diff --git a/_app/immutable/assets/3.4b59a7fc.css b/_app/immutable/assets/3.4b59a7fc.css new file mode 100644 index 00000000..ad18380b --- /dev/null +++ b/_app/immutable/assets/3.4b59a7fc.css @@ -0,0 +1 @@ +.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.staff.svelte-115d3uv.svelte-115d3uv{font-family:Noto Music,sans-serif;position:relative}.staff.svelte-115d3uv .line.svelte-115d3uv{border-top:.1rem solid #222;margin:.75rem 0}.staff.svelte-115d3uv .line.invisible.svelte-115d3uv{border-color:transparent}.staff.svelte-115d3uv .g-clef.svelte-115d3uv{font-size:3.6rem;bottom:4.2rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-115d3uv .f-clef.svelte-115d3uv{bottom:-.7rem;font-size:3.6rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-115d3uv .note.svelte-115d3uv{font-size:3.6rem;position:absolute}.staff.svelte-115d3uv .target.svelte-115d3uv{display:none;left:6rem}.staff.svelte-115d3uv .played.svelte-115d3uv{display:none;left:9rem}.staff.svelte-115d3uv .ledger-line.svelte-115d3uv{position:relative}.staff.svelte-115d3uv .ledger-line.svelte-115d3uv:after{border-top:.1rem solid #222;bottom:1.35rem;content:" ";display:block;position:absolute;width:1.86rem}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))}.objective.svelte-1dxpmgm{display:flex} diff --git a/_app/immutable/assets/3.9a7776e0.css b/_app/immutable/assets/3.9a7776e0.css deleted file mode 100644 index 0f40bff1..00000000 --- a/_app/immutable/assets/3.9a7776e0.css +++ /dev/null @@ -1 +0,0 @@ -.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.staff.svelte-8yf9w8.svelte-8yf9w8{font-family:Noto Music,sans-serif;position:relative}.staff.svelte-8yf9w8 .line.svelte-8yf9w8{border-top:1.25pt solid #222;margin:.75rem 0}.staff.svelte-8yf9w8 .line.invisible.svelte-8yf9w8{border-color:transparent}.staff.svelte-8yf9w8 .g-clef.svelte-8yf9w8{font-size:3.6rem;bottom:4.2rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-8yf9w8 .f-clef.svelte-8yf9w8{bottom:-.7rem;font-size:3.6rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-8yf9w8 .note.svelte-8yf9w8{font-size:3.1rem;position:absolute}.staff.svelte-8yf9w8 .target.svelte-8yf9w8{display:none;left:6rem}.staff.svelte-8yf9w8 .played.svelte-8yf9w8{display:none;left:9rem}.staff.svelte-8yf9w8 .ledger-line.svelte-8yf9w8{position:relative}.staff.svelte-8yf9w8 .ledger-line.svelte-8yf9w8:after{border-top:1.25pt solid #222;bottom:1.14rem;content:" ";display:block;position:absolute;width:1.65rem}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))}.objective.svelte-1dxpmgm{display:flex} diff --git a/_app/immutable/assets/_page.3s6SborX.css b/_app/immutable/assets/_page.3s6SborX.css deleted file mode 100644 index 0f40bff1..00000000 --- a/_app/immutable/assets/_page.3s6SborX.css +++ /dev/null @@ -1 +0,0 @@ -.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.staff.svelte-8yf9w8.svelte-8yf9w8{font-family:Noto Music,sans-serif;position:relative}.staff.svelte-8yf9w8 .line.svelte-8yf9w8{border-top:1.25pt solid #222;margin:.75rem 0}.staff.svelte-8yf9w8 .line.invisible.svelte-8yf9w8{border-color:transparent}.staff.svelte-8yf9w8 .g-clef.svelte-8yf9w8{font-size:3.6rem;bottom:4.2rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-8yf9w8 .f-clef.svelte-8yf9w8{bottom:-.7rem;font-size:3.6rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-8yf9w8 .note.svelte-8yf9w8{font-size:3.1rem;position:absolute}.staff.svelte-8yf9w8 .target.svelte-8yf9w8{display:none;left:6rem}.staff.svelte-8yf9w8 .played.svelte-8yf9w8{display:none;left:9rem}.staff.svelte-8yf9w8 .ledger-line.svelte-8yf9w8{position:relative}.staff.svelte-8yf9w8 .ledger-line.svelte-8yf9w8:after{border-top:1.25pt solid #222;bottom:1.14rem;content:" ";display:block;position:absolute;width:1.65rem}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))}.objective.svelte-1dxpmgm{display:flex} diff --git a/_app/immutable/assets/_page.lm1KPwFM.css b/_app/immutable/assets/_page.lm1KPwFM.css new file mode 100644 index 00000000..ad18380b --- /dev/null +++ b/_app/immutable/assets/_page.lm1KPwFM.css @@ -0,0 +1 @@ +.midi-body.svelte-5m5dii{display:grid;gap:.5rem;grid-template-columns:25% 25% 25%;grid-template-rows:auto;align-items:center}@media (width <= 475px){.midi-body.svelte-5m5dii{grid-template-columns:50% 50%}}.error.svelte-5m5dii{font-size:.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity))}.staff.svelte-115d3uv.svelte-115d3uv{font-family:Noto Music,sans-serif;position:relative}.staff.svelte-115d3uv .line.svelte-115d3uv{border-top:.1rem solid #222;margin:.75rem 0}.staff.svelte-115d3uv .line.invisible.svelte-115d3uv{border-color:transparent}.staff.svelte-115d3uv .g-clef.svelte-115d3uv{font-size:3.6rem;bottom:4.2rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-115d3uv .f-clef.svelte-115d3uv{bottom:-.7rem;font-size:3.6rem;left:1rem;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.staff.svelte-115d3uv .note.svelte-115d3uv{font-size:3.6rem;position:absolute}.staff.svelte-115d3uv .target.svelte-115d3uv{display:none;left:6rem}.staff.svelte-115d3uv .played.svelte-115d3uv{display:none;left:9rem}.staff.svelte-115d3uv .ledger-line.svelte-115d3uv{position:relative}.staff.svelte-115d3uv .ledger-line.svelte-115d3uv:after{border-top:.1rem solid #222;bottom:1.35rem;content:" ";display:block;position:absolute;width:1.86rem}.wrong{color:red}.correct{--tw-text-opacity:1;color:rgb(34 197 94 / var(--tw-text-opacity))}.objective.svelte-1dxpmgm{display:flex} diff --git a/_app/immutable/chunks/singletons.64d20ebf.js b/_app/immutable/chunks/singletons.47934468.js similarity index 72% rename from _app/immutable/chunks/singletons.64d20ebf.js rename to _app/immutable/chunks/singletons.47934468.js index 266fa754..998fd2e5 100644 --- a/_app/immutable/chunks/singletons.64d20ebf.js +++ b/_app/immutable/chunks/singletons.47934468.js @@ -1 +1 @@ -import{w as u}from"./index.7d157e8c.js";var _;const m=((_=globalThis.__sveltekit_1f0ommy)==null?void 0:_.base)??"/practise-music-reading";var g;const k=((g=globalThis.__sveltekit_1f0ommy)==null?void 0:g.assets)??m,w="1705664424802",R="sveltekit:snapshot",T="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||E(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function y(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${k}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function E(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:y()};export{I,f as P,T as S,R as a,U as b,L as c,P as d,m as e,O as f,S as g,N as h,E as i,h as o,x as s}; +import{w as u}from"./index.7d157e8c.js";var _;const k=((_=globalThis.__sveltekit_1j4mf6k)==null?void 0:_.base)??"/practise-music-reading";var g;const m=((g=globalThis.__sveltekit_1j4mf6k)==null?void 0:g.assets)??k,w="1705665785306",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const j={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,j as d,k as e,O as f,S as g,N as h,A as i,h as o,x as s}; diff --git a/_app/immutable/entry/app.bf028d06.js b/_app/immutable/entry/app.742aff23.js similarity index 96% rename from _app/immutable/entry/app.bf028d06.js rename to _app/immutable/entry/app.742aff23.js index 765aaaca..374df007 100644 --- a/_app/immutable/entry/app.bf028d06.js +++ b/_app/immutable/entry/app.742aff23.js @@ -1 +1 @@ -import{s as U,a as j,o as W,t as z,b as L}from"../chunks/scheduler.e80da8ef.js";import{S as F,i as G,s as H,e as m,c as J,a as w,t as p,b as y,d as h,f as d,g as K,h as M,j as Q,k as S,l as E,m as X,n as Y,o as Z,p as R,q as g,r as b,u as P,v as k,w as v}from"../chunks/index.3d76737d.js";const x="modulepreload",ee=function(f,e){return new URL(f,e).href},I={},$=function(e,n,r){if(!n||n.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=ee(a,r),a in I)return;I[a]=!0;const t=a.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!r)for(let l=i.length-1;l>=0;l--){const u=i[l];if(u.href===a&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":x,t||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),t)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=a,window.dispatchEvent(t),!t.defaultPrevented)throw a})},_e={};function te(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],form:t[2]}}}return i&&(e=g(i,a(f)),f[15](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[15](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[15](null),e&&v(e,t)}}}function ne(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],$$slots:{default:[oe]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[14](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[14](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&65591&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[14](null),e&&v(e,t)}}}function ie(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],form:t[2]}}}return i&&(e=g(i,a(f)),f[13](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[13](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[13](null),e&&v(e,t)}}}function se(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],$$slots:{default:[re]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[12](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[12](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&65575&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[12](null),e&&v(e,t)}}}function re(f){let e,n,r;var i=f[1][2];function a(t,o){return{props:{data:t[5],form:t[2]}}}return i&&(e=g(i,a(f)),f[11](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][2])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[11](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&32&&(s.data=t[5]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[11](null),e&&v(e,t)}}}function oe(f){let e,n,r,i;const a=[se,ie],t=[];function o(s,c){return s[1][2]?0:1}return e=o(f),n=t[e]=a[e](f),{c(){n.c(),r=m()},l(s){n.l(s),r=m()},m(s,c){t[e].m(s,c),w(s,r,c),i=!0},p(s,c){let l=e;e=o(s),e===l?t[e].p(s,c):(R(),p(t[l],1,1,()=>{t[l]=null}),y(),n=t[e],n?n.p(s,c):(n=t[e]=a[e](s),n.c()),h(n,1),n.m(r.parentNode,r))},i(s){i||(h(n),i=!0)},o(s){p(n),i=!1},d(s){s&&d(r),t[e].d(s)}}}function O(f){let e,n=f[7]&&T(f);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=M(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=Q(e);n&&n.l(i),i.forEach(d),this.h()},h(){S(e,"id","svelte-announcer"),S(e,"aria-live","assertive"),S(e,"aria-atomic","true"),E(e,"position","absolute"),E(e,"left","0"),E(e,"top","0"),E(e,"clip","rect(0 0 0 0)"),E(e,"clip-path","inset(50%)"),E(e,"overflow","hidden"),E(e,"white-space","nowrap"),E(e,"width","1px"),E(e,"height","1px")},m(r,i){w(r,e,i),n&&n.m(e,null)},p(r,i){r[7]?n?n.p(r,i):(n=T(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&d(e),n&&n.d()}}}function T(f){let e;return{c(){e=X(f[8])},l(n){e=Y(n,f[8])},m(n,r){w(n,e,r)},p(n,r){r&256&&Z(e,n[8])},d(n){n&&d(e)}}}function fe(f){let e,n,r,i,a;const t=[ne,te],o=[];function s(l,u){return l[1][1]?0:1}e=s(f),n=o[e]=t[e](f);let c=f[6]&&O(f);return{c(){n.c(),r=H(),c&&c.c(),i=m()},l(l){n.l(l),r=J(l),c&&c.l(l),i=m()},m(l,u){o[e].m(l,u),w(l,r,u),c&&c.m(l,u),w(l,i,u),a=!0},p(l,[u]){let N=e;e=s(l),e===N?o[e].p(l,u):(R(),p(o[N],1,1,()=>{o[N]=null}),y(),n=o[e],n?n.p(l,u):(n=o[e]=t[e](l),n.c()),h(n,1),n.m(r.parentNode,r)),l[6]?c?c.p(l,u):(c=O(l),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i(l){a||(h(n),a=!0)},o(l){p(n),a=!1},d(l){l&&(d(r),d(i)),o[e].d(l),c&&c.d(l)}}}function ae(f,e,n){let{stores:r}=e,{page:i}=e,{constructors:a}=e,{components:t=[]}=e,{form:o}=e,{data_0:s=null}=e,{data_1:c=null}=e,{data_2:l=null}=e;j(r.page.notify);let u=!1,N=!1,D=null;W(()=>{const _=r.page.subscribe(()=>{u&&(n(7,N=!0),z().then(()=>{n(8,D=document.title||"untitled page")}))});return n(6,u=!0),_});function V(_){L[_?"unshift":"push"](()=>{t[2]=_,n(0,t)})}function A(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function C(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function q(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function B(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return f.$$set=_=>{"stores"in _&&n(9,r=_.stores),"page"in _&&n(10,i=_.page),"constructors"in _&&n(1,a=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,o=_.form),"data_0"in _&&n(3,s=_.data_0),"data_1"in _&&n(4,c=_.data_1),"data_2"in _&&n(5,l=_.data_2)},f.$$.update=()=>{f.$$.dirty&1536&&r.page.set(i)},[t,a,o,s,c,l,u,N,D,r,i,V,A,C,q,B]}class ue extends F{constructor(e){super(),G(this,e,ae,fe,U,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const me=[()=>$(()=>import("../nodes/0.7cc727eb.js"),["../nodes/0.7cc727eb.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.b9bd0710.css"],import.meta.url),()=>$(()=>import("../nodes/1.e3107bad.js"),["../nodes/1.e3107bad.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/singletons.64d20ebf.js","../chunks/index.7d157e8c.js"],import.meta.url),()=>$(()=>import("../nodes/2.e0dcdf55.js"),["../nodes/2.e0dcdf55.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.b9bd0710.css"],import.meta.url),()=>$(()=>import("../nodes/3.247e9824.js"),["../nodes/3.247e9824.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/index.7d157e8c.js","../assets/3.9a7776e0.css"],import.meta.url)],pe=[],he={"/(site)":[3,[2]]},de={handleError:({error:f})=>{console.error(f)}};export{he as dictionary,de as hooks,_e as matchers,me as nodes,ue as root,pe as server_loads}; +import{s as U,a as j,o as W,t as z,b as L}from"../chunks/scheduler.e80da8ef.js";import{S as F,i as G,s as H,e as m,c as J,a as w,t as p,b as y,d as h,f as d,g as K,h as M,j as Q,k as S,l as E,m as X,n as Y,o as Z,p as R,q as g,r as b,u as P,v as k,w as v}from"../chunks/index.3d76737d.js";const x="modulepreload",ee=function(f,e){return new URL(f,e).href},I={},$=function(e,n,r){if(!n||n.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=ee(a,r),a in I)return;I[a]=!0;const t=a.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!r)for(let l=i.length-1;l>=0;l--){const u=i[l];if(u.href===a&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":x,t||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),t)return new Promise((l,u)=>{c.addEventListener("load",l),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=a,window.dispatchEvent(t),!t.defaultPrevented)throw a})},_e={};function te(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],form:t[2]}}}return i&&(e=g(i,a(f)),f[15](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[15](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[15](null),e&&v(e,t)}}}function ne(f){let e,n,r;var i=f[1][0];function a(t,o){return{props:{data:t[3],$$slots:{default:[oe]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[14](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][0])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[14](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&8&&(s.data=t[3]),o&65591&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[14](null),e&&v(e,t)}}}function ie(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],form:t[2]}}}return i&&(e=g(i,a(f)),f[13](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[13](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[13](null),e&&v(e,t)}}}function se(f){let e,n,r;var i=f[1][1];function a(t,o){return{props:{data:t[4],$$slots:{default:[re]},$$scope:{ctx:t}}}}return i&&(e=g(i,a(f)),f[12](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][1])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[12](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&16&&(s.data=t[4]),o&65575&&(s.$$scope={dirty:o,ctx:t}),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[12](null),e&&v(e,t)}}}function re(f){let e,n,r;var i=f[1][2];function a(t,o){return{props:{data:t[5],form:t[2]}}}return i&&(e=g(i,a(f)),f[11](e)),{c(){e&&b(e.$$.fragment),n=m()},l(t){e&&P(e.$$.fragment,t),n=m()},m(t,o){e&&k(e,t,o),w(t,n,o),r=!0},p(t,o){if(o&2&&i!==(i=t[1][2])){if(e){R();const s=e;p(s.$$.fragment,1,0,()=>{v(s,1)}),y()}i?(e=g(i,a(t)),t[11](e),b(e.$$.fragment),h(e.$$.fragment,1),k(e,n.parentNode,n)):e=null}else if(i){const s={};o&32&&(s.data=t[5]),o&4&&(s.form=t[2]),e.$set(s)}},i(t){r||(e&&h(e.$$.fragment,t),r=!0)},o(t){e&&p(e.$$.fragment,t),r=!1},d(t){t&&d(n),f[11](null),e&&v(e,t)}}}function oe(f){let e,n,r,i;const a=[se,ie],t=[];function o(s,c){return s[1][2]?0:1}return e=o(f),n=t[e]=a[e](f),{c(){n.c(),r=m()},l(s){n.l(s),r=m()},m(s,c){t[e].m(s,c),w(s,r,c),i=!0},p(s,c){let l=e;e=o(s),e===l?t[e].p(s,c):(R(),p(t[l],1,1,()=>{t[l]=null}),y(),n=t[e],n?n.p(s,c):(n=t[e]=a[e](s),n.c()),h(n,1),n.m(r.parentNode,r))},i(s){i||(h(n),i=!0)},o(s){p(n),i=!1},d(s){s&&d(r),t[e].d(s)}}}function O(f){let e,n=f[7]&&T(f);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=M(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var i=Q(e);n&&n.l(i),i.forEach(d),this.h()},h(){S(e,"id","svelte-announcer"),S(e,"aria-live","assertive"),S(e,"aria-atomic","true"),E(e,"position","absolute"),E(e,"left","0"),E(e,"top","0"),E(e,"clip","rect(0 0 0 0)"),E(e,"clip-path","inset(50%)"),E(e,"overflow","hidden"),E(e,"white-space","nowrap"),E(e,"width","1px"),E(e,"height","1px")},m(r,i){w(r,e,i),n&&n.m(e,null)},p(r,i){r[7]?n?n.p(r,i):(n=T(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&d(e),n&&n.d()}}}function T(f){let e;return{c(){e=X(f[8])},l(n){e=Y(n,f[8])},m(n,r){w(n,e,r)},p(n,r){r&256&&Z(e,n[8])},d(n){n&&d(e)}}}function fe(f){let e,n,r,i,a;const t=[ne,te],o=[];function s(l,u){return l[1][1]?0:1}e=s(f),n=o[e]=t[e](f);let c=f[6]&&O(f);return{c(){n.c(),r=H(),c&&c.c(),i=m()},l(l){n.l(l),r=J(l),c&&c.l(l),i=m()},m(l,u){o[e].m(l,u),w(l,r,u),c&&c.m(l,u),w(l,i,u),a=!0},p(l,[u]){let N=e;e=s(l),e===N?o[e].p(l,u):(R(),p(o[N],1,1,()=>{o[N]=null}),y(),n=o[e],n?n.p(l,u):(n=o[e]=t[e](l),n.c()),h(n,1),n.m(r.parentNode,r)),l[6]?c?c.p(l,u):(c=O(l),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},i(l){a||(h(n),a=!0)},o(l){p(n),a=!1},d(l){l&&(d(r),d(i)),o[e].d(l),c&&c.d(l)}}}function ae(f,e,n){let{stores:r}=e,{page:i}=e,{constructors:a}=e,{components:t=[]}=e,{form:o}=e,{data_0:s=null}=e,{data_1:c=null}=e,{data_2:l=null}=e;j(r.page.notify);let u=!1,N=!1,D=null;W(()=>{const _=r.page.subscribe(()=>{u&&(n(7,N=!0),z().then(()=>{n(8,D=document.title||"untitled page")}))});return n(6,u=!0),_});function V(_){L[_?"unshift":"push"](()=>{t[2]=_,n(0,t)})}function A(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function C(_){L[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function q(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function B(_){L[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return f.$$set=_=>{"stores"in _&&n(9,r=_.stores),"page"in _&&n(10,i=_.page),"constructors"in _&&n(1,a=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,o=_.form),"data_0"in _&&n(3,s=_.data_0),"data_1"in _&&n(4,c=_.data_1),"data_2"in _&&n(5,l=_.data_2)},f.$$.update=()=>{f.$$.dirty&1536&&r.page.set(i)},[t,a,o,s,c,l,u,N,D,r,i,V,A,C,q,B]}class ue extends F{constructor(e){super(),G(this,e,ae,fe,U,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const me=[()=>$(()=>import("../nodes/0.7cc727eb.js"),["../nodes/0.7cc727eb.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.b9bd0710.css"],import.meta.url),()=>$(()=>import("../nodes/1.40fe253f.js"),["../nodes/1.40fe253f.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/singletons.47934468.js","../chunks/index.7d157e8c.js"],import.meta.url),()=>$(()=>import("../nodes/2.e0dcdf55.js"),["../nodes/2.e0dcdf55.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../assets/tailwind.b9bd0710.css"],import.meta.url),()=>$(()=>import("../nodes/3.7ec0ec65.js"),["../nodes/3.7ec0ec65.js","../chunks/scheduler.e80da8ef.js","../chunks/index.3d76737d.js","../chunks/index.7d157e8c.js","../assets/3.4b59a7fc.css"],import.meta.url)],pe=[],he={"/(site)":[3,[2]]},de={handleError:({error:f})=>{console.error(f)}};export{he as dictionary,de as hooks,_e as matchers,me as nodes,ue as root,pe as server_loads}; diff --git a/_app/immutable/entry/start.51002488.js b/_app/immutable/entry/start.394a0d9e.js similarity index 99% rename from _app/immutable/entry/start.51002488.js rename to _app/immutable/entry/start.394a0d9e.js index 248a4a31..79a4901e 100644 --- a/_app/immutable/entry/start.51002488.js +++ b/_app/immutable/entry/start.394a0d9e.js @@ -1,3 +1,3 @@ -import{o as me,t as we}from"../chunks/scheduler.e80da8ef.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,e as G,P as Ve,h as Ze}from"../chunks/singletons.64d20ebf.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` +import{o as me,t as we}from"../chunks/scheduler.e80da8ef.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,e as G,P as Ve,h as Ze}from"../chunks/singletons.47934468.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` `:g.decode(R);;){const C=d.indexOf(` `);if(C===-1)break;const U=JSON.parse(d.slice(0,C));if(d=d.slice(C+1),U.type==="redirect")return u(U);if(U.type==="data")(j=U.nodes)==null||j.forEach(D=>{(D==null?void 0:D.type)==="data"&&(D.uses=Ye(D.uses),D.data=m(D.data))}),u(U);else if(U.type==="chunk"){const{id:D,data:z,error:q}=U,x=E.get(D);E.delete(D),q?x.reject(m(q)):x.fulfil(m(z))}}}})}function Ye(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const h=[];for(let u=0;u{if(i.rangeCount===h.length){for(let u=0;u{h=d,u=j});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:i,complete:E},fulfil:h,reject:u}}async function xt(t,r,f){const i=Lt(t,r);Ze({client:i}),f?await i._hydrate(f):i.goto(location.href,{replaceState:!0}),i._start_router()}export{xt as start}; diff --git a/_app/immutable/nodes/1.e3107bad.js b/_app/immutable/nodes/1.40fe253f.js similarity index 93% rename from _app/immutable/nodes/1.e3107bad.js rename to _app/immutable/nodes/1.40fe253f.js index 2432fed3..ed1790ee 100644 --- a/_app/immutable/nodes/1.e3107bad.js +++ b/_app/immutable/nodes/1.40fe253f.js @@ -1 +1 @@ -import{s as x,n as _,e as S}from"../chunks/scheduler.e80da8ef.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.3d76737d.js";import{d as H}from"../chunks/singletons.64d20ebf.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; +import{s as x,n as _,e as S}from"../chunks/scheduler.e80da8ef.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.3d76737d.js";import{d as H}from"../chunks/singletons.47934468.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; diff --git a/_app/immutable/nodes/3.247e9824.js b/_app/immutable/nodes/3.7ec0ec65.js similarity index 89% rename from _app/immutable/nodes/3.247e9824.js rename to _app/immutable/nodes/3.7ec0ec65.js index d250e2b5..86478eca 100644 --- a/_app/immutable/nodes/3.247e9824.js +++ b/_app/immutable/nodes/3.7ec0ec65.js @@ -1,4 +1,4 @@ -var Ke=Object.defineProperty;var Je=(i,e,t)=>e in i?Ke(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ge=(i,e,t)=>(Je(i,typeof e!="symbol"?e+"":e,t),t);import{s as Me,f as _e,n as me,r as Ye,e as ve,h as Ne,i as ye,b as De,j as Qe,o as Xe}from"../chunks/scheduler.e80da8ef.js";import{S as Ie,i as Ae,g as u,s as C,h as m,j as I,y as G,c as T,f as E,k as p,a as L,x as d,z as be,A as $,m as W,n as K,o as fe,r as Be,u as Le,v as xe,d as Ue,t as Pe,w as Ge}from"../chunks/index.3d76737d.js";import{w as Ce}from"../chunks/index.7d157e8c.js";class J{constructor(e=!1){this.eventMap={},this.eventsSuspended=e==!0}addListener(e,t,n={}){if(typeof e=="string"&&e.length<1||e instanceof String&&e.length<1||typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(typeof t!="function")throw new TypeError("The callback must be a function.");const r=new ke(e,this,t,n);return this.eventMap[e]||(this.eventMap[e]=[]),n.prepend?this.eventMap[e].unshift(r):this.eventMap[e].push(r),r}addOneTimeListener(e,t,n={}){n.remaining=1,this.addListener(e,t,n)}static get ANY_EVENT(){return Symbol.for("Any event")}hasListener(e,t){return e===void 0?this.eventMap[J.ANY_EVENT]&&this.eventMap[J.ANY_EVENT].length>0?!0:Object.entries(this.eventMap).some(([,n])=>n.length>0):this.eventMap[e]&&this.eventMap[e].length>0?t instanceof ke?this.eventMap[e].filter(r=>r===t).length>0:typeof t=="function"?this.eventMap[e].filter(r=>r.callback===t).length>0:t==null:!1}get eventNames(){return Object.keys(this.eventMap)}getListeners(e){return this.eventMap[e]||[]}suspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!0})}unsuspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!1})}getListenerCount(e){return this.getListeners(e).length}emit(e,...t){if(typeof e!="string"&&!(e instanceof String))throw new TypeError("The 'event' parameter must be a string.");if(this.eventsSuspended)return;let n=[],r=this.eventMap[J.ANY_EVENT]||[];return this.eventMap[e]&&(r=r.concat(this.eventMap[e])),r.forEach(s=>{if(s.suspended)return;let l=[...t];Array.isArray(s.arguments)&&(l=l.concat(s.arguments)),s.remaining>0&&(n.push(s.callback.apply(s.context,l)),s.count++),--s.remaining<1&&s.remove()}),n}removeListener(e,t,n={}){if(e===void 0){this.eventMap={};return}else if(!this.eventMap[e])return;let r=this.eventMap[e].filter(s=>t&&s.callback!==t||n.remaining&&n.remaining!==s.remaining||n.context&&n.context!==s.context);r.length?this.eventMap[e]=r:delete this.eventMap[e]}async waitFor(e,t={}){return t.duration=parseInt(t.duration),(isNaN(t.duration)||t.duration<=0)&&(t.duration=1/0),new Promise((n,r)=>{let s,l=this.addListener(e,()=>{clearTimeout(s),n()},{remaining:1});t.duration!==1/0&&(s=setTimeout(()=>{l.remove(),r("The duration expired before the event was emitted.")},t.duration))})}get eventCount(){return Object.keys(this.eventMap).length}}class ke{constructor(e,t,n,r={}){if(typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(!t)throw new ReferenceError("The 'target' parameter is mandatory.");if(typeof n!="function")throw new TypeError("The 'callback' must be a function.");r.arguments!==void 0&&!Array.isArray(r.arguments)&&(r.arguments=[r.arguments]),r=Object.assign({context:t,remaining:1/0,arguments:void 0,duration:1/0},r),r.duration!==1/0&&setTimeout(()=>this.remove(),r.duration),this.arguments=r.arguments,this.callback=n,this.context=r.context,this.count=0,this.event=e,this.remaining=parseInt(r.remaining)>=1?parseInt(r.remaining):1/0,this.suspended=!1,this.target=t}remove(){this.target.removeListener(this.event,this.callback,{context:this.context,remaining:this.remaining})}}/** +var Ke=Object.defineProperty;var Je=(i,e,t)=>e in i?Ke(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ge=(i,e,t)=>(Je(i,typeof e!="symbol"?e+"":e,t),t);import{s as Me,f as _e,n as me,r as Ye,e as ve,h as Ne,i as ye,b as De,j as Qe,o as Xe}from"../chunks/scheduler.e80da8ef.js";import{S as Ie,i as Ae,g as f,s as C,h as m,j as I,y as G,c as T,f as E,k as p,a as L,x as d,z as be,A as $,m as W,n as K,o as ue,r as Be,u as Le,v as xe,d as Ue,t as Pe,w as Ge}from"../chunks/index.3d76737d.js";import{w as Ce}from"../chunks/index.7d157e8c.js";class J{constructor(e=!1){this.eventMap={},this.eventsSuspended=e==!0}addListener(e,t,n={}){if(typeof e=="string"&&e.length<1||e instanceof String&&e.length<1||typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(typeof t!="function")throw new TypeError("The callback must be a function.");const r=new ke(e,this,t,n);return this.eventMap[e]||(this.eventMap[e]=[]),n.prepend?this.eventMap[e].unshift(r):this.eventMap[e].push(r),r}addOneTimeListener(e,t,n={}){n.remaining=1,this.addListener(e,t,n)}static get ANY_EVENT(){return Symbol.for("Any event")}hasListener(e,t){return e===void 0?this.eventMap[J.ANY_EVENT]&&this.eventMap[J.ANY_EVENT].length>0?!0:Object.entries(this.eventMap).some(([,n])=>n.length>0):this.eventMap[e]&&this.eventMap[e].length>0?t instanceof ke?this.eventMap[e].filter(r=>r===t).length>0:typeof t=="function"?this.eventMap[e].filter(r=>r.callback===t).length>0:t==null:!1}get eventNames(){return Object.keys(this.eventMap)}getListeners(e){return this.eventMap[e]||[]}suspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!0})}unsuspendEvent(e){this.getListeners(e).forEach(t=>{t.suspended=!1})}getListenerCount(e){return this.getListeners(e).length}emit(e,...t){if(typeof e!="string"&&!(e instanceof String))throw new TypeError("The 'event' parameter must be a string.");if(this.eventsSuspended)return;let n=[],r=this.eventMap[J.ANY_EVENT]||[];return this.eventMap[e]&&(r=r.concat(this.eventMap[e])),r.forEach(s=>{if(s.suspended)return;let l=[...t];Array.isArray(s.arguments)&&(l=l.concat(s.arguments)),s.remaining>0&&(n.push(s.callback.apply(s.context,l)),s.count++),--s.remaining<1&&s.remove()}),n}removeListener(e,t,n={}){if(e===void 0){this.eventMap={};return}else if(!this.eventMap[e])return;let r=this.eventMap[e].filter(s=>t&&s.callback!==t||n.remaining&&n.remaining!==s.remaining||n.context&&n.context!==s.context);r.length?this.eventMap[e]=r:delete this.eventMap[e]}async waitFor(e,t={}){return t.duration=parseInt(t.duration),(isNaN(t.duration)||t.duration<=0)&&(t.duration=1/0),new Promise((n,r)=>{let s,l=this.addListener(e,()=>{clearTimeout(s),n()},{remaining:1});t.duration!==1/0&&(s=setTimeout(()=>{l.remove(),r("The duration expired before the event was emitted.")},t.duration))})}get eventCount(){return Object.keys(this.eventMap).length}}class ke{constructor(e,t,n,r={}){if(typeof e!="string"&&!(e instanceof String)&&e!==J.ANY_EVENT)throw new TypeError("The 'event' parameter must be a string or EventEmitter.ANY_EVENT.");if(!t)throw new ReferenceError("The 'target' parameter is mandatory.");if(typeof n!="function")throw new TypeError("The 'callback' must be a function.");r.arguments!==void 0&&!Array.isArray(r.arguments)&&(r.arguments=[r.arguments]),r=Object.assign({context:t,remaining:1/0,arguments:void 0,duration:1/0},r),r.duration!==1/0&&setTimeout(()=>this.remove(),r.duration),this.arguments=r.arguments,this.callback=n,this.context=r.context,this.count=0,this.event=e,this.remaining=parseInt(r.remaining)>=1?parseInt(r.remaining):1/0,this.suspended=!1,this.target=t}remove(){this.target.removeListener(this.event,this.callback,{context:this.context,remaining:this.remaining})}}/** * The `Enumerations` class contains enumerations and arrays of elements used throughout the * library. All its properties are static and should be referenced using the class name. For * example: `Enumerations.CHANNEL_MESSAGES`. @@ -262,4 +262,4 @@ var Ke=Object.defineProperty;var Je=(i,e,t)=>e in i?Ke(i,e,{enumerable:!0,config `)();global.navigator||(global.navigator={}),Object.assign(global.navigator,h)}try{}catch{global.performance=await Object.getPrototypeOf(async function(){}).constructor(` let perf_hooks = await import("perf_hooks"); return perf_hooks.performance; - `)()}}if(this.validation=e.validation!==!1,this.validation&&(typeof e=="function"&&(e={callback:e,sysex:t}),t&&(e.sysex=!0)),this.enabled)return typeof e.callback=="function"&&e.callback(),Promise.resolve();const n={timestamp:this.time,target:this,type:"error",error:void 0},r={timestamp:this.time,target:this,type:"midiaccessgranted"},s={timestamp:this.time,target:this,type:"enabled"};try{typeof e.requestMIDIAccessFunction=="function"?this.interface=await e.requestMIDIAccessFunction({sysex:e.sysex,software:e.software}):this.interface=await navigator.requestMIDIAccess({sysex:e.sysex,software:e.software})}catch(l){return n.error=l,this.emit("error",n),typeof e.callback=="function"&&e.callback(l),Promise.reject(l)}this.emit("midiaccessgranted",r),this.interface.onstatechange=this._onInterfaceStateChange.bind(this);try{await this._updateInputsAndOutputs()}catch(l){return n.error=l,this.emit("error",n),typeof e.callback=="function"&&e.callback(l),Promise.reject(l)}return this.emit("enabled",s),typeof e.callback=="function"&&e.callback(),Promise.resolve(this)}async disable(){return this.interface&&(this.interface.onstatechange=void 0),this._destroyInputsAndOutputs().then(()=>{navigator&&typeof navigator.close=="function"&&navigator.close(),this.interface=null;let e={timestamp:this.time,target:this,type:"disabled"};this.emit("disabled",e),this.removeListener()})}getInputById(e,t={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(t.disconnected){for(let n=0;n=0&&e<=127?c.getNoteDetails(c.offsetNumber(e,this.octaveOffset)).octave:!1}sanitizeChannels(e){return this.validation&&console.warn("The sanitizeChannels() method has been moved to the utilities class."),c.sanitizeChannels(e)}toMIDIChannels(e){return this.validation&&console.warn("The toMIDIChannels() method has been deprecated. Use Utilities.sanitizeChannels() instead."),c.sanitizeChannels(e)}guessNoteNumber(e){return this.validation&&console.warn("The guessNoteNumber() method has been deprecated. Use Utilities.guessNoteNumber() instead."),c.guessNoteNumber(e,this.octaveOffset)}getValidNoteArray(e,t={}){return this.validation&&console.warn("The getValidNoteArray() method has been moved to the Utilities.buildNoteArray()"),c.buildNoteArray(e,t)}convertToTimestamp(e){return this.validation&&console.warn("The convertToTimestamp() method has been moved to Utilities.toTimestamp()."),c.toTimestamp(e)}async _destroyInputsAndOutputs(){let e=[];return this.inputs.forEach(t=>e.push(t.destroy())),this.outputs.forEach(t=>e.push(t.destroy())),Promise.all(e).then(()=>{this._inputs=[],this._outputs=[]})}_onInterfaceStateChange(e){this._updateInputsAndOutputs();let t={timestamp:e.timeStamp,type:e.port.state,target:this};if(e.port.state==="connected"&&e.port.connection==="open"){e.port.type==="output"?t.port=this.getOutputById(e.port.id):e.port.type==="input"&&(t.port=this.getInputById(e.port.id)),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}else if(e.port.state==="disconnected"&&e.port.connection==="pending"){e.port.type==="input"?t.port=this.getInputById(e.port.id,{disconnected:!0}):e.port.type==="output"&&(t.port=this.getOutputById(e.port.id,{disconnected:!0})),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}}async _updateInputsAndOutputs(){return Promise.all([this._updateInputs(),this._updateOutputs()])}async _updateInputs(){if(!this.interface)return;for(let t=this._inputs.length-1;t>=0;t--){const n=this._inputs[t];Array.from(this.interface.inputs.values()).find(s=>s===n._midiInput)||(this._disconnectedInputs.push(n),this._inputs.splice(t,1))}let e=[];return this.interface.inputs.forEach(t=>{if(!this._inputs.find(n=>n._midiInput===t)){let n=this._disconnectedInputs.find(r=>r._midiInput===t);n||(n=new et(t)),this._inputs.push(n),e.push(n.open())}}),Promise.all(e)}async _updateOutputs(){if(!this.interface)return;for(let t=this._outputs.length-1;t>=0;t--){const n=this._outputs[t];Array.from(this.interface.outputs.values()).find(s=>s===n._midiOutput)||(this._disconnectedOutputs.push(n),this._outputs.splice(t,1))}let e=[];return this.interface.outputs.forEach(t=>{if(!this._outputs.find(n=>n._midiOutput===t)){let n=this._disconnectedOutputs.find(r=>r._midiOutput===t);n||(n=new Se(t)),this._outputs.push(n),e.push(n.open())}}),Promise.all(e)}get enabled(){return this.interface!==null}get inputs(){return this._inputs}get isNode(){return this.validation&&console.warn("WebMidi.isNode has been deprecated. Use Utilities.isNode instead."),c.isNode}get isBrowser(){return this.validation&&console.warn("WebMidi.isBrowser has been deprecated. Use Utilities.isBrowser instead."),c.isBrowser}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get outputs(){return this._outputs}get supported(){return typeof navigator<"u"&&navigator.requestMIDIAccess}get sysexEnabled(){return!!(this.interface&&this.interface.sysexEnabled)}get time(){return performance.now()}get version(){return"3.1.8"}get flavour(){return"esm"}get CHANNEL_EVENTS(){return this.validation&&console.warn("The CHANNEL_EVENTS enum has been moved to Enumerations.CHANNEL_EVENTS."),a.CHANNEL_EVENTS}get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been moved to Enumerations.SYSTEM_MESSAGES."),a.SYSTEM_MESSAGES}get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been moved to Enumerations.CHANNEL_MODE_MESSAGES."),a.CHANNEL_MODE_MESSAGES}get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been replaced by the Enumerations.CONTROL_CHANGE_MESSAGES array."),a.MIDI_CONTROL_CHANGE_MESSAGES}get MIDI_REGISTERED_PARAMETER(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETER enum has been moved to Enumerations.REGISTERED_PARAMETERS."),a.REGISTERED_PARAMETERS}get NOTES(){return this.validation&&console.warn("The NOTES enum has been deprecated."),["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]}}const o=new tt;o.constructor=null;function nt(i,e){try{const t=e==="local"?window.localStorage:window.sessionStorage;return{data:JSON.parse(t.getItem(i)||"")}}catch(t){return{err:`Failed to retrieve value from storage: ${t}`,code:400}}}function rt(i,e,t){try{return(t==="local"?window.localStorage:window.sessionStorage).setItem(e,JSON.stringify(i)),{data:void 0}}catch(n){return{err:`Failed to store the value: ${n}`,code:400}}}function st(i,e){const{key:t,storage:n="local"}=e,r=nt(t,n);return"data"in r&&r.data?i.set(e.deserialize?e.deserialize(r.data):r.data):"err"in r&&(e!=null&&e.debug)&&console.info(r.err),i.subscribe(s=>{const l=rt(e.serialize?e.serialize(s):s,t,n);"err"in l&&(e!=null&&e.debug)&&console.error(l.err)}),i}const pe=Ce(void 0),Te=st(Ce([60,84]),{key:"midi-range",storage:"session"}),Re={async openMidi(){return o.enable().then(()=>o.inputs.length>0?(pe.set(o.inputs[0]),{data:o.inputs[0]}):{err:"No MIDI device found.",code:400}).catch(i=>({err:i.toString(),code:403}))},setMidiRange(i){Te.set(i)}},We={0:{note:"C",steps:0,sharp:!1,flat:!1},1:{note:"C♯",steps:0,sharp:!0,flat:!1},2:{note:"D",steps:1,sharp:!1,flat:!1},3:{note:"E♭",steps:2,sharp:!1,flat:!0},4:{note:"E",steps:2,sharp:!1,flat:!1},5:{note:"F",steps:3,sharp:!1,flat:!1},6:{note:"F♯",steps:3,sharp:!0,flat:!1},7:{note:"G",steps:4,sharp:!1,flat:!1},8:{note:"G♯",steps:4,sharp:!0,flat:!1},9:{note:"A",steps:5,sharp:!1,flat:!1},10:{note:"B♭",steps:6,sharp:!1,flat:!0},11:{note:"B",steps:6,sharp:!1,flat:!1}};function ee(i){const e=i-12,t=Math.floor(e/12),n=We[e%12];return{...n,octave:t,absolute:`${n.note}${t}`}}function it(i){if(i.length===2||i.length===3){const e=i.slice(0,i.length-1).toUpperCase();let t;try{t=parseInt(i[i.length-1])}catch{return{err:`Couldn't parse note "${i}" octave`,code:400}}const n=Object.values(We).findIndex(r=>r.note===e);return n===-1?{err:`Note "${i}" not found in scale`,code:400}:{data:12+t*12+n}}else return{err:`Unrecognized note "${i}"`,code:400}}function Ve(i){let e,t;return{c(){e=u("div"),t=W(i[2]),this.h()},l(n){e=m(n,"DIV",{class:!0});var r=I(e);t=K(r,i[2]),r.forEach(E),this.h()},h(){p(e,"class","error svelte-5m5dii")},m(n,r){L(n,e,r),d(e,t)},p(n,r){r&4&&fe(t,n[2])},d(n){n&&E(e)}}}function at(i){let e,t,n,r="MIDI",s,l,h,_,y="Device",A,S,f,b,v,N,g="Prompt",w,R,O,F="Range",k,H,x,te,P,ue="—",ne,D,ie,z,V,q,ae="Use MIDI",j,Q,re=`
`,Y,X,M,U=i[2]&&Ve(i);return{c(){e=u("div"),t=u("fieldset"),n=u("legend"),n.textContent=r,s=C(),l=u("div"),h=u("div"),_=u("label"),_.textContent=y,A=C(),S=u("input"),b=C(),v=u("div"),N=u("button"),N.textContent=g,w=C(),R=u("div"),O=u("label"),O.textContent=F,k=C(),H=u("div"),x=u("input"),te=C(),P=u("span"),P.textContent=ue,ne=C(),D=u("input"),ie=C(),z=u("div"),U&&U.c(),V=C(),q=u("button"),q.textContent=ae,j=C(),Q=u("div"),Q.innerHTML=re,this.h()},l(B){e=m(B,"DIV",{class:!0});var Z=I(e);t=m(Z,"FIELDSET",{class:!0});var se=I(t);n=m(se,"LEGEND",{class:!0,"data-svelte-h":!0}),G(n)!=="svelte-dnpakp"&&(n.textContent=r),s=T(se),l=m(se,"DIV",{class:!0});var le=I(l);h=m(le,"DIV",{class:!0});var oe=I(h);_=m(oe,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),G(_)!=="svelte-crpa7y"&&(_.textContent=y),A=T(oe),S=m(oe,"INPUT",{class:!0,id:!0}),b=T(oe),v=m(oe,"DIV",{});var Oe=I(v);N=m(Oe,"BUTTON",{class:!0,"data-svelte-h":!0}),G(N)!=="svelte-r53s7o"&&(N.textContent=g),Oe.forEach(E),oe.forEach(E),w=T(le),R=m(le,"DIV",{class:!0});var ce=I(R);O=m(ce,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),G(O)!=="svelte-10u0679"&&(O.textContent=F),k=T(ce),H=m(ce,"DIV",{class:!0});var de=I(H);x=m(de,"INPUT",{class:!0,id:!0}),te=T(de),P=m(de,"SPAN",{class:!0,"data-svelte-h":!0}),G(P)!=="svelte-91k20l"&&(P.textContent=ue),ne=T(de),D=m(de,"INPUT",{class:!0,id:!0}),de.forEach(E),ie=T(ce),z=m(ce,"DIV",{});var Ee=I(z);U&&U.l(Ee),V=T(Ee),q=m(Ee,"BUTTON",{class:!0,"data-svelte-h":!0}),G(q)!=="svelte-1elgafa"&&(q.textContent=ae),Ee.forEach(E),ce.forEach(E),j=T(le),Q=m(le,"DIV",{class:!0,"data-svelte-h":!0}),G(Q)!=="svelte-1po95sj"&&(Q.innerHTML=re),le.forEach(E),se.forEach(E),Z.forEach(E),this.h()},h(){var B;p(n,"class","px-2 text-0A text-base"),p(_,"class","font-bold"),p(_,"for","device"),p(S,"class","my-1 w-50"),p(S,"id","device"),S.disabled=!0,S.value=f=((B=i[3])==null?void 0:B.name)??"No device",p(N,"class","btn primary"),p(h,"class","flex flex-col"),p(O,"class","font-bold"),p(O,"for","range_min"),p(x,"class","w-full"),p(x,"id","range_min"),p(P,"class","mx-4"),p(D,"class","w-full"),p(D,"id","range_max"),p(H,"class","my-1 flex w-full"),p(q,"class","btn primary"),p(R,"class","flex flex-col"),p(Q,"class","flex flex-col h-full"),p(l,"class","midi-body svelte-5m5dii"),p(t,"class","flex flex-col rounded border-2 px-4 py-2 my-4 text-sm"),p(e,"class",Y=_e(`${i[5].class||""}`)+" svelte-5m5dii")},m(B,Z){L(B,e,Z),d(e,t),d(t,n),d(t,s),d(t,l),d(l,h),d(h,_),d(h,A),d(h,S),d(h,b),d(h,v),d(v,N),d(l,w),d(l,R),d(R,O),d(R,k),d(R,H),d(H,x),be(x,i[0]),d(H,te),d(H,P),d(H,ne),d(H,D),be(D,i[1]),d(R,ie),d(R,z),U&&U.m(z,null),d(z,V),d(z,q),d(l,j),d(l,Q),X||(M=[$(N,"click",Re.openMidi),$(x,"input",i[6]),$(x,"change",i[7]),$(D,"input",i[8]),$(D,"change",i[9]),$(q,"click",lt)],X=!0)},p(B,[Z]){var se;Z&8&&f!==(f=((se=B[3])==null?void 0:se.name)??"No device")&&S.value!==f&&(S.value=f),Z&1&&x.value!==B[0]&&be(x,B[0]),Z&2&&D.value!==B[1]&&be(D,B[1]),B[2]?U?U.p(B,Z):(U=Ve(B),U.c(),U.m(z,V)):U&&(U.d(1),U=null),Z&32&&Y!==(Y=_e(`${B[5].class||""}`)+" svelte-5m5dii")&&p(e,"class",Y)},i:me,o:me,d(B){B&&E(e),U&&U.d(),X=!1,Ye(M)}}}function lt(){}function ot(i,e,t){let n,r;ve(i,Te,b=>t(10,n=b)),ve(i,pe,b=>t(3,r=b));let s=ee(n[0]).absolute,l=ee(n[1]).absolute,h="";function _(b,v){const N=it(v.currentTarget.value);if("data"in N){const g=n,w=[b==="min"?N.data:g[0],b==="max"?N.data:g[1]];Re.setMidiRange(w),t(2,h="")}else t(2,h=N.err),b==="min"?t(0,s=ee(n[0]).absolute):t(1,l=ee(n[1]).absolute)}function y(){s=this.value,t(0,s)}const A=b=>_("min",b);function S(){l=this.value,t(1,l)}const f=b=>_("max",b);return i.$$set=b=>{t(5,e=Ne(Ne({},e),ye(b)))},e=ye(e),[s,l,h,r,_,e,y,A,S,f]}class ct extends Ie{constructor(e){super(),Ae(this,e,ot,at,Me,{})}}function dt(i){let e,t,n,r,s,l,h,_,y,A,S,f,b,v,N,g,w,R,O,F,k,H,x,te,P,ue="𝄞",ne,D,ie="𝄢",z,V,q='
',ae,j,Q='
',re;return{c(){e=u("section"),t=u("div"),n=u("div"),r=C(),s=u("div"),l=C(),h=u("div"),_=C(),y=u("div"),A=C(),S=u("div"),f=C(),b=u("div"),v=C(),N=u("div"),g=C(),w=u("div"),R=C(),O=u("div"),F=C(),k=u("div"),H=C(),x=u("div"),te=C(),P=u("span"),P.textContent=ue,ne=C(),D=u("span"),D.textContent=ie,z=C(),V=u("div"),V.innerHTML=q,ae=C(),j=u("div"),j.innerHTML=Q,this.h()},l(Y){e=m(Y,"SECTION",{class:!0});var X=I(e);t=m(X,"DIV",{class:!0});var M=I(t);n=m(M,"DIV",{class:!0}),I(n).forEach(E),r=T(M),s=m(M,"DIV",{class:!0}),I(s).forEach(E),l=T(M),h=m(M,"DIV",{class:!0}),I(h).forEach(E),_=T(M),y=m(M,"DIV",{class:!0}),I(y).forEach(E),A=T(M),S=m(M,"DIV",{class:!0}),I(S).forEach(E),f=T(M),b=m(M,"DIV",{class:!0}),I(b).forEach(E),v=T(M),N=m(M,"DIV",{class:!0}),I(N).forEach(E),g=T(M),w=m(M,"DIV",{class:!0}),I(w).forEach(E),R=T(M),O=m(M,"DIV",{class:!0}),I(O).forEach(E),F=T(M),k=m(M,"DIV",{class:!0}),I(k).forEach(E),H=T(M),x=m(M,"DIV",{class:!0}),I(x).forEach(E),te=T(M),P=m(M,"SPAN",{class:!0,"data-svelte-h":!0}),G(P)!=="svelte-19670ev"&&(P.textContent=ue),ne=T(M),D=m(M,"SPAN",{class:!0,"data-svelte-h":!0}),G(D)!=="svelte-119te60"&&(D.textContent=ie),z=T(M),V=m(M,"DIV",{class:!0,"data-svelte-h":!0}),G(V)!=="svelte-1avvn9p"&&(V.innerHTML=q),ae=T(M),j=m(M,"DIV",{class:!0,"data-svelte-h":!0}),G(j)!=="svelte-1rv4bt9"&&(j.innerHTML=Q),M.forEach(E),X.forEach(E),this.h()},h(){p(n,"class","line svelte-8yf9w8"),p(s,"class","line svelte-8yf9w8"),p(h,"class","line svelte-8yf9w8"),p(y,"class","line svelte-8yf9w8"),p(S,"class","line svelte-8yf9w8"),p(b,"class","line invisible svelte-8yf9w8"),p(N,"class","line svelte-8yf9w8"),p(w,"class","line svelte-8yf9w8"),p(O,"class","line svelte-8yf9w8"),p(k,"class","line svelte-8yf9w8"),p(x,"class","line svelte-8yf9w8"),p(P,"class","g-clef svelte-8yf9w8"),p(D,"class","f-clef svelte-8yf9w8"),p(V,"class","note target svelte-8yf9w8"),p(j,"class","note played svelte-8yf9w8"),p(t,"class","staff svelte-8yf9w8"),p(e,"class",re=_e(`${i[2].class||""} score pt-12 pb-8`)+" svelte-8yf9w8")},m(Y,X){L(Y,e,X),d(e,t),d(t,n),d(t,r),d(t,s),d(t,l),d(t,h),d(t,_),d(t,y),d(t,A),d(t,S),d(t,f),d(t,b),d(t,v),d(t,N),d(t,g),d(t,w),d(t,R),d(t,O),d(t,F),d(t,k),d(t,H),d(t,x),d(t,te),d(t,P),d(t,ne),d(t,D),d(t,z),d(t,V),i[5](V),d(t,ae),d(t,j),i[6](j)},p(Y,[X]){X&4&&re!==(re=_e(`${Y[2].class||""} score pt-12 pb-8`)+" svelte-8yf9w8")&&p(e,"class",re)},i:me,o:me,d(Y){Y&&E(e),i[5](null),i[6](null)}}}function Fe(i,e,t){e?(i.style.display="block",i.style.bottom=ht(e)+"rem",i.firstChild&&(i.firstChild.textContent=`${e.flat?"♭":e.sharp?"♯":""}𝅝`),t!==void 0&&t?(i.classList.remove("wrong"),i.classList.add("correct")):t!==void 0&&(i.classList.remove("correct"),i.classList.add("wrong")),(e.value===60||e.value===61)&&i.lastChild instanceof HTMLElement||e.value===81&&i.lastChild instanceof HTMLElement?(i.lastChild.style.display="block",e.flat||e.sharp?i.lastChild.style.left="1rem":i.lastChild.style.left=""):i.lastChild instanceof HTMLElement&&(i.lastChild.style.display="none")):i.style.display="none"}function ht(i){const e=.4272727272727273,n=(i.octave-4)*7+i.steps;return 3.1+e*n}function ft(i,e,t){let{target:n=void 0,played:r=void 0}=e,s,l;function h(y){De[y?"unshift":"push"](()=>{l=y,t(1,l)})}function _(y){De[y?"unshift":"push"](()=>{s=y,t(0,s)})}return i.$$set=y=>{t(2,e=Ne(Ne({},e),ye(y))),"target"in y&&t(3,n=y.target),"played"in y&&t(4,r=y.played)},i.$$.update=()=>{i.$$.dirty&10&&l&&Fe(l,n),i.$$.dirty&17&&s&&Fe(s,r,r==null?void 0:r.correct)},e=ye(e),[s,l,e,n,r,h,_]}class ut extends Ie{constructor(e){super(),Ae(this,e,ft,dt,Me,{target:3,played:4})}}class mt{constructor(e){ge(this,"notes");ge(this,"correct",0);ge(this,"idx",0);this.notes=e}get current(){return this.notes[this.idx]}get ended(){return this.notes.length===this.idx+1}guess(e){const t=this.current===e;return t&&(this.correct+=1),this.idx+=1,t}}const we=Ce(void 0),ze={playGuessNotes(i=10){const e=[],t=Qe(Te);console.log("range",t);for(let r=0;rt(3,n=f));let r,s,l,h;Xe(()=>{y()}),pe.subscribe(f=>{f&&f.channels[1].addListener("noteon",_)});function _(f){if(l)return;console.log("noteon",f);const v=f.rawData[1];if(!n)t(1,s={...ee(v),value:v,correct:!1});else{t(0,r={...ee(n.current),value:n.current});const N=n.guess(v);t(2,h=N?"correct":"wrong"),t(1,s={...ee(v),value:v,correct:N}),l=setTimeout(()=>{n!=null&&n.ended?(t(0,r=void 0),t(2,h="ended")):n&&(t(0,r={...ee(n.current),value:n.current}),t(2,h="waiting")),t(1,s=void 0),l=void 0},2e3)}}async function y(){const f=await Re.openMidi();"data"in f?f.data.name:f.err}function A(){t(2,h="waiting");const f=ze.playGuessNotes(),b=ee(f.current);t(0,r={...b,value:f.current})}function S(){t(2,h="waiting"),ze.clearGame()}return[r,s,h,n,A,S]}class It extends Ie{constructor(e){super(),Ae(this,e,yt,Nt,Me,{})}}export{It as component}; + `)()}}if(this.validation=e.validation!==!1,this.validation&&(typeof e=="function"&&(e={callback:e,sysex:t}),t&&(e.sysex=!0)),this.enabled)return typeof e.callback=="function"&&e.callback(),Promise.resolve();const n={timestamp:this.time,target:this,type:"error",error:void 0},r={timestamp:this.time,target:this,type:"midiaccessgranted"},s={timestamp:this.time,target:this,type:"enabled"};try{typeof e.requestMIDIAccessFunction=="function"?this.interface=await e.requestMIDIAccessFunction({sysex:e.sysex,software:e.software}):this.interface=await navigator.requestMIDIAccess({sysex:e.sysex,software:e.software})}catch(l){return n.error=l,this.emit("error",n),typeof e.callback=="function"&&e.callback(l),Promise.reject(l)}this.emit("midiaccessgranted",r),this.interface.onstatechange=this._onInterfaceStateChange.bind(this);try{await this._updateInputsAndOutputs()}catch(l){return n.error=l,this.emit("error",n),typeof e.callback=="function"&&e.callback(l),Promise.reject(l)}return this.emit("enabled",s),typeof e.callback=="function"&&e.callback(),Promise.resolve(this)}async disable(){return this.interface&&(this.interface.onstatechange=void 0),this._destroyInputsAndOutputs().then(()=>{navigator&&typeof navigator.close=="function"&&navigator.close(),this.interface=null;let e={timestamp:this.time,target:this,type:"disabled"};this.emit("disabled",e),this.removeListener()})}getInputById(e,t={disconnected:!1}){if(this.validation){if(!this.enabled)throw new Error("WebMidi is not enabled.");if(!e)return}if(t.disconnected){for(let n=0;n=0&&e<=127?c.getNoteDetails(c.offsetNumber(e,this.octaveOffset)).octave:!1}sanitizeChannels(e){return this.validation&&console.warn("The sanitizeChannels() method has been moved to the utilities class."),c.sanitizeChannels(e)}toMIDIChannels(e){return this.validation&&console.warn("The toMIDIChannels() method has been deprecated. Use Utilities.sanitizeChannels() instead."),c.sanitizeChannels(e)}guessNoteNumber(e){return this.validation&&console.warn("The guessNoteNumber() method has been deprecated. Use Utilities.guessNoteNumber() instead."),c.guessNoteNumber(e,this.octaveOffset)}getValidNoteArray(e,t={}){return this.validation&&console.warn("The getValidNoteArray() method has been moved to the Utilities.buildNoteArray()"),c.buildNoteArray(e,t)}convertToTimestamp(e){return this.validation&&console.warn("The convertToTimestamp() method has been moved to Utilities.toTimestamp()."),c.toTimestamp(e)}async _destroyInputsAndOutputs(){let e=[];return this.inputs.forEach(t=>e.push(t.destroy())),this.outputs.forEach(t=>e.push(t.destroy())),Promise.all(e).then(()=>{this._inputs=[],this._outputs=[]})}_onInterfaceStateChange(e){this._updateInputsAndOutputs();let t={timestamp:e.timeStamp,type:e.port.state,target:this};if(e.port.state==="connected"&&e.port.connection==="open"){e.port.type==="output"?t.port=this.getOutputById(e.port.id):e.port.type==="input"&&(t.port=this.getInputById(e.port.id)),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}else if(e.port.state==="disconnected"&&e.port.connection==="pending"){e.port.type==="input"?t.port=this.getInputById(e.port.id,{disconnected:!0}):e.port.type==="output"&&(t.port=this.getOutputById(e.port.id,{disconnected:!0})),this.emit(e.port.state,t);const n=Object.assign({},t);n.type="portschanged",this.emit(n.type,n)}}async _updateInputsAndOutputs(){return Promise.all([this._updateInputs(),this._updateOutputs()])}async _updateInputs(){if(!this.interface)return;for(let t=this._inputs.length-1;t>=0;t--){const n=this._inputs[t];Array.from(this.interface.inputs.values()).find(s=>s===n._midiInput)||(this._disconnectedInputs.push(n),this._inputs.splice(t,1))}let e=[];return this.interface.inputs.forEach(t=>{if(!this._inputs.find(n=>n._midiInput===t)){let n=this._disconnectedInputs.find(r=>r._midiInput===t);n||(n=new et(t)),this._inputs.push(n),e.push(n.open())}}),Promise.all(e)}async _updateOutputs(){if(!this.interface)return;for(let t=this._outputs.length-1;t>=0;t--){const n=this._outputs[t];Array.from(this.interface.outputs.values()).find(s=>s===n._midiOutput)||(this._disconnectedOutputs.push(n),this._outputs.splice(t,1))}let e=[];return this.interface.outputs.forEach(t=>{if(!this._outputs.find(n=>n._midiOutput===t)){let n=this._disconnectedOutputs.find(r=>r._midiOutput===t);n||(n=new Se(t)),this._outputs.push(n),e.push(n.open())}}),Promise.all(e)}get enabled(){return this.interface!==null}get inputs(){return this._inputs}get isNode(){return this.validation&&console.warn("WebMidi.isNode has been deprecated. Use Utilities.isNode instead."),c.isNode}get isBrowser(){return this.validation&&console.warn("WebMidi.isBrowser has been deprecated. Use Utilities.isBrowser instead."),c.isBrowser}get octaveOffset(){return this._octaveOffset}set octaveOffset(e){if(this.validation&&(e=parseInt(e),isNaN(e)))throw new TypeError("The 'octaveOffset' property must be an integer.");this._octaveOffset=e}get outputs(){return this._outputs}get supported(){return typeof navigator<"u"&&navigator.requestMIDIAccess}get sysexEnabled(){return!!(this.interface&&this.interface.sysexEnabled)}get time(){return performance.now()}get version(){return"3.1.8"}get flavour(){return"esm"}get CHANNEL_EVENTS(){return this.validation&&console.warn("The CHANNEL_EVENTS enum has been moved to Enumerations.CHANNEL_EVENTS."),a.CHANNEL_EVENTS}get MIDI_SYSTEM_MESSAGES(){return this.validation&&console.warn("The MIDI_SYSTEM_MESSAGES enum has been moved to Enumerations.SYSTEM_MESSAGES."),a.SYSTEM_MESSAGES}get MIDI_CHANNEL_MODE_MESSAGES(){return this.validation&&console.warn("The MIDI_CHANNEL_MODE_MESSAGES enum has been moved to Enumerations.CHANNEL_MODE_MESSAGES."),a.CHANNEL_MODE_MESSAGES}get MIDI_CONTROL_CHANGE_MESSAGES(){return this.validation&&console.warn("The MIDI_CONTROL_CHANGE_MESSAGES enum has been replaced by the Enumerations.CONTROL_CHANGE_MESSAGES array."),a.MIDI_CONTROL_CHANGE_MESSAGES}get MIDI_REGISTERED_PARAMETER(){return this.validation&&console.warn("The MIDI_REGISTERED_PARAMETER enum has been moved to Enumerations.REGISTERED_PARAMETERS."),a.REGISTERED_PARAMETERS}get NOTES(){return this.validation&&console.warn("The NOTES enum has been deprecated."),["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]}}const o=new tt;o.constructor=null;function nt(i,e){try{const t=e==="local"?window.localStorage:window.sessionStorage;return{data:JSON.parse(t.getItem(i)||"")}}catch(t){return{err:`Failed to retrieve value from storage: ${t}`,code:400}}}function rt(i,e,t){try{return(t==="local"?window.localStorage:window.sessionStorage).setItem(e,JSON.stringify(i)),{data:void 0}}catch(n){return{err:`Failed to store the value: ${n}`,code:400}}}function st(i,e){const{key:t,storage:n="local"}=e,r=nt(t,n);return"data"in r&&r.data?i.set(e.deserialize?e.deserialize(r.data):r.data):"err"in r&&(e!=null&&e.debug)&&console.info(r.err),i.subscribe(s=>{const l=rt(e.serialize?e.serialize(s):s,t,n);"err"in l&&(e!=null&&e.debug)&&console.error(l.err)}),i}const pe=Ce(void 0),Te=st(Ce([60,84]),{key:"midi-range",storage:"session"}),Re={async openMidi(){return o.enable().then(()=>o.inputs.length>0?(pe.set(o.inputs[0]),{data:o.inputs[0]}):{err:"No MIDI device found.",code:400}).catch(i=>({err:i.toString(),code:403}))},setMidiRange(i){Te.set(i)}},We={0:{note:"C",steps:0,sharp:!1,flat:!1},1:{note:"C♯",steps:0,sharp:!0,flat:!1},2:{note:"D",steps:1,sharp:!1,flat:!1},3:{note:"E♭",steps:2,sharp:!1,flat:!0},4:{note:"E",steps:2,sharp:!1,flat:!1},5:{note:"F",steps:3,sharp:!1,flat:!1},6:{note:"F♯",steps:3,sharp:!0,flat:!1},7:{note:"G",steps:4,sharp:!1,flat:!1},8:{note:"G♯",steps:4,sharp:!0,flat:!1},9:{note:"A",steps:5,sharp:!1,flat:!1},10:{note:"B♭",steps:6,sharp:!1,flat:!0},11:{note:"B",steps:6,sharp:!1,flat:!1}};function ee(i){const e=i-12,t=Math.floor(e/12),n=We[e%12];return{...n,octave:t,absolute:`${n.note}${t}`}}function it(i){if(i.length===2||i.length===3){const e=i.slice(0,i.length-1).toUpperCase();let t;try{t=parseInt(i[i.length-1])}catch{return{err:`Couldn't parse note "${i}" octave`,code:400}}const n=Object.values(We).findIndex(r=>r.note===e);return n===-1?{err:`Note "${i}" not found in scale`,code:400}:{data:12+t*12+n}}else return{err:`Unrecognized note "${i}"`,code:400}}function Ve(i){let e,t;return{c(){e=f("div"),t=W(i[2]),this.h()},l(n){e=m(n,"DIV",{class:!0});var r=I(e);t=K(r,i[2]),r.forEach(E),this.h()},h(){p(e,"class","error svelte-5m5dii")},m(n,r){L(n,e,r),d(e,t)},p(n,r){r&4&&ue(t,n[2])},d(n){n&&E(e)}}}function at(i){let e,t,n,r="MIDI",s,l,h,_,y="Device",A,S,u,b,v,N,g="Prompt",w,R,O,F="Range",k,H,x,te,P,fe="—",ne,D,ie,z,V,q,ae="Use MIDI",j,Q,re=`
`,Y,X,M,U=i[2]&&Ve(i);return{c(){e=f("div"),t=f("fieldset"),n=f("legend"),n.textContent=r,s=C(),l=f("div"),h=f("div"),_=f("label"),_.textContent=y,A=C(),S=f("input"),b=C(),v=f("div"),N=f("button"),N.textContent=g,w=C(),R=f("div"),O=f("label"),O.textContent=F,k=C(),H=f("div"),x=f("input"),te=C(),P=f("span"),P.textContent=fe,ne=C(),D=f("input"),ie=C(),z=f("div"),U&&U.c(),V=C(),q=f("button"),q.textContent=ae,j=C(),Q=f("div"),Q.innerHTML=re,this.h()},l(B){e=m(B,"DIV",{class:!0});var Z=I(e);t=m(Z,"FIELDSET",{class:!0});var se=I(t);n=m(se,"LEGEND",{class:!0,"data-svelte-h":!0}),G(n)!=="svelte-dnpakp"&&(n.textContent=r),s=T(se),l=m(se,"DIV",{class:!0});var le=I(l);h=m(le,"DIV",{class:!0});var oe=I(h);_=m(oe,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),G(_)!=="svelte-crpa7y"&&(_.textContent=y),A=T(oe),S=m(oe,"INPUT",{class:!0,id:!0}),b=T(oe),v=m(oe,"DIV",{});var Oe=I(v);N=m(Oe,"BUTTON",{class:!0,"data-svelte-h":!0}),G(N)!=="svelte-r53s7o"&&(N.textContent=g),Oe.forEach(E),oe.forEach(E),w=T(le),R=m(le,"DIV",{class:!0});var ce=I(R);O=m(ce,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),G(O)!=="svelte-10u0679"&&(O.textContent=F),k=T(ce),H=m(ce,"DIV",{class:!0});var de=I(H);x=m(de,"INPUT",{class:!0,id:!0}),te=T(de),P=m(de,"SPAN",{class:!0,"data-svelte-h":!0}),G(P)!=="svelte-91k20l"&&(P.textContent=fe),ne=T(de),D=m(de,"INPUT",{class:!0,id:!0}),de.forEach(E),ie=T(ce),z=m(ce,"DIV",{});var Ee=I(z);U&&U.l(Ee),V=T(Ee),q=m(Ee,"BUTTON",{class:!0,"data-svelte-h":!0}),G(q)!=="svelte-1elgafa"&&(q.textContent=ae),Ee.forEach(E),ce.forEach(E),j=T(le),Q=m(le,"DIV",{class:!0,"data-svelte-h":!0}),G(Q)!=="svelte-1po95sj"&&(Q.innerHTML=re),le.forEach(E),se.forEach(E),Z.forEach(E),this.h()},h(){var B;p(n,"class","px-2 text-0A text-base"),p(_,"class","font-bold"),p(_,"for","device"),p(S,"class","my-1 w-50"),p(S,"id","device"),S.disabled=!0,S.value=u=((B=i[3])==null?void 0:B.name)??"No device",p(N,"class","btn primary"),p(h,"class","flex flex-col"),p(O,"class","font-bold"),p(O,"for","range_min"),p(x,"class","w-full"),p(x,"id","range_min"),p(P,"class","mx-4"),p(D,"class","w-full"),p(D,"id","range_max"),p(H,"class","my-1 flex w-full"),p(q,"class","btn primary"),p(R,"class","flex flex-col"),p(Q,"class","flex flex-col h-full"),p(l,"class","midi-body svelte-5m5dii"),p(t,"class","flex flex-col rounded border-2 px-4 py-2 my-4 text-sm"),p(e,"class",Y=_e(`${i[5].class||""}`)+" svelte-5m5dii")},m(B,Z){L(B,e,Z),d(e,t),d(t,n),d(t,s),d(t,l),d(l,h),d(h,_),d(h,A),d(h,S),d(h,b),d(h,v),d(v,N),d(l,w),d(l,R),d(R,O),d(R,k),d(R,H),d(H,x),be(x,i[0]),d(H,te),d(H,P),d(H,ne),d(H,D),be(D,i[1]),d(R,ie),d(R,z),U&&U.m(z,null),d(z,V),d(z,q),d(l,j),d(l,Q),X||(M=[$(N,"click",Re.openMidi),$(x,"input",i[6]),$(x,"change",i[7]),$(D,"input",i[8]),$(D,"change",i[9]),$(q,"click",lt)],X=!0)},p(B,[Z]){var se;Z&8&&u!==(u=((se=B[3])==null?void 0:se.name)??"No device")&&S.value!==u&&(S.value=u),Z&1&&x.value!==B[0]&&be(x,B[0]),Z&2&&D.value!==B[1]&&be(D,B[1]),B[2]?U?U.p(B,Z):(U=Ve(B),U.c(),U.m(z,V)):U&&(U.d(1),U=null),Z&32&&Y!==(Y=_e(`${B[5].class||""}`)+" svelte-5m5dii")&&p(e,"class",Y)},i:me,o:me,d(B){B&&E(e),U&&U.d(),X=!1,Ye(M)}}}function lt(){}function ot(i,e,t){let n,r;ve(i,Te,b=>t(10,n=b)),ve(i,pe,b=>t(3,r=b));let s=ee(n[0]).absolute,l=ee(n[1]).absolute,h="";function _(b,v){const N=it(v.currentTarget.value);if("data"in N){const g=n,w=[b==="min"?N.data:g[0],b==="max"?N.data:g[1]];Re.setMidiRange(w),t(2,h="")}else t(2,h=N.err),b==="min"?t(0,s=ee(n[0]).absolute):t(1,l=ee(n[1]).absolute)}function y(){s=this.value,t(0,s)}const A=b=>_("min",b);function S(){l=this.value,t(1,l)}const u=b=>_("max",b);return i.$$set=b=>{t(5,e=Ne(Ne({},e),ye(b)))},e=ye(e),[s,l,h,r,_,e,y,A,S,u]}class ct extends Ie{constructor(e){super(),Ae(this,e,ot,at,Me,{})}}function dt(i){let e,t,n,r,s,l,h,_,y,A,S,u,b,v,N,g,w,R,O,F,k,H,x,te,P,fe="𝄞",ne,D,ie="𝄢",z,V,q='
',ae,j,Q='
',re;return{c(){e=f("section"),t=f("div"),n=f("div"),r=C(),s=f("div"),l=C(),h=f("div"),_=C(),y=f("div"),A=C(),S=f("div"),u=C(),b=f("div"),v=C(),N=f("div"),g=C(),w=f("div"),R=C(),O=f("div"),F=C(),k=f("div"),H=C(),x=f("div"),te=C(),P=f("span"),P.textContent=fe,ne=C(),D=f("span"),D.textContent=ie,z=C(),V=f("div"),V.innerHTML=q,ae=C(),j=f("div"),j.innerHTML=Q,this.h()},l(Y){e=m(Y,"SECTION",{class:!0});var X=I(e);t=m(X,"DIV",{class:!0});var M=I(t);n=m(M,"DIV",{class:!0}),I(n).forEach(E),r=T(M),s=m(M,"DIV",{class:!0}),I(s).forEach(E),l=T(M),h=m(M,"DIV",{class:!0}),I(h).forEach(E),_=T(M),y=m(M,"DIV",{class:!0}),I(y).forEach(E),A=T(M),S=m(M,"DIV",{class:!0}),I(S).forEach(E),u=T(M),b=m(M,"DIV",{class:!0}),I(b).forEach(E),v=T(M),N=m(M,"DIV",{class:!0}),I(N).forEach(E),g=T(M),w=m(M,"DIV",{class:!0}),I(w).forEach(E),R=T(M),O=m(M,"DIV",{class:!0}),I(O).forEach(E),F=T(M),k=m(M,"DIV",{class:!0}),I(k).forEach(E),H=T(M),x=m(M,"DIV",{class:!0}),I(x).forEach(E),te=T(M),P=m(M,"SPAN",{class:!0,"data-svelte-h":!0}),G(P)!=="svelte-19670ev"&&(P.textContent=fe),ne=T(M),D=m(M,"SPAN",{class:!0,"data-svelte-h":!0}),G(D)!=="svelte-119te60"&&(D.textContent=ie),z=T(M),V=m(M,"DIV",{class:!0,"data-svelte-h":!0}),G(V)!=="svelte-1avvn9p"&&(V.innerHTML=q),ae=T(M),j=m(M,"DIV",{class:!0,"data-svelte-h":!0}),G(j)!=="svelte-1rv4bt9"&&(j.innerHTML=Q),M.forEach(E),X.forEach(E),this.h()},h(){p(n,"class","line svelte-115d3uv"),p(s,"class","line svelte-115d3uv"),p(h,"class","line svelte-115d3uv"),p(y,"class","line svelte-115d3uv"),p(S,"class","line svelte-115d3uv"),p(b,"class","line invisible svelte-115d3uv"),p(N,"class","line svelte-115d3uv"),p(w,"class","line svelte-115d3uv"),p(O,"class","line svelte-115d3uv"),p(k,"class","line svelte-115d3uv"),p(x,"class","line svelte-115d3uv"),p(P,"class","g-clef svelte-115d3uv"),p(D,"class","f-clef svelte-115d3uv"),p(V,"class","note target svelte-115d3uv"),p(j,"class","note played svelte-115d3uv"),p(t,"class","staff svelte-115d3uv"),p(e,"class",re=_e(`${i[2].class||""} score pt-12 pb-8`)+" svelte-115d3uv")},m(Y,X){L(Y,e,X),d(e,t),d(t,n),d(t,r),d(t,s),d(t,l),d(t,h),d(t,_),d(t,y),d(t,A),d(t,S),d(t,u),d(t,b),d(t,v),d(t,N),d(t,g),d(t,w),d(t,R),d(t,O),d(t,F),d(t,k),d(t,H),d(t,x),d(t,te),d(t,P),d(t,ne),d(t,D),d(t,z),d(t,V),i[5](V),d(t,ae),d(t,j),i[6](j)},p(Y,[X]){X&4&&re!==(re=_e(`${Y[2].class||""} score pt-12 pb-8`)+" svelte-115d3uv")&&p(e,"class",re)},i:me,o:me,d(Y){Y&&E(e),i[5](null),i[6](null)}}}function Fe(i,e,t){e?(i.style.display="block",i.style.bottom=ht(e)+"rem",i.firstChild&&(i.firstChild.textContent=`${e.flat?"♭":e.sharp?"♯":""}𝅝`),t!==void 0&&t?(i.classList.remove("wrong"),i.classList.add("correct")):t!==void 0&&(i.classList.remove("correct"),i.classList.add("wrong")),(e.value===60||e.value===61)&&i.lastChild instanceof HTMLElement||e.value===81&&i.lastChild instanceof HTMLElement?(i.lastChild.style.display="block",e.flat||e.sharp?i.lastChild.style.left="1.18rem":i.lastChild.style.left=""):i.lastChild instanceof HTMLElement&&(i.lastChild.style.display="none")):i.style.display="none"}function ht(i){const e=.42272727272,n=(i.octave-4)*7+i.steps;return 2.85+e*n}function ut(i,e,t){let{target:n=void 0,played:r=void 0}=e,s,l;function h(y){De[y?"unshift":"push"](()=>{l=y,t(1,l)})}function _(y){De[y?"unshift":"push"](()=>{s=y,t(0,s)})}return i.$$set=y=>{t(2,e=Ne(Ne({},e),ye(y))),"target"in y&&t(3,n=y.target),"played"in y&&t(4,r=y.played)},i.$$.update=()=>{i.$$.dirty&10&&l&&Fe(l,n),i.$$.dirty&17&&s&&Fe(s,r,r==null?void 0:r.correct)},e=ye(e),[s,l,e,n,r,h,_]}class ft extends Ie{constructor(e){super(),Ae(this,e,ut,dt,Me,{target:3,played:4})}}class mt{constructor(e){ge(this,"notes");ge(this,"correct",0);ge(this,"idx",0);this.notes=e}get current(){return this.notes[this.idx]}get ended(){return this.notes.length===this.idx+1}guess(e){const t=this.current===e;return t&&(this.correct+=1),this.idx+=1,t}}const we=Ce(void 0),ze={playGuessNotes(i=10){const e=[],t=Qe(Te);console.log("range",t);for(let r=0;rt(3,n=u));let r,s,l,h;Xe(()=>{y()}),pe.subscribe(u=>{u&&u.channels[1].addListener("noteon",_)});function _(u){if(l)return;console.log("noteon",u);const v=u.rawData[1];if(!n)t(1,s={...ee(v),value:v,correct:!1});else{t(0,r={...ee(n.current),value:n.current});const N=n.guess(v);t(2,h=N?"correct":"wrong"),t(1,s={...ee(v),value:v,correct:N}),l=setTimeout(()=>{n!=null&&n.ended?(t(0,r=void 0),t(2,h="ended")):n&&(t(0,r={...ee(n.current),value:n.current}),t(2,h="waiting")),t(1,s=void 0),l=void 0},2e3)}}async function y(){const u=await Re.openMidi();"data"in u?u.data.name:u.err}function A(){t(2,h="waiting");const u=ze.playGuessNotes(),b=ee(u.current);t(0,r={...b,value:u.current})}function S(){t(2,h="waiting"),ze.clearGame()}return[r,s,h,n,A,S]}class It extends Ie{constructor(e){super(),Ae(this,e,yt,Nt,Me,{})}}export{It as component}; diff --git a/_app/version.json b/_app/version.json index 3b22a7eb..3e649df7 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1705664424802"} \ No newline at end of file +{"version":"1705665785306"} \ No newline at end of file diff --git a/index.html b/index.html index 70cb78cf..273eaf05 100644 --- a/index.html +++ b/index.html @@ -22,11 +22,11 @@ - + - + - + @@ -34,7 +34,7 @@