@opendaw/studio-core 0.0.44 → 0.0.46

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.
Files changed (75) hide show
  1. package/dist/AudioOfflineRenderer.d.ts +1 -2
  2. package/dist/AudioOfflineRenderer.d.ts.map +1 -1
  3. package/dist/AudioOfflineRenderer.js +10 -3
  4. package/dist/EffectBox.d.ts +2 -2
  5. package/dist/EffectBox.d.ts.map +1 -1
  6. package/dist/EffectFactories.d.ts +9 -0
  7. package/dist/EffectFactories.d.ts.map +1 -1
  8. package/dist/EffectFactories.js +41 -24
  9. package/dist/EffectFactory.d.ts +1 -1
  10. package/dist/EffectFactory.d.ts.map +1 -1
  11. package/dist/EffectParameterDefaults.d.ts +5 -0
  12. package/dist/EffectParameterDefaults.d.ts.map +1 -0
  13. package/dist/EffectParameterDefaults.js +27 -0
  14. package/dist/Engine.d.ts +1 -1
  15. package/dist/Engine.d.ts.map +1 -1
  16. package/dist/EngineFacade.d.ts +1 -1
  17. package/dist/EngineFacade.d.ts.map +1 -1
  18. package/dist/EngineFacade.js +1 -1
  19. package/dist/EngineWorklet.d.ts +1 -1
  20. package/dist/EngineWorklet.d.ts.map +1 -1
  21. package/dist/EngineWorklet.js +3 -2
  22. package/dist/Preferences.d.ts +20 -0
  23. package/dist/Preferences.d.ts.map +1 -0
  24. package/dist/Preferences.js +46 -0
  25. package/dist/capture/CaptureDevices.d.ts +1 -1
  26. package/dist/capture/CaptureDevices.d.ts.map +1 -1
  27. package/dist/capture/CaptureDevices.js +22 -11
  28. package/dist/capture/CaptureMidi.js +1 -1
  29. package/dist/capture/RecordTrack.d.ts +2 -2
  30. package/dist/capture/RecordTrack.d.ts.map +1 -1
  31. package/dist/capture/Recording.d.ts +1 -1
  32. package/dist/capture/Recording.d.ts.map +1 -1
  33. package/dist/capture/Recording.js +1 -1
  34. package/dist/dawproject/BuiltinDevices.d.ts.map +1 -1
  35. package/dist/dawproject/BuiltinDevices.js +3 -2
  36. package/dist/dawproject/{DawProjectImport.d.ts → DawProjectImporter.d.ts} +1 -1
  37. package/dist/dawproject/DawProjectImporter.d.ts.map +1 -0
  38. package/dist/dawproject/{DawProjectImport.js → DawProjectImporter.js} +17 -5
  39. package/dist/dawproject/DawProjectImporter.test.d.ts +2 -0
  40. package/dist/dawproject/DawProjectImporter.test.d.ts.map +1 -0
  41. package/dist/dawproject/{DawProjectImport.test.js → DawProjectImporter.test.js} +1 -1
  42. package/dist/dawproject/DawProjectService.js +1 -1
  43. package/dist/dawproject/index.d.ts +1 -1
  44. package/dist/dawproject/index.d.ts.map +1 -1
  45. package/dist/dawproject/index.js +1 -1
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +1 -0
  49. package/dist/midi/MIDILearning.d.ts +1 -1
  50. package/dist/midi/MIDILearning.d.ts.map +1 -1
  51. package/dist/midi/MIDILearning.js +22 -3
  52. package/dist/processors.js +7 -7
  53. package/dist/processors.js.map +4 -4
  54. package/dist/project/Project.d.ts +12 -7
  55. package/dist/project/Project.d.ts.map +1 -1
  56. package/dist/project/Project.js +60 -33
  57. package/dist/project/ProjectMigration.d.ts.map +1 -1
  58. package/dist/project/ProjectMigration.js +10 -1
  59. package/dist/project/Recovery.d.ts +9 -0
  60. package/dist/project/Recovery.d.ts.map +1 -0
  61. package/dist/project/Recovery.js +49 -0
  62. package/dist/project/index.d.ts +1 -0
  63. package/dist/project/index.d.ts.map +1 -1
  64. package/dist/project/index.js +1 -0
  65. package/dist/workers-main.js +2 -2
  66. package/dist/workers-main.js.map +4 -4
  67. package/dist/ysync/YService.d.ts.map +1 -1
  68. package/dist/ysync/YService.js +19 -8
  69. package/dist/ysync/YSync.d.ts +4 -4
  70. package/dist/ysync/YSync.d.ts.map +1 -1
  71. package/dist/ysync/YSync.js +29 -26
  72. package/package.json +49 -49
  73. package/dist/dawproject/DawProjectImport.d.ts.map +0 -1
  74. package/dist/dawproject/DawProjectImport.test.d.ts +0 -2
  75. package/dist/dawproject/DawProjectImport.test.d.ts.map +0 -1
@@ -1,9 +1,9 @@
1
- var kv=Object.defineProperty;var zr=(r,e)=>{for(var t in e)kv(r,t,{get:e[t],enumerable:!0})};var An=r=>r,z=r=>r!=null,Tr=r=>r===null;var Fo=r=>r===void 0,nt=r=>r!==void 0,Bo=r=>r==null,xl=(r,e)=>r!=null?e(r):void 0,H=(r,e="asDefined failed")=>r??w(Ur(e)),fe=(r,e)=>r instanceof e,Mr=(r,e)=>r instanceof e?r:w(`${r} is not instance of ${e}`),yl=(r,e)=>{r instanceof e||w(`${r} is not instance of ${e}`)};var Ur=r=>r instanceof Function?r():r;var A=(r,...e)=>r?.apply(null,e),Yt=r=>z(r)&&typeof r=="object",bl=(r,e,t)=>{if(!(e in r))return!1;let n=r[e];return t==="null"?n===null:typeof n===t},em=(r,...e)=>{let t=r;for(let n of e){if(!Yt(t)||!(n in t))return;t=t[n]}return t},Bt=r=>{throw new Error(`Unhandled ${r}`)},w=r=>{throw typeof r=="string"?new Error(r):r},N=(r,e)=>r?void 0:w(Ur(e));var $n=r=>new Proxy({},{get(){return w(r)}});var gl=class{value;status="success";constructor(e){this.value=e}error=$n("Cannot access error when succeeded")},vl=class{error;status="failure";constructor(e){this.error=e}value=$n("Cannot access value when failed")},Vr=r=>{try{return new gl(r())}catch(e){return new vl(e)}};var tm=(r,e)=>Object.keys(e).length===0?w("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:w(`Invalid enum value: ${String(r)}`),Ot=()=>{};var rm=r=>{};var wl;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(wl||(wl={}));var P=class{static#t=Object.freeze(new Array(0));static empty=()=>this.#t;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let n=0;n<e.length;)t(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>H(e.at(0),t);static getLast=(e,t)=>H(e.at(-1),t);static getPrev=(e,t)=>{let n=e.indexOf(t);return n===-1?w(`${t} not found in ${e}`):H(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let n=e.indexOf(t);return n===-1?w(`${t} not found in ${e}`):H(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,t)=>H(e.pop(),t);static create=(e,t)=>{let n=new Array(t);for(let i=0;i<t;i++)n[i]=e(i);return n};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!t(n,e[i]))return!1;return!0};static remove=(e,t)=>{let n=e.indexOf(t);if(n===-1)return w(`${t} not found in ${e}`);e.splice(n,1)};static removeIf=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n])&&e.splice(n,1)};static removeOpt=(e,t)=>{let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let n=0,i=new Set;for(let o of e){let s=o[t];i.has(s)||(i.add(s),e[n++]=o)}return e.length=n,e};static subtract(e,t,n){return e.filter(i=>!t.some(o=>n(i,o)))}static intersect(e,t,n){return e.filter(i=>t.some(o=>n(i,o)))}static merge(e,t,n){return[...e.filter(i=>!t.some(o=>n(i,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let n=0;n<=t;n++)yield{value:e[n],isFirst:n===0,isLast:n===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,n=e[0];t<e.length;t++){let i=e[t];yield[n,i],n=i}}static isSorted(e,t=wl.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let o=e[i];if(Math.sign(n-o)===t)return!1;n=o}return!0}static toRecord(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),{})}};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,...n)=>r.wrap(t?.apply(null,n)),r.async=t=>t.then(n=>r.wrap(n),()=>r.None);class e{#t;constructor(n){this.#t=H(n)}unwrap(){return this.#t}unwrapOrElse(n){return this.#t}unwrapOrNull(){return this.#t}unwrapOrUndefined(){return this.#t}contains(n){return n===this.#t}match(n){return n.some(this.#t)}ifSome(n){return n(this.#t)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return r.wrap(n(this.#t))}mapOr(n,i){return n(this.#t)}flatMap(n){return n(this.#t)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#t})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>w(z(t)?Ur(t):"unwrap failed");unwrapOrElse=t=>Ur(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,n)=>Ur(n);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>w(Ur(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var im;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>m.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(n){return r.err(n)}};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());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=()=>{throw new Error(`No result because '${this.reason}'`)};map=()=>this;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)})(im||(im={}));var pe;(function(r){r.exact=(e,t,n)=>{let i=0,o=e.length-1;for(;i<=o;){let s=i+o>>>1,a=n(e[s],t);if(a===0)return s;a<0?i=s+1:o=s-1}return-1},r.exactMapped=(e,t,n,i)=>{let o=0,s=e.length-1;for(;o<=s;){let a=o+s>>>1,u=n(i(e[a]),t);if(u===0)return a;u<0?o=a+1:s=a-1}return-1},r.leftMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let s=i+o>>>1;n(e[s],t)<0?i=s+1:o=s}return i},r.rightMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let s=i+o>>>1;n(e[s],t)<=0?i=s+1:o=s}return o-1},r.leftMostMapped=(e,t,n,i)=>{let o=0,s=e.length;for(;o<s;){let a=o+s>>>1;n(i(e[a]),t)<0?o=a+1:s=a}return o},r.rightMostMapped=(e,t,n,i)=>{let o=0,s=e.length;for(;o<s;){let a=o+s>>>1;n(i(e[a]),t)<=0?o=a+1:s=a}return s-1},r.rangeMapped=(e,t,n,i)=>[r.leftMostMapped(e,t,n,i),r.rightMostMapped(e,t,n,i)]})(pe||(pe={}));var Fe=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#t;#e;constructor(e=32){this.#t=e,this.#e=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,n=1<<e-(t<<5);return(this.#e[t]&n)!==0}setBit(e,t){let n=e>>>5,i=1<<e-(n<<5),o=this.#e[n],s=t?o|i:o&~i;return s===o?!1:(this.#e[n]=s,!0)}isEmpty(){return this.#e.every(e=>e===0)}nonEmpty(){return this.#e.some(e=>e>0)}set buffer(e){this.#e.set(new Int32Array(e))}get buffer(){return this.#e.buffer}replace(e){let t=new Int32Array(e),n=!1;for(let i=0;i<t.length;i++)this.#e[i]!==t[i]&&(this.#e[i]=t[i],n=!0);return n}toString(){let e="";for(let t of P.iterateReverse(this.#e))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#t)}clear(){this.#e.fill(0)}};var Oo=class{#t;#e=null;constructor(e){this.#t=e}invalidate=()=>this.#e=null;get(){return this.#e===null&&(this.#e=this.#t()),this.#e}terminate(){this.invalidate()}};var Co;(function(r){r.parseCssRgbOrRgba=e=>{let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(z(t)&&t.every(n=>!isNaN(n))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)},r.hslToHex=(e,t,n)=>{let i=u=>(u+e/30)%12,o=t*Math.min(n,1-n),s=u=>n-o*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),a=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${a(s(0))}${a(s(8))}${a(s(4))}`},r.hexToHsl=e=>{let t=e.startsWith("#")?e.slice(1):e,n=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,s=Math.max(n,i,o),a=Math.min(n,i,o),u=(s+a)/2,l=0,d=0;if(s!==a){let h=s-a;switch(d=u>.5?h/(2-s-a):h/(s+a),s){case n:l=((i-o)/h+(i<o?6:0))*60;break;case i:l=((o-n)/h+2)*60;break;case o:l=((n-i)/h+4)*60;break}}return{h:l,s:d,l:u}},r.hslStringToHex=e=>{let[t,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,n/100,i/100)}})(Co||(Co={}));var Xt=(r,e)=>r-e,nm=(r,e)=>{let t=Math.min(r.length,e.length);for(let n=0;n<t;n++){let i=r[n]-e[n];if(i!==0)return i}return r.length-e.length};var ft=Math.PI*2,Y0=Math.PI/2,Al=Math.PI/4,X0=1/Math.sqrt(2),G=(r,e,t)=>Math.max(e,Math.min(r,t));var om=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Ct=(r,e)=>Math.floor(r/e)*e;var sm=(r,e,t)=>r+(e-r)*t;var En=(r,e)=>Iv(r/e)*e,Iv=r=>r-Math.floor(r),Dt=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var $l=(r,e)=>r*e/((2*e-1)*(r-1)+e);var ot;(function(r){r.valueAt=({slope:i,steps:o,y0:s,y1:a},u)=>r.normalizedAt(u/o,i)*(a-s)+s,r.normalizedAt=(i,o)=>{if(o>.499999&&o<.500001)return i;{let s=G(o,1e-15,.999999999999999);return s*s/(1-s*2)*(Math.pow((1-s)/s,2*i)-1)}},r.inverseAt=(i,o)=>{let s=G(o,1e-15,.999999999999999);return Math.log(i*(1-2*s)/(s*s)+1)/(2*Math.log((1-s)/s))},r.coefficients=i=>{let o=r.valueAt(i,1),a=(r.valueAt(i,2)-o)/(o-i.y0),u=o-a*i.y0;return{m:a,q:u}};function*t(i,o,s,a){let{m:u,q:l}=r.coefficients({slope:i,steps:o,y0:s,y1:a});for(let d=0,h=s;d<o;d++)yield h=u*h+l}r.walk=t;function*n(i,o){let s=1/o,a=r.normalizedAt(s,i),l=(r.normalizedAt(2*s,i)-a)/a;for(let d=0,h=0;d<o;d++)yield h=l*h+a}r.walkNormalized=n,r.byHalf=(i,o,s,a)=>({slope:r.slopeByHalf(o,s,a),steps:i,y0:o,y1:a}),r.slopeByHalf=(i,o,s)=>Math.abs(s-i)<1e-6?.5:(o-i)/(s-i)})(ot||(ot={}));var bt=new DataView(new ArrayBuffer(8)),je;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(bt.setInt8(0,e),bt.getInt8(0)),r.toShort=e=>(bt.setInt16(0,e),bt.getInt16(0)),r.toInt=e=>(bt.setInt32(0,e),bt.getInt32(0))})(je||(je={}));var Rt;(function(r){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),o=new Int32Array(n);r.floatToIntBits=s=>{let a=r.floatToRawIntBits(s);return(a&2139095040)===2139095040&&(a&8388607)!==0?2143289344:a},r.intBitsToFloat=s=>(o[0]=s,i[0]),r.floatToRawIntBits=s=>(i[0]=s,o[0]),r.toFloat32=s=>(bt.setFloat32(0,s),bt.getFloat32(0))})(Rt||(Rt={}));var Qt;(function(r){r.floatToIntBits=e=>{let t=Rt.floatToIntBits(e),n=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(t&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(t&2147483647)>>>23,n|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,t===0&&n>115712)return Rt.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(t!==0){n=115712;do t<<=1,n-=1024;while((t&1024)===0);t&=1023}return Rt.intBitsToFloat((e&32768)<<16|(n|t)<<13)}})(Qt||(Qt={}));var Do;(function(r){let e=9218868437227405312n,t=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),o=new BigInt64Array(n);r.float64ToLongBits=s=>{let a=r.float64ToRawLongBits(s);return(a&e)===e&&(a&t)!==0n?0x7ff8000000000000n:a},r.longBitsToFloat64=s=>(o[0]=s,i[0]),r.float64ToRawLongBits=s=>(i[0]=s,o[0]),r.clamp=s=>(bt.setFloat64(0,s),bt.getFloat64(0))})(Do||(Do={}));var ve=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let n of e)t++;return t}static some(e,t){for(let n of e)if(t(n))return!0;return!1}static every(e,t){for(let n of e)if(!t(n))return!1;return!0}static reduce(e,t,n){let i=n,o=0;for(let s of e)i=t(i,s,o++);return i}static includes(e,t){for(let n of e)if(n===t)return!0;return!1}static forEach(e,t){for(let n of e)t(n)}static*map(e,t){let n=0;for(let i of e)yield t(i,n++)}static*take(e,t){let n=0;for(let i of e){if(n++>=t)return;yield i}}static filter(e,t){let n=[];for(let i of e)t(i)&&n.push(i);return n}static filterMap(e,t){let n=[];for(let i of e){let o=t(i);z(o)&&n.push(o)}return n}static reverse(e){let t=[];for(let n of e)t.push(n);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:n,value:i}=t.next(),o=i;if(n!==!0)for(;;){let{done:s,value:a}=t.next();if(s===!0){yield[o,null];return}yield[o,a],o=a}}};var Ee=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;#t;#e=0;constructor(e){this.#t=e}get remaining(){return this.#t.byteLength-this.#e}get position(){return this.#e}set position(e){e<0?w(`position(${e}) cannot be negative.`):e>this.#t.byteLength?w(`position(${e}) is outside range (${this.#t.byteLength}).`):this.#e=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#t.setInt8(this.#e++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#t.setInt16(this.#e,e,this.littleEndian),this.#e+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#t.setInt32(this.#e,e,this.littleEndian),this.#e+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#t.setBigInt64(this.#e,e,this.littleEndian),this.#e+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#t.setFloat32(this.#e,e,this.littleEndian),this.#e+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#t.setFloat64(this.#e,e,this.littleEndian),this.#e+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let t=0;t<e.length;++t)this.#t.setInt8(this.#e++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let n=0;n<t;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#t.buffer.slice(0,this.#e)}#r(e){let t=this.#t.byteLength;if(this.#e+e>t){let n=this.#t;this.#t=new DataView(new ArrayBuffer(Dt(t+e)));for(let i=0;i<this.#e;i++)this.#t.setInt8(i,n.getInt8(i))}}},li=class{#t=0;writeByte(e){this.#t++}writeShort(e){this.#t+=2}writeInt(e){this.#t+=4}writeLong(e){this.#t+=8}writeFloat(e){this.#t+=4}writeDouble(e){this.#t+=8}writeBoolean(e){this.#t++}writeBytes(e){this.#t+=e.length}writeString(e){this.#t+=e.length+4}get count(){return this.#t}},Ro=class{#t;#e=0;constructor(e=32){this.#t=new Int8Array(e)}result(){return this.#t}equals(e){return e===this?!0:this.#t.every((t,n)=>e.#t[n]===t)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#e>=this.#t.length&&(this.#e=0),this.#t[this.#e++]^=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(Rt.floatToIntBits(e))}writeDouble(e){this.writeLong(Do.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(ve.map(this.#t.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},Pe=class{littleEndian=!1;#t;#e=0;constructor(e,t=0){this.#t=new DataView(e,t)}get position(){return this.#e}set position(e){e<0?w(`position(${e}) cannot be negative.`):e>this.#t.byteLength?w(`position(${e}) is outside range (${this.#t.byteLength}).`):this.#e=e}readByte(){return this.#t.getInt8(this.#e++)}readShort(){let e=this.#t.getInt16(this.#e,this.littleEndian);return this.#e+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#t.getInt32(this.#e,this.littleEndian);return this.#e+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#t.getBigInt64(this.#e,this.littleEndian);return this.#e+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#t.getFloat32(this.#e,this.littleEndian);return this.#e+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#t.getFloat64(this.#e,this.littleEndian);return this.#e+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#e+e<=this.#t.byteLength}remaining(){return this.#t.byteLength-this.#e}skip(e){this.position+=e}};var Fv=r=>z(r)?r.value!==void 0?"value":r.get!==void 0?"get":w(`Cannot resolve method key of ${r}`):w("Cannot resolve method key of undefined descriptor"),ci=(r,e,t)=>{if(!z(t))return function(o,s){if(s&&s.kind==="getter")return function(){let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!z(a?.get))return w(`Cannot find getter for property '${e}'`);let u=a.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=Fv(t),i=H(t[n]);return{[n]:function(...o){if(o.length>0)return w("lazy accessory must not have any construction parameters");let s=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?s:()=>s,configurable:!1,writable:!1,enumerable:!1}),s}}};var zt;(function(r){function*e(){}r.empty=e,r.next=n=>{let{value:i,done:o}=n.next();return o?null:i};function*t(...n){for(let i of n)for(let o of i)yield o}r.flatten=t})(zt||(zt={}));var di;(function(r){r[r.T=0]="T",r[r.R=1]="R",r[r.B=2]="B",r[r.L=3]="L"})(di||(di={}));var hi;(function(r){r[r.TL=0]="TL",r[r.TR=1]="TR",r[r.BR=2]="BR",r[r.BL=3]="BL"})(hi||(hi={}));var am;(function(r){r.outerTangentPoints=(e,t)=>{let n=t.x-e.x,i=t.y-e.y,o=Math.atan2(i,n)+Math.acos((e.r-t.r)/Math.sqrt(n*n+i*i)),s=Math.cos(o),a=Math.sin(o);return[{x:e.x+e.r*s,y:e.y+e.r*a},{x:t.x+t.r*s,y:t.y+t.r*a}]}})(am||(am={}));var um;(function(r){r.zero=()=>({x:0,y:0}),r.create=(e,t)=>({x:e,y:t}),r.clone=e=>({...e}),r.floor=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),r.length=e=>Math.sqrt(e.x*e.x+e.y*e.y),r.distance=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),r.add=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),r.subtract=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),r.scaleBy=(e,t)=>({x:e.x*t,y:e.y*t}),r.scaleTo=(e,t)=>{let n=t/r.length(e);return{x:e.x*n,y:e.y*n}},r.fromClient=e=>({x:e.clientX,y:e.clientY})})(um||(um={}));var Sn;(function(r){r.Empty=Object.freeze({x:0,y:0,width:0,height:0}),r.corners=e=>{let t=e.x,n=e.y,i=t+e.width,o=n+e.height;return[{x:t,y:n},{x:i,y:n},{x:i,y:o},{x:t,y:o}]},r.inflate=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),r.contains=(e,t)=>{let n=t.x>=e.x&&t.y>=e.y,i=t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height;return n&&i},r.isPointInside=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,r.intersect=(e,t)=>{let n=Math.max(e.x,t.x),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height),s=Math.max(e.y,t.y);return i>n&&o>s},r.axis=(e,t)=>{switch(t){case di.T:return e.y;case di.R:return e.x+e.width;case di.B:return e.y+e.height;case di.L:return e.x;default:return Bt(t)}},r.corner=(e,t)=>{switch(t){case hi.TL:return{x:e.x,y:e.y};case hi.TR:return{x:e.x+e.width,y:e.y};case hi.BR:return{x:e.x+e.width,y:e.y+e.height};case hi.BL:return{x:e.x,y:e.y+e.height};default:return Bt(t)}},r.center=e=>({x:e.x+e.width*.5,y:e.y+e.height*.5}),r.isEmpty=e=>e.width===0||e.height===0,r.union=(e,t)=>{if(r.isEmpty(e))r.isEmpty(t)||(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height);else if(!r.isEmpty(t)){let n=t.x,i=t.y,o=Math.min(e.x,n),s=Math.min(e.y,i);e.width=Math.max(e.x+e.width,n+t.width)-o,e.height=Math.max(e.y+e.height,i+t.height)-s,e.x=o,e.y=s}}})(Sn||(Sn={}));var lm;(function(r){r.width=e=>e.xMax-e.xMin,r.height=e=>e.yMax-e.yMin,r.from=(e,t)=>{e.xMin=t.xMin,e.xMax=t.xMax,e.yMin=t.yMin,e.yMax=t.yMax},r.extend=(e,t)=>{e.xMin-=t,e.yMin-=t,e.xMax+=t,e.yMax+=t},r.padding=(e,[t,n,i,o])=>(e.xMin+=o,e.yMin+=t,e.xMax-=n,e.yMax-=i,e),r.intersectPoint=(e,t)=>e.xMin<=t.x&&t.x<e.xMax&&e.yMin<=t.y&&t.y<e.yMax,r.intersectThat=(e,t)=>t.xMin<e.xMax&&t.xMax>e.xMin&&t.yMin<e.yMax&&t.yMax>e.yMin,r.center=e=>({x:(e.xMin+e.xMax)*.5,y:(e.yMin+e.yMax)*.5})})(lm||(lm={}));var cm;(function(r){r.Identity=Object.freeze([0,0,0,0])})(cm||(cm={}));var dm;(function(r){r.intersects=(n,i,o,s,a,u,l,d)=>{let h=e(n,i,o,s,a,u),f=e(n,i,o,s,l,d);if((h|f)===0||(h&f)!==0)return!1;let v=t(a,u,l,d,n,o);return v!==t(a,u,l,d,i,o)||v!==t(a,u,l,d,i,s)||v!==t(a,u,l,d,n,s)};let e=(n,i,o,s,a,u)=>{let l=0;return a<=n?l|=1:a>=i&&(l|=2),u<=o?l|=8:u>=s&&(l|=4),l},t=(n,i,o,s,a,u)=>(o-n)*(u-i)-(a-n)*(s-i)>=0})(dm||(dm={}));var hm;(function(r){r.Identity={valueToAxis:e=>e,axisToValue:e=>e},r.toClamped=(e,t,n)=>({valueToAxis:i=>e.valueToAxis(G(i,t,n)),axisToValue:i=>G(e.axisToValue(i),t,n)}),r.createClamped=(e,t)=>({valueToAxis:n=>G(n,e,t),axisToValue:n=>G(n,e,t)})})(hm||(hm={}));var pm;(function(r){r.fromBuffers=async(...e)=>{let t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t),i=0;for(let o of e)n.set(new Uint8Array(o),i),i+=o.byteLength;return await crypto.subtle.digest("SHA-256",n)},r.equals=(e,t)=>{N(e.byteLength===32,"First hash has invalid length"),N(t.byteLength===32,"Second hash has invalid length");let n=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<32;o++)if(n[o]!==i[o])return!1;return!0},r.toString=e=>Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")})(pm||(pm={}));var Nn;(function(r){r.intersect1D=(e,t,n,i)=>Math.max(e,n)<=Math.min(t,i)})(Nn||(Nn={}));var Ce=class{#t=new Set;#e;constructor(){this.#e=new Proxy({},{get:(e,t)=>(...n)=>this.#t.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?A(i[t],...n):i[t]?.apply(i,n))})}get proxy(){return this.#e}get size(){return this.#t.size}subscribe(e){return this.#t.add(e),{terminate:()=>this.#t.delete(e)}}forEach(e){this.#t.forEach(e)}terminate(){this.#t.clear()}};var jr=class{static createIfAbsent(e,t,n){let i=e.get(t);return i===void 0&&(i=n(t),e.set(t,i)),i}};var Pn=class r{static#t=Object.freeze(new Set);static empty=()=>r.#t};var Lr=class r{#t;#e;constructor(e,t){this.#t=new Map(e),this.#e=m.wrap(t),this.#e.ifSome(n=>Array.from(this.#t.values()).forEach(i=>i.sort(n)))}[Symbol.iterator](){return this.#t.entries()}clear(){this.#t.clear()}containsEntry(e,t){return ve.some(this.#t.entries(),n=>e===n[0]&&n[1].includes(t))}containsKey(e){return ve.includes(this.#t.keys(),e)}containsValue(e){return ve.some(this.#t.values(),t=>t.includes(e))}get(e){return this.#t.get(e)??P.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let n=jr.createIfAbsent(this.#t,e,()=>[]);if(this.#e.isEmpty())n.push(t);else{let i=pe.leftMost(n,t,this.#e.unwrap());n.splice(i,0,t)}}addAll(e,t){let n=jr.createIfAbsent(this.#t,e,()=>[]);n.push(...t),this.#e.nonEmpty()&&n.sort(this.#e.unwrap())}remove(e,t){let n=this.#t.get(e);if(n===void 0)return!1;{let i=n.indexOf(t);return i===-1?!1:(n.splice(i,1),n.length===0&&this.#t.delete(e),!0)}}removeFromKeyIf(e,t){let n=this.#t.get(e);if(n===void 0)return null;{let i=n.findIndex(t);if(i===-1)return null;{let o=n.splice(i,1)[0];return n.length===0&&this.#t.delete(e),o}}}removeValueIf(e){let t=[];for(let[n,i]of this.#t.entries())for(let o of i.filter(s=>e(s)))t.push([n,o]);for(let[n,i]of t)this.remove(n,i);return new Set(t.map(([,n])=>n))}removeKey(e){let t=this.#t.get(e);return this.#t.delete(e),t??P.empty()}forEach(e){ve.forEach(this.#t.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#t.size}keys(){return this.#t.keys()}sortKeys(e){let t=this.clone(),n=Array.from(this.keys()).sort(e);this.#t.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#t.forEach((t,n)=>{e.#t.set(n,t.map(i=>i))}),e}},zo=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let n=t[0],i=t[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return ve.some(this.map.entries(),n=>e===n[0]&&n[1].has(t))}containsKey(e){return ve.includes(this.map.keys(),e)}containsValue(e){return ve.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Pn.empty()}isEmpty(){return this.keyCount()===0}add(e,t){jr.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let n=jr.createIfAbsent(this.map,e,()=>new Set);for(let i of t)n.add(i)}remove(e,t){let n=this.map.get(e);return n===void 0?!1:n.delete(t)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[n,i]of this.map.entries()){for(let o of i)e(o)&&(i.delete(o),t.add(o));i.size===0&&this.map.delete(n)}return t}removeFromKeyIf(e,t){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(t(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Pn.empty()}forEach(e){ve.forEach(this.map.entries(),t=>e(t[0],t[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let t=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,n)=>{e.map.set(n,new Set(Array.from(t)))}),e}};var Z=Object.freeze({Empty:{terminate:Ot},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),V=class r{#t=[];isEmpty(){return this.#t.length===0}nonEmpty(){return this.#t.length>0}own(e){return this.#t.push(e),e}ownAll(...e){for(let t of e)this.#t.push(t)}spawn(){let e=new r;return e.own({terminate:()=>P.removeOpt(this.#t,e)}),this.own(e)}terminate(){for(;this.#t.length>0;)this.#t.pop().terminate()}};var W=class{static subscribeMany(e,...t){return Z.many(...t.map(n=>n.subscribe(()=>e(n))))}#t=new Set;subscribe(e){return this.#t.add(e),{terminate:()=>this.#t.delete(e)}}isEmpty(){return this.#t.size===0}notify(e){this.#t.forEach(t=>t(e))}observers(){return this.#t}terminate(){this.#t.clear()}};var wt;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,n)=>{let i=new Set(Object.keys(t));for(let o of Object.keys(n))if(i.has(o))return w(`'${o}' is an overlapping key`);return{...t,...n}},r.include=(t,...n)=>{let i={};for(let o of n)i[o]=t[o];return i},r.exclude=(t,...n)=>{let i=new Set(n);return Object.entries(t).reduce((o,[s,a])=>(i.has(s)||(o[s]=a),o),{})},r.overwrite=(t,n)=>Object.assign(t,n)})(wt||(wt={}));var mm;(function(r){r.make=e=>new class{getValue(){return e}subscribe(t){return Z.Empty}catchupAndSubscribe(t){return t(this),Z.Empty}}})(mm||(mm={}));var fm;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return Z.Empty}catchupAndSubscribe(e){return e(this),Z.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)}}})(fm||(fm={}));var pi=class{#t;#e=m.None;constructor(e){this.#t=new W,this.wrap(e)}wrap(e){this.wrapOption(m.wrap(e))}wrapOption(e){this.#e.equals(e)||(this.#e=e,this.#t.notify(this))}clear(e){this.#e.isEmpty()||(z(e)&&e(this.#e.unwrap()),this.#e=m.None,this.#t.notify(this))}assert(e){return this.#e.assert(e),this}contains(e){return this.#e.contains(e)}equals(e){return this.#e.equals(e)}flatMap(e){return this.#e.flatMap(e)}ifSome(e){return this.#e.ifSome(e)}ifAbsent(e){return this.#e.ifAbsent(e)}isEmpty(){return this.#e.isEmpty()}map(e){return this.#e.map(e)}mapOr(e,t){return this.#e.mapOr(e,t)}match(e){return this.#e.match(e)}nonEmpty(){return this.#e.nonEmpty()}unwrap(e){return this.#e.unwrap(e)}unwrapOrElse(e){return this.#e.unwrapOrElse(e)}unwrapOrNull(){return this.#e.unwrapOrNull()}unwrapOrUndefined(){return this.#e.unwrapOrUndefined()}subscribe(e){return this.#t.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#t.subscribe(()=>e(this))}terminate(){this.#t.terminate()}};var Le=class{#t;#e=m.None;#r;constructor(e,t){this.#t=new W,this.#r=t?.guard(e)??e,this.#e=m.wrap(t)}setValue(e){this.#e.nonEmpty()&&(e=this.#e.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#t.notify(this))}getValue(){return this.#r}subscribe(e){return this.#t.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#t.subscribe(e)}terminate(){this.#t.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var El=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#t)/this.#r}y(e){return this.#t+G(e,0,1)*this.#r}clamp(e){return G(e,this.#t,this.#e)}floating(){return!0}},Sl=class{#t;#e;#r;constructor(e,t){this.#t=G(Math.round(e),je.MIN_VALUE,je.MAX_VALUE),this.#e=G(Math.round(t),je.MIN_VALUE,je.MAX_VALUE),this.#r=this.#e-this.#t}x(e){return(this.clamp(e)-this.#t)/this.#r}y(e){return this.#t+Math.round(G(e,0,1)*this.#r)}clamp(e){return G(Math.round(e),this.#t,this.#e)}floating(){return!1}},Nl=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=Math.log(t/e)}x(e){return Math.log(G(e,this.#t,this.#e)/this.#t)/this.#r}y(e){return this.#t*Math.exp(G(e,0,1)*this.#r)}clamp(e){return Math.min(this.#e,Math.max(this.#t,e))}floating(){return!0}},Pl=class{#t;constructor(e){this.#t=e}x(e){let t=this.#t.findIndex(n=>n===e);return t===-1?w(`Could not find index for ${e}`):t/(this.#t.length-1)}y(e){let t=Math.round(G(e,0,1)*(this.#t.length-1));return t>-1?H(this.#t.at(t),`Could not find value for ${e}`):w(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},_l=class{#t;#e;#r;#i;#n;constructor(e,t,n){this.#t=e,this.#e=n;let i=e*e,o=n*n,s=t*t,a=e+n-2*t,u=n-t;this.#r=((2*n-t)*e-t*n)/a,this.#i=(u*i+(s-o)*e+t*o-s*n)/(i+(2*n-4*t)*e+o-4*t*n+4*s),this.#n=-u/a}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#e:this.#r-this.#i/(e+this.#n)}x(e){return this.#t>=e?0:this.#e<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#e,e)}floating(){return!0}},O;(function(r){r.linear=(o,s)=>new El(o,s),r.linearInteger=(o,s)=>new Sl(o,s),r.exponential=(o,s)=>new Nl(o,s),r.values=o=>new Pl(o),r.decibel=(o,s,a)=>new _l(o,s,a);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),n=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>n,r.DefaultDecibel=i})(O||(O={}));var B;(function(r){r.percent=({bipolar:o,fractionDigits:s}={})=>new e("%",s,!1,o),r.numeric=({unit:o,fractionDigits:s,unitPrefix:a,bipolar:u}={})=>new e(o,s,a,u),r.indices=(o,s)=>new class{x(a){return{unit:o,value:s[a]}}y(a){let u=s.indexOf(a);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},r.values=(o,s,a)=>new class{x(u){return{unit:o,value:a.at(s.indexOf(u))??"N/A"}}y(u){let l=a.indexOf(u);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:s[l]}}},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:String(o),unit:""}}};class e{#t;#e;#r;#i;constructor(s,a,u,l){this.#t=s??"",this.#e=a??0,this.#r=u??!1,this.#i=l??!1}y(s){let a=s.trim(),u=parseFloat(a);if(isNaN(u))return{type:"unknown",value:a};if(this.#t==="%")return{type:"explicit",value:u/100};if(a.endsWith("%"))return{type:"unitValue",value:this.#i?G(u/200+.5,0,1):G(u/100,0,1)};{a.endsWith(this.#t)&&this.#t.length>0&&(a=a.slice(0,-this.#t.length));let h=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(z(h)){let f=t.indexOf(h);if(f>-1)return{type:"explicit",value:u*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:u}}}x(s){if(Number.isNaN(s))return{value:"\u{1F4A3}",unit:this.#t};if(Number.isFinite(s)){if(this.#t==="%")return this.#i?{value:(s*200-100).toFixed(this.#e),unit:this.#t}:{value:(s*100).toFixed(this.#e),unit:this.#t};if(this.#r){let{value:a,prefix:u}=i(s);return{value:a.toFixed(this.#e),unit:`${u}${this.#t}`}}else return{value:s.toFixed(this.#e),unit:this.#t}}else return{value:s===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#t}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=o=>Math.log(o)/Math.log(9.999999999999998),i=o=>{let s=Math.floor(n(o)/3),a=t[s+4];return z(a)?{value:o*Math.pow(10,s*-3),prefix:a}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(B||(B={}));var To;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(To||(To={}));var gm;(function(r){r.Empty=Object.freeze(e=>{}),r.split=(e,t)=>{let n=new Float32Array(t);return P.create(i=>o=>{n[i]=o,e(n.reduce((s,a)=>s+a,0)/t)},t)},r.splitWithWeights=(e,t)=>{let n=t.length,i=new Float32Array(n);if(t.length===0)return w("Weights must not be empty");if(t.some(a=>a<=0))return w("Weights must be greater than zero");let o=t.reduce((a,u)=>a+u,0),s=o>0?t.map(a=>a/o):P.create(()=>1/n,n);return P.create(a=>u=>{i[a]=u,e(i.reduce((l,d,h)=>l+d*s[h],0))},n)}})(gm||(gm={}));var Mo;(function(r){r.create=(e=252854082)=>new kl(e),r.monotoneAscending=(e,t=128,n=r.create())=>{let i=e.length;if(i<2)return w("Array must have at least 2 elements");let o=0;for(let a=1;a<i;a++){let u=Math.floor(n.uniform()*(1+t))+1;e[a]=u,o+=u}let s=0;e[0]=0;for(let a=1;a<i;a++)s+=e[a],e[a]=s/o;return e}})(Mo||(Mo={}));var kl=class{#t=0;constructor(e){this.setSeed(e)}setSeed(e){this.#t=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.#t+=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 Ke;(function(r){class e{}r.createBuilder=n=>{let i=o=>{let s=o instanceof Array?[]:{};return Object.entries(o).forEach(([a,u])=>{u instanceof e?s[a]=u.initialValue():typeof u=="object"&&(s[a]=i(u))}),s};return()=>new t(n,Object.seal(i(n)))},r.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},r.floats=n=>new class extends e{read(i,o){for(let s=0;s<o.length;s++)o[s]=i.readFloat();return o}write(i,o){for(let s=0;s<o.length;s++)i.writeFloat(o[s])}initialValue(){return new Float32Array(n)}},r.doubles=n=>new class extends e{read(i,o){for(let s=0;s<o.length;s++)o[s]=i.readDouble();return o}write(i,o){for(let s=0;s<o.length;s++)i.writeDouble(o[s])}initialValue(){return new Float64Array(n)}};class t{#t;#e;#r;constructor(i,o){this.#t=i,this.#e=o,this.#r=this.#i()}get object(){return this.#e}get bytesTotal(){return this.#r}read(i){let o=(s,a)=>{Object.entries(s).forEach(([u,l])=>{let d=a;l instanceof e?d[u]=l.read(i,d[u]):typeof l=="object"&&o(l,d[u])})};o(this.#t,this.#e)}write(i){let o=(s,a)=>{Object.entries(s).forEach(([u,l])=>{let d=a;l instanceof e?l.write(i,d[u]):typeof l=="object"&&o(l,d[u])})};o(this.#t,this.#e)}#i(){let i=new li;return this.write(i),i.count}}})(Ke||(Ke={}));var er=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=[]}add(e,t=!1){let n=this.#t(e),i=pe.leftMostMapped(this.#r,n,this.#e,this.#t),o=this.#r[i];return z(o)&&this.#e(this.#t(o),n)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let n=pe.leftMostMapped(this.#r,e,this.#e,this.#t),i=this.#r[n];if(z(i)&&this.#e(this.#t(i),e)===0)return i;let o=t(e);return this.#r.splice(n,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,n)=>{let i=this.#e(this.#t(t),this.#t(n));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,o)=>this.#e(this.#t(i),this.#t(o))),!1}return w(t)}}removeByValue(e){return this.removeByKey(this.#t(e))}removeByKey(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return z(n)&&this.#e(this.#t(n),e)===0?(this.#r.splice(t,1),n):w(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return z(n)&&this.#e(this.#t(n),e)===0?(this.#r.splice(t,1),n):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),t++);return t}get(e){return H(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let n=this.#i(e);if(z(n))return n;throw t()}opt(e){return m.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return z(this.#i(e))}hasValue(e){return z(this.#i(this.#t(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.#t(e),e])}clear(){P.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return z(n)&&this.#e(this.#t(n),e)===0?n:void 0}};var vm;(function(r){r.hyphenToCamelCase=e=>e.replace(/-([a-z])/g,t=>t[1].toUpperCase()),r.fallback=(e,t)=>z(e)&&e.length>0?e:t,r.endsWithDigit=e=>/\d$/.test(e),r.nonEmpty=(e,t)=>z(e)&&e.trim().length>0?e:t,r.toArrayBuffer=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t},r.getUniqueName=(e,t)=>{let n=new Set(e),i=t,o=1;if(n.has(t)||n.has(`${t} 1`))o=2;else return t;for(;n.has(i=`${t} ${o++}`););return i}})(vm||(vm={}));var xm=(()=>{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:Ot}),some:t=>t.progress(e)}),install:e=>{N(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var ym;(function(r){let e=new W;r.subscribe=t=>e.subscribe(t),r.dispatch=t=>e.notify(t)})(ym||(ym={}));var tr=class r{static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#t);static minutes=e=>new r(e*r.#e);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#i);static#t=1e3;static#e=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/r.#t}absMinutes(){return Math.abs(this.#n)/r.#e}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,t,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),o=Math.floor(i/60),s=Math.floor(o/24);return n<60?(e=n,t="second"):i<60?(e=i,t="minute"):o<24?(e=o,t="hour"):(e=s,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:n,s:i}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):t>0?[r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):n>0?[r.#o("m",n),r.#o("s",i)].join(", "):i>0?r.#o("s",i):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return Bt(e)}}};var mi;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,n,i)=>{if(t.bytesTotal+1>n.byteLength)return w("Insufficient memory allocated.");let o=new Uint8Array(n),s=Ee.use(n,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),s.position=0,t.write(s),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,n)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(i),s=new Pe(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(s.position=0,t.read(s),n(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(mi||(mi={}));var E;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let n=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",n?new Uint8Array(t.slice(0)):t).then(i=>e(new Uint8Array(i.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:w(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let n=new Uint8Array(r.length);return t.readBytes(new Int8Array(n.buffer)),n},r.toDataOutput=(t,n)=>t.writeBytes(new Int8Array(n.buffer)),r.toString=t=>{let n=P.create(i=>(i+256).toString(16).substring(1),256);return n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]},r.parse=t=>{let n=t.replace(/-/g,"").toLowerCase();if(n.length!==32)return w("Invalid UUID format");let i=new Uint8Array(r.length);for(let o=0,s=0;o<32;o+=2,s++)i[s]=parseInt(n.slice(o,o+2),16);return i},r.Comparator=(t,n)=>{if(t.length!==r.length||n.length!==r.length)return w("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let o=t[i]-n[i];if(o!==0)return o}return 0},r.equals=(t,n)=>r.Comparator(t,n)===0,r.newSet=t=>new er(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let n=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)n[o]=i[o];return n},r.zType=t=>t.string().refine(n=>r.validateString(n),{message:"Invalid UUID format"}).transform(n=>n);let e=t=>(N(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(E||(E={}));var bm;(function(r){r.create=o=>z(o)?z(o?.snap)?r.snap(o?.trackLength,o?.snap?.snapLength,Array.isArray(o?.snap?.threshold)?o?.snap.threshold:[o?.snap?.threshold]):r.identity(o?.trackLength):r.identity(),r.snap=(o=e,s=t,a)=>new i(o,s/o,a),r.identity=(o=e)=>new n(o);let e=128,t=24;class n{length;#t=NaN;#e=NaN;#r=1;constructor(s){this.length=s}begin(s){this.#e=this.#t=s}moveBy(s){N(!isNaN(this.#e),()=>"value has never been set"),this.#t+=s/this.length*this.#r,this.#e=G(this.#t,0,1)}ratio(s){this.#r=s}value(){return N(!isNaN(this.#e),()=>"value has never been set"),this.#e}disable(){}enable(){}}class i{#t;#e;#r;#i;#n=NaN;#o=NaN;#s=1;#a=!0;constructor(s,a,u){N(a>0,()=>`margin(${a}) must be greater then 0`),N(P.isSorted(u),()=>"thresholds are not sorted"),N(a<s,()=>`margin(${a}) must be lower then length(${s})`),this.#t=s,this.#e=a,this.#r=u,this.#i=u.map((l,d)=>l+d*this.#e)}begin(s){this.#a&&(this.#n=this.valueToX(s)),this.#o=s}moveBy(s){N(!isNaN(this.#o),()=>"value has never been set"),this.#n+=s/this.#t*this.#s,this.#o=this.#a?this.xToValue(this.#n):G(this.#n,0,1)}ratio(s){this.#s=s}value(){return N(!isNaN(this.#o),()=>"value has never been set"),this.#o}disable(){this.#a&&(this.#a=!1,this.#n=this.xToValue(this.#n))}enable(){this.#a||(this.#a=!0,this.#n=this.valueToX(this.#n))}valueToX(s){let a=pe.rightMost(this.#r,s,Xt);if(a<0)return s;{let u=this.#i[a],l=this.#r[a];return s===l?u+this.#e/2:u+this.#e+(s-l)}}xToValue(s){let a=G(s,0,1+this.#e*this.#r.length),u=pe.rightMost(this.#i,a,Xt);if(u<0)return a;{let l=this.#i[u],d=this.#r[u];return a>l+this.#e?a-(l+this.#e)+d:d}}get margin(){return this.#e}}})(bm||(bm={}));var Uo;(function(r){class e extends Error{}r.Warning=e,r.warn=n=>{throw new e(n)};class t extends Error{constructor(i){super(`${i} not found`)}}r.FileNotFound=t,r.AbortError=typeof DOMException>"u"?{name:"AbortError",message:""}:Object.freeze(new DOMException("AbortError")),r.isAbort=n=>n===r.AbortError||r.isDOMException(n)&&n.name==="AbortError",r.CatchAbort=n=>n===r.AbortError?void 0:w(n),r.isOverconstrained=n=>Yt(n)&&"constraint"in n,r.isDOMException=n=>Yt(n)&&bl(n,"name","string")&&bl(n,"message","string")})(Uo||(Uo={}));var Vo=Symbol.for("@openDAW/lib-std");globalThis[Vo]?console.debug(`%c${Vo.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Vo]=!0,console.debug(`%c${Vo.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var rr=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){if(e=G(e,0,1),e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){t=Math.pow(10,t/20);let n=ft*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=(1-o)/2,a=s,u=2*s,l=s,d=1+i,h=-2*o,f=1-i;this.setNormalizedCoefficients(a,u,l,d,h,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t){if(e=G(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){t=Math.pow(10,t/20);let n=ft*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=(1+o)/2,a=s,u=-2*s,l=s,d=1+i,h=-2*o,f=1-i;this.setNormalizedCoefficients(a,u,l,d,h,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,n,i,o,s){let a=1/i;return this.b0=e*a,this.b1=t*a,this.b2=n*a,this.a1=o*a,this.a2=s*a,this}setLowShelfParams(e,t){e=G(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=ft*e,s=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),a=Math.cos(i),u=2*Math.sqrt(n)*s,l=n+1,d=n-1,h=n*(l-d*a+u),f=2*n*(d-l*a),v=n*(l-d*a-u),g=l+d*a+u,y=-2*(d+l*a),b=l+d*a-u;this.setNormalizedCoefficients(h,f,v,g,y,b)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=G(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=ft*e,s=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),a=Math.cos(i),u=2*Math.sqrt(n)*s,l=n+1,d=n-1,h=n*(l+d*a+u),f=-2*n*(d+l*a),v=n*(l+d*a-u),g=l-d*a+u,y=2*(d-l*a),b=l-d*a-u;this.setNormalizedCoefficients(h,f,v,g,y,b)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,t,n){e=G(e,0,1),t=Math.max(0,t);let i=Math.pow(10,n/40);if(e>0&&e<1)if(t>0){let o=ft*e,s=Math.sin(o)/(2*t),a=Math.cos(o),u=1+s*i,l=-2*a,d=1-s*i,h=1+s/i,f=-2*a,v=1-s/i;this.setNormalizedCoefficients(u,l,d,h,f,v)}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=G(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=ft*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=1-i,a=-2*o,u=1+i,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}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=G(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=ft*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=1,a=-2*o,u=1,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let n=ft*e;if(t>0){let i=Math.sin(n)/(2*t),o=Math.cos(n),s=i,a=0,u=-i,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,n){N(e.length===t.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,o=this.b1,s=this.b2,a=this.a1,u=this.a2;for(let l=0;l<e.length;++l){let d=-Math.PI*2*e[l],h=Math.cos(d),f=Math.sin(d),v=i+((o+s*h)*h-s*f*f),g=(o+s*h)*f+s*f*h,y=1+((a+u*h)*h-u*f*f),b=(a+u*h)*f+u*f*h,C=y*y+b*b,U=(v*y+g*b)/C,j=(g*y-v*b)/C;t[l]=Math.sqrt(U*U+j*j),n[l]=Math.atan2(j,U)}}};var Be=class{#t=0;#e=0;#r=0;#i=0;reset(){this.#t=0,this.#e=0,this.#r=0,this.#i=0}process({a1:e,a2:t,b0:n,b1:i,b2:o},s,a,u,l){let d=this.#t,h=this.#e,f=this.#r,v=this.#i;for(let g=u;g<l;g++){let y=s[g],b=a[g]=n*y+i*d+o*h-e*f-t*v+1e-18-1e-18;h=d,d=y,v=f,f=b}this.#t=d,this.#e=h,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:n,b1:i,b2:o},s){let a=n*s+i*this.#t+o*this.#e-e*this.#r-t*this.#i+1e-18-1e-18;return this.#e=this.#t,this.#t=s,this.#i=this.#r,this.#r=a,a}},Kr=class{#t;order;constructor(e){this.#t=P.create(()=>new Be,e),this.order=this.#t.length}reset(){this.#t.forEach(e=>e.reset())}process(e,t,n,i,o){for(let s=0;s<this.order;s++)this.#t[s].process(e,t,n,i,o),t=n}processFrame(e,t){for(let n=0;n<this.order;n++)t=this.#t[n].processFrame(e,t);return t}};var wm;(function(r){function e(t,n,i={}){let{interval:o=64,scanSteps:s=1024,scanSamples:a=2048,minBPM:u=90,maxBPM:l=180}=i,d=new Float32Array(Math.floor(t.length/o)),h=0,f=0,v=0;for(let q of t){let ae=Math.abs(q);h+=(ae-h)*(ae>h?1/8:1/512),++f===o&&(f=0,d[v++]=h)}if(!d.length)return NaN;let g=(q,ae)=>q[Math.floor(ae)]??0,y=q=>n/(q/60)/o,b=q=>n/(q*o)*60,C=[-32,-16,-8,-4,-2,-1,1,2,4,8,16,32],U=[-.5,-.25,.25,.5],j=q=>{let ae=Math.random()*d.length,le=g(d,ae),it=0,pt=0;for(let ze of C){let mt=1/Math.abs(ze);it+=mt*Math.abs(g(d,ae+ze*q)-le),pt+=mt}for(let ze of U){let mt=Math.abs(ze);it-=mt*Math.abs(g(d,ae+ze*q)-le),pt+=mt}return it/pt},L=q=>{let ae=0;for(let le=0;le<a;++le)ae+=j(q);return ae/a},ee=y(u),be=y(l),we=(ee-be)/s,J=u,ue=1/0;for(let q=be;q<=ee;q+=we){let ae=b(q),le=L(q)*(u/ae);le<ue&&(ue=le,J=ae)}return J}r.detect=e})(wm||(wm={}));var Am;(function(r){r.Major=[0,2,4,5,7,9,11],r.Minor=[0,2,3,5,7,8,10],r.NoteLabels=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r.compile=(e,t,n,i)=>P.create(o=>{let s=n+o*2,a=e[s%7]+Math.floor(s/7)*12;return t+a},i),r.toString=e=>r.NoteLabels[e%12]+(Math.floor(e/12)-2)})(Am||(Am={}));var Zr;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Zr||(Zr={}));var qr;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(qr||(qr={}));var We;(function(r){r.globalToLocal=(t,n)=>En(n-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:n,loopOffset:i,loopDuration:o},s,a)=>{let u=t-i,l=u+o;if(u>=a||l<=s)return m.None;let d=Math.max(u,s),h=Math.min(l,a);return m.wrap({index:0,rawStart:u,rawEnd:l,regionStart:Math.max(u,t),regionEnd:Math.min(l,n),resultStart:d,resultEnd:h,resultStartValue:u<d?(d-u)/o:0,resultEndValue:l>h?(h-u)/o:1})};function*e({position:t,complete:n,loopOffset:i,loopDuration:o},s,a){let u=t-i,l=Math.max(t,s),d=Math.min(n,a),h=Math.floor((l-u)/o),f=u+h*o;for(;f<d;){let v=f+o,g=Math.max(f,t),y=Math.min(v,n),b=Math.max(f,l),C=Math.min(v,d),U=f<b?(b-f)/o:0,j=v>C?(C-f)/o:1;yield{index:h++,rawStart:f,rawEnd:v,regionStart:g,regionEnd:y,resultStart:b,resultEnd:C,resultStartValue:U,resultEndValue:j},f=v}}r.locateLoops=e})(We||(We={}));var ir=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#t;constructor(e){this.#t=new jo(e)}add(e){this.#t.add(e)}remove(e){return this.#t.remove(e)}contains(e){return this.#t.contains(e)}clear(){this.#t.clear()}optAt(e){return this.#t.optAt(e)}asArray(){return this.#t.asArray()}lowerEqual(e,t){return this.#t.lowerEqual(e,t)}greaterEqual(e,t){return this.#t.greaterEqual(e,t)}floorLastIndex(e){return this.#t.floorLastIndex(e)}ceilFirstIndex(e){return this.#t.ceilFirstIndex(e)}iterateFrom(e,t){return this.#t.isEmpty()?zt.empty():this.#t.iterateFrom(e,t)}iterateRange(e,t,n){return this.#t.isEmpty()?zt.empty():this.#t.iterate(this.#t.ceilFirstIndex(e),t,n)}length(){return this.#t.length()}isEmpty(){return this.#t.isEmpty()}onIndexingChanged(){this.#t.onIndexingChanged()}},nr=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#t;constructor(e=r.Comparator){this.#t=new jo(e)}add(e){this.#t.add(e)}remove(e){return this.#t.remove(e)}contains(e){return this.#t.contains(e)}clear(){this.#t.clear()}optAt(e){return this.#t.optAt(e)}asArray(){return this.#t.asArray()}lowerEqual(e,t){return this.#t.lowerEqual(e,t)}greaterEqual(e,t){return this.#t.greaterEqual(e,t)}floorLastIndex(e){return this.#t.floorLastIndex(e)}ceilFirstIndex(e){return this.#t.ceilFirstIndex(e)}iterateFrom(e,t){return this.#t.isEmpty()?zt.empty():this.#t.iterateFrom(e,t)}iterateRange(e,t){if(this.#t.isEmpty())return zt.empty();let n=Math.max(0,this.#t.floorLastIndex(e)),i=this.#t.optAt(n);if(i===null)return zt.empty();for(;i.position+i.duration<=e;)if(i=this.#t.optAt(++n),i===null||i.position>=t)return zt.empty();return this.#t.iterate(n,t)}length(){return this.#t.length()}isEmpty(){return this.#t.isEmpty()}onIndexingChanged(){this.#t.onIndexingChanged()}},fi=class{#t;constructor(){this.#t=[]}addAndRetain(e){if(this.#t.length===0)this.#t.push(e);else{let t=pe.leftMost(this.#t,e,qr.DescendingComparator);this.#t.splice(t,0,e)}}*overlapping(e,t){let n=this.#t.filter(i=>i.position<=e&&e<i.position+i.duration);yield*z(t)?n.sort(t):n}*releaseLinearCompleted(e){if(this.#t.length!==0)for(let t=this.#t.length-1;t>=0;t--){let n=this.#t[t];if(qr.complete(n)<e)this.#t.splice(t,1),yield n;else return}}*releaseAll(){if(this.#t.length!==0)for(let e=this.#t.length-1;e>=0;e--){let t=this.#t[e];Number.POSITIVE_INFINITY>t.duration&&(this.#t.splice(e,1),yield t)}}isEmpty(){return this.#t.length===0}nonEmpty(){return this.#t.length>0}clear(){P.clear(this.#t)}},jo=class{comparator;#t=[];#e=!1;modCount=0;constructor(e){this.comparator=e}add(e){++this.modCount,this.#t.push(e),this.#t.length>1&&(this.#e=!0)}remove(e){++this.modCount;let t=this.#t.indexOf(e);return t===-1?!1:(this.#t.splice(t,1),!0)}contains(e){if(this.#t.length===0)return!1;this.#e&&this.#r();let n=e.position,i=pe.leftMostMapped(this.#t,n,Xt,Zr.PositionExtractor);for(let o=i;o<this.#t.length;o++){let s=this.#t[o];if(s===e)return!0;if(s.position!==n)return!1}return!1}clear(){++this.modCount,P.clear(this.#t),this.#e=!1}optAt(e){return e<0||e>=this.#t.length?null:(this.#e&&this.#r(),this.#t[e])}asArray(){return this.#e&&this.#r(),this.#t}lowerEqual(e,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#t[n--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#t.length;){let i=this.#t[n++];if(t(i))return i}return null}floorLastIndex(e){return this.#e&&this.#r(),pe.rightMostMapped(this.#t,e,Xt,Zr.PositionExtractor)}ceilFirstIndex(e){return this.#e&&this.#r(),pe.leftMostMapped(this.#t,e,Xt,Zr.PositionExtractor)}iterateFrom(e,t){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,je.MAX_VALUE,t);for(;i>=0;){let o=this.optAt(i);if(o!==null&&t!==void 0&&t(o))return this.iterate(i,je.MAX_VALUE,t);i--}return this.iterate(n,je.MAX_VALUE,t)}length(){return this.#t.length}isEmpty(){return this.#t.length===0}onIndexingChanged(){this.#e=this.length()>1}*iterate(e,t,n=To.alwaysTrue){for(this.#e&&this.#r();e<this.#t.length;){let i=this.#t[e++];if(i.position>=t)return;n(i)&&(yield i)}}#r(){this.#t.sort(this.comparator),this.#e=!1}};var Lo=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}#t;#e;#r;#i;constructor(e){this.#t=e;let t=e/2;this.#e=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let n=0;n<t;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,t){let n,i,o,s;for(let l=0;l<this.#t;++l)i=r.reverse(l)>>>this.#e,i>l&&(s=e[l],e[l]=e[i],e[i]=s,s=t[l],t[l]=t[i],t[i]=s);let a=this.#r,u=this.#i;for(let l=2;l<=this.#t;l<<=1){let d=l>>1,h=this.#t/l;for(n=0;n<this.#t;n+=l){let f=n+d;for(i=n,o=0;i<f;i++,o=o+h|0){let v=i+d|0,g=a[o],y=u[o],b=e[v],C=t[v],U=b*g+C*y,j=C*g-b*y,L=e[i],ee=t[i];e[v]=L-U,t[v]=ee-j,e[i]=L+U,t[i]=ee+j}}if(l===this.#t)break}}};var Il=(r,e)=>Math.floor(3840/e)*r,$m=(r,e=4,t=4)=>{let n=Il(1,t),i=Math.floor(r/n),o=Math.floor(i/e),a=(Math.floor(r)-Il(o*e,t))%n,u=Math.floor(a/240),l=a%240;return{bars:o,beats:i-o*e,semiquavers:u,ticks:l}},Em=(r,e)=>r*e/60*960,Sm=(r,e)=>r*60/960/e,Bv=(r,e,t)=>Em(r/t,e),Ov=(r,e,t)=>Sm(r,e)*t,te={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Il,toParts:$m,secondsToPulses:Em,pulsesToSeconds:Sm,samplesToPulses:Bv,pulsesToSamples:Ov,toString:(r,e=4,t=4)=>{let{bars:n,beats:i,semiquavers:o,ticks:s}=$m(r|0,e,t);return`${n+1}.${i+1}.${o+1}:${s}`}};var gt;(function(r){r.builder=()=>new e,r.toDouble=([t,n])=>t/n,r.toPPQN=([t,n])=>te.fromSignature(t,n);class e{#t=[];add(n){return this.#t.push(n),this}asArray(){return this.#t}asAscendingArray(){return this.#t.toSorted((n,i)=>r.toDouble(n)-r.toDouble(i))}asDescendingArray(){return this.#t.toSorted((n,i)=>r.toDouble(i)-r.toDouble(n))}}})(gt||(gt={}));var or=class{static*iterate(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield o,o=++i*n}static*iterateWithIndex(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield{position:o,index:i},o=++i*n}};var Ko=class{#t;#e;constructor(){this.#t=[],this.#e=new Map}addVertex(e){N(!this.#t.includes(e),"Vertex already exists"),this.#t.push(e),N(!this.#e.has(e),"Predecessor already exists"),this.#e.set(e,[])}removeVertex(e){P.remove(this.#t,e);let t=this.#e.delete(e);N(t,"Predecessor does not exists")}getPredecessors(e){return this.#e.get(e)??P.empty()}predecessors(){return this.#e}vertices(){return this.#t}addEdge([e,t]){let n=H(this.#e.get(t),`[add] Edge has unannounced vertex. (${t})`);N(!n.includes(e),`${e} is already marked.`),n.push(e)}removeEdge([e,t]){let n=H(this.#e.get(t),`[remove] Edge has unannounced vertex. (${t})`);N(n.includes(e),`${e} is not marked.`),P.remove(n,e)}isEmpty(){return this.#t.length===0}},Zo=class{#t;#e;#r;#i;#n;constructor(e){this.#t=e,this.#e=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#t.vertices().forEach(e=>this.#s(e))}sorted(){return this.#e}hasLoops(){return this.#i.size!==0}#o(){this.#a();let e=new Map;for(let n of this.#t.vertices())this.#n.set(n,new Set),e.set(n,new Set);for(let n of this.#t.vertices())for(let i of this.#t.getPredecessors(n))H(this.#n.get(i),`Could not find Successor for ${i}`).add(n);let t;do{t=!1;for(let n of this.#t.vertices()){H(e.get(n)).clear();for(let i of H(this.#n.get(n)))for(let o of H(this.#n.get(i)))this.#n.get(n)?.has(o)||(t=!0,H(e.get(n)).add(o))}for(let n of this.#t.vertices()){let i=H(this.#n.get(n));H(e.get(n)).forEach(o=>i.add(o))}}while(t)}#s(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#t.getPredecessors(e)){if(H(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#s(t)}this.#e.push(e)}}#a(){P.clear(this.#e),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var _n;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(_n||(_n={}));var qo=class{#t;constructor(e){this.#t=e}warp(e){return this.#e(!0,e)}unwarp(e){return this.#e(!1,e)}#e(e,t){let n=this.#t.duration(),i=Ct(t,n),o=(t-i)/n,s=e?this.#t.fx(o):this.#t.fy(o);return i+s*n}};var Nm;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,n)=>t|=1<<n,0),r.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`;class e{#t;#e;constructor(n,...i){this.#t=n,this.#e=i.reduce((o,s)=>o|=1<<s,0)}get name(){return this.#t}get bits(){return this.#e}has(n){return(this.#e&1<<n%12)!==0}equals(n){return this.#e===n.bits}}r.StockScales=[new e("Major",0,2,4,5,7,9,11),new e("Natural Minor",0,2,3,5,7,8,10),new e("Harmonic Minor",0,2,3,5,7,8,11),new e("Melodic Minor",0,2,3,5,7,9,11),new e("Dorian",0,2,3,5,7,9,10),new e("Phrygian",0,1,3,5,7,8,10),new e("Lydian",0,2,4,6,7,9,11),new e("Mixolydian",0,2,4,5,7,9,10),new e("Locrian",0,1,3,5,6,8,10),new e("Pentatonic Major",0,2,4,7,9),new e("Pentatonic Minor",0,3,5,7,10),new e("Blues",0,3,5,6,7,10),new e("Whole Tone",0,2,4,6,8,10),new e("Diminished",0,2,3,5,6,8,9,11),new e("Augmented",0,3,4,7,8,11)]})(Nm||(Nm={}));var Ze;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.pitch-t.pitch;return i!==0?i:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let n=qr.complete(e)-qr.complete(t);return n!==0?n:e.pitch-t.pitch}})(Ze||(Ze={}));var Tt;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.sawtooth=2]="sawtooth",r[r.square=3]="square"})(Tt||(Tt={}));var Ho=class{#t=0;#e=0;generate(e,t,n,i,o){for(let s=i;s<o;s++){let a=this.#t%1,u=0;switch(n){case Tt.sine:u=Math.sin(2*Math.PI*a);break;case Tt.sawtooth:u=2*a-1,u-=this.#r(a,t);break;case Tt.square:u=a<.5?1:-1,u+=this.#r(a,t),u-=this.#r((a+.5)%1,t);break;case Tt.triangle:let l=a<.5?1:-1;l+=this.#r(a,t),l-=this.#r((a+.5)%1,t),this.#e+=l*(4*t),u=this.#e;break}e[s]=u,this.#t+=t}}#r(e,t){return e<t?(e/=t,e+e-e*e-1):e>1-t?(e=(e-1)/t,e*e+e+e+1):0}};var Mt;(function(r){let e;(function(t){t[t.Linear=0]="Linear",t[t.EqualPower=1]="EqualPower"})(e=r.Mixing||(r.Mixing={})),r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(t,{gain:n,panning:i,invertL:o,invertR:s,stereo:a,swap:u},l=e.EqualPower)=>{let[d,h]=r.panningToGains(i,l),f=d*n,v=h*n;o&&(f*=-1),s&&(v*=-1);let g=Math.max(0,-a),y=Math.max(0,a),b=1-y,C=1+y,U=g*.5,j=1-g,L=(b+C)*.5,ee=(b-C)*.5,be=(b-C)*.5,we=(b+C)*.5,J=f*(U+j)*L+v*U*ee,ue=f*(U+j)*be+v*U*we,q=f*U*L+v*(U+j)*ee,ae=f*U*be+v*(U+j)*we;u?(t.ll=ue,t.rl=J,t.lr=ae,t.rr=q):(t.ll=J,t.lr=q,t.rl=ue,t.rr=ae)},r.panningToGains=(t,n)=>{let i=G(t,-1,1);switch(n){case e.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case e.EqualPower:return[Math.cos((i+1)*Al),Math.sin((i+1)*Al)]}},r.applyFrame=(t,n,i)=>[t.ll*n+t.rl*i,t.lr*n+t.rr*i],r.processFrames=(t,n,i,o,s)=>{let[a,u]=n,[l,d]=i;for(let h=o;h<s;h++){let f=a[h],v=u[h];l[h]=t.ll*f+t.rl*v,d[h]=t.lr*f+t.rr*v}},r.replaceFrames=(t,[n,i],o,s)=>{for(let a=o;a<s;a++){let u=n[a],l=i[a];n[a]=t.ll*u+t.rl*l,i[a]=t.lr*u+t.rr*l}}})(Mt||(Mt={}));var vt;(function(r){r.linear=(n,i=.005)=>new e(Math.ceil(n*i)|0),r.stereoMatrix=(n,i=.005)=>new t(Math.ceil(n*i)|0);class e{#t;#e=0;#r=0;#i=0;#n=0;constructor(i){this.#t=i}set(i,o){this.#e!==i&&(o===!0?(this.#r=i,this.#i=(i-this.#e)/this.#t,this.#n=this.#t):(this.#e=this.#r=i,this.#i=0,this.#n=0))}get(){return this.#e}moveAndGet(){return 0<this.#n&&(this.#e+=this.#i,--this.#n===0&&(this.#i=0,this.#e=this.#r)),this.#e}isFixed(i){return this.#e===i&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#t;#e=Mt.zero();#r=Mt.zero();#i=Mt.zero();#n=0;constructor(i){this.#t=i}update(i,o,s){Mt.update(this.#r,i,o),s===!0?(this.#i.ll=(this.#r.ll-this.#e.ll)/this.#t,this.#i.lr=(this.#r.lr-this.#e.lr)/this.#t,this.#i.rl=(this.#r.rl-this.#e.rl)/this.#t,this.#i.rr=(this.#r.rr-this.#e.rr)/this.#t,this.#n=this.#t):(this.#e.ll=this.#r.ll,this.#e.lr=this.#r.lr,this.#e.rl=this.#r.rl,this.#e.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(i,o,s,a){let[u,l]=i,[d,h]=o;if(this.isInterpolating())for(let f=s;f<a;f++){let v=u[f],g=l[f],y=this.moveAndGet();d[f]=y.ll*v+y.rl*g,h[f]=y.lr*v+y.rr*g}else{let f=this.#r;for(let v=s;v<a;v++){let g=u[v],y=l[v];d[v]=f.ll*g+f.rl*y,h[v]=f.lr*g+f.rr*y}}}set(i,o){this.#o(i)||(o===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#e.ll)/this.#t,this.#i.lr=(i.lr-this.#e.lr)/this.#t,this.#i.rl=(i.rl-this.#e.rl)/this.#t,this.#i.rr=(i.rr-this.#e.rr)/this.#t,this.#n=this.#t):(this.#e.ll=this.#r.ll=i.ll,this.#e.lr=this.#r.lr=i.lr,this.#e.rl=this.#r.rl=i.rl,this.#e.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#e}moveAndGet(){return 0<this.#n&&(this.#e.ll+=this.#i.ll,this.#e.lr+=this.#i.lr,this.#e.rl+=this.#i.rl,this.#e.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#e.ll=this.#r.ll,this.#e.lr=this.#r.lr,this.#e.rl=this.#r.rl,this.#e.rr=this.#r.rr)),this.#e}isFixed(i){return this.#o(i)&&this.#n===0}isInterpolating(){return this.#n>0}#o(i){return this.#e.ll===i.ll&&this.#e.lr===i.lr&&this.#e.rl===i.rl&&this.#e.rr===i.rr}}r.StereoMatrixRamp=t})(vt||(vt={}));var gi=class{#t;#e;#r;#i;constructor(e){this.#t=new Float32Array(e),this.#e=1/e,this.#r=0,this.#i=0}pushPop(e){let t=e*e;return this.#i-=this.#t[this.#r],this.#i+=t,this.#t[this.#r]=t,++this.#r===this.#t.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#e)}clear(){this.#t.fill(0),this.#i=0,this.#r=0}};var Cv=Math.log(10)/20,kn=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var De=r=>Math.exp(r*Cv);var vi=r=>De(20*Math.log10(r));var sr={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},Go;(function(r){r.Comparator=(i,o)=>{let s=i.position-o.position;if(s!==0)return s;let a=i.index-o.index;return a!==0?a:i===o?0:w(`${i} and ${o} are identical in terms of comparison`)};function*e(i,o,s){if(i.isEmpty())return ve.empty();for(let a of i.iterateFrom(o))if(yield a,a.position>=s)return}r.iterateWindow=e,r.nextEvent=(i,o)=>{let s=i.asArray(),a=pe.rightMost(s,o,r.Comparator);return a===-1?null:s[a+1]??null},r.valueAt=(i,o,s)=>{if(i.isEmpty())return s;let a=i.iterateFrom(o),{done:u,value:l}=a.next();if(u)return s;if(l.position<=o){let{done:d,value:h}=a.next();if(d)return l.value;if(o<h.position)return n(l,h,o);if(l.interpolation===sr.None)return l.value}return l.value};function*t(i,o,s,a){if(i.isEmpty())return;let u=i.iterateFrom(o),{done:l,value:d}=u.next();if(l)return;let h=s/a,f=d;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=h,o>s)return;f.position<=s&&(yield f)}for(;o<=s;){let{done:v,value:g}=u.next();if(v)break;for(;o<g.position;){if(o>s)return;yield{position:o,value:n(f,g,o)},o+=h}g.position<s&&(f.interpolation===sr.None&&(yield{position:g.position,value:f.value}),yield g),f=g}for(;o<=s;)yield{position:o,value:f.value},o+=h}r.quantise=t;let n=({value:i,position:o,interpolation:s},a,u)=>s.type==="none"?i:s.type==="linear"?i+(u-o)/(a.position-o)*(a.value-i):s.type==="curve"?ot.valueAt({slope:s.slope,steps:a.position-o,y0:i,y1:a.value},u-o):w("Unknown interpolation")})(Go||(Go={}));var In;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,n)=>{let i=new Float32Array(n),o=Math.PI/(n-1);switch(t){case e.Bartlett:{let s=(n>>1)-1,a=0;for(;a<=s;++a)i[a]=2*a/(n-1);for(;a<n;++a)i[a]=2-2*a/(n-1);return i}case e.Blackman:{let s=2*o,a=4*o;for(let u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(s*u)+.07922*Math.cos(a*u);return i}case e.BlackmanHarris:{let s=2*o,a=4*o,u=6*o;for(let l=0;l<n;++l)i[l]=.35875-.48829*Math.cos(s*l)+.14128*Math.cos(a*l)-.01168*Math.cos(u*l);return i}case e.Hamming:{let s=2*o;for(let a=0;a<n;++a)i[a]=.54-.46*Math.cos(s*a);return i}case e.Hanning:{let s=2*o;for(let a=0;a<n;++a)i[a]=.5-.5*Math.cos(s*a);return i}}}})(In||(In={}));var Wo=Symbol.for("@openDAW/lib-dsp");globalThis[Wo]?console.debug(`%c${Wo.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Wo]=!0,console.debug(`%c${Wo.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Jo=class extends AudioWorkletProcessor{#t;#e;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:n,valueDecay:i}}){super(),this.#t=t,this.#e=new Float32Array(t),this.#r=new Float32Array(t),this.#i=P.create(()=>new gi(sampleRate*n),t);let o=Ke.createBuilder({peak:Ke.floats(t),rms:Ke.floats(t)})();this.#n=mi.writer(o,e,s=>{let a=Math.exp(-(128*this.#o)/(sampleRate*i));for(let u=0;u<t;++u){let l=this.#e[u],d=this.#r[u];s.peak[u]=l,s.rms[u]=Math.sqrt(d),this.#e[u]=l*a,this.#r[u]=d*a}this.#o=0})}process([e]){for(let t=0;t<this.#t;++t){let n=e[t];if(n===void 0)this.#e[t]=0,this.#r[t]=0;else{let i=this.#i[t],o=this.#e[t],s=this.#r[t];for(let a=0;a<128;++a){let u=n[a];o=Math.max(o,Math.abs(u)),s=Math.max(s,i.pushPop(u*u))}this.#e[t]=o,this.#r[t]=s}}return this.#o++,this.#n.tryWrite(),!0}};var X=class r{static newSet(e){return new er(e,r.Comparator)}static compose=(e,...t)=>{let n=t.length===0?this.#t:new Int16Array(t);return N(n.every((i,o)=>i===t[o]),`fieldKeys (${n.join(",")}) only allows i16`),new r(e,n)};static decode(e){let t=e.split("/");return N(t.length>0,"Unable to parse Address"),r.compose(E.parse(t[0]),...t.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,n){let i=e.values(),o=pe.leftMostMapped(i,t,E.Comparator,n),s=i.length;if(o<0||o>=s)return null;for(let a=o;a<s;a++)if(E.Comparator(n(i[a]),t)!==0)return o<a?[o,a]:null;return[o,s]}static Comparator=(e,t)=>{let n=E.Comparator(e.#e,t.#e);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let s=e.#r[o]-t.#r[o];if(s!==0)return s}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let n=E.Comparator(e.#e,t.#e);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let s=e.#r[o]-t.#r[o];if(s!==0)return s}return 0};static LengthComparator=(e,t)=>{let n=E.Comparator(e.#e,t.#e);return n!==0?n:t.#r.length-e.#r.length};static#t=new Int16Array(0);#e;#r;constructor(e,t){this.#e=e,this.#r=t}get uuid(){return this.#e}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.#e,new Int16Array([...this.#r,e]))}startsWith(e){return E.Comparator(e.#e,this.#e)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,n)=>this.#r[n]===t)}write(e){e.writeBytes(new Int8Array(this.#e.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(e,this.#r)}decompose(){return[this.#e,this.#r]}toJSON(){return{uuid:Array.from(this.#e.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(E.length+this.#r.length);return e.set(this.#e,0),e.set(this.#r,E.length),e.buffer}toString(){return[E.toString(this.#e),...this.#r].join("/")}static read(e){let t=E.fromDataInput(e),n=e.readByte();return r.compose(t,...P.create(()=>e.readShort(),n))}},Hr;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>X.Comparator(e,t),r.equals=(e,t)=>{let[n,i]=pe.rangeMapped(t,e,X.Comparator,r.AddressReader);return t.slice(n,i+1)},r.startsWith=(e,t)=>{let[n,i]=pe.rangeMapped(t,e,X.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let n=pe.leftMostMapped(t,e,X.LengthComparator,r.AddressReader),i=pe.rightMostMapped(t,e,X.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>e.startsWith(o.address))}})(Hr||(Hr={}));var At=class r{static validate(e,t){if(e.address.equals(t.address))return m.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(n=>n===e.pointerType)){let n=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return m.None}#t;#e;constructor(e){this.#t=e,this.#e=new Ce}subscribe(e,...t){return this.#r(this.#e,e,t)}catchupAndSubscribe(e,...t){let n=X.newSet(i=>i.address);return n.addMany(this.filter(...t)),n.forEach(i=>e.onAdd(i)),this.subscribe({onAdd:i=>{n.add(i)&&e.onAdd(i)},onRemove:i=>{n.removeByKey(i.address),e.onRemove(i)}},...t)}filter(...e){return e.length===0?this.incoming():ve.filter(this.incoming().values(),t=>e.some(n=>n===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#t.graph.edges().incomingEdgesOf(this.#t)}onAdded(e){let t=r.validate(e,this.#t);if(t.nonEmpty())return w(t.unwrap());this.#e.proxy.onAdd(e)}onRemoved(e){this.#e.proxy.onRemove(e)}toString(){return`{Pointers ${this.#t.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,t,n){return e.subscribe({onAdd:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onAdd(i)},onRemove:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onRemove(i)}})}};var Fl=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},xi=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)}#t;#e;#r;#i;constructor({parent:e,fieldKey:t,fieldName:n,pointerRules:i}){this.#t=e,this.#e=t,this.#r=n,this.#i=i,i.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return A(e.visitField,this)}get box(){return this.#t.box}get graph(){return this.#t.graph}get parent(){return this.#t}get fieldKey(){return this.#e}get fieldName(){return this.#r}get pointerRules(){return this.#i}get pointerHub(){return new At(this)}get address(){return this.#t.address.append(this.#e)}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 P.empty()}record(){return wt.empty()}getField(e){return w()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return w("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()}`}};Fl([ci,xi("design:type",At),xi("design:paramtypes",[])],K.prototype,"pointerHub",null);Fl([ci,xi("design:type",X),xi("design:paramtypes",[])],K.prototype,"address",null);Fl([ci,xi("design:type",String),xi("design:paramtypes",[])],K.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,accepts:[]});var yi=class r extends K{static create(e,t,n){return new r(e,t,n)}#t;constructor(e,t,n){super(e),this.#t=P.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p}),n)}accept(e){return A(e.visitArrayField,this)}fields(){return this.#t}record(){return P.toRecord(this.#t,e=>String(e.fieldKey))}getField(e){return H(this.#t[e])}optField(e){return m.wrap(this.#t[e])}read(e){this.#t.forEach(t=>t.read(e))}write(e){this.#t.forEach(t=>t.write(e))}size(){return this.#t.length}toJSON(){return Object.values(this.#t).map(e=>e.toJSON()??null)}fromJSON(e){if(Array.isArray(e))e.forEach((t,n)=>this.#t[n].fromJSON(t));else return w("Type mismatch")}};var ar;(function(r){r.writeFields=(t,n)=>{let i=Object.entries(n);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([o,s])=>{let a=Ee.create();s.write(a);let u=new Int8Array(a.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(u.length),t.writeBytes(u)})},r.readFields=(t,n)=>{N(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let o=0;o<i;o++){let s=t.readShort();if(Fo(n[s]))continue;let a=t.readInt(),u=new Int8Array(a);t.readBytes(u);let{status:l,error:d}=Vr(()=>n[s]?.read(new Pe(u.buffer)));l==="failure"&&console.warn(n,d)}}})(ar||(ar={}));var Dv=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Pm=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},k=class r{static DEBUG_DELETION=!1;static Index=0;#t;#e;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:n,pointerRules:i}){this.#t=X.compose(e),this.#e=t,this.#r=n,this.#i=i,this.#n=this.initializeFields(),i.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return H(this.#n[e])}optField(e){return m.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.#e}get parent(){return this}get address(){return this.#t}get pointerRules(){return this.#i}get creationIndex(){return this.#o}get pointerHub(){return new At(this)}estimateMemory(){let e=new li;return this.write(e),e.count}isBox(){return!0}asBox(e){return Mr(this,e)}isField(){return!1}isAttached(){return this.#e.findBox(this.address.uuid).nonEmpty()}read(e){ar.readFields(e,this.#n)}write(e){ar.writeFields(e,this.#n)}serialize(){let e=Ee.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=Ee.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,n])=>{let i=n.toJSON();return z(i)&&(e[t]=i),e},{})}fromJSON(e){if(Yt(e))Object.entries(e).forEach(([t,n])=>{let i=this.#n[parseInt(t)];z(n)&&i.fromJSON(n)});else return w("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return P.empty();let n=this.getField(t[0]),i=[e(n)];for(let o=1;o<t.length;o++)n=n.getField(t[o]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return m.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return m.None;for(let n=1;n<e.length;n++)if(t=t.unwrap().optField(e[n]),t.isEmpty())return m.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(n=>n.toString()).join(`
1
+ var sx=Object.defineProperty;var Mr=(r,e)=>{for(var t in e)sx(r,t,{get:e[t],enumerable:!0})};var Pn=r=>r,O=r=>r!=null,Tr=r=>r===null;var zo=r=>r===void 0,li=r=>r!==void 0,Mo=r=>r==null,Tl=(r,e)=>r!=null?e(r):void 0,q=(r,e="asDefined failed")=>r??A(Ur(e)),Ee=(r,e)=>r instanceof e,st=(r,e)=>r instanceof e?r:A(`${r} is not instance of ${e}`),Ul=(r,e)=>{r instanceof e||A(`${r} is not instance of ${e}`)};var Ur=r=>r instanceof Function?r():r;var w=(r,...e)=>r?.apply(null,e),Qt=r=>O(r)&&typeof r=="object",Vl=(r,e,t)=>{if(!(e in r))return!1;let n=r[e];return t==="null"?n===null:typeof n===t},Sm=(r,...e)=>{let t=r;for(let n of e){if(!Qt(t)||!(n in t))return;t=t[n]}return t},Dt=r=>{throw new Error(`Unhandled ${r}`)},A=r=>{throw typeof r=="string"?new Error(r):r},N=(r,e)=>r?void 0:A(Ur(e));var kn=r=>new Proxy({},{get(){return A(r)}});var zl=class{value;status="success";constructor(e){this.value=e}error=kn("Cannot access error when succeeded")},Ml=class{error;status="failure";constructor(e){this.error=e}value=kn("Cannot access value when failed")},Vr=r=>{try{return new zl(r())}catch(e){return new Ml(e)}};var Nm=(r,e)=>Object.keys(e).length===0?A("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:A(`Invalid enum value: ${String(r)}`),Ct=()=>{};var Pm=r=>{};var jl;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(jl||(jl={}));var F=class{static#t=Object.freeze(new Array(0));static empty=()=>this.#t;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let n=0;n<e.length;)t(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>q(e.at(0),t);static getLast=(e,t)=>q(e.at(-1),t);static getPrev=(e,t)=>{let n=e.indexOf(t);return n===-1?A(`${t} not found in ${e}`):q(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let n=e.indexOf(t);return n===-1?A(`${t} not found in ${e}`):q(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,t)=>q(e.pop(),t);static create=(e,t)=>{let n=new Array(t);for(let i=0;i<t;i++)n[i]=e(i);return n};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!t(n,e[i]))return!1;return!0};static remove=(e,t)=>{let n=e.indexOf(t);if(n===-1)return A(`${t} not found in ${e}`);e.splice(n,1)};static removeIf=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n])&&e.splice(n,1)};static removeOpt=(e,t)=>{let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let n=0,i=new Set;for(let o of e){let s=o[t];i.has(s)||(i.add(s),e[n++]=o)}return e.length=n,e};static subtract(e,t,n){return e.filter(i=>!t.some(o=>n(i,o)))}static intersect(e,t,n){return e.filter(i=>t.some(o=>n(i,o)))}static merge(e,t,n){return[...e.filter(i=>!t.some(o=>n(i,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let n=0;n<=t;n++)yield{value:e[n],isFirst:n===0,isLast:n===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,n=e[0];t<e.length;t++){let i=e[t];yield[n,i],n=i}}static isSorted(e,t=jl.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let o=e[i];if(Math.sign(n-o)===t)return!1;n=o}return!0}static toRecord(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),{})}};var m;(function(r){r.wrap=t=>O(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,...n)=>r.wrap(t?.apply(null,n)),r.async=t=>t.then(n=>r.wrap(n),()=>r.None);class e{#t;constructor(n){this.#t=q(n)}unwrap(){return this.#t}unwrapOrElse(n){return this.#t}unwrapOrNull(){return this.#t}unwrapOrUndefined(){return this.#t}contains(n){return n===this.#t}match(n){return n.some(this.#t)}ifSome(n){return n(this.#t)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return r.wrap(n(this.#t))}mapOr(n,i){return n(this.#t)}flatMap(n){return n(this.#t)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#t})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>A(O(t)?Ur(t):"unwrap failed");unwrapOrElse=t=>Ur(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,n)=>Ur(n);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>A(Ur(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var km;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>m.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(n){return r.err(n)}};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());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=()=>{throw new Error(`No result because '${this.reason}'`)};map=()=>this;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)})(km||(km={}));var pe;(function(r){r.exact=(e,t,n)=>{let i=0,o=e.length-1;for(;i<=o;){let s=i+o>>>1,a=n(e[s],t);if(a===0)return s;a<0?i=s+1:o=s-1}return-1},r.exactMapped=(e,t,n,i)=>{let o=0,s=e.length-1;for(;o<=s;){let a=o+s>>>1,u=n(i(e[a]),t);if(u===0)return a;u<0?o=a+1:s=a-1}return-1},r.leftMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let s=i+o>>>1;n(e[s],t)<0?i=s+1:o=s}return i},r.rightMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let s=i+o>>>1;n(e[s],t)<=0?i=s+1:o=s}return o-1},r.leftMostMapped=(e,t,n,i)=>{let o=0,s=e.length;for(;o<s;){let a=o+s>>>1;n(i(e[a]),t)<0?o=a+1:s=a}return o},r.rightMostMapped=(e,t,n,i)=>{let o=0,s=e.length;for(;o<s;){let a=o+s>>>1;n(i(e[a]),t)<=0?o=a+1:s=a}return s-1},r.rangeMapped=(e,t,n,i)=>[r.leftMostMapped(e,t,n,i),r.rightMostMapped(e,t,n,i)]})(pe||(pe={}));var Ce=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#t;#e;constructor(e=32){this.#t=e,this.#e=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,n=1<<e-(t<<5);return(this.#e[t]&n)!==0}setBit(e,t){let n=e>>>5,i=1<<e-(n<<5),o=this.#e[n],s=t?o|i:o&~i;return s===o?!1:(this.#e[n]=s,!0)}isEmpty(){return this.#e.every(e=>e===0)}nonEmpty(){return this.#e.some(e=>e>0)}set buffer(e){this.#e.set(new Int32Array(e))}get buffer(){return this.#e.buffer}replace(e){let t=new Int32Array(e),n=!1;for(let i=0;i<t.length;i++)this.#e[i]!==t[i]&&(this.#e[i]=t[i],n=!0);return n}toString(){let e="";for(let t of F.iterateReverse(this.#e))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#t)}clear(){this.#e.fill(0)}};var To=class{#t;#e=null;constructor(e){this.#t=e}invalidate=()=>this.#e=null;get(){return this.#e===null&&(this.#e=this.#t()),this.#e}terminate(){this.invalidate()}};var Uo;(function(r){r.parseCssRgbOrRgba=e=>{let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(O(t)&&t.every(n=>!isNaN(n))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)},r.hslToHex=(e,t,n)=>{let i=u=>(u+e/30)%12,o=t*Math.min(n,1-n),s=u=>n-o*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),a=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${a(s(0))}${a(s(8))}${a(s(4))}`},r.hexToHsl=e=>{let t=e.startsWith("#")?e.slice(1):e,n=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,s=Math.max(n,i,o),a=Math.min(n,i,o),u=(s+a)/2,l=0,d=0;if(s!==a){let h=s-a;switch(d=u>.5?h/(2-s-a):h/(s+a),s){case n:l=((i-o)/h+(i<o?6:0))*60;break;case i:l=((o-n)/h+2)*60;break;case o:l=((n-i)/h+4)*60;break}}return{h:l,s:d,l:u}},r.hslStringToHex=e=>{let[t,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,n/100,i/100)}})(Uo||(Uo={}));var Xt=(r,e)=>r-e,_m=(r,e)=>{let t=Math.min(r.length,e.length);for(let n=0;n<t;n++){let i=r[n]-e[n];if(i!==0)return i}return r.length-e.length};var gt=Math.PI*2,Pw=Math.PI/2,Ll=Math.PI/4,kw=1/Math.sqrt(2),G=(r,e,t)=>Math.max(e,Math.min(r,t)),Vo=r=>Math.max(0,Math.min(r,1)),Fm=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Rt=(r,e)=>Math.floor(r/e)*e;var Im=(r,e,t)=>r+(e-r)*t;var _n=(r,e)=>ax(r/e)*e,ax=r=>r-Math.floor(r),Ot=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Kl=(r,e)=>r*e/((2*e-1)*(r-1)+e);var at;(function(r){r.valueAt=({slope:i,steps:o,y0:s,y1:a},u)=>r.normalizedAt(u/o,i)*(a-s)+s,r.normalizedAt=(i,o)=>{if(o>.499999&&o<.500001)return i;{let s=G(o,1e-15,.999999999999999);return s*s/(1-s*2)*(Math.pow((1-s)/s,2*i)-1)}},r.inverseAt=(i,o)=>{let s=G(o,1e-15,.999999999999999);return Math.log(i*(1-2*s)/(s*s)+1)/(2*Math.log((1-s)/s))},r.coefficients=i=>{let o=r.valueAt(i,1),a=(r.valueAt(i,2)-o)/(o-i.y0),u=o-a*i.y0;return{m:a,q:u}};function*t(i,o,s,a){let{m:u,q:l}=r.coefficients({slope:i,steps:o,y0:s,y1:a});for(let d=0,h=s;d<o;d++)yield h=u*h+l}r.walk=t;function*n(i,o){let s=1/o,a=r.normalizedAt(s,i),l=(r.normalizedAt(2*s,i)-a)/a;for(let d=0,h=0;d<o;d++)yield h=l*h+a}r.walkNormalized=n,r.byHalf=(i,o,s,a)=>({slope:r.slopeByHalf(o,s,a),steps:i,y0:o,y1:a}),r.slopeByHalf=(i,o,s)=>Math.abs(s-i)<1e-6?.5:(o-i)/(s-i)})(at||(at={}));var bt=new DataView(new ArrayBuffer(8)),Ke;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(bt.setInt8(0,e),bt.getInt8(0)),r.toShort=e=>(bt.setInt16(0,e),bt.getInt16(0)),r.toInt=e=>(bt.setInt32(0,e),bt.getInt32(0))})(Ke||(Ke={}));var zt;(function(r){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),o=new Int32Array(n);r.floatToIntBits=s=>{let a=r.floatToRawIntBits(s);return(a&2139095040)===2139095040&&(a&8388607)!==0?2143289344:a},r.intBitsToFloat=s=>(o[0]=s,i[0]),r.floatToRawIntBits=s=>(i[0]=s,o[0]),r.toFloat32=s=>(bt.setFloat32(0,s),bt.getFloat32(0))})(zt||(zt={}));var er;(function(r){r.floatToIntBits=e=>{let t=zt.floatToIntBits(e),n=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(t&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(t&2147483647)>>>23,n|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,t===0&&n>115712)return zt.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(t!==0){n=115712;do t<<=1,n-=1024;while((t&1024)===0);t&=1023}return zt.intBitsToFloat((e&32768)<<16|(n|t)<<13)}})(er||(er={}));var jo;(function(r){let e=9218868437227405312n,t=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),o=new BigInt64Array(n);r.float64ToLongBits=s=>{let a=r.float64ToRawLongBits(s);return(a&e)===e&&(a&t)!==0n?0x7ff8000000000000n:a},r.longBitsToFloat64=s=>(o[0]=s,i[0]),r.float64ToRawLongBits=s=>(i[0]=s,o[0]),r.clamp=s=>(bt.setFloat64(0,s),bt.getFloat64(0))})(jo||(jo={}));var xe=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let n of e)t++;return t}static some(e,t){for(let n of e)if(t(n))return!0;return!1}static every(e,t){for(let n of e)if(!t(n))return!1;return!0}static reduce(e,t,n){let i=n,o=0;for(let s of e)i=t(i,s,o++);return i}static includes(e,t){for(let n of e)if(n===t)return!0;return!1}static forEach(e,t){for(let n of e)t(n)}static*map(e,t){let n=0;for(let i of e)yield t(i,n++)}static*take(e,t){let n=0;for(let i of e){if(n++>=t)return;yield i}}static filter(e,t){let n=[];for(let i of e)t(i)&&n.push(i);return n}static filterMap(e,t){let n=[];for(let i of e){let o=t(i);O(o)&&n.push(o)}return n}static reverse(e){let t=[];for(let n of e)t.push(n);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:n,value:i}=t.next(),o=i;if(n!==!0)for(;;){let{done:s,value:a}=t.next();if(s===!0){yield[o,null];return}yield[o,a],o=a}}};var Se=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;#t;#e=0;constructor(e){this.#t=e}get remaining(){return this.#t.byteLength-this.#e}get position(){return this.#e}set position(e){e<0?A(`position(${e}) cannot be negative.`):e>this.#t.byteLength?A(`position(${e}) is outside range (${this.#t.byteLength}).`):this.#e=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#t.setInt8(this.#e++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#t.setInt16(this.#e,e,this.littleEndian),this.#e+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#t.setInt32(this.#e,e,this.littleEndian),this.#e+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#t.setBigInt64(this.#e,e,this.littleEndian),this.#e+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#t.setFloat32(this.#e,e,this.littleEndian),this.#e+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#t.setFloat64(this.#e,e,this.littleEndian),this.#e+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let t=0;t<e.length;++t)this.#t.setInt8(this.#e++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let n=0;n<t;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#t.buffer.slice(0,this.#e)}#r(e){let t=this.#t.byteLength;if(this.#e+e>t){let n=this.#t;this.#t=new DataView(new ArrayBuffer(Ot(t+e)));for(let i=0;i<this.#e;i++)this.#t.setInt8(i,n.getInt8(i))}}},ci=class{#t=0;writeByte(e){this.#t++}writeShort(e){this.#t+=2}writeInt(e){this.#t+=4}writeLong(e){this.#t+=8}writeFloat(e){this.#t+=4}writeDouble(e){this.#t+=8}writeBoolean(e){this.#t++}writeBytes(e){this.#t+=e.length}writeString(e){this.#t+=e.length+4}get count(){return this.#t}},Lo=class{#t;#e=0;constructor(e=32){this.#t=new Int8Array(e)}result(){return this.#t}equals(e){return e===this?!0:this.#t.every((t,n)=>e.#t[n]===t)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#e>=this.#t.length&&(this.#e=0),this.#t[this.#e++]^=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(zt.floatToIntBits(e))}writeDouble(e){this.writeLong(jo.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.#t.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},_e=class{littleEndian=!1;#t;#e=0;constructor(e,t=0){this.#t=new DataView(e,t)}get position(){return this.#e}set position(e){e<0?A(`position(${e}) cannot be negative.`):e>this.#t.byteLength?A(`position(${e}) is outside range (${this.#t.byteLength}).`):this.#e=e}readByte(){return this.#t.getInt8(this.#e++)}readShort(){let e=this.#t.getInt16(this.#e,this.littleEndian);return this.#e+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#t.getInt32(this.#e,this.littleEndian);return this.#e+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#t.getBigInt64(this.#e,this.littleEndian);return this.#e+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#t.getFloat32(this.#e,this.littleEndian);return this.#e+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#t.getFloat64(this.#e,this.littleEndian);return this.#e+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#e+e<=this.#t.byteLength}remaining(){return this.#t.byteLength-this.#e}skip(e){this.position+=e}};var ux=r=>O(r)?r.value!==void 0?"value":r.get!==void 0?"get":A(`Cannot resolve method key of ${r}`):A("Cannot resolve method key of undefined descriptor"),di=(r,e,t)=>{if(!O(t))return function(o,s){if(s&&s.kind==="getter")return function(){let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!O(a?.get))return A(`Cannot find getter for property '${e}'`);let u=a.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=ux(t),i=q(t[n]);return{[n]:function(...o){if(o.length>0)return A("lazy accessory must not have any construction parameters");let s=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?s:()=>s,configurable:!1,writable:!1,enumerable:!1}),s}}};var Bm;(function(r){r.Transient=Object.freeze({modify:(e,t)=>m.wrap(e()),mark:()=>{}})})(Bm||(Bm={}));var Mt;(function(r){function*e(){}r.empty=e,r.next=n=>{let{value:i,done:o}=n.next();return o?null:i};function*t(...n){for(let i of n)for(let o of i)yield o}r.flatten=t})(Mt||(Mt={}));var hi;(function(r){r[r.T=0]="T",r[r.R=1]="R",r[r.B=2]="B",r[r.L=3]="L"})(hi||(hi={}));var pi;(function(r){r[r.TL=0]="TL",r[r.TR=1]="TR",r[r.BR=2]="BR",r[r.BL=3]="BL"})(pi||(pi={}));var Dm;(function(r){r.outerTangentPoints=(e,t)=>{let n=t.x-e.x,i=t.y-e.y,o=Math.atan2(i,n)+Math.acos((e.r-t.r)/Math.sqrt(n*n+i*i)),s=Math.cos(o),a=Math.sin(o);return[{x:e.x+e.r*s,y:e.y+e.r*a},{x:t.x+t.r*s,y:t.y+t.r*a}]}})(Dm||(Dm={}));var Cm;(function(r){r.zero=()=>({x:0,y:0}),r.create=(e,t)=>({x:e,y:t}),r.clone=e=>({...e}),r.floor=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),r.length=e=>Math.sqrt(e.x*e.x+e.y*e.y),r.distance=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),r.add=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),r.subtract=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),r.scaleBy=(e,t)=>({x:e.x*t,y:e.y*t}),r.scaleTo=(e,t)=>{let n=t/r.length(e);return{x:e.x*n,y:e.y*n}},r.fromClient=e=>({x:e.clientX,y:e.clientY})})(Cm||(Cm={}));var Fn;(function(r){r.Empty=Object.freeze({x:0,y:0,width:0,height:0}),r.corners=e=>{let t=e.x,n=e.y,i=t+e.width,o=n+e.height;return[{x:t,y:n},{x:i,y:n},{x:i,y:o},{x:t,y:o}]},r.inflate=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),r.contains=(e,t)=>{let n=t.x>=e.x&&t.y>=e.y,i=t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height;return n&&i},r.isPointInside=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,r.intersect=(e,t)=>{let n=Math.max(e.x,t.x),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height),s=Math.max(e.y,t.y);return i>n&&o>s},r.axis=(e,t)=>{switch(t){case hi.T:return e.y;case hi.R:return e.x+e.width;case hi.B:return e.y+e.height;case hi.L:return e.x;default:return Dt(t)}},r.corner=(e,t)=>{switch(t){case pi.TL:return{x:e.x,y:e.y};case pi.TR:return{x:e.x+e.width,y:e.y};case pi.BR:return{x:e.x+e.width,y:e.y+e.height};case pi.BL:return{x:e.x,y:e.y+e.height};default:return Dt(t)}},r.center=e=>({x:e.x+e.width*.5,y:e.y+e.height*.5}),r.isEmpty=e=>e.width===0||e.height===0,r.union=(e,t)=>{if(r.isEmpty(e))r.isEmpty(t)||(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height);else if(!r.isEmpty(t)){let n=t.x,i=t.y,o=Math.min(e.x,n),s=Math.min(e.y,i);e.width=Math.max(e.x+e.width,n+t.width)-o,e.height=Math.max(e.y+e.height,i+t.height)-s,e.x=o,e.y=s}}})(Fn||(Fn={}));var Rm;(function(r){r.width=e=>e.xMax-e.xMin,r.height=e=>e.yMax-e.yMin,r.from=(e,t)=>{e.xMin=t.xMin,e.xMax=t.xMax,e.yMin=t.yMin,e.yMax=t.yMax},r.extend=(e,t)=>{e.xMin-=t,e.yMin-=t,e.xMax+=t,e.yMax+=t},r.padding=(e,[t,n,i,o])=>(e.xMin+=o,e.yMin+=t,e.xMax-=n,e.yMax-=i,e),r.intersectPoint=(e,t)=>e.xMin<=t.x&&t.x<e.xMax&&e.yMin<=t.y&&t.y<e.yMax,r.intersectThat=(e,t)=>t.xMin<e.xMax&&t.xMax>e.xMin&&t.yMin<e.yMax&&t.yMax>e.yMin,r.center=e=>({x:(e.xMin+e.xMax)*.5,y:(e.yMin+e.yMax)*.5})})(Rm||(Rm={}));var Om;(function(r){r.Identity=Object.freeze([0,0,0,0])})(Om||(Om={}));var zm;(function(r){r.intersects=(n,i,o,s,a,u,l,d)=>{let h=e(n,i,o,s,a,u),f=e(n,i,o,s,l,d);if((h|f)===0||(h&f)!==0)return!1;let v=t(a,u,l,d,n,o);return v!==t(a,u,l,d,i,o)||v!==t(a,u,l,d,i,s)||v!==t(a,u,l,d,n,s)};let e=(n,i,o,s,a,u)=>{let l=0;return a<=n?l|=1:a>=i&&(l|=2),u<=o?l|=8:u>=s&&(l|=4),l},t=(n,i,o,s,a,u)=>(o-n)*(u-i)-(a-n)*(s-i)>=0})(zm||(zm={}));var Mm;(function(r){r.Identity={valueToAxis:e=>e,axisToValue:e=>e},r.toClamped=(e,t,n)=>({valueToAxis:i=>e.valueToAxis(G(i,t,n)),axisToValue:i=>G(e.axisToValue(i),t,n)}),r.createClamped=(e,t)=>({valueToAxis:n=>G(n,e,t),axisToValue:n=>G(n,e,t)})})(Mm||(Mm={}));var Tm;(function(r){r.fromBuffers=async(...e)=>{let t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t),i=0;for(let o of e)n.set(new Uint8Array(o),i),i+=o.byteLength;return await crypto.subtle.digest("SHA-256",n)},r.equals=(e,t)=>{N(e.byteLength===32,"First hash has invalid length"),N(t.byteLength===32,"Second hash has invalid length");let n=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<32;o++)if(n[o]!==i[o])return!1;return!0},r.toString=e=>Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")})(Tm||(Tm={}));var In;(function(r){r.intersect1D=(e,t,n,i)=>Math.max(e,n)<=Math.min(t,i)})(In||(In={}));var Ie=class{#t=new Set;#e;constructor(){this.#e=new Proxy({},{get:(e,t)=>(...n)=>this.#t.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?w(i[t],...n):i[t]?.apply(i,n))})}get proxy(){return this.#e}get size(){return this.#t.size}subscribe(e){return this.#t.add(e),{terminate:()=>this.#t.delete(e)}}forEach(e){this.#t.forEach(e)}terminate(){this.#t.clear()}};var jr=class{static createIfAbsent(e,t,n){let i=e.get(t);return i===void 0&&(i=n(t),e.set(t,i)),i}};var Bn=class r{static#t=Object.freeze(new Set);static empty=()=>r.#t};var Lr=class r{#t;#e;constructor(e,t){this.#t=new Map(e),this.#e=m.wrap(t),this.#e.ifSome(n=>Array.from(this.#t.values()).forEach(i=>i.sort(n)))}[Symbol.iterator](){return this.#t.entries()}clear(){this.#t.clear()}containsEntry(e,t){return xe.some(this.#t.entries(),n=>e===n[0]&&n[1].includes(t))}containsKey(e){return xe.includes(this.#t.keys(),e)}containsValue(e){return xe.some(this.#t.values(),t=>t.includes(e))}get(e){return this.#t.get(e)??F.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let n=jr.createIfAbsent(this.#t,e,()=>[]);if(this.#e.isEmpty())n.push(t);else{let i=pe.leftMost(n,t,this.#e.unwrap());n.splice(i,0,t)}}addAll(e,t){let n=jr.createIfAbsent(this.#t,e,()=>[]);n.push(...t),this.#e.nonEmpty()&&n.sort(this.#e.unwrap())}remove(e,t){let n=this.#t.get(e);if(n===void 0)return!1;{let i=n.indexOf(t);return i===-1?!1:(n.splice(i,1),n.length===0&&this.#t.delete(e),!0)}}removeFromKeyIf(e,t){let n=this.#t.get(e);if(n===void 0)return null;{let i=n.findIndex(t);if(i===-1)return null;{let o=n.splice(i,1)[0];return n.length===0&&this.#t.delete(e),o}}}removeValueIf(e){let t=[];for(let[n,i]of this.#t.entries())for(let o of i.filter(s=>e(s)))t.push([n,o]);for(let[n,i]of t)this.remove(n,i);return new Set(t.map(([,n])=>n))}removeKey(e){let t=this.#t.get(e);return this.#t.delete(e),t??F.empty()}forEach(e){xe.forEach(this.#t.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#t.size}keys(){return this.#t.keys()}sortKeys(e){let t=this.clone(),n=Array.from(this.keys()).sort(e);this.#t.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#t.forEach((t,n)=>{e.#t.set(n,t.map(i=>i))}),e}},Ko=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let n=t[0],i=t[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return xe.some(this.map.entries(),n=>e===n[0]&&n[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)??Bn.empty()}isEmpty(){return this.keyCount()===0}add(e,t){jr.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let n=jr.createIfAbsent(this.map,e,()=>new Set);for(let i of t)n.add(i)}remove(e,t){let n=this.map.get(e);return n===void 0?!1:n.delete(t)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[n,i]of this.map.entries()){for(let o of i)e(o)&&(i.delete(o),t.add(o));i.size===0&&this.map.delete(n)}return t}removeFromKeyIf(e,t){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(t(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Bn.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(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,n)=>{e.map.set(n,new Set(Array.from(t)))}),e}};var Z=Object.freeze({Empty:{terminate:Ct},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),V=class r{#t=[];isEmpty(){return this.#t.length===0}nonEmpty(){return this.#t.length>0}own(e){return this.#t.push(e),e}ownAll(...e){for(let t of e)this.#t.push(t)}spawn(){let e=new r;return e.own({terminate:()=>F.removeOpt(this.#t,e)}),this.own(e)}terminate(){for(;this.#t.length>0;)this.#t.pop().terminate()}};var W=class{static subscribeMany(e,...t){return Z.many(...t.map(n=>n.subscribe(()=>e(n))))}#t=new Set;subscribe(e){return this.#t.add(e),{terminate:()=>this.#t.delete(e)}}isEmpty(){return this.#t.size===0}notify(e){this.#t.forEach(t=>t(e))}observers(){return this.#t}terminate(){this.#t.clear()}};var wt;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,n)=>{let i=new Set(Object.keys(t));for(let o of Object.keys(n))if(i.has(o))return A(`'${o}' is an overlapping key`);return{...t,...n}},r.include=(t,...n)=>{let i={};for(let o of n)i[o]=t[o];return i},r.exclude=(t,...n)=>{let i=new Set(n);return Object.entries(t).reduce((o,[s,a])=>(i.has(s)||(o[s]=a),o),{})},r.overwrite=(t,n)=>Object.assign(t,n)})(wt||(wt={}));var Um;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return Z.Empty}catchupAndSubscribe(t){return t(this),Z.Empty}}})(Um||(Um={}));var Vm;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return Z.Empty}catchupAndSubscribe(e){return e(this),Z.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)}}})(Vm||(Vm={}));var mi=class{#t;#e=m.None;constructor(e){this.#t=new W,this.wrap(e)}wrap(e){this.wrapOption(m.wrap(e))}wrapOption(e){this.#e.equals(e)||(this.#e=e,this.#t.notify(this))}clear(e){this.#e.isEmpty()||(O(e)&&e(this.#e.unwrap()),this.#e=m.None,this.#t.notify(this))}assert(e){return this.#e.assert(e),this}contains(e){return this.#e.contains(e)}equals(e){return this.#e.equals(e)}flatMap(e){return this.#e.flatMap(e)}ifSome(e){return this.#e.ifSome(e)}ifAbsent(e){return this.#e.ifAbsent(e)}isEmpty(){return this.#e.isEmpty()}map(e){return this.#e.map(e)}mapOr(e,t){return this.#e.mapOr(e,t)}match(e){return this.#e.match(e)}nonEmpty(){return this.#e.nonEmpty()}unwrap(e){return this.#e.unwrap(e)}unwrapOrElse(e){return this.#e.unwrapOrElse(e)}unwrapOrNull(){return this.#e.unwrapOrNull()}unwrapOrUndefined(){return this.#e.unwrapOrUndefined()}subscribe(e){return this.#t.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#t.subscribe(()=>e(this))}terminate(){this.#t.terminate()}};var Ze=class{#t;#e=m.None;#r;constructor(e,t){this.#t=new W,this.#r=t?.guard(e)??e,this.#e=m.wrap(t)}setValue(e){this.#e.nonEmpty()&&(e=this.#e.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#t.notify(this))}getValue(){return this.#r}subscribe(e){return this.#t.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#t.subscribe(e)}terminate(){this.#t.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var Zl=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#t)/this.#r}y(e){return this.#t+G(e,0,1)*this.#r}clamp(e){return G(e,this.#t,this.#e)}floating(){return!0}},ql=class{#t;#e;#r;constructor(e,t){this.#t=G(Math.round(e),Ke.MIN_VALUE,Ke.MAX_VALUE),this.#e=G(Math.round(t),Ke.MIN_VALUE,Ke.MAX_VALUE),this.#r=this.#e-this.#t}x(e){return(this.clamp(e)-this.#t)/this.#r}y(e){return this.#t+Math.round(G(e,0,1)*this.#r)}clamp(e){return G(Math.round(e),this.#t,this.#e)}floating(){return!1}},Hl=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=Math.log(t/e)}x(e){return Math.log(G(e,this.#t,this.#e)/this.#t)/this.#r}y(e){return this.#t*Math.exp(G(e,0,1)*this.#r)}clamp(e){return Math.min(this.#e,Math.max(this.#t,e))}floating(){return!0}},Gl=class{#t;constructor(e){this.#t=e}x(e){let t=this.#t.findIndex(n=>n===e);return t===-1?A(`Could not find index for ${e}`):t/(this.#t.length-1)}y(e){let t=Math.round(G(e,0,1)*(this.#t.length-1));return t>-1?q(this.#t.at(t),`Could not find value for ${e}`):A(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Wl=class{#t;#e;#r;#i;#n;constructor(e,t,n){this.#t=e,this.#e=n;let i=e*e,o=n*n,s=t*t,a=e+n-2*t,u=n-t;this.#r=((2*n-t)*e-t*n)/a,this.#i=(u*i+(s-o)*e+t*o-s*n)/(i+(2*n-4*t)*e+o-4*t*n+4*s),this.#n=-u/a}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#e:this.#r-this.#i/(e+this.#n)}x(e){return this.#t>=e?0:this.#e<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#e,e)}floating(){return!0}},B;(function(r){r.linear=(o,s)=>new Zl(o,s),r.linearInteger=(o,s)=>new ql(o,s),r.exponential=(o,s)=>new Hl(o,s),r.values=o=>new Gl(o),r.decibel=(o,s,a)=>new Wl(o,s,a);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),n=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>n,r.DefaultDecibel=i})(B||(B={}));var I;(function(r){r.percent=({bipolar:o,fractionDigits:s}={})=>new e("%",s,!1,o),r.numeric=({unit:o,fractionDigits:s,unitPrefix:a,bipolar:u}={})=>new e(o,s,a,u),r.indices=(o,s)=>new class{x(a){return{unit:o,value:s[a]}}y(a){let u=s.indexOf(a);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},r.values=(o,s,a)=>new class{x(u){return{unit:o,value:a.at(s.indexOf(u))??"N/A"}}y(u){let l=a.indexOf(u);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:s[l]}}},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,s)=>new class{y(a){switch(a.trim()){case s:case"on":case"yes":case"true":return{type:"explicit",value:!0};case o:default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}};class e{#t;#e;#r;#i;constructor(s,a,u,l){this.#t=s??"",this.#e=a??0,this.#r=u??!1,this.#i=l??!1}y(s){let a=s.trim(),u=parseFloat(a);if(isNaN(u))return{type:"unknown",value:a};if(this.#t==="%")return{type:"explicit",value:u/100};if(a.endsWith("%"))return{type:"unitValue",value:this.#i?G(u/200+.5,0,1):G(u/100,0,1)};{a.endsWith(this.#t)&&this.#t.length>0&&(a=a.slice(0,-this.#t.length));let h=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(O(h)){let f=t.indexOf(h);if(f>-1)return{type:"explicit",value:u*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:u}}}x(s){if(Number.isNaN(s))return{value:"\u{1F4A3}",unit:this.#t};if(Number.isFinite(s)){if(this.#t==="%")return this.#i?{value:(s*200-100).toFixed(this.#e),unit:this.#t}:{value:(s*100).toFixed(this.#e),unit:this.#t};if(this.#r){let{value:a,prefix:u}=i(s);return{value:a.toFixed(this.#e),unit:`${u}${this.#t}`}}else return{value:s.toFixed(this.#e),unit:this.#t}}else return{value:s===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#t}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=o=>Math.log(o)/Math.log(9.999999999999998),i=o=>{let s=Math.floor(n(o)/3),a=t[s+4];return O(a)?{value:o*Math.pow(10,s*-3),prefix:a}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(I||(I={}));var Zo;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(Zo||(Zo={}));var jm;(function(r){r.Empty=Object.freeze(e=>{}),r.split=(e,t)=>{let n=new Float32Array(t);return F.create(i=>o=>{n[i]=o,e(n.reduce((s,a)=>s+a,0)/t)},t)},r.splitWithWeights=(e,t)=>{let n=t.length,i=new Float32Array(n);if(t.length===0)return A("Weights must not be empty");if(t.some(a=>a<=0))return A("Weights must be greater than zero");let o=t.reduce((a,u)=>a+u,0),s=o>0?t.map(a=>a/o):F.create(()=>1/n,n);return F.create(a=>u=>{i[a]=u,e(i.reduce((l,d,h)=>l+d*s[h],0))},n)}})(jm||(jm={}));var qo;(function(r){r.create=(e=252854082)=>new Jl(e),r.monotoneAscending=(e,t=128,n=r.create())=>{let i=e.length;if(i<2)return A("Array must have at least 2 elements");let o=0;for(let a=1;a<i;a++){let u=Math.floor(n.uniform()*(1+t))+1;e[a]=u,o+=u}let s=0;e[0]=0;for(let a=1;a<i;a++)s+=e[a],e[a]=s/o;return e}})(qo||(qo={}));var Jl=class{#t=0;constructor(e){this.setSeed(e)}setSeed(e){this.#t=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.#t+=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 qe;(function(r){class e{}r.createBuilder=n=>{let i=o=>{let s=o instanceof Array?[]:{};return Object.entries(o).forEach(([a,u])=>{u instanceof e?s[a]=u.initialValue():typeof u=="object"&&(s[a]=i(u))}),s};return()=>new t(n,Object.seal(i(n)))},r.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},r.floats=n=>new class extends e{read(i,o){for(let s=0;s<o.length;s++)o[s]=i.readFloat();return o}write(i,o){for(let s=0;s<o.length;s++)i.writeFloat(o[s])}initialValue(){return new Float32Array(n)}},r.doubles=n=>new class extends e{read(i,o){for(let s=0;s<o.length;s++)o[s]=i.readDouble();return o}write(i,o){for(let s=0;s<o.length;s++)i.writeDouble(o[s])}initialValue(){return new Float64Array(n)}};class t{#t;#e;#r;constructor(i,o){this.#t=i,this.#e=o,this.#r=this.#i()}get object(){return this.#e}get bytesTotal(){return this.#r}read(i){let o=(s,a)=>{Object.entries(s).forEach(([u,l])=>{let d=a;l instanceof e?d[u]=l.read(i,d[u]):typeof l=="object"&&o(l,d[u])})};o(this.#t,this.#e)}write(i){let o=(s,a)=>{Object.entries(s).forEach(([u,l])=>{let d=a;l instanceof e?l.write(i,d[u]):typeof l=="object"&&o(l,d[u])})};o(this.#t,this.#e)}#i(){let i=new ci;return this.write(i),i.count}}})(qe||(qe={}));var tr=class{#t;#e;#r;constructor(e,t){this.#t=e,this.#e=t,this.#r=[]}add(e,t=!1){let n=this.#t(e),i=pe.leftMostMapped(this.#r,n,this.#e,this.#t),o=this.#r[i];return O(o)&&this.#e(this.#t(o),n)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let n=pe.leftMostMapped(this.#r,e,this.#e,this.#t),i=this.#r[n];if(O(i)&&this.#e(this.#t(i),e)===0)return i;let o=t(e);return this.#r.splice(n,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,n)=>{let i=this.#e(this.#t(t),this.#t(n));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,o)=>this.#e(this.#t(i),this.#t(o))),!1}return A(t)}}removeByValue(e){return this.removeByKey(this.#t(e))}removeByKey(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return O(n)&&this.#e(this.#t(n),e)===0?(this.#r.splice(t,1),n):A(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return O(n)&&this.#e(this.#t(n),e)===0?(this.#r.splice(t,1),n):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),t++);return t}get(e){return q(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let n=this.#i(e);if(O(n))return n;throw t()}opt(e){return m.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return O(this.#i(e))}hasValue(e){return O(this.#i(this.#t(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.#t(e),e])}clear(){F.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=pe.leftMostMapped(this.#r,e,this.#e,this.#t),n=this.#r[t];return O(n)&&this.#e(this.#t(n),e)===0?n:void 0}};var Lm;(function(r){r.hyphenToCamelCase=e=>e.replace(/-([a-z])/g,t=>t[1].toUpperCase()),r.fallback=(e,t)=>O(e)&&e.length>0?e:t,r.endsWithDigit=e=>/\d$/.test(e),r.nonEmpty=(e,t)=>O(e)&&e.trim().length>0?e:t,r.toArrayBuffer=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t},r.getUniqueName=(e,t)=>{let n=new Set(e),i=t,o=1;if(n.has(t)||n.has(`${t} 1`))o=2;else return t;for(;n.has(i=`${t} ${o++}`););return i}})(Lm||(Lm={}));var Km=(()=>{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:Ct}),some:t=>t.progress(e)}),install:e=>{N(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var Zm;(function(r){let e=new W;r.subscribe=t=>e.subscribe(t),r.dispatch=t=>e.notify(t)})(Zm||(Zm={}));var rr=class r{static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#t);static minutes=e=>new r(e*r.#e);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#i);static#t=1e3;static#e=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/r.#t}absMinutes(){return Math.abs(this.#n)/r.#e}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,t,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),o=Math.floor(i/60),s=Math.floor(o/24);return n<60?(e=n,t="second"):i<60?(e=i,t="minute"):o<24?(e=o,t="hour"):(e=s,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:n,s:i}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):t>0?[r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):n>0?[r.#o("m",n),r.#o("s",i)].join(", "):i>0?r.#o("s",i):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return Dt(e)}}};var fi;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,n,i)=>{if(t.bytesTotal+1>n.byteLength)return A("Insufficient memory allocated.");let o=new Uint8Array(n),s=Se.use(n,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),s.position=0,t.write(s),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,n)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(i),s=new _e(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(s.position=0,t.read(s),n(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(fi||(fi={}));var S;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let n=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",n?new Uint8Array(t.slice(0)):t).then(i=>e(new Uint8Array(i.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:A(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let n=new Uint8Array(r.length);return t.readBytes(new Int8Array(n.buffer)),n},r.toDataOutput=(t,n)=>t.writeBytes(new Int8Array(n.buffer)),r.toString=t=>{let n=F.create(i=>(i+256).toString(16).substring(1),256);return n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]},r.parse=t=>{let n=t.replace(/-/g,"").toLowerCase();if(n.length!==32)return A("Invalid UUID format");let i=new Uint8Array(r.length);for(let o=0,s=0;o<32;o+=2,s++)i[s]=parseInt(n.slice(o,o+2),16);return i},r.Comparator=(t,n)=>{if(t.length!==r.length||n.length!==r.length)return A("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let o=t[i]-n[i];if(o!==0)return o}return 0},r.equals=(t,n)=>r.Comparator(t,n)===0,r.newSet=t=>new tr(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let n=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)n[o]=i[o];return n},r.zType=t=>t.string().refine(n=>r.validateString(n),{message:"Invalid UUID format"}).transform(n=>n);let e=t=>(N(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(S||(S={}));var qm;(function(r){r.create=o=>O(o)?O(o?.snap)?r.snap(o?.trackLength,o?.snap?.snapLength,Array.isArray(o?.snap?.threshold)?o?.snap.threshold:[o?.snap?.threshold]):r.identity(o?.trackLength):r.identity(),r.snap=(o=e,s=t,a)=>new i(o,s/o,a),r.identity=(o=e)=>new n(o);let e=128,t=24;class n{length;#t=NaN;#e=NaN;#r=1;constructor(s){this.length=s}begin(s){this.#e=this.#t=s}moveBy(s){N(!isNaN(this.#e),()=>"value has never been set"),this.#t+=s/this.length*this.#r,this.#e=G(this.#t,0,1)}ratio(s){this.#r=s}value(){return N(!isNaN(this.#e),()=>"value has never been set"),this.#e}disable(){}enable(){}}class i{#t;#e;#r;#i;#n=NaN;#o=NaN;#s=1;#a=!0;constructor(s,a,u){N(a>0,()=>`margin(${a}) must be greater then 0`),N(F.isSorted(u),()=>"thresholds are not sorted"),N(a<s,()=>`margin(${a}) must be lower then length(${s})`),this.#t=s,this.#e=a,this.#r=u,this.#i=u.map((l,d)=>l+d*this.#e)}begin(s){this.#a&&(this.#n=this.valueToX(s)),this.#o=s}moveBy(s){N(!isNaN(this.#o),()=>"value has never been set"),this.#n+=s/this.#t*this.#s,this.#o=this.#a?this.xToValue(this.#n):G(this.#n,0,1)}ratio(s){this.#s=s}value(){return N(!isNaN(this.#o),()=>"value has never been set"),this.#o}disable(){this.#a&&(this.#a=!1,this.#n=this.xToValue(this.#n))}enable(){this.#a||(this.#a=!0,this.#n=this.valueToX(this.#n))}valueToX(s){let a=pe.rightMost(this.#r,s,Xt);if(a<0)return s;{let u=this.#i[a],l=this.#r[a];return s===l?u+this.#e/2:u+this.#e+(s-l)}}xToValue(s){let a=G(s,0,1+this.#e*this.#r.length),u=pe.rightMost(this.#i,a,Xt);if(u<0)return a;{let l=this.#i[u],d=this.#r[u];return a>l+this.#e?a-(l+this.#e)+d:d}}get margin(){return this.#e}}})(qm||(qm={}));var Ho;(function(r){class e extends Error{}r.Warning=e,r.warn=n=>{throw new e(n)};class t extends Error{constructor(i){super(`${i} not found`)}}r.FileNotFound=t,r.AbortError=typeof DOMException>"u"?{name:"AbortError",message:""}:Object.freeze(new DOMException("AbortError")),r.isAbort=n=>n===r.AbortError||r.isDOMException(n)&&n.name==="AbortError",r.CatchAbort=n=>n===r.AbortError?void 0:A(n),r.isOverconstrained=n=>Qt(n)&&"constraint"in n,r.isDOMException=n=>Qt(n)&&Vl(n,"name","string")&&Vl(n,"message","string")})(Ho||(Ho={}));var Go=Symbol.for("@openDAW/lib-std");globalThis[Go]?console.debug(`%c${Go.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Go]=!0,console.debug(`%c${Go.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var oe=class r{static Empty=new r(2);#t;constructor(e=2){this.#t=F.create(()=>new Float32Array(128),e)}clear(e,t){this.#t.forEach(n=>n.fill(0,e,t))}numChannels(){return this.#t.length}getChannel(e){return e<this.numChannels()?this.#t[e]:this.#t[this.numChannels()-1]}assertSanity(){N(!this.#t.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#t}replace(e){this.replaceInto(e.#t)}replaceInto(e){N(e.length===2,"mixLayout: target.length must be 2"),N(this.#t.length===1||this.#t.length===2,"mixLayout: target.length must be 1 or 2"),this.#t.length===1?(e[0].set(this.#t[0]),e[1].set(this.#t[0])):(e[0].set(this.#t[0]),e[1].set(this.#t[1]))}mixInto(e){N(e.length===2,"mixLayout: target.length must be 2"),N(this.#t.length===1||this.#t.length===2,"mixLayout: target.length must be 1 or 2");let[t,n]=e;if(this.#t.length===1){let[i]=this.#t;for(let o=0;o<128;o++)t[o]+=i[o],n[o]+=i[o]}else{let[i,o]=this.#t;for(let s=0;s<128;s++)t[s]+=i[s],n[s]+=o[s]}}};var Hm;(function(r){function e(t,n,i={}){let{interval:o=64,scanSteps:s=1024,scanSamples:a=2048,minBPM:u=90,maxBPM:l=180}=i,d=new Float32Array(Math.floor(t.length/o)),h=0,f=0,v=0;for(let H of t){let ne=Math.abs(H);h+=(ne-h)*(ne>h?1/8:1/512),++f===o&&(f=0,d[v++]=h)}if(!d.length)return NaN;let g=(H,ne)=>H[Math.floor(ne)]??0,y=H=>n/(H/60)/o,b=H=>n/(H*o)*60,R=[-32,-16,-8,-4,-2,-1,1,2,4,8,16,32],M=[-.5,-.25,.25,.5],j=H=>{let ne=Math.random()*d.length,ge=g(d,ne),je=0,ft=0;for(let Le of R){let ot=1/Math.abs(Le);je+=ot*Math.abs(g(d,ne+Le*H)-ge),ft+=ot}for(let Le of M){let ot=Math.abs(Le);je-=ot*Math.abs(g(d,ne+Le*H)-ge),ft+=ot}return je/ft},L=H=>{let ne=0;for(let ge=0;ge<a;++ge)ne+=j(H);return ne/a},ee=y(u),we=y(l),$e=(ee-we)/s,J=u,me=1/0;for(let H=we;H<=ee;H+=$e){let ne=b(H),ge=L(H)*(u/ne);ge<me&&(me=ge,J=ne)}return J}r.detect=e})(Hm||(Hm={}));var At=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=G(e,0,1),e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=gt*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=(1-o)/2,a=s,u=2*s,l=s,d=1+i,h=-2*o,f=1-i;this.setNormalizedCoefficients(a,u,l,d,h,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=G(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=gt*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=(1+o)/2,a=s,u=-2*s,l=s,d=1+i,h=-2*o,f=1-i;this.setNormalizedCoefficients(a,u,l,d,h,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,n,i,o,s){let a=1/i;return this.b0=e*a,this.b1=t*a,this.b2=n*a,this.a1=o*a,this.a2=s*a,this}setLowShelfParams(e,t){e=G(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=gt*e,s=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),a=Math.cos(i),u=2*Math.sqrt(n)*s,l=n+1,d=n-1,h=n*(l-d*a+u),f=2*n*(d-l*a),v=n*(l-d*a-u),g=l+d*a+u,y=-2*(d+l*a),b=l+d*a-u;this.setNormalizedCoefficients(h,f,v,g,y,b)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=G(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=gt*e,s=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),a=Math.cos(i),u=2*Math.sqrt(n)*s,l=n+1,d=n-1,h=n*(l+d*a+u),f=-2*n*(d+l*a),v=n*(l+d*a-u),g=l-d*a+u,y=2*(d-l*a),b=l-d*a-u;this.setNormalizedCoefficients(h,f,v,g,y,b)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,t,n){e=G(e,0,1),t=Math.max(0,t);let i=Math.pow(10,n/40);if(e>0&&e<1)if(t>0){let o=gt*e,s=Math.sin(o)/(2*t),a=Math.cos(o),u=1+s*i,l=-2*a,d=1-s*i,h=1+s/i,f=-2*a,v=1-s/i;this.setNormalizedCoefficients(u,l,d,h,f,v)}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=G(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=gt*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=1-i,a=-2*o,u=1+i,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}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=G(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=gt*e,i=Math.sin(n)/(2*t),o=Math.cos(n),s=1,a=-2*o,u=1,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let n=gt*e;if(t>0){let i=Math.sin(n)/(2*t),o=Math.cos(n),s=i,a=0,u=-i,l=1+i,d=-2*o,h=1-i;this.setNormalizedCoefficients(s,a,u,l,d,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,n){N(e.length===t.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,o=this.b1,s=this.b2,a=this.a1,u=this.a2;for(let l=0;l<e.length;++l){let d=-Math.PI*2*e[l],h=Math.cos(d),f=Math.sin(d),v=i+((o+s*h)*h-s*f*f),g=(o+s*h)*f+s*f*h,y=1+((a+u*h)*h-u*f*f),b=(a+u*h)*f+u*f*h,R=y*y+b*b,M=(v*y+g*b)/R,j=(g*y-v*b)/R;t[l]=Math.sqrt(M*M+j*j),n[l]=Math.atan2(j,M)}}};var Ne=class{#t=0;#e=0;#r=0;#i=0;reset(){this.#t=0,this.#e=0,this.#r=0,this.#i=0}process({a1:e,a2:t,b0:n,b1:i,b2:o},s,a,u,l){let d=this.#t,h=this.#e,f=this.#r,v=this.#i;for(let g=u;g<l;g++){let y=s[g],b=a[g]=n*y+i*d+o*h-e*f-t*v+1e-18-1e-18;h=d,d=y,v=f,f=b}this.#t=d,this.#e=h,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:n,b1:i,b2:o},s){let a=n*s+i*this.#t+o*this.#e-e*this.#r-t*this.#i+1e-18-1e-18;return this.#e=this.#t,this.#t=s,this.#i=this.#r,this.#r=a,a}},Kr=class{#t;order;constructor(e){this.#t=F.create(()=>new Ne,e),this.order=this.#t.length}reset(){this.#t.forEach(e=>e.reset())}process(e,t,n,i,o){for(let s=0;s<this.order;s++)this.#t[s].process(e,t,n,i,o),t=n}processFrame(e,t){for(let n=0;n<this.order;n++)t=this.#t[n].processFrame(e,t);return t}};var Gm=Math.log(10)/20,Dn=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var fe=r=>Math.exp(r*Gm),Yl=r=>Math.log(r)/Gm,gi=r=>fe(20*Math.log10(r));var lx=.02,Wo=class{#t;#e;#r;#i;#n;#o;#s=NaN;#a=NaN;#u=0;#l=0;#c=0;#h=8;#d=0;#p=1;#f=!1;constructor(e){this.#t=e,this.#e=Math.ceil(e*lx)|0,this.#r=new At,this.#r.setLowpassParams(.5),this.#i=[new Ne,new Ne],this.#n=[new Float32Array(128),new Float32Array(128)],this.#o=new Float32Array(2)}process(e,t,n,i){let[o,s]=e,[a,u]=t,[l,d]=this.#n;this.#i[0].process(this.#r,o,l,n,i),this.#i[1].process(this.#r,s,d,n,i);let h=fe(this.#d),f=fe(-this.#d/2),v=this.#t/this.#s,g=Math.pow(2,this.#h)-1,y=1/g;for(let b=n;b<i;b++)this.#l>0&&(this.#s+=this.#u,--this.#l===0&&(this.#u=0,this.#s=this.#a),this.#r.setLowpassParams(this.#s/this.#t)),this.#c+=1,this.#c>=v&&(this.#c-=v,this.#o[0]=G(Math.round(l[b]*h*g)*y,-1,1),this.#o[1]=G(Math.round(d[b]*h*g)*y,-1,1)),a[b]=(o[b]*(1-this.#p)+this.#o[0]*this.#p)*f,u[b]=(s[b]*(1-this.#p)+this.#o[1]*this.#p)*f;this.#f=!0}setCrush(e){let t=e*.5*this.#t;this.#f&&isFinite(this.#s)?(this.#a=t,this.#u=(t-this.#s)/this.#e,this.#l=this.#e):(this.#s=t,this.#r.setLowpassParams(this.#s/this.#t))}setBitDepth(e){this.#h=G(e,1,16)}setBoost(e){this.#d=e}setMix(e){this.#p=Vo(e)}reset(){this.#f=!1,this.#s=NaN,this.#a=NaN,this.#u=0,this.#l=0,this.#c=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Wm;(function(r){r.Major=[0,2,4,5,7,9,11],r.Minor=[0,2,3,5,7,8,10],r.NoteLabels=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r.compile=(e,t,n,i)=>F.create(o=>{let s=n+o*2,a=e[s%7]+Math.floor(s/7)*12;return t+a},i),r.toString=e=>r.NoteLabels[e%12]+(Math.floor(e/12)-2)})(Wm||(Wm={}));var Zr;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Zr||(Zr={}));var qr;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(qr||(qr={}));var Ye;(function(r){r.globalToLocal=(t,n)=>_n(n-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:n,loopOffset:i,loopDuration:o},s,a)=>{let u=t-i,l=u+o;if(u>=a||l<=s)return m.None;let d=Math.max(u,s),h=Math.min(l,a);return m.wrap({index:0,rawStart:u,rawEnd:l,regionStart:Math.max(u,t),regionEnd:Math.min(l,n),resultStart:d,resultEnd:h,resultStartValue:u<d?(d-u)/o:0,resultEndValue:l>h?(h-u)/o:1})};function*e({position:t,complete:n,loopOffset:i,loopDuration:o},s,a){let u=t-i,l=Math.max(t,s),d=Math.min(n,a),h=Math.floor((l-u)/o),f=u+h*o;for(;f<d;){let v=f+o,g=Math.max(f,t),y=Math.min(v,n),b=Math.max(f,l),R=Math.min(v,d),M=f<b?(b-f)/o:0,j=v>R?(R-f)/o:1;yield{index:h++,rawStart:f,rawEnd:v,regionStart:g,regionEnd:y,resultStart:b,resultEnd:R,resultStartValue:M,resultEndValue:j},f=v}}r.locateLoops=e})(Ye||(Ye={}));var ir=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#t;constructor(e){this.#t=new Jo(e)}add(e){this.#t.add(e)}remove(e){return this.#t.remove(e)}contains(e){return this.#t.contains(e)}clear(){this.#t.clear()}optAt(e){return this.#t.optAt(e)}asArray(){return this.#t.asArray()}lowerEqual(e,t){return this.#t.lowerEqual(e,t)}greaterEqual(e,t){return this.#t.greaterEqual(e,t)}floorLastIndex(e){return this.#t.floorLastIndex(e)}ceilFirstIndex(e){return this.#t.ceilFirstIndex(e)}iterateFrom(e,t){return this.#t.isEmpty()?Mt.empty():this.#t.iterateFrom(e,t)}iterateRange(e,t,n){return this.#t.isEmpty()?Mt.empty():this.#t.iterate(this.#t.ceilFirstIndex(e),t,n)}length(){return this.#t.length()}isEmpty(){return this.#t.isEmpty()}onIndexingChanged(){this.#t.onIndexingChanged()}},nr=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#t;constructor(e=r.Comparator){this.#t=new Jo(e)}add(e){this.#t.add(e)}remove(e){return this.#t.remove(e)}contains(e){return this.#t.contains(e)}clear(){this.#t.clear()}optAt(e){return this.#t.optAt(e)}asArray(){return this.#t.asArray()}lowerEqual(e,t){return this.#t.lowerEqual(e,t)}greaterEqual(e,t){return this.#t.greaterEqual(e,t)}floorLastIndex(e){return this.#t.floorLastIndex(e)}ceilFirstIndex(e){return this.#t.ceilFirstIndex(e)}iterateFrom(e,t){return this.#t.isEmpty()?Mt.empty():this.#t.iterateFrom(e,t)}iterateRange(e,t){if(this.#t.isEmpty())return Mt.empty();let n=Math.max(0,this.#t.floorLastIndex(e)),i=this.#t.optAt(n);if(i===null)return Mt.empty();for(;i.position+i.duration<=e;)if(i=this.#t.optAt(++n),i===null||i.position>=t)return Mt.empty();return this.#t.iterate(n,t)}length(){return this.#t.length()}isEmpty(){return this.#t.isEmpty()}onIndexingChanged(){this.#t.onIndexingChanged()}},vi=class{#t;constructor(){this.#t=[]}addAndRetain(e){if(this.#t.length===0)this.#t.push(e);else{let t=pe.leftMost(this.#t,e,qr.DescendingComparator);this.#t.splice(t,0,e)}}*overlapping(e,t){let n=this.#t.filter(i=>i.position<=e&&e<i.position+i.duration);yield*O(t)?n.sort(t):n}*releaseLinearCompleted(e){if(this.#t.length!==0)for(let t=this.#t.length-1;t>=0;t--){let n=this.#t[t];if(qr.complete(n)<e)this.#t.splice(t,1),yield n;else return}}*releaseAll(){if(this.#t.length!==0)for(let e=this.#t.length-1;e>=0;e--){let t=this.#t[e];Number.POSITIVE_INFINITY>t.duration&&(this.#t.splice(e,1),yield t)}}isEmpty(){return this.#t.length===0}nonEmpty(){return this.#t.length>0}clear(){F.clear(this.#t)}},Jo=class{comparator;#t=[];#e=!1;modCount=0;constructor(e){this.comparator=e}add(e){++this.modCount,this.#t.push(e),this.#t.length>1&&(this.#e=!0)}remove(e){++this.modCount;let t=this.#t.indexOf(e);return t===-1?!1:(this.#t.splice(t,1),!0)}contains(e){if(this.#t.length===0)return!1;this.#e&&this.#r();let n=e.position,i=pe.leftMostMapped(this.#t,n,Xt,Zr.PositionExtractor);for(let o=i;o<this.#t.length;o++){let s=this.#t[o];if(s===e)return!0;if(s.position!==n)return!1}return!1}clear(){++this.modCount,F.clear(this.#t),this.#e=!1}optAt(e){return e<0||e>=this.#t.length?null:(this.#e&&this.#r(),this.#t[e])}asArray(){return this.#e&&this.#r(),this.#t}lowerEqual(e,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#t[n--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#t.length;){let i=this.#t[n++];if(t(i))return i}return null}floorLastIndex(e){return this.#e&&this.#r(),pe.rightMostMapped(this.#t,e,Xt,Zr.PositionExtractor)}ceilFirstIndex(e){return this.#e&&this.#r(),pe.leftMostMapped(this.#t,e,Xt,Zr.PositionExtractor)}iterateFrom(e,t){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Ke.MAX_VALUE,t);for(;i>=0;){let o=this.optAt(i);if(o!==null&&t!==void 0&&t(o))return this.iterate(i,Ke.MAX_VALUE,t);i--}return this.iterate(n,Ke.MAX_VALUE,t)}length(){return this.#t.length}isEmpty(){return this.#t.length===0}onIndexingChanged(){this.#e=this.length()>1}*iterate(e,t,n=Zo.alwaysTrue){for(this.#e&&this.#r();e<this.#t.length;){let i=this.#t[e++];if(i.position>=t)return;n(i)&&(yield i)}}#r(){this.#t.sort(this.comparator),this.#e=!1}};var Yo=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}#t;#e;#r;#i;constructor(e){this.#t=e;let t=e/2;this.#e=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let n=0;n<t;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,t){let n,i,o,s;for(let l=0;l<this.#t;++l)i=r.reverse(l)>>>this.#e,i>l&&(s=e[l],e[l]=e[i],e[i]=s,s=t[l],t[l]=t[i],t[i]=s);let a=this.#r,u=this.#i;for(let l=2;l<=this.#t;l<<=1){let d=l>>1,h=this.#t/l;for(n=0;n<this.#t;n+=l){let f=n+d;for(i=n,o=0;i<f;i++,o=o+h|0){let v=i+d|0,g=a[o],y=u[o],b=e[v],R=t[v],M=b*g+R*y,j=R*g-b*y,L=e[i],ee=t[i];e[v]=L-M,t[v]=ee-j,e[i]=L+M,t[i]=ee+j}}if(l===this.#t)break}}};var Ql=(r,e)=>{let t=.25*e*r+.25;return 4*(Math.abs(t-Math.round(t))-.25)};var Xl=(r,e)=>Math.floor(3840/e)*r,Jm=(r,e=4,t=4)=>{let n=Xl(1,t),i=Math.floor(r/n),o=Math.floor(i/e),a=(Math.floor(r)-Xl(o*e,t))%n,u=Math.floor(a/240),l=a%240;return{bars:o,beats:i-o*e,semiquavers:u,ticks:l}},Ym=(r,e)=>r*e/60*960,Qm=(r,e)=>r*60/960/e,cx=(r,e,t)=>Ym(r/t,e),dx=(r,e,t)=>Qm(r,e)*t,re={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Xl,toParts:Jm,secondsToPulses:Ym,pulsesToSeconds:Qm,samplesToPulses:cx,pulsesToSamples:dx,toString:(r,e=4,t=4)=>{let{bars:n,beats:i,semiquavers:o,ticks:s}=Jm(r|0,e,t);return`${n+1}.${i+1}.${o+1}:${s}`}};var vt;(function(r){r.builder=()=>new e,r.toDouble=([t,n])=>t/n,r.toPPQN=([t,n])=>re.fromSignature(t,n);class e{#t=[];add(n){return this.#t.push(n),this}asArray(){return this.#t}asAscendingArray(){return this.#t.toSorted((n,i)=>r.toDouble(n)-r.toDouble(i))}asDescendingArray(){return this.#t.toSorted((n,i)=>r.toDouble(i)-r.toDouble(n))}}})(vt||(vt={}));var or=class{static*iterate(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield o,o=++i*n}static*iterateWithIndex(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield{position:o,index:i},o=++i*n}};var Qo=class{#t;#e;constructor(){this.#t=[],this.#e=new Map}addVertex(e){N(!this.#t.includes(e),"Vertex already exists"),this.#t.push(e),N(!this.#e.has(e),"Predecessor already exists"),this.#e.set(e,[])}removeVertex(e){F.remove(this.#t,e);let t=this.#e.delete(e);N(t,"Predecessor does not exists")}getPredecessors(e){return this.#e.get(e)??F.empty()}predecessors(){return this.#e}vertices(){return this.#t}addEdge([e,t]){let n=q(this.#e.get(t),`[add] Edge has unannounced vertex. (${t})`);N(!n.includes(e),`${e} is already marked.`),n.push(e)}removeEdge([e,t]){let n=q(this.#e.get(t),`[remove] Edge has unannounced vertex. (${t})`);N(n.includes(e),`${e} is not marked.`),F.remove(n,e)}isEmpty(){return this.#t.length===0}},Xo=class{#t;#e;#r;#i;#n;constructor(e){this.#t=e,this.#e=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#t.vertices().forEach(e=>this.#s(e))}sorted(){return this.#e}hasLoops(){return this.#i.size!==0}#o(){this.#a();let e=new Map;for(let n of this.#t.vertices())this.#n.set(n,new Set),e.set(n,new Set);for(let n of this.#t.vertices())for(let i of this.#t.getPredecessors(n))q(this.#n.get(i),`Could not find Successor for ${i}`).add(n);let t;do{t=!1;for(let n of this.#t.vertices()){q(e.get(n)).clear();for(let i of q(this.#n.get(n)))for(let o of q(this.#n.get(i)))this.#n.get(n)?.has(o)||(t=!0,q(e.get(n)).add(o))}for(let n of this.#t.vertices()){let i=q(this.#n.get(n));q(e.get(n)).forEach(o=>i.add(o))}}while(t)}#s(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#t.getPredecessors(e)){if(q(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#s(t)}this.#e.push(e)}}#a(){F.clear(this.#e),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Cn;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Cn||(Cn={}));var es=class{#t;constructor(e){this.#t=e}warp(e){return this.#e(!0,e)}unwarp(e){return this.#e(!1,e)}#e(e,t){let n=this.#t.duration(),i=Rt(t,n),o=(t-i)/n,s=e?this.#t.fx(o):this.#t.fy(o);return i+s*n}};var Xm;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,n)=>t|=1<<n,0),r.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`;class e{#t;#e;constructor(n,...i){this.#t=n,this.#e=i.reduce((o,s)=>o|=1<<s,0)}get name(){return this.#t}get bits(){return this.#e}has(n){return(this.#e&1<<n%12)!==0}equals(n){return this.#e===n.bits}}r.StockScales=[new e("Major",0,2,4,5,7,9,11),new e("Natural Minor",0,2,3,5,7,8,10),new e("Harmonic Minor",0,2,3,5,7,8,11),new e("Melodic Minor",0,2,3,5,7,9,11),new e("Dorian",0,2,3,5,7,9,10),new e("Phrygian",0,1,3,5,7,8,10),new e("Lydian",0,2,4,6,7,9,11),new e("Mixolydian",0,2,4,5,7,9,10),new e("Locrian",0,1,3,5,6,8,10),new e("Pentatonic Major",0,2,4,7,9),new e("Pentatonic Minor",0,3,5,7,10),new e("Blues",0,3,5,6,7,10),new e("Whole Tone",0,2,4,6,8,10),new e("Diminished",0,2,3,5,6,8,9,11),new e("Augmented",0,3,4,7,8,11)]})(Xm||(Xm={}));var He;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.pitch-t.pitch;return i!==0?i:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let n=qr.complete(e)-qr.complete(t);return n!==0?n:e.pitch-t.pitch}})(He||(He={}));var Tt;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.sawtooth=2]="sawtooth",r[r.square=3]="square"})(Tt||(Tt={}));var ts=class{#t=0;#e=0;generate(e,t,n,i,o){for(let s=i;s<o;s++){let a=this.#t%1,u=0;switch(n){case Tt.sine:u=Math.sin(2*Math.PI*a);break;case Tt.sawtooth:u=2*a-1,u-=this.#r(a,t);break;case Tt.square:u=a<.5?1:-1,u+=this.#r(a,t),u-=this.#r((a+.5)%1,t);break;case Tt.triangle:let l=a<.5?1:-1;l+=this.#r(a,t),l-=this.#r((a+.5)%1,t),this.#e+=l*(4*t),u=this.#e;break}e[s]=u,this.#t+=t}}#r(e,t){return e<t?(e/=t,e+e-e*e-1):e>1-t?(e=(e-1)/t,e*e+e+e+1):0}};var Ut;(function(r){let e;(function(t){t[t.Linear=0]="Linear",t[t.EqualPower=1]="EqualPower"})(e=r.Mixing||(r.Mixing={})),r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(t,{gain:n,panning:i,invertL:o,invertR:s,stereo:a,swap:u},l=e.EqualPower)=>{let[d,h]=r.panningToGains(i,l),f=d*n,v=h*n;o&&(f*=-1),s&&(v*=-1);let g=Math.max(0,-a),y=Math.max(0,a),b=1-y,R=1+y,M=g*.5,j=1-g,L=(b+R)*.5,ee=(b-R)*.5,we=(b-R)*.5,$e=(b+R)*.5,J=f*(M+j)*L+v*M*ee,me=f*(M+j)*we+v*M*$e,H=f*M*L+v*(M+j)*ee,ne=f*M*we+v*(M+j)*$e;u?(t.ll=me,t.rl=J,t.lr=ne,t.rr=H):(t.ll=J,t.lr=H,t.rl=me,t.rr=ne)},r.panningToGains=(t,n)=>{let i=G(t,-1,1);switch(n){case e.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case e.EqualPower:return[Math.cos((i+1)*Ll),Math.sin((i+1)*Ll)]}},r.applyFrame=(t,n,i)=>[t.ll*n+t.rl*i,t.lr*n+t.rr*i],r.processFrames=(t,n,i,o,s)=>{let[a,u]=n,[l,d]=i;for(let h=o;h<s;h++){let f=a[h],v=u[h];l[h]=t.ll*f+t.rl*v,d[h]=t.lr*f+t.rr*v}},r.replaceFrames=(t,[n,i],o,s)=>{for(let a=o;a<s;a++){let u=n[a],l=i[a];n[a]=t.ll*u+t.rl*l,i[a]=t.lr*u+t.rr*l}}})(Ut||(Ut={}));var Oe;(function(r){r.linear=(n,i=.005)=>new e(Math.ceil(n*i)|0),r.stereoMatrix=(n,i=.005)=>new t(Math.ceil(n*i)|0);class e{#t;#e=0;#r=0;#i=0;#n=0;constructor(i){this.#t=i}set(i,o){this.#e!==i&&(o===!0?(this.#r=i,this.#i=(i-this.#e)/this.#t,this.#n=this.#t):(this.#e=this.#r=i,this.#i=0,this.#n=0))}get(){return this.#e}moveAndGet(){return 0<this.#n&&(this.#e+=this.#i,--this.#n===0&&(this.#i=0,this.#e=this.#r)),this.#e}isFixed(i){return this.#e===i&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#t;#e=Ut.zero();#r=Ut.zero();#i=Ut.zero();#n=0;constructor(i){this.#t=i}update(i,o,s){Ut.update(this.#r,i,o),s===!0?(this.#i.ll=(this.#r.ll-this.#e.ll)/this.#t,this.#i.lr=(this.#r.lr-this.#e.lr)/this.#t,this.#i.rl=(this.#r.rl-this.#e.rl)/this.#t,this.#i.rr=(this.#r.rr-this.#e.rr)/this.#t,this.#n=this.#t):(this.#e.ll=this.#r.ll,this.#e.lr=this.#r.lr,this.#e.rl=this.#r.rl,this.#e.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(i,o,s,a){let[u,l]=i,[d,h]=o;if(this.isInterpolating())for(let f=s;f<a;f++){let v=u[f],g=l[f],y=this.moveAndGet();d[f]=y.ll*v+y.rl*g,h[f]=y.lr*v+y.rr*g}else{let f=this.#r;for(let v=s;v<a;v++){let g=u[v],y=l[v];d[v]=f.ll*g+f.rl*y,h[v]=f.lr*g+f.rr*y}}}set(i,o){this.#o(i)||(o===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#e.ll)/this.#t,this.#i.lr=(i.lr-this.#e.lr)/this.#t,this.#i.rl=(i.rl-this.#e.rl)/this.#t,this.#i.rr=(i.rr-this.#e.rr)/this.#t,this.#n=this.#t):(this.#e.ll=this.#r.ll=i.ll,this.#e.lr=this.#r.lr=i.lr,this.#e.rl=this.#r.rl=i.rl,this.#e.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#e}moveAndGet(){return 0<this.#n&&(this.#e.ll+=this.#i.ll,this.#e.lr+=this.#i.lr,this.#e.rl+=this.#i.rl,this.#e.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#e.ll=this.#r.ll,this.#e.lr=this.#r.lr,this.#e.rl=this.#r.rl,this.#e.rr=this.#r.rr)),this.#e}isFixed(i){return this.#o(i)&&this.#n===0}isInterpolating(){return this.#n>0}#o(i){return this.#e.ll===i.ll&&this.#e.lr===i.lr&&this.#e.rl===i.rl&&this.#e.rr===i.rr}}r.StereoMatrixRamp=t})(Oe||(Oe={}));var Rn=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]),ec=new Float32Array(12),ef=new Float32Array(11);for(let r=0,e=0,t=0;r<Rn.length;r++)r%2===0?ec[e++]=Rn[r]:ef[t++]=Rn[r];var tc=class{#t=new Float32Array(ec.length);#e=new Float32Array(Rn.length);#r=0;#i=0;reset(){this.#t.fill(0),this.#e.fill(0),this.#r=0,this.#i=0}upsample(e,t,n,i){let o=this.#t,s=ec,a=ef;for(let u=n;u<i;u++){let l=e[u],d=u*2;o[this.#r]=l;let h=0;for(let v=0;v<s.length;v++){let g=(this.#r-v+o.length)%o.length;h+=o[g]*s[v]}t[d]=h*2;let f=0;for(let v=0;v<a.length;v++){let g=(this.#r-v+o.length-1)%o.length;f+=o[g]*a[v]}t[d+1]=f*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,n,i){let o=this.#e,s=Rn;for(let a=n;a<i;a++){o[this.#i]=e[a*2],this.#i=(this.#i+1)%o.length,o[this.#i]=e[a*2+1],this.#i=(this.#i+1)%o.length;let u=0;for(let l=0;l<s.length;l++){let d=(this.#i-1-l+o.length)%o.length;u+=o[d]*s[l]}t[a]=u}}},rs=class{#t;#e;#r;constructor(e){this.#t=e;let t=e===2?1:e===4?2:3;this.#e=F.create(()=>new tc,t),this.#r=F.create(n=>new Float32Array(128*(2<<n)),t-1)}reset(){this.#e.forEach(e=>e.reset())}upsample(e,t,n,i){let o=i-n,s=e,a=n,u=i;for(let l=0;l<this.#e.length;l++){let h=l===this.#e.length-1?t:this.#r[l];this.#e[l].upsample(s,h,a,u),s=h,a=0,u=o*(2<<l)}}downsample(e,t,n,i){let o=i-n,s=e,a=o*this.#t;for(let u=this.#e.length-1;u>=0;u--){let l=u===0,d=l?t:this.#r[u-1],h=l?n:0,f=l?i:a/2;this.#e[u].downsample(s,d,h,f),s=d,a=f}}},is=class{#t;#e;constructor(e){this.#t=new rs(e),this.#e=new rs(e)}reset(){this.#t.reset(),this.#e.reset()}upsample(e,t,n,i){this.#t.upsample(e[0],t[0],n,i),this.#e.upsample(e[1],t[1],n,i)}downsample(e,t,n,i){this.#t.downsample(e[0],t[0],n,i),this.#e.downsample(e[1],t[1],n,i)}};var xi=class{#t;#e;#r;#i;constructor(e){this.#t=new Float32Array(e),this.#e=1/e,this.#r=0,this.#i=0}pushPop(e){let t=e*e;return this.#i-=this.#t[this.#r],this.#i+=t,this.#t[this.#r]=t,++this.#r===this.#t.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#e)}clear(){this.#t.fill(0),this.#i=0,this.#r=0}};var sr={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},ns;(function(r){r.Comparator=(i,o)=>{let s=i.position-o.position;if(s!==0)return s;let a=i.index-o.index;return a!==0?a:i===o?0:A(`${i} and ${o} are identical in terms of comparison`)};function*e(i,o,s){if(i.isEmpty())return xe.empty();for(let a of i.iterateFrom(o))if(yield a,a.position>=s)return}r.iterateWindow=e,r.nextEvent=(i,o)=>{let s=i.asArray(),a=pe.rightMost(s,o,r.Comparator);return a===-1?null:s[a+1]??null},r.valueAt=(i,o,s)=>{if(i.isEmpty())return s;let a=i.iterateFrom(o),{done:u,value:l}=a.next();if(u)return s;if(l.position<=o){let{done:d,value:h}=a.next();if(d)return l.value;if(o<h.position)return n(l,h,o);if(l.interpolation===sr.None)return l.value}return l.value};function*t(i,o,s,a){if(i.isEmpty())return;let u=i.iterateFrom(o),{done:l,value:d}=u.next();if(l)return;let h=s/a,f=d;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=h,o>s)return;f.position<=s&&(yield f)}for(;o<=s;){let{done:v,value:g}=u.next();if(v)break;for(;o<g.position;){if(o>s)return;yield{position:o,value:n(f,g,o)},o+=h}g.position<s&&(f.interpolation===sr.None&&(yield{position:g.position,value:f.value}),yield g),f=g}for(;o<=s;)yield{position:o,value:f.value},o+=h}r.quantise=t;let n=({value:i,position:o,interpolation:s},a,u)=>s.type==="none"?i:s.type==="linear"?i+(u-o)/(a.position-o)*(a.value-i):s.type==="curve"?at.valueAt({slope:s.slope,steps:a.position-o,y0:i,y1:a.value},u-o):A("Unknown interpolation")})(ns||(ns={}));var On;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,n)=>{let i=new Float32Array(n),o=Math.PI/(n-1);switch(t){case e.Bartlett:{let s=(n>>1)-1,a=0;for(;a<=s;++a)i[a]=2*a/(n-1);for(;a<n;++a)i[a]=2-2*a/(n-1);return i}case e.Blackman:{let s=2*o,a=4*o;for(let u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(s*u)+.07922*Math.cos(a*u);return i}case e.BlackmanHarris:{let s=2*o,a=4*o,u=6*o;for(let l=0;l<n;++l)i[l]=.35875-.48829*Math.cos(s*l)+.14128*Math.cos(a*l)-.01168*Math.cos(u*l);return i}case e.Hamming:{let s=2*o;for(let a=0;a<n;++a)i[a]=.54-.46*Math.cos(s*a);return i}case e.Hanning:{let s=2*o;for(let a=0;a<n;++a)i[a]=.5-.5*Math.cos(s*a);return i}}}})(On||(On={}));var os=Symbol.for("@openDAW/lib-dsp");globalThis[os]?console.debug(`%c${os.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[os]=!0,console.debug(`%c${os.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var ss=class extends AudioWorkletProcessor{#t;#e;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:n,valueDecay:i}}){super(),this.#t=t,this.#e=new Float32Array(t),this.#r=new Float32Array(t),this.#i=F.create(()=>new xi(sampleRate*n),t);let o=qe.createBuilder({peak:qe.floats(t),rms:qe.floats(t)})();this.#n=fi.writer(o,e,s=>{let a=Math.exp(-(128*this.#o)/(sampleRate*i));for(let u=0;u<t;++u){let l=this.#e[u],d=this.#r[u];s.peak[u]=l,s.rms[u]=Math.sqrt(d),this.#e[u]=l*a,this.#r[u]=d*a}this.#o=0})}process([e]){for(let t=0;t<this.#t;++t){let n=e[t];if(n===void 0)this.#e[t]=0,this.#r[t]=0;else{let i=this.#i[t],o=this.#e[t],s=this.#r[t];for(let a=0;a<128;++a){let u=n[a];o=Math.max(o,Math.abs(u)),s=Math.max(s,i.pushPop(u*u))}this.#e[t]=o,this.#r[t]=s}}return this.#o++,this.#n.tryWrite(),!0}};var te=class r{static newSet(e){return new tr(e,r.Comparator)}static compose=(e,...t)=>{let n=t.length===0?this.#t:new Int16Array(t);return N(n.every((i,o)=>i===t[o]),`fieldKeys (${n.join(",")}) only allows i16`),new r(e,n)};static decode(e){let t=e.split("/");return N(t.length>0,"Unable to parse Address"),r.compose(S.parse(t[0]),...t.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,n){let i=e.values(),o=pe.leftMostMapped(i,t,S.Comparator,n),s=i.length;if(o<0||o>=s)return null;for(let a=o;a<s;a++)if(S.Comparator(n(i[a]),t)!==0)return o<a?[o,a]:null;return[o,s]}static Comparator=(e,t)=>{let n=S.Comparator(e.#e,t.#e);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let s=e.#r[o]-t.#r[o];if(s!==0)return s}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let n=S.Comparator(e.#e,t.#e);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let s=e.#r[o]-t.#r[o];if(s!==0)return s}return 0};static LengthComparator=(e,t)=>{let n=S.Comparator(e.#e,t.#e);return n!==0?n:t.#r.length-e.#r.length};static#t=new Int16Array(0);#e;#r;constructor(e,t){this.#e=e,this.#r=t}get uuid(){return this.#e}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.#e,new Int16Array([...this.#r,e]))}startsWith(e){return S.Comparator(e.#e,this.#e)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,n)=>this.#r[n]===t)}write(e){e.writeBytes(new Int8Array(this.#e.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(e,this.#r)}decompose(){return[this.#e,this.#r]}toJSON(){return{uuid:Array.from(this.#e.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(S.length+this.#r.length);return e.set(this.#e,0),e.set(this.#r,S.length),e.buffer}toString(){return[S.toString(this.#e),...this.#r].join("/")}static read(e){let t=S.fromDataInput(e),n=e.readByte();return r.compose(t,...F.create(()=>e.readShort(),n))}},Hr;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>te.Comparator(e,t),r.equals=(e,t)=>{let[n,i]=pe.rangeMapped(t,e,te.Comparator,r.AddressReader);return t.slice(n,i+1)},r.startsWith=(e,t)=>{let[n,i]=pe.rangeMapped(t,e,te.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let n=pe.leftMostMapped(t,e,te.LengthComparator,r.AddressReader),i=pe.rightMostMapped(t,e,te.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>e.startsWith(o.address))}})(Hr||(Hr={}));var $t=class r{static validate(e,t){if(e.address.equals(t.address))return m.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(n=>n===e.pointerType)){let n=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return m.None}#t;#e;constructor(e){this.#t=e,this.#e=new Ie}subscribe(e,...t){return this.#r(this.#e,e,t)}catchupAndSubscribe(e,...t){let n=te.newSet(i=>i.address);return n.addMany(this.filter(...t)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{n.removeByKey(i.address),e.onRemoved(i)}},...t)}filter(...e){return e.length===0?this.incoming():xe.filter(this.incoming().values(),t=>e.some(n=>n===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#t.graph.edges().incomingEdgesOf(this.#t)}onAdded(e){let t=r.validate(e,this.#t);if(t.nonEmpty())return A(t.unwrap());this.#e.proxy.onAdded(e)}onRemoved(e){this.#e.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#t.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,t,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onRemoved(i)}})}};var rc=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},yi=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)}#t;#e;#r;#i;constructor({parent:e,fieldKey:t,fieldName:n,pointerRules:i}){this.#t=e,this.#e=t,this.#r=n,this.#i=i,i.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return w(e.visitField,this)}get box(){return this.#t.box}get graph(){return this.#t.graph}get parent(){return this.#t}get fieldKey(){return this.#e}get fieldName(){return this.#r}get pointerRules(){return this.#i}get pointerHub(){return new $t(this)}get address(){return this.#t.address.append(this.#e)}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 F.empty()}record(){return wt.empty()}getField(e){return A()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return A("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()}`}};rc([di,yi("design:type",$t),yi("design:paramtypes",[])],K.prototype,"pointerHub",null);rc([di,yi("design:type",te),yi("design:paramtypes",[])],K.prototype,"address",null);rc([di,yi("design:type",String),yi("design:paramtypes",[])],K.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,accepts:[]});var bi=class r extends K{static create(e,t,n){return new r(e,t,n)}#t;constructor(e,t,n){super(e),this.#t=F.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p}),n)}accept(e){return w(e.visitArrayField,this)}fields(){return this.#t}record(){return F.toRecord(this.#t,e=>String(e.fieldKey))}getField(e){return q(this.#t[e])}optField(e){return m.wrap(this.#t[e])}read(e){this.#t.forEach(t=>t.read(e))}write(e){this.#t.forEach(t=>t.write(e))}size(){return this.#t.length}toJSON(){return Object.values(this.#t).map(e=>e.toJSON()??null)}fromJSON(e){if(Array.isArray(e))e.forEach((t,n)=>this.#t[n].fromJSON(t));else return A("Type mismatch")}};var ar;(function(r){r.writeFields=(t,n)=>{let i=Object.entries(n);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([o,s])=>{let a=Se.create();s.write(a);let u=new Int8Array(a.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(u.length),t.writeBytes(u)})},r.readFields=(t,n)=>{N(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let o=0;o<i;o++){let s=t.readShort();if(zo(n[s]))continue;let a=t.readInt(),u=new Int8Array(a);t.readBytes(u);let{status:l,error:d}=Vr(()=>n[s]?.read(new _e(u.buffer)));l==="failure"&&console.warn(n,d)}}})(ar||(ar={}));var hx=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(i<3?s(o):i>3?s(e,t,o):s(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},tf=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},D=class r{static DEBUG_DELETION=!1;static Index=0;#t;#e;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:n,pointerRules:i}){this.#t=te.compose(e),this.#e=t,this.#r=n,this.#i=i,this.#n=this.initializeFields(),i.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return q(this.#n[e])}optField(e){return m.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.#e}get parent(){return this}get address(){return this.#t}get pointerRules(){return this.#i}get creationIndex(){return this.#o}get pointerHub(){return new $t(this)}estimateMemory(){let e=new ci;return this.write(e),e.count}isBox(){return!0}asBox(e){return st(this,e)}isField(){return!1}isAttached(){return this.#e.findBox(this.address.uuid).nonEmpty()}read(e){ar.readFields(e,this.#n)}write(e){ar.writeFields(e,this.#n)}serialize(){let e=Se.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=Se.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,n])=>{let i=n.toJSON();return O(i)&&(e[t]=i),e},{})}fromJSON(e){if(Qt(e))Object.entries(e).forEach(([t,n])=>{let i=this.#n[parseInt(t)];O(n)&&i.fromJSON(n)});else return A("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return F.empty();let n=this.getField(t[0]),i=[e(n)];for(let o=1;o<t.length;o++)n=n.getField(t[o]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return m.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return m.None;for(let n=1;n<e.length;n++)if(t=t.unwrap().optField(e[n]),t.isEmpty())return m.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(n=>n.toString()).join(`
2
2
  `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
3
- `),this));for(let n of t)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};Dv([ci,Pm("design:type",At),Pm("design:paramtypes",[])],k.prototype,"pointerHub",null);var oe;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(oe||(oe={}));var Yo;(function(r){r.create=()=>new Bl})(Yo||(Yo={}));var Bl=class{#t=new Fn(Hr.equals);#e=new Fn(Hr.startsWith);#r=new Fn(Hr.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,n){let i=new Ol(t,e,this.#n++,n);if(this.#o){let o=new Cl(i,e);return this.#i.push(o),o}else return this.subscribeMonitor(i,e)}dispatch(e){this.#o=!0,[...this.#t.filter(e),...this.#e.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#o=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case oe.This:return this.#t.subscribe(e);case oe.Parent:return this.#e.subscribe(e);case oe.Children:return this.#r.subscribe(e);default:return Bt(t)}}countStations(){return this.#t.count()+this.#e.count()+this.#r.count()}},Ol=class{address;propagation;order;procedure;constructor(e,t,n,i){this.address=e,this.propagation=t,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${oe[this.propagation]}, order: ${this.order} }`}},Fn=class{filterStrategy;#t=[];#e=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#t.push(e),this.#e=this.#t.length<2,{terminate:()=>{let t=this.#t.length;for(;--t>=0;)this.#t[t]===e&&this.#t.splice(t,1)}}}stations(){return this.#e||(this.#t.sort(Hr.Comparator),this.#e=!0),this.#t}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#t.length}},Cl=class{monitor;propagation;#t=new V;#e=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#e||(this.#t.terminate(),this.#t.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#e=!0,this.#t.terminate()}};var Se;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(Se||(Se={}));var Wr={[Se.Boolean]:{type:Se.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[Se.Float32]:{type:Se.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[Se.Int32]:{type:Se.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[Se.String]:{type:Se.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[Se.Bytes]:{type:Se.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Gr=class extends K{#t;#e;#r;constructor(e,t,n){super(e),this.#t=t,this.#e=this.clamp(n),this.#r=this.#e}accept(e){return A(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(oe.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#t}get initValue(){return this.#e}setInitValue(e){N(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#e=e)}getValue(){return this.#r}setValue(e){let t=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=e,this.graph.onPrimitiveValueUpdate(this,t,n))}writeValue(e,t){this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){let e=this.getValue();return ArrayBuffer.isView(e)?w("not implemented"):e}fromJSON(e){return w("Type mismatch")}reset(){this.setValue(this.#e)}},I=class r extends Gr{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,Se.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Wr[Se.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){e.writeBoolean(this.getValue())}fromJSON(e){typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString())}},F=class r extends Gr{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,Se.Float32,t)}serialization(){return Wr[Se.Float32]}equals(e){return this.getValue()===e}clamp(e){return Rt.toFloat32(e)}read(e){this.setValue(e.readFloat())}write(e){e.writeFloat(this.getValue())}fromJSON(e){typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString())}},S=class r extends Gr{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,Se.Int32,t)}serialization(){return Wr[Se.Int32]}equals(e){return this.getValue()===e}clamp(e){return je.toInt(e)}read(e){this.setValue(e.readInt())}write(e){e.writeInt(this.getValue())}fromJSON(e){typeof e=="number"&&e===Math.floor(e)&&e>=je.MIN_VALUE&&e<=je.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString())}},D=class r extends Gr{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,Se.String,t)}serialization(){return Wr[Se.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){e.writeString(this.getValue())}fromJSON(e){typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString())}},_m=class r extends Gr{static create(e,t=this.#t){return new r(e,t)}static#t=Object.freeze(new Int8Array(0));constructor(e,t){super(e,Se.Bytes,t)}serialization(){return Wr[Se.Bytes]}equals(e){return this.getValue().length===e.length&&this.getValue().every((t,n)=>e[n]===t)}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){return Array.from(this.getValue().values())}fromJSON(e){Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString())}};var km;(function(r){r.decode=e=>{let t=e.readInt();return P.create(()=>{switch(e.readString()){case"new":{let i=E.fromDataInput(e),o=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Bn(i,o,s.buffer)}case"pointer":{let i=X.read(e),o=e.readBoolean()?m.wrap(X.read(e)):m.None,s=e.readBoolean()?m.wrap(X.read(e)):m.None;return new Cn(i,o,s)}case"primitive":{let i=X.read(e),o=e.readString(),s=Wr[o],a=s.decode(e),u=s.decode(e);return new On(i,s,a,u)}case"delete":{let i=E.fromDataInput(e),o=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Dn(i,o,s.buffer)}}},t)}})(km||(km={}));var Bn=class{type="new";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get uuid(){return this.#t}get name(){return this.#e}get settings(){return this.#r}forward(e){e.createBox(this.#e,this.#t,t=>t.read(new Pe(this.#r)))}inverse(e){e.findBox(this.#t).unwrap(()=>`Could not find ${this.#e}`).unstage()}write(e){e.writeString(this.type),E.toDataOutput(e,this.#t),e.writeString(this.#e),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${E.toString(this.#t)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},On=class{type="primitive";#t;#e;#r;#i;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#r=n,this.#i=i}get address(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#t).unwrap(()=>`Could not find PrimitiveField at ${this.#t}`)}write(e){e.writeString(this.type),this.#t.write(e),e.writeString(this.#e.type),this.#e.encode(e,this.#r),this.#e.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},Cn=class{type="pointer";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get address(){return this.#t}get oldAddress(){return this.#e}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#e}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#t).unwrap(()=>`Could not find PointerField at ${this.#t}`)}write(e){e.writeString(this.type),this.#t.write(e),this.#e.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.#e.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},Dn=class{type="delete";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get uuid(){return this.#t}get name(){return this.#e}get settings(){return this.#r}forward(e){e.findBox(this.#t).unwrap(()=>`Could not find ${this.#e}`).unstage()}inverse(e){e.createBox(this.#e,this.#t,t=>t.read(new Pe(this.#r)))}write(e){e.writeString(this.type),E.toDataOutput(e,this.#t),e.writeString(this.#e),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${E.toString(this.#t)}, attachment: ${this.settings.byteLength}b`}};var jE=Symbol("Unreferenceable"),_=class r extends K{static create(e,t,n){return new r(e,t,n)}static encodeWith(e,t){N(this.#t.isEmpty(),"SerializationEncoder already in use"),this.#t=m.wrap(e);let n=Vr(t);if(this.#t=m.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,t){N(this.#e.isEmpty(),"SerializationDecoder already in use"),this.#e=m.wrap(e);let n=Vr(t);if(this.#e=m.None,n.status==="failure")throw n.error;return n.value}static#t=m.None;static#e=m.None;#r;#i;#n=m.None;#o=m.None;constructor(e,t,n){super(e),this.#r=t,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return w(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return A(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(oe.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.graph.subscribeVertexUpdates(oe.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}refer(e){this.targetVertex=m.wrap(e)}defer(){this.targetVertex=m.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=At.validate(this,e.unwrap());t.nonEmpty()&&w(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()}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?m.wrap(X.read(e)):m.None;this.targetAddress=r.#e.match({none:()=>t,some:n=>n.map(this,t)})}write(e){r.#t.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){return r.#t.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(Tr(e)||typeof e=="string"){let t=m.wrap(Tr(e)?null:X.decode(e));this.targetAddress=r.#e.match({none:()=>t,some:n=>n.map(this,t)})}else return w(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var Xo=class{#t;#e;#r;#i;constructor(){this.#t=X.newSet(e=>e.address),this.#e=X.newSet(e=>e.address),this.#r=X.newSet(([e])=>e),this.#i=X.newSet(([e])=>e.address)}watchVertex(e){if(fe(e,_)){if(!e.mandatory)return w("watchVertex called but has no edge requirement");this.#t.add(e)}else{if(!e.pointerRules.mandatory)return w("watchVertex called but has no edge requirement");this.#e.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#o(this.#t,n,t),this.#o(this.#e,n,t);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return w(`${n} has outgoing edges: ${i.map(([s,a])=>`[${s.toString()}, ${a.toString()}]`)}`);let o=this.incomingEdgesOf(n);if(o.length>0)return w(`${n} has incoming edges from: ${o.map(s=>s.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,n])=>n.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,n]=this.#r.get(t);P.remove(n,e),n.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,n])=>n.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,n])=>n):this.#r.opt(e.address).mapOr(([t,n])=>n,P.empty())}validateRequirements(){this.#t.forEach(e=>{if(N(e.isAttached(),`Pointer ${e.address.toString()} is not attached`),e.isEmpty())return e.mandatory?w(`Pointer ${e.toString()} requires an edge.`):w(`Illegal state: ${e} has no edge requirements.`)}),this.#e.forEach(e=>{if(N(e.isAttached(),`Target ${e.address.toString()} is not attached`),e.pointerHub.isEmpty())return e.pointerRules.mandatory?w(`Target ${e.toString()} requires an edge.`):w(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,n){let i=X.boxRange(e,t,n);return z(i)?e.values().slice(i[0],i[1]):P.empty()}#o(e,t,n){let i=X.boxRange(e,t,n);z(i)&&e.removeRange(i[0],i[1])}};var Qo=class{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c=!1;#d=!1;constructor(e=m.None){this.#t=e,this.#e=E.newSet(t=>t.address.uuid),this.#r=[],this.#s=Yo.create(),this.#i=new Ce,this.#n=new Ce,this.#o=new Ce,this.#a=new Xo,this.#u=X.newSet(({pointer:t})=>t.address),this.#l=[]}beginTransaction(){N(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(N(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#h(e,t)),this.#r.length=0),this.#u.forEach(({pointer:e,initial:t,final:n})=>{t.equals(n)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#u.clear(),this.#c=!1;this.#l.length>0;)this.#l.splice(0).forEach(e=>e()),this.#l.length>0&&console.debug(`${this.#l.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,n){return this.#t.unwrap("No box-factory installed")(e,this,t,n)}stageBox(e,t){this.#p(),N(!this.#d,"Cannot construct box while other box is constructing"),z(t)&&(this.#d=!0,t(e),this.#d=!1);let n=this.#e.add(e);N(n,`${e} already staged`);let i=new Bn(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,n){return this.#s.subscribe(e,t,n)}subscribeEndTransaction(e){this.#l.push(e)}unstageBox(e){this.#p();let t=this.#e.removeByKey(e.address.uuid);N(t===e,`${e} could not be found to unstage`),this.#a.unwatchVerticesOf(e);let n=new Dn(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}findBox(e){return this.#e.opt(e)}findVertex(e){return this.#e.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#e.values()}edges(){return this.#a}checksum(){let e=new Ro;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,n){if(this.#p(),e.isAttached()&&!this.#d){let i=new On(e.address,e.serialization(),t,n);this.#s.dispatch(i),this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,n){this.#p(),t.nonEmpty()&&this.#a.disconnect(e),n.nonEmpty()&&this.#a.connect(e,n.unwrap());let i=new Cn(e.address,t,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#h(e,i),this.#n.proxy.onUpdate(i))}#h(e,t){let{oldAddress:n,newAddress:i}=t;e.resolvedTo(i.flatMap(s=>this.findVertex(s))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i}),some:s=>s.final=i}),this.#s.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e){let t=new Set,n=new Set,i=o=>{t.has(o)||(t.add(o),o.outgoingEdges().filter(([s])=>!n.has(s)).forEach(([s,a])=>{let u=this.findVertex(a).unwrap(`Could not find target of ${s.toString()}`);if(n.add(s),u.pointerRules.mandatory&&u.pointerHub.incoming().every(l=>n.has(l)))return i(u.box)}),o.incomingEdges().forEach(s=>{n.add(s),s.mandatory&&i(s.box)}))};return i(e),t.delete(e),{boxes:t,pointers:Array.from(n).reverse()}}verifyPointers(){this.#a.validateRequirements();let e=0,t=n=>{for(let i of n.fields())i.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let s=o.targetVertex.nonEmpty(),a=this.findVertex(o.targetAddress.unwrap()).nonEmpty();N(s,`pointer ${o.address} is broken`),N(a,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#e.forEach(n=>t(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#e.values().reduce((e,t)=>(e[E.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(n=>n.name):this.findBox(t.uuid).flatMap(n=>n.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:w("Unknown address"))))}toArrayBuffer(){let e=Ee.create(),t=this.#e.values();return e.writeInt(t.length),t.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){N(this.#e.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new Pe(e),n=t.readInt();this.beginTransaction();let i=[];for(let o=0;o<n;o++){let s=t.readInt(),a=new Int8Array(s);t.readBytes(a);let u=new Pe(a.buffer),l=u.readInt(),d=u.readString(),h=E.fromDataInput(u);i.push({creationIndex:l,name:d,uuid:h,boxStream:u})}i.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:a})=>this.createBox(o,s,u=>u.read(a))),this.endTransaction()}toJSON(){return this.#e.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:H(e.toJSON())}))}#p(){N(this.#c,()=>"Modification only prohibited in transaction mode.")}};var Im;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let n=r.collectIndexedBoxes(e),i=G(t,0,n.length);if(i<n.length)for(let o=i;o<n.length;o++)n[o].index.setValue(o+1);return i},r.removeOrder=(e,t)=>{let n=r.collectIndexedBoxes(e);if(t<n.length)for(let i=t+1;i<n.length;i++)n[i].index.setValue(i-1)},r.moveIndex=(e,t,n)=>{let i=r.collectIndexedBoxes(e),o=i[t];if(n<0){let s=G(t+n,0,i.length-1);for(let a=s;a<t;a++)i[a].index.setValue(a+1);o.index.setValue(s)}else if(n>1){let s=G(t+(n-1),0,i.length-1);for(let a=t;a<s;a++)i[a+1].index.setValue(a);o.index.setValue(s)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${n}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof S,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:n})=>r.isIndexedBox(n)&&(t===void 0||n instanceof t)?n:w(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(Im||(Im={}));var xe=class extends K{#t;constructor(e){super(e),this.#t=this.initializeFields()}accept(e){return A(e.visitObjectField,this)}fields(){return Object.values(this.#t)}record(){return this.#t}getField(e){return H(this.#t[e])}optField(e){return m.wrap(this.#t[e])}read(e){ar.readFields(e,this.#t)}write(e){ar.writeFields(e,this.#t)}toJSON(){return Object.entries(this.#t).reduce((e,[t,n])=>(e[t]=n.toJSON(),e),{})}fromJSON(e){if(Yt(e))Object.entries(e).forEach(([t,n])=>{let i=this.#t[parseInt(t)];z(n)&&i.fromJSON(n)});else return w("Type mismatch")}};var qe;(function(r){r.sender=(n,i)=>i(new e(n)),r.executor=(n,i)=>new t(n,i);class e{#t;#e=new Map;#r;#i=0;constructor(i){this.#t=i,this.#r=i.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(i,...o)=>this.#t.send({type:"send",returnId:!1,func:i.name,args:Array.from(ve.map(o,s=>({value:s})))});dispatchAndReturn=(i,...o)=>new Promise((s,a)=>{let u=ve.reduce(o,(l,d,h)=>(typeof d=="function"&&l.push([h,d]),l),[]);this.#e.set(this.#i,{executorTuple:{resolve:s,reject:a},callbacks:new Map(u)}),this.#t.send({type:"send",returnId:this.#i,func:i.name,args:Array.from(ve.map(o,(l,d)=>typeof l=="function"?{callback:d}:{value:l}))}),this.#i++});#n=i=>{let o=this.#e.get(i.returnId);z(o)?i.type==="resolve"?(o.executorTuple.resolve(i.resolve),this.#e.delete(i.returnId)):i.type==="reject"?(o.executorTuple.reject(i.reject),this.#e.delete(i.returnId)):i.type==="callback"&&o.callbacks?.get(i.funcAt).apply(this,i.args):w(`Promise has already been resolved. ${JSON.stringify(i)}`)}}class t{#t;#e;#r;constructor(i,o){this.#t=i,this.#e=o,this.#r=i.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=i=>{N(i.type==="send",()=>"Message type must be 'send'");let o=Object.getPrototypeOf(this.#e)===Object.getPrototypeOf({})?this.#e:Object.getPrototypeOf(this.#e),s=H(o[i.func],`${i.func.toString()} does not exists on ${this.#e}`),a=i.returnId;if(a===!1)s.apply(this.#e,i.args.map(u=>"value"in u?u.value:w(`${i.func.toString()} has no promise.`)));else try{s.apply(this.#e,i.args.map(l=>"callback"in l?(...d)=>this.#s(a,l.callback,d):l.value)).then(l=>this.#n(a,l),l=>this.#o(a,l))}catch(u){this.#o(a,u)}};#n=(i,o)=>this.#t.send({type:"resolve",returnId:i,resolve:o});#o=(i,o)=>this.#t.send({type:"reject",returnId:i,reject:o});#s=(i,o,s)=>this.#t.send({type:"callback",returnId:i,funcAt:o,args:s})}r.Executor=t})(qe||(qe={}));var Fm;(function(r){r.ProgressArrayBuffer=e=>async t=>{if(!t.headers.has("Content-Length"))return console.debug("No Content-Length"),t.arrayBuffer();let n=parseInt(t.headers.get("Content-Length"));if(console.debug(`Content-Length: ${n}b`),isNaN(n)||n<4096)return t.arrayBuffer();e(0);let i=Ee.create(n),o=H(t.body,"response.body is empty").getReader();for(;;){let{done:s,value:a}=await o.read();if(s)break;a.forEach(u=>i.writeByte(u)),e(i.position/n)}return e(1),i.toArrayBuffer()}})(Fm||(Fm={}));var Bm;(function(r){r.debounce=(()=>{let e;return(t,n=1e3)=>{clearTimeout(e),e=setTimeout(t,n)}})(),r.scheduleInterval=(e,t,...n)=>{let i=setInterval(e,t,...n);return{terminate:()=>clearInterval(i)}},r.scheduleTimeout=(e,t,...n)=>{let i=setTimeout(e,t,...n);return{terminate:()=>clearTimeout(i)}}})(Bm||(Bm={}));var Om={for:r=>new Dl(r)},Dl=class{#t;#e=new W;constructor(e){if(this.#t=e,z(e.onmessage)||z(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#e.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e){this.#t.postMessage(e)}channel(e){return new Rl(this,e)}subscribe(e){return this.#e.subscribe(e)}terminate(){this.#e.terminate(),this.#t.onmessage=null,this.#t.onmessageerror=null}},Rl=class r{#t;#e;#r=new W;#i;constructor(e,t){this.#t=e,this.#e=t,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===t&&this.#r.notify(n.message)})}send(e){this.#t.send({__id__:"42",channel:this.#e,message:e})}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var es;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let n=e,i=()=>{--n<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(n=>setTimeout(n,e.millis(),...t)),r.event=(e,t)=>new Promise(n=>e.addEventListener(t,n,{once:!0})),r.observable=e=>new Promise(t=>{let n=e.subscribe(()=>{n.terminate(),t()})}),r.complete=e=>new Promise((t,n)=>{let i=setInterval(()=>{let{status:o,value:s,error:a}=Vr(()=>e.next());if(o==="success"){let{done:u,value:l}=s;u&&(clearInterval(i),t(l))}else clearInterval(i),n(a)},0)})})(es||(es={}));var zl=class{maxRetry;timeSpan;#t=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#t===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},ur;(function(r){class e{value;status="resolved";constructor(a){this.value=a}error=$n("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(a){this.error=a}value=$n("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(s,a)=>{let u=!0;return s.own(Z.create(()=>u=!1)),new Promise((l,d)=>a.then(h=>{u&&l(h)},h=>{u&&d(h)}))},r.tryCatch=s=>s.then(a=>new e(a),a=>new t(a));let n=new zl(3,tr.seconds(3));r.retry=(s,a=n)=>s().catch(u=>new Promise((l,d)=>{let h=f=>{a.retry(f,()=>s().then(v=>l(v),h))||d(f)};h(u)})),r.guardedRetry=(s,a)=>{let u=async(l=0)=>{try{return await s()}catch(d){if(a(d,++l))return await es.timeSpan(tr.seconds(1)),u(l);throw d}};return u()},r.approvedRetry=(s,a)=>{let u=async()=>{try{return await s()}catch(l){if(await xm.approve(a(l)))return u();throw l}};return u()},r.fail=(s,a)=>{let u=()=>new Promise((l,d)=>setTimeout(()=>d("fails first"),s.millis()));return()=>{let l=u();return u=a,l}},r.timeout=(s,a,u)=>new Promise((l,d)=>{let h=!0,f=setTimeout(()=>{h=!1,d(new Error(u??"timeout"))},a.millis());s.then(v=>{h&&l(v)},v=>{h&&d(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=s=>s.reduce((a,u)=>a.then(async l=>[...l,await u()]),Promise.resolve([])),r.sequentialize=s=>{let a=Promise.resolve();return u=>{let l=()=>s(u),d=a.then(l,l);return a=d.catch(()=>{}),d}},r.memoizeAsync=(s,a)=>{let u=null,l=Date.now();return()=>{let d=Date.now();return(Tr(u)||z(a)&&d-l>a.millis())&&(l=d,u=s(),u.catch(h=>(u=null,h))),u}},r.allWithLimit=async(s,a=1)=>{let u=new Array(s.length),l=0,d=!1,h=async()=>{for(;l<s.length&&!d;){let f=l++;try{let v=await s[f]();d||(u[f]=v)}catch(v){throw d=!0,v}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},h)),u},r.allSettledWithLimit=async(s,a=1)=>{let u=new Array(s.length),l=0,d=async()=>{for(;l<s.length;){let h=l++;try{let f=await s[h]();u[h]={status:"fulfilled",value:f}}catch(f){u[h]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},d)),u};class i{max;#t;#e=0;constructor(a=1){this.max=a,this.#t=[]}async add(a){if(this.#e<this.max)return this.#e++,a().finally(()=>this.#r());{let u=Promise.withResolvers();return this.#t.push([a,u]),u.promise.finally(()=>this.#r())}}#r(){if(N(this.#e>0,"Internal Error in Promises.Limit"),--this.#e<this.max&&this.#t.length>0){let[a,{resolve:u,reject:l}]=this.#t.shift();this.#e++,a().then(u,l)}}}r.Limit=i;class o{#t;#e;#r;#i=m.None;constructor(a,u,l){this.#t=a,this.#e=u,this.#r=l}update(a){this.#i=m.wrap(a),a.then(u=>{this.#i.contains(a)&&this.#t(u)}).catch(u=>{this.#i.contains(a)&&this.#e(u)}).finally(()=>{this.#i.contains(a)&&(this.terminate(),A(this.#r))})}terminate(){this.#i=m.None}}r.Latest=o})(ur||(ur={}));var Cm;(function(r){let e=new ur.Limit(4);r.limitFetch=(t,n)=>e.add(()=>fetch(t,n)),r.DefaultRetry=(t,n)=>!fe(t,Uo.FileNotFound)||n<=100})(Cm||(Cm={}));var Dm=(r="debug")=>{let e=performance.now();return{lab:t=>console[r].call(console,`${t} in ${(performance.now()-e).toFixed(1)}ms`)}};var Rm;(function(r){r.startEstimator=()=>{let e=performance.now();return t=>{if(t===0)return tr.POSITIVE_INFINITY;let n=performance.now()-e;return tr.millis(n/t-n)}}})(Rm||(Rm={}));var ts=Symbol.for("@openDAW/lib-runtime");globalThis[ts]?console.debug(`%c${ts.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ts]=!0,console.debug(`%c${ts.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var zm=(r,e)=>qe.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(n=>{let i=n.type;i==="new"?r.createBox(n.name,n.uuid,o=>o.read(new Pe(n.buffer))):i==="update-primitive"?r.findVertex(X.reconstruct(n.address)).unwrap(()=>`Could not find primitive field ${n.address}`).setValue(n.value):i==="update-pointer"?r.findVertex(X.reconstruct(n.address)).unwrap(()=>`Could not find pointer field ${n.address}`).targetAddress=z(n.target)?m.wrap(X.reconstruct(n.target)):m.None:n.type==="delete"&&r.unstageBox(r.findBox(n.uuid).unwrap(()=>`Could not find box ${E.toString(n.uuid)}`))}),r.endTransaction()}checksum(t){return P.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var rs=Symbol.for("@openDAW/lib-box");globalThis[rs]?console.debug(`%c${rs.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[rs]=!0,console.debug(`%c${rs.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var is=class{#t=0;#e=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#t}set position(e){this.#t=e,this.#r=!0}get transporting(){return this.#e}set transporting(e){this.#e!==e&&(this.#e=e)}pause(){this.#e=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#t=e}};var c;(function(r){r[r.Timeline=0]="Timeline",r[r.Selection=1]="Selection",r[r.PianoMode=2]="PianoMode",r[r.User=3]="User",r[r.AudioConnection=4]="AudioConnection",r[r.InstrumentHost=5]="InstrumentHost",r[r.AudioOutput=6]="AudioOutput",r[r.Capture=7]="Capture",r[r.NotesConnection=8]="NotesConnection",r[r.VoltageConnection=9]="VoltageConnection",r[r.AudioUnits=10]="AudioUnits",r[r.MidiEffectHost=11]="MidiEffectHost",r[r.AudioEffectHost=12]="AudioEffectHost",r[r.AudioBusses=13]="AudioBusses",r[r.AuxSend=14]="AuxSend",r[r.Modulation=15]="Modulation",r[r.Automation=16]="Automation",r[r.ParameterController=17]="ParameterController",r[r.MidiControl=18]="MidiControl",r[r.StepAutomation=19]="StepAutomation",r[r.Editing=20]="Editing",r[r.AudioFile=21]="AudioFile",r[r.SoundfontFile=22]="SoundfontFile",r[r.AudioUnit=23]="AudioUnit",r[r.MarkerTrack=24]="MarkerTrack",r[r.MarkerEvents=25]="MarkerEvents",r[r.ClipCollection=26]="ClipCollection",r[r.RegionCollection=27]="RegionCollection",r[r.TrackCollection=28]="TrackCollection",r[r.Device=29]="Device",r[r.Groove=30]="Groove",r[r.ModularSetup=31]="ModularSetup",r[r.ModuleCollection=32]="ModuleCollection",r[r.ConnectionCollection=33]="ConnectionCollection",r[r.DeviceUserInterface=34]="DeviceUserInterface",r[r.NoteEvents=35]="NoteEvents",r[r.NoteEventFeature=36]="NoteEventFeature",r[r.NoteEventCollection=37]="NoteEventCollection",r[r.ValueEvents=38]="ValueEvents",r[r.ValueEventCollection=39]="ValueEventCollection",r[r.ValueInterpolation=40]="ValueInterpolation",r[r.Sample=41]="Sample"})(c||(c={}));var Tm;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(Tm||(Tm={}));var Mm;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(Mm||(Mm={}));var Jr;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Jr||(Jr={}));var Um=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?w(`Indices cannot be equal (${r}, ${e})`):t};var Te=class r{static create(e,t,n){return new r(e,t,n)}#t;#e;#r;#i;#n=null;constructor(e,t,n){this.#t=e,this.#e=E.newSet(i=>i.adapter.uuid),this.#r=new Ce,this.#i=e.pointerHub.catchupAndSubscribe({onAdd:i=>{this.#n=null;let o=t(i.box),s=o.indexField.subscribe(()=>{this.#n=null,this.#r.proxy.onReorder(o)}),a=this.#e.add({adapter:o,subscription:s});N(a,`Could not add ${o}`),this.#r.proxy.onAdd(o)},onRemove:i=>{this.#n=null;let o=i.box.address.uuid,{adapter:s,subscription:a}=this.#e.removeByKey(o);a.terminate(),this.#r.proxy.onRemove(s)}},n)}field(){return this.#t}subscribe(e){return this.#r.subscribe(e)}catchupAndSubscribe(e){return this.#e.forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=pe.exactMapped(this.adapters(),e,Um,n=>n.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return this.#e.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 this.#n===null&&(this.#n=this.#e.values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue())),this.#n}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let n=this.adapters(),i=n[e];if(t<0){let o=G(e+t,0,n.length-1);for(let s=o;s<e;s++)n[s].indexField.setValue(s+1);i.indexField.setValue(o)}else if(t>1){let o=G(e+(t-1),0,n.length-1);for(let s=e;s<o;s++)n[s+1].indexField.setValue(s);i.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return this.#e.size()}isEmpty(){return this.size()===0}terminate(){this.#n=null,this.#e.forEach(({subscription:e})=>e.terminate()),this.#e.clear(),this.#r.terminate(),this.#i.terminate()}};var ns;(function(r){r.create=(e,t,n,i)=>{switch(e){case"RootBox":return bi.create(t,n,i);case"SelectionBox":return Rn.create(t,n,i);case"UserInterfaceBox":return os.create(t,n,i);case"TimelineBox":return ss.create(t,n,i);case"TrackBox":return wi.create(t,n,i);case"NoteEventBox":return lr.create(t,n,i);case"NoteEventRepeatBox":return as.create(t,n,i);case"NoteEventCollectionBox":return Ut.create(t,n,i);case"NoteRegionBox":return Yr.create(t,n,i);case"NoteClipBox":return Ai.create(t,n,i);case"ValueEventBox":return cr.create(t,n,i);case"ValueEventCollectionBox":return Vt.create(t,n,i);case"ValueEventCurveBox":return dr.create(t,n,i);case"ValueRegionBox":return Xr.create(t,n,i);case"ValueClipBox":return $i.create(t,n,i);case"AudioRegionBox":return Ei.create(t,n,i);case"AudioClipBox":return Si.create(t,n,i);case"MarkerBox":return Ni.create(t,n,i);case"AudioFileBox":return us.create(t,n,i);case"SoundfontFileBox":return ls.create(t,n,i);case"AudioUnitBox":return xt.create(t,n,i);case"CaptureAudioBox":return cs.create(t,n,i);case"CaptureMidiBox":return ds.create(t,n,i);case"AudioBusBox":return Pi.create(t,n,i);case"AuxSendBox":return hs.create(t,n,i);case"StepAutomationBox":return ps.create(t,n,i);case"GrooveShuffleBox":return ms.create(t,n,i);case"UnknownAudioEffectDeviceBox":return fs.create(t,n,i);case"UnknownMidiEffectDeviceBox":return gs.create(t,n,i);case"DeviceInterfaceKnobBox":return vs.create(t,n,i);case"ModularDeviceBox":return xs.create(t,n,i);case"DeviceClashBox":return ys.create(t,n,i);case"StereoToolDeviceBox":return bs.create(t,n,i);case"DelayDeviceBox":return ws.create(t,n,i);case"RevampDeviceBox":return As.create(t,n,i);case"ReverbDeviceBox":return $s.create(t,n,i);case"VaporisateurDeviceBox":return Es.create(t,n,i);case"SoundfontDeviceBox":return Ss.create(t,n,i);case"NanoDeviceBox":return Ns.create(t,n,i);case"PlayfieldDeviceBox":return Ps.create(t,n,i);case"PlayfieldSampleBox":return _i.create(t,n,i);case"TapeDeviceBox":return _s.create(t,n,i);case"ArpeggioDeviceBox":return ks.create(t,n,i);case"PitchDeviceBox":return Is.create(t,n,i);case"ZeitgeistDeviceBox":return Fs.create(t,n,i);case"ModularBox":return Bs.create(t,n,i);case"ModuleConnectionBox":return Os.create(t,n,i);case"ModularAudioInputBox":return Cs.create(t,n,i);case"ModularAudioOutputBox":return Ds.create(t,n,i);case"ModuleDelayBox":return Rs.create(t,n,i);case"ModuleMultiplierBox":return zs.create(t,n,i);case"ModuleGainBox":return Ts.create(t,n,i);default:return w(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let n=new Pe(t),i=n.readString(),o=E.fromDataInput(n),s=r.create(i,e,o);return s.read(n),s}})(ns||(ns={}));var Ms=class r extends xe{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:S.create({parent:this,fieldKey:1,fieldName:"keyboard",pointerRules:p},0),2:F.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",pointerRules:p},8),3:F.create({parent:this,fieldKey:3,fieldName:"noteScale",pointerRules:p},1.5),4:I.create({parent:this,fieldKey:4,fieldName:"noteLabels",pointerRules:p},!0),5:S.create({parent:this,fieldKey:5,fieldName:"transpose",pointerRules:p},0)}}};var bi=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:p}),n)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return A(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 pianoMode(){return this.getField(40)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"timeline",pointerRules:p},c.Timeline,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"users",pointerRules:{accepts:[c.User],mandatory:!0}}),3:D.create({parent:this,fieldKey:3,fieldName:"created",pointerRules:p}),4:_.create({parent:this,fieldKey:4,fieldName:"groove",pointerRules:p},c.Groove,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"modularSetups",pointerRules:{accepts:[c.ModularSetup],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"audioUnits",pointerRules:{accepts:[c.AudioUnits],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"audioBusses",pointerRules:{accepts:[c.AudioBusses],mandatory:!1}}),30:K.hook({parent:this,fieldKey:30,fieldName:"outputDevice",pointerRules:{accepts:[c.AudioOutput],mandatory:!0}}),40:Ms.create({parent:this,fieldKey:40,fieldName:"pianoMode",pointerRules:p}),111:_.create({parent:this,fieldKey:111,fieldName:"editingChannel",pointerRules:p},c.Editing,!1)}}};var Rn=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:p}),n)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return A(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"selection",pointerRules:p},c.Selection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"selectable",pointerRules:p},c.Selection,!0)}}};var os=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:p}),n)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return A(e.visitUserInterfaceBox,this)}get root(){return this.getField(1)}get selection(){return this.getField(10)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"root",pointerRules:p},c.User,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"selection",pointerRules:{accepts:[c.Selection],mandatory:!1}}),21:_.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",pointerRules:p},c.Editing,!1),22:_.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",pointerRules:p},c.Editing,!1),23:_.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",pointerRules:p},c.Editing,!1)}}};var Us=class r extends xe{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:S.create({parent:this,fieldKey:1,fieldName:"nominator",pointerRules:p},4),2:S.create({parent:this,fieldKey:2,fieldName:"denominator",pointerRules:p},4)}}};var Vs=class r extends xe{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",pointerRules:p},!0),2:S.create({parent:this,fieldKey:2,fieldName:"from",pointerRules:p},0),3:S.create({parent:this,fieldKey:3,fieldName:"to",pointerRules:p},15360)}}};var js=class r extends xe{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",pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),10:S.create({parent:this,fieldKey:10,fieldName:"index",pointerRules:p}),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",pointerRules:p},!0)}}};var ss=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:p}),n)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return A(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",pointerRules:{accepts:[c.Timeline],mandatory:!0}}),10:Us.create({parent:this,fieldKey:10,fieldName:"signature",pointerRules:p}),11:Vs.create({parent:this,fieldKey:11,fieldName:"loopArea",pointerRules:p}),20:K.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),21:js.create({parent:this,fieldKey:21,fieldName:"markerTrack",pointerRules:p}),30:S.create({parent:this,fieldKey:30,fieldName:"durationInPulses",pointerRules:p},491520),31:F.create({parent:this,fieldKey:31,fieldName:"bpm",pointerRules:p},120)}}};var wi=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode],mandatory:!1}}),n)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"tracks",pointerRules:p},c.TrackCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"target",pointerRules:p},c.Automation,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"regions",pointerRules:{accepts:[c.RegionCollection],mandatory:!1}}),4:K.hook({parent:this,fieldKey:4,fieldName:"clips",pointerRules:{accepts:[c.ClipCollection],mandatory:!1}}),10:S.create({parent:this,fieldKey:10,fieldName:"index",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"type",pointerRules:p}),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",pointerRules:p},!0),30:I.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",pointerRules:p},!1)}}};var lr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.NoteEventFeature],mandatory:!1}}),n)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"events",pointerRules:p},c.NoteEvents,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p},240),20:S.create({parent:this,fieldKey:20,fieldName:"pitch",pointerRules:p},60),21:F.create({parent:this,fieldKey:21,fieldName:"velocity",pointerRules:p},.7874015748031497),22:S.create({parent:this,fieldKey:22,fieldName:"playCount",pointerRules:p},1),23:F.create({parent:this,fieldKey:23,fieldName:"playCurve",pointerRules:p},0),24:F.create({parent:this,fieldKey:24,fieldName:"cent",pointerRules:p},0),25:S.create({parent:this,fieldKey:25,fieldName:"chance",pointerRules:p},100)}}};var as=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:p}),n)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"event",pointerRules:p},c.NoteEventFeature,!0),2:S.create({parent:this,fieldKey:2,fieldName:"count",pointerRules:p},1),3:F.create({parent:this,fieldKey:3,fieldName:"curve",pointerRules:p},0),4:F.create({parent:this,fieldKey:4,fieldName:"length",pointerRules:p},1)}}};var Ut=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return A(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",pointerRules:{accepts:[c.NoteEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0}})}}};var Yr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.NoteEventCollection,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:S.create({parent:this,fieldKey:14,fieldName:"eventOffset",pointerRules:p}),15:I.create({parent:this,fieldKey:15,fieldName:"mute",pointerRules:p}),16:D.create({parent:this,fieldKey:16,fieldName:"label",pointerRules:p}),17:S.create({parent:this,fieldKey:17,fieldName:"hue",pointerRules:p})}}};var hr=class r extends xe{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:I.create({parent:this,fieldKey:1,fieldName:"loop",pointerRules:p},!0),2:I.create({parent:this,fieldKey:2,fieldName:"reverse",pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"mute",pointerRules:p}),4:S.create({parent:this,fieldKey:4,fieldName:"speed",pointerRules:p}),5:S.create({parent:this,fieldKey:5,fieldName:"quantise",pointerRules:p}),6:S.create({parent:this,fieldKey:6,fieldName:"trigger",pointerRules:p})}}};var Ai=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return A(e.visitNoteClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.NoteEventCollection,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:hr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:S.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:I.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:D.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p})}}};var cr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"events",pointerRules:p},c.ValueEvents,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"index",pointerRules:p}),12:S.create({parent:this,fieldKey:12,fieldName:"interpolation",pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1}},1),13:F.create({parent:this,fieldKey:13,fieldName:"value",pointerRules:p}),14:F.create({parent:this,fieldKey:14,fieldName:"slope",pointerRules:p})}}};var Vt=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return A(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",pointerRules:{accepts:[c.ValueEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0}})}}};var dr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:p}),n)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return A(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"event",pointerRules:p},c.ValueInterpolation,!0),2:F.create({parent:this,fieldKey:2,fieldName:"slope",pointerRules:p},.5)}}};var Xr=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.ValueEventCollection,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:I.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:p}),15:D.create({parent:this,fieldKey:15,fieldName:"label",pointerRules:p}),16:S.create({parent:this,fieldKey:16,fieldName:"hue",pointerRules:p})}}};var $i=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return A(e.visitValueClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.ValueEventCollection,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:hr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:S.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:I.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:D.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p})}}};var Ei=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return A(e.visitAudioRegionBox,this)}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"file",pointerRules:p},c.AudioFile,!0),3:D.create({parent:this,fieldKey:3,fieldName:"playback",pointerRules:p},"pitch"),10:S.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:S.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:I.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:p}),15:D.create({parent:this,fieldKey:15,fieldName:"label",pointerRules:p}),16:S.create({parent:this,fieldKey:16,fieldName:"hue",pointerRules:p}),17:F.create({parent:this,fieldKey:17,fieldName:"gain",pointerRules:p})}}};var Si=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return A(e.visitAudioClipBox,this)}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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)}get gain(){return this.getField(14)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"file",pointerRules:p},c.AudioFile,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:hr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:S.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:I.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:D.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p}),14:F.create({parent:this,fieldKey:14,fieldName:"gain",pointerRules:p})}}};var Ni=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"track",pointerRules:p},c.MarkerTrack,!0),2:S.create({parent:this,fieldKey:2,fieldName:"position",pointerRules:p}),3:S.create({parent:this,fieldKey:3,fieldName:"plays",pointerRules:p},1),4:D.create({parent:this,fieldKey:4,fieldName:"label",pointerRules:p}),5:S.create({parent:this,fieldKey:5,fieldName:"hue",pointerRules:p})}}};var us=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile],mandatory:!0}}),n)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return A(e.visitAudioFileBox,this)}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}initializeFields(){return{1:S.create({parent:this,fieldKey:1,fieldName:"startInSeconds",pointerRules:p}),2:S.create({parent:this,fieldKey:2,fieldName:"endInSeconds",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"fileName",pointerRules:p})}}};var ls=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.SoundfontFile],mandatory:!0}}),n)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return A(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"fileName",pointerRules:p})}}};var xt=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation],mandatory:!1}}),n)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return A(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:D.create({parent:this,fieldKey:1,fieldName:"type",pointerRules:p},"instrument"),2:_.create({parent:this,fieldKey:2,fieldName:"collection",pointerRules:p},c.AudioUnits,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:S.create({parent:this,fieldKey:11,fieldName:"index",pointerRules:p}),12:F.create({parent:this,fieldKey:12,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:F.create({parent:this,fieldKey:13,fieldName:"panning",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"solo",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"tracks",pointerRules:{accepts:[c.TrackCollection],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"midiEffects",pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),22:K.hook({parent:this,fieldKey:22,fieldName:"input",pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1}}),23:K.hook({parent:this,fieldKey:23,fieldName:"audioEffects",pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),24:K.hook({parent:this,fieldKey:24,fieldName:"auxSends",pointerRules:{accepts:[c.AuxSend],mandatory:!1}}),25:_.create({parent:this,fieldKey:25,fieldName:"output",pointerRules:p},c.AudioOutput,!1),26:_.create({parent:this,fieldKey:26,fieldName:"capture",pointerRules:p},c.Capture,!1)}}};var cs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return A(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:D.create({parent:this,fieldKey:1,fieldName:"deviceId",pointerRules:p}),2:D.create({parent:this,fieldKey:2,fieldName:"recordMode",pointerRules:p},"normal"),10:S.create({parent:this,fieldKey:10,fieldName:"requestChannels",pointerRules:p},1),11:F.create({parent:this,fieldKey:11,fieldName:"gainDb",pointerRules:p},0)}}};var ds=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return A(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"deviceId",pointerRules:p}),2:D.create({parent:this,fieldKey:2,fieldName:"recordMode",pointerRules:p},"normal"),10:S.create({parent:this,fieldKey:10,fieldName:"channel",pointerRules:p},-1)}}};var Pi=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:p}),n)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.AudioBusses,!0),2:_.create({parent:this,fieldKey:2,fieldName:"output",pointerRules:p},c.AudioOutput,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"input",pointerRules:{accepts:[c.AudioOutput],mandatory:!1}}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:D.create({parent:this,fieldKey:5,fieldName:"icon",pointerRules:p}),6:D.create({parent:this,fieldKey:6,fieldName:"label",pointerRules:p}),7:D.create({parent:this,fieldKey:7,fieldName:"color",pointerRules:p},"red"),8:I.create({parent:this,fieldKey:8,fieldName:"minimized",pointerRules:p})}}};var hs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:p}),n)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"audioUnit",pointerRules:p},c.AuxSend,!0),2:_.create({parent:this,fieldKey:2,fieldName:"targetBus",pointerRules:p},c.AudioOutput,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:S.create({parent:this,fieldKey:4,fieldName:"routing",pointerRules:p},1),5:F.create({parent:this,fieldKey:5,fieldName:"sendGain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),6:F.create({parent:this,fieldKey:6,fieldName:"sendPan",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var ps=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StepAutomationBox",pointerRules:p}),n)}static ClassName="StepAutomationBox";constructor(e){super(e)}accept(e){return A(e.visitStepAutomationBox,this)}get step(){return this.getField(1)}get parameter(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"step",pointerRules:p},c.StepAutomation,!0),2:_.create({parent:this,fieldKey:2,fieldName:"parameter",pointerRules:p},c.StepAutomation,!0),3:F.create({parent:this,fieldKey:3,fieldName:"value",pointerRules:p})}}};var ms=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.Groove],mandatory:!0}}),n)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return A(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"label",pointerRules:p}),10:F.create({parent:this,fieldKey:10,fieldName:"amount",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.6),11:S.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},480)}}};var fs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:D.create({parent:this,fieldKey:10,fieldName:"comment",pointerRules:p})}}};var gs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:D.create({parent:this,fieldKey:10,fieldName:"comment",pointerRules:p})}}};var vs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p}),n)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"userInterface",pointerRules:p},c.DeviceUserInterface,!0),2:_.create({parent:this,fieldKey:2,fieldName:"parameter",pointerRules:p},c.ParameterController,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),10:F.create({parent:this,fieldKey:10,fieldName:"anchor",pointerRules:p}),11:D.create({parent:this,fieldKey:11,fieldName:"color",pointerRules:p})}}};var Ls=class r extends xe{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",pointerRules:{accepts:[c.DeviceUserInterface],mandatory:!1}})}}};var xs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"modularSetup",pointerRules:p},c.ModularSetup,!0),11:Ls.create({parent:this,fieldKey:11,fieldName:"userInterface",pointerRules:p})}}};var Ks=class r extends xe{static create(e){return new r(e)}constructor(e){super(e)}get active(){return this.getField(1)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"active",pointerRules:{accepts:[c.StepAutomation],mandatory:!1}})}}};var Zs=class r extends xe{static create(e){return new r(e)}constructor(e){super(e)}get steps(){return this.getField(10)}get length(){return this.getField(11)}get scale(){return this.getField(12)}initializeFields(){return{10:yi.create({parent:this,fieldKey:10,fieldName:"steps",pointerRules:p},e=>Ks.create(e),128),11:S.create({parent:this,fieldKey:11,fieldName:"length",pointerRules:p},16),12:S.create({parent:this,fieldKey:12,fieldName:"scale",pointerRules:p},960)}}};var ys=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceClashBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="DeviceClashBox";constructor(e){super(e)}accept(e){return A(e.visitDeviceClashBox,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 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)}get patterns(){return this.getField(30)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"delay",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},.5),11:F.create({parent:this,fieldKey:11,fieldName:"feedback",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},.9),12:F.create({parent:this,fieldKey:12,fieldName:"cross",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},0),13:F.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},-3),15:F.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},-3),30:yi.create({parent:this,fieldKey:30,fieldName:"patterns",pointerRules:p},e=>Zs.create(e),16)}}};var bs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:F.create({parent:this,fieldKey:11,fieldName:"panning",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"stereo",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:I.create({parent:this,fieldKey:13,fieldName:"invertL",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"invertR",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"swap",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"panningMixing",pointerRules:p},1)}}};var ws=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"delay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},4),11:F.create({parent:this,fieldKey:11,fieldName:"feedback",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),12:F.create({parent:this,fieldKey:12,fieldName:"cross",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),13:F.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-6),15:F.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0)}}};var zn=class r extends xe{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:S.create({parent:this,fieldKey:11,fieldName:"order",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"q",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Tn=class r extends xe{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:F.create({parent:this,fieldKey:11,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var ki=class r extends xe{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:F.create({parent:this,fieldKey:11,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"q",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var As=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:zn.create({parent:this,fieldKey:10,fieldName:"highPass",pointerRules:p}),11:Tn.create({parent:this,fieldKey:11,fieldName:"lowShelf",pointerRules:p}),12:ki.create({parent:this,fieldKey:12,fieldName:"lowBell",pointerRules:p}),13:ki.create({parent:this,fieldKey:13,fieldName:"midBell",pointerRules:p}),14:ki.create({parent:this,fieldKey:14,fieldName:"highBell",pointerRules:p}),15:Tn.create({parent:this,fieldKey:15,fieldName:"highShelf",pointerRules:p}),16:zn.create({parent:this,fieldKey:16,fieldName:"lowPass",pointerRules:p}),17:F.create({parent:this,fieldKey:17,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var $s=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"decay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),11:F.create({parent:this,fieldKey:11,fieldName:"preDelay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),12:F.create({parent:this,fieldKey:12,fieldName:"damp",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),13:F.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-3),15:F.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0)}}};var Es=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return A(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)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:S.create({parent:this,fieldKey:11,fieldName:"octave",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"tune",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:S.create({parent:this,fieldKey:13,fieldName:"waveform",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:F.create({parent:this,fieldKey:14,fieldName:"cutoff",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:F.create({parent:this,fieldKey:15,fieldName:"resonance",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),16:F.create({parent:this,fieldKey:16,fieldName:"attack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),17:F.create({parent:this,fieldKey:17,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),18:F.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Ss=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"file",pointerRules:p},c.SoundfontFile,!1),11:S.create({parent:this,fieldKey:11,fieldName:"presetIndex",pointerRules:p})}}};var Ns=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-3),15:_.create({parent:this,fieldKey:15,fieldName:"file",pointerRules:p},c.AudioFile,!1),20:F.create({parent:this,fieldKey:20,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.1)}}};var Ps=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:K.hook({parent:this,fieldKey:10,fieldName:"samples",pointerRules:{accepts:[c.Sample],mandatory:!1}})}}};var _i=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing],mandatory:!1}}),n)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:10,fieldName:"device",pointerRules:p},c.Sample,!0),11:_.create({parent:this,fieldKey:11,fieldName:"file",pointerRules:p},c.AudioFile,!0),12:K.hook({parent:this,fieldKey:12,fieldName:"midiEffects",pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),13:K.hook({parent:this,fieldKey:13,fieldName:"audioEffects",pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),15:S.create({parent:this,fieldKey:15,fieldName:"index",pointerRules:p},60),20:D.create({parent:this,fieldKey:20,fieldName:"label",pointerRules:p}),21:D.create({parent:this,fieldKey:21,fieldName:"icon",pointerRules:p}),22:I.create({parent:this,fieldKey:22,fieldName:"enabled",pointerRules:p},!0),23:I.create({parent:this,fieldKey:23,fieldName:"minimized",pointerRules:p},!1),40:I.create({parent:this,fieldKey:40,fieldName:"mute",pointerRules:p}),41:I.create({parent:this,fieldKey:41,fieldName:"solo",pointerRules:p}),42:I.create({parent:this,fieldKey:42,fieldName:"exclude",pointerRules:p}),43:I.create({parent:this,fieldKey:43,fieldName:"polyphone",pointerRules:p}),44:S.create({parent:this,fieldKey:44,fieldName:"gate",pointerRules:p},0),45:F.create({parent:this,fieldKey:45,fieldName:"pitch",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),46:F.create({parent:this,fieldKey:46,fieldName:"sampleStart",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),47:F.create({parent:this,fieldKey:47,fieldName:"sampleEnd",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),48:F.create({parent:this,fieldKey:48,fieldName:"attack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.001),49:F.create({parent:this,fieldKey:49,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.02)}}};var _s=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.Automation],mandatory:!1}}),n)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"flutter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:F.create({parent:this,fieldKey:11,fieldName:"wow",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"noise",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:F.create({parent:this,fieldKey:13,fieldName:"saturation",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var ks=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"modeIndex",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:S.create({parent:this,fieldKey:11,fieldName:"numOctaves",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),12:S.create({parent:this,fieldKey:12,fieldName:"rateIndex",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},9),13:F.create({parent:this,fieldKey:13,fieldName:"gate",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),14:S.create({parent:this,fieldKey:14,fieldName:"repeat",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),15:F.create({parent:this,fieldKey:15,fieldName:"velocity",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Is=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"semiTones",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:F.create({parent:this,fieldKey:11,fieldName:"cents",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:S.create({parent:this,fieldKey:12,fieldName:"octaves",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Fs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:D.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"groove",pointerRules:p},c.Groove,!0)}}};var Bs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:p}),n)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return A(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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ModularSetup,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"device",pointerRules:{accepts:[c.ModularSetup],mandatory:!0}}),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"modules",pointerRules:{accepts:[c.ModuleCollection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"connections",pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1}}),13:D.create({parent:this,fieldKey:13,fieldName:"label",pointerRules:p})}}};var Os=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:p}),n)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return A(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ConnectionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"source",pointerRules:p},c.VoltageConnection,!0),3:_.create({parent:this,fieldKey:3,fieldName:"target",pointerRules:p},c.VoltageConnection,!0)}}};var st=class r extends xe{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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ModuleCollection,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:S.create({parent:this,fieldKey:3,fieldName:"x",pointerRules:p}),4:S.create({parent:this,fieldKey:4,fieldName:"y",pointerRules:p}),5:I.create({parent:this,fieldKey:5,fieldName:"collapsed",pointerRules:p},!1),6:I.create({parent:this,fieldKey:6,fieldName:"removable",pointerRules:p},!0)}}};var Cs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return A(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:st.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"output",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Ds=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return A(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:st.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"input",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Rs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return A(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:st.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"time",pointerRules:{accepts:[c.ParameterController],mandatory:!1}},500)}}};var zs=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return A(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:st.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"multiplier",pointerRules:p})}}};var Ts=class r extends k{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return A(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:st.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"gain",pointerRules:{accepts:[c.ParameterController],mandatory:!1}})}}};var $t;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;z(n)?(yl(n,dr),n.slope.setValue(t.slope)):dr.create(e.box.graph,E.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)?(yl(t,dr),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?sr.None:e.getValue()===1?sr.Linear:w("Unknown Interpolation value")}})($t||($t={}));var pr=class r{static Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.index-t.index;if(i!==0)return i;throw new Error(`${e} and ${t} are identical in terms of comparison`)};type="value-event";#t=new V;#e;#r;#i;#n;#o=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new Oo(()=>$t.read(this.#r.interpolation)));let n=()=>{this.#i.invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};this.#t.ownAll(this.#r.subscribe(oe.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let o=this.collection.unwrap(),s=i.address.fieldKeys,a=P.equals(this.#r.index.address.fieldKeys,s),u=P.equals(this.#r.position.address.fieldKeys,s);a||u?o.requestSorting():o.onEventPropertyChanged()}}),this.#r.interpolation.subscribe(n),this.#r.interpolation.pointerHub.subscribe({onAdd:({box:i})=>{this.#n.terminate(),this.#n=i.subscribe(oe.Children,n),n()},onRemove:()=>{this.#n.terminate(),this.#n=Z.Empty,n()}})),this.#n=this.#r.interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(oe.Children,n)??Z.Empty}onSelected(){this.#o=!0,this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){this.#o=!1,this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){this.#n.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get index(){return this.#r.index.getValue()}set interpolation(e){$t.write(this.#r.interpolation,e)}get interpolation(){return this.#i.get()}get value(){return this.#r.value.getValue()}get isSelected(){return this.#o}get collection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,at))}copyTo(e){let t=cr.create(this.#e.boxGraph,E.generate(),n=>{n.position.setValue(e?.position??this.position),n.index.setValue(e?.index??this.index),n.events.refer(e?.events??this.collection.unwrap().box.events),n.value.setValue(e?.value??this.value)});return $t.write(t.interpolation,e?.interpolation??this.interpolation),this.#e.boxAdapters.adapterFor(t,r)}copyFrom(e){return this.#r.position.setValue(e?.position??this.position),this.#r.index.setValue(e?.index??this.index),this.#r.events.refer(e?.events??this.collection.unwrap().box.events),this.#r.value.setValue(e?.value??this.value),$t.write(this.#r.interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};var at=class r{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#n=E.newSet(i=>i.uuid),this.#o=ir.create(pr.Comparator);let n=i=>{let o=H(i.accept({visitValueEventBox:s=>this.#e.boxAdapters.adapterFor(s,pr)}),`Could not find adapter for ${i}`);this.#n.add(o)&&(this.#o.add(o),this.#s())};this.#r.events.pointerHub.incoming().forEach(({box:i})=>n(i)),this.#t.own(this.#r.events.pointerHub.subscribe({onAdd:({box:i})=>n(i),onRemove:({box:{address:{uuid:i}}})=>{this.#o.remove(this.#n.removeByKey(i)),this.#s()}})),this.#t.own(this.#r.owners.pointerHub.subscribe({onAdd:()=>this.#i.notify(this),onRemove:()=>this.#i.notify(this)}))}valueAt(e,t){return Go.valueAt(this.#o,e,t)}copy(){let e=this.#e.boxGraph,t=Vt.create(e,E.generate());return this.#o.asArray().forEach(n=>n.copyTo({events:t.events})),this.#e.boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),n=this.events.greaterEqual(e);if(n===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:n.value,index:n.index,interpolation:n.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:o}=t,{position:s,value:a}=n;return m.wrap(this.createEvent({position:e,value:sm(o,a,(e-i)/(s-i)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:i,value:o}=t,{position:s,value:a}=n,u=s-i,l=e-i,d=ot.byHalf(u,o,ot.valueAt({slope:t.interpolation.slope,steps:u,y0:o,y1:a},u*.5),a),h=ot.valueAt(d,l),f=ot.slopeByHalf(o,ot.valueAt(d,l*.5),h);return $t.write(t.box.interpolation,sr.Curve(f)),m.wrap(this.createEvent({position:e,value:h,index:0,interpolation:sr.Curve(ot.slopeByHalf(h,ot.valueAt(d,(l+u)*.5),a))}))}return w("Unknown interpolation type")}subscribeChange(e){return this.#i.subscribe(e)}createEvent({position:e,index:t,value:n,interpolation:i}){let o=cr.create(this.#e.boxGraph,E.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(n),s.events.refer(this.#r.events)});return $t.write(o.interpolation,i),this.#e.boxAdapters.adapterFor(o,pr)}requestSorting(){this.#o.onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){this.#s()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get numOwners(){return this.#r.owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return this.#o}toString(){return`{ValueEventCollectionBox ${E.toString(this.#r.address.uuid)}}`}#s(){this.#i.notify(this)}};var mr=class{type="value-clip";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Le(!1)),this.#n=this.#t.own(new W),this.#t.own(this.#r.pointerHub.subscribe({onAdd:()=>this.#a(),onRemove:()=>this.#a()})),this.#t.own(this.#r.subscribe(oe.Children,n=>this.#a())),this.#t.own(this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,at).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return A(e.visitValueClipBoxAdapter,this)}consolidate(){this.#r.events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:this.#r.events.targetVertex.unwrap();$i.create(this.#e.boxGraph,E.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(this.#r.clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,at))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${E.toString(this.#r.address.uuid)} d: ${te.toString(this.duration)}}`}#a(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var Et=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get startInSeconds(){return this.#e.startInSeconds.getValue()}get endInSeconds(){return this.#e.endInSeconds.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}getOrCreateLoader(){return this.#t.sampleManager.getOrCreate(this.#e.address.uuid)}terminate(){}};var fr=class{type="audio-clip";#t=new V;#e;#r;#i;#n;#o;#s=m.None;#a=m.None;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Le(!1)),this.#n=this.#t.own(new W),this.#t.ownAll(this.#r.pointerHub.subscribe({onAdd:()=>this.#u(),onRemove:()=>this.#u()}),this.#r.file.catchupAndSubscribe(n=>{this.#s=n.targetVertex.map(i=>this.#e.boxAdapters.adapterFor(i.box,Et)),this.#a.ifSome(i=>i.terminate()),this.#a=this.#s.map(i=>i.getOrCreateLoader().subscribe(()=>this.#u()))}),this.#r.subscribe(oe.Children,n=>this.#u()),{terminate:()=>{this.#a.ifSome(n=>n.terminate()),this.#a=m.None}}),this.#o=!1}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return A(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){Si.create(this.#e.boxGraph,E.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(this.#r.clips.targetVertex.unwrap()),t.file.refer(this.#r.file.targetVertex.unwrap())})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get gain(){return this.#r.gain.getValue()}get file(){return this.#s.unwrap("Cannot access file.")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}get isMirrowed(){return!1}get canMirror(){return!1}toString(){return`{AudioClipBoxAdapter ${E.toString(this.#r.address.uuid)} d: ${te.toString(this.duration)}}`}#u(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var Qr=class r{type="note-event";#t;#e;#r;#i=!1;constructor(e,t){this.#t=e,this.#e=t,this.#r=this.#e.subscribe(oe.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),o=n.address.fieldKeys,s=P.equals(this.#e.pitch.address.fieldKeys,o),a=P.equals(this.#e.position.address.fieldKeys,o);s||a?i.requestSorting():i.onEventPropertyChanged()}})}onSelected(){this.#i=!0,this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){this.#i=!1,this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){this.#r.terminate()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get position(){return this.#e.position.getValue()}get duration(){return this.#e.duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return this.#e.velocity.getValue()}get pitch(){return this.#e.pitch.getValue()}get cent(){return this.#e.cent.getValue()}get chance(){return this.#e.chance.getValue()}get playCount(){return this.#e.playCount.getValue()}get playCurve(){return this.#e.playCurve.getValue()}get isSelected(){return this.#i}get collection(){return this.#e.events.targetVertex.map(e=>this.#t.boxAdapters.adapterFor(e.box,ut))}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 this.#t.boxAdapters.adapterFor(lr.create(this.#t.boxGraph,E.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 Ze.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,n=P.create(i=>{let o=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+o),duration:Math.max(1,s-o),playCount:1,events:t})},e);return this.#e.delete(),n}};var ut=class r{#t=new V;#e;#r;#i;#n;#o;#s=60;#a=60;#u=0;#l=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#n=E.newSet(i=>i.uuid),this.#o=ir.create(Ze.Comparator);let n=i=>{let o=H(i.accept({visitNoteEventBox:s=>this.#e.boxAdapters.adapterFor(s,Qr)}),`Could not find adapter for ${i}`);this.#n.add(o)&&(this.#o.add(o),this.#c())};this.#r.events.pointerHub.incoming().forEach(({box:i})=>n(i)),this.#t.own(this.#r.events.pointerHub.subscribe({onAdd:({box:i})=>n(i),onRemove:({box:{address:{uuid:i}}})=>{this.#o.remove(this.#n.removeByKey(i)),this.#c()}})),this.#t.own(this.#r.owners.pointerHub.subscribe({onAdd:()=>this.#i.notify(this),onRemove:()=>this.#i.notify(this)}))}copy(){let e=this.#e.boxGraph,t=Ut.create(e,E.generate());return this.#o.asArray().forEach(n=>n.copyTo({events:t.events})),this.#e.boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:n,pitch:i,chance:o,playCount:s,cent:a}){return this.#e.boxAdapters.adapterFor(lr.create(this.#e.boxGraph,E.generate(),u=>{u.position.setValue(e),u.duration.setValue(t),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(o),u.playCount.setValue(s),u.cent.setValue(a),u.events.refer(this.#r.events)}),Qr)}subscribeChange(e){return this.#i.subscribe(e)}selectable(){return this.#o.asArray()}selectableAt(e){for(let t of this.#o.asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return ve.one(t);return ve.empty()}selectablesBetween(e,t){let n=[];for(let i of this.#o.asArray())Nn.intersect1D(i.position,i.complete,e.u,t.u)&&Nn.intersect1D(i.pitch,i.pitch,e.v,t.v)&&n.push(i);return n}requestSorting(){this.#o.onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){this.#c()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get numOwners(){return this.#r.owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return this.#l||this.#d(),this.#o}get minPitch(){return this.#l||this.#d(),this.#s}get maxPitch(){return this.#l||this.#d(),this.#a}get maxDuration(){return this.#l||this.#d(),this.#u}toString(){return`{NoteEventCollectionBox ${E.toString(this.#r.address.uuid)}}`}#c(){this.#l=!1,this.#i.notify(this)}#d(){let e=127,t=0,n=0;this.#o.asArray().forEach(({pitch:i,duration:o})=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.max(n,o)}),this.#s=e,this.#a=t,this.#u=n,this.#l=!0}};var Ii=class{type="note-clip";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Le(!1)),this.#n=this.#t.own(new W),this.#t.ownAll(this.#r.pointerHub.subscribe({onAdd:()=>this.#a(),onRemove:()=>this.#a()}),this.#r.subscribe(oe.Children,n=>this.#a()),this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,ut).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return A(e.visitNoteClipBoxAdapter,this)}consolidate(){this.#r.events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:this.#r.events.targetVertex.unwrap();Ai.create(this.#e.boxGraph,E.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(this.#r.clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ut))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${E.toString(this.#r.address.uuid)} d: ${te.toString(this.duration)}}`}#a(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var qs={for:(r,e)=>H(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Ii),visitValueClipBox:t=>r.adapterFor(t,mr),visitAudioClipBox:t=>r.adapterFor(t,fr)}),"")};var Hs=class{#t;#e;#r;#i;constructor(e,t){this.#t=e,this.#e=new V,this.#r=this.#e.own(new W),this.#i=this.#e.own(Te.create(e.box.clips,n=>qs.for(t,n),c.ClipCollection)),this.#i.subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return this.#t}get collection(){return this.#i}dispatchChange(){this.#r.notify()}subscribeChanges(e){return this.#r.subscribe(e)}terminate(){this.#e.terminate()}};var gr=class r{type="audio-region";#t;#e;#r;#i;#n=m.None;#o=m.None;#s;#a;constructor(e,t){this.#e=e,this.#r=t,this.#t=new V,this.#i=new W,this.#s=!1,this.#a=!0,this.#t.ownAll(this.#r.pointerHub.subscribe({onAdd:()=>this.#u(),onRemove:()=>this.#u()}),this.#r.file.catchupAndSubscribe(n=>{this.#n=n.targetVertex.map(i=>this.#e.boxAdapters.adapterFor(i.box,Et)),this.#o.ifSome(i=>i.terminate()),this.#o=this.#n.map(i=>i.getOrCreateLoader().subscribe(()=>this.#u()))}),this.#r.subscribe(oe.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#u()):this.#u()}}),{terminate:()=>{this.#o.ifSome(n=>n.terminate()),this.#o=m.None}}),this.#a=!1}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return A(e.visitAudioRegionBoxAdapter,this)}onSelected(){this.#s=!0,this.#u()}onDeselected(){this.#s=!1,this.#u()}get isSelected(){return this.#s}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){let e=this.#r.duration.getValue();if(e===0){let t=this.#n.unwrap("Cannot compute duration without file"),n=t.startInSeconds,o=t.endInSeconds-n;return te.secondsToPulses(o,this.#e.bpm)}return e}get complete(){return this.position+this.duration}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get gain(){return this.#r.gain.getValue()}get file(){return this.#n.unwrap("Cannot access file.")}get hasCollection(){return this.#n.nonEmpty()}get optCollection(){return m.None}get label(){if(this.#n.isEmpty())return"No Audio File";let e=this.#n.unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):this.#r.label.getValue()}get isMirrowed(){return!1}get canMirror(){return!1}get trackBoxAdapter(){return this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}copyTo(e){return this.#e.boxAdapters.adapterFor(Ei.create(this.#e.boxGraph,E.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.loopOffset.setValue(e?.loopOffset??this.loopOffset),t.loopDuration.setValue(e?.loopDuration??this.loopDuration),t.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap()),t.file.refer(this.#r.file.targetVertex.unwrap()),t.mute.setValue(this.mute),t.hue.setValue(this.hue),t.label.setValue(this.label),t.gain.setValue(this.gain)}),r)}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}toString(){return`{AudioRegionBoxAdapter ${E.toString(this.#r.address.uuid)}}`}#u(){this.#a||(this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())}};var vr=class r{type="note-region";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#o=!1,this.#n=!0,this.#t.ownAll(this.#r.pointerHub.subscribe({onAdd:()=>this.#a(),onRemove:()=>this.#a()}),this.#r.subscribe(oe.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#a()):this.#a()}}),this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,ut).subscribeChange(()=>this.#a())}),this.#a()})),this.#n=!1}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return A(e.visitNoteRegionBoxAdapter,this)}onSelected(){this.#o=!0,this.#a()}onDeselected(){this.#o=!1,this.#a()}get isSelected(){return this.#o}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let n=t.unwrap(),i=We.globalToLocal(this,e);for(let o of n.events.iterateFrom(i-n.maxDuration)){if(i<o.position)return;i<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){return this.#r.duration.getValue()}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ut))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#n?m.None:this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return this.#e.boxAdapters.adapterFor(Yr.create(this.#e.boxGraph,E.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=this.#e.boxGraph,n=Ut.create(t,E.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),this.#r.events.refer(n.owners)})}canFlatten(e){return e.length>0&&P.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=this.#e.boxGraph,n=e.toSorted(nr.Comparator),i=P.getFirst(n,"Internal error (no first)"),o=P.getLast(n,"Internal error (no last)"),s=i.position,a=o.position+o.duration,u=i.trackBoxAdapter.unwrap(),l=Ut.create(t,E.generate()),d=Array.from(u.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of We.locateLoops(f,f.position,f.complete)){let b=Math.floor(v-y),C=Math.floor(g-y);for(let U of f.optCollection.unwrap().events.iterateRange(b,C))U.copyTo({position:U.position+y-i.position,events:l.events})}}),d.forEach(({box:h})=>h.delete()),m.wrap(Yr.create(t,E.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(l.owners),h.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${E.toString(this.#r.address.uuid)} p: ${te.toString(this.position)}, c: ${te.toString(this.complete)}}`}#a(){this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()}};var jt=class r{type="value-region";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=new W,this.#n=!1,this.#t.own(this.#r.pointerHub.subscribe({onAdd:()=>this.#a(),onRemove:()=>this.#a()})),this.#t.own(this.#r.subscribe(oe.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#a()):this.#a()}})),this.#t.own(this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,at).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(We.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(We.globalToLocal(this,this.complete),e)}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return A(e.visitValueRegionBoxAdapter,this)}onSelected(){this.#n=!0,this.#a()}onDeselected(){this.#n=!1,this.#a()}get isSelected(){return this.#n}onValuesPropertyChanged(){this.#a()}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){return this.#r.duration.getValue()}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,at))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Ne))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return this.#e.boxAdapters.adapterFor(Xr.create(this.#e.boxGraph,E.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=this.#e.boxGraph,n=Vt.create(t,E.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),this.#r.events.refer(n.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=this.#e.boxGraph,n=e.toSorted(nr.Comparator),i=P.getFirst(n,"Internal error (no first)"),o=P.getLast(n,"Internal error (no last)"),s=i.position,a=o.position+o.duration,u=i.trackBoxAdapter.unwrap(),l=Vt.create(t,E.generate()),d=Array.from(u.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of We.locateLoops(f,f.position,f.complete)){let b=Math.floor(v-y),C=Math.floor(g-y);for(let U of f.events.unwrap().iterateRange(b,C));}}),d.forEach(({box:h})=>h.delete()),m.wrap(Xr.create(t,E.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(l.owners),h.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${E.toString(this.#r.address.uuid)} p: ${te.toString(this.position)}, c: ${te.toString(this.complete)}}`}#a(){this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()}};var Vm=(r,e)=>r.position-e.position,jm={for:(r,e)=>H(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,vr),visitAudioRegionBox:t=>r.adapterFor(t,gr),visitValueRegionBox:t=>r.adapterFor(t,jt)}),"")};var Gs=class{#t;#e;#r;#i;#n;constructor(e,t){this.#t=e,this.#e=new V,this.#r=this.#e.own(new W),this.#i=nr.create(Vm),this.#n=E.newSet(n=>n.uuid),this.#e.ownAll(this.#t.box.regions.pointerHub.catchupAndSubscribe({onAdd:({box:n})=>{let i=jm.for(t,n),o=this.#n.add(i);N(o,`Cannot add ${n}`),this.#i.add(i),this.dispatchChange()},onRemove:({box:{address:{uuid:n}}})=>{this.#i.remove(this.#n.removeByKey(n)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return this.#t}get collection(){return this.#i}get adapters(){return this.#n}onIndexingChanged(){this.#i.onIndexingChanged(),this.dispatchChange()}subscribeChanges(e){return this.#r.subscribe(e)}dispatchChange(){this.#r.notify()}terminate(){this.#e.terminate()}};var Re;(function(r){r[r.Rectangle=0]="Rectangle",r[r.Checkbox=1]="Checkbox",r[r.Cursor=2]="Cursor",r[r.Panel=3]="Panel",r[r.MainMenu=4]="MainMenu",r[r.Dropdown=5]="Dropdown",r[r.Dropbox=6]="Dropbox",r[r.GoogleDrive=7]="GoogleDrive",r[r.AudioDevice=8]="AudioDevice",r[r.GuitarTab=9]="GuitarTab",r[r.Effects=10]="Effects",r[r.Flask=11]="Flask",r[r.Robot=12]="Robot",r[r.NotePad=13]="NotePad",r[r.Pencil=14]="Pencil",r[r.Waveform=15]="Waveform",r[r.Mix=16]="Mix",r[r.Adsr=17]="Adsr",r[r.Dial=18]="Dial",r[r.Record=19]="Record",r[r.Play=20]="Play",r[r.Stop=21]="Stop",r[r.Loop=22]="Loop",r[r.Timeline=23]="Timeline",r[r.Region=24]="Region",r[r.Box=25]="Box",r[r.Mixing=26]="Mixing",r[r.Vinyl=27]="Vinyl",r[r.Help=28]="Help",r[r.Metronome=29]="Metronome",r[r.System=30]="System",r[r.Add=31]="Add",r[r.Subtract=32]="Subtract",r[r.Peak=33]="Peak",r[r.LowPass=34]="LowPass",r[r.HighPass=35]="HighPass",r[r.LowShelf=36]="LowShelf",r[r.HighShelf=37]="HighShelf",r[r.RoundUp=38]="RoundUp",r[r.RoundDown=39]="RoundDown",r[r.Mute=40]="Mute",r[r.Solo=41]="Solo",r[r.Exclude=42]="Exclude",r[r.Menu=43]="Menu",r[r.Pointer=44]="Pointer",r[r.Eraser=45]="Eraser",r[r.Scissors=46]="Scissors",r[r.Tape=47]="Tape",r[r.CollapseDown=48]="CollapseDown",r[r.FileList=49]="FileList",r[r.Close=50]="Close",r[r.DragConnections=51]="DragConnections",r[r.Heart=52]="Heart",r[r.Merge=53]="Merge",r[r.SpeakerHeadphone=54]="SpeakerHeadphone",r[r.AudioBus=55]="AudioBus",r[r.DrumSet=56]="DrumSet",r[r.BassGuitar=57]="BassGuitar",r[r.Guitar=58]="Guitar",r[r.Saxophone=59]="Saxophone",r[r.Microphone=60]="Microphone",r[r.New=61]="New",r[r.Piano=62]="Piano",r[r.ExpandWidth=63]="ExpandWidth",r[r.OpenDAW=64]="OpenDAW",r[r.Automation=65]="Automation",r[r.Embed=66]="Embed",r[r.Popout=67]="Popout",r[r.Minimized=68]="Minimized",r[r.Maximized=69]="Maximized",r[r.Search=70]="Search",r[r.Generator=71]="Generator",r[r.Groove=72]="Groove",r[r.Table=73]="Table",r[r.Note=74]="Note",r[r.Exit=75]="Exit",r[r.Start=76]="Start",r[r.Duration=77]="Duration",r[r.Velocity=78]="Velocity",r[r.Random=79]="Random",r[r.Divide=80]="Divide",r[r.Curve=81]="Curve",r[r.Primary=82]="Primary",r[r.Clips=83]="Clips",r[r.NoAudio=84]="NoAudio",r[r.Unknown=85]="Unknown",r[r.UserFolder=86]="UserFolder",r[r.CloudFolder=87]="CloudFolder",r[r.Run=88]="Run",r[r.Insert=89]="Insert",r[r.ArrayDown=90]="ArrayDown",r[r.Sun=91]="Sun",r[r.Book=92]="Book",r[r.Stack=93]="Stack",r[r.EditBox=94]="EditBox",r[r.Delete=95]="Delete",r[r.Time=96]="Time",r[r.EQ=97]="EQ",r[r.Cube=98]="Cube",r[r.NanoWave=99]="NanoWave",r[r.Midi=100]="Midi",r[r.DinSlot=101]="DinSlot",r[r.VUMeter=102]="VUMeter",r[r.Playfield=103]="Playfield",r[r.Invert=104]="Invert",r[r.Headphone=105]="Headphone",r[r.Stereo=106]="Stereo",r[r.AutoGain=107]="AutoGain",r[r.AudioFile=108]="AudioFile",r[r.Tool=109]="Tool",r[r.Focus=110]="Focus",r[r.Swap=111]="Swap",r[r.Connected=112]="Connected",r[r.Disconnected=113]="Disconnected",r[r.Zeitgeist=114]="Zeitgeist"})(Re||(Re={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(Re||(Re={}));var se;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(se||(se={}));(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 Re.Waveform;case r.Notes:return Re.Piano;case r.Value:return Re.Automation;case r.Undefined:return Re.AudioBus;default:return Re.Unknown}}})(se||(se={}));var Ws;(function(r){r.isDeviceBox=e=>"host"in e&&fe(e.host,_)&&"label"in e&&fe(e.label,D)&&"enabled"in e&&fe(e.enabled,I)&&"minimized"in e&&fe(e.minimized,I),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===c.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&fe(e.index,S)&&(e.host.pointerType===c.MidiEffectHost||e.host.pointerType===c.AudioEffectHost),r.lookupHostField=e=>z(e)&&"host"in e&&fe(e.host,_)?e.host:w(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>z(e)&&"label"in e&&fe(e.label,D)?e.label:w(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>z(e)&&"enabled"in e&&fe(e.enabled,I)?e.enabled:w(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>z(e)&&"minimized"in e&&fe(e.minimized,I)?e.minimized:w(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>z(e)&&"index"in e&&fe(e.index,S)?e.index:w(`Could not find 'index' field in '${e?.name}'`)})(Ws||(Ws={}));var Lm;(function(r){r.toTrackType=e=>{switch(e){case"midi":return se.Notes;case"audio":return se.Audio;default:return w()}}})(Lm||(Lm={}));var Q;(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;N(P.satisfy(e,(i,o)=>i.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MidiEffectHost):w("unknown type")).map(({box:i})=>Ws.lookupIndexField(i)).filter(i=>e.some(o=>E.Comparator(o.uuid,i.address.uuid)!==0)).sort((i,o)=>i.getValue()-o.getValue()).forEach((i,o)=>i.setValue(o)),e.forEach(i=>i.box.delete())}})(Q||(Q={}));var Js=class{#t;#e=new W;#r;#i;#n;constructor(e,t){this.#t=e,this.#r=Te.create(e.box.tracks,n=>t.adapterFor(n,Ne),c.TrackCollection),this.#i=E.newSet(({uuid:n})=>n),this.#n=this.#r.catchupAndSubscribe({onAdd:n=>this.#i.add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>this.#e.notify())}),onRemove:({uuid:n})=>this.#i.removeByKey(n).subscription.terminate(),onReorder:n=>{}})}create(e,t,n){let i=this.#t.box.graph,o=this.#t.box.tracks;wi.create(i,E.generate(),s=>{s.index.setValue(n??this.#r.getMinFreeIndex()),s.type.setValue(e),s.tracks.refer(o),s.target.refer(t)})}controls(e){return m.wrap(this.#r.adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=this.#r.adapters(),n=t.indexOf(e);if(n===-1)return w(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return this.#r}values(){return this.#r.adapters()}catchupAndSubscribe(e){return this.#r.catchupAndSubscribe(e)}subscribeAnyChange(e){return this.#e.subscribe(e)}terminate(){this.#r.terminate(),this.#n.terminate(),this.#i.forEach(({subscription:e})=>e.terminate()),this.#i.clear()}};var He=class{type="bus";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}catchupAndSubscribe(e){return e(this),this.#e.subscribe(oe.Children,()=>e(this))}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get iconField(){return this.#e.icon}get labelField(){return this.#e.label}get colorField(){return this.#e.color}get iconSymbol(){return Re.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.output.targetVertex.unwrap("No AudioUnitBox found").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};var Ys=class{#t;#e;#r;#i;#n=Z.Empty;constructor(e,t){this.#t=new V,this.#e=this.#t.own(new W),this.#r=this.#t.own(new Le(Re.Unknown)),this.#i=this.#t.own(new Le(m.None)),this.#t.own(this.#i.subscribe(n=>{this.#n.terminate(),this.#n=n.getValue().match({none:()=>(this.#e.notify(m.None),Z.Empty),some:({labelField:i,iconField:o})=>Z.many(o.catchupAndSubscribe(s=>this.#r.setValue(Re.fromName(s.getValue()))),i.catchupAndSubscribe(s=>this.#e.notify(m.wrap(s.getValue()))))})})),this.#t.own(e.catchupAndSubscribe({onAdd:({box:n})=>{N(this.#i.getValue().isEmpty(),"Already set");let i=n instanceof Pi?t.adapterFor(n,He):t.adapterFor(n,Q.isInstrument);this.#i.getValue().unwrapOrNull()!==i&&this.#i.setValue(m.wrap(i))},onRemove:({box:n})=>{N(this.#i.getValue().unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),this.#i.setValue(m.None)}},c.InstrumentHost,c.AudioOutput))}getValue(){return this.#i.getValue()}subscribe(e){return this.#i.subscribe(e)}catchupAndSubscribe(e){return e(this.#i),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),this.#e.subscribe(e)}catchupAndSubscribeIconChange(e){return this.#r.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(Re.toName(e)))}get icon(){return this.getValue().match({none:()=>Re.Unknown,some:e=>Re.fromName(e.iconField.getValue())})}get iconValue(){return this.#r}terminate(){this.#t.terminate(),this.#n.terminate()}};var ce=class{#t;#e;constructor(e){this.#t=e,this.#e=new er(t=>t.address.fieldKeys,nm)}terminate(){this.#e.forEach(e=>e.terminate()),this.#e.clear()}parameters(){return this.#e.values()}parameterAt(e){return this.#e.getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e}]`))}createParameter(e,t,n,i,o){let s=new ei(this.#t,e,t,n,i,o),a=this.#e.add(s);return N(a,`Could not add adapter for ${e}`),s}removeParameter(e){this.#e.removeByValue(e)}};var Fi=class{#t;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new W),this.#r.own(t.targetBus.catchupAndSubscribe(()=>{this.#s.terminate(),this.#s=this.optTargetBus.match({none:()=>(this.#i.notify(m.None),Z.Empty),some:n=>n.catchupAndSubscribe(i=>this.#i.notify(m.wrap(i)))})})),this.#n=this.#r.own(new ei(this.#t,this.#e.sendPan,O.bipolar(),B.percent({unit:"%",fractionDigits:0}),"panning")),this.#o=this.#r.own(new ei(this.#t,this.#e.sendGain,O.DefaultDecibel,B.numeric({unit:"dB",fractionDigits:1}),"gain"))}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),this.#i.subscribe(e)}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get indexField(){return this.#e.index}get sendPan(){return this.#n}get sendGain(){return this.#o}get targetBus(){return this.#t.boxAdapters.adapterFor(this.#e.targetBus.targetVertex.unwrap("no audioUnit").box,He)}get optTargetBus(){return this.#e.targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>this.#t.boxAdapters.adapterFor(t,He)})))}delete(){this.#e.delete()}terminate(){this.#r.terminate(),this.#s.terminate()}};var Xs=class{#t;#e;#r;#i;#n=Z.Empty;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new W),this.#r.own(e.catchupAndSubscribe(()=>{this.#n.terminate(),this.#n=this.adapter.match({none:()=>(this.#i.notify(m.None),Z.Empty),some:n=>n.catchupAndSubscribe(i=>this.#i.notify(m.wrap(i)))})}))}subscribe(e){return this.#i.subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return this.#t.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>this.#e.adapterFor(t,He)})))}terminate(){this.#r.terminate(),this.#n.terminate()}};var St=class r{static VolumeMapper=O.decibel(-96,-9,6);class="device-host";#t=new V;#e;#r;#i;#n;#o;#s;#a;#u;#l;namedParameter;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new ce(this.#e)),this.#n=this.#t.own(new Js(this,this.#e.boxAdapters)),this.#o=this.#t.own(new Ys(this.#r.input.pointerHub,this.#e.boxAdapters)),this.#s=this.#t.own(Te.create(this.#r.midiEffects,n=>this.#e.boxAdapters.adapterFor(n,Q.isMidiEffect),c.MidiEffectHost)),this.#a=this.#t.own(Te.create(this.#r.audioEffects,n=>this.#e.boxAdapters.adapterFor(n,Q.isAudioEffect),c.AudioEffectHost)),this.#u=this.#t.own(Te.create(this.#r.auxSends,n=>this.#e.boxAdapters.adapterFor(n,Fi),c.AuxSend)),this.#l=this.#t.own(new Xs(this.#r.output,this.#e.boxAdapters)),this.namedParameter=this.#c(t),this.#d()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get type(){return this.#r.type.getValue()}get captureBox(){return this.#r.capture.targetVertex}get tracks(){return this.#n}get input(){return this.#o}get midiEffects(){return this.#s}get audioEffects(){return this.#a}get inputAdapter(){return this.#o.getValue()}get auxSends(){return this.#u}get output(){return this.#l}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 this.#r.output.targetVertex.mapOr(e=>e.box.address.equals(this.#e.rootBoxAdapter.address),!1)}get midiEffectsField(){return this.#r.midiEffects}get inputField(){return this.#r.input}get audioEffectsField(){return this.#r.audioEffects}get tracksField(){return this.#r.tracks}get minimizedField(){return this.#o.getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return this.#o.getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=this.#e.rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),n=this.type,i=t,o=t;for(;i>0&&e[i-1].type===n;)i--;for(;o<e.length-1&&e[o+1].type===n;)o++;return[i,o+1]}move(e){this.#e.rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){this.#n.collection.move(e,t)}deleteTrack(e){this.#n.delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){this.#t.terminate()}#c(e){return{volume:this.#i.createParameter(e.volume,r.VolumeMapper,B.decible,"volume"),panning:this.#i.createParameter(e.panning,O.bipolar(),B.panning,"panning",.5),mute:this.#i.createParameter(e.mute,O.bool,B.bool,"mute"),solo:this.#i.createParameter(e.solo,O.bool,B.bool,"solo")}}#d(){let e=this.address.toString(),t=this.#r.capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${this.#r.input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;N(this.type!==Jr.Instrument||this.#r.capture.targetAddress.nonEmpty(),n)}};var Qs=te.fromSignature(1,384);var Ne=class{#t;#e;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new Hs(this,e.boxAdapters)),this.#n=this.#r.own(new Gs(this,e.boxAdapters)),this.#o=this.#r.own(new Le(-1))}catchupAndSubscribePath(e){let t=[m.None,m.None],n=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return Z.many(this.#s(i=>{t[0].equals(i)||(t[0]=i,n())}),this.#a(i=>{t[1].equals(i)||(t[1]=i,n())}))}set targetDeviceName(e){this.#e.target.targetVertex.ifSome(t=>{let n=t.box;if(n instanceof xt)return this.#t.boxAdapters.adapterFor(n,St).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in n&&n.label instanceof D)return n.label.setValue(e)})}get targetDeviceName(){return this.#e.target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof xt?this.#t.boxAdapters.adapterFor(t,St).input.label:"label"in t&&t.label instanceof D?m.wrap(t.label.getValue()):m.wrap(t.name)})}#s(e){let t=this.#e.target.targetVertex;if(t.nonEmpty()){let n=t.unwrap().box;return n instanceof xt?this.#t.boxAdapters.adapterFor(n,St).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in n&&n.label instanceof D?n.label.catchupAndSubscribe(i=>e(m.wrap(i.getValue()))):(e(m.wrap(n.name)),Z.Empty)}return e(m.None),Z.Empty}#a(e){let t=this.type;switch(t){case se.Audio:case se.Notes:return e(m.wrap(se[t])),Z.Empty;case se.Value:{let n=this.#e.target.targetVertex.unwrap();if(n.isField())e(this.#t.parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(m.wrap(n.name));else return w("Illegal State. Vertex is not a field nor box.");return Z.Empty}case se.Undefined:return e(m.wrap("")),Z.Empty;default:return e(m.None),Z.Empty}}terminate(){this.#r.terminate()}get audioUnit(){return Mr(this.#e.tracks.targetVertex.unwrap().box,xt)}get target(){return this.#e.target}get clips(){return this.#i}get regions(){return this.#n}get enabled(){return this.#e.enabled}get indexField(){return this.#e.index}get type(){return this.#e.type.getValue()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get listIndex(){return this.#o.getValue()}set listIndex(e){this.#o.setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===se.Audio;case"note-clip":return this.type===se.Notes;case"value-clip":return this.type===se.Value;case"audio-region":return this.type===se.Audio;case"note-region":return this.type===se.Notes;case"value-region":return this.type===se.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let n=t,i=this.#t.clipSequencing.iterate(this.uuid,e,e+Qs);for(let{optClip:o,sectionFrom:s}of i)n=o.match({none:()=>{let a=this.regions.collection.lowerEqual(e,u=>!u.mute);if(a===null){let u=this.regions.collection.optAt(0);return fe(u,jt)?u.incomingValue(t):t}else if(fe(a,jt))return e<a.complete?a.valueAt(e,t):a.outgoingValue(t);return t},some:a=>s===e&&fe(a,mr)?a.valueAt(e,t):t});return n}};var Km=[c.Automation,c.Modulation,c.MidiControl,c.ParameterController],ei=class{#t;#e;#r;#i;#n;#o;#s=new V;#a;#u;#l=m.None;#c=m.None;#d=null;#h=!1;constructor(e,t,n,i,o,s){this.#t=e,this.#e=t,this.#r=n,this.#i=i,this.#n=o,this.#o=s??0,this.#s.own(this.#t.parameterFieldAdapters.register(this)),this.#a=this.#s.own(new W),this.#u=new Ce,this.#s.own(this.#e.subscribe(()=>this.#a.notify(this))),this.#s.own(this.#e.pointerHub.catchupAndSubscribe({onAdd:a=>{this.#u.proxy.onControlSourceAdd(Tl(a.pointerType)),a.box.accept({visitTrackBox:u=>{N(this.#l.isEmpty(),"Already assigned");let l=this.#t.boxAdapters.adapterFor(u,Ne);this.#l=m.wrap(l),this.#t.isMainThread&&(this.#c=m.wrap(this.#t.liveStreamReceiver.subscribeFloat(this.#e.address,d=>{this.#d!==d&&(this.#d=d,this.#a.notify(this))})))}})},onRemove:a=>{this.#u.proxy.onControlSourceRemove(Tl(a.pointerType)),a.box.accept({visitTrackBox:u=>{N(this.#l.unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),this.#l=m.None,this.#t.isMainThread&&(this.#c.ifSome(l=>l.terminate()),this.#c=m.None,this.#d=null,this.#a.notify(this))}})}},...Km)),t.getValue()!==n.clamp(t.getValue())&&console.warn(`${o} (${t.getValue()}) is out of bounds`,n)}registerMidiControl(){return this.#u.proxy.onControlSourceAdd("midi"),this.#h=!0,{terminate:()=>{this.#h=!1,this.#u.proxy.onControlSourceRemove("midi")}}}get field(){return this.#e}get valueMapping(){return this.#r}get stringMapping(){return this.#i}get name(){return this.#n}get anchor(){return this.#o}get type(){return this.#e.type}get address(){return this.#e.address}get track(){return this.#l}valueAt(e){let t=this.#l;if(t.nonEmpty()){let n=t.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return this.#a.subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return this.#h&&e.onControlSourceAdd("midi"),this.#e.pointerHub.filter(...Km).forEach(t=>e.onControlSourceAdd(Tl(t.pointerType))),this.#u.subscribe(e)}getValue(){return this.#e.getValue()}setValue(e){this.#e.setValue(e)}setUnitValue(e){this.setValue(this.#r.y(e))}getUnitValue(){return this.#r.x(this.getValue())}getControlledValue(){return this.#r.y(this.getControlledUnitValue())}getControlledUnitValue(){return this.#d??this.getUnitValue()}getControlledPrintValue(){return this.#i.x(this.getControlledValue())}getPrintValue(){return this.#i.x(this.getValue())}setPrintValue(e){let t=this.#i.y(e);t.type==="unitValue"?this.setUnitValue(G(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(this.#r.clamp(this.#e.initValue))}terminate(){this.#c.ifSome(e=>e.terminate()),this.#c=m.None,this.#s.terminate()}},Tl=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MidiControl:return"midi";case c.ParameterController:return"external";default:return w(`${r.toString()} is an unknown pointer type`)}};var ea=class{#t;#e;#r;constructor(e,t,n){this.#t=E.newSet(i=>i.uuid),this.#e=new Ce,this.#r=e.catchupAndSubscribe({onAdd:i=>{let o=t(i.box),s=this.#t.add(o);N(s,`Could not add ${o}`),this.#e.proxy.onAdd(o)},onRemove:i=>{let o=i.box.address.uuid;this.#e.proxy.onRemove(this.#t.removeByKey(o))}},n)}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return this.#t.forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return this.#t.values()}size(){return this.#t.size()}isEmpty(){return this.size()===0}terminate(){this.#t.clear(),this.#e.terminate(),this.#r.terminate()}};var Lt=class r{static OffsetFractions=gt.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();static OffsetStringMapping=B.indices("",this.OffsetFractions.map(([e,t])=>`${e}/${t}`));type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{delay:this.#r.createParameter(e.delay,O.linearInteger(0,r.OffsetFractions.length-1),r.OffsetStringMapping,"delay"),feedback:this.#r.createParameter(e.feedback,O.unipolar(),B.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:this.#r.createParameter(e.cross,O.unipolar(),B.numeric({unit:"%",fractionDigits:0}),"cross"),filter:this.#r.createParameter(e.filter,O.bipolar(),B.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:this.#r.createParameter(e.dry,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"dry"),wet:this.#r.createParameter(e.wet,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"wet")}}};var Bi=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{decay:this.#r.createParameter(e.decay,O.unipolar(),B.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:this.#r.createParameter(e.preDelay,O.exponential(.001,.5),B.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:this.#r.createParameter(e.damp,O.unipolar(),B.numeric({unit:"%",fractionDigits:0}),"damping"),filter:this.#r.createParameter(e.filter,O.bipolar(),B.numeric({unit:"%",fractionDigits:0}),"filter"),dry:this.#r.createParameter(e.dry,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"dry"),wet:this.#r.createParameter(e.wet,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"wet")}}};var Oi=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get spectrum(){return this.#e.address.append(4095)}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{highPass:Zm(this.#r,e.highPass,"High-Pass"),lowShelf:qm(this.#r,e.lowShelf,"Low-Shelf"),lowBell:Ml(this.#r,e.lowBell,"Low-Bell"),midBell:Ml(this.#r,e.midBell,"Mid-Bell"),highBell:Ml(this.#r,e.highBell,"High-Bell"),highShelf:qm(this.#r,e.highShelf,"High-Shelf"),lowPass:Zm(this.#r,e.lowPass,"Low-Pass")}}},Ul=O.exponential(20,2e4),Hm=O.linear(-24,24),Gm=O.exponential(.01,10),Zm=(r,e,t)=>({enabled:r.createParameter(e.enabled,O.bool,B.bool,"enabled"),frequency:r.createParameter(e.frequency,Ul,B.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,O.linearInteger(1,4),B.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,Gm,B.numeric({unit:"",fractionDigits:3}),`${t} Q`)}),qm=(r,e,t)=>({enabled:r.createParameter(e.enabled,O.bool,B.bool,"enabled"),frequency:r.createParameter(e.frequency,Ul,B.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,Hm,B.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Ml=(r,e,t)=>({enabled:r.createParameter(e.enabled,O.bool,B.bool,"enabled"),frequency:r.createParameter(e.frequency,Ul,B.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,Hm,B.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,Gm,B.numeric({unit:"",fractionDigits:3}),`${t} Q`)});var ti=class{static Comparator=(e,t)=>e.position-t.position;type="marker-event";#t=new V;#e;#r;constructor(e,t){this.#e=e,this.#r=t,this.#t.own(this.#r.subscribe(oe.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();this.#r.position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get plays(){return this.#r.plays.getValue()}get hue(){return this.#r.hue.getValue()}get label(){return this.#r.label.getValue()}get trackAdapter(){return this.#r.track.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Nt).markerTrack)}terminate(){this.#t.terminate()}toString(){return`{MarkerBoxAdapter ${E.toString(this.#r.address.uuid).substring(0,4)}, plays: ${this.plays}`}};var ta=class{#t;#e;changeNotifier;#r;#i;#n;constructor(e,t){this.#t=e,this.#e=t,this.changeNotifier=new W,this.#r=E.newSet(n=>n.uuid),this.#i=ir.create(ti.Comparator),this.#n=this.#e.markers.pointerHub.catchupAndSubscribe({onAdd:({box:n})=>{if(n instanceof Ni){let i=this.#t.boxAdapters.adapterFor(n,ti),o=this.#r.add(i);N(o,"Could not add adapter"),this.#i.add(i),this.dispatchChange()}},onRemove:({box:{address:{uuid:n}}})=>{this.#i.remove(this.#r.removeByKey(n)),this.dispatchChange()}})}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return this.#t}get enabled(){return this.#e.enabled.getValue()}get events(){return this.#i}get object(){return this.#e}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){this.#i.onIndexingChanged(),this.dispatchChange()}terminate(){this.#n.terminate()}};var Nt=class{#t;#e;constructor(e,t){this.#t=t,this.#e=new ta(e,this.#t.markerTrack)}terminate(){}get box(){return this.#t}get uuid(){return this.#t.address.uuid}get address(){return this.#t.address}get markerTrack(){return this.#e}};var xr=class{#t;constructor(e,t){this.#t=t}get box(){return this.#t}get uuid(){return this.#t.address.uuid}get address(){return this.#t.address}get source(){return this.#t.source.targetVertex.unwrap("Insufficient Vertex")}get target(){return this.#t.target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};var lt=class{#t;#e;#r;#i;#n;#o=!1;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=t.attributes,this.#n=this.#r.own(new ce(e))}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return this.#r.own(e)}ownAll(...e){this.#r.ownAll(...e)}onSelected(){this.#o=!0}onDeselected(){this.#o=!1}isSelected(){return this.#o}get box(){return this.#e}get attributes(){return this.#i}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get parameters(){return this.#n}get modular(){return this.#t.boxAdapters.adapterFor(this.#e.attributes.collection.targetVertex.unwrap().box,yr)}terminate(){this.#r.terminate()}};var Ue;(function(r){r.Input="input",r.Output="output"})(Ue||(Ue={}));var Ve=class r{static create(e,t,n,i){return new r(e,t,n,i??t.fieldName)}#t;#e;#r;#i;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#r=n,this.#i=i}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(n=>n===t))}get connections(){return this.#e.pointerHub.isEmpty()?P.empty():this.#e.pointerHub.filter(c.VoltageConnection).map(({box:e})=>this.#t.adapterFor(e,xr))}get field(){return this.#e}get address(){return this.#e.address}get direction(){return this.#r}get name(){return this.#i}toString(){return`{ModuleConnectorAdapter address: ${this.#e.address.toString()}, direction: ${this.#r}}`}};var Ci=class extends lt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=this.parameters.createParameter(t.time,O.exponential(1,1e4),B.numeric({unit:"ms"}),"Time"),this.#e=Ve.create(e.boxAdapters,t.voltageInput,Ue.Input,"Input"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Output")}get parameterTime(){return this.#t}get voltageInput(){return this.#e}get voltageOutput(){return this.#r}get inputs(){return[this.#e]}get outputs(){return[this.#r]}};var Di=class extends lt{#t;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.input,Ue.Input,"Input")}get voltageInput(){return this.#t}get inputs(){return[this.#t]}get outputs(){return P.empty()}};var Ri=class extends lt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=this.parameters.createParameter(t.gain,O.DefaultDecibel,B.numeric({unit:"db"}),"Gain"),this.#e=Ve.create(e.boxAdapters,t.voltageInput,Ue.Input,"Input"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Output")}get parameterGain(){return this.#t}get voltageInput(){return this.#e}get voltageOutput(){return this.#r}get inputs(){return[this.#e]}get outputs(){return[this.#r]}};var zi=class extends lt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.voltageInputX,Ue.Input,"X"),this.#e=Ve.create(e.boxAdapters,t.voltageInputY,Ue.Input,"Y"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Result")}get inputs(){return[this.#t,this.#e]}get outputs(){return[this.#r]}};var Ti=class extends lt{#t;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.output,Ue.Output,"Output")}get voltageOutput(){return this.#t}get inputs(){return P.empty()}get outputs(){return[this.#t]}};var Mi;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>H(t.accept({visitModuleGainBox:n=>e.adapterFor(n,Ri),visitModuleDelayBox:n=>e.adapterFor(n,Ci),visitModuleMultiplierBox:n=>e.adapterFor(n,zi),visitModularAudioInputBox:n=>e.adapterFor(n,Ti),visitModularAudioOutputBox:n=>e.adapterFor(n,Di)}),`Could not find ModuleAdapter for ${t.name}`)})(Mi||(Mi={}));var Ui=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get moduleAdapter(){return Mi.adapterFor(this.#t.boxAdapters,this.#r.box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(this.#r.address.fieldKeys)}get#r(){return this.#e.parameter.targetVertex.unwrap("Parameter not assigned")}terminate(){}};var br=class{type="audio-effect";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}parameterAt(e){return w("Not yet implemented")}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return this.#t.boxAdapters.adapterFor(this.#e.modularSetup.targetVertex.unwrap("No Modular found").box,yr)}elements(){return this.#e.userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>this.#t.boxAdapters.adapterFor(e.box,Ui))}terminate(){}};var yr=class{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#r=e,this.#i=t,this.#e=this.#t.own(new Ce),this.#n=E.newSet(a=>a.uuid),this.#o=E.newSet(a=>a.uuid);let n=a=>{let u=Mi.adapterFor(this.#r.boxAdapters,a.box);this.#n.add(u)&&this.#e.proxy.onModuleAdded(u)},i=a=>this.#e.proxy.onModuleRemoved(this.#n.removeByKey(a.address.uuid)),o=a=>{let u=this.#r.boxAdapters.adapterFor(a.box,xr);this.#o.add(u)&&this.#e.proxy.onConnectionAdded(u)},s=a=>this.#e.proxy.onConnectionRemoved(this.#o.removeByKey(a.address.uuid));this.#i.modules.pointerHub.filter(c.ModuleCollection).forEach(n),this.#i.connections.pointerHub.filter(c.ConnectionCollection).forEach(o),this.#t.own(this.#i.modules.pointerHub.subscribe({onAdd:n,onRemove:i},c.ModuleCollection)),this.#t.own(this.#i.connections.pointerHub.subscribe({onAdd:o,onRemove:s},c.ConnectionCollection))}catchupAndSubscribe(e){return xl(e.onModuleAdded,t=>this.#n.forEach(n=>t(n))),xl(e.onConnectionAdded,t=>this.#o.forEach(n=>t(n))),this.#e.subscribe(e)}get box(){return this.#i}get address(){return this.#i.address}get uuid(){return this.#i.address.uuid}get editingField(){return this.#i.editing}get labelField(){return this.#i.label}get modules(){return this.#n.values()}get connections(){return this.#o.values()}get device(){return this.#r.boxAdapters.adapterFor(H(this.#i.device.pointerHub.incoming().at(0),"No device found").box,br)}terminate(){console.debug(`terminate ${this}`),this.#t.terminate()}};var Vi=class r{static Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];static DurationPPQNs=r.Durations.map(([e,t])=>te.fromSignature(e,t));static DurationStrings=r.Durations.map(([e,t])=>`${e}/${t}`);type="groove-adapter";#t=new V;#e;#r;#i;namedParameter;#n=new qo({duration:()=>this.#s,fx:e=>$l(e,this.#o),fy:e=>$l(e,1-this.#o)});#o=0;#s=te.SemiQuaver*2;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new ce(this.#e)),this.namedParameter=this.#a(t),this.#t.ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>this.#s=n.getValue()),this.namedParameter.amount.catchupAndSubscribe(n=>this.#o=om(n.getValue(),.01)))}unwarp(e){return this.#n.unwarp(e)}warp(e){return this.#n.warp(e)}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#t.terminate()}#a(e){return{duration:this.#i.createParameter(e.duration,O.values(r.DurationPPQNs),B.values("",r.DurationPPQNs,r.DurationStrings),"duration"),amount:this.#i.createParameter(e.amount,O.unipolar(),B.percent({fractionDigits:0}),"amount")}}};var wr=class{#t;#e;#r;#i;#n;#o=new V;#s;#a=m.None;constructor(e,t,n,i,o){this.#t=e,this.#e=t,this.#r=n,this.#i=i,this.#n=o??0,this.#s=this.#o.own(new W),this.#o.own(this.#t.subscribe(()=>this.#s.notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${i} (${e.getValue()}) is out of bounds`,t)}get field(){return this.#t}get valueMapping(){return this.#e}get stringMapping(){return this.#r}get name(){return this.#i}get anchor(){return this.#n}get type(){return this.#t.type}get address(){return this.#t.address}get track(){return this.#a}subscribe(e){return this.#s.subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return this.#t.getValue()}setValue(e){this.#t.setValue(this.#e.clamp(e))}setUnitValue(e){this.setValue(this.#e.y(e))}getUnitValue(){return this.#e.x(this.getValue())}getPrintValue(){return this.#r.x(this.getValue())}setPrintValue(e){let t=this.#r.y(e);t.type==="unitValue"?this.setUnitValue(G(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(this.#e.clamp(this.#t.initValue))}terminate(){this.#o.terminate()}};var ra=class{#t;#e;#r;#i;#n;#o;constructor(e){this.#t=e,this.#e=new wr(this.#t.keyboard,O.values([88,76,61,49]),B.numeric({fractionDigits:1}),"Keyboard Type"),this.#r=new wr(this.#t.timeRangeInQuarters,O.exponential(1,64),B.numeric({fractionDigits:1}),"Time-Range"),this.#i=new wr(this.#t.noteScale,O.exponential(.5,2),B.numeric({fractionDigits:1}),"Note Scale"),this.#n=new wr(this.#t.noteLabels,O.bool,B.bool,"Note Labels"),this.#o=new wr(this.#t.transpose,O.linearInteger(-48,48),B.numeric({fractionDigits:0}),"Transpose")}subscribe(e){return this.#t.box.subscribe(oe.Children,()=>e(this))}get object(){return this.#t}get keyboard(){return this.#e}get timeRangeInQuarters(){return this.#r}get noteScale(){return this.#i}get noteLabels(){return this.#n}get transpose(){return this.#o}};var ji=class{#t;#e;#r;#i;#n;constructor(e,t){this.#t=e,this.#e=t,this.#r=Te.create(this.#e.audioUnits,n=>this.#t.boxAdapters.adapterFor(n,St),c.AudioUnits),this.#i=new ea(this.#e.audioBusses.pointerHub,n=>this.#t.boxAdapters.adapterFor(n,He),c.AudioBusses),this.#n=new ra(this.#e.pianoMode)}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get audioBusses(){return this.#i}get audioUnits(){return this.#r}get clips(){return this.#r.adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return this.#t.boxAdapters.adapterFor(this.#e.groove.targetVertex.unwrap("no groove").box,Vi)}get timeline(){return this.#t.boxAdapters.adapterFor(this.#e.timeline.targetVertex.unwrap("no timeline").box,Nt)}get pianoMode(){return this.#n}get created(){return new Date(this.#e.created.getValue())}terminate(){this.#r.terminate()}};var Li=class{type="instrument";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return se.Audio}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!1}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{flutter:this.#r.createParameter(e.flutter,O.unipolar(),B.percent(),"flutter"),wow:this.#r.createParameter(e.wow,O.unipolar(),B.percent(),"wow"),noise:this.#r.createParameter(e.noise,O.unipolar(),B.percent(),"noise"),saturation:this.#r.createParameter(e.saturation,O.unipolar(),B.percent(),"saturation")}}};var Ki=class{type="instrument";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return se.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"volume"),octave:this.#r.createParameter(e.octave,O.linearInteger(-3,3),B.numeric(),"octave",.5),tune:this.#r.createParameter(e.tune,O.linear(-1200,1200),B.numeric({unit:"cent",fractionDigits:0}),"tune",.5),waveform:this.#r.createParameter(e.waveform,O.linearInteger(0,3),B.indices("",["sine","triangle","sawtooth","square"]),"waveform"),cutoff:this.#r.createParameter(e.cutoff,O.exponential(20,18e3),B.numeric({unit:"Hz"}),"cutoff"),resonance:this.#r.createParameter(e.resonance,O.exponential(.1,20),B.numeric({unit:"q",fractionDigits:1}),"resonance"),attack:this.#r.createParameter(e.attack,O.exponential(.001,1),B.numeric({unit:"s",fractionDigits:3}),"attack"),release:this.#r.createParameter(e.release,O.exponential(.001,1),B.numeric({unit:"s",fractionDigits:3}),"release"),filterEnvelope:this.#r.createParameter(e.filterEnvelope,O.linear(-.5,.5),B.percent(),"filter env",.5)}}};var Ar=class r{static RateFractions=gt.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();static RateStringMapping=B.indices("",this.RateFractions.map(([e,t])=>`${e}/${t}`));type="midi-effect";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}parameterAt(e){return this.#r.parameterAt(e)}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{modeIndex:this.#r.createParameter(e.modeIndex,O.linearInteger(0,2),B.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:this.#r.createParameter(e.numOctaves,O.linearInteger(1,5),B.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:this.#r.createParameter(e.rateIndex,O.linearInteger(0,r.RateFractions.length-1),r.RateStringMapping,"Rate"),gate:this.#r.createParameter(e.gate,O.linear(0,2),B.percent({fractionDigits:0}),"Gate"),repeat:this.#r.createParameter(e.repeat,O.linearInteger(1,16),B.numeric({fractionDigits:0}),"Repeat"),velocity:this.#r.createParameter(e.velocity,O.bipolar(),B.percent({fractionDigits:0,bipolar:!1}),"Velocity")}}};var Zi=class{type="midi-effect";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{octaves:this.#r.createParameter(e.octaves,O.linearInteger(-7,7),B.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:this.#r.createParameter(e.semiTones,O.linearInteger(-36,36),B.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:this.#r.createParameter(e.cents,O.linear(-50,50),B.numeric({unit:"cents",fractionDigits:1}),"cents")}}};var qi=class{type="instrument";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return se.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,O.DefaultDecibel,B.numeric({unit:"db",fractionDigits:1}),"volume"),release:this.#r.createParameter(e.release,O.exponential(.001,8),B.numeric({unit:"s",fractionDigits:3}),"release")}}};var Hi=class{class="device-host";accepts=!1;type="instrument";#t=new V;#e;#r;#i;#n;#o;namedParameter;#s=m.None;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(Te.create(this.#r.midiEffects,n=>this.#e.boxAdapters.adapterFor(n,Q.isMidiEffect),c.MidiEffectHost)),this.#n=this.#t.own(Te.create(this.#r.audioEffects,n=>this.#e.boxAdapters.adapterFor(n,Q.isAudioEffect),c.AudioEffectHost)),this.#o=this.#t.own(new ce(this.#e)),this.namedParameter=this.#a(t),this.#t.own(this.#r.file.catchupAndSubscribe(n=>{this.#s=n.targetVertex.map(({box:i})=>this.#e.boxAdapters.adapterFor(i,Et)),this.#s.unwrapOrNull()?.getOrCreateLoader()}))}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get peakAddress(){return this.#r.address.append(1001)}get indexField(){return this.#r.index}get gate(){return this.#r.gate.getValue()}get exclude(){return this.#r.exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${this.#s.mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return this.#r.icon}get defaultTrackType(){return se.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return this.#r.midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return this.#r.audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return this.#s}fileUUID(){return this.#r.file.targetAddress.unwrap().uuid}resetParameters(){this.#r.mute.reset(),this.#r.solo.reset(),this.#r.exclude.reset(),this.#r.polyphone.reset(),this.#r.pitch.reset(),this.#r.attack.reset(),this.#r.release.reset(),this.#r.sampleStart.reset(),this.#r.sampleEnd.reset(),this.#r.gate.reset()}copyToIndex(e){_i.create(this.#r.graph,E.generate(),t=>{t.file.refer(this.#r.file.targetVertex.unwrap()),t.device.refer(this.#r.device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(this.#r.mute.getValue()),t.solo.setValue(this.#r.solo.getValue()),t.sampleStart.setValue(this.#r.sampleStart.getValue()),t.sampleEnd.setValue(this.#r.sampleEnd.getValue()),t.attack.setValue(this.#r.attack.getValue()),t.release.setValue(this.#r.release.getValue()),t.pitch.setValue(this.#r.pitch.getValue()),t.exclude.setValue(this.#r.exclude.getValue()),t.gate.setValue(this.#r.gate.getValue())})}get midiEffects(){return this.#i}get inputAdapter(){return m.wrap(this)}get audioEffects(){return this.#n}get labelField(){return this.#r.label}get enabledField(){return this.#r.enabled}get minimizedField(){return this.#r.minimized}device(){return this.#e.boxAdapters.adapterFor(this.#r.device.targetVertex.unwrap().box,$r)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#t.terminate()}#a(e){return{gate:this.#o.createParameter(e.gate,O.linearInteger(0,2),B.indices("",["Off","On","Loop"]),"Gate"),mute:this.#o.createParameter(e.mute,O.bool,B.bool,"Mute"),solo:this.#o.createParameter(e.solo,O.bool,B.bool,"Solo"),polyphone:this.#o.createParameter(e.polyphone,O.bool,B.bool,"Polyphone"),exclude:this.#o.createParameter(e.exclude,O.bool,B.bool,"Exclude"),pitch:this.#o.createParameter(e.pitch,O.linear(-1200,1200),B.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:this.#o.createParameter(e.sampleStart,O.unipolar(),B.percent(),"Start",0),sampleEnd:this.#o.createParameter(e.sampleEnd,O.unipolar(),B.percent(),"End",1),attack:this.#o.createParameter(e.attack,O.exponential(.001,5),B.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:this.#o.createParameter(e.release,O.exponential(.001,5),B.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}}};var $r=class{type="instrument";accepts="midi";#t;#e;#r;#i;constructor(e,t){this.#t=e,this.#e=t,this.#r=Te.create(t.samples,n=>e.boxAdapters.adapterFor(n,Hi),c.Sample),this.#i=new ce(this.#t)}reset(){this.#r.adapters().forEach(e=>e.box.delete())}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get notesAddress(){return this.#e.address.append(1e3)}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return se.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}get samples(){return this.#r}get context(){return this.#t}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#i.terminate()}};var Gi=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new ce(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,O.decibel(-72,0,12),B.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:this.#r.createParameter(e.panning,O.bipolar(),B.panning,"Panning",.5),stereo:this.#r.createParameter(e.stereo,O.bipolar(),B.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:this.#r.createParameter(e.invertL,O.bool,B.bool,"Invert Left"),invertR:this.#r.createParameter(e.invertR,O.bool,B.bool,"Invert Right"),swap:this.#r.createParameter(e.swap,O.bool,B.bool,"Swap")}}};var ri;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(ri||(ri={}));var Wi=class{type="midi-effect";accepts="midi";#t;#e;constructor(e,t){this.#t=e,this.#e=t,this.groove()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}groove(){return this.#t.boxAdapters.adapterFor(this.#e.groove.targetVertex.unwrap("no groove").box,ri.checkType)}catchupAndSubscribeGroove(e){return this.#e.groove.catchupAndSubscribe(t=>e(this.#t.boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,ri.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Ji=class{type="audio-effect";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get commentField(){return this.#e.comment}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Yi=class{type="midi-effect";accepts="midi";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get commentField(){return this.#e.comment}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Xi=class{type="instrument";accepts="midi";#t=new V;#e;#r;#i;namedParameter;#n;#o;#s;#a=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#i=new ce(this.#e),this.namedParameter=this.#u(t),this.#n=new pi,this.#o=new pi,this.#s=new pi,this.#t.ownAll(this.#n.subscribe(this.#l),this.#r.file.catchupAndSubscribe(({targetVertex:n})=>this.#n.wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),this.#r.presetIndex.catchupAndSubscribe(n=>this.#o.match({none:()=>this.#s.clear(),some:i=>this.#s.wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return this.#n}get soundfont(){return this.#o}get preset(){return this.#s}get presetIndex(){return this.#r.presetIndex.getValue()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get labelField(){return this.#r.label}get iconField(){return this.#r.icon}get defaultTrackType(){return se.Notes}get enabledField(){return this.#r.enabled}get minimizedField(){return this.#r.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#e.boxAdapters.adapterFor(this.#r.host.targetVertex.unwrap("no device-host").box,Q.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#a.terminate(),this.#a=Z.Empty,this.#i.terminate()}#u(e){return{}}#l=e=>e.match({none:()=>{this.#s.clear(),this.#o.clear()},some:t=>t.soundfont.match({none:()=>{this.#s.clear(),this.#o.clear(),this.#a.terminate(),this.#a=t.subscribe(n=>{if(n.type==="loaded"){let i=t.soundfont.unwrap();this.#s.wrap(i.presets[this.presetIndex]??i.presets[0]),this.#o.wrap(i)}else n.type==="error"?(this.#s.clear(),this.#o.clear()):n.type==="idle"&&(this.#s.clear(),this.#o.clear())})},some:n=>{this.#o.wrap(n),this.#s.wrap(n.presets[this.presetIndex]??n.presets[0])}})})};var ia=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return this.#t.soundfontManager.getOrCreate(this.#e.address.uuid)}terminate(){}};var na=class{#t;#e;#r;#i;constructor(e){this.#t=e,this.#e=E.newSet(t=>t.uuid),this.#r=new Set,this.#i=this.#t.boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let n=this.#e.getOrNull(t.uuid);z(n)&&(this.#r.add(n.box),this.#e.removeByValue(n).terminate())}}})}terminate(){this.#e.values().forEach(e=>e.terminate()),this.#e.clear(),this.#i.terminate()}adapterFor(e,t){if(this.#r.has(e))return w(`Cannot resolve adapter for already deleted box: ${e}`);let n=this.#e.getOrNull(e.address.uuid);if(n===null){n=this.#n(e);let i=this.#e.add(n);N(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?n instanceof t?n:w(`${n} is not instance of ${t}`):t(n)?n:w(`${n} did not pass custom type guard`):w("Unknown checkType method")}#n(e){return H(e.accept({visitRootBox:t=>new ji(this.#t,t),visitArpeggioDeviceBox:t=>new Ar(this.#t,t),visitPitchDeviceBox:t=>new Zi(this.#t,t),visitStereoToolDeviceBox:t=>new Gi(this.#t,t),visitDelayDeviceBox:t=>new Lt(this.#t,t),visitReverbDeviceBox:t=>new Bi(this.#t,t),visitRevampDeviceBox:t=>new Oi(this.#t,t),visitUnknownAudioEffectDeviceBox:t=>new Ji(this.#t,t),visitPlayfieldDeviceBox:t=>new $r(this.#t,t),visitPlayfieldSampleBox:t=>new Hi(this.#t,t),visitModularDeviceBox:t=>new br(this.#t,t),visitTapeDeviceBox:t=>new Li(this.#t,t),visitNanoDeviceBox:t=>new qi(this.#t,t),visitVaporisateurDeviceBox:t=>new Ki(this.#t,t),visitSoundfontDeviceBox:t=>new Xi(this.#t,t),visitModularBox:t=>new yr(this.#t,t),visitModuleConnectionBox:t=>new xr(this.#t,t),visitModuleDelayBox:t=>new Ci(this.#t,t),visitModuleGainBox:t=>new Ri(this.#t,t),visitModuleMultiplierBox:t=>new zi(this.#t,t),visitModularAudioInputBox:t=>new Ti(this.#t,t),visitModularAudioOutputBox:t=>new Di(this.#t,t),visitDeviceInterfaceKnobBox:t=>new Ui(this.#t,t),visitAudioUnitBox:t=>new St(this.#t,t),visitAudioBusBox:t=>new He(this.#t,t),visitAuxSendBox:t=>new Fi(this.#t,t),visitSoundfontFileBox:t=>new ia(this.#t,t),visitAudioFileBox:t=>new Et(this.#t,t),visitAudioClipBox:t=>new fr(this.#t,t),visitAudioRegionBox:t=>new gr(this.#t,t),visitNoteEventBox:t=>new Qr(this.#t,t),visitNoteEventCollectionBox:t=>new ut(this.#t,t),visitNoteClipBox:t=>new Ii(this.#t,t),visitNoteRegionBox:t=>new vr(this.#t,t),visitValueEventBox:t=>new pr(this.#t,t),visitValueEventCollectionBox:t=>new at(this.#t,t),visitValueClipBox:t=>new mr(this.#t,t),visitValueRegionBox:t=>new jt(this.#t,t),visitTrackBox:t=>new Ne(this.#t,t),visitTimelineBox:t=>new Nt(this.#t,t),visitMarkerBox:t=>new ti(this.#t,t),visitZeitgeistDeviceBox:t=>new Wi(this.#t,t),visitUnknownMidiEffectDeviceBox:t=>new Yi(this.#t,t),visitGrooveShuffleBox:t=>new Vi(this.#t,t)}),`Could not find factory for ${e}`)}};var Wm;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,n=i=>{let o=t.get(i)??0,s=i;for(;t.has(s);)o++,s=`${i} ${o}`;return t.set(i,o),t.set(s,1),s};Object.keys(e).forEach(i=>{let o=e[i];o.fileName=n(r.sanitizeFileName(o.fileName))})}})(Wm||(Wm={}));var Jm=Ke.createBuilder({position:Ke.float,playbackTimestamp:Ke.float,countInBeatsRemaining:Ke.float,countInBeatsTotal:Ke.float,isPlaying:Ke.bool,isCountingIn:Ke.bool,isRecording:Ke.bool});var Pt=class{#t=new V;#e;#r;#i;constructor(e,t){this.#e=e,this.#r=t,this.#i=new Fe(128),this.#t.own(this.#e.broadcastIntegers(this.#r,new Int32Array(this.#i.buffer),Ot))}noteOn(e){e>=0&&e<128&&this.#i.setBit(e,!0)}noteOff(e){e>=0&&e<128&&this.#i.setBit(e,!1)}reset(){}clear(){this.#i.clear()}terminate(){this.#t.terminate()}toString(){return`{${this.constructor.name}}`}};var Kt;(function(r){r[r.MTHD=1297377380]="MTHD",r[r.MTRK=1297379947]="MTRK"})(Kt||(Kt={}));var Me;(function(r){r[r.NOTE_ON=144]="NOTE_ON",r[r.NOTE_OFF=128]="NOTE_OFF",r[r.NOTE_AFTER_TOUCH=160]="NOTE_AFTER_TOUCH",r[r.CONTROLLER=176]="CONTROLLER",r[r.PROGRAM_CHANGE=192]="PROGRAM_CHANGE",r[r.CHANNEL_AFTER_TOUCH=208]="CHANNEL_AFTER_TOUCH",r[r.PITCH_BEND=224]="PITCH_BEND"})(Me||(Me={}));var oa=class r{ticks;type;param0;param1;static Comparator=(e,t)=>e.ticks-t.ticks;constructor(e,t,n,i){this.ticks=e,this.type=t,this.param0=n,this.param1=i}static decode(e,t,n){switch(t){case Me.NOTE_ON:case Me.NOTE_OFF:case Me.CONTROLLER:case Me.PITCH_BEND:case Me.NOTE_AFTER_TOUCH:return new r(n,t,e.readByte(),e.readByte());case Me.PROGRAM_CHANGE:case Me.CHANNEL_AFTER_TOUCH:return new r(n,t,e.readByte(),0)}{let i;do i=e.readByte()&255;while(i<128);e.skip(-1)}return null}accept(e){switch(this.type){case Me.NOTE_ON:{this.param1===0?A(e.noteOff,this.param0):A(e.noteOn,this.param0,this.param1/127);break}case Me.NOTE_OFF:{A(e.noteOff,this.param0);break}case Me.PITCH_BEND:{let t=this.param0&127,n=this.param1&127,i=t|n<<7;A(e.pitchBend,8192>=i?i/8192-1:(i-8191)/8192);break}case Me.CONTROLLER:{A(e.controller,this.param0,this.param1/127);break}default:break}}toString(){return`ControlEvent{ticks: ${this.ticks}, type: ${this.type}, param0: ${this.param0}, param1: ${this.param1}}`}};var ke;(function(r){r[r.SEQUENCE_NUMBER=0]="SEQUENCE_NUMBER",r[r.TEXT_EVENT=1]="TEXT_EVENT",r[r.COPYRIGHT_NOTICE=2]="COPYRIGHT_NOTICE",r[r.SEQUENCE_TRACK_NAME=3]="SEQUENCE_TRACK_NAME",r[r.INSTRUMENT_NAME=4]="INSTRUMENT_NAME",r[r.LYRICS=5]="LYRICS",r[r.MARKER=6]="MARKER",r[r.CUE_POINT=7]="CUE_POINT",r[r.CHANNEL_PREFIX=32]="CHANNEL_PREFIX",r[r.SET_TEMPO=81]="SET_TEMPO",r[r.SMPTE_OFFSET=84]="SMPTE_OFFSET",r[r.TIME_SIGNATURE=88]="TIME_SIGNATURE",r[r.KEY_SIGNATURE=89]="KEY_SIGNATURE",r[r.SEQUENCER_SPECIFIC=127]="SEQUENCER_SPECIFIC",r[r.PREFIX_PORT=33]="PREFIX_PORT",r[r.END_OF_TRACK=47]="END_OF_TRACK"})(ke||(ke={}));var sa=class r{ticks;type;value;constructor(e,t,n){this.ticks=e,this.type=t,this.value=n}static decode(e,t){let n=e.readByte()&255,i=e.readVarLen();switch(n){case ke.SET_TEMPO:return new r(t,n,e.readTempo());case ke.TIME_SIGNATURE:return new r(t,n,e.readSignature());case ke.END_OF_TRACK:return new r(t,n,null);case ke.TEXT_EVENT:case ke.COPYRIGHT_NOTICE:case ke.SEQUENCE_TRACK_NAME:case ke.INSTRUMENT_NAME:case ke.LYRICS:case ke.MARKER:case ke.CUE_POINT:case ke.SEQUENCE_NUMBER:case ke.CHANNEL_PREFIX:case ke.KEY_SIGNATURE:case ke.SEQUENCER_SPECIFIC:case ke.PREFIX_PORT:case ke.SMPTE_OFFSET:default:e.skip(i)}return null}toString(){return`MetaEvent{ticks: ${this.ticks}, type: ${this.type}, value: ${this.value}}`}};var Er;(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"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>1<t.length?t[1]&255:0,r.readParam2=t=>2<t.length?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.asPitchBend=t=>{let n=r.readParam1(t)&127,i=r.readParam2(t)&127,o=n|i<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.isController=t=>r.readCommand(t)===e.Controller,r.asValue=t=>{let n=r.readParam2(t);return 64<n?.5+(n-63)/128:64>n?n/128:.5},r.noteOn=(t,n,i)=>{let o=new Uint8Array(3);return o[0]=t|e.NoteOn,o[1]=n|0,o[2]=i|0,o},r.noteOff=(t,n)=>{let i=new Uint8Array(3);return i[0]=t|e.NoteOff,i[1]=n,i},r.accept=(t,n)=>{if(!Tr(t))if(r.isNoteOn(t))A(n.noteOn,r.readPitch(t),r.readVelocity(t));else if(r.isNoteOff(t))A(n.noteOff,r.readPitch(t));else if(r.isPitchWheel(t)){let i=r.readParam1(t)&127,o=r.readParam2(t)&127,s=i|o<<7;A(n.pitchBend,8192>=s?s/8192-1:(s-8191)/8192)}else r.isController(t)&&A(n.controller,r.readParam1(t),r.readParam2(t)/127)},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)}`:"Unknown"})(Er||(Er={}));var aa=class{tracks;formatType;timeDivision;constructor(e,t,n){this.tracks=e,this.formatType=t,this.timeDivision=n}};var ua=class r{controlEvents;metaEvents;static decode(e){let t=new Lr,n=[],i=0,o=0,s=0;for(;;){let a=e.readVarLen(),u=e.readByte()&255;if(u<240){i+=a,u<128?e.skip(-1):(o=u&240,s=u&15);let l=oa.decode(e,o,i);z(l)&&t.add(s,l)}else if(u<248)e.skipSysEx(u);else{i+=a;let l=sa.decode(e,i);if(l!==null&&(n.push(l),l.type===ke.END_OF_TRACK))break}}return new r(t,n)}static createEmpty(){return new r(new Lr,[])}constructor(e,t){this.controlEvents=e,this.metaEvents=t}encode(){let e=Ee.create(),t=n=>{if(n<=127)e.writeByte(n);else{let i=n,o=[];for(o.push(i&127),i>>=7;i;){let s=i&127|128;o.push(s),i>>=7}o.reverse().forEach(s=>e.writeByte(s))}};return this.controlEvents.forEach((n,i)=>{let o=0,s=-1;i.forEach(a=>{let u=a.ticks-o;if(t(u),a.type===Me.NOTE_ON){let l=144|n;l!==s&&e.writeByte(l),e.writeByte(a.param0),e.writeByte(a.param1)}else if(a.type===Me.NOTE_OFF){let l=144|n;l!==s&&e.writeByte(l),e.writeByte(a.param0),e.writeByte(a.param1)}else console.warn("Unknown ControlType");o=a.ticks})}),e.toArrayBuffer()}};var la=class{input;#t=!1;#e=!1;constructor(e){this.input=e}decode(){this.input.littleEndian=!1;let e=this.input.readInt();if(e===Kt.MTHD){if(this.input.readInt()!==6)throw new Error("2nd int in header must be 6")}else throw console.warn(`Unsupported midi format ${e} !== ${Kt.MTHD}`),new Error("Unsupported midi format");let t=this.input.readShort(),n=this.input.readShort(),i=this.input.readShort(),o=[];for(let s=0;s<n;s++){let a=this.input.readInt(),u=this.input.readInt(),l=this.input.position;a===Kt.MTRK&&(o[s]=ua.decode(this)),this.input.position=l+u}return 0<this.input.remaining()&&console.warn(`${this.input.remaining()} bytes remaining.`),new aa(o,t,i)}readVarLen(){let e=this.input.readByte()&255,t;if(0<(e&128)){e&=127;do t=this.input.readByte()&255,e=(e<<7)+(t&127);while(0<(t&128))}return e}readSignature(){let e=this.input.readByte()&255,t=this.input.readByte()&255,n=this.input.readByte()&255,i=this.input.readByte()&255;return this.#t,[e,1<<t]}readTempo(){let e=this.input.readByte()&255,t=this.input.readByte()&255,n=this.input.readByte()&255;return 6e7/(e<<16|t<<8|n)}skipSysEx(e){if(e===240){if(this.#e)throw new Error("System message already in progress");this.input.skip(this.readVarLen()-1),this.#e=!0}else e===247&&(this.#e?this.#e=!1:(this.input.skip(this.readVarLen()-1),this.#e=!0))}skip(e){this.input.skip(e)}readByte(){return this.input.readByte()}};var Ym;(function(r){r.decoder=t=>new la(new Pe(t)),r.encoder=()=>new e;class e{static writeVarLen(n,i){let o=[];for(;i>127;)o.push(i&127|128),i>>=7;o.push(i&127);for(let s=o.length-1;s>=0;s--)n.writeByte(o[s])}#t=[];addTrack(n){return this.#t.push(n),this}encode(){let n=Ee.create();return n.littleEndian=!1,n.writeInt(Kt.MTHD),n.writeInt(6),n.writeShort(0),n.writeShort(this.#t.length),n.writeShort(96),this.#t.forEach(i=>{n.writeInt(Kt.MTRK);let o=i.encode();n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o))}),n}}})(Ym||(Ym={}));var ca=Symbol.for("@openDAW/lib-midi");globalThis[ca]?console.debug(`%c${ca.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ca]=!0,console.debug(`%c${ca.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Sr;(function(r){r.on=(e,t,n)=>({type:"note-on",uuid:e,pitch:t,velocity:n}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let n=e.data;if(Er.isNoteOn(n)){let i=Er.readPitch(n),o=Er.readVelocity(n);return{type:"note-on",uuid:t,pitch:i,velocity:o}}else if(Er.isNoteOff(n)){let i=Er.readPitch(n);return{type:"note-off",uuid:t,pitch:i}}return w("Unknown MIDI event")}})(Sr||(Sr={}));var Xm;(function(r){r.start=(e,t,n,i=1)=>{let o=!0;return e(Sr.on(t,n,i)),{terminate:()=>{o&&(e(Sr.off(t,n)),o=!1)}}}})(Xm||(Xm={}));var da=class{#t;constructor(){this.#t=X.newSet(e=>e.field.address)}register(e){return this.#t.add(e),{terminate:()=>this.#t.removeByValue(e)}}get(e){return this.#t.get(e)}opt(e){return this.#t.opt(e)}};var ha;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i},o)=>{let s=!0,a=new Int32Array(e,0,2),u=new Float32Array(e,8),l=new Float32Array(n*i),d=typeof document>"u",h=()=>{if(!s)return;let f=Atomics.load(a,1),v=Atomics.load(a,0);if(f===v){if(d)Atomics.wait(a,0,v);else{setTimeout(h,1);return}v=Atomics.load(a,0)}for(;f!==v;){let g=f*n*i;l.set(u.subarray(g,g+n*i));let y=[];for(let b=0;b<n;b++){let C=b*i,U=C+i;y.push(l.slice(C,U))}if(f=(f+1)%t,Atomics.store(a,1,f),!s)return;o(y)}h()};return h(),{stop:()=>s=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i})=>{let o=new Int32Array(e,0,2),s=new Float32Array(e,8);return Object.freeze({write:a=>{if(a.length!==n)return;for(let d of a)if(d.length!==i)return w("Each channel buffer must contain 'bufferSize' samples");let u=Atomics.load(o,0),l=u*n*i;a.forEach((d,h)=>s.set(d,l+h*i)),Atomics.store(o,0,(u+1)%t),Atomics.notify(o,0)}})}})(ha||(ha={}));var Vl={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})??w("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var jl={isRegion:r=>Vl.isRegionBox(r.box),isLoopableRegion:r=>Vl.isLoopableRegionBox(r.box)};var _t;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(_t||(_t={}));var pa;(function(r){r.MAGIC_HEADER_OPEN=1330660686,r.FORMAT_VERSION=2,r.decode=t=>{let n=new Pe(t);N(n.readInt()===r.MAGIC_HEADER_OPEN,"Corrupt header. Probably not an openDAW project file."),N(n.readInt()===r.FORMAT_VERSION,"Deprecated Format");let i=n.readInt(),o=new Int8Array(i);n.readBytes(o);let s=new Qo(m.wrap(ns.create));return s.fromArrayBuffer(o.buffer),{boxGraph:s,mandatoryBoxes:e(s,n)}},r.findMandatoryBoxes=t=>{let n={};for(let i of t.boxes())i.accept({visitRootBox:o=>n.rootBox=o,visitTimelineBox:o=>n.timelineBox=o,visitUserInterfaceBox:o=>{let s=o.root.targetVertex.unwrapOrNull()?.box;fe(s,bi)&&(n.userInterfaceBox=o)},visitAudioUnitBox:o=>{o.type.getValue()===Jr.Output&&(n.masterAudioUnit=o)},visitAudioBusBox:o=>{let s=o.output.targetVertex.unwrapOrNull()?.box;fe(s,xt)&&s.type.getValue()===Jr.Output&&(n.masterBusBox=o)}});return N(nt(n.rootBox),"RootBox not found"),N(nt(n.timelineBox),"TimelineBox not found"),N(nt(n.userInterfaceBox),"UserInterfaceBox not found"),N(nt(n.masterAudioUnit),"MasterAudioUnit not found"),N(nt(n.masterBusBox),"MasterBusBox not found"),n};let e=(t,n)=>{let i=t.findBox(E.fromDataInput(n)).unwrap("RootBox not found"),o=t.findBox(E.fromDataInput(n)).unwrap("UserInterfaceBox not found"),s=t.findBox(E.fromDataInput(n)).unwrap("AudioBusBox not found"),a=t.findBox(E.fromDataInput(n)).unwrap("AudioUnitBox not found"),u=t.findBox(E.fromDataInput(n)).unwrap("TimelineBox not found");return{rootBox:i,userInterfaceBox:o,masterBusBox:s,masterAudioUnit:a,timelineBox:u}}})(pa||(pa={}));var Ie={};zr(Ie,{$brand:()=>ma,$input:()=>sh,$output:()=>oh,NEVER:()=>Ll,TimePrecision:()=>lh,ZodAny:()=>kg,ZodArray:()=>Og,ZodBase64:()=>Np,ZodBase64URL:()=>Pp,ZodBigInt:()=>Eo,ZodBigIntFormat:()=>Ip,ZodBoolean:()=>$o,ZodCIDRv4:()=>Ep,ZodCIDRv6:()=>Sp,ZodCUID:()=>vp,ZodCUID2:()=>xp,ZodCatch:()=>Xg,ZodCodec:()=>Up,ZodCustom:()=>Au,ZodCustomStringFormat:()=>wo,ZodDate:()=>yu,ZodDefault:()=>qg,ZodDiscriminatedUnion:()=>Cg,ZodE164:()=>_p,ZodEmail:()=>mp,ZodEmoji:()=>fp,ZodEnum:()=>yo,ZodError:()=>cb,ZodFile:()=>Lg,ZodFirstPartyTypeKind:()=>Vp,ZodFunction:()=>av,ZodGUID:()=>mu,ZodIPv4:()=>Ap,ZodIPv6:()=>$p,ZodISODate:()=>cu,ZodISODateTime:()=>lu,ZodISODuration:()=>hu,ZodISOTime:()=>du,ZodIntersection:()=>Dg,ZodIssueCode:()=>w0,ZodJWT:()=>kp,ZodKSUID:()=>wp,ZodLazy:()=>nv,ZodLiteral:()=>jg,ZodMap:()=>Ug,ZodNaN:()=>ev,ZodNanoID:()=>gp,ZodNever:()=>Fg,ZodNonOptional:()=>Tp,ZodNull:()=>Pg,ZodNullable:()=>Zg,ZodNumber:()=>Ao,ZodNumberFormat:()=>mn,ZodObject:()=>wu,ZodOptional:()=>zp,ZodPipe:()=>Mp,ZodPrefault:()=>Gg,ZodPromise:()=>sv,ZodReadonly:()=>tv,ZodRealError:()=>Xe,ZodRecord:()=>Cp,ZodSet:()=>Vg,ZodString:()=>bo,ZodStringFormat:()=>ye,ZodSuccess:()=>Yg,ZodSymbol:()=>Sg,ZodTemplateLiteral:()=>iv,ZodTransform:()=>Kg,ZodTuple:()=>zg,ZodType:()=>re,ZodULID:()=>yp,ZodURL:()=>xu,ZodUUID:()=>Wt,ZodUndefined:()=>Ng,ZodUnion:()=>Bp,ZodUnknown:()=>Ig,ZodVoid:()=>Bg,ZodXID:()=>bp,_ZodString:()=>pp,_default:()=>Hg,_function:()=>m0,any:()=>Gb,array:()=>bu,base64:()=>Fb,base64url:()=>Bb,bigint:()=>Lb,boolean:()=>Eg,catch:()=>Qg,check:()=>f0,cidrv4:()=>kb,cidrv6:()=>Ib,clone:()=>Ge,codec:()=>d0,coerce:()=>jp,config:()=>_e,core:()=>Gt,cuid:()=>Ab,cuid2:()=>$b,custom:()=>g0,date:()=>Jb,decode:()=>np,decodeAsync:()=>sp,discriminatedUnion:()=>t0,e164:()=>Ob,email:()=>hb,emoji:()=>bb,encode:()=>ip,encodeAsync:()=>op,endsWith:()=>ho,enum:()=>Dp,file:()=>a0,flattenError:()=>Hn,float32:()=>Mb,float64:()=>Ub,formatError:()=>Gn,function:()=>m0,getErrorMap:()=>$0,globalRegistry:()=>It,gt:()=>qt,gte:()=>Ye,guid:()=>pb,hash:()=>Tb,hex:()=>zb,hostname:()=>Rb,httpUrl:()=>yb,includes:()=>lo,instanceof:()=>v0,int:()=>hp,int32:()=>Vb,int64:()=>Kb,intersection:()=>Rg,ipv4:()=>Pb,ipv6:()=>_b,iso:()=>pu,json:()=>y0,jwt:()=>Cb,keyof:()=>Yb,ksuid:()=>Nb,lazy:()=>ov,length:()=>dn,literal:()=>s0,locales:()=>ro,looseObject:()=>e0,lowercase:()=>ao,lt:()=>Zt,lte:()=>dt,map:()=>i0,maxLength:()=>cn,maxSize:()=>ln,mime:()=>po,minLength:()=>Br,minSize:()=>ai,multipleOf:()=>si,nan:()=>c0,nanoid:()=>wb,nativeEnum:()=>o0,negative:()=>Th,never:()=>Fp,nonnegative:()=>Uh,nonoptional:()=>Jg,nonpositive:()=>Mh,normalize:()=>mo,null:()=>_g,nullable:()=>gu,nullish:()=>u0,number:()=>$g,object:()=>Xb,optional:()=>fu,overwrite:()=>Ht,parse:()=>Qh,parseAsync:()=>ep,partialRecord:()=>r0,pipe:()=>vu,positive:()=>zh,prefault:()=>Wg,preprocess:()=>b0,prettifyError:()=>ec,promise:()=>p0,property:()=>Vh,readonly:()=>rv,record:()=>Mg,refine:()=>uv,regex:()=>so,regexes:()=>ct,registry:()=>ja,safeDecode:()=>up,safeDecodeAsync:()=>cp,safeEncode:()=>ap,safeEncodeAsync:()=>lp,safeParse:()=>tp,safeParseAsync:()=>rp,set:()=>n0,setErrorMap:()=>A0,size:()=>oo,startsWith:()=>co,strictObject:()=>Qb,string:()=>dp,stringFormat:()=>Db,stringbool:()=>x0,success:()=>l0,superRefine:()=>lv,symbol:()=>qb,templateLiteral:()=>h0,toJSONSchema:()=>Gh,toLowerCase:()=>go,toUpperCase:()=>vo,transform:()=>Rp,treeifyError:()=>Ql,trim:()=>fo,tuple:()=>Tg,uint32:()=>jb,uint64:()=>Zb,ulid:()=>Eb,undefined:()=>Hb,union:()=>Op,unknown:()=>pn,uppercase:()=>uo,url:()=>xb,util:()=>M,uuid:()=>mb,uuidv4:()=>fb,uuidv6:()=>gb,uuidv7:()=>vb,void:()=>Wb,xid:()=>Sb});var Gt={};zr(Gt,{$ZodAny:()=>_d,$ZodArray:()=>Od,$ZodAsyncError:()=>yt,$ZodBase64:()=>xd,$ZodBase64URL:()=>yd,$ZodBigInt:()=>Ra,$ZodBigIntFormat:()=>Ed,$ZodBoolean:()=>Xn,$ZodCIDRv4:()=>fd,$ZodCIDRv6:()=>gd,$ZodCUID:()=>nd,$ZodCUID2:()=>od,$ZodCatch:()=>Jd,$ZodCheck:()=>Ae,$ZodCheckBigIntFormat:()=>Cc,$ZodCheckEndsWith:()=>qc,$ZodCheckGreaterThan:()=>ka,$ZodCheckIncludes:()=>Kc,$ZodCheckLengthEquals:()=>Uc,$ZodCheckLessThan:()=>_a,$ZodCheckLowerCase:()=>jc,$ZodCheckMaxLength:()=>Tc,$ZodCheckMaxSize:()=>Dc,$ZodCheckMimeType:()=>Gc,$ZodCheckMinLength:()=>Mc,$ZodCheckMinSize:()=>Rc,$ZodCheckMultipleOf:()=>Bc,$ZodCheckNumberFormat:()=>Oc,$ZodCheckOverwrite:()=>Wc,$ZodCheckProperty:()=>Hc,$ZodCheckRegex:()=>Vc,$ZodCheckSizeEquals:()=>zc,$ZodCheckStartsWith:()=>Zc,$ZodCheckStringFormat:()=>an,$ZodCheckUpperCase:()=>Lc,$ZodCodec:()=>Qn,$ZodCustom:()=>nh,$ZodCustomStringFormat:()=>Ad,$ZodDate:()=>Bd,$ZodDefault:()=>qd,$ZodDiscriminatedUnion:()=>Dd,$ZodE164:()=>bd,$ZodEmail:()=>ed,$ZodEmoji:()=>rd,$ZodEncodeError:()=>Nr,$ZodEnum:()=>Ud,$ZodError:()=>qn,$ZodFile:()=>jd,$ZodFunction:()=>th,$ZodGUID:()=>Xc,$ZodIPv4:()=>pd,$ZodIPv6:()=>md,$ZodISODate:()=>cd,$ZodISODateTime:()=>ld,$ZodISODuration:()=>hd,$ZodISOTime:()=>dd,$ZodIntersection:()=>Rd,$ZodJWT:()=>wd,$ZodKSUID:()=>ud,$ZodLazy:()=>ih,$ZodLiteral:()=>Vd,$ZodMap:()=>Td,$ZodNaN:()=>Yd,$ZodNanoID:()=>id,$ZodNever:()=>Id,$ZodNonOptional:()=>Gd,$ZodNull:()=>Pd,$ZodNullable:()=>Zd,$ZodNumber:()=>Da,$ZodNumberFormat:()=>$d,$ZodObject:()=>Sf,$ZodObjectJIT:()=>Cd,$ZodOptional:()=>Kd,$ZodPipe:()=>Xd,$ZodPrefault:()=>Hd,$ZodPromise:()=>rh,$ZodReadonly:()=>Qd,$ZodRealError:()=>Je,$ZodRecord:()=>zd,$ZodRegistry:()=>un,$ZodSet:()=>Md,$ZodString:()=>oi,$ZodStringFormat:()=>ge,$ZodSuccess:()=>Wd,$ZodSymbol:()=>Sd,$ZodTemplateLiteral:()=>eh,$ZodTransform:()=>Ld,$ZodTuple:()=>Ta,$ZodType:()=>Y,$ZodULID:()=>sd,$ZodURL:()=>td,$ZodUUID:()=>Qc,$ZodUndefined:()=>Nd,$ZodUnion:()=>za,$ZodUnknown:()=>kd,$ZodVoid:()=>Fd,$ZodXID:()=>ad,$brand:()=>ma,$constructor:()=>x,$input:()=>sh,$output:()=>oh,Doc:()=>Yn,JSONSchema:()=>bg,JSONSchemaGenerator:()=>xo,NEVER:()=>Ll,TimePrecision:()=>lh,_any:()=>Ih,_array:()=>jh,_base64:()=>ou,_base64url:()=>su,_bigint:()=>$h,_boolean:()=>wh,_catch:()=>ib,_check:()=>yg,_cidrv4:()=>iu,_cidrv6:()=>nu,_coercedBigint:()=>Eh,_coercedBoolean:()=>Ah,_coercedDate:()=>Dh,_coercedNumber:()=>fh,_coercedString:()=>uh,_cuid:()=>Ja,_cuid2:()=>Ya,_custom:()=>Kh,_date:()=>Ch,_decode:()=>ba,_decodeAsync:()=>Aa,_default:()=>eb,_discriminatedUnion:()=>jy,_e164:()=>au,_email:()=>La,_emoji:()=>Ga,_encode:()=>ya,_encodeAsync:()=>wa,_endsWith:()=>ho,_enum:()=>Gy,_file:()=>Lh,_float32:()=>vh,_float64:()=>xh,_gt:()=>qt,_gte:()=>Ye,_guid:()=>io,_includes:()=>lo,_int:()=>gh,_int32:()=>yh,_int64:()=>Sh,_intersection:()=>Ly,_ipv4:()=>tu,_ipv6:()=>ru,_isoDate:()=>dh,_isoDateTime:()=>ch,_isoDuration:()=>ph,_isoTime:()=>hh,_jwt:()=>uu,_ksuid:()=>eu,_lazy:()=>ab,_length:()=>dn,_literal:()=>Jy,_lowercase:()=>ao,_lt:()=>Zt,_lte:()=>dt,_map:()=>qy,_max:()=>dt,_maxLength:()=>cn,_maxSize:()=>ln,_mime:()=>po,_min:()=>Ye,_minLength:()=>Br,_minSize:()=>ai,_multipleOf:()=>si,_nan:()=>Rh,_nanoid:()=>Wa,_nativeEnum:()=>Wy,_negative:()=>Th,_never:()=>Bh,_nonnegative:()=>Uh,_nonoptional:()=>tb,_nonpositive:()=>Mh,_normalize:()=>mo,_null:()=>kh,_nullable:()=>Qy,_number:()=>mh,_optional:()=>Xy,_overwrite:()=>Ht,_parse:()=>rn,_parseAsync:()=>nn,_pipe:()=>nb,_positive:()=>zh,_promise:()=>ub,_property:()=>Vh,_readonly:()=>ob,_record:()=>Zy,_refine:()=>Zh,_regex:()=>so,_safeDecode:()=>Ea,_safeDecodeAsync:()=>Na,_safeEncode:()=>$a,_safeEncodeAsync:()=>Sa,_safeParse:()=>on,_safeParseAsync:()=>sn,_set:()=>Hy,_size:()=>oo,_startsWith:()=>co,_string:()=>ah,_stringFormat:()=>hn,_stringbool:()=>Hh,_success:()=>rb,_superRefine:()=>qh,_symbol:()=>Ph,_templateLiteral:()=>sb,_toLowerCase:()=>go,_toUpperCase:()=>vo,_transform:()=>Yy,_trim:()=>fo,_tuple:()=>Ky,_uint32:()=>bh,_uint64:()=>Nh,_ulid:()=>Xa,_undefined:()=>_h,_union:()=>Vy,_unknown:()=>Fh,_uppercase:()=>uo,_url:()=>no,_uuid:()=>Ka,_uuidv4:()=>Za,_uuidv6:()=>qa,_uuidv7:()=>Ha,_void:()=>Oh,_xid:()=>Qa,clone:()=>Ge,config:()=>_e,decode:()=>lx,decodeAsync:()=>dx,encode:()=>ux,encodeAsync:()=>cx,flattenError:()=>Hn,formatError:()=>Gn,globalConfig:()=>Mn,globalRegistry:()=>It,isValidBase64:()=>vd,isValidBase64URL:()=>wf,isValidJWT:()=>Af,locales:()=>ro,parse:()=>va,parseAsync:()=>xa,prettifyError:()=>ec,regexes:()=>ct,registry:()=>ja,safeDecode:()=>px,safeDecodeAsync:()=>fx,safeEncode:()=>hx,safeEncodeAsync:()=>mx,safeParse:()=>tc,safeParseAsync:()=>rc,toDotPath:()=>nf,toJSONSchema:()=>Gh,treeifyError:()=>Ql,util:()=>M,version:()=>Jc});var Ll=Object.freeze({status:"aborted"});function x(r,e,t){function n(a,u){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.traits=new Set),a._zod.traits.add(r),e(a,u);for(let d in s.prototype)d in a||Object.defineProperty(a,d,{value:s.prototype[d].bind(a)});a._zod.constr=s,a._zod.def=u}let i=t?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:r});function s(a){var u;let l=t?.Parent?new o:this;n(l,a),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(s,"init",{value:n}),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 ma=Symbol("zod_brand"),yt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Nr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Mn={};function _e(r){return r&&Object.assign(Mn,r),Mn}var M={};zr(M,{BIGINT_FORMAT_RANGES:()=>Xl,Class:()=>Zl,NUMBER_FORMAT_RANGES:()=>Yl,aborted:()=>Fr,allowsEval:()=>Hl,assert:()=>Uv,assertEqual:()=>Rv,assertIs:()=>Tv,assertNever:()=>Mv,assertNotEqual:()=>zv,assignProp:()=>_r,base64ToUint8Array:()=>ef,base64urlToUint8Array:()=>ix,cached:()=>en,captureStackTrace:()=>ga,cleanEnum:()=>rx,cleanRegex:()=>jn,clone:()=>Ge,cloneDef:()=>jv,createTransparentProxy:()=>Gv,defineLazy:()=>ne,esc:()=>fa,escapeRegex:()=>kt,extend:()=>Yv,finalizeIssue:()=>rt,floatSafeRemainder:()=>ql,getElementAtPath:()=>Lv,getEnumValues:()=>Vn,getLengthableOrigin:()=>Zn,getParsedType:()=>Hv,getSizableOrigin:()=>Kn,hexToUint8Array:()=>ox,isObject:()=>ii,isPlainObject:()=>Ir,issue:()=>tn,joinValues:()=>$,jsonStringifyReplacer:()=>Qi,merge:()=>Qv,mergeDefs:()=>kr,normalizeParams:()=>T,nullish:()=>Pr,numKeys:()=>qv,objectClone:()=>Vv,omit:()=>Jv,optionalKeys:()=>Jl,partial:()=>ex,pick:()=>Wv,prefixIssues:()=>tt,primitiveTypes:()=>Wl,promiseAllObject:()=>Kv,propertyKeyTypes:()=>Ln,randomString:()=>Zv,required:()=>tx,safeExtend:()=>Xv,shallowClone:()=>Gl,stringifyPrimitive:()=>R,uint8ArrayToBase64:()=>tf,uint8ArrayToBase64url:()=>nx,uint8ArrayToHex:()=>sx,unwrapMessage:()=>Un});function Rv(r){return r}function zv(r){return r}function Tv(r){}function Mv(r){throw new Error}function Uv(r){}function Vn(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function $(r,e="|"){return r.map(t=>R(t)).join(e)}function Qi(r,e){return typeof e=="bigint"?e.toString():e}function en(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Pr(r){return r==null}function jn(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function ql(r,e){let t=(r.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let u=n.match(/\d?e-(\d?)/);u?.[1]&&(i=Number.parseInt(u[1]))}let o=t>i?t:i,s=Number.parseInt(r.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Qm=Symbol("evaluating");function ne(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==Qm)return n===void 0&&(n=Qm,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function Vv(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function _r(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function kr(...r){let e={};for(let t of r){let n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function jv(r){return kr(r._zod.def)}function Lv(r,e){return e?e.reduce((t,n)=>t?.[n],r):r}function Kv(r){let e=Object.keys(r),t=e.map(n=>r[n]);return Promise.all(t).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function Zv(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let n=0;n<r;n++)t+=e[Math.floor(Math.random()*e.length)];return t}function fa(r){return JSON.stringify(r)}var ga="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function ii(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Hl=en(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function Ir(r){if(ii(r)===!1)return!1;let e=r.constructor;if(e===void 0)return!0;let t=e.prototype;return!(ii(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Gl(r){return Ir(r)?{...r}:Array.isArray(r)?[...r]:r}function qv(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var Hv=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}`)}},Ln=new Set(["string","number","symbol"]),Wl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function kt(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ge(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}function T(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 Gv(r){let e;return new Proxy({},{get(t,n,i){return e??(e=r()),Reflect.get(e,n,i)},set(t,n,i,o){return e??(e=r()),Reflect.set(e,n,i,o)},has(t,n){return e??(e=r()),Reflect.has(e,n)},deleteProperty(t,n){return e??(e=r()),Reflect.deleteProperty(e,n)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,n){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(t,n,i){return e??(e=r()),Reflect.defineProperty(e,n,i)}})}function R(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Jl(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Yl={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]},Xl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wv(r,e){let t=r._zod.def,n=kr(r._zod.def,{get shape(){let i={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(i[o]=t.shape[o])}return _r(this,"shape",i),i},checks:[]});return Ge(r,n)}function Jv(r,e){let t=r._zod.def,n=kr(r._zod.def,{get shape(){let i={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete i[o]}return _r(this,"shape",i),i},checks:[]});return Ge(r,n)}function Yv(r,e){if(!Ir(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=kr(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return _r(this,"shape",o),o},checks:[]});return Ge(r,i)}function Xv(r,e){if(!Ir(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let n={...r._zod.def.shape,...e};return _r(this,"shape",n),n},checks:r._zod.def.checks};return Ge(r,t)}function Qv(r,e){let t=kr(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e._zod.def.shape};return _r(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Ge(r,t)}function ex(r,e,t){let n=kr(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let s in t){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r?new r({type:"optional",innerType:i[s]}):i[s])}else for(let s in i)o[s]=r?new r({type:"optional",innerType:i[s]}):i[s];return _r(this,"shape",o),o},checks:[]});return Ge(e,n)}function tx(r,e,t){let n=kr(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let s in t){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=new r({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new r({type:"nonoptional",innerType:i[s]});return _r(this,"shape",o),o},checks:[]});return Ge(e,n)}function Fr(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 tt(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}function Un(r){return typeof r=="string"?r:r?.message}function rt(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=Un(r.inst?._zod.def?.error?.(r))??Un(e?.error?.(r))??Un(t.customError?.(r))??Un(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Kn(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Zn(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function tn(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}function rx(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ef(r){let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function tf(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function ix(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return ef(e+t)}function nx(r){return tf(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ox(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=Number.parseInt(e.slice(n,n+2),16);return t}function sx(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var Zl=class{constructor(...e){}};var rf=(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,Qi,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},qn=x("$ZodError",rf),Je=x("$ZodError",rf,{Parent:Error});function Hn(r,e=t=>t.message){let t={},n=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}function Gn(r,e=t=>t.message){let t={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let s=t,a=0;for(;a<o.path.length;){let u=o.path[a];a===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(e(o))):s[u]=s[u]||{_errors:[]},s=s[u],a++}}};return n(r),t}function Ql(r,e=t=>t.message){let t={errors:[]},n=(i,o=[])=>{var s,a;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>n({issues:l},u.path));else if(u.code==="invalid_key")n({issues:u.issues},u.path);else if(u.code==="invalid_element")n({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){t.errors.push(e(u));continue}let d=t,h=0;for(;h<l.length;){let f=l[h],v=h===l.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]),v&&d.errors.push(e(u)),h++}}};return n(r),t}function nf(r){let e=[],t=r.map(n=>typeof n=="object"?n.key:n);for(let n of t)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function ec(r){let e=[],t=[...r.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of t)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${nf(n.path)}`);return e.join(`
4
- `)}var rn=r=>(e,t,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new yt;if(s.issues.length){let a=new(i?.Err??r)(s.issues.map(u=>rt(u,o,_e())));throw ga(a,i?.callee),a}return s.value},va=rn(Je),nn=r=>async(e,t,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??r)(s.issues.map(u=>rt(u,o,_e())));throw ga(a,i?.callee),a}return s.value},xa=nn(Je),on=r=>(e,t,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new yt;return o.issues.length?{success:!1,error:new(r??qn)(o.issues.map(s=>rt(s,i,_e())))}:{success:!0,data:o.value}},tc=on(Je),sn=r=>async(e,t,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(s=>rt(s,i,_e())))}:{success:!0,data:o.value}},rc=sn(Je),ya=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rn(r)(e,t,i)},ux=ya(Je),ba=r=>(e,t,n)=>rn(r)(e,t,n),lx=ba(Je),wa=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nn(r)(e,t,i)},cx=wa(Je),Aa=r=>async(e,t,n)=>nn(r)(e,t,n),dx=Aa(Je),$a=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return on(r)(e,t,i)},hx=$a(Je),Ea=r=>(e,t,n)=>on(r)(e,t,n),px=Ea(Je),Sa=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return sn(r)(e,t,i)},mx=Sa(Je),Na=r=>async(e,t,n)=>sn(r)(e,t,n),fx=Na(Je);var ct={};zr(ct,{base64:()=>vc,base64url:()=>Pa,bigint:()=>Ec,boolean:()=>Pc,browserEmail:()=>$x,cidrv4:()=>fc,cidrv6:()=>gc,cuid:()=>ic,cuid2:()=>nc,date:()=>bc,datetime:()=>Ac,domain:()=>Sx,duration:()=>lc,e164:()=>yc,email:()=>dc,emoji:()=>hc,extendedDuration:()=>gx,guid:()=>cc,hex:()=>Nx,hostname:()=>xc,html5Email:()=>bx,idnEmail:()=>Ax,integer:()=>Sc,ipv4:()=>pc,ipv6:()=>mc,ksuid:()=>ac,lowercase:()=>Ic,md5_base64:()=>_x,md5_base64url:()=>kx,md5_hex:()=>Px,nanoid:()=>uc,null:()=>_c,number:()=>Nc,rfc5322Email:()=>wx,sha1_base64:()=>Fx,sha1_base64url:()=>Bx,sha1_hex:()=>Ix,sha256_base64:()=>Cx,sha256_base64url:()=>Dx,sha256_hex:()=>Ox,sha384_base64:()=>zx,sha384_base64url:()=>Tx,sha384_hex:()=>Rx,sha512_base64:()=>Ux,sha512_base64url:()=>Vx,sha512_hex:()=>Mx,string:()=>$c,time:()=>wc,ulid:()=>oc,undefined:()=>kc,unicodeEmail:()=>of,uppercase:()=>Fc,uuid:()=>ni,uuid4:()=>vx,uuid6:()=>xx,uuid7:()=>yx,xid:()=>sc});var ic=/^[cC][^\s-]{8,}$/,nc=/^[0-9a-z]+$/,oc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sc=/^[0-9a-vA-V]{20}$/,ac=/^[A-Za-z0-9]{27}$/,uc=/^[a-zA-Z0-9_-]{21}$/,lc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gx=/^[-+]?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)?)??$/,cc=/^([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})$/,ni=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)$/,vx=ni(4),xx=ni(6),yx=ni(7),dc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bx=/^[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])?)*$/,wx=/^(([^<>()\[\]\\.,;:\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,}))$/,of=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ax=of,$x=/^[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])?)*$/,Ex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hc(){return new RegExp(Ex,"u")}var pc=/^(?:(?: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])$/,mc=/^(([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}|:))$/,fc=/^((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])$/,gc=/^(([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])$/,vc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pa=/^[A-Za-z0-9_-]*$/,xc=/^(?=.{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])?)*\.?$/,Sx=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,yc=/^\+(?:[0-9]){6,14}[0-9]$/,sf="(?:(?:\\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])))",bc=new RegExp(`^${sf}$`);function af(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 wc(r){return new RegExp(`^${af(r)}$`)}function Ac(r){let e=af({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${t.join("|")})`;return new RegExp(`^${sf}T(?:${n})$`)}var $c=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ec=/^-?\d+n?$/,Sc=/^-?\d+$/,Nc=/^-?\d+(?:\.\d+)?/,Pc=/^(?:true|false)$/i,_c=/^null$/i;var kc=/^undefined$/i;var Ic=/^[^A-Z]*$/,Fc=/^[^a-z]*$/,Nx=/^[0-9a-fA-F]*$/;function Wn(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function Jn(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var Px=/^[0-9a-fA-F]{32}$/,_x=Wn(22,"=="),kx=Jn(22),Ix=/^[0-9a-fA-F]{40}$/,Fx=Wn(27,"="),Bx=Jn(27),Ox=/^[0-9a-fA-F]{64}$/,Cx=Wn(43,"="),Dx=Jn(43),Rx=/^[0-9a-fA-F]{96}$/,zx=Wn(64,""),Tx=Jn(64),Mx=/^[0-9a-fA-F]{128}$/,Ux=Wn(86,"=="),Vx=Jn(86);var Ae=x("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),lf={number:"number",bigint:"bigint",object:"date"},_a=x("$ZodCheckLessThan",(r,e)=>{Ae.init(r,e);let t=lf[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),ka=x("$ZodCheckGreaterThan",(r,e)=>{Ae.init(r,e);let t=lf[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Bc=x("$ZodCheckMultipleOf",(r,e)=>{Ae.init(r,e),r._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):ql(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})}}),Oc=x("$ZodCheckNumberFormat",(r,e)=>{Ae.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),n=t?"int":"number",[i,o]=Yl[e.format];r._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,t&&(a.pattern=Sc)}),r._zod.check=s=>{let a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:n,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:n,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:n,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>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:r})}}),Cc=x("$ZodCheckBigIntFormat",(r,e)=>{Ae.init(r,e);let[t,n]=Xl[e.format];r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=t,o.maximum=n}),r._zod.check=i=>{let o=i.value;o<t&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inst:r})}}),Dc=x("$ZodCheckMaxSize",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:Kn(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Rc=x("$ZodCheckMinSize",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:Kn(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),zc=x("$ZodCheckSizeEquals",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let s=o>e.size;n.issues.push({origin:Kn(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),Tc=x("$ZodCheckMaxLength",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let s=Zn(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Mc=x("$ZodCheckMinLength",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=Zn(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Uc=x("$ZodCheckLengthEquals",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Pr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let s=Zn(i),a=o>e.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),an=x("$ZodCheckStringFormat",(r,e)=>{var t,n;Ae.init(r,e),r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(n=r._zod).check??(n.check=()=>{})}),Vc=x("$ZodCheckRegex",(r,e)=>{an.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})}}),jc=x("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Ic),an.init(r,e)}),Lc=x("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Fc),an.init(r,e)}),Kc=x("$ZodCheckIncludes",(r,e)=>{Ae.init(r,e);let t=kt(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,r._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),r._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:r,continue:!e.abort})}}),Zc=x("$ZodCheckStartsWith",(r,e)=>{Ae.init(r,e);let t=new RegExp(`^${kt(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:r,continue:!e.abort})}}),qc=x("$ZodCheckEndsWith",(r,e)=>{Ae.init(r,e);let t=new RegExp(`.*${kt(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:r,continue:!e.abort})}});function uf(r,e,t){r.issues.length&&e.issues.push(...tt(t,r.issues))}var Hc=x("$ZodCheckProperty",(r,e)=>{Ae.init(r,e),r._zod.check=t=>{let n=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>uf(i,t,e.property));uf(n,t,e.property)}}),Gc=x("$ZodCheckMimeType",(r,e)=>{Ae.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),r._zod.check=n=>{t.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:r,continue:!e.abort})}}),Wc=x("$ZodCheckOverwrite",(r,e)=>{Ae.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var Yn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
3
+ `),this));for(let n of t)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};hx([di,tf("design:type",$t),tf("design:paramtypes",[])],D.prototype,"pointerHub",null);var ce;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(ce||(ce={}));var as;(function(r){r.create=()=>new ic})(as||(as={}));var ic=class{#t=new zn(Hr.equals);#e=new zn(Hr.startsWith);#r=new zn(Hr.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,n){let i=new nc(t,e,this.#n++,n);if(this.#o){let o=new oc(i,e);return this.#i.push(o),o}else return this.subscribeMonitor(i,e)}dispatch(e){this.#o=!0,[...this.#t.filter(e),...this.#e.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#o=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case ce.This:return this.#t.subscribe(e);case ce.Parent:return this.#e.subscribe(e);case ce.Children:return this.#r.subscribe(e);default:return Dt(t)}}countStations(){return this.#t.count()+this.#e.count()+this.#r.count()}},nc=class{address;propagation;order;procedure;constructor(e,t,n,i){this.address=e,this.propagation=t,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${ce[this.propagation]}, order: ${this.order} }`}},zn=class{filterStrategy;#t=[];#e=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#t.push(e),this.#e=this.#t.length<2,{terminate:()=>{let t=this.#t.length;for(;--t>=0;)this.#t[t]===e&&this.#t.splice(t,1)}}}stations(){return this.#e||(this.#t.sort(Hr.Comparator),this.#e=!0),this.#t}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#t.length}},oc=class{monitor;propagation;#t=new V;#e=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#e||(this.#t.terminate(),this.#t.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#e=!0,this.#t.terminate()}};var Pe;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(Pe||(Pe={}));var Wr={[Pe.Boolean]:{type:Pe.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[Pe.Float32]:{type:Pe.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[Pe.Int32]:{type:Pe.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[Pe.String]:{type:Pe.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[Pe.Bytes]:{type:Pe.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Gr=class extends K{#t;#e;#r;constructor(e,t,n){super(e),this.#t=t,this.#e=this.clamp(n),this.#r=this.#e}accept(e){return w(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ce.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#t}get initValue(){return this.#e}setInitValue(e){N(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#e=e)}getValue(){return this.#r}setValue(e){let t=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=e,this.graph.onPrimitiveValueUpdate(this,t,n))}writeValue(e,t){this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){let e=this.getValue();return ArrayBuffer.isView(e)?A("not implemented"):e}fromJSON(e){return A("Type mismatch")}reset(){this.setValue(this.#e)}},k=class r extends Gr{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,Pe.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Wr[Pe.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){e.writeBoolean(this.getValue())}fromJSON(e){typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString())}},P=class r extends Gr{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,Pe.Float32,t)}serialization(){return Wr[Pe.Float32]}equals(e){return this.getValue()===e}clamp(e){return zt.toFloat32(e)}read(e){this.setValue(e.readFloat())}write(e){e.writeFloat(this.getValue())}fromJSON(e){typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString())}},$=class r extends Gr{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,Pe.Int32,t)}serialization(){return Wr[Pe.Int32]}equals(e){return this.getValue()===e}clamp(e){return Ke.toInt(e)}read(e){this.setValue(e.readInt())}write(e){e.writeInt(this.getValue())}fromJSON(e){typeof e=="number"&&e===Math.floor(e)&&e>=Ke.MIN_VALUE&&e<=Ke.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString())}},C=class r extends Gr{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,Pe.String,t)}serialization(){return Wr[Pe.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){e.writeString(this.getValue())}fromJSON(e){typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString())}},rf=class r extends Gr{static create(e,t=this.#t){return new r(e,t)}static#t=Object.freeze(new Int8Array(0));constructor(e,t){super(e,Pe.Bytes,t)}serialization(){return Wr[Pe.Bytes]}equals(e){return this.getValue().length===e.length&&this.getValue().every((t,n)=>e[n]===t)}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){return Array.from(this.getValue().values())}fromJSON(e){Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString())}};var nf;(function(r){r.decode=e=>{let t=e.readInt();return F.create(()=>{switch(e.readString()){case"new":{let i=S.fromDataInput(e),o=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Mn(i,o,s.buffer)}case"pointer":{let i=te.read(e),o=e.readBoolean()?m.wrap(te.read(e)):m.None,s=e.readBoolean()?m.wrap(te.read(e)):m.None;return new Un(i,o,s)}case"primitive":{let i=te.read(e),o=e.readString(),s=Wr[o],a=s.decode(e),u=s.decode(e);return new Tn(i,s,a,u)}case"delete":{let i=S.fromDataInput(e),o=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Vn(i,o,s.buffer)}}},t)}})(nf||(nf={}));var Mn=class{type="new";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get uuid(){return this.#t}get name(){return this.#e}get settings(){return this.#r}forward(e){e.createBox(this.#e,this.#t,t=>t.read(new _e(this.#r)))}inverse(e){e.findBox(this.#t).unwrap(()=>`Could not find ${this.#e}`).unstage()}write(e){e.writeString(this.type),S.toDataOutput(e,this.#t),e.writeString(this.#e),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${S.toString(this.#t)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Tn=class{type="primitive";#t;#e;#r;#i;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#r=n,this.#i=i}get address(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#t).unwrap(()=>`Could not find PrimitiveField at ${this.#t}`)}write(e){e.writeString(this.type),this.#t.write(e),e.writeString(this.#e.type),this.#e.encode(e,this.#r),this.#e.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},Un=class{type="pointer";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get address(){return this.#t}get oldAddress(){return this.#e}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#e}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#t).unwrap(()=>`Could not find PointerField at ${this.#t}`)}write(e){e.writeString(this.type),this.#t.write(e),this.#e.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.#e.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},Vn=class{type="delete";#t;#e;#r;constructor(e,t,n){this.#t=e,this.#e=t,this.#r=n}get uuid(){return this.#t}get name(){return this.#e}get settings(){return this.#r}forward(e){e.findBox(this.#t).unwrap(()=>`Could not find ${this.#e}`).unstage()}inverse(e){e.createBox(this.#e,this.#t,t=>t.read(new _e(this.#r)))}write(e){e.writeString(this.type),S.toDataOutput(e,this.#t),e.writeString(this.#e),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${S.toString(this.#t)}, attachment: ${this.settings.byteLength}b`}};var US=Symbol("Unreferenceable"),_=class r extends K{static create(e,t,n){return new r(e,t,n)}static encodeWith(e,t){N(this.#t.isEmpty(),"SerializationEncoder already in use"),this.#t=m.wrap(e);let n=Vr(t);if(this.#t=m.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,t){N(this.#e.isEmpty(),"SerializationDecoder already in use"),this.#e=m.wrap(e);let n=Vr(t);if(this.#e=m.None,n.status==="failure")throw n.error;return n.value}static#t=m.None;static#e=m.None;#r;#i;#n=m.None;#o=m.None;constructor(e,t,n){super(e),this.#r=t,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return A(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return w(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ce.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.graph.subscribeVertexUpdates(ce.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}refer(e){this.targetVertex=m.wrap(e)}defer(){this.targetVertex=m.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=$t.validate(this,e.unwrap());t.nonEmpty()&&A(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()}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?m.wrap(te.read(e)):m.None;this.targetAddress=r.#e.match({none:()=>t,some:n=>n.map(this,t)})}write(e){r.#t.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){return r.#t.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(Tr(e)||typeof e=="string"){let t=m.wrap(Tr(e)?null:te.decode(e));this.targetAddress=r.#e.match({none:()=>t,some:n=>n.map(this,t)})}else return A(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var us=class{#t;#e;#r;#i;constructor(){this.#t=te.newSet(e=>e.address),this.#e=te.newSet(e=>e.address),this.#r=te.newSet(([e])=>e),this.#i=te.newSet(([e])=>e.address)}watchVertex(e){if(Ee(e,_)){if(!e.mandatory)return A("watchVertex called but has no edge requirement");this.#t.add(e)}else{if(!e.pointerRules.mandatory)return A("watchVertex called but has no edge requirement");this.#e.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#o(this.#t,n,t),this.#o(this.#e,n,t);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return A(`${n} has outgoing edges: ${i.map(([s,a])=>`[${s.toString()}, ${a.toString()}]`)}`);let o=this.incomingEdgesOf(n);if(o.length>0)return A(`${n} has incoming edges from: ${o.map(s=>s.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,n])=>n.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,n]=this.#r.get(t);F.remove(n,e),n.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,n])=>n.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,n])=>n):this.#r.opt(e.address).mapOr(([t,n])=>n,F.empty())}validateRequirements(){this.#t.forEach(e=>{if(e.isEmpty())return e.mandatory?A(`Pointer ${e.toString()} requires an edge.`):A(`Illegal state: ${e} has no edge requirements.`)}),this.#e.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?A(`Target ${e.toString()} requires an edge.`):A(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,n){let i=te.boxRange(e,t,n);return O(i)?e.values().slice(i[0],i[1]):F.empty()}#o(e,t,n){let i=te.boxRange(e,t,n);O(i)&&e.removeRange(i[0],i[1])}};var ls=class{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c=!1;#h=!1;constructor(e=m.None){this.#t=e,this.#e=S.newSet(t=>t.address.uuid),this.#r=[],this.#s=as.create(),this.#i=new Ie,this.#n=new Ie,this.#o=new Ie,this.#a=new us,this.#u=te.newSet(({pointer:t})=>t.address),this.#l=[]}beginTransaction(){N(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(N(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#d(e,t)),this.#r.length=0),this.#u.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:n})=>{t.equals(n)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#u.clear(),this.#c=!1;this.#l.length>0;)this.#l.splice(0).forEach(e=>e()),this.#l.length>0&&console.debug(`${this.#l.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#h}createBox(e,t,n){return this.#t.unwrap("No box-factory installed")(e,this,t,n)}stageBox(e,t){this.#p(),N(!this.#h,"Cannot construct box while other box is constructing"),O(t)&&(this.#h=!0,t(e),this.#h=!1);let n=this.#e.add(e);N(n,`${e} already staged`);let i=new Mn(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,n){return this.#s.subscribe(e,t,n)}subscribeEndTransaction(e){this.#l.push(e)}unstageBox(e){this.#p();let t=this.#e.removeByKey(e.address.uuid);N(t===e,`${e} could not be found to unstage`),this.#a.unwatchVerticesOf(e);let n=new Vn(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}findBox(e){return this.#e.opt(e)}findVertex(e){return this.#e.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#e.values()}edges(){return this.#a}checksum(){let e=new Lo;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,n){if(this.#p(),e.isAttached()&&!this.#h){let i=new Tn(e.address,e.serialization(),t,n);this.#s.dispatch(i),this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,n){this.#p(),t.nonEmpty()&&this.#a.disconnect(e),n.nonEmpty()&&this.#a.connect(e,n.unwrap());let i=new Un(e.address,t,n);this.#h?this.#r.push({pointerField:e,update:i}):(this.#d(e,i),this.#n.proxy.onUpdate(i))}#d(e,t){let{oldAddress:n,newAddress:i}=t;e.resolvedTo(i.flatMap(s=>this.findVertex(s))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:s=>s.final=i}),this.#s.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e){let t=new Set,n=new Set,i=o=>{t.has(o)||(t.add(o),o.outgoingEdges().filter(([s])=>!n.has(s)).forEach(([s,a])=>{let u=this.findVertex(a).unwrap(`Could not find target of ${s.toString()}`);if(n.add(s),u.pointerRules.mandatory&&u.pointerHub.incoming().every(l=>n.has(l)))return i(u.box)}),o.incomingEdges().forEach(s=>{n.add(s),s.mandatory&&i(s.box)}))};return i(e),t.delete(e),{boxes:t,pointers:Array.from(n).reverse()}}verifyPointers(){this.#a.validateRequirements();let e=0,t=n=>{for(let i of n.fields())i.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let s=o.targetVertex.nonEmpty(),a=this.findVertex(o.targetAddress.unwrap()).nonEmpty();N(s,`pointer ${o.address} is broken`),N(a,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#e.forEach(n=>t(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#e.values().reduce((e,t)=>(e[S.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(n=>n.name):this.findBox(t.uuid).flatMap(n=>n.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:A("Unknown address"))))}toArrayBuffer(){let e=Se.create(),t=this.#e.values();return e.writeInt(t.length),t.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){N(this.#e.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new _e(e),n=t.readInt();this.beginTransaction();let i=[];for(let o=0;o<n;o++){let s=t.readInt(),a=new Int8Array(s);t.readBytes(a);let u=new _e(a.buffer),l=u.readInt(),d=u.readString(),h=S.fromDataInput(u);i.push({creationIndex:l,name:d,uuid:h,boxStream:u})}i.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:a})=>this.createBox(o,s,u=>u.read(a))),this.endTransaction()}toJSON(){return this.#e.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:q(e.toJSON())}))}#p(){N(this.#c,()=>"Modification only prohibited in transaction mode.")}};var of;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let n=r.collectIndexedBoxes(e),i=G(t,0,n.length);if(i<n.length)for(let o=i;o<n.length;o++)n[o].index.setValue(o+1);return i},r.removeOrder=(e,t)=>{let n=r.collectIndexedBoxes(e);if(t<n.length)for(let i=t+1;i<n.length;i++)n[i].index.setValue(i-1)},r.moveIndex=(e,t,n)=>{let i=r.collectIndexedBoxes(e),o=i[t];if(n<0){let s=G(t+n,0,i.length-1);for(let a=s;a<t;a++)i[a].index.setValue(a+1);o.index.setValue(s)}else if(n>1){let s=G(t+(n-1),0,i.length-1);for(let a=t;a<s;a++)i[a+1].index.setValue(a);o.index.setValue(s)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${n}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof $,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:n})=>r.isIndexedBox(n)&&(t===void 0||n instanceof t)?n:A(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(of||(of={}));var ye=class extends K{#t;constructor(e){super(e),this.#t=this.initializeFields()}accept(e){return w(e.visitObjectField,this)}fields(){return Object.values(this.#t)}record(){return this.#t}getField(e){return q(this.#t[e])}optField(e){return m.wrap(this.#t[e])}read(e){ar.readFields(e,this.#t)}write(e){ar.writeFields(e,this.#t)}toJSON(){return Object.entries(this.#t).reduce((e,[t,n])=>(e[t]=n.toJSON(),e),{})}fromJSON(e){if(Qt(e))Object.entries(e).forEach(([t,n])=>{let i=this.#t[parseInt(t)];O(n)&&i.fromJSON(n)});else return A("Type mismatch")}};var Ge;(function(r){r.sender=(n,i)=>i(new e(n)),r.executor=(n,i)=>new t(n,i);class e{#t;#e=new Map;#r;#i=0;constructor(i){this.#t=i,this.#r=i.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(i,...o)=>this.#t.send({type:"send",returnId:!1,func:i.name,args:Array.from(xe.map(o,s=>({value:s})))});dispatchAndReturn=(i,...o)=>new Promise((s,a)=>{let u=xe.reduce(o,(l,d,h)=>(typeof d=="function"&&l.push([h,d]),l),[]);this.#e.set(this.#i,{executorTuple:{resolve:s,reject:a},callbacks:new Map(u)}),this.#t.send({type:"send",returnId:this.#i,func:i.name,args:Array.from(xe.map(o,(l,d)=>typeof l=="function"?{callback:d}:{value:l}))}),this.#i++});#n=i=>{let o=this.#e.get(i.returnId);O(o)?i.type==="resolve"?(o.executorTuple.resolve(i.resolve),this.#e.delete(i.returnId)):i.type==="reject"?(o.executorTuple.reject(i.reject),this.#e.delete(i.returnId)):i.type==="callback"&&o.callbacks?.get(i.funcAt).apply(this,i.args):A(`Promise has already been resolved. ${JSON.stringify(i)}`)}}class t{#t;#e;#r;constructor(i,o){this.#t=i,this.#e=o,this.#r=i.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=i=>{N(i.type==="send",()=>"Message type must be 'send'");let o=Object.getPrototypeOf(this.#e)===Object.getPrototypeOf({})?this.#e:Object.getPrototypeOf(this.#e),s=q(o[i.func],`${i.func.toString()} does not exists on ${this.#e}`),a=i.returnId;if(a===!1)s.apply(this.#e,i.args.map(u=>"value"in u?u.value:A(`${i.func.toString()} has no promise.`)));else try{s.apply(this.#e,i.args.map(l=>"callback"in l?(...d)=>this.#s(a,l.callback,d):l.value)).then(l=>{try{this.#n(a,l)}catch(d){this.#o(a,d)}},l=>this.#o(a,l))}catch(u){this.#o(a,u)}};#n=(i,o)=>this.#t.send({type:"resolve",returnId:i,resolve:o});#o=(i,o)=>this.#t.send({type:"reject",returnId:i,reject:o});#s=(i,o,s)=>this.#t.send({type:"callback",returnId:i,funcAt:o,args:s})}r.Executor=t})(Ge||(Ge={}));var sf;(function(r){r.ProgressArrayBuffer=e=>async t=>{if(!t.headers.has("Content-Length"))return console.debug("No Content-Length"),t.arrayBuffer();let n=parseInt(t.headers.get("Content-Length"));if(console.debug(`Content-Length: ${n}b`),isNaN(n)||n<4096)return t.arrayBuffer();e(0);let i=Se.create(n),o=q(t.body,"response.body is empty").getReader();for(;;){let{done:s,value:a}=await o.read();if(s)break;a.forEach(u=>i.writeByte(u)),e(i.position/n)}return e(1),i.toArrayBuffer()}})(sf||(sf={}));var af;(function(r){r.debounce=(()=>{let e;return(t,n=1e3)=>{clearTimeout(e),e=setTimeout(t,n)}})(),r.scheduleInterval=(e,t,...n)=>{let i=setInterval(e,t,...n);return{terminate:()=>clearInterval(i)}},r.scheduleTimeout=(e,t,...n)=>{let i=setTimeout(e,t,...n);return{terminate:()=>clearTimeout(i)}}})(af||(af={}));var uf={for:r=>new sc(r)},sc=class{#t;#e=new W;constructor(e){if(this.#t=e,O(e.onmessage)||O(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#e.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e){this.#t.postMessage(e)}channel(e){return new ac(this,e)}subscribe(e){return this.#e.subscribe(e)}terminate(){this.#e.terminate(),this.#t.onmessage=null,this.#t.onmessageerror=null}},ac=class r{#t;#e;#r=new W;#i;constructor(e,t){this.#t=e,this.#e=t,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===t&&this.#r.notify(n.message)})}send(e){this.#t.send({__id__:"42",channel:this.#e,message:e})}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var cs;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let n=e,i=()=>{--n<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(n=>setTimeout(n,e.millis(),...t)),r.event=(e,t)=>new Promise(n=>e.addEventListener(t,n,{once:!0})),r.observable=e=>new Promise(t=>{let n=e.subscribe(()=>{n.terminate(),t()})}),r.complete=e=>new Promise((t,n)=>{let i=setInterval(()=>{let{status:o,value:s,error:a}=Vr(()=>e.next());if(o==="success"){let{done:u,value:l}=s;u&&(clearInterval(i),t(l))}else clearInterval(i),n(a)},0)})})(cs||(cs={}));var uc=class{maxRetry;timeSpan;#t=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#t===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},ur;(function(r){class e{value;status="resolved";constructor(a){this.value=a}error=kn("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(a){this.error=a}value=kn("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(s,a)=>{let u=!0;return s.own(Z.create(()=>u=!1)),new Promise((l,d)=>a.then(h=>{u&&l(h)},h=>{u&&d(h)}))},r.tryCatch=s=>s.then(a=>new e(a),a=>new t(a));let n=new uc(3,rr.seconds(3));r.retry=(s,a=n)=>s().catch(u=>new Promise((l,d)=>{let h=f=>{a.retry(f,()=>s().then(v=>l(v),h))||d(f)};h(u)})),r.guardedRetry=(s,a)=>{let u=async(l=0)=>{try{return await s()}catch(d){if(a(d,++l))return await cs.timeSpan(rr.seconds(1)),u(l);throw d}};return u()},r.approvedRetry=(s,a)=>{let u=async()=>{try{return await s()}catch(l){if(await Km.approve(a(l)))return u();throw l}};return u()},r.fail=(s,a)=>{let u=()=>new Promise((l,d)=>setTimeout(()=>d("fails first"),s.millis()));return()=>{let l=u();return u=a,l}},r.timeout=(s,a,u)=>new Promise((l,d)=>{let h=!0,f=setTimeout(()=>{h=!1,d(new Error(u??"timeout"))},a.millis());s.then(v=>{h&&l(v)},v=>{h&&d(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=s=>s.reduce((a,u)=>a.then(async l=>[...l,await u()]),Promise.resolve([])),r.sequentialize=s=>{let a=Promise.resolve();return u=>{let l=()=>s(u),d=a.then(l,l);return a=d.catch(()=>{}),d}},r.memoizeAsync=(s,a)=>{let u=null,l=Date.now();return()=>{let d=Date.now();return(Tr(u)||O(a)&&d-l>a.millis())&&(l=d,u=s(),u.catch(h=>(u=null,h))),u}},r.allWithLimit=async(s,a=1)=>{let u=new Array(s.length),l=0,d=!1,h=async()=>{for(;l<s.length&&!d;){let f=l++;try{let v=await s[f]();d||(u[f]=v)}catch(v){throw d=!0,v}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},h)),u},r.allSettledWithLimit=async(s,a=1)=>{let u=new Array(s.length),l=0,d=async()=>{for(;l<s.length;){let h=l++;try{let f=await s[h]();u[h]={status:"fulfilled",value:f}}catch(f){u[h]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},d)),u};class i{max;#t;#e=0;constructor(a=1){this.max=a,this.#t=[]}async add(a){if(this.#e<this.max)return this.#e++,a().finally(()=>this.#r());{let u=Promise.withResolvers();return this.#t.push([a,u]),u.promise.finally(()=>this.#r())}}#r(){if(N(this.#e>0,"Internal Error in Promises.Limit"),--this.#e<this.max&&this.#t.length>0){let[a,{resolve:u,reject:l}]=this.#t.shift();this.#e++,a().then(u,l)}}}r.Limit=i;class o{#t;#e;#r;#i=m.None;constructor(a,u,l){this.#t=a,this.#e=u,this.#r=l}update(a){this.#i=m.wrap(a),a.then(u=>{this.#i.contains(a)&&this.#t(u)}).catch(u=>{this.#i.contains(a)&&this.#e(u)}).finally(()=>{this.#i.contains(a)&&(this.terminate(),w(this.#r))})}terminate(){this.#i=m.None}}r.Latest=o})(ur||(ur={}));var lf;(function(r){let e=new ur.Limit(4);r.limitFetch=(t,n)=>e.add(()=>fetch(t,n)),r.DefaultRetry=(t,n)=>!Ee(t,Ho.FileNotFound)||n<=100})(lf||(lf={}));var cf=(r="debug")=>{let e=performance.now();return{lab:t=>console[r].call(console,`${t} in ${(performance.now()-e).toFixed(1)}ms`)}};var df;(function(r){r.startEstimator=()=>{let e=performance.now();return t=>{if(t===0)return rr.POSITIVE_INFINITY;let n=performance.now()-e;return rr.millis(n/t-n)}}})(df||(df={}));var ds=Symbol.for("@openDAW/lib-runtime");globalThis[ds]?console.debug(`%c${ds.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ds]=!0,console.debug(`%c${ds.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var hf=(r,e)=>Ge.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(n=>{let i=n.type;i==="new"?r.createBox(n.name,n.uuid,o=>o.read(new _e(n.buffer))):i==="update-primitive"?r.findVertex(te.reconstruct(n.address)).unwrap(()=>`Could not find primitive field ${n.address}`).setValue(n.value):i==="update-pointer"?r.findVertex(te.reconstruct(n.address)).unwrap(()=>`Could not find pointer field ${n.address}`).targetAddress=O(n.target)?m.wrap(te.reconstruct(n.target)):m.None:n.type==="delete"&&r.unstageBox(r.findBox(n.uuid).unwrap(()=>`Could not find box ${S.toString(n.uuid)}`))}),r.endTransaction()}checksum(t){return F.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var hs=Symbol.for("@openDAW/lib-box");globalThis[hs]?console.debug(`%c${hs.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[hs]=!0,console.debug(`%c${hs.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var ps=class{#t=0;#e=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#t}set position(e){this.#t=e,this.#r=!0}get transporting(){return this.#e}set transporting(e){this.#e!==e&&(this.#e=e)}pause(){this.#e=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#t=e}};var c;(function(r){r[r.Timeline=0]="Timeline",r[r.Selection=1]="Selection",r[r.PianoMode=2]="PianoMode",r[r.User=3]="User",r[r.AudioConnection=4]="AudioConnection",r[r.InstrumentHost=5]="InstrumentHost",r[r.AudioOutput=6]="AudioOutput",r[r.Capture=7]="Capture",r[r.NotesConnection=8]="NotesConnection",r[r.VoltageConnection=9]="VoltageConnection",r[r.AudioUnits=10]="AudioUnits",r[r.MidiEffectHost=11]="MidiEffectHost",r[r.AudioEffectHost=12]="AudioEffectHost",r[r.AudioBusses=13]="AudioBusses",r[r.AuxSend=14]="AuxSend",r[r.Modulation=15]="Modulation",r[r.Automation=16]="Automation",r[r.ParameterController=17]="ParameterController",r[r.MidiControl=18]="MidiControl",r[r.StepAutomation=19]="StepAutomation",r[r.Editing=20]="Editing",r[r.AudioFile=21]="AudioFile",r[r.SoundfontFile=22]="SoundfontFile",r[r.AudioUnit=23]="AudioUnit",r[r.MarkerTrack=24]="MarkerTrack",r[r.MarkerEvents=25]="MarkerEvents",r[r.ClipCollection=26]="ClipCollection",r[r.RegionCollection=27]="RegionCollection",r[r.TrackCollection=28]="TrackCollection",r[r.Device=29]="Device",r[r.Groove=30]="Groove",r[r.ModularSetup=31]="ModularSetup",r[r.ModuleCollection=32]="ModuleCollection",r[r.ConnectionCollection=33]="ConnectionCollection",r[r.DeviceUserInterface=34]="DeviceUserInterface",r[r.NoteEvents=35]="NoteEvents",r[r.NoteEventFeature=36]="NoteEventFeature",r[r.NoteEventCollection=37]="NoteEventCollection",r[r.ValueEvents=38]="ValueEvents",r[r.ValueEventCollection=39]="ValueEventCollection",r[r.ValueInterpolation=40]="ValueInterpolation",r[r.Sample=41]="Sample"})(c||(c={}));var pf;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(pf||(pf={}));var mf;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(mf||(mf={}));var ms;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(ms||(ms={}));var ff=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?A(`Indices cannot be equal (${r}, ${e})`):t};var Me=class r{static create(e,t,n){return new r(e,t,n)}#t;#e;#r;#i;#n=null;constructor(e,t,n){this.#t=e,this.#e=S.newSet(i=>i.adapter.uuid),this.#r=new Ie,this.#i=e.pointerHub.catchupAndSubscribe({onAdded:i=>{this.#n=null;let o=t(i.box),s=o.indexField.subscribe(()=>{this.#n=null,this.#r.proxy.onReorder(o)}),a=this.#e.add({adapter:o,subscription:s});N(a,`Could not add ${o}`),this.#r.proxy.onAdd(o)},onRemoved:i=>{this.#n=null;let o=i.box.address.uuid,{adapter:s,subscription:a}=this.#e.removeByKey(o);a.terminate(),this.#r.proxy.onRemove(s)}},n)}field(){return this.#t}subscribe(e){return this.#r.subscribe(e)}catchupAndSubscribe(e){return this.#e.forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=pe.exactMapped(this.adapters(),e,ff,n=>n.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return this.#e.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 this.#n===null&&(this.#n=this.#e.values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue())),this.#n}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let n=this.adapters(),i=n[e];if(t<0){let o=G(e+t,0,n.length-1);for(let s=o;s<e;s++)n[s].indexField.setValue(s+1);i.indexField.setValue(o)}else if(t>1){let o=G(e+(t-1),0,n.length-1);for(let s=e;s<o;s++)n[s+1].indexField.setValue(s);i.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return this.#e.size()}isEmpty(){return this.size()===0}terminate(){this.#n=null,this.#e.forEach(({subscription:e})=>e.terminate()),this.#e.clear(),this.#r.terminate(),this.#i.terminate()}};var fs;(function(r){r.create=(e,t,n,i)=>{switch(e){case"RootBox":return gs.create(t,n,i);case"SelectionBox":return jn.create(t,n,i);case"UserInterfaceBox":return wi.create(t,n,i);case"TimelineBox":return Ai.create(t,n,i);case"TrackBox":return $i.create(t,n,i);case"NoteEventBox":return lr.create(t,n,i);case"NoteEventRepeatBox":return vs.create(t,n,i);case"NoteEventCollectionBox":return Vt.create(t,n,i);case"NoteRegionBox":return Jr.create(t,n,i);case"NoteClipBox":return Ei.create(t,n,i);case"ValueEventBox":return cr.create(t,n,i);case"ValueEventCollectionBox":return jt.create(t,n,i);case"ValueEventCurveBox":return dr.create(t,n,i);case"ValueRegionBox":return Yr.create(t,n,i);case"ValueClipBox":return Si.create(t,n,i);case"AudioRegionBox":return Ni.create(t,n,i);case"AudioClipBox":return Pi.create(t,n,i);case"MarkerBox":return ki.create(t,n,i);case"AudioFileBox":return xs.create(t,n,i);case"SoundfontFileBox":return ys.create(t,n,i);case"AudioUnitBox":return xt.create(t,n,i);case"CaptureAudioBox":return bs.create(t,n,i);case"CaptureMidiBox":return ws.create(t,n,i);case"AudioBusBox":return hr.create(t,n,i);case"AuxSendBox":return As.create(t,n,i);case"StepAutomationBox":return $s.create(t,n,i);case"GrooveShuffleBox":return Es.create(t,n,i);case"UnknownAudioEffectDeviceBox":return Ss.create(t,n,i);case"UnknownMidiEffectDeviceBox":return Ns.create(t,n,i);case"DeviceInterfaceKnobBox":return Ps.create(t,n,i);case"ModularDeviceBox":return ks.create(t,n,i);case"DeviceClashBox":return _s.create(t,n,i);case"StereoToolDeviceBox":return Fs.create(t,n,i);case"CompressorDeviceBox":return Is.create(t,n,i);case"DelayDeviceBox":return Bs.create(t,n,i);case"CrusherDeviceBox":return Ds.create(t,n,i);case"FoldDeviceBox":return Cs.create(t,n,i);case"RevampDeviceBox":return Rs.create(t,n,i);case"ReverbDeviceBox":return Os.create(t,n,i);case"VaporisateurDeviceBox":return zs.create(t,n,i);case"SoundfontDeviceBox":return Ms.create(t,n,i);case"NanoDeviceBox":return Ts.create(t,n,i);case"PlayfieldDeviceBox":return Us.create(t,n,i);case"PlayfieldSampleBox":return _i.create(t,n,i);case"TapeDeviceBox":return Vs.create(t,n,i);case"ArpeggioDeviceBox":return js.create(t,n,i);case"PitchDeviceBox":return Ls.create(t,n,i);case"ZeitgeistDeviceBox":return Ks.create(t,n,i);case"ModularBox":return Zs.create(t,n,i);case"ModuleConnectionBox":return qs.create(t,n,i);case"ModularAudioInputBox":return Hs.create(t,n,i);case"ModularAudioOutputBox":return Gs.create(t,n,i);case"ModuleDelayBox":return Ws.create(t,n,i);case"ModuleMultiplierBox":return Js.create(t,n,i);case"ModuleGainBox":return Ys.create(t,n,i);default:return A(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let n=new _e(t),i=n.readString(),o=S.fromDataInput(n),s=r.create(i,e,o);return s.read(n),s}})(fs||(fs={}));var Qs=class r extends ye{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:$.create({parent:this,fieldKey:1,fieldName:"keyboard",pointerRules:p},0),2:P.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",pointerRules:p},8),3:P.create({parent:this,fieldKey:3,fieldName:"noteScale",pointerRules:p},1.5),4:k.create({parent:this,fieldKey:4,fieldName:"noteLabels",pointerRules:p},!1),5:$.create({parent:this,fieldKey:5,fieldName:"transpose",pointerRules:p},0)}}};var gs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:p}),n)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return w(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 pianoMode(){return this.getField(40)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"timeline",pointerRules:p},c.Timeline,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"users",pointerRules:{accepts:[c.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",pointerRules:p}),4:_.create({parent:this,fieldKey:4,fieldName:"groove",pointerRules:p},c.Groove,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"modularSetups",pointerRules:{accepts:[c.ModularSetup],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"audioUnits",pointerRules:{accepts:[c.AudioUnits],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"audioBusses",pointerRules:{accepts:[c.AudioBusses],mandatory:!1}}),30:K.hook({parent:this,fieldKey:30,fieldName:"outputDevice",pointerRules:{accepts:[c.AudioOutput],mandatory:!0}}),40:Qs.create({parent:this,fieldKey:40,fieldName:"pianoMode",pointerRules:p}),111:_.create({parent:this,fieldKey:111,fieldName:"editingChannel",pointerRules:p},c.Editing,!1)}}};var jn=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:p}),n)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return w(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"selection",pointerRules:p},c.Selection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"selectable",pointerRules:p},c.Selection,!0)}}};var wi=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:p}),n)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return w(e.visitUserInterfaceBox,this)}get root(){return this.getField(1)}get selection(){return this.getField(10)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"root",pointerRules:p},c.User,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"selection",pointerRules:{accepts:[c.Selection],mandatory:!1}}),21:_.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",pointerRules:p},c.Editing,!1),22:_.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",pointerRules:p},c.Editing,!1),23:_.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",pointerRules:p},c.Editing,!1)}}};var Xs=class r extends ye{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:$.create({parent:this,fieldKey:1,fieldName:"nominator",pointerRules:p},4),2:$.create({parent:this,fieldKey:2,fieldName:"denominator",pointerRules:p},4)}}};var ea=class r extends ye{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",pointerRules:p},!0),2:$.create({parent:this,fieldKey:2,fieldName:"from",pointerRules:p},0),3:$.create({parent:this,fieldKey:3,fieldName:"to",pointerRules:p},15360)}}};var ta=class r extends ye{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",pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),10:$.create({parent:this,fieldKey:10,fieldName:"index",pointerRules:p}),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",pointerRules:p},!0)}}};var Ai=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:p}),n)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:{accepts:[c.Timeline],mandatory:!0}}),10:Xs.create({parent:this,fieldKey:10,fieldName:"signature",pointerRules:p}),11:ea.create({parent:this,fieldKey:11,fieldName:"loopArea",pointerRules:p}),20:K.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),21:ta.create({parent:this,fieldKey:21,fieldName:"markerTrack",pointerRules:p}),30:$.create({parent:this,fieldKey:30,fieldName:"durationInPulses",pointerRules:p},491520),31:P.create({parent:this,fieldKey:31,fieldName:"bpm",pointerRules:p},120)}}};var $i=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode],mandatory:!1}}),n)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"tracks",pointerRules:p},c.TrackCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"target",pointerRules:p},c.Automation,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"regions",pointerRules:{accepts:[c.RegionCollection],mandatory:!1}}),4:K.hook({parent:this,fieldKey:4,fieldName:"clips",pointerRules:{accepts:[c.ClipCollection],mandatory:!1}}),10:$.create({parent:this,fieldKey:10,fieldName:"index",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"type",pointerRules:p}),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",pointerRules:p},!0),30:k.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",pointerRules:p},!1)}}};var lr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.NoteEventFeature],mandatory:!1}}),n)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"events",pointerRules:p},c.NoteEvents,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p},240),20:$.create({parent:this,fieldKey:20,fieldName:"pitch",pointerRules:p},60),21:P.create({parent:this,fieldKey:21,fieldName:"velocity",pointerRules:p},.7874015748031497),22:$.create({parent:this,fieldKey:22,fieldName:"playCount",pointerRules:p},1),23:P.create({parent:this,fieldKey:23,fieldName:"playCurve",pointerRules:p},0),24:P.create({parent:this,fieldKey:24,fieldName:"cent",pointerRules:p},0),25:$.create({parent:this,fieldKey:25,fieldName:"chance",pointerRules:p},100)}}};var vs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:p}),n)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"event",pointerRules:p},c.NoteEventFeature,!0),2:$.create({parent:this,fieldKey:2,fieldName:"count",pointerRules:p},1),3:P.create({parent:this,fieldKey:3,fieldName:"curve",pointerRules:p},0),4:P.create({parent:this,fieldKey:4,fieldName:"length",pointerRules:p},1)}}};var Vt=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:{accepts:[c.NoteEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0}})}}};var Jr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.NoteEventCollection,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:$.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:$.create({parent:this,fieldKey:14,fieldName:"eventOffset",pointerRules:p}),15:k.create({parent:this,fieldKey:15,fieldName:"mute",pointerRules:p}),16:C.create({parent:this,fieldKey:16,fieldName:"label",pointerRules:p}),17:$.create({parent:this,fieldKey:17,fieldName:"hue",pointerRules:p})}}};var pr=class r extends ye{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",pointerRules:p},!0),2:k.create({parent:this,fieldKey:2,fieldName:"reverse",pointerRules:p}),3:k.create({parent:this,fieldKey:3,fieldName:"mute",pointerRules:p}),4:$.create({parent:this,fieldKey:4,fieldName:"speed",pointerRules:p}),5:$.create({parent:this,fieldKey:5,fieldName:"quantise",pointerRules:p}),6:$.create({parent:this,fieldKey:6,fieldName:"trigger",pointerRules:p})}}};var Ei=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return w(e.visitNoteClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.NoteEventCollection,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:pr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:$.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:k.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p})}}};var cr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"events",pointerRules:p},c.ValueEvents,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"index",pointerRules:p}),12:$.create({parent:this,fieldKey:12,fieldName:"interpolation",pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1}},1),13:P.create({parent:this,fieldKey:13,fieldName:"value",pointerRules:p}),14:P.create({parent:this,fieldKey:14,fieldName:"slope",pointerRules:p})}}};var jt=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:{accepts:[c.ValueEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0}})}}};var dr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:p}),n)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return w(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"event",pointerRules:p},c.ValueInterpolation,!0),2:P.create({parent:this,fieldKey:2,fieldName:"slope",pointerRules:p},.5)}}};var Yr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.ValueEventCollection,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:$.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:k.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:p}),15:C.create({parent:this,fieldKey:15,fieldName:"label",pointerRules:p}),16:$.create({parent:this,fieldKey:16,fieldName:"hue",pointerRules:p})}}};var Si=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return w(e.visitValueClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"events",pointerRules:p},c.ValueEventCollection,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:pr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:$.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:k.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p})}}};var Ni=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return w(e.visitAudioRegionBox,this)}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}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:_.create({parent:this,fieldKey:1,fieldName:"regions",pointerRules:p},c.RegionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"file",pointerRules:p},c.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",pointerRules:p},"pitch"),10:$.create({parent:this,fieldKey:10,fieldName:"position",pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:p}),12:$.create({parent:this,fieldKey:12,fieldName:"loopOffset",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"loopDuration",pointerRules:p}),14:k.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:p}),15:C.create({parent:this,fieldKey:15,fieldName:"label",pointerRules:p}),16:$.create({parent:this,fieldKey:16,fieldName:"hue",pointerRules:p}),17:P.create({parent:this,fieldKey:17,fieldName:"gain",pointerRules:p})}}};var Pi=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),n)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return w(e.visitAudioClipBox,this)}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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)}get gain(){return this.getField(14)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"clips",pointerRules:p},c.ClipCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"file",pointerRules:p},c.AudioFile,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:pr.create({parent:this,fieldKey:4,fieldName:"playback",pointerRules:p}),10:$.create({parent:this,fieldKey:10,fieldName:"duration",pointerRules:p}),11:k.create({parent:this,fieldKey:11,fieldName:"mute",pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",pointerRules:p}),14:P.create({parent:this,fieldKey:14,fieldName:"gain",pointerRules:p})}}};var ki=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"track",pointerRules:p},c.MarkerTrack,!0),2:$.create({parent:this,fieldKey:2,fieldName:"position",pointerRules:p}),3:$.create({parent:this,fieldKey:3,fieldName:"plays",pointerRules:p},1),4:C.create({parent:this,fieldKey:4,fieldName:"label",pointerRules:p}),5:$.create({parent:this,fieldKey:5,fieldName:"hue",pointerRules:p})}}};var xs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile],mandatory:!0}}),n)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return w(e.visitAudioFileBox,this)}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"startInSeconds",pointerRules:p}),2:$.create({parent:this,fieldKey:2,fieldName:"endInSeconds",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",pointerRules:p})}}};var ys=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.SoundfontFile],mandatory:!0}}),n)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return w(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",pointerRules:p})}}};var xt=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation],mandatory:!1}}),n)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:p},"instrument"),2:_.create({parent:this,fieldKey:2,fieldName:"collection",pointerRules:p},c.AudioUnits,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:$.create({parent:this,fieldKey:11,fieldName:"index",pointerRules:p}),12:P.create({parent:this,fieldKey:12,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:P.create({parent:this,fieldKey:13,fieldName:"panning",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"mute",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"solo",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"tracks",pointerRules:{accepts:[c.TrackCollection],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"midiEffects",pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),22:K.hook({parent:this,fieldKey:22,fieldName:"input",pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1}}),23:K.hook({parent:this,fieldKey:23,fieldName:"audioEffects",pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),24:K.hook({parent:this,fieldKey:24,fieldName:"auxSends",pointerRules:{accepts:[c.AuxSend],mandatory:!1}}),25:_.create({parent:this,fieldKey:25,fieldName:"output",pointerRules:p},c.AudioOutput,!1),26:_.create({parent:this,fieldKey:26,fieldName:"capture",pointerRules:p},c.Capture,!1)}}};var bs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:p}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",pointerRules:p},"normal"),10:$.create({parent:this,fieldKey:10,fieldName:"requestChannels",pointerRules:p},1),11:P.create({parent:this,fieldKey:11,fieldName:"gainDb",pointerRules:p},0)}}};var ws=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:p}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",pointerRules:p},"normal"),10:$.create({parent:this,fieldKey:10,fieldName:"channel",pointerRules:p},-1)}}};var hr=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:p}),n)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.AudioBusses,!0),2:_.create({parent:this,fieldKey:2,fieldName:"output",pointerRules:p},c.AudioOutput,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"input",pointerRules:{accepts:[c.AudioOutput],mandatory:!1}}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",pointerRules:p}),6:C.create({parent:this,fieldKey:6,fieldName:"label",pointerRules:p}),7:C.create({parent:this,fieldKey:7,fieldName:"color",pointerRules:p},"red"),8:k.create({parent:this,fieldKey:8,fieldName:"minimized",pointerRules:p})}}};var As=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:p}),n)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"audioUnit",pointerRules:p},c.AuxSend,!0),2:_.create({parent:this,fieldKey:2,fieldName:"targetBus",pointerRules:p},c.AudioOutput,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),4:$.create({parent:this,fieldKey:4,fieldName:"routing",pointerRules:p},1),5:P.create({parent:this,fieldKey:5,fieldName:"sendGain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),6:P.create({parent:this,fieldKey:6,fieldName:"sendPan",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var $s=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StepAutomationBox",pointerRules:p}),n)}static ClassName="StepAutomationBox";constructor(e){super(e)}accept(e){return w(e.visitStepAutomationBox,this)}get step(){return this.getField(1)}get parameter(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"step",pointerRules:p},c.StepAutomation,!0),2:_.create({parent:this,fieldKey:2,fieldName:"parameter",pointerRules:p},c.StepAutomation,!0),3:P.create({parent:this,fieldKey:3,fieldName:"value",pointerRules:p})}}};var Es=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.Groove],mandatory:!0}}),n)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return w(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",pointerRules:p}),10:P.create({parent:this,fieldKey:10,fieldName:"amount",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.6),11:$.create({parent:this,fieldKey:11,fieldName:"duration",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},480)}}};var Ss=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",pointerRules:p})}}};var Ns=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",pointerRules:p})}}};var Ps=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p}),n)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"userInterface",pointerRules:p},c.DeviceUserInterface,!0),2:_.create({parent:this,fieldKey:2,fieldName:"parameter",pointerRules:p},c.ParameterController,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",pointerRules:p}),10:P.create({parent:this,fieldKey:10,fieldName:"anchor",pointerRules:p}),11:C.create({parent:this,fieldKey:11,fieldName:"color",pointerRules:p})}}};var ra=class r extends ye{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",pointerRules:{accepts:[c.DeviceUserInterface],mandatory:!1}})}}};var ks=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"modularSetup",pointerRules:p},c.ModularSetup,!0),11:ra.create({parent:this,fieldKey:11,fieldName:"userInterface",pointerRules:p})}}};var ia=class r extends ye{static create(e){return new r(e)}constructor(e){super(e)}get active(){return this.getField(1)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"active",pointerRules:{accepts:[c.StepAutomation],mandatory:!1}})}}};var na=class r extends ye{static create(e){return new r(e)}constructor(e){super(e)}get steps(){return this.getField(10)}get length(){return this.getField(11)}get scale(){return this.getField(12)}initializeFields(){return{10:bi.create({parent:this,fieldKey:10,fieldName:"steps",pointerRules:p},e=>ia.create(e),128),11:$.create({parent:this,fieldKey:11,fieldName:"length",pointerRules:p},16),12:$.create({parent:this,fieldKey:12,fieldName:"scale",pointerRules:p},960)}}};var _s=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceClashBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="DeviceClashBox";constructor(e){super(e)}accept(e){return w(e.visitDeviceClashBox,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 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)}get patterns(){return this.getField(30)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"delay",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},.5),11:P.create({parent:this,fieldKey:11,fieldName:"feedback",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},.9),12:P.create({parent:this,fieldKey:12,fieldName:"cross",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},0),13:P.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},0),14:P.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},-3),15:P.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.StepAutomation],mandatory:!1}},-3),30:bi.create({parent:this,fieldKey:30,fieldName:"patterns",pointerRules:p},e=>na.create(e),16)}}};var Fs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"panning",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:P.create({parent:this,fieldKey:12,fieldName:"stereo",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:k.create({parent:this,fieldKey:13,fieldName:"invertL",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"invertR",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"swap",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:$.create({parent:this,fieldKey:20,fieldName:"panningMixing",pointerRules:p},1)}}};var Is=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),11:k.create({parent:this,fieldKey:11,fieldName:"automakeup",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!0),12:k.create({parent:this,fieldKey:12,fieldName:"autoattack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),13:k.create({parent:this,fieldKey:13,fieldName:"autorelease",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),14:P.create({parent:this,fieldKey:14,fieldName:"inputgain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),15:P.create({parent:this,fieldKey:15,fieldName:"threshold",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-10),16:P.create({parent:this,fieldKey:16,fieldName:"ratio",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},2),17:P.create({parent:this,fieldKey:17,fieldName:"knee",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),18:P.create({parent:this,fieldKey:18,fieldName:"attack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),19:P.create({parent:this,fieldKey:19,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},5),20:P.create({parent:this,fieldKey:20,fieldName:"makeup",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),21:P.create({parent:this,fieldKey:21,fieldName:"mix",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1)}}};var Bs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"delay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},4),11:P.create({parent:this,fieldKey:11,fieldName:"feedback",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),12:P.create({parent:this,fieldKey:12,fieldName:"cross",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),13:P.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),14:P.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-6),15:P.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0)}}};var Ds=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"crush",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),11:$.create({parent:this,fieldKey:11,fieldName:"bits",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},16),12:P.create({parent:this,fieldKey:12,fieldName:"boost",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),13:P.create({parent:this,fieldKey:13,fieldName:"mix",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1)}}};var Cs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"drive",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),11:$.create({parent:this,fieldKey:11,fieldName:"overSampling",pointerRules:p},0),12:P.create({parent:this,fieldKey:12,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0)}}};var Ln=class r extends ye{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",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:$.create({parent:this,fieldKey:11,fieldName:"order",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:P.create({parent:this,fieldKey:12,fieldName:"q",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Kn=class r extends ye{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",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Fi=class r extends ye{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",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"frequency",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:P.create({parent:this,fieldKey:12,fieldName:"q",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Rs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:Ln.create({parent:this,fieldKey:10,fieldName:"highPass",pointerRules:p}),11:Kn.create({parent:this,fieldKey:11,fieldName:"lowShelf",pointerRules:p}),12:Fi.create({parent:this,fieldKey:12,fieldName:"lowBell",pointerRules:p}),13:Fi.create({parent:this,fieldKey:13,fieldName:"midBell",pointerRules:p}),14:Fi.create({parent:this,fieldKey:14,fieldName:"highBell",pointerRules:p}),15:Kn.create({parent:this,fieldKey:15,fieldName:"highShelf",pointerRules:p}),16:Ln.create({parent:this,fieldKey:16,fieldName:"lowPass",pointerRules:p}),17:P.create({parent:this,fieldKey:17,fieldName:"gain",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Os=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"decay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),11:P.create({parent:this,fieldKey:11,fieldName:"preDelay",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),12:P.create({parent:this,fieldKey:12,fieldName:"damp",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.5),13:P.create({parent:this,fieldKey:13,fieldName:"filter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),14:P.create({parent:this,fieldKey:14,fieldName:"wet",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-3),15:P.create({parent:this,fieldKey:15,fieldName:"dry",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0)}}};var zs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return w(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)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:$.create({parent:this,fieldKey:11,fieldName:"octave",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:P.create({parent:this,fieldKey:12,fieldName:"tune",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:$.create({parent:this,fieldKey:13,fieldName:"waveform",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:P.create({parent:this,fieldKey:14,fieldName:"cutoff",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:P.create({parent:this,fieldKey:15,fieldName:"resonance",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),16:P.create({parent:this,fieldKey:16,fieldName:"attack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),17:P.create({parent:this,fieldKey:17,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),18:P.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Ms=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"file",pointerRules:p},c.SoundfontFile,!1),11:$.create({parent:this,fieldKey:11,fieldName:"presetIndex",pointerRules:p})}}};var Ts=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"volume",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},-3),15:_.create({parent:this,fieldKey:15,fieldName:"file",pointerRules:p},c.AudioFile,!1),20:P.create({parent:this,fieldKey:20,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.1)}}};var Us=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:K.hook({parent:this,fieldKey:10,fieldName:"samples",pointerRules:{accepts:[c.Sample],mandatory:!1}})}}};var _i=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing],mandatory:!1}}),n)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:10,fieldName:"device",pointerRules:p},c.Sample,!0),11:_.create({parent:this,fieldKey:11,fieldName:"file",pointerRules:p},c.AudioFile,!0),12:K.hook({parent:this,fieldKey:12,fieldName:"midiEffects",pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),13:K.hook({parent:this,fieldKey:13,fieldName:"audioEffects",pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"index",pointerRules:p},60),20:C.create({parent:this,fieldKey:20,fieldName:"label",pointerRules:p}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",pointerRules:p}),22:k.create({parent:this,fieldKey:22,fieldName:"enabled",pointerRules:p},!0),23:k.create({parent:this,fieldKey:23,fieldName:"minimized",pointerRules:p},!1),40:k.create({parent:this,fieldKey:40,fieldName:"mute",pointerRules:p}),41:k.create({parent:this,fieldKey:41,fieldName:"solo",pointerRules:p}),42:k.create({parent:this,fieldKey:42,fieldName:"exclude",pointerRules:p}),43:k.create({parent:this,fieldKey:43,fieldName:"polyphone",pointerRules:p}),44:$.create({parent:this,fieldKey:44,fieldName:"gate",pointerRules:p},0),45:P.create({parent:this,fieldKey:45,fieldName:"pitch",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),46:P.create({parent:this,fieldKey:46,fieldName:"sampleStart",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},0),47:P.create({parent:this,fieldKey:47,fieldName:"sampleEnd",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),48:P.create({parent:this,fieldKey:48,fieldName:"attack",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.001),49:P.create({parent:this,fieldKey:49,fieldName:"release",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},.02)}}};var Vs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.Automation],mandatory:!1}}),n)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:P.create({parent:this,fieldKey:10,fieldName:"flutter",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"wow",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:P.create({parent:this,fieldKey:12,fieldName:"noise",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),13:P.create({parent:this,fieldKey:13,fieldName:"saturation",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var js=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:$.create({parent:this,fieldKey:10,fieldName:"modeIndex",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:$.create({parent:this,fieldKey:11,fieldName:"numOctaves",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),12:$.create({parent:this,fieldKey:12,fieldName:"rateIndex",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},9),13:P.create({parent:this,fieldKey:13,fieldName:"gate",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),14:$.create({parent:this,fieldKey:14,fieldName:"repeat",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},1),15:P.create({parent:this,fieldKey:15,fieldName:"velocity",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Ls=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:$.create({parent:this,fieldKey:10,fieldName:"semiTones",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"cents",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),12:$.create({parent:this,fieldKey:12,fieldName:"octaves",pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}})}}};var Ks=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),n)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"host",pointerRules:p},c.MidiEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",pointerRules:p},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"groove",pointerRules:p},c.Groove,!0)}}};var Zs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:p}),n)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return w(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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ModularSetup,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"device",pointerRules:{accepts:[c.ModularSetup],mandatory:!0}}),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"modules",pointerRules:{accepts:[c.ModuleCollection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"connections",pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",pointerRules:p})}}};var qs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:p}),n)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return w(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ConnectionCollection,!0),2:_.create({parent:this,fieldKey:2,fieldName:"source",pointerRules:p},c.VoltageConnection,!0),3:_.create({parent:this,fieldKey:3,fieldName:"target",pointerRules:p},c.VoltageConnection,!0)}}};var ut=class r extends ye{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:_.create({parent:this,fieldKey:1,fieldName:"collection",pointerRules:p},c.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",pointerRules:p}),3:$.create({parent:this,fieldKey:3,fieldName:"x",pointerRules:p}),4:$.create({parent:this,fieldKey:4,fieldName:"y",pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"collapsed",pointerRules:p},!1),6:k.create({parent:this,fieldKey:6,fieldName:"removable",pointerRules:p},!0)}}};var Hs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return w(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:ut.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"output",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Gs=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return w(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:ut.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"input",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Ws=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return w(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:ut.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:P.create({parent:this,fieldKey:20,fieldName:"time",pointerRules:{accepts:[c.ParameterController],mandatory:!1}},500)}}};var Js=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return w(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:ut.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:P.create({parent:this,fieldKey:20,fieldName:"multiplier",pointerRules:p})}}};var Ys=class r extends D{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return w(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:ut.create({parent:this,fieldKey:1,fieldName:"attributes",pointerRules:p}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:P.create({parent:this,fieldKey:20,fieldName:"gain",pointerRules:{accepts:[c.ParameterController],mandatory:!1}})}}};var Et;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;O(n)?(Ul(n,dr),n.slope.setValue(t.slope)):dr.create(e.box.graph,S.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return O(t)?(Ul(t,dr),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?sr.None:e.getValue()===1?sr.Linear:A("Unknown Interpolation value")}})(Et||(Et={}));var mr=class r{static Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.index-t.index;if(i!==0)return i;throw new Error(`${e} and ${t} are identical in terms of comparison`)};type="value-event";#t=new V;#e;#r;#i;#n;#o=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new To(()=>Et.read(this.#r.interpolation)));let n=()=>{this.#i.invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};this.#t.ownAll(this.#r.subscribe(ce.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let o=this.collection.unwrap(),s=i.address.fieldKeys,a=F.equals(this.#r.index.address.fieldKeys,s),u=F.equals(this.#r.position.address.fieldKeys,s);a||u?o.requestSorting():o.onEventPropertyChanged()}}),this.#r.interpolation.subscribe(n),this.#r.interpolation.pointerHub.subscribe({onAdded:({box:i})=>{this.#n.terminate(),this.#n=i.subscribe(ce.Children,n),n()},onRemoved:()=>{this.#n.terminate(),this.#n=Z.Empty,n()}})),this.#n=this.#r.interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(ce.Children,n)??Z.Empty}onSelected(){this.#o=!0,this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){this.#o=!1,this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){this.#n.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get index(){return this.#r.index.getValue()}set interpolation(e){Et.write(this.#r.interpolation,e)}get interpolation(){return this.#i.get()}get value(){return this.#r.value.getValue()}get isSelected(){return this.#o}get collection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,lt))}copyTo(e){let t=cr.create(this.#e.boxGraph,S.generate(),n=>{n.position.setValue(e?.position??this.position),n.index.setValue(e?.index??this.index),n.events.refer(e?.events??this.collection.unwrap().box.events),n.value.setValue(e?.value??this.value)});return Et.write(t.interpolation,e?.interpolation??this.interpolation),this.#e.boxAdapters.adapterFor(t,r)}copyFrom(e){return this.#r.position.setValue(e?.position??this.position),this.#r.index.setValue(e?.index??this.index),this.#r.events.refer(e?.events??this.collection.unwrap().box.events),this.#r.value.setValue(e?.value??this.value),Et.write(this.#r.interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};var lt=class r{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#n=S.newSet(i=>i.uuid),this.#o=ir.create(mr.Comparator);let n=i=>{let o=q(i.accept({visitValueEventBox:s=>this.#e.boxAdapters.adapterFor(s,mr)}),`Could not find adapter for ${i}`);this.#n.add(o)&&(this.#o.add(o),this.#s())};this.#r.events.pointerHub.incoming().forEach(({box:i})=>n(i)),this.#t.own(this.#r.events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{this.#o.remove(this.#n.removeByKey(i)),this.#s()}})),this.#t.own(this.#r.owners.pointerHub.subscribe({onAdded:()=>this.#i.notify(this),onRemoved:()=>this.#i.notify(this)}))}valueAt(e,t){return ns.valueAt(this.#o,e,t)}copy(){let e=this.#e.boxGraph,t=jt.create(e,S.generate());return this.#o.asArray().forEach(n=>n.copyTo({events:t.events})),this.#e.boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),n=this.events.greaterEqual(e);if(n===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:n.value,index:n.index,interpolation:n.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:o}=t,{position:s,value:a}=n;return m.wrap(this.createEvent({position:e,value:Im(o,a,(e-i)/(s-i)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:i,value:o}=t,{position:s,value:a}=n,u=s-i,l=e-i,d=at.byHalf(u,o,at.valueAt({slope:t.interpolation.slope,steps:u,y0:o,y1:a},u*.5),a),h=at.valueAt(d,l),f=at.slopeByHalf(o,at.valueAt(d,l*.5),h);return Et.write(t.box.interpolation,sr.Curve(f)),m.wrap(this.createEvent({position:e,value:h,index:0,interpolation:sr.Curve(at.slopeByHalf(h,at.valueAt(d,(l+u)*.5),a))}))}return A("Unknown interpolation type")}subscribeChange(e){return this.#i.subscribe(e)}createEvent({position:e,index:t,value:n,interpolation:i}){let o=cr.create(this.#e.boxGraph,S.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(n),s.events.refer(this.#r.events)});return Et.write(o.interpolation,i),this.#e.boxAdapters.adapterFor(o,mr)}requestSorting(){this.#o.onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){this.#s()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get numOwners(){return this.#r.owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return this.#o}toString(){return`{ValueEventCollectionBox ${S.toString(this.#r.address.uuid)}}`}#s(){this.#i.notify(this)}};var fr=class{type="value-clip";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Ze(!1)),this.#n=this.#t.own(new W),this.#t.own(this.#r.pointerHub.subscribe({onAdded:()=>this.#a(),onRemoved:()=>this.#a()})),this.#t.own(this.#r.subscribe(ce.Children,n=>this.#a())),this.#t.own(this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,lt).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return w(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&this.#r.events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:this.#r.events.targetVertex.unwrap();Si.create(this.#e.boxGraph,S.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(this.#r.clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,lt))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${S.toString(this.#r.address.uuid)} d: ${re.toString(this.duration)}}`}#a(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var St=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get startInSeconds(){return this.#e.startInSeconds.getValue()}get endInSeconds(){return this.#e.endInSeconds.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}getOrCreateLoader(){return this.#t.sampleManager.getOrCreate(this.#e.address.uuid)}terminate(){}};var gr=class{type="audio-clip";#t=new V;#e;#r;#i;#n;#o;#s=m.None;#a=m.None;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Ze(!1)),this.#n=this.#t.own(new W),this.#t.ownAll(this.#r.pointerHub.subscribe({onAdded:()=>this.#u(),onRemoved:()=>this.#u()}),this.#r.file.catchupAndSubscribe(n=>{this.#s=n.targetVertex.map(i=>this.#e.boxAdapters.adapterFor(i.box,St)),this.#a.ifSome(i=>i.terminate()),this.#a=this.#s.map(i=>i.getOrCreateLoader().subscribe(()=>this.#u()))}),this.#r.subscribe(ce.Children,n=>this.#u()),{terminate:()=>{this.#a.ifSome(n=>n.terminate()),this.#a=m.None}}),this.#o=!1}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return w(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){Pi.create(this.#e.boxGraph,S.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(this.#r.clips.targetVertex.unwrap()),t.file.refer(this.#r.file.targetVertex.unwrap())})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get gain(){return this.#r.gain.getValue()}get file(){return this.#s.unwrap("Cannot access file.")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}get isMirrowed(){return!1}get canMirror(){return!1}toString(){return`{AudioClipBoxAdapter ${S.toString(this.#r.address.uuid)} d: ${re.toString(this.duration)}}`}#u(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var Qr=class r{type="note-event";#t;#e;#r;#i=!1;constructor(e,t){this.#t=e,this.#e=t,this.#r=this.#e.subscribe(ce.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),o=n.address.fieldKeys,s=F.equals(this.#e.pitch.address.fieldKeys,o),a=F.equals(this.#e.position.address.fieldKeys,o);s||a?i.requestSorting():i.onEventPropertyChanged()}})}onSelected(){this.#i=!0,this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){this.#i=!1,this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){this.#r.terminate()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get position(){return this.#e.position.getValue()}get duration(){return this.#e.duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return this.#e.velocity.getValue()}get pitch(){return this.#e.pitch.getValue()}get cent(){return this.#e.cent.getValue()}get chance(){return this.#e.chance.getValue()}get playCount(){return this.#e.playCount.getValue()}get playCurve(){return this.#e.playCurve.getValue()}get isSelected(){return this.#i}get collection(){return this.#e.events.targetVertex.map(e=>this.#t.boxAdapters.adapterFor(e.box,ct))}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 this.#t.boxAdapters.adapterFor(lr.create(this.#t.boxGraph,S.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 He.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,n=F.create(i=>{let o=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+o),duration:Math.max(1,s-o),playCount:1,events:t})},e);return this.#e.delete(),n}};var ct=class r{#t=new V;#e;#r;#i;#n;#o;#s=60;#a=60;#u=0;#l=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#n=S.newSet(i=>i.uuid),this.#o=ir.create(He.Comparator);let n=i=>{let o=q(i.accept({visitNoteEventBox:s=>this.#e.boxAdapters.adapterFor(s,Qr)}),`Could not find adapter for ${i}`);this.#n.add(o)&&(this.#o.add(o),this.#c())};this.#r.events.pointerHub.incoming().forEach(({box:i})=>n(i)),this.#t.own(this.#r.events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{this.#o.remove(this.#n.removeByKey(i)),this.#c()}})),this.#t.own(this.#r.owners.pointerHub.subscribe({onAdded:()=>this.#i.notify(this),onRemoved:()=>this.#i.notify(this)}))}copy(){let e=this.#e.boxGraph,t=Vt.create(e,S.generate());return this.#o.asArray().forEach(n=>n.copyTo({events:t.events})),this.#e.boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:n,pitch:i,chance:o,playCount:s,cent:a}){return this.#e.boxAdapters.adapterFor(lr.create(this.#e.boxGraph,S.generate(),u=>{u.position.setValue(e),u.duration.setValue(t),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(o),u.playCount.setValue(s),u.cent.setValue(a),u.events.refer(this.#r.events)}),Qr)}subscribeChange(e){return this.#i.subscribe(e)}selectable(){return this.#o.asArray()}selectableAt(e){for(let t of this.#o.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 n=[];for(let i of this.#o.asArray())In.intersect1D(i.position,i.complete,e.u,t.u)&&In.intersect1D(i.pitch,i.pitch,e.v,t.v)&&n.push(i);return n}requestSorting(){this.#o.onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){this.#c()}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get numOwners(){return this.#r.owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return this.#l||this.#h(),this.#o}get minPitch(){return this.#l||this.#h(),this.#s}get maxPitch(){return this.#l||this.#h(),this.#a}get maxDuration(){return this.#l||this.#h(),this.#u}toString(){return`{NoteEventCollectionBox ${S.toString(this.#r.address.uuid)}}`}#c(){this.#l=!1,this.#i.notify(this)}#h(){let e=127,t=0,n=0;this.#o.asArray().forEach(({pitch:i,duration:o})=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.max(n,o)}),this.#s=e,this.#a=t,this.#u=n,this.#l=!0}};var Ii=class{type="note-clip";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=this.#t.own(new Ze(!1)),this.#n=this.#t.own(new W),this.#t.ownAll(this.#r.pointerHub.subscribe({onAdded:()=>this.#a(),onRemoved:()=>this.#a()}),this.#r.subscribe(ce.Children,n=>this.#a()),this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,ct).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}catchupAndSubscribeSelected(e){return this.#i.catchupAndSubscribe(e)}subscribeChange(e){return this.#n.subscribe(e)}accept(e){return w(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&this.#r.events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:this.#r.events.targetVertex.unwrap();Ei.create(this.#e.boxGraph,S.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(this.#r.clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){this.#i.setValue(!0)}onDeselected(){this.#i.setValue(!1)}get isSelected(){return this.#i.getValue()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get duration(){return this.#r.duration.getValue()}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ct))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.clips.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${S.toString(this.#r.address.uuid)} d: ${re.toString(this.duration)}}`}#a(){this.#n.notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()}};var oa={for:(r,e)=>q(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Ii),visitValueClipBox:t=>r.adapterFor(t,fr),visitAudioClipBox:t=>r.adapterFor(t,gr)}),"")};var sa=class{#t;#e;#r;#i;constructor(e,t){this.#t=e,this.#e=new V,this.#r=this.#e.own(new W),this.#i=this.#e.own(Me.create(e.box.clips,n=>oa.for(t,n),c.ClipCollection)),this.#i.subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return this.#t}get collection(){return this.#i}dispatchChange(){this.#r.notify()}subscribeChanges(e){return this.#r.subscribe(e)}terminate(){this.#e.terminate()}};var vr=class r{type="audio-region";#t;#e;#r;#i;#n=m.None;#o=m.None;#s;#a;constructor(e,t){this.#e=e,this.#r=t,this.#t=new V,this.#i=new W,this.#s=!1,this.#a=!0,this.#t.ownAll(this.#r.pointerHub.subscribe({onAdded:()=>this.#u(),onRemoved:()=>this.#u()}),this.#r.file.catchupAndSubscribe(n=>{this.#n=n.targetVertex.map(i=>this.#e.boxAdapters.adapterFor(i.box,St)),this.#o.ifSome(i=>i.terminate()),this.#o=this.#n.map(i=>i.getOrCreateLoader().subscribe(()=>this.#u()))}),this.#r.subscribe(ce.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#u()):this.#u()}}),{terminate:()=>{this.#o.ifSome(n=>n.terminate()),this.#o=m.None}}),this.#a=!1}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return w(e.visitAudioRegionBoxAdapter,this)}onSelected(){this.#s=!0,this.#u()}onDeselected(){this.#s=!1,this.#u()}get isSelected(){return this.#s}terminate(){this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){let e=this.#r.duration.getValue();if(e===0){let t=this.#n.unwrap("Cannot compute duration without file"),n=t.startInSeconds,o=t.endInSeconds-n;return re.secondsToPulses(o,this.#e.bpm)}return e}get complete(){return this.position+this.duration}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get gain(){return this.#r.gain.getValue()}get file(){return this.#n.unwrap("Cannot access file.")}get hasCollection(){return this.#n.nonEmpty()}get optCollection(){return m.None}get label(){if(this.#n.isEmpty())return"No Audio File";let e=this.#n.unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):this.#r.label.getValue()}get isMirrowed(){return!1}get canMirror(){return!1}get trackBoxAdapter(){return this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}copyTo(e){return this.#e.boxAdapters.adapterFor(Ni.create(this.#e.boxGraph,S.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.loopOffset.setValue(e?.loopOffset??this.loopOffset),t.loopDuration.setValue(e?.loopDuration??this.loopDuration),t.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap()),t.file.refer(this.#r.file.targetVertex.unwrap()),t.mute.setValue(this.mute),t.hue.setValue(this.hue),t.label.setValue(this.label),t.gain.setValue(this.gain)}),r)}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}toString(){return`{AudioRegionBoxAdapter ${S.toString(this.#r.address.uuid)}}`}#u(){this.#a||(this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())}};var xr=class r{type="note-region";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#o=!1,this.#n=!0,this.#t.ownAll(this.#r.pointerHub.subscribe({onAdded:()=>this.#a(),onRemoved:()=>this.#a()}),this.#r.subscribe(ce.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#a()):this.#a()}}),this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,ct).subscribeChange(()=>this.#a())}),this.#a()})),this.#n=!1}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return w(e.visitNoteRegionBoxAdapter,this)}onSelected(){this.#o=!0,this.#a()}onDeselected(){this.#o=!1,this.#a()}get isSelected(){return this.#o}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let n=t.unwrap(),i=Ye.globalToLocal(this,e);for(let o of n.events.iterateFrom(i-n.maxDuration)){if(i<o.position)return;i<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){return this.#r.duration.getValue()}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ct))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#n?m.None:this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return this.#e.boxAdapters.adapterFor(Jr.create(this.#e.boxGraph,S.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=this.#e.boxGraph,n=Vt.create(t,S.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),this.#r.events.refer(n.owners)})}canFlatten(e){return e.length>0&&F.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=this.#e.boxGraph,n=e.toSorted(nr.Comparator),i=F.getFirst(n,"Internal error (no first)"),o=F.getLast(n,"Internal error (no last)"),s=i.position,a=o.position+o.duration,u=i.trackBoxAdapter.unwrap(),l=Vt.create(t,S.generate()),d=Array.from(u.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of Ye.locateLoops(f,f.position,f.complete)){let b=Math.floor(v-y),R=Math.floor(g-y);for(let M of f.optCollection.unwrap().events.iterateRange(b,R))M.copyTo({position:M.position+y-i.position,events:l.events})}}),d.forEach(({box:h})=>h.delete()),m.wrap(Jr.create(t,S.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(l.owners),h.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${S.toString(this.#r.address.uuid)} p: ${re.toString(this.position)}, c: ${re.toString(this.complete)}}`}#a(){this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()}};var Lt=class r{type="value-region";#t=new V;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#o=!0,this.#i=new W,this.#n=!1,this.#t.own(this.#r.pointerHub.subscribe({onAdded:()=>this.#a(),onRemoved:()=>this.#a()})),this.#t.own(this.#r.subscribe(ce.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();this.#r.position.address.equals(n.address)?(i.regions.onIndexingChanged(),this.#a()):this.#a()}})),this.#t.own(this.#r.events.catchupAndSubscribe(({targetVertex:n})=>{this.#s.terminate(),this.#s=n.match({none:()=>Z.Empty,some:({box:i})=>this.#e.boxAdapters.adapterFor(i,lt).subscribeChange(()=>this.#a())}),this.#a()})),this.#o=!1}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(Ye.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(Ye.globalToLocal(this,this.complete),e)}subscribeChange(e){return this.#i.subscribe(e)}accept(e){return w(e.visitValueRegionBoxAdapter,this)}onSelected(){this.#n=!0,this.#a()}onDeselected(){this.#n=!1,this.#a()}get isSelected(){return this.#n}onValuesPropertyChanged(){this.#a()}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){this.#s.terminate(),this.#t.terminate()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get duration(){return this.#r.duration.getValue()}get loopOffset(){return this.#r.loopOffset.getValue()}get loopDuration(){return this.#r.loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return this.#r.mute.getValue()}get hue(){return this.#r.hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return this.#r.events.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,lt))}get label(){return this.#r.label.getValue()}get trackBoxAdapter(){return this.#o?m.None:this.#r.regions.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,ke))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return this.#e.boxAdapters.adapterFor(Yr.create(this.#e.boxGraph,S.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??this.#r.regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=this.#e.boxGraph,n=jt.create(t,S.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),this.#r.events.refer(n.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=this.#e.boxGraph,n=e.toSorted(nr.Comparator),i=F.getFirst(n,"Internal error (no first)"),o=F.getLast(n,"Internal error (no last)"),s=i.position,a=o.position+o.duration,u=i.trackBoxAdapter.unwrap(),l=jt.create(t,S.generate()),d=Array.from(u.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of Ye.locateLoops(f,f.position,f.complete)){let b=Math.floor(v-y),R=Math.floor(g-y);for(let M of f.events.unwrap().iterateRange(b,R));}}),d.forEach(({box:h})=>h.delete()),m.wrap(Yr.create(t,S.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(l.owners),h.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${S.toString(this.#r.address.uuid)} p: ${re.toString(this.position)}, c: ${re.toString(this.complete)}}`}#a(){this.#i.notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()}};var gf=(r,e)=>r.position-e.position,vf={for:(r,e)=>q(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,xr),visitAudioRegionBox:t=>r.adapterFor(t,vr),visitValueRegionBox:t=>r.adapterFor(t,Lt)}),"")};var aa=class{#t;#e;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#e=new V,this.#r=this.#e.own(new W),this.#i=this.#e.own(new Ie),this.#n=nr.create(gf),this.#o=S.newSet(n=>n.uuid),this.#e.ownAll(this.#t.box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=vf.for(t,n),o=this.#o.add(i);N(o,`Cannot add ${n}`),this.#n.add(i),this.#i.forEach(s=>s.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=this.#o.removeByKey(n);this.#n.remove(i),this.#i.forEach(o=>o.onRemoved(i)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return this.#t}get collection(){return this.#n}get adapters(){return this.#o}onIndexingChanged(){this.#n.onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),this.#i.subscribe(e)}subscribeChanges(e){return this.#r.subscribe(e)}dispatchChange(){this.#r.notify()}terminate(){this.#e.terminate()}};var ze;(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.Checkbox=12]="Checkbox",r[r.Clips=13]="Clips",r[r.Close=14]="Close",r[r.CloudFolder=15]="CloudFolder",r[r.CollapseDown=16]="CollapseDown",r[r.Compressor=17]="Compressor",r[r.Connected=18]="Connected",r[r.Cube=19]="Cube",r[r.Cursor=20]="Cursor",r[r.Curve=21]="Curve",r[r.Delete=22]="Delete",r[r.Dial=23]="Dial",r[r.DinSlot=24]="DinSlot",r[r.Disconnected=25]="Disconnected",r[r.Divide=26]="Divide",r[r.DragConnections=27]="DragConnections",r[r.Dropdown=28]="Dropdown",r[r.Dropbox=29]="Dropbox",r[r.DrumSet=30]="DrumSet",r[r.Duration=31]="Duration",r[r.EditBox=32]="EditBox",r[r.Effects=33]="Effects",r[r.Embed=34]="Embed",r[r.EQ=35]="EQ",r[r.Eraser=36]="Eraser",r[r.Exclude=37]="Exclude",r[r.Exit=38]="Exit",r[r.ExpandWidth=39]="ExpandWidth",r[r.FileList=40]="FileList",r[r.Flask=41]="Flask",r[r.Focus=42]="Focus",r[r.Generator=43]="Generator",r[r.GoogleDrive=44]="GoogleDrive",r[r.Groove=45]="Groove",r[r.Guitar=46]="Guitar",r[r.GuitarTab=47]="GuitarTab",r[r.Headphone=48]="Headphone",r[r.Heart=49]="Heart",r[r.Help=50]="Help",r[r.HighPass=51]="HighPass",r[r.HighShelf=52]="HighShelf",r[r.Insert=53]="Insert",r[r.Invert=54]="Invert",r[r.Loop=55]="Loop",r[r.LowPass=56]="LowPass",r[r.LowShelf=57]="LowShelf",r[r.MainMenu=58]="MainMenu",r[r.Maximized=59]="Maximized",r[r.Menu=60]="Menu",r[r.Merge=61]="Merge",r[r.Metronome=62]="Metronome",r[r.Microphone=63]="Microphone",r[r.Midi=64]="Midi",r[r.Minimized=65]="Minimized",r[r.Mix=66]="Mix",r[r.Mixing=67]="Mixing",r[r.Mute=68]="Mute",r[r.NanoWave=69]="NanoWave",r[r.New=70]="New",r[r.NoAudio=71]="NoAudio",r[r.Note=72]="Note",r[r.NotePad=73]="NotePad",r[r.OpenDAW=74]="OpenDAW",r[r.Panel=75]="Panel",r[r.Peak=76]="Peak",r[r.Pencil=77]="Pencil",r[r.Piano=78]="Piano",r[r.Playfield=79]="Playfield",r[r.Play=80]="Play",r[r.Pointer=81]="Pointer",r[r.Popout=82]="Popout",r[r.Primary=83]="Primary",r[r.Random=84]="Random",r[r.Record=85]="Record",r[r.Rectangle=86]="Rectangle",r[r.Region=87]="Region",r[r.Robot=88]="Robot",r[r.RoundDown=89]="RoundDown",r[r.RoundUp=90]="RoundUp",r[r.Run=91]="Run",r[r.Saxophone=92]="Saxophone",r[r.Scissors=93]="Scissors",r[r.Search=94]="Search",r[r.Solo=95]="Solo",r[r.SpeakerHeadphone=96]="SpeakerHeadphone",r[r.Stack=97]="Stack",r[r.Start=98]="Start",r[r.Stereo=99]="Stereo",r[r.Stop=100]="Stop",r[r.Subtract=101]="Subtract",r[r.Sun=102]="Sun",r[r.Swap=103]="Swap",r[r.System=104]="System",r[r.Table=105]="Table",r[r.Tape=106]="Tape",r[r.Time=107]="Time",r[r.Timeline=108]="Timeline",r[r.Tool=109]="Tool",r[r.Unknown=110]="Unknown",r[r.UserFolder=111]="UserFolder",r[r.Velocity=112]="Velocity",r[r.Vinyl=113]="Vinyl",r[r.VUMeter=114]="VUMeter",r[r.Waveform=115]="Waveform",r[r.Zeitgeist=116]="Zeitgeist"})(ze||(ze={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(ze||(ze={}));var de;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(de||(de={}));(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 ze.Waveform;case r.Notes:return ze.Piano;case r.Value:return ze.Automation;case r.Undefined:return ze.AudioBus;default:return ze.Unknown}}})(de||(de={}));var ua;(function(r){r.isDeviceBox=e=>"host"in e&&Ee(e.host,_)&&"label"in e&&Ee(e.label,C)&&"enabled"in e&&Ee(e.enabled,k)&&"minimized"in e&&Ee(e.minimized,k),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===c.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Ee(e.index,$)&&(e.host.pointerType===c.MidiEffectHost||e.host.pointerType===c.AudioEffectHost),r.lookupHostField=e=>O(e)&&"host"in e&&Ee(e.host,_)?e.host:A(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>O(e)&&"label"in e&&Ee(e.label,C)?e.label:A(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>O(e)&&"enabled"in e&&Ee(e.enabled,k)?e.enabled:A(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>O(e)&&"minimized"in e&&Ee(e.minimized,k)?e.minimized:A(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>O(e)&&"index"in e&&Ee(e.index,$)?e.index:A(`Could not find 'index' field in '${e?.name}'`)})(ua||(ua={}));var xf;(function(r){r.toTrackType=e=>{switch(e){case"midi":return de.Notes;case"audio":return de.Audio;default:return A()}}})(xf||(xf={}));var Y;(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;N(F.satisfy(e,(i,o)=>i.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MidiEffectHost):A("unknown type")).map(({box:i})=>ua.lookupIndexField(i)).filter(i=>e.some(o=>S.Comparator(o.uuid,i.address.uuid)!==0)).sort((i,o)=>i.getValue()-o.getValue()).forEach((i,o)=>i.setValue(o)),e.forEach(i=>i.box.delete())}})(Y||(Y={}));var la=class{#t;#e=new W;#r;#i;#n;constructor(e,t){this.#t=e,this.#r=Me.create(e.box.tracks,n=>t.adapterFor(n,ke),c.TrackCollection),this.#i=S.newSet(({uuid:n})=>n),this.#n=this.#r.catchupAndSubscribe({onAdd:n=>this.#i.add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>this.#e.notify())}),onRemove:({uuid:n})=>this.#i.removeByKey(n).subscription.terminate(),onReorder:n=>{}})}create(e,t,n){let i=this.#t.box.graph,o=this.#t.box.tracks;$i.create(i,S.generate(),s=>{s.index.setValue(n??this.#r.getMinFreeIndex()),s.type.setValue(e),s.tracks.refer(o),s.target.refer(t)})}controls(e){return m.wrap(this.#r.adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=this.#r.adapters(),n=t.indexOf(e);if(n===-1)return A(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return this.#r}values(){return this.#r.adapters()}catchupAndSubscribe(e){return this.#r.catchupAndSubscribe(e)}subscribeAnyChange(e){return this.#e.subscribe(e)}terminate(){this.#r.terminate(),this.#n.terminate(),this.#i.forEach(({subscription:e})=>e.terminate()),this.#i.clear()}};var We=class{type="bus";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}catchupAndSubscribe(e){return e(this),this.#e.subscribe(ce.Children,()=>e(this))}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get iconField(){return this.#e.icon}get labelField(){return this.#e.label}get colorField(){return this.#e.color}get iconSymbol(){return ze.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.output.targetVertex.unwrap("No AudioUnitBox found").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};var ca=class{#t;#e;#r;#i;#n=Z.Empty;constructor(e,t){this.#t=new V,this.#e=this.#t.own(new W),this.#r=this.#t.own(new Ze(ze.Unknown)),this.#i=this.#t.own(new Ze(m.None)),this.#t.own(this.#i.subscribe(n=>{this.#n.terminate(),this.#n=n.getValue().match({none:()=>(this.#e.notify(m.None),Z.Empty),some:({labelField:i,iconField:o})=>Z.many(o.catchupAndSubscribe(s=>this.#r.setValue(ze.fromName(s.getValue()))),i.catchupAndSubscribe(s=>this.#e.notify(m.wrap(s.getValue()))))})})),this.#t.own(e.catchupAndSubscribe({onAdded:({box:n})=>{N(this.#i.getValue().isEmpty(),"Already set");let i=n instanceof hr?t.adapterFor(n,We):t.adapterFor(n,Y.isInstrument);this.#i.getValue().unwrapOrNull()!==i&&this.#i.setValue(m.wrap(i))},onRemoved:({box:n})=>{N(this.#i.getValue().unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),this.#i.setValue(m.None)}},c.InstrumentHost,c.AudioOutput))}getValue(){return this.#i.getValue()}subscribe(e){return this.#i.subscribe(e)}catchupAndSubscribe(e){return e(this.#i),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),this.#e.subscribe(e)}catchupAndSubscribeIconChange(e){return this.#r.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(ze.toName(e)))}get icon(){return this.getValue().match({none:()=>ze.Unknown,some:e=>ze.fromName(e.iconField.getValue())})}get iconValue(){return this.#r}terminate(){this.#t.terminate(),this.#n.terminate()}};var se=class{#t;#e;constructor(e){this.#t=e,this.#e=new tr(t=>t.address.fieldKeys,_m)}terminate(){this.#e.forEach(e=>e.terminate()),this.#e.clear()}parameters(){return this.#e.values()}parameterAt(e){return this.#e.getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e}]`))}createParameter(e,t,n,i,o){let s=new Xr(this.#t,e,t,n,i,o),a=this.#e.add(s);return N(a,`Could not add adapter for ${e}`),s}removeParameter(e){this.#e.removeByValue(e)}};var Bi=class{#t;#e;#r;#i;#n;#o;#s=Z.Empty;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new W),this.#r.own(t.targetBus.catchupAndSubscribe(()=>{this.#s.terminate(),this.#s=this.optTargetBus.match({none:()=>(this.#i.notify(m.None),Z.Empty),some:n=>n.catchupAndSubscribe(i=>this.#i.notify(m.wrap(i)))})})),this.#n=this.#r.own(new Xr(this.#t,this.#e.sendPan,B.bipolar(),I.percent({unit:"%",fractionDigits:0}),"panning")),this.#o=this.#r.own(new Xr(this.#t,this.#e.sendGain,B.DefaultDecibel,I.numeric({unit:"dB",fractionDigits:1}),"gain"))}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),this.#i.subscribe(e)}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get indexField(){return this.#e.index}get sendPan(){return this.#n}get sendGain(){return this.#o}get targetBus(){return this.#t.boxAdapters.adapterFor(this.#e.targetBus.targetVertex.unwrap("no audioUnit").box,We)}get optTargetBus(){return this.#e.targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>this.#t.boxAdapters.adapterFor(t,We)})))}delete(){this.#e.delete()}terminate(){this.#r.terminate(),this.#s.terminate()}};var da=class{#t;#e;#r;#i;#n=Z.Empty;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new W),this.#r.own(e.catchupAndSubscribe(()=>{this.#n.terminate(),this.#n=this.adapter.match({none:()=>(this.#i.notify(m.None),Z.Empty),some:n=>n.catchupAndSubscribe(i=>this.#i.notify(m.wrap(i)))})}))}subscribe(e){return this.#i.subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return this.#t.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>this.#e.adapterFor(t,We)})))}terminate(){this.#r.terminate(),this.#n.terminate()}};var Nt=class r{static VolumeMapper=B.decibel(-96,-9,6);class="device-host";#t=new V;#e;#r;#i;#n;#o;#s;#a;#u;#l;namedParameter;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new se(this.#e)),this.#n=this.#t.own(new la(this,this.#e.boxAdapters)),this.#o=this.#t.own(new ca(this.#r.input.pointerHub,this.#e.boxAdapters)),this.#s=this.#t.own(Me.create(this.#r.midiEffects,n=>this.#e.boxAdapters.adapterFor(n,Y.isMidiEffect),c.MidiEffectHost)),this.#a=this.#t.own(Me.create(this.#r.audioEffects,n=>this.#e.boxAdapters.adapterFor(n,Y.isAudioEffect),c.AudioEffectHost)),this.#u=this.#t.own(Me.create(this.#r.auxSends,n=>this.#e.boxAdapters.adapterFor(n,Bi),c.AuxSend)),this.#l=this.#t.own(new da(this.#r.output,this.#e.boxAdapters)),this.namedParameter=this.#c(t),this.#h()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get indexField(){return this.#r.index}get type(){return this.#r.type.getValue()}get captureBox(){return this.#r.capture.targetVertex}get tracks(){return this.#n}get input(){return this.#o}get midiEffects(){return this.#s}get audioEffects(){return this.#a}get inputAdapter(){return this.#o.getValue()}get auxSends(){return this.#u}get output(){return this.#l}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 this.#r.output.targetVertex.mapOr(e=>e.box.address.equals(this.#e.rootBoxAdapter.address),!1)}get midiEffectsField(){return this.#r.midiEffects}get inputField(){return this.#r.input}get audioEffectsField(){return this.#r.audioEffects}get tracksField(){return this.#r.tracks}get minimizedField(){return this.#o.getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return this.#o.getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=this.#e.rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),n=this.type,i=t,o=t;for(;i>0&&e[i-1].type===n;)i--;for(;o<e.length-1&&e[o+1].type===n;)o++;return[i,o+1]}move(e){this.#e.rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){this.#n.collection.move(e,t)}deleteTrack(e){this.#n.delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){this.#t.terminate()}#c(e){return{volume:this.#i.createParameter(e.volume,r.VolumeMapper,I.decible,"volume"),panning:this.#i.createParameter(e.panning,B.bipolar(),I.panning,"panning",.5),mute:this.#i.createParameter(e.mute,B.bool,I.bool,"mute"),solo:this.#i.createParameter(e.solo,B.bool,I.bool,"solo")}}#h(){let e=this.address.toString(),t=this.#r.capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${this.#r.input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;N(this.type!==ms.Instrument||this.#r.capture.targetAddress.nonEmpty(),n)}};var ha=re.fromSignature(1,384);var ke=class{#t;#e;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=this.#r.own(new sa(this,e.boxAdapters)),this.#n=this.#r.own(new aa(this,e.boxAdapters)),this.#o=this.#r.own(new Ze(-1))}catchupAndSubscribePath(e){let t=[m.None,m.None],n=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return Z.many(this.#s(i=>{t[0].equals(i)||(t[0]=i,n())}),this.#a(i=>{t[1].equals(i)||(t[1]=i,n())}))}set targetDeviceName(e){this.#e.target.targetVertex.ifSome(t=>{let n=t.box;if(n instanceof xt)return this.#t.boxAdapters.adapterFor(n,Nt).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in n&&n.label instanceof C)return n.label.setValue(e)})}get targetDeviceName(){return this.#e.target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof xt?this.#t.boxAdapters.adapterFor(t,Nt).input.label:"label"in t&&t.label instanceof C?m.wrap(t.label.getValue()):m.wrap(t.name)})}#s(e){let t=this.#e.target.targetVertex;if(t.nonEmpty()){let n=t.unwrap().box;return n instanceof xt?this.#t.boxAdapters.adapterFor(n,Nt).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in n&&n.label instanceof C?n.label.catchupAndSubscribe(i=>e(m.wrap(i.getValue()))):(e(m.wrap(n.name)),Z.Empty)}return e(m.None),Z.Empty}#a(e){let t=this.type;switch(t){case de.Audio:case de.Notes:return e(m.wrap(de[t])),Z.Empty;case de.Value:{let n=this.#e.target.targetVertex.unwrap();if(n.isField())e(this.#t.parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(m.wrap(n.name));else return A("Illegal State. Vertex is not a field nor box.");return Z.Empty}case de.Undefined:return e(m.wrap("")),Z.Empty;default:return e(m.None),Z.Empty}}terminate(){this.#r.terminate()}get audioUnit(){return st(this.#e.tracks.targetVertex.unwrap().box,xt)}get target(){return this.#e.target}get clips(){return this.#i}get regions(){return this.#n}get enabled(){return this.#e.enabled}get indexField(){return this.#e.index}get type(){return this.#e.type.getValue()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get listIndex(){return this.#o.getValue()}set listIndex(e){this.#o.setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===de.Audio;case"note-clip":return this.type===de.Notes;case"value-clip":return this.type===de.Value;case"audio-region":return this.type===de.Audio;case"note-region":return this.type===de.Notes;case"value-region":return this.type===de.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let n=t,i=this.#t.clipSequencing.iterate(this.uuid,e,e+ha);for(let{optClip:o,sectionFrom:s}of i)n=o.match({none:()=>{let a=this.regions.collection.lowerEqual(e,u=>!u.mute);if(a===null){let u=this.regions.collection.optAt(0);return Ee(u,Lt)?u.incomingValue(t):t}else if(Ee(a,Lt))return e<a.complete?a.valueAt(e,t):a.outgoingValue(t);return t},some:a=>s===e&&Ee(a,fr)?a.valueAt(e,t):t});return n}};var yf=[c.Automation,c.Modulation,c.MidiControl,c.ParameterController],Xr=class{#t;#e;#r;#i;#n;#o;#s=new V;#a;#u;#l=m.None;#c=m.None;#h=null;#d=!1;constructor(e,t,n,i,o,s){this.#t=e,this.#e=t,this.#r=n,this.#i=i,this.#n=o,this.#o=s??0,this.#s.own(this.#t.parameterFieldAdapters.register(this)),this.#a=this.#s.own(new W),this.#u=new Ie,this.#s.own(this.#e.subscribe(()=>this.#a.notify(this))),this.#s.own(this.#e.pointerHub.catchupAndSubscribe({onAdded:a=>{this.#u.proxy.onControlSourceAdd(lc(a.pointerType)),a.box.accept({visitTrackBox:u=>{N(this.#l.isEmpty(),"Already assigned");let l=this.#t.boxAdapters.adapterFor(u,ke);this.#l=m.wrap(l),this.#t.isMainThread&&(this.#c=m.wrap(this.#t.liveStreamReceiver.subscribeFloat(this.#e.address,d=>{this.#h!==d&&(this.#h=d,this.#a.notify(this))})))}})},onRemoved:a=>{this.#u.proxy.onControlSourceRemove(lc(a.pointerType)),a.box.accept({visitTrackBox:u=>{N(this.#l.unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),this.#l=m.None,this.#t.isMainThread&&(this.#c.ifSome(l=>l.terminate()),this.#c=m.None,this.#h=null,this.#a.notify(this))}})}},...yf)),t.getValue()!==n.clamp(t.getValue())&&console.warn(`${o} (${t.getValue()}) is out of bounds`,n)}registerMidiControl(){return this.#u.proxy.onControlSourceAdd("midi"),this.#d=!0,{terminate:()=>{this.#d=!1,this.#u.proxy.onControlSourceRemove("midi")}}}get field(){return this.#e}get valueMapping(){return this.#r}get stringMapping(){return this.#i}get name(){return this.#n}get anchor(){return this.#o}get type(){return this.#e.type}get address(){return this.#e.address}get track(){return this.#l}valueAt(e){let t=this.#l;if(t.nonEmpty()){let n=t.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return this.#a.subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return this.#d&&e.onControlSourceAdd("midi"),this.#e.pointerHub.filter(...yf).forEach(t=>e.onControlSourceAdd(lc(t.pointerType))),this.#u.subscribe(e)}getValue(){return this.#e.getValue()}setValue(e){this.#e.setValue(e)}setUnitValue(e){this.setValue(this.#r.y(e))}getUnitValue(){return this.#r.x(this.getValue())}getControlledValue(){return this.#r.y(this.getControlledUnitValue())}getControlledUnitValue(){return this.#h??this.getUnitValue()}getControlledPrintValue(){return this.#i.x(this.getControlledValue())}getPrintValue(){return this.#i.x(this.getValue())}setPrintValue(e){let t=this.#i.y(e);t.type==="unitValue"?this.setUnitValue(G(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(this.#r.clamp(this.#e.initValue))}terminate(){this.#c.ifSome(e=>e.terminate()),this.#c=m.None,this.#s.terminate()}},lc=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MidiControl:return"midi";case c.ParameterController:return"external";default:return A(`${r.toString()} is an unknown pointer type`)}};var pa=class{#t;#e;#r;constructor(e,t,n){this.#t=S.newSet(i=>i.uuid),this.#e=new Ie,this.#r=e.catchupAndSubscribe({onAdded:i=>{let o=t(i.box),s=this.#t.add(o);N(s,`Could not add ${o}`),this.#e.proxy.onAdd(o)},onRemoved:i=>{let o=i.box.address.uuid;this.#e.proxy.onRemove(this.#t.removeByKey(o))}},n)}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return this.#t.forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return this.#t.values()}size(){return this.#t.size()}isEmpty(){return this.size()===0}terminate(){this.#t.clear(),this.#e.terminate(),this.#r.terminate()}};var Kt=class r{static OffsetFractions=vt.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();static OffsetStringMapping=I.indices("",this.OffsetFractions.map(([e,t])=>`${e}/${t}`));type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{delay:this.#r.createParameter(e.delay,B.linearInteger(0,r.OffsetFractions.length-1),r.OffsetStringMapping,"delay"),feedback:this.#r.createParameter(e.feedback,B.unipolar(),I.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:this.#r.createParameter(e.cross,B.unipolar(),I.numeric({unit:"%",fractionDigits:0}),"cross"),filter:this.#r.createParameter(e.filter,B.bipolar(),I.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:this.#r.createParameter(e.dry,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"dry"),wet:this.#r.createParameter(e.wet,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"wet")}}};var Di=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{decay:this.#r.createParameter(e.decay,B.unipolar(),I.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:this.#r.createParameter(e.preDelay,B.exponential(.001,.5),I.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:this.#r.createParameter(e.damp,B.unipolar(),I.numeric({unit:"%",fractionDigits:0}),"damping"),filter:this.#r.createParameter(e.filter,B.bipolar(),I.numeric({unit:"%",fractionDigits:0}),"filter"),dry:this.#r.createParameter(e.dry,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"dry"),wet:this.#r.createParameter(e.wet,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"wet")}}};var Ci=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get spectrum(){return this.#e.address.append(4095)}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{highPass:bf(this.#r,e.highPass,"High-Pass"),lowShelf:wf(this.#r,e.lowShelf,"Low-Shelf"),lowBell:cc(this.#r,e.lowBell,"Low-Bell"),midBell:cc(this.#r,e.midBell,"Mid-Bell"),highBell:cc(this.#r,e.highBell,"High-Bell"),highShelf:wf(this.#r,e.highShelf,"High-Shelf"),lowPass:bf(this.#r,e.lowPass,"Low-Pass")}}},dc=B.exponential(20,2e4),Af=B.linear(-24,24),$f=B.exponential(.01,10),bf=(r,e,t)=>({enabled:r.createParameter(e.enabled,B.bool,I.bool,"enabled"),frequency:r.createParameter(e.frequency,dc,I.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,B.linearInteger(0,3),I.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,$f,I.numeric({fractionDigits:3}),`${t} Q`)}),wf=(r,e,t)=>({enabled:r.createParameter(e.enabled,B.bool,I.bool,"enabled"),frequency:r.createParameter(e.frequency,dc,I.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,Af,I.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),cc=(r,e,t)=>({enabled:r.createParameter(e.enabled,B.bool,I.bool,"enabled"),frequency:r.createParameter(e.frequency,dc,I.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,Af,I.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,$f,I.numeric({fractionDigits:3}),`${t} Q`)});var ei=class{static Comparator=(e,t)=>e.position-t.position;type="marker-event";#t=new V;#e;#r;constructor(e,t){this.#e=e,this.#r=t,this.#t.own(this.#r.subscribe(ce.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();this.#r.position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get position(){return this.#r.position.getValue()}get plays(){return this.#r.plays.getValue()}get hue(){return this.#r.hue.getValue()}get label(){return this.#r.label.getValue()}get trackAdapter(){return this.#r.track.targetVertex.map(e=>this.#e.boxAdapters.adapterFor(e.box,Pt).markerTrack)}terminate(){this.#t.terminate()}toString(){return`{MarkerBoxAdapter ${S.toString(this.#r.address.uuid).substring(0,4)}, plays: ${this.plays}`}};var ma=class{#t;#e;changeNotifier;#r;#i;#n;constructor(e,t){this.#t=e,this.#e=t,this.changeNotifier=new W,this.#r=S.newSet(n=>n.uuid),this.#i=ir.create(ei.Comparator),this.#n=this.#e.markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof ki){let i=this.#t.boxAdapters.adapterFor(n,ei),o=this.#r.add(i);N(o,"Could not add adapter"),this.#i.add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{this.#i.remove(this.#r.removeByKey(n)),this.dispatchChange()}})}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return this.#t}get enabled(){return this.#e.enabled.getValue()}get events(){return this.#i}get object(){return this.#e}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){this.#i.onIndexingChanged(),this.dispatchChange()}terminate(){this.#n.terminate()}};var Pt=class{#t;#e;constructor(e,t){this.#t=t,this.#e=new ma(e,this.#t.markerTrack)}terminate(){}get box(){return this.#t}get uuid(){return this.#t.address.uuid}get address(){return this.#t.address}get markerTrack(){return this.#e}};var yr=class{#t;constructor(e,t){this.#t=t}get box(){return this.#t}get uuid(){return this.#t.address.uuid}get address(){return this.#t.address}get source(){return this.#t.source.targetVertex.unwrap("Insufficient Vertex")}get target(){return this.#t.target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};var dt=class{#t;#e;#r;#i;#n;#o=!1;constructor(e,t){this.#t=e,this.#e=t,this.#r=new V,this.#i=t.attributes,this.#n=this.#r.own(new se(e))}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return this.#r.own(e)}ownAll(...e){this.#r.ownAll(...e)}onSelected(){this.#o=!0}onDeselected(){this.#o=!1}isSelected(){return this.#o}get box(){return this.#e}get attributes(){return this.#i}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get parameters(){return this.#n}get modular(){return this.#t.boxAdapters.adapterFor(this.#e.attributes.collection.targetVertex.unwrap().box,br)}terminate(){this.#r.terminate()}};var Ue;(function(r){r.Input="input",r.Output="output"})(Ue||(Ue={}));var Ve=class r{static create(e,t,n,i){return new r(e,t,n,i??t.fieldName)}#t;#e;#r;#i;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#r=n,this.#i=i}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(n=>n===t))}get connections(){return this.#e.pointerHub.isEmpty()?F.empty():this.#e.pointerHub.filter(c.VoltageConnection).map(({box:e})=>this.#t.adapterFor(e,yr))}get field(){return this.#e}get address(){return this.#e.address}get direction(){return this.#r}get name(){return this.#i}toString(){return`{ModuleConnectorAdapter address: ${this.#e.address.toString()}, direction: ${this.#r}}`}};var Ri=class extends dt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=this.parameters.createParameter(t.time,B.exponential(1,1e4),I.numeric({unit:"ms"}),"Time"),this.#e=Ve.create(e.boxAdapters,t.voltageInput,Ue.Input,"Input"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Output")}get parameterTime(){return this.#t}get voltageInput(){return this.#e}get voltageOutput(){return this.#r}get inputs(){return[this.#e]}get outputs(){return[this.#r]}};var Oi=class extends dt{#t;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.input,Ue.Input,"Input")}get voltageInput(){return this.#t}get inputs(){return[this.#t]}get outputs(){return F.empty()}};var zi=class extends dt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=this.parameters.createParameter(t.gain,B.DefaultDecibel,I.numeric({unit:"db"}),"Gain"),this.#e=Ve.create(e.boxAdapters,t.voltageInput,Ue.Input,"Input"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Output")}get parameterGain(){return this.#t}get voltageInput(){return this.#e}get voltageOutput(){return this.#r}get inputs(){return[this.#e]}get outputs(){return[this.#r]}};var Mi=class extends dt{#t;#e;#r;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.voltageInputX,Ue.Input,"X"),this.#e=Ve.create(e.boxAdapters,t.voltageInputY,Ue.Input,"Y"),this.#r=Ve.create(e.boxAdapters,t.voltageOutput,Ue.Output,"Result")}get inputs(){return[this.#t,this.#e]}get outputs(){return[this.#r]}};var Ti=class extends dt{#t;constructor(e,t){super(e,t),this.#t=Ve.create(e.boxAdapters,t.output,Ue.Output,"Output")}get voltageOutput(){return this.#t}get inputs(){return F.empty()}get outputs(){return[this.#t]}};var Ui;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>q(t.accept({visitModuleGainBox:n=>e.adapterFor(n,zi),visitModuleDelayBox:n=>e.adapterFor(n,Ri),visitModuleMultiplierBox:n=>e.adapterFor(n,Mi),visitModularAudioInputBox:n=>e.adapterFor(n,Ti),visitModularAudioOutputBox:n=>e.adapterFor(n,Oi)}),`Could not find ModuleAdapter for ${t.name}`)})(Ui||(Ui={}));var Vi=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get moduleAdapter(){return Ui.adapterFor(this.#t.boxAdapters,this.#r.box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(this.#r.address.fieldKeys)}get#r(){return this.#e.parameter.targetVertex.unwrap("Parameter not assigned")}terminate(){}};var wr=class{type="audio-effect";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}parameterAt(e){return A("Not yet implemented")}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return this.#t.boxAdapters.adapterFor(this.#e.modularSetup.targetVertex.unwrap("No Modular found").box,br)}elements(){return this.#e.userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>this.#t.boxAdapters.adapterFor(e.box,Vi))}terminate(){}};var br=class{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#r=e,this.#i=t,this.#e=this.#t.own(new Ie),this.#n=S.newSet(a=>a.uuid),this.#o=S.newSet(a=>a.uuid);let n=a=>{let u=Ui.adapterFor(this.#r.boxAdapters,a.box);this.#n.add(u)&&this.#e.proxy.onModuleAdded(u)},i=a=>this.#e.proxy.onModuleRemoved(this.#n.removeByKey(a.address.uuid)),o=a=>{let u=this.#r.boxAdapters.adapterFor(a.box,yr);this.#o.add(u)&&this.#e.proxy.onConnectionAdded(u)},s=a=>this.#e.proxy.onConnectionRemoved(this.#o.removeByKey(a.address.uuid));this.#i.modules.pointerHub.filter(c.ModuleCollection).forEach(n),this.#i.connections.pointerHub.filter(c.ConnectionCollection).forEach(o),this.#t.own(this.#i.modules.pointerHub.subscribe({onAdded:n,onRemoved:i},c.ModuleCollection)),this.#t.own(this.#i.connections.pointerHub.subscribe({onAdded:o,onRemoved:s},c.ConnectionCollection))}catchupAndSubscribe(e){return Tl(e.onModuleAdded,t=>this.#n.forEach(n=>t(n))),Tl(e.onConnectionAdded,t=>this.#o.forEach(n=>t(n))),this.#e.subscribe(e)}get box(){return this.#i}get address(){return this.#i.address}get uuid(){return this.#i.address.uuid}get editingField(){return this.#i.editing}get labelField(){return this.#i.label}get modules(){return this.#n.values()}get connections(){return this.#o.values()}get device(){return this.#r.boxAdapters.adapterFor(q(this.#i.device.pointerHub.incoming().at(0),"No device found").box,wr)}terminate(){console.debug(`terminate ${this}`),this.#t.terminate()}};var ji=class r{static Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];static DurationPPQNs=r.Durations.map(([e,t])=>re.fromSignature(e,t));static DurationStrings=r.Durations.map(([e,t])=>`${e}/${t}`);type="groove-adapter";#t=new V;#e;#r;#i;namedParameter;#n=new es({duration:()=>this.#s,fx:e=>Kl(e,this.#o),fy:e=>Kl(e,1-this.#o)});#o=0;#s=re.SemiQuaver*2;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(new se(this.#e)),this.namedParameter=this.#a(t),this.#t.ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>this.#s=n.getValue()),this.namedParameter.amount.catchupAndSubscribe(n=>this.#o=Fm(n.getValue(),.01)))}unwarp(e){return this.#n.unwarp(e)}warp(e){return this.#n.warp(e)}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#t.terminate()}#a(e){return{duration:this.#i.createParameter(e.duration,B.values(r.DurationPPQNs),I.values("",r.DurationPPQNs,r.DurationStrings),"duration"),amount:this.#i.createParameter(e.amount,B.unipolar(),I.percent({fractionDigits:0}),"amount")}}};var Ar=class{#t;#e;#r;#i;#n;#o=new V;#s;#a=m.None;constructor(e,t,n,i,o){this.#t=e,this.#e=t,this.#r=n,this.#i=i,this.#n=o??0,this.#s=this.#o.own(new W),this.#o.own(this.#t.subscribe(()=>this.#s.notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${i} (${e.getValue()}) is out of bounds`,t)}get field(){return this.#t}get valueMapping(){return this.#e}get stringMapping(){return this.#r}get name(){return this.#i}get anchor(){return this.#n}get type(){return this.#t.type}get address(){return this.#t.address}get track(){return this.#a}subscribe(e){return this.#s.subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return this.#t.getValue()}setValue(e){this.#t.setValue(this.#e.clamp(e))}setUnitValue(e){this.setValue(this.#e.y(e))}getUnitValue(){return this.#e.x(this.getValue())}getPrintValue(){return this.#r.x(this.getValue())}setPrintValue(e){let t=this.#r.y(e);t.type==="unitValue"?this.setUnitValue(G(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(this.#e.clamp(this.#t.initValue))}terminate(){this.#o.terminate()}};var fa=class{#t;#e;#r;#i;#n;#o;constructor(e){this.#t=e,this.#e=new Ar(this.#t.keyboard,B.values([88,76,61,49]),I.numeric({fractionDigits:1}),"Keyboard Type"),this.#r=new Ar(this.#t.timeRangeInQuarters,B.exponential(1,64),I.numeric({fractionDigits:1}),"Time-Range"),this.#i=new Ar(this.#t.noteScale,B.exponential(.5,2),I.numeric({fractionDigits:1}),"Note Scale"),this.#n=new Ar(this.#t.noteLabels,B.bool,I.bool,"Note Labels"),this.#o=new Ar(this.#t.transpose,B.linearInteger(-48,48),I.numeric({fractionDigits:0}),"Transpose")}subscribe(e){return this.#t.box.subscribe(ce.Children,()=>e(this))}get object(){return this.#t}get keyboard(){return this.#e}get timeRangeInQuarters(){return this.#r}get noteScale(){return this.#i}get noteLabels(){return this.#n}get transpose(){return this.#o}};var Li=class{#t;#e;#r;#i;#n;constructor(e,t){this.#t=e,this.#e=t,this.#r=Me.create(this.#e.audioUnits,n=>this.#t.boxAdapters.adapterFor(n,Nt),c.AudioUnits),this.#i=new pa(this.#e.audioBusses.pointerHub,n=>this.#t.boxAdapters.adapterFor(n,We),c.AudioBusses),this.#n=new fa(this.#e.pianoMode)}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get box(){return this.#e}get audioBusses(){return this.#i}get audioUnits(){return this.#r}get clips(){return this.#r.adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return this.#t.boxAdapters.adapterFor(this.#e.groove.targetVertex.unwrap("no groove").box,ji)}get timeline(){return this.#t.boxAdapters.adapterFor(this.#e.timeline.targetVertex.unwrap("no timeline").box,Pt)}get pianoMode(){return this.#n}get created(){return new Date(this.#e.created.getValue())}terminate(){this.#r.terminate()}};var Ki=class{type="instrument";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return de.Audio}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!1}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{flutter:this.#r.createParameter(e.flutter,B.unipolar(),I.percent(),"flutter"),wow:this.#r.createParameter(e.wow,B.unipolar(),I.percent(),"wow"),noise:this.#r.createParameter(e.noise,B.unipolar(),I.percent(),"noise"),saturation:this.#r.createParameter(e.saturation,B.unipolar(),I.percent(),"saturation")}}};var Zi=class{type="instrument";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return de.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"volume"),octave:this.#r.createParameter(e.octave,B.linearInteger(-3,3),I.numeric(),"octave",.5),tune:this.#r.createParameter(e.tune,B.linear(-1200,1200),I.numeric({unit:"cent",fractionDigits:0}),"tune",.5),waveform:this.#r.createParameter(e.waveform,B.linearInteger(0,3),I.indices("",["sine","triangle","sawtooth","square"]),"waveform"),cutoff:this.#r.createParameter(e.cutoff,B.exponential(20,18e3),I.numeric({unit:"Hz"}),"cutoff"),resonance:this.#r.createParameter(e.resonance,B.exponential(.01,10),I.numeric({unit:"q",fractionDigits:3}),"resonance"),attack:this.#r.createParameter(e.attack,B.exponential(.001,1),I.numeric({unit:"s",fractionDigits:3}),"attack"),release:this.#r.createParameter(e.release,B.exponential(.001,1),I.numeric({unit:"s",fractionDigits:3}),"release"),filterEnvelope:this.#r.createParameter(e.filterEnvelope,B.linear(-.5,.5),I.percent(),"filter env",.5)}}};var $r=class r{static RateFractions=vt.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();static RateStringMapping=I.indices("",this.RateFractions.map(([e,t])=>`${e}/${t}`));type="midi-effect";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}parameterAt(e){return this.#r.parameterAt(e)}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{modeIndex:this.#r.createParameter(e.modeIndex,B.linearInteger(0,2),I.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:this.#r.createParameter(e.numOctaves,B.linearInteger(1,5),I.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:this.#r.createParameter(e.rateIndex,B.linearInteger(0,r.RateFractions.length-1),r.RateStringMapping,"Rate"),gate:this.#r.createParameter(e.gate,B.linear(0,2),I.percent({fractionDigits:0}),"Gate"),repeat:this.#r.createParameter(e.repeat,B.linearInteger(1,16),I.numeric({fractionDigits:0}),"Repeat"),velocity:this.#r.createParameter(e.velocity,B.bipolar(),I.percent({fractionDigits:0,bipolar:!1}),"Velocity")}}};var qi=class{type="midi-effect";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{octaves:this.#r.createParameter(e.octaves,B.linearInteger(-7,7),I.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:this.#r.createParameter(e.semiTones,B.linearInteger(-36,36),I.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:this.#r.createParameter(e.cents,B.linear(-50,50),I.numeric({unit:"cents",fractionDigits:1}),"cents")}}};var Hi=class{type="instrument";accepts="midi";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return de.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#r.parameterAt(e)}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,B.DefaultDecibel,I.numeric({unit:"db",fractionDigits:1}),"volume"),release:this.#r.createParameter(e.release,B.exponential(.001,8),I.numeric({unit:"s",fractionDigits:3}),"release")}}};var Gi=class{class="device-host";accepts=!1;type="instrument";#t=new V;#e;#r;#i;#n;#o;namedParameter;#s=m.None;constructor(e,t){this.#e=e,this.#r=t,this.#i=this.#t.own(Me.create(this.#r.midiEffects,n=>this.#e.boxAdapters.adapterFor(n,Y.isMidiEffect),c.MidiEffectHost)),this.#n=this.#t.own(Me.create(this.#r.audioEffects,n=>this.#e.boxAdapters.adapterFor(n,Y.isAudioEffect),c.AudioEffectHost)),this.#o=this.#t.own(new se(this.#e)),this.namedParameter=this.#a(t),this.#t.own(this.#r.file.catchupAndSubscribe(n=>{this.#s=n.targetVertex.map(({box:i})=>this.#e.boxAdapters.adapterFor(i,St)),this.#s.unwrapOrNull()?.getOrCreateLoader()}))}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get peakAddress(){return this.#r.address.append(1001)}get indexField(){return this.#r.index}get gate(){return this.#r.gate.getValue()}get exclude(){return this.#r.exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${this.#s.mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return this.#r.icon}get defaultTrackType(){return de.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return this.#r.midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return this.#r.audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return this.#s}fileUUID(){return this.#r.file.targetAddress.unwrap().uuid}resetParameters(){this.#r.mute.reset(),this.#r.solo.reset(),this.#r.exclude.reset(),this.#r.polyphone.reset(),this.#r.pitch.reset(),this.#r.attack.reset(),this.#r.release.reset(),this.#r.sampleStart.reset(),this.#r.sampleEnd.reset(),this.#r.gate.reset()}copyToIndex(e){_i.create(this.#r.graph,S.generate(),t=>{t.file.refer(this.#r.file.targetVertex.unwrap()),t.device.refer(this.#r.device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(this.#r.mute.getValue()),t.solo.setValue(this.#r.solo.getValue()),t.sampleStart.setValue(this.#r.sampleStart.getValue()),t.sampleEnd.setValue(this.#r.sampleEnd.getValue()),t.attack.setValue(this.#r.attack.getValue()),t.release.setValue(this.#r.release.getValue()),t.pitch.setValue(this.#r.pitch.getValue()),t.exclude.setValue(this.#r.exclude.getValue()),t.gate.setValue(this.#r.gate.getValue())})}get midiEffects(){return this.#i}get inputAdapter(){return m.wrap(this)}get audioEffects(){return this.#n}get labelField(){return this.#r.label}get enabledField(){return this.#r.enabled}get minimizedField(){return this.#r.minimized}device(){return this.#e.boxAdapters.adapterFor(this.#r.device.targetVertex.unwrap().box,Er)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#t.terminate()}#a(e){return{gate:this.#o.createParameter(e.gate,B.linearInteger(0,2),I.indices("",["Off","On","Loop"]),"Gate"),mute:this.#o.createParameter(e.mute,B.bool,I.bool,"Mute"),solo:this.#o.createParameter(e.solo,B.bool,I.bool,"Solo"),polyphone:this.#o.createParameter(e.polyphone,B.bool,I.bool,"Polyphone"),exclude:this.#o.createParameter(e.exclude,B.bool,I.bool,"Exclude"),pitch:this.#o.createParameter(e.pitch,B.linear(-1200,1200),I.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:this.#o.createParameter(e.sampleStart,B.unipolar(),I.percent(),"Start",0),sampleEnd:this.#o.createParameter(e.sampleEnd,B.unipolar(),I.percent(),"End",1),attack:this.#o.createParameter(e.attack,B.exponential(.001,5),I.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:this.#o.createParameter(e.release,B.exponential(.001,5),I.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}}};var Er=class{type="instrument";accepts="midi";#t;#e;#r;#i;constructor(e,t){this.#t=e,this.#e=t,this.#r=Me.create(t.samples,n=>e.boxAdapters.adapterFor(n,Gi),c.Sample),this.#i=new se(this.#t)}reset(){this.#r.adapters().forEach(e=>e.box.delete())}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get notesAddress(){return this.#e.address.append(1e3)}get labelField(){return this.#e.label}get iconField(){return this.#e.icon}get defaultTrackType(){return de.Notes}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get acceptsMidiEvents(){return!0}get samples(){return this.#r}get context(){return this.#t}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#i.terminate()}};var Wi=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{volume:this.#r.createParameter(e.volume,B.decibel(-72,0,12),I.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:this.#r.createParameter(e.panning,B.bipolar(),I.panning,"Panning",.5),stereo:this.#r.createParameter(e.stereo,B.bipolar(),I.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:this.#r.createParameter(e.invertL,B.bool,I.bool,"Invert Left"),invertR:this.#r.createParameter(e.invertR,B.bool,I.bool,"Invert Right"),swap:this.#r.createParameter(e.swap,B.bool,I.bool,"Swap")}}};var ti;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(ti||(ti={}));var Ji=class{type="midi-effect";accepts="midi";#t;#e;constructor(e,t){this.#t=e,this.#e=t,this.groove()}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}groove(){return this.#t.boxAdapters.adapterFor(this.#e.groove.targetVertex.unwrap("no groove").box,ti.checkType)}catchupAndSubscribeGroove(e){return this.#e.groove.catchupAndSubscribe(t=>e(this.#t.boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,ti.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Yi=class{type="audio-effect";accepts="audio";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get commentField(){return this.#e.comment}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Qi=class{type="midi-effect";accepts="midi";#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}get commentField(){return this.#e.comment}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};var Xi=class{type="instrument";accepts="midi";#t=new V;#e;#r;#i;namedParameter;#n;#o;#s;#a=Z.Empty;constructor(e,t){this.#e=e,this.#r=t,this.#i=new se(this.#e),this.namedParameter=this.#u(t),this.#n=new mi,this.#o=new mi,this.#s=new mi,this.#t.ownAll(this.#n.subscribe(this.#l),this.#r.file.catchupAndSubscribe(({targetVertex:n})=>this.#n.wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),this.#r.presetIndex.catchupAndSubscribe(n=>this.#o.match({none:()=>this.#s.clear(),some:i=>this.#s.wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return this.#n}get soundfont(){return this.#o}get preset(){return this.#s}get presetIndex(){return this.#r.presetIndex.getValue()}get box(){return this.#r}get uuid(){return this.#r.address.uuid}get address(){return this.#r.address}get labelField(){return this.#r.label}get iconField(){return this.#r.icon}get defaultTrackType(){return de.Notes}get enabledField(){return this.#r.enabled}get minimizedField(){return this.#r.minimized}get acceptsMidiEvents(){return!0}deviceHost(){return this.#e.boxAdapters.adapterFor(this.#r.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}parameterAt(e){return this.#i.parameterAt(e)}terminate(){this.#a.terminate(),this.#a=Z.Empty,this.#i.terminate()}#u(e){return{}}#l=e=>e.match({none:()=>{this.#s.clear(),this.#o.clear()},some:t=>t.soundfont.match({none:()=>{this.#s.clear(),this.#o.clear(),this.#a.terminate(),this.#a=t.subscribe(n=>{if(n.type==="loaded"){let i=t.soundfont.unwrap();this.#s.wrap(i.presets[this.presetIndex]??i.presets[0]),this.#o.wrap(i)}else n.type==="error"?(this.#s.clear(),this.#o.clear()):n.type==="idle"&&(this.#s.clear(),this.#o.clear())})},some:n=>{this.#o.wrap(n),this.#s.wrap(n.presets[this.presetIndex]??n.presets[0])}})})};var ga=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return this.#t.soundfontManager.getOrCreate(this.#e.address.uuid)}terminate(){}};var en=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{lookahead:this.#r.createParameter(e.lookahead,B.bool,I.bool,"Lookahead"),automakeup:this.#r.createParameter(e.automakeup,B.bool,I.bool,"Auto Makeup"),autoattack:this.#r.createParameter(e.autoattack,B.bool,I.bool,"Auto Attack"),autorelease:this.#r.createParameter(e.autorelease,B.bool,I.bool,"Auto Release"),inputgain:this.#r.createParameter(e.inputgain,B.linear(-30,30),I.decible,"Input Gain"),threshold:this.#r.createParameter(e.threshold,B.linear(-60,0),I.decible,"Threshold"),ratio:this.#r.createParameter(e.ratio,B.exponential(1,24),I.numeric({fractionDigits:1}),"Ratio"),knee:this.#r.createParameter(e.knee,B.linear(0,24),I.decible,"Knee"),attack:this.#r.createParameter(e.attack,B.linear(0,100),I.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:this.#r.createParameter(e.release,B.linear(5,1500),I.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:this.#r.createParameter(e.makeup,B.linear(-40,40),I.decible,"Makeup Gain"),mix:this.#r.createParameter(e.mix,B.unipolar(),I.percent(),"Dry/Wet")}}};var tn=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{crush:this.#r.createParameter(e.crush,B.unipolar(),I.percent(),"Crush"),bits:this.#r.createParameter(e.bits,B.linearInteger(1,16),I.numeric(),"Bits"),boost:this.#r.createParameter(e.boost,B.linear(0,24),I.decible,"Boost"),mix:this.#r.createParameter(e.mix,B.exponential(.001,1),I.percent(),"Mix")}}};var rn=class{type="audio-effect";accepts="audio";#t;#e;#r;namedParameter;constructor(e,t){this.#t=e,this.#e=t,this.#r=new se(this.#t),this.namedParameter=this.#i(t)}get box(){return this.#e}get uuid(){return this.#e.address.uuid}get address(){return this.#e.address}get indexField(){return this.#e.index}get labelField(){return this.#e.label}get enabledField(){return this.#e.enabled}get minimizedField(){return this.#e.minimized}get host(){return this.#e.host}deviceHost(){return this.#t.boxAdapters.adapterFor(this.#e.host.targetVertex.unwrap("no device-host").box,Y.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){this.#r.terminate()}#i(e){return{drive:this.#r.createParameter(e.drive,B.linear(0,30),I.decible,"Drive"),volume:this.#r.createParameter(e.volume,B.linear(-18,0),I.decible,"Volume")}}};var va=class{#t;#e;#r;#i;constructor(e){this.#t=e,this.#e=S.newSet(t=>t.uuid),this.#r=new Set,this.#i=this.#t.boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let n=this.#e.getOrNull(t.uuid);O(n)&&(this.#r.add(n.box),this.#e.removeByValue(n).terminate())}}})}terminate(){this.#e.values().forEach(e=>e.terminate()),this.#e.clear(),this.#i.terminate()}adapterFor(e,t){if(this.#r.has(e))return A(`Cannot resolve adapter for already deleted box: ${e}`);let n=this.#e.getOrNull(e.address.uuid);if(n===null){n=this.#n(e);let i=this.#e.add(n);N(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?n instanceof t?n:A(`${n} is not instance of ${t}`):t(n)?n:A(`${n} did not pass custom type guard`):A("Unknown checkType method")}#n(e){return q(e.accept({visitRootBox:t=>new Li(this.#t,t),visitArpeggioDeviceBox:t=>new $r(this.#t,t),visitPitchDeviceBox:t=>new qi(this.#t,t),visitStereoToolDeviceBox:t=>new Wi(this.#t,t),visitCrusherDeviceBox:t=>new tn(this.#t,t),visitFoldDeviceBox:t=>new rn(this.#t,t),visitDelayDeviceBox:t=>new Kt(this.#t,t),visitCompressorDeviceBox:t=>new en(this.#t,t),visitReverbDeviceBox:t=>new Di(this.#t,t),visitRevampDeviceBox:t=>new Ci(this.#t,t),visitUnknownAudioEffectDeviceBox:t=>new Yi(this.#t,t),visitPlayfieldDeviceBox:t=>new Er(this.#t,t),visitPlayfieldSampleBox:t=>new Gi(this.#t,t),visitModularDeviceBox:t=>new wr(this.#t,t),visitTapeDeviceBox:t=>new Ki(this.#t,t),visitNanoDeviceBox:t=>new Hi(this.#t,t),visitVaporisateurDeviceBox:t=>new Zi(this.#t,t),visitSoundfontDeviceBox:t=>new Xi(this.#t,t),visitModularBox:t=>new br(this.#t,t),visitModuleConnectionBox:t=>new yr(this.#t,t),visitModuleDelayBox:t=>new Ri(this.#t,t),visitModuleGainBox:t=>new zi(this.#t,t),visitModuleMultiplierBox:t=>new Mi(this.#t,t),visitModularAudioInputBox:t=>new Ti(this.#t,t),visitModularAudioOutputBox:t=>new Oi(this.#t,t),visitDeviceInterfaceKnobBox:t=>new Vi(this.#t,t),visitAudioUnitBox:t=>new Nt(this.#t,t),visitAudioBusBox:t=>new We(this.#t,t),visitAuxSendBox:t=>new Bi(this.#t,t),visitSoundfontFileBox:t=>new ga(this.#t,t),visitAudioFileBox:t=>new St(this.#t,t),visitAudioClipBox:t=>new gr(this.#t,t),visitAudioRegionBox:t=>new vr(this.#t,t),visitNoteEventBox:t=>new Qr(this.#t,t),visitNoteEventCollectionBox:t=>new ct(this.#t,t),visitNoteClipBox:t=>new Ii(this.#t,t),visitNoteRegionBox:t=>new xr(this.#t,t),visitValueEventBox:t=>new mr(this.#t,t),visitValueEventCollectionBox:t=>new lt(this.#t,t),visitValueClipBox:t=>new fr(this.#t,t),visitValueRegionBox:t=>new Lt(this.#t,t),visitTrackBox:t=>new ke(this.#t,t),visitTimelineBox:t=>new Pt(this.#t,t),visitMarkerBox:t=>new ei(this.#t,t),visitZeitgeistDeviceBox:t=>new Ji(this.#t,t),visitUnknownMidiEffectDeviceBox:t=>new Qi(this.#t,t),visitGrooveShuffleBox:t=>new ji(this.#t,t)}),`Could not find factory for ${e}`)}};var Ef;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,n=i=>{let o=t.get(i)??0,s=i;for(;t.has(s);)o++,s=`${i} ${o}`;return t.set(i,o),t.set(s,1),s};Object.keys(e).forEach(i=>{let o=e[i];o.fileName=n(r.sanitizeFileName(o.fileName))})}})(Ef||(Ef={}));var Sf=qe.createBuilder({position:qe.float,playbackTimestamp:qe.float,countInBeatsRemaining:qe.float,countInBeatsTotal:qe.float,isPlaying:qe.bool,isCountingIn:qe.bool,isRecording:qe.bool});var kt=class{#t=new V;#e;#r;#i;constructor(e,t){this.#e=e,this.#r=t,this.#i=new Ce(128),this.#t.own(this.#e.broadcastIntegers(this.#r,new Int32Array(this.#i.buffer),Ct))}noteOn(e){e>=0&&e<128&&this.#i.setBit(e,!0)}noteOff(e){e>=0&&e<128&&this.#i.setBit(e,!1)}reset(){}clear(){this.#i.clear()}terminate(){this.#t.terminate()}toString(){return`{${this.constructor.name}}`}};var Zt;(function(r){r[r.MTHD=1297377380]="MTHD",r[r.MTRK=1297379947]="MTRK"})(Zt||(Zt={}));var Te;(function(r){r[r.NOTE_ON=144]="NOTE_ON",r[r.NOTE_OFF=128]="NOTE_OFF",r[r.NOTE_AFTER_TOUCH=160]="NOTE_AFTER_TOUCH",r[r.CONTROLLER=176]="CONTROLLER",r[r.PROGRAM_CHANGE=192]="PROGRAM_CHANGE",r[r.CHANNEL_AFTER_TOUCH=208]="CHANNEL_AFTER_TOUCH",r[r.PITCH_BEND=224]="PITCH_BEND"})(Te||(Te={}));var xa=class r{ticks;type;param0;param1;static Comparator=(e,t)=>e.ticks-t.ticks;constructor(e,t,n,i){this.ticks=e,this.type=t,this.param0=n,this.param1=i}static decode(e,t,n){switch(t){case Te.NOTE_ON:case Te.NOTE_OFF:case Te.CONTROLLER:case Te.PITCH_BEND:case Te.NOTE_AFTER_TOUCH:return new r(n,t,e.readByte(),e.readByte());case Te.PROGRAM_CHANGE:case Te.CHANNEL_AFTER_TOUCH:return new r(n,t,e.readByte(),0)}{let i;do i=e.readByte()&255;while(i<128);e.skip(-1)}return null}accept(e){switch(this.type){case Te.NOTE_ON:{this.param1===0?w(e.noteOff,this.param0):w(e.noteOn,this.param0,this.param1/127);break}case Te.NOTE_OFF:{w(e.noteOff,this.param0);break}case Te.PITCH_BEND:{let t=this.param0&127,n=this.param1&127,i=t|n<<7;w(e.pitchBend,8192>=i?i/8192-1:(i-8191)/8192);break}case Te.CONTROLLER:{w(e.controller,this.param0,this.param1/127);break}default:break}}toString(){return`ControlEvent{ticks: ${this.ticks}, type: ${this.type}, param0: ${this.param0}, param1: ${this.param1}}`}};var Be;(function(r){r[r.SEQUENCE_NUMBER=0]="SEQUENCE_NUMBER",r[r.TEXT_EVENT=1]="TEXT_EVENT",r[r.COPYRIGHT_NOTICE=2]="COPYRIGHT_NOTICE",r[r.SEQUENCE_TRACK_NAME=3]="SEQUENCE_TRACK_NAME",r[r.INSTRUMENT_NAME=4]="INSTRUMENT_NAME",r[r.LYRICS=5]="LYRICS",r[r.MARKER=6]="MARKER",r[r.CUE_POINT=7]="CUE_POINT",r[r.CHANNEL_PREFIX=32]="CHANNEL_PREFIX",r[r.SET_TEMPO=81]="SET_TEMPO",r[r.SMPTE_OFFSET=84]="SMPTE_OFFSET",r[r.TIME_SIGNATURE=88]="TIME_SIGNATURE",r[r.KEY_SIGNATURE=89]="KEY_SIGNATURE",r[r.SEQUENCER_SPECIFIC=127]="SEQUENCER_SPECIFIC",r[r.PREFIX_PORT=33]="PREFIX_PORT",r[r.END_OF_TRACK=47]="END_OF_TRACK"})(Be||(Be={}));var ya=class r{ticks;type;value;constructor(e,t,n){this.ticks=e,this.type=t,this.value=n}static decode(e,t){let n=e.readByte()&255,i=e.readVarLen();switch(n){case Be.SET_TEMPO:return new r(t,n,e.readTempo());case Be.TIME_SIGNATURE:return new r(t,n,e.readSignature());case Be.END_OF_TRACK:return new r(t,n,null);case Be.TEXT_EVENT:case Be.COPYRIGHT_NOTICE:case Be.SEQUENCE_TRACK_NAME:case Be.INSTRUMENT_NAME:case Be.LYRICS:case Be.MARKER:case Be.CUE_POINT:case Be.SEQUENCE_NUMBER:case Be.CHANNEL_PREFIX:case Be.KEY_SIGNATURE:case Be.SEQUENCER_SPECIFIC:case Be.PREFIX_PORT:case Be.SMPTE_OFFSET:default:e.skip(i)}return null}toString(){return`MetaEvent{ticks: ${this.ticks}, type: ${this.type}, value: ${this.value}}`}};var Sr;(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"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>1<t.length?t[1]&255:0,r.readParam2=t=>2<t.length?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.asPitchBend=t=>{let n=r.readParam1(t)&127,i=r.readParam2(t)&127,o=n|i<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.isController=t=>r.readCommand(t)===e.Controller,r.asValue=t=>{let n=r.readParam2(t);return 64<n?.5+(n-63)/128:64>n?n/128:.5},r.noteOn=(t,n,i)=>{let o=new Uint8Array(3);return o[0]=t|e.NoteOn,o[1]=n|0,o[2]=i|0,o},r.noteOff=(t,n)=>{let i=new Uint8Array(3);return i[0]=t|e.NoteOff,i[1]=n,i},r.accept=(t,n)=>{if(!Tr(t))if(r.isNoteOn(t))w(n.noteOn,r.readPitch(t),r.readVelocity(t));else if(r.isNoteOff(t))w(n.noteOff,r.readPitch(t));else if(r.isPitchWheel(t)){let i=r.readParam1(t)&127,o=r.readParam2(t)&127,s=i|o<<7;w(n.pitchBend,8192>=s?s/8192-1:(s-8191)/8192)}else r.isController(t)&&w(n.controller,r.readParam1(t),r.readParam2(t)/127)},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)}`:"Unknown"})(Sr||(Sr={}));var ba=class{tracks;formatType;timeDivision;constructor(e,t,n){this.tracks=e,this.formatType=t,this.timeDivision=n}};var wa=class r{controlEvents;metaEvents;static decode(e){let t=new Lr,n=[],i=0,o=0,s=0;for(;;){let a=e.readVarLen(),u=e.readByte()&255;if(u<240){i+=a,u<128?e.skip(-1):(o=u&240,s=u&15);let l=xa.decode(e,o,i);O(l)&&t.add(s,l)}else if(u<248)e.skipSysEx(u);else{i+=a;let l=ya.decode(e,i);if(l!==null&&(n.push(l),l.type===Be.END_OF_TRACK))break}}return new r(t,n)}static createEmpty(){return new r(new Lr,[])}constructor(e,t){this.controlEvents=e,this.metaEvents=t}encode(){let e=Se.create(),t=n=>{if(n<=127)e.writeByte(n);else{let i=n,o=[];for(o.push(i&127),i>>=7;i;){let s=i&127|128;o.push(s),i>>=7}o.reverse().forEach(s=>e.writeByte(s))}};return this.controlEvents.forEach((n,i)=>{let o=0,s=-1;i.forEach(a=>{let u=a.ticks-o;if(t(u),a.type===Te.NOTE_ON){let l=144|n;l!==s&&e.writeByte(l),e.writeByte(a.param0),e.writeByte(a.param1)}else if(a.type===Te.NOTE_OFF){let l=144|n;l!==s&&e.writeByte(l),e.writeByte(a.param0),e.writeByte(a.param1)}else console.warn("Unknown ControlType");o=a.ticks})}),e.toArrayBuffer()}};var Aa=class{input;#t=!1;#e=!1;constructor(e){this.input=e}decode(){this.input.littleEndian=!1;let e=this.input.readInt();if(e===Zt.MTHD){if(this.input.readInt()!==6)throw new Error("2nd int in header must be 6")}else throw console.warn(`Unsupported midi format ${e} !== ${Zt.MTHD}`),new Error("Unsupported midi format");let t=this.input.readShort(),n=this.input.readShort(),i=this.input.readShort(),o=[];for(let s=0;s<n;s++){let a=this.input.readInt(),u=this.input.readInt(),l=this.input.position;a===Zt.MTRK&&(o[s]=wa.decode(this)),this.input.position=l+u}return 0<this.input.remaining()&&console.warn(`${this.input.remaining()} bytes remaining.`),new ba(o,t,i)}readVarLen(){let e=this.input.readByte()&255,t;if(0<(e&128)){e&=127;do t=this.input.readByte()&255,e=(e<<7)+(t&127);while(0<(t&128))}return e}readSignature(){let e=this.input.readByte()&255,t=this.input.readByte()&255,n=this.input.readByte()&255,i=this.input.readByte()&255;return this.#t,[e,1<<t]}readTempo(){let e=this.input.readByte()&255,t=this.input.readByte()&255,n=this.input.readByte()&255;return 6e7/(e<<16|t<<8|n)}skipSysEx(e){if(e===240){if(this.#e)throw new Error("System message already in progress");this.input.skip(this.readVarLen()-1),this.#e=!0}else e===247&&(this.#e?this.#e=!1:(this.input.skip(this.readVarLen()-1),this.#e=!0))}skip(e){this.input.skip(e)}readByte(){return this.input.readByte()}};var Nf;(function(r){r.decoder=t=>new Aa(new _e(t)),r.encoder=()=>new e;class e{static writeVarLen(n,i){let o=[];for(;i>127;)o.push(i&127|128),i>>=7;o.push(i&127);for(let s=o.length-1;s>=0;s--)n.writeByte(o[s])}#t=[];addTrack(n){return this.#t.push(n),this}encode(){let n=Se.create();return n.littleEndian=!1,n.writeInt(Zt.MTHD),n.writeInt(6),n.writeShort(0),n.writeShort(this.#t.length),n.writeShort(96),this.#t.forEach(i=>{n.writeInt(Zt.MTRK);let o=i.encode();n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o))}),n}}})(Nf||(Nf={}));var $a=Symbol.for("@openDAW/lib-midi");globalThis[$a]?console.debug(`%c${$a.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[$a]=!0,console.debug(`%c${$a.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Nr;(function(r){r.on=(e,t,n)=>({type:"note-on",uuid:e,pitch:t,velocity:n}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let n=e.data;if(Sr.isNoteOn(n)){let i=Sr.readPitch(n),o=Sr.readVelocity(n);return{type:"note-on",uuid:t,pitch:i,velocity:o}}else if(Sr.isNoteOff(n)){let i=Sr.readPitch(n);return{type:"note-off",uuid:t,pitch:i}}return A("Unknown MIDI event")}})(Nr||(Nr={}));var Pf;(function(r){r.start=(e,t,n,i=1)=>{let o=!0;return e(Nr.on(t,n,i)),{terminate:()=>{o&&(e(Nr.off(t,n)),o=!1)}}}})(Pf||(Pf={}));var Ea=class{#t;constructor(){this.#t=te.newSet(e=>e.field.address)}register(e){return this.#t.add(e),{terminate:()=>this.#t.removeByValue(e)}}get(e){return this.#t.get(e)}opt(e){return this.#t.opt(e)}};var Sa;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i},o)=>{let s=!0,a=new Int32Array(e,0,2),u=new Float32Array(e,8),l=new Float32Array(n*i),d=typeof document>"u",h=()=>{if(!s)return;let f=Atomics.load(a,1),v=Atomics.load(a,0);if(f===v){if(d)Atomics.wait(a,0,v);else{setTimeout(h,1);return}v=Atomics.load(a,0)}for(;f!==v;){let g=f*n*i;l.set(u.subarray(g,g+n*i));let y=[];for(let b=0;b<n;b++){let R=b*i,M=R+i;y.push(l.slice(R,M))}if(f=(f+1)%t,Atomics.store(a,1,f),!s)return;o(y)}h()};return h(),{stop:()=>s=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i})=>{let o=new Int32Array(e,0,2),s=new Float32Array(e,8);return Object.freeze({write:a=>{if(a.length!==n)return;for(let d of a)if(d.length!==i)return A("Each channel buffer must contain 'bufferSize' samples");let u=Atomics.load(o,0),l=u*n*i;a.forEach((d,h)=>s.set(d,l+h*i)),Atomics.store(o,0,(u+1)%t),Atomics.notify(o,0)}})}})(Sa||(Sa={}));var hc={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})??A("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var pc={isRegion:r=>hc.isRegionBox(r.box),isLoopableRegion:r=>hc.isLoopableRegionBox(r.box)};var _t;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(_t||(_t={}));var Na;(function(r){r.MAGIC_HEADER_OPEN=1330660686,r.FORMAT_VERSION=2,r.decode=e=>{let t=new _e(e);N(t.readInt()===r.MAGIC_HEADER_OPEN,"Corrupt header. Probably not an openDAW project file."),N(t.readInt()===r.FORMAT_VERSION,"Deprecated Format");let n=t.readInt(),i=new Int8Array(n);t.readBytes(i);let o=new ls(m.wrap(fs.create));return o.fromArrayBuffer(i.buffer),{boxGraph:o,mandatoryBoxes:r.findMandatoryBoxes(o)}},r.findMandatoryBoxes=e=>{let t=e.boxes().find(n=>n.accept({visitRootBox:()=>!0}));if(O(t)){let n=st(t.outputDevice.pointerHub.incoming().at(0)?.box,xt),i=st(n.input.pointerHub.incoming().at(0)?.box,hr),o=st(t.timeline.targetVertex.unwrap("TimelineBox not found").box,Ai),s=t.users.pointerHub.incoming().map(({box:a})=>st(a,wi));return{rootBox:t,primaryAudioBus:i,primaryAudioOutputUnit:n,timelineBox:o,userInterfaceBoxes:s}}return A("Could not find mandatory boxes")}})(Na||(Na={}));var De={};Mr(De,{$brand:()=>Pa,$input:()=>Ih,$output:()=>Fh,NEVER:()=>mc,TimePrecision:()=>Ch,ZodAny:()=>iv,ZodArray:()=>av,ZodBase64:()=>Yp,ZodBase64URL:()=>Qp,ZodBigInt:()=>Fo,ZodBigIntFormat:()=>tm,ZodBoolean:()=>_o,ZodCIDRv4:()=>Wp,ZodCIDRv6:()=>Jp,ZodCUID:()=>jp,ZodCUID2:()=>Lp,ZodCatch:()=>Nv,ZodCodec:()=>dm,ZodCustom:()=>Ru,ZodCustomStringFormat:()=>Po,ZodDate:()=>Bu,ZodDefault:()=>bv,ZodDiscriminatedUnion:()=>uv,ZodE164:()=>Xp,ZodEmail:()=>Tp,ZodEmoji:()=>Up,ZodEnum:()=>So,ZodError:()=>Vb,ZodFile:()=>vv,ZodFirstPartyTypeKind:()=>hm,ZodFunction:()=>Rv,ZodGUID:()=>Pu,ZodIPv4:()=>Hp,ZodIPv6:()=>Gp,ZodISODate:()=>$u,ZodISODateTime:()=>Au,ZodISODuration:()=>Su,ZodISOTime:()=>Eu,ZodIntersection:()=>lv,ZodIssueCode:()=>Q0,ZodJWT:()=>em,ZodKSUID:()=>qp,ZodLazy:()=>Bv,ZodLiteral:()=>gv,ZodMap:()=>mv,ZodNaN:()=>kv,ZodNanoID:()=>Vp,ZodNever:()=>ov,ZodNonOptional:()=>lm,ZodNull:()=>tv,ZodNullable:()=>yv,ZodNumber:()=>ko,ZodNumberFormat:()=>xn,ZodObject:()=>Cu,ZodOptional:()=>um,ZodPipe:()=>cm,ZodPrefault:()=>Av,ZodPromise:()=>Cv,ZodReadonly:()=>_v,ZodRealError:()=>et,ZodRecord:()=>om,ZodSet:()=>fv,ZodString:()=>No,ZodStringFormat:()=>be,ZodSuccess:()=>Sv,ZodSymbol:()=>Xg,ZodTemplateLiteral:()=>Iv,ZodTransform:()=>xv,ZodTuple:()=>dv,ZodType:()=>ie,ZodULID:()=>Kp,ZodURL:()=>Iu,ZodUUID:()=>Jt,ZodUndefined:()=>ev,ZodUnion:()=>im,ZodUnknown:()=>nv,ZodVoid:()=>sv,ZodXID:()=>Zp,_ZodString:()=>Mp,_default:()=>wv,_function:()=>Z0,any:()=>S0,array:()=>Du,base64:()=>u0,base64url:()=>l0,bigint:()=>b0,boolean:()=>Qg,catch:()=>Pv,check:()=>q0,cidrv4:()=>s0,cidrv6:()=>a0,clone:()=>Je,codec:()=>j0,coerce:()=>pm,config:()=>Fe,core:()=>Wt,cuid:()=>Xb,cuid2:()=>e0,custom:()=>H0,date:()=>P0,decode:()=>_p,decodeAsync:()=>Ip,discriminatedUnion:()=>B0,e164:()=>c0,email:()=>Lb,emoji:()=>Yb,encode:()=>kp,encodeAsync:()=>Fp,endsWith:()=>xo,enum:()=>sm,file:()=>M0,flattenError:()=>Xn,float32:()=>g0,float64:()=>v0,formatError:()=>eo,function:()=>Z0,getErrorMap:()=>ew,globalRegistry:()=>It,gt:()=>Ht,gte:()=>Xe,guid:()=>Kb,hash:()=>f0,hex:()=>m0,hostname:()=>p0,httpUrl:()=>Jb,includes:()=>go,instanceof:()=>G0,int:()=>zp,int32:()=>x0,int64:()=>w0,intersection:()=>cv,ipv4:()=>n0,ipv6:()=>o0,iso:()=>Nu,json:()=>J0,jwt:()=>d0,keyof:()=>k0,ksuid:()=>i0,lazy:()=>Dv,length:()=>fn,literal:()=>z0,locales:()=>uo,looseObject:()=>I0,lowercase:()=>mo,lt:()=>qt,lte:()=>pt,map:()=>C0,maxLength:()=>mn,maxSize:()=>pn,mime:()=>yo,minLength:()=>Dr,minSize:()=>si,multipleOf:()=>oi,nan:()=>V0,nanoid:()=>Qb,nativeEnum:()=>O0,negative:()=>lp,never:()=>rm,nonnegative:()=>dp,nonoptional:()=>Ev,nonpositive:()=>cp,normalize:()=>bo,null:()=>rv,nullable:()=>_u,nullish:()=>T0,number:()=>Yg,object:()=>_0,optional:()=>ku,overwrite:()=>Gt,parse:()=>Ep,parseAsync:()=>Sp,partialRecord:()=>D0,pipe:()=>Fu,positive:()=>up,prefault:()=>$v,preprocess:()=>Y0,prettifyError:()=>Sc,promise:()=>K0,property:()=>hp,readonly:()=>Fv,record:()=>pv,refine:()=>Ov,regex:()=>po,regexes:()=>ht,registry:()=>tu,safeDecode:()=>Dp,safeDecodeAsync:()=>Rp,safeEncode:()=>Bp,safeEncodeAsync:()=>Cp,safeParse:()=>Np,safeParseAsync:()=>Pp,set:()=>R0,setErrorMap:()=>X0,size:()=>ho,startsWith:()=>vo,strictObject:()=>F0,string:()=>Op,stringFormat:()=>h0,stringbool:()=>W0,success:()=>U0,superRefine:()=>zv,symbol:()=>$0,templateLiteral:()=>L0,toJSONSchema:()=>yp,toLowerCase:()=>Ao,toUpperCase:()=>$o,transform:()=>am,treeifyError:()=>Ec,trim:()=>wo,tuple:()=>hv,uint32:()=>y0,uint64:()=>A0,ulid:()=>t0,undefined:()=>E0,union:()=>nm,unknown:()=>vn,uppercase:()=>fo,url:()=>Wb,util:()=>U,uuid:()=>Zb,uuidv4:()=>qb,uuidv6:()=>Hb,uuidv7:()=>Gb,void:()=>N0,xid:()=>r0});var Wt={};Mr(Wt,{$ZodAny:()=>Xd,$ZodArray:()=>nh,$ZodAsyncError:()=>yt,$ZodBase64:()=>Ld,$ZodBase64URL:()=>Kd,$ZodBigInt:()=>Wa,$ZodBigIntFormat:()=>Wd,$ZodBoolean:()=>no,$ZodCIDRv4:()=>Ud,$ZodCIDRv6:()=>Vd,$ZodCUID:()=>_d,$ZodCUID2:()=>Fd,$ZodCatch:()=>wh,$ZodCheck:()=>Ae,$ZodCheckBigIntFormat:()=>od,$ZodCheckEndsWith:()=>vd,$ZodCheckGreaterThan:()=>ja,$ZodCheckIncludes:()=>fd,$ZodCheckLengthEquals:()=>dd,$ZodCheckLessThan:()=>Va,$ZodCheckLowerCase:()=>pd,$ZodCheckMaxLength:()=>ld,$ZodCheckMaxSize:()=>sd,$ZodCheckMimeType:()=>yd,$ZodCheckMinLength:()=>cd,$ZodCheckMinSize:()=>ad,$ZodCheckMultipleOf:()=>id,$ZodCheckNumberFormat:()=>nd,$ZodCheckOverwrite:()=>bd,$ZodCheckProperty:()=>xd,$ZodCheckRegex:()=>hd,$ZodCheckSizeEquals:()=>ud,$ZodCheckStartsWith:()=>gd,$ZodCheckStringFormat:()=>dn,$ZodCheckUpperCase:()=>md,$ZodCodec:()=>oo,$ZodCustom:()=>_h,$ZodCustomStringFormat:()=>Hd,$ZodDate:()=>ih,$ZodDefault:()=>vh,$ZodDiscriminatedUnion:()=>sh,$ZodE164:()=>Zd,$ZodEmail:()=>Sd,$ZodEmoji:()=>Pd,$ZodEncodeError:()=>Pr,$ZodEnum:()=>dh,$ZodError:()=>Qn,$ZodFile:()=>ph,$ZodFunction:()=>Nh,$ZodGUID:()=>$d,$ZodIPv4:()=>Md,$ZodIPv6:()=>Td,$ZodISODate:()=>Rd,$ZodISODateTime:()=>Cd,$ZodISODuration:()=>zd,$ZodISOTime:()=>Od,$ZodIntersection:()=>ah,$ZodJWT:()=>qd,$ZodKSUID:()=>Dd,$ZodLazy:()=>kh,$ZodLiteral:()=>hh,$ZodMap:()=>lh,$ZodNaN:()=>Ah,$ZodNanoID:()=>kd,$ZodNever:()=>th,$ZodNonOptional:()=>yh,$ZodNull:()=>Qd,$ZodNullable:()=>gh,$ZodNumber:()=>Ga,$ZodNumberFormat:()=>Gd,$ZodObject:()=>Xf,$ZodObjectJIT:()=>oh,$ZodOptional:()=>fh,$ZodPipe:()=>$h,$ZodPrefault:()=>xh,$ZodPromise:()=>Ph,$ZodReadonly:()=>Eh,$ZodRealError:()=>Qe,$ZodRecord:()=>uh,$ZodRegistry:()=>hn,$ZodSet:()=>ch,$ZodString:()=>ni,$ZodStringFormat:()=>ve,$ZodSuccess:()=>bh,$ZodSymbol:()=>Jd,$ZodTemplateLiteral:()=>Sh,$ZodTransform:()=>mh,$ZodTuple:()=>Ya,$ZodType:()=>Q,$ZodULID:()=>Id,$ZodURL:()=>Nd,$ZodUUID:()=>Ed,$ZodUndefined:()=>Yd,$ZodUnion:()=>Ja,$ZodUnknown:()=>eh,$ZodVoid:()=>rh,$ZodXID:()=>Bd,$brand:()=>Pa,$constructor:()=>x,$input:()=>Ih,$output:()=>Fh,Doc:()=>io,JSONSchema:()=>Gg,JSONSchemaGenerator:()=>Eo,NEVER:()=>mc,TimePrecision:()=>Ch,_any:()=>tp,_array:()=>pp,_base64:()=>xu,_base64url:()=>yu,_bigint:()=>Gh,_boolean:()=>qh,_catch:()=>Cb,_check:()=>Hg,_cidrv4:()=>gu,_cidrv6:()=>vu,_coercedBigint:()=>Wh,_coercedBoolean:()=>Hh,_coercedDate:()=>sp,_coercedNumber:()=>Uh,_coercedString:()=>Dh,_cuid:()=>lu,_cuid2:()=>cu,_custom:()=>fp,_date:()=>op,_decode:()=>Da,_decodeAsync:()=>Ra,_default:()=>Ib,_discriminatedUnion:()=>yb,_e164:()=>bu,_email:()=>ru,_emoji:()=>au,_encode:()=>Ba,_encodeAsync:()=>Ca,_endsWith:()=>xo,_enum:()=>Sb,_file:()=>mp,_float32:()=>jh,_float64:()=>Lh,_gt:()=>Ht,_gte:()=>Xe,_guid:()=>lo,_includes:()=>go,_int:()=>Vh,_int32:()=>Kh,_int64:()=>Jh,_intersection:()=>bb,_ipv4:()=>mu,_ipv6:()=>fu,_isoDate:()=>Oh,_isoDateTime:()=>Rh,_isoDuration:()=>Mh,_isoTime:()=>zh,_jwt:()=>wu,_ksuid:()=>pu,_lazy:()=>Mb,_length:()=>fn,_literal:()=>Pb,_lowercase:()=>mo,_lt:()=>qt,_lte:()=>pt,_map:()=>$b,_max:()=>pt,_maxLength:()=>mn,_maxSize:()=>pn,_mime:()=>yo,_min:()=>Xe,_minLength:()=>Dr,_minSize:()=>si,_multipleOf:()=>oi,_nan:()=>ap,_nanoid:()=>uu,_nativeEnum:()=>Nb,_negative:()=>lp,_never:()=>ip,_nonnegative:()=>dp,_nonoptional:()=>Bb,_nonpositive:()=>cp,_normalize:()=>bo,_null:()=>ep,_nullable:()=>Fb,_number:()=>Th,_optional:()=>_b,_overwrite:()=>Gt,_parse:()=>an,_parseAsync:()=>un,_pipe:()=>Rb,_positive:()=>up,_promise:()=>Tb,_property:()=>hp,_readonly:()=>Ob,_record:()=>Ab,_refine:()=>gp,_regex:()=>po,_safeDecode:()=>za,_safeDecodeAsync:()=>Ta,_safeEncode:()=>Oa,_safeEncodeAsync:()=>Ma,_safeParse:()=>ln,_safeParseAsync:()=>cn,_set:()=>Eb,_size:()=>ho,_startsWith:()=>vo,_string:()=>Bh,_stringFormat:()=>gn,_stringbool:()=>xp,_success:()=>Db,_superRefine:()=>vp,_symbol:()=>Qh,_templateLiteral:()=>zb,_toLowerCase:()=>Ao,_toUpperCase:()=>$o,_transform:()=>kb,_trim:()=>wo,_tuple:()=>wb,_uint32:()=>Zh,_uint64:()=>Yh,_ulid:()=>du,_undefined:()=>Xh,_union:()=>xb,_unknown:()=>rp,_uppercase:()=>fo,_url:()=>co,_uuid:()=>iu,_uuidv4:()=>nu,_uuidv6:()=>ou,_uuidv7:()=>su,_void:()=>np,_xid:()=>hu,clone:()=>Je,config:()=>Fe,decode:()=>Ux,decodeAsync:()=>jx,encode:()=>Tx,encodeAsync:()=>Vx,flattenError:()=>Xn,formatError:()=>eo,globalConfig:()=>Zn,globalRegistry:()=>It,isValidBase64:()=>jd,isValidBase64URL:()=>Wf,isValidJWT:()=>Jf,locales:()=>uo,parse:()=>Fa,parseAsync:()=>Ia,prettifyError:()=>Sc,regexes:()=>ht,registry:()=>tu,safeDecode:()=>Kx,safeDecodeAsync:()=>qx,safeEncode:()=>Lx,safeEncodeAsync:()=>Zx,safeParse:()=>Nc,safeParseAsync:()=>Pc,toDotPath:()=>Bf,toJSONSchema:()=>yp,treeifyError:()=>Ec,util:()=>U,version:()=>wd});var mc=Object.freeze({status:"aborted"});function x(r,e,t){function n(a,u){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.traits=new Set),a._zod.traits.add(r),e(a,u);for(let d in s.prototype)d in a||Object.defineProperty(a,d,{value:s.prototype[d].bind(a)});a._zod.constr=s,a._zod.def=u}let i=t?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:r});function s(a){var u;let l=t?.Parent?new o:this;n(l,a),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(s,"init",{value:n}),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 Pa=Symbol("zod_brand"),yt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Zn={};function Fe(r){return r&&Object.assign(Zn,r),Zn}var U={};Mr(U,{BIGINT_FORMAT_RANGES:()=>$c,Class:()=>gc,NUMBER_FORMAT_RANGES:()=>Ac,aborted:()=>Br,allowsEval:()=>xc,assert:()=>vx,assertEqual:()=>px,assertIs:()=>fx,assertNever:()=>gx,assertNotEqual:()=>mx,assignProp:()=>_r,base64ToUint8Array:()=>_f,base64urlToUint8Array:()=>Cx,cached:()=>on,captureStackTrace:()=>_a,cleanEnum:()=>Dx,cleanRegex:()=>Gn,clone:()=>Je,cloneDef:()=>yx,createTransparentProxy:()=>Sx,defineLazy:()=>ue,esc:()=>ka,escapeRegex:()=>Ft,extend:()=>kx,finalizeIssue:()=>nt,floatSafeRemainder:()=>vc,getElementAtPath:()=>bx,getEnumValues:()=>Hn,getLengthableOrigin:()=>Yn,getParsedType:()=>Ex,getSizableOrigin:()=>Jn,hexToUint8Array:()=>Ox,isObject:()=>ri,isPlainObject:()=>Ir,issue:()=>sn,joinValues:()=>E,jsonStringifyReplacer:()=>nn,merge:()=>Fx,mergeDefs:()=>Fr,normalizeParams:()=>T,nullish:()=>kr,numKeys:()=>$x,objectClone:()=>xx,omit:()=>Px,optionalKeys:()=>wc,partial:()=>Ix,pick:()=>Nx,prefixIssues:()=>it,primitiveTypes:()=>bc,promiseAllObject:()=>wx,propertyKeyTypes:()=>Wn,randomString:()=>Ax,required:()=>Bx,safeExtend:()=>_x,shallowClone:()=>yc,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>Ff,uint8ArrayToBase64url:()=>Rx,uint8ArrayToHex:()=>zx,unwrapMessage:()=>qn});function px(r){return r}function mx(r){return r}function fx(r){}function gx(r){throw new Error}function vx(r){}function Hn(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function E(r,e="|"){return r.map(t=>z(t)).join(e)}function nn(r,e){return typeof e=="bigint"?e.toString():e}function on(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function kr(r){return r==null}function Gn(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function vc(r,e){let t=(r.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let u=n.match(/\d?e-(\d?)/);u?.[1]&&(i=Number.parseInt(u[1]))}let o=t>i?t:i,s=Number.parseInt(r.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var kf=Symbol("evaluating");function ue(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==kf)return n===void 0&&(n=kf,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function xx(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function _r(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Fr(...r){let e={};for(let t of r){let n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function yx(r){return Fr(r._zod.def)}function bx(r,e){return e?e.reduce((t,n)=>t?.[n],r):r}function wx(r){let e=Object.keys(r),t=e.map(n=>r[n]);return Promise.all(t).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function Ax(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let n=0;n<r;n++)t+=e[Math.floor(Math.random()*e.length)];return t}function ka(r){return JSON.stringify(r)}var _a="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function ri(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var xc=on(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function Ir(r){if(ri(r)===!1)return!1;let e=r.constructor;if(e===void 0)return!0;let t=e.prototype;return!(ri(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function yc(r){return Ir(r)?{...r}:Array.isArray(r)?[...r]:r}function $x(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var Ex=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}`)}},Wn=new Set(["string","number","symbol"]),bc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}function T(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 Sx(r){let e;return new Proxy({},{get(t,n,i){return e??(e=r()),Reflect.get(e,n,i)},set(t,n,i,o){return e??(e=r()),Reflect.set(e,n,i,o)},has(t,n){return e??(e=r()),Reflect.has(e,n)},deleteProperty(t,n){return e??(e=r()),Reflect.deleteProperty(e,n)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,n){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(t,n,i){return e??(e=r()),Reflect.defineProperty(e,n,i)}})}function z(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function wc(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Ac={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]},$c={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Nx(r,e){let t=r._zod.def,n=Fr(r._zod.def,{get shape(){let i={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(i[o]=t.shape[o])}return _r(this,"shape",i),i},checks:[]});return Je(r,n)}function Px(r,e){let t=r._zod.def,n=Fr(r._zod.def,{get shape(){let i={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete i[o]}return _r(this,"shape",i),i},checks:[]});return Je(r,n)}function kx(r,e){if(!Ir(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=Fr(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return _r(this,"shape",o),o},checks:[]});return Je(r,i)}function _x(r,e){if(!Ir(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let n={...r._zod.def.shape,...e};return _r(this,"shape",n),n},checks:r._zod.def.checks};return Je(r,t)}function Fx(r,e){let t=Fr(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e._zod.def.shape};return _r(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Je(r,t)}function Ix(r,e,t){let n=Fr(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let s in t){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r?new r({type:"optional",innerType:i[s]}):i[s])}else for(let s in i)o[s]=r?new r({type:"optional",innerType:i[s]}):i[s];return _r(this,"shape",o),o},checks:[]});return Je(e,n)}function Bx(r,e,t){let n=Fr(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(t)for(let s in t){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=new r({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new r({type:"nonoptional",innerType:i[s]});return _r(this,"shape",o),o},checks:[]});return Je(e,n)}function Br(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 it(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}function qn(r){return typeof r=="string"?r:r?.message}function nt(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=qn(r.inst?._zod.def?.error?.(r))??qn(e?.error?.(r))??qn(t.customError?.(r))??qn(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Jn(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Yn(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function sn(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}function Dx(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function _f(r){let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Ff(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function Cx(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return _f(e+t)}function Rx(r){return Ff(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ox(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=Number.parseInt(e.slice(n,n+2),16);return t}function zx(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var gc=class{constructor(...e){}};var If=(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,nn,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Qn=x("$ZodError",If),Qe=x("$ZodError",If,{Parent:Error});function Xn(r,e=t=>t.message){let t={},n=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}function eo(r,e=t=>t.message){let t={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let s=t,a=0;for(;a<o.path.length;){let u=o.path[a];a===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(e(o))):s[u]=s[u]||{_errors:[]},s=s[u],a++}}};return n(r),t}function Ec(r,e=t=>t.message){let t={errors:[]},n=(i,o=[])=>{var s,a;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>n({issues:l},u.path));else if(u.code==="invalid_key")n({issues:u.issues},u.path);else if(u.code==="invalid_element")n({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){t.errors.push(e(u));continue}let d=t,h=0;for(;h<l.length;){let f=l[h],v=h===l.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]),v&&d.errors.push(e(u)),h++}}};return n(r),t}function Bf(r){let e=[],t=r.map(n=>typeof n=="object"?n.key:n);for(let n of t)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function Sc(r){let e=[],t=[...r.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of t)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Bf(n.path)}`);return e.join(`
4
+ `)}var an=r=>(e,t,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new yt;if(s.issues.length){let a=new(i?.Err??r)(s.issues.map(u=>nt(u,o,Fe())));throw _a(a,i?.callee),a}return s.value},Fa=an(Qe),un=r=>async(e,t,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??r)(s.issues.map(u=>nt(u,o,Fe())));throw _a(a,i?.callee),a}return s.value},Ia=un(Qe),ln=r=>(e,t,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new yt;return o.issues.length?{success:!1,error:new(r??Qn)(o.issues.map(s=>nt(s,i,Fe())))}:{success:!0,data:o.value}},Nc=ln(Qe),cn=r=>async(e,t,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(s=>nt(s,i,Fe())))}:{success:!0,data:o.value}},Pc=cn(Qe),Ba=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return an(r)(e,t,i)},Tx=Ba(Qe),Da=r=>(e,t,n)=>an(r)(e,t,n),Ux=Da(Qe),Ca=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return un(r)(e,t,i)},Vx=Ca(Qe),Ra=r=>async(e,t,n)=>un(r)(e,t,n),jx=Ra(Qe),Oa=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ln(r)(e,t,i)},Lx=Oa(Qe),za=r=>(e,t,n)=>ln(r)(e,t,n),Kx=za(Qe),Ma=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return cn(r)(e,t,i)},Zx=Ma(Qe),Ta=r=>async(e,t,n)=>cn(r)(e,t,n),qx=Ta(Qe);var ht={};Mr(ht,{base64:()=>jc,base64url:()=>Ua,bigint:()=>Wc,boolean:()=>Qc,browserEmail:()=>ey,cidrv4:()=>Uc,cidrv6:()=>Vc,cuid:()=>kc,cuid2:()=>_c,date:()=>Zc,datetime:()=>Hc,domain:()=>ry,duration:()=>Cc,e164:()=>Kc,email:()=>Oc,emoji:()=>zc,extendedDuration:()=>Hx,guid:()=>Rc,hex:()=>iy,hostname:()=>Lc,html5Email:()=>Yx,idnEmail:()=>Xx,integer:()=>Jc,ipv4:()=>Mc,ipv6:()=>Tc,ksuid:()=>Bc,lowercase:()=>td,md5_base64:()=>oy,md5_base64url:()=>sy,md5_hex:()=>ny,nanoid:()=>Dc,null:()=>Xc,number:()=>Yc,rfc5322Email:()=>Qx,sha1_base64:()=>uy,sha1_base64url:()=>ly,sha1_hex:()=>ay,sha256_base64:()=>dy,sha256_base64url:()=>hy,sha256_hex:()=>cy,sha384_base64:()=>my,sha384_base64url:()=>fy,sha384_hex:()=>py,sha512_base64:()=>vy,sha512_base64url:()=>xy,sha512_hex:()=>gy,string:()=>Gc,time:()=>qc,ulid:()=>Fc,undefined:()=>ed,unicodeEmail:()=>Df,uppercase:()=>rd,uuid:()=>ii,uuid4:()=>Gx,uuid6:()=>Wx,uuid7:()=>Jx,xid:()=>Ic});var kc=/^[cC][^\s-]{8,}$/,_c=/^[0-9a-z]+$/,Fc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ic=/^[0-9a-vA-V]{20}$/,Bc=/^[A-Za-z0-9]{27}$/,Dc=/^[a-zA-Z0-9_-]{21}$/,Cc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hx=/^[-+]?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)?)??$/,Rc=/^([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})$/,ii=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)$/,Gx=ii(4),Wx=ii(6),Jx=ii(7),Oc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Yx=/^[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])?)*$/,Qx=/^(([^<>()\[\]\\.,;:\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,}))$/,Df=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Xx=Df,ey=/^[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])?)*$/,ty="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function zc(){return new RegExp(ty,"u")}var Mc=/^(?:(?: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])$/,Tc=/^(([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}|:))$/,Uc=/^((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])$/,Vc=/^(([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])$/,jc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ua=/^[A-Za-z0-9_-]*$/,Lc=/^(?=.{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])?)*\.?$/,ry=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Kc=/^\+(?:[0-9]){6,14}[0-9]$/,Cf="(?:(?:\\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])))",Zc=new RegExp(`^${Cf}$`);function Rf(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 qc(r){return new RegExp(`^${Rf(r)}$`)}function Hc(r){let e=Rf({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${t.join("|")})`;return new RegExp(`^${Cf}T(?:${n})$`)}var Gc=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Wc=/^-?\d+n?$/,Jc=/^-?\d+$/,Yc=/^-?\d+(?:\.\d+)?/,Qc=/^(?:true|false)$/i,Xc=/^null$/i;var ed=/^undefined$/i;var td=/^[^A-Z]*$/,rd=/^[^a-z]*$/,iy=/^[0-9a-fA-F]*$/;function to(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function ro(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var ny=/^[0-9a-fA-F]{32}$/,oy=to(22,"=="),sy=ro(22),ay=/^[0-9a-fA-F]{40}$/,uy=to(27,"="),ly=ro(27),cy=/^[0-9a-fA-F]{64}$/,dy=to(43,"="),hy=ro(43),py=/^[0-9a-fA-F]{96}$/,my=to(64,""),fy=ro(64),gy=/^[0-9a-fA-F]{128}$/,vy=to(86,"=="),xy=ro(86);var Ae=x("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),zf={number:"number",bigint:"bigint",object:"date"},Va=x("$ZodCheckLessThan",(r,e)=>{Ae.init(r,e);let t=zf[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),ja=x("$ZodCheckGreaterThan",(r,e)=>{Ae.init(r,e);let t=zf[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),id=x("$ZodCheckMultipleOf",(r,e)=>{Ae.init(r,e),r._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):vc(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})}}),nd=x("$ZodCheckNumberFormat",(r,e)=>{Ae.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),n=t?"int":"number",[i,o]=Ac[e.format];r._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,t&&(a.pattern=Jc)}),r._zod.check=s=>{let a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:n,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:n,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:n,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>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:r})}}),od=x("$ZodCheckBigIntFormat",(r,e)=>{Ae.init(r,e);let[t,n]=$c[e.format];r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=t,o.maximum=n}),r._zod.check=i=>{let o=i.value;o<t&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inst:r})}}),sd=x("$ZodCheckMaxSize",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:Jn(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),ad=x("$ZodCheckMinSize",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:Jn(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),ud=x("$ZodCheckSizeEquals",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let s=o>e.size;n.issues.push({origin:Jn(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),ld=x("$ZodCheckMaxLength",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let s=Yn(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),cd=x("$ZodCheckMinLength",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=Yn(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),dd=x("$ZodCheckLengthEquals",(r,e)=>{var t;Ae.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!kr(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let s=Yn(i),a=o>e.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),dn=x("$ZodCheckStringFormat",(r,e)=>{var t,n;Ae.init(r,e),r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(n=r._zod).check??(n.check=()=>{})}),hd=x("$ZodCheckRegex",(r,e)=>{dn.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})}}),pd=x("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=td),dn.init(r,e)}),md=x("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=rd),dn.init(r,e)}),fd=x("$ZodCheckIncludes",(r,e)=>{Ae.init(r,e);let t=Ft(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,r._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),r._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:r,continue:!e.abort})}}),gd=x("$ZodCheckStartsWith",(r,e)=>{Ae.init(r,e);let t=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:r,continue:!e.abort})}}),vd=x("$ZodCheckEndsWith",(r,e)=>{Ae.init(r,e);let t=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:r,continue:!e.abort})}});function Of(r,e,t){r.issues.length&&e.issues.push(...it(t,r.issues))}var xd=x("$ZodCheckProperty",(r,e)=>{Ae.init(r,e),r._zod.check=t=>{let n=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>Of(i,t,e.property));Of(n,t,e.property)}}),yd=x("$ZodCheckMimeType",(r,e)=>{Ae.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),r._zod.check=n=>{t.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:r,continue:!e.abort})}}),bd=x("$ZodCheckOverwrite",(r,e)=>{Ae.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var io=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
5
5
  `).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),o=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,i.join(`
6
- `))}};var Jc={major:4,minor:1,patch:12};var Y=x("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Jc;let n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(let i of n)for(let o of i._zod.onattach)o(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(s,a,u)=>{let l=Fr(s),d;for(let h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(l)continue;let f=s.issues.length,v=h._zod.check(s);if(v instanceof Promise&&u?.async===!1)throw new yt;if(d||v instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await v,s.issues.length!==f&&(l||(l=Fr(s,f)))});else{if(s.issues.length===f)continue;l||(l=Fr(s,f))}}return d?d.then(()=>s):s},o=(s,a,u)=>{if(Fr(s))return s.aborted=!0,s;let l=i(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new yt;return l.then(d=>r._zod.parse(d,u))}return r._zod.parse(l,u)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){let l=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,s,a)):o(l,s,a)}let u=r._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new yt;return u.then(l=>i(l,n,a))}return i(u,n,a)}}r["~standard"]={validate:i=>{try{let o=tc(r,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return rc(r,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),oi=x("$ZodString",(r,e)=>{Y.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??$c(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),ge=x("$ZodStringFormat",(r,e)=>{an.init(r,e),oi.init(r,e)}),Xc=x("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=cc),ge.init(r,e)}),Qc=x("$ZodUUID",(r,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ni(n))}else e.pattern??(e.pattern=ni());ge.init(r,e)}),ed=x("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=dc),ge.init(r,e)}),td=x("$ZodURL",(r,e)=>{ge.init(r,e),r._zod.check=t=>{try{let n=t.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:xc.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=i.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),rd=x("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=hc()),ge.init(r,e)}),id=x("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=uc),ge.init(r,e)}),nd=x("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=ic),ge.init(r,e)}),od=x("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=nc),ge.init(r,e)}),sd=x("$ZodULID",(r,e)=>{e.pattern??(e.pattern=oc),ge.init(r,e)}),ad=x("$ZodXID",(r,e)=>{e.pattern??(e.pattern=sc),ge.init(r,e)}),ud=x("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=ac),ge.init(r,e)}),ld=x("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=Ac(e)),ge.init(r,e)}),cd=x("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=bc),ge.init(r,e)}),dd=x("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=wc(e)),ge.init(r,e)}),hd=x("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=lc),ge.init(r,e)}),pd=x("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=pc),ge.init(r,e),r._zod.onattach.push(t=>{let n=t._zod.bag;n.format="ipv4"})}),md=x("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=mc),ge.init(r,e),r._zod.onattach.push(t=>{let n=t._zod.bag;n.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})}}}),fd=x("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=fc),ge.init(r,e)}),gd=x("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=gc),ge.init(r,e),r._zod.check=t=>{let n=t.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)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 vd(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var xd=x("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=vc),ge.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64"}),r._zod.check=t=>{vd(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function wf(r){if(!Pa.test(r))return!1;let e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return vd(t)}var yd=x("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Pa),ge.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64url"}),r._zod.check=t=>{wf(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),bd=x("$ZodE164",(r,e)=>{e.pattern??(e.pattern=yc),ge.init(r,e)});function Af(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[n]=t;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var wd=x("$ZodJWT",(r,e)=>{ge.init(r,e),r._zod.check=t=>{Af(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),Ad=x("$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})}}),Da=x("$ZodNumber",(r,e)=>{Y.init(r,e),r._zod.pattern=r._zod.bag.pattern??Nc,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...o?{received:o}:{}}),t}}),$d=x("$ZodNumber",(r,e)=>{Oc.init(r,e),Da.init(r,e)}),Xn=x("$ZodBoolean",(r,e)=>{Y.init(r,e),r._zod.pattern=Pc,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),Ra=x("$ZodBigInt",(r,e)=>{Y.init(r,e),r._zod.pattern=Ec,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),Ed=x("$ZodBigInt",(r,e)=>{Cc.init(r,e),Ra.init(r,e)}),Sd=x("$ZodSymbol",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),Nd=x("$ZodUndefined",(r,e)=>{Y.init(r,e),r._zod.pattern=kc,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),Pd=x("$ZodNull",(r,e)=>{Y.init(r,e),r._zod.pattern=_c,r._zod.values=new Set([null]),r._zod.parse=(t,n)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),_d=x("$ZodAny",(r,e)=>{Y.init(r,e),r._zod.parse=t=>t}),kd=x("$ZodUnknown",(r,e)=>{Y.init(r,e),r._zod.parse=t=>t}),Id=x("$ZodNever",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),Fd=x("$ZodVoid",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),Bd=x("$ZodDate",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:r}),t}});function df(r,e,t){r.issues.length&&e.issues.push(...tt(t,r.issues)),e.value[t]=r.value}var Od=x("$ZodArray",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],u=e.element._zod.run({value:a,issues:[]},n);u instanceof Promise?o.push(u.then(l=>df(l,t,s))):df(u,t,s)}return o.length?Promise.all(o).then(()=>t):t}});function Ca(r,e,t,n){r.issues.length&&e.issues.push(...tt(t,r.issues)),r.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=r.value}function $f(r){let e=Object.keys(r.shape);for(let n of e)if(!r.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let t=Jl(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Ef(r,e,t,n,i,o){let s=[],a=i.keySet,u=i.catchall._zod,l=u.def.type;for(let d of Object.keys(e)){if(a.has(d))continue;if(l==="never"){s.push(d);continue}let h=u.run({value:e[d],issues:[]},n);h instanceof Promise?r.push(h.then(f=>Ca(f,t,d,e))):Ca(h,t,d,e)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var Sf=x("$ZodObject",(r,e)=>{if(Y.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=en(()=>$f(e));ne(r._zod,"propValues",()=>{let a=e.shape,u={};for(let l in a){let d=a[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let h of d.values)u[l].add(h)}}return u});let i=ii,o=e.catchall,s;r._zod.parse=(a,u)=>{s??(s=n.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:r}),a;a.value={};let d=[],h=s.shape;for(let f of s.keys){let g=h[f]._zod.run({value:l[f],issues:[]},u);g instanceof Promise?d.push(g.then(y=>Ca(y,a,f,l))):Ca(g,a,f,l)}return o?Ef(d,l,a,u,n.value,r):d.length?Promise.all(d).then(()=>a):a}}),Cd=x("$ZodObjectJIT",(r,e)=>{Sf.init(r,e);let t=r._zod.parse,n=en(()=>$f(e)),i=f=>{let v=new Yn(["shape","payload","ctx"]),g=n.value,y=j=>{let L=fa(j);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};v.write("const input = payload.value;");let b=Object.create(null),C=0;for(let j of g.keys)b[j]=`key_${C++}`;v.write("const newResult = {};");for(let j of g.keys){let L=b[j],ee=fa(j);v.write(`const ${L} = ${y(j)};`),v.write(`
6
+ `))}};var wd={major:4,minor:1,patch:12};var Q=x("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=wd;let n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(let i of n)for(let o of i._zod.onattach)o(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(s,a,u)=>{let l=Br(s),d;for(let h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(l)continue;let f=s.issues.length,v=h._zod.check(s);if(v instanceof Promise&&u?.async===!1)throw new yt;if(d||v instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await v,s.issues.length!==f&&(l||(l=Br(s,f)))});else{if(s.issues.length===f)continue;l||(l=Br(s,f))}}return d?d.then(()=>s):s},o=(s,a,u)=>{if(Br(s))return s.aborted=!0,s;let l=i(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new yt;return l.then(d=>r._zod.parse(d,u))}return r._zod.parse(l,u)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){let l=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,s,a)):o(l,s,a)}let u=r._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new yt;return u.then(l=>i(l,n,a))}return i(u,n,a)}}r["~standard"]={validate:i=>{try{let o=Nc(r,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Pc(r,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),ni=x("$ZodString",(r,e)=>{Q.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Gc(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),ve=x("$ZodStringFormat",(r,e)=>{dn.init(r,e),ni.init(r,e)}),$d=x("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=Rc),ve.init(r,e)}),Ed=x("$ZodUUID",(r,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ii(n))}else e.pattern??(e.pattern=ii());ve.init(r,e)}),Sd=x("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=Oc),ve.init(r,e)}),Nd=x("$ZodURL",(r,e)=>{ve.init(r,e),r._zod.check=t=>{try{let n=t.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Lc.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=i.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Pd=x("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=zc()),ve.init(r,e)}),kd=x("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=Dc),ve.init(r,e)}),_d=x("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=kc),ve.init(r,e)}),Fd=x("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=_c),ve.init(r,e)}),Id=x("$ZodULID",(r,e)=>{e.pattern??(e.pattern=Fc),ve.init(r,e)}),Bd=x("$ZodXID",(r,e)=>{e.pattern??(e.pattern=Ic),ve.init(r,e)}),Dd=x("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=Bc),ve.init(r,e)}),Cd=x("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=Hc(e)),ve.init(r,e)}),Rd=x("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=Zc),ve.init(r,e)}),Od=x("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=qc(e)),ve.init(r,e)}),zd=x("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=Cc),ve.init(r,e)}),Md=x("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=Mc),ve.init(r,e),r._zod.onattach.push(t=>{let n=t._zod.bag;n.format="ipv4"})}),Td=x("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=Tc),ve.init(r,e),r._zod.onattach.push(t=>{let n=t._zod.bag;n.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})}}}),Ud=x("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=Uc),ve.init(r,e)}),Vd=x("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=Vc),ve.init(r,e),r._zod.check=t=>{let n=t.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)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 jd(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var Ld=x("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=jc),ve.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64"}),r._zod.check=t=>{jd(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function Wf(r){if(!Ua.test(r))return!1;let e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return jd(t)}var Kd=x("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Ua),ve.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64url"}),r._zod.check=t=>{Wf(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),Zd=x("$ZodE164",(r,e)=>{e.pattern??(e.pattern=Kc),ve.init(r,e)});function Jf(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[n]=t;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var qd=x("$ZodJWT",(r,e)=>{ve.init(r,e),r._zod.check=t=>{Jf(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),Hd=x("$ZodCustomStringFormat",(r,e)=>{ve.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})}}),Ga=x("$ZodNumber",(r,e)=>{Q.init(r,e),r._zod.pattern=r._zod.bag.pattern??Yc,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...o?{received:o}:{}}),t}}),Gd=x("$ZodNumber",(r,e)=>{nd.init(r,e),Ga.init(r,e)}),no=x("$ZodBoolean",(r,e)=>{Q.init(r,e),r._zod.pattern=Qc,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),Wa=x("$ZodBigInt",(r,e)=>{Q.init(r,e),r._zod.pattern=Wc,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),Wd=x("$ZodBigInt",(r,e)=>{od.init(r,e),Wa.init(r,e)}),Jd=x("$ZodSymbol",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),Yd=x("$ZodUndefined",(r,e)=>{Q.init(r,e),r._zod.pattern=ed,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),Qd=x("$ZodNull",(r,e)=>{Q.init(r,e),r._zod.pattern=Xc,r._zod.values=new Set([null]),r._zod.parse=(t,n)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),Xd=x("$ZodAny",(r,e)=>{Q.init(r,e),r._zod.parse=t=>t}),eh=x("$ZodUnknown",(r,e)=>{Q.init(r,e),r._zod.parse=t=>t}),th=x("$ZodNever",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),rh=x("$ZodVoid",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),ih=x("$ZodDate",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:r}),t}});function Tf(r,e,t){r.issues.length&&e.issues.push(...it(t,r.issues)),e.value[t]=r.value}var nh=x("$ZodArray",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],u=e.element._zod.run({value:a,issues:[]},n);u instanceof Promise?o.push(u.then(l=>Tf(l,t,s))):Tf(u,t,s)}return o.length?Promise.all(o).then(()=>t):t}});function Ha(r,e,t,n){r.issues.length&&e.issues.push(...it(t,r.issues)),r.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=r.value}function Yf(r){let e=Object.keys(r.shape);for(let n of e)if(!r.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let t=wc(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Qf(r,e,t,n,i,o){let s=[],a=i.keySet,u=i.catchall._zod,l=u.def.type;for(let d of Object.keys(e)){if(a.has(d))continue;if(l==="never"){s.push(d);continue}let h=u.run({value:e[d],issues:[]},n);h instanceof Promise?r.push(h.then(f=>Ha(f,t,d,e))):Ha(h,t,d,e)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var Xf=x("$ZodObject",(r,e)=>{if(Q.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=on(()=>Yf(e));ue(r._zod,"propValues",()=>{let a=e.shape,u={};for(let l in a){let d=a[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let h of d.values)u[l].add(h)}}return u});let i=ri,o=e.catchall,s;r._zod.parse=(a,u)=>{s??(s=n.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:r}),a;a.value={};let d=[],h=s.shape;for(let f of s.keys){let g=h[f]._zod.run({value:l[f],issues:[]},u);g instanceof Promise?d.push(g.then(y=>Ha(y,a,f,l))):Ha(g,a,f,l)}return o?Qf(d,l,a,u,n.value,r):d.length?Promise.all(d).then(()=>a):a}}),oh=x("$ZodObjectJIT",(r,e)=>{Xf.init(r,e);let t=r._zod.parse,n=on(()=>Yf(e)),i=f=>{let v=new io(["shape","payload","ctx"]),g=n.value,y=j=>{let L=ka(j);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};v.write("const input = payload.value;");let b=Object.create(null),R=0;for(let j of g.keys)b[j]=`key_${R++}`;v.write("const newResult = {};");for(let j of g.keys){let L=b[j],ee=ka(j);v.write(`const ${L} = ${y(j)};`),v.write(`
7
7
  if (${L}.issues.length) {
8
8
  payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
9
9
  ...iss,
@@ -20,9 +20,9 @@ var kv=Object.defineProperty;var zr=(r,e)=>{for(var t in e)kv(r,t,{get:e[t],enum
20
20
  newResult[${ee}] = ${L}.value;
21
21
  }
22
22
 
23
- `)}v.write("payload.value = newResult;"),v.write("return payload;");let U=v.compile();return(j,L)=>U(f,j,L)},o,s=ii,a=!Mn.jitless,l=a&&Hl.value,d=e.catchall,h;r._zod.parse=(f,v)=>{h??(h=n.value);let g=f.value;return s(g)?a&&l&&v?.async===!1&&v.jitless!==!0?(o||(o=i(e.shape)),f=o(f,v),d?Ef([],g,f,v,h,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:r}),f)}});function hf(r,e,t,n){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let i=r.filter(o=>!Fr(o));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(o=>o.issues.map(s=>rt(s,n,_e())))}),e)}var za=x("$ZodUnion",(r,e)=>{Y.init(r,e),ne(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ne(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ne(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ne(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>jn(o.source)).join("|")})$`)}});let t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(i,o)=>{if(t)return n(i,o);let s=!1,a=[];for(let u of e.options){let l=u._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(u=>hf(u,i,r,o)):hf(a,i,r,o)}}),Dd=x("$ZodDiscriminatedUnion",(r,e)=>{za.init(r,e);let t=r._zod.parse;ne(r._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of u)i[a].add(l)}}return i});let n=en(()=>{let i=e.options,o=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 u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});r._zod.parse=(i,o)=>{let s=i.value;if(!ii(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),i)}}),Rd=x("$ZodIntersection",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value,o=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>pf(t,u,l)):pf(t,o,s)}});function Yc(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(Ir(r)&&Ir(e)){let t=Object.keys(e),n=Object.keys(r).filter(o=>t.indexOf(o)!==-1),i={...r,...e};for(let o of n){let s=Yc(r[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=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 n=0;n<r.length;n++){let i=r[n],o=e[n],s=Yc(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function pf(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Fr(r))return r;let n=Yc(e.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return r.value=n.data,r}var Ta=x("$ZodTuple",(r,e)=>{Y.init(r,e);let t=e.items,n=t.length-[...t].reverse().findIndex(i=>i._zod.optin!=="optional");r._zod.parse=(i,o)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[];if(!e.rest){let l=s.length>t.length,d=s.length<n-1;if(l||d)return i.issues.push({...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:s,inst:r,origin:"array"}),i}let u=-1;for(let l of t){if(u++,u>=s.length&&u>=n)continue;let d=l._zod.run({value:s[u],issues:[]},o);d instanceof Promise?a.push(d.then(h=>Ia(h,i,u))):Ia(d,i,u)}if(e.rest){let l=s.slice(t.length);for(let d of l){u++;let h=e.rest._zod.run({value:d,issues:[]},o);h instanceof Promise?a.push(h.then(f=>Ia(f,i,u))):Ia(h,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function Ia(r,e,t){r.issues.length&&e.issues.push(...tt(t,r.issues)),e.value[t]=r.value}var zd=x("$ZodRecord",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Ir(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let o=[];if(e.keyType._zod.values){let s=e.keyType._zod.values;t.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let l=e.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&t.issues.push(...tt(u,d.issues)),t.value[u]=d.value})):(l.issues.length&&t.issues.push(...tt(u,l.issues)),t.value[u]=l.value)}let a;for(let u in i)s.has(u)||(a=a??[],a.push(u));a&&a.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:a})}else{t.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let a=e.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(l=>rt(l,n,_e())),input:s,path:[s],inst:r}),t.value[a.value]=a.value;continue}let u=e.valueType._zod.run({value:i[s],issues:[]},n);u instanceof Promise?o.push(u.then(l=>{l.issues.length&&t.issues.push(...tt(s,l.issues)),t.value[a.value]=l.value})):(u.issues.length&&t.issues.push(...tt(s,u.issues)),t.value[a.value]=u.value)}}return o.length?Promise.all(o).then(()=>t):t}}),Td=x("$ZodMap",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),t;let o=[];t.value=new Map;for(let[s,a]of i){let u=e.keyType._zod.run({value:s,issues:[]},n),l=e.valueType._zod.run({value:a,issues:[]},n);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([d,h])=>{mf(d,h,t,s,i,r,n)})):mf(u,l,t,s,i,r,n)}return o.length?Promise.all(o).then(()=>t):t}});function mf(r,e,t,n,i,o,s){r.issues.length&&(Ln.has(typeof n)?t.issues.push(...tt(n,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:r.issues.map(a=>rt(a,s,_e()))})),e.issues.length&&(Ln.has(typeof n)?t.issues.push(...tt(n,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:e.issues.map(a=>rt(a,s,_e()))})),t.value.set(r.value,e.value)}var Md=x("$ZodSet",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Set))return t.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(u=>ff(u,t))):ff(a,t)}return o.length?Promise.all(o).then(()=>t):t}});function ff(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var Ud=x("$ZodEnum",(r,e)=>{Y.init(r,e);let t=Vn(e.entries),n=new Set(t);r._zod.values=n,r._zod.pattern=new RegExp(`^(${t.filter(i=>Ln.has(typeof i)).map(i=>typeof i=="string"?kt(i):i.toString()).join("|")})$`),r._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t,input:s,inst:r}),i}}),Vd=x("$ZodLiteral",(r,e)=>{if(Y.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");r._zod.values=new Set(e.values),r._zod.pattern=new RegExp(`^(${e.values.map(t=>typeof t=="string"?kt(t):t?kt(t.toString()):String(t)).join("|")})$`),r._zod.parse=(t,n)=>{let i=t.value;return r._zod.values.has(i)||t.issues.push({code:"invalid_value",values:e.values,input:i,inst:r}),t}}),jd=x("$ZodFile",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),t}}),Ld=x("$ZodTransform",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Nr(r.constructor.name);let i=e.transform(t.value,t);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(t.value=s,t));if(i instanceof Promise)throw new yt;return t.value=i,t}});function gf(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var Kd=x("$ZodOptional",(r,e)=>{Y.init(r,e),r._zod.optin="optional",r._zod.optout="optional",ne(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ne(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${jn(t.source)})?$`):void 0}),r._zod.parse=(t,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>gf(o,t.value)):gf(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}}),Zd=x("$ZodNullable",(r,e)=>{Y.init(r,e),ne(r._zod,"optin",()=>e.innerType._zod.optin),ne(r._zod,"optout",()=>e.innerType._zod.optout),ne(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${jn(t.source)}|null)$`):void 0}),ne(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,n)=>t.value===null?t:e.innerType._zod.run(t,n)}),qd=x("$ZodDefault",(r,e)=>{Y.init(r,e),r._zod.optin="optional",ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);if(t.value===void 0)return t.value=e.defaultValue,t;let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>vf(o,e)):vf(i,e)}});function vf(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var Hd=x("$ZodPrefault",(r,e)=>{Y.init(r,e),r._zod.optin="optional",ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,n))}),Gd=x("$ZodNonOptional",(r,e)=>{Y.init(r,e),ne(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),r._zod.parse=(t,n)=>{let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>xf(o,r)):xf(i,r)}});function xf(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 Wd=x("$ZodSuccess",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Nr("ZodSuccess");let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.issues.length===0,t)):(t.value=i.issues.length===0,t)}}),Jd=x("$ZodCatch",(r,e)=>{Y.init(r,e),ne(r._zod,"optin",()=>e.innerType._zod.optin),ne(r._zod,"optout",()=>e.innerType._zod.optout),ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(s=>rt(s,n,_e()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>rt(o,n,_e()))},input:t.value}),t.issues=[]),t)}}),Yd=x("$ZodNaN",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),Xd=x("$ZodPipe",(r,e)=>{Y.init(r,e),ne(r._zod,"values",()=>e.in._zod.values),ne(r._zod,"optin",()=>e.in._zod.optin),ne(r._zod,"optout",()=>e.out._zod.optout),ne(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(s=>Fa(s,e.in,n)):Fa(o,e.in,n)}let i=e.in._zod.run(t,n);return i instanceof Promise?i.then(o=>Fa(o,e.out,n)):Fa(i,e.out,n)}});function Fa(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var Qn=x("$ZodCodec",(r,e)=>{Y.init(r,e),ne(r._zod,"values",()=>e.in._zod.values),ne(r._zod,"optin",()=>e.in._zod.optin),ne(r._zod,"optout",()=>e.out._zod.optout),ne(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(t,n);return o instanceof Promise?o.then(s=>Ba(s,e,n)):Ba(o,e,n)}else{let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(s=>Ba(s,e,n)):Ba(o,e,n)}}});function Ba(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(o=>Oa(r,o,e.out,t)):Oa(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(o=>Oa(r,o,e.in,t)):Oa(r,i,e.in,t)}}function Oa(r,e,t,n){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},n)}var Qd=x("$ZodReadonly",(r,e)=>{Y.init(r,e),ne(r._zod,"propValues",()=>e.innerType._zod.propValues),ne(r._zod,"values",()=>e.innerType._zod.values),ne(r._zod,"optin",()=>e.innerType._zod.optin),ne(r._zod,"optout",()=>e.innerType._zod.optout),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(yf):yf(i)}});function yf(r){return r.value=Object.freeze(r.value),r}var eh=x("$ZodTemplateLiteral",(r,e)=>{Y.init(r,e);let t=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;t.push(i.slice(o,s))}else if(n===null||Wl.has(typeof n))t.push(kt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:r,expected:"template_literal",code:"invalid_type"}),n):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),n)}),th=x("$ZodFunction",(r,e)=>(Y.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(...n){let i=r._def.input?va(r._def.input,n):n,o=Reflect.apply(t,this,i);return r._def.output?va(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(...n){let i=r._def.input?await xa(r._def.input,n):n,o=await Reflect.apply(t,this,i);return r._def.output?await xa(r._def.output,o):o}},r._zod.parse=(t,n)=>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 n=r.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Ta({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new n({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let n=r.constructor;return new n({type:"function",input:r._def.input,output:t})},r)),rh=x("$ZodPromise",(r,e)=>{Y.init(r,e),r._zod.parse=(t,n)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),ih=x("$ZodLazy",(r,e)=>{Y.init(r,e),ne(r._zod,"innerType",()=>e.getter()),ne(r._zod,"pattern",()=>r._zod.innerType._zod.pattern),ne(r._zod,"propValues",()=>r._zod.innerType._zod.propValues),ne(r._zod,"optin",()=>r._zod.innerType._zod.optin??void 0),ne(r._zod,"optout",()=>r._zod.innerType._zod.optout??void 0),r._zod.parse=(t,n)=>r._zod.innerType._zod.run(t,n)}),nh=x("$ZodCustom",(r,e)=>{Ae.init(r,e),Y.init(r,e),r._zod.parse=(t,n)=>t,r._zod.check=t=>{let n=t.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>bf(o,t,n,r));bf(i,t,n,r)}});function bf(r,e,t,n){if(!r){let i={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(tn(i))}}var ro={};zr(ro,{ar:()=>Nf,az:()=>Pf,be:()=>kf,bg:()=>If,ca:()=>Ff,cs:()=>Bf,da:()=>Of,de:()=>Cf,en:()=>Ma,eo:()=>Df,es:()=>Rf,fa:()=>zf,fi:()=>Tf,fr:()=>Mf,frCA:()=>Uf,he:()=>Vf,hu:()=>jf,id:()=>Lf,is:()=>Kf,it:()=>Zf,ja:()=>qf,ka:()=>Hf,kh:()=>Gf,km:()=>Ua,ko:()=>Wf,lt:()=>Yf,mk:()=>Xf,ms:()=>Qf,nl:()=>eg,no:()=>tg,ota:()=>rg,pl:()=>ng,ps:()=>ig,pt:()=>og,ru:()=>ag,sl:()=>ug,sv:()=>lg,ta:()=>cg,th:()=>dg,tr:()=>hg,ua:()=>pg,uk:()=>Va,ur:()=>mg,vi:()=>fg,yo:()=>xg,zhCN:()=>gg,zhTW:()=>vg});var Lx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=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"} ${o} ${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"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=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 ${o} ${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 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 "${i.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}`:`${n[o.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.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 Nf(){return{localeError:Lx()}}var Kx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Pf(){return{localeError:Kx()}}function _f(r,e,t,n){let i=Math.abs(r),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?t:n}var Zx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),u=_f(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} ${o}${i.maximum.toString()} ${u}`}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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),u=_f(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} ${o}${i.minimum.toString()} ${u}`}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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 kf(){return{localeError:Zx()}}var qx=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},Hx=()=>{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(n){return r[n]??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 n=>{switch(n.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 ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${qx(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${R(n.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 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.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 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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 o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${$(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function If(){return{localeError:Hx()}}var Gx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$(i.values," o ")}`;case"too_big":{let o=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 ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Ff(){return{localeError:Gx()}}var Wx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Bf(){return{localeError:Wx()}}var Jx=()=>{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 n(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},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 s=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${n(s.expected)}, fik ${n(i(s.input))}`;case"invalid_value":return s.values.length===1?`Ugyldig v\xE6rdi: forventede ${R(s.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${$(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",u=t(s.origin),l=n(s.origin);return u?`For stor: forventede ${l??"value"} ${u.verb} ${a} ${s.maximum.toString()} ${u.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",u=t(s.origin),l=n(s.origin);return u?`For lille: forventede ${l} ${u.verb} ${a} ${s.minimum.toString()} ${u.unit}`:`For lille: forventede ${l} 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 ${o[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"}: ${$(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 Of(){return{localeError:Jx()}}var Yx=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;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: ${n[o.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.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 Cf(){return{localeError:Yx()}}var Xx=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},Qx=()=>{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(n){return r[n]??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",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`Invalid input: expected ${n.expected}, received ${Xx(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${R(n.values[0])}`:`Invalid option: expected one of ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${o.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Ma(){return{localeError:Qx()}}var ey=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},ty=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${ey(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${R(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Df(){return{localeError:ty()}}var ry=()=>{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 n(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},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 s=>{switch(s.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${n(s.expected)}, recibido ${n(i(s.input))}`;case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: se esperaba ${R(s.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",u=t(s.origin),l=n(s.origin);return u?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${a}${s.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",u=t(s.origin),l=n(s.origin);return u?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${a}${s.minimum.toString()} ${u.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} 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 ${o[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":""}: ${$(s.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n(s.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n(s.origin)}`;default:return"Entrada inv\xE1lida"}}};function Rf(){return{localeError:ry()}}var iy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;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`:`${n[o.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.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 zf(){return{localeError:iy()}}var ny=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Tf(){return{localeError:ny()}}var oy=()=>{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 o=typeof i;switch(o){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 o},n={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 : ${R(i.values[0])} attendu`:`Option invalide : une valeur parmi ${$(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 Mf(){return{localeError:oy()}}var sy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 Uf(){return{localeError:sy()}}var ay=()=>{let r={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(i){return r[i]??null}let t=i=>{let o=typeof i;switch(o){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 o},n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return i=>{switch(i.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${i.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${R(i.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${o.prefix}"`:o.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${o.suffix}"`:o.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${o.includes}"`:o.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${o.pattern}`:`${n[o.format]??i.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}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 ${i.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${i.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${i.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$(i.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i.origin}`;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.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Vf(){return{localeError:ay()}}var uy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 jf(){return{localeError:uy()}}var ly=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 Lf(){return{localeError:ly()}}var cy=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},dy=()=>{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(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${cy(n.input)} \xFEar sem \xE1 a\xF0 vera ${n.expected}`;case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${R(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${$(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function Kf(){return{localeError:dy()}}var hy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Opzione non valida: atteso uno tra ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Zf(){return{localeError:hy()}}var py=()=>{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 o=typeof i;switch(o){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 o},n={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: ${R(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=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"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=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}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;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${n[o.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.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 qf(){return{localeError:py()}}var my=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},fy=()=>{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(n){return r[n]??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 n=>{switch(n.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 ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${my(n.input)}`;case"invalid_value":return n.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 ${R(n.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 ${$(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${i}${n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.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 ${n.origin} ${o.verb} ${i}${n.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 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.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 ${n.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${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${$(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.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 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Hf(){return{localeError:fy()}}var gy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=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"} ${o} ${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"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=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} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Ua(){return{localeError:gy()}}function Gf(){return Ua()}var vy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),u=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${u} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),u=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${u} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Wf(){return{localeError:vy()}}var xy=r=>to(typeof r,r),to=(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},eo=r=>r.charAt(0).toUpperCase()+r.slice(1);function Jf(r){let e=Math.abs(r),t=e%10,n=e%100;return n>=11&&n<=19||t===0?"many":t===1?"one":"few"}var yy=()=>{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(n,i,o,s){let a=r[n]??null;return a===null?a:{unit:a.unit[i],verb:a.verb[s][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 n=>{switch(n.code){case"invalid_type":return`Gautas tipas ${xy(n.input)}, o tik\u0117tasi - ${to(n.expected)}`;case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${R(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${$(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=to(n.origin),o=e(n.origin,Jf(Number(n.maximum)),n.inclusive??!1,"smaller");if(o?.verb)return`${eo(i??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.maximum.toString()} ${o.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${eo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${o?.unit}`}case"too_small":{let i=to(n.origin),o=e(n.origin,Jf(Number(n.minimum)),n.inclusive??!1,"bigger");if(o?.verb)return`${eo(i??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.minimum.toString()} ${o.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${eo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${o?.unit}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${$(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=to(n.origin);return`${eo(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Yf(){return{localeError:yy()}}var by=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()}`}case"too_small":{let o=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 ${o}${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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Xf(){return{localeError:by()}}var wy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 Qf(){return{localeError:wy()}}var Ay=()=>{let r={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(i){return r[i]??null}let t=i=>{let o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;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: ${n[o.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.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 eg(){return{localeError:Ay()}}var $y=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Ugyldig valg: forventet en av ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 tg(){return{localeError:$y()}}var Ey=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;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 ${n[o.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.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 rg(){return{localeError:Ey()}}var Sy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;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`:`${n[o.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.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 ig(){return{localeError:Sy()}}var Ny=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$(i.values,"|")}`;case"too_big":{let o=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 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=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 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${n[o.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.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 ng(){return{localeError:Ny()}}var Py=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 og(){return{localeError:Py()}}function sg(r,e,t,n){let i=Math.abs(r),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?t:n}var _y=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),u=sg(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 ${o}${i.maximum.toString()} ${u}`}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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),u=sg(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 ${o}${i.minimum.toString()} ${u}`}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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 ag(){return{localeError:_y()}}var ky=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 ug(){return{localeError:ky()}}var Iy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${n[o.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.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 lg(){return{localeError:Iy()}}var Fy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=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"} ${o}${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"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=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} ${o}${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} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;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 ${n[o.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.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 cg(){return{localeError:Fy()}}var By=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=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${o} ${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${o} ${i.maximum.toString()}`}case"too_small":{let o=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${o} ${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${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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: ${n[o.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.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 dg(){return{localeError:By()}}var Oy=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},Cy=()=>{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(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Oy(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${R(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${$(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function hg(){return{localeError:Cy()}}var Dy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=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} ${o}${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 ${o}${i.maximum.toString()}`}case"too_small":{let o=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} ${o}${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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 Va(){return{localeError:Dy()}}function pg(){return Va()}var Ry=()=>{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 o=typeof i;switch(o){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 o},n={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: ${R(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${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 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${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 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;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 ${n[o.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.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 mg(){return{localeError:Ry()}}var zy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(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.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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.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 fg(){return{localeError:zy()}}var Ty=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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${n[o.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.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 gg(){return{localeError:Ty()}}var My=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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.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 vg(){return{localeError:My()}}var Uy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${R(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${$(i.values,"|")}`;case"too_big":{let o=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} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=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} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;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: ${n[o.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.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 xg(){return{localeError:Uy()}}var oh=Symbol("ZodOutput"),sh=Symbol("ZodInput"),un=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.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 n={...this.get(t)??{}};delete n.id;let i={...n,...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 ja(){return new un}var It=ja();function ah(r,e){return new r({type:"string",...T(e)})}function uh(r,e){return new r({type:"string",coerce:!0,...T(e)})}function La(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...T(e)})}function io(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...T(e)})}function Ka(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...T(e)})}function Za(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(e)})}function qa(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(e)})}function Ha(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(e)})}function no(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...T(e)})}function Ga(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...T(e)})}function Wa(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(e)})}function Ja(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...T(e)})}function Ya(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(e)})}function Xa(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...T(e)})}function Qa(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...T(e)})}function eu(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(e)})}function tu(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(e)})}function ru(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(e)})}function iu(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(e)})}function nu(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(e)})}function ou(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...T(e)})}function su(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...T(e)})}function au(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...T(e)})}function uu(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...T(e)})}var lh={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ch(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(e)})}function dh(r,e){return new r({type:"string",format:"date",check:"string_format",...T(e)})}function hh(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...T(e)})}function ph(r,e){return new r({type:"string",format:"duration",check:"string_format",...T(e)})}function mh(r,e){return new r({type:"number",checks:[],...T(e)})}function fh(r,e){return new r({type:"number",coerce:!0,checks:[],...T(e)})}function gh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...T(e)})}function vh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...T(e)})}function xh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...T(e)})}function yh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...T(e)})}function bh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...T(e)})}function wh(r,e){return new r({type:"boolean",...T(e)})}function Ah(r,e){return new r({type:"boolean",coerce:!0,...T(e)})}function $h(r,e){return new r({type:"bigint",...T(e)})}function Eh(r,e){return new r({type:"bigint",coerce:!0,...T(e)})}function Sh(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(e)})}function Nh(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(e)})}function Ph(r,e){return new r({type:"symbol",...T(e)})}function _h(r,e){return new r({type:"undefined",...T(e)})}function kh(r,e){return new r({type:"null",...T(e)})}function Ih(r){return new r({type:"any"})}function Fh(r){return new r({type:"unknown"})}function Bh(r,e){return new r({type:"never",...T(e)})}function Oh(r,e){return new r({type:"void",...T(e)})}function Ch(r,e){return new r({type:"date",...T(e)})}function Dh(r,e){return new r({type:"date",coerce:!0,...T(e)})}function Rh(r,e){return new r({type:"nan",...T(e)})}function Zt(r,e){return new _a({check:"less_than",...T(e),value:r,inclusive:!1})}function dt(r,e){return new _a({check:"less_than",...T(e),value:r,inclusive:!0})}function qt(r,e){return new ka({check:"greater_than",...T(e),value:r,inclusive:!1})}function Ye(r,e){return new ka({check:"greater_than",...T(e),value:r,inclusive:!0})}function zh(r){return qt(0,r)}function Th(r){return Zt(0,r)}function Mh(r){return dt(0,r)}function Uh(r){return Ye(0,r)}function si(r,e){return new Bc({check:"multiple_of",...T(e),value:r})}function ln(r,e){return new Dc({check:"max_size",...T(e),maximum:r})}function ai(r,e){return new Rc({check:"min_size",...T(e),minimum:r})}function oo(r,e){return new zc({check:"size_equals",...T(e),size:r})}function cn(r,e){return new Tc({check:"max_length",...T(e),maximum:r})}function Br(r,e){return new Mc({check:"min_length",...T(e),minimum:r})}function dn(r,e){return new Uc({check:"length_equals",...T(e),length:r})}function so(r,e){return new Vc({check:"string_format",format:"regex",...T(e),pattern:r})}function ao(r){return new jc({check:"string_format",format:"lowercase",...T(r)})}function uo(r){return new Lc({check:"string_format",format:"uppercase",...T(r)})}function lo(r,e){return new Kc({check:"string_format",format:"includes",...T(e),includes:r})}function co(r,e){return new Zc({check:"string_format",format:"starts_with",...T(e),prefix:r})}function ho(r,e){return new qc({check:"string_format",format:"ends_with",...T(e),suffix:r})}function Vh(r,e,t){return new Hc({check:"property",property:r,schema:e,...T(t)})}function po(r,e){return new Gc({check:"mime_type",mime:r,...T(e)})}function Ht(r){return new Wc({check:"overwrite",tx:r})}function mo(r){return Ht(e=>e.normalize(r))}function fo(){return Ht(r=>r.trim())}function go(){return Ht(r=>r.toLowerCase())}function vo(){return Ht(r=>r.toUpperCase())}function jh(r,e,t){return new r({type:"array",element:e,...T(t)})}function Vy(r,e,t){return new r({type:"union",options:e,...T(t)})}function jy(r,e,t,n){return new r({type:"union",options:t,discriminator:e,...T(n)})}function Ly(r,e,t){return new r({type:"intersection",left:e,right:t})}function Ky(r,e,t,n){let i=t instanceof Y,o=i?n:t,s=i?t:null;return new r({type:"tuple",items:e,rest:s,...T(o)})}function Zy(r,e,t,n){return new r({type:"record",keyType:e,valueType:t,...T(n)})}function qy(r,e,t,n){return new r({type:"map",keyType:e,valueType:t,...T(n)})}function Hy(r,e,t){return new r({type:"set",valueType:e,...T(t)})}function Gy(r,e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:n,...T(t)})}function Wy(r,e,t){return new r({type:"enum",entries:e,...T(t)})}function Jy(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}function Lh(r,e){return new r({type:"file",...T(e)})}function Yy(r,e){return new r({type:"transform",transform:e})}function Xy(r,e){return new r({type:"optional",innerType:e})}function Qy(r,e){return new r({type:"nullable",innerType:e})}function eb(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Gl(t)}})}function tb(r,e,t){return new r({type:"nonoptional",innerType:e,...T(t)})}function rb(r,e){return new r({type:"success",innerType:e})}function ib(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function nb(r,e,t){return new r({type:"pipe",in:e,out:t})}function ob(r,e){return new r({type:"readonly",innerType:e})}function sb(r,e,t){return new r({type:"template_literal",parts:e,...T(t)})}function ab(r,e){return new r({type:"lazy",getter:e})}function ub(r,e){return new r({type:"promise",innerType:e})}function Kh(r,e,t){let n=T(t);return n.abort??(n.abort=!0),new r({type:"custom",check:"custom",fn:e,...n})}function Zh(r,e,t){return new r({type:"custom",check:"custom",fn:e,...T(t)})}function qh(r){let e=yg(t=>(t.addIssue=n=>{if(typeof n=="string")t.issues.push(tn(n,t.value,e._zod.def));else{let i=n;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(tn(i))}},r(t.value,t)));return e}function yg(r,e){let t=new Ae({check:"custom",...T(e)});return t._zod.check=r,t}function Hh(r,e){let t=T(e),n=t.truthy??["true","1","yes","on","y","enabled"],i=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(n=n.map(v=>typeof v=="string"?v.toLowerCase():v),i=i.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(n),s=new Set(i),a=r.Codec??Qn,u=r.Boolean??Xn,l=r.String??oi,d=new l({type:"string",error:t.error}),h=new u({type:"boolean",error:t.error}),f=new a({type:"pipe",in:d,out:h,transform:((v,g)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:g.value,inst:f,continue:!1}),{})}),reverseTransform:((v,g)=>v===!0?n[0]||"true":i[0]||"false"),error:t.error});return f}function hn(r,e,t,n={}){let i=T(n),o={...T(n),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:a=>t.test(a),...i};return t instanceof RegExp&&(o.pattern=t),new r(o)}var xo=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??It,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 n;let i=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(e);if(s)return s.count++,t.schemaPath.includes(e)&&(s.cycle=t.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,a);let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let h={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)a.ref=f,this.process(f,h),this.seen.get(f).isParent=!0;else{let v=a.schema;switch(i.type){case"string":{let g=v;g.type="string";let{minimum:y,maximum:b,format:C,patterns:U,contentEncoding:j}=e._zod.bag;if(typeof y=="number"&&(g.minLength=y),typeof b=="number"&&(g.maxLength=b),C&&(g.format=o[C]??C,g.format===""&&delete g.format),j&&(g.contentEncoding=j),U&&U.size>0){let L=[...U];L.length===1?g.pattern=L[0].source:L.length>1&&(a.schema.allOf=[...L.map(ee=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:ee.source}))])}break}case"number":{let g=v,{minimum:y,maximum:b,format:C,multipleOf:U,exclusiveMaximum:j,exclusiveMinimum:L}=e._zod.bag;typeof C=="string"&&C.includes("int")?g.type="integer":g.type="number",typeof L=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.minimum=L,g.exclusiveMinimum=!0):g.exclusiveMinimum=L),typeof y=="number"&&(g.minimum=y,typeof L=="number"&&this.target!=="draft-4"&&(L>=y?delete g.minimum:delete g.exclusiveMinimum)),typeof j=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.maximum=j,g.exclusiveMaximum=!0):g.exclusiveMaximum=j),typeof b=="number"&&(g.maximum=b,typeof j=="number"&&this.target!=="draft-4"&&(j<=b?delete g.maximum:delete g.exclusiveMaximum)),typeof U=="number"&&(g.multipleOf=U);break}case"boolean":{let g=v;g.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 g=v,{minimum:y,maximum:b}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof b=="number"&&(g.maxItems=b),g.type="array",g.items=this.process(i.element,{...h,path:[...h.path,"items"]});break}case"object":{let g=v;g.type="object",g.properties={};let y=i.shape;for(let U in y)g.properties[U]=this.process(y[U],{...h,path:[...h.path,"properties",U]});let b=new Set(Object.keys(y)),C=new Set([...b].filter(U=>{let j=i.shape[U]._zod;return this.io==="input"?j.optin===void 0:j.optout===void 0}));C.size>0&&(g.required=Array.from(C)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=v,y=i.options.map((b,C)=>this.process(b,{...h,path:[...h.path,"anyOf",C]}));g.anyOf=y;break}case"intersection":{let g=v,y=this.process(i.left,{...h,path:[...h.path,"allOf",0]}),b=this.process(i.right,{...h,path:[...h.path,"allOf",1]}),C=j=>"allOf"in j&&Object.keys(j).length===1,U=[...C(y)?y.allOf:[y],...C(b)?b.allOf:[b]];g.allOf=U;break}case"tuple":{let g=v;g.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",b=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",C=i.items.map((ee,be)=>this.process(ee,{...h,path:[...h.path,y,be]})),U=i.rest?this.process(i.rest,{...h,path:[...h.path,b,...this.target==="openapi-3.0"?[i.items.length]:[]]}):null;this.target==="draft-2020-12"?(g.prefixItems=C,U&&(g.items=U)):this.target==="openapi-3.0"?(g.items={anyOf:C},U&&g.items.anyOf.push(U),g.minItems=C.length,U||(g.maxItems=C.length)):(g.items=C,U&&(g.additionalItems=U));let{minimum:j,maximum:L}=e._zod.bag;typeof j=="number"&&(g.minItems=j),typeof L=="number"&&(g.maxItems=L);break}case"record":{let g=v;g.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(g.propertyNames=this.process(i.keyType,{...h,path:[...h.path,"propertyNames"]})),g.additionalProperties=this.process(i.valueType,{...h,path:[...h.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 g=v,y=Vn(i.entries);y.every(b=>typeof b=="number")&&(g.type="number"),y.every(b=>typeof b=="string")&&(g.type="string"),g.enum=y;break}case"literal":{let g=v,y=[];for(let b of i.values)if(b===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(b))}else y.push(b);if(y.length!==0)if(y.length===1){let b=y[0];g.type=b===null?"null":typeof b,this.target==="draft-4"||this.target==="openapi-3.0"?g.enum=[b]:g.const=b}else y.every(b=>typeof b=="number")&&(g.type="number"),y.every(b=>typeof b=="string")&&(g.type="string"),y.every(b=>typeof b=="boolean")&&(g.type="string"),y.every(b=>b===null)&&(g.type="null"),g.enum=y;break}case"file":{let g=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:C,mime:U}=e._zod.bag;b!==void 0&&(y.minLength=b),C!==void 0&&(y.maxLength=C),U?U.length===1?(y.contentMediaType=U[0],Object.assign(g,y)):g.anyOf=U.map(j=>({...y,contentMediaType:j})):Object.assign(g,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(i.innerType,h);this.target==="openapi-3.0"?(a.ref=i.innerType,v.nullable=!0):v.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"success":{let g=v;g.type="boolean";break}case"default":{this.process(i.innerType,h),a.ref=i.innerType,v.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,h),a.ref=i.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,h),a.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=y.source;break}case"pipe":{let g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,h),a.ref=g;break}case"readonly":{this.process(i.innerType,h),a.ref=i.innerType,v.readOnly=!0;break}case"promise":{this.process(i.innerType,h),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,h),a.ref=g;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 l=this.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),this.io==="input"&&Oe(e)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=d=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(d[0])?.id,b=n.external.uri??(U=>U);if(y)return{ref:b(y)};let C=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=C,{defId:C,ref:`${b("__shared")}#/${h}/${C}`}}if(d[1]===i)return{ref:"#"};let v=`#/${h}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:v+g}},s=d=>{if(d[1].schema.$ref)return;let h=d[1],{ref:f,defId:v}=o(d);h.def={...h.schema},v&&(h.defId=v);let g=h.schema;for(let y in g)delete g[y];g.$ref=f};if(n.cycles==="throw")for(let d of this.seen.entries()){let h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
23
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");let M=v.compile();return(j,L)=>M(f,j,L)},o,s=ri,a=!Zn.jitless,l=a&&xc.value,d=e.catchall,h;r._zod.parse=(f,v)=>{h??(h=n.value);let g=f.value;return s(g)?a&&l&&v?.async===!1&&v.jitless!==!0?(o||(o=i(e.shape)),f=o(f,v),d?Qf([],g,f,v,h,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:r}),f)}});function Uf(r,e,t,n){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let i=r.filter(o=>!Br(o));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(o=>o.issues.map(s=>nt(s,n,Fe())))}),e)}var Ja=x("$ZodUnion",(r,e)=>{Q.init(r,e),ue(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ue(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ue(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ue(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Gn(o.source)).join("|")})$`)}});let t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(i,o)=>{if(t)return n(i,o);let s=!1,a=[];for(let u of e.options){let l=u._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(u=>Uf(u,i,r,o)):Uf(a,i,r,o)}}),sh=x("$ZodDiscriminatedUnion",(r,e)=>{Ja.init(r,e);let t=r._zod.parse;ue(r._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of u)i[a].add(l)}}return i});let n=on(()=>{let i=e.options,o=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 u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});r._zod.parse=(i,o)=>{let s=i.value;if(!ri(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),i)}}),ah=x("$ZodIntersection",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value,o=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>Vf(t,u,l)):Vf(t,o,s)}});function Ad(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(Ir(r)&&Ir(e)){let t=Object.keys(e),n=Object.keys(r).filter(o=>t.indexOf(o)!==-1),i={...r,...e};for(let o of n){let s=Ad(r[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=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 n=0;n<r.length;n++){let i=r[n],o=e[n],s=Ad(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Vf(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Br(r))return r;let n=Ad(e.value,t.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return r.value=n.data,r}var Ya=x("$ZodTuple",(r,e)=>{Q.init(r,e);let t=e.items,n=t.length-[...t].reverse().findIndex(i=>i._zod.optin!=="optional");r._zod.parse=(i,o)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[];if(!e.rest){let l=s.length>t.length,d=s.length<n-1;if(l||d)return i.issues.push({...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:s,inst:r,origin:"array"}),i}let u=-1;for(let l of t){if(u++,u>=s.length&&u>=n)continue;let d=l._zod.run({value:s[u],issues:[]},o);d instanceof Promise?a.push(d.then(h=>La(h,i,u))):La(d,i,u)}if(e.rest){let l=s.slice(t.length);for(let d of l){u++;let h=e.rest._zod.run({value:d,issues:[]},o);h instanceof Promise?a.push(h.then(f=>La(f,i,u))):La(h,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function La(r,e,t){r.issues.length&&e.issues.push(...it(t,r.issues)),e.value[t]=r.value}var uh=x("$ZodRecord",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Ir(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let o=[];if(e.keyType._zod.values){let s=e.keyType._zod.values;t.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let l=e.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&t.issues.push(...it(u,d.issues)),t.value[u]=d.value})):(l.issues.length&&t.issues.push(...it(u,l.issues)),t.value[u]=l.value)}let a;for(let u in i)s.has(u)||(a=a??[],a.push(u));a&&a.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:a})}else{t.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let a=e.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(l=>nt(l,n,Fe())),input:s,path:[s],inst:r}),t.value[a.value]=a.value;continue}let u=e.valueType._zod.run({value:i[s],issues:[]},n);u instanceof Promise?o.push(u.then(l=>{l.issues.length&&t.issues.push(...it(s,l.issues)),t.value[a.value]=l.value})):(u.issues.length&&t.issues.push(...it(s,u.issues)),t.value[a.value]=u.value)}}return o.length?Promise.all(o).then(()=>t):t}}),lh=x("$ZodMap",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),t;let o=[];t.value=new Map;for(let[s,a]of i){let u=e.keyType._zod.run({value:s,issues:[]},n),l=e.valueType._zod.run({value:a,issues:[]},n);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([d,h])=>{jf(d,h,t,s,i,r,n)})):jf(u,l,t,s,i,r,n)}return o.length?Promise.all(o).then(()=>t):t}});function jf(r,e,t,n,i,o,s){r.issues.length&&(Wn.has(typeof n)?t.issues.push(...it(n,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:r.issues.map(a=>nt(a,s,Fe()))})),e.issues.length&&(Wn.has(typeof n)?t.issues.push(...it(n,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:e.issues.map(a=>nt(a,s,Fe()))})),t.value.set(r.value,e.value)}var ch=x("$ZodSet",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Set))return t.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(u=>Lf(u,t))):Lf(a,t)}return o.length?Promise.all(o).then(()=>t):t}});function Lf(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var dh=x("$ZodEnum",(r,e)=>{Q.init(r,e);let t=Hn(e.entries),n=new Set(t);r._zod.values=n,r._zod.pattern=new RegExp(`^(${t.filter(i=>Wn.has(typeof i)).map(i=>typeof i=="string"?Ft(i):i.toString()).join("|")})$`),r._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t,input:s,inst:r}),i}}),hh=x("$ZodLiteral",(r,e)=>{if(Q.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");r._zod.values=new Set(e.values),r._zod.pattern=new RegExp(`^(${e.values.map(t=>typeof t=="string"?Ft(t):t?Ft(t.toString()):String(t)).join("|")})$`),r._zod.parse=(t,n)=>{let i=t.value;return r._zod.values.has(i)||t.issues.push({code:"invalid_value",values:e.values,input:i,inst:r}),t}}),ph=x("$ZodFile",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),t}}),mh=x("$ZodTransform",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Pr(r.constructor.name);let i=e.transform(t.value,t);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(t.value=s,t));if(i instanceof Promise)throw new yt;return t.value=i,t}});function Kf(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var fh=x("$ZodOptional",(r,e)=>{Q.init(r,e),r._zod.optin="optional",r._zod.optout="optional",ue(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ue(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Gn(t.source)})?$`):void 0}),r._zod.parse=(t,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>Kf(o,t.value)):Kf(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}}),gh=x("$ZodNullable",(r,e)=>{Q.init(r,e),ue(r._zod,"optin",()=>e.innerType._zod.optin),ue(r._zod,"optout",()=>e.innerType._zod.optout),ue(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Gn(t.source)}|null)$`):void 0}),ue(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,n)=>t.value===null?t:e.innerType._zod.run(t,n)}),vh=x("$ZodDefault",(r,e)=>{Q.init(r,e),r._zod.optin="optional",ue(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);if(t.value===void 0)return t.value=e.defaultValue,t;let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>Zf(o,e)):Zf(i,e)}});function Zf(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var xh=x("$ZodPrefault",(r,e)=>{Q.init(r,e),r._zod.optin="optional",ue(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,n))}),yh=x("$ZodNonOptional",(r,e)=>{Q.init(r,e),ue(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),r._zod.parse=(t,n)=>{let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>qf(o,r)):qf(i,r)}});function qf(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 bh=x("$ZodSuccess",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Pr("ZodSuccess");let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.issues.length===0,t)):(t.value=i.issues.length===0,t)}}),wh=x("$ZodCatch",(r,e)=>{Q.init(r,e),ue(r._zod,"optin",()=>e.innerType._zod.optin),ue(r._zod,"optout",()=>e.innerType._zod.optout),ue(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(s=>nt(s,n,Fe()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>nt(o,n,Fe()))},input:t.value}),t.issues=[]),t)}}),Ah=x("$ZodNaN",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),$h=x("$ZodPipe",(r,e)=>{Q.init(r,e),ue(r._zod,"values",()=>e.in._zod.values),ue(r._zod,"optin",()=>e.in._zod.optin),ue(r._zod,"optout",()=>e.out._zod.optout),ue(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(s=>Ka(s,e.in,n)):Ka(o,e.in,n)}let i=e.in._zod.run(t,n);return i instanceof Promise?i.then(o=>Ka(o,e.out,n)):Ka(i,e.out,n)}});function Ka(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var oo=x("$ZodCodec",(r,e)=>{Q.init(r,e),ue(r._zod,"values",()=>e.in._zod.values),ue(r._zod,"optin",()=>e.in._zod.optin),ue(r._zod,"optout",()=>e.out._zod.optout),ue(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(t,n);return o instanceof Promise?o.then(s=>Za(s,e,n)):Za(o,e,n)}else{let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(s=>Za(s,e,n)):Za(o,e,n)}}});function Za(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(o=>qa(r,o,e.out,t)):qa(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(o=>qa(r,o,e.in,t)):qa(r,i,e.in,t)}}function qa(r,e,t,n){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},n)}var Eh=x("$ZodReadonly",(r,e)=>{Q.init(r,e),ue(r._zod,"propValues",()=>e.innerType._zod.propValues),ue(r._zod,"values",()=>e.innerType._zod.values),ue(r._zod,"optin",()=>e.innerType._zod.optin),ue(r._zod,"optout",()=>e.innerType._zod.optout),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(Hf):Hf(i)}});function Hf(r){return r.value=Object.freeze(r.value),r}var Sh=x("$ZodTemplateLiteral",(r,e)=>{Q.init(r,e);let t=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;t.push(i.slice(o,s))}else if(n===null||bc.has(typeof n))t.push(Ft(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:r,expected:"template_literal",code:"invalid_type"}),n):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),n)}),Nh=x("$ZodFunction",(r,e)=>(Q.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(...n){let i=r._def.input?Fa(r._def.input,n):n,o=Reflect.apply(t,this,i);return r._def.output?Fa(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(...n){let i=r._def.input?await Ia(r._def.input,n):n,o=await Reflect.apply(t,this,i);return r._def.output?await Ia(r._def.output,o):o}},r._zod.parse=(t,n)=>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 n=r.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Ya({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new n({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let n=r.constructor;return new n({type:"function",input:r._def.input,output:t})},r)),Ph=x("$ZodPromise",(r,e)=>{Q.init(r,e),r._zod.parse=(t,n)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),kh=x("$ZodLazy",(r,e)=>{Q.init(r,e),ue(r._zod,"innerType",()=>e.getter()),ue(r._zod,"pattern",()=>r._zod.innerType._zod.pattern),ue(r._zod,"propValues",()=>r._zod.innerType._zod.propValues),ue(r._zod,"optin",()=>r._zod.innerType._zod.optin??void 0),ue(r._zod,"optout",()=>r._zod.innerType._zod.optout??void 0),r._zod.parse=(t,n)=>r._zod.innerType._zod.run(t,n)}),_h=x("$ZodCustom",(r,e)=>{Ae.init(r,e),Q.init(r,e),r._zod.parse=(t,n)=>t,r._zod.check=t=>{let n=t.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>Gf(o,t,n,r));Gf(i,t,n,r)}});function Gf(r,e,t,n){if(!r){let i={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(sn(i))}}var uo={};Mr(uo,{ar:()=>eg,az:()=>tg,be:()=>ig,bg:()=>ng,ca:()=>og,cs:()=>sg,da:()=>ag,de:()=>ug,en:()=>Qa,eo:()=>lg,es:()=>cg,fa:()=>dg,fi:()=>hg,fr:()=>pg,frCA:()=>mg,he:()=>fg,hu:()=>gg,id:()=>vg,is:()=>xg,it:()=>yg,ja:()=>bg,ka:()=>wg,kh:()=>Ag,km:()=>Xa,ko:()=>$g,lt:()=>Sg,mk:()=>Ng,ms:()=>Pg,nl:()=>kg,no:()=>_g,ota:()=>Fg,pl:()=>Bg,ps:()=>Ig,pt:()=>Dg,ru:()=>Rg,sl:()=>Og,sv:()=>zg,ta:()=>Mg,th:()=>Tg,tr:()=>Ug,ua:()=>Vg,uk:()=>eu,ur:()=>jg,vi:()=>Lg,yo:()=>qg,zhCN:()=>Kg,zhTW:()=>Zg});var by=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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: ${E(i.values,"|")}`;case"too_big":{let o=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"} ${o} ${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"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=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 ${o} ${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 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 "${i.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}`:`${n[o.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":""}: ${E(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 eg(){return{localeError:by()}}var wy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 tg(){return{localeError:wy()}}function rg(r,e,t,n){let i=Math.abs(r),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?t:n}var Ay=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),u=rg(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} ${o}${i.maximum.toString()} ${u}`}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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),u=rg(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} ${o}${i.minimum.toString()} ${u}`}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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 ig(){return{localeError:Ay()}}var $y=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},Ey=()=>{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(n){return r[n]??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 n=>{switch(n.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 ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${$y(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(n.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 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.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 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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 o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function ng(){return{localeError:Ey()}}var Sy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${E(i.values," o ")}`;case"too_big":{let o=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 ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 og(){return{localeError:Sy()}}var Ny=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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: ${E(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 sg(){return{localeError:Ny()}}var Py=()=>{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 n(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},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 s=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${n(s.expected)}, fik ${n(i(s.input))}`;case"invalid_value":return s.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(s.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${E(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",u=t(s.origin),l=n(s.origin);return u?`For stor: forventede ${l??"value"} ${u.verb} ${a} ${s.maximum.toString()} ${u.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",u=t(s.origin),l=n(s.origin);return u?`For lille: forventede ${l} ${u.verb} ${a} ${s.minimum.toString()} ${u.unit}`:`For lille: forventede ${l} 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 ${o[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"}: ${E(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 ag(){return{localeError:Py()}}var ky=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;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: ${n[o.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"}: ${E(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 ug(){return{localeError:ky()}}var _y=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},Fy=()=>{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(n){return r[n]??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",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`Invalid input: expected ${n.expected}, received ${_y(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`Invalid option: expected one of ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${o.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Qa(){return{localeError:Fy()}}var Iy=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},By=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${Iy(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function lg(){return{localeError:By()}}var Dy=()=>{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 n(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},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 s=>{switch(s.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${n(s.expected)}, recibido ${n(i(s.input))}`;case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(s.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${E(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",u=t(s.origin),l=n(s.origin);return u?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${a}${s.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",u=t(s.origin),l=n(s.origin);return u?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${a}${s.minimum.toString()} ${u.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} 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 ${o[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":""}: ${E(s.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n(s.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n(s.origin)}`;default:return"Entrada inv\xE1lida"}}};function cg(){return{localeError:Dy()}}var Cy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;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`:`${n[o.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: ${E(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 dg(){return{localeError:Cy()}}var Ry=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 hg(){return{localeError:Ry()}}var Oy=()=>{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 o=typeof i;switch(o){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 o},n={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 : ${z(i.values[0])} attendu`:`Option invalide : une valeur parmi ${E(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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":""} : ${E(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 pg(){return{localeError:Oy()}}var zy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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":""} : ${E(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 mg(){return{localeError:zy()}}var My=()=>{let r={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(i){return r[i]??null}let t=i=>{let o=typeof i;switch(o){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 o},n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return i=>{switch(i.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${i.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${z(i.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${o.prefix}"`:o.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${o.suffix}"`:o.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${o.includes}"`:o.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${o.pattern}`:`${n[o.format]??i.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}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 ${i.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${i.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${i.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${E(i.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i.origin}`;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.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function fg(){return{localeError:My()}}var Ty=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 gg(){return{localeError:Ty()}}var Uy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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":""}: ${E(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 vg(){return{localeError:Uy()}}var Vy=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},jy=()=>{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(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${Vy(n.input)} \xFEar sem \xE1 a\xF0 vera ${n.expected}`;case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${E(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function xg(){return{localeError:jy()}}var Ly=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Opzione non valida: atteso uno tra ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 yg(){return{localeError:Ly()}}var Ky=()=>{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 o=typeof i;switch(o){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 o},n={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: ${z(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${E(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=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"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=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}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;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${n[o.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":""}: ${E(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 bg(){return{localeError:Ky()}}var Zy=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},qy=()=>{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(n){return r[n]??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 n=>{switch(n.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 ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${Zy(n.input)}`;case"invalid_value":return n.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(n.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 ${E(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${i}${n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.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 ${n.origin} ${o.verb} ${i}${n.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 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.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 ${n.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${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.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 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function wg(){return{localeError:qy()}}var Hy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=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"} ${o} ${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"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=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} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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 ${E(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 Xa(){return{localeError:Hy()}}function Ag(){return Xa()}var Gy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${E(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),u=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${u} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),u=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${u} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;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 ${n[o.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: ${E(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 $g(){return{localeError:Gy()}}var Wy=r=>ao(typeof r,r),ao=(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},so=r=>r.charAt(0).toUpperCase()+r.slice(1);function Eg(r){let e=Math.abs(r),t=e%10,n=e%100;return n>=11&&n<=19||t===0?"many":t===1?"one":"few"}var Jy=()=>{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(n,i,o,s){let a=r[n]??null;return a===null?a:{unit:a.unit[i],verb:a.verb[s][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 n=>{switch(n.code){case"invalid_type":return`Gautas tipas ${Wy(n.input)}, o tik\u0117tasi - ${ao(n.expected)}`;case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${E(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=ao(n.origin),o=e(n.origin,Eg(Number(n.maximum)),n.inclusive??!1,"smaller");if(o?.verb)return`${so(i??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.maximum.toString()} ${o.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${so(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${o?.unit}`}case"too_small":{let i=ao(n.origin),o=e(n.origin,Eg(Number(n.minimum)),n.inclusive??!1,"bigger");if(o?.verb)return`${so(i??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.minimum.toString()} ${o.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${so(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${o?.unit}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${E(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=ao(n.origin);return`${so(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Sg(){return{localeError:Jy()}}var Yy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()}`}case"too_small":{let o=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 ${o}${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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 Ng(){return{localeError:Yy()}}var Qy=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${E(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 Pg(){return{localeError:Qy()}}var Xy=()=>{let r={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(i){return r[i]??null}let t=i=>{let o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;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: ${n[o.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":""}: ${E(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 kg(){return{localeError:Xy()}}var eb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Ugyldig valg: forventet en av ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 _g(){return{localeError:eb()}}var tb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 Fg(){return{localeError:tb()}}var rb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${E(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=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 ${o}${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 ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;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`:`${n[o.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"}: ${E(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 Ig(){return{localeError:rb()}}var ib=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${E(i.values,"|")}`;case"too_big":{let o=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 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=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 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${n[o.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":""}: ${E(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 Bg(){return{localeError:ib()}}var nb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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":""}: ${E(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 Dg(){return{localeError:nb()}}function Cg(r,e,t,n){let i=Math.abs(r),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?t:n}var ob=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),u=Cg(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 ${o}${i.maximum.toString()} ${u}`}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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),u=Cg(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 ${o}${i.minimum.toString()} ${u}`}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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 Rg(){return{localeError:ob()}}var sb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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"}: ${E(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 Og(){return{localeError:sb()}}var ab=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${n[o.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"}: ${E(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 zg(){return{localeError:ab()}}var ub=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=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"} ${o}${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"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=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} ${o}${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} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 Mg(){return{localeError:ub()}}var lb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=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${o} ${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${o} ${i.maximum.toString()}`}case"too_small":{let o=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${o} ${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${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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: ${n[o.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: ${E(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 Tg(){return{localeError:lb()}}var cb=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},db=()=>{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(n){return r[n]??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 n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${cb(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Ug(){return{localeError:db()}}var hb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=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} ${o}${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 ${o}${i.maximum.toString()}`}case"too_small":{let o=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} ${o}${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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 eu(){return{localeError:hb()}}function Vg(){return eu()}var pb=()=>{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 o=typeof i;switch(o){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 o},n={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: ${z(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${E(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${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 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${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 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;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 ${n[o.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":""}: ${E(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 jg(){return{localeError:pb()}}var mb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(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 ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${n[o.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: ${E(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 Lg(){return{localeError:mb()}}var fb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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${n[o.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): ${E(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 Kg(){return{localeError:fb()}}var gb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${E(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${n[o.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${E(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 Zg(){return{localeError:gb()}}var vb=()=>{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 o=typeof i;switch(o){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 o},n={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 ${z(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${E(i.values,"|")}`;case"too_big":{let o=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} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=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} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;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: ${n[o.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: ${E(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 qg(){return{localeError:vb()}}var Fh=Symbol("ZodOutput"),Ih=Symbol("ZodInput"),hn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.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 n={...this.get(t)??{}};delete n.id;let i={...n,...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 tu(){return new hn}var It=tu();function Bh(r,e){return new r({type:"string",...T(e)})}function Dh(r,e){return new r({type:"string",coerce:!0,...T(e)})}function ru(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...T(e)})}function lo(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...T(e)})}function iu(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...T(e)})}function nu(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(e)})}function ou(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(e)})}function su(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(e)})}function co(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...T(e)})}function au(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...T(e)})}function uu(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(e)})}function lu(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...T(e)})}function cu(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(e)})}function du(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...T(e)})}function hu(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...T(e)})}function pu(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(e)})}function mu(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(e)})}function fu(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(e)})}function gu(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(e)})}function vu(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(e)})}function xu(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...T(e)})}function yu(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...T(e)})}function bu(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...T(e)})}function wu(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...T(e)})}var Ch={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Rh(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(e)})}function Oh(r,e){return new r({type:"string",format:"date",check:"string_format",...T(e)})}function zh(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...T(e)})}function Mh(r,e){return new r({type:"string",format:"duration",check:"string_format",...T(e)})}function Th(r,e){return new r({type:"number",checks:[],...T(e)})}function Uh(r,e){return new r({type:"number",coerce:!0,checks:[],...T(e)})}function Vh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...T(e)})}function jh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...T(e)})}function Lh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...T(e)})}function Kh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...T(e)})}function Zh(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...T(e)})}function qh(r,e){return new r({type:"boolean",...T(e)})}function Hh(r,e){return new r({type:"boolean",coerce:!0,...T(e)})}function Gh(r,e){return new r({type:"bigint",...T(e)})}function Wh(r,e){return new r({type:"bigint",coerce:!0,...T(e)})}function Jh(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(e)})}function Yh(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(e)})}function Qh(r,e){return new r({type:"symbol",...T(e)})}function Xh(r,e){return new r({type:"undefined",...T(e)})}function ep(r,e){return new r({type:"null",...T(e)})}function tp(r){return new r({type:"any"})}function rp(r){return new r({type:"unknown"})}function ip(r,e){return new r({type:"never",...T(e)})}function np(r,e){return new r({type:"void",...T(e)})}function op(r,e){return new r({type:"date",...T(e)})}function sp(r,e){return new r({type:"date",coerce:!0,...T(e)})}function ap(r,e){return new r({type:"nan",...T(e)})}function qt(r,e){return new Va({check:"less_than",...T(e),value:r,inclusive:!1})}function pt(r,e){return new Va({check:"less_than",...T(e),value:r,inclusive:!0})}function Ht(r,e){return new ja({check:"greater_than",...T(e),value:r,inclusive:!1})}function Xe(r,e){return new ja({check:"greater_than",...T(e),value:r,inclusive:!0})}function up(r){return Ht(0,r)}function lp(r){return qt(0,r)}function cp(r){return pt(0,r)}function dp(r){return Xe(0,r)}function oi(r,e){return new id({check:"multiple_of",...T(e),value:r})}function pn(r,e){return new sd({check:"max_size",...T(e),maximum:r})}function si(r,e){return new ad({check:"min_size",...T(e),minimum:r})}function ho(r,e){return new ud({check:"size_equals",...T(e),size:r})}function mn(r,e){return new ld({check:"max_length",...T(e),maximum:r})}function Dr(r,e){return new cd({check:"min_length",...T(e),minimum:r})}function fn(r,e){return new dd({check:"length_equals",...T(e),length:r})}function po(r,e){return new hd({check:"string_format",format:"regex",...T(e),pattern:r})}function mo(r){return new pd({check:"string_format",format:"lowercase",...T(r)})}function fo(r){return new md({check:"string_format",format:"uppercase",...T(r)})}function go(r,e){return new fd({check:"string_format",format:"includes",...T(e),includes:r})}function vo(r,e){return new gd({check:"string_format",format:"starts_with",...T(e),prefix:r})}function xo(r,e){return new vd({check:"string_format",format:"ends_with",...T(e),suffix:r})}function hp(r,e,t){return new xd({check:"property",property:r,schema:e,...T(t)})}function yo(r,e){return new yd({check:"mime_type",mime:r,...T(e)})}function Gt(r){return new bd({check:"overwrite",tx:r})}function bo(r){return Gt(e=>e.normalize(r))}function wo(){return Gt(r=>r.trim())}function Ao(){return Gt(r=>r.toLowerCase())}function $o(){return Gt(r=>r.toUpperCase())}function pp(r,e,t){return new r({type:"array",element:e,...T(t)})}function xb(r,e,t){return new r({type:"union",options:e,...T(t)})}function yb(r,e,t,n){return new r({type:"union",options:t,discriminator:e,...T(n)})}function bb(r,e,t){return new r({type:"intersection",left:e,right:t})}function wb(r,e,t,n){let i=t instanceof Q,o=i?n:t,s=i?t:null;return new r({type:"tuple",items:e,rest:s,...T(o)})}function Ab(r,e,t,n){return new r({type:"record",keyType:e,valueType:t,...T(n)})}function $b(r,e,t,n){return new r({type:"map",keyType:e,valueType:t,...T(n)})}function Eb(r,e,t){return new r({type:"set",valueType:e,...T(t)})}function Sb(r,e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:n,...T(t)})}function Nb(r,e,t){return new r({type:"enum",entries:e,...T(t)})}function Pb(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}function mp(r,e){return new r({type:"file",...T(e)})}function kb(r,e){return new r({type:"transform",transform:e})}function _b(r,e){return new r({type:"optional",innerType:e})}function Fb(r,e){return new r({type:"nullable",innerType:e})}function Ib(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yc(t)}})}function Bb(r,e,t){return new r({type:"nonoptional",innerType:e,...T(t)})}function Db(r,e){return new r({type:"success",innerType:e})}function Cb(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Rb(r,e,t){return new r({type:"pipe",in:e,out:t})}function Ob(r,e){return new r({type:"readonly",innerType:e})}function zb(r,e,t){return new r({type:"template_literal",parts:e,...T(t)})}function Mb(r,e){return new r({type:"lazy",getter:e})}function Tb(r,e){return new r({type:"promise",innerType:e})}function fp(r,e,t){let n=T(t);return n.abort??(n.abort=!0),new r({type:"custom",check:"custom",fn:e,...n})}function gp(r,e,t){return new r({type:"custom",check:"custom",fn:e,...T(t)})}function vp(r){let e=Hg(t=>(t.addIssue=n=>{if(typeof n=="string")t.issues.push(sn(n,t.value,e._zod.def));else{let i=n;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(sn(i))}},r(t.value,t)));return e}function Hg(r,e){let t=new Ae({check:"custom",...T(e)});return t._zod.check=r,t}function xp(r,e){let t=T(e),n=t.truthy??["true","1","yes","on","y","enabled"],i=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(n=n.map(v=>typeof v=="string"?v.toLowerCase():v),i=i.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(n),s=new Set(i),a=r.Codec??oo,u=r.Boolean??no,l=r.String??ni,d=new l({type:"string",error:t.error}),h=new u({type:"boolean",error:t.error}),f=new a({type:"pipe",in:d,out:h,transform:((v,g)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:g.value,inst:f,continue:!1}),{})}),reverseTransform:((v,g)=>v===!0?n[0]||"true":i[0]||"false"),error:t.error});return f}function gn(r,e,t,n={}){let i=T(n),o={...T(n),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:a=>t.test(a),...i};return t instanceof RegExp&&(o.pattern=t),new r(o)}var Eo=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??It,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 n;let i=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(e);if(s)return s.count++,t.schemaPath.includes(e)&&(s.cycle=t.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,a);let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let h={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)a.ref=f,this.process(f,h),this.seen.get(f).isParent=!0;else{let v=a.schema;switch(i.type){case"string":{let g=v;g.type="string";let{minimum:y,maximum:b,format:R,patterns:M,contentEncoding:j}=e._zod.bag;if(typeof y=="number"&&(g.minLength=y),typeof b=="number"&&(g.maxLength=b),R&&(g.format=o[R]??R,g.format===""&&delete g.format),j&&(g.contentEncoding=j),M&&M.size>0){let L=[...M];L.length===1?g.pattern=L[0].source:L.length>1&&(a.schema.allOf=[...L.map(ee=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:ee.source}))])}break}case"number":{let g=v,{minimum:y,maximum:b,format:R,multipleOf:M,exclusiveMaximum:j,exclusiveMinimum:L}=e._zod.bag;typeof R=="string"&&R.includes("int")?g.type="integer":g.type="number",typeof L=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.minimum=L,g.exclusiveMinimum=!0):g.exclusiveMinimum=L),typeof y=="number"&&(g.minimum=y,typeof L=="number"&&this.target!=="draft-4"&&(L>=y?delete g.minimum:delete g.exclusiveMinimum)),typeof j=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.maximum=j,g.exclusiveMaximum=!0):g.exclusiveMaximum=j),typeof b=="number"&&(g.maximum=b,typeof j=="number"&&this.target!=="draft-4"&&(j<=b?delete g.maximum:delete g.exclusiveMaximum)),typeof M=="number"&&(g.multipleOf=M);break}case"boolean":{let g=v;g.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 g=v,{minimum:y,maximum:b}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof b=="number"&&(g.maxItems=b),g.type="array",g.items=this.process(i.element,{...h,path:[...h.path,"items"]});break}case"object":{let g=v;g.type="object",g.properties={};let y=i.shape;for(let M in y)g.properties[M]=this.process(y[M],{...h,path:[...h.path,"properties",M]});let b=new Set(Object.keys(y)),R=new Set([...b].filter(M=>{let j=i.shape[M]._zod;return this.io==="input"?j.optin===void 0:j.optout===void 0}));R.size>0&&(g.required=Array.from(R)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=v,y=i.options.map((b,R)=>this.process(b,{...h,path:[...h.path,"anyOf",R]}));g.anyOf=y;break}case"intersection":{let g=v,y=this.process(i.left,{...h,path:[...h.path,"allOf",0]}),b=this.process(i.right,{...h,path:[...h.path,"allOf",1]}),R=j=>"allOf"in j&&Object.keys(j).length===1,M=[...R(y)?y.allOf:[y],...R(b)?b.allOf:[b]];g.allOf=M;break}case"tuple":{let g=v;g.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",b=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",R=i.items.map((ee,we)=>this.process(ee,{...h,path:[...h.path,y,we]})),M=i.rest?this.process(i.rest,{...h,path:[...h.path,b,...this.target==="openapi-3.0"?[i.items.length]:[]]}):null;this.target==="draft-2020-12"?(g.prefixItems=R,M&&(g.items=M)):this.target==="openapi-3.0"?(g.items={anyOf:R},M&&g.items.anyOf.push(M),g.minItems=R.length,M||(g.maxItems=R.length)):(g.items=R,M&&(g.additionalItems=M));let{minimum:j,maximum:L}=e._zod.bag;typeof j=="number"&&(g.minItems=j),typeof L=="number"&&(g.maxItems=L);break}case"record":{let g=v;g.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(g.propertyNames=this.process(i.keyType,{...h,path:[...h.path,"propertyNames"]})),g.additionalProperties=this.process(i.valueType,{...h,path:[...h.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 g=v,y=Hn(i.entries);y.every(b=>typeof b=="number")&&(g.type="number"),y.every(b=>typeof b=="string")&&(g.type="string"),g.enum=y;break}case"literal":{let g=v,y=[];for(let b of i.values)if(b===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(b))}else y.push(b);if(y.length!==0)if(y.length===1){let b=y[0];g.type=b===null?"null":typeof b,this.target==="draft-4"||this.target==="openapi-3.0"?g.enum=[b]:g.const=b}else y.every(b=>typeof b=="number")&&(g.type="number"),y.every(b=>typeof b=="string")&&(g.type="string"),y.every(b=>typeof b=="boolean")&&(g.type="string"),y.every(b=>b===null)&&(g.type="null"),g.enum=y;break}case"file":{let g=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:R,mime:M}=e._zod.bag;b!==void 0&&(y.minLength=b),R!==void 0&&(y.maxLength=R),M?M.length===1?(y.contentMediaType=M[0],Object.assign(g,y)):g.anyOf=M.map(j=>({...y,contentMediaType:j})):Object.assign(g,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(i.innerType,h);this.target==="openapi-3.0"?(a.ref=i.innerType,v.nullable=!0):v.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"success":{let g=v;g.type="boolean";break}case"default":{this.process(i.innerType,h),a.ref=i.innerType,v.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,h),a.ref=i.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,h),a.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=y.source;break}case"pipe":{let g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,h),a.ref=g;break}case"readonly":{this.process(i.innerType,h),a.ref=i.innerType,v.readOnly=!0;break}case"promise":{this.process(i.innerType,h),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,h),a.ref=g;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 l=this.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),this.io==="input"&&Re(e)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=d=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(d[0])?.id,b=n.external.uri??(M=>M);if(y)return{ref:b(y)};let R=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=R,{defId:R,ref:`${b("__shared")}#/${h}/${R}`}}if(d[1]===i)return{ref:"#"};let v=`#/${h}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:v+g}},s=d=>{if(d[1].schema.$ref)return;let h=d[1],{ref:f,defId:v}=o(d);h.def={...h.schema},v&&(h.defId=v);let g=h.schema;for(let y in g)delete g[y];g.$ref=f};if(n.cycles==="throw")for(let d of this.seen.entries()){let h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
24
24
 
25
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let h=d[1];if(e===d[0]){s(d);continue}if(n.external){let v=n.external.registry.get(d[0])?.id;if(e!==d[0]&&v){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(h.cycle){s(d);continue}if(h.count>1&&n.reused==="ref"){s(d);continue}}let a=(d,h)=>{let f=this.seen.get(d),v=f.def??f.schema,g={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){a(y,h);let b=this.seen.get(y).schema;b.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(b)):(Object.assign(v,b),Object.assign(v,g))}f.isParent||this.override({zodSchema:d,jsonSchema:v,path:f.path??[]})};for(let d of[...this.seen.entries()].reverse())a(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?u.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let d=n.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(d)}Object.assign(u,i.def);let l=n.external?.defs??{};for(let d of this.seen.entries()){let h=d[1];h.def&&h.defId&&(l[h.defId]=h.def)}n.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function Gh(r,e){if(r instanceof un){let n=new xo(e),i={};for(let a of r._idmap.entries()){let[u,l]=a;n.process(l)}let o={},s={registry:r,uri:e?.uri,defs:i};for(let a of r._idmap.entries()){let[u,l]=a;o[u]=n.emit(l,{...e,external:s})}if(Object.keys(i).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[a]:i}}return{schemas:o}}let t=new xo(e);return t.process(r),t.emit(r,e)}function Oe(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Oe(i.element,t);case"object":{for(let o in i.shape)if(Oe(i.shape[o],t))return!0;return!1}case"union":{for(let o of i.options)if(Oe(o,t))return!0;return!1}case"intersection":return Oe(i.left,t)||Oe(i.right,t);case"tuple":{for(let o of i.items)if(Oe(o,t))return!0;return!!(i.rest&&Oe(i.rest,t))}case"record":return Oe(i.keyType,t)||Oe(i.valueType,t);case"map":return Oe(i.keyType,t)||Oe(i.valueType,t);case"set":return Oe(i.valueType,t);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Oe(i.innerType,t);case"lazy":return Oe(i.getter(),t);case"default":return Oe(i.innerType,t);case"prefault":return Oe(i.innerType,t);case"custom":return!1;case"transform":return!0;case"pipe":return Oe(i.in,t)||Oe(i.out,t);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${i.type}`)}var bg={};var pu={};zr(pu,{ZodISODate:()=>cu,ZodISODateTime:()=>lu,ZodISODuration:()=>hu,ZodISOTime:()=>du,date:()=>Jh,datetime:()=>Wh,duration:()=>Xh,time:()=>Yh});var lu=x("ZodISODateTime",(r,e)=>{ld.init(r,e),ye.init(r,e)});function Wh(r){return ch(lu,r)}var cu=x("ZodISODate",(r,e)=>{cd.init(r,e),ye.init(r,e)});function Jh(r){return dh(cu,r)}var du=x("ZodISOTime",(r,e)=>{dd.init(r,e),ye.init(r,e)});function Yh(r){return hh(du,r)}var hu=x("ZodISODuration",(r,e)=>{hd.init(r,e),ye.init(r,e)});function Xh(r){return ph(hu,r)}var Ag=(r,e)=>{qn.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Gn(r,t)},flatten:{value:t=>Hn(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,Qi,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,Qi,2)}},isEmpty:{get(){return r.issues.length===0}}})},cb=x("ZodError",Ag),Xe=x("ZodError",Ag,{Parent:Error});var Qh=rn(Xe),ep=nn(Xe),tp=on(Xe),rp=sn(Xe),ip=ya(Xe),np=ba(Xe),op=wa(Xe),sp=Aa(Xe),ap=$a(Xe),up=Ea(Xe),lp=Sa(Xe),cp=Na(Xe);var re=x("ZodType",(r,e)=>(Y.init(r,e),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(M.mergeDefs(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),r.clone=(t,n)=>Ge(r,t,n),r.brand=()=>r,r.register=((t,n)=>(t.add(r,n),r)),r.parse=(t,n)=>Qh(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>tp(r,t,n),r.parseAsync=async(t,n)=>ep(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>rp(r,t,n),r.spa=r.safeParseAsync,r.encode=(t,n)=>ip(r,t,n),r.decode=(t,n)=>np(r,t,n),r.encodeAsync=async(t,n)=>op(r,t,n),r.decodeAsync=async(t,n)=>sp(r,t,n),r.safeEncode=(t,n)=>ap(r,t,n),r.safeDecode=(t,n)=>up(r,t,n),r.safeEncodeAsync=async(t,n)=>lp(r,t,n),r.safeDecodeAsync=async(t,n)=>cp(r,t,n),r.refine=(t,n)=>r.check(uv(t,n)),r.superRefine=t=>r.check(lv(t)),r.overwrite=t=>r.check(Ht(t)),r.optional=()=>fu(r),r.nullable=()=>gu(r),r.nullish=()=>fu(gu(r)),r.nonoptional=t=>Jg(r,t),r.array=()=>bu(r),r.or=t=>Op([r,t]),r.and=t=>Rg(r,t),r.transform=t=>vu(r,Rp(t)),r.default=t=>Hg(r,t),r.prefault=t=>Wg(r,t),r.catch=t=>Qg(r,t),r.pipe=t=>vu(r,t),r.readonly=()=>rv(r),r.describe=t=>{let n=r.clone();return It.add(n,{description:t}),n},Object.defineProperty(r,"description",{get(){return It.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return It.get(r);let n=r.clone();return It.add(n,t[0]),n},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),pp=x("_ZodString",(r,e)=>{oi.init(r,e),re.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=(...n)=>r.check(so(...n)),r.includes=(...n)=>r.check(lo(...n)),r.startsWith=(...n)=>r.check(co(...n)),r.endsWith=(...n)=>r.check(ho(...n)),r.min=(...n)=>r.check(Br(...n)),r.max=(...n)=>r.check(cn(...n)),r.length=(...n)=>r.check(dn(...n)),r.nonempty=(...n)=>r.check(Br(1,...n)),r.lowercase=n=>r.check(ao(n)),r.uppercase=n=>r.check(uo(n)),r.trim=()=>r.check(fo()),r.normalize=(...n)=>r.check(mo(...n)),r.toLowerCase=()=>r.check(go()),r.toUpperCase=()=>r.check(vo())}),bo=x("ZodString",(r,e)=>{oi.init(r,e),pp.init(r,e),r.email=t=>r.check(La(mp,t)),r.url=t=>r.check(no(xu,t)),r.jwt=t=>r.check(uu(kp,t)),r.emoji=t=>r.check(Ga(fp,t)),r.guid=t=>r.check(io(mu,t)),r.uuid=t=>r.check(Ka(Wt,t)),r.uuidv4=t=>r.check(Za(Wt,t)),r.uuidv6=t=>r.check(qa(Wt,t)),r.uuidv7=t=>r.check(Ha(Wt,t)),r.nanoid=t=>r.check(Wa(gp,t)),r.guid=t=>r.check(io(mu,t)),r.cuid=t=>r.check(Ja(vp,t)),r.cuid2=t=>r.check(Ya(xp,t)),r.ulid=t=>r.check(Xa(yp,t)),r.base64=t=>r.check(ou(Np,t)),r.base64url=t=>r.check(su(Pp,t)),r.xid=t=>r.check(Qa(bp,t)),r.ksuid=t=>r.check(eu(wp,t)),r.ipv4=t=>r.check(tu(Ap,t)),r.ipv6=t=>r.check(ru($p,t)),r.cidrv4=t=>r.check(iu(Ep,t)),r.cidrv6=t=>r.check(nu(Sp,t)),r.e164=t=>r.check(au(_p,t)),r.datetime=t=>r.check(Wh(t)),r.date=t=>r.check(Jh(t)),r.time=t=>r.check(Yh(t)),r.duration=t=>r.check(Xh(t))});function dp(r){return ah(bo,r)}var ye=x("ZodStringFormat",(r,e)=>{ge.init(r,e),pp.init(r,e)}),mp=x("ZodEmail",(r,e)=>{ed.init(r,e),ye.init(r,e)});function hb(r){return La(mp,r)}var mu=x("ZodGUID",(r,e)=>{Xc.init(r,e),ye.init(r,e)});function pb(r){return io(mu,r)}var Wt=x("ZodUUID",(r,e)=>{Qc.init(r,e),ye.init(r,e)});function mb(r){return Ka(Wt,r)}function fb(r){return Za(Wt,r)}function gb(r){return qa(Wt,r)}function vb(r){return Ha(Wt,r)}var xu=x("ZodURL",(r,e)=>{td.init(r,e),ye.init(r,e)});function xb(r){return no(xu,r)}function yb(r){return no(xu,{protocol:/^https?$/,hostname:ct.domain,...M.normalizeParams(r)})}var fp=x("ZodEmoji",(r,e)=>{rd.init(r,e),ye.init(r,e)});function bb(r){return Ga(fp,r)}var gp=x("ZodNanoID",(r,e)=>{id.init(r,e),ye.init(r,e)});function wb(r){return Wa(gp,r)}var vp=x("ZodCUID",(r,e)=>{nd.init(r,e),ye.init(r,e)});function Ab(r){return Ja(vp,r)}var xp=x("ZodCUID2",(r,e)=>{od.init(r,e),ye.init(r,e)});function $b(r){return Ya(xp,r)}var yp=x("ZodULID",(r,e)=>{sd.init(r,e),ye.init(r,e)});function Eb(r){return Xa(yp,r)}var bp=x("ZodXID",(r,e)=>{ad.init(r,e),ye.init(r,e)});function Sb(r){return Qa(bp,r)}var wp=x("ZodKSUID",(r,e)=>{ud.init(r,e),ye.init(r,e)});function Nb(r){return eu(wp,r)}var Ap=x("ZodIPv4",(r,e)=>{pd.init(r,e),ye.init(r,e)});function Pb(r){return tu(Ap,r)}var $p=x("ZodIPv6",(r,e)=>{md.init(r,e),ye.init(r,e)});function _b(r){return ru($p,r)}var Ep=x("ZodCIDRv4",(r,e)=>{fd.init(r,e),ye.init(r,e)});function kb(r){return iu(Ep,r)}var Sp=x("ZodCIDRv6",(r,e)=>{gd.init(r,e),ye.init(r,e)});function Ib(r){return nu(Sp,r)}var Np=x("ZodBase64",(r,e)=>{xd.init(r,e),ye.init(r,e)});function Fb(r){return ou(Np,r)}var Pp=x("ZodBase64URL",(r,e)=>{yd.init(r,e),ye.init(r,e)});function Bb(r){return su(Pp,r)}var _p=x("ZodE164",(r,e)=>{bd.init(r,e),ye.init(r,e)});function Ob(r){return au(_p,r)}var kp=x("ZodJWT",(r,e)=>{wd.init(r,e),ye.init(r,e)});function Cb(r){return uu(kp,r)}var wo=x("ZodCustomStringFormat",(r,e)=>{Ad.init(r,e),ye.init(r,e)});function Db(r,e,t={}){return hn(wo,r,e,t)}function Rb(r){return hn(wo,"hostname",ct.hostname,r)}function zb(r){return hn(wo,"hex",ct.hex,r)}function Tb(r,e){let t=e?.enc??"hex",n=`${r}_${t}`,i=ct[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return hn(wo,n,i,e)}var Ao=x("ZodNumber",(r,e)=>{Da.init(r,e),re.init(r,e),r.gt=(n,i)=>r.check(qt(n,i)),r.gte=(n,i)=>r.check(Ye(n,i)),r.min=(n,i)=>r.check(Ye(n,i)),r.lt=(n,i)=>r.check(Zt(n,i)),r.lte=(n,i)=>r.check(dt(n,i)),r.max=(n,i)=>r.check(dt(n,i)),r.int=n=>r.check(hp(n)),r.safe=n=>r.check(hp(n)),r.positive=n=>r.check(qt(0,n)),r.nonnegative=n=>r.check(Ye(0,n)),r.negative=n=>r.check(Zt(0,n)),r.nonpositive=n=>r.check(dt(0,n)),r.multipleOf=(n,i)=>r.check(si(n,i)),r.step=(n,i)=>r.check(si(n,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 $g(r){return mh(Ao,r)}var mn=x("ZodNumberFormat",(r,e)=>{$d.init(r,e),Ao.init(r,e)});function hp(r){return gh(mn,r)}function Mb(r){return vh(mn,r)}function Ub(r){return xh(mn,r)}function Vb(r){return yh(mn,r)}function jb(r){return bh(mn,r)}var $o=x("ZodBoolean",(r,e)=>{Xn.init(r,e),re.init(r,e)});function Eg(r){return wh($o,r)}var Eo=x("ZodBigInt",(r,e)=>{Ra.init(r,e),re.init(r,e),r.gte=(n,i)=>r.check(Ye(n,i)),r.min=(n,i)=>r.check(Ye(n,i)),r.gt=(n,i)=>r.check(qt(n,i)),r.gte=(n,i)=>r.check(Ye(n,i)),r.min=(n,i)=>r.check(Ye(n,i)),r.lt=(n,i)=>r.check(Zt(n,i)),r.lte=(n,i)=>r.check(dt(n,i)),r.max=(n,i)=>r.check(dt(n,i)),r.positive=n=>r.check(qt(BigInt(0),n)),r.negative=n=>r.check(Zt(BigInt(0),n)),r.nonpositive=n=>r.check(dt(BigInt(0),n)),r.nonnegative=n=>r.check(Ye(BigInt(0),n)),r.multipleOf=(n,i)=>r.check(si(n,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function Lb(r){return $h(Eo,r)}var Ip=x("ZodBigIntFormat",(r,e)=>{Ed.init(r,e),Eo.init(r,e)});function Kb(r){return Sh(Ip,r)}function Zb(r){return Nh(Ip,r)}var Sg=x("ZodSymbol",(r,e)=>{Sd.init(r,e),re.init(r,e)});function qb(r){return Ph(Sg,r)}var Ng=x("ZodUndefined",(r,e)=>{Nd.init(r,e),re.init(r,e)});function Hb(r){return _h(Ng,r)}var Pg=x("ZodNull",(r,e)=>{Pd.init(r,e),re.init(r,e)});function _g(r){return kh(Pg,r)}var kg=x("ZodAny",(r,e)=>{_d.init(r,e),re.init(r,e)});function Gb(){return Ih(kg)}var Ig=x("ZodUnknown",(r,e)=>{kd.init(r,e),re.init(r,e)});function pn(){return Fh(Ig)}var Fg=x("ZodNever",(r,e)=>{Id.init(r,e),re.init(r,e)});function Fp(r){return Bh(Fg,r)}var Bg=x("ZodVoid",(r,e)=>{Fd.init(r,e),re.init(r,e)});function Wb(r){return Oh(Bg,r)}var yu=x("ZodDate",(r,e)=>{Bd.init(r,e),re.init(r,e),r.min=(n,i)=>r.check(Ye(n,i)),r.max=(n,i)=>r.check(dt(n,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 Jb(r){return Ch(yu,r)}var Og=x("ZodArray",(r,e)=>{Od.init(r,e),re.init(r,e),r.element=e.element,r.min=(t,n)=>r.check(Br(t,n)),r.nonempty=t=>r.check(Br(1,t)),r.max=(t,n)=>r.check(cn(t,n)),r.length=(t,n)=>r.check(dn(t,n)),r.unwrap=()=>r.element});function bu(r,e){return jh(Og,r,e)}function Yb(r){let e=r._zod.def.shape;return Dp(Object.keys(e))}var wu=x("ZodObject",(r,e)=>{Cd.init(r,e),re.init(r,e),M.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>Dp(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:pn()}),r.loose=()=>r.clone({...r._zod.def,catchall:pn()}),r.strict=()=>r.clone({...r._zod.def,catchall:Fp()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>M.extend(r,t),r.safeExtend=t=>M.safeExtend(r,t),r.merge=t=>M.merge(r,t),r.pick=t=>M.pick(r,t),r.omit=t=>M.omit(r,t),r.partial=(...t)=>M.partial(zp,r,t[0]),r.required=(...t)=>M.required(Tp,r,t[0])});function Xb(r,e){let t={type:"object",shape:r??{},...M.normalizeParams(e)};return new wu(t)}function Qb(r,e){return new wu({type:"object",shape:r,catchall:Fp(),...M.normalizeParams(e)})}function e0(r,e){return new wu({type:"object",shape:r,catchall:pn(),...M.normalizeParams(e)})}var Bp=x("ZodUnion",(r,e)=>{za.init(r,e),re.init(r,e),r.options=e.options});function Op(r,e){return new Bp({type:"union",options:r,...M.normalizeParams(e)})}var Cg=x("ZodDiscriminatedUnion",(r,e)=>{Bp.init(r,e),Dd.init(r,e)});function t0(r,e,t){return new Cg({type:"union",options:e,discriminator:r,...M.normalizeParams(t)})}var Dg=x("ZodIntersection",(r,e)=>{Rd.init(r,e),re.init(r,e)});function Rg(r,e){return new Dg({type:"intersection",left:r,right:e})}var zg=x("ZodTuple",(r,e)=>{Ta.init(r,e),re.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function Tg(r,e,t){let n=e instanceof Y,i=n?t:e,o=n?e:null;return new zg({type:"tuple",items:r,rest:o,...M.normalizeParams(i)})}var Cp=x("ZodRecord",(r,e)=>{zd.init(r,e),re.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function Mg(r,e,t){return new Cp({type:"record",keyType:r,valueType:e,...M.normalizeParams(t)})}function r0(r,e,t){let n=Ge(r);return n._zod.values=void 0,new Cp({type:"record",keyType:n,valueType:e,...M.normalizeParams(t)})}var Ug=x("ZodMap",(r,e)=>{Td.init(r,e),re.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function i0(r,e,t){return new Ug({type:"map",keyType:r,valueType:e,...M.normalizeParams(t)})}var Vg=x("ZodSet",(r,e)=>{Md.init(r,e),re.init(r,e),r.min=(...t)=>r.check(ai(...t)),r.nonempty=t=>r.check(ai(1,t)),r.max=(...t)=>r.check(ln(...t)),r.size=(...t)=>r.check(oo(...t))});function n0(r,e){return new Vg({type:"set",valueType:r,...M.normalizeParams(e)})}var yo=x("ZodEnum",(r,e)=>{Ud.init(r,e),re.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(n,i)=>{let o={};for(let s of n)if(t.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new yo({...e,checks:[],...M.normalizeParams(i),entries:o})},r.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(t.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new yo({...e,checks:[],...M.normalizeParams(i),entries:o})}});function Dp(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(n=>[n,n])):r;return new yo({type:"enum",entries:t,...M.normalizeParams(e)})}function o0(r,e){return new yo({type:"enum",entries:r,...M.normalizeParams(e)})}var jg=x("ZodLiteral",(r,e)=>{Vd.init(r,e),re.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 s0(r,e){return new jg({type:"literal",values:Array.isArray(r)?r:[r],...M.normalizeParams(e)})}var Lg=x("ZodFile",(r,e)=>{jd.init(r,e),re.init(r,e),r.min=(t,n)=>r.check(ai(t,n)),r.max=(t,n)=>r.check(ln(t,n)),r.mime=(t,n)=>r.check(po(Array.isArray(t)?t:[t],n))});function a0(r){return Lh(Lg,r)}var Kg=x("ZodTransform",(r,e)=>{Ld.init(r,e),re.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Nr(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(M.issue(o,t.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=r),t.issues.push(M.issue(s))}};let i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>(t.value=o,t)):(t.value=i,t)}});function Rp(r){return new Kg({type:"transform",transform:r})}var zp=x("ZodOptional",(r,e)=>{Kd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function fu(r){return new zp({type:"optional",innerType:r})}var Zg=x("ZodNullable",(r,e)=>{Zd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function gu(r){return new Zg({type:"nullable",innerType:r})}function u0(r){return fu(gu(r))}var qg=x("ZodDefault",(r,e)=>{qd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function Hg(r,e){return new qg({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}var Gg=x("ZodPrefault",(r,e)=>{Hd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Wg(r,e){return new Gg({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}var Tp=x("ZodNonOptional",(r,e)=>{Gd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Jg(r,e){return new Tp({type:"nonoptional",innerType:r,...M.normalizeParams(e)})}var Yg=x("ZodSuccess",(r,e)=>{Wd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function l0(r){return new Yg({type:"success",innerType:r})}var Xg=x("ZodCatch",(r,e)=>{Jd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function Qg(r,e){return new Xg({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var ev=x("ZodNaN",(r,e)=>{Yd.init(r,e),re.init(r,e)});function c0(r){return Rh(ev,r)}var Mp=x("ZodPipe",(r,e)=>{Xd.init(r,e),re.init(r,e),r.in=e.in,r.out=e.out});function vu(r,e){return new Mp({type:"pipe",in:r,out:e})}var Up=x("ZodCodec",(r,e)=>{Mp.init(r,e),Qn.init(r,e)});function d0(r,e,t){return new Up({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var tv=x("ZodReadonly",(r,e)=>{Qd.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function rv(r){return new tv({type:"readonly",innerType:r})}var iv=x("ZodTemplateLiteral",(r,e)=>{eh.init(r,e),re.init(r,e)});function h0(r,e){return new iv({type:"template_literal",parts:r,...M.normalizeParams(e)})}var nv=x("ZodLazy",(r,e)=>{ih.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.getter()});function ov(r){return new nv({type:"lazy",getter:r})}var sv=x("ZodPromise",(r,e)=>{rh.init(r,e),re.init(r,e),r.unwrap=()=>r._zod.def.innerType});function p0(r){return new sv({type:"promise",innerType:r})}var av=x("ZodFunction",(r,e)=>{th.init(r,e),re.init(r,e)});function m0(r){return new av({type:"function",input:Array.isArray(r?.input)?Tg(r?.input):r?.input??bu(pn()),output:r?.output??pn()})}var Au=x("ZodCustom",(r,e)=>{nh.init(r,e),re.init(r,e)});function f0(r){let e=new Ae({check:"custom"});return e._zod.check=r,e}function g0(r,e){return Kh(Au,r??(()=>!0),e)}function uv(r,e={}){return Zh(Au,r,e)}function lv(r){return qh(r)}function v0(r,e={error:`Input not instance of ${r.name}`}){let t=new Au({type:"custom",check:"custom",fn:n=>n instanceof r,abort:!0,...M.normalizeParams(e)});return t._zod.bag.Class=r,t}var x0=(...r)=>Hh({Codec:Up,Boolean:$o,String:bo},...r);function y0(r){let e=ov(()=>Op([dp(r),$g(),Eg(),_g(),bu(e),Mg(dp(),e)]));return e}function b0(r,e){return vu(Rp(r),e)}var w0={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 A0(r){_e({customError:r})}function $0(){return _e().customError}var Vp;Vp||(Vp={});var jp={};zr(jp,{bigint:()=>P0,boolean:()=>N0,date:()=>_0,number:()=>S0,string:()=>E0});function E0(r){return uh(bo,r)}function S0(r){return fh(Ao,r)}function N0(r){return Ah($o,r)}function P0(r){return Eh(Eo,r)}function _0(r){return Dh(yu,r)}_e(Ma());var cv=Ie.object({name:Ie.string(),bpm:Ie.number(),duration:Ie.number(),sample_rate:Ie.number(),origin:Ie.enum(["openDAW","recording","import"])});var c6=cv.extend({uuid:E.zType(Ie)});var dv=Ie.object({name:Ie.string(),size:Ie.number().int(),url:Ie.string(),license:Ie.string(),origin:Ie.enum(["openDAW","import"])});var _6=dv.extend({uuid:E.zType(Ie)});var hv;(function(r){r.cut=(e,t,n)=>{if(!(e.position>=t||t>=e.complete))if(jl.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:s,loopDuration:a}=e;e.box.duration.setValue(t-i),e.copyTo({position:t,duration:o-t,loopOffset:En(s+(t-i),a),consolidate:n})}else return w("Not yet implemented")},r.clip=(e,t,n)=>{if(jl.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:s,loopDuration:a}=e;if(o-n<=0)return w(`duration will zero or negative(${o-n})`);e.box.duration.setValue(t-i),e.copyTo({position:n,duration:o-n,loopOffset:En(s+(n-i),a)})}else return w("Not yet implemented")}})(hv||(hv={}));var fn;(e=>e.create=(t,n,i,o)=>0|(t?1:0)|(n?2:0)|(i?4:0)|(o?8:0))(fn||={});var de=class r{static Empty=new r(2);#t;constructor(e=2){this.#t=P.create(()=>new Float32Array(128),e)}clear(e,t){this.#t.forEach(n=>n.fill(0,e,t))}numChannels(){return this.#t.length}getChannel(e){return e<this.numChannels()?this.#t[e]:this.#t[this.numChannels()-1]}assertSanity(){N(!this.#t.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#t}replace(e){this.replaceInto(e.#t)}replaceInto(e){N(e.length===2,"mixLayout: target.length must be 2"),N(this.#t.length===1||this.#t.length===2,"mixLayout: target.length must be 1 or 2"),this.#t.length===1?(e[0].set(this.#t[0]),e[1].set(this.#t[0])):(e[0].set(this.#t[0]),e[1].set(this.#t[1]))}mixInto(e){N(e.length===2,"mixLayout: target.length must be 2"),N(this.#t.length===1||this.#t.length===2,"mixLayout: target.length must be 1 or 2");let[t,n]=e;if(this.#t.length===1){let[i]=this.#t;for(let o=0;o<128;o++)t[o]+=i[o],n[o]+=i[o]}else{let[i,o]=this.#t;for(let s=0;s<128;s++)t[s]+=i[s],n[s]+=o[s]}}};var he=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#t;#e;#r;#i;#n;#o=0;#s=0;#a=0;#u=0;constructor(e,t){this.#t=e,this.#e=t,this.#r=new Float32Array(4),this.#i=P.create(()=>new gi(r.RMS_WINDOW),2),this.#n=this.#t.broadcastFloats(this.#e,this.#r,()=>{this.#r[0]=this.#o,this.#r[1]=this.#s,this.#r[2]=this.#a,this.#r[3]=this.#u})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#s=0}process(e,t,n=0,i=128){let[o,s]=this.#i;for(let a=n;a<i;a++){let u=e[a],l=t[a];this.#o<u?this.#o=u:this.#o*=r.PEAK_DECAY,this.#s<l?this.#s=l:this.#s*=r.PEAK_DECAY,this.#a=o.pushPop(u),this.#u=s.pushPop(l)}}processStereo([e,t],n=0,i=128){this.process(e,t,n,i)}terminate(){this.#n.terminate()}};var $u=class{#t=new V;#e;#r;#i;#n=m.None;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#o=this.#r.getValue(),this.#t.own(this.#r.subscribe(n=>{this.#o=n.getValue(),this.#i.notify(this)}))}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){N(this.#n.isEmpty(),"Already broadcasting"),this.#n=m.wrap(this.#e.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(){N(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=m.None,this.#o=this.#r.getValue()}own(e){return this.#t.own(e)}ownAll(...e){this.#t.ownAll(...e)}spawn(){return this.#t.spawn()}terminate(){this.#t.terminate()}};var gn=class{#t;constructor(){this.#t=new Lr(P.empty(),Zr.Comparator)}add(e,t){this.#t.add(e,t)}get(e){return this.#t.get(e)}forEach(e){return this.#t.forEach(e)}clear(){this.#t.clear()}};var Qe=class{#t=new V;#e;#r;#i;#n;#o=m.None;constructor(e){this.#e=e,this.#r=new gn,this.#i=[],this.#n=[]}parameterChanged(e){return w(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#e}get eventInput(){return this.#r}bindParameter(e){let t=new $u(this.#e,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdd:n=>{this.#o.isEmpty()&&(this.#o=m.wrap(this.#e.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemove:n=>{P.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(i=>i.terminate()),this.#o=m.None),t.onStopAutomation()}},c.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameter(e){this.#n.forEach(t=>{t.updateAutomation(e)&&this.parameterChanged(t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e))}own(e){return this.#t.own(e)}ownAll(...e){return this.#t.ownAll(...e)}spawn(){return this.#t.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=m.None,this.#i.length=0,this.#t.terminate()}toString(){return`{${this.constructor.name}}`}};var No;(e=>e.isOfType=t=>t.type==="update-event")(No||={});var Eu=class extends Qe{#t=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#t.push(e),{terminate:()=>P.remove(this.#t,e)}}process({blocks:e}){e.forEach(({p0:t,p1:n,flags:i},o)=>{if(Fe.every(i,1))for(let s of or.iterate(t,n,Qs)){let a={type:"update-event",position:s};this.#t.forEach(u=>u.add(o,a))}})}toString(){return`{${this.constructor.name}}`}};var $e=class extends Qe{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,s0:o,s1:s,bpm:a}=t,u=null,l=o;for(let d of this.eventInput.get(n)){let h=d.position-i,f=Math.abs(h)<1e-7?o:o+Math.floor(te.pulsesToSamples(h,a,sampleRate));N(o<=f&&f<=s,()=>`${f} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),u?.forEach(v=>this.handleEvent(v)),u=null,l<f&&(this.processAudio(t,l,f),l=f),No.isOfType(d)?this.updateParameter(d.position):(u??=[]).push(d)}u?.forEach(d=>this.handleEvent(d)),u=null,l<s&&this.processAudio(t,l,s)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return w(`${this} received an event but has no accepting method.`)}finishProcess(){}};var Su=class r{static#t=O.exponential(20/sampleRate,2e4/sampleRate);#e;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#s=0;#a=0;#u=0;#l=0;#c=0;#d=!1;#h=!1;constructor(e,t){let n=Dt(e);this.#e=n,this.#r=[new Float32Array(n),new Float32Array(n)],this.#i=[new Be,new Be],this.#n=new rr,this.#o=t}reset(){this.#a=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#h=!1),this.#f()}set offset(e){N(0<=e&&e<this.#e,"Out of bounds"),this.#l!==e&&(this.#l=e,this.#d?this.#v():this.#f())}get offset(){return this.#l}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#t.y(e),.001):e<0&&this.#n.setLowpassParams(r.#t.y(1+e),.001)}process(e,t,n,i){this.#h?this.#g(e,t,n,i):this.#p(e,t,n,i),this.#d=!0}#p(e,t,n,i){let o=this.#e-1,s=this.#r,a=this.feedback,u=this.wet,l=this.dry,d=this.#a,h=d-Math.floor(this.#u);h<0&&(h+=this.#e);let f=e[0],v=e[1],g=t[0],y=t[1],b=this.#i[0],C=this.#i[1],U=s[0],j=s[1];for(let L=n;L<i;++L){let ee=f[L],be=v[L],we=b.processFrame(this.#n,U[h]*.96),J=C.processFrame(this.#n,j[h]*.96),ue=this.cross*(J-we),q=we+ue,ae=J-ue;U[d]=(ee+q)*a+1e-18-1e-18,j[d]=(be+ae)*a+1e-18-1e-18,g[L]=q*u+ee*l,y[L]=ae*u+be*l,h=++h&o,d=++d&o}this.#a=d}#g(e,t,n,i){let o=this.#e-1,s=this.#r,a=this.feedback,u=this.wet,l=this.dry,d=this.#a;for(let h=n;h<i;++h){0<this.#c?(this.#u+=this.#s,this.#c--):(this.#u=this.#l,this.#h=!1);let f=d-this.#u;f<0&&(f+=this.#e);let v=f|0,g=f-v,y=e[0][h],b=e[1][h],C=s[0][v],U=s[0][v],j=this.#i[0].processFrame(this.#n,C+g*(s[0][v+1&o]-C)),L=this.#i[1].processFrame(this.#n,U+g*(s[1][v+1&o]-U));s[0][d]=y+j*a+1e-18-1e-18,s[1][d]=b+j*a+1e-18-1e-18,t[0][h]=j*u+y*l,t[1][h]=L*u+b*l,d=++d&o}this.#a=d}#f(){this.#u=this.#l,this.#c=0,this.#h=!1}#v(){this.#l!==this.#u&&(this.#c=this.#o,this.#s=(this.#l-this.#u)/this.#c,this.#h=!0)}};var Nu=class r extends $e{static ID=0;#t=r.ID++;#e;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=m.None;#s=!0;constructor(e,t){super(e),this.#e=t,this.#r=new de,this.#i=this.own(new he(e.broadcaster,t.address));let{delay:n,feedback:i,cross:o,filter:s,dry:a,wet:u}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(n)),this.parameterFeedback=this.own(this.bindParameter(i)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(s)),this.parameterDry=this.own(this.bindParameter(a)),this.parameterWet=this.own(this.bindParameter(u));let l=te.pulsesToSamples(gt.toPPQN(Lt.OffsetFractions[0]),30,sampleRate),d=Math.floor(.5*sampleRate);this.#n=new Su(l,d),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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}handleEvent(e){}processAudio({bpm:e,flags:t},n,i){if(this.#o.isEmpty())return;if(this.#s||Fe.some(t,8)){let s=this.parameterDelay.getValue(),a=gt.toPPQN(Lt.OffsetFractions[s]);this.#n.offset=te.pulsesToSamples(a,e,sampleRate),this.#s=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),n,i),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),n,i)}parameterChanged(e){e===this.parameterDelay?this.#s=!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=De(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=De(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#t})}`}};var Po=class r extends Qe{static ID=0;#t=r.ID++;#e;#r;#i;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new de,this.#i=this.own(new he(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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[n,i]=t.channels(),[o,s]=this.#r.channels();for(let a=0;a<128;a++)o[a]=n[a],s[a]=i[a];this.#i.process(o,s)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#t})`}};var vn=class r extends Qe{static ID=0;#t=r.ID++;#e;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#r=new de,this.#i=this.own(new he(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return m.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{P.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#e}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,n]=this.#r.channels();for(let i of this.#n){let[o,s]=i.channels();for(let a=0;a<128;a++)t[a]+=o[a],n[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.#t})}`}};var ie;(s=>{s.start=(a,u,l,d,h=0)=>({type:"note-event",position:a,duration:u,pitch:l,velocity:d,cent:h,id:++o}),s.startWith=(a,u,l)=>({type:"note-event",position:u??a.position,duration:l??a.duration,pitch:a.pitch,cent:a.cent,velocity:a.velocity,id:++o}),s.stop=({id:a,pitch:u},l)=>({type:"note-complete-event",position:l,pitch:u,id:a}),s.isStart=a=>a.type==="note-event"&&"id"in a&&typeof a.id=="number",s.isStop=a=>a.type==="note-complete-event";let o=0})(ie||={});var Ft=class{#t=new V;#e;#r;#i=m.None;constructor(e,t,n){this.#e=e,this.#r=this.#t.own(new Pt(t,n))}setNoteEventSource(e){return N(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),this.#e.reset(),Z.create(()=>{this.#i=m.None,this.#e.reset()})}introduceBlock({index:e,p0:t,p1:n,flags:i}){if(!this.#i.isEmpty())for(let o of this.#i.unwrap().processNotes(t,n,i))o.pitch>=0&&o.pitch<=127&&(this.#e.eventInput.add(e,o),this.#n(o))}clear(){}terminate(){this.#t.terminate()}#n(e){ie.isStart(e)?this.#r.noteOn(e.pitch):ie.isStop(e)&&this.#r.noteOff(e.pitch)}};var Pu=class extends $e{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#d;#h;#p;gain=1;freqMult=1;attack=1;release=1;waveform=Tt.sine;cutoff=1;resonance=1;filterEnvelope=0;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new Ft(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new de,this.#n=this.own(new he(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.octave)),this.#a=this.own(this.bindParameter(this.#t.namedParameter.tune)),this.#u=this.own(this.bindParameter(this.#t.namedParameter.attack)),this.#l=this.own(this.bindParameter(this.#t.namedParameter.release)),this.#c=this.own(this.bindParameter(this.#t.namedParameter.waveform)),this.#d=this.own(this.bindParameter(this.#t.namedParameter.cutoff)),this.#h=this.own(this.bindParameter(this.#t.namedParameter.resonance)),this.#p=this.own(this.bindParameter(this.#t.namedParameter.filterEnvelope)),this.own(e.registerProcessor(this)),this.readAllParameters()}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.#e.length=0,this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){ie.isStart(e)?this.#e.push(new Lp(this,e)):ie.isStop(e)&&this.#e.find(t=>t.event.id===e.id)?.stop()}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#i,t,n)&&this.#e.splice(i,1)}parameterChanged(e){e===this.#o?this.gain=De(this.#o.getValue()):e===this.#s||e===this.#a?this.freqMult=2**(this.#s.getValue()+this.#a.getValue()/1200):e===this.#u?this.attack=Math.floor(this.#u.getValue()*sampleRate):e===this.#l?this.release=Math.floor(this.#l.getValue()*sampleRate):e===this.#c?this.waveform=tm(this.#c.getValue(),Tt):e===this.#d?this.cutoff=this.#d.getValue():e===this.#h?this.resonance=this.#h.getValue():e===this.#p&&(this.filterEnvelope=this.#p.getValue())}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}},Lp=class{device;event;osc;buffer;filterCoeff;filterProcessor;phase=0;position=0;decayPosition=Number.POSITIVE_INFINITY;constructor(e,t){this.device=e,this.event=t,this.osc=new Ho,this.buffer=new Float32Array(128),this.filterCoeff=new rr,this.filterProcessor=new Be}stop(){this.decayPosition=this.position-this.device.attack}processAdd(e,t,n){let i=kn(this.event.pitch+this.event.cent/100,440)*this.device.freqMult,o=vi(this.event.velocity)*this.device.gain*De(-15),s=this.device.waveform,a=this.device.attack,u=this.device.release,l=this.device.adapter.namedParameter.cutoff.valueMapping,d=l.x(this.device.cutoff),h=this.device.resonance,f=this.device.filterEnvelope,v=e.getChannel(0),g=e.getChannel(1);this.osc.generate(this.buffer,i/sampleRate,s,t,n);for(let y=t;y<n;y++){let b=Math.min(this.position/a,1-(this.position-(this.decayPosition+a))/u,1)**2;this.filterCoeff.setLowpassParams(l.y(G(d+b*f,0,1))/sampleRate,h);let C=this.filterProcessor.processFrame(this.filterCoeff,this.buffer[y])*o*b;if(v[y]+=C,g[y]+=C,++this.position-this.decayPosition>a+u)return!0}return!1}};var _u=class extends Qe{#t;#e;#r;#i=NaN;#n=0;#o=128;constructor(e,t){super(e),this.#t=t,this.#e=new de(2),this.#r=this.own(new he(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get noteEventTarget(){return m.None}reset(){this.#r.clear(),this.#e.clear(),this.eventInput.clear(),this.#i=NaN,this.#n=0}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#e}process({blocks:e}){this.#e.clear(0,128);let[t,n]=this.#e.channels();this.#t.deviceHost().audioUnitBoxAdapter().tracks.collection.adapters().filter(i=>i.type===se.Audio&&i.enabled.getValue()).forEach(i=>e.forEach(o=>{let{p0:s,p1:a,flags:u}=o;if(!Fe.every(u,5))return;let l=this.context.clipSequencing.iterate(i.uuid,s,a);for(let{optClip:d,sectionFrom:h,sectionTo:f}of l)d.match({none:()=>{for(let v of i.regions.collection.iterateRange(s,a)){if(v.mute||!fe(v,gr))continue;let y=v.file.getOrCreateLoader().data;if(y.isEmpty())return;let b=y.unwrap();for(let C of We.locateLoops(v,s,a))this.#s(this.#e,b,C,o)}},some:v=>{if(!fe(v,fr))return;let g=v.file.getOrCreateLoader().data;if(g.isEmpty())return;let y=g.unwrap();for(let b of We.locateLoops({position:0,loopDuration:v.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},h,f))this.#s(this.#e,y,b,o)}})})),this.#e.assertSanity(),this.#r.process(t,n)}parameterChanged(e){}#s(e,t,n,{p0:i,p1:o,s0:s,s1:a}){let[u,l]=e.channels(),{numberOfFrames:d,frames:h}=t,f=h[0],v=h.length===1?h[0]:h[1],g=a-s,y=o-i,b=d*n.resultStartValue,C=d*n.resultEndValue,U=(n.resultStart-i)/y,j=(n.resultEnd-i)/y,L=s+g*U,ee=s+g*j,be=ee-L|0,we=(C-b)/be;N(s<=L&&ee<=a,`Out of bounds ${L}, ${ee}`);let J=!Number.isFinite(this.#i)||Math.abs(b-(this.#i+we))>2;for(let ue=0,q=L|0;ue<be;ue++,q++){let ae=b+ue*we,le=ae|0,it=0,pt=0;if(le>=0&&le<d-1){let ze=ae-le,mt=f[le],wn=v[le];it=mt+ze*(f[le+1]-mt),pt=wn+ze*(v[le+1]-wn)}if(J&&ue<this.#o&&Number.isFinite(this.#i)){let ze=ue/this.#o,mt=1-ze,wn=this.#i+ue*this.#n,Rr=wn|0;if(Rr>=0&&Rr<d-1){let Yp=wn-Rr,Xp=f[Rr],Qp=v[Rr],Pv=Xp+Yp*(f[Rr+1]-Xp),_v=Qp+Yp*(v[Rr+1]-Qp);u[q]+=mt*Pv+ze*it,l[q]+=mt*_v+ze*pt}else u[q]+=it,l[q]+=pt}else u[q]+=it,l[q]+=pt}this.#i=b+(be-1)*we,this.#n=we}};var ht=class extends Qe{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,p1:o}=t,s=null,a=i;for(let u of this.eventInput.get(n))s?.forEach(l=>this.handleEvent(t,l)),s=null,a<u.position&&(this.processEvents(t,a,u.position),a=u.position),No.isOfType(u)?this.updateParameter(u.position):(s??=[]).push(u);s?.forEach(u=>this.handleEvent(t,u)),s=null,a<o&&this.processEvents(t,a,o)}),this.eventInput.clear()}introduceBlock(e){}};var xn;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(n,i)=>i*n.mult+n.add))(xn||={});var ku=Object.freeze([{name:"up",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=t%s,l=Math.floor(t%a/s),d=r[u];return ie.start(n,i,d.pitch+l*12,xn.apply(o,d.velocity))}},{name:"down",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=s-1-t%s,l=e-1-Math.floor(t%a/s),d=r[u];return ie.start(n,i,d.pitch+l*12,xn.apply(o,d.velocity))}},{name:"up-down",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=Math.max(1,a*2-2),l=t%u,d=l<a?l:u-l,h=d%s,f=Math.floor(d/s),v=r[h];return ie.start(n,i,v.pitch+f*12,xn.apply(o,v.velocity))}}]);var Iu=class extends ht{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l=xn.create();#c=m.None;#d=ku[0];#h=NaN;#p=1;#g=1;#f=1;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new fi,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.#s=this.own(this.bindParameter(t.namedParameter.repeat)),this.#a=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#u=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return m.wrap(this)}setNoteEventSource(e){return N(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=m.wrap(e),Z.create(()=>this.#c=m.None)}*processNotes(e,t,n){if(this.#r.nonEmpty())if(Fe.every(n,2))for(let o of this.#r.releaseAll())yield ie.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ie.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let i=this.#c.unwrap();for(let s of i.processNotes(e,t,n));let o=!Fe.every(n,1);for(let{position:s,index:a}of or.iterateWithIndex(e,t,this.#h)){let u=Array.from(i.iterateActiveNotesAt(s,o));if(u.length===0)continue;let l=Math.floor(a/this.#g),d=Math.max(1,Math.floor(this.#h*this.#p)),h=this.#d.run(u,this.#f,l,s,d,this.#l);this.#r.addAndRetain({...h}),yield h}for(let s of this.#r.releaseLinearCompleted(t))yield ie.stop(s,s.position+s.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,Ze.Comparator))}reset(){this.#e.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){if(e===this.#i)this.#d=ku.at(this.#i.getValue())??ku[0];else if(e===this.#n)this.#h=gt.toPPQN(Ar.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#p=this.#o.getValue();else if(e===this.#s)this.#g=this.#s.getValue();else if(e===this.#a)this.#f=this.#a.getValue();else if(e===this.#u){let t=this.#u.getValue();t<=0?(this.#l.add=1+t,this.#l.mult=0):(this.#l.add=1-t,this.#l.mult=t)}}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var Fu=class extends ht{#t;#e;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new Pt(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 N(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),Z.create(()=>this.#o=m.None)}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#o.isEmpty())for(let i of this.#o.unwrap().processNotes(e,t,n))if(ie.isStart(i)){this.#e.noteOn(i.pitch);let{cent:o,octaves:s,semiTones:a}=this.#t.namedParameter;yield wt.overwrite(i,{pitch:i.pitch+s.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+o.valueAt(i.position)})}else this.#e.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let n of this.#o.unwrap().iterateActiveNotesAt(e,t))if(n.type==="note-event"){let{cent:i,octaves:o,semiTones:s}=this.#t.namedParameter;yield wt.overwrite(n,{pitch:n.pitch+o.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+i.valueAt(n.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var Bu=class r{static DEFAULT_SIZE=1024;#t;#e;#r;#i;#n;#o;#s;#a=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#t=e,this.#r=new Lo(this.#t),this.#i=new Float32Array(this.#t),this.#n=new Float32Array(this.#t),this.#o=In.create(In.Type.Blackman,this.#t),this.#e=this.#t>>1,this.#s=new Float32Array(this.#e)}clear(){this.#s.fill(0),this.#a=0}numBins(){return this.#e}bins(){return this.#s}process(e,t,n,i){for(let o=n;o<i;++o)this.#i[this.#a]=this.#o[this.#a]*(e[o]+t[o]),++this.#a===this.#t&&this.#u()}#u(){this.#r.process(this.#i,this.#n);let e=1/this.#e;for(let t=0;t<this.#e;++t){let n=this.#i[t],i=this.#n[t],o=Math.sqrt(n*n+i*i)*e;this.#s[t]<o?this.#s[t]=o:this.decay&&(this.#s[t]*=.9)}this.#a=0,this.#n.fill(0),this.decay=!1}};var Ou=class r extends $e{static ID=0;#t=r.ID++;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#d;#h;#p;#g;#f;#v;#y;#C;#P;#_;#E;#D;#k;#b;#x;#S;#I;#F;#B;#w;#$;#A;#N;#O;#R;#T;#z=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new de,this.#i=this.own(new he(e.broadcaster,t.address)),this.#n=new Bu,this.#o=new Float32Array(this.#n.numBins()),this.#s=P.create(()=>new rr,7),this.#a=[new Kr(4),new Kr(4)],this.#u=[new Kr(4),new Kr(4)],this.#l=[this.#u,[new Be,new Be],[new Be,new Be],[new Be,new Be],[new Be,new Be],[new Be,new Be],this.#a],this.#c=P.create(()=>!0,7);let n=this.#e.namedParameter;this.#d=this.own(this.bindParameter(n.highPass.enabled)),this.#p=this.own(this.bindParameter(n.highPass.q)),this.#h=this.own(this.bindParameter(n.highPass.frequency)),this.#g=this.own(this.bindParameter(n.highPass.order)),this.#f=this.own(this.bindParameter(n.lowShelf.enabled)),this.#v=this.own(this.bindParameter(n.lowShelf.frequency)),this.#y=this.own(this.bindParameter(n.lowShelf.gain)),this.#C=this.own(this.bindParameter(n.lowBell.enabled)),this.#P=this.own(this.bindParameter(n.lowBell.frequency)),this.#_=this.own(this.bindParameter(n.lowBell.gain)),this.#E=this.own(this.bindParameter(n.lowBell.q)),this.#D=this.own(this.bindParameter(n.midBell.enabled)),this.#k=this.own(this.bindParameter(n.midBell.frequency)),this.#b=this.own(this.bindParameter(n.midBell.gain)),this.#x=this.own(this.bindParameter(n.midBell.q)),this.#S=this.own(this.bindParameter(n.highBell.enabled)),this.#I=this.own(this.bindParameter(n.highBell.frequency)),this.#F=this.own(this.bindParameter(n.highBell.gain)),this.#B=this.own(this.bindParameter(n.highBell.q)),this.#w=this.own(this.bindParameter(n.highShelf.enabled)),this.#$=this.own(this.bindParameter(n.highShelf.frequency)),this.#A=this.own(this.bindParameter(n.highShelf.gain)),this.#N=this.own(this.bindParameter(n.lowPass.enabled)),this.#O=this.own(this.bindParameter(n.lowPass.frequency)),this.#R=this.own(this.bindParameter(n.lowPass.q)),this.#T=this.own(this.bindParameter(n.lowPass.order)),this.own(e.registerProcessor(this)),e.broadcaster.broadcastFloats(t.spectrum,this.#o,()=>{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.#l.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#z=m.wrap(e),{terminate:()=>this.#z=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#z.isEmpty())return;let[i,o]=this.#r.channels(),s=this.#z.unwrap();if(this.#c.some(a=>a)){let[a,u]=s.channels();this.#s.forEach((l,d)=>{if(this.#c[d]){let[h,f]=this.#l[d];h.process(l,a,i,t,n),f.process(l,u,o,t,n),a=i,u=o}})}else{let[a,u]=s.channels();for(let l=t;l<n;l++)i[l]=a[l],o[l]=u[l]}this.#i.process(i,o,t,n),this.#n.process(i,o,t,n)}parameterChanged(e){if(e===this.#T){let t=this.#T.getValue();this.#a[0].order=t,this.#a[1].order=t}else if(e===this.#g){let t=this.#g.getValue();this.#u[0].order=t,this.#u[1].order=t}else if(e===this.#h||e===this.#p){let t=this.#h.getValue(),n=this.#p.getValue();this.#s[0].setHighpassParams(t/sampleRate,n)}else if(e===this.#v||e===this.#y){let t=this.#v.getValue(),n=this.#y.getValue();this.#s[1].setLowShelfParams(t/sampleRate,n)}else if(e===this.#P||e===this.#_||e===this.#E){let t=this.#P.getValue(),n=this.#_.getValue(),i=this.#E.getValue();this.#s[2].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#k||e===this.#b||e===this.#x){let t=this.#k.getValue(),n=this.#b.getValue(),i=this.#x.getValue();this.#s[3].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#I||e===this.#F||e===this.#B){let t=this.#I.getValue(),n=this.#F.getValue(),i=this.#B.getValue();this.#s[4].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#$||e===this.#A){let t=this.#$.getValue(),n=this.#A.getValue();this.#s[5].setHighShelfParams(t/sampleRate,n)}else if(e===this.#O||e===this.#R){let t=this.#O.getValue(),n=this.#R.getValue();this.#s[6].setLowpassParams(t/sampleRate,n)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#f?this.#c[1]=this.#f.getValue():e===this.#C?this.#c[2]=this.#C.getValue():e===this.#D?this.#c[3]=this.#D.getValue():e===this.#S?this.#c[4]=this.#S.getValue():e===this.#w?this.#c[5]=this.#w.getValue():e===this.#N&&(this.#c[6]=this.#N.getValue())}toString(){return`{${this.constructor.name} (${this.#t})`}};var Cu=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#t=new Float32Array(2048);#e=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#s=new Float32Array(2048);#a=new Float32Array(2048);#u=new Float32Array(1024);#l=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#h=new Float32Array(2048);#p=new Float32Array(2048);#g=new Float32Array(2048);#f=new Float32Array(2048);#v=new Float32Array(2048);#y=new Float32Array(2048);#C=new Float32Array(2048);#P=new Float32Array(2048);#_=new Float32Array(1024);#E=new Float32Array(512);#D=new Float32Array(512);#k=new Float32Array(256);#b;#x;#S=0;#I=0;#F=0;#B=0;#w=0;#$=0;#A=0;#N=0;#O=0;#R=0;#T=0;#z=0;#U=0;#V=0;#j=0;#L=0;#K=0;#Z=0;#q=0;#H=0;#G=0;#W=0;#J=0;#Y=0;#X=0;#Q=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#se=0;#ae=0;#ue=0;#le=0;#ce=0;#de=0;#he=0;#pe=0;#m=0;#M=0;constructor(e=.5){this.#b=Dt(Math.ceil(e*sampleRate)),this.#x=new Float32Array(this.#b<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#m=0,this.#M=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#m=0,this.#M=0,this.clearHistory(),this.clearBuffers()}process(e,t,n,i){let[o,s]=t.channels(),[a,u]=e.channels(),l=.4*this.damp,d=1-l,h=.7+.28*this.roomSize;for(let f=n;f<i;++f){let v=o[f],g=s[f],y=this.#M-this.predelayInSamples;y<0&&(y+=this.#b);let b;b=y<<1;let C=.01,U=this.#x[b]*C,j=this.#x[b+1]*C;b=this.#M<<1,this.#x[b]=v,this.#x[b+1]=g,this.#M=this.#M+1&this.#b-1;let L=this.#m&2047;this.#S=d*this.#I+l*this.#S,this.#t[L]=U+h*this.#S,this.#I=this.#t[this.#m-1617&2047],this.#F=d*this.#B+l*this.#F,this.#e[L]=U+h*this.#F,this.#B=this.#e[this.#m-1557&2047],this.#w=d*this.#$+l*this.#w,this.#r[L]=U+h*this.#w,this.#$=this.#r[this.#m-1491&2047],this.#A=d*this.#N+l*this.#A,this.#i[L]=U+h*this.#A,this.#N=this.#i[this.#m-1422&2047],this.#O=d*this.#R+l*this.#O,this.#n[L]=U+h*this.#O,this.#R=this.#n[this.#m-1356&2047],this.#T=d*this.#z+l*this.#T,this.#o[L]=U+h*this.#T,this.#z=this.#o[this.#m-1277&2047],this.#U=d*this.#V+l*this.#U,this.#s[L]=U+h*this.#U,this.#V=this.#s[this.#m-1188&2047],this.#j=d*this.#L+l*this.#j,this.#a[L]=U+h*this.#j,this.#L=this.#a[this.#m-1116&2047];let ee=this.#L+this.#V+this.#z+this.#R+this.#N+this.#$+this.#B+this.#I,be=this.#K-ee,we=this.#Z-be,J=this.#q-we;this.#u[this.#m&1023]=ee+.5*this.#K,this.#K=this.#u[this.#m-556&1023],this.#l[this.#m&511]=be+.5*this.#Z,this.#Z=this.#l[this.#m-441&511],this.#c[this.#m&511]=we+.5*this.#q,this.#q=this.#c[this.#m-341&511],this.#d[this.#m&255]=J+.5*this.#H,this.#H=this.#d[this.#m-225&255],a[f]=this.dryGain*v+this.wetGain*(this.#H-J),this.#G=d*this.#W+l*this.#G,this.#h[L]=j+h*this.#G,this.#W=this.#h[this.#m-1640&2047],this.#J=d*this.#Y+l*this.#J,this.#p[L]=j+h*this.#J,this.#Y=this.#p[this.#m-1580&2047],this.#X=d*this.#Q+l*this.#X,this.#g[L]=j+h*this.#X,this.#Q=this.#g[this.#m-1514&2047],this.#ee=d*this.#te+l*this.#ee,this.#f[L]=j+h*this.#ee,this.#te=this.#f[this.#m-1445&2047],this.#re=d*this.#ie+l*this.#re,this.#v[L]=j+h*this.#re,this.#ie=this.#v[this.#m-1379&2047],this.#ne=d*this.#oe+l*this.#ne,this.#y[L]=j+h*this.#ne,this.#oe=this.#y[this.#m-1300&2047],this.#se=d*this.#ae+l*this.#se,this.#C[L]=j+h*this.#se,this.#ae=this.#C[this.#m-1211&2047],this.#ue=d*this.#le+l*this.#ue,this.#P[L]=j+h*this.#ue,this.#le=this.#P[this.#m-1139&2047];let ue=this.#le+this.#ae+this.#oe+this.#ie+this.#te+this.#Q+this.#Y+this.#W,q=this.#ce-ue,ae=this.#de-q,le=this.#he-ae;this.#_[this.#m&1023]=ue+.5*this.#ce,this.#ce=this.#_[this.#m-579&1023],this.#E[this.#m&511]=q+.5*this.#de,this.#de=this.#E[this.#m-464&511],this.#D[this.#m&511]=ae+.5*this.#he,this.#he=this.#D[this.#m-364&511],this.#k[this.#m&255]=le+.5*this.#pe,this.#pe=this.#k[this.#m-248&255],u[f]=this.dryGain*g+this.wetGain*(this.#pe-le),this.#m++}}clearBuffers(){this.#t.fill(0),this.#e.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#s.fill(0),this.#a.fill(0),this.#u.fill(0),this.#l.fill(0),this.#c.fill(0),this.#d.fill(0),this.#h.fill(0),this.#p.fill(0),this.#g.fill(0),this.#f.fill(0),this.#v.fill(0),this.#y.fill(0),this.#C.fill(0),this.#P.fill(0),this.#_.fill(0),this.#E.fill(0),this.#D.fill(0),this.#k.fill(0),this.#x.fill(0)}clearHistory(){this.#S=0,this.#I=0,this.#F=0,this.#B=0,this.#w=0,this.#$=0,this.#A=0,this.#N=0,this.#O=0,this.#R=0,this.#T=0,this.#z=0,this.#U=0,this.#V=0,this.#j=0,this.#L=0,this.#K=0,this.#Z=0,this.#q=0,this.#H=0,this.#G=0,this.#W=0,this.#J=0,this.#Y=0,this.#X=0,this.#Q=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#se=0,this.#ae=0,this.#ue=0,this.#le=0,this.#ce=0,this.#de=0,this.#he=0,this.#pe=0}};var Du=class r extends $e{static ID=0;#t=r.ID++;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new de,this.#i=this.own(new he(e.broadcaster,t.address)),this.#n=new Cu;let{decay:n,preDelay:i,damp:o,wet:s,dry:a}=this.#e.namedParameter;this.#o=this.own(this.bindParameter(n)),this.#s=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(o)),this.#u=this.own(this.bindParameter(s)),this.#l=this.own(this.bindParameter(a)),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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=m.wrap(e),{terminate:()=>this.#c=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,n);let[i,o]=this.#r.channels();this.#i.process(i,o,t,n)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#s===e?this.#n.predelayInSamples=Math.ceil(this.#s.getValue()*sampleRate):this.#a===e?this.#n.damp=this.#a.getValue():this.#u===e?this.#n.wetGain=De(this.#u.getValue()):this.#l===e&&(this.#n.dryGain=De(this.#l.getValue()))}toString(){return`{${this.constructor.name} (${this.#t})`}};var Ru=class extends $e{#t;#e;#r;#i;#n;#o;#s;gain=1;release=1;loader=m.None;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new de,this.#i=new Ft(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new he(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(n=>this.loader=n.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.#e.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}get adapter(){return this.#t}handleEvent(e){ie.isStart(e)?this.#e.push(new Kp(this,e)):ie.isStop(e)&&this.#e.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,n){this.#r.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#r,t,n)&&this.#e.splice(i,1)}parameterChanged(e){e===this.#o?this.gain=De(this.#o.getValue()):e===this.#s&&(this.release=this.#s.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},Kp=class{#t;#e;#r=1;#i=0;#n=0;#o=Number.POSITIVE_INFINITY;constructor(e,t){this.#t=e,this.#e=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#e}stop(){this.#o=this.#n}processAdd(e,t,n){let i=this.#t.loader;if(i.isEmpty())return!0;let o=i.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,n)}processSimple(e,t,n,i){let[o,s]=e,a=t.frames[0],u=t.frames[1]??a,l=t.numberOfFrames,d=t.sampleRate/sampleRate,h=this.#t.gain,f=this.#t.release,v=1/f;for(let g=n;g<i;g++){let y=this.#i|0;if(y>=l-1)return!0;let b=this.#i-y,C=Math.min(1-(this.#n-this.#o)*v,1)**2,U=a[y]*(1-b)+a[y+1]*b,j=u[y]*(1-b)+u[y+1]*b;if(o[g]+=U*h*C,s[g]+=j*h*C,this.#i+=this.#r*d,++this.#n-this.#o>f)return!0}return!1}};var zu=class extends ht{#t;#e;constructor(e,t){super(e),this.#t=t,this.#e=new Ft(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#e.introduceBlock(e)}setNoteEventSource(e){return this.#e.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#e.clear()}processEvents(e,t,n){}handleEvent({index:e},t){ie.isStart(t)?this.#t.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t)):ie.isStop(t)&&this.#t.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Tu=class extends $e{#t;#e;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#e=new de,this.#r=this.own(new he(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new gn,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{P.remove(this.#i,e),this.#e.clear()}}}get audioOutput(){return this.#e}get eventInput(){return this.#n}processAudio(e,t,n){}reset(){this.#r.clear()}finishProcess(){this.#e.clear();let[e,t]=this.#e.channels();for(let n of this.#i){let[i,o]=n.channels();for(let s=0;s<128;s++)e[s]+=i[s],t[s]+=o[s]}this.#e.assertSanity(),this.#r.process(this.#e.getChannel(0),this.#e.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Mu=class r{static create(e,t,n,i){return new r(e,t,n,i)}#t=new V;#e;#r;#i=[];#n=!0;constructor(e,t,n,i){this.#e=E.newSet(({device:o})=>o.uuid),this.#r=this.#t.own(new V),this.#t.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let s=_o.create(e,o.box),a=this.#e.add({device:s,subscription:s.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(a,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:s,subscription:a}=this.#e.removeByKey(o.uuid);a.terminate(),s.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let s=n;P.replace(this.#i,t.adapters().map(({uuid:a})=>this.#e.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.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#t.terminate(),this.#e.forEach(({device:e})=>e.terminate()),this.#e.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var ko=Math.floor(.005*sampleRate),Vu=class{#t;#e;#r;#i;#n;#o;#s=0;#a=Number.POSITIVE_INFINITY;#u;#l;#c;#d;#h;#p;#g=!0;#f=!1;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#i=n,this.#r=i,this.#n=e.gate,this.#o=vi(this.#r.velocity);let{attack:o,release:s,sampleStart:a,sampleEnd:u}=this.#e;this.#u=o.getValue()*sampleRate,this.#l=s.getValue()*sampleRate,this.#c=(n.numberOfFrames-1)*a.getValue(),this.#d=(n.numberOfFrames-1)*u.getValue(),this.#h=this.#c,this.#p=0}get sample(){return this.#t}get event(){return this.#r}get position(){return this.#h}get envelope(){return this.#p}release(e=!1){this.#g&&(e?(this.#l=ko,this.#v(),this.#g=!1):this.#n!==_t.Off&&this.#v())}processAdd(e,t,n){let[i,o]=e,{frames:s,numberOfFrames:a}=this.#i,u=s[0],l=s[1]??u,{pitch:d}=this.#e,h=this.#d-this.#c,f=Math.sign(h),v=this.#i.sampleRate/sampleRate*f*2**(d.getValue()/1200),g=0;for(let y=t;y<n;y++){let b=this.#h|0,C=this.#h-b,U=u[b]*(1-C)+(u[b+1]??0)*C,j=l[b]*(1-C)+(l[b+1]??0)*C;if(g=Math.min(this.#s/this.#u,1-(this.#s-(this.#a+this.#u))/this.#l,1),this.#h+=v,f>0){if(this.#n===_t.Off){if(this.#h>=a)return!0;!this.#f&&this.#h>=this.#d&&this.#v()}else if(this.#n===_t.On){if(this.#h>=this.#d-ko){if(this.#h>=this.#d)return!0;g*=(this.#d-this.#h)/ko}}else if(this.#n===_t.Loop)for(;this.#h>=this.#d;)this.#h-=h}else if(f<0){if(this.#n===_t.Off){if(this.#h<=0)return!0;!this.#f&&this.#h<=this.#d&&this.#v()}else if(this.#n===_t.On){if(this.#h<=this.#d+ko){if(this.#h<=this.#d)return!0;g*=(this.#d-this.#h)/ko}}else if(this.#n===_t.Loop)for(;this.#h<=this.#d;)this.#h-=h}if(++this.#s-this.#a>this.#u+this.#l)return!0;g*=this.#o*g,i[y]+=U*g,o[y]+=j*g}return this.#p=g,!1}toString(){return"{PlayfieldSampleVoice}"}#v(){this.#f||(this.#f=!0,this.#a=this.#s<this.#u?this.#s-this.#u:this.#s)}};var ju=class extends $e{#t;#e;#r;#i;#n;#o;constructor(e,t,n,i){super(e),this.#t=t,this.#e=n,this.#r=[],this.#i=new de,this.#n=this.own(new he(e.broadcaster,n.peakAddress));let{sampleStart:o,sampleEnd:s,attack:a,release:u,pitch:l}=n.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(s)),attack:this.own(this.bindParameter(a)),release:this.own(this.bindParameter(u)),pitch:this.own(this.bindParameter(l))});let d=new Float32Array(16);this.ownAll(Mu.create(e,n.audioEffects,this,i),e.broadcaster.broadcastFloats(n.address,d,()=>{let h=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);h.forEach(({position:f},v)=>d[v]=f),d[h.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){if(ie.isStart(e)){let t=this.#e.file().flatMap(d=>d.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:n,solo:i,polyphone:o,exclude:s}=this.#e.namedParameter,a=n.getValue(),u=i.getValue();if(a||this.#t.hasSolo()&&!u)return;o.getValue()||this.#r.forEach(d=>d.release(!0)),s.getValue()&&this.#t.stopExcludeOthers(this.#e),this.#r.push(new Vu(this.#e,this.#o,t.unwrap(),e))}else ie.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#r.length-1;i>=0;i--)this.#r[i].processAdd(this.#i.channels(),t,n)&&this.#r.splice(i,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.#e.indexField.getValue()}}`}};var Lu=class{#t=new V;#e;#r;#i;#n;constructor(e,t){this.#e=t,this.#r=this.#t.own(new zu(e,this)),this.#i=this.#t.own(new Tu(e,this)),this.#n=E.newSet(n=>n.uuid),this.#t.ownAll(t.samples.catchupAndSubscribe({onAdd:n=>{let i=new ju(e,this,n,this.#i);this.#n.add({uuid:n.uuid,processor:i,terminable:e.registerEdge(this.#r,i)}),e.sampleManager.getOrCreate(n.fileUUID())},onRemove:n=>{let{terminable:i,processor:o}=this.#n.removeByKey(n.uuid);i.terminate(),o.terminate()},onReorder:n=>{}}),{terminate:()=>{this.#n.forEach(({terminable:n,processor:i})=>{n.terminate(),i.terminate()}),this.#n.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.#e.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#e.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#e.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:n})=>n.forceStop())}get uuid(){return this.#e.uuid}get adapter(){return this.#e}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#t.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var Ku=class extends $e{#t;#e;#r;#i=vt.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#s;#a;#u;#l;#c;#d=m.None;#h=Mt.Mixing.Linear;#p=!0;#g=!1;constructor(e,t){super(e),this.#t=t,this.#e=new de,this.#r=this.own(new he(e.broadcaster,t.address)),this.#o=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.#u=this.own(this.bindParameter(t.namedParameter.invertL)),this.#l=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(n=>{this.#h=n.getValue(),this.#p=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#e.clear(),this.eventInput.clear(),this.#g=!1}get uuid(){return this.#t.uuid}get audioOutput(){return this.#e}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#d.isEmpty())return;this.#p&&(this.#i.update(this.#n,this.#h,this.#g),this.#p=!1);let i=this.#d.unwrap().channels(),o=this.#e.channels();this.#i.processFrames(i,o,t,n),this.#r.processStereo(o,t,n),this.#g=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=De(this.#o.getValue()),this.#p=!0;return;case this.#s:this.#n.panning=this.#s.getValue(),this.#p=!0;return;case this.#a:this.#n.stereo=this.#a.getValue(),this.#p=!0;return;case this.#u:this.#n.invertL=this.#u.getValue(),this.#p=!0;return;case this.#l:this.#n.invertR=this.#l.getValue(),this.#p=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#p=!0;return}}toString(){return`{${this.constructor.name}}`}};var Zu=class extends ht{#t;#e;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new Pt(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(n=>{this.#r.ifSome(i=>i.terminate()),this.#r=m.wrap(n.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(n.targetVertex.unwrap().box,ri.checkType))}),Z.create(()=>{this.#r.ifSome(n=>n.terminate()),this.#r=m.None}),e.registerProcessor(this))}get uuid(){return this.#t.uuid}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}setNoteEventSource(e){return N(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),Z.create(()=>this.#i=m.None)}*processNotes(e,t,n){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),o=this.#r.mapOr(An,_n.Identity);for(let s of i.processNotes(o.unwarp(e),o.unwarp(t),n))ie.isStart(s)?this.#e.noteOn(s.pitch):this.#e.noteOff(s.pitch),yield wt.overwrite(s,{position:G(o.warp(s.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),i=this.#r.mapOr(An,_n.Identity);for(let o of n.iterateActiveNotesAt(i.unwarp(e),t))yield wt.overwrite(o,{position:i.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,n){}};var qu=class extends ht{#t;#e;#r=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new Pt(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return N(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),Z.create(()=>this.#r=m.None)}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().processNotes(e,t,n))yield i}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().iterateActiveNotesAt(e,t))yield n}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var Hu=class{attackSamples;decaySamples;sustainLevel;releaseSamples;#t=0;#e=0;#r=0;#i=0;constructor(e,t,n,i){this.attackSamples=e*sampleRate,this.decaySamples=t*sampleRate,this.sustainLevel=Math.max(0,Math.min(1,n)),this.releaseSamples=i*sampleRate}get isComplete(){return this.#t===4}release(){this.#t!==4&&this.#t!==3&&(this.#i=this.#r,this.#t=3,this.#e=0)}process(){switch(this.#t){case 0:this.attackSamples<=0?(this.#r=1,this.#t=1,this.#e=0):(this.#r=this.#e++/this.attackSamples,this.#r>=1&&(this.#r=1,this.#t=1,this.#e=0));break;case 1:this.decaySamples<=0?(this.#r=this.sustainLevel,this.#t=2,this.#e=0):(this.#r=1-this.#e++/this.decaySamples*(1-this.sustainLevel),this.#r<=this.sustainLevel&&(this.#r=this.sustainLevel,this.#t=2,this.#e=0));break;case 2:this.#r=this.sustainLevel;break;case 3:this.releaseSamples<=0?(this.#r=0,this.#t=4):(this.#r=this.#i*(1-this.#e++/this.releaseSamples),(this.#r<=.001||this.#e>=this.releaseSamples)&&(this.#r=0,this.#t=4));break;case 4:this.#r=0;break}return this.#r}};var Gu=(r,e)=>(r[e]??r[e.toString()])?.value,yn=(r,e,t)=>Gu(e,t)??Gu(r,t),Wu=class{event;sampleData;envelope;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,n,i){this.event=e;let o=t.generators,s=n?.generators,a=Gu(s,53)??0,u=n?.sample??i.samples[a];this.sampleData=u.data,this.rootKey=Gu(s,58)??u?.header.originalPitch??60,this.sampleRate=u?.header.sampleRate??sampleRate,this.loopStart=u?.header.startLoop??0,this.loopEnd=u?.header.endLoop??this.sampleData.length;let l=yn(o,s,54)??0;this.shouldLoop=l===1||l===3,this.pan=(yn(o,s,17)??0)/1e3;let d=yn(o,s,34),h=yn(o,s,36),f=yn(o,s,37),v=yn(o,s,38),g=nt(d)?Math.pow(2,d/1200):.005,y=nt(h)?Math.pow(2,h/1200):.005,b=1-(f??0)/1e3,C=nt(v)?Math.pow(2,v/1200):.005;this.envelope=new Hu(g,y,b,C)}release(){this.isReleasing=!0,this.envelope.release()}processAdd(e,t,n){let o=kn(this.event.pitch+this.event.cent/100,440)/kn(this.rootKey,440)*(this.sampleRate/sampleRate),s=vi(this.event.velocity),a=Math.cos((this.pan+1)*Math.PI/4),u=Math.sin((this.pan+1)*Math.PI/4),l=e.getChannel(0),d=e.getChannel(1);for(let h=t;h<n;h++){let f=Math.floor(this.playbackPosition),v=this.envelope.process(),y=this.#t(f)/32768*s*v;if(l[h]+=y*a,d[h]+=y*u,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.isComplete}#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 Ju=class extends $e{#t;#e;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new Ft(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new de,this.#n=this.own(new he(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(n=>this.#o=n.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.#t.uuid}get audioOutput(){return this.#i}get adapter(){return this.#t}reset(){this.#r.clear(),this.#n.clear(),this.#e.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(i=>i.soundfont);if(t.isEmpty())return;let n=t.unwrap();if(ie.isStart(e)){let i=n.presets[this.#t.presetIndex]??n.presets[0];if(Bo(i)){console.warn("No preset available");return}let o=0;for(let s of i.zones){let a=Math.round(e.velocity*127);if(this.#s(e.pitch,a,s)){let u=s.instrument.zones;for(let l=0;l<u.length;l++){let d=u[l];this.#s(e.pitch,a,d)&&(this.#e.push(new Wu(e,s,d,n)),o++)}}}}else ie.isStop(e)&&this.#e.forEach(i=>i.event.id===e.id&&i.release())}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#i,t,n)&&this.#e.splice(i,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#s(e,t,n){return this.#a(n.generators[44]?.range,t)&&this.#a(n.generators[43]?.range,e)}#a(e,t){return Fo(e)||t>=e.lo&&t<=e.hi}};var Zp;(e=>e.create=(t,n)=>n.accept({visitAudioBusBox:i=>new vn(t,t.boxAdapters.adapterFor(i,He)),visitVaporisateurDeviceBox:i=>new Pu(t,t.boxAdapters.adapterFor(i,Ki)),visitNanoDeviceBox:i=>new Ru(t,t.boxAdapters.adapterFor(i,qi)),visitTapeDeviceBox:i=>new _u(t,t.boxAdapters.adapterFor(i,Li)),visitPlayfieldDeviceBox:i=>new Lu(t,t.boxAdapters.adapterFor(i,$r)),visitSoundfontDeviceBox:i=>new Ju(t,t.boxAdapters.adapterFor(i,Xi))}))(Zp||={});var qp;(e=>e.create=(t,n)=>H(n.accept({visitUnknownMidiEffectDeviceBox:i=>new qu(t,t.boxAdapters.adapterFor(i,Yi)),visitArpeggioDeviceBox:i=>new Iu(t,t.boxAdapters.adapterFor(i,Ar)),visitPitchDeviceBox:i=>new Fu(t,t.boxAdapters.adapterFor(i,Zi)),visitZeitgeistDeviceBox:i=>new Zu(t,t.boxAdapters.adapterFor(i,Wi))}),`Could not create midi-effect for'${n.name}'`))(qp||={});var _o;(e=>e.create=(t,n)=>H(n.accept({visitUnknownAudioEffectDeviceBox:i=>new Po(t,t.boxAdapters.adapterFor(i,Ji)),visitStereoToolDeviceBox:i=>new Ku(t,t.boxAdapters.adapterFor(i,Gi)),visitDelayDeviceBox:i=>new Nu(t,t.boxAdapters.adapterFor(i,Lt)),visitReverbDeviceBox:i=>new Du(t,t.boxAdapters.adapterFor(i,Bi)),visitRevampDeviceBox:i=>new Ou(t,t.boxAdapters.adapterFor(i,Oi)),visitModularDeviceBox:i=>new Po(t,t.boxAdapters.adapterFor(i,br))}),`Could not create audio-effect for'${n.name}'`))(_o||={});var Yu=class extends $e{#t;#e;#r;#i;#n;#o;#s=m.None;#a=!0;#u=!1;constructor(e,t){super(e),this.#t=t,this.#e=new de,this.#r=vt.linear(sampleRate),this.#i=vt.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.#e.clear()}get adapter(){return this.#t}setAudioSource(e){return this.#s=m.wrap(e),{terminate:()=>this.#s=m.None}}get audioOutput(){return this.#e}processAudio(e,t,n){if(this.#s.isEmpty())return;if(this.#a){let l=De(this.#n.getValue()),d=this.#o.getValue();this.#r.set((1-Math.max(0,d))*l,this.#u),this.#i.set((1+Math.min(0,d))*l,this.#u),this.#a=!1}let i=this.#e.getChannel(0),o=this.#e.getChannel(1),s=this.#s.unwrap(),a=s.getChannel(0),u=s.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let l=t;l<n;l++)i[l]=a[l]*this.#r.moveAndGet(),o[l]=u[l]*this.#i.moveAndGet();else{let l=this.#r.get(),d=this.#i.get();for(let h=t;h<n;h++)i[h]=a[h]*l,o[h]=u[h]*d}this.#u=!0}parameterChanged(e){this.#a=!0}};var Xu=class extends $e{#t;#e;#r;#i;#n;#o;#s;#a;#u=vt.linear(sampleRate);#l=vt.linear(sampleRate);#c=vt.linear(sampleRate);#d=m.None;#h=!0;#p=!1;constructor(e,t){super(e),this.#t=t,this.#e=new de,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new he(e.broadcaster,this.#t.address)),this.#n=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.panning)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.mute)),this.#a=this.own(this.bindParameter(this.#t.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#e.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#p=!1}get isMute(){return this.#s.getValue()}get isSolo(){return this.#a.getValue()}get adapter(){return this.#t}get audioOutput(){return this.#e}handleEvent(e){}processAudio(e,t,n){if(this.#d.isEmpty())return;if(this.#h){let h=this.context.mixer;h.updateSolo();let f=this.isSolo||h.isVirtualSolo(this),v=this.isMute||h.hasChannelSolo()&&!f&&!this.#t.isOutput,g=De(this.#n.getValue()),y=this.#o.getValue();this.#u.set((1-Math.max(0,y))*g,this.#p),this.#l.set((1+Math.min(0,y))*g,this.#p),this.#c.set(v?0:1,this.#p),this.#h=!1}let i=this.#d.unwrap(),[o,s]=i.channels(),[a,u]=this.#e.channels(),[l,d]=this.#r;if(this.#u.isInterpolating()||this.#l.isInterpolating()||this.#c.isInterpolating())for(let h=t;h<n;h++){let f=this.#c.moveAndGet(),v=o[h]*this.#u.moveAndGet(),g=s[h]*this.#l.moveAndGet();a[h]=v*f,u[h]=g*f,l[h]=v,d[h]=g}else{let h=this.#u.get(),f=this.#l.get(),v=this.#c.get();for(let g=t;g<n;g++){let y=o[g]*h,b=s[g]*f;l[g]=y,d[g]=b,a[g]=y*v,u[g]=b*v}}this.#i.process(l,d,t,n),this.#p=!0}finishProcess(){this.#e.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#s?this.requestGainUpdate():e===this.#a&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#h=!0}requestSoloUpdate(){this.#h=!0}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}toString(){return`{${this.constructor.name}}`}};var Qu=class{#t=new V;#e;#r;#i;#n;#o;#s;#a=[];#u=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=E.newSet(n=>n.adapter.uuid),this.#n=this.#t.own(new Xu(this.#e.context,this.#e.adapter)),this.#o=E.newSet(({device:n})=>n.uuid),this.#s=this.#t.own(new V),this.#t.ownAll(this.#e.adapter.audioEffects.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=_o.create(this.#e.context,n.box),o=this.#o.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(o,"Could not add.")},onRemove:n=>{this.invalidateWiring();let{device:i,subscription:o}=this.#o.removeByKey(n.uuid);o.terminate(),i.terminate()},onReorder:n=>this.invalidateWiring()}),this.#e.adapter.auxSends.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=this.#i.add(new Yu(this.#e.context,n));N(i,"Could not add.")},onRemove:({uuid:n})=>{this.invalidateWiring(),this.#i.removeByKey(n).terminate()},onReorder:n=>{}}),this.#e.adapter.output.catchupAndSubscribe(n=>this.invalidateWiring()),this.#e.context.subscribeProcessPhase(n=>{n===0&&this.#u&&(this.#l(),this.#u=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#s.terminate(),this.#u=!0}terminate(){this.#t.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#a=[]}toString(){return`{${this.constructor.name}}`}#l(){let e=this.#e.adapter.isOutput,t=this.#e.context,n=this.#e.input(),i=this.#e.adapter.output.adapter.map(s=>t.getAudioUnit(s.deviceHost().uuid).inputAsAudioBus());if(n.isEmpty()||i.isEmpty()&&!e)return;let o=n.unwrap();if(this.#r.includeAudioEffects){P.replace(this.#a,this.#e.adapter.audioEffects.adapters().map(({uuid:s})=>this.#o.get(s).device));for(let s of this.#a)s.adapter().enabledField.getValue()&&(this.#s.own(s.setAudioSource(o.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,s.incoming)),o=s)}if(this.#r.includeSends&&this.#i.forEach(s=>{let a=t.getAudioUnit(s.adapter.targetBus.deviceHost().uuid);this.#s.own(s.setAudioSource(o.audioOutput)),this.#s.own(a.inputAsAudioBus().addAudioSource(s.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,s)),this.#s.own(t.registerEdge(s,a.inputAsAudioBus()))}),this.#s.own(this.#n.setAudioSource(o.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,this.#n)),i.nonEmpty()&&!e){let s=i.unwrap();this.#s.own(s.addAudioSource(this.#n.audioOutput)),this.#s.own(t.registerEdge(this.#n,s))}}};var el=class{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=Mo.create(268431651),this.#n=new Set,this.#o=new fi,this.#t.ownAll(this.#e.subscribeProcessPhase(n=>{if(n===1)for(let i of this.#n)i.gate||this.#n.delete(i)}))}get uuid(){return this.#r.uuid}terminate(){this.#t.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:m.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,n){let i=Fe.every(n,5);if(this.#o.nonEmpty()&&(!i||Fe.every(n,2)?yield*this.#l(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:s,velocity:a}=o,u=Number.POSITIVE_INFINITY,l=ie.start(e,u,s,a);o.running=m.wrap(l),yield l}o.gate||(this.#n.delete(o),yield ie.stop(o.running.unwrap("raw note never started"),e))}if(i){let o=this.#r.tracks.collection.adapters().filter(s=>s.type===se.Notes&&s.enabled.getValue());for(let s of o)for(let{optClip:a,sectionFrom:u,sectionTo:l}of this.#e.clipSequencing.iterate(s.uuid,e,t))a.isEmpty()?yield*this.#a(s,u,l):yield*this.#s(a.unwrap(),u,l);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:n,velocity:i}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:n,velocity:i,cent:0};t||(yield*this.#o.overlapping(e,Ze.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#s(e,t,n){if(e.optCollection.isEmpty())return;let i=e.optCollection.unwrap(),o=e.duration,s=Ct(t,o),a=s+o;n>a?(yield*this.#u(i,t,a,s),yield*this.#u(i,a,n,a)):yield*this.#u(i,t,n,s)}*#a(e,t,n){for(let i of e.regions.collection.iterateRange(t,n)){if(this.#e.ignoresRegion(i.address.uuid)||i.mute||!fe(i,vr))continue;let o=i.optCollection;if(o.isEmpty())continue;let s=o.unwrap();for(let{resultStart:a,resultEnd:u,rawStart:l}of We.locateLoops(i,t,n))yield*this.#u(s,a,u,l)}}*#u(e,t,n,i){let o=t-i,s=n-i;for(let a of e.events.iterateRange(o-e.maxDuration,s)){if(!Ze.isOfType(a))continue;let{position:u,duration:l,chance:d,playCount:h,playCurve:f}=a;if(!(d<100&&this.#i.nextDouble(0,100)>d)){if(h>1){let v=Ze.inverseCurveFunc((o-u)/l,f),g=Ze.inverseCurveFunc((s-u)/l,f),y=Math.floor(v*h),b=y/h;for(;b<g;){if(b>=v){let C=Ze.curveFunc(b,f)*l;if(C>=l)break;let U=Ze.curveFunc(b+1/h,f)*l,j=ie.startWith(a,u+C+i,U-C);this.#o.addAndRetain({...j}),yield j}b=++y/h}}else if(o<=u&&u<s){let v=ie.startWith(a,u+i);this.#o.addAndRetain({...v}),yield v}}}}*#l(e){for(let t of this.#o.releaseAll())yield ie.stop(t,e)}*#c(e,t){for(let n of this.#o.releaseLinearCompleted(t)){let i=G(n.position+n.duration,e,t);yield ie.stop(n,i)}}};var tl=class{#t=new V;#e;#r;#i;#n;#o=!1;constructor(e){this.#e=e,this.#r=this.#t.own(new el(this.#e.context,this.#e.adapter)),this.#i=E.newSet(({device:t})=>t.uuid),this.#n=this.#t.own(new V),this.#t.ownAll(this.#e.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let n=qp.create(this.#e.context,t.box),i=this.#i.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(i,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:n,subscription:i}=this.#i.removeByKey(t.uuid);i.terminate(),n.terminate()},onReorder:t=>this.invalidateWiring()}),this.#e.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#s(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#t.terminate()}toString(){return`{${this.constructor.name}}`}#s(){let e=this.#e.input().flatMap(i=>i.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),n=this.#r;this.#e.adapter.midiEffects.adapters().map(i=>this.#i.get(i.uuid).device).forEach(i=>{i.adapter().enabledField.getValue()&&(this.#n.ownAll(i.setNoteEventSource(n),this.#e.context.registerEdge(i,t.incoming)),n=i)}),this.#n.own(t.setNoteEventSource(n))}};var rl=class r{static ID=0;#t=r.ID++;#e=new V;#r;#i;#n;#o;#s=m.None;constructor(e,t,n){this.#r=e,this.#i=t,this.#n=this.#e.own(new tl(this)),this.#o=this.#e.own(new Qu(this,n)),this.#e.ownAll(this.#i.input.catchupAndSubscribe(i=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#s.ifSome(o=>o.terminate()),this.#s=i.getValue().flatMap(o=>m.wrap(Zp.create(e,o.box.box)))}))}input(){return this.#s}inputAsAudioBus(){return Mr(this.#s.unwrap("No input available"),vn)}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.#e.terminate(),this.#s.ifSome(e=>e.terminate()),this.#s=m.None}toString(){return`{${this.constructor.name}(${this.#t})}`}};var il=class{#t;#e;#r;#i=!1;constructor(){this.#t=E.newSet(e=>e.adapter.uuid),this.#e=new Set,this.#r=new Set}attachChannelStrip(e){return this.#t.add(e),Z.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#e.delete(e),this.#t.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#e.add(e):this.#e.delete(e),this.#n()}hasChannelSolo(){return this.#e.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#t.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=n=>{e.has(n)||(e.add(n),n.adapter.input.getValue().ifSome(i=>{i.type==="bus"&&i.box.input.pointerHub.filter(c.AudioOutput).map(o=>H(o.box.accept({visitAudioUnitBox:({address:{uuid:s}})=>this.#t.get(s),visitAuxSendBox:({audioUnit:{targetVertex:s}})=>this.#t.get(s.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#t.forEach(n=>{n.isSolo&&t(n)}),this.#i=!1}};var Or;(function(r){let e=typeof self<"u"&&"location"in self&&typeof self.location!==void 0,t=typeof self<"u"&&"navigator"in self&&typeof self.navigator!==void 0;r.isLocalHost=()=>e&&location.host.includes("localhost"),r.isMacOS=()=>t&&navigator.userAgent.includes("Mac OS X"),r.isWindows=()=>t&&navigator.userAgent.includes("Windows"),r.isFirefox=()=>t&&navigator.userAgent.toLowerCase().includes("firefox"),r.isWeb=()=>!r.isTauriApp(),r.isVitest=typeof process<"u"&&process.env?.VITEST==="true",r.isTauriApp=()=>"__TAURI__"in window,r.userAgent=t?navigator.userAgent.replace(/^Mozilla\/[\d.]+\s*/,"").replace(/\bAppleWebKit\/[\d.]+\s*/g,"").replace(/\(KHTML, like Gecko\)\s*/g,"").replace(/\bSafari\/[\d.]+\s*/g,"").replace(/\s+/g," ").trim():"N/A",r.id=()=>{if(!e)return"";let n="__id__",i=localStorage.getItem(n);if(z(i))return i;let o=E.toString(E.generate());return localStorage.setItem(n,o),o}})(Or||(Or={}));var pv;(function(r){r.encode=async(e,t="gzip")=>{let n=new CompressionStream(t),i=n.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(n.readable).arrayBuffer()},r.decode=async(e,t="gzip")=>{let n=new DecompressionStream(t),i=n.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(n.readable).arrayBuffer()}})(pv||(pv={}));var mv;(function(r){r.exportMethod=(i,o)=>n(i,{value:o}),r.exportBoolean=(i,o=!1)=>{let s=new Le(o);return r.exportAccessor(i,()=>s.getValue(),a=>{let u=!!a;console.debug(`set to ${u}`),s.setValue(u)}),s},r.exportAccessor=(i,o,s=rm)=>n(i,{get:()=>{try{return console.debug(o()),0}catch(a){return console.error(a),1}},set:a=>{try{return s(a),o()}catch(u){return console.error(u),1}},enumerable:!1,configurable:!1});let e=(()=>{try{return self}catch{return{}}})(),t=e.opendaw??={},n=(i,o)=>{let s=i.split("."),a=s.splice(-1)[0],u=t;for(let l of s)u=u[l]??={};Object.defineProperty(u,a,o),console.debug(`Console command 'opendaw.${i}' exported`)}})(mv||(mv={}));var fv;(function(r){r.resolveString=e=>{if(!Bo(e)){if(typeof e=="string")return e;if(Array.isArray(e))return e.join(",");if(typeof e=="object"){if(typeof e.exact=="string")return e.exact;if(Array.isArray(e.exact))return e.exact.join(",");if(typeof e.ideal=="string")return e.ideal;if(Array.isArray(e.ideal))return e.ideal.join(",")}}}})(fv||(fv={}));var gv;(function(r){r.truncateText=(e,t,n)=>{if(t.length===0)return{text:"",width:0};let i=e.measureText(t).width;if(i<=n)return{text:t,width:i};let o=e.measureText("\u2026").width,s=0,a=t.length|0;for(;s<a;){let l=a+s>>>1;i=e.measureText(t.substring(0,l+1)).width+o,i<=n?s=l+1:a=l}if(s===0)return{text:"",width:0};let u=t.substring(0,s);return{text:u+"\u2026",width:e.measureText(u).width+o}}})(gv||(gv={}));var vv;(function(r){r.calc=(t,n,i)=>{let o=/([0-9]*\.?[0-9]+)([a-zA-Z%]*)/g,s=t;return s.split(/\+|(?<!\d)-/).flatMap(a=>Array.from(a.matchAll(o))).forEach(([a,u,l])=>{let d=parseFloat(u);if(isNaN(d))return w(`${a} does not contain a number`);if(l==="em")s=s.replaceAll(a,`${d*i}`);else if(l==="%")s=s.replaceAll(a,`${d/100*n}`);else if(l==="px")s=s.replaceAll(a,`${d}`);else return w(`Unknown unit '${l}'`)}),Function(`return ${s}`)()};let e=new Map;r.registerCustomCursor=(t,n)=>e.set(t,n),r.setCursor=(t,n=document)=>{n.documentElement.style.cursor=typeof t=="number"?e.get(t)??"auto":t}})(vv||(vv={}));var Io;(function(r){let e=new Set,t=new Set,n=new Array,i=-1,o=null;r.add=s=>(t.add(s),{terminate:()=>t.delete(s)}),r.once=s=>{e.add(s)},r.start=s=>{let a=()=>{o===s&&((t.size>0||e.size>0)&&(t.forEach(u=>n.push(u)),e.forEach(u=>n.push(u)),e.clear(),n.forEach(u=>u()),n.length=0),i=s.requestAnimationFrame(a))};i=s.requestAnimationFrame(a),o=s,a()},r.terminate=()=>{console.debug("AnimationFrame terminate"),e.clear(),t.clear(),n.length=0,cancelAnimationFrame(i)}})(Io||(Io={}));var et=class{static subscribe(e,t,n,i){return e.addEventListener(t,n,i),{terminate:()=>e.removeEventListener(t,n,i)}}static subscribeAny(e,t,n,i){return e.addEventListener(t,n,i),{terminate:()=>e.removeEventListener(t,n,i)}}static DOUBLE_DOWN_THRESHOLD=200;static subscribeDblDwn=(e,t)=>{let n=0;return this.subscribe(e,"pointerdown",i=>{let o=performance.now();o-n<this.DOUBLE_DOWN_THRESHOLD&&t(i),n=o},{capture:!0})};static PreventDefault=e=>e.preventDefault();static isTextInput=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&z(e.getAttribute("contenteditable"))};var Cr;(function(r){r.isControlKey=({ctrlKey:e,metaKey:t})=>Or.isMacOS()?t:e,r.isCopyKey=({altKey:e})=>e,r.GlobalShortcut=Object.freeze({isDelete:e=>!et.isTextInput(e.target)&&(e.code==="Delete"||e.code==="Backspace"),isSelectAll:e=>r.isControlKey(e)&&!e.shiftKey&&e.code==="KeyA",isDeselectAll:e=>r.isControlKey(e)&&e.shiftKey&&e.code==="KeyA"})})(Cr||(Cr={}));var xv;(function(r){r.attach=(e,t,n)=>{let i=new V;return Z.many(i,et.subscribe(e,"pointerdown",o=>{if(n?.multiTouch!==!0&&!o.isPrimary||o.buttons!==1||Or.isMacOS()&&o.ctrlKey)return;let s=t(o);if(s.isEmpty())return;let a=s.unwrap(),u=o.pointerId;o.stopPropagation(),o.stopImmediatePropagation(),e.setPointerCapture(u);let l={clientX:o.clientX,clientY:o.clientY,altKey:o.altKey,shiftKey:o.shiftKey,ctrlKey:Cr.isControlKey(o)};n?.immediate===!0&&a.update(l),n?.permanentUpdates===!0?(i.own(Io.add(()=>a.update(l))),i.own(et.subscribe(e,"pointermove",f=>{f.pointerId===u&&(l.clientX=f.clientX,l.clientY=f.clientY,l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Cr.isControlKey(f))}))):i.own(et.subscribe(e,"pointermove",f=>{f.pointerId===u&&(l.clientX=f.clientX,l.clientY=f.clientY,l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Cr.isControlKey(f),a.update(l))}));let d=()=>{a.cancel?.call(a),a.finally?.call(a),i.terminate()},h=em(e,"ownerDocument","defaultView")??self;i.ownAll(et.subscribe(e,"pointerup",f=>{f.pointerId===u&&(a.approve?.call(a),a.finally?.call(a),i.terminate())},{capture:!0}),et.subscribe(e,"pointercancel",f=>{console.debug(f.type),f.pointerId===u&&(e.releasePointerCapture(u),d())},{capture:!0}),et.subscribe(h,"beforeunload",f=>{e.releasePointerCapture(u),d()},{capture:!0}),et.subscribe(h,"keydown",f=>{l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Cr.isControlKey(f),f.key==="Escape"?d():a.update(l)}),et.subscribe(h,"keyup",f=>{l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Cr.isControlKey(f),a.update(l)})),z(a.abortSignal)&&i.own(et.subscribe(a.abortSignal,"abort",()=>{e.releasePointerCapture(u),d()}))}))}})(xv||(xv={}));var yv;(function(r){r.save=async(e,t)=>{if(z(window.showSaveFilePicker)){let n=await window.showSaveFilePicker(t),i=await n.createWritable();return await i.truncate(0),await i.write(e),await i.close(),n.name??"unknown"}else{let n=new Blob([e]),i=URL.createObjectURL(n),o=document.createElement("a");return o.href=i,o.download=t?.suggestedName??"unknown",o.click(),URL.revokeObjectURL(i),t?.suggestedName??"Unknown"}},r.open=async e=>{if(z(window.showOpenFilePicker)){let{status:t,value:n,error:i}=await ur.tryCatch(window.showOpenFilePicker(e));return t==="rejected"?Promise.reject(i):Promise.all(n.map(o=>o.getFile()))}else return new Promise((t,n)=>{z(e)&&console.warn("FileApi.showOpenFilePicker is emulated in this browser. OpenFilePickerOptions are ignored.");let i=document.createElement("input");i.type="file",i.multiple=e?.multiple??!1,i.style.display="none",i.addEventListener("cancel",async()=>{i.remove(),n(new DOMException("cancel","AbortError"))}),i.addEventListener("change",async o=>{let a=o.target.files;z(a)?t(P.create(u=>H(a.item(u),`No file at index ${u}`),a.length)):n(new DOMException("cancel","AbortError")),i.remove()}),document.body.appendChild(i),i.click()})}})(yv||(yv={}));var bv;(function(r){r.parse=e=>{let t=document.createElement("div");if(t.innerHTML=e,t.childElementCount!==1)return w(`Source html has more than one root elements: '${e}'`);let n=t.firstChild;return n instanceof HTMLElement||n instanceof SVGSVGElement?n:w(`Cannot parse to HTMLOrSVGElement from '${e}'`)},r.empty=e=>{for(;e.firstChild!==null;)e.firstChild.remove()},r.query=(e,t=document)=>H(t.querySelector(e)),r.queryAll=(e,t=document)=>Array.from(t.querySelectorAll(e)),r.sanitize=e=>{e.querySelectorAll("script").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{[...t.attributes].forEach(n=>{n.name.toLowerCase().startsWith("on")&&t.removeAttribute(n.name)})})},r.nextID=(()=>{let e=0;return()=>(++e).toString(16).padStart(4,"0")})(),r.adoptStyleSheet=(e,t)=>{N(e.includes("component"),`No 'component' found in: ${e}`);let n=`${t??"C"}${r.nextID()}`,i=new CSSStyleSheet;return i.replaceSync(e.replaceAll("component",`.${n}`)),i.cssRules.length===0?w(`No cssRules found in: ${e}`):(document.adoptedStyleSheets.push(i),n)},r.buildClassList=(...e)=>e.filter(t=>t!==!1&&t!==void 0).join(" "),r.readCssVarColor=(...e)=>{let t=document.createElement("div");document.body.appendChild(t);let n=e.map(i=>(t.style.color=i,Co.parseCssRgbOrRgba(getComputedStyle(t).color)));return t.remove(),n},r.watchResize=(e,t,n)=>{let i=new ResizeObserver(([o],s)=>t(o,s));return i.observe(e,n),{terminate:()=>i.disconnect()}},r.watchIntersection=(e,t,n)=>{let i=new IntersectionObserver(t,n);return i.observe(e),{terminate:()=>i.disconnect()}},r.secureBoundingBox=e=>{let t=e.getBoundingClientRect();if(!Sn.isEmpty(t))return t;for(let n of e.children)Sn.union(t,r.secureBoundingBox(n));return t},r.unfocus=(e=self)=>{let t=e.document.activeElement;t!==null&&"blur"in t&&typeof t.blur=="function"&&t.blur()},r.selectContent=e=>{let t=document.createRange(),n=window.getSelection();z(n)&&(t.selectNodeContents(e),n.removeAllRanges(),n.addRange(t))},r.unselectContent=e=>{let t=window.getSelection();!z(t)||t.rangeCount===0||e.contains(t.getRangeAt(0).commonAncestorContainer)&&t.removeAllRanges()},r.limitChars=(e,t,n)=>{if(!(t in e))return w(`${t} not found in ${e}`);if(typeof e[t]!="string")return w(`${t} in ${e} is not a string`);if(e[t].length>n)if(e[t]=e[t].substring(0,n),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.setSelectionRange(n,n);else{let i=e.ownerDocument,o=i.createRange(),s=i.defaultView?.getSelection();if(!z(s))return;o.selectNodeContents(e),o.collapse(!1),s.removeAllRanges(),s.addRange(o)}},r.EmptyGif="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="})(bv||(bv={}));var bG=(()=>{let r={Cmd:"\u2318",Opt:"\u2325",Shift:"\u21E7"},e={Cmd:"Ctrl",Opt:"Alt",Shift:"\u21E7"};return Object.freeze({Mac:r,Win:e,System:Or.isMacOS()?r:e})})();var wv;(function(r){r.read=async e=>{let t=[];for(;;){let{done:s,value:a}=await e.read();if(s)break;t.push(a)}let n=t.reduce((s,a)=>s+a.length,0),i=new Uint8Array(n),o=0;for(let s of t)i.set(s,o),o+=s.length;return i.buffer}})(wv||(wv={}));var Av;(function(r){r.pathBuilder=()=>new class{#t="";moveTo(e,t){return this.#t+=`M${e.toFixed(3)} ${t.toFixed(3)}`,this}lineTo(e,t){return this.#t+=`L${e.toFixed(3)} ${t.toFixed(3)}`,this}quadratic(e,t,n,i){return this.#t+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)}`,this}quadraticTo(e,t){return this.#t+=`T${e.toFixed(3)} ${t.toFixed(3)}`,this}cubic(e,t,n,i,o,s){return this.#t+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)} ${o.toFixed(3)} ${s.toFixed(3)}`,this}arc(e,t,n,i,o,s,a){return this.#t+=`A${e} ${t} ${n} ${i?1:0} ${o?1:0} ${s.toFixed(3)} ${a.toFixed(3)}`,this}circleSegment(e,t,n,i,o){let s=e+Math.cos(i)*n,a=t+Math.sin(i)*n,u=e+Math.cos(o)*n,l=t+Math.sin(o)*n,d=o-i;for(;d<0;)d+=Math.PI*2;return this.moveTo(s,a).arc(n,n,0,d>Math.PI,!0,u,l)}close(){return this.#t+="Z",this}get(){return this.#t}}})(Av||(Av={}));var $v;(function(r){let e=new Array;r.watchWeak=(n,i)=>{let o=new WeakRef(n),s=i(o);return e.push([o,s]),e.length===1&&t(),n};let t=()=>{console.debug("start weak watching");let n=setInterval(()=>{let i=e.length;for(;--i>=0;){let o=e[i];o[0].deref()===void 0&&(o[1].terminate(),e.splice(i,1),e.length===0&&clearInterval(n))}},1e3)}})($v||($v={}));var nl=Symbol.for("@openDAW/lib-dom");globalThis[nl]?console.debug(`%c${nl.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[nl]=!0,console.debug(`%c${nl.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Jt;(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"})(Jt||(Jt={}));var bn;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(bn||(bn={}));var ui;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(ui||(ui={}));var ol=class r{static create(e,t){return new r(e.channel(t))}#t=[];#e=new SharedArrayBuffer(1);#r=new Int8Array(this.#e);#i;#n=Ee.create(0);#o=m.None;#s=m.None;#a=-1;#u=-1;#l=!1;#c=!1;constructor(e){this.#i=qe.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(n){t(this.sendShareLock,n)}sendUpdateData(n){t(this.sendUpdateData,n)}sendUpdateStructure(n){t(this.sendUpdateStructure,n)}})}flush(){let e=this.#d();if(e.nonEmpty()){this.#c||(this.#i.sendShareLock(this.#e),this.#c=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#h();if(this.#n.remaining<t){let n=Dt(t),i=new SharedArrayBuffer(n);this.#n=Ee.use(i),this.#o=m.wrap(i),this.#i.sendUpdateData(i)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===bn.WRITE&&(this.#p(this.#n),this.#n.position=0,Atomics.store(this.#r,0,bn.READ))}broadcastFloat(e,t){return this.#f(new class{type=Jt.Float;address=e;capacity=8;put(n){n.writeFloat(t())}})}broadcastInteger(e,t){return this.#f(new class{type=Jt.Integer;address=e;capacity=8;put(n){n.writeInt(t())}})}broadcastFloats(e,t,n){return this.#f(new class{type=Jt.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(i){n(),i.writeInt(t.length);for(let o of t)i.writeFloat(o)}})}broadcastIntegers(e,t,n){return this.#f(new class{type=Jt.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i){n(),i.writeInt(t.length),t.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,t,n){return this.#f(new class{type=Jt.ByteArray;address=e;capacity=4+t.byteLength;put(i){n(),i.writeInt(t.byteLength),i.writeBytes(t)}})}#d(){if(this.#l){try{this.#s=m.wrap(this.#y())}catch(e){throw e}this.#l=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=m.None,e}return m.None}#h(){return this.#u===-1&&(this.#u=this.#g()+12),this.#u}terminate(){P.clear(this.#t),this.#s=m.None,this.#l=!1,this.#u=0}#p(e){N(!this.#l&&this.#s.isEmpty(),"Cannot flush while update is available");let t=this.#h();N(e.remaining>=t,"Insufficient data"),e.writeInt(this.#a),e.writeInt(ui.START);for(let n of this.#t)n.put(e);e.writeInt(ui.END)}#g(){return this.#t.reduce((e,t)=>e+t.capacity,0)}#f(e){return this.#t.push(e),this.#v(),{terminate:()=>{P.removeOpt(this.#t,e),this.#v()}}}#v(){this.#u=-1,this.#l=!0}#y(){let e=Ee.create();e.writeInt(ui.ID),e.writeInt(++this.#a),e.writeInt(this.#t.length);for(let{address:t,type:n}of this.#t)t.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Dr;(function(r){class e{shift;numPeaks;dataOffset;constructor(n,i,o){this.shift=n,this.numPeaks=i,this.dataOffset=o}unitsEachPeak(){return 1<<this.shift}}r.Stage=e,r.unpack=(t,n)=>{switch(n){case 0:return Qt.intBitsToFloat(t);case 1:return Qt.intBitsToFloat(t>>16);default:return Bt(n)}}})(Dr||(Dr={}));var sl=class r{stages;data;numFrames;numChannels;static from(e){N(e.readString()==="PEAKS","Wrong header");let t=e.readInt(),n=[];for(let u=0;u<t;u++){let l=e.readInt(),d=e.readInt(),h=e.readInt();e.readInt(),n[u]=new Dr.Stage(h,d,l)}let i=e.readInt(),o=[];for(let u=0;u<i;u++){let l=new Int8Array(e.readInt());e.readBytes(l),o[u]=new Int32Array(l.buffer)}let s=e.readInt(),a=e.readInt();return new r(n,o,s,a)}static None=new r([],[],0,0);static findBestFit=(e,t=1200)=>{let n=e/t;if(n<=1)return new Uint8Array(0);let i=3,o=Math.floor(Math.log(n)/Math.LN2),s=Math.max(1,Math.floor(o/i));return new Uint8Array(P.create(a=>i*(a+1),s))};constructor(e,t,n,i){this.stages=e,this.data=t,this.numFrames=n,this.numChannels=i}nearest(e){if(this.stages.length===0)return null;let t=Math.floor(Math.log(Math.abs(e))/Math.LN2),n=this.stages.length;for(;--n>-1;)if(t>=this.stages[n].shift)return this.stages[n];return this.stages[0]}toArrayBuffer(){let e=Ee.create();e.writeString("PEAKS"),e.writeInt(this.stages.length);for(let t=0;t<this.stages.length;t++){let{dataOffset:n,numPeaks:i,shift:o}=this.stages[t];e.writeInt(n),e.writeInt(i),e.writeInt(o),e.writeInt((1<<o)-1)}e.writeInt(this.data.length);for(let t=0;t<this.data.length;t++){let n=new Int8Array(this.data[t].buffer);e.writeInt(n.length),e.writeBytes(n)}return e.writeInt(this.numFrames),e.writeInt(this.numChannels),e.toArrayBuffer()}toString(){return`{SamplePeaks num-stages: ${this.stages.length}}`}};var Ev;(function(r){r.install=n=>qe.executor(n.channel("peaks"),new class{async generateAsync(i,o,s,a,u){return e(i,o,s,a,u).toArrayBuffer()}});let e=(n,i,o,s,a)=>{if(o.length!==a)return w(`Invalid numberOfChannels. Expected: ${a}. Got ${o.length}`);class u{min=Number.POSITIVE_INFINITY;max=Number.NEGATIVE_INFINITY;index=0}let l=Dm(),d=i.length,[h,f]=t(i,s),v=P.create(()=>new Int32Array(f),a),g=(1<<h[0].shift)-1,y=a*s,b=0;for(let C=0;C<a;++C){let U=v[C],j=o[C],L=P.create(()=>new u,d),ee=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,we=0;for(let J=0;J<s;++J){let ue=j[J];if(ee=Math.min(ue,ee),be=Math.max(ue,be),(++we&g)===0){for(let q=0;q<d;++q){let ae=h[q],le=L[q];le.min=Math.min(le.min,ee),le.max=Math.max(le.max,be),((1<<ae.shift)-1&we)===0&&(U[ae.dataOffset+le.index++]=r.pack(le.min,le.max),le.min=Number.POSITIVE_INFINITY,le.max=Number.NEGATIVE_INFINITY)}ee=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY}(++b&65535)===0&&n(b/y)}}return n(1),l.lab(`SamplePeaks '${self.constructor.name}'`),new sl(h,v,s,a)},t=(n,i)=>{let o=0;return[P.create(a=>{let u=n[a],l=Math.ceil(i/(1<<u)),d=new Dr.Stage(u,l,o);return o+=l,d},n.length),o]};r.pack=(n,i)=>{let o=Qt.floatToIntBits(n),s=Qt.floatToIntBits(i);return o|s<<16}})(Ev||(Ev={}));var Sv;(function(r){r.renderBlocks=(e,t,n,{u0:i,u1:o,v0:s,v1:a,x0:u,x1:l,y0:d,y1:h})=>{let f=(o-i)/(l-u),v=t.nearest(f);if(v===null)return;let g=(h-d-1)/(a-s),y=v.unitsEachPeak(),b=u-Math.floor(u),C=f/y,U=(i-b*f)/f*C,j=Math.floor(U),L=0,ee=0,be=t.data[n];for(let we=Math.floor(u);we<Math.floor(l);we++){let J=U+C,ue=Math.floor(J),q=!1;for(;j<ue;){let ze=be[v.dataOffset+j++];L=Math.min(Dr.unpack(ze,0),L),ee=Math.max(Dr.unpack(ze,1),ee),q=!0}let ae=d+Math.floor((L-s)*g),le=d+Math.floor((ee-s)*g),it=Math.max(d,Math.min(ae,le)),pt=Math.min(h,Math.max(ae,le));if(e.fillRect(we,it,1,pt===it?1:pt-it),q){let ze=ee;ee=L,L=ze}U=J,j=ue}}})(Sv||(Sv={}));var Nv;(function(r){r.init=n=>qe.executor(n.channel("opfs"),new class{#t=new Map;async write(i,o){await this.#e(i,async()=>{let s=await this.#r(i,{create:!0});try{s.truncate(o.length),s.write(o.buffer,{at:0}),s.flush()}finally{s.close()}})}async read(i){return await this.#e(i,async()=>{let o=await this.#r(i);try{let s=o.getSize(),a=new Uint8Array(s);return o.read(a),a}finally{o.close()}})}async delete(i){await this.#e(i,async()=>{let o=t(i);return o.length===0?this.clear():this.#i(o.slice(0,-1)).then(s=>s.removeEntry(H(o.at(-1)),{recursive:!0}))})}async list(i){let o=t(i),{status:s,value:a}=await ur.tryCatch(this.#i(o));if(s==="rejected")return P.empty();let u=[];for await(let{name:l,kind:d}of a.values())u.push({name:l,kind:d});return u}async clear(){let i=await navigator.storage.getDirectory();for await(let[o,s]of i.entries())s.kind==="file"?await i.removeEntry(o):s.kind==="directory"&&await i.removeEntry(o,{recursive:!0})}async#e(i,o){for(;;){let s=this.#t.get(i);if(nt(s)){await s;continue}let a=()=>w("Lock not acquired"),u=new Promise(l=>a=l);this.#t.set(i,u);try{return await o()}finally{this.#t.get(i)===u&&this.#t.delete(i),a()}}}async#r(i,o){let s=t(i);return await(await(await this.#i(s.slice(0,-1),o)).getFileHandle(H(s.at(-1)),o)).createSyncAccessHandle()}async#i(i,o){let s=await navigator.storage.getDirectory();for(let a of i)s=await s.getDirectoryHandle(a,o);return s}});let t=n=>{let i=n.replace(/^\/+|\/+$/g,"");return i===""?[]:i.split("/")}})(Nv||(Nv={}));var al=Symbol.for("@openDAW/lib-fusion");globalThis[al]?console.debug(`%c${al.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[al]=!0,console.debug(`%c${al.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var ul=class{#t;#e=new de;#r=[];constructor(e){this.#t=e}process({blocks:e}){e.forEach(({p0:t,p1:n,bpm:i,s0:o,s1:s,flags:a})=>{if(this.#t.metronomeEnabled&&Fe.every(a,1))for(let u of or.iterate(t,n,te.Quarter)){N(t<=u&&u<n,`${u} out of bounds (${t}, ${n})`);let l=Math.floor(te.pulsesToSamples(u-t,i,sampleRate));this.#r.push(new Hp(u,o+l))}this.#e.clear(o,s);for(let u=this.#r.length-1;u>=0;u--)this.#r[u].processAdd(this.#e,o,s)&&this.#r.splice(u,1)})}get output(){return this.#e}},Hp=class{#t;#e=0;#r=0;constructor(e,t){N(t>=0&&t<128,`${t} out of bounds`),this.#t=te.toParts(e).beats===0?880:440,this.#r=t}processAdd(e,t,n){let[i,o]=e.channels(),s=Math.floor(.002*sampleRate),a=Math.floor(.05*sampleRate);for(let u=Math.max(this.#r,t);u<n;u++){let l=Math.min(this.#e/s,1-(this.#e-s)/a),d=Math.sin(this.#e/sampleRate*ft*this.#t)*.25*l*l;if(i[u]+=d,o[u]+=d,++this.#e>s+a)return!0}return this.#r=0,!1}};var ll=class{#t;#e;#r=!0;#i=!1;#n=null;#o=!1;#s=0;constructor(e,t){this.#t=e,this.#t.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#t.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#e=new zo}setCallback(e,t){return this.#e.add(e,t),Z.create(()=>this.#e.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#s=0,this.#n=null}process(e){let t=!1,{timeInfo:n,timelineBoxAdapter:{box:i,markerTrack:o}}=this.#t,s=i.bpm.getValue(),a=n.transporting;if(a){let u=[],l=n.position,d=0,h=0,f=n.getLeapStateAndReset();for(;d<128;){if(this.#o||f){this.#o=!1;let J=o.events.lowerEqual(l);(this.#n?.at(0)??null)!==J&&(this.#n=z(J)?[J,0]:null,t=!0)}let v=128-d,g=l+te.samplesToPulses(v,s,sampleRate),y=null,b=Number.POSITIVE_INFINITY;if(o.enabled){let J=Array.from(ve.take(o.events.iterateFrom(l),2));if(J.length>0){let[ue,q]=J;this.#n===null?ue.position>=l&&ue.position<g&&(y={type:"marker",prev:ue,next:q},b=ue.position):z(q)&&q!==this.#n[0]&&ue.position<l&&q.position<g&&(y={type:"marker",prev:ue,next:q},b=q.position)}}let{isRecording:C,isCountingIn:U}=this.#t.timeInfo,{from:j,to:L,enabled:ee}=i.loopArea;if(ee.getValue()&&!(C||U)||this.#r){let J=L.getValue();l<J&&g>J&&J<b&&(y={type:"loop",target:j.getValue()},b=J)}if(this.#e.keyCount()>0)for(let J of this.#e.keys())l<J&&g>J&&J<b&&(y={type:"callback",position:J,callbacks:this.#e.get(J)},b=J);let we=!n.isCountingIn;if(y===null){let J=d+v;u.push({index:h++,p0:l,p1:g,s0:d,s1:J,bpm:s,flags:fn.create(a,f,we,this.#i)}),f=!1,l=g,d=J}else{let J=()=>{if(b>l){let q=d+te.pulsesToSamples(b-l,s,sampleRate)|0;u.push({index:h++,p0:l,p1:b,s0:d,s1:q,bpm:s,flags:fn.create(a,f,we,this.#i)}),f=!1,l=b,d=q}},ue=()=>{if(d<128){let q=d+te.pulsesToSamples(g-l,s,sampleRate)|0;u.push({index:h++,p0:l,p1:b,s0:d,s1:q,bpm:s,flags:fn.create(!1,!1,!1,this.#i)}),d=q}};switch(y.type){case"loop":{J(),this.#r?(this.#t.timeInfo.pause(),ue()):(l=y.target,f=!0);break}case"marker":{let{prev:q,next:ae}=y;!z(this.#n)||this.#n[0]!==q?this.#n=[q,0]:++this.#n[1]<q.plays||q.plays===0?(J(),l=q.position,f=!0):this.#n=[ae,0],t=!0;break}case"callback":{J(),y.callbacks.forEach(q=>q());break}}}this.#i=!1}e({blocks:u}),n.advanceTo(l),this.#s=l}else{if(this.#o||n.getLeapStateAndReset()){this.#o=!1;let h=o.events.lowerEqual(n.position);h!==null&&this.#n?.at(0)!==h&&(this.#n=[h,0],t=!0)}let u=this.#s,l=u+te.samplesToPulses(128,s,sampleRate),d={blocks:[{index:0,p0:u,p1:l,s0:0,s1:128,bpm:s,flags:fn.create(!1,!1,!1,!1)}]};e(d),this.#s=l}t&&this.#t.engineToClient.switchMarkerState(z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var Gp=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(n=>this.#e=m.wrap(n))}peaks=m.None;#t={type:"idle"};#e=m.None;get data(){return this.#e}get state(){return this.#t}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},cl=class{#t;#e;constructor(e){this.#t=e,this.#e=E.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#e.getOrCreate(e,t=>new Gp(t,this.#t))}remove(e){}invalidate(e){}};var dl=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},hl=class{#t;#e;#r=[];#i=[];#n=[];constructor(e){this.#t=e,this.#t.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let n=t.uuid;this.#e.opt(n).ifSome(i=>{i.playing.ifSome(o=>this.#s(o.uuid)),i.playing=m.None,i.waiting=m.None}),this.#e.forEach(i=>{i.playing.nonEmpty()&&E.equals(i.playing.unwrap().uuid,n)&&(i.playing=m.None,this.#s(n));let o=i.waiting.flatMap(An);o.nonEmpty()&&E.equals(o.unwrap().uuid,n)&&(i.waiting=m.None)})}}}),this.#e=E.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let n=this.#e.getOrCreate(t,o=>new dl(o));if(n.playing.nonEmpty()&&n.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let i=n.waiting.flatMap(o=>o);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),n.waiting=m.None),console.debug(`schedulePlay(${E.toString(n.uuid)} > ${e})`),P.removeOpt(this.#n,e.uuid),n.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#e.getOrCreate(e,i=>new dl(i)),n=t.waiting.flatMap(i=>i);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),t.waiting=m.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${E.toString(e)})`),t.waiting=m.wrap(m.None))}reset(){this.#e.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(n=>this.#n.push(n.uuid))),e.waiting=m.None,e.playing.ifSome(t=>this.#s(t.uuid)),e.playing=m.None}),this.#e.clear()}*iterate(e,t,n){let i=this.#e.getOrNull(e);if(i===null){yield{optClip:m.None,sectionFrom:t,sectionTo:n};return}if(i.waiting.nonEmpty()){let o=i.waiting.unwrap(),s=i.playing.mapOr(u=>u.duration,te.Bar),a=Ct(n,s);a>=t?(t<a&&(yield{optClip:i.playing,sectionFrom:t,sectionTo:a}),i.waiting=m.None,i.playing.ifSome(u=>this.#s(u.uuid)),o.nonEmpty()?(i.playing=o,this.#o(o.unwrap().uuid)):i.playing=m.None,yield{optClip:i.playing,sectionFrom:a,sectionTo:n}):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}else if(i.playing.nonEmpty()){let o=i.playing.unwrap();if(o.box.playback.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:n};else{let s=Ct(t,o.duration)+o.duration;s<=n?(yield{optClip:i.playing,sectionFrom:t,sectionTo:s},i.playing=m.None,this.#s(o.uuid),s<n&&(yield{optClip:m.None,sectionFrom:s,sectionTo:n})):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}}else yield{optClip:m.None,sectionFrom:t,sectionTo:n}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=m.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 m.None}terminate(){this.#e.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#s(e){this.#i.push(e)}};var Wp;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(Wp||={});var Jp=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(n=>this.#e=m.wrap(n))}peaks=m.None;#t={type:"idle"};#e=m.None;get soundfont(){return this.#e}get state(){return this.#t}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},pl=class{#t;#e;constructor(e){this.#t=e,this.#e=E.newSet(t=>t.uuid)}getOrCreate(e){return this.#e.getOrCreate(e,t=>new Jp(t,this.#t))}remove(e){}invalidate(e){}};var I0=!1,ml=class extends AudioWorkletProcessor{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#d;#h;#p;#g;#f;#v;#y;#C;#P;#_;#E;#D;#k;#b;#x=m.None;#S=m.None;#I=m.None;#F=!1;#B=!0;#w=!1;#$=0;#A=0;#N=!0;#O=4;constructor({processorOptions:{sab:e,project:t,exportConfiguration:n,options:i}}){super();let{boxGraph:o,mandatoryBoxes:{rootBox:s,timelineBox:a}}=pa.decode(t);this.#t=new V,this.#e=Om.for(this.port),this.#r=o,this.#i=new is,this.#n=qe.sender(this.#e.channel("engine-to-client"),u=>new class{log(l){u.dispatchAndForget(this.log,l)}fetchAudio(l){return u.dispatchAndReturn(this.fetchAudio,l)}fetchSoundfont(l){return u.dispatchAndReturn(this.fetchSoundfont,l)}notifyClipSequenceChanges(l){u.dispatchAndForget(this.notifyClipSequenceChanges,l)}switchMarkerState(l){u.dispatchAndForget(this.switchMarkerState,l)}ready(){u.dispatchAndForget(this.ready)}}),this.#s=new cl(this.#n),this.#a=new pl(this.#n),this.#u=E.newSet(u=>u.adapter.uuid),this.#d=new da,this.#o=this.#t.own(new na(this)),this.#l=this.#o.adapterFor(s,ji),this.#c=this.#o.adapterFor(a,Nt),this.#h=new Ko,this.#p=new Zo(this.#h),this.#g=new W,this.#f=new il,this.#_=new ul(this.#i),this.#E=new ll(this,i),this.#b=E.newSet(u=>u),this.#D=mi.writer(Jm(),e,u=>{let{transporting:l,isCountingIn:d,isRecording:h,position:f}=this.#i;u.position=f,u.playbackTimestamp=this.#A,u.countInBeatsTotal=this.#O,u.countInBeatsRemaining=d?(this.#$-f)/te.Quarter:0,u.isPlaying=l,u.isRecording=h,u.isCountingIn=d}),this.#v=this.#t.own(ol.create(this.#e,"engine-live-data")),this.#C=new Eu(this),this.#P=this.#t.own(new he(this.#v,X.compose(E.Lowest))),this.#y=this.#t.own(new hl(this.#r)),this.#t.ownAll(zm(this.#r,this.#e.channel("engine-sync")),qe.executor(this.#e.channel("engine-commands"),{play:()=>{this.#N&&(this.#i.position=this.#A),this.#i.transporting=!0},stop:u=>{(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#N?this.#A:0);let l=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#w,this.#b.clear(),(u||!l)&&this.#R()},setPosition:u=>{this.#i.isRecording||(this.#i.position=this.#A=u)},startRecording:u=>{if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&u){let l=this.#i.position,d=this.#c.box.signature.nominator.getValue(),h=this.#c.box.signature.denominator.getValue();this.#$=Ct(l,te.fromSignature(d,h)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#$-te.fromSignature(this.#O,h);let f=this.#E.setCallback(this.#$,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#w,f.terminate()})}else this.#i.transporting=!0,this.#i.isRecording=!0},stopRecording:()=>{!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#w,this.#i.transporting=!1,this.#b.clear())},setMetronomeEnabled:u=>this.#i.metronomeEnabled=this.#w=u,setPlaybackTimestampEnabled:u=>this.#N=u,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(u=>u.accept({visitAudioFileBox:l=>this.#s.getOrCreate(l.address.uuid).data.nonEmpty()&&l.pointerHub.nonEmpty()})??!0)),panic:()=>this.#F=!0,noteSignal:u=>{if(Sr.isOn(u)){let{uuid:l,pitch:d,velocity:h}=u;this.optAudioUnit(l).ifSome(f=>f.midiDeviceChain.noteSequencer.pushRawNoteOn(d,h))}else if(Sr.isOff(u)){let{uuid:l,pitch:d}=u;this.optAudioUnit(l).ifSome(h=>h.midiDeviceChain.noteSequencer.pushRawNoteOff(d))}},ignoreNoteRegion:u=>this.#b.add(u),scheduleClipPlay:u=>{u.forEach(l=>{let d=this.#r.findBox(l);if(d.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${E.toString(l)}'`);else{let h=qs.for(this.#o,d.unwrap());this.#y.schedulePlay(h)}}),this.#i.transporting=!0},scheduleClipStop:u=>{u.forEach(l=>{let d=this.#r.findBox(l);d.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${E.toString(l)}'`):this.#y.scheduleStop(this.#o.adapterFor(d.unwrap(),Ne))})},terminate:()=>{this.#I.ifSome(u=>u.terminate()),this.#I=m.None,this.#B=!1,this.#b.clear(),this.#t.terminate()}}),this.#l.audioUnits.catchupAndSubscribe({onAdd:u=>{let l=E.toString(u.uuid),d=z(n?.[l])?n[l]:Wp.Default,h=new rl(this,u,d),f=this.#u.add(h);if(N(f,`Could not add ${h}`),h.adapter.isOutput){N(this.#S.isEmpty(),"Output can only assigned once."),this.#S=m.wrap(h);return}},onRemove:({uuid:u})=>this.#u.removeByKey(u).terminate(),onReorder:Ot})),this.#k=m.wrap(n).match({none:()=>P.empty(),some:u=>Object.keys(u).map(l=>this.#u.get(E.parse(l)))}),this.#n.ready(),console.log=(...u)=>this.#n.log(u.join(", "))}ignoresRegion(e){return this.#b.hasKey(e)}process(e,t){try{return this.render(e,t)}catch(n){throw this.#n.log(n),n}}render(e,[t]){if(!this.#B)return!1;if(this.#F)return w("Manual Panic");let n=this.#i.metronomeEnabled;this.#g.notify(0),this.#x.isEmpty()&&(this.#p.update(),this.#x=m.wrap(this.#p.sorted().concat()),I0&&console.debug(`%cAudio-Graph%c
25
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let h=d[1];if(e===d[0]){s(d);continue}if(n.external){let v=n.external.registry.get(d[0])?.id;if(e!==d[0]&&v){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(h.cycle){s(d);continue}if(h.count>1&&n.reused==="ref"){s(d);continue}}let a=(d,h)=>{let f=this.seen.get(d),v=f.def??f.schema,g={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){a(y,h);let b=this.seen.get(y).schema;b.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(b)):(Object.assign(v,b),Object.assign(v,g))}f.isParent||this.override({zodSchema:d,jsonSchema:v,path:f.path??[]})};for(let d of[...this.seen.entries()].reverse())a(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?u.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let d=n.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(d)}Object.assign(u,i.def);let l=n.external?.defs??{};for(let d of this.seen.entries()){let h=d[1];h.def&&h.defId&&(l[h.defId]=h.def)}n.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function yp(r,e){if(r instanceof hn){let n=new Eo(e),i={};for(let a of r._idmap.entries()){let[u,l]=a;n.process(l)}let o={},s={registry:r,uri:e?.uri,defs:i};for(let a of r._idmap.entries()){let[u,l]=a;o[u]=n.emit(l,{...e,external:s})}if(Object.keys(i).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[a]:i}}return{schemas:o}}let t=new Eo(e);return t.process(r),t.emit(r,e)}function Re(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Re(i.element,t);case"object":{for(let o in i.shape)if(Re(i.shape[o],t))return!0;return!1}case"union":{for(let o of i.options)if(Re(o,t))return!0;return!1}case"intersection":return Re(i.left,t)||Re(i.right,t);case"tuple":{for(let o of i.items)if(Re(o,t))return!0;return!!(i.rest&&Re(i.rest,t))}case"record":return Re(i.keyType,t)||Re(i.valueType,t);case"map":return Re(i.keyType,t)||Re(i.valueType,t);case"set":return Re(i.valueType,t);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Re(i.innerType,t);case"lazy":return Re(i.getter(),t);case"default":return Re(i.innerType,t);case"prefault":return Re(i.innerType,t);case"custom":return!1;case"transform":return!0;case"pipe":return Re(i.in,t)||Re(i.out,t);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${i.type}`)}var Gg={};var Nu={};Mr(Nu,{ZodISODate:()=>$u,ZodISODateTime:()=>Au,ZodISODuration:()=>Su,ZodISOTime:()=>Eu,date:()=>wp,datetime:()=>bp,duration:()=>$p,time:()=>Ap});var Au=x("ZodISODateTime",(r,e)=>{Cd.init(r,e),be.init(r,e)});function bp(r){return Rh(Au,r)}var $u=x("ZodISODate",(r,e)=>{Rd.init(r,e),be.init(r,e)});function wp(r){return Oh($u,r)}var Eu=x("ZodISOTime",(r,e)=>{Od.init(r,e),be.init(r,e)});function Ap(r){return zh(Eu,r)}var Su=x("ZodISODuration",(r,e)=>{zd.init(r,e),be.init(r,e)});function $p(r){return Mh(Su,r)}var Jg=(r,e)=>{Qn.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>eo(r,t)},flatten:{value:t=>Xn(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,nn,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,nn,2)}},isEmpty:{get(){return r.issues.length===0}}})},Vb=x("ZodError",Jg),et=x("ZodError",Jg,{Parent:Error});var Ep=an(et),Sp=un(et),Np=ln(et),Pp=cn(et),kp=Ba(et),_p=Da(et),Fp=Ca(et),Ip=Ra(et),Bp=Oa(et),Dp=za(et),Cp=Ma(et),Rp=Ta(et);var ie=x("ZodType",(r,e)=>(Q.init(r,e),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(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),r.clone=(t,n)=>Je(r,t,n),r.brand=()=>r,r.register=((t,n)=>(t.add(r,n),r)),r.parse=(t,n)=>Ep(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>Np(r,t,n),r.parseAsync=async(t,n)=>Sp(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>Pp(r,t,n),r.spa=r.safeParseAsync,r.encode=(t,n)=>kp(r,t,n),r.decode=(t,n)=>_p(r,t,n),r.encodeAsync=async(t,n)=>Fp(r,t,n),r.decodeAsync=async(t,n)=>Ip(r,t,n),r.safeEncode=(t,n)=>Bp(r,t,n),r.safeDecode=(t,n)=>Dp(r,t,n),r.safeEncodeAsync=async(t,n)=>Cp(r,t,n),r.safeDecodeAsync=async(t,n)=>Rp(r,t,n),r.refine=(t,n)=>r.check(Ov(t,n)),r.superRefine=t=>r.check(zv(t)),r.overwrite=t=>r.check(Gt(t)),r.optional=()=>ku(r),r.nullable=()=>_u(r),r.nullish=()=>ku(_u(r)),r.nonoptional=t=>Ev(r,t),r.array=()=>Du(r),r.or=t=>nm([r,t]),r.and=t=>cv(r,t),r.transform=t=>Fu(r,am(t)),r.default=t=>wv(r,t),r.prefault=t=>$v(r,t),r.catch=t=>Pv(r,t),r.pipe=t=>Fu(r,t),r.readonly=()=>Fv(r),r.describe=t=>{let n=r.clone();return It.add(n,{description:t}),n},Object.defineProperty(r,"description",{get(){return It.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return It.get(r);let n=r.clone();return It.add(n,t[0]),n},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),Mp=x("_ZodString",(r,e)=>{ni.init(r,e),ie.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=(...n)=>r.check(po(...n)),r.includes=(...n)=>r.check(go(...n)),r.startsWith=(...n)=>r.check(vo(...n)),r.endsWith=(...n)=>r.check(xo(...n)),r.min=(...n)=>r.check(Dr(...n)),r.max=(...n)=>r.check(mn(...n)),r.length=(...n)=>r.check(fn(...n)),r.nonempty=(...n)=>r.check(Dr(1,...n)),r.lowercase=n=>r.check(mo(n)),r.uppercase=n=>r.check(fo(n)),r.trim=()=>r.check(wo()),r.normalize=(...n)=>r.check(bo(...n)),r.toLowerCase=()=>r.check(Ao()),r.toUpperCase=()=>r.check($o())}),No=x("ZodString",(r,e)=>{ni.init(r,e),Mp.init(r,e),r.email=t=>r.check(ru(Tp,t)),r.url=t=>r.check(co(Iu,t)),r.jwt=t=>r.check(wu(em,t)),r.emoji=t=>r.check(au(Up,t)),r.guid=t=>r.check(lo(Pu,t)),r.uuid=t=>r.check(iu(Jt,t)),r.uuidv4=t=>r.check(nu(Jt,t)),r.uuidv6=t=>r.check(ou(Jt,t)),r.uuidv7=t=>r.check(su(Jt,t)),r.nanoid=t=>r.check(uu(Vp,t)),r.guid=t=>r.check(lo(Pu,t)),r.cuid=t=>r.check(lu(jp,t)),r.cuid2=t=>r.check(cu(Lp,t)),r.ulid=t=>r.check(du(Kp,t)),r.base64=t=>r.check(xu(Yp,t)),r.base64url=t=>r.check(yu(Qp,t)),r.xid=t=>r.check(hu(Zp,t)),r.ksuid=t=>r.check(pu(qp,t)),r.ipv4=t=>r.check(mu(Hp,t)),r.ipv6=t=>r.check(fu(Gp,t)),r.cidrv4=t=>r.check(gu(Wp,t)),r.cidrv6=t=>r.check(vu(Jp,t)),r.e164=t=>r.check(bu(Xp,t)),r.datetime=t=>r.check(bp(t)),r.date=t=>r.check(wp(t)),r.time=t=>r.check(Ap(t)),r.duration=t=>r.check($p(t))});function Op(r){return Bh(No,r)}var be=x("ZodStringFormat",(r,e)=>{ve.init(r,e),Mp.init(r,e)}),Tp=x("ZodEmail",(r,e)=>{Sd.init(r,e),be.init(r,e)});function Lb(r){return ru(Tp,r)}var Pu=x("ZodGUID",(r,e)=>{$d.init(r,e),be.init(r,e)});function Kb(r){return lo(Pu,r)}var Jt=x("ZodUUID",(r,e)=>{Ed.init(r,e),be.init(r,e)});function Zb(r){return iu(Jt,r)}function qb(r){return nu(Jt,r)}function Hb(r){return ou(Jt,r)}function Gb(r){return su(Jt,r)}var Iu=x("ZodURL",(r,e)=>{Nd.init(r,e),be.init(r,e)});function Wb(r){return co(Iu,r)}function Jb(r){return co(Iu,{protocol:/^https?$/,hostname:ht.domain,...U.normalizeParams(r)})}var Up=x("ZodEmoji",(r,e)=>{Pd.init(r,e),be.init(r,e)});function Yb(r){return au(Up,r)}var Vp=x("ZodNanoID",(r,e)=>{kd.init(r,e),be.init(r,e)});function Qb(r){return uu(Vp,r)}var jp=x("ZodCUID",(r,e)=>{_d.init(r,e),be.init(r,e)});function Xb(r){return lu(jp,r)}var Lp=x("ZodCUID2",(r,e)=>{Fd.init(r,e),be.init(r,e)});function e0(r){return cu(Lp,r)}var Kp=x("ZodULID",(r,e)=>{Id.init(r,e),be.init(r,e)});function t0(r){return du(Kp,r)}var Zp=x("ZodXID",(r,e)=>{Bd.init(r,e),be.init(r,e)});function r0(r){return hu(Zp,r)}var qp=x("ZodKSUID",(r,e)=>{Dd.init(r,e),be.init(r,e)});function i0(r){return pu(qp,r)}var Hp=x("ZodIPv4",(r,e)=>{Md.init(r,e),be.init(r,e)});function n0(r){return mu(Hp,r)}var Gp=x("ZodIPv6",(r,e)=>{Td.init(r,e),be.init(r,e)});function o0(r){return fu(Gp,r)}var Wp=x("ZodCIDRv4",(r,e)=>{Ud.init(r,e),be.init(r,e)});function s0(r){return gu(Wp,r)}var Jp=x("ZodCIDRv6",(r,e)=>{Vd.init(r,e),be.init(r,e)});function a0(r){return vu(Jp,r)}var Yp=x("ZodBase64",(r,e)=>{Ld.init(r,e),be.init(r,e)});function u0(r){return xu(Yp,r)}var Qp=x("ZodBase64URL",(r,e)=>{Kd.init(r,e),be.init(r,e)});function l0(r){return yu(Qp,r)}var Xp=x("ZodE164",(r,e)=>{Zd.init(r,e),be.init(r,e)});function c0(r){return bu(Xp,r)}var em=x("ZodJWT",(r,e)=>{qd.init(r,e),be.init(r,e)});function d0(r){return wu(em,r)}var Po=x("ZodCustomStringFormat",(r,e)=>{Hd.init(r,e),be.init(r,e)});function h0(r,e,t={}){return gn(Po,r,e,t)}function p0(r){return gn(Po,"hostname",ht.hostname,r)}function m0(r){return gn(Po,"hex",ht.hex,r)}function f0(r,e){let t=e?.enc??"hex",n=`${r}_${t}`,i=ht[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return gn(Po,n,i,e)}var ko=x("ZodNumber",(r,e)=>{Ga.init(r,e),ie.init(r,e),r.gt=(n,i)=>r.check(Ht(n,i)),r.gte=(n,i)=>r.check(Xe(n,i)),r.min=(n,i)=>r.check(Xe(n,i)),r.lt=(n,i)=>r.check(qt(n,i)),r.lte=(n,i)=>r.check(pt(n,i)),r.max=(n,i)=>r.check(pt(n,i)),r.int=n=>r.check(zp(n)),r.safe=n=>r.check(zp(n)),r.positive=n=>r.check(Ht(0,n)),r.nonnegative=n=>r.check(Xe(0,n)),r.negative=n=>r.check(qt(0,n)),r.nonpositive=n=>r.check(pt(0,n)),r.multipleOf=(n,i)=>r.check(oi(n,i)),r.step=(n,i)=>r.check(oi(n,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 Yg(r){return Th(ko,r)}var xn=x("ZodNumberFormat",(r,e)=>{Gd.init(r,e),ko.init(r,e)});function zp(r){return Vh(xn,r)}function g0(r){return jh(xn,r)}function v0(r){return Lh(xn,r)}function x0(r){return Kh(xn,r)}function y0(r){return Zh(xn,r)}var _o=x("ZodBoolean",(r,e)=>{no.init(r,e),ie.init(r,e)});function Qg(r){return qh(_o,r)}var Fo=x("ZodBigInt",(r,e)=>{Wa.init(r,e),ie.init(r,e),r.gte=(n,i)=>r.check(Xe(n,i)),r.min=(n,i)=>r.check(Xe(n,i)),r.gt=(n,i)=>r.check(Ht(n,i)),r.gte=(n,i)=>r.check(Xe(n,i)),r.min=(n,i)=>r.check(Xe(n,i)),r.lt=(n,i)=>r.check(qt(n,i)),r.lte=(n,i)=>r.check(pt(n,i)),r.max=(n,i)=>r.check(pt(n,i)),r.positive=n=>r.check(Ht(BigInt(0),n)),r.negative=n=>r.check(qt(BigInt(0),n)),r.nonpositive=n=>r.check(pt(BigInt(0),n)),r.nonnegative=n=>r.check(Xe(BigInt(0),n)),r.multipleOf=(n,i)=>r.check(oi(n,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function b0(r){return Gh(Fo,r)}var tm=x("ZodBigIntFormat",(r,e)=>{Wd.init(r,e),Fo.init(r,e)});function w0(r){return Jh(tm,r)}function A0(r){return Yh(tm,r)}var Xg=x("ZodSymbol",(r,e)=>{Jd.init(r,e),ie.init(r,e)});function $0(r){return Qh(Xg,r)}var ev=x("ZodUndefined",(r,e)=>{Yd.init(r,e),ie.init(r,e)});function E0(r){return Xh(ev,r)}var tv=x("ZodNull",(r,e)=>{Qd.init(r,e),ie.init(r,e)});function rv(r){return ep(tv,r)}var iv=x("ZodAny",(r,e)=>{Xd.init(r,e),ie.init(r,e)});function S0(){return tp(iv)}var nv=x("ZodUnknown",(r,e)=>{eh.init(r,e),ie.init(r,e)});function vn(){return rp(nv)}var ov=x("ZodNever",(r,e)=>{th.init(r,e),ie.init(r,e)});function rm(r){return ip(ov,r)}var sv=x("ZodVoid",(r,e)=>{rh.init(r,e),ie.init(r,e)});function N0(r){return np(sv,r)}var Bu=x("ZodDate",(r,e)=>{ih.init(r,e),ie.init(r,e),r.min=(n,i)=>r.check(Xe(n,i)),r.max=(n,i)=>r.check(pt(n,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 P0(r){return op(Bu,r)}var av=x("ZodArray",(r,e)=>{nh.init(r,e),ie.init(r,e),r.element=e.element,r.min=(t,n)=>r.check(Dr(t,n)),r.nonempty=t=>r.check(Dr(1,t)),r.max=(t,n)=>r.check(mn(t,n)),r.length=(t,n)=>r.check(fn(t,n)),r.unwrap=()=>r.element});function Du(r,e){return pp(av,r,e)}function k0(r){let e=r._zod.def.shape;return sm(Object.keys(e))}var Cu=x("ZodObject",(r,e)=>{oh.init(r,e),ie.init(r,e),U.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>sm(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:vn()}),r.loose=()=>r.clone({...r._zod.def,catchall:vn()}),r.strict=()=>r.clone({...r._zod.def,catchall:rm()}),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(um,r,t[0]),r.required=(...t)=>U.required(lm,r,t[0])});function _0(r,e){let t={type:"object",shape:r??{},...U.normalizeParams(e)};return new Cu(t)}function F0(r,e){return new Cu({type:"object",shape:r,catchall:rm(),...U.normalizeParams(e)})}function I0(r,e){return new Cu({type:"object",shape:r,catchall:vn(),...U.normalizeParams(e)})}var im=x("ZodUnion",(r,e)=>{Ja.init(r,e),ie.init(r,e),r.options=e.options});function nm(r,e){return new im({type:"union",options:r,...U.normalizeParams(e)})}var uv=x("ZodDiscriminatedUnion",(r,e)=>{im.init(r,e),sh.init(r,e)});function B0(r,e,t){return new uv({type:"union",options:e,discriminator:r,...U.normalizeParams(t)})}var lv=x("ZodIntersection",(r,e)=>{ah.init(r,e),ie.init(r,e)});function cv(r,e){return new lv({type:"intersection",left:r,right:e})}var dv=x("ZodTuple",(r,e)=>{Ya.init(r,e),ie.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function hv(r,e,t){let n=e instanceof Q,i=n?t:e,o=n?e:null;return new dv({type:"tuple",items:r,rest:o,...U.normalizeParams(i)})}var om=x("ZodRecord",(r,e)=>{uh.init(r,e),ie.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function pv(r,e,t){return new om({type:"record",keyType:r,valueType:e,...U.normalizeParams(t)})}function D0(r,e,t){let n=Je(r);return n._zod.values=void 0,new om({type:"record",keyType:n,valueType:e,...U.normalizeParams(t)})}var mv=x("ZodMap",(r,e)=>{lh.init(r,e),ie.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function C0(r,e,t){return new mv({type:"map",keyType:r,valueType:e,...U.normalizeParams(t)})}var fv=x("ZodSet",(r,e)=>{ch.init(r,e),ie.init(r,e),r.min=(...t)=>r.check(si(...t)),r.nonempty=t=>r.check(si(1,t)),r.max=(...t)=>r.check(pn(...t)),r.size=(...t)=>r.check(ho(...t))});function R0(r,e){return new fv({type:"set",valueType:r,...U.normalizeParams(e)})}var So=x("ZodEnum",(r,e)=>{dh.init(r,e),ie.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(n,i)=>{let o={};for(let s of n)if(t.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new So({...e,checks:[],...U.normalizeParams(i),entries:o})},r.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(t.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new So({...e,checks:[],...U.normalizeParams(i),entries:o})}});function sm(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(n=>[n,n])):r;return new So({type:"enum",entries:t,...U.normalizeParams(e)})}function O0(r,e){return new So({type:"enum",entries:r,...U.normalizeParams(e)})}var gv=x("ZodLiteral",(r,e)=>{hh.init(r,e),ie.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 z0(r,e){return new gv({type:"literal",values:Array.isArray(r)?r:[r],...U.normalizeParams(e)})}var vv=x("ZodFile",(r,e)=>{ph.init(r,e),ie.init(r,e),r.min=(t,n)=>r.check(si(t,n)),r.max=(t,n)=>r.check(pn(t,n)),r.mime=(t,n)=>r.check(yo(Array.isArray(t)?t:[t],n))});function M0(r){return mp(vv,r)}var xv=x("ZodTransform",(r,e)=>{mh.init(r,e),ie.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Pr(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(U.issue(o,t.value,e));else{let s=o;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(o=>(t.value=o,t)):(t.value=i,t)}});function am(r){return new xv({type:"transform",transform:r})}var um=x("ZodOptional",(r,e)=>{fh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function ku(r){return new um({type:"optional",innerType:r})}var yv=x("ZodNullable",(r,e)=>{gh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function _u(r){return new yv({type:"nullable",innerType:r})}function T0(r){return ku(_u(r))}var bv=x("ZodDefault",(r,e)=>{vh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function wv(r,e){return new bv({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var Av=x("ZodPrefault",(r,e)=>{xh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function $v(r,e){return new Av({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var lm=x("ZodNonOptional",(r,e)=>{yh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Ev(r,e){return new lm({type:"nonoptional",innerType:r,...U.normalizeParams(e)})}var Sv=x("ZodSuccess",(r,e)=>{bh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function U0(r){return new Sv({type:"success",innerType:r})}var Nv=x("ZodCatch",(r,e)=>{wh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function Pv(r,e){return new Nv({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var kv=x("ZodNaN",(r,e)=>{Ah.init(r,e),ie.init(r,e)});function V0(r){return ap(kv,r)}var cm=x("ZodPipe",(r,e)=>{$h.init(r,e),ie.init(r,e),r.in=e.in,r.out=e.out});function Fu(r,e){return new cm({type:"pipe",in:r,out:e})}var dm=x("ZodCodec",(r,e)=>{cm.init(r,e),oo.init(r,e)});function j0(r,e,t){return new dm({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var _v=x("ZodReadonly",(r,e)=>{Eh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Fv(r){return new _v({type:"readonly",innerType:r})}var Iv=x("ZodTemplateLiteral",(r,e)=>{Sh.init(r,e),ie.init(r,e)});function L0(r,e){return new Iv({type:"template_literal",parts:r,...U.normalizeParams(e)})}var Bv=x("ZodLazy",(r,e)=>{kh.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.getter()});function Dv(r){return new Bv({type:"lazy",getter:r})}var Cv=x("ZodPromise",(r,e)=>{Ph.init(r,e),ie.init(r,e),r.unwrap=()=>r._zod.def.innerType});function K0(r){return new Cv({type:"promise",innerType:r})}var Rv=x("ZodFunction",(r,e)=>{Nh.init(r,e),ie.init(r,e)});function Z0(r){return new Rv({type:"function",input:Array.isArray(r?.input)?hv(r?.input):r?.input??Du(vn()),output:r?.output??vn()})}var Ru=x("ZodCustom",(r,e)=>{_h.init(r,e),ie.init(r,e)});function q0(r){let e=new Ae({check:"custom"});return e._zod.check=r,e}function H0(r,e){return fp(Ru,r??(()=>!0),e)}function Ov(r,e={}){return gp(Ru,r,e)}function zv(r){return vp(r)}function G0(r,e={error:`Input not instance of ${r.name}`}){let t=new Ru({type:"custom",check:"custom",fn:n=>n instanceof r,abort:!0,...U.normalizeParams(e)});return t._zod.bag.Class=r,t}var W0=(...r)=>xp({Codec:dm,Boolean:_o,String:No},...r);function J0(r){let e=Dv(()=>nm([Op(r),Yg(),Qg(),rv(),Du(e),pv(Op(),e)]));return e}function Y0(r,e){return Fu(am(r),e)}var Q0={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 X0(r){Fe({customError:r})}function ew(){return Fe().customError}var hm;hm||(hm={});var pm={};Mr(pm,{bigint:()=>nw,boolean:()=>iw,date:()=>ow,number:()=>rw,string:()=>tw});function tw(r){return Dh(No,r)}function rw(r){return Uh(ko,r)}function iw(r){return Hh(_o,r)}function nw(r){return Wh(Fo,r)}function ow(r){return sp(Bu,r)}Fe(Qa());var Mv=De.object({name:De.string(),bpm:De.number(),duration:De.number(),sample_rate:De.number(),origin:De.enum(["openDAW","recording","import"])});var Uj=Mv.extend({uuid:S.zType(De)});var Tv=De.object({name:De.string(),size:De.number().int(),url:De.string(),license:De.string(),origin:De.enum(["openDAW","import"])});var n3=Tv.extend({uuid:S.zType(De)});var Uv;(function(r){r.cut=(e,t,n)=>{if(!(e.position>=t||t>=e.complete))if(pc.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:s,loopDuration:a}=e;e.box.duration.setValue(t-i),e.copyTo({position:t,duration:o-t,loopOffset:_n(s+(t-i),a),consolidate:n})}else return A("Not yet implemented")},r.clip=(e,t,n)=>{if(pc.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:s,loopDuration:a}=e;if(o-n<=0)return A(`duration will zero or negative(${o-n})`);e.box.duration.setValue(t-i),e.copyTo({position:n,duration:o-n,loopOffset:_n(s+(n-i),a)})}else return A("Not yet implemented")}})(Uv||(Uv={}));var yn;(e=>e.create=(t,n,i,o)=>0|(t?1:0)|(n?2:0)|(i?4:0)|(o?8:0))(yn||={});var le=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#t;#e;#r;#i;#n;#o=0;#s=0;#a=0;#u=0;constructor(e,t){this.#t=e,this.#e=t,this.#r=new Float32Array(4),this.#i=F.create(()=>new xi(r.RMS_WINDOW),2),this.#n=this.#t.broadcastFloats(this.#e,this.#r,()=>{this.#r[0]=this.#o,this.#r[1]=this.#s,this.#r[2]=this.#a,this.#r[3]=this.#u})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#s=0}process(e,t,n=0,i=128){let[o,s]=this.#i;for(let a=n;a<i;a++){let u=e[a],l=t[a];this.#o<=u?this.#o=u:this.#o*=r.PEAK_DECAY,this.#s<=l?this.#s=l:this.#s*=r.PEAK_DECAY,this.#a=o.pushPop(u),this.#u=s.pushPop(l)}}processStereo([e,t],n=0,i=128){this.process(e,t,n,i)}terminate(){this.#n.terminate()}};var Ou=class{#t=new V;#e;#r;#i;#n=m.None;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=new W,this.#o=this.#r.getValue(),this.#t.own(this.#r.subscribe(n=>{this.#o=n.getValue(),this.#i.notify(this)}))}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){N(this.#n.isEmpty(),"Already broadcasting"),this.#n=m.wrap(this.#e.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(){N(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=m.None,this.#o=this.#r.getValue()}own(e){return this.#t.own(e)}ownAll(...e){this.#t.ownAll(...e)}spawn(){return this.#t.spawn()}terminate(){this.#t.terminate()}};var bn=class{#t;constructor(){this.#t=new Lr(F.empty(),Zr.Comparator)}add(e,t){this.#t.add(e,t)}get(e){return this.#t.get(e)}forEach(e){return this.#t.forEach(e)}clear(){this.#t.clear()}};var tt=class{#t=new V;#e;#r;#i;#n;#o=m.None;constructor(e){this.#e=e,this.#r=new bn,this.#i=[],this.#n=[]}parameterChanged(e){return A(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#e}get eventInput(){return this.#r}bindParameter(e){let t=new Ou(this.#e,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:n=>{this.#o.isEmpty()&&(this.#o=m.wrap(this.#e.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:n=>{F.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(i=>i.terminate()),this.#o=m.None),t.onStopAutomation()}},c.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameter(e){this.#n.forEach(t=>{t.updateAutomation(e)&&this.parameterChanged(t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e))}own(e){return this.#t.own(e)}ownAll(...e){return this.#t.ownAll(...e)}spawn(){return this.#t.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=m.None,this.#i.length=0,this.#t.terminate()}toString(){return`{${this.constructor.name}}`}};var Bo;(e=>e.isOfType=t=>t.type==="update-event")(Bo||={});var zu=class extends tt{#t=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#t.push(e),{terminate:()=>F.remove(this.#t,e)}}process({blocks:e}){e.forEach(({p0:t,p1:n,flags:i},o)=>{if(Ce.every(i,1))for(let s of or.iterate(t,n,ha)){let a={type:"update-event",position:s};this.#t.forEach(u=>u.add(o,a))}})}toString(){return`{${this.constructor.name}}`}};var he=class extends tt{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,s0:o,s1:s,bpm:a}=t,u=null,l=o;for(let d of this.eventInput.get(n)){let h=d.position-i,f=Math.abs(h)<1e-7?o:o+Math.floor(re.pulsesToSamples(h,a,sampleRate));N(o<=f&&f<=s,()=>`${f} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),u?.forEach(v=>this.handleEvent(v)),u=null,l<f&&(this.processAudio(t,l,f),l=f),Bo.isOfType(d)?this.updateParameter(d.position):(u??=[]).push(d)}u?.forEach(d=>this.handleEvent(d)),u=null,l<s&&this.processAudio(t,l,s)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return A(`${this} received an event but has no accepting method.`)}finishProcess(){}};var Mu=class r{static#t=B.exponential(20/sampleRate,2e4/sampleRate);#e;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#s=0;#a=0;#u=0;#l=0;#c=0;#h=!1;#d=!1;constructor(e,t){let n=Ot(e);this.#e=n,this.#r=[new Float32Array(n),new Float32Array(n)],this.#i=[new Ne,new Ne],this.#n=new At,this.#o=t}reset(){this.#a=0,this.#h&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#h=!1,this.#d=!1),this.#g()}set offset(e){N(0<=e&&e<this.#e,"Out of bounds"),this.#l!==e&&(this.#l=e,this.#h?this.#v():this.#g())}get offset(){return this.#l}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#t.y(e)):e<0&&this.#n.setLowpassParams(r.#t.y(1+e))}process(e,t,n,i){this.#d?this.#f(e,t,n,i):this.#p(e,t,n,i),this.#h=!0}#p(e,t,n,i){let o=this.#e-1,s=this.#r,a=this.feedback,u=this.wet,l=this.dry,d=this.#a,h=d-Math.floor(this.#u);h<0&&(h+=this.#e);let f=e[0],v=e[1],g=t[0],y=t[1],b=this.#i[0],R=this.#i[1],M=s[0],j=s[1];for(let L=n;L<i;++L){let ee=f[L],we=v[L],$e=b.processFrame(this.#n,M[h]*.96),J=R.processFrame(this.#n,j[h]*.96),me=this.cross*(J-$e),H=$e+me,ne=J-me;M[d]=(ee+H)*a+1e-18-1e-18,j[d]=(we+ne)*a+1e-18-1e-18,g[L]=H*u+ee*l,y[L]=ne*u+we*l,h=++h&o,d=++d&o}this.#a=d}#f(e,t,n,i){let o=this.#e-1,s=this.#r,a=this.feedback,u=this.wet,l=this.dry,d=this.#a;for(let h=n;h<i;++h){0<this.#c?(this.#u+=this.#s,this.#c--):(this.#u=this.#l,this.#d=!1);let f=d-this.#u;f<0&&(f+=this.#e);let v=f|0,g=f-v,y=e[0][h],b=e[1][h],R=s[0][v],M=s[0][v],j=this.#i[0].processFrame(this.#n,R+g*(s[0][v+1&o]-R)),L=this.#i[1].processFrame(this.#n,M+g*(s[1][v+1&o]-M));s[0][d]=y+j*a+1e-18-1e-18,s[1][d]=b+j*a+1e-18-1e-18,t[0][h]=j*u+y*l,t[1][h]=L*u+b*l,d=++d&o}this.#a=d}#g(){this.#u=this.#l,this.#c=0,this.#d=!1}#v(){this.#l!==this.#u&&(this.#c=this.#o,this.#s=(this.#l-this.#u)/this.#c,this.#d=!0)}};var Tu=class r extends he{static ID=0;#t=r.ID++;#e;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=m.None;#s=!0;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(e.broadcaster,t.address));let{delay:n,feedback:i,cross:o,filter:s,dry:a,wet:u}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(n)),this.parameterFeedback=this.own(this.bindParameter(i)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(s)),this.parameterDry=this.own(this.bindParameter(a)),this.parameterWet=this.own(this.bindParameter(u));let l=re.pulsesToSamples(vt.toPPQN(Kt.OffsetFractions[0]),30,sampleRate),d=Math.floor(.5*sampleRate);this.#n=new Mu(l,d),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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}handleEvent(e){}processAudio({bpm:e,flags:t},n,i){if(this.#o.isEmpty())return;if(this.#s||Ce.some(t,8)){let s=this.parameterDelay.getValue(),a=vt.toPPQN(Kt.OffsetFractions[s]);this.#n.offset=re.pulsesToSamples(a,e,sampleRate),this.#s=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),n,i),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),n,i)}parameterChanged(e){e===this.parameterDelay?this.#s=!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=fe(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=fe(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#t})}`}};var Do=class r extends tt{static ID=0;#t=r.ID++;#e;#r;#i;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[n,i]=t.channels(),[o,s]=this.#r.channels();for(let a=0;a<128;a++)o[a]=n[a],s[a]=i[a];this.#i.process(o,s)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#t})`}};var wn=class r extends tt{static ID=0;#t=r.ID++;#e;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return m.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{F.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#e}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,n]=this.#r.channels();for(let i of this.#n){let[o,s]=i.channels();for(let a=0;a<128;a++)t[a]+=o[a],n[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.#t})}`}};var ae;(s=>{s.start=(a,u,l,d,h=0)=>({type:"note-event",position:a,duration:u,pitch:l,velocity:d,cent:h,id:++o}),s.startWith=(a,u,l)=>({type:"note-event",position:u??a.position,duration:l??a.duration,pitch:a.pitch,cent:a.cent,velocity:a.velocity,id:++o}),s.stop=({id:a,pitch:u},l)=>({type:"note-complete-event",position:l,pitch:u,id:a}),s.isStart=a=>a.type==="note-event"&&"id"in a&&typeof a.id=="number",s.isStop=a=>a.type==="note-complete-event";let o=0})(ae||={});var Bt=class{#t=new V;#e;#r;#i=m.None;constructor(e,t,n){this.#e=e,this.#r=this.#t.own(new kt(t,n))}setNoteEventSource(e){return N(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),this.#e.reset(),Z.create(()=>{this.#i=m.None,this.#e.reset()})}introduceBlock({index:e,p0:t,p1:n,flags:i}){if(!this.#i.isEmpty())for(let o of this.#i.unwrap().processNotes(t,n,i))o.pitch>=0&&o.pitch<=127&&(this.#e.eventInput.add(e,o),this.#n(o))}clear(){}terminate(){this.#t.terminate()}#n(e){ae.isStart(e)?this.#r.noteOn(e.pitch):ae.isStop(e)&&this.#r.noteOff(e.pitch)}};var Uu=class extends he{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#h;#d;#p;gain=1;freqMult=1;attack=1;release=1;waveform=Tt.sine;cutoff=1;resonance=Math.SQRT1_2;filterEnvelope=0;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new Bt(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new oe,this.#n=this.own(new le(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.octave)),this.#a=this.own(this.bindParameter(this.#t.namedParameter.tune)),this.#u=this.own(this.bindParameter(this.#t.namedParameter.attack)),this.#l=this.own(this.bindParameter(this.#t.namedParameter.release)),this.#c=this.own(this.bindParameter(this.#t.namedParameter.waveform)),this.#h=this.own(this.bindParameter(this.#t.namedParameter.cutoff)),this.#d=this.own(this.bindParameter(this.#t.namedParameter.resonance)),this.#p=this.own(this.bindParameter(this.#t.namedParameter.filterEnvelope)),this.own(e.registerProcessor(this)),this.readAllParameters()}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.#e.length=0,this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){ae.isStart(e)?this.#e.push(new mm(this,e)):ae.isStop(e)&&this.#e.find(t=>t.event.id===e.id)?.stop()}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#i,t,n)&&this.#e.splice(i,1)}parameterChanged(e){e===this.#o?this.gain=fe(this.#o.getValue()):e===this.#s||e===this.#a?this.freqMult=2**(this.#s.getValue()+this.#a.getValue()/1200):e===this.#u?this.attack=Math.floor(this.#u.getValue()*sampleRate):e===this.#l?this.release=Math.floor(this.#l.getValue()*sampleRate):e===this.#c?this.waveform=Nm(this.#c.getValue(),Tt):e===this.#h?this.cutoff=this.#h.getValue():e===this.#d?this.resonance=this.#d.getValue():e===this.#p&&(this.filterEnvelope=this.#p.getValue())}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}},mm=class{device;event;osc;buffer;filterCoeff;filterProcessor;phase=0;position=0;decayPosition=Number.POSITIVE_INFINITY;constructor(e,t){this.device=e,this.event=t,this.osc=new ts,this.buffer=new Float32Array(128),this.filterCoeff=new At,this.filterProcessor=new Ne}stop(){this.decayPosition=this.position-this.device.attack}processAdd(e,t,n){let i=Dn(this.event.pitch+this.event.cent/100,440)*this.device.freqMult,o=gi(this.event.velocity)*this.device.gain*fe(-15),s=this.device.waveform,a=this.device.attack,u=this.device.release,l=this.device.adapter.namedParameter.cutoff.valueMapping,d=l.x(this.device.cutoff),h=this.device.resonance,f=this.device.filterEnvelope,v=e.getChannel(0),g=e.getChannel(1);this.osc.generate(this.buffer,i/sampleRate,s,t,n);for(let y=t;y<n;y++){let b=Vo(Math.min(this.position/a,1-(this.position-(this.decayPosition+a))/u,1)**2);this.filterCoeff.setLowpassParams(l.y(G(d+b*f,0,1))/sampleRate,h);let R=this.filterProcessor.processFrame(this.filterCoeff,this.buffer[y])*o*b;if(v[y]+=R,g[y]+=R,++this.position-this.decayPosition>a+u)return!0}return!1}};var Vu=class extends tt{#t;#e;#r;#i;#n=128;constructor(e,t){super(e),this.#t=t,this.#e=new oe(2),this.#r=this.own(new le(e.broadcaster,t.address)),this.#i=S.newSet(({adapter:{uuid:n}})=>n),this.ownAll(this.#t.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:n=>this.#i.add({adapter:n,lastRead:NaN,lastStepSize:0}),onRemove:n=>this.#i.removeByKey(n.uuid),onReorder:n=>{}}),e.registerProcessor(this))}get noteEventTarget(){return m.None}reset(){this.#r.clear(),this.#e.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#e}process({blocks:e}){this.#e.clear(0,128);let[t,n]=this.#e.channels();this.#i.forEach(i=>e.forEach(o=>{let{adapter:s}=i;if(s.type!==de.Audio||!s.enabled.getValue())return;let{p0:a,p1:u,flags:l}=o;if(!Ce.every(l,5))return;let d=this.context.clipSequencing.iterate(s.uuid,a,u);for(let{optClip:h,sectionFrom:f,sectionTo:v}of d)h.match({none:()=>{for(let g of s.regions.collection.iterateRange(a,u)){if(g.mute||!Ee(g,vr))continue;let b=g.file.getOrCreateLoader().data;if(b.isEmpty())return;let R=b.unwrap();for(let M of Ye.locateLoops(g,a,u))this.#o(this.#e,R,M,o,i)}},some:g=>{if(!Ee(g,gr))return;let y=g.file.getOrCreateLoader().data;if(y.isEmpty())return;let b=y.unwrap();for(let R of Ye.locateLoops({position:0,loopDuration:g.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},f,v))this.#o(this.#e,b,R,o,i)}})})),this.#e.assertSanity(),this.#r.process(t,n)}parameterChanged(e){}#o(e,t,n,{p0:i,p1:o,s0:s,s1:a},u){let[l,d]=e.channels(),{numberOfFrames:h,frames:f}=t,v=f[0],g=f.length===1?f[0]:f[1],y=a-s,b=o-i,R=h*n.resultStartValue,M=h*n.resultEndValue,j=(n.resultStart-i)/b,L=(n.resultEnd-i)/b,ee=s+y*j,we=s+y*L,$e=we-ee|0,J=(M-R)/$e;N(s<=ee&&we<=a,`Out of bounds ${ee}, ${we}`);let me=!Number.isFinite(u.lastRead)||Math.abs(R-(u.lastRead+J))>2;for(let H=0,ne=ee|0;H<$e;H++,ne++){let ge=R+H*J,je=ge|0,ft=0,Le=0;if(je>=0&&je<h-1){let ot=ge-je,Sn=v[je],Nn=g[je];ft=Sn+ot*(v[je+1]-Sn),Le=Nn+ot*(g[je+1]-Nn)}if(me&&H<this.#n&&Number.isFinite(u.lastRead)){let ot=H/this.#n,Sn=1-ot,Nn=u.lastRead+H*u.lastStepSize,zr=Nn|0;if(zr>=0&&zr<h-1){let Am=Nn-zr,$m=v[zr],Em=g[zr],nx=$m+Am*(v[zr+1]-$m),ox=Em+Am*(g[zr+1]-Em);l[ne]+=Sn*nx+ot*ft,d[ne]+=Sn*ox+ot*Le}else l[ne]+=ft,d[ne]+=Le}else l[ne]+=ft,d[ne]+=Le}u.lastRead=R+($e-1)*J,u.lastStepSize=J}};var mt=class extends tt{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,p1:o}=t,s=null,a=i;for(let u of this.eventInput.get(n))s?.forEach(l=>this.handleEvent(t,l)),s=null,a<u.position&&(this.processEvents(t,a,u.position),a=u.position),Bo.isOfType(u)?this.updateParameter(u.position):(s??=[]).push(u);s?.forEach(u=>this.handleEvent(t,u)),s=null,a<o&&this.processEvents(t,a,o)}),this.eventInput.clear()}introduceBlock(e){}};var An;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(n,i)=>i*n.mult+n.add))(An||={});var ju=Object.freeze([{name:"up",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=t%s,l=Math.floor(t%a/s),d=r[u];return ae.start(n,i,d.pitch+l*12,An.apply(o,d.velocity))}},{name:"down",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=s-1-t%s,l=e-1-Math.floor(t%a/s),d=r[u];return ae.start(n,i,d.pitch+l*12,An.apply(o,d.velocity))}},{name:"up-down",run:(r,e,t,n,i,o)=>{let s=r.length,a=s*e,u=Math.max(1,a*2-2),l=t%u,d=l<a?l:u-l,h=d%s,f=Math.floor(d/s),v=r[h];return ae.start(n,i,v.pitch+f*12,An.apply(o,v.velocity))}}]);var Lu=class extends mt{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l=An.create();#c=m.None;#h=ju[0];#d=NaN;#p=1;#f=1;#g=1;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new vi,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.#s=this.own(this.bindParameter(t.namedParameter.repeat)),this.#a=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#u=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return m.wrap(this)}setNoteEventSource(e){return N(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=m.wrap(e),Z.create(()=>this.#c=m.None)}*processNotes(e,t,n){if(this.#r.nonEmpty())if(Ce.every(n,2))for(let o of this.#r.releaseAll())yield ae.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ae.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let i=this.#c.unwrap();for(let s of i.processNotes(e,t,n));let o=!Ce.every(n,1);for(let{position:s,index:a}of or.iterateWithIndex(e,t,this.#d)){let u=Array.from(i.iterateActiveNotesAt(s,o));if(u.length===0)continue;let l=Math.floor(a/this.#f),d=Math.max(1,Math.floor(this.#d*this.#p)),h=this.#h.run(u,this.#g,l,s,d,this.#l);this.#r.addAndRetain({...h}),yield h}for(let s of this.#r.releaseLinearCompleted(t))yield ae.stop(s,s.position+s.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,He.Comparator))}reset(){this.#e.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){if(e===this.#i)this.#h=ju.at(this.#i.getValue())??ju[0];else if(e===this.#n)this.#d=vt.toPPQN($r.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#p=this.#o.getValue();else if(e===this.#s)this.#f=this.#s.getValue();else if(e===this.#a)this.#g=this.#a.getValue();else if(e===this.#u){let t=this.#u.getValue();t<=0?(this.#l.add=1+t,this.#l.mult=0):(this.#l.add=1-t,this.#l.mult=t)}}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var Ku=class extends mt{#t;#e;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new kt(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 N(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),Z.create(()=>this.#o=m.None)}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#o.isEmpty())for(let i of this.#o.unwrap().processNotes(e,t,n))if(ae.isStart(i)){this.#e.noteOn(i.pitch);let{cent:o,octaves:s,semiTones:a}=this.#t.namedParameter;yield wt.overwrite(i,{pitch:i.pitch+s.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+o.valueAt(i.position)})}else this.#e.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let n of this.#o.unwrap().iterateActiveNotesAt(e,t))if(n.type==="note-event"){let{cent:i,octaves:o,semiTones:s}=this.#t.namedParameter;yield wt.overwrite(n,{pitch:n.pitch+o.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+i.valueAt(n.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var Zu=class r{static DEFAULT_SIZE=1024;#t;#e;#r;#i;#n;#o;#s;#a=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#t=e,this.#r=new Yo(this.#t),this.#i=new Float32Array(this.#t),this.#n=new Float32Array(this.#t),this.#o=On.create(On.Type.Blackman,this.#t),this.#e=this.#t>>1,this.#s=new Float32Array(this.#e)}clear(){this.#s.fill(0),this.#a=0}numBins(){return this.#e}bins(){return this.#s}process(e,t,n,i){for(let o=n;o<i;++o)this.#i[this.#a]=this.#o[this.#a]*(e[o]+t[o]),++this.#a===this.#t&&this.#u()}#u(){this.#r.process(this.#i,this.#n);let e=1/this.#e;for(let t=0;t<this.#e;++t){let n=this.#i[t],i=this.#n[t],o=Math.sqrt(n*n+i*i)*e;this.#s[t]<o?this.#s[t]=o:this.decay&&(this.#s[t]*=.9)}this.#a=0,this.#n.fill(0),this.decay=!1}};var qu=class r extends he{static ID=0;#t=r.ID++;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#h;#d;#p;#f;#g;#v;#y;#N;#F;#I;#P;#B;#k;#w;#x;#S;#$;#E;#b;#A;#_;#D;#C;#R;#O;#M;#z=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(e.broadcaster,t.address)),this.#n=new Zu,this.#o=new Float32Array(this.#n.numBins()),this.#s=F.create(()=>new At,7),this.#a=[new Kr(4),new Kr(4)],this.#u=[new Kr(4),new Kr(4)],this.#l=[this.#u,[new Ne,new Ne],[new Ne,new Ne],[new Ne,new Ne],[new Ne,new Ne],[new Ne,new Ne],this.#a],this.#c=F.create(()=>!0,7);let n=this.#e.namedParameter;this.#h=this.own(this.bindParameter(n.highPass.enabled)),this.#p=this.own(this.bindParameter(n.highPass.q)),this.#d=this.own(this.bindParameter(n.highPass.frequency)),this.#f=this.own(this.bindParameter(n.highPass.order)),this.#g=this.own(this.bindParameter(n.lowShelf.enabled)),this.#v=this.own(this.bindParameter(n.lowShelf.frequency)),this.#y=this.own(this.bindParameter(n.lowShelf.gain)),this.#N=this.own(this.bindParameter(n.lowBell.enabled)),this.#F=this.own(this.bindParameter(n.lowBell.frequency)),this.#I=this.own(this.bindParameter(n.lowBell.gain)),this.#P=this.own(this.bindParameter(n.lowBell.q)),this.#B=this.own(this.bindParameter(n.midBell.enabled)),this.#k=this.own(this.bindParameter(n.midBell.frequency)),this.#w=this.own(this.bindParameter(n.midBell.gain)),this.#x=this.own(this.bindParameter(n.midBell.q)),this.#S=this.own(this.bindParameter(n.highBell.enabled)),this.#$=this.own(this.bindParameter(n.highBell.frequency)),this.#E=this.own(this.bindParameter(n.highBell.gain)),this.#b=this.own(this.bindParameter(n.highBell.q)),this.#A=this.own(this.bindParameter(n.highShelf.enabled)),this.#_=this.own(this.bindParameter(n.highShelf.frequency)),this.#D=this.own(this.bindParameter(n.highShelf.gain)),this.#C=this.own(this.bindParameter(n.lowPass.enabled)),this.#R=this.own(this.bindParameter(n.lowPass.frequency)),this.#O=this.own(this.bindParameter(n.lowPass.q)),this.#M=this.own(this.bindParameter(n.lowPass.order)),this.own(e.registerProcessor(this)),e.broadcaster.broadcastFloats(t.spectrum,this.#o,()=>{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.#l.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#z=m.wrap(e),{terminate:()=>this.#z=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#z.isEmpty())return;let[i,o]=this.#r.channels(),s=this.#z.unwrap();if(this.#c.some(a=>a)){let[a,u]=s.channels();this.#s.forEach((l,d)=>{if(this.#c[d]){let[h,f]=this.#l[d];h.process(l,a,i,t,n),f.process(l,u,o,t,n),a=i,u=o}})}else{let[a,u]=s.channels();for(let l=t;l<n;l++)i[l]=a[l],o[l]=u[l]}this.#i.process(i,o,t,n),this.#n.process(i,o,t,n)}parameterChanged(e){if(e===this.#M){let n=this.#M.getValue()+1;this.#a[0].order=n,this.#a[1].order=n}else if(e===this.#f){let n=this.#f.getValue()+1;this.#u[0].order=n,this.#u[1].order=n}else if(e===this.#d||e===this.#p){let t=this.#d.getValue(),n=this.#p.getValue();this.#s[0].setHighpassParams(t/sampleRate,n)}else if(e===this.#v||e===this.#y){let t=this.#v.getValue(),n=this.#y.getValue();this.#s[1].setLowShelfParams(t/sampleRate,n)}else if(e===this.#F||e===this.#I||e===this.#P){let t=this.#F.getValue(),n=this.#I.getValue(),i=this.#P.getValue();this.#s[2].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#k||e===this.#w||e===this.#x){let t=this.#k.getValue(),n=this.#w.getValue(),i=this.#x.getValue();this.#s[3].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#$||e===this.#E||e===this.#b){let t=this.#$.getValue(),n=this.#E.getValue(),i=this.#b.getValue();this.#s[4].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#_||e===this.#D){let t=this.#_.getValue(),n=this.#D.getValue();this.#s[5].setHighShelfParams(t/sampleRate,n)}else if(e===this.#R||e===this.#O){let t=this.#R.getValue(),n=this.#O.getValue();this.#s[6].setLowpassParams(t/sampleRate,n)}else e===this.#h?this.#c[0]=this.#h.getValue():e===this.#g?this.#c[1]=this.#g.getValue():e===this.#N?this.#c[2]=this.#N.getValue():e===this.#B?this.#c[3]=this.#B.getValue():e===this.#S?this.#c[4]=this.#S.getValue():e===this.#A?this.#c[5]=this.#A.getValue():e===this.#C&&(this.#c[6]=this.#C.getValue())}toString(){return`{${this.constructor.name} (${this.#t})`}};var Hu=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#t=new Float32Array(2048);#e=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#s=new Float32Array(2048);#a=new Float32Array(2048);#u=new Float32Array(1024);#l=new Float32Array(512);#c=new Float32Array(512);#h=new Float32Array(256);#d=new Float32Array(2048);#p=new Float32Array(2048);#f=new Float32Array(2048);#g=new Float32Array(2048);#v=new Float32Array(2048);#y=new Float32Array(2048);#N=new Float32Array(2048);#F=new Float32Array(2048);#I=new Float32Array(1024);#P=new Float32Array(512);#B=new Float32Array(512);#k=new Float32Array(256);#w;#x;#S=0;#$=0;#E=0;#b=0;#A=0;#_=0;#D=0;#C=0;#R=0;#O=0;#M=0;#z=0;#U=0;#V=0;#j=0;#L=0;#K=0;#Z=0;#q=0;#H=0;#G=0;#W=0;#J=0;#Y=0;#Q=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#se=0;#ae=0;#ue=0;#le=0;#ce=0;#de=0;#he=0;#pe=0;#m=0;#T=0;constructor(e=.5){this.#w=Ot(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.#m=0,this.#T=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#m=0,this.#T=0,this.clearHistory(),this.clearBuffers()}process(e,t,n,i){let[o,s]=t.channels(),[a,u]=e.channels(),l=.4*this.damp,d=1-l,h=.7+.28*this.roomSize;for(let f=n;f<i;++f){let v=o[f],g=s[f],y=this.#T-this.predelayInSamples;y<0&&(y+=this.#w);let b;b=y<<1;let R=.01,M=this.#x[b]*R,j=this.#x[b+1]*R;b=this.#T<<1,this.#x[b]=v,this.#x[b+1]=g,this.#T=this.#T+1&this.#w-1;let L=this.#m&2047;this.#S=d*this.#$+l*this.#S,this.#t[L]=M+h*this.#S,this.#$=this.#t[this.#m-1617&2047],this.#E=d*this.#b+l*this.#E,this.#e[L]=M+h*this.#E,this.#b=this.#e[this.#m-1557&2047],this.#A=d*this.#_+l*this.#A,this.#r[L]=M+h*this.#A,this.#_=this.#r[this.#m-1491&2047],this.#D=d*this.#C+l*this.#D,this.#i[L]=M+h*this.#D,this.#C=this.#i[this.#m-1422&2047],this.#R=d*this.#O+l*this.#R,this.#n[L]=M+h*this.#R,this.#O=this.#n[this.#m-1356&2047],this.#M=d*this.#z+l*this.#M,this.#o[L]=M+h*this.#M,this.#z=this.#o[this.#m-1277&2047],this.#U=d*this.#V+l*this.#U,this.#s[L]=M+h*this.#U,this.#V=this.#s[this.#m-1188&2047],this.#j=d*this.#L+l*this.#j,this.#a[L]=M+h*this.#j,this.#L=this.#a[this.#m-1116&2047];let ee=this.#L+this.#V+this.#z+this.#O+this.#C+this.#_+this.#b+this.#$,we=this.#K-ee,$e=this.#Z-we,J=this.#q-$e;this.#u[this.#m&1023]=ee+.5*this.#K,this.#K=this.#u[this.#m-556&1023],this.#l[this.#m&511]=we+.5*this.#Z,this.#Z=this.#l[this.#m-441&511],this.#c[this.#m&511]=$e+.5*this.#q,this.#q=this.#c[this.#m-341&511],this.#h[this.#m&255]=J+.5*this.#H,this.#H=this.#h[this.#m-225&255],a[f]=this.dryGain*v+this.wetGain*(this.#H-J),this.#G=d*this.#W+l*this.#G,this.#d[L]=j+h*this.#G,this.#W=this.#d[this.#m-1640&2047],this.#J=d*this.#Y+l*this.#J,this.#p[L]=j+h*this.#J,this.#Y=this.#p[this.#m-1580&2047],this.#Q=d*this.#X+l*this.#Q,this.#f[L]=j+h*this.#Q,this.#X=this.#f[this.#m-1514&2047],this.#ee=d*this.#te+l*this.#ee,this.#g[L]=j+h*this.#ee,this.#te=this.#g[this.#m-1445&2047],this.#re=d*this.#ie+l*this.#re,this.#v[L]=j+h*this.#re,this.#ie=this.#v[this.#m-1379&2047],this.#ne=d*this.#oe+l*this.#ne,this.#y[L]=j+h*this.#ne,this.#oe=this.#y[this.#m-1300&2047],this.#se=d*this.#ae+l*this.#se,this.#N[L]=j+h*this.#se,this.#ae=this.#N[this.#m-1211&2047],this.#ue=d*this.#le+l*this.#ue,this.#F[L]=j+h*this.#ue,this.#le=this.#F[this.#m-1139&2047];let me=this.#le+this.#ae+this.#oe+this.#ie+this.#te+this.#X+this.#Y+this.#W,H=this.#ce-me,ne=this.#de-H,ge=this.#he-ne;this.#I[this.#m&1023]=me+.5*this.#ce,this.#ce=this.#I[this.#m-579&1023],this.#P[this.#m&511]=H+.5*this.#de,this.#de=this.#P[this.#m-464&511],this.#B[this.#m&511]=ne+.5*this.#he,this.#he=this.#B[this.#m-364&511],this.#k[this.#m&255]=ge+.5*this.#pe,this.#pe=this.#k[this.#m-248&255],u[f]=this.dryGain*g+this.wetGain*(this.#pe-ge),this.#m++}}clearBuffers(){this.#t.fill(0),this.#e.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#s.fill(0),this.#a.fill(0),this.#u.fill(0),this.#l.fill(0),this.#c.fill(0),this.#h.fill(0),this.#d.fill(0),this.#p.fill(0),this.#f.fill(0),this.#g.fill(0),this.#v.fill(0),this.#y.fill(0),this.#N.fill(0),this.#F.fill(0),this.#I.fill(0),this.#P.fill(0),this.#B.fill(0),this.#k.fill(0),this.#x.fill(0)}clearHistory(){this.#S=0,this.#$=0,this.#E=0,this.#b=0,this.#A=0,this.#_=0,this.#D=0,this.#C=0,this.#R=0,this.#O=0,this.#M=0,this.#z=0,this.#U=0,this.#V=0,this.#j=0,this.#L=0,this.#K=0,this.#Z=0,this.#q=0,this.#H=0,this.#G=0,this.#W=0,this.#J=0,this.#Y=0,this.#Q=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#se=0,this.#ae=0,this.#ue=0,this.#le=0,this.#ce=0,this.#de=0,this.#he=0,this.#pe=0}};var Gu=class r extends he{static ID=0;#t=r.ID++;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(e.broadcaster,t.address)),this.#n=new Hu;let{decay:n,preDelay:i,damp:o,wet:s,dry:a}=this.#e.namedParameter;this.#o=this.own(this.bindParameter(n)),this.#s=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(o)),this.#u=this.own(this.bindParameter(s)),this.#l=this.own(this.bindParameter(a)),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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=m.wrap(e),{terminate:()=>this.#c=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,n);let[i,o]=this.#r.channels();this.#i.process(i,o,t,n)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#s===e?this.#n.predelayInSamples=Math.ceil(this.#s.getValue()*sampleRate):this.#a===e?this.#n.damp=this.#a.getValue():this.#u===e?this.#n.wetGain=fe(this.#u.getValue()):this.#l===e&&(this.#n.dryGain=fe(this.#l.getValue()))}toString(){return`{${this.constructor.name} (${this.#t})`}};var Wu=class extends he{#t;#e;#r;#i;#n;#o;#s;gain=1;release=1;loader=m.None;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new oe,this.#i=new Bt(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new le(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(n=>this.loader=n.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.#e.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}get adapter(){return this.#t}handleEvent(e){ae.isStart(e)?this.#e.push(new fm(this,e)):ae.isStop(e)&&this.#e.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,n){this.#r.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#r,t,n)&&this.#e.splice(i,1)}parameterChanged(e){e===this.#o?this.gain=fe(this.#o.getValue()):e===this.#s&&(this.release=this.#s.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},fm=class{#t;#e;#r=1;#i=0;#n=0;#o=Number.POSITIVE_INFINITY;constructor(e,t){this.#t=e,this.#e=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#e}stop(){this.#o=this.#n}processAdd(e,t,n){let i=this.#t.loader;if(i.isEmpty())return!0;let o=i.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,n)}processSimple(e,t,n,i){let[o,s]=e,a=t.frames[0],u=t.frames[1]??a,l=t.numberOfFrames,d=t.sampleRate/sampleRate,h=this.#t.gain,f=this.#t.release,v=1/f;for(let g=n;g<i;g++){let y=this.#i|0;if(y>=l-1)return!0;let b=this.#i-y,R=Math.min(1-(this.#n-this.#o)*v,1)**2,M=a[y]*(1-b)+a[y+1]*b,j=u[y]*(1-b)+u[y+1]*b;if(o[g]+=M*h*R,s[g]+=j*h*R,this.#i+=this.#r*d,++this.#n-this.#o>f)return!0}return!1}};var Ju=class extends mt{#t;#e;constructor(e,t){super(e),this.#t=t,this.#e=new Bt(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#e.introduceBlock(e)}setNoteEventSource(e){return this.#e.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#e.clear()}processEvents(e,t,n){}handleEvent({index:e},t){ae.isStart(t)?this.#t.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t)):ae.isStop(t)&&this.#t.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Yu=class extends he{#t;#e;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#e=new oe,this.#r=this.own(new le(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new bn,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{F.remove(this.#i,e),this.#e.clear()}}}get audioOutput(){return this.#e}get eventInput(){return this.#n}processAudio(e,t,n){}reset(){this.#r.clear()}finishProcess(){this.#e.clear();let[e,t]=this.#e.channels();for(let n of this.#i){let[i,o]=n.channels();for(let s=0;s<128;s++)e[s]+=i[s],t[s]+=o[s]}this.#e.assertSanity(),this.#r.process(this.#e.getChannel(0),this.#e.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Qu=class r{static create(e,t,n,i){return new r(e,t,n,i)}#t=new V;#e;#r;#i=[];#n=!0;constructor(e,t,n,i){this.#e=S.newSet(({device:o})=>o.uuid),this.#r=this.#t.own(new V),this.#t.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let s=Co.create(e,o.box),a=this.#e.add({device:s,subscription:s.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(a,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:s,subscription:a}=this.#e.removeByKey(o.uuid);a.terminate(),s.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let s=n;F.replace(this.#i,t.adapters().map(({uuid:a})=>this.#e.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.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#t.terminate(),this.#e.forEach(({device:e})=>e.terminate()),this.#e.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var Ro=Math.floor(.005*sampleRate),el=class{#t;#e;#r;#i;#n;#o;#s=0;#a=Number.POSITIVE_INFINITY;#u;#l;#c;#h;#d;#p;#f=!0;#g=!1;constructor(e,t,n,i){this.#t=e,this.#e=t,this.#i=n,this.#r=i,this.#n=e.gate,this.#o=gi(this.#r.velocity);let{attack:o,release:s,sampleStart:a,sampleEnd:u}=this.#e;this.#u=o.getValue()*sampleRate,this.#l=s.getValue()*sampleRate,this.#c=(n.numberOfFrames-1)*a.getValue(),this.#h=(n.numberOfFrames-1)*u.getValue(),this.#d=this.#c,this.#p=0}get sample(){return this.#t}get event(){return this.#r}get position(){return this.#d}get envelope(){return this.#p}release(e=!1){this.#f&&(e?(this.#l=Ro,this.#v(),this.#f=!1):this.#n!==_t.Off&&this.#v())}processAdd(e,t,n){let[i,o]=e,{frames:s,numberOfFrames:a}=this.#i,u=s[0],l=s[1]??u,{pitch:d}=this.#e,h=this.#h-this.#c,f=Math.sign(h),v=this.#i.sampleRate/sampleRate*f*2**(d.getValue()/1200),g=0;for(let y=t;y<n;y++){let b=this.#d|0,R=this.#d-b,M=u[b]*(1-R)+(u[b+1]??0)*R,j=l[b]*(1-R)+(l[b+1]??0)*R;if(g=Math.min(this.#s/this.#u,1-(this.#s-(this.#a+this.#u))/this.#l,1),this.#d+=v,f>0){if(this.#n===_t.Off){if(this.#d>=a)return!0;!this.#g&&this.#d>=this.#h&&this.#v()}else if(this.#n===_t.On){if(this.#d>=this.#h-Ro){if(this.#d>=this.#h)return!0;g*=(this.#h-this.#d)/Ro}}else if(this.#n===_t.Loop)for(;this.#d>=this.#h;)this.#d-=h}else if(f<0){if(this.#n===_t.Off){if(this.#d<=0)return!0;!this.#g&&this.#d<=this.#h&&this.#v()}else if(this.#n===_t.On){if(this.#d<=this.#h+Ro){if(this.#d<=this.#h)return!0;g*=(this.#h-this.#d)/Ro}}else if(this.#n===_t.Loop)for(;this.#d<=this.#h;)this.#d-=h}if(++this.#s-this.#a>this.#u+this.#l)return!0;g*=this.#o*g,i[y]+=M*g,o[y]+=j*g}return this.#p=g,!1}toString(){return"{PlayfieldSampleVoice}"}#v(){this.#g||(this.#g=!0,this.#a=this.#s<this.#u?this.#s-this.#u:this.#s)}};var tl=class extends he{#t;#e;#r;#i;#n;#o;constructor(e,t,n,i){super(e),this.#t=t,this.#e=n,this.#r=[],this.#i=new oe,this.#n=this.own(new le(e.broadcaster,n.peakAddress));let{sampleStart:o,sampleEnd:s,attack:a,release:u,pitch:l}=n.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(s)),attack:this.own(this.bindParameter(a)),release:this.own(this.bindParameter(u)),pitch:this.own(this.bindParameter(l))});let d=new Float32Array(16);this.ownAll(Qu.create(e,n.audioEffects,this,i),e.broadcaster.broadcastFloats(n.address,d,()=>{let h=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);h.forEach(({position:f},v)=>d[v]=f),d[h.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){if(ae.isStart(e)){let t=this.#e.file().flatMap(d=>d.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:n,solo:i,polyphone:o,exclude:s}=this.#e.namedParameter,a=n.getValue(),u=i.getValue();if(a||this.#t.hasSolo()&&!u)return;o.getValue()||this.#r.forEach(d=>d.release(!0)),s.getValue()&&this.#t.stopExcludeOthers(this.#e),this.#r.push(new el(this.#e,this.#o,t.unwrap(),e))}else ae.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#r.length-1;i>=0;i--)this.#r[i].processAdd(this.#i.channels(),t,n)&&this.#r.splice(i,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.#e.indexField.getValue()}}`}};var rl=class{#t=new V;#e;#r;#i;#n;constructor(e,t){this.#e=t,this.#r=this.#t.own(new Ju(e,this)),this.#i=this.#t.own(new Yu(e,this)),this.#n=S.newSet(n=>n.uuid),this.#t.ownAll(t.samples.catchupAndSubscribe({onAdd:n=>{let i=new tl(e,this,n,this.#i);this.#n.add({uuid:n.uuid,processor:i,terminable:e.registerEdge(this.#r,i)}),e.sampleManager.getOrCreate(n.fileUUID())},onRemove:n=>{let{terminable:i,processor:o}=this.#n.removeByKey(n.uuid);i.terminate(),o.terminate()},onReorder:n=>{}}),{terminate:()=>{this.#n.forEach(({terminable:n,processor:i})=>{n.terminate(),i.terminate()}),this.#n.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.#e.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#e.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#e.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:n})=>n.forceStop())}get uuid(){return this.#e.uuid}get adapter(){return this.#e}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#t.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var il=class extends he{#t;#e;#r;#i=Oe.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#s;#a;#u;#l;#c;#h=m.None;#d=Ut.Mixing.Linear;#p=!0;#f=!1;constructor(e,t){super(e),this.#t=t,this.#e=new oe,this.#r=this.own(new le(e.broadcaster,t.address)),this.#o=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.#u=this.own(this.bindParameter(t.namedParameter.invertL)),this.#l=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(n=>{this.#d=n.getValue(),this.#p=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#e.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#t.uuid}get audioOutput(){return this.#e}setAudioSource(e){return this.#h=m.wrap(e),{terminate:()=>this.#h=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#h.isEmpty())return;this.#p&&(this.#i.update(this.#n,this.#d,this.#f),this.#p=!1);let i=this.#h.unwrap().channels(),o=this.#e.channels();this.#i.processFrames(i,o,t,n),this.#r.processStereo(o,t,n),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=fe(this.#o.getValue()),this.#p=!0;return;case this.#s:this.#n.panning=this.#s.getValue(),this.#p=!0;return;case this.#a:this.#n.stereo=this.#a.getValue(),this.#p=!0;return;case this.#u:this.#n.invertL=this.#u.getValue(),this.#p=!0;return;case this.#l:this.#n.invertR=this.#l.getValue(),this.#p=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#p=!0;return}}toString(){return`{${this.constructor.name}}`}};var nl=class extends mt{#t;#e;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new kt(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(n=>{this.#r.ifSome(i=>i.terminate()),this.#r=m.wrap(n.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(n.targetVertex.unwrap().box,ti.checkType))}),Z.create(()=>{this.#r.ifSome(n=>n.terminate()),this.#r=m.None}),e.registerProcessor(this))}get uuid(){return this.#t.uuid}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}setNoteEventSource(e){return N(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),Z.create(()=>this.#i=m.None)}*processNotes(e,t,n){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),o=this.#r.mapOr(Pn,Cn.Identity);for(let s of i.processNotes(o.unwarp(e),o.unwarp(t),n))ae.isStart(s)?this.#e.noteOn(s.pitch):this.#e.noteOff(s.pitch),yield wt.overwrite(s,{position:G(o.warp(s.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),i=this.#r.mapOr(Pn,Cn.Identity);for(let o of n.iterateActiveNotesAt(i.unwarp(e),t))yield wt.overwrite(o,{position:i.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,n){}};var ol=class extends mt{#t;#e;#r=m.None;constructor(e,t){super(e),this.#t=t,this.#e=this.own(new kt(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return N(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),Z.create(()=>this.#r=m.None)}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().processNotes(e,t,n))yield i}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().iterateActiveNotesAt(e,t))yield n}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}};var sl=class{attackSamples;decaySamples;sustainLevel;releaseSamples;#t=0;#e=0;#r=0;#i=0;constructor(e,t,n,i){this.attackSamples=e*sampleRate,this.decaySamples=t*sampleRate,this.sustainLevel=Math.max(0,Math.min(1,n)),this.releaseSamples=i*sampleRate}get isComplete(){return this.#t===4}release(){this.#t!==4&&this.#t!==3&&(this.#i=this.#r,this.#t=3,this.#e=0)}process(){switch(this.#t){case 0:this.attackSamples<=0?(this.#r=1,this.#t=1,this.#e=0):(this.#r=this.#e++/this.attackSamples,this.#r>=1&&(this.#r=1,this.#t=1,this.#e=0));break;case 1:this.decaySamples<=0?(this.#r=this.sustainLevel,this.#t=2,this.#e=0):(this.#r=1-this.#e++/this.decaySamples*(1-this.sustainLevel),this.#r<=this.sustainLevel&&(this.#r=this.sustainLevel,this.#t=2,this.#e=0));break;case 2:this.#r=this.sustainLevel;break;case 3:this.releaseSamples<=0?(this.#r=0,this.#t=4):(this.#r=this.#i*(1-this.#e++/this.releaseSamples),(this.#r<=.001||this.#e>=this.releaseSamples)&&(this.#r=0,this.#t=4));break;case 4:this.#r=0;break}return this.#r}};var al=(r,e)=>(r[e]??r[e.toString()])?.value,$n=(r,e,t)=>al(e,t)??al(r,t),ul=class{event;sampleData;envelope;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,n,i){this.event=e;let o=t.generators,s=n?.generators,a=al(s,53)??0,u=n?.sample??i.samples[a];this.sampleData=u.data,this.rootKey=al(s,58)??u?.header.originalPitch??60,this.sampleRate=u?.header.sampleRate??sampleRate,this.loopStart=u?.header.startLoop??0,this.loopEnd=u?.header.endLoop??this.sampleData.length;let l=$n(o,s,54)??0;this.shouldLoop=l===1||l===3,this.pan=($n(o,s,17)??0)/1e3;let d=$n(o,s,34),h=$n(o,s,36),f=$n(o,s,37),v=$n(o,s,38),g=li(d)?Math.pow(2,d/1200):.005,y=li(h)?Math.pow(2,h/1200):.005,b=1-(f??0)/1e3,R=li(v)?Math.pow(2,v/1200):.005;this.envelope=new sl(g,y,b,R)}release(){this.isReleasing=!0,this.envelope.release()}processAdd(e,t,n){let o=Dn(this.event.pitch+this.event.cent/100,440)/Dn(this.rootKey,440)*(this.sampleRate/sampleRate),s=gi(this.event.velocity),a=Math.cos((this.pan+1)*Math.PI/4),u=Math.sin((this.pan+1)*Math.PI/4),l=e.getChannel(0),d=e.getChannel(1);for(let h=t;h<n;h++){let f=Math.floor(this.playbackPosition),v=this.envelope.process(),y=this.#t(f)/32768*s*v;if(l[h]+=y*a,d[h]+=y*u,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.isComplete}#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 ll=class extends he{#t;#e;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#e=[],this.#r=new Bt(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new oe,this.#n=this.own(new le(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(n=>this.#o=n.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.#t.uuid}get audioOutput(){return this.#i}get adapter(){return this.#t}reset(){this.#r.clear(),this.#n.clear(),this.#e.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(i=>i.soundfont);if(t.isEmpty())return;let n=t.unwrap();if(ae.isStart(e)){let i=n.presets[this.#t.presetIndex]??n.presets[0];if(Mo(i)){console.warn("No preset available");return}let o=0;for(let s of i.zones){let a=Math.round(e.velocity*127);if(this.#s(e.pitch,a,s)){let u=s.instrument.zones;for(let l=0;l<u.length;l++){let d=u[l];this.#s(e.pitch,a,d)&&(this.#e.push(new ul(e,s,d,n)),o++)}}}}else ae.isStop(e)&&this.#e.forEach(i=>i.event.id===e.id&&i.release())}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#e.length-1;i>=0;i--)this.#e[i].processAdd(this.#i,t,n)&&this.#e.splice(i,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#s(e,t,n){return this.#a(n.generators[44]?.range,t)&&this.#a(n.generators[43]?.range,e)}#a(e,t){return zo(e)||t>=e.lo&&t<=e.hi}};var Vv=r=>r>0?20*Math.log10(r):-100,jv=r=>Math.pow(10,r*.05);var cl=class{#t=.08;#e=1;#r;#i;#n=0;#o=.14;#s=0;#a=.14;#u=0;#l=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t){this.#u===0&&(this.#u=e[0]),this.#l===0&&(this.#l=e[0]),this.#s=0,this.#a=0;for(let n=0;n<t;++n){let i=e[n]*e[n];this.#u=Math.max(i,this.#r*this.#u+this.#i*i),this.#l=this.#r*this.#l+this.#i*i;let o=this.#u/this.#l;this.#c=o>0?o:0,this.#c>0&&(this.#n=2*(this.#t/this.#c),this.#o=2*(this.#e/this.#c)-this.#n,this.#s+=this.#n,this.#a+=this.#o)}this.#s/=t,this.#a/=t}getAvgAttack(){return this.#s}getAvgRelease(){return this.#a}};var dl=class{#t=[];#e;#r;#i;#n=0;constructor(e,t,n,i){this.#i=i,this.#r=Math.floor(e*t),this.#e=n+this.#r;for(let o=0;o<i;o++)this.#t[o]=new Float32Array(this.#e);this.#n=0}process(e,t){if(this.#r===0)return;let n=(this.#n-this.#r+this.#e)%this.#e;for(let i=0;i<this.#i;i++){let o=e.getChannel(i),s=this.#n,a=n;for(let u=0;u<t;u++){let l=this.#t[i][a];this.#t[i][s]=o[u],o[u]=l,s=(s+1)%this.#e,a=(a+1)%this.#e}}this.#n=(this.#n+t)%this.#e}};var hl=class{#t=-20;#e=2;#r=6;#i=3;#n=-.5;setThreshold(e){this.#t=e}setRatio(e){this.#e!==e&&(this.#e=e,this.#e>23.9&&(this.#e=-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.#t;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){for(let n=0;n<t;++n){let i=Math.max(Math.abs(e[n]),1e-6),o=Vv(i);e[n]=this.applyCompression(o)}}};var ai=class{#t;#e=1;#r=0;#i=0;#n=!0;constructor(e){this.#t=e,this.#e=1,this.#r=1-this.#e}process(e){this.#n&&(this.#i=e,this.#n=!1),this.#i=this.#e*e+this.#r*this.#i}setAlpha(e){this.#e=e,this.#r=1-this.#e}setAlphaWithTime(e){this.#e=Math.exp(-1/(this.#t*e)),this.#r=1-this.#e}getState(){return this.#i}};var pl=class{#t;#e;#r;#i;#n=.01;#o=0;#s=.14;#a=0;#u=0;#l=0;#c=!1;#h=!1;constructor(e){this.#t=e,this.#e=new cl(e),this.#r=new ai(e),this.#i=new ai(e),this.#o=Math.exp(-1/(e*this.#n)),this.#a=Math.exp(-1/(e*this.#s)),this.#u=0,this.#l=0}setAttack(e){e!==this.#n&&(this.#n=e,this.#o=Math.exp(-1/(this.#t*this.#n)))}setRelease(e){e!==this.#s&&(this.#s=e,this.#a=Math.exp(-1/(this.#t*this.#s)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#h=e}#d(e){return e<this.#u?this.#u=this.#o*this.#u+(1-this.#o)*e:this.#u=this.#a*this.#u+(1-this.#a)*e,this.#u}applyBallistics(e,t){for(let n=0;n<t;++n)e[n]=this.#d(e[n])}processCrestFactor(e,t){(this.#c||this.#h)&&(this.#e.process(e,t),this.#r.process(this.#e.getAvgAttack()),this.#i.process(this.#e.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#h&&this.setRelease(this.#i.getState()))}};var ml=class{#t;#e;#r;#i=0;#n=0;constructor(e,t,n){this.#e=Math.floor(e*t),this.#r=n+this.#e,this.#t=new Float32Array(this.#r),this.#i=0}process(e,t){this.#o(e,t),this.#a(),this.#s(e,t)}#o(e,t){for(let n=0;n<t;n++)this.#t[this.#i]=e[n],this.#i=(this.#i+1)%this.#r;this.#n=t}#s(e,t){let n=this.#i-this.#n-this.#e;n<0&&(n+=this.#r);for(let i=0;i<t;i++)e[i]=this.#t[n],n=(n+1)%this.#r}#a(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,n=0;for(let o=0;o<this.#n;o++){let s=this.#t[e];s>t?(this.#t[e]=t,t+=n):(n=-s/this.#e,t=s+n),e=e-1,e<0&&(e+=this.#r)}let i=!1;for(let o=0;o<this.#e&&!i;o++){if(this.#t[e]>t)this.#t[e]=t,t+=n;else{i=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var fl=class r extends he{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#t=r.ID++;#e;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#n;#o;#s;#a;#u;#l;#c;#h=.005;#d;#p;#f=m.None;#g=!1;#v=!1;#y=!1;#N=!1;#F=-10;#I=2;#P=6;#B=2;#k=140;#w=0;#x=1;#S=0;#$=0;#E=0;#b=0;#A=!1;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=this.own(new le(e.broadcaster,t.address)),this.#d=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#p=Oe.linear(sampleRate);let{lookahead:n,automakeup:i,autoattack:o,autorelease:s,inputgain:a,threshold:u,ratio:l,knee:d,attack:h,release:f,makeup:v,mix:g}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(n)),this.parameterAutomakeup=this.own(this.bindParameter(i)),this.parameterAutoattack=this.own(this.bindParameter(o)),this.parameterAutorelease=this.own(this.bindParameter(s)),this.parameterInputgain=this.own(this.bindParameter(a)),this.parameterThreshold=this.own(this.bindParameter(u)),this.parameterRatio=this.own(this.bindParameter(l)),this.parameterKnee=this.own(this.bindParameter(d)),this.parameterAttack=this.own(this.bindParameter(h)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(g)),this.#n=new pl(sampleRate),this.#o=new hl,this.#s=new dl(sampleRate,.005,128,2),this.#a=new ml(sampleRate,this.#h,128),this.#u=new ai(sampleRate),this.#u.setAlpha(.03),this.#l=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#d,()=>{this.#d[0]=Yl(this.#$),this.#d[1]=this.#b,this.#d[2]=Yl(this.#E)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#A=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#l.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#S=0,this.#$=0,this.#E=0,this.#b=0}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=m.wrap(e),{terminate:()=>this.#f=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}handleEvent(e){}processAudio(e,t,n){if(this.#f.isEmpty())return;let i=this.#f.unwrap(),o=n-t,s=i.getChannel(0),a=i.getChannel(1),u=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let d=t;d<n;d++){let h=this.#p.moveAndGet(),f=u[d]=s[d]*h,v=l[d]=a[d]*h,g=Math.max(Math.abs(f),Math.abs(v));this.#$<=g?this.#$=g:this.#$*=r.PEAK_DECAY_PER_SAMPLE}this.#l.fill(0,0,o);for(let d=0;d<o;d++){let h=t+d;this.#l[d]=Math.max(Math.abs(u[h]),Math.abs(l[h]))}this.#n.processCrestFactor(this.#l,o),this.#o.applyCompressionToBuffer(this.#l,o),this.#n.applyBallistics(this.#l,o);for(let d=0;d<o;d++){let h=this.#l[d];this.#b>=h?this.#b=h:this.#b+=r.REDUCTION_DECAY_PER_SAMPLE}this.#S=this.#_(this.#l,o),this.#g&&(this.#s.process(this.#r,o),this.#a.process(this.#l,o));for(let d=0;d<o;d++)this.#l[d]=jv(this.#l[d]+this.#w+this.#S);for(let d=0;d<o;d++){let h=t+d;this.#c[0][d]=u[h],this.#c[1][d]=l[h]}for(let d=0;d<o;d++){let h=t+d;u[h]*=this.#l[d],l[h]*=this.#l[d]}for(let d=0;d<o;d++){let h=t+d,f=u[h]*this.#x+this.#c[0][d]*(1-this.#x),v=l[h]*this.#x+this.#c[1][d]*(1-this.#x),g=Math.max(Math.abs(f),Math.abs(v));this.#E<=g?this.#E=g:this.#E*=r.PEAK_DECAY_PER_SAMPLE,u[h]=f,l[h]=v}this.#i.process(u,l,t,n),this.#A=!0}#_(e,t){let n=0;for(let i=0;i<t;i++)n+=e[i];return this.#u.process(-n/t),this.#v?this.#u.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#g=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#v=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#y=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#y),this.#y||this.#n.setAttack(this.#B*.001)):e===this.parameterAutorelease?(this.#N=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#N),this.#N||this.#n.setRelease(this.#k*.001)):e===this.parameterInputgain?this.#p.set(fe(this.parameterInputgain.getValue()),this.#A):e===this.parameterThreshold?(this.#F=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#F)):e===this.parameterRatio?(this.#I=this.parameterRatio.getValue(),this.#o.setRatio(this.#I)):e===this.parameterKnee?(this.#P=this.parameterKnee.getValue(),this.#o.setKnee(this.#P)):e===this.parameterAttack?(this.#B=this.parameterAttack.getValue(),this.#y||this.#n.setAttack(this.#B*.001)):e===this.parameterRelease?(this.#k=this.parameterRelease.getValue(),this.#N||this.#n.setRelease(this.#k*.001)):e===this.parameterMakeup?this.#w=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#x=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#t})}`}};var gl=class r extends he{static ID=0;#t=r.ID++;#e;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=m.None;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=new Wo(sampleRate),this.#n=this.own(new le(e.broadcaster,t.address));let{crush:n,bits:i,boost:o,mix:s}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(n)),this.parameterBitDepth=this.own(this.bindParameter(i)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(s)),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.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#o.isEmpty())return;let i=this.#o.unwrap();this.#i.process(i.channels(),this.#r.channels(),t,n),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,n)}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.#t})`}};var Lv=8,vl=class r extends he{static ID=0;#t=r.ID++;#e;#r;#i;#n;parameterDrive;parameterVolume;#o=m.None;#s;#a;#u;#l;#c=!1;constructor(e,t){super(e),this.#e=t,this.#r=new oe,this.#i=[new Float32Array(128*Lv),new Float32Array(128*Lv)],this.#n=this.own(new le(e.broadcaster,t.address)),this.#u=Oe.linear(sampleRate),this.#l=Oe.linear(sampleRate);let{drive:n,volume:i}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(n)),this.parameterVolume=this.own(this.bindParameter(i));let o=[2,4,8];this.ownAll(e.registerProcessor(this),t.box.overSampling.catchupAndSubscribe(s=>{let a=o[s.getValue()];this.#s=new is(a),this.#u=Oe.linear(sampleRate*a),this.#u.set(fe(this.parameterDrive.getValue()),this.#c),this.#l=Oe.linear(sampleRate*a),this.#l.set(fe(this.parameterVolume.getValue()),this.#c),this.#a=a})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#c=!1,this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#o.isEmpty())return;let i=this.#o.unwrap();this.#s.upsample(i.channels(),this.#i,t,n);let o=(n-t)*this.#a,[s,a]=this.#i;for(let u=0;u<o;u++){let l=this.#l.moveAndGet(),d=this.#u.moveAndGet();s[u]=Ql(s[u],d)*l,a[u]=Ql(a[u],d)*l}this.#s.downsample(this.#i,this.#r.channels(),t,n),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,n),this.#c=!0}parameterChanged(e){e===this.parameterDrive?this.#u.set(fe(this.parameterDrive.getValue()),this.#c):e===this.parameterVolume&&this.#l.set(fe(this.parameterVolume.getValue()),this.#c)}toString(){return`{${this.constructor.name} (${this.#t})`}};var gm;(e=>e.create=(t,n)=>n.accept({visitAudioBusBox:i=>new wn(t,t.boxAdapters.adapterFor(i,We)),visitVaporisateurDeviceBox:i=>new Uu(t,t.boxAdapters.adapterFor(i,Zi)),visitNanoDeviceBox:i=>new Wu(t,t.boxAdapters.adapterFor(i,Hi)),visitTapeDeviceBox:i=>new Vu(t,t.boxAdapters.adapterFor(i,Ki)),visitPlayfieldDeviceBox:i=>new rl(t,t.boxAdapters.adapterFor(i,Er)),visitSoundfontDeviceBox:i=>new ll(t,t.boxAdapters.adapterFor(i,Xi))}))(gm||={});var vm;(e=>e.create=(t,n)=>q(n.accept({visitUnknownMidiEffectDeviceBox:i=>new ol(t,t.boxAdapters.adapterFor(i,Qi)),visitArpeggioDeviceBox:i=>new Lu(t,t.boxAdapters.adapterFor(i,$r)),visitPitchDeviceBox:i=>new Ku(t,t.boxAdapters.adapterFor(i,qi)),visitZeitgeistDeviceBox:i=>new nl(t,t.boxAdapters.adapterFor(i,Ji))}),`Could not create midi-effect for'${n.name}'`))(vm||={});var Co;(e=>e.create=(t,n)=>q(n.accept({visitUnknownAudioEffectDeviceBox:i=>new Do(t,t.boxAdapters.adapterFor(i,Yi)),visitStereoToolDeviceBox:i=>new il(t,t.boxAdapters.adapterFor(i,Wi)),visitCompressorDeviceBox:i=>new fl(t,t.boxAdapters.adapterFor(i,en)),visitDelayDeviceBox:i=>new Tu(t,t.boxAdapters.adapterFor(i,Kt)),visitCrusherDeviceBox:i=>new gl(t,t.boxAdapters.adapterFor(i,tn)),visitFoldDeviceBox:i=>new vl(t,t.boxAdapters.adapterFor(i,rn)),visitReverbDeviceBox:i=>new Gu(t,t.boxAdapters.adapterFor(i,Di)),visitRevampDeviceBox:i=>new qu(t,t.boxAdapters.adapterFor(i,Ci)),visitModularDeviceBox:i=>new Do(t,t.boxAdapters.adapterFor(i,wr))}),`Could not create audio-effect for'${n.name}'`))(Co||={});var xl=class extends he{#t;#e;#r;#i;#n;#o;#s=m.None;#a=!0;#u=!1;constructor(e,t){super(e),this.#t=t,this.#e=new oe,this.#r=Oe.linear(sampleRate),this.#i=Oe.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.#e.clear()}get adapter(){return this.#t}setAudioSource(e){return this.#s=m.wrap(e),{terminate:()=>this.#s=m.None}}get audioOutput(){return this.#e}processAudio(e,t,n){if(this.#s.isEmpty())return;if(this.#a){let l=fe(this.#n.getValue()),d=this.#o.getValue();this.#r.set((1-Math.max(0,d))*l,this.#u),this.#i.set((1+Math.min(0,d))*l,this.#u),this.#a=!1}let i=this.#e.getChannel(0),o=this.#e.getChannel(1),s=this.#s.unwrap(),a=s.getChannel(0),u=s.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let l=t;l<n;l++)i[l]=a[l]*this.#r.moveAndGet(),o[l]=u[l]*this.#i.moveAndGet();else{let l=this.#r.get(),d=this.#i.get();for(let h=t;h<n;h++)i[h]=a[h]*l,o[h]=u[h]*d}this.#u=!0}parameterChanged(e){this.#a=!0}};var yl=class extends he{#t;#e;#r;#i;#n;#o;#s;#a;#u=Oe.linear(sampleRate);#l=Oe.linear(sampleRate);#c=Oe.linear(sampleRate);#h=m.None;#d=!0;#p=!1;constructor(e,t){super(e),this.#t=t,this.#e=new oe,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new le(e.broadcaster,this.#t.address)),this.#n=this.own(this.bindParameter(this.#t.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#t.namedParameter.panning)),this.#s=this.own(this.bindParameter(this.#t.namedParameter.mute)),this.#a=this.own(this.bindParameter(this.#t.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#e.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#p=!1}get isMute(){return this.#s.getValue()}get isSolo(){return this.#a.getValue()}get adapter(){return this.#t}get audioOutput(){return this.#e}handleEvent(e){}processAudio(e,t,n){if(this.#h.isEmpty())return;if(this.#d){let h=this.context.mixer;h.updateSolo();let f=this.isSolo||h.isVirtualSolo(this),v=this.isMute||h.hasChannelSolo()&&!f&&!this.#t.isOutput,g=fe(this.#n.getValue()),y=this.#o.getValue();this.#u.set((1-Math.max(0,y))*g,this.#p),this.#l.set((1+Math.min(0,y))*g,this.#p),this.#c.set(v?0:1,this.#p),this.#d=!1}let i=this.#h.unwrap(),[o,s]=i.channels(),[a,u]=this.#e.channels(),[l,d]=this.#r;if(this.#u.isInterpolating()||this.#l.isInterpolating()||this.#c.isInterpolating())for(let h=t;h<n;h++){let f=this.#c.moveAndGet(),v=o[h]*this.#u.moveAndGet(),g=s[h]*this.#l.moveAndGet();a[h]=v*f,u[h]=g*f,l[h]=v,d[h]=g}else{let h=this.#u.get(),f=this.#l.get(),v=this.#c.get();for(let g=t;g<n;g++){let y=o[g]*h,b=s[g]*f;l[g]=y,d[g]=b,a[g]=y*v,u[g]=b*v}}this.#i.process(l,d,t,n),this.#p=!0}finishProcess(){this.#e.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#s?this.requestGainUpdate():e===this.#a&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#d=!0}requestSoloUpdate(){this.#d=!0}setAudioSource(e){return this.#h=m.wrap(e),{terminate:()=>this.#h=m.None}}toString(){return`{${this.constructor.name}}`}};var bl=class{#t=new V;#e;#r;#i;#n;#o;#s;#a=[];#u=!1;constructor(e,t){this.#e=e,this.#r=t,this.#i=S.newSet(n=>n.adapter.uuid),this.#n=this.#t.own(new yl(this.#e.context,this.#e.adapter)),this.#o=S.newSet(({device:n})=>n.uuid),this.#s=this.#t.own(new V),this.#t.ownAll(this.#e.adapter.audioEffects.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=Co.create(this.#e.context,n.box),o=this.#o.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(o,"Could not add.")},onRemove:n=>{this.invalidateWiring();let{device:i,subscription:o}=this.#o.removeByKey(n.uuid);o.terminate(),i.terminate()},onReorder:n=>this.invalidateWiring()}),this.#e.adapter.auxSends.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=this.#i.add(new xl(this.#e.context,n));N(i,"Could not add.")},onRemove:({uuid:n})=>{this.invalidateWiring(),this.#i.removeByKey(n).terminate()},onReorder:n=>{}}),this.#e.adapter.output.catchupAndSubscribe(n=>this.invalidateWiring()),this.#e.context.subscribeProcessPhase(n=>{n===0&&this.#u&&(this.#l(),this.#u=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#s.terminate(),this.#u=!0}terminate(){this.#t.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#a=[]}toString(){return`{${this.constructor.name}}`}#l(){let e=this.#e.adapter.isOutput,t=this.#e.context,n=this.#e.input(),i=this.#e.adapter.output.adapter.map(s=>t.getAudioUnit(s.deviceHost().uuid).inputAsAudioBus());if(n.isEmpty()||i.isEmpty()&&!e)return;let o=n.unwrap();if(this.#r.includeAudioEffects){F.replace(this.#a,this.#e.adapter.audioEffects.adapters().map(({uuid:s})=>this.#o.get(s).device));for(let s of this.#a)s.adapter().enabledField.getValue()&&(this.#s.own(s.setAudioSource(o.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,s.incoming)),o=s)}if(this.#r.includeSends&&this.#i.forEach(s=>{let a=t.getAudioUnit(s.adapter.targetBus.deviceHost().uuid);this.#s.own(s.setAudioSource(o.audioOutput)),this.#s.own(a.inputAsAudioBus().addAudioSource(s.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,s)),this.#s.own(t.registerEdge(s,a.inputAsAudioBus()))}),this.#s.own(this.#n.setAudioSource(o.audioOutput)),this.#s.own(t.registerEdge(o.outgoing,this.#n)),i.nonEmpty()&&!e){let s=i.unwrap();this.#s.own(s.addAudioSource(this.#n.audioOutput)),this.#s.own(t.registerEdge(this.#n,s))}}};var wl=class{#t=new V;#e;#r;#i;#n;#o;constructor(e,t){this.#e=e,this.#r=t,this.#i=qo.create(268431651),this.#n=new Set,this.#o=new vi,this.#t.ownAll(this.#e.subscribeProcessPhase(n=>{if(n===1)for(let i of this.#n)i.gate||this.#n.delete(i)}))}get uuid(){return this.#r.uuid}terminate(){this.#t.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:m.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,n){let i=Ce.every(n,5);if(this.#o.nonEmpty()&&(!i||Ce.every(n,2)?yield*this.#l(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:s,velocity:a}=o,u=Number.POSITIVE_INFINITY,l=ae.start(e,u,s,a);o.running=m.wrap(l),yield l}o.gate||(this.#n.delete(o),yield ae.stop(o.running.unwrap("raw note never started"),e))}if(i){let o=this.#r.tracks.collection.adapters().filter(s=>s.type===de.Notes&&s.enabled.getValue());for(let s of o)for(let{optClip:a,sectionFrom:u,sectionTo:l}of this.#e.clipSequencing.iterate(s.uuid,e,t))a.isEmpty()?yield*this.#a(s,u,l):yield*this.#s(a.unwrap(),u,l);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:n,velocity:i}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:n,velocity:i,cent:0};t||(yield*this.#o.overlapping(e,He.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#s(e,t,n){if(e.optCollection.isEmpty())return;let i=e.optCollection.unwrap(),o=e.duration,s=Rt(t,o),a=s+o;n>a?(yield*this.#u(i,t,a,s),yield*this.#u(i,a,n,a)):yield*this.#u(i,t,n,s)}*#a(e,t,n){for(let i of e.regions.collection.iterateRange(t,n)){if(this.#e.ignoresRegion(i.address.uuid)||i.mute||!Ee(i,xr))continue;let o=i.optCollection;if(o.isEmpty())continue;let s=o.unwrap();for(let{resultStart:a,resultEnd:u,rawStart:l}of Ye.locateLoops(i,t,n))yield*this.#u(s,a,u,l)}}*#u(e,t,n,i){let o=t-i,s=n-i;for(let a of e.events.iterateRange(o-e.maxDuration,s)){if(!He.isOfType(a))continue;let{position:u,duration:l,chance:d,playCount:h,playCurve:f}=a;if(!(d<100&&this.#i.nextDouble(0,100)>d)){if(h>1){let v=He.inverseCurveFunc((o-u)/l,f),g=He.inverseCurveFunc((s-u)/l,f),y=Math.floor(v*h),b=y/h;for(;b<g;){if(b>=v){let R=He.curveFunc(b,f)*l;if(R>=l)break;let M=He.curveFunc(b+1/h,f)*l,j=ae.startWith(a,u+R+i,M-R);this.#o.addAndRetain({...j}),yield j}b=++y/h}}else if(o<=u&&u<s){let v=ae.startWith(a,u+i);this.#o.addAndRetain({...v}),yield v}}}}*#l(e){for(let t of this.#o.releaseAll())yield ae.stop(t,e)}*#c(e,t){for(let n of this.#o.releaseLinearCompleted(t)){let i=G(n.position+n.duration,e,t);yield ae.stop(n,i)}}};var Al=class{#t=new V;#e;#r;#i;#n;#o=!1;constructor(e){this.#e=e,this.#r=this.#t.own(new wl(this.#e.context,this.#e.adapter)),this.#i=S.newSet(({device:t})=>t.uuid),this.#n=this.#t.own(new V),this.#t.ownAll(this.#e.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let n=vm.create(this.#e.context,t.box),i=this.#i.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});N(i,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:n,subscription:i}=this.#i.removeByKey(t.uuid);i.terminate(),n.terminate()},onReorder:t=>this.invalidateWiring()}),this.#e.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#s(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#t.terminate()}toString(){return`{${this.constructor.name}}`}#s(){let e=this.#e.input().flatMap(i=>i.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),n=this.#r;this.#e.adapter.midiEffects.adapters().map(i=>this.#i.get(i.uuid).device).forEach(i=>{i.adapter().enabledField.getValue()&&(this.#n.ownAll(i.setNoteEventSource(n),this.#e.context.registerEdge(i,t.incoming)),n=i)}),this.#n.own(t.setNoteEventSource(n))}};var $l=class r{static ID=0;#t=r.ID++;#e=new V;#r;#i;#n;#o;#s=m.None;constructor(e,t,n){this.#r=e,this.#i=t,this.#n=this.#e.own(new Al(this)),this.#o=this.#e.own(new bl(this,n)),this.#e.ownAll(this.#i.input.catchupAndSubscribe(i=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#s.ifSome(o=>o.terminate()),this.#s=i.getValue().flatMap(o=>m.wrap(gm.create(e,o.box.box)))}))}input(){return this.#s}inputAsAudioBus(){return st(this.#s.unwrap("No input available"),wn)}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.#e.terminate(),this.#s.ifSome(e=>e.terminate()),this.#s=m.None}toString(){return`{${this.constructor.name}(${this.#t})}`}};var El=class{#t;#e;#r;#i=!1;constructor(){this.#t=S.newSet(e=>e.adapter.uuid),this.#e=new Set,this.#r=new Set}attachChannelStrip(e){return this.#t.add(e),Z.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#e.delete(e),this.#t.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#e.add(e):this.#e.delete(e),this.#n()}hasChannelSolo(){return this.#e.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#t.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=n=>{e.has(n)||(e.add(n),n.adapter.input.getValue().ifSome(i=>{i.type==="bus"&&i.box.input.pointerHub.filter(c.AudioOutput).map(o=>q(o.box.accept({visitAudioUnitBox:({address:{uuid:s}})=>this.#t.get(s),visitAuxSendBox:({audioUnit:{targetVertex:s}})=>this.#t.get(s.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#t.forEach(n=>{n.isSolo&&t(n)}),this.#i=!1}};var Cr;(function(r){let e=typeof self<"u"&&"location"in self&&typeof self.location!==void 0,t=typeof self<"u"&&"navigator"in self&&typeof self.navigator!==void 0;r.isLocalHost=()=>e&&location.host.includes("localhost"),r.isMacOS=()=>t&&navigator.userAgent.includes("Mac OS X"),r.isWindows=()=>t&&navigator.userAgent.includes("Windows"),r.isFirefox=()=>t&&navigator.userAgent.toLowerCase().includes("firefox"),r.isWeb=()=>!r.isTauriApp(),r.isVitest=typeof process<"u"&&process.env?.VITEST==="true",r.isTauriApp=()=>"__TAURI__"in window,r.userAgent=t?navigator.userAgent.replace(/^Mozilla\/[\d.]+\s*/,"").replace(/\bAppleWebKit\/[\d.]+\s*/g,"").replace(/\(KHTML, like Gecko\)\s*/g,"").replace(/\bSafari\/[\d.]+\s*/g,"").replace(/\s+/g," ").trim():"N/A",r.id=()=>{if(!e)return"";let n="__id__",i=localStorage.getItem(n);if(O(i))return i;let o=S.toString(S.generate());return localStorage.setItem(n,o),o}})(Cr||(Cr={}));var Kv;(function(r){r.encode=async(e,t="gzip")=>{let n=new CompressionStream(t),i=n.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(n.readable).arrayBuffer()},r.decode=async(e,t="gzip")=>{let n=new DecompressionStream(t),i=n.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(n.readable).arrayBuffer()}})(Kv||(Kv={}));var Zv;(function(r){r.exportMethod=(i,o)=>n(i,{value:o}),r.exportBoolean=(i,o=!1)=>{let s=new Ze(o);return r.exportAccessor(i,()=>s.getValue(),a=>{let u=!!a;console.debug(`set to ${u}`),s.setValue(u)}),s},r.exportAccessor=(i,o,s=Pm)=>n(i,{get:()=>{try{return console.debug(o()),0}catch(a){return console.error(a),1}},set:a=>{try{return s(a),o()}catch(u){return console.error(u),1}},enumerable:!1,configurable:!1});let e=(()=>{try{return self}catch{return{}}})(),t=e.opendaw??={},n=(i,o)=>{let s=i.split("."),a=s.splice(-1)[0],u=t;for(let l of s)u=u[l]??={};Object.defineProperty(u,a,o),console.debug(`Console command 'opendaw.${i}' exported`)}})(Zv||(Zv={}));var qv;(function(r){r.resolveString=e=>{if(!Mo(e)){if(typeof e=="string")return e;if(Array.isArray(e))return e.join(",");if(typeof e=="object"){if(typeof e.exact=="string")return e.exact;if(Array.isArray(e.exact))return e.exact.join(",");if(typeof e.ideal=="string")return e.ideal;if(Array.isArray(e.ideal))return e.ideal.join(",")}}}})(qv||(qv={}));var Hv;(function(r){r.truncateText=(e,t,n)=>{if(t.length===0)return{text:"",width:0};let i=e.measureText(t).width;if(i<=n)return{text:t,width:i};let o=e.measureText("\u2026").width,s=0,a=t.length|0;for(;s<a;){let l=a+s>>>1;i=e.measureText(t.substring(0,l+1)).width+o,i<=n?s=l+1:a=l}if(s===0)return{text:"",width:0};let u=t.substring(0,s);return{text:u+"\u2026",width:e.measureText(u).width+o}}})(Hv||(Hv={}));var Gv;(function(r){r.calc=(t,n,i)=>{let o=/([0-9]*\.?[0-9]+)([a-zA-Z%]*)/g,s=t;return s.split(/\+|(?<!\d)-/).flatMap(a=>Array.from(a.matchAll(o))).forEach(([a,u,l])=>{let d=parseFloat(u);if(isNaN(d))return A(`${a} does not contain a number`);if(l==="em")s=s.replaceAll(a,`${d*i}`);else if(l==="%")s=s.replaceAll(a,`${d/100*n}`);else if(l==="px")s=s.replaceAll(a,`${d}`);else return A(`Unknown unit '${l}'`)}),Function(`return ${s}`)()};let e=new Map;r.registerCustomCursor=(t,n)=>e.set(t,n),r.setCursor=(t,n=document)=>{n.documentElement.style.cursor=typeof t=="number"?e.get(t)??"auto":t}})(Gv||(Gv={}));var Oo;(function(r){let e=new Set,t=new Set,n=new Array,i=-1,o=null;r.add=a=>(t.add(a),{terminate:()=>t.delete(a)}),r.once=a=>{e.add(a)},r.start=a=>{o!==a&&(o?.cancelAnimationFrame(i),o=a,i=a.requestAnimationFrame(s))},r.stop=()=>{o?.cancelAnimationFrame(i),o=null,i=-1},r.terminate=()=>{r.stop(),n.length=0,t.clear(),e.clear()};let s=()=>{(t.size>0||e.size>0)&&(t.forEach(a=>n.push(a)),e.forEach(a=>n.push(a)),e.clear(),n.forEach(a=>a()),n.length=0),i=o?.requestAnimationFrame(s)??-1}})(Oo||(Oo={}));var rt=class{static subscribe(e,t,n,i){return e.addEventListener(t,n,i),{terminate:()=>e.removeEventListener(t,n,i)}}static subscribeAny(e,t,n,i){return e.addEventListener(t,n,i),{terminate:()=>e.removeEventListener(t,n,i)}}static DOUBLE_DOWN_THRESHOLD=200;static subscribeDblDwn=(e,t)=>{let n=0;return this.subscribe(e,"pointerdown",i=>{let o=performance.now();o-n<this.DOUBLE_DOWN_THRESHOLD&&t(i),n=o},{capture:!0})};static PreventDefault=e=>e.preventDefault();static isTextInput=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&O(e.getAttribute("contenteditable"))};var Rr;(function(r){r.isControlKey=({ctrlKey:e,metaKey:t})=>Cr.isMacOS()?t:e,r.isCopyKey=({altKey:e})=>e,r.GlobalShortcut=Object.freeze({isDelete:e=>!rt.isTextInput(e.target)&&(e.code==="Delete"||e.code==="Backspace"),isSelectAll:e=>r.isControlKey(e)&&!e.shiftKey&&e.code==="KeyA",isDeselectAll:e=>r.isControlKey(e)&&e.shiftKey&&e.code==="KeyA"})})(Rr||(Rr={}));var Wv;(function(r){r.attach=(e,t,n)=>{let i=new V;return Z.many(i,rt.subscribe(e,"pointerdown",o=>{if(n?.multiTouch!==!0&&!o.isPrimary||o.buttons!==1||Cr.isMacOS()&&o.ctrlKey)return;let s=t(o);if(s.isEmpty())return;let a=s.unwrap(),u=o.pointerId;o.stopPropagation(),o.stopImmediatePropagation(),e.setPointerCapture(u);let l={clientX:o.clientX,clientY:o.clientY,altKey:o.altKey,shiftKey:o.shiftKey,ctrlKey:Rr.isControlKey(o)};n?.immediate===!0&&a.update(l),n?.permanentUpdates===!0?(i.own(Oo.add(()=>a.update(l))),i.own(rt.subscribe(e,"pointermove",f=>{f.pointerId===u&&(l.clientX=f.clientX,l.clientY=f.clientY,l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Rr.isControlKey(f))}))):i.own(rt.subscribe(e,"pointermove",f=>{f.pointerId===u&&(l.clientX=f.clientX,l.clientY=f.clientY,l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Rr.isControlKey(f),a.update(l))}));let d=()=>{a.cancel?.call(a),a.finally?.call(a),i.terminate()},h=Sm(e,"ownerDocument","defaultView")??self;i.ownAll(rt.subscribe(e,"pointerup",f=>{f.pointerId===u&&(a.approve?.call(a),a.finally?.call(a),i.terminate())},{capture:!0}),rt.subscribe(e,"pointercancel",f=>{console.debug(f.type),f.pointerId===u&&(e.releasePointerCapture(u),d())},{capture:!0}),rt.subscribe(h,"beforeunload",f=>{e.releasePointerCapture(u),d()},{capture:!0}),rt.subscribe(h,"keydown",f=>{l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Rr.isControlKey(f),f.key==="Escape"?d():a.update(l)}),rt.subscribe(h,"keyup",f=>{l.altKey=f.altKey,l.shiftKey=f.shiftKey,l.ctrlKey=Rr.isControlKey(f),a.update(l)})),O(a.abortSignal)&&i.own(rt.subscribe(a.abortSignal,"abort",()=>{e.releasePointerCapture(u),d()}))}))}})(Wv||(Wv={}));var Jv;(function(r){r.save=async(e,t)=>{if(O(window.showSaveFilePicker)){let n=await window.showSaveFilePicker(t),i=await n.createWritable();return await i.truncate(0),await i.write(e),await i.close(),n.name??"unknown"}else{let n=new Blob([e]),i=URL.createObjectURL(n),o=document.createElement("a");return o.href=i,o.download=t?.suggestedName??"unknown",o.click(),URL.revokeObjectURL(i),t?.suggestedName??"Unknown"}},r.open=async e=>{if(O(window.showOpenFilePicker)){let{status:t,value:n,error:i}=await ur.tryCatch(window.showOpenFilePicker(e));return t==="rejected"?Promise.reject(i):Promise.all(n.map(o=>o.getFile()))}else return new Promise((t,n)=>{O(e)&&console.warn("FileApi.showOpenFilePicker is emulated in this browser. OpenFilePickerOptions are ignored.");let i=document.createElement("input");i.type="file",i.multiple=e?.multiple??!1,i.style.display="none",i.addEventListener("cancel",async()=>{i.remove(),n(new DOMException("cancel","AbortError"))}),i.addEventListener("change",async o=>{let a=o.target.files;O(a)?t(F.create(u=>q(a.item(u),`No file at index ${u}`),a.length)):n(new DOMException("cancel","AbortError")),i.remove()}),document.body.appendChild(i),i.click()})}})(Jv||(Jv={}));var Yv;(function(r){r.parse=e=>{let t=document.createElement("div");if(t.innerHTML=e,t.childElementCount!==1)return A(`Source html has more than one root elements: '${e}'`);let n=t.firstChild;return n instanceof HTMLElement||n instanceof SVGSVGElement?n:A(`Cannot parse to HTMLOrSVGElement from '${e}'`)},r.empty=e=>{for(;e.firstChild!==null;)e.firstChild.remove()},r.query=(e,t=document)=>q(t.querySelector(e)),r.queryAll=(e,t=document)=>Array.from(t.querySelectorAll(e)),r.sanitize=e=>{e.querySelectorAll("script").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{[...t.attributes].forEach(n=>{n.name.toLowerCase().startsWith("on")&&t.removeAttribute(n.name)})})},r.nextID=(()=>{let e=0;return()=>(++e).toString(16).padStart(4,"0")})(),r.adoptStyleSheet=(e,t)=>{N(e.includes("component"),`No 'component' found in: ${e}`);let n=`${t??"C"}${r.nextID()}`,i=new CSSStyleSheet;return i.replaceSync(e.replaceAll("component",`.${n}`)),i.cssRules.length===0?A(`No cssRules found in: ${e}`):(document.adoptedStyleSheets.push(i),n)},r.buildClassList=(...e)=>e.filter(t=>t!==!1&&t!==void 0).join(" "),r.readCssVarColor=(...e)=>{let t=document.createElement("div");document.body.appendChild(t);let n=e.map(i=>(t.style.color=i,Uo.parseCssRgbOrRgba(getComputedStyle(t).color)));return t.remove(),n},r.watchResize=(e,t,n)=>{let i=new ResizeObserver(([o],s)=>t(o,s));return i.observe(e,n),{terminate:()=>i.disconnect()}},r.watchIntersection=(e,t,n)=>{let i=new IntersectionObserver(t,n);return i.observe(e),{terminate:()=>i.disconnect()}},r.secureBoundingBox=e=>{let t=e.getBoundingClientRect();if(!Fn.isEmpty(t))return t;for(let n of e.children)Fn.union(t,r.secureBoundingBox(n));return t},r.unfocus=(e=self)=>{let t=e.document.activeElement;t!==null&&"blur"in t&&typeof t.blur=="function"&&t.blur()},r.selectContent=e=>{let t=document.createRange(),n=window.getSelection();O(n)&&(t.selectNodeContents(e),n.removeAllRanges(),n.addRange(t))},r.unselectContent=e=>{let t=window.getSelection();!O(t)||t.rangeCount===0||e.contains(t.getRangeAt(0).commonAncestorContainer)&&t.removeAllRanges()},r.limitChars=(e,t,n)=>{if(!(t in e))return A(`${t} not found in ${e}`);if(typeof e[t]!="string")return A(`${t} in ${e} is not a string`);if(e[t].length>n)if(e[t]=e[t].substring(0,n),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.setSelectionRange(n,n);else{let i=e.ownerDocument,o=i.createRange(),s=i.defaultView?.getSelection();if(!O(s))return;o.selectNodeContents(e),o.collapse(!1),s.removeAllRanges(),s.addRange(o)}},r.EmptyGif="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="})(Yv||(Yv={}));var D7=(()=>{let r={Cmd:"\u2318",Opt:"\u2325",Shift:"\u21E7"},e={Cmd:"Ctrl",Opt:"Alt",Shift:"\u21E7"};return Object.freeze({Mac:r,Win:e,System:Cr.isMacOS()?r:e})})();var Qv;(function(r){r.read=async e=>{let t=[];for(;;){let{done:s,value:a}=await e.read();if(s)break;t.push(a)}let n=t.reduce((s,a)=>s+a.length,0),i=new Uint8Array(n),o=0;for(let s of t)i.set(s,o),o+=s.length;return i.buffer}})(Qv||(Qv={}));var Xv;(function(r){r.pathBuilder=()=>new class{#t="";moveTo(e,t){return this.#t+=`M${e.toFixed(3)} ${t.toFixed(3)}`,this}lineTo(e,t){return this.#t+=`L${e.toFixed(3)} ${t.toFixed(3)}`,this}quadratic(e,t,n,i){return this.#t+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)}`,this}quadraticTo(e,t){return this.#t+=`T${e.toFixed(3)} ${t.toFixed(3)}`,this}cubic(e,t,n,i,o,s){return this.#t+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)} ${o.toFixed(3)} ${s.toFixed(3)}`,this}arc(e,t,n,i,o,s,a){return this.#t+=`A${e} ${t} ${n} ${i?1:0} ${o?1:0} ${s.toFixed(3)} ${a.toFixed(3)}`,this}circleSegment(e,t,n,i,o){let s=e+Math.cos(i)*n,a=t+Math.sin(i)*n,u=e+Math.cos(o)*n,l=t+Math.sin(o)*n,d=o-i;for(;d<0;)d+=Math.PI*2;return this.moveTo(s,a).arc(n,n,0,d>Math.PI,!0,u,l)}close(){return this.#t+="Z",this}get(){return this.#t}}})(Xv||(Xv={}));var ex;(function(r){let e=new Array;r.watchWeak=(n,i)=>{let o=new WeakRef(n),s=i(o);return e.push([o,s]),e.length===1&&t(),n};let t=()=>{console.debug("start weak watching");let n=setInterval(()=>{let i=e.length;for(;--i>=0;){let o=e[i];o[0].deref()===void 0&&(o[1].terminate(),e.splice(i,1),e.length===0&&clearInterval(n))}},1e3)}})(ex||(ex={}));var Sl=Symbol.for("@openDAW/lib-dom");globalThis[Sl]?console.debug(`%c${Sl.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Sl]=!0,console.debug(`%c${Sl.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Yt;(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"})(Yt||(Yt={}));var En;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(En||(En={}));var ui;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(ui||(ui={}));var Nl=class r{static create(e,t){return new r(e.channel(t))}#t=[];#e=new SharedArrayBuffer(1);#r=new Int8Array(this.#e);#i;#n=Se.create(0);#o=m.None;#s=m.None;#a=-1;#u=-1;#l=!1;#c=!1;constructor(e){this.#i=Ge.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(n){t(this.sendShareLock,n)}sendUpdateData(n){t(this.sendUpdateData,n)}sendUpdateStructure(n){t(this.sendUpdateStructure,n)}})}flush(){let e=this.#h();if(e.nonEmpty()){this.#c||(this.#i.sendShareLock(this.#e),this.#c=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#d();if(this.#n.remaining<t){let n=Ot(t),i=new SharedArrayBuffer(n);this.#n=Se.use(i),this.#o=m.wrap(i),this.#i.sendUpdateData(i)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===En.WRITE&&(this.#p(this.#n),this.#n.position=0,Atomics.store(this.#r,0,En.READ))}broadcastFloat(e,t){return this.#g(new class{type=Yt.Float;address=e;capacity=8;put(n){n.writeFloat(t())}})}broadcastInteger(e,t){return this.#g(new class{type=Yt.Integer;address=e;capacity=8;put(n){n.writeInt(t())}})}broadcastFloats(e,t,n,i){return this.#g(new class{type=Yt.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(o){w(n),o.writeInt(t.length);for(let s of t)o.writeFloat(s);w(i)}})}broadcastIntegers(e,t,n){return this.#g(new class{type=Yt.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i){n(),i.writeInt(t.length),t.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,t,n){return this.#g(new class{type=Yt.ByteArray;address=e;capacity=4+t.byteLength;put(i){n(),i.writeInt(t.byteLength),i.writeBytes(t)}})}#h(){if(this.#l){try{this.#s=m.wrap(this.#y())}catch(e){throw e}this.#l=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=m.None,e}return m.None}#d(){return this.#u===-1&&(this.#u=this.#f()+12),this.#u}terminate(){F.clear(this.#t),this.#s=m.None,this.#l=!1,this.#u=0}#p(e){N(!this.#l&&this.#s.isEmpty(),"Cannot flush while update is available");let t=this.#d();N(e.remaining>=t,"Insufficient data"),e.writeInt(this.#a),e.writeInt(ui.START);for(let n of this.#t)n.put(e);e.writeInt(ui.END)}#f(){return this.#t.reduce((e,t)=>e+t.capacity,0)}#g(e){return this.#t.push(e),this.#v(),{terminate:()=>{F.removeOpt(this.#t,e),this.#v()}}}#v(){this.#u=-1,this.#l=!0}#y(){let e=Se.create();e.writeInt(ui.ID),e.writeInt(++this.#a),e.writeInt(this.#t.length);for(let{address:t,type:n}of this.#t)t.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Or;(function(r){class e{shift;numPeaks;dataOffset;constructor(n,i,o){this.shift=n,this.numPeaks=i,this.dataOffset=o}unitsEachPeak(){return 1<<this.shift}}r.Stage=e,r.unpack=(t,n)=>{switch(n){case 0:return er.intBitsToFloat(t);case 1:return er.intBitsToFloat(t>>16);default:return Dt(n)}}})(Or||(Or={}));var Pl=class r{stages;data;numFrames;numChannels;static from(e){N(e.readString()==="PEAKS","Wrong header");let t=e.readInt(),n=[];for(let u=0;u<t;u++){let l=e.readInt(),d=e.readInt(),h=e.readInt();e.readInt(),n[u]=new Or.Stage(h,d,l)}let i=e.readInt(),o=[];for(let u=0;u<i;u++){let l=new Int8Array(e.readInt());e.readBytes(l),o[u]=new Int32Array(l.buffer)}let s=e.readInt(),a=e.readInt();return new r(n,o,s,a)}static None=new r([],[],0,0);static findBestFit=(e,t=1200)=>{let n=e/t;if(n<=1)return new Uint8Array(0);let i=3,o=Math.floor(Math.log(n)/Math.LN2),s=Math.max(1,Math.floor(o/i));return new Uint8Array(F.create(a=>i*(a+1),s))};constructor(e,t,n,i){this.stages=e,this.data=t,this.numFrames=n,this.numChannels=i}nearest(e){if(this.stages.length===0)return null;let t=Math.floor(Math.log(Math.abs(e))/Math.LN2),n=this.stages.length;for(;--n>-1;)if(t>=this.stages[n].shift)return this.stages[n];return this.stages[0]}toArrayBuffer(){let e=Se.create();e.writeString("PEAKS"),e.writeInt(this.stages.length);for(let t=0;t<this.stages.length;t++){let{dataOffset:n,numPeaks:i,shift:o}=this.stages[t];e.writeInt(n),e.writeInt(i),e.writeInt(o),e.writeInt((1<<o)-1)}e.writeInt(this.data.length);for(let t=0;t<this.data.length;t++){let n=new Int8Array(this.data[t].buffer);e.writeInt(n.length),e.writeBytes(n)}return e.writeInt(this.numFrames),e.writeInt(this.numChannels),e.toArrayBuffer()}toString(){return`{SamplePeaks num-stages: ${this.stages.length}}`}};var tx;(function(r){r.install=n=>Ge.executor(n.channel("peaks"),new class{async generateAsync(i,o,s,a,u){return e(i,o,s,a,u).toArrayBuffer()}});let e=(n,i,o,s,a)=>{if(o.length!==a)return A(`Invalid numberOfChannels. Expected: ${a}. Got ${o.length}`);class u{min=Number.POSITIVE_INFINITY;max=Number.NEGATIVE_INFINITY;index=0}let l=cf(),d=i.length,[h,f]=t(i,s),v=F.create(()=>new Int32Array(f),a),g=(1<<h[0].shift)-1,y=a*s,b=0;for(let R=0;R<a;++R){let M=v[R],j=o[R],L=F.create(()=>new u,d),ee=Number.POSITIVE_INFINITY,we=Number.NEGATIVE_INFINITY,$e=0;for(let J=0;J<s;++J){let me=j[J];if(ee=Math.min(me,ee),we=Math.max(me,we),(++$e&g)===0){for(let H=0;H<d;++H){let ne=h[H],ge=L[H];ge.min=Math.min(ge.min,ee),ge.max=Math.max(ge.max,we),((1<<ne.shift)-1&$e)===0&&(M[ne.dataOffset+ge.index++]=r.pack(ge.min,ge.max),ge.min=Number.POSITIVE_INFINITY,ge.max=Number.NEGATIVE_INFINITY)}ee=Number.POSITIVE_INFINITY,we=Number.NEGATIVE_INFINITY}(++b&65535)===0&&n(b/y)}}return n(1),l.lab(`SamplePeaks '${self.constructor.name}'`),new Pl(h,v,s,a)},t=(n,i)=>{let o=0;return[F.create(a=>{let u=n[a],l=Math.ceil(i/(1<<u)),d=new Or.Stage(u,l,o);return o+=l,d},n.length),o]};r.pack=(n,i)=>{let o=er.floatToIntBits(n),s=er.floatToIntBits(i);return o|s<<16}})(tx||(tx={}));var rx;(function(r){r.renderBlocks=(e,t,n,{u0:i,u1:o,v0:s,v1:a,x0:u,x1:l,y0:d,y1:h})=>{let f=(o-i)/(l-u),v=t.nearest(f);if(v===null)return;let g=(h-d-1)/(a-s),y=v.unitsEachPeak(),b=u-Math.floor(u),R=f/y,M=(i-b*f)/f*R,j=Math.floor(M),L=0,ee=0,we=t.data[n];for(let $e=Math.floor(u);$e<Math.floor(l);$e++){let J=M+R,me=Math.floor(J),H=!1;for(;j<me;){let Le=we[v.dataOffset+j++];L=Math.min(Or.unpack(Le,0),L),ee=Math.max(Or.unpack(Le,1),ee),H=!0}let ne=d+Math.floor((L-s)*g),ge=d+Math.floor((ee-s)*g),je=Math.max(d,Math.min(ne,ge)),ft=Math.min(h,Math.max(ne,ge));if(e.fillRect($e,je,1,ft===je?1:ft-je),H){let Le=ee;ee=L,L=Le}M=J,j=me}}})(rx||(rx={}));var ix;(function(r){r.init=n=>Ge.executor(n.channel("opfs"),new class{#t=new Map;async write(i,o){await this.#e(i,async()=>{let s=await this.#r(i,{create:!0});try{s.truncate(o.length),s.write(o.buffer,{at:0}),s.flush()}finally{s.close()}})}async read(i){return await this.#e(i,async()=>{let o=await this.#r(i);try{let s=o.getSize(),a=new Uint8Array(s);return o.read(a),a}finally{o.close()}})}async delete(i){await this.#e(i,async()=>{let o=t(i);return o.length===0?this.clear():this.#i(o.slice(0,-1)).then(s=>s.removeEntry(q(o.at(-1)),{recursive:!0}))})}async list(i){let o=t(i),{status:s,value:a}=await ur.tryCatch(this.#i(o));if(s==="rejected")return F.empty();let u=[];for await(let{name:l,kind:d}of a.values())u.push({name:l,kind:d});return u}async clear(){let i=await navigator.storage.getDirectory();for await(let[o,s]of i.entries())s.kind==="file"?await i.removeEntry(o):s.kind==="directory"&&await i.removeEntry(o,{recursive:!0})}async#e(i,o){for(;;){let s=this.#t.get(i);if(li(s)){await s;continue}let a=()=>A("Lock not acquired"),u=new Promise(l=>a=l);this.#t.set(i,u);try{return await o()}finally{this.#t.get(i)===u&&this.#t.delete(i),a()}}}async#r(i,o){let s=t(i);return await(await(await this.#i(s.slice(0,-1),o)).getFileHandle(q(s.at(-1)),o)).createSyncAccessHandle()}async#i(i,o){let s=await navigator.storage.getDirectory();for(let a of i)s=await s.getDirectoryHandle(a,o);return s}});let t=n=>{let i=n.replace(/^\/+|\/+$/g,"");return i===""?[]:i.split("/")}})(ix||(ix={}));var kl=Symbol.for("@openDAW/lib-fusion");globalThis[kl]?console.debug(`%c${kl.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[kl]=!0,console.debug(`%c${kl.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var _l=class{#t;#e=new oe;#r=[];constructor(e){this.#t=e}process({blocks:e}){e.forEach(({p0:t,p1:n,bpm:i,s0:o,s1:s,flags:a})=>{if(this.#t.metronomeEnabled&&Ce.every(a,1))for(let u of or.iterate(t,n,re.Quarter)){N(t<=u&&u<n,`${u} out of bounds (${t}, ${n})`);let l=Math.floor(re.pulsesToSamples(u-t,i,sampleRate));this.#r.push(new xm(u,o+l))}this.#e.clear(o,s);for(let u=this.#r.length-1;u>=0;u--)this.#r[u].processAdd(this.#e,o,s)&&this.#r.splice(u,1)})}get output(){return this.#e}},xm=class{#t;#e=0;#r=0;constructor(e,t){N(t>=0&&t<128,`${t} out of bounds`),this.#t=re.toParts(e).beats===0?880:440,this.#r=t}processAdd(e,t,n){let[i,o]=e.channels(),s=Math.floor(.002*sampleRate),a=Math.floor(.05*sampleRate);for(let u=Math.max(this.#r,t);u<n;u++){let l=Math.min(this.#e/s,1-(this.#e-s)/a),d=Math.sin(this.#e/sampleRate*gt*this.#t)*.25*l*l;if(i[u]+=d,o[u]+=d,++this.#e>s+a)return!0}return this.#r=0,!1}};var Fl=class{#t;#e;#r=!0;#i=!1;#n=null;#o=!1;#s=0;constructor(e,t){this.#t=e,this.#t.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#t.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#e=new Ko}setCallback(e,t){return this.#e.add(e,t),Z.create(()=>this.#e.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#s=0,this.#n=null}process(e){let t=!1,{timeInfo:n,timelineBoxAdapter:{box:i,markerTrack:o}}=this.#t,s=i.bpm.getValue(),a=n.transporting;if(a){let u=[],l=n.position,d=0,h=0,f=n.getLeapStateAndReset();for(;d<128;){if(this.#o||f){this.#o=!1;let J=o.events.lowerEqual(l);(this.#n?.at(0)??null)!==J&&(this.#n=O(J)?[J,0]:null,t=!0)}let v=128-d,g=l+re.samplesToPulses(v,s,sampleRate),y=null,b=Number.POSITIVE_INFINITY;if(o.enabled){let J=Array.from(xe.take(o.events.iterateFrom(l),2));if(J.length>0){let[me,H]=J;this.#n===null?me.position>=l&&me.position<g&&(y={type:"marker",prev:me,next:H},b=me.position):O(H)&&H!==this.#n[0]&&me.position<l&&H.position<g&&(y={type:"marker",prev:me,next:H},b=H.position)}}let{isRecording:R,isCountingIn:M}=this.#t.timeInfo,{from:j,to:L,enabled:ee}=i.loopArea;if(ee.getValue()&&!(R||M)||this.#r){let J=L.getValue();l<J&&g>J&&J<b&&(y={type:"loop",target:j.getValue()},b=J)}if(this.#e.keyCount()>0)for(let J of this.#e.keys())l<J&&g>J&&J<b&&(y={type:"callback",position:J,callbacks:this.#e.get(J)},b=J);let $e=!n.isCountingIn;if(y===null){let J=d+v;u.push({index:h++,p0:l,p1:g,s0:d,s1:J,bpm:s,flags:yn.create(a,f,$e,this.#i)}),f=!1,l=g,d=J}else{let J=()=>{if(b>l){let H=d+re.pulsesToSamples(b-l,s,sampleRate)|0;u.push({index:h++,p0:l,p1:b,s0:d,s1:H,bpm:s,flags:yn.create(a,f,$e,this.#i)}),f=!1,l=b,d=H}},me=()=>{if(d<128){let H=d+re.pulsesToSamples(g-l,s,sampleRate)|0;u.push({index:h++,p0:l,p1:b,s0:d,s1:H,bpm:s,flags:yn.create(!1,!1,!1,this.#i)}),d=H}};switch(y.type){case"loop":{J(),this.#r?(this.#t.timeInfo.pause(),me()):(l=y.target,f=!0);break}case"marker":{let{prev:H,next:ne}=y;!O(this.#n)||this.#n[0]!==H?this.#n=[H,0]:++this.#n[1]<H.plays||H.plays===0?(J(),l=H.position,f=!0):this.#n=[ne,0],t=!0;break}case"callback":{J(),y.callbacks.forEach(H=>H());break}}}this.#i=!1}e({blocks:u}),n.advanceTo(l),this.#s=l}else{if(this.#o||n.getLeapStateAndReset()){this.#o=!1;let h=o.events.lowerEqual(n.position);h!==null&&this.#n?.at(0)!==h&&(this.#n=[h,0],t=!0)}let u=this.#s,l=u+re.samplesToPulses(128,s,sampleRate),d={blocks:[{index:0,p0:u,p1:l,s0:0,s1:128,bpm:s,flags:yn.create(!1,!1,!1,!1)}]};e(d),this.#s=l}t&&this.#t.engineToClient.switchMarkerState(O(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var ym=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(n=>this.#e=m.wrap(n))}peaks=m.None;#t={type:"idle"};#e=m.None;get data(){return this.#e}get state(){return this.#t}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},Il=class{#t;#e;constructor(e){this.#t=e,this.#e=S.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#e.getOrCreate(e,t=>new ym(t,this.#t))}remove(e){}invalidate(e){}};var Bl=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},Dl=class{#t;#e;#r=[];#i=[];#n=[];constructor(e){this.#t=e,this.#t.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let n=t.uuid;this.#e.opt(n).ifSome(i=>{i.playing.ifSome(o=>this.#s(o.uuid)),i.playing=m.None,i.waiting=m.None}),this.#e.forEach(i=>{i.playing.nonEmpty()&&S.equals(i.playing.unwrap().uuid,n)&&(i.playing=m.None,this.#s(n));let o=i.waiting.flatMap(Pn);o.nonEmpty()&&S.equals(o.unwrap().uuid,n)&&(i.waiting=m.None)})}}}),this.#e=S.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let n=this.#e.getOrCreate(t,o=>new Bl(o));if(n.playing.nonEmpty()&&n.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let i=n.waiting.flatMap(o=>o);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),n.waiting=m.None),console.debug(`schedulePlay(${S.toString(n.uuid)} > ${e})`),F.removeOpt(this.#n,e.uuid),n.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#e.getOrCreate(e,i=>new Bl(i)),n=t.waiting.flatMap(i=>i);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),t.waiting=m.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${S.toString(e)})`),t.waiting=m.wrap(m.None))}reset(){this.#e.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(n=>this.#n.push(n.uuid))),e.waiting=m.None,e.playing.ifSome(t=>this.#s(t.uuid)),e.playing=m.None}),this.#e.clear()}*iterate(e,t,n){let i=this.#e.getOrNull(e);if(i===null){yield{optClip:m.None,sectionFrom:t,sectionTo:n};return}if(i.waiting.nonEmpty()){let o=i.waiting.unwrap(),s=i.playing.mapOr(u=>u.duration,re.Bar),a=Rt(n,s);a>=t?(t<a&&(yield{optClip:i.playing,sectionFrom:t,sectionTo:a}),i.waiting=m.None,i.playing.ifSome(u=>this.#s(u.uuid)),o.nonEmpty()?(i.playing=o,this.#o(o.unwrap().uuid)):i.playing=m.None,yield{optClip:i.playing,sectionFrom:a,sectionTo:n}):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}else if(i.playing.nonEmpty()){let o=i.playing.unwrap();if(o.box.playback.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:n};else{let s=Rt(t,o.duration)+o.duration;s<=n?(yield{optClip:i.playing,sectionFrom:t,sectionTo:s},i.playing=m.None,this.#s(o.uuid),s<n&&(yield{optClip:m.None,sectionFrom:s,sectionTo:n})):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}}else yield{optClip:m.None,sectionFrom:t,sectionTo:n}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=m.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 m.None}terminate(){this.#e.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#s(e){this.#i.push(e)}};var bm;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(bm||={});var wm=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(n=>this.#e=m.wrap(n))}peaks=m.None;#t={type:"idle"};#e=m.None;get soundfont(){return this.#e}get state(){return this.#t}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},Cl=class{#t;#e;constructor(e){this.#t=e,this.#e=S.newSet(t=>t.uuid)}getOrCreate(e){return this.#e.getOrCreate(e,t=>new wm(t,this.#t))}remove(e){}invalidate(e){}};var aw=!1,Rl=class extends AudioWorkletProcessor{#t;#e;#r;#i;#n;#o;#s;#a;#u;#l;#c;#h;#d;#p;#f;#g;#v;#y;#N;#F;#I;#P;#B;#k;#w;#x=m.None;#S=m.None;#$=m.None;#E=!1;#b=!0;#A=!1;#_=0;#D=0;#C=!0;#R=4;constructor({processorOptions:{sab:e,project:t,exportConfiguration:n,options:i}}){super();let{boxGraph:o,mandatoryBoxes:{rootBox:s,timelineBox:a}}=Na.decode(t);this.#t=new V,this.#e=uf.for(this.port),this.#r=o,this.#i=new ps,this.#n=Ge.sender(this.#e.channel("engine-to-client"),u=>new class{log(l){u.dispatchAndForget(this.log,l)}error(l){u.dispatchAndForget(this.error,l)}fetchAudio(l){return u.dispatchAndReturn(this.fetchAudio,l)}fetchSoundfont(l){return u.dispatchAndReturn(this.fetchSoundfont,l)}notifyClipSequenceChanges(l){u.dispatchAndForget(this.notifyClipSequenceChanges,l)}switchMarkerState(l){u.dispatchAndForget(this.switchMarkerState,l)}ready(){u.dispatchAndForget(this.ready)}}),this.#s=new Il(this.#n),this.#a=new Cl(this.#n),this.#u=S.newSet(u=>u.adapter.uuid),this.#h=new Ea,this.#o=this.#t.own(new va(this)),this.#l=this.#o.adapterFor(s,Li),this.#c=this.#o.adapterFor(a,Pt),this.#d=new Qo,this.#p=new Xo(this.#d),this.#f=new W,this.#g=new El,this.#I=new _l(this.#i),this.#P=new Fl(this,i),this.#w=S.newSet(u=>u),this.#B=fi.writer(Sf(),e,u=>{let{transporting:l,isCountingIn:d,isRecording:h,position:f}=this.#i;u.position=f,u.playbackTimestamp=this.#D,u.countInBeatsTotal=this.#R,u.countInBeatsRemaining=d?(this.#_-f)/re.Quarter:0,u.isPlaying=l,u.isRecording=h,u.isCountingIn=d}),this.#v=this.#t.own(Nl.create(this.#e,"engine-live-data")),this.#N=new zu(this),this.#F=this.#t.own(new le(this.#v,te.compose(S.Lowest))),this.#y=this.#t.own(new Dl(this.#r)),this.#t.ownAll(hf(this.#r,this.#e.channel("engine-sync")),Ge.executor(this.#e.channel("engine-commands"),{play:()=>{this.#C&&(this.#i.position=this.#D),this.#i.transporting=!0},stop:u=>{(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#C?this.#D:0);let l=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#A,this.#w.clear(),(u||!l)&&this.#O()},setPosition:u=>{this.#i.isRecording||(this.#i.position=this.#D=u)},prepareRecordingState:u=>{if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&u){let l=this.#i.position,d=this.#c.box.signature.nominator.getValue(),h=this.#c.box.signature.denominator.getValue();this.#_=Rt(l,re.fromSignature(d,h)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#_-re.fromSignature(this.#R,h);let f=this.#P.setCallback(this.#_,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#A,f.terminate()})}else this.#i.transporting=!0,this.#i.isRecording=!0},stopRecording:()=>{!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#A,this.#i.transporting=!1,this.#w.clear())},setMetronomeEnabled:u=>this.#i.metronomeEnabled=this.#A=u,setPlaybackTimestampEnabled:u=>this.#C=u,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(u=>u.accept({visitAudioFileBox:l=>this.#s.getOrCreate(l.address.uuid).data.nonEmpty()&&l.pointerHub.nonEmpty()})??!0)),panic:()=>this.#E=!0,noteSignal:u=>{if(Nr.isOn(u)){let{uuid:l,pitch:d,velocity:h}=u;this.optAudioUnit(l).ifSome(f=>f.midiDeviceChain.noteSequencer.pushRawNoteOn(d,h))}else if(Nr.isOff(u)){let{uuid:l,pitch:d}=u;this.optAudioUnit(l).ifSome(h=>h.midiDeviceChain.noteSequencer.pushRawNoteOff(d))}},ignoreNoteRegion:u=>this.#w.add(u),scheduleClipPlay:u=>{u.forEach(l=>{let d=this.#r.findBox(l);if(d.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${S.toString(l)}'`);else{let h=oa.for(this.#o,d.unwrap());this.#y.schedulePlay(h)}}),this.#i.transporting=!0},scheduleClipStop:u=>{u.forEach(l=>{let d=this.#r.findBox(l);d.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${S.toString(l)}'`):this.#y.scheduleStop(this.#o.adapterFor(d.unwrap(),ke))})},terminate:()=>{this.#$.ifSome(u=>u.terminate()),this.#$=m.None,this.#b=!1,this.#w.clear(),this.#t.terminate()}}),this.#l.audioUnits.catchupAndSubscribe({onAdd:u=>{let l=S.toString(u.uuid),d=O(n?.[l])?n[l]:bm.Default,h=new $l(this,u,d),f=this.#u.add(h);if(N(f,`Could not add ${h}`),h.adapter.isOutput){N(this.#S.isEmpty(),"Output can only assigned once."),this.#S=m.wrap(h);return}},onRemove:({uuid:u})=>this.#u.removeByKey(u).terminate(),onReorder:Ct})),this.#k=m.wrap(n).match({none:()=>F.empty(),some:u=>Object.keys(u).map(l=>this.#u.get(S.parse(l)))}),this.#n.ready(),console.log=(...u)=>this.#n.log(u.join(", "))}ignoresRegion(e){return this.#w.hasKey(e)}process(e,t){if(!this.#b)return!1;try{return this.render(e,t)}catch(n){return this.#b=!1,this.#n.error(n),this.terminate(),!1}}render(e,[t]){if(!this.#b)return!1;if(this.#E)return A("Manual Panic");let n=this.#i.metronomeEnabled;this.#f.notify(0),this.#x.isEmpty()&&(this.#p.update(),this.#x=m.wrap(this.#p.sorted().concat()),aw&&console.debug(`%cAudio-Graph%c
26
26
  ${this.#x.unwrap().map((o,s)=>`${s+1}: ${o}`).join(`
27
- `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let i=this.#x.unwrap();return this.#E.process(o=>{i.forEach(s=>s.process(o)),n&&this.#_.process(o)}),this.#k.length===0?(this.#S.unwrap().audioOutput().replaceInto(t),n&&this.#_.output.mixInto(t),this.#P.process(t[0],t[1])):this.#k.forEach((o,s)=>{let[a,u]=o.audioOutput().channels();t[s*2].set(a),t[s*2+1].set(u)}),this.#g.notify(1),this.#y.changes().ifSome(o=>this.#n.notifyClipSequenceChanges(o)),this.#D.tryWrite(),this.#v.flush(),!0}getAudioUnit(e){return this.#u.get(e)}optAudioUnit(e){return this.#u.opt(e)}subscribeProcessPhase(e){return this.#g.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#x=m.None,{terminate:()=>{this.#h.removeVertex(e),this.#x=m.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#x=m.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#x=m.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#o}get sampleManager(){return this.#s}get soundfontManager(){return this.#a}get rootBoxAdapter(){return this.#l}get timelineBoxAdapter(){return this.#c}get bpm(){return this.#c.box.bpm.getValue()}get liveStreamBroadcaster(){return this.#v}get liveStreamReceiver(){return w("Only available in main thread")}get parameterFieldAdapters(){return this.#d}get clipSequencing(){return this.#y}get broadcaster(){return this.#v}get updateClock(){return this.#C}get timeInfo(){return this.#i}get mixer(){return this.#f}get engineToClient(){return this.#n}get isMainThread(){return!1}get isAudioContext(){return!0}terminate(){console.debug(`terminate: ${this}`),this.#t.terminate(),this.#u.forEach(e=>e.terminate()),this.#u.clear()}#R(){this.#A=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#w,this.#i.position=0,this.#i.transporting=!1,this.#E.reset(),this.#y.reset(),this.#p.sorted().forEach(e=>e.reset()),this.#P.clear()}};var fl=class extends AudioWorkletProcessor{#t;constructor({processorOptions:e}){super(),this.#t=ha.writer(e)}process(e){return this.#t.write(e[0]),!0}};registerProcessor("meter-processor",Jo);registerProcessor("engine-processor",ml);registerProcessor("recording-processor",fl);
27
+ `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let i=this.#x.unwrap();return this.#P.process(o=>{i.forEach(s=>s.process(o)),n&&this.#I.process(o)}),this.#k.length===0?(this.#S.unwrap().audioOutput().replaceInto(t),n&&this.#I.output.mixInto(t),this.#F.process(t[0],t[1])):this.#k.forEach((o,s)=>{let[a,u]=o.audioOutput().channels();t[s*2].set(a),t[s*2+1].set(u)}),this.#f.notify(1),this.#y.changes().ifSome(o=>this.#n.notifyClipSequenceChanges(o)),this.#B.tryWrite(),this.#v.flush(),!0}getAudioUnit(e){return this.#u.get(e)}optAudioUnit(e){return this.#u.opt(e)}subscribeProcessPhase(e){return this.#f.subscribe(e)}registerProcessor(e){return this.#d.addVertex(e),this.#x=m.None,{terminate:()=>{this.#d.removeVertex(e),this.#x=m.None}}}registerEdge(e,t){return this.#d.addEdge([e,t]),this.#x=m.None,{terminate:()=>{this.#d.removeEdge([e,t]),this.#x=m.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#o}get sampleManager(){return this.#s}get soundfontManager(){return this.#a}get rootBoxAdapter(){return this.#l}get timelineBoxAdapter(){return this.#c}get bpm(){return this.#c.box.bpm.getValue()}get liveStreamBroadcaster(){return this.#v}get liveStreamReceiver(){return A("Only available in main thread")}get parameterFieldAdapters(){return this.#h}get clipSequencing(){return this.#y}get broadcaster(){return this.#v}get updateClock(){return this.#N}get timeInfo(){return this.#i}get mixer(){return this.#g}get engineToClient(){return this.#n}get isMainThread(){return!1}get isAudioContext(){return!0}terminate(){console.debug(`terminate: ${this}`),this.#t.terminate(),this.#u.forEach(e=>e.terminate()),this.#u.clear()}#O(){this.#D=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#A,this.#i.position=0,this.#i.transporting=!1,this.#P.reset(),this.#y.reset(),this.#p.sorted().forEach(e=>e.reset()),this.#F.clear()}};var Ol=class extends AudioWorkletProcessor{#t;constructor({processorOptions:e}){super(),this.#t=Sa.writer(e)}process(e){return this.#t.write(e[0]),!0}};registerProcessor("meter-processor",ss);registerProcessor("engine-processor",Rl);registerProcessor("recording-processor",Ol);
28
28
  //# sourceMappingURL=processors.js.map