From fa9702786bda01697f8f72ae1c850c5fe658b985 Mon Sep 17 00:00:00 2001 From: Bludwarf Date: Mon, 18 Mar 2024 14:31:05 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20-=2060f65?= =?UTF-8?q?91d722d68c365c766699767c9ac94bc9b07=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- "assets/song/entries/(mod\303\250le).ts.j2" | 40 +++ index.html | 2 +- main-QQFPEJ2K.js | 268 ++++++++++++++++++++ 4 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 "assets/song/entries/(mod\303\250le).ts.j2" create mode 100644 main-QQFPEJ2K.js diff --git a/404.html b/404.html index e36d7ea..fee8526 100644 --- a/404.html +++ b/404.html @@ -12,7 +12,7 @@ - + diff --git "a/assets/song/entries/(mod\303\250le).ts.j2" "b/assets/song/entries/(mod\303\250le).ts.j2" new file mode 100644 index 0000000..5dd410b --- /dev/null +++ "b/assets/song/entries/(mod\303\250le).ts.j2" @@ -0,0 +1,40 @@ +import {Key} from "../../notes"; +import stuctureObject from "../../../assets/structures/{{songName}}.json"; +import {Pattern} from "../../structure/pattern/pattern"; +import {Structure} from "../../structure/structure"; + +const key = Key.Gm +const fretboard = { + lowestFret: 0, + fretsCount: 5, +} + +const couplet = Pattern.fromData({ + key, + name: 'Couplet', + chords: '| A | C | G | F |', + fretboard, +}) + +const refrain = Pattern.fromData({ + key, + name: 'Refrain', + chords: '| A | E | F | G |', + fretboard, +}) + +const ligne1 = [couplet, couplet, refrain,] + +const patterns: Pattern[] = [ + ...ligne1, +] + +const structure = Structure.builder() + .stuctureObject(stuctureObject) + .patterns(patterns) + .build() + +export default { + name: '{{songName}}', + structure, +} diff --git a/index.html b/index.html index e36d7ea..fee8526 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ - + diff --git a/main-QQFPEJ2K.js b/main-QQFPEJ2K.js new file mode 100644 index 0000000..caeeb57 --- /dev/null +++ b/main-QQFPEJ2K.js @@ -0,0 +1,268 @@ +var r1=Object.create;var Vh=Object.defineProperty,i1=Object.defineProperties,o1=Object.getOwnPropertyDescriptor,s1=Object.getOwnPropertyDescriptors,a1=Object.getOwnPropertyNames,du=Object.getOwnPropertySymbols,c1=Object.getPrototypeOf,Lh=Object.prototype.hasOwnProperty,Vy=Object.prototype.propertyIsEnumerable;var Py=(t,e,n)=>e in t?Vh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e)=>{for(var n in e||={})Lh.call(e,n)&&Py(t,n,e[n]);if(du)for(var n of du(e))Vy.call(e,n)&&Py(t,n,e[n]);return t},H=(t,e)=>i1(t,s1(e));var u1=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var yi=(t,e)=>{var n={};for(var r in t)Lh.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&du)for(var r of du(t))e.indexOf(r)<0&&Vy.call(t,r)&&(n[r]=t[r]);return n};var ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var l1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a1(e))!Lh.call(t,i)&&i!==n&&Vh(t,i,{get:()=>e[i],enumerable:!(r=o1(e,i))||r.enumerable});return t};var hu=(t,e,n)=>(n=t!=null?r1(c1(t)):{},l1(e||!t||!t.__esModule?Vh(n,"default",{value:t,enumerable:!0}):n,t));var Q=(t,e,n)=>new Promise((r,i)=>{var o=c=>{try{a(n.next(c))}catch(u){i(u)}},s=c=>{try{a(n.throw(c))}catch(u){i(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);a((n=n.apply(t,e)).next())});var Jb=ft((aq,Pc)=>{"use strict";function E2(t){if(Array.isArray(t))return t}Pc.exports=E2,Pc.exports.__esModule=!0,Pc.exports.default=Pc.exports});var ew=ft((cq,Vc)=>{"use strict";function S2(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}Vc.exports=S2,Vc.exports.__esModule=!0,Vc.exports.default=Vc.exports});var tw=ft((uq,Lc)=>{"use strict";function A2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n{"use strict";var nw=tw();function I2(t,e){if(t){if(typeof t=="string")return nw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nw(t,e)}}Bc.exports=I2,Bc.exports.__esModule=!0,Bc.exports.default=Bc.exports});var iw=ft((dq,jc)=>{"use strict";function M2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}jc.exports=M2,jc.exports.__esModule=!0,jc.exports.default=jc.exports});var ow=ft((hq,Uc)=>{"use strict";var N2=Jb(),O2=ew(),F2=rw(),k2=iw();function R2(t,e){return N2(t)||O2(t,e)||F2(t,e)||k2()}Uc.exports=R2,Uc.exports.__esModule=!0,Uc.exports.default=Uc.exports});var sw=ft((fq,qc)=>{"use strict";function P2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}qc.exports=P2,qc.exports.__esModule=!0,qc.exports.default=qc.exports});var bg=ft((pq,ci)=>{"use strict";function xg(t){"@babel/helpers - typeof";return ci.exports=xg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ci.exports.__esModule=!0,ci.exports.default=ci.exports,xg(t)}ci.exports=xg,ci.exports.__esModule=!0,ci.exports.default=ci.exports});var cw=ft((mq,$c)=>{"use strict";var aw=bg().default;function V2(t,e){if(aw(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(aw(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}$c.exports=V2,$c.exports.__esModule=!0,$c.exports.default=$c.exports});var uw=ft((gq,Hc)=>{"use strict";var L2=bg().default,B2=cw();function j2(t){var e=B2(t,"string");return L2(e)=="symbol"?e:String(e)}Hc.exports=j2,Hc.exports.__esModule=!0,Hc.exports.default=Hc.exports});var dw=ft((yq,Gc)=>{"use strict";var U2=uw();function lw(t,e){for(var n=0;n{"use strict";(function(t,e){typeof yd=="object"&&typeof hw<"u"?e(yd,ow(),sw(),dw()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/classCallCheck","@babel/runtime/helpers/createClass"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.automationEvents={},t._slicedToArray,t._classCallCheck,t._createClass))})(yd,function(t,e,n,r){"use strict";var i=function(N,A,F){return{endTime:A,insertTime:F,type:"exponentialRampToValue",value:N}},o=function(N,A,F){return{endTime:A,insertTime:F,type:"linearRampToValue",value:N}},s=function(N,A){return{startTime:A,type:"setValue",value:N}},a=function(N,A,F){return{duration:F,startTime:A,type:"setValueCurve",values:N}},c=function(N,A,F){var G=F.startTime,B=F.target,W=F.timeConstant;return B+(A-B)*Math.exp((G-N)/W)},u=function(N){return N.type==="exponentialRampToValue"},l=function(N){return N.type==="linearRampToValue"},d=function(N){return u(N)||l(N)},h=function(N){return N.type==="setValue"},p=function(N){return N.type==="setValueCurve"},y=function O(N,A,F,G){var B=N[A];return B===void 0?G:d(B)||h(B)?B.value:p(B)?B.values[B.values.length-1]:c(F,O(N,A-1,B.startTime,G),B)},v=function(N,A,F,G,B){return F===void 0?[G.insertTime,B]:d(F)?[F.endTime,F.value]:h(F)?[F.startTime,F.value]:p(F)?[F.startTime+F.duration,F.values[F.values.length-1]]:[F.startTime,y(N,A-1,F.startTime,B)]},_=function(N){return N.type==="cancelAndHold"},x=function(N){return N.type==="cancelScheduledValues"},M=function(N){return _(N)||x(N)?N.cancelTime:u(N)||l(N)?N.endTime:N.startTime},I=function(N,A,F,G){var B=G.endTime,W=G.value;return F===W?W:0=G:M(Z)>=G}),W=this._automationEvents[B];if(B!==-1&&(this._automationEvents=this._automationEvents.slice(0,B)),_(F)){var U=this._automationEvents[this._automationEvents.length-1];if(W!==void 0&&d(W)){if(U!==void 0&&w(U))throw new Error("The internal list is malformed.");var Fe=U===void 0?W.insertTime:p(U)?U.startTime+U.duration:M(U),We=U===void 0?this._defaultValue:p(U)?U.values[U.values.length-1]:U.value,Et=u(W)?I(G,Fe,We,W):L(G,Fe,We,W),Bt=u(W)?i(Et,G,this._currenTime):o(Et,G,this._currenTime);this._automationEvents.push(Bt)}if(U!==void 0&&w(U)&&this._automationEvents.push(s(this.getValue(G),G)),U!==void 0&&p(U)&&U.startTime+U.duration>G){var g=G-U.startTime,f=(U.values.length-1)/U.duration,k=Math.max(2,1+Math.ceil(g*f)),C=g/(k-1)*f,q=U.values.slice(0,k);if(C<1)for(var Ve=1;VeG}),yt=st===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[st-1];if(yt!==void 0&&p(yt)&&M(yt)+yt.duration>G)return!1;var z=u(F)?i(F.value,F.endTime,this._currenTime):l(F)?o(F.value,G,this._currenTime):F;if(st===-1)this._automationEvents.push(z);else{if(p(F)&&G+F.duration>M(this._automationEvents[st]))return!1;this._automationEvents.splice(st,0,z)}}return!0}},{key:"flush",value:function(F){var G=this._automationEvents.findIndex(function(U){return M(U)>F});if(G>1){var B=this._automationEvents.slice(G-1),W=B[0];w(W)&&B.unshift(s(y(this._automationEvents,G-2,W.startTime,this._defaultValue),W.startTime)),this._automationEvents=B}}},{key:"getValue",value:function(F){if(this._automationEvents.length===0)return this._defaultValue;var G=this._automationEvents.findIndex(function(q){return M(q)>F}),B=this._automationEvents[G],W=(G===-1?this._automationEvents.length:G)-1,U=this._automationEvents[W];if(U!==void 0&&w(U)&&(B===void 0||!d(B)||B.insertTime>F))return c(F,y(this._automationEvents,W-1,U.startTime,this._defaultValue),U);if(U!==void 0&&h(U)&&(B===void 0||!d(B)))return U.value;if(U!==void 0&&p(U)&&(B===void 0||!d(B)||U.startTime+U.duration>F))return F{"use strict";yh.byteLength=b6;yh.toByteArray=T6;yh.fromByteArray=E6;var Zr=[],rr=[],x6=typeof Uint8Array<"u"?Uint8Array:Array,vy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(jo=0,kE=vy.length;jo0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function b6(t){var e=RE(t),n=e[0],r=e[1];return(n+r)*3/4-r}function w6(t,e,n){return(e+n)*3/4-n}function T6(t){var e,n=RE(t),r=n[0],i=n[1],o=new x6(w6(t,r,i)),s=0,a=i>0?r-4:r,c;for(c=0;c>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=rr[t.charCodeAt(c)]<<2|rr[t.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=rr[t.charCodeAt(c)]<<10|rr[t.charCodeAt(c+1)]<<4|rr[t.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function C6(t){return Zr[t>>18&63]+Zr[t>>12&63]+Zr[t>>6&63]+Zr[t&63]}function D6(t,e,n){for(var r,i=[],o=e;oa?a:s+o));return r===1?(e=t[n-1],i.push(Zr[e>>2]+Zr[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(Zr[e>>10]+Zr[e>>4&63]+Zr[e<<2&63]+"=")),i.join("")}});var VE=ft(_y=>{"use strict";_y.read=function(t,e,n,r,i){var o,s,a=i*8-r-1,c=(1<>1,l=-7,d=n?i-1:0,h=n?-1:1,p=t[e+d];for(d+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=o*256+t[e+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=s*256+t[e+d],d+=h,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(p?-1:1)*s*Math.pow(2,o-r)};_y.write=function(t,e,n,r,i,o){var s,a,c,u=o*8-i-1,l=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,y=r?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?e+=h/c:e+=h*Math.pow(2,1-d),e*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(e*c-1)*Math.pow(2,i),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=a&255,p+=y,a/=256,i-=8);for(s=s<0;t[n+p]=s&255,p+=y,s/=256,u-=8);t[n+p-y]|=v*128}});var QE=ft(Aa=>{"use strict";var xy=PE(),Sa=VE(),LE=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Aa.Buffer=R;Aa.SlowBuffer=O6;Aa.INSPECT_MAX_BYTES=50;var vh=2147483647;Aa.kMaxLength=vh;R.TYPED_ARRAY_SUPPORT=S6();!R.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function S6(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(R.prototype,"parent",{enumerable:!0,get:function(){if(R.isBuffer(this))return this.buffer}});Object.defineProperty(R.prototype,"offset",{enumerable:!0,get:function(){if(R.isBuffer(this))return this.byteOffset}});function pi(t){if(t>vh)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,R.prototype),e}function R(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Cy(t)}return UE(t,e,n)}R.poolSize=8192;function UE(t,e,n){if(typeof t=="string")return I6(t,e);if(ArrayBuffer.isView(t))return M6(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Qr(t,ArrayBuffer)||t&&Qr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qr(t,SharedArrayBuffer)||t&&Qr(t.buffer,SharedArrayBuffer)))return wy(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return R.from(r,e,n);var i=N6(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return R.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}R.from=function(t,e,n){return UE(t,e,n)};Object.setPrototypeOf(R.prototype,Uint8Array.prototype);Object.setPrototypeOf(R,Uint8Array);function qE(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function A6(t,e,n){return qE(t),t<=0?pi(t):e!==void 0?typeof n=="string"?pi(t).fill(e,n):pi(t).fill(e):pi(t)}R.alloc=function(t,e,n){return A6(t,e,n)};function Cy(t){return qE(t),pi(t<0?0:Dy(t)|0)}R.allocUnsafe=function(t){return Cy(t)};R.allocUnsafeSlow=function(t){return Cy(t)};function I6(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!R.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=$E(t,e)|0,r=pi(n),i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function by(t){for(var e=t.length<0?0:Dy(t.length)|0,n=pi(e),r=0;r=vh)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+vh.toString(16)+" bytes");return t|0}function O6(t){return+t!=t&&(t=0),R.alloc(+t)}R.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==R.prototype};R.compare=function(e,n){if(Qr(e,Uint8Array)&&(e=R.from(e,e.offset,e.byteLength)),Qr(n,Uint8Array)&&(n=R.from(n,n.offset,n.byteLength)),!R.isBuffer(e)||!R.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var r=e.length,i=n.length,o=0,s=Math.min(r,i);oi.length?R.from(s).copy(i,o):Uint8Array.prototype.set.call(i,s,o);else if(R.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function $E(t,e){if(R.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Qr(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Ty(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return ZE(t).length;default:if(i)return r?-1:Ty(t).length;e=(""+e).toLowerCase(),i=!0}}R.byteLength=$E;function F6(t,e,n){var r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return $6(this,e,n);case"utf8":case"utf-8":return GE(this,e,n);case"ascii":return U6(this,e,n);case"latin1":case"binary":return q6(this,e,n);case"base64":return B6(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H6(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}R.prototype._isBuffer=!0;function Uo(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}R.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;nn&&(e+=" ... "),""};LE&&(R.prototype[LE]=R.prototype.inspect);R.prototype.compare=function(e,n,r,i,o){if(Qr(e,Uint8Array)&&(e=R.from(e,e.offset,e.byteLength)),!R.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(n===void 0&&(n=0),r===void 0&&(r=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=r-n,c=Math.min(s,a),u=this.slice(i,o),l=e.slice(n,r),d=0;d2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Ey(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof e=="string"&&(e=R.from(e,r)),R.isBuffer(e))return e.length===0?-1:BE(t,e,n,r,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):BE(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function BE(t,e,n,r,i){var o=1,s=t.length,a=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,n/=2}function c(p,y){return o===1?p[y]:p.readUInt16BE(y*o)}var u;if(i){var l=-1;for(u=n;us&&(n=s-a),u=n;u>=0;u--){for(var d=!0,h=0;hi&&(r=i)):r=i;var o=e.length;r>o/2&&(r=o/2);for(var s=0;s>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return k6(this,e,n,r);case"utf8":case"utf-8":return R6(this,e,n,r);case"ascii":case"latin1":case"binary":return P6(this,e,n,r);case"base64":return V6(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L6(this,e,n,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};R.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B6(t,e,n){return e===0&&n===t.length?xy.fromByteArray(t):xy.fromByteArray(t.slice(e,n))}function GE(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:o>223?3:o>191?2:1;if(i+a<=n){var c,u,l,d;switch(a){case 1:o<128&&(s=o);break;case 2:c=t[i+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(s=d));break;case 3:c=t[i+1],u=t[i+2],(c&192)===128&&(u&192)===128&&(d=(o&15)<<12|(c&63)<<6|u&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:c=t[i+1],u=t[i+2],l=t[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(d=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,d>65535&&d<1114112&&(s=d))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=a}return j6(r)}var jE=4096;function j6(t){var e=t.length;if(e<=jE)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;or&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),nn)throw new RangeError("Trying to access beyond buffer length")}R.prototype.readUintLE=R.prototype.readUIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||Wt(e,n,this.length);for(var i=this[e],o=1,s=0;++s>>0,n=n>>>0,r||Wt(e,n,this.length);for(var i=this[e+--n],o=1;n>0&&(o*=256);)i+=this[e+--n]*o;return i};R.prototype.readUint8=R.prototype.readUInt8=function(e,n){return e=e>>>0,n||Wt(e,1,this.length),this[e]};R.prototype.readUint16LE=R.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||Wt(e,2,this.length),this[e]|this[e+1]<<8};R.prototype.readUint16BE=R.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||Wt(e,2,this.length),this[e]<<8|this[e+1]};R.prototype.readUint32LE=R.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};R.prototype.readUint32BE=R.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};R.prototype.readIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||Wt(e,n,this.length);for(var i=this[e],o=1,s=0;++s=o&&(i-=Math.pow(2,8*n)),i};R.prototype.readIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||Wt(e,n,this.length);for(var i=n,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*n)),s};R.prototype.readInt8=function(e,n){return e=e>>>0,n||Wt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};R.prototype.readInt16LE=function(e,n){e=e>>>0,n||Wt(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};R.prototype.readInt16BE=function(e,n){e=e>>>0,n||Wt(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};R.prototype.readInt32LE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};R.prototype.readInt32BE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};R.prototype.readFloatLE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),Sa.read(this,e,!0,23,4)};R.prototype.readFloatBE=function(e,n){return e=e>>>0,n||Wt(e,4,this.length),Sa.read(this,e,!1,23,4)};R.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||Wt(e,8,this.length),Sa.read(this,e,!0,52,8)};R.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||Wt(e,8,this.length),Sa.read(this,e,!1,52,8)};function Nn(t,e,n,r,i,o){if(!R.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}R.prototype.writeUintLE=R.prototype.writeUIntLE=function(e,n,r,i){if(e=+e,n=n>>>0,r=r>>>0,!i){var o=Math.pow(2,8*r)-1;Nn(this,e,n,r,o,0)}var s=1,a=0;for(this[n]=e&255;++a>>0,r=r>>>0,!i){var o=Math.pow(2,8*r)-1;Nn(this,e,n,r,o,0)}var s=r-1,a=1;for(this[n+s]=e&255;--s>=0&&(a*=256);)this[n+s]=e/a&255;return n+r};R.prototype.writeUint8=R.prototype.writeUInt8=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,1,255,0),this[n]=e&255,n+1};R.prototype.writeUint16LE=R.prototype.writeUInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2};R.prototype.writeUint16BE=R.prototype.writeUInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2};R.prototype.writeUint32LE=R.prototype.writeUInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4};R.prototype.writeUint32BE=R.prototype.writeUInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};R.prototype.writeIntLE=function(e,n,r,i){if(e=+e,n=n>>>0,!i){var o=Math.pow(2,8*r-1);Nn(this,e,n,r,o-1,-o)}var s=0,a=1,c=0;for(this[n]=e&255;++s>0)-c&255;return n+r};R.prototype.writeIntBE=function(e,n,r,i){if(e=+e,n=n>>>0,!i){var o=Math.pow(2,8*r-1);Nn(this,e,n,r,o-1,-o)}var s=r-1,a=1,c=0;for(this[n+s]=e&255;--s>=0&&(a*=256);)e<0&&c===0&&this[n+s+1]!==0&&(c=1),this[n+s]=(e/a>>0)-c&255;return n+r};R.prototype.writeInt8=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1};R.prototype.writeInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2};R.prototype.writeInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2};R.prototype.writeInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4};R.prototype.writeInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||Nn(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function WE(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function zE(t,e,n,r,i){return e=+e,n=n>>>0,i||WE(t,e,n,4,34028234663852886e22,-34028234663852886e22),Sa.write(t,e,n,r,23,4),n+4}R.prototype.writeFloatLE=function(e,n,r){return zE(this,e,n,!0,r)};R.prototype.writeFloatBE=function(e,n,r){return zE(this,e,n,!1,r)};function YE(t,e,n,r,i){return e=+e,n=n>>>0,i||WE(t,e,n,8,17976931348623157e292,-17976931348623157e292),Sa.write(t,e,n,r,52,8),n+8}R.prototype.writeDoubleLE=function(e,n,r){return YE(this,e,n,!0,r)};R.prototype.writeDoubleBE=function(e,n,r){return YE(this,e,n,!1,r)};R.prototype.copy=function(e,n,r,i){if(!R.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n>>0,r=r===void 0?this.length:r>>>0,e||(e=0);var s;if(typeof e=="number")for(s=n;s55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function z6(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function ZE(t){return xy.toByteArray(W6(t))}function _h(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Qr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ey(t){return t!==t}var Z6=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=n*16,i=0;i<16;++i)e[r+i]=t[n]+t[i];return e}()});var JE=ft(XE=>{"use strict";var KE=QE().Buffer,Q6=KE.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K6(t){if(t&&!Q6(t))throw new Error("Unknown encoding: "+t)}var Sy=XE.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),K6(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=J6;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=eV;break;default:this.write=X6;return}this.charBuffer=new KE(6),this.charReceived=0,this.charLength=0};Sy.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize,e="";continue}if(this.charReceived=this.charLength=0,t.length===0)return e;break}this.detectIncompleteChar(t);var r=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,r),r-=this.charReceived),e+=t.toString(this.encoding,0,r);var r=e.length-1,i=e.charCodeAt(r);if(i>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,r)}return e};Sy.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(e==1&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e};Sy.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e};function X6(t){return t.toString(this.encoding)}function J6(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function eV(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}});var eS=ft(xh=>{"use strict";(function(t){t.parser=function(g,f){return new n(g,f)},t.SAXParser=n,t.SAXStream=u,t.createStream=c,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(g,f){if(!(this instanceof n))return new n(g,f);var k=this;i(k),k.q=k.c="",k.bufferCheckPosition=t.MAX_BUFFER_LENGTH,k.opt=f||{},k.opt.lowercase=k.opt.lowercase||k.opt.lowercasetags,k.looseCase=k.opt.lowercase?"toLowerCase":"toUpperCase",k.tags=[],k.closed=k.closedRoot=k.sawRoot=!1,k.tag=k.error=null,k.strict=!!g,k.noscript=!!(g||k.opt.noscript),k.state=m.BEGIN,k.strictEntities=k.opt.strictEntities,k.ENTITIES=k.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),k.attribList=[],k.opt.xmlns&&(k.ns=Object.create(y)),k.trackPosition=k.opt.position!==!1,k.trackPosition&&(k.position=k.line=k.column=0),K(k,"onready")}Object.create||(Object.create=function(g){function f(){}f.prototype=g;var k=new f;return k}),Object.keys||(Object.keys=function(g){var f=[];for(var k in g)g.hasOwnProperty(k)&&f.push(k);return f});function r(g){for(var f=Math.max(t.MAX_BUFFER_LENGTH,10),k=0,C=0,q=e.length;Cf)switch(e[C]){case"textNode":V(g);break;case"cdata":P(g,"oncdata",g.cdata),g.cdata="";break;case"script":P(g,"onscript",g.script),g.script="";break;default:O(g,"Max buffer length exceeded: "+e[C])}k=Math.max(k,Ve)}var Ke=t.MAX_BUFFER_LENGTH-k;g.bufferCheckPosition=Ke+g.position}function i(g){for(var f=0,k=e.length;f"||I(g)}function D(g,f){return g.test(f)}function w(g,f){return!D(g,f)}var m=0;t.STATE={BEGIN:m++,BEGIN_WHITESPACE:m++,TEXT:m++,TEXT_ENTITY:m++,OPEN_WAKA:m++,SGML_DECL:m++,SGML_DECL_QUOTED:m++,DOCTYPE:m++,DOCTYPE_QUOTED:m++,DOCTYPE_DTD:m++,DOCTYPE_DTD_QUOTED:m++,COMMENT_STARTING:m++,COMMENT:m++,COMMENT_ENDING:m++,COMMENT_ENDED:m++,CDATA:m++,CDATA_ENDING:m++,CDATA_ENDING_2:m++,PROC_INST:m++,PROC_INST_BODY:m++,PROC_INST_ENDING:m++,OPEN_TAG:m++,OPEN_TAG_SLASH:m++,ATTRIB:m++,ATTRIB_NAME:m++,ATTRIB_NAME_SAW_WHITE:m++,ATTRIB_VALUE:m++,ATTRIB_VALUE_QUOTED:m++,ATTRIB_VALUE_CLOSED:m++,ATTRIB_VALUE_UNQUOTED:m++,ATTRIB_VALUE_ENTITY_Q:m++,ATTRIB_VALUE_ENTITY_U:m++,CLOSE_TAG:m++,CLOSE_TAG_SAW_WHITE:m++,SCRIPT:m++,SCRIPT_ENDING:m++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(g){var f=t.ENTITIES[g],k=typeof f=="number"?String.fromCharCode(f):f;t.ENTITIES[g]=k});for(var j in t.STATE)t.STATE[t.STATE[j]]=j;m=t.STATE;function K(g,f,k){g[f]&&g[f](k)}function P(g,f,k){g.textNode&&V(g),K(g,f,k)}function V(g){g.textNode=X(g.opt,g.textNode),g.textNode&&K(g,"ontext",g.textNode),g.textNode=""}function X(g,f){return g.trim&&(f=f.trim()),g.normalize&&(f=f.replace(/\s+/g," ")),f}function O(g,f){return V(g),g.trackPosition&&(f+=` +Line: `+g.line+` +Column: `+g.column+` +Char: `+g.c),f=new Error(f),g.error=f,K(g,"onerror",f),g}function N(g){return g.sawRoot&&!g.closedRoot&&A(g,"Unclosed root tag"),g.state!==m.BEGIN&&g.state!==m.BEGIN_WHITESPACE&&g.state!==m.TEXT&&O(g,"Unexpected end"),V(g),g.c="",g.closed=!0,K(g,"onend"),n.call(g,g.strict,g.opt),g}function A(g,f){if(typeof g!="object"||!(g instanceof n))throw new Error("bad call to strictFail");g.strict&&O(g,f)}function F(g){g.strict||(g.tagName=g.tagName[g.looseCase]());var f=g.tags[g.tags.length-1]||g,k=g.tag={name:g.tagName,attributes:{}};g.opt.xmlns&&(k.ns=f.ns),g.attribList.length=0,P(g,"onopentagstart",k)}function G(g,f){var k=g.indexOf(":"),C=k<0?["",g]:g.split(":"),q=C[0],Ve=C[1];return f&&g==="xmlns"&&(q="xmlns",Ve=""),{prefix:q,local:Ve}}function B(g){if(g.strict||(g.attribName=g.attribName[g.looseCase]()),g.attribList.indexOf(g.attribName)!==-1||g.tag.attributes.hasOwnProperty(g.attribName)){g.attribName=g.attribValue="";return}if(g.opt.xmlns){var f=G(g.attribName,!0),k=f.prefix,C=f.local;if(k==="xmlns")if(C==="xml"&&g.attribValue!==h)A(g,"xml: prefix must be bound to "+h+` +Actual: `+g.attribValue);else if(C==="xmlns"&&g.attribValue!==p)A(g,"xmlns: prefix must be bound to "+p+` +Actual: `+g.attribValue);else{var q=g.tag,Ve=g.tags[g.tags.length-1]||g;q.ns===Ve.ns&&(q.ns=Object.create(Ve.ns)),q.ns[C]=g.attribValue}g.attribList.push([g.attribName,g.attribValue])}else g.tag.attributes[g.attribName]=g.attribValue,P(g,"onattribute",{name:g.attribName,value:g.attribValue});g.attribName=g.attribValue=""}function W(g,f){if(g.opt.xmlns){var k=g.tag,C=G(g.tagName);k.prefix=C.prefix,k.local=C.local,k.uri=k.ns[C.prefix]||"",k.prefix&&!k.uri&&(A(g,"Unbound namespace prefix: "+JSON.stringify(g.tagName)),k.uri=C.prefix);var q=g.tags[g.tags.length-1]||g;k.ns&&q.ns!==k.ns&&Object.keys(k.ns).forEach(function(cn){P(g,"onopennamespace",{prefix:cn,uri:k.ns[cn]})});for(var Ve=0,Ke=g.attribList.length;Ve",g.tagName="",g.state=m.SCRIPT;return}P(g,"onscript",g.script),g.script=""}var f=g.tags.length,k=g.tagName;g.strict||(k=k[g.looseCase]());for(var C=k;f--;){var q=g.tags[f];if(q.name!==C)A(g,"Unexpected close tag");else break}if(f<0){A(g,"Unmatched closing tag: "+g.tagName),g.textNode+="",g.state=m.TEXT;return}g.tagName=k;for(var Ve=g.tags.length;Ve-- >f;){var Ke=g.tag=g.tags.pop();g.tagName=g.tag.name,P(g,"onclosetag",g.tagName);var st={};for(var yt in Ke.ns)st[yt]=Ke.ns[yt];var z=g.tags[g.tags.length-1]||g;g.opt.xmlns&&Ke.ns!==z.ns&&Object.keys(Ke.ns).forEach(function(Z){var Xe=Ke.ns[Z];P(g,"onclosenamespace",{prefix:Z,uri:Xe})})}f===0&&(g.closedRoot=!0),g.tagName=g.attribValue=g.attribName="",g.attribList.length=0,g.state=m.TEXT}function Fe(g){var f=g.entity,k=f.toLowerCase(),C,q="";return g.ENTITIES[f]?g.ENTITIES[f]:g.ENTITIES[k]?g.ENTITIES[k]:(f=k,f.charAt(0)==="#"&&(f.charAt(1)==="x"?(f=f.slice(2),C=parseInt(f,16),q=C.toString(16)):(f=f.slice(1),C=parseInt(f,10),q=C.toString(10))),f=f.replace(/^0+/,""),isNaN(C)||q.toLowerCase()!==f?(A(g,"Invalid character entity"),"&"+g.entity+";"):String.fromCodePoint(C))}function We(g,f){f==="<"?(g.state=m.OPEN_WAKA,g.startTagPosition=g.position):I(f)||(A(g,"Non-whitespace before first tag."),g.textNode=f,g.state=m.TEXT)}function Et(g,f){var k="";return f"?(P(f,"onsgmldeclaration",f.sgmlDecl),f.sgmlDecl="",f.state=m.TEXT):(L(C)&&(f.state=m.SGML_DECL_QUOTED),f.sgmlDecl+=C);continue;case m.SGML_DECL_QUOTED:C===f.q&&(f.state=m.SGML_DECL,f.q=""),f.sgmlDecl+=C;continue;case m.DOCTYPE:C===">"?(f.state=m.TEXT,P(f,"ondoctype",f.doctype),f.doctype=!0):(f.doctype+=C,C==="["?f.state=m.DOCTYPE_DTD:L(C)&&(f.state=m.DOCTYPE_QUOTED,f.q=C));continue;case m.DOCTYPE_QUOTED:f.doctype+=C,C===f.q&&(f.q="",f.state=m.DOCTYPE);continue;case m.DOCTYPE_DTD:f.doctype+=C,C==="]"?f.state=m.DOCTYPE:L(C)&&(f.state=m.DOCTYPE_DTD_QUOTED,f.q=C);continue;case m.DOCTYPE_DTD_QUOTED:f.doctype+=C,C===f.q&&(f.state=m.DOCTYPE_DTD,f.q="");continue;case m.COMMENT:C==="-"?f.state=m.COMMENT_ENDING:f.comment+=C;continue;case m.COMMENT_ENDING:C==="-"?(f.state=m.COMMENT_ENDED,f.comment=X(f.opt,f.comment),f.comment&&P(f,"oncomment",f.comment),f.comment=""):(f.comment+="-"+C,f.state=m.COMMENT);continue;case m.COMMENT_ENDED:C!==">"?(A(f,"Malformed comment"),f.comment+="--"+C,f.state=m.COMMENT):f.state=m.TEXT;continue;case m.CDATA:C==="]"?f.state=m.CDATA_ENDING:f.cdata+=C;continue;case m.CDATA_ENDING:C==="]"?f.state=m.CDATA_ENDING_2:(f.cdata+="]"+C,f.state=m.CDATA);continue;case m.CDATA_ENDING_2:C===">"?(f.cdata&&P(f,"oncdata",f.cdata),P(f,"onclosecdata"),f.cdata="",f.state=m.TEXT):C==="]"?f.cdata+="]":(f.cdata+="]]"+C,f.state=m.CDATA);continue;case m.PROC_INST:C==="?"?f.state=m.PROC_INST_ENDING:I(C)?f.state=m.PROC_INST_BODY:f.procInstName+=C;continue;case m.PROC_INST_BODY:if(!f.procInstBody&&I(C))continue;C==="?"?f.state=m.PROC_INST_ENDING:f.procInstBody+=C;continue;case m.PROC_INST_ENDING:C===">"?(P(f,"onprocessinginstruction",{name:f.procInstName,body:f.procInstBody}),f.procInstName=f.procInstBody="",f.state=m.TEXT):(f.procInstBody+="?"+C,f.state=m.PROC_INST_BODY);continue;case m.OPEN_TAG:D(_,C)?f.tagName+=C:(F(f),C===">"?W(f):C==="/"?f.state=m.OPEN_TAG_SLASH:(I(C)||A(f,"Invalid character in tag name"),f.state=m.ATTRIB));continue;case m.OPEN_TAG_SLASH:C===">"?(W(f,!0),U(f)):(A(f,"Forward-slash in opening tag not followed by >"),f.state=m.ATTRIB);continue;case m.ATTRIB:if(I(C))continue;C===">"?W(f):C==="/"?f.state=m.OPEN_TAG_SLASH:D(v,C)?(f.attribName=C,f.attribValue="",f.state=m.ATTRIB_NAME):A(f,"Invalid attribute name");continue;case m.ATTRIB_NAME:C==="="?f.state=m.ATTRIB_VALUE:C===">"?(A(f,"Attribute without value"),f.attribValue=f.attribName,B(f),W(f)):I(C)?f.state=m.ATTRIB_NAME_SAW_WHITE:D(_,C)?f.attribName+=C:A(f,"Invalid attribute name");continue;case m.ATTRIB_NAME_SAW_WHITE:if(C==="=")f.state=m.ATTRIB_VALUE;else{if(I(C))continue;A(f,"Attribute without value"),f.tag.attributes[f.attribName]="",f.attribValue="",P(f,"onattribute",{name:f.attribName,value:""}),f.attribName="",C===">"?W(f):D(v,C)?(f.attribName=C,f.state=m.ATTRIB_NAME):(A(f,"Invalid attribute name"),f.state=m.ATTRIB)}continue;case m.ATTRIB_VALUE:if(I(C))continue;L(C)?(f.q=C,f.state=m.ATTRIB_VALUE_QUOTED):(A(f,"Unquoted attribute value"),f.state=m.ATTRIB_VALUE_UNQUOTED,f.attribValue=C);continue;case m.ATTRIB_VALUE_QUOTED:if(C!==f.q){C==="&"?f.state=m.ATTRIB_VALUE_ENTITY_Q:f.attribValue+=C;continue}B(f),f.q="",f.state=m.ATTRIB_VALUE_CLOSED;continue;case m.ATTRIB_VALUE_CLOSED:I(C)?f.state=m.ATTRIB:C===">"?W(f):C==="/"?f.state=m.OPEN_TAG_SLASH:D(v,C)?(A(f,"No whitespace between attributes"),f.attribName=C,f.attribValue="",f.state=m.ATTRIB_NAME):A(f,"Invalid attribute name");continue;case m.ATTRIB_VALUE_UNQUOTED:if(!S(C)){C==="&"?f.state=m.ATTRIB_VALUE_ENTITY_U:f.attribValue+=C;continue}B(f),C===">"?W(f):f.state=m.ATTRIB;continue;case m.CLOSE_TAG:if(f.tagName)C===">"?U(f):D(_,C)?f.tagName+=C:f.script?(f.script+=""?U(f):A(f,"Invalid characters in closing tag");continue;case m.TEXT_ENTITY:case m.ATTRIB_VALUE_ENTITY_Q:case m.ATTRIB_VALUE_ENTITY_U:var Ke,st;switch(f.state){case m.TEXT_ENTITY:Ke=m.TEXT,st="textNode";break;case m.ATTRIB_VALUE_ENTITY_Q:Ke=m.ATTRIB_VALUE_QUOTED,st="attribValue";break;case m.ATTRIB_VALUE_ENTITY_U:Ke=m.ATTRIB_VALUE_UNQUOTED,st="attribValue";break}if(C===";")if(f.opt.unparsedEntities){var yt=Fe(f);f.entity="",f.state=Ke,f.write(yt)}else f[st]+=Fe(f),f.entity="",f.state=Ke;else D(f.entity.length?M:x,C)?f.entity+=C:(A(f,"Invalid character in entity name"),f[st]+="&"+f.entity+C,f.entity="",f.state=Ke);continue;default:throw new Error(f,"Unknown state: "+f.state)}return f.position>=f.bufferCheckPosition&&r(f),f}String.fromCodePoint||function(){var g=String.fromCharCode,f=Math.floor,k=function(){var C=16384,q=[],Ve,Ke,st=-1,yt=arguments.length;if(!yt)return"";for(var z="";++st1114111||f(Z)!==Z)throw RangeError("Invalid code point: "+Z);Z<=65535?q.push(Z):(Z-=65536,Ve=(Z>>10)+55296,Ke=Z%1024+56320,q.push(Ve,Ke)),(st+1===yt||q.length>C)&&(z+=g.apply(null,q),q.length=0)}return z};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:k,configurable:!0,writable:!0}):String.fromCodePoint=k}()})(typeof xh>"u"?xh.sax={}:xh)});var bh=ft((RNe,tS)=>{"use strict";tS.exports={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}}});var wh=ft((PNe,nS)=>{"use strict";var tV=bh().isArray;nS.exports={copyOptions:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},ensureFlagExists:function(t,e){(!(t in e)||typeof e[t]!="boolean")&&(e[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!tV(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,e){(!(t+"Key"in e)||typeof e[t+"Key"]!="string")&&(e[t+"Key"]=e.compact?"_"+t:t)},checkFnExists:function(t,e){return t+"Fn"in e}}});var Iy=ft((VNe,lS)=>{"use strict";var nV=eS(),rV={on:function(){},parse:function(){}},xe=wh(),Ia=bh().isArray,E,Ay=!0,ge;function iV(t){return E=xe.copyOptions(t),xe.ensureFlagExists("ignoreDeclaration",E),xe.ensureFlagExists("ignoreInstruction",E),xe.ensureFlagExists("ignoreAttributes",E),xe.ensureFlagExists("ignoreText",E),xe.ensureFlagExists("ignoreComment",E),xe.ensureFlagExists("ignoreCdata",E),xe.ensureFlagExists("ignoreDoctype",E),xe.ensureFlagExists("compact",E),xe.ensureFlagExists("alwaysChildren",E),xe.ensureFlagExists("addParent",E),xe.ensureFlagExists("trim",E),xe.ensureFlagExists("nativeType",E),xe.ensureFlagExists("nativeTypeAttributes",E),xe.ensureFlagExists("sanitize",E),xe.ensureFlagExists("instructionHasAttributes",E),xe.ensureFlagExists("captureSpacesBetweenElements",E),xe.ensureAlwaysArrayExists(E),xe.ensureKeyExists("declaration",E),xe.ensureKeyExists("instruction",E),xe.ensureKeyExists("attributes",E),xe.ensureKeyExists("text",E),xe.ensureKeyExists("comment",E),xe.ensureKeyExists("cdata",E),xe.ensureKeyExists("doctype",E),xe.ensureKeyExists("type",E),xe.ensureKeyExists("name",E),xe.ensureKeyExists("elements",E),xe.ensureKeyExists("parent",E),xe.checkFnExists("doctype",E),xe.checkFnExists("instruction",E),xe.checkFnExists("cdata",E),xe.checkFnExists("comment",E),xe.checkFnExists("text",E),xe.checkFnExists("instructionName",E),xe.checkFnExists("elementName",E),xe.checkFnExists("attributeName",E),xe.checkFnExists("attributeValue",E),xe.checkFnExists("attributes",E),E}function cS(t){var e=Number(t);if(!isNaN(e))return e;var n=t.toLowerCase();return n==="true"?!0:n==="false"?!1:t}function uu(t,e){var n;if(E.compact){if(!ge[E[t+"Key"]]&&(Ia(E.alwaysArray)?E.alwaysArray.indexOf(E[t+"Key"])!==-1:E.alwaysArray)&&(ge[E[t+"Key"]]=[]),ge[E[t+"Key"]]&&!Ia(ge[E[t+"Key"]])&&(ge[E[t+"Key"]]=[ge[E[t+"Key"]]]),t+"Fn"in E&&typeof e=="string"&&(e=E[t+"Fn"](e,ge)),t==="instruction"&&("instructionFn"in E||"instructionNameFn"in E)){for(n in e)if(e.hasOwnProperty(n))if("instructionFn"in E)e[n]=E.instructionFn(e[n],n,ge);else{var r=e[n];delete e[n],e[E.instructionNameFn(n,r,ge)]=r}}Ia(ge[E[t+"Key"]])?ge[E[t+"Key"]].push(e):ge[E[t+"Key"]]=e}else{ge[E.elementsKey]||(ge[E.elementsKey]=[]);var i={};if(i[E.typeKey]=t,t==="instruction"){for(n in e)if(e.hasOwnProperty(n))break;i[E.nameKey]="instructionNameFn"in E?E.instructionNameFn(n,e,ge):n,E.instructionHasAttributes?(i[E.attributesKey]=e[n][E.attributesKey],"instructionFn"in E&&(i[E.attributesKey]=E.instructionFn(i[E.attributesKey],n,ge))):("instructionFn"in E&&(e[n]=E.instructionFn(e[n],n,ge)),i[E.instructionKey]=e[n])}else t+"Fn"in E&&(e=E[t+"Fn"](e,ge)),i[E[t+"Key"]]=e;E.addParent&&(i[E.parentKey]=ge),ge[E.elementsKey].push(i)}}function uS(t){if("attributesFn"in E&&t&&(t=E.attributesFn(t,ge)),(E.trim||"attributeValueFn"in E||"attributeNameFn"in E||E.nativeTypeAttributes)&&t){var e;for(e in t)if(t.hasOwnProperty(e)&&(E.trim&&(t[e]=t[e].trim()),E.nativeTypeAttributes&&(t[e]=cS(t[e])),"attributeValueFn"in E&&(t[e]=E.attributeValueFn(t[e],e,ge)),"attributeNameFn"in E)){var n=t[e];delete t[e],t[E.attributeNameFn(e,t[e],ge)]=n}}return t}function oV(t){var e={};if(t.body&&(t.name.toLowerCase()==="xml"||E.instructionHasAttributes)){for(var n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,r;(r=n.exec(t.body))!==null;)e[r[1]]=r[2]||r[3]||r[4];e=uS(e)}if(t.name.toLowerCase()==="xml"){if(E.ignoreDeclaration)return;ge[E.declarationKey]={},Object.keys(e).length&&(ge[E.declarationKey][E.attributesKey]=e),E.addParent&&(ge[E.declarationKey][E.parentKey]=ge)}else{if(E.ignoreInstruction)return;E.trim&&(t.body=t.body.trim());var i={};E.instructionHasAttributes&&Object.keys(e).length?(i[t.name]={},i[t.name][E.attributesKey]=e):i[t.name]=t.body,uu("instruction",i)}}function rS(t,e){var n;if(typeof t=="object"&&(e=t.attributes,t=t.name),e=uS(e),"elementNameFn"in E&&(t=E.elementNameFn(t,ge)),E.compact){if(n={},!E.ignoreAttributes&&e&&Object.keys(e).length){n[E.attributesKey]={};var r;for(r in e)e.hasOwnProperty(r)&&(n[E.attributesKey][r]=e[r])}!(t in ge)&&(Ia(E.alwaysArray)?E.alwaysArray.indexOf(t)!==-1:E.alwaysArray)&&(ge[t]=[]),ge[t]&&!Ia(ge[t])&&(ge[t]=[ge[t]]),Ia(ge[t])?ge[t].push(n):ge[t]=n}else ge[E.elementsKey]||(ge[E.elementsKey]=[]),n={},n[E.typeKey]="element",n[E.nameKey]=t,!E.ignoreAttributes&&e&&Object.keys(e).length&&(n[E.attributesKey]=e),E.alwaysChildren&&(n[E.elementsKey]=[]),ge[E.elementsKey].push(n);n[E.parentKey]=ge,ge=n}function iS(t){E.ignoreText||!t.trim()&&!E.captureSpacesBetweenElements||(E.trim&&(t=t.trim()),E.nativeType&&(t=cS(t)),E.sanitize&&(t=t.replace(/&/g,"&").replace(//g,">")),uu("text",t))}function oS(t){E.ignoreComment||(E.trim&&(t=t.trim()),uu("comment",t))}function sS(t){var e=ge[E.parentKey];E.addParent||delete ge[E.parentKey],ge=e}function sV(t){E.ignoreCdata||(E.trim&&(t=t.trim()),uu("cdata",t))}function aV(t){E.ignoreDoctype||(t=t.replace(/^ /,""),E.trim&&(t=t.trim()),uu("doctype",t))}function aS(t){t.note=t}lS.exports=function(t,e){var n=Ay?nV.parser(!0,{}):n=new rV.Parser("UTF-8"),r={};if(ge=r,E=iV(e),Ay?(n.opt={strictEntities:!0},n.onopentag=rS,n.ontext=iS,n.oncomment=oS,n.onclosetag=sS,n.onerror=aS,n.oncdata=sV,n.ondoctype=aV,n.onprocessinginstruction=oV):(n.on("startElement",rS),n.on("text",iS),n.on("comment",oS),n.on("endElement",sS),n.on("error",aS)),Ay)n.write(t).close();else if(!n.parse(t))throw new Error("XML parsing error: "+n.getError());if(r[E.elementsKey]){var i=r[E.elementsKey];delete r[E.elementsKey],r[E.elementsKey]=i,delete r.text}return r}});var fS=ft((LNe,hS)=>{"use strict";var dS=wh(),cV=Iy();function uV(t){var e=dS.copyOptions(t);return dS.ensureSpacesExists(e),e}hS.exports=function(t,e){var n,r,i,o;return n=uV(e),r=cV(t,n),o="compact"in n&&n.compact?"_parent":"parent","addParent"in n&&n.addParent?i=JSON.stringify(r,function(s,a){return s===o?"_":a},n.spaces):i=JSON.stringify(r,null,n.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}});var Ny=ft((BNe,wS)=>{"use strict";var Ie=wh(),lV=bh().isArray,on,sn;function dV(t){var e=Ie.copyOptions(t);return Ie.ensureFlagExists("ignoreDeclaration",e),Ie.ensureFlagExists("ignoreInstruction",e),Ie.ensureFlagExists("ignoreAttributes",e),Ie.ensureFlagExists("ignoreText",e),Ie.ensureFlagExists("ignoreComment",e),Ie.ensureFlagExists("ignoreCdata",e),Ie.ensureFlagExists("ignoreDoctype",e),Ie.ensureFlagExists("compact",e),Ie.ensureFlagExists("indentText",e),Ie.ensureFlagExists("indentCdata",e),Ie.ensureFlagExists("indentAttributes",e),Ie.ensureFlagExists("indentInstruction",e),Ie.ensureFlagExists("fullTagEmptyElement",e),Ie.ensureFlagExists("noQuotesForNativeAttributes",e),Ie.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),Ie.ensureKeyExists("declaration",e),Ie.ensureKeyExists("instruction",e),Ie.ensureKeyExists("attributes",e),Ie.ensureKeyExists("text",e),Ie.ensureKeyExists("comment",e),Ie.ensureKeyExists("cdata",e),Ie.ensureKeyExists("doctype",e),Ie.ensureKeyExists("type",e),Ie.ensureKeyExists("name",e),Ie.ensureKeyExists("elements",e),Ie.checkFnExists("doctype",e),Ie.checkFnExists("instruction",e),Ie.checkFnExists("cdata",e),Ie.checkFnExists("comment",e),Ie.checkFnExists("text",e),Ie.checkFnExists("instructionName",e),Ie.checkFnExists("elementName",e),Ie.checkFnExists("attributeName",e),Ie.checkFnExists("attributeValue",e),Ie.checkFnExists("attributes",e),Ie.checkFnExists("fullTagEmptyElement",e),e}function Kr(t,e,n){return(!n&&t.spaces?` +`:"")+Array(e+1).join(t.spaces)}function Th(t,e,n){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,sn,on));var r,i,o,s,a=[];for(r in t)t.hasOwnProperty(r)&&t[r]!==null&&t[r]!==void 0&&(s=e.noQuotesForNativeAttributes&&typeof t[r]!="string"?"":'"',i=""+t[r],i=i.replace(/"/g,"""),o="attributeNameFn"in e?e.attributeNameFn(r,i,sn,on):r,a.push(e.spaces&&e.indentAttributes?Kr(e,n+1,!1):" "),a.push(o+"="+s+("attributeValueFn"in e?e.attributeValueFn(i,r,sn,on):i)+s));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&a.push(Kr(e,n,!1)),a.join("")}function pS(t,e,n){return on=t,sn="xml",e.ignoreDeclaration?"":""}function mS(t,e,n){if(e.ignoreInstruction)return"";var r;for(r in t)if(t.hasOwnProperty(r))break;var i="instructionNameFn"in e?e.instructionNameFn(r,t[r],sn,on):r;if(typeof t[r]=="object")return on=t,sn=i,"";var o=t[r]?t[r]:"";return"instructionFn"in e&&(o=e.instructionFn(o,r,sn,on)),""}function gS(t,e){return e.ignoreComment?"":""}function yS(t,e){return e.ignoreCdata?"":"","]]]]>"))+"]]>"}function vS(t,e){return e.ignoreDoctype?"":""}function My(t,e){return e.ignoreText?"":(t=""+t,t=t.replace(/&/g,"&"),t=t.replace(/&/g,"&").replace(//g,">"),"textFn"in e?e.textFn(t,sn,on):t)}function hV(t,e){var n;if(t.elements&&t.elements.length)for(n=0;n"),t[e.elementsKey]&&t[e.elementsKey].length&&(r.push(_S(t[e.elementsKey],e,n+1)),on=t,sn=t.name),r.push(e.spaces&&hV(t,e)?` +`+Array(n+1).join(e.spaces):""),r.push("")):r.push("/>"),r.join("")}function _S(t,e,n,r){return t.reduce(function(i,o){var s=Kr(e,n,r&&!i);switch(o.type){case"element":return i+s+fV(o,e,n);case"comment":return i+s+gS(o[e.commentKey],e);case"doctype":return i+s+vS(o[e.doctypeKey],e);case"cdata":return i+(e.indentCdata?s:"")+yS(o[e.cdataKey],e);case"text":return i+(e.indentText?s:"")+My(o[e.textKey],e);case"instruction":var a={};return a[o[e.nameKey]]=o[e.attributesKey]?o:o[e.instructionKey],i+(e.indentInstruction?s:"")+mS(a,e,n)}},"")}function xS(t,e,n){var r;for(r in t)if(t.hasOwnProperty(r))switch(r){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||n)return!0;break;case e.cdataKey:if(e.indentCdata||n)return!0;break;case e.instructionKey:if(e.indentInstruction||n)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function pV(t,e,n,r,i){on=t,sn=e;var o="elementNameFn"in n?n.elementNameFn(e,t):e;if(typeof t>"u"||t===null||t==="")return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(e,t)||n.fullTagEmptyElement?"<"+o+">":"<"+o+"/>";var s=[];if(e){if(s.push("<"+o),typeof t!="object")return s.push(">"+My(t,n)+""),s.join("");t[n.attributesKey]&&s.push(Th(t[n.attributesKey],n,r));var a=xS(t,n,!0)||t[n.attributesKey]&&t[n.attributesKey]["xml:space"]==="preserve";if(a||("fullTagEmptyElementFn"in n?a=n.fullTagEmptyElementFn(e,t):a=n.fullTagEmptyElement),a)s.push(">");else return s.push("/>"),s.join("")}return s.push(bS(t,n,r+1,!1)),on=t,sn=e,e&&s.push((i?Kr(n,r,!1):"")+""),s.join("")}function bS(t,e,n,r){var i,o,s,a=[];for(o in t)if(t.hasOwnProperty(o))for(s=lV(t[o])?t[o]:[t[o]],i=0;i{"use strict";var mV=Ny();TS.exports=function(t,e){t instanceof Buffer&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return mV(n,e)}});var Oy=ft((UNe,DS)=>{"use strict";var gV=Iy(),yV=fS(),vV=Ny(),_V=CS();DS.exports={xml2js:gV,xml2json:yV,js2xml:vV,json2xml:_V}});var Ly=null;var Bh=1;function On(t){let e=Ly;return Ly=t,e}var By={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function d1(t){if(!(qh(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Bh)){if(!t.producerMustRecompute(t)&&!jh(t)){t.dirty=!1,t.lastCleanEpoch=Bh;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Bh}}function jy(t){return t&&(t.nextProducerIndex=0),On(t)}function Uy(t,e){if(On(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(qh(t))for(let n=t.nextProducerIndex;nt.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function jh(t){fu(t);for(let e=0;e0}function fu(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function h1(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function f1(){throw new Error}var p1=f1;function $y(t){p1=t}function ae(t){return typeof t=="function"}function Go(t){let n=t(r=>{Error.call(r),r.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var pu=Go(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription: +${n.map((r,i)=>`${i+1}) ${r.toString()}`).join(` + `)}`:"",this.name="UnsubscriptionError",this.errors=n});function eo(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var St=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let o of n)o.remove(this);else n.remove(this);let{initialTeardown:r}=this;if(ae(r))try{r()}catch(o){e=o instanceof pu?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{Hy(o)}catch(s){e=e??[],s instanceof pu?e=[...e,...s.errors]:e.push(s)}}if(e)throw new pu(e)}}add(e){var n;if(e&&e!==this)if(this.closed)Hy(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}}_hasParent(e){let{_parentage:n}=this;return n===e||Array.isArray(n)&&n.includes(e)}_addParent(e){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e}_removeParent(e){let{_parentage:n}=this;n===e?this._parentage=null:Array.isArray(n)&&eo(n,e)}remove(e){let{_finalizers:n}=this;n&&eo(n,e),e instanceof t&&e._removeParent(this)}};St.EMPTY=(()=>{let t=new St;return t.closed=!0,t})();var $h=St.EMPTY;function mu(t){return t instanceof St||t&&"closed"in t&&ae(t.remove)&&ae(t.add)&&ae(t.unsubscribe)}function Hy(t){ae(t)?t():t.unsubscribe()}var sr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Wo={setTimeout(t,e,...n){let{delegate:r}=Wo;return r?.setTimeout?r.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=Wo;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function gu(t){Wo.setTimeout(()=>{let{onUnhandledError:e}=sr;if(e)e(t);else throw t})}function Ra(){}var Gy=(()=>Hh("C",void 0,void 0))();function Wy(t){return Hh("E",void 0,t)}function zy(t){return Hh("N",t,void 0)}function Hh(t,e,n){return{kind:t,value:e,error:n}}var to=null;function zo(t){if(sr.useDeprecatedSynchronousErrorHandling){let e=!to;if(e&&(to={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:r}=to;if(to=null,n)throw r}}else t()}function Yy(t){sr.useDeprecatedSynchronousErrorHandling&&to&&(to.errorThrown=!0,to.error=t)}var no=class extends St{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,mu(e)&&e.add(this)):this.destination=y1}static create(e,n,r){return new Yo(e,n,r)}next(e){this.isStopped?Wh(zy(e),this):this._next(e)}error(e){this.isStopped?Wh(Wy(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Wh(Gy,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},m1=Function.prototype.bind;function Gh(t,e){return m1.call(t,e)}var zh=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(r){yu(r)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(r){yu(r)}else yu(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){yu(n)}}},Yo=class extends no{constructor(e,n,r){super();let i;if(ae(e)||!e)i={next:e??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&sr.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&Gh(e.next,o),error:e.error&&Gh(e.error,o),complete:e.complete&&Gh(e.complete,o)}):i=e}this.destination=new zh(i)}};function yu(t){sr.useDeprecatedSynchronousErrorHandling?Yy(t):gu(t)}function g1(t){throw t}function Wh(t,e){let{onStoppedNotification:n}=sr;n&&Wo.setTimeout(()=>n(t,e))}var y1={closed:!0,next:Ra,error:g1,complete:Ra};var Zo=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Fn(t){return t}function Yh(...t){return Zh(t)}function Zh(t){return t.length===0?Fn:t.length===1?t[0]:function(n){return t.reduce((r,i)=>i(r),n)}}var Ue=(()=>{class t{constructor(n){n&&(this._subscribe=n)}lift(n){let r=new t;return r.source=this,r.operator=n,r}subscribe(n,r,i){let o=_1(n)?n:new Yo(n,r,i);return zo(()=>{let{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return r=Zy(r),new r((i,o)=>{let s=new Yo({next:a=>{try{n(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)}[Zo](){return this}pipe(...n){return Zh(n)(this)}toPromise(n){return n=Zy(n),new n((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return t.create=e=>new t(e),t})();function Zy(t){var e;return(e=t??sr.Promise)!==null&&e!==void 0?e:Promise}function v1(t){return t&&ae(t.next)&&ae(t.error)&&ae(t.complete)}function _1(t){return t&&t instanceof no||v1(t)&&mu(t)}function Qh(t){return ae(t?.lift)}function Me(t){return e=>{if(Qh(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function be(t,e,n,r,i){return new Kh(t,e,n,r,i)}var Kh=class extends no{constructor(e,n,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=i?function(a){try{i(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function Qo(){return Me((t,e)=>{let n=null;t._refCount++;let r=be(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){n=null;return}let i=t._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(r),r.closed||(n=t.connect())})}var Ko=class extends Ue{constructor(e,n){super(),this.source=e,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,Qh(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new St;let n=this.getSubject();e.add(this.source.subscribe(be(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=St.EMPTY)}return e}refCount(){return Qo()(this)}};var Qy=Go(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var vn=(()=>{class t extends Ue{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let r=new vu(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Qy}next(n){zo(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(n)}})}error(n){zo(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){zo(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:r,isStopped:i,observers:o}=this;return r||i?$h:(this.currentObservers=null,o.push(n),new St(()=>{this.currentObservers=null,eo(o,n)}))}_checkFinalizedStatuses(n){let{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){let n=new Ue;return n.source=this,n}}return t.create=(e,n)=>new vu(e,n),t})(),vu=class extends vn{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)}error(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,e)}complete(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)}_subscribe(e){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:$h}};var Yt=class extends vn{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let n=super._subscribe(e);return!n.closed&&e.next(this._value),n}getValue(){let{hasError:e,thrownError:n,_value:r}=this;if(e)throw n;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}};var Xh={now(){return(Xh.delegate||Date).now()},delegate:void 0};var _u=class extends St{constructor(e,n){super()}schedule(e,n=0){return this}};var Pa={setInterval(t,e,...n){let{delegate:r}=Pa;return r?.setInterval?r.setInterval(t,e,...n):setInterval(t,e,...n)},clearInterval(t){let{delegate:e}=Pa;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var xu=class extends _u{constructor(e,n){super(e,n),this.scheduler=e,this.work=n,this.pending=!1}schedule(e,n=0){var r;if(this.closed)return this;this.state=e;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(e,n,r=0){return Pa.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,n,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return n;n!=null&&Pa.clearInterval(n)}execute(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,n);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,n){let r=!1,i;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:e,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,eo(r,this),e!=null&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,super.unsubscribe()}}};var Xo=class t{constructor(e,n=t.now){this.schedulerActionCtor=e,this.now=n}schedule(e,n=0,r){return new this.schedulerActionCtor(this,e).schedule(r,n)}};Xo.now=Xh.now;var bu=class extends Xo{constructor(e,n=Xo.now){super(e,n),this.actions=[],this._active=!1}flush(e){let{actions:n}=this;if(this._active){n.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}}};var Ky=new bu(xu);var Bn=new Ue(t=>t.complete());function Xy(t){return t&&ae(t.schedule)}function Jy(t){return t[t.length-1]}function wu(t){return ae(Jy(t))?t.pop():void 0}function vi(t){return Xy(Jy(t))?t.pop():void 0}function en(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o}function Ne(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function ev(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ro(t){return this instanceof ro?(this.v=t,this):new ro(t)}function tv(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){r[h]&&(i[h]=function(p){return new Promise(function(y,v){o.push([h,p,y,v])>1||a(h,p)})})}function a(h,p){try{c(r[h](p))}catch(y){d(o[0][3],y)}}function c(h){h.value instanceof ro?Promise.resolve(h.value.v).then(u,l):d(o[0][2],h)}function u(h){a("next",h)}function l(h){a("throw",h)}function d(h,p){h(p),o.shift(),o.length&&a(o[0][0],o[0][1])}}function nv(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof ev=="function"?ev(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}var Jo=t=>t&&typeof t.length=="number"&&typeof t!="function";function Tu(t){return ae(t?.then)}function Cu(t){return ae(t[Zo])}function Du(t){return Symbol.asyncIterator&&ae(t?.[Symbol.asyncIterator])}function Eu(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function x1(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Su=x1();function Au(t){return ae(t?.[Su])}function Iu(t){return tv(this,arguments,function*(){let n=t.getReader();try{for(;;){let{value:r,done:i}=yield ro(n.read());if(i)return yield ro(void 0);yield yield ro(r)}}finally{n.releaseLock()}})}function Mu(t){return ae(t?.getReader)}function xt(t){if(t instanceof Ue)return t;if(t!=null){if(Cu(t))return b1(t);if(Jo(t))return w1(t);if(Tu(t))return T1(t);if(Du(t))return rv(t);if(Au(t))return C1(t);if(Mu(t))return D1(t)}throw Eu(t)}function b1(t){return new Ue(e=>{let n=t[Zo]();if(ae(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function w1(t){return new Ue(e=>{for(let n=0;n{t.then(n=>{e.closed||(e.next(n),e.complete())},n=>e.error(n)).then(null,gu)})}function C1(t){return new Ue(e=>{for(let n of t)if(e.next(n),e.closed)return;e.complete()})}function rv(t){return new Ue(e=>{E1(t,e).catch(n=>e.error(n))})}function D1(t){return rv(Iu(t))}function E1(t,e){var n,r,i,o;return Ne(this,void 0,void 0,function*(){try{for(n=nv(t);r=yield n.next(),!r.done;){let s=r.value;if(e.next(s),e.closed)return}}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}e.complete()})}function _n(t,e,n,r=0,i=!1){let o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Nu(t,e=0){return Me((n,r)=>{n.subscribe(be(r,i=>_n(r,t,()=>r.next(i),e),()=>_n(r,t,()=>r.complete(),e),i=>_n(r,t,()=>r.error(i),e)))})}function Ou(t,e=0){return Me((n,r)=>{r.add(t.schedule(()=>n.subscribe(r),e))})}function iv(t,e){return xt(t).pipe(Ou(e),Nu(e))}function ov(t,e){return xt(t).pipe(Ou(e),Nu(e))}function sv(t,e){return new Ue(n=>{let r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function av(t,e){return new Ue(n=>{let r;return _n(n,e,()=>{r=t[Su](),_n(n,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){n.error(s);return}o?n.complete():n.next(i)},0,!0)}),()=>ae(r?.return)&&r.return()})}function Fu(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ue(n=>{_n(n,e,()=>{let r=t[Symbol.asyncIterator]();_n(n,e,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function cv(t,e){return Fu(Iu(t),e)}function uv(t,e){if(t!=null){if(Cu(t))return iv(t,e);if(Jo(t))return sv(t,e);if(Tu(t))return ov(t,e);if(Du(t))return Fu(t,e);if(Au(t))return av(t,e);if(Mu(t))return cv(t,e)}throw Eu(t)}function vt(t,e){return e?uv(t,e):xt(t)}function me(...t){let e=vi(t);return vt(t,e)}function es(t,e){let n=ae(t)?t:()=>t,r=i=>i.error(n());return new Ue(e?i=>e.schedule(r,0,i):r)}function Jh(t){return!!t&&(t instanceof Ue||ae(t.lift)&&ae(t.subscribe))}var Jr=Go(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Oe(t,e){return Me((n,r)=>{let i=0;n.subscribe(be(r,o=>{r.next(t.call(e,o,i++))}))})}var{isArray:S1}=Array;function A1(t,e){return S1(e)?t(...e):t(e)}function ts(t){return Oe(e=>A1(t,e))}var{isArray:I1}=Array,{getPrototypeOf:M1,prototype:N1,keys:O1}=Object;function ku(t){if(t.length===1){let e=t[0];if(I1(e))return{args:e,keys:null};if(F1(e)){let n=O1(e);return{args:n.map(r=>e[r]),keys:n}}}return{args:t,keys:null}}function F1(t){return t&&typeof t=="object"&&M1(t)===N1}function Ru(t,e){return t.reduce((n,r,i)=>(n[r]=e[i],n),{})}function Va(...t){let e=vi(t),n=wu(t),{args:r,keys:i}=ku(t);if(r.length===0)return vt([],e);let o=new Ue(k1(r,e,i?s=>Ru(i,s):Fn));return n?o.pipe(ts(n)):o}function k1(t,e,n=Fn){return r=>{lv(e,()=>{let{length:i}=t,o=new Array(i),s=i,a=i;for(let c=0;c{let u=vt(t[c],e),l=!1;u.subscribe(be(r,d=>{o[c]=d,l||(l=!0,a--),a||r.next(n(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}function lv(t,e,n){t?_n(n,t,e):e()}function dv(t,e,n,r,i,o,s,a){let c=[],u=0,l=0,d=!1,h=()=>{d&&!c.length&&!u&&e.complete()},p=v=>u{o&&e.next(v),u++;let _=!1;xt(n(v,l++)).subscribe(be(e,x=>{i?.(x),o?p(x):e.next(x)},()=>{_=!0},void 0,()=>{if(_)try{for(u--;c.length&&uy(x)):y(x)}h()}catch(x){e.error(x)}}))};return t.subscribe(be(e,p,()=>{d=!0,h()})),()=>{a?.()}}function bt(t,e,n=1/0){return ae(e)?bt((r,i)=>Oe((o,s)=>e(r,o,i,s))(xt(t(r,i))),n):(typeof e=="number"&&(n=e),Me((r,i)=>dv(r,i,t,n)))}function ns(t=1/0){return bt(Fn,t)}function hv(){return ns(1)}function rs(...t){return hv()(vt(t,vi(t)))}function Pu(t){return new Ue(e=>{xt(t()).subscribe(e)})}function ef(...t){let e=wu(t),{args:n,keys:r}=ku(t),i=new Ue(o=>{let{length:s}=n;if(!s){o.complete();return}let a=new Array(s),c=s,u=s;for(let l=0;l{d||(d=!0,u--),a[l]=h},()=>c--,void 0,()=>{(!c||!d)&&(u||o.next(r?Ru(r,a):a),o.complete())}))}});return e?i.pipe(ts(e)):i}var R1=["addListener","removeListener"],P1=["addEventListener","removeEventListener"],V1=["on","off"];function La(t,e,n,r){if(ae(n)&&(r=n,n=void 0),r)return La(t,e,n).pipe(ts(r));let[i,o]=j1(t)?P1.map(s=>a=>t[s](e,a,n)):L1(t)?R1.map(fv(t,e)):B1(t)?V1.map(fv(t,e)):[];if(!i&&Jo(t))return bt(s=>La(s,e,n))(xt(t));if(!i)throw new TypeError("Invalid event target");return new Ue(s=>{let a=(...c)=>s.next(1o(a)})}function fv(t,e){return n=>r=>t[n](e,r)}function L1(t){return ae(t.addListener)&&ae(t.removeListener)}function B1(t){return ae(t.on)&&ae(t.off)}function j1(t){return ae(t.addEventListener)&&ae(t.removeEventListener)}function jn(t,e){return Me((n,r)=>{let i=0;n.subscribe(be(r,o=>t.call(e,o,i++)&&r.next(o)))})}function _i(t){return Me((e,n)=>{let r=null,i=!1,o;r=e.subscribe(be(n,void 0,void 0,s=>{o=xt(t(s,_i(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function pv(t,e,n,r,i){return(o,s)=>{let a=n,c=e,u=0;o.subscribe(be(s,l=>{let d=u++;c=a?t(c,l,d):(a=!0,l),r&&s.next(c)},i&&(()=>{a&&s.next(c),s.complete()})))}}function io(t,e){return ae(e)?bt(t,e,1):bt(t,1)}function tf(t,e=Ky){return Me((n,r)=>{let i=null,o=null,s=null,a=()=>{if(i){i.unsubscribe(),i=null;let u=o;o=null,r.next(u)}};function c(){let u=s+t,l=e.now();if(l{o=u,s=e.now(),i||(i=e.schedule(c,t),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function xi(t){return Me((e,n)=>{let r=!1;e.subscribe(be(n,i=>{r=!0,n.next(i)},()=>{r||n.next(t),n.complete()}))})}function ei(t){return t<=0?()=>Bn:Me((e,n)=>{let r=0;e.subscribe(be(n,i=>{++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function nf(t){return Oe(()=>t)}function Vu(t=U1){return Me((e,n)=>{let r=!1;e.subscribe(be(n,i=>{r=!0,n.next(i)},()=>r?n.complete():n.error(t())))})}function U1(){return new Jr}function Ba(t){return Me((e,n)=>{try{e.subscribe(n)}finally{n.add(t)}})}function Dr(t,e){let n=arguments.length>=2;return r=>r.pipe(t?jn((i,o)=>t(i,o,r)):Fn,ei(1),n?xi(e):Vu(()=>new Jr))}function is(t){return t<=0?()=>Bn:Me((e,n)=>{let r=[];e.subscribe(be(n,i=>{r.push(i),t{for(let i of r)n.next(i);n.complete()},void 0,()=>{r=null}))})}function rf(t,e){let n=arguments.length>=2;return r=>r.pipe(t?jn((i,o)=>t(i,o,r)):Fn,is(1),n?xi(e):Vu(()=>new Jr))}function of(t,e){return Me(pv(t,e,arguments.length>=2,!0))}function sf(...t){let e=vi(t);return Me((n,r)=>{(e?rs(t,n,e):rs(t,n)).subscribe(r)})}function Un(t,e){return Me((n,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();n.subscribe(be(r,c=>{i?.unsubscribe();let u=0,l=o++;xt(t(c,l)).subscribe(i=be(r,d=>r.next(e?e(c,d,l,u++):d),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function af(t){return Me((e,n)=>{xt(t).subscribe(be(n,()=>n.complete(),Ra)),!n.closed&&e.subscribe(n)})}function wt(t,e,n){let r=ae(t)||e||n?{next:t,error:e,complete:n}:t;return r?Me((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(be(o,c=>{var u;(u=r.next)===null||u===void 0||u.call(r,c),o.next(c)},()=>{var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},c=>{var u;a=!1,(u=r.error)===null||u===void 0||u.call(r,c),o.error(c)},()=>{var c,u;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(u=r.finalize)===null||u===void 0||u.call(r)}))}):Fn}function it(t){for(let e in t)if(t[e]===it)return e;throw Error("Could not find renamed property on target object.")}function Lu(t,e){for(let n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function tn(t){if(typeof t=="string")return t;if(Array.isArray(t))return"["+t.map(tn).join(", ")+"]";if(t==null)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;let e=t.toString();if(e==null)return""+e;let n=e.indexOf(` +`);return n===-1?e:e.substring(0,n)}function mv(t,e){return t==null||t===""?e===null?"":e:e==null||e===""?t:t+" "+e}var q1=it({__forward_ref__:it});function Xa(t){return t.__forward_ref__=Xa,t.toString=function(){return tn(this())},t}function un(t){return e_(t)?t():t}function e_(t){return typeof t=="function"&&t.hasOwnProperty(q1)&&t.__forward_ref__===Xa}function t_(t){return t&&!!t.\u0275providers}var n_="https://g.co/ng/security#xss",ie=class extends Error{constructor(e,n){super(mp(e,n)),this.code=e}};function mp(t,e){return`${`NG0${Math.abs(t)}`}${e?": "+e:""}`}var $1=it({\u0275cmp:it}),H1=it({\u0275dir:it}),G1=it({\u0275pipe:it}),W1=it({\u0275mod:it}),Qu=it({\u0275fac:it}),ja=it({__NG_ELEMENT_ID__:it}),gv=it({__NG_ENV_ID__:it});function ds(t){return typeof t=="string"?t:t==null?"":String(t)}function z1(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():ds(t)}function Y1(t,e){let n=e?`. Dependency path: ${e.join(" > ")} > ${t}`:"";throw new ie(-200,`Circular dependency in DI detected for ${t}${n}`)}function gp(t,e){let n=e?` in ${e}`:"";throw new ie(-201,!1)}function Z1(t,e){t==null&&Q1(e,t,null,"!=")}function Q1(t,e,n,r){throw new Error(`ASSERTION ERROR: ${t}`+(r==null?"":` [Expected=> ${n} ${r} ${e} <=Actual]`))}function se(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function xn(t){return{providers:t.providers||[],imports:t.imports||[]}}function gl(t){return yv(t,i_)||yv(t,o_)}function r_(t){return gl(t)!==null}function yv(t,e){return t.hasOwnProperty(e)?t[e]:null}function K1(t){let e=t&&(t[i_]||t[o_]);return e||null}function vv(t){return t&&(t.hasOwnProperty(_v)||t.hasOwnProperty(X1))?t[_v]:null}var i_=it({\u0275prov:it}),_v=it({\u0275inj:it}),o_=it({ngInjectableDef:it}),X1=it({ngInjectorDef:it}),we=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(we||{}),wf;function s_(){return wf}function qn(t){let e=wf;return wf=t,e}function a_(t,e,n){let r=gl(t);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(n&we.Optional)return null;if(e!==void 0)return e;gp(tn(t),"Injector")}var ln=globalThis;var le=class{constructor(e,n){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=se({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var J1={},qa=J1,Tf="__NG_DI_FLAG__",Ku="ngTempTokenPath",eA="ngTokenPath",tA=/\n/gm,nA="\u0275",xv="__source",us;function rA(){return us}function bi(t){let e=us;return us=t,e}function iA(t,e=we.Default){if(us===void 0)throw new ie(-203,!1);return us===null?a_(t,void 0,e):us.get(t,e&we.Optional?null:void 0,e)}function ce(t,e=we.Default){return(s_()||iA)(un(t),e)}function J(t,e=we.Default){return ce(t,yl(e))}function yl(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function Cf(t){let e=[];for(let n=0;n ");else if(typeof e=="object"){let o=[];for(let s in e)if(e.hasOwnProperty(s)){let a=e[s];o.push(s+":"+(typeof a=="string"?JSON.stringify(a):tn(a)))}i=`{${o.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${t.replace(tA,` + `)}`}function Ja(t){return{toString:t}.toString()}var u_=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}(u_||{}),Ir=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}(Ir||{}),hs={},$n=[];function l_(t,e,n){let r=t.length;for(;;){let i=t.indexOf(e,n);if(i===-1)return i;if(i===0||t.charCodeAt(i-1)<=32){let o=e.length;if(i+o===r||t.charCodeAt(i+o)<=32)return i}n=i+1}}function Df(t,e,n){let r=0;for(;re){s=o-1;break}}}for(;oo?h="":h=i[d+1].toLowerCase();let p=r&8?h:null;if(p&&l_(p,u,0)!==-1||r&2&&u!==h){if(ar(r))return!1;s=!0}}}}return ar(r)||s}function ar(t){return(t&1)===0}function hA(t,e,n,r){if(e===null)return-1;let i=0;if(r||!n){let o=!1;for(;i-1)for(n++;n0?'="'+a+'"':"")+"]"}else r&8?i+="."+s:r&4&&(i+=" "+s);else i!==""&&!ar(s)&&(e+=wv(o,i),i=""),r=s,o=o||!ar(r);n++}return i!==""&&(e+=wv(o,i)),e}function vA(t){return t.map(yA).join(",")}function _A(t){let e=[],n=[],r=1,i=2;for(;r{let e=__(t),n=H(T({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===u_.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||Ir.Emulated,styles:t.styles||$n,_:null,schemas:t.schemas||null,tView:null,id:""});x_(n);let r=t.dependencies;return n.directiveDefs=Cv(r,!1),n.pipeDefs=Cv(r,!0),n.id=wA(n),n})}function xA(t){return Ci(t)||m_(t)}function bA(t){return t!==null}function bn(t){return Ja(()=>({type:t.type,bootstrap:t.bootstrap||$n,declarations:t.declarations||$n,imports:t.imports||$n,exports:t.exports||$n,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function Tv(t,e){if(t==null)return hs;let n={};for(let r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,e&&(e[i]=o)}return n}function Hn(t){return Ja(()=>{let e=__(t);return x_(e),e})}function Ci(t){return t[$1]||null}function m_(t){return t[H1]||null}function g_(t){return t[G1]||null}function y_(t){let e=Ci(t)||m_(t)||g_(t);return e!==null?e.standalone:!1}function v_(t,e){let n=t[W1]||null;if(!n&&e===!0)throw new Error(`Type ${tn(t)} does not have '\u0275mod' property.`);return n}function __(t){let e={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputTransforms:null,inputConfig:t.inputs||hs,exportAs:t.exportAs||null,standalone:t.standalone===!0,signals:t.signals===!0,selectors:t.selectors||$n,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Tv(t.inputs,e),outputs:Tv(t.outputs),debugInfo:null}}function x_(t){t.features?.forEach(e=>e(t))}function Cv(t,e){if(!t)return null;let n=e?g_:xA;return()=>(typeof t=="function"?t():t).map(r=>n(r)).filter(bA)}function wA(t){let e=0,n=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,t.consts,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery].join("|");for(let i of n)e=Math.imul(31,e)+i.charCodeAt(0)<<0;return e+=2147483647+1,"c"+e}var ri=0,Te=1,he=2,Ft=3,cr=4,Pn=5,Ha=6,Ga=7,ur=8,fs=9,ti=10,At=11,Wa=12,Dv=13,ws=14,lr=15,ec=16,os=17,Ar=18,vl=19,b_=20,wi=21,cf=22,so=23,Mr=25,w_=1;var ao=7,Xu=8,ps=9,kn=10,ms=function(t){return t[t.None=0]="None",t[t.HasTransplantedViews=2]="HasTransplantedViews",t[t.HasChildViewsToRefresh=4]="HasChildViewsToRefresh",t}(ms||{});function Ti(t){return Array.isArray(t)&&typeof t[w_]=="object"}function dr(t){return Array.isArray(t)&&t[w_]===!0}function yp(t){return(t.flags&4)!==0}function _l(t){return t.componentOffset>-1}function xl(t){return(t.flags&1)===1}function Di(t){return!!t.template}function TA(t){return(t[he]&512)!==0}function gs(t,e){let n=t.hasOwnProperty(Qu);return n?t[Qu]:null}var Ef=class{constructor(e,n,r){this.previousValue=e,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function ii(){return T_}function T_(t){return t.type.prototype.ngOnChanges&&(t.setInput=DA),CA}ii.ngInherit=!0;function CA(){let t=D_(this),e=t?.current;if(e){let n=t.previous;if(n===hs)t.previous=e;else for(let r in e)n[r]=e[r];t.current=null,this.ngOnChanges(e)}}function DA(t,e,n,r){let i=this.declaredInputs[n],o=D_(t)||EA(t,{previous:hs,current:null}),s=o.current||(o.current={}),a=o.previous,c=a[i];s[i]=new Ef(c&&c.currentValue,e,a===hs),t[r]=e}var C_="__ngSimpleChanges__";function D_(t){return t[C_]||null}function EA(t,e){return t[C_]=e}var Ev=null;var Er=function(t,e,n){Ev?.(t,e,n)},SA="svg",AA="math",IA=!1;function MA(){return IA}function Nr(t){for(;Array.isArray(t);)t=t[ri];return t}function E_(t,e){return Nr(e[t])}function Gn(t,e){return Nr(e[t.index])}function S_(t,e){return t.data[e]}function Ai(t,e){let n=e[t];return Ti(n)?n:n[ri]}function NA(t){return(t[he]&4)===4}function vp(t){return(t[he]&128)===128}function OA(t){return dr(t[Ft])}function ys(t,e){return e==null?null:t[e]}function A_(t){t[os]=0}function FA(t){t[he]&1024||(t[he]|=1024,vp(t)&&za(t))}function kA(t,e){for(;t>0;)e=e[ws],t--;return e}function I_(t){return t[he]&9216||t[so]?.dirty}function Sf(t){I_(t)?za(t):t[he]&64&&(MA()?(t[he]|=1024,za(t)):t[ti].changeDetectionScheduler?.notify())}function za(t){t[ti].changeDetectionScheduler?.notify();let e=t[Ft];for(;e!==null&&!(dr(e)&&e[he]&ms.HasChildViewsToRefresh||Ti(e)&&e[he]&8192);){if(dr(e))e[he]|=ms.HasChildViewsToRefresh;else if(e[he]|=8192,!vp(e))break;e=e[Ft]}}function M_(t,e){if((t[he]&256)===256)throw new ie(911,!1);t[wi]===null&&(t[wi]=[]),t[wi].push(e)}function RA(t,e){if(t[wi]===null)return;let n=t[wi].indexOf(e);n!==-1&&t[wi].splice(n,1)}var Ce={lFrame:L_(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function PA(){return Ce.lFrame.elementDepthCount}function VA(){Ce.lFrame.elementDepthCount++}function LA(){Ce.lFrame.elementDepthCount--}function N_(){return Ce.bindingsEnabled}function O_(){return Ce.skipHydrationRootTNode!==null}function BA(t){return Ce.skipHydrationRootTNode===t}function jA(){Ce.skipHydrationRootTNode=null}function He(){return Ce.lFrame.lView}function Zt(){return Ce.lFrame.tView}function et(t){return Ce.lFrame.contextLView=t,t[ur]}function tt(t){return Ce.lFrame.contextLView=null,t}function wn(){let t=F_();for(;t!==null&&t.type===64;)t=t.parent;return t}function F_(){return Ce.lFrame.currentTNode}function UA(){let t=Ce.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function go(t,e){let n=Ce.lFrame;n.currentTNode=t,n.isParent=e}function _p(){return Ce.lFrame.isParent}function xp(){Ce.lFrame.isParent=!1}function qA(){return Ce.lFrame.bindingIndex}function $A(t){return Ce.lFrame.bindingIndex=t}function bl(){return Ce.lFrame.bindingIndex++}function k_(t){let e=Ce.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function HA(){return Ce.lFrame.inI18n}function GA(t,e){let n=Ce.lFrame;n.bindingIndex=n.bindingRootIndex=t,Af(e)}function WA(){return Ce.lFrame.currentDirectiveIndex}function Af(t){Ce.lFrame.currentDirectiveIndex=t}function zA(t){let e=Ce.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function R_(){return Ce.lFrame.currentQueryIndex}function bp(t){Ce.lFrame.currentQueryIndex=t}function YA(t){let e=t[Te];return e.type===2?e.declTNode:e.type===1?t[Pn]:null}function P_(t,e,n){if(n&we.SkipSelf){let i=e,o=t;for(;i=i.parent,i===null&&!(n&we.Host);)if(i=YA(o),i===null||(o=o[ws],i.type&10))break;if(i===null)return!1;e=i,t=o}let r=Ce.lFrame=V_();return r.currentTNode=e,r.lView=t,!0}function wp(t){let e=V_(),n=t[Te];Ce.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function V_(){let t=Ce.lFrame,e=t===null?null:t.child;return e===null?L_(t):e}function L_(t){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return t!==null&&(t.child=e),e}function B_(){let t=Ce.lFrame;return Ce.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var j_=B_;function Tp(){let t=B_();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function ZA(t){return(Ce.lFrame.contextLView=kA(t,Ce.lFrame.contextLView))[ur]}function yo(){return Ce.lFrame.selectedIndex}function co(t){Ce.lFrame.selectedIndex=t}function Cp(){let t=Ce.lFrame;return S_(t.tView,t.selectedIndex)}function QA(){return Ce.lFrame.currentNamespace}var U_=!0;function wl(){return U_}function Tl(t){U_=t}function KA(t,e,n){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=T_(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}i&&(n.preOrderHooks??=[]).push(0-t,i),o&&((n.preOrderHooks??=[]).push(t,o),(n.preOrderCheckHooks??=[]).push(t,o))}function Cl(t,e){for(let n=e.directiveStart,r=e.directiveEnd;n=r)break}else e[c]<0&&(t[os]+=65536),(a>14>16&&(t[he]&3)===e&&(t[he]+=16384,Sv(a,o)):Sv(a,o)}var ls=-1,uo=class{constructor(e,n,r){this.factory=e,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}};function JA(t){return t instanceof uo}function eI(t){return(t.flags&8)!==0}function tI(t){return(t.flags&16)!==0}function $_(t){return t!==ls}function Ju(t){let e=t&32767;return t&32767}function nI(t){return t>>16}function el(t,e){let n=nI(t),r=e;for(;n>0;)r=r[ws],n--;return r}var If=!0;function Av(t){let e=If;return If=t,e}var rI=256,H_=rI-1,G_=5,iI=0,Sr={};function oI(t,e,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:n.hasOwnProperty(ja)&&(r=n[ja]),r==null&&(r=n[ja]=iI++);let i=r&H_,o=1<>G_)]|=o}function tl(t,e){let n=W_(t,e);if(n!==-1)return n;let r=e[Te];r.firstCreatePass&&(t.injectorIndex=e.length,lf(r.data,t),lf(e,null),lf(r.blueprint,null));let i=Dp(t,e),o=t.injectorIndex;if($_(i)){let s=Ju(i),a=el(i,e),c=a[Te].data;for(let u=0;u<8;u++)e[o+u]=a[s+u]|c[s+u]}return e[o+8]=i,o}function lf(t,e){t.push(0,0,0,0,0,0,0,0,e)}function W_(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function Dp(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,r=null,i=e;for(;i!==null;){if(r=K_(i),r===null)return ls;if(n++,i=i[ws],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return ls}function Mf(t,e,n){oI(t,e,n)}function sI(t,e){if(e==="class")return t.classes;if(e==="style")return t.styles;let n=t.attrs;if(n){let r=n.length,i=0;for(;i>20,d=r?a:a+l,h=i?a+l:u;for(let p=d;p=c&&y.type===n)return p}if(i){let p=s[c];if(p&&Di(p)&&p.type===n)return c}return null}function lo(t,e,n,r){let i=t[n],o=e.data;if(JA(i)){let s=i;s.resolving&&Y1(z1(o[n]));let a=Av(s.canSeeViewProviders);s.resolving=!0;let c,u=s.injectImpl?qn(s.injectImpl):null,l=P_(t,r,we.Default);try{i=t[n]=s.factory(void 0,o,t,r),e.firstCreatePass&&n>=r.directiveStart&&KA(n,o[n],e)}finally{u!==null&&qn(u),Av(a),s.resolving=!1,j_()}}return i}function cI(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=t.hasOwnProperty(ja)?t[ja]:void 0;return typeof e=="number"?e>=0?e&H_:uI:e}function Iv(t,e,n){let r=1<>G_)]&r)}function Mv(t,e){return!(t&we.Self)&&!(t&we.Host&&e)}var oo=class{constructor(e,n){this._tNode=e,this._lView=n}get(e,n,r){return Z_(this._tNode,this._lView,e,yl(r),n)}};function uI(){return new oo(wn(),He())}function tc(t){return Ja(()=>{let e=t.prototype.constructor,n=e[Qu]||Nf(e),r=Object.prototype,i=Object.getPrototypeOf(t.prototype).constructor;for(;i&&i!==r;){let o=i[Qu]||Nf(i);if(o&&o!==n)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function Nf(t){return e_(t)?()=>{let e=Nf(un(t));return e&&e()}:gs(t)}function lI(t,e,n,r,i){let o=t,s=e;for(;o!==null&&s!==null&&s[he]&2048&&!(s[he]&512);){let a=Q_(o,s,n,r|we.Self,Sr);if(a!==Sr)return a;let c=o.parent;if(!c){let u=s[b_];if(u){let l=u.get(n,Sr,r);if(l!==Sr)return l}c=K_(s),s=s[ws]}o=c}return i}function K_(t){let e=t[Te],n=e.type;return n===2?e.declTNode:n===1?t[Pn]:null}function Ep(t){return sI(wn(),t)}var Bu="__parameters__";function dI(t){return function(...n){if(t){let r=t(...n);for(let i in r)this[i]=r[i]}}}function X_(t,e,n){return Ja(()=>{let r=dI(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;let s=new i(...o);return a.annotation=s,a;function a(c,u,l){let d=c.hasOwnProperty(Bu)?c[Bu]:Object.defineProperty(c,Bu,{value:[]})[Bu];for(;d.length<=l;)d.push(null);return(d[l]=d[l]||[]).push(s),c}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=t,i.annotationCls=i,i})}function hI(t){let e=ln.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}function fI(t){return typeof t=="function"}function pI(t,e,n){if(t.length!==e.length)return!1;for(let r=0;rArray.isArray(n)?Sp(n,e):e(n))}function J_(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function nl(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function e0(t,e){let n=[];for(let r=0;re;){let o=i-2;t[i]=t[o],i--}t[e]=n,t[e+1]=r}}function yI(t,e,n){let r=nc(t,e);return r>=0?t[r|1]=n:(r=~r,gI(t,r,e,n)),r}function df(t,e){let n=nc(t,e);if(n>=0)return t[n|1]}function nc(t,e){return vI(t,e,1)}function vI(t,e,n){let r=0,i=t.length>>n;for(;i!==r;){let o=r+(i-r>>1),s=t[o<e?i=o:r=o+1}return~(i<{let s=[];i.templateUrl&&s.push(r(i.templateUrl).then(u=>{i.template=u}));let a=typeof i.styles=="string"?[i.styles]:i.styles||[];if(i.styles=a,i.styleUrl&&i.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");if(i.styleUrls?.length){let u=i.styles.length,l=i.styleUrls;i.styleUrls.forEach((d,h)=>{a.push(""),s.push(r(d).then(p=>{a[u+h]=p,l.splice(l.indexOf(d),1),l.length==0&&(i.styleUrls=void 0)}))})}else i.styleUrl&&s.push(r(i.styleUrl).then(u=>{a.push(u),i.styleUrl=void 0}));let c=Promise.all(s).then(()=>CI(o));e.push(c)}),bI(),Promise.all(e).then(()=>{})}var rl=new Map,xI=new Set;function bI(){let t=rl;return rl=new Map,t}function wI(){return rl.size===0}function TI(t){return typeof t=="string"?t:t.text()}function CI(t){xI.delete(t)}var vs=new le("ENVIRONMENT_INITIALIZER"),t0=new le("INJECTOR",-1),n0=new le("INJECTOR_DEF_TYPES"),il=class{get(e,n=qa){if(n===qa){let r=new Error(`NullInjectorError: No provider for ${tn(e)}!`);throw r.name="NullInjectorError",r}return n}};function DI(...t){return{\u0275providers:r0(!0,t),\u0275fromNgModule:!0}}function r0(t,...e){let n=[],r=new Set,i,o=s=>{n.push(s)};return Sp(e,s=>{let a=s;Of(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&i0(i,o),n}function i0(t,e){for(let n=0;n{e(o,r)})}}function Of(t,e,n,r){if(t=un(t),!t)return!1;let i=null,o=vv(t),s=!o&&Ci(t);if(!o&&!s){let c=t.ngModule;if(o=vv(c),o)i=c;else return!1}else{if(s&&!s.standalone)return!1;i=t}let a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let u of c)Of(u,e,n,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let u;try{Sp(o.imports,l=>{Of(l,e,n,r)&&(u||=[],u.push(l))})}finally{}u!==void 0&&i0(u,e)}if(!a){let u=gs(i)||(()=>new i);e({provide:i,useFactory:u,deps:$n},i),e({provide:n0,useValue:i,multi:!0},i),e({provide:vs,useValue:()=>ce(i),multi:!0},i)}let c=o.providers;if(c!=null&&!a){let u=t;Ip(c,l=>{e(l,u)})}}else return!1;return i!==t&&t.providers!==void 0}function Ip(t,e){for(let n of t)t_(n)&&(n=n.\u0275providers),Array.isArray(n)?Ip(n,e):e(n)}var EI=it({provide:String,useValue:it});function o0(t){return t!==null&&typeof t=="object"&&EI in t}function SI(t){return!!(t&&t.useExisting)}function AI(t){return!!(t&&t.useFactory)}function _s(t){return typeof t=="function"}function II(t){return!!t.useClass}var El=new le("Set Injector scope."),zu={},MI={},hf;function Mp(){return hf===void 0&&(hf=new il),hf}var Rn=class{},Ya=class extends Rn{get destroyed(){return this._destroyed}constructor(e,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,kf(e,s=>this.processProvider(s)),this.records.set(t0,ss(void 0,this)),i.has("environment")&&this.records.set(Rn,ss(void 0,this));let o=this.records.get(El);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(n0,$n,we.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(let n of this._ngOnDestroyHooks)n.ngOnDestroy();let e=this._onDestroyHooks;this._onDestroyHooks=[];for(let n of e)n()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(e){return this.assertNotDestroyed(),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){this.assertNotDestroyed();let n=bi(this),r=qn(void 0),i;try{return e()}finally{bi(n),qn(r)}}get(e,n=qa,r=we.Default){if(this.assertNotDestroyed(),e.hasOwnProperty(gv))return e[gv](this);r=yl(r);let i,o=bi(this),s=qn(void 0);try{if(!(r&we.SkipSelf)){let c=this.records.get(e);if(c===void 0){let u=RI(e)&&gl(e);u&&this.injectableDefInScope(u)?c=ss(Ff(e),zu):c=null,this.records.set(e,c)}if(c!=null)return this.hydrate(e,c)}let a=r&we.Self?Mp():this.parent;return n=r&we.Optional&&n===qa?null:n,a.get(e,n)}catch(a){if(a.name==="NullInjectorError"){if((a[Ku]=a[Ku]||[]).unshift(tn(e)),o)throw a;return sA(a,e,"R3InjectorError",this.source)}else throw a}finally{qn(s),bi(o)}}resolveInjectorInitializers(){let e=bi(this),n=qn(void 0),r;try{let i=this.get(vs,$n,we.Self);for(let o of i)o()}finally{bi(e),qn(n)}}toString(){let e=[],n=this.records;for(let r of n.keys())e.push(tn(r));return`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new ie(205,!1)}processProvider(e){e=un(e);let n=_s(e)?e:un(e&&e.provide),r=OI(e);if(!_s(e)&&e.multi===!0){let i=this.records.get(n);i||(i=ss(void 0,zu,!0),i.factory=()=>Cf(i.multi),this.records.set(n,i)),n=e,i.multi.push(e)}else{let i=this.records.get(n)}this.records.set(n,r)}hydrate(e,n){return n.value===zu&&(n.value=MI,n.value=n.factory()),typeof n.value=="object"&&n.value&&kI(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}injectableDefInScope(e){if(!e.providedIn)return!1;let n=un(e.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(e){let n=this._onDestroyHooks.indexOf(e);n!==-1&&this._onDestroyHooks.splice(n,1)}};function Ff(t){let e=gl(t),n=e!==null?e.factory:gs(t);if(n!==null)return n;if(t instanceof le)throw new ie(204,!1);if(t instanceof Function)return NI(t);throw new ie(204,!1)}function NI(t){let e=t.length;if(e>0){let r=e0(e,"?");throw new ie(204,!1)}let n=K1(t);return n!==null?()=>n.factory(t):()=>new t}function OI(t){if(o0(t))return ss(void 0,t.useValue);{let e=s0(t);return ss(e,zu)}}function s0(t,e,n){let r;if(_s(t)){let i=un(t);return gs(i)||Ff(i)}else if(o0(t))r=()=>un(t.useValue);else if(AI(t))r=()=>t.useFactory(...Cf(t.deps||[]));else if(SI(t))r=()=>ce(un(t.useExisting));else{let i=un(t&&(t.useClass||t.provide));if(FI(t))r=()=>new i(...Cf(t.deps));else return gs(i)||Ff(i)}return r}function ss(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function FI(t){return!!t.deps}function kI(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function RI(t){return typeof t=="function"||typeof t=="object"&&t instanceof le}function kf(t,e){for(let n of t)Array.isArray(n)?kf(n,e):n&&t_(n)?kf(n.\u0275providers,e):e(n)}function Ii(t,e){t instanceof Ya&&t.assertNotDestroyed();let n,r=bi(t),i=qn(void 0);try{return e()}finally{bi(r),qn(i)}}function PI(t){if(!s_()&&!rA())throw new ie(-203,!1)}function Nv(t,e=null,n=null,r){let i=a0(t,e,n,r);return i.resolveInjectorInitializers(),i}function a0(t,e=null,n=null,r,i=new Set){let o=[n||$n,DI(t)];return r=r||(typeof t=="object"?void 0:tn(t)),new Ya(o,e||Mp(),r||null,i)}var Wn=(()=>{let e=class e{static create(r,i){if(Array.isArray(r))return Nv({name:""},i,r,"");{let o=r.name??"";return Nv({name:o},r.parent,r.providers,o)}}};e.THROW_IF_NOT_FOUND=qa,e.NULL=new il,e.\u0275prov=se({token:e,providedIn:"any",factory:()=>ce(t0)}),e.__NG_ELEMENT_ID__=-1;let t=e;return t})();var Rf;function c0(t){Rf=t}function VI(){if(Rf!==void 0)return Rf;if(typeof document<"u")return document;throw new ie(210,!1)}var Sl=new le("AppId",{providedIn:"root",factory:()=>LI}),LI="ng",Np=new le("Platform Initializer"),vo=new le("Platform ID",{providedIn:"platform",factory:()=>"unknown"});var Op=new le("CSP nonce",{providedIn:"root",factory:()=>VI().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});function u0(t){return t instanceof Function?t():t}function BI(t){return(t??J(Wn)).get(vo)==="browser"}function l0(t){return(t.flags&128)===128}var ni=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}(ni||{}),jI=/^>|^->||--!>|)/g,qI="\u200B$1\u200B";function $I(t){return t.replace(jI,e=>e.replace(UI,qI))}var d0=new Map,HI=0;function GI(){return HI++}function WI(t){d0.set(t[vl],t)}function zI(t){d0.delete(t[vl])}var Ov="__ngContext__";function Ei(t,e){Ti(e)?(t[Ov]=e[vl],WI(e)):t[Ov]=e}var YI;function Fp(t,e){return YI(t,e)}function kp(t){let e=t[Ft];return dr(e)?e[Ft]:e}function h0(t){return p0(t[Wa])}function f0(t){return p0(t[cr])}function p0(t){for(;t!==null&&!dr(t);)t=t[cr];return t}function as(t,e,n,r,i){if(r!=null){let o,s=!1;dr(r)?o=r:Ti(r)&&(s=!0,r=r[ri]);let a=Nr(r);t===0&&n!==null?i==null?_0(e,n,a):ol(e,n,a,i||null,!0):t===1&&n!==null?ol(e,n,a,i||null,!0):t===2?dM(e,a,s):t===3&&e.destroyNode(a),o!=null&&fM(e,t,o,n,i)}}function ZI(t,e){return t.createText(e)}function QI(t,e,n){t.setValue(e,n)}function KI(t,e){return t.createComment($I(e))}function m0(t,e,n){return t.createElement(e,n)}function XI(t,e){let n=e[At];rc(t,e,n,2,null,null),e[ri]=null,e[Pn]=null}function JI(t,e,n,r,i,o){r[ri]=i,r[Pn]=e,rc(t,r,n,1,i,o)}function eM(t,e){rc(t,e,e[At],2,null,null)}function tM(t){let e=t[Wa];if(!e)return ff(t[Te],t);for(;e;){let n=null;if(Ti(e))n=e[Wa];else{let r=e[kn];r&&(n=r)}if(!n){for(;e&&!e[cr]&&e!==t;)Ti(e)&&ff(e[Te],e),e=e[Ft];e===null&&(e=t),Ti(e)&&ff(e[Te],e),n=e&&e[cr]}e=n}}function nM(t,e,n,r){let i=kn+r,o=n.length;r>0&&(n[i-1][cr]=e),r0&&(t[n-1][cr]=r[cr]);let o=nl(t,kn+e);XI(r[Te],r);let s=o[Ar];s!==null&&s.detachView(o[Te]),r[Ft]=null,r[cr]=null,r[he]&=-129}return r}function y0(t,e){if(!(e[he]&256)){let n=e[At];n.destroyNode&&rc(t,e,n,3,null,null),tM(e)}}function ff(t,e){if(!(e[he]&256)){e[he]&=-129,e[he]|=256,e[so]&&qy(e[so]),oM(t,e),iM(t,e),e[Te].type===1&&e[At].destroy();let n=e[ec];if(n!==null&&dr(e[Ft])){n!==e[Ft]&&g0(n,e);let r=e[Ar];r!==null&&r.detachView(t)}zI(e)}}function iM(t,e){let n=t.cleanup,r=e[Ga];if(n!==null)for(let o=0;o=0?r[s]():r[-s].unsubscribe(),o+=2}else{let s=r[n[o+1]];n[o].call(s)}r!==null&&(e[Ga]=null);let i=e[wi];if(i!==null){e[wi]=null;for(let o=0;o-1){let{encapsulation:o}=t.data[r.directiveStart+i];if(o===Ir.None||o===Ir.Emulated)return null}return Gn(r,n)}}function ol(t,e,n,r,i){t.insertBefore(e,n,r,i)}function _0(t,e,n){t.appendChild(e,n)}function Fv(t,e,n,r,i){r!==null?ol(t,e,n,r,i):_0(t,e,n)}function aM(t,e,n,r){t.removeChild(e,n,r)}function Rp(t,e){return t.parentNode(e)}function cM(t,e){return t.nextSibling(e)}function x0(t,e,n){return lM(t,e,n)}function uM(t,e,n){return t.type&40?Gn(t,n):null}var lM=uM,kv;function Al(t,e,n,r){let i=v0(t,r,e),o=e[At],s=r.parent||e[Pn],a=x0(s,r,e);if(i!=null)if(Array.isArray(n))for(let c=0;ct,createScript:t=>t,createScriptURL:t=>t})}catch{}return ju}function Rv(t){return gM()?.createScriptURL(t)||t}var sl=class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${n_})`}};function ic(t){return t instanceof sl?t.changingThisBreaksApplicationSecurity:t}function Vp(t,e){let n=yM(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${n_})`)}return n===e}function yM(t){return t instanceof sl&&t.getTypeName()||null}var vM=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function D0(t){return t=String(t),t.match(vM)?t:"unsafe:"+t}var Il=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}(Il||{});function _M(t){let e=S0();return e?e.sanitize(Il.URL,t)||"":Vp(t,"URL")?ic(t):D0(ds(t))}function xM(t){let e=S0();if(e)return Rv(e.sanitize(Il.RESOURCE_URL,t)||"");if(Vp(t,"ResourceURL"))return Rv(ic(t));throw new ie(904,!1)}function bM(t,e){return e==="src"&&(t==="embed"||t==="frame"||t==="iframe"||t==="media"||t==="script")||e==="href"&&(t==="base"||t==="link")?xM:_M}function E0(t,e,n){return bM(e,n)(t)}function S0(){let t=He();return t&&t[ti].sanitizer}var Lf=class{};var wM="h",TM="b";var CM=(t,e,n)=>null;function Lp(t,e,n=!1){return CM(t,e,n)}var Bf=class{},al=class{};function DM(t){let e=Error(`No component factory found for ${tn(t)}.`);return e[EM]=t,e}var EM="ngComponent";var jf=class{resolveComponentFactory(e){throw DM(e)}},Ml=(()=>{let e=class e{};e.NULL=new jf;let t=e;return t})();function SM(){return Ts(wn(),He())}function Ts(t,e){return new dn(Gn(t,e))}var dn=(()=>{let e=class e{constructor(r){this.nativeElement=r}};e.__NG_ELEMENT_ID__=SM;let t=e;return t})();function AM(t){return t instanceof dn?t.nativeElement:t}var Za=class{},_o=(()=>{let e=class e{constructor(){this.destroyNode=null}};e.__NG_ELEMENT_ID__=()=>IM();let t=e;return t})();function IM(){let t=He(),e=wn(),n=Ai(e.index,t);return(Ti(n)?n:t)[At]}var MM=(()=>{let e=class e{};e.\u0275prov=se({token:e,providedIn:"root",factory:()=>null});let t=e;return t})(),pf={};function A0(t){return OM(t)?Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t:!1}function NM(t,e){if(Array.isArray(t))for(let n=0;ne,qf=class{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||FM}forEachItem(e){let n;for(n=this._itHead;n!==null;n=n._next)e(n)}forEachOperation(e){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){let s=!r||n&&n.currentIndex{s=this._trackByFn(i,a),n===null||!Object.is(n.trackById,s)?(n=this._mismatch(n,a,s,i),r=!0):(r&&(n=this._verifyReinsertion(n,a,s,i)),Object.is(n.item,a)||this._addIdentityChange(n,a)),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,n,r,i){let o;return e===null?o=this._itTail:(o=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._reinsertAfter(e,o,i)):(e=this._linkedRecords===null?null:this._linkedRecords.get(r,i),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._moveAfter(e,o,i)):e=this._addAfter(new $f(n,r),o,i)),e}_verifyReinsertion(e,n,r,i){let o=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null);return o!==null?e=this._reinsertAfter(o,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;e!==null;){let n=e._next;this._addToRemovals(this._unlink(e)),e=n}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,n,r){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let i=e._prevRemoved,o=e._nextRemoved;return i===null?this._removalsHead=o:i._nextRemoved=o,o===null?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(e,n,r),this._addToMoves(e,r),e}_moveAfter(e,n,r){return this._unlink(e),this._insertAfter(e,n,r),this._addToMoves(e,r),e}_addAfter(e,n,r){return this._insertAfter(e,n,r),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,n,r){let i=n===null?this._itHead:n._next;return e._next=i,e._prev=n,i===null?this._itTail=e:i._prev=e,n===null?this._itHead=e:n._next=e,this._linkedRecords===null&&(this._linkedRecords=new cl),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let n=e._prev,r=e._next;return n===null?this._itHead=r:n._next=r,r===null?this._itTail=n:r._prev=n,e}_addToMoves(e,n){return e.previousIndex===n||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new cl),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,n){return e.item=n,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},$f=class{constructor(e,n){this.item=e,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}},Hf=class{constructor(){this._head=null,this._tail=null}add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,n){let r;for(r=this._head;r!==null;r=r._nextDup)if((n===null||n<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){let n=e._prevDup,r=e._nextDup;return n===null?this._head=r:n._nextDup=r,r===null?this._tail=n:r._prevDup=n,this._head===null}},cl=class{constructor(){this.map=new Map}put(e){let n=e.trackById,r=this.map.get(n);r||(r=new Hf,this.map.set(n,r)),r.add(e)}get(e,n){let r=e,i=this.map.get(r);return i?i.get(e,n):null}remove(e){let n=e.trackById;return this.map.get(n).remove(e)&&this.map.delete(n),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function Pv(t,e,n){let r=t.previousIndex;if(r===null)return r;let i=0;return n&&r{let e=class e{constructor(r){this.factories=r}static create(r,i){if(i!=null){let o=i.factories.slice();r=r.concat(o)}return new e(r)}static extend(r){return{provide:e,useFactory:i=>e.create(r,i||Vv()),deps:[[e,new Ap,new Dl]]}}find(r){let i=this.factories.find(o=>o.supports(r));if(i!=null)return i;throw new ie(901,!1)}};e.\u0275prov=se({token:e,providedIn:"root",factory:Vv});let t=e;return t})();function ul(t,e,n,r,i=!1){for(;n!==null;){let o=e[n.index];o!==null&&r.push(Nr(o)),dr(o)&&kM(o,r);let s=n.type;if(s&8)ul(t,e,n.child,r);else if(s&32){let a=Fp(n,e),c;for(;c=a();)r.push(c)}else if(s&16){let a=b0(e,n);if(Array.isArray(a))r.push(...a);else{let c=kp(e[lr]);ul(c[Te],c,a,r,!0)}}n=i?n.projectionNext:n.next}return r}function kM(t,e){for(let n=kn;n{za(t.lView)},consumerOnSignalRead(){this.lView[so]=this}}),BM="ngOriginalError";function mf(t){return t[BM]}var Or=class{constructor(){this._console=console}handleError(e){let n=this._findOriginalError(e);this._console.error("ERROR",e),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(e){let n=e&&mf(e);for(;n&&mf(n);)n=mf(n);return n||null}},M0=new le("",{providedIn:"root",factory:()=>J(Or).handleError.bind(void 0)});var N0=!1,jM=new le("",{providedIn:"root",factory:()=>N0});var Mi={};function ee(t){O0(Zt(),He(),yo()+t,!1)}function O0(t,e,n,r){if(!r)if((e[he]&3)===3){let o=t.preOrderCheckHooks;o!==null&&Hu(e,o,n)}else{let o=t.preOrderHooks;o!==null&&Gu(e,o,0,n)}co(n)}function ve(t,e=we.Default){let n=He();if(n===null)return ce(t,e);let r=wn();return Z_(r,n,un(t),e)}function F0(){let t="invalid";throw new Error(t)}function UM(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let r=0;rMr&&O0(t,e,Mr,!1),Er(s?2:0,i),n(r,i)}finally{co(o),Er(s?3:1,i)}}function jp(t,e,n){if(yp(e)){let r=On(null);try{let i=e.directiveStart,o=e.directiveEnd;for(let s=i;snull;function zM(t,e,n,r){let i=$0(e);i.push(n),t.firstCreatePass&&H0(t).push(r,i.length-1)}function YM(t,e,n,r,i,o){let s=e?e.injectorIndex:-1,a=0;return O_()&&(a|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,attrs:o,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function Lv(t,e,n,r){for(let i in t)if(t.hasOwnProperty(i)){n=n===null?{}:n;let o=t[i];r===null?Bv(n,e,i,o):r.hasOwnProperty(i)&&Bv(n,e,r[i],o)}return n}function Bv(t,e,n,r){t.hasOwnProperty(n)?t[n].push(e,r):t[n]=[e,r]}function ZM(t,e,n){let r=e.directiveStart,i=e.directiveEnd,o=t.data,s=e.attrs,a=[],c=null,u=null;for(let l=r;l0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function eN(t,e,n,r){let i=n.directiveStart,o=n.directiveEnd;_l(n)&&aN(e,n,t.data[i+n.componentOffset]),t.firstCreatePass||tl(n,e),Ei(r,e);let s=n.initialInputs;for(let a=i;a-1&&(Pf(e,r),nl(n,r))}this._attachedToViewContainer=!1}y0(this._lView[Te],this._lView)}onDestroy(e){M_(this._lView,e)}markForCheck(){Wp(this._cdRefInjectingView||this._lView)}detach(){this._lView[he]&=-129}reattach(){Sf(this._lView),this._lView[he]|=128}detectChanges(){this._lView[he]|=1024,fN(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ie(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,eM(this._lView[Te],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new ie(902,!1);this._appRef=e,Sf(this._lView)}},zn=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=_N;let t=e;return t})();function _N(t){return xN(wn(),He(),(t&16)===16)}function xN(t,e,n){if(_l(t)&&!n){let r=Ai(t.index,e);return new ho(r,r)}else if(t.type&47){let r=e[lr];return new ho(r,e)}return null}var Q0=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=bN,e.__NG_ENV_ID__=r=>r;let t=e;return t})(),Yf=class extends Q0{constructor(e){super(),this._lView=e}onDestroy(e){return M_(this._lView,e),()=>RA(this._lView,e)}};function bN(){return new Yf(He())}var jv=new Set;function zp(t){jv.has(t)||(jv.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var Zf=class extends vn{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,n,r){let i=e,o=n||(()=>null),s=r;if(e&&typeof e=="object"){let c=e;i=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=gf(o),i&&(i=gf(i)),s&&(s=gf(s)));let a=super.subscribe({next:i,error:o,complete:s});return e instanceof St&&e.add(a),a}};function gf(t){return e=>{setTimeout(t,void 0,e)}}var Le=Zf;function Uv(...t){}function wN(){let t=typeof ln.requestAnimationFrame=="function",e=ln[t?"requestAnimationFrame":"setTimeout"],n=ln[t?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&e&&n){let r=e[Zone.__symbol__("OriginalDelegate")];r&&(e=r);let i=n[Zone.__symbol__("OriginalDelegate")];i&&(n=i)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:n}}var ct=class t{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Le(!1),this.onMicrotaskEmpty=new Le(!1),this.onStable=new Le(!1),this.onError=new Le(!1),typeof Zone>"u")throw new ie(908,!1);Zone.assertZonePatched();let i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&n,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=wN().nativeRequestAnimationFrame,DN(i)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get("isAngularZone")===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new ie(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new ie(909,!1)}run(e,n,r){return this._inner.run(e,n,r)}runTask(e,n,r,i){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,TN,Uv,Uv);try{return o.runTask(s,n,r)}finally{o.cancelTask(s)}}runGuarded(e,n,r){return this._inner.runGuarded(e,n,r)}runOutsideAngular(e){return this._outer.run(e)}},TN={};function Yp(t){if(t._nesting==0&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function CN(t){t.isCheckStableRunning||t.lastRequestAnimationFrameId!==-1||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(ln,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Qf(t),t.isCheckStableRunning=!0,Yp(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Qf(t))}function DN(t){let e=()=>{CN(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,i,o,s,a)=>{if(EN(a))return n.invokeTask(i,o,s,a);try{return qv(t),n.invokeTask(i,o,s,a)}finally{(t.shouldCoalesceEventChangeDetection&&o.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),$v(t)}},onInvoke:(n,r,i,o,s,a,c)=>{try{return qv(t),n.invoke(i,o,s,a,c)}finally{t.shouldCoalesceRunChangeDetection&&e(),$v(t)}},onHasTask:(n,r,i,o)=>{n.hasTask(i,o),r===i&&(o.change=="microTask"?(t._hasPendingMicrotasks=o.microTask,Qf(t),Yp(t)):o.change=="macroTask"&&(t.hasPendingMacrotasks=o.macroTask))},onHandleError:(n,r,i,o)=>(n.handleError(i,o),t.runOutsideAngular(()=>t.onError.emit(o)),!1)})}function Qf(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.lastRequestAnimationFrameId!==-1?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function qv(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function $v(t){t._nesting--,Yp(t)}var Kf=class{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Le,this.onMicrotaskEmpty=new Le,this.onStable=new Le,this.onError=new Le}run(e,n,r){return e.apply(n,r)}runGuarded(e,n,r){return e.apply(n,r)}runOutsideAngular(e){return e()}runTask(e,n,r,i){return e.apply(n,r)}};function EN(t){return!Array.isArray(t)||t.length!==1?!1:t[0].data?.__ignore_ng_zone__===!0}function SN(t="zone.js",e){return t==="noop"?new Kf:t==="zone.js"?new ct(e):t}var cs=function(t){return t[t.EarlyRead=0]="EarlyRead",t[t.Write=1]="Write",t[t.MixedReadWrite=2]="MixedReadWrite",t[t.Read=3]="Read",t}(cs||{}),AN={destroy(){}};function Zp(t,e){!e&&PI(Zp);let n=e?.injector??J(Wn);if(!BI(n))return AN;zp("NgAfterNextRender");let r=n.get(K0),i=r.handler??=new Jf,o=e?.phase??cs.MixedReadWrite,s=()=>{i.unregister(c),a()},a=n.get(Q0).onDestroy(s),c=new Xf(n,o,()=>{s(),t()});return i.register(c),{destroy:s}}var Xf=class{constructor(e,n,r){this.phase=n,this.callbackFn=r,this.zone=e.get(ct),this.errorHandler=e.get(Or,null,{optional:!0})}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(e){this.errorHandler?.handleError(e)}}},Jf=class{constructor(){this.executingCallbacks=!1,this.buckets={[cs.EarlyRead]:new Set,[cs.Write]:new Set,[cs.MixedReadWrite]:new Set,[cs.Read]:new Set},this.deferredCallbacks=new Set}validateBegin(){if(this.executingCallbacks)throw new ie(102,!1)}register(e){(this.executingCallbacks?this.deferredCallbacks:this.buckets[e.phase]).add(e)}unregister(e){this.buckets[e.phase].delete(e),this.deferredCallbacks.delete(e)}execute(){this.executingCallbacks=!0;for(let e of Object.values(this.buckets))for(let n of e)n.invoke();this.executingCallbacks=!1;for(let e of this.deferredCallbacks)this.buckets[e.phase].add(e);this.deferredCallbacks.clear()}destroy(){for(let e of Object.values(this.buckets))e.clear();this.deferredCallbacks.clear()}},K0=(()=>{let e=class e{constructor(){this.renderDepth=0,this.handler=null,this.internalCallbacks=[]}begin(){this.handler?.validateBegin(),this.renderDepth++}end(){if(this.renderDepth--,this.renderDepth===0){for(let r of this.internalCallbacks)r();this.internalCallbacks.length=0,this.handler?.execute()}}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}};e.\u0275prov=se({token:e,providedIn:"root",factory:()=>new e});let t=e;return t})();function IN(t,e){let n=Ai(e,t),r=n[Te];MN(r,n);let i=n[ri];i!==null&&n[Ha]===null&&(n[Ha]=Lp(i,n[fs])),Qp(r,n,n[ur])}function MN(t,e){for(let n=e.length;n0&&T0(t,n,o.join(" "))}}function LN(t,e,n){let r=t.projection=[];for(let i=0;i=0;r--){let i=t[r];i.hostVars=e+=i.hostVars,i.hostAttrs=$a(i.hostAttrs,n=$a(n,i.hostAttrs))}}function Uu(t){return t===hs?{}:t===$n?[]:t}function qN(t,e){let n=t.viewQuery;n?t.viewQuery=(r,i)=>{e(r,i),n(r,i)}:t.viewQuery=e}function $N(t,e){let n=t.contentQueries;n?t.contentQueries=(r,i,o)=>{e(r,i,o),n(r,i,o)}:t.contentQueries=e}function HN(t,e){let n=t.hostBindings;n?t.hostBindings=(r,i)=>{e(r,i),n(r,i)}:t.hostBindings=e}function Kp(t){let e=t.inputConfig,n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r];Array.isArray(i)&&i[2]&&(n[r]=i[2])}t.inputTransforms=n}function fo(t,e,n){let r=t[e];return Object.is(r,n)?!1:(t[e]=n,!0)}function GN(t,e,n,r){let i=fo(t,e,n);return fo(t,e+1,r)||i}function xo(t,e,n,r){let i=He(),o=bl();if(fo(i,o,e)){let s=Zt(),a=Cp();cN(a,i,t,e,n,r)}return xo}function WN(t,e,n,r){return fo(t,bl(),n)?e+ds(n)+r:Mi}function zN(t,e,n,r,i,o){let s=qA(),a=GN(t,s,n,i);return k_(2),a?e+ds(n)+r+ds(i)+o:Mi}function qu(t,e){return t<<17|e<<2}function po(t){return t>>17&32767}function YN(t){return(t&2)==2}function ZN(t,e){return t&131071|e<<17}function np(t){return t|2}function bs(t){return(t&131068)>>2}function yf(t,e){return t&-131069|e<<2}function QN(t){return(t&1)===1}function rp(t){return t|1}function KN(t,e,n,r,i,o){let s=o?e.classBindings:e.styleBindings,a=po(s),c=bs(s);t[r]=n;let u=!1,l;if(Array.isArray(n)){let d=n;l=d[1],(l===null||nc(d,l)>0)&&(u=!0)}else l=n;if(i)if(c!==0){let h=po(t[a+1]);t[r+1]=qu(h,a),h!==0&&(t[h+1]=yf(t[h+1],r)),t[a+1]=ZN(t[a+1],r)}else t[r+1]=qu(a,0),a!==0&&(t[a+1]=yf(t[a+1],r)),a=r;else t[r+1]=qu(c,0),a===0?a=r:t[c+1]=yf(t[c+1],r),c=r;u&&(t[r+1]=np(t[r+1])),Gv(t,l,r,!0,o),Gv(t,l,r,!1,o),XN(e,l,t,r,o),s=qu(a,c),o?e.classBindings=s:e.styleBindings=s}function XN(t,e,n,r,i){let o=i?t.residualClasses:t.residualStyles;o!=null&&typeof e=="string"&&nc(o,e)>=0&&(n[r+1]=rp(n[r+1]))}function Gv(t,e,n,r,i){let o=t[n+1],s=e===null,a=r?po(o):bs(o),c=!1;for(;a!==0&&(c===!1||s);){let u=t[a],l=t[a+1];JN(u,e)&&(c=!0,t[a+1]=r?rp(l):np(l)),a=r?po(l):bs(l)}c&&(t[n+1]=r?np(o):rp(o))}function JN(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?nc(t,e)>=0:!1}function ne(t,e,n){let r=He(),i=bl();if(fo(r,i,e)){let o=Zt(),s=Cp();V0(o,s,r,t,e,r[At],n,!1)}return ne}function Wv(t,e,n,r,i){let o=e.inputs,s=i?"class":"style";Gp(t,n,o[s],s,r)}function Fl(t,e,n){return X0(t,e,n,!1),Fl}function hr(t,e){return X0(t,e,null,!0),hr}function X0(t,e,n,r){let i=He(),o=Zt(),s=k_(2);if(o.firstUpdatePass&&tO(o,t,s,r),e!==Mi&&fo(i,s,e)){let a=o.data[yo()];sO(o,a,i,i[At],t,i[s+1]=aO(e,n),r,s)}}function eO(t,e){return e>=t.expandoStartIndex}function tO(t,e,n,r){let i=t.data;if(i[n+1]===null){let o=i[yo()],s=eO(t,n);cO(o,r)&&e===null&&!s&&(e=!1),e=nO(i,o,e,r),KN(i,o,e,n,s,r)}}function nO(t,e,n,r){let i=zA(t),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(n=vf(null,t,e,n,r),n=Qa(n,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==i)if(n=vf(i,t,e,n,r),o===null){let c=rO(t,e,r);c!==void 0&&Array.isArray(c)&&(c=vf(null,t,e,c[1],r),c=Qa(c,e.attrs,r),iO(t,e,r,c))}else o=oO(t,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),n}function rO(t,e,n){let r=n?e.classBindings:e.styleBindings;if(bs(r)!==0)return t[po(r)]}function iO(t,e,n,r){let i=n?e.classBindings:e.styleBindings;t[po(i)]=r}function oO(t,e,n){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o0;){let c=t[i],u=Array.isArray(c),l=u?c[1]:c,d=l===null,h=n[i+1];h===Mi&&(h=d?$n:void 0);let p=d?df(h,r):l===r?h:void 0;if(u&&!hl(p)&&(p=df(c,r)),hl(p)&&(a=p,s))return a;let y=t[i+1];i=s?po(y):bs(y)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=df(c,r))}return a}function hl(t){return t!==void 0}function aO(t,e){return t==null||t===""||(typeof e=="string"?t=t+e:typeof t=="object"&&(t=tn(ic(t)))),t}function cO(t,e){return(t.flags&(e?8:16))!==0}var R9=new RegExp(`^(\\d+)*(${TM}|${wM})*(.*)`);var uO=(t,e)=>null;function Yv(t,e){return uO(t,e)}function lO(t,e,n,r){let i=e.tView,s=t[he]&4096?4096:16,a=Nl(t,i,n,s,null,e,null,null,null,r?.injector??null,r?.dehydratedView??null),c=t[e.index];a[ec]=c;let u=t[Ar];return u!==null&&(a[Ar]=u.createEmbeddedView(i)),Qp(i,a,n),a}function Zv(t,e){return!e||e.firstChild===null||l0(t)}function dO(t,e,n,r=!0){let i=e[Te];if(nM(i,e,t,n),r){let s=Vf(n,t),a=e[At],c=Rp(a,t[ao]);c!==null&&JI(i,t[Pn],a,e,c,s)}let o=e[Ha];o!==null&&o.firstChild!==null&&(o.firstChild=null)}var Ni=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=hO;let t=e;return t})();function hO(){let t=wn();return ex(t,He())}var fO=Ni,J0=class extends fO{constructor(e,n,r){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=r}get element(){return Ts(this._hostTNode,this._hostLView)}get injector(){return new oo(this._hostTNode,this._hostLView)}get parentInjector(){let e=Dp(this._hostTNode,this._hostLView);if($_(e)){let n=el(e,this._hostLView),r=Ju(e),i=n[Te].data[r+8];return new oo(i,n)}else return new oo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=Qv(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-kn}createEmbeddedView(e,n,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=Yv(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(n||{},o,s);return this.insertImpl(a,i,Zv(this._hostTNode,s)),a}createComponent(e,n,r,i,o){let s=e&&!fI(e),a;if(s)a=n;else{let y=n||{};a=y.index,r=y.injector,i=y.projectableNodes,o=y.environmentInjector||y.ngModuleRef}let c=s?e:new xs(Ci(e)),u=r||this.parentInjector;if(!o&&c.ngModule==null){let v=(s?u:this.parentInjector).get(Rn,null);v&&(o=v)}let l=Ci(c.componentType??{}),d=Yv(this._lContainer,l?.id??null),h=d?.firstChild??null,p=c.create(u,i,h,o);return this.insertImpl(p.hostView,a,Zv(this._hostTNode,d)),p}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,r){let i=e._lView;if(OA(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[Ft],u=new J0(c,c[Pn],c[Ft]);u.detach(u.indexOf(e))}}let o=this._adjustIndex(n),s=this._lContainer;return dO(s,i,o,r),e.attachToViewContainerRef(),J_(_f(s),o,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=Qv(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),r=Pf(this._lContainer,n);r&&(nl(_f(this._lContainer),n),y0(r[Te],r))}detach(e){let n=this._adjustIndex(e,-1),r=Pf(this._lContainer,n);return r&&nl(_f(this._lContainer),n)!=null?new ho(r):null}_adjustIndex(e,n=0){return e??this.length+n}};function Qv(t){return t[Xu]}function _f(t){return t[Xu]||(t[Xu]=[])}function ex(t,e){let n,r=e[t.index];return dr(r)?n=r:(n=U0(r,e,null,t),e[t.index]=n,Ol(e,n)),mO(n,e,t,r),new J0(n,t,e)}function pO(t,e){let n=t[At],r=n.createComment(""),i=Gn(e,t),o=Rp(n,i);return ol(n,o,r,cM(n,i),!1),r}var mO=vO,gO=(t,e,n)=>!1;function yO(t,e,n){return gO(t,e,n)}function vO(t,e,n,r){if(t[ao])return;let i;n.type&8?i=Nr(r):i=pO(e,n),t[ao]=i}function _O(t,e,n,r,i,o,s,a,c){let u=e.consts,l=Cs(e,t,4,s||null,ys(u,a));Hp(e,n,l,ys(u,c)),Cl(e,l);let d=l.tView=$p(2,l,r,i,o,e.directiveRegistry,e.pipeRegistry,null,e.schemas,u,null);return e.queries!==null&&(e.queries.template(e,l),d.queries=e.queries.embeddedTView(l)),l}function Re(t,e,n,r,i,o,s,a){let c=He(),u=Zt(),l=t+Mr,d=u.firstCreatePass?_O(l,u,c,e,n,r,i,o,s):u.data[l];go(d,!1);let h=xO(u,c,d,t);wl()&&Al(u,c,h,d),Ei(h,c);let p=U0(h,c,h,d);return c[l]=p,Ol(c,p),yO(p,d,c),xl(d)&&Up(u,c,d),s!=null&&qp(c,d,a),Re}var xO=bO;function bO(t,e,n,r){return Tl(!0),e[At].createComment("")}function wO(t,e,n,r,i,o){let s=e.consts,a=ys(s,i),c=Cs(e,t,2,r,a);return Hp(e,n,c,ys(s,o)),c.attrs!==null&&ll(c,c.attrs,!1),c.mergedAttrs!==null&&ll(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}function Ee(t,e,n,r){let i=He(),o=Zt(),s=Mr+t,a=i[At],c=o.firstCreatePass?wO(s,o,i,e,n,r):o.data[s],u=TO(o,i,c,a,e,t);i[s]=u;let l=xl(c);return go(c,!0),C0(a,u,c),(c.flags&32)!==32&&wl()&&Al(o,i,u,c),PA()===0&&Ei(u,i),VA(),l&&(Up(o,i,c),jp(o,c,i)),r!==null&&qp(i,c),Ee}function Se(){let t=wn();_p()?xp():(t=t.parent,go(t,!1));let e=t;BA(e)&&jA(),LA();let n=Zt();return n.firstCreatePass&&(Cl(n,t),yp(t)&&n.queries.elementEnd(t)),e.classesWithoutHost!=null&&eI(e)&&Wv(n,e,He(),e.classesWithoutHost,!0),e.stylesWithoutHost!=null&&tI(e)&&Wv(n,e,He(),e.stylesWithoutHost,!1),Se}function Be(t,e,n,r){return Ee(t,e,n,r),Se(),Be}var TO=(t,e,n,r,i,o)=>(Tl(!0),m0(r,i,QA()));function CO(t,e,n,r,i){let o=e.consts,s=ys(o,r),a=Cs(e,t,8,"ng-container",s);s!==null&&ll(a,s,!0);let c=ys(o,i);return Hp(e,n,a,c),e.queries!==null&&e.queries.elementStart(e,a),a}function ze(t,e,n){let r=He(),i=Zt(),o=t+Mr,s=i.firstCreatePass?CO(o,i,r,e,n):i.data[o];go(s,!0);let a=DO(i,r,s,t);return r[o]=a,wl()&&Al(i,r,a,s),Ei(a,r),xl(s)&&(Up(i,r,s),jp(i,s,r)),n!=null&&qp(r,s),ze}function Ye(){let t=wn(),e=Zt();return _p()?xp():(t=t.parent,go(t,!1)),e.firstCreatePass&&(Cl(e,t),yp(t)&&e.queries.elementEnd(t)),Ye}var DO=(t,e,n,r)=>(Tl(!0),KI(e[At],""));function It(){return He()}function Xp(t,e,n){let r=He(),i=bl();if(fo(r,i,e)){let o=Zt(),s=Cp();V0(o,s,r,t,e,r[At],n,!0)}return Xp}var fl="en-US";var EO=fl;function SO(t){Z1(t,"Expected localeId to be defined"),typeof t=="string"&&(EO=t.toLowerCase().replace(/_/g,"-"))}function bo(t){return!!t&&typeof t.then=="function"}function tx(t){return!!t&&typeof t.subscribe=="function"}function Pe(t,e,n,r){let i=He(),o=Zt(),s=wn();return IO(o,i,i[At],s,t,e,r),Pe}function AO(t,e,n,r){let i=t.cleanup;if(i!=null)for(let o=0;oc?a[c]:null}typeof s=="string"&&(o+=2)}return null}function IO(t,e,n,r,i,o,s){let a=xl(r),u=t.firstCreatePass&&H0(t),l=e[ur],d=$0(e),h=!0;if(r.type&3||s){let v=Gn(r,e),_=s?s(v):v,x=d.length,M=s?L=>s(Nr(L[r.index])):r.index,I=null;if(!s&&a&&(I=AO(t,e,i,r.index)),I!==null){let L=I.__ngLastListenerFn__||I;L.__ngNextListenerFn__=o,I.__ngLastListenerFn__=o,h=!1}else{o=Xv(r,e,l,o,!1);let L=n.listen(_,i,o);d.push(o,L),u&&u.push(i,M,x,x+1)}}else o=Xv(r,e,l,o,!1);let p=r.outputs,y;if(h&&p!==null&&(y=p[i])){let v=y.length;if(v)for(let _=0;_-1?Ai(t.index,e):e;Wp(a);let c=Kv(e,n,r,s),u=o.__ngNextListenerFn__;for(;u;)c=Kv(e,n,u,s)&&c,u=u.__ngNextListenerFn__;return i&&c===!1&&s.preventDefault(),c}}function re(t=1){return ZA(t)}function MO(t,e){let n=null,r=fA(t);for(let i=0;i(Tl(!0),ZI(e[At],r));function oc(t){return _t("",t,""),oc}function _t(t,e,n){let r=He(),i=WN(r,t,e,n);return i!==Mi&&W0(r,yo(),i),_t}function Jp(t,e,n,r,i){let o=He(),s=zN(o,t,e,n,r,i);return s!==Mi&&W0(o,yo(),s),Jp}function OO(t,e,n){let r=Zt();if(r.firstCreatePass){let i=Di(t);ip(n,r.data,r.blueprint,i,!0),ip(e,r.data,r.blueprint,i,!1)}}function ip(t,e,n,r,i){if(t=un(t),Array.isArray(t))for(let o=0;o>20;if(_s(t)||!t.multi){let p=new uo(u,i,ve),y=bf(c,e,i?l:l+h,d);y===-1?(Mf(tl(a,s),o,c),xf(o,t,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(p),s.push(p)):(n[y]=p,s[y]=p)}else{let p=bf(c,e,l+h,d),y=bf(c,e,l,l+h),v=p>=0&&n[p],_=y>=0&&n[y];if(i&&!_||!i&&!v){Mf(tl(a,s),o,c);let x=RO(i?kO:FO,n.length,i,r,u);!i&&_&&(n[y].providerFactory=x),xf(o,t,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(x),s.push(x)}else{let x=ix(n[i?y:p],u,!i&&r);xf(o,t,p>-1?p:y,x)}!i&&r&&_&&n[y].componentProviders++}}}function xf(t,e,n,r){let i=_s(e),o=II(e);if(i||o){let c=(o?un(e.useClass):e).prototype.ngOnDestroy;if(c){let u=t.destroyHooks||(t.destroyHooks=[]);if(!i&&e.multi){let l=u.indexOf(n);l===-1?u.push(n,[r,c]):u[l+1].push(r,c)}else u.push(n,c)}}}function ix(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function bf(t,e,n,r){for(let i=n;i{n.providersResolver=(r,i)=>OO(r,i?i(t):t,e)}}var Si=class{},Ka=class{};var pl=class extends Si{constructor(e,n,r){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new dl(this);let i=v_(e);this._bootstrapComponents=u0(i.bootstrap),this._r3Injector=a0(e,n,[{provide:Si,useValue:this},{provide:Ml,useValue:this.componentFactoryResolver},...r],tn(e),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(e)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},ml=class extends Ka{constructor(e){super(),this.moduleType=e}create(e){return new pl(this.moduleType,e,[])}};function PO(t,e,n){return new pl(t,e,n)}var sp=class extends Si{constructor(e){super(),this.componentFactoryResolver=new dl(this),this.instance=null;let n=new Ya([...e.providers,{provide:Si,useValue:this},{provide:Ml,useValue:this.componentFactoryResolver}],e.parent||Mp(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function kl(t,e,n=null){return new sp({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var VO=(()=>{let e=class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){let i=r0(!1,r.type),o=i.length>0?kl([i],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,o)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(let r of this.cachedInjectors.values())r!==null&&r.destroy()}finally{this.cachedInjectors.clear()}}};e.\u0275prov=se({token:e,providedIn:"environment",factory:()=>new e(ce(Rn))});let t=e;return t})();function pt(t){zp("NgStandalone"),t.getStandaloneInjector=e=>e.get(VO).getOrCreateStandaloneInjector(t)}function LO(){return this._results[Symbol.iterator]()}var ap=class t{get changes(){return this._changes??=new Le}constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;let n=t.prototype;n[Symbol.iterator]||(n[Symbol.iterator]=LO)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,n){return this._results.reduce(e,n)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,n){this.dirty=!1;let r=mI(e);(this._changesDetected=!pI(this._results,r,n))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}},mo=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=UO;let t=e;return t})(),BO=mo,jO=class extends BO{constructor(e,n,r){super(),this._declarationLView=e,this._declarationTContainer=n,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,n){return this.createEmbeddedViewImpl(e,n)}createEmbeddedViewImpl(e,n,r){let i=lO(this._declarationLView,this._declarationTContainer,e,{injector:n,dehydratedView:r});return new ho(i)}};function UO(){return tm(wn(),He())}function tm(t,e){return t.type&4?new jO(e,t,Ts(t,e)):null}var cp=class t{constructor(e){this.queryList=e,this.matches=null}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},up=class t{constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let r=e.contentQueries!==null?e.contentQueries[0]:n.length,i=[];for(let o=0;o0)r.push(s[a/2]);else{let u=o[a+1],l=e[-c];for(let d=kn;d{let e=class e{log(r){console.log(r)}warn(r){console.warn(r)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"platform"});let t=e;return t})(),pp=class{constructor(e,n){this.ngModuleFactory=e,this.componentFactories=n}},Pl=(()=>{let e=class e{compileModuleSync(r){return new ml(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){let i=this.compileModuleSync(r),o=v_(r),s=u0(o.declarations).reduce((a,c)=>{let u=Ci(c);return u&&a.push(new xs(u)),a},[]);return new pp(i,s)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),QO=new le("compilerOptions");var Vl=(()=>{let e=class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Yt(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var im=new le(""),sc=new le(""),Ll=(()=>{let e=class e{constructor(r,i,o){this._ngZone=r,this.registry=i,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,om||(KO(o),o.addToWindow(i)),this._watchAngularEvents(),r.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{ct.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&this._pendingCount===0&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let r=this._callbacks.pop();clearTimeout(r.timeoutId),r.doneCb(this._didWork)}this._didWork=!1});else{let r=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>i.updateCb&&i.updateCb(r)?(clearTimeout(i.timeoutId),!1):!0),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(r=>({source:r.source,creationLocation:r.creationLocation,data:r.data})):[]}addCallback(r,i,o){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(a=>a.timeoutId!==s),r(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:r,timeoutId:s,updateCb:o})}whenStable(r,i,o){if(o&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(r,i,o),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(r){this.registry.registerApplication(r,this)}unregisterApplication(r){this.registry.unregisterApplication(r)}findProviders(r,i,o){return[]}};e.\u0275fac=function(i){return new(i||e)(ce(ct),ce(Bl),ce(sc))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),Bl=(()=>{let e=class e{constructor(){this._applications=new Map}registerApplication(r,i){this._applications.set(r,i)}unregisterApplication(r){this._applications.delete(r)}unregisterAllApplications(){this._applications.clear()}getTestability(r){return this._applications.get(r)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(r,i=!0){return om?.findTestabilityInTree(this,r,i)??null}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"platform"});let t=e;return t})();function KO(t){om=t}var om,jl=new le("Application Initializer"),cx=(()=>{let e=class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=J(jl,{optional:!0})??[]}runInitializers(){if(this.initialized)return;let r=[];for(let o of this.appInits){let s=o();if(bo(s))r.push(s);else if(tx(s)){let a=new Promise((c,u)=>{s.subscribe({complete:c,error:u})});r.push(a)}}let i=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{i()}).catch(o=>{this.reject(o)}),r.length===0&&i(),this.initialized=!0}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),sm=new le("appBootstrapListener");function XO(t,e,n){let r=new ml(n);return Promise.resolve(r)}function JO(){$y(()=>{throw new ie(600,!1)})}function eF(t){return t.isBoundToModule}function tF(t,e,n){try{let r=n();return bo(r)?r.catch(i=>{throw e.runOutsideAngular(()=>t.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>t.handleError(r)),r}}function ux(t,e){return Array.isArray(e)?e.reduce(ux,t):T(T({},t),e)}var Es=(()=>{let e=class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=J(M0),this.componentTypes=[],this.components=[],this.isStable=J(Vl).hasPendingTasks.pipe(Oe(r=>!r)),this._injector=J(Rn)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,i){let o=r instanceof al;if(!this._injector.get(cx).done){let y="Cannot bootstrap as there are still asynchronous initializers running."+(!o&&y_(r)?"":" Bootstrap components in the `ngDoBootstrap` method of the root module.");throw new ie(405,!1)}let a;o?a=r:a=this._injector.get(Ml).resolveComponentFactory(r),this.componentTypes.push(a.componentType);let c=eF(a)?void 0:this._injector.get(Si),u=i||a.selector,l=a.create(Wn.NULL,[],u,c),d=l.location.nativeElement,h=l.injector.get(im,null);return h?.registerApplication(d),l.onDestroy(()=>{this.detachView(l.hostView),Zu(this.components,l),h?.unregisterApplication(d)}),this._loadComponent(l),l}tick(){if(this._runningTick)throw new ie(101,!1);try{this._runningTick=!0;for(let r of this._views)r.detectChanges()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1}}attachView(r){let i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){let i=r;Zu(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);let i=this._injector.get(sm,[]);[...this._bootstrapListeners,...i].forEach(o=>o(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>Zu(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new ie(406,!1);let r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Zu(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function Jv(t){for(let e=t.length-1;e>=0;e--)if(t[e]!==void 0)return t[e]}var nF=(()=>{let e=class e{constructor(){this.zone=J(ct),this.applicationRef=J(Es)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function rF(t){return[{provide:ct,useFactory:t},{provide:vs,multi:!0,useFactory:()=>{let e=J(nF,{optional:!0});return()=>e.initialize()}},{provide:vs,multi:!0,useFactory:()=>{let e=J(sF);return()=>{e.initialize()}}},{provide:M0,useFactory:iF}]}function iF(){let t=J(ct),e=J(Or);return n=>t.runOutsideAngular(()=>e.handleError(n))}function oF(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}var sF=(()=>{let e=class e{constructor(){this.subscription=new St,this.initialized=!1,this.zone=J(ct),this.pendingTasks=J(Vl)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{ct.assertNotInAngularZone(),queueMicrotask(()=>{r!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{ct.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function aF(){return typeof $localize<"u"&&$localize.locale||fl}var am=new le("LocaleId",{providedIn:"root",factory:()=>J(am,we.Optional|we.SkipSelf)||aF()});var lx=new le("PlatformDestroyListeners"),dx=(()=>{let e=class e{constructor(r){this._injector=r,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(r,i){let o=SN(i?.ngZone,oF({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}));return o.run(()=>{let s=PO(r.moduleType,this.injector,rF(()=>o)),a=s.injector.get(Or,null);return o.runOutsideAngular(()=>{let c=o.onError.subscribe({next:u=>{a.handleError(u)}});s.onDestroy(()=>{Zu(this._modules,s),c.unsubscribe()})}),tF(a,o,()=>{let c=s.injector.get(cx);return c.runInitializers(),c.donePromise.then(()=>{let u=s.injector.get(am,fl);return SO(u||fl),this._moduleDoBootstrap(s),s})})})}bootstrapModule(r,i=[]){let o=ux({},i);return XO(this.injector,o,r).then(s=>this.bootstrapModuleFactory(s,o))}_moduleDoBootstrap(r){let i=r.injector.get(Es);if(r._bootstrapComponents.length>0)r._bootstrapComponents.forEach(o=>i.bootstrap(o));else if(r.instance.ngDoBootstrap)r.instance.ngDoBootstrap(i);else throw new ie(-403,!1);this._modules.push(r)}onDestroy(r){this._destroyListeners.push(r)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new ie(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());let r=this._injector.get(lx,null);r&&(r.forEach(i=>i()),r.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}};e.\u0275fac=function(i){return new(i||e)(ce(Wn))},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"platform"});let t=e;return t})(),Ua=null,hx=new le("AllowMultipleToken");function cF(t){if(Ua&&!Ua.get(hx,!1))throw new ie(400,!1);JO(),Ua=t;let e=t.get(dx);return dF(t),e}function cm(t,e,n=[]){let r=`Platform: ${e}`,i=new le(r);return(o=[])=>{let s=fx();if(!s||s.injector.get(hx,!1)){let a=[...n,...o,{provide:i,useValue:!0}];t?t(a):cF(uF(a,r))}return lF(i)}}function uF(t=[],e){return Wn.create({name:e,providers:[{provide:El,useValue:"platform"},{provide:lx,useValue:new Set([()=>Ua=null])},...t]})}function lF(t){let e=fx();if(!e)throw new ie(401,!1);return e}function fx(){return Ua?.get(dx)??null}function dF(t){t.get(Np,null)?.forEach(n=>n())}var px=cm(null,"core",[]),mx=(()=>{let e=class e{constructor(r){}};e.\u0275fac=function(i){return new(i||e)(ce(Es))},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({});let t=e;return t})();function wo(t){return typeof t=="boolean"?t:t!=null&&t!=="false"}function gx(t){let e=Ci(t);if(!e)return null;let n=new xs(e);return{get selector(){return n.selector},get type(){return n.componentType},get inputs(){return n.inputs},get outputs(){return n.outputs},get ngContentSelectors(){return n.ngContentSelectors},get isStandalone(){return e.standalone},get isSignal(){return e.signals}}}var um=null;function Fr(){return um}function bx(t){um||(um=t)}var Ul=class{},hn=new le("DocumentToken"),pm=(()=>{let e=class e{historyGo(r){throw new Error("Not implemented")}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(hF))(),providedIn:"platform"});let t=e;return t})(),wx=new le("Location Initialized"),hF=(()=>{let e=class e extends pm{constructor(){super(),this._doc=J(hn),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fr().getBaseHref(this._doc)}onPopState(r){let i=Fr().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",r,!1),()=>i.removeEventListener("popstate",r)}onHashChange(r){let i=Fr().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",r,!1),()=>i.removeEventListener("hashchange",r)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(r){this._location.pathname=r}pushState(r,i,o){this._history.pushState(r,i,o)}replaceState(r,i,o){this._history.replaceState(r,i,o)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>new e)(),providedIn:"platform"});let t=e;return t})();function mm(t,e){if(t.length==0)return e;if(e.length==0)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,n==2?t+e.substring(1):n==1?t+e:t+"/"+e}function yx(t){let e=t.match(/#|\?|$/),n=e&&e.index||t.length,r=n-(t[n-1]==="/"?1:0);return t.slice(0,r)+t.slice(n)}function oi(t){return t&&t[0]!=="?"?"?"+t:t}var si=(()=>{let e=class e{historyGo(r){throw new Error("Not implemented")}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(gm))(),providedIn:"root"});let t=e;return t})(),Tx=new le("appBaseHref"),gm=(()=>{let e=class e extends si{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??J(hn).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return mm(this._baseHref,r)}path(r=!1){let i=this._platformLocation.pathname+oi(this._platformLocation.search),o=this._platformLocation.hash;return o&&r?`${i}${o}`:i}pushState(r,i,o,s){let a=this.prepareExternalUrl(o+oi(s));this._platformLocation.pushState(r,i,a)}replaceState(r,i,o,s){let a=this.prepareExternalUrl(o+oi(s));this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}};e.\u0275fac=function(i){return new(i||e)(ce(pm),ce(Tx,8))},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Cx=(()=>{let e=class e extends si{constructor(r,i){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],i!=null&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){let i=this._platformLocation.hash;return i==null&&(i="#"),i.length>0?i.substring(1):i}prepareExternalUrl(r){let i=mm(this._baseHref,r);return i.length>0?"#"+i:i}pushState(r,i,o,s){let a=this.prepareExternalUrl(o+oi(s));a.length==0&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,i,a)}replaceState(r,i,o,s){let a=this.prepareExternalUrl(o+oi(s));a.length==0&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}};e.\u0275fac=function(i){return new(i||e)(ce(pm),ce(Tx,8))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),Ss=(()=>{let e=class e{constructor(r){this._subject=new Le,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;let i=this._locationStrategy.getBaseHref();this._basePath=mF(yx(vx(i))),this._locationStrategy.onPopState(o=>{this._subject.emit({url:this.path(!0),pop:!0,state:o.state,type:o.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,i=""){return this.path()==this.normalize(r+oi(i))}normalize(r){return e.stripTrailingSlash(pF(this._basePath,vx(r)))}prepareExternalUrl(r){return r&&r[0]!=="/"&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,i="",o=null){this._locationStrategy.pushState(o,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+oi(i)),o)}replaceState(r,i="",o=null){this._locationStrategy.replaceState(o,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+oi(i)),o)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)})),()=>{let i=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(i,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",i){this._urlChangeListeners.forEach(o=>o(r,i))}subscribe(r,i,o){return this._subject.subscribe({next:r,error:i,complete:o})}};e.normalizeQueryParams=oi,e.joinWithSlash=mm,e.stripTrailingSlash=yx,e.\u0275fac=function(i){return new(i||e)(ce(si))},e.\u0275prov=se({token:e,factory:()=>fF(),providedIn:"root"});let t=e;return t})();function fF(){return new Ss(ce(si))}function pF(t,e){if(!t||!e.startsWith(t))return e;let n=e.substring(t.length);return n===""||["/",";","?","#"].includes(n[0])?n:e}function vx(t){return t.replace(/\/index.html$/,"")}function mF(t){if(new RegExp("^(https?:)?//").test(t)){let[,n]=t.split(/\/\/[^\/]+/);return n}return t}function Dx(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let r=n.indexOf("="),[i,o]=r==-1?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}var lm=class{constructor(e,n,r,i){this.$implicit=e,this.ngForOf=n,this.index=r,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},Tn=(()=>{let e=class e{set ngForOf(r){this._ngForOf=r,this._ngForOfDirty=!0}set ngForTrackBy(r){this._trackByFn=r}get ngForTrackBy(){return this._trackByFn}constructor(r,i,o){this._viewContainer=r,this._template=i,this._differs=o,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(r){r&&(this._template=r)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let r=this._ngForOf;if(!this._differ&&r)if(!1)try{}catch{}else this._differ=this._differs.find(r).create(this.ngForTrackBy)}if(this._differ){let r=this._differ.diff(this._ngForOf);r&&this._applyChanges(r)}}_applyChanges(r){let i=this._viewContainer;r.forEachOperation((o,s,a)=>{if(o.previousIndex==null)i.createEmbeddedView(this._template,new lm(o.item,this._ngForOf,-1,-1),a===null?void 0:a);else if(a==null)i.remove(s===null?void 0:s);else if(s!==null){let c=i.get(s);i.move(c,a),_x(c,o)}});for(let o=0,s=i.length;o{let s=i.get(o.currentIndex);_x(s,o)})}static ngTemplateContextGuard(r,i){return!0}};e.\u0275fac=function(i){return new(i||e)(ve(Ni),ve(mo),ve(Bp))},e.\u0275dir=Hn({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0});let t=e;return t})();function _x(t,e){t.context.$implicit=e.item}var kr=(()=>{let e=class e{constructor(r,i){this._viewContainer=r,this._context=new dm,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(r){this._context.$implicit=this._context.ngIf=r,this._updateView()}set ngIfThen(r){xx("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){xx("ngIfElse",r),this._elseTemplateRef=r,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(r,i){return!0}};e.\u0275fac=function(i){return new(i||e)(ve(Ni),ve(mo))},e.\u0275dir=Hn({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0});let t=e;return t})(),dm=class{constructor(){this.$implicit=null,this.ngIf=null}};function xx(t,e){if(!!!(!e||e.createEmbeddedView))throw new Error(`${t} must be a TemplateRef, but received '${tn(e)}'.`)}var kt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({});let t=e;return t})(),Ex="browser",gF="server";function ym(t){return t===gF}var Sx=(()=>{let e=class e{};e.\u0275prov=se({token:e,providedIn:"root",factory:()=>new hm(ce(hn),window)});let t=e;return t})(),hm=class{constructor(e,n){this.document=e,this.window=n,this.offset=()=>[0,0]}setOffset(e){Array.isArray(e)?this.offset=()=>e:this.offset=e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;let n=yF(this.document,e);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(e){this.supportsScrolling()&&(this.window.history.scrollRestoration=e)}scrollToElement(e){let n=e.getBoundingClientRect(),r=n.left+this.window.pageXOffset,i=n.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(r-o[0],i-o[1])}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}};function yF(t,e){let n=t.getElementById(e)||t.getElementsByName(e)[0];if(n)return n;if(typeof t.createTreeWalker=="function"&&t.body&&typeof t.body.attachShadow=="function"){let r=t.createTreeWalker(t.body,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){let o=i.shadowRoot;if(o){let s=o.getElementById(e)||o.querySelector(`[name="${e}"]`);if(s)return s}i=r.nextNode()}}return null}var ql=class{};var xm=class extends Ul{constructor(){super(...arguments),this.supportsDOMEvents=!0}},bm=class t extends xm{static makeCurrent(){bx(new t)}onAndCancel(e,n,r){return e.addEventListener(n,r),()=>{e.removeEventListener(n,r)}}dispatchEvent(e,n){e.dispatchEvent(n)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,n){return n=n||this.getDefaultDocument(),n.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,n){return n==="window"?window:n==="document"?e:n==="body"?e.body:null}getBaseHref(e){let n=_F();return n==null?null:xF(n)}resetBaseElement(){ac=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Dx(document.cookie,e)}},ac=null;function _F(){return ac=ac||document.querySelector("base"),ac?ac.getAttribute("href"):null}function xF(t){return new URL(t,document.baseURI).pathname}var wm=class{addToWindow(e){ln.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new ie(5103,!1);return o},ln.getAllAngularTestabilities=()=>e.getAllTestabilities(),ln.getAllAngularRootElements=()=>e.getAllRootElements();let n=r=>{let i=ln.getAllAngularTestabilities(),o=i.length,s=!1,a=function(c){s=s||c,o--,o==0&&r(s)};i.forEach(c=>{c.whenStable(a)})};ln.frameworkStabilizers||(ln.frameworkStabilizers=[]),ln.frameworkStabilizers.push(n)}findTestabilityInTree(e,n,r){if(n==null)return null;let i=e.getTestability(n);return i??(r?Fr().isShadowRoot(n)?this.findTestabilityInTree(e,n.host,!0):this.findTestabilityInTree(e,n.parentElement,!0):null)}},bF=(()=>{let e=class e{build(){return new XMLHttpRequest}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),Tm=new le("EventManagerPlugins"),Nx=(()=>{let e=class e{constructor(r,i){this._zone=i,this._eventNameToPlugin=new Map,r.forEach(o=>{o.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,i,o){return this._findPluginFor(i).addEventListener(r,i,o)}getZone(){return this._zone}_findPluginFor(r){let i=this._eventNameToPlugin.get(r);if(i)return i;if(i=this._plugins.find(s=>s.supports(r)),!i)throw new ie(5101,!1);return this._eventNameToPlugin.set(r,i),i}};e.\u0275fac=function(i){return new(i||e)(ce(Tm),ce(ct))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),$l=class{constructor(e){this._doc=e}},vm="ng-app-id",Ox=(()=>{let e=class e{constructor(r,i,o,s={}){this.doc=r,this.appId=i,this.nonce=o,this.platformId=s,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=ym(s),this.resetHostNodes()}addStyles(r){for(let i of r)this.changeUsageCount(i,1)===1&&this.onStyleAdded(i)}removeStyles(r){for(let i of r)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){let r=this.styleNodesInDOM;r&&(r.forEach(i=>i.remove()),r.clear());for(let i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(let i of this.getAllStyles())this.addStyleToHost(r,i)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(let i of this.hostNodes)this.addStyleToHost(i,r)}onStyleRemoved(r){let i=this.styleRef;i.get(r)?.elements?.forEach(o=>o.remove()),i.delete(r)}collectServerRenderedStyles(){let r=this.doc.head?.querySelectorAll(`style[${vm}="${this.appId}"]`);if(r?.length){let i=new Map;return r.forEach(o=>{o.textContent!=null&&i.set(o.textContent,o)}),i}return null}changeUsageCount(r,i){let o=this.styleRef;if(o.has(r)){let s=o.get(r);return s.usage+=i,s.usage}return o.set(r,{usage:i,elements:[]}),i}getStyleElement(r,i){let o=this.styleNodesInDOM,s=o?.get(i);if(s?.parentNode===r)return o.delete(i),s.removeAttribute(vm),s;{let a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(vm,this.appId),r.appendChild(a),a}}addStyleToHost(r,i){let o=this.getStyleElement(r,i),s=this.styleRef,a=s.get(i)?.elements;a?a.push(o):s.set(i,{elements:[o],usage:1})}resetHostNodes(){let r=this.hostNodes;r.clear(),r.add(this.doc.head)}};e.\u0275fac=function(i){return new(i||e)(ce(hn),ce(Sl),ce(Op,8),ce(vo))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),_m={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},Dm=/%COMP%/g,Fx="%COMP%",wF=`_nghost-${Fx}`,TF=`_ngcontent-${Fx}`,CF=!0,DF=new le("RemoveStylesOnCompDestroy",{providedIn:"root",factory:()=>CF});function EF(t){return TF.replace(Dm,t)}function SF(t){return wF.replace(Dm,t)}function kx(t,e){return e.map(n=>n.replace(Dm,t))}var Ax=(()=>{let e=class e{constructor(r,i,o,s,a,c,u,l=null){this.eventManager=r,this.sharedStylesHost=i,this.appId=o,this.removeStylesOnCompDestroy=s,this.doc=a,this.platformId=c,this.ngZone=u,this.nonce=l,this.rendererByCompId=new Map,this.platformIsServer=ym(c),this.defaultRenderer=new cc(r,a,u,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===Ir.ShadowDom&&(i=H(T({},i),{encapsulation:Ir.Emulated}));let o=this.getOrCreateRenderer(r,i);return o instanceof Hl?o.applyToHost(r):o instanceof uc&&o.applyStyles(),o}getOrCreateRenderer(r,i){let o=this.rendererByCompId,s=o.get(i.id);if(!s){let a=this.doc,c=this.ngZone,u=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,h=this.platformIsServer;switch(i.encapsulation){case Ir.Emulated:s=new Hl(u,l,i,this.appId,d,a,c,h);break;case Ir.ShadowDom:return new Cm(u,l,r,i,a,c,this.nonce,h);default:s=new uc(u,l,i,d,a,c,h);break}o.set(i.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}};e.\u0275fac=function(i){return new(i||e)(ce(Nx),ce(Ox),ce(Sl),ce(DF),ce(hn),ce(vo),ce(ct),ce(Op))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),cc=class{constructor(e,n,r,i){this.eventManager=e,this.doc=n,this.ngZone=r,this.platformIsServer=i,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(e,n){return n?this.doc.createElementNS(_m[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(Ix(e)?e.content:e).appendChild(n)}insertBefore(e,n,r){e&&(Ix(e)?e.content:e).insertBefore(n,r)}removeChild(e,n){e&&e.removeChild(n)}selectRootElement(e,n){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new ie(-5104,!1);return n||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,r,i){if(i){n=i+":"+n;let o=_m[i];o?e.setAttributeNS(o,n,r):e.setAttribute(n,r)}else e.setAttribute(n,r)}removeAttribute(e,n,r){if(r){let i=_m[r];i?e.removeAttributeNS(i,n):e.removeAttribute(`${r}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,r,i){i&(ni.DashCase|ni.Important)?e.style.setProperty(n,r,i&ni.Important?"important":""):e.style[n]=r}removeStyle(e,n,r){r&ni.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,r){e!=null&&(e[n]=r)}setValue(e,n){e.nodeValue=n}listen(e,n,r){if(typeof e=="string"&&(e=Fr().getGlobalEventTarget(this.doc,e),!e))throw new Error(`Unsupported event target ${e} for event ${n}`);return this.eventManager.addEventListener(e,n,this.decoratePreventDefault(r))}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(n)):e(n))===!1&&n.preventDefault()}}};function Ix(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var Cm=class extends cc{constructor(e,n,r,i,o,s,a,c){super(e,o,s,c),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=kx(i.id,i.styles);for(let l of u){let d=document.createElement("style");a&&d.setAttribute("nonce",a),d.textContent=l,this.shadowRoot.appendChild(d)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,r){return super.insertBefore(this.nodeOrShadowRoot(e),n,r)}removeChild(e,n){return super.removeChild(this.nodeOrShadowRoot(e),n)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},uc=class extends cc{constructor(e,n,r,i,o,s,a,c){super(e,o,s,a),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=i,this.styles=c?kx(c,r.styles):r.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},Hl=class extends uc{constructor(e,n,r,i,o,s,a,c){let u=i+"-"+r.id;super(e,n,r,o,s,a,c,u),this.contentAttr=EF(u),this.hostAttr=SF(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let r=super.createElement(e,n);return super.setAttribute(r,this.contentAttr,""),r}},AF=(()=>{let e=class e extends $l{constructor(r){super(r)}supports(r){return!0}addEventListener(r,i,o){return r.addEventListener(i,o,!1),()=>this.removeEventListener(r,i,o)}removeEventListener(r,i,o){return r.removeEventListener(i,o)}};e.\u0275fac=function(i){return new(i||e)(ce(hn))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})(),Mx=["alt","control","meta","shift"],IF={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},MF={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},NF=(()=>{let e=class e extends $l{constructor(r){super(r)}supports(r){return e.parseEventName(r)!=null}addEventListener(r,i,o){let s=e.parseEventName(i),a=e.eventCallback(s.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fr().onAndCancel(r,s.domEventName,a))}static parseEventName(r){let i=r.toLowerCase().split("."),o=i.shift();if(i.length===0||!(o==="keydown"||o==="keyup"))return null;let s=e._normalizeKey(i.pop()),a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),Mx.forEach(l=>{let d=i.indexOf(l);d>-1&&(i.splice(d,1),a+=l+".")}),a+=s,i.length!=0||s.length===0)return null;let u={};return u.domEventName=o,u.fullKey=a,u}static matchEventFullKeyCode(r,i){let o=IF[r.key]||r.key,s="";return i.indexOf("code.")>-1&&(o=r.code,s="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),Mx.forEach(a=>{if(a!==o){let c=MF[a];c(r)&&(s+=a+".")}}),s+=o,s===i)}static eventCallback(r,i,o){return s=>{e.matchEventFullKeyCode(s,r)&&o.runGuarded(()=>i(s))}}static _normalizeKey(r){return r==="esc"?"escape":r}};e.\u0275fac=function(i){return new(i||e)(ce(hn))},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})();function OF(){bm.makeCurrent()}function FF(){return new Or}function kF(){return c0(document),document}var RF=[{provide:vo,useValue:Ex},{provide:Np,useValue:OF,multi:!0},{provide:hn,useFactory:kF,deps:[]}],Rx=cm(px,"browser",RF),PF=new le(""),VF=[{provide:sc,useClass:wm,deps:[]},{provide:im,useClass:Ll,deps:[ct,Bl,sc]},{provide:Ll,useClass:Ll,deps:[ct,Bl,sc]}],LF=[{provide:El,useValue:"root"},{provide:Or,useFactory:FF,deps:[]},{provide:Tm,useClass:AF,multi:!0,deps:[hn,ct,vo]},{provide:Tm,useClass:NF,multi:!0,deps:[hn]},Ax,Ox,Nx,{provide:Za,useExisting:Ax},{provide:ql,useClass:bF,deps:[]},[]],Px=(()=>{let e=class e{constructor(r){}static withServerTransition(r){return{ngModule:e,providers:[{provide:Sl,useValue:r.appId}]}}};e.\u0275fac=function(i){return new(i||e)(ce(PF,12))},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({providers:[...LF,...VF],imports:[kt,mx]});let t=e;return t})();function BF(){return new lc(ce(hn))}var lc=(()=>{let e=class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}};e.\u0275fac=function(i){return new(i||e)(ce(hn))},e.\u0275prov=se({token:e,factory:function(i){let o=null;return i?o=new i:o=BF(),o},providedIn:"root"});let t=e;return t})();var _e="primary",Dc=Symbol("RouteTitle"),Nm=class{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){let n=this.params[e];return Array.isArray(n)?n[0]:n}return null}getAll(e){if(this.has(e)){let n=this.params[e];return Array.isArray(n)?n:[n]}return[]}get keys(){return Object.keys(this.params)}};function Os(t){return new Nm(t)}function jF(t,e,n){let r=n.path.split("/");if(r.length>t.length||n.pathMatch==="full"&&(e.hasChildren()||r.lengthr[o]===i)}else return t===e}function Wx(t){return t.length>0?t[t.length-1]:null}function Vi(t){return Jh(t)?t:bo(t)?vt(Promise.resolve(t)):me(t)}var qF={exact:Yx,subset:Zx},zx={exact:$F,subset:HF,ignored:()=>!0};function Vx(t,e,n){return qF[n.paths](t.root,e.root,n.matrixParams)&&zx[n.queryParams](t.queryParams,e.queryParams)&&!(n.fragment==="exact"&&t.fragment!==e.fragment)}function $F(t,e){return Rr(t,e)}function Yx(t,e,n){if(!Co(t.segments,e.segments)||!zl(t.segments,e.segments,n)||t.numberOfChildren!==e.numberOfChildren)return!1;for(let r in e.children)if(!t.children[r]||!Yx(t.children[r],e.children[r],n))return!1;return!0}function HF(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>Gx(t[n],e[n]))}function Zx(t,e,n){return Qx(t,e,e.segments,n)}function Qx(t,e,n,r){if(t.segments.length>n.length){let i=t.segments.slice(0,n.length);return!(!Co(i,n)||e.hasChildren()||!zl(i,n,r))}else if(t.segments.length===n.length){if(!Co(t.segments,n)||!zl(t.segments,n,r))return!1;for(let i in e.children)if(!t.children[i]||!Zx(t.children[i],e.children[i],r))return!1;return!0}else{let i=n.slice(0,t.segments.length),o=n.slice(t.segments.length);return!Co(t.segments,i)||!zl(t.segments,i,r)||!t.children[_e]?!1:Qx(t.children[_e],e,o,r)}}function zl(t,e,n){return e.every((r,i)=>zx[n](t[i].parameters,r.parameters))}var Fi=class{constructor(e=new Ze([],{}),n={},r=null){this.root=e,this.queryParams=n,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Os(this.queryParams)),this._queryParamMap}toString(){return zF.serialize(this)}},Ze=class{constructor(e,n){this.segments=e,this.children=n,this.parent=null,Object.values(n).forEach(r=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Yl(this)}},To=class{constructor(e,n){this.path=e,this.parameters=n}get parameterMap(){return this._parameterMap||(this._parameterMap=Os(this.parameters)),this._parameterMap}toString(){return Xx(this)}};function GF(t,e){return Co(t,e)&&t.every((n,r)=>Rr(n.parameters,e[r].parameters))}function Co(t,e){return t.length!==e.length?!1:t.every((n,r)=>n.path===e[r].path)}function WF(t,e){let n=[];return Object.entries(t.children).forEach(([r,i])=>{r===_e&&(n=n.concat(e(i,r)))}),Object.entries(t.children).forEach(([r,i])=>{r!==_e&&(n=n.concat(e(i,r)))}),n}var Ec=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>new yc)(),providedIn:"root"});let t=e;return t})(),yc=class{parse(e){let n=new km(e);return new Fi(n.parseRootSegment(),n.parseQueryParams(),n.parseFragment())}serialize(e){let n=`/${dc(e.root,!0)}`,r=QF(e.queryParams),i=typeof e.fragment=="string"?`#${YF(e.fragment)}`:"";return`${n}${r}${i}`}},zF=new yc;function Yl(t){return t.segments.map(e=>Xx(e)).join("/")}function dc(t,e){if(!t.hasChildren())return Yl(t);if(e){let n=t.children[_e]?dc(t.children[_e],!1):"",r=[];return Object.entries(t.children).forEach(([i,o])=>{i!==_e&&r.push(`${i}:${dc(o,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}else{let n=WF(t,(r,i)=>i===_e?[dc(t.children[_e],!1)]:[`${i}:${dc(r,!1)}`]);return Object.keys(t.children).length===1&&t.children[_e]!=null?`${Yl(t)}/${n[0]}`:`${Yl(t)}/(${n.join("//")})`}}function Kx(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Gl(t){return Kx(t).replace(/%3B/gi,";")}function YF(t){return encodeURI(t)}function Fm(t){return Kx(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Zl(t){return decodeURIComponent(t)}function Lx(t){return Zl(t.replace(/\+/g,"%20"))}function Xx(t){return`${Fm(t.path)}${ZF(t.parameters)}`}function ZF(t){return Object.keys(t).map(e=>`;${Fm(e)}=${Fm(t[e])}`).join("")}function QF(t){let e=Object.keys(t).map(n=>{let r=t[n];return Array.isArray(r)?r.map(i=>`${Gl(n)}=${Gl(i)}`).join("&"):`${Gl(n)}=${Gl(r)}`}).filter(n=>!!n);return e.length?`?${e.join("&")}`:""}var KF=/^[^\/()?;#]+/;function Sm(t){let e=t.match(KF);return e?e[0]:""}var XF=/^[^\/()?;=#]+/;function JF(t){let e=t.match(XF);return e?e[0]:""}var ek=/^[^=?&#]+/;function tk(t){let e=t.match(ek);return e?e[0]:""}var nk=/^[^&#]+/;function rk(t){let e=t.match(nk);return e?e[0]:""}var km=class{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ze([],{}):new Ze([],this.parseChildren())}parseQueryParams(){let e={};if(this.consumeOptional("?"))do this.parseQueryParam(e);while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let n={};this.peekStartsWith("/(")&&(this.capture("/"),n=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(n).length>0)&&(r[_e]=new Ze(e,n)),r}parseSegment(){let e=Sm(this.remaining);if(e===""&&this.peekStartsWith(";"))throw new ie(4009,!1);return this.capture(e),new To(Zl(e),this.parseMatrixParams())}parseMatrixParams(){let e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){let n=JF(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){let i=Sm(this.remaining);i&&(r=i,this.capture(r))}e[Zl(n)]=Zl(r)}parseQueryParam(e){let n=tk(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){let s=rk(this.remaining);s&&(r=s,this.capture(r))}let i=Lx(n),o=Lx(r);if(e.hasOwnProperty(i)){let s=e[i];Array.isArray(s)||(s=[s],e[i]=s),s.push(o)}else e[i]=o}parseParens(e){let n={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let r=Sm(this.remaining),i=this.remaining[r.length];if(i!=="/"&&i!==")"&&i!==";")throw new ie(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=_e);let s=this.parseChildren();n[o]=Object.keys(s).length===1?s[_e]:new Ze([],s),this.consumeOptional("//")}return n}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return this.peekStartsWith(e)?(this.remaining=this.remaining.substring(e.length),!0):!1}capture(e){if(!this.consumeOptional(e))throw new ie(4011,!1)}};function Jx(t){return t.segments.length>0?new Ze([],{[_e]:t}):t}function eb(t){let e={};for(let r of Object.keys(t.children)){let i=t.children[r],o=eb(i);if(r===_e&&o.segments.length===0&&o.hasChildren())for(let[s,a]of Object.entries(o.children))e[s]=a;else(o.segments.length>0||o.hasChildren())&&(e[r]=o)}let n=new Ze(t.segments,e);return ik(n)}function ik(t){if(t.numberOfChildren===1&&t.children[_e]){let e=t.children[_e];return new Ze(t.segments.concat(e.segments),e.children)}return t}function Fs(t){return t instanceof Fi}function ok(t,e,n=null,r=null){let i=tb(t);return nb(i,e,n,r)}function tb(t){let e;function n(o){let s={};for(let c of o.children){let u=n(c);s[c.outlet]=u}let a=new Ze(o.url,s);return o===t&&(e=a),a}let r=n(t.root),i=Jx(r);return e??i}function nb(t,e,n,r){let i=t;for(;i.parent;)i=i.parent;if(e.length===0)return Am(i,i,i,n,r);let o=sk(e);if(o.toRoot())return Am(i,i,new Ze([],{}),n,r);let s=ak(o,i,t),a=s.processChildren?pc(s.segmentGroup,s.index,o.commands):ib(s.segmentGroup,s.index,o.commands);return Am(i,s.segmentGroup,a,n,r)}function Ql(t){return typeof t=="object"&&t!=null&&!t.outlets&&!t.segmentPath}function vc(t){return typeof t=="object"&&t!=null&&t.outlets}function Am(t,e,n,r,i){let o={};r&&Object.entries(r).forEach(([c,u])=>{o[c]=Array.isArray(u)?u.map(l=>`${l}`):`${u}`});let s;t===e?s=n:s=rb(t,e,n);let a=Jx(eb(s));return new Fi(a,o,i)}function rb(t,e,n){let r={};return Object.entries(t.children).forEach(([i,o])=>{o===e?r[i]=n:r[i]=rb(o,e,n)}),new Ze(t.segments,r)}var Kl=class{constructor(e,n,r){if(this.isAbsolute=e,this.numberOfDoubleDots=n,this.commands=r,e&&r.length>0&&Ql(r[0]))throw new ie(4003,!1);let i=r.find(vc);if(i&&i!==Wx(r))throw new ie(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function sk(t){if(typeof t[0]=="string"&&t.length===1&&t[0]==="/")return new Kl(!0,0,t);let e=0,n=!1,r=t.reduce((i,o,s)=>{if(typeof o=="object"&&o!=null){if(o.outlets){let a={};return Object.entries(o.outlets).forEach(([c,u])=>{a[c]=typeof u=="string"?u.split("/"):u}),[...i,{outlets:a}]}if(o.segmentPath)return[...i,o.segmentPath]}return typeof o!="string"?[...i,o]:s===0?(o.split("/").forEach((a,c)=>{c==0&&a==="."||(c==0&&a===""?n=!0:a===".."?e++:a!=""&&i.push(a))}),i):[...i,o]},[]);return new Kl(n,e,r)}var Ms=class{constructor(e,n,r){this.segmentGroup=e,this.processChildren=n,this.index=r}};function ak(t,e,n){if(t.isAbsolute)return new Ms(e,!0,0);if(!n)return new Ms(e,!1,NaN);if(n.parent===null)return new Ms(n,!0,0);let r=Ql(t.commands[0])?0:1,i=n.segments.length-1+r;return ck(n,i,t.numberOfDoubleDots)}function ck(t,e,n){let r=t,i=e,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new ie(4005,!1);i=r.segments.length}return new Ms(r,!1,i-o)}function uk(t){return vc(t[0])?t[0].outlets:{[_e]:t}}function ib(t,e,n){if(t||(t=new Ze([],{})),t.segments.length===0&&t.hasChildren())return pc(t,e,n);let r=lk(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndexo!==_e)&&t.children[_e]&&t.numberOfChildren===1&&t.children[_e].segments.length===0){let o=pc(t.children[_e],e,n);return new Ze(t.segments,o.children)}return Object.entries(r).forEach(([o,s])=>{typeof s=="string"&&(s=[s]),s!==null&&(i[o]=ib(t.children[o],e,s))}),Object.entries(t.children).forEach(([o,s])=>{r[o]===void 0&&(i[o]=s)}),new Ze(t.segments,i)}}function lk(t,e,n){let r=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};for(;i=n.length)return o;let s=t.segments[i],a=n[r];if(vc(a))break;let c=`${a}`,u=r0&&c===void 0)break;if(c&&u&&typeof u=="object"&&u.outlets===void 0){if(!jx(c,u,s))return o;r+=2}else{if(!jx(c,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}function Rm(t,e,n){let r=t.segments.slice(0,e),i=0;for(;i{typeof r=="string"&&(r=[r]),r!==null&&(e[n]=Rm(new Ze([],{}),0,r))}),e}function Bx(t){let e={};return Object.entries(t).forEach(([n,r])=>e[n]=`${r}`),e}function jx(t,e,n){return t==n.path&&Rr(e,n.parameters)}var mc="imperative",Yn=class{constructor(e,n){this.id=e,this.url=n}},ks=class extends Yn{constructor(e,n,r="imperative",i=null){super(e,n),this.type=0,this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},Pr=class extends Yn{constructor(e,n,r){super(e,n),this.urlAfterRedirects=r,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},ki=class extends Yn{constructor(e,n,r,i){super(e,n),this.reason=r,this.code=i,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},Ri=class extends Yn{constructor(e,n,r,i){super(e,n),this.reason=r,this.code=i,this.type=16}},_c=class extends Yn{constructor(e,n,r,i){super(e,n),this.error=r,this.target=i,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},Xl=class extends Yn{constructor(e,n,r,i){super(e,n),this.urlAfterRedirects=r,this.state=i,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Pm=class extends Yn{constructor(e,n,r,i){super(e,n),this.urlAfterRedirects=r,this.state=i,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Vm=class extends Yn{constructor(e,n,r,i,o){super(e,n),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},Lm=class extends Yn{constructor(e,n,r,i){super(e,n),this.urlAfterRedirects=r,this.state=i,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Bm=class extends Yn{constructor(e,n,r,i){super(e,n),this.urlAfterRedirects=r,this.state=i,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},jm=class{constructor(e){this.route=e,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Um=class{constructor(e){this.route=e,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},qm=class{constructor(e){this.snapshot=e,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},$m=class{constructor(e){this.snapshot=e,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Hm=class{constructor(e){this.snapshot=e,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Gm=class{constructor(e){this.snapshot=e,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Jl=class{constructor(e,n,r){this.routerEvent=e,this.position=n,this.anchor=r,this.type=15}toString(){let e=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${e}')`}},xc=class{},bc=class{constructor(e){this.url=e}};var Wm=class{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new Sc,this.attachRef=null}},Sc=(()=>{let e=class e{constructor(){this.contexts=new Map}onChildOutletCreated(r,i){let o=this.getOrCreateContext(r);o.outlet=i,this.contexts.set(r,o)}onChildOutletDestroyed(r){let i=this.getContext(r);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){let r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let i=this.getContext(r);return i||(i=new Wm,this.contexts.set(r,i)),i}getContext(r){return this.contexts.get(r)||null}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),ed=class{constructor(e){this._root=e}get root(){return this._root.value}parent(e){let n=this.pathFromRoot(e);return n.length>1?n[n.length-2]:null}children(e){let n=zm(e,this._root);return n?n.children.map(r=>r.value):[]}firstChild(e){let n=zm(e,this._root);return n&&n.children.length>0?n.children[0].value:null}siblings(e){let n=Ym(e,this._root);return n.length<2?[]:n[n.length-2].children.map(i=>i.value).filter(i=>i!==e)}pathFromRoot(e){return Ym(e,this._root).map(n=>n.value)}};function zm(t,e){if(t===e.value)return e;for(let n of e.children){let r=zm(t,n);if(r)return r}return null}function Ym(t,e){if(t===e.value)return[e];for(let n of e.children){let r=Ym(t,n);if(r.length)return r.unshift(e),r}return[]}var Vn=class{constructor(e,n){this.value=e,this.children=n}toString(){return`TreeNode(${this.value})`}};function Is(t){let e={};return t&&t.children.forEach(n=>e[n.value.outlet]=n),e}var td=class extends ed{constructor(e,n){super(e),this.snapshot=n,ig(this,e)}toString(){return this.snapshot.toString()}};function ob(t,e){let n=hk(t,e),r=new Yt([new To("",{})]),i=new Yt({}),o=new Yt({}),s=new Yt({}),a=new Yt(""),c=new ai(r,i,s,a,o,_e,e,n.root);return c.snapshot=n.root,new td(new Vn(c,[]),n)}function hk(t,e){let n={},r={},i={},o="",s=new wc([],n,i,o,r,_e,e,null,{});return new nd("",new Vn(s,[]))}var ai=class{constructor(e,n,r,i,o,s,a,c){this.urlSubject=e,this.paramsSubject=n,this.queryParamsSubject=r,this.fragmentSubject=i,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=c,this.title=this.dataSubject?.pipe(Oe(u=>u[Dc]))??me(void 0),this.url=e,this.params=n,this.queryParams=r,this.fragment=i,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Oe(e=>Os(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Oe(e=>Os(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function rg(t,e,n="emptyOnly"){let r,{routeConfig:i}=t;return e!==null&&(n==="always"||i?.path===""||!e.component&&!e.routeConfig?.loadComponent)?r={params:T(T({},e.params),t.params),data:T(T({},e.data),t.data),resolve:T(T(T(T({},t.data),e.data),i?.data),t._resolvedData)}:r={params:T({},t.params),data:T({},t.data),resolve:T(T({},t.data),t._resolvedData??{})},i&&ab(i)&&(r.resolve[Dc]=i.title),r}var wc=class{get title(){return this.data?.[Dc]}constructor(e,n,r,i,o,s,a,c,u){this.url=e,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=s,this.component=a,this.routeConfig=c,this._resolve=u}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Os(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Os(this.queryParams)),this._queryParamMap}toString(){let e=this.url.map(r=>r.toString()).join("/"),n=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${e}', path:'${n}')`}},nd=class extends ed{constructor(e,n){super(n),this.url=e,ig(this,n)}toString(){return sb(this._root)}};function ig(t,e){e.value._routerState=t,e.children.forEach(n=>ig(t,n))}function sb(t){let e=t.children.length>0?` { ${t.children.map(sb).join(", ")} } `:"";return`${t.value}${e}`}function Im(t){if(t.snapshot){let e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Rr(e.queryParams,n.queryParams)||t.queryParamsSubject.next(n.queryParams),e.fragment!==n.fragment&&t.fragmentSubject.next(n.fragment),Rr(e.params,n.params)||t.paramsSubject.next(n.params),UF(e.url,n.url)||t.urlSubject.next(n.url),Rr(e.data,n.data)||t.dataSubject.next(n.data)}else t.snapshot=t._futureSnapshot,t.dataSubject.next(t._futureSnapshot.data)}function Zm(t,e){let n=Rr(t.params,e.params)&&GF(t.url,e.url),r=!t.parent!=!e.parent;return n&&!r&&(!t.parent||Zm(t.parent,e.parent))}function ab(t){return typeof t.title=="string"||t.title===null}var og=(()=>{let e=class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=_e,this.activateEvents=new Le,this.deactivateEvents=new Le,this.attachEvents=new Le,this.detachEvents=new Le,this.parentContexts=J(Sc),this.location=J(Ni),this.changeDetector=J(zn),this.environmentInjector=J(Rn),this.inputBinder=J(ad,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){let{firstChange:i,previousValue:o}=r.name;if(i)return;this.isTrackedInParentContexts(o)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(o)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new ie(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new ie(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new ie(4012,!1);this.location.detach();let r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,i){this.activated=r,this._activatedRoute=i,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){let r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,i){if(this.isActivated)throw new ie(4013,!1);this._activatedRoute=r;let o=this.location,a=r.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,u=new Qm(r,c,o.injector);this.activated=o.createComponent(a,{index:o.length,injector:u,environmentInjector:i??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275dir=Hn({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[ii]});let t=e;return t})(),Qm=class{constructor(e,n,r){this.route=e,this.childContexts=n,this.parent=r}get(e,n){return e===ai?this.route:e===Sc?this.childContexts:this.parent.get(e,n)}},ad=new le(""),Ux=(()=>{let e=class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){let{activatedRoute:i}=r,o=Va([i.queryParams,i.params,i.data]).pipe(Un(([s,a,c],u)=>(c=T(T(T({},s),a),c),u===0?me(c):Promise.resolve(c)))).subscribe(s=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==i||i.component===null){this.unsubscribeFromRouteData(r);return}let a=gx(i.component);if(!a){this.unsubscribeFromRouteData(r);return}for(let{templateName:c}of a.inputs)r.activatedComponentRef.setInput(c,s[c])});this.outletDataSubscriptions.set(r,o)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})();function fk(t,e,n){let r=Tc(t,e._root,n?n._root:void 0);return new td(r,e)}function Tc(t,e,n){if(n&&t.shouldReuseRoute(e.value,n.value.snapshot)){let r=n.value;r._futureSnapshot=e.value;let i=pk(t,e,n);return new Vn(r,i)}else{if(t.shouldAttach(e.value)){let o=t.retrieve(e.value);if(o!==null){let s=o.route;return s.value._futureSnapshot=e.value,s.children=e.children.map(a=>Tc(t,a)),s}}let r=mk(e.value),i=e.children.map(o=>Tc(t,o));return new Vn(r,i)}}function pk(t,e,n){return e.children.map(r=>{for(let i of n.children)if(t.shouldReuseRoute(r.value,i.value.snapshot))return Tc(t,r,i);return Tc(t,r)})}function mk(t){return new ai(new Yt(t.url),new Yt(t.params),new Yt(t.queryParams),new Yt(t.fragment),new Yt(t.data),t.outlet,t.component,t)}var cb="ngNavigationCancelingError";function ub(t,e){let{redirectTo:n,navigationBehaviorOptions:r}=Fs(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,i=lb(!1,0,e);return i.url=n,i.navigationBehaviorOptions=r,i}function lb(t,e,n){let r=new Error("NavigationCancelingError: "+(t||""));return r[cb]=!0,r.cancellationCode=e,n&&(r.url=n),r}function gk(t){return db(t)&&Fs(t.url)}function db(t){return t&&t[cb]}var yk=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["ng-component"]],standalone:!0,features:[pt],decls:1,vars:0,template:function(i,o){i&1&&Be(0,"router-outlet")},dependencies:[og],encapsulation:2});let t=e;return t})();function vk(t,e){return t.providers&&!t._injector&&(t._injector=kl(t.providers,e,`Route: ${t.path}`)),t._injector??e}function sg(t){let e=t.children&&t.children.map(sg),n=e?H(T({},t),{children:e}):T({},t);return!n.component&&!n.loadComponent&&(e||n.loadChildren)&&n.outlet&&n.outlet!==_e&&(n.component=yk),n}function Vr(t){return t.outlet||_e}function _k(t,e){let n=t.filter(r=>Vr(r)===e);return n.push(...t.filter(r=>Vr(r)!==e)),n}function Ac(t){if(!t)return null;if(t.routeConfig?._injector)return t.routeConfig._injector;for(let e=t.parent;e;e=e.parent){let n=e.routeConfig;if(n?._loadedInjector)return n._loadedInjector;if(n?._injector)return n._injector}return null}var xk=(t,e,n,r)=>Oe(i=>(new Km(e,i.targetRouterState,i.currentRouterState,n,r).activate(t),i)),Km=class{constructor(e,n,r,i,o){this.routeReuseStrategy=e,this.futureState=n,this.currState=r,this.forwardEvent=i,this.inputBindingEnabled=o}activate(e){let n=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(n,r,e),Im(this.futureState.root),this.activateChildRoutes(n,r,e)}deactivateChildRoutes(e,n,r){let i=Is(n);e.children.forEach(o=>{let s=o.value.outlet;this.deactivateRoutes(o,i[s],r),delete i[s]}),Object.values(i).forEach(o=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(e,n,r){let i=e.value,o=n?n.value:null;if(i===o)if(i.component){let s=r.getContext(i.outlet);s&&this.deactivateChildRoutes(e,n,s.children)}else this.deactivateChildRoutes(e,n,r);else o&&this.deactivateRouteAndItsChildren(n,r)}deactivateRouteAndItsChildren(e,n){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,n):this.deactivateRouteAndOutlet(e,n)}detachAndStoreRouteSubtree(e,n){let r=n.getContext(e.value.outlet),i=r&&e.value.component?r.children:n,o=Is(e);for(let s of Object.keys(o))this.deactivateRouteAndItsChildren(o[s],i);if(r&&r.outlet){let s=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:s,route:e,contexts:a})}}deactivateRouteAndOutlet(e,n){let r=n.getContext(e.value.outlet),i=r&&e.value.component?r.children:n,o=Is(e);for(let s of Object.keys(o))this.deactivateRouteAndItsChildren(o[s],i);r&&(r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated()),r.attachRef=null,r.route=null)}activateChildRoutes(e,n,r){let i=Is(n);e.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Gm(o.value.snapshot))}),e.children.length&&this.forwardEvent(new $m(e.value.snapshot))}activateRoutes(e,n,r){let i=e.value,o=n?n.value:null;if(Im(i),i===o)if(i.component){let s=r.getOrCreateContext(i.outlet);this.activateChildRoutes(e,n,s.children)}else this.activateChildRoutes(e,n,r);else if(i.component){let s=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){let a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),Im(a.route.value),this.activateChildRoutes(e,null,s.children)}else{let a=Ac(i.snapshot);s.attachRef=null,s.route=i,s.injector=a,s.outlet&&s.outlet.activateWith(i,s.injector),this.activateChildRoutes(e,null,s.children)}}else this.activateChildRoutes(e,null,r)}},rd=class{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}},Ns=class{constructor(e,n){this.component=e,this.route=n}};function bk(t,e,n){let r=t._root,i=e?e._root:null;return hc(r,i,n,[r.value])}function wk(t){let e=t.routeConfig?t.routeConfig.canActivateChild:null;return!e||e.length===0?null:{node:t,guards:e}}function Ps(t,e){let n=Symbol(),r=e.get(t,n);return r===n?typeof t=="function"&&!r_(t)?t:e.get(t):r}function hc(t,e,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){let o=Is(e);return t.children.forEach(s=>{Tk(s,o[s.value.outlet],n,r.concat([s.value]),i),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>gc(a,n.getContext(s),i)),i}function Tk(t,e,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){let o=t.value,s=e?e.value:null,a=n?n.getContext(t.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){let c=Ck(s,o,o.routeConfig.runGuardsAndResolvers);c?i.canActivateChecks.push(new rd(r)):(o.data=s.data,o._resolvedData=s._resolvedData),o.component?hc(t,e,a?a.children:null,r,i):hc(t,e,n,r,i),c&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new Ns(a.outlet.component,s))}else s&&gc(e,a,i),i.canActivateChecks.push(new rd(r)),o.component?hc(t,null,a?a.children:null,r,i):hc(t,null,n,r,i);return i}function Ck(t,e,n){if(typeof n=="function")return n(t,e);switch(n){case"pathParamsChange":return!Co(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Co(t.url,e.url)||!Rr(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Zm(t,e)||!Rr(t.queryParams,e.queryParams);case"paramsChange":default:return!Zm(t,e)}}function gc(t,e,n){let r=Is(t),i=t.value;Object.entries(r).forEach(([o,s])=>{i.component?e?gc(s,e.children.getContext(o),n):gc(s,null,n):gc(s,e,n)}),i.component?e&&e.outlet&&e.outlet.isActivated?n.canDeactivateChecks.push(new Ns(e.outlet.component,i)):n.canDeactivateChecks.push(new Ns(null,i)):n.canDeactivateChecks.push(new Ns(null,i))}function Ic(t){return typeof t=="function"}function Dk(t){return typeof t=="boolean"}function Ek(t){return t&&Ic(t.canLoad)}function Sk(t){return t&&Ic(t.canActivate)}function Ak(t){return t&&Ic(t.canActivateChild)}function Ik(t){return t&&Ic(t.canDeactivate)}function Mk(t){return t&&Ic(t.canMatch)}function hb(t){return t instanceof Jr||t?.name==="EmptyError"}var Wl=Symbol("INITIAL_VALUE");function Rs(){return Un(t=>Va(t.map(e=>e.pipe(ei(1),sf(Wl)))).pipe(Oe(e=>{for(let n of e)if(n!==!0){if(n===Wl)return Wl;if(n===!1||n instanceof Fi)return n}return!0}),jn(e=>e!==Wl),ei(1)))}function Nk(t,e){return bt(n=>{let{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=n;return s.length===0&&o.length===0?me(H(T({},n),{guardsResult:!0})):Ok(s,r,i,t).pipe(bt(a=>a&&Dk(a)?Fk(r,o,t,e):me(a)),Oe(a=>H(T({},n),{guardsResult:a})))})}function Ok(t,e,n,r){return vt(t).pipe(bt(i=>Lk(i.component,i.route,n,e,r)),Dr(i=>i!==!0,!0))}function Fk(t,e,n,r){return vt(e).pipe(io(i=>rs(Rk(i.route.parent,r),kk(i.route,r),Vk(t,i.path,n),Pk(t,i.route,n))),Dr(i=>i!==!0,!0))}function kk(t,e){return t!==null&&e&&e(new Hm(t)),me(!0)}function Rk(t,e){return t!==null&&e&&e(new qm(t)),me(!0)}function Pk(t,e,n){let r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||r.length===0)return me(!0);let i=r.map(o=>Pu(()=>{let s=Ac(e)??n,a=Ps(o,s),c=Sk(a)?a.canActivate(e,t):Ii(s,()=>a(e,t));return Vi(c).pipe(Dr())}));return me(i).pipe(Rs())}function Vk(t,e,n){let r=e[e.length-1],o=e.slice(0,e.length-1).reverse().map(s=>wk(s)).filter(s=>s!==null).map(s=>Pu(()=>{let a=s.guards.map(c=>{let u=Ac(s.node)??n,l=Ps(c,u),d=Ak(l)?l.canActivateChild(r,t):Ii(u,()=>l(r,t));return Vi(d).pipe(Dr())});return me(a).pipe(Rs())}));return me(o).pipe(Rs())}function Lk(t,e,n,r,i){let o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!o||o.length===0)return me(!0);let s=o.map(a=>{let c=Ac(e)??i,u=Ps(a,c),l=Ik(u)?u.canDeactivate(t,e,n,r):Ii(c,()=>u(t,e,n,r));return Vi(l).pipe(Dr())});return me(s).pipe(Rs())}function Bk(t,e,n,r){let i=e.canLoad;if(i===void 0||i.length===0)return me(!0);let o=i.map(s=>{let a=Ps(s,t),c=Ek(a)?a.canLoad(e,n):Ii(t,()=>a(e,n));return Vi(c)});return me(o).pipe(Rs(),fb(r))}function fb(t){return Yh(wt(e=>{if(Fs(e))throw ub(t,e)}),Oe(e=>e===!0))}function jk(t,e,n,r){let i=e.canMatch;if(!i||i.length===0)return me(!0);let o=i.map(s=>{let a=Ps(s,t),c=Mk(a)?a.canMatch(e,n):Ii(t,()=>a(e,n));return Vi(c)});return me(o).pipe(Rs(),fb(r))}var Cc=class{constructor(e){this.segmentGroup=e||null}},id=class extends Error{constructor(e){super(),this.urlTree=e}};function As(t){return es(new Cc(t))}function Uk(t){return es(new ie(4e3,!1))}function qk(t){return es(lb(!1,3))}var Xm=class{constructor(e,n){this.urlSerializer=e,this.urlTree=n}lineralizeSegments(e,n){let r=[],i=n.root;for(;;){if(r=r.concat(i.segments),i.numberOfChildren===0)return me(r);if(i.numberOfChildren>1||!i.children[_e])return Uk(e.redirectTo);i=i.children[_e]}}applyRedirectCommands(e,n,r){let i=this.applyRedirectCreateUrlTree(n,this.urlSerializer.parse(n),e,r);if(n.startsWith("/"))throw new id(i);return i}applyRedirectCreateUrlTree(e,n,r,i){let o=this.createSegmentGroup(e,n.root,r,i);return new Fi(o,this.createQueryParams(n.queryParams,this.urlTree.queryParams),n.fragment)}createQueryParams(e,n){let r={};return Object.entries(e).forEach(([i,o])=>{if(typeof o=="string"&&o.startsWith(":")){let a=o.substring(1);r[i]=n[a]}else r[i]=o}),r}createSegmentGroup(e,n,r,i){let o=this.createSegments(e,n.segments,r,i),s={};return Object.entries(n.children).forEach(([a,c])=>{s[a]=this.createSegmentGroup(e,c,r,i)}),new Ze(o,s)}createSegments(e,n,r,i){return n.map(o=>o.path.startsWith(":")?this.findPosParam(e,o,i):this.findOrReturn(o,r))}findPosParam(e,n,r){let i=r[n.path.substring(1)];if(!i)throw new ie(4001,!1);return i}findOrReturn(e,n){let r=0;for(let i of n){if(i.path===e.path)return n.splice(r),i;r++}return e}},Jm={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function $k(t,e,n,r,i){let o=ag(t,e,n);return o.matched?(r=vk(e,r),jk(r,e,n,i).pipe(Oe(s=>s===!0?o:T({},Jm)))):me(o)}function ag(t,e,n){if(e.path==="**")return Hk(n);if(e.path==="")return e.pathMatch==="full"&&(t.hasChildren()||n.length>0)?T({},Jm):{matched:!0,consumedSegments:[],remainingSegments:n,parameters:{},positionalParamSegments:{}};let i=(e.matcher||jF)(n,t,e);if(!i)return T({},Jm);let o={};Object.entries(i.posParams??{}).forEach(([a,c])=>{o[a]=c.path});let s=i.consumed.length>0?T(T({},o),i.consumed[i.consumed.length-1].parameters):o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:n.slice(i.consumed.length),parameters:s,positionalParamSegments:i.posParams??{}}}function Hk(t){return{matched:!0,parameters:t.length>0?Wx(t).parameters:{},consumedSegments:t,remainingSegments:[],positionalParamSegments:{}}}function qx(t,e,n,r){return n.length>0&&zk(t,n,r)?{segmentGroup:new Ze(e,Wk(r,new Ze(n,t.children))),slicedSegments:[]}:n.length===0&&Yk(t,n,r)?{segmentGroup:new Ze(t.segments,Gk(t,e,n,r,t.children)),slicedSegments:n}:{segmentGroup:new Ze(t.segments,t.children),slicedSegments:n}}function Gk(t,e,n,r,i){let o={};for(let s of r)if(cd(t,n,s)&&!i[Vr(s)]){let a=new Ze([],{});o[Vr(s)]=a}return T(T({},i),o)}function Wk(t,e){let n={};n[_e]=e;for(let r of t)if(r.path===""&&Vr(r)!==_e){let i=new Ze([],{});n[Vr(r)]=i}return n}function zk(t,e,n){return n.some(r=>cd(t,e,r)&&Vr(r)!==_e)}function Yk(t,e,n){return n.some(r=>cd(t,e,r))}function cd(t,e,n){return(t.hasChildren()||e.length>0)&&n.pathMatch==="full"?!1:n.path===""}function Zk(t,e,n,r){return Vr(t)!==r&&(r===_e||!cd(e,n,t))?!1:ag(e,t,n).matched}function Qk(t,e,n){return e.length===0&&!t.children[n]}var eg=class{};function Kk(t,e,n,r,i,o,s="emptyOnly"){return new tg(t,e,n,r,i,s,o).recognize()}var Xk=31,tg=class{constructor(e,n,r,i,o,s,a){this.injector=e,this.configLoader=n,this.rootComponentType=r,this.config=i,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new Xm(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(e){return new ie(4002,`'${e.segmentGroup}'`)}recognize(){let e=qx(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(Oe(n=>{let r=new wc([],Object.freeze({}),Object.freeze(T({},this.urlTree.queryParams)),this.urlTree.fragment,{},_e,this.rootComponentType,null,{}),i=new Vn(r,n),o=new nd("",i),s=ok(r,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),this.inheritParamsAndData(o._root,null),{state:o,tree:s}}))}match(e){return this.processSegmentGroup(this.injector,this.config,e,_e).pipe(_i(r=>{if(r instanceof id)return this.urlTree=r.urlTree,this.match(r.urlTree.root);throw r instanceof Cc?this.noMatchError(r):r}))}inheritParamsAndData(e,n){let r=e.value,i=rg(r,n,this.paramsInheritanceStrategy);r.params=Object.freeze(i.params),r.data=Object.freeze(i.data),e.children.forEach(o=>this.inheritParamsAndData(o,r))}processSegmentGroup(e,n,r,i){return r.segments.length===0&&r.hasChildren()?this.processChildren(e,n,r):this.processSegment(e,n,r,r.segments,i,!0).pipe(Oe(o=>o instanceof Vn?[o]:[]))}processChildren(e,n,r){let i=[];for(let o of Object.keys(r.children))o==="primary"?i.unshift(o):i.push(o);return vt(i).pipe(io(o=>{let s=r.children[o],a=_k(n,o);return this.processSegmentGroup(e,a,s,o)}),of((o,s)=>(o.push(...s),o)),xi(null),rf(),bt(o=>{if(o===null)return As(r);let s=pb(o);return Jk(s),me(s)}))}processSegment(e,n,r,i,o,s){return vt(n).pipe(io(a=>this.processSegmentAgainstRoute(a._injector??e,n,a,r,i,o,s).pipe(_i(c=>{if(c instanceof Cc)return me(null);throw c}))),Dr(a=>!!a),_i(a=>{if(hb(a))return Qk(r,i,o)?me(new eg):As(r);throw a}))}processSegmentAgainstRoute(e,n,r,i,o,s,a){return Zk(r,i,o,s)?r.redirectTo===void 0?this.matchSegmentAgainstRoute(e,i,r,o,s):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,i,n,r,o,s):As(i):As(i)}expandSegmentAgainstRouteUsingRedirect(e,n,r,i,o,s){let{matched:a,consumedSegments:c,positionalParamSegments:u,remainingSegments:l}=ag(n,i,o);if(!a)return As(n);i.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>Xk&&(this.allowRedirects=!1));let d=this.applyRedirects.applyRedirectCommands(c,i.redirectTo,u);return this.applyRedirects.lineralizeSegments(i,d).pipe(bt(h=>this.processSegment(e,r,n,h.concat(l),s,!1)))}matchSegmentAgainstRoute(e,n,r,i,o){let s=$k(n,r,i,e,this.urlSerializer);return r.path==="**"&&(n.children={}),s.pipe(Un(a=>a.matched?(e=r._injector??e,this.getChildConfig(e,r,i).pipe(Un(({routes:c})=>{let u=r._loadedInjector??e,{consumedSegments:l,remainingSegments:d,parameters:h}=a,p=new wc(l,h,Object.freeze(T({},this.urlTree.queryParams)),this.urlTree.fragment,tR(r),Vr(r),r.component??r._loadedComponent??null,r,nR(r)),{segmentGroup:y,slicedSegments:v}=qx(n,l,d,c);if(v.length===0&&y.hasChildren())return this.processChildren(u,c,y).pipe(Oe(x=>x===null?null:new Vn(p,x)));if(c.length===0&&v.length===0)return me(new Vn(p,[]));let _=Vr(r)===o;return this.processSegment(u,c,y,v,_?_e:o,!0).pipe(Oe(x=>new Vn(p,x instanceof Vn?[x]:[])))}))):As(n)))}getChildConfig(e,n,r){return n.children?me({routes:n.children,injector:e}):n.loadChildren?n._loadedRoutes!==void 0?me({routes:n._loadedRoutes,injector:n._loadedInjector}):Bk(e,n,r,this.urlSerializer).pipe(bt(i=>i?this.configLoader.loadChildren(e,n).pipe(wt(o=>{n._loadedRoutes=o.routes,n._loadedInjector=o.injector})):qk(n))):me({routes:[],injector:e})}};function Jk(t){t.sort((e,n)=>e.value.outlet===_e?-1:n.value.outlet===_e?1:e.value.outlet.localeCompare(n.value.outlet))}function eR(t){let e=t.value.routeConfig;return e&&e.path===""}function pb(t){let e=[],n=new Set;for(let r of t){if(!eR(r)){e.push(r);continue}let i=e.find(o=>r.value.routeConfig===o.value.routeConfig);i!==void 0?(i.children.push(...r.children),n.add(i)):e.push(r)}for(let r of n){let i=pb(r.children);e.push(new Vn(r.value,i))}return e.filter(r=>!n.has(r))}function tR(t){return t.data||{}}function nR(t){return t.resolve||{}}function rR(t,e,n,r,i,o){return bt(s=>Kk(t,e,n,r,s.extractedUrl,i,o).pipe(Oe(({state:a,tree:c})=>H(T({},s),{targetSnapshot:a,urlAfterRedirects:c}))))}function iR(t,e){return bt(n=>{let{targetSnapshot:r,guards:{canActivateChecks:i}}=n;if(!i.length)return me(n);let o=new Set(i.map(c=>c.route)),s=new Set;for(let c of o)if(!s.has(c))for(let u of mb(c))s.add(u);let a=0;return vt(s).pipe(io(c=>o.has(c)?oR(c,r,t,e):(c.data=rg(c,c.parent,t).resolve,me(void 0))),wt(()=>a++),is(1),bt(c=>a===s.size?me(n):Bn))})}function mb(t){let e=t.children.map(n=>mb(n)).flat();return[t,...e]}function oR(t,e,n,r){let i=t.routeConfig,o=t._resolve;return i?.title!==void 0&&!ab(i)&&(o[Dc]=i.title),sR(o,t,e,r).pipe(Oe(s=>(t._resolvedData=s,t.data=rg(t,t.parent,n).resolve,null)))}function sR(t,e,n,r){let i=Om(t);if(i.length===0)return me({});let o={};return vt(i).pipe(bt(s=>aR(t[s],e,n,r).pipe(Dr(),wt(a=>{o[s]=a}))),is(1),nf(o),_i(s=>hb(s)?Bn:es(s)))}function aR(t,e,n,r){let i=Ac(e)??r,o=Ps(t,i),s=o.resolve?o.resolve(e,n):Ii(i,()=>o(e,n));return Vi(s)}function Mm(t){return Un(e=>{let n=t(e);return n?vt(n).pipe(Oe(()=>e)):me(e)})}var gb=(()=>{let e=class e{buildTitle(r){let i,o=r.root;for(;o!==void 0;)i=this.getResolvedTitleForRoute(o)??i,o=o.children.find(s=>s.outlet===_e);return i}getResolvedTitleForRoute(r){return r.data[Dc]}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(cR))(),providedIn:"root"});let t=e;return t})(),cR=(()=>{let e=class e extends gb{constructor(r){super(),this.title=r}updateTitle(r){let i=this.buildTitle(r);i!==void 0&&this.title.setTitle(i)}};e.\u0275fac=function(i){return new(i||e)(ce(lc))},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Mc=new le("",{providedIn:"root",factory:()=>({})}),od=new le("ROUTES"),cg=(()=>{let e=class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=J(Pl)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return me(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);let i=Vi(r.loadComponent()).pipe(Oe(yb),wt(s=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=s}),Ba(()=>{this.componentLoaders.delete(r)})),o=new Ko(i,()=>new vn).pipe(Qo());return this.componentLoaders.set(r,o),o}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return me({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);let s=uR(i,this.compiler,r,this.onLoadEndListener).pipe(Ba(()=>{this.childrenLoaders.delete(i)})),a=new Ko(s,()=>new vn).pipe(Qo());return this.childrenLoaders.set(i,a),a}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function uR(t,e,n,r){return Vi(t.loadChildren()).pipe(Oe(yb),bt(i=>i instanceof Ka||Array.isArray(i)?me(i):vt(e.compileModuleAsync(i))),Oe(i=>{r&&r(t);let o,s,a=!1;return Array.isArray(i)?(s=i,a=!0):(o=i.create(n).injector,s=o.get(od,[],{optional:!0,self:!0}).flat()),{routes:s.map(sg),injector:o}}))}function lR(t){return t&&typeof t=="object"&&"default"in t}function yb(t){return lR(t)?t.default:t}var ug=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(dR))(),providedIn:"root"});let t=e;return t})(),dR=(()=>{let e=class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,i){return r}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),vb=new le(""),_b=new le("");function hR(t,e,n){let r=t.get(_b),i=t.get(hn);return t.get(ct).runOutsideAngular(()=>{if(!i.startViewTransition||r.skipNextTransition)return r.skipNextTransition=!1,Promise.resolve();let o,s=new Promise(u=>{o=u}),a=i.startViewTransition(()=>(o(),fR(t))),{onViewTransitionCreated:c}=r;return c&&Ii(t,()=>c({transition:a,from:e,to:n})),s})}function fR(t){return new Promise(e=>{Zp(e,{injector:t})})}var lg=(()=>{let e=class e{get hasRequestedNavigation(){return this.navigationId!==0}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new vn,this.transitionAbortSubject=new vn,this.configLoader=J(cg),this.environmentInjector=J(Rn),this.urlSerializer=J(Ec),this.rootContexts=J(Sc),this.location=J(Ss),this.inputBindingEnabled=J(ad,{optional:!0})!==null,this.titleStrategy=J(gb),this.options=J(Mc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=J(ug),this.createViewTransition=J(vb,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>me(void 0),this.rootComponentType=null;let r=o=>this.events.next(new jm(o)),i=o=>this.events.next(new Um(o));this.configLoader.onLoadEndListener=i,this.configLoader.onLoadStartListener=r}complete(){this.transitions?.complete()}handleNavigationRequest(r){let i=++this.navigationId;this.transitions?.next(H(T(T({},this.transitions.value),r),{id:i}))}setupNavigations(r,i,o){return this.transitions=new Yt({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:mc,restoredState:null,currentSnapshot:o.snapshot,targetSnapshot:null,currentRouterState:o,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(jn(s=>s.id!==0),Oe(s=>H(T({},s),{extractedUrl:this.urlHandlingStrategy.extract(s.rawUrl)})),Un(s=>{this.currentTransition=s;let a=!1,c=!1;return me(s).pipe(wt(u=>{this.currentNavigation={id:u.id,initialUrl:u.rawUrl,extractedUrl:u.extractedUrl,trigger:u.source,extras:u.extras,previousNavigation:this.lastSuccessfulNavigation?H(T({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Un(u=>{let l=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),d=u.extras.onSameUrlNavigation??r.onSameUrlNavigation;if(!l&&d!=="reload"){let h="";return this.events.next(new Ri(u.id,this.urlSerializer.serialize(u.rawUrl),h,0)),u.resolve(null),Bn}if(this.urlHandlingStrategy.shouldProcessUrl(u.rawUrl))return me(u).pipe(Un(h=>{let p=this.transitions?.getValue();return this.events.next(new ks(h.id,this.urlSerializer.serialize(h.extractedUrl),h.source,h.restoredState)),p!==this.transitions?.getValue()?Bn:Promise.resolve(h)}),rR(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),wt(h=>{s.targetSnapshot=h.targetSnapshot,s.urlAfterRedirects=h.urlAfterRedirects,this.currentNavigation=H(T({},this.currentNavigation),{finalUrl:h.urlAfterRedirects});let p=new Xl(h.id,this.urlSerializer.serialize(h.extractedUrl),this.urlSerializer.serialize(h.urlAfterRedirects),h.targetSnapshot);this.events.next(p)}));if(l&&this.urlHandlingStrategy.shouldProcessUrl(u.currentRawUrl)){let{id:h,extractedUrl:p,source:y,restoredState:v,extras:_}=u,x=new ks(h,this.urlSerializer.serialize(p),y,v);this.events.next(x);let M=ob(p,this.rootComponentType).snapshot;return this.currentTransition=s=H(T({},u),{targetSnapshot:M,urlAfterRedirects:p,extras:H(T({},_),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=p,me(s)}else{let h="";return this.events.next(new Ri(u.id,this.urlSerializer.serialize(u.extractedUrl),h,1)),u.resolve(null),Bn}}),wt(u=>{let l=new Pm(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(l)}),Oe(u=>(this.currentTransition=s=H(T({},u),{guards:bk(u.targetSnapshot,u.currentSnapshot,this.rootContexts)}),s)),Nk(this.environmentInjector,u=>this.events.next(u)),wt(u=>{if(s.guardsResult=u.guardsResult,Fs(u.guardsResult))throw ub(this.urlSerializer,u.guardsResult);let l=new Vm(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot,!!u.guardsResult);this.events.next(l)}),jn(u=>u.guardsResult?!0:(this.cancelNavigationTransition(u,"",3),!1)),Mm(u=>{if(u.guards.canActivateChecks.length)return me(u).pipe(wt(l=>{let d=new Lm(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(d)}),Un(l=>{let d=!1;return me(l).pipe(iR(this.paramsInheritanceStrategy,this.environmentInjector),wt({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(l,"",2)}}))}),wt(l=>{let d=new Bm(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(d)}))}),Mm(u=>{let l=d=>{let h=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&h.push(this.configLoader.loadComponent(d.routeConfig).pipe(wt(p=>{d.component=p}),Oe(()=>{})));for(let p of d.children)h.push(...l(p));return h};return Va(l(u.targetSnapshot.root)).pipe(xi(null),ei(1))}),Mm(()=>this.afterPreactivation()),Un(()=>{let{currentSnapshot:u,targetSnapshot:l}=s,d=this.createViewTransition?.(this.environmentInjector,u.root,l.root);return d?vt(d).pipe(Oe(()=>s)):me(s)}),Oe(u=>{let l=fk(r.routeReuseStrategy,u.targetSnapshot,u.currentRouterState);return this.currentTransition=s=H(T({},u),{targetRouterState:l}),this.currentNavigation.targetRouterState=l,s}),wt(()=>{this.events.next(new xc)}),xk(this.rootContexts,r.routeReuseStrategy,u=>this.events.next(u),this.inputBindingEnabled),ei(1),wt({next:u=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Pr(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects))),this.titleStrategy?.updateTitle(u.targetRouterState.snapshot),u.resolve(!0)},complete:()=>{a=!0}}),af(this.transitionAbortSubject.pipe(wt(u=>{throw u}))),Ba(()=>{if(!a&&!c){let u="";this.cancelNavigationTransition(s,u,1)}this.currentNavigation?.id===s.id&&(this.currentNavigation=null)}),_i(u=>{if(c=!0,db(u))this.events.next(new ki(s.id,this.urlSerializer.serialize(s.extractedUrl),u.message,u.cancellationCode)),gk(u)?this.events.next(new bc(u.url)):s.resolve(!1);else{this.events.next(new _c(s.id,this.urlSerializer.serialize(s.extractedUrl),u,s.targetSnapshot??void 0));try{s.resolve(r.errorHandler(u))}catch(l){s.reject(l)}}return Bn}))}))}cancelNavigationTransition(r,i,o){let s=new ki(r.id,this.urlSerializer.serialize(r.extractedUrl),i,o);this.events.next(s),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function pR(t){return t!==mc}var mR=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(gR))(),providedIn:"root"});let t=e;return t})(),ng=class{shouldDetach(e){return!1}store(e,n){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,n){return e.routeConfig===n.routeConfig}},gR=(()=>{let e=class e extends ng{};e.\u0275fac=(()=>{let r;return function(o){return(r||(r=tc(e)))(o||e)}})(),e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),xb=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:()=>(()=>J(yR))(),providedIn:"root"});let t=e;return t})(),yR=(()=>{let e=class e extends xb{constructor(){super(...arguments),this.location=J(Ss),this.urlSerializer=J(Ec),this.options=J(Mc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=J(ug),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Fi,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=ob(this.currentUrlTree,null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(i=>{i.type==="popstate"&&r(i.url,i.state)})}handleRouterEvent(r,i){if(r instanceof ks)this.stateMemento=this.createStateMemento();else if(r instanceof Ri)this.rawUrlTree=i.initialUrl;else if(r instanceof Xl){if(this.urlUpdateStrategy==="eager"&&!i.extras.skipLocationChange){let o=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(o,i)}}else r instanceof xc?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,this.urlUpdateStrategy==="deferred"&&(i.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,i))):r instanceof ki&&(r.code===3||r.code===2)?this.restoreHistory(i):r instanceof _c?this.restoreHistory(i,!0):r instanceof Pr&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){let o=this.urlSerializer.serialize(r);if(this.location.isCurrentPathEqualTo(o)||i.extras.replaceUrl){let s=this.browserPageId,a=T(T({},i.extras.state),this.generateNgRouterState(i.id,s));this.location.replaceState(o,"",a)}else{let s=T(T({},i.extras.state),this.generateNgRouterState(i.id,this.browserPageId+1));this.location.go(o,"",s)}}restoreHistory(r,i=!1){if(this.canceledNavigationResolution==="computed"){let o=this.browserPageId,s=this.currentPageId-o;s!==0?this.location.historyGo(s):this.currentUrlTree===r.finalUrl&&s===0&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(i&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,i){return this.canceledNavigationResolution==="computed"?{navigationId:r,\u0275routerPageId:i}:{navigationId:r}}};e.\u0275fac=(()=>{let r;return function(o){return(r||(r=tc(e)))(o||e)}})(),e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),fc=function(t){return t[t.COMPLETE=0]="COMPLETE",t[t.FAILED=1]="FAILED",t[t.REDIRECTING=2]="REDIRECTING",t}(fc||{});function bb(t,e){t.events.pipe(jn(n=>n instanceof Pr||n instanceof ki||n instanceof _c||n instanceof Ri),Oe(n=>n instanceof Pr||n instanceof Ri?fc.COMPLETE:(n instanceof ki?n.code===0||n.code===1:!1)?fc.REDIRECTING:fc.FAILED),jn(n=>n!==fc.REDIRECTING),ei(1)).subscribe(()=>{e()})}function vR(t){throw t}var _R={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},xR={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},Pi=(()=>{let e=class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=J(Rl),this.stateManager=J(xb),this.options=J(Mc,{optional:!0})||{},this.pendingTasks=J(Vl),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=J(lg),this.urlSerializer=J(Ec),this.location=J(Ss),this.urlHandlingStrategy=J(ug),this._events=new vn,this.errorHandler=this.options.errorHandler||vR,this.navigated=!1,this.routeReuseStrategy=J(mR),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=J(od,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!J(ad,{optional:!0}),this.eventsSubscription=new St,this.isNgZoneEnabled=J(ct)instanceof ct&&ct.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){let r=this.navigationTransitions.events.subscribe(i=>{try{let o=this.navigationTransitions.currentTransition,s=this.navigationTransitions.currentNavigation;if(o!==null&&s!==null){if(this.stateManager.handleRouterEvent(i,s),i instanceof ki&&i.code!==0&&i.code!==1)this.navigated=!0;else if(i instanceof Pr)this.navigated=!0;else if(i instanceof bc){let a=this.urlHandlingStrategy.merge(i.url,o.currentRawUrl),c={skipLocationChange:o.extras.skipLocationChange,replaceUrl:this.urlUpdateStrategy==="eager"||pR(o.source)};this.scheduleNavigation(a,mc,null,c,{resolve:o.resolve,reject:o.reject,promise:o.promise})}}wR(i)&&this._events.next(i)}catch(o){this.navigationTransitions.transitionAbortSubject.next(o)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),mc,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription||(this.nonRouterCurrentEntryChangeSubscription=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",i)},0)}))}navigateToSyncWithBrowser(r,i,o){let s={replaceUrl:!0},a=o?.navigationId?o:null;if(o){let u=T({},o);delete u.navigationId,delete u.\u0275routerPageId,Object.keys(u).length!==0&&(s.state=u)}let c=this.parseUrl(r);this.scheduleNavigation(c,i,a,s)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(sg),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,i={}){let{relativeTo:o,queryParams:s,fragment:a,queryParamsHandling:c,preserveFragment:u}=i,l=u?this.currentUrlTree.fragment:a,d=null;switch(c){case"merge":d=T(T({},this.currentUrlTree.queryParams),s);break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=s||null}d!==null&&(d=this.removeEmptyProps(d));let h;try{let p=o?o.snapshot:this.routerState.snapshot.root;h=tb(p)}catch{(typeof r[0]!="string"||!r[0].startsWith("/"))&&(r=[]),h=this.currentUrlTree.root}return nb(h,r,d,l??null)}navigateByUrl(r,i={skipLocationChange:!1}){let o=Fs(r)?r:this.parseUrl(r),s=this.urlHandlingStrategy.merge(o,this.rawUrlTree);return this.scheduleNavigation(s,mc,null,i)}navigate(r,i={skipLocationChange:!1}){return bR(r),this.navigateByUrl(this.createUrlTree(r,i),i)}serializeUrl(r){return this.urlSerializer.serialize(r)}parseUrl(r){try{return this.urlSerializer.parse(r)}catch{return this.urlSerializer.parse("/")}}isActive(r,i){let o;if(i===!0?o=T({},_R):i===!1?o=T({},xR):o=i,Fs(r))return Vx(this.currentUrlTree,r,o);let s=this.parseUrl(r);return Vx(this.currentUrlTree,s,o)}removeEmptyProps(r){return Object.keys(r).reduce((i,o)=>{let s=r[o];return s!=null&&(i[o]=s),i},{})}scheduleNavigation(r,i,o,s,a){if(this.disposed)return Promise.resolve(!1);let c,u,l;a?(c=a.resolve,u=a.reject,l=a.promise):l=new Promise((h,p)=>{c=h,u=p});let d=this.pendingTasks.add();return bb(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:o,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:s,resolve:c,reject:u,promise:l,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),l.catch(h=>Promise.reject(h))}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function bR(t){for(let e=0;e{let e=class e{constructor(r,i,o,s,a,c){this.router=r,this.route=i,this.tabIndexAttribute=o,this.renderer=s,this.el=a,this.locationStrategy=c,this.href=null,this.commands=null,this.onChanges=new vn,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;let u=a.nativeElement.tagName?.toLowerCase();this.isAnchorElement=u==="a"||u==="area",this.isAnchorElement?this.subscription=r.events.subscribe(l=>{l instanceof Pr&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(r){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",r)}ngOnChanges(r){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(r){r!=null?(this.commands=Array.isArray(r)?r:[r],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(r,i,o,s,a){if(this.urlTree===null||this.isAnchorElement&&(r!==0||i||o||s||a||typeof this.target=="string"&&this.target!="_self"))return!0;let c={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state};return this.router.navigateByUrl(this.urlTree,c),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){this.href=this.urlTree!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(this.urlTree)):null;let r=this.href===null?null:E0(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",r)}applyAttributeValue(r,i){let o=this.renderer,s=this.el.nativeElement;i!==null?o.setAttribute(s,r,i):o.removeAttribute(s,r)}get urlTree(){return this.commands===null?null:this.router.createUrlTree(this.commands,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}};e.\u0275fac=function(i){return new(i||e)(ve(Pi),ve(ai),Ep("tabindex"),ve(_o),ve(dn),ve(si))},e.\u0275dir=Hn({type:e,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(i,o){i&1&&Pe("click",function(a){return o.onClick(a.button,a.ctrlKey,a.shiftKey,a.altKey,a.metaKey)}),i&2&&xo("target",o.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",relativeTo:"relativeTo",preserveFragment:["preserveFragment","preserveFragment",wo],skipLocationChange:["skipLocationChange","skipLocationChange",wo],replaceUrl:["replaceUrl","replaceUrl",wo],routerLink:"routerLink"},standalone:!0,features:[Kp,ii]});let t=e;return t})();var sd=class{};var TR=(()=>{let e=class e{constructor(r,i,o,s,a){this.router=r,this.injector=o,this.preloadingStrategy=s,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(jn(r=>r instanceof Pr),io(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,i){let o=[];for(let s of i){s.providers&&!s._injector&&(s._injector=kl(s.providers,r,`Route: ${s.path}`));let a=s._injector??r,c=s._loadedInjector??a;(s.loadChildren&&!s._loadedRoutes&&s.canLoad===void 0||s.loadComponent&&!s._loadedComponent)&&o.push(this.preloadConfig(a,s)),(s.children||s._loadedRoutes)&&o.push(this.processRoutes(c,s.children??s._loadedRoutes))}return vt(o).pipe(ns())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let o;i.loadChildren&&i.canLoad===void 0?o=this.loader.loadChildren(r,i):o=me(null);let s=o.pipe(bt(a=>a===null?me(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));if(i.loadComponent&&!i._loadedComponent){let a=this.loader.loadComponent(i);return vt([s,a]).pipe(ns())}else return s})}};e.\u0275fac=function(i){return new(i||e)(ce(Pi),ce(Pl),ce(Rn),ce(sd),ce(cg))},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Tb=new le(""),CR=(()=>{let e=class e{constructor(r,i,o,s,a={}){this.urlSerializer=r,this.transitions=i,this.viewportScroller=o,this.zone=s,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},a.scrollPositionRestoration=a.scrollPositionRestoration||"disabled",a.anchorScrolling=a.anchorScrolling||"disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof ks?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Pr?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof Ri&&r.code===0&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof Jl&&(r.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(r.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,i){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new Jl(r,this.lastSource==="popstate"?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}};e.\u0275fac=function(i){F0()},e.\u0275prov=se({token:e,factory:e.\u0275fac});let t=e;return t})();function DR(t){return t.routerState.root}function Nc(t,e){return{\u0275kind:t,\u0275providers:e}}function ER(){let t=J(Wn);return e=>{let n=t.get(Es);if(e!==n.components[0])return;let r=t.get(Pi),i=t.get(Cb);t.get(dg)===1&&r.initialNavigation(),t.get(Db,null,we.Optional)?.setUpPreloading(),t.get(Tb,null,we.Optional)?.init(),r.resetRootComponentType(n.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}var Cb=new le("",{factory:()=>new vn}),dg=new le("",{providedIn:"root",factory:()=>1});function SR(){return Nc(2,[{provide:dg,useValue:0},{provide:jl,multi:!0,deps:[Wn],useFactory:e=>{let n=e.get(wx,Promise.resolve());return()=>n.then(()=>new Promise(r=>{let i=e.get(Pi),o=e.get(Cb);bb(i,()=>{r(!0)}),e.get(lg).afterPreactivation=()=>(r(!0),o.closed?me(void 0):o),i.initialNavigation()}))}}])}function AR(){return Nc(3,[{provide:jl,multi:!0,useFactory:()=>{let e=J(Pi);return()=>{e.setUpLocationChangeListener()}}},{provide:dg,useValue:2}])}var Db=new le("");function IR(t){return Nc(0,[{provide:Db,useExisting:TR},{provide:sd,useExisting:t}])}function MR(){return Nc(8,[Ux,{provide:ad,useExisting:Ux}])}function NR(t){let e=[{provide:vb,useValue:hR},{provide:_b,useValue:T({skipNextTransition:!!t?.skipInitialTransition},t)}];return Nc(9,e)}var $x=new le("ROUTER_FORROOT_GUARD"),OR=[Ss,{provide:Ec,useClass:yc},Pi,Sc,{provide:ai,useFactory:DR,deps:[Pi]},cg,[]],Eb=(()=>{let e=class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[OR,[],{provide:od,multi:!0,useValue:r},{provide:$x,useFactory:PR,deps:[[Pi,new Dl,new Ap]]},{provide:Mc,useValue:i||{}},i?.useHash?kR():RR(),FR(),i?.preloadingStrategy?IR(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?VR(i):[],i?.bindToComponentInputs?MR().\u0275providers:[],i?.enableViewTransitions?NR().\u0275providers:[],LR()]}}static forChild(r){return{ngModule:e,providers:[{provide:od,multi:!0,useValue:r}]}}};e.\u0275fac=function(i){return new(i||e)(ce($x,8))},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({});let t=e;return t})();function FR(){return{provide:Tb,useFactory:()=>{let t=J(Sx),e=J(ct),n=J(Mc),r=J(lg),i=J(Ec);return n.scrollOffset&&t.setOffset(n.scrollOffset),new CR(i,r,t,e,n)}}}function kR(){return{provide:si,useClass:Cx}}function RR(){return{provide:si,useClass:gm}}function PR(t){return"guarded"}function VR(t){return[t.initialNavigation==="disabled"?AR().\u0275providers:[],t.initialNavigation==="enabledBlocking"?SR().\u0275providers:[]]}var Hx=new le("");function LR(){return[{provide:Hx,useFactory:ER},{provide:sm,multi:!0,useExisting:Hx}]}var Rb=(()=>{let e=class e{constructor(r,i){this._renderer=r,this._elementRef=i,this.onChange=o=>{},this.onTouched=()=>{}}setProperty(r,i){this._renderer.setProperty(this._elementRef.nativeElement,r,i)}registerOnTouched(r){this.onTouched=r}registerOnChange(r){this.onChange=r}setDisabledState(r){this.setProperty("disabled",r)}};e.\u0275fac=function(i){return new(i||e)(ve(_o),ve(dn))},e.\u0275dir=Hn({type:e});let t=e;return t})(),BR=(()=>{let e=class e extends Rb{};e.\u0275fac=(()=>{let r;return function(o){return(r||(r=tc(e)))(o||e)}})(),e.\u0275dir=Hn({type:e,features:[Ds]});let t=e;return t})(),Pb=new le("NgValueAccessor");var jR={provide:Pb,useExisting:Xa(()=>hd),multi:!0};function UR(){let t=Fr()?Fr().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}var qR=new le("CompositionEventMode"),hd=(()=>{let e=class e extends Rb{constructor(r,i,o){super(r,i),this._compositionMode=o,this._composing=!1,this._compositionMode==null&&(this._compositionMode=!UR())}writeValue(r){let i=r??"";this.setProperty("value",i)}_handleInput(r){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(r)}_compositionStart(){this._composing=!0}_compositionEnd(r){this._composing=!1,this._compositionMode&&this.onChange(r)}};e.\u0275fac=function(i){return new(i||e)(ve(_o),ve(dn),ve(qR,8))},e.\u0275dir=Hn({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&Pe("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},features:[em([jR]),Ds]});let t=e;return t})();var $R=new le("NgValidators"),HR=new le("NgAsyncValidators");function Vb(t){return t!=null}function Lb(t){return bo(t)?vt(t):t}function Bb(t){let e={};return t.forEach(n=>{e=n!=null?T(T({},e),n):e}),Object.keys(e).length===0?null:e}function jb(t,e){return e.map(n=>n(t))}function GR(t){return!t.validate}function Ub(t){return t.map(e=>GR(e)?e:n=>e.validate(n))}function WR(t){if(!t)return null;let e=t.filter(Vb);return e.length==0?null:function(n){return Bb(jb(n,e))}}function qb(t){return t!=null?WR(Ub(t)):null}function zR(t){if(!t)return null;let e=t.filter(Vb);return e.length==0?null:function(n){let r=jb(n,e).map(Lb);return ef(r).pipe(Oe(Bb))}}function $b(t){return t!=null?zR(Ub(t)):null}function Ab(t,e){return t===null?[e]:Array.isArray(t)?[...t,e]:[t,e]}function YR(t){return t._rawValidators}function ZR(t){return t._rawAsyncValidators}function hg(t){return t?Array.isArray(t)?t:[t]:[]}function ld(t,e){return Array.isArray(t)?t.includes(e):t===e}function Ib(t,e){let n=hg(e);return hg(t).forEach(i=>{ld(n,i)||n.push(i)}),n}function Mb(t,e){return hg(e).filter(n=>!ld(t,n))}var dd=class{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=qb(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=$b(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,n){return this.control?this.control.hasError(e,n):!1}getError(e,n){return this.control?this.control.getError(e,n):null}},fg=class extends dd{get formDirective(){return null}get path(){return null}},kc=class extends dd{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}},pg=class{constructor(e){this._cd=e}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}},QR={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},aU=H(T({},QR),{"[class.ng-submitted]":"isSubmitted"}),Hb=(()=>{let e=class e extends pg{constructor(r){super(r)}};e.\u0275fac=function(i){return new(i||e)(ve(kc,2))},e.\u0275dir=Hn({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&hr("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},features:[Ds]});let t=e;return t})();var Oc="VALID",ud="INVALID",Vs="PENDING",Fc="DISABLED";function KR(t){return(fd(t)?t.validators:t)||null}function XR(t){return Array.isArray(t)?qb(t):t||null}function JR(t,e){return(fd(e)?e.asyncValidators:t)||null}function e2(t){return Array.isArray(t)?$b(t):t||null}function fd(t){return t!=null&&!Array.isArray(t)&&typeof t=="object"}var mg=class{constructor(e,n){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(e),this._assignAsyncValidators(n)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Oc}get invalid(){return this.status===ud}get pending(){return this.status==Vs}get disabled(){return this.status===Fc}get enabled(){return this.status!==Fc}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(Ib(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(Ib(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Mb(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Mb(e,this._rawAsyncValidators))}hasValidator(e){return ld(this._rawValidators,e)}hasAsyncValidator(e){return ld(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(n=>{n.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(n=>{n.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Vs,e.emitEvent!==!1&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){let n=this._parentMarkedDirty(e.onlySelf);this.status=Fc,this.errors=null,this._forEachChild(r=>{r.disable(H(T({},e),{onlySelf:!0}))}),this._updateValue(),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(H(T({},e),{skipPristineCheck:n})),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let n=this._parentMarkedDirty(e.onlySelf);this.status=Oc,this._forEachChild(r=>{r.enable(H(T({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(H(T({},e),{skipPristineCheck:n})),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Oc||this.status===Vs)&&this._runAsyncValidator(e.emitEvent)),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(n=>n._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Fc:Oc}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Vs,this._hasOwnPendingAsyncValidator=!0;let n=Lb(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(r=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(r,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,n={}){this.errors=e,this._updateControlsErrors(n.emitEvent!==!1)}get(e){let n=e;return n==null||(Array.isArray(n)||(n=n.split(".")),n.length===0)?null:n.reduce((r,i)=>r&&r._find(i),this)}getError(e,n){let r=n?this.get(n):this;return r&&r.errors?r.errors[e]:null}hasError(e,n){return!!this.getError(e,n)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Le,this.statusChanges=new Le}_calculateStatus(){return this._allControlsDisabled()?Fc:this.errors?ud:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Vs)?Vs:this._anyControlsHaveStatus(ud)?ud:Oc}_anyControlsHaveStatus(e){return this._anyControls(n=>n.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){fd(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let n=this._parent&&this._parent.dirty;return!e&&!!n&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=XR(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=e2(this._rawAsyncValidators)}};var gg=new le("CallSetDisabledState",{providedIn:"root",factory:()=>pd}),pd="always";function t2(t,e){return[...e.path,t]}function n2(t,e,n=pd){i2(t,e),e.valueAccessor.writeValue(t.value),(t.disabled||n==="always")&&e.valueAccessor.setDisabledState?.(t.disabled),o2(t,e),a2(t,e),s2(t,e),r2(t,e)}function Nb(t,e){t.forEach(n=>{n.registerOnValidatorChange&&n.registerOnValidatorChange(e)})}function r2(t,e){if(e.valueAccessor.setDisabledState){let n=r=>{e.valueAccessor.setDisabledState(r)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}function i2(t,e){let n=YR(t);e.validator!==null?t.setValidators(Ab(n,e.validator)):typeof n=="function"&&t.setValidators([n]);let r=ZR(t);e.asyncValidator!==null?t.setAsyncValidators(Ab(r,e.asyncValidator)):typeof r=="function"&&t.setAsyncValidators([r]);let i=()=>t.updateValueAndValidity();Nb(e._rawValidators,i),Nb(e._rawAsyncValidators,i)}function o2(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,t.updateOn==="change"&&Gb(t,e)})}function s2(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,t.updateOn==="blur"&&t._pendingChange&&Gb(t,e),t.updateOn!=="submit"&&t.markAsTouched()})}function Gb(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function a2(t,e){let n=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}function c2(t,e){if(!t.hasOwnProperty("model"))return!1;let n=t.model;return n.isFirstChange()?!0:!Object.is(e,n.currentValue)}function u2(t){return Object.getPrototypeOf(t.constructor)===BR}function l2(t,e){if(!e)return null;Array.isArray(e);let n,r,i;return e.forEach(o=>{o.constructor===hd?n=o:u2(o)?r=o:i=o}),i||r||n||null}function Ob(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function Fb(t){return typeof t=="object"&&t!==null&&Object.keys(t).length===2&&"value"in t&&"disabled"in t}var d2=class extends mg{constructor(e=null,n,r){super(KR(n),JR(r,n)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(n),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),fd(n)&&(n.nonNullable||n.initialValueIsDefault)&&(Fb(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,n={}){this.value=this._pendingValue=e,this._onChange.length&&n.emitModelToViewChange!==!1&&this._onChange.forEach(r=>r(this.value,n.emitViewToModelChange!==!1)),this.updateValueAndValidity(n)}patchValue(e,n={}){this.setValue(e,n)}reset(e=this.defaultValue,n={}){this._applyFormState(e),this.markAsPristine(n),this.markAsUntouched(n),this.setValue(this.value,n),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Ob(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Ob(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Fb(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var h2={provide:kc,useExisting:Xa(()=>yg)},kb=(()=>Promise.resolve())(),yg=(()=>{let e=class e extends kc{constructor(r,i,o,s,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this.control=new d2,this._registered=!1,this.name="",this.update=new Le,this._parent=r,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=l2(this,s)}ngOnChanges(r){if(this._checkForErrors(),!this._registered||"name"in r){if(this._registered&&(this._checkName(),this.formDirective)){let i=r.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in r&&this._updateDisabled(r),c2(r,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(r){this.viewModel=r,this.update.emit(r)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){n2(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(r){kb.then(()=>{this.control.setValue(r,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(r){let i=r.isDisabled.currentValue,o=i!==0&&wo(i);kb.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(r){return this._parent?t2(r,this._parent):[r]}};e.\u0275fac=function(i){return new(i||e)(ve(fg,9),ve($R,10),ve(HR,10),ve(Pb,10),ve(zn,8),ve(gg,8))},e.\u0275dir=Hn({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[em([h2]),Ds,ii]});let t=e;return t})();var f2=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({});let t=e;return t})();var p2=new le("NgModelWithFormControlWarning");var Wb=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({imports:[f2]});let t=e;return t})();var Ls=(()=>{let e=class e{static withConfig(r){return{ngModule:e,providers:[{provide:gg,useValue:r.callSetDisabledState??pd}]}}};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({imports:[Wb]});let t=e;return t})(),zb=(()=>{let e=class e{static withConfig(r){return{ngModule:e,providers:[{provide:p2,useValue:r.warnOnNgModelWithFormControl??"always"},{provide:gg,useValue:r.callSetDisabledState??pd}]}}};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e}),e.\u0275inj=xn({imports:[Wb]});let t=e;return t})();var Yb=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-root"]],decls:2,vars:0,consts:[[1,"container"]],template:function(i,o){i&1&&(Ee(0,"div",0),Be(1,"router-outlet"),Se())},dependencies:[og]});let t=e;return t})();function Lr(t,e=0){return Array.from(new Array(t).keys()).map(n=>n+e)}function Bs(t){throw alert(t),new Error(t)}var js=class t{constructor(e=1,n=1,r=1,i=""){this.bar=e,this.beat=n,this.division=r,this.note=i}static from(e){return Object.assign(new t,e)}static fromEach(e){return e.map(n=>this.from(n))}get timeCode(){return vg(this.bar,this.beat,this.division)}};function vg(t=1,e=1,n=1){let r=n>1?`.${n}`:"";return(r||e>1)&&(r=`.${e}${r}`),`${t}${r}`}var _g=(()=>{let e=class e{get timeCode(){return vg(this.barNumber,this.beatNumber,this.beatDivisionNumber)}get onTheBeat(){return this.beatDivisionNumber==1}get title(){return this.timeCode}get event(){return this.events.find(r=>r.bar===this.barNumber&&r.beat===this.beatNumber&&r.division===this.beatDivisionNumber&&r.note===this.note)}onClick(){return this.clickLine.emit(this),!1}get height(){return this.el.nativeElement.getBoundingClientRect().height}get top(){return this.el.nativeElement.getBoundingClientRect().top}constructor(r){this.el=r,this.lineIndex=0,this.note="",this.barNumber=1,this.beatNumber=1,this.beatDivisionNumber=1,this.events=[],this.clickLine=new Le}};e.\u0275fac=function(i){return new(i||e)(ve(dn))},e.\u0275cmp=ut({type:e,selectors:[["app-rythm-bar-beat-division-line"]],hostVars:5,hostBindings:function(i,o){i&1&&Pe("click",function(){return o.onClick()}),i&2&&(Xp("title",o.title),hr("on-the-beat",o.onTheBeat)("bottom-line",o.bottomLine))},inputs:{lineIndex:"lineIndex",note:"note",barNumber:"barNumber",beatNumber:"beatNumber",beatDivisionNumber:"beatDivisionNumber",events:"events",bottomLine:"bottomLine"},outputs:{clickLine:"clickLine"},standalone:!0,features:[pt],decls:0,vars:0,template:function(i,o){},dependencies:[kt],styles:["[_nghost-%COMP%]{background:white;aspect-ratio:1.7142857143;font-size:10pt;border-top:solid 1px black}.bottom-line[_nghost-%COMP%]{border-bottom:solid 1px black}.on-the-beat[_nghost-%COMP%]{background:#EEE}[_nghost-%COMP%]:hover{background:rgb(255,255,155)}"]});let t=e;return t})();var Zb=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-note"]],standalone:!0,features:[pt],decls:1,vars:0,consts:[["src","assets/images/WholeNote-centered.svg"]],template:function(i,o){i&1&&Be(0,"img",0)},styles:["[_nghost-%COMP%]{aspect-ratio:12/7;pointer-events:none}img[_ngcontent-%COMP%]{display:block;width:100%;pointer-events:none}"]});let t=e;return t})();function g2(t,e){if(t&1){let n=It();Ee(0,"app-rythm-bar-beat-division-line",2),Pe("clickLine",function(i){et(n);let o=re();return tt(o.onClickLine(i))}),Se()}if(t&2){let n=e.$implicit,r=re();ne("barNumber",r.barNumber)("beatNumber",r.beatNumber)("beatDivisionNumber",r.number)("lineIndex",n)("note",r.note(n+1))("bottomLine",n+1===r.linesArray.length)("events",r.events)}}function y2(t,e){if(t&1&&(ze(0),Ee(1,"div",3),je(2),Se(),Ye()),t&2){let n=re();ee(2),_t("V",n.beatNumber,"")}}function v2(t,e){if(t&1&&Be(0,"app-note"),t&2){let n=e.ngIf,r=re(3);Fl("width",r.width,"px")("top",r.getNoteOffsetTop(n),"px")}}function _2(t,e){if(t&1&&(ze(0),Re(1,v2,1,4,"app-note",5),Ye()),t&2){let n=e.$implicit,r=re(2);ee(1),ne("ngIf",r.line(n))}}function x2(t,e){if(t&1&&(ze(0),Re(1,_2,2,1,"ng-container",4),Ye()),t&2){let n=re();ee(1),ne("ngForOf",n.eventsOnThisDivision)}}var Qb=(()=>{let e=class e{get active(){if(!this.timecode)return!1;let r=this.timecode.split("."),i=+r[0],o=+r[1],s=+r[2];return i===this.barNumber&&o===this.beatNumber&&s===this.number}get width(){return this.widthV2}get top(){return this.el.nativeElement.getBoundingClientRect().top}get widthV1(){return this.el.nativeElement.offsetWidth}get widthV2(){return this.el.nativeElement.getBoundingClientRect().width}getNoteOffsetTop(r){return this.getNoteOffsetTopV2(r)}getNoteOffsetTopV1(r){let o=this.width/1.7142857142857142*.97,s=1;return(r-1)*(o+s)}getNoteOffsetTopV2(r){if(this.lineComponents){let i=this.minLineComponent(r);if(i?.top!==void 0){let o=this.maxLineComponent(r);if(o===i)return i.top-this.top;if(o?.top!==void 0){let s=r%1;return i.top-this.top+(o.top-this.top)*s}}}return console.warn("Impossible de calculer getNoteOffsetTopV2 => on utilise getNoteOffsetTopV1"),this.getNoteOffsetTopV1(r)}lineComponent(r){return this.lineComponents?.get(r-1)}minLineComponent(r){return this.lineComponent(Math.floor(r))}maxLineComponent(r){return this.lineComponent(Math.ceil(r))}get eventsOnThisDivision(){return this.events.filter(r=>r.bar===this.barNumber&&r.beat===this.beatNumber&&r.division==this.number)}get linesArray(){return this._linesArray||(this._linesArray=Lr(this.lines)),this._linesArray}constructor(r,i){this.el=r,this.changeDetectorRef=i,this.number=1,this.barNumber=1,this.beatNumber=1,this.lines=2,this.events=[],this.addEvent=new Le,this.removeEvent=new Le}ngAfterViewInit(){this.changeDetectorRef.detectChanges(),this.detectChangesOnWindowResize()}detectChangesOnWindowResize(){La(window,"resize").pipe(wt(()=>console.log("window resize")),tf(1e3),wt(()=>console.log("debounced window resize"))).subscribe()}line(r){switch(r.note){case"kick":return this.lines;case"snare":return this.lines-1;default:throw new Error("Unknown note "+r.note)}}note(r){switch(r){case this.lines:return"kick";case this.lines-1:return"snare";default:throw new Error("Unknown line "+r)}}onClickLine(r){let i=r.event;if(i)return this.removeEvent.emit(i);let o=this.note(r.lineIndex+1),s=new js(this.barNumber,this.beatNumber,r.beatDivisionNumber,o);this.addEvent.emit(s)}};e.\u0275fac=function(i){return new(i||e)(ve(dn),ve(zn))},e.\u0275cmp=ut({type:e,selectors:[["app-rythm-bar-beat-division"]],viewQuery:function(i,o){if(i&1&&sx(_g,5),i&2){let s;nm(s=rm())&&(o.lineComponents=s)}},hostVars:2,hostBindings:function(i,o){i&2&&hr("active",o.active)},inputs:{number:"number",barNumber:"barNumber",beatNumber:"beatNumber",lines:"lines",events:"events",timecode:"timecode"},outputs:{addEvent:"addEvent",removeEvent:"removeEvent"},standalone:!0,features:[pt],decls:3,vars:3,consts:[[3,"barNumber","beatNumber","beatDivisionNumber","lineIndex","note","bottomLine","events","clickLine",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"barNumber","beatNumber","beatDivisionNumber","lineIndex","note","bottomLine","events","clickLine"],[1,"beat-number"],[4,"ngFor","ngForOf"],[3,"width","top",4,"ngIf"]],template:function(i,o){i&1&&Re(0,g2,1,7,"app-rythm-bar-beat-division-line",0)(1,y2,3,1,"ng-container",1)(2,x2,2,1,"ng-container",1),i&2&&(ne("ngForOf",o.linesArray),ee(1),ne("ngIf",o.number==1),ee(1),ne("ngIf",o.lineComponents))},dependencies:[kt,Tn,kr,_g,Zb],styles:['[_nghost-%COMP%]{flex:1;display:flex;flex-direction:column;position:relative}@font-face{font-family:Beats;src:local("Beats"),url("./media/Beats-JVHCVOT7.woff2") format("woff2")}.beat-number[_ngcontent-%COMP%]{font-family:Beats;font-size:4vw}app-note[_ngcontent-%COMP%]{position:absolute;width:24px}[_nghost-%COMP%]:hover, .active[_nghost-%COMP%]{background:rgb(255,255,155);color:#000}']});let t=e;return t})();function b2(t,e){if(t&1){let n=It();Ee(0,"app-rythm-bar-beat-division",1),Pe("addEvent",function(i){et(n);let o=re();return tt(o.addEvent.emit(i))})("removeEvent",function(i){et(n);let o=re();return tt(o.removeEvent.emit(i))}),Se()}if(t&2){let n=e.$implicit,r=re();ne("barNumber",r.barNumber)("beatNumber",r.number)("number",n)("events",r.events)("timecode",r.timecode)}}var Kb=(()=>{let e=class e{constructor(){this.number=1,this.barNumber=1,this.beatDivision=4,this.events=[],this.addEvent=new Le,this.removeEvent=new Le}get beatDivisionArray(){return this._beatDivisionArray||(this._beatDivisionArray=Lr(this.beatDivision,1)),this._beatDivisionArray}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-rythm-bar-beat"]],inputs:{number:"number",barNumber:"barNumber",beatDivision:"beatDivision",events:"events",timecode:"timecode"},outputs:{addEvent:"addEvent",removeEvent:"removeEvent"},standalone:!0,features:[pt],decls:1,vars:1,consts:[[3,"barNumber","beatNumber","number","events","timecode","addEvent","removeEvent",4,"ngFor","ngForOf"],[3,"barNumber","beatNumber","number","events","timecode","addEvent","removeEvent"]],template:function(i,o){i&1&&Re(0,b2,1,5,"app-rythm-bar-beat-division",0),i&2&&ne("ngForOf",o.beatDivisionArray)},dependencies:[kt,Tn,Qb],styles:["[_nghost-%COMP%]{flex:1;display:flex;flex-direction:row}"]});let t=e;return t})();function w2(t,e){if(t&1){let n=It();Ee(0,"app-rythm-bar-beat",1),Pe("addEvent",function(i){et(n);let o=re();return tt(o.addEvent.emit(i))})("removeEvent",function(i){et(n);let o=re();return tt(o.removeEvent.emit(i))}),Se()}if(t&2){let n=e.$implicit,r=re();ne("number",n)("barNumber",r.number)("beatDivision",r.beatDivision)("events",r.events)("timecode",r.timecode)}}var md=(()=>{let e=class e{constructor(){this.number=1,this.beats=4,this.beatDivision=4,this.events=[],this.addEvent=new Le,this.removeEvent=new Le}get beatsArray(){return this._beatsArray||(this._beatsArray=Lr(this.beats,1)),this._beatsArray}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-rythm-bar"]],inputs:{number:"number",beats:"beats",beatDivision:"beatDivision",events:"events",timecode:"timecode"},outputs:{addEvent:"addEvent",removeEvent:"removeEvent"},standalone:!0,features:[pt],decls:1,vars:1,consts:[[3,"number","barNumber","beatDivision","events","timecode","addEvent","removeEvent",4,"ngFor","ngForOf"],[3,"number","barNumber","beatDivision","events","timecode","addEvent","removeEvent"]],template:function(i,o){i&1&&Re(0,w2,1,5,"app-rythm-bar-beat",0),i&2&&ne("ngForOf",o.beatsArray)},dependencies:[kt,Tn,Kb],styles:["[_nghost-%COMP%]{display:flex}"]});let t=e;return t})();var T2=["*"],Xb=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-pattern"]],standalone:!0,features:[pt],ngContentSelectors:T2,decls:1,vars:0,template:function(i,o){i&1&&(nx(),rx(0))},styles:["[_nghost-%COMP%]{display:block;flex:0 1cm}"]});let t=e;return t})();function C2(t,e){if(t&1){let n=It();Ee(0,"app-pattern",2),Pe("click",function(){let o=et(n).$implicit,s=re(2);return tt(s.onClickPatternInStructure(o))}),je(1),Se()}if(t&2){let n=e.$implicit,r=re(2);hr("active",n==r.currentPatternInStructure),ee(1),oc(n.initial)}}function D2(t,e){if(t&1&&(ze(0),Re(1,C2,2,3,"app-pattern",1),Ye()),t&2){let n=re();ee(1),ne("ngForOf",n.structure.patternsInStructure)}}var gd=(()=>{let e=class e{constructor(){this.clickPatternInStructure=new Le}onClickPatternInStructure(r){this.clickPatternInStructure.emit(r)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-structure"]],inputs:{structure:"structure",currentPatternInStructure:"currentPatternInStructure"},outputs:{clickPatternInStructure:"clickPatternInStructure"},standalone:!0,features:[pt],decls:1,vars:1,consts:[[4,"ngIf"],[3,"active","click",4,"ngFor","ngForOf"],[3,"click"]],template:function(i,o){i&1&&Re(0,D2,2,1,"ng-container",0),i&2&&ne("ngIf",o.structure)},dependencies:[Xb,kt,Tn,kr],styles:["[_nghost-%COMP%]{display:flex;flex-wrap:wrap}app-pattern.active[_ngcontent-%COMP%]{color:#fff}"]});let t=e;return t})();var Rc="14.7.77";var Cn=hu(wg());var fw=()=>new DOMException("","AbortError");var pw=t=>(e,n,[r,i,o],s)=>{t(e[i],[n,r,o],a=>a[0]===n&&a[1]===r,s)};var mw=t=>(e,n,r)=>{let i=[];for(let o=0;o(e,n)=>{t.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:n})};var Br=new WeakSet,vd=new WeakMap,Us=new WeakMap,_d=new WeakMap,Wc=new WeakMap,qs=new WeakMap,xd=new WeakMap,zc=new WeakMap,Yc=new WeakMap,Zc=new WeakMap;var yw={construct(){return yw}},vw=t=>{try{let e=new Proxy(t,yw);new e}catch{return!1}return!0};var _w=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,Tg=(t,e)=>{let n=[],r=t.replace(/^[\s]+/,""),i=r.match(_w);for(;i!==null;){let o=i[1].slice(1,-1),s=i[0].replace(/([\s]+)?;?$/,"").replace(o,new URL(o,e).toString());n.push(s),r=r.slice(i[0].length).replace(/^[\s]+/,""),i=r.match(_w)}return[n.join(";"),r]};var xw=t=>{if(t!==void 0&&!Array.isArray(t))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},bw=t=>{if(!vw(t))throw new TypeError("The given value for processorCtor should be a constructor.");if(t.prototype===null||typeof t.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},ww=(t,e,n,r,i,o,s,a,c,u,l,d,h)=>{let p=0;return(y,v,_={credentials:"omit"})=>{let x=l.get(y);if(x!==void 0&&x.has(v))return Promise.resolve();let M=u.get(y);if(M!==void 0){let S=M.get(v);if(S!==void 0)return S}let I=o(y),L=I.audioWorklet===void 0?i(v).then(([S,D])=>{let[w,m]=Tg(S,D),j=`${w};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${m} +})})(window,'_AWGS')`;return n(j)}).then(()=>{let S=h._AWGS.pop();if(S===void 0)throw new SyntaxError;r(I.currentTime,I.sampleRate,()=>S(class{},void 0,(D,w)=>{if(D.trim()==="")throw e();let m=Yc.get(I);if(m!==void 0){if(m.has(D))throw e();bw(w),xw(w.parameterDescriptors),m.set(D,w)}else bw(w),xw(w.parameterDescriptors),Yc.set(I,new Map([[D,w]]))},I.sampleRate,void 0,void 0))}):Promise.all([i(v),Promise.resolve(t(d,d))]).then(([[S,D],w])=>{let m=p+1;p=m;let[j,K]=Tg(S,D),O=`${j};((AudioWorkletProcessor,registerProcessor)=>{${K} +})(${w?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${w?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${w?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${m}',class extends AudioWorkletProcessor{process(){return !1}})`,N=new Blob([O],{type:"application/javascript; charset=utf-8"}),A=URL.createObjectURL(N);return I.audioWorklet.addModule(A,_).then(()=>{if(a(I))return I;let F=s(I);return F.audioWorklet.addModule(A,_).then(()=>F)}).then(F=>{if(c===null)throw new SyntaxError;try{new c(F,`__sac${m}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(A))});return M===void 0?u.set(y,new Map([[v,L]])):M.set(v,L),L.then(()=>{let S=l.get(y);S===void 0?l.set(y,new Set([v])):S.add(v)}).finally(()=>{let S=u.get(y);S!==void 0&&S.delete(v)}),L}};var Rt=(t,e)=>{let n=t.get(e);if(n===void 0)throw new Error("A value with the given key could not be found.");return n};var Li=(t,e)=>{let n=Array.from(t).filter(e);if(n.length>1)throw Error("More than one element was found.");if(n.length===0)throw Error("No element was found.");let[r]=n;return t.delete(r),r};var bd=(t,e,n,r)=>{let i=Rt(t,e),o=Li(i,s=>s[0]===n&&s[1]===r);return i.size===0&&t.delete(e),o};var jr=t=>Rt(xd,t);var fr=t=>{if(Br.has(t))throw new Error("The AudioNode is already stored.");Br.add(t),jr(t).forEach(e=>e(!0))};var wd=t=>"port"in t;var Ur=t=>{if(!Br.has(t))throw new Error("The AudioNode is not stored.");Br.delete(t),jr(t).forEach(e=>e(!1))};var Qc=(t,e)=>{!wd(t)&&e.every(n=>n.size===0)&&Ur(t)};var Tw=(t,e,n,r,i,o,s,a,c,u,l,d,h)=>{let p=new WeakMap;return(y,v,_,x,M)=>{let{activeInputs:I,passiveInputs:L}=o(v),{outputs:S}=o(y),D=a(y),w=m=>{let j=c(v),K=c(y);if(m){let P=bd(L,y,_,x);t(I,y,P,!1),!M&&!d(y)&&n(K,j,_,x),h(v)&&fr(v)}else{let P=r(I,y,_,x);e(L,x,P,!1),!M&&!d(y)&&i(K,j,_,x);let V=s(v);if(V===0)l(v)&&Qc(v,I);else{let X=p.get(v);X!==void 0&&clearTimeout(X),p.set(v,setTimeout(()=>{l(v)&&Qc(v,I)},V*1e3))}}};return u(S,[v,_,x],m=>m[0]===v&&m[1]===_&&m[2]===x,!0)?(D.add(w),l(y)?t(I,y,[_,x,w],!0):e(L,x,[y,_,w],!0),!0):!1}};var Cw=t=>(e,n,[r,i,o],s)=>{let a=e.get(r);a===void 0?e.set(r,new Set([[i,n,o]])):t(a,[i,n,o],c=>c[0]===i&&c[1]===n,s)};var Dw=t=>(e,n)=>{let r=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(r).connect(e.destination);let i=()=>{n.removeEventListener("ended",i),n.disconnect(r),r.disconnect()};n.addEventListener("ended",i)};var Ew=t=>(e,n)=>{t(e).add(n)};var $2={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Sw=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=i(a),l=T(T({},$2),c),d=r(u,l),h=o(u)?e():null;super(a,!1,d,h),this._nativeAnalyserNode=d}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(a){this._nativeAnalyserNode.fftSize=a}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(a){let c=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=a,!(a>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=c,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(a){let c=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=a,!(this._nativeAnalyserNode.maxDecibels>a))throw this._nativeAnalyserNode.minDecibels=c,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(a){this._nativeAnalyserNode.smoothingTimeConstant=a}getByteFrequencyData(a){this._nativeAnalyserNode.getByteFrequencyData(a)}getByteTimeDomainData(a){this._nativeAnalyserNode.getByteTimeDomainData(a)}getFloatFrequencyData(a){this._nativeAnalyserNode.getFloatFrequencyData(a)}getFloatTimeDomainData(a){this._nativeAnalyserNode.getFloatTimeDomainData(a)}};var qe=(t,e)=>t.context===e;var Aw=(t,e,n)=>()=>{let r=new WeakMap,i=(o,s)=>Q(void 0,null,function*(){let a=e(o);if(!qe(a,s)){let u={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=t(s,u)}return r.set(s,a),yield n(o,s,a),a});return{render(o,s){let a=r.get(s);return a!==void 0?Promise.resolve(a):i(o,s)}}};var $s=t=>{try{t.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0};var Zn=()=>new DOMException("","IndexSizeError");var Hs=t=>{t.getChannelData=(e=>n=>{try{return e.call(t,n)}catch(r){throw r.code===12?Zn():r}})(t.getChannelData)};var H2={numberOfChannels:1},Iw=(t,e,n,r,i,o,s,a)=>{let c=null;return class Mw{constructor(l){if(i===null)throw new Error("Missing the native OfflineAudioContext constructor.");let{length:d,numberOfChannels:h,sampleRate:p}=T(T({},H2),l);c===null&&(c=new i(1,1,44100));let y=r!==null&&e(o,o)?new r({length:d,numberOfChannels:h,sampleRate:p}):c.createBuffer(h,d,p);if(y.numberOfChannels===0)throw n();return typeof y.copyFromChannel!="function"?(s(y),Hs(y)):e($s,()=>$s(y))||a(y),t.add(y),y}static[Symbol.hasInstance](l){return l!==null&&typeof l=="object"&&Object.getPrototypeOf(l)===Mw.prototype||t.has(l)}}};var Mt=-34028234663852886e22,Tt=-Mt;var fn=t=>Br.has(t);var G2={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Nw=(t,e,n,r,i,o,s,a)=>class extends t{constructor(u,l){let d=o(u),h=T(T({},G2),l),p=i(d,h),y=s(d),v=y?e():null;super(u,!1,p,v),this._audioBufferSourceNodeRenderer=v,this._isBufferNullified=!1,this._isBufferSet=h.buffer!==null,this._nativeAudioBufferSourceNode=p,this._onended=null,this._playbackRate=n(this,y,p.playbackRate,Tt,Mt)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(u){if(this._nativeAudioBufferSourceNode.buffer=u,u!==null){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(u){this._nativeAudioBufferSourceNode.loop=u}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(u){this._nativeAudioBufferSourceNode.loopEnd=u}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(u){this._nativeAudioBufferSourceNode.loopStart=u}get onended(){return this._onended}set onended(u){let l=typeof u=="function"?a(this,u):null;this._nativeAudioBufferSourceNode.onended=l;let d=this._nativeAudioBufferSourceNode.onended;this._onended=d!==null&&d===l?u:d}get playbackRate(){return this._playbackRate}start(u=0,l=0,d){if(this._nativeAudioBufferSourceNode.start(u,l,d),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=d===void 0?[u,l]:[u,l,d]),this.context.state!=="closed"){fr(this);let h=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",h),fn(this)&&Ur(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",h)}}stop(u=0){this._nativeAudioBufferSourceNode.stop(u),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=u)}};var Ow=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=null,a=null,c=(u,l)=>Q(void 0,null,function*(){let d=n(u),h=qe(d,l);if(!h){let p={buffer:d.buffer,channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,loop:d.loop,loopEnd:d.loopEnd,loopStart:d.loopStart,playbackRate:d.playbackRate.value};d=e(l,p),s!==null&&d.start(...s),a!==null&&d.stop(a)}return o.set(l,d),h?yield t(l,u.playbackRate,d.playbackRate):yield r(l,u.playbackRate,d.playbackRate),yield i(u,l,d),d});return{set start(u){s=u},set stop(u){a=u},render(u,l){let d=o.get(l);return d!==void 0?Promise.resolve(d):c(u,l)}}};var Fw=t=>"playbackRate"in t;var kw=t=>"frequency"in t&&"gain"in t;var Rw=t=>"offset"in t;var Pw=t=>!("frequency"in t)&&"gain"in t;var Vw=t=>"detune"in t&&"frequency"in t;var Lw=t=>"pan"in t;var jt=t=>Rt(vd,t);var Bi=t=>Rt(_d,t);var Td=(t,e)=>{let{activeInputs:n}=jt(t);n.forEach(i=>i.forEach(([o])=>{e.includes(t)||Td(o,[...e,t])}));let r=Fw(t)?[t.playbackRate]:wd(t)?Array.from(t.parameters.values()):kw(t)?[t.Q,t.detune,t.frequency,t.gain]:Rw(t)?[t.offset]:Pw(t)?[t.gain]:Vw(t)?[t.detune,t.frequency]:Lw(t)?[t.pan]:[];for(let i of r){let o=Bi(i);o!==void 0&&o.activeInputs.forEach(([s])=>Td(s,e))}fn(t)&&Ur(t)};var ji=t=>{Td(t.destination,[])};var Cd=t=>t===void 0||typeof t=="number"||typeof t=="string"&&(t==="balanced"||t==="interactive"||t==="playback");var Bw=(t,e,n,r,i,o,s,a,c)=>class extends t{constructor(l={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let d;try{d=new c(l)}catch(y){throw y.code===12&&y.message==="sampleRate is not in range"?n():y}if(d===null)throw r();if(!Cd(l.latencyHint))throw new TypeError(`The provided value '${l.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(l.sampleRate!==void 0&&d.sampleRate!==l.sampleRate)throw n();super(d,2);let{latencyHint:h}=l,{sampleRate:p}=d;if(this._baseLatency=typeof d.baseLatency=="number"?d.baseLatency:h==="balanced"?512/p:h==="interactive"||h===void 0?256/p:h==="playback"?1024/p:Math.max(2,Math.min(128,Math.round(h*p/128)))*128/p,this._nativeAudioContext=d,c.name==="webkitAudioContext"?(this._nativeGainNode=d.createGain(),this._nativeOscillatorNode=d.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(d.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,d.state==="running"){this._state="suspended";let y=()=>{this._state==="suspended"&&(this._state=null),d.removeEventListener("statechange",y)};d.addEventListener("statechange",y)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw e()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),ji(this)}))}createMediaElementSource(l){return new i(this,{mediaElement:l})}createMediaStreamDestination(){return new o(this)}createMediaStreamSource(l){return new s(this,{mediaStream:l})}createMediaStreamTrackSource(l){return new a(this,{mediaStreamTrack:l})}resume(){return this._state==="suspended"?new Promise((l,d)=>{let h=()=>{this._nativeAudioContext.removeEventListener("statechange",h),this._nativeAudioContext.state==="running"?l():this.resume().then(l,d)};this._nativeAudioContext.addEventListener("statechange",h)}):this._nativeAudioContext.resume().catch(l=>{throw l===void 0||l.code===15?e():l})}suspend(){return this._nativeAudioContext.suspend().catch(l=>{throw l===void 0?e():l})}};var jw=(t,e,n,r,i,o,s,a)=>class extends t{constructor(u,l){let d=o(u),h=s(d),p=i(d,l,h),y=h?e(a):null;super(u,!1,p,y),this._isNodeOfNativeOfflineAudioContext=h,this._nativeAudioDestinationNode=p}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(u){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(u>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=u}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(u){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=u}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}};var Uw=t=>{let e=new WeakMap,n=(r,i)=>Q(void 0,null,function*(){let o=i.destination;return e.set(i,o),yield t(r,i,o),o});return{render(r,i){let o=e.get(i);return o!==void 0?Promise.resolve(o):n(r,i)}}};var qw=(t,e,n,r,i,o,s,a)=>(c,u)=>{let l=u.listener,d=()=>{let S=new Float32Array(1),D=e(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),w=s(u),m=!1,j=[0,0,-1,0,1,0],K=[0,0,0],P=()=>{if(m)return;m=!0;let N=r(u,256,9,0);N.onaudioprocess=({inputBuffer:A})=>{let F=[o(A,S,0),o(A,S,1),o(A,S,2),o(A,S,3),o(A,S,4),o(A,S,5)];F.some((B,W)=>B!==j[W])&&(l.setOrientation(...F),j=F);let G=[o(A,S,6),o(A,S,7),o(A,S,8)];G.some((B,W)=>B!==K[W])&&(l.setPosition(...G),K=G)},D.connect(N)},V=N=>A=>{A!==j[N]&&(j[N]=A,l.setOrientation(...j))},X=N=>A=>{A!==K[N]&&(K[N]=A,l.setPosition(...K))},O=(N,A,F)=>{let G=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:A});G.connect(D,0,N),G.start(),Object.defineProperty(G.offset,"defaultValue",{get(){return A}});let B=t({context:c},w,G.offset,Tt,Mt);return a(B,"value",W=>()=>W.call(B),W=>U=>{try{W.call(B,U)}catch(Fe){if(Fe.code!==9)throw Fe}P(),w&&F(U)}),B.cancelAndHoldAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.cancelAndHoldAtTime),B.cancelScheduledValues=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.cancelScheduledValues),B.exponentialRampToValueAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.exponentialRampToValueAtTime),B.linearRampToValueAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.linearRampToValueAtTime),B.setTargetAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.setTargetAtTime),B.setValueAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.setValueAtTime),B.setValueCurveAtTime=(W=>w?()=>{throw i()}:(...U)=>{let Fe=W.apply(B,U);return P(),Fe})(B.setValueCurveAtTime),B};return{forwardX:O(0,0,V(0)),forwardY:O(1,0,V(1)),forwardZ:O(2,-1,V(2)),positionX:O(6,0,X(0)),positionY:O(7,0,X(1)),positionZ:O(8,0,X(2)),upX:O(3,0,V(3)),upY:O(4,1,V(4)),upZ:O(5,0,V(5))}},{forwardX:h,forwardY:p,forwardZ:y,positionX:v,positionY:_,positionZ:x,upX:M,upY:I,upZ:L}=l.forwardX===void 0?d():l;return{get forwardX(){return h},get forwardY(){return p},get forwardZ(){return y},get positionX(){return v},get positionY(){return _},get positionZ(){return x},get upX(){return M},get upY(){return I},get upZ(){return L}}};var Do=t=>"context"in t;var Ui=t=>Do(t[0]);var pr=(t,e,n,r)=>{for(let i of t)if(n(i)){if(r)return!1;throw Error("The set contains at least one similar element.")}return t.add(e),!0};var Cg=(t,e,[n,r],i)=>{pr(t,[e,n,r],o=>o[0]===e&&o[1]===n,i)};var Dg=(t,[e,n,r],i)=>{let o=t.get(e);o===void 0?t.set(e,new Set([[n,r]])):pr(o,[n,r],s=>s[0]===n,i)};var Qn=t=>"inputs"in t;var Gs=(t,e,n,r)=>{if(Qn(e)){let i=e.inputs[r];return t.connect(i,n,0),[i,n,0]}return t.connect(e,n,r),[e,n,r]};var Eg=(t,e,n)=>{for(let r of t)if(r[0]===e&&r[1]===n)return t.delete(r),r;return null};var $w=(t,e,n)=>Li(t,r=>r[0]===e&&r[1]===n);var Sg=(t,e)=>{if(!jr(t).delete(e))throw new Error("Missing the expected event listener.")};var Ag=(t,e,n)=>{let r=Rt(t,e),i=Li(r,o=>o[0]===n);return r.size===0&&t.delete(e),i};var Ws=(t,e,n,r)=>{Qn(e)?t.disconnect(e.inputs[r],n,0):t.disconnect(e,n,r)};var nt=t=>Rt(Us,t);var Eo=t=>Rt(Wc,t);var ui=t=>zc.has(t);var zs=t=>!Br.has(t);var Ig=(t,e)=>new Promise(n=>{if(e!==null)n(!0);else{let r=t.createScriptProcessor(256,1,1),i=t.createGain(),o=t.createBuffer(1,2,44100),s=o.getChannelData(0);s[0]=1,s[1]=1;let a=t.createBufferSource();a.buffer=o,a.loop=!0,a.connect(r).connect(t.destination),a.connect(i),a.disconnect(i),r.onaudioprocess=c=>{let u=c.inputBuffer.getChannelData(0);Array.prototype.some.call(u,l=>l===1)?n(!0):n(!1),a.stop(),r.onaudioprocess=null,a.disconnect(r),r.disconnect(t.destination)},a.start()}});var Dd=(t,e)=>{let n=new Map;for(let r of t)for(let i of r){let o=n.get(i);n.set(i,o===void 0?1:o+1)}n.forEach((r,i)=>e(i,r))};var So=t=>"context"in t;var Hw=t=>{let e=new Map;t.connect=(n=>(r,i=0,o=0)=>{let s=So(r)?n(r,i,o):n(r,i),a=e.get(r);return a===void 0?e.set(r,[{input:o,output:i}]):a.every(c=>c.input!==o||c.output!==i)&&a.push({input:o,output:i}),s})(t.connect.bind(t)),t.disconnect=(n=>(r,i,o)=>{if(n.apply(t),r===void 0)e.clear();else if(typeof r=="number")for(let[s,a]of e){let c=a.filter(u=>u.output!==r);c.length===0?e.delete(s):e.set(s,c)}else if(e.has(r))if(i===void 0)e.delete(r);else{let s=e.get(r);if(s!==void 0){let a=s.filter(c=>c.output!==i&&(c.input!==o||o===void 0));a.length===0?e.delete(r):e.set(r,a)}}for(let[s,a]of e)a.forEach(c=>{So(s)?t.connect(s,c.output,c.input):t.connect(s,c.output)})})(t.disconnect)};var W2=(t,e,n,r)=>{let{activeInputs:i,passiveInputs:o}=Bi(e),{outputs:s}=jt(t),a=jr(t),c=u=>{let l=nt(t),d=Eo(e);if(u){let h=Ag(o,t,n);Cg(i,t,h,!1),!r&&!ui(t)&&l.connect(d,n)}else{let h=$w(i,t,n);Dg(o,h,!1),!r&&!ui(t)&&l.disconnect(d,n)}};return pr(s,[e,n],u=>u[0]===e&&u[1]===n,!0)?(a.add(c),fn(t)?Cg(i,t,[n,c],!0):Dg(o,[t,n,c],!0),!0):!1},z2=(t,e,n,r)=>{let{activeInputs:i,passiveInputs:o}=jt(e),s=Eg(i[r],t,n);return s===null?[bd(o,t,n,r)[2],!1]:[s[2],!0]},Y2=(t,e,n)=>{let{activeInputs:r,passiveInputs:i}=Bi(e),o=Eg(r,t,n);return o===null?[Ag(i,t,n)[1],!1]:[o[2],!0]},Mg=(t,e,n,r,i)=>{let[o,s]=z2(t,n,r,i);if(o!==null&&(Sg(t,o),s&&!e&&!ui(t)&&Ws(nt(t),nt(n),r,i)),fn(n)){let{activeInputs:a}=jt(n);Qc(n,a)}},Ng=(t,e,n,r)=>{let[i,o]=Y2(t,n,r);i!==null&&(Sg(t,i),o&&!e&&!ui(t)&&nt(t).disconnect(Eo(n),r))},Z2=(t,e)=>{let n=jt(t),r=[];for(let i of n.outputs)Ui(i)?Mg(t,e,...i):Ng(t,e,...i),r.push(i[0]);return n.outputs.clear(),r},Q2=(t,e,n)=>{let r=jt(t),i=[];for(let o of r.outputs)o[1]===n&&(Ui(o)?Mg(t,e,...o):Ng(t,e,...o),i.push(o[0]),r.outputs.delete(o));return i},K2=(t,e,n,r,i)=>{let o=jt(t);return Array.from(o.outputs).filter(s=>s[0]===n&&(r===void 0||s[1]===r)&&(i===void 0||s[2]===i)).map(s=>(Ui(s)?Mg(t,e,...s):Ng(t,e,...s),o.outputs.delete(s),s[0]))},Gw=(t,e,n,r,i,o,s,a,c,u,l,d,h,p,y,v)=>class extends u{constructor(x,M,I,L){super(I),this._context=x,this._nativeAudioNode=I;let S=l(x);d(S)&&n(Ig,()=>Ig(S,v))!==!0&&Hw(I),Us.set(this,I),xd.set(this,new Set),x.state!=="closed"&&M&&fr(this),t(this,L,I)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(x){this._nativeAudioNode.channelCount=x}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(x){this._nativeAudioNode.channelCountMode=x}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(x){this._nativeAudioNode.channelInterpretation=x}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(x,M=0,I=0){if(M<0||M>=this._nativeAudioNode.numberOfOutputs)throw i();let L=l(this._context),S=y(L);if(h(x)||p(x))throw o();if(Do(x)){let m=nt(x);try{let K=Gs(this._nativeAudioNode,m,M,I),P=zs(this);(S||P)&&this._nativeAudioNode.disconnect(...K),this.context.state!=="closed"&&!P&&zs(x)&&fr(x)}catch(K){throw K.code===12?o():K}if(e(this,x,M,I,S)){let K=c([this],x);Dd(K,r(S))}return x}let D=Eo(x);if(D.name==="playbackRate"&&D.maxValue===1024)throw s();try{this._nativeAudioNode.connect(D,M),(S||zs(this))&&this._nativeAudioNode.disconnect(D,M)}catch(m){throw m.code===12?o():m}if(W2(this,x,M,S)){let m=c([this],x);Dd(m,r(S))}}disconnect(x,M,I){let L,S=l(this._context),D=y(S);if(x===void 0)L=Z2(this,D);else if(typeof x=="number"){if(x<0||x>=this.numberOfOutputs)throw i();L=Q2(this,D,x)}else{if(M!==void 0&&(M<0||M>=this.numberOfOutputs)||Do(x)&&I!==void 0&&(I<0||I>=x.numberOfInputs))throw i();if(L=K2(this,D,x,M,I),L.length===0)throw o()}for(let w of L){let m=c([this],w);Dd(m,a)}}};var Ww=hu(wg()),zw=(t,e,n,r,i,o,s,a,c,u,l,d,h)=>(p,y,v,_=null,x=null)=>{let M=v.value,I=new Ww.AutomationEventList(M),L=y?r(I):null,S={get defaultValue(){return M},get maxValue(){return _===null?v.maxValue:_},get minValue(){return x===null?v.minValue:x},get value(){return v.value},set value(D){v.value=D,S.setValueAtTime(D,p.context.currentTime)},cancelAndHoldAtTime(D){if(typeof v.cancelAndHoldAtTime=="function")L===null&&I.flush(p.context.currentTime),I.add(i(D)),v.cancelAndHoldAtTime(D);else{let w=Array.from(I).pop();L===null&&I.flush(p.context.currentTime),I.add(i(D));let m=Array.from(I).pop();v.cancelScheduledValues(D),w!==m&&m!==void 0&&(m.type==="exponentialRampToValue"?v.exponentialRampToValueAtTime(m.value,m.endTime):m.type==="linearRampToValue"?v.linearRampToValueAtTime(m.value,m.endTime):m.type==="setValue"?v.setValueAtTime(m.value,m.startTime):m.type==="setValueCurve"&&v.setValueCurveAtTime(m.values,m.startTime,m.duration))}return S},cancelScheduledValues(D){return L===null&&I.flush(p.context.currentTime),I.add(o(D)),v.cancelScheduledValues(D),S},exponentialRampToValueAtTime(D,w){if(D===0)throw new RangeError;if(!Number.isFinite(w)||w<0)throw new RangeError;let m=p.context.currentTime;return L===null&&I.flush(m),Array.from(I).length===0&&(I.add(u(M,m)),v.setValueAtTime(M,m)),I.add(s(D,w)),v.exponentialRampToValueAtTime(D,w),S},linearRampToValueAtTime(D,w){let m=p.context.currentTime;return L===null&&I.flush(m),Array.from(I).length===0&&(I.add(u(M,m)),v.setValueAtTime(M,m)),I.add(a(D,w)),v.linearRampToValueAtTime(D,w),S},setTargetAtTime(D,w,m){return L===null&&I.flush(p.context.currentTime),I.add(c(D,w,m)),v.setTargetAtTime(D,w,m),S},setValueAtTime(D,w){return L===null&&I.flush(p.context.currentTime),I.add(u(D,w)),v.setValueAtTime(D,w),S},setValueCurveAtTime(D,w,m){let j=D instanceof Float32Array?D:new Float32Array(D);if(d!==null&&d.name==="webkitAudioContext"){let K=w+m,P=p.context.sampleRate,V=Math.ceil(w*P),X=Math.floor(K*P),O=X-V,N=new Float32Array(O);for(let F=0;F({replay(e){for(let n of t)if(n.type==="exponentialRampToValue"){let{endTime:r,value:i}=n;e.exponentialRampToValueAtTime(i,r)}else if(n.type==="linearRampToValue"){let{endTime:r,value:i}=n;e.linearRampToValueAtTime(i,r)}else if(n.type==="setTarget"){let{startTime:r,target:i,timeConstant:o}=n;e.setTargetAtTime(i,r,o)}else if(n.type==="setValue"){let{startTime:r,value:i}=n;e.setValueAtTime(i,r)}else if(n.type==="setValueCurve"){let{duration:r,startTime:i,values:o}=n;e.setValueCurveAtTime(o,i,r)}else throw new Error("Can't apply an unknown automation.")}});var Ys=class{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,n=null){return this._map.forEach((r,i)=>e.call(n,r,i,this))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}};var X2={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},Zw=(t,e,n,r,i,o,s,a,c,u,l,d,h,p)=>class extends e{constructor(v,_,x){var M;let I=a(v),L=c(I),S=l(T(T({},X2),x));h(S);let D=Yc.get(I),w=D?.get(_),m=L||I.state!=="closed"?I:(M=s(I))!==null&&M!==void 0?M:I,j=i(m,L?null:v.baseLatency,u,_,w,S),K=L?r(_,S,w):null;super(v,!0,j,K);let P=[];j.parameters.forEach((X,O)=>{let N=n(this,L,X);P.push([O,N])}),this._nativeAudioWorkletNode=j,this._onprocessorerror=null,this._parameters=new Ys(P),L&&t(I,this);let{activeInputs:V}=o(this);d(j,V)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(v){let _=typeof v=="function"?p(this,v):null;this._nativeAudioWorkletNode.onprocessorerror=_;let x=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=x!==null&&x===_?v:x}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Zs(t,e,n,r,i){if(typeof t.copyFromChannel=="function")e[n].byteLength===0&&(e[n]=new Float32Array(128)),t.copyFromChannel(e[n],r,i);else{let o=t.getChannelData(r);if(e[n].byteLength===0)e[n]=o.slice(i,i+128);else{let s=new Float32Array(o.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[n].set(s)}}}var Ed=(t,e,n,r,i)=>{typeof t.copyToChannel=="function"?e[n].byteLength!==0&&t.copyToChannel(e[n],r,i):e[n].byteLength!==0&&t.getChannelData(r).set(e[n],i)};var Qs=(t,e)=>{let n=[];for(let r=0;r{let n=Rt(Zc,t),r=nt(e);return Rt(n,r)};var J2=(t,e,n,r,i,o,s)=>Q(void 0,null,function*(){let a=e===null?Math.ceil(t.context.length/128)*128:e.length,c=r.channelCount*r.numberOfInputs,u=i.reduce((_,x)=>_+x,0),l=u===0?null:n.createBuffer(u,a,n.sampleRate);if(o===void 0)throw new Error("Missing the processor constructor.");let d=jt(t),h=yield Qw(n,t),p=Qs(r.numberOfInputs,r.channelCount),y=Qs(r.numberOfOutputs,i),v=Array.from(t.parameters.keys()).reduce((_,x)=>H(T({},_),{[x]:new Float32Array(128)}),{});for(let _=0;_0&&e!==null)for(let x=0;x{Zs(e,v,x,c+M,_)});for(let x=0;xd.activeInputs[L].size===0?[]:I),M=s(_/n.sampleRate,n.sampleRate,()=>h.process(x,y,v));if(l!==null)for(let I=0,L=0;I(_,x,M)=>{let I=new WeakMap,L=null,S=(D,w)=>Q(void 0,null,function*(){let m=l(D),j=null,K=qe(m,w),P=Array.isArray(x.outputChannelCount)?x.outputChannelCount:Array.from(x.outputChannelCount);if(d===null){let V=P.reduce((A,F)=>A+F,0),X=i(w,{channelCount:Math.max(1,V),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,V)}),O=[];for(let A=0;AQ(void 0,null,function*(){let U=new h(B,Math.ceil(D.context.length/128)*128,w.sampleRate),Fe=[],We=[];for(let g=0;gQ(void 0,null,function*(){let f=o(U,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:g.value});return yield p(U,g,f.offset),f}))),Bt=r(U,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,F+G)});for(let g=0;gy(D,U,g))),v(U)}))(),w,x,P,M,u)}let V=yield L,X=n(w,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[O,N,A]=j;V!==null&&(X.buffer=V,X.start(0)),X.connect(O);for(let F=0,G=0;Fclass extends y{constructor(S,D){super(S,D),this._nativeContext=S,this._audioWorklet=t===void 0?void 0:{addModule:(w,m)=>t(this,w,m)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new i(this)}createBuffer(S,D,w){return new n({length:D,numberOfChannels:S,sampleRate:w})}createBufferSource(){return new r(this)}createChannelMerger(S=6){return new o(this,{numberOfInputs:S})}createChannelSplitter(S=6){return new s(this,{numberOfOutputs:S})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(S=1){return new l(this,{maxDelayTime:S})}createDynamicsCompressor(){return new d(this)}createGain(){return new h(this)}createIIRFilter(S,D){return new p(this,{feedback:D,feedforward:S})}createOscillator(){return new v(this)}createPanner(){return new _(this)}createPeriodicWave(S,D,w={disableNormalization:!1}){return new x(this,H(T({},w),{imag:D,real:S}))}createStereoPanner(){return new M(this)}createWaveShaper(){return new I(this)}decodeAudioData(S,D,w){return u(this._nativeContext,S).then(m=>(typeof D=="function"&&D(m),m),m=>{throw typeof w=="function"&&w(m),m})}};var eP={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Jw=(t,e,n,r,i,o,s,a)=>class extends t{constructor(u,l){let d=o(u),h=T(T({},eP),l),p=i(d,h),y=s(d),v=y?n():null;super(u,!1,p,v),this._Q=e(this,y,p.Q,Tt,Mt),this._detune=e(this,y,p.detune,1200*Math.log2(Tt),-1200*Math.log2(Tt)),this._frequency=e(this,y,p.frequency,u.sampleRate/2,0),this._gain=e(this,y,p.gain,40*Math.log10(Tt),Mt),this._nativeBiquadFilterNode=p,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(u){this._nativeBiquadFilterNode.type=u}getFrequencyResponse(u,l,d){try{this._nativeBiquadFilterNode.getFrequencyResponse(u,l,d)}catch(h){throw h.code===11?r():h}if(u.length!==l.length||l.length!==d.length)throw r()}};var eT=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=(a,c)=>Q(void 0,null,function*(){let u=n(a),l=qe(u,c);if(!l){let d={Q:u.Q.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,detune:u.detune.value,frequency:u.frequency.value,gain:u.gain.value,type:u.type};u=e(c,d)}return o.set(c,u),l?(yield t(c,a.Q,u.Q),yield t(c,a.detune,u.detune),yield t(c,a.frequency,u.frequency),yield t(c,a.gain,u.gain)):(yield r(c,a.Q,u.Q),yield r(c,a.detune,u.detune),yield r(c,a.frequency,u.frequency),yield r(c,a.gain,u.gain)),yield i(a,c,u),u});return{render(a,c){let u=o.get(c);return u!==void 0?Promise.resolve(u):s(a,c)}}};var tT=(t,e)=>(n,r)=>{let i=e.get(n);if(i!==void 0)return i;let o=t.get(n);if(o!==void 0)return o;try{let s=r();return s instanceof Promise?(t.set(n,s),s.catch(()=>!1).then(a=>(t.delete(n),e.set(n,a),a))):(e.set(n,s),s)}catch{return e.set(n,!1),!1}};var tP={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},nT=(t,e,n,r,i)=>class extends t{constructor(s,a){let c=r(s),u=T(T({},tP),a),l=n(c,u),d=i(c)?e():null;super(s,!1,l,d)}};var rT=(t,e,n)=>()=>{let r=new WeakMap,i=(o,s)=>Q(void 0,null,function*(){let a=e(o);if(!qe(a,s)){let u={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=t(s,u)}return r.set(s,a),yield n(o,s,a),a});return{render(o,s){let a=r.get(s);return a!==void 0?Promise.resolve(a):i(o,s)}}};var nP={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},iT=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=r(a),l=o(T(T({},nP),c)),d=n(u,l),h=i(u)?e():null;super(a,!1,d,h)}};var oT=(t,e,n)=>()=>{let r=new WeakMap,i=(o,s)=>Q(void 0,null,function*(){let a=e(o);if(!qe(a,s)){let u={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=t(s,u)}return r.set(s,a),yield n(o,s,a),a});return{render(o,s){let a=r.get(s);return a!==void 0?Promise.resolve(a):i(o,s)}}};var sT=t=>(e,n,r)=>t(n,e,r);var aT=t=>(e,n,r=0,i=0)=>{let o=e[r];if(o===void 0)throw t();return So(n)?o.connect(n,0,i):o.connect(n,0)};var cT=t=>(e,n)=>{let r=t(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=e.createBuffer(1,2,44100);return r.buffer=i,r.loop=!0,r.connect(n),r.start(),()=>{r.stop(),r.disconnect(n)}};var rP={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},uT=(t,e,n,r,i,o,s)=>class extends t{constructor(c,u){let l=i(c),d=T(T({},rP),u),h=r(l,d),p=o(l),y=p?n():null;super(c,!1,h,y),this._constantSourceNodeRenderer=y,this._nativeConstantSourceNode=h,this._offset=e(this,p,h.offset,Tt,Mt),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(c){let u=typeof c=="function"?s(this,c):null;this._nativeConstantSourceNode.onended=u;let l=this._nativeConstantSourceNode.onended;this._onended=l!==null&&l===u?c:l}start(c=0){if(this._nativeConstantSourceNode.start(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=c),this.context.state!=="closed"){fr(this);let u=()=>{this._nativeConstantSourceNode.removeEventListener("ended",u),fn(this)&&Ur(this)};this._nativeConstantSourceNode.addEventListener("ended",u)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}};var lT=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=null,a=null,c=(u,l)=>Q(void 0,null,function*(){let d=n(u),h=qe(d,l);if(!h){let p={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,offset:d.offset.value};d=e(l,p),s!==null&&d.start(s),a!==null&&d.stop(a)}return o.set(l,d),h?yield t(l,u.offset,d.offset):yield r(l,u.offset,d.offset),yield i(u,l,d),d});return{set start(u){s=u},set stop(u){a=u},render(u,l){let d=o.get(l);return d!==void 0?Promise.resolve(d):c(u,l)}}};var dT=t=>e=>(t[0]=e,t[0]);var iP={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},hT=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=r(a),l=T(T({},iP),c),d=n(u,l),p=i(u)?e():null;super(a,!1,d,p),this._isBufferNullified=!1,this._nativeConvolverNode=d,l.buffer!==null&&o(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(a){if(this._nativeConvolverNode.buffer=a,a===null&&this._nativeConvolverNode.buffer!==null){let c=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=c.createBuffer(1,1,c.sampleRate),this._isBufferNullified=!0,o(this,0)}else this._isBufferNullified=!1,o(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(a){this._nativeConvolverNode.normalize=a}};var fT=(t,e,n)=>()=>{let r=new WeakMap,i=(o,s)=>Q(void 0,null,function*(){let a=e(o);if(!qe(a,s)){let u={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=t(s,u)}return r.set(s,a),Qn(a)?yield n(o,s,a.inputs[0]):yield n(o,s,a),a});return{render(o,s){let a=r.get(s);return a!==void 0?Promise.resolve(a):i(o,s)}}};var pT=(t,e)=>(n,r,i)=>{if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(n,r,i)}catch(o){throw o.name==="SyntaxError"?t():o}};var mT=()=>new DOMException("","DataCloneError");var Og=t=>{let{port1:e,port2:n}=new MessageChannel;return new Promise(r=>{let i=()=>{n.onmessage=null,e.close(),n.close(),r()};n.onmessage=()=>i();try{e.postMessage(t,[t])}catch{}finally{i()}})};var gT=(t,e,n,r,i,o,s,a,c,u,l)=>(d,h)=>{let p=s(d)?d:o(d);if(i.has(h)){let y=n();return Promise.reject(y)}try{i.add(h)}catch{}return e(c,()=>c(p))?p.decodeAudioData(h).then(y=>(Og(h).catch(()=>{}),e(a,()=>a(y))||l(y),t.add(y),y)):new Promise((y,v)=>{let _=()=>Q(void 0,null,function*(){try{yield Og(h)}catch{}}),x=M=>{v(M),_()};try{p.decodeAudioData(h,M=>{typeof M.copyFromChannel!="function"&&(u(M),Hs(M)),t.add(M),_().then(()=>y(M))},M=>{x(M===null?r():M)})}catch(M){x(M)}})};var yT=(t,e,n,r,i,o,s,a)=>(c,u)=>{let l=e.get(c);if(l===void 0)throw new Error("Missing the expected cycle count.");let d=o(c.context),h=a(d);if(l===u){if(e.delete(c),!h&&s(c)){let p=r(c),{outputs:y}=n(c);for(let v of y)if(Ui(v)){let _=r(v[0]);t(p,_,v[1],v[2])}else{let _=i(v[0]);p.connect(_,v[1])}}}else e.set(c,l-u)};var oP={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},vT=(t,e,n,r,i,o,s)=>class extends t{constructor(c,u){let l=i(c),d=T(T({},oP),u),h=r(l,d),p=o(l),y=p?n(d.maxDelayTime):null;super(c,!1,h,y),this._delayTime=e(this,p,h.delayTime),s(this,d.maxDelayTime)}get delayTime(){return this._delayTime}};var _T=(t,e,n,r,i)=>o=>{let s=new WeakMap,a=(c,u)=>Q(void 0,null,function*(){let l=n(c),d=qe(l,u);if(!d){let h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,delayTime:l.delayTime.value,maxDelayTime:o};l=e(u,h)}return s.set(u,l),d?yield t(u,c.delayTime,l.delayTime):yield r(u,c.delayTime,l.delayTime),yield i(c,u,l),l});return{render(c,u){let l=s.get(u);return l!==void 0?Promise.resolve(l):a(c,u)}}};var xT=t=>(e,n,r,i)=>t(e[i],o=>o[0]===n&&o[1]===r);var bT=t=>(e,n)=>{t(e).delete(n)};var wT=t=>"delayTime"in t;var TT=(t,e,n)=>function r(i,o){let s=Do(o)?o:n(t,o);if(wT(s))return[];if(i[0]===s)return[i];if(i.includes(s))return[];let{outputs:a}=e(s);return Array.from(a).map(c=>r([...i,s],c[0])).reduce((c,u)=>c.concat(u),[])};var Sd=(t,e,n)=>{let r=e[n];if(r===void 0)throw t();return r},CT=t=>(e,n=void 0,r=void 0,i=0)=>n===void 0?e.forEach(o=>o.disconnect()):typeof n=="number"?Sd(t,e,n).disconnect():So(n)?r===void 0?e.forEach(o=>o.disconnect(n)):i===void 0?Sd(t,e,r).disconnect(n,0):Sd(t,e,r).disconnect(n,0,i):r===void 0?e.forEach(o=>o.disconnect(n)):Sd(t,e,r).disconnect(n,0);var sP={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},DT=(t,e,n,r,i,o,s,a)=>class extends t{constructor(u,l){let d=o(u),h=T(T({},sP),l),p=r(d,h),y=s(d),v=y?n():null;super(u,!1,p,v),this._attack=e(this,y,p.attack),this._knee=e(this,y,p.knee),this._nativeDynamicsCompressorNode=p,this._ratio=e(this,y,p.ratio),this._release=e(this,y,p.release),this._threshold=e(this,y,p.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(u){let l=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=u,u>2)throw this._nativeDynamicsCompressorNode.channelCount=l,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(u){let l=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=u,u==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=l,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}};var ET=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=(a,c)=>Q(void 0,null,function*(){let u=n(a),l=qe(u,c);if(!l){let d={attack:u.attack.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,knee:u.knee.value,ratio:u.ratio.value,release:u.release.value,threshold:u.threshold.value};u=e(c,d)}return o.set(c,u),l?(yield t(c,a.attack,u.attack),yield t(c,a.knee,u.knee),yield t(c,a.ratio,u.ratio),yield t(c,a.release,u.release),yield t(c,a.threshold,u.threshold)):(yield r(c,a.attack,u.attack),yield r(c,a.knee,u.knee),yield r(c,a.ratio,u.ratio),yield r(c,a.release,u.release),yield r(c,a.threshold,u.threshold)),yield i(a,c,u),u});return{render(a,c){let u=o.get(c);return u!==void 0?Promise.resolve(u):s(a,c)}}};var ST=()=>new DOMException("","EncodingError");var AT=t=>e=>new Promise((n,r)=>{if(t===null){r(new SyntaxError);return}let i=t.document.head;if(i===null)r(new SyntaxError);else{let o=t.document.createElement("script"),s=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(s),c=t.onerror,u=()=>{t.onerror=c,URL.revokeObjectURL(a)};t.onerror=(l,d,h,p,y)=>{if(d===a||d===t.location.href&&h===1&&p===1)return u(),r(y),!1;if(c!==null)return c(l,d,h,p,y)},o.onerror=()=>{u(),r(new SyntaxError)},o.onload=()=>{u(),n()},o.src=a,o.type="module",i.appendChild(o)}});var IT=t=>class{constructor(n){this._nativeEventTarget=n,this._listeners=new WeakMap}addEventListener(n,r,i){if(r!==null){let o=this._listeners.get(r);o===void 0&&(o=t(this,r),typeof r=="function"&&this._listeners.set(r,o)),this._nativeEventTarget.addEventListener(n,o,i)}}dispatchEvent(n){return this._nativeEventTarget.dispatchEvent(n)}removeEventListener(n,r,i){let o=r===null?void 0:this._listeners.get(r);this._nativeEventTarget.removeEventListener(n,o===void 0?null:o,i)}};var MT=t=>(e,n,r)=>{Object.defineProperties(t,{currentFrame:{configurable:!0,get(){return Math.round(e*n)}},currentTime:{configurable:!0,get(){return e}}});try{return r()}finally{t!==null&&(delete t.currentFrame,delete t.currentTime)}};var NT=t=>e=>Q(void 0,null,function*(){try{let n=yield fetch(e);if(n.ok)return[yield n.text(),n.url]}catch{}throw t()});var aP={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},OT=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=i(a),l=T(T({},aP),c),d=r(u,l),h=o(u),p=h?n():null;super(a,!1,d,p),this._gain=e(this,h,d.gain,Tt,Mt)}get gain(){return this._gain}};var FT=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=(a,c)=>Q(void 0,null,function*(){let u=n(a),l=qe(u,c);if(!l){let d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,gain:u.gain.value};u=e(c,d)}return o.set(c,u),l?yield t(c,a.gain,u.gain):yield r(c,a.gain,u.gain),yield i(a,c,u),u});return{render(a,c){let u=o.get(c);return u!==void 0?Promise.resolve(u):s(a,c)}}};var kT=(t,e)=>n=>e(t,n);var RT=t=>e=>{let n=t(e);if(n.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer};var PT=t=>e=>{var n;return(n=t.get(e))!==null&&n!==void 0?n:0};var VT=t=>e=>{let n=t(e);if(n.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer};var LT=t=>e=>t.get(e);var mt=()=>new DOMException("","InvalidStateError");var BT=t=>e=>{let n=t.get(e);if(n===void 0)throw mt();return n};var jT=(t,e)=>n=>{let r=t.get(n);if(r!==void 0)return r;if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new e(1,1,44100),t.set(n,r),r};var UT=t=>e=>{let n=t.get(e);if(n===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return n};var Ks=()=>new DOMException("","InvalidAccessError");var qT=t=>{t.getFrequencyResponse=(e=>(n,r,i)=>{if(n.length!==r.length||r.length!==i.length)throw Ks();return e.call(t,n,r,i)})(t.getFrequencyResponse)};var cP={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},$T=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=r(a),l=i(u),d=T(T({},cP),c),h=e(u,l?null:a.baseLatency,d),p=l?n(d.feedback,d.feedforward):null;super(a,!1,h,p),qT(h),this._nativeIIRFilterNode=h,o(this,1)}getFrequencyResponse(a,c,u){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,u)}};var Ad=(t,e,n,r,i,o,s,a,c,u,l)=>{let d=u.length,h=a;for(let p=0;p{let i=n instanceof Float64Array?n:new Float64Array(n),o=r instanceof Float64Array?r:new Float64Array(r),s=i.length,a=o.length,c=Math.min(s,a);if(i[0]!==1){for(let y=0;y(o,s)=>{let a=new WeakMap,c=null,u=(l,d)=>Q(void 0,null,function*(){let h=null,p=e(l),y=qe(p,d);if(d.createIIRFilter===void 0?h=t(d,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):y||(p=d.createIIRFilter(s,o)),a.set(d,h===null?p:h),h!==null){if(c===null){if(n===null)throw new Error("Missing the native OfflineAudioContext constructor.");let _=new n(l.context.destination.channelCount,l.context.length,d.sampleRate);c=(()=>Q(void 0,null,function*(){yield r(l,_,_.destination);let x=yield i(_);return uP(x,d,o,s)}))()}let v=yield c;return h.buffer=v,h.start(0),h}return yield r(l,d,p),p});return{render(l,d){let h=a.get(d);return h!==void 0?Promise.resolve(h):u(l,d)}}};var GT=(t,e,n,r,i,o)=>s=>(a,c)=>{let u=t.get(a);if(u===void 0){if(!s&&o(a)){let l=r(a),{outputs:d}=n(a);for(let h of d)if(Ui(h)){let p=r(h[0]);e(l,p,h[1],h[2])}else{let p=i(h[0]);l.disconnect(p,h[1])}}t.set(a,c)}else t.set(a,u+c)};var WT=(t,e)=>n=>{let r=t.get(n);return e(r)||e(n)};var zT=(t,e)=>n=>t.has(n)||e(n);var YT=(t,e)=>n=>t.has(n)||e(n);var ZT=(t,e)=>n=>{let r=t.get(n);return e(r)||e(n)};var QT=t=>e=>t!==null&&e instanceof t;var KT=t=>e=>t!==null&&typeof t.AudioNode=="function"&&e instanceof t.AudioNode;var XT=t=>e=>t!==null&&typeof t.AudioParam=="function"&&e instanceof t.AudioParam;var JT=(t,e)=>n=>t(n)||e(n);var eC=t=>e=>t!==null&&e instanceof t;var tC=t=>t!==null&&t.isSecureContext;var nC=(t,e,n,r)=>class extends t{constructor(o,s){let a=n(o),c=e(a,s);if(r(a))throw TypeError();super(o,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}};var lP={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},rC=(t,e,n,r)=>class extends t{constructor(o,s){let a=n(o);if(r(a))throw new TypeError;let c=T(T({},lP),s),u=e(a,c);super(o,!1,u,null),this._nativeMediaStreamAudioDestinationNode=u}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}};var iC=(t,e,n,r)=>class extends t{constructor(o,s){let a=n(o),c=e(a,s);if(r(a))throw new TypeError;super(o,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}};var oC=(t,e,n)=>class extends t{constructor(i,o){let s=n(i),a=e(s,o);super(i,!0,a,null)}};var sC=(t,e,n,r,i)=>class extends r{constructor(s={}){if(i===null)throw new Error("Missing the native AudioContext constructor.");let a;try{a=new i(s)}catch(l){throw l.code===12&&l.message==="sampleRate is not in range"?e():l}if(a===null)throw n();if(!Cd(s.latencyHint))throw new TypeError(`The provided value '${s.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(s.sampleRate!==void 0&&a.sampleRate!==s.sampleRate)throw e();super(a,2);let{latencyHint:c}=s,{sampleRate:u}=a;if(this._baseLatency=typeof a.baseLatency=="number"?a.baseLatency:c==="balanced"?512/u:c==="interactive"||c===void 0?256/u:c==="playback"?1024/u:Math.max(2,Math.min(128,Math.round(c*u/128)))*128/u,this._nativeAudioContext=a,i.name==="webkitAudioContext"?(this._nativeGainNode=a.createGain(),this._nativeOscillatorNode=a.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(a.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,a.state==="running"){this._state="suspended";let l=()=>{this._state==="suspended"&&(this._state=null),a.removeEventListener("statechange",l)};a.addEventListener("statechange",l)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw t()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),ji(this)}))}resume(){return this._state==="suspended"?new Promise((s,a)=>{let c=()=>{this._nativeAudioContext.removeEventListener("statechange",c),this._nativeAudioContext.state==="running"?s():this.resume().then(s,a)};this._nativeAudioContext.addEventListener("statechange",c)}):this._nativeAudioContext.resume().catch(s=>{throw s===void 0||s.code===15?t():s})}suspend(){return this._nativeAudioContext.suspend().catch(s=>{throw s===void 0?t():s})}};var aC=(t,e,n,r,i,o)=>class extends n{constructor(a,c){super(a),this._nativeContext=a,qs.set(this,a),r(a)&&i.set(a,new Set),this._destination=new t(this,c),this._listener=e(this,a),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(a){let c=typeof a=="function"?o(this,a):null;this._nativeContext.onstatechange=c;let u=this._nativeContext.onstatechange;this._onstatechange=u!==null&&u===c?a:u}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}};var mr=t=>{let e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{let n=t.decodeAudioData(e.buffer,()=>{});return n===void 0?!1:(n.catch(()=>{}),!0)}catch{}return!1};var dP={numberOfChannels:1},cC=(t,e,n,r,i)=>class extends r{constructor(s){let{length:a,numberOfChannels:c,sampleRate:u}=T(T({},dP),s),l=n(c,a,u);t(mr,()=>mr(l))||l.addEventListener("statechange",(()=>{let d=0,h=p=>{this._state==="running"&&(d>0?(l.removeEventListener("statechange",h),p.stopImmediatePropagation(),this._waitForThePromiseToSettle(p)):d+=1)};return h})()),super(l,c),this._length=a,this._nativeOfflineAudioContext=l,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(e()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,ji(this)}))}_waitForThePromiseToSettle(s){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(s):setTimeout(()=>this._waitForThePromiseToSettle(s))}};var uC=(t,e)=>(n,r,i)=>{let o=new Set;return n.connect=(s=>(a,c=0,u=0)=>{let l=o.size===0;if(e(a))return s.call(n,a,c,u),t(o,[a,c,u],d=>d[0]===a&&d[1]===c&&d[2]===u,!0),l&&r(),a;s.call(n,a,c),t(o,[a,c],d=>d[0]===a&&d[1]===c,!0),l&&r()})(n.connect),n.disconnect=(s=>(a,c,u)=>{let l=o.size>0;if(a===void 0)s.apply(n),o.clear();else if(typeof a=="number"){s.call(n,a);for(let h of o)h[1]===a&&o.delete(h)}else{e(a)?s.call(n,a,c,u):s.call(n,a,c);for(let h of o)h[0]===a&&(c===void 0||h[1]===c)&&(u===void 0||h[2]===u)&&o.delete(h)}let d=o.size===0;l&&d&&i()})(n.disconnect),n};var $e=(t,e,n)=>{let r=e[n];r!==void 0&&r!==t[n]&&(t[n]=r)};var Ae=(t,e)=>{$e(t,e,"channelCount"),$e(t,e,"channelCountMode"),$e(t,e,"channelInterpretation")};var Fg=t=>typeof t.getFloatTimeDomainData=="function";var lC=t=>{t.getFloatTimeDomainData=e=>{let n=new Uint8Array(e.length);t.getByteTimeDomainData(n);let r=Math.max(n.length,t.fftSize);for(let i=0;i(n,r)=>{let i=n.createAnalyser();if(Ae(i,r),!(r.maxDecibels>r.minDecibels))throw e();return $e(i,r,"fftSize"),$e(i,r,"maxDecibels"),$e(i,r,"minDecibels"),$e(i,r,"smoothingTimeConstant"),t(Fg,()=>Fg(i))||lC(i),i};var hC=t=>t===null?null:t.hasOwnProperty("AudioBuffer")?t.AudioBuffer:null;var Ge=(t,e,n)=>{let r=e[n];r!==void 0&&r!==t[n].value&&(t[n].value=r)};var fC=t=>{t.start=(e=>{let n=!1;return(r=0,i=0,o)=>{if(n)throw mt();e.call(t,r,i,o),n=!0}})(t.start)};var Xs=t=>{t.start=(e=>(n=0,r=0,i)=>{if(typeof i=="number"&&i<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");e.call(t,n,r,i)})(t.start)};var Js=t=>{t.stop=(e=>(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");e.call(t,n)})(t.stop)};var pC=(t,e,n,r,i,o,s,a,c,u,l)=>(d,h)=>{let p=d.createBufferSource();return Ae(p,h),Ge(p,h,"playbackRate"),$e(p,h,"buffer"),$e(p,h,"loop"),$e(p,h,"loopEnd"),$e(p,h,"loopStart"),e(n,()=>n(d))||fC(p),e(r,()=>r(d))||c(p),e(i,()=>i(d))||u(p,d),e(o,()=>o(d))||Xs(p),e(s,()=>s(d))||l(p,d),e(a,()=>a(d))||Js(p),t(d,p),p};var mC=t=>t===null?null:t.hasOwnProperty("AudioContext")?t.AudioContext:t.hasOwnProperty("webkitAudioContext")?t.webkitAudioContext:null;var gC=(t,e)=>(n,r,i)=>{let o=n.destination;if(o.channelCount!==r)try{o.channelCount=r}catch{}i&&o.channelCountMode!=="explicit"&&(o.channelCountMode="explicit"),o.maxChannelCount===0&&Object.defineProperty(o,"maxChannelCount",{value:r});let s=t(n,{channelCount:r,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,gain:1});return e(s,"channelCount",a=>()=>a.call(s),a=>c=>{a.call(s,c);try{o.channelCount=c}catch(u){if(c>o.maxChannelCount)throw u}}),e(s,"channelCountMode",a=>()=>a.call(s),a=>c=>{a.call(s,c),o.channelCountMode=c}),e(s,"channelInterpretation",a=>()=>a.call(s),a=>c=>{a.call(s,c),o.channelInterpretation=c}),Object.defineProperty(s,"maxChannelCount",{get:()=>o.maxChannelCount}),s.connect(o),s};var yC=t=>t===null?null:t.hasOwnProperty("AudioWorkletNode")?t.AudioWorkletNode:null;var vC=t=>{let{port1:e}=new MessageChannel;try{e.postMessage(t)}finally{e.close()}};var _C=(t,e,n,r,i)=>(o,s,a,c,u,l)=>{if(a!==null)try{let d=new a(o,c,l),h=new Map,p=null;if(Object.defineProperties(d,{channelCount:{get:()=>l.channelCount,set:()=>{throw t()}},channelCountMode:{get:()=>"explicit",set:()=>{throw t()}},onprocessorerror:{get:()=>p,set:y=>{typeof p=="function"&&d.removeEventListener("processorerror",p),p=typeof y=="function"?y:null,typeof p=="function"&&d.addEventListener("processorerror",p)}}}),d.addEventListener=(y=>(...v)=>{if(v[0]==="processorerror"){let _=typeof v[1]=="function"?v[1]:typeof v[1]=="object"&&v[1]!==null&&typeof v[1].handleEvent=="function"?v[1].handleEvent:null;if(_!==null){let x=h.get(v[1]);x!==void 0?v[1]=x:(v[1]=M=>{M.type==="error"?(Object.defineProperties(M,{type:{value:"processorerror"}}),_(M)):_(new ErrorEvent(v[0],T({},M)))},h.set(_,v[1]))}}return y.call(d,"error",v[1],v[2]),y.call(d,...v)})(d.addEventListener),d.removeEventListener=(y=>(...v)=>{if(v[0]==="processorerror"){let _=h.get(v[1]);_!==void 0&&(h.delete(v[1]),v[1]=_)}return y.call(d,"error",v[1],v[2]),y.call(d,v[0],v[1],v[2])})(d.removeEventListener),l.numberOfOutputs!==0){let y=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return d.connect(y).connect(o.destination),i(d,()=>y.disconnect(),()=>y.connect(o.destination))}return d}catch(d){throw d.code===11?r():d}if(u===void 0)throw r();return vC(l),e(o,s,u,l)};var Id=(t,e)=>t===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e)))));var xC=t=>new Promise((e,n)=>{let{port1:r,port2:i}=new MessageChannel;r.onmessage=({data:o})=>{r.close(),i.close(),e(o)},r.onmessageerror=({data:o})=>{r.close(),i.close(),n(o)},i.postMessage(t)});var bC=(t,e)=>Q(void 0,null,function*(){let n=yield xC(e);return new t(n)});var wC=(t,e,n,r)=>{let i=Zc.get(t);i===void 0&&(i=new WeakMap,Zc.set(t,i));let o=bC(n,r);return i.set(e,o),o};var TC=(t,e,n,r,i,o,s,a,c,u,l,d,h)=>(p,y,v,_)=>{if(_.numberOfInputs===0&&_.numberOfOutputs===0)throw c();let x=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(x.some(z=>z<1))throw c();if(x.length!==_.numberOfOutputs)throw e();if(_.channelCountMode!=="explicit")throw c();let M=_.channelCount*_.numberOfInputs,I=x.reduce((z,Z)=>z+Z,0),L=v.parameterDescriptors===void 0?0:v.parameterDescriptors.length;if(M+L>6||I>6)throw c();let S=new MessageChannel,D=[],w=[];for(let z=0;z<_.numberOfInputs;z+=1)D.push(s(p,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),w.push(i(p,{channelCount:_.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:_.channelCount}));let m=[];if(v.parameterDescriptors!==void 0)for(let{defaultValue:z,maxValue:Z,minValue:Xe,name:dt}of v.parameterDescriptors){let ke=o(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:_.parameterData[dt]!==void 0?_.parameterData[dt]:z===void 0?0:z});Object.defineProperties(ke.offset,{defaultValue:{get:()=>z===void 0?0:z},maxValue:{get:()=>Z===void 0?Tt:Z},minValue:{get:()=>Xe===void 0?Mt:Xe}}),m.push(ke)}let j=r(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,M+L)}),K=Id(y,p.sampleRate),P=a(p,K,M+L,Math.max(1,I)),V=i(p,{channelCount:Math.max(1,I),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,I)}),X=[];for(let z=0;z<_.numberOfOutputs;z+=1)X.push(r(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:x[z]}));for(let z=0;z<_.numberOfInputs;z+=1){D[z].connect(w[z]);for(let Z=0;Z<_.channelCount;Z+=1)w[z].connect(j,Z,z*_.channelCount+Z)}let O=new Ys(v.parameterDescriptors===void 0?[]:v.parameterDescriptors.map(({name:z},Z)=>{let Xe=m[Z];return Xe.connect(j,0,M+Z),Xe.start(0),[z,Xe.offset]}));j.connect(P);let N=_.channelInterpretation,A=null,F=_.numberOfOutputs===0?[P]:X,G={get bufferSize(){return K},get channelCount(){return _.channelCount},set channelCount(z){throw n()},get channelCountMode(){return _.channelCountMode},set channelCountMode(z){throw n()},get channelInterpretation(){return N},set channelInterpretation(z){for(let Z of D)Z.channelInterpretation=z;N=z},get context(){return P.context},get inputs(){return D},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get onprocessorerror(){return A},set onprocessorerror(z){typeof A=="function"&&G.removeEventListener("processorerror",A),A=typeof z=="function"?z:null,typeof A=="function"&&G.addEventListener("processorerror",A)},get parameters(){return O},get port(){return S.port2},addEventListener(...z){return P.addEventListener(z[0],z[1],z[2])},connect:t.bind(null,F),disconnect:u.bind(null,F),dispatchEvent(...z){return P.dispatchEvent(z[0])},removeEventListener(...z){return P.removeEventListener(z[0],z[1],z[2])}},B=new Map;S.port1.addEventListener=(z=>(...Z)=>{if(Z[0]==="message"){let Xe=typeof Z[1]=="function"?Z[1]:typeof Z[1]=="object"&&Z[1]!==null&&typeof Z[1].handleEvent=="function"?Z[1].handleEvent:null;if(Xe!==null){let dt=B.get(Z[1]);dt!==void 0?Z[1]=dt:(Z[1]=ke=>{l(p.currentTime,p.sampleRate,()=>Xe(ke))},B.set(Xe,Z[1]))}}return z.call(S.port1,Z[0],Z[1],Z[2])})(S.port1.addEventListener),S.port1.removeEventListener=(z=>(...Z)=>{if(Z[0]==="message"){let Xe=B.get(Z[1]);Xe!==void 0&&(B.delete(Z[1]),Z[1]=Xe)}return z.call(S.port1,Z[0],Z[1],Z[2])})(S.port1.removeEventListener);let W=null;Object.defineProperty(S.port1,"onmessage",{get:()=>W,set:z=>{typeof W=="function"&&S.port1.removeEventListener("message",W),W=typeof z=="function"?z:null,typeof W=="function"&&(S.port1.addEventListener("message",W),S.port1.start())}}),v.prototype.port=S.port1;let U=null;wC(p,G,v,_).then(z=>U=z);let We=Qs(_.numberOfInputs,_.channelCount),Et=Qs(_.numberOfOutputs,x),Bt=v.parameterDescriptors===void 0?[]:v.parameterDescriptors.reduce((z,{name:Z})=>H(T({},z),{[Z]:new Float32Array(128)}),{}),g=!0,f=()=>{_.numberOfOutputs>0&&P.disconnect(V);for(let z=0,Z=0;z<_.numberOfOutputs;z+=1){let Xe=X[z];for(let dt=0;dt{if(U!==null){let Xe=d(G);for(let dt=0;dt{Zs(z,Bt,ke,M+at,dt)});for(let ke=0;ke<_.numberOfInputs;ke+=1)for(let at=0;at{if(Xe[gi].size>0)return k.set(gi,K/128),cn;let Ph=k.get(gi);return Ph===void 0?[]:(cn.every(t1=>t1.every(n1=>n1===0))&&(Ph===1?k.delete(gi):k.set(gi,Ph-1)),cn)});g=l(p.currentTime+dt/p.sampleRate,p.sampleRate,()=>U.process(ke,Et,Bt));for(let cn=0,gi=0;cn<_.numberOfOutputs;cn+=1){for(let ka=0;kaP.connect(q).connect(p.destination),Ke=()=>{P.disconnect(q),q.disconnect()},st=()=>{if(g){Ke(),_.numberOfOutputs>0&&P.connect(V);for(let z=0,Z=0;z<_.numberOfOutputs;z+=1){let Xe=X[z];for(let dt=0;dt{g&&(Ve(),f()),C=!1};return Ve(),h(G,st,yt)};var kg=(t,e)=>{let n=t.createBiquadFilter();return Ae(n,e),Ge(n,e,"Q"),Ge(n,e,"detune"),Ge(n,e,"frequency"),Ge(n,e,"gain"),$e(n,e,"type"),n};var CC=(t,e)=>(n,r)=>{let i=n.createChannelMerger(r.numberOfInputs);return t!==null&&t.name==="webkitAudioContext"&&e(n,i),Ae(i,r),i};var DC=t=>{let e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:()=>e,set:n=>{if(n!==e)throw mt()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:n=>{if(n!=="explicit")throw mt()}}),Object.defineProperty(t,"channelInterpretation",{get:()=>"discrete",set:n=>{if(n!=="discrete")throw mt()}})};var ea=(t,e)=>{let n=t.createChannelSplitter(e.numberOfOutputs);return Ae(n,e),DC(n),n};var EC=(t,e,n,r,i)=>(o,s)=>{if(o.createConstantSource===void 0)return n(o,s);let a=o.createConstantSource();return Ae(a,s),Ge(a,s,"offset"),e(r,()=>r(o))||Xs(a),e(i,()=>i(o))||Js(a),t(o,a),a};var Kn=(t,e)=>(t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t);var SC=(t,e,n,r)=>(i,a)=>{var c=a,{offset:o}=c,s=yi(c,["offset"]);let u=i.createBuffer(1,2,44100),l=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),d=n(i,H(T({},s),{gain:o})),h=u.getChannelData(0);h[0]=1,h[1]=1,l.buffer=u,l.loop=!0;let p={get bufferSize(){},get channelCount(){return d.channelCount},set channelCount(_){d.channelCount=_},get channelCountMode(){return d.channelCountMode},set channelCountMode(_){d.channelCountMode=_},get channelInterpretation(){return d.channelInterpretation},set channelInterpretation(_){d.channelInterpretation=_},get context(){return d.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return d.numberOfOutputs},get offset(){return d.gain},get onended(){return l.onended},set onended(_){l.onended=_},addEventListener(..._){return l.addEventListener(_[0],_[1],_[2])},dispatchEvent(..._){return l.dispatchEvent(_[0])},removeEventListener(..._){return l.removeEventListener(_[0],_[1],_[2])},start(_=0){l.start.call(l,_)},stop(_=0){l.stop.call(l,_)}},y=()=>l.connect(d),v=()=>l.disconnect(d);return t(i,l),r(Kn(p,d),y,v)};var AC=(t,e)=>(n,r)=>{let i=n.createConvolver();if(Ae(i,r),r.disableNormalization===i.normalize&&(i.normalize=!r.disableNormalization),$e(i,r,"buffer"),r.channelCount>2||(e(i,"channelCount",o=>()=>o.call(i),o=>s=>{if(s>2)throw t();return o.call(i,s)}),r.channelCountMode==="max"))throw t();return e(i,"channelCountMode",o=>()=>o.call(i),o=>s=>{if(s==="max")throw t();return o.call(i,s)}),i};var Rg=(t,e)=>{let n=t.createDelay(e.maxDelayTime);return Ae(n,e),Ge(n,e,"delayTime"),n};var IC=t=>(e,n)=>{let r=e.createDynamicsCompressor();if(Ae(r,n),n.channelCount>2||n.channelCountMode==="max")throw t();return Ge(r,n,"attack"),Ge(r,n,"knee"),Ge(r,n,"ratio"),Ge(r,n,"release"),Ge(r,n,"threshold"),r};var pn=(t,e)=>{let n=t.createGain();return Ae(n,e),Ge(n,e,"gain"),n};var MC=t=>(e,n,r)=>{if(e.createIIRFilter===void 0)return t(e,n,r);let i=e.createIIRFilter(r.feedforward,r.feedback);return Ae(i,r),i};function hP(t,e){let n=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/n,(t[1]*e[0]-t[0]*e[1])/n]}function fP(t,e){return[t[0]*e[0]-t[1]*e[1],t[0]*e[1]+t[1]*e[0]]}function NC(t,e){let n=[0,0];for(let r=t.length-1;r>=0;r-=1)n=fP(n,e),n[0]+=t[r];return n}var OC=(t,e,n,r)=>(i,o,{channelCount:s,channelCountMode:a,channelInterpretation:c,feedback:u,feedforward:l})=>{let d=Id(o,i.sampleRate),h=u instanceof Float64Array?u:new Float64Array(u),p=l instanceof Float64Array?l:new Float64Array(l),y=h.length,v=p.length,_=Math.min(y,v);if(y===0||y>20)throw r();if(h[0]===0)throw e();if(v===0||v>20)throw r();if(p[0]===0)throw e();if(h[0]!==1){for(let m=0;m{let j=m.inputBuffer,K=m.outputBuffer,P=j.numberOfChannels;for(let V=0;Vt.createMediaElementSource(e.mediaElement);var kC=(t,e)=>{let n=t.createMediaStreamDestination();return Ae(n,e),n.numberOfOutputs===1&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n};var RC=(t,{mediaStream:e})=>{let n=e.getAudioTracks();n.sort((o,s)=>o.ids.id?1:0);let r=n.slice(0,1),i=t.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(i,"mediaStream",{value:e}),i};var PC=(t,e)=>(n,{mediaStreamTrack:r})=>{if(typeof n.createMediaStreamTrackSource=="function")return n.createMediaStreamTrackSource(r);let i=new MediaStream([r]),o=n.createMediaStreamSource(i);if(r.kind!=="audio")throw t();if(e(n))throw new TypeError;return o};var VC=t=>t===null?null:t.hasOwnProperty("OfflineAudioContext")?t.OfflineAudioContext:t.hasOwnProperty("webkitOfflineAudioContext")?t.webkitOfflineAudioContext:null;var LC=(t,e,n,r,i,o)=>(s,a)=>{let c=s.createOscillator();return Ae(c,a),Ge(c,a,"detune"),Ge(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):$e(c,a,"type"),e(n,()=>n(s))||Xs(c),e(r,()=>r(s))||o(c,s),e(i,()=>i(s))||Js(c),t(s,c),c};var BC=t=>(e,n)=>{let r=e.createPanner();return r.orientationX===void 0?t(e,n):(Ae(r,n),Ge(r,n,"orientationX"),Ge(r,n,"orientationY"),Ge(r,n,"orientationZ"),Ge(r,n,"positionX"),Ge(r,n,"positionY"),Ge(r,n,"positionZ"),$e(r,n,"coneInnerAngle"),$e(r,n,"coneOuterAngle"),$e(r,n,"coneOuterGain"),$e(r,n,"distanceModel"),$e(r,n,"maxDistance"),$e(r,n,"panningModel"),$e(r,n,"refDistance"),$e(r,n,"rolloffFactor"),r)};var jC=(t,e,n,r,i,o,s,a,c,u)=>(l,K)=>{var P=K,{coneInnerAngle:d,coneOuterAngle:h,coneOuterGain:p,distanceModel:y,maxDistance:v,orientationX:_,orientationY:x,orientationZ:M,panningModel:I,positionX:L,positionY:S,positionZ:D,refDistance:w,rolloffFactor:m}=P,j=yi(P,["coneInnerAngle","coneOuterAngle","coneOuterGain","distanceModel","maxDistance","orientationX","orientationY","orientationZ","panningModel","positionX","positionY","positionZ","refDistance","rolloffFactor"]);let V=l.createPanner();if(j.channelCount>2||j.channelCountMode==="max")throw s();Ae(V,j);let X={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},O=n(l,H(T({},X),{channelInterpretation:"speakers",numberOfInputs:6})),N=r(l,H(T({},j),{gain:1})),A=r(l,H(T({},X),{gain:1})),F=r(l,H(T({},X),{gain:0})),G=r(l,H(T({},X),{gain:0})),B=r(l,H(T({},X),{gain:0})),W=r(l,H(T({},X),{gain:0})),U=r(l,H(T({},X),{gain:0})),Fe=i(l,256,6,1),We=o(l,H(T({},X),{curve:new Float32Array([1,1]),oversample:"none"})),Et=[_,x,M],Bt=[L,S,D],g=new Float32Array(1);Fe.onaudioprocess=({inputBuffer:q})=>{let Ve=[c(q,g,0),c(q,g,1),c(q,g,2)];Ve.some((st,yt)=>st!==Et[yt])&&(V.setOrientation(...Ve),Et=Ve);let Ke=[c(q,g,3),c(q,g,4),c(q,g,5)];Ke.some((st,yt)=>st!==Bt[yt])&&(V.setPosition(...Ke),Bt=Ke)},Object.defineProperty(F.gain,"defaultValue",{get:()=>0}),Object.defineProperty(G.gain,"defaultValue",{get:()=>0}),Object.defineProperty(B.gain,"defaultValue",{get:()=>0}),Object.defineProperty(W.gain,"defaultValue",{get:()=>0}),Object.defineProperty(U.gain,"defaultValue",{get:()=>0});let f={get bufferSize(){},get channelCount(){return V.channelCount},set channelCount(q){if(q>2)throw s();N.channelCount=q,V.channelCount=q},get channelCountMode(){return V.channelCountMode},set channelCountMode(q){if(q==="max")throw s();N.channelCountMode=q,V.channelCountMode=q},get channelInterpretation(){return V.channelInterpretation},set channelInterpretation(q){N.channelInterpretation=q,V.channelInterpretation=q},get coneInnerAngle(){return V.coneInnerAngle},set coneInnerAngle(q){V.coneInnerAngle=q},get coneOuterAngle(){return V.coneOuterAngle},set coneOuterAngle(q){V.coneOuterAngle=q},get coneOuterGain(){return V.coneOuterGain},set coneOuterGain(q){if(q<0||q>1)throw e();V.coneOuterGain=q},get context(){return V.context},get distanceModel(){return V.distanceModel},set distanceModel(q){V.distanceModel=q},get inputs(){return[N]},get maxDistance(){return V.maxDistance},set maxDistance(q){if(q<0)throw new RangeError;V.maxDistance=q},get numberOfInputs(){return V.numberOfInputs},get numberOfOutputs(){return V.numberOfOutputs},get orientationX(){return A.gain},get orientationY(){return F.gain},get orientationZ(){return G.gain},get panningModel(){return V.panningModel},set panningModel(q){V.panningModel=q},get positionX(){return B.gain},get positionY(){return W.gain},get positionZ(){return U.gain},get refDistance(){return V.refDistance},set refDistance(q){if(q<0)throw new RangeError;V.refDistance=q},get rolloffFactor(){return V.rolloffFactor},set rolloffFactor(q){if(q<0)throw new RangeError;V.rolloffFactor=q},addEventListener(...q){return N.addEventListener(q[0],q[1],q[2])},dispatchEvent(...q){return N.dispatchEvent(q[0])},removeEventListener(...q){return N.removeEventListener(q[0],q[1],q[2])}};d!==f.coneInnerAngle&&(f.coneInnerAngle=d),h!==f.coneOuterAngle&&(f.coneOuterAngle=h),p!==f.coneOuterGain&&(f.coneOuterGain=p),y!==f.distanceModel&&(f.distanceModel=y),v!==f.maxDistance&&(f.maxDistance=v),_!==f.orientationX.value&&(f.orientationX.value=_),x!==f.orientationY.value&&(f.orientationY.value=x),M!==f.orientationZ.value&&(f.orientationZ.value=M),I!==f.panningModel&&(f.panningModel=I),L!==f.positionX.value&&(f.positionX.value=L),S!==f.positionY.value&&(f.positionY.value=S),D!==f.positionZ.value&&(f.positionZ.value=D),w!==f.refDistance&&(f.refDistance=w),m!==f.rolloffFactor&&(f.rolloffFactor=m),(Et[0]!==1||Et[1]!==0||Et[2]!==0)&&V.setOrientation(...Et),(Bt[0]!==0||Bt[1]!==0||Bt[2]!==0)&&V.setPosition(...Bt);let k=()=>{N.connect(V),t(N,We,0,0),We.connect(A).connect(O,0,0),We.connect(F).connect(O,0,1),We.connect(G).connect(O,0,2),We.connect(B).connect(O,0,3),We.connect(W).connect(O,0,4),We.connect(U).connect(O,0,5),O.connect(Fe).connect(l.destination)},C=()=>{N.disconnect(V),a(N,We,0,0),We.disconnect(A),A.disconnect(O),We.disconnect(F),F.disconnect(O),We.disconnect(G),G.disconnect(O),We.disconnect(B),B.disconnect(O),We.disconnect(W),W.disconnect(O),We.disconnect(U),U.disconnect(O),O.disconnect(Fe),Fe.disconnect(l.destination)};return u(Kn(f,V),k,C)};var UC=t=>(e,{disableNormalization:n,imag:r,real:i})=>{let o=r instanceof Float32Array?r:new Float32Array(r),s=i instanceof Float32Array?i:new Float32Array(i),a=e.createPeriodicWave(s,o,{disableNormalization:n});if(Array.from(r).length<2)throw t();return a};var ta=(t,e,n,r)=>t.createScriptProcessor(e,n,r);var qC=(t,e)=>(n,r)=>{let i=r.channelCountMode;if(i==="clamped-max")throw e();if(n.createStereoPanner===void 0)return t(n,r);let o=n.createStereoPanner();return Ae(o,r),Ge(o,r,"pan"),Object.defineProperty(o,"channelCountMode",{get:()=>i,set:s=>{if(s!==i)throw e()}}),o};var $C=(t,e,n,r,i,o)=>{let a=new Float32Array([1,1]),c=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},l=H(T({},u),{oversample:"none"}),d=(y,v,_,x)=>{let M=new Float32Array(16385),I=new Float32Array(16385);for(let j=0;j<16385;j+=1){let K=j/16384*c;M[j]=Math.cos(K),I[j]=Math.sin(K)}let L=n(y,H(T({},u),{gain:0})),S=r(y,H(T({},l),{curve:M})),D=r(y,H(T({},l),{curve:a})),w=n(y,H(T({},u),{gain:0})),m=r(y,H(T({},l),{curve:I}));return{connectGraph(){v.connect(L),v.connect(D.inputs===void 0?D:D.inputs[0]),v.connect(w),D.connect(_),_.connect(S.inputs===void 0?S:S.inputs[0]),_.connect(m.inputs===void 0?m:m.inputs[0]),S.connect(L.gain),m.connect(w.gain),L.connect(x,0,0),w.connect(x,0,1)},disconnectGraph(){v.disconnect(L),v.disconnect(D.inputs===void 0?D:D.inputs[0]),v.disconnect(w),D.disconnect(_),_.disconnect(S.inputs===void 0?S:S.inputs[0]),_.disconnect(m.inputs===void 0?m:m.inputs[0]),S.disconnect(L.gain),m.disconnect(w.gain),L.disconnect(x,0,0),w.disconnect(x,0,1)}}},h=(y,v,_,x)=>{let M=new Float32Array(16385),I=new Float32Array(16385),L=new Float32Array(16385),S=new Float32Array(16385),D=Math.floor(16385/2);for(let F=0;F<16385;F+=1)if(F>D){let G=(F-D)/(16384-D)*c;M[F]=Math.cos(G),I[F]=Math.sin(G),L[F]=0,S[F]=1}else{let G=F/(16384-D)*c;M[F]=1,I[F]=0,L[F]=Math.cos(G),S[F]=Math.sin(G)}let w=e(y,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),m=n(y,H(T({},u),{gain:0})),j=r(y,H(T({},l),{curve:M})),K=n(y,H(T({},u),{gain:0})),P=r(y,H(T({},l),{curve:I})),V=r(y,H(T({},l),{curve:a})),X=n(y,H(T({},u),{gain:0})),O=r(y,H(T({},l),{curve:L})),N=n(y,H(T({},u),{gain:0})),A=r(y,H(T({},l),{curve:S}));return{connectGraph(){v.connect(w),v.connect(V.inputs===void 0?V:V.inputs[0]),w.connect(m,0),w.connect(K,0),w.connect(X,1),w.connect(N,1),V.connect(_),_.connect(j.inputs===void 0?j:j.inputs[0]),_.connect(P.inputs===void 0?P:P.inputs[0]),_.connect(O.inputs===void 0?O:O.inputs[0]),_.connect(A.inputs===void 0?A:A.inputs[0]),j.connect(m.gain),P.connect(K.gain),O.connect(X.gain),A.connect(N.gain),m.connect(x,0,0),X.connect(x,0,0),K.connect(x,0,1),N.connect(x,0,1)},disconnectGraph(){v.disconnect(w),v.disconnect(V.inputs===void 0?V:V.inputs[0]),w.disconnect(m,0),w.disconnect(K,0),w.disconnect(X,1),w.disconnect(N,1),V.disconnect(_),_.disconnect(j.inputs===void 0?j:j.inputs[0]),_.disconnect(P.inputs===void 0?P:P.inputs[0]),_.disconnect(O.inputs===void 0?O:O.inputs[0]),_.disconnect(A.inputs===void 0?A:A.inputs[0]),j.disconnect(m.gain),P.disconnect(K.gain),O.disconnect(X.gain),A.disconnect(N.gain),m.disconnect(x,0,0),X.disconnect(x,0,0),K.disconnect(x,0,1),N.disconnect(x,0,1)}}},p=(y,v,_,x,M)=>{if(v===1)return d(y,_,x,M);if(v===2)return h(y,_,x,M);throw i()};return(y,I)=>{var L=I,{channelCount:v,channelCountMode:_,pan:x}=L,M=yi(L,["channelCount","channelCountMode","pan"]);if(_==="max")throw i();let S=t(y,H(T({},M),{channelCount:1,channelCountMode:_,numberOfInputs:2})),D=n(y,H(T({},M),{channelCount:v,channelCountMode:_,gain:1})),w=n(y,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:x}),{connectGraph:m,disconnectGraph:j}=p(y,v,D,w,S);Object.defineProperty(w.gain,"defaultValue",{get:()=>0}),Object.defineProperty(w.gain,"maxValue",{get:()=>1}),Object.defineProperty(w.gain,"minValue",{get:()=>-1});let K={get bufferSize(){},get channelCount(){return D.channelCount},set channelCount(O){D.channelCount!==O&&(P&&j(),{connectGraph:m,disconnectGraph:j}=p(y,O,D,w,S),P&&m()),D.channelCount=O},get channelCountMode(){return D.channelCountMode},set channelCountMode(O){if(O==="clamped-max"||O==="max")throw i();D.channelCountMode=O},get channelInterpretation(){return D.channelInterpretation},set channelInterpretation(O){D.channelInterpretation=O},get context(){return D.context},get inputs(){return[D]},get numberOfInputs(){return D.numberOfInputs},get numberOfOutputs(){return D.numberOfOutputs},get pan(){return w.gain},addEventListener(...O){return D.addEventListener(O[0],O[1],O[2])},dispatchEvent(...O){return D.dispatchEvent(O[0])},removeEventListener(...O){return D.removeEventListener(O[0],O[1],O[2])}},P=!1,V=()=>{m(),P=!0},X=()=>{j(),P=!1};return o(Kn(K,S),V,X)}};var HC=(t,e,n,r,i,o,s)=>(a,c)=>{let u=a.createWaveShaper();if(o!==null&&o.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return n(a,c);Ae(u,c);let l=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(l!==null&&l.length<2)throw e();$e(u,{curve:l},"curve"),$e(u,c,"oversample");let d=null,h=!1;return s(u,"curve",v=>()=>v.call(u),v=>_=>(v.call(u,_),h&&(r(_)&&d===null?d=t(a,u):!r(_)&&d!==null&&(d(),d=null)),_)),i(u,()=>{h=!0,r(u.curve)&&(d=t(a,u))},()=>{h=!1,d!==null&&(d(),d=null)})};var GC=(t,e,n,r,i)=>(o,u)=>{var l=u,{curve:s,oversample:a}=l,c=yi(l,["curve","oversample"]);let d=o.createWaveShaper(),h=o.createWaveShaper();Ae(d,c),Ae(h,c);let p=n(o,H(T({},c),{gain:1})),y=n(o,H(T({},c),{gain:-1})),v=n(o,H(T({},c),{gain:1})),_=n(o,H(T({},c),{gain:-1})),x=null,M=!1,I=null,L={get bufferSize(){},get channelCount(){return d.channelCount},set channelCount(w){p.channelCount=w,y.channelCount=w,d.channelCount=w,v.channelCount=w,h.channelCount=w,_.channelCount=w},get channelCountMode(){return d.channelCountMode},set channelCountMode(w){p.channelCountMode=w,y.channelCountMode=w,d.channelCountMode=w,v.channelCountMode=w,h.channelCountMode=w,_.channelCountMode=w},get channelInterpretation(){return d.channelInterpretation},set channelInterpretation(w){p.channelInterpretation=w,y.channelInterpretation=w,d.channelInterpretation=w,v.channelInterpretation=w,h.channelInterpretation=w,_.channelInterpretation=w},get context(){return d.context},get curve(){return I},set curve(w){if(w!==null&&w.length<2)throw e();if(w===null)d.curve=w,h.curve=w;else{let m=w.length,j=new Float32Array(m+2-m%2),K=new Float32Array(m+2-m%2);j[0]=w[0],K[0]=-w[m-1];let P=Math.ceil((m+1)/2),V=(m+1)/2-1;for(let X=1;X{p.connect(d).connect(v),p.connect(y).connect(h).connect(_).connect(v),M=!0,r(I)&&(x=t(o,p))},D=()=>{p.disconnect(d),d.disconnect(v),p.disconnect(y),y.disconnect(h),h.disconnect(_),_.disconnect(v),M=!1,x!==null&&(x(),x=null)};return i(Kn(L,v),S,D)};var Qt=()=>new DOMException("","NotSupportedError");var pP={numberOfChannels:1},WC=(t,e,n,r,i)=>class extends t{constructor(s,a,c){let u;if(typeof s=="number"&&a!==void 0&&c!==void 0)u={length:a,numberOfChannels:s,sampleRate:c};else if(typeof s=="object")u=s;else throw new Error("The given parameters are not valid.");let{length:l,numberOfChannels:d,sampleRate:h}=T(T({},pP),u),p=r(d,l,h);e(mr,()=>mr(p))||p.addEventListener("statechange",(()=>{let y=0,v=_=>{this._state==="running"&&(y>0?(p.removeEventListener("statechange",v),_.stopImmediatePropagation(),this._waitForThePromiseToSettle(_)):y+=1)};return v})()),super(p,d),this._length=l,this._nativeOfflineAudioContext=p,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(n()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,ji(this)}))}_waitForThePromiseToSettle(s){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(s):setTimeout(()=>this._waitForThePromiseToSettle(s))}};var mP={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},zC=(t,e,n,r,i,o,s)=>class extends t{constructor(c,u){let l=i(c),d=T(T({},mP),u),h=n(l,d),p=o(l),y=p?r():null,v=c.sampleRate/2;super(c,!1,h,y),this._detune=e(this,p,h.detune,153600,-153600),this._frequency=e(this,p,h.frequency,v,-v),this._nativeOscillatorNode=h,this._onended=null,this._oscillatorNodeRenderer=y,this._oscillatorNodeRenderer!==null&&d.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=d.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(c){let u=typeof c=="function"?s(this,c):null;this._nativeOscillatorNode.onended=u;let l=this._nativeOscillatorNode.onended;this._onended=l!==null&&l===u?c:l}get type(){return this._nativeOscillatorNode.type}set type(c){this._nativeOscillatorNode.type=c,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(c){this._nativeOscillatorNode.setPeriodicWave(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=c)}start(c=0){if(this._nativeOscillatorNode.start(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=c),this.context.state!=="closed"){fr(this);let u=()=>{this._nativeOscillatorNode.removeEventListener("ended",u),fn(this)&&Ur(this)};this._nativeOscillatorNode.addEventListener("ended",u)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}};var YC=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=null,a=null,c=null,u=(l,d)=>Q(void 0,null,function*(){let h=n(l),p=qe(h,d);if(!p){let y={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:s===null?void 0:s,type:h.type};h=e(d,y),a!==null&&h.start(a),c!==null&&h.stop(c)}return o.set(d,h),p?(yield t(d,l.detune,h.detune),yield t(d,l.frequency,h.frequency)):(yield r(d,l.detune,h.detune),yield r(d,l.frequency,h.frequency)),yield i(l,d,h),h});return{set periodicWave(l){s=l},set start(l){a=l},set stop(l){c=l},render(l,d){let h=o.get(d);return h!==void 0?Promise.resolve(h):u(l,d)}}};var gP={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},ZC=(t,e,n,r,i,o,s)=>class extends t{constructor(c,u){let l=i(c),d=T(T({},gP),u),h=n(l,d),p=o(l),y=p?r():null;super(c,!1,h,y),this._nativePannerNode=h,this._orientationX=e(this,p,h.orientationX,Tt,Mt),this._orientationY=e(this,p,h.orientationY,Tt,Mt),this._orientationZ=e(this,p,h.orientationZ,Tt,Mt),this._positionX=e(this,p,h.positionX,Tt,Mt),this._positionY=e(this,p,h.positionY,Tt,Mt),this._positionZ=e(this,p,h.positionZ,Tt,Mt),s(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(c){this._nativePannerNode.coneInnerAngle=c}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(c){this._nativePannerNode.coneOuterAngle=c}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(c){this._nativePannerNode.coneOuterGain=c}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(c){this._nativePannerNode.distanceModel=c}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(c){this._nativePannerNode.maxDistance=c}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(c){this._nativePannerNode.panningModel=c}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(c){this._nativePannerNode.refDistance=c}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(c){this._nativePannerNode.rolloffFactor=c}};var QC=(t,e,n,r,i,o,s,a,c,u)=>()=>{let l=new WeakMap,d=null,h=(p,y)=>Q(void 0,null,function*(){let v=null,_=o(p),x={channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation},M=H(T({},x),{coneInnerAngle:_.coneInnerAngle,coneOuterAngle:_.coneOuterAngle,coneOuterGain:_.coneOuterGain,distanceModel:_.distanceModel,maxDistance:_.maxDistance,panningModel:_.panningModel,refDistance:_.refDistance,rolloffFactor:_.rolloffFactor}),I=qe(_,y);if("bufferSize"in _)v=r(y,H(T({},x),{gain:1}));else if(!I){let L=H(T({},M),{orientationX:_.orientationX.value,orientationY:_.orientationY.value,orientationZ:_.orientationZ.value,positionX:_.positionX.value,positionY:_.positionY.value,positionZ:_.positionZ.value});_=i(y,L)}if(l.set(y,v===null?_:v),v!==null){if(d===null){if(s===null)throw new Error("Missing the native OfflineAudioContext constructor.");let P=new s(6,p.context.length,y.sampleRate),V=e(P,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});V.connect(P.destination),d=(()=>Q(void 0,null,function*(){let X=yield Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map((O,N)=>Q(void 0,null,function*(){let A=n(P,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:N===0?1:0});return yield a(P,O,A.offset),A})));for(let O=0;O<6;O+=1)X[O].connect(V,0,O),X[O].start(0);return u(P)}))()}let L=yield d,S=r(y,H(T({},x),{gain:1}));yield c(p,y,S);let D=[];for(let P=0;PO!==w[N])||X.some((O,N)=>O!==m[N])){w=V,m=X;let O=P/y.sampleRate;j.gain.setValueAtTime(0,O),j=r(y,H(T({},x),{gain:0})),K=i(y,H(T({},M),{orientationX:w[0],orientationY:w[1],orientationZ:w[2],positionX:m[0],positionY:m[1],positionZ:m[2]})),j.gain.setValueAtTime(1,O),S.connect(j).connect(K.inputs[0]),K.connect(v)}}return v}return I?(yield t(y,p.orientationX,_.orientationX),yield t(y,p.orientationY,_.orientationY),yield t(y,p.orientationZ,_.orientationZ),yield t(y,p.positionX,_.positionX),yield t(y,p.positionY,_.positionY),yield t(y,p.positionZ,_.positionZ)):(yield a(y,p.orientationX,_.orientationX),yield a(y,p.orientationY,_.orientationY),yield a(y,p.orientationZ,_.orientationZ),yield a(y,p.positionX,_.positionX),yield a(y,p.positionY,_.positionY),yield a(y,p.positionZ,_.positionZ)),Qn(_)?yield c(p,y,_.inputs[0]):yield c(p,y,_),_});return{render(p,y){let v=l.get(y);return v!==void 0?Promise.resolve(v):h(p,y)}}};var yP={disableNormalization:!1},KC=(t,e,n,r)=>class XC{constructor(o,s){let a=e(o),c=r(T(T({},yP),s)),u=t(a,c);return n.add(u),u}static[Symbol.hasInstance](o){return o!==null&&typeof o=="object"&&Object.getPrototypeOf(o)===XC.prototype||n.has(o)}};var JC=(t,e)=>(n,r,i)=>(t(r).replay(i),e(r,n,i));var eD=(t,e,n)=>(r,i,o)=>Q(void 0,null,function*(){let s=t(r);yield Promise.all(s.activeInputs.map((a,c)=>Array.from(a).map(d=>Q(void 0,[d],function*([u,l]){let p=yield e(u).render(u,i),y=r.context.destination;!n(u)&&(r!==y||!n(r))&&p.connect(o,l,c)}))).reduce((a,c)=>[...a,...c],[]))});var tD=(t,e,n)=>(r,i,o)=>Q(void 0,null,function*(){let s=e(r);yield Promise.all(Array.from(s.activeInputs).map(u=>Q(void 0,[u],function*([a,c]){let d=yield t(a).render(a,i);n(a)||d.connect(o,c)})))});var nD=(t,e,n,r)=>i=>t(mr,()=>mr(i))?Promise.resolve(t(r,r)).then(o=>{if(!o){let s=n(i,512,0,1);i.oncomplete=()=>{s.onaudioprocess=null,s.disconnect()},s.onaudioprocess=()=>i.currentTime,s.connect(i.destination)}return i.startRendering()}):new Promise(o=>{let s=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=a=>{s.disconnect(),o(a.renderedBuffer)},s.connect(i.destination),i.startRendering()});var rD=t=>(e,n)=>{t.set(e,n)};var iD=t=>(e,n)=>t.set(e,n);var oD=(t,e,n,r,i,o,s,a)=>(c,u)=>n(c).render(c,u).then(()=>Promise.all(Array.from(r(u)).map(l=>n(l).render(l,u)))).then(()=>i(u)).then(l=>(typeof l.copyFromChannel!="function"?(s(l),Hs(l)):e(o,()=>o(l))||a(l),t.add(l),l));var vP={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},sD=(t,e,n,r,i,o)=>class extends t{constructor(a,c){let u=i(a),l=T(T({},vP),c),d=n(u,l),h=o(u),p=h?r():null;super(a,!1,d,p),this._pan=e(this,h,d.pan)}get pan(){return this._pan}};var aD=(t,e,n,r,i)=>()=>{let o=new WeakMap,s=(a,c)=>Q(void 0,null,function*(){let u=n(a),l=qe(u,c);if(!l){let d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,pan:u.pan.value};u=e(c,d)}return o.set(c,u),l?yield t(c,a.pan,u.pan):yield r(c,a.pan,u.pan),Qn(u)?yield i(a,c,u.inputs[0]):yield i(a,c,u),u});return{render(a,c){let u=o.get(c);return u!==void 0?Promise.resolve(u):s(a,c)}}};var cD=t=>()=>{if(t===null)return!1;try{new t({length:1,sampleRate:44100})}catch{return!1}return!0};var uD=(t,e)=>()=>Q(void 0,null,function*(){if(t===null)return!0;if(e===null)return!1;let n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new e(1,128,44100),i=URL.createObjectURL(n),o=!1,s=!1;try{yield r.audioWorklet.addModule(i);let a=new t(r,"a",{numberOfOutputs:0}),c=r.createOscillator();a.port.onmessage=()=>o=!0,a.onprocessorerror=()=>s=!0,c.connect(a),c.start(0),yield r.startRendering(),yield new Promise(u=>setTimeout(u))}catch{}finally{URL.revokeObjectURL(i)}return o&&!s});var lD=(t,e)=>()=>{if(e===null)return Promise.resolve(!1);let n=new e(1,1,44100),r=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(i=>{n.oncomplete=()=>{r.disconnect(),i(n.currentTime!==0)},n.startRendering()})};var Pg=()=>new DOMException("","UnknownError");var _P={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},dD=(t,e,n,r,i,o,s)=>class extends t{constructor(c,u){let l=i(c),d=T(T({},_P),u),h=n(l,d),y=o(l)?r():null;super(c,!0,h,y),this._isCurveNullified=!1,this._nativeWaveShaperNode=h,s(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(c){if(c===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(c.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}};var hD=(t,e,n)=>()=>{let r=new WeakMap,i=(o,s)=>Q(void 0,null,function*(){let a=e(o);if(!qe(a,s)){let u={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=t(s,u)}return r.set(s,a),Qn(a)?yield n(o,s,a.inputs[0]):yield n(o,s,a),a});return{render(o,s){let a=r.get(s);return a!==void 0?Promise.resolve(a):i(o,s)}}};var fD=()=>typeof window>"u"?null:window;var pD=(t,e)=>n=>{n.copyFromChannel=(r,i,o=0)=>{let s=t(o),a=t(i);if(a>=n.numberOfChannels)throw e();let c=n.length,u=n.getChannelData(a),l=r.length;for(let d=s<0?-s:0;d+s{let s=t(o),a=t(i);if(a>=n.numberOfChannels)throw e();let c=n.length,u=n.getChannelData(a),l=r.length;for(let d=s<0?-s:0;d+se=>{e.copyFromChannel=(n=>(r,i,o=0)=>{let s=t(o),a=t(i);if(s(r,i,o=0)=>{let s=t(o),a=t(i);if(s(e,n)=>{let r=n.createBuffer(1,1,44100);e.buffer===null&&(e.buffer=r),t(e,"buffer",i=>()=>{let o=i.call(e);return o===r?null:o},i=>o=>i.call(e,o===null?r:o))};var yD=(t,e)=>(n,r)=>{r.channelCount=1,r.channelCountMode="explicit",Object.defineProperty(r,"channelCount",{get:()=>1,set:()=>{throw t()}}),Object.defineProperty(r,"channelCountMode",{get:()=>"explicit",set:()=>{throw t()}});let i=n.createBufferSource();e(r,()=>{let a=r.numberOfInputs;for(let c=0;ci.disconnect(r))};var Vg=(t,e,n)=>t.copyFromChannel===void 0?t.getChannelData(n)[0]:(t.copyFromChannel(e,n),e[0]);var Lg=t=>{if(t===null)return!1;let e=t.length;return e%2!==0?t[Math.floor(e/2)]!==0:t[e/2-1]+t[e/2]!==0};var na=(t,e,n,r)=>{let i=t;for(;!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);let{get:o,set:s}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,{get:n(o),set:r(s)})};var vD=t=>H(T({},t),{outputChannelCount:t.outputChannelCount!==void 0?t.outputChannelCount:t.numberOfInputs===1&&t.numberOfOutputs===1?[t.channelCount]:Array.from({length:t.numberOfOutputs},()=>1)});var _D=t=>H(T({},t),{channelCount:t.numberOfOutputs});var xD=t=>{let{imag:e,real:n}=t;return e===void 0?n===void 0?H(T({},t),{imag:[0,0],real:[0,0]}):H(T({},t),{imag:Array.from(n,()=>0),real:n}):n===void 0?H(T({},t),{imag:e,real:Array.from(e,()=>0)}):H(T({},t),{imag:e,real:n})};var Bg=(t,e,n)=>{try{t.setValueAtTime(e,n)}catch(r){if(r.code!==9)throw r;Bg(t,e,n+1e-7)}};var bD=t=>{let e=t.createBufferSource();e.start();try{e.start()}catch{return!0}return!1};var wD=t=>{let e=t.createBufferSource(),n=t.createBuffer(1,1,44100);e.buffer=n;try{e.start(0,1)}catch{return!1}return!0};var TD=t=>{let e=t.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0};var Md=t=>{let e=t.createOscillator();try{e.start(-1)}catch(n){return n instanceof RangeError}return!1};var jg=t=>{let e=t.createBuffer(1,1,44100),n=t.createBufferSource();n.buffer=e,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}};var Nd=t=>{let e=t.createOscillator();try{e.stop(-1)}catch(n){return n instanceof RangeError}return!1};var CD=t=>{let{port1:e,port2:n}=new MessageChannel;try{e.postMessage(t)}finally{e.close(),n.close()}};var DD=t=>{t.start=(e=>(n=0,r=0,i)=>{let o=t.buffer,s=o===null?r:Math.min(o.duration,r);o!==null&&s>o.duration-.5/t.context.sampleRate?e.call(t,n,0,0):e.call(t,n,s,i)})(t.start)};var Ug=(t,e)=>{let n=e.createGain();t.connect(n);let r=(i=>()=>{i.call(t,n),t.removeEventListener("ended",r)})(t.disconnect);t.addEventListener("ended",r),Kn(t,n),t.stop=(i=>{let o=!1;return(s=0)=>{if(o)try{i.call(t,s)}catch{n.gain.setValueAtTime(0,s)}else i.call(t,s),o=!0}})(t.stop)};var Ao=(t,e)=>n=>{let r={value:t};return Object.defineProperties(n,{currentTarget:r,target:r}),typeof e=="function"?e.call(t,n):e.handleEvent.call(t,n)};var xP=pw(pr),bP=Cw(pr),wP=xT(Li),SD=new WeakMap,TP=PT(SD),Xn=tT(new Map,new WeakMap),qr=fD(),AD=dC(Xn,Zn),qg=RT(jt),Kt=eD(jt,qg,ui),CP=Aw(AD,nt,Kt),lt=BT(qs),li=VC(qr),rt=eC(li),ID=new WeakMap,MD=IT(Ao),ra=mC(qr),$g=QT(ra),Hg=KT(qr),ND=XT(qr),Kc=yC(qr),Nt=Gw(mw(vd),Tw(xP,bP,Gs,wP,Ws,jt,TP,jr,nt,pr,fn,ui,zs),Xn,GT(zc,Ws,jt,nt,Eo,fn),Zn,Ks,Qt,yT(Gs,zc,jt,nt,Eo,lt,fn,rt),TT(ID,jt,Rt),MD,lt,$g,Hg,ND,rt,Kc),DP=Sw(Nt,CP,Zn,AD,lt,rt);var Gg=new WeakSet,ED=hC(qr),OD=dT(new Uint32Array(1)),Wg=pD(OD,Zn),zg=mD(OD),EP=Iw(Gg,Xn,Qt,ED,li,cD(ED),Wg,zg);var Od=Dw(pn),FD=tD(qg,Bi,ui),$r=sT(FD),ia=pC(Od,Xn,bD,wD,TD,Md,jg,Nd,DD,gD(na),Ug),Hr=JC(VT(Bi),FD),SP=Ow($r,ia,nt,Hr,Kt),gr=zw(gw(_d),ID,Wc,Yw,Cn.createCancelAndHoldAutomationEvent,Cn.createCancelScheduledValuesAutomationEvent,Cn.createExponentialRampToValueAutomationEvent,Cn.createLinearRampToValueAutomationEvent,Cn.createSetTargetAutomationEvent,Cn.createSetValueAutomationEvent,Cn.createSetValueCurveAutomationEvent,ra,Bg),AP=Nw(Nt,SP,gr,mt,ia,lt,rt,Ao);var IP=jw(Nt,Uw,Zn,mt,gC(pn,na),lt,rt,Kt),MP=eT($r,kg,nt,Hr,Kt),Io=iD(SD),NP=Jw(Nt,gr,MP,Ks,kg,lt,rt,Io),qi=uC(pr,Hg),OP=yD(mt,qi),$i=CC(ra,OP),FP=rT($i,nt,Kt),kP=nT(Nt,FP,$i,lt,rt),RP=oT(ea,nt,Kt),PP=iT(Nt,RP,ea,lt,rt,_D),VP=SC(Od,ia,pn,qi),oa=EC(Od,Xn,VP,Md,Nd),LP=lT($r,oa,nt,Hr,Kt),BP=uT(Nt,gr,LP,oa,lt,rt,Ao),kD=AC(Qt,na),jP=fT(kD,nt,Kt),UP=hT(Nt,jP,kD,lt,rt,Io),qP=_T($r,Rg,nt,Hr,Kt),$P=vT(Nt,gr,qP,Rg,lt,rt,Io),RD=IC(Qt),HP=ET($r,RD,nt,Hr,Kt),GP=DT(Nt,gr,HP,RD,Qt,lt,rt,Io),WP=FT($r,pn,nt,Hr,Kt),zP=OT(Nt,gr,WP,pn,lt,rt),YP=OC(Ks,mt,ta,Qt),Fd=nD(Xn,pn,ta,lD(pn,li)),ZP=HT(ia,nt,li,Kt,Fd),QP=MC(YP),KP=$T(Nt,QP,ZP,lt,rt,Io),XP=qw(gr,$i,oa,ta,Qt,Vg,rt,na),PD=new WeakMap,Yg=aC(IP,XP,MD,rt,PD,Ao),VD=LC(Od,Xn,Md,jg,Nd,Ug),JP=YC($r,VD,nt,Hr,Kt),e3=zC(Nt,gr,VD,JP,lt,rt,Ao),LD=cT(ia),t3=GC(LD,mt,pn,Lg,qi),kd=HC(LD,mt,t3,Lg,qi,ra,na),n3=jC(Gs,mt,$i,pn,ta,kd,Qt,Ws,Vg,qi),BD=BC(n3),r3=QC($r,$i,oa,pn,BD,nt,li,Hr,Kt,Fd),i3=ZC(Nt,gr,BD,r3,lt,rt,Io),o3=UC(Zn),s3=KC(o3,lt,new WeakSet,xD),a3=$C($i,ea,pn,kd,Qt,qi),jD=qC(a3,Qt),c3=aD($r,jD,nt,Hr,Kt),u3=sD(Nt,gr,jD,c3,lt,rt),l3=hD(kd,nt,Kt),d3=dD(Nt,mt,kd,l3,lt,rt,Io),UD=tC(qr),Zg=MT(qr),qD=new WeakMap,h3=jT(qD,li),f3=UD?ww(Xn,Qt,AT(qr),Zg,NT(fw),lt,h3,rt,Kc,new WeakMap,new WeakMap,uD(Kc,li),qr):void 0,p3=JT($g,rt),m3=gT(Gg,Xn,mT,ST,new WeakSet,lt,p3,$s,mr,Wg,zg),$D=Xw(f3,DP,EP,AP,NP,kP,PP,BP,UP,m3,$P,GP,zP,KP,Yg,e3,i3,s3,u3,d3),g3=nC(Nt,FC,lt,rt),y3=rC(Nt,kC,lt,rt),v3=iC(Nt,RC,lt,rt),_3=PC(mt,rt),x3=oC(Nt,_3,lt),HD=Bw($D,mt,Qt,Pg,g3,y3,v3,x3,ra);var Qg=UT(PD),b3=Ew(Qg),GD=aT(Zn),w3=bT(Qg),WD=CT(Zn),zD=new WeakMap,T3=kT(zD,Rt),C3=TC(GD,Zn,mt,$i,ea,oa,pn,ta,Qt,WD,Zg,T3,qi),D3=_C(mt,C3,pn,Qt,qi),E3=Kw($r,GD,ia,$i,ea,oa,pn,w3,WD,Zg,nt,Kc,li,Hr,Kt,Fd),S3=LT(qD),A3=rD(zD),Kg=UD?Zw(b3,Nt,gr,E3,D3,jt,S3,lt,rt,Kc,vD,A3,CD,Ao):void 0;var Tde=sC(mt,Qt,Pg,Yg,ra);var YD=pT(Qt,li),ZD=oD(Gg,Xn,qg,Qg,Fd,$s,Wg,zg),Cde=cC(Xn,mt,YD,Yg,ZD);var QD=WC($D,Xn,mt,YD,ZD);var KD=WT(qs,$g),XD=zT(Us,Hg),JD=YT(Wc,ND),eE=ZT(qs,rt);function te(t,e){if(!t)throw new Error(e)}function $t(t,e,n=1/0){if(!(e<=t&&t<=n))throw new RangeError(`Value must be within [${e}, ${n}], got: ${t}`)}function Rd(t){!t.isOffline&&t.state!=="running"&&Xc('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}var tE=console;function nE(...t){tE.log(...t)}function Xc(...t){tE.warn(...t)}function Pt(t){return typeof t>"u"}function ue(t){return!Pt(t)}function rE(t){return typeof t=="function"}function Xt(t){return typeof t=="number"}function yr(t){return Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object}function Pd(t){return typeof t=="boolean"}function Ot(t){return Array.isArray(t)}function Ht(t){return typeof t=="string"}function Jc(t){return Ht(t)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(t)}function iE(t){return new HD(t)}function oE(t,e,n){return new QD(t,e,n)}var Gr=typeof self=="object"?self:null,sE=Gr&&(Gr.hasOwnProperty("AudioContext")||Gr.hasOwnProperty("webkitAudioContext"));function aE(t,e,n){return te(ue(Kg),"This node only works in a secure context (https or localhost)"),new Kg(t,e,n)}var Vd=class{constructor(e,n,r){this._callback=e,this._type=n,this._updateInterval=r,this._createClock()}_createWorker(){let e=new Blob([` + // the initial timeout time + let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; + // onmessage callback + self.onmessage = function(msg){ + timeoutTime = parseInt(msg.data); + }; + // the tick function which posts a message + // and schedules a new tick + function tick(){ + setTimeout(tick, timeoutTime); + self.postMessage('tick'); + } + // call tick initially + tick(); + `],{type:"text/javascript"}),n=URL.createObjectURL(e),r=new Worker(n);r.onmessage=this._callback.bind(this),this._worker=r}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type==="worker")try{this._createWorker()}catch{this._type="timeout",this._createClock()}else this._type==="timeout"&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){this._updateInterval=Math.max(e,128/44100),this._type==="worker"&&this._worker.postMessage(Math.max(e*1e3,1))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}};function vr(t){return JD(t)}function Wr(t){return XD(t)}function sa(t){return eE(t)}function Hi(t){return KD(t)}function Ld(t){return t instanceof AudioBuffer}function N3(t,e){return t==="value"||vr(e)||Wr(e)||Ld(e)}function _r(t,...e){if(!e.length)return t;let n=e.shift();if(yr(t)&&yr(n))for(let r in n)N3(r,n[r])?t[r]=n[r]:yr(n[r])?(t[r]||Object.assign(t,{[r]:{}}),_r(t[r],n[r])):Object.assign(t,{[r]:n[r]});return _r(t,...e)}function cE(t,e){return t.length===e.length&&t.every((n,r)=>e[r]===n)}function b(t,e,n=[],r){let i={},o=Array.from(e);if(yr(o[0])&&r&&!Reflect.has(o[0],r)&&(Object.keys(o[0]).some(a=>Reflect.has(t,a))||(_r(i,{[r]:o[0]}),n.splice(n.indexOf(r),1),o.shift())),o.length===1&&yr(o[0]))_r(i,o[0]);else for(let s=0;s{Reflect.has(t,n)&&delete t[n]}),t}var nn=(()=>{class t{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...n){(this.debug||Gr&&this.toString()===Gr.TONE_DEBUG_CLASS)&&nE(this,...n)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}return t.version=Rc,t})();function aa(t,e){return t>e+1e-6}function eu(t,e){return aa(t,e)||mn(t,e)}function Bd(t,e){return t+1e-6this.memory){let n=this.length-this.memory;this._timeline.splice(0,n)}return this}remove(e){let n=this._timeline.indexOf(e);return n!==-1&&this._timeline.splice(n,1),this}get(e,n="time"){let r=this._search(e,n);return r!==-1?this._timeline[r]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,n="time"){let r=this._search(e,n);return r+10&&this._timeline[n-1].time=0?this._timeline[r-1]:null}cancel(e){if(this._timeline.length>1){let n=this._search(e);if(n>=0)if(mn(this._timeline[n].time,e)){for(let r=n;r>=0&&mn(this._timeline[r].time,e);r--)n=r;this._timeline=this._timeline.slice(0,n)}else this._timeline=this._timeline.slice(0,n+1);else this._timeline=[]}else this._timeline.length===1&&eu(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){let n=this._search(e);return n>=0&&(this._timeline=this._timeline.slice(n+1)),this}previousEvent(e){let n=this._timeline.indexOf(e);return n>0?this._timeline[n-1]:null}_search(e,n="time"){if(this._timeline.length===0)return-1;let r=0,i=this._timeline.length,o=i;if(i>0&&this._timeline[i-1][n]<=e)return i-1;for(;r=0&&this._timeline[r].time>=e;)r--;return this._iterate(n,r+1),this}forEachAtTime(e,n){let r=this._search(e);if(r!==-1&&mn(this._timeline[r].time,e)){let i=r;for(let o=r;o>=0&&mn(this._timeline[o].time,e);o--)i=o;this._iterate(o=>{n(o)},i,r)}return this}dispose(){return super.dispose(),this._timeline=[],this}};var lE=[];function Gi(t){lE.push(t)}function dE(t){lE.forEach(e=>e(t))}var hE=[];function Wi(t){hE.push(t)}function fE(t){hE.forEach(e=>e(t))}var zi=class t extends nn{constructor(){super(...arguments),this.name="Emitter"}on(e,n){return e.split(/\W+/).forEach(i=>{Pt(this._events)&&(this._events={}),this._events.hasOwnProperty(i)||(this._events[i]=[]),this._events[i].push(n)}),this}once(e,n){let r=(...i)=>{n(...i),this.off(e,r)};return this.on(e,r),this}off(e,n){return e.split(/\W+/).forEach(i=>{if(Pt(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(Pt(n))this._events[e]=[];else{let o=this._events[e];for(let s=o.length-1;s>=0;s--)o[s]===n&&o.splice(s,1)}}),this}emit(e,...n){if(this._events&&this._events.hasOwnProperty(e)){let r=this._events[e].slice(0);for(let i=0,o=r.length;i{let r=Object.getOwnPropertyDescriptor(t.prototype,n);Object.defineProperty(e.prototype,n,r)})}dispose(){return super.dispose(),this._events=void 0,this}};var ca=class extends zi{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}};var Mo=class t extends ca{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Gt,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;let e=b(t.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=iE({latencyHint:e.latencyHint}),this._ticker=new Vd(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(dE(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,n,r){return this._context.createBuffer(e,n,r)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,n){return this._context.createIIRFilter(e,n)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,n,r){return this._context.createPeriodicWave(e,n,r)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){return te(Hi(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(e)}createMediaElementSource(e){return te(Hi(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(e)}createMediaStreamDestination(){return te(Hi(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){te(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){te(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){te(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){te(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,n){return aE(this.rawContext,e,n)}addAudioWorkletModule(e,n){return Ne(this,void 0,void 0,function*(){te(ue(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(n)||this._workletModules.set(n,this.rawContext.audioWorklet.addModule(e)),yield this._workletModules.get(n)})}workletsAreReady(){return Ne(this,void 0,void 0,function*(){let e=[];this._workletModules.forEach(n=>e.push(n)),yield Promise.all(e)})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get latencyHint(){return this._latencyHint}_setLatencyHint(e){let n=0;if(this._latencyHint=e,Ht(e))switch(e){case"interactive":n=.1;break;case"playback":n=.5;break;case"balanced":n=.25;break}this.lookAhead=n,this.updateInterval=n/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Hi(this._context)?this._context.resume():Promise.resolve()}close(){return Ne(this,void 0,void 0,function*(){Hi(this._context)&&(yield this._context.close()),this._initialized&&fE(this)})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{let n=this._context.createBuffer(1,128,this._context.sampleRate),r=n.getChannelData(0);for(let o=0;othis._constants[e].disconnect()),this}_timeoutLoop(){let e=this.now(),n=this._timeouts.peek();for(;this._timeouts.length&&n&&n.time<=e;)n.callback(),this._timeouts.shift(),n=this._timeouts.peek()}setTimeout(e,n){this._timeoutIds++;let r=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:r+n}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(n=>{n.id===e&&this._timeouts.remove(n)}),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,n){let r=++this._timeoutIds,i=()=>{let o=this.now();this._timeouts.add({callback:()=>{e(),i()},id:r,time:o+n})};return i(),r}};var jd=class extends ca{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,n,r){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,n){return{}}createPanner(){return{}}createPeriodicWave(e,n,r){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,n){return{}}get rawContext(){return{}}addAudioWorkletModule(e,n){return Ne(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(e,n){return 0}clearTimeout(e){return this}setInterval(e,n){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};function Y(t,e){Ot(e)?e.forEach(n=>Y(t,n)):Object.defineProperty(t,e,{enumerable:!0,writable:!1})}function ua(t,e){Ot(e)?e.forEach(n=>ua(t,n)):Object.defineProperty(t,e,{writable:!0})}var de=()=>{};var rn=(()=>{class t extends nn{constructor(){super(),this.name="ToneAudioBuffer",this.onload=de;let n=b(t.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=n.reverse,this.onload=n.onload,n.url&&Ld(n.url)||n.url instanceof t?this.set(n.url):Ht(n.url)&&this.load(n.url).catch(n.onerror)}static getDefaults(){return{onerror:de,onload:de,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ct().sampleRate}set(n){return n instanceof t?n.loaded?this._buffer=n.get():n.onload=()=>{this.set(n),this.onload(this)}:this._buffer=n,this._reversed&&this._reverse(),this}get(){return this._buffer}load(n){return Ne(this,void 0,void 0,function*(){let r=t.load(n).then(i=>{this.set(i),this.onload(this)});t.downloads.push(r);try{yield r}finally{let i=t.downloads.indexOf(r);t.downloads.splice(i,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(n){let r=Ot(n)&&n[0].length>0,i=r?n.length:1,o=r?n[0].length:n.length,s=Ct(),a=s.createBuffer(i,o,s.sampleRate),c=!r&&i===1?[n]:n;for(let u=0;uo/i),this.fromArray(r)}return this}toArray(n){if(Xt(n))return this.getChannelData(n);if(this.numberOfChannels===1)return this.toArray(0);{let r=[];for(let i=0;i0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(n){this._reversed!==n&&(this._reversed=n,this._reverse())}static fromArray(n){return new t().fromArray(n)}static fromUrl(n){return Ne(this,void 0,void 0,function*(){return yield new t().load(n)})}static load(n){return Ne(this,void 0,void 0,function*(){let r=n.match(/\[([^\]\[]+\|.+)\]$/);if(r){let c=r[1].split("|"),u=c[0];for(let l of c)if(t.supportsType(l)){u=l;break}n=n.replace(r[0],u)}let i=t.baseUrl===""||t.baseUrl.endsWith("/")?t.baseUrl:t.baseUrl+"/",o=yield fetch(i+n);if(!o.ok)throw new Error(`could not load url: ${n}`);let s=yield o.arrayBuffer();return yield Ct().decodeAudioData(s)})}static supportsType(n){let r=n.split("."),i=r[r.length-1];return document.createElement("audio").canPlayType("audio/"+i)!==""}static loaded(){return Ne(this,void 0,void 0,function*(){for(yield Promise.resolve();t.downloads.length;)yield t.downloads[0]})}}return t.baseUrl="",t.downloads=[],t})();var Yr=class extends Mo{constructor(){super({clockSource:"offline",context:sa(arguments[0])?arguments[0]:oE(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:sa(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=sa(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return Ne(this,void 0,void 0,function*(){let n=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,n++;let r=Math.floor(this.sampleRate/128);e&&n%r===0&&(yield new Promise(i=>setTimeout(i,1)))}})}render(e=!0){return Ne(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(e);let n=yield this._context.startRendering();return new rn(n)})}close(){return Promise.resolve()}};var pE=new jd,la=pE;function Ct(){return la===pE&&sE&&Jg(new Mo),la}function Jg(t){Hi(t)?la=new Mo(t):sa(t)?la=new Yr(t):la=t}function No(){return la.resume()}if(Gr&&!Gr.TONE_SILENCE_LOGGING){let t="v";Rc==="dev"&&(t="");let e=` * Tone.js ${t}${Rc} * `;console.log(`%c${e}`,"background: #000; color: #fff")}function da(t){return Math.pow(10,t/20)}function ha(t){return 20*(Math.log(t)/Math.LN10)}function Oo(t){return Math.pow(2,t/12)}var Ud=440;function mE(){return Ud}function gE(t){Ud=t}function Fo(t){return Math.round(ey(t))}function ey(t){return 69+12*Math.log2(t/Ud)}function qd(t){return Ud*Math.pow(2,(t-69)/12)}var $d=class t extends nn{constructor(e,n,r){super(),this.defaultUnits="s",this._val=n,this._units=r,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,n)=>{let r=parseInt(e,10),i=n==="."?1.5:1;return r===1?this._beatsToUnits(this._getTimeSignature())*i:this._beatsToUnits(4/r)*i},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{let n=parseInt(e,10);return this._beatsToUnits(8/(Math.floor(n)*3))},regexp:/^(\d+)t$/i},tr:{method:(e,n,r)=>{let i=0;return e&&e!=="0"&&(i+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),n&&n!=="0"&&(i+=this._beatsToUnits(parseFloat(n))),r&&r!=="0"&&(i+=this._beatsToUnits(parseFloat(r)/4)),i},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof t&&this.fromType(this._val),Pt(this._val))return this._noArg();if(Ht(this._val)&&Pt(this._units)){for(let e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(yr(this._val)){let e=0;for(let n in this._val)if(ue(this._val[n])){let r=this._val[n],i=new this.constructor(this.context,n).valueOf()*r;e+=i}return e}if(ue(this._units)){let e=this._expressions[this._units],n=this._val.toString().trim().match(e.regexp);return n?e.method.apply(this,n.slice(1)):e.method.call(this,this._val)}else return Ht(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}};var En=class t extends $d{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{let n=new t(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(n))},regexp:/^@(.+)/}})}quantize(e,n=1){let r=new this.constructor(this.context,e).valueOf(),i=this.valueOf(),a=Math.round(i/r)*r-i;return i+a*n}toNotation(){let e=this.toSeconds(),n=["1m"];for(let o=1;o<9;o++){let s=Math.pow(2,o);n.push(s+"n."),n.push(s+"n"),n.push(s+"t")}n.push("0");let r=n[0],i=new t(this.context,n[0]).toSeconds();return n.forEach(o=>{let s=new t(this.context,o).toSeconds();Math.abs(s-e)3&&(i=parseFloat(parseFloat(o).toFixed(3))),[r,n,i].join(":")}toTicks(){let e=this._beatsToUnits(1),n=this.valueOf()/e;return Math.round(n*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return Fo(this.toFrequency())}_now(){return this.context.now()}};function Sn(t,e){return new En(Ct(),t,e)}var An=class t extends En{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return mE()}static set A4(e){gE(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return this.defaultUnits==="midi"?e:t.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,n){let i=O3[e.toLowerCase()]+(parseInt(n,10)+1)*12;return this.defaultUnits==="midi"?i:t.mtof(i)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,n,r){let i=1;return e&&e!=="0"&&(i*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),n&&n!=="0"&&(i*=this._beatsToUnits(parseFloat(n))),r&&r!=="0"&&(i*=this._beatsToUnits(parseFloat(r)/4)),i}}})}transpose(e){return new t(this.context,this.valueOf()*Oo(e))}harmonize(e){return e.map(n=>this.transpose(n))}toMidi(){return Fo(this.valueOf())}toNote(){let e=this.toFrequency(),n=Math.log2(e/t.A4),r=Math.round(12*n)+57,i=Math.floor(r/12);return i<0&&(r+=-12*i),F3[r%12]+i.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){let e=this._beatsToUnits(1),n=this.valueOf()/e;return Math.floor(n*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(e*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return qd(e)}static ftom(e){return Fo(e)}},O3={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},F3=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];var Jn=class extends En{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}};var gt=class t extends nn{constructor(){super();let e=b(t.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:Ct()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return new En(this.context,e).toSeconds()}toFrequency(e){return new An(this.context,e).toFrequency()}toTicks(e){return new Jn(this.context,e).toTicks()}_getPartialProperties(e){let n=this.get();return Object.keys(n).forEach(r=>{Pt(e[r])&&delete n[r]}),n}get(){let e=uE(this);return Object.keys(e).forEach(n=>{if(Reflect.has(this,n)){let r=this[n];ue(r)&&ue(r.value)&&ue(r.setValueAtTime)?e[n]=r.value:r instanceof t?e[n]=r._getPartialProperties(e[n]):Ot(r)||Xt(r)||Ht(r)||Pd(r)?e[n]=r:delete e[n]}}),e}set(e){return Object.keys(e).forEach(n=>{Reflect.has(this,n)&&ue(this[n])&&(this[n]&&ue(this[n].value)&&ue(this[n].setValueAtTime)?this[n].value!==e[n]&&(this[n].value=e[n]):this[n]instanceof t?this[n].set(e[n]):this[n]=e[n])}),this}};var xr=class extends Gt{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){let n=this.get(e);return n!==null?n.state:this._initial}setStateAtTime(e,n,r){return $t(n,0),this.add(Object.assign({},r,{state:e,time:n})),this}getLastState(e,n){let r=this._search(n);for(let i=r;i>=0;i--){let o=this._timeline[i];if(o.state===e)return o}}getNextState(e,n){let r=this._search(n);if(r!==-1)for(let i=r;i0,"timeConstant must be a number greater than 0");let o=this.toSeconds(n);return this._assertRange(i),te(isFinite(i)&&isFinite(o),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(n)}`),this._events.add({constant:r,time:o,type:"setTargetAtTime",value:i}),this.log(this.units,"setTargetAtTime",e,o,r),this._param.setTargetAtTime(i,o,r),this}setValueCurveAtTime(e,n,r,i=1){r=this.toSeconds(r),n=this.toSeconds(n);let o=this._fromType(e[0])*i;this.setValueAtTime(this._toType(o),n);let s=r/(e.length-1);for(let a=1;a{i.type==="cancelScheduledValues"?e.cancelScheduledValues(i.time):i.type==="setTargetAtTime"?e.setTargetAtTime(i.value,i.time,i.constant):e[i.type](i.value,i.time)}),this}setParam(e){te(this._swappable,"The Param must be assigned as 'swappable' in the constructor");let n=this.input;return n.disconnect(this._param),this.apply(e),this._param=e,n.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,n,r,i,o){return r+(n-r)*Math.exp(-(o-e)/i)}_linearInterpolate(e,n,r,i,o){return n+(i-n)*((o-e)/(r-e))}_exponentialInterpolate(e,n,r,i,o){return n*Math.pow(i/n,(o-e)/(r-e))}};var $=class t extends gt{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return ue(this.input)?vr(this.input)||this.input instanceof De?1:this.input.numberOfInputs:0}get numberOfOutputs(){return ue(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return ue(e)&&(e instanceof t||Wr(e))}_getInternalNodes(){let e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach(r=>{r.channelCount=e.channelCount,r.channelCountMode=e.channelCountMode,r.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){let e=this._getInternalNodes();te(e.length>0,"ToneAudioNode does not have any internal nodes");let n=e[0];return{channelCount:n.channelCount,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){let n=this._getChannelProperties();this._setChannelProperties(Object.assign(n,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){let n=this._getChannelProperties();this._setChannelProperties(Object.assign(n,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){let n=this._getChannelProperties();this._setChannelProperties(Object.assign(n,{channelInterpretation:e}))}connect(e,n=0,r=0){return gn(this,e,n,r),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Xc("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,n=0,r=0){return yE(this,e,n,r),this}chain(...e){return br(this,...e),this}fan(...e){return e.forEach(n=>this.connect(n)),this}dispose(){return super.dispose(),ue(this.input)&&(this.input instanceof t?this.input.dispose():Wr(this.input)&&this.input.disconnect()),ue(this.output)&&(this.output instanceof t?this.output.dispose():Wr(this.output)&&this.output.disconnect()),this._internalChannels=[],this}};function br(...t){let e=t.shift();t.reduce((n,r)=>(n instanceof $?n.connect(r):Wr(n)&&gn(n,r),r),e)}function gn(t,e,n=0,r=0){for(te(ue(t),"Cannot connect from undefined node"),te(ue(e),"Cannot connect to undefined node"),(e instanceof $||Wr(e))&&te(e.numberOfInputs>0,"Cannot connect to node with no inputs"),te(t.numberOfOutputs>0,"Cannot connect from node with no outputs");e instanceof $||e instanceof De;)ue(e.input)&&(e=e.input);for(;t instanceof $;)ue(t.output)&&(t=t.output);vr(e)?t.connect(e,n):t.connect(e,n,r)}function yE(t,e,n=0,r=0){if(ue(e))for(;e instanceof $;)e=e.input;for(;!Wr(t);)ue(t.output)&&(t=t.output);vr(e)?t.disconnect(e,n):Wr(e)?t.disconnect(e,n,r):t.disconnect()}var oe=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;let e=b(t.getDefaults(),arguments,["gain","units"]);this.gain=new De({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Y(this,"gain")}static getDefaults(){return Object.assign($.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}};var wr=class extends ${constructor(e){super(e),this.onended=de,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new oe({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(n){let r=this.toSeconds(n);return this._startTime!==-1&&r>=this._startTime&&(this._stopTime===-1||r<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign($.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:de})}_startGain(e,n=1){te(this._startTime===-1,"Source cannot be started more than once");let r=this.toSeconds(this._fadeIn);return this._startTime=e+r,this._startTime=Math.max(this._startTime,this.context.currentTime),r>0?(this._gainNode.gain.setValueAtTime(0,e),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(n,e+r):this._gainNode.gain.exponentialApproachValueAtTime(n,e,r)):this._gainNode.gain.setValueAtTime(n,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){te(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();let n=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+n,this._stopTime=Math.max(this._stopTime,this.context.currentTime),n>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,n,e):this._gainNode.gain.targetRampTo(0,n,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{let r=this._curve==="exponential"?n*2:0;this._stopSource(this.now()+r),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==de&&(this.onended(this),this.onended=de,!this.context.isOffline)){let e=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),te(this._startTime!==-1,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}};var tu=class t extends wr{constructor(){super(b(t.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();let e=b(t.getDefaults(),arguments,["offset"]);gn(this._source,this._gainNode),this.offset=new De({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(wr.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){let n=this.toSeconds(e);return this.log("start",n),this._startGain(n),this._source.start(n),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}};var pe=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;let e=b(t.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new tu({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign($.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,n=0,r=0){return fa(this,e,n,r),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,n){return this._param.setValueAtTime(e,n),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,n){return this._param.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,n){return this._param.exponentialRampToValueAtTime(e,n),this}exponentialRampTo(e,n,r){return this._param.exponentialRampTo(e,n,r),this}linearRampTo(e,n,r){return this._param.linearRampTo(e,n,r),this}targetRampTo(e,n,r){return this._param.targetRampTo(e,n,r),this}exponentialApproachValueAtTime(e,n,r){return this._param.exponentialApproachValueAtTime(e,n,r),this}setTargetAtTime(e,n,r){return this._param.setTargetAtTime(e,n,r),this}setValueCurveAtTime(e,n,r,i){return this._param.setValueCurveAtTime(e,n,r,i),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,n,r){return this._param.rampTo(e,n,r),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}};function fa(t,e,n,r){(e instanceof De||vr(e)||e instanceof pe&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof pe&&(e.overridden=!0)),gn(t,e,n,r)}var Hd=class t extends De{constructor(){super(b(t.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Gt(1/0),this._multiplier=1;let e=b(t.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(De.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,n,r){n=this.toSeconds(n),this.setRampPoint(n);let i=this._fromType(e),o=this._events.get(n),s=Math.round(Math.max(1/r,1));for(let a=0;a<=s;a++){let c=r*a+n,u=this._exponentialApproach(o.time,o.value,i,r,c);this.linearRampToValueAtTime(this._toType(u),c)}return this}setValueAtTime(e,n){let r=this.toSeconds(n);super.setValueAtTime(e,n);let i=this._events.get(r),o=this._events.previousEvent(i),s=this._getTicksUntilEvent(o,r);return i.ticks=Math.max(s,0),this}linearRampToValueAtTime(e,n){let r=this.toSeconds(n);super.linearRampToValueAtTime(e,n);let i=this._events.get(r),o=this._events.previousEvent(i),s=this._getTicksUntilEvent(o,r);return i.ticks=Math.max(s,0),this}exponentialRampToValueAtTime(e,n){n=this.toSeconds(n);let r=this._fromType(e),i=this._events.get(n),o=Math.round(Math.max((n-i.time)*10,1)),s=(n-i.time)/o;for(let a=0;a<=o;a++){let c=s*a+i.time,u=this._exponentialInterpolate(i.time,i.value,n,r,c);this.linearRampToValueAtTime(this._toType(u),c)}return this}_getTicksUntilEvent(e,n){if(e===null)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(Pt(e.ticks)){let s=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(s,e.time)}let r=this._fromType(this.getValueAtTime(e.time)),i=this._fromType(this.getValueAtTime(n)),o=this._events.get(n);return o&&o.time===n&&o.type==="setValueAtTime"&&(i=this._fromType(this.getValueAtTime(n-this.sampleTime))),.5*(n-e.time)*(r+i)+e.ticks}getTicksAtTime(e){let n=this.toSeconds(e),r=this._events.get(n);return Math.max(this._getTicksUntilEvent(r,n),0)}getDurationOfTicks(e,n){let r=this.toSeconds(n),i=this.getTicksAtTime(n);return this.getTimeOfTick(i+e)-r}getTimeOfTick(e){let n=this._events.get(e,"ticks"),r=this._events.getAfter(e,"ticks");if(n&&n.ticks===e)return n.time;if(n&&r&&r.type==="linearRampToValueAtTime"&&n.value!==r.value){let i=this._fromType(this.getValueAtTime(n.time)),s=(this._fromType(this.getValueAtTime(r.time))-i)/(r.time-n.time),a=Math.sqrt(Math.pow(i,2)-2*s*(n.ticks-e)),c=(-i+a)/s,u=(-i-a)/s;return(c>0?c:u)+n.time}else return n?n.value===0?1/0:n.time+(e-n.ticks)/n.value:e/this._initialValue}ticksToTime(e,n){return this.getDurationOfTicks(e,n)}timeToTicks(e,n){let r=this.toSeconds(n),i=this.toSeconds(e),o=this.getTicksAtTime(r);return this.getTicksAtTime(r+i)-o}_fromType(e){return this.units==="bpm"&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return this.units==="bpm"&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){let n=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(n,0)}};var Gd=class t extends pe{constructor(){super(b(t.getDefaults(),arguments,["value"])),this.name="TickSignal";let e=b(t.getDefaults(),arguments,["value"]);this.input=this._param=new Hd({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(pe.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,n){return this._param.ticksToTime(e,n)}timeToTicks(e,n){return this._param.timeToTicks(e,n)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,n){return this._param.getDurationOfTicks(e,n)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}};var Wd=class t extends gt{constructor(){super(b(t.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new xr,this._tickOffset=new Gt;let e=b(t.getDefaults(),arguments,["frequency"]);this.frequency=new Gd({context:this.context,units:e.units,value:e.frequency}),Y(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},gt.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,n){let r=this.toSeconds(e);return this._state.getValueAtTime(r)!=="started"&&(this._state.setStateAtTime("started",r),ue(n)&&this.setTicksAtTime(n,r)),this}stop(e){let n=this.toSeconds(e);if(this._state.getValueAtTime(n)==="stopped"){let r=this._state.get(n);r&&r.time>0&&(this._tickOffset.cancel(r.time),this._state.cancel(r.time))}return this._state.cancel(n),this._state.setStateAtTime("stopped",n),this.setTicksAtTime(0,n),this}pause(e){let n=this.toSeconds(e);return this._state.getValueAtTime(n)==="started"&&this._state.setStateAtTime("paused",n),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this}getTicksAtTime(e){let n=this.toSeconds(e),r=this._state.getLastState("stopped",n),i={state:"paused",time:n};this._state.add(i);let o=r,s=0;return this._state.forEachBetween(r.time,n+this.sampleTime,a=>{let c=o.time,u=this._tickOffset.get(a.time);u&&u.time>=o.time&&(s=u.ticks,c=u.time),o.state==="started"&&a.state!=="started"&&(s+=this.frequency.getTicksAtTime(a.time)-this.frequency.getTicksAtTime(c)),o=a}),this._state.remove(i),s}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){let n=this.now(),r=this.frequency.timeToTicks(e,n);this.setTicksAtTime(r,n)}getSecondsAtTime(e){e=this.toSeconds(e);let n=this._state.getLastState("stopped",e),r={state:"paused",time:e};this._state.add(r);let i=n,o=0;return this._state.forEachBetween(n.time,e+this.sampleTime,s=>{let a=i.time,c=this._tickOffset.get(s.time);c&&c.time>=i.time&&(o=c.seconds,a=c.time),i.state==="started"&&s.state!=="started"&&(o+=s.time-a),i=s}),this._state.remove(r),o}setTicksAtTime(e,n){return n=this.toSeconds(n),this._tickOffset.cancel(n),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,n),ticks:e,time:n}),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,n=this.now()){let r=this._tickOffset.get(n),i=this._state.get(n),o=Math.max(r.time,i.time),s=this.frequency.getTicksAtTime(o)+e-r.ticks;return this.frequency.getTimeOfTick(s)}forEachTickBetween(e,n,r){let i=this._state.get(e);this._state.forEachBetween(e,n,s=>{i&&i.state==="started"&&s.state!=="started"&&this.forEachTickBetween(Math.max(i.time,e),s.time-this.sampleTime,r),i=s});let o=null;if(i&&i.state==="started"){let s=Math.max(i.time,e),a=this.frequency.getTicksAtTime(s),c=this.frequency.getTicksAtTime(i.time),u=a-c,l=Math.ceil(u)-u;l=mn(l,1)?0:l;let d=this.frequency.getTimeOfTick(a+l);for(;d{switch(r.state){case"started":let i=this._tickSource.getTicksAtTime(r.time);this.emit("start",r.time,i);break;case"stopped":r.time!==0&&this.emit("stop",r.time);break;case"paused":this.emit("pause",r.time);break}}),this._tickSource.forEachTickBetween(e,n,(r,i)=>{this.callback(r,i)}))}getStateAtTime(e){let n=this.toSeconds(e);return this._state.getValueAtTime(n)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}};zi.mixin(pa);var ma=class t extends nn{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;let e=b(t.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach(n=>{this._loadingCount++;let r=e.urls[n];this.add(n,r,this._bufferLoaded.bind(this,e.onload),e.onerror)})}static getDefaults(){return{baseUrl:"",onerror:de,onload:de,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return te(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,this._loadingCount===0&&e&&e()}get loaded(){return Array.from(this._buffers).every(([e,n])=>n.loaded)}add(e,n,r=de,i=de){return Ht(n)?this._buffers.set(e.toString(),new rn(this.baseUrl+n,r,i)):this._buffers.set(e.toString(),new rn(n,r,i)),this}dispose(){return super.dispose(),this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this}};var Dt=class extends Jn{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}};var ty=class extends gt{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Gt,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,n){return this._events.add({callback:e,time:this.toSeconds(n)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){let e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){let n=this._events.shift();n&&e-n.time<=this.expiration&&n.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}};Gi(t=>{t.draw=new ty({context:t})});Wi(t=>{t.draw.dispose()});var zd=class extends nn{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){te(ue(e.time),"Events must have a time property"),te(ue(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let n=new ny(e.time,e.time+e.duration,e);for(this._root===null?this._root=n:this._root.insert(n),this._length++;n!==null;)n.updateHeight(),n.updateMax(),this._rebalance(n),n=n.parent;return this}remove(e){if(this._root!==null){let n=[];this._root.search(e.time,n);for(let r of n)if(r.event===e){this._removeNode(r),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,n=>this.remove(n)),this}_setRoot(e){this._root=e,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(e,n){e.parent!==null?(e.isLeftChild()?e.parent.left=n:e.parent.right=n,this._rebalance(e.parent)):this._setRoot(n)}_removeNode(e){if(e.left===null&&e.right===null)this._replaceNodeInParent(e,null);else if(e.right===null)this._replaceNodeInParent(e,e.left);else if(e.left===null)this._replaceNodeInParent(e,e.right);else{let n=e.getBalance(),r,i=null;if(n>0)if(e.left.right===null)r=e.left,r.right=e.right,i=r;else{for(r=e.left.right;r.right!==null;)r=r.right;r.parent&&(r.parent.right=r.left,i=r.parent,r.left=e.left,r.right=e.right)}else if(e.right.left===null)r=e.right,r.left=e.left,i=r;else{for(r=e.right.left;r.left!==null;)r=r.left;r.parent&&(r.parent.left=r.right,i=r.parent,r.left=e.left,r.right=e.right)}e.parent!==null?e.isLeftChild()?e.parent.left=r:e.parent.right=r:this._setRoot(r),i&&this._rebalance(i)}e.dispose()}_rotateLeft(e){let n=e.parent,r=e.isLeftChild(),i=e.right;i&&(e.right=i.left,i.left=e),n!==null?r?n.left=i:n.right=i:this._setRoot(i)}_rotateRight(e){let n=e.parent,r=e.isLeftChild(),i=e.left;i&&(e.left=i.right,i.right=e),n!==null?r?n.left=i:n.right=i:this._setRoot(i)}_rebalance(e){let n=e.getBalance();n>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):n<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(this._root!==null){let n=[];if(this._root.search(e,n),n.length>0){let r=n[0];for(let i=1;ir.low&&(r=n[i]);return r.event}}return null}forEach(e){if(this._root!==null){let n=[];this._root.traverse(r=>n.push(r)),n.forEach(r=>{r.event&&e(r.event)})}return this}forEachAtTime(e,n){if(this._root!==null){let r=[];this._root.search(e,r),r.forEach(i=>{i.event&&n(i.event)})}return this}forEachFrom(e,n){if(this._root!==null){let r=[];this._root.searchAfter(e,r),r.forEach(i=>{i.event&&n(i.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(e=>e.dispose()),this._root=null,this}},ny=class{constructor(e,n,r){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=r,this.low=e,this.high=n,this.max=this.high}insert(e){e.low<=this.low?this.left===null?this.left=e:this.left.insert(e):this.right===null?this.right=e:this.right.insert(e)}search(e,n){e>this.max||(this.left!==null&&this.left.search(e,n),this.low<=e&&this.high>e&&n.push(this),!(this.low>e)&&this.right!==null&&this.right.search(e,n))}searchAfter(e,n){this.low>=e&&(n.push(this),this.left!==null&&this.left.searchAfter(e,n)),this.right!==null&&this.right.searchAfter(e,n)}traverse(e){e(this),this.left!==null&&this.left.traverse(e),this.right!==null&&this.right.traverse(e)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right!==null?this.height=this.right.height+1:this.left!==null?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return this.left!==null&&this.right!==null?e=this.left.height-this.right.height:this.left!==null?e=this.left.height+1:this.right!==null&&(e=-(this.right.height+1)),e}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}};var er=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["volume"])),this.name="Volume";let e=b(t.getDefaults(),arguments,["volume"]);this.input=this.output=new oe({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Y(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}};var ry=class t extends ${constructor(){super(b(t.getDefaults(),arguments)),this.name="Destination",this.input=new er({context:this.context}),this.output=new oe({context:this.context}),this.volume=this.input.volume;let e=b(t.getDefaults(),arguments);br(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),br(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};Gi(t=>{t.destination=new ry({context:t})});Wi(t=>{t.destination.dispose()});var Yd=class extends nn{constructor(e){super(),this.name="TimelineValue",this._timeline=new Gt({memory:10}),this._initialValue=e}set(e,n){return this._timeline.add({value:e,time:n}),this}get(e){let n=this._timeline.get(e);return n?n.value:this._initialValue}};var ga=(()=>{class t{constructor(n,r){this.id=t._eventId++;let i=Object.assign(t.getDefaults(),r);this.transport=n,this.callback=i.callback,this._once=i.once,this.time=i.time}static getDefaults(){return{callback:de,once:!1,time:0}}invoke(n){this.callback&&(this.callback(n),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}return t._eventId=0,t})();var Zd=class t extends ga{constructor(e,n){super(e,n),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);let r=Object.assign(t.getDefaults(),n);this.duration=new Dt(e.context,r.duration).valueOf(),this._interval=new Dt(e.context,r.interval).valueOf(),this._nextTick=r.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},ga.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvents(e){let n=this.transport.getTicksAtTime(e);n>=this.time&&n>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((n-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new Dt(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Dt(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}};var Qd=class t extends gt{constructor(){super(b(t.getDefaults(),arguments)),this.name="Transport",this._loop=new Yd(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Gt,this._repeatedEvents=new zd,this._syncedSignals=[],this._swingAmount=0;let e=b(t.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new pa({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Y(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(gt.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,n){if(this._loop.get(e)&&n>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),n=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&n%this._ppq!==0&&n%(this._swingTicks*2)!==0){let r=n%(this._swingTicks*2)/(this._swingTicks*2),i=Math.sin(r*Math.PI)*this._swingAmount;e+=new Dt(this.context,this._swingTicks*2/3).toSeconds()*i}this._timeline.forEachAtTime(n,r=>r.invoke(e))}schedule(e,n){let r=new ga(this,{callback:e,time:new Jn(this.context,n).toTicks()});return this._addEvent(r,this._timeline)}scheduleRepeat(e,n,r,i=1/0){let o=new Zd(this,{callback:e,duration:new En(this.context,i).toTicks(),interval:new En(this.context,n).toTicks(),time:new Jn(this.context,r).toTicks()});return this._addEvent(o,this._repeatedEvents)}scheduleOnce(e,n){let r=new ga(this,{callback:e,once:!0,time:new Jn(this.context,n).toTicks()});return this._addEvent(r,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){let n=this._scheduledEvents[e.toString()];n.timeline.remove(n.event),n.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,n){return this._scheduledEvents[e.id.toString()]={event:e,timeline:n},n.add(e),e.id}cancel(e=0){let n=this.toTicks(e);return this._timeline.forEachFrom(n,r=>this.clear(r.id)),this._repeatedEvents.forEachFrom(n,r=>this.clear(r.id)),this}_bindClockEvents(){this._clock.on("start",(e,n)=>{n=new Dt(this.context,n).toSeconds(),this.emit("start",e,n)}),this._clock.on("stop",e=>{this.emit("stop",e)}),this._clock.on("pause",e=>{this.emit("pause",e)})}get state(){return this._clock.getStateAtTime(this.now())}start(e,n){let r;return ue(n)&&(r=this.toTicks(n)),this._clock.start(e,r),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!=="started"?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){Ot(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new En(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new En(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,n){return this.loopStart=e,this.loopEnd=n,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Dt(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){let e=this.now(),n=this._clock.getTicksAtTime(e);return new Dt(this.context,n).toBarsBeatsSixteenths()}set position(e){let n=this.toTicks(e);this.ticks=n}get seconds(){return this._clock.seconds}set seconds(e){let n=this.now(),r=this._clock.frequency.timeToTicks(e,n);this.ticks=r}get progress(){if(this.loop){let e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){let n=this.now();if(this.state==="started"){let r=this._clock.getTicksAtTime(n),i=this._clock.frequency.getDurationOfTicks(Math.ceil(r)-r,n),o=n+i;this.emit("stop",o),this._clock.setTicksAtTime(e,o),this.emit("start",o,this._clock.getSecondsAtTime(o))}else this._clock.setTicksAtTime(e,n)}}getTicksAtTime(e){return Math.round(this._clock.getTicksAtTime(e))}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),this.state!=="started")return 0;{let n=this.now(),r=this.getTicksAtTime(n),i=e-r%e;return this._clock.nextTickTime(i,n)}}syncSignal(e,n){if(!n){let i=this.now();if(e.getValueAtTime(i)!==0){let s=1/(60/this.bpm.getValueAtTime(i)/this.PPQ);n=e.getValueAtTime(i)/s}else n=0}let r=new oe(n);return this.bpm.connect(r),r.connect(e._param),this._syncedSignals.push({initial:e.value,ratio:r,signal:e}),e.value=0,this}unsyncSignal(e){for(let n=this._syncedSignals.length-1;n>=0;n--){let r=this._syncedSignals[n];r.signal===e&&(r.ratio.dispose(),r.signal.value=r.initial,this._syncedSignals.splice(n,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),ua(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}};zi.mixin(Qd);Gi(t=>{t.transport=new Qd({context:t})});Wi(t=>{t.transport.dispose()});var Qe=class extends ${constructor(e){super(e),this.input=void 0,this._state=new xr("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=de,this._syncedStop=de,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new er({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Y(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,onstop:de,volume:0})}get state(){return this._synced?this.context.transport.state==="started"?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,n,r){let i=Pt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(i=this._clampToCurrentTime(i),!this._synced&&this._state.getValueAtTime(i)==="started")te(aa(i,this._state.get(i).time),"Start time must be strictly greater than previous start time"),this._state.cancel(i),this._state.setStateAtTime("started",i),this.log("restart",i),this.restart(i,n,r);else if(this.log("start",i),this._state.setStateAtTime("started",i),this._synced){let o=this._state.get(i);o&&(o.offset=this.toSeconds(Dn(n,0)),o.duration=r?this.toSeconds(r):void 0);let s=this.context.transport.schedule(a=>{this._start(a,n,r)},i);this._scheduled.push(s),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>i&&this._syncedStart(this.now(),this.context.transport.seconds)}else Rd(this.context),this._start(i,n,r);return this}stop(e){let n=Pt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(n=this._clampToCurrentTime(n),this._state.getValueAtTime(n)==="started"||ue(this._state.getNextState("started",n))){if(this.log("stop",n),!this._synced)this._stop(n);else{let r=this.context.transport.schedule(this._stop.bind(this),n);this._scheduled.push(r)}this._state.cancel(n),this._state.setStateAtTime("stopped",n)}return this}restart(e,n,r){return e=this.toSeconds(e),this._state.getValueAtTime(e)==="started"&&(this._state.cancel(e),this._restart(e,n,r)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,n)=>{if(n>0){let r=this._state.get(n);if(r&&r.state==="started"&&r.time!==n){let i=n-this.toSeconds(r.time),o;r.duration&&(o=this.toSeconds(r.duration)-i),this._start(e,this.toSeconds(r.offset)+i,o)}}},this._syncedStop=e=>{let n=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(n)==="started"&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(e=>this.context.transport.clear(e)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=de,this.unsync(),this._volume.dispose(),this._state.dispose(),this}};var di=class t extends wr{constructor(){super(b(t.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;let e=b(t.getDefaults(),arguments,["url","onload"]);gn(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new De({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new rn(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(wr.getDefaults(),{url:new rn,loop:!1,loopEnd:0,loopStart:0,onload:de,onerror:de,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,n,r,i=1){te(this.buffer.loaded,"buffer is either not set or not loaded");let o=this.toSeconds(e);this._startGain(o,i),this.loop?n=Dn(n,this.loopStart):n=Dn(n,0);let s=Math.max(this.toSeconds(n),0);if(this.loop){let a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),u=a-c;eu(s,a)&&(s=(s-c)%u+c),mn(s,this.buffer.duration)&&(s=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Bd(s,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(o,s)),ue(r)){let a=this.toSeconds(r);a=Math.max(a,0),this.stop(o+a)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}};var kge=44100*5;function In(t,e){return Ne(this,void 0,void 0,function*(){let n=e/t.context.sampleRate,r=new Yr(1,n,t.context.sampleRate);return new t.constructor(Object.assign(t.get(),{frequency:2/n,detune:0,context:r})).toDestination().start(0),(yield r.render()).getChannelData(0)})}var nu=class t extends wr{constructor(){super(b(t.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];let e=b(t.getDefaults(),arguments,["frequency","type"]);gn(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new De({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new De({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Y(this,["frequency","detune"])}static getDefaults(){return Object.assign(wr.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(e){let n=this.toSeconds(e);return this.log("start",n),this._startGain(n),this._oscillator.start(n),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}};var Vt=(()=>{class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;let n=b(t.getDefaults(),arguments,["frequency","type"]);this.frequency=new pe({context:this.context,units:"frequency",value:n.frequency}),Y(this,"frequency"),this.detune=new pe({context:this.context,units:"cents",value:n.detune}),Y(this,"detune"),this._partials=n.partials,this._partialCount=n.partialCount,this._type=n.type,n.partialCount&&n.type!=="custom"&&(this._type=this.baseType+n.partialCount.toString()),this.phase=n.phase}static getDefaults(){return Object.assign(Qe.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(n){let r=this.toSeconds(n),i=new nu({context:this.context,onended:()=>this.onstop(this)});this._oscillator=i,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(r)}_stop(n){let r=this.toSeconds(n);this._oscillator&&this._oscillator.stop(r)}_restart(n){let r=this.toSeconds(n);return this.log("restart",r),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(r),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type==="custom")return t._periodicWaveCache.find(r=>r.phase===this._phase&&cE(r.partials,this._partials));{let n=t._periodicWaveCache.find(r=>r.type===this._type&&r.phase===this._phase);return this._partialCount=n?n.partialCount:this._partialCount,n}}get type(){return this._type}set type(n){this._type=n;let r=["sine","square","sawtooth","triangle"].indexOf(n)!==-1;if(this._phase===0&&r)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=n);else{let i=this._getCachedPeriodicWave();if(ue(i)){let{partials:o,wave:s}=i;this._wave=s,this._partials=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{let[o,s]=this._getRealImaginary(n,this._phase),a=this.context.createPeriodicWave(o,s);this._wave=a,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),t._periodicWaveCache.push({imag:s,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:o,type:this._type,wave:this._wave}),t._periodicWaveCache.length>100&&t._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(n){this.partialCount&&this._type!=="custom"&&n!=="custom"?this.type=n+this.partialCount:this.type=n}get partialCount(){return this._partialCount}set partialCount(n){$t(n,0);let r=this._type,i=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(i&&(r=i[1]),this._type!=="custom")n===0?this.type=r:this.type=r+n.toString();else{let o=new Float32Array(n);this._partials.forEach((s,a)=>o[a]=s),this._partials=Array.from(o),this.type=this._type}}_getRealImaginary(n,r){let o=2048,s=new Float32Array(o),a=new Float32Array(o),c=1;if(n==="custom"){if(c=this._partials.length+1,this._partialCount=this._partials.length,o=c,this._partials.length===0)return[s,a]}else{let u=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(n);u?(c=parseInt(u[2],10)+1,this._partialCount=parseInt(u[2],10),n=u[1],c=Math.max(c,2),o=c):this._partialCount=0,this._partials=[]}for(let u=1;u>1&1?-1:1):d=0,this._partials[u-1]=d;break;case"custom":d=this._partials[u-1];break;default:throw new TypeError("Oscillator: invalid type: "+n)}d!==0?(s[u]=-d*Math.sin(r*u),a[u]=d*Math.cos(r*u)):(s[u]=0,a[u]=0)}return[s,a]}_inverseFFT(n,r,i){let o=0,s=n.length;for(let a=0;ar.includes(e));te(n,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}};var ya=class extends Ln{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new tr({context:this.context,mapping:e=>(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}};var Lt=class t extends pe{constructor(){super(Object.assign(b(t.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;let e=b(t.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new oe({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(pe.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}};var ru=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new ya({context:this.context}),this._modulationNode=new oe({context:this.context});let e=b(t.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Vt({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Vt({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Lt({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Y(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Vt.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}};var va=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new oe({context:this.context,gain:0});let e=b(t.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Vt({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new pe({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new Vt({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Lt({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new Lt({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Y(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Vt.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}};var ko=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new oe({context:this.context,gain:0}),this._thresh=new tr({context:this.context,mapping:n=>n<=0?-1:1});let e=b(t.getDefaults(),arguments,["frequency","width"]);this.width=new pe({context:this.context,units:"audioRange",value:e.width}),this._triangle=new Vt({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Y(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(Qe.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}};var iu=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];let e=b(t.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new pe({context:this.context,units:"frequency",value:e.frequency}),this.detune=new pe({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Y(this,["frequency","detune"])}static getDefaults(){return Object.assign(Vt.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach(n=>n.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(n=>n.stop(e))}_restart(e){this._forEach(n=>n.restart(e))}_forEach(e){for(let n=0;nn.type=e)}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){let n=-e/2,r=e/(this._oscillators.length-1);this._forEach((i,o)=>i.detune.value=n+r*o)}}get count(){return this._oscillators.length}set count(e){if($t(e,1),this._oscillators.length!==e){this._forEach(n=>n.dispose()),this._oscillators=[];for(let n=0;nthis.onstop(this):de});this.type==="custom"&&(r.partials=this._partials),this.frequency.connect(r.frequency),this.detune.connect(r.detune),r.detune.overridden=!1,r.connect(this.output),this._oscillators[n]=r}this.spread=this._spread,this.state==="started"&&this._forEach(n=>n.start())}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach((n,r)=>n.phase=this._phase+r/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(n=>n.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach(n=>n.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(n=>n.partialCount=e),this._type=this._oscillators[0].type}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(e=>e.dispose()),this}};var ou=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Lt({context:this.context,value:2});let e=b(t.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new ko({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Vt({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Y(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(Qe.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}};var vE={am:ru,fat:iu,fm:va,oscillator:Vt,pulse:ko,pwm:ou},Ro=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";let e=b(t.getDefaults(),arguments,["frequency","type"]);this.frequency=new pe({context:this.context,units:"frequency",value:e.frequency}),this.detune=new pe({context:this.context,units:"cents",value:e.detune}),Y(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(Vt.getDefaults(),va.getDefaults(),ru.getDefaults(),iu.getDefaults(),ko.getDefaults(),ou.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some(n=>this._sourceType===n)&&(e=this._sourceType),e+this._oscillator.type}set type(e){e.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):e==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):e==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;let n=vE[e],r=this.now();if(this._oscillator){let i=this._oscillator;i.stop(r),this.context.setTimeout(()=>i.dispose(),this.blockTime)}this._oscillator=new n({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state==="started"&&this._oscillator.start(r)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let n="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(n=this._oscillator.type),e==="fm"?this.type="fm"+n:e==="am"?this.type="am"+n:e==="fat"?this.type="fat"+n:e==="oscillator"?this.type=n:e==="pulse"?this.type="pulse":e==="pwm"&&(this.type="pwm")}_getOscType(e,n){return e instanceof vE[n]}get baseType(){return this._oscillator.baseType}set baseType(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&e!=="pulse"&&e!=="pwm"&&(this._oscillator.baseType=e)}get width(){if(this._getOscType(this._oscillator,"pulse"))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.count}set count(e){this._getOscType(this._oscillator,"fat")&&Xt(e)&&(this._oscillator.count=e)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(e){this._getOscType(this._oscillator,"fat")&&Xt(e)&&(this._oscillator.spread=e)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&Ht(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){if(this._getOscType(this._oscillator,"fm"))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,"pwm"))return this._oscillator.modulationFrequency}asArray(e=1024){return Ne(this,void 0,void 0,function*(){return In(this,e)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}};function Xd(t,e=1/0){let n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(o){$t(o,t,e),n.set(this,o)}})}}function Mn(t,e=1/0){let n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(o){$t(this.toSeconds(o),t,e),n.set(this,o)}})}}var hi=class t extends Qe{constructor(){super(b(t.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;let e=b(t.getDefaults(),arguments,["url","onload"]);this._buffer=new rn({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(Qe.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:de,onerror:de,playbackRate:1,reverse:!1})}load(e){return Ne(this,void 0,void 0,function*(){return yield this._buffer.load(e),this._onload(),this})}_onload(e=de){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,n,r){return super.start(e,n,r),this}_start(e,n,r){this._loop?n=Dn(n,this._loopStart):n=Dn(n,0);let i=this.toSeconds(n),o=r;r=Dn(r,Math.max(this._buffer.duration-i,0));let s=this.toSeconds(r);s=s/this._playbackRate,e=this.toSeconds(e);let a=new di({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(e+s),this._state.setStateAtTime("stopped",e+s,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&Pt(o)?a.start(e,i):a.start(e,i,s-this.toSeconds(this.fadeOut))}_stop(e){let n=this.toSeconds(e);this._activeSources.forEach(r=>r.stop(n))}restart(e,n,r){return super.restart(e,n,r),this}_restart(e,n,r){this._stop(e),this._start(e,n,r)}seek(e,n){let r=this.toSeconds(n);if(this._state.getValueAtTime(r)==="started"){let i=this.toSeconds(e);this._stop(r),this._start(r,i)}return this}setLoopPoints(e,n){return this.loopStart=e,this.loopEnd=n,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&$t(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(n=>{n.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&$t(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(n=>{n.loopEnd=e})}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(n=>{n.loop=e}),e)){let n=this._state.getNextState("stopped",this.now());n&&this._state.cancel(n.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;let n=this.now(),r=this._state.getNextState("stopped",n);r&&r.implicitEnd&&(this._state.cancel(r.time),this._activeSources.forEach(i=>i.cancelStop())),this._activeSources.forEach(i=>{i.playbackRate.setValueAtTime(e,n)})}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(e=>e.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}};en([Mn(0)],hi.prototype,"fadeIn",void 0);en([Mn(0)],hi.prototype,"fadeOut",void 0);var yn=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new pe({context:this.context,value:0}),this.output=this._sig,this.input=void 0;let e=b(t.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign($.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,n){if(Ht(e))return e;{let r;for(r in Jd)if(Jd[r][n]===e)return r;return e}}_setCurve(e,n,r){if(Ht(r)&&Reflect.has(Jd,r)){let i=Jd[r];yr(i)?e!=="_decayCurve"&&(this[e]=i[n]):this[e]=i}else if(Ot(r)&&e!=="_decayCurve")this[e]=r;else throw new Error("Envelope: invalid curve: "+r)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._decayCurve}set decayCurve(e){te(["linear","exponential"].some(n=>n===e),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(e,n=1){this.log("triggerAttack",e,n),e=this.toSeconds(e);let i=this.toSeconds(this.attack),o=this.toSeconds(this.decay),s=this.getValueAtTime(e);if(s>0){let a=1/i;i=(1-s)/a}if(i0){let r=this.toSeconds(this.release);r{let e,n,r=[];for(e=0;e<128;e++)r[e]=Math.sin(e/(128-1)*(Math.PI/2));let i=[],o=6.4;for(e=0;e<128-1;e++){n=e/(128-1);let h=Math.sin(n*(Math.PI*2)*o-Math.PI/2)+1;i[e]=h/10+n*.83}i[128-1]=1;let s=[],a=5;for(e=0;e<128;e++)s[e]=Math.ceil(e/(128-1)*a)/a;let c=[];for(e=0;e<128;e++)n=e/(128-1),c[e]=.5*(1-Math.cos(Math.PI*n));let u=[];for(e=0;e<128;e++){n=e/(128-1);let h=Math.pow(n,3)*4+.2,p=Math.cos(h*Math.PI*2*n);u[e]=Math.abs(p*(1-n))}function l(h){let p=new Array(h.length);for(let y=0;y{let o=i[n],s=this.context.transport.schedule(a=>{i[n]=a,r.apply(this,i)},o);this._scheduledEvents.push(s)}}unsync(){return this._scheduledEvents.forEach(e=>this.context.transport.clear(e)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(e,n,r,i){let o=this.toSeconds(r),s=this.toSeconds(n);return this.triggerAttack(e,o,i),this.triggerRelease(o+s),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}};var nr=class t extends Tr{constructor(){super(b(t.getDefaults(),arguments));let e=b(t.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Tr.getDefaults(),{detune:0,onsilence:de,portamento:0})}triggerAttack(e,n,r=1){this.log("triggerAttack",e,n,r);let i=this.toSeconds(n);return this._triggerEnvelopeAttack(i,r),this.setNote(e,i),this}triggerRelease(e){this.log("triggerRelease",e);let n=this.toSeconds(e);return this._triggerEnvelopeRelease(n),this}setNote(e,n){let r=this.toSeconds(n),i=e instanceof An?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(r)>.05){let o=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(i,o,r)}else this.frequency.setValueAtTime(i,r);return this}};en([Mn(0)],nr.prototype,"portamento",void 0);var _a=class t extends yn{constructor(){super(b(t.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new oe({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}};var Po=class t extends nr{constructor(){super(b(t.getDefaults(),arguments)),this.name="Synth";let e=b(t.getDefaults(),arguments);this.oscillator=new Ro(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new _a(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Y(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(nr.getDefaults(),{envelope:Object.assign(zr(yn.getDefaults(),Object.keys($.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(zr(Ro.getDefaults(),[...Object.keys(Qe.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,n){if(this.envelope.triggerAttack(e,n),this.oscillator.start(e),this.envelope.sustain===0){let r=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+r+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}};var th=class t extends Po{constructor(){super(b(t.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;let e=b(t.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Y(this,["oscillator","envelope"])}static getDefaults(){return _r(nr.getDefaults(),Po.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,n){let r=this.toSeconds(n),i=this.toFrequency(e instanceof An?e.toFrequency():e),o=i*this.octaves;return this.oscillator.frequency.setValueAtTime(o,r),this.oscillator.frequency.exponentialRampToValueAtTime(i,r+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}};en([Xd(0)],th.prototype,"octaves",void 0);en([Mn(0)],th.prototype,"pitchDecay",void 0);var xE=new Set;function ba(t){xE.add(t)}function nh(t,e){let n=`registerProcessor("${t}", ${e})`;xE.add(n)}var V3=` + /** + * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. + */ + class ToneAudioWorkletProcessor extends AudioWorkletProcessor { + + constructor(options) { + + super(options); + /** + * If the processor was disposed or not. Keep alive until it's disposed. + */ + this.disposed = false; + /** + * The number of samples in the processing block + */ + this.blockSize = 128; + /** + * the sample rate + */ + this.sampleRate = sampleRate; + + this.port.onmessage = (event) => { + // when it receives a dispose + if (event.data === "dispose") { + this.disposed = true; + } + }; + } + } +`;ba(V3);var L3=` + /** + * Abstract class for a single input/output processor. + * has a 'generate' function which processes one sample at a time + */ + class SingleIOProcessor extends ToneAudioWorkletProcessor { + + constructor(options) { + super(Object.assign(options, { + numberOfInputs: 1, + numberOfOutputs: 1 + })); + /** + * Holds the name of the parameter and a single value of that + * parameter at the current sample + * @type { [name: string]: number } + */ + this.params = {} + } + + /** + * Generate an output sample from the input sample and parameters + * @abstract + * @param input number + * @param channel number + * @param parameters { [name: string]: number } + * @returns number + */ + generate(){} + + /** + * Update the private params object with the + * values of the parameters at the given index + * @param parameters { [name: string]: Float32Array }, + * @param index number + */ + updateParams(parameters, index) { + for (const paramName in parameters) { + const param = parameters[paramName]; + if (param.length > 1) { + this.params[paramName] = parameters[paramName][index]; + } else { + this.params[paramName] = parameters[paramName][0]; + } + } + } + + /** + * Process a single frame of the audio + * @param inputs Float32Array[][] + * @param outputs Float32Array[][] + */ + process(inputs, outputs, parameters) { + const input = inputs[0]; + const output = outputs[0]; + // get the parameter values + const channelCount = Math.max(input && input.length || 0, output.length); + for (let sample = 0; sample < this.blockSize; sample++) { + this.updateParams(parameters, sample); + for (let channel = 0; channel < channelCount; channel++) { + const inputSample = input && input.length ? input[channel][sample] : 0; + output[channel][sample] = this.generate(inputSample, channel, this.params); + } + } + return !this.disposed; + } + }; +`;ba(L3);var B3=` + /** + * A multichannel buffer for use within an AudioWorkletProcessor as a delay line + */ + class DelayLine { + + constructor(size, channels) { + this.buffer = []; + this.writeHead = [] + this.size = size; + + // create the empty channels + for (let i = 0; i < channels; i++) { + this.buffer[i] = new Float32Array(this.size); + this.writeHead[i] = 0; + } + } + + /** + * Push a value onto the end + * @param channel number + * @param value number + */ + push(channel, value) { + this.writeHead[channel] += 1; + if (this.writeHead[channel] > this.size) { + this.writeHead[channel] = 0; + } + this.buffer[channel][this.writeHead[channel]] = value; + } + + /** + * Get the recorded value of the channel given the delay + * @param channel number + * @param delay number delay samples + */ + get(channel, delay) { + let readHead = this.writeHead[channel] - Math.floor(delay); + if (readHead < 0) { + readHead += this.size; + } + return this.buffer[channel][readHead]; + } + } +`;ba(B3);var bE="feedback-comb-filter",j3=` + class FeedbackCombFilterWorklet extends SingleIOProcessor { + + constructor(options) { + super(options); + this.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2); + } + + static get parameterDescriptors() { + return [{ + name: "delayTime", + defaultValue: 0.1, + minValue: 0, + maxValue: 1, + automationRate: "k-rate" + }, { + name: "feedback", + defaultValue: 0.5, + minValue: 0, + maxValue: 0.9999, + automationRate: "k-rate" + }]; + } + + generate(input, channel, parameters) { + const delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate); + this.delayLine.push(channel, input + delayedSample * parameters.feedback); + return delayedSample; + } + } +`;nh(bE,j3);var rh=class t extends Tr{constructor(){super(b(t.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;let e=b(t.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),n={};Object.keys(e.urls).forEach(r=>{let i=parseInt(r,10);if(te(Jc(r)||Xt(i)&&isFinite(i),`url key is neither a note or midi pitch: ${r}`),Jc(r)){let o=new An(this.context,r).toMidi();n[o]=e.urls[r]}else Xt(i)&&isFinite(i)&&(n[i]=e.urls[i])}),this._buffers=new ma({urls:n,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Tr.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:de,onerror:de,release:.1,urls:{}})}_findClosest(e){let r=0;for(;r<96;){if(this._buffers.has(e+r))return-r;if(this._buffers.has(e-r))return r;r++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,n,r=1){return this.log("triggerAttack",e,n,r),Array.isArray(e)||(e=[e]),e.forEach(i=>{let o=ey(new An(this.context,i).toFrequency()),s=Math.round(o),a=o-s,c=this._findClosest(s),u=s-c,l=this._buffers.get(u),d=Oo(c+a),h=new di({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:d}).connect(this.output);h.start(n,0,l.duration/d,r),Ot(this._activeSources.get(s))||this._activeSources.set(s,[]),this._activeSources.get(s).push(h),h.onended=()=>{if(this._activeSources&&this._activeSources.has(s)){let p=this._activeSources.get(s),y=p.indexOf(h);y!==-1&&p.splice(y,1)}}}),this}triggerRelease(e,n){return this.log("triggerRelease",e,n),Array.isArray(e)||(e=[e]),e.forEach(r=>{let i=new An(this.context,r).toMidi();if(this._activeSources.has(i)&&this._activeSources.get(i).length){let o=this._activeSources.get(i);n=this.toSeconds(n),o.forEach(s=>{s.stop(n)}),this._activeSources.set(i,[])}}),this}releaseAll(e){let n=this.toSeconds(e);return this._activeSources.forEach(r=>{for(;r.length;)r.shift().stop(n)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,n,r,i=1){let o=this.toSeconds(r);return this.triggerAttack(e,o,i),Ot(n)?(te(Ot(e),"notes must be an array when duration is array"),e.forEach((s,a)=>{let c=n[Math.min(a,n.length-1)];this.triggerRelease(s,o+this.toSeconds(c))})):this.triggerRelease(e,o+this.toSeconds(n)),this}add(e,n,r){if(te(Jc(e)||isFinite(e),`note must be a pitch or midi: ${e}`),Jc(e)){let i=new An(this.context,e).toMidi();this._buffers.add(i,n,r)}else this._buffers.add(e,n,r);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(e=>{e.forEach(n=>n.dispose())}),this._activeSources.clear(),this}};en([Mn(0)],rh.prototype,"attack",void 0);en([Mn(0)],rh.prototype,"release",void 0);var wa=class t extends gt{constructor(){super(b(t.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new xr("stopped"),this._startOffset=0;let e=b(t.getDefaults(),arguments,["callback","value"]);this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._playbackRate=e.playbackRate,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this._playbackRate=e.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(gt.getDefaults(),{callback:de,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,n=>{let r;if(n.state==="started"){n.id!==-1&&this.context.transport.clear(n.id);let i=n.time+Math.round(this.startOffset/this._playbackRate);if(this._loop===!0||Xt(this._loop)&&this._loop>1){r=1/0,Xt(this._loop)&&(r=this._loop*this._getLoopDuration());let o=this._state.getAfter(i);o!==null&&(r=Math.min(r,o.time-i)),r!==1/0&&(this._state.setStateAtTime("stopped",i+r+1,{id:-1}),r=new Dt(this.context,r));let s=new Dt(this.context,this._getLoopDuration());n.id=this.context.transport.scheduleRepeat(this._tick.bind(this),s,new Dt(this.context,i),r)}else n.id=this.context.transport.schedule(this._tick.bind(this),new Dt(this.context,i))}})}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){let n=this.toTicks(e);return this._state.getValueAtTime(n)==="stopped"&&(this._state.add({id:-1,state:"started",time:n}),this._rescheduleEvents(n)),this}stop(e){this.cancel(e);let n=this.toTicks(e);if(this._state.getValueAtTime(n)==="started"){this._state.setStateAtTime("stopped",n,{id:-1});let r=this._state.getBefore(n),i=n;r!==null&&(i=r.time),this._rescheduleEvents(i)}return this}cancel(e){e=Dn(e,-1/0);let n=this.toTicks(e);return this._state.forEachFrom(n,r=>{this.context.transport.clear(r.id)}),this._state.cancel(n),this}_tick(e){let n=this.context.transport.getTicksAtTime(e);if(!this.mute&&this._state.getValueAtTime(n)==="started"){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let r=.02;Pd(this.humanize)||(r=this.toSeconds(this.humanize)),e+=(Math.random()*2-1)*r}this.callback(e,this.value)}}_getLoopDuration(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new Dt(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Dt(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){let e=this.context.transport.ticks,n=this._state.get(e);if(n!==null&&n.state==="started"){let r=this._getLoopDuration();return(e-n.time)%r/r}else return 0}else return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}};var Vo=class t extends gt{constructor(){super(b(t.getDefaults(),arguments,["callback","interval"])),this.name="Loop";let e=b(t.getDefaults(),arguments,["callback","interval"]);this._event=new wa({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations}static getDefaults(){return Object.assign(gt.getDefaults(),{interval:"4n",callback:de,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return this._event.loop===!0?1/0:this._event.loop}set iterations(e){e===1/0?this._event.loop=!0:this._event.loop=e}dispose(){return super.dispose(),this._event.dispose(),this}};var su=class t extends ${constructor(){super(Object.assign(b(t.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;let e=b(t.getDefaults(),arguments,["pan"]);this.pan=new De({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Y(this,"pan")}static getDefaults(){return Object.assign($.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}};var TE="bit-crusher",z3=` + class BitCrusherWorklet extends SingleIOProcessor { + + static get parameterDescriptors() { + return [{ + name: "bits", + defaultValue: 12, + minValue: 1, + maxValue: 16, + automationRate: 'k-rate' + }]; + } + + generate(input, _channel, parameters) { + const step = Math.pow(0.5, parameters.bits - 1); + const val = step * Math.floor(input / step + 0.5); + return val; + } + } +`;nh(TE,z3);var PEe=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100];var HEe=[1687/25e3,1601/25e3,2053/25e3,2251/25e3];var Ta=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["solo"])),this.name="Solo";let e=b(t.getDefaults(),arguments,["solo"]);this.input=this.output=new oe({context:this.context}),t._allSolos.has(this.context)||t._allSolos.set(this.context,new Set),t._allSolos.get(this.context).add(this),this.solo=e.solo}static getDefaults(){return Object.assign($.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(e){e?this._addSolo():this._removeSolo(),t._allSolos.get(this.context).forEach(n=>n._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){t._soloed.has(this.context)||t._soloed.set(this.context,new Set),t._soloed.get(this.context).add(this)}_removeSolo(){t._soloed.has(this.context)&&t._soloed.get(this.context).delete(this)}_isSoloed(){return t._soloed.has(this.context)&&t._soloed.get(this.context).has(this)}_noSolos(){return!t._soloed.has(this.context)||t._soloed.has(this.context)&&t._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),t._allSolos.get(this.context).delete(this),this._removeSolo(),this}};Ta._allSolos=new Map;Ta._soloed=new Map;var ah=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";let e=b(t.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new su({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new er({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Y(this,["pan","volume"])}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}};var cy=class t extends ${constructor(){super(b(t.getDefaults(),arguments,["volume","pan"])),this.name="Channel";let e=b(t.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Ta({solo:e.solo,context:this.context}),this._panVol=this.output=new ah({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Y(this,["pan","volume"])}static getDefaults(){return Object.assign($.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return t.buses.has(e)||t.buses.set(e,new oe({context:this.context})),t.buses.get(e)}send(e,n=0){let r=this._getBus(e),i=new oe({context:this.context,units:"decibels",gain:n});return this.connect(i),i.connect(r),i}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}};cy.buses=new Map;var uy=class extends ${constructor(){super(...arguments),this.name="Listener",this.positionX=new De({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new De({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new De({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new De({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new De({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new De({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new De({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new De({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new De({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign($.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}};Gi(t=>{t.listener=new uy({context:t})});Wi(t=>{t.listener.dispose()});var ot=Ct().transport;var OMe=Ct().destination,FMe=Ct().destination;var kMe=Ct().listener;var ch=Ct().draw;var RMe=Ct();function Ca(){return rn.loaded()}var Je=class t{constructor(e=Sn(0)){this._toneTime=e}static fromValue(e){return new this(Sn(e))}static fromTransport(e){return new this(Sn(e.position))}static fromBeatTime(e){let n=Math.floor(e/4),r=Math.floor(e)-n*4,i=e%1*4,o=`${n}:${r}:${i}`;return new t(Sn(o))}static fromFields(e){return t.fromValue(DE(e))}add(e){let n=this.toBarsBeatsSixteenthsFields(),r=e.toBarsBeatsSixteenthsFields(),i={bars:n.bars+r.bars,beats:n.beats+r.beats,sixteenths:n.sixteenths+r.sixteenths};return t.fromFields(i)}dividedIn(e){let n=this.toBarsBeatsSixteenthsFields(),r={bars:n.bars/e,beats:n.beats/e,sixteenths:n.sixteenths/e};return t.fromFields(r)}relativeTo(e){return new t(Sn(this.toSeconds()-e.toSeconds(),"s"))}compareTo(e){return this.toSeconds()-e.toSeconds()}isBefore(e){return this.compareTo(e)<0}isBeforeOrEquals(e){return this.compareTo(e)<=0}isAfterOrEquals(e){return this.compareTo(e)>=0}toBarsBeatsSixteenths(){return this._toneTime.toBarsBeatsSixteenths()}toBars(){return this.toBarsBeatsSixteenthsFields().bars}toBarsBeatsSixteenthsFields(){let e=this._toneTime.toBarsBeatsSixteenths().split(":");return{bars:+e[0],beats:+e[1],sixteenths:+e[2]}}toAbletonLiveBarsBeatsSixteenths(){let e=this.toBarsBeatsSixteenthsFields();return++e.bars,++e.beats,e.sixteenths=Math.floor(e.sixteenths)+1,DE(e,".")}toAbletonLiveBeatTime(){let e=this.toBarsBeatsSixteenthsFields(),n=e.bars,r=e.beats,i=Math.floor(e.sixteenths);return n*4+r+i/4}toSeconds(){return this._toneTime.toSeconds()}toString(){return this.toBarsBeatsSixteenths()}mod(e){let n=this.toBarsBeatsSixteenthsFields();return n.bars=n.bars%e,t.fromFields(n)}toBeatTime(){let e=this.toBarsBeatsSixteenthsFields();return e.bars*4+e.beats}},EE=Je.fromValue("1m");function DE(t,e=":"){return`${t.bars}${e}${t.beats}${e}${t.sixteenths}`}var uh=["C","C#","D","Eb","E","F","F#","G","Ab","A","Bb","B"],Lo=class{constructor(e){let n=e%12;this.value=n>=0?n:n+12}static getValueFromName(e,n){let r=n.indexOf(e);if(r===-1)throw new Error("invalid name : "+e);return r}equals(e){return this.value===e.value}},Ut=class t extends Lo{constructor(e){super(e)}static fromName(e){return new t(Lo.getValueFromName(e,uh))}next(e){return new t(this.value+e)}get name(){return uh[this.value]}is(e){return this.value===e.value}degreeIn(e){return new ly(this.value-e.note.value)}modeIn(e){return new Cr(e.mode.value+this.value-e.note.value)}toString(){return uh[this.value]}};(function(t){t.C=t.fromName("C"),t.Cs=t.fromName("C#"),t.D=t.fromName("D"),t.Eb=t.fromName("Eb"),t.E=t.fromName("E"),t.F=t.fromName("F"),t.Fs=t.fromName("F#"),t.Gb=t.Fs,t.G=t.fromName("G"),t.Ab=t.fromName("Ab"),t.A=t.fromName("A"),t.Bb=t.fromName("Bb"),t.B=t.fromName("B")})(Ut||(Ut={}));var SE=["I","bii","ii","biii","iii","IV","bV","V","bvi","vi","bvii","vii"],Cr=class extends Lo{constructor(e){super(e)}static fromName(e){return new Ut(Lo.getValueFromName(e,SE))}get name(){return SE[this.value]}};(function(t){t.I=t.fromName("I"),t.vi=t.fromName("vi")})(Cr||(Cr={}));var ht=class{constructor(e,n=Cr.I){this.note=e,this.mode=n}};(function(t){t.Cm=new t(Ut.C,Cr.vi),t.Gm=new t(Ut.G,Cr.vi),t.Am=new t(Ut.A,Cr.vi),t.Bb=new t(Ut.Bb)})(ht||(ht={}));var ly=class extends Lo{constructor(e){super(e)}},cu=class t{constructor(e,n){this.name=e,this.root=t.getRootFromName(e)}static getRootFromName(e){if(uh.includes(e))return Ut.fromName(e);switch(e){case"Gb":return Ut.Gb;case"Gm":return Ut.G}throw new Error("Cannot find root from "+e)}toString(){return this.name}};(function(t){t.Gm=new t("Gm",Ut.G)})(cu||(cu={}));var lh=class t{constructor(e,n,r=[]){this.asciiChords=e,this.duration=n,this.chordsByTime=r}static fromAsciiChords(e){let n=e.split("|").slice(1,-1).map(o=>o.trim());if(n.length===0)throw new Error("Cannot find bars in AsciiChords : "+e);let r=[],i=Je.fromValue(0);return n.forEach(o=>{let s=o.split(" "),a=EE.dividedIn(s.length);s.forEach(c=>{let u=new cu(c);r.push([i,u]),i=i.add(a)})}),new t(e,Je.fromValue(`${n.length}m`),r)}setChordAt(e,n){this.chordsByTime.push([e,n])}getChordAt(e){return[...this.chordsByTime].reverse().find(([i])=>i.isBeforeOrEquals(e))?.[1]}get length(){return this.chordsByTime.length}toString(){return this.chordsByTime.map(([e,n])=>`${e.toBarsBeatsSixteenths()} ${n}`).join(` +`)}toAscii(){return this.asciiChords}};var dh=class t{constructor(e,n){this.strings=e,this.lines=n}static create(e){let{startingNote:n,stringInterval:r,stringsCount:i,lowestFret:o,fretsCount:s}=e,a=this.buildStrings(n,r,i),u=[...Array(s).keys()].map(l=>o+l).map(l=>dy.create(a,l));return new t(a,u)}static buildStrings(e,n,r){return[...Array(r).keys()].map(o=>e.next(o*n.value))}},dy=class t{constructor(e,n){this.fret=e,this.notes=n}static create(e,n){let r=e.map(i=>new hy(i,n));return new t(n,r)}},hy=class extends Ut{constructor(e,n){super(e.value+n),this.string=e,this.fret=n}};function e6(t,e){if(t&1&&(Ee(0,"div"),je(1),Se()),t&2){let n=e.$implicit,r=re().$implicit,i=re();hr("active",i.currentNote==null?null:i.currentNote.equals(n)),xo("data-fret",r.fret)("data-string",n.string.name)("data-note",n.value)("data-degree",i.key&&n.degreeIn(i.key).value)("data-mode",i.key&&n.modeIn(i.key).name)("title",i.key&&"Mode : "+n.modeIn(i.key).name+` +Degr\xE9 : +`+n.degreeIn(i.key).value+"/12"),ee(1),_t(" ",n.name," ")}}function t6(t,e){if(t&1&&(ze(0),Ee(1,"div",1),je(2),Se(),Re(3,e6,2,9,"div",2),Ye()),t&2){let n=e.$implicit;ee(1),xo("data-fret",n.fret),ee(1),_t(" ",n.fret==12?"":n.fret," "),ee(1),ne("ngForOf",n.notes)}}var hh=(()=>{let e=class e{constructor(){this.lowestFret=0,this.startingNote=Ut.fromName("E"),this.stringInterval=new Ut(5),this.stringsCount=4,this.fretsCount=5,this.key=new ht(Ut.fromName("C"),Cr.fromName("I"))}ngOnInit(){this.buildFretboard()}buildFretboard(){this.fretboard=dh.create({startingNote:this.startingNote,stringInterval:this.stringInterval,stringsCount:this.stringsCount,lowestFret:this.lowestFret,fretsCount:this.fretsCount})}ngOnChanges(r){this.buildFretboard()}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=ut({type:e,selectors:[["app-fretboard"]],inputs:{lowestFret:"lowestFret",fretsCount:"fretsCount",key:"key",currentNote:"currentNote"},standalone:!0,features:[ii,pt],decls:1,vars:1,consts:[[4,"ngFor","ngForOf"],[1,"fret-mark"],[3,"active",4,"ngFor","ngForOf"]],template:function(i,o){i&1&&Re(0,t6,4,3,"ng-container",0),i&2&&ne("ngForOf",o.fretboard==null?null:o.fretboard.lines)},dependencies:[kt,Tn],styles:['@charset "UTF-8";.viewport[_ngcontent-%COMP%]{display:inline-block}[_nghost-%COMP%]{background:#000;display:inline-grid;grid-template-columns:auto repeat(4,1fr);gap:2mm;padding:2mm;margin:2mm}[data-fret][_ngcontent-%COMP%]{flex:1 1 auto;height:2cm;width:2cm;line-height:2cm;box-sizing:border-box}[data-note][_ngcontent-%COMP%]{background:var(--disabled-color);color:var(--disabled-color);border-radius:.1em}[data-note][data-fret="0"][_ngcontent-%COMP%]{border-top-left-radius:100%;border-top-right-radius:100%}[data-note][_ngcontent-%COMP%]:hover, [data-note].active[_ngcontent-%COMP%]{color:#fff;text-shadow:0 0 1ex #000;border:solid 1pt #fff}.fret-mark[_ngcontent-%COMP%]{color:#444;font-size:5mm;text-align:right;width:1cm;text-wrap:nowrap}.fret-mark[data-fret="3"][_ngcontent-%COMP%], .fret-mark[data-fret="5"][_ngcontent-%COMP%], .fret-mark[data-fret="7"][_ngcontent-%COMP%], .fret-mark[data-fret="9"][_ngcontent-%COMP%], .fret-mark[data-fret="12"][_ngcontent-%COMP%], .fret-mark[data-fret="15"][_ngcontent-%COMP%]{color:#fff}.fret-mark[data-fret="3"][_ngcontent-%COMP%]:before, .fret-mark[data-fret="5"][_ngcontent-%COMP%]:before, .fret-mark[data-fret="7"][_ngcontent-%COMP%]:before, .fret-mark[data-fret="9"][_ngcontent-%COMP%]:before, .fret-mark[data-fret="12"][_ngcontent-%COMP%]:before, .fret-mark[data-fret="15"][_ngcontent-%COMP%]:before{content:"\\2b24";margin-right:1ex}.fret-mark[data-fret="12"][_ngcontent-%COMP%]:before{content:"\\2b24\\2b24"}[data-mode=vi][_ngcontent-%COMP%]{background:var(--vi-color);color:var(--vi-color);border-color:var(--vi-color)}[data-mode=ii][_ngcontent-%COMP%]{background:var(--ii-color);color:var(--ii-color);border-color:var(--ii-color)}[data-mode=iii][_ngcontent-%COMP%]{background:var(--iii-color);color:var(--iii-color);border-color:var(--iii-color)}[data-mode=vii][_ngcontent-%COMP%]{background:var(--vii-color);color:var(--vii-color);border-color:var(--vii-color)}[data-mode=IV][_ngcontent-%COMP%]{background:var(--IV-color);color:var(--IV-color);border-color:var(--IV-color)}[data-mode=V][_ngcontent-%COMP%]{background:var(--V-color);color:var(--V-color);border-color:var(--V-color)}[data-mode=I][_ngcontent-%COMP%]{background:var(--I-color);color:var(--I-color);border-color:var(--I-color)}[data-degree="0"][_ngcontent-%COMP%]{color:#fff4;font-weight:700}']});let t=e;return t})();var AE={sampleDuration:208,sampleBeatTimeDuration:380,warpMarkers:[{secTime:0,beatTime:-1.1762159715284715},{secTime:.6474583333333334,beatTime:0},{secTime:2.5494791666666665,beatTime:4},{secTime:4.533229166666667,beatTime:8},{secTime:6.414729166666667,beatTime:12},{secTime:8.447458333333334,beatTime:16},{secTime:8.623416666666666,beatTime:16.323610764235763},{secTime:10.798354166666666,beatTime:20.323610764235763},{secTime:12.963208333333332,beatTime:24.323610764235763},{secTime:15.102354166666666,beatTime:28.323610764235763},{secTime:19.361729166666667,beatTime:36.32361076423577},{secTime:21.5016875,beatTime:40.32361076423577},{secTime:23.657645833333333,beatTime:44.32361076423577},{secTime:25.796,beatTime:48.32361076423577},{secTime:30.123145833333332,beatTime:56.32361076423577},{secTime:32.3084375,beatTime:60.32361076423577},{secTime:36.767270833333335,beatTime:68.32361076423577},{secTime:38.93233333333333,beatTime:72.32361076423577},{secTime:41.07664583333333,beatTime:76.32361076423577},{secTime:45.41322916666667,beatTime:84.32361076423577},{secTime:47.56552083333333,beatTime:88.32361076423577},{secTime:49.75370833333333,beatTime:92.32361076423577},{secTime:54.171625,beatTime:100.32361076423577},{secTime:56.36841666666666,beatTime:104.32361076423577},{secTime:58.552125,beatTime:108.32361076423577},{secTime:60.758874999999996,beatTime:112.32361076423577},{secTime:62.94252083333333,beatTime:116.32361076423577},{secTime:65.11383333333333,beatTime:120.32361076423577},{secTime:69.3805,beatTime:128.32361076423575},{secTime:71.57797916666667,beatTime:132.32361076423575},{secTime:73.79679166666666,beatTime:136.32361076423575},{secTime:76.00502083333333,beatTime:140.32361076423575},{secTime:78.20058333333333,beatTime:144.32361076423575},{secTime:80.44814583333333,beatTime:148.32361076423575},{secTime:82.71722916666667,beatTime:152.32361076423575},{secTime:84.971625,beatTime:156.32361076423575},{secTime:89.40552083333333,beatTime:164.32361076423575},{secTime:91.63077083333333,beatTime:168.32361076423575},{secTime:96.12441666666666,beatTime:176.32361076423575},{secTime:98.34041666666667,beatTime:180.32361076423575},{secTime:100.53739583333333,beatTime:184.32361076423575},{secTime:102.71122916666667,beatTime:188.32361076423575},{secTime:104.869875,beatTime:192.32361076423575},{secTime:107.0630625,beatTime:196.32361076423575},{secTime:111.51870833333334,beatTime:204.32361076423575},{secTime:115.91847916666666,beatTime:212.32361076423575},{secTime:118.13981249999999,beatTime:216.32361076423575},{secTime:120.3725625,beatTime:220.32361076423575},{secTime:122.5775625,beatTime:224.32361076423575},{secTime:124.79789583333333,beatTime:228.32361076423575},{secTime:129.27608333333333,beatTime:236.32361076423575},{secTime:135.8514375,beatTime:248.32361076423575},{secTime:138.0909375,beatTime:252.32361076423575},{secTime:140.3044375,beatTime:256.32361076423575},{secTime:144.69927083333332,beatTime:264.32361076423575},{secTime:146.91591666666667,beatTime:268.32361076423575},{secTime:149.09029166666667,beatTime:272.32361076423575},{secTime:151.29185416666667,beatTime:276.32361076423575},{secTime:155.75666666666666,beatTime:284.32361076423575},{secTime:164.63647916666667,beatTime:300.32361076423575},{secTime:169.0448125,beatTime:308.32361076423575},{secTime:171.278875,beatTime:312.32361076423575},{secTime:173.54152083333332,beatTime:316.32361076423575},{secTime:175.77772916666666,beatTime:320.32361076423575},{secTime:177.99827083333332,beatTime:324.32361076423575},{secTime:182.51258333333334,beatTime:332.32361076423575},{secTime:184.74072916666665,beatTime:336.32361076423575},{secTime:186.95395833333333,beatTime:340.32361076423575},{secTime:189.1530833333333,beatTime:344.32361076423575},{secTime:191.3145625,beatTime:348.32361076423575},{secTime:193.45008333333334,beatTime:352.32361076423575},{secTime:195.61702083333333,beatTime:356.32361076423575},{secTime:197.8255,beatTime:360.32361076423575},{secTime:197.84312565104167,beatTime:360.35486076423575}]};var IE=[{bar:1,beat:1,division:1,note:"kick"},{bar:1,beat:2,division:1,note:"snare"},{bar:1,beat:2,division:4,note:"kick"},{bar:1,beat:3,division:2,note:"kick"},{bar:1,beat:3,division:3,note:"kick"},{bar:1,beat:4,division:1,note:"snare"},{bar:2,beat:1,division:1,note:"kick"},{bar:2,beat:2,division:1,note:"snare"},{bar:2,beat:2,division:4,note:"kick"},{bar:2,beat:3,division:3,note:"kick"},{bar:2,beat:4,division:1,note:"snare"},{bar:3,beat:1,division:1,note:"kick"},{bar:3,beat:2,division:1,note:"snare"},{bar:3,beat:3,division:3,note:"kick"},{bar:3,beat:4,division:1,note:"snare"},{bar:4,beat:1,division:1,note:"kick"},{bar:4,beat:2,division:1,note:"snare"},{bar:4,beat:3,division:3,note:"kick"},{bar:4,beat:4,division:1,note:"snare"},{bar:3,beat:2,division:4,note:"kick"},{bar:1,beat:4,division:4,note:"kick"},{bar:2,beat:1,division:3,note:"kick"},{bar:2,beat:3,division:2,note:"kick"},{bar:4,beat:2,division:4,note:"kick"},{bar:4,beat:1,division:3,note:"kick"},{bar:5,beat:1,division:1,note:"kick"},{bar:5,beat:2,division:1,note:"snare"},{bar:5,beat:4,division:1,note:"snare"},{bar:6,beat:2,division:1,note:"snare"},{bar:6,beat:4,division:1,note:"snare"},{bar:7,beat:2,division:1,note:"snare"},{bar:7,beat:4,division:1,note:"snare"},{bar:8,beat:2,division:1,note:"snare"},{bar:8,beat:4,division:1,note:"snare"},{bar:8,beat:4,division:2,note:"snare"},{bar:8,beat:4,division:3,note:"snare"},{bar:8,beat:4,division:4,note:"snare"},{bar:6,beat:1,division:1,note:"kick"},{bar:6,beat:1,division:3,note:"kick"},{bar:7,beat:1,division:1,note:"kick"},{bar:8,beat:1,division:1,note:"kick"},{bar:8,beat:1,division:3,note:"kick"},{bar:5,beat:3,division:3,note:"kick"},{bar:6,beat:3,division:3,note:"kick"},{bar:7,beat:3,division:3,note:"kick"},{bar:8,beat:3,division:3,note:"snare"}];var fe=class t{constructor(e,n,r,i,o,s,a){this.name=e,this.duration=n,this.initial=r,this.key=i,this.chords=o,this.events=s,this.fretboard=a}static fromData(e){let n=e.chords?lh.fromAsciiChords(e.chords):void 0,r=i=>{if(!i)throw new Error("Missing duration");return i.duration};return new t(e.name,e.duration?new Je(Sn(e.duration)):r(n),e.initial,e.key,n,e.events,e.fretboard)}};var fh=class{constructor(e,n,r,i,o=e.duration.toBars()){this.pattern=e,this.structure=n,this.startTime=r,this.eventsStartTime=i,this.eventsDurationInBars=o,this.endTime=r.add(e.duration)}get initial(){return this.pattern.initial??this.pattern.name.charAt(0)}getChordAt(e){let n=e.relativeTo(this.startTime);return this.pattern.chords?.getChordAt(n)}};var Da=class{constructor(e,n){this.secTime=e,this.beatTime=n}};function i6(t){return t.map(e=>e.duration).reduce((e,n)=>e.add(n)).toBeatTime()}var fy=class{stuctureObject(e){return this._stuctureObject=e,this}patterns(e){return this._patterns=e,this}getEventsStartTime(e){return this._getEventsStartTime=e,this}getEventsDurationInBars(e){return this._getEventsDurationInBars=e,this}build(){if(!this._stuctureObject)throw new Error("Missing stuctureObject");if(!this._patterns)throw new Error("Missing patterns");let e=this._stuctureObject.sampleBeatTimeDuration??i6(this._patterns);return new Jt(Je.fromValue(this._stuctureObject.sampleDuration),e,this._patterns,this._stuctureObject.warpMarkers,this._getEventsStartTime,this._getEventsDurationInBars)}},Jt=class{constructor(e,n,r,i,o,s){this.sampleDuration=e,this.sampleBeatTimeDuration=n,this.warpMarkers=i,this.patternsInStructure=[];let a=new Je;for(let c of r)this.patternsInStructure.push(new fh(c,this,a,o?.(c),s?.(c))),a=a.add(c.duration);a.toSeconds()!==e.toSeconds()&&console.warn("currentTime != duration",a.toSeconds(),a.toAbletonLiveBarsBeatsSixteenths(),e.toSeconds()),a.toAbletonLiveBarsBeatsSixteenths()!==e.toAbletonLiveBarsBeatsSixteenths()&&console.warn("currentTime != duration",a.toAbletonLiveBarsBeatsSixteenths(),e.toAbletonLiveBarsBeatsSixteenths())}getPatternInStructureAt(e){let n=this.patternsInStructure[0];if(!e.isBefore(n.startTime)){for(let r of this.patternsInStructure)if(e.isBeforeOrEquals(r.endTime))return r}}static builder(){return new fy}getWarpMarkers(){return[...this.warpMarkers,new Da(this.sampleDuration.toSeconds(),this.sampleBeatTimeDuration)]}getWarpPosition(e){let n=this.getWarpMarkers();if(en[n.length-1].secTime)return;let r=n.find(u=>e===u.secTime);if(r)return Je.fromBeatTime(r.beatTime);let i=n.findIndex(u=>en[n.length-1].beatTime&&Bs(`beatTime apr\xE8s le dernier WrapMarker : ${r} > ${n[n.length-1].beatTime}`);let i=n.findIndex(u=>rt.bar>=1||t.bar<=2)}),s6=fe.fromData({name:"Bombarde seule",initial:"B*1",duration:"1m",key:Yi,fretboard:Zi}),py=fe.fromData({name:"Retour groupe",initial:"B*2",chords:"| Eb D |",key:Yi,fretboard:Zi,events:Ea.filter(t=>t.bar==2)}),my=fe.fromData({name:"1/2 Partie bombarde",initial:"B*34",key:Yi,chords:"| Gm F | Eb D Gm Gm |",fretboard:Zi,events:Ea.filter(t=>t.bar>=1||t.bar<=2)}),gy=fe.fromData({name:"Couplet",key:Yi,chords:"| Gm F | Eb D | Gm F | Eb D Gm Gm |",fretboard:Zi,events:Ea.filter(t=>t.bar>=3||t.bar<=4)}),yy=fe.fromData({name:"Couplet (Bb)",initial:"C'",key:Yi,chords:"| Gm F | Eb Bb | Gm F | Eb D Gm Gm |",fretboard:Zi,events:Ea.filter(t=>t.bar>=3||t.bar<=4)}),mh=fe.fromData({name:"Refrain",duration:"4m",key:Yi,chords:"| Bb | F | C | Gm |",fretboard:Zi,events:Ea.filter(t=>t.bar>=5)}),a6=[o6,Bo,Bo],ME=[Bo,Bo],NE=[s6,py,my,Bo],ph=[gy,yy],OE=[mh,mh],c6=Jt.builder().stuctureObject(AE).patterns([...a6,...ph,...ME,...ph,...OE,...NE,...ph,...ME,...ph,...OE,...NE]).getEventsStartTime(t=>{if(t===Bo)return Je.fromValue("0:0");if(t===my)return Je.fromValue("0:0");if(t===py)return Je.fromValue("1:0");if(t===gy)return Je.fromValue("2:0");if(t===yy)return Je.fromValue("2:0");if(t===mh)return Je.fromValue("4:0")}).getEventsDurationInBars(t=>{if(t===Bo||t===my)return 2;if(t===py)return 1;if(t===gy||t===yy)return 2;if(t===mh)return 4}).build(),gh={name:"Petit Papillon",structure:c6};function u6(t,e){if(t&1&&(Ee(0,"li")(1,"a",2),je(2),Se()()),t&2){let n=e.$implicit;ee(1),ne("routerLink","morceaux/"+n),ee(1),oc(n)}}function l6(t,e){if(t&1){let n=It();ze(0),Ee(1,"input",3),Pe("change",function(i){et(n);let o=re();return tt(o.uploadFile(i))}),Se(),Be(2,"br"),Ye()}}function d6(t,e){if(t&1){let n=It();Ee(0,"button",5),Pe("click",function(){et(n);let i=re(2);return tt(i.playSong())}),je(1,"\u23F5"),Se()}}function h6(t,e){if(t&1){let n=It();Ee(0,"button",5),Pe("click",function(){et(n);let i=re(2);return tt(i.pauseSong())}),je(1,"\u23F8"),Se()}}function f6(t,e){if(t&1&&(ze(0),je(1),Ye()),t&2){let n=e.$implicit;ee(1),_t(" ",n.toAscii()," ")}}function p6(t,e){if(t&1&&(ze(0),je(1),Ye()),t&2){let n=re(3);ee(1),_t(" ",n.currentPatternInStructure.pattern.duration.toBars(),"m ")}}function m6(t,e){if(t&1){let n=It();Ee(0,"app-rythm-bar",10),Pe("addEvent",function(i){et(n);let o=re(5);return tt(o.addEvent(i))})("removeEvent",function(i){et(n);let o=re(5);return tt(o.removeEvent(i))}),Se()}if(t&2){let n=re().$implicit,r=re(4);ne("number",n)("events",r.currentPatternInStructure.pattern.events)("timecode",r.rythmBarTimecode)}}function g6(t,e){if(t&1&&(ze(0),Re(1,m6,1,3,"app-rythm-bar",9),Be(2,"br"),Ye()),t&2){let n=re(4);ee(1),ne("ngIf",n.currentPatternInStructure.pattern.events==null?null:n.currentPatternInStructure.pattern.events.length)}}function y6(t,e){if(t&1&&(ze(0),Re(1,g6,3,1,"ng-container",0),Ye()),t&2){let n=re(3);ee(1),ne("ngForOf",n.sequence(n.currentPatternInStructure.eventsDurationInBars,n.currentPatternInStructure.eventsStartTime.toBars()+1))}}function v6(t,e){if(t&1&&(ze(0),je(1),Be(2,"br"),je(3),Be(4,"br"),Re(5,f6,2,1,"ng-container",1)(6,p6,2,1,"ng-container",1),Be(7,"br")(8,"app-fretboard",8),Re(9,y6,2,1,"ng-container",1),Ye()),t&2){let n=re(2);ee(1),_t(" ",n.currentPatternInStructure.pattern.name,""),ee(2),_t(" ",n.currentPatternInStructureRelativeTimecode,""),ee(2),ne("ngIf",n.currentPatternInStructure.pattern.chords),ee(1),ne("ngIf",!n.currentPatternInStructure.pattern.chords),ee(2),ne("lowestFret",0)("fretsCount",7)("key",n.currentPatternInStructure.pattern.key)("currentNote",n.currentChord==null?null:n.currentChord.root),ee(1),ne("ngIf",n.currentPatternInStructure.eventsStartTime)}}function _6(t,e){if(t&1){let n=It();ze(0),je(1),Re(2,d6,2,0,"button",4)(3,h6,2,0,"button",4),Ee(4,"button",5),Pe("click",function(){et(n);let i=re();return tt(i.stopSong())}),je(5,"\u23F9"),Se(),Be(6,"br"),Ee(7,"input",6),Pe("change",function(i){et(n);let o=re();return tt(o.setProgress(i))}),Se(),Be(8,"br"),je(9," Gm "),Ee(10,"app-structure",7),Pe("clickPatternInStructure",function(i){et(n);let o=re();return tt(o.onClickPatternInStructure(i))}),Se(),Be(11,"br"),Re(12,v6,10,9,"ng-container",1),Ye()}if(t&2){let n=re();ee(1),_t(" ",n.timecode," "),ee(1),ne("ngIf",!n.playing),ee(1),ne("ngIf",n.playing),ee(4),ne("value",n.progress),ee(3),ne("structure",n.structure)("currentPatternInStructure",n.currentPatternInStructure),ee(2),ne("ngIf",n.currentPatternInStructure)}}var FE=(()=>{let e=class e{constructor(r){this.changeDetectorRef=r,this.progress=0,this.playlist=["Petit Papillon","Surcouf","La femme dragon","Le jour (le phare)","Le r\xE9sistant","Noyer le silence","Nuages blancs"],this.sequence=Lr}addEvent(r){}removeEvent(r){}uploadFile(r){return Q(this,null,function*(){let o=r.currentTarget.files;if(!o?.length)return;let s=o[0];console.log("audioFile",s);let a=URL.createObjectURL(s),c=new hi({url:a}).toDestination();yield Ca();let u=gh.structure;ot.bpm.value=120,ot.loop=!0,ot.loopStart=0,ot.loopEnd=u.sampleDuration.toSeconds(),c.sync().start(0);let l=new Vo(d=>{ch.schedule(()=>{this.refresh(d)},d)},"16n").start(0);this.structure=u})}refresh(r){if(this.progress=Math.min(Math.max(0,ot.progress),1)*100,this.structure){let i=this.structure.getWarpPosition(ot.seconds);if(this.timecode=i?.toAbletonLiveBarsBeatsSixteenths(),i){let o=Je.fromValue(0),s=i.add(o);this.currentPatternInStructure=this.structure.getPatternInStructureAt(s),this.currentChord=this.currentPatternInStructure?.getChordAt(s),this.currentPatternInStructure?(this.currentPatternInStructure.eventsStartTime?this.rythmBarTimecode=s.relativeTo(this.currentPatternInStructure.startTime).mod(this.currentPatternInStructure.eventsDurationInBars).add(this.currentPatternInStructure.eventsStartTime).toAbletonLiveBarsBeatsSixteenths():delete this.rythmBarTimecode,this.currentPatternInStructureRelativeTimecode=s.relativeTo(this.currentPatternInStructure.startTime).toAbletonLiveBarsBeatsSixteenths()):(delete this.rythmBarTimecode,delete this.currentPatternInStructureRelativeTimecode)}}this.changeDetectorRef.detectChanges()}playSong(){return Q(this,null,function*(){console.log("playSong"),yield Ca(),No(),ot.start()})}pauseSong(){return Q(this,null,function*(){console.log("pauseSong"),yield Ca(),ot.pause()})}stopSong(){console.log("stopSong"),ot.stop()}onClickPatternInStructure(r){let i=r.structure.getWrappedTime(r.startTime);if(i){let o=i.toSeconds()/r.structure.sampleDuration.toSeconds();this.setProgressPercent(o*100)}}loopPattern(r){return Q(this,null,function*(){let i=o=>{let s=["C","B","R"].indexOf(o);if(s===-1)return;let c=document.getElementsByTagName("input")?.[s].files?.[0];if(c)return console.log("file",c),URL.createObjectURL(c)}})}play(){return Q(this,null,function*(){if(this.player){console.log("play");let r="https://drive.google.com/file/d/1DktZf_rGRaoRxoJEbo3NVWd9yYFX39aj/view?usp=sharing",i="https://drive.usercontent.google.com/u/0/uc?id=1DktZf_rGRaoRxoJEbo3NVWd9yYFX39aj&export=download",o="../assets/audio/Petit Papillon/Partie bombarde [2024-01-31 233921].wav";yield No(),this.player.start()}})}stop(){return Q(this,null,function*(){this.player&&(yield No(),this.player.stop()),this.refresh()})}setProgress(r){let o=+r.target.value;this.setProgressPercent(o)}setProgressPercent(r){let i=new Je(Sn(r/100*+ot.loopEnd.valueOf(),"s"));ot.position=i.toBarsBeatsSixteenths(),this.refresh()}get playing(){return ot.state==="started"}};e.\u0275fac=function(i){return new(i||e)(ve(zn))},e.\u0275cmp=ut({type:e,selectors:[["app-rythm-sandbox"]],standalone:!0,features:[pt],decls:4,vars:3,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"routerLink"],["type","file","accept",".wav,.mp3",3,"change"],[3,"click",4,"ngIf"],[3,"click"],["type","range","min","0","max","100","step","1",3,"value","change"],[3,"structure","currentPatternInStructure","clickPatternInStructure"],[3,"lowestFret","fretsCount","key","currentNote"],[3,"number","events","timecode","addEvent","removeEvent",4,"ngIf"],[3,"number","events","timecode","addEvent","removeEvent"]],template:function(i,o){i&1&&(Ee(0,"ol"),Re(1,u6,3,2,"li",0),Se(),Re(2,l6,3,0,"ng-container",1)(3,_6,13,7,"ng-container",1)),i&2&&(ee(1),ne("ngForOf",o.playlist),ee(1),ne("ngIf",!o.structure),ee(1),ne("ngIf",o.structure))},dependencies:[md,gd,kt,Tn,kr,Ls,hh,wb],styles:["[_nghost-%COMP%]{width:100%}input[type=range][_ngcontent-%COMP%]{width:100%}"]});let t=e;return t})();var MS=hu(Oy());var Ch=class{constructor(e){this.alsProject=e}get originalAudioTrack(){return this.alsProject.audioTracks[0]}get originalAudioClip(){return this.originalAudioTrack.audioClips[0]}get sampleDuration(){let e=this.originalAudioClip.duration,n=this.originalAudioClip.sampleRate;return Je.fromValue(e/n)}get warpMarkers(){return this.originalAudioClip.wrapMarkers.map(e=>new Da(e.secTime,e.beatTime))}toStructureObject(){return{sampleDuration:this.sampleDuration.toSeconds(),warpMarkers:this.warpMarkers}}};var Dh=class{constructor(e){this.xmlWarpMarker=e}get secTime(){return+this.xmlWarpMarker._attributes.SecTime}get beatTime(){return+this.xmlWarpMarker._attributes.BeatTime}};var Eh=class{constructor(e){this.xmlAudioClip=e}get duration(){return+this.xmlAudioClip.SampleRef.DefaultDuration._attributes.Value}get sampleRate(){return+this.xmlAudioClip.SampleRef.DefaultSampleRate._attributes.Value}get wrapMarkers(){return this.xmlAudioClip.WarpMarkers.WarpMarker.map(n=>new Dh(n))}};var Sh=class{constructor(e){this.xmlObject=e}get audioClips(){let e=this.xmlObject.DeviceChain.MainSequencer.Sample.ArrangerAutomation.Events.AudioClip;return[new Eh(e)]}};var Ah=class{constructor(e){this.parsedXml=e}get audioTracks(){return this.parsedXml.Ableton.LiveSet.Tracks.AudioTrack.map(e=>new Sh(e))}};var ES="NOT FOUND";function SS(t){if(t.substring(0,ES.length)===ES)throw new Error("XML file not found")}var AS=hu(Oy());var IS=(()=>{let e=class e{loadUnzipped(r){return Q(this,null,function*(){let i=yield r.text();return this.loadXmlContent(i)})}loadXmlContent(r){SS(r);let i=AS.xml2json(r,{compact:!0});return this.loadJsonContent(i)}loadJsonContent(r){return new Ah(JSON.parse(r))}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=se({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function bV(t,e){if(t&1&&(ze(0),je(1),Be(2,"textarea",3),Ye()),t&2){let n=re();ee(1),_t(" src/assets/als/",n.songName,".als.xml.json : "),ee(1),ne("ngModel",n.jsonContent)}}function wV(t,e){if(t&1&&(ze(0),je(1),Be(2,"textarea",3),Ye()),t&2){let n=re();ee(1),_t(" src/assets/structures/",n.songName,".json : "),ee(1),ne("ngModel",n.jsonStructure)}}function TV(t,e){if(t&1&&(ze(0),je(1),Be(2,"textarea",3),Ye()),t&2){let n=re();ee(1),_t(" src/app/song/entries/",n.songName,".ts : "),ee(1),ne("ngModel",n.songEntry)}}var NS=(()=>{let e=class e{constructor(r){this.alsImporter=r}uploadFile(r){return Q(this,null,function*(){let o=r.currentTarget.files;if(!o?.length)return;let s=o[0],a=yield s.text(),c=MS.default.xml2json(a,{compact:!0});this.jsonContent=c;let u=this.alsImporter.loadJsonContent(c),l=new Ch(u);this.jsonStructure=JSON.stringify(l.toStructureObject(),void 0,4),this.songName=s.name.substring(0,s.name.indexOf("."))})}get songName(){return this._songName}set songName(r){this._songName=r,this.songEntry=` +import {Key} from "../../notes"; +import stuctureObject from "../../../assets/structures/${r}.json"; +import {Pattern} from "../../structure/pattern/pattern"; +import {Structure} from "../../structure/structure"; + +const key = Key.Gm +const fretboard = { + lowestFret: 0, + fretsCount: 5, +} + +const couplet = Pattern.fromData({ + key, + name: 'Couplet', + chords: '| A | C | G | F |', + fretboard, +}) + +const refrain = Pattern.fromData({ + key, + name: 'Refrain', + chords: '| A | E | F | G |', + fretboard, +}) + +const ligne1 = [couplet, couplet, refrain,] + +const patterns: Pattern[] = [ + ...ligne1, +] + +const structure = Structure.builder() + .stuctureObject(stuctureObject) + .patterns(patterns) + .build() + +export default { + name: '${r}', + structure, +} +`}};e.\u0275fac=function(i){return new(i||e)(ve(IS))},e.\u0275cmp=ut({type:e,selectors:[["app-convert"]],standalone:!0,features:[pt],decls:5,vars:4,consts:[["type","file","accept",".xml",3,"change"],["type","text","placeholder","Titre du morceau",3,"ngModel","ngModelChange"],[4,"ngIf"],["rows","10",3,"ngModel"]],template:function(i,o){i&1&&(Ee(0,"input",0),Pe("change",function(a){return o.uploadFile(a)}),Se(),Ee(1,"input",1),Pe("ngModelChange",function(a){return o.songName=a}),Se(),Re(2,bV,3,2,"ng-container",2)(3,wV,3,2,"ng-container",2)(4,TV,3,2,"ng-container",2)),i&2&&(ee(1),ne("ngModel",o.songName),ee(1),ne("ngIf",o.jsonContent),ee(1),ne("ngIf",o.jsonStructure),ee(1),ne("ngIf",o.songEntry))},dependencies:[Ls,hd,Hb,yg,kr],styles:["input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{width:100vw}textarea[_ngcontent-%COMP%]{resize:vertical}"]});let t=e;return t})();var OS={sampleDuration:260.08495833333336,warpMarkers:[{secTime:0,beatTime:-2.064692338911089},{secTime:.9532291666666667,beatTime:0},{secTime:7.386895697453931,beatTime:13.935307661088912},{secTime:7.618447832134066,beatTime:14.435307661088912},{secTime:18.732947678792698,beatTime:38.43530766108891},{secTime:24.271405966863313,beatTime:50.43530766108891},{secTime:31.64342700917041,beatTime:66.43530766108891},{secTime:37.17946871269669,beatTime:78.43530766108891},{secTime:42.66861435259125,beatTime:90.43530766108891},{secTime:44.51096852491173,beatTime:94.43530766108891},{secTime:48.23017688219625,beatTime:102.43530766108891},{secTime:51.90959360795932,beatTime:110.43530766108891},{secTime:53.76057278176086,beatTime:114.43530766108891},{secTime:57.48478091362085,beatTime:122.43530766108891},{secTime:64.85184352583383,beatTime:138.4353076610889},{secTime:68.5591349820861,beatTime:146.4353076610889},{secTime:70.40334324532341,beatTime:150.4353076610889},{secTime:74.05878069062601,beatTime:158.4353076610889},{secTime:75.89946822404454,beatTime:162.4353076610889},{secTime:79.62392636679942,beatTime:170.4353076610889},{secTime:81.47680126890555,beatTime:174.4353076610889},{secTime:85.14869727966288,beatTime:182.4353076610889},{secTime:88.80159294911937,beatTime:190.4353076610889},{secTime:90.64253039385221,beatTime:194.4353076610889},{secTime:92.50061371382617,beatTime:198.4353076610889},{secTime:94.36873880802705,beatTime:202.4353076610889},{secTime:98.0847386336718,beatTime:210.4353076610889},{secTime:99.95109279841017,beatTime:214.4353076610889},{secTime:107.3820092412061,beatTime:230.4353076610889},{secTime:112.89998872129217,beatTime:242.4353076610889},{secTime:116.58788462406665,beatTime:250.4353076610889},{secTime:118.41425971429089,beatTime:254.4353076610889},{secTime:125.76536419289187,beatTime:270.4353076610889},{secTime:129.47355153171884,beatTime:278.4353076610889},{secTime:133.15265583912696,beatTime:286.4353076610889},{secTime:138.70740605564788,beatTime:298.4353076610889},{secTime:140.33442467303394,beatTime:301.9353076610889},{secTime:153.70223761284433,beatTime:325.9353076610889},{secTime:158.10040426044725,beatTime:333.9353076610889},{secTime:160.35638335505064,beatTime:337.9353076610889},{secTime:162.50930006001363,beatTime:341.9353076610889},{secTime:176.3814040189609,beatTime:365.9353076610889},{secTime:176.67533107673853,beatTime:366.4353076610889},{secTime:190.14706668796134,beatTime:389.9353076610889},{secTime:194.92471266157372,beatTime:397.9353076610889},{secTime:201.8139415399637,beatTime:413.9353076610889},{secTime:208.76123296628066,beatTime:429.9353076610889},{secTime:222.82671263066004,beatTime:461.9353076610889},{secTime:229.8833169417776,beatTime:477.9353076610889},{secTime:236.76984753877332,beatTime:493.6853076610889},{secTime:236.93480184635973,beatTime:493.9353076610889},{secTime:243.8276770625962,beatTime:509.9353076610889},{secTime:249.06801026067114,beatTime:521.9353076610889},{secTime:249.0827228259598,beatTime:521.9665576610889}]};var RS={lowestFret:0,fretsCount:4},qo=fe.fromData({key:ht.Am,name:"Couplet (sans basse)",initial:"Cs",duration:"4m"}),Na=fe.fromData({key:ht.Am,name:"Couplet",chords:"| A | C | G | F |",fretboard:RS}),Ih=fe.fromData({key:ht.Am,name:"Refrain calme",chords:"| A | E | F | G |",fretboard:{lowestFret:5,fretsCount:6}}),FS=fe.fromData({key:ht.Am,name:"Refrain",chords:"| A | E | F | G |",fretboard:RS}),PS=[Na,Na,Na,Na],VS=[FS,FS],DV=[qo,qo,qo,Ih,Ih],EV=[...PS,...VS],SV=[...PS,...VS,Na,Na],AV=[qo,qo,qo,qo,Ih,Ih],LS={lowestFret:3,fretsCount:4},Ma=fe.fromData({key:ht.Cm,name:"Couplet final",initial:"Cf",chords:"| C | Eb | Bb | Ab |",fretboard:LS}),kS=fe.fromData({key:ht.Cm,name:"Refrain final",initial:"Rf",chords:"| C | G | Ab | Bb |",fretboard:LS}),IV=[Ma,Ma,Ma,Ma,kS,kS,Ma,Ma],MV=[...DV,...EV,...SV,...AV,...IV],NV=Jt.builder().stuctureObject(OS).patterns(MV).build(),BS={name:"La femme dragon",structure:NV};var jS={sampleDuration:369.799375,warpMarkers:[{secTime:0,beatTime:-6.224249968781219},{secTime:3.4579166666666667,beatTime:0},{secTime:22.351291666666665,beatTime:36},{secTime:30.459041666666664,beatTime:51},{secTime:42.05529166666666,beatTime:72},{secTime:42.144437499999995,beatTime:72.16275417291043},{secTime:48.70516666666666,beatTime:84},{secTime:48.751333333333335,beatTime:84.08376129079254},{secTime:57.018875,beatTime:99.08376129079254},{secTime:63.66835416666667,beatTime:111.08376129079254},{secTime:66.96145833333333,beatTime:117.08376129079254},{secTime:73.47235416666666,beatTime:129.08376129079255},{secTime:75.11614583333333,beatTime:132.08376129079255},{secTime:80.07225,beatTime:141.08376129079255},{secTime:84.98291666666667,beatTime:150.08376129079255},{secTime:88.295625,beatTime:156.08376129079255},{secTime:91.61639583333333,beatTime:162.08376129079255},{secTime:96.56429166666666,beatTime:171.08376129079255},{secTime:101.54414583333333,beatTime:180.08376129079255},{secTime:104.84110416666667,beatTime:186.08376129079255},{secTime:108.10497916666667,beatTime:192.08376129079255},{secTime:112.96947916666666,beatTime:201.08376129079255},{secTime:116.2294375,beatTime:207.08376129079255},{secTime:117.86881249999999,beatTime:210.08376129079255},{secTime:122.82164583333333,beatTime:219.08376129079255},{secTime:124.45947916666667,beatTime:222.08376129079255},{secTime:127.70710416666667,beatTime:228.08376129079255},{secTime:129.34047916666665,beatTime:231.08376129079255},{secTime:134.2848125,beatTime:240.08376129079255},{secTime:139.17302083333334,beatTime:249.08376129079255},{secTime:142.42797916666666,beatTime:255.08376129079255},{secTime:147.35399999999998,beatTime:264.08376129079255},{secTime:150.66899999999998,beatTime:270.08376129079255},{secTime:153.99264583333334,beatTime:276.08376129079255},{secTime:155.63899999999998,beatTime:279.08376129079255},{secTime:158.90097916666667,beatTime:285.08376129079255},{secTime:163.75981249999998,beatTime:294.08376129079255},{secTime:167.02472916666667,beatTime:300.08376129079255},{secTime:173.61004166666666,beatTime:312.08376129079255},{secTime:175.26452083333334,beatTime:315.08376129079255},{secTime:178.59608333333333,beatTime:321.08376129079255},{secTime:181.89316666666667,beatTime:327.08376129079255},{secTime:183.53229166666665,beatTime:330.08376129079255},{secTime:185.16091666666665,beatTime:333.08376129079255},{secTime:186.77635416666666,beatTime:336.08376129079255},{secTime:189.9793125,beatTime:342.08376129079255},{secTime:193.2136875,beatTime:348.08376129079255},{secTime:194.84979166666665,beatTime:351.08376129079255},{secTime:196.4960625,beatTime:354.08376129079255},{secTime:199.82375,beatTime:360.08376129079255},{secTime:201.49927083333333,beatTime:363.08376129079255},{secTime:203.16229166666665,beatTime:366.08376129079255},{secTime:206.44916666666666,beatTime:372.08376129079255},{secTime:213.08656249999999,beatTime:384.08376129079255},{secTime:218.07764583333332,beatTime:393.08376129079255},{secTime:219.72968749999998,beatTime:396.08376129079255},{secTime:223.00297916666665,beatTime:402.08376129079255},{secTime:229.51089583333334,beatTime:414.08376129079255},{secTime:234.43122916666667,beatTime:423.08376129079255},{secTime:241.010125,beatTime:435.08376129079255},{secTime:247.56333333333333,beatTime:447.08376129079255},{secTime:250.85685416666666,beatTime:453.08376129079255},{secTime:252.49277083333334,beatTime:456.08376129079255},{secTime:254.11664583333334,beatTime:459.08376129079255},{secTime:255.72933333333333,beatTime:462.08376129079255},{secTime:258.9378125,beatTime:468.08376129079255},{secTime:260.56066666666663,beatTime:471.08376129079255},{secTime:267.1436458333333,beatTime:483.08376129079255},{secTime:270.43558333333334,beatTime:489.08376129079255},{secTime:273.6933333333333,beatTime:495.08376129079255},{secTime:275.30785416666663,beatTime:498.08376129079255},{secTime:276.9080208333333,beatTime:501.08376129079255},{secTime:280.0957916666667,beatTime:507.08376129079255},{secTime:281.710125,beatTime:510.08376129079255},{secTime:283.3408958333333,beatTime:513.0837612907925},{secTime:284.9841875,beatTime:516.0837612907925},{secTime:288.29766666666666,beatTime:522.0837612907925},{secTime:289.94145833333334,beatTime:525.0837612907925},{secTime:299.69279166666666,beatTime:543.0837612907925},{secTime:307.80691666666667,beatTime:558.0837612907925},{secTime:311.0409583333333,beatTime:564.0837612907925},{secTime:317.4848333333333,beatTime:576.0837612907925},{secTime:319.10643749999997,beatTime:579.0837612907925},{secTime:324.01222916666666,beatTime:588.0837612907925},{secTime:325.6351458333333,beatTime:591.0837612907925},{secTime:328.8441041666667,beatTime:597.0837612907925},{secTime:332.04622916666665,beatTime:603.0837612907925},{secTime:336.89547916666663,beatTime:612.0837612907925},{secTime:338.3669791666667,beatTime:615},{secTime:338.5878333333333,beatTime:615.4069568452381},{secTime:343.47210416666667,beatTime:624.4069568452381},{secTime:346.70525,beatTime:630.4069568452381},{secTime:351.5108333333333,beatTime:639.4069568452381},{secTime:353.1265833333333,beatTime:642.4069568452381},{secTime:361.29745833333334,beatTime:657.4069568452381},{secTime:361.31451280381947,beatTime:657.4382068452381}]};var Fy=ht.Bb,ky={lowestFret:0,fretsCount:6},US=fe.fromData({key:Fy,name:"Solo bombarde",initial:"B",duration:"4m",fretboard:ky}),mi=fe.fromData({key:Fy,name:"Couplet",chords:"| Bb | Bb | Eb | Bb | Bb | Bb | F | F | Bb | Bb | Eb | Bb | Bb | Bb | F | F | Eb | Eb | Bb | Bb | F | Eb | Bb | Bb |",fretboard:ky}),Oa=fe.fromData({key:Fy,name:"Refrain",chords:"| G | G | D | D | Eb | Eb | Bb | Bb | G | G | D | D | Eb | Eb | Bb | Bb |",fretboard:ky}),FV=[US,mi,mi,mi,mi,Oa,Oa,Oa,mi,mi,Oa,Oa,Oa,mi,US,mi,mi],kV=Jt.builder().stuctureObject(jS).patterns(FV).build(),qS={name:"Surcouf",structure:kV};var $S={sampleDuration:283.10864583333336,warpMarkers:[{secTime:0,beatTime:-14.87709347943723},{secTime:7.551666666666667,beatTime:0},{secTime:38.2276875,beatTime:64},{secTime:38.45735416666667,beatTime:64.46719790626041},{secTime:42.39002083333333,beatTime:72.46719790626041},{secTime:45.94810416666667,beatTime:80},{secTime:46.15141666666666,beatTime:80.42164606227107},{secTime:50.008916666666664,beatTime:88.42164606227107},{secTime:55.75929166666666,beatTime:100.42164606227107},{secTime:61.477062499999995,beatTime:112.42164606227107},{secTime:65.26477083333333,beatTime:120.42164606227107},{secTime:69.02708333333334,beatTime:128.42164606227107},{secTime:74.66047916666666,beatTime:140.42164606227107},{secTime:78.450375,beatTime:148.42164606227107},{secTime:84.1599375,beatTime:160.42164606227107},{secTime:91.810375,beatTime:176.42164606227107},{secTime:93.712625,beatTime:180.42164606227107},{secTime:95.60175,beatTime:184.42164606227107},{secTime:97.4788125,beatTime:188.42164606227107},{secTime:99.10685416666666,beatTime:192},{secTime:114.64177083333333,beatTime:208},{secTime:130.38116666666667,beatTime:224},{secTime:145.69397916666665,beatTime:256},{secTime:160.9465625,beatTime:288},{secTime:191.22304166666666,beatTime:352},{secTime:222.56958333333333,beatTime:384},{secTime:238.12291666666667,beatTime:416},{secTime:241.330625,beatTime:420},{secTime:243.34139583333334,beatTime:424},{secTime:251.14045833333333,beatTime:440},{secTime:258.7989166666667,beatTime:456},{secTime:266.45824999999996,beatTime:472},{secTime:274.1059583333333,beatTime:488},{secTime:274.1134959310165,beatTime:488.03125}]};var Fa=ht.Cm,Nh={lowestFret:1,fretsCount:5},zt=fe.fromData({key:Fa,name:"Couplet",chords:"| G | Bb | F | F |",fretboard:Nh}),Qi=fe.fromData({key:Fa,name:"Couplet (Eb)",initial:"C'",chords:"| Eb | G | F | F |",fretboard:Nh}),Mh=fe.fromData({key:Fa,name:"Refrain",chords:"| C | G | Bb | F |",fretboard:Nh}),PV=fe.fromData({key:Fa,name:"Bloqu\xE9e",duration:"1m"}),VV=fe.fromData({key:Fa,name:"Break batterie",duration:"1m"}),LV=fe.fromData({key:Fa,name:"Fin",chords:"| G |",fretboard:Nh}),BV=[zt,zt,Qi,Qi,zt,zt,Qi,Qi,zt,zt,zt,zt,Mh,Mh,zt,zt,Qi,Qi,zt,zt,zt,zt,Mh,Mh,zt,zt,PV,VV,zt,zt,Qi,Qi,LV],jV=Jt.builder().stuctureObject($S).patterns(BV).build(),HS={name:"Le jour (le phare)",structure:jV};var GS={sampleDuration:197,warpMarkers:[{secTime:0,beatTime:-.8124305382117882},{secTime:.4874583333333333,beatTime:0},{secTime:16.617874999999998,beatTime:32},{secTime:32.5,beatTime:64},{secTime:48.40141666666666,beatTime:96},{secTime:64.38291666666666,beatTime:128},{secTime:80.41875,beatTime:160},{secTime:88.55091666666667,beatTime:176},{secTime:92.64445833333333,beatTime:184},{secTime:96.5581875,beatTime:192},{secTime:112.64314583333334,beatTime:224},{secTime:116.72545833333334,beatTime:232},{secTime:124.68491666666667,beatTime:248},{secTime:128.59675,beatTime:256},{secTime:144.51929166666667,beatTime:288},{secTime:168.65872916666666,beatTime:336},{secTime:176.70497916666667,beatTime:352},{secTime:190.65445833333334,beatTime:380},{secTime:192.58866666666665,beatTime:384},{secTime:192.60741666707017,beatTime:384.03125}]};var Oh=ht.Cm,Ry={lowestFret:1,fretsCount:6},Xr=fe.fromData({key:Oh,name:"Couplet",chords:"| G | G | Bb | Bb | D | Eb | Bb | F |",fretboard:Ry}),WS=fe.fromData({key:Oh,name:"Refrain",chords:"| C | C | G | G | C | C | D |",fretboard:Ry}),zS=fe.fromData({key:Oh,name:"Silence",duration:"1m"}),qV=fe.fromData({key:Oh,name:"Fin",chords:"| G |",fretboard:Ry}),$V=[Xr,Xr,Xr,Xr,Xr,WS,zS,Xr,Xr,Xr,Xr,WS,zS,Xr,qV],HV=Jt.builder().stuctureObject(GS).patterns($V).build(),YS={name:"Le r\xE9sistant",structure:HV};var ZS={sampleDuration:185.60035416666668,warpMarkers:[{secTime:0,beatTime:-2.2997661192973693},{secTime:.8784166666666666,beatTime:0},{secTime:6.8019791666666665,beatTime:16},{secTime:12.905208333333333,beatTime:32},{secTime:25.032791666666665,beatTime:64},{secTime:37.25477083333333,beatTime:96},{secTime:49.66683333333333,beatTime:128},{secTime:61.934625,beatTime:160},{secTime:74.08143749999999,beatTime:192},{secTime:86.46016666666667,beatTime:224},{secTime:98.69770833333332,beatTime:256},{secTime:111.03422916666666,beatTime:288},{secTime:123.28531249999999,beatTime:320},{secTime:135.49777083333333,beatTime:352},{secTime:147.93939583333332,beatTime:384},{secTime:151.2485,beatTime:392},{secTime:153.70666666666665,beatTime:396},{secTime:155.90406249999998,beatTime:400},{secTime:157.94277083333333,beatTime:404},{secTime:159.982375,beatTime:408},{secTime:161.9501875,beatTime:412},{secTime:163.83564583333333,beatTime:416},{secTime:165.64431249999998,beatTime:420},{secTime:167.2971875,beatTime:424},{secTime:173.294875,beatTime:440},{secTime:179.38589583333334,beatTime:456},{secTime:213.89711263469778,beatTime:557.7002338807026},{secTime:213.91220199013253,beatTime:557.7314838807026}]};var lu=ht.Cm,kh={lowestFret:1,fretsCount:5},an=fe.fromData({key:lu,name:"Intro",chords:"| C | G | Eb | Bb |",fretboard:kh}),Ki=fe.fromData({key:lu,name:"Couplet",chords:"| G | Bb | F | Eb |",fretboard:kh}),Fh=fe.fromData({key:lu,name:"Refrain",chords:"| Eb | Bb | C | G |",fretboard:kh}),WV=fe.fromData({key:lu,name:"Silence",duration:"2m"}),zV=fe.fromData({key:lu,name:"Fin",chords:"| C |",fretboard:kh}),YV=[an,an,an,an,Ki,Ki,an,an,Ki,Ki,Fh,Fh,an,an,Ki,Ki,an,an,Ki,Ki,Fh,Fh,an,an,WV,an,an,an,an,zV],ZV=Jt.builder().stuctureObject(ZS).patterns(YV).build(),QS={name:"Noyer le silence",structure:ZV};var KS={sampleDuration:273.96295833333335,warpMarkers:[{secTime:0,beatTime:-.7827300303862804},{secTime:.42395837309788215,beatTime:0},{secTime:17.701291666666666,beatTime:64},{secTime:30.922270833333332,beatTime:112},{secTime:49.082541666666664,beatTime:176},{secTime:66.80204166666667,beatTime:240},{secTime:71.44810416666667,beatTime:256},{secTime:75.98356249999999,beatTime:272},{secTime:78.25212499999999,beatTime:280},{secTime:79.38366666666667,beatTime:284},{secTime:80.44440520387778,beatTime:288},{secTime:80.90841666666667,beatTime:290},{secTime:85.04110416666667,beatTime:304},{secTime:89.59554166666666,beatTime:320},{secTime:94.15424999999999,beatTime:336},{secTime:96.50452083333333,beatTime:344},{secTime:98.6989375,beatTime:352},{secTime:116.77741666666667,beatTime:416},{secTime:125.7705625,beatTime:448},{secTime:143.68041666666667,beatTime:512},{secTime:152.68768749999998,beatTime:544},{secTime:157.23129166666666,beatTime:560},{secTime:161.73185416666666,beatTime:576},{secTime:166.23175,beatTime:592},{secTime:184.92158333333333,beatTime:656},{secTime:202.97295833333334,beatTime:720},{secTime:217.38062499999998,beatTime:768},{secTime:236.63854166666667,beatTime:832},{secTime:255.14091666666667,beatTime:896},{secTime:257.5819583333333,beatTime:904},{secTime:259.93664583333333,beatTime:912},{secTime:262.32047916666664,beatTime:920},{secTime:263.4732916666667,beatTime:924},{secTime:264.54720833333334,beatTime:928},{secTime:264.61854869968425,beatTime:928.03125}]};var $o=ht.Gm,Ho={lowestFret:1,fretsCount:6},ye=fe.fromData({key:$o,name:"Intro",chords:"| G | C |",fretboard:Ho}),KV=fe.fromData({key:$o,name:"Fin",chords:"| G |",fretboard:Ho}),ir=fe.fromData({key:$o,name:"Couplet",chords:"| G | C | Gb | D |",fretboard:Ho}),or=fe.fromData({key:$o,name:"Refrain",chords:"| Eb | Bb | F | F |",fretboard:Ho}),Rh=fe.fromData({key:$o,name:"Refrain (fin)",initial:"R'",chords:"| Eb | Bb | D | D |",fretboard:Ho}),Xi=fe.fromData({key:$o,name:"Solo (base)",initial:"Sb",chords:"| G | C |",fretboard:Ho}),Ji=fe.fromData({key:$o,name:"Solo (accords)",initial:"Sa",chords:"| G | C |",fretboard:Ho}),XV=[ye,ye,ye,ye,ye,ye,ye,ye,ir,ir,ir,or,or,or,Rh,ye,ye,ye,ye,ye,ye,ye,ye,ir,ir,ir,or,or,or,Rh,ye,ye,ye,ye,ye,ye,ye,ye,Xi,Xi,Xi,Xi,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Xi,Xi,Xi,Xi,ir,ir,ir,or,or,or,Rh,ye,ye,ye,ye,ye,ye,ye,ye,ir,ir,ir,or,or,or,Rh,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,KV],JV=Jt.builder().stuctureObject(KS).patterns(XV).build(),XS={name:"Nuages blancs",structure:JV};function eL(t,e){if(t&1){let n=It();ze(0),Ee(1,"input",1),Pe("change",function(i){et(n);let o=re();return tt(o.uploadFile(i))}),Se(),Be(2,"br"),Ye()}}function tL(t,e){if(t&1){let n=It();Ee(0,"button",3),Pe("click",function(){et(n);let i=re(2);return tt(i.playSong())}),je(1,"\u23F5"),Se()}}function nL(t,e){if(t&1){let n=It();Ee(0,"button",3),Pe("click",function(){et(n);let i=re(2);return tt(i.pauseSong())}),je(1,"\u23F8"),Se()}}function rL(t,e){if(t&1){let n=It();ze(0),je(1),Re(2,tL,2,0,"button",2)(3,nL,2,0,"button",2),Ee(4,"button",3),Pe("click",function(){et(n);let i=re();return tt(i.stopSong())}),je(5,"\u23F9"),Se(),Be(6,"br"),je(7),Be(8,"br"),Ee(9,"input",4),Pe("change",function(i){et(n);let o=re();return tt(o.setProgress(i))}),Se(),Be(10,"br"),Ye()}if(t&2){let n=re();ee(1),_t(" ",n.timecode," "),ee(1),ne("ngIf",!n.playing),ee(1),ne("ngIf",n.playing),ee(4),Jp(" ",n.transportBeatTime," - ",n.transportSeconds," "),ee(2),ne("value",n.progress)}}function iL(t,e){if(t&1&&(ze(0),je(1),Ye()),t&2){let n=e.$implicit;ee(1),_t(" ",n.toAscii()," ")}}function oL(t,e){if(t&1&&(ze(0),je(1),Ye()),t&2){let n=re(3);ee(1),_t(" ",n.currentPatternInStructure.pattern.duration.toBars(),"m ")}}function sL(t,e){if(t&1&&Be(0,"app-fretboard",7),t&2){let n=re(3);ne("lowestFret",n.currentPatternInStructure.pattern.fretboard.lowestFret)("fretsCount",n.currentPatternInStructure.pattern.fretboard.fretsCount)("key",n.currentPatternInStructure.pattern.key)("currentNote",n.currentChord==null?null:n.currentChord.root)}}function aL(t,e){if(t&1){let n=It();Ee(0,"app-rythm-bar",10),Pe("addEvent",function(i){et(n);let o=re(5);return tt(o.addEvent(i))})("removeEvent",function(i){et(n);let o=re(5);return tt(o.removeEvent(i))}),Se()}if(t&2){let n=re().$implicit,r=re(4);ne("number",n)("events",r.currentPatternInStructure.pattern.events)("timecode",r.rythmBarTimecode)}}function cL(t,e){if(t&1&&(ze(0),Re(1,aL,1,3,"app-rythm-bar",9),Be(2,"br"),Ye()),t&2){let n=re(4);ee(1),ne("ngIf",n.currentPatternInStructure.pattern.events==null?null:n.currentPatternInStructure.pattern.events.length)}}function uL(t,e){if(t&1&&(ze(0),Re(1,cL,3,1,"ng-container",8),Ye()),t&2){let n=re(3);ee(1),ne("ngForOf",n.sequence(n.currentPatternInStructure.eventsDurationInBars,n.currentPatternInStructure.eventsStartTime.toBars()+1))}}function lL(t,e){if(t&1&&(ze(0),je(1),Be(2,"br"),je(3),Be(4,"br"),Re(5,iL,2,1,"ng-container",0)(6,oL,2,1,"ng-container",0),Be(7,"br"),Re(8,sL,1,4,"app-fretboard",6)(9,uL,2,1,"ng-container",0),Ye()),t&2){let n=re(2);ee(1),_t(" ",n.currentPatternInStructure.pattern.name,""),ee(2),_t(" ",n.currentPatternInStructureRelativeTimecode,""),ee(2),ne("ngIf",n.currentPatternInStructure.pattern.chords),ee(1),ne("ngIf",!n.currentPatternInStructure.pattern.chords),ee(2),ne("ngIf",n.currentPatternInStructure.pattern.fretboard&&n.currentPatternInStructure.pattern.fretboard.lowestFret!=null&&n.currentPatternInStructure.pattern.fretboard.fretsCount!=null),ee(1),ne("ngIf",n.currentPatternInStructure.eventsStartTime)}}function dL(t,e){if(t&1){let n=It();ze(0),je(1," Gm "),Ee(2,"app-structure",5),Pe("clickPatternInStructure",function(i){et(n);let o=re();return tt(o.onClickPatternInStructure(i))}),Se(),Be(3,"br"),Re(4,lL,10,6,"ng-container",0),Ye()}if(t&2){let n=re();ee(2),ne("structure",n.structure)("currentPatternInStructure",n.currentPatternInStructure),ee(2),ne("ngIf",n.currentPatternInStructure)}}var JS=(()=>{let e=class e{constructor(r,i,o){this.changeDetectorRef=r,this.progress=0,this.songEntries=[],this.sequence=Lr,this.sampleIsLoaded=!1,this.songEntries.push(gh),this.songEntries.push(BS),this.songEntries.push(qS),this.songEntries.push(HS),this.songEntries.push(YS),this.songEntries.push(QS),this.songEntries.push(XS),i.params.subscribe(s=>{this.songName=s.songName,this.songName?o.setTitle(this.songName):Bs("Aucun titre")})}ngOnInit(){let r=this.songEntries.find(i=>this.songNameEquals(i.name));r||Bs("SongEntry inconnu pour "+this.songName),this.structure=r.structure}songNameEquals(r){if(!this.songName)return!1;let i=o=>o.toLowerCase().trim();return i(r)===i(this.songName)}addEvent(r){}removeEvent(r){}uploadFile(r){return Q(this,null,function*(){this.structure||Bs("Aucune structure");let o=r.currentTarget.files;if(!o?.length)return;let s=o[0];console.log("audioFile",s);let a=URL.createObjectURL(s),c=new hi({url:a}).toDestination();ot.bpm.value=120,ot.loop=!0,ot.loopStart=0,ot.loopEnd=this.structure.sampleDuration.toSeconds(),c.sync().start(0);let u=new Vo(l=>{ch.schedule(()=>{this.refresh(l)},l)},"16n").start(0);yield Ca(),yield No(),this.sampleIsLoaded=!0})}refresh(r){if(this.progress=Math.min(Math.max(0,ot.progress),1)*100,this.structure){this.transportSeconds=+ot.seconds.toFixed(3);let i=this.structure.getWarpPosition(ot.seconds);if(i){this.timecode=i.toAbletonLiveBarsBeatsSixteenths(),this.transportBeatTime=+i.toBeatTime().toFixed(0);let o=Je.fromValue(0),s=i.add(o);this.currentPatternInStructure=this.structure.getPatternInStructureAt(s),this.currentChord=this.currentPatternInStructure?.getChordAt(s),this.currentPatternInStructure?(this.currentPatternInStructure.eventsStartTime?this.rythmBarTimecode=s.relativeTo(this.currentPatternInStructure.startTime).mod(this.currentPatternInStructure.eventsDurationInBars).add(this.currentPatternInStructure.eventsStartTime).toAbletonLiveBarsBeatsSixteenths():delete this.rythmBarTimecode,this.currentPatternInStructureRelativeTimecode=s.relativeTo(this.currentPatternInStructure.startTime).toAbletonLiveBarsBeatsSixteenths()):(delete this.rythmBarTimecode,delete this.currentPatternInStructureRelativeTimecode)}else delete this.timecode,delete this.rythmBarTimecode,delete this.currentPatternInStructureRelativeTimecode}this.changeDetectorRef.detectChanges()}playSong(){return Q(this,null,function*(){console.log("playSong"),ot.start()})}pauseSong(){return Q(this,null,function*(){console.log("pauseSong"),ot.pause()})}stopSong(){console.log("stopSong"),ot.stop()}onClickPatternInStructure(r){let i=r.structure.getWrappedTime(r.startTime);if(i){let o=i.toSeconds()/r.structure.sampleDuration.toSeconds();this.setProgressPercent(o*100)}}loopPattern(r){return Q(this,null,function*(){let i=o=>{let s=["C","B","R"].indexOf(o);if(s===-1)return;let c=document.getElementsByTagName("input")?.[s].files?.[0];if(c)return console.log("file",c),URL.createObjectURL(c)}})}setProgress(r){let o=+r.target.value;this.setProgressPercent(o)}setProgressPercent(r){let i=new Je(Sn(r/100*+ot.loopEnd.valueOf(),"s"));ot.position=i.toBarsBeatsSixteenths(),this.refresh()}get playing(){return ot.state==="started"}};e.\u0275fac=function(i){return new(i||e)(ve(zn),ve(ai),ve(lc))},e.\u0275cmp=ut({type:e,selectors:[["app-song"]],standalone:!0,features:[pt],decls:3,vars:3,consts:[[4,"ngIf"],["type","file","accept",".wav,.mp3",3,"change"],[3,"click",4,"ngIf"],[3,"click"],["type","range","min","0","max","100","step","1",3,"value","change"],[3,"structure","currentPatternInStructure","clickPatternInStructure"],[3,"lowestFret","fretsCount","key","currentNote",4,"ngIf"],[3,"lowestFret","fretsCount","key","currentNote"],[4,"ngFor","ngForOf"],[3,"number","events","timecode","addEvent","removeEvent",4,"ngIf"],[3,"number","events","timecode","addEvent","removeEvent"]],template:function(i,o){i&1&&Re(0,eL,3,0,"ng-container",0)(1,rL,11,6,"ng-container",0)(2,dL,5,3,"ng-container",0),i&2&&(ne("ngIf",!o.sampleIsLoaded),ee(1),ne("ngIf",o.sampleIsLoaded),ee(1),ne("ngIf",o.structure))},dependencies:[md,gd,kt,Tn,kr,Ls,hh],styles:["[_nghost-%COMP%]{width:100%}input[type=range][_ngcontent-%COMP%]{width:100%}"]});let t=e;return t})();var e1=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=bn({type:e,bootstrap:[Yb]}),e.\u0275inj=xn({imports:[kt,Px,zb,Eb.forRoot([{path:"",component:FE},{path:"morceaux/:songName",component:JS},{path:"convert",component:NS}])]});let t=e;return t})();Rx().bootstrapModule(e1).catch(t=>console.error(t));