@opendaw/studio-core 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExternalLib.d.ts +3 -2
- package/dist/ExternalLib.d.ts.map +1 -1
- package/dist/ExternalLib.js +2 -2
- package/dist/Preferences.d.ts +4 -0
- package/dist/Preferences.d.ts.map +1 -1
- package/dist/Preferences.js +4 -2
- package/dist/capture/CaptureDevices.js +1 -1
- package/dist/capture/RecordAudio.d.ts.map +1 -1
- package/dist/capture/RecordAudio.js +17 -9
- package/dist/dawproject/BuiltinDevices.d.ts +1 -1
- package/dist/dawproject/DawProject.d.ts.map +1 -1
- package/dist/dawproject/DawProject.js +17 -3
- package/dist/midi/MIDILearning.d.ts +4 -16
- package/dist/midi/MIDILearning.d.ts.map +1 -1
- package/dist/midi/MIDILearning.js +95 -62
- package/dist/processors.js +17 -17
- package/dist/processors.js.map +4 -4
- package/dist/project/Project.d.ts.map +1 -1
- package/dist/project/Project.js +1 -0
- package/dist/project/ProjectBundle.d.ts.map +1 -1
- package/dist/project/ProjectBundle.js +17 -3
- package/dist/project/ProjectMigration.d.ts.map +1 -1
- package/dist/project/ProjectMigration.js +4 -3
- package/dist/project/ProjectValidation.d.ts.map +1 -1
- package/dist/project/ProjectValidation.js +15 -13
- package/dist/project/audio/AudioContentFactory.d.ts.map +1 -1
- package/dist/project/audio/AudioContentFactory.js +3 -3
- package/dist/project/audio/AudioContentModifier.d.ts.map +1 -1
- package/dist/project/audio/AudioContentModifier.js +0 -1
- package/dist/project/audio/AudioFileBoxFactory.d.ts.map +1 -1
- package/dist/project/audio/AudioFileBoxFactory.js +5 -0
- package/dist/samples/DefaultSampleLoaderManager.d.ts.map +1 -1
- package/dist/samples/DefaultSampleLoaderManager.js +4 -1
- package/dist/soundfont/DefaultSoundfontLoader.d.ts.map +1 -1
- package/dist/soundfont/DefaultSoundfontLoader.js +8 -7
- package/dist/soundfont/SoundfontService.d.ts.map +1 -1
- package/dist/soundfont/SoundfontService.js +3 -6
- package/dist/workers-main.js +1 -1
- package/dist/workers-main.js.map +2 -2
- package/package.json +15 -15
package/dist/processors.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var vB=Object.defineProperty;var Da=(r,e)=>{for(var t in e)vB(r,t,{get:e[t],enumerable:!0})};var Xs=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#l;#s=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new Lh(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=Dc.create(Dc.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#l=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#l.fill(0),this.#s=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#l}process(e,t,i,n){for(let o=i;o<n;++o)this.#i[this.#s]=e[o]+t[o],++this.#s===this.#e&&this.#u()}#u(){for(let t=0;t<this.#t;++t)this.#l[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 i=this.#i[t],n=this.#n[t],o=Math.sqrt(i*i+n*n)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=r.DECAY)}this.#s=0,this.#n.fill(0),this.decay=!1}};var Ic=r=>r,Z=r=>r!=null,Ia=r=>r===null,At=r=>r!==null,el=r=>r===void 0,Ca=r=>r!==void 0,vP=r=>r==null,bx=(r,e)=>r!=null?e(r):void 0,ee=(r,e="asDefined failed")=>r??F(nn(e)),Ie=(r,e)=>r instanceof e,Ne=(r,e)=>r instanceof e?r:F(`${r} is not instance of ${e}`),Ax=(r,e)=>{r instanceof e||F(`${r} is not instance of ${e}`)};var nn=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),Kh=r=>Z(r)&&typeof r=="object";var Wh=r=>{throw new Error(`Unhandled ${r}`)},F=r=>{throw typeof r=="string"?new Error(r):r},I=(r,e)=>r?void 0:F(nn(e));var Ta=r=>new Proxy({},{get(){return F(r)}});var xx=class{value;status="success";constructor(e){this.value=e}error=Ta("Cannot access error when succeeded")},wx=class{error;status="failure";constructor(e){this.error=e}value=Ta("Cannot access value when failed")},Un=r=>{try{return new xx(r())}catch(e){return new wx(e)}};var Jr=(r,e)=>Object.keys(e).length===0?F("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(n=>isNaN(Number(n))).map(n=>e[n]).includes(r)?r:F(`Invalid enum value: ${String(r)}`),jn=()=>{};var _x;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(_x||(_x={}));var R=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 i=0;i<e.length;)t(e[i])?e.splice(i,1):i++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>ee(e.at(0),t);static getLast=(e,t)=>ee(e.at(-1),t);static getPrev=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):ee(e.at((i-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):ee(e.at((i+1)%e.length),"Internal Error")};static removeLast=(e,t)=>ee(e.pop(),t);static create=(e,t)=>{let i=new Array(t);for(let n=0;n<t;n++)i[n]=e(n);return i};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++)if(!t(i,e[n]))return!1;return!0};static remove=(e,t)=>{let i=e.indexOf(t);if(i===-1)return F(`${t} not found in ${e}`);e.splice(i,1)};static removeIf=(e,t)=>{for(let i=e.length-1;i>=0;i--)t(e[i])&&e.splice(i,1)};static removeOpt=(e,t)=>{let i=e.indexOf(t);return i===-1?!1:(e.splice(i,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,i=new Set;for(let n of e)i.has(n)||(i.add(n),e[t++]=n);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let i=0,n=new Set;for(let o of e){let a=o[t];n.has(a)||(n.add(a),e[i++]=o)}return e.length=i,e};static subtract(e,t,i){return e.filter(n=>!t.some(o=>i(n,o)))}static intersect(e,t,i){return e.filter(n=>t.some(o=>i(n,o)))}static merge(e,t,i){return[...e.filter(n=>!t.some(o=>i(n,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 i=0;i<=t;i++)yield{value:e[i],isFirst:i===0,isLast:i===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,i=e[0];t<e.length;t++){let n=e[t];yield[i,n],i=n}}static isSorted(e,t=_x.Ascending){if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++){let o=e[n];if(Math.sign(i-o)===t)return!1;i=o}return!0}static toRecord(e,t){return e.reduce((i,n)=>(i[t(n)]=n,i),{})}static concatArrayBuffers(e,t){let i=new ArrayBuffer(e.byteLength+t.byteLength),n=new Uint8Array(i);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),i}};var g;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...i)=>r.wrap(t?.apply(null,i)),r.async=t=>t.then(i=>r.wrap(i),()=>r.None);class e{#e;constructor(i){this.#e=ee(i)}unwrap(){return this.#e}unwrapOrElse(i){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(i){return i===this.#e}match(i){return i.some(this.#e)}ifSome(i){return i(this.#e)}ifAbsent(i){}isEmpty(){return!1}nonEmpty(){return!0}map(i){return r.wrap(i(this.#e))}mapOr(i,n){return i(this.#e)}flatMap(i){return i(this.#e)}equals(i){return this.unwrapOrNull()===i.unwrapOrNull()}assert(i){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>F(Z(t)?nn(t):"unwrap failed");unwrapOrElse=t=>nn(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,i)=>nn(i);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>F(nn(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(g||(g={}));var Ln;(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=()=>g.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(i){return r.err(i)}};mapOr=(t,i)=>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=()=>g.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=()=>g.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>F(`'${this.reason}'`);map=()=>this;mapOr=(t,i)=>nn(i);unwrapOrElse=t=>nn(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)})(Ln||(Ln={}));var Ye;(function(r){r.exact=(e,t,i)=>{let n=0,o=e.length-1;for(;n<=o;){let a=n+o>>>1,s=i(e[a],t);if(s===0)return a;s<0?n=a+1:o=a-1}return-1},r.exactMapped=(e,t,i,n)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,l=i(n(e[s]),t);if(l===0)return s;l<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}return n},r.rightMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<=0?n=a+1:o=a}return o-1},r.stableInsert=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}for(;n<e.length&&i(e[n],t)===0;)n++;return n},r.leftMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,i,n)=>[r.leftMostMapped(e,t,i,n),r.rightMostMapped(e,t,i,n)]})(Ye||(Ye={}));var rt=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,i=1<<e-(t<<5);return(this.#t[t]&i)!==0}setBit(e,t){let i=e>>>5,n=1<<e-(i<<5),o=this.#t[i],a=t?o|n:o&~n;return a===o?!1:(this.#t[i]=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),i=!1;for(let n=0;n<t.length;n++)this.#t[n]!==t[n]&&(this.#t[n]=t[n],i=!0);return i}toString(){let e="";for(let t of R.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Zh=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 _t=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(i=>!isNaN(i))){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,i){let n=l=>(l+e/30)%12,o=t*Math.min(i,1-i),a=l=>i-o*Math.max(-1,Math.min(n(l)-3,Math.min(9-n(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,i=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(i,n,o),s=Math.min(i,n,o),l=(a+s)/2,c=0,p=0;if(a!==s){let d=a-s;switch(p=l>.5?d/(2-a-s):d/(a+s),a){case i:c=((n-o)/d+(n<o?6:0))*60;break;case n:c=((o-i)/d+2)*60;break;case o:c=((i-n)/d+4)*60;break}}return{h:c,s:p,l}}static hslStringToHex(e){let[t,i,n]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,i/100,n/100)}#e;#t;#r;#i;constructor(e,t,i,n=1){this.#e=e,this.#t=t,this.#r=i,this.#i=n}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)),i=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,i,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Cc=(r,e)=>r-e;var Mi=Math.PI*2,EM=Math.PI/2,Px=Math.PI/4,BM=1/Math.sqrt(2),le=(r,e,t)=>Math.max(e,Math.min(r,t)),Qr=r=>Math.max(0,Math.min(r,1)),yP=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Kn=(r,e)=>Math.floor(r/e)*e;var Gh=(r,e,t)=>r+(e-r)*t,xP=(r,e,t)=>r*Math.pow(e/r,t);var Tc=(r,e)=>yB(r/e)*e,yB=r=>r-Math.floor(r),_o=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Sx=(r,e)=>r*e/((2*e-1)*(r-1)+e);var Yr;(function(r){r.valueAt=({slope:n,steps:o,y0:a,y1:s},l)=>r.normalizedAt(l/o,n)*(s-a)+a,r.normalizedAt=(n,o)=>{if(o>.499999&&o<.500001)return n;{let a=le(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*n)-1)}},r.inverseAt=(n,o)=>{let a=le(o,1e-15,.999999999999999);return Math.log(n*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=n=>{let o=r.valueAt(n,1),s=(r.valueAt(n,2)-o)/(o-n.y0),l=o-s*n.y0;return{m:s,q:l}};function*t(n,o,a,s){let{m:l,q:c}=r.coefficients({slope:n,steps:o,y0:a,y1:s});for(let p=0,d=a;p<o;p++)yield d=l*d+c}r.walk=t;function*i(n,o){let a=1/o,s=r.normalizedAt(a,n),c=(r.normalizedAt(2*a,n)-s)/s;for(let p=0,d=0;p<o;p++)yield d=c*d+s}r.walkNormalized=i,r.byHalf=(n,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:n,y0:o,y1:s}),r.slopeByHalf=(n,o,a)=>Math.abs(a-n)<1e-6?.5:(o-n)/(a-n)})(Yr||(Yr={}));var on=new DataView(new ArrayBuffer(8)),nr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(on.setInt8(0,e),on.getInt8(0)),r.toShort=e=>(on.setInt16(0,e),on.getInt16(0)),r.toInt=e=>(on.setInt32(0,e),on.getInt32(0))})(nr||(nr={}));var Wn;(function(r){let i=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(i),o=new Int32Array(i);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&s&8388607?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,n[0]),r.floatToRawIntBits=a=>(n[0]=a,o[0]),r.toFloat32=a=>(on.setFloat32(0,a),on.getFloat32(0))})(Wn||(Wn={}));var wP;(function(r){r.floatToIntBits=e=>{let t=Wn.floatToIntBits(e),i=t>>>16&32768,n=(t&2147483647)+4096;return n>=1199570944?(t&2147483647)>=1199570944?n<2139095040?i|31744:i|31744|(t&8388607)>>>13:i|31743:n>=947912704?i|n-939524096>>>13:n<855638016?i:(n=(t&2147483647)>>>23,i|(t&8388607|8388608)+(8388608>>>n-102)>>>126-n)},r.intBitsToFloat=e=>{let t=e&1023,i=e&31744;if(i===31744)i=261120;else if(i!==0){if(i+=114688,t===0&&i>115712)return Wn.intBitsToFloat((e&32768)<<16|i<<13|1023)}else if(t!==0){i=115712;do t<<=1,i-=1024;while(!(t&1024));t&=1023}return Wn.intBitsToFloat((e&32768)<<16|(i|t)<<13)}})(wP||(wP={}));var qh;(function(r){let e=9218868437227405312n,t=4503599627370495n,i=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),n=new Float64Array(i),o=new BigInt64Array(i);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,n[0]),r.float64ToRawLongBits=a=>(n[0]=a,o[0]),r.clamp=a=>(on.setFloat64(0,a),on.getFloat64(0))})(qh||(qh={}));var Xe=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let i of e)t++;return t}static some(e,t){for(let i of e)if(t(i))return!0;return!1}static every(e,t){for(let i of e)if(!t(i))return!1;return!0}static reduce(e,t,i){let n=i,o=0;for(let a of e)n=t(n,a,o++);return n}static includes(e,t){for(let i of e)if(i===t)return!0;return!1}static forEach(e,t){for(let i of e)t(i)}static*map(e,t){let i=0;for(let n of e)yield t(n,i++)}static*take(e,t){let i=0;for(let n of e){if(i++>=t)return;yield n}}static filter(e,t){let i=[];for(let n of e)t(n)&&i.push(n);return i}static filterMap(e,t){let i=[];for(let n of e){let o=t(n);Z(o)&&i.push(o)}return i}static reverse(e){let t=[];for(let i of e)t.push(i);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:i,value:n}=t.next(),o=n;if(i!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var $t=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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 i=0;i<t;i++)this.writeShort(e.charCodeAt(i))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let i=this.#e;this.#e=new DataView(new ArrayBuffer(_o(t+e)));for(let n=0;n<this.#t;n++)this.#e.setInt8(n,i.getInt8(n))}}},tl=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}},Hh=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,i)=>e.#e[i]===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(Wn.floatToIntBits(e))}writeDouble(e){this.writeLong(qh.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(Xe.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},lt=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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 i=0;i<e;i++)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 xB=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":F(`Cannot resolve method key of ${r}`):F("Cannot resolve method key of undefined descriptor"),rl=(r,e,t)=>{if(!Z(t))return function(o,a){if(a&&a.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!Z(s?.get))return F(`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 i=xB(t),n=ee(t[i]);return{[i]:function(...o){if(o.length>0)return F("lazy accessory must not have any construction parameters");let a=n.apply(this);return Object.defineProperty(this,e,{value:i==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var Zn;(function(r){function*e(){}r.empty=e,r.next=i=>{let{value:n,done:o}=i.next();return o?null:n};function*t(...i){for(let n of i)for(let o of n)yield o}r.flatten=t})(Zn||(Zn={}));var Rc;(function(r){r.intersect1D=(e,t,i,n)=>Math.max(e,i)<=Math.min(t,n)})(Rc||(Rc={}));var Mt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...i)=>this.#e.forEach(n=>Object.getPrototypeOf(n)===Object.getPrototypeOf({})?_(n[t],...i):n[t]?.apply(n,i))})}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 bP=(r,...e)=>new Proxy([],{get(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0&&Number.isInteger(n))return new r(...e)}return i===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[i]},has(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0)return!0}return i in t}});var Ra=class{static createIfAbsent(e,t,i){let n=e.get(t);return n===void 0&&(n=i(t),e.set(t,n)),n}};var Oc=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Jh=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=g.wrap(t),this.#t.ifSome(i=>Array.from(this.#e.values()).forEach(n=>n.sort(i)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Xe.some(this.#e.entries(),i=>e===i[0]&&i[1].includes(t))}containsKey(e){return Xe.includes(this.#e.keys(),e)}containsValue(e){return Xe.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??R.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let i=Ra.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())i.push(t);else{let n=Ye.stableInsert(i,t,this.#t.unwrap());i.splice(n,0,t)}}addAll(e,t){let i=Ra.createIfAbsent(this.#e,e,()=>[]);i.push(...t),this.#t.nonEmpty()&&i.sort(this.#t.unwrap())}remove(e,t){let i=this.#e.get(e);if(i===void 0)return!1;{let n=i.indexOf(t);return n===-1?!1:(i.splice(n,1),i.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let i=this.#e.get(e);if(i===void 0)return null;{let n=i.findIndex(t);if(n===-1)return null;{let o=i.splice(n,1)[0];return i.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[i,n]of this.#e.entries())for(let o of n.filter(a=>e(a)))t.push([i,o]);for(let[i,n]of t)this.remove(i,n);return new Set(t.map(([,i])=>i))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??R.empty()}forEach(e){Xe.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(),i=Array.from(this.keys()).sort(e);this.#e.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.#e.forEach((t,i)=>{e.#e.set(i,t.map(n=>n))}),e}},il=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let i=t[0],n=t[1];return[i,new Set(n)]}))}clear(){this.map.clear()}containsEntry(e,t){return Xe.some(this.map.entries(),i=>e===i[0]&&i[1].has(t))}containsKey(e){return Xe.includes(this.map.keys(),e)}containsValue(e){return Xe.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Oc.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Ra.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let i=Ra.createIfAbsent(this.map,e,()=>new Set);for(let n of t)i.add(n)}remove(e,t){let i=this.map.get(e);return i===void 0?!1:i.delete(t)?(i.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[i,n]of this.map.entries()){for(let o of n)e(o)&&(n.delete(o),t.add(o));n.size===0&&this.map.delete(i)}return t}removeFromKeyIf(e,t){let i=this.map.get(e);if(i===void 0)return null;for(let n of i)if(t(n))return i.delete(n),i.size===0&&this.map.delete(e),n;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Oc.empty()}forEach(e){Xe.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(),i=Array.from(this.keys()).sort(e);this.map.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.map.forEach((t,i)=>{e.map.set(i,new Set(Array.from(t)))}),e}};var K=Object.freeze({Empty:{terminate:jn},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),U=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:()=>R.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var re=class{static subscribeMany(e,...t){return K.many(...t.map(i=>i.subscribe(()=>e(i))))}#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 Ir;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,i)=>{let n=new Set(Object.keys(t));for(let o of Object.keys(i))if(n.has(o))return F(`'${o}' is an overlapping key`);return{...t,...i}},r.include=(t,...i)=>{let n={};for(let o of i)n[o]=t[o];return n},r.exclude=(t,...i)=>{let n=new Set(i);return Object.entries(t).reduce((o,[a,s])=>(n.has(a)||(o[a]=s),o),{})},r.overwrite=(t,i)=>Object.assign(t,i)})(Ir||(Ir={}));var AP;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return K.Empty}catchupAndSubscribe(t){return t(this),K.Empty}}})(AP||(AP={}));var _P;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return K.Empty}catchupAndSubscribe(e){return e(this),K.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)}}})(_P||(_P={}));var Xr=class{#e;#t=g.None;constructor(e){this.#e=new re,this.wrap(e)}wrap(e){this.wrapOption(g.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(Z(e)&&e(this.#t.unwrap()),this.#t=g.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 Cr=class{#e;#t=g.None;#r;constructor(e,t){this.#e=new re,this.#r=t?.guard(e)??e,this.#t=g.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 Ex=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+le(e,0,1)*this.#r}clamp(e){return le(e,this.#e,this.#t)}floating(){return!0}},Bx=class{#e;#t;#r;constructor(e,t){this.#e=le(Math.round(e),nr.MIN_VALUE,nr.MAX_VALUE),this.#t=le(Math.round(t),nr.MIN_VALUE,nr.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(le(e,0,1)*this.#r)}clamp(e){return le(Math.round(e),this.#e,this.#t)}floating(){return!1}},Fx=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(le(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(le(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Nx=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(i=>i===e);return t===-1?F(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(le(e,0,1)*(this.#e.length-1));return t>-1?ee(this.#e.at(t),`Could not find value for ${e}`):F(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},kx=class{#e;#t;#r;#i;#n;constructor(e,t,i){this.#e=e,this.#t=i;let n=e*e,o=i*i,a=t*t,s=e+i-2*t,l=i-t;this.#r=((2*i-t)*e-t*i)/s,this.#i=(l*n+(a-o)*e+t*o-a*i)/(n+(2*i-4*t)*e+o-4*t*i+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}},S;(function(r){r.linear=(o,a)=>new Ex(o,a),r.linearInteger=(o,a)=>new Bx(o,a),r.exponential=(o,a)=>new Fx(o,a),r.values=o=>new Nx(o),r.decibel=(o,a,s)=>new kx(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),i=r.linear(-1,1);r.bool=e;let n=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>i,r.DefaultDecibel=n})(S||(S={}));var P;(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 c=s.indexOf(l);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:a[c]}}},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,c){this.#e=a??"",this.#t=s??0,this.#r=l??!1,this.#i=c??!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?le(l/200+.5,0,1):le(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(Z(d)){let f=t.indexOf(d);if(f>-1)return{type:"explicit",value:l*Math.pow(10,(f-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}=n(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"]),i=o=>Math.log(o)/Math.log(9.999999999999998),n=o=>{let a=Math.floor(i(o)/3),s=t[a+4];return Z(s)?{value:o*Math.pow(10,a*-3),prefix:s}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(P||(P={}));var Po;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(Po||(Po={}));var nl;(function(r){r.create=(e=252854082)=>new $x(e),r.monotoneAscending=(e,t=128,i=r.create())=>{let n=e.length;if(n<2)return F("Array must have at least 2 elements");let o=0;for(let s=1;s<n;s++){let l=Math.floor(i.uniform()*(1+t))+1;e[s]=l,o+=l}let a=0;e[0]=0;for(let s=1;s<n;s++)a+=e[s],e[s]=a/o;return e}})(nl||(nl={}));var $x=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=i=>{let n=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]=n(l))}),a};return()=>new t(i,Object.seal(n(i)))},r.bool=new class extends e{read(i){return i.readByte()===1}write(i,n){i.writeByte(n?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(i){return i.readByte()}write(i,n){i.writeByte(n)}initialValue(){return 0}},r.int16=new class extends e{read(i){return i.readShort()}write(i,n){i.writeShort(n)}initialValue(){return 0}},r.int32=new class extends e{read(i){return i.readInt()}write(i,n){i.writeInt(n)}initialValue(){return 0}},r.float=new class extends e{read(i){return i.readFloat()}write(i,n){i.writeFloat(n)}initialValue(){return 0}},r.double=new class extends e{read(i){return i.readDouble()}write(i,n){i.writeDouble(n)}initialValue(){return 0}},r.int64=new class extends e{read(i){return i.readLong()}write(i,n){i.writeLong(n)}initialValue(){return 0n}},r.floats=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readFloat();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeFloat(o[a])}initialValue(){return new Float32Array(i)}},r.doubles=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readDouble();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeDouble(o[a])}initialValue(){return new Float64Array(i)}};class t{#e;#t;#r;constructor(n,o){this.#e=n,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(n){let o=(a,s)=>{Object.entries(a).forEach(([l,c])=>{let p=s;c instanceof e?p[l]=c.read(n,p[l]):typeof c=="object"&&o(c,p[l])})};o(this.#e,this.#t)}write(n){let o=(a,s)=>{Object.entries(a).forEach(([l,c])=>{let p=s;c instanceof e?c.write(n,p[l]):typeof c=="object"&&o(c,p[l])})};o(this.#e,this.#t)}#i(){let n=new tl;return this.write(n),n.count}}})(yr||(yr={}));var ol=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let i=this.#e(e),n=Ye.leftMostMapped(this.#r,i,this.#t,this.#e),o=this.#r[n];return Z(o)&&this.#t(this.#e(o),i)===0?t?(this.#r.splice(n,1,e),!0):!1:(this.#r.splice(n,0,e),!0)}getOrCreate(e,t){let i=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[i];if(Z(n)&&this.#t(this.#e(n),e)===0)return n;let o=t(e);return this.#r.splice(i,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,i)=>{let n=this.#t(this.#e(t),this.#e(i));if(n===0)throw"cancel";return n}),!0}catch(t){if(t==="cancel"){let i=new Map(this.entries());return this.#r.splice(0,this.#r.length,...i.values()),this.#r.sort((n,o)=>this.#t(this.#e(n),this.#e(o))),!1}return F(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):F(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,i=this.#r.length;for(;--i>=0;)e(this.#r[i])&&(this.#r.splice(i,1),t++);return t}get(e){return ee(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let i=this.#i(e);if(Z(i))return i;throw t()}opt(e){return g.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return Z(this.#i(e))}hasValue(e){return Z(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(){R.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?i:void 0}};var al=(()=>{let r=g.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:jn}),some:t=>t.progress(e)}),install:e=>{I(r.isEmpty(),"RuntimeNotification already installed"),r=g.wrap(e)}}})();var Vc=class r{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#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,i=Math.floor(Math.abs(this.#n)/1e3),n=Math.floor(i/60),o=Math.floor(n/60),a=Math.floor(o/24);return i<60?(e=i,t="second"):n<60?(e=n,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:i,s:n}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):t>0?[r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):i>0?[r.#o("m",i),r.#o("s",n)].join(", "):n>0?r.#o("s",n):"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 Wh(e)}}};var sl;(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,i,n)=>{if(t.bytesTotal+1>i.byteLength)return F("Insufficient memory allocated.");let o=new Uint8Array(i),a=$t.use(i,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(n(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,i)=>{let n=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(n),a=new lt(n,1);return{buffer:n,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),i(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(sl||(sl={}));var w;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(t.slice(0)):t).then(n=>e(new Uint8Array(n.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:F(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let i=new Uint8Array(r.length);return t.readBytes(new Int8Array(i.buffer)),i},r.toDataOutput=(t,i)=>t.writeBytes(new Int8Array(i.buffer)),r.toString=t=>{let i=R.create(n=>(n+256).toString(16).substring(1),256);return i[t[0]]+i[t[1]]+i[t[2]]+i[t[3]]+"-"+i[t[4]]+i[t[5]]+"-"+i[t[6]]+i[t[7]]+"-"+i[t[8]]+i[t[9]]+"-"+i[t[10]]+i[t[11]]+i[t[12]]+i[t[13]]+i[t[14]]+i[t[15]]},r.parse=t=>{let i=t.replace(/-/g,"").toLowerCase();if(i.length!==32)return F("Invalid UUID format");let n=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)n[a]=parseInt(i.slice(o,o+2),16);return n},r.Comparator=(t,i)=>{if(t.length!==r.length||i.length!==r.length)return F("Unexpected array length for uuid(v4)");for(let n=0;n<r.length;n++){let o=t[n]-i[n];if(o!==0)return o}return 0},r.equals=(t,i)=>r.Comparator(t,i)===0,r.newSet=t=>new ol(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 i=new Uint8Array(r.Lowest),n=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)i[o]=n[o];return i},r.zType=t=>t.string().refine(i=>r.validateString(i),{message:"Invalid UUID format"}).transform(i=>i);let e=t=>(I(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(w||(w={}));var ve=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=R.create(()=>new Float32Array(128),e)}clear(e,t){this.#e.forEach(i=>i.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){I(!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){I(e.length===2,"mixLayout: target.length must be 2"),I(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){I(e.length===2,"mixLayout: target.length must be 2"),I(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,i]=e;if(this.#e.length===1){let[n]=this.#e;for(let o=0;o<128;o++)t[o]+=n[o],i[o]+=n[o]}else{let[n,o]=this.#e;for(let a=0;a<128;a++)t[a]+=n[a],i[a]+=o[a]}}};var ut;(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"})(ut||(ut={}));var ll=class{#e;#t=ut.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==ut.Idle&&this.#t!==ut.Release}get complete(){return this.#t===ut.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,i,n){this.#n=e,this.#o=t,this.#a=i,this.#l=n,this.#d()}#d(){switch(this.#t){case ut.Attack:{let e=1-this.#r;this.#s=e*this.#e/Math.max(this.#n,1e-6);break}case ut.Decay:{let e=this.#r-this.#a;this.#u=e*this.#e/Math.max(this.#o,1e-6);break}case ut.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#l,1e-6);break}case ut.Sustain:case ut.Idle:{this.#s=this.#e/Math.max(this.#n,1e-6),this.#u=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#c=this.#a*this.#e/Math.max(this.#l,1e-6);break}}}gateOn(){this.#t=ut.Attack}gateOff(){this.#t!==ut.Idle&&(this.#t=ut.Release,this.#d())}forceStop(){this.#t=ut.Idle,this.#r=0}process(e,t,i){for(let n=t;n<i;)switch(this.#t){case ut.Attack:for(;n<i;){if(this.#r+=this.#s,this.#r>=1){this.#r=1,this.#i=1,e[n++]=this.#r,this.#t=ut.Decay,this.#d();break}e[n++]=this.#i=this.#r}break;case ut.Decay:for(;n<i;){if(this.#r-=this.#u,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[n++]=this.#r,this.#t=ut.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#a),e[n++]=this.#r}break;case ut.Sustain:e.fill(this.#a,n,i);return;case ut.Release:for(;n<i;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[n++]=this.#r,this.#t=ut.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#a),e[n++]=this.#r}break;case ut.Idle:e.fill(0,n,i);return}}};var an=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=le(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=Mi*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1-o)/2,s=a,l=2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,c,p,d,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=le(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let i=Mi*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1+o)/2,s=a,l=-2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,c,p,d,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,i,n,o,a){let s=1/n;return this.b0=e*s,this.b1=t*s,this.b2=i*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=le(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(i*i,0,0,1,0,0);else if(e>0){let n=Mi*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c-p*s+l),f=2*i*(p-c*s),v=i*(c-p*s-l),m=c+p*s+l,y=-2*(p+c*s),x=c+p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=le(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=Mi*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c+p*s+l),f=-2*i*(p+c*s),v=i*(c+p*s-l),m=c-p*s+l,y=2*(p-c*s),x=c-p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);return this}setPeakingParams(e,t,i){e=le(e,0,1),t=Math.max(0,t);let n=Math.pow(10,i/40);if(e>0&&e<1)if(t>0){let o=Mi*e,a=Math.sin(o)/(2*t),s=Math.cos(o),l=1+a*n,c=-2*s,p=1-a*n,d=1+a/n,f=-2*s,v=1-a/n;this.setNormalizedCoefficients(l,c,p,d,f,v)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=le(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=Mi*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1-n,s=-2*o,l=1+n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,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=le(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=Mi*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1,s=-2*o,l=1,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,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 i=Mi*e;if(t>0){let n=Math.sin(i)/(2*t),o=Math.cos(i),a=n,s=0,l=-n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,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,i){I(e.length===t.length&&e.length===i.length,"Array lengths do not match");let n=this.b0,o=this.b1,a=this.b2,s=this.a1,l=this.a2;for(let c=0;c<e.length;++c){let p=-Math.PI*2*e[c],d=Math.cos(p),f=Math.sin(p),v=n+((o+a*d)*d-a*f*f),m=(o+a*d)*f+a*f*d,y=1+((s+l*d)*d-l*f*f),x=(s+l*d)*f+l*f*d,D=y*y+x*x,M=(v*y+m*x)/D,O=(m*y-v*x)/D;t[c]=Math.sqrt(M*M+O*O),i[c]=Math.atan2(O,M)}}};var Pt=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:i,b1:n,b2:o},a,s,l,c){let p=this.#e,d=this.#t,f=this.#r,v=this.#i;for(let m=l;m<c;m++){let y=a[m],x=s[m]=i*y+n*p+o*d-e*f-t*v+1e-18-1e-18;d=p,p=y,v=f,f=x}this.#e=p,this.#t=d,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:i,b1:n,b2:o},a){let s=i*a+n*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}},So=class{#e;#t;constructor(e){this.#e=R.create(()=>new Pt,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,i,n,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,i,n,o),t=i}processFrame(e,t){for(let i=0;i<this.#t;i++)t=this.#e[i].processFrame(e,t);return t}},zc=512,Qh=class{#e;#t=new an;#r;#i=-1;constructor(e,t,i){this.#r=new So(4),this.#e=new Float32Array(zc+1);let n=Math.log(t/e),o=1/i;for(let a=0;a<=zc;a++)this.#e[a]=e*Math.exp(a/zc*n)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,i,n,o,a){let s=this.#e,l=this.#r,c=this.#t,p=n/l.order**1.25,d=o,f=this.#i;for(;d<a;){let v=Math.floor(Qr(i[d])*zc),m=d+1;for(;m<a&&Math.floor(Qr(i[m])*zc)===v;)++m;v!==f&&(f=v,c.setLowpassParams(s[v],p)),l.process(c,e,t,d,m),d=m}this.#i=f}};var PP=Math.log(10)/20,Uc=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Oe=r=>Math.exp(r*PP),Mx=r=>Math.log(r)/PP,ul=r=>Oe(20*Math.log10(r));var wB=.02,SP=1e3,Yh=class{#e;#t;#r;#i;#n;#o;#a=NaN;#l=NaN;#s=0;#u=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*wB)|0,this.#r=new an,this.#r.setLowpassParams(.5),this.#i=[new Pt,new Pt],this.#n=[new Float32Array(128),new Float32Array(128)],this.#o=new Float32Array(2)}process(e,t,i,n){let[o,a]=e,[s,l]=t,[c,p]=this.#n;this.#i[0].process(this.#r,o,c,i,n),this.#i[1].process(this.#r,a,p,i,n);let d=Oe(this.#p),f=Oe(-this.#p/2),v=this.#e/this.#a,m=Math.pow(2,this.#d)-1,y=1/m;for(let x=i;x<n;x++)this.#u>0&&(this.#a+=this.#s,--this.#u===0&&(this.#s=0,this.#a=this.#l),this.#r.setLowpassParams(Math.max(this.#a,SP)/this.#e)),this.#c+=1,this.#c>=v&&(this.#c-=v,this.#o[0]=le(Math.round(c[x]*d*m)*y,-1,1),this.#o[1]=le(Math.round(p[x]*d*m)*y,-1,1)),s[x]=(o[x]*(1-this.#h)+this.#o[0]*this.#h)*f,l[x]=(a[x]*(1-this.#h)+this.#o[1]*this.#h)*f;this.#f=!0}setCrush(e){let t=xP(20,this.#e*.5,e);this.#f&&isFinite(this.#a)?(this.#l=t,this.#s=(t-this.#a)/this.#t,this.#u=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,SP)/this.#e))}setBitDepth(e){this.#d=le(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=Qr(e)}reset(){this.#f=!1,this.#l=NaN,this.#s=0,this.#u=0,this.#c=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Xh=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,i){this.#t=e,this.#r=t*r.#e,this.#i=Gh(1e-5,1-1e-5,i),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),i,n,o,a;return this.#r<0?(i=1-t,n=1-this.#i,o=this.#a,a=this.#o):(i=t,n=this.#i,o=this.#o,a=this.#a),i<=n?1-(1-i*o)**this.#n*this.#t:((1-i)*a)**this.#n*this.#t-this.#t+1}};var jc;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(jc||(jc={}));var Oa;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Oa||(Oa={}));var qt;(function(r){r.globalToLocal=(t,i)=>Tc(i-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:i,loopOffset:n,loopDuration:o},a,s)=>{let l=t-n,c=l+o;if(l>=s||c<=a)return g.None;let p=Math.max(l,a),d=Math.min(c,s);return g.wrap({index:0,rawStart:l,rawEnd:c,regionStart:Math.max(l,t),regionEnd:Math.min(c,i),resultStart:p,resultEnd:d,resultStartValue:l<p?(p-l)/o:0,resultEndValue:c>d?(d-l)/o:1})};function*e({position:t,complete:i,loopOffset:n,loopDuration:o},a,s){let l=t-n,c=Math.max(t,a),p=Math.min(i,s),d=Math.floor((c-l)/o),f=l+d*o;for(;f<p;){let v=f+o,m=Math.max(f,t),y=Math.min(v,i),x=Math.max(f,c),D=Math.min(v,p),M=f<x?(x-f)/o:0,O=v>D?(D-f)/o:1;yield{index:d++,rawStart:f,rawEnd:v,regionStart:m,regionEnd:y,resultStart:x,resultEnd:D,resultStartValue:M,resultEndValue:O},f=v}}r.locateLoops=e})(qt||(qt={}));var xr=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 ef(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()?Zn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,i){return this.#e.isEmpty()?Zn.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,i)}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()}},Eo=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 ef(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()?Zn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return Zn.empty();let i=Math.max(0,this.#e.floorLastIndex(e)),n=this.#e.optAt(i);if(n===null)return Zn.empty();for(;n.position+n.duration<=e;)if(n=this.#e.optAt(++i),n===null||n.position>=t)return Zn.empty();return this.#e.iterate(i,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},cl=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=Ye.leftMost(this.#e,e,Oa.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let i=this.#e.filter(n=>n.position<=e&&e<n.position+n.duration);yield*Z(t)?i.sort(t):i}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let i=this.#e[t];if(Oa.complete(i)<e)this.#e.splice(t,1),yield i;else return}}*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(){R.clear(this.#e)}},ef=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(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 i=e.position,n=Ye.leftMostMapped(this.#e,i,Cc,jc.PositionExtractor);for(let o=n;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==i)return!1}return!1}clear(){++this.modCount,R.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 i=this.floorLastIndex(e);for(;i>=0;){let n=this.#e[i--];if(t(n))return n}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let i=this.ceilFirstIndex(e);for(;i<this.#e.length;){let n=this.#e[i++];if(t(n))return n}return null}floorLastIndex(e){return this.#t&&this.#r(),Ye.rightMostMapped(this.#e,e,Cc,jc.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),Ye.leftMostMapped(this.#e,e,Cc,jc.PositionExtractor)}iterateFrom(e,t){let i=this.floorLastIndex(e),n=i;if(n<0)return this.iterate(0,nr.MAX_VALUE,t);for(;n>=0;){let o=this.optAt(n);if(o!==null&&t!==void 0&&t(o))return this.iterate(n,nr.MAX_VALUE,t);n--}return this.iterate(i,nr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,i=Po.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let n=this.#e[e++];if(n.position>=t)return;i(n)&&(yield n)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Lh=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 i=0;i<t;i++){let n=2*Math.PI*i/e;this.#r[i]=Math.cos(n),this.#i[i]=Math.sin(n)}}process(e,t){let i,n,o,a;for(let c=0;c<this.#e;++c)n=r.reverse(c)>>>this.#t,n>c&&(a=e[c],e[c]=e[n],e[n]=a,a=t[c],t[c]=t[n],t[n]=a);let s=this.#r,l=this.#i;for(let c=2;c<=this.#e;c<<=1){let p=c>>1,d=this.#e/c;for(i=0;i<this.#e;i+=c){let f=i+p;for(n=i,o=0;n<f;n++,o=o+d|0){let v=n+p|0,m=s[o],y=l[o],x=e[v],D=t[v],M=x*m+D*y,O=D*m-x*y,T=e[n],V=t[n];e[v]=T-M,t[v]=V-O,e[n]=T+M,t[n]=V+O}}if(c===this.#e)break}}};var Dx=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var Ix=(r,e)=>Math.floor(3840/e)*r,EP=(r,e=4,t=4)=>{let i=Ix(1,t),n=Math.floor(r/i),o=Math.floor(n/e),s=(Math.floor(r)-Ix(o*e,t))%i,l=Math.floor(s/240),c=s%240;return{bars:o,beats:n-o*e,semiquavers:l,ticks:c}},BP=(r,e)=>r*e/60*960,FP=(r,e)=>r*60/960/e,bB=(r,e)=>e*60/960/r,AB=(r,e,t)=>BP(r/t,e),_B=(r,e,t)=>FP(r,e)*t,Q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Ix,toParts:EP,secondsToPulses:BP,pulsesToSeconds:FP,secondsToBpm:bB,samplesToPulses:AB,pulsesToSamples:_B,toString:(r,e=4,t=4)=>{let{bars:i,beats:n,semiquavers:o,ticks:a}=EP(r|0,e,t);return`${i+1}.${n+1}.${o+1}:${a}`}};var or;(function(r){r.builder=()=>new e,r.toDouble=([t,i])=>t/i,r.toPPQN=([t,i])=>Q.fromSignature(t,i);class e{#e=[];add(i){return this.#e.push(i),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(i)-r.toDouble(n))}asDescendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(n)-r.toDouble(i))}}})(or||(or={}));var sn=class{static*iterate(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield o,o=++n*i}static*iterateWithIndex(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield{position:o,index:n},o=++n*i}};var dl=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,i,n){if(isNaN(this.#r)){for(let o=i;o<n;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=Q.samplesToPulses(1,t,sampleRate);for(let a=i;a<n;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<n;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,i){if(isNaN(this.#r))this.#t=this.#e;else{let n=Q.samplesToPulses(i-t,e,sampleRate);this.#i+=n/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 tf=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){I(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),I(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){R.remove(this.#e,e);let t=this.#t.delete(e);I(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??R.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){let i=ee(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`);I(!i.includes(e),`${e} is already marked.`),i.push(e)}removeEdge([e,t]){let i=ee(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);I(i.includes(e),`${e} is not marked.`),R.remove(i,e)}isEmpty(){return this.#e.length===0}},rf=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.#l();let e=new Map;for(let i of this.#e.vertices())this.#n.set(i,new Set),e.set(i,new Set);for(let i of this.#e.vertices())for(let n of this.#e.getPredecessors(i))ee(this.#n.get(n),`Could not find Successor for ${n}`).add(i);let t;do{t=!1;for(let i of this.#e.vertices()){ee(e.get(i)).clear();for(let n of ee(this.#n.get(i)))for(let o of ee(this.#n.get(n)))this.#n.get(i)?.has(o)||(t=!0,ee(e.get(i)).add(o))}for(let i of this.#e.vertices()){let n=ee(this.#n.get(i));ee(e.get(i)).forEach(o=>n.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(ee(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#l(){R.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Lc;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Lc||(Lc={}));var nf=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 i=this.#e.duration(),n=Kn(t,i),o=(t-n)/i,a=e?this.#e.fx(o):this.#e.fy(o);return n+a*i}};var Le;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Le||(Le={}));var of=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,i,n,o){let a=i/this.sampleRate;switch(t){case Le.sine:{for(let s=n;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case Le.triangle:{for(let s=n;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 Le.saw:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=2*l-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Le.square:{for(let s=n;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 ln;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(ln||(ln={}));var af;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,i)=>t|=1<<i,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,i)=>Qr((t-60)*i);class e{#e;#t;constructor(i,...n){this.#e=i,this.#t=n.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(i){return(this.#t&1<<i%12)!==0}equals(i){return this.#t===i.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)]})(af||(af={}));var ar;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let i=e.position-t.position;if(i!==0)return i;let n=e.pitch-t.pitch;return n!==0?n: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 i=Oa.complete(e)-Oa.complete(t);return i!==0?i:e.pitch-t.pitch}})(ar||(ar={}));var Kc=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,i,n,o){let a=t*this.#e;switch(i){case Le.sine:this.#i(e,a,n,o);break;case Le.saw:this.#n(e,a,n,o);break;case Le.square:this.#o(e,a,n,o);break;case Le.triangle:this.#a(e,a,n,o);break}}generateFromFrequencies(e,t,i,n,o){switch(i){case Le.sine:this.#l(e,t,n,o);break;case Le.saw:this.#s(e,t,n,o);break;case Le.square:this.#u(e,t,n,o);break;case Le.triangle:this.#c(e,t,n,o);break}}#i(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=2*s-1-un(s,t),o+=t}this.#t=o}#o(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=(s<.5?1:-1)+un(s,t)-un((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,i,n){let o=this.#t,a=this.#r,s=4*t;for(let l=i;l<n;l++){let c=o%1,p=(c<.5?1:-1)+un(c,t)-un((c+.5)%1,t);a=a*.9995+p*s,e[l]=a,o+=t}this.#t=o,this.#r=a}#l(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#s(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,c=a%1;e[s]=2*c-1-un(c,l),a+=l}this.#t=a}#u(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,c=a%1;e[s]=(c<.5?1:-1)+un(c,l)-un((c+.5)%1,l),a+=l}this.#t=a}#c(e,t,i,n){let o=this.#e,a=this.#t,s=this.#r;for(let l=i;l<n;l++){let c=t[l]*o,p=a%1,d=(p<.5?1:-1)+un(p,c)-un((p+.5)%1,c);s=s*.9995+d*(4*c),e[l]=s,a+=c}this.#t=a,this.#r=s}},un=(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 Gn;(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:i,invertL:n,invertR:o,stereo:a,swap:s},l=ln.EqualPower)=>{let[c,p]=r.panningToGains(i,l),d=c*t,f=p*t;n&&(d*=-1),o&&(f*=-1);let v=Math.max(0,-a),m=Math.max(0,a),y=1-m,x=1+m,D=v*.5,M=1-v,O=(y+x)*.5,T=(y-x)*.5,V=(y-x)*.5,Y=(y+x)*.5,te=d*(D+M)*O+f*D*T,q=d*(D+M)*V+f*D*Y,ge=d*D*O+f*(D+M)*T,se=d*D*V+f*(D+M)*Y;s?(e.ll=q,e.rl=te,e.lr=se,e.rr=ge):(e.ll=te,e.lr=ge,e.rl=q,e.rr=se)},r.panningToGains=(e,t)=>{let i=le(e,-1,1);switch(t){case ln.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case ln.EqualPower:return[Math.cos((i+1)*Px),Math.sin((i+1)*Px)]}},r.applyFrame=(e,t,i)=>[e.ll*t+e.rl*i,e.lr*t+e.rr*i],r.processFrames=(e,t,i,n,o)=>{let[a,s]=t,[l,c]=i;for(let p=n;p<o;p++){let d=a[p],f=s[p];l[p]=e.ll*d+e.rl*f,c[p]=e.lr*d+e.rr*f}},r.replaceFrames=(e,[t,i],n,o)=>{for(let a=n;a<o;a++){let s=t[a],l=i[a];t[a]=e.ll*s+e.rl*l,i[a]=e.lr*s+e.rr*l}}})(Gn||(Gn={}));var Ht;(function(r){r.linear=(i,n=.005)=>new e(Math.ceil(i*n)|0),r.stereoMatrix=(i,n=.005)=>new t(Math.ceil(i*n)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(n){this.#e=n}set(n,o){this.#t!==n&&(o===!0?(this.#r=n,this.#i=(n-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=n,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(n){return this.#t===n&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=Gn.zero();#r=Gn.zero();#i=Gn.zero();#n=0;constructor(n){this.#e=n}update(n,o,a){Gn.update(this.#r,n,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(n,o,a,s){let[l,c]=n,[p,d]=o;if(this.isInterpolating())for(let f=a;f<s;f++){let v=l[f],m=c[f],y=this.moveAndGet();p[f]=y.ll*v+y.rl*m,d[f]=y.lr*v+y.rr*m}else{let f=this.#r;for(let v=a;v<s;v++){let m=l[v],y=c[v];p[v]=f.ll*m+f.rl*y,d[v]=f.lr*m+f.rr*y}}}set(n,o){this.#o(n)||(o===!0?(this.#r.ll=n.ll,this.#r.lr=n.lr,this.#r.rl=n.rl,this.#r.rr=n.rr,this.#i.ll=(n.ll-this.#t.ll)/this.#e,this.#i.lr=(n.lr-this.#t.lr)/this.#e,this.#i.rl=(n.rl-this.#t.rl)/this.#e,this.#i.rr=(n.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=n.ll,this.#t.lr=this.#r.lr=n.lr,this.#t.rl=this.#r.rl=n.rl,this.#t.rr=this.#r.rr=n.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(n){return this.#o(n)&&this.#n===0}isInterpolating(){return this.#n>0}#o(n){return this.#t.ll===n.ll&&this.#t.lr===n.lr&&this.#t.rl===n.rl&&this.#t.rr===n.rr}}r.StereoMatrixRamp=t})(Ht||(Ht={}));var Wc=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]),Cx=new Float32Array(12),NP=new Float32Array(11);for(let r=0,e=0,t=0;r<Wc.length;r++)r%2===0?Cx[e++]=Wc[r]:NP[t++]=Wc[r];var Tx=class{#e=new Float32Array(Cx.length);#t=new Float32Array(Wc.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,i,n){let o=this.#e,a=Cx,s=NP;for(let l=i;l<n;l++){let c=e[l],p=(l-i)*2;o[this.#r]=c;let d=0;for(let v=0;v<a.length;v++){let m=(this.#r-v+o.length)%o.length;d+=o[m]*a[v]}t[p]=d*2;let f=0;for(let v=0;v<s.length;v++){let m=(this.#r-v+o.length-1)%o.length;f+=o[m]*s[v]}t[p+1]=f*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,i,n){let o=this.#t,a=Wc;for(let s=i;s<n;s++){let l=(s-i)*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 c=0;for(let p=0;p<a.length;p++){let d=(this.#i-1-p+o.length)%o.length;c+=o[d]*a[p]}t[s]=c}}},sf=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=R.create(()=>new Tx,t),this.#r=R.create(i=>new Float32Array(128*(2<<i)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,i,n){let o=n-i,a=e,s=i,l=n;for(let c=0;c<this.#t.length;c++){let d=c===this.#t.length-1?t:this.#r[c];this.#t[c].upsample(a,d,s,l),a=d,s=0,l=o*(2<<c)}}downsample(e,t,i,n){let o=n-i,a=e,s=o*this.#e;for(let l=this.#t.length-1;l>=0;l--){let c=l===0,p=c?t:this.#r[l-1],d=c?i:0,f=c?n:s/2;this.#t[l].downsample(a,p,d,f),a=p,s=f}}},lf=class{#e;#t;constructor(e){this.#e=new sf(e),this.#t=new sf(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,i,n){this.#e.upsample(e[0],t[0],i,n),this.#t.upsample(e[1],t[1],i,n)}downsample(e,t,i,n){this.#e.downsample(e[0],t[0],i,n),this.#t.downsample(e[1],t[1],i,n)}};var pl=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,i){let n=this.#e,o=n.length,a=this.#r,s=this.#i;for(let l=t;l<i;l++){let c=e[l]*e[l];s+=c-n[a],n[a]=c,++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 uf=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,i){let n=this.#r,o=this.#i,[a,s]=e.channels(),l=this.#n;for(let c=t;c<i;++c){let p=a[c],d=s[c],f=Math.max(Math.abs(p),Math.abs(d));if(l=f>l?n*(l-f)+f:o*(l-f)+f,l>1){let v=1/l;a[c]=p*v,s[c]=d*v}}this.#n=l}};var Di=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 cf=class{#e=new U;#t;#r;constructor(e){this.#t=this.#e.own(new re),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}ppqnToSeconds(e){return Q.pulsesToSeconds(e,this.#r)}secondsToPPQN(e){return Q.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return Q.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return Q.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var sr;(function(r){r.Musical="musical",r.Seconds="seconds"})(sr||(sr={}));var Bo;(function(r){function e(i,n,o){return new Ox(i,n,o)}r.musical=e;function t(i,n,o,a){return new Rx(i,n,o,a)}r.aware=t})(Bo||(Bo={}));var Rx=class{#e;#t;#r;#i;constructor(e,t,i,n){this.#i=n,this.#t=t,this.#r=i,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===sr.Musical)return e;let t=this.#r.getValue(),i=this.#e.ppqnToSeconds(t),n=i+e;return this.#e.intervalToPPQN(i,n)}fromPPQN(e){if(this.getTimeBase()===sr.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),i=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(i)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===sr.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return Jr(this.#t.getValue(),sr)}},Ox=class{#e;#t;#r;constructor(e,t,i){this.#r=i,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return sr.Musical}};var df=Q.fromSignature(1,384);var Fo={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},pf;(function(r){r.Comparator=(n,o)=>{let a=n.position-o.position;if(a!==0)return a;let s=n.index-o.index;return s!==0?s:n===o?0:F(`${n} and ${o} are identical in terms of comparison`)};function*e(n,o,a){if(n.isEmpty())return Xe.empty();for(let s of n.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(n,o)=>{let a=n.asArray(),s=Ye.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(n,o,a)=>{if(n.isEmpty())return a;let s=n.iterateFrom(o),{done:l,value:c}=s.next();if(l)return a;if(c.position<=o){let{done:p,value:d}=s.next();if(p)return c.value;if(o<d.position)return i(c,d,o);if(c.interpolation===Fo.None)return c.value}return c.value};function*t(n,o,a,s){if(n.isEmpty())return;let l=n.iterateFrom(o),{done:c,value:p}=l.next();if(c)return;let d=a/s,f=p;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=d,o>a)return;f.position<=a&&(yield f)}for(;o<=a;){let{done:v,value:m}=l.next();if(v)break;for(;o<m.position;){if(o>a)return;yield{position:o,value:i(f,m,o)},o+=d}m.position<a&&(f.interpolation===Fo.None&&(yield{position:m.position,value:f.value}),yield m),f=m}for(;o<=a;)yield{position:o,value:f.value},o+=d}r.quantise=t;let i=({value:n,position:o,interpolation:a},s,l)=>a.type==="none"?n:a.type==="linear"?n+(l-o)/(s.position-o)*(s.value-n):a.type==="curve"?Yr.valueAt({slope:a.slope,steps:s.position-o,y0:n,y1:s.value},l-o):F("Unknown interpolation")})(pf||(pf={}));var Dc;(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,i)=>{let n=new Float32Array(i),o=Math.PI/(i-1);switch(t){case e.Bartlett:{let a=(i>>1)-1,s=0;for(;s<=a;++s)n[s]=2*s/(i-1);for(;s<i;++s)n[s]=2-2*s/(i-1);return n}case e.Blackman:{let a=2*o,s=4*o;for(let l=0;l<i;++l)n[l]=.42323-.49755*Math.cos(a*l)+.07922*Math.cos(s*l);return n}case e.BlackmanHarris:{let a=2*o,s=4*o,l=6*o;for(let c=0;c<i;++c)n[c]=.35875-.48829*Math.cos(a*c)+.14128*Math.cos(s*c)-.01168*Math.cos(l*c);return n}case e.Hamming:{let a=2*o;for(let s=0;s<i;++s)n[s]=.54-.46*Math.cos(a*s);return n}case e.Hanning:{let a=2*o;for(let s=0;s<i;++s)n[s]=.5-.5*Math.cos(a*s);return n}}}})(Dc||(Dc={}));var hf=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:i,valueDecay:n}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=R.create(()=>new pl(sampleRate*i),t);let o=yr.createBuilder({peak:yr.floats(t),rms:yr.floats(t)})();this.#n=sl.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*n));for(let l=0;l<t;++l){let c=this.#t[l],p=this.#r[l];a.peak[l]=c,a.rms[l]=Math.sqrt(p),this.#t[l]=c*s,this.#r[l]=p*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let i=e[t];if(i===void 0)this.#t[t]=0,this.#r[t]=0;else{let n=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<128;++s){let l=i[s];o=Math.max(o,Math.abs(l)),a=Math.max(a,n.pushPop(l*l))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var Ae=class r{static newSet(e){return new ol(e,r.Comparator)}static compose=(e,...t)=>{let i=t.length===0?this.#e:new Int16Array(t);return I(i.every((n,o)=>n===t[o]),`fieldKeys (${i.join(",")}) only allows i16`),new r(e,i)};static decode(e){let t=e.split("/");return I(t.length>0,"Unable to parse Address"),r.compose(w.parse(t[0]),...t.slice(1).map(i=>parseInt(i)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,i){let n=e.values(),o=Ye.leftMostMapped(n,t,w.Comparator,i),a=n.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(w.Comparator(i(n[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let i=w.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;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 i=w.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let i=w.Comparator(e.#t,t.#t);return i!==0?i: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 w.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,i)=>this.#r[i]===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(w.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,w.length),e.buffer}toString(){return[w.toString(this.#t),...this.#r].join("/")}static read(e){let t=w.fromDataInput(e),i=e.readByte();return r.compose(t,...R.create(()=>e.readShort(),i))}},Va;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>Ae.Comparator(e,t),r.equals=(e,t)=>{let[i,n]=Ye.rangeMapped(t,e,Ae.Comparator,r.AddressReader);return t.slice(i,n+1)},r.startsWith=(e,t)=>{let[i,n]=Ye.rangeMapped(t,e,Ae.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let i=Ye.leftMostMapped(t,e,Ae.LengthComparator,r.AddressReader),n=Ye.rightMostMapped(t,e,Ae.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>e.startsWith(o.address))}})(Va||(Va={}));var cn=class r{static validate(e,t){if(e.address.equals(t.address))return g.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(i=>i===e.pointerType)){let i=t.pointerRules.accepts.join(", ");return g.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${i}).`)}return g.None}#e;#t;constructor(e){this.#e=e,this.#t=new Mt}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let i=Ae.newSet(n=>n.address);return i.addMany(this.filter(...t)),i.forEach(n=>e.onAdded(n)),this.subscribe({onAdded:n=>{i.add(n)&&e.onAdded(n)},onRemoved:n=>{i.removeByKey(n.address),e.onRemoved(n)}},...t)}filter(...e){return e.length===0?this.incoming():Xe.filter(this.incoming().values(),t=>e.some(i=>i===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 F(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,i){return e.subscribe({onAdded:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onAdded(n)},onRemoved:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onRemoved(n)}})}};var Vx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hl=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},W=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:t,fieldName:i,pointerRules:n,deprecated:o}){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=o,n.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return _(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new cn(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 R.empty()}record(){return Ir.empty()}getField(e){return F()}optField(e){return g.None}read(e){}write(e){}toJSON(){}fromJSON(e){return F("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)&&t.box.delete()})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};Vx([rl,hl("design:type",cn),hl("design:paramtypes",[])],W.prototype,"pointerHub",null);Vx([rl,hl("design:type",Ae),hl("design:paramtypes",[])],W.prototype,"address",null);Vx([rl,hl("design:type",String),hl("design:paramtypes",[])],W.prototype,"debugPath",null);var h=Object.freeze({mandatory:!1,accepts:[]});var ff=class r extends W{static create(e,t,i){return new r(e,t,i)}#e;constructor(e,t,i){super(e),this.#e=R.create(n=>t({parent:this,fieldKey:n,fieldName:String(n),pointerRules:h,deprecated:e.deprecated}),i)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return R.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ee(this.#e[e])}optField(e){return g.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,i)=>this.#e[i].fromJSON(t));else return F("Type mismatch")}};var No;(function(r){r.writeFields=(t,i)=>{let n=Object.entries(i).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(n.length),n.forEach(([o,a])=>{let s=$t.create();a.write(s);let l=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,i)=>{I(t.readInt()===1179403347,"Serializer header is corrupt");let n=t.readShort();for(let o=0;o<n;o++){let a=t.readShort();if(el(i[a]))continue;let s=t.readInt(),l=new Int8Array(s);t.readBytes(l);let{status:c,error:p}=Un(()=>i[a]?.read(new lt(l.buffer)));c==="failure"&&console.warn(i,p)}}})(No||(No={}));var PB=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kP=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},N=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:i,pointerRules:n}){this.#e=Ae.compose(e),this.#t=t,this.#r=i,this.#i=n,this.#n=this.initializeFields(),n.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return ee(this.#n[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return g.wrap(this.#n[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}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 creationIndex(){return this.#o}get pointerHub(){return new cn(this)}estimateMemory(){let e=new tl;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ne(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){No.readFields(e,this.#n)}write(e){No.writeFields(e,this.#n)}serialize(){let e=$t.create();return e.writeInt(this.#o),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=$t.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,i])=>{let n=i.toJSON();return Z(n)&&(e[t]=n),e},{})}fromJSON(e){if(Kh(e))Object.entries(e).forEach(([t,i])=>{let n=this.#n[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return R.empty();let i=this.getField(t[0]),n=[e(i)];for(let o=1;o<t.length;o++)i=i.getField(t[o]),n.push(e(i));return n}searchVertex(e){if(e.length===0)return g.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return g.None;for(let i=1;i<e.length;i++)if(t=t.unwrap().optField(e[i]),t.isEmpty())return g.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(i=>i.toString()).join(`
|
|
2
|
-
`)),console.debug(" unstages",[...e].map(
|
|
3
|
-
`),this));for(let i of t)i.defer();for(let i of e)i.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(i=>i.accept({visitPointerField:n=>!n.mandatory||n.nonEmpty(),visitArrayField:n=>e(n.fields()),visitObjectField:n=>e(n.fields()),visitPrimitiveField:n=>!0,visitField:n=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};PB([rl,kP("design:type",cn),kP("design:paramtypes",[])],N.prototype,"pointerHub",null);var Zc;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Zc||(Zc={}));var ke;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(ke||(ke={}));var mf;(function(r){r.create=()=>new zx})(mf||(mf={}));var zx=class{#e=new Gc(Va.equals);#t=new Gc(Va.startsWith);#r=new Gc(Va.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,i){let n=new Ux(t,e,this.#n++,i);if(this.#o){let o=new jx(n,e);return this.#i.push(o),o}else return this.subscribeMonitor(n,e)}dispatch(e){this.#o=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:i},{order:n})=>i-n).forEach(i=>i.procedure(e)),this.#o=!1,this.#i.forEach(i=>i.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case ke.This:return this.#e.subscribe(e);case ke.Parent:return this.#t.subscribe(e);case ke.Children:return this.#r.subscribe(e);default:return Wh(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Ux=class{address;propagation;order;procedure;constructor(e,t,i,n){this.address=e,this.propagation=t,this.order=i,this.procedure=n}toString(){return`{ Monitor address: ${this.address}, propagation: ${ke[this.propagation]}, order: ${this.order} }`}},Gc=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(Va.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},jx=class{monitor;propagation;#e=new U;#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 ft;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(ft||(ft={}));var Ua={[ft.Boolean]:{type:ft.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[ft.Float32]:{type:ft.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[ft.Int32]:{type:ft.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[ft.String]:{type:ft.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[ft.Bytes]:{type:ft.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},za=class extends W{#e;#t;#r;constructor(e,t,i){super(e),this.#e=t,this.#t=i,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.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){I(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,i=this.clamp(e);this.equals(i)||(this.#r=i,this.graph.onPrimitiveValueUpdate(this,t,i))}writeValue(e,t){I(!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)?F("not implemented"):e}fromJSON(e){return F("Type mismatch")}reset(){this.setValue(this.#t)}},$=class r extends za{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,ft.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Ua[ft.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){I(!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 za{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,ft.Float32,n),this.#e=t,this.#t=i}serialization(){return Ua[ft.Float32]}equals(e){return this.getValue()===e}clamp(e){return Zc.clampFloat32(this.#e,Wn.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){I(!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 za{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,ft.Int32,n),this.#e=t,this.#t=i}serialization(){return Ua[ft.Int32]}equals(e){return this.getValue()===e}clamp(e){return Zc.clampInt32(this.#e,nr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){I(!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>=nr.MIN_VALUE&&e<=nr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends za{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,ft.String,t)}serialization(){return Ua[ft.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){I(!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()))}},$P=class r extends za{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,ft.Bytes,t)}serialization(){return Ua[ft.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){I(!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 MP;(function(r){r.decode=e=>{let t=e.readInt();return R.create(()=>{switch(e.readString()){case"new":{let n=w.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new qc(n,o,a.buffer)}case"pointer":{let n=Ae.read(e),o=e.readBoolean()?g.wrap(Ae.read(e)):g.None,a=e.readBoolean()?g.wrap(Ae.read(e)):g.None;return new Jc(n,o,a)}case"primitive":{let n=Ae.read(e),o=e.readString(),a=Ua[o],s=a.decode(e),l=a.decode(e);return new Hc(n,a,s,l)}case"delete":{let n=w.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new Qc(n,o,a.buffer)}}},t)}})(MP||(MP={}));var qc=class{type="new";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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 lt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),w.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${w.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Hc=class{type="primitive";#e;#t;#r;#i;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#r=i,this.#i=n}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}`}},Jc=class{type="pointer";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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()}`}},Qc=class{type="delete";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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 lt(this.#r)))}write(e){e.writeString(this.type),w.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${w.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var eT=Symbol("Unreferenceable"),B=class r extends W{static create(e,t,i){return new r(e,t,i)}static encodeWith(e,t){I(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=g.wrap(e);let i=Un(t);if(this.#e=g.None,i.status==="failure")throw i.error;return i.value}static decodeWith(e,t){I(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=g.wrap(e);let i=Un(t);if(this.#t=g.None,i.status==="failure")throw i.error;return i.value}static#e=g.None;static#t=g.None;#r;#i;#n=g.None;#o=g.None;constructor(e,t,i){super(e),this.#r=t,this.#i=i,i&&this.graph.edges().watchVertex(this)}get pointerHub(){return F(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return _(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=g.wrap(e)}defer(){this.targetVertex=g.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=cn.validate(this,e.unwrap());t.nonEmpty()&&F(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()?g.wrap(Ae.read(e)):g.None;this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}write(e){I(!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(Ia(e)||typeof e=="string"){let t=g.wrap(Ia(e)?null:Ae.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}else return F(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var gf=class{#e;#t;#r;#i;constructor(){this.#e=Ae.newSet(e=>e.address),this.#t=Ae.newSet(e=>e.address),this.#r=Ae.newSet(([e])=>e),this.#i=Ae.newSet(([e])=>e.address)}watchVertex(e){if(Ie(e,B)){if(!e.mandatory)return F("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return F("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:i}}})=>i;for(let{address:{uuid:i}}of e)this.#o(this.#e,i,t),this.#o(this.#t,i,t);for(let i of e){let n=this.outgoingEdgesOf(i);if(n.length>0)return F(`${i} has outgoing edges: ${n.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(i);if(o.length>0)return F(`${i} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,i])=>i.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,i]=this.#r.get(t);R.remove(i,e),i.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,i])=>i.equals(t),!1)}outgoingEdgesOf(e){return this.#n(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#n(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,i])=>i):this.#r.opt(e.address).mapOr(([t,i])=>i,R.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?F(`Pointer ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?F(`Target ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,i){let n=Ae.boxRange(e,t,i);return Z(n)?e.values().slice(n[0],n[1]):R.empty()}#o(e,t,i){let n=Ae.boxRange(e,t,i);Z(n)&&e.removeRange(n[0],n[1])}};var ja=class{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=!1;#d=!1;constructor(e=g.None){this.#e=e,this.#t=w.newSet(t=>t.address.uuid),this.#r=[],this.#a=mf.create(),this.#i=new Mt,this.#n=new Mt,this.#o=new Mt,this.#l=new gf,this.#s=Ae.newSet(({pointer:t})=>t.address),this.#u=[]}beginTransaction(){I(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(I(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#s.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:i})=>{t.equals(i)||(t.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onRemoved(e)),i.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#s.clear(),this.#c=!1;this.#u.length>0;)this.#u.splice(0).forEach(e=>e()),this.#u.length>0&&console.debug(`${this.#u.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,i){return this.#e.unwrap("No box-factory installed")(e,this,t,i)}stageBox(e,t){this.#h(),I(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let i=this.#t.add(e);I(i,`${e} already staged`);let n=new qc(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n),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,i){return this.#a.subscribe(e,t,i)}subscribeEndTransaction(e){this.#u.push(e)}unstageBox(e){this.#h();let t=this.#t.removeByKey(e.address.uuid);I(t===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let i=new Qc(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}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.#l}checksum(){let e=new Hh;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,i){if(this.#h(),e.isAttached()&&!this.#d){let n=new Hc(e.address,e.serialization(),t,i);this.#a.dispatch(n),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}}onPointerAddressUpdated(e,t,i){this.#h(),t.nonEmpty()&&this.#l.disconnect(e),i.nonEmpty()&&this.#l.connect(e,i.unwrap());let n=new Jc(e.address,t,i);this.#d?this.#r.push({pointerField:e,update:n}):(this.#p(e,n),this.#n.proxy.onUpdate(n))}#p(e,t){let{oldAddress:i,newAddress:n}=t;e.resolvedTo(n.flatMap(a=>this.findVertex(a))),this.#s.opt(e.address).match({none:()=>this.#s.add({pointer:e,initial:i,final:n,index:this.#s.size()}),some:a=>a.final=n}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let i=Z(t.excludeBox)?t.excludeBox:Po.alwaysFalse,n=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=new Set,a=new Set,s=l=>{o.has(l)||i(l)||(o.add(l),l.outgoingEdges().filter(([c])=>!a.has(c)).forEach(([c,p])=>{let d=this.findVertex(p).unwrap(`Could not find target of ${c.toString()}`);if(a.add(c),d.pointerRules.mandatory&&(n||d.pointerHub.incoming().every(f=>a.has(f))))return s(d.box)}),l.incomingEdges().forEach(c=>{a.add(c),c.mandatory&&s(c.box)}))};return s(e),o.delete(e),{boxes:o,pointers:Array.from(a).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,t=i=>{for(let n of i.fields())n.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();I(a,`pointer ${o.address} is broken`),I(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(i=>t(i)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[w.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(i=>i.name):this.findBox(t.uuid).flatMap(i=>i.searchVertex(t.fieldKeys).map(n=>n.isField()?n.debugPath:F("Unknown address"))))}toArrayBuffer(){let e=$t.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(i=>{let n=i.serialize();e.writeInt(n.byteLength),e.writeBytes(new Int8Array(n))}),e.toArrayBuffer()}fromArrayBuffer(e){I(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new lt(e),i=t.readInt();this.beginTransaction();let n=[];for(let o=0;o<i;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new lt(s.buffer),c=l.readInt(),p=l.readString(),d=w.fromDataInput(l);n.push({creationIndex:c,name:p,uuid:d,boxStream:l})}n.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(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:ee(e.toJSON())}))}#h(){I(this.#c,()=>"Modification only prohibited in transaction mode.")}};var fl;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let i=r.collectIndexedBoxes(e),n=le(t,0,i.length);if(n<i.length)for(let o=n;o<i.length;o++)i[o].index.setValue(o+1);return n},r.removeOrder=(e,t)=>{let i=r.collectIndexedBoxes(e);if(t<i.length)for(let n=t+1;n<i.length;n++)i[n].index.setValue(n-1)},r.moveIndex=(e,t,i)=>{let n=r.collectIndexedBoxes(e),o=n[t];if(i<0){let a=le(t+i,0,n.length-1);for(let s=a;s<t;s++)n[s].index.setValue(s+1);o.index.setValue(a)}else if(i>1){let a=le(t+(i-1),0,n.length-1);for(let s=t;s<a;s++)n[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${i}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:i})=>r.isIndexedBox(i)&&(t===void 0||i instanceof t)?i:F(`${i} has no index field`)).sort((i,n)=>i.index.getValue()-n.index.getValue())})(fl||(fl={}));var ze=class extends W{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return _(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ee(this.#e[e])}optField(e){return g.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){No.readFields(e,this.#e)}write(e){No.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,i])=>(e[t]=i.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Kh(e))Object.entries(e).forEach(([t,i])=>{let n=this.#e[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}};var qn;(function(r){r.sender=(n,o)=>o(new t(n)),r.executor=(n,o)=>new i(n,o);let e=n=>{let o=[];for(let a of n)a instanceof MessagePort&&o.push(a),typeof ImageBitmap<"u"&&a instanceof ImageBitmap&&o.push(a),typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas&&o.push(a);return o};class t{#e;#t=new Map;#r;#i=0;constructor(o){this.#e=o,this.#r=o.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(o,...a)=>{let s=e(a);this.#e.send({type:"send",returnId:!1,func:o.name,args:Array.from(Xe.map(a,l=>({value:l})))},s)};dispatchAndReturn=(o,...a)=>new Promise((s,l)=>{let c=Xe.reduce(a,(d,f,v)=>(typeof f=="function"&&d.push([v,f]),d),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:l},callbacks:new Map(c)});let p=e(a);this.#e.send({type:"send",returnId:this.#i,func:o.name,args:Array.from(Xe.map(a,(d,f)=>typeof d=="function"?{callback:f}:{value:d}))},p),this.#i++});#n=o=>{let a=this.#t.get(o.returnId);Z(a)?o.type==="resolve"?(a.executorTuple.resolve(o.resolve),this.#t.delete(o.returnId)):o.type==="reject"?(a.executorTuple.reject(o.reject),this.#t.delete(o.returnId)):o.type==="callback"&&a.callbacks?.get(o.funcAt).apply(this,o.args):F(`Promise has already been resolved. ${JSON.stringify(o)}`)}}class i{#e;#t;#r;constructor(o,a){this.#e=o,this.#t=a,this.#r=o.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=o=>{I(o.type==="send",()=>"Message type must be 'send'");let a=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=ee(a[o.func],`${o.func.toString()} does not exists on ${this.#t}`),l=o.returnId;if(l===!1)s.apply(this.#t,o.args.map(c=>"value"in c?c.value:F(`${o.func.toString()} has no promise.`)));else try{s.apply(this.#t,o.args.map(p=>"callback"in p?(...d)=>this.#a(l,p.callback,d):p.value)).then(p=>{try{this.#n(l,p)}catch(d){this.#o(l,d)}},p=>this.#o(l,p))}catch(c){this.#o(l,c)}};#n=(o,a)=>this.#e.send({type:"resolve",returnId:o,resolve:a});#o=(o,a)=>this.#e.send({type:"reject",returnId:o,reject:a});#a=(o,a,s)=>this.#e.send({type:"callback",returnId:o,funcAt:a,args:s})}r.Executor=i})(qn||(qn={}));var DP={for:r=>new Lx(r)},SB=[],Lx=class{#e;#t=new re;constructor(e){if(this.#e=e,Z(e.onmessage)||Z(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??SB)}channel(e){return new Kx(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Kx=class r{#e;#t;#r=new re;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(i=>{"__id__"in i&&i.__id__==="42"&&"message"in i&&"channel"in i&&i.channel===t&&this.#r.notify(i.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 vf;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let i=e,n=()=>{--i<=0?t():requestAnimationFrame(n)};requestAnimationFrame(n)}),r.timeSpan=(e,...t)=>new Promise(i=>setTimeout(i,e.millis(),...t)),r.event=(e,t)=>new Promise(i=>e.addEventListener(t,i,{once:!0})),r.observable=e=>new Promise(t=>{let i=e.subscribe(()=>{i.terminate(),t()})}),r.complete=e=>new Promise((t,i)=>{let n=setInterval(()=>{let{status:o,value:a,error:s}=Un(()=>e.next());if(o==="success"){let{done:l,value:c}=a;l&&(clearInterval(n),t(c))}else clearInterval(n),i(s)},0)})})(vf||(vf={}));var Wx=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)}},yf;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Ta("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Ta("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(K.create(()=>l=!1)),new Promise((c,p)=>s.then(d=>{l&&c(d)},d=>{l&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let i=new Wx(3,Vc.seconds(3));r.retry=(a,s=i)=>a().catch(l=>new Promise((c,p)=>{let d=f=>{s.retry(f,()=>a().then(v=>c(v),d))||p(f)};d(l)})),r.guardedRetry=(a,s)=>{let l=async(c=0)=>{try{return await a()}catch(p){if(s(p,++c))return console.debug("retrying after failure:",p),await vf.timeSpan(Vc.seconds(1)),l(c);throw new Error(`Failed after ${c} retries: ${p}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(c){if(await al.approve(s(c)))return l();throw c}};return l()},r.fail=(a,s)=>{let l=()=>new Promise((c,p)=>setTimeout(()=>p("fails first"),a.millis()));return()=>{let c=l();return l=s,c}},r.timeout=(a,s,l)=>new Promise((c,p)=>{let d=!0,f=setTimeout(()=>{d=!1,p(new Error(l??"timeout"))},s.millis());a.then(v=>{d&&c(v)},v=>{d&&p(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=a=>a.reduce((s,l)=>s.then(async c=>[...c,await l()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return l=>{let c=()=>a(l),p=s.then(c,c);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let l=null,c=Date.now();return()=>{let p=Date.now();return(Ia(l)||Z(s)&&p-c>s.millis())&&(c=p,l=a(),l.catch(d=>(l=null,d))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),c=0,p=!1,d=async()=>{for(;c<a.length&&!p;){let f=c++;try{let v=await a[f]();p||(l[f]=v)}catch(v){throw p=!0,v}}};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),c=0,p=async()=>{for(;c<a.length;){let d=c++;try{let f=await a[d]();l[d]={status:"fulfilled",value:f}}catch(f){l[d]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l};class n{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(I(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:c}]=this.#e.shift();this.#t++,s().then(l,c)}}}r.Limit=n;class o{#e;#t;#r;#i=g.None;constructor(s,l,c){this.#e=s,this.#t=l,this.#r=c}update(s){this.#i=g.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(),_(this.#r))})}terminate(){this.#i=g.None}}r.Latest=o})(yf||(yf={}));var IP=(r,e)=>qn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(i=>{let n=i.type;n==="new"?r.createBox(i.name,i.uuid,o=>o.read(new lt(i.buffer))):n==="update-primitive"?r.findVertex(Ae.reconstruct(i.address)).unwrap(()=>`Could not find primitive field ${i.address}`).setValue(i.value):n==="update-pointer"?r.findVertex(Ae.reconstruct(i.address)).unwrap(()=>`Could not find pointer field ${i.address}`).targetAddress=Z(i.target)?g.wrap(Ae.reconstruct(i.target)):g.None:i.type==="delete"&&r.unstageBox(r.findBox(i.uuid).unwrap(()=>`Could not find box ${w.toString(i.uuid)}`))}),r.endTransaction()}checksum(t){return R.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var xf=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 CP;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(CP||(CP={}));var TP;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(TP||(TP={}));var St;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(St||(St={}));var ml={white:new _t(0,0,100),blue:new _t(189,100,65),green:new _t(150,77,69),yellow:new _t(60,100,84),cream:new _t(65,20,83),orange:new _t(31,100,73),red:new _t(354,100,65),purple:new _t(314,100,78),bright:new _t(197,0,100),gray:new _t(197,31,85),dark:new _t(197,15,62),shadow:new _t(197,10,42),black:new _t(197,10,14),background:new _t(197,6,5),panelBackground:new _t(197,14,7),panelBackgroundBright:new _t(197,14,10),panelBackgroundDark:new _t(197,14,6)};var Me;(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.Bug=11]="Bug",r[r.Fold=12]="Fold",r[r.Checkbox=13]="Checkbox",r[r.Clips=14]="Clips",r[r.Close=15]="Close",r[r.CloudFolder=16]="CloudFolder",r[r.CollapseDown=17]="CollapseDown",r[r.Compressor=18]="Compressor",r[r.Connected=19]="Connected",r[r.Cube=20]="Cube",r[r.Cursor=21]="Cursor",r[r.Curve=22]="Curve",r[r.Dattorro=23]="Dattorro",r[r.Delete=24]="Delete",r[r.Dial=25]="Dial",r[r.DinSlot=26]="DinSlot",r[r.Disconnected=27]="Disconnected",r[r.Divide=28]="Divide",r[r.DragConnections=29]="DragConnections",r[r.Dropdown=30]="Dropdown",r[r.Dropbox=31]="Dropbox",r[r.DrumSet=32]="DrumSet",r[r.Tidal=33]="Tidal",r[r.Duration=34]="Duration",r[r.EditBox=35]="EditBox",r[r.Effects=36]="Effects",r[r.Embed=37]="Embed",r[r.EQ=38]="EQ",r[r.Eraser=39]="Eraser",r[r.Exclude=40]="Exclude",r[r.Exit=41]="Exit",r[r.ExpandWidth=42]="ExpandWidth",r[r.FileList=43]="FileList",r[r.Flask=44]="Flask",r[r.Focus=45]="Focus",r[r.Generator=46]="Generator",r[r.GoogleDrive=47]="GoogleDrive",r[r.Groove=48]="Groove",r[r.Guitar=49]="Guitar",r[r.GuitarTab=50]="GuitarTab",r[r.Headphone=51]="Headphone",r[r.Heart=52]="Heart",r[r.Help=53]="Help",r[r.HighPass=54]="HighPass",r[r.HighShelf=55]="HighShelf",r[r.Insert=56]="Insert",r[r.Invert=57]="Invert",r[r.Loop=58]="Loop",r[r.LowPass=59]="LowPass",r[r.LowShelf=60]="LowShelf",r[r.Magnet=61]="Magnet",r[r.MainMenu=62]="MainMenu",r[r.Maximized=63]="Maximized",r[r.Menu=64]="Menu",r[r.Merge=65]="Merge",r[r.Metronome=66]="Metronome",r[r.Microphone=67]="Microphone",r[r.Midi=68]="Midi",r[r.Minimized=69]="Minimized",r[r.Mix=70]="Mix",r[r.Mixing=71]="Mixing",r[r.Mute=72]="Mute",r[r.NanoWave=73]="NanoWave",r[r.New=74]="New",r[r.NoAudio=75]="NoAudio",r[r.Note=76]="Note",r[r.NotePad=77]="NotePad",r[r.OpenDAW=78]="OpenDAW",r[r.Panel=79]="Panel",r[r.Peak=80]="Peak",r[r.Pencil=81]="Pencil",r[r.Piano=82]="Piano",r[r.Play=83]="Play",r[r.Playfield=84]="Playfield",r[r.PlayOnce=85]="PlayOnce",r[r.PlayRepeat=86]="PlayRepeat",r[r.PlayAlternate=87]="PlayAlternate",r[r.Pointer=88]="Pointer",r[r.Popout=89]="Popout",r[r.Primary=90]="Primary",r[r.Random=91]="Random",r[r.Record=92]="Record",r[r.Rectangle=93]="Rectangle",r[r.Region=94]="Region",r[r.Robot=95]="Robot",r[r.RoundDown=96]="RoundDown",r[r.RoundUp=97]="RoundUp",r[r.Run=98]="Run",r[r.Sawtooth=99]="Sawtooth",r[r.Saxophone=100]="Saxophone",r[r.Scissors=101]="Scissors",r[r.Search=102]="Search",r[r.Shadertoy=103]="Shadertoy",r[r.Sine=104]="Sine",r[r.Solo=105]="Solo",r[r.SoundFont=106]="SoundFont",r[r.SpeakerHeadphone=107]="SpeakerHeadphone",r[r.Square=108]="Square",r[r.Stack=109]="Stack",r[r.Start=110]="Start",r[r.Stereo=111]="Stereo",r[r.Stop=112]="Stop",r[r.Subtract=113]="Subtract",r[r.Sun=114]="Sun",r[r.Swap=115]="Swap",r[r.System=116]="System",r[r.Table=117]="Table",r[r.Tape=118]="Tape",r[r.TapeReel=119]="TapeReel",r[r.Time=120]="Time",r[r.Timeline=121]="Timeline",r[r.Tool=122]="Tool",r[r.Triangle=123]="Triangle",r[r.Unknown=124]="Unknown",r[r.UserFolder=125]="UserFolder",r[r.Velocity=126]="Velocity",r[r.Vinyl=127]="Vinyl",r[r.VUMeter=128]="VUMeter",r[r.Waveform=129]="Waveform",r[r.Zeitgeist=130]="Zeitgeist"})(Me||(Me={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(Me||(Me={}));var u;(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.MIDIDevice=23]="MIDIDevice",r[r.MidiEffectHost=24]="MidiEffectHost",r[r.ModularSetup=25]="ModularSetup",r[r.Modulation=26]="Modulation",r[r.ModuleCollection=27]="ModuleCollection",r[r.NoteEventCollection=28]="NoteEventCollection",r[r.NoteEventFeature=29]="NoteEventFeature",r[r.NoteEvents=30]="NoteEvents",r[r.NotesConnection=31]="NotesConnection",r[r.Parameter=32]="Parameter",r[r.ParameterController=33]="ParameterController",r[r.PianoMode=34]="PianoMode",r[r.RegionCollection=35]="RegionCollection",r[r.Sample=36]="Sample",r[r.Selection=37]="Selection",r[r.Shadertoy=38]="Shadertoy",r[r.SoundfontFile=39]="SoundfontFile",r[r.StepAutomation=40]="StepAutomation",r[r.Timeline=41]="Timeline",r[r.TrackCollection=42]="TrackCollection",r[r.TransientMarkers=43]="TransientMarkers",r[r.User=44]="User",r[r.ValueEventCollection=45]="ValueEventCollection",r[r.ValueEvents=46]="ValueEvents",r[r.ValueInterpolation=47]="ValueInterpolation",r[r.VoltageConnection=48]="VoltageConnection",r[r.WarpMarkers=49]="WarpMarkers"})(u||(u={}));var ko;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(ko||(ko={}));var dn;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(dn||(dn={}));var RP=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?F(`Indices cannot be equal (${r}, ${e})`):t};var Hn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},wf,Ii,$o,bf,Jn,Lt=class r{static create(e,t,i){return new r(e,t,i)}constructor(e,t,i){wf.set(this,void 0),Ii.set(this,void 0),$o.set(this,void 0),bf.set(this,void 0),Jn.set(this,null),Hn(this,wf,e,"f"),Hn(this,Ii,w.newSet(n=>n.adapter.uuid),"f"),Hn(this,$o,new Mt,"f"),Hn(this,bf,e.pointerHub.catchupAndSubscribe({onAdded:n=>{Hn(this,Jn,null,"f");let o=t(n.box),a=o.indexField.subscribe(()=>{Hn(this,Jn,null,"f"),jt(this,$o,"f").proxy.onReorder(o)}),s=jt(this,Ii,"f").add({adapter:o,subscription:a});I(s,`Could not add ${o}`),jt(this,$o,"f").proxy.onAdd(o)},onRemoved:n=>{Hn(this,Jn,null,"f");let o=n.box.address.uuid,{adapter:a,subscription:s}=jt(this,Ii,"f").removeByKey(o);s.terminate(),jt(this,$o,"f").proxy.onRemove(a)}},i),"f")}field(){return jt(this,wf,"f")}subscribe(e){return jt(this,$o,"f").subscribe(e)}catchupAndSubscribe(e){return jt(this,Ii,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=Ye.exactMapped(this.adapters(),e,RP,i=>i.indexField.getValue());return t===-1?g.None:g.wrap(this.adapters()[t])}getAdapterById(e){return jt(this,Ii,"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 jt(this,Jn,"f")===null&&Hn(this,Jn,jt(this,Ii,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),jt(this,Jn,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let i=this.adapters(),n=i[e];if(t<0){let o=le(e+t,0,i.length-1);for(let a=o;a<e;a++)i[a].indexField.setValue(a+1);n.indexField.setValue(o)}else if(t>1){let o=le(e+(t-1),0,i.length-1);for(let a=e;a<o;a++)i[a+1].indexField.setValue(a);n.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return jt(this,Ii,"f").size()}isEmpty(){return this.size()===0}terminate(){Hn(this,Jn,null,"f"),jt(this,Ii,"f").forEach(({subscription:e})=>e.terminate()),jt(this,Ii,"f").clear(),jt(this,$o,"f").terminate(),jt(this,bf,"f").terminate()}};wf=new WeakMap,Ii=new WeakMap,$o=new WeakMap,bf=new WeakMap,Jn=new WeakMap;var La;(function(r){r.create=(e,t,i,n)=>{switch(e){case"MetaDataBox":return Qn.create(t,i,n);case"RootBox":return gl.create(t,i,n);case"SelectionBox":return pn.create(t,i,n);case"UserInterfaceBox":return Ka.create(t,i,n);case"UploadFileBox":return Af.create(t,i,n);case"ShadertoyBox":return _f.create(t,i,n);case"TimelineBox":return Wa.create(t,i,n);case"TrackBox":return lr.create(t,i,n);case"NoteEventBox":return Mo.create(t,i,n);case"NoteEventRepeatBox":return Pf.create(t,i,n);case"NoteEventCollectionBox":return Yn.create(t,i,n);case"NoteRegionBox":return Za.create(t,i,n);case"NoteClipBox":return vl.create(t,i,n);case"ValueEventBox":return Do.create(t,i,n);case"ValueEventCollectionBox":return Xn.create(t,i,n);case"ValueEventCurveBox":return Io.create(t,i,n);case"ValueRegionBox":return Ga.create(t,i,n);case"ValueClipBox":return yl.create(t,i,n);case"AudioRegionBox":return Co.create(t,i,n);case"AudioClipBox":return xl.create(t,i,n);case"AudioPitchStretchBox":return wl.create(t,i,n);case"AudioTimeStretchBox":return bl.create(t,i,n);case"TransientMarkerBox":return Sf.create(t,i,n);case"WarpMarkerBox":return To.create(t,i,n);case"MarkerBox":return Al.create(t,i,n);case"AudioFileBox":return Tr.create(t,i,n);case"SoundfontFileBox":return ei.create(t,i,n);case"AudioUnitBox":return it.create(t,i,n);case"CaptureAudioBox":return Ro.create(t,i,n);case"CaptureMidiBox":return Oo.create(t,i,n);case"AudioBusBox":return Ci.create(t,i,n);case"AuxSendBox":return qa.create(t,i,n);case"GrooveShuffleBox":return _l.create(t,i,n);case"UnknownAudioEffectDeviceBox":return Ef.create(t,i,n);case"UnknownMidiEffectDeviceBox":return Bf.create(t,i,n);case"DeviceInterfaceKnobBox":return Ff.create(t,i,n);case"ModularDeviceBox":return Nf.create(t,i,n);case"StereoToolDeviceBox":return kf.create(t,i,n);case"CompressorDeviceBox":return Pl.create(t,i,n);case"DelayDeviceBox":return $f.create(t,i,n);case"CrusherDeviceBox":return Mf.create(t,i,n);case"DattorroReverbDeviceBox":return Df.create(t,i,n);case"VelocityDeviceBox":return If.create(t,i,n);case"FoldDeviceBox":return Cf.create(t,i,n);case"TidalDeviceBox":return Tf.create(t,i,n);case"RevampDeviceBox":return Rf.create(t,i,n);case"ReverbDeviceBox":return Of.create(t,i,n);case"VaporisateurDeviceBox":return Sl.create(t,i,n);case"MIDIOutputDeviceBox":return El.create(t,i,n);case"MIDIOutputBox":return Ti.create(t,i,n);case"MIDIOutputParameterBox":return Ri.create(t,i,n);case"SoundfontDeviceBox":return Bl.create(t,i,n);case"NanoDeviceBox":return Fl.create(t,i,n);case"PlayfieldDeviceBox":return Nl.create(t,i,n);case"PlayfieldSampleBox":return Vo.create(t,i,n);case"TapeDeviceBox":return kl.create(t,i,n);case"ArpeggioDeviceBox":return Vf.create(t,i,n);case"PitchDeviceBox":return zf.create(t,i,n);case"ZeitgeistDeviceBox":return Uf.create(t,i,n);case"ModularBox":return jf.create(t,i,n);case"ModuleConnectionBox":return Lf.create(t,i,n);case"ModularAudioInputBox":return Kf.create(t,i,n);case"ModularAudioOutputBox":return Wf.create(t,i,n);case"ModuleDelayBox":return Zf.create(t,i,n);case"ModuleMultiplierBox":return Gf.create(t,i,n);case"ModuleGainBox":return qf.create(t,i,n);default:return F(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let i=new lt(t),n=i.readString(),o=w.fromDataInput(i),a=r.create(n,e,o);return a.read(i),a}})(La||(La={}));var Qn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:h}),i)}static ClassName="MetaDataBox";constructor(e){super(e)}accept(e){return _(e.visitMetaDataBox,this)}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:h},u.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:h})}}};var Hf=class r extends ze{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:h},{length:4},"",0),2:b.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:h},{min:1,max:64,scaling:"linear"},"",8),3:b.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:h},{min:.5,max:2,scaling:"linear"},"",1),4:$.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:h},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:h},{min:-48,max:48},"st",0)}}};var gl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:h}),i)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return _(e.visitRootBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:h},u.Timeline,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[u.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:h}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[u.AudioUnits],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[u.AudioBusses],mandatory:!1}}),30:W.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!0}}),35:W.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!1}}),40:Hf.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:h}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:h},u.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:h},u.Editing,!1)}}};var pn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:h}),i)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return _(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:h},u.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:h},u.Selection,!0)}}};var Ka=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[u.MetaData],mandatory:!1}}),i)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return _(e.visitUserInterfaceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.User,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[u.Selection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[u.FileUploadState],mandatory:!1}}),21:B.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:h},u.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:h},u.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:h},u.Editing,!1)}}};var Af=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:h}),i)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return _(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:h},u.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.FileUploadState,!0)}}};var _f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[u.Shadertoy],mandatory:!0}}),i)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return _(e.visitShadertoyBox,this)}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:h}),2:$.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:h},!0)}}};var Jf=class r extends ze{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:h},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4)}}};var Qf=class r extends ze{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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:h},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:h},"any","ppqn",15360)}}};var Yf=class r extends ze{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:W.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),20:$.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0)}}};var Wa=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:h}),i)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return _(e.visitTimelineBox,this)}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 durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[u.Timeline],mandatory:!0}}),10:Jf.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:h}),11:Qf.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:h}),20:W.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),21:Yf.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:h}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:h},"positive","ppqn",491520),31:b.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:h},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var lr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[u.Selection,u.PianoMode,u.MetaData],mandatory:!1}}),i)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return _(e.visitTrackBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:h},u.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:h},u.Automation,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[u.RegionCollection],mandatory:!1}}),4:W.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[u.ClipCollection],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:h},{values:[0,1,2,3]},""),20:$.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),30:$.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:h},!1)}}};var Mo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[u.Selection,u.NoteEventFeature],mandatory:!1}}),i)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),21:b.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:h},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),23:b.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:h},"bipolar","%",0),24:b.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:h},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:h},{min:0,max:100},"",100)}}};var Pf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:h}),i)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventRepeatBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),3:b.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:h},"bipolar","%",0),4:b.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:h},"unipolar","%",1)}}};var Yn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.NoteEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.NoteEventCollection],mandatory:!0}})}}};var Za=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:h},"any","ppqn"),15:$.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:h}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:h}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var zo=class r extends ze{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:$.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:h},!0),2:$.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:h}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:h},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:h},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:h},"non-negative","")}}};var vl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return _(e.visitNoteClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:zo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Do=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[u.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:b.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:h},"unipolar","%"),14:b.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:h},"any","",NaN)}}};var Xn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.ValueEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.ValueEventCollection],mandatory:!0}})}}};var Io=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:h}),i)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.ValueInterpolation,!0),2:b.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:h},"unipolar","%",.5)}}};var Ga=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return _(e.visitValueRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var yl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return _(e.visitValueClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:zo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Co=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return _(e.visitAudioRegionBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:b.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"any","mixed"),12:b.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","mixed"),13:b.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"any","mixed"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db")}}};var xl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return _(e.visitAudioClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:zo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:b.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),14:b.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical")}}};var wl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioPitchStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioPitchStretchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}})}}};var bl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioTimeStretchBox,this)}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:h},"positive","enum",2),3:b.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:h},"positive","ratio",1)}}};var Sf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.TransientMarkers,!0),2:b.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var To=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:b.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var Al=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return _(e.visitMarkerBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:h},u.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:h},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Tr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[u.AudioFile,u.FileUploadState,u.MetaData],mandatory:!0}}),i)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return _(e.visitAudioFileBox,this)}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:h},"non-negative","s"),2:b.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[u.TransientMarkers],mandatory:!1}})}}};var ei=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[u.SoundfontFile],mandatory:!0}}),i)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:h})}}};var it=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[u.Selection,u.Automation,u.MetaData],mandatory:!1}}),i)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return _(e.visitAudioUnitBox,this)}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:h},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioUnits,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:b.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[u.TrackCollection],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),22:W.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.InstrumentHost,u.AudioOutput],mandatory:!1}}),23:W.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),24:W.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[u.AuxSend],mandatory:!1}}),25:B.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:h},u.Capture,!1)}}};var Ro=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),i)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureAudioBox,this)}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:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:h},"any","",1),11:b.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:h},"decibel","dB",0)}}};var Oo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),i)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureMidiBox,this)}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:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:h},"any","",-1)}}};var Ci=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:h}),i)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return _(e.visitAudioBusBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!1}}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:h}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:h}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:h},"red"),8:$.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:h})}}};var qa=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:h}),i)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return _(e.visitAuxSendBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:h},u.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1),5:b.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB"),6:b.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","")}}};var _l=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[u.Groove],mandatory:!0}}),i)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return _(e.visitGrooveShuffleBox,this)}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:h}),10:b.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"non-negative","ppqn",480)}}};var Ef=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownAudioEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Bf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownMidiEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Ff=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:h}),i)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return _(e.visitDeviceInterfaceKnobBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:h},u.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},u.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),10:b.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:h},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:h})}}};var Xf=class r extends ze{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[u.DeviceUserInterface],mandatory:!1}})}}};var Nf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitModularDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:h},u.ModularSetup,!0),11:Xf.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:h})}}};var kf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitStereoToolDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:b.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),12:b.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),13:$.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:$.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1)}}};var Pl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCompressorDeviceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:$.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),11:$.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!0),12:$.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),13:$.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),14:b.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:b.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:b.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:b.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:b.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",5),20:b.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:b.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var $f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDelayDeviceBox,this)}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 delay(){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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","",4),11:b.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),12:b.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Mf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCrusherDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),11:E.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:16},"bits",16),12:b.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:b.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Df=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDattorroReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:b.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.9999),12:b.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.75),13:b.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.625),14:b.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),15:b.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.7),16:b.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),17:b.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.005),18:b.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),19:b.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.7),20:b.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),21:b.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var If=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVelocityDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:h},"any","",2048),13:b.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),14:b.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),15:b.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Cf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitFoldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:h},{length:3},"",0),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var Tf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTidalDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",-.25),11:b.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),20:b.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",3),21:b.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","",1),22:b.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:b.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var Yc=class r extends ze{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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:4},""),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Xc=class r extends ze{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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var $l=class r extends ze{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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Rf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitRevampDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Yc.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:h}),11:Xc.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:h}),12:$l.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:h}),13:$l.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:h}),14:$l.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:h}),15:Xc.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:h}),16:Yc.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:h}),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Of=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:b.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-3),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var em=class r extends ze{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:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","db",-1/0),3:E.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:b.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var tm=class r extends ze{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:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:$.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),10:b.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%")}}};var rm=class r extends ze{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:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:b.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:b.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:b.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","db",.001)}}};var Sl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVaporisateurDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","oct"),12:b.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:b.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:b.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:b.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:b.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),19:b.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:b.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),21:b.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1]},"",1),23:E.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[1,3,5]},"",1),24:b.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:b.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),26:E.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:b.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),30:tm.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:h}),40:ff.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:h},e=>em.create(e),2),50:rm.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:h}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:h},"any","")}}};var im=class r extends ze{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:h}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h})}}};var El=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:im.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:h}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:h},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:h},"any","ms",10),13:W.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[u.Parameter],mandatory:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:h},u.MIDIDevice,!1)}}};var Ti=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:h}),i)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.MIDIDevice,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:h},{min:0,max:500},"ms",10),6:$.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:h},!0)}}};var Ri=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:h}),i)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputParameterBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:h},{min:0,max:127},"#",64),4:b.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!0}},"unipolar","%")}}};var Bl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:h},u.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:h},{min:0,max:65535},"")}}};var Fl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitNanoDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!1),20:b.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Nl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:W.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[u.Sample],mandatory:!1}})}}};var Vo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[u.Editing],mandatory:!1}}),i)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldSampleBox,this)}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:B.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:h},u.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),12:W.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),13:W.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:h}),22:$.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),23:$.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),40:$.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:h}),41:$.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:h}),42:$.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:h}),43:$.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:h}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:h},{length:3},"",0),45:b.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:b.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),47:b.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),48:b.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:b.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var kl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.Automation],mandatory:!1}}),i)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTapeDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:b.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),13:b.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%")}}};var Vf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitArpeggioDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:3},"",0),11:E.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:5},"oct",1),12:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:17},"",9),13:b.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:E.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:16},"",1),15:b.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","",0)}}};var zf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPitchDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-36,max:36},"st",0),11:b.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:E.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var Uf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitZeitgeistDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0)}}};var jf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:h}),i)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return _(e.visitModularBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModularSetup,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!0}}),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[u.ModuleCollection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[u.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:h})}}};var Lf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:h}),i)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return _(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:h},u.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:h},u.VoltageConnection,!0)}}};var ti=class r extends ze{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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:h},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:h},"any","y"),5:$.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:h},!1),6:$.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:h},!0)}}};var Kf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:ti.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Wf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:ti.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Zf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return _(e.visitModuleDelayBox,this)}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:ti.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Gf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return _(e.visitModuleMultiplierBox,this)}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:ti.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:h},"unipolar","%")}}};var qf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return _(e.visitModuleGainBox,this)}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:ti.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},"decibel","dB")}}};var hn;(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 i=e.pointerHub.filter(u.ValueInterpolation).at(0)?.box;Z(i)?(Ax(i,Io),i.slope.setValue(t.slope)):Io.create(e.box.graph,w.generate(),n=>{n.slope.setValue(t.slope),n.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(Ax(t,Io),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?Fo.None:e.getValue()===1?Fo.Linear:F("Unknown Interpolation value")}})(hn||(hn={}));var Uo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ce=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ed,Ml,ct,td,jo,rd,eo=class r{constructor(e,t){this.type="value-event",ed.set(this,new U),Ml.set(this,void 0),ct.set(this,void 0),td.set(this,void 0),jo.set(this,void 0),rd.set(this,!1),Uo(this,Ml,e,"f"),Uo(this,ct,t,"f"),Uo(this,td,Ce(this,ed,"f").own(new Zh(()=>hn.read(Ce(this,ct,"f").interpolation))),"f");let i=()=>{Ce(this,td,"f").invalidate(),this.collection.ifSome(n=>n.onEventPropertyChanged())};Ce(this,ed,"f").ownAll(Ce(this,ct,"f").subscribe(ke.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let o=this.collection.unwrap(),a=n.address.fieldKeys,s=R.equals(Ce(this,ct,"f").index.address.fieldKeys,a),l=R.equals(Ce(this,ct,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),Ce(this,ct,"f").interpolation.subscribe(i),Ce(this,ct,"f").interpolation.pointerHub.subscribe({onAdded:({box:n})=>{Ce(this,jo,"f").terminate(),Uo(this,jo,n.subscribe(ke.Children,i),"f"),i()},onRemoved:()=>{Ce(this,jo,"f").terminate(),Uo(this,jo,K.Empty,"f"),i()}})),Uo(this,jo,Ce(this,ct,"f").interpolation.pointerHub.filter(u.ValueInterpolation).at(0)?.box.subscribe(ke.Children,i)??K.Empty,"f")}onSelected(){Uo(this,rd,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Uo(this,rd,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Ce(this,jo,"f").terminate(),Ce(this,ed,"f").terminate()}get box(){return Ce(this,ct,"f")}get uuid(){return Ce(this,ct,"f").address.uuid}get address(){return Ce(this,ct,"f").address}get position(){return Ce(this,ct,"f").position.getValue()}get index(){return Ce(this,ct,"f").index.getValue()}set interpolation(e){hn.write(Ce(this,ct,"f").interpolation,e)}get interpolation(){return Ce(this,td,"f").get()}get value(){return Ce(this,ct,"f").value.getValue()}get isSelected(){return Ce(this,rd,"f")}get collection(){return Ce(this,ct,"f").events.targetVertex.map(e=>Ce(this,Ml,"f").boxAdapters.adapterFor(e.box,ur))}copyTo(e){let t=Do.create(Ce(this,Ml,"f").boxGraph,w.generate(),i=>{i.position.setValue(e?.position??this.position),i.index.setValue(e?.index??this.index),i.events.refer(e?.events??this.collection.unwrap().box.events),i.value.setValue(e?.value??this.value)});return hn.write(t.interpolation,e?.interpolation??this.interpolation),Ce(this,Ml,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Ce(this,ct,"f").position.setValue(e?.position??this.position),Ce(this,ct,"f").index.setValue(e?.index??this.index),Ce(this,ct,"f").events.refer(e?.events??this.collection.unwrap().box.events),Ce(this,ct,"f").value.setValue(e?.value??this.value),hn.write(Ce(this,ct,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};ed=new WeakMap,Ml=new WeakMap,ct=new WeakMap,td=new WeakMap,jo=new WeakMap,rd=new WeakMap;eo.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let i=r.index-e.index;if(i!==0)return i;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var id=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Te=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},nd,od,Lo,ri,Ha,ad,to,nm,ur=class r{constructor(e,t){nd.add(this),od.set(this,new U),Lo.set(this,void 0),ri.set(this,void 0),Ha.set(this,void 0),ad.set(this,void 0),to.set(this,void 0),id(this,Lo,e,"f"),id(this,ri,t,"f"),id(this,Ha,new re,"f"),id(this,ad,w.newSet(n=>n.uuid),"f"),id(this,to,xr.create(eo.Comparator),"f");let i=n=>{let o=ee(n.accept({visitValueEventBox:a=>Te(this,Lo,"f").boxAdapters.adapterFor(a,eo)}),`Could not find adapter for ${n}`);Te(this,ad,"f").add(o)&&(Te(this,to,"f").add(o),Te(this,nd,"m",nm).call(this))};Te(this,ri,"f").events.pointerHub.incoming().forEach(({box:n})=>i(n)),Te(this,od,"f").own(Te(this,ri,"f").events.pointerHub.subscribe({onAdded:({box:n})=>i(n),onRemoved:({box:{address:{uuid:n}}})=>{Te(this,to,"f").remove(Te(this,ad,"f").removeByKey(n)),Te(this,nd,"m",nm).call(this)}})),Te(this,od,"f").own(Te(this,ri,"f").owners.pointerHub.subscribe({onAdded:()=>Te(this,Ha,"f").notify(this),onRemoved:()=>Te(this,Ha,"f").notify(this)}))}valueAt(e,t){return pf.valueAt(Te(this,to,"f"),e,t)}copy(){let e=Te(this,Lo,"f").boxGraph,t=Xn.create(e,w.generate());return Te(this,to,"f").asArray().forEach(i=>i.copyTo({events:t.events})),Te(this,Lo,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return t===null?g.None:g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return g.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(t.position===e)return g.wrap(t);if(t.interpolation.type==="none")return g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:n,value:o}=t,{position:a,value:s}=i;return g.wrap(this.createEvent({position:e,value:Gh(o,s,(e-n)/(a-n)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:n,value:o}=t,{position:a,value:s}=i,l=a-n,c=e-n,p=Yr.byHalf(l,o,Yr.valueAt({slope:t.interpolation.slope,steps:l,y0:o,y1:s},l*.5),s),d=Yr.valueAt(p,c),f=Yr.slopeByHalf(o,Yr.valueAt(p,c*.5),d);return hn.write(t.box.interpolation,Fo.Curve(f)),g.wrap(this.createEvent({position:e,value:d,index:0,interpolation:Fo.Curve(Yr.slopeByHalf(d,Yr.valueAt(p,(c+l)*.5),s))}))}return F("Unknown interpolation type")}subscribeChange(e){return Te(this,Ha,"f").subscribe(e)}createEvent({position:e,index:t,value:i,interpolation:n}){let o=Do.create(Te(this,Lo,"f").boxGraph,w.generate(),a=>{a.position.setValue(e),a.index.setValue(t),a.value.setValue(i),a.events.refer(Te(this,ri,"f").events)});return hn.write(o.interpolation,n),Te(this,Lo,"f").boxAdapters.adapterFor(o,eo)}requestSorting(){Te(this,to,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Te(this,nd,"m",nm).call(this)}terminate(){Te(this,od,"f").terminate()}get box(){return Te(this,ri,"f")}get uuid(){return Te(this,ri,"f").address.uuid}get address(){return Te(this,ri,"f").address}get numOwners(){return Te(this,ri,"f").owners.pointerHub.filter(u.ValueEventCollection).length}get events(){return Te(this,to,"f")}toString(){return`{ValueEventCollectionBox ${w.toString(Te(this,ri,"f").address.uuid)}}`}};od=new WeakMap,Lo=new WeakMap,ri=new WeakMap,Ha=new WeakMap,ad=new WeakMap,to=new WeakMap,nd=new WeakSet,nm=function(){Te(this,Ha,"f").notify(this)};var Ja=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},_e=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qa,Ko,Ya,Et,Xa,ud,sd,ld,Dl,Wo=class{constructor(e,t){Qa.add(this),this.type="value-clip",Ko.set(this,new U),Ya.set(this,void 0),Et.set(this,void 0),Xa.set(this,void 0),ud.set(this,void 0),sd.set(this,void 0),ld.set(this,K.Empty),Ja(this,Ya,e,"f"),Ja(this,Et,t,"f"),Ja(this,sd,!0,"f"),Ja(this,Xa,_e(this,Ko,"f").own(new Cr(!1)),"f"),Ja(this,ud,_e(this,Ko,"f").own(new re),"f"),_e(this,Ko,"f").own(_e(this,Et,"f").pointerHub.subscribe({onAdded:()=>_e(this,Qa,"m",Dl).call(this),onRemoved:()=>_e(this,Qa,"m",Dl).call(this)})),_e(this,Ko,"f").own(_e(this,Et,"f").subscribe(ke.Children,i=>_e(this,Qa,"m",Dl).call(this))),_e(this,Ko,"f").own(_e(this,Et,"f").events.catchupAndSubscribe(({targetVertex:i})=>{_e(this,ld,"f").terminate(),Ja(this,ld,i.match({none:()=>K.Empty,some:({box:n})=>_e(this,Ya,"f").boxAdapters.adapterFor(n,ur).subscribeChange(()=>_e(this,Qa,"m",Dl).call(this))}),"f"),_e(this,Qa,"m",Dl).call(this)})),Ja(this,sd,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return _e(this,Xa,"f").catchupAndSubscribe(e)}subscribeChange(e){return _e(this,ud,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&_e(this,Et,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:_e(this,Et,"f").events.targetVertex.unwrap();yl.create(_e(this,Ya,"f").boxGraph,w.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(_e(this,Et,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){_e(this,Xa,"f").setValue(!0)}onDeselected(){_e(this,Xa,"f").setValue(!1)}get isSelected(){return _e(this,Xa,"f").getValue()}terminate(){_e(this,ld,"f").terminate(),_e(this,Ko,"f").terminate()}get box(){return _e(this,Et,"f")}get uuid(){return _e(this,Et,"f").address.uuid}get address(){return _e(this,Et,"f").address}get indexField(){return _e(this,Et,"f").index}get duration(){return _e(this,Et,"f").duration.getValue()}get mute(){return _e(this,Et,"f").mute.getValue()}get hue(){return _e(this,Et,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return _e(this,Et,"f").events.targetVertex.map(e=>_e(this,Ya,"f").boxAdapters.adapterFor(e.box,ur))}get label(){return _e(this,Et,"f").label.getValue()}get trackBoxAdapter(){return _e(this,sd,"f")?g.None:_e(this,Et,"f").clips.targetVertex.map(e=>_e(this,Ya,"f").boxAdapters.adapterFor(e.box,mt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${w.toString(_e(this,Et,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Ko=new WeakMap,Ya=new WeakMap,Et=new WeakMap,Xa=new WeakMap,ud=new WeakMap,sd=new WeakMap,ld=new WeakMap,Qa=new WeakSet,Dl=function(){_e(this,ud,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var OP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Il=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Zx,es,om,Cl=class{constructor(e){this.type="transient-marker",Zx.set(this,new U),es.set(this,void 0),om.set(this,void 0),OP(this,es,e,"f"),OP(this,om,new re,"f")}get box(){return Il(this,es,"f")}get uuid(){return Il(this,es,"f").address.uuid}get address(){return Il(this,es,"f").address}get position(){return Il(this,es,"f").position.getValue()}subscribe(e){return Il(this,om,"f").subscribe(e)}terminate(){Il(this,Zx,"f").terminate()}};Zx=new WeakMap,es=new WeakMap,om=new WeakMap;var cd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Kt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},am,dd,fn,pd,Tl,sm,Oi=class r{constructor(e,t){am.set(this,new U),dd.set(this,void 0),fn.set(this,void 0),pd.set(this,void 0),Tl.set(this,void 0),sm.set(this,void 0),cd(this,dd,e,"f"),cd(this,fn,t,"f"),cd(this,pd,w.newSet(({uuid:i})=>i),"f"),cd(this,Tl,xr.create(r.Comparator),"f"),cd(this,sm,yf.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:i,resolve:n,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(s.terminate(),n(a.data.unwrap("State mismatch"))):l.type==="error"&&(s.terminate(),o(l.reason))});return i}),"f"),Kt(this,am,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Kt(this,dd,"f").boxAdapters.adapterFor(i.box,Cl);Kt(this,pd,"f").add(n)&&Kt(this,Tl,"f").add(n)},onRemoved:({box:{address:{uuid:i}}})=>{Kt(this,Tl,"f").remove(Kt(this,pd,"f").removeByKey(i))}}))}get box(){return Kt(this,fn,"f")}get uuid(){return Kt(this,fn,"f").address.uuid}get address(){return Kt(this,fn,"f").address}get startInSeconds(){return Kt(this,fn,"f").startInSeconds.getValue()}get endInSeconds(){return Kt(this,fn,"f").endInSeconds.getValue()}get transients(){return Kt(this,Tl,"f")}get fileName(){return Kt(this,fn,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Kt(this,sm,"f").call(this)}getOrCreateLoader(){return Kt(this,dd,"f").sampleManager.getOrCreate(Kt(this,fn,"f").address.uuid)}terminate(){Kt(this,am,"f").terminate()}};am=new WeakMap,dd=new WeakMap,fn=new WeakMap,pd=new WeakMap,Tl=new WeakMap,sm=new WeakMap;Oi.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var hd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},cr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fd,lm,um,ro,gd,md,cm,Zo=class{constructor(e,t){fd.add(this),this.type="warp-marker",lm.set(this,new U),um.set(this,void 0),ro.set(this,void 0),gd.set(this,void 0),md.set(this,!1),hd(this,um,e,"f"),hd(this,ro,t,"f"),hd(this,gd,new re,"f"),cr(this,lm,"f").own(t.subscribe(ke.Children,()=>cr(this,fd,"m",cm).call(this)))}onSelected(){hd(this,md,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),cr(this,fd,"m",cm).call(this)}onDeselected(){hd(this,md,!1,"f"),cr(this,fd,"m",cm).call(this)}get box(){return cr(this,ro,"f")}get uuid(){return cr(this,ro,"f").address.uuid}get address(){return cr(this,ro,"f").address}get position(){return cr(this,ro,"f").position.getValue()}get seconds(){return cr(this,ro,"f").seconds.getValue()}get isSelected(){return cr(this,md,"f")}get optWarping(){return cr(this,ro,"f").owner.targetVertex.map(e=>cr(this,um,"f").boxAdapters.adapterFor(e.box,mn.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return cr(this,gd,"f").subscribe(e)}terminate(){cr(this,lm,"f").terminate()}};lm=new WeakMap,um=new WeakMap,ro=new WeakMap,gd=new WeakMap,md=new WeakMap,fd=new WeakSet,cm=function(){cr(this,gd,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var dm=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var vd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Jt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},pm,hm,ts,rs,yd,Rl,gn=class{constructor(e,t){pm.set(this,new U),hm.set(this,void 0),ts.set(this,void 0),rs.set(this,void 0),yd.set(this,void 0),Rl.set(this,void 0),vd(this,hm,e,"f"),vd(this,ts,t,"f"),vd(this,rs,new re,"f"),vd(this,yd,w.newSet(({uuid:i})=>i),"f"),vd(this,Rl,xr.create(dm),"f"),Jt(this,pm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Jt(this,hm,"f").boxAdapters.adapterFor(i.box,Zo);Jt(this,yd,"f").add(n)&&(Jt(this,Rl,"f").add(n),Jt(this,rs,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{Jt(this,Rl,"f").remove(Jt(this,yd,"f").removeByKey(i)),Jt(this,rs,"f").notify()}}))}get box(){return Jt(this,ts,"f")}get uuid(){return Jt(this,ts,"f").address.uuid}get address(){return Jt(this,ts,"f").address}get warpMarkers(){return Jt(this,Rl,"f")}clone(){let e=wl.create(Jt(this,ts,"f").graph,w.generate());return this.warpMarkers.asArray().forEach(t=>To.create(e.graph,w.generate(),i=>{i.position.setValue(t.position),i.seconds.setValue(t.seconds),i.owner.refer(e.warpMarkers)})),e}subscribe(e){return Jt(this,rs,"f").subscribe(e)}onChanged(){Jt(this,rs,"f").notify()}terminate(){Jt(this,pm,"f").terminate()}};pm=new WeakMap,hm=new WeakMap,ts=new WeakMap,rs=new WeakMap,yd=new WeakMap,Rl=new WeakMap;var xd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Bt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fm,mm,Vi,is,wd,Ol,vn=class{constructor(e,t){fm.set(this,new U),mm.set(this,void 0),Vi.set(this,void 0),is.set(this,void 0),wd.set(this,void 0),Ol.set(this,void 0),xd(this,mm,e,"f"),xd(this,Vi,t,"f"),xd(this,is,new re,"f"),xd(this,wd,w.newSet(({uuid:i})=>i),"f"),xd(this,Ol,xr.create(dm),"f"),Bt(this,fm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Bt(this,mm,"f").boxAdapters.adapterFor(i.box,Zo);Bt(this,wd,"f").add(n)&&(Bt(this,Ol,"f").add(n),Bt(this,is,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{Bt(this,Ol,"f").remove(Bt(this,wd,"f").removeByKey(i)),Bt(this,is,"f").notify()}}))}get box(){return Bt(this,Vi,"f")}get uuid(){return Bt(this,Vi,"f").address.uuid}get address(){return Bt(this,Vi,"f").address}get warpMarkers(){return Bt(this,Ol,"f")}get playbackRate(){return Bt(this,Vi,"f").playbackRate.getValue()}get cents(){return Math.log2(Bt(this,Vi,"f").playbackRate.getValue())*1200}set cents(e){Bt(this,Vi,"f").playbackRate.setValue(le(2**(e/1200),.5,2))}get transientPlayMode(){return Jr(Bt(this,Vi,"f").transientPlayMode.getValue(),ko)}clone(){let e=bl.create(Bt(this,Vi,"f").graph,w.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>To.create(e.graph,w.generate(),i=>{i.position.setValue(t.position),i.seconds.setValue(t.seconds),i.owner.refer(e.warpMarkers)})),e}subscribe(e){return Bt(this,is,"f").subscribe(e)}onChanged(){Bt(this,is,"f").notify()}terminate(){Bt(this,fm,"f").terminate()}};fm=new WeakMap,mm=new WeakMap,Vi=new WeakMap,is=new WeakMap,wd=new WeakMap,Ol=new WeakMap;var mn;(function(r){r.isAudioPlayMode=e=>e instanceof gn||e instanceof vn})(mn||(mn={}));var Rr=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},oe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ns,Vl,os,dt,as,ss,bd,_d,Ad,ls,zl,Ul,jl,io=class r{constructor(e,t){ns.add(this),this.type="audio-clip",Vl.set(this,new U),os.set(this,void 0),dt.set(this,void 0),as.set(this,void 0),ss.set(this,void 0),bd.set(this,void 0),_d.set(this,void 0),Ad.set(this,void 0),ls.set(this,g.None),zl.set(this,g.None),Ul.set(this,K.Empty),Rr(this,os,e,"f"),Rr(this,dt,t,"f"),Rr(this,Ad,!0,"f"),Rr(this,as,new Xr,"f"),Rr(this,ss,oe(this,Vl,"f").own(new Cr(!1)),"f"),Rr(this,bd,Bo.aware(e.tempoMap,t.timeBase,r.STATIC_POSITION,t.duration),"f"),Rr(this,_d,oe(this,Vl,"f").own(new re),"f"),oe(this,Vl,"f").ownAll(oe(this,dt,"f").pointerHub.subscribe({onAdded:()=>oe(this,ns,"m",jl).call(this),onRemoved:()=>oe(this,ns,"m",jl).call(this)}),oe(this,dt,"f").playMode.catchupAndSubscribe(({targetVertex:i})=>{oe(this,Ul,"f").terminate(),i.match({none:()=>oe(this,as,"f").clear(),some:({box:n})=>{let o=oe(this,os,"f").boxAdapters.adapterFor(n,mn.isAudioPlayMode);Rr(this,Ul,o.subscribe(()=>oe(this,ns,"m",jl).call(this)),"f"),oe(this,as,"f").wrap(o)}})}),oe(this,dt,"f").file.catchupAndSubscribe(i=>{Rr(this,ls,i.targetVertex.map(n=>oe(this,os,"f").boxAdapters.adapterFor(n.box,Oi)),"f"),oe(this,zl,"f").ifSome(n=>n.terminate()),Rr(this,zl,oe(this,ls,"f").map(n=>n.getOrCreateLoader().subscribe(()=>oe(this,ns,"m",jl).call(this))),"f")}),oe(this,dt,"f").subscribe(ke.Children,i=>oe(this,ns,"m",jl).call(this))),Rr(this,Ad,!1,"f")}catchupAndSubscribeSelected(e){return oe(this,ss,"f").catchupAndSubscribe(e)}subscribeChange(e){return oe(this,_d,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(i=>i.clone());xl.create(oe(this,os,"f").boxGraph,w.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.gain.setValue(this.gain.getValue()),i.timeBase.setValue(this.timeBase),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(oe(this,dt,"f").clips.targetVertex.unwrap()),i.file.refer(oe(this,dt,"f").file.targetVertex.unwrap()),i.events.refer(oe(this,dt,"f").events.targetVertex.unwrap()),t.ifSome(n=>i.playMode.refer(n))})}onSelected(){oe(this,ss,"f").setValue(!0)}onDeselected(){oe(this,ss,"f").setValue(!1)}get isSelected(){return oe(this,ss,"f").getValue()}get box(){return oe(this,dt,"f")}get uuid(){return oe(this,dt,"f").address.uuid}get address(){return oe(this,dt,"f").address}get indexField(){return oe(this,dt,"f").index}get duration(){return oe(this,bd,"f").toPPQN()}set duration(e){oe(this,bd,"f").fromPPQN(e)}get mute(){return oe(this,dt,"f").mute.getValue()}get hue(){return oe(this,dt,"f").hue.getValue()}get gain(){return oe(this,dt,"f").gain}get file(){return oe(this,ls,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return oe(this,as,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return g.None}get timeBase(){return Jr(oe(this,dt,"f").timeBase.getValue(),sr)}get waveformOffset(){return oe(this,dt,"f").waveformOffset}get isPlayModeNoStretch(){return oe(this,dt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ie(e,gn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ie(e,vn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>mn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(oe(this,ls,"f").isEmpty())return"No Audio File";let e=oe(this,ls,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):oe(this,dt,"f").label.getValue()}get trackBoxAdapter(){return oe(this,Ad,"f")?g.None:oe(this,dt,"f").clips.targetVertex.map(e=>oe(this,os,"f").boxAdapters.adapterFor(e.box,mt))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return oe(this,as,"f").nonEmpty()}terminate(){oe(this,zl,"f").ifSome(e=>e.terminate()),Rr(this,zl,g.None,"f"),oe(this,Ul,"f").terminate(),Rr(this,Ul,K.Empty,"f"),oe(this,Vl,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${w.toString(oe(this,dt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Vl=new WeakMap,os=new WeakMap,dt=new WeakMap,as=new WeakMap,ss=new WeakMap,bd=new WeakMap,_d=new WeakMap,Ad=new WeakMap,ls=new WeakMap,zl=new WeakMap,Ul=new WeakMap,ns=new WeakSet,jl=function(){oe(this,_d,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};io.STATIC_POSITION={getValue:()=>0};var Pd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},yt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ll,Dt,gm,Sd,us=class r{constructor(e,t){this.type="note-event",Ll.set(this,void 0),Dt.set(this,void 0),gm.set(this,void 0),Sd.set(this,!1),Pd(this,Ll,e,"f"),Pd(this,Dt,t,"f"),Pd(this,gm,yt(this,Dt,"f").subscribe(ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),o=i.address.fieldKeys,a=R.equals(yt(this,Dt,"f").pitch.address.fieldKeys,o),s=R.equals(yt(this,Dt,"f").position.address.fieldKeys,o);a||s?n.requestSorting():n.onEventPropertyChanged()}}),"f")}onSelected(){Pd(this,Sd,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Pd(this,Sd,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){yt(this,gm,"f").terminate()}get box(){return yt(this,Dt,"f")}get uuid(){return yt(this,Dt,"f").address.uuid}get address(){return yt(this,Dt,"f").address}get position(){return yt(this,Dt,"f").position.getValue()}get duration(){return yt(this,Dt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return yt(this,Dt,"f").velocity.getValue()}get pitch(){return yt(this,Dt,"f").pitch.getValue()}get cent(){return yt(this,Dt,"f").cent.getValue()}get chance(){return yt(this,Dt,"f").chance.getValue()}get playCount(){return yt(this,Dt,"f").playCount.getValue()}get playCurve(){return yt(this,Dt,"f").playCurve.getValue()}get isSelected(){return yt(this,Sd,"f")}get collection(){return yt(this,Dt,"f").events.targetVertex.map(e=>yt(this,Ll,"f").boxAdapters.adapterFor(e.box,ii))}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 yt(this,Ll,"f").boxAdapters.adapterFor(Mo.create(yt(this,Ll,"f").boxGraph,w.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 ar.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,i=R.create(n=>{let o=Math.floor(this.computeCurveValue(n/e)*this.duration),a=Math.floor(this.computeCurveValue((n+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 yt(this,Dt,"f").delete(),i}};Ll=new WeakMap,Dt=new WeakMap,gm=new WeakMap,Sd=new WeakMap;var yn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},me=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},no,Ed,Go,zi,cs,Bd,ni,ym,xm,wm,qo,vm,Fd,ii=class r{constructor(e,t){no.add(this),Ed.set(this,new U),Go.set(this,void 0),zi.set(this,void 0),cs.set(this,void 0),Bd.set(this,void 0),ni.set(this,void 0),ym.set(this,60),xm.set(this,60),wm.set(this,0),qo.set(this,!1),yn(this,Go,e,"f"),yn(this,zi,t,"f"),yn(this,cs,new re,"f"),yn(this,Bd,w.newSet(i=>i.uuid),"f"),yn(this,ni,xr.create(ar.Comparator),"f"),me(this,Ed,"f").own(me(this,zi,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=me(this,Go,"f").boxAdapters.adapterFor(i,us);me(this,Bd,"f").add(n)&&(me(this,ni,"f").add(n),me(this,no,"m",vm).call(this))},onRemoved:({box:{address:{uuid:i}}})=>{me(this,ni,"f").remove(me(this,Bd,"f").removeByKey(i)),me(this,no,"m",vm).call(this)}})),me(this,Ed,"f").own(me(this,zi,"f").owners.pointerHub.subscribe({onAdded:()=>me(this,cs,"f").notify(this),onRemoved:()=>me(this,cs,"f").notify(this)}))}copy(){let e=me(this,Go,"f").boxGraph,t=Yn.create(e,w.generate());return me(this,ni,"f").asArray().forEach(i=>i.copyTo({events:t.events})),me(this,Go,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:i,pitch:n,chance:o,playCount:a,cent:s}){return me(this,Go,"f").boxAdapters.adapterFor(Mo.create(me(this,Go,"f").boxGraph,w.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(i),l.pitch.setValue(n),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(me(this,zi,"f").events)}),us)}subscribeChange(e){return me(this,cs,"f").subscribe(e)}selectable(){return me(this,ni,"f").asArray()}selectableAt(e){for(let t of me(this,ni,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Xe.one(t);return Xe.empty()}selectablesBetween(e,t){let i=[];for(let n of me(this,ni,"f").asArray())Rc.intersect1D(n.position,n.complete,e.u,t.u)&&Rc.intersect1D(n.pitch,n.pitch,e.v,t.v)&&i.push(n);return i}requestSorting(){me(this,ni,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){me(this,no,"m",vm).call(this)}terminate(){me(this,Ed,"f").terminate()}get box(){return me(this,zi,"f")}get uuid(){return me(this,zi,"f").address.uuid}get address(){return me(this,zi,"f").address}get numOwners(){return me(this,zi,"f").owners.pointerHub.filter(u.NoteEventCollection).length}get events(){return me(this,qo,"f")||me(this,no,"m",Fd).call(this),me(this,ni,"f")}get minPitch(){return me(this,qo,"f")||me(this,no,"m",Fd).call(this),me(this,ym,"f")}get maxPitch(){return me(this,qo,"f")||me(this,no,"m",Fd).call(this),me(this,xm,"f")}get maxDuration(){return me(this,qo,"f")||me(this,no,"m",Fd).call(this),me(this,wm,"f")}toString(){return`{NoteEventCollectionBox ${w.toString(me(this,zi,"f").address.uuid)}}`}};Ed=new WeakMap,Go=new WeakMap,zi=new WeakMap,cs=new WeakMap,Bd=new WeakMap,ni=new WeakMap,ym=new WeakMap,xm=new WeakMap,wm=new WeakMap,qo=new WeakMap,no=new WeakSet,vm=function(){yn(this,qo,!1,"f"),me(this,cs,"f").notify(this)},Fd=function(){let e=127,t=0,i=0;me(this,ni,"f").asArray().forEach(({pitch:n,duration:o})=>{e=Math.min(e,n),t=Math.max(t,n),i=Math.max(i,o)}),yn(this,ym,e,"f"),yn(this,xm,t,"f"),yn(this,wm,i,"f"),yn(this,qo,!0,"f")};var ds=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ee=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ps,Kl,hs,Ft,fs,$d,Nd,kd,Wl,Zl=class{constructor(e,t){ps.add(this),this.type="note-clip",Kl.set(this,new U),hs.set(this,void 0),Ft.set(this,void 0),fs.set(this,void 0),$d.set(this,void 0),Nd.set(this,void 0),kd.set(this,K.Empty),ds(this,hs,e,"f"),ds(this,Ft,t,"f"),ds(this,Nd,!0,"f"),ds(this,fs,Ee(this,Kl,"f").own(new Cr(!1)),"f"),ds(this,$d,Ee(this,Kl,"f").own(new re),"f"),Ee(this,Kl,"f").ownAll(Ee(this,Ft,"f").pointerHub.subscribe({onAdded:()=>Ee(this,ps,"m",Wl).call(this),onRemoved:()=>Ee(this,ps,"m",Wl).call(this)}),Ee(this,Ft,"f").subscribe(ke.Children,i=>Ee(this,ps,"m",Wl).call(this)),Ee(this,Ft,"f").events.catchupAndSubscribe(({targetVertex:i})=>{Ee(this,kd,"f").terminate(),ds(this,kd,i.match({none:()=>K.Empty,some:({box:n})=>Ee(this,hs,"f").boxAdapters.adapterFor(n,ii).subscribeChange(()=>Ee(this,ps,"m",Wl).call(this))}),"f"),Ee(this,ps,"m",Wl).call(this)})),ds(this,Nd,!1,"f")}catchupAndSubscribeSelected(e){return Ee(this,fs,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ee(this,$d,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ee(this,Ft,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ee(this,Ft,"f").events.targetVertex.unwrap();vl.create(Ee(this,hs,"f").boxGraph,w.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(Ee(this,Ft,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){Ee(this,fs,"f").setValue(!0)}onDeselected(){Ee(this,fs,"f").setValue(!1)}get isSelected(){return Ee(this,fs,"f").getValue()}terminate(){Ee(this,kd,"f").terminate(),Ee(this,Kl,"f").terminate()}get box(){return Ee(this,Ft,"f")}get uuid(){return Ee(this,Ft,"f").address.uuid}get address(){return Ee(this,Ft,"f").address}get indexField(){return Ee(this,Ft,"f").index}get duration(){return Ee(this,Ft,"f").duration.getValue()}get mute(){return Ee(this,Ft,"f").mute.getValue()}get hue(){return Ee(this,Ft,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ee(this,Ft,"f").events.targetVertex.map(e=>Ee(this,hs,"f").boxAdapters.adapterFor(e.box,ii))}get label(){return Ee(this,Ft,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,Nd,"f")?g.None:Ee(this,Ft,"f").clips.targetVertex.map(e=>Ee(this,hs,"f").boxAdapters.adapterFor(e.box,mt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${w.toString(Ee(this,Ft,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Kl=new WeakMap,hs=new WeakMap,Ft=new WeakMap,fs=new WeakMap,$d=new WeakMap,Nd=new WeakMap,kd=new WeakMap,ps=new WeakSet,Wl=function(){Ee(this,$d,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var bm={for:(r,e)=>ee(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Zl),visitValueClipBox:t=>r.adapterFor(t,Wo),visitAudioClipBox:t=>r.adapterFor(t,io)}),"")};var Am=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ho=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},_m,Gl,Md,Dd,Pm=class{constructor(e,t){_m.set(this,void 0),Gl.set(this,void 0),Md.set(this,void 0),Dd.set(this,void 0),Am(this,_m,e,"f"),Am(this,Gl,new U,"f"),Am(this,Md,Ho(this,Gl,"f").own(new re),"f"),Am(this,Dd,Ho(this,Gl,"f").own(Lt.create(e.box.clips,i=>bm.for(t,i),u.ClipCollection)),"f"),Ho(this,Dd,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Ho(this,_m,"f")}get collection(){return Ho(this,Dd,"f")}dispatchChange(){Ho(this,Md,"f").notify()}subscribeChanges(e){return Ho(this,Md,"f").subscribe(e)}terminate(){Ho(this,Gl,"f").terminate()}};_m=new WeakMap,Gl=new WeakMap,Md=new WeakMap,Dd=new WeakMap;var gt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},G=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Or,Id,xn,Ke,Cd,Td,Rd,oo,Od,Vd,ms,ql,Hl,Jl,Ql,Yl,oi,Jo=class r{constructor(e,t){Or.add(this),this.type="audio-region",Id.set(this,void 0),xn.set(this,void 0),Ke.set(this,void 0),Cd.set(this,void 0),Td.set(this,void 0),Rd.set(this,void 0),oo.set(this,void 0),Od.set(this,void 0),Vd.set(this,void 0),ms.set(this,g.None),ql.set(this,K.Empty),Hl.set(this,K.Empty),Jl.set(this,K.Empty),Ql.set(this,K.Empty),Yl.set(this,void 0),gt(this,xn,e,"f"),gt(this,Ke,t,"f"),gt(this,Id,new U,"f");let{timeBase:i,position:n,duration:o,loopOffset:a,loopDuration:s}=t;gt(this,Cd,Bo.aware(e.tempoMap,i,n,o),"f"),gt(this,Td,Bo.aware(e.tempoMap,i,n,a),"f"),gt(this,Rd,Bo.aware(e.tempoMap,i,n,s),"f"),gt(this,oo,new Xr,"f"),gt(this,Od,new re,"f"),gt(this,Yl,!1,"f"),gt(this,Vd,!0,"f"),G(this,Id,"f").ownAll(G(this,Ke,"f").pointerHub.subscribe({onAdded:()=>G(this,Or,"m",oi).call(this),onRemoved:()=>G(this,Or,"m",oi).call(this)}),G(this,Ke,"f").file.catchupAndSubscribe(l=>{gt(this,ms,l.targetVertex.map(c=>G(this,xn,"f").boxAdapters.adapterFor(c.box,Oi)),"f"),G(this,ql,"f").terminate(),gt(this,ql,G(this,ms,"f").mapOr(c=>c.getOrCreateLoader().subscribe(()=>G(this,Or,"m",oi).call(this)),K.Empty),"f")}),G(this,Ke,"f").playMode.catchupAndSubscribe(({targetVertex:l})=>{G(this,Hl,"f").terminate(),l.match({none:()=>G(this,oo,"f").clear(),some:({box:c})=>{let p=G(this,xn,"f").boxAdapters.adapterFor(c,mn.isAudioPlayMode);gt(this,Hl,p.subscribe(()=>G(this,Or,"m",oi).call(this)),"f"),G(this,oo,"f").wrap(p)}})}),G(this,Ke,"f").timeBase.catchupAndSubscribe(l=>{G(this,Jl,"f").terminate(),Jr(l.getValue(),sr)===sr.Seconds&>(this,Jl,e.tempoMap.subscribe(()=>G(this,Or,"m",oi).call(this)),"f")}),G(this,Ke,"f").subscribe(ke.Children,l=>{if(!this.trackBoxAdapter.isEmpty()&&(l.type==="primitive"||l.type==="pointer")){let c=this.trackBoxAdapter.unwrap();G(this,Ke,"f").position.address.equals(l.address)?(c.regions.onIndexingChanged(),G(this,Or,"m",oi).call(this)):G(this,Or,"m",oi).call(this)}}),G(this,Ke,"f").events.catchupAndSubscribe(({targetVertex:l})=>{G(this,Ql,"f").terminate(),gt(this,Ql,l.match({none:()=>K.Empty,some:({box:c})=>G(this,xn,"f").boxAdapters.adapterFor(c,ur).subscribeChange(()=>G(this,Or,"m",oi).call(this))}),"f"),G(this,Or,"m",oi).call(this)})),gt(this,Vd,!1,"f")}subscribeChange(e){return G(this,Od,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){gt(this,Yl,!0,"f"),G(this,Or,"m",oi).call(this)}onDeselected(){gt(this,Yl,!1,"f"),G(this,Or,"m",oi).call(this)}get isSelected(){return G(this,Yl,"f")}get box(){return G(this,Ke,"f")}get uuid(){return G(this,Ke,"f").address.uuid}get address(){return G(this,Ke,"f").address}get position(){return G(this,Ke,"f").position.getValue()}get duration(){return G(this,Cd,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return G(this,Td,"f").toPPQN()}get loopDuration(){return G(this,Rd,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return G(this,Ke,"f").mute.getValue()}get hue(){return G(this,Ke,"f").hue.getValue()}get gain(){return G(this,Ke,"f").gain}get file(){return G(this,ms,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return G(this,oo,"f")}get timeBase(){return Jr(G(this,Ke,"f").timeBase.getValue(),sr)}get waveformOffset(){return G(this,Ke,"f").waveformOffset}get isPlayModeNoStretch(){return G(this,Ke,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ie(e,gn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ie(e,vn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>mn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(G(this,ms,"f").isEmpty())return"No Audio File";let e=G(this,ms,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):G(this,Ke,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return G(this,oo,"f").nonEmpty()}get trackBoxAdapter(){return G(this,Ke,"f").regions.targetVertex.map(e=>G(this,xn,"f").boxAdapters.adapterFor(e.box,mt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return G(this,Ke,"f").events.targetVertex.map(e=>G(this,xn,"f").boxAdapters.adapterFor(e.box,ur))}set position(e){G(this,Ke,"f").position.setValue(e)}set duration(e){G(this,oo,"f").nonEmpty()&&G(this,Cd,"f").fromPPQN(e)}set loopOffset(e){G(this,Td,"f").fromPPQN(e)}set loopDuration(e){G(this,oo,"f").nonEmpty()&&G(this,Rd,"f").fromPPQN(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners,n=this.observableOptPlayMode.map(a=>a.clone()),o=G(this,xn,"f").boxAdapters.adapterFor(Co.create(G(this,xn,"f").boxGraph,w.generate(),a=>{a.timeBase.setValue(G(this,Ke,"f").timeBase.getValue()),a.position.setValue(e?.position??G(this,Ke,"f").position.getValue()),a.regions.refer(e?.track??G(this,Ke,"f").regions.targetVertex.unwrap()),a.file.refer(G(this,Ke,"f").file.targetVertex.unwrap()),a.events.refer(i),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()),n.ifSome(s=>a.playMode.refer(s))}),r);return o.duration=e?.duration??this.duration,o.loopOffset=e?.loopOffset??this.loopOffset,o.loopDuration=e?.loopDuration??this.loopDuration,o}consolidate(){}canFlatten(e){return!1}flatten(e){return g.None}terminate(){G(this,ql,"f").terminate(),gt(this,ql,K.Empty,"f"),G(this,Jl,"f").terminate(),gt(this,Jl,K.Empty,"f"),G(this,Hl,"f").terminate(),gt(this,Hl,K.Empty,"f"),G(this,Ql,"f").terminate(),gt(this,Ql,K.Empty,"f"),G(this,Id,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${w.toString(G(this,Ke,"f").address.uuid)}}`}};Id=new WeakMap,xn=new WeakMap,Ke=new WeakMap,Cd=new WeakMap,Td=new WeakMap,Rd=new WeakMap,oo=new WeakMap,Od=new WeakMap,Vd=new WeakMap,ms=new WeakMap,ql=new WeakMap,Hl=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,Yl=new WeakMap,Or=new WeakSet,oi=function(){G(this,Vd,"f")||(G(this,Od,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var ao=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},de=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},wn,Sm,bn,et,jd,zd,Xl,Ud,so,Qo=class r{constructor(e,t){wn.add(this),this.type="note-region",Sm.set(this,new U),bn.set(this,void 0),et.set(this,void 0),jd.set(this,void 0),zd.set(this,void 0),Xl.set(this,void 0),Ud.set(this,K.Empty),ao(this,bn,e,"f"),ao(this,et,t,"f"),ao(this,jd,new re,"f"),ao(this,Xl,!1,"f"),ao(this,zd,!0,"f"),de(this,Sm,"f").ownAll(de(this,et,"f").pointerHub.subscribe({onAdded:()=>de(this,wn,"m",so).call(this),onRemoved:()=>de(this,wn,"m",so).call(this)}),de(this,et,"f").subscribe(ke.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();de(this,et,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),de(this,wn,"m",so).call(this)):de(this,wn,"m",so).call(this)}}),de(this,et,"f").events.catchupAndSubscribe(({targetVertex:i})=>{de(this,Ud,"f").terminate(),ao(this,Ud,i.match({none:()=>K.Empty,some:({box:n})=>de(this,bn,"f").boxAdapters.adapterFor(n,ii).subscribeChange(()=>de(this,wn,"m",so).call(this))}),"f"),de(this,wn,"m",so).call(this)})),ao(this,zd,!1,"f")}set position(e){de(this,et,"f").position.setValue(e)}set duration(e){de(this,et,"f").duration.setValue(e)}set loopOffset(e){de(this,et,"f").loopOffset.setValue(e)}set loopDuration(e){de(this,et,"f").loopDuration.setValue(e)}subscribeChange(e){return de(this,jd,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){ao(this,Xl,!0,"f"),de(this,wn,"m",so).call(this)}onDeselected(){ao(this,Xl,!1,"f"),de(this,wn,"m",so).call(this)}get isSelected(){return de(this,Xl,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let i=t.unwrap(),n=qt.globalToLocal(this,e);for(let o of i.events.iterateFrom(n-i.maxDuration)){if(n<o.position)return;n<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){de(this,Ud,"f").terminate(),de(this,Sm,"f").terminate()}get box(){return de(this,et,"f")}get uuid(){return de(this,et,"f").address.uuid}get address(){return de(this,et,"f").address}get position(){return de(this,et,"f").position.getValue()}get duration(){return de(this,et,"f").duration.getValue()}get loopOffset(){return de(this,et,"f").loopOffset.getValue()}get loopDuration(){return de(this,et,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return de(this,et,"f").mute.getValue()}get hue(){return de(this,et,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return de(this,et,"f").events.targetVertex.map(e=>de(this,bn,"f").boxAdapters.adapterFor(e.box,ii))}get label(){return de(this,et,"f").label.getValue()}get trackBoxAdapter(){return de(this,zd,"f")?g.None:de(this,et,"f").regions.targetVertex.map(e=>de(this,bn,"f").boxAdapters.adapterFor(e.box,mt))}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"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return de(this,bn,"f").boxAdapters.adapterFor(Za.create(de(this,bn,"f").boxGraph,w.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??de(this,et,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=de(this,bn,"f").boxGraph,i=Yn.create(t,w.generate());e.events.asArray().forEach(n=>n.copyTo({events:i.events})),de(this,et,"f").events.refer(i.owners)})}canFlatten(e){return e.length>0&&R.satisfy(e,(t,i)=>t.trackBoxAdapter.contains(i.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return g.None;let t=de(this,bn,"f").boxGraph,i=e.toSorted(Eo.Comparator),n=R.getFirst(i,"Internal error (no first)"),o=R.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),c=Yn.create(t,w.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of qt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),D=Math.floor(m-y);for(let M of f.optCollection.unwrap().events.iterateRange(x,D))M.copyTo({position:M.position+y-n.position,events:c.events})}}),p.forEach(({box:d})=>d.delete()),g.wrap(Za.create(t,w.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(c.owners),d.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${w.toString(de(this,et,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Sm=new WeakMap,bn=new WeakMap,et=new WeakMap,jd=new WeakMap,zd=new WeakMap,Xl=new WeakMap,Ud=new WeakMap,wn=new WeakSet,so=function(){de(this,jd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var lo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ue=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ui,eu,An,tt,Wd,tu,Ld,Kd,_n,uo=class r{constructor(e,t){Ui.add(this),this.type="value-region",eu.set(this,new U),An.set(this,void 0),tt.set(this,void 0),Wd.set(this,void 0),tu.set(this,void 0),Ld.set(this,void 0),Kd.set(this,K.Empty),lo(this,An,e,"f"),lo(this,tt,t,"f"),lo(this,Ld,!0,"f"),lo(this,Wd,new re,"f"),lo(this,tu,!1,"f"),ue(this,eu,"f").own(ue(this,tt,"f").pointerHub.subscribe({onAdded:()=>ue(this,Ui,"m",_n).call(this),onRemoved:()=>ue(this,Ui,"m",_n).call(this)})),ue(this,eu,"f").own(ue(this,tt,"f").subscribe(ke.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();ue(this,tt,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),ue(this,Ui,"m",_n).call(this)):ue(this,Ui,"m",_n).call(this)}})),ue(this,eu,"f").own(ue(this,tt,"f").events.catchupAndSubscribe(({targetVertex:i})=>{ue(this,Kd,"f").terminate(),lo(this,Kd,i.match({none:()=>K.Empty,some:({box:n})=>ue(this,An,"f").boxAdapters.adapterFor(n,ur).subscribeChange(()=>ue(this,Ui,"m",_n).call(this))}),"f"),ue(this,Ui,"m",_n).call(this)})),lo(this,Ld,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(qt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let i=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?i.valueAt(this.loopDuration,e):i.valueAt(qt.globalToLocal(this,this.complete),e)}subscribeChange(e){return ue(this,Wd,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){lo(this,tu,!0,"f"),ue(this,Ui,"m",_n).call(this)}onDeselected(){lo(this,tu,!1,"f"),ue(this,Ui,"m",_n).call(this)}get isSelected(){return ue(this,tu,"f")}onValuesPropertyChanged(){ue(this,Ui,"m",_n).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){ue(this,Kd,"f").terminate(),ue(this,eu,"f").terminate()}get box(){return ue(this,tt,"f")}get uuid(){return ue(this,tt,"f").address.uuid}get address(){return ue(this,tt,"f").address}get position(){return ue(this,tt,"f").position.getValue()}get duration(){return ue(this,tt,"f").duration.getValue()}get loopOffset(){return ue(this,tt,"f").loopOffset.getValue()}get loopDuration(){return ue(this,tt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return ue(this,tt,"f").mute.getValue()}get hue(){return ue(this,tt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return ue(this,tt,"f").events.targetVertex.map(e=>ue(this,An,"f").boxAdapters.adapterFor(e.box,ur))}get label(){return ue(this,tt,"f").label.getValue()}get trackBoxAdapter(){return ue(this,Ld,"f")?g.None:ue(this,tt,"f").regions.targetVertex.map(e=>ue(this,An,"f").boxAdapters.adapterFor(e.box,mt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){ue(this,tt,"f").position.setValue(e)}set duration(e){ue(this,tt,"f").duration.setValue(e)}set loopOffset(e){ue(this,tt,"f").loopOffset.setValue(e)}set loopDuration(e){ue(this,tt,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return ue(this,An,"f").boxAdapters.adapterFor(Ga.create(ue(this,An,"f").boxGraph,w.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??ue(this,tt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=ue(this,An,"f").boxGraph,i=Xn.create(t,w.generate());e.asArray().forEach(n=>n.copyTo({events:i.events})),ue(this,tt,"f").events.refer(i.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return g.None;let t=ue(this,An,"f").boxGraph,i=e.toSorted(Eo.Comparator),n=R.getFirst(i,"Internal error (no first)"),o=R.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),c=Xn.create(t,w.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of qt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),D=Math.floor(m-y);for(let M of f.events.unwrap().iterateRange(x,D));}}),p.forEach(({box:d})=>d.delete()),g.wrap(Ga.create(t,w.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(c.owners),d.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${w.toString(ue(this,tt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};eu=new WeakMap,An=new WeakMap,tt=new WeakMap,Wd=new WeakMap,tu=new WeakMap,Ld=new WeakMap,Kd=new WeakMap,Ui=new WeakSet,_n=function(){ue(this,Wd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var VP=(r,e)=>r.position-e.position,zP={for:(r,e)=>ee(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,Qo),visitAudioRegionBox:t=>r.adapterFor(t,Jo),visitValueRegionBox:t=>r.adapterFor(t,uo)}),"")};var ru=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Zd,gs,Gd,iu,vs,nu,Em=class{constructor(e,t){Zd.set(this,void 0),gs.set(this,void 0),Gd.set(this,void 0),iu.set(this,void 0),vs.set(this,void 0),nu.set(this,void 0),ru(this,Zd,e,"f"),ru(this,gs,new U,"f"),ru(this,Gd,Ut(this,gs,"f").own(new re),"f"),ru(this,iu,Ut(this,gs,"f").own(new Mt),"f"),ru(this,vs,Eo.create(VP),"f"),ru(this,nu,w.newSet(i=>i.uuid),"f"),Ut(this,gs,"f").ownAll(Ut(this,Zd,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=zP.for(t,i),o=Ut(this,nu,"f").add(n);I(o,`Cannot add ${i}`),Ut(this,vs,"f").add(n),Ut(this,iu,"f").forEach(a=>a.onAdded(n)),this.dispatchChange()},onRemoved:({box:{address:{uuid:i}}})=>{let n=Ut(this,nu,"f").removeByKey(i);Ut(this,vs,"f").remove(n),Ut(this,iu,"f").forEach(o=>o.onRemoved(n)),this.dispatchChange()}},u.RegionCollection))}get trackBoxAdapter(){return Ut(this,Zd,"f")}get collection(){return Ut(this,vs,"f")}get adapters(){return Ut(this,nu,"f")}onIndexingChanged(){Ut(this,vs,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Ut(this,iu,"f").subscribe(e)}subscribeChanges(e){return Ut(this,Gd,"f").subscribe(e)}dispatchChange(){Ut(this,Gd,"f").notify()}terminate(){Ut(this,gs,"f").terminate()}};Zd=new WeakMap,gs=new WeakMap,Gd=new WeakMap,iu=new WeakMap,vs=new WeakMap,nu=new WeakMap;var ie;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(ie||(ie={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Notes";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return Me.Waveform;case r.Notes:return Me.Piano;case r.Value:return Me.Automation;case r.Undefined:return Me.AudioBus;default:return Me.Unknown}}})(ie||(ie={}));var Bm;(function(r){r.isDeviceBox=e=>"host"in e&&Ie(e.host,B)&&"label"in e&&Ie(e.label,C)&&"enabled"in e&&Ie(e.enabled,$)&&"minimized"in e&&Ie(e.minimized,$),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===u.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Ie(e.index,E)&&(e.host.pointerType===u.MidiEffectHost||e.host.pointerType===u.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&Ie(e.host,B)?e.host:F(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&Ie(e.label,C)?e.label:F(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&Ie(e.enabled,$)?e.enabled:F(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&Ie(e.minimized,$)?e.minimized:F(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&Ie(e.index,E)?e.index:F(`Could not find 'index' field in '${e?.name}'`)})(Bm||(Bm={}));var UP;(function(r){r.toTrackType=e=>{switch(e){case"midi":return ie.Notes;case"audio":return ie.Audio;default:return F()}}})(UP||(UP={}));var ne;(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;I(R.satisfy(e,(n,o)=>n.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(u.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(u.MidiEffectHost):F("unknown type")).map(({box:n})=>Bm.lookupIndexField(n)).filter(n=>e.some(o=>w.Comparator(o.uuid,n.address.uuid)!==0)).sort((n,o)=>n.getValue()-o.getValue()).forEach((n,o)=>n.setValue(o)),e.forEach(n=>n.box.delete())}})(ne||(ne={}));var Fm=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Wt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},qd,Nm,ji,ys,km,$m=class{constructor(e,t){qd.set(this,void 0),Nm.set(this,new re),ji.set(this,void 0),ys.set(this,void 0),km.set(this,void 0),Fm(this,qd,e,"f"),Fm(this,ji,Lt.create(e.box.tracks,i=>t.adapterFor(i,mt),u.TrackCollection),"f"),Fm(this,ys,w.newSet(({uuid:i})=>i),"f"),Fm(this,km,Wt(this,ji,"f").catchupAndSubscribe({onAdd:i=>Wt(this,ys,"f").add({uuid:i.uuid,subscription:i.regions.subscribeChanges(()=>Wt(this,Nm,"f").notify())}),onRemove:({uuid:i})=>Wt(this,ys,"f").removeByKey(i).subscription.terminate(),onReorder:i=>{}}),"f")}create(e,t,i){let n=Wt(this,qd,"f").box.graph,o=Wt(this,qd,"f").box.tracks;lr.create(n,w.generate(),a=>{a.index.setValue(i??Wt(this,ji,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return g.wrap(Wt(this,ji,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Wt(this,ji,"f").adapters(),i=t.indexOf(e);if(i===-1)return F(`Cannot delete ${e}. Does not exist.`);for(let n=i+1;n<t.length;n++)t[n].indexField.setValue(n-1);e.box.delete()}get collection(){return Wt(this,ji,"f")}values(){return Wt(this,ji,"f").adapters()}catchupAndSubscribe(e){return Wt(this,ji,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Wt(this,Nm,"f").subscribe(e)}terminate(){Wt(this,ji,"f").terminate(),Wt(this,km,"f").terminate(),Wt(this,ys,"f").forEach(({subscription:e})=>e.terminate()),Wt(this,ys,"f").clear()}};qd=new WeakMap,Nm=new WeakMap,ji=new WeakMap,ys=new WeakMap,km=new WeakMap;var jP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Li=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Mm,Vr,dr=class{constructor(e,t){this.type="bus",this.accepts="audio",Mm.set(this,void 0),Vr.set(this,void 0),jP(this,Mm,e,"f"),jP(this,Vr,t,"f")}catchupAndSubscribe(e){return e(this),Li(this,Vr,"f").subscribe(ke.Children,()=>e(this))}get uuid(){return Li(this,Vr,"f").address.uuid}get address(){return Li(this,Vr,"f").address}get box(){return Li(this,Vr,"f")}get enabledField(){return Li(this,Vr,"f").enabled}get minimizedField(){return Li(this,Vr,"f").minimized}get iconField(){return Li(this,Vr,"f").icon}get labelField(){return Li(this,Vr,"f").label}get colorField(){return Li(this,Vr,"f").color}get iconSymbol(){return Me.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Li(this,Mm,"f").boxAdapters.adapterFor(Li(this,Vr,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};Mm=new WeakMap,Vr=new WeakMap;var Hd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},co,ou,au,ai,Jd,Dm=class{constructor(e,t){co.set(this,void 0),ou.set(this,void 0),au.set(this,void 0),ai.set(this,void 0),Jd.set(this,K.Empty),Hd(this,co,new U,"f"),Hd(this,ou,pt(this,co,"f").own(new re),"f"),Hd(this,au,pt(this,co,"f").own(new Cr(Me.Unknown)),"f"),Hd(this,ai,pt(this,co,"f").own(new Cr(g.None)),"f"),pt(this,co,"f").own(pt(this,ai,"f").subscribe(i=>{pt(this,Jd,"f").terminate(),Hd(this,Jd,i.getValue().match({none:()=>(pt(this,ou,"f").notify(g.None),K.Empty),some:({labelField:n,iconField:o})=>K.many(o.catchupAndSubscribe(a=>pt(this,au,"f").setValue(Me.fromName(a.getValue()))),n.catchupAndSubscribe(a=>pt(this,ou,"f").notify(g.wrap(a.getValue()))))}),"f")})),pt(this,co,"f").own(e.catchupAndSubscribe({onAdded:({box:i})=>{I(pt(this,ai,"f").getValue().isEmpty(),"Already set");let n=i instanceof Ci?t.adapterFor(i,dr):t.adapterFor(i,ne.isInstrument);pt(this,ai,"f").getValue().unwrapOrNull()!==n&&pt(this,ai,"f").setValue(g.wrap(n))},onRemoved:({box:i})=>{I(pt(this,ai,"f").getValue().unwrap("Cannot remove").box.address.equals(i.address),"Unexpected value to remove"),pt(this,ai,"f").setValue(g.None)}},u.InstrumentHost,u.AudioOutput))}getValue(){return pt(this,ai,"f").getValue()}subscribe(e){return pt(this,ai,"f").subscribe(e)}catchupAndSubscribe(e){return e(pt(this,ai,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),pt(this,ou,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return pt(this,au,"f").catchupAndSubscribe(e)}set label(e){this.getValue().ifSome(t=>t.labelField.setValue(e))}get label(){return this.getValue().map(e=>e.labelField.getValue())}set icon(e){this.getValue().ifSome(t=>t.iconField.setValue(Me.toName(e)))}get icon(){return this.getValue().match({none:()=>Me.Unknown,some:e=>Me.fromName(e.iconField.getValue())})}get iconValue(){return pt(this,au,"f")}terminate(){pt(this,co,"f").terminate(),pt(this,Jd,"f").terminate()}};co=new WeakMap,ou=new WeakMap,au=new WeakMap,ai=new WeakMap,Jd=new WeakMap;var LP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},xs=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Im,po,pe=class{constructor(e){Im.set(this,void 0),po.set(this,void 0),LP(this,Im,e,"f"),LP(this,po,Ae.newSet(t=>t.address),"f")}terminate(){xs(this,po,"f").forEach(e=>e.terminate()),xs(this,po,"f").clear()}parameters(){return xs(this,po,"f").values()}parameterAt(e){return xs(this,po,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,i,n,o){let a=new ws(xs(this,Im,"f"),e,t,i,n,o),s=xs(this,po,"f").add(a);return I(s,`Could not add adapter for ${e}`),a}removeParameter(e){return xs(this,po,"f").removeByKey(e)}};Im=new WeakMap,po=new WeakMap;var bs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},nt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},As,si,Yo,su,Cm,Tm,Qd,lu=class{constructor(e,t){As.set(this,void 0),si.set(this,void 0),Yo.set(this,void 0),su.set(this,void 0),Cm.set(this,void 0),Tm.set(this,void 0),Qd.set(this,K.Empty),bs(this,As,e,"f"),bs(this,si,t,"f"),bs(this,Yo,new U,"f"),bs(this,su,nt(this,Yo,"f").own(new re),"f"),nt(this,Yo,"f").own(t.targetBus.catchupAndSubscribe(()=>{nt(this,Qd,"f").terminate(),bs(this,Qd,this.optTargetBus.match({none:()=>(nt(this,su,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>nt(this,su,"f").notify(g.wrap(n)))}),"f")})),bs(this,Cm,nt(this,Yo,"f").own(new ws(nt(this,As,"f"),nt(this,si,"f").sendPan,S.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),bs(this,Tm,nt(this,Yo,"f").own(new ws(nt(this,As,"f"),nt(this,si,"f").sendGain,S.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),nt(this,su,"f").subscribe(e)}get uuid(){return nt(this,si,"f").address.uuid}get address(){return nt(this,si,"f").address}get box(){return nt(this,si,"f")}get indexField(){return nt(this,si,"f").index}get sendPan(){return nt(this,Cm,"f")}get sendGain(){return nt(this,Tm,"f")}get targetBus(){return nt(this,As,"f").boxAdapters.adapterFor(nt(this,si,"f").targetBus.targetVertex.unwrap("no audioUnit").box,dr)}get optTargetBus(){return nt(this,si,"f").targetBus.targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>nt(this,As,"f").boxAdapters.adapterFor(t,dr)})))}delete(){nt(this,si,"f").delete()}terminate(){nt(this,Yo,"f").terminate(),nt(this,Qd,"f").terminate()}};As=new WeakMap,si=new WeakMap,Yo=new WeakMap,su=new WeakMap,Cm=new WeakMap,Tm=new WeakMap,Qd=new WeakMap;var Yd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pn=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Rm,Om,uu,cu,Xd,Vm=class{constructor(e,t){Rm.set(this,void 0),Om.set(this,void 0),uu.set(this,void 0),cu.set(this,void 0),Xd.set(this,K.Empty),Yd(this,Rm,e,"f"),Yd(this,Om,t,"f"),Yd(this,uu,new U,"f"),Yd(this,cu,Pn(this,uu,"f").own(new re),"f"),Pn(this,uu,"f").own(e.catchupAndSubscribe(()=>{Pn(this,Xd,"f").terminate(),Yd(this,Xd,this.adapter.match({none:()=>(Pn(this,cu,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>Pn(this,cu,"f").notify(g.wrap(n)))}),"f")}))}subscribe(e){return Pn(this,cu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Pn(this,Rm,"f").targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>Pn(this,Om,"f").adapterFor(t,dr)})))}terminate(){Pn(this,uu,"f").terminate(),Pn(this,Xd,"f").terminate()}};Rm=new WeakMap,Om=new WeakMap,uu=new WeakMap,cu=new WeakMap,Xd=new WeakMap;var ho=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ae=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},zm,KP,Sn,zr,vt,Ps,du,_s,Um,jm,Lm,Km,WP,ZP,li=class{constructor(e,t){zm.add(this),this.class="device-host",Sn.set(this,new U),zr.set(this,void 0),vt.set(this,void 0),Ps.set(this,void 0),du.set(this,void 0),_s.set(this,void 0),Um.set(this,void 0),jm.set(this,void 0),Lm.set(this,void 0),Km.set(this,void 0),ho(this,zr,e,"f"),ho(this,vt,t,"f"),ho(this,Ps,ae(this,Sn,"f").own(new pe(ae(this,zr,"f"))),"f"),ho(this,du,ae(this,Sn,"f").own(new $m(this,ae(this,zr,"f").boxAdapters)),"f"),ho(this,_s,ae(this,Sn,"f").own(new Dm(ae(this,vt,"f").input.pointerHub,ae(this,zr,"f").boxAdapters)),"f"),ho(this,Um,ae(this,Sn,"f").own(Lt.create(ae(this,vt,"f").midiEffects,i=>ae(this,zr,"f").boxAdapters.adapterFor(i,ne.isMidiEffect),u.MidiEffectHost)),"f"),ho(this,jm,ae(this,Sn,"f").own(Lt.create(ae(this,vt,"f").audioEffects,i=>ae(this,zr,"f").boxAdapters.adapterFor(i,ne.isAudioEffect),u.AudioEffectHost)),"f"),ho(this,Lm,ae(this,Sn,"f").own(Lt.create(ae(this,vt,"f").auxSends,i=>ae(this,zr,"f").boxAdapters.adapterFor(i,lu),u.AuxSend)),"f"),ho(this,Km,ae(this,Sn,"f").own(new Vm(ae(this,vt,"f").output,ae(this,zr,"f").boxAdapters)),"f"),this.namedParameter=ae(this,zm,"m",WP).call(this,t),ae(this,zm,"m",ZP).call(this)}get box(){return ae(this,vt,"f")}get uuid(){return ae(this,vt,"f").address.uuid}get address(){return ae(this,vt,"f").address}get indexField(){return ae(this,vt,"f").index}get type(){return ae(this,vt,"f").type.getValue()}get captureBox(){return ae(this,vt,"f").capture.targetVertex}get tracks(){return ae(this,du,"f")}get input(){return ae(this,_s,"f")}get midiEffects(){return ae(this,Um,"f")}get audioEffects(){return ae(this,jm,"f")}get inputAdapter(){return ae(this,_s,"f").getValue()}get auxSends(){return ae(this,Lm,"f")}get output(){return ae(this,Km,"f")}get isBus(){return this.input.getValue().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.getValue().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return ae(this,vt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ae(this,zr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ae(this,vt,"f").midiEffects}get inputField(){return ae(this,vt,"f").input}get audioEffectsField(){return ae(this,vt,"f").audioEffects}get tracksField(){return ae(this,vt,"f").tracks}get minimizedField(){return ae(this,_s,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ae(this,_s,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=ae(this,zr,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),i=this.type,n=t,o=t;for(;n>0&&e[n-1].type===i;)n--;for(;o<e.length-1&&e[o+1].type===i;)o++;return[n,o+1]}move(e){ae(this,zr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ae(this,du,"f").collection.move(e,t)}deleteTrack(e){ae(this,du,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ae(this,Sn,"f").terminate()}};KP=li,Sn=new WeakMap,zr=new WeakMap,vt=new WeakMap,Ps=new WeakMap,du=new WeakMap,_s=new WeakMap,Um=new WeakMap,jm=new WeakMap,Lm=new WeakMap,Km=new WeakMap,zm=new WeakSet,WP=function(e){return{volume:ae(this,Ps,"f").createParameter(e.volume,KP.VolumeMapper,P.decible,"volume"),panning:ae(this,Ps,"f").createParameter(e.panning,S.bipolar(),P.panning,"panning",.5),mute:ae(this,Ps,"f").createParameter(e.mute,S.bool,P.bool,"mute"),solo:ae(this,Ps,"f").createParameter(e.solo,S.bool,P.bool,"solo")}},ZP=function(){let e=this.address.toString(),t=ae(this,vt,"f").capture.targetAddress.unwrapOrUndefined(),i=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ae(this,vt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;I(this.type!==St.Instrument||ae(this,vt,"f").capture.targetAddress.nonEmpty(),i)};li.VolumeMapper=S.decibel(-96,-9,6);var pu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},qe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Wm,Xo,pr,Ss,Zm,Gm,ep,GP,qP,mt=class{constructor(e,t){Wm.add(this),Xo.set(this,void 0),pr.set(this,void 0),Ss.set(this,void 0),Zm.set(this,void 0),Gm.set(this,void 0),ep.set(this,void 0),pu(this,Xo,e,"f"),pu(this,pr,t,"f"),pu(this,Ss,new U,"f"),pu(this,Zm,qe(this,Ss,"f").own(new Pm(this,e.boxAdapters)),"f"),pu(this,Gm,qe(this,Ss,"f").own(new Em(this,e.boxAdapters)),"f"),pu(this,ep,qe(this,Ss,"f").own(new Cr(-1)),"f")}catchupAndSubscribePath(e){let t=[g.None,g.None],i=()=>{t.every(n=>n.nonEmpty())?e(g.wrap(t.map(n=>n.unwrap()))):e(g.None)};return K.many(qe(this,Wm,"m",GP).call(this,n=>{t[0].equals(n)||(t[0]=n,i())}),qe(this,Wm,"m",qP).call(this,n=>{t[1].equals(n)||(t[1]=n,i())}))}set targetDeviceName(e){qe(this,pr,"f").target.targetVertex.ifSome(t=>{let i=t.box;if(i instanceof it)return qe(this,Xo,"f").boxAdapters.adapterFor(i,li).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in i&&i.label instanceof C)return i.label.setValue(e)})}get targetDeviceName(){return qe(this,pr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof it?qe(this,Xo,"f").boxAdapters.adapterFor(t,li).input.label:"label"in t&&t.label instanceof C?g.wrap(t.label.getValue()):g.wrap(t.name)})}terminate(){qe(this,Ss,"f").terminate()}get audioUnit(){return Ne(qe(this,pr,"f").tracks.targetVertex.unwrap().box,it)}get target(){return qe(this,pr,"f").target}get clips(){return qe(this,Zm,"f")}get regions(){return qe(this,Gm,"f")}get enabled(){return qe(this,pr,"f").enabled}get indexField(){return qe(this,pr,"f").index}get type(){return qe(this,pr,"f").type.getValue()}get box(){return qe(this,pr,"f")}get uuid(){return qe(this,pr,"f").address.uuid}get address(){return qe(this,pr,"f").address}get listIndex(){return qe(this,ep,"f").getValue()}set listIndex(e){qe(this,ep,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ie.Audio;case"note-clip":return this.type===ie.Notes;case"value-clip":return this.type===ie.Value;case"audio-region":return this.type===ie.Audio;case"note-region":return this.type===ie.Notes;case"value-region":return this.type===ie.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let i=t,n=qe(this,Xo,"f").clipSequencing.iterate(this.uuid,e,e+df);for(let{optClip:o,sectionFrom:a}of n)i=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return Ie(l,uo)?l.incomingValue(t):t}else if(Ie(s,uo))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&Ie(s,Wo)?s.valueAt(e,t):t});return i}};Xo=new WeakMap,pr=new WeakMap,Ss=new WeakMap,Zm=new WeakMap,Gm=new WeakMap,ep=new WeakMap,Wm=new WeakSet,GP=function(e){let t=qe(this,pr,"f").target.targetVertex;if(t.nonEmpty()){let i=t.unwrap().box;return i instanceof it?qe(this,Xo,"f").boxAdapters.adapterFor(i,li).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in i&&i.label instanceof C?i.label.catchupAndSubscribe(n=>e(g.wrap(n.getValue()))):(e(g.wrap(i.name)),K.Empty)}return e(g.None),K.Empty},qP=function(e){let t=this.type;switch(t){case ie.Audio:case ie.Notes:return e(g.wrap(ie[t])),K.Empty;case ie.Value:{let i=qe(this,pr,"f").target.targetVertex.unwrap();if(i.isField())e(qe(this,Xo,"f").parameterFieldAdapters.opt(i.address).map(n=>n.name));else if(i.isBox())e(g.wrap(i.name));else return F("Illegal State. Vertex is not a field nor box.");return K.Empty}case ie.Undefined:return e(g.wrap("")),K.Empty;default:return e(g.None),K.Empty}};var Zt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ce=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ea,Ur,ta,Es,qm,Hm,Bs,Fs,ra,ia,Ns,hu,tp,HP=[u.Automation,u.Modulation,u.MidiControl,u.ParameterController],ws=class{constructor(e,t,i,n,o,a){ea.set(this,void 0),Ur.set(this,void 0),ta.set(this,void 0),Es.set(this,void 0),qm.set(this,void 0),Hm.set(this,void 0),Bs.set(this,new U),Fs.set(this,void 0),ra.set(this,void 0),ia.set(this,g.None),Ns.set(this,g.None),hu.set(this,null),tp.set(this,!1),Zt(this,ea,e,"f"),Zt(this,Ur,t,"f"),Zt(this,ta,i,"f"),Zt(this,Es,n,"f"),Zt(this,qm,o,"f"),Zt(this,Hm,a??0,"f"),ce(this,Bs,"f").own(ce(this,ea,"f").parameterFieldAdapters.register(this)),Zt(this,Fs,ce(this,Bs,"f").own(new re),"f"),Zt(this,ra,new Mt,"f"),ce(this,Bs,"f").own(ce(this,Ur,"f").subscribe(()=>ce(this,Fs,"f").notify(this))),ce(this,Bs,"f").own(ce(this,Ur,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{ce(this,ra,"f").proxy.onControlSourceAdd(Gx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ce(this,ia,"f").isEmpty(),"Already assigned");let c=ce(this,ea,"f").boxAdapters.adapterFor(l,mt);Zt(this,ia,g.wrap(c),"f"),ce(this,ea,"f").isMainThread&&Zt(this,Ns,g.wrap(ce(this,ea,"f").liveStreamReceiver.subscribeFloat(ce(this,Ur,"f").address,p=>{ce(this,hu,"f")!==p&&(Zt(this,hu,p,"f"),ce(this,Fs,"f").notify(this))})),"f")}})},onRemoved:s=>{ce(this,ra,"f").proxy.onControlSourceRemove(Gx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ce(this,ia,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Zt(this,ia,g.None,"f"),ce(this,ea,"f").isMainThread&&(ce(this,Ns,"f").ifSome(c=>c.terminate()),Zt(this,Ns,g.None,"f"),Zt(this,hu,null,"f"),ce(this,Fs,"f").notify(this))}})}},...HP)),t.getValue(),i.clamp(t.getValue())}registerMidiControl(){return ce(this,ra,"f").proxy.onControlSourceAdd("midi"),Zt(this,tp,!0,"f"),{terminate:()=>{Zt(this,tp,!1,"f"),ce(this,ra,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ce(this,Ur,"f")}get valueMapping(){return ce(this,ta,"f")}get stringMapping(){return ce(this,Es,"f")}get name(){return ce(this,qm,"f")}get anchor(){return ce(this,Hm,"f")}get type(){return ce(this,Ur,"f").type}get address(){return ce(this,Ur,"f").address}get track(){return ce(this,ia,"f")}valueAt(e){let t=ce(this,ia,"f");if(t.nonEmpty()){let i=t.unwrap();if(i.enabled)return this.valueMapping.y(i.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return ce(this,Fs,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ce(this,tp,"f")&&e.onControlSourceAdd("midi"),ce(this,Ur,"f").pointerHub.filter(...HP).forEach(t=>e.onControlSourceAdd(Gx(t.pointerType))),ce(this,ra,"f").subscribe(e)}getValue(){return ce(this,Ur,"f").getValue()}setValue(e){ce(this,Ur,"f").setValue(e)}setUnitValue(e){this.setValue(ce(this,ta,"f").y(e))}getUnitValue(){return ce(this,ta,"f").x(this.getValue())}getControlledValue(){return ce(this,ta,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ce(this,hu,"f")??this.getUnitValue()}getControlledPrintValue(){return ce(this,Es,"f").x(this.getControlledValue())}getPrintValue(){return ce(this,Es,"f").x(this.getValue())}setPrintValue(e){let t=ce(this,Es,"f").y(e);t.type==="unitValue"?this.setUnitValue(le(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ce(this,ta,"f").clamp(ce(this,Ur,"f").initValue))}terminate(){ce(this,Ns,"f").ifSome(e=>e.terminate()),Zt(this,Ns,g.None,"f"),ce(this,Bs,"f").terminate()}};ea=new WeakMap,Ur=new WeakMap,ta=new WeakMap,Es=new WeakMap,qm=new WeakMap,Hm=new WeakMap,Bs=new WeakMap,Fs=new WeakMap,ra=new WeakMap,ia=new WeakMap,Ns=new WeakMap,hu=new WeakMap,tp=new WeakMap;var Gx=r=>{switch(r){case u.Automation:return"automated";case u.Modulation:return"modulated";case u.MidiControl:return"midi";case u.ParameterController:return"external";default:return F(`${r.toString()} is an unknown pointer type`)}};var qx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ki=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fo,ks,Jm,Qm=class{constructor(e,t,i){fo.set(this,void 0),ks.set(this,void 0),Jm.set(this,void 0),qx(this,fo,w.newSet(n=>n.uuid),"f"),qx(this,ks,new Mt,"f"),qx(this,Jm,e.catchupAndSubscribe({onAdded:n=>{let o=t(n.box),a=Ki(this,fo,"f").add(o);I(a,`Could not add ${o}`),Ki(this,ks,"f").proxy.onAdd(o)},onRemoved:n=>{let o=n.box.address.uuid;Ki(this,ks,"f").proxy.onRemove(Ki(this,fo,"f").removeByKey(o))}},i),"f")}subscribe(e){return Ki(this,ks,"f").subscribe(e)}catchupAndSubscribe(e){return Ki(this,fo,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Ki(this,fo,"f").values()}size(){return Ki(this,fo,"f").size()}isEmpty(){return this.size()===0}terminate(){Ki(this,fo,"f").clear(),Ki(this,ks,"f").terminate(),Ki(this,Jm,"f").terminate()}};fo=new WeakMap,ks=new WeakMap,Jm=new WeakMap;var Hx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},It=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Jx,Ym,rp,ui,En,JP,ci=class{constructor(e,t){Jx.add(this),this.type="audio-effect",this.accepts="audio",rp.set(this,void 0),ui.set(this,void 0),En.set(this,void 0),Hx(this,rp,e,"f"),Hx(this,ui,t,"f"),Hx(this,En,new pe(It(this,rp,"f")),"f"),this.namedParameter=It(this,Jx,"m",JP).call(this,t)}get box(){return It(this,ui,"f")}get uuid(){return It(this,ui,"f").address.uuid}get address(){return It(this,ui,"f").address}get indexField(){return It(this,ui,"f").index}get labelField(){return It(this,ui,"f").label}get enabledField(){return It(this,ui,"f").enabled}get minimizedField(){return It(this,ui,"f").minimized}get host(){return It(this,ui,"f").host}deviceHost(){return It(this,rp,"f").boxAdapters.adapterFor(It(this,ui,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){It(this,En,"f").terminate()}};Ym=ci,rp=new WeakMap,ui=new WeakMap,En=new WeakMap,Jx=new WeakSet,JP=function(e){return{delay:It(this,En,"f").createParameter(e.delay,S.linearInteger(0,Ym.OffsetFractions.length-1),Ym.OffsetStringMapping,"delay"),feedback:It(this,En,"f").createParameter(e.feedback,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:It(this,En,"f").createParameter(e.cross,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),filter:It(this,En,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:It(this,En,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:It(this,En,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};ci.OffsetFractions=or.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();ci.OffsetStringMapping=P.indices("",Ym.OffsetFractions.map(([r,e])=>`${r}/${e}`));var Qx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ct=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Yx,ip,di,Bn,QP,fu=class{constructor(e,t){Yx.add(this),this.type="audio-effect",this.accepts="audio",ip.set(this,void 0),di.set(this,void 0),Bn.set(this,void 0),Qx(this,ip,e,"f"),Qx(this,di,t,"f"),Qx(this,Bn,new pe(Ct(this,ip,"f")),"f"),this.namedParameter=Ct(this,Yx,"m",QP).call(this,t)}get box(){return Ct(this,di,"f")}get uuid(){return Ct(this,di,"f").address.uuid}get address(){return Ct(this,di,"f").address}get indexField(){return Ct(this,di,"f").index}get labelField(){return Ct(this,di,"f").label}get enabledField(){return Ct(this,di,"f").enabled}get minimizedField(){return Ct(this,di,"f").minimized}get host(){return Ct(this,di,"f").host}deviceHost(){return Ct(this,ip,"f").boxAdapters.adapterFor(Ct(this,di,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ct(this,Bn,"f").terminate()}};ip=new WeakMap,di=new WeakMap,Bn=new WeakMap,Yx=new WeakSet,QP=function(e){return{decay:Ct(this,Bn,"f").createParameter(e.decay,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Ct(this,Bn,"f").createParameter(e.preDelay,S.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Ct(this,Bn,"f").createParameter(e.damp,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Ct(this,Bn,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Ct(this,Bn,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Ct(this,Bn,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Xx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},xt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},tw,np,jr,Wi,e1,mu=class{constructor(e,t){tw.add(this),this.type="audio-effect",this.accepts="audio",np.set(this,void 0),jr.set(this,void 0),Wi.set(this,void 0),Xx(this,np,e,"f"),Xx(this,jr,t,"f"),Xx(this,Wi,new pe(xt(this,np,"f")),"f"),this.namedParameter=xt(this,tw,"m",e1).call(this,t)}get box(){return xt(this,jr,"f")}get uuid(){return xt(this,jr,"f").address.uuid}get address(){return xt(this,jr,"f").address}get indexField(){return xt(this,jr,"f").index}get labelField(){return xt(this,jr,"f").label}get enabledField(){return xt(this,jr,"f").enabled}get minimizedField(){return xt(this,jr,"f").minimized}get host(){return xt(this,jr,"f").host}get spectrum(){return xt(this,jr,"f").address.append(4095)}deviceHost(){return xt(this,np,"f").boxAdapters.adapterFor(xt(this,jr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){xt(this,Wi,"f").terminate()}};np=new WeakMap,jr=new WeakMap,Wi=new WeakMap,tw=new WeakSet,e1=function(e){return{highPass:YP(xt(this,Wi,"f"),e.highPass,"High-Pass"),lowShelf:XP(xt(this,Wi,"f"),e.lowShelf,"Low-Shelf"),lowBell:ew(xt(this,Wi,"f"),e.lowBell,"Low-Bell"),midBell:ew(xt(this,Wi,"f"),e.midBell,"Mid-Bell"),highBell:ew(xt(this,Wi,"f"),e.highBell,"High-Bell"),highShelf:XP(xt(this,Wi,"f"),e.highShelf,"High-Shelf"),lowPass:YP(xt(this,Wi,"f"),e.lowPass,"Low-Pass")}};var rw=S.exponential(20,2e4),t1=S.linear(-24,24),r1=S.exponential(.01,10),YP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,rw,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,r1,P.numeric({fractionDigits:3}),`${t} Q`)}),XP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,rw,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,t1,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),ew=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,rw,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,t1,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,r1,P.numeric({fractionDigits:3}),`${t} Q`)});var i1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Xm,eg,br,na=class{constructor(e,t){this.type="marker-event",Xm.set(this,new U),eg.set(this,void 0),br.set(this,void 0),i1(this,eg,e,"f"),i1(this,br,t,"f"),wr(this,Xm,"f").own(wr(this,br,"f").subscribe(ke.Children,i=>{if(!this.trackAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackAdapter.unwrap();wr(this,br,"f").position.address.equals(i.address)?n.onSortingChanged():n.dispatchChange()}}))}get box(){return wr(this,br,"f")}get uuid(){return wr(this,br,"f").address.uuid}get address(){return wr(this,br,"f").address}get position(){return wr(this,br,"f").position.getValue()}get plays(){return wr(this,br,"f").plays.getValue()}get hue(){return wr(this,br,"f").hue.getValue()}get label(){return wr(this,br,"f").label.getValue()}get trackAdapter(){return wr(this,br,"f").track.targetVertex.map(e=>wr(this,eg,"f").boxAdapters.adapterFor(e.box,Fn).markerTrack)}terminate(){wr(this,Xm,"f").terminate()}toString(){return`{MarkerBoxAdapter ${w.toString(wr(this,br,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Xm=new WeakMap,eg=new WeakMap,br=new WeakMap;na.Comparator=(r,e)=>r.position-e.position;var op=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ap,gu,sp,$s,tg,rg=class{constructor(e,t){ap.set(this,void 0),gu.set(this,void 0),sp.set(this,void 0),$s.set(this,void 0),tg.set(this,void 0),op(this,ap,e,"f"),op(this,gu,t,"f"),this.changeNotifier=new re,op(this,sp,w.newSet(i=>i.uuid),"f"),op(this,$s,xr.create(na.Comparator),"f"),op(this,tg,pi(this,gu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{if(i instanceof Al){let n=pi(this,ap,"f").boxAdapters.adapterFor(i,na),o=pi(this,sp,"f").add(n);I(o,"Could not add adapter"),pi(this,$s,"f").add(n),this.dispatchChange()}},onRemoved:({box:{address:{uuid:i}}})=>{pi(this,$s,"f").remove(pi(this,sp,"f").removeByKey(i)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return pi(this,ap,"f")}get enabled(){return pi(this,gu,"f").enabled.getValue()}get events(){return pi(this,$s,"f")}get object(){return pi(this,gu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){pi(this,$s,"f").onIndexingChanged(),this.dispatchChange()}terminate(){pi(this,tg,"f").terminate()}};ap=new WeakMap,gu=new WeakMap,sp=new WeakMap,$s=new WeakMap,tg=new WeakMap;var n1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},mo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Zi,ig,Fn=class{constructor(e,t){Zi.set(this,void 0),ig.set(this,void 0),n1(this,Zi,t,"f"),n1(this,ig,new rg(e,mo(this,Zi,"f").markerTrack),"f")}terminate(){}get box(){return mo(this,Zi,"f")}get uuid(){return mo(this,Zi,"f").address.uuid}get address(){return mo(this,Zi,"f").address}get markerTrack(){return mo(this,ig,"f")}get signature(){return[mo(this,Zi,"f").signature.nominator.getValue(),mo(this,Zi,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=mo(this,Zi,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),mo(this,Zi,"f").signature.subscribe(()=>e(this.signature))}};Zi=new WeakMap,ig=new WeakMap;var EB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},lp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},oa,aa=class{constructor(e,t){oa.set(this,void 0),EB(this,oa,t,"f")}get box(){return lp(this,oa,"f")}get uuid(){return lp(this,oa,"f").address.uuid}get address(){return lp(this,oa,"f").address}get source(){return lp(this,oa,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return lp(this,oa,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};oa=new WeakMap;var Ms=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},hi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ng,Ds,Is,og,ag,up,fi=class{constructor(e,t){ng.set(this,void 0),Ds.set(this,void 0),Is.set(this,void 0),og.set(this,void 0),ag.set(this,void 0),up.set(this,!1),Ms(this,ng,e,"f"),Ms(this,Ds,t,"f"),Ms(this,Is,new U,"f"),Ms(this,og,t.attributes,"f"),Ms(this,ag,hi(this,Is,"f").own(new pe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return hi(this,Is,"f").own(e)}ownAll(...e){hi(this,Is,"f").ownAll(...e)}onSelected(){Ms(this,up,!0,"f")}onDeselected(){Ms(this,up,!1,"f")}isSelected(){return hi(this,up,"f")}get box(){return hi(this,Ds,"f")}get attributes(){return hi(this,og,"f")}get uuid(){return hi(this,Ds,"f").address.uuid}get address(){return hi(this,Ds,"f").address}get parameters(){return hi(this,ag,"f")}get modular(){return hi(this,ng,"f").boxAdapters.adapterFor(hi(this,Ds,"f").attributes.collection.targetVertex.unwrap().box,sa)}terminate(){hi(this,Is,"f").terminate()}};ng=new WeakMap,Ds=new WeakMap,Is=new WeakMap,og=new WeakMap,ag=new WeakMap,up=new WeakMap;var sg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},go=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lg,la,cp,ug,Qt;(function(r){r.Input="input",r.Output="output"})(Qt||(Qt={}));var Yt=class r{static create(e,t,i,n){return new r(e,t,i,n??t.fieldName)}constructor(e,t,i,n){lg.set(this,void 0),la.set(this,void 0),cp.set(this,void 0),ug.set(this,void 0),sg(this,lg,e,"f"),sg(this,la,t,"f"),sg(this,cp,i,"f"),sg(this,ug,n,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(i=>i===t))}get connections(){return go(this,la,"f").pointerHub.isEmpty()?R.empty():go(this,la,"f").pointerHub.filter(u.VoltageConnection).map(({box:e})=>go(this,lg,"f").adapterFor(e,aa))}get field(){return go(this,la,"f")}get address(){return go(this,la,"f").address}get direction(){return go(this,cp,"f")}get name(){return go(this,ug,"f")}toString(){return`{ModuleConnectorAdapter address: ${go(this,la,"f").address.toString()}, direction: ${go(this,cp,"f")}}`}};lg=new WeakMap,la=new WeakMap,cp=new WeakMap,ug=new WeakMap;var iw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},dp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},cg,pp,hp,vu=class extends fi{constructor(e,t){super(e,t),cg.set(this,void 0),pp.set(this,void 0),hp.set(this,void 0),iw(this,cg,this.parameters.createParameter(t.time,S.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),iw(this,pp,Yt.create(e.boxAdapters,t.voltageInput,Qt.Input,"Input"),"f"),iw(this,hp,Yt.create(e.boxAdapters,t.voltageOutput,Qt.Output,"Output"),"f")}get parameterTime(){return dp(this,cg,"f")}get voltageInput(){return dp(this,pp,"f")}get voltageOutput(){return dp(this,hp,"f")}get inputs(){return[dp(this,pp,"f")]}get outputs(){return[dp(this,hp,"f")]}};cg=new WeakMap,pp=new WeakMap,hp=new WeakMap;var BB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},o1=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fp,yu=class extends fi{constructor(e,t){super(e,t),fp.set(this,void 0),BB(this,fp,Yt.create(e.boxAdapters,t.input,Qt.Input,"Input"),"f")}get voltageInput(){return o1(this,fp,"f")}get inputs(){return[o1(this,fp,"f")]}get outputs(){return R.empty()}};fp=new WeakMap;var nw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},mp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},dg,gp,vp,xu=class extends fi{constructor(e,t){super(e,t),dg.set(this,void 0),gp.set(this,void 0),vp.set(this,void 0),nw(this,dg,this.parameters.createParameter(t.gain,S.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),nw(this,gp,Yt.create(e.boxAdapters,t.voltageInput,Qt.Input,"Input"),"f"),nw(this,vp,Yt.create(e.boxAdapters,t.voltageOutput,Qt.Output,"Output"),"f")}get parameterGain(){return mp(this,dg,"f")}get voltageInput(){return mp(this,gp,"f")}get voltageOutput(){return mp(this,vp,"f")}get inputs(){return[mp(this,gp,"f")]}get outputs(){return[mp(this,vp,"f")]}};dg=new WeakMap,gp=new WeakMap,vp=new WeakMap;var ow=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},aw=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},pg,hg,fg,wu=class extends fi{constructor(e,t){super(e,t),pg.set(this,void 0),hg.set(this,void 0),fg.set(this,void 0),ow(this,pg,Yt.create(e.boxAdapters,t.voltageInputX,Qt.Input,"X"),"f"),ow(this,hg,Yt.create(e.boxAdapters,t.voltageInputY,Qt.Input,"Y"),"f"),ow(this,fg,Yt.create(e.boxAdapters,t.voltageOutput,Qt.Output,"Result"),"f")}get inputs(){return[aw(this,pg,"f"),aw(this,hg,"f")]}get outputs(){return[aw(this,fg,"f")]}};pg=new WeakMap,hg=new WeakMap,fg=new WeakMap;var FB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},a1=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},yp,bu=class extends fi{constructor(e,t){super(e,t),yp.set(this,void 0),FB(this,yp,Yt.create(e.boxAdapters,t.output,Qt.Output,"Output"),"f")}get voltageOutput(){return a1(this,yp,"f")}get inputs(){return R.empty()}get outputs(){return[a1(this,yp,"f")]}};yp=new WeakMap;var Au;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>ee(t.accept({visitModuleGainBox:i=>e.adapterFor(i,xu),visitModuleDelayBox:i=>e.adapterFor(i,vu),visitModuleMultiplierBox:i=>e.adapterFor(i,wu),visitModularAudioInputBox:i=>e.adapterFor(i,bu),visitModularAudioOutputBox:i=>e.adapterFor(i,yu)}),`Could not find ModuleAdapter for ${t.name}`)})(Au||(Au={}));var s1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Cs=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mg,gg,Ts,sw,_u=class{constructor(e,t){mg.add(this),gg.set(this,void 0),Ts.set(this,void 0),s1(this,gg,e,"f"),s1(this,Ts,t,"f")}get box(){return Cs(this,Ts,"f")}get uuid(){return Cs(this,Ts,"f").address.uuid}get address(){return Cs(this,Ts,"f").address}get moduleAdapter(){return Au.adapterFor(Cs(this,gg,"f").boxAdapters,Cs(this,mg,"a",sw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Cs(this,mg,"a",sw).address)}terminate(){}};gg=new WeakMap,Ts=new WeakMap,mg=new WeakSet,sw=function(){return Cs(this,Ts,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var l1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ar=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Pu,_r,ua=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Pu.set(this,void 0),_r.set(this,void 0),l1(this,Pu,e,"f"),l1(this,_r,t,"f")}get box(){return Ar(this,_r,"f")}get uuid(){return Ar(this,_r,"f").address.uuid}get address(){return Ar(this,_r,"f").address}get indexField(){return Ar(this,_r,"f").index}get labelField(){return Ar(this,_r,"f").label}get enabledField(){return Ar(this,_r,"f").enabled}get minimizedField(){return Ar(this,_r,"f").minimized}get host(){return Ar(this,_r,"f").host}parameterAt(e){return F("Not yet implemented")}deviceHost(){return Ar(this,Pu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Ar(this,Pu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").modularSetup.targetVertex.unwrap("No Modular found").box,sa)}elements(){return Ar(this,_r,"f").userInterface.elements.pointerHub.filter(u.DeviceUserInterface).map(e=>Ar(this,Pu,"f").boxAdapters.adapterFor(e.box,_u))}terminate(){}};Pu=new WeakMap,_r=new WeakMap;var xp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ue=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Su,ca,Eu,Lr,Rs,Os,sa=class{constructor(e,t){Su.set(this,new U),ca.set(this,void 0),Eu.set(this,void 0),Lr.set(this,void 0),Rs.set(this,void 0),Os.set(this,void 0),xp(this,Eu,e,"f"),xp(this,Lr,t,"f"),xp(this,ca,Ue(this,Su,"f").own(new Mt),"f"),xp(this,Rs,w.newSet(s=>s.uuid),"f"),xp(this,Os,w.newSet(s=>s.uuid),"f");let i=s=>{let l=Au.adapterFor(Ue(this,Eu,"f").boxAdapters,s.box);Ue(this,Rs,"f").add(l)&&Ue(this,ca,"f").proxy.onModuleAdded(l)},n=s=>Ue(this,ca,"f").proxy.onModuleRemoved(Ue(this,Rs,"f").removeByKey(s.address.uuid)),o=s=>{let l=Ue(this,Eu,"f").boxAdapters.adapterFor(s.box,aa);Ue(this,Os,"f").add(l)&&Ue(this,ca,"f").proxy.onConnectionAdded(l)},a=s=>Ue(this,ca,"f").proxy.onConnectionRemoved(Ue(this,Os,"f").removeByKey(s.address.uuid));Ue(this,Lr,"f").modules.pointerHub.filter(u.ModuleCollection).forEach(i),Ue(this,Lr,"f").connections.pointerHub.filter(u.ConnectionCollection).forEach(o),Ue(this,Su,"f").own(Ue(this,Lr,"f").modules.pointerHub.subscribe({onAdded:i,onRemoved:n},u.ModuleCollection)),Ue(this,Su,"f").own(Ue(this,Lr,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},u.ConnectionCollection))}catchupAndSubscribe(e){return bx(e.onModuleAdded,t=>Ue(this,Rs,"f").forEach(i=>t(i))),bx(e.onConnectionAdded,t=>Ue(this,Os,"f").forEach(i=>t(i))),Ue(this,ca,"f").subscribe(e)}get box(){return Ue(this,Lr,"f")}get address(){return Ue(this,Lr,"f").address}get uuid(){return Ue(this,Lr,"f").address.uuid}get editingField(){return Ue(this,Lr,"f").editing}get labelField(){return Ue(this,Lr,"f").label}get modules(){return Ue(this,Rs,"f").values()}get connections(){return Ue(this,Os,"f").values()}get device(){return Ue(this,Eu,"f").boxAdapters.adapterFor(ee(Ue(this,Lr,"f").device.pointerHub.incoming().at(0),"No device found").box,ua)}terminate(){console.debug(`terminate ${this}`),Ue(this,Su,"f").terminate()}};Su=new WeakMap,ca=new WeakMap,Eu=new WeakMap,Lr=new WeakMap,Rs=new WeakMap,Os=new WeakMap;var wp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},hr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lw,Fu,bp,vg,Bu,_p,yg,Ap,xg,u1,Nn=class{constructor(e,t){lw.add(this),this.type="groove-adapter",bp.set(this,new U),vg.set(this,void 0),Bu.set(this,void 0),_p.set(this,void 0),yg.set(this,new nf({duration:()=>hr(this,xg,"f"),fx:i=>Sx(i,hr(this,Ap,"f")),fy:i=>Sx(i,1-hr(this,Ap,"f"))})),Ap.set(this,0),xg.set(this,Q.SemiQuaver*2),wp(this,vg,e,"f"),wp(this,Bu,t,"f"),wp(this,_p,hr(this,bp,"f").own(new pe(hr(this,vg,"f"))),"f"),this.namedParameter=hr(this,lw,"m",u1).call(this,t),hr(this,bp,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(i=>wp(this,xg,i.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(i=>wp(this,Ap,yP(i.getValue(),.01),"f")))}unwarp(e){return hr(this,yg,"f").unwarp(e)}warp(e){return hr(this,yg,"f").warp(e)}get box(){return hr(this,Bu,"f")}get uuid(){return hr(this,Bu,"f").address.uuid}get address(){return hr(this,Bu,"f").address}terminate(){hr(this,bp,"f").terminate()}};Fu=Nn,bp=new WeakMap,vg=new WeakMap,Bu=new WeakMap,_p=new WeakMap,yg=new WeakMap,Ap=new WeakMap,xg=new WeakMap,lw=new WeakSet,u1=function(e){return{duration:hr(this,_p,"f").createParameter(e.duration,S.values(Fu.DurationPPQNs),P.values("",Fu.DurationPPQNs,Fu.DurationStrings),"duration"),amount:hr(this,_p,"f").createParameter(e.amount,S.unipolar(),P.percent({fractionDigits:0}),"amount")}};Nn.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Nn.DurationPPQNs=Fu.Durations.map(([r,e])=>Q.fromSignature(r,e));Nn.DurationStrings=Fu.Durations.map(([r,e])=>`${r}/${e}`);var Nu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ht=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kn,da,ku,wg,bg,Pp,Sp,uw,pa=class{constructor(e,t,i,n,o){kn.set(this,void 0),da.set(this,void 0),ku.set(this,void 0),wg.set(this,void 0),bg.set(this,void 0),Pp.set(this,new U),Sp.set(this,void 0),uw.set(this,g.None),Nu(this,kn,e,"f"),Nu(this,da,t,"f"),Nu(this,ku,i,"f"),Nu(this,wg,n,"f"),Nu(this,bg,o??0,"f"),Nu(this,Sp,ht(this,Pp,"f").own(new re),"f"),ht(this,Pp,"f").own(ht(this,kn,"f").subscribe(()=>ht(this,Sp,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return ht(this,kn,"f")}get valueMapping(){return ht(this,da,"f")}get stringMapping(){return ht(this,ku,"f")}get name(){return ht(this,wg,"f")}get anchor(){return ht(this,bg,"f")}get type(){return ht(this,kn,"f").type}get address(){return ht(this,kn,"f").address}get track(){return ht(this,uw,"f")}subscribe(e){return ht(this,Sp,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return ht(this,kn,"f").getValue()}setValue(e){ht(this,kn,"f").setValue(ht(this,da,"f").clamp(e))}setUnitValue(e){this.setValue(ht(this,da,"f").y(e))}getUnitValue(){return ht(this,da,"f").x(this.getValue())}getPrintValue(){return ht(this,ku,"f").x(this.getValue())}setPrintValue(e){let t=ht(this,ku,"f").y(e);t.type==="unitValue"?this.setUnitValue(le(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ht(this,da,"f").clamp(ht(this,kn,"f").initValue))}terminate(){ht(this,Pp,"f").terminate()}};kn=new WeakMap,da=new WeakMap,ku=new WeakMap,wg=new WeakMap,bg=new WeakMap,Pp=new WeakMap,Sp=new WeakMap,uw=new WeakMap;var $u=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},mi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$n,Ag,_g,Pg,Sg,Eg,Bg=class{constructor(e){$n.set(this,void 0),Ag.set(this,void 0),_g.set(this,void 0),Pg.set(this,void 0),Sg.set(this,void 0),Eg.set(this,void 0),$u(this,$n,e,"f"),$u(this,Ag,new pa(mi(this,$n,"f").keyboard,S.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),$u(this,_g,new pa(mi(this,$n,"f").timeRangeInQuarters,S.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),$u(this,Pg,new pa(mi(this,$n,"f").noteScale,S.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),$u(this,Sg,new pa(mi(this,$n,"f").noteLabels,S.bool,P.bool,"Note Labels"),"f"),$u(this,Eg,new pa(mi(this,$n,"f").transpose,S.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return mi(this,$n,"f").box.subscribe(ke.Children,()=>e(this))}get object(){return mi(this,$n,"f")}get keyboard(){return mi(this,Ag,"f")}get timeRangeInQuarters(){return mi(this,_g,"f")}get noteScale(){return mi(this,Pg,"f")}get noteLabels(){return mi(this,Sg,"f")}get transpose(){return mi(this,Eg,"f")}};$n=new WeakMap,Ag=new WeakMap,_g=new WeakMap,Pg=new WeakMap,Sg=new WeakMap,Eg=new WeakMap;var Ep=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Tt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vs,Kr,Mu,Fg,Ng,Du=class{constructor(e,t){Vs.set(this,void 0),Kr.set(this,void 0),Mu.set(this,void 0),Fg.set(this,void 0),Ng.set(this,void 0),Ep(this,Vs,e,"f"),Ep(this,Kr,t,"f"),Ep(this,Mu,Lt.create(Tt(this,Kr,"f").audioUnits,i=>Tt(this,Vs,"f").boxAdapters.adapterFor(i,li),u.AudioUnits),"f"),Ep(this,Fg,new Qm(Tt(this,Kr,"f").audioBusses.pointerHub,i=>Tt(this,Vs,"f").boxAdapters.adapterFor(i,dr),u.AudioBusses),"f"),Ep(this,Ng,new Bg(Tt(this,Kr,"f").pianoMode),"f")}get uuid(){return Tt(this,Kr,"f").address.uuid}get address(){return Tt(this,Kr,"f").address}get box(){return Tt(this,Kr,"f")}get audioBusses(){return Tt(this,Fg,"f")}get audioUnits(){return Tt(this,Mu,"f")}get clips(){return Tt(this,Mu,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Tt(this,Vs,"f").boxAdapters.adapterFor(Tt(this,Kr,"f").groove.targetVertex.unwrap("no groove").box,Nn)}get timeline(){return Tt(this,Vs,"f").boxAdapters.adapterFor(Tt(this,Kr,"f").timeline.targetVertex.unwrap("no timeline").box,Fn)}get pianoMode(){return Tt(this,Ng,"f")}get created(){return new Date(Tt(this,Kr,"f").created.getValue())}get midiOutputDevices(){return Tt(this,Kr,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ne(e,Ti))}terminate(){Tt(this,Mu,"f").terminate()}};Vs=new WeakMap,Kr=new WeakMap,Mu=new WeakMap,Fg=new WeakMap,Ng=new WeakMap;var cw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Xt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},dw,Bp,Gi,ha,c1,Iu=class{constructor(e,t){dw.add(this),this.type="instrument",this.accepts="audio",Bp.set(this,void 0),Gi.set(this,void 0),ha.set(this,void 0),cw(this,Bp,e,"f"),cw(this,Gi,t,"f"),cw(this,ha,new pe(Xt(this,Bp,"f")),"f"),this.namedParameter=Xt(this,dw,"m",c1).call(this,t)}get box(){return Xt(this,Gi,"f")}get uuid(){return Xt(this,Gi,"f").address.uuid}get address(){return Xt(this,Gi,"f").address}get labelField(){return Xt(this,Gi,"f").label}get iconField(){return Xt(this,Gi,"f").icon}get defaultTrackType(){return ie.Audio}get enabledField(){return Xt(this,Gi,"f").enabled}get minimizedField(){return Xt(this,Gi,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Xt(this,Bp,"f").boxAdapters.adapterFor(Xt(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Xt(this,ha,"f").terminate()}};Bp=new WeakMap,Gi=new WeakMap,ha=new WeakMap,dw=new WeakSet,c1=function(e){return{flutter:Xt(this,ha,"f").createParameter(e.flutter,S.unipolar(),P.percent(),"flutter"),wow:Xt(this,ha,"f").createParameter(e.wow,S.unipolar(),P.percent(),"wow"),noise:Xt(this,ha,"f").createParameter(e.noise,S.unipolar(),P.percent(),"noise"),saturation:Xt(this,ha,"f").createParameter(e.saturation,S.unipolar(),P.percent(),"saturation")}};var Mn=(()=>{let t=[1,2,3,4],i=["12","24","36","48"],n=[Le.sine,Le.triangle,Le.saw,Le.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:i,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:P.values("db",t,i),LFO_WAVEFORM_VALUES:n,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:S.values(n),LFO_WAVEFORM_STRING_MAPPING:P.values("",n,o)}})();var pw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Be=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},hw,Fp,qi,Ve,d1,Cu=class{constructor(e,t){hw.add(this),this.type="instrument",this.accepts="midi",Fp.set(this,void 0),qi.set(this,void 0),Ve.set(this,void 0),pw(this,Fp,e,"f"),pw(this,qi,t,"f"),pw(this,Ve,new pe(Be(this,Fp,"f")),"f"),this.namedParameter=Be(this,hw,"m",d1).call(this,t)}get box(){return Be(this,qi,"f")}get uuid(){return Be(this,qi,"f").address.uuid}get address(){return Be(this,qi,"f").address}get labelField(){return Be(this,qi,"f").label}get iconField(){return Be(this,qi,"f").icon}get defaultTrackType(){return ie.Notes}get enabledField(){return Be(this,qi,"f").enabled}get minimizedField(){return Be(this,qi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Be(this,Fp,"f").boxAdapters.adapterFor(Be(this,qi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Be(this,Ve,"f").terminate()}};Fp=new WeakMap,qi=new WeakMap,Ve=new WeakMap,hw=new WeakSet,d1=function(e){let t=[dn.Monophonic,dn.Polyphonic];return{oscillators:e.oscillators.fields().map(i=>({waveform:Be(this,Ve,"f").createParameter(i.waveform,S.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Be(this,Ve,"f").createParameter(i.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Be(this,Ve,"f").createParameter(i.octave,S.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:Be(this,Ve,"f").createParameter(i.tune,S.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Be(this,Ve,"f").createParameter(e.noise.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Be(this,Ve,"f").createParameter(e.noise.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Be(this,Ve,"f").createParameter(e.noise.hold,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Be(this,Ve,"f").createParameter(e.noise.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Be(this,Ve,"f").createParameter(e.filterOrder,Mn.FILTER_ORDER_VALUE_MAPPING,Mn.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Be(this,Ve,"f").createParameter(e.cutoff,Mn.CUTOFF_VALUE_MAPPING,Mn.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Be(this,Ve,"f").createParameter(e.resonance,S.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Be(this,Ve,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Be(this,Ve,"f").createParameter(e.decay,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Be(this,Ve,"f").createParameter(e.sustain,S.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:Be(this,Ve,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Be(this,Ve,"f").createParameter(e.filterEnvelope,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Be(this,Ve,"f").createParameter(e.filterKeyboard,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Be(this,Ve,"f").createParameter(e.voicingMode,S.values(t),P.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Be(this,Ve,"f").createParameter(e.glideTime,S.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:Be(this,Ve,"f").createParameter(e.unisonCount,S.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(i=>String(i))),"Unisono",0),unisonDetune:Be(this,Ve,"f").createParameter(e.unisonDetune,S.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Be(this,Ve,"f").createParameter(e.unisonStereo,S.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Be(this,Ve,"f").createParameter(e.lfo.waveform,Mn.LFO_WAVEFORM_VALUE_MAPPING,Mn.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Be(this,Ve,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Be(this,Ve,"f").createParameter(e.lfo.targetTune,S.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Be(this,Ve,"f").createParameter(e.lfo.targetVolume,S.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Be(this,Ve,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var fw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mw,kg,Np,gi,Dn,p1,Hi=class{constructor(e,t){mw.add(this),this.type="midi-effect",this.accepts="midi",Np.set(this,void 0),gi.set(this,void 0),Dn.set(this,void 0),fw(this,Np,e,"f"),fw(this,gi,t,"f"),fw(this,Dn,new pe(Rt(this,Np,"f")),"f"),this.namedParameter=Rt(this,mw,"m",p1).call(this,t)}get box(){return Rt(this,gi,"f")}get uuid(){return Rt(this,gi,"f").address.uuid}get address(){return Rt(this,gi,"f").address}get indexField(){return Rt(this,gi,"f").index}get labelField(){return Rt(this,gi,"f").label}get enabledField(){return Rt(this,gi,"f").enabled}get minimizedField(){return Rt(this,gi,"f").minimized}get host(){return Rt(this,gi,"f").host}deviceHost(){return Rt(this,Np,"f").boxAdapters.adapterFor(Rt(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Rt(this,Dn,"f").terminate()}};kg=Hi,Np=new WeakMap,gi=new WeakMap,Dn=new WeakMap,mw=new WeakSet,p1=function(e){return{modeIndex:Rt(this,Dn,"f").createParameter(e.modeIndex,S.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Rt(this,Dn,"f").createParameter(e.numOctaves,S.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Rt(this,Dn,"f").createParameter(e.rateIndex,S.linearInteger(0,kg.RateFractions.length-1),kg.RateStringMapping,"Rate"),gate:Rt(this,Dn,"f").createParameter(e.gate,S.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:Rt(this,Dn,"f").createParameter(e.repeat,S.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:Rt(this,Dn,"f").createParameter(e.velocity,S.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Hi.RateFractions=or.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();Hi.RateStringMapping=P.indices("",kg.RateFractions.map(([r,e])=>`${r}/${e}`));var gw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},er=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vw,kp,vi,zs,h1,Tu=class{constructor(e,t){vw.add(this),this.type="midi-effect",this.accepts="midi",kp.set(this,void 0),vi.set(this,void 0),zs.set(this,void 0),gw(this,kp,e,"f"),gw(this,vi,t,"f"),gw(this,zs,new pe(er(this,kp,"f")),"f"),this.namedParameter=er(this,vw,"m",h1).call(this,t)}get box(){return er(this,vi,"f")}get uuid(){return er(this,vi,"f").address.uuid}get address(){return er(this,vi,"f").address}get indexField(){return er(this,vi,"f").index}get labelField(){return er(this,vi,"f").label}get enabledField(){return er(this,vi,"f").enabled}get minimizedField(){return er(this,vi,"f").minimized}get host(){return er(this,vi,"f").host}deviceHost(){return er(this,kp,"f").boxAdapters.adapterFor(er(this,vi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){er(this,zs,"f").terminate()}};kp=new WeakMap,vi=new WeakMap,zs=new WeakMap,vw=new WeakSet,h1=function(e){return{octaves:er(this,zs,"f").createParameter(e.octaves,S.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:er(this,zs,"f").createParameter(e.semiTones,S.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:er(this,zs,"f").createParameter(e.cents,S.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var yw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},xw,$p,Ji,Ru,f1,Ou=class{constructor(e,t){xw.add(this),this.type="instrument",this.accepts="midi",$p.set(this,void 0),Ji.set(this,void 0),Ru.set(this,void 0),yw(this,$p,e,"f"),yw(this,Ji,t,"f"),yw(this,Ru,new pe(Pr(this,$p,"f")),"f"),this.namedParameter=Pr(this,xw,"m",f1).call(this,t)}get box(){return Pr(this,Ji,"f")}get uuid(){return Pr(this,Ji,"f").address.uuid}get address(){return Pr(this,Ji,"f").address}get labelField(){return Pr(this,Ji,"f").label}get iconField(){return Pr(this,Ji,"f").icon}get defaultTrackType(){return ie.Notes}get enabledField(){return Pr(this,Ji,"f").enabled}get minimizedField(){return Pr(this,Ji,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Pr(this,$p,"f").boxAdapters.adapterFor(Pr(this,Ji,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pr(this,Ru,"f").terminate()}};$p=new WeakMap,Ji=new WeakMap,Ru=new WeakMap,xw=new WeakSet,f1=function(e){return{volume:Pr(this,Ru,"f").createParameter(e.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:Pr(this,Ru,"f").createParameter(e.release,S.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var Vu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},H=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ww,Us,fa,we,$g,Mg,Wr,zu,m1,Uu=class{constructor(e,t){ww.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",Us.set(this,new U),fa.set(this,void 0),we.set(this,void 0),$g.set(this,void 0),Mg.set(this,void 0),Wr.set(this,void 0),zu.set(this,g.None),Vu(this,fa,e,"f"),Vu(this,we,t,"f"),Vu(this,$g,H(this,Us,"f").own(Lt.create(H(this,we,"f").midiEffects,i=>H(this,fa,"f").boxAdapters.adapterFor(i,ne.isMidiEffect),u.MidiEffectHost)),"f"),Vu(this,Mg,H(this,Us,"f").own(Lt.create(H(this,we,"f").audioEffects,i=>H(this,fa,"f").boxAdapters.adapterFor(i,ne.isAudioEffect),u.AudioEffectHost)),"f"),Vu(this,Wr,H(this,Us,"f").own(new pe(H(this,fa,"f"))),"f"),this.namedParameter=H(this,ww,"m",m1).call(this,t),H(this,Us,"f").own(H(this,we,"f").file.catchupAndSubscribe(i=>{Vu(this,zu,i.targetVertex.map(({box:n})=>H(this,fa,"f").boxAdapters.adapterFor(n,Oi)),"f"),H(this,zu,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return H(this,we,"f")}get uuid(){return H(this,we,"f").address.uuid}get address(){return H(this,we,"f").address}get peakAddress(){return H(this,we,"f").address.append(1001)}get indexField(){return H(this,we,"f").index}get gate(){return H(this,we,"f").gate.getValue()}get exclude(){return H(this,we,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${H(this,zu,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return H(this,we,"f").icon}get defaultTrackType(){return ie.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return H(this,we,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return H(this,we,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return H(this,zu,"f")}fileUUID(){return H(this,we,"f").file.targetAddress.unwrap().uuid}resetParameters(){H(this,we,"f").mute.reset(),H(this,we,"f").solo.reset(),H(this,we,"f").exclude.reset(),H(this,we,"f").polyphone.reset(),H(this,we,"f").pitch.reset(),H(this,we,"f").attack.reset(),H(this,we,"f").release.reset(),H(this,we,"f").sampleStart.reset(),H(this,we,"f").sampleEnd.reset(),H(this,we,"f").gate.reset()}copyToIndex(e){Vo.create(H(this,we,"f").graph,w.generate(),t=>{t.file.refer(H(this,we,"f").file.targetVertex.unwrap()),t.device.refer(H(this,we,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(H(this,we,"f").mute.getValue()),t.solo.setValue(H(this,we,"f").solo.getValue()),t.sampleStart.setValue(H(this,we,"f").sampleStart.getValue()),t.sampleEnd.setValue(H(this,we,"f").sampleEnd.getValue()),t.attack.setValue(H(this,we,"f").attack.getValue()),t.release.setValue(H(this,we,"f").release.getValue()),t.pitch.setValue(H(this,we,"f").pitch.getValue()),t.exclude.setValue(H(this,we,"f").exclude.getValue()),t.gate.setValue(H(this,we,"f").gate.getValue())})}get midiEffects(){return H(this,$g,"f")}get inputAdapter(){return g.wrap(this)}get audioEffects(){return H(this,Mg,"f")}get labelField(){return H(this,we,"f").label}get enabledField(){return H(this,we,"f").enabled}get minimizedField(){return H(this,we,"f").minimized}device(){return H(this,fa,"f").boxAdapters.adapterFor(H(this,we,"f").device.targetVertex.unwrap().box,ma)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){H(this,Us,"f").terminate()}};Us=new WeakMap,fa=new WeakMap,we=new WeakMap,$g=new WeakMap,Mg=new WeakMap,Wr=new WeakMap,zu=new WeakMap,ww=new WeakSet,m1=function(e){return{gate:H(this,Wr,"f").createParameter(e.gate,S.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:H(this,Wr,"f").createParameter(e.mute,S.bool,P.bool,"Mute"),solo:H(this,Wr,"f").createParameter(e.solo,S.bool,P.bool,"Solo"),polyphone:H(this,Wr,"f").createParameter(e.polyphone,S.bool,P.bool,"Polyphone"),exclude:H(this,Wr,"f").createParameter(e.exclude,S.bool,P.bool,"Exclude"),pitch:H(this,Wr,"f").createParameter(e.pitch,S.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:H(this,Wr,"f").createParameter(e.sampleStart,S.unipolar(),P.percent(),"Start",0),sampleEnd:H(this,Wr,"f").createParameter(e.sampleEnd,S.unipolar(),P.percent(),"End",1),attack:H(this,Wr,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:H(this,Wr,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Dg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Sr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ju,Qi,Mp,Ig,ma=class{constructor(e,t){this.type="instrument",this.accepts="midi",ju.set(this,void 0),Qi.set(this,void 0),Mp.set(this,void 0),Ig.set(this,void 0),Dg(this,ju,e,"f"),Dg(this,Qi,t,"f"),Dg(this,Mp,Lt.create(t.samples,i=>e.boxAdapters.adapterFor(i,Uu),u.Sample),"f"),Dg(this,Ig,new pe(Sr(this,ju,"f")),"f")}reset(){Sr(this,Mp,"f").adapters().forEach(e=>e.box.delete())}get box(){return Sr(this,Qi,"f")}get uuid(){return Sr(this,Qi,"f").address.uuid}get address(){return Sr(this,Qi,"f").address}get labelField(){return Sr(this,Qi,"f").label}get iconField(){return Sr(this,Qi,"f").icon}get defaultTrackType(){return ie.Notes}get enabledField(){return Sr(this,Qi,"f").enabled}get minimizedField(){return Sr(this,Qi,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Sr(this,Mp,"f")}get context(){return Sr(this,ju,"f")}deviceHost(){return Sr(this,ju,"f").boxAdapters.adapterFor(Sr(this,Qi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Sr(this,Ig,"f").terminate()}};ju=new WeakMap,Qi=new WeakMap,Mp=new WeakMap,Ig=new WeakMap;var bw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ot=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Aw,Dp,yi,In,g1,Lu=class{constructor(e,t){Aw.add(this),this.type="audio-effect",this.accepts="audio",Dp.set(this,void 0),yi.set(this,void 0),In.set(this,void 0),bw(this,Dp,e,"f"),bw(this,yi,t,"f"),bw(this,In,new pe(Ot(this,Dp,"f")),"f"),this.namedParameter=Ot(this,Aw,"m",g1).call(this,t)}get box(){return Ot(this,yi,"f")}get uuid(){return Ot(this,yi,"f").address.uuid}get address(){return Ot(this,yi,"f").address}get indexField(){return Ot(this,yi,"f").index}get labelField(){return Ot(this,yi,"f").label}get enabledField(){return Ot(this,yi,"f").enabled}get minimizedField(){return Ot(this,yi,"f").minimized}get host(){return Ot(this,yi,"f").host}deviceHost(){return Ot(this,Dp,"f").boxAdapters.adapterFor(Ot(this,yi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ot(this,In,"f").terminate()}};Dp=new WeakMap,yi=new WeakMap,In=new WeakMap,Aw=new WeakSet,g1=function(e){return{volume:Ot(this,In,"f").createParameter(e.volume,S.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Ot(this,In,"f").createParameter(e.panning,S.bipolar(),P.panning,"Panning",.5),stereo:Ot(this,In,"f").createParameter(e.stereo,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:Ot(this,In,"f").createParameter(e.invertL,S.bool,P.bool,"Invert Left"),invertR:Ot(this,In,"f").createParameter(e.invertR,S.bool,P.bool,"Invert Right"),swap:Ot(this,In,"f").createParameter(e.swap,S.bool,P.bool,"Swap")}};var js;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(js||(js={}));var v1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Er=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ku,Br,Wu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Ku.set(this,void 0),Br.set(this,void 0),v1(this,Ku,e,"f"),v1(this,Br,t,"f"),this.groove()}get box(){return Er(this,Br,"f")}get uuid(){return Er(this,Br,"f").address.uuid}get address(){return Er(this,Br,"f").address}get indexField(){return Er(this,Br,"f").index}get labelField(){return Er(this,Br,"f").label}get enabledField(){return Er(this,Br,"f").enabled}get minimizedField(){return Er(this,Br,"f").minimized}get host(){return Er(this,Br,"f").host}deviceHost(){return Er(this,Ku,"f").boxAdapters.adapterFor(Er(this,Br,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}groove(){return Er(this,Ku,"f").boxAdapters.adapterFor(Er(this,Br,"f").groove.targetVertex.unwrap("no groove").box,js.checkType)}catchupAndSubscribeGroove(e){return Er(this,Br,"f").groove.catchupAndSubscribe(t=>e(Er(this,Ku,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,js.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ku=new WeakMap,Br=new WeakMap;var y1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Yi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Cg,Zr,Zu=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Cg.set(this,void 0),Zr.set(this,void 0),y1(this,Cg,e,"f"),y1(this,Zr,t,"f")}get box(){return Yi(this,Zr,"f")}get uuid(){return Yi(this,Zr,"f").address.uuid}get address(){return Yi(this,Zr,"f").address}get indexField(){return Yi(this,Zr,"f").index}get labelField(){return Yi(this,Zr,"f").label}get enabledField(){return Yi(this,Zr,"f").enabled}get minimizedField(){return Yi(this,Zr,"f").minimized}get host(){return Yi(this,Zr,"f").host}get commentField(){return Yi(this,Zr,"f").comment}deviceHost(){return Yi(this,Cg,"f").boxAdapters.adapterFor(Yi(this,Zr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Cg=new WeakMap,Zr=new WeakMap;var x1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Xi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Tg,Gr,Gu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Tg.set(this,void 0),Gr.set(this,void 0),x1(this,Tg,e,"f"),x1(this,Gr,t,"f")}get box(){return Xi(this,Gr,"f")}get uuid(){return Xi(this,Gr,"f").address.uuid}get address(){return Xi(this,Gr,"f").address}get indexField(){return Xi(this,Gr,"f").index}get labelField(){return Xi(this,Gr,"f").label}get enabledField(){return Xi(this,Gr,"f").enabled}get minimizedField(){return Xi(this,Gr,"f").minimized}get host(){return Xi(this,Gr,"f").host}get commentField(){return Xi(this,Gr,"f").comment}deviceHost(){return Xi(this,Tg,"f").boxAdapters.adapterFor(Xi(this,Gr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Tg=new WeakMap,Gr=new WeakMap;var ga=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Fe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},_w,Pw,Ip,Fr,Rg,qu,en,xi,Hu,w1,Sw,Ju=class{constructor(e,t){_w.add(this),this.type="instrument",this.accepts="midi",Pw.set(this,new U),Ip.set(this,void 0),Fr.set(this,void 0),Rg.set(this,void 0),qu.set(this,void 0),en.set(this,void 0),xi.set(this,void 0),Hu.set(this,K.Empty),Sw.set(this,i=>i.match({none:()=>{Fe(this,xi,"f").clear(),Fe(this,en,"f").clear()},some:n=>n.soundfont.match({none:()=>{Fe(this,xi,"f").clear(),Fe(this,en,"f").clear(),Fe(this,Hu,"f").terminate(),ga(this,Hu,n.subscribe(o=>{if(o.type==="loaded"){let a=n.soundfont.unwrap();Fe(this,xi,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Fe(this,en,"f").wrap(a)}else o.type==="error"?(Fe(this,xi,"f").clear(),Fe(this,en,"f").clear()):o.type==="idle"&&(Fe(this,xi,"f").clear(),Fe(this,en,"f").clear())}),"f")},some:o=>{Fe(this,en,"f").wrap(o),Fe(this,xi,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),ga(this,Ip,e,"f"),ga(this,Fr,t,"f"),ga(this,Rg,new pe(Fe(this,Ip,"f")),"f"),this.namedParameter=Fe(this,_w,"m",w1).call(this,t),ga(this,qu,new Xr,"f"),ga(this,en,new Xr,"f"),ga(this,xi,new Xr,"f"),Fe(this,Pw,"f").ownAll(Fe(this,qu,"f").subscribe(Fe(this,Sw,"f")),Fe(this,Fr,"f").file.catchupAndSubscribe(({targetVertex:i})=>Fe(this,qu,"f").wrapOption(i.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid)))),Fe(this,Fr,"f").presetIndex.catchupAndSubscribe(i=>Fe(this,en,"f").match({none:()=>Fe(this,xi,"f").clear(),some:n=>Fe(this,xi,"f").wrap(n.presets[i.getValue()]??n.presets[0])})))}get loader(){return Fe(this,qu,"f")}get soundfont(){return Fe(this,en,"f")}get preset(){return Fe(this,xi,"f")}get presetIndex(){return Fe(this,Fr,"f").presetIndex.getValue()}get box(){return Fe(this,Fr,"f")}get uuid(){return Fe(this,Fr,"f").address.uuid}get address(){return Fe(this,Fr,"f").address}get labelField(){return Fe(this,Fr,"f").label}get iconField(){return Fe(this,Fr,"f").icon}get defaultTrackType(){return ie.Notes}get enabledField(){return Fe(this,Fr,"f").enabled}get minimizedField(){return Fe(this,Fr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Fe(this,Ip,"f").boxAdapters.adapterFor(Fe(this,Fr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Fe(this,Hu,"f").terminate(),ga(this,Hu,K.Empty,"f"),Fe(this,Rg,"f").terminate()}};Pw=new WeakMap,Ip=new WeakMap,Fr=new WeakMap,Rg=new WeakMap,qu=new WeakMap,en=new WeakMap,xi=new WeakMap,Hu=new WeakMap,Sw=new WeakMap,_w=new WeakSet,w1=function(e){return{}};var b1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Cp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Og,Ls,Vg=class{constructor(e,t){Og.set(this,void 0),Ls.set(this,void 0),b1(this,Og,e,"f"),b1(this,Ls,t,"f")}get box(){return Cp(this,Ls,"f")}get uuid(){return Cp(this,Ls,"f").address.uuid}get address(){return Cp(this,Ls,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Cp(this,Og,"f").soundfontManager.getOrCreate(Cp(this,Ls,"f").address.uuid)}terminate(){}};Og=new WeakMap,Ls=new WeakMap;var Ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ot=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Bw,Tp,wi,tr,A1,Qu=class{constructor(e,t){Bw.add(this),this.type="audio-effect",this.accepts="audio",Tp.set(this,void 0),wi.set(this,void 0),tr.set(this,void 0),Ew(this,Tp,e,"f"),Ew(this,wi,t,"f"),Ew(this,tr,new pe(ot(this,Tp,"f")),"f"),this.namedParameter=ot(this,Bw,"m",A1).call(this,t)}get box(){return ot(this,wi,"f")}get uuid(){return ot(this,wi,"f").address.uuid}get address(){return ot(this,wi,"f").address}get indexField(){return ot(this,wi,"f").index}get labelField(){return ot(this,wi,"f").label}get enabledField(){return ot(this,wi,"f").enabled}get minimizedField(){return ot(this,wi,"f").minimized}get host(){return ot(this,wi,"f").host}deviceHost(){return ot(this,Tp,"f").boxAdapters.adapterFor(ot(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ot(this,tr,"f").terminate()}};Tp=new WeakMap,wi=new WeakMap,tr=new WeakMap,Bw=new WeakSet,A1=function(e){return{lookahead:ot(this,tr,"f").createParameter(e.lookahead,S.bool,P.bool,"Lookahead"),automakeup:ot(this,tr,"f").createParameter(e.automakeup,S.bool,P.bool,"Auto Makeup"),autoattack:ot(this,tr,"f").createParameter(e.autoattack,S.bool,P.bool,"Auto Attack"),autorelease:ot(this,tr,"f").createParameter(e.autorelease,S.bool,P.bool,"Auto Release"),inputgain:ot(this,tr,"f").createParameter(e.inputgain,S.linear(-30,30),P.decible,"Input Gain"),threshold:ot(this,tr,"f").createParameter(e.threshold,S.linear(-60,0),P.decible,"Threshold"),ratio:ot(this,tr,"f").createParameter(e.ratio,S.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:ot(this,tr,"f").createParameter(e.knee,S.linear(0,24),P.decible,"Knee"),attack:ot(this,tr,"f").createParameter(e.attack,S.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:ot(this,tr,"f").createParameter(e.release,S.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:ot(this,tr,"f").createParameter(e.makeup,S.linear(-40,40),P.decible,"Makeup Gain"),mix:ot(this,tr,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Dry/Wet")}};var Fw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Gt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Nw,Rp,bi,va,_1,Yu=class{constructor(e,t){Nw.add(this),this.type="audio-effect",this.accepts="audio",Rp.set(this,void 0),bi.set(this,void 0),va.set(this,void 0),Fw(this,Rp,e,"f"),Fw(this,bi,t,"f"),Fw(this,va,new pe(Gt(this,Rp,"f")),"f"),this.namedParameter=Gt(this,Nw,"m",_1).call(this,t)}get box(){return Gt(this,bi,"f")}get uuid(){return Gt(this,bi,"f").address.uuid}get address(){return Gt(this,bi,"f").address}get indexField(){return Gt(this,bi,"f").index}get labelField(){return Gt(this,bi,"f").label}get enabledField(){return Gt(this,bi,"f").enabled}get minimizedField(){return Gt(this,bi,"f").minimized}get host(){return Gt(this,bi,"f").host}deviceHost(){return Gt(this,Rp,"f").boxAdapters.adapterFor(Gt(this,bi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Gt(this,va,"f").terminate()}};Rp=new WeakMap,bi=new WeakMap,va=new WeakMap,Nw=new WeakSet,_1=function(e){return{crush:Gt(this,va,"f").createParameter(e.crush,S.unipolar(),P.percent(),"Crush"),bits:Gt(this,va,"f").createParameter(e.bits,S.linearInteger(1,16),P.numeric(),"Bits"),boost:Gt(this,va,"f").createParameter(e.boost,S.linear(0,24),P.decible,"Boost"),mix:Gt(this,va,"f").createParameter(e.mix,S.exponential(.001,1),P.percent(),"Mix")}};var kw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},fr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$w,Op,Ai,Xu,P1,ec=class{constructor(e,t){$w.add(this),this.type="audio-effect",this.accepts="audio",Op.set(this,void 0),Ai.set(this,void 0),Xu.set(this,void 0),kw(this,Op,e,"f"),kw(this,Ai,t,"f"),kw(this,Xu,new pe(fr(this,Op,"f")),"f"),this.namedParameter=fr(this,$w,"m",P1).call(this,t)}get box(){return fr(this,Ai,"f")}get uuid(){return fr(this,Ai,"f").address.uuid}get address(){return fr(this,Ai,"f").address}get indexField(){return fr(this,Ai,"f").index}get labelField(){return fr(this,Ai,"f").label}get enabledField(){return fr(this,Ai,"f").enabled}get minimizedField(){return fr(this,Ai,"f").minimized}get host(){return fr(this,Ai,"f").host}deviceHost(){return fr(this,Op,"f").boxAdapters.adapterFor(fr(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){fr(this,Xu,"f").terminate()}};Op=new WeakMap,Ai=new WeakMap,Xu=new WeakMap,$w=new WeakSet,P1=function(e){return{drive:fr(this,Xu,"f").createParameter(e.drive,S.linear(0,30),P.decible,"Drive"),volume:fr(this,Xu,"f").createParameter(e.volume,S.linear(-18,0),P.decible,"Volume")}};var zg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Nt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vp,zp,_i,tc,rc,ic=class{constructor(e,t){Vp.set(this,new U),this.type="instrument",this.accepts="midi",zp.set(this,void 0),_i.set(this,void 0),tc.set(this,void 0),rc.set(this,void 0),zg(this,zp,e,"f"),zg(this,_i,t,"f"),zg(this,tc,new Xr,"f"),zg(this,rc,Nt(this,Vp,"f").own(new pe(Nt(this,zp,"f"))),"f"),Nt(this,Vp,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>Nt(this,rc,"f").createParameter(Ne(i,Ri).value,S.unipolar(),P.percent({fractionDigits:1}),"",0),onRemoved:({box:i})=>Nt(this,rc,"f").removeParameter(Ne(i,Ri).value.address)}),Nt(this,_i,"f").device.catchupAndSubscribe(({targetVertex:i})=>i.match({none:()=>Nt(this,tc,"f").clear(),some:({box:n})=>Nt(this,tc,"f").wrap(Ne(n,Ti))})))}get box(){return Nt(this,_i,"f")}get uuid(){return Nt(this,_i,"f").address.uuid}get address(){return Nt(this,_i,"f").address}get labelField(){return Nt(this,_i,"f").label}get iconField(){return Nt(this,_i,"f").icon}get defaultTrackType(){return ie.Notes}get enabledField(){return Nt(this,_i,"f").enabled}get minimizedField(){return Nt(this,_i,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Nt(this,rc,"f")}get midiDevice(){return Nt(this,tc,"f")}deviceHost(){return Nt(this,zp,"f").boxAdapters.adapterFor(Nt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Nt(this,Vp,"f").terminate()}};Vp=new WeakMap,zp=new WeakMap,_i=new WeakMap,tc=new WeakMap,rc=new WeakMap;var Ug=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Mw,Up,Pi,Cn,jp,S1,nc=class{constructor(e,t){Mw.add(this),this.type="midi-effect",this.accepts="midi",Up.set(this,void 0),Pi.set(this,void 0),Cn.set(this,void 0),jp.set(this,void 0),Ug(this,Up,e,"f"),Ug(this,Pi,t,"f"),Ug(this,Cn,new pe(wt(this,Up,"f")),"f"),Ug(this,jp,nl.create(),"f"),this.namedParameter=wt(this,Mw,"m",S1).call(this,t)}computeVelocity(e,t){let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;wt(this,jp,"f").setSeed(o.valueAt(e)+e);let c=t+(i.valueAt(e)-t)*n.valueAt(e),p=(wt(this,jp,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),f=l.valueAt(e);return t*(1-f)+Qr(c+p+d)*f}get box(){return wt(this,Pi,"f")}get uuid(){return wt(this,Pi,"f").address.uuid}get address(){return wt(this,Pi,"f").address}get indexField(){return wt(this,Pi,"f").index}get labelField(){return wt(this,Pi,"f").label}get enabledField(){return wt(this,Pi,"f").enabled}get minimizedField(){return wt(this,Pi,"f").minimized}get host(){return wt(this,Pi,"f").host}deviceHost(){return wt(this,Up,"f").boxAdapters.adapterFor(wt(this,Pi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){wt(this,Cn,"f").terminate()}};Up=new WeakMap,Pi=new WeakMap,Cn=new WeakMap,jp=new WeakMap,Mw=new WeakSet,S1=function(e){return{magnetPosition:wt(this,Cn,"f").createParameter(e.magnetPosition,S.unipolar(),P.percent(),"Position"),magnetStrength:wt(this,Cn,"f").createParameter(e.magnetStrength,S.unipolar(),P.percent(),"Strength"),randomSeed:wt(this,Cn,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:wt(this,Cn,"f").createParameter(e.randomAmount,S.unipolar(),P.percent(),"Amount"),offset:wt(this,Cn,"f").createParameter(e.offset,S.bipolar(),P.percent(),"Offset"),mix:wt(this,Cn,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Mix")}};var Dw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Vt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iw,Cw,Lp,Si,Tn,E1,tn=class{constructor(e,t){Iw.add(this),this.type="audio-effect",this.accepts="audio",Lp.set(this,void 0),Si.set(this,void 0),Tn.set(this,void 0),Dw(this,Lp,e,"f"),Dw(this,Si,t,"f"),Dw(this,Tn,new pe(Vt(this,Lp,"f")),"f"),this.namedParameter=Vt(this,Iw,"m",E1).call(this,t)}get box(){return Vt(this,Si,"f")}get uuid(){return Vt(this,Si,"f").address.uuid}get address(){return Vt(this,Si,"f").address}get indexField(){return Vt(this,Si,"f").index}get labelField(){return Vt(this,Si,"f").label}get enabledField(){return Vt(this,Si,"f").enabled}get minimizedField(){return Vt(this,Si,"f").minimized}get host(){return Vt(this,Si,"f").host}deviceHost(){return Vt(this,Lp,"f").boxAdapters.adapterFor(Vt(this,Si,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Vt(this,Tn,"f").terminate()}};Cw=tn,Lp=new WeakMap,Si=new WeakMap,Tn=new WeakMap,Iw=new WeakSet,E1=function(e){let{RateFractions:t,RateStringMapping:i}=Cw;return{slope:Vt(this,Tn,"f").createParameter(e.slope,S.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:Vt(this,Tn,"f").createParameter(e.symmetry,S.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Vt(this,Tn,"f").createParameter(e.rate,S.values(t.map((n,o)=>o)),i,"Rate",0),depth:Vt(this,Tn,"f").createParameter(e.depth,S.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:Vt(this,Tn,"f").createParameter(e.offset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Vt(this,Tn,"f").createParameter(e.channelOffset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};tn.RateFractions=or.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();tn.RateStringMapping=P.indices("",Cw.RateFractions.map(([r,e])=>`${r}/${e}`));var Tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},at=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Rw,Kp,Ei,rr,B1,oc=class{constructor(e,t){Rw.add(this),this.type="audio-effect",this.accepts="audio",Kp.set(this,void 0),Ei.set(this,void 0),rr.set(this,void 0),Tw(this,Kp,e,"f"),Tw(this,Ei,t,"f"),Tw(this,rr,new pe(at(this,Kp,"f")),"f"),this.namedParameter=at(this,Rw,"m",B1).call(this,t)}get box(){return at(this,Ei,"f")}get uuid(){return at(this,Ei,"f").address.uuid}get address(){return at(this,Ei,"f").address}get indexField(){return at(this,Ei,"f").index}get labelField(){return at(this,Ei,"f").label}get enabledField(){return at(this,Ei,"f").enabled}get minimizedField(){return at(this,Ei,"f").minimized}get host(){return at(this,Ei,"f").host}deviceHost(){return at(this,Kp,"f").boxAdapters.adapterFor(at(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){at(this,rr,"f").terminate()}};Kp=new WeakMap,Ei=new WeakMap,rr=new WeakMap,Rw=new WeakSet,B1=function(e){return{preDelay:at(this,rr,"f").createParameter(e.preDelay,S.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:at(this,rr,"f").createParameter(e.bandwidth,S.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:at(this,rr,"f").createParameter(e.inputDiffusion1,S.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:at(this,rr,"f").createParameter(e.inputDiffusion2,S.unipolar(),P.percent(),"Tank 2"),decay:at(this,rr,"f").createParameter(e.decay,S.unipolar(),P.percent(),"Decay"),decayDiffusion1:at(this,rr,"f").createParameter(e.decayDiffusion1,S.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:at(this,rr,"f").createParameter(e.decayDiffusion2,S.unipolar(),P.percent(),"Tank 2"),damping:at(this,rr,"f").createParameter(e.damping,S.unipolar(),P.percent(),"Damping"),excursionRate:at(this,rr,"f").createParameter(e.excursionRate,S.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:at(this,rr,"f").createParameter(e.excursionDepth,S.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:at(this,rr,"f").createParameter(e.wet,S.DefaultDecibel,P.decible,"Wet"),dry:at(this,rr,"f").createParameter(e.dry,S.DefaultDecibel,P.decible,"Dry")}};var jg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},J=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ow,X,vo,Wp,Lg,F1,Kg=class{constructor(e){Ow.add(this),X.set(this,void 0),vo.set(this,void 0),Wp.set(this,void 0),Lg.set(this,void 0),jg(this,X,e,"f"),jg(this,vo,w.newSet(t=>t.uuid),"f"),jg(this,Wp,new Set,"f"),jg(this,Lg,J(this,X,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let i=J(this,vo,"f").getOrNull(t.uuid);Z(i)&&(J(this,Wp,"f").add(i.box),J(this,vo,"f").removeByValue(i).terminate())}}}),"f")}terminate(){J(this,vo,"f").values().forEach(e=>e.terminate()),J(this,vo,"f").clear(),J(this,Lg,"f").terminate()}adapterFor(e,t){if(J(this,Wp,"f").has(e))return F(`Cannot resolve adapter for already deleted box: ${e}`);let i=J(this,vo,"f").getOrNull(e.address.uuid);if(i===null){i=J(this,Ow,"m",F1).call(this,e);let n=J(this,vo,"f").add(i);I(n,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?i instanceof t?i:F(`${i} is not instance of ${t}`):t(i)?i:F(`${i} did not pass custom type guard`):F("Unknown checkType method")}};X=new WeakMap,vo=new WeakMap,Wp=new WeakMap,Lg=new WeakMap,Ow=new WeakSet,F1=function(e){return ee(e.accept({visitArpeggioDeviceBox:t=>new Hi(J(this,X,"f"),t),visitAudioBusBox:t=>new dr(J(this,X,"f"),t),visitAudioClipBox:t=>new io(J(this,X,"f"),t),visitAudioFileBox:t=>new Oi(J(this,X,"f"),t),visitAudioTimeStretchBox:t=>new vn(J(this,X,"f"),t),visitAudioPitchStretchBox:t=>new gn(J(this,X,"f"),t),visitTransientMarkerBox:t=>new Cl(t),visitWarpMarkerBox:t=>new Zo(J(this,X,"f"),t),visitAudioRegionBox:t=>new Jo(J(this,X,"f"),t),visitAudioUnitBox:t=>new li(J(this,X,"f"),t),visitAuxSendBox:t=>new lu(J(this,X,"f"),t),visitCompressorDeviceBox:t=>new Qu(J(this,X,"f"),t),visitCrusherDeviceBox:t=>new Yu(J(this,X,"f"),t),visitDattorroReverbDeviceBox:t=>new oc(J(this,X,"f"),t),visitDelayDeviceBox:t=>new ci(J(this,X,"f"),t),visitDeviceInterfaceKnobBox:t=>new _u(J(this,X,"f"),t),visitTidalDeviceBox:t=>new tn(J(this,X,"f"),t),visitFoldDeviceBox:t=>new ec(J(this,X,"f"),t),visitGrooveShuffleBox:t=>new Nn(J(this,X,"f"),t),visitMarkerBox:t=>new na(J(this,X,"f"),t),visitMIDIOutputDeviceBox:t=>new ic(J(this,X,"f"),t),visitModularAudioInputBox:t=>new bu(J(this,X,"f"),t),visitModularAudioOutputBox:t=>new yu(J(this,X,"f"),t),visitModularBox:t=>new sa(J(this,X,"f"),t),visitModularDeviceBox:t=>new ua(J(this,X,"f"),t),visitModuleConnectionBox:t=>new aa(J(this,X,"f"),t),visitModuleDelayBox:t=>new vu(J(this,X,"f"),t),visitModuleGainBox:t=>new xu(J(this,X,"f"),t),visitModuleMultiplierBox:t=>new wu(J(this,X,"f"),t),visitNanoDeviceBox:t=>new Ou(J(this,X,"f"),t),visitNoteClipBox:t=>new Zl(J(this,X,"f"),t),visitNoteEventBox:t=>new us(J(this,X,"f"),t),visitNoteEventCollectionBox:t=>new ii(J(this,X,"f"),t),visitNoteRegionBox:t=>new Qo(J(this,X,"f"),t),visitPitchDeviceBox:t=>new Tu(J(this,X,"f"),t),visitPlayfieldDeviceBox:t=>new ma(J(this,X,"f"),t),visitPlayfieldSampleBox:t=>new Uu(J(this,X,"f"),t),visitRevampDeviceBox:t=>new mu(J(this,X,"f"),t),visitReverbDeviceBox:t=>new fu(J(this,X,"f"),t),visitRootBox:t=>new Du(J(this,X,"f"),t),visitSoundfontDeviceBox:t=>new Ju(J(this,X,"f"),t),visitSoundfontFileBox:t=>new Vg(J(this,X,"f"),t),visitStereoToolDeviceBox:t=>new Lu(J(this,X,"f"),t),visitTapeDeviceBox:t=>new Iu(J(this,X,"f"),t),visitTimelineBox:t=>new Fn(J(this,X,"f"),t),visitTrackBox:t=>new mt(J(this,X,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Zu(J(this,X,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Gu(J(this,X,"f"),t),visitValueClipBox:t=>new Wo(J(this,X,"f"),t),visitValueEventBox:t=>new eo(J(this,X,"f"),t),visitValueEventCollectionBox:t=>new ur(J(this,X,"f"),t),visitValueRegionBox:t=>new uo(J(this,X,"f"),t),visitVaporisateurDeviceBox:t=>new Cu(J(this,X,"f"),t),visitVelocityDeviceBox:t=>new nc(J(this,X,"f"),t),visitZeitgeistDeviceBox:t=>new Wu(J(this,X,"f"),t)}),`Could not find factory for ${e}`)};var ac;(function(r){r.PEAKS=Ae.compose(w.Lowest).append(0),r.SPECTRUM=Ae.compose(w.Lowest).append(1),r.WAVEFORM=Ae.compose(w.Lowest).append(2)})(ac||(ac={}));var N1;(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,i=n=>{let o=t.get(n)??0,a=n;for(;t.has(a);)o++,a=`${n} ${o}`;return t.set(n,o),t.set(a,1),a};Object.keys(e).forEach(n=>{let o=e[n];o.fileName=i(r.sanitizeFileName(o.fileName))})}})(N1||(N1={}));var k1=yr.createBuilder({position:yr.float,playbackTimestamp:yr.float,countInBeatsRemaining:yr.float,isPlaying:yr.bool,isCountingIn:yr.bool,isRecording:yr.bool});var $1;(function(r){r.store=(e,t,i)=>{if(i==="")return F("MetaData.store: origin must be unique to your app.");let n=e.pointerHub.filter(u.MetaData).map(({box:a})=>a).find(a=>a instanceof Qn&&a.origin.getValue()===i),o=a=>{a.target.refer(e),a.origin.setValue(i),a.value.setValue(JSON.stringify(t))};Ca(n)?o(n):Qn.create(e.graph,w.generate(),o)},r.read=(e,t)=>{if(t==="")return F("MetaData.read: origin must be unique to your app.");let i=e.pointerHub.filter(u.MetaData).map(({box:n})=>n).find(n=>n instanceof Qn&&n.origin.getValue()===t);if(Ca(i)){let{status:n,value:o,error:a}=Un(()=>JSON.parse(i.value.getValue()));if(n==="success")return o;console.warn(a)}return null},r.clear=(e,t)=>{if(t==="")return F("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(u.MetaData).map(({box:i})=>i).filter(i=>i instanceof Qn&&i.origin.getValue()===t).forEach(i=>i.delete())}})($1||($1={}));var Vw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ya=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Wg,Zg,Gg,Ks,Bi=class{constructor(e,t){Wg.set(this,new U),Zg.set(this,void 0),Gg.set(this,void 0),Ks.set(this,void 0),Vw(this,Zg,e,"f"),Vw(this,Gg,t,"f"),Vw(this,Ks,new rt(128),"f"),ya(this,Wg,"f").own(ya(this,Zg,"f").broadcastIntegers(ya(this,Gg,"f"),new Int32Array(ya(this,Ks,"f").buffer),i=>{}))}noteOn(e){e>=0&&e<128&&ya(this,Ks,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&ya(this,Ks,"f").setBit(e,!1)}reset(){}clear(){ya(this,Ks,"f").clear()}terminate(){ya(this,Wg,"f").terminate()}toString(){return`{${this.constructor.name}}`}};Wg=new WeakMap,Zg=new WeakMap,Gg=new WeakMap,Ks=new WeakMap;var st;(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 i=r.readParam1(t)&127,n=r.readParam2(t)&127,o=i|n<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let i=r.readParam2(t);return i>64?.5+(i-63)/128:i<64?i/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,i,n)=>new Uint8Array([e.NoteOn|t,i,n]),r.noteOff=(t,i)=>new Uint8Array([e.NoteOff|t,i,0]),r.control=(t,i,n)=>new Uint8Array([e.Controller|t,i&127,n&127]),r.position=(t,i)=>new Uint8Array([e.Position,t&127,i&127]),r.positionInPPQN=t=>{let i=Math.floor(t/96),n=i&127,o=i>>7&127;return new Uint8Array([e.Position,n,o])},r.accept=(t,i)=>{Ia(t)||(r.isNoteOn(t)?_(i.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(i.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(i.pitchBend,r.asPitchBend(t)):r.isController(t)?_(i.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(i.clock):r.isStart(t)?_(i.start):r.isContinue(t)?_(i.continue):r.isStop(t)?_(i.stop):r.isPosition(t)&&_(i.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"})(st||(st={}));var xa;(function(r){r.on=(e,t,i)=>({type:"note-on",uuid:e,pitch:t,velocity:i}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let i=e.data;if(st.isNoteOn(i)){let n=st.readPitch(i),o=st.readVelocity(i);return{type:"note-on",uuid:t,pitch:n,velocity:o}}else if(st.isNoteOff(i)){let n=st.readPitch(i);return{type:"note-off",uuid:t,pitch:n}}return F("Unknown MIDI event")}})(xa||(xa={}));var M1;(function(r){r.start=(e,t,i,n=1)=>{let o=!0;return e(xa.on(t,i,n)),{terminate:()=>{o&&(e(xa.off(t,i)),o=!1)}}}})(M1||(M1={}));var NB,kB,$B,MB,DB;NB=new WeakMap,kB=new WeakMap,$B=new WeakMap,MB=new WeakMap,DB=new WeakMap;var IB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},qg=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ws,Hg=class{constructor(){Ws.set(this,void 0),IB(this,Ws,Ae.newSet(e=>e.field.address),"f")}register(e){return qg(this,Ws,"f").add(e),{terminate:()=>qg(this,Ws,"f").removeByValue(e)}}get(e){return qg(this,Ws,"f").get(e)}opt(e){return qg(this,Ws,"f").opt(e)}};Ws=new WeakMap;var wa={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})??F("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Jg;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Ln.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?Ln.err("Denominator must be a power of two between 1 and 32"):Ln.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?le(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:i=>{for(let[n,o]of R.iterateAdjacent(i.regions.pointerHub.incoming().map(({box:a})=>wa.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(n instanceof Co&&n.timeBase.getValue()===sr.Seconds)return!1;if(n.position.getValue()+n.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(Jg||(Jg={}));var D1;(function(r){r.parseTimeSignature=e=>{let[t,i]=e.split("/"),n=parseInt(t,10),o=parseInt(i,10);return Jg.isTimeSignatureValid(n,o)}})(D1||(D1={}));var Qg;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),c=new Float32Array(i*n),p=typeof document>"u",d=()=>{if(!a)return;let f=Atomics.load(s,1),v=Atomics.load(s,0);if(f===v){if(p)Atomics.wait(s,0,v);else{setTimeout(d,1);return}v=Atomics.load(s,0)}for(;f!==v;){let m=f*i*n;c.set(l.subarray(m,m+i*n));let y=[];for(let x=0;x<i;x++){let D=x*n,M=D+n;y.push(c.slice(D,M))}if(f=(f+1)%t,Atomics.store(s,1,f),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==i)return;for(let p of s)if(p.length!==n)return F("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),c=l*i*n;s.forEach((p,d)=>a.set(p,c+d*n)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(Qg||(Qg={}));var zw={isRegion:r=>wa.isRegionBox(r.box),isLoopableRegion:r=>wa.isLoopableRegionBox(r.box)};var Rn;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(Rn||(Rn={}));var CB,TB,RB,OB;CB=new WeakMap,TB=new WeakMap,RB=new WeakMap,OB=new WeakMap;var VB,zB,UB,jB;VB=new WeakMap,zB=new WeakMap,UB=new WeakMap,jB=new WeakMap;var sc={[St.Instrument]:0,[St.Aux]:1,[St.Bus]:2,[St.Output]:3};var Yg;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:i}},n,o,a)=>{let s=a??r.orderAndGetIndex(t,n);return console.debug(`createAudioUnit type: ${n}, insertIndex: ${s}`),it.create(e,w.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(i.input),l.index.setValue(s),l.type.setValue(n),o.ifSome(c=>l.capture.refer(c))})},r.orderAndGetIndex=(e,t)=>{let i=fl.collectIndexedBoxes(e.audioUnits,it),n=sc[t],o=0;for(;o<i.length&&!(sc[i[o].type.getValue()]>n);o++);let a=o;for(;o<i.length;)i[o].index.setValue(++o);return a},r.trackTypeToCapture=(e,t)=>{switch(t){case ie.Audio:return g.wrap(Ro.create(e,w.generate()));case ie.Notes:return g.wrap(Oo.create(e,w.generate()));default:return g.None}}})(Yg||(Yg={}));var I1;(function(r){r.create=(e,t,i,n,o)=>{console.debug(`createAudioBus '${t}', type: ${n}, color: ${o}`);let{boxGraph:a,mandatoryBoxes:{rootBox:s}}=e;I(s.isAttached(),"rootBox not attached");let l=w.generate(),c=Ci.create(a,l,d=>{d.collection.refer(s.audioBusses),d.label.setValue(t),d.icon.setValue(Me.toName(i)),d.color.setValue(o.toString())}),p=Yg.create(e,n,g.None);return lr.create(a,w.generate(),d=>{d.tracks.refer(p.tracks),d.target.refer(p),d.index.setValue(0),d.type.setValue(ie.Undefined)}),c.output.refer(p.input),c}})(I1||(I1={}));var C1;(function(r){r.forAudioType=e=>{switch(e){case St.Output:return ml.blue;case St.Aux:return ml.purple;case St.Bus:return ml.orange;case St.Instrument:return ml.green;default:return ml.dark}},r.forTrackType=e=>{switch(e){case ie.Audio:return 200;case ie.Notes:return 45;case ie.Value:return 156;default:return 0}}})(C1||(C1={}));var T1;(function(r){r.Tape={defaultName:"Tape",defaultIcon:Me.Tape,description:"Plays audio regions & clips",trackType:ie.Audio,create:(i,n,o,a,s)=>kl.create(i,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(n)})},r.Nano={defaultName:"Nano",defaultIcon:Me.NanoWave,description:"Simple sampler",trackType:ie.Notes,create:(i,n,o,a,s)=>{let l;if(Z(s))l=s;else{let c=w.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),p=5.34;l=i.findBox(c).unwrapOrElse(()=>Tr.create(i,c,d=>{d.fileName.setValue("Rhode"),d.endInSeconds.setValue(p)}))}return Fl.create(i,w.generate(),c=>{c.label.setValue(o),c.icon.setValue(Me.toName(a)),c.file.refer(l),c.host.refer(n)})}},r.Playfield={defaultName:"Playfield",defaultIcon:Me.Playfield,description:"Drum computer",trackType:ie.Notes,create:(i,n,o,a,s)=>{let l=Nl.create(i,w.generate(),c=>{c.label.setValue(o),c.icon.setValue(Me.toName(a)),c.host.refer(n)});return Z(s)&&s.filter(({note:c,uuid:p,name:d,durationInSeconds:f,exclude:v})=>{let m=e(i,p,d,f);Vo.create(i,w.generate(),y=>{y.device.refer(l.samples),y.file.refer(m),y.index.setValue(c),y.exclude.setValue(v)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Me.Piano,description:"Classic subtractive synthesizer",trackType:ie.Notes,create:(i,n,o,a,s)=>Sl.create(i,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.tune.setInitValue(0),l.cutoff.setInitValue(8e3),l.resonance.setInitValue(.1),l.attack.setInitValue(.005),l.decay.setInitValue(.1),l.sustain.setInitValue(.5),l.release.setInitValue(.5),l.voicingMode.setInitValue(dn.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(Le.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(Le.square),l.host.refer(n),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Me.Midi,description:"MIDI Output",trackType:ie.Notes,create:(i,n,o,a,s)=>El.create(i,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.host.refer(n)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:Me.SoundFont,description:"Soundfont Player",trackType:ie.Notes,create:(i,n,o,a,s)=>{s??(s={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=s.uuid,c=w.parse(l),p=t(i,c,s.name);return Bl.create(i,w.generate(),d=>{d.label.setValue(o),d.icon.setValue(Me.toName(a)),d.host.refer(n),d.file.refer(p)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(i,n,o,a)=>i.findBox(n).unwrapOrElse(()=>Tr.create(i,n,s=>{s.fileName.setValue(o),s.endInSeconds.setValue(a)})),t=(i,n,o)=>i.findBox(n).unwrapOrElse(()=>ei.create(i,n,a=>a.fileName.setValue(o)))})(T1||(T1={}));var ba;(function(r){r.empty=i=>{let n=new ja(g.wrap(La.create)),o=new Date().toISOString();console.debug(`New Project created on ${o}`),n.beginTransaction();let a=_l.create(n,w.generate(),f=>{f.label.setValue("Groove Shuffle")}),s=gl.create(n,w.generate(),f=>{f.groove.refer(a),f.created.setValue(o)}),l=Ci.create(n,w.generate(),f=>{f.collection.refer(s.audioBusses),f.label.setValue("Output"),f.icon.setValue(Me.toName(Me.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),c=it.create(n,w.generate(),f=>{f.type.setValue(St.Output),f.collection.refer(s.audioUnits),f.output.refer(s.outputDevice),f.index.setValue(0)});i.createOutputCompressor&&Pl.create(n,w.generate(),f=>{f.label.setValue("Compressor"),f.index.setValue(0),f.host.refer(c.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let p=Wa.create(n,w.generate());s.timeline.refer(p.root),l.output.refer(c.input);let d=[];if(i.createDefaultUser){let f=Ka.create(n,w.generate());f.root.refer(s.users),d.push(f)}return n.endTransaction(),{boxGraph:n,mandatoryBoxes:{rootBox:s,primaryAudioBus:l,primaryAudioOutputUnit:c,timelineBox:p,userInterfaceBoxes:d}}},r.encode=i=>{let n=$t.create();n.writeInt(1330660686),n.writeInt(2);let o=i.toArrayBuffer();return n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o)),n.toArrayBuffer()},r.decode=i=>{let n=new lt(i);I(n.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),I(n.readInt()===2,"Deprecated Format");let o=n.readInt(),a=new Int8Array(o);n.readBytes(a);let s=new ja(g.wrap(La.create));return s.fromArrayBuffer(a.buffer),{boxGraph:s,mandatoryBoxes:r.findMandatoryBoxes(s)}},r.findMandatoryBoxes=i=>{let n=i.boxes().find(o=>o.accept({visitRootBox:()=>!0}));if(Z(n)){let o=Ne(n.outputDevice.pointerHub.incoming().at(0)?.box,it),a=Ne(o.input.pointerHub.incoming().at(0)?.box,Ci),s=Ne(n.timeline.targetVertex.unwrap("TimelineBox not found").box,Wa),l=n.users.pointerHub.incoming().map(({box:c})=>Ne(c,Ka));return{rootBox:n,primaryAudioBus:a,primaryAudioOutputUnit:o,timelineBox:s,userInterfaceBoxes:l}}return F("Could not find mandatory boxes")}})(ba||(ba={}));var lc;(function(r){let e=({graph:s},{graph:l})=>s===l,t=(s,l)=>s.index.getValue()-l.index.getValue(),i=s=>s.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d={})=>{I(R.satisfy(s,e),"AudioUnits must share the same BoxGraph"),I(!d.includeAux&&!d.includeBus,"Options are not yet implemented");let f=d?.excludeTimeline===!0?i:Po.alwaysFalse,v=s.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==pn.ClassName&&y.name!==qa.ClassName),m=n(s,v,p.audioUnits.address.uuid,c.address.uuid);return o(m,l,s,v),a(m,s,p),console.debug("inTransaction",l.inTransaction()),s.map(y=>Ne(p.graph.findBox(m.get(y.address.uuid).target).unwrap("Target Track has not been copied"),it))},r.extractRegions=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d=0)=>{I(R.satisfy(s,e),"Region smust be from the same BoxGraph");let f=new Set(s),v=new Set,m=new il;s.forEach(V=>{let Y=Ne(V.regions.targetVertex.unwrap().box,lr);v.add(Y);let te=Ne(Y.tracks.targetVertex.unwrap().box,it);m.add(te,Y)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${v.size} tracks`);let y=[...m.keys()],x=V=>Ie(V,lr)&&!v.has(V)||wa.isRegionBox(V)&&!f.has(V),D=y.flatMap(V=>Array.from(V.graph.dependenciesOf(V,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(V=>V.name!==pn.ClassName&&V.name!==qa.ClassName),M=n(y,D,p.audioUnits.address.uuid,c.address.uuid);o(M,l,y,D),a(M,y,p),m.forEach((V,Y)=>[...Y].sort(t).forEach((te,q)=>{let ge=l.findBox(M.get(te.address.uuid).target).unwrap("Target Track has not been copied");Ne(ge,lr).index.setValue(q)}));let O=s.reduce((V,Y)=>Math.min(V,Y.position.getValue()),Number.MAX_VALUE),T=d-O;s.forEach(V=>{let Y=l.findBox(M.get(V.address.uuid).target).unwrap("Target Track has not been copied"),te=wa.asRegionBox(Y).position;te.setValue(te.getValue()+T)})};let n=(s,l,c,p)=>{let d=w.newSet(({source:f})=>f);return d.addMany([...s.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:p})),...s.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:c})),...s.map(f=>({source:f.address.uuid,target:w.generate()})),...l.map(({address:{uuid:f},name:v})=>({source:f,target:v===Tr.ClassName||v===ei.ClassName?f:w.generate()}))]),d},o=(s,l,c,p)=>{B.decodeWith({map:(d,f)=>f.map(v=>s.opt(v.uuid).match({none:()=>v,some:({target:m})=>v.moveTo(m)}))},()=>{c.forEach(d=>{let f=new lt(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;l.createBox(v,m,y=>y.read(f))}),p.forEach(d=>{let f=new lt(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;if((d instanceof Tr||d instanceof ei)&&l.findBox(d.address.uuid).nonEmpty()){d.read(f);return}l.createBox(v,m,y=>y.read(f))})})},a=(s,l,c)=>l.toSorted(t).map(p=>Ne(c.graph.findBox(s.get(p.address.uuid).target).unwrap("Target Track has not been copied"),it)).forEach(p=>fl.collectIndexedBoxes(c.audioUnits,it).toSorted((d,f)=>{let v=sc[d.type.getValue()],m=sc[f.type.getValue()],y=v-m;return y===0?f===p?-1:1:y}).forEach((d,f)=>d.index.setValue(f)))})(lc||(lc={}));var Aa;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(Aa||(Aa={}));var R1;(function(r){r.decode=(e,t)=>{let i=new lt(e.slice(0,8));if(i.readInt()!==Aa.MAGIC_HEADER_OPEN){al.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(i.readInt()!==Aa.FORMAT_VERSION){al.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let n=new ja(g.wrap(La.create));try{n.fromArrayBuffer(e.slice(8))}catch(a){al.info({headline:"Could Not Import Preset",message:String(a)}).then();return}let o=n.boxes().filter(a=>Ie(a,it)).filter(a=>a.type.getValue()!==St.Output);lc.extractAudioUnits(o,t,{excludeTimeline:!0}).filter(a=>a.type.getValue()!==St.Output).forEach(a=>{let s=a.input.pointerHub.incoming().at(0)?.box;Z(s)&&a.capture.targetVertex.ifSome(({box:l})=>{l instanceof Oo?lr.create(t.boxGraph,w.generate(),c=>{c.index.setValue(0),c.type.setValue(ie.Notes),c.target.refer(a),c.tracks.refer(a.tracks)}):l instanceof Ro&&lr.create(t.boxGraph,w.generate(),c=>{c.index.setValue(0),c.type.setValue(ie.Audio),c.target.refer(a),c.tracks.refer(a.tracks)})})})},r.replaceAudioUnit=(e,t,i)=>{console.debug("ReplaceAudioUnit with preset...");let n=ba.empty({createDefaultUser:!1,createOutputCompressor:!1}),o=n.boxGraph,a=t.graph;o.beginTransaction(),r.decode(e,n),o.endTransaction();let s=ee(n.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Ne(y,it)).find(y=>y.type.getValue()!==St.Output),"Source has no audioUnitBox"),l=s.capture.targetVertex.mapOr(({box:y})=>y.name,""),c=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(l!==c)return Ln.err("Cannot replace incompatible instruments");let p=i?.keepMIDIEffects!==!0,d=i?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",p),console.debug("replaceAudioEffects",d),ee(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),p?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction()),d?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction());let f=y=>y.accept({visitTrackBox:x=>!0,visitCaptureMidiBox:x=>!0,visitCaptureAudioBox:x=>!0})===!0,v=w.newSet(({source:y})=>y),m=Array.from(o.dependenciesOf(s,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);return v.addMany([{source:s.address.uuid,target:t.address.uuid},...m.map(({address:{uuid:y},name:x})=>({source:y,target:x===Tr.ClassName||x===ei.ClassName?y:w.generate()}))]),B.decodeWith({map:(y,x)=>x.map(D=>v.opt(D.uuid).match({none:()=>D,some:({target:M})=>D.moveTo(M)}))},()=>{m.forEach(y=>{let x=new lt(y.toArrayBuffer()),D=y.name,M=v.get(y.address.uuid).target;if((y instanceof Tr||y instanceof ei)&&a.findBox(y.address.uuid).nonEmpty()){y.read(x);return}a.createBox(D,M,O=>O.read(x))})}),Ln.Ok}})(R1||(R1={}));var O1;(function(r){r.encode=e=>{let t=$t.create();t.writeInt(Aa.MAGIC_HEADER_OPEN),t.writeInt(Aa.FORMAT_VERSION);let i=ba.empty({createOutputCompressor:!1,createDefaultUser:!1});return i.boxGraph.beginTransaction(),lc.extractAudioUnits([e],i,{excludeTimeline:!0}),i.boxGraph.endTransaction(),console.debug("SAVING..."),i.boxGraph.debugBoxes(),R.concatArrayBuffers(t.toArrayBuffer(),i.boxGraph.toArrayBuffer())}})(O1||(O1={}));var V1;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let i=ee(Ne(t,it).input.pointerHub.incoming().at(0)).box;return"label"in i&&i.label instanceof C?i.label.getValue():"N/A"})})(V1||(V1={}));var kt={};Da(kt,{$brand:()=>Xg,$input:()=>aA,$output:()=>oA,NEVER:()=>Uw,TimePrecision:()=>cA,ZodAny:()=>vE,ZodArray:()=>bE,ZodBase64:()=>N_,ZodBase64URL:()=>k_,ZodBigInt:()=>$h,ZodBigIntFormat:()=>D_,ZodBoolean:()=>kh,ZodCIDRv4:()=>B_,ZodCIDRv6:()=>F_,ZodCUID:()=>w_,ZodCUID2:()=>b_,ZodCatch:()=>zE,ZodCodec:()=>L_,ZodCustom:()=>sy,ZodCustomStringFormat:()=>Fh,ZodDate:()=>ny,ZodDefault:()=>IE,ZodDiscriminatedUnion:()=>AE,ZodE164:()=>$_,ZodEmail:()=>v_,ZodEmoji:()=>y_,ZodEnum:()=>Eh,ZodError:()=>xk,ZodFile:()=>$E,ZodFirstPartyTypeKind:()=>K_,ZodFunction:()=>HE,ZodGUID:()=>Xv,ZodIPv4:()=>S_,ZodIPv6:()=>E_,ZodISODate:()=>Hv,ZodISODateTime:()=>qv,ZodISODuration:()=>Qv,ZodISOTime:()=>Jv,ZodIntersection:()=>_E,ZodIssueCode:()=>D$,ZodJWT:()=>M_,ZodKSUID:()=>P_,ZodLazy:()=>ZE,ZodLiteral:()=>kE,ZodMAC:()=>cE,ZodMap:()=>FE,ZodNaN:()=>jE,ZodNanoID:()=>x_,ZodNever:()=>xE,ZodNonOptional:()=>U_,ZodNull:()=>mE,ZodNullable:()=>DE,ZodNumber:()=>Nh,ZodNumberFormat:()=>_c,ZodObject:()=>ay,ZodOptional:()=>z_,ZodPipe:()=>j_,ZodPrefault:()=>TE,ZodPromise:()=>qE,ZodReadonly:()=>LE,ZodRealError:()=>$r,ZodRecord:()=>R_,ZodSet:()=>NE,ZodString:()=>Bh,ZodStringFormat:()=>Je,ZodSuccess:()=>VE,ZodSymbol:()=>hE,ZodTemplateLiteral:()=>WE,ZodTransform:()=>ME,ZodTuple:()=>SE,ZodType:()=>Pe,ZodULID:()=>A_,ZodURL:()=>iy,ZodUUID:()=>bo,ZodUndefined:()=>fE,ZodUnion:()=>C_,ZodUnknown:()=>yE,ZodVoid:()=>wE,ZodXID:()=>__,_ZodString:()=>g_,_default:()=>CE,_function:()=>P$,any:()=>n$,array:()=>oy,base64:()=>Uk,base64url:()=>jk,bigint:()=>Xk,boolean:()=>pE,catch:()=>UE,check:()=>S$,cidrv4:()=>Vk,cidrv6:()=>zk,clone:()=>mr,codec:()=>b$,coerce:()=>W_,config:()=>bt,core:()=>wo,cuid:()=>$k,cuid2:()=>Mk,custom:()=>E$,date:()=>a$,decode:()=>s_,decodeAsync:()=>u_,describe:()=>B$,discriminatedUnion:()=>d$,e164:()=>Lk,email:()=>bk,emoji:()=>Nk,encode:()=>a_,encodeAsync:()=>l_,endsWith:()=>yh,enum:()=>O_,file:()=>v$,flattenError:()=>eh,float32:()=>Hk,float64:()=>Jk,formatError:()=>th,function:()=>P$,getErrorMap:()=>C$,globalRegistry:()=>gr,gt:()=>xo,gte:()=>kr,guid:()=>Ak,hash:()=>qk,hex:()=>Gk,hostname:()=>Zk,httpUrl:()=>Fk,includes:()=>gh,instanceof:()=>N$,int:()=>m_,int32:()=>Qk,int64:()=>e$,intersection:()=>PE,ipv4:()=>Tk,ipv6:()=>Ok,iso:()=>Yv,json:()=>$$,jwt:()=>Kk,keyof:()=>s$,ksuid:()=>Ck,lazy:()=>GE,length:()=>wc,literal:()=>g$,locales:()=>uh,looseObject:()=>c$,lowercase:()=>fh,lt:()=>yo,lte:()=>ki,mac:()=>Rk,map:()=>h$,maxLength:()=>xc,maxSize:()=>yc,meta:()=>F$,mime:()=>xh,minLength:()=>Na,minSize:()=>Js,multipleOf:()=>Hs,nan:()=>w$,nanoid:()=>kk,nativeEnum:()=>m$,negative:()=>VA,never:()=>I_,nonnegative:()=>UA,nonoptional:()=>OE,nonpositive:()=>zA,normalize:()=>wh,null:()=>gE,nullable:()=>ty,nullish:()=>y$,number:()=>dE,object:()=>l$,optional:()=>ey,overwrite:()=>On,parse:()=>r_,parseAsync:()=>i_,partialRecord:()=>p$,pipe:()=>ry,positive:()=>OA,prefault:()=>RE,preprocess:()=>M$,prettifyError:()=>Xw,promise:()=>_$,property:()=>jA,readonly:()=>KE,record:()=>BE,refine:()=>JE,regex:()=>hh,regexes:()=>Ni,registry:()=>Bv,safeDecode:()=>d_,safeDecodeAsync:()=>h_,safeEncode:()=>c_,safeEncodeAsync:()=>p_,safeParse:()=>n_,safeParseAsync:()=>o_,set:()=>f$,setErrorMap:()=>I$,size:()=>ph,slugify:()=>Ph,startsWith:()=>vh,strictObject:()=>u$,string:()=>f_,stringFormat:()=>Wk,stringbool:()=>k$,success:()=>x$,superRefine:()=>QE,symbol:()=>r$,templateLiteral:()=>A$,toJSONSchema:()=>QA,toLowerCase:()=>Ah,toUpperCase:()=>_h,transform:()=>V_,treeifyError:()=>Yw,trim:()=>bh,tuple:()=>EE,uint32:()=>Yk,uint64:()=>t$,ulid:()=>Dk,undefined:()=>i$,union:()=>T_,unknown:()=>Ac,uppercase:()=>mh,url:()=>Bk,util:()=>L,uuid:()=>_k,uuidv4:()=>Pk,uuidv6:()=>Sk,uuidv7:()=>Ek,void:()=>o$,xid:()=>Ik});var wo={};Da(wo,{$ZodAny:()=>F0,$ZodArray:()=>D0,$ZodAsyncError:()=>rn,$ZodBase64:()=>y0,$ZodBase64URL:()=>x0,$ZodBigInt:()=>bv,$ZodBigIntFormat:()=>P0,$ZodBoolean:()=>oh,$ZodCIDRv4:()=>m0,$ZodCIDRv6:()=>g0,$ZodCUID:()=>i0,$ZodCUID2:()=>n0,$ZodCatch:()=>J0,$ZodCheck:()=>He,$ZodCheckBigIntFormat:()=>Db,$ZodCheckEndsWith:()=>Wb,$ZodCheckGreaterThan:()=>fv,$ZodCheckIncludes:()=>Lb,$ZodCheckLengthEquals:()=>Vb,$ZodCheckLessThan:()=>hv,$ZodCheckLowerCase:()=>Ub,$ZodCheckMaxLength:()=>Rb,$ZodCheckMaxSize:()=>Ib,$ZodCheckMimeType:()=>Gb,$ZodCheckMinLength:()=>Ob,$ZodCheckMinSize:()=>Cb,$ZodCheckMultipleOf:()=>$b,$ZodCheckNumberFormat:()=>Mb,$ZodCheckOverwrite:()=>qb,$ZodCheckProperty:()=>Zb,$ZodCheckRegex:()=>zb,$ZodCheckSizeEquals:()=>Tb,$ZodCheckStartsWith:()=>Kb,$ZodCheckStringFormat:()=>gc,$ZodCheckUpperCase:()=>jb,$ZodCodec:()=>ah,$ZodCustom:()=>nA,$ZodCustomStringFormat:()=>A0,$ZodDate:()=>M0,$ZodDefault:()=>Z0,$ZodDiscriminatedUnion:()=>C0,$ZodE164:()=>w0,$ZodEmail:()=>Xb,$ZodEmoji:()=>t0,$ZodEncodeError:()=>_a,$ZodEnum:()=>z0,$ZodError:()=>Xp,$ZodFile:()=>j0,$ZodFunction:()=>tA,$ZodGUID:()=>Qb,$ZodIPv4:()=>p0,$ZodIPv6:()=>h0,$ZodISODate:()=>u0,$ZodISODateTime:()=>l0,$ZodISODuration:()=>d0,$ZodISOTime:()=>c0,$ZodIntersection:()=>T0,$ZodJWT:()=>b0,$ZodKSUID:()=>s0,$ZodLazy:()=>iA,$ZodLiteral:()=>U0,$ZodMAC:()=>f0,$ZodMap:()=>O0,$ZodNaN:()=>Q0,$ZodNanoID:()=>r0,$ZodNever:()=>k0,$ZodNonOptional:()=>q0,$ZodNull:()=>B0,$ZodNullable:()=>W0,$ZodNumber:()=>wv,$ZodNumberFormat:()=>_0,$ZodObject:()=>dS,$ZodObjectJIT:()=>I0,$ZodOptional:()=>K0,$ZodPipe:()=>Y0,$ZodPrefault:()=>G0,$ZodPromise:()=>rA,$ZodReadonly:()=>X0,$ZodRealError:()=>Nr,$ZodRecord:()=>R0,$ZodRegistry:()=>vc,$ZodSet:()=>V0,$ZodString:()=>qs,$ZodStringFormat:()=>We,$ZodSuccess:()=>H0,$ZodSymbol:()=>S0,$ZodTemplateLiteral:()=>eA,$ZodTransform:()=>L0,$ZodTuple:()=>_v,$ZodType:()=>he,$ZodULID:()=>o0,$ZodURL:()=>e0,$ZodUUID:()=>Yb,$ZodUndefined:()=>E0,$ZodUnion:()=>Av,$ZodUnknown:()=>N0,$ZodVoid:()=>$0,$ZodXID:()=>a0,$brand:()=>Xg,$constructor:()=>A,$input:()=>aA,$output:()=>oA,Doc:()=>nh,JSONSchema:()=>sE,JSONSchemaGenerator:()=>Sh,NEVER:()=>Uw,TimePrecision:()=>cA,_any:()=>$A,_array:()=>LA,_base64:()=>Kv,_base64url:()=>Wv,_bigint:()=>PA,_boolean:()=>AA,_catch:()=>pk,_check:()=>aE,_cidrv4:()=>jv,_cidrv6:()=>Lv,_coercedBigint:()=>SA,_coercedBoolean:()=>_A,_coercedDate:()=>TA,_coercedNumber:()=>gA,_coercedString:()=>lA,_cuid:()=>Cv,_cuid2:()=>Tv,_custom:()=>WA,_date:()=>CA,_decode:()=>ov,_decodeAsync:()=>sv,_default:()=>uk,_discriminatedUnion:()=>QN,_e164:()=>Zv,_email:()=>Fv,_emoji:()=>Dv,_encode:()=>nv,_encodeAsync:()=>av,_endsWith:()=>yh,_enum:()=>ik,_file:()=>KA,_float32:()=>yA,_float64:()=>xA,_gt:()=>xo,_gte:()=>kr,_guid:()=>ch,_includes:()=>gh,_int:()=>vA,_int32:()=>wA,_int64:()=>EA,_intersection:()=>YN,_ipv4:()=>zv,_ipv6:()=>Uv,_isoDate:()=>pA,_isoDateTime:()=>dA,_isoDuration:()=>fA,_isoTime:()=>hA,_jwt:()=>Gv,_ksuid:()=>Vv,_lazy:()=>gk,_length:()=>wc,_literal:()=>ok,_lowercase:()=>fh,_lt:()=>yo,_lte:()=>ki,_mac:()=>uA,_map:()=>tk,_max:()=>ki,_maxLength:()=>xc,_maxSize:()=>yc,_mime:()=>xh,_min:()=>kr,_minLength:()=>Na,_minSize:()=>Js,_multipleOf:()=>Hs,_nan:()=>RA,_nanoid:()=>Iv,_nativeEnum:()=>nk,_negative:()=>VA,_never:()=>DA,_nonnegative:()=>UA,_nonoptional:()=>ck,_nonpositive:()=>zA,_normalize:()=>wh,_null:()=>kA,_nullable:()=>lk,_number:()=>mA,_optional:()=>sk,_overwrite:()=>On,_parse:()=>pc,_parseAsync:()=>hc,_pipe:()=>hk,_positive:()=>OA,_promise:()=>vk,_property:()=>jA,_readonly:()=>fk,_record:()=>ek,_refine:()=>ZA,_regex:()=>hh,_safeDecode:()=>uv,_safeDecodeAsync:()=>dv,_safeEncode:()=>lv,_safeEncodeAsync:()=>cv,_safeParse:()=>fc,_safeParseAsync:()=>mc,_set:()=>rk,_size:()=>ph,_slugify:()=>Ph,_startsWith:()=>vh,_string:()=>sA,_stringFormat:()=>bc,_stringbool:()=>JA,_success:()=>dk,_superRefine:()=>GA,_symbol:()=>FA,_templateLiteral:()=>mk,_toLowerCase:()=>Ah,_toUpperCase:()=>_h,_transform:()=>ak,_trim:()=>bh,_tuple:()=>XN,_uint32:()=>bA,_uint64:()=>BA,_ulid:()=>Rv,_undefined:()=>NA,_union:()=>JN,_unknown:()=>MA,_uppercase:()=>mh,_url:()=>dh,_uuid:()=>Nv,_uuidv4:()=>kv,_uuidv6:()=>$v,_uuidv7:()=>Mv,_void:()=>IA,_xid:()=>Ov,clone:()=>mr,config:()=>bt,decode:()=>gF,decodeAsync:()=>yF,describe:()=>qA,encode:()=>mF,encodeAsync:()=>vF,flattenError:()=>eh,formatError:()=>th,globalConfig:()=>Zp,globalRegistry:()=>gr,isValidBase64:()=>v0,isValidBase64URL:()=>sS,isValidJWT:()=>lS,locales:()=>uh,meta:()=>HA,parse:()=>rv,parseAsync:()=>iv,prettifyError:()=>Xw,regexes:()=>Ni,registry:()=>Bv,safeDecode:()=>wF,safeDecodeAsync:()=>AF,safeEncode:()=>xF,safeEncodeAsync:()=>bF,safeParse:()=>eb,safeParseAsync:()=>tb,toDotPath:()=>K1,toJSONSchema:()=>QA,treeifyError:()=>Yw,util:()=>L,version:()=>Hb});var Uw=Object.freeze({status:"aborted"});function A(r,e,t){function i(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 c=a.prototype,p=Object.keys(c);for(let d=0;d<p.length;d++){let f=p[d];f in s||(s[f]=c[f].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let c=t?.Parent?new o:this;i(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let p of c._zod.deferred)p();return c}return Object.defineProperty(a,"init",{value:i}),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 Xg=Symbol("zod_brand"),rn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_a=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Zp={};function bt(r){return r&&Object.assign(Zp,r),Zp}var L={};Da(L,{BIGINT_FORMAT_RANGES:()=>Qw,Class:()=>Lw,NUMBER_FORMAT_RANGES:()=>Jw,aborted:()=>Fa,allowsEval:()=>Zw,assert:()=>GB,assertEqual:()=>LB,assertIs:()=>WB,assertNever:()=>ZB,assertNotEqual:()=>KB,assignProp:()=>Sa,base64ToUint8Array:()=>U1,base64urlToUint8Array:()=>cF,cached:()=>cc,captureStackTrace:()=>tv,cleanEnum:()=>uF,cleanRegex:()=>Hp,clone:()=>mr,cloneDef:()=>HB,createTransparentProxy:()=>tF,defineLazy:()=>$e,esc:()=>ev,escapeRegex:()=>Fi,extend:()=>nF,finalizeIssue:()=>Hr,floatSafeRemainder:()=>Kw,getElementAtPath:()=>JB,getEnumValues:()=>qp,getLengthableOrigin:()=>Yp,getParsedType:()=>eF,getSizableOrigin:()=>Qp,hexToUint8Array:()=>pF,isObject:()=>Zs,isPlainObject:()=>Ba,issue:()=>dc,joinValues:()=>k,jsonStringifyReplacer:()=>uc,merge:()=>aF,mergeDefs:()=>Ea,normalizeParams:()=>j,nullish:()=>Pa,numKeys:()=>XB,objectClone:()=>qB,omit:()=>iF,optionalKeys:()=>Hw,partial:()=>sF,pick:()=>rF,prefixIssues:()=>qr,primitiveTypes:()=>qw,promiseAllObject:()=>QB,propertyKeyTypes:()=>Jp,randomString:()=>YB,required:()=>lF,safeExtend:()=>oF,shallowClone:()=>Gw,slugify:()=>Ww,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>j1,uint8ArrayToBase64url:()=>dF,uint8ArrayToHex:()=>hF,unwrapMessage:()=>Gp});function LB(r){return r}function KB(r){return r}function WB(r){}function ZB(r){throw new Error}function GB(r){}function qp(r){let e=Object.values(r).filter(i=>typeof i=="number");return Object.entries(r).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function k(r,e="|"){return r.map(t=>z(t)).join(e)}function uc(r,e){return typeof e=="bigint"?e.toString():e}function cc(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Pa(r){return r==null}function Hp(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function Kw(r,e){let t=(r.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=t>n?t:n,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var z1=Symbol("evaluating");function $e(r,e,t){let i;Object.defineProperty(r,e,{get(){if(i!==z1)return i===void 0&&(i=z1,i=t()),i},set(n){Object.defineProperty(r,e,{value:n})},configurable:!0})}function qB(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Sa(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 i=Object.getOwnPropertyDescriptors(t);Object.assign(e,i)}return Object.defineProperties({},e)}function HB(r){return Ea(r._zod.def)}function JB(r,e){return e?e.reduce((t,i)=>t?.[i],r):r}function QB(r){let e=Object.keys(r),t=e.map(i=>r[i]);return Promise.all(t).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function YB(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let i=0;i<r;i++)t+=e[Math.floor(Math.random()*e.length)];return t}function ev(r){return JSON.stringify(r)}function Ww(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var tv="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Zs(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Zw=cc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function Ba(r){if(Zs(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Zs(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Gw(r){return Ba(r)?{...r}:Array.isArray(r)?[...r]:r}function XB(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var eF=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}`)}},Jp=new Set(["string","number","symbol"]),qw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Fi(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mr(r,e,t){let i=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(i._zod.parent=r),i}function j(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 tF(r){let e;return new Proxy({},{get(t,i,n){return e??(e=r()),Reflect.get(e,i,n)},set(t,i,n,o){return e??(e=r()),Reflect.set(e,i,n,o)},has(t,i){return e??(e=r()),Reflect.has(e,i)},deleteProperty(t,i){return e??(e=r()),Reflect.deleteProperty(e,i)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,i){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(t,i,n){return e??(e=r()),Reflect.defineProperty(e,i,n)}})}function z(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Hw(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Jw={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]},Qw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rF(r,e){let t=r._zod.def,i=Ea(r._zod.def,{get shape(){let n={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=t.shape[o])}return Sa(this,"shape",n),n},checks:[]});return mr(r,i)}function iF(r,e){let t=r._zod.def,i=Ea(r._zod.def,{get shape(){let n={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return Sa(this,"shape",n),n},checks:[]});return mr(r,i)}function nF(r,e){if(!Ba(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=Ea(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return Sa(this,"shape",o),o},checks:[]});return mr(r,n)}function oF(r,e){if(!Ba(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let i={...r._zod.def.shape,...e};return Sa(this,"shape",i),i},checks:r._zod.def.checks};return mr(r,t)}function aF(r,e){let t=Ea(r._zod.def,{get shape(){let i={...r._zod.def.shape,...e._zod.def.shape};return Sa(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return mr(r,t)}function sF(r,e,t){let i=Ea(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=r?new r({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=r?new r({type:"optional",innerType:n[a]}):n[a];return Sa(this,"shape",o),o},checks:[]});return mr(e,i)}function lF(r,e,t){let i=Ea(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};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:n[a]}))}else for(let a in n)o[a]=new r({type:"nonoptional",innerType:n[a]});return Sa(this,"shape",o),o},checks:[]});return mr(e,i)}function Fa(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 qr(r,e){return e.map(t=>{var i;return(i=t).path??(i.path=[]),t.path.unshift(r),t})}function Gp(r){return typeof r=="string"?r:r?.message}function Hr(r,e,t){let i={...r,path:r.path??[]};if(!r.message){let n=Gp(r.inst?._zod.def?.error?.(r))??Gp(e?.error?.(r))??Gp(t.customError?.(r))??Gp(t.localeError?.(r))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Qp(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Yp(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function dc(...r){let[e,t,i]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}function uF(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function U1(r){let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function j1(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function cF(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return U1(e+t)}function dF(r){return j1(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pF(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 i=0;i<e.length;i+=2)t[i/2]=Number.parseInt(e.slice(i,i+2),16);return t}function hF(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var Lw=class{constructor(...e){}};var L1=(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,uc,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Xp=A("$ZodError",L1),Nr=A("$ZodError",L1,{Parent:Error});function eh(r,e=t=>t.message){let t={},i=[];for(let n of r.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}function th(r,e=t=>t.message){let t={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({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 i(r),t}function Yw(r,e=t=>t.message){let t={errors:[]},i=(n,o=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>i({issues:c},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let c=[...o,...l.path];if(c.length===0){t.errors.push(e(l));continue}let p=t,d=0;for(;d<c.length;){let f=c[d],v=d===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),v&&p.errors.push(e(l)),d++}}};return i(r),t}function K1(r){let e=[],t=r.map(i=>typeof i=="object"?i.key:i);for(let i of t)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Xw(r){let e=[],t=[...r.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of t)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${K1(i.path)}`);return e.join(`
|
|
4
|
-
`)}var pc=r=>(e,t,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new rn;if(a.issues.length){let s=new(n?.Err??r)(a.issues.map(l=>Hr(l,o,bt())));throw tv(s,n?.callee),s}return a.value},rv=pc(Nr),hc=r=>async(e,t,i,n)=>{let o=i?Object.assign(i,{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(n?.Err??r)(a.issues.map(l=>Hr(l,o,bt())));throw tv(s,n?.callee),s}return a.value},iv=hc(Nr),fc=r=>(e,t,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new rn;return o.issues.length?{success:!1,error:new(r??Xp)(o.issues.map(a=>Hr(a,n,bt())))}:{success:!0,data:o.value}},eb=fc(Nr),mc=r=>async(e,t,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>Hr(a,n,bt())))}:{success:!0,data:o.value}},tb=mc(Nr),nv=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return pc(r)(e,t,n)},mF=nv(Nr),ov=r=>(e,t,i)=>pc(r)(e,t,i),gF=ov(Nr),av=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return hc(r)(e,t,n)},vF=av(Nr),sv=r=>async(e,t,i)=>hc(r)(e,t,i),yF=sv(Nr),lv=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return fc(r)(e,t,n)},xF=lv(Nr),uv=r=>(e,t,i)=>fc(r)(e,t,i),wF=uv(Nr),cv=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mc(r)(e,t,n)},bF=cv(Nr),dv=r=>async(e,t,i)=>mc(r)(e,t,i),AF=dv(Nr);var Ni={};Da(Ni,{base64:()=>vb,base64url:()=>pv,bigint:()=>_b,boolean:()=>Eb,browserEmail:()=>kF,cidrv4:()=>mb,cidrv6:()=>gb,cuid:()=>rb,cuid2:()=>ib,date:()=>xb,datetime:()=>bb,domain:()=>DF,duration:()=>lb,e164:()=>yb,email:()=>cb,emoji:()=>db,extendedDuration:()=>_F,guid:()=>ub,hex:()=>IF,hostname:()=>MF,html5Email:()=>BF,idnEmail:()=>NF,integer:()=>Pb,ipv4:()=>pb,ipv6:()=>hb,ksuid:()=>ab,lowercase:()=>Nb,mac:()=>fb,md5_base64:()=>TF,md5_base64url:()=>RF,md5_hex:()=>CF,nanoid:()=>sb,null:()=>Bb,number:()=>Sb,rfc5322Email:()=>FF,sha1_base64:()=>VF,sha1_base64url:()=>zF,sha1_hex:()=>OF,sha256_base64:()=>jF,sha256_base64url:()=>LF,sha256_hex:()=>UF,sha384_base64:()=>WF,sha384_base64url:()=>ZF,sha384_hex:()=>KF,sha512_base64:()=>qF,sha512_base64url:()=>HF,sha512_hex:()=>GF,string:()=>Ab,time:()=>wb,ulid:()=>nb,undefined:()=>Fb,unicodeEmail:()=>W1,uppercase:()=>kb,uuid:()=>Gs,uuid4:()=>PF,uuid6:()=>SF,uuid7:()=>EF,xid:()=>ob});var rb=/^[cC][^\s-]{8,}$/,ib=/^[0-9a-z]+$/,nb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ob=/^[0-9a-vA-V]{20}$/,ab=/^[A-Za-z0-9]{27}$/,sb=/^[a-zA-Z0-9_-]{21}$/,lb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_F=/^[-+]?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)?)??$/,ub=/^([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})$/,Gs=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)$/,PF=Gs(4),SF=Gs(6),EF=Gs(7),cb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BF=/^[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])?)*$/,FF=/^(([^<>()\[\]\\.,;:\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,}))$/,W1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,NF=W1,kF=/^[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="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function db(){return new RegExp($F,"u")}var pb=/^(?:(?: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])$/,hb=/^(([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}|:))$/,fb=r=>{let e=Fi(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},mb=/^((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])$/,gb=/^(([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])$/,vb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pv=/^[A-Za-z0-9_-]*$/,MF=/^(?=.{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])?)*\.?$/,DF=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,yb=/^\+(?:[0-9]){6,14}[0-9]$/,Z1="(?:(?:\\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])))",xb=new RegExp(`^${Z1}$`);function G1(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 wb(r){return new RegExp(`^${G1(r)}$`)}function bb(r){let e=G1({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${t.join("|")})`;return new RegExp(`^${Z1}T(?:${i})$`)}var Ab=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},_b=/^-?\d+n?$/,Pb=/^-?\d+$/,Sb=/^-?\d+(?:\.\d+)?/,Eb=/^(?:true|false)$/i,Bb=/^null$/i;var Fb=/^undefined$/i;var Nb=/^[^A-Z]*$/,kb=/^[^a-z]*$/,IF=/^[0-9a-fA-F]*$/;function rh(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function ih(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var CF=/^[0-9a-fA-F]{32}$/,TF=rh(22,"=="),RF=ih(22),OF=/^[0-9a-fA-F]{40}$/,VF=rh(27,"="),zF=ih(27),UF=/^[0-9a-fA-F]{64}$/,jF=rh(43,"="),LF=ih(43),KF=/^[0-9a-fA-F]{96}$/,WF=rh(64,""),ZF=ih(64),GF=/^[0-9a-fA-F]{128}$/,qF=rh(86,"=="),HF=ih(86);var He=A("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),H1={number:"number",bigint:"bigint",object:"date"},hv=A("$ZodCheckLessThan",(r,e)=>{He.init(r,e);let t=H1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:t,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),fv=A("$ZodCheckGreaterThan",(r,e)=>{He.init(r,e);let t=H1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),$b=A("$ZodCheckMultipleOf",(r,e)=>{He.init(r,e),r._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.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):Kw(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})}}),Mb=A("$ZodCheckNumberFormat",(r,e)=>{He.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),i=t?"int":"number",[n,o]=Jw[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,t&&(s.pattern=Pb)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:i,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:i,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:i,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:r})}}),Db=A("$ZodCheckBigIntFormat",(r,e)=>{He.init(r,e);let[t,i]=Qw[e.format];r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=t,o.maximum=i}),r._zod.check=n=>{let o=n.value;o<t&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:r})}}),Ib=A("$ZodCheckMaxSize",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Qp(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Cb=A("$ZodCheckMinSize",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Qp(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Tb=A("$ZodCheckSizeEquals",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),r._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:Qp(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),Rb=A("$ZodCheckMaxLength",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=Yp(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Ob=A("$ZodCheckMinLength",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=Yp(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Vb=A("$ZodCheckLengthEquals",(r,e)=>{var t;He.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!Pa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),r._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=Yp(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),gc=A("$ZodCheckStringFormat",(r,e)=>{var t,i;He.init(r,e),r._zod.onattach.push(n=>{let o=n._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=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(i=r._zod).check??(i.check=()=>{})}),zb=A("$ZodCheckRegex",(r,e)=>{gc.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})}}),Ub=A("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Nb),gc.init(r,e)}),jb=A("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=kb),gc.init(r,e)}),Lb=A("$ZodCheckIncludes",(r,e)=>{He.init(r,e);let t=Fi(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,r._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),r._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:r,continue:!e.abort})}}),Kb=A("$ZodCheckStartsWith",(r,e)=>{He.init(r,e);let t=new RegExp(`^${Fi(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:r,continue:!e.abort})}}),Wb=A("$ZodCheckEndsWith",(r,e)=>{He.init(r,e);let t=new RegExp(`.*${Fi(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:r,continue:!e.abort})}});function q1(r,e,t){r.issues.length&&e.issues.push(...qr(t,r.issues))}var Zb=A("$ZodCheckProperty",(r,e)=>{He.init(r,e),r._zod.check=t=>{let i=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>q1(n,t,e.property));q1(i,t,e.property)}}),Gb=A("$ZodCheckMimeType",(r,e)=>{He.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),r._zod.check=i=>{t.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:r,continue:!e.abort})}}),qb=A("$ZodCheckOverwrite",(r,e)=>{He.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var nh=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 i=e.split(`
|
|
5
|
-
`).filter(
|
|
6
|
-
`))}};var Hb={major:4,minor:1,patch:13};var he=A("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Hb;let i=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&i.unshift(r);for(let n of i)for(let o of n._zod.onattach)o(r);if(i.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let n=(a,s,l)=>{let c=Fa(a),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,v=d._zod.check(a);if(v instanceof Promise&&l?.async===!1)throw new rn;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(c||(c=Fa(a,f)))});else{if(a.issues.length===f)continue;c||(c=Fa(a,f))}}return p?p.then(()=>a):a},o=(a,s,l)=>{if(Fa(a))return a.aborted=!0,a;let c=n(s,i,l);if(c instanceof Promise){if(l.async===!1)throw new rn;return c.then(p=>r._zod.parse(p,l))}return r._zod.parse(c,l)};r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let c=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(p=>o(p,a,s)):o(c,a,s)}let l=r._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new rn;return l.then(c=>n(c,i,s))}return n(l,i,s)}}r["~standard"]={validate:n=>{try{let o=eb(r,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return tb(r,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),qs=A("$ZodString",(r,e)=>{he.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Ab(r._zod.bag),r._zod.parse=(t,i)=>{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}}),We=A("$ZodStringFormat",(r,e)=>{gc.init(r,e),qs.init(r,e)}),Qb=A("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=ub),We.init(r,e)}),Yb=A("$ZodUUID",(r,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Gs(i))}else e.pattern??(e.pattern=Gs());We.init(r,e)}),Xb=A("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=cb),We.init(r,e)}),e0=A("$ZodURL",(r,e)=>{We.init(r,e),r._zod.check=t=>{try{let i=t.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.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(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.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=n.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),t0=A("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=db()),We.init(r,e)}),r0=A("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=sb),We.init(r,e)}),i0=A("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=rb),We.init(r,e)}),n0=A("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=ib),We.init(r,e)}),o0=A("$ZodULID",(r,e)=>{e.pattern??(e.pattern=nb),We.init(r,e)}),a0=A("$ZodXID",(r,e)=>{e.pattern??(e.pattern=ob),We.init(r,e)}),s0=A("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=ab),We.init(r,e)}),l0=A("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=bb(e)),We.init(r,e)}),u0=A("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=xb),We.init(r,e)}),c0=A("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=wb(e)),We.init(r,e)}),d0=A("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=lb),We.init(r,e)}),p0=A("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=pb),We.init(r,e),r._zod.bag.format="ipv4"}),h0=A("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=hb),We.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})}}}),f0=A("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=fb(e.delimiter)),We.init(r,e),r._zod.bag.format="mac"}),m0=A("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=mb),We.init(r,e)}),g0=A("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=gb),We.init(r,e),r._zod.check=t=>{let i=t.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;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://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function v0(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var y0=A("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=vb),We.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{v0(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function sS(r){if(!pv.test(r))return!1;let e=r.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return v0(t)}var x0=A("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=pv),We.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{sS(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),w0=A("$ZodE164",(r,e)=>{e.pattern??(e.pattern=yb),We.init(r,e)});function lS(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[i]=t;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var b0=A("$ZodJWT",(r,e)=>{We.init(r,e),r._zod.check=t=>{lS(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),A0=A("$ZodCustomStringFormat",(r,e)=>{We.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})}}),wv=A("$ZodNumber",(r,e)=>{he.init(r,e),r._zod.pattern=r._zod.bag.pattern??Sb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:r,...o?{received:o}:{}}),t}}),_0=A("$ZodNumberFormat",(r,e)=>{Mb.init(r,e),wv.init(r,e)}),oh=A("$ZodBoolean",(r,e)=>{he.init(r,e),r._zod.pattern=Eb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:r}),t}}),bv=A("$ZodBigInt",(r,e)=>{he.init(r,e),r._zod.pattern=_b,r._zod.parse=(t,i)=>{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}}),P0=A("$ZodBigIntFormat",(r,e)=>{Db.init(r,e),bv.init(r,e)}),S0=A("$ZodSymbol",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:r}),t}}),E0=A("$ZodUndefined",(r,e)=>{he.init(r,e),r._zod.pattern=Fb,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:r}),t}}),B0=A("$ZodNull",(r,e)=>{he.init(r,e),r._zod.pattern=Bb,r._zod.values=new Set([null]),r._zod.parse=(t,i)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:r}),t}}),F0=A("$ZodAny",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),N0=A("$ZodUnknown",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),k0=A("$ZodNever",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),$0=A("$ZodVoid",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:r}),t}}),M0=A("$ZodDate",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:r}),t}});function Q1(r,e,t){r.issues.length&&e.issues.push(...qr(t,r.issues)),e.value[t]=r.value}var D0=A("$ZodArray",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:r}),t;t.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],l=e.element._zod.run({value:s,issues:[]},i);l instanceof Promise?o.push(l.then(c=>Q1(c,t,a))):Q1(l,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function xv(r,e,t,i){r.issues.length&&e.issues.push(...qr(t,r.issues)),r.value===void 0?t in i&&(e.value[t]=void 0):e.value[t]=r.value}function uS(r){let e=Object.keys(r.shape);for(let i of e)if(!r.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let t=Hw(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function cS(r,e,t,i,n,o){let a=[],s=n.keySet,l=n.catchall._zod,c=l.def.type;for(let p in e){if(s.has(p))continue;if(c==="never"){a.push(p);continue}let d=l.run({value:e[p],issues:[]},i);d instanceof Promise?r.push(d.then(f=>xv(f,t,p,e))):xv(d,t,p,e)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var dS=A("$ZodObject",(r,e)=>{if(he.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 i=cc(()=>uS(e));$e(r._zod,"propValues",()=>{let s=e.shape,l={};for(let c in s){let p=s[c]._zod;if(p.values){l[c]??(l[c]=new Set);for(let d of p.values)l[c].add(d)}}return l});let n=Zs,o=e.catchall,a;r._zod.parse=(s,l)=>{a??(a=i.value);let c=s.value;if(!n(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:r}),s;s.value={};let p=[],d=a.shape;for(let f of a.keys){let m=d[f]._zod.run({value:c[f],issues:[]},l);m instanceof Promise?p.push(m.then(y=>xv(y,s,f,c))):xv(m,s,f,c)}return o?cS(p,c,s,l,i.value,r):p.length?Promise.all(p).then(()=>s):s}}),I0=A("$ZodObjectJIT",(r,e)=>{dS.init(r,e);let t=r._zod.parse,i=cc(()=>uS(e)),n=f=>{let v=new nh(["shape","payload","ctx"]),m=i.value,y=O=>{let T=ev(O);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};v.write("const input = payload.value;");let x=Object.create(null),D=0;for(let O of m.keys)x[O]=`key_${D++}`;v.write("const newResult = {};");for(let O of m.keys){let T=x[O],V=ev(O);v.write(`const ${T} = ${y(O)};`),v.write(`
|
|
7
|
-
if (${
|
|
8
|
-
payload.issues = payload.issues.concat(${
|
|
1
|
+
var DN=Object.defineProperty;var qo=(r,e)=>{for(var t in e)DN(r,t,{get:e[t],enumerable:!0})};var hl=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#o;#n;#s;#a;#l=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new hf(this.#e),this.#i=new Float32Array(this.#e),this.#o=new Float32Array(this.#e),this.#n=ad.create(ad.Type.Blackman,this.#e),this.#t=e,this.#s=new Float32Array(e),this.#a=new Float32Array(e)}clear(){this.#s.fill(0),this.#i.fill(0),this.#a.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#s}waveform(){return this.#a}process(e,t,o,i){for(let n=o;n<i;++n)this.#i[this.#l]=e[n]+t[n],++this.#l===this.#e&&this.#u()}#u(){for(let t=0;t<this.#t;++t)this.#a[t]=this.#i[t<<1];for(let t=0;t<this.#e;++t)this.#i[t]*=this.#n[t];this.#r.process(this.#i,this.#o);let e=1/this.#t;for(let t=0;t<this.#t;++t){let o=this.#i[t],i=this.#o[t],n=Math.sqrt(o*o+i*i)*e;this.#s[t]<n?this.#s[t]=n:this.decay&&(this.#s[t]*=r.DECAY)}this.#l=0,this.#o.fill(0),this.decay=!1}};var ld=r=>r,Z=r=>r!=null,Us=r=>r===null,Pt=r=>r!==null,fl=r=>r===void 0,js=r=>r!==void 0,ff=r=>r==null,vb=(r,e)=>r!=null?e(r):void 0,re=(r,e="asDefined failed")=>r??F(ao(e)),Ce=(r,e)=>r instanceof e,Ie=(r,e)=>r instanceof e?r:F(`${r} is not instance of ${e}`),yb=(r,e)=>{r instanceof e||F(`${r} is not instance of ${e}`)};var ao=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),mf=r=>Z(r)&&typeof r=="object";var gf=r=>{throw new Error(`Unhandled ${r}`)},F=r=>{throw typeof r=="string"?new Error(r):r},D=(r,e)=>r?void 0:F(ao(e));var Ls=r=>new Proxy({},{get(){return F(r)}});var mb=class{value;status="success";constructor(e){this.value=e}error=Ls("Cannot access error when succeeded")},gb=class{error;status="failure";constructor(e){this.error=e}value=Ls("Cannot access value when failed")},Ho=r=>{try{return new mb(r())}catch(e){return new gb(e)}};var ri=(r,e)=>Object.keys(e).length===0?F("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:F(`Invalid enum value: ${String(r)}`),Jo=()=>{};var xb;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(xb||(xb={}));var C=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 o=0;o<e.length;)t(e[o])?e.splice(o,1):o++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>re(e.at(0),t);static getLast=(e,t)=>re(e.at(-1),t);static getPrev=(e,t)=>{let o=e.indexOf(t);return o===-1?F(`${t} not found in ${e}`):re(e.at((o-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let o=e.indexOf(t);return o===-1?F(`${t} not found in ${e}`):re(e.at((o+1)%e.length),"Internal Error")};static removeLast=(e,t)=>re(e.pop(),t);static create=(e,t)=>{let o=new Array(t);for(let i=0;i<t;i++)o[i]=e(i);return o};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let o=e[0];for(let i=1;i<e.length;i++)if(!t(o,e[i]))return!1;return!0};static remove=(e,t)=>{let o=e.indexOf(t);if(o===-1)return F(`${t} not found in ${e}`);e.splice(o,1)};static removeIf=(e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o])&&e.splice(o,1)};static removeOpt=(e,t)=>{let o=e.indexOf(t);return o===-1?!1:(e.splice(o,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,o=new Set;for(let i of e)o.has(i)||(o.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let o=0,i=new Set;for(let n of e){let s=n[t];i.has(s)||(i.add(s),e[o++]=n)}return e.length=o,e};static subtract(e,t,o){return e.filter(i=>!t.some(n=>o(i,n)))}static intersect(e,t,o){return e.filter(i=>t.some(n=>o(i,n)))}static merge(e,t,o){return[...e.filter(i=>!t.some(n=>o(i,n))),...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 o=0;o<=t;o++)yield{value:e[o],isFirst:o===0,isLast:o===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,o=e[0];t<e.length;t++){let i=e[t];yield[o,i],o=i}}static isSorted(e,t=xb.Ascending){if(e.length<2)return!0;let o=e[0];for(let i=1;i<e.length;i++){let n=e[i];if(Math.sign(o-n)===t)return!1;o=n}return!0}static toRecord(e,t){return e.reduce((o,i)=>(o[t(i)]=i,o),{})}static concatArrayBuffers(e,t){let o=new ArrayBuffer(e.byteLength+t.byteLength),i=new Uint8Array(o);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),o}};var m;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...o)=>r.wrap(t?.apply(null,o)),r.async=t=>t.then(o=>r.wrap(o),()=>r.None);class e{#e;constructor(o){this.#e=re(o)}unwrap(){return this.#e}unwrapOrElse(o){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(o){return o===this.#e}match(o){return o.some(this.#e)}ifSome(o){return o(this.#e)}ifAbsent(o){}isEmpty(){return!1}nonEmpty(){return!0}map(o){return r.wrap(o(this.#e))}mapOr(o,i){return o(this.#e)}flatMap(o){return o(this.#e)}equals(o){return this.unwrapOrNull()===o.unwrapOrNull()}assert(o){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>F(Z(t)?ao(t):"unwrap failed");unwrapOrElse=t=>ao(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,o)=>ao(o);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>F(ao(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var lo;(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(o){return r.err(o)}};mapOr=(t,o)=>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=()=>F(`'${this.reason}'`);map=()=>this;mapOr=(t,o)=>ao(o);unwrapOrElse=t=>ao(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)})(lo||(lo={}));var et;(function(r){r.exact=(e,t,o)=>{let i=0,n=e.length-1;for(;i<=n;){let s=i+n>>>1,a=o(e[s],t);if(a===0)return s;a<0?i=s+1:n=s-1}return-1},r.exactMapped=(e,t,o,i)=>{let n=0,s=e.length-1;for(;n<=s;){let a=n+s>>>1,l=o(i(e[a]),t);if(l===0)return a;l<0?n=a+1:s=a-1}return-1},r.leftMost=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<0?i=s+1:n=s}return i},r.rightMost=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<=0?i=s+1:n=s}return n-1},r.stableInsert=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<0?i=s+1:n=s}for(;i<e.length&&o(e[i],t)===0;)i++;return i},r.leftMostMapped=(e,t,o,i)=>{let n=0,s=e.length;for(;n<s;){let a=n+s>>>1;o(i(e[a]),t)<0?n=a+1:s=a}return n},r.rightMostMapped=(e,t,o,i)=>{let n=0,s=e.length;for(;n<s;){let a=n+s>>>1;o(i(e[a]),t)<=0?n=a+1:s=a}return s-1},r.rangeMapped=(e,t,o,i)=>[r.leftMostMapped(e,t,o,i),r.rightMostMapped(e,t,o,i)]})(et||(et={}));var nt=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,o=1<<e-(t<<5);return(this.#t[t]&o)!==0}setBit(e,t){let o=e>>>5,i=1<<e-(o<<5),n=this.#t[o],s=t?n|i:n&~i;return s===n?!1:(this.#t[o]=s,!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),o=!1;for(let i=0;i<t.length;i++)this.#t[i]!==t[i]&&(this.#t[i]=t[i],o=!0);return o}toString(){let e="";for(let t of C.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var vf=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 St=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(o=>!isNaN(o))){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,o){let i=l=>(l+e/30)%12,n=t*Math.min(o,1-o),s=l=>o-n*Math.max(-1,Math.min(i(l)-3,Math.min(9-i(l),1))),a=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${a(s(0))}${a(s(8))}${a(s(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,o=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255,s=Math.max(o,i,n),a=Math.min(o,i,n),l=(s+a)/2,c=0,d=0;if(s!==a){let p=s-a;switch(d=l>.5?p/(2-s-a):p/(s+a),s){case o:c=((i-n)/p+(i<n?6:0))*60;break;case i:c=((n-o)/p+2)*60;break;case n:c=((o-i)/p+4)*60;break}}return{h:c,s:d,l}}static hslStringToHex(e){let[t,o,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,o/100,i/100)}#e;#t;#r;#i;constructor(e,t,o,i=1){this.#e=e,this.#t=t,this.#r=o,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)),o=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,o,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var ud=(r,e)=>r-e;var Ci=Math.PI*2,MD=Math.PI/2,bb=Math.PI/4,CD=1/Math.sqrt(2),ue=(r,e,t)=>Math.max(e,Math.min(r,t)),ii=r=>Math.max(0,Math.min(r,1)),sS=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Qo=(r,e)=>Math.floor(r/e)*e;var yf=(r,e,t)=>r+(e-r)*t,aS=(r,e,t)=>r*Math.pow(e/r,t);var cd=(r,e)=>MN(r/e)*e,MN=r=>r-Math.floor(r),Fn=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var wb=(r,e)=>r*e/((2*e-1)*(r-1)+e);var oi;(function(r){r.valueAt=({slope:i,steps:n,y0:s,y1:a},l)=>r.normalizedAt(l/n,i)*(a-s)+s,r.normalizedAt=(i,n)=>{if(n>.499999&&n<.500001)return i;{let s=ue(n,1e-15,.999999999999999);return s*s/(1-s*2)*(Math.pow((1-s)/s,2*i)-1)}},r.inverseAt=(i,n)=>{let s=ue(n,1e-15,.999999999999999);return Math.log(i*(1-2*s)/(s*s)+1)/(2*Math.log((1-s)/s))},r.coefficients=i=>{let n=r.valueAt(i,1),a=(r.valueAt(i,2)-n)/(n-i.y0),l=n-a*i.y0;return{m:a,q:l}};function*t(i,n,s,a){let{m:l,q:c}=r.coefficients({slope:i,steps:n,y0:s,y1:a});for(let d=0,p=s;d<n;d++)yield p=l*p+c}r.walk=t;function*o(i,n){let s=1/n,a=r.normalizedAt(s,i),c=(r.normalizedAt(2*s,i)-a)/a;for(let d=0,p=0;d<n;d++)yield p=c*p+a}r.walkNormalized=o,r.byHalf=(i,n,s,a)=>({slope:r.slopeByHalf(n,s,a),steps:i,y0:n,y1:a}),r.slopeByHalf=(i,n,s)=>Math.abs(s-i)<1e-6?.5:(n-i)/(s-i)})(oi||(oi={}));var uo=new DataView(new ArrayBuffer(8)),lr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(uo.setInt8(0,e),uo.getInt8(0)),r.toShort=e=>(uo.setInt16(0,e),uo.getInt16(0)),r.toInt=e=>(uo.setInt32(0,e),uo.getInt32(0))})(lr||(lr={}));var Xo;(function(r){let o=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(o),n=new Int32Array(o);r.floatToIntBits=s=>{let a=r.floatToRawIntBits(s);return(a&2139095040)===2139095040&&a&8388607?2143289344:a},r.intBitsToFloat=s=>(n[0]=s,i[0]),r.floatToRawIntBits=s=>(i[0]=s,n[0]),r.toFloat32=s=>(uo.setFloat32(0,s),uo.getFloat32(0))})(Xo||(Xo={}));var lS;(function(r){r.floatToIntBits=e=>{let t=Xo.floatToIntBits(e),o=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?o|31744:o|31744|(t&8388607)>>>13:o|31743:i>=947912704?o|i-939524096>>>13:i<855638016?o:(i=(t&2147483647)>>>23,o|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,o=e&31744;if(o===31744)o=261120;else if(o!==0){if(o+=114688,t===0&&o>115712)return Xo.intBitsToFloat((e&32768)<<16|o<<13|1023)}else if(t!==0){o=115712;do t<<=1,o-=1024;while(!(t&1024));t&=1023}return Xo.intBitsToFloat((e&32768)<<16|(o|t)<<13)}})(lS||(lS={}));var xf;(function(r){let e=9218868437227405312n,t=4503599627370495n,o=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(o),n=new BigInt64Array(o);r.float64ToLongBits=s=>{let a=r.float64ToRawLongBits(s);return(a&e)===e&&(a&t)!==0n?0x7ff8000000000000n:a},r.longBitsToFloat64=s=>(n[0]=s,i[0]),r.float64ToRawLongBits=s=>(i[0]=s,n[0]),r.clamp=s=>(uo.setFloat64(0,s),uo.getFloat64(0))})(xf||(xf={}));var tt=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let o of e)t++;return t}static some(e,t){for(let o of e)if(t(o))return!0;return!1}static every(e,t){for(let o of e)if(!t(o))return!1;return!0}static reduce(e,t,o){let i=o,n=0;for(let s of e)i=t(i,s,n++);return i}static includes(e,t){for(let o of e)if(o===t)return!0;return!1}static forEach(e,t){for(let o of e)t(o)}static*map(e,t){let o=0;for(let i of e)yield t(i,o++)}static*take(e,t){let o=0;for(let i of e){if(o++>=t)return;yield i}}static filter(e,t){let o=[];for(let i of e)t(i)&&o.push(i);return o}static filterMap(e,t){let o=[];for(let i of e){let n=t(i);Z(n)&&o.push(n)}return o}static reverse(e){let t=[];for(let o of e)t.push(o);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:o,value:i}=t.next(),n=i;if(o!==!0)for(;;){let{done:s,value:a}=t.next();if(s===!0){yield[n,null];return}yield[n,a],n=a}}};var Mt=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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 o=0;o<t;o++)this.writeShort(e.charCodeAt(o))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let o=this.#e;this.#e=new DataView(new ArrayBuffer(Fn(t+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,o.getInt8(i))}}},ml=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}},bf=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,o)=>e.#e[o]===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(xf.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(tt.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},ct=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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 o=0;o<e;o++)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 CN=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":F(`Cannot resolve method key of ${r}`):F("Cannot resolve method key of undefined descriptor"),gl=(r,e,t)=>{if(!Z(t))return function(n,s){if(s&&s.kind==="getter")return function(){let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!Z(a?.get))return F(`Cannot find getter for property '${e}'`);let l=a.get.apply(this);return Object.defineProperty(this,e,{value:l,configurable:!1,writable:!1,enumerable:!1}),l}};let o=CN(t),i=re(t[o]);return{[o]:function(...n){if(n.length>0)return F("lazy accessory must not have any construction parameters");let s=i.apply(this);return Object.defineProperty(this,e,{value:o==="get"?s:()=>s,configurable:!1,writable:!1,enumerable:!1}),s}}};var Yo;(function(r){function*e(){}r.empty=e,r.next=o=>{let{value:i,done:n}=o.next();return n?null:i};function*t(...o){for(let i of o)for(let n of i)yield n}r.flatten=t})(Yo||(Yo={}));var dd;(function(r){r.intersect1D=(e,t,o,i)=>Math.max(e,o)<=Math.min(t,i)})(dd||(dd={}));var Ct=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...o)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?_(i[t],...o):i[t]?.apply(i,o))})}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 uS=(r,...e)=>new Proxy([],{get(t,o){if(typeof o=="string"){let i=Number(o);if(!isNaN(i)&&i>=0&&Number.isInteger(i))return new r(...e)}return o===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[o]},has(t,o){if(typeof o=="string"){let i=Number(o);if(!isNaN(i)&&i>=0)return!0}return o in t}});var Ks=class{static createIfAbsent(e,t,o){let i=e.get(t);return i===void 0&&(i=o(t),e.set(t,i)),i}};var pd=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var wf=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=m.wrap(t),this.#t.ifSome(o=>Array.from(this.#e.values()).forEach(i=>i.sort(o)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return tt.some(this.#e.entries(),o=>e===o[0]&&o[1].includes(t))}containsKey(e){return tt.includes(this.#e.keys(),e)}containsValue(e){return tt.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??C.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let o=Ks.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())o.push(t);else{let i=et.stableInsert(o,t,this.#t.unwrap());o.splice(i,0,t)}}addAll(e,t){let o=Ks.createIfAbsent(this.#e,e,()=>[]);o.push(...t),this.#t.nonEmpty()&&o.sort(this.#t.unwrap())}remove(e,t){let o=this.#e.get(e);if(o===void 0)return!1;{let i=o.indexOf(t);return i===-1?!1:(o.splice(i,1),o.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let o=this.#e.get(e);if(o===void 0)return null;{let i=o.findIndex(t);if(i===-1)return null;{let n=o.splice(i,1)[0];return o.length===0&&this.#e.delete(e),n}}}removeValueIf(e){let t=[];for(let[o,i]of this.#e.entries())for(let n of i.filter(s=>e(s)))t.push([o,n]);for(let[o,i]of t)this.remove(o,i);return new Set(t.map(([,o])=>o))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??C.empty()}forEach(e){tt.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(),o=Array.from(this.keys()).sort(e);this.#e.clear();for(let i of o)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#e.forEach((t,o)=>{e.#e.set(o,t.map(i=>i))}),e}},vl=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let o=t[0],i=t[1];return[o,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return tt.some(this.map.entries(),o=>e===o[0]&&o[1].has(t))}containsKey(e){return tt.includes(this.map.keys(),e)}containsValue(e){return tt.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??pd.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Ks.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let o=Ks.createIfAbsent(this.map,e,()=>new Set);for(let i of t)o.add(i)}remove(e,t){let o=this.map.get(e);return o===void 0?!1:o.delete(t)?(o.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[o,i]of this.map.entries()){for(let n of i)e(n)&&(i.delete(n),t.add(n));i.size===0&&this.map.delete(o)}return t}removeFromKeyIf(e,t){let o=this.map.get(e);if(o===void 0)return null;for(let i of o)if(t(i))return o.delete(i),o.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??pd.empty()}forEach(e){tt.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(),o=Array.from(this.keys()).sort(e);this.map.clear();for(let i of o)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,o)=>{e.map.set(o,new Set(Array.from(t)))}),e}};var W=Object.freeze({Empty:{terminate:Jo},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),O=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:()=>C.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var ie=class{static subscribeMany(e,...t){return W.many(...t.map(o=>o.subscribe(()=>e(o))))}#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 zr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,o)=>{let i=new Set(Object.keys(t));for(let n of Object.keys(o))if(i.has(n))return F(`'${n}' is an overlapping key`);return{...t,...o}},r.include=(t,...o)=>{let i={};for(let n of o)i[n]=t[n];return i},r.exclude=(t,...o)=>{let i=new Set(o);return Object.entries(t).reduce((n,[s,a])=>(i.has(s)||(n[s]=a),n),{})},r.overwrite=(t,o)=>Object.assign(t,o)})(zr||(zr={}));var cS;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return W.Empty}catchupAndSubscribe(t){return t(this),W.Empty}}})(cS||(cS={}));var dS;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return W.Empty}catchupAndSubscribe(e){return e(this),W.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)}}})(dS||(dS={}));var ni=class{#e;#t=m.None;constructor(e){this.#e=new ie,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()||(Z(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 Ur=class{#e;#t=m.None;#r;constructor(e,t){this.#e=new ie,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 Ab=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+ue(e,0,1)*this.#r}clamp(e){return ue(e,this.#e,this.#t)}floating(){return!0}},_b=class{#e;#t;#r;constructor(e,t){this.#e=ue(Math.round(e),lr.MIN_VALUE,lr.MAX_VALUE),this.#t=ue(Math.round(t),lr.MIN_VALUE,lr.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(ue(e,0,1)*this.#r)}clamp(e){return ue(Math.round(e),this.#e,this.#t)}floating(){return!1}},Pb=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(ue(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(ue(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Sb=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(o=>o===e);return t===-1?F(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(ue(e,0,1)*(this.#e.length-1));return t>-1?re(this.#e.at(t),`Could not find value for ${e}`):F(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Eb=class{#e;#t;#r;#i;#o;constructor(e,t,o){this.#e=e,this.#t=o;let i=e*e,n=o*o,s=t*t,a=e+o-2*t,l=o-t;this.#r=((2*o-t)*e-t*o)/a,this.#i=(l*i+(s-n)*e+t*n-s*o)/(i+(2*o-4*t)*e+n-4*t*o+4*s),this.#o=-l/a}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#o)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#o}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},S;(function(r){r.linear=(n,s)=>new Ab(n,s),r.linearInteger=(n,s)=>new _b(n,s),r.exponential=(n,s)=>new Pb(n,s),r.values=n=>new Sb(n),r.decibel=(n,s,a)=>new Eb(n,s,a);let e=new class{x(n){return n?1:0}y(n){return n>=.5}clamp(n){return n}floating(){return!1}},t=r.linear(0,1),o=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>o,r.DefaultDecibel=i})(S||(S={}));var P;(function(r){r.percent=({bipolar:n,fractionDigits:s}={})=>new e("%",s,!1,n),r.numeric=({unit:n,fractionDigits:s,unitPrefix:a,bipolar:l}={})=>new e(n,s,a,l),r.indices=(n,s)=>new class{x(a){return{unit:n,value:s[a]}}y(a){let l=s.indexOf(a);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:l}}},r.values=(n,s,a)=>new class{x(l){return{unit:n,value:a.at(s.indexOf(l))??"N/A"}}y(l){let c=a.indexOf(l);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:s[c]}}},r.bool=new class{y(n){switch(n.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(n){return{value:n?"On":"Off",unit:""}}},r.boolValues=(n,s)=>new class{y(a){switch(a.trim()){case s:case"on":case"yes":case"true":return{type:"explicit",value:!0};case n:default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(s,a,l,c){this.#e=s??"",this.#t=a??0,this.#r=l??!1,this.#i=c??!1}y(s){let a=s.trim(),l=parseFloat(a);if(isNaN(l))return{type:"unknown",value:a};if(this.#e==="%")return{type:"explicit",value:l/100};if(a.endsWith("%"))return{type:"unitValue",value:this.#i?ue(l/200+.5,0,1):ue(l/100,0,1)};{a.endsWith(this.#e)&&this.#e.length>0&&(a=a.slice(0,-this.#e.length));let p=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(Z(p)){let f=t.indexOf(p);if(f>-1)return{type:"explicit",value:l*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:l}}}x(s){if(Number.isNaN(s))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(s)){if(this.#e==="%")return this.#i?{value:(s*200-100).toFixed(this.#t),unit:this.#e}:{value:(s*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:a,prefix:l}=i(s);return{value:a.toFixed(this.#t),unit:`${l}${this.#e}`}}else return{value:s.toFixed(this.#t),unit:this.#e}}else return{value:s===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),o=n=>Math.log(n)/Math.log(9.999999999999998),i=n=>{let s=Math.floor(o(n)/3),a=t[s+4];return Z(a)?{value:n*Math.pow(10,s*-3),prefix:a}:{value:n,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(P||(P={}));var Nn;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(Nn||(Nn={}));var yl;(function(r){r.create=(e=252854082)=>new Bb(e),r.monotoneAscending=(e,t=128,o=r.create())=>{let i=e.length;if(i<2)return F("Array must have at least 2 elements");let n=0;for(let a=1;a<i;a++){let l=Math.floor(o.uniform()*(1+t))+1;e[a]=l,n+=l}let s=0;e[0]=0;for(let a=1;a<i;a++)s+=e[a],e[a]=s/n;return e}})(yl||(yl={}));var Bb=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 Pr;(function(r){class e{}r.createBuilder=o=>{let i=n=>{let s=n instanceof Array?[]:{};return Object.entries(n).forEach(([a,l])=>{l instanceof e?s[a]=l.initialValue():typeof l=="object"&&(s[a]=i(l))}),s};return()=>new t(o,Object.seal(i(o)))},r.bool=new class extends e{read(o){return o.readByte()===1}write(o,i){o.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(o){return o.readByte()}write(o,i){o.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(o){return o.readShort()}write(o,i){o.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(o){return o.readInt()}write(o,i){o.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(o){return o.readFloat()}write(o,i){o.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(o){return o.readDouble()}write(o,i){o.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(o){return o.readLong()}write(o,i){o.writeLong(i)}initialValue(){return 0n}},r.floats=o=>new class extends e{read(i,n){for(let s=0;s<n.length;s++)n[s]=i.readFloat();return n}write(i,n){for(let s=0;s<n.length;s++)i.writeFloat(n[s])}initialValue(){return new Float32Array(o)}},r.doubles=o=>new class extends e{read(i,n){for(let s=0;s<n.length;s++)n[s]=i.readDouble();return n}write(i,n){for(let s=0;s<n.length;s++)i.writeDouble(n[s])}initialValue(){return new Float64Array(o)}};class t{#e;#t;#r;constructor(i,n){this.#e=i,this.#t=n,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let n=(s,a)=>{Object.entries(s).forEach(([l,c])=>{let d=a;c instanceof e?d[l]=c.read(i,d[l]):typeof c=="object"&&n(c,d[l])})};n(this.#e,this.#t)}write(i){let n=(s,a)=>{Object.entries(s).forEach(([l,c])=>{let d=a;c instanceof e?c.write(i,d[l]):typeof c=="object"&&n(c,d[l])})};n(this.#e,this.#t)}#i(){let i=new ml;return this.write(i),i.count}}})(Pr||(Pr={}));var xl=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let o=this.#e(e),i=et.leftMostMapped(this.#r,o,this.#t,this.#e),n=this.#r[i];return Z(n)&&this.#t(this.#e(n),o)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let o=et.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[o];if(Z(i)&&this.#t(this.#e(i),e)===0)return i;let n=t(e);return this.#r.splice(o,0,n),n}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,o)=>{let i=this.#t(this.#e(t),this.#e(o));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let o=new Map(this.entries());return this.#r.splice(0,this.#r.length,...o.values()),this.#r.sort((i,n)=>this.#t(this.#e(i),this.#e(n))),!1}return F(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=et.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return Z(o)&&this.#t(this.#e(o),e)===0?(this.#r.splice(t,1),o):F(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=et.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return Z(o)&&this.#t(this.#e(o),e)===0?(this.#r.splice(t,1),o):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,o=this.#r.length;for(;--o>=0;)e(this.#r[o])&&(this.#r.splice(o,1),t++);return t}get(e){return re(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let o=this.#i(e);if(Z(o))return o;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 Z(this.#i(e))}hasValue(e){return Z(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(){C.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=et.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return Z(o)&&this.#t(this.#e(o),e)===0?o:void 0}};var bl=(()=>{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:Jo}),some:t=>t.progress(e)}),install:e=>{D(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var hd=class r{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#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#o;constructor(e){this.#o=e}millis(){return this.#o}absSeconds(){return Math.abs(this.#o)/r.#e}absMinutes(){return Math.abs(this.#o)/r.#t}absHours(){return Math.abs(this.#o)/r.#r}absDays(){return Math.abs(this.#o)/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.#o===0}isPast(){return this.#o<0}isFuture(){return this.#o>0}toUnitString(){let e,t,o=Math.floor(Math.abs(this.#o)/1e3),i=Math.floor(o/60),n=Math.floor(i/60),s=Math.floor(n/24);return o<60?(e=o,t="second"):i<60?(e=i,t="minute"):n<24?(e=n,t="hour"):(e=s,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#o),t)}toString(){if(isNaN(this.#o))return"NaN";if(!isFinite(this.#o))return"\u221E";let{d:e,h:t,m:o,s:i}=this.split();return e>0?[r.#n("d",e),r.#n("h",t),r.#n("m",o),r.#n("s",i)].join(", "):t>0?[r.#n("h",t),r.#n("m",o),r.#n("s",i)].join(", "):o>0?[r.#n("m",o),r.#n("s",i)].join(", "):i>0?r.#n("s",i):"now"}static#n=(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 gf(e)}}};var wl;(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,o,i)=>{if(t.bytesTotal+1>o.byteLength)return F("Insufficient memory allocated.");let n=new Uint8Array(o),s=Mt.use(o,1);return Atomics.store(n,0,e.READ),{tryWrite:()=>Atomics.compareExchange(n,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),s.position=0,t.write(s),Atomics.store(n,0,e.WRITTEN),!0):!1}},r.reader=(t,o)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),n=new Uint8Array(i),s=new ct(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(n,0,e.WRITTEN,e.READING)===e.READING?(s.position=0,t.read(s),o(t.object),Atomics.store(n,0,e.READ),!0):!1}}})(wl||(wl={}));var b;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let o=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",o?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:F(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let o=new Uint8Array(r.length);return t.readBytes(new Int8Array(o.buffer)),o},r.toDataOutput=(t,o)=>t.writeBytes(new Int8Array(o.buffer)),r.toString=t=>{let o=C.create(i=>(i+256).toString(16).substring(1),256);return o[t[0]]+o[t[1]]+o[t[2]]+o[t[3]]+"-"+o[t[4]]+o[t[5]]+"-"+o[t[6]]+o[t[7]]+"-"+o[t[8]]+o[t[9]]+"-"+o[t[10]]+o[t[11]]+o[t[12]]+o[t[13]]+o[t[14]]+o[t[15]]},r.parse=t=>{let o=t.replace(/-/g,"").toLowerCase();if(o.length!==32)return F("Invalid UUID format");let i=new Uint8Array(r.length);for(let n=0,s=0;n<32;n+=2,s++)i[s]=parseInt(o.slice(n,n+2),16);return i},r.Comparator=(t,o)=>{if(t.length!==r.length||o.length!==r.length)return F("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let n=t[i]-o[i];if(n!==0)return n}return 0},r.equals=(t,o)=>r.Comparator(t,o)===0,r.newSet=t=>new xl(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 o=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let n=0;n<4;n++)o[n]=i[n];return o},r.zType=t=>t.string().refine(o=>r.validateString(o),{message:"Invalid UUID format"}).transform(o=>o);let e=t=>(D(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(b||(b={}));var xe=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=C.create(()=>new Float32Array(128),e)}clear(e,t){this.#e.forEach(o=>o.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){D(!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){D(e.length===2,"mixLayout: target.length must be 2"),D(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){D(e.length===2,"mixLayout: target.length must be 2"),D(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,o]=e;if(this.#e.length===1){let[i]=this.#e;for(let n=0;n<128;n++)t[n]+=i[n],o[n]+=i[n]}else{let[i,n]=this.#e;for(let s=0;s<128;s++)t[s]+=i[s],o[s]+=n[s]}}};var dt;(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"})(dt||(dt={}));var Al=class{#e;#t=dt.Idle;#r=0;#i=0;#o=0;#n=0;#s=0;#a=0;#l=0;#u=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==dt.Idle&&this.#t!==dt.Release}get complete(){return this.#t===dt.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,o,i){this.#o=e,this.#n=t,this.#s=o,this.#a=i,this.#d()}#d(){switch(this.#t){case dt.Attack:{let e=1-this.#r;this.#l=e*this.#e/Math.max(this.#o,1e-6);break}case dt.Decay:{let e=this.#r-this.#s;this.#u=e*this.#e/Math.max(this.#n,1e-6);break}case dt.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#a,1e-6);break}case dt.Sustain:case dt.Idle:{this.#l=this.#e/Math.max(this.#o,1e-6),this.#u=(1-this.#s)*this.#e/Math.max(this.#n,1e-6),this.#c=this.#s*this.#e/Math.max(this.#a,1e-6);break}}}gateOn(){this.#t=dt.Attack}gateOff(){this.#t!==dt.Idle&&(this.#t=dt.Release,this.#d())}forceStop(){this.#t=dt.Idle,this.#r=0}process(e,t,o){for(let i=t;i<o;)switch(this.#t){case dt.Attack:for(;i<o;){if(this.#r+=this.#l,this.#r>=1){this.#r=1,this.#i=1,e[i++]=this.#r,this.#t=dt.Decay,this.#d();break}e[i++]=this.#i=this.#r}break;case dt.Decay:for(;i<o;){if(this.#r-=this.#u,this.#r<=this.#s){this.#r=this.#s,this.#i=2,e[i++]=this.#r,this.#t=dt.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#s),e[i++]=this.#r}break;case dt.Sustain:e.fill(this.#s,i,o);return;case dt.Release:for(;i<o;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[i++]=this.#r,this.#t=dt.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#s),e[i++]=this.#r}break;case dt.Idle:e.fill(0,i,o);return}}};var co=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=ue(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let o=Ci*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1-n)/2,a=s,l=2*s,c=s,d=1+i,p=-2*n,f=1-i;this.setNormalizedCoefficients(a,l,c,d,p,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=ue(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let o=Ci*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1+n)/2,a=s,l=-2*s,c=s,d=1+i,p=-2*n,f=1-i;this.setNormalizedCoefficients(a,l,c,d,p,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,o,i,n,s){let a=1/i;return this.b0=e*a,this.b1=t*a,this.b2=o*a,this.a1=n*a,this.a2=s*a,this}setLowShelfParams(e,t){e=ue(e,0,1);let o=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(o*o,0,0,1,0,0);else if(e>0){let i=Ci*e,s=.5*Math.sin(i)*Math.sqrt((o+1/o)*(1/1-1)+2),a=Math.cos(i),l=2*Math.sqrt(o)*s,c=o+1,d=o-1,p=o*(c-d*a+l),f=2*o*(d-c*a),g=o*(c-d*a-l),v=c+d*a+l,x=-2*(d+c*a),y=c+d*a-l;this.setNormalizedCoefficients(p,f,g,v,x,y)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=ue(e,0,1);let o=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=Ci*e,s=.5*Math.sin(i)*Math.sqrt((o+1/o)*(1/1-1)+2),a=Math.cos(i),l=2*Math.sqrt(o)*s,c=o+1,d=o-1,p=o*(c+d*a+l),f=-2*o*(d+c*a),g=o*(c+d*a-l),v=c-d*a+l,x=2*(d-c*a),y=c-d*a-l;this.setNormalizedCoefficients(p,f,g,v,x,y)}else this.setNormalizedCoefficients(o*o,0,0,1,0,0);return this}setPeakingParams(e,t,o){e=ue(e,0,1),t=Math.max(0,t);let i=Math.pow(10,o/40);if(e>0&&e<1)if(t>0){let n=Ci*e,s=Math.sin(n)/(2*t),a=Math.cos(n),l=1+s*i,c=-2*a,d=1-s*i,p=1+s/i,f=-2*a,g=1-s/i;this.setNormalizedCoefficients(l,c,d,p,f,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=ue(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=Ci*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1-i,a=-2*n,l=1+i,c=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,c,d,p)}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=ue(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=Ci*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1,a=-2*n,l=1,c=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,c,d,p)}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 o=Ci*e;if(t>0){let i=Math.sin(o)/(2*t),n=Math.cos(o),s=i,a=0,l=-i,c=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,c,d,p)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,o){D(e.length===t.length&&e.length===o.length,"Array lengths do not match");let i=this.b0,n=this.b1,s=this.b2,a=this.a1,l=this.a2;for(let c=0;c<e.length;++c){let d=-Math.PI*2*e[c],p=Math.cos(d),f=Math.sin(d),g=i+((n+s*p)*p-s*f*f),v=(n+s*p)*f+s*f*p,x=1+((a+l*p)*p-l*f*f),y=(a+l*p)*f+l*f*p,M=x*x+y*y,T=(g*x+v*y)/M,L=(v*x-g*y)/M;t[c]=Math.sqrt(T*T+L*L),o[c]=Math.atan2(L,T)}}};var Et=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:o,b1:i,b2:n},s,a,l,c){let d=this.#e,p=this.#t,f=this.#r,g=this.#i;for(let v=l;v<c;v++){let x=s[v],y=a[v]=o*x+i*d+n*p-e*f-t*g+1e-18-1e-18;p=d,d=x,g=f,f=y}this.#e=d,this.#t=p,this.#r=f,this.#i=g}processFrame({a1:e,a2:t,b0:o,b1:i,b2:n},s){let a=o*s+i*this.#e+n*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=s,this.#i=this.#r,this.#r=a,a}},In=class{#e;#t;constructor(e){this.#e=C.create(()=>new Et,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,o,i,n){for(let s=0;s<this.#t;s++)this.#e[s].process(e,t,o,i,n),t=o}processFrame(e,t){for(let o=0;o<this.#t;o++)t=this.#e[o].processFrame(e,t);return t}},fd=512,Af=class{#e;#t=new co;#r;#i=-1;constructor(e,t,o){this.#r=new In(4),this.#e=new Float32Array(fd+1);let i=Math.log(t/e),n=1/o;for(let s=0;s<=fd;s++)this.#e[s]=e*Math.exp(s/fd*i)*n}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,o,i,n,s){let a=this.#e,l=this.#r,c=this.#t,d=i/l.order**1.25,p=n,f=this.#i;for(;p<s;){let g=Math.floor(ii(o[p])*fd),v=p+1;for(;v<s&&Math.floor(ii(o[v])*fd)===g;)++v;g!==f&&(f=g,c.setLowpassParams(a[g],d)),l.process(c,e,t,p,v),p=v}this.#i=f}};var pS=Math.log(10)/20,md=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Ve=r=>Math.exp(r*pS),Fb=r=>Math.log(r)/pS,_l=r=>Ve(20*Math.log10(r));var TN=.02,hS=1e3,_f=class{#e;#t;#r;#i;#o;#n;#s=NaN;#a=NaN;#l=0;#u=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*TN)|0,this.#r=new co,this.#r.setLowpassParams(.5),this.#i=[new Et,new Et],this.#o=[new Float32Array(128),new Float32Array(128)],this.#n=new Float32Array(2)}process(e,t,o,i){let[n,s]=e,[a,l]=t,[c,d]=this.#o;this.#i[0].process(this.#r,n,c,o,i),this.#i[1].process(this.#r,s,d,o,i);let p=Ve(this.#p),f=Ve(-this.#p/2),g=this.#e/this.#s,v=Math.pow(2,this.#d)-1,x=1/v;for(let y=o;y<i;y++)this.#u>0&&(this.#s+=this.#l,--this.#u===0&&(this.#l=0,this.#s=this.#a),this.#r.setLowpassParams(Math.max(this.#s,hS)/this.#e)),this.#c+=1,this.#c>=g&&(this.#c-=g,this.#n[0]=ue(Math.round(c[y]*p*v)*x,-1,1),this.#n[1]=ue(Math.round(d[y]*p*v)*x,-1,1)),a[y]=(n[y]*(1-this.#h)+this.#n[0]*this.#h)*f,l[y]=(s[y]*(1-this.#h)+this.#n[1]*this.#h)*f;this.#f=!0}setCrush(e){let t=aS(20,this.#e*.5,e);this.#f&&isFinite(this.#s)?(this.#a=t,this.#l=(t-this.#s)/this.#t,this.#u=this.#t):(this.#s=t,this.#r.setLowpassParams(Math.max(this.#s,hS)/this.#e))}setBitDepth(e){this.#d=ue(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=ii(e)}reset(){this.#f=!1,this.#a=NaN,this.#l=0,this.#u=0,this.#c=0,this.#n.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Pf=class r{static#e=10;#t=1;#r=0;#i=0;#o=0;#n=0;#s=0;set(e,t,o){this.#t=e,this.#r=t*r.#e,this.#i=yf(1e-5,1-1e-5,o),this.#o=2**Math.abs(this.#r),this.#n=1/this.#i,this.#s=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),o,i,n,s;return this.#r<0?(o=1-t,i=1-this.#i,n=this.#s,s=this.#n):(o=t,i=this.#i,n=this.#n,s=this.#s),o<=i?1-(1-o*n)**this.#o*this.#t:((1-o)*s)**this.#o*this.#t-this.#t+1}};var gd;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(gd||(gd={}));var Ws;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Ws||(Ws={}));var Jt;(function(r){r.globalToLocal=(t,o)=>cd(o-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:o,loopOffset:i,loopDuration:n},s,a)=>{let l=t-i,c=l+n;if(l>=a||c<=s)return m.None;let d=Math.max(l,s),p=Math.min(c,a);return m.wrap({index:0,rawStart:l,rawEnd:c,regionStart:Math.max(l,t),regionEnd:Math.min(c,o),resultStart:d,resultEnd:p,resultStartValue:l<d?(d-l)/n:0,resultEndValue:c>p?(p-l)/n:1})};function*e({position:t,complete:o,loopOffset:i,loopDuration:n},s,a){let l=t-i,c=Math.max(t,s),d=Math.min(o,a),p=Math.floor((c-l)/n),f=l+p*n;for(;f<d;){let g=f+n,v=Math.max(f,t),x=Math.min(g,o),y=Math.max(f,c),M=Math.min(g,d),T=f<y?(y-f)/n:0,L=g>M?(M-f)/n:1;yield{index:p++,rawStart:f,rawEnd:g,regionStart:v,regionEnd:x,resultStart:y,resultEnd:M,resultStartValue:T,resultEndValue:L},f=g}}r.locateLoops=e})(Jt||(Jt={}));var Sr=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 Sf(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()?Yo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,o){return this.#e.isEmpty()?Yo.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,o)}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()}},kn=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 Sf(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()?Yo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return Yo.empty();let o=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(o);if(i===null)return Yo.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++o),i===null||i.position>=t)return Yo.empty();return this.#e.iterate(o,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Zs=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=et.leftMost(this.#e,e,Ws.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let o=this.#e.filter(i=>i.position<=e&&e<i.position+i.duration);yield*Z(t)?o.sort(t):o}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let o=this.#e[t];if(Ws.complete(o)<e)this.#e.splice(t,1),yield o;else return}}*release(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let o=this.#e[t];e(o)&&(this.#e.splice(t,1),yield o)}}*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(){C.clear(this.#e)}},Sf=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(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 o=e.position,i=et.leftMostMapped(this.#e,o,ud,gd.PositionExtractor);for(let n=i;n<this.#e.length;n++){let s=this.#e[n];if(s===e)return!0;if(s.position!==o)return!1}return!1}clear(){++this.modCount,C.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 o=this.floorLastIndex(e);for(;o>=0;){let i=this.#e[o--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let o=this.ceilFirstIndex(e);for(;o<this.#e.length;){let i=this.#e[o++];if(t(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),et.rightMostMapped(this.#e,e,ud,gd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),et.leftMostMapped(this.#e,e,ud,gd.PositionExtractor)}iterateFrom(e,t){let o=this.floorLastIndex(e),i=o;if(i<0)return this.iterate(0,lr.MAX_VALUE,t);for(;i>=0;){let n=this.optAt(i);if(n!==null&&t!==void 0&&t(n))return this.iterate(i,lr.MAX_VALUE,t);i--}return this.iterate(o,lr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,o=Nn.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=t)return;o(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var hf=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 o=0;o<t;o++){let i=2*Math.PI*o/e;this.#r[o]=Math.cos(i),this.#i[o]=Math.sin(i)}}process(e,t){let o,i,n,s;for(let c=0;c<this.#e;++c)i=r.reverse(c)>>>this.#t,i>c&&(s=e[c],e[c]=e[i],e[i]=s,s=t[c],t[c]=t[i],t[i]=s);let a=this.#r,l=this.#i;for(let c=2;c<=this.#e;c<<=1){let d=c>>1,p=this.#e/c;for(o=0;o<this.#e;o+=c){let f=o+d;for(i=o,n=0;i<f;i++,n=n+p|0){let g=i+d|0,v=a[n],x=l[n],y=e[g],M=t[g],T=y*v+M*x,L=M*v-y*x,R=e[i],z=t[i];e[g]=R-T,t[g]=z-L,e[i]=R+T,t[i]=z+L}}if(c===this.#e)break}}};var Nb=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var Ib=(r,e)=>Math.floor(3840/e)*r,fS=(r,e=4,t=4)=>{let o=Ib(1,t),i=Math.floor(r/o),n=Math.floor(i/e),a=(Math.floor(r)-Ib(n*e,t))%o,l=Math.floor(a/240),c=a%240;return{bars:n,beats:i-n*e,semiquavers:l,ticks:c}},mS=(r,e)=>r*e/60*960,gS=(r,e)=>r*60/960/e,RN=(r,e)=>e*60/960/r,ON=(r,e,t)=>mS(r/t,e),VN=(r,e,t)=>gS(r,e)*t,X={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Ib,toParts:fS,secondsToPulses:mS,pulsesToSeconds:gS,secondsToBpm:RN,samplesToPulses:ON,pulsesToSamples:VN,toString:(r,e=4,t=4)=>{let{bars:o,beats:i,semiquavers:n,ticks:s}=fS(r|0,e,t);return`${o+1}.${i+1}.${n+1}:${s}`}};var ur;(function(r){r.builder=()=>new e,r.toDouble=([t,o])=>t/o,r.toPPQN=([t,o])=>X.fromSignature(t,o);class e{#e=[];add(o){return this.#e.push(o),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((o,i)=>r.toDouble(o)-r.toDouble(i))}asDescendingArray(){return this.#e.toSorted((o,i)=>r.toDouble(i)-r.toDouble(o))}}})(ur||(ur={}));var po=class{static*iterate(e,t,o){let i=Math.ceil(e/o),n=i*o;for(;n<t;)yield n,n=++i*o}static*iterateWithIndex(e,t,o){let i=Math.ceil(e/o),n=i*o;for(;n<t;)yield{position:n,index:i},n=++i*o}};var Pl=class{#e=0;#t=NaN;#r=NaN;#i=0;#o=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#o=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.#o=t}process(e,t,o,i){if(isNaN(this.#r)){for(let n=o;n<i;n++)e[n]*=this.#e;this.#t=this.#e}else{let n=X.samplesToPulses(1,t,sampleRate);for(let s=o;s<i;s++){if(this.#i+=n/this.#o,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let a=s;a<i;a++)e[a]*=this.#e;break}e[s]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,o){if(isNaN(this.#r))this.#t=this.#e;else{let i=X.samplesToPulses(o-t,e,sampleRate);this.#i+=i/this.#o,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 Ef=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){D(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),D(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){C.remove(this.#e,e);let t=this.#t.delete(e);D(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??C.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){re(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`).push(e)}removeEdge([e,t]){let o=re(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);D(o.includes(e),`${e} is not marked.`),C.remove(o,e)}isEmpty(){return this.#e.length===0}},Bf=class{#e;#t;#r;#i;#o;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#o=new Map}update(){this.#n(),this.#e.vertices().forEach(e=>this.#s(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#n(){this.#a();let e=new Map;for(let o of this.#e.vertices())this.#o.set(o,new Set),e.set(o,new Set);for(let o of this.#e.vertices())for(let i of this.#e.getPredecessors(o))re(this.#o.get(i),`Could not find Successor for ${i}`).add(o);let t;do{t=!1;for(let o of this.#e.vertices()){re(e.get(o)).clear();for(let i of re(this.#o.get(o)))for(let n of re(this.#o.get(i)))this.#o.get(o)?.has(n)||(t=!0,re(e.get(o)).add(n))}for(let o of this.#e.vertices()){let i=re(this.#o.get(o));re(e.get(o)).forEach(n=>i.add(n))}}while(t)}#s(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(re(this.#o.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#s(t)}this.#t.push(e)}}#a(){C.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#o.clear()}};var vd;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(vd||(vd={}));var Ff=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 o=this.#e.duration(),i=Qo(t,o),n=(t-i)/o,s=e?this.#e.fx(n):this.#e.fy(n);return i+s*o}};var Ke;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Ke||(Ke={}));var Nf=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,o,i,n){let s=o/this.sampleRate;switch(t){case Ke.sine:{for(let a=i;a<n;a++)e[a]=Math.sin(this.#e*Math.PI*2),this.#e+=s,this.#e>=1&&(this.#e-=1);break}case Ke.triangle:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=4*Math.abs(l-.5)-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}case Ke.saw:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=2*l-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}case Ke.square:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=l<.5?1:-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var ho;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(ho||(ho={}));var If;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,o)=>t|=1<<o,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,o)=>ii((t-60)*o);class e{#e;#t;constructor(o,...i){this.#e=o,this.#t=i.reduce((n,s)=>n|=1<<s,0)}get name(){return this.#e}get bits(){return this.#t}has(o){return(this.#t&1<<o%12)!==0}equals(o){return this.#t===o.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)]})(If||(If={}));var Qt;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let o=e.position-t.position;if(o!==0)return o;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 o=Ws.complete(e)-Ws.complete(t);return o!==0?o:e.pitch-t.pitch}})(Qt||(Qt={}));var yd=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,o,i,n){let s=t*this.#e;switch(o){case Ke.sine:this.#i(e,s,i,n);break;case Ke.saw:this.#o(e,s,i,n);break;case Ke.square:this.#n(e,s,i,n);break;case Ke.triangle:this.#s(e,s,i,n);break}}generateFromFrequencies(e,t,o,i,n){switch(o){case Ke.sine:this.#a(e,t,i,n);break;case Ke.saw:this.#l(e,t,i,n);break;case Ke.square:this.#u(e,t,i,n);break;case Ke.triangle:this.#c(e,t,i,n);break}}#i(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++)e[s]=Math.sin(2*Math.PI*(n%1)),n+=t;this.#t=n}#o(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++){let a=n%1;e[s]=2*a-1-fo(a,t),n+=t}this.#t=n}#n(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++){let a=n%1;e[s]=(a<.5?1:-1)+fo(a,t)-fo((a+.5)%1,t),n+=t}this.#t=n}#s(e,t,o,i){let n=this.#t,s=this.#r,a=4*t;for(let l=o;l<i;l++){let c=n%1,d=(c<.5?1:-1)+fo(c,t)-fo((c+.5)%1,t);s=s*.9995+d*a,e[l]=s,n+=t}this.#t=n,this.#r=s}#a(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++)e[a]=Math.sin(2*Math.PI*(s%1)),s+=t[a]*n;this.#t=s}#l(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++){let l=t[a]*n,c=s%1;e[a]=2*c-1-fo(c,l),s+=l}this.#t=s}#u(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++){let l=t[a]*n,c=s%1;e[a]=(c<.5?1:-1)+fo(c,l)-fo((c+.5)%1,l),s+=l}this.#t=s}#c(e,t,o,i){let n=this.#e,s=this.#t,a=this.#r;for(let l=o;l<i;l++){let c=t[l]*n,d=s%1,p=(d<.5?1:-1)+fo(d,c)-fo((d+.5)%1,c);a=a*.9995+p*(4*c),e[l]=a,s+=c}this.#t=s,this.#r=a}},fo=(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 en;(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:o,invertL:i,invertR:n,stereo:s,swap:a},l=ho.EqualPower)=>{let[c,d]=r.panningToGains(o,l),p=c*t,f=d*t;i&&(p*=-1),n&&(f*=-1);let g=Math.max(0,-s),v=Math.max(0,s),x=1-v,y=1+v,M=g*.5,T=1-g,L=(x+y)*.5,R=(x-y)*.5,z=(x-y)*.5,ee=(x+y)*.5,te=p*(M+T)*L+f*M*R,H=p*(M+T)*z+f*M*ee,ye=p*M*L+f*(M+T)*R,le=p*M*z+f*(M+T)*ee;a?(e.ll=H,e.rl=te,e.lr=le,e.rr=ye):(e.ll=te,e.lr=ye,e.rl=H,e.rr=le)},r.panningToGains=(e,t)=>{let o=ue(e,-1,1);switch(t){case ho.Linear:return[Math.min(1-o,1),Math.min(o+1,1)];case ho.EqualPower:return[Math.cos((o+1)*bb),Math.sin((o+1)*bb)]}},r.applyFrame=(e,t,o)=>[e.ll*t+e.rl*o,e.lr*t+e.rr*o],r.processFrames=(e,t,o,i,n)=>{let[s,a]=t,[l,c]=o;for(let d=i;d<n;d++){let p=s[d],f=a[d];l[d]=e.ll*p+e.rl*f,c[d]=e.lr*p+e.rr*f}},r.replaceFrames=(e,[t,o],i,n)=>{for(let s=i;s<n;s++){let a=t[s],l=o[s];t[s]=e.ll*a+e.rl*l,o[s]=e.lr*a+e.rr*l}}})(en||(en={}));var Xt;(function(r){r.linear=(o,i=.005)=>new e(Math.ceil(o*i)|0),r.stereoMatrix=(o,i=.005)=>new t(Math.ceil(o*i)|0);class e{#e;#t=0;#r=0;#i=0;#o=0;constructor(i){this.#e=i}set(i,n){this.#t!==i&&(n===!0?(this.#r=i,this.#i=(i-this.#t)/this.#e,this.#o=this.#e):(this.#t=this.#r=i,this.#i=0,this.#o=0))}get(){return this.#t}moveAndGet(){return 0<this.#o&&(this.#t+=this.#i,--this.#o===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(i){return this.#t===i&&this.#o===0}isInterpolating(){return this.#o>0}}class t{#e;#t=en.zero();#r=en.zero();#i=en.zero();#o=0;constructor(i){this.#e=i}update(i,n,s){en.update(this.#r,i,n),s===!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.#o=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.#o=0)}processFrames(i,n,s,a){let[l,c]=i,[d,p]=n;if(this.isInterpolating())for(let f=s;f<a;f++){let g=l[f],v=c[f],x=this.moveAndGet();d[f]=x.ll*g+x.rl*v,p[f]=x.lr*g+x.rr*v}else{let f=this.#r;for(let g=s;g<a;g++){let v=l[g],x=c[g];d[g]=f.ll*v+f.rl*x,p[g]=f.lr*v+f.rr*x}}}set(i,n){this.#n(i)||(n===!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.#o=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.#o=0))}get(){return this.#t}moveAndGet(){return 0<this.#o&&(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.#o===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.#n(i)&&this.#o===0}isInterpolating(){return this.#o>0}#n(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})(Xt||(Xt={}));var xd=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]),kb=new Float32Array(12),vS=new Float32Array(11);for(let r=0,e=0,t=0;r<xd.length;r++)r%2===0?kb[e++]=xd[r]:vS[t++]=xd[r];var $b=class{#e=new Float32Array(kb.length);#t=new Float32Array(xd.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,o,i){let n=this.#e,s=kb,a=vS;for(let l=o;l<i;l++){let c=e[l],d=(l-o)*2;n[this.#r]=c;let p=0;for(let g=0;g<s.length;g++){let v=(this.#r-g+n.length)%n.length;p+=n[v]*s[g]}t[d]=p*2;let f=0;for(let g=0;g<a.length;g++){let v=(this.#r-g+n.length-1)%n.length;f+=n[v]*a[g]}t[d+1]=f*2,this.#r=(this.#r+1)%n.length}}downsample(e,t,o,i){let n=this.#t,s=xd;for(let a=o;a<i;a++){let l=(a-o)*2;n[this.#i]=e[l],this.#i=(this.#i+1)%n.length,n[this.#i]=e[l+1],this.#i=(this.#i+1)%n.length;let c=0;for(let d=0;d<s.length;d++){let p=(this.#i-1-d+n.length)%n.length;c+=n[p]*s[d]}t[a]=c}}},kf=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=C.create(()=>new $b,t),this.#r=C.create(o=>new Float32Array(128*(2<<o)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,o,i){let n=i-o,s=e,a=o,l=i;for(let c=0;c<this.#t.length;c++){let p=c===this.#t.length-1?t:this.#r[c];this.#t[c].upsample(s,p,a,l),s=p,a=0,l=n*(2<<c)}}downsample(e,t,o,i){let n=i-o,s=e,a=n*this.#e;for(let l=this.#t.length-1;l>=0;l--){let c=l===0,d=c?t:this.#r[l-1],p=c?o:0,f=c?i:a/2;this.#t[l].downsample(s,d,p,f),s=d,a=f}}},$f=class{#e;#t;constructor(e){this.#e=new kf(e),this.#t=new kf(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,o,i){this.#e.upsample(e[0],t[0],o,i),this.#t.upsample(e[1],t[1],o,i)}downsample(e,t,o,i){this.#e.downsample(e[0],t[0],o,i),this.#t.downsample(e[1],t[1],o,i)}};var Sl=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,o){let i=this.#e,n=i.length,s=this.#r,a=this.#i;for(let l=t;l<o;l++){let c=e[l]*e[l];a+=c-i[s],i[s]=c,++s===n&&(s=0)}return this.#r=s,this.#i=a,a<=0?0:Math.sqrt(a*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var Df=class r{static#e=.003;static#t=.02;#r;#i;#o=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#o=0}replace(e,t,o){let i=this.#r,n=this.#i,[s,a]=e.channels(),l=this.#o;for(let c=t;c<o;++c){let d=s[c],p=a[c],f=Math.max(Math.abs(d),Math.abs(p));if(l=f>l?i*(l-f)+f:n*(l-f)+f,l>1){let g=1/l;s[c]=d*g,a[c]=p*g}}this.#o=l}};var Ti=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 Mf=class{#e=new O;#t;#r;constructor(e){this.#t=this.#e.own(new ie),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}ppqnToSeconds(e){return X.pulsesToSeconds(e,this.#r)}secondsToPPQN(e){return X.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return X.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return X.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var cr;(function(r){r.Musical="musical",r.Seconds="seconds"})(cr||(cr={}));var $n;(function(r){function e(o,i,n){return new Mb(o,i,n)}r.musical=e;function t(o,i,n,s){return new Db(o,i,n,s)}r.aware=t})($n||($n={}));var Db=class{#e;#t;#r;#i;constructor(e,t,o,i){this.#i=i,this.#t=t,this.#r=o,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===cr.Musical)return e;let t=this.#r.getValue(),o=this.#e.ppqnToSeconds(t),i=o+e;return this.#e.intervalToPPQN(o,i)}fromPPQN(e){if(this.getTimeBase()===cr.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),o=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(o)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===cr.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return ri(this.#t.getValue(),cr)}},Mb=class{#e;#t;#r;constructor(e,t,o){this.#r=o,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return cr.Musical}};var Cf=X.fromSignature(1,384);var Dn={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},Tf;(function(r){r.Comparator=(i,n)=>{let s=i.position-n.position;if(s!==0)return s;let a=i.index-n.index;return a!==0?a:i===n?0:F(`${i} and ${n} are identical in terms of comparison`)};function*e(i,n,s){if(i.isEmpty())return tt.empty();for(let a of i.iterateFrom(n))if(yield a,a.position>=s)return}r.iterateWindow=e,r.nextEvent=(i,n)=>{let s=i.asArray(),a=et.rightMost(s,n,r.Comparator);return a===-1?null:s[a+1]??null},r.valueAt=(i,n,s)=>{if(i.isEmpty())return s;let a=i.iterateFrom(n),{done:l,value:c}=a.next();if(l)return s;if(c.position<=n){let{done:d,value:p}=a.next();if(d)return c.value;if(n<p.position)return o(c,p,n);if(c.interpolation===Dn.None)return c.value}return c.value};function*t(i,n,s,a){if(i.isEmpty())return;let l=i.iterateFrom(n),{done:c,value:d}=l.next();if(c)return;let p=s/a,f=d;if(f.position>n){for(;n<f.position;)if(yield{position:n,value:f.value},n+=p,n>s)return;f.position<=s&&(yield f)}for(;n<=s;){let{done:g,value:v}=l.next();if(g)break;for(;n<v.position;){if(n>s)return;yield{position:n,value:o(f,v,n)},n+=p}v.position<s&&(f.interpolation===Dn.None&&(yield{position:v.position,value:f.value}),yield v),f=v}for(;n<=s;)yield{position:n,value:f.value},n+=p}r.quantise=t;let o=({value:i,position:n,interpolation:s},a,l)=>s.type==="none"?i:s.type==="linear"?i+(l-n)/(a.position-n)*(a.value-i):s.type==="curve"?oi.valueAt({slope:s.slope,steps:a.position-n,y0:i,y1:a.value},l-n):F("Unknown interpolation")})(Tf||(Tf={}));var ad;(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,o)=>{let i=new Float32Array(o),n=Math.PI/(o-1);switch(t){case e.Bartlett:{let s=(o>>1)-1,a=0;for(;a<=s;++a)i[a]=2*a/(o-1);for(;a<o;++a)i[a]=2-2*a/(o-1);return i}case e.Blackman:{let s=2*n,a=4*n;for(let l=0;l<o;++l)i[l]=.42323-.49755*Math.cos(s*l)+.07922*Math.cos(a*l);return i}case e.BlackmanHarris:{let s=2*n,a=4*n,l=6*n;for(let c=0;c<o;++c)i[c]=.35875-.48829*Math.cos(s*c)+.14128*Math.cos(a*c)-.01168*Math.cos(l*c);return i}case e.Hamming:{let s=2*n;for(let a=0;a<o;++a)i[a]=.54-.46*Math.cos(s*a);return i}case e.Hanning:{let s=2*n;for(let a=0;a<o;++a)i[a]=.5-.5*Math.cos(s*a);return i}}}})(ad||(ad={}));var Rf=class extends AudioWorkletProcessor{#e;#t;#r;#i;#o;#n=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:o,valueDecay:i}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=C.create(()=>new Sl(sampleRate*o),t);let n=Pr.createBuilder({peak:Pr.floats(t),rms:Pr.floats(t)})();this.#o=wl.writer(n,e,s=>{let a=Math.exp(-(128*this.#n)/(sampleRate*i));for(let l=0;l<t;++l){let c=this.#t[l],d=this.#r[l];s.peak[l]=c,s.rms[l]=Math.sqrt(d),this.#t[l]=c*a,this.#r[l]=d*a}this.#n=0})}process([e]){for(let t=0;t<this.#e;++t){let o=e[t];if(o===void 0)this.#t[t]=0,this.#r[t]=0;else{let i=this.#i[t],n=this.#t[t],s=this.#r[t];for(let a=0;a<128;++a){let l=o[a];n=Math.max(n,Math.abs(l)),s=Math.max(s,i.pushPop(l*l))}this.#t[t]=n,this.#r[t]=s}}return this.#n++,this.#o.tryWrite(),!0}};var be=class r{static newSet(e){return new xl(e,r.Comparator)}static compose=(e,...t)=>{let o=t.length===0?this.#e:new Int16Array(t);return D(o.every((i,n)=>i===t[n]),`fieldKeys (${o.join(",")}) only allows i16`),new r(e,o)};static decode(e){let t=e.split("/");return D(t.length>0,"Unable to parse Address"),r.compose(b.parse(t[0]),...t.slice(1).map(o=>parseInt(o)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,o){let i=e.values(),n=et.leftMostMapped(i,t,b.Comparator,o),s=i.length;if(n<0||n>=s)return null;for(let a=n;a<s;a++)if(b.Comparator(o(i[a]),t)!==0)return n<a?[n,a]:null;return[n,s]}static Comparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);if(o!==0)return o;let i=Math.min(e.#r.length,t.#r.length);for(let n=0;n<i;n++){let s=e.#r[n]-t.#r[n];if(s!==0)return s}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);if(o!==0)return o;let i=Math.min(e.#r.length,t.#r.length);for(let n=0;n<i;n++){let s=e.#r[n]-t.#r[n];if(s!==0)return s}return 0};static LengthComparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);return o!==0?o: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 b.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,o)=>this.#r[o]===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(b.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,b.length),e.buffer}toString(){return[b.toString(this.#t),...this.#r].join("/")}static read(e){let t=b.fromDataInput(e),o=e.readByte();return r.compose(t,...C.create(()=>e.readShort(),o))}},Gs;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>be.Comparator(e,t),r.equals=(e,t)=>{let[o,i]=et.rangeMapped(t,e,be.Comparator,r.AddressReader);return t.slice(o,i+1)},r.startsWith=(e,t)=>{let[o,i]=et.rangeMapped(t,e,be.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>n.address.startsWith(e))},r.endsWith=(e,t)=>{let o=et.leftMostMapped(t,e,be.LengthComparator,r.AddressReader),i=et.rightMostMapped(t,e,be.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>e.startsWith(n.address))}})(Gs||(Gs={}));var mo=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(o=>o===e.pointerType)){let o=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${o}).`)}return m.None}#e;#t;constructor(e){this.#e=e,this.#t=new Ct}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let o=be.newSet(i=>i.address);return o.addMany(this.filter(...t)),o.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{o.add(i)&&e.onAdded(i)},onRemoved:i=>{o.removeByKey(i.address),e.onRemoved(i)}},...t)}filter(...e){return e.length===0?this.incoming():tt.filter(this.incoming().values(),t=>e.some(o=>o===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 F(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,o){return e.subscribe({onAdded:i=>{(o.length===0||o.some(n=>n===i.pointerType))&&t.onAdded(i)},onRemoved:i=>{(o.length===0||o.some(n=>n===i.pointerType))&&t.onRemoved(i)}})}};var Cb=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},El=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},K=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#o;constructor({parent:e,fieldKey:t,fieldName:o,pointerRules:i,deprecated:n}){this.#e=e,this.#t=t,this.#r=o,this.#i=i,this.#o=n,i.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return _(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#o}get pointerHub(){return new mo(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 C.empty()}record(){return zr.empty()}getField(e){return F()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return F("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)&&t.box.delete()})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};Cb([gl,El("design:type",mo),El("design:paramtypes",[])],K.prototype,"pointerHub",null);Cb([gl,El("design:type",be),El("design:paramtypes",[])],K.prototype,"address",null);Cb([gl,El("design:type",String),El("design:paramtypes",[])],K.prototype,"debugPath",null);var h=Object.freeze({mandatory:!1,accepts:[]});var Of=class r extends K{static create(e,t,o){return new r(e,t,o)}#e;constructor(e,t,o){super(e),this.#e=C.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:h,deprecated:e.deprecated}),o)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return C.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return re(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,o)=>this.#e[o].fromJSON(t));else return F("Type mismatch")}};var Mn;(function(r){r.writeFields=(t,o)=>{let i=Object.entries(o).filter(([n,s])=>!s.deprecated);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([n,s])=>{let a=Mt.create();s.write(a);let l=new Int8Array(a.toArrayBuffer());t.writeShort(Number(n)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,o)=>{D(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let n=0;n<i;n++){let s=t.readShort();if(fl(o[s]))continue;let a=t.readInt(),l=new Int8Array(a);t.readBytes(l);let{status:c,error:d}=Ho(()=>o[s]?.read(new ct(l.buffer)));c==="failure"&&console.warn(o,d)}}})(Mn||(Mn={}));var zN=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},yS=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},N=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#o;#n=r.Index++;constructor({uuid:e,graph:t,name:o,pointerRules:i}){this.#e=be.compose(e),this.#t=t,this.#r=o,this.#i=i,this.#o=this.initializeFields(),i.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return re(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return m.wrap(this.#o[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}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 creationIndex(){return this.#n}get pointerHub(){return new mo(this)}estimateMemory(){let e=new ml;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ie(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Mn.readFields(e,this.#o)}write(e){Mn.writeFields(e,this.#o)}serialize(){let e=Mt.create();return e.writeInt(this.#n),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=Mt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[t,o])=>{let i=o.toJSON();return Z(i)&&(e[t]=i),e},{})}fromJSON(e){if(mf(e))Object.entries(e).forEach(([t,o])=>{let i=this.#o[parseInt(t)];Z(o)&&i.fromJSON(o)});else return F("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return C.empty();let o=this.getField(t[0]),i=[e(o)];for(let n=1;n<t.length;n++)o=o.getField(t[n]),i.push(e(o));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 o=1;o<e.length;o++)if(t=t.unwrap().optField(e[o]),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(o=>o.toString()).join(`
|
|
2
|
+
`)),console.debug(" unstages",[...e].map(o=>o.toString()).join(`
|
|
3
|
+
`),this));for(let o of t)o.defer();for(let o of e)o.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(o=>o.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()}`}};zN([gl,yS("design:type",mo),yS("design:paramtypes",[])],N.prototype,"pointerHub",null);var bd;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(bd||(bd={}));var ke;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(ke||(ke={}));var Vf;(function(r){r.create=()=>new Tb})(Vf||(Vf={}));var Tb=class{#e=new wd(Gs.equals);#t=new wd(Gs.startsWith);#r=new wd(Gs.endsWith);#i=[];#o=0;#n=!1;subscribe(e,t,o){let i=new Rb(t,e,this.#o++,o);if(this.#n){let n=new Ob(i,e);return this.#i.push(n),n}else return this.subscribeMonitor(i,e)}dispatch(e){this.#n=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:o},{order:i})=>o-i).forEach(o=>o.procedure(e)),this.#n=!1,this.#i.forEach(o=>o.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case ke.This:return this.#e.subscribe(e);case ke.Parent:return this.#t.subscribe(e);case ke.Children:return this.#r.subscribe(e);default:return gf(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Rb=class{address;propagation;order;procedure;constructor(e,t,o,i){this.address=e,this.propagation=t,this.order=o,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${ke[this.propagation]}, order: ${this.order} }`}},wd=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(Gs.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Ob=class{monitor;propagation;#e=new O;#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 gt;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(gt||(gt={}));var Hs={[gt.Boolean]:{type:gt.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[gt.Float32]:{type:gt.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[gt.Int32]:{type:gt.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[gt.String]:{type:gt.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[gt.Bytes]:{type:gt.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},qs=class extends K{#e;#t;#r;constructor(e,t,o){super(e),this.#e=t,this.#t=o,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.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){D(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,o=this.clamp(e);this.equals(o)||(this.#r=o,this.graph.onPrimitiveValueUpdate(this,t,o))}writeValue(e,t){D(!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)?F("not implemented"):e}fromJSON(e){return F("Type mismatch")}reset(){this.setValue(this.#t)}},k=class r extends qs{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,gt.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Hs[gt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){D(!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()))}},A=class r extends qs{static create(e,t,o,i=0){return new r(e,t,o,i)}#e;#t;constructor(e,t,o,i){super(e,gt.Float32,i),this.#e=t,this.#t=o}serialization(){return Hs[gt.Float32]}equals(e){return this.getValue()===e}clamp(e){return bd.clampFloat32(this.#e,Xo.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){D(!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 qs{static create(e,t,o,i=0){return new r(e,t,o,i)}#e;#t;constructor(e,t,o,i){super(e,gt.Int32,i),this.#e=t,this.#t=o}serialization(){return Hs[gt.Int32]}equals(e){return this.getValue()===e}clamp(e){return bd.clampInt32(this.#e,lr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){D(!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>=lr.MIN_VALUE&&e<=lr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},$=class r extends qs{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,gt.String,t)}serialization(){return Hs[gt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){D(!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()))}},xS=class r extends qs{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,gt.Bytes,t)}serialization(){return Hs[gt.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){D(!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 bS;(function(r){r.decode=e=>{let t=e.readInt();return C.create(()=>{switch(e.readString()){case"new":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Ad(i,n,s.buffer)}case"pointer":{let i=be.read(e),n=e.readBoolean()?m.wrap(be.read(e)):m.None,s=e.readBoolean()?m.wrap(be.read(e)):m.None;return new Pd(i,n,s)}case"primitive":{let i=be.read(e),n=e.readString(),s=Hs[n],a=s.decode(e),l=s.decode(e);return new _d(i,s,a,l)}case"delete":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Sd(i,n,s.buffer)}}},t)}})(bS||(bS={}));var Ad=class{type="new";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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 ct(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),b.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${b.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},_d=class{type="primitive";#e;#t;#r;#i;constructor(e,t,o,i){this.#e=e,this.#t=t,this.#r=o,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}`}},Pd=class{type="pointer";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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()}`}},Sd=class{type="delete";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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 ct(this.#r)))}write(e){e.writeString(this.type),b.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${b.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var lR=Symbol("Unreferenceable"),B=class r extends K{static create(e,t,o){return new r(e,t,o)}static encodeWith(e,t){D(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let o=Ho(t);if(this.#e=m.None,o.status==="failure")throw o.error;return o.value}static decodeWith(e,t){D(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let o=Ho(t);if(this.#t=m.None,o.status==="failure")throw o.error;return o.value}static#e=m.None;static#t=m.None;#r;#i;#o=m.None;#n=m.None;constructor(e,t,o){super(e),this.#r=t,this.#i=o,o&&this.graph.edges().watchVertex(this)}get pointerHub(){return F(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return _(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.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.#n.flatMap(e=>this.graph.findVertex(e)):this.#o}set targetVertex(e){if(e.nonEmpty()){let t=mo.validate(this,e.unwrap());t.nonEmpty()&&F(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#n}set targetAddress(e){let t=this.#n;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#n=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.#o=e}read(e){let t=e.readBoolean()?m.wrap(be.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}write(e){D(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#n,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.#n,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Us(e)||typeof e=="string"){let t=m.wrap(Us(e)?null:be.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}else return F(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var zf=class{#e;#t;#r;#i;constructor(){this.#e=be.newSet(e=>e.address),this.#t=be.newSet(e=>e.address),this.#r=be.newSet(([e])=>e),this.#i=be.newSet(([e])=>e.address)}watchVertex(e){if(Ce(e,B)){if(!e.mandatory)return F("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return F("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:o}}})=>o;for(let{address:{uuid:o}}of e)this.#n(this.#e,o,t),this.#n(this.#t,o,t);for(let o of e){let i=this.outgoingEdgesOf(o);if(i.length>0)return F(`${o} has outgoing edges: ${i.map(([s,a])=>`[${s.toString()}, ${a.toString()}]`)}`);let n=this.incomingEdgesOf(o);if(n.length>0)return F(`${o} has incoming edges from: ${n.map(s=>s.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,o])=>o.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,o]=this.#r.get(t);C.remove(o,e),o.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,o])=>o.equals(t),!1)}outgoingEdgesOf(e){return this.#o(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,o])=>o):this.#r.opt(e.address).mapOr(([t,o])=>o,C.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?F(`Pointer ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?F(`Target ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)})}#o(e,t,o){let i=be.boxRange(e,t,o);return Z(i)?e.values().slice(i[0],i[1]):C.empty()}#n(e,t,o){let i=be.boxRange(e,t,o);Z(i)&&e.removeRange(i[0],i[1])}};var Js=class{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c=!1;#d=!1;constructor(e=m.None){this.#e=e,this.#t=b.newSet(t=>t.address.uuid),this.#r=[],this.#s=Vf.create(),this.#i=new Ct,this.#o=new Ct,this.#n=new Ct,this.#a=new zf,this.#l=be.newSet(({pointer:t})=>t.address),this.#u=[]}beginTransaction(){D(!this.#c,"Transaction already in progress"),this.#c=!0,this.#n.proxy.onBeginTransaction()}endTransaction(){for(D(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#l.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:o})=>{t.equals(o)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),o.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#l.clear(),this.#c=!1;this.#u.length>0;)this.#u.splice(0).forEach(e=>e()),this.#u.length>0&&console.debug(`${this.#u.length} new observers while notifying`);this.#n.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,o){return this.#e.unwrap("No box-factory installed")(e,this,t,o)}stageBox(e,t){this.#h(),D(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let o=this.#t.add(e);D(o,`${e} already staged`);let i=new Ad(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#n.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,t,o){return this.#s.subscribe(e,t,o)}subscribeEndTransaction(e){this.#u.push(e)}unstageBox(e){this.#h();let t=this.#t.removeByKey(e.address.uuid);D(t===e,`${e} could not be found to unstage`),this.#a.unwatchVerticesOf(e);let o=new Sd(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(o),this.#o.proxy.onUpdate(o)}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.#a}checksum(){let e=new bf;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,o){if(this.#h(),e.isAttached()&&!this.#d){let i=new _d(e.address,e.serialization(),t,o);this.#s.dispatch(i),this.#i.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,o){this.#h(),t.nonEmpty()&&this.#a.disconnect(e),o.nonEmpty()&&this.#a.connect(e,o.unwrap());let i=new Pd(e.address,t,o);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p(e,i),this.#o.proxy.onUpdate(i))}#p(e,t){let{oldAddress:o,newAddress:i}=t;e.resolvedTo(i.flatMap(s=>this.findVertex(s))),this.#l.opt(e.address).match({none:()=>this.#l.add({pointer:e,initial:o,final:i,index:this.#l.size()}),some:s=>s.final=i}),this.#s.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let o=Z(t.excludeBox)?t.excludeBox:Nn.alwaysFalse,i=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,n=new Set,s=new Set,a=l=>{n.has(l)||o(l)||(n.add(l),l.outgoingEdges().filter(([c])=>!s.has(c)).forEach(([c,d])=>{let p=this.findVertex(d).unwrap(`Could not find target of ${c.toString()}`);if(s.add(c),p.pointerRules.mandatory&&(i||p.pointerHub.incoming().every(f=>s.has(f))))return a(p.box)}),l.incomingEdges().forEach(c=>{s.add(c),c.mandatory&&a(c.box)}))};return a(e),n.delete(e),{boxes:n,pointers:Array.from(s).reverse()}}verifyPointers(){this.#a.validateRequirements();let e=0,t=o=>{for(let i of o.fields())i.accept({visitPointerField:n=>{if(n.targetAddress.nonEmpty()){let s=n.targetVertex.nonEmpty(),a=this.findVertex(n.targetAddress.unwrap()).nonEmpty();D(s,`pointer ${n.address} is broken`),D(a,`Cannot find target for pointer ${n.address}`),e++}},visitObjectField:n=>t(n)})};return this.#t.forEach(o=>t(o)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[b.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(o=>o.name):this.findBox(t.uuid).flatMap(o=>o.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:F("Unknown address"))))}toArrayBuffer(){let e=Mt.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(o=>{let i=o.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){D(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new ct(e),o=t.readInt();this.beginTransaction();let i=[];for(let n=0;n<o;n++){let s=t.readInt(),a=new Int8Array(s);t.readBytes(a);let l=new ct(a.buffer),c=l.readInt(),d=l.readString(),p=b.fromDataInput(l);i.push({creationIndex:c,name:d,uuid:p,boxStream:l})}i.sort((n,s)=>n.creationIndex-s.creationIndex).forEach(({name:n,uuid:s,boxStream:a})=>this.createBox(n,s,l=>l.read(a))),this.endTransaction()}toJSON(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:re(e.toJSON())}))}#h(){D(this.#c,()=>"Modification only prohibited in transaction mode.")}};var Bl;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let o=r.collectIndexedBoxes(e),i=ue(t,0,o.length);if(i<o.length)for(let n=i;n<o.length;n++)o[n].index.setValue(n+1);return i},r.removeOrder=(e,t)=>{let o=r.collectIndexedBoxes(e);if(t<o.length)for(let i=t+1;i<o.length;i++)o[i].index.setValue(i-1)},r.moveIndex=(e,t,o)=>{let i=r.collectIndexedBoxes(e),n=i[t];if(o<0){let s=ue(t+o,0,i.length-1);for(let a=s;a<t;a++)i[a].index.setValue(a+1);n.index.setValue(s)}else if(o>1){let s=ue(t+(o-1),0,i.length-1);for(let a=t;a<s;a++)i[a+1].index.setValue(a);n.index.setValue(s)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${o}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:o})=>r.isIndexedBox(o)&&(t===void 0||o instanceof t)?o:F(`${o} has no index field`)).sort((o,i)=>o.index.getValue()-i.index.getValue())})(Bl||(Bl={}));var Ue=class extends K{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return _(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return re(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Mn.readFields(e,this.#e)}write(e){Mn.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,o])=>(e[t]=o.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(mf(e))Object.entries(e).forEach(([t,o])=>{let i=this.#e[parseInt(t)];Z(o)&&i.fromJSON(o)});else return F("Type mismatch")}};var tn;(function(r){r.sender=(i,n)=>n(new t(i)),r.executor=(i,n)=>new o(i,n);let e=i=>{let n=[];for(let s of i)s instanceof MessagePort&&n.push(s),typeof ImageBitmap<"u"&&s instanceof ImageBitmap&&n.push(s),typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas&&n.push(s);return n};class t{#e;#t=new Map;#r;#i=0;constructor(n){this.#e=n,this.#r=n.subscribe(this.#o)}terminate(){this.#r.terminate()}dispatchAndForget=(n,...s)=>{let a=e(s);this.#e.send({type:"send",returnId:!1,func:n.name,args:Array.from(tt.map(s,l=>({value:l})))},a)};dispatchAndReturn=(n,...s)=>new Promise((a,l)=>{let c=tt.reduce(s,(p,f,g)=>(typeof f=="function"&&p.push([g,f]),p),[]);this.#t.set(this.#i,{executorTuple:{resolve:a,reject:l},callbacks:new Map(c)});let d=e(s);this.#e.send({type:"send",returnId:this.#i,func:n.name,args:Array.from(tt.map(s,(p,f)=>typeof p=="function"?{callback:f}:{value:p}))},d),this.#i++});#o=n=>{let s=this.#t.get(n.returnId);Z(s)?n.type==="resolve"?(s.executorTuple.resolve(n.resolve),this.#t.delete(n.returnId)):n.type==="reject"?(s.executorTuple.reject(n.reject),this.#t.delete(n.returnId)):n.type==="callback"&&s.callbacks?.get(n.funcAt).apply(this,n.args):F(`Promise has already been resolved. ${JSON.stringify(n)}`)}}class o{#e;#t;#r;constructor(n,s){this.#e=n,this.#t=s,this.#r=n.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=n=>{D(n.type==="send",()=>"Message type must be 'send'");let s=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),a=re(s[n.func],`${n.func.toString()} does not exists on ${this.#t}`),l=n.returnId;if(l===!1)a.apply(this.#t,n.args.map(c=>"value"in c?c.value:F(`${n.func.toString()} has no promise.`)));else try{a.apply(this.#t,n.args.map(d=>"callback"in d?(...p)=>this.#s(l,d.callback,p):d.value)).then(d=>{try{this.#o(l,d)}catch(p){this.#n(l,p)}},d=>this.#n(l,d))}catch(c){this.#n(l,c)}};#o=(n,s)=>this.#e.send({type:"resolve",returnId:n,resolve:s});#n=(n,s)=>this.#e.send({type:"reject",returnId:n,reject:s});#s=(n,s,a)=>this.#e.send({type:"callback",returnId:n,funcAt:s,args:a})}r.Executor=o})(tn||(tn={}));var wS={for:r=>new Vb(r)},UN=[],Vb=class{#e;#t=new ie;constructor(e){if(this.#e=e,Z(e.onmessage)||Z(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??UN)}channel(e){return new zb(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},zb=class r{#e;#t;#r=new ie;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(o=>{"__id__"in o&&o.__id__==="42"&&"message"in o&&"channel"in o&&o.channel===t&&this.#r.notify(o.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 Uf;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let o=e,i=()=>{--o<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(o=>setTimeout(o,e.millis(),...t)),r.event=(e,t)=>new Promise(o=>e.addEventListener(t,o,{once:!0})),r.observable=e=>new Promise(t=>{let o=e.subscribe(()=>{o.terminate(),t()})}),r.complete=e=>new Promise((t,o)=>{let i=setInterval(()=>{let{status:n,value:s,error:a}=Ho(()=>e.next());if(n==="success"){let{done:l,value:c}=s;l&&(clearInterval(i),t(c))}else clearInterval(i),o(a)},0)})})(Uf||(Uf={}));var Ub=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)}},jf;(function(r){class e{value;status="resolved";constructor(a){this.value=a}error=Ls("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(a){this.error=a}value=Ls("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(s,a)=>{let l=!0;return s.own(W.create(()=>l=!1)),new Promise((c,d)=>a.then(p=>{l&&c(p)},p=>{l&&d(p)}))},r.tryCatch=s=>s.then(a=>new e(a),a=>new t(a));let o=new Ub(3,hd.seconds(3));r.retry=(s,a=o)=>s().catch(l=>new Promise((c,d)=>{let p=f=>{a.retry(f,()=>s().then(g=>c(g),p))||d(f)};p(l)})),r.guardedRetry=(s,a)=>{let l=async(c=0)=>{try{return await s()}catch(d){if(a(d,++c))return console.debug(`retry after failure (online: ${navigator.onLine}):`,d),await Uf.timeSpan(hd.seconds(1)),l(c);throw new Error(`Failed after ${c} retries: ${d}`)}};return l()},r.approvedRetry=(s,a)=>{let l=async()=>{try{return await s()}catch(c){if(await bl.approve(a(c)))return l();throw c}};return l()},r.fail=(s,a)=>{let l=()=>new Promise((c,d)=>setTimeout(()=>d("fails first"),s.millis()));return()=>{let c=l();return l=a,c}},r.timeout=(s,a,l)=>new Promise((c,d)=>{let p=!0,f=setTimeout(()=>{p=!1,d(new Error(l??"timeout"))},a.millis());s.then(g=>{p&&c(g)},g=>{p&&d(g)}).finally(()=>clearTimeout(f))}),r.sequentialAll=s=>s.reduce((a,l)=>a.then(async c=>[...c,await l()]),Promise.resolve([])),r.sequentialize=s=>{let a=Promise.resolve();return l=>{let c=()=>s(l),d=a.then(c,c);return a=d.catch(()=>{}),d}},r.memoizeAsync=(s,a)=>{let l=null,c=Date.now();return()=>{let d=Date.now();return(Us(l)||Z(a)&&d-c>a.millis())&&(c=d,l=s(),l.catch(p=>(l=null,p))),l}},r.allWithLimit=async(s,a=1)=>{let l=new Array(s.length),c=0,d=!1,p=async()=>{for(;c<s.length&&!d;){let f=c++;try{let g=await s[f]();d||(l[f]=g)}catch(g){throw d=!0,g}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},p)),l},r.allSettledWithLimit=async(s,a=1)=>{let l=new Array(s.length),c=0,d=async()=>{for(;c<s.length;){let p=c++;try{let f=await s[p]();l[p]={status:"fulfilled",value:f}}catch(f){l[p]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},d)),l};class i{max;#e;#t=0;constructor(a=1){this.max=a,this.#e=[]}async add(a){if(this.#t<this.max)return this.#t++,a().finally(()=>this.#r());{let l=Promise.withResolvers();return this.#e.push([a,l]),l.promise.finally(()=>this.#r())}}#r(){if(D(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[a,{resolve:l,reject:c}]=this.#e.shift();this.#t++,a().then(l,c)}}}r.Limit=i;class n{#e;#t;#r;#i=m.None;constructor(a,l,c){this.#e=a,this.#t=l,this.#r=c}update(a){this.#i=m.wrap(a),a.then(l=>{this.#i.contains(a)&&this.#e(l)}).catch(l=>{this.#i.contains(a)&&this.#t(l)}).finally(()=>{this.#i.contains(a)&&(this.terminate(),_(this.#r))})}terminate(){this.#i=m.None}}r.Latest=n})(jf||(jf={}));var AS=(r,e)=>tn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(o=>{let i=o.type;i==="new"?r.createBox(o.name,o.uuid,n=>n.read(new ct(o.buffer))):i==="update-primitive"?r.findVertex(be.reconstruct(o.address)).unwrap(()=>`Could not find primitive field ${o.address}`).setValue(o.value):i==="update-pointer"?r.findVertex(be.reconstruct(o.address)).unwrap(()=>`Could not find pointer field ${o.address}`).targetAddress=Z(o.target)?m.wrap(be.reconstruct(o.target)):m.None:o.type==="delete"&&r.unstageBox(r.findBox(o.uuid).unwrap(()=>`Could not find box ${b.toString(o.uuid)}`))}),r.endTransaction()}checksum(t){return C.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var Lf=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 _S;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(_S||(_S={}));var PS;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(PS||(PS={}));var Bt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Bt||(Bt={}));var Fl={white:new St(0,0,100),blue:new St(189,100,65),green:new St(150,77,69),yellow:new St(60,100,84),cream:new St(65,20,83),orange:new St(31,100,73),red:new St(354,100,65),purple:new St(314,100,78),bright:new St(197,0,100),gray:new St(197,31,85),dark:new St(197,15,57),shadow:new St(197,10,38),black:new St(197,10,14),background:new St(197,6,5),panelBackground:new St(197,14,7),panelBackgroundBright:new St(197,14,10),panelBackgroundDark:new St(197,14,6)};var De;(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.Bug=11]="Bug",r[r.Fold=12]="Fold",r[r.Checkbox=13]="Checkbox",r[r.Clips=14]="Clips",r[r.Close=15]="Close",r[r.CloudFolder=16]="CloudFolder",r[r.CollapseDown=17]="CollapseDown",r[r.Compressor=18]="Compressor",r[r.Connected=19]="Connected",r[r.Cube=20]="Cube",r[r.Cursor=21]="Cursor",r[r.Curve=22]="Curve",r[r.Dattorro=23]="Dattorro",r[r.Delete=24]="Delete",r[r.Dial=25]="Dial",r[r.DinSlot=26]="DinSlot",r[r.Disconnected=27]="Disconnected",r[r.Divide=28]="Divide",r[r.DragConnections=29]="DragConnections",r[r.Dropdown=30]="Dropdown",r[r.Dropbox=31]="Dropbox",r[r.DrumSet=32]="DrumSet",r[r.Tidal=33]="Tidal",r[r.Duration=34]="Duration",r[r.EditBox=35]="EditBox",r[r.Effects=36]="Effects",r[r.Embed=37]="Embed",r[r.EQ=38]="EQ",r[r.Eraser=39]="Eraser",r[r.Exclude=40]="Exclude",r[r.Exit=41]="Exit",r[r.ExpandWidth=42]="ExpandWidth",r[r.FileList=43]="FileList",r[r.Flask=44]="Flask",r[r.Focus=45]="Focus",r[r.Generator=46]="Generator",r[r.GoogleDrive=47]="GoogleDrive",r[r.Groove=48]="Groove",r[r.Guitar=49]="Guitar",r[r.GuitarTab=50]="GuitarTab",r[r.Headphone=51]="Headphone",r[r.Heart=52]="Heart",r[r.Help=53]="Help",r[r.HighPass=54]="HighPass",r[r.HighShelf=55]="HighShelf",r[r.Insert=56]="Insert",r[r.Invert=57]="Invert",r[r.Loop=58]="Loop",r[r.LowPass=59]="LowPass",r[r.LowShelf=60]="LowShelf",r[r.Magnet=61]="Magnet",r[r.MainMenu=62]="MainMenu",r[r.Maximized=63]="Maximized",r[r.Menu=64]="Menu",r[r.Merge=65]="Merge",r[r.Metronome=66]="Metronome",r[r.Microphone=67]="Microphone",r[r.Midi=68]="Midi",r[r.Minimized=69]="Minimized",r[r.Mix=70]="Mix",r[r.Mixing=71]="Mixing",r[r.Mute=72]="Mute",r[r.NanoWave=73]="NanoWave",r[r.New=74]="New",r[r.NoAudio=75]="NoAudio",r[r.Note=76]="Note",r[r.NotePad=77]="NotePad",r[r.OpenDAW=78]="OpenDAW",r[r.Panel=79]="Panel",r[r.Peak=80]="Peak",r[r.Pencil=81]="Pencil",r[r.Piano=82]="Piano",r[r.Play=83]="Play",r[r.Playfield=84]="Playfield",r[r.PlayOnce=85]="PlayOnce",r[r.PlayRepeat=86]="PlayRepeat",r[r.PlayAlternate=87]="PlayAlternate",r[r.Pointer=88]="Pointer",r[r.Popout=89]="Popout",r[r.Primary=90]="Primary",r[r.Random=91]="Random",r[r.Record=92]="Record",r[r.Rectangle=93]="Rectangle",r[r.Region=94]="Region",r[r.Robot=95]="Robot",r[r.RoundDown=96]="RoundDown",r[r.RoundUp=97]="RoundUp",r[r.Run=98]="Run",r[r.Sawtooth=99]="Sawtooth",r[r.Saxophone=100]="Saxophone",r[r.Scissors=101]="Scissors",r[r.Search=102]="Search",r[r.Shadertoy=103]="Shadertoy",r[r.Sine=104]="Sine",r[r.Solo=105]="Solo",r[r.SoundFont=106]="SoundFont",r[r.SpeakerHeadphone=107]="SpeakerHeadphone",r[r.Square=108]="Square",r[r.Stack=109]="Stack",r[r.Start=110]="Start",r[r.Stereo=111]="Stereo",r[r.Stop=112]="Stop",r[r.Subtract=113]="Subtract",r[r.Sun=114]="Sun",r[r.Swap=115]="Swap",r[r.System=116]="System",r[r.Table=117]="Table",r[r.Tape=118]="Tape",r[r.TapeReel=119]="TapeReel",r[r.Time=120]="Time",r[r.Timeline=121]="Timeline",r[r.Tool=122]="Tool",r[r.Triangle=123]="Triangle",r[r.Unknown=124]="Unknown",r[r.UserFolder=125]="UserFolder",r[r.Velocity=126]="Velocity",r[r.Vinyl=127]="Vinyl",r[r.VUMeter=128]="VUMeter",r[r.Waveform=129]="Waveform",r[r.Zeitgeist=130]="Zeitgeist"})(De||(De={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(De||(De={}));var u;(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.SoundfontFile=41]="SoundfontFile",r[r.StepAutomation=42]="StepAutomation",r[r.Timeline=43]="Timeline",r[r.TrackCollection=44]="TrackCollection",r[r.TransientMarkers=45]="TransientMarkers",r[r.User=46]="User",r[r.ValueEventCollection=47]="ValueEventCollection",r[r.ValueEvents=48]="ValueEvents",r[r.ValueInterpolation=49]="ValueInterpolation",r[r.VoltageConnection=50]="VoltageConnection",r[r.WarpMarkers=51]="WarpMarkers"})(u||(u={}));var Cn;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(Cn||(Cn={}));var go;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(go||(go={}));var SS=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?F(`Indices cannot be equal (${r}, ${e})`):t};var rn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Kt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Kf,Ri,Tn,Wf,on,Wt=class r{static create(e,t,o){return new r(e,t,o)}constructor(e,t,o){Kf.set(this,void 0),Ri.set(this,void 0),Tn.set(this,void 0),Wf.set(this,void 0),on.set(this,null),rn(this,Kf,e,"f"),rn(this,Ri,b.newSet(i=>i.adapter.uuid),"f"),rn(this,Tn,new Ct,"f"),rn(this,Wf,e.pointerHub.catchupAndSubscribe({onAdded:i=>{rn(this,on,null,"f");let n=t(i.box),s=n.indexField.subscribe(()=>{rn(this,on,null,"f"),Kt(this,Tn,"f").proxy.onReorder(n)}),a=Kt(this,Ri,"f").add({adapter:n,subscription:s});D(a,`Could not add ${n}`),Kt(this,Tn,"f").proxy.onAdd(n)},onRemoved:i=>{rn(this,on,null,"f");let n=i.box.address.uuid,{adapter:s,subscription:a}=Kt(this,Ri,"f").removeByKey(n);a.terminate(),Kt(this,Tn,"f").proxy.onRemove(s)}},o),"f")}field(){return Kt(this,Kf,"f")}subscribe(e){return Kt(this,Tn,"f").subscribe(e)}catchupAndSubscribe(e){return Kt(this,Ri,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=et.exactMapped(this.adapters(),e,SS,o=>o.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return Kt(this,Ri,"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 Kt(this,on,"f")===null&&rn(this,on,Kt(this,Ri,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Kt(this,on,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let o=this.adapters(),i=o[e];if(t<0){let n=ue(e+t,0,o.length-1);for(let s=n;s<e;s++)o[s].indexField.setValue(s+1);i.indexField.setValue(n)}else if(t>1){let n=ue(e+(t-1),0,o.length-1);for(let s=e;s<n;s++)o[s+1].indexField.setValue(s);i.indexField.setValue(n)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return Kt(this,Ri,"f").size()}isEmpty(){return this.size()===0}terminate(){rn(this,on,null,"f"),Kt(this,Ri,"f").forEach(({subscription:e})=>e.terminate()),Kt(this,Ri,"f").clear(),Kt(this,Tn,"f").terminate(),Kt(this,Wf,"f").terminate()}};Kf=new WeakMap,Ri=new WeakMap,Tn=new WeakMap,Wf=new WeakMap,on=new WeakMap;var Qs;(function(r){r.create=(e,t,o,i)=>{switch(e){case"MetaDataBox":return nn.create(t,o,i);case"RootBox":return Nl.create(t,o,i);case"SelectionBox":return vo.create(t,o,i);case"UserInterfaceBox":return Xs.create(t,o,i);case"UploadFileBox":return Zf.create(t,o,i);case"ShadertoyBox":return Gf.create(t,o,i);case"MIDIControllerBox":return qf.create(t,o,i);case"TimelineBox":return Ys.create(t,o,i);case"TrackBox":return dr.create(t,o,i);case"NoteEventBox":return Rn.create(t,o,i);case"NoteEventRepeatBox":return Hf.create(t,o,i);case"NoteEventCollectionBox":return sn.create(t,o,i);case"NoteRegionBox":return ea.create(t,o,i);case"NoteClipBox":return Il.create(t,o,i);case"ValueEventBox":return On.create(t,o,i);case"ValueEventCollectionBox":return an.create(t,o,i);case"ValueEventCurveBox":return Vn.create(t,o,i);case"ValueRegionBox":return ta.create(t,o,i);case"ValueClipBox":return kl.create(t,o,i);case"AudioRegionBox":return zn.create(t,o,i);case"AudioClipBox":return $l.create(t,o,i);case"AudioPitchStretchBox":return Dl.create(t,o,i);case"AudioTimeStretchBox":return Ml.create(t,o,i);case"TransientMarkerBox":return Cl.create(t,o,i);case"WarpMarkerBox":return Un.create(t,o,i);case"MarkerBox":return Tl.create(t,o,i);case"AudioFileBox":return pr.create(t,o,i);case"SoundfontFileBox":return Er.create(t,o,i);case"AudioUnitBox":return st.create(t,o,i);case"CaptureAudioBox":return jn.create(t,o,i);case"CaptureMidiBox":return Ln.create(t,o,i);case"AudioBusBox":return Oi.create(t,o,i);case"AuxSendBox":return ra.create(t,o,i);case"GrooveShuffleBox":return Rl.create(t,o,i);case"UnknownAudioEffectDeviceBox":return Jf.create(t,o,i);case"UnknownMidiEffectDeviceBox":return Qf.create(t,o,i);case"DeviceInterfaceKnobBox":return Xf.create(t,o,i);case"ModularDeviceBox":return Yf.create(t,o,i);case"StereoToolDeviceBox":return em.create(t,o,i);case"CompressorDeviceBox":return Ol.create(t,o,i);case"DelayDeviceBox":return tm.create(t,o,i);case"CrusherDeviceBox":return rm.create(t,o,i);case"DattorroReverbDeviceBox":return im.create(t,o,i);case"VelocityDeviceBox":return om.create(t,o,i);case"FoldDeviceBox":return nm.create(t,o,i);case"TidalDeviceBox":return sm.create(t,o,i);case"RevampDeviceBox":return am.create(t,o,i);case"ReverbDeviceBox":return lm.create(t,o,i);case"VaporisateurDeviceBox":return Vl.create(t,o,i);case"MIDIOutputDeviceBox":return zl.create(t,o,i);case"MIDIOutputBox":return Vi.create(t,o,i);case"MIDIOutputParameterBox":return zi.create(t,o,i);case"SoundfontDeviceBox":return Ul.create(t,o,i);case"NanoDeviceBox":return jl.create(t,o,i);case"PlayfieldDeviceBox":return Ll.create(t,o,i);case"PlayfieldSampleBox":return Kn.create(t,o,i);case"TapeDeviceBox":return Kl.create(t,o,i);case"ArpeggioDeviceBox":return um.create(t,o,i);case"PitchDeviceBox":return cm.create(t,o,i);case"ZeitgeistDeviceBox":return dm.create(t,o,i);case"ModularBox":return pm.create(t,o,i);case"ModuleConnectionBox":return hm.create(t,o,i);case"ModularAudioInputBox":return fm.create(t,o,i);case"ModularAudioOutputBox":return mm.create(t,o,i);case"ModuleDelayBox":return gm.create(t,o,i);case"ModuleMultiplierBox":return vm.create(t,o,i);case"ModuleGainBox":return ym.create(t,o,i);default:return F(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let o=new ct(t),i=o.readString(),n=b.fromDataInput(o),s=r.create(i,e,n);return s.read(o),s}})(Qs||(Qs={}));var nn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:h}),o)}static ClassName="MetaDataBox";constructor(e){super(e)}accept(e){return _(e.visitMetaDataBox,this)}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:h},u.MetaData,!0),2:$.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:h})}}};var xm=class r extends Ue{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:h},{length:4},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:h},{min:1,max:64,scaling:"linear"},"",8),3:A.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:h},{min:.5,max:2,scaling:"linear"},"",1),4:k.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:h},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:h},{min:-48,max:48},"st",0)}}};var Nl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:h}),o)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return _(e.visitRootBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:h},u.Timeline,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[u.User],mandatory:!0}}),3:$.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:h}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[u.AudioUnits],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[u.AudioBusses],mandatory:!1}}),30:K.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!0}}),35:K.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!1}}),40:xm.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:h}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:h},u.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:h},u.Editing,!1)}}};var vo=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:h}),o)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return _(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:h},u.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:h},u.Selection,!0)}}};var Xs=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[u.MetaData],mandatory:!1}}),o)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return _(e.visitUserInterfaceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.User,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[u.Selection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[u.FileUploadState],mandatory:!1}}),21:B.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:h},u.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:h},u.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:h},u.Editing,!1),30:K.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[u.MIDIControllers],mandatory:!1}})}}};var Zf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:h}),o)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return _(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:h},u.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.FileUploadState,!0)}}};var Gf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[u.Shadertoy],mandatory:!0}}),o)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return _(e.visitShadertoyBox,this)}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:h}),2:k.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:h},!0)}}};var qf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIControllerBox",pointerRules:h}),o)}static ClassName="MIDIControllerBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIControllerBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:h},u.MIDIControllers,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},u.MIDIControl,!0),3:$.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:h}),4:E.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:h},{min:0,max:127},""),5:E.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:h},{min:0,max:127},"")}}};var bm=class r extends Ue{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:h},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4)}}};var wm=class r extends Ue{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:h},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:h},"any","ppqn",15360)}}};var Am=class r extends Ue{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:K.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0)}}};var Ys=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:h}),o)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return _(e.visitTimelineBox,this)}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 durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[u.Timeline],mandatory:!0}}),10:bm.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:h}),11:wm.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:h}),20:K.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),21:Am.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:h}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:h},"positive","ppqn",491520),31:A.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:h},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var dr=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[u.Selection,u.PianoMode,u.MetaData],mandatory:!1}}),o)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return _(e.visitTrackBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:h},u.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:h},u.Automation,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[u.RegionCollection],mandatory:!1}}),4:K.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[u.ClipCollection],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:h},{values:[0,1,2,3]},""),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),30:k.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:h},!1)}}};var Rn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[u.Selection,u.NoteEventFeature],mandatory:!1}}),o)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),21:A.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:h},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),23:A.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:h},"bipolar","%",0),24:A.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:h},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:h},{min:0,max:100},"",100)}}};var Hf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:h}),o)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventRepeatBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),3:A.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:h},"bipolar","%",0),4:A.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:h},"unipolar","%",1)}}};var sn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.NoteEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.NoteEventCollection],mandatory:!0}})}}};var ea=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:h},"any","ppqn"),15:k.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:h}),16:$.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:h}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Wn=class r extends Ue{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:k.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:h},!0),2:k.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:h}),3:k.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:h}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:h},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:h},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:h},"non-negative","")}}};var Il=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return _(e.visitNoteClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Wn.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:$.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var On=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[u.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:A.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:h},"unipolar","%"),14:A.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:h},"any","",NaN)}}};var an=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.ValueEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.ValueEventCollection],mandatory:!0}})}}};var Vn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:h}),o)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.ValueInterpolation,!0),2:A.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:h},"unipolar","%",.5)}}};var ta=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return _(e.visitValueRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:$.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var kl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return _(e.visitValueClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Wn.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:$.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var zn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return _(e.visitAudioRegionBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:$.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:A.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"any","mixed"),12:A.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","mixed"),13:A.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"any","mixed"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:$.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db")}}};var $l=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),o)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return _(e.visitAudioClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Wn.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:A.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:$.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),14:A.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db"),20:$.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:h}),21:$.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical")}}};var Dl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),o)}static ClassName="AudioPitchStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioPitchStretchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}})}}};var Ml=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),o)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioTimeStretchBox,this)}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:h},"positive","enum",2),3:A.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:h},"positive","ratio",1)}}};var Cl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.TransientMarkers,!0),2:A.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var Un=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:A.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var Tl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return _(e.visitMarkerBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:h},u.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:h},"non-negative","",1),4:$.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var pr=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[u.AudioFile,u.FileUploadState,u.MetaData],mandatory:!0}}),o)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return _(e.visitAudioFileBox,this)}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:A.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),2:A.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),3:$.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[u.TransientMarkers],mandatory:!1}})}}};var Er=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[u.SoundfontFile],mandatory:!0}}),o)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:h})}}};var st=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[u.Selection,u.Automation,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return _(e.visitAudioUnitBox,this)}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:$.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:h},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioUnits,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:A.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:A.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[u.TrackCollection],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MIDIEffectHost],mandatory:!1}}),22:K.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.InstrumentHost,u.AudioOutput],mandatory:!1}}),23:K.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),24:K.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[u.AuxSend],mandatory:!1}}),25:B.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:h},u.Capture,!1)}}};var jn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),o)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureAudioBox,this)}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:$.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:$.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:h},"any","",1),11:A.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:h},"decibel","dB",0)}}};var Ln=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),o)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:$.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:h},"any","",-1)}}};var Oi=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:{accepts:[u.SideChain],mandatory:!1}}),o)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return _(e.visitAudioBusBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!1}}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:h}),6:$.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:h}),7:$.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:h},"red"),8:k.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:h})}}};var ra=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:{accepts:[u.SideChain],mandatory:!1}}),o)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return _(e.visitAuxSendBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:h},u.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1),5:A.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB"),6:A.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","")}}};var Rl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[u.Groove],mandatory:!0}}),o)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return _(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:h}),10:A.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"non-negative","ppqn",480)}}};var Jf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownAudioEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:$.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Qf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownMidiEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:$.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Xf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:h}),o)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return _(e.visitDeviceInterfaceKnobBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:h},u.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},u.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),10:A.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:h},"unipolar","%"),11:$.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:h})}}};var _m=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[u.DeviceUserInterface],mandatory:!1}})}}};var Yf=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitModularDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:h},u.ModularSetup,!0),11:_m.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:h})}}};var em=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitStereoToolDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:A.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),13:k.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1)}}};var Ol=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCompressorDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},!1),11:k.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},!0),12:k.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},!1),13:k.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},!1),14:A.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:A.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:A.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:A.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:A.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:A.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:A.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:A.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1),30:B.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:h},u.SideChain,!1)}}};var tm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDelayDeviceBox,this)}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 delay(){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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"any","",4),11:A.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),12:A.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),14:A.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",-6),15:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var rm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCrusherDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",0),11:E.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1,max:16},"bits",16),12:A.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:A.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var im=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDattorroReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:A.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.9999),12:A.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.75),13:A.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.625),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.75),15:A.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.7),16:A.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),17:A.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.005),18:A.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),19:A.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.7),20:A.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",-6),21:A.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var om=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVelocityDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:h},"any","",2048),13:A.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%"),14:A.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),15:A.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var nm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitFoldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:h},{length:3},"",0),12:A.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var sm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTidalDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",-.25),11:A.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),20:A.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",3),21:A.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","",1),22:A.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:A.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var Ed=class r extends Ue{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{length:4},""),12:A.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Bd=class r extends Ue{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:A.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var Wl=class r extends Ue{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:A.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:A.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var am=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitRevampDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Ed.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:h}),11:Bd.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:h}),12:Wl.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:h}),13:Wl.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:h}),14:Wl.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:h}),15:Bd.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:h}),16:Ed.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:h}),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var lm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:A.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",.5),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%",0),14:A.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var Pm=class r extends Ue{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:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:A.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","db",-1/0),3:E.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:A.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var Sm=class r extends Ue{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:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:A.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:k.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},!1),10:A.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%")}}};var Em=class r extends Ue{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:A.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:A.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:A.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:A.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","db",.001)}}};var Vl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVaporisateurDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"any","oct"),12:A.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"any",""),14:A.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:A.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:A.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:A.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:A.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%"),19:A.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:A.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1),21:A.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{values:[0,1]},"",1),23:E.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{values:[1,3,5]},"",1),24:A.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:A.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1),26:E.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:A.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","%"),30:Sm.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:h}),40:Of.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:h},e=>Pm.create(e),2),50:Em.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:h}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:h},"any","")}}};var Bm=class r extends Ue{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:$.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:h}),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h})}}};var zl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Bm.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:h}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:h},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:h},"any","ms",10),13:K.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[u.Parameter],mandatory:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:h},u.MIDIDevice,!1)}}};var Vi=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:h}),o)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.MIDIDevice,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!0}}),3:$.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:h},{min:0,max:500},"ms",10),6:k.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:h},!0)}}};var zi=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:h}),o)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputParameterBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.Parameter,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:h},{min:0,max:127},"#",64),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!0}},"unipolar","%")}}};var Ul=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:h},u.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:h},{min:0,max:65535},"")}}};var jl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitNanoDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!1),20:A.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Ll=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain],mandatory:!1}}),o)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:K.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[u.Sample],mandatory:!1}})}}};var Kn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[u.Editing,u.SideChain],mandatory:!1}}),o)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldSampleBox,this)}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:B.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:h},u.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),12:K.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MIDIEffectHost],mandatory:!1}}),13:K.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),20:$.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:h}),21:$.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:h}),22:k.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),23:k.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),40:k.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:h}),41:k.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:h}),42:k.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:h}),43:k.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:h}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:h},{length:3},"",0),45:A.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:A.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",0),47:A.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%",1),48:A.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:A.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var Kl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.SideChain,u.Automation],mandatory:!1}}),o)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTapeDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:A.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%"),13:A.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"unipolar","%")}}};var um=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitArpeggioDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{length:3},"",0),11:E.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1,max:5},"oct",1),12:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{length:17},"",9),13:A.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:E.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:1,max:16},"",1),15:A.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},"bipolar","",0)}}};var cm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPitchDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-36,max:36},"st",0),11:A.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:E.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MIDIControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var dm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),o)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitZeitgeistDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MIDIEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:$.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0)}}};var pm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:h}),o)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return _(e.visitModularBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModularSetup,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!0}}),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[u.ModuleCollection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[u.ConnectionCollection],mandatory:!1}}),13:$.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:h})}}};var hm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:h}),o)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return _(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:h},u.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:h},u.VoltageConnection,!0)}}};var si=class r extends Ue{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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModuleCollection,!0),2:$.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:h},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:h},"any","y"),5:k.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:h},!1),6:k.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:h},!0)}}};var fm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:si.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var mm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:si.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var gm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return _(e.visitModuleDelayBox,this)}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:si.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var vm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return _(e.visitModuleMultiplierBox,this)}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:si.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:h},"unipolar","%")}}};var ym=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return _(e.visitModuleGainBox,this)}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:si.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},"decibel","dB")}}};var yo;(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 o=e.pointerHub.filter(u.ValueInterpolation).at(0)?.box;Z(o)?(yb(o,Vn),o.slope.setValue(t.slope)):Vn.create(e.box.graph,b.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(yb(t,Vn),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?Dn.None:e.getValue()===1?Dn.Linear:F("Unknown Interpolation value")}})(yo||(yo={}));var Zn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Te=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Fd,Zl,pt,Nd,Gn,Id,ln=class r{constructor(e,t){this.type="value-event",Fd.set(this,new O),Zl.set(this,void 0),pt.set(this,void 0),Nd.set(this,void 0),Gn.set(this,void 0),Id.set(this,!1),Zn(this,Zl,e,"f"),Zn(this,pt,t,"f"),Zn(this,Nd,Te(this,Fd,"f").own(new vf(()=>yo.read(Te(this,pt,"f").interpolation))),"f");let o=()=>{Te(this,Nd,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Te(this,Fd,"f").ownAll(Te(this,pt,"f").subscribe(ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),s=i.address.fieldKeys,a=C.equals(Te(this,pt,"f").index.address.fieldKeys,s),l=C.equals(Te(this,pt,"f").position.address.fieldKeys,s);a||l?n.requestSorting():n.onEventPropertyChanged()}}),Te(this,pt,"f").interpolation.subscribe(o),Te(this,pt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Te(this,Gn,"f").terminate(),Zn(this,Gn,i.subscribe(ke.Children,o),"f"),o()},onRemoved:()=>{Te(this,Gn,"f").terminate(),Zn(this,Gn,W.Empty,"f"),o()}})),Zn(this,Gn,Te(this,pt,"f").interpolation.pointerHub.filter(u.ValueInterpolation).at(0)?.box.subscribe(ke.Children,o)??W.Empty,"f")}onSelected(){Zn(this,Id,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Zn(this,Id,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Te(this,Gn,"f").terminate(),Te(this,Fd,"f").terminate()}get box(){return Te(this,pt,"f")}get uuid(){return Te(this,pt,"f").address.uuid}get address(){return Te(this,pt,"f").address}get position(){return Te(this,pt,"f").position.getValue()}get index(){return Te(this,pt,"f").index.getValue()}set interpolation(e){yo.write(Te(this,pt,"f").interpolation,e)}get interpolation(){return Te(this,Nd,"f").get()}get value(){return Te(this,pt,"f").value.getValue()}get isSelected(){return Te(this,Id,"f")}get collection(){return Te(this,pt,"f").events.targetVertex.map(e=>Te(this,Zl,"f").boxAdapters.adapterFor(e.box,hr))}copyTo(e){let t=On.create(Te(this,Zl,"f").boxGraph,b.generate(),o=>{o.position.setValue(e?.position??this.position),o.index.setValue(e?.index??this.index),o.events.refer(e?.events??this.collection.unwrap().box.events),o.value.setValue(e?.value??this.value)});return yo.write(t.interpolation,e?.interpolation??this.interpolation),Te(this,Zl,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Te(this,pt,"f").position.setValue(e?.position??this.position),Te(this,pt,"f").index.setValue(e?.index??this.index),Te(this,pt,"f").events.refer(e?.events??this.collection.unwrap().box.events),Te(this,pt,"f").value.setValue(e?.value??this.value),yo.write(Te(this,pt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Fd=new WeakMap,Zl=new WeakMap,pt=new WeakMap,Nd=new WeakMap,Gn=new WeakMap,Id=new WeakMap;ln.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let o=r.index-e.index;if(o!==0)return o;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var kd=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Re=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},$d,Dd,qn,ai,ia,Md,un,Fm,hr=class r{constructor(e,t){$d.add(this),Dd.set(this,new O),qn.set(this,void 0),ai.set(this,void 0),ia.set(this,void 0),Md.set(this,void 0),un.set(this,void 0),kd(this,qn,e,"f"),kd(this,ai,t,"f"),kd(this,ia,new ie,"f"),kd(this,Md,b.newSet(i=>i.uuid),"f"),kd(this,un,Sr.create(ln.Comparator),"f");let o=i=>{let n=re(i.accept({visitValueEventBox:s=>Re(this,qn,"f").boxAdapters.adapterFor(s,ln)}),`Could not find adapter for ${i}`);Re(this,Md,"f").add(n)&&(Re(this,un,"f").add(n),Re(this,$d,"m",Fm).call(this))};Re(this,ai,"f").events.pointerHub.incoming().forEach(({box:i})=>o(i)),Re(this,Dd,"f").own(Re(this,ai,"f").events.pointerHub.subscribe({onAdded:({box:i})=>o(i),onRemoved:({box:{address:{uuid:i}}})=>{Re(this,un,"f").remove(Re(this,Md,"f").removeByKey(i)),Re(this,$d,"m",Fm).call(this)}})),Re(this,Dd,"f").own(Re(this,ai,"f").owners.pointerHub.subscribe({onAdded:()=>Re(this,ia,"f").notify(this),onRemoved:()=>Re(this,ia,"f").notify(this)}))}valueAt(e,t){return Tf.valueAt(Re(this,un,"f"),e,t)}copy(){let e=Re(this,qn,"f").boxGraph,t=an.create(e,b.generate());return Re(this,un,"f").asArray().forEach(o=>o.copyTo({events:t.events})),Re(this,qn,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),o=this.events.greaterEqual(e);if(o===null)return t===null?m.None:m.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return m.wrap(this.createEvent({position:e,value:o.value,index:o.index,interpolation:o.interpolation}));if(t.position===e)return m.wrap(t);if(t.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:i,value:n}=t,{position:s,value:a}=o;return m.wrap(this.createEvent({position:e,value:yf(n,a,(e-i)/(s-i)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:i,value:n}=t,{position:s,value:a}=o,l=s-i,c=e-i,d=oi.byHalf(l,n,oi.valueAt({slope:t.interpolation.slope,steps:l,y0:n,y1:a},l*.5),a),p=oi.valueAt(d,c),f=oi.slopeByHalf(n,oi.valueAt(d,c*.5),p);return yo.write(t.box.interpolation,Dn.Curve(f)),m.wrap(this.createEvent({position:e,value:p,index:0,interpolation:Dn.Curve(oi.slopeByHalf(p,oi.valueAt(d,(c+l)*.5),a))}))}return F("Unknown interpolation type")}subscribeChange(e){return Re(this,ia,"f").subscribe(e)}createEvent({position:e,index:t,value:o,interpolation:i}){let n=On.create(Re(this,qn,"f").boxGraph,b.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(o),s.events.refer(Re(this,ai,"f").events)});return yo.write(n.interpolation,i),Re(this,qn,"f").boxAdapters.adapterFor(n,ln)}requestSorting(){Re(this,un,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Re(this,$d,"m",Fm).call(this)}terminate(){Re(this,Dd,"f").terminate()}get box(){return Re(this,ai,"f")}get uuid(){return Re(this,ai,"f").address.uuid}get address(){return Re(this,ai,"f").address}get numOwners(){return Re(this,ai,"f").owners.pointerHub.filter(u.ValueEventCollection).length}get events(){return Re(this,un,"f")}toString(){return`{ValueEventCollectionBox ${b.toString(Re(this,ai,"f").address.uuid)}}`}};Dd=new WeakMap,qn=new WeakMap,ai=new WeakMap,ia=new WeakMap,Md=new WeakMap,un=new WeakMap,$d=new WeakSet,Fm=function(){Re(this,ia,"f").notify(this)};var oa=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},na,Hn,sa,Ft,aa,Rd,Cd,Td,Gl,Jn=class{constructor(e,t){na.add(this),this.type="value-clip",Hn.set(this,new O),sa.set(this,void 0),Ft.set(this,void 0),aa.set(this,void 0),Rd.set(this,void 0),Cd.set(this,void 0),Td.set(this,W.Empty),oa(this,sa,e,"f"),oa(this,Ft,t,"f"),oa(this,Cd,!0,"f"),oa(this,aa,Pe(this,Hn,"f").own(new Ur(!1)),"f"),oa(this,Rd,Pe(this,Hn,"f").own(new ie),"f"),Pe(this,Hn,"f").own(Pe(this,Ft,"f").pointerHub.subscribe({onAdded:()=>Pe(this,na,"m",Gl).call(this),onRemoved:()=>Pe(this,na,"m",Gl).call(this)})),Pe(this,Hn,"f").own(Pe(this,Ft,"f").subscribe(ke.Children,o=>Pe(this,na,"m",Gl).call(this))),Pe(this,Hn,"f").own(Pe(this,Ft,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Pe(this,Td,"f").terminate(),oa(this,Td,o.match({none:()=>W.Empty,some:({box:i})=>Pe(this,sa,"f").boxAdapters.adapterFor(i,hr).subscribeChange(()=>Pe(this,na,"m",Gl).call(this))}),"f"),Pe(this,na,"m",Gl).call(this)})),oa(this,Cd,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return Pe(this,aa,"f").catchupAndSubscribe(e)}subscribeChange(e){return Pe(this,Rd,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Pe(this,Ft,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Pe(this,Ft,"f").events.targetVertex.unwrap();kl.create(Pe(this,sa,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(Pe(this,Ft,"f").clips.targetVertex.unwrap()),o.events.refer(t)})}onSelected(){Pe(this,aa,"f").setValue(!0)}onDeselected(){Pe(this,aa,"f").setValue(!1)}get isSelected(){return Pe(this,aa,"f").getValue()}terminate(){Pe(this,Td,"f").terminate(),Pe(this,Hn,"f").terminate()}get box(){return Pe(this,Ft,"f")}get uuid(){return Pe(this,Ft,"f").address.uuid}get address(){return Pe(this,Ft,"f").address}get indexField(){return Pe(this,Ft,"f").index}get duration(){return Pe(this,Ft,"f").duration.getValue()}get mute(){return Pe(this,Ft,"f").mute.getValue()}get hue(){return Pe(this,Ft,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Pe(this,Ft,"f").events.targetVertex.map(e=>Pe(this,sa,"f").boxAdapters.adapterFor(e.box,hr))}get label(){return Pe(this,Ft,"f").label.getValue()}get trackBoxAdapter(){return Pe(this,Cd,"f")?m.None:Pe(this,Ft,"f").clips.targetVertex.map(e=>Pe(this,sa,"f").boxAdapters.adapterFor(e.box,vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${b.toString(Pe(this,Ft,"f").address.uuid)} d: ${X.toString(this.duration)}}`}};Hn=new WeakMap,sa=new WeakMap,Ft=new WeakMap,aa=new WeakMap,Rd=new WeakMap,Cd=new WeakMap,Td=new WeakMap,na=new WeakSet,Gl=function(){Pe(this,Rd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var ES=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ql=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jb,la,Nm,Hl=class{constructor(e){this.type="transient-marker",jb.set(this,new O),la.set(this,void 0),Nm.set(this,void 0),ES(this,la,e,"f"),ES(this,Nm,new ie,"f")}get box(){return ql(this,la,"f")}get uuid(){return ql(this,la,"f").address.uuid}get address(){return ql(this,la,"f").address}get position(){return ql(this,la,"f").position.getValue()}subscribe(e){return ql(this,Nm,"f").subscribe(e)}terminate(){ql(this,jb,"f").terminate()}};jb=new WeakMap,la=new WeakMap,Nm=new WeakMap;var Od=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Im,Vd,xo,zd,Jl,km,Ui=class r{constructor(e,t){Im.set(this,new O),Vd.set(this,void 0),xo.set(this,void 0),zd.set(this,void 0),Jl.set(this,void 0),km.set(this,void 0),Od(this,Vd,e,"f"),Od(this,xo,t,"f"),Od(this,zd,b.newSet(({uuid:o})=>o),"f"),Od(this,Jl,Sr.create(r.Comparator),"f"),Od(this,km,jf.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:o,resolve:i,reject:n}=Promise.withResolvers(),s=this.getOrCreateLoader(),a=s.subscribe(l=>{l.type==="loaded"?(a.terminate(),i(s.data.unwrap("State mismatch"))):l.type==="error"&&(a.terminate(),n(l.reason))});return o}),"f"),Zt(this,Im,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=Zt(this,Vd,"f").boxAdapters.adapterFor(o.box,Hl);Zt(this,zd,"f").add(i)&&Zt(this,Jl,"f").add(i)},onRemoved:({box:{address:{uuid:o}}})=>{Zt(this,Jl,"f").remove(Zt(this,zd,"f").removeByKey(o))}}))}get box(){return Zt(this,xo,"f")}get uuid(){return Zt(this,xo,"f").address.uuid}get address(){return Zt(this,xo,"f").address}get startInSeconds(){return Zt(this,xo,"f").startInSeconds.getValue()}get endInSeconds(){return Zt(this,xo,"f").endInSeconds.getValue()}get transients(){return Zt(this,Jl,"f")}get fileName(){return Zt(this,xo,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Zt(this,km,"f").call(this)}getOrCreateLoader(){return Zt(this,Vd,"f").sampleManager.getOrCreate(Zt(this,xo,"f").address.uuid)}terminate(){Zt(this,Im,"f").terminate()}};Im=new WeakMap,Vd=new WeakMap,xo=new WeakMap,zd=new WeakMap,Jl=new WeakMap,km=new WeakMap;Ui.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var Ud=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jd,$m,Dm,cn,Kd,Ld,Mm,Qn=class{constructor(e,t){jd.add(this),this.type="warp-marker",$m.set(this,new O),Dm.set(this,void 0),cn.set(this,void 0),Kd.set(this,void 0),Ld.set(this,!1),Ud(this,Dm,e,"f"),Ud(this,cn,t,"f"),Ud(this,Kd,new ie,"f"),fr(this,$m,"f").own(t.subscribe(ke.Children,()=>fr(this,jd,"m",Mm).call(this)))}onSelected(){Ud(this,Ld,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),fr(this,jd,"m",Mm).call(this)}onDeselected(){Ud(this,Ld,!1,"f"),fr(this,jd,"m",Mm).call(this)}get box(){return fr(this,cn,"f")}get uuid(){return fr(this,cn,"f").address.uuid}get address(){return fr(this,cn,"f").address}get position(){return fr(this,cn,"f").position.getValue()}get seconds(){return fr(this,cn,"f").seconds.getValue()}get isSelected(){return fr(this,Ld,"f")}get optWarping(){return fr(this,cn,"f").owner.targetVertex.map(e=>fr(this,Dm,"f").boxAdapters.adapterFor(e.box,bo.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return fr(this,Kd,"f").subscribe(e)}terminate(){fr(this,$m,"f").terminate()}};$m=new WeakMap,Dm=new WeakMap,cn=new WeakMap,Kd=new WeakMap,Ld=new WeakMap,jd=new WeakSet,Mm=function(){fr(this,Kd,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var Cm=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var Wd=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Tm,Rm,ua,ca,Zd,Ql,wo=class{constructor(e,t){Tm.set(this,new O),Rm.set(this,void 0),ua.set(this,void 0),ca.set(this,void 0),Zd.set(this,void 0),Ql.set(this,void 0),Wd(this,Rm,e,"f"),Wd(this,ua,t,"f"),Wd(this,ca,new ie,"f"),Wd(this,Zd,b.newSet(({uuid:o})=>o),"f"),Wd(this,Ql,Sr.create(Cm),"f"),Yt(this,Tm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=Yt(this,Rm,"f").boxAdapters.adapterFor(o.box,Qn);Yt(this,Zd,"f").add(i)&&(Yt(this,Ql,"f").add(i),Yt(this,ca,"f").notify())},onRemoved:({box:{address:{uuid:o}}})=>{Yt(this,Ql,"f").remove(Yt(this,Zd,"f").removeByKey(o)),Yt(this,ca,"f").notify()}}))}get box(){return Yt(this,ua,"f")}get uuid(){return Yt(this,ua,"f").address.uuid}get address(){return Yt(this,ua,"f").address}get warpMarkers(){return Yt(this,Ql,"f")}clone(){let e=Dl.create(Yt(this,ua,"f").graph,b.generate());return this.warpMarkers.asArray().forEach(t=>Un.create(e.graph,b.generate(),o=>{o.position.setValue(t.position),o.seconds.setValue(t.seconds),o.owner.refer(e.warpMarkers)})),e}subscribe(e){return Yt(this,ca,"f").subscribe(e)}onChanged(){Yt(this,ca,"f").notify()}terminate(){Yt(this,Tm,"f").terminate()}};Tm=new WeakMap,Rm=new WeakMap,ua=new WeakMap,ca=new WeakMap,Zd=new WeakMap,Ql=new WeakMap;var Gd=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Nt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Om,Vm,ji,da,qd,Xl,Ao=class{constructor(e,t){Om.set(this,new O),Vm.set(this,void 0),ji.set(this,void 0),da.set(this,void 0),qd.set(this,void 0),Xl.set(this,void 0),Gd(this,Vm,e,"f"),Gd(this,ji,t,"f"),Gd(this,da,new ie,"f"),Gd(this,qd,b.newSet(({uuid:o})=>o),"f"),Gd(this,Xl,Sr.create(Cm),"f"),Nt(this,Om,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=Nt(this,Vm,"f").boxAdapters.adapterFor(o.box,Qn);Nt(this,qd,"f").add(i)&&(Nt(this,Xl,"f").add(i),Nt(this,da,"f").notify())},onRemoved:({box:{address:{uuid:o}}})=>{Nt(this,Xl,"f").remove(Nt(this,qd,"f").removeByKey(o)),Nt(this,da,"f").notify()}}))}get box(){return Nt(this,ji,"f")}get uuid(){return Nt(this,ji,"f").address.uuid}get address(){return Nt(this,ji,"f").address}get warpMarkers(){return Nt(this,Xl,"f")}get playbackRate(){return Nt(this,ji,"f").playbackRate.getValue()}get cents(){return Math.log2(Nt(this,ji,"f").playbackRate.getValue())*1200}set cents(e){Nt(this,ji,"f").playbackRate.setValue(ue(2**(e/1200),.5,2))}get transientPlayMode(){return ri(Nt(this,ji,"f").transientPlayMode.getValue(),Cn)}clone(){let e=Ml.create(Nt(this,ji,"f").graph,b.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>Un.create(e.graph,b.generate(),o=>{o.position.setValue(t.position),o.seconds.setValue(t.seconds),o.owner.refer(e.warpMarkers)})),e}subscribe(e){return Nt(this,da,"f").subscribe(e)}onChanged(){Nt(this,da,"f").notify()}terminate(){Nt(this,Om,"f").terminate()}};Om=new WeakMap,Vm=new WeakMap,ji=new WeakMap,da=new WeakMap,qd=new WeakMap,Xl=new WeakMap;var bo;(function(r){r.isAudioPlayMode=e=>e instanceof wo||e instanceof Ao})(bo||(bo={}));var jr=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ae=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},pa,Yl,ha,ht,fa,ma,Hd,Qd,Jd,ga,eu,tu,ru,dn=class r{constructor(e,t){pa.add(this),this.type="audio-clip",Yl.set(this,new O),ha.set(this,void 0),ht.set(this,void 0),fa.set(this,void 0),ma.set(this,void 0),Hd.set(this,void 0),Qd.set(this,void 0),Jd.set(this,void 0),ga.set(this,m.None),eu.set(this,m.None),tu.set(this,W.Empty),jr(this,ha,e,"f"),jr(this,ht,t,"f"),jr(this,Jd,!0,"f"),jr(this,fa,new ni,"f"),jr(this,ma,ae(this,Yl,"f").own(new Ur(!1)),"f"),jr(this,Hd,$n.aware(e.tempoMap,t.timeBase,r.STATIC_POSITION,t.duration),"f"),jr(this,Qd,ae(this,Yl,"f").own(new ie),"f"),ae(this,Yl,"f").ownAll(ae(this,ht,"f").pointerHub.subscribe({onAdded:()=>ae(this,pa,"m",ru).call(this),onRemoved:()=>ae(this,pa,"m",ru).call(this)}),ae(this,ht,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{ae(this,tu,"f").terminate(),o.match({none:()=>ae(this,fa,"f").clear(),some:({box:i})=>{let n=ae(this,ha,"f").boxAdapters.adapterFor(i,bo.isAudioPlayMode);jr(this,tu,n.subscribe(()=>ae(this,pa,"m",ru).call(this)),"f"),ae(this,fa,"f").wrap(n)}})}),ae(this,ht,"f").file.catchupAndSubscribe(o=>{jr(this,ga,o.targetVertex.map(i=>ae(this,ha,"f").boxAdapters.adapterFor(i.box,Ui)),"f"),ae(this,eu,"f").ifSome(i=>i.terminate()),jr(this,eu,ae(this,ga,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ae(this,pa,"m",ru).call(this))),"f")}),ae(this,ht,"f").subscribe(ke.Children,o=>ae(this,pa,"m",ru).call(this))),jr(this,Jd,!1,"f")}catchupAndSubscribeSelected(e){return ae(this,ma,"f").catchupAndSubscribe(e)}subscribeChange(e){return ae(this,Qd,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(o=>o.clone());$l.create(ae(this,ha,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.gain.setValue(this.gain.getValue()),o.timeBase.setValue(this.timeBase),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(ae(this,ht,"f").clips.targetVertex.unwrap()),o.file.refer(ae(this,ht,"f").file.targetVertex.unwrap()),o.events.refer(ae(this,ht,"f").events.targetVertex.unwrap()),t.ifSome(i=>o.playMode.refer(i))})}onSelected(){ae(this,ma,"f").setValue(!0)}onDeselected(){ae(this,ma,"f").setValue(!1)}get isSelected(){return ae(this,ma,"f").getValue()}get box(){return ae(this,ht,"f")}get uuid(){return ae(this,ht,"f").address.uuid}get address(){return ae(this,ht,"f").address}get indexField(){return ae(this,ht,"f").index}get duration(){return ae(this,Hd,"f").toPPQN()}set duration(e){ae(this,Hd,"f").fromPPQN(e)}get mute(){return ae(this,ht,"f").mute.getValue()}get hue(){return ae(this,ht,"f").hue.getValue()}get gain(){return ae(this,ht,"f").gain}get file(){return ae(this,ga,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ae(this,fa,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get timeBase(){return ri(ae(this,ht,"f").timeBase.getValue(),cr)}get waveformOffset(){return ae(this,ht,"f").waveformOffset}get isPlayModeNoStretch(){return ae(this,ht,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ce(e,wo)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ce(e,Ao)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>bo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ae(this,ga,"f").isEmpty())return"No Audio File";let e=ae(this,ga,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ae(this,ht,"f").label.getValue()}get trackBoxAdapter(){return ae(this,Jd,"f")?m.None:ae(this,ht,"f").clips.targetVertex.map(e=>ae(this,ha,"f").boxAdapters.adapterFor(e.box,vt))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ae(this,fa,"f").nonEmpty()}terminate(){ae(this,eu,"f").ifSome(e=>e.terminate()),jr(this,eu,m.None,"f"),ae(this,tu,"f").terminate(),jr(this,tu,W.Empty,"f"),ae(this,Yl,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${b.toString(ae(this,ht,"f").address.uuid)} d: ${X.toString(this.duration)}}`}};Yl=new WeakMap,ha=new WeakMap,ht=new WeakMap,fa=new WeakMap,ma=new WeakMap,Hd=new WeakMap,Qd=new WeakMap,Jd=new WeakMap,ga=new WeakMap,eu=new WeakMap,tu=new WeakMap,pa=new WeakSet,ru=function(){ae(this,Qd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};dn.STATIC_POSITION={getValue:()=>0};var Xd=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},iu,Tt,zm,Yd,va=class r{constructor(e,t){this.type="note-event",iu.set(this,void 0),Tt.set(this,void 0),zm.set(this,void 0),Yd.set(this,!1),Xd(this,iu,e,"f"),Xd(this,Tt,t,"f"),Xd(this,zm,wt(this,Tt,"f").subscribe(ke.Children,o=>{if(!this.collection.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.collection.unwrap(),n=o.address.fieldKeys,s=C.equals(wt(this,Tt,"f").pitch.address.fieldKeys,n),a=C.equals(wt(this,Tt,"f").position.address.fieldKeys,n);s||a?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Xd(this,Yd,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Xd(this,Yd,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){wt(this,zm,"f").terminate()}get box(){return wt(this,Tt,"f")}get uuid(){return wt(this,Tt,"f").address.uuid}get address(){return wt(this,Tt,"f").address}get position(){return wt(this,Tt,"f").position.getValue()}get duration(){return wt(this,Tt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return wt(this,Tt,"f").velocity.getValue()}get pitch(){return wt(this,Tt,"f").pitch.getValue()}get cent(){return wt(this,Tt,"f").cent.getValue()}get chance(){return wt(this,Tt,"f").chance.getValue()}get playCount(){return wt(this,Tt,"f").playCount.getValue()}get playCurve(){return wt(this,Tt,"f").playCurve.getValue()}get isSelected(){return wt(this,Yd,"f")}get collection(){return wt(this,Tt,"f").events.targetVertex.map(e=>wt(this,iu,"f").boxAdapters.adapterFor(e.box,li))}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,iu,"f").boxAdapters.adapterFor(Rn.create(wt(this,iu,"f").boxGraph,b.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 Qt.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,o=C.create(i=>{let n=Math.floor(this.computeCurveValue(i/e)*this.duration),s=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+n),duration:Math.max(1,s-n),playCount:1,events:t})},e);return wt(this,Tt,"f").delete(),o}};iu=new WeakMap,Tt=new WeakMap,zm=new WeakMap,Yd=new WeakMap;var _o=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ve=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},pn,ep,Xn,Li,ya,tp,ui,jm,Lm,Km,Yn,Um,rp,li=class r{constructor(e,t){pn.add(this),ep.set(this,new O),Xn.set(this,void 0),Li.set(this,void 0),ya.set(this,void 0),tp.set(this,void 0),ui.set(this,void 0),jm.set(this,60),Lm.set(this,60),Km.set(this,0),Yn.set(this,!1),_o(this,Xn,e,"f"),_o(this,Li,t,"f"),_o(this,ya,new ie,"f"),_o(this,tp,b.newSet(o=>o.uuid),"f"),_o(this,ui,Sr.create(Qt.Comparator),"f"),ve(this,ep,"f").own(ve(this,Li,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{let i=ve(this,Xn,"f").boxAdapters.adapterFor(o,va);ve(this,tp,"f").add(i)&&(ve(this,ui,"f").add(i),ve(this,pn,"m",Um).call(this))},onRemoved:({box:{address:{uuid:o}}})=>{ve(this,ui,"f").remove(ve(this,tp,"f").removeByKey(o)),ve(this,pn,"m",Um).call(this)}})),ve(this,ep,"f").own(ve(this,Li,"f").owners.pointerHub.subscribe({onAdded:()=>ve(this,ya,"f").notify(this),onRemoved:()=>ve(this,ya,"f").notify(this)}))}copy(){let e=ve(this,Xn,"f").boxGraph,t=sn.create(e,b.generate());return ve(this,ui,"f").asArray().forEach(o=>o.copyTo({events:t.events})),ve(this,Xn,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:o,pitch:i,chance:n,playCount:s,cent:a}){return ve(this,Xn,"f").boxAdapters.adapterFor(Rn.create(ve(this,Xn,"f").boxGraph,b.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(o),l.pitch.setValue(i),l.chance.setValue(n),l.playCount.setValue(s),l.cent.setValue(a),l.events.refer(ve(this,Li,"f").events)}),va)}subscribeChange(e){return ve(this,ya,"f").subscribe(e)}selectable(){return ve(this,ui,"f").asArray()}selectableAt(e){for(let t of ve(this,ui,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return tt.one(t);return tt.empty()}selectablesBetween(e,t){let o=[];for(let i of ve(this,ui,"f").asArray())dd.intersect1D(i.position,i.complete,e.u,t.u)&&dd.intersect1D(i.pitch,i.pitch,e.v,t.v)&&o.push(i);return o}requestSorting(){ve(this,ui,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){ve(this,pn,"m",Um).call(this)}terminate(){ve(this,ep,"f").terminate()}get box(){return ve(this,Li,"f")}get uuid(){return ve(this,Li,"f").address.uuid}get address(){return ve(this,Li,"f").address}get numOwners(){return ve(this,Li,"f").owners.pointerHub.filter(u.NoteEventCollection).length}get events(){return ve(this,Yn,"f")||ve(this,pn,"m",rp).call(this),ve(this,ui,"f")}get minPitch(){return ve(this,Yn,"f")||ve(this,pn,"m",rp).call(this),ve(this,jm,"f")}get maxPitch(){return ve(this,Yn,"f")||ve(this,pn,"m",rp).call(this),ve(this,Lm,"f")}get maxDuration(){return ve(this,Yn,"f")||ve(this,pn,"m",rp).call(this),ve(this,Km,"f")}toString(){return`{NoteEventCollectionBox ${b.toString(ve(this,Li,"f").address.uuid)}}`}};ep=new WeakMap,Xn=new WeakMap,Li=new WeakMap,ya=new WeakMap,tp=new WeakMap,ui=new WeakMap,jm=new WeakMap,Lm=new WeakMap,Km=new WeakMap,Yn=new WeakMap,pn=new WeakSet,Um=function(){_o(this,Yn,!1,"f"),ve(this,ya,"f").notify(this)},rp=function(){let e=127,t=0,o=0;ve(this,ui,"f").asArray().forEach(({pitch:i,duration:n})=>{e=Math.min(e,i),t=Math.max(t,i),o=Math.max(o,n)}),_o(this,jm,e,"f"),_o(this,Lm,t,"f"),_o(this,Km,o,"f"),_o(this,Yn,!0,"f")};var xa=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Be=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ba,ou,wa,It,Aa,np,ip,op,nu,su=class{constructor(e,t){ba.add(this),this.type="note-clip",ou.set(this,new O),wa.set(this,void 0),It.set(this,void 0),Aa.set(this,void 0),np.set(this,void 0),ip.set(this,void 0),op.set(this,W.Empty),xa(this,wa,e,"f"),xa(this,It,t,"f"),xa(this,ip,!0,"f"),xa(this,Aa,Be(this,ou,"f").own(new Ur(!1)),"f"),xa(this,np,Be(this,ou,"f").own(new ie),"f"),Be(this,ou,"f").ownAll(Be(this,It,"f").pointerHub.subscribe({onAdded:()=>Be(this,ba,"m",nu).call(this),onRemoved:()=>Be(this,ba,"m",nu).call(this)}),Be(this,It,"f").subscribe(ke.Children,o=>Be(this,ba,"m",nu).call(this)),Be(this,It,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Be(this,op,"f").terminate(),xa(this,op,o.match({none:()=>W.Empty,some:({box:i})=>Be(this,wa,"f").boxAdapters.adapterFor(i,li).subscribeChange(()=>Be(this,ba,"m",nu).call(this))}),"f"),Be(this,ba,"m",nu).call(this)})),xa(this,ip,!1,"f")}catchupAndSubscribeSelected(e){return Be(this,Aa,"f").catchupAndSubscribe(e)}subscribeChange(e){return Be(this,np,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Be(this,It,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Be(this,It,"f").events.targetVertex.unwrap();Il.create(Be(this,wa,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(Be(this,It,"f").clips.targetVertex.unwrap()),o.events.refer(t)})}onSelected(){Be(this,Aa,"f").setValue(!0)}onDeselected(){Be(this,Aa,"f").setValue(!1)}get isSelected(){return Be(this,Aa,"f").getValue()}terminate(){Be(this,op,"f").terminate(),Be(this,ou,"f").terminate()}get box(){return Be(this,It,"f")}get uuid(){return Be(this,It,"f").address.uuid}get address(){return Be(this,It,"f").address}get indexField(){return Be(this,It,"f").index}get duration(){return Be(this,It,"f").duration.getValue()}get mute(){return Be(this,It,"f").mute.getValue()}get hue(){return Be(this,It,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Be(this,It,"f").events.targetVertex.map(e=>Be(this,wa,"f").boxAdapters.adapterFor(e.box,li))}get label(){return Be(this,It,"f").label.getValue()}get trackBoxAdapter(){return Be(this,ip,"f")?m.None:Be(this,It,"f").clips.targetVertex.map(e=>Be(this,wa,"f").boxAdapters.adapterFor(e.box,vt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${b.toString(Be(this,It,"f").address.uuid)} d: ${X.toString(this.duration)}}`}};ou=new WeakMap,wa=new WeakMap,It=new WeakMap,Aa=new WeakMap,np=new WeakMap,ip=new WeakMap,op=new WeakMap,ba=new WeakSet,nu=function(){Be(this,np,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Wm={for:(r,e)=>re(e.accept({visitNoteClipBox:t=>r.adapterFor(t,su),visitValueClipBox:t=>r.adapterFor(t,Jn),visitAudioClipBox:t=>r.adapterFor(t,dn)}),"")};var Zm=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},es=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Gm,au,sp,ap,qm=class{constructor(e,t){Gm.set(this,void 0),au.set(this,void 0),sp.set(this,void 0),ap.set(this,void 0),Zm(this,Gm,e,"f"),Zm(this,au,new O,"f"),Zm(this,sp,es(this,au,"f").own(new ie),"f"),Zm(this,ap,es(this,au,"f").own(Wt.create(e.box.clips,o=>Wm.for(t,o),u.ClipCollection)),"f"),es(this,ap,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return es(this,Gm,"f")}get collection(){return es(this,ap,"f")}dispatchChange(){es(this,sp,"f").notify()}subscribeChanges(e){return es(this,sp,"f").subscribe(e)}terminate(){es(this,au,"f").terminate()}};Gm=new WeakMap,au=new WeakMap,sp=new WeakMap,ap=new WeakMap;var yt=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},q=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Lr,lp,Po,We,up,cp,dp,_a,pp,hp,Pa,lu,uu,cu,du,pu,ci,ts=class r{constructor(e,t){Lr.add(this),this.type="audio-region",lp.set(this,void 0),Po.set(this,void 0),We.set(this,void 0),up.set(this,void 0),cp.set(this,void 0),dp.set(this,void 0),_a.set(this,void 0),pp.set(this,void 0),hp.set(this,void 0),Pa.set(this,m.None),lu.set(this,W.Empty),uu.set(this,W.Empty),cu.set(this,W.Empty),du.set(this,W.Empty),pu.set(this,void 0),yt(this,Po,e,"f"),yt(this,We,t,"f"),yt(this,lp,new O,"f");let{timeBase:o,position:i,duration:n,loopOffset:s,loopDuration:a}=t;yt(this,up,$n.aware(e.tempoMap,o,i,n),"f"),yt(this,cp,$n.aware(e.tempoMap,o,i,s),"f"),yt(this,dp,$n.aware(e.tempoMap,o,i,a),"f"),yt(this,_a,new ni,"f"),yt(this,pp,new ie,"f"),yt(this,pu,!1,"f"),yt(this,hp,!0,"f"),q(this,lp,"f").ownAll(q(this,We,"f").pointerHub.subscribe({onAdded:()=>q(this,Lr,"m",ci).call(this),onRemoved:()=>q(this,Lr,"m",ci).call(this)}),q(this,We,"f").file.catchupAndSubscribe(l=>{yt(this,Pa,l.targetVertex.map(c=>q(this,Po,"f").boxAdapters.adapterFor(c.box,Ui)),"f"),q(this,lu,"f").terminate(),yt(this,lu,q(this,Pa,"f").mapOr(c=>c.getOrCreateLoader().subscribe(()=>q(this,Lr,"m",ci).call(this)),W.Empty),"f")}),q(this,We,"f").playMode.catchupAndSubscribe(({targetVertex:l})=>{q(this,uu,"f").terminate(),l.match({none:()=>q(this,_a,"f").clear(),some:({box:c})=>{let d=q(this,Po,"f").boxAdapters.adapterFor(c,bo.isAudioPlayMode);yt(this,uu,d.subscribe(()=>q(this,Lr,"m",ci).call(this)),"f"),q(this,_a,"f").wrap(d)}})}),q(this,We,"f").timeBase.catchupAndSubscribe(l=>{q(this,cu,"f").terminate(),ri(l.getValue(),cr)===cr.Seconds&&yt(this,cu,e.tempoMap.subscribe(()=>q(this,Lr,"m",ci).call(this)),"f")}),q(this,We,"f").subscribe(ke.Children,l=>{if(!this.trackBoxAdapter.isEmpty()&&(l.type==="primitive"||l.type==="pointer")){let c=this.trackBoxAdapter.unwrap();q(this,We,"f").position.address.equals(l.address)?(c.regions.onIndexingChanged(),q(this,Lr,"m",ci).call(this)):q(this,Lr,"m",ci).call(this)}}),q(this,We,"f").events.catchupAndSubscribe(({targetVertex:l})=>{q(this,du,"f").terminate(),yt(this,du,l.match({none:()=>W.Empty,some:({box:c})=>q(this,Po,"f").boxAdapters.adapterFor(c,hr).subscribeChange(()=>q(this,Lr,"m",ci).call(this))}),"f"),q(this,Lr,"m",ci).call(this)})),yt(this,hp,!1,"f")}subscribeChange(e){return q(this,pp,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){yt(this,pu,!0,"f"),q(this,Lr,"m",ci).call(this)}onDeselected(){yt(this,pu,!1,"f"),q(this,Lr,"m",ci).call(this)}get isSelected(){return q(this,pu,"f")}get box(){return q(this,We,"f")}get uuid(){return q(this,We,"f").address.uuid}get address(){return q(this,We,"f").address}get position(){return q(this,We,"f").position.getValue()}get duration(){return q(this,up,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return q(this,cp,"f").toPPQN()}get loopDuration(){return q(this,dp,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return q(this,We,"f").mute.getValue()}get hue(){return q(this,We,"f").hue.getValue()}get gain(){return q(this,We,"f").gain}get file(){return q(this,Pa,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return q(this,_a,"f")}get timeBase(){return ri(q(this,We,"f").timeBase.getValue(),cr)}get waveformOffset(){return q(this,We,"f").waveformOffset}get isPlayModeNoStretch(){return q(this,We,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ce(e,wo)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ce(e,Ao)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>bo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(q(this,Pa,"f").isEmpty())return"No Audio File";let e=q(this,Pa,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):q(this,We,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return q(this,_a,"f").nonEmpty()}get trackBoxAdapter(){return q(this,We,"f").regions.targetVertex.map(e=>q(this,Po,"f").boxAdapters.adapterFor(e.box,vt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return q(this,We,"f").events.targetVertex.map(e=>q(this,Po,"f").boxAdapters.adapterFor(e.box,hr))}set position(e){q(this,We,"f").position.setValue(e)}set duration(e){q(this,up,"f").fromPPQN(e)}set loopOffset(e){q(this,cp,"f").fromPPQN(e)}set loopDuration(e){q(this,dp,"f").fromPPQN(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners,i=this.observableOptPlayMode.map(s=>s.clone()),n=q(this,Po,"f").boxAdapters.adapterFor(zn.create(q(this,Po,"f").boxGraph,b.generate(),s=>{s.timeBase.setValue(q(this,We,"f").timeBase.getValue()),s.position.setValue(e?.position??q(this,We,"f").position.getValue()),s.regions.refer(e?.track??q(this,We,"f").regions.targetVertex.unwrap()),s.file.refer(q(this,We,"f").file.targetVertex.unwrap()),s.events.refer(o),s.mute.setValue(this.mute),s.hue.setValue(this.hue),s.label.setValue(this.label),s.gain.setValue(this.gain.getValue()),s.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(a=>s.playMode.refer(a))}),r);return n.duration=e?.duration??this.duration,n.loopOffset=e?.loopOffset??this.loopOffset,n.loopDuration=e?.loopDuration??this.loopDuration,n}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}terminate(){q(this,lu,"f").terminate(),yt(this,lu,W.Empty,"f"),q(this,cu,"f").terminate(),yt(this,cu,W.Empty,"f"),q(this,uu,"f").terminate(),yt(this,uu,W.Empty,"f"),q(this,du,"f").terminate(),yt(this,du,W.Empty,"f"),q(this,lp,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${b.toString(q(this,We,"f").address.uuid)}}`}};lp=new WeakMap,Po=new WeakMap,We=new WeakMap,up=new WeakMap,cp=new WeakMap,dp=new WeakMap,_a=new WeakMap,pp=new WeakMap,hp=new WeakMap,Pa=new WeakMap,lu=new WeakMap,uu=new WeakMap,cu=new WeakMap,du=new WeakMap,pu=new WeakMap,Lr=new WeakSet,ci=function(){q(this,hp,"f")||(q(this,pp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var hn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},he=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},So,Hm,Eo,rt,gp,fp,hu,mp,fn,rs=class r{constructor(e,t){So.add(this),this.type="note-region",Hm.set(this,new O),Eo.set(this,void 0),rt.set(this,void 0),gp.set(this,void 0),fp.set(this,void 0),hu.set(this,void 0),mp.set(this,W.Empty),hn(this,Eo,e,"f"),hn(this,rt,t,"f"),hn(this,gp,new ie,"f"),hn(this,hu,!1,"f"),hn(this,fp,!0,"f"),he(this,Hm,"f").ownAll(he(this,rt,"f").pointerHub.subscribe({onAdded:()=>he(this,So,"m",fn).call(this),onRemoved:()=>he(this,So,"m",fn).call(this)}),he(this,rt,"f").subscribe(ke.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();he(this,rt,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),he(this,So,"m",fn).call(this)):he(this,So,"m",fn).call(this)}}),he(this,rt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{he(this,mp,"f").terminate(),hn(this,mp,o.match({none:()=>W.Empty,some:({box:i})=>he(this,Eo,"f").boxAdapters.adapterFor(i,li).subscribeChange(()=>he(this,So,"m",fn).call(this))}),"f"),he(this,So,"m",fn).call(this)})),hn(this,fp,!1,"f")}set position(e){he(this,rt,"f").position.setValue(e)}set duration(e){he(this,rt,"f").duration.setValue(e)}set loopOffset(e){he(this,rt,"f").loopOffset.setValue(e)}set loopDuration(e){he(this,rt,"f").loopDuration.setValue(e)}subscribeChange(e){return he(this,gp,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){hn(this,hu,!0,"f"),he(this,So,"m",fn).call(this)}onDeselected(){hn(this,hu,!1,"f"),he(this,So,"m",fn).call(this)}get isSelected(){return he(this,hu,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let o=t.unwrap(),i=Jt.globalToLocal(this,e);for(let n of o.events.iterateFrom(i-o.maxDuration)){if(i<n.position)return;i<n.complete&&(yield n.copyAsNoteEvent())}}terminate(){he(this,mp,"f").terminate(),he(this,Hm,"f").terminate()}get box(){return he(this,rt,"f")}get uuid(){return he(this,rt,"f").address.uuid}get address(){return he(this,rt,"f").address}get position(){return he(this,rt,"f").position.getValue()}get duration(){return he(this,rt,"f").duration.getValue()}get loopOffset(){return he(this,rt,"f").loopOffset.getValue()}get loopDuration(){return he(this,rt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return he(this,rt,"f").mute.getValue()}get hue(){return he(this,rt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return he(this,rt,"f").events.targetVertex.map(e=>he(this,Eo,"f").boxAdapters.adapterFor(e.box,li))}get label(){return he(this,rt,"f").label.getValue()}get trackBoxAdapter(){return he(this,fp,"f")?m.None:he(this,rt,"f").regions.targetVertex.map(e=>he(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"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return he(this,Eo,"f").boxAdapters.adapterFor(ea.create(he(this,Eo,"f").boxGraph,b.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(o),i.regions.refer(e?.track??he(this,rt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=he(this,Eo,"f").boxGraph,o=sn.create(t,b.generate());e.events.asArray().forEach(i=>i.copyTo({events:o.events})),he(this,rt,"f").events.refer(o.owners)})}canFlatten(e){return e.length>0&&C.satisfy(e,(t,o)=>t.trackBoxAdapter.contains(o.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=he(this,Eo,"f").boxGraph,o=e.toSorted(kn.Comparator),i=C.getFirst(o,"Internal error (no first)"),n=C.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),c=sn.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(p=>p.isSelected).forEach(p=>{let f=p;for(let{resultStart:g,resultEnd:v,rawStart:x}of Jt.locateLoops(f,f.position,f.complete)){let y=Math.floor(g-x),M=Math.floor(v-x);for(let T of f.optCollection.unwrap().events.iterateRange(y,M))T.copyTo({position:T.position+x-i.position,events:c.events})}}),d.forEach(({box:p})=>p.delete()),m.wrap(ea.create(t,b.generate(),p=>{p.position.setValue(s),p.duration.setValue(a-s),p.loopDuration.setValue(a-s),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(c.owners),p.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${b.toString(he(this,rt,"f").address.uuid)} p: ${X.toString(this.position)}, c: ${X.toString(this.complete)}}`}};Hm=new WeakMap,Eo=new WeakMap,rt=new WeakMap,gp=new WeakMap,fp=new WeakMap,hu=new WeakMap,mp=new WeakMap,So=new WeakSet,fn=function(){he(this,gp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var mn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ce=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ki,fu,Bo,it,xp,mu,vp,yp,Fo,gn=class r{constructor(e,t){Ki.add(this),this.type="value-region",fu.set(this,new O),Bo.set(this,void 0),it.set(this,void 0),xp.set(this,void 0),mu.set(this,void 0),vp.set(this,void 0),yp.set(this,W.Empty),mn(this,Bo,e,"f"),mn(this,it,t,"f"),mn(this,vp,!0,"f"),mn(this,xp,new ie,"f"),mn(this,mu,!1,"f"),ce(this,fu,"f").own(ce(this,it,"f").pointerHub.subscribe({onAdded:()=>ce(this,Ki,"m",Fo).call(this),onRemoved:()=>ce(this,Ki,"m",Fo).call(this)})),ce(this,fu,"f").own(ce(this,it,"f").subscribe(ke.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();ce(this,it,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),ce(this,Ki,"m",Fo).call(this)):ce(this,Ki,"m",Fo).call(this)}})),ce(this,fu,"f").own(ce(this,it,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ce(this,yp,"f").terminate(),mn(this,yp,o.match({none:()=>W.Empty,some:({box:i})=>ce(this,Bo,"f").boxAdapters.adapterFor(i,hr).subscribeChange(()=>ce(this,Ki,"m",Fo).call(this))}),"f"),ce(this,Ki,"m",Fo).call(this)})),mn(this,vp,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(Jt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let o=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?o.valueAt(this.loopDuration,e):o.valueAt(Jt.globalToLocal(this,this.complete),e)}subscribeChange(e){return ce(this,xp,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){mn(this,mu,!0,"f"),ce(this,Ki,"m",Fo).call(this)}onDeselected(){mn(this,mu,!1,"f"),ce(this,Ki,"m",Fo).call(this)}get isSelected(){return ce(this,mu,"f")}onValuesPropertyChanged(){ce(this,Ki,"m",Fo).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){ce(this,yp,"f").terminate(),ce(this,fu,"f").terminate()}get box(){return ce(this,it,"f")}get uuid(){return ce(this,it,"f").address.uuid}get address(){return ce(this,it,"f").address}get position(){return ce(this,it,"f").position.getValue()}get duration(){return ce(this,it,"f").duration.getValue()}get loopOffset(){return ce(this,it,"f").loopOffset.getValue()}get loopDuration(){return ce(this,it,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return ce(this,it,"f").mute.getValue()}get hue(){return ce(this,it,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return ce(this,it,"f").events.targetVertex.map(e=>ce(this,Bo,"f").boxAdapters.adapterFor(e.box,hr))}get label(){return ce(this,it,"f").label.getValue()}get trackBoxAdapter(){return ce(this,vp,"f")?m.None:ce(this,it,"f").regions.targetVertex.map(e=>ce(this,Bo,"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){ce(this,it,"f").position.setValue(e)}set duration(e){ce(this,it,"f").duration.setValue(e)}set loopOffset(e){ce(this,it,"f").loopOffset.setValue(e)}set loopDuration(e){ce(this,it,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return ce(this,Bo,"f").boxAdapters.adapterFor(ta.create(ce(this,Bo,"f").boxGraph,b.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(o),i.regions.refer(e?.track??ce(this,it,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=ce(this,Bo,"f").boxGraph,o=an.create(t,b.generate());e.asArray().forEach(i=>i.copyTo({events:o.events})),ce(this,it,"f").events.refer(o.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=ce(this,Bo,"f").boxGraph,o=e.toSorted(kn.Comparator),i=C.getFirst(o,"Internal error (no first)"),n=C.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),c=an.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(p=>p.isSelected).forEach(p=>{let f=p;for(let{resultStart:g,resultEnd:v,rawStart:x}of Jt.locateLoops(f,f.position,f.complete)){let y=Math.floor(g-x),M=Math.floor(v-x);for(let T of f.events.unwrap().iterateRange(y,M));}}),d.forEach(({box:p})=>p.delete()),m.wrap(ta.create(t,b.generate(),p=>{p.position.setValue(s),p.duration.setValue(a-s),p.loopDuration.setValue(a-s),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(c.owners),p.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${b.toString(ce(this,it,"f").address.uuid)} p: ${X.toString(this.position)}, c: ${X.toString(this.complete)}}`}};fu=new WeakMap,Bo=new WeakMap,it=new WeakMap,xp=new WeakMap,mu=new WeakMap,vp=new WeakMap,yp=new WeakMap,Ki=new WeakSet,Fo=function(){ce(this,xp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var BS=(r,e)=>r.position-e.position,FS={for:(r,e)=>re(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,rs),visitAudioRegionBox:t=>r.adapterFor(t,ts),visitValueRegionBox:t=>r.adapterFor(t,gn)}),"")};var gu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Lt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},bp,Sa,wp,vu,Ea,yu,Jm=class{constructor(e,t){bp.set(this,void 0),Sa.set(this,void 0),wp.set(this,void 0),vu.set(this,void 0),Ea.set(this,void 0),yu.set(this,void 0),gu(this,bp,e,"f"),gu(this,Sa,new O,"f"),gu(this,wp,Lt(this,Sa,"f").own(new ie),"f"),gu(this,vu,Lt(this,Sa,"f").own(new Ct),"f"),gu(this,Ea,kn.create(BS),"f"),gu(this,yu,b.newSet(o=>o.uuid),"f"),Lt(this,Sa,"f").ownAll(Lt(this,bp,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{let i=FS.for(t,o),n=Lt(this,yu,"f").add(i);D(n,`Cannot add ${o}`),Lt(this,Ea,"f").add(i),Lt(this,vu,"f").forEach(s=>s.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:o}}})=>{let i=Lt(this,yu,"f").removeByKey(o);Lt(this,Ea,"f").remove(i),Lt(this,vu,"f").forEach(n=>n.onRemoved(i)),this.dispatchChange()}},u.RegionCollection))}get trackBoxAdapter(){return Lt(this,bp,"f")}get collection(){return Lt(this,Ea,"f")}get adapters(){return Lt(this,yu,"f")}onIndexingChanged(){Lt(this,Ea,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Lt(this,vu,"f").subscribe(e)}subscribeChanges(e){return Lt(this,wp,"f").subscribe(e)}dispatchChange(){Lt(this,wp,"f").notify()}terminate(){Lt(this,Sa,"f").terminate()}};bp=new WeakMap,Sa=new WeakMap,wp=new WeakMap,vu=new WeakMap,Ea=new WeakMap,yu=new WeakMap;var oe;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(oe||(oe={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Notes";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return De.Waveform;case r.Notes:return De.Piano;case r.Value:return De.Automation;case r.Undefined:return De.AudioBus;default:return De.Unknown}}})(oe||(oe={}));var Qm;(function(r){r.isDeviceBox=e=>"host"in e&&Ce(e.host,B)&&"label"in e&&Ce(e.label,$)&&"enabled"in e&&Ce(e.enabled,k)&&"minimized"in e&&Ce(e.minimized,k),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===u.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Ce(e.index,E)&&(e.host.pointerType===u.MIDIEffectHost||e.host.pointerType===u.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&Ce(e.host,B)?e.host:F(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&Ce(e.label,$)?e.label:F(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&Ce(e.enabled,k)?e.enabled:F(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&Ce(e.minimized,k)?e.minimized:F(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&Ce(e.index,E)?e.index:F(`Could not find 'index' field in '${e?.name}'`)})(Qm||(Qm={}));var NS;(function(r){r.toTrackType=e=>{switch(e){case"midi":return oe.Notes;case"audio":return oe.Audio;default:return F()}}})(NS||(NS={}));var ne;(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;D(C.satisfy(e,(i,n)=>i.deviceHost().address.equals(n.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(u.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(u.MIDIEffectHost):F("unknown type")).map(({box:i})=>Qm.lookupIndexField(i)).filter(i=>e.some(n=>b.Comparator(n.uuid,i.address.uuid)!==0)).sort((i,n)=>i.getValue()-n.getValue()).forEach((i,n)=>i.setValue(n)),e.forEach(i=>i.box.delete())}})(ne||(ne={}));var Xm=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ap,Ym,Wi,Ba,eg,tg=class{constructor(e,t){Ap.set(this,void 0),Ym.set(this,new ie),Wi.set(this,void 0),Ba.set(this,void 0),eg.set(this,void 0),Xm(this,Ap,e,"f"),Xm(this,Wi,Wt.create(e.box.tracks,o=>t.adapterFor(o,vt),u.TrackCollection),"f"),Xm(this,Ba,b.newSet(({uuid:o})=>o),"f"),Xm(this,eg,Gt(this,Wi,"f").catchupAndSubscribe({onAdd:o=>Gt(this,Ba,"f").add({uuid:o.uuid,subscription:o.regions.subscribeChanges(()=>Gt(this,Ym,"f").notify())}),onRemove:({uuid:o})=>Gt(this,Ba,"f").removeByKey(o).subscription.terminate(),onReorder:o=>{}}),"f")}create(e,t,o){let i=Gt(this,Ap,"f").box.graph,n=Gt(this,Ap,"f").box.tracks;dr.create(i,b.generate(),s=>{s.index.setValue(o??Gt(this,Wi,"f").getMinFreeIndex()),s.type.setValue(e),s.tracks.refer(n),s.target.refer(t)})}controls(e){return m.wrap(Gt(this,Wi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Gt(this,Wi,"f").adapters(),o=t.indexOf(e);if(o===-1)return F(`Cannot delete ${e}. Does not exist.`);for(let i=o+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return Gt(this,Wi,"f")}values(){return Gt(this,Wi,"f").adapters()}catchupAndSubscribe(e){return Gt(this,Wi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Gt(this,Ym,"f").subscribe(e)}terminate(){Gt(this,Wi,"f").terminate(),Gt(this,eg,"f").terminate(),Gt(this,Ba,"f").forEach(({subscription:e})=>e.terminate()),Gt(this,Ba,"f").clear()}};Ap=new WeakMap,Ym=new WeakMap,Wi=new WeakMap,Ba=new WeakMap,eg=new WeakMap;var IS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},rg,Kr,mr=class{constructor(e,t){this.type="bus",this.accepts="audio",rg.set(this,void 0),Kr.set(this,void 0),IS(this,rg,e,"f"),IS(this,Kr,t,"f")}catchupAndSubscribe(e){return e(this),Zi(this,Kr,"f").subscribe(ke.Children,()=>e(this))}get uuid(){return Zi(this,Kr,"f").address.uuid}get address(){return Zi(this,Kr,"f").address}get box(){return Zi(this,Kr,"f")}get enabledField(){return Zi(this,Kr,"f").enabled}get minimizedField(){return Zi(this,Kr,"f").minimized}get iconField(){return Zi(this,Kr,"f").icon}get labelField(){return Zi(this,Kr,"f").label}get colorField(){return Zi(this,Kr,"f").color}get iconSymbol(){return De.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Zi(this,rg,"f").boxAdapters.adapterFor(Zi(this,Kr,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};rg=new WeakMap,Kr=new WeakMap;var _p=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ft=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},vn,xu,bu,di,Pp,ig=class{constructor(e,t){vn.set(this,void 0),xu.set(this,void 0),bu.set(this,void 0),di.set(this,void 0),Pp.set(this,W.Empty),_p(this,vn,new O,"f"),_p(this,xu,ft(this,vn,"f").own(new ie),"f"),_p(this,bu,ft(this,vn,"f").own(new Ur(De.Unknown)),"f"),_p(this,di,ft(this,vn,"f").own(new Ur(m.None)),"f"),ft(this,vn,"f").own(ft(this,di,"f").subscribe(o=>{ft(this,Pp,"f").terminate(),_p(this,Pp,o.getValue().match({none:()=>(ft(this,xu,"f").notify(m.None),W.Empty),some:({labelField:i,iconField:n})=>W.many(n.catchupAndSubscribe(s=>ft(this,bu,"f").setValue(De.fromName(s.getValue()))),i.catchupAndSubscribe(s=>ft(this,xu,"f").notify(m.wrap(s.getValue()))))}),"f")})),ft(this,vn,"f").own(e.catchupAndSubscribe({onAdded:({box:o})=>{D(ft(this,di,"f").getValue().isEmpty(),"Already set");let i=o instanceof Oi?t.adapterFor(o,mr):t.adapterFor(o,ne.isInstrument);ft(this,di,"f").getValue().unwrapOrNull()!==i&&ft(this,di,"f").setValue(m.wrap(i))},onRemoved:({box:o})=>{D(ft(this,di,"f").getValue().unwrap("Cannot remove").box.address.equals(o.address),"Unexpected value to remove"),ft(this,di,"f").setValue(m.None)}},u.InstrumentHost,u.AudioOutput))}getValue(){return ft(this,di,"f").getValue()}subscribe(e){return ft(this,di,"f").subscribe(e)}catchupAndSubscribe(e){return e(ft(this,di,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),ft(this,xu,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return ft(this,bu,"f").catchupAndSubscribe(e)}set label(e){this.getValue().ifSome(t=>t.labelField.setValue(e))}get label(){return this.getValue().map(e=>e.labelField.getValue())}set icon(e){this.getValue().ifSome(t=>t.iconField.setValue(De.toName(e)))}get icon(){return this.getValue().match({none:()=>De.Unknown,some:e=>De.fromName(e.iconField.getValue())})}get iconValue(){return ft(this,bu,"f")}terminate(){ft(this,vn,"f").terminate(),ft(this,Pp,"f").terminate()}};vn=new WeakMap,xu=new WeakMap,bu=new WeakMap,di=new WeakMap,Pp=new WeakMap;var kS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fa=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},og,yn,fe=class{constructor(e){og.set(this,void 0),yn.set(this,void 0),kS(this,og,e,"f"),kS(this,yn,be.newSet(t=>t.address),"f")}terminate(){Fa(this,yn,"f").forEach(e=>e.terminate()),Fa(this,yn,"f").clear()}parameters(){return Fa(this,yn,"f").values()}parameterAt(e){return Fa(this,yn,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,o,i,n){let s=new Na(Fa(this,og,"f"),e,t,o,i,n),a=Fa(this,yn,"f").add(s);return D(a,`Could not add adapter for ${e}`),s}removeParameter(e){return Fa(this,yn,"f").removeByKey(e)}};og=new WeakMap,yn=new WeakMap;var Ia=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},at=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ka,pi,is,wu,ng,sg,Sp,Au=class{constructor(e,t){ka.set(this,void 0),pi.set(this,void 0),is.set(this,void 0),wu.set(this,void 0),ng.set(this,void 0),sg.set(this,void 0),Sp.set(this,W.Empty),Ia(this,ka,e,"f"),Ia(this,pi,t,"f"),Ia(this,is,new O,"f"),Ia(this,wu,at(this,is,"f").own(new ie),"f"),at(this,is,"f").own(t.targetBus.catchupAndSubscribe(()=>{at(this,Sp,"f").terminate(),Ia(this,Sp,this.optTargetBus.match({none:()=>(at(this,wu,"f").notify(m.None),W.Empty),some:o=>o.catchupAndSubscribe(i=>at(this,wu,"f").notify(m.wrap(i)))}),"f")})),Ia(this,ng,at(this,is,"f").own(new Na(at(this,ka,"f"),at(this,pi,"f").sendPan,S.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Ia(this,sg,at(this,is,"f").own(new Na(at(this,ka,"f"),at(this,pi,"f").sendGain,S.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),at(this,wu,"f").subscribe(e)}get uuid(){return at(this,pi,"f").address.uuid}get address(){return at(this,pi,"f").address}get box(){return at(this,pi,"f")}get indexField(){return at(this,pi,"f").index}get sendPan(){return at(this,ng,"f")}get sendGain(){return at(this,sg,"f")}get targetBus(){return at(this,ka,"f").boxAdapters.adapterFor(at(this,pi,"f").targetBus.targetVertex.unwrap("no audioUnit").box,mr)}get optTargetBus(){return at(this,pi,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>at(this,ka,"f").boxAdapters.adapterFor(t,mr)})))}delete(){at(this,pi,"f").delete()}terminate(){at(this,is,"f").terminate(),at(this,Sp,"f").terminate()}};ka=new WeakMap,pi=new WeakMap,is=new WeakMap,wu=new WeakMap,ng=new WeakMap,sg=new WeakMap,Sp=new WeakMap;var Ep=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},No=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ag,lg,_u,Pu,Bp,ug=class{constructor(e,t){ag.set(this,void 0),lg.set(this,void 0),_u.set(this,void 0),Pu.set(this,void 0),Bp.set(this,W.Empty),Ep(this,ag,e,"f"),Ep(this,lg,t,"f"),Ep(this,_u,new O,"f"),Ep(this,Pu,No(this,_u,"f").own(new ie),"f"),No(this,_u,"f").own(e.catchupAndSubscribe(()=>{No(this,Bp,"f").terminate(),Ep(this,Bp,this.adapter.match({none:()=>(No(this,Pu,"f").notify(m.None),W.Empty),some:o=>o.catchupAndSubscribe(i=>No(this,Pu,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return No(this,Pu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return No(this,ag,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>No(this,lg,"f").adapterFor(t,mr)})))}terminate(){No(this,_u,"f").terminate(),No(this,Bp,"f").terminate()}};ag=new WeakMap,lg=new WeakMap,_u=new WeakMap,Pu=new WeakMap,Bp=new WeakMap;var xn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},se=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},cg,$S,Io,Wr,xt,Da,Su,$a,dg,Fp,pg,hg,DS,MS,hi=class{constructor(e,t){cg.add(this),this.class="device-host",Io.set(this,new O),Wr.set(this,void 0),xt.set(this,void 0),Da.set(this,void 0),Su.set(this,void 0),$a.set(this,void 0),dg.set(this,void 0),Fp.set(this,void 0),pg.set(this,void 0),hg.set(this,void 0),xn(this,Wr,e,"f"),xn(this,xt,t,"f"),xn(this,Da,se(this,Io,"f").own(new fe(se(this,Wr,"f"))),"f"),xn(this,Su,se(this,Io,"f").own(new tg(this,se(this,Wr,"f").boxAdapters)),"f"),xn(this,$a,se(this,Io,"f").own(new ig(se(this,xt,"f").input.pointerHub,se(this,Wr,"f").boxAdapters)),"f"),xn(this,dg,se(this,Io,"f").own(Wt.create(se(this,xt,"f").midiEffects,o=>se(this,Wr,"f").boxAdapters.adapterFor(o,ne.isMidiEffect),u.MIDIEffectHost)),"f"),xn(this,Fp,se(this,Io,"f").own(Wt.create(se(this,xt,"f").audioEffects,o=>se(this,Wr,"f").boxAdapters.adapterFor(o,ne.isAudioEffect),u.AudioEffectHost)),"f"),xn(this,pg,se(this,Io,"f").own(Wt.create(se(this,xt,"f").auxSends,o=>se(this,Wr,"f").boxAdapters.adapterFor(o,Au),u.AuxSend)),"f"),xn(this,hg,se(this,Io,"f").own(new ug(se(this,xt,"f").output,se(this,Wr,"f").boxAdapters)),"f"),this.namedParameter=se(this,cg,"m",DS).call(this,t),se(this,cg,"m",MS).call(this)}get box(){return se(this,xt,"f")}get uuid(){return se(this,xt,"f").address.uuid}get address(){return se(this,xt,"f").address}get indexField(){return se(this,xt,"f").index}get type(){return se(this,xt,"f").type.getValue()}get captureBox(){return se(this,xt,"f").capture.targetVertex}get tracks(){return se(this,Su,"f")}get input(){return se(this,$a,"f")}get midiEffects(){return se(this,dg,"f")}get audioEffects(){return se(this,Fp,"f")}get inputAdapter(){return se(this,$a,"f").getValue()}get auxSends(){return se(this,pg,"f")}get output(){return se(this,hg,"f")}get isBus(){return this.input.getValue().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.getValue().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return se(this,xt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(se(this,Wr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return se(this,xt,"f").midiEffects}get inputField(){return se(this,xt,"f").input}get audioEffectsField(){return se(this,xt,"f").audioEffects}get tracksField(){return se(this,xt,"f").tracks}get minimizedField(){return se(this,$a,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return se(this,$a,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.getValue();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let t of se(this,Fp,"f").adapters())yield*t.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>m.None}}indicesLimit(){let e=se(this,Wr,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),o=this.type,i=t,n=t;for(;i>0&&e[i-1].type===o;)i--;for(;n<e.length-1&&e[n+1].type===o;)n++;return[i,n+1]}move(e){se(this,Wr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){se(this,Su,"f").collection.move(e,t)}deleteTrack(e){se(this,Su,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){se(this,Io,"f").terminate()}};$S=hi,Io=new WeakMap,Wr=new WeakMap,xt=new WeakMap,Da=new WeakMap,Su=new WeakMap,$a=new WeakMap,dg=new WeakMap,Fp=new WeakMap,pg=new WeakMap,hg=new WeakMap,cg=new WeakSet,DS=function(e){return{volume:se(this,Da,"f").createParameter(e.volume,$S.VolumeMapper,P.decible,"volume"),panning:se(this,Da,"f").createParameter(e.panning,S.bipolar(),P.panning,"panning",.5),mute:se(this,Da,"f").createParameter(e.mute,S.bool,P.bool,"mute"),solo:se(this,Da,"f").createParameter(e.solo,S.bool,P.bool,"solo")}},MS=function(){let e=this.address.toString(),t=se(this,xt,"f").capture.targetAddress.unwrapOrUndefined(),o=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${se(this,xt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;D(this.type!==Bt.Instrument||se(this,xt,"f").capture.targetAddress.nonEmpty(),o)};hi.VolumeMapper=S.decibel(-96,-9,6);var Eu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Qe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},fg,os,gr,Ma,mg,gg,Np,CS,TS,vt=class{constructor(e,t){fg.add(this),os.set(this,void 0),gr.set(this,void 0),Ma.set(this,void 0),mg.set(this,void 0),gg.set(this,void 0),Np.set(this,void 0),Eu(this,os,e,"f"),Eu(this,gr,t,"f"),Eu(this,Ma,new O,"f"),Eu(this,mg,Qe(this,Ma,"f").own(new qm(this,e.boxAdapters)),"f"),Eu(this,gg,Qe(this,Ma,"f").own(new Jm(this,e.boxAdapters)),"f"),Eu(this,Np,Qe(this,Ma,"f").own(new Ur(-1)),"f")}catchupAndSubscribePath(e){let t=[m.None,m.None],o=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return W.many(Qe(this,fg,"m",CS).call(this,i=>{t[0].equals(i)||(t[0]=i,o())}),Qe(this,fg,"m",TS).call(this,i=>{t[1].equals(i)||(t[1]=i,o())}))}set targetDeviceName(e){Qe(this,gr,"f").target.targetVertex.ifSome(t=>{let o=t.box;if(o instanceof st)return Qe(this,os,"f").boxAdapters.adapterFor(o,hi).input.getValue().ifSome(({labelField:n})=>n.setValue(e));if("label"in o&&o.label instanceof $)return o.label.setValue(e)})}get targetDeviceName(){return Qe(this,gr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof st?Qe(this,os,"f").boxAdapters.adapterFor(t,hi).input.label:"label"in t&&t.label instanceof $?m.wrap(t.label.getValue()):m.wrap(t.name)})}terminate(){Qe(this,Ma,"f").terminate()}get audioUnit(){return Ie(Qe(this,gr,"f").tracks.targetVertex.unwrap().box,st)}get target(){return Qe(this,gr,"f").target}get clips(){return Qe(this,mg,"f")}get regions(){return Qe(this,gg,"f")}get enabled(){return Qe(this,gr,"f").enabled}get indexField(){return Qe(this,gr,"f").index}get type(){return Qe(this,gr,"f").type.getValue()}get box(){return Qe(this,gr,"f")}get uuid(){return Qe(this,gr,"f").address.uuid}get address(){return Qe(this,gr,"f").address}get listIndex(){return Qe(this,Np,"f").getValue()}set listIndex(e){Qe(this,Np,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===oe.Audio;case"note-clip":return this.type===oe.Notes;case"value-clip":return this.type===oe.Value;case"audio-region":return this.type===oe.Audio;case"note-region":return this.type===oe.Notes;case"value-region":return this.type===oe.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let o=t,i=Qe(this,os,"f").clipSequencing.iterate(this.uuid,e,e+Cf);for(let{optClip:n,sectionFrom:s}of i)o=n.match({none:()=>{let a=this.regions.collection.lowerEqual(e,l=>!l.mute);if(a===null){let l=this.regions.collection.optAt(0);return Ce(l,gn)?l.incomingValue(t):t}else if(Ce(a,gn))return e<a.complete?a.valueAt(e,t):a.outgoingValue(t);return t},some:a=>s===e&&Ce(a,Jn)?a.valueAt(e,t):t});return o}};os=new WeakMap,gr=new WeakMap,Ma=new WeakMap,mg=new WeakMap,gg=new WeakMap,Np=new WeakMap,fg=new WeakSet,CS=function(e){let t=Qe(this,gr,"f").target.targetVertex;if(t.nonEmpty()){let o=t.unwrap().box;return o instanceof st?Qe(this,os,"f").boxAdapters.adapterFor(o,hi).input.catchupAndSubscribeLabelChange(n=>e(n)):"label"in o&&o.label instanceof $?o.label.catchupAndSubscribe(i=>e(m.wrap(i.getValue()))):(e(m.wrap(o.name)),W.Empty)}return e(m.None),W.Empty},TS=function(e){let t=this.type;switch(t){case oe.Audio:case oe.Notes:return e(m.wrap(oe[t])),W.Empty;case oe.Value:{let o=Qe(this,gr,"f").target.targetVertex.unwrap();if(o.isField())e(Qe(this,os,"f").parameterFieldAdapters.opt(o.address).map(i=>i.name));else if(o.isBox())e(m.wrap(o.name));else return F("Illegal State. Vertex is not a field nor box.");return W.Empty}case oe.Undefined:return e(m.wrap("")),W.Empty;default:return e(m.None),W.Empty}};var qt=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},de=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ns,Zr,ss,Ca,vg,yg,Ta,Ra,as,ls,Oa,Bu,Ip,RS=[u.Automation,u.Modulation,u.MIDIControl,u.ParameterController],Na=class{constructor(e,t,o,i,n,s){ns.set(this,void 0),Zr.set(this,void 0),ss.set(this,void 0),Ca.set(this,void 0),vg.set(this,void 0),yg.set(this,void 0),Ta.set(this,new O),Ra.set(this,void 0),as.set(this,void 0),ls.set(this,m.None),Oa.set(this,m.None),Bu.set(this,null),Ip.set(this,!1),qt(this,ns,e,"f"),qt(this,Zr,t,"f"),qt(this,ss,o,"f"),qt(this,Ca,i,"f"),qt(this,vg,n,"f"),qt(this,yg,s??0,"f"),de(this,Ta,"f").own(de(this,ns,"f").parameterFieldAdapters.register(this)),qt(this,Ra,de(this,Ta,"f").own(new ie),"f"),qt(this,as,new Ct,"f"),de(this,Ta,"f").own(de(this,Zr,"f").subscribe(()=>de(this,Ra,"f").notify(this))),de(this,Ta,"f").own(de(this,Zr,"f").pointerHub.catchupAndSubscribe({onAdded:a=>{de(this,as,"f").proxy.onControlSourceAdd(Lb(a.pointerType)),a.box.accept({visitTrackBox:l=>{D(de(this,ls,"f").isEmpty(),"Already assigned");let c=de(this,ns,"f").boxAdapters.adapterFor(l,vt);qt(this,ls,m.wrap(c),"f"),de(this,ns,"f").isMainThread&&qt(this,Oa,m.wrap(de(this,ns,"f").liveStreamReceiver.subscribeFloat(de(this,Zr,"f").address,d=>{de(this,Bu,"f")!==d&&(qt(this,Bu,d,"f"),de(this,Ra,"f").notify(this))})),"f")}})},onRemoved:a=>{de(this,as,"f").proxy.onControlSourceRemove(Lb(a.pointerType)),a.box.accept({visitTrackBox:l=>{D(de(this,ls,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),qt(this,ls,m.None,"f"),de(this,ns,"f").isMainThread&&(de(this,Oa,"f").ifSome(c=>c.terminate()),qt(this,Oa,m.None,"f"),qt(this,Bu,null,"f"),de(this,Ra,"f").notify(this))}})}},...RS)),t.getValue(),o.clamp(t.getValue())}registerMidiControl(){return de(this,as,"f").proxy.onControlSourceAdd("midi"),qt(this,Ip,!0,"f"),{terminate:()=>{qt(this,Ip,!1,"f"),de(this,as,"f").proxy.onControlSourceRemove("midi")}}}get field(){return de(this,Zr,"f")}get valueMapping(){return de(this,ss,"f")}get stringMapping(){return de(this,Ca,"f")}get name(){return de(this,vg,"f")}get anchor(){return de(this,yg,"f")}get type(){return de(this,Zr,"f").type}get address(){return de(this,Zr,"f").address}get track(){return de(this,ls,"f")}valueAt(e){let t=de(this,ls,"f");if(t.nonEmpty()){let o=t.unwrap();if(o.enabled)return this.valueMapping.y(o.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return de(this,Ra,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return de(this,Ip,"f")&&e.onControlSourceAdd("midi"),de(this,Zr,"f").pointerHub.filter(...RS).forEach(t=>e.onControlSourceAdd(Lb(t.pointerType))),de(this,as,"f").subscribe(e)}getValue(){return de(this,Zr,"f").getValue()}setValue(e){de(this,Zr,"f").setValue(e)}setUnitValue(e){this.setValue(de(this,ss,"f").y(e))}getUnitValue(){return de(this,ss,"f").x(this.getValue())}getControlledValue(){return de(this,ss,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return de(this,Bu,"f")??this.getUnitValue()}getControlledPrintValue(){return de(this,Ca,"f").x(this.getControlledValue())}getPrintValue(){return de(this,Ca,"f").x(this.getValue())}setPrintValue(e){let t=de(this,Ca,"f").y(e);t.type==="unitValue"?this.setUnitValue(ue(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(de(this,ss,"f").clamp(de(this,Zr,"f").initValue))}terminate(){de(this,Oa,"f").ifSome(e=>e.terminate()),qt(this,Oa,m.None,"f"),de(this,Ta,"f").terminate()}};ns=new WeakMap,Zr=new WeakMap,ss=new WeakMap,Ca=new WeakMap,vg=new WeakMap,yg=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,as=new WeakMap,ls=new WeakMap,Oa=new WeakMap,Bu=new WeakMap,Ip=new WeakMap;var Lb=r=>{switch(r){case u.Automation:return"automated";case u.Modulation:return"modulated";case u.MIDIControl:return"midi";case u.ParameterController:return"external";default:return F(`${r.toString()} is an unknown pointer type`)}};var Kb=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},bn,Va,xg,bg=class{constructor(e,t,o){bn.set(this,void 0),Va.set(this,void 0),xg.set(this,void 0),Kb(this,bn,b.newSet(i=>i.uuid),"f"),Kb(this,Va,new Ct,"f"),Kb(this,xg,e.catchupAndSubscribe({onAdded:i=>{let n=t(i.box),s=Gi(this,bn,"f").add(n);D(s,`Could not add ${n}`),Gi(this,Va,"f").proxy.onAdd(n)},onRemoved:i=>{let n=i.box.address.uuid;Gi(this,Va,"f").proxy.onRemove(Gi(this,bn,"f").removeByKey(n))}},o),"f")}subscribe(e){return Gi(this,Va,"f").subscribe(e)}catchupAndSubscribe(e){return Gi(this,bn,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Gi(this,bn,"f").values()}size(){return Gi(this,bn,"f").size()}isEmpty(){return this.size()===0}terminate(){Gi(this,bn,"f").clear(),Gi(this,Va,"f").terminate(),Gi(this,xg,"f").terminate()}};bn=new WeakMap,Va=new WeakMap,xg=new WeakMap;var Wb=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Rt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Zb,wg,kp,fi,ko,OS,mi=class{constructor(e,t){Zb.add(this),this.type="audio-effect",this.accepts="audio",kp.set(this,void 0),fi.set(this,void 0),ko.set(this,void 0),Wb(this,kp,e,"f"),Wb(this,fi,t,"f"),Wb(this,ko,new fe(Rt(this,kp,"f")),"f"),this.namedParameter=Rt(this,Zb,"m",OS).call(this,t)}get box(){return Rt(this,fi,"f")}get uuid(){return Rt(this,fi,"f").address.uuid}get address(){return Rt(this,fi,"f").address}get indexField(){return Rt(this,fi,"f").index}get labelField(){return Rt(this,fi,"f").label}get enabledField(){return Rt(this,fi,"f").enabled}get minimizedField(){return Rt(this,fi,"f").minimized}get host(){return Rt(this,fi,"f").host}deviceHost(){return Rt(this,kp,"f").boxAdapters.adapterFor(Rt(this,fi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Rt(this,ko,"f").terminate()}};wg=mi,kp=new WeakMap,fi=new WeakMap,ko=new WeakMap,Zb=new WeakSet,OS=function(e){return{delay:Rt(this,ko,"f").createParameter(e.delay,S.linearInteger(0,wg.OffsetFractions.length-1),wg.OffsetStringMapping,"delay"),feedback:Rt(this,ko,"f").createParameter(e.feedback,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:Rt(this,ko,"f").createParameter(e.cross,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),filter:Rt(this,ko,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:Rt(this,ko,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Rt(this,ko,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};mi.OffsetFractions=ur.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();mi.OffsetStringMapping=P.indices("",wg.OffsetFractions.map(([r,e])=>`${r}/${e}`));var Gb=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ot=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},qb,$p,gi,$o,VS,Fu=class{constructor(e,t){qb.add(this),this.type="audio-effect",this.accepts="audio",$p.set(this,void 0),gi.set(this,void 0),$o.set(this,void 0),Gb(this,$p,e,"f"),Gb(this,gi,t,"f"),Gb(this,$o,new fe(Ot(this,$p,"f")),"f"),this.namedParameter=Ot(this,qb,"m",VS).call(this,t)}get box(){return Ot(this,gi,"f")}get uuid(){return Ot(this,gi,"f").address.uuid}get address(){return Ot(this,gi,"f").address}get indexField(){return Ot(this,gi,"f").index}get labelField(){return Ot(this,gi,"f").label}get enabledField(){return Ot(this,gi,"f").enabled}get minimizedField(){return Ot(this,gi,"f").minimized}get host(){return Ot(this,gi,"f").host}deviceHost(){return Ot(this,$p,"f").boxAdapters.adapterFor(Ot(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ot(this,$o,"f").terminate()}};$p=new WeakMap,gi=new WeakMap,$o=new WeakMap,qb=new WeakSet,VS=function(e){return{decay:Ot(this,$o,"f").createParameter(e.decay,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Ot(this,$o,"f").createParameter(e.preDelay,S.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Ot(this,$o,"f").createParameter(e.damp,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Ot(this,$o,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Ot(this,$o,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Ot(this,$o,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Hb=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},At=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Qb,Dp,Gr,qi,jS,Nu=class{constructor(e,t){Qb.add(this),this.type="audio-effect",this.accepts="audio",Dp.set(this,void 0),Gr.set(this,void 0),qi.set(this,void 0),Hb(this,Dp,e,"f"),Hb(this,Gr,t,"f"),Hb(this,qi,new fe(At(this,Dp,"f")),"f"),this.namedParameter=At(this,Qb,"m",jS).call(this,t)}get box(){return At(this,Gr,"f")}get uuid(){return At(this,Gr,"f").address.uuid}get address(){return At(this,Gr,"f").address}get indexField(){return At(this,Gr,"f").index}get labelField(){return At(this,Gr,"f").label}get enabledField(){return At(this,Gr,"f").enabled}get minimizedField(){return At(this,Gr,"f").minimized}get host(){return At(this,Gr,"f").host}get spectrum(){return At(this,Gr,"f").address.append(4095)}deviceHost(){return At(this,Dp,"f").boxAdapters.adapterFor(At(this,Gr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){At(this,qi,"f").terminate()}};Dp=new WeakMap,Gr=new WeakMap,qi=new WeakMap,Qb=new WeakSet,jS=function(e){return{highPass:zS(At(this,qi,"f"),e.highPass,"High-Pass"),lowShelf:US(At(this,qi,"f"),e.lowShelf,"Low-Shelf"),lowBell:Jb(At(this,qi,"f"),e.lowBell,"Low-Bell"),midBell:Jb(At(this,qi,"f"),e.midBell,"Mid-Bell"),highBell:Jb(At(this,qi,"f"),e.highBell,"High-Bell"),highShelf:US(At(this,qi,"f"),e.highShelf,"High-Shelf"),lowPass:zS(At(this,qi,"f"),e.lowPass,"Low-Pass")}};var Xb=S.exponential(20,2e4),LS=S.linear(-24,24),KS=S.exponential(.01,10),zS=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xb,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,KS,P.numeric({fractionDigits:3}),`${t} Q`)}),US=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xb,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,LS,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Jb=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xb,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,LS,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,KS,P.numeric({fractionDigits:3}),`${t} Q`)});var WS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Br=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ag,_g,Fr,us=class{constructor(e,t){this.type="marker-event",Ag.set(this,new O),_g.set(this,void 0),Fr.set(this,void 0),WS(this,_g,e,"f"),WS(this,Fr,t,"f"),Br(this,Ag,"f").own(Br(this,Fr,"f").subscribe(ke.Children,o=>{if(!this.trackAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackAdapter.unwrap();Br(this,Fr,"f").position.address.equals(o.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return Br(this,Fr,"f")}get uuid(){return Br(this,Fr,"f").address.uuid}get address(){return Br(this,Fr,"f").address}get position(){return Br(this,Fr,"f").position.getValue()}get plays(){return Br(this,Fr,"f").plays.getValue()}get hue(){return Br(this,Fr,"f").hue.getValue()}get label(){return Br(this,Fr,"f").label.getValue()}get trackAdapter(){return Br(this,Fr,"f").track.targetVertex.map(e=>Br(this,_g,"f").boxAdapters.adapterFor(e.box,Do).markerTrack)}terminate(){Br(this,Ag,"f").terminate()}toString(){return`{MarkerBoxAdapter ${b.toString(Br(this,Fr,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Ag=new WeakMap,_g=new WeakMap,Fr=new WeakMap;us.Comparator=(r,e)=>r.position-e.position;var Mp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Cp,Iu,Tp,za,Pg,Sg=class{constructor(e,t){Cp.set(this,void 0),Iu.set(this,void 0),Tp.set(this,void 0),za.set(this,void 0),Pg.set(this,void 0),Mp(this,Cp,e,"f"),Mp(this,Iu,t,"f"),this.changeNotifier=new ie,Mp(this,Tp,b.newSet(o=>o.uuid),"f"),Mp(this,za,Sr.create(us.Comparator),"f"),Mp(this,Pg,vi(this,Iu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{if(o instanceof Tl){let i=vi(this,Cp,"f").boxAdapters.adapterFor(o,us),n=vi(this,Tp,"f").add(i);D(n,"Could not add adapter"),vi(this,za,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:o}}})=>{vi(this,za,"f").remove(vi(this,Tp,"f").removeByKey(o)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return vi(this,Cp,"f")}get enabled(){return vi(this,Iu,"f").enabled.getValue()}get events(){return vi(this,za,"f")}get object(){return vi(this,Iu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){vi(this,za,"f").onIndexingChanged(),this.dispatchChange()}terminate(){vi(this,Pg,"f").terminate()}};Cp=new WeakMap,Iu=new WeakMap,Tp=new WeakMap,za=new WeakMap,Pg=new WeakMap;var ZS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wn=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Hi,Eg,Do=class{constructor(e,t){Hi.set(this,void 0),Eg.set(this,void 0),ZS(this,Hi,t,"f"),ZS(this,Eg,new Sg(e,wn(this,Hi,"f").markerTrack),"f")}terminate(){}get box(){return wn(this,Hi,"f")}get uuid(){return wn(this,Hi,"f").address.uuid}get address(){return wn(this,Hi,"f").address}get markerTrack(){return wn(this,Eg,"f")}get signature(){return[wn(this,Hi,"f").signature.nominator.getValue(),wn(this,Hi,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=wn(this,Hi,"f").signature;return X.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),wn(this,Hi,"f").signature.subscribe(()=>e(this.signature))}};Hi=new WeakMap,Eg=new WeakMap;var jN=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Rp=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},cs,ds=class{constructor(e,t){cs.set(this,void 0),jN(this,cs,t,"f")}get box(){return Rp(this,cs,"f")}get uuid(){return Rp(this,cs,"f").address.uuid}get address(){return Rp(this,cs,"f").address}get source(){return Rp(this,cs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Rp(this,cs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};cs=new WeakMap;var Ua=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},yi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Bg,ja,La,Fg,Ng,Op,xi=class{constructor(e,t){Bg.set(this,void 0),ja.set(this,void 0),La.set(this,void 0),Fg.set(this,void 0),Ng.set(this,void 0),Op.set(this,!1),Ua(this,Bg,e,"f"),Ua(this,ja,t,"f"),Ua(this,La,new O,"f"),Ua(this,Fg,t.attributes,"f"),Ua(this,Ng,yi(this,La,"f").own(new fe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return yi(this,La,"f").own(e)}ownAll(...e){yi(this,La,"f").ownAll(...e)}onSelected(){Ua(this,Op,!0,"f")}onDeselected(){Ua(this,Op,!1,"f")}isSelected(){return yi(this,Op,"f")}get box(){return yi(this,ja,"f")}get attributes(){return yi(this,Fg,"f")}get uuid(){return yi(this,ja,"f").address.uuid}get address(){return yi(this,ja,"f").address}get parameters(){return yi(this,Ng,"f")}get modular(){return yi(this,Bg,"f").boxAdapters.adapterFor(yi(this,ja,"f").attributes.collection.targetVertex.unwrap().box,ps)}terminate(){yi(this,La,"f").terminate()}};Bg=new WeakMap,ja=new WeakMap,La=new WeakMap,Fg=new WeakMap,Ng=new WeakMap,Op=new WeakMap;var Ig=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},An=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},kg,hs,Vp,$g,er;(function(r){r.Input="input",r.Output="output"})(er||(er={}));var tr=class r{static create(e,t,o,i){return new r(e,t,o,i??t.fieldName)}constructor(e,t,o,i){kg.set(this,void 0),hs.set(this,void 0),Vp.set(this,void 0),$g.set(this,void 0),Ig(this,kg,e,"f"),Ig(this,hs,t,"f"),Ig(this,Vp,o,"f"),Ig(this,$g,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(o=>o===t))}get connections(){return An(this,hs,"f").pointerHub.isEmpty()?C.empty():An(this,hs,"f").pointerHub.filter(u.VoltageConnection).map(({box:e})=>An(this,kg,"f").adapterFor(e,ds))}get field(){return An(this,hs,"f")}get address(){return An(this,hs,"f").address}get direction(){return An(this,Vp,"f")}get name(){return An(this,$g,"f")}toString(){return`{ModuleConnectorAdapter address: ${An(this,hs,"f").address.toString()}, direction: ${An(this,Vp,"f")}}`}};kg=new WeakMap,hs=new WeakMap,Vp=new WeakMap,$g=new WeakMap;var Yb=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},zp=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Dg,Up,jp,ku=class extends xi{constructor(e,t){super(e,t),Dg.set(this,void 0),Up.set(this,void 0),jp.set(this,void 0),Yb(this,Dg,this.parameters.createParameter(t.time,S.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),Yb(this,Up,tr.create(e.boxAdapters,t.voltageInput,er.Input,"Input"),"f"),Yb(this,jp,tr.create(e.boxAdapters,t.voltageOutput,er.Output,"Output"),"f")}get parameterTime(){return zp(this,Dg,"f")}get voltageInput(){return zp(this,Up,"f")}get voltageOutput(){return zp(this,jp,"f")}get inputs(){return[zp(this,Up,"f")]}get outputs(){return[zp(this,jp,"f")]}};Dg=new WeakMap,Up=new WeakMap,jp=new WeakMap;var LN=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},GS=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Lp,$u=class extends xi{constructor(e,t){super(e,t),Lp.set(this,void 0),LN(this,Lp,tr.create(e.boxAdapters,t.input,er.Input,"Input"),"f")}get voltageInput(){return GS(this,Lp,"f")}get inputs(){return[GS(this,Lp,"f")]}get outputs(){return C.empty()}};Lp=new WeakMap;var ew=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Kp=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Mg,Wp,Zp,Du=class extends xi{constructor(e,t){super(e,t),Mg.set(this,void 0),Wp.set(this,void 0),Zp.set(this,void 0),ew(this,Mg,this.parameters.createParameter(t.gain,S.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),ew(this,Wp,tr.create(e.boxAdapters,t.voltageInput,er.Input,"Input"),"f"),ew(this,Zp,tr.create(e.boxAdapters,t.voltageOutput,er.Output,"Output"),"f")}get parameterGain(){return Kp(this,Mg,"f")}get voltageInput(){return Kp(this,Wp,"f")}get voltageOutput(){return Kp(this,Zp,"f")}get inputs(){return[Kp(this,Wp,"f")]}get outputs(){return[Kp(this,Zp,"f")]}};Mg=new WeakMap,Wp=new WeakMap,Zp=new WeakMap;var tw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rw=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Cg,Tg,Rg,Mu=class extends xi{constructor(e,t){super(e,t),Cg.set(this,void 0),Tg.set(this,void 0),Rg.set(this,void 0),tw(this,Cg,tr.create(e.boxAdapters,t.voltageInputX,er.Input,"X"),"f"),tw(this,Tg,tr.create(e.boxAdapters,t.voltageInputY,er.Input,"Y"),"f"),tw(this,Rg,tr.create(e.boxAdapters,t.voltageOutput,er.Output,"Result"),"f")}get inputs(){return[rw(this,Cg,"f"),rw(this,Tg,"f")]}get outputs(){return[rw(this,Rg,"f")]}};Cg=new WeakMap,Tg=new WeakMap,Rg=new WeakMap;var KN=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qS=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Gp,Cu=class extends xi{constructor(e,t){super(e,t),Gp.set(this,void 0),KN(this,Gp,tr.create(e.boxAdapters,t.output,er.Output,"Output"),"f")}get voltageOutput(){return qS(this,Gp,"f")}get inputs(){return C.empty()}get outputs(){return[qS(this,Gp,"f")]}};Gp=new WeakMap;var Tu;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>re(t.accept({visitModuleGainBox:o=>e.adapterFor(o,Du),visitModuleDelayBox:o=>e.adapterFor(o,ku),visitModuleMultiplierBox:o=>e.adapterFor(o,Mu),visitModularAudioInputBox:o=>e.adapterFor(o,Cu),visitModularAudioOutputBox:o=>e.adapterFor(o,$u)}),`Could not find ModuleAdapter for ${t.name}`)})(Tu||(Tu={}));var HS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ka=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Og,Vg,Wa,iw,Ru=class{constructor(e,t){Og.add(this),Vg.set(this,void 0),Wa.set(this,void 0),HS(this,Vg,e,"f"),HS(this,Wa,t,"f")}get box(){return Ka(this,Wa,"f")}get uuid(){return Ka(this,Wa,"f").address.uuid}get address(){return Ka(this,Wa,"f").address}get moduleAdapter(){return Tu.adapterFor(Ka(this,Vg,"f").boxAdapters,Ka(this,Og,"a",iw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Ka(this,Og,"a",iw).address)}terminate(){}};Vg=new WeakMap,Wa=new WeakMap,Og=new WeakSet,iw=function(){return Ka(this,Wa,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var JS=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Nr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ou,Ir,fs=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Ou.set(this,void 0),Ir.set(this,void 0),JS(this,Ou,e,"f"),JS(this,Ir,t,"f")}get box(){return Nr(this,Ir,"f")}get uuid(){return Nr(this,Ir,"f").address.uuid}get address(){return Nr(this,Ir,"f").address}get indexField(){return Nr(this,Ir,"f").index}get labelField(){return Nr(this,Ir,"f").label}get enabledField(){return Nr(this,Ir,"f").enabled}get minimizedField(){return Nr(this,Ir,"f").minimized}get host(){return Nr(this,Ir,"f").host}parameterAt(e){return F("Not yet implemented")}deviceHost(){return Nr(this,Ou,"f").boxAdapters.adapterFor(Nr(this,Ir,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Nr(this,Ou,"f").boxAdapters.adapterFor(Nr(this,Ir,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ps)}elements(){return Nr(this,Ir,"f").userInterface.elements.pointerHub.filter(u.DeviceUserInterface).map(e=>Nr(this,Ou,"f").boxAdapters.adapterFor(e.box,Ru))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};Ou=new WeakMap,Ir=new WeakMap;var qp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},je=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Vu,ms,zu,qr,Za,Ga,ps=class{constructor(e,t){Vu.set(this,new O),ms.set(this,void 0),zu.set(this,void 0),qr.set(this,void 0),Za.set(this,void 0),Ga.set(this,void 0),qp(this,zu,e,"f"),qp(this,qr,t,"f"),qp(this,ms,je(this,Vu,"f").own(new Ct),"f"),qp(this,Za,b.newSet(a=>a.uuid),"f"),qp(this,Ga,b.newSet(a=>a.uuid),"f");let o=a=>{let l=Tu.adapterFor(je(this,zu,"f").boxAdapters,a.box);je(this,Za,"f").add(l)&&je(this,ms,"f").proxy.onModuleAdded(l)},i=a=>je(this,ms,"f").proxy.onModuleRemoved(je(this,Za,"f").removeByKey(a.address.uuid)),n=a=>{let l=je(this,zu,"f").boxAdapters.adapterFor(a.box,ds);je(this,Ga,"f").add(l)&&je(this,ms,"f").proxy.onConnectionAdded(l)},s=a=>je(this,ms,"f").proxy.onConnectionRemoved(je(this,Ga,"f").removeByKey(a.address.uuid));je(this,qr,"f").modules.pointerHub.filter(u.ModuleCollection).forEach(o),je(this,qr,"f").connections.pointerHub.filter(u.ConnectionCollection).forEach(n),je(this,Vu,"f").own(je(this,qr,"f").modules.pointerHub.subscribe({onAdded:o,onRemoved:i},u.ModuleCollection)),je(this,Vu,"f").own(je(this,qr,"f").connections.pointerHub.subscribe({onAdded:n,onRemoved:s},u.ConnectionCollection))}catchupAndSubscribe(e){return vb(e.onModuleAdded,t=>je(this,Za,"f").forEach(o=>t(o))),vb(e.onConnectionAdded,t=>je(this,Ga,"f").forEach(o=>t(o))),je(this,ms,"f").subscribe(e)}get box(){return je(this,qr,"f")}get address(){return je(this,qr,"f").address}get uuid(){return je(this,qr,"f").address.uuid}get editingField(){return je(this,qr,"f").editing}get labelField(){return je(this,qr,"f").label}get modules(){return je(this,Za,"f").values()}get connections(){return je(this,Ga,"f").values()}get device(){return je(this,zu,"f").boxAdapters.adapterFor(re(je(this,qr,"f").device.pointerHub.incoming().at(0),"No device found").box,fs)}terminate(){console.debug(`terminate ${this}`),je(this,Vu,"f").terminate()}};Vu=new WeakMap,ms=new WeakMap,zu=new WeakMap,qr=new WeakMap,Za=new WeakMap,Ga=new WeakMap;var Hp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},vr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ow,ju,Jp,zg,Uu,Xp,Ug,Qp,jg,QS,Mo=class{constructor(e,t){ow.add(this),this.type="groove-adapter",Jp.set(this,new O),zg.set(this,void 0),Uu.set(this,void 0),Xp.set(this,void 0),Ug.set(this,new Ff({duration:()=>vr(this,jg,"f"),fx:o=>wb(o,vr(this,Qp,"f")),fy:o=>wb(o,1-vr(this,Qp,"f"))})),Qp.set(this,0),jg.set(this,X.SemiQuaver*2),Hp(this,zg,e,"f"),Hp(this,Uu,t,"f"),Hp(this,Xp,vr(this,Jp,"f").own(new fe(vr(this,zg,"f"))),"f"),this.namedParameter=vr(this,ow,"m",QS).call(this,t),vr(this,Jp,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(o=>Hp(this,jg,o.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(o=>Hp(this,Qp,sS(o.getValue(),.01),"f")))}unwarp(e){return vr(this,Ug,"f").unwarp(e)}warp(e){return vr(this,Ug,"f").warp(e)}get box(){return vr(this,Uu,"f")}get uuid(){return vr(this,Uu,"f").address.uuid}get address(){return vr(this,Uu,"f").address}terminate(){vr(this,Jp,"f").terminate()}};ju=Mo,Jp=new WeakMap,zg=new WeakMap,Uu=new WeakMap,Xp=new WeakMap,Ug=new WeakMap,Qp=new WeakMap,jg=new WeakMap,ow=new WeakSet,QS=function(e){return{duration:vr(this,Xp,"f").createParameter(e.duration,S.values(ju.DurationPPQNs),P.values("",ju.DurationPPQNs,ju.DurationStrings),"duration"),amount:vr(this,Xp,"f").createParameter(e.amount,S.unipolar(),P.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=ju.Durations.map(([r,e])=>X.fromSignature(r,e));Mo.DurationStrings=ju.Durations.map(([r,e])=>`${r}/${e}`);var Lu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},mt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Co,gs,Ku,Lg,Kg,Yp,eh,nw,vs=class{constructor(e,t,o,i,n){Co.set(this,void 0),gs.set(this,void 0),Ku.set(this,void 0),Lg.set(this,void 0),Kg.set(this,void 0),Yp.set(this,new O),eh.set(this,void 0),nw.set(this,m.None),Lu(this,Co,e,"f"),Lu(this,gs,t,"f"),Lu(this,Ku,o,"f"),Lu(this,Lg,i,"f"),Lu(this,Kg,n??0,"f"),Lu(this,eh,mt(this,Yp,"f").own(new ie),"f"),mt(this,Yp,"f").own(mt(this,Co,"f").subscribe(()=>mt(this,eh,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return mt(this,Co,"f")}get valueMapping(){return mt(this,gs,"f")}get stringMapping(){return mt(this,Ku,"f")}get name(){return mt(this,Lg,"f")}get anchor(){return mt(this,Kg,"f")}get type(){return mt(this,Co,"f").type}get address(){return mt(this,Co,"f").address}get track(){return mt(this,nw,"f")}subscribe(e){return mt(this,eh,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return mt(this,Co,"f").getValue()}setValue(e){mt(this,Co,"f").setValue(mt(this,gs,"f").clamp(e))}setUnitValue(e){this.setValue(mt(this,gs,"f").y(e))}getUnitValue(){return mt(this,gs,"f").x(this.getValue())}getPrintValue(){return mt(this,Ku,"f").x(this.getValue())}setPrintValue(e){let t=mt(this,Ku,"f").y(e);t.type==="unitValue"?this.setUnitValue(ue(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(mt(this,gs,"f").clamp(mt(this,Co,"f").initValue))}terminate(){mt(this,Yp,"f").terminate()}};Co=new WeakMap,gs=new WeakMap,Ku=new WeakMap,Lg=new WeakMap,Kg=new WeakMap,Yp=new WeakMap,eh=new WeakMap,nw=new WeakMap;var Wu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},To,Wg,Zg,Gg,qg,Hg,Jg=class{constructor(e){To.set(this,void 0),Wg.set(this,void 0),Zg.set(this,void 0),Gg.set(this,void 0),qg.set(this,void 0),Hg.set(this,void 0),Wu(this,To,e,"f"),Wu(this,Wg,new vs(bi(this,To,"f").keyboard,S.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Wu(this,Zg,new vs(bi(this,To,"f").timeRangeInQuarters,S.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),Wu(this,Gg,new vs(bi(this,To,"f").noteScale,S.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),Wu(this,qg,new vs(bi(this,To,"f").noteLabels,S.bool,P.bool,"Note Labels"),"f"),Wu(this,Hg,new vs(bi(this,To,"f").transpose,S.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return bi(this,To,"f").box.subscribe(ke.Children,()=>e(this))}get object(){return bi(this,To,"f")}get keyboard(){return bi(this,Wg,"f")}get timeRangeInQuarters(){return bi(this,Zg,"f")}get noteScale(){return bi(this,Gg,"f")}get noteLabels(){return bi(this,qg,"f")}get transpose(){return bi(this,Hg,"f")}};To=new WeakMap,Wg=new WeakMap,Zg=new WeakMap,Gg=new WeakMap,qg=new WeakMap,Hg=new WeakMap;var th=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},qa,Hr,Ha,Qg,Xg,Zu=class{constructor(e,t){qa.set(this,void 0),Hr.set(this,void 0),Ha.set(this,void 0),Qg.set(this,void 0),Xg.set(this,void 0),th(this,qa,e,"f"),th(this,Hr,t,"f"),th(this,Ha,Wt.create(kt(this,Hr,"f").audioUnits,o=>kt(this,qa,"f").boxAdapters.adapterFor(o,hi),u.AudioUnits),"f"),th(this,Qg,new bg(kt(this,Hr,"f").audioBusses.pointerHub,o=>kt(this,qa,"f").boxAdapters.adapterFor(o,mr),u.AudioBusses),"f"),th(this,Xg,new Jg(kt(this,Hr,"f").pianoMode),"f")}get uuid(){return kt(this,Hr,"f").address.uuid}get address(){return kt(this,Hr,"f").address}get box(){return kt(this,Hr,"f")}get audioBusses(){return kt(this,Qg,"f")}get audioUnits(){return kt(this,Ha,"f")}get clips(){return kt(this,Ha,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return kt(this,qa,"f").boxAdapters.adapterFor(kt(this,Hr,"f").groove.targetVertex.unwrap("no groove").box,Mo)}get timeline(){return kt(this,qa,"f").boxAdapters.adapterFor(kt(this,Hr,"f").timeline.targetVertex.unwrap("no timeline").box,Do)}get pianoMode(){return kt(this,Xg,"f")}get created(){return new Date(kt(this,Hr,"f").created.getValue())}get midiOutputDevices(){return kt(this,Hr,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ie(e,Vi))}*labeledAudioOutputs(){for(let e of kt(this,Ha,"f").adapters())yield{label:e.label,address:e.address,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){kt(this,Ha,"f").terminate()}};qa=new WeakMap,Hr=new WeakMap,Ha=new WeakMap,Qg=new WeakMap,Xg=new WeakMap;var sw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},aw,rh,Ji,ys,XS,Gu=class{constructor(e,t){aw.add(this),this.type="instrument",this.accepts="audio",rh.set(this,void 0),Ji.set(this,void 0),ys.set(this,void 0),sw(this,rh,e,"f"),sw(this,Ji,t,"f"),sw(this,ys,new fe(rr(this,rh,"f")),"f"),this.namedParameter=rr(this,aw,"m",XS).call(this,t)}get box(){return rr(this,Ji,"f")}get uuid(){return rr(this,Ji,"f").address.uuid}get address(){return rr(this,Ji,"f").address}get labelField(){return rr(this,Ji,"f").label}get iconField(){return rr(this,Ji,"f").icon}get defaultTrackType(){return oe.Audio}get enabledField(){return rr(this,Ji,"f").enabled}get minimizedField(){return rr(this,Ji,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return rr(this,rh,"f").boxAdapters.adapterFor(rr(this,Ji,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){rr(this,ys,"f").terminate()}};rh=new WeakMap,Ji=new WeakMap,ys=new WeakMap,aw=new WeakSet,XS=function(e){return{flutter:rr(this,ys,"f").createParameter(e.flutter,S.unipolar(),P.percent(),"flutter"),wow:rr(this,ys,"f").createParameter(e.wow,S.unipolar(),P.percent(),"wow"),noise:rr(this,ys,"f").createParameter(e.noise,S.unipolar(),P.percent(),"noise"),saturation:rr(this,ys,"f").createParameter(e.saturation,S.unipolar(),P.percent(),"saturation")}};var Ro=(()=>{let t=[1,2,3,4],o=["12","24","36","48"],i=[Ke.sine,Ke.triangle,Ke.saw,Ke.square],n=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:o,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:P.values("db",t,o),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:n,LFO_WAVEFORM_VALUE_MAPPING:S.values(i),LFO_WAVEFORM_STRING_MAPPING:P.values("",i,n)}})();var lw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},uw,ih,Qi,ze,YS,qu=class{constructor(e,t){uw.add(this),this.type="instrument",this.accepts="midi",ih.set(this,void 0),Qi.set(this,void 0),ze.set(this,void 0),lw(this,ih,e,"f"),lw(this,Qi,t,"f"),lw(this,ze,new fe(Fe(this,ih,"f")),"f"),this.namedParameter=Fe(this,uw,"m",YS).call(this,t)}get box(){return Fe(this,Qi,"f")}get uuid(){return Fe(this,Qi,"f").address.uuid}get address(){return Fe(this,Qi,"f").address}get labelField(){return Fe(this,Qi,"f").label}get iconField(){return Fe(this,Qi,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Fe(this,Qi,"f").enabled}get minimizedField(){return Fe(this,Qi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Fe(this,ih,"f").boxAdapters.adapterFor(Fe(this,Qi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Fe(this,ze,"f").terminate()}};ih=new WeakMap,Qi=new WeakMap,ze=new WeakMap,uw=new WeakSet,YS=function(e){let t=[go.Monophonic,go.Polyphonic];return{oscillators:e.oscillators.fields().map(o=>({waveform:Fe(this,ze,"f").createParameter(o.waveform,S.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Fe(this,ze,"f").createParameter(o.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Fe(this,ze,"f").createParameter(o.octave,S.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:Fe(this,ze,"f").createParameter(o.tune,S.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Fe(this,ze,"f").createParameter(e.noise.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Fe(this,ze,"f").createParameter(e.noise.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Fe(this,ze,"f").createParameter(e.noise.hold,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Fe(this,ze,"f").createParameter(e.noise.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Fe(this,ze,"f").createParameter(e.filterOrder,Ro.FILTER_ORDER_VALUE_MAPPING,Ro.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Fe(this,ze,"f").createParameter(e.cutoff,Ro.CUTOFF_VALUE_MAPPING,Ro.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Fe(this,ze,"f").createParameter(e.resonance,S.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Fe(this,ze,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Fe(this,ze,"f").createParameter(e.decay,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Fe(this,ze,"f").createParameter(e.sustain,S.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:Fe(this,ze,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Fe(this,ze,"f").createParameter(e.filterEnvelope,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Fe(this,ze,"f").createParameter(e.filterKeyboard,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Fe(this,ze,"f").createParameter(e.voicingMode,S.values(t),P.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Fe(this,ze,"f").createParameter(e.glideTime,S.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:Fe(this,ze,"f").createParameter(e.unisonCount,S.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(o=>String(o))),"Unisono",0),unisonDetune:Fe(this,ze,"f").createParameter(e.unisonDetune,S.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Fe(this,ze,"f").createParameter(e.unisonStereo,S.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Fe(this,ze,"f").createParameter(e.lfo.waveform,Ro.LFO_WAVEFORM_VALUE_MAPPING,Ro.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Fe(this,ze,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Fe(this,ze,"f").createParameter(e.lfo.targetTune,S.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Fe(this,ze,"f").createParameter(e.lfo.targetVolume,S.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Fe(this,ze,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var cw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Vt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},dw,Yg,oh,wi,Oo,eE,Xi=class{constructor(e,t){dw.add(this),this.type="midi-effect",this.accepts="midi",oh.set(this,void 0),wi.set(this,void 0),Oo.set(this,void 0),cw(this,oh,e,"f"),cw(this,wi,t,"f"),cw(this,Oo,new fe(Vt(this,oh,"f")),"f"),this.namedParameter=Vt(this,dw,"m",eE).call(this,t)}get box(){return Vt(this,wi,"f")}get uuid(){return Vt(this,wi,"f").address.uuid}get address(){return Vt(this,wi,"f").address}get indexField(){return Vt(this,wi,"f").index}get labelField(){return Vt(this,wi,"f").label}get enabledField(){return Vt(this,wi,"f").enabled}get minimizedField(){return Vt(this,wi,"f").minimized}get host(){return Vt(this,wi,"f").host}deviceHost(){return Vt(this,oh,"f").boxAdapters.adapterFor(Vt(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Vt(this,Oo,"f").terminate()}};Yg=Xi,oh=new WeakMap,wi=new WeakMap,Oo=new WeakMap,dw=new WeakSet,eE=function(e){return{modeIndex:Vt(this,Oo,"f").createParameter(e.modeIndex,S.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Vt(this,Oo,"f").createParameter(e.numOctaves,S.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Vt(this,Oo,"f").createParameter(e.rateIndex,S.linearInteger(0,Yg.RateFractions.length-1),Yg.RateStringMapping,"Rate"),gate:Vt(this,Oo,"f").createParameter(e.gate,S.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:Vt(this,Oo,"f").createParameter(e.repeat,S.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:Vt(this,Oo,"f").createParameter(e.velocity,S.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Xi.RateFractions=ur.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();Xi.RateStringMapping=P.indices("",Yg.RateFractions.map(([r,e])=>`${r}/${e}`));var pw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ir=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},hw,nh,Ai,Ja,tE,Hu=class{constructor(e,t){hw.add(this),this.type="midi-effect",this.accepts="midi",nh.set(this,void 0),Ai.set(this,void 0),Ja.set(this,void 0),pw(this,nh,e,"f"),pw(this,Ai,t,"f"),pw(this,Ja,new fe(ir(this,nh,"f")),"f"),this.namedParameter=ir(this,hw,"m",tE).call(this,t)}get box(){return ir(this,Ai,"f")}get uuid(){return ir(this,Ai,"f").address.uuid}get address(){return ir(this,Ai,"f").address}get indexField(){return ir(this,Ai,"f").index}get labelField(){return ir(this,Ai,"f").label}get enabledField(){return ir(this,Ai,"f").enabled}get minimizedField(){return ir(this,Ai,"f").minimized}get host(){return ir(this,Ai,"f").host}deviceHost(){return ir(this,nh,"f").boxAdapters.adapterFor(ir(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ir(this,Ja,"f").terminate()}};nh=new WeakMap,Ai=new WeakMap,Ja=new WeakMap,hw=new WeakSet,tE=function(e){return{octaves:ir(this,Ja,"f").createParameter(e.octaves,S.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:ir(this,Ja,"f").createParameter(e.semiTones,S.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:ir(this,Ja,"f").createParameter(e.cents,S.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var fw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},mw,sh,Yi,Ju,rE,Qu=class{constructor(e,t){mw.add(this),this.type="instrument",this.accepts="midi",sh.set(this,void 0),Yi.set(this,void 0),Ju.set(this,void 0),fw(this,sh,e,"f"),fw(this,Yi,t,"f"),fw(this,Ju,new fe(kr(this,sh,"f")),"f"),this.namedParameter=kr(this,mw,"m",rE).call(this,t)}get box(){return kr(this,Yi,"f")}get uuid(){return kr(this,Yi,"f").address.uuid}get address(){return kr(this,Yi,"f").address}get labelField(){return kr(this,Yi,"f").label}get iconField(){return kr(this,Yi,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return kr(this,Yi,"f").enabled}get minimizedField(){return kr(this,Yi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return kr(this,sh,"f").boxAdapters.adapterFor(kr(this,Yi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){kr(this,Ju,"f").terminate()}};sh=new WeakMap,Yi=new WeakMap,Ju=new WeakMap,mw=new WeakSet,rE=function(e){return{volume:kr(this,Ju,"f").createParameter(e.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:kr(this,Ju,"f").createParameter(e.release,S.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var Xu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},J=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},gw,Qa,xs,Ae,ev,ah,Jr,Xa,iE,Yu=class{constructor(e,t){gw.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",Qa.set(this,new O),xs.set(this,void 0),Ae.set(this,void 0),ev.set(this,void 0),ah.set(this,void 0),Jr.set(this,void 0),Xa.set(this,m.None),Xu(this,xs,e,"f"),Xu(this,Ae,t,"f"),Xu(this,ev,J(this,Qa,"f").own(Wt.create(J(this,Ae,"f").midiEffects,o=>J(this,xs,"f").boxAdapters.adapterFor(o,ne.isMidiEffect),u.MIDIEffectHost)),"f"),Xu(this,ah,J(this,Qa,"f").own(Wt.create(J(this,Ae,"f").audioEffects,o=>J(this,xs,"f").boxAdapters.adapterFor(o,ne.isAudioEffect),u.AudioEffectHost)),"f"),Xu(this,Jr,J(this,Qa,"f").own(new fe(J(this,xs,"f"))),"f"),this.namedParameter=J(this,gw,"m",iE).call(this,t),J(this,Qa,"f").own(J(this,Ae,"f").file.catchupAndSubscribe(o=>{Xu(this,Xa,o.targetVertex.map(({box:i})=>J(this,xs,"f").boxAdapters.adapterFor(i,Ui)),"f"),J(this,Xa,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return J(this,Ae,"f")}get uuid(){return J(this,Ae,"f").address.uuid}get address(){return J(this,Ae,"f").address}get peakAddress(){return J(this,Ae,"f").address.append(1001)}get indexField(){return J(this,Ae,"f").index}get gate(){return J(this,Ae,"f").gate.getValue()}get exclude(){return J(this,Ae,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${J(this,Xa,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${J(this,Xa,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return J(this,Ae,"f").icon}get defaultTrackType(){return oe.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return J(this,Ae,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return J(this,Ae,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return J(this,Xa,"f")}fileUUID(){return J(this,Ae,"f").file.targetAddress.unwrap().uuid}resetParameters(){J(this,Ae,"f").mute.reset(),J(this,Ae,"f").solo.reset(),J(this,Ae,"f").exclude.reset(),J(this,Ae,"f").polyphone.reset(),J(this,Ae,"f").pitch.reset(),J(this,Ae,"f").attack.reset(),J(this,Ae,"f").release.reset(),J(this,Ae,"f").sampleStart.reset(),J(this,Ae,"f").sampleEnd.reset(),J(this,Ae,"f").gate.reset()}copyToIndex(e){Kn.create(J(this,Ae,"f").graph,b.generate(),t=>{t.file.refer(J(this,Ae,"f").file.targetVertex.unwrap()),t.device.refer(J(this,Ae,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(J(this,Ae,"f").mute.getValue()),t.solo.setValue(J(this,Ae,"f").solo.getValue()),t.sampleStart.setValue(J(this,Ae,"f").sampleStart.getValue()),t.sampleEnd.setValue(J(this,Ae,"f").sampleEnd.getValue()),t.attack.setValue(J(this,Ae,"f").attack.getValue()),t.release.setValue(J(this,Ae,"f").release.getValue()),t.pitch.setValue(J(this,Ae,"f").pitch.getValue()),t.exclude.setValue(J(this,Ae,"f").exclude.getValue()),t.gate.setValue(J(this,Ae,"f").gate.getValue())})}get midiEffects(){return J(this,ev,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return J(this,ah,"f")}get labelField(){return J(this,Ae,"f").label}get enabledField(){return J(this,Ae,"f").enabled}get minimizedField(){return J(this,Ae,"f").minimized}device(){return J(this,xs,"f").boxAdapters.adapterFor(J(this,Ae,"f").device.targetVertex.unwrap().box,bs)}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 J(this,ah,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){J(this,Qa,"f").terminate()}};Qa=new WeakMap,xs=new WeakMap,Ae=new WeakMap,ev=new WeakMap,ah=new WeakMap,Jr=new WeakMap,Xa=new WeakMap,gw=new WeakSet,iE=function(e){return{gate:J(this,Jr,"f").createParameter(e.gate,S.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:J(this,Jr,"f").createParameter(e.mute,S.bool,P.bool,"Mute"),solo:J(this,Jr,"f").createParameter(e.solo,S.bool,P.bool,"Solo"),polyphone:J(this,Jr,"f").createParameter(e.polyphone,S.bool,P.bool,"Polyphone"),exclude:J(this,Jr,"f").createParameter(e.exclude,S.bool,P.bool,"Exclude"),pitch:J(this,Jr,"f").createParameter(e.pitch,S.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:J(this,Jr,"f").createParameter(e.sampleStart,S.unipolar(),P.percent(),"Start",0),sampleEnd:J(this,Jr,"f").createParameter(e.sampleEnd,S.unipolar(),P.percent(),"End",1),attack:J(this,Jr,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:J(this,Jr,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var tv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},yr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ec,eo,tc,rv,bs=class{constructor(e,t){this.type="instrument",this.accepts="midi",ec.set(this,void 0),eo.set(this,void 0),tc.set(this,void 0),rv.set(this,void 0),tv(this,ec,e,"f"),tv(this,eo,t,"f"),tv(this,tc,Wt.create(t.samples,o=>e.boxAdapters.adapterFor(o,Yu),u.Sample),"f"),tv(this,rv,new fe(yr(this,ec,"f")),"f")}reset(){yr(this,tc,"f").adapters().forEach(e=>e.box.delete())}get box(){return yr(this,eo,"f")}get uuid(){return yr(this,eo,"f").address.uuid}get address(){return yr(this,eo,"f").address}get labelField(){return yr(this,eo,"f").label}get iconField(){return yr(this,eo,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return yr(this,eo,"f").enabled}get minimizedField(){return yr(this,eo,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return yr(this,tc,"f")}get context(){return yr(this,ec,"f")}deviceHost(){return yr(this,ec,"f").boxAdapters.adapterFor(yr(this,eo,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None};for(let e of yr(this,tc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){yr(this,rv,"f").terminate()}};ec=new WeakMap,eo=new WeakMap,tc=new WeakMap,rv=new WeakMap;var vw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},zt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},yw,lh,_i,Vo,oE,rc=class{constructor(e,t){yw.add(this),this.type="audio-effect",this.accepts="audio",lh.set(this,void 0),_i.set(this,void 0),Vo.set(this,void 0),vw(this,lh,e,"f"),vw(this,_i,t,"f"),vw(this,Vo,new fe(zt(this,lh,"f")),"f"),this.namedParameter=zt(this,yw,"m",oE).call(this,t)}get box(){return zt(this,_i,"f")}get uuid(){return zt(this,_i,"f").address.uuid}get address(){return zt(this,_i,"f").address}get indexField(){return zt(this,_i,"f").index}get labelField(){return zt(this,_i,"f").label}get enabledField(){return zt(this,_i,"f").enabled}get minimizedField(){return zt(this,_i,"f").minimized}get host(){return zt(this,_i,"f").host}deviceHost(){return zt(this,lh,"f").boxAdapters.adapterFor(zt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){zt(this,Vo,"f").terminate()}};lh=new WeakMap,_i=new WeakMap,Vo=new WeakMap,yw=new WeakSet,oE=function(e){return{volume:zt(this,Vo,"f").createParameter(e.volume,S.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:zt(this,Vo,"f").createParameter(e.panning,S.bipolar(),P.panning,"Panning",.5),stereo:zt(this,Vo,"f").createParameter(e.stereo,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:zt(this,Vo,"f").createParameter(e.invertL,S.bool,P.bool,"Invert Left"),invertR:zt(this,Vo,"f").createParameter(e.invertR,S.bool,P.bool,"Invert Right"),swap:zt(this,Vo,"f").createParameter(e.swap,S.bool,P.bool,"Swap")}};var Ya;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Ya||(Ya={}));var nE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$r=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ic,Dr,oc=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",ic.set(this,void 0),Dr.set(this,void 0),nE(this,ic,e,"f"),nE(this,Dr,t,"f"),this.groove()}get box(){return $r(this,Dr,"f")}get uuid(){return $r(this,Dr,"f").address.uuid}get address(){return $r(this,Dr,"f").address}get indexField(){return $r(this,Dr,"f").index}get labelField(){return $r(this,Dr,"f").label}get enabledField(){return $r(this,Dr,"f").enabled}get minimizedField(){return $r(this,Dr,"f").minimized}get host(){return $r(this,Dr,"f").host}deviceHost(){return $r(this,ic,"f").boxAdapters.adapterFor($r(this,Dr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}groove(){return $r(this,ic,"f").boxAdapters.adapterFor($r(this,Dr,"f").groove.targetVertex.unwrap("no groove").box,Ya.checkType)}catchupAndSubscribeGroove(e){return $r(this,Dr,"f").groove.catchupAndSubscribe(t=>e($r(this,ic,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,Ya.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};ic=new WeakMap,Dr=new WeakMap;var sE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},to=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},iv,Qr,nc=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",iv.set(this,void 0),Qr.set(this,void 0),sE(this,iv,e,"f"),sE(this,Qr,t,"f")}get box(){return to(this,Qr,"f")}get uuid(){return to(this,Qr,"f").address.uuid}get address(){return to(this,Qr,"f").address}get indexField(){return to(this,Qr,"f").index}get labelField(){return to(this,Qr,"f").label}get enabledField(){return to(this,Qr,"f").enabled}get minimizedField(){return to(this,Qr,"f").minimized}get host(){return to(this,Qr,"f").host}get commentField(){return to(this,Qr,"f").comment}deviceHost(){return to(this,iv,"f").boxAdapters.adapterFor(to(this,Qr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};iv=new WeakMap,Qr=new WeakMap;var aE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ro=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ov,Xr,sc=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",ov.set(this,void 0),Xr.set(this,void 0),aE(this,ov,e,"f"),aE(this,Xr,t,"f")}get box(){return ro(this,Xr,"f")}get uuid(){return ro(this,Xr,"f").address.uuid}get address(){return ro(this,Xr,"f").address}get indexField(){return ro(this,Xr,"f").index}get labelField(){return ro(this,Xr,"f").label}get enabledField(){return ro(this,Xr,"f").enabled}get minimizedField(){return ro(this,Xr,"f").minimized}get host(){return ro(this,Xr,"f").host}get commentField(){return ro(this,Xr,"f").comment}deviceHost(){return ro(this,ov,"f").boxAdapters.adapterFor(ro(this,Xr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};ov=new WeakMap,Xr=new WeakMap;var ws=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ne=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},xw,bw,uh,Mr,nv,ac,io,Pi,lc,lE,ww,uc=class{constructor(e,t){xw.add(this),this.type="instrument",this.accepts="midi",bw.set(this,new O),uh.set(this,void 0),Mr.set(this,void 0),nv.set(this,void 0),ac.set(this,void 0),io.set(this,void 0),Pi.set(this,void 0),lc.set(this,W.Empty),ww.set(this,o=>o.match({none:()=>{Ne(this,Pi,"f").clear(),Ne(this,io,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ne(this,Pi,"f").clear(),Ne(this,io,"f").clear(),Ne(this,lc,"f").terminate(),ws(this,lc,i.subscribe(n=>{if(n.type==="loaded"){let s=i.soundfont.unwrap();Ne(this,Pi,"f").wrap(s.presets[this.presetIndex]??s.presets[0]),Ne(this,io,"f").wrap(s)}else n.type==="error"?(Ne(this,Pi,"f").clear(),Ne(this,io,"f").clear()):n.type==="idle"&&(Ne(this,Pi,"f").clear(),Ne(this,io,"f").clear())}),"f")},some:n=>{Ne(this,io,"f").wrap(n),Ne(this,Pi,"f").wrap(n.presets[this.presetIndex]??n.presets[0])}})})),ws(this,uh,e,"f"),ws(this,Mr,t,"f"),ws(this,nv,new fe(Ne(this,uh,"f")),"f"),this.namedParameter=Ne(this,xw,"m",lE).call(this,t),ws(this,ac,new ni,"f"),ws(this,io,new ni,"f"),ws(this,Pi,new ni,"f"),Ne(this,bw,"f").ownAll(Ne(this,ac,"f").subscribe(Ne(this,ww,"f")),Ne(this,Mr,"f").file.catchupAndSubscribe(({targetVertex:o})=>Ne(this,ac,"f").wrapOption(o.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ne(this,Mr,"f").presetIndex.catchupAndSubscribe(o=>Ne(this,io,"f").match({none:()=>Ne(this,Pi,"f").clear(),some:i=>Ne(this,Pi,"f").wrap(i.presets[o.getValue()]??i.presets[0])})))}get loader(){return Ne(this,ac,"f")}get soundfont(){return Ne(this,io,"f")}get preset(){return Ne(this,Pi,"f")}get presetIndex(){return Ne(this,Mr,"f").presetIndex.getValue()}get box(){return Ne(this,Mr,"f")}get uuid(){return Ne(this,Mr,"f").address.uuid}get address(){return Ne(this,Mr,"f").address}get labelField(){return Ne(this,Mr,"f").label}get iconField(){return Ne(this,Mr,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Ne(this,Mr,"f").enabled}get minimizedField(){return Ne(this,Mr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ne(this,uh,"f").boxAdapters.adapterFor(Ne(this,Mr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ne(this,lc,"f").terminate(),ws(this,lc,W.Empty,"f"),Ne(this,nv,"f").terminate()}};bw=new WeakMap,uh=new WeakMap,Mr=new WeakMap,nv=new WeakMap,ac=new WeakMap,io=new WeakMap,Pi=new WeakMap,lc=new WeakMap,ww=new WeakMap,xw=new WeakSet,lE=function(e){return{}};var uE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ch=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},sv,el,av=class{constructor(e,t){sv.set(this,void 0),el.set(this,void 0),uE(this,sv,e,"f"),uE(this,el,t,"f")}get box(){return ch(this,el,"f")}get uuid(){return ch(this,el,"f").address.uuid}get address(){return ch(this,el,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return ch(this,sv,"f").soundfontManager.getOrCreate(ch(this,el,"f").address.uuid)}terminate(){}};sv=new WeakMap,el=new WeakMap;var Aw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ot=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},_w,dh,Yr,or,cE,cc=class{constructor(e,t){_w.add(this),this.type="audio-effect",this.accepts="audio",dh.set(this,void 0),Yr.set(this,void 0),or.set(this,void 0),Aw(this,dh,e,"f"),Aw(this,Yr,t,"f"),Aw(this,or,new fe(ot(this,dh,"f")),"f"),this.namedParameter=ot(this,_w,"m",cE).call(this,t)}get box(){return ot(this,Yr,"f")}get uuid(){return ot(this,Yr,"f").address.uuid}get address(){return ot(this,Yr,"f").address}get indexField(){return ot(this,Yr,"f").index}get labelField(){return ot(this,Yr,"f").label}get enabledField(){return ot(this,Yr,"f").enabled}get minimizedField(){return ot(this,Yr,"f").minimized}get host(){return ot(this,Yr,"f").host}get sideChain(){return ot(this,Yr,"f").sideChain}deviceHost(){return ot(this,dh,"f").boxAdapters.adapterFor(ot(this,Yr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ot(this,or,"f").terminate()}};dh=new WeakMap,Yr=new WeakMap,or=new WeakMap,_w=new WeakSet,cE=function(e){return{lookahead:ot(this,or,"f").createParameter(e.lookahead,S.bool,P.bool,"Lookahead"),automakeup:ot(this,or,"f").createParameter(e.automakeup,S.bool,P.bool,"Auto Makeup"),autoattack:ot(this,or,"f").createParameter(e.autoattack,S.bool,P.bool,"Auto Attack"),autorelease:ot(this,or,"f").createParameter(e.autorelease,S.bool,P.bool,"Auto Release"),inputgain:ot(this,or,"f").createParameter(e.inputgain,S.linear(-30,30),P.decible,"Input Gain"),threshold:ot(this,or,"f").createParameter(e.threshold,S.linear(-60,0),P.decible,"Threshold"),ratio:ot(this,or,"f").createParameter(e.ratio,S.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:ot(this,or,"f").createParameter(e.knee,S.linear(0,24),P.decible,"Knee"),attack:ot(this,or,"f").createParameter(e.attack,S.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:ot(this,or,"f").createParameter(e.release,S.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:ot(this,or,"f").createParameter(e.makeup,S.linear(-40,40),P.decible,"Makeup Gain"),mix:ot(this,or,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Dry/Wet")}};var Pw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ht=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Sw,ph,Si,As,dE,dc=class{constructor(e,t){Sw.add(this),this.type="audio-effect",this.accepts="audio",ph.set(this,void 0),Si.set(this,void 0),As.set(this,void 0),Pw(this,ph,e,"f"),Pw(this,Si,t,"f"),Pw(this,As,new fe(Ht(this,ph,"f")),"f"),this.namedParameter=Ht(this,Sw,"m",dE).call(this,t)}get box(){return Ht(this,Si,"f")}get uuid(){return Ht(this,Si,"f").address.uuid}get address(){return Ht(this,Si,"f").address}get indexField(){return Ht(this,Si,"f").index}get labelField(){return Ht(this,Si,"f").label}get enabledField(){return Ht(this,Si,"f").enabled}get minimizedField(){return Ht(this,Si,"f").minimized}get host(){return Ht(this,Si,"f").host}deviceHost(){return Ht(this,ph,"f").boxAdapters.adapterFor(Ht(this,Si,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ht(this,As,"f").terminate()}};ph=new WeakMap,Si=new WeakMap,As=new WeakMap,Sw=new WeakSet,dE=function(e){return{crush:Ht(this,As,"f").createParameter(e.crush,S.unipolar(),P.percent(),"Crush"),bits:Ht(this,As,"f").createParameter(e.bits,S.linearInteger(1,16),P.numeric(),"Bits"),boost:Ht(this,As,"f").createParameter(e.boost,S.linear(0,24),P.decible,"Boost"),mix:Ht(this,As,"f").createParameter(e.mix,S.exponential(.001,1),P.percent(),"Mix")}};var Ew=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},xr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Bw,hh,Ei,pc,pE,hc=class{constructor(e,t){Bw.add(this),this.type="audio-effect",this.accepts="audio",hh.set(this,void 0),Ei.set(this,void 0),pc.set(this,void 0),Ew(this,hh,e,"f"),Ew(this,Ei,t,"f"),Ew(this,pc,new fe(xr(this,hh,"f")),"f"),this.namedParameter=xr(this,Bw,"m",pE).call(this,t)}get box(){return xr(this,Ei,"f")}get uuid(){return xr(this,Ei,"f").address.uuid}get address(){return xr(this,Ei,"f").address}get indexField(){return xr(this,Ei,"f").index}get labelField(){return xr(this,Ei,"f").label}get enabledField(){return xr(this,Ei,"f").enabled}get minimizedField(){return xr(this,Ei,"f").minimized}get host(){return xr(this,Ei,"f").host}deviceHost(){return xr(this,hh,"f").boxAdapters.adapterFor(xr(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){xr(this,pc,"f").terminate()}};hh=new WeakMap,Ei=new WeakMap,pc=new WeakMap,Bw=new WeakSet,pE=function(e){return{drive:xr(this,pc,"f").createParameter(e.drive,S.linear(0,30),P.decible,"Drive"),volume:xr(this,pc,"f").createParameter(e.volume,S.linear(-18,0),P.decible,"Volume")}};var lv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$t=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},fh,mh,Bi,fc,mc,gc=class{constructor(e,t){fh.set(this,new O),this.type="instrument",this.accepts="midi",mh.set(this,void 0),Bi.set(this,void 0),fc.set(this,void 0),mc.set(this,void 0),lv(this,mh,e,"f"),lv(this,Bi,t,"f"),lv(this,fc,new ni,"f"),lv(this,mc,$t(this,fh,"f").own(new fe($t(this,mh,"f"))),"f"),$t(this,fh,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>$t(this,mc,"f").createParameter(Ie(o,zi).value,S.unipolar(),P.percent({fractionDigits:1}),"",0),onRemoved:({box:o})=>$t(this,mc,"f").removeParameter(Ie(o,zi).value.address)}),$t(this,Bi,"f").device.catchupAndSubscribe(({targetVertex:o})=>o.match({none:()=>$t(this,fc,"f").clear(),some:({box:i})=>$t(this,fc,"f").wrap(Ie(i,Vi))})))}get box(){return $t(this,Bi,"f")}get uuid(){return $t(this,Bi,"f").address.uuid}get address(){return $t(this,Bi,"f").address}get labelField(){return $t(this,Bi,"f").label}get iconField(){return $t(this,Bi,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return $t(this,Bi,"f").enabled}get minimizedField(){return $t(this,Bi,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return $t(this,mc,"f")}get midiDevice(){return $t(this,fc,"f")}deviceHost(){return $t(this,mh,"f").boxAdapters.adapterFor($t(this,Bi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){$t(this,fh,"f").terminate()}};fh=new WeakMap,mh=new WeakMap,Bi=new WeakMap,fc=new WeakMap,mc=new WeakMap;var uv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_t=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Fw,gh,Fi,zo,vh,hE,vc=class{constructor(e,t){Fw.add(this),this.type="midi-effect",this.accepts="midi",gh.set(this,void 0),Fi.set(this,void 0),zo.set(this,void 0),vh.set(this,void 0),uv(this,gh,e,"f"),uv(this,Fi,t,"f"),uv(this,zo,new fe(_t(this,gh,"f")),"f"),uv(this,vh,yl.create(),"f"),this.namedParameter=_t(this,Fw,"m",hE).call(this,t)}computeVelocity(e,t){let{magnetPosition:o,magnetStrength:i,randomSeed:n,randomAmount:s,offset:a,mix:l}=this.namedParameter;_t(this,vh,"f").setSeed(n.valueAt(e)+e);let c=t+(o.valueAt(e)-t)*i.valueAt(e),d=(_t(this,vh,"f").uniform()*2-1)*s.valueAt(e),p=a.valueAt(e),f=l.valueAt(e);return t*(1-f)+ii(c+d+p)*f}get box(){return _t(this,Fi,"f")}get uuid(){return _t(this,Fi,"f").address.uuid}get address(){return _t(this,Fi,"f").address}get indexField(){return _t(this,Fi,"f").index}get labelField(){return _t(this,Fi,"f").label}get enabledField(){return _t(this,Fi,"f").enabled}get minimizedField(){return _t(this,Fi,"f").minimized}get host(){return _t(this,Fi,"f").host}deviceHost(){return _t(this,gh,"f").boxAdapters.adapterFor(_t(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){_t(this,zo,"f").terminate()}};gh=new WeakMap,Fi=new WeakMap,zo=new WeakMap,vh=new WeakMap,Fw=new WeakSet,hE=function(e){return{magnetPosition:_t(this,zo,"f").createParameter(e.magnetPosition,S.unipolar(),P.percent(),"Position"),magnetStrength:_t(this,zo,"f").createParameter(e.magnetStrength,S.unipolar(),P.percent(),"Strength"),randomSeed:_t(this,zo,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:_t(this,zo,"f").createParameter(e.randomAmount,S.unipolar(),P.percent(),"Amount"),offset:_t(this,zo,"f").createParameter(e.offset,S.bipolar(),P.percent(),"Offset"),mix:_t(this,zo,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Mix")}};var Nw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ut=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Iw,kw,yh,Ni,Uo,fE,oo=class{constructor(e,t){Iw.add(this),this.type="audio-effect",this.accepts="audio",yh.set(this,void 0),Ni.set(this,void 0),Uo.set(this,void 0),Nw(this,yh,e,"f"),Nw(this,Ni,t,"f"),Nw(this,Uo,new fe(Ut(this,yh,"f")),"f"),this.namedParameter=Ut(this,Iw,"m",fE).call(this,t)}get box(){return Ut(this,Ni,"f")}get uuid(){return Ut(this,Ni,"f").address.uuid}get address(){return Ut(this,Ni,"f").address}get indexField(){return Ut(this,Ni,"f").index}get labelField(){return Ut(this,Ni,"f").label}get enabledField(){return Ut(this,Ni,"f").enabled}get minimizedField(){return Ut(this,Ni,"f").minimized}get host(){return Ut(this,Ni,"f").host}deviceHost(){return Ut(this,yh,"f").boxAdapters.adapterFor(Ut(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ut(this,Uo,"f").terminate()}};kw=oo,yh=new WeakMap,Ni=new WeakMap,Uo=new WeakMap,Iw=new WeakSet,fE=function(e){let{RateFractions:t,RateStringMapping:o}=kw;return{slope:Ut(this,Uo,"f").createParameter(e.slope,S.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:Ut(this,Uo,"f").createParameter(e.symmetry,S.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Ut(this,Uo,"f").createParameter(e.rate,S.values(t.map((i,n)=>n)),o,"Rate",0),depth:Ut(this,Uo,"f").createParameter(e.depth,S.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:Ut(this,Uo,"f").createParameter(e.offset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Ut(this,Uo,"f").createParameter(e.channelOffset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};oo.RateFractions=ur.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();oo.RateStringMapping=P.indices("",kw.RateFractions.map(([r,e])=>`${r}/${e}`));var $w=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Dw,xh,Ii,nr,mE,yc=class{constructor(e,t){Dw.add(this),this.type="audio-effect",this.accepts="audio",xh.set(this,void 0),Ii.set(this,void 0),nr.set(this,void 0),$w(this,xh,e,"f"),$w(this,Ii,t,"f"),$w(this,nr,new fe(lt(this,xh,"f")),"f"),this.namedParameter=lt(this,Dw,"m",mE).call(this,t)}get box(){return lt(this,Ii,"f")}get uuid(){return lt(this,Ii,"f").address.uuid}get address(){return lt(this,Ii,"f").address}get indexField(){return lt(this,Ii,"f").index}get labelField(){return lt(this,Ii,"f").label}get enabledField(){return lt(this,Ii,"f").enabled}get minimizedField(){return lt(this,Ii,"f").minimized}get host(){return lt(this,Ii,"f").host}deviceHost(){return lt(this,xh,"f").boxAdapters.adapterFor(lt(this,Ii,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){lt(this,nr,"f").terminate()}};xh=new WeakMap,Ii=new WeakMap,nr=new WeakMap,Dw=new WeakSet,mE=function(e){return{preDelay:lt(this,nr,"f").createParameter(e.preDelay,S.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:lt(this,nr,"f").createParameter(e.bandwidth,S.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:lt(this,nr,"f").createParameter(e.inputDiffusion1,S.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:lt(this,nr,"f").createParameter(e.inputDiffusion2,S.unipolar(),P.percent(),"Tank 2"),decay:lt(this,nr,"f").createParameter(e.decay,S.unipolar(),P.percent(),"Decay"),decayDiffusion1:lt(this,nr,"f").createParameter(e.decayDiffusion1,S.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:lt(this,nr,"f").createParameter(e.decayDiffusion2,S.unipolar(),P.percent(),"Tank 2"),damping:lt(this,nr,"f").createParameter(e.damping,S.unipolar(),P.percent(),"Damping"),excursionRate:lt(this,nr,"f").createParameter(e.excursionRate,S.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:lt(this,nr,"f").createParameter(e.excursionDepth,S.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:lt(this,nr,"f").createParameter(e.wet,S.DefaultDecibel,P.decible,"Wet"),dry:lt(this,nr,"f").createParameter(e.dry,S.DefaultDecibel,P.decible,"Dry")}};var cv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Q=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Mw,Y,_n,bh,dv,gE,pv=class{constructor(e){Mw.add(this),Y.set(this,void 0),_n.set(this,void 0),bh.set(this,void 0),dv.set(this,void 0),cv(this,Y,e,"f"),cv(this,_n,b.newSet(t=>t.uuid),"f"),cv(this,bh,new Set,"f"),cv(this,dv,Q(this,Y,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let o=Q(this,_n,"f").getOrNull(t.uuid);Z(o)&&(Q(this,bh,"f").add(o.box),Q(this,_n,"f").removeByValue(o).terminate())}}}),"f")}terminate(){Q(this,_n,"f").values().forEach(e=>e.terminate()),Q(this,_n,"f").clear(),Q(this,dv,"f").terminate()}adapterFor(e,t){if(Q(this,bh,"f").has(e))return F(`Cannot resolve adapter for already deleted box: ${e}`);let o=Q(this,_n,"f").getOrNull(e.address.uuid);if(o===null){o=Q(this,Mw,"m",gE).call(this,e);let i=Q(this,_n,"f").add(o);D(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?o instanceof t?o:F(`${o} is not instance of ${t}`):t(o)?o:F(`${o} did not pass custom type guard`):F("Unknown checkType method")}};Y=new WeakMap,_n=new WeakMap,bh=new WeakMap,dv=new WeakMap,Mw=new WeakSet,gE=function(e){return re(e.accept({visitArpeggioDeviceBox:t=>new Xi(Q(this,Y,"f"),t),visitAudioBusBox:t=>new mr(Q(this,Y,"f"),t),visitAudioClipBox:t=>new dn(Q(this,Y,"f"),t),visitAudioFileBox:t=>new Ui(Q(this,Y,"f"),t),visitAudioTimeStretchBox:t=>new Ao(Q(this,Y,"f"),t),visitAudioPitchStretchBox:t=>new wo(Q(this,Y,"f"),t),visitTransientMarkerBox:t=>new Hl(t),visitWarpMarkerBox:t=>new Qn(Q(this,Y,"f"),t),visitAudioRegionBox:t=>new ts(Q(this,Y,"f"),t),visitAudioUnitBox:t=>new hi(Q(this,Y,"f"),t),visitAuxSendBox:t=>new Au(Q(this,Y,"f"),t),visitCompressorDeviceBox:t=>new cc(Q(this,Y,"f"),t),visitCrusherDeviceBox:t=>new dc(Q(this,Y,"f"),t),visitDattorroReverbDeviceBox:t=>new yc(Q(this,Y,"f"),t),visitDelayDeviceBox:t=>new mi(Q(this,Y,"f"),t),visitDeviceInterfaceKnobBox:t=>new Ru(Q(this,Y,"f"),t),visitTidalDeviceBox:t=>new oo(Q(this,Y,"f"),t),visitFoldDeviceBox:t=>new hc(Q(this,Y,"f"),t),visitGrooveShuffleBox:t=>new Mo(Q(this,Y,"f"),t),visitMarkerBox:t=>new us(Q(this,Y,"f"),t),visitMIDIOutputDeviceBox:t=>new gc(Q(this,Y,"f"),t),visitModularAudioInputBox:t=>new Cu(Q(this,Y,"f"),t),visitModularAudioOutputBox:t=>new $u(Q(this,Y,"f"),t),visitModularBox:t=>new ps(Q(this,Y,"f"),t),visitModularDeviceBox:t=>new fs(Q(this,Y,"f"),t),visitModuleConnectionBox:t=>new ds(Q(this,Y,"f"),t),visitModuleDelayBox:t=>new ku(Q(this,Y,"f"),t),visitModuleGainBox:t=>new Du(Q(this,Y,"f"),t),visitModuleMultiplierBox:t=>new Mu(Q(this,Y,"f"),t),visitNanoDeviceBox:t=>new Qu(Q(this,Y,"f"),t),visitNoteClipBox:t=>new su(Q(this,Y,"f"),t),visitNoteEventBox:t=>new va(Q(this,Y,"f"),t),visitNoteEventCollectionBox:t=>new li(Q(this,Y,"f"),t),visitNoteRegionBox:t=>new rs(Q(this,Y,"f"),t),visitPitchDeviceBox:t=>new Hu(Q(this,Y,"f"),t),visitPlayfieldDeviceBox:t=>new bs(Q(this,Y,"f"),t),visitPlayfieldSampleBox:t=>new Yu(Q(this,Y,"f"),t),visitRevampDeviceBox:t=>new Nu(Q(this,Y,"f"),t),visitReverbDeviceBox:t=>new Fu(Q(this,Y,"f"),t),visitRootBox:t=>new Zu(Q(this,Y,"f"),t),visitSoundfontDeviceBox:t=>new uc(Q(this,Y,"f"),t),visitSoundfontFileBox:t=>new av(Q(this,Y,"f"),t),visitStereoToolDeviceBox:t=>new rc(Q(this,Y,"f"),t),visitTapeDeviceBox:t=>new Gu(Q(this,Y,"f"),t),visitTimelineBox:t=>new Do(Q(this,Y,"f"),t),visitTrackBox:t=>new vt(Q(this,Y,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new nc(Q(this,Y,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new sc(Q(this,Y,"f"),t),visitValueClipBox:t=>new Jn(Q(this,Y,"f"),t),visitValueEventBox:t=>new ln(Q(this,Y,"f"),t),visitValueEventCollectionBox:t=>new hr(Q(this,Y,"f"),t),visitValueRegionBox:t=>new gn(Q(this,Y,"f"),t),visitVaporisateurDeviceBox:t=>new qu(Q(this,Y,"f"),t),visitVelocityDeviceBox:t=>new vc(Q(this,Y,"f"),t),visitZeitgeistDeviceBox:t=>new oc(Q(this,Y,"f"),t)}),`Could not find factory for ${e}`)};var xc;(function(r){r.PEAKS=be.compose(b.Lowest).append(0),r.SPECTRUM=be.compose(b.Lowest).append(1),r.WAVEFORM=be.compose(b.Lowest).append(2)})(xc||(xc={}));var vE;(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,o=i=>{let n=t.get(i)??0,s=i;for(;t.has(s);)n++,s=`${i} ${n}`;return t.set(i,n),t.set(s,1),s};Object.keys(e).forEach(i=>{let n=e[i];n.fileName=o(r.sanitizeFileName(n.fileName))})}})(vE||(vE={}));var yE=Pr.createBuilder({position:Pr.float,playbackTimestamp:Pr.float,countInBeatsRemaining:Pr.float,isPlaying:Pr.bool,isCountingIn:Pr.bool,isRecording:Pr.bool});var xE;(function(r){r.store=(e,t,o)=>{if(o==="")return F("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(u.MetaData).map(({box:s})=>s).find(s=>s instanceof nn&&s.origin.getValue()===o),n=s=>{s.target.refer(e),s.origin.setValue(o),s.value.setValue(JSON.stringify(t))};js(i)?n(i):nn.create(e.graph,b.generate(),n)},r.read=(e,t)=>{if(t==="")return F("MetaData.read: origin must be unique to your app.");let o=e.pointerHub.filter(u.MetaData).map(({box:i})=>i).find(i=>i instanceof nn&&i.origin.getValue()===t);if(js(o)){let{status:i,value:n,error:s}=Ho(()=>JSON.parse(o.value.getValue()));if(i==="success")return n;console.warn(s)}return null},r.clear=(e,t)=>{if(t==="")return F("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(u.MetaData).map(({box:o})=>o).filter(o=>o instanceof nn&&o.origin.getValue()===t).forEach(o=>o.delete())}})(xE||(xE={}));var Cw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_s=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},hv,fv,mv,tl,ki=class{constructor(e,t){hv.set(this,new O),fv.set(this,void 0),mv.set(this,void 0),tl.set(this,void 0),Cw(this,fv,e,"f"),Cw(this,mv,t,"f"),Cw(this,tl,new nt(128),"f"),_s(this,hv,"f").own(_s(this,fv,"f").broadcastIntegers(_s(this,mv,"f"),new Int32Array(_s(this,tl,"f").buffer),o=>{}))}noteOn(e){e>=0&&e<128&&_s(this,tl,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&_s(this,tl,"f").setBit(e,!1)}reset(){}clear(){_s(this,tl,"f").clear()}terminate(){_s(this,hv,"f").terminate()}toString(){return`{${this.constructor.name}}`}};hv=new WeakMap,fv=new WeakMap,mv=new WeakMap,tl=new WeakMap;var ut;(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 o=r.readParam1(t)&127,i=r.readParam2(t)&127,n=o|i<<7;return 8192>=n?n/8192-1:(n-8191)/8192},r.asValue=t=>{let o=r.readParam2(t);return o>64?.5+(o-63)/128:o<64?o/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,o,i)=>new Uint8Array([e.NoteOn|t,o,i]),r.noteOff=(t,o)=>new Uint8Array([e.NoteOff|t,o,0]),r.control=(t,o,i)=>new Uint8Array([e.Controller|t,o&127,i&127]),r.position=(t,o)=>new Uint8Array([e.Position,t&127,o&127]),r.positionInPPQN=t=>{let o=Math.floor(t/96),i=o&127,n=o>>7&127;return new Uint8Array([e.Position,i,n])},r.accept=(t,o)=>{Us(t)||(r.isNoteOn(t)?_(o.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(o.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(o.pitchBend,r.asPitchBend(t)):r.isController(t)?_(o.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(o.clock):r.isStart(t)?_(o.start):r.isContinue(t)?_(o.continue):r.isStop(t)?_(o.stop):r.isPosition(t)&&_(o.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"})(ut||(ut={}));var Pn;(function(r){r.on=(e,t,o)=>({type:"note-on",uuid:e,pitch:t,velocity:o}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.audition=(e,t,o,i)=>({type:"note-audition",uuid:e,pitch:t,duration:o,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 o=e.data;if(ut.isNoteOn(o)){let i=ut.readPitch(o),n=ut.readVelocity(o);return{type:"note-on",uuid:t,pitch:i,velocity:n}}else if(ut.isNoteOff(o)){let i=ut.readPitch(o);return{type:"note-off",uuid:t,pitch:i}}return F("Unknown MIDI event")}})(Pn||(Pn={}));var bE;(function(r){r.start=(e,t,o,i=1)=>{let n=!0;return e(Pn.on(t,o,i)),{terminate:()=>{n&&(e(Pn.off(t,o)),n=!1)}}}})(bE||(bE={}));var WN,ZN,GN,qN,HN;WN=new WeakMap,ZN=new WeakMap,GN=new WeakMap,qN=new WeakMap,HN=new WeakMap;var JN=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="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 o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gv=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},rl,vv=class{constructor(){rl.set(this,void 0),JN(this,rl,be.newSet(e=>e.field.address),"f")}register(e){return gv(this,rl,"f").add(e),{terminate:()=>gv(this,rl,"f").removeByValue(e)}}get(e){return gv(this,rl,"f").get(e)}opt(e){return gv(this,rl,"f").opt(e)}};rl=new WeakMap;var Ps={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})??F("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var yv;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?lo.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?lo.err("Denominator must be a power of two between 1 and 32"):lo.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?ue(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:o=>{for(let[i,n]of C.iterateAdjacent(o.regions.pointerHub.incoming().map(({box:s})=>Ps.asRegionBox(s)).sort(({position:s},{position:a})=>s.getValue()-a.getValue()))){if(i instanceof zn&&i.timeBase.getValue()===cr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>n.position.getValue())return!0}return!1}})??!1)})(yv||(yv={}));var wE;(function(r){r.parseTimeSignature=e=>{let[t,o]=e.split("/"),i=parseInt(t,10),n=parseInt(o,10);return yv.isTimeSignatureValid(i,n)}})(wE||(wE={}));var xv;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:o,bufferSize:i},n)=>{let s=!0,a=new Int32Array(e,0,2),l=new Float32Array(e,8),c=new Float32Array(o*i),d=typeof document>"u",p=()=>{if(!s)return;let f=Atomics.load(a,1),g=Atomics.load(a,0);if(f===g){if(d)Atomics.wait(a,0,g);else{setTimeout(p,1);return}g=Atomics.load(a,0)}for(;f!==g;){let v=f*o*i;c.set(l.subarray(v,v+o*i));let x=[];for(let y=0;y<o;y++){let M=y*i,T=M+i;x.push(c.slice(M,T))}if(f=(f+1)%t,Atomics.store(a,1,f),!s)return;n(x)}p()};return p(),{stop:()=>s=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:o,bufferSize:i})=>{let n=new Int32Array(e,0,2),s=new Float32Array(e,8);return Object.freeze({write:a=>{if(a.length!==o)return;for(let d of a)if(d.length!==i)return F("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(n,0),c=l*o*i;a.forEach((d,p)=>s.set(d,c+p*i)),Atomics.store(n,0,(l+1)%t),Atomics.notify(n,0)}})}})(xv||(xv={}));var Tw={isRegion:r=>Ps.isRegionBox(r.box),isLoopableRegion:r=>Ps.isLoopableRegionBox(r.box)};var jo;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(jo||(jo={}));var QN,XN,YN,eI;QN=new WeakMap,XN=new WeakMap,YN=new WeakMap,eI=new WeakMap;var tI,rI,iI,oI;tI=new WeakMap,rI=new WeakMap,iI=new WeakMap,oI=new WeakMap;var bc={[Bt.Instrument]:0,[Bt.Aux]:1,[Bt.Bus]:2,[Bt.Output]:3};var bv;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:o}},i,n,s)=>{let a=s??r.orderAndGetIndex(t,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${a}`),st.create(e,b.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(o.input),l.index.setValue(a),l.type.setValue(i),n.ifSome(c=>l.capture.refer(c))})},r.orderAndGetIndex=(e,t)=>{let o=Bl.collectIndexedBoxes(e.audioUnits,st),i=bc[t],n=0;for(;n<o.length&&!(bc[o[n].type.getValue()]>i);n++);let s=n;for(;n<o.length;)o[n].index.setValue(++n);return s},r.trackTypeToCapture=(e,t)=>{switch(t){case oe.Audio:return m.wrap(jn.create(e,b.generate()));case oe.Notes:return m.wrap(Ln.create(e,b.generate()));default:return m.None}}})(bv||(bv={}));var AE;(function(r){r.create=(e,t,o,i,n)=>{console.debug(`createAudioBus '${t}', type: ${i}, color: ${n}`);let{boxGraph:s,mandatoryBoxes:{rootBox:a}}=e;D(a.isAttached(),"rootBox not attached");let l=b.generate(),c=Oi.create(s,l,p=>{p.collection.refer(a.audioBusses),p.label.setValue(t),p.icon.setValue(De.toName(o)),p.color.setValue(n.toString())}),d=bv.create(e,i,m.None);return dr.create(s,b.generate(),p=>{p.tracks.refer(d.tracks),p.target.refer(d),p.index.setValue(0),p.type.setValue(oe.Undefined)}),c.output.refer(d.input),c}})(AE||(AE={}));var _E;(function(r){r.forAudioType=e=>{switch(e){case Bt.Output:return Fl.blue;case Bt.Aux:return Fl.purple;case Bt.Bus:return Fl.orange;case Bt.Instrument:return Fl.green;default:return Fl.dark}},r.forTrackType=e=>{switch(e){case oe.Audio:return 200;case oe.Notes:return 45;case oe.Value:return 156;default:return 0}}})(_E||(_E={}));var PE;(function(r){r.Tape={defaultName:"Tape",defaultIcon:De.Tape,description:"Plays audio regions & clips",trackType:oe.Audio,create:(o,i,n,s,a)=>Kl.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue(De.toName(s)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(i)})},r.Nano={defaultName:"Nano",defaultIcon:De.NanoWave,description:"Simple sampler",trackType:oe.Notes,create:(o,i,n,s,a)=>{let l;if(Z(a))l=a;else{let c=b.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),d=5.34;l=o.findBox(c).unwrapOrElse(()=>pr.create(o,c,p=>{p.fileName.setValue("Rhode"),p.endInSeconds.setValue(d)}))}return jl.create(o,b.generate(),c=>{c.label.setValue(n),c.icon.setValue(De.toName(s)),c.file.refer(l),c.host.refer(i)})}},r.Playfield={defaultName:"Playfield",defaultIcon:De.Playfield,description:"Drum computer",trackType:oe.Notes,create:(o,i,n,s,a)=>{let l=Ll.create(o,b.generate(),c=>{c.label.setValue(n),c.icon.setValue(De.toName(s)),c.host.refer(i)});return Z(a)&&a.filter(({note:c,uuid:d,name:p,durationInSeconds:f,exclude:g})=>{let v=e(o,d,p,f);Kn.create(o,b.generate(),x=>{x.device.refer(l.samples),x.file.refer(v),x.index.setValue(c),x.exclude.setValue(g)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:De.Piano,description:"Classic subtractive synthesizer",trackType:oe.Notes,create:(o,i,n,s,a)=>Vl.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue(De.toName(s)),l.tune.setInitValue(0),l.cutoff.setInitValue(8e3),l.resonance.setInitValue(.1),l.attack.setInitValue(.005),l.decay.setInitValue(.1),l.sustain.setInitValue(.5),l.release.setInitValue(.5),l.voicingMode.setInitValue(go.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(Ke.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(Ke.square),l.host.refer(i),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:De.Midi,description:"MIDI Output",trackType:oe.Notes,create:(o,i,n,s,a)=>zl.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue(De.toName(s)),l.host.refer(i)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:De.SoundFont,description:"Soundfont Player",trackType:oe.Notes,create:(o,i,n,s,a)=>{a??(a={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=a.uuid,c=b.parse(l),d=t(o,c,a.name);return Ul.create(o,b.generate(),p=>{p.label.setValue(n),p.icon.setValue(De.toName(s)),p.host.refer(i),p.file.refer(d)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(o,i,n,s)=>o.findBox(i).unwrapOrElse(()=>pr.create(o,i,a=>{a.fileName.setValue(n),a.endInSeconds.setValue(s)})),t=(o,i,n)=>o.findBox(i).unwrapOrElse(()=>Er.create(o,i,s=>s.fileName.setValue(n)))})(PE||(PE={}));var Ss;(function(r){r.empty=o=>{let i=new Js(m.wrap(Qs.create)),n=new Date().toISOString();console.debug(`New Project created on ${n}`),i.beginTransaction();let s=Rl.create(i,b.generate(),f=>{f.label.setValue("Groove Shuffle")}),a=Nl.create(i,b.generate(),f=>{f.groove.refer(s),f.created.setValue(n)}),l=Oi.create(i,b.generate(),f=>{f.collection.refer(a.audioBusses),f.label.setValue("Output"),f.icon.setValue(De.toName(De.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),c=st.create(i,b.generate(),f=>{f.type.setValue(Bt.Output),f.collection.refer(a.audioUnits),f.output.refer(a.outputDevice),f.index.setValue(0)});o.createOutputCompressor&&Ol.create(i,b.generate(),f=>{f.label.setValue("Master Compressor"),f.index.setValue(0),f.host.refer(c.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let d=Ys.create(i,b.generate());a.timeline.refer(d.root),l.output.refer(c.input);let p=[];if(o.createDefaultUser){let f=Xs.create(i,b.generate());f.root.refer(a.users),p.push(f)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:a,primaryAudioBus:l,primaryAudioOutputUnit:c,timelineBox:d,userInterfaceBoxes:p}}},r.encode=o=>{let i=Mt.create();i.writeInt(1330660686),i.writeInt(2);let n=o.toArrayBuffer();return i.writeInt(n.byteLength),i.writeBytes(new Int8Array(n)),i.toArrayBuffer()},r.decode=o=>{let i=new ct(o);D(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),D(i.readInt()===2,"Deprecated Format");let n=i.readInt(),s=new Int8Array(n);i.readBytes(s);let a=new Js(m.wrap(Qs.create));return a.fromArrayBuffer(s.buffer),{boxGraph:a,mandatoryBoxes:r.findMandatoryBoxes(a)}},r.findMandatoryBoxes=o=>{let i=o.boxes().find(n=>n.accept({visitRootBox:()=>!0}));if(Z(i)){let n=Ie(i.outputDevice.pointerHub.incoming().at(0)?.box,st),s=Ie(n.input.pointerHub.incoming().at(0)?.box,Oi),a=Ie(i.timeline.targetVertex.unwrap("TimelineBox not found").box,Ys),l=i.users.pointerHub.incoming().map(({box:c})=>Ie(c,Xs));return{rootBox:i,primaryAudioBus:s,primaryAudioOutputUnit:n,timelineBox:a,userInterfaceBoxes:l}}return F("Could not find mandatory boxes")}})(Ss||(Ss={}));var wc;(function(r){let e=({graph:a},{graph:l})=>a===l,t=(a,l)=>a.index.getValue()-l.index.getValue(),o=a=>a.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(a,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:d}},p={})=>{D(C.satisfy(a,e),"AudioUnits must share the same BoxGraph"),D(!p.includeAux&&!p.includeBus,"Options are not yet implemented");let f=p?.excludeTimeline===!0?o:Nn.alwaysFalse,g=b.newSet(y=>y);a.forEach(y=>g.add(y.address.uuid)),a.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!1,excludeBox:f}).boxes)).forEach(y=>g.add(y.address.uuid));let v=a.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==vo.ClassName&&y.name!==ra.ClassName).filter(y=>g.opt(y.address.uuid).nonEmpty()),x=i(a,v,d.audioUnits.address.uuid,c.address.uuid);return n(x,l,a,v),s(x,a,d),console.debug("inTransaction",l.inTransaction()),a.map(y=>Ie(d.graph.findBox(x.get(y.address.uuid).target).unwrap("Target Track has not been copied"),st))},r.extractRegions=(a,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:d}},p=0)=>{D(C.satisfy(a,e),"Region smust be from the same BoxGraph");let f=new Set(a),g=new Set,v=new vl;a.forEach(z=>{let ee=Ie(z.regions.targetVertex.unwrap().box,dr);g.add(ee);let te=Ie(ee.tracks.targetVertex.unwrap().box,st);v.add(te,ee)}),console.debug(`Found ${v.keyCount()} audioUnits`),console.debug(`Found ${g.size} tracks`);let x=[...v.keys()],y=z=>Ce(z,dr)&&!g.has(z)||Ps.isRegionBox(z)&&!f.has(z),M=x.flatMap(z=>Array.from(z.graph.dependenciesOf(z,{excludeBox:y,alwaysFollowMandatory:!0}).boxes)).filter(z=>z.name!==vo.ClassName&&z.name!==ra.ClassName),T=i(x,M,d.audioUnits.address.uuid,c.address.uuid);n(T,l,x,M),s(T,x,d),v.forEach((z,ee)=>[...ee].sort(t).forEach((te,H)=>{let ye=l.findBox(T.get(te.address.uuid).target).unwrap("Target Track has not been copied");Ie(ye,dr).index.setValue(H)}));let L=a.reduce((z,ee)=>Math.min(z,ee.position.getValue()),Number.MAX_VALUE),R=p-L;a.forEach(z=>{let ee=l.findBox(T.get(z.address.uuid).target).unwrap("Target Track has not been copied"),te=Ps.asRegionBox(ee).position;te.setValue(te.getValue()+R)})};let i=(a,l,c,d)=>{let p=b.newSet(({source:f})=>f);return p.addMany([...a.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:d})),...a.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:c})),...a.map(f=>({source:f.address.uuid,target:b.generate()})),...l.map(({address:{uuid:f},name:g})=>({source:f,target:g===pr.ClassName||g===Er.ClassName?f:b.generate()}))]),p},n=(a,l,c,d)=>{let p=b.newSet(f=>f);d.forEach(f=>{(f instanceof pr||f instanceof Er)&&l.findBox(f.address.uuid).nonEmpty()&&(console.debug(`Skipping existing file box: ${f.name} ${b.toString(f.address.uuid)}`),p.add(f.address.uuid))}),console.debug(`Dependencies to copy: ${d.length}, existing file boxes: ${p.size}`),B.decodeWith({map:(f,g)=>g.map(v=>a.opt(v.uuid).match({none:()=>v,some:({target:x})=>v.moveTo(x)}))},()=>{c.forEach(f=>{let g=new ct(f.toArrayBuffer()),v=f.name,x=a.get(f.address.uuid).target;l.createBox(v,x,y=>y.read(g))}),d.forEach(f=>{if((f instanceof pr||f instanceof Er)&&p.opt(f.address.uuid).nonEmpty()){console.debug(` Skipping file box: ${f.name}`);return}if(f instanceof Cl){let y=f.owner.targetAddress.unwrap().uuid;if(p.opt(y).nonEmpty()){console.debug(" Skipping TransientMarkerBox (owner exists)");return}}let g=new ct(f.toArrayBuffer()),v=f.name,x=a.get(f.address.uuid).target;console.debug(` Creating: ${v} ${b.toString(x)}`),l.createBox(v,x,y=>y.read(g))})})},s=(a,l,c)=>l.toSorted(t).map(d=>Ie(c.graph.findBox(a.get(d.address.uuid).target).unwrap("Target Track has not been copied"),st)).forEach(d=>Bl.collectIndexedBoxes(c.audioUnits,st).toSorted((p,f)=>{let g=bc[p.type.getValue()],v=bc[f.type.getValue()],x=g-v;return x===0?f===d?-1:1:x}).forEach((p,f)=>p.index.setValue(f)))})(wc||(wc={}));var Es;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(Es||(Es={}));var SE;(function(r){r.decode=(e,t)=>{let o=new ct(e.slice(0,8));if(o.readInt()!==Es.MAGIC_HEADER_OPEN){bl.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(o.readInt()!==Es.FORMAT_VERSION){bl.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let i=new Js(m.wrap(Qs.create));try{i.fromArrayBuffer(e.slice(8))}catch(s){bl.info({headline:"Could Not Import Preset",message:String(s)}).then();return}let n=i.boxes().filter(s=>Ce(s,st)).filter(s=>s.type.getValue()!==Bt.Output);wc.extractAudioUnits(n,t,{excludeTimeline:!0}).filter(s=>s.type.getValue()!==Bt.Output).forEach(s=>{let a=s.input.pointerHub.incoming().at(0)?.box;Z(a)&&s.capture.targetVertex.ifSome(({box:l})=>{l instanceof Ln?dr.create(t.boxGraph,b.generate(),c=>{c.index.setValue(0),c.type.setValue(oe.Notes),c.target.refer(s),c.tracks.refer(s.tracks)}):l instanceof jn&&dr.create(t.boxGraph,b.generate(),c=>{c.index.setValue(0),c.type.setValue(oe.Audio),c.target.refer(s),c.tracks.refer(s.tracks)})})})},r.replaceAudioUnit=(e,t,o)=>{console.debug("ReplaceAudioUnit with preset...");let i=Ss.empty({createDefaultUser:!1,createOutputCompressor:!1}),n=i.boxGraph,s=t.graph;n.beginTransaction(),r.decode(e,i),n.endTransaction();let a=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Ie(y,st)).find(y=>y.type.getValue()!==Bt.Output);if(ff(a))return lo.err("Preset contains no valid audio unit. Please send the file to the developers.");let l=a.capture.targetVertex.mapOr(({box:y})=>y.name,""),c=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(l!==c)return lo.err("Cannot replace incompatible instruments");let d=o?.keepMIDIEffects!==!0,p=o?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",d),console.debug("replaceAudioEffects",p),re(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),d?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(n.beginTransaction(),a.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),n.endTransaction()),p?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(n.beginTransaction(),a.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),n.endTransaction());let f=y=>y.accept({visitTrackBox:M=>!0,visitCaptureMidiBox:M=>!0,visitCaptureAudioBox:M=>!0})===!0,g=b.newSet(({source:y})=>y),v=Array.from(n.dependenciesOf(a,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);g.addMany([{source:a.address.uuid,target:t.address.uuid},...v.map(({address:{uuid:y},name:M})=>({source:y,target:M===pr.ClassName||M===Er.ClassName?y:b.generate()}))]);let x=b.newSet(y=>y);return v.forEach(y=>{(y instanceof pr||y instanceof Er)&&s.findBox(y.address.uuid).nonEmpty()&&x.add(y.address.uuid)}),B.decodeWith({map:(y,M)=>M.map(T=>g.opt(T.uuid).match({none:()=>T,some:({target:L})=>T.moveTo(L)}))},()=>{v.forEach(y=>{if((y instanceof pr||y instanceof Er)&&x.opt(y.address.uuid).nonEmpty())return;let M=new ct(y.toArrayBuffer()),T=y.name,L=g.get(y.address.uuid).target;s.createBox(T,L,R=>R.read(M))})}),lo.Ok}})(SE||(SE={}));var EE;(function(r){r.encode=e=>{let t=Mt.create();t.writeInt(Es.MAGIC_HEADER_OPEN),t.writeInt(Es.FORMAT_VERSION);let o=Ss.empty({createOutputCompressor:!1,createDefaultUser:!1});return o.boxGraph.beginTransaction(),wc.extractAudioUnits([e],o,{excludeTimeline:!0}),o.boxGraph.endTransaction(),console.debug("SAVING..."),o.boxGraph.debugBoxes(),C.concatArrayBuffers(t.toArrayBuffer(),o.boxGraph.toArrayBuffer())}})(EE||(EE={}));var BE;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let o=re(Ie(t,st).input.pointerHub.incoming().at(0)).box;return"label"in o&&o.label instanceof $?o.label.getValue():"N/A"})})(BE||(BE={}));var Dt={};qo(Dt,{$brand:()=>wv,$input:()=>i_,$output:()=>r_,NEVER:()=>Rw,TimePrecision:()=>a_,ZodAny:()=>QP,ZodArray:()=>t1,ZodBase64:()=>Wy,ZodBase64URL:()=>Zy,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>Hy,ZodBoolean:()=>Jc,ZodCIDRv4:()=>Ly,ZodCIDRv6:()=>Ky,ZodCUID:()=>Ty,ZodCUID2:()=>Ry,ZodCatch:()=>w1,ZodCodec:()=>ix,ZodCustom:()=>Yh,ZodCustomStringFormat:()=>qc,ZodDate:()=>qh,ZodDefault:()=>m1,ZodDiscriminatedUnion:()=>i1,ZodE164:()=>Gy,ZodEmail:()=>Dy,ZodEmoji:()=>My,ZodEnum:()=>Zc,ZodError:()=>R$,ZodFile:()=>p1,ZodFirstPartyTypeKind:()=>D1,ZodFunction:()=>I1,ZodGUID:()=>Lh,ZodIPv4:()=>Uy,ZodIPv6:()=>jy,ZodISODate:()=>By,ZodISODateTime:()=>Ey,ZodISODuration:()=>Ny,ZodISOTime:()=>Fy,ZodIntersection:()=>o1,ZodIssueCode:()=>V$,ZodJWT:()=>qy,ZodKSUID:()=>zy,ZodLazy:()=>B1,ZodLiteral:()=>d1,ZodMAC:()=>KP,ZodMap:()=>u1,ZodNaN:()=>_1,ZodNanoID:()=>Cy,ZodNever:()=>YP,ZodNonOptional:()=>tx,ZodNull:()=>HP,ZodNullable:()=>f1,ZodNumber:()=>Hc,ZodNumberFormat:()=>cl,ZodObject:()=>Jh,ZodOptional:()=>ex,ZodPipe:()=>rx,ZodPrefault:()=>v1,ZodPromise:()=>N1,ZodReadonly:()=>P1,ZodRealError:()=>Rr,ZodRecord:()=>Xh,ZodSet:()=>c1,ZodString:()=>Gc,ZodStringFormat:()=>qe,ZodSuccess:()=>b1,ZodSymbol:()=>GP,ZodTemplateLiteral:()=>E1,ZodTransform:()=>h1,ZodTuple:()=>s1,ZodType:()=>Se,ZodULID:()=>Oy,ZodURL:()=>Gh,ZodUUID:()=>Wo,ZodUndefined:()=>qP,ZodUnion:()=>Qh,ZodUnknown:()=>XP,ZodVoid:()=>e1,ZodXID:()=>Vy,ZodXor:()=>r1,_ZodString:()=>$y,_default:()=>g1,_function:()=>iN,any:()=>CF,array:()=>Hh,base64:()=>yF,base64url:()=>xF,bigint:()=>IF,boolean:()=>ZP,catch:()=>A1,check:()=>oN,cidrv4:()=>gF,cidrv6:()=>vF,clone:()=>br,codec:()=>eN,coerce:()=>M1,config:()=>bt,core:()=>En,cuid:()=>lF,cuid2:()=>uF,custom:()=>nN,date:()=>RF,decode:()=>RP,decodeAsync:()=>VP,describe:()=>sN,discriminatedUnion:()=>LF,e164:()=>bF,email:()=>XB,emoji:()=>sF,encode:()=>TP,encodeAsync:()=>OP,endsWith:()=>Tc,enum:()=>Xy,file:()=>JF,flattenError:()=>Nh,float32:()=>EF,float64:()=>BF,formatError:()=>Ih,fromJSONSchema:()=>hN,function:()=>iN,getErrorMap:()=>U$,globalRegistry:()=>wr,gt:()=>Ko,gte:()=>Ar,guid:()=>YB,hash:()=>SF,hex:()=>PF,hostname:()=>_F,httpUrl:()=>nF,includes:()=>Mc,instanceof:()=>lN,int:()=>ky,int32:()=>FF,int64:()=>kF,intersection:()=>n1,ipv4:()=>hF,ipv6:()=>mF,iso:()=>Wc,json:()=>cN,jwt:()=>wF,keyof:()=>OF,ksuid:()=>pF,lazy:()=>F1,length:()=>ll,literal:()=>HF,locales:()=>Vh,looseObject:()=>UF,looseRecord:()=>WF,lowercase:()=>$c,lt:()=>Lo,lte:()=>ti,mac:()=>fF,map:()=>ZF,maxLength:()=>al,maxSize:()=>sl,meta:()=>aN,mime:()=>Rc,minLength:()=>Sn,minSize:()=>Ms,multipleOf:()=>Ds,nan:()=>YF,nanoid:()=>aF,nativeEnum:()=>qF,negative:()=>vy,never:()=>Jy,nonnegative:()=>xy,nonoptional:()=>x1,nonpositive:()=>yy,normalize:()=>Oc,null:()=>JP,nullable:()=>Wh,nullish:()=>QF,number:()=>WP,object:()=>VF,optional:()=>Kh,overwrite:()=>so,parse:()=>$P,parseAsync:()=>DP,partialRecord:()=>KF,pipe:()=>Zh,positive:()=>gy,prefault:()=>y1,preprocess:()=>dN,prettifyError:()=>Hw,promise:()=>rN,property:()=>by,readonly:()=>S1,record:()=>l1,refine:()=>k1,regex:()=>kc,regexes:()=>Di,registry:()=>Hv,safeDecode:()=>UP,safeDecodeAsync:()=>LP,safeEncode:()=>zP,safeEncodeAsync:()=>jP,safeParse:()=>MP,safeParseAsync:()=>CP,set:()=>GF,setErrorMap:()=>z$,size:()=>Ic,slugify:()=>jc,startsWith:()=>Cc,strictObject:()=>zF,string:()=>Iy,stringFormat:()=>AF,stringbool:()=>uN,success:()=>XF,superRefine:()=>$1,symbol:()=>DF,templateLiteral:()=>tN,toJSONSchema:()=>_y,toLowerCase:()=>zc,toUpperCase:()=>Uc,transform:()=>Yy,treeifyError:()=>qw,trim:()=>Vc,tuple:()=>a1,uint32:()=>NF,uint64:()=>$F,ulid:()=>cF,undefined:()=>MF,union:()=>Qy,unknown:()=>ul,uppercase:()=>Dc,url:()=>oF,util:()=>U,uuid:()=>eF,uuidv4:()=>tF,uuidv6:()=>rF,uuidv7:()=>iF,void:()=>TF,xid:()=>dF,xor:()=>jF});var En={};qo(En,{$ZodAny:()=>PA,$ZodArray:()=>NA,$ZodAsyncError:()=>no,$ZodBase64:()=>fA,$ZodBase64URL:()=>mA,$ZodBigInt:()=>Lv,$ZodBigIntFormat:()=>bA,$ZodBoolean:()=>Mh,$ZodCIDRv4:()=>dA,$ZodCIDRv6:()=>pA,$ZodCUID:()=>Y0,$ZodCUID2:()=>eA,$ZodCatch:()=>GA,$ZodCheck:()=>Xe,$ZodCheckBigIntFormat:()=>N0,$ZodCheckEndsWith:()=>U0,$ZodCheckGreaterThan:()=>Tv,$ZodCheckIncludes:()=>V0,$ZodCheckLengthEquals:()=>C0,$ZodCheckLessThan:()=>Cv,$ZodCheckLowerCase:()=>R0,$ZodCheckMaxLength:()=>D0,$ZodCheckMaxSize:()=>I0,$ZodCheckMimeType:()=>L0,$ZodCheckMinLength:()=>M0,$ZodCheckMinSize:()=>k0,$ZodCheckMultipleOf:()=>B0,$ZodCheckNumberFormat:()=>F0,$ZodCheckOverwrite:()=>K0,$ZodCheckProperty:()=>j0,$ZodCheckRegex:()=>T0,$ZodCheckSizeEquals:()=>$0,$ZodCheckStartsWith:()=>z0,$ZodCheckStringFormat:()=>Nc,$ZodCheckUpperCase:()=>O0,$ZodCodec:()=>Th,$ZodCustom:()=>t_,$ZodCustomStringFormat:()=>yA,$ZodDate:()=>FA,$ZodDefault:()=>LA,$ZodDiscriminatedUnion:()=>$A,$ZodE164:()=>gA,$ZodEmail:()=>H0,$ZodEmoji:()=>Q0,$ZodEncodeError:()=>Bs,$ZodEnum:()=>RA,$ZodError:()=>Fh,$ZodFile:()=>VA,$ZodFunction:()=>XA,$ZodGUID:()=>G0,$ZodIPv4:()=>lA,$ZodIPv6:()=>uA,$ZodISODate:()=>nA,$ZodISODateTime:()=>oA,$ZodISODuration:()=>aA,$ZodISOTime:()=>sA,$ZodIntersection:()=>DA,$ZodJWT:()=>vA,$ZodKSUID:()=>iA,$ZodLazy:()=>e_,$ZodLiteral:()=>OA,$ZodMAC:()=>cA,$ZodMap:()=>CA,$ZodNaN:()=>qA,$ZodNanoID:()=>X0,$ZodNever:()=>EA,$ZodNonOptional:()=>WA,$ZodNull:()=>_A,$ZodNullable:()=>jA,$ZodNumber:()=>jv,$ZodNumberFormat:()=>xA,$ZodObject:()=>eB,$ZodObjectJIT:()=>IA,$ZodOptional:()=>UA,$ZodPipe:()=>HA,$ZodPrefault:()=>KA,$ZodPromise:()=>YA,$ZodReadonly:()=>JA,$ZodRealError:()=>Tr,$ZodRecord:()=>MA,$ZodRegistry:()=>qv,$ZodSet:()=>TA,$ZodString:()=>nl,$ZodStringFormat:()=>Ge,$ZodSuccess:()=>ZA,$ZodSymbol:()=>wA,$ZodTemplateLiteral:()=>QA,$ZodTransform:()=>zA,$ZodTuple:()=>Kv,$ZodType:()=>me,$ZodULID:()=>tA,$ZodURL:()=>J0,$ZodUUID:()=>q0,$ZodUndefined:()=>AA,$ZodUnion:()=>Ch,$ZodUnknown:()=>SA,$ZodVoid:()=>BA,$ZodXID:()=>rA,$ZodXor:()=>kA,$brand:()=>wv,$constructor:()=>w,$input:()=>i_,$output:()=>r_,Doc:()=>Dh,JSONSchema:()=>JB,JSONSchemaGenerator:()=>Py,NEVER:()=>Rw,TimePrecision:()=>a_,_any:()=>F_,_array:()=>C_,_base64:()=>py,_base64url:()=>hy,_bigint:()=>w_,_boolean:()=>x_,_catch:()=>N$,_check:()=>HB,_cidrv4:()=>cy,_cidrv6:()=>dy,_coercedBigint:()=>A_,_coercedBoolean:()=>b_,_coercedDate:()=>D_,_coercedNumber:()=>h_,_coercedString:()=>n_,_cuid:()=>iy,_cuid2:()=>oy,_custom:()=>R_,_date:()=>$_,_decode:()=>Bv,_decodeAsync:()=>Nv,_default:()=>E$,_discriminatedUnion:()=>f$,_e164:()=>fy,_email:()=>Jv,_emoji:()=>ty,_encode:()=>Ev,_encodeAsync:()=>Fv,_endsWith:()=>Tc,_enum:()=>b$,_file:()=>T_,_float32:()=>m_,_float64:()=>g_,_gt:()=>Ko,_gte:()=>Ar,_guid:()=>zh,_includes:()=>Mc,_int:()=>f_,_int32:()=>v_,_int64:()=>__,_intersection:()=>m$,_ipv4:()=>ly,_ipv6:()=>uy,_isoDate:()=>u_,_isoDateTime:()=>l_,_isoDuration:()=>d_,_isoTime:()=>c_,_jwt:()=>my,_ksuid:()=>ay,_lazy:()=>D$,_length:()=>ll,_literal:()=>A$,_lowercase:()=>$c,_lt:()=>Lo,_lte:()=>ti,_mac:()=>s_,_map:()=>y$,_max:()=>ti,_maxLength:()=>al,_maxSize:()=>sl,_mime:()=>Rc,_min:()=>Ar,_minLength:()=>Sn,_minSize:()=>Ms,_multipleOf:()=>Ds,_nan:()=>M_,_nanoid:()=>ry,_nativeEnum:()=>w$,_negative:()=>vy,_never:()=>I_,_nonnegative:()=>xy,_nonoptional:()=>B$,_nonpositive:()=>yy,_normalize:()=>Oc,_null:()=>B_,_nullable:()=>S$,_number:()=>p_,_optional:()=>P$,_overwrite:()=>so,_parse:()=>Sc,_parseAsync:()=>Ec,_pipe:()=>I$,_positive:()=>gy,_promise:()=>M$,_property:()=>by,_readonly:()=>k$,_record:()=>v$,_refine:()=>O_,_regex:()=>kc,_safeDecode:()=>kv,_safeDecodeAsync:()=>Dv,_safeEncode:()=>Iv,_safeEncodeAsync:()=>$v,_safeParse:()=>Bc,_safeParseAsync:()=>Fc,_set:()=>x$,_size:()=>Ic,_slugify:()=>jc,_startsWith:()=>Cc,_string:()=>o_,_stringFormat:()=>Lc,_stringbool:()=>j_,_success:()=>F$,_superRefine:()=>V_,_symbol:()=>S_,_templateLiteral:()=>$$,_toLowerCase:()=>zc,_toUpperCase:()=>Uc,_transform:()=>_$,_trim:()=>Vc,_tuple:()=>g$,_uint32:()=>y_,_uint64:()=>P_,_ulid:()=>ny,_undefined:()=>E_,_union:()=>p$,_unknown:()=>N_,_uppercase:()=>Dc,_url:()=>Uh,_uuid:()=>Qv,_uuidv4:()=>Xv,_uuidv6:()=>Yv,_uuidv7:()=>ey,_void:()=>k_,_xid:()=>sy,_xor:()=>h$,clone:()=>br,config:()=>bt,createStandardJSONSchemaMethod:()=>Kc,createToJSONSchemaMethod:()=>L_,decode:()=>$I,decodeAsync:()=>MI,describe:()=>z_,encode:()=>kI,encodeAsync:()=>DI,extractDefs:()=>Ts,finalize:()=>Rs,flattenError:()=>Nh,formatError:()=>Ih,globalConfig:()=>wh,globalRegistry:()=>wr,initializeContext:()=>Cs,isValidBase64:()=>hA,isValidBase64URL:()=>JE,isValidJWT:()=>QE,locales:()=>Vh,meta:()=>U_,parse:()=>Pv,parseAsync:()=>Sv,prettifyError:()=>Hw,process:()=>Ze,regexes:()=>Di,registry:()=>Hv,safeDecode:()=>TI,safeDecodeAsync:()=>OI,safeEncode:()=>CI,safeEncodeAsync:()=>RI,safeParse:()=>Jw,safeParseAsync:()=>Qw,toDotPath:()=>$E,toJSONSchema:()=>_y,treeifyError:()=>qw,util:()=>U,version:()=>W0});var Rw=Object.freeze({status:"aborted"});function w(r,e,t){function o(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(r))return;a._zod.traits.add(r),e(a,l);let c=s.prototype,d=Object.keys(c);for(let p=0;p<d.length;p++){let f=d[p];f in a||(a[f]=c[f].bind(a))}}let i=t?.Parent??Object;class n extends i{}Object.defineProperty(n,"name",{value:r});function s(a){var l;let c=t?.Parent?new n:this;o(c,a),(l=c._zod).deferred??(l.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>t?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(r)}),Object.defineProperty(s,"name",{value:r}),s}var wv=Symbol("zod_brand"),no=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Bs=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},wh={};function bt(r){return r&&Object.assign(wh,r),wh}var U={};qo(U,{BIGINT_FORMAT_RANGES:()=>Gw,Class:()=>Vw,NUMBER_FORMAT_RANGES:()=>Zw,aborted:()=>$s,allowsEval:()=>jw,assert:()=>uI,assertEqual:()=>nI,assertIs:()=>aI,assertNever:()=>lI,assertNotEqual:()=>sI,assignProp:()=>Ns,base64ToUint8Array:()=>NE,base64urlToUint8Array:()=>EI,cached:()=>_c,captureStackTrace:()=>_v,cleanEnum:()=>SI,cleanRegex:()=>Ph,clone:()=>br,cloneDef:()=>dI,createTransparentProxy:()=>vI,defineLazy:()=>$e,esc:()=>Av,escapeRegex:()=>$i,extend:()=>bI,finalizeIssue:()=>Cr,floatSafeRemainder:()=>zw,getElementAtPath:()=>pI,getEnumValues:()=>_h,getLengthableOrigin:()=>Bh,getParsedType:()=>gI,getSizableOrigin:()=>Eh,hexToUint8Array:()=>FI,isObject:()=>il,isPlainObject:()=>ks,issue:()=>Pc,joinValues:()=>I,jsonStringifyReplacer:()=>Ac,merge:()=>AI,mergeDefs:()=>Is,normalizeParams:()=>j,nullish:()=>Fs,numKeys:()=>mI,objectClone:()=>cI,omit:()=>xI,optionalKeys:()=>Ww,partial:()=>_I,pick:()=>yI,prefixIssues:()=>ei,primitiveTypes:()=>Kw,promiseAllObject:()=>hI,propertyKeyTypes:()=>Sh,randomString:()=>fI,required:()=>PI,safeExtend:()=>wI,shallowClone:()=>Lw,slugify:()=>Uw,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>IE,uint8ArrayToBase64url:()=>BI,uint8ArrayToHex:()=>NI,unwrapMessage:()=>Ah});function nI(r){return r}function sI(r){return r}function aI(r){}function lI(r){throw new Error("Unexpected value in exhaustive check")}function uI(r){}function _h(r){let e=Object.values(r).filter(o=>typeof o=="number");return Object.entries(r).filter(([o,i])=>e.indexOf(+o)===-1).map(([o,i])=>i)}function I(r,e="|"){return r.map(t=>V(t)).join(e)}function Ac(r,e){return typeof e=="bigint"?e.toString():e}function _c(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Fs(r){return r==null}function Ph(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function zw(r,e){let t=(r.toString().split(".")[1]||"").length,o=e.toString(),i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}let n=t>i?t:i,s=Number.parseInt(r.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return s%a/10**n}var FE=Symbol("evaluating");function $e(r,e,t){let o;Object.defineProperty(r,e,{get(){if(o!==FE)return o===void 0&&(o=FE,o=t()),o},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function cI(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Ns(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Is(...r){let e={};for(let t of r){let o=Object.getOwnPropertyDescriptors(t);Object.assign(e,o)}return Object.defineProperties({},e)}function dI(r){return Is(r._zod.def)}function pI(r,e){return e?e.reduce((t,o)=>t?.[o],r):r}function hI(r){let e=Object.keys(r),t=e.map(o=>r[o]);return Promise.all(t).then(o=>{let i={};for(let n=0;n<e.length;n++)i[e[n]]=o[n];return i})}function fI(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let o=0;o<r;o++)t+=e[Math.floor(Math.random()*e.length)];return t}function Av(r){return JSON.stringify(r)}function Uw(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var _v="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function il(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var jw=_c(()=>{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(il(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(il(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Lw(r){return ks(r)?{...r}:Array.isArray(r)?[...r]:r}function mI(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var gI=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}`)}},Sh=new Set(["string","number","symbol"]),Kw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $i(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function br(r,e,t){let o=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(o._zod.parent=r),o}function j(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 vI(r){let e;return new Proxy({},{get(t,o,i){return e??(e=r()),Reflect.get(e,o,i)},set(t,o,i,n){return e??(e=r()),Reflect.set(e,o,i,n)},has(t,o){return e??(e=r()),Reflect.has(e,o)},deleteProperty(t,o){return e??(e=r()),Reflect.deleteProperty(e,o)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,o){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(t,o,i){return e??(e=r()),Reflect.defineProperty(e,o,i)}})}function V(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Ww(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Zw={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]},Gw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yI(r,e){let t=r._zod.def,o=Is(r._zod.def,{get shape(){let i={};for(let n in e){if(!(n in t.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&(i[n]=t.shape[n])}return Ns(this,"shape",i),i},checks:[]});return br(r,o)}function xI(r,e){let t=r._zod.def,o=Is(r._zod.def,{get shape(){let i={...r._zod.def.shape};for(let n in e){if(!(n in t.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&delete i[n]}return Ns(this,"shape",i),i},checks:[]});return br(r,o)}function bI(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)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let i=Is(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return Ns(this,"shape",n),n},checks:[]});return br(r,i)}function wI(r,e){if(!ks(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let o={...r._zod.def.shape,...e};return Ns(this,"shape",o),o},checks:r._zod.def.checks};return br(r,t)}function AI(r,e){let t=Is(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e._zod.def.shape};return Ns(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:[]});return br(r,t)}function _I(r,e,t){let o=Is(e._zod.def,{get shape(){let i=e._zod.def.shape,n={...i};if(t)for(let s in t){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(n[s]=r?new r({type:"optional",innerType:i[s]}):i[s])}else for(let s in i)n[s]=r?new r({type:"optional",innerType:i[s]}):i[s];return Ns(this,"shape",n),n},checks:[]});return br(e,o)}function PI(r,e,t){let o=Is(e._zod.def,{get shape(){let i=e._zod.def.shape,n={...i};if(t)for(let s in t){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(n[s]=new r({type:"nonoptional",innerType:i[s]}))}else for(let s in i)n[s]=new r({type:"nonoptional",innerType:i[s]});return Ns(this,"shape",n),n},checks:[]});return br(e,o)}function $s(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 ei(r,e){return e.map(t=>{var o;return(o=t).path??(o.path=[]),t.path.unshift(r),t})}function Ah(r){return typeof r=="string"?r:r?.message}function Cr(r,e,t){let o={...r,path:r.path??[]};if(!r.message){let i=Ah(r.inst?._zod.def?.error?.(r))??Ah(e?.error?.(r))??Ah(t.customError?.(r))??Ah(t.localeError?.(r))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function Eh(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Bh(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function Pc(...r){let[e,t,o]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:o}:{...e}}function SI(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function NE(r){let e=atob(r),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t}function IE(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function EI(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return NE(e+t)}function BI(r){return IE(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function FI(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 o=0;o<e.length;o+=2)t[o/2]=Number.parseInt(e.slice(o,o+2),16);return t}function NI(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var Vw=class{constructor(...e){}};var kE=(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,Ac,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Fh=w("$ZodError",kE),Tr=w("$ZodError",kE,{Parent:Error});function Nh(r,e=t=>t.message){let t={},o=[];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))):o.push(e(i));return{formErrors:o,fieldErrors:t}}function Ih(r,e=t=>t.message){let t={_errors:[]},o=i=>{for(let n of i.issues)if(n.code==="invalid_union"&&n.errors.length)n.errors.map(s=>o({issues:s}));else if(n.code==="invalid_key")o({issues:n.issues});else if(n.code==="invalid_element")o({issues:n.issues});else if(n.path.length===0)t._errors.push(e(n));else{let s=t,a=0;for(;a<n.path.length;){let l=n.path[a];a===n.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(e(n))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return o(r),t}function qw(r,e=t=>t.message){let t={errors:[]},o=(i,n=[])=>{var s,a;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>o({issues:c},l.path));else if(l.code==="invalid_key")o({issues:l.issues},l.path);else if(l.code==="invalid_element")o({issues:l.issues},l.path);else{let c=[...n,...l.path];if(c.length===0){t.errors.push(e(l));continue}let d=t,p=0;for(;p<c.length;){let f=c[p],g=p===c.length-1;typeof f=="string"?(d.properties??(d.properties={}),(s=d.properties)[f]??(s[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(a=d.items)[f]??(a[f]={errors:[]}),d=d.items[f]),g&&d.errors.push(e(l)),p++}}};return o(r),t}function $E(r){let e=[],t=r.map(o=>typeof o=="object"?o.key:o);for(let o of t)typeof o=="number"?e.push(`[${o}]`):typeof o=="symbol"?e.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?e.push(`[${JSON.stringify(o)}]`):(e.length&&e.push("."),e.push(o));return e.join("")}function Hw(r){let e=[],t=[...r.issues].sort((o,i)=>(o.path??[]).length-(i.path??[]).length);for(let o of t)e.push(`\u2716 ${o.message}`),o.path?.length&&e.push(` \u2192 at ${$E(o.path)}`);return e.join(`
|
|
4
|
+
`)}var Sc=r=>(e,t,o,i)=>{let n=o?Object.assign(o,{async:!1}):{async:!1},s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise)throw new no;if(s.issues.length){let a=new(i?.Err??r)(s.issues.map(l=>Cr(l,n,bt())));throw _v(a,i?.callee),a}return s.value},Pv=Sc(Tr),Ec=r=>async(e,t,o,i)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??r)(s.issues.map(l=>Cr(l,n,bt())));throw _v(a,i?.callee),a}return s.value},Sv=Ec(Tr),Bc=r=>(e,t,o)=>{let i=o?{...o,async:!1}:{async:!1},n=e._zod.run({value:t,issues:[]},i);if(n instanceof Promise)throw new no;return n.issues.length?{success:!1,error:new(r??Fh)(n.issues.map(s=>Cr(s,i,bt())))}:{success:!0,data:n.value}},Jw=Bc(Tr),Fc=r=>async(e,t,o)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},n=e._zod.run({value:t,issues:[]},i);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new r(n.issues.map(s=>Cr(s,i,bt())))}:{success:!0,data:n.value}},Qw=Fc(Tr),Ev=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Sc(r)(e,t,i)},kI=Ev(Tr),Bv=r=>(e,t,o)=>Sc(r)(e,t,o),$I=Bv(Tr),Fv=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ec(r)(e,t,i)},DI=Fv(Tr),Nv=r=>async(e,t,o)=>Ec(r)(e,t,o),MI=Nv(Tr),Iv=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Bc(r)(e,t,i)},CI=Iv(Tr),kv=r=>(e,t,o)=>Bc(r)(e,t,o),TI=kv(Tr),$v=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Fc(r)(e,t,i)},RI=$v(Tr),Dv=r=>async(e,t,o)=>Fc(r)(e,t,o),OI=Dv(Tr);var Di={};qo(Di,{base64:()=>h0,base64url:()=>Mv,bigint:()=>x0,boolean:()=>A0,browserEmail:()=>ZI,cidrv4:()=>d0,cidrv6:()=>p0,cuid:()=>Xw,cuid2:()=>Yw,date:()=>m0,datetime:()=>v0,domain:()=>HI,duration:()=>o0,e164:()=>f0,email:()=>s0,emoji:()=>a0,extendedDuration:()=>VI,guid:()=>n0,hex:()=>JI,hostname:()=>qI,html5Email:()=>LI,idnEmail:()=>WI,integer:()=>b0,ipv4:()=>l0,ipv6:()=>u0,ksuid:()=>r0,lowercase:()=>S0,mac:()=>c0,md5_base64:()=>XI,md5_base64url:()=>YI,md5_hex:()=>QI,nanoid:()=>i0,null:()=>_0,number:()=>w0,rfc5322Email:()=>KI,sha1_base64:()=>tk,sha1_base64url:()=>rk,sha1_hex:()=>ek,sha256_base64:()=>ok,sha256_base64url:()=>nk,sha256_hex:()=>ik,sha384_base64:()=>ak,sha384_base64url:()=>lk,sha384_hex:()=>sk,sha512_base64:()=>ck,sha512_base64url:()=>dk,sha512_hex:()=>uk,string:()=>y0,time:()=>g0,ulid:()=>e0,undefined:()=>P0,unicodeEmail:()=>DE,uppercase:()=>E0,uuid:()=>ol,uuid4:()=>zI,uuid6:()=>UI,uuid7:()=>jI,xid:()=>t0});var Xw=/^[cC][^\s-]{8,}$/,Yw=/^[0-9a-z]+$/,e0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t0=/^[0-9a-vA-V]{20}$/,r0=/^[A-Za-z0-9]{27}$/,i0=/^[a-zA-Z0-9_-]{21}$/,o0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VI=/^[-+]?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)?)??$/,n0=/^([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})$/,ol=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)$/,zI=ol(4),UI=ol(6),jI=ol(7),s0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LI=/^[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])?)*$/,KI=/^(([^<>()\[\]\\.,;:\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,}))$/,DE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,WI=DE,ZI=/^[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])?)*$/,GI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function a0(){return new RegExp(GI,"u")}var l0=/^(?:(?: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])$/,u0=/^(([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}|:))$/,c0=r=>{let e=$i(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},d0=/^((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])$/,p0=/^(([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])$/,h0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mv=/^[A-Za-z0-9_-]*$/,qI=/^(?=.{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])?)*\.?$/,HI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,f0=/^\+(?:[0-9]){6,14}[0-9]$/,ME="(?:(?:\\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])))",m0=new RegExp(`^${ME}$`);function CE(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 g0(r){return new RegExp(`^${CE(r)}$`)}function v0(r){let e=CE({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${t.join("|")})`;return new RegExp(`^${ME}T(?:${o})$`)}var y0=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},x0=/^-?\d+n?$/,b0=/^-?\d+$/,w0=/^-?\d+(?:\.\d+)?/,A0=/^(?:true|false)$/i,_0=/^null$/i;var P0=/^undefined$/i;var S0=/^[^A-Z]*$/,E0=/^[^a-z]*$/,JI=/^[0-9a-fA-F]*$/;function kh(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function $h(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var QI=/^[0-9a-fA-F]{32}$/,XI=kh(22,"=="),YI=$h(22),ek=/^[0-9a-fA-F]{40}$/,tk=kh(27,"="),rk=$h(27),ik=/^[0-9a-fA-F]{64}$/,ok=kh(43,"="),nk=$h(43),sk=/^[0-9a-fA-F]{96}$/,ak=kh(64,""),lk=$h(64),uk=/^[0-9a-fA-F]{128}$/,ck=kh(86,"=="),dk=$h(86);var Xe=w("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),RE={number:"number",bigint:"bigint",object:"date"},Cv=w("$ZodCheckLessThan",(r,e)=>{Xe.init(r,e);let t=RE[typeof e.value];r._zod.onattach.push(o=>{let i=o._zod.bag,n=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<n&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:t,code:"too_big",maximum:e.value,input:o.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Tv=w("$ZodCheckGreaterThan",(r,e)=>{Xe.init(r,e);let t=RE[typeof e.value];r._zod.onattach.push(o=>{let i=o._zod.bag,n=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>n&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:t,code:"too_small",minimum:e.value,input:o.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),B0=w("$ZodCheckMultipleOf",(r,e)=>{Xe.init(r,e),r._zod.onattach.push(t=>{var o;(o=t._zod.bag).multipleOf??(o.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):zw(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})}}),F0=w("$ZodCheckNumberFormat",(r,e)=>{Xe.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),o=t?"int":"number",[i,n]=Zw[e.format];r._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=n,t&&(a.pattern=b0)}),r._zod.check=s=>{let a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:a,inst:r});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!e.abort}),a>n&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:n,inst:r})}}),N0=w("$ZodCheckBigIntFormat",(r,e)=>{Xe.init(r,e);let[t,o]=Gw[e.format];r._zod.onattach.push(i=>{let n=i._zod.bag;n.format=e.format,n.minimum=t,n.maximum=o}),r._zod.check=i=>{let n=i.value;n<t&&i.issues.push({origin:"bigint",input:n,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),n>o&&i.issues.push({origin:"bigint",input:n,code:"too_big",maximum:o,inst:r})}}),I0=w("$ZodCheckMaxSize",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(o._zod.bag.maximum=e.maximum)}),r._zod.check=o=>{let i=o.value;i.size<=e.maximum||o.issues.push({origin:Eh(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),k0=w("$ZodCheckMinSize",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(o._zod.bag.minimum=e.minimum)}),r._zod.check=o=>{let i=o.value;i.size>=e.minimum||o.issues.push({origin:Eh(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),$0=w("$ZodCheckSizeEquals",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=o=>{let i=o.value,n=i.size;if(n===e.size)return;let s=n>e.size;o.issues.push({origin:Eh(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!e.abort})}}),D0=w("$ZodCheckMaxLength",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(o._zod.bag.maximum=e.maximum)}),r._zod.check=o=>{let i=o.value;if(i.length<=e.maximum)return;let s=Bh(i);o.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),M0=w("$ZodCheckMinLength",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(o._zod.bag.minimum=e.minimum)}),r._zod.check=o=>{let i=o.value;if(i.length>=e.minimum)return;let s=Bh(i);o.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),C0=w("$ZodCheckLengthEquals",(r,e)=>{var t;Xe.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Fs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=o=>{let i=o.value,n=i.length;if(n===e.length)return;let s=Bh(i),a=n>e.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!e.abort})}}),Nc=w("$ZodCheckStringFormat",(r,e)=>{var t,o;Xe.init(r,e),r._zod.onattach.push(i=>{let n=i._zod.bag;n.format=e.format,e.pattern&&(n.patterns??(n.patterns=new Set),n.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})}):(o=r._zod).check??(o.check=()=>{})}),T0=w("$ZodCheckRegex",(r,e)=>{Nc.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})}}),R0=w("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=S0),Nc.init(r,e)}),O0=w("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=E0),Nc.init(r,e)}),V0=w("$ZodCheckIncludes",(r,e)=>{Xe.init(r,e);let t=$i(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=o,r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),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})}}),z0=w("$ZodCheckStartsWith",(r,e)=>{Xe.init(r,e);let t=new RegExp(`^${$i(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:r,continue:!e.abort})}}),U0=w("$ZodCheckEndsWith",(r,e)=>{Xe.init(r,e);let t=new RegExp(`.*${$i(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:r,continue:!e.abort})}});function TE(r,e,t){r.issues.length&&e.issues.push(...ei(t,r.issues))}var j0=w("$ZodCheckProperty",(r,e)=>{Xe.init(r,e),r._zod.check=t=>{let o=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(o instanceof Promise)return o.then(i=>TE(i,t,e.property));TE(o,t,e.property)}}),L0=w("$ZodCheckMimeType",(r,e)=>{Xe.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(o=>{o._zod.bag.mime=e.mime}),r._zod.check=o=>{t.has(o.value.type)||o.issues.push({code:"invalid_value",values:e.mime,input:o.value.type,inst:r,continue:!e.abort})}}),K0=w("$ZodCheckOverwrite",(r,e)=>{Xe.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var Dh=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 o=e.split(`
|
|
5
|
+
`).filter(s=>s),i=Math.min(...o.map(s=>s.length-s.trimStart().length)),n=o.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map(n=>` ${n}`)];return new e(...t,i.join(`
|
|
6
|
+
`))}};var W0={major:4,minor:2,patch:1};var me=w("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=W0;let o=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&o.unshift(r);for(let i of o)for(let n of i._zod.onattach)n(r);if(o.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(s,a,l)=>{let c=$s(s),d;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(c)continue;let f=s.issues.length,g=p._zod.check(s);if(g instanceof Promise&&l?.async===!1)throw new no;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,s.issues.length!==f&&(c||(c=$s(s,f)))});else{if(s.issues.length===f)continue;c||(c=$s(s,f))}}return d?d.then(()=>s):s},n=(s,a,l)=>{if($s(s))return s.aborted=!0,s;let c=i(a,o,l);if(c instanceof Promise){if(l.async===!1)throw new no;return c.then(d=>r._zod.parse(d,l))}return r._zod.parse(c,l)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){let c=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>n(d,s,a)):n(c,s,a)}let l=r._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new no;return l.then(c=>i(c,o,a))}return i(l,o,a)}}r["~standard"]={validate:i=>{try{let n=Jw(r,i);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Qw(r,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),nl=w("$ZodString",(r,e)=>{me.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??y0(r._zod.bag),r._zod.parse=(t,o)=>{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}}),Ge=w("$ZodStringFormat",(r,e)=>{Nc.init(r,e),nl.init(r,e)}),G0=w("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=n0),Ge.init(r,e)}),q0=w("$ZodUUID",(r,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ol(o))}else e.pattern??(e.pattern=ol());Ge.init(r,e)}),H0=w("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=s0),Ge.init(r,e)}),J0=w("$ZodURL",(r,e)=>{Ge.init(r,e),r._zod.check=t=>{try{let o=t.value.trim(),i=new URL(o);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=o;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Q0=w("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=a0()),Ge.init(r,e)}),X0=w("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=i0),Ge.init(r,e)}),Y0=w("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Xw),Ge.init(r,e)}),eA=w("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=Yw),Ge.init(r,e)}),tA=w("$ZodULID",(r,e)=>{e.pattern??(e.pattern=e0),Ge.init(r,e)}),rA=w("$ZodXID",(r,e)=>{e.pattern??(e.pattern=t0),Ge.init(r,e)}),iA=w("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=r0),Ge.init(r,e)}),oA=w("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=v0(e)),Ge.init(r,e)}),nA=w("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=m0),Ge.init(r,e)}),sA=w("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=g0(e)),Ge.init(r,e)}),aA=w("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=o0),Ge.init(r,e)}),lA=w("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=l0),Ge.init(r,e),r._zod.bag.format="ipv4"}),uA=w("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=u0),Ge.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})}}}),cA=w("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=c0(e.delimiter)),Ge.init(r,e),r._zod.bag.format="mac"}),dA=w("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=d0),Ge.init(r,e)}),pA=w("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=p0),Ge.init(r,e),r._zod.check=t=>{let o=t.value.split("/");try{if(o.length!==2)throw new Error;let[i,n]=o;if(!n)throw new Error;let s=Number(n);if(`${s}`!==n)throw new Error;if(s<0||s>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 hA(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var fA=w("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=h0),Ge.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{hA(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function JE(r){if(!Mv.test(r))return!1;let e=r.replace(/[-_]/g,o=>o==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return hA(t)}var mA=w("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Mv),Ge.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{JE(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),gA=w("$ZodE164",(r,e)=>{e.pattern??(e.pattern=f0),Ge.init(r,e)});function QE(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[o]=t;if(!o)return!1;let i=JSON.parse(atob(o));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var vA=w("$ZodJWT",(r,e)=>{Ge.init(r,e),r._zod.check=t=>{QE(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),yA=w("$ZodCustomStringFormat",(r,e)=>{Ge.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})}}),jv=w("$ZodNumber",(r,e)=>{me.init(r,e),r._zod.pattern=r._zod.bag.pattern??w0,r._zod.parse=(t,o)=>{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 n=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,...n?{received:n}:{}}),t}}),xA=w("$ZodNumberFormat",(r,e)=>{F0.init(r,e),jv.init(r,e)}),Mh=w("$ZodBoolean",(r,e)=>{me.init(r,e),r._zod.pattern=A0,r._zod.parse=(t,o)=>{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}}),Lv=w("$ZodBigInt",(r,e)=>{me.init(r,e),r._zod.pattern=x0,r._zod.parse=(t,o)=>{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}}),bA=w("$ZodBigIntFormat",(r,e)=>{N0.init(r,e),Lv.init(r,e)}),wA=w("$ZodSymbol",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),AA=w("$ZodUndefined",(r,e)=>{me.init(r,e),r._zod.pattern=P0,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,o)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),_A=w("$ZodNull",(r,e)=>{me.init(r,e),r._zod.pattern=_0,r._zod.values=new Set([null]),r._zod.parse=(t,o)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),PA=w("$ZodAny",(r,e)=>{me.init(r,e),r._zod.parse=t=>t}),SA=w("$ZodUnknown",(r,e)=>{me.init(r,e),r._zod.parse=t=>t}),EA=w("$ZodNever",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),BA=w("$ZodVoid",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),FA=w("$ZodDate",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,n=i instanceof Date;return n&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...n?{received:"Invalid Date"}:{},inst:r}),t}});function VE(r,e,t){r.issues.length&&e.issues.push(...ei(t,r.issues)),e.value[t]=r.value}var NA=w("$ZodArray",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{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 n=[];for(let s=0;s<i.length;s++){let a=i[s],l=e.element._zod.run({value:a,issues:[]},o);l instanceof Promise?n.push(l.then(c=>VE(c,t,s))):VE(l,t,s)}return n.length?Promise.all(n).then(()=>t):t}});function Uv(r,e,t,o){r.issues.length&&e.issues.push(...ei(t,r.issues)),r.value===void 0?t in o&&(e.value[t]=void 0):e.value[t]=r.value}function XE(r){let e=Object.keys(r.shape);for(let o of e)if(!r.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let t=Ww(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function YE(r,e,t,o,i,n){let s=[],a=i.keySet,l=i.catchall._zod,c=l.def.type;for(let d in e){if(a.has(d))continue;if(c==="never"){s.push(d);continue}let p=l.run({value:e[d],issues:[]},o);p instanceof Promise?r.push(p.then(f=>Uv(f,t,d,e))):Uv(p,t,d,e)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:n}),r.length?Promise.all(r).then(()=>t):t}var eB=w("$ZodObject",(r,e)=>{if(me.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}let o=_c(()=>XE(e));$e(r._zod,"propValues",()=>{let a=e.shape,l={};for(let c in a){let d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(let p of d.values)l[c].add(p)}}return l});let i=il,n=e.catchall,s;r._zod.parse=(a,l)=>{s??(s=o.value);let c=a.value;if(!i(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:r}),a;a.value={};let d=[],p=s.shape;for(let f of s.keys){let v=p[f]._zod.run({value:c[f],issues:[]},l);v instanceof Promise?d.push(v.then(x=>Uv(x,a,f,c))):Uv(v,a,f,c)}return n?YE(d,c,a,l,o.value,r):d.length?Promise.all(d).then(()=>a):a}}),IA=w("$ZodObjectJIT",(r,e)=>{eB.init(r,e);let t=r._zod.parse,o=_c(()=>XE(e)),i=f=>{let g=new Dh(["shape","payload","ctx"]),v=o.value,x=L=>{let R=Av(L);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};g.write("const input = payload.value;");let y=Object.create(null),M=0;for(let L of v.keys)y[L]=`key_${M++}`;g.write("const newResult = {};");for(let L of v.keys){let R=y[L],z=Av(L);g.write(`const ${R} = ${x(L)};`),g.write(`
|
|
7
|
+
if (${R}.issues.length) {
|
|
8
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
9
9
|
...iss,
|
|
10
|
-
path: iss.path ? [${
|
|
10
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
11
11
|
})));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
if (${
|
|
16
|
-
if (${
|
|
17
|
-
newResult[${
|
|
15
|
+
if (${R}.value === undefined) {
|
|
16
|
+
if (${z} in input) {
|
|
17
|
+
newResult[${z}] = undefined;
|
|
18
18
|
}
|
|
19
19
|
} else {
|
|
20
|
-
newResult[${
|
|
20
|
+
newResult[${z}] = ${R}.value;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");let M=v.compile();return(O,T)=>M(f,O,T)},o,a=Zs,s=!Zp.jitless,c=s&&Zw.value,p=e.catchall,d;r._zod.parse=(f,v)=>{d??(d=i.value);let m=f.value;return a(m)?s&&c&&v?.async===!1&&v.jitless!==!0?(o||(o=n(e.shape)),f=o(f,v),p?cS([],m,f,v,d,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),f)}});function Y1(r,e,t,i){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let n=r.filter(o=>!Fa(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>Hr(a,i,bt())))}),e)}var Av=A("$ZodUnion",(r,e)=>{he.init(r,e),$e(r._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),$e(r._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),$e(r._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),$e(r._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Hp(o.source)).join("|")})$`)}});let t=e.options.length===1,i=e.options[0]._zod.run;r._zod.parse=(n,o)=>{if(t)return i(n,o);let a=!1,s=[];for(let l of e.options){let c=l._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>Y1(l,n,r,o)):Y1(s,n,r,o)}}),C0=A("$ZodDiscriminatedUnion",(r,e)=>{Av.init(r,e);let t=r._zod.parse;$e(r._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let c of l)n[s].add(c)}}return n});let i=cc(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});r._zod.parse=(n,o)=>{let a=n.value;if(!Zs(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?t(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),n)}}),T0=A("$ZodIntersection",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,c])=>X1(t,l,c)):X1(t,o,a)}});function Jb(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(Ba(r)&&Ba(e)){let t=Object.keys(e),i=Object.keys(r).filter(o=>t.indexOf(o)!==-1),n={...r,...e};for(let o of i){let a=Jb(r[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let i=0;i<r.length;i++){let n=r[i],o=e[i],a=Jb(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function X1(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Fa(r))return r;let i=Jb(e.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return r.value=i.data,r}var _v=A("$ZodTuple",(r,e)=>{he.init(r,e);let t=e.items;r._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...t].reverse().findIndex(p=>p._zod.optin!=="optional"),l=s===-1?0:t.length-s;if(!e.rest){let p=o.length>t.length,d=o.length<l-1;if(p||d)return i.issues.push({...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:o,inst:r,origin:"array"}),i}let c=-1;for(let p of t){if(c++,c>=o.length&&c>=l)continue;let d=p._zod.run({value:o[c],issues:[]},n);d instanceof Promise?a.push(d.then(f=>mv(f,i,c))):mv(d,i,c)}if(e.rest){let p=o.slice(t.length);for(let d of p){c++;let f=e.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(v=>mv(v,i,c))):mv(f,i,c)}}return a.length?Promise.all(a).then(()=>i):i}});function mv(r,e,t){r.issues.length&&e.issues.push(...qr(t,r.issues)),e.value[t]=r.value}var R0=A("$ZodRecord",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!Ba(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);let p=e.valueType._zod.run({value:n[c],issues:[]},i);p instanceof Promise?o.push(p.then(d=>{d.issues.length&&t.issues.push(...qr(c,d.issues)),t.value[c]=d.value})):(p.issues.length&&t.issues.push(...qr(c,p.issues)),t.value[c]=p.value)}let l;for(let c in n)s.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:r,keys:l})}else{t.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let l=e.keyType._zod.run({value:s,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Hr(p,i,bt())),input:s,path:[s],inst:r}),t.value[l.value]=l.value;continue}let c=e.valueType._zod.run({value:n[s],issues:[]},i);c instanceof Promise?o.push(c.then(p=>{p.issues.length&&t.issues.push(...qr(s,p.issues)),t.value[l.value]=p.value})):(c.issues.length&&t.issues.push(...qr(s,c.issues)),t.value[l.value]=c.value)}}return o.length?Promise.all(o).then(()=>t):t}}),O0=A("$ZodMap",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:r}),t;let o=[];t.value=new Map;for(let[a,s]of n){let l=e.keyType._zod.run({value:a,issues:[]},i),c=e.valueType._zod.run({value:s,issues:[]},i);l instanceof Promise||c instanceof Promise?o.push(Promise.all([l,c]).then(([p,d])=>{eS(p,d,t,a,n,r,i)})):eS(l,c,t,a,n,r,i)}return o.length?Promise.all(o).then(()=>t):t}});function eS(r,e,t,i,n,o,a){r.issues.length&&(Jp.has(typeof i)?t.issues.push(...qr(i,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:r.issues.map(s=>Hr(s,a,bt()))})),e.issues.length&&(Jp.has(typeof i)?t.issues.push(...qr(i,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>Hr(s,a,bt()))})),t.value.set(r.value,e.value)}var V0=A("$ZodSet",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(l=>tS(l,t))):tS(s,t)}return o.length?Promise.all(o).then(()=>t):t}});function tS(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var z0=A("$ZodEnum",(r,e)=>{he.init(r,e);let t=qp(e.entries),i=new Set(t);r._zod.values=i,r._zod.pattern=new RegExp(`^(${t.filter(n=>Jp.has(typeof n)).map(n=>typeof n=="string"?Fi(n):n.toString()).join("|")})$`),r._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:t,input:a,inst:r}),n}}),U0=A("$ZodLiteral",(r,e)=>{if(he.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Fi(i):i?Fi(i.toString()):String(i)).join("|")})$`),r._zod.parse=(i,n)=>{let o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),i}}),j0=A("$ZodFile",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:r}),t}}),L0=A("$ZodTransform",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new _a(r.constructor.name);let n=e.transform(t.value,t);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(t.value=a,t));if(n instanceof Promise)throw new rn;return t.value=n,t}});function rS(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var K0=A("$ZodOptional",(r,e)=>{he.init(r,e),r._zod.optin="optional",r._zod.optout="optional",$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Hp(t.source)})?$`):void 0}),r._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>rS(o,t.value)):rS(n,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),W0=A("$ZodNullable",(r,e)=>{he.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Hp(t.source)}|null)$`):void 0}),$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),Z0=A("$ZodDefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>iS(o,e)):iS(n,e)}});function iS(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var G0=A("$ZodPrefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),q0=A("$ZodNonOptional",(r,e)=>{he.init(r,e),$e(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),r._zod.parse=(t,i)=>{let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>nS(o,r)):nS(n,r)}});function nS(r,e){return!r.issues.length&&r.value===void 0&&r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:e}),r}var H0=A("$ZodSuccess",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new _a("ZodSuccess");let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.issues.length===0,t)):(t.value=n.issues.length===0,t)}}),J0=A("$ZodCatch",(r,e)=>{he.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>Hr(a,i,bt()))},input:t.value}),t.issues=[]),t)):(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(o=>Hr(o,i,bt()))},input:t.value}),t.issues=[]),t)}}),Q0=A("$ZodNaN",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),Y0=A("$ZodPipe",(r,e)=>{he.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>gv(a,e.in,i)):gv(o,e.in,i)}let n=e.in._zod.run(t,i);return n instanceof Promise?n.then(o=>gv(o,e.out,i)):gv(n,e.out,i)}});function gv(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var ah=A("$ZodCodec",(r,e)=>{he.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(t,i);return o instanceof Promise?o.then(a=>vv(a,e,i)):vv(o,e,i)}else{let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>vv(a,e,i)):vv(o,e,i)}}});function vv(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>yv(r,o,e.out,t)):yv(r,n,e.out,t)}else{let n=e.reverseTransform(r.value,r);return n instanceof Promise?n.then(o=>yv(r,o,e.in,t)):yv(r,n,e.in,t)}}function yv(r,e,t,i){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},i)}var X0=A("$ZodReadonly",(r,e)=>{he.init(r,e),$e(r._zod,"propValues",()=>e.innerType._zod.propValues),$e(r._zod,"values",()=>e.innerType._zod.values),$e(r._zod,"optin",()=>e.innerType?._zod?.optin),$e(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(oS):oS(n)}});function oS(r){return r.value=Object.freeze(r.value),r}var eA=A("$ZodTemplateLiteral",(r,e)=>{he.init(r,e);let t=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;t.push(n.slice(o,a))}else if(i===null||qw.has(typeof i))t.push(Fi(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:r,expected:"template_literal",code:"invalid_type"}),i):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),i)}),tA=A("$ZodFunction",(r,e)=>(he.init(r,e),r._def=e,r._zod.def=e,r.implement=t=>{if(typeof t!="function")throw new Error("implement() must be called with a function");return function(...i){let n=r._def.input?rv(r._def.input,i):i,o=Reflect.apply(t,this,n);return r._def.output?rv(r._def.output,o):o}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=r._def.input?await iv(r._def.input,i):i,o=await Reflect.apply(t,this,n);return r._def.output?await iv(r._def.output,o):o}},r._zod.parse=(t,i)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:r}),t):(r._def.output&&r._def.output._zod.def.type==="promise"?t.value=r.implementAsync(t.value):t.value=r.implement(t.value),t),r.input=(...t)=>{let i=r.constructor;return Array.isArray(t[0])?new i({type:"function",input:new _v({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new i({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let i=r.constructor;return new i({type:"function",input:r._def.input,output:t})},r)),rA=A("$ZodPromise",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>Promise.resolve(t.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),iA=A("$ZodLazy",(r,e)=>{he.init(r,e),$e(r._zod,"innerType",()=>e.getter()),$e(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),$e(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),$e(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),$e(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(t,i)=>r._zod.innerType._zod.run(t,i)}),nA=A("$ZodCustom",(r,e)=>{He.init(r,e),he.init(r,e),r._zod.parse=(t,i)=>t,r._zod.check=t=>{let i=t.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>aS(o,t,i,r));aS(n,t,i,r)}});function aS(r,e,t,i){if(!r){let n={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(dc(n))}}var uh={};Da(uh,{ar:()=>pS,az:()=>hS,be:()=>mS,bg:()=>gS,ca:()=>vS,cs:()=>yS,da:()=>xS,de:()=>wS,en:()=>Pv,eo:()=>bS,es:()=>AS,fa:()=>_S,fi:()=>PS,fr:()=>SS,frCA:()=>ES,he:()=>BS,hu:()=>FS,id:()=>NS,is:()=>kS,it:()=>$S,ja:()=>MS,ka:()=>DS,kh:()=>IS,km:()=>Sv,ko:()=>CS,lt:()=>RS,mk:()=>OS,ms:()=>VS,nl:()=>zS,no:()=>US,ota:()=>jS,pl:()=>KS,ps:()=>LS,pt:()=>WS,ru:()=>GS,sl:()=>qS,sv:()=>HS,ta:()=>JS,th:()=>QS,tr:()=>YS,ua:()=>XS,uk:()=>Ev,ur:()=>eE,vi:()=>tE,yo:()=>nE,zhCN:()=>rE,zhTW:()=>iE});var QF=()=>{let r={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{switch(n.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${z(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${i[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function pS(){return{localeError:QF()}}var YF=()=>{let r={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function hS(){return{localeError:YF()}}function fS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var XF=()=>{let r={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${z(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=fS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=fS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function mS(){return{localeError:XF()}}var eN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},tN=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return r[i]??null}let t={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${eN(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${n.prefix}"`;if(n.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${n.suffix}"`;if(n.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${n.includes}"`;if(n.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${n.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${k(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function gS(){return{localeError:tN()}}var rN=()=>{let r={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function vS(){return{localeError:rN()}}var iN=()=>{let r={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function yS(){return{localeError:iN()}}var nN=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),c=i(a.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${s} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),c=i(a.origin);return l?`For lille: forventede ${c} ${l.verb} ${s} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${o[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function xS(){return{localeError:nN()}}var oN=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function wS(){return{localeError:oN()}}var aN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},sN=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return r[i]??null}let t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${aN(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${z(i.values[0])}`:`Invalid option: expected one of ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${t[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Pv(){return{localeError:sN()}}var lN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"nombro";case"object":{if(Array.isArray(r))return"tabelo";if(r===null)return"senvalora";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},uN=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return r[i]??null}let t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${lN(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${t[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function bS(){return{localeError:uN()}}var cN=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return s},o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${i(a.expected)}, recibido ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),c=i(a.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${s}${a.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),c=i(a.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${s}${a.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${o[s.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${k(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function AS(){return{localeError:cN()}}var dN=()=>{let r={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${k(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function _S(){return{localeError:dN()}}var pN=()=>{let r={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function PS(){return{localeError:pN()}}var hN=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${t(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${k(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function SS(){return{localeError:hN()}}var fN=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function ES(){return{localeError:fN()}}var mN=()=>{let r={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},t=c=>c?r[c]:void 0,i=c=>{let p=t(c);return p?p.label:c??r.unknown.label},n=c=>`\u05D4${i(c)}`,o=c=>(t(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=c=>c?e[c]??null:null,s=c=>{let p=typeof c;switch(p){case"number":return Number.isNaN(c)?"NaN":"number";case"object":return Array.isArray(c)?"array":c===null?"null":Object.getPrototypeOf(c)!==Object.prototype&&c.constructor?c.constructor.name:"object";default:return p}},l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,d=i(p),f=s(c.input),v=r[f]?.label??f;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${z(c.values[0])}`;let p=c.values.map(v=>z(v));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?"<=":"<",v=o(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?">=":">",v=o(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let d=l[p.format],f=d?.label??p.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${k(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function BS(){return{localeError:mN()}}var gN=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function FS(){return{localeError:gN()}}var vN=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function NS(){return{localeError:vN()}}var yN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(r))return"fylki";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},xN=()=>{let r={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return r[i]??null}let t={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${yN(i.input)} \xFEar sem \xE1 a\xF0 vera ${i.expected}`;case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${z(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${t[n.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${k(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function kS(){return{localeError:xN()}}var wN=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${z(n.values[0])}`:`Opzione non valida: atteso uno tra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${k(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function $S(){return{localeError:wN()}}var bN=()=>{let r={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function MS(){return{localeError:bN()}}var AN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(r))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[e]??e},_N=()=>{let r={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return r[i]??null}let t={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return i=>{switch(i.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${AN(i.input)}`;case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${z(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${k(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[n.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${k(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function DS(){return{localeError:_N()}}var PN=()=>{let r={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{switch(n.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${z(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Sv(){return{localeError:PN()}}function IS(){return Sv()}var SN=()=>{let r={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function CS(){return{localeError:SN()}}var EN=r=>lh(typeof r,r),lh=(r,e=void 0)=>{switch(r){case"number":return Number.isNaN(e)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return e===void 0?"ne\u017Einomas objektas":e===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(e)?"masyvas":Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return r},sh=r=>r.charAt(0).toUpperCase()+r.slice(1);function TS(r){let e=Math.abs(r),t=e%10,i=e%100;return i>=11&&i<=19||t===0?"many":t===1?"one":"few"}var BN=()=>{let r={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,n,o,a){let s=r[i]??null;return s===null?s:{unit:s.unit[n],verb:s.verb[a][o?"inclusive":"notInclusive"]}}let t={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return i=>{switch(i.code){case"invalid_type":return`Gautas tipas ${EN(i.input)}, o tik\u0117tasi - ${lh(i.expected)}`;case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${z(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(i.values,"|")} pasirinkim\u0173`;case"too_big":{let n=lh(i.origin),o=e(i.origin,TS(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${sh(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${sh(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let n=lh(i.origin),o=e(i.origin,TS(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${sh(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${sh(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${t[n.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${k(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=lh(i.origin);return`${sh(n??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function RS(){return{localeError:BN()}}var FN=()=>{let r={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function OS(){return{localeError:FN()}}var NN=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function VS(){return{localeError:NN()}}var kN=()=>{let r={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Te groot: verwacht dat ${n.origin??"waarde"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Te klein: verwacht dat ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Te klein: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function zS(){return{localeError:kN()}}var $N=()=>{let r={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${z(n.values[0])}`:`Ugyldig valg: forventet en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function US(){return{localeError:$N()}}var MN=()=>{let r={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function jS(){return{localeError:MN()}}var DN=()=>{let r={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function LS(){return{localeError:DN()}}var IN=()=>{let r={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function KS(){return{localeError:IN()}}var CN=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function WS(){return{localeError:CN()}}function ZS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var TN=()=>{let r={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${z(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=ZS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=ZS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function GS(){return{localeError:TN()}}var RN=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function qS(){return{localeError:RN()}}var ON=()=>{let r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function HS(){return{localeError:ON()}}var VN=()=>{let r={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function JS(){return{localeError:VN()}}var zN=()=>{let r={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{switch(n.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${k(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function QS(){return{localeError:zN()}}var UN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},jN=()=>{let r={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return r[i]??null}let t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${UN(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[n.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function YS(){return{localeError:jN()}}var LN=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${z(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Ev(){return{localeError:LN()}}function XS(){return Ev()}var KN=()=>{let r={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function eE(){return{localeError:KN()}}var WN=()=>{let r={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function tE(){return{localeError:WN()}}var ZN=()=>{let r={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function rE(){return{localeError:ZN()}}var GN=()=>{let r={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function iE(){return{localeError:GN()}}var qN=()=>{let r={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return n=>{switch(n.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${i[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function nE(){return{localeError:qN()}}var oE,oA=Symbol("ZodOutput"),aA=Symbol("ZodInput"),vc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let i=t[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let i={...this.get(t)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Bv(){return new vc}(oE=globalThis).__zod_globalRegistry??(oE.__zod_globalRegistry=Bv());var gr=globalThis.__zod_globalRegistry;function sA(r,e){return new r({type:"string",...j(e)})}function lA(r,e){return new r({type:"string",coerce:!0,...j(e)})}function Fv(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...j(e)})}function ch(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...j(e)})}function Nv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...j(e)})}function kv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(e)})}function $v(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(e)})}function Mv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(e)})}function dh(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...j(e)})}function Dv(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...j(e)})}function Iv(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(e)})}function Cv(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...j(e)})}function Tv(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(e)})}function Rv(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...j(e)})}function Ov(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...j(e)})}function Vv(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(e)})}function zv(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(e)})}function Uv(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(e)})}function uA(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...j(e)})}function jv(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(e)})}function Lv(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(e)})}function Kv(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...j(e)})}function Wv(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...j(e)})}function Zv(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...j(e)})}function Gv(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...j(e)})}var cA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function dA(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(e)})}function pA(r,e){return new r({type:"string",format:"date",check:"string_format",...j(e)})}function hA(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...j(e)})}function fA(r,e){return new r({type:"string",format:"duration",check:"string_format",...j(e)})}function mA(r,e){return new r({type:"number",checks:[],...j(e)})}function gA(r,e){return new r({type:"number",coerce:!0,checks:[],...j(e)})}function vA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...j(e)})}function yA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...j(e)})}function xA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...j(e)})}function wA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...j(e)})}function bA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...j(e)})}function AA(r,e){return new r({type:"boolean",...j(e)})}function _A(r,e){return new r({type:"boolean",coerce:!0,...j(e)})}function PA(r,e){return new r({type:"bigint",...j(e)})}function SA(r,e){return new r({type:"bigint",coerce:!0,...j(e)})}function EA(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(e)})}function BA(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(e)})}function FA(r,e){return new r({type:"symbol",...j(e)})}function NA(r,e){return new r({type:"undefined",...j(e)})}function kA(r,e){return new r({type:"null",...j(e)})}function $A(r){return new r({type:"any"})}function MA(r){return new r({type:"unknown"})}function DA(r,e){return new r({type:"never",...j(e)})}function IA(r,e){return new r({type:"void",...j(e)})}function CA(r,e){return new r({type:"date",...j(e)})}function TA(r,e){return new r({type:"date",coerce:!0,...j(e)})}function RA(r,e){return new r({type:"nan",...j(e)})}function yo(r,e){return new hv({check:"less_than",...j(e),value:r,inclusive:!1})}function ki(r,e){return new hv({check:"less_than",...j(e),value:r,inclusive:!0})}function xo(r,e){return new fv({check:"greater_than",...j(e),value:r,inclusive:!1})}function kr(r,e){return new fv({check:"greater_than",...j(e),value:r,inclusive:!0})}function OA(r){return xo(0,r)}function VA(r){return yo(0,r)}function zA(r){return ki(0,r)}function UA(r){return kr(0,r)}function Hs(r,e){return new $b({check:"multiple_of",...j(e),value:r})}function yc(r,e){return new Ib({check:"max_size",...j(e),maximum:r})}function Js(r,e){return new Cb({check:"min_size",...j(e),minimum:r})}function ph(r,e){return new Tb({check:"size_equals",...j(e),size:r})}function xc(r,e){return new Rb({check:"max_length",...j(e),maximum:r})}function Na(r,e){return new Ob({check:"min_length",...j(e),minimum:r})}function wc(r,e){return new Vb({check:"length_equals",...j(e),length:r})}function hh(r,e){return new zb({check:"string_format",format:"regex",...j(e),pattern:r})}function fh(r){return new Ub({check:"string_format",format:"lowercase",...j(r)})}function mh(r){return new jb({check:"string_format",format:"uppercase",...j(r)})}function gh(r,e){return new Lb({check:"string_format",format:"includes",...j(e),includes:r})}function vh(r,e){return new Kb({check:"string_format",format:"starts_with",...j(e),prefix:r})}function yh(r,e){return new Wb({check:"string_format",format:"ends_with",...j(e),suffix:r})}function jA(r,e,t){return new Zb({check:"property",property:r,schema:e,...j(t)})}function xh(r,e){return new Gb({check:"mime_type",mime:r,...j(e)})}function On(r){return new qb({check:"overwrite",tx:r})}function wh(r){return On(e=>e.normalize(r))}function bh(){return On(r=>r.trim())}function Ah(){return On(r=>r.toLowerCase())}function _h(){return On(r=>r.toUpperCase())}function Ph(){return On(r=>Ww(r))}function LA(r,e,t){return new r({type:"array",element:e,...j(t)})}function JN(r,e,t){return new r({type:"union",options:e,...j(t)})}function QN(r,e,t,i){return new r({type:"union",options:t,discriminator:e,...j(i)})}function YN(r,e,t){return new r({type:"intersection",left:e,right:t})}function XN(r,e,t,i){let n=t instanceof he,o=n?i:t,a=n?t:null;return new r({type:"tuple",items:e,rest:a,...j(o)})}function ek(r,e,t,i){return new r({type:"record",keyType:e,valueType:t,...j(i)})}function tk(r,e,t,i){return new r({type:"map",keyType:e,valueType:t,...j(i)})}function rk(r,e,t){return new r({type:"set",valueType:e,...j(t)})}function ik(r,e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new r({type:"enum",entries:i,...j(t)})}function nk(r,e,t){return new r({type:"enum",entries:e,...j(t)})}function ok(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...j(t)})}function KA(r,e){return new r({type:"file",...j(e)})}function ak(r,e){return new r({type:"transform",transform:e})}function sk(r,e){return new r({type:"optional",innerType:e})}function lk(r,e){return new r({type:"nullable",innerType:e})}function uk(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Gw(t)}})}function ck(r,e,t){return new r({type:"nonoptional",innerType:e,...j(t)})}function dk(r,e){return new r({type:"success",innerType:e})}function pk(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function hk(r,e,t){return new r({type:"pipe",in:e,out:t})}function fk(r,e){return new r({type:"readonly",innerType:e})}function mk(r,e,t){return new r({type:"template_literal",parts:e,...j(t)})}function gk(r,e){return new r({type:"lazy",getter:e})}function vk(r,e){return new r({type:"promise",innerType:e})}function WA(r,e,t){let i=j(t);return i.abort??(i.abort=!0),new r({type:"custom",check:"custom",fn:e,...i})}function ZA(r,e,t){return new r({type:"custom",check:"custom",fn:e,...j(t)})}function GA(r){let e=aE(t=>(t.addIssue=i=>{if(typeof i=="string")t.issues.push(dc(i,t.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),t.issues.push(dc(n))}},r(t.value,t)));return e}function aE(r,e){let t=new He({check:"custom",...j(e)});return t._zod.check=r,t}function qA(r){let e=new He({check:"describe"});return e._zod.onattach=[t=>{let i=gr.get(t)??{};gr.add(t,{...i,description:r})}],e._zod.check=()=>{},e}function HA(r){let e=new He({check:"meta"});return e._zod.onattach=[t=>{let i=gr.get(t)??{};gr.add(t,{...i,...r})}],e._zod.check=()=>{},e}function JA(r,e){let t=j(e),i=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(i=i.map(v=>typeof v=="string"?v.toLowerCase():v),n=n.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(i),a=new Set(n),s=r.Codec??ah,l=r.Boolean??oh,c=r.String??qs,p=new c({type:"string",error:t.error}),d=new l({type:"boolean",error:t.error}),f=new s({type:"pipe",in:p,out:d,transform:(v,m)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})},reverseTransform:(v,m)=>v===!0?i[0]||"true":n[0]||"false",error:t.error});return f}function bc(r,e,t,i={}){let n=j(i),o={...j(i),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:s=>t.test(s),...n};return t instanceof RegExp&&(o.pattern=t),new r(o)}var Sh=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??gr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{let d={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let v=s.schema;switch(n.type){case"string":{let m=v;m.type="string";let{minimum:y,maximum:x,format:D,patterns:M,contentEncoding:O}=e._zod.bag;if(typeof y=="number"&&(m.minLength=y),typeof x=="number"&&(m.maxLength=x),D&&(m.format=o[D]??D,m.format===""&&delete m.format),O&&(m.contentEncoding=O),M&&M.size>0){let T=[...M];T.length===1?m.pattern=T[0].source:T.length>1&&(s.schema.allOf=[...T.map(V=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:V.source}))])}break}case"number":{let m=v,{minimum:y,maximum:x,format:D,multipleOf:M,exclusiveMaximum:O,exclusiveMinimum:T}=e._zod.bag;typeof D=="string"&&D.includes("int")?m.type="integer":m.type="number",typeof T=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.minimum=T,m.exclusiveMinimum=!0):m.exclusiveMinimum=T),typeof y=="number"&&(m.minimum=y,typeof T=="number"&&this.target!=="draft-4"&&(T>=y?delete m.minimum:delete m.exclusiveMinimum)),typeof O=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.maximum=O,m.exclusiveMaximum=!0):m.exclusiveMaximum=O),typeof x=="number"&&(m.maximum=x,typeof O=="number"&&this.target!=="draft-4"&&(O<=x?delete m.maximum:delete m.exclusiveMaximum)),typeof M=="number"&&(m.multipleOf=M);break}case"boolean":{let m=v;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(v.type="string",v.nullable=!0,v.enum=[null]):v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=v,{minimum:y,maximum:x}=e._zod.bag;typeof y=="number"&&(m.minItems=y),typeof x=="number"&&(m.maxItems=x),m.type="array",m.items=this.process(n.element,{...d,path:[...d.path,"items"]});break}case"object":{let m=v;m.type="object",m.properties={};let y=n.shape;for(let M in y)m.properties[M]=this.process(y[M],{...d,path:[...d.path,"properties",M]});let x=new Set(Object.keys(y)),D=new Set([...x].filter(M=>{let O=n.shape[M]._zod;return this.io==="input"?O.optin===void 0:O.optout===void 0}));D.size>0&&(m.required=Array.from(D)),n.catchall?._zod.def.type==="never"?m.additionalProperties=!1:n.catchall?n.catchall&&(m.additionalProperties=this.process(n.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=v,y=n.discriminator!==void 0,x=n.options.map((D,M)=>this.process(D,{...d,path:[...d.path,y?"oneOf":"anyOf",M]}));y?m.oneOf=x:m.anyOf=x;break}case"intersection":{let m=v,y=this.process(n.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(n.right,{...d,path:[...d.path,"allOf",1]}),D=O=>"allOf"in O&&Object.keys(O).length===1,M=[...D(y)?y.allOf:[y],...D(x)?x.allOf:[x]];m.allOf=M;break}case"tuple":{let m=v;m.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",D=n.items.map((V,Y)=>this.process(V,{...d,path:[...d.path,y,Y]})),M=n.rest?this.process(n.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[n.items.length]:[]]}):null;this.target==="draft-2020-12"?(m.prefixItems=D,M&&(m.items=M)):this.target==="openapi-3.0"?(m.items={anyOf:D},M&&m.items.anyOf.push(M),m.minItems=D.length,M||(m.maxItems=D.length)):(m.items=D,M&&(m.additionalItems=M));let{minimum:O,maximum:T}=e._zod.bag;typeof O=="number"&&(m.minItems=O),typeof T=="number"&&(m.maxItems=T);break}case"record":{let m=v;m.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(m.propertyNames=this.process(n.keyType,{...d,path:[...d.path,"propertyNames"]})),m.additionalProperties=this.process(n.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=v,y=qp(n.entries);y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),m.enum=y;break}case"literal":{let m=v,y=[];for(let x of n.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(x))}else y.push(x);if(y.length!==0)if(y.length===1){let x=y[0];m.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0"?m.enum=[x]:m.const=x}else y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),y.every(x=>typeof x=="boolean")&&(m.type="string"),y.every(x=>x===null)&&(m.type="null"),m.enum=y;break}case"file":{let m=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:D,mime:M}=e._zod.bag;x!==void 0&&(y.minLength=x),D!==void 0&&(y.maxLength=D),M?M.length===1?(y.contentMediaType=M[0],Object.assign(m,y)):m.anyOf=M.map(O=>({...y,contentMediaType:O})):Object.assign(m,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(n.innerType,d);this.target==="openapi-3.0"?(s.ref=n.innerType,v.nullable=!0):v.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"success":{let m=v;m.type="boolean";break}case"default":{this.process(n.innerType,d),s.ref=n.innerType,v.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,d),s.ref=n.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,d),s.ref=n.innerType;let m;try{m=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=y.source;break}case"pipe":{let m=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(m,d),s.ref=m;break}case"readonly":{this.process(n.innerType,d),s.ref=n.innerType,v.readOnly=!0;break}case"promise":{this.process(n.innerType,d),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,d),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),this.io==="input"&&vr(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let i={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=p=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let y=i.external.registry.get(p[0])?.id,x=i.external.uri??(M=>M);if(y)return{ref:x(y)};let D=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=D,{defId:D,ref:`${x("__shared")}#/${d}/${D}`}}if(p[1]===n)return{ref:"#"};let v=`#/${d}/`,m=p[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:v+m}},a=p=>{if(p[1].schema.$ref)return;let d=p[1],{ref:f,defId:v}=o(p);d.def={...d.schema},v&&(d.defId=v);let m=d.schema;for(let y in m)delete m[y];m.$ref=f};if(i.cycles==="throw")for(let p of this.seen.entries()){let d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
23
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");let T=g.compile();return(L,R)=>T(f,L,R)},n,s=il,a=!wh.jitless,c=a&&jw.value,d=e.catchall,p;r._zod.parse=(f,g)=>{p??(p=o.value);let v=f.value;return s(v)?a&&c&&g?.async===!1&&g.jitless!==!0?(n||(n=i(e.shape)),f=n(f,g),d?YE([],v,f,g,p,r):f):t(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:v,inst:r}),f)}});function zE(r,e,t,o){for(let n of r)if(n.issues.length===0)return e.value=n.value,e;let i=r.filter(n=>!$s(n));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(n=>n.issues.map(s=>Cr(s,o,bt())))}),e)}var Ch=w("$ZodUnion",(r,e)=>{me.init(r,e),$e(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),$e(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),$e(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),$e(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>Ph(n.source)).join("|")})$`)}});let t=e.options.length===1,o=e.options[0]._zod.run;r._zod.parse=(i,n)=>{if(t)return o(i,n);let s=!1,a=[];for(let l of e.options){let c=l._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>zE(l,i,r,n)):zE(a,i,r,n)}});function UE(r,e,t,o){let i=r.filter(n=>n.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(n=>n.issues.map(s=>Cr(s,o,bt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:[],inclusive:!1}),e)}var kA=w("$ZodXor",(r,e)=>{Ch.init(r,e),e.inclusive=!1;let t=e.options.length===1,o=e.options[0]._zod.run;r._zod.parse=(i,n)=>{if(t)return o(i,n);let s=!1,a=[];for(let l of e.options){let c=l._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(a.push(c),s=!0):a.push(c)}return s?Promise.all(a).then(l=>UE(l,i,r,n)):UE(a,i,r,n)}}),$A=w("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,Ch.init(r,e);let t=r._zod.parse;$e(r._zod,"propValues",()=>{let i={};for(let n of e.options){let s=n._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let[a,l]of Object.entries(s)){i[a]||(i[a]=new Set);for(let c of l)i[a].add(c)}}return i});let o=_c(()=>{let i=e.options,n=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let l of a){if(n.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);n.set(l,s)}}return n});r._zod.parse=(i,n)=>{let s=i.value;if(!il(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),i;let a=o.value.get(s?.[e.discriminator]);return a?a._zod.run(i,n):e.unionFallback?t(i,n):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),i)}}),DA=w("$ZodIntersection",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value,n=e.left._zod.run({value:i,issues:[]},o),s=e.right._zod.run({value:i,issues:[]},o);return n instanceof Promise||s instanceof Promise?Promise.all([n,s]).then(([l,c])=>jE(t,l,c)):jE(t,n,s)}});function Z0(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(ks(r)&&ks(e)){let t=Object.keys(e),o=Object.keys(r).filter(n=>t.indexOf(n)!==-1),i={...r,...e};for(let n of o){let s=Z0(r[n],e[n]);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};i[n]=s.data}return{valid:!0,data:i}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let o=0;o<r.length;o++){let i=r[o],n=e[o],s=Z0(i,n);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function jE(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),$s(r))return r;let o=Z0(e.value,t.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return r.value=o.data,r}var Kv=w("$ZodTuple",(r,e)=>{me.init(r,e);let t=e.items;r._zod.parse=(o,i)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({input:n,inst:r,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...t].reverse().findIndex(d=>d._zod.optin!=="optional"),l=a===-1?0:t.length-a;if(!e.rest){let d=n.length>t.length,p=n.length<l-1;if(d||p)return o.issues.push({...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:n,inst:r,origin:"array"}),o}let c=-1;for(let d of t){if(c++,c>=n.length&&c>=l)continue;let p=d._zod.run({value:n[c],issues:[]},i);p instanceof Promise?s.push(p.then(f=>Rv(f,o,c))):Rv(p,o,c)}if(e.rest){let d=n.slice(t.length);for(let p of d){c++;let f=e.rest._zod.run({value:p,issues:[]},i);f instanceof Promise?s.push(f.then(g=>Rv(g,o,c))):Rv(f,o,c)}}return s.length?Promise.all(s).then(()=>o):o}});function Rv(r,e,t){r.issues.length&&e.issues.push(...ei(t,r.issues)),e.value[t]=r.value}var MA=w("$ZodRecord",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!ks(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let n=[],s=e.keyType._zod.values;if(s){t.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let d=e.valueType._zod.run({value:i[c],issues:[]},o);d instanceof Promise?n.push(d.then(p=>{p.issues.length&&t.issues.push(...ei(c,p.issues)),t.value[c]=p.value})):(d.issues.length&&t.issues.push(...ei(c,d.issues)),t.value[c]=d.value)}let l;for(let c in i)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:l})}else{t.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?t.value[a]=i[a]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Cr(d,o,bt())),input:a,path:[a],inst:r});continue}let c=e.valueType._zod.run({value:i[a],issues:[]},o);c instanceof Promise?n.push(c.then(d=>{d.issues.length&&t.issues.push(...ei(a,d.issues)),t.value[l.value]=d.value})):(c.issues.length&&t.issues.push(...ei(a,c.issues)),t.value[l.value]=c.value)}}return n.length?Promise.all(n).then(()=>t):t}}),CA=w("$ZodMap",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!(i instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),t;let n=[];t.value=new Map;for(let[s,a]of i){let l=e.keyType._zod.run({value:s,issues:[]},o),c=e.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||c instanceof Promise?n.push(Promise.all([l,c]).then(([d,p])=>{LE(d,p,t,s,i,r,o)})):LE(l,c,t,s,i,r,o)}return n.length?Promise.all(n).then(()=>t):t}});function LE(r,e,t,o,i,n,s){r.issues.length&&(Sh.has(typeof o)?t.issues.push(...ei(o,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:n,issues:r.issues.map(a=>Cr(a,s,bt()))})),e.issues.length&&(Sh.has(typeof o)?t.issues.push(...ei(o,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:n,key:o,issues:e.issues.map(a=>Cr(a,s,bt()))})),t.value.set(r.value,e.value)}var TA=w("$ZodSet",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!(i instanceof Set))return t.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),t;let n=[];t.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?n.push(a.then(l=>KE(l,t))):KE(a,t)}return n.length?Promise.all(n).then(()=>t):t}});function KE(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var RA=w("$ZodEnum",(r,e)=>{me.init(r,e);let t=_h(e.entries),o=new Set(t);r._zod.values=o,r._zod.pattern=new RegExp(`^(${t.filter(i=>Sh.has(typeof i)).map(i=>typeof i=="string"?$i(i):i.toString()).join("|")})$`),r._zod.parse=(i,n)=>{let s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:t,input:s,inst:r}),i}}),OA=w("$ZodLiteral",(r,e)=>{if(me.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?$i(o):o?$i(o.toString()):String(o)).join("|")})$`),r._zod.parse=(o,i)=>{let n=o.value;return t.has(n)||o.issues.push({code:"invalid_value",values:e.values,input:n,inst:r}),o}}),VA=w("$ZodFile",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),t}}),zA=w("$ZodTransform",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Bs(r.constructor.name);let i=e.transform(t.value,t);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(t.value=s,t));if(i instanceof Promise)throw new no;return t.value=i,t}});function WE(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var UA=w("$ZodOptional",(r,e)=>{me.init(r,e),r._zod.optin="optional",r._zod.optout="optional",$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Ph(t.source)})?$`):void 0}),r._zod.parse=(t,o)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>WE(n,t.value)):WE(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,o)}}),jA=w("$ZodNullable",(r,e)=>{me.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Ph(t.source)}|null)$`):void 0}),$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,o)=>t.value===null?t:e.innerType._zod.run(t,o)}),LA=w("$ZodDefault",(r,e)=>{me.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);if(t.value===void 0)return t.value=e.defaultValue,t;let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>ZE(n,e)):ZE(i,e)}});function ZE(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var KA=w("$ZodPrefault",(r,e)=>{me.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>(o.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,o))}),WA=w("$ZodNonOptional",(r,e)=>{me.init(r,e),$e(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(o=>o!==void 0)):void 0}),r._zod.parse=(t,o)=>{let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>GE(n,r)):GE(i,r)}});function GE(r,e){return!r.issues.length&&r.value===void 0&&r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:e}),r}var ZA=w("$ZodSuccess",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Bs("ZodSuccess");let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>(t.value=n.issues.length===0,t)):(t.value=i.issues.length===0,t)}}),GA=w("$ZodCatch",(r,e)=>{me.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(s=>Cr(s,o,bt()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(n=>Cr(n,o,bt()))},input:t.value}),t.issues=[]),t)}}),qA=w("$ZodNaN",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),HA=w("$ZodPipe",(r,e)=>{me.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,o)=>{if(o.direction==="backward"){let n=e.out._zod.run(t,o);return n instanceof Promise?n.then(s=>Ov(s,e.in,o)):Ov(n,e.in,o)}let i=e.in._zod.run(t,o);return i instanceof Promise?i.then(n=>Ov(n,e.out,o)):Ov(i,e.out,o)}});function Ov(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var Th=w("$ZodCodec",(r,e)=>{me.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,o)=>{if((o.direction||"forward")==="forward"){let n=e.in._zod.run(t,o);return n instanceof Promise?n.then(s=>Vv(s,e,o)):Vv(n,e,o)}else{let n=e.out._zod.run(t,o);return n instanceof Promise?n.then(s=>Vv(s,e,o)):Vv(n,e,o)}}});function Vv(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let i=e.transform(r.value,r);return i instanceof Promise?i.then(n=>zv(r,n,e.out,t)):zv(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(n=>zv(r,n,e.in,t)):zv(r,i,e.in,t)}}function zv(r,e,t,o){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},o)}var JA=w("$ZodReadonly",(r,e)=>{me.init(r,e),$e(r._zod,"propValues",()=>e.innerType._zod.propValues),$e(r._zod,"values",()=>e.innerType._zod.values),$e(r._zod,"optin",()=>e.innerType?._zod?.optin),$e(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(qE):qE(i)}});function qE(r){return r.value=Object.freeze(r.value),r}var QA=w("$ZodTemplateLiteral",(r,e)=>{me.init(r,e);let t=[];for(let o of e.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let i=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let n=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;t.push(i.slice(n,s))}else if(o===null||Kw.has(typeof o))t.push($i(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(o,i)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:r,expected:"template_literal",code:"invalid_type"}),o):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),o)}),XA=w("$ZodFunction",(r,e)=>(me.init(r,e),r._def=e,r._zod.def=e,r.implement=t=>{if(typeof t!="function")throw new Error("implement() must be called with a function");return function(...o){let i=r._def.input?Pv(r._def.input,o):o,n=Reflect.apply(t,this,i);return r._def.output?Pv(r._def.output,n):n}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let i=r._def.input?await Sv(r._def.input,o):o,n=await Reflect.apply(t,this,i);return r._def.output?await Sv(r._def.output,n):n}},r._zod.parse=(t,o)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:r}),t):(r._def.output&&r._def.output._zod.def.type==="promise"?t.value=r.implementAsync(t.value):t.value=r.implement(t.value),t),r.input=(...t)=>{let o=r.constructor;return Array.isArray(t[0])?new o({type:"function",input:new Kv({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new o({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let o=r.constructor;return new o({type:"function",input:r._def.input,output:t})},r)),YA=w("$ZodPromise",(r,e)=>{me.init(r,e),r._zod.parse=(t,o)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},o))}),e_=w("$ZodLazy",(r,e)=>{me.init(r,e),$e(r._zod,"innerType",()=>e.getter()),$e(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),$e(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),$e(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),$e(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(t,o)=>r._zod.innerType._zod.run(t,o)}),t_=w("$ZodCustom",(r,e)=>{Xe.init(r,e),me.init(r,e),r._zod.parse=(t,o)=>t,r._zod.check=t=>{let o=t.value,i=e.fn(o);if(i instanceof Promise)return i.then(n=>HE(n,t,o,r));HE(i,t,o,r)}});function HE(r,e,t,o){if(!r){let i={code:"custom",input:t,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),e.issues.push(Pc(i))}}var Vh={};qo(Vh,{ar:()=>tB,az:()=>rB,be:()=>oB,bg:()=>nB,ca:()=>sB,cs:()=>aB,da:()=>lB,de:()=>uB,en:()=>Wv,eo:()=>cB,es:()=>dB,fa:()=>pB,fi:()=>hB,fr:()=>fB,frCA:()=>mB,he:()=>gB,hu:()=>vB,id:()=>yB,is:()=>xB,it:()=>bB,ja:()=>wB,ka:()=>AB,kh:()=>_B,km:()=>Zv,ko:()=>PB,lt:()=>EB,mk:()=>BB,ms:()=>FB,nl:()=>NB,no:()=>IB,ota:()=>kB,pl:()=>DB,ps:()=>$B,pt:()=>MB,ru:()=>TB,sl:()=>RB,sv:()=>OB,ta:()=>VB,th:()=>zB,tr:()=>UB,ua:()=>jB,uk:()=>Gv,ur:()=>LB,vi:()=>KB,yo:()=>GB,zhCN:()=>WB,zhTW:()=>ZB});var hk=()=>{let r={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return i=>{switch(i.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:n.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${n.suffix}"`:n.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${n.includes}"`:n.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${n.pattern}`:`${o[n.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${I(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function tB(){return{localeError:hk()}}var fk=()=>{let r={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i.expected}, daxil olan ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${n}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${n.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:n.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${n.suffix}" il\u0259 bitm\u0259lidir`:n.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${n.includes}" daxil olmal\u0131d\u0131r`:n.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${n.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[n.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${I(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function rB(){return{localeError:fk()}}function iB(r,e,t,o){let i=Math.abs(r),n=i%10,s=i%100;return s>=11&&s<=19?o:n===1?e:n>=2&&n<=4?t:o}var mk=()=>{let r={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0456\u045E";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=iB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${n}${i.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),l=iB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${n}${i.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${n.includes}"`:n.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${I(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function oB(){return{localeError:mk()}}var gk=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},vk=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(o){return r[o]??null}let t={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${gk(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(o.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${I(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${o.maximum.toString()} ${n.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${o.minimum.toString()} ${n.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${n} ${t[i.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${o.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u043E\u0432\u0435":""}: ${I(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function nB(){return{localeError:vk()}}var yk=()=>{let r={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${i.expected}, s'ha rebut ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${V(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${I(i.values," o ")}`;case"too_big":{let n=i.inclusive?"com a m\xE0xim":"menys de",s=e(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${n} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${n} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${n.prefix}"`:n.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${n.suffix}"`:n.format==="includes"?`Format inv\xE0lid: ha d'incloure "${n.includes}"`:n.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${n.pattern}`:`Format inv\xE0lid per a ${o[n.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function sB(){return{localeError:yk()}}var xk=()=>{let r={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(i))return"pole";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return i=>{switch(i.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i.expected}, obdr\u017Eeno ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${n}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${n}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${n.prefix}"`:n.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${n.suffix}"`:n.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${n.includes}"`:n.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${n.pattern}`:`Neplatn\xFD form\xE1t ${o[n.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${I(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function aB(){return{localeError:xk()}}var bk=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function t(s){return r[s]??null}function o(s){return e[s]??s}let i=s=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"tal";case"object":return Array.isArray(s)?"liste":s===null?"null":Object.getPrototypeOf(s)!==Object.prototype&&s.constructor?s.constructor.name:"objekt"}return a},n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return s=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${o(s.expected)}, fik ${o(i(s.input))}`;case"invalid_value":return s.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(s.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${I(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),c=o(s.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${a} ${s.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),c=o(s.origin);return l?`For lille: forventede ${c} ${l.verb} ${a} ${s.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} havde ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??s.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${s.divisor}`;case"unrecognized_keys":return`${s.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${I(s.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${s.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${s.origin}`;default:return"Ugyldigt input"}}};function lB(){return{localeError:bk()}}var wk=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"Zahl";case"object":{if(Array.isArray(i))return"Array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return i=>{switch(i.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${i.expected}, erhalten ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ist`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ist`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ung\xFCltiger String: muss mit "${n.prefix}" beginnen`:n.format==="ends_with"?`Ung\xFCltiger String: muss mit "${n.suffix}" enden`:n.format==="includes"?`Ung\xFCltiger String: muss "${n.includes}" enthalten`:n.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${n.pattern} entsprechen`:`Ung\xFCltig: ${o[n.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${I(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function uB(){return{localeError:wk()}}var Ak=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},_k=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(o){return r[o]??null}let t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Ak(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${V(o.values[0])}`:`Invalid option: expected one of ${I(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Too big: expected ${o.origin??"value"} to have ${i}${o.maximum.toString()} ${n.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Too small: expected ${o.origin} to have ${i}${o.minimum.toString()} ${n.unit}`:`Too small: expected ${o.origin} to be ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${t[i.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${I(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Wv(){return{localeError:_k()}}var Pk=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"nombro";case"object":{if(Array.isArray(r))return"tabelo";if(r===null)return"senvalora";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},Sk=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(o){return r[o]??null}let t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${Pk(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${I(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()} ${n.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${i}${o.minimum.toString()} ${n.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${t[i.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${I(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function cB(){return{localeError:Sk()}}var Ek=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function t(s){return r[s]??null}function o(s){return e[s]??s}let i=s=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"number";case"object":return Array.isArray(s)?"array":s===null?"null":Object.getPrototypeOf(s)!==Object.prototype?s.constructor.name:"object"}return a},n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return s=>{switch(s.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o(s.expected)}, recibido ${o(i(s.input))}`;case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(s.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${I(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),c=o(s.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${a}${s.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),c=o(s.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${a}${s.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${n[a.format]??s.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":return`Llave${s.keys.length>1?"s":""} desconocida${s.keys.length>1?"s":""}: ${I(s.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o(s.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o(s.origin)}`;default:return"Entrada inv\xE1lida"}}};function dB(){return{localeError:Ek()}}var Bk=()=>{let r={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0622\u0631\u0627\u06CC\u0647";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return i=>{switch(i.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(i.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${I(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:n.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:n.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${n.includes}" \u0628\u0627\u0634\u062F`:n.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${n.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[n.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${I(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function pB(){return{localeError:Bk()}}var Fk=()=>{let r={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${n}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${n}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${n.prefix}"`:n.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${n.suffix}"`:n.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${n.includes}"`:n.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${n.pattern}`:`Virheellinen ${o[n.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function hB(){return{localeError:Fk()}}var Nk=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"nombre";case"object":{if(Array.isArray(i))return"tableau";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : ${i.expected} attendu, ${t(i.input)} re\xE7u`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${V(i.values[0])} attendu`:`Option invalide : une valeur parmi ${I(i.values,"|")} attendue`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${n.pattern}`:`${o[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${I(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function fB(){return{localeError:Nk()}}var Ik=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${i.expected}, re\xE7u ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${V(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${n}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${n}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${n.pattern}`:`${o[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${I(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function mB(){return{localeError:Ik()}}var kk=()=>{let r={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},t=c=>c?r[c]:void 0,o=c=>{let d=t(c);return d?d.label:c??r.unknown.label},i=c=>`\u05D4${o(c)}`,n=c=>(t(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?e[c]??null:null,a=c=>{let d=typeof c;switch(d){case"number":return Number.isNaN(c)?"NaN":"number";case"object":return Array.isArray(c)?"array":c===null?"null":Object.getPrototypeOf(c)!==Object.prototype&&c.constructor?c.constructor.name:"object";default:return d}},l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}};return c=>{switch(c.code){case"invalid_type":{let d=c.expected,p=o(d),f=a(c.input),g=r[f]?.label??f;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${V(c.values[0])}`;let d=c.values.map(g=>V(g));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=s(c.origin),p=i(c.origin??"value");if(c.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${d?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let v=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(c.origin==="array"||c.origin==="set"){let v=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",x=c.inclusive?`${c.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`.trim()}let f=c.inclusive?"<=":"<",g=n(c.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${c.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${c.maximum.toString()}`}case"too_small":{let d=s(c.origin),p=i(c.origin??"value");if(c.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${d?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let v=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(c.origin==="array"||c.origin==="set"){let v=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let y=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`}let x=c.inclusive?`${c.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`.trim()}let f=c.inclusive?">=":">",g=n(c.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${c.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${c.minimum.toString()}`}case"invalid_format":{let d=c;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=l[d.format],f=p?.label??d.format,v=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${v}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${I(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function gB(){return{localeError:kk()}}var $k=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(i))return"t\xF6mb";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return i=>{switch(i.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i.expected}, a kapott \xE9rt\xE9k ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${n}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${n}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xC9rv\xE9nytelen string: "${n.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:n.format==="ends_with"?`\xC9rv\xE9nytelen string: "${n.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:n.format==="includes"?`\xC9rv\xE9nytelen string: "${n.includes}" \xE9rt\xE9ket kell tartalmaznia`:n.format==="regex"?`\xC9rv\xE9nytelen string: ${n.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[n.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function vB(){return{localeError:$k()}}var Dk=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${V(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${n}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${n}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`String tidak valid: harus dimulai dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak valid: harus berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak valid: harus menyertakan "${n.includes}"`:n.format==="regex"?`String tidak valid: harus sesuai pola ${n.pattern}`:`${o[n.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function yB(){return{localeError:Dk()}}var Mk=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(r))return"fylki";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},Ck=()=>{let r={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(o){return r[o]??null}let t={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${Mk(o.input)} \xFEar sem \xE1 a\xF0 vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${I(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${i}${o.maximum.toString()} ${n.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${i}${o.minimum.toString()} ${n.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${t[i.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${I(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}};function xB(){return{localeError:Ck()}}var Tk=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"numero";case"object":{if(Array.isArray(i))return"vettore";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input non valido: atteso ${V(i.values[0])}`:`Opzione non valida: atteso uno tra ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${n}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${n}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Stringa non valida: deve iniziare con "${n.prefix}"`:n.format==="ends_with"?`Stringa non valida: deve terminare con "${n.suffix}"`:n.format==="includes"?`Stringa non valida: deve includere "${n.includes}"`:n.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${n.pattern}`:`Invalid ${o[n.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${I(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function bB(){return{localeError:Tk()}}var Rk=()=>{let r={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(i))return"\u914D\u5217";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return i=>{switch(i.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(i.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${I(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let n=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let n=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${n.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[n.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${I(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function wB(){return{localeError:Rk()}}var Ok=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(r))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[e]??e},Vk=()=>{let r={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(o){return r[o]??null}let t={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return o=>{switch(o.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${Ok(o.input)}`;case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${I(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${n.verb} ${i}${o.maximum.toString()} ${n.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${n.verb} ${i}${o.minimum.toString()} ${n.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[i.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${I(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function AB(){return{localeError:Vk()}}var zk=()=>{let r={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(i))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(i===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return i=>{switch(i.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${n} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${n.prefix}"`:n.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${n.suffix}"`:n.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${n.includes}"`:n.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${n.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${I(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Zv(){return{localeError:zk()}}function _B(){return Zv()}var Uk=()=>{let r={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return i=>{switch(i.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(i.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${I(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let n=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=n==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),l=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${l} ${n}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${n}${s}`}case"too_small":{let n=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=n==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),l=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${l} ${n}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${n}${s}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:n.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${n.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[n.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${I(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function PB(){return{localeError:Uk()}}var jk=r=>Oh(typeof r,r),Oh=(r,e=void 0)=>{switch(r){case"number":return Number.isNaN(e)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return e===void 0?"ne\u017Einomas objektas":e===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(e)?"masyvas":Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return r},Rh=r=>r.charAt(0).toUpperCase()+r.slice(1);function SB(r){let e=Math.abs(r),t=e%10,o=e%100;return o>=11&&o<=19||t===0?"many":t===1?"one":"few"}var Lk=()=>{let r={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(o,i,n,s){let a=r[o]??null;return a===null?a:{unit:a.unit[i],verb:a.verb[s][n?"inclusive":"notInclusive"]}}let t={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${jk(o.input)}, o tik\u0117tasi - ${Oh(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${V(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${I(o.values,"|")} pasirinkim\u0173`;case"too_big":{let i=Oh(o.origin),n=e(o.origin,SB(Number(o.maximum)),o.inclusive??!1,"smaller");if(n?.verb)return`${Rh(i??o.origin??"reik\u0161m\u0117")} ${n.verb} ${o.maximum.toString()} ${n.unit??"element\u0173"}`;let s=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Rh(i??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${o.maximum.toString()} ${n?.unit}`}case"too_small":{let i=Oh(o.origin),n=e(o.origin,SB(Number(o.minimum)),o.inclusive??!1,"bigger");if(n?.verb)return`${Rh(i??o.origin??"reik\u0161m\u0117")} ${n.verb} ${o.minimum.toString()} ${n.unit??"element\u0173"}`;let s=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Rh(i??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${o.minimum.toString()} ${n?.unit}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${t[i.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${I(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=Oh(o.origin);return`${Rh(i??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function EB(){return{localeError:Lk()}}var Kk=()=>{let r={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(i))return"\u043D\u0438\u0437\u0430";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return i=>{switch(i.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${V(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${n}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${n}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${n.pattern}`:`Invalid ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${I(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function BB(){return{localeError:Kk()}}var Wk=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"nombor";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${V(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`String tidak sah: mesti bermula dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak sah: mesti mengandungi "${n.includes}"`:n.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${n.pattern}`:`${o[n.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function FB(){return{localeError:Wk()}}var Zk=()=>{let r={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"getal";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${V(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Te groot: verwacht dat ${i.origin??"waarde"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"elementen"}`:`Te groot: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} is`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Te klein: verwacht dat ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Te klein: verwacht dat ${i.origin} ${n}${i.minimum.toString()} is`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ongeldige tekst: moet met "${n.prefix}" beginnen`:n.format==="ends_with"?`Ongeldige tekst: moet op "${n.suffix}" eindigen`:n.format==="includes"?`Ongeldige tekst: moet "${n.includes}" bevatten`:n.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`:`Ongeldig: ${o[n.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function NB(){return{localeError:Zk()}}var Gk=()=>{let r={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"tall";case"object":{if(Array.isArray(i))return"liste";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${V(i.values[0])}`:`Ugyldig valg: forventet en av ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${n}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${n}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${o[n.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${I(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function IB(){return{localeError:Gk()}}var qk=()=>{let r={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"numara";case"object":{if(Array.isArray(i))return"saf";if(i===null)return"gayb";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return i=>{switch(i.code){case"invalid_type":return`F\xE2sit giren: umulan ${i.expected}, al\u0131nan ${t(i.input)}`;case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${V(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${n}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${n}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${n}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${n}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let n=i;return n.format==="starts_with"?`F\xE2sit metin: "${n.prefix}" ile ba\u015Flamal\u0131.`:n.format==="ends_with"?`F\xE2sit metin: "${n.suffix}" ile bitmeli.`:n.format==="includes"?`F\xE2sit metin: "${n.includes}" ihtiv\xE2 etmeli.`:n.format==="regex"?`F\xE2sit metin: ${n.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[n.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function kB(){return{localeError:qk()}}var Hk=()=>{let r={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0627\u0631\u06D0";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return i=>{switch(i.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(i.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${I(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:n.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:n.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${n.includes}" \u0648\u0644\u0631\u064A`:n.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${n.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[n.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${I(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function $B(){return{localeError:Hk()}}var Jk=()=>{let r={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"liczba";case"object":{if(Array.isArray(i))return"tablica";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return i=>{switch(i.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i.expected}, otrzymano ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${n.prefix}"`:n.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${n.suffix}"`:n.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${n.includes}"`:n.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${n.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[n.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function DB(){return{localeError:Jk()}}var Qk=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(i))return"array";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${i.expected}, recebido ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${V(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${n}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${n}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${n.prefix}"`:n.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${n.suffix}"`:n.format==="includes"?`Texto inv\xE1lido: deve incluir "${n.includes}"`:n.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${n.pattern}`:`${o[n.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${I(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function MB(){return{localeError:Qk()}}function CB(r,e,t,o){let i=Math.abs(r),n=i%10,s=i%100;return s>=11&&s<=19?o:n===1?e:n>=2&&n<=4?t:o}var Xk=()=>{let r={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=CB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${i.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),l=CB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${i.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${I(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function TB(){return{localeError:Xk()}}var Yk=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(i))return"tabela";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${i.expected}, prejeto ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${n}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${n}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${n.prefix}"`:n.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${n.suffix}"`:n.format==="includes"?`Neveljaven niz: mora vsebovati "${n.includes}"`:n.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`:`Neveljaven ${o[n.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${I(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function RB(){return{localeError:Yk()}}var e$=()=>{let r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"antal";case"object":{if(Array.isArray(i))return"lista";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${i.expected}, fick ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${n.prefix}"`:n.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${n.suffix}"`:n.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${n.includes}"`:n.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${n.pattern}"`:`Ogiltig(t) ${o[n.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${I(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function OB(){return{localeError:e$()}}var t$=()=>{let r={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(i))return"\u0B85\u0BA3\u0BBF";if(i===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${I(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${n}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${n}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${n.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${I(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function VB(){return{localeError:t$()}}var r$=()=>{let r={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(i))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(i===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return i=>{switch(i.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${n.prefix}"`:n.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${n.suffix}"`:n.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${n.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:n.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${n.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${I(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function zB(){return{localeError:r$()}}var i$=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},o$=()=>{let r={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(o){return r[o]??null}let t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${i$(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${I(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${i}${o.maximum.toString()} ${n.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${i}${o.minimum.toString()} ${n.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[i.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${I(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function UB(){return{localeError:o$()}}var n$=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${n.prefix}"`:n.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${n.suffix}"`:n.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${n.includes}"`:n.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${n.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${I(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Gv(){return{localeError:n$()}}function jB(){return Gv()}var s$=()=>{let r={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(i))return"\u0622\u0631\u06D2";if(i===null)return"\u0646\u0644";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return i=>{switch(i.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(i.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${I(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${n}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${n}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${n}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${n.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${I(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function LB(){return{localeError:s$()}}var a$=()=>{let r={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(i))return"m\u1EA3ng";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return i=>{switch(i.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${n.prefix}"`:n.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${n.suffix}"`:n.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${n.includes}"`:n.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${n.pattern}`:`${o[n.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${I(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function KB(){return{localeError:a$()}}var l$=()=>{let r={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(i))return"\u6570\u7EC4";if(i===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return i=>{switch(i.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${n}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.prefix}" \u5F00\u5934`:n.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.suffix}" \u7ED3\u5C3E`:n.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${n.pattern}`:`\u65E0\u6548${o[n.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${I(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function WB(){return{localeError:l$()}}var u$=()=>{let r={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return i=>{switch(i.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i.expected}\uFF0C\u4F46\u6536\u5230 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${n}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${n}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.prefix}" \u958B\u982D`:n.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.suffix}" \u7D50\u5C3E`:n.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${n.pattern}`:`\u7121\u6548\u7684 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${I(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function ZB(){return{localeError:u$()}}var c$=()=>{let r={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(i))return"akop\u1ECD";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return i=>{switch(i.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${I(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${n}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${i.maximum}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${n}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${i.minimum}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${n.prefix}"`:n.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${n.suffix}"`:n.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${n.includes}"`:n.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${n.pattern}`:`A\u1E63\xEC\u1E63e: ${o[n.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${I(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function GB(){return{localeError:c$()}}var qB,r_=Symbol("ZodOutput"),i_=Symbol("ZodInput"),qv=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let o=t[0];if(this._map.set(e,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let o={...this.get(t)??{}};delete o.id;let i={...o,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Hv(){return new qv}(qB=globalThis).__zod_globalRegistry??(qB.__zod_globalRegistry=Hv());var wr=globalThis.__zod_globalRegistry;function o_(r,e){return new r({type:"string",...j(e)})}function n_(r,e){return new r({type:"string",coerce:!0,...j(e)})}function Jv(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...j(e)})}function zh(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...j(e)})}function Qv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...j(e)})}function Xv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(e)})}function Yv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(e)})}function ey(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(e)})}function Uh(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...j(e)})}function ty(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...j(e)})}function ry(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(e)})}function iy(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...j(e)})}function oy(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(e)})}function ny(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...j(e)})}function sy(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...j(e)})}function ay(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(e)})}function ly(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(e)})}function uy(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(e)})}function s_(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...j(e)})}function cy(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(e)})}function dy(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(e)})}function py(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...j(e)})}function hy(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...j(e)})}function fy(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...j(e)})}function my(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...j(e)})}var a_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function l_(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(e)})}function u_(r,e){return new r({type:"string",format:"date",check:"string_format",...j(e)})}function c_(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...j(e)})}function d_(r,e){return new r({type:"string",format:"duration",check:"string_format",...j(e)})}function p_(r,e){return new r({type:"number",checks:[],...j(e)})}function h_(r,e){return new r({type:"number",coerce:!0,checks:[],...j(e)})}function f_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...j(e)})}function m_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...j(e)})}function g_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...j(e)})}function v_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...j(e)})}function y_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...j(e)})}function x_(r,e){return new r({type:"boolean",...j(e)})}function b_(r,e){return new r({type:"boolean",coerce:!0,...j(e)})}function w_(r,e){return new r({type:"bigint",...j(e)})}function A_(r,e){return new r({type:"bigint",coerce:!0,...j(e)})}function __(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(e)})}function P_(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(e)})}function S_(r,e){return new r({type:"symbol",...j(e)})}function E_(r,e){return new r({type:"undefined",...j(e)})}function B_(r,e){return new r({type:"null",...j(e)})}function F_(r){return new r({type:"any"})}function N_(r){return new r({type:"unknown"})}function I_(r,e){return new r({type:"never",...j(e)})}function k_(r,e){return new r({type:"void",...j(e)})}function $_(r,e){return new r({type:"date",...j(e)})}function D_(r,e){return new r({type:"date",coerce:!0,...j(e)})}function M_(r,e){return new r({type:"nan",...j(e)})}function Lo(r,e){return new Cv({check:"less_than",...j(e),value:r,inclusive:!1})}function ti(r,e){return new Cv({check:"less_than",...j(e),value:r,inclusive:!0})}function Ko(r,e){return new Tv({check:"greater_than",...j(e),value:r,inclusive:!1})}function Ar(r,e){return new Tv({check:"greater_than",...j(e),value:r,inclusive:!0})}function gy(r){return Ko(0,r)}function vy(r){return Lo(0,r)}function yy(r){return ti(0,r)}function xy(r){return Ar(0,r)}function Ds(r,e){return new B0({check:"multiple_of",...j(e),value:r})}function sl(r,e){return new I0({check:"max_size",...j(e),maximum:r})}function Ms(r,e){return new k0({check:"min_size",...j(e),minimum:r})}function Ic(r,e){return new $0({check:"size_equals",...j(e),size:r})}function al(r,e){return new D0({check:"max_length",...j(e),maximum:r})}function Sn(r,e){return new M0({check:"min_length",...j(e),minimum:r})}function ll(r,e){return new C0({check:"length_equals",...j(e),length:r})}function kc(r,e){return new T0({check:"string_format",format:"regex",...j(e),pattern:r})}function $c(r){return new R0({check:"string_format",format:"lowercase",...j(r)})}function Dc(r){return new O0({check:"string_format",format:"uppercase",...j(r)})}function Mc(r,e){return new V0({check:"string_format",format:"includes",...j(e),includes:r})}function Cc(r,e){return new z0({check:"string_format",format:"starts_with",...j(e),prefix:r})}function Tc(r,e){return new U0({check:"string_format",format:"ends_with",...j(e),suffix:r})}function by(r,e,t){return new j0({check:"property",property:r,schema:e,...j(t)})}function Rc(r,e){return new L0({check:"mime_type",mime:r,...j(e)})}function so(r){return new K0({check:"overwrite",tx:r})}function Oc(r){return so(e=>e.normalize(r))}function Vc(){return so(r=>r.trim())}function zc(){return so(r=>r.toLowerCase())}function Uc(){return so(r=>r.toUpperCase())}function jc(){return so(r=>Uw(r))}function C_(r,e,t){return new r({type:"array",element:e,...j(t)})}function p$(r,e,t){return new r({type:"union",options:e,...j(t)})}function h$(r,e,t){return new r({type:"union",options:e,inclusive:!1,...j(t)})}function f$(r,e,t,o){return new r({type:"union",options:t,discriminator:e,...j(o)})}function m$(r,e,t){return new r({type:"intersection",left:e,right:t})}function g$(r,e,t,o){let i=t instanceof me,n=i?o:t,s=i?t:null;return new r({type:"tuple",items:e,rest:s,...j(n)})}function v$(r,e,t,o){return new r({type:"record",keyType:e,valueType:t,...j(o)})}function y$(r,e,t,o){return new r({type:"map",keyType:e,valueType:t,...j(o)})}function x$(r,e,t){return new r({type:"set",valueType:e,...j(t)})}function b$(r,e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:o,...j(t)})}function w$(r,e,t){return new r({type:"enum",entries:e,...j(t)})}function A$(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...j(t)})}function T_(r,e){return new r({type:"file",...j(e)})}function _$(r,e){return new r({type:"transform",transform:e})}function P$(r,e){return new r({type:"optional",innerType:e})}function S$(r,e){return new r({type:"nullable",innerType:e})}function E$(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Lw(t)}})}function B$(r,e,t){return new r({type:"nonoptional",innerType:e,...j(t)})}function F$(r,e){return new r({type:"success",innerType:e})}function N$(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function I$(r,e,t){return new r({type:"pipe",in:e,out:t})}function k$(r,e){return new r({type:"readonly",innerType:e})}function $$(r,e,t){return new r({type:"template_literal",parts:e,...j(t)})}function D$(r,e){return new r({type:"lazy",getter:e})}function M$(r,e){return new r({type:"promise",innerType:e})}function R_(r,e,t){let o=j(t);return o.abort??(o.abort=!0),new r({type:"custom",check:"custom",fn:e,...o})}function O_(r,e,t){return new r({type:"custom",check:"custom",fn:e,...j(t)})}function V_(r){let e=HB(t=>(t.addIssue=o=>{if(typeof o=="string")t.issues.push(Pc(o,t.value,e._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(Pc(i))}},r(t.value,t)));return e}function HB(r,e){let t=new Xe({check:"custom",...j(e)});return t._zod.check=r,t}function z_(r){let e=new Xe({check:"describe"});return e._zod.onattach=[t=>{let o=wr.get(t)??{};wr.add(t,{...o,description:r})}],e._zod.check=()=>{},e}function U_(r){let e=new Xe({check:"meta"});return e._zod.onattach=[t=>{let o=wr.get(t)??{};wr.add(t,{...o,...r})}],e._zod.check=()=>{},e}function j_(r,e){let t=j(e),o=t.truthy??["true","1","yes","on","y","enabled"],i=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(o=o.map(g=>typeof g=="string"?g.toLowerCase():g),i=i.map(g=>typeof g=="string"?g.toLowerCase():g));let n=new Set(o),s=new Set(i),a=r.Codec??Th,l=r.Boolean??Mh,c=r.String??nl,d=new c({type:"string",error:t.error}),p=new l({type:"boolean",error:t.error}),f=new a({type:"pipe",in:d,out:p,transform:(g,v)=>{let x=g;return t.case!=="sensitive"&&(x=x.toLowerCase()),n.has(x)?!0:s.has(x)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...s],input:v.value,inst:f,continue:!1}),{})},reverseTransform:(g,v)=>g===!0?o[0]||"true":i[0]||"false",error:t.error});return f}function Lc(r,e,t,o={}){let i=j(o),n={...j(o),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:a=>t.test(a),...i};return t instanceof RegExp&&(n.pattern=t),new r(n)}function Cs(r){let e=r?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:r.processors??{},metadataRegistry:r?.metadata??wr,target:e,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function Ze(r,e,t={path:[],schemaPath:[]}){var o;let i=r._zod.def,n=e.seen.get(r);if(n)return n.count++,t.schemaPath.includes(r)&&(n.cycle=t.path),n.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(r,s);let a=r._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...t,schemaPath:[...t.schemaPath,r],path:t.path},p=r._zod.parent;if(p)s.ref=p,Ze(p,e,d),e.seen.get(p).isParent=!0;else if(r._zod.processJSONSchema)r._zod.processJSONSchema(e,s.schema,d);else{let f=s.schema,g=e.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(r,e,f,d)}}let l=e.metadataRegistry.get(r);return l&&Object.assign(s.schema,l),e.io==="input"&&_r(r)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(r).schema}function Ts(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=n=>{let s=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let d=r.external.registry.get(n[0])?.id,p=r.external.uri??(g=>g);if(d)return{ref:p(d)};let f=n[1].defId??n[1].schema.id??`schema${r.counter++}`;return n[1].defId=f,{defId:f,ref:`${p("__shared")}#/${s}/${f}`}}if(n[1]===t)return{ref:"#"};let l=`#/${s}/`,c=n[1].schema.id??`__schema${r.counter++}`;return{defId:c,ref:l+c}},i=n=>{if(n[1].schema.$ref)return;let s=n[1],{ref:a,defId:l}=o(n);s.def={...s.schema},l&&(s.defId=l);let c=s.schema;for(let d in c)delete c[d];c.$ref=a};if(r.cycles==="throw")for(let n of r.seen.entries()){let s=n[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
24
24
|
|
|
25
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let d=p[1];if(e===p[0]){a(p);continue}if(i.external){let v=i.external.registry.get(p[0])?.id;if(e!==p[0]&&v){a(p);continue}}if(this.metadataRegistry.get(p[0])?.id){a(p);continue}if(d.cycle){a(p);continue}if(d.count>1&&i.reused==="ref"){a(p);continue}}let s=(p,d)=>{let f=this.seen.get(p),v=f.def??f.schema,m={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,d);let x=this.seen.get(y).schema;x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(x)):(Object.assign(v,x),Object.assign(v,m))}f.isParent||this.override({zodSchema:p,jsonSchema:v,path:f.path??[]})};for(let p of[...this.seen.entries()].reverse())s(p[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),i.external?.uri){let p=i.external.registry.get(e)?.id;if(!p)throw new Error("Schema is missing an `id` property");l.$id=i.external.uri(p)}Object.assign(l,n.def);let c=i.external?.defs??{};for(let p of this.seen.entries()){let d=p[1];d.def&&d.defId&&(c[d.defId]=d.def)}i.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function QA(r,e){if(r instanceof vc){let i=new Sh(e),n={};for(let s of r._idmap.entries()){let[l,c]=s;i.process(c)}let o={},a={registry:r,uri:e?.uri,defs:n};for(let s of r._idmap.entries()){let[l,c]=s;o[l]=i.emit(c,{...e,external:a})}if(Object.keys(n).length>0){let s=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:n}}return{schemas:o}}let t=new Sh(e);return t.process(r),t.emit(r,e)}function vr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return vr(i.element,t);if(i.type==="set")return vr(i.valueType,t);if(i.type==="lazy")return vr(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return vr(i.innerType,t);if(i.type==="intersection")return vr(i.left,t)||vr(i.right,t);if(i.type==="record"||i.type==="map")return vr(i.keyType,t)||vr(i.valueType,t);if(i.type==="pipe")return vr(i.in,t)||vr(i.out,t);if(i.type==="object"){for(let n in i.shape)if(vr(i.shape[n],t))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(vr(n,t))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(vr(n,t))return!0;return!!(i.rest&&vr(i.rest,t))}return!1}var sE={};var Yv={};Da(Yv,{ZodISODate:()=>Hv,ZodISODateTime:()=>qv,ZodISODuration:()=>Qv,ZodISOTime:()=>Jv,date:()=>XA,datetime:()=>YA,duration:()=>t_,time:()=>e_});var qv=A("ZodISODateTime",(r,e)=>{l0.init(r,e),Je.init(r,e)});function YA(r){return dA(qv,r)}var Hv=A("ZodISODate",(r,e)=>{u0.init(r,e),Je.init(r,e)});function XA(r){return pA(Hv,r)}var Jv=A("ZodISOTime",(r,e)=>{c0.init(r,e),Je.init(r,e)});function e_(r){return hA(Jv,r)}var Qv=A("ZodISODuration",(r,e)=>{d0.init(r,e),Je.init(r,e)});function t_(r){return fA(Qv,r)}var uE=(r,e)=>{Xp.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>th(r,t)},flatten:{value:t=>eh(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,uc,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,uc,2)}},isEmpty:{get(){return r.issues.length===0}}})},xk=A("ZodError",uE),$r=A("ZodError",uE,{Parent:Error});var r_=pc($r),i_=hc($r),n_=fc($r),o_=mc($r),a_=nv($r),s_=ov($r),l_=av($r),u_=sv($r),c_=lv($r),d_=uv($r),p_=cv($r),h_=dv($r);var Pe=A("ZodType",(r,e)=>(he.init(r,e),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(L.mergeDefs(e,{checks:[...e.checks??[],...t.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),r.clone=(t,i)=>mr(r,t,i),r.brand=()=>r,r.register=(t,i)=>(t.add(r,i),r),r.parse=(t,i)=>r_(r,t,i,{callee:r.parse}),r.safeParse=(t,i)=>n_(r,t,i),r.parseAsync=async(t,i)=>i_(r,t,i,{callee:r.parseAsync}),r.safeParseAsync=async(t,i)=>o_(r,t,i),r.spa=r.safeParseAsync,r.encode=(t,i)=>a_(r,t,i),r.decode=(t,i)=>s_(r,t,i),r.encodeAsync=async(t,i)=>l_(r,t,i),r.decodeAsync=async(t,i)=>u_(r,t,i),r.safeEncode=(t,i)=>c_(r,t,i),r.safeDecode=(t,i)=>d_(r,t,i),r.safeEncodeAsync=async(t,i)=>p_(r,t,i),r.safeDecodeAsync=async(t,i)=>h_(r,t,i),r.refine=(t,i)=>r.check(JE(t,i)),r.superRefine=t=>r.check(QE(t)),r.overwrite=t=>r.check(On(t)),r.optional=()=>ey(r),r.nullable=()=>ty(r),r.nullish=()=>ey(ty(r)),r.nonoptional=t=>OE(r,t),r.array=()=>oy(r),r.or=t=>T_([r,t]),r.and=t=>PE(r,t),r.transform=t=>ry(r,V_(t)),r.default=t=>CE(r,t),r.prefault=t=>RE(r,t),r.catch=t=>UE(r,t),r.pipe=t=>ry(r,t),r.readonly=()=>KE(r),r.describe=t=>{let i=r.clone();return gr.add(i,{description:t}),i},Object.defineProperty(r,"description",{get(){return gr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return gr.get(r);let i=r.clone();return gr.add(i,t[0]),i},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),g_=A("_ZodString",(r,e)=>{qs.init(r,e),Pe.init(r,e);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...i)=>r.check(hh(...i)),r.includes=(...i)=>r.check(gh(...i)),r.startsWith=(...i)=>r.check(vh(...i)),r.endsWith=(...i)=>r.check(yh(...i)),r.min=(...i)=>r.check(Na(...i)),r.max=(...i)=>r.check(xc(...i)),r.length=(...i)=>r.check(wc(...i)),r.nonempty=(...i)=>r.check(Na(1,...i)),r.lowercase=i=>r.check(fh(i)),r.uppercase=i=>r.check(mh(i)),r.trim=()=>r.check(bh()),r.normalize=(...i)=>r.check(wh(...i)),r.toLowerCase=()=>r.check(Ah()),r.toUpperCase=()=>r.check(_h()),r.slugify=()=>r.check(Ph())}),Bh=A("ZodString",(r,e)=>{qs.init(r,e),g_.init(r,e),r.email=t=>r.check(Fv(v_,t)),r.url=t=>r.check(dh(iy,t)),r.jwt=t=>r.check(Gv(M_,t)),r.emoji=t=>r.check(Dv(y_,t)),r.guid=t=>r.check(ch(Xv,t)),r.uuid=t=>r.check(Nv(bo,t)),r.uuidv4=t=>r.check(kv(bo,t)),r.uuidv6=t=>r.check($v(bo,t)),r.uuidv7=t=>r.check(Mv(bo,t)),r.nanoid=t=>r.check(Iv(x_,t)),r.guid=t=>r.check(ch(Xv,t)),r.cuid=t=>r.check(Cv(w_,t)),r.cuid2=t=>r.check(Tv(b_,t)),r.ulid=t=>r.check(Rv(A_,t)),r.base64=t=>r.check(Kv(N_,t)),r.base64url=t=>r.check(Wv(k_,t)),r.xid=t=>r.check(Ov(__,t)),r.ksuid=t=>r.check(Vv(P_,t)),r.ipv4=t=>r.check(zv(S_,t)),r.ipv6=t=>r.check(Uv(E_,t)),r.cidrv4=t=>r.check(jv(B_,t)),r.cidrv6=t=>r.check(Lv(F_,t)),r.e164=t=>r.check(Zv($_,t)),r.datetime=t=>r.check(YA(t)),r.date=t=>r.check(XA(t)),r.time=t=>r.check(e_(t)),r.duration=t=>r.check(t_(t))});function f_(r){return sA(Bh,r)}var Je=A("ZodStringFormat",(r,e)=>{We.init(r,e),g_.init(r,e)}),v_=A("ZodEmail",(r,e)=>{Xb.init(r,e),Je.init(r,e)});function bk(r){return Fv(v_,r)}var Xv=A("ZodGUID",(r,e)=>{Qb.init(r,e),Je.init(r,e)});function Ak(r){return ch(Xv,r)}var bo=A("ZodUUID",(r,e)=>{Yb.init(r,e),Je.init(r,e)});function _k(r){return Nv(bo,r)}function Pk(r){return kv(bo,r)}function Sk(r){return $v(bo,r)}function Ek(r){return Mv(bo,r)}var iy=A("ZodURL",(r,e)=>{e0.init(r,e),Je.init(r,e)});function Bk(r){return dh(iy,r)}function Fk(r){return dh(iy,{protocol:/^https?$/,hostname:Ni.domain,...L.normalizeParams(r)})}var y_=A("ZodEmoji",(r,e)=>{t0.init(r,e),Je.init(r,e)});function Nk(r){return Dv(y_,r)}var x_=A("ZodNanoID",(r,e)=>{r0.init(r,e),Je.init(r,e)});function kk(r){return Iv(x_,r)}var w_=A("ZodCUID",(r,e)=>{i0.init(r,e),Je.init(r,e)});function $k(r){return Cv(w_,r)}var b_=A("ZodCUID2",(r,e)=>{n0.init(r,e),Je.init(r,e)});function Mk(r){return Tv(b_,r)}var A_=A("ZodULID",(r,e)=>{o0.init(r,e),Je.init(r,e)});function Dk(r){return Rv(A_,r)}var __=A("ZodXID",(r,e)=>{a0.init(r,e),Je.init(r,e)});function Ik(r){return Ov(__,r)}var P_=A("ZodKSUID",(r,e)=>{s0.init(r,e),Je.init(r,e)});function Ck(r){return Vv(P_,r)}var S_=A("ZodIPv4",(r,e)=>{p0.init(r,e),Je.init(r,e)});function Tk(r){return zv(S_,r)}var cE=A("ZodMAC",(r,e)=>{f0.init(r,e),Je.init(r,e)});function Rk(r){return uA(cE,r)}var E_=A("ZodIPv6",(r,e)=>{h0.init(r,e),Je.init(r,e)});function Ok(r){return Uv(E_,r)}var B_=A("ZodCIDRv4",(r,e)=>{m0.init(r,e),Je.init(r,e)});function Vk(r){return jv(B_,r)}var F_=A("ZodCIDRv6",(r,e)=>{g0.init(r,e),Je.init(r,e)});function zk(r){return Lv(F_,r)}var N_=A("ZodBase64",(r,e)=>{y0.init(r,e),Je.init(r,e)});function Uk(r){return Kv(N_,r)}var k_=A("ZodBase64URL",(r,e)=>{x0.init(r,e),Je.init(r,e)});function jk(r){return Wv(k_,r)}var $_=A("ZodE164",(r,e)=>{w0.init(r,e),Je.init(r,e)});function Lk(r){return Zv($_,r)}var M_=A("ZodJWT",(r,e)=>{b0.init(r,e),Je.init(r,e)});function Kk(r){return Gv(M_,r)}var Fh=A("ZodCustomStringFormat",(r,e)=>{A0.init(r,e),Je.init(r,e)});function Wk(r,e,t={}){return bc(Fh,r,e,t)}function Zk(r){return bc(Fh,"hostname",Ni.hostname,r)}function Gk(r){return bc(Fh,"hex",Ni.hex,r)}function qk(r,e){let t=e?.enc??"hex",i=`${r}_${t}`,n=Ni[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return bc(Fh,i,n,e)}var Nh=A("ZodNumber",(r,e)=>{wv.init(r,e),Pe.init(r,e),r.gt=(i,n)=>r.check(xo(i,n)),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.lt=(i,n)=>r.check(yo(i,n)),r.lte=(i,n)=>r.check(ki(i,n)),r.max=(i,n)=>r.check(ki(i,n)),r.int=i=>r.check(m_(i)),r.safe=i=>r.check(m_(i)),r.positive=i=>r.check(xo(0,i)),r.nonnegative=i=>r.check(kr(0,i)),r.negative=i=>r.check(yo(0,i)),r.nonpositive=i=>r.check(ki(0,i)),r.multipleOf=(i,n)=>r.check(Hs(i,n)),r.step=(i,n)=>r.check(Hs(i,n)),r.finite=()=>r;let t=r._zod.bag;r.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),r.isFinite=!0,r.format=t.format??null});function dE(r){return mA(Nh,r)}var _c=A("ZodNumberFormat",(r,e)=>{_0.init(r,e),Nh.init(r,e)});function m_(r){return vA(_c,r)}function Hk(r){return yA(_c,r)}function Jk(r){return xA(_c,r)}function Qk(r){return wA(_c,r)}function Yk(r){return bA(_c,r)}var kh=A("ZodBoolean",(r,e)=>{oh.init(r,e),Pe.init(r,e)});function pE(r){return AA(kh,r)}var $h=A("ZodBigInt",(r,e)=>{bv.init(r,e),Pe.init(r,e),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.gt=(i,n)=>r.check(xo(i,n)),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.lt=(i,n)=>r.check(yo(i,n)),r.lte=(i,n)=>r.check(ki(i,n)),r.max=(i,n)=>r.check(ki(i,n)),r.positive=i=>r.check(xo(BigInt(0),i)),r.negative=i=>r.check(yo(BigInt(0),i)),r.nonpositive=i=>r.check(ki(BigInt(0),i)),r.nonnegative=i=>r.check(kr(BigInt(0),i)),r.multipleOf=(i,n)=>r.check(Hs(i,n));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function Xk(r){return PA($h,r)}var D_=A("ZodBigIntFormat",(r,e)=>{P0.init(r,e),$h.init(r,e)});function e$(r){return EA(D_,r)}function t$(r){return BA(D_,r)}var hE=A("ZodSymbol",(r,e)=>{S0.init(r,e),Pe.init(r,e)});function r$(r){return FA(hE,r)}var fE=A("ZodUndefined",(r,e)=>{E0.init(r,e),Pe.init(r,e)});function i$(r){return NA(fE,r)}var mE=A("ZodNull",(r,e)=>{B0.init(r,e),Pe.init(r,e)});function gE(r){return kA(mE,r)}var vE=A("ZodAny",(r,e)=>{F0.init(r,e),Pe.init(r,e)});function n$(){return $A(vE)}var yE=A("ZodUnknown",(r,e)=>{N0.init(r,e),Pe.init(r,e)});function Ac(){return MA(yE)}var xE=A("ZodNever",(r,e)=>{k0.init(r,e),Pe.init(r,e)});function I_(r){return DA(xE,r)}var wE=A("ZodVoid",(r,e)=>{$0.init(r,e),Pe.init(r,e)});function o$(r){return IA(wE,r)}var ny=A("ZodDate",(r,e)=>{M0.init(r,e),Pe.init(r,e),r.min=(i,n)=>r.check(kr(i,n)),r.max=(i,n)=>r.check(ki(i,n));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function a$(r){return CA(ny,r)}var bE=A("ZodArray",(r,e)=>{D0.init(r,e),Pe.init(r,e),r.element=e.element,r.min=(t,i)=>r.check(Na(t,i)),r.nonempty=t=>r.check(Na(1,t)),r.max=(t,i)=>r.check(xc(t,i)),r.length=(t,i)=>r.check(wc(t,i)),r.unwrap=()=>r.element});function oy(r,e){return LA(bE,r,e)}function s$(r){let e=r._zod.def.shape;return O_(Object.keys(e))}var ay=A("ZodObject",(r,e)=>{I0.init(r,e),Pe.init(r,e),L.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>O_(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:Ac()}),r.loose=()=>r.clone({...r._zod.def,catchall:Ac()}),r.strict=()=>r.clone({...r._zod.def,catchall:I_()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>L.extend(r,t),r.safeExtend=t=>L.safeExtend(r,t),r.merge=t=>L.merge(r,t),r.pick=t=>L.pick(r,t),r.omit=t=>L.omit(r,t),r.partial=(...t)=>L.partial(z_,r,t[0]),r.required=(...t)=>L.required(U_,r,t[0])});function l$(r,e){let t={type:"object",shape:r??{},...L.normalizeParams(e)};return new ay(t)}function u$(r,e){return new ay({type:"object",shape:r,catchall:I_(),...L.normalizeParams(e)})}function c$(r,e){return new ay({type:"object",shape:r,catchall:Ac(),...L.normalizeParams(e)})}var C_=A("ZodUnion",(r,e)=>{Av.init(r,e),Pe.init(r,e),r.options=e.options});function T_(r,e){return new C_({type:"union",options:r,...L.normalizeParams(e)})}var AE=A("ZodDiscriminatedUnion",(r,e)=>{C_.init(r,e),C0.init(r,e)});function d$(r,e,t){return new AE({type:"union",options:e,discriminator:r,...L.normalizeParams(t)})}var _E=A("ZodIntersection",(r,e)=>{T0.init(r,e),Pe.init(r,e)});function PE(r,e){return new _E({type:"intersection",left:r,right:e})}var SE=A("ZodTuple",(r,e)=>{_v.init(r,e),Pe.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function EE(r,e,t){let i=e instanceof he,n=i?t:e,o=i?e:null;return new SE({type:"tuple",items:r,rest:o,...L.normalizeParams(n)})}var R_=A("ZodRecord",(r,e)=>{R0.init(r,e),Pe.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function BE(r,e,t){return new R_({type:"record",keyType:r,valueType:e,...L.normalizeParams(t)})}function p$(r,e,t){let i=mr(r);return i._zod.values=void 0,new R_({type:"record",keyType:i,valueType:e,...L.normalizeParams(t)})}var FE=A("ZodMap",(r,e)=>{O0.init(r,e),Pe.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function h$(r,e,t){return new FE({type:"map",keyType:r,valueType:e,...L.normalizeParams(t)})}var NE=A("ZodSet",(r,e)=>{V0.init(r,e),Pe.init(r,e),r.min=(...t)=>r.check(Js(...t)),r.nonempty=t=>r.check(Js(1,t)),r.max=(...t)=>r.check(yc(...t)),r.size=(...t)=>r.check(ph(...t))});function f$(r,e){return new NE({type:"set",valueType:r,...L.normalizeParams(e)})}var Eh=A("ZodEnum",(r,e)=>{z0.init(r,e),Pe.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(i,n)=>{let o={};for(let a of i)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Eh({...e,checks:[],...L.normalizeParams(n),entries:o})},r.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Eh({...e,checks:[],...L.normalizeParams(n),entries:o})}});function O_(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(i=>[i,i])):r;return new Eh({type:"enum",entries:t,...L.normalizeParams(e)})}function m$(r,e){return new Eh({type:"enum",entries:r,...L.normalizeParams(e)})}var kE=A("ZodLiteral",(r,e)=>{U0.init(r,e),Pe.init(r,e),r.values=new Set(e.values),Object.defineProperty(r,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function g$(r,e){return new kE({type:"literal",values:Array.isArray(r)?r:[r],...L.normalizeParams(e)})}var $E=A("ZodFile",(r,e)=>{j0.init(r,e),Pe.init(r,e),r.min=(t,i)=>r.check(Js(t,i)),r.max=(t,i)=>r.check(yc(t,i)),r.mime=(t,i)=>r.check(xh(Array.isArray(t)?t:[t],i))});function v$(r){return KA($E,r)}var ME=A("ZodTransform",(r,e)=>{L0.init(r,e),Pe.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new _a(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(L.issue(o,t.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=r),t.issues.push(L.issue(a))}};let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>(t.value=o,t)):(t.value=n,t)}});function V_(r){return new ME({type:"transform",transform:r})}var z_=A("ZodOptional",(r,e)=>{K0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function ey(r){return new z_({type:"optional",innerType:r})}var DE=A("ZodNullable",(r,e)=>{W0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function ty(r){return new DE({type:"nullable",innerType:r})}function y$(r){return ey(ty(r))}var IE=A("ZodDefault",(r,e)=>{Z0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function CE(r,e){return new IE({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var TE=A("ZodPrefault",(r,e)=>{G0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function RE(r,e){return new TE({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var U_=A("ZodNonOptional",(r,e)=>{q0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function OE(r,e){return new U_({type:"nonoptional",innerType:r,...L.normalizeParams(e)})}var VE=A("ZodSuccess",(r,e)=>{H0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function x$(r){return new VE({type:"success",innerType:r})}var zE=A("ZodCatch",(r,e)=>{J0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function UE(r,e){return new zE({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var jE=A("ZodNaN",(r,e)=>{Q0.init(r,e),Pe.init(r,e)});function w$(r){return RA(jE,r)}var j_=A("ZodPipe",(r,e)=>{Y0.init(r,e),Pe.init(r,e),r.in=e.in,r.out=e.out});function ry(r,e){return new j_({type:"pipe",in:r,out:e})}var L_=A("ZodCodec",(r,e)=>{j_.init(r,e),ah.init(r,e)});function b$(r,e,t){return new L_({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var LE=A("ZodReadonly",(r,e)=>{X0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function KE(r){return new LE({type:"readonly",innerType:r})}var WE=A("ZodTemplateLiteral",(r,e)=>{eA.init(r,e),Pe.init(r,e)});function A$(r,e){return new WE({type:"template_literal",parts:r,...L.normalizeParams(e)})}var ZE=A("ZodLazy",(r,e)=>{iA.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.getter()});function GE(r){return new ZE({type:"lazy",getter:r})}var qE=A("ZodPromise",(r,e)=>{rA.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function _$(r){return new qE({type:"promise",innerType:r})}var HE=A("ZodFunction",(r,e)=>{tA.init(r,e),Pe.init(r,e)});function P$(r){return new HE({type:"function",input:Array.isArray(r?.input)?EE(r?.input):r?.input??oy(Ac()),output:r?.output??Ac()})}var sy=A("ZodCustom",(r,e)=>{nA.init(r,e),Pe.init(r,e)});function S$(r){let e=new He({check:"custom"});return e._zod.check=r,e}function E$(r,e){return WA(sy,r??(()=>!0),e)}function JE(r,e={}){return ZA(sy,r,e)}function QE(r){return GA(r)}var B$=qA,F$=HA;function N$(r,e={error:`Input not instance of ${r.name}`}){let t=new sy({type:"custom",check:"custom",fn:i=>i instanceof r,abort:!0,...L.normalizeParams(e)});return t._zod.bag.Class=r,t}var k$=(...r)=>JA({Codec:L_,Boolean:kh,String:Bh},...r);function $$(r){let e=GE(()=>T_([f_(r),dE(),pE(),gE(),oy(e),BE(f_(),e)]));return e}function M$(r,e){return ry(V_(r),e)}var D$={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function I$(r){bt({customError:r})}function C$(){return bt().customError}var K_;K_||(K_={});var W_={};Da(W_,{bigint:()=>V$,boolean:()=>O$,date:()=>z$,number:()=>R$,string:()=>T$});function T$(r){return lA(Bh,r)}function R$(r){return gA(Nh,r)}function O$(r){return _A(kh,r)}function V$(r){return SA($h,r)}function z$(r){return TA(ny,r)}bt(Pv());var YE=kt.object({name:kt.string(),bpm:kt.number(),duration:kt.number(),sample_rate:kt.number(),origin:kt.enum(["openDAW","recording","import"])});var xJ=YE.extend({uuid:w.zType(kt)});var U$,j$,L$,K$,W$,Z$;U$=new WeakMap,j$=new WeakMap,L$=new WeakMap,K$=new WeakMap,W$=new WeakMap,Z$=new WeakMap;var Pc=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},G$,q$,Z_,G_,q_,H$,J$;q$=new WeakMap,Z_=new WeakMap,G_=new WeakMap,q_=new WeakMap,H$=new WeakMap,G$=new WeakSet,J$=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let i=Ne(t.box,pn);I(i.isAttached(),"SelectionBox is not attached");let n=i.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${i.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),o={box:i,selectable:n};Pc(this,q_,"f").proxy.onSelected(n),I(Pc(this,Z_,"f").add(o),"Could not add to entityMap"),I(Pc(this,G_,"f").add(o),"Could not add to selectableMap")},onRemoved:t=>{let i=Ne(t.box,pn),n=Pc(this,Z_,"f").removeByKey(i.address.uuid);I(n.box===i,"Broken selection");let o=n.selectable;Pc(this,q_,"f").proxy.onDeselected(o),Pc(this,G_,"f").removeByKey(o.address)}},u.Selection)};var XE=kt.object({name:kt.string(),size:kt.number().int(),url:kt.string(),license:kt.string(),origin:kt.enum(["openDAW","import"])});var IJ=XE.extend({uuid:w.zType(kt)});var eB;(function(r){r.cut=(e,t,i)=>{if(!(e.position>=t||t>=e.complete))if(zw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;e.duration=t-n,e.copyTo({position:t,duration:o-t,loopOffset:Tc(a+(t-n),s),consolidate:i})}else return F("Not yet implemented")},r.clip=(e,t,i)=>{if(zw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;if(o-i<=0)return F(`duration will zero or negative(${o-i})`);e.duration=t-n,e.copyTo({position:i,duration:o-i,loopOffset:Tc(a+(i-n),s)})}else return F("Not yet implemented")}})(eB||(eB={}));var Sc;(e=>e.create=(t,i,n,o)=>0|(t?1:0)|(i?2:0)|(n?4:0)|(o?8:0))(Sc||={});var Se=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#o=0;#a=0;#l=0;#s=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=R.create(()=>new pl(r.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,i=>{this.#r[0]=this.#o,this.#r[1]=this.#a,this.#r[2]=this.#l,this.#r[3]=this.#s})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#a=0}process(e,t,i=0,n=128){let o=n-i,a=r.PEAK_DECAY**o,s=0,l=0;for(let c=i;c<n;c++){let p=Math.abs(e[c]),d=Math.abs(t[c]);p>s&&(s=p),d>l&&(l=d)}this.#o=Math.max(s,this.#o*a),this.#a=Math.max(l,this.#a*a),this.#l=this.#i[0].processBlock(e,i,n),this.#s=this.#i[1].processBlock(t,i,n)}processStereo([e,t],i=0,n=128){this.process(e,t,i,n)}terminate(){this.#n.terminate()}};var ly=class{#e=new U;#t;#r;#i;#n=g.None;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=new re,this.#o=this.#r.getValue(),this.#e.own(this.#r.subscribe(i=>{this.#o=i.getValue(),this.#i.notify(this)}))}get adapter(){return this.#r}get address(){return this.#r.address}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){I(this.#n.isEmpty(),"Already broadcasting"),this.#n=g.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#o!==t?(this.#o=t,!0):!1}onStopAutomation(){I(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=g.None,this.#o=this.#r.getValue()}own(e){return this.#e.own(e)}ownAll(...e){this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#e.terminate()}};var Ec=class{#e;constructor(){this.#e=new Jh}add(e,t){this.#e.add(e,t)}get(e){return this.#e.get(e)}forEach(e){return this.#e.forEach(e)}clear(){this.#e.clear()}};var ir=class{#e=new U;#t;#r;#i;#n;#o=g.None;constructor(e){this.#t=e,this.#r=new Ec,this.#i=[],this.#n=[]}parameterChanged(e,t){return F(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#t}get eventInput(){return this.#r}bindParameter(e){let t=new ly(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:i=>{this.#o.isEmpty()&&(this.#o=g.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:i=>{R.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(n=>n.terminate()),this.#o=g.None),t.onStopAutomation()}},u.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#n.forEach(i=>{i.updateAutomation(e)&&this.parameterChanged(i,t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e,0))}own(e){return this.#e.own(e)}ownAll(...e){return this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=g.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var Mh;(e=>e.isOfType=t=>t.type==="update-event")(Mh||={});var uy=class extends ir{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>R.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:i,flags:n},o)=>{if(rt.every(n,1))for(let a of sn.iterate(t,i,df)){let s={type:"update-event",position:a};this.#e.forEach(l=>l.add(o,s))}})}toString(){return`{${this.constructor.name}}`}};var De=class extends ir{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,s0:o,s1:a,bpm:s}=t,l=null,c=o;for(let p of this.eventInput.get(i)){let d=p.position-n,f=Math.abs(d)<1e-7?o:o+Math.floor(Q.pulsesToSamples(d,s,sampleRate));I(o<=f&&f<=a,()=>`${f} out of bounds. event: ${p.position} (${p.type}), p0: ${n}`),l?.forEach(v=>this.handleEvent(v)),l=null,c<f&&(this.processAudio(t,c,f),c=f),Mh.isOfType(p)?this.updateParameters(p.position,o/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p)}l?.forEach(p=>this.handleEvent(p)),l=null,c<a&&this.processAudio(t,c,a)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return F(`${this} received an event but has no accepting method.`)}finishProcess(){}};var cy=class r{static#e=S.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#a=0;#l=0;#s=0;#u=0;#c=0;#d=!1;#p=!1;constructor(e,t){let i=_o(e);this.#t=i,this.#r=[new Float32Array(i),new Float32Array(i)],this.#i=[new Pt,new Pt],this.#n=new an,this.#o=t}reset(){this.#l=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#p=!1),this.#m()}set offset(e){I(0<=e&&e<this.#t,"Out of bounds"),this.#u!==e&&(this.#u=e,this.#d?this.#y():this.#m())}get offset(){return this.#u}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#e.y(e)):e<0&&this.#n.setLowpassParams(r.#e.y(1+e))}process(e,t,i,n){this.#p?this.#f(e,t,i,n):this.#h(e,t,i,n),this.#d=!0}#h(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,c=this.dry,p=this.#l,d=p-Math.floor(this.#s);d<0&&(d+=this.#t);let f=e[0],v=e[1],m=t[0],y=t[1],x=this.#i[0],D=this.#i[1],M=a[0],O=a[1];for(let T=i;T<n;++T){let V=f[T],Y=v[T],te=x.processFrame(this.#n,M[d]*.96),q=D.processFrame(this.#n,O[d]*.96),ge=this.cross*(q-te),se=te+ge,Re=q-ge;M[p]=(V+se)*s+1e-18-1e-18,O[p]=(Y+Re)*s+1e-18-1e-18,m[T]=se*l+V*c,y[T]=Re*l+Y*c,d=++d&o,p=++p&o}this.#l=p}#f(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,c=this.dry,p=this.#l;for(let d=i;d<n;++d){0<this.#c?(this.#s+=this.#a,this.#c--):(this.#s=this.#u,this.#p=!1);let f=p-this.#s;f<0&&(f+=this.#t);let v=f|0,m=f-v,y=e[0][d],x=e[1][d],D=a[0][v],M=a[0][v],O=this.#i[0].processFrame(this.#n,D+m*(a[0][v+1&o]-D)),T=this.#i[1].processFrame(this.#n,M+m*(a[1][v+1&o]-M));a[0][p]=y+O*s+1e-18-1e-18,a[1][p]=x+O*s+1e-18-1e-18,t[0][d]=O*l+y*c,t[1][d]=T*l+x*c,p=++p&o}this.#l=p}#m(){this.#s=this.#u,this.#c=0,this.#p=!1}#y(){this.#u!==this.#s&&(this.#c=this.#o,this.#a=(this.#u-this.#s)/this.#c,this.#p=!0)}};var dy=class r extends De{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=g.None;#a=!0;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address));let{delay:i,feedback:n,cross:o,filter:a,dry:s,wet:l}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(i)),this.parameterFeedback=this.own(this.bindParameter(n)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(a)),this.parameterDry=this.own(this.bindParameter(s)),this.parameterWet=this.own(this.bindParameter(l));let c=Q.pulsesToSamples(or.toPPQN(ci.OffsetFractions[0]),30,sampleRate),p=Math.floor(.5*sampleRate);this.#n=new cy(c,p),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#n.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},i,n){if(this.#o.isEmpty())return;if(this.#a||rt.some(t,8)){let a=this.parameterDelay.getValue(),s=or.toPPQN(ci.OffsetFractions[a]);this.#n.offset=Q.pulsesToSamples(s,e,sampleRate),this.#a=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),i,n),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),i,n)}parameterChanged(e){e===this.parameterDelay?this.#a=!0:e===this.parameterFeedback?this.#n.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#n.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#n.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#n.dry=Oe(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=Oe(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Dh=class r extends ir{static ID=0;#e=r.ID++;#t;#r;#i;#n=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=g.wrap(e),{terminate:()=>this.#n=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[i,n]=t.channels(),[o,a]=this.#r.channels();for(let s=0;s<128;s++)o[s]=i[s],a[s]=n[s];this.#i.process(o,a)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var Bc=class r extends ir{static ID=0;#e=r.ID++;#t;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return g.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#t.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{R.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,i]=this.#r.channels();for(let n of this.#n){let[o,a]=n.channels();for(let s=0;s<128;s++)t[s]+=o[s],i[s]+=a[s]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var ye;(s=>{s.Comparator=(l,c)=>{let p=l.position-c.position;return p!==0?p:l.type==="note-complete-event"?-1:c.type==="note-complete-event"?1:0},s.start=(l,c,p,d,f=0)=>({type:"note-event",position:l,duration:c,pitch:p,velocity:d,cent:f,id:++a}),s.startWith=(l,c,p)=>({type:"note-event",position:c??l.position,duration:p??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++a}),s.stop=({id:l,pitch:c},p)=>({type:"note-complete-event",position:p,pitch:c,id:l}),s.isStart=l=>l.type==="note-event"&&"id"in l&&typeof l.id=="number",s.isStop=l=>l.type==="note-complete-event";let a=0})(ye||={});var Vn=class{#e=new U;#t;#r;#i;#n=g.None;constructor(e,t,i){this.#t=e,this.#r=this.#e.own(new Bi(t,i)),this.#i=new Array(16)}setNoteEventSource(e){return I(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=g.wrap(e),this.#t.reset(),K.create(()=>{this.#n=g.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:i,flags:n}){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().processNotes(t,i,n))this.#i.push(o);this.#i.sort(ye.Comparator).forEach(o=>{o.pitch>=0&&o.pitch<=127&&(this.#t.eventInput.add(e,o),this.#o(o))}),this.#i.length=0}}clear(){}terminate(){this.#e.terminate()}#o(e){ye.isStart(e)?this.#r.noteOn(e.pitch):ye.isStop(e)&&this.#r.noteOff(e.pitch)}};var H_;(e=>e.NotSet={start:()=>F("VoicingStrategy.start"),stop:()=>F("VoicingStrategy.stop"),forceStop:()=>jn,process:()=>F("VoicingStrategy.process"),reset:jn,processing:()=>R.empty()})(H_||={});var py=class{#e;#t=[];constructor(e=H_.NotSet){this.#e=e}set strategy(e){this.#t.push(this.#e),this.#e.forceStop(),this.#e=e}get strategy(){return this.#e}start(e){this.#e.start(e)}stop(e){this.#e.stop(e)}process(e,t,i,n){this.#e.process(e,t,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var hy=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let o=0;o<this.#r.length;o++){let a=this.#r[o];if(!a.gate){t=a.currentFrequency,this.#r.splice(o,1);break}}let i=this.#e.computeFrequency(e),n=this.#e.create();isNaN(t)?n.start(e,i,1,0):(n.start(e,t,1,0),n.startGlide(i,this.#e.glideTime)),this.#r.push(n),this.#t.push(n)}stop(e){this.#t.find(t=>t.id===e)?.stop()}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#t.length=0,this.#r.length=0}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(R.removeIf(this.#r,s=>s===a),this.#t.splice(o,1))}return this.#t.length===0}processing(){return this.#t}};var fy=class{#e;#t=[];#r=[];#i=null;#n=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),Z(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}Z(this.#n)&&this.#n.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#n=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(i=>i.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let i=this.#r.at(-1);if(Z(i)){this.#i.startGlide(this.#e.computeFrequency(i),this.#e.glideTime);return}}this.#r.length===0&&(this.#i.stop(),this.#i=null)}}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#r.length=0,this.#t.length=0,this.#i=null,this.#n=null}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(this.#t.splice(o,1),a===this.#i&&(this.#i=null),a===this.#n&&(this.#n=null))}return this.#t.length===0}processing(){return this.#t}};var Ih=class{#e;#t=[];#r=new dl;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,i,n){if(this.id=e.id,this.#r.init(t),this.#i===1){let o=this.#e();o.start(e,t,i,n),this.#t.push(o)}else for(let o=0;o<this.#i;++o){let a=o/(this.#i-1)*2-1,s=this.#e(),l=(1-Math.abs(n))*a+n;s.start(e,t,i/Math.sqrt(this.#i),l),this.#t.push(s)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(i=>i.startGlide(e,t))}process(e,t,i,n){this.#r.advance(t.bpm,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1);return this.#t.length===0}stop(){this.#t.forEach(e=>e.stop()),this.gate=!1}forceStop(){this.#t.forEach(e=>e.forceStop()),this.gate=!1}processing(){return this.#t}};var[tB,rB,J_,iB,nB,my,oB,aB,gy]=bP(Float32Array,128),Ch=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Ta("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new Kc(sampleRate),this.oscB=new Kc(sampleRate),this.lfo=new of(sampleRate),this.filter=new Qh(Mn.MIN_CUTOFF,Mn.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new ll(sampleRate),this.env.set(this.device.env_attack,this.device.env_decay,this.device.env_sustain,this.device.env_release),this.env.gateOn(),this.glide=new dl,this.gainASmooth=new Di(.003,sampleRate),this.gainBSmooth=new Di(.003,sampleRate),this.gainVcaSmooth=new Di(.003,sampleRate)}start(e,t,i,n){this.#e=e,this.#t=i,this.#r=n,this.filter_keyboard_delta=af.keyboardTracking(e.pitch,this.device.parameterFilterKeyboard.getValue()),this.glide.init(t)}stop(){this.env.gateOff()}forceStop(){this.env.forceStop()}startGlide(e,t){this.glide.glideTo(e,t)}get gate(){return this.env.gate}get currentFrequency(){return this.glide.currentFrequency()}process(e,{bpm:t},i,n){let{gainOscA:o,gainOscB:a,oscA_waveform:s,oscB_waveform:l,flt_cutoff:c,flt_resonance:p,flt_env_amount:d,flt_order:f,frequencyAMultiplier:v,frequencyBMultiplier:m,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:D,parameterLfoTargetCutoff:M,parameterLfoTargetVolume:O,parameterUnisonDetune:T,parameterUnisonStereo:V}=this.device,Y=ul(this.#e.velocity)*this.#t,te=2**(this.#r*(T.getValue()/1200)),q=this.#r*V.getValue(),[ge,se]=Gn.panningToGains(q,ln.Linear),[Re,Ze]=e.channels();J_.fill(te,i,n),this.glide.process(J_,t,i,n),this.lfo.fill(oB,y.getValue(),x.getValue(),i,n),this.env.process(my,i,n);let be=D.getValue(),Ge=M.getValue(),je=O.getValue();for(let xe=i;xe<n;xe++){let Qe=oB[xe];aB[xe]=c+this.filter_keyboard_delta+my[xe]*d+Qe*Ge,my[xe]*=Qr(Y+Qe*je);let Dr=J_[xe]*2**(Qe*be);iB[xe]=Dr*v,nB[xe]=Dr*m}this.oscA.generateFromFrequencies(tB,iB,s,i,n),this.oscB.generateFromFrequencies(rB,nB,l,i,n);for(let xe=i;xe<n;xe++)gy[xe]=tB[xe]*this.gainASmooth.process(o)+rB[xe]*this.gainBSmooth.process(a);this.filter.order=f,this.filter.process(gy,gy,aB,p,i,n);for(let xe=i;xe<n;xe++){let Qe=this.gainVcaSmooth.process(Qr(my[xe])),Dr=gy[xe]*Qe;if(Re[xe]+=Dr*ge,Ze[xe]+=Dr*se,this.env.complete&&Qe<1e-4)return!0}return!1}};var vy=class extends De{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#y;#g;#A;#B;#F;#P;#k;#v;#x;#w;#E;#N;#S;#_;#$;#M;#D;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Le.sine;oscB_waveform=Le.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#I=0;constructor(e,t){super(e),this.#e=t,this.#t=new py,this.#r=new Vn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ve,this.#n=new uf(sampleRate),this.#o=this.own(new Se(e.broadcaster,t.address));let{namedParameter:i}=this.#e,{oscillators:n}=i;this.#a=this.own(this.bindParameter(n[0].waveform)),this.#l=this.own(this.bindParameter(n[0].octave)),this.#s=this.own(this.bindParameter(n[0].tune)),this.#u=this.own(this.bindParameter(n[0].volume)),this.#c=this.own(this.bindParameter(n[1].waveform)),this.#d=this.own(this.bindParameter(n[1].octave)),this.#p=this.own(this.bindParameter(n[1].tune)),this.#h=this.own(this.bindParameter(n[1].volume)),this.#f=this.own(this.bindParameter(i.attack)),this.#m=this.own(this.bindParameter(i.decay)),this.#y=this.own(this.bindParameter(i.sustain)),this.#g=this.own(this.bindParameter(i.release)),this.#A=this.own(this.bindParameter(i.cutoff)),this.#B=this.own(this.bindParameter(i.resonance)),this.#F=this.own(this.bindParameter(i.filterEnvelope)),this.#P=this.own(this.bindParameter(i.filterOrder)),this.#k=this.own(this.bindParameter(i.filterKeyboard)),this.#v=this.own(this.bindParameter(i.glideTime)),this.#x=this.own(this.bindParameter(i.voicingMode)),this.#w=this.own(this.bindParameter(i.unisonCount)),this.#E=this.own(this.bindParameter(i.unisonDetune)),this.#N=this.own(this.bindParameter(i.unisonStereo)),this.#S=this.own(this.bindParameter(i.lfoWaveform)),this.#_=this.own(this.bindParameter(i.lfoRate)),this.#$=this.own(this.bindParameter(i.lfoTargetTune)),this.#M=this.own(this.bindParameter(i.lfoTargetCutoff)),this.#D=this.own(this.bindParameter(i.lfoTargetVolume));let o=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),o,a=>{if(!a)return;let s=0;this.#t.strategy.processing().forEach(l=>{let p=Ne(l,Ih).processing().at(0);p instanceof Ch&&(o[s++]=p.env.phase),o.length-1}),o[s]=-1}),e.registerProcessor(this)),this.readAllParameters()}computeFrequency(e){return Uc(e.pitch+e.cent/100,440)}get glideTime(){return this.#I}get parameterFilterKeyboard(){return this.#k}get parameterLfoShape(){return this.#S}get parameterLfoRate(){return this.#_}get parameterLfoTargetTune(){return this.#$}get parameterLfoTargetCutoff(){return this.#M}get parameterLfoTargetVolume(){return this.#D}get parameterUnisonDetune(){return this.#E}get parameterUnisonStereo(){return this.#N}create(){return new Ih(()=>new Ch(this),this.#w.getValue())}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.clear(),this.#t.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){ye.isStart(e)?this.#t.start(e):ye.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,i){this.#t.process(this.#i,e,t,i),this.#n.replace(this.#i,t,i)}parameterChanged(e){if(e===this.#u)this.gainOscA=Oe(this.#u.getValue());else if(e===this.#h)this.gainOscB=Oe(this.#h.getValue());else if(e===this.#l||e===this.#s)this.frequencyAMultiplier=2**(this.#l.getValue()+this.#s.getValue()/1200);else if(e===this.#d||e===this.#p)this.frequencyBMultiplier=2**(this.#d.getValue()+this.#p.getValue()/1200);else if(e===this.#f)this.env_attack=this.#f.getValue();else if(e===this.#m)this.env_decay=this.#m.getValue();else if(e===this.#y)this.env_sustain=this.#y.getValue();else if(e===this.#g)this.env_release=this.#g.getValue();else if(e===this.#a)this.oscA_waveform=Jr(this.#a.getValue(),Le);else if(e===this.#c)this.oscB_waveform=Jr(this.#c.getValue(),Le);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#B)this.flt_resonance=this.#B.getValue();else if(e===this.#F)this.flt_env_amount=this.#F.getValue();else if(e===this.#P)this.flt_order=this.#P.getValue();else if(e===this.#v)this.#I=this.#v.getValue()*Q.Bar;else if(e===this.#x){let t=this.#x.getValue();switch(t){case dn.Monophonic:{this.#t.strategy=new fy(this);return}case dn.Polyphonic:{this.#t.strategy=new hy(this);return}default:return F(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var $a=class{#e;#t;#r;#i;#n;#o;#a=0;#l;#s;#u=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#l=n,this.#o=o,this.#s=a,this.#o>=t.numberOfFrames?(this.#i=2,this.#n=0):o===0?(this.#i=1,this.#n=0):(this.#i=0,this.#n=1)}get readPosition(){return this.#o}done(){return this.#i===2}isFadingOut(){return this.#i===0&&this.#n<0}startFadeOut(e){this.#i!==2&&!(this.#i===0&&this.#n<0)&&(this.#i=0,this.#n=-1,this.#a=0,this.#u=e)}setPlaybackRate(e){this.#l=e}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#r,p=this.#l,d=a-c*p,f=this.#s,v=this.#u,m=this.#i,y=this.#n,x=this.#o,D=this.#a;for(let M=0;M<t&&m!==2;M++){if(M<f)continue;let O=e+M,T;if(m===0&&y>0)T=D/c,++D>=c&&(m=1,D=0,y=0);else if(m===0&&y<0){if(M<v)T=1;else if(T=1-D/c,++D>=c){m=2;break}}else T=1;let V=x|0;if(V>=0&&V<a-1){let Y=x-V,te=s[V],q=l[V];i[O]+=(te+Y*(s[V+1]-te))*T,n[O]+=(q+Y*(l[V+1]-q))*T}x+=p,m===1&&x>=d&&(m=0,y=-1,D=0)}this.#i=m,this.#n=y,this.#o=x,this.#a=D,this.#s=0,this.#u=0}};var Fc=class{#e;#t;#r;#i;#n;#o;#a=1;#l=0;#s=0;#u=0;#c=0;#d=0;constructor(e,t,i,n,o,a,s){this.#e=e,this.#t=t,this.#r=o,this.#o=n,this.#i=Math.round(.02*s),this.#n=1/this.#i,this.#u=i,this.#c=a,this.#d=0,i>0?(this.#a=0,this.#l=1,this.#s=0):(this.#a=1,this.#l=0,this.#s=0)}done(){return this.#a===2}isFadingOut(){return this.#a===0&&this.#l<0}readPosition(){return this.#u}segmentEnd(){return this.#o}setSegmentEnd(e){this.#o=e}startFadeOut(e){if(this.#a!==2&&!(this.#a===0&&this.#l<0)){if(this.#a===0&&this.#l>0){let t=this.#s*this.#n;this.#s=this.#i*(1-t)}else this.#s=0;this.#a=0,this.#l=-1,this.#d=e}}process(e,t){if(this.#a===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#o,p=this.#i,d=this.#n,f=this.#r,v=this.#d,m=this.#a,y=this.#l,x=this.#s,D=this.#u;for(let M=this.#c;M<t&&m!==2;M++){let O=e+M,T;if(m===0){if(y>0)T=x*d,x+=1,x>=p&&(m=1,x=0,y=0);else if(M<v)T=1;else if(T=1-x*d,x+=1,x>=p){m=2;break}}else T=1;let V=D|0;if(V>=0&&V<a-1){let Y=D-V,te=s[V],q=l[V];i[O]+=(te+Y*(s[V+1]-te))*T,n[O]+=(q+Y*(l[V+1]-q))*T}D+=f}this.#a=m,this.#l=y,this.#s=x,this.#u=D,this.#c=0,this.#d=0}};var yy=class{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=1;#d=0;#p=0;#h=0;#f=0;#m=0;#y=0;#g=0;constructor(e,t,i,n,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#u=n;let c=.01*s,p=.02*s;this.#i=i+c,this.#n=n-p,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#l=Math.round(.01*s),this.#s=1/this.#l,this.#h=l??i,this.#y=a,this.#g=0,this.#f=0,this.#m=0,l!==void 0||i>0?(this.#c=0,this.#d=1,this.#p=0):(this.#c=1,this.#d=0,this.#p=0),this.#i>=this.#n&&(this.#c=2)}done(){return this.#c===2}isFadingOut(){return this.#c===0&&this.#d<0}readPosition(){return this.#h}segmentEnd(){return this.#u}setSegmentEnd(e){this.#u=e}startFadeOut(e){if(this.#c!==2&&!(this.#c===0&&this.#d<0)){if(this.#c===0&&this.#d>0){let t=this.#p*this.#a;this.#p=this.#o*(1-t)}else this.#p=0;this.#c=0,this.#d=-1,this.#g=e}}process(e,t){if(this.#c===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#i,d=this.#n-this.#l,f=this.#o,v=this.#a,m=this.#l,y=this.#s,x=this.#r,D=this.#g,M=this.#c,O=this.#d,T=this.#p,V=this.#h,Y=this.#f,te=this.#m;for(let q=this.#y;q<t&&M!==2;q++){let ge=e+q,se;if(M===0){if(O>0)se=T*v,T+=1,T>=f&&(M=1,T=0,O=0);else if(q<D)se=1;else if(se=1-T*v,T+=1,T>=f){M=2;break}}else se=1;let Re=0,Ze=0,be=V|0;if(be>=0&&be<a-1){let Ge=V-be,je=s[be],xe=l[be];Re=je+Ge*(s[be+1]-je),Ze=xe+Ge*(l[be+1]-xe)}if(Y===0&&V>=d&&(Y=1,te=c),Y>0){let Ge=te|0;if(Ge>=0&&Ge<a-1){let je=te-Ge,xe=s[Ge],Qe=l[Ge],Dr=xe+je*(s[Ge+1]-xe),Ys=Qe+je*(l[Ge+1]-Qe),Ao=Y*y;Re=Re*(1-Ao)+Dr*Ao,Ze=Ze*(1-Ao)+Ys*Ao}te+=x,Y+=1,Y>=m&&(V=te,Y=0)}i[ge]+=Re*se,n[ge]+=Ze*se,V+=x}this.#c=M,this.#d=O,this.#p=T,this.#h=V,this.#f=Y,this.#m=te,this.#y=0,this.#g=0}};var Th=class{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u=1;#c=0;#d=0;#p=0;#h=1;#f=0;#m=0;#y=0;#g=0;constructor(e,t,i,n,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#s=n;let c=.01*s,p=.02*s;this.#i=i+c,this.#n=n-p,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#l=Math.round(.01*s),this.#p=l?.position??i,this.#h=l?.direction??1,this.#y=a,this.#g=0,this.#f=0,this.#m=0,l!==void 0||i>0?(this.#u=0,this.#c=1,this.#d=0):(this.#u=1,this.#c=0,this.#d=0),this.#i>=this.#n&&(this.#u=2)}done(){return this.#u===2}isFadingOut(){return this.#u===0&&this.#c<0}readPosition(){return this.#p}segmentEnd(){return this.#s}setSegmentEnd(e){this.#s=e}startFadeOut(e){if(this.#u!==2&&!(this.#u===0&&this.#c<0)){if(this.#u===0&&this.#c>0){let t=this.#d*this.#a;this.#d=this.#o*(1-t)}else this.#d=0;this.#u=0,this.#c=-1,this.#g=e}}process(e,t){if(this.#u===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#i,p=this.#n,d=p-this.#l,f=c+this.#l,v=this.#o,m=this.#a,y=this.#l,x=this.#r,D=this.#g,M=this.#u,O=this.#c,T=this.#d,V=this.#p,Y=this.#h,te=this.#f,q=this.#m;for(let ge=this.#y;ge<t&&M!==2;ge++){let se=e+ge,Re;if(M===0){if(O>0)Re=T*m,T+=1,T>=v&&(M=1,T=0,O=0);else if(ge<D)Re=1;else if(Re=1-T*m,T+=1,T>=v){M=2;break}}else Re=1;let Ze=0,be=0,Ge=V|0;if(Ge>=0&&Ge<a-1){let je=V-Ge,xe=s[Ge],Qe=l[Ge];Ze=xe+je*(s[Ge+1]-xe),be=Qe+je*(l[Ge+1]-Qe)}if(te===0&&(Y>0&&V>=d?(te=1,q=p):Y<0&&V<=f&&(te=1,q=c)),te>0){let je=q|0;if(je>=0&&je<a-1){let xe=q-je,Qe=s[je],Dr=l[je],Ys=Qe+xe*(s[je+1]-Qe),Ao=Dr+xe*(l[je+1]-Dr),zh=te/y,Uh=Math.cos(zh*Math.PI*.5),zn=Math.sin(zh*Math.PI*.5);Ze=Ze*Uh+Ys*zn,be=be*Uh+Ao*zn}q-=Y*x,te+=1,te>=y&&(V=q,Y=-Y,te=0)}i[se]+=Ze*Re,n[se]+=be*Re,V+=Y*x}this.#u=M,this.#c=O,this.#d=T,this.#p=V,this.#h=Y,this.#f=te,this.#m=q,this.#y=0,this.#g=0}};var xy=class{#e=[];#t=-1;#r=0;constructor(){}get voiceCount(){return this.#e.length}reset(){for(let e of this.#e)e.startFadeOut(0);this.#t=-1,this.#r=0}process(e,t,i,n,o,a,s){let{p0:l,p1:c,bpm:p,flags:d}=a,f=n.warpMarkers,v=n.transientPlayMode,m=n.playbackRate,{sampleRate:y,numberOfFrames:x}=t,D=x/y;rt.some(d,2)&&this.reset();let M=c-l,O=a.s0,V=a.s1-O,Y=(s.resultStart-l)/M,te=(s.resultEnd-l)/M,q=O+V*Y|0,se=(O+V*te|0)-q,Re=f.first(),Ze=f.last();if(!At(Re)||!At(Ze))return;let be=s.resultStart-s.rawStart;if(be<Re.position||be>=Ze.position)return;let Ge=be+M,je=this.#o(Ge,f);if(!At(je))return;let xe=je+o;if(xe<0||xe>=D)return;let Qe=this.#o(be,f)??0,Dr=je-Qe,Ys=M/(960*p/60),Ao=Ys>0?Dr/Ys:1,zh=.02*Ao*m*(t.sampleRate/y),Uh=xe+zh,zn=i.floorLastIndex(Uh);if(zn<this.#t&&this.reset(),zn>this.#t&&zn>=0){let zt=i.optAt(zn);At(zt)&&(this.#i(e,t,i,f,v,m,o,p,y,zn,zt.position),this.#t=zn)}for(let zt of this.#e){if(!(zt instanceof Fc)||zt.done()||zt.isFadingOut())continue;let yx=zt.readPosition(),uP=zt.segmentEnd();if(yx>=uP){zt.startFadeOut(0);continue}if(v!==ko.Once){let jh=this.#n(i,this.#t,t);if(At(jh)){let{startSamples:dP,endSamples:pP,hasNext:dB,nextTransientFileSeconds:pB}=jh,hP=pP-dP,fP=Number.POSITIVE_INFINITY;if(dB){let Mc=i.optAt(this.#t);if(At(Mc)){let hB=Mc.position-o,fB=this.#a(hB,f),mB=pB-o,gB=this.#a(mB,f)-fB;fP=Q.pulsesToSeconds(gB,p)*y}}let mP=fP*m,gP=hP/mP;if(!(gP>=.99&&gP<=1.01)&&mP>hP){zt.startFadeOut(0);let Mc=this.#l(e,t,dP,pP,m,0,y,v,!0,yx);At(Mc)&&this.#e.push(Mc);continue}}}let cP=(uP-yx)/m;if(cP<se){let jh=Math.max(0,Math.floor(cP));zt.startFadeOut(jh)}}for(let zt of this.#e)zt.process(q,se);for(let zt=this.#e.length-1;zt>=0;zt--)this.#e[zt].done()&&this.#e.splice(zt,1)}#i(e,t,i,n,o,a,s,l,c,p,d){let f=this.#n(i,p,t);if(!At(f))return;let{startSamples:v,endSamples:m,hasNext:y,nextTransientFileSeconds:x}=f,D=m-v,M=Number.POSITIVE_INFINITY;if(y){let be=d-s,Ge=this.#a(be,n),je=x-s,Qe=this.#a(je,n)-Ge;M=Q.pulsesToSeconds(Qe,l)*c}let O=.02*c,T=.02*t.sampleRate*a,V=null;for(let be of this.#e){if(be.done()||!(be instanceof Fc))continue;let je=be.readPosition()+T-v;if(!(Math.abs(je)>=O)){this.#r+=je,Math.abs(this.#r)<O?(V=be,be.setSegmentEnd(m)):this.#r=0;break}}if(At(V)){for(let be of this.#e)be!==V&&!be.done()&&be.startFadeOut(0);return}for(let be of this.#e)be.done()||be.startFadeOut(0);let Y=M*a,te=D/Y,ge=!(te>=.99&&te<=1.01)&&Y>D,se=.02*t.sampleRate*a,Re=p===0?v:Math.max(0,v-se),Ze=this.#l(e,t,Re,m,a,0,c,o,ge);At(Ze)&&this.#e.push(Ze),this.#r=0}#n(e,t,i){let n=e.optAt(t);if(!At(n))return null;let o=e.optAt(t+1);return{startSamples:n.position*i.sampleRate,endSamples:At(o)?o.position*i.sampleRate:i.numberOfFrames,hasNext:At(o),nextTransientFileSeconds:At(o)?o.position:Number.POSITIVE_INFINITY}}#o(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),o=t.optAt(i+1);if(!(!At(n)||!At(o))&&e>=n.position&&e<o.position){let a=(e-n.position)/(o.position-n.position);return n.seconds+a*(o.seconds-n.seconds)}}return null}#a(e,t){for(let n=0;n<t.length()-1;n++){let o=t.optAt(n),a=t.optAt(n+1);if(!(!At(o)||!At(a))&&e>=o.seconds&&e<a.seconds){let s=(e-o.seconds)/(a.seconds-o.seconds);return o.position+s*(a.position-o.position)}}let i=t.last();return At(i)&&e>=i.seconds?i.position:0}#l(e,t,i,n,o,a,s,l,c,p){return i>=n?null:l===ko.Once||!c?new Fc(e,t,i,n,o,a,s):l===ko.Repeat?new yy(e,t,i,n,o,a,s,p):Z(p)?new Th(e,t,i,n,o,a,s,{position:p,direction:1}):new Th(e,t,i,n,o,a,s)}};var wy=class extends ir{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new ve(2),this.#r=this.own(new Se(e.broadcaster,t.address)),this.#i=w.newSet(({adapter:{uuid:i}})=>i),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:i=>this.#i.add({adapter:i,voices:[],sequencer:new xy}),onRemove:i=>this.#i.removeByKey(i.uuid),onReorder:i=>{}}),e.registerProcessor(this))}get noteEventTarget(){return g.None}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#i.forEach(e=>{e.voices=[],e.sequencer.reset()})}process({blocks:e}){this.#t.clear(0,128),this.#i.forEach(n=>e.forEach(o=>this.#n(n,o))),this.#t.assertSanity();let[t,i]=this.#t.channels();this.#r.process(t,i)}parameterChanged(e){}#n(e,t){let{adapter:i}=e;if(i.type!==ie.Audio||!i.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.sequencer.reset();return}let{p0:n,p1:o,flags:a}=t;if(!rt.every(a,5))return;let s=this.context.clipSequencing.iterate(i.uuid,n,o);for(let{optClip:l,sectionFrom:c,sectionTo:p}of s)l.match({none:()=>{for(let d of i.regions.collection.iterateRange(n,o)){if(d.mute||!Ie(d,Jo))continue;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.waveformOffset.getValue(),y=d.asPlayModeTimeStretch;if(y.nonEmpty()){let x=f.transients;if(x.length()<2)return;for(let D of qt.locateLoops(d,n,o)){let M=y.unwrap();this.#l(e,t,D,v.unwrap(),M,x,m)}}else for(let x of qt.locateLoops(d,n,o))this.#o(e,t,x,d,v.unwrap())}},some:d=>{if(!Ie(d,io))return;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.asPlayModeTimeStretch;if(m.nonEmpty()){let y=m.unwrap(),x=f.transients;if(x.length()<2)return;for(let D of qt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#l(e,t,D,v.unwrap(),y,x,d.waveformOffset.getValue())}else for(let y of qt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#o(e,t,y,d,v.unwrap())}})}#o(e,t,i,n,o){let{p0:a,p1:s,s0:l,s1:c,flags:p}=t,d=c-l,f=s-a,v=(i.resultStart-a)/f,m=(i.resultEnd-a)/f,y=l+d*v,x=l+d*m,D=x-y|0,M=n.waveformOffset.getValue();I(l<=y&&x<=c,()=>`Out of bounds ${y}, ${x}`),rt.some(p,2)&&(e.voices.forEach(T=>T.startFadeOut(0)),e.sequencer.reset());let O=n.asPlayModePitchStretch;if(O.isEmpty()||n.observableOptPlayMode.isEmpty()){let T=o.numberOfFrames,Y=(i.resultEndValue-i.resultStartValue)*T,te=(i.resultEnd-i.resultStart)/f*d,q=Y/te,ge=i.resultStartValue*o.numberOfFrames+M*o.sampleRate;this.#a(e,o,q,ge,0)}else{let V=O.unwrap().warpMarkers,Y=V.first(),te=V.last();if(Y===null||te===null){e.voices.forEach(Ze=>Ze.startFadeOut(0));return}let q=i.resultStart-i.rawStart;if(q<Y.position||q>=te.position){e.voices.forEach(Ze=>Ze.startFadeOut(0));return}let ge=this.#u(q,i.resultStartValue,V),se=this.#s(q,V,o.sampleRate,f,d),Re=(ge+M)*o.sampleRate;this.#a(e,o,se,Re,0)}for(let T of e.voices)T.process(y|0,D);e.voices=e.voices.filter(T=>!T.done())}#a(e,t,i,n,o){let a=Math.round(.02*t.sampleRate);if(e.voices.length===0)e.voices.push(new $a(this.#t,t,a,i,n,o));else{let s=!1;for(let l of e.voices)if(l instanceof $a){if(l.isFadingOut())continue;Math.abs(l.readPosition-n)>a?l.startFadeOut(o):(l.setPlaybackRate(i),s=!0)}else l.startFadeOut(o);s||e.voices.push(new $a(this.#t,t,a,i,n,o))}}#l(e,t,i,n,o,a,s){for(let l of e.voices)l instanceof $a&&l.startFadeOut(0);e.sequencer.process(this.#t,n,a,o,s,t,i),e.voices=e.voices.filter(l=>l instanceof $a&&!l.done())}#s(e,t,i,n,o){let a=t.floorLastIndex(e),s=t.optAt(a),l=t.optAt(a+1);if(s===null||l===null)return 1;let c=l.position-s.position,f=(l.seconds-s.seconds)*i/c,v=o/n;return f/v}#u(e,t,i){let n=i.floorLastIndex(e),o=i.optAt(n),a=i.optAt(n+1);if(o===null||a===null)return t;let s=(e-o.position)/(a.position-o.position);return o.seconds+s*(a.seconds-o.seconds)}};var Mr=class extends ir{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,p1:o,s0:a,bpm:s}=t,l=null,c=n;for(let p of this.eventInput.get(i))l?.forEach(d=>this.handleEvent(t,d)),l=null,c<p.position&&(this.processEvents(t,c,p.position),c=p.position),Mh.isOfType(p)?this.updateParameters(p.position,a/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p);l?.forEach(p=>this.handleEvent(t,p)),l=null,c<o&&this.processEvents(t,c,o)}),this.eventInput.clear()}introduceBlock(e){}};var Nc;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(i,n)=>n*i.mult+i.add))(Nc||={});var by=Object.freeze([{name:"up",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=t%a,c=Math.floor(t%s/a),p=r[l];return ye.start(i,n,p.pitch+c*12,Nc.apply(o,p.velocity))}},{name:"down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=a-1-t%a,c=e-1-Math.floor(t%s/a),p=r[l];return ye.start(i,n,p.pitch+c*12,Nc.apply(o,p.velocity))}},{name:"up-down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=Math.max(1,s*2-2),c=t%l,p=c<s?c:l-c,d=p%a,f=Math.floor(p/a),v=r[d];return ye.start(i,n,v.pitch+f*12,Nc.apply(o,v.velocity))}}]);var Ay=class extends Mr{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u=Nc.create();#c=g.None;#d=by[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new cl,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#n=this.own(this.bindParameter(t.namedParameter.rate)),this.#o=this.own(this.bindParameter(t.namedParameter.gate)),this.#a=this.own(this.bindParameter(t.namedParameter.repeat)),this.#l=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#s=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return g.wrap(this)}setNoteEventSource(e){return I(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=g.wrap(e),K.create(()=>this.#c=g.None)}*processNotes(e,t,i){if(this.#r.nonEmpty())if(rt.every(i,2))for(let o of this.#r.releaseAll())yield ye.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ye.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let n=this.#c.unwrap();for(let a of n.processNotes(e,t,i));let o=!rt.every(i,1);for(let{position:a,index:s}of sn.iterateWithIndex(e,t,this.#p)){let l=Array.from(n.iterateActiveNotesAt(a,o));if(l.length===0)continue;let c=Math.floor(s/this.#f),p=Math.max(1,Math.floor(this.#p*this.#h)),d=this.#d.run(l,this.#m,c,a,p,this.#u);this.#r.addAndRetain({...d}),yield d}for(let a of this.#r.releaseLinearCompleted(t))yield ye.stop(a,a.position+a.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,ar.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){if(e===this.#i)this.#d=by.at(this.#i.getValue())??by[0];else if(e===this.#n)this.#p=or.toPPQN(Hi.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#h=this.#o.getValue();else if(e===this.#a)this.#f=this.#a.getValue();else if(e===this.#l)this.#m=this.#l.getValue();else if(e===this.#s){let t=this.#s.getValue();t<=0?(this.#u.add=1+t,this.#u.mult=0):(this.#u.add=1-t,this.#u.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var _y=class extends Mr{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Bi(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#n=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#o.isEmpty())for(let n of this.#o.unwrap().processNotes(e,t,i))if(ye.isStart(n)){this.#t.noteOn(n.pitch);let{cent:o,octaves:a,semiTones:s}=this.#e.namedParameter;yield Ir.overwrite(n,{pitch:n.pitch+a.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+o.valueAt(n.position)})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let i of this.#o.unwrap().iterateActiveNotesAt(e,t))if(i.type==="note-event"){let{cent:n,octaves:o,semiTones:a}=this.#e.namedParameter;yield Ir.overwrite(i,{pitch:i.pitch+o.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Py=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#y;#g;#A;#B;#F;#P;#k;#v;#x;#w;#E;#N;#S;#_;#$;#M;#D;#I;#V;#R;#C;#T=g.None;#O=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new Xs,this.#o=new Float32Array(this.#n.numBins()),this.#a=R.create(()=>new an,7),this.#l=[new So(4),new So(4)],this.#s=[new So(4),new So(4)],this.#u=[this.#s,[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],this.#l],this.#c=R.create(()=>!0,7);let i=this.#t.namedParameter;this.#d=this.own(this.bindParameter(i.highPass.enabled)),this.#h=this.own(this.bindParameter(i.highPass.q)),this.#p=this.own(this.bindParameter(i.highPass.frequency)),this.#f=this.own(this.bindParameter(i.highPass.order)),this.#m=this.own(this.bindParameter(i.lowShelf.enabled)),this.#y=this.own(this.bindParameter(i.lowShelf.frequency)),this.#g=this.own(this.bindParameter(i.lowShelf.gain)),this.#A=this.own(this.bindParameter(i.lowBell.enabled)),this.#B=this.own(this.bindParameter(i.lowBell.frequency)),this.#F=this.own(this.bindParameter(i.lowBell.gain)),this.#P=this.own(this.bindParameter(i.lowBell.q)),this.#k=this.own(this.bindParameter(i.midBell.enabled)),this.#v=this.own(this.bindParameter(i.midBell.frequency)),this.#x=this.own(this.bindParameter(i.midBell.gain)),this.#w=this.own(this.bindParameter(i.midBell.q)),this.#E=this.own(this.bindParameter(i.highBell.enabled)),this.#N=this.own(this.bindParameter(i.highBell.frequency)),this.#S=this.own(this.bindParameter(i.highBell.gain)),this.#_=this.own(this.bindParameter(i.highBell.q)),this.#$=this.own(this.bindParameter(i.highShelf.enabled)),this.#M=this.own(this.bindParameter(i.highShelf.frequency)),this.#D=this.own(this.bindParameter(i.highShelf.gain)),this.#I=this.own(this.bindParameter(i.lowPass.enabled)),this.#V=this.own(this.bindParameter(i.lowPass.frequency)),this.#R=this.own(this.bindParameter(i.lowPass.q)),this.#C=this.own(this.bindParameter(i.lowPass.order)),this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.spectrum,this.#o,n=>{this.#O=n,n&&(this.#o.set(this.#n.bins()),this.#n.decay=!0)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#u.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#T=g.wrap(e),{terminate:()=>this.#T=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#T.isEmpty())return;let[n,o]=this.#r.channels(),a=this.#T.unwrap();if(this.#c.some(s=>s)){let[s,l]=a.channels();this.#a.forEach((c,p)=>{if(this.#c[p]){let[d,f]=this.#u[p];d.process(c,s,n,t,i),f.process(c,l,o,t,i),s=n,l=o}})}else{let[s,l]=a.channels();for(let c=t;c<i;c++)n[c]=s[c],o[c]=l[c]}this.#i.process(n,o,t,i),this.#O&&this.#n.process(n,o,t,i)}parameterChanged(e){if(e===this.#C){let i=this.#C.getValue()+1;this.#l[0].order=i,this.#l[1].order=i}else if(e===this.#f){let i=this.#f.getValue()+1;this.#s[0].order=i,this.#s[1].order=i}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),i=this.#h.getValue();this.#a[0].setHighpassParams(t/sampleRate,i)}else if(e===this.#y||e===this.#g){let t=this.#y.getValue(),i=this.#g.getValue();this.#a[1].setLowShelfParams(t/sampleRate,i)}else if(e===this.#B||e===this.#F||e===this.#P){let t=this.#B.getValue(),i=this.#F.getValue(),n=this.#P.getValue();this.#a[2].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#v||e===this.#x||e===this.#w){let t=this.#v.getValue(),i=this.#x.getValue(),n=this.#w.getValue();this.#a[3].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#N||e===this.#S||e===this.#_){let t=this.#N.getValue(),i=this.#S.getValue(),n=this.#_.getValue();this.#a[4].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#M||e===this.#D){let t=this.#M.getValue(),i=this.#D.getValue();this.#a[5].setHighShelfParams(t/sampleRate,i)}else if(e===this.#V||e===this.#R){let t=this.#V.getValue(),i=this.#R.getValue();this.#a[6].setLowpassParams(t/sampleRate,i)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#m?this.#c[1]=this.#m.getValue():e===this.#A?this.#c[2]=this.#A.getValue():e===this.#k?this.#c[3]=this.#k.getValue():e===this.#E?this.#c[4]=this.#E.getValue():e===this.#$?this.#c[5]=this.#$.getValue():e===this.#I&&(this.#c[6]=this.#I.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var Sy=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#a=new Float32Array(2048);#l=new Float32Array(2048);#s=new Float32Array(1024);#u=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#y=new Float32Array(2048);#g=new Float32Array(2048);#A=new Float32Array(2048);#B=new Float32Array(2048);#F=new Float32Array(1024);#P=new Float32Array(512);#k=new Float32Array(512);#v=new Float32Array(256);#x;#w;#E=0;#N=0;#S=0;#_=0;#$=0;#M=0;#D=0;#I=0;#V=0;#R=0;#C=0;#T=0;#O=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#G=0;#H=0;#J=0;#Q=0;#Y=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#ae=0;#se=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#b=0;#q=0;constructor(e=.5){this.#x=_o(Math.ceil(e*sampleRate)),this.#w=new Float32Array(this.#x<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#b=0,this.#q=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#b=0,this.#q=0,this.clearHistory(),this.clearBuffers()}process(e,t,i,n){let[o,a]=t.channels(),[s,l]=e.channels(),c=.4*this.damp,p=1-c,d=.7+.28*this.roomSize;for(let f=i;f<n;++f){let v=o[f],m=a[f],y=this.#q-this.predelayInSamples;y<0&&(y+=this.#x);let x;x=y<<1;let D=.01,M=this.#w[x]*D,O=this.#w[x+1]*D;x=this.#q<<1,this.#w[x]=v,this.#w[x+1]=m,this.#q=this.#q+1&this.#x-1;let T=this.#b&2047;this.#E=p*this.#N+c*this.#E,this.#e[T]=M+d*this.#E,this.#N=this.#e[this.#b-1617&2047],this.#S=p*this.#_+c*this.#S,this.#t[T]=M+d*this.#S,this.#_=this.#t[this.#b-1557&2047],this.#$=p*this.#M+c*this.#$,this.#r[T]=M+d*this.#$,this.#M=this.#r[this.#b-1491&2047],this.#D=p*this.#I+c*this.#D,this.#i[T]=M+d*this.#D,this.#I=this.#i[this.#b-1422&2047],this.#V=p*this.#R+c*this.#V,this.#n[T]=M+d*this.#V,this.#R=this.#n[this.#b-1356&2047],this.#C=p*this.#T+c*this.#C,this.#o[T]=M+d*this.#C,this.#T=this.#o[this.#b-1277&2047],this.#O=p*this.#z+c*this.#O,this.#a[T]=M+d*this.#O,this.#z=this.#a[this.#b-1188&2047],this.#U=p*this.#j+c*this.#U,this.#l[T]=M+d*this.#U,this.#j=this.#l[this.#b-1116&2047];let V=this.#j+this.#z+this.#T+this.#R+this.#I+this.#M+this.#_+this.#N,Y=this.#L-V,te=this.#K-Y,q=this.#W-te;this.#s[this.#b&1023]=V+.5*this.#L,this.#L=this.#s[this.#b-556&1023],this.#u[this.#b&511]=Y+.5*this.#K,this.#K=this.#u[this.#b-441&511],this.#c[this.#b&511]=te+.5*this.#W,this.#W=this.#c[this.#b-341&511],this.#d[this.#b&255]=q+.5*this.#Z,this.#Z=this.#d[this.#b-225&255],s[f]=this.dryGain*v+this.wetGain*(this.#Z-q),this.#G=p*this.#H+c*this.#G,this.#p[T]=O+d*this.#G,this.#H=this.#p[this.#b-1640&2047],this.#J=p*this.#Q+c*this.#J,this.#h[T]=O+d*this.#J,this.#Q=this.#h[this.#b-1580&2047],this.#Y=p*this.#X+c*this.#Y,this.#f[T]=O+d*this.#Y,this.#X=this.#f[this.#b-1514&2047],this.#ee=p*this.#te+c*this.#ee,this.#m[T]=O+d*this.#ee,this.#te=this.#m[this.#b-1445&2047],this.#re=p*this.#ie+c*this.#re,this.#y[T]=O+d*this.#re,this.#ie=this.#y[this.#b-1379&2047],this.#ne=p*this.#oe+c*this.#ne,this.#g[T]=O+d*this.#ne,this.#oe=this.#g[this.#b-1300&2047],this.#ae=p*this.#se+c*this.#ae,this.#A[T]=O+d*this.#ae,this.#se=this.#A[this.#b-1211&2047],this.#le=p*this.#ue+c*this.#le,this.#B[T]=O+d*this.#le,this.#ue=this.#B[this.#b-1139&2047];let ge=this.#ue+this.#se+this.#oe+this.#ie+this.#te+this.#X+this.#Q+this.#H,se=this.#ce-ge,Re=this.#de-se,Ze=this.#pe-Re;this.#F[this.#b&1023]=ge+.5*this.#ce,this.#ce=this.#F[this.#b-579&1023],this.#P[this.#b&511]=se+.5*this.#de,this.#de=this.#P[this.#b-464&511],this.#k[this.#b&511]=Re+.5*this.#pe,this.#pe=this.#k[this.#b-364&511],this.#v[this.#b&255]=Ze+.5*this.#he,this.#he=this.#v[this.#b-248&255],l[f]=this.dryGain*m+this.wetGain*(this.#he-Ze),this.#b++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#a.fill(0),this.#l.fill(0),this.#s.fill(0),this.#u.fill(0),this.#c.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#y.fill(0),this.#g.fill(0),this.#A.fill(0),this.#B.fill(0),this.#F.fill(0),this.#P.fill(0),this.#k.fill(0),this.#v.fill(0),this.#w.fill(0)}clearHistory(){this.#E=0,this.#N=0,this.#S=0,this.#_=0,this.#$=0,this.#M=0,this.#D=0,this.#I=0,this.#V=0,this.#R=0,this.#C=0,this.#T=0,this.#O=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#G=0,this.#H=0,this.#J=0,this.#Q=0,this.#Y=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#ae=0,this.#se=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var Ey=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new Sy;let{decay:i,preDelay:n,damp:o,wet:a,dry:s}=this.#t.namedParameter;this.#o=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(n)),this.#l=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(a)),this.#u=this.own(this.bindParameter(s)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=g.wrap(e),{terminate:()=>this.#c=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,i);let[n,o]=this.#r.channels();this.#i.process(n,o,t,i)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#a===e?this.#n.predelayInSamples=Math.ceil(this.#a.getValue()*sampleRate):this.#l===e?this.#n.damp=this.#l.getValue():this.#s===e?this.#n.wetGain=Oe(this.#s.getValue()):this.#u===e&&(this.#n.dryGain=Oe(this.#u.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var By=class extends De{#e;#t;#r;#i;#n;#o;#a;gain=1;release=1;loader=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ve,this.#i=new Vn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new Se(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.loader=i.targetVertex.map(({box:n})=>e.sampleManager.getOrCreate(n.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){ye.isStart(e)?this.#t.push(new rP(this,e)):ye.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,i){this.#r.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#r,t,i)&&this.#t.splice(n,1)}parameterChanged(e){e===this.#o?this.gain=Oe(this.#o.getValue()):e===this.#a&&(this.release=this.#a.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},rP=class{#e;#t;#r=1;#i=0;#n=.003*sampleRate|0;#o=0;#a=Number.POSITIVE_INFINITY;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#t}stop(){this.#a=this.#o}processAdd(e,t,i){let n=this.#e.loader;if(n.isEmpty())return!0;let o=n.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,i)}processSimple(e,t,i,n){let[o,a]=e,s=t.frames[0],l=t.frames[1]??s,c=t.numberOfFrames,p=t.sampleRate/sampleRate,d=this.#e.gain*this.#t.velocity,f=this.#e.release,v=1/f;for(let m=i;m<n;m++){let y=this.#i|0;if(y>=c-1)return!0;let x=this.#i-y,D=this.#o<this.#n?this.#o/this.#n:1,M=(Math.min(1-(this.#o-this.#a)*v,1)*D)**2,O=s[y]*(1-x)+s[y+1]*x,T=l[y]*(1-x)+l[y+1]*x;if(o[m]+=O*d*M,a[m]+=T*d*M,this.#i+=this.#r*p,++this.#o-this.#a>f)return!0}return!1}};var Fy=class extends Mr{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new Vn(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,i){}handleEvent({index:e},t){ye.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t)):ye.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Ny=class extends De{#e;#t;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=this.own(new Se(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new Ec,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{R.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#n}processAudio(e,t,i){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let i of this.#i){let[n,o]=i.channels();for(let a=0;a<128;a++)e[a]+=n[a],t[a]+=o[a]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var ky=class r{static create(e,t,i,n){return new r(e,t,i,n)}#e=new U;#t;#r;#i=[];#n=!0;constructor(e,t,i,n){this.#t=w.newSet(({device:o})=>o.uuid),this.#r=this.#e.own(new U),this.#e.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let a=Rh.create(e,o.box),s=this.#t.add({device:a,subscription:a.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(s,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:a,subscription:s}=this.#t.removeByKey(o.uuid);s.terminate(),a.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let a=i;R.replace(this.#i,t.adapters().map(({uuid:s})=>this.#t.get(s).device));for(let s of this.#i)s.adapter().enabledField.getValue()&&(this.#r.own(s.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,s.incoming)),a=s);this.#r.own(n.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,n.incoming)),this.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var Oh=Math.floor(.005*sampleRate),My=class{#e;#t;#r;#i;#n;#o;#a=0;#l=Number.POSITIVE_INFINITY;#s;#u;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#i=i,this.#r=n,this.#n=e.gate,this.#o=ul(this.#r.velocity);let{attack:o,release:a,sampleStart:s,sampleEnd:l}=this.#t;this.#s=o.getValue()*sampleRate,this.#u=a.getValue()*sampleRate,this.#c=(i.numberOfFrames-1)*s.getValue(),this.#d=(i.numberOfFrames-1)*l.getValue(),this.#p=this.#c,this.#h=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#p}get envelope(){return this.#h}release(e=!1){this.#f&&(e?(this.#u=Oh,this.#y(),this.#f=!1):this.#n!==Rn.Off&&this.#y())}processAdd(e,t,i){let[n,o]=e,{frames:a,numberOfFrames:s}=this.#i,l=a[0],c=a[1]??l,{pitch:p}=this.#t,d=this.#d-this.#c,f=Math.sign(d),v=this.#i.sampleRate/sampleRate*f*2**(p.getValue()/1200),m=0;for(let y=t;y<i;y++){let x=this.#p|0,D=this.#p-x,M=l[x]*(1-D)+(l[x+1]??0)*D,O=c[x]*(1-D)+(c[x+1]??0)*D;if(m=Math.min(this.#a/this.#s,1-(this.#a-(this.#l+this.#s))/this.#u,1),this.#p+=v,f>0){if(this.#n===Rn.Off){if(this.#p>=s)return!0;!this.#m&&this.#p>=this.#d&&this.#y()}else if(this.#n===Rn.On){if(this.#p>=this.#d-Oh){if(this.#p>=this.#d)return!0;m*=(this.#d-this.#p)/Oh}}else if(this.#n===Rn.Loop)for(;this.#p>=this.#d;)this.#p-=d}else if(f<0){if(this.#n===Rn.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#y()}else if(this.#n===Rn.On){if(this.#p<=this.#d+Oh){if(this.#p<=this.#d)return!0;m*=(this.#d-this.#p)/Oh}}else if(this.#n===Rn.Loop)for(;this.#p<=this.#d;)this.#p-=d}if(++this.#a-this.#l>this.#s+this.#u)return!0;m*=this.#o*m,n[y]+=M*m,o[y]+=O*m}return this.#h=m,!1}toString(){return"{PlayfieldSampleVoice}"}#y(){this.#m||(this.#m=!0,this.#l=this.#a<this.#s?this.#a-this.#s:this.#a)}};var Dy=class extends De{#e;#t;#r;#i;#n;#o;constructor(e,t,i,n){super(e),this.#e=t,this.#t=i,this.#r=[],this.#i=new ve,this.#n=this.own(new Se(e.broadcaster,i.peakAddress));let{sampleStart:o,sampleEnd:a,attack:s,release:l,pitch:c}=i.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(a)),attack:this.own(this.bindParameter(s)),release:this.own(this.bindParameter(l)),pitch:this.own(this.bindParameter(c))});let p=new Float32Array(16);this.ownAll(ky.create(e,i.audioEffects,this,n),e.broadcaster.broadcastFloats(i.address,p,d=>{if(!d)return;let f=this.#r.length<p.length?this.#r:this.#r.slice(0,p.length);f.forEach(({position:v},m)=>p[m]=v),p[f.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(ye.isStart(e)){let t=this.#t.file().flatMap(p=>p.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:i,solo:n,polyphone:o,exclude:a}=this.#t.namedParameter,s=i.getValue(),l=n.getValue();if(s||this.#e.hasSolo()&&!l)return;o.getValue()||this.#r.forEach(p=>p.release(!0)),a.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new My(this.#t,this.#o,t.unwrap(),e))}else ye.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#r.length-1;n>=0;n--)this.#r[n].processAdd(this.#i.channels(),t,i)&&this.#r.splice(n,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#n.clear()}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var Iy=class{#e=new U;#t;#r;#i;#n;constructor(e,t){this.#t=t,this.#r=this.#e.own(new Fy(e,this)),this.#i=this.#e.own(new Ny(e,this)),this.#n=w.newSet(i=>i.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:i=>{let n=new Dy(e,this,i,this.#i);this.#n.add({uuid:i.uuid,processor:n,terminable:e.registerEdge(this.#r,n)}),e.sampleManager.getOrCreate(i.fileUUID())},onRemove:i=>{let{terminable:n,processor:o}=this.#n.removeByKey(i.uuid);n.terminate(),o.terminate()},onReorder:i=>{}}),{terminate:()=>{this.#n.forEach(({terminable:i,processor:n})=>{i.terminate(),n.terminate()}),this.#n.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#t.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#t.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:i})=>i.forceStop())}get uuid(){return this.#t.uuid}get adapter(){return this.#t}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#e.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var Cy=class extends De{#e;#t;#r;#i=Ht.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#a;#l;#s;#u;#c;#d=g.None;#p=ln.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=this.own(new Se(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(t.namedParameter.volume)),this.#a=this.own(this.bindParameter(t.namedParameter.panning)),this.#l=this.own(this.bindParameter(t.namedParameter.stereo)),this.#s=this.own(this.bindParameter(t.namedParameter.invertL)),this.#u=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(i=>{this.#p=i.getValue(),this.#h=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,i){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#n,this.#p,this.#f),this.#h=!1);let n=this.#d.unwrap().channels(),o=this.#t.channels();this.#i.processFrames(n,o,t,i),this.#r.processStereo(o,t,i),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=Oe(this.#o.getValue()),this.#h=!0;return;case this.#a:this.#n.panning=this.#a.getValue(),this.#h=!0;return;case this.#l:this.#n.stereo=this.#l.getValue(),this.#h=!0;return;case this.#s:this.#n.invertL=this.#s.getValue(),this.#h=!0;return;case this.#u:this.#n.invertR=this.#u.getValue(),this.#h=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var Ty=class extends Mr{#e;#t;#r=g.None;#i=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Bi(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(i=>{this.#r.ifSome(n=>n.terminate()),this.#r=g.wrap(i.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(i.targetVertex.unwrap().box,js.checkType))}),K.create(()=>{this.#r.ifSome(i=>i.terminate()),this.#r=g.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}*processNotes(e,t,i){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),o=this.#r.mapOr(Ic,Lc.Identity);for(let a of n.processNotes(o.unwarp(e),o.unwarp(t),i))ye.isStart(a)?this.#t.noteOn(a.pitch):this.#t.noteOff(a.pitch),yield Ir.overwrite(a,{position:le(o.warp(a.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(Ic,Lc.Identity);for(let o of i.iterateActiveNotesAt(n.unwarp(e),t))yield Ir.overwrite(o,{position:n.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,i){}};var Ry=class extends Mr{#e;#t;#r=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Bi(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=g.wrap(e),K.create(()=>this.#r=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().processNotes(e,t,i))yield n}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().iterateActiveNotesAt(e,t))yield i}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Oy=(r,e)=>(r[e]??r[e.toString()])?.value,kc=(r,e,t)=>Oy(e,t)??Oy(r,t),sB=new Float32Array(128),Vy=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,i,n){this.event=e;let o=t.generators,a=i?.generators,s=Oy(a,53)??0,l=i?.sample??n.samples[s];this.sampleData=l.data,this.rootKey=Oy(a,58)??l?.header.originalPitch??60,this.sampleRate=l?.header.sampleRate??sampleRate,this.loopStart=l?.header.startLoop??0,this.loopEnd=l?.header.endLoop??this.sampleData.length;let c=kc(o,a,54)??0;this.shouldLoop=c===1||c===3,this.pan=(kc(o,a,17)??0)/1e3;let p=kc(o,a,34),d=kc(o,a,36),f=kc(o,a,37),v=kc(o,a,38),m=Ca(p)?Math.pow(2,p/1200):.005,y=Ca(d)?Math.pow(2,d/1200):.005,x=1-(f??0)/1e3,D=Ca(v)?Math.pow(2,v/1200):.005;this.envelope=new ll(sampleRate),this.envelope.set(m,y,x,D),this.envelope.gateOn(),this.#e=new Di(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,i){let o=Uc(this.event.pitch+this.event.cent/100,440)/Uc(this.rootKey,440)*(this.sampleRate/sampleRate),a=ul(this.event.velocity),s=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(sB,t,i);let c=e.getChannel(0),p=e.getChannel(1);for(let d=t;d<i;d++){let f=Math.floor(this.playbackPosition),m=this.#t(f)/32768*a*this.#e.process(sB[d]);if(c[d]+=m*s,p[d]+=m*l,this.playbackPosition+=o,this.shouldLoop)this.playbackPosition>=this.loopEnd&&this.loopEnd>this.loopStart&&(this.playbackPosition=this.loopStart+(this.playbackPosition-this.loopEnd));else if(this.playbackPosition>=this.sampleData.length-1)return!0}return this.envelope.complete&&this.#e.value<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var zy=class extends De{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Vn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ve,this.#n=this.own(new Se(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.#o=i.targetVertex.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}reset(){this.#r.clear(),this.#n.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(n=>n.soundfont);if(t.isEmpty())return;let i=t.unwrap();if(ye.isStart(e)){let n=i.presets[this.#e.presetIndex]??i.presets[0];if(vP(n)){console.warn("No preset available");return}let o=0;for(let a of n.zones){let s=Math.round(e.velocity*127);if(this.#a(e.pitch,s,a)){let l=a.instrument.zones;for(let c=0;c<l.length;c++){let p=l[c];this.#a(e.pitch,s,p)&&(this.#t.push(new Vy(e,a,p,i)),o++)}}}}else ye.isStop(e)&&this.#t.forEach(n=>{n.event.id===e.id&&n.release()})}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#i,t,i)&&this.#t.splice(n,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#a(e,t,i){return this.#l(i.generators[44]?.range,t)&&this.#l(i.generators[43]?.range,e)}#l(e,t){return el(e)||t>=e.lo&&t<=e.hi}};var lB=r=>r>0?20*Math.log10(r):-100,uB=r=>Math.pow(10,r*.05);var Uy=class{#e=.08;#t=1;#r;#i;#n=0;#o=.14;#a=0;#l=.14;#s=0;#u=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,i){this.#s===0&&(this.#s=e[0]),this.#u===0&&(this.#u=e[0]),this.#a=0,this.#l=0;for(let o=t;o<i;++o){let a=e[o]*e[o];this.#s=Math.max(a,this.#r*this.#s+this.#i*a),this.#u=this.#r*this.#u+this.#i*a;let s=this.#s/this.#u;this.#c=s>0?s:0,this.#c>0&&(this.#n=2*(this.#e/this.#c),this.#o=2*(this.#t/this.#c)-this.#n,this.#a+=this.#n,this.#l+=this.#o)}let n=i-t;this.#a/=n,this.#l/=n}getAvgAttack(){return this.#a}getAvgRelease(){return this.#l}};var jy=class{#e=[];#t;#r;#i;#n=0;constructor(e,t,i,n){this.#i=n,this.#r=Math.floor(e*t),this.#t=i+this.#r;for(let o=0;o<n;o++)this.#e[o]=new Float32Array(this.#t);this.#n=0}process(e,t,i){if(this.#r===0)return;let n=(this.#n-this.#r+this.#t)%this.#t;for(let o=0;o<this.#i;o++){let a=e.getChannel(o),s=this.#n,l=n;for(let c=t;c<i;c++){let p=this.#e[o][l];this.#e[o][s]=a[c],a[c]=p,s=(s+1)%this.#t,l=(l+1)%this.#t}}this.#n=(this.#n+(i-t))%this.#t}};var Ly=class{#e=-20;#t=2;#r=6;#i=3;#n=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#n=1/e-1)}setKnee(e){e!==this.#r&&(this.#r=e,this.#i=e/2)}applyCompression(e){let t=e-this.#e;return t<=-this.#i?0:t>-this.#i&&t<=this.#i?.5*this.#n*((t+this.#i)*(t+this.#i))/this.#r:this.#n*t}applyCompressionToBuffer(e,t,i){for(let n=t;n<i;++n){let o=Math.max(Math.abs(e[n]),1e-6),a=lB(o);e[n]=this.applyCompression(a)}}};var Qs=class{#e;#t=1;#r=0;#i=0;#n=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#n&&(this.#i=e,this.#n=!1),this.#i=this.#t*e+this.#r*this.#i}setAlpha(e){this.#t=e,this.#r=1-this.#t}setAlphaWithTime(e){this.#t=Math.exp(-1/(this.#e*e)),this.#r=1-this.#t}getState(){return this.#i}};var Ky=class{#e;#t;#r;#i;#n=.01;#o=0;#a=.14;#l=0;#s=0;#u=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Uy(e),this.#r=new Qs(e),this.#i=new Qs(e),this.#o=Math.exp(-1/(e*this.#n)),this.#l=Math.exp(-1/(e*this.#a)),this.#s=0,this.#u=0}setAttack(e){e!==this.#n&&(this.#n=e,this.#o=Math.exp(-1/(this.#e*this.#n)))}setRelease(e){e!==this.#a&&(this.#a=e,this.#l=Math.exp(-1/(this.#e*this.#a)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#s?this.#s=this.#o*this.#s+(1-this.#o)*e:this.#s=this.#l*this.#s+(1-this.#l)*e,this.#s}applyBallistics(e,t,i){for(let n=t;n<i;++n)e[n]=this.#p(e[n])}processCrestFactor(e,t,i){(this.#c||this.#d)&&(this.#t.process(e,t,i),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var Wy=class{#e;#t;#r;#i=0;#n=0;constructor(e,t,i){this.#t=Math.floor(e*t),this.#r=i+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,i){this.#o(e,t,i),this.#l(),this.#a(e,t,i)}#o(e,t,i){for(let n=t;n<i;n++)this.#e[this.#i]=e[n],this.#i=(this.#i+1)%this.#r;this.#n=i-t}#a(e,t,i){let n=this.#i-this.#n-this.#t;n<0&&(n+=this.#r);for(let o=t;o<i;o++)e[o]=this.#e[n],n=(n+1)%this.#r}#l(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,i=0;for(let o=0;o<this.#n;o++){let a=this.#e[e];a>t?(this.#e[e]=t,t+=i):(i=-a/this.#t,t=a+i),e=e-1,e<0&&(e+=this.#r)}let n=!1;for(let o=0;o<this.#t&&!n;o++){if(this.#e[e]>t)this.#e[e]=t,t+=i;else{n=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var Zy=class r extends De{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d=.005;#p;#h;#f=g.None;#m=!1;#y=!1;#g=!1;#A=!1;#B=-10;#F=2;#P=6;#k=2;#v=140;#x=0;#w=1;#E=0;#N=0;#S=0;#_=0;#$=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=Ht.linear(sampleRate);let{lookahead:i,automakeup:n,autoattack:o,autorelease:a,inputgain:s,threshold:l,ratio:c,knee:p,attack:d,release:f,makeup:v,mix:m}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(i)),this.parameterAutomakeup=this.own(this.bindParameter(n)),this.parameterAutoattack=this.own(this.bindParameter(o)),this.parameterAutorelease=this.own(this.bindParameter(a)),this.parameterInputgain=this.own(this.bindParameter(s)),this.parameterThreshold=this.own(this.bindParameter(l)),this.parameterRatio=this.own(this.bindParameter(c)),this.parameterKnee=this.own(this.bindParameter(p)),this.parameterAttack=this.own(this.bindParameter(d)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(m)),this.#n=new Ky(sampleRate),this.#o=new Ly,this.#a=new jy(sampleRate,.005,128,2),this.#l=new Wy(sampleRate,this.#d,128),this.#s=new Qs(sampleRate),this.#s.setAlpha(.03),this.#u=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,y=>{this.#p[0]=Mx(this.#N),this.#p[1]=this.#_,this.#p[2]=Mx(this.#S)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#$=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#u.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#E=0,this.#N=0,this.#S=0,this.#_=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=g.wrap(e),{terminate:()=>this.#f=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#f.isEmpty())return;let n=this.#f.unwrap(),o=n.getChannel(0),a=n.getChannel(1),s=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let c=t;c<i;c++){let p=this.#h.moveAndGet(),d=s[c]=o[c]*p,f=l[c]=a[c]*p,v=Math.max(Math.abs(d),Math.abs(f));this.#N<=v?this.#N=v:this.#N*=r.PEAK_DECAY_PER_SAMPLE}this.#u.fill(0,t,i);for(let c=t;c<i;c++)this.#u[c]=Math.max(Math.abs(s[c]),Math.abs(l[c]));this.#n.processCrestFactor(this.#u,t,i),this.#o.applyCompressionToBuffer(this.#u,t,i),this.#n.applyBallistics(this.#u,t,i);for(let c=t;c<i;c++){let p=this.#u[c];this.#_>=p?this.#_=p:this.#_+=r.REDUCTION_DECAY_PER_SAMPLE}this.#E=this.#M(this.#u,t,i),this.#m&&(this.#a.process(this.#r,t,i),this.#l.process(this.#u,t,i));for(let c=t;c<i;c++)this.#u[c]=uB(this.#u[c]+this.#x+this.#E);for(let c=t;c<i;c++)this.#c[0][c]=s[c],this.#c[1][c]=l[c];for(let c=t;c<i;c++)s[c]*=this.#u[c],l[c]*=this.#u[c];for(let c=t;c<i;c++){let p=s[c]*this.#w+this.#c[0][c]*(1-this.#w),d=l[c]*this.#w+this.#c[1][c]*(1-this.#w),f=Math.max(Math.abs(p),Math.abs(d));this.#S<=f?this.#S=f:this.#S*=r.PEAK_DECAY_PER_SAMPLE,s[c]=p,l[c]=d}this.#i.process(s,l,t,i),this.#$=!0}#M(e,t,i){let n=0;for(let o=t;o<i;o++)n+=e[o];return this.#s.process(-n/(i-t)),this.#y?this.#s.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#m=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#y=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#g=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#g),this.#g||this.#n.setAttack(this.#k*.001)):e===this.parameterAutorelease?(this.#A=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#A),this.#A||this.#n.setRelease(this.#v*.001)):e===this.parameterInputgain?this.#h.set(Oe(this.parameterInputgain.getValue()),this.#$):e===this.parameterThreshold?(this.#B=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#B)):e===this.parameterRatio?(this.#F=this.parameterRatio.getValue(),this.#o.setRatio(this.#F)):e===this.parameterKnee?(this.#P=this.parameterKnee.getValue(),this.#o.setKnee(this.#P)):e===this.parameterAttack?(this.#k=this.parameterAttack.getValue(),this.#g||this.#n.setAttack(this.#k*.001)):e===this.parameterRelease?(this.#v=this.parameterRelease.getValue(),this.#A||this.#n.setRelease(this.#v*.001)):e===this.parameterMakeup?this.#x=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#w=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Gy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=new Yh(sampleRate),this.#n=this.own(new Se(e.broadcaster,t.address));let{crush:i,bits:n,boost:o,mix:a}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(i)),this.parameterBitDepth=this.own(this.bindParameter(n)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(a)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#i.process(n.channels(),this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i)}parameterChanged(e){e===this.parameterCrusherRate?this.#i.setCrush(1-this.parameterCrusherRate.getValue()):e===this.parameterBitDepth?this.#i.setBitDepth(this.parameterBitDepth.getValue()):e===this.parameterBoost?this.#i.setBoost(this.parameterBoost.getValue()):e===this.parameterMix&&this.#i.setMix(this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var Y$=[2,4,8],cB=8,qy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterDrive;parameterVolume;#o=g.None;#a=!1;#l;#s;#u;#c;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=[new Float32Array(128*cB),new Float32Array(128*cB)],this.#n=this.own(new Se(e.broadcaster,t.address));let{drive:i,volume:n}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(i)),this.parameterVolume=this.own(this.bindParameter(n)),this.ownAll(e.registerProcessor(this),t.box.overSampling.catchupAndSubscribe(o=>{let a=Y$[o.getValue()];this.#l=new lf(a),this.#u=Ht.linear(sampleRate*a),this.#u.set(Oe(this.parameterDrive.getValue()),this.#a),this.#c=Ht.linear(sampleRate*a),this.#c.set(Oe(this.parameterVolume.getValue()),this.#a),this.#s=a})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#a=!1,this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;this.#l.upsample(this.#o.unwrap().channels(),this.#i,t,i);let n=(i-t)*this.#s,[o,a]=this.#i;for(let s=0;s<n;s++){let l=this.#c.moveAndGet(),c=this.#u.moveAndGet();o[s]=Dx(o[s]*c)*l,a[s]=Dx(a[s]*c)*l}this.#l.downsample(this.#i,this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i),this.#a=!0}parameterChanged(e){e===this.parameterDrive?this.#u.set(Oe(this.parameterDrive.getValue()),this.#a):e===this.parameterVolume&&this.#c.set(Oe(this.parameterVolume.getValue()),this.#a)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Hy=class extends De{#e;#t;#r=[];#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#i=[];let{midiDevice:i,box:n,parameters:o}=t;this.#n=n.channel.getValue(),this.ownAll(n.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:a})=>this.#i.push(this.bindParameter(o.parameterAt(Ne(a,Ri).value.address))),onRemoved:({box:a})=>R.removeIf(this.#i,s=>s.address===Ne(a,Ri).value.address)}),n.channel.subscribe(a=>{i.ifSome(s=>this.#r.forEach(l=>e.sendMIDIData(s.id.getValue(),st.noteOff(this.#n,l),s.delayInMs.getValue()))),this.#r.length=0,this.#n=a.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock({p0:e,p1:t,s0:i,flags:n,bpm:o}){if(this.#o.isEmpty())return;let{box:{channel:a,device:s}}=this.#e,l=s.targetVertex.match({none:()=>g.None,some:({box:p})=>g.wrap(Ne(p,Ti))}),c=l.mapOr(p=>p.delayInMs.getValue(),0);for(let p of this.#o.unwrap().processNotes(e,t,n))if(p.pitch>=0&&p.pitch<=127){let d=i/sampleRate,f=Q.pulsesToSeconds(p.position-e,o),v=(d+f)*1e3+c,m=a.getValue();if(ye.isStart(p)){let y=Math.round(p.velocity*127);this.#r.push(p.pitch),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),st.noteOn(m,p.pitch,y),v))}else if(ye.isStop(p)){let y=this.#r.indexOf(p.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),st.noteOff(m,p.pitch),v))}}}setNoteEventSource(e){return this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get incoming(){return this}get outgoing(){return this}reset(){}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}get adapter(){return this.#e}handleEvent(e){}processAudio(e,t,i){}parameterChanged(e,t=0){let{box:{channel:i,device:n}}=this.#e;if(n.isEmpty())return;let{id:o,delayInMs:a}=Ne(n.targetVertex.unwrap().box,Ti),s=t*1e3*a.getValue(),l=Ne(e.adapter.field.box,Ri).controller.getValue(),c=Math.round(e.getValue()*127),p=st.control(i.getValue(),l,c);this.context.sendMIDIData(o.getValue(),p,s)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var Jy=class extends Mr{#e;#t;#r;#i=g.None;#n;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Bi(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#n=0;let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(i),this.bindParameter(n),this.bindParameter(o),this.bindParameter(a),this.bindParameter(s),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,c=>{this.#r[this.#n]=0,this.#n=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#i.isEmpty())for(let n of this.#i.unwrap().processNotes(e,t,i))if(ye.isStart(n)){this.#t.noteOn(n.pitch);let o=this.#e.computeVelocity(n.position,n.velocity);this.#r[this.#n++]=Math.round(n.velocity*127)|Math.round(o*127)<<8|65536,yield Ir.overwrite(n,{velocity:o})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().iterateActiveNotesAt(e,t))i.type==="note-event"&&(yield Ir.overwrite(i,{velocity:this.#e.computeVelocity(i.position,i.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Qy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h=g.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new Xh,this.#o=new Di(.003,sampleRate),this.#a=new Di(.003,sampleRate);let{rate:i,depth:n,slope:o,symmetry:a,offset:s,channelOffset:l}=t.namedParameter;this.#l=this.bindParameter(i),this.#s=this.bindParameter(n),this.#u=this.bindParameter(o),this.#c=this.bindParameter(a),this.#d=this.bindParameter(s),this.#p=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#h=g.wrap(e),{terminate:()=>this.#h=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:i},n,o){if(this.#h.isEmpty())return;let a=this.#h.unwrap(),[s,l]=a.channels(),[c,p]=this.#r.channels();this.#f&&(this.#n.set(this.#s.getValue(),this.#u.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:d}=tn,f=Q.samplesToPulses(1,t,sampleRate),m=1/or.toPPQN(d[this.#l.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let D=n;D<o;D++){let M=(e+D*f)*m+y,O=(e+D*f)*m+x;c[D]=s[D]*this.#o.process(this.#n.compute(M-Math.floor(M))),p[D]=l[D]*this.#a.process(this.#n.compute(O-Math.floor(O)))}this.#i.process(c,p),rt.every(i,5)&&(this.#m=(e+(o-n)*f)*m)}parameterChanged(e){(e===this.#s||e===this.#u||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Yy=class{#e;#t=[];#r;#i;#n;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#y=.5;#g=.005;#A=.5;#B=.7;#F=.3;#P=.6;constructor(e){this.#e=e,this.#n=e+1,this.#r=new Float32Array(this.#n),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(n=>this.#k(n));let i=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(i,n=>Math.round(n*e))}#k(e){let t=Math.round(e*this.#e),i=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(i),t-1,0,i-1])}#v(e,t){return this.#t[e][0][this.#t[e][1]]=t}#x(e){return this.#t[e][0][this.#t[e][2]]}#w(e,t){let i=this.#t[e];return i[0][i[2]+t&i[3]]}#E(e,t){let i=this.#t[e],n=t-~~t,o=~~t+i[2]-1,a=i[3],s=i[0][o++&a],l=i[0][o++&a],c=i[0][o++&a],p=i[0][o&a],d=(3*(l-c)-s+p)*.5,f=2*c+s-(5*l+p)*.5,v=(c-s)*.5;return((d*n+f)*n+v)*n+l}set preDelayMs(e){this.#c=Math.floor(e/1e3*this.#e)}set bandwidth(e){this.#d=e*.9999}set inputDiffusion1(e){this.#p=e}set inputDiffusion2(e){this.#h=e}set decay(e){this.#f=e}set decayDiffusion1(e){this.#m=e*.999999}set decayDiffusion2(e){this.#y=e*.999999}set damping(e){this.#g=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#B=e*2}set wetGain(e){this.#F=e}set dryGain(e){this.#P=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#o=0,this.#a=0,this.#l=0,this.#s=0,this.#u=0}process(e,t,i,n){let o=this.#c,a=this.#d,s=this.#p,l=this.#h,c=this.#f,p=this.#m,d=this.#y,f=1-this.#g,v=this.#A/this.#e,m=this.#B*this.#e/1e3,y=this.#F*.6,x=this.#P,D=e[0],M=e[1],O=t[0],T=t[1];for(let V=i;V<n;V++){let Y=D[V],te=M[V];this.#r[this.#o]=(Y+te)*.5,O[V]=Y*x,T[V]=te*x;let q=this.#r[(this.#n+this.#o-o)%this.#n];this.#a+=a*(q-this.#a);let ge=this.#v(0,this.#a-s*this.#x(0));ge=this.#v(1,s*(ge-this.#x(1))+this.#x(0)),ge=this.#v(2,s*ge+this.#x(1)-l*this.#x(2)),ge=this.#v(3,l*(ge-this.#x(3))+this.#x(2));let se=l*ge+this.#x(3),Re=m*(1+Math.cos(this.#u*6.28)),Ze=m*(1+Math.sin(this.#u*6.2847)),be=this.#v(4,se+c*this.#x(11)+p*this.#E(4,Re));this.#v(5,this.#E(4,Re)-p*be),this.#l+=f*(this.#x(5)-this.#l),be=this.#v(6,c*this.#l-d*this.#x(6)),this.#v(7,this.#x(6)+d*be),be=this.#v(8,se+c*this.#x(7)+p*this.#E(8,Ze)),this.#v(9,this.#E(8,Ze)-p*be),this.#s+=f*(this.#x(9)-this.#s),be=this.#v(10,c*this.#s-d*this.#x(10)),this.#v(11,this.#x(10)+d*be);let Ge=this.#w(9,this.#i[0])+this.#w(9,this.#i[1])-this.#w(10,this.#i[2])+this.#w(11,this.#i[3])-this.#w(5,this.#i[4])-this.#w(6,this.#i[5])-this.#w(7,this.#i[6]),je=this.#w(5,this.#i[7])+this.#w(5,this.#i[8])-this.#w(6,this.#i[9])+this.#w(7,this.#i[10])-this.#w(9,this.#i[11])-this.#w(10,this.#i[12])-this.#w(11,this.#i[13]);O[V]+=Ge*y,T[V]+=je*y,this.#u+=v,this.#o=(this.#o+1)%this.#n;for(let xe=0;xe<this.#t.length;xe++){let Qe=this.#t[xe];Qe[1]=Qe[1]+1&Qe[3],Qe[2]=Qe[2]+1&Qe[3]}}}};var Xy=class r extends De{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#i=new ve,this.#n=this.own(new Se(e.broadcaster,t.address)),this.#r=new Yy(sampleRate);let{preDelay:i,bandwidth:n,inputDiffusion1:o,inputDiffusion2:a,decay:s,decayDiffusion1:l,decayDiffusion2:c,damping:p,excursionRate:d,excursionDepth:f,wet:v,dry:m}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(i)),this.parameterBandwidth=this.own(this.bindParameter(n)),this.parameterInputDiffusion1=this.own(this.bindParameter(o)),this.parameterInputDiffusion2=this.own(this.bindParameter(a)),this.parameterDecay=this.own(this.bindParameter(s)),this.parameterDecayDiffusion1=this.own(this.bindParameter(l)),this.parameterDecayDiffusion2=this.own(this.bindParameter(c)),this.parameterDamping=this.own(this.bindParameter(p)),this.parameterExcursionRate=this.own(this.bindParameter(d)),this.parameterExcursionDepth=this.own(this.bindParameter(f)),this.parameterWet=this.own(this.bindParameter(v)),this.parameterDry=this.own(this.bindParameter(m)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#n.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#r.process(n.channels(),this.#i.channels(),t,i),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1),t,i)}parameterChanged(e){e===this.parameterPreDelay?this.#r.preDelayMs=this.parameterPreDelay.getValue():e===this.parameterBandwidth?this.#r.bandwidth=this.parameterBandwidth.getValue():e===this.parameterInputDiffusion1?this.#r.inputDiffusion1=this.parameterInputDiffusion1.getValue():e===this.parameterInputDiffusion2?this.#r.inputDiffusion2=this.parameterInputDiffusion2.getValue():e===this.parameterDecay?this.#r.decay=this.parameterDecay.getValue():e===this.parameterDecayDiffusion1?this.#r.decayDiffusion1=this.parameterDecayDiffusion1.getValue():e===this.parameterDecayDiffusion2?this.#r.decayDiffusion2=this.parameterDecayDiffusion2.getValue():e===this.parameterDamping?this.#r.damping=this.parameterDamping.getValue():e===this.parameterExcursionRate?this.#r.excursionRate=this.parameterExcursionRate.getValue():e===this.parameterExcursionDepth?this.#r.excursionDepth=this.parameterExcursionDepth.getValue():e===this.parameterWet?this.#r.wetGain=Oe(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Oe(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var iP;(e=>e.create=(t,i)=>i.accept({visitAudioBusBox:n=>new Bc(t,t.boxAdapters.adapterFor(n,dr)),visitVaporisateurDeviceBox:n=>new vy(t,t.boxAdapters.adapterFor(n,Cu)),visitNanoDeviceBox:n=>new By(t,t.boxAdapters.adapterFor(n,Ou)),visitTapeDeviceBox:n=>new wy(t,t.boxAdapters.adapterFor(n,Iu)),visitPlayfieldDeviceBox:n=>new Iy(t,t.boxAdapters.adapterFor(n,ma)),visitSoundfontDeviceBox:n=>new zy(t,t.boxAdapters.adapterFor(n,Ju)),visitMIDIOutputDeviceBox:n=>new Hy(t,t.boxAdapters.adapterFor(n,ic))}))(iP||={});var nP;(e=>e.create=(t,i)=>ee(i.accept({visitUnknownMidiEffectDeviceBox:n=>new Ry(t,t.boxAdapters.adapterFor(n,Gu)),visitArpeggioDeviceBox:n=>new Ay(t,t.boxAdapters.adapterFor(n,Hi)),visitPitchDeviceBox:n=>new _y(t,t.boxAdapters.adapterFor(n,Tu)),visitVelocityDeviceBox:n=>new Jy(t,t.boxAdapters.adapterFor(n,nc)),visitZeitgeistDeviceBox:n=>new Ty(t,t.boxAdapters.adapterFor(n,Wu))}),`Could not create midi-effect for'${i.name}'`))(nP||={});var Rh;(e=>e.create=(t,i)=>ee(i.accept({visitUnknownAudioEffectDeviceBox:n=>new Dh(t,t.boxAdapters.adapterFor(n,Zu)),visitStereoToolDeviceBox:n=>new Cy(t,t.boxAdapters.adapterFor(n,Lu)),visitCompressorDeviceBox:n=>new Zy(t,t.boxAdapters.adapterFor(n,Qu)),visitDelayDeviceBox:n=>new dy(t,t.boxAdapters.adapterFor(n,ci)),visitDattorroReverbDeviceBox:n=>new Xy(t,t.boxAdapters.adapterFor(n,oc)),visitTidalDeviceBox:n=>new Qy(t,t.boxAdapters.adapterFor(n,tn)),visitCrusherDeviceBox:n=>new Gy(t,t.boxAdapters.adapterFor(n,Yu)),visitFoldDeviceBox:n=>new qy(t,t.boxAdapters.adapterFor(n,ec)),visitReverbDeviceBox:n=>new Ey(t,t.boxAdapters.adapterFor(n,fu)),visitRevampDeviceBox:n=>new Py(t,t.boxAdapters.adapterFor(n,mu)),visitModularDeviceBox:n=>new Dh(t,t.boxAdapters.adapterFor(n,ua))}),`Could not create audio-effect for'${i.name}'`))(Rh||={});var ex=class extends De{#e;#t;#r;#i;#n;#o;#a=g.None;#l=!0;#s=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=Ht.linear(sampleRate),this.#i=Ht.linear(sampleRate),this.#n=this.own(this.bindParameter(t.sendGain)),this.#o=this.own(this.bindParameter(t.sendPan)),this.own(e.registerProcessor(this)),this.readAllParameters()}reset(){this.#t.clear()}get adapter(){return this.#e}setAudioSource(e){return this.#a=g.wrap(e),{terminate:()=>this.#a=g.None}}get audioOutput(){return this.#t}processAudio(e,t,i){if(this.#a.isEmpty())return;if(this.#l){let c=Oe(this.#n.getValue()),p=this.#o.getValue();this.#r.set((1-Math.max(0,p))*c,this.#s),this.#i.set((1+Math.min(0,p))*c,this.#s),this.#l=!1}let n=this.#t.getChannel(0),o=this.#t.getChannel(1),a=this.#a.unwrap(),s=a.getChannel(0),l=a.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let c=t;c<i;c++)n[c]=s[c]*this.#r.moveAndGet(),o[c]=l[c]*this.#i.moveAndGet();else{let c=this.#r.get(),p=this.#i.get();for(let d=t;d<i;d++)n[d]=s[d]*c,o[d]=l[d]*p}this.#s=!0}parameterChanged(e){this.#l=!0}};var tx=class extends De{#e;#t;#r;#i;#n;#o;#a;#l;#s=Ht.linear(sampleRate);#u=Ht.linear(sampleRate);#c=Ht.linear(sampleRate);#d=g.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new Se(e.broadcaster,this.#e.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.mute)),this.#l=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#h=!1}get isMute(){return this.#a.getValue()}get isSolo(){return this.#l.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#d.isEmpty())return;if(this.#p){let d=this.context.mixer;d.updateSolo();let f=this.isSolo||d.isVirtualSolo(this),v=this.isMute||d.hasChannelSolo()&&!f&&!this.#e.isOutput,m=Oe(this.#n.getValue()),y=this.#o.getValue();this.#s.set((1-Math.max(0,y))*m,this.#h),this.#u.set((1+Math.min(0,y))*m,this.#h),this.#c.set(v?0:1,this.#h),this.#p=!1}let n=this.#d.unwrap(),[o,a]=n.channels(),[s,l]=this.#t.channels(),[c,p]=this.#r;if(this.#s.isInterpolating()||this.#u.isInterpolating()||this.#c.isInterpolating())for(let d=t;d<i;d++){let f=this.#c.moveAndGet(),v=o[d]*this.#s.moveAndGet(),m=a[d]*this.#u.moveAndGet();s[d]=v*f,l[d]=m*f,c[d]=v,p[d]=m}else{let d=this.#s.get(),f=this.#u.get(),v=this.#c.get();for(let m=t;m<i;m++){let y=o[m]*d,x=a[m]*f;c[m]=y,p[m]=x,s[m]=y*v,l[m]=x*v}}this.#i.process(c,p,t,i),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#a?this.requestGainUpdate():e===this.#l&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}toString(){return`{${this.constructor.name}}`}};var rx=class{#e=new U;#t;#r;#i;#n;#o;#a;#l=[];#s=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=w.newSet(i=>i.adapter.uuid),this.#n=this.#e.own(new tx(this.#t.context,this.#t.adapter)),this.#o=w.newSet(({device:i})=>i.uuid),this.#a=this.#e.own(new U),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=Rh.create(this.#t.context,i.box),o=this.#o.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(o,"Could not add.")},onRemove:i=>{this.invalidateWiring();let{device:n,subscription:o}=this.#o.removeByKey(i.uuid);o.terminate(),n.terminate()},onReorder:i=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=this.#i.add(new ex(this.#t.context,i));I(n,"Could not add.")},onRemove:({uuid:i})=>{this.invalidateWiring(),this.#i.removeByKey(i).terminate()},onReorder:i=>{}}),this.#t.adapter.output.catchupAndSubscribe(i=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(i=>{i===0&&this.#s&&(this.#u(),this.#s=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#a.terminate(),this.#s=!0}terminate(){this.#e.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#l=[]}toString(){return`{${this.constructor.name}}`}#u(){let e=this.#t.adapter.isOutput,t=this.#t.context,i=this.#t.input(),n=this.#t.adapter.output.adapter.map(a=>t.getAudioUnit(a.deviceHost().uuid).inputAsAudioBus());if(i.isEmpty()||n.isEmpty()&&!e)return;let o=i.unwrap();if(this.#r.includeAudioEffects){R.replace(this.#l,this.#t.adapter.audioEffects.adapters().map(({uuid:a})=>this.#o.get(a).device));for(let a of this.#l)a.adapter().enabledField.getValue()&&(this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a.incoming)),o=a)}if(this.#r.includeSends&&this.#i.forEach(a=>{let s=t.getAudioUnit(a.adapter.targetBus.deviceHost().uuid);this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(s.inputAsAudioBus().addAudioSource(a.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a)),this.#a.own(t.registerEdge(a,s.inputAsAudioBus()))}),this.#a.own(this.#n.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,this.#n)),n.nonEmpty()&&!e){let a=n.unwrap();this.#a.own(a.addAudioSource(this.#n.audioOutput)),this.#a.own(t.registerEdge(this.#n,a))}}};var ix=class{#e=new U;#t;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=nl.create(268431651),this.#n=new Set,this.#o=new cl,this.#e.ownAll(this.#t.subscribeProcessPhase(i=>{if(i===1)for(let n of this.#n)n.gate||this.#n.delete(n)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:g.None})}pushRawNoteOff(e){for(let t of this.#n)if(t.running.isEmpty())this.#n.delete(t);else if(t.pitch===e){t.gate=!1;return}}*processNotes(e,t,i){let n=rt.every(i,5);if(this.#o.nonEmpty()&&(!n||rt.every(i,2)?yield*this.#u(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:a,velocity:s}=o,l=Number.POSITIVE_INFINITY,c=ye.start(e,l,a,s);o.running=g.wrap(c),yield c}o.gate||(this.#n.delete(o),yield ye.stop(o.running.unwrap("raw note never started"),e))}if(n){let o=this.#r.tracks.collection.adapters().filter(a=>a.type===ie.Notes&&a.enabled.getValue());for(let a of o)for(let{optClip:s,sectionFrom:l,sectionTo:c}of this.#t.clipSequencing.iterate(a.uuid,e,t))s.isEmpty()?yield*this.#l(a,l,c):yield*this.#a(s.unwrap(),l,c);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:i,velocity:n}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:i,velocity:n,cent:0};t||(yield*this.#o.overlapping(e,ar.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#a(e,t,i){if(e.optCollection.isEmpty())return;let n=e.optCollection.unwrap(),o=e.duration,a=Kn(t,o),s=a+o;i>s?(yield*this.#s(n,t,s,a),yield*this.#s(n,s,i,s)):yield*this.#s(n,t,i,a)}*#l(e,t,i){for(let n of e.regions.collection.iterateRange(t,i)){if(this.#t.ignoresRegion(n.address.uuid)||n.mute||!Ie(n,Qo))continue;let o=n.optCollection;if(o.isEmpty())continue;let a=o.unwrap();for(let{resultStart:s,resultEnd:l,rawStart:c}of qt.locateLoops(n,t,i))yield*this.#s(a,s,l,c)}}*#s(e,t,i,n){let o=t-n,a=i-n;for(let s of e.events.iterateRange(o-e.maxDuration,a)){if(!ar.isOfType(s))continue;let{position:l,duration:c,chance:p,playCount:d,playCurve:f}=s;if(!(p<100&&this.#i.nextDouble(0,100)>p)){if(d>1){let v=ar.inverseCurveFunc((o-l)/c,f),m=ar.inverseCurveFunc((a-l)/c,f),y=Math.floor(v*d),x=y/d;for(;x<m;){if(x>=v){let D=ar.curveFunc(x,f)*c;if(D>=c)break;let M=ar.curveFunc(x+1/d,f)*c,O=ye.startWith(s,l+D+n,M-D);this.#o.addAndRetain({...O}),yield O}x=++y/d}}else if(o<=l&&l<a){let v=ye.startWith(s,l+n);this.#o.addAndRetain({...v}),yield v}}}}*#u(e){for(let t of this.#o.releaseAll())yield ye.stop(t,e)}*#c(e,t){for(let i of this.#o.releaseLinearCompleted(t)){let n=le(i.position+i.duration,e,t);yield ye.stop(i,n)}}};var nx=class{#e=new U;#t;#r;#i;#n;#o=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new ix(this.#t.context,this.#t.adapter)),this.#i=w.newSet(({device:t})=>t.uuid),this.#n=this.#e.own(new U),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let i=nP.create(this.#t.context,t.box),n=this.#i.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(n,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:i,subscription:n}=this.#i.removeByKey(t.uuid);n.terminate(),i.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#a(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#a(){let e=this.#t.input().flatMap(n=>n.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),i=this.#r;this.#t.adapter.midiEffects.adapters().map(n=>this.#i.get(n.uuid).device).forEach(n=>{n.adapter().enabledField.getValue()&&(this.#n.ownAll(n.setNoteEventSource(i),this.#t.context.registerEdge(n,t.incoming)),i=n)}),this.#n.own(t.setNoteEventSource(i))}};var ox=class r{static ID=0;#e=r.ID++;#t=new U;#r;#i;#n;#o;#a=g.None;constructor(e,t,i){this.#r=e,this.#i=t,this.#n=this.#t.own(new nx(this)),this.#o=this.#t.own(new rx(this,i)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(n=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#a.ifSome(o=>o.terminate()),this.#a=n.getValue().flatMap(o=>g.wrap(iP.create(e,o.box.box)))}))}input(){return this.#a}inputAsAudioBus(){return Ne(this.#a.unwrap("No input available"),Bc)}audioOutput(){return this.#o.channelStrip.audioOutput}get midiDeviceChain(){return this.#n}get audioDeviceChain(){return this.#o}get context(){return this.#r}get adapter(){return this.#i}terminate(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#a.ifSome(e=>e.terminate()),this.#a=g.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var ax=class{#e;#t;#r;#i=!1;constructor(){this.#e=w.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),K.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#n()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=i=>{e.has(i)||(e.add(i),i.adapter.input.getValue().ifSome(n=>{n.type==="bus"&&n.box.input.pointerHub.filter(u.AudioOutput).map(o=>ee(o.box.accept({visitAudioUnitBox:({address:{uuid:a}})=>this.#e.get(a),visitAuxSendBox:({audioUnit:{targetVertex:a}})=>this.#e.get(a.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#e.forEach(i=>{i.isSolo&&t(i)}),this.#i=!1}};var Ma;(function(r){r[r.Float=0]="Float",r[r.FloatArray=1]="FloatArray",r[r.Integer=2]="Integer",r[r.IntegerArray=3]="IntegerArray",r[r.ByteArray=4]="ByteArray"})(Ma||(Ma={}));var Vh;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(Vh||(Vh={}));var $c;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})($c||($c={}));var sx=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=$t.create(0);#o=g.None;#a=g.None;#l=g.None;#s=-1;#u=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=qn.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(i){t(this.sendShareLock,i)}sendUpdateData(i){t(this.sendUpdateData,i)}sendUpdateStructure(i){t(this.sendUpdateStructure,i)}})}flush(){let e=this.#h();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#e.length,i=this.#f(),n=t+i;if(this.#o.isEmpty()||this.#o.unwrap().byteLength<n||t!==this.#p){let a=_o(n),s=new SharedArrayBuffer(a);this.#a=g.wrap(new Uint8Array(s,0,t)),this.#n=$t.use(s,t),this.#o=g.wrap(s),this.#p=t,this.#i.sendUpdateData(s)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===Vh.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Vh.READ))}broadcastFloat(e,t){return this.#g(new class{type=Ma.Float;address=e;capacity=8;put(i,n){i.writeFloat(t())}})}broadcastInteger(e,t){return this.#g(new class{type=Ma.Integer;address=e;capacity=8;put(i,n){i.writeInt(t())}})}broadcastFloats(e,t,i){return this.#g(new class{type=Ma.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(n,o){i?.(o),n.writeInt(t.length);for(let a of t)n.writeFloat(a)}})}broadcastIntegers(e,t,i){return this.#g(new class{type=Ma.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(n,o){i(o),n.writeInt(t.length),t.forEach(a=>n.writeInt(a))}})}broadcastByteArray(e,t,i){return this.#g(new class{type=Ma.ByteArray;address=e;capacity=4+t.byteLength;put(n,o){i(o),n.writeInt(t.byteLength),n.writeBytes(t)}})}#h(){if(this.#c){try{this.#l=g.wrap(this.#B())}catch(e){throw e}this.#c=!1}if(this.#l.nonEmpty()){let e=this.#l;return this.#l=g.None,e}return g.None}#f(){return this.#u===-1&&(this.#u=this.#y()+12),this.#u}terminate(){R.clear(this.#e),this.#l=g.None,this.#c=!1,this.#u=0}#m(e){I(!this.#c&&this.#l.isEmpty(),"Cannot flush while update is available");let t=this.#f();I(e.remaining>=t,"Insufficient data"),e.writeInt(this.#s),e.writeInt($c.START);let i=this.#a;for(let n=0;n<this.#e.length;n++){let o=i.nonEmpty()&&i.unwrap()[n]!==0;this.#e[n].put(e,o)}e.writeInt($c.END)}#y(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#g(e){return this.#e.push(e),this.#A(),{terminate:()=>{R.removeOpt(this.#e,e),this.#A()}}}#A(){this.#u=-1,this.#c=!0}#B(){let e=$t.create();e.writeInt($c.ID),e.writeInt(++this.#s),e.writeInt(this.#e.length);for(let{address:t,type:i}of this.#e)t.write(e),e.writeByte(i);return e.toArrayBuffer()}};var lx=class{#e;#t;#r=new ve;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:i,bpm:n,s0:o,s1:a,flags:s})=>{if(this.#t.metronomeEnabled&&rt.every(s,1)){let[l,c]=this.#e.signature,p=Q.fromSignature(1,c);for(let d of sn.iterate(t,i,p)){I(t<=d&&d<i,()=>`${d} out of bounds (${t}, ${i})`);let f=Math.floor(Q.pulsesToSamples(d-t,n,sampleRate));this.#i.push(new oP(d,o+f,l,c))}}this.#r.clear(o,a);for(let l=this.#i.length-1;l>=0;l--)this.#i[l].processAdd(this.#r,o,a)&&this.#i.splice(l,1)})}get output(){return this.#r}},oP=class{#e;#t=0;#r=0;constructor(e,t,i,n){I(t>=0&&t<128,`${t} out of bounds`),this.#e=Q.toParts(e,i,n).beats===0?880:440,this.#r=t}processAdd(e,t,i){let[n,o]=e.channels(),a=Math.floor(.002*sampleRate),s=Math.floor(.05*sampleRate);for(let l=Math.max(this.#r,t);l<i;l++){let c=Math.min(this.#t/a,1-(this.#t-a)/s),p=Math.sin(this.#t/sampleRate*Mi*this.#e)*.25*c*c;if(n[l]+=p,o[l]+=p,++this.#t>a+s)return!0}return this.#r=0,!1}};var ux=class{#e;#t;#r=!0;#i=!1;#n=null;#o=!1;#a=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new il}setCallback(e,t){return this.#t.add(e,t),K.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#a=0,this.#n=null}process(e){let t=!1,{timeInfo:i,timelineBoxAdapter:{box:n,markerTrack:o}}=this.#e,a=n.bpm.getValue(),s=i.transporting;if(s){let l=[],c=i.position,p=0,d=0,f=i.getLeapStateAndReset();for(;p<128;){if(this.#o||f){this.#o=!1;let q=o.events.lowerEqual(c);(this.#n?.at(0)??null)!==q&&(this.#n=Z(q)?[q,0]:null,t=!0)}let v=128-p,m=c+Q.samplesToPulses(v,a,sampleRate),y=null,x=Number.POSITIVE_INFINITY;if(o.enabled){let q=Array.from(Xe.take(o.events.iterateFrom(c),2));if(q.length>0){let[ge,se]=q;this.#n===null?ge.position>=c&&ge.position<m&&(y={type:"marker",prev:ge,next:se},x=ge.position):Z(se)&&se!==this.#n[0]&&ge.position<c&&se.position<m&&(y={type:"marker",prev:ge,next:se},x=se.position)}}let{isRecording:D,isCountingIn:M}=this.#e.timeInfo,{from:O,to:T,enabled:V}=n.loopArea;if(V.getValue()&&!(D||M)||this.#r){let q=T.getValue();c<q&&m>q&&q<x&&(y={type:"loop",target:O.getValue()},x=q)}if(this.#t.keyCount()>0)for(let q of this.#t.keys())c<q&&m>q&&q<x&&(y={type:"callback",position:q,callbacks:this.#t.get(q)},x=q);let te=!i.isCountingIn;if(y===null){let q=p+v;l.push({index:d++,p0:c,p1:m,s0:p,s1:q,bpm:a,flags:Sc.create(s,f,te,this.#i)}),f=!1,c=m,p=q}else{let q=()=>{if(x>c){let se=p+Q.pulsesToSamples(x-c,a,sampleRate)|0;se>p&&(l.push({index:d++,p0:c,p1:x,s0:p,s1:se,bpm:a,flags:Sc.create(s,f,te,this.#i)}),f=!1),c=x,p=se}},ge=()=>{if(p<128){let se=p+Q.pulsesToSamples(m-c,a,sampleRate)|0;l.push({index:d++,p0:c,p1:x,s0:p,s1:se,bpm:a,flags:Sc.create(!1,!1,!1,this.#i)}),p=se}};switch(y.type){case"loop":{q(),this.#r?(this.#e.timeInfo.pause(),ge()):(c=y.target,f=!0);break}case"marker":{let{prev:se,next:Re}=y;!Z(this.#n)||this.#n[0]!==se?this.#n=[se,0]:++this.#n[1]<se.plays||se.plays===0?(q(),c=se.position,f=!0):this.#n=[Re,0],t=!0;break}case"callback":{q(),y.callbacks.forEach(se=>se());break}}}this.#i=!1}e({blocks:l}),i.advanceTo(c),this.#a=c}else{if(this.#o||i.getLeapStateAndReset()){this.#o=!1;let d=o.events.lowerEqual(i.position);d!==null&&this.#n?.at(0)!==d&&(this.#n=[d,0],t=!0)}let l=this.#a,c=l+Q.samplesToPulses(128,a,sampleRate),p={blocks:[{index:0,p0:l,p1:c,s0:0,s1:128,bpm:a,flags:Sc.create(!1,!1,!1,!1)}]};e(p),this.#a=c}t&&this.#e.engineToClient.switchMarkerState(Z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var aP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},cx=class{#e;#t;constructor(e){this.#e=e,this.#t=w.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new aP(t,this.#e))}remove(e){}invalidate(e){}};var dx=class{constructor(e){this.uuid=e}waiting=g.None;playing=g.None},px=class{#e;#t;#r=[];#i=[];#n=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let i=t.uuid;this.#t.opt(i).ifSome(n=>{n.playing.ifSome(o=>this.#a(o.uuid)),n.playing=g.None,n.waiting=g.None}),this.#t.forEach(n=>{n.playing.nonEmpty()&&w.equals(n.playing.unwrap().uuid,i)&&(n.playing=g.None,this.#a(i));let o=n.waiting.flatMap(Ic);o.nonEmpty()&&w.equals(o.unwrap().uuid,i)&&(n.waiting=g.None)})}}}),this.#t=w.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let i=this.#t.getOrCreate(t,o=>new dx(o));if(i.playing.nonEmpty()&&i.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let n=i.waiting.flatMap(o=>o);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),i.waiting=g.None),console.debug(`schedulePlay(${w.toString(i.uuid)} > ${e})`),R.removeOpt(this.#n,e.uuid),i.waiting=g.wrap(g.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,n=>new dx(n)),i=t.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),t.waiting=g.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${w.toString(e)})`),t.waiting=g.wrap(g.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(i=>this.#n.push(i.uuid))),e.waiting=g.None,e.playing.ifSome(t=>this.#a(t.uuid)),e.playing=g.None}),this.#t.clear()}*iterate(e,t,i){let n=this.#t.getOrNull(e);if(n===null){yield{optClip:g.None,sectionFrom:t,sectionTo:i};return}if(n.waiting.nonEmpty()){let o=n.waiting.unwrap(),a=n.playing.mapOr(l=>l.duration,Q.Bar),s=Kn(i,a);s>=t?(t<s&&(yield{optClip:n.playing,sectionFrom:t,sectionTo:s}),n.waiting=g.None,n.playing.ifSome(l=>this.#a(l.uuid)),o.nonEmpty()?(n.playing=o,this.#o(o.unwrap().uuid)):n.playing=g.None,yield{optClip:n.playing,sectionFrom:s,sectionTo:i}):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}else if(n.playing.nonEmpty()){let o=n.playing.unwrap();if(o.box.triggerMode.loop.getValue())yield{optClip:n.playing,sectionFrom:t,sectionTo:i};else{let a=Kn(t,o.duration)+o.duration;a<=i?(yield{optClip:n.playing,sectionFrom:t,sectionTo:a},n.playing=g.None,this.#a(o.uuid),a<i&&(yield{optClip:g.None,sectionFrom:a,sectionTo:i})):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}}else yield{optClip:g.None,sectionFrom:t,sectionTo:i}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=g.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#n.slice()});return this.#r.length=0,this.#i.length=0,this.#n.length=0,e}return g.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#a(e){this.#i.push(e)}};var sP;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(sP||={});var lP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},hx=class{#e;#t;constructor(e){this.#e=e,this.#t=w.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new lP(t,this.#e))}remove(e){}invalidate(e){}};var fx=class r extends ir{static ClockRate=Q.fromSignature(1,24*4);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let i=t.filter(n=>n.sendTransportMessages.getValue()&&n.id.getValue()!=="");if(i.length===0){this.#t.length=0;return}i.forEach(n=>{let o=n.id.getValue(),a=n.delayInMs.getValue();this.#t.forEach(s=>this.context.sendMIDIData(o,s,a)),this.#t.length=0}),e.forEach(({p0:n,p1:o,s0:a,bpm:s,flags:l})=>{let c=a/sampleRate;if(rt.every(l,1))for(let p of sn.iterate(n,o,r.ClockRate)){let d=Q.pulsesToSeconds(p-n,s);i.forEach(f=>{let v=f.id.getValue(),m=f.delayInMs.getValue(),y=(c+d)*1e3+m;this.context.sendMIDIData(v,st.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var mx=class{#e;#t;#r;#i;#n=new Map;#o=[];constructor(e,t){this.#e=e,this.#t=new Uint32Array(t,0,2),this.#r=new Uint32Array(t,8),this.#i=(this.#r.length>>1)-1}send(e,t,i){let n=this.#n.get(e);if(el(n)){if(n=this.#o.length,n>=64)return console.error(`Too many MIDI devices: ${n}, max is 64`),!1;this.#n.set(e,n),this.#o.push(e),this.#e.postMessage({registerDevice:e,id:n})}let o=Atomics.load(this.#t,0),a=o+1&this.#i;if(a===Atomics.load(this.#t,1))return!1;let s=t.length,l=t[0]??0,c=t[1]??0,p=t[2]??0,d=s<<30|n<<24|l<<16|c<<8|p,f=i|0,v=o<<1;return this.#r[v]=d,this.#r[v+1]=f,Atomics.store(this.#t,0,a),this.#e.postMessage(null),!0}};var X$=!1,gx=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#y;#g;#A;#B;#F;#P;#k;#v;#x;#w;#E;#N;#S;#_=g.None;#$=g.None;#M=!1;#D=g.None;#I=g.None;#V=!1;#R=!0;#C=!1;#T=0;#O=0;#z=!0;#U=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:i,exportConfiguration:n,options:o}}){super();let{boxGraph:a,mandatoryBoxes:{rootBox:s,timelineBox:l}}=ba.decode(i);this.#e=new U,this.#t=DP.for(this.port),this.#r=a,this.#i=new xf,this.#E=new Int32Array(t),this.#n=qn.sender(this.#t.channel("engine-to-client"),d=>new class{log(f){d.dispatchAndForget(this.log,f)}error(f){d.dispatchAndForget(this.error,f)}fetchAudio(f){return d.dispatchAndReturn(this.fetchAudio,f)}fetchSoundfont(f){return d.dispatchAndReturn(this.fetchSoundfont,f)}notifyClipSequenceChanges(f){d.dispatchAndForget(this.notifyClipSequenceChanges,f)}switchMarkerState(f){d.dispatchAndForget(this.switchMarkerState,f)}ready(){d.dispatchAndForget(this.ready)}}),this.#a=new cx(this.#n),this.#l=new hx(this.#n),this.#s=w.newSet(d=>d.adapter.uuid),this.#p=new Hg,this.#d=new cf(l.bpm),this.#o=this.#e.own(new Kg(this)),this.#u=this.#o.adapterFor(s,Du),this.#c=this.#o.adapterFor(l,Fn),this.#h=new tf,this.#f=new rf(this.#h),this.#m=new re,this.#y=new ax,this.#k=new lx(this.#c,this.#i),this.#v=new fx(this,this.#u),this.#x=new ux(this,o),this.#S=w.newSet(d=>d),this.#w=sl.writer(k1(),e,d=>{let{transporting:f,isCountingIn:v,isRecording:m,position:y}=this.#i,x=this.#c.box.signature.denominator.getValue();d.position=y,d.playbackTimestamp=this.#O,d.countInBeatsRemaining=v?(this.#T-y)/Q.fromSignature(1,x):0,d.isPlaying=f,d.isRecording=m,d.isCountingIn=v}),this.#g=this.#e.own(sx.create(this.#t,"engine-live-data")),this.#B=new uy(this),this.#F=this.#e.own(new Se(this.#g,ac.PEAKS)),this.#P=new Xs;let c=new Float32Array(this.#P.numBins()),p=new Float32Array(this.#P.numBins());this.#e.own(this.#g.broadcastFloats(ac.SPECTRUM,c,d=>{this.#M||=d,d&&(c.set(this.#P.bins()),this.#P.decay=!0)})),this.#e.own(this.#g.broadcastFloats(ac.WAVEFORM,p,d=>{this.#M||=d,d&&p.set(this.#P.waveform())})),this.#A=this.#e.own(new px(this.#r)),this.#e.ownAll(IP(this.#r,this.#t.channel("engine-sync")),qn.executor(this.#t.channel("engine-commands"),{play:()=>this.#j(),stop:d=>this.#L(d),setPosition:d=>this.#K(d),prepareRecordingState:d=>this.#W(d),stopRecording:()=>this.#Z(),setMetronomeEnabled:d=>this.#i.metronomeEnabled=this.#C=d,setPlaybackTimestampEnabled:d=>this.#z=d,setCountInBarsTotal:d=>this.#U=d,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(d=>d.accept({visitAudioFileBox:f=>this.#a.getOrCreate(f.address.uuid).data.nonEmpty()&&f.pointerHub.nonEmpty()})??!0)),panic:()=>this.#V=!0,noteSignal:d=>{if(xa.isOn(d)){let{uuid:f,pitch:v,velocity:m}=d;this.optAudioUnit(f).ifSome(y=>y.midiDeviceChain.noteSequencer.pushRawNoteOn(v,m))}else if(xa.isOff(d)){let{uuid:f,pitch:v}=d;this.optAudioUnit(f).ifSome(m=>m.midiDeviceChain.noteSequencer.pushRawNoteOff(v))}},ignoreNoteRegion:d=>this.#S.add(d),scheduleClipPlay:d=>{d.forEach(f=>{let v=this.#r.findBox(f);if(v.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${w.toString(f)}'`);else{let m=bm.for(this.#o,v.unwrap());this.#A.schedulePlay(m)}}),this.#i.transporting=!0,this.#v.schedule(st.Start)},scheduleClipStop:d=>{d.forEach(f=>{let v=this.#r.findBox(f);v.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${w.toString(f)}'`):this.#A.scheduleStop(this.#o.adapterFor(v.unwrap(),mt))})},setupMIDI:(d,f)=>{this.#I=g.wrap(new mx(d,f))},terminate:()=>{this.#D.ifSome(d=>d.terminate()),this.#D=g.None,this.#R=!1,this.#S.clear(),this.#e.terminate()}}),this.#u.audioUnits.catchupAndSubscribe({onAdd:d=>{let f=w.toString(d.uuid),v=Z(n?.[f])?n[f]:sP.Default,m=new ox(this,d,v),y=this.#s.add(m);if(I(y,`Could not add ${m}`),m.adapter.isOutput){I(this.#$.isEmpty(),"Output can only assigned once."),this.#$=g.wrap(m);return}},onRemove:({uuid:d})=>this.#s.removeByKey(d).terminate(),onReorder:jn})),this.#N=g.wrap(n).match({none:()=>R.empty(),some:d=>Object.keys(d).map(f=>this.#s.get(w.parse(f)))}),this.#n.ready(),console.log=(...d)=>this.#n.log(d.join(", "))}ignoresRegion(e){return this.#S.hasKey(e)}process(e,t){if(!this.#R)return!1;if(Atomics.load(this.#E,0)===1)return!0;try{return this.render(e,t)}catch(i){return console.debug(i),this.#R=!1,this.#n.error(i),this.terminate(),!1}}render(e,[t]){if(!this.#R)return!1;if(this.#V)return F("Manual Panic");let i=this.#i.metronomeEnabled;this.#m.notify(0),this.#_.isEmpty()&&(this.#f.update(),this.#_=g.wrap(this.#f.sorted().concat()),X$&&console.debug(`%cAudio-Graph%c
|
|
26
|
-
${this.#
|
|
27
|
-
`)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let
|
|
25
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of r.seen.entries()){let s=n[1];if(e===n[0]){i(n);continue}if(r.external){let l=r.external.registry.get(n[0])?.id;if(e!==n[0]&&l){i(n);continue}}if(r.metadataRegistry.get(n[0])?.id){i(n);continue}if(s.cycle){i(n);continue}if(s.count>1&&r.reused==="ref"){i(n);continue}}}function Rs(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=r.seen.get(s),l=a.def??a.schema,c={...l};if(a.ref===null)return;let d=a.ref;if(a.ref=null,d){o(d);let p=r.seen.get(d).schema;p.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(p)):(Object.assign(l,p),Object.assign(l,c))}a.isParent||r.override({zodSchema:s,jsonSchema:l,path:a.path??[]})};for(let s of[...r.seen.entries()].reverse())o(s[0]);let i={};if(r.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){let s=r.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=r.external.uri(s)}Object.assign(i,t.def??t.schema);let n=r.external?.defs??{};for(let s of r.seen.entries()){let a=s[1];a.def&&a.defId&&(n[a.defId]=a.def)}r.external||Object.keys(n).length>0&&(r.target==="draft-2020-12"?i.$defs=n:i.definitions=n);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Kc(e,"input"),output:Kc(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function _r(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let o=r._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return _r(o.element,t);if(o.type==="set")return _r(o.valueType,t);if(o.type==="lazy")return _r(o.getter(),t);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return _r(o.innerType,t);if(o.type==="intersection")return _r(o.left,t)||_r(o.right,t);if(o.type==="record"||o.type==="map")return _r(o.keyType,t)||_r(o.valueType,t);if(o.type==="pipe")return _r(o.in,t)||_r(o.out,t);if(o.type==="object"){for(let i in o.shape)if(_r(o.shape[i],t))return!0;return!1}if(o.type==="union"){for(let i of o.options)if(_r(i,t))return!0;return!1}if(o.type==="tuple"){for(let i of o.items)if(_r(i,t))return!0;return!!(o.rest&&_r(o.rest,t))}return!1}var L_=(r,e={})=>t=>{let o=Cs({...t,processors:e});return Ze(r,o),Ts(o,r),Rs(o,r)},Kc=(r,e)=>t=>{let{libraryOptions:o,target:i}=t??{},n=Cs({...o??{},target:i,io:e,processors:{}});return Ze(r,n),Ts(n,r),Rs(n,r)};var C$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K_=(r,e,t,o)=>{let i=t;i.type="string";let{minimum:n,maximum:s,format:a,patterns:l,contentEncoding:c}=r._zod.bag;if(typeof n=="number"&&(i.minLength=n),typeof s=="number"&&(i.maxLength=s),a&&(i.format=C$[a]??a,i.format===""&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){let d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},W_=(r,e,t,o)=>{let i=t,{minimum:n,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=r._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof n=="number"&&(i.minimum=n,typeof d=="number"&&e.target!=="draft-04"&&(d>=n?delete i.minimum:delete i.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c),typeof s=="number"&&(i.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},Z_=(r,e,t,o)=>{t.type="boolean"},G_=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},q_=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},H_=(r,e,t,o)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},J_=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Q_=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},X_=(r,e,t,o)=>{t.not={}},Y_=(r,e,t,o)=>{},eP=(r,e,t,o)=>{},tP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},rP=(r,e,t,o)=>{let i=r._zod.def,n=_h(i.entries);n.every(s=>typeof s=="number")&&(t.type="number"),n.every(s=>typeof s=="string")&&(t.type="string"),t.enum=n},iP=(r,e,t,o)=>{let i=r._zod.def,n=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(s))}else n.push(s);if(n.length!==0)if(n.length===1){let s=n[0];t.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[s]:t.const=s}else n.every(s=>typeof s=="number")&&(t.type="number"),n.every(s=>typeof s=="string")&&(t.type="string"),n.every(s=>typeof s=="boolean")&&(t.type="boolean"),n.every(s=>s===null)&&(t.type="null"),t.enum=n},oP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},nP=(r,e,t,o)=>{let i=t,n=r._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=n.source},sP=(r,e,t,o)=>{let i=t,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=r._zod.bag;s!==void 0&&(n.minLength=s),a!==void 0&&(n.maxLength=a),l?l.length===1?(n.contentMediaType=l[0],Object.assign(i,n)):i.anyOf=l.map(c=>({...n,contentMediaType:c})):Object.assign(i,n)},aP=(r,e,t,o)=>{t.type="boolean"},lP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},cP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},dP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},pP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},hP=(r,e,t,o)=>{let i=t,n=r._zod.def,{minimum:s,maximum:a}=r._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ze(n.element,e,{...o,path:[...o.path,"items"]})},fP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="object",i.properties={};let s=n.shape;for(let c in s)i.properties[c]=Ze(s[c],e,{...o,path:[...o.path,"properties",c]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{let d=n.shape[c]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),n.catchall?._zod.def.type==="never"?i.additionalProperties=!1:n.catchall?n.catchall&&(i.additionalProperties=Ze(n.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Ay=(r,e,t,o)=>{let i=r._zod.def,n=i.inclusive===!1,s=i.options.map((a,l)=>Ze(a,e,{...o,path:[...o.path,n?"oneOf":"anyOf",l]}));n?t.oneOf=s:t.anyOf=s},mP=(r,e,t,o)=>{let i=r._zod.def,n=Ze(i.left,e,{...o,path:[...o.path,"allOf",0]}),s=Ze(i.right,e,{...o,path:[...o.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(n)?n.allOf:[n],...a(s)?s.allOf:[s]];t.allOf=l},gP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=n.items.map((f,g)=>Ze(f,e,{...o,path:[...o.path,s,g]})),c=n.rest?Ze(n.rest,e,{...o,path:[...o.path,a,...e.target==="openapi-3.0"?[n.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=l,c&&(i.items=c)):e.target==="openapi-3.0"?(i.items={anyOf:l},c&&i.items.anyOf.push(c),i.minItems=l.length,c||(i.maxItems=l.length)):(i.items=l,c&&(i.additionalItems=c));let{minimum:d,maximum:p}=r._zod.bag;typeof d=="number"&&(i.minItems=d),typeof p=="number"&&(i.maxItems=p)},vP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="object",(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ze(n.keyType,e,{...o,path:[...o.path,"propertyNames"]})),i.additionalProperties=Ze(n.valueType,e,{...o,path:[...o.path,"additionalProperties"]})},yP=(r,e,t,o)=>{let i=r._zod.def,n=Ze(i.innerType,e,o),s=e.seen.get(r);e.target==="openapi-3.0"?(s.ref=i.innerType,t.nullable=!0):t.anyOf=[n,{type:"null"}]},xP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},bP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},wP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},AP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},_P=(r,e,t,o)=>{let i=r._zod.def,n=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ze(n,e,o);let s=e.seen.get(r);s.ref=n},PP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,t.readOnly=!0},SP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},EP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},BP=(r,e,t,o)=>{let i=r._zod.innerType;Ze(i,e,o);let n=e.seen.get(r);n.ref=i},wy={string:K_,number:W_,boolean:Z_,bigint:G_,symbol:q_,null:H_,undefined:J_,void:Q_,never:X_,any:Y_,unknown:eP,date:tP,enum:rP,literal:iP,nan:oP,template_literal:nP,file:sP,success:aP,custom:lP,function:uP,transform:cP,map:dP,set:pP,array:hP,object:fP,union:Ay,intersection:mP,tuple:gP,record:vP,nullable:yP,nonoptional:xP,default:bP,prefault:wP,catch:AP,pipe:_P,readonly:PP,promise:SP,optional:EP,lazy:BP};function _y(r,e){if("_idmap"in r){let o=r,i=Cs({...e,processors:wy}),n={};for(let l of o._idmap.entries()){let[c,d]=l;Ze(d,i)}let s={},a={registry:o,uri:e?.uri,defs:n};i.external=a;for(let l of o._idmap.entries()){let[c,d]=l;Ts(i,d),s[c]=Rs(i,d)}if(Object.keys(n).length>0){let l=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:n}}return{schemas:s}}let t=Cs({...e,processors:wy});return Ze(r,t),Ts(t,r),Rs(t,r)}var Py=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Cs({processors:wy,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Ze(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Ts(this.ctx,e);let o=Rs(this.ctx,e),{"~standard":i,...n}=o;return n}};var JB={};var jh={};qo(jh,{ZodAny:()=>QP,ZodArray:()=>t1,ZodBase64:()=>Wy,ZodBase64URL:()=>Zy,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>Hy,ZodBoolean:()=>Jc,ZodCIDRv4:()=>Ly,ZodCIDRv6:()=>Ky,ZodCUID:()=>Ty,ZodCUID2:()=>Ry,ZodCatch:()=>w1,ZodCodec:()=>ix,ZodCustom:()=>Yh,ZodCustomStringFormat:()=>qc,ZodDate:()=>qh,ZodDefault:()=>m1,ZodDiscriminatedUnion:()=>i1,ZodE164:()=>Gy,ZodEmail:()=>Dy,ZodEmoji:()=>My,ZodEnum:()=>Zc,ZodFile:()=>p1,ZodFunction:()=>I1,ZodGUID:()=>Lh,ZodIPv4:()=>Uy,ZodIPv6:()=>jy,ZodIntersection:()=>o1,ZodJWT:()=>qy,ZodKSUID:()=>zy,ZodLazy:()=>B1,ZodLiteral:()=>d1,ZodMAC:()=>KP,ZodMap:()=>u1,ZodNaN:()=>_1,ZodNanoID:()=>Cy,ZodNever:()=>YP,ZodNonOptional:()=>tx,ZodNull:()=>HP,ZodNullable:()=>f1,ZodNumber:()=>Hc,ZodNumberFormat:()=>cl,ZodObject:()=>Jh,ZodOptional:()=>ex,ZodPipe:()=>rx,ZodPrefault:()=>v1,ZodPromise:()=>N1,ZodReadonly:()=>P1,ZodRecord:()=>Xh,ZodSet:()=>c1,ZodString:()=>Gc,ZodStringFormat:()=>qe,ZodSuccess:()=>b1,ZodSymbol:()=>GP,ZodTemplateLiteral:()=>E1,ZodTransform:()=>h1,ZodTuple:()=>s1,ZodType:()=>Se,ZodULID:()=>Oy,ZodURL:()=>Gh,ZodUUID:()=>Wo,ZodUndefined:()=>qP,ZodUnion:()=>Qh,ZodUnknown:()=>XP,ZodVoid:()=>e1,ZodXID:()=>Vy,ZodXor:()=>r1,_ZodString:()=>$y,_default:()=>g1,_function:()=>iN,any:()=>CF,array:()=>Hh,base64:()=>yF,base64url:()=>xF,bigint:()=>IF,boolean:()=>ZP,catch:()=>A1,check:()=>oN,cidrv4:()=>gF,cidrv6:()=>vF,codec:()=>eN,cuid:()=>lF,cuid2:()=>uF,custom:()=>nN,date:()=>RF,describe:()=>sN,discriminatedUnion:()=>LF,e164:()=>bF,email:()=>XB,emoji:()=>sF,enum:()=>Xy,file:()=>JF,float32:()=>EF,float64:()=>BF,function:()=>iN,guid:()=>YB,hash:()=>SF,hex:()=>PF,hostname:()=>_F,httpUrl:()=>nF,instanceof:()=>lN,int:()=>ky,int32:()=>FF,int64:()=>kF,intersection:()=>n1,ipv4:()=>hF,ipv6:()=>mF,json:()=>cN,jwt:()=>wF,keyof:()=>OF,ksuid:()=>pF,lazy:()=>F1,literal:()=>HF,looseObject:()=>UF,looseRecord:()=>WF,mac:()=>fF,map:()=>ZF,meta:()=>aN,nan:()=>YF,nanoid:()=>aF,nativeEnum:()=>qF,never:()=>Jy,nonoptional:()=>x1,null:()=>JP,nullable:()=>Wh,nullish:()=>QF,number:()=>WP,object:()=>VF,optional:()=>Kh,partialRecord:()=>KF,pipe:()=>Zh,prefault:()=>y1,preprocess:()=>dN,promise:()=>rN,readonly:()=>S1,record:()=>l1,refine:()=>k1,set:()=>GF,strictObject:()=>zF,string:()=>Iy,stringFormat:()=>AF,stringbool:()=>uN,success:()=>XF,superRefine:()=>$1,symbol:()=>DF,templateLiteral:()=>tN,transform:()=>Yy,tuple:()=>a1,uint32:()=>NF,uint64:()=>$F,ulid:()=>cF,undefined:()=>MF,union:()=>Qy,unknown:()=>ul,url:()=>oF,uuid:()=>eF,uuidv4:()=>tF,uuidv6:()=>rF,uuidv7:()=>iF,void:()=>TF,xid:()=>dF,xor:()=>jF});var Sy={};qo(Sy,{endsWith:()=>Tc,gt:()=>Ko,gte:()=>Ar,includes:()=>Mc,length:()=>ll,lowercase:()=>$c,lt:()=>Lo,lte:()=>ti,maxLength:()=>al,maxSize:()=>sl,mime:()=>Rc,minLength:()=>Sn,minSize:()=>Ms,multipleOf:()=>Ds,negative:()=>vy,nonnegative:()=>xy,nonpositive:()=>yy,normalize:()=>Oc,overwrite:()=>so,positive:()=>gy,property:()=>by,regex:()=>kc,size:()=>Ic,slugify:()=>jc,startsWith:()=>Cc,toLowerCase:()=>zc,toUpperCase:()=>Uc,trim:()=>Vc,uppercase:()=>Dc});var Wc={};qo(Wc,{ZodISODate:()=>By,ZodISODateTime:()=>Ey,ZodISODuration:()=>Ny,ZodISOTime:()=>Fy,date:()=>NP,datetime:()=>FP,duration:()=>kP,time:()=>IP});var Ey=w("ZodISODateTime",(r,e)=>{oA.init(r,e),qe.init(r,e)});function FP(r){return l_(Ey,r)}var By=w("ZodISODate",(r,e)=>{nA.init(r,e),qe.init(r,e)});function NP(r){return u_(By,r)}var Fy=w("ZodISOTime",(r,e)=>{sA.init(r,e),qe.init(r,e)});function IP(r){return c_(Fy,r)}var Ny=w("ZodISODuration",(r,e)=>{aA.init(r,e),qe.init(r,e)});function kP(r){return d_(Ny,r)}var QB=(r,e)=>{Fh.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Ih(r,t)},flatten:{value:t=>Nh(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,Ac,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,Ac,2)}},isEmpty:{get(){return r.issues.length===0}}})},R$=w("ZodError",QB),Rr=w("ZodError",QB,{Parent:Error});var $P=Sc(Rr),DP=Ec(Rr),MP=Bc(Rr),CP=Fc(Rr),TP=Ev(Rr),RP=Bv(Rr),OP=Fv(Rr),VP=Nv(Rr),zP=Iv(Rr),UP=kv(Rr),jP=$v(Rr),LP=Dv(Rr);var Se=w("ZodType",(r,e)=>(me.init(r,e),Object.assign(r["~standard"],{jsonSchema:{input:Kc(r,"input"),output:Kc(r,"output")}}),r.toJSONSchema=L_(r,{}),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(U.mergeDefs(e,{checks:[...e.checks??[],...t.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),r.clone=(t,o)=>br(r,t,o),r.brand=()=>r,r.register=(t,o)=>(t.add(r,o),r),r.parse=(t,o)=>$P(r,t,o,{callee:r.parse}),r.safeParse=(t,o)=>MP(r,t,o),r.parseAsync=async(t,o)=>DP(r,t,o,{callee:r.parseAsync}),r.safeParseAsync=async(t,o)=>CP(r,t,o),r.spa=r.safeParseAsync,r.encode=(t,o)=>TP(r,t,o),r.decode=(t,o)=>RP(r,t,o),r.encodeAsync=async(t,o)=>OP(r,t,o),r.decodeAsync=async(t,o)=>VP(r,t,o),r.safeEncode=(t,o)=>zP(r,t,o),r.safeDecode=(t,o)=>UP(r,t,o),r.safeEncodeAsync=async(t,o)=>jP(r,t,o),r.safeDecodeAsync=async(t,o)=>LP(r,t,o),r.refine=(t,o)=>r.check(k1(t,o)),r.superRefine=t=>r.check($1(t)),r.overwrite=t=>r.check(so(t)),r.optional=()=>Kh(r),r.nullable=()=>Wh(r),r.nullish=()=>Kh(Wh(r)),r.nonoptional=t=>x1(r,t),r.array=()=>Hh(r),r.or=t=>Qy([r,t]),r.and=t=>n1(r,t),r.transform=t=>Zh(r,Yy(t)),r.default=t=>g1(r,t),r.prefault=t=>y1(r,t),r.catch=t=>A1(r,t),r.pipe=t=>Zh(r,t),r.readonly=()=>S1(r),r.describe=t=>{let o=r.clone();return wr.add(o,{description:t}),o},Object.defineProperty(r,"description",{get(){return wr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return wr.get(r);let o=r.clone();return wr.add(o,t[0]),o},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),$y=w("_ZodString",(r,e)=>{nl.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(o,i,n)=>K_(r,o,i,n);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...o)=>r.check(kc(...o)),r.includes=(...o)=>r.check(Mc(...o)),r.startsWith=(...o)=>r.check(Cc(...o)),r.endsWith=(...o)=>r.check(Tc(...o)),r.min=(...o)=>r.check(Sn(...o)),r.max=(...o)=>r.check(al(...o)),r.length=(...o)=>r.check(ll(...o)),r.nonempty=(...o)=>r.check(Sn(1,...o)),r.lowercase=o=>r.check($c(o)),r.uppercase=o=>r.check(Dc(o)),r.trim=()=>r.check(Vc()),r.normalize=(...o)=>r.check(Oc(...o)),r.toLowerCase=()=>r.check(zc()),r.toUpperCase=()=>r.check(Uc()),r.slugify=()=>r.check(jc())}),Gc=w("ZodString",(r,e)=>{nl.init(r,e),$y.init(r,e),r.email=t=>r.check(Jv(Dy,t)),r.url=t=>r.check(Uh(Gh,t)),r.jwt=t=>r.check(my(qy,t)),r.emoji=t=>r.check(ty(My,t)),r.guid=t=>r.check(zh(Lh,t)),r.uuid=t=>r.check(Qv(Wo,t)),r.uuidv4=t=>r.check(Xv(Wo,t)),r.uuidv6=t=>r.check(Yv(Wo,t)),r.uuidv7=t=>r.check(ey(Wo,t)),r.nanoid=t=>r.check(ry(Cy,t)),r.guid=t=>r.check(zh(Lh,t)),r.cuid=t=>r.check(iy(Ty,t)),r.cuid2=t=>r.check(oy(Ry,t)),r.ulid=t=>r.check(ny(Oy,t)),r.base64=t=>r.check(py(Wy,t)),r.base64url=t=>r.check(hy(Zy,t)),r.xid=t=>r.check(sy(Vy,t)),r.ksuid=t=>r.check(ay(zy,t)),r.ipv4=t=>r.check(ly(Uy,t)),r.ipv6=t=>r.check(uy(jy,t)),r.cidrv4=t=>r.check(cy(Ly,t)),r.cidrv6=t=>r.check(dy(Ky,t)),r.e164=t=>r.check(fy(Gy,t)),r.datetime=t=>r.check(FP(t)),r.date=t=>r.check(NP(t)),r.time=t=>r.check(IP(t)),r.duration=t=>r.check(kP(t))});function Iy(r){return o_(Gc,r)}var qe=w("ZodStringFormat",(r,e)=>{Ge.init(r,e),$y.init(r,e)}),Dy=w("ZodEmail",(r,e)=>{H0.init(r,e),qe.init(r,e)});function XB(r){return Jv(Dy,r)}var Lh=w("ZodGUID",(r,e)=>{G0.init(r,e),qe.init(r,e)});function YB(r){return zh(Lh,r)}var Wo=w("ZodUUID",(r,e)=>{q0.init(r,e),qe.init(r,e)});function eF(r){return Qv(Wo,r)}function tF(r){return Xv(Wo,r)}function rF(r){return Yv(Wo,r)}function iF(r){return ey(Wo,r)}var Gh=w("ZodURL",(r,e)=>{J0.init(r,e),qe.init(r,e)});function oF(r){return Uh(Gh,r)}function nF(r){return Uh(Gh,{protocol:/^https?$/,hostname:Di.domain,...U.normalizeParams(r)})}var My=w("ZodEmoji",(r,e)=>{Q0.init(r,e),qe.init(r,e)});function sF(r){return ty(My,r)}var Cy=w("ZodNanoID",(r,e)=>{X0.init(r,e),qe.init(r,e)});function aF(r){return ry(Cy,r)}var Ty=w("ZodCUID",(r,e)=>{Y0.init(r,e),qe.init(r,e)});function lF(r){return iy(Ty,r)}var Ry=w("ZodCUID2",(r,e)=>{eA.init(r,e),qe.init(r,e)});function uF(r){return oy(Ry,r)}var Oy=w("ZodULID",(r,e)=>{tA.init(r,e),qe.init(r,e)});function cF(r){return ny(Oy,r)}var Vy=w("ZodXID",(r,e)=>{rA.init(r,e),qe.init(r,e)});function dF(r){return sy(Vy,r)}var zy=w("ZodKSUID",(r,e)=>{iA.init(r,e),qe.init(r,e)});function pF(r){return ay(zy,r)}var Uy=w("ZodIPv4",(r,e)=>{lA.init(r,e),qe.init(r,e)});function hF(r){return ly(Uy,r)}var KP=w("ZodMAC",(r,e)=>{cA.init(r,e),qe.init(r,e)});function fF(r){return s_(KP,r)}var jy=w("ZodIPv6",(r,e)=>{uA.init(r,e),qe.init(r,e)});function mF(r){return uy(jy,r)}var Ly=w("ZodCIDRv4",(r,e)=>{dA.init(r,e),qe.init(r,e)});function gF(r){return cy(Ly,r)}var Ky=w("ZodCIDRv6",(r,e)=>{pA.init(r,e),qe.init(r,e)});function vF(r){return dy(Ky,r)}var Wy=w("ZodBase64",(r,e)=>{fA.init(r,e),qe.init(r,e)});function yF(r){return py(Wy,r)}var Zy=w("ZodBase64URL",(r,e)=>{mA.init(r,e),qe.init(r,e)});function xF(r){return hy(Zy,r)}var Gy=w("ZodE164",(r,e)=>{gA.init(r,e),qe.init(r,e)});function bF(r){return fy(Gy,r)}var qy=w("ZodJWT",(r,e)=>{vA.init(r,e),qe.init(r,e)});function wF(r){return my(qy,r)}var qc=w("ZodCustomStringFormat",(r,e)=>{yA.init(r,e),qe.init(r,e)});function AF(r,e,t={}){return Lc(qc,r,e,t)}function _F(r){return Lc(qc,"hostname",Di.hostname,r)}function PF(r){return Lc(qc,"hex",Di.hex,r)}function SF(r,e){let t=e?.enc??"hex",o=`${r}_${t}`,i=Di[o];if(!i)throw new Error(`Unrecognized hash format: ${o}`);return Lc(qc,o,i,e)}var Hc=w("ZodNumber",(r,e)=>{jv.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(o,i,n)=>W_(r,o,i,n),r.gt=(o,i)=>r.check(Ko(o,i)),r.gte=(o,i)=>r.check(Ar(o,i)),r.min=(o,i)=>r.check(Ar(o,i)),r.lt=(o,i)=>r.check(Lo(o,i)),r.lte=(o,i)=>r.check(ti(o,i)),r.max=(o,i)=>r.check(ti(o,i)),r.int=o=>r.check(ky(o)),r.safe=o=>r.check(ky(o)),r.positive=o=>r.check(Ko(0,o)),r.nonnegative=o=>r.check(Ar(0,o)),r.negative=o=>r.check(Lo(0,o)),r.nonpositive=o=>r.check(ti(0,o)),r.multipleOf=(o,i)=>r.check(Ds(o,i)),r.step=(o,i)=>r.check(Ds(o,i)),r.finite=()=>r;let t=r._zod.bag;r.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),r.isFinite=!0,r.format=t.format??null});function WP(r){return p_(Hc,r)}var cl=w("ZodNumberFormat",(r,e)=>{xA.init(r,e),Hc.init(r,e)});function ky(r){return f_(cl,r)}function EF(r){return m_(cl,r)}function BF(r){return g_(cl,r)}function FF(r){return v_(cl,r)}function NF(r){return y_(cl,r)}var Jc=w("ZodBoolean",(r,e)=>{Mh.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Z_(r,t,o,i)});function ZP(r){return x_(Jc,r)}var Qc=w("ZodBigInt",(r,e)=>{Lv.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(o,i,n)=>G_(r,o,i,n),r.gte=(o,i)=>r.check(Ar(o,i)),r.min=(o,i)=>r.check(Ar(o,i)),r.gt=(o,i)=>r.check(Ko(o,i)),r.gte=(o,i)=>r.check(Ar(o,i)),r.min=(o,i)=>r.check(Ar(o,i)),r.lt=(o,i)=>r.check(Lo(o,i)),r.lte=(o,i)=>r.check(ti(o,i)),r.max=(o,i)=>r.check(ti(o,i)),r.positive=o=>r.check(Ko(BigInt(0),o)),r.negative=o=>r.check(Lo(BigInt(0),o)),r.nonpositive=o=>r.check(ti(BigInt(0),o)),r.nonnegative=o=>r.check(Ar(BigInt(0),o)),r.multipleOf=(o,i)=>r.check(Ds(o,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function IF(r){return w_(Qc,r)}var Hy=w("ZodBigIntFormat",(r,e)=>{bA.init(r,e),Qc.init(r,e)});function kF(r){return __(Hy,r)}function $F(r){return P_(Hy,r)}var GP=w("ZodSymbol",(r,e)=>{wA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>q_(r,t,o,i)});function DF(r){return S_(GP,r)}var qP=w("ZodUndefined",(r,e)=>{AA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>J_(r,t,o,i)});function MF(r){return E_(qP,r)}var HP=w("ZodNull",(r,e)=>{_A.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>H_(r,t,o,i)});function JP(r){return B_(HP,r)}var QP=w("ZodAny",(r,e)=>{PA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Y_(r,t,o,i)});function CF(){return F_(QP)}var XP=w("ZodUnknown",(r,e)=>{SA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>eP(r,t,o,i)});function ul(){return N_(XP)}var YP=w("ZodNever",(r,e)=>{EA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>X_(r,t,o,i)});function Jy(r){return I_(YP,r)}var e1=w("ZodVoid",(r,e)=>{BA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Q_(r,t,o,i)});function TF(r){return k_(e1,r)}var qh=w("ZodDate",(r,e)=>{FA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(o,i,n)=>tP(r,o,i,n),r.min=(o,i)=>r.check(Ar(o,i)),r.max=(o,i)=>r.check(ti(o,i));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function RF(r){return $_(qh,r)}var t1=w("ZodArray",(r,e)=>{NA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>hP(r,t,o,i),r.element=e.element,r.min=(t,o)=>r.check(Sn(t,o)),r.nonempty=t=>r.check(Sn(1,t)),r.max=(t,o)=>r.check(al(t,o)),r.length=(t,o)=>r.check(ll(t,o)),r.unwrap=()=>r.element});function Hh(r,e){return C_(t1,r,e)}function OF(r){let e=r._zod.def.shape;return Xy(Object.keys(e))}var Jh=w("ZodObject",(r,e)=>{IA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>fP(r,t,o,i),U.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>Xy(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:ul()}),r.loose=()=>r.clone({...r._zod.def,catchall:ul()}),r.strict=()=>r.clone({...r._zod.def,catchall:Jy()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>U.extend(r,t),r.safeExtend=t=>U.safeExtend(r,t),r.merge=t=>U.merge(r,t),r.pick=t=>U.pick(r,t),r.omit=t=>U.omit(r,t),r.partial=(...t)=>U.partial(ex,r,t[0]),r.required=(...t)=>U.required(tx,r,t[0])});function VF(r,e){let t={type:"object",shape:r??{},...U.normalizeParams(e)};return new Jh(t)}function zF(r,e){return new Jh({type:"object",shape:r,catchall:Jy(),...U.normalizeParams(e)})}function UF(r,e){return new Jh({type:"object",shape:r,catchall:ul(),...U.normalizeParams(e)})}var Qh=w("ZodUnion",(r,e)=>{Ch.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Ay(r,t,o,i),r.options=e.options});function Qy(r,e){return new Qh({type:"union",options:r,...U.normalizeParams(e)})}var r1=w("ZodXor",(r,e)=>{Qh.init(r,e),kA.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Ay(r,t,o,i),r.options=e.options});function jF(r,e){return new r1({type:"union",options:r,inclusive:!1,...U.normalizeParams(e)})}var i1=w("ZodDiscriminatedUnion",(r,e)=>{Qh.init(r,e),$A.init(r,e)});function LF(r,e,t){return new i1({type:"union",options:e,discriminator:r,...U.normalizeParams(t)})}var o1=w("ZodIntersection",(r,e)=>{DA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>mP(r,t,o,i)});function n1(r,e){return new o1({type:"intersection",left:r,right:e})}var s1=w("ZodTuple",(r,e)=>{Kv.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>gP(r,t,o,i),r.rest=t=>r.clone({...r._zod.def,rest:t})});function a1(r,e,t){let o=e instanceof me,i=o?t:e,n=o?e:null;return new s1({type:"tuple",items:r,rest:n,...U.normalizeParams(i)})}var Xh=w("ZodRecord",(r,e)=>{MA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>vP(r,t,o,i),r.keyType=e.keyType,r.valueType=e.valueType});function l1(r,e,t){return new Xh({type:"record",keyType:r,valueType:e,...U.normalizeParams(t)})}function KF(r,e,t){let o=br(r);return o._zod.values=void 0,new Xh({type:"record",keyType:o,valueType:e,...U.normalizeParams(t)})}function WF(r,e,t){return new Xh({type:"record",keyType:r,valueType:e,mode:"loose",...U.normalizeParams(t)})}var u1=w("ZodMap",(r,e)=>{CA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>dP(r,t,o,i),r.keyType=e.keyType,r.valueType=e.valueType});function ZF(r,e,t){return new u1({type:"map",keyType:r,valueType:e,...U.normalizeParams(t)})}var c1=w("ZodSet",(r,e)=>{TA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>pP(r,t,o,i),r.min=(...t)=>r.check(Ms(...t)),r.nonempty=t=>r.check(Ms(1,t)),r.max=(...t)=>r.check(sl(...t)),r.size=(...t)=>r.check(Ic(...t))});function GF(r,e){return new c1({type:"set",valueType:r,...U.normalizeParams(e)})}var Zc=w("ZodEnum",(r,e)=>{RA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(o,i,n)=>rP(r,o,i,n),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(o,i)=>{let n={};for(let s of o)if(t.has(s))n[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Zc({...e,checks:[],...U.normalizeParams(i),entries:n})},r.exclude=(o,i)=>{let n={...e.entries};for(let s of o)if(t.has(s))delete n[s];else throw new Error(`Key ${s} not found in enum`);return new Zc({...e,checks:[],...U.normalizeParams(i),entries:n})}});function Xy(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(o=>[o,o])):r;return new Zc({type:"enum",entries:t,...U.normalizeParams(e)})}function qF(r,e){return new Zc({type:"enum",entries:r,...U.normalizeParams(e)})}var d1=w("ZodLiteral",(r,e)=>{OA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>iP(r,t,o,i),r.values=new Set(e.values),Object.defineProperty(r,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function HF(r,e){return new d1({type:"literal",values:Array.isArray(r)?r:[r],...U.normalizeParams(e)})}var p1=w("ZodFile",(r,e)=>{VA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>sP(r,t,o,i),r.min=(t,o)=>r.check(Ms(t,o)),r.max=(t,o)=>r.check(sl(t,o)),r.mime=(t,o)=>r.check(Rc(Array.isArray(t)?t:[t],o))});function JF(r){return T_(p1,r)}var h1=w("ZodTransform",(r,e)=>{zA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>cP(r,t,o,i),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Bs(r.constructor.name);t.addIssue=n=>{if(typeof n=="string")t.issues.push(U.issue(n,t.value,e));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=r),t.issues.push(U.issue(s))}};let i=e.transform(t.value,t);return i instanceof Promise?i.then(n=>(t.value=n,t)):(t.value=i,t)}});function Yy(r){return new h1({type:"transform",transform:r})}var ex=w("ZodOptional",(r,e)=>{UA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>EP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function Kh(r){return new ex({type:"optional",innerType:r})}var f1=w("ZodNullable",(r,e)=>{jA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>yP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function Wh(r){return new f1({type:"nullable",innerType:r})}function QF(r){return Kh(Wh(r))}var m1=w("ZodDefault",(r,e)=>{LA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>bP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function g1(r,e){return new m1({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var v1=w("ZodPrefault",(r,e)=>{KA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>wP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function y1(r,e){return new v1({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var tx=w("ZodNonOptional",(r,e)=>{WA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>xP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function x1(r,e){return new tx({type:"nonoptional",innerType:r,...U.normalizeParams(e)})}var b1=w("ZodSuccess",(r,e)=>{ZA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>aP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function XF(r){return new b1({type:"success",innerType:r})}var w1=w("ZodCatch",(r,e)=>{GA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>AP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function A1(r,e){return new w1({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var _1=w("ZodNaN",(r,e)=>{qA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>oP(r,t,o,i)});function YF(r){return M_(_1,r)}var rx=w("ZodPipe",(r,e)=>{HA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>_P(r,t,o,i),r.in=e.in,r.out=e.out});function Zh(r,e){return new rx({type:"pipe",in:r,out:e})}var ix=w("ZodCodec",(r,e)=>{rx.init(r,e),Th.init(r,e)});function eN(r,e,t){return new ix({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var P1=w("ZodReadonly",(r,e)=>{JA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>PP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function S1(r){return new P1({type:"readonly",innerType:r})}var E1=w("ZodTemplateLiteral",(r,e)=>{QA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>nP(r,t,o,i)});function tN(r,e){return new E1({type:"template_literal",parts:r,...U.normalizeParams(e)})}var B1=w("ZodLazy",(r,e)=>{e_.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>BP(r,t,o,i),r.unwrap=()=>r._zod.def.getter()});function F1(r){return new B1({type:"lazy",getter:r})}var N1=w("ZodPromise",(r,e)=>{YA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>SP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function rN(r){return new N1({type:"promise",innerType:r})}var I1=w("ZodFunction",(r,e)=>{XA.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>uP(r,t,o,i)});function iN(r){return new I1({type:"function",input:Array.isArray(r?.input)?a1(r?.input):r?.input??Hh(ul()),output:r?.output??ul()})}var Yh=w("ZodCustom",(r,e)=>{t_.init(r,e),Se.init(r,e),r._zod.processJSONSchema=(t,o,i)=>lP(r,t,o,i)});function oN(r){let e=new Xe({check:"custom"});return e._zod.check=r,e}function nN(r,e){return R_(Yh,r??(()=>!0),e)}function k1(r,e={}){return O_(Yh,r,e)}function $1(r){return V_(r)}var sN=z_,aN=U_;function lN(r,e={error:`Input not instance of ${r.name}`}){let t=new Yh({type:"custom",check:"custom",fn:o=>o instanceof r,abort:!0,...U.normalizeParams(e)});return t._zod.bag.Class=r,t}var uN=(...r)=>j_({Codec:ix,Boolean:Jc,String:Gc},...r);function cN(r){let e=F1(()=>Qy([Iy(r),WP(),ZP(),JP(),Hh(e),l1(Iy(),e)]));return e}function dN(r,e){return Zh(Yy(r),e)}var V$={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function z$(r){bt({customError:r})}function U$(){return bt().customError}var D1;D1||(D1={});var G={...jh,...Sy,iso:Wc};function j$(r,e){let t=r.$schema;return t==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":t==="http://json-schema.org/draft-07/schema#"?"draft-7":t==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function L$(r,e){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let t=r.slice(1).split("/").filter(Boolean);if(t.length===0)return e.rootSchema;let o=e.version==="draft-2020-12"?"$defs":"definitions";if(t[0]===o){let i=t[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${r}`);return e.defs[i]}throw new Error(`Reference not found: ${r}`)}function pN(r,e){if(r.not!==void 0){if(typeof r.not=="object"&&Object.keys(r.not).length===0)return G.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let i=r.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return G.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let n=L$(i,e),s=sr(n,e);return e.refs.set(i,s),e.processing.delete(i),s}if(r.enum!==void 0){let i=r.enum;if(e.version==="openapi-3.0"&&r.nullable===!0&&i.length===1&&i[0]===null)return G.null();if(i.length===0)return G.never();if(i.length===1)return G.literal(i[0]);if(i.every(s=>typeof s=="string"))return G.enum(i);let n=i.map(s=>G.literal(s));return n.length<2?n[0]:G.union([n[0],n[1],...n.slice(2)])}if(r.const!==void 0)return G.literal(r.const);let t=r.type;if(Array.isArray(t)){let i=t.map(n=>{let s={...r,type:n};return pN(s,e)});return i.length===0?G.never():i.length===1?i[0]:G.union(i)}if(!t)return G.any();let o;switch(t){case"string":{let i=G.string();if(r.format){let n=r.format;n==="email"?i=i.check(G.email()):n==="uri"||n==="uri-reference"?i=i.check(G.url()):n==="uuid"||n==="guid"?i=i.check(G.uuid()):n==="date-time"?i=i.check(G.iso.datetime()):n==="date"?i=i.check(G.iso.date()):n==="time"?i=i.check(G.iso.time()):n==="duration"?i=i.check(G.iso.duration()):n==="ipv4"?i=i.check(G.ipv4()):n==="ipv6"?i=i.check(G.ipv6()):n==="mac"?i=i.check(G.mac()):n==="cidr"?i=i.check(G.cidrv4()):n==="cidr-v6"?i=i.check(G.cidrv6()):n==="base64"?i=i.check(G.base64()):n==="base64url"?i=i.check(G.base64url()):n==="e164"?i=i.check(G.e164()):n==="jwt"?i=i.check(G.jwt()):n==="emoji"?i=i.check(G.emoji()):n==="nanoid"?i=i.check(G.nanoid()):n==="cuid"?i=i.check(G.cuid()):n==="cuid2"?i=i.check(G.cuid2()):n==="ulid"?i=i.check(G.ulid()):n==="xid"?i=i.check(G.xid()):n==="ksuid"&&(i=i.check(G.ksuid()))}typeof r.minLength=="number"&&(i=i.min(r.minLength)),typeof r.maxLength=="number"&&(i=i.max(r.maxLength)),r.pattern&&(i=i.regex(new RegExp(r.pattern))),o=i;break}case"number":case"integer":{let i=t==="integer"?G.number().int():G.number();typeof r.minimum=="number"&&(i=i.min(r.minimum)),typeof r.maximum=="number"&&(i=i.max(r.maximum)),typeof r.exclusiveMinimum=="number"?i=i.gt(r.exclusiveMinimum):r.exclusiveMinimum===!0&&typeof r.minimum=="number"&&(i=i.gt(r.minimum)),typeof r.exclusiveMaximum=="number"?i=i.lt(r.exclusiveMaximum):r.exclusiveMaximum===!0&&typeof r.maximum=="number"&&(i=i.lt(r.maximum)),typeof r.multipleOf=="number"&&(i=i.multipleOf(r.multipleOf)),o=i;break}case"boolean":{o=G.boolean();break}case"null":{o=G.null();break}case"object":{let i={},n=r.properties||{},s=new Set(r.required||[]);for(let[l,c]of Object.entries(n)){let d=sr(c,e);i[l]=s.has(l)?d:d.optional()}if(r.propertyNames){let l=sr(r.propertyNames,e),c=r.additionalProperties&&typeof r.additionalProperties=="object"?sr(r.additionalProperties,e):G.any();if(Object.keys(i).length===0){o=G.record(l,c);break}let d=G.object(i).passthrough(),p=G.looseRecord(l,c);o=G.intersection(d,p);break}if(r.patternProperties){let l=r.patternProperties,c=Object.keys(l),d=[];for(let f of c){let g=sr(l[f],e),v=G.string().regex(new RegExp(f));d.push(G.looseRecord(v,g))}let p=[];if(Object.keys(i).length>0&&p.push(G.object(i).passthrough()),p.push(...d),p.length===0)o=G.object({}).passthrough();else if(p.length===1)o=p[0];else{let f=G.intersection(p[0],p[1]);for(let g=2;g<p.length;g++)f=G.intersection(f,p[g]);o=f}break}let a=G.object(i);r.additionalProperties===!1?o=a.strict():typeof r.additionalProperties=="object"?o=a.catchall(sr(r.additionalProperties,e)):o=a.passthrough();break}case"array":{let i=r.prefixItems,n=r.items;if(i&&Array.isArray(i)){let s=i.map(l=>sr(l,e)),a=n&&typeof n=="object"&&!Array.isArray(n)?sr(n,e):void 0;a?o=G.tuple(s).rest(a):o=G.tuple(s),typeof r.minItems=="number"&&(o=o.check(G.minLength(r.minItems))),typeof r.maxItems=="number"&&(o=o.check(G.maxLength(r.maxItems)))}else if(Array.isArray(n)){let s=n.map(l=>sr(l,e)),a=r.additionalItems&&typeof r.additionalItems=="object"?sr(r.additionalItems,e):void 0;a?o=G.tuple(s).rest(a):o=G.tuple(s),typeof r.minItems=="number"&&(o=o.check(G.minLength(r.minItems))),typeof r.maxItems=="number"&&(o=o.check(G.maxLength(r.maxItems)))}else if(n!==void 0){let s=sr(n,e),a=G.array(s);typeof r.minItems=="number"&&(a=a.min(r.minItems)),typeof r.maxItems=="number"&&(a=a.max(r.maxItems)),o=a}else o=G.array(G.any());break}default:throw new Error(`Unsupported type: ${t}`)}return r.description&&(o=o.describe(r.description)),r.default!==void 0&&(o=o.default(r.default)),o}function sr(r,e){if(typeof r=="boolean")return r?G.any():G.never();let t=pN(r,e),o=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){let i=r.anyOf.map(s=>sr(s,e)),n=G.union(i);t=o?G.intersection(t,n):n}if(r.oneOf&&Array.isArray(r.oneOf)){let i=r.oneOf.map(s=>sr(s,e)),n=G.xor(i);t=o?G.intersection(t,n):n}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)t=o?t:G.any();else{let i=o?t:sr(r.allOf[0],e),n=o?0:1;for(let s=n;s<r.allOf.length;s++)i=G.intersection(i,sr(r.allOf[s],e));t=i}return r.nullable===!0&&e.version==="openapi-3.0"&&(t=G.nullable(t)),r.readOnly===!0&&(t=G.readonly(t)),t}function hN(r,e){if(typeof r=="boolean")return r?G.any():G.never();let t=j$(r,e?.defaultTarget),o=r.$defs||r.definitions||{};return sr(r,{version:t,defs:o,refs:new Map,processing:new Set,rootSchema:r})}var M1={};qo(M1,{bigint:()=>G$,boolean:()=>Z$,date:()=>q$,number:()=>W$,string:()=>K$});function K$(r){return n_(Gc,r)}function W$(r){return h_(Hc,r)}function Z$(r){return b_(Jc,r)}function G$(r){return A_(Qc,r)}function q$(r){return D_(qh,r)}bt(Wv());var fN=Dt.object({name:Dt.string(),bpm:Dt.number(),duration:Dt.number(),sample_rate:Dt.number(),origin:Dt.enum(["openDAW","recording","import"])});var ZQ=fN.extend({uuid:b.zType(Dt)});var H$,J$,Q$,X$,Y$,eD;H$=new WeakMap,J$=new WeakMap,Q$=new WeakMap,X$=new WeakMap,Y$=new WeakMap,eD=new WeakMap;var Xc=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},tD,rD,C1,T1,R1,iD,oD;rD=new WeakMap,C1=new WeakMap,T1=new WeakMap,R1=new WeakMap,iD=new WeakMap,tD=new WeakSet,oD=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let o=Ie(t.box,vo);D(o.isAttached(),"SelectionBox is not attached");let i=o.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${o.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),n={box:o,selectable:i};Xc(this,R1,"f").proxy.onSelected(i),D(Xc(this,C1,"f").add(n),"Could not add to entityMap"),D(Xc(this,T1,"f").add(n),"Could not add to selectableMap")},onRemoved:t=>{let o=Ie(t.box,vo),i=Xc(this,C1,"f").removeByKey(o.address.uuid);D(i.box===o,"Broken selection");let n=i.selectable;Xc(this,R1,"f").proxy.onDeselected(n),Xc(this,T1,"f").removeByKey(n.address)}},u.Selection)};var mN=Dt.object({name:Dt.string(),size:Dt.number().int(),url:Dt.string(),license:Dt.string(),origin:Dt.enum(["openDAW","import"])});var aX=mN.extend({uuid:b.zType(Dt)});var gN;(function(r){r.cut=(e,t,o)=>{if(console.debug("cut",e.position,e.complete,t),!(e.position>=t||t>=e.complete))if(Tw.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;e.duration=t-i,e.copyTo({position:t,duration:n-t,loopOffset:cd(s+(t-i),a),consolidate:o})}else return F("Not yet implemented")},r.clip=(e,t,o)=>{if(Tw.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;if(n-o<=0)return F(`duration will zero or negative(${n-o})`);e.duration=t-i,e.copyTo({position:o,duration:n-o,loopOffset:cd(s+(o-i),a)})}else return F("Not yet implemented")}})(gN||(gN={}));var Yc;(e=>e.create=(t,o,i,n)=>0|(t?1:0)|(o?2:0)|(i?4:0)|(n?8:0))(Yc||={});var Ee=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#o;#n=0;#s=0;#a=0;#l=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=C.create(()=>new Sl(r.RMS_WINDOW),2),this.#o=this.#e.broadcastFloats(this.#t,this.#r,o=>{this.#r[0]=this.#n,this.#r[1]=this.#s,this.#r[2]=this.#a,this.#r[3]=this.#l})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#n=0,this.#s=0}process(e,t,o=0,i=128){let n=i-o,s=r.PEAK_DECAY**n,a=0,l=0;for(let c=o;c<i;c++){let d=Math.abs(e[c]),p=Math.abs(t[c]);d>a&&(a=d),p>l&&(l=p)}this.#n=Math.max(a,this.#n*s),this.#s=Math.max(l,this.#s*s),this.#a=this.#i[0].processBlock(e,o,i),this.#l=this.#i[1].processBlock(t,o,i)}processStereo([e,t],o=0,i=128){this.process(e,t,o,i)}terminate(){this.#o.terminate()}};var ox=class{#e=new O;#t;#r;#i;#o=m.None;#n;constructor(e,t){this.#t=e,this.#r=t,this.#i=new ie,this.#n=this.#r.getValue(),this.#e.own(this.#r.subscribe(o=>{this.#n=o.getValue(),this.#i.notify(this)}))}get adapter(){return this.#r}get address(){return this.#r.address}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#n}getUnitValue(){return this.#r.valueMapping.x(this.#n)}onStartAutomation(){D(this.#o.isEmpty(),"Already broadcasting"),this.#o=m.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#n!==t?(this.#n=t,!0):!1}onStopAutomation(){D(this.#o.nonEmpty(),"Never started broadcasting"),this.#o.unwrap().terminate(),this.#o=m.None,this.#n=this.#r.getValue()}own(e){return this.#e.own(e)}ownAll(...e){this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#e.terminate()}};var ed=class{#e;constructor(){this.#e=new wf}add(e,t){this.#e.add(e,t)}get(e){return this.#e.get(e)}forEach(e){return this.#e.forEach(e)}clear(){this.#e.clear()}};var ar=class{#e=new O;#t;#r;#i;#o;#n=m.None;constructor(e){this.#t=e,this.#r=new ed,this.#i=[],this.#o=[]}parameterChanged(e,t){return F(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#t}get eventInput(){return this.#r}bindParameter(e){let t=new ox(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:o=>{this.#n.isEmpty()&&(this.#n=m.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#o.push(t),t.onStartAutomation()},onRemoved:o=>{C.remove(this.#o,t),this.#o.length===0&&(this.#n.ifSome(i=>i.terminate()),this.#n=m.None),t.onStopAutomation()}},u.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#o.forEach(o=>{o.updateAutomation(e)&&this.parameterChanged(o,t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e,0))}own(e){return this.#e.own(e)}ownAll(...e){return this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#n.ifSome(e=>e.terminate()),this.#n=m.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var ef;(e=>e.isOfType=t=>t.type==="update-event")(ef||={});var nx=class extends ar{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>C.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:o,flags:i},n)=>{if(nt.every(i,1))for(let s of po.iterate(t,o,Cf)){let a={type:"update-event",position:s};this.#e.forEach(l=>l.add(n,a))}})}toString(){return`{${this.constructor.name}}`}};var Me=class extends ar{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:o,p0:i,s0:n,s1:s,bpm:a}=t,l=null,c=n;for(let d of this.eventInput.get(o)){let p=d.position-i,f=Math.abs(p)<1e-7?n:n+Math.floor(X.pulsesToSamples(p,a,sampleRate));D(n<=f&&f<=s,()=>`${f} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),l?.forEach(g=>this.handleEvent(g)),l=null,c<f&&(this.processAudio(t,c,f),c=f),ef.isOfType(d)?this.updateParameters(d.position,n/sampleRate+X.pulsesToSeconds(d.position-i,a)):(l??=[]).push(d)}l?.forEach(d=>this.handleEvent(d)),l=null,c<s&&this.processAudio(t,c,s)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return F(`${this} received an event but has no accepting method.`)}finishProcess(){}};var sx=class r{static#e=S.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#o;#n;feedback=.7;cross=0;wet=.75;dry=.75;#s=0;#a=0;#l=0;#u=0;#c=0;#d=!1;#p=!1;constructor(e,t){let o=Fn(e);this.#t=o,this.#r=[new Float32Array(o),new Float32Array(o)],this.#i=[new Et,new Et],this.#o=new co,this.#n=t}reset(){this.#a=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#p=!1),this.#m()}set offset(e){D(0<=e&&e<this.#t,"Out of bounds"),this.#u!==e&&(this.#u=e,this.#d?this.#v():this.#m())}get offset(){return this.#u}set filter(e){e===0?this.#o.identity():e>0?this.#o.setHighpassParams(r.#e.y(e)):e<0&&this.#o.setLowpassParams(r.#e.y(1+e))}process(e,t,o,i){this.#p?this.#f(e,t,o,i):this.#h(e,t,o,i),this.#d=!0}#h(e,t,o,i){let n=this.#t-1,s=this.#r,a=this.feedback,l=this.wet,c=this.dry,d=this.#a,p=d-Math.floor(this.#l);p<0&&(p+=this.#t);let f=e[0],g=e[1],v=t[0],x=t[1],y=this.#i[0],M=this.#i[1],T=s[0],L=s[1];for(let R=o;R<i;++R){let z=f[R],ee=g[R],te=y.processFrame(this.#o,T[p]*.96),H=M.processFrame(this.#o,L[p]*.96),ye=this.cross*(H-te),le=te+ye,Oe=H-ye;T[d]=(z+le)*a+1e-18-1e-18,L[d]=(ee+Oe)*a+1e-18-1e-18,v[R]=le*l+z*c,x[R]=Oe*l+ee*c,p=++p&n,d=++d&n}this.#a=d}#f(e,t,o,i){let n=this.#t-1,s=this.#r,a=this.feedback,l=this.wet,c=this.dry,d=this.#a;for(let p=o;p<i;++p){0<this.#c?(this.#l+=this.#s,this.#c--):(this.#l=this.#u,this.#p=!1);let f=d-this.#l;f<0&&(f+=this.#t);let g=f|0,v=f-g,x=e[0][p],y=e[1][p],M=s[0][g],T=s[0][g],L=this.#i[0].processFrame(this.#o,M+v*(s[0][g+1&n]-M)),R=this.#i[1].processFrame(this.#o,T+v*(s[1][g+1&n]-T));s[0][d]=x+L*a+1e-18-1e-18,s[1][d]=y+L*a+1e-18-1e-18,t[0][p]=L*l+x*c,t[1][p]=R*l+y*c,d=++d&n}this.#a=d}#m(){this.#l=this.#u,this.#c=0,this.#p=!1}#v(){this.#u!==this.#l&&(this.#c=this.#n,this.#s=(this.#u-this.#l)/this.#c,this.#p=!0)}};var ax=class r extends Me{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#o;#n=m.None;#s=!0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address));let{delay:o,feedback:i,cross:n,filter:s,dry:a,wet:l}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(o)),this.parameterFeedback=this.own(this.bindParameter(i)),this.parameterCross=this.own(this.bindParameter(n)),this.parameterFilter=this.own(this.bindParameter(s)),this.parameterDry=this.own(this.bindParameter(a)),this.parameterWet=this.own(this.bindParameter(l));let c=X.pulsesToSamples(ur.toPPQN(mi.OffsetFractions[0]),30,sampleRate),d=Math.floor(.5*sampleRate);this.#o=new sx(c,d),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},o,i){if(this.#n.isEmpty())return;if(this.#s||nt.some(t,8)){let s=this.parameterDelay.getValue(),a=ur.toPPQN(mi.OffsetFractions[s]);this.#o.offset=X.pulsesToSamples(a,e,sampleRate),this.#s=!1}let n=this.#n.unwrap();this.#o.process(n.channels(),this.#r.channels(),o,i),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),o,i)}parameterChanged(e){e===this.parameterDelay?this.#s=!0:e===this.parameterFeedback?this.#o.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#o.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#o.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#o.dry=Ve(this.parameterDry.getValue()):e===this.parameterWet&&(this.#o.wet=Ve(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var tf=class r extends ar{static ID=0;#e=r.ID++;#t;#r;#i;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#o.isEmpty())return;let t=this.#o.unwrap(),[o,i]=t.channels(),[n,s]=this.#r.channels();for(let a=0;a<128;a++)n[a]=o[a],s[a]=i[a];this.#i.process(n,s)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var td=class r extends ar{static ID=0;#e=r.ID++;#t;#r;#i;#o;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return m.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#t.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#o.push(e),{terminate:()=>{C.remove(this.#o,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,o]=this.#r.channels();for(let i of this.#o){let[n,s]=i.channels();for(let a=0;a<128;a++)t[a]+=n[a],o[a]+=s[a]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var pe;(a=>{a.Comparator=(l,c)=>{let d=l.position-c.position;return d!==0?d:l.type==="note-complete-event"?-1:c.type==="note-complete-event"?1:0},a.start=(l,c,d,p,f=0)=>({type:"note-event",position:l,duration:c,pitch:d,velocity:p,cent:f,id:++s}),a.startWith=(l,c,d)=>({type:"note-event",position:c??l.position,duration:d??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++s}),a.stop=({id:l,pitch:c},d)=>({type:"note-complete-event",position:d,pitch:c,id:l}),a.isStart=l=>l.type==="note-event"&&"id"in l&&typeof l.id=="number",a.isStop=l=>l.type==="note-complete-event";let s=0})(pe||={});var Zo=class{#e=new O;#t;#r;#i;#o=m.None;constructor(e,t,o){this.#t=e,this.#r=this.#e.own(new ki(t,o)),this.#i=new Array(16)}setNoteEventSource(e){return D(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),this.#t.reset(),W.create(()=>{this.#o=m.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:o,flags:i}){if(!this.#o.isEmpty()){for(let n of this.#o.unwrap().processNotes(t,o,i))this.#i.push(n);this.#i.sort(pe.Comparator).forEach(n=>{n.pitch>=0&&n.pitch<=127&&(this.#t.eventInput.add(e,n),this.#n(n))}),this.#i.length=0}}clear(){}terminate(){this.#e.terminate()}#n(e){pe.isStart(e)?this.#r.noteOn(e.pitch):pe.isStop(e)&&this.#r.noteOff(e.pitch)}};var O1;(e=>e.NotSet={start:()=>F("VoicingStrategy.start"),stop:()=>F("VoicingStrategy.stop"),forceStop:()=>Jo,process:()=>F("VoicingStrategy.process"),reset:Jo,processing:()=>C.empty()})(O1||={});var lx=class{#e;#t=[];constructor(e=O1.NotSet){this.#e=e}set strategy(e){this.#t.push(this.#e),this.#e.forceStop(),this.#e=e}get strategy(){return this.#e}start(e){this.#e.start(e)}stop(e){this.#e.stop(e)}process(e,t,o,i){this.#e.process(e,t,o,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].process(e,t,o,i)&&this.#t.splice(n,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var ux=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let n=0;n<this.#r.length;n++){let s=this.#r[n];if(!s.gate){t=s.currentFrequency,this.#r.splice(n,1);break}}let o=this.#e.computeFrequency(e),i=this.#e.create();isNaN(t)?i.start(e,o,1,0):(i.start(e,t,1,0),i.startGlide(o,this.#e.glideTime)),this.#r.push(i),this.#t.push(i)}stop(e){this.#t.find(t=>t.id===e)?.stop()}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#t.length=0,this.#r.length=0}process(e,t,o,i){e.clear(o,i);for(let n=this.#t.length-1;n>=0;n--){let s=this.#t[n];s.process(e,t,o,i)&&(C.removeIf(this.#r,a=>a===s),this.#t.splice(n,1))}return this.#t.length===0}processing(){return this.#t}};var cx=class{#e;#t=[];#r=[];#i=null;#o=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),Z(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}Z(this.#o)&&this.#o.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#o=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(o=>o.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let o=this.#r.at(-1);if(Z(o)){this.#i.startGlide(this.#e.computeFrequency(o),this.#e.glideTime);return}}this.#r.length===0&&(this.#i.stop(),this.#i=null)}}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#r.length=0,this.#t.length=0,this.#i=null,this.#o=null}process(e,t,o,i){e.clear(o,i);for(let n=this.#t.length-1;n>=0;n--){let s=this.#t[n];s.process(e,t,o,i)&&(this.#t.splice(n,1),s===this.#i&&(this.#i=null),s===this.#o&&(this.#o=null))}return this.#t.length===0}processing(){return this.#t}};var rf=class{#e;#t=[];#r=new Pl;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,o,i){if(this.id=e.id,this.#r.init(t),this.#i===1){let n=this.#e();n.start(e,t,o,i),this.#t.push(n)}else for(let n=0;n<this.#i;++n){let s=n/(this.#i-1)*2-1,a=this.#e(),l=(1-Math.abs(i))*s+i;a.start(e,t,o/Math.sqrt(this.#i),l),this.#t.push(a)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(o=>o.startGlide(e,t))}process(e,t,o,i){this.#r.advance(t.bpm,o,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].process(e,t,o,i)&&this.#t.splice(n,1);return this.#t.length===0}stop(){this.#t.forEach(e=>e.stop()),this.gate=!1}forceStop(){this.#t.forEach(e=>e.forceStop()),this.gate=!1}processing(){return this.#t}};var[vN,yN,V1,xN,bN,dx,wN,AN,px]=uS(Float32Array,128),of=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Ls("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new yd(sampleRate),this.oscB=new yd(sampleRate),this.lfo=new Nf(sampleRate),this.filter=new Af(Ro.MIN_CUTOFF,Ro.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Al(sampleRate),this.env.set(this.device.env_attack,this.device.env_decay,this.device.env_sustain,this.device.env_release),this.env.gateOn(),this.glide=new Pl,this.gainASmooth=new Ti(.003,sampleRate),this.gainBSmooth=new Ti(.003,sampleRate),this.gainVcaSmooth=new Ti(.003,sampleRate)}start(e,t,o,i){this.#e=e,this.#t=o,this.#r=i,this.filter_keyboard_delta=If.keyboardTracking(e.pitch,this.device.parameterFilterKeyboard.getValue()),this.glide.init(t)}stop(){this.env.gateOff()}forceStop(){this.env.forceStop()}startGlide(e,t){this.glide.glideTo(e,t)}get gate(){return this.env.gate}get currentFrequency(){return this.glide.currentFrequency()}process(e,{bpm:t},o,i){let{gainOscA:n,gainOscB:s,oscA_waveform:a,oscB_waveform:l,flt_cutoff:c,flt_resonance:d,flt_env_amount:p,flt_order:f,frequencyAMultiplier:g,frequencyBMultiplier:v,parameterLfoShape:x,parameterLfoRate:y,parameterLfoTargetTune:M,parameterLfoTargetCutoff:T,parameterLfoTargetVolume:L,parameterUnisonDetune:R,parameterUnisonStereo:z}=this.device,ee=_l(this.#e.velocity)*this.#t,te=2**(this.#r*(R.getValue()/1200)),H=this.#r*z.getValue(),[ye,le]=en.panningToGains(H,ho.Linear),[Oe,He]=e.channels();V1.fill(te,o,i),this.glide.process(V1,t,o,i),this.lfo.fill(wN,x.getValue(),y.getValue(),o,i),this.env.process(dx,o,i);let _e=M.getValue(),Je=T.getValue(),Le=L.getValue();for(let we=o;we<i;we++){let Ye=wN[we];AN[we]=c+this.filter_keyboard_delta+dx[we]*p+Ye*Je,dx[we]*=ii(ee+Ye*Le);let Vr=V1[we]*2**(Ye*_e);xN[we]=Vr*g,bN[we]=Vr*v}this.oscA.generateFromFrequencies(vN,xN,a,o,i),this.oscB.generateFromFrequencies(yN,bN,l,o,i);for(let we=o;we<i;we++)px[we]=vN[we]*this.gainASmooth.process(n)+yN[we]*this.gainBSmooth.process(s);this.filter.order=f,this.filter.process(px,px,AN,d,o,i);for(let we=o;we<i;we++){let Ye=this.gainVcaSmooth.process(ii(dx[we])),Vr=px[we]*Ye;if(Oe[we]+=Vr*ye,He[we]+=Vr*le,this.env.complete&&Ye<1e-4)return!0}return!1}};var hx=class extends Me{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P;#I;#k;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Ke.sine;oscB_waveform=Ke.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#D=0;constructor(e,t){super(e),this.#e=t,this.#t=new lx,this.#r=new Zo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#o=new Df(sampleRate),this.#n=this.own(new Ee(e.broadcaster,t.address));let{namedParameter:o}=this.#e,{oscillators:i}=o;this.#s=this.own(this.bindParameter(i[0].waveform)),this.#a=this.own(this.bindParameter(i[0].octave)),this.#l=this.own(this.bindParameter(i[0].tune)),this.#u=this.own(this.bindParameter(i[0].volume)),this.#c=this.own(this.bindParameter(i[1].waveform)),this.#d=this.own(this.bindParameter(i[1].octave)),this.#p=this.own(this.bindParameter(i[1].tune)),this.#h=this.own(this.bindParameter(i[1].volume)),this.#f=this.own(this.bindParameter(o.attack)),this.#m=this.own(this.bindParameter(o.decay)),this.#v=this.own(this.bindParameter(o.sustain)),this.#g=this.own(this.bindParameter(o.release)),this.#A=this.own(this.bindParameter(o.cutoff)),this.#B=this.own(this.bindParameter(o.resonance)),this.#S=this.own(this.bindParameter(o.filterEnvelope)),this.#_=this.own(this.bindParameter(o.filterOrder)),this.#$=this.own(this.bindParameter(o.filterKeyboard)),this.#y=this.own(this.bindParameter(o.glideTime)),this.#w=this.own(this.bindParameter(o.voicingMode)),this.#x=this.own(this.bindParameter(o.unisonCount)),this.#E=this.own(this.bindParameter(o.unisonDetune)),this.#M=this.own(this.bindParameter(o.unisonStereo)),this.#N=this.own(this.bindParameter(o.lfoWaveform)),this.#F=this.own(this.bindParameter(o.lfoRate)),this.#P=this.own(this.bindParameter(o.lfoTargetTune)),this.#I=this.own(this.bindParameter(o.lfoTargetCutoff)),this.#k=this.own(this.bindParameter(o.lfoTargetVolume));let n=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),n,s=>{if(!s)return;let a=0;this.#t.strategy.processing().forEach(l=>{let d=Ie(l,rf).processing().at(0);d instanceof of&&(n[a++]=d.env.phase),n.length-1}),n[a]=-1}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),this.readAllParameters()}computeFrequency(e){return md(e.pitch+e.cent/100,440)}get glideTime(){return this.#D}get parameterFilterKeyboard(){return this.#$}get parameterLfoShape(){return this.#N}get parameterLfoRate(){return this.#F}get parameterLfoTargetTune(){return this.#P}get parameterLfoTargetCutoff(){return this.#I}get parameterLfoTargetVolume(){return this.#k}get parameterUnisonDetune(){return this.#E}get parameterUnisonStereo(){return this.#M}create(){return new rf(()=>new of(this),this.#x.getValue())}get noteEventTarget(){return m.wrap(this)}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#n.clear(),this.#t.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){pe.isStart(e)?this.#t.start(e):pe.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,o){this.#t.process(this.#i,e,t,o),this.#o.replace(this.#i,t,o)}parameterChanged(e){if(e===this.#u)this.gainOscA=Ve(this.#u.getValue());else if(e===this.#h)this.gainOscB=Ve(this.#h.getValue());else if(e===this.#a||e===this.#l)this.frequencyAMultiplier=2**(this.#a.getValue()+this.#l.getValue()/1200);else if(e===this.#d||e===this.#p)this.frequencyBMultiplier=2**(this.#d.getValue()+this.#p.getValue()/1200);else if(e===this.#f)this.env_attack=this.#f.getValue();else if(e===this.#m)this.env_decay=this.#m.getValue();else if(e===this.#v)this.env_sustain=this.#v.getValue();else if(e===this.#g)this.env_release=this.#g.getValue();else if(e===this.#s)this.oscA_waveform=ri(this.#s.getValue(),Ke);else if(e===this.#c)this.oscB_waveform=ri(this.#c.getValue(),Ke);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#B)this.flt_resonance=this.#B.getValue();else if(e===this.#S)this.flt_env_amount=this.#S.getValue();else if(e===this.#_)this.flt_order=this.#_.getValue();else if(e===this.#y)this.#D=this.#y.getValue()*X.Bar;else if(e===this.#w){let t=this.#w.getValue();switch(t){case go.Monophonic:{this.#t.strategy=new cx(this);return}case go.Polyphonic:{this.#t.strategy=new ux(this);return}default:return F(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var Vs=class{#e;#t;#r;#i;#o;#n;#s=0;#a;#l;#u=0;constructor(e,t,o,i,n=0,s=0){this.#e=e,this.#t=t,this.#r=o,this.#a=i,this.#n=n,this.#l=s,this.#n>=t.numberOfFrames?(this.#i=2,this.#o=0):n===0?(this.#i=1,this.#o=0):(this.#i=0,this.#o=1)}get readPosition(){return this.#n}done(){return this.#i===2}isFadingOut(){return this.#i===0&&this.#o<0}startFadeOut(e){this.#i!==2&&!(this.#i===0&&this.#o<0)&&(this.#i=0,this.#o=-1,this.#s=0,this.#u=e)}setPlaybackRate(e){this.#a=e}process(e,t){let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],c=this.#r,d=this.#a,p=s-c*d,f=this.#l,g=this.#u,v=this.#i,x=this.#o,y=this.#n,M=this.#s;for(let T=0;T<t&&v!==2;T++){if(T<f)continue;let L=e+T,R;if(v===0&&x>0)R=M/c,++M>=c&&(v=1,M=0,x=0);else if(v===0&&x<0){if(T<g)R=1;else if(R=1-M/c,++M>=c){v=2;break}}else R=1;let z=y|0;if(z>=0&&z<s-1){let ee=y-z,te=a[z],H=l[z];o[L]+=(te+ee*(a[z+1]-te))*R,i[L]+=(H+ee*(l[z+1]-H))*R}y+=d,v===1&&y>=p&&(v=0,x=-1,M=0)}this.#i=v,this.#o=x,this.#n=y,this.#s=M,this.#l=0,this.#u=0}};var rd=class{#e;#t;#r;#i;#o;#n;#s=1;#a=0;#l=0;#u=0;#c=0;#d=0;constructor(e,t,o,i,n,s,a){this.#e=e,this.#t=t,this.#r=n,this.#n=i,this.#i=Math.round(.02*a),this.#o=1/this.#i,this.#u=o,this.#c=s,this.#d=0,o>0?(this.#s=0,this.#a=1,this.#l=0):(this.#s=1,this.#a=0,this.#l=0)}done(){return this.#s===2}isFadingOut(){return this.#s===0&&this.#a<0}readPosition(){return this.#u}segmentEnd(){return this.#n}setSegmentEnd(e){this.#n=e}startFadeOut(e){if(this.#s!==2&&!(this.#s===0&&this.#a<0)){if(this.#s===0&&this.#a>0){let t=this.#l*this.#o;this.#l=this.#i*(1-t)}else this.#l=0;this.#s=0,this.#a=-1,this.#d=e}}process(e,t){if(this.#s===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],c=this.#n,d=this.#i,p=this.#o,f=this.#r,g=this.#d,v=this.#s,x=this.#a,y=this.#l,M=this.#u;for(let T=this.#c;T<t&&v!==2;T++){let L=e+T,R;if(v===0){if(x>0)R=y*p,y+=1,y>=d&&(v=1,y=0,x=0);else if(T<g)R=1;else if(R=1-y*p,y+=1,y>=d){v=2;break}}else R=1;let z=M|0;if(z>=0&&z<s-1){let ee=M-z,te=a[z],H=l[z];o[L]+=(te+ee*(a[z+1]-te))*R,i[L]+=(H+ee*(l[z+1]-H))*R}M+=f}this.#s=v,this.#a=x,this.#l=y,this.#u=M,this.#c=0,this.#d=0}};var fx=class{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c=1;#d=0;#p=0;#h=0;#f=0;#m=0;#v=0;#g=0;constructor(e,t,o,i,n,s,a,l){this.#e=e,this.#t=t,this.#r=n,this.#u=i;let c=.01*a,d=.02*a;this.#i=o+c,this.#o=i-d,this.#n=Math.round(.02*a),this.#s=1/this.#n,this.#a=Math.round(.01*a),this.#l=1/this.#a,this.#h=l??o,this.#v=s,this.#g=0,this.#f=0,this.#m=0,l!==void 0||o>0?(this.#c=0,this.#d=1,this.#p=0):(this.#c=1,this.#d=0,this.#p=0),this.#i>=this.#o&&(this.#c=2)}done(){return this.#c===2}isFadingOut(){return this.#c===0&&this.#d<0}readPosition(){return this.#h}segmentEnd(){return this.#u}setSegmentEnd(e){this.#u=e}startFadeOut(e){if(this.#c!==2&&!(this.#c===0&&this.#d<0)){if(this.#c===0&&this.#d>0){let t=this.#p*this.#s;this.#p=this.#n*(1-t)}else this.#p=0;this.#c=0,this.#d=-1,this.#g=e}}process(e,t){if(this.#c===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],c=this.#i,p=this.#o-this.#a,f=this.#n,g=this.#s,v=this.#a,x=this.#l,y=this.#r,M=this.#g,T=this.#c,L=this.#d,R=this.#p,z=this.#h,ee=this.#f,te=this.#m;for(let H=this.#v;H<t&&T!==2;H++){let ye=e+H,le;if(T===0){if(L>0)le=R*g,R+=1,R>=f&&(T=1,R=0,L=0);else if(H<M)le=1;else if(le=1-R*g,R+=1,R>=f){T=2;break}}else le=1;let Oe=0,He=0,_e=z|0;if(_e>=0&&_e<s-1){let Je=z-_e,Le=a[_e],we=l[_e];Oe=Le+Je*(a[_e+1]-Le),He=we+Je*(l[_e+1]-we)}if(ee===0&&z>=p&&(ee=1,te=c),ee>0){let Je=te|0;if(Je>=0&&Je<s-1){let Le=te-Je,we=a[Je],Ye=l[Je],Vr=we+Le*(a[Je+1]-we),pl=Ye+Le*(l[Je+1]-Ye),Bn=ee*x;Oe=Oe*(1-Bn)+Vr*Bn,He=He*(1-Bn)+pl*Bn}te+=y,ee+=1,ee>=v&&(z=te,ee=0)}o[ye]+=Oe*le,i[ye]+=He*le,z+=y}this.#c=T,this.#d=L,this.#p=R,this.#h=z,this.#f=ee,this.#m=te,this.#v=0,this.#g=0}};var nf=class{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u=1;#c=0;#d=0;#p=0;#h=1;#f=0;#m=0;#v=0;#g=0;constructor(e,t,o,i,n,s,a,l){this.#e=e,this.#t=t,this.#r=n,this.#l=i;let c=.01*a,d=.02*a;this.#i=o+c,this.#o=i-d,this.#n=Math.round(.02*a),this.#s=1/this.#n,this.#a=Math.round(.01*a),this.#p=l?.position??o,this.#h=l?.direction??1,this.#v=s,this.#g=0,this.#f=0,this.#m=0,l!==void 0||o>0?(this.#u=0,this.#c=1,this.#d=0):(this.#u=1,this.#c=0,this.#d=0),this.#i>=this.#o&&(this.#u=2)}done(){return this.#u===2}isFadingOut(){return this.#u===0&&this.#c<0}readPosition(){return this.#p}segmentEnd(){return this.#l}setSegmentEnd(e){this.#l=e}startFadeOut(e){if(this.#u!==2&&!(this.#u===0&&this.#c<0)){if(this.#u===0&&this.#c>0){let t=this.#d*this.#s;this.#d=this.#n*(1-t)}else this.#d=0;this.#u=0,this.#c=-1,this.#g=e}}process(e,t){if(this.#u===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],c=this.#i,d=this.#o,p=d-this.#a,f=c+this.#a,g=this.#n,v=this.#s,x=this.#a,y=this.#r,M=this.#g,T=this.#u,L=this.#c,R=this.#d,z=this.#p,ee=this.#h,te=this.#f,H=this.#m;for(let ye=this.#v;ye<t&&T!==2;ye++){let le=e+ye,Oe;if(T===0){if(L>0)Oe=R*v,R+=1,R>=g&&(T=1,R=0,L=0);else if(ye<M)Oe=1;else if(Oe=1-R*v,R+=1,R>=g){T=2;break}}else Oe=1;let He=0,_e=0,Je=z|0;if(Je>=0&&Je<s-1){let Le=z-Je,we=a[Je],Ye=l[Je];He=we+Le*(a[Je+1]-we),_e=Ye+Le*(l[Je+1]-Ye)}if(te===0&&(ee>0&&z>=p?(te=1,H=d):ee<0&&z<=f&&(te=1,H=c)),te>0){let Le=H|0;if(Le>=0&&Le<s-1){let we=H-Le,Ye=a[Le],Vr=l[Le],pl=Ye+we*(a[Le+1]-Ye),Bn=Vr+we*(l[Le+1]-Vr),cf=te/x,df=Math.cos(cf*Math.PI*.5),Go=Math.sin(cf*Math.PI*.5);He=He*df+pl*Go,_e=_e*df+Bn*Go}H-=ee*y,te+=1,te>=x&&(z=H,ee=-ee,te=0)}o[le]+=He*Oe,i[le]+=_e*Oe,z+=ee*y}this.#u=T,this.#c=L,this.#d=R,this.#p=z,this.#h=ee,this.#f=te,this.#m=H,this.#v=0,this.#g=0}};var mx=class{#e=[];#t=-1;#r=0;constructor(){}get voiceCount(){return this.#e.length}reset(){for(let e of this.#e)e.startFadeOut(0);this.#t=-1,this.#r=0}process(e,t,o,i,n,s,a){let{p0:l,p1:c,bpm:d,flags:p}=s,f=i.warpMarkers,g=i.transientPlayMode,v=i.playbackRate,{sampleRate:x,numberOfFrames:y}=t,M=y/x;nt.some(p,2)&&this.reset();let T=c-l,L=s.s0,z=s.s1-L,ee=(a.resultStart-l)/T,te=(a.resultEnd-l)/T,H=L+z*ee|0,le=(L+z*te|0)-H,Oe=f.first(),He=f.last();if(!Pt(Oe)||!Pt(He))return;let _e=a.resultStart-a.rawStart;if(_e<Oe.position||_e>=He.position)return;let Je=_e+T,Le=this.#n(Je,f);if(!Pt(Le))return;let we=Le+n;if(we<0||we>=M)return;let Ye=this.#n(_e,f)??0,Vr=Le-Ye,pl=T/(960*d/60),Bn=pl>0?Vr/pl:1,cf=.02*Bn*v*(t.sampleRate/x),df=we+cf,Go=o.floorLastIndex(df);if(Go<this.#t&&this.reset(),Go>this.#t&&Go>=0){let jt=o.optAt(Go);Pt(jt)&&(this.#i(e,t,o,f,g,v,n,d,x,Go,jt.position),this.#t=Go)}for(let jt of this.#e){if(!(jt instanceof rd)||jt.done()||jt.isFadingOut())continue;let fb=jt.readPosition(),X1=jt.segmentEnd();if(fb>=X1){jt.startFadeOut(0);continue}if(g!==Cn.Once){let pf=this.#o(o,this.#t,t);if(Pt(pf)){let{startSamples:eS,endSamples:tS,hasNext:BN,nextTransientFileSeconds:FN}=pf,rS=tS-eS,iS=Number.POSITIVE_INFINITY;if(BN){let sd=o.optAt(this.#t);if(Pt(sd)){let NN=sd.position-n,IN=this.#s(NN,f),kN=FN-n,$N=this.#s(kN,f)-IN;iS=X.pulsesToSeconds($N,d)*x}}let oS=iS*v,nS=rS/oS;if(!(nS>=.99&&nS<=1.01)&&oS>rS){jt.startFadeOut(0);let sd=this.#a(e,t,eS,tS,v,0,x,g,!0,fb);Pt(sd)&&this.#e.push(sd);continue}}}let Y1=(X1-fb)/v;if(Y1<le){let pf=Math.max(0,Math.floor(Y1));jt.startFadeOut(pf)}}for(let jt of this.#e)jt.process(H,le);for(let jt=this.#e.length-1;jt>=0;jt--)this.#e[jt].done()&&this.#e.splice(jt,1)}#i(e,t,o,i,n,s,a,l,c,d,p){let f=this.#o(o,d,t);if(!Pt(f))return;let{startSamples:g,endSamples:v,hasNext:x,nextTransientFileSeconds:y}=f,M=v-g,T=Number.POSITIVE_INFINITY;if(x){let _e=p-a,Je=this.#s(_e,i),Le=y-a,Ye=this.#s(Le,i)-Je;T=X.pulsesToSeconds(Ye,l)*c}let L=.02*c,R=.02*t.sampleRate*s,z=null;for(let _e of this.#e){if(_e.done()||!(_e instanceof rd))continue;let Le=_e.readPosition()+R-g;if(!(Math.abs(Le)>=L)){this.#r+=Le,Math.abs(this.#r)<L?(z=_e,_e.setSegmentEnd(v)):this.#r=0;break}}if(Pt(z)){for(let _e of this.#e)_e!==z&&!_e.done()&&_e.startFadeOut(0);return}for(let _e of this.#e)_e.done()||_e.startFadeOut(0);let ee=T*s,te=M/ee,ye=!(te>=.99&&te<=1.01)&&ee>M,le=.02*t.sampleRate*s,Oe=d===0?g:Math.max(0,g-le),He=this.#a(e,t,Oe,v,s,0,c,n,ye);Pt(He)&&this.#e.push(He),this.#r=0}#o(e,t,o){let i=e.optAt(t);if(!Pt(i))return null;let n=e.optAt(t+1);return{startSamples:i.position*o.sampleRate,endSamples:Pt(n)?n.position*o.sampleRate:o.numberOfFrames,hasNext:Pt(n),nextTransientFileSeconds:Pt(n)?n.position:Number.POSITIVE_INFINITY}}#n(e,t){for(let o=0;o<t.length()-1;o++){let i=t.optAt(o),n=t.optAt(o+1);if(!(!Pt(i)||!Pt(n))&&e>=i.position&&e<n.position){let s=(e-i.position)/(n.position-i.position);return i.seconds+s*(n.seconds-i.seconds)}}return null}#s(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),s=t.optAt(i+1);if(!(!Pt(n)||!Pt(s))&&e>=n.seconds&&e<s.seconds){let a=(e-n.seconds)/(s.seconds-n.seconds);return n.position+a*(s.position-n.position)}}let o=t.last();return Pt(o)&&e>=o.seconds?o.position:0}#a(e,t,o,i,n,s,a,l,c,d){return o>=i?null:l===Cn.Once||!c?new rd(e,t,o,i,n,s,a):l===Cn.Repeat?new fx(e,t,o,i,n,s,a,d):Z(d)?new nf(e,t,o,i,n,s,a,{position:d,direction:1}):new nf(e,t,o,i,n,s,a)}};var gx=class extends ar{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new xe(2),this.#r=this.own(new Ee(e.broadcaster,t.address)),this.#i=b.newSet(({adapter:{uuid:o}})=>o),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:o=>this.#i.add({adapter:o,voices:[],sequencer:new mx}),onRemove:o=>this.#i.removeByKey(o.uuid),onReorder:o=>{}}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing))}get noteEventTarget(){return m.None}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#i.forEach(e=>{e.voices=[],e.sequencer.reset()})}process({blocks:e}){this.#t.clear(0,128),this.#i.forEach(i=>e.forEach(n=>this.#o(i,n))),this.#t.assertSanity();let[t,o]=this.#t.channels();this.#r.process(t,o)}parameterChanged(e){}#o(e,t){let{adapter:o}=e;if(o.type!==oe.Audio||!o.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.sequencer.reset();return}let{p0:i,p1:n,flags:s}=t;if(!nt.every(s,5))return;let a=this.context.clipSequencing.iterate(o.uuid,i,n);for(let{optClip:l,sectionFrom:c,sectionTo:d}of a)l.match({none:()=>{for(let p of o.regions.collection.iterateRange(i,n)){if(p.mute||!Ce(p,ts))continue;let f=p.file,g=f.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.waveformOffset.getValue(),x=p.asPlayModeTimeStretch;if(x.nonEmpty()){let y=f.transients;if(y.length()<2)return;for(let M of Jt.locateLoops(p,i,n)){let T=x.unwrap();this.#a(e,t,M,g.unwrap(),T,y,v)}}else for(let y of Jt.locateLoops(p,i,n))this.#n(e,t,y,p,g.unwrap())}},some:p=>{if(!Ce(p,dn))return;let f=p.file,g=f.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.asPlayModeTimeStretch;if(v.nonEmpty()){let x=v.unwrap(),y=f.transients;if(y.length()<2)return;for(let M of Jt.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,d))this.#a(e,t,M,g.unwrap(),x,y,p.waveformOffset.getValue())}else for(let x of Jt.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,d))this.#n(e,t,x,p,g.unwrap())}})}#n(e,t,o,i,n){let{p0:s,p1:a,s0:l,s1:c,flags:d}=t,p=c-l,f=a-s,g=(o.resultStart-s)/f,v=(o.resultEnd-s)/f,x=l+p*g,y=l+p*v,M=y-x|0,T=i.waveformOffset.getValue();D(l<=x&&y<=c,()=>`Out of bounds ${x}, ${y}`),nt.some(d,2)&&(e.voices.forEach(R=>R.startFadeOut(0)),e.sequencer.reset());let L=i.asPlayModePitchStretch;if(L.isEmpty()||i.observableOptPlayMode.isEmpty()){let R=n.numberOfFrames,ee=(o.resultEndValue-o.resultStartValue)*R,te=(o.resultEnd-o.resultStart)/f*p,H=ee/te,ye=o.resultStartValue*n.numberOfFrames+T*n.sampleRate;this.#s(e,n,H,ye,0)}else{let z=L.unwrap().warpMarkers,ee=z.first(),te=z.last();if(ee===null||te===null){e.voices.forEach(He=>He.startFadeOut(0));return}let H=o.resultStart-o.rawStart;if(H<ee.position||H>=te.position){e.voices.forEach(He=>He.startFadeOut(0));return}let ye=this.#u(H,o.resultStartValue,z),le=this.#l(H,z,n.sampleRate,f,p),Oe=(ye+T)*n.sampleRate;this.#s(e,n,le,Oe,0)}for(let R of e.voices)R.process(x|0,M);e.voices=e.voices.filter(R=>!R.done())}#s(e,t,o,i,n){let s=Math.round(.02*t.sampleRate);if(e.voices.length===0)e.voices.push(new Vs(this.#t,t,s,o,i,n));else{let a=!1;for(let l of e.voices)if(l instanceof Vs){if(l.isFadingOut())continue;Math.abs(l.readPosition-i)>s?l.startFadeOut(n):(l.setPlaybackRate(o),a=!0)}else l.startFadeOut(n);a||e.voices.push(new Vs(this.#t,t,s,o,i,n))}}#a(e,t,o,i,n,s,a){for(let l of e.voices)l instanceof Vs&&l.startFadeOut(0);e.sequencer.process(this.#t,i,s,n,a,t,o),e.voices=e.voices.filter(l=>l instanceof Vs&&!l.done())}#l(e,t,o,i,n){let s=t.floorLastIndex(e),a=t.optAt(s),l=t.optAt(s+1);if(a===null||l===null)return 1;let c=l.position-a.position,f=(l.seconds-a.seconds)*o/c,g=n/i;return f/g}#u(e,t,o){let i=o.floorLastIndex(e),n=o.optAt(i),s=o.optAt(i+1);if(n===null||s===null)return t;let a=(e-n.position)/(s.position-n.position);return n.seconds+a*(s.seconds-n.seconds)}};var Or=class extends ar{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:o,p0:i,p1:n,s0:s,bpm:a}=t,l=null,c=i;for(let d of this.eventInput.get(o))l?.forEach(p=>this.handleEvent(t,p)),l=null,c<d.position&&(this.processEvents(t,c,d.position),c=d.position),ef.isOfType(d)?this.updateParameters(d.position,s/sampleRate+X.pulsesToSeconds(d.position-i,a)):(l??=[]).push(d);l?.forEach(d=>this.handleEvent(t,d)),l=null,c<n&&this.processEvents(t,c,n)}),this.eventInput.clear()}introduceBlock(e){}};var id;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(o,i)=>i*o.mult+o.add))(id||={});var vx=Object.freeze([{name:"up",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=t%s,c=Math.floor(t%a/s),d=r[l];return pe.start(o,i,d.pitch+c*12,id.apply(n,d.velocity))}},{name:"down",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=s-1-t%s,c=e-1-Math.floor(t%a/s),d=r[l];return pe.start(o,i,d.pitch+c*12,id.apply(n,d.velocity))}},{name:"up-down",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=Math.max(1,a*2-2),c=t%l,d=c<a?c:l-c,p=d%s,f=Math.floor(d/s),g=r[p];return pe.start(o,i,g.pitch+f*12,id.apply(n,g.velocity))}}]);var yx=class extends Or{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u=id.create();#c=m.None;#d=vx[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Zs,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#o=this.own(this.bindParameter(t.namedParameter.rate)),this.#n=this.own(this.bindParameter(t.namedParameter.gate)),this.#s=this.own(this.bindParameter(t.namedParameter.repeat)),this.#a=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#l=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return m.wrap(this)}setNoteEventSource(e){return D(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=m.wrap(e),W.create(()=>this.#c=m.None)}*processNotes(e,t,o){if(this.#r.nonEmpty())if(nt.every(o,2))for(let n of this.#r.releaseAll())yield pe.stop(n,e);else for(let n of this.#r.releaseLinearCompleted(t))yield pe.stop(n,n.position+n.duration);if(this.#c.nonEmpty()){let i=this.#c.unwrap();for(let s of i.processNotes(e,t,o));let n=!nt.every(o,1);for(let{position:s,index:a}of po.iterateWithIndex(e,t,this.#p)){let l=Array.from(i.iterateActiveNotesAt(s,n));if(l.length===0)continue;let c=Math.floor(a/this.#f),d=Math.max(1,Math.floor(this.#p*this.#h)),p=this.#d.run(l,this.#m,c,s,d,this.#u);this.#r.addAndRetain({...p}),yield p}for(let s of this.#r.releaseLinearCompleted(t))yield pe.stop(s,s.position+s.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,Qt.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){if(e===this.#i)this.#d=vx.at(this.#i.getValue())??vx[0];else if(e===this.#o)this.#p=ur.toPPQN(Xi.RateFractions[this.#o.getValue()]);else if(e===this.#n)this.#h=this.#n.getValue();else if(e===this.#s)this.#f=this.#s.getValue();else if(e===this.#a)this.#m=this.#a.getValue();else if(e===this.#l){let t=this.#l.getValue();t<=0?(this.#u.add=1+t,this.#u.mult=0):(this.#u.add=1-t,this.#u.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var xx=class extends Or{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new ki(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#o=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=m.wrap(e),W.create(()=>this.#n=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#n.isEmpty())for(let i of this.#n.unwrap().processNotes(e,t,o))if(pe.isStart(i)){this.#t.noteOn(i.pitch);let{cent:n,octaves:s,semiTones:a}=this.#e.namedParameter;yield zr.overwrite(i,{pitch:i.pitch+s.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().iterateActiveNotesAt(e,t))if(o.type==="note-event"){let{cent:i,octaves:n,semiTones:s}=this.#e.namedParameter;yield zr.overwrite(o,{pitch:o.pitch+n.valueAt(o.position)*12+s.valueAt(o.position),cent:o.cent+i.valueAt(o.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var bx=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P;#I;#k;#D;#R;#O;#C;#T=m.None;#V=!1;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new hl,this.#n=new Float32Array(this.#o.numBins()),this.#s=C.create(()=>new co,7),this.#a=[new In(4),new In(4)],this.#l=[new In(4),new In(4)],this.#u=[this.#l,[new Et,new Et],[new Et,new Et],[new Et,new Et],[new Et,new Et],[new Et,new Et],this.#a],this.#c=C.create(()=>!0,7);let o=this.#t.namedParameter;this.#d=this.own(this.bindParameter(o.highPass.enabled)),this.#h=this.own(this.bindParameter(o.highPass.q)),this.#p=this.own(this.bindParameter(o.highPass.frequency)),this.#f=this.own(this.bindParameter(o.highPass.order)),this.#m=this.own(this.bindParameter(o.lowShelf.enabled)),this.#v=this.own(this.bindParameter(o.lowShelf.frequency)),this.#g=this.own(this.bindParameter(o.lowShelf.gain)),this.#A=this.own(this.bindParameter(o.lowBell.enabled)),this.#B=this.own(this.bindParameter(o.lowBell.frequency)),this.#S=this.own(this.bindParameter(o.lowBell.gain)),this.#_=this.own(this.bindParameter(o.lowBell.q)),this.#$=this.own(this.bindParameter(o.midBell.enabled)),this.#y=this.own(this.bindParameter(o.midBell.frequency)),this.#w=this.own(this.bindParameter(o.midBell.gain)),this.#x=this.own(this.bindParameter(o.midBell.q)),this.#E=this.own(this.bindParameter(o.highBell.enabled)),this.#M=this.own(this.bindParameter(o.highBell.frequency)),this.#N=this.own(this.bindParameter(o.highBell.gain)),this.#F=this.own(this.bindParameter(o.highBell.q)),this.#P=this.own(this.bindParameter(o.highShelf.enabled)),this.#I=this.own(this.bindParameter(o.highShelf.frequency)),this.#k=this.own(this.bindParameter(o.highShelf.gain)),this.#D=this.own(this.bindParameter(o.lowPass.enabled)),this.#R=this.own(this.bindParameter(o.lowPass.frequency)),this.#O=this.own(this.bindParameter(o.lowPass.q)),this.#C=this.own(this.bindParameter(o.lowPass.order)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.spectrum,this.#n,i=>{this.#V=i,i&&(this.#n.set(this.#o.bins()),this.#o.decay=!0)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#u.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#T=m.wrap(e),{terminate:()=>this.#T=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#T.isEmpty())return;let[i,n]=this.#r.channels(),s=this.#T.unwrap();if(this.#c.some(a=>a)){let[a,l]=s.channels();this.#s.forEach((c,d)=>{if(this.#c[d]){let[p,f]=this.#u[d];p.process(c,a,i,t,o),f.process(c,l,n,t,o),a=i,l=n}})}else{let[a,l]=s.channels();for(let c=t;c<o;c++)i[c]=a[c],n[c]=l[c]}this.#i.process(i,n,t,o),this.#V&&this.#o.process(i,n,t,o)}parameterChanged(e){if(e===this.#C){let o=this.#C.getValue()+1;this.#a[0].order=o,this.#a[1].order=o}else if(e===this.#f){let o=this.#f.getValue()+1;this.#l[0].order=o,this.#l[1].order=o}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),o=this.#h.getValue();this.#s[0].setHighpassParams(t/sampleRate,o)}else if(e===this.#v||e===this.#g){let t=this.#v.getValue(),o=this.#g.getValue();this.#s[1].setLowShelfParams(t/sampleRate,o)}else if(e===this.#B||e===this.#S||e===this.#_){let t=this.#B.getValue(),o=this.#S.getValue(),i=this.#_.getValue();this.#s[2].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#y||e===this.#w||e===this.#x){let t=this.#y.getValue(),o=this.#w.getValue(),i=this.#x.getValue();this.#s[3].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#M||e===this.#N||e===this.#F){let t=this.#M.getValue(),o=this.#N.getValue(),i=this.#F.getValue();this.#s[4].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#I||e===this.#k){let t=this.#I.getValue(),o=this.#k.getValue();this.#s[5].setHighShelfParams(t/sampleRate,o)}else if(e===this.#R||e===this.#O){let t=this.#R.getValue(),o=this.#O.getValue();this.#s[6].setLowpassParams(t/sampleRate,o)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#m?this.#c[1]=this.#m.getValue():e===this.#A?this.#c[2]=this.#A.getValue():e===this.#$?this.#c[3]=this.#$.getValue():e===this.#E?this.#c[4]=this.#E.getValue():e===this.#P?this.#c[5]=this.#P.getValue():e===this.#D&&(this.#c[6]=this.#D.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var wx=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#o=new Float32Array(2048);#n=new Float32Array(2048);#s=new Float32Array(2048);#a=new Float32Array(2048);#l=new Float32Array(1024);#u=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#v=new Float32Array(2048);#g=new Float32Array(2048);#A=new Float32Array(2048);#B=new Float32Array(2048);#S=new Float32Array(1024);#_=new Float32Array(512);#$=new Float32Array(512);#y=new Float32Array(256);#w;#x;#E=0;#M=0;#N=0;#F=0;#P=0;#I=0;#k=0;#D=0;#R=0;#O=0;#C=0;#T=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#G=0;#H=0;#J=0;#Q=0;#X=0;#Y=0;#ee=0;#te=0;#re=0;#ie=0;#oe=0;#ne=0;#se=0;#ae=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#b=0;#q=0;constructor(e=.5){this.#w=Fn(Math.ceil(e*sampleRate)),this.#x=new Float32Array(this.#w<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#b=0,this.#q=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#b=0,this.#q=0,this.clearHistory(),this.clearBuffers()}process(e,t,o,i){let[n,s]=t.channels(),[a,l]=e.channels(),c=.4*this.damp,d=1-c,p=.7+.28*this.roomSize;for(let f=o;f<i;++f){let g=n[f],v=s[f],x=this.#q-this.predelayInSamples;x<0&&(x+=this.#w);let y;y=x<<1;let M=.01,T=this.#x[y]*M,L=this.#x[y+1]*M;y=this.#q<<1,this.#x[y]=g,this.#x[y+1]=v,this.#q=this.#q+1&this.#w-1;let R=this.#b&2047;this.#E=d*this.#M+c*this.#E,this.#e[R]=T+p*this.#E,this.#M=this.#e[this.#b-1617&2047],this.#N=d*this.#F+c*this.#N,this.#t[R]=T+p*this.#N,this.#F=this.#t[this.#b-1557&2047],this.#P=d*this.#I+c*this.#P,this.#r[R]=T+p*this.#P,this.#I=this.#r[this.#b-1491&2047],this.#k=d*this.#D+c*this.#k,this.#i[R]=T+p*this.#k,this.#D=this.#i[this.#b-1422&2047],this.#R=d*this.#O+c*this.#R,this.#o[R]=T+p*this.#R,this.#O=this.#o[this.#b-1356&2047],this.#C=d*this.#T+c*this.#C,this.#n[R]=T+p*this.#C,this.#T=this.#n[this.#b-1277&2047],this.#V=d*this.#z+c*this.#V,this.#s[R]=T+p*this.#V,this.#z=this.#s[this.#b-1188&2047],this.#U=d*this.#j+c*this.#U,this.#a[R]=T+p*this.#U,this.#j=this.#a[this.#b-1116&2047];let z=this.#j+this.#z+this.#T+this.#O+this.#D+this.#I+this.#F+this.#M,ee=this.#L-z,te=this.#K-ee,H=this.#W-te;this.#l[this.#b&1023]=z+.5*this.#L,this.#L=this.#l[this.#b-556&1023],this.#u[this.#b&511]=ee+.5*this.#K,this.#K=this.#u[this.#b-441&511],this.#c[this.#b&511]=te+.5*this.#W,this.#W=this.#c[this.#b-341&511],this.#d[this.#b&255]=H+.5*this.#Z,this.#Z=this.#d[this.#b-225&255],a[f]=this.dryGain*g+this.wetGain*(this.#Z-H),this.#G=d*this.#H+c*this.#G,this.#p[R]=L+p*this.#G,this.#H=this.#p[this.#b-1640&2047],this.#J=d*this.#Q+c*this.#J,this.#h[R]=L+p*this.#J,this.#Q=this.#h[this.#b-1580&2047],this.#X=d*this.#Y+c*this.#X,this.#f[R]=L+p*this.#X,this.#Y=this.#f[this.#b-1514&2047],this.#ee=d*this.#te+c*this.#ee,this.#m[R]=L+p*this.#ee,this.#te=this.#m[this.#b-1445&2047],this.#re=d*this.#ie+c*this.#re,this.#v[R]=L+p*this.#re,this.#ie=this.#v[this.#b-1379&2047],this.#oe=d*this.#ne+c*this.#oe,this.#g[R]=L+p*this.#oe,this.#ne=this.#g[this.#b-1300&2047],this.#se=d*this.#ae+c*this.#se,this.#A[R]=L+p*this.#se,this.#ae=this.#A[this.#b-1211&2047],this.#le=d*this.#ue+c*this.#le,this.#B[R]=L+p*this.#le,this.#ue=this.#B[this.#b-1139&2047];let ye=this.#ue+this.#ae+this.#ne+this.#ie+this.#te+this.#Y+this.#Q+this.#H,le=this.#ce-ye,Oe=this.#de-le,He=this.#pe-Oe;this.#S[this.#b&1023]=ye+.5*this.#ce,this.#ce=this.#S[this.#b-579&1023],this.#_[this.#b&511]=le+.5*this.#de,this.#de=this.#_[this.#b-464&511],this.#$[this.#b&511]=Oe+.5*this.#pe,this.#pe=this.#$[this.#b-364&511],this.#y[this.#b&255]=He+.5*this.#he,this.#he=this.#y[this.#b-248&255],l[f]=this.dryGain*v+this.wetGain*(this.#he-He),this.#b++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#o.fill(0),this.#n.fill(0),this.#s.fill(0),this.#a.fill(0),this.#l.fill(0),this.#u.fill(0),this.#c.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#v.fill(0),this.#g.fill(0),this.#A.fill(0),this.#B.fill(0),this.#S.fill(0),this.#_.fill(0),this.#$.fill(0),this.#y.fill(0),this.#x.fill(0)}clearHistory(){this.#E=0,this.#M=0,this.#N=0,this.#F=0,this.#P=0,this.#I=0,this.#k=0,this.#D=0,this.#R=0,this.#O=0,this.#C=0,this.#T=0,this.#V=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#G=0,this.#H=0,this.#J=0,this.#Q=0,this.#X=0,this.#Y=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#oe=0,this.#ne=0,this.#se=0,this.#ae=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var Ax=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new wx;let{decay:o,preDelay:i,damp:n,wet:s,dry:a}=this.#t.namedParameter;this.#n=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(n)),this.#l=this.own(this.bindParameter(s)),this.#u=this.own(this.bindParameter(a)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=m.wrap(e),{terminate:()=>this.#c=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#c.isEmpty())return;this.#o.process(this.#r,this.#c.unwrap(),t,o);let[i,n]=this.#r.channels();this.#i.process(i,n,t,o)}parameterChanged(e){this.#n===e?this.#o.roomSize=this.#n.getValue():this.#s===e?this.#o.predelayInSamples=Math.ceil(this.#s.getValue()*sampleRate):this.#a===e?this.#o.damp=this.#a.getValue():this.#l===e?this.#o.wetGain=Ve(this.#l.getValue()):this.#u===e&&(this.#o.dryGain=Ve(this.#u.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var _x=class extends Me{#e;#t;#r;#i;#o;#n;#s;gain=1;release=1;loader=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new xe,this.#i=new Zo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#o=this.own(new Ee(e.broadcaster,t.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.file.catchupAndSubscribe(o=>this.loader=o.targetVertex.map(({box:i})=>e.sampleManager.getOrCreate(i.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return m.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#o.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){pe.isStart(e)?this.#t.push(new W1(this,e)):pe.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,o){this.#r.clear(t,o);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#r,t,o)&&this.#t.splice(i,1)}parameterChanged(e){e===this.#n?this.gain=Ve(this.#n.getValue()):e===this.#s&&(this.release=this.#s.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},W1=class{#e;#t;#r=1;#i=0;#o=.003*sampleRate|0;#n=0;#s=Number.POSITIVE_INFINITY;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#t}stop(){this.#s=this.#n}processAdd(e,t,o){let i=this.#e.loader;if(i.isEmpty())return!0;let n=i.unwrap();return n.data.isEmpty()?!0:this.processSimple(e.channels(),n.data.unwrap(),t,o)}processSimple(e,t,o,i){let[n,s]=e,a=t.frames[0],l=t.frames[1]??a,c=t.numberOfFrames,d=t.sampleRate/sampleRate,p=this.#e.gain*this.#t.velocity,f=this.#e.release,g=1/f;for(let v=o;v<i;v++){let x=this.#i|0;if(x>=c-1)return!0;let y=this.#i-x,M=this.#n<this.#o?this.#n/this.#o:1,T=(Math.min(1-(this.#n-this.#s)*g,1)*M)**2,L=a[x]*(1-y)+a[x+1]*y,R=l[x]*(1-y)+l[x+1]*y;if(n[v]+=L*p*T,s[v]+=R*p*T,this.#i+=this.#r*d,++this.#n-this.#s>f)return!0}return!1}};var Px=class extends Or{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new Zo(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,o){}handleEvent({index:e},t){pe.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t)):pe.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Sx=class extends Me{#e;#t;#r;#i;#o;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Ee(e.broadcaster,t.adapter.address)),this.#i=[],this.#o=new ed,this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.adapter.address,this.#t,this.outgoing)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{C.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#o}processAudio(e,t,o){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let o of this.#i){let[i,n]=o.channels();for(let s=0;s<128;s++)e[s]+=i[s],t[s]+=n[s]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Ex=class r{static create(e,t,o,i){return new r(e,t,o,i)}#e=new O;#t;#r;#i=[];#o=!0;constructor(e,t,o,i){this.#t=b.newSet(({device:n})=>n.uuid),this.#r=this.#e.own(new O),this.#e.ownAll(t.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let s=af.create(e,n.box),a=this.#t.add({device:s,subscription:s.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(a,"Could not add.")},onRemove:n=>{this.invalidateWiring();let{device:s,subscription:a}=this.#t.removeByKey(n.uuid);a.terminate(),s.terminate()},onReorder:n=>this.invalidateWiring()}),e.subscribeProcessPhase(n=>{if(n===0&&this.#o){let s=o;C.replace(this.#i,t.adapters().map(({uuid:a})=>this.#t.get(a).device));for(let a of this.#i)a.adapter().enabledField.getValue()&&(this.#r.own(a.setAudioSource(s.audioOutput)),this.#r.own(e.registerEdge(s.outgoing,a.incoming)),s=a);this.#r.own(i.setAudioSource(s.audioOutput)),this.#r.own(e.registerEdge(s.outgoing,i.incoming)),this.#o=!1}}))}invalidateWiring(){this.#r.terminate(),this.#o=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var lf=Math.floor(.005*sampleRate),Bx=class{#e;#t;#r;#i;#o;#n;#s=0;#a=Number.POSITIVE_INFINITY;#l;#u;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,o,i){this.#e=e,this.#t=t,this.#i=o,this.#r=i,this.#o=e.gate,this.#n=_l(this.#r.velocity);let{attack:n,release:s,sampleStart:a,sampleEnd:l}=this.#t;this.#l=n.getValue()*sampleRate,this.#u=s.getValue()*sampleRate,this.#c=(o.numberOfFrames-1)*a.getValue(),this.#d=(o.numberOfFrames-1)*l.getValue(),this.#p=this.#c,this.#h=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#p}get envelope(){return this.#h}release(e=!1){this.#f&&(e?(this.#u=lf,this.#v(),this.#f=!1):this.#o!==jo.Off&&this.#v())}processAdd(e,t,o){let[i,n]=e,{frames:s,numberOfFrames:a}=this.#i,l=s[0],c=s[1]??l,{pitch:d}=this.#t,p=this.#d-this.#c,f=Math.sign(p),g=this.#i.sampleRate/sampleRate*f*2**(d.getValue()/1200),v=0;for(let x=t;x<o;x++){let y=this.#p|0,M=this.#p-y,T=l[y]*(1-M)+(l[y+1]??0)*M,L=c[y]*(1-M)+(c[y+1]??0)*M;if(v=Math.min(this.#s/this.#l,1-(this.#s-(this.#a+this.#l))/this.#u,1),this.#p+=g,f>0){if(this.#o===jo.Off){if(this.#p>=a)return!0;!this.#m&&this.#p>=this.#d&&this.#v()}else if(this.#o===jo.On){if(this.#p>=this.#d-lf){if(this.#p>=this.#d)return!0;v*=(this.#d-this.#p)/lf}}else if(this.#o===jo.Loop)for(;this.#p>=this.#d;)this.#p-=p}else if(f<0){if(this.#o===jo.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#v()}else if(this.#o===jo.On){if(this.#p<=this.#d+lf){if(this.#p<=this.#d)return!0;v*=(this.#d-this.#p)/lf}}else if(this.#o===jo.Loop)for(;this.#p<=this.#d;)this.#p-=p}if(++this.#s-this.#a>this.#l+this.#u)return!0;v*=this.#n*v,i[x]+=T*v,n[x]+=L*v}return this.#h=v,!1}toString(){return"{PlayfieldSampleVoice}"}#v(){this.#m||(this.#m=!0,this.#a=this.#s<this.#l?this.#s-this.#l:this.#s)}};var Fx=class extends Me{#e;#t;#r;#i;#o;#n;constructor(e,t,o,i){super(e),this.#e=t,this.#t=o,this.#r=[],this.#i=new xe,this.#o=this.own(new Ee(e.broadcaster,o.peakAddress));let{sampleStart:n,sampleEnd:s,attack:a,release:l,pitch:c}=o.namedParameter;this.#n=Object.freeze({sampleStart:this.own(this.bindParameter(n)),sampleEnd:this.own(this.bindParameter(s)),attack:this.own(this.bindParameter(a)),release:this.own(this.bindParameter(l)),pitch:this.own(this.bindParameter(c))});let d=new Float32Array(16);this.ownAll(Ex.create(e,o.audioEffects,this,i),e.broadcaster.broadcastFloats(o.address,d,p=>{if(!p)return;let f=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);f.forEach(({position:g},v)=>d[v]=g),d[f.length]=-1}),e.audioOutputBufferRegistry.register(o.address,this.#i,this.outgoing),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(pe.isStart(e)){let t=this.#t.file().flatMap(d=>d.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:o,solo:i,polyphone:n,exclude:s}=this.#t.namedParameter,a=o.getValue(),l=i.getValue();if(a||this.#e.hasSolo()&&!l)return;n.getValue()||this.#r.forEach(d=>d.release(!0)),s.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new Bx(this.#t,this.#n,t.unwrap(),e))}else pe.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,o){this.#i.clear(t,o);for(let i=this.#r.length-1;i>=0;i--)this.#r[i].processAdd(this.#i.channels(),t,o)&&this.#r.splice(i,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#o.clear()}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var Nx=class{#e=new O;#t;#r;#i;#o;constructor(e,t){this.#t=t,this.#r=this.#e.own(new Px(e,this)),this.#i=this.#e.own(new Sx(e,this)),this.#o=b.newSet(o=>o.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:o=>{let i=new Fx(e,this,o,this.#i);this.#o.add({uuid:o.uuid,processor:i,terminable:e.registerEdge(this.#r,i)}),e.sampleManager.getOrCreate(o.fileUUID())},onRemove:o=>{let{terminable:i,processor:n}=this.#o.removeByKey(o.uuid);i.terminate(),n.terminate()},onReorder:o=>{}}),{terminate:()=>{this.#o.forEach(({terminable:o,processor:i})=>{o.terminate(),i.terminate()}),this.#o.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#o.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#t.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#t.samples.adapters())t.exclude&&t!==e&&this.#o.opt(t.uuid).ifSome(({processor:o})=>o.forceStop())}get uuid(){return this.#t.uuid}get adapter(){return this.#t}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#e.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var Ix=class extends Me{#e;#t;#r;#i=Xt.stereoMatrix(sampleRate);#o={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#n;#s;#a;#l;#u;#c;#d=m.None;#p=ho.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Ee(e.broadcaster,t.address)),this.#n=this.own(this.bindParameter(t.namedParameter.volume)),this.#s=this.own(this.bindParameter(t.namedParameter.panning)),this.#a=this.own(this.bindParameter(t.namedParameter.stereo)),this.#l=this.own(this.bindParameter(t.namedParameter.invertL)),this.#u=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(o=>{this.#p=o.getValue(),this.#h=!0}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,o){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#o,this.#p,this.#f),this.#h=!1);let i=this.#d.unwrap().channels(),n=this.#t.channels();this.#i.processFrames(i,n,t,o),this.#r.processStereo(n,t,o),this.#f=!0}parameterChanged(e){switch(e){case this.#n:this.#o.gain=Ve(this.#n.getValue()),this.#h=!0;return;case this.#s:this.#o.panning=this.#s.getValue(),this.#h=!0;return;case this.#a:this.#o.stereo=this.#a.getValue(),this.#h=!0;return;case this.#l:this.#o.invertL=this.#l.getValue(),this.#h=!0;return;case this.#u:this.#o.invertR=this.#u.getValue(),this.#h=!0;return;case this.#c:this.#o.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var kx=class extends Or{#e;#t;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new ki(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(o=>{this.#r.ifSome(i=>i.terminate()),this.#r=m.wrap(o.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(o.targetVertex.unwrap().box,Ya.checkType))}),W.create(()=>{this.#r.ifSome(o=>o.terminate()),this.#r=m.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return D(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),W.create(()=>this.#i=m.None)}*processNotes(e,t,o){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(ld,vd.Identity);for(let s of i.processNotes(n.unwarp(e),n.unwarp(t),o))pe.isStart(s)?this.#t.noteOn(s.pitch):this.#t.noteOff(s.pitch),yield zr.overwrite(s,{position:ue(n.warp(s.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let o=this.#i.unwrap(),i=this.#r.mapOr(ld,vd.Identity);for(let n of o.iterateActiveNotesAt(i.unwarp(e),t))yield zr.overwrite(n,{position:i.warp(n.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,o){}};var $x=class extends Or{#e;#t;#r=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new ki(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),W.create(()=>this.#r=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().processNotes(e,t,o))yield i}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let o of this.#r.unwrap().iterateActiveNotesAt(e,t))yield o}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Dx=(r,e)=>(r[e]??r[e.toString()])?.value,od=(r,e,t)=>Dx(e,t)??Dx(r,t),_N=new Float32Array(128),Mx=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,o,i){this.event=e;let n=t.generators,s=o?.generators,a=Dx(s,53)??0,l=o?.sample??i.samples[a];this.sampleData=l.data,this.rootKey=Dx(s,58)??l?.header.originalPitch??60,this.sampleRate=l?.header.sampleRate??sampleRate,this.loopStart=l?.header.startLoop??0,this.loopEnd=l?.header.endLoop??this.sampleData.length;let c=od(n,s,54)??0;this.shouldLoop=c===1||c===3,this.pan=(od(n,s,17)??0)/1e3;let d=od(n,s,34),p=od(n,s,36),f=od(n,s,37),g=od(n,s,38),v=js(d)?Math.pow(2,d/1200):.005,x=js(p)?Math.pow(2,p/1200):.005,y=1-(f??0)/1e3,M=js(g)?Math.pow(2,g/1200):.005;this.envelope=new Al(sampleRate),this.envelope.set(v,x,y,M),this.envelope.gateOn(),this.#e=new Ti(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,o){let n=md(this.event.pitch+this.event.cent/100,440)/md(this.rootKey,440)*(this.sampleRate/sampleRate),s=_l(this.event.velocity),a=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(_N,t,o);let c=e.getChannel(0),d=e.getChannel(1);for(let p=t;p<o;p++){let f=Math.floor(this.playbackPosition),v=this.#t(f)/32768*s*this.#e.process(_N[p]);if(c[p]+=v*a,d[p]+=v*l,this.playbackPosition+=n,this.shouldLoop)this.playbackPosition>=this.loopEnd&&this.loopEnd>this.loopStart&&(this.playbackPosition=this.loopStart+(this.playbackPosition-this.loopEnd));else if(this.playbackPosition>=this.sampleData.length-1)return!0}return this.envelope.complete&&this.#e.value<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var Cx=class extends Me{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Zo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#o=this.own(new Ee(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing),t.box.file.catchupAndSubscribe(o=>this.#n=o.targetVertex.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.wrap(this)}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}reset(){this.#r.clear(),this.#o.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#n.flatMap(i=>i.soundfont);if(t.isEmpty())return;let o=t.unwrap();if(pe.isStart(e)){let i=o.presets[this.#e.presetIndex]??o.presets[0];if(ff(i)){console.warn("No preset available");return}let n=0;for(let s of i.zones){let a=Math.round(e.velocity*127);if(this.#s(e.pitch,a,s)){let l=s.instrument.zones;for(let c=0;c<l.length;c++){let d=l[c];this.#s(e.pitch,a,d)&&(this.#t.push(new Mx(e,s,d,o)),n++)}}}}else pe.isStop(e)&&this.#t.forEach(i=>{i.event.id===e.id&&i.release()})}processAudio(e,t,o){this.#i.clear(t,o);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#i,t,o)&&this.#t.splice(i,1)}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#s(e,t,o){return this.#a(o.generators[44]?.range,t)&&this.#a(o.generators[43]?.range,e)}#a(e,t){return fl(e)||t>=e.lo&&t<=e.hi}};var PN=r=>r>0?20*Math.log10(r):-100,SN=r=>Math.pow(10,r*.05);var Tx=class{#e=.08;#t=1;#r;#i;#o=0;#n=.14;#s=0;#a=.14;#l=0;#u=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,o){this.#l===0&&(this.#l=e[0]),this.#u===0&&(this.#u=e[0]),this.#s=0,this.#a=0;for(let n=t;n<o;++n){let s=e[n]*e[n];this.#l=Math.max(s,this.#r*this.#l+this.#i*s),this.#u=this.#r*this.#u+this.#i*s;let a=this.#l/this.#u;this.#c=a>0?a:0,this.#c>0&&(this.#o=2*(this.#e/this.#c),this.#n=2*(this.#t/this.#c)-this.#o,this.#s+=this.#o,this.#a+=this.#n)}let i=o-t;this.#s/=i,this.#a/=i}getAvgAttack(){return this.#s}getAvgRelease(){return this.#a}};var Rx=class{#e=[];#t;#r;#i;#o=0;constructor(e,t,o,i){this.#i=i,this.#r=Math.floor(e*t),this.#t=o+this.#r;for(let n=0;n<i;n++)this.#e[n]=new Float32Array(this.#t);this.#o=0}process(e,t,o){if(this.#r===0)return;let i=(this.#o-this.#r+this.#t)%this.#t;for(let n=0;n<this.#i;n++){let s=e.getChannel(n),a=this.#o,l=i;for(let c=t;c<o;c++){let d=this.#e[n][l];this.#e[n][a]=s[c],s[c]=d,a=(a+1)%this.#t,l=(l+1)%this.#t}}this.#o=(this.#o+(o-t))%this.#t}};var Ox=class{#e=-20;#t=2;#r=6;#i=3;#o=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#o=1/e-1)}setKnee(e){e!==this.#r&&(this.#r=e,this.#i=e/2)}applyCompression(e){let t=e-this.#e;return t<=-this.#i?0:t>-this.#i&&t<=this.#i?.5*this.#o*((t+this.#i)*(t+this.#i))/this.#r:this.#o*t}applyCompressionToBuffer(e,t,o){for(let i=t;i<o;++i){let n=Math.max(Math.abs(e[i]),1e-6),s=PN(n);e[i]=this.applyCompression(s)}}};var dl=class{#e;#t=1;#r=0;#i=0;#o=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#o&&(this.#i=e,this.#o=!1),this.#i=this.#t*e+this.#r*this.#i}setAlpha(e){this.#t=e,this.#r=1-this.#t}setAlphaWithTime(e){this.#t=Math.exp(-1/(this.#e*e)),this.#r=1-this.#t}getState(){return this.#i}};var Vx=class{#e;#t;#r;#i;#o=.01;#n=0;#s=.14;#a=0;#l=0;#u=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Tx(e),this.#r=new dl(e),this.#i=new dl(e),this.#n=Math.exp(-1/(e*this.#o)),this.#a=Math.exp(-1/(e*this.#s)),this.#l=0,this.#u=0}setAttack(e){e!==this.#o&&(this.#o=e,this.#n=Math.exp(-1/(this.#e*this.#o)))}setRelease(e){e!==this.#s&&(this.#s=e,this.#a=Math.exp(-1/(this.#e*this.#s)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#l?this.#l=this.#n*this.#l+(1-this.#n)*e:this.#l=this.#a*this.#l+(1-this.#a)*e,this.#l}applyBallistics(e,t,o){for(let i=t;i<o;++i)e[i]=this.#p(e[i])}processCrestFactor(e,t,o){(this.#c||this.#d)&&(this.#t.process(e,t,o),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var zx=class{#e;#t;#r;#i=0;#o=0;constructor(e,t,o){this.#t=Math.floor(e*t),this.#r=o+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,o){this.#n(e,t,o),this.#a(),this.#s(e,t,o)}#n(e,t,o){for(let i=t;i<o;i++)this.#e[this.#i]=e[i],this.#i=(this.#i+1)%this.#r;this.#o=o-t}#s(e,t,o){let i=this.#i-this.#o-this.#t;i<0&&(i+=this.#r);for(let n=t;n<o;n++)e[n]=this.#e[i],i=(i+1)%this.#r}#a(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,o=0;for(let n=0;n<this.#o;n++){let s=this.#e[e];s>t?(this.#e[e]=t,t+=o):(o=-s/this.#t,t=s+o),e=e-1,e<0&&(e+=this.#r)}let i=!1;for(let n=0;n<this.#t&&!i;n++){if(this.#e[e]>t)this.#e[e]=t,t+=o;else{i=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var Ux=class r extends Me{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#o;#n;#s;#a;#l;#u;#c;#d=.005;#p;#h;#f=new O;#m=m.None;#v=m.None;#g=!1;#A=!1;#B=!1;#S=!1;#_=!1;#$=-10;#y=2;#w=6;#x=2;#E=140;#M=0;#N=1;#F=0;#P=0;#I=0;#k=0;#D=!1;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=Xt.linear(sampleRate);let{lookahead:o,automakeup:i,autoattack:n,autorelease:s,inputgain:a,threshold:l,ratio:c,knee:d,attack:p,release:f,makeup:g,mix:v}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(o)),this.parameterAutomakeup=this.own(this.bindParameter(i)),this.parameterAutoattack=this.own(this.bindParameter(n)),this.parameterAutorelease=this.own(this.bindParameter(s)),this.parameterInputgain=this.own(this.bindParameter(a)),this.parameterThreshold=this.own(this.bindParameter(l)),this.parameterRatio=this.own(this.bindParameter(c)),this.parameterKnee=this.own(this.bindParameter(d)),this.parameterAttack=this.own(this.bindParameter(p)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(g)),this.parameterMix=this.own(this.bindParameter(v)),this.#o=new Vx(sampleRate),this.#n=new Ox,this.#s=new Rx(sampleRate,.005,128,2),this.#a=new zx(sampleRate,this.#d,128),this.#l=new dl(sampleRate),this.#l.setAlpha(.03),this.#u=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,x=>{this.#p[0]=Fb(this.#P),this.#p[1]=this.#k,this.#p[2]=Fb(this.#I)}),t.sideChain.catchupAndSubscribe(()=>{this.#f.terminate(),this.#v=m.None,this.#g=!0}),e.subscribeProcessPhase(x=>{x===0&&this.#g&&(this.#g=!1,t.sideChain.targetVertex.map(({box:y})=>y.address).ifSome(y=>{e.audioOutputBufferRegistry.resolve(y).ifSome(M=>{this.#v=m.wrap(M.buffer),this.#f.own(e.registerEdge(M.processor,this.incoming))})}))}),this.#f),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#D=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#u.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#F=0,this.#P=0,this.#I=0,this.#k=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#m=m.wrap(e),{terminate:()=>this.#m=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#m.isEmpty())return;let i=this.#m.unwrap(),n=i.getChannel(0),s=i.getChannel(1),a=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let c=t;c<o;c++){let d=this.#h.moveAndGet();a[c]=n[c]*d,l[c]=s[c]*d}if(this.#u.fill(0,t,o),this.#v.nonEmpty()){let c=this.#v.unwrap(),d=c.getChannel(0),p=c.getChannel(1);for(let f=t;f<o;f++)this.#u[f]=Math.max(Math.abs(d[f]),Math.abs(p[f]))}else for(let c=t;c<o;c++)this.#u[c]=Math.max(Math.abs(a[c]),Math.abs(l[c]));for(let c=t;c<o;c++){let d=this.#u[c];this.#P<=d?this.#P=d:this.#P*=r.PEAK_DECAY_PER_SAMPLE}this.#o.processCrestFactor(this.#u,t,o),this.#n.applyCompressionToBuffer(this.#u,t,o),this.#o.applyBallistics(this.#u,t,o);for(let c=t;c<o;c++){let d=this.#u[c];this.#k>=d?this.#k=d:this.#k+=r.REDUCTION_DECAY_PER_SAMPLE}this.#F=this.#R(this.#u,t,o),this.#A&&(this.#s.process(this.#r,t,o),this.#a.process(this.#u,t,o));for(let c=t;c<o;c++)this.#u[c]=SN(this.#u[c]+this.#M+this.#F);for(let c=t;c<o;c++)this.#c[0][c]=a[c],this.#c[1][c]=l[c];for(let c=t;c<o;c++)a[c]*=this.#u[c],l[c]*=this.#u[c];for(let c=t;c<o;c++){let d=a[c]*this.#N+this.#c[0][c]*(1-this.#N),p=l[c]*this.#N+this.#c[1][c]*(1-this.#N),f=Math.max(Math.abs(d),Math.abs(p));this.#I<=f?this.#I=f:this.#I*=r.PEAK_DECAY_PER_SAMPLE,a[c]=d,l[c]=p}this.#i.process(a,l,t,o),this.#D=!0}#R(e,t,o){let i=0;for(let n=t;n<o;n++)i+=e[n];return this.#l.process(-i/(o-t)),this.#B?this.#l.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#A=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#B=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#S=this.parameterAutoattack.getValue(),this.#o.setAutoAttack(this.#S),this.#S||this.#o.setAttack(this.#x*.001)):e===this.parameterAutorelease?(this.#_=this.parameterAutorelease.getValue(),this.#o.setAutoRelease(this.#_),this.#_||this.#o.setRelease(this.#E*.001)):e===this.parameterInputgain?this.#h.set(Ve(this.parameterInputgain.getValue()),this.#D):e===this.parameterThreshold?(this.#$=this.parameterThreshold.getValue(),this.#n.setThreshold(this.#$)):e===this.parameterRatio?(this.#y=this.parameterRatio.getValue(),this.#n.setRatio(this.#y)):e===this.parameterKnee?(this.#w=this.parameterKnee.getValue(),this.#n.setKnee(this.#w)):e===this.parameterAttack?(this.#x=this.parameterAttack.getValue(),this.#S||this.#o.setAttack(this.#x*.001)):e===this.parameterRelease?(this.#E=this.parameterRelease.getValue(),this.#_||this.#o.setRelease(this.#E*.001)):e===this.parameterMakeup?this.#M=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#N=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var jx=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#o;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#n=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=new _f(sampleRate),this.#o=this.own(new Ee(e.broadcaster,t.address));let{crush:o,bits:i,boost:n,mix:s}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(o)),this.parameterBitDepth=this.own(this.bindParameter(i)),this.parameterBoost=this.own(this.bindParameter(n)),this.parameterMix=this.own(this.bindParameter(s)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#n.isEmpty())return;let i=this.#n.unwrap();this.#i.process(i.channels(),this.#r.channels(),t,o),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1),t,o)}parameterChanged(e){e===this.parameterCrusherRate?this.#i.setCrush(1-this.parameterCrusherRate.getValue()):e===this.parameterBitDepth?this.#i.setBitDepth(this.parameterBitDepth.getValue()):e===this.parameterBoost?this.#i.setBoost(this.parameterBoost.getValue()):e===this.parameterMix&&this.#i.setMix(this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var sD=[2,4,8],EN=8,Lx=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#o;parameterDrive;parameterVolume;#n=m.None;#s=!1;#a;#l;#u;#c;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=[new Float32Array(128*EN),new Float32Array(128*EN)],this.#o=this.own(new Ee(e.broadcaster,t.address));let{drive:o,volume:i}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(o)),this.parameterVolume=this.own(this.bindParameter(i)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.overSampling.catchupAndSubscribe(n=>{let s=sD[n.getValue()];this.#a=new $f(s),this.#u=Xt.linear(sampleRate*s),this.#u.set(Ve(this.parameterDrive.getValue()),this.#s),this.#c=Xt.linear(sampleRate*s),this.#c.set(Ve(this.parameterVolume.getValue()),this.#s),this.#l=s})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#s=!1,this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#n.isEmpty())return;this.#a.upsample(this.#n.unwrap().channels(),this.#i,t,o);let i=(o-t)*this.#l,[n,s]=this.#i;for(let a=0;a<i;a++){let l=this.#c.moveAndGet(),c=this.#u.moveAndGet();n[a]=Nb(n[a]*c)*l,s[a]=Nb(s[a]*c)*l}this.#a.downsample(this.#i,this.#r.channels(),t,o),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1),t,o),this.#s=!0}parameterChanged(e){e===this.parameterDrive?this.#u.set(Ve(this.parameterDrive.getValue()),this.#s):e===this.parameterVolume&&this.#c.set(Ve(this.parameterVolume.getValue()),this.#s)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Kx=class extends Me{#e;#t;#r=[];#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#i=[];let{midiDevice:o,box:i,parameters:n}=t;this.#o=i.channel.getValue(),this.ownAll(i.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>this.#i.push(this.bindParameter(n.parameterAt(Ie(s,zi).value.address))),onRemoved:({box:s})=>C.removeIf(this.#i,a=>a.address===Ie(s,zi).value.address)}),i.channel.subscribe(s=>{o.ifSome(a=>this.#r.forEach(l=>e.sendMIDIData(a.id.getValue(),ut.noteOff(this.#o,l),a.delayInMs.getValue()))),this.#r.length=0,this.#o=s.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return m.wrap(this)}introduceBlock({p0:e,p1:t,s0:o,flags:i,bpm:n}){if(this.#n.isEmpty())return;let{box:{channel:s,device:a}}=this.#e,l=a.targetVertex.match({none:()=>m.None,some:({box:d})=>m.wrap(Ie(d,Vi))}),c=l.mapOr(d=>d.delayInMs.getValue(),0);for(let d of this.#n.unwrap().processNotes(e,t,i))if(d.pitch>=0&&d.pitch<=127){let p=o/sampleRate,f=X.pulsesToSeconds(d.position-e,n),g=(p+f)*1e3+c,v=s.getValue();if(pe.isStart(d)){let x=Math.round(d.velocity*127);this.#r.push(d.pitch),l.ifSome(y=>this.context.sendMIDIData(y.id.getValue(),ut.noteOn(v,d.pitch,x),g))}else if(pe.isStop(d)){let x=this.#r.indexOf(d.pitch);x>-1&&this.#r.splice(x,1),l.ifSome(y=>this.context.sendMIDIData(y.id.getValue(),ut.noteOff(v,d.pitch),g))}}}setNoteEventSource(e){return this.#n=m.wrap(e),W.create(()=>this.#n=m.None)}get incoming(){return this}get outgoing(){return this}reset(){}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}get adapter(){return this.#e}handleEvent(e){}processAudio(e,t,o){}parameterChanged(e,t=0){let{box:{channel:o,device:i}}=this.#e;if(i.isEmpty())return;let{id:n,delayInMs:s}=Ie(i.targetVertex.unwrap().box,Vi),a=t*1e3*s.getValue(),l=Ie(e.adapter.field.box,zi).controller.getValue(),c=Math.round(e.getValue()*127),d=ut.control(o.getValue(),l,c);this.context.sendMIDIData(n.getValue(),d,a)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var Wx=class extends Or{#e;#t;#r;#i=m.None;#o;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new ki(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#o=0;let{magnetPosition:o,magnetStrength:i,randomSeed:n,randomAmount:s,offset:a,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(o),this.bindParameter(i),this.bindParameter(n),this.bindParameter(s),this.bindParameter(a),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,c=>{this.#r[this.#o]=0,this.#o=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),W.create(()=>this.#i=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().processNotes(e,t,o))if(pe.isStart(i)){this.#t.noteOn(i.pitch);let n=this.#e.computeVelocity(i.position,i.velocity);this.#r[this.#o++]=Math.round(i.velocity*127)|Math.round(n*127)<<8|65536,yield zr.overwrite(i,{velocity:n})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let o of this.#i.unwrap().iterateActiveNotesAt(e,t))o.type==="note-event"&&(yield zr.overwrite(o,{velocity:this.#e.computeVelocity(o.position,o.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Zx=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c;#d;#p;#h=m.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new Pf,this.#n=new Ti(.003,sampleRate),this.#s=new Ti(.003,sampleRate);let{rate:o,depth:i,slope:n,symmetry:s,offset:a,channelOffset:l}=t.namedParameter;this.#a=this.bindParameter(o),this.#l=this.bindParameter(i),this.#u=this.bindParameter(n),this.#c=this.bindParameter(s),this.#d=this.bindParameter(a),this.#p=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#h=m.wrap(e),{terminate:()=>this.#h=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:o},i,n){if(this.#h.isEmpty())return;let s=this.#h.unwrap(),[a,l]=s.channels(),[c,d]=this.#r.channels();this.#f&&(this.#o.set(this.#l.getValue(),this.#u.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:p}=oo,f=X.samplesToPulses(1,t,sampleRate),v=1/ur.toPPQN(p[this.#a.getValue()]),x=this.#d.getValue()/360,y=x+this.#p.getValue()/360;for(let M=i;M<n;M++){let T=(e+M*f)*v+x,L=(e+M*f)*v+y;c[M]=a[M]*this.#n.process(this.#o.compute(T-Math.floor(T))),d[M]=l[M]*this.#s.process(this.#o.compute(L-Math.floor(L)))}this.#i.process(c,d),nt.every(o,5)&&(this.#m=(e+(n-i)*f)*v)}parameterChanged(e){(e===this.#l||e===this.#u||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Gx=class{#e;#t=[];#r;#i;#o;#n=0;#s=0;#a=0;#l=0;#u=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#v=.5;#g=.005;#A=.5;#B=.7;#S=.3;#_=.6;constructor(e){this.#e=e,this.#o=e+1,this.#r=new Float32Array(this.#o),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(i=>this.#$(i));let o=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(o,i=>Math.round(i*e))}#$(e){let t=Math.round(e*this.#e),o=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(o),t-1,0,o-1])}#y(e,t){return this.#t[e][0][this.#t[e][1]]=t}#w(e){return this.#t[e][0][this.#t[e][2]]}#x(e,t){let o=this.#t[e];return o[0][o[2]+t&o[3]]}#E(e,t){let o=this.#t[e],i=t-~~t,n=~~t+o[2]-1,s=o[3],a=o[0][n++&s],l=o[0][n++&s],c=o[0][n++&s],d=o[0][n&s],p=(3*(l-c)-a+d)*.5,f=2*c+a-(5*l+d)*.5,g=(c-a)*.5;return((p*i+f)*i+g)*i+l}set preDelayMs(e){this.#c=Math.floor(e/1e3*this.#e)}set bandwidth(e){this.#d=e*.9999}set inputDiffusion1(e){this.#p=e}set inputDiffusion2(e){this.#h=e}set decay(e){this.#f=e}set decayDiffusion1(e){this.#m=e*.999999}set decayDiffusion2(e){this.#v=e*.999999}set damping(e){this.#g=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#B=e*2}set wetGain(e){this.#S=e}set dryGain(e){this.#_=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#n=0,this.#s=0,this.#a=0,this.#l=0,this.#u=0}process(e,t,o,i){let n=this.#c,s=this.#d,a=this.#p,l=this.#h,c=this.#f,d=this.#m,p=this.#v,f=1-this.#g,g=this.#A/this.#e,v=this.#B*this.#e/1e3,x=this.#S*.6,y=this.#_,M=e[0],T=e[1],L=t[0],R=t[1];for(let z=o;z<i;z++){let ee=M[z],te=T[z];this.#r[this.#n]=(ee+te)*.5,L[z]=ee*y,R[z]=te*y;let H=this.#r[(this.#o+this.#n-n)%this.#o];this.#s+=s*(H-this.#s);let ye=this.#y(0,this.#s-a*this.#w(0));ye=this.#y(1,a*(ye-this.#w(1))+this.#w(0)),ye=this.#y(2,a*ye+this.#w(1)-l*this.#w(2)),ye=this.#y(3,l*(ye-this.#w(3))+this.#w(2));let le=l*ye+this.#w(3),Oe=v*(1+Math.cos(this.#u*6.28)),He=v*(1+Math.sin(this.#u*6.2847)),_e=this.#y(4,le+c*this.#w(11)+d*this.#E(4,Oe));this.#y(5,this.#E(4,Oe)-d*_e),this.#a+=f*(this.#w(5)-this.#a),_e=this.#y(6,c*this.#a-p*this.#w(6)),this.#y(7,this.#w(6)+p*_e),_e=this.#y(8,le+c*this.#w(7)+d*this.#E(8,He)),this.#y(9,this.#E(8,He)-d*_e),this.#l+=f*(this.#w(9)-this.#l),_e=this.#y(10,c*this.#l-p*this.#w(10)),this.#y(11,this.#w(10)+p*_e);let Je=this.#x(9,this.#i[0])+this.#x(9,this.#i[1])-this.#x(10,this.#i[2])+this.#x(11,this.#i[3])-this.#x(5,this.#i[4])-this.#x(6,this.#i[5])-this.#x(7,this.#i[6]),Le=this.#x(5,this.#i[7])+this.#x(5,this.#i[8])-this.#x(6,this.#i[9])+this.#x(7,this.#i[10])-this.#x(9,this.#i[11])-this.#x(10,this.#i[12])-this.#x(11,this.#i[13]);L[z]+=Je*x,R[z]+=Le*x,this.#u+=g,this.#n=(this.#n+1)%this.#o;for(let we=0;we<this.#t.length;we++){let Ye=this.#t[we];Ye[1]=Ye[1]+1&Ye[3],Ye[2]=Ye[2]+1&Ye[3]}}}};var qx=class r extends Me{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#t=t,this.#i=new xe,this.#o=this.own(new Ee(e.broadcaster,t.address)),this.#r=new Gx(sampleRate);let{preDelay:o,bandwidth:i,inputDiffusion1:n,inputDiffusion2:s,decay:a,decayDiffusion1:l,decayDiffusion2:c,damping:d,excursionRate:p,excursionDepth:f,wet:g,dry:v}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(o)),this.parameterBandwidth=this.own(this.bindParameter(i)),this.parameterInputDiffusion1=this.own(this.bindParameter(n)),this.parameterInputDiffusion2=this.own(this.bindParameter(s)),this.parameterDecay=this.own(this.bindParameter(a)),this.parameterDecayDiffusion1=this.own(this.bindParameter(l)),this.parameterDecayDiffusion2=this.own(this.bindParameter(c)),this.parameterDamping=this.own(this.bindParameter(d)),this.parameterExcursionRate=this.own(this.bindParameter(p)),this.parameterExcursionDepth=this.own(this.bindParameter(f)),this.parameterWet=this.own(this.bindParameter(g)),this.parameterDry=this.own(this.bindParameter(v)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#o.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#n.isEmpty())return;let i=this.#n.unwrap();this.#r.process(i.channels(),this.#i.channels(),t,o),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1),t,o)}parameterChanged(e){e===this.parameterPreDelay?this.#r.preDelayMs=this.parameterPreDelay.getValue():e===this.parameterBandwidth?this.#r.bandwidth=this.parameterBandwidth.getValue():e===this.parameterInputDiffusion1?this.#r.inputDiffusion1=this.parameterInputDiffusion1.getValue():e===this.parameterInputDiffusion2?this.#r.inputDiffusion2=this.parameterInputDiffusion2.getValue():e===this.parameterDecay?this.#r.decay=this.parameterDecay.getValue():e===this.parameterDecayDiffusion1?this.#r.decayDiffusion1=this.parameterDecayDiffusion1.getValue():e===this.parameterDecayDiffusion2?this.#r.decayDiffusion2=this.parameterDecayDiffusion2.getValue():e===this.parameterDamping?this.#r.damping=this.parameterDamping.getValue():e===this.parameterExcursionRate?this.#r.excursionRate=this.parameterExcursionRate.getValue():e===this.parameterExcursionDepth?this.#r.excursionDepth=this.parameterExcursionDepth.getValue():e===this.parameterWet?this.#r.wetGain=Ve(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Ve(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Z1;(e=>e.create=(t,o)=>o.accept({visitAudioBusBox:i=>new td(t,t.boxAdapters.adapterFor(i,mr)),visitVaporisateurDeviceBox:i=>new hx(t,t.boxAdapters.adapterFor(i,qu)),visitNanoDeviceBox:i=>new _x(t,t.boxAdapters.adapterFor(i,Qu)),visitTapeDeviceBox:i=>new gx(t,t.boxAdapters.adapterFor(i,Gu)),visitPlayfieldDeviceBox:i=>new Nx(t,t.boxAdapters.adapterFor(i,bs)),visitSoundfontDeviceBox:i=>new Cx(t,t.boxAdapters.adapterFor(i,uc)),visitMIDIOutputDeviceBox:i=>new Kx(t,t.boxAdapters.adapterFor(i,gc))}))(Z1||={});var G1;(e=>e.create=(t,o)=>re(o.accept({visitUnknownMidiEffectDeviceBox:i=>new $x(t,t.boxAdapters.adapterFor(i,sc)),visitArpeggioDeviceBox:i=>new yx(t,t.boxAdapters.adapterFor(i,Xi)),visitPitchDeviceBox:i=>new xx(t,t.boxAdapters.adapterFor(i,Hu)),visitVelocityDeviceBox:i=>new Wx(t,t.boxAdapters.adapterFor(i,vc)),visitZeitgeistDeviceBox:i=>new kx(t,t.boxAdapters.adapterFor(i,oc))}),`Could not create midi-effect for'${o.name}'`))(G1||={});var af;(e=>e.create=(t,o)=>re(o.accept({visitUnknownAudioEffectDeviceBox:i=>new tf(t,t.boxAdapters.adapterFor(i,nc)),visitStereoToolDeviceBox:i=>new Ix(t,t.boxAdapters.adapterFor(i,rc)),visitCompressorDeviceBox:i=>new Ux(t,t.boxAdapters.adapterFor(i,cc)),visitDelayDeviceBox:i=>new ax(t,t.boxAdapters.adapterFor(i,mi)),visitDattorroReverbDeviceBox:i=>new qx(t,t.boxAdapters.adapterFor(i,yc)),visitTidalDeviceBox:i=>new Zx(t,t.boxAdapters.adapterFor(i,oo)),visitCrusherDeviceBox:i=>new jx(t,t.boxAdapters.adapterFor(i,dc)),visitFoldDeviceBox:i=>new Lx(t,t.boxAdapters.adapterFor(i,hc)),visitReverbDeviceBox:i=>new Ax(t,t.boxAdapters.adapterFor(i,Fu)),visitRevampDeviceBox:i=>new bx(t,t.boxAdapters.adapterFor(i,Nu)),visitModularDeviceBox:i=>new tf(t,t.boxAdapters.adapterFor(i,fs))}),`Could not create audio-effect for'${o.name}'`))(af||={});var Hx=class extends Me{#e;#t;#r;#i;#o;#n;#s=m.None;#a=!0;#l=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=Xt.linear(sampleRate),this.#i=Xt.linear(sampleRate),this.#o=this.own(this.bindParameter(t.sendGain)),this.#n=this.own(this.bindParameter(t.sendPan)),this.own(e.registerProcessor(this)),this.readAllParameters()}reset(){this.#t.clear()}get adapter(){return this.#e}setAudioSource(e){return this.#s=m.wrap(e),{terminate:()=>this.#s=m.None}}get audioOutput(){return this.#t}processAudio(e,t,o){if(this.#s.isEmpty())return;if(this.#a){let c=Ve(this.#o.getValue()),d=this.#n.getValue();this.#r.set((1-Math.max(0,d))*c,this.#l),this.#i.set((1+Math.min(0,d))*c,this.#l),this.#a=!1}let i=this.#t.getChannel(0),n=this.#t.getChannel(1),s=this.#s.unwrap(),a=s.getChannel(0),l=s.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let c=t;c<o;c++)i[c]=a[c]*this.#r.moveAndGet(),n[c]=l[c]*this.#i.moveAndGet();else{let c=this.#r.get(),d=this.#i.get();for(let p=t;p<o;p++)i[p]=a[p]*c,n[p]=l[p]*d}this.#l=!0}parameterChanged(e){this.#a=!0}};var Jx=class extends Me{#e;#t;#r;#i;#o;#n;#s;#a;#l=Xt.linear(sampleRate);#u=Xt.linear(sampleRate);#c=Xt.linear(sampleRate);#d=m.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new Ee(e.broadcaster,this.#e.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#s=this.own(this.bindParameter(this.#e.namedParameter.mute)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#h=!1}get isMute(){return this.#s.getValue()}get isSolo(){return this.#a.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#d.isEmpty())return;if(this.#p){let p=this.context.mixer;p.updateSolo();let f=this.isSolo||p.isVirtualSolo(this),g=this.isMute||p.hasChannelSolo()&&!f&&!this.#e.isOutput,v=Ve(this.#o.getValue()),x=this.#n.getValue();this.#l.set((1-Math.max(0,x))*v,this.#h),this.#u.set((1+Math.min(0,x))*v,this.#h),this.#c.set(g?0:1,this.#h),this.#p=!1}let i=this.#d.unwrap(),[n,s]=i.channels(),[a,l]=this.#t.channels(),[c,d]=this.#r;if(this.#l.isInterpolating()||this.#u.isInterpolating()||this.#c.isInterpolating())for(let p=t;p<o;p++){let f=this.#c.moveAndGet(),g=n[p]*this.#l.moveAndGet(),v=s[p]*this.#u.moveAndGet();a[p]=g*f,l[p]=v*f,c[p]=g,d[p]=v}else{let p=this.#l.get(),f=this.#u.get(),g=this.#c.get();for(let v=t;v<o;v++){let x=n[v]*p,y=s[v]*f;c[v]=x,d[v]=y,a[v]=x*g,l[v]=y*g}}this.#i.process(c,d,t,o),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#o?this.requestGainUpdate():e===this.#n?this.requestGainUpdate():e===this.#s?this.requestGainUpdate():e===this.#a&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}toString(){return`{${this.constructor.name}}`}};var Qx=class{#e=new O;#t;#r;#i;#o;#n;#s;#a=[];#l=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=b.newSet(o=>o.adapter.uuid),this.#o=this.#e.own(new Jx(this.#t.context,this.#t.adapter)),this.#n=b.newSet(({device:o})=>o.uuid),this.#s=this.#e.own(new O),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let i=af.create(this.#t.context,o.box),n=this.#n.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(n,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:i,subscription:n}=this.#n.removeByKey(o.uuid);n.terminate(),i.terminate()},onReorder:o=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let i=this.#i.add(new Hx(this.#t.context,o));D(i,"Could not add.")},onRemove:({uuid:o})=>{this.invalidateWiring(),this.#i.removeByKey(o).terminate()},onReorder:o=>{}}),this.#t.adapter.output.catchupAndSubscribe(o=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(o=>{o===0&&this.#l&&(this.#u(),this.#l=!1)}))}get channelStrip(){return this.#o}invalidateWiring(){this.#s.terminate(),this.#l=!0}terminate(){this.#e.terminate(),this.#n.forEach(({device:e})=>e.terminate()),this.#n.clear(),this.#a=[]}toString(){return`{${this.constructor.name}}`}#u(){let e=this.#t.adapter.isOutput,t=this.#t.context,o=this.#t.input(),i=this.#t.adapter.output.adapter.map(s=>t.getAudioUnit(s.deviceHost().uuid).inputAsAudioBus());if(o.isEmpty()||i.isEmpty()&&!e)return;let n=o.unwrap();if(this.#r.includeAudioEffects){C.replace(this.#a,this.#t.adapter.audioEffects.adapters().map(({uuid:s})=>this.#n.get(s).device));for(let s of this.#a)s.adapter().enabledField.getValue()&&(this.#s.own(s.setAudioSource(n.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,s.incoming)),n=s)}if(this.#r.includeSends&&this.#i.forEach(s=>{let a=t.getAudioUnit(s.adapter.targetBus.deviceHost().uuid);this.#s.own(s.setAudioSource(n.audioOutput)),this.#s.own(a.inputAsAudioBus().addAudioSource(s.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,s)),this.#s.own(t.registerEdge(s,a.inputAsAudioBus()))}),this.#s.own(this.#o.setAudioSource(n.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,this.#o)),i.nonEmpty()&&!e){let s=i.unwrap();this.#s.own(s.addAudioSource(this.#o.audioOutput)),this.#s.own(t.registerEdge(this.#o,s))}}};var Xx=class{#e=new O;#t;#r;#i;#o;#n;#s;#a;constructor(e,t){this.#t=e,this.#r=t,this.#i=yl.create(268431651),this.#o=new Set,this.#n=[],this.#s=new Zs,this.#a=new Zs,this.#e.ownAll(this.#t.subscribeProcessPhase(o=>{if(o===1)for(let i of this.#o)i.gate||this.#o.delete(i)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#o.add({pitch:e,velocity:t,gate:!0,running:m.None})}pushRawNoteOff(e){for(let t of this.#o)if(t.running.isEmpty())this.#o.delete(t);else if(t.pitch===e){t.gate=!1;return}}auditionNote(e,t,o){this.#n.push({pitch:e,duration:t,velocity:o})}*processNotes(e,t,o){let i=nt.every(o,5),n=nt.every(o,2);if(this.#a.nonEmpty()&&(!i||n?yield*this.#d(e):yield*this.#p(e,t)),this.#s.nonEmpty())if(n)for(let s of this.#s.releaseAll())yield pe.stop(s,e);else for(let s of this.#s.releaseLinearCompleted(t))yield pe.stop(s,s.position+s.duration);if(this.#o.size>0)for(let s of this.#o){if(s.running.isEmpty()){let{pitch:a,velocity:l}=s,c=Number.POSITIVE_INFINITY,d=pe.start(e,c,a,l);s.running=m.wrap(d),yield d}s.gate||(this.#o.delete(s),yield pe.stop(s.running.unwrap("raw note never started"),e))}if(this.#n.length>0){for(let s of this.#s.releaseAll())yield pe.stop(s,e);for(let{pitch:s,duration:a,velocity:l}of this.#n){let c=pe.start(e,a,s,l);this.#s.addAndRetain({...c}),yield c}this.#n.length=0}if(i){let s=this.#r.tracks.collection.adapters().filter(a=>a.type===oe.Notes&&a.enabled.getValue());for(let a of s){let l=this.#t.clipSequencing.iterate(a.uuid,e,t);for(let{optClip:c,sectionFrom:d,sectionTo:p}of l)c.isEmpty()?yield*this.#u(a,d,p):yield*this.#l(c.unwrap(),d,p)}yield*this.#p(e,t)}}*iterateActiveNotesAt(e,t){if(this.#o.size>0)for(let{pitch:o,velocity:i}of this.#o)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:o,velocity:i,cent:0};yield*this.#s.overlapping(e,Qt.Comparator),!t&&(yield*this.#a.overlapping(e,Qt.Comparator))}reset(){this.#o.clear(),this.#a.clear(),this.#n.length=0,this.#s.clear()}toString(){return`{${this.constructor.name}}`}*#l(e,t,o){if(e.optCollection.isEmpty())return;let i=e.optCollection.unwrap(),n=e.duration,s=Qo(t,n),a=s+n;o>a?(yield*this.#c(i,t,a,s),yield*this.#c(i,a,o,a)):yield*this.#c(i,t,o,s)}*#u(e,t,o){for(let i of e.regions.collection.iterateRange(t,o)){if(this.#t.ignoresRegion(i.address.uuid)||i.mute||!Ce(i,rs))continue;let n=i.optCollection;if(n.isEmpty())continue;let s=n.unwrap();for(let{resultStart:a,resultEnd:l,rawStart:c}of Jt.locateLoops(i,t,o))yield*this.#c(s,a,l,c)}}*#c(e,t,o,i){let n=t-i,s=o-i;for(let a of e.events.iterateRange(n-e.maxDuration,s)){if(!Qt.isOfType(a))continue;let{position:l,duration:c,chance:d,playCount:p,playCurve:f}=a;if(!(d<100&&this.#i.nextDouble(0,100)>d)){if(p>1){let g=Qt.inverseCurveFunc((n-l)/c,f),v=Qt.inverseCurveFunc((s-l)/c,f),x=Math.floor(g*p),y=x/p;for(;y<v;){if(y>=g){let M=Qt.curveFunc(y,f)*c;if(M>=c)break;let T=Qt.curveFunc(y+1/p,f)*c,L=pe.startWith(a,l+M+i,T-M);this.#a.addAndRetain({...L}),yield L}y=++x/p}}else if(n<=l&&l<s){let g=pe.startWith(a,l+i);this.#a.addAndRetain({...g}),yield g}}}}*#d(e){for(let t of this.#a.releaseAll())yield pe.stop(t,e)}*#p(e,t){for(let o of this.#a.releaseLinearCompleted(t)){let i=ue(o.position+o.duration,e,t);yield pe.stop(o,i)}}};var Yx=class{#e=new O;#t;#r;#i;#o;#n=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new Xx(this.#t.context,this.#t.adapter)),this.#i=b.newSet(({device:t})=>t.uuid),this.#o=this.#e.own(new O),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let o=G1.create(this.#t.context,t.box),i=this.#i.add({device:o,subscription:o.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(i,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:o,subscription:i}=this.#i.removeByKey(t.uuid);i.terminate(),o.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#n&&(this.#s(),this.#n=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#o.terminate(),this.#n=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#s(){let e=this.#t.input().flatMap(i=>i.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),o=this.#r;this.#t.adapter.midiEffects.adapters().map(i=>this.#i.get(i.uuid).device).forEach(i=>{i.adapter().enabledField.getValue()&&(this.#o.ownAll(i.setNoteEventSource(o),this.#t.context.registerEdge(i,t.incoming)),o=i)}),this.#o.own(t.setNoteEventSource(o))}};var eb=class r{static ID=0;#e=r.ID++;#t=new O;#r;#i;#o;#n;#s=m.None;constructor(e,t,o){this.#r=e,this.#i=t,this.#o=this.#t.own(new Yx(this)),this.#n=this.#t.own(new Qx(this,o)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(i=>{this.#o.invalidateWiring(),this.#n.invalidateWiring(),this.#s.ifSome(n=>n.terminate()),this.#s=i.getValue().flatMap(n=>m.wrap(Z1.create(e,n.box.box)))}))}input(){return this.#s}inputAsAudioBus(){return Ie(this.#s.unwrap("No input available"),td)}audioOutput(){return this.#n.channelStrip.audioOutput}get midiDeviceChain(){return this.#o}get audioDeviceChain(){return this.#n}get context(){return this.#r}get adapter(){return this.#i}terminate(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#s.ifSome(e=>e.terminate()),this.#s=m.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var tb=class{#e;#t;#r;#i=!1;constructor(){this.#e=b.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),W.many(e.adapter.input.subscribe(()=>this.#o()),e.adapter.output.subscribe(()=>this.#o()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#o()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#o()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#o(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=o=>{e.has(o)||(e.add(o),o.adapter.input.getValue().ifSome(i=>{i.type==="bus"&&i.box.input.pointerHub.filter(u.AudioOutput).map(n=>re(n.box.accept({visitAudioUnitBox:({address:{uuid:s}})=>this.#e.get(s),visitAuxSendBox:({audioUnit:{targetVertex:s}})=>this.#e.get(s.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(n=>{n.isSolo||this.#r.add(n),t(n)})}))};this.#e.forEach(o=>{o.isSolo&&t(o)}),this.#i=!1}};var zs;(function(r){r[r.Float=0]="Float",r[r.FloatArray=1]="FloatArray",r[r.Integer=2]="Integer",r[r.IntegerArray=3]="IntegerArray",r[r.ByteArray=4]="ByteArray"})(zs||(zs={}));var uf;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(uf||(uf={}));var nd;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(nd||(nd={}));var rb=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#o=Mt.create(0);#n=m.None;#s=m.None;#a=m.None;#l=-1;#u=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=tn.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(o){t(this.sendShareLock,o)}sendUpdateData(o){t(this.sendUpdateData,o)}sendUpdateStructure(o){t(this.sendUpdateStructure,o)}})}flush(){let e=this.#h();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#e.length,o=this.#f(),i=t+o;if(this.#n.isEmpty()||this.#n.unwrap().byteLength<i||t!==this.#p){let s=Fn(i),a=new SharedArrayBuffer(s);this.#s=m.wrap(new Uint8Array(a,0,t)),this.#o=Mt.use(a,t),this.#n=m.wrap(a),this.#p=t,this.#i.sendUpdateData(a)}}this.#n.isEmpty()||Atomics.load(this.#r,0)===uf.WRITE&&(this.#m(this.#o),this.#o.position=0,Atomics.store(this.#r,0,uf.READ))}broadcastFloat(e,t){return this.#g(new class{type=zs.Float;address=e;capacity=8;put(o,i){o.writeFloat(t())}})}broadcastInteger(e,t){return this.#g(new class{type=zs.Integer;address=e;capacity=8;put(o,i){o.writeInt(t())}})}broadcastFloats(e,t,o){return this.#g(new class{type=zs.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(i,n){o?.(n),i.writeInt(t.length);for(let s of t)i.writeFloat(s)}})}broadcastIntegers(e,t,o){return this.#g(new class{type=zs.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i,n){o(n),i.writeInt(t.length),t.forEach(s=>i.writeInt(s))}})}broadcastByteArray(e,t,o){return this.#g(new class{type=zs.ByteArray;address=e;capacity=4+t.byteLength;put(i,n){o(n),i.writeInt(t.byteLength),i.writeBytes(t)}})}#h(){if(this.#c){try{this.#a=m.wrap(this.#B())}catch(e){throw e}this.#c=!1}if(this.#a.nonEmpty()){let e=this.#a;return this.#a=m.None,e}return m.None}#f(){return this.#u===-1&&(this.#u=this.#v()+12),this.#u}terminate(){C.clear(this.#e),this.#a=m.None,this.#c=!1,this.#u=0}#m(e){D(!this.#c&&this.#a.isEmpty(),"Cannot flush while update is available");let t=this.#f();D(e.remaining>=t,"Insufficient data"),e.writeInt(this.#l),e.writeInt(nd.START);let o=this.#s;for(let i=0;i<this.#e.length;i++){let n=o.nonEmpty()&&o.unwrap()[i]!==0;this.#e[i].put(e,n)}e.writeInt(nd.END)}#v(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#g(e){return this.#e.push(e),this.#A(),{terminate:()=>{C.removeOpt(this.#e,e),this.#A()}}}#A(){this.#u=-1,this.#c=!0}#B(){let e=Mt.create();e.writeInt(nd.ID),e.writeInt(++this.#l),e.writeInt(this.#e.length);for(let{address:t,type:o}of this.#e)t.write(e),e.writeByte(o);return e.toArrayBuffer()}};var ib=class{#e;#t;#r=new xe;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:o,bpm:i,s0:n,s1:s,flags:a})=>{if(this.#t.metronomeEnabled&&nt.every(a,1)){let[l,c]=this.#e.signature,d=X.fromSignature(1,c);for(let p of po.iterate(t,o,d)){D(t<=p&&p<o,()=>`${p} out of bounds (${t}, ${o})`);let f=Math.floor(X.pulsesToSamples(p-t,i,sampleRate));this.#i.push(new q1(p,n+f,l,c))}}this.#r.clear(n,s);for(let l=this.#i.length-1;l>=0;l--)this.#i[l].processAdd(this.#r,n,s)&&this.#i.splice(l,1)})}get output(){return this.#r}},q1=class{#e;#t=0;#r=0;constructor(e,t,o,i){D(t>=0&&t<128,`${t} out of bounds`),this.#e=X.toParts(e,o,i).beats===0?880:440,this.#r=t}processAdd(e,t,o){let[i,n]=e.channels(),s=Math.floor(.002*sampleRate),a=Math.floor(.05*sampleRate);for(let l=Math.max(this.#r,t);l<o;l++){let c=Math.min(this.#t/s,1-(this.#t-s)/a),d=Math.sin(this.#t/sampleRate*Ci*this.#e)*.25*c*c;if(i[l]+=d,n[l]+=d,++this.#t>s+a)return!0}return this.#r=0,!1}};var ob=class{#e;constructor(){this.#e=be.newSet(({address:e})=>e)}register(e,t,o){return this.#e.add({address:e,buffer:t,processor:o}),{terminate:()=>this.#e.removeByKey(e)}}resolve(e){return this.#e.opt(e)}};var nb=class{#e;#t;#r=!0;#i=!1;#o=null;#n=!1;#s=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#n=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new vl}setCallback(e,t){return this.#t.add(e,t),W.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#n=!1,this.#s=0,this.#o=null}process(e){let t=!1,{timeInfo:o,timelineBoxAdapter:{box:i,markerTrack:n}}=this.#e,s=i.bpm.getValue(),a=o.transporting;if(a){let l=[],c=o.position,d=0,p=0,f=o.getLeapStateAndReset();for(;d<128;){if(this.#n||f){this.#n=!1;let H=n.events.lowerEqual(c);(this.#o?.at(0)??null)!==H&&(this.#o=Z(H)?[H,0]:null,t=!0)}let g=128-d,v=c+X.samplesToPulses(g,s,sampleRate),x=null,y=Number.POSITIVE_INFINITY;if(n.enabled){let H=Array.from(tt.take(n.events.iterateFrom(c),2));if(H.length>0){let[ye,le]=H;this.#o===null?ye.position>=c&&ye.position<v&&(x={type:"marker",prev:ye,next:le},y=ye.position):Z(le)&&le!==this.#o[0]&&ye.position<c&&le.position<v&&(x={type:"marker",prev:ye,next:le},y=le.position)}}let{isRecording:M,isCountingIn:T}=this.#e.timeInfo,{from:L,to:R,enabled:z}=i.loopArea;if(z.getValue()&&!(M||T)||this.#r){let H=R.getValue();c<H&&v>H&&H<y&&(x={type:"loop",target:L.getValue()},y=H)}if(this.#t.keyCount()>0)for(let H of this.#t.keys())c<H&&v>H&&H<y&&(x={type:"callback",position:H,callbacks:this.#t.get(H)},y=H);let te=!o.isCountingIn;if(x===null){let H=d+g;l.push({index:p++,p0:c,p1:v,s0:d,s1:H,bpm:s,flags:Yc.create(a,f,te,this.#i)}),f=!1,c=v,d=H}else{let H=()=>{if(y>c){let le=d+X.pulsesToSamples(y-c,s,sampleRate)|0;le>d&&(l.push({index:p++,p0:c,p1:y,s0:d,s1:le,bpm:s,flags:Yc.create(a,f,te,this.#i)}),f=!1),c=y,d=le}},ye=()=>{if(d<128){let le=d+X.pulsesToSamples(v-c,s,sampleRate)|0;l.push({index:p++,p0:c,p1:y,s0:d,s1:le,bpm:s,flags:Yc.create(!1,!1,!1,this.#i)}),d=le}};switch(x.type){case"loop":{H(),this.#r?(this.#e.timeInfo.pause(),ye()):(c=x.target,f=!0);break}case"marker":{let{prev:le,next:Oe}=x;!Z(this.#o)||this.#o[0]!==le?this.#o=[le,0]:++this.#o[1]<le.plays||le.plays===0?(H(),c=le.position,f=!0):this.#o=[Oe,0],t=!0;break}case"callback":{H(),x.callbacks.forEach(le=>le());break}}}this.#i=!1}e({blocks:l}),o.advanceTo(c),this.#s=c}else{if(this.#n||o.getLeapStateAndReset()){this.#n=!1;let p=n.events.lowerEqual(o.position);p!==null&&this.#o?.at(0)!==p&&(this.#o=[p,0],t=!0)}let l=this.#s,c=l+X.samplesToPulses(128,s,sampleRate),d={blocks:[{index:0,p0:l,p1:c,s0:0,s1:128,bpm:s,flags:Yc.create(!1,!1,!1,!1)}]};e(d),this.#s=c}t&&this.#e.engineToClient.switchMarkerState(Z(this.#o)?[this.#o[0].uuid,this.#o[1]]:null)}};var H1=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(o=>this.#t=m.wrap(o))}peaks=m.None;#e={type:"idle"};#t=m.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return W.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},sb=class{#e;#t;constructor(e){this.#e=e,this.#t=b.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new H1(t,this.#e))}remove(e){}invalidate(e){}};var ab=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},lb=class{#e;#t;#r=[];#i=[];#o=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let o=t.uuid;this.#t.opt(o).ifSome(i=>{i.playing.ifSome(n=>this.#s(n.uuid)),i.playing=m.None,i.waiting=m.None}),this.#t.forEach(i=>{i.playing.nonEmpty()&&b.equals(i.playing.unwrap().uuid,o)&&(i.playing=m.None,this.#s(o));let n=i.waiting.flatMap(ld);n.nonEmpty()&&b.equals(n.unwrap().uuid,o)&&(i.waiting=m.None)})}}}),this.#t=b.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let o=this.#t.getOrCreate(t,n=>new ab(n));if(o.playing.nonEmpty()&&o.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let i=o.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#o.push(i.unwrap().uuid),o.waiting=m.None),console.debug(`schedulePlay(${b.toString(o.uuid)} > ${e})`),C.removeOpt(this.#o,e.uuid),o.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,i=>new ab(i)),o=t.waiting.flatMap(i=>i);o.nonEmpty()&&(console.debug("obsolete",o.unwrap()),this.#o.push(o.unwrap().uuid),t.waiting=m.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${b.toString(e)})`),t.waiting=m.wrap(m.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(o=>this.#o.push(o.uuid))),e.waiting=m.None,e.playing.ifSome(t=>this.#s(t.uuid)),e.playing=m.None}),this.#t.clear()}*iterate(e,t,o){let i=this.#t.getOrNull(e);if(i===null){yield{optClip:m.None,sectionFrom:t,sectionTo:o};return}if(i.waiting.nonEmpty()){let n=i.waiting.unwrap(),s=i.playing.mapOr(l=>l.duration,X.Bar),a=Qo(o,s);a>=t?(t<a&&(yield{optClip:i.playing,sectionFrom:t,sectionTo:a}),i.waiting=m.None,i.playing.ifSome(l=>this.#s(l.uuid)),n.nonEmpty()?(i.playing=n,this.#n(n.unwrap().uuid)):i.playing=m.None,yield{optClip:i.playing,sectionFrom:a,sectionTo:o}):yield{optClip:i.playing,sectionFrom:t,sectionTo:o}}else if(i.playing.nonEmpty()){let n=i.playing.unwrap();if(n.box.triggerMode.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:o};else{let s=Qo(t,n.duration)+n.duration;s<=o?(yield{optClip:i.playing,sectionFrom:t,sectionTo:s},i.playing=m.None,this.#s(n.uuid),s<o&&(yield{optClip:m.None,sectionFrom:s,sectionTo:o})):yield{optClip:i.playing,sectionFrom:t,sectionTo:o}}}else yield{optClip:m.None,sectionFrom:t,sectionTo:o}}changes(){if(this.#r.length>0||this.#i.length>0||this.#o.length>0){let e=m.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#o.slice()});return this.#r.length=0,this.#i.length=0,this.#o.length=0,e}return m.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#o.length=0}#n(e){this.#r.push(e)}#s(e){this.#i.push(e)}};var J1;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(J1||={});var Q1=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(o=>this.#t=m.wrap(o))}peaks=m.None;#e={type:"idle"};#t=m.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return W.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},ub=class{#e;#t;constructor(e){this.#e=e,this.#t=b.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new Q1(t,this.#e))}remove(e){}invalidate(e){}};var cb=class r extends ar{static ClockRate=X.fromSignature(1,24*4);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let o=t.filter(i=>i.sendTransportMessages.getValue()&&i.id.getValue()!=="");if(o.length===0){this.#t.length=0;return}o.forEach(i=>{let n=i.id.getValue(),s=i.delayInMs.getValue();this.#t.forEach(a=>this.context.sendMIDIData(n,a,s)),this.#t.length=0}),e.forEach(({p0:i,p1:n,s0:s,bpm:a,flags:l})=>{let c=s/sampleRate;if(nt.every(l,1))for(let d of po.iterate(i,n,r.ClockRate)){let p=X.pulsesToSeconds(d-i,a);o.forEach(f=>{let g=f.id.getValue(),v=f.delayInMs.getValue(),x=(c+p)*1e3+v;this.context.sendMIDIData(g,ut.Clock,x)})}})}toString(){return`{${this.constructor.name}}`}};var db=class{#e;#t;#r;#i;#o=new Map;#n=[];constructor(e,t){this.#e=e,this.#t=new Uint32Array(t,0,2),this.#r=new Uint32Array(t,8),this.#i=(this.#r.length>>1)-1}send(e,t,o){let i=this.#o.get(e);if(fl(i)){if(i=this.#n.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#o.set(e,i),this.#n.push(e),this.#e.postMessage({registerDevice:e,id:i})}let n=Atomics.load(this.#t,0),s=n+1&this.#i;if(s===Atomics.load(this.#t,1))return!1;let a=t.length,l=t[0]??0,c=t[1]??0,d=t[2]??0,p=a<<30|i<<24|l<<16|c<<8|d,f=o|0,g=n<<1;return this.#r[g]=p,this.#r[g+1]=f,Atomics.store(this.#t,0,s),this.#e.postMessage(null),!0}};var aD=!1,pb=class extends AudioWorkletProcessor{#e;#t;#r;#i;#o;#n;#s;#a;#l;#u;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P=m.None;#I=m.None;#k=m.None;#D=m.None;#R=!1;#O=!0;#C=!1;#T=0;#V=0;#z=!0;#U=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:o,exportConfiguration:i,options:n}}){super();let{boxGraph:s,mandatoryBoxes:{rootBox:a,timelineBox:l}}=Ss.decode(o);this.#e=new O,this.#t=wS.for(this.port),this.#r=s,this.#i=new Lf,this.#M=new Int32Array(t),this.#o=tn.sender(this.#t.channel("engine-to-client"),p=>new class{log(f){p.dispatchAndForget(this.log,f)}error(f){p.dispatchAndForget(this.error,f)}fetchAudio(f){return p.dispatchAndReturn(this.fetchAudio,f)}fetchSoundfont(f){return p.dispatchAndReturn(this.fetchSoundfont,f)}notifyClipSequenceChanges(f){p.dispatchAndForget(this.notifyClipSequenceChanges,f)}switchMarkerState(f){p.dispatchAndForget(this.switchMarkerState,f)}ready(){p.dispatchAndForget(this.ready)}}),this.#s=new sb(this.#o),this.#a=new ub(this.#o),this.#l=b.newSet(p=>p.adapter.uuid),this.#p=new vv,this.#d=new Mf(l.bpm),this.#n=this.#e.own(new pv(this)),this.#u=this.#n.adapterFor(a,Zu),this.#c=this.#n.adapterFor(l,Do),this.#h=new Ef,this.#f=new Bf(this.#h),this.#m=new ie,this.#v=new tb,this.#$=new ib(this.#c,this.#i),this.#y=new cb(this,this.#u),this.#w=new ob,this.#x=new nb(this,n),this.#F=b.newSet(p=>p),this.#E=wl.writer(yE(),e,p=>{let{transporting:f,isCountingIn:g,isRecording:v,position:x}=this.#i,y=this.#c.box.signature.denominator.getValue();p.position=x,p.playbackTimestamp=this.#V,p.countInBeatsRemaining=g?(this.#T-x)/X.fromSignature(1,y):0,p.isPlaying=f,p.isRecording=v,p.isCountingIn=g}),this.#g=this.#e.own(rb.create(this.#t,"engine-live-data")),this.#B=new nx(this),this.#S=this.#e.own(new Ee(this.#g,xc.PEAKS)),this.#_=new hl;let c=new Float32Array(this.#_.numBins()),d=new Float32Array(this.#_.numBins());this.#e.own(this.#g.broadcastFloats(xc.SPECTRUM,c,p=>{p&&(c.set(this.#_.bins()),this.#_.decay=!0)})),this.#e.own(this.#g.broadcastFloats(xc.WAVEFORM,d,p=>{p&&d.set(this.#_.waveform())})),this.#A=this.#e.own(new lb(this.#r)),this.#e.ownAll(AS(this.#r,this.#t.channel("engine-sync")),tn.executor(this.#t.channel("engine-commands"),{play:()=>this.#j(),stop:p=>this.#L(p),setPosition:p=>this.#K(p),prepareRecordingState:p=>this.#W(p),stopRecording:()=>this.#Z(),setMetronomeEnabled:p=>this.#i.metronomeEnabled=this.#C=p,setPlaybackTimestampEnabled:p=>this.#z=p,setCountInBarsTotal:p=>this.#U=p,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(p=>p.accept({visitAudioFileBox:f=>this.#s.getOrCreate(f.address.uuid).data.nonEmpty()&&f.pointerHub.nonEmpty()})??!0)),panic:()=>this.#R=!0,noteSignal:p=>{if(Pn.isOn(p)){let{uuid:f,pitch:g,velocity:v}=p;this.optAudioUnit(f).ifSome(x=>x.midiDeviceChain.noteSequencer.pushRawNoteOn(g,v))}else if(Pn.isOff(p)){let{uuid:f,pitch:g}=p;this.optAudioUnit(f).ifSome(v=>v.midiDeviceChain.noteSequencer.pushRawNoteOff(g))}else if(Pn.isAudition(p)){let{uuid:f,pitch:g,duration:v,velocity:x}=p;this.optAudioUnit(f).ifSome(y=>y.midiDeviceChain.noteSequencer.auditionNote(g,v,x))}},ignoreNoteRegion:p=>this.#F.add(p),scheduleClipPlay:p=>{p.forEach(f=>{let g=this.#r.findBox(f);if(g.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${b.toString(f)}'`);else{let v=Wm.for(this.#n,g.unwrap());this.#A.schedulePlay(v)}}),this.#i.transporting=!0,this.#y.schedule(ut.Start)},scheduleClipStop:p=>{p.forEach(f=>{let g=this.#r.findBox(f);g.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${b.toString(f)}'`):this.#A.scheduleStop(this.#n.adapterFor(g.unwrap(),vt))})},setupMIDI:(p,f)=>{this.#D=m.wrap(new db(p,f))},terminate:()=>{this.#k.ifSome(p=>p.terminate()),this.#k=m.None,this.#O=!1,this.#F.clear(),this.#e.terminate()}}),this.#u.audioUnits.catchupAndSubscribe({onAdd:p=>{let f=b.toString(p.uuid),g=Z(i?.[f])?i[f]:J1.Default,v=new eb(this,p,g),x=this.#l.add(v);if(D(x,`Could not add ${v}`),v.adapter.isOutput){D(this.#I.isEmpty(),"Output can only assigned once."),this.#I=m.wrap(v);return}},onRemove:({uuid:p})=>this.#l.removeByKey(p).terminate(),onReorder:Jo})),this.#N=m.wrap(i).match({none:()=>C.empty(),some:p=>Object.keys(p).map(f=>this.#l.get(b.parse(f)))}),this.#o.ready(),console.log=(...p)=>this.#o.log(p.join(", "))}ignoresRegion(e){return this.#F.hasKey(e)}process(e,t){if(!this.#O)return!1;if(Atomics.load(this.#M,0)===1)return!0;try{return this.render(e,t)}catch(o){return console.debug(o),this.#O=!1,this.#o.error(o),this.terminate(),!1}}render(e,[t]){if(!this.#O)return!1;if(this.#R)return F("Manual Panic");let o=this.#i.metronomeEnabled;this.#m.notify(0),this.#P.isEmpty()&&(this.#f.update(),this.#P=m.wrap(this.#f.sorted().concat()),aD&&console.debug(`%cAudio-Graph%c
|
|
26
|
+
${this.#P.unwrap().map((n,s)=>`${s+1}: ${n}`).join(`
|
|
27
|
+
`)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let i=this.#P.unwrap();return this.#x.process(n=>{i.forEach(s=>s.process(n)),o&&this.#$.process(n)}),this.#N.length===0?(this.#I.unwrap().audioOutput().replaceInto(t),o&&this.#$.output.mixInto(t),this.#S.process(t[0],t[1]),this.#_.process(t[0],t[1],0,128)):this.#N.forEach((n,s)=>{let[a,l]=n.audioOutput().channels();t[s*2].set(a),t[s*2+1].set(l)}),this.#m.notify(1),this.#A.changes().ifSome(n=>this.#o.notifyClipSequenceChanges(n)),this.#E.tryWrite(),this.#g.flush(),!0}getAudioUnit(e){return this.#l.get(e)}optAudioUnit(e){return this.#l.opt(e)}subscribeProcessPhase(e){return this.#m.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#P=m.None,{terminate:()=>{this.#h.removeVertex(e),this.#P=m.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#P=m.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#P=m.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#n}get sampleManager(){return this.#s}get soundfontManager(){return this.#a}get rootBoxAdapter(){return this.#u}get timelineBoxAdapter(){return this.#c}get signatureDuration(){return this.timelineBoxAdapter.signatureDuration}get tempoMap(){return this.#d}get liveStreamBroadcaster(){return this.#g}get liveStreamReceiver(){return F("Only available in main thread")}get parameterFieldAdapters(){return this.#p}get clipSequencing(){return this.#A}get broadcaster(){return this.#g}get updateClock(){return this.#B}get timeInfo(){return this.#i}get mixer(){return this.#v}get engineToClient(){return this.#o}get isMainThread(){return!1}get isAudioContext(){return!0}get audioOutputBufferRegistry(){return this.#w}sendMIDIData(e,t,o){this.#D.ifSome(i=>i.send(e,t,o))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#l.forEach(e=>e.terminate()),this.#l.clear()}#j(){this.#z&&(this.#i.position=this.#V,this.#y.schedule(ut.positionInPPQN(this.#i.position))),this.#i.transporting=!0,this.#y.schedule(ut.Start)}#L(e){(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#z?this.#V:0,this.#y.schedule(ut.positionInPPQN(this.#i.position)));let t=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#C,this.#F.clear(),(e||!t)&&this.#G(),this.#y.schedule(ut.Stop)}#K(e){this.#i.isRecording||(this.#i.position=this.#V=e,this.#y.schedule(ut.positionInPPQN(this.#i.position)))}#W(e){if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&e){let t=this.#i.position,[o,i]=this.#c.signature;this.#T=Qo(t,X.fromSignature(o,i)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#T-X.fromSignature(this.#U*o,i);let n=this.#x.setCallback(this.#T,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#C,n.terminate()});this.#y.schedule(ut.positionInPPQN(this.#i.position))}else this.#i.transporting=!0,this.#i.isRecording=!0,this.#y.schedule(ut.Start)}#Z(){!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#C,this.#i.transporting=!1,this.#F.clear(),this.#y.schedule(ut.Stop))}#G(){this.#V=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#C,this.#i.position=0,this.#i.transporting=!1,this.#x.reset(),this.#A.reset(),this.#f.sorted().forEach(e=>e.reset()),this.#S.clear()}};var hb=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=xv.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",Rf);registerProcessor("engine-processor",pb);registerProcessor("recording-processor",hb);
|
|
28
28
|
//# sourceMappingURL=processors.js.map
|