From 9fcce7f31fde4699506c6d00d91087b31c55d996 Mon Sep 17 00:00:00 2001 From: Moshe Gordon Radian Date: Fri, 8 Mar 2024 22:24:54 +0200 Subject: [PATCH] chore: update static dist folder --- .../dist/assets/index-4sK4E3Wk.css | 1 - .../dist/assets/index-GuiIu7V1.css | 1 + .../dist/assets/index-HxL5fAOE.js | 289 ------------------ .../dist/assets/index-rEEADXRV.js | 289 ++++++++++++++++++ .../dist/index.html | 4 +- 5 files changed, 292 insertions(+), 292 deletions(-) delete mode 100644 musicxml-singer-with-oddvoices/dist/assets/index-4sK4E3Wk.css create mode 100644 musicxml-singer-with-oddvoices/dist/assets/index-GuiIu7V1.css delete mode 100644 musicxml-singer-with-oddvoices/dist/assets/index-HxL5fAOE.js create mode 100644 musicxml-singer-with-oddvoices/dist/assets/index-rEEADXRV.js diff --git a/musicxml-singer-with-oddvoices/dist/assets/index-4sK4E3Wk.css b/musicxml-singer-with-oddvoices/dist/assets/index-4sK4E3Wk.css deleted file mode 100644 index 7704ff6..0000000 --- a/musicxml-singer-with-oddvoices/dist/assets/index-4sK4E3Wk.css +++ /dev/null @@ -1 +0,0 @@ -#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/musicxml-singer-with-oddvoices/dist/assets/index-GuiIu7V1.css b/musicxml-singer-with-oddvoices/dist/assets/index-GuiIu7V1.css new file mode 100644 index 0000000..3328bbb --- /dev/null +++ b/musicxml-singer-with-oddvoices/dist/assets/index-GuiIu7V1.css @@ -0,0 +1 @@ +._GzYRV{line-height:1.2;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}._3eOF8{margin-right:5px;font-weight:700}._1MFti{cursor:pointer}._f10Tu{font-size:1.2em;margin-right:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._1UmXx:after{content:"▸"}._1LId0:after{content:"▾"}._1pNG9{margin-right:5px}._1pNG9:after{content:"...";font-size:.8em}._2IvMF{background:#eee}._2bkNM{margin:0 10px;padding:0}._1MGIk{font-weight:600;margin-right:5px;color:#000}._3uHL6{color:#000}._2T6PJ,._1Gho6{color:#df113a}._vGjyY{color:#2a3f3c}._1bQdo{color:#0b75f5}._3zQKs{color:#469038}._1xvuR{color:#43413d}._oLqym,._2AXVT,._2KJWg{color:#000}._11RoI{background:#002b36}._17H2C,._3QHg2,._3fDAz{color:#fdf6e3}._2bSDX{font-weight:bolder;margin-right:5px;color:#fdf6e3}._gsbQL{color:#fdf6e3}._LaAZe,._GTKgm{color:#81b5ac}._Chy1W{color:#cb4b16}._2bveF{color:#d33682}._2vRm-{color:#ae81ff}._1prJR{color:#268bd2}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/musicxml-singer-with-oddvoices/dist/assets/index-HxL5fAOE.js b/musicxml-singer-with-oddvoices/dist/assets/index-HxL5fAOE.js deleted file mode 100644 index 1bbbedc..0000000 --- a/musicxml-singer-with-oddvoices/dist/assets/index-HxL5fAOE.js +++ /dev/null @@ -1,289 +0,0 @@ -var C9=Object.defineProperty;var L9=(e,t,n)=>t in e?C9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Um=(e,t,n)=>(L9(e,typeof t!="symbol"?t+"":t,n),n),$m=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Xe=(e,t,n)=>($m(e,t,"read from private field"),n?n.call(e):t.get(e)),Ft=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Mt=(e,t,n,l)=>($m(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var $d=(e,t,n,l)=>({set _(g){Mt(e,t,g,n)},get _(){return Xe(e,t,l)}}),nn=(e,t,n)=>($m(e,t,"access private method"),n);function A9(e,t){for(var n=0;nl[g]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))l(g);new MutationObserver(g=>{for(const b of g)if(b.type==="childList")for(const a of b.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function n(g){const b={};return g.integrity&&(b.integrity=g.integrity),g.referrerPolicy&&(b.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?b.credentials="include":g.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function l(g){if(g.ep)return;g.ep=!0;const b=n(g);fetch(g.href,b)}})();var ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function R9(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function l(){return this instanceof l?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(l){var g=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(n,l,g.get?g:{enumerable:!0,get:function(){return e[l]}})}),n}var U4={exports:{}},vp={},$4={exports:{}},an={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Hh=Symbol.for("react.element"),I9=Symbol.for("react.portal"),N9=Symbol.for("react.fragment"),k9=Symbol.for("react.strict_mode"),O9=Symbol.for("react.profiler"),F9=Symbol.for("react.provider"),B9=Symbol.for("react.context"),D9=Symbol.for("react.forward_ref"),V9=Symbol.for("react.suspense"),G9=Symbol.for("react.memo"),W9=Symbol.for("react.lazy"),hy=Symbol.iterator;function z9(e){return e===null||typeof e!="object"?null:(e=hy&&e[hy]||e["@@iterator"],typeof e=="function"?e:null)}var H4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j4=Object.assign,X4={};function Yu(e,t,n){this.props=e,this.context=t,this.refs=X4,this.updater=n||H4}Yu.prototype.isReactComponent={};Yu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Yu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Y4(){}Y4.prototype=Yu.prototype;function jg(e,t,n){this.props=e,this.context=t,this.refs=X4,this.updater=n||H4}var Xg=jg.prototype=new Y4;Xg.constructor=jg;j4(Xg,Yu.prototype);Xg.isPureReactComponent=!0;var dy=Array.isArray,K4=Object.prototype.hasOwnProperty,Yg={current:null},q4={key:!0,ref:!0,__self:!0,__source:!0};function Q4(e,t,n){var l,g={},b=null,a=null;if(t!=null)for(l in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(b=""+t.key),t)K4.call(t,l)&&!q4.hasOwnProperty(l)&&(g[l]=t[l]);var r=arguments.length-2;if(r===1)g.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fu=typeof window>"u"||"Deno"in window;function ts(){}function J9(e,t){return typeof e=="function"?e(t):e}function C0(e){return typeof e=="number"&&e>=0&&e!==1/0}function J4(e,t){return Math.max(e+(t||0)-Date.now(),0)}function py(e,t){const{type:n="all",exact:l,fetchStatus:g,predicate:b,queryKey:a,stale:r}=e;if(a){if(l){if(t.queryHash!==qg(a,t.options))return!1}else if(!ch(t.queryKey,a))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof r=="boolean"&&t.isStale()!==r||typeof g<"u"&&g!==t.state.fetchStatus||b&&!b(t))}function my(e,t){const{exact:n,status:l,predicate:g,mutationKey:b}=e;if(b){if(!t.options.mutationKey)return!1;if(n){if(uh(t.options.mutationKey)!==uh(b))return!1}else if(!ch(t.options.mutationKey,b))return!1}return!(l&&t.state.status!==l||g&&!g(t))}function qg(e,t){return((t==null?void 0:t.queryKeyHashFn)||uh)(e)}function uh(e){return JSON.stringify(e,(t,n)=>A0(n)?Object.keys(n).sort().reduce((l,g)=>(l[g]=n[g],l),{}):n)}function ch(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ch(e[n],t[n])):!1}function eS(e,t){if(e===t)return e;const n=gy(e)&&gy(t);if(n||A0(e)&&A0(t)){const l=n?e:Object.keys(e),g=l.length,b=n?t:Object.keys(t),a=b.length,r=n?[]:{};let h=0;for(let s=0;s"u")return!0;const n=t.prototype;return!(!by(n)||!n.hasOwnProperty("isPrototypeOf"))}function by(e){return Object.prototype.toString.call(e)==="[object Object]"}function eT(e){return new Promise(t=>{setTimeout(t,e)})}function R0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?eS(e,t):t}function tT(e,t,n=0){const l=[...e,t];return n&&l.length>n?l.slice(1):l}function nT(e,t,n=0){const l=[t,...e];return n&&l.length>n?l.slice(0,-1):l}var il,la,Eu,N4,iT=(N4=class extends jh{constructor(){super();Ft(this,il,void 0);Ft(this,la,void 0);Ft(this,Eu,void 0);Mt(this,Eu,t=>{if(!Fu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Xe(this,la)||this.setEventListener(Xe(this,Eu))}onUnsubscribe(){var t;this.hasListeners()||((t=Xe(this,la))==null||t.call(this),Mt(this,la,void 0))}setEventListener(t){var n;Mt(this,Eu,t),(n=Xe(this,la))==null||n.call(this),Mt(this,la,t(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()}))}setFocused(t){Xe(this,il)!==t&&(Mt(this,il,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Xe(this,il)=="boolean"?Xe(this,il):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},il=new WeakMap,la=new WeakMap,Eu=new WeakMap,N4),Ff=new iT,xu,ua,wu,k4,rT=(k4=class extends jh{constructor(){super();Ft(this,xu,!0);Ft(this,ua,void 0);Ft(this,wu,void 0);Mt(this,wu,t=>{if(!Fu&&window.addEventListener){const n=()=>t(!0),l=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",l)}}})}onSubscribe(){Xe(this,ua)||this.setEventListener(Xe(this,wu))}onUnsubscribe(){var t;this.hasListeners()||((t=Xe(this,ua))==null||t.call(this),Mt(this,ua,void 0))}setEventListener(t){var n;Mt(this,wu,t),(n=Xe(this,ua))==null||n.call(this),Mt(this,ua,t(this.setOnline.bind(this)))}setOnline(t){Xe(this,xu)!==t&&(Mt(this,xu,t),this.listeners.forEach(l=>{l(t)}))}isOnline(){return Xe(this,xu)}},xu=new WeakMap,ua=new WeakMap,wu=new WeakMap,k4),Bf=new rT;function sT(e){return Math.min(1e3*2**e,3e4)}function Sp(e){return(e??"online")==="online"?Bf.isOnline():!0}var tS=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jm(e){return e instanceof tS}function nS(e){let t=!1,n=0,l=!1,g,b,a;const r=new Promise((p,v)=>{b=p,a=v}),h=p=>{var v;l||(u(new tS(p)),(v=e.abort)==null||v.call(e))},s=()=>{t=!0},m=()=>{t=!1},c=()=>!Ff.isFocused()||e.networkMode!=="always"&&!Bf.isOnline(),o=p=>{var v;l||(l=!0,(v=e.onSuccess)==null||v.call(e,p),g==null||g(),b(p))},u=p=>{var v;l||(l=!0,(v=e.onError)==null||v.call(e,p),g==null||g(),a(p))},d=()=>new Promise(p=>{var v;g=S=>{const T=l||!c();return T&&p(S),T},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;g=void 0,l||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(l)return;let p;try{p=e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(o).catch(v=>{var E;if(l)return;const S=e.retry??(Fu?0:3),T=e.retryDelay??sT,P=typeof T=="function"?T(n,v):T,_=S===!0||typeof S=="number"&&n{if(c())return d()}).then(()=>{t?u(v):x()})})};return Sp(e.networkMode)?x():d().then(x),{promise:r,cancel:h,continue:()=>(g==null?void 0:g())?r:Promise.resolve(),cancelRetry:s,continueRetry:m}}function oT(){let e=[],t=0,n=o=>{o()},l=o=>{o()},g=o=>setTimeout(o,0);const b=o=>{g=o},a=o=>{let u;t++;try{u=o()}finally{t--,t||s()}return u},r=o=>{t?e.push(o):g(()=>{n(o)})},h=o=>(...u)=>{r(()=>{o(...u)})},s=()=>{const o=e;e=[],o.length&&g(()=>{l(()=>{o.forEach(u=>{n(u)})})})};return{batch:a,batchCalls:h,schedule:r,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{l=o},setScheduler:b}}var ki=oT(),rl,O4,iS=(O4=class{constructor(){Ft(this,rl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),C0(this.gcTime)&&Mt(this,rl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fu?1/0:5*60*1e3))}clearGcTimeout(){Xe(this,rl)&&(clearTimeout(Xe(this,rl)),Mt(this,rl,void 0))}},rl=new WeakMap,O4),_u,Tu,Zr,ca,Jr,Ti,Nh,sl,Pu,Sf,Cs,_o,F4,aT=(F4=class extends iS{constructor(t){super();Ft(this,Pu);Ft(this,Cs);Ft(this,_u,void 0);Ft(this,Tu,void 0);Ft(this,Zr,void 0);Ft(this,ca,void 0);Ft(this,Jr,void 0);Ft(this,Ti,void 0);Ft(this,Nh,void 0);Ft(this,sl,void 0);Mt(this,sl,!1),Mt(this,Nh,t.defaultOptions),nn(this,Pu,Sf).call(this,t.options),Mt(this,Ti,[]),Mt(this,Zr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Mt(this,_u,t.state||lT(this.options)),this.state=Xe(this,_u),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Xe(this,Ti).length&&this.state.fetchStatus==="idle"&&Xe(this,Zr).remove(this)}setData(t,n){const l=R0(this.state.data,t,this.options);return nn(this,Cs,_o).call(this,{data:l,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),l}setState(t,n){nn(this,Cs,_o).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var l;const n=Xe(this,ca);return(l=Xe(this,Jr))==null||l.cancel(t),n?n.then(ts).catch(ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Xe(this,_u))}isActive(){return Xe(this,Ti).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Xe(this,Ti).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!J4(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Xe(this,Ti).find(l=>l.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Xe(this,Jr))==null||n.continue()}onOnline(){var n;const t=Xe(this,Ti).find(l=>l.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Xe(this,Jr))==null||n.continue()}addObserver(t){Xe(this,Ti).includes(t)||(Xe(this,Ti).push(t),this.clearGcTimeout(),Xe(this,Zr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Xe(this,Ti).includes(t)&&(Mt(this,Ti,Xe(this,Ti).filter(n=>n!==t)),Xe(this,Ti).length||(Xe(this,Jr)&&(Xe(this,sl)?Xe(this,Jr).cancel({revert:!0}):Xe(this,Jr).cancelRetry()),this.scheduleGc()),Xe(this,Zr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Xe(this,Ti).length}invalidate(){this.state.isInvalidated||nn(this,Cs,_o).call(this,{type:"invalidate"})}fetch(t,n){var s,m,c,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Xe(this,ca))return(s=Xe(this,Jr))==null||s.continueRetry(),Xe(this,ca)}if(t&&nn(this,Pu,Sf).call(this,t),!this.options.queryFn){const u=Xe(this,Ti).find(d=>d.options.queryFn);u&&nn(this,Pu,Sf).call(this,u.options)}const l=new AbortController,g={queryKey:this.queryKey,meta:this.meta},b=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(Mt(this,sl,!0),l.signal)})};b(g);const a=()=>this.options.queryFn?(Mt(this,sl,!1),this.options.persister?this.options.persister(this.options.queryFn,g,this):this.options.queryFn(g)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),r={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};b(r),(m=this.options.behavior)==null||m.onFetch(r,this),Mt(this,Tu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=r.fetchOptions)==null?void 0:c.meta))&&nn(this,Cs,_o).call(this,{type:"fetch",meta:(o=r.fetchOptions)==null?void 0:o.meta});const h=u=>{var d,x,p,v;jm(u)&&u.silent||nn(this,Cs,_o).call(this,{type:"error",error:u}),jm(u)||((x=(d=Xe(this,Zr).config).onError)==null||x.call(d,u,this),(v=(p=Xe(this,Zr).config).onSettled)==null||v.call(p,this.state.data,u,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Mt(this,Jr,nS({fn:r.fetchFn,abort:l.abort.bind(l),onSuccess:u=>{var d,x,p,v;if(typeof u>"u"){h(new Error(`${this.queryHash} data is undefined`));return}this.setData(u),(x=(d=Xe(this,Zr).config).onSuccess)==null||x.call(d,u,this),(v=(p=Xe(this,Zr).config).onSettled)==null||v.call(p,u,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:h,onFail:(u,d)=>{nn(this,Cs,_o).call(this,{type:"failed",failureCount:u,error:d})},onPause:()=>{nn(this,Cs,_o).call(this,{type:"pause"})},onContinue:()=>{nn(this,Cs,_o).call(this,{type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode})),Mt(this,ca,Xe(this,Jr).promise),Xe(this,ca)}},_u=new WeakMap,Tu=new WeakMap,Zr=new WeakMap,ca=new WeakMap,Jr=new WeakMap,Ti=new WeakMap,Nh=new WeakMap,sl=new WeakMap,Pu=new WeakSet,Sf=function(t){this.options={...Xe(this,Nh),...t},this.updateGcTime(this.options.gcTime)},Cs=new WeakSet,_o=function(t){const n=l=>{switch(t.type){case"failed":return{...l,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Sp(this.options.networkMode)?"fetching":"paused",...!l.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...l,data:t.data,dataUpdateCount:l.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const g=t.error;return jm(g)&&g.revert&&Xe(this,Tu)?{...Xe(this,Tu),fetchStatus:"idle"}:{...l,error:g,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:g,fetchStatus:"idle",status:"error"};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...t.state}}};this.state=n(this.state),ki.batch(()=>{Xe(this,Ti).forEach(l=>{l.onQueryUpdate()}),Xe(this,Zr).notify({query:this,type:"updated",action:t})})},F4);function lT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",l=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Zs,B4,uT=(B4=class extends jh{constructor(t={}){super();Ft(this,Zs,void 0);this.config=t,Mt(this,Zs,new Map)}build(t,n,l){const g=n.queryKey,b=n.queryHash??qg(g,n);let a=this.get(b);return a||(a=new aT({cache:this,queryKey:g,queryHash:b,options:t.defaultQueryOptions(n),state:l,defaultOptions:t.getQueryDefaults(g)}),this.add(a)),a}add(t){Xe(this,Zs).has(t.queryHash)||(Xe(this,Zs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Xe(this,Zs).get(t.queryHash);n&&(t.destroy(),n===t&&Xe(this,Zs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ki.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Xe(this,Zs).get(t)}getAll(){return[...Xe(this,Zs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(l=>py(n,l))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(l=>py(t,l)):n}notify(t){ki.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ki.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ki.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zs=new WeakMap,B4),Js,kh,Nr,Mu,eo,na,D4,cT=(D4=class extends iS{constructor(t){super();Ft(this,eo);Ft(this,Js,void 0);Ft(this,kh,void 0);Ft(this,Nr,void 0);Ft(this,Mu,void 0);this.mutationId=t.mutationId,Mt(this,kh,t.defaultOptions),Mt(this,Nr,t.mutationCache),Mt(this,Js,[]),this.state=t.state||hT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Xe(this,kh),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Xe(this,Js).includes(t)||(Xe(this,Js).push(t),this.clearGcTimeout(),Xe(this,Nr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Mt(this,Js,Xe(this,Js).filter(n=>n!==t)),this.scheduleGc(),Xe(this,Nr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Xe(this,Js).length||(this.state.status==="pending"?this.scheduleGc():Xe(this,Nr).remove(this))}continue(){var t;return((t=Xe(this,Mu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var g,b,a,r,h,s,m,c,o,u,d,x,p,v,S,T,P,_,E,M;const n=()=>(Mt(this,Mu,nS({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(N,I)=>{nn(this,eo,na).call(this,{type:"failed",failureCount:N,error:I})},onPause:()=>{nn(this,eo,na).call(this,{type:"pause"})},onContinue:()=>{nn(this,eo,na).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Xe(this,Mu).promise),l=this.state.status==="pending";try{if(!l){nn(this,eo,na).call(this,{type:"pending",variables:t}),await((b=(g=Xe(this,Nr).config).onMutate)==null?void 0:b.call(g,t,this));const I=await((r=(a=this.options).onMutate)==null?void 0:r.call(a,t));I!==this.state.context&&nn(this,eo,na).call(this,{type:"pending",context:I,variables:t})}const N=await n();return await((s=(h=Xe(this,Nr).config).onSuccess)==null?void 0:s.call(h,N,t,this.state.context,this)),await((c=(m=this.options).onSuccess)==null?void 0:c.call(m,N,t,this.state.context)),await((u=(o=Xe(this,Nr).config).onSettled)==null?void 0:u.call(o,N,null,this.state.variables,this.state.context,this)),await((x=(d=this.options).onSettled)==null?void 0:x.call(d,N,null,t,this.state.context)),nn(this,eo,na).call(this,{type:"success",data:N}),N}catch(N){try{throw await((v=(p=Xe(this,Nr).config).onError)==null?void 0:v.call(p,N,t,this.state.context,this)),await((T=(S=this.options).onError)==null?void 0:T.call(S,N,t,this.state.context)),await((_=(P=Xe(this,Nr).config).onSettled)==null?void 0:_.call(P,void 0,N,this.state.variables,this.state.context,this)),await((M=(E=this.options).onSettled)==null?void 0:M.call(E,void 0,N,t,this.state.context)),N}finally{nn(this,eo,na).call(this,{type:"error",error:N})}}}},Js=new WeakMap,kh=new WeakMap,Nr=new WeakMap,Mu=new WeakMap,eo=new WeakSet,na=function(t){const n=l=>{switch(t.type){case"failed":return{...l,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Sp(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...l,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:t.error,failureCount:l.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ki.batch(()=>{Xe(this,Js).forEach(l=>{l.onMutationUpdate(t)}),Xe(this,Nr).notify({mutation:this,type:"updated",action:t})})},D4);function hT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var es,Oh,ol,V4,dT=(V4=class extends jh{constructor(t={}){super();Ft(this,es,void 0);Ft(this,Oh,void 0);Ft(this,ol,void 0);this.config=t,Mt(this,es,[]),Mt(this,Oh,0)}build(t,n,l){const g=new cT({mutationCache:this,mutationId:++$d(this,Oh)._,options:t.defaultMutationOptions(n),state:l});return this.add(g),g}add(t){Xe(this,es).push(t),this.notify({type:"added",mutation:t})}remove(t){Mt(this,es,Xe(this,es).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){ki.batch(()=>{Xe(this,es).forEach(t=>{this.remove(t)})})}getAll(){return Xe(this,es)}find(t){const n={exact:!0,...t};return Xe(this,es).find(l=>my(n,l))}findAll(t={}){return Xe(this,es).filter(n=>my(t,n))}notify(t){ki.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Mt(this,ol,(Xe(this,ol)??Promise.resolve()).then(()=>{const t=Xe(this,es).filter(n=>n.state.isPaused);return ki.batch(()=>t.reduce((n,l)=>n.then(()=>l.continue().catch(ts)),Promise.resolve()))}).then(()=>{Mt(this,ol,void 0)})),Xe(this,ol)}},es=new WeakMap,Oh=new WeakMap,ol=new WeakMap,V4);function fT(e){return{onFetch:(t,n)=>{const l=async()=>{var d,x,p,v,S;const g=t.options,b=(p=(x=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:x.fetchMore)==null?void 0:p.direction,a=((v=t.state.data)==null?void 0:v.pages)||[],r=((S=t.state.data)==null?void 0:S.pageParams)||[],h={pages:[],pageParams:[]};let s=!1;const m=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?s=!0:t.signal.addEventListener("abort",()=>{s=!0}),t.signal)})},c=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),o=async(T,P,_)=>{if(s)return Promise.reject();if(P==null&&T.pages.length)return Promise.resolve(T);const E={queryKey:t.queryKey,pageParam:P,direction:_?"backward":"forward",meta:t.options.meta};m(E);const M=await c(E),{maxPages:N}=t.options,I=_?nT:tT;return{pages:I(T.pages,M,N),pageParams:I(T.pageParams,P,N)}};let u;if(b&&a.length){const T=b==="backward",P=T?pT:yy,_={pages:a,pageParams:r},E=P(g,_);u=await o(_,E,T)}else{u=await o(h,r[0]??g.initialPageParam);const T=e??a.length;for(let P=1;P{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function yy(e,{pages:t,pageParams:n}){const l=t.length-1;return e.getNextPageParam(t[l],t,n[l],n)}function pT(e,{pages:t,pageParams:n}){var l;return(l=e.getPreviousPageParam)==null?void 0:l.call(e,t[0],t,n[0],n)}var vi,ha,da,Cu,Lu,fa,Au,Ru,G4,mT=(G4=class{constructor(e={}){Ft(this,vi,void 0);Ft(this,ha,void 0);Ft(this,da,void 0);Ft(this,Cu,void 0);Ft(this,Lu,void 0);Ft(this,fa,void 0);Ft(this,Au,void 0);Ft(this,Ru,void 0);Mt(this,vi,e.queryCache||new uT),Mt(this,ha,e.mutationCache||new dT),Mt(this,da,e.defaultOptions||{}),Mt(this,Cu,new Map),Mt(this,Lu,new Map),Mt(this,fa,0)}mount(){$d(this,fa)._++,Xe(this,fa)===1&&(Mt(this,Au,Ff.subscribe(()=>{Ff.isFocused()&&(this.resumePausedMutations(),Xe(this,vi).onFocus())})),Mt(this,Ru,Bf.subscribe(()=>{Bf.isOnline()&&(this.resumePausedMutations(),Xe(this,vi).onOnline())})))}unmount(){var e,t;$d(this,fa)._--,Xe(this,fa)===0&&((e=Xe(this,Au))==null||e.call(this),Mt(this,Au,void 0),(t=Xe(this,Ru))==null||t.call(this),Mt(this,Ru,void 0))}isFetching(e){return Xe(this,vi).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Xe(this,ha).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Xe(this,vi).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const l=n.data;return[t,l]})}setQueryData(e,t,n){const l=Xe(this,vi).find({queryKey:e}),g=l==null?void 0:l.state.data,b=J9(t,g);if(typeof b>"u")return;const a=this.defaultQueryOptions({queryKey:e});return Xe(this,vi).build(this,a).setData(b,{...n,manual:!0})}setQueriesData(e,t,n){return ki.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,t,n)]))}getQueryState(e){var t;return(t=Xe(this,vi).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Xe(this,vi);ki.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Xe(this,vi),l={type:"active",...e};return ki.batch(()=>(n.findAll(e).forEach(g=>{g.reset()}),this.refetchQueries(l,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},l=ki.batch(()=>Xe(this,vi).findAll(e).map(g=>g.cancel(n)));return Promise.all(l).then(ts).catch(ts)}invalidateQueries(e={},t={}){return ki.batch(()=>{if(Xe(this,vi).findAll(e).forEach(l=>{l.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},l=ki.batch(()=>Xe(this,vi).findAll(e).filter(g=>!g.isDisabled()).map(g=>{let b=g.fetch(void 0,n);return n.throwOnError||(b=b.catch(ts)),g.state.fetchStatus==="paused"?Promise.resolve():b}));return Promise.all(l).then(ts)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Xe(this,vi).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ts).catch(ts)}fetchInfiniteQuery(e){return e.behavior=fT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ts).catch(ts)}resumePausedMutations(){return Xe(this,ha).resumePausedMutations()}getQueryCache(){return Xe(this,vi)}getMutationCache(){return Xe(this,ha)}getDefaultOptions(){return Xe(this,da)}setDefaultOptions(e){Mt(this,da,e)}setQueryDefaults(e,t){Xe(this,Cu).set(uh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Xe(this,Cu).values()];let n={};return t.forEach(l=>{ch(e,l.queryKey)&&(n={...n,...l.defaultOptions})}),n}setMutationDefaults(e,t){Xe(this,Lu).set(uh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Xe(this,Lu).values()];let n={};return t.forEach(l=>{ch(e,l.mutationKey)&&(n={...n,...l.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Xe(this,da).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qg(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Xe(this,da).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Xe(this,vi).clear(),Xe(this,ha).clear()}},vi=new WeakMap,ha=new WeakMap,da=new WeakMap,Cu=new WeakMap,Lu=new WeakMap,fa=new WeakMap,Au=new WeakMap,Ru=new WeakMap,G4),Sr,Gn,Fh,Ji,al,Iu,to,Bh,Nu,ku,ll,ul,pa,Ou,cl,$c,Dh,I0,Vh,N0,Gh,k0,Wh,O0,zh,F0,Uh,B0,$h,D0,yp,rS,W4,gT=(W4=class extends jh{constructor(t,n){super();Ft(this,cl);Ft(this,Dh);Ft(this,Vh);Ft(this,Gh);Ft(this,Wh);Ft(this,zh);Ft(this,Uh);Ft(this,$h);Ft(this,yp);Ft(this,Sr,void 0);Ft(this,Gn,void 0);Ft(this,Fh,void 0);Ft(this,Ji,void 0);Ft(this,al,void 0);Ft(this,Iu,void 0);Ft(this,to,void 0);Ft(this,Bh,void 0);Ft(this,Nu,void 0);Ft(this,ku,void 0);Ft(this,ll,void 0);Ft(this,ul,void 0);Ft(this,pa,void 0);Ft(this,Ou,new Set);this.options=n,Mt(this,Sr,t),Mt(this,to,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Xe(this,Gn).addObserver(this),vy(Xe(this,Gn),this.options)?nn(this,cl,$c).call(this):this.updateResult(),nn(this,Wh,O0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return V0(Xe(this,Gn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return V0(Xe(this,Gn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,nn(this,zh,F0).call(this),nn(this,Uh,B0).call(this),Xe(this,Gn).removeObserver(this)}setOptions(t,n){const l=this.options,g=Xe(this,Gn);if(this.options=Xe(this,Sr).defaultQueryOptions(t),L0(l,this.options)||Xe(this,Sr).getQueryCache().notify({type:"observerOptionsUpdated",query:Xe(this,Gn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=l.queryKey),nn(this,$h,D0).call(this);const b=this.hasListeners();b&&Sy(Xe(this,Gn),g,this.options,l)&&nn(this,cl,$c).call(this),this.updateResult(n),b&&(Xe(this,Gn)!==g||this.options.enabled!==l.enabled||this.options.staleTime!==l.staleTime)&&nn(this,Dh,I0).call(this);const a=nn(this,Vh,N0).call(this);b&&(Xe(this,Gn)!==g||this.options.enabled!==l.enabled||a!==Xe(this,pa))&&nn(this,Gh,k0).call(this,a)}getOptimisticResult(t){const n=Xe(this,Sr).getQueryCache().build(Xe(this,Sr),t),l=this.createResult(n,t);return yT(this,l)&&(Mt(this,Ji,l),Mt(this,Iu,this.options),Mt(this,al,Xe(this,Gn).state)),l}getCurrentResult(){return Xe(this,Ji)}trackResult(t){const n={};return Object.keys(t).forEach(l=>{Object.defineProperty(n,l,{configurable:!1,enumerable:!0,get:()=>(Xe(this,Ou).add(l),t[l])})}),n}getCurrentQuery(){return Xe(this,Gn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Xe(this,Sr).defaultQueryOptions(t),l=Xe(this,Sr).getQueryCache().build(Xe(this,Sr),n);return l.isFetchingOptimistic=!0,l.fetch().then(()=>this.createResult(l,n))}fetch(t){return nn(this,cl,$c).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Xe(this,Ji)))}createResult(t,n){var E;const l=Xe(this,Gn),g=this.options,b=Xe(this,Ji),a=Xe(this,al),r=Xe(this,Iu),s=t!==l?t.state:Xe(this,Fh),{state:m}=t;let{error:c,errorUpdatedAt:o,fetchStatus:u,status:d}=m,x=!1,p;if(n._optimisticResults){const M=this.hasListeners(),N=!M&&vy(t,n),I=M&&Sy(t,l,n,g);(N||I)&&(u=Sp(t.options.networkMode)?"fetching":"paused",m.dataUpdatedAt||(d="pending")),n._optimisticResults==="isRestoring"&&(u="idle")}if(n.select&&typeof m.data<"u")if(b&&m.data===(a==null?void 0:a.data)&&n.select===Xe(this,Bh))p=Xe(this,Nu);else try{Mt(this,Bh,n.select),p=n.select(m.data),p=R0(b==null?void 0:b.data,p,n),Mt(this,Nu,p),Mt(this,to,null)}catch(M){Mt(this,to,M)}else p=m.data;if(typeof n.placeholderData<"u"&&typeof p>"u"&&d==="pending"){let M;if(b!=null&&b.isPlaceholderData&&n.placeholderData===(r==null?void 0:r.placeholderData))M=b.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((E=Xe(this,ku))==null?void 0:E.state.data,Xe(this,ku)):n.placeholderData,n.select&&typeof M<"u")try{M=n.select(M),Mt(this,to,null)}catch(N){Mt(this,to,N)}typeof M<"u"&&(d="success",p=R0(b==null?void 0:b.data,M,n),x=!0)}Xe(this,to)&&(c=Xe(this,to),p=Xe(this,Nu),o=Date.now(),d="error");const v=u==="fetching",S=d==="pending",T=d==="error",P=S&&v;return{status:d,fetchStatus:u,isPending:S,isSuccess:d==="success",isError:T,isInitialLoading:P,isLoading:P,data:p,dataUpdatedAt:m.dataUpdatedAt,error:c,errorUpdatedAt:o,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>s.dataUpdateCount||m.errorUpdateCount>s.errorUpdateCount,isFetching:v,isRefetching:v&&!S,isLoadingError:T&&m.dataUpdatedAt===0,isPaused:u==="paused",isPlaceholderData:x,isRefetchError:T&&m.dataUpdatedAt!==0,isStale:Qg(t,n),refetch:this.refetch}}updateResult(t){const n=Xe(this,Ji),l=this.createResult(Xe(this,Gn),this.options);if(Mt(this,al,Xe(this,Gn).state),Mt(this,Iu,this.options),Xe(this,al).data!==void 0&&Mt(this,ku,Xe(this,Gn)),L0(l,n))return;Mt(this,Ji,l);const g={},b=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!Xe(this,Ou).size)return!0;const h=new Set(r??Xe(this,Ou));return this.options.throwOnError&&h.add("error"),Object.keys(Xe(this,Ji)).some(s=>{const m=s;return Xe(this,Ji)[m]!==n[m]&&h.has(m)})};(t==null?void 0:t.listeners)!==!1&&b()&&(g.listeners=!0),nn(this,yp,rS).call(this,{...g,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&nn(this,Wh,O0).call(this)}},Sr=new WeakMap,Gn=new WeakMap,Fh=new WeakMap,Ji=new WeakMap,al=new WeakMap,Iu=new WeakMap,to=new WeakMap,Bh=new WeakMap,Nu=new WeakMap,ku=new WeakMap,ll=new WeakMap,ul=new WeakMap,pa=new WeakMap,Ou=new WeakMap,cl=new WeakSet,$c=function(t){nn(this,$h,D0).call(this);let n=Xe(this,Gn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ts)),n},Dh=new WeakSet,I0=function(){if(nn(this,zh,F0).call(this),Fu||Xe(this,Ji).isStale||!C0(this.options.staleTime))return;const n=J4(Xe(this,Ji).dataUpdatedAt,this.options.staleTime)+1;Mt(this,ll,setTimeout(()=>{Xe(this,Ji).isStale||this.updateResult()},n))},Vh=new WeakSet,N0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Xe(this,Gn)):this.options.refetchInterval)??!1},Gh=new WeakSet,k0=function(t){nn(this,Uh,B0).call(this),Mt(this,pa,t),!(Fu||this.options.enabled===!1||!C0(Xe(this,pa))||Xe(this,pa)===0)&&Mt(this,ul,setInterval(()=>{(this.options.refetchIntervalInBackground||Ff.isFocused())&&nn(this,cl,$c).call(this)},Xe(this,pa)))},Wh=new WeakSet,O0=function(){nn(this,Dh,I0).call(this),nn(this,Gh,k0).call(this,nn(this,Vh,N0).call(this))},zh=new WeakSet,F0=function(){Xe(this,ll)&&(clearTimeout(Xe(this,ll)),Mt(this,ll,void 0))},Uh=new WeakSet,B0=function(){Xe(this,ul)&&(clearInterval(Xe(this,ul)),Mt(this,ul,void 0))},$h=new WeakSet,D0=function(){const t=Xe(this,Sr).getQueryCache().build(Xe(this,Sr),this.options);if(t===Xe(this,Gn))return;const n=Xe(this,Gn);Mt(this,Gn,t),Mt(this,Fh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},yp=new WeakSet,rS=function(t){ki.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Xe(this,Ji))}),Xe(this,Sr).getQueryCache().notify({query:Xe(this,Gn),type:"observerResultsUpdated"})})},W4);function bT(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vy(e,t){return bT(e,t)||e.state.dataUpdatedAt>0&&V0(e,t,t.refetchOnMount)}function V0(e,t,n){if(t.enabled!==!1){const l=typeof n=="function"?n(e):n;return l==="always"||l!==!1&&Qg(e,t)}return!1}function Sy(e,t,n,l){return n.enabled!==!1&&(e!==t||l.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Qg(e,n)}function Qg(e,t){return e.isStaleByTime(t.staleTime)}function yT(e,t){return!L0(e.getCurrentResult(),t)}var sS=ke.createContext(void 0),vT=e=>{const t=ke.useContext(sS);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ST=({client:e,children:t})=>(ke.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Be.jsx(sS.Provider,{value:e,children:t})),oS=ke.createContext(!1),ET=()=>ke.useContext(oS);oS.Provider;function xT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var wT=ke.createContext(xT()),_T=()=>ke.useContext(wT);function TT(e,t){return typeof e=="function"?e(...t):!!e}var PT=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},MT=e=>{ke.useEffect(()=>{e.clearReset()},[e])},CT=({result:e,errorResetBoundary:t,throwOnError:n,query:l})=>e.isError&&!t.isReset()&&!e.isFetching&&l&&TT(n,[e.error,l]),LT=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},AT=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,RT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function IT(e,t,n){const l=vT(n),g=ET(),b=_T(),a=l.defaultQueryOptions(e);a._optimisticResults=g?"isRestoring":"optimistic",LT(a),PT(a,b),MT(b);const[r]=ke.useState(()=>new t(l,a)),h=r.getOptimisticResult(a);if(ke.useSyncExternalStore(ke.useCallback(s=>{const m=g?()=>{}:r.subscribe(ki.batchCalls(s));return r.updateResult(),m},[r,g]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),ke.useEffect(()=>{r.setOptions(a,{listeners:!1})},[a,r]),AT(a,h))throw RT(a,r,b);if(CT({result:h,errorResetBoundary:b,throwOnError:a.throwOnError,query:l.getQueryCache().get(a.queryHash)}))throw h.error;return a.notifyOnChangeProps?h:r.trackResult(h)}function NT(e,t){return IT(e,gT,t)}var G0={},aS={exports:{}},Wr={},lS={exports:{}},uS={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,H){var ne=L.length;L.push(H);e:for(;0>>1,be=L[ie];if(0>>1;ieg(ce,ne))eeg(ye,ce)?(L[ie]=ye,L[ee]=ne,ie=ee):(L[ie]=ce,L[ge]=ne,ie=ge);else if(eeg(ye,ne))L[ie]=ye,L[ee]=ne,ie=ee;else break e}}return H}function g(L,H){var ne=L.sortIndex-H.sortIndex;return ne!==0?ne:L.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var b=performance;e.unstable_now=function(){return b.now()}}else{var a=Date,r=a.now();e.unstable_now=function(){return a.now()-r}}var h=[],s=[],m=1,c=null,o=3,u=!1,d=!1,x=!1,p=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(L){for(var H=n(s);H!==null;){if(H.callback===null)l(s);else if(H.startTime<=L)l(s),H.sortIndex=H.expirationTime,t(h,H);else break;H=n(s)}}function P(L){if(x=!1,T(L),!d)if(n(h)!==null)d=!0,G(_);else{var H=n(s);H!==null&&X(P,H.startTime-L)}}function _(L,H){d=!1,x&&(x=!1,v(N),N=-1),u=!0;var ne=o;try{for(T(H),c=n(h);c!==null&&(!(c.expirationTime>H)||L&&!V());){var ie=c.callback;if(typeof ie=="function"){c.callback=null,o=c.priorityLevel;var be=ie(c.expirationTime<=H);H=e.unstable_now(),typeof be=="function"?c.callback=be:c===n(h)&&l(h),T(H)}else l(h);c=n(h)}if(c!==null)var ae=!0;else{var ge=n(s);ge!==null&&X(P,ge.startTime-H),ae=!1}return ae}finally{c=null,o=ne,u=!1}}var E=!1,M=null,N=-1,I=5,R=-1;function V(){return!(e.unstable_now()-RL||125ie?(L.sortIndex=ne,t(s,L),n(h)===null&&L===n(s)&&(x?(v(N),N=-1):x=!0,X(P,ne-ie))):(L.sortIndex=be,t(h,L),d||u||(d=!0,G(_))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var H=o;return function(){var ne=o;o=H;try{return L.apply(this,arguments)}finally{o=ne}}}})(uS);lS.exports=uS;var kT=lS.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var cS=ke,Gr=kT;function mt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),W0=Object.prototype.hasOwnProperty,OT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ey={},xy={};function FT(e){return W0.call(xy,e)?!0:W0.call(Ey,e)?!1:OT.test(e)?xy[e]=!0:(Ey[e]=!0,!1)}function BT(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function DT(e,t,n,l){if(t===null||typeof t>"u"||BT(e,t,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rr(e,t,n,l,g,b,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=g,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=b,this.removeEmptyString=a}var Fi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fi[e]=new rr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fi[t]=new rr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fi[e]=new rr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fi[e]=new rr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fi[e]=new rr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fi[e]=new rr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fi[e]=new rr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fi[e]=new rr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fi[e]=new rr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zg=/[\-:]([a-z])/g;function Jg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zg,Jg);Fi[t]=new rr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zg,Jg);Fi[t]=new rr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zg,Jg);Fi[t]=new rr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fi[e]=new rr(e,1,!1,e.toLowerCase(),null,!1,!1)});Fi.xlinkHref=new rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fi[e]=new rr(e,1,!1,e.toLowerCase(),null,!0,!0)});function e2(e,t,n,l){var g=Fi.hasOwnProperty(t)?Fi[t]:null;(g!==null?g.type!==0:l||!(2r||g[a]!==b[r]){var h=` -`+g[a].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=a&&0<=r);break}}}finally{Ym=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hc(e):""}function VT(e){switch(e.tag){case 5:return Hc(e.type);case 16:return Hc("Lazy");case 13:return Hc("Suspense");case 19:return Hc("SuspenseList");case 0:case 2:case 15:return e=Km(e.type,!1),e;case 11:return e=Km(e.type.render,!1),e;case 1:return e=Km(e.type,!0),e;default:return""}}function H0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jl:return"Fragment";case Zl:return"Portal";case z0:return"Profiler";case t2:return"StrictMode";case U0:return"Suspense";case $0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fS:return(e.displayName||"Context")+".Consumer";case dS:return(e._context.displayName||"Context")+".Provider";case n2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case i2:return t=e.displayName||null,t!==null?t:H0(e.type)||"Memo";case ia:t=e._payload,e=e._init;try{return H0(e(t))}catch{}}return null}function GT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H0(t);case 8:return t===t2?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ta(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WT(e){var t=mS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var g=n.get,b=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return g.call(this)},set:function(a){l=""+a,b.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(a){l=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xd(e){e._valueTracker||(e._valueTracker=WT(e))}function gS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=mS(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Df(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function j0(e,t){var n=t.checked;return Jn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _y(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=Ta(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function bS(e,t){t=t.checked,t!=null&&e2(e,"checked",t,!1)}function X0(e,t){bS(e,t);var n=Ta(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Y0(e,t.type,n):t.hasOwnProperty("defaultValue")&&Y0(e,t.type,Ta(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ty(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Y0(e,t,n){(t!=="number"||Df(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jc=Array.isArray;function du(e,t,n,l){if(e=e.options,t){t={};for(var g=0;g"+t.valueOf().toString()+"",t=Yd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zT=["Webkit","ms","Moz","O"];Object.keys(qc).forEach(function(e){zT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qc[t]=qc[e]})});function ES(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qc.hasOwnProperty(e)&&qc[e]?(""+t).trim():t+"px"}function xS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,g=ES(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,g):e[n]=g}}var UT=Jn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Q0(e,t){if(t){if(UT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(mt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(mt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(mt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(mt(62))}}function Z0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var J0=null;function r2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var eg=null,fu=null,pu=null;function Cy(e){if(e=Kh(e)){if(typeof eg!="function")throw Error(mt(280));var t=e.stateNode;t&&(t=Tp(t),eg(e.stateNode,e.type,t))}}function wS(e){fu?pu?pu.push(e):pu=[e]:fu=e}function _S(){if(fu){var e=fu,t=pu;if(pu=fu=null,Cy(e),t)for(e=0;e>>=0,e===0?32:31-(eP(e)/tP|0)|0}var Kd=64,qd=4194304;function Xc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zf(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,g=e.suspendedLanes,b=e.pingedLanes,a=n&268435455;if(a!==0){var r=a&~g;r!==0?l=Xc(r):(b&=a,b!==0&&(l=Xc(b)))}else a=n&~g,a!==0?l=Xc(a):b!==0&&(l=Xc(b));if(l===0)return 0;if(t!==0&&t!==l&&!(t&g)&&(g=l&-l,b=t&-t,g>=b||g===16&&(b&4194240)!==0))return t;if(l&4&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0n;n++)t.push(e);return t}function Xh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rs(t),e[t]=n}function sP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0=Zc),By=" ",Dy=!1;function $S(e,t){switch(e){case"keyup":return NP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var eu=!1;function OP(e,t){switch(e){case"compositionend":return HS(t);case"keypress":return t.which!==32?null:(Dy=!0,By);case"textInput":return e=t.data,e===By&&Dy?null:e;default:return null}}function FP(e,t){if(eu)return e==="compositionend"||!d2&&$S(e,t)?(e=zS(),xf=u2=ma=null,eu=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zy(n)}}function KS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?KS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qS(){for(var e=window,t=Df();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Df(e.document)}return t}function f2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function HP(e){var t=qS(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&KS(n.ownerDocument.documentElement,n)){if(l!==null&&f2(n)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var g=n.textContent.length,b=Math.min(l.start,g);l=l.end===void 0?b:Math.min(l.end,g),!e.extend&&b>l&&(g=l,l=b,b=g),g=Uy(n,b);var a=Uy(n,l);g&&a&&(e.rangeCount!==1||e.anchorNode!==g.node||e.anchorOffset!==g.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(g.node,g.offset),e.removeAllRanges(),b>l?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,tu=null,og=null,eh=null,ag=!1;function $y(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ag||tu==null||tu!==Df(l)||(l=tu,"selectionStart"in l&&f2(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),eh&&yh(eh,l)||(eh=l,l=Hf(og,"onSelect"),0ru||(e.current=fg[ru],fg[ru]=null,ru--)}function Fn(e,t){ru++,fg[ru]=e.current,e.current=t}var Pa={},$i=Ra(Pa),wr=Ra(!1),fl=Pa;function Du(e,t){var n=e.type.contextTypes;if(!n)return Pa;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in n)g[b]=t[b];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=g),g}function _r(e){return e=e.childContextTypes,e!=null}function Xf(){zn(wr),zn($i)}function Qy(e,t,n){if($i.current!==Pa)throw Error(mt(168));Fn($i,t),Fn(wr,n)}function s5(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var g in l)if(!(g in t))throw Error(mt(108,GT(e)||"Unknown",g));return Jn({},n,l)}function Yf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pa,fl=$i.current,Fn($i,e),Fn(wr,wr.current),!0}function Zy(e,t,n){var l=e.stateNode;if(!l)throw Error(mt(169));n?(e=s5(e,t,fl),l.__reactInternalMemoizedMergedChildContext=e,zn(wr),zn($i),Fn($i,e)):zn(wr),Fn(wr,n)}var Mo=null,Pp=!1,u0=!1;function o5(e){Mo===null?Mo=[e]:Mo.push(e)}function iM(e){Pp=!0,o5(e)}function Ia(){if(!u0&&Mo!==null){u0=!0;var e=0,t=Ln;try{var n=Mo;for(Ln=1;e>=a,g-=a,Co=1<<32-Rs(t)+g|n<N?(I=M,M=null):I=M.sibling;var R=o(v,M,T[N],P);if(R===null){M===null&&(M=I);break}e&&M&&R.alternate===null&&t(v,M),S=b(R,S,N),E===null?_=R:E.sibling=R,E=R,M=I}if(N===T.length)return n(v,M),Hn&&Xa(v,N),_;if(M===null){for(;NN?(I=M,M=null):I=M.sibling;var V=o(v,M,R.value,P);if(V===null){M===null&&(M=I);break}e&&M&&V.alternate===null&&t(v,M),S=b(V,S,N),E===null?_=V:E.sibling=V,E=V,M=I}if(R.done)return n(v,M),Hn&&Xa(v,N),_;if(M===null){for(;!R.done;N++,R=T.next())R=c(v,R.value,P),R!==null&&(S=b(R,S,N),E===null?_=R:E.sibling=R,E=R);return Hn&&Xa(v,N),_}for(M=l(v,M);!R.done;N++,R=T.next())R=u(M,v,N,R.value,P),R!==null&&(e&&R.alternate!==null&&M.delete(R.key===null?N:R.key),S=b(R,S,N),E===null?_=R:E.sibling=R,E=R);return e&&M.forEach(function(U){return t(v,U)}),Hn&&Xa(v,N),_}function p(v,S,T,P){if(typeof T=="object"&&T!==null&&T.type===Jl&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case jd:e:{for(var _=T.key,E=S;E!==null;){if(E.key===_){if(_=T.type,_===Jl){if(E.tag===7){n(v,E.sibling),S=g(E,T.props.children),S.return=v,v=S;break e}}else if(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===ia&&sv(_)===E.type){n(v,E.sibling),S=g(E,T.props),S.ref=Nc(v,E,T),S.return=v,v=S;break e}n(v,E);break}else t(v,E);E=E.sibling}T.type===Jl?(S=dl(T.props.children,v.mode,P,T.key),S.return=v,v=S):(P=Af(T.type,T.key,T.props,null,v.mode,P),P.ref=Nc(v,S,T),P.return=v,v=P)}return a(v);case Zl:e:{for(E=T.key;S!==null;){if(S.key===E)if(S.tag===4&&S.stateNode.containerInfo===T.containerInfo&&S.stateNode.implementation===T.implementation){n(v,S.sibling),S=g(S,T.children||[]),S.return=v,v=S;break e}else{n(v,S);break}else t(v,S);S=S.sibling}S=b0(T,v.mode,P),S.return=v,v=S}return a(v);case ia:return E=T._init,p(v,S,E(T._payload),P)}if(jc(T))return d(v,S,T,P);if(Cc(T))return x(v,S,T,P);rf(v,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,S!==null&&S.tag===6?(n(v,S.sibling),S=g(S,T),S.return=v,v=S):(n(v,S),S=g0(T,v.mode,P),S.return=v,v=S),a(v)):n(v,S)}return p}var Gu=p5(!0),m5=p5(!1),qh={},ao=Ra(qh),xh=Ra(qh),wh=Ra(qh);function Ja(e){if(e===qh)throw Error(mt(174));return e}function x2(e,t){switch(Fn(wh,t),Fn(xh,e),Fn(ao,qh),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:q0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=q0(t,e)}zn(ao),Fn(ao,t)}function Wu(){zn(ao),zn(xh),zn(wh)}function g5(e){Ja(wh.current);var t=Ja(ao.current),n=q0(t,e.type);t!==n&&(Fn(xh,e),Fn(ao,n))}function w2(e){xh.current===e&&(zn(ao),zn(xh))}var qn=Ra(0);function ep(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var c0=[];function _2(){for(var e=0;en?n:4,e(!0);var l=h0.transition;h0.transition={};try{e(!1),t()}finally{Ln=n,h0.transition=l}}function I5(){return cs().memoizedState}function aM(e,t,n){var l=wa(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},N5(e))k5(t,n);else if(n=c5(e,t,n,l),n!==null){var g=nr();Is(n,e,l,g),O5(n,t,l)}}function lM(e,t,n){var l=wa(e),g={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(N5(e))k5(t,g);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=t.lastRenderedReducer,b!==null))try{var a=t.lastRenderedState,r=b(a,n);if(g.hasEagerState=!0,g.eagerState=r,ks(r,a)){var h=t.interleaved;h===null?(g.next=g,S2(t)):(g.next=h.next,h.next=g),t.interleaved=g;return}}catch{}finally{}n=c5(e,t,g,l),n!==null&&(g=nr(),Is(n,e,l,g),O5(n,t,l))}}function N5(e){var t=e.alternate;return e===Zn||t!==null&&t===Zn}function k5(e,t){th=tp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function O5(e,t,n){if(n&4194240){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,o2(e,n)}}var np={readContext:us,useCallback:Gi,useContext:Gi,useEffect:Gi,useImperativeHandle:Gi,useInsertionEffect:Gi,useLayoutEffect:Gi,useMemo:Gi,useReducer:Gi,useRef:Gi,useState:Gi,useDebugValue:Gi,useDeferredValue:Gi,useTransition:Gi,useMutableSource:Gi,useSyncExternalStore:Gi,useId:Gi,unstable_isNewReconciler:!1},uM={readContext:us,useCallback:function(e,t){return Qs().memoizedState=[e,t===void 0?null:t],e},useContext:us,useEffect:av,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pf(4194308,4,M5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pf(4,2,e,t)},useMemo:function(e,t){var n=Qs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Qs();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=aM.bind(null,Zn,e),[l.memoizedState,e]},useRef:function(e){var t=Qs();return e={current:e},t.memoizedState=e},useState:ov,useDebugValue:L2,useDeferredValue:function(e){return Qs().memoizedState=e},useTransition:function(){var e=ov(!1),t=e[0];return e=oM.bind(null,e[1]),Qs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=Zn,g=Qs();if(Hn){if(n===void 0)throw Error(mt(407));n=n()}else{if(n=t(),Mi===null)throw Error(mt(349));ml&30||v5(l,t,n)}g.memoizedState=n;var b={value:n,getSnapshot:t};return g.queue=b,av(E5.bind(null,l,b,e),[e]),l.flags|=2048,Ph(9,S5.bind(null,l,b,n,t),void 0,null),n},useId:function(){var e=Qs(),t=Mi.identifierPrefix;if(Hn){var n=Lo,l=Co;n=(l&~(1<<32-Rs(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=_h++,0<\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=a.createElement(n,{is:l.is}):(e=a.createElement(n),n==="select"&&(a=e,l.multiple?a.multiple=!0:l.size&&(a.size=l.size))):e=a.createElementNS(e,n),e[ro]=t,e[Eh]=l,$5(e,t,!1,!1),t.stateNode=e;e:{switch(a=Z0(n,l),n){case"dialog":Vn("cancel",e),Vn("close",e),g=l;break;case"iframe":case"object":case"embed":Vn("load",e),g=l;break;case"video":case"audio":for(g=0;gUu&&(t.flags|=128,l=!0,kc(b,!1),t.lanes=4194304)}else{if(!l)if(e=ep(a),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kc(b,!0),b.tail===null&&b.tailMode==="hidden"&&!a.alternate&&!Hn)return Wi(t),null}else 2*ui()-b.renderingStartTime>Uu&&n!==1073741824&&(t.flags|=128,l=!0,kc(b,!1),t.lanes=4194304);b.isBackwards?(a.sibling=t.child,t.child=a):(n=b.last,n!==null?n.sibling=a:t.child=a,b.last=a)}return b.tail!==null?(t=b.tail,b.rendering=t,b.tail=t.sibling,b.renderingStartTime=ui(),t.sibling=null,n=qn.current,Fn(qn,l?n&1|2:n&1),t):(Wi(t),null);case 22:case 23:return O2(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&t.mode&1?kr&1073741824&&(Wi(t),t.subtreeFlags&6&&(t.flags|=8192)):Wi(t),null;case 24:return null;case 25:return null}throw Error(mt(156,t.tag))}function bM(e,t){switch(m2(t),t.tag){case 1:return _r(t.type)&&Xf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wu(),zn(wr),zn($i),_2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return w2(t),null;case 13:if(zn(qn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(mt(340));Vu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zn(qn),null;case 4:return Wu(),null;case 10:return v2(t.type._context),null;case 22:case 23:return O2(),null;case 24:return null;default:return null}}var of=!1,Ui=!1,yM=typeof WeakSet=="function"?WeakSet:Set,At=null;function lu(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){si(e,t,l)}else n.current=null}function Tg(e,t,n){try{n()}catch(l){si(e,t,l)}}var gv=!1;function vM(e,t){if(lg=Uf,e=qS(),f2(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var g=l.anchorOffset,b=l.focusNode;l=l.focusOffset;try{n.nodeType,b.nodeType}catch{n=null;break e}var a=0,r=-1,h=-1,s=0,m=0,c=e,o=null;t:for(;;){for(var u;c!==n||g!==0&&c.nodeType!==3||(r=a+g),c!==b||l!==0&&c.nodeType!==3||(h=a+l),c.nodeType===3&&(a+=c.nodeValue.length),(u=c.firstChild)!==null;)o=c,c=u;for(;;){if(c===e)break t;if(o===n&&++s===g&&(r=a),o===b&&++m===l&&(h=a),(u=c.nextSibling)!==null)break;c=o,o=c.parentNode}c=u}n=r===-1||h===-1?null:{start:r,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(ug={focusedElem:e,selectionRange:n},Uf=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){t=At;try{var d=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var x=d.memoizedProps,p=d.memoizedState,v=t.stateNode,S=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ms(t.type,x),p);v.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(mt(163))}}catch(P){si(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}return d=gv,gv=!1,d}function nh(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var g=l=l.next;do{if((g.tag&e)===e){var b=g.destroy;g.destroy=void 0,b!==void 0&&Tg(t,n,b)}g=g.next}while(g!==l)}}function Lp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function Pg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function X5(e){var t=e.alternate;t!==null&&(e.alternate=null,X5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ro],delete t[Eh],delete t[dg],delete t[tM],delete t[nM])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Y5(e){return e.tag===5||e.tag===3||e.tag===4}function bv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Y5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mg(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jf));else if(l!==4&&(e=e.child,e!==null))for(Mg(e,t,n),e=e.sibling;e!==null;)Mg(e,t,n),e=e.sibling}function Cg(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Cg(e,t,n),e=e.sibling;e!==null;)Cg(e,t,n),e=e.sibling}var Ii=null,Ls=!1;function Zo(e,t,n){for(n=n.child;n!==null;)K5(e,t,n),n=n.sibling}function K5(e,t,n){if(oo&&typeof oo.onCommitFiberUnmount=="function")try{oo.onCommitFiberUnmount(Ep,n)}catch{}switch(n.tag){case 5:Ui||lu(n,t);case 6:var l=Ii,g=Ls;Ii=null,Zo(e,t,n),Ii=l,Ls=g,Ii!==null&&(Ls?(e=Ii,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ii.removeChild(n.stateNode));break;case 18:Ii!==null&&(Ls?(e=Ii,n=n.stateNode,e.nodeType===8?l0(e.parentNode,n):e.nodeType===1&&l0(e,n),gh(e)):l0(Ii,n.stateNode));break;case 4:l=Ii,g=Ls,Ii=n.stateNode.containerInfo,Ls=!0,Zo(e,t,n),Ii=l,Ls=g;break;case 0:case 11:case 14:case 15:if(!Ui&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){g=l=l.next;do{var b=g,a=b.destroy;b=b.tag,a!==void 0&&(b&2||b&4)&&Tg(n,t,a),g=g.next}while(g!==l)}Zo(e,t,n);break;case 1:if(!Ui&&(lu(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(r){si(n,t,r)}Zo(e,t,n);break;case 21:Zo(e,t,n);break;case 22:n.mode&1?(Ui=(l=Ui)||n.memoizedState!==null,Zo(e,t,n),Ui=l):Zo(e,t,n);break;default:Zo(e,t,n)}}function yv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yM),t.forEach(function(l){var g=CM.bind(null,e,l);n.has(l)||(n.add(l),l.then(g,g))})}}function Ps(e,t){var n=t.deletions;if(n!==null)for(var l=0;lg&&(g=a),l&=~b}if(l=g,l=ui()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*EM(l/1960))-l,10e?16:e,ga===null)var l=!1;else{if(e=ga,ga=null,sp=0,vn&6)throw Error(mt(331));var g=vn;for(vn|=4,At=e.current;At!==null;){var b=At,a=b.child;if(At.flags&16){var r=b.deletions;if(r!==null){for(var h=0;hui()-N2?hl(e,0):I2|=n),Tr(e,t)}function iE(e,t){t===0&&(e.mode&1?(t=qd,qd<<=1,!(qd&130023424)&&(qd=4194304)):t=1);var n=nr();e=ko(e,t),e!==null&&(Xh(e,t,n),Tr(e,n))}function MM(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),iE(e,n)}function CM(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,g=e.memoizedState;g!==null&&(n=g.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(mt(314))}l!==null&&l.delete(t),iE(e,n)}var rE;rE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)xr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xr=!1,mM(e,t,n);xr=!!(e.flags&131072)}else xr=!1,Hn&&t.flags&1048576&&a5(t,qf,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Mf(e,t),e=t.pendingProps;var g=Du(t,$i.current);gu(t,n),g=P2(null,t,l,e,g,n);var b=M2();return t.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_r(l)?(b=!0,Yf(t)):b=!1,t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,E2(t),g.updater=Mp,t.stateNode=g,g._reactInternals=t,yg(t,l,e,n),t=Eg(null,t,l,!0,b,n)):(t.tag=0,Hn&&b&&p2(t),er(null,t,g,n),t=t.child),t;case 16:l=t.elementType;e:{switch(Mf(e,t),e=t.pendingProps,g=l._init,l=g(l._payload),t.type=l,g=t.tag=AM(l),e=Ms(l,e),g){case 0:t=Sg(null,t,l,e,n);break e;case 1:t=fv(null,t,l,e,n);break e;case 11:t=hv(null,t,l,e,n);break e;case 14:t=dv(null,t,l,Ms(l.type,e),n);break e}throw Error(mt(306,l,""))}return t;case 0:return l=t.type,g=t.pendingProps,g=t.elementType===l?g:Ms(l,g),Sg(e,t,l,g,n);case 1:return l=t.type,g=t.pendingProps,g=t.elementType===l?g:Ms(l,g),fv(e,t,l,g,n);case 3:e:{if(W5(t),e===null)throw Error(mt(387));l=t.pendingProps,b=t.memoizedState,g=b.element,h5(e,t),Jf(t,l,null,n);var a=t.memoizedState;if(l=a.element,b.isDehydrated)if(b={element:l,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=b,t.memoizedState=b,t.flags&256){g=zu(Error(mt(423)),t),t=pv(e,t,l,n,g);break e}else if(l!==g){g=zu(Error(mt(424)),t),t=pv(e,t,l,n,g);break e}else for(Br=Sa(t.stateNode.containerInfo.firstChild),Dr=t,Hn=!0,As=null,n=m5(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vu(),l===g){t=Oo(e,t,n);break e}er(e,t,l,n)}t=t.child}return t;case 5:return g5(t),e===null&&mg(t),l=t.type,g=t.pendingProps,b=e!==null?e.memoizedProps:null,a=g.children,cg(l,g)?a=null:b!==null&&cg(l,b)&&(t.flags|=32),G5(e,t),er(e,t,a,n),t.child;case 6:return e===null&&mg(t),null;case 13:return z5(e,t,n);case 4:return x2(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Gu(t,null,l,n):er(e,t,l,n),t.child;case 11:return l=t.type,g=t.pendingProps,g=t.elementType===l?g:Ms(l,g),hv(e,t,l,g,n);case 7:return er(e,t,t.pendingProps,n),t.child;case 8:return er(e,t,t.pendingProps.children,n),t.child;case 12:return er(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,g=t.pendingProps,b=t.memoizedProps,a=g.value,Fn(Qf,l._currentValue),l._currentValue=a,b!==null)if(ks(b.value,a)){if(b.children===g.children&&!wr.current){t=Oo(e,t,n);break e}}else for(b=t.child,b!==null&&(b.return=t);b!==null;){var r=b.dependencies;if(r!==null){a=b.child;for(var h=r.firstContext;h!==null;){if(h.context===l){if(b.tag===1){h=Ao(-1,n&-n),h.tag=2;var s=b.updateQueue;if(s!==null){s=s.shared;var m=s.pending;m===null?h.next=h:(h.next=m.next,m.next=h),s.pending=h}}b.lanes|=n,h=b.alternate,h!==null&&(h.lanes|=n),gg(b.return,n,t),r.lanes|=n;break}h=h.next}}else if(b.tag===10)a=b.type===t.type?null:b.child;else if(b.tag===18){if(a=b.return,a===null)throw Error(mt(341));a.lanes|=n,r=a.alternate,r!==null&&(r.lanes|=n),gg(a,n,t),a=b.sibling}else a=b.child;if(a!==null)a.return=b;else for(a=b;a!==null;){if(a===t){a=null;break}if(b=a.sibling,b!==null){b.return=a.return,a=b;break}a=a.return}b=a}er(e,t,g.children,n),t=t.child}return t;case 9:return g=t.type,l=t.pendingProps.children,gu(t,n),g=us(g),l=l(g),t.flags|=1,er(e,t,l,n),t.child;case 14:return l=t.type,g=Ms(l,t.pendingProps),g=Ms(l.type,g),dv(e,t,l,g,n);case 15:return D5(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,g=t.pendingProps,g=t.elementType===l?g:Ms(l,g),Mf(e,t),t.tag=1,_r(l)?(e=!0,Yf(t)):e=!1,gu(t,n),f5(t,l,g),yg(t,l,g,n),Eg(null,t,l,!0,e,n);case 19:return U5(e,t,n);case 22:return V5(e,t,n)}throw Error(mt(156,t.tag))};function sE(e,t){return RS(e,t)}function LM(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function os(e,t,n,l){return new LM(e,t,n,l)}function B2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function AM(e){if(typeof e=="function")return B2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===n2)return 11;if(e===i2)return 14}return 2}function _a(e,t){var n=e.alternate;return n===null?(n=os(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Af(e,t,n,l,g,b){var a=2;if(l=e,typeof e=="function")B2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Jl:return dl(n.children,g,b,t);case t2:a=8,g|=8;break;case z0:return e=os(12,n,t,g|2),e.elementType=z0,e.lanes=b,e;case U0:return e=os(13,n,t,g),e.elementType=U0,e.lanes=b,e;case $0:return e=os(19,n,t,g),e.elementType=$0,e.lanes=b,e;case pS:return Rp(n,g,b,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dS:a=10;break e;case fS:a=9;break e;case n2:a=11;break e;case i2:a=14;break e;case ia:a=16,l=null;break e}throw Error(mt(130,e==null?e:typeof e,""))}return t=os(a,n,t,g),t.elementType=e,t.type=l,t.lanes=b,t}function dl(e,t,n,l){return e=os(7,e,l,t),e.lanes=n,e}function Rp(e,t,n,l){return e=os(22,e,l,t),e.elementType=pS,e.lanes=n,e.stateNode={isHidden:!1},e}function g0(e,t,n){return e=os(6,e,null,t),e.lanes=n,e}function b0(e,t,n){return t=os(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function RM(e,t,n,l,g){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qm(0),this.expirationTimes=Qm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qm(0),this.identifierPrefix=l,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function D2(e,t,n,l,g,b,a,r,h){return e=new RM(e,t,n,r,h),t===1?(t=1,b===!0&&(t|=8)):t=0,b=os(3,null,null,t),e.current=b,b.stateNode=e,b.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},E2(b),e}function IM(e,t,n){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uE)}catch(e){console.error(e)}}uE(),aS.exports=Wr;var Fp=aS.exports;const uf=z4(Fp);var Pv=Fp;G0.createRoot=Pv.createRoot,G0.hydrateRoot=Pv.hydrateRoot;var lp={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */lp.exports;(function(e,t){(function(){var n,l="4.17.21",g=200,b="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",r="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",s=500,m="__lodash_placeholder__",c=1,o=2,u=4,d=1,x=2,p=1,v=2,S=4,T=8,P=16,_=32,E=64,M=128,N=256,I=512,R=30,V="...",U=800,K=16,k=1,W=2,G=3,X=1/0,L=9007199254740991,H=17976931348623157e292,ne=NaN,ie=4294967295,be=ie-1,ae=ie>>>1,ge=[["ary",M],["bind",p],["bindKey",v],["curry",T],["curryRight",P],["flip",I],["partial",_],["partialRight",E],["rearg",N]],ce="[object Arguments]",ee="[object Array]",ye="[object AsyncFunction]",Ee="[object Boolean]",j="[object Date]",te="[object DOMException]",re="[object Error]",O="[object Function]",z="[object GeneratorFunction]",Y="[object Map]",q="[object Number]",de="[object Null]",le="[object Object]",he="[object Promise]",me="[object Proxy]",_e="[object RegExp]",Me="[object Set]",Ue="[object String]",Ge="[object Symbol]",Qe="[object Undefined]",Re="[object WeakMap]",We="[object WeakSet]",qe="[object ArrayBuffer]",Ke="[object DataView]",Ze="[object Float32Array]",st="[object Float64Array]",ft="[object Int8Array]",xt="[object Int16Array]",ut="[object Int32Array]",Et="[object Uint8Array]",dt="[object Uint8ClampedArray]",Tt="[object Uint16Array]",It="[object Uint32Array]",Jt=/\b__p \+= '';/g,hi=/\b(__p \+=) '' \+/g,jn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$r=/&(?:amp|lt|gt|quot|#39);/g,Lt=/[&<>"']/g,Bn=RegExp($r.source),sn=RegExp(Lt.source),jt=/<%-([\s\S]+?)%>/g,Xn=/<%([\s\S]+?)%>/g,kn=/<%=([\s\S]+?)%>/g,Yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Di=/^\w*$/,Hr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oi=/[\\^$.*+?()[\]{}|]/g,Bs=RegExp(oi.source),Dt=/^\s+/,El=/\s/,xl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,sr=/\{\n\/\* \[wrapped with (.+)\] \*/,ps=/,? & /,ka=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Do=/[()=,{}\[\]\/\s]/,ms=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vo=/\w*$/,Ds=/^[-+]0x[0-9a-f]+$/i,wl=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,xn=/^0o[0-7]+$/i,Qt=/^(?:0|[1-9]\d*)$/,xi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gs=/($^)/,_l=/['\n\r\u2028\u2029\\]/g,or="\\ud800-\\udfff",Go="\\u0300-\\u036f",Li="\\ufe20-\\ufe2f",Cr="\\u20d0-\\u20ff",ar=Go+Li+Cr,wi="\\u2700-\\u27bf",bs="a-z\\xdf-\\xf6\\xf8-\\xff",cn="\\xac\\xb1\\xd7\\xf7",Tl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wo="\\u2000-\\u206f",Vs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zo="A-Z\\xc0-\\xd6\\xd8-\\xde",lr="\\ufe0e\\ufe0f",mn=cn+Tl+Wo+Vs,ys="['’]",Pl="["+or+"]",uo="["+mn+"]",Gs="["+ar+"]",Ie="\\d+",i="["+wi+"]",y="["+bs+"]",C="[^"+or+mn+Ie+wi+bs+zo+"]",B="\\ud83c[\\udffb-\\udfff]",$="(?:"+Gs+"|"+B+")",Z="[^"+or+"]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",ve="["+zo+"]",we="\\u200d",Pe="(?:"+y+"|"+C+")",Ae="(?:"+ve+"|"+C+")",Ce="(?:"+ys+"(?:d|ll|m|re|s|t|ve))?",Ve="(?:"+ys+"(?:D|LL|M|RE|S|T|VE))?",je=$+"?",$e="["+lr+"]?",Je="(?:"+we+"(?:"+[Z,se,ue].join("|")+")"+$e+je+")*",pt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ht="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bt=$e+je+Je,kt="(?:"+[i,se,ue].join("|")+")"+bt,zt="(?:"+[Z+Gs+"?",Gs,se,ue,Pl].join("|")+")",tn=RegExp(ys,"g"),Cn=RegExp(Gs,"g"),Sn=RegExp(B+"(?="+B+")|"+zt+bt,"g"),Ai=RegExp([ve+"?"+y+"+"+Ce+"(?="+[uo,ve,"$"].join("|")+")",Ae+"+"+Ve+"(?="+[uo,ve+Pe,"$"].join("|")+")",ve+"?"+Pe+"+"+Ce,ve+"+"+Ve,ht,pt,Ie,kt].join("|"),"g"),ei=RegExp("["+we+or+ar+lr+"]"),ti=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ji=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ur=-1,gn={};gn[Ze]=gn[st]=gn[ft]=gn[xt]=gn[ut]=gn[Et]=gn[dt]=gn[Tt]=gn[It]=!0,gn[ce]=gn[ee]=gn[qe]=gn[Ee]=gn[Ke]=gn[j]=gn[re]=gn[O]=gn[Y]=gn[q]=gn[le]=gn[_e]=gn[Me]=gn[Ue]=gn[Re]=!1;var hn={};hn[ce]=hn[ee]=hn[qe]=hn[Ke]=hn[Ee]=hn[j]=hn[Ze]=hn[st]=hn[ft]=hn[xt]=hn[ut]=hn[Y]=hn[q]=hn[le]=hn[_e]=hn[Me]=hn[Ue]=hn[Ge]=hn[Et]=hn[dt]=hn[Tt]=hn[It]=!0,hn[re]=hn[O]=hn[Re]=!1;var Xi={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vs={"&":"&","<":"<",">":">",'"':""","'":"'"},Ws={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ss={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Es=parseFloat,zs=parseInt,co=typeof ql=="object"&&ql&&ql.Object===Object&&ql,L1=typeof self=="object"&&self&&self.Object===Object&&self,Dn=co||L1||Function("return this")(),nc=t&&!t.nodeType&&t,Us=nc&&!0&&e&&!e.nodeType&&e,nd=Us&&Us.exports===nc,Uo=nd&&co.process,cr=function(){try{var He=Us&&Us.require&&Us.require("util").types;return He||Uo&&Uo.binding&&Uo.binding("util")}catch{}}(),Ml=cr&&cr.isArrayBuffer,id=cr&&cr.isDate,ic=cr&&cr.isMap,rd=cr&&cr.isRegExp,sd=cr&&cr.isSet,Cl=cr&&cr.isTypedArray;function Yi(He,nt,tt){switch(tt.length){case 0:return He.call(nt);case 1:return He.call(nt,tt[0]);case 2:return He.call(nt,tt[0],tt[1]);case 3:return He.call(nt,tt[0],tt[1],tt[2])}return He.apply(nt,tt)}function od(He,nt,tt,_t){for(var $t=-1,bn=He==null?0:He.length;++$t-1}function rc(He,nt,tt){for(var _t=-1,$t=He==null?0:He.length;++_t<$t;)if(tt(nt,He[_t]))return!0;return!1}function Rn(He,nt){for(var tt=-1,_t=He==null?0:He.length,$t=Array(_t);++tt<_t;)$t[tt]=nt(He[tt],tt,He);return $t}function xs(He,nt){for(var tt=-1,_t=nt.length,$t=He.length;++tt<_t;)He[$t+tt]=nt[tt];return He}function sc(He,nt,tt,_t){var $t=-1,bn=He==null?0:He.length;for(_t&&bn&&(tt=He[++$t]);++$t-1;);return tt}function fd(He,nt){for(var tt=He.length;tt--&&$o(nt,He[tt],0)>-1;);return tt}function dc(He,nt){for(var tt=He.length,_t=0;tt--;)He[tt]===nt&&++_t;return _t}var B1=lc(Xi),Fa=lc(vs);function D1(He){return"\\"+Ss[He]}function V1(He,nt){return He==null?n:He[nt]}function Ho(He){return ei.test(He)}function G1(He){return ti.test(He)}function W1(He){for(var nt,tt=[];!(nt=He.next()).done;)tt.push(nt.value);return tt}function fc(He){var nt=-1,tt=Array(He.size);return He.forEach(function(_t,$t){tt[++nt]=[$t,_t]}),tt}function pd(He,nt){return function(tt){return He(nt(tt))}}function js(He,nt){for(var tt=-1,_t=He.length,$t=0,bn=[];++tt<_t;){var In=He[tt];(In===nt||In===m)&&(He[tt]=m,bn[$t++]=tt)}return bn}function Rl(He){var nt=-1,tt=Array(He.size);return He.forEach(function(_t){tt[++nt]=_t}),tt}function z1(He){var nt=-1,tt=Array(He.size);return He.forEach(function(_t){tt[++nt]=[_t,_t]}),tt}function Il(He,nt,tt){for(var _t=tt-1,$t=He.length;++_t<$t;)if(He[_t]===nt)return _t;return-1}function U1(He,nt,tt){for(var _t=tt+1;_t--;)if(He[_t]===nt)return _t;return _t}function ho(He){return Ho(He)?$1(He):I1(He)}function fr(He){return Ho(He)?H1(He):N1(He)}function md(He){for(var nt=He.length;nt--&&El.test(He.charAt(nt)););return nt}var gd=lc(Ws);function $1(He){for(var nt=Sn.lastIndex=0;Sn.test(He);)++nt;return nt}function H1(He){return He.match(Sn)||[]}function j1(He){return He.match(Ai)||[]}var X1=function He(nt){nt=nt==null?Dn:fo.defaults(Dn.Object(),nt,fo.pick(Dn,ji));var tt=nt.Array,_t=nt.Date,$t=nt.Error,bn=nt.Function,In=nt.Math,Pn=nt.Object,jr=nt.RegExp,Y1=nt.String,pr=nt.TypeError,Ba=tt.prototype,pc=bn.prototype,jo=Pn.prototype,Nl=nt["__core-js_shared__"],Da=pc.toString,wn=jo.hasOwnProperty,K1=0,bd=function(){var f=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),po=jo.toString,q1=Da.call(Pn),yd=Dn._,A=jr("^"+Da.call(wn).replace(oi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D=nd?nt.Buffer:n,Q=nt.Symbol,oe=nt.Uint8Array,Se=D?D.allocUnsafe:n,Le=pd(Pn.getPrototypeOf,Pn),Fe=Pn.create,De=jo.propertyIsEnumerable,et=Ba.splice,it=Q?Q.isConcatSpreadable:n,rt=Q?Q.iterator:n,gt=Q?Q.toStringTag:n,yt=function(){try{var f=Ua(Pn,"defineProperty");return f({},"",{}),f}catch{}}(),St=nt.clearTimeout!==Dn.clearTimeout&&nt.clearTimeout,vt=_t&&_t.now!==Dn.Date.now&&_t.now,Bt=nt.setTimeout!==Dn.setTimeout&&nt.setTimeout,Xt=In.ceil,yn=In.floor,lt=Pn.getOwnPropertySymbols,Pt=D?D.isBuffer:n,On=nt.isFinite,En=Ba.join,bi=pd(Pn.keys,Pn),Kt=In.max,yi=In.min,Nx=_t.now,kx=nt.parseInt,Cb=In.random,Ox=Ba.reverse,Q1=Ua(nt,"DataView"),mc=Ua(nt,"Map"),Z1=Ua(nt,"Promise"),kl=Ua(nt,"Set"),gc=Ua(nt,"WeakMap"),bc=Ua(Pn,"create"),vd=gc&&new gc,Ol={},Fx=$a(Q1),Bx=$a(mc),Dx=$a(Z1),Vx=$a(kl),Gx=$a(gc),Sd=Q?Q.prototype:n,yc=Sd?Sd.valueOf:n,Lb=Sd?Sd.toString:n;function xe(f){if(ni(f)&&!Yt(f)&&!(f instanceof on)){if(f instanceof Xr)return f;if(wn.call(f,"__wrapped__"))return A3(f)}return new Xr(f)}var Fl=function(){function f(){}return function(w){if(!Kn(w))return{};if(Fe)return Fe(w);f.prototype=w;var F=new f;return f.prototype=n,F}}();function Ed(){}function Xr(f,w){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!w,this.__index__=0,this.__values__=n}xe.templateSettings={escape:jt,evaluate:Xn,interpolate:kn,variable:"",imports:{_:xe}},xe.prototype=Ed.prototype,xe.prototype.constructor=xe,Xr.prototype=Fl(Ed.prototype),Xr.prototype.constructor=Xr;function on(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function Wx(){var f=new on(this.__wrapped__);return f.__actions__=mr(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=mr(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=mr(this.__views__),f}function zx(){if(this.__filtered__){var f=new on(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function Ux(){var f=this.__wrapped__.value(),w=this.__dir__,F=Yt(f),J=w<0,pe=F?f.length:0,Te=t7(0,pe,this.__views__),Oe=Te.start,ze=Te.end,Ye=ze-Oe,ot=J?ze:Oe-1,at=this.__iteratees__,ct=at.length,wt=0,Ot=yi(Ye,this.__takeCount__);if(!F||!J&&pe==Ye&&Ot==Ye)return Jb(f,this.__actions__);var Gt=[];e:for(;Ye--&&wt-1}function Jx(f,w){var F=this.__data__,J=xd(F,f);return J<0?(++this.size,F.push([f,w])):F[J][1]=w,this}mo.prototype.clear=Kx,mo.prototype.delete=qx,mo.prototype.get=Qx,mo.prototype.has=Zx,mo.prototype.set=Jx;function go(f){var w=-1,F=f==null?0:f.length;for(this.clear();++w=w?f:w)),f}function Yr(f,w,F,J,pe,Te){var Oe,ze=w&c,Ye=w&o,ot=w&u;if(F&&(Oe=pe?F(f,J,pe,Te):F(f)),Oe!==n)return Oe;if(!Kn(f))return f;var at=Yt(f);if(at){if(Oe=i7(f),!ze)return mr(f,Oe)}else{var ct=Vi(f),wt=ct==O||ct==z;if(Qo(f))return n3(f,ze);if(ct==le||ct==ce||wt&&!pe){if(Oe=Ye||wt?{}:E3(f),!ze)return Ye?j6(f,m6(Oe,f)):H6(f,Ib(Oe,f))}else{if(!hn[ct])return pe?f:{};Oe=r7(f,ct,ze)}}Te||(Te=new ws);var Ot=Te.get(f);if(Ot)return Ot;Te.set(f,Oe),q3(f)?f.forEach(function(Wt){Oe.add(Yr(Wt,w,F,Wt,f,Te))}):Y3(f)&&f.forEach(function(Wt,rn){Oe.set(rn,Yr(Wt,w,F,rn,f,Te))});var Gt=ot?Ye?Sm:vm:Ye?br:_i,Zt=at?n:Gt(f);return hr(Zt||f,function(Wt,rn){Zt&&(rn=Wt,Wt=f[rn]),vc(Oe,rn,Yr(Wt,w,F,rn,f,Te))}),Oe}function g6(f){var w=_i(f);return function(F){return Nb(F,f,w)}}function Nb(f,w,F){var J=F.length;if(f==null)return!J;for(f=Pn(f);J--;){var pe=F[J],Te=w[pe],Oe=f[pe];if(Oe===n&&!(pe in f)||!Te(Oe))return!1}return!0}function kb(f,w,F){if(typeof f!="function")throw new pr(a);return Pc(function(){f.apply(n,F)},w)}function Sc(f,w,F,J){var pe=-1,Te=Ll,Oe=!0,ze=f.length,Ye=[],ot=w.length;if(!ze)return Ye;F&&(w=Rn(w,Ki(F))),J?(Te=rc,Oe=!1):w.length>=g&&(Te=Oa,Oe=!1,w=new Ga(w));e:for(;++pepe?0:pe+F),J=J===n||J>pe?pe:qt(J),J<0&&(J+=pe),J=F>J?0:Z3(J);F0&&F(ze)?w>1?Ri(ze,w-1,F,J,pe):xs(pe,ze):J||(pe[pe.length]=ze)}return pe}var tm=l3(),Bb=l3(!0);function Xs(f,w){return f&&tm(f,w,_i)}function nm(f,w){return f&&Bb(f,w,_i)}function _d(f,w){return $s(w,function(F){return Eo(f[F])})}function za(f,w){w=Ko(w,f);for(var F=0,J=w.length;f!=null&&Fw}function v6(f,w){return f!=null&&wn.call(f,w)}function S6(f,w){return f!=null&&w in Pn(f)}function E6(f,w,F){return f>=yi(w,F)&&f=120&&at.length>=120)?new Ga(Oe&&at):n}at=f[0];var ct=-1,wt=ze[0];e:for(;++ct-1;)ze!==f&&et.call(ze,Ye,1),et.call(f,Ye,1);return f}function Yb(f,w){for(var F=f?w.length:0,J=F-1;F--;){var pe=w[F];if(F==J||pe!==Te){var Te=pe;So(pe)?et.call(f,pe,1):dm(f,pe)}}return f}function um(f,w){return f+yn(Cb()*(w-f+1))}function k6(f,w,F,J){for(var pe=-1,Te=Kt(Xt((w-f)/(F||1)),0),Oe=tt(Te);Te--;)Oe[J?Te:++pe]=f,f+=F;return Oe}function cm(f,w){var F="";if(!f||w<1||w>L)return F;do w%2&&(F+=f),w=yn(w/2),w&&(f+=f);while(w);return F}function en(f,w){return Mm(_3(f,w,yr),f+"")}function O6(f){return Rb(Wl(f))}function F6(f,w){var F=Wl(f);return Od(F,Wa(w,0,F.length))}function wc(f,w,F,J){if(!Kn(f))return f;w=Ko(w,f);for(var pe=-1,Te=w.length,Oe=Te-1,ze=f;ze!=null&&++pepe?0:pe+w),F=F>pe?pe:F,F<0&&(F+=pe),pe=w>F?0:F-w>>>0,w>>>=0;for(var Te=tt(pe);++J>>1,Oe=f[Te];Oe!==null&&!Ar(Oe)&&(F?Oe<=w:Oe=g){var ot=w?null:q6(f);if(ot)return Rl(ot);Oe=!1,pe=Oa,Ye=new Ga}else Ye=w?[]:ze;e:for(;++J=J?f:Kr(f,w,F)}var t3=St||function(f){return Dn.clearTimeout(f)};function n3(f,w){if(w)return f.slice();var F=f.length,J=Se?Se(F):new f.constructor(F);return f.copy(J),J}function gm(f){var w=new f.constructor(f.byteLength);return new oe(w).set(new oe(f)),w}function W6(f,w){var F=w?gm(f.buffer):f.buffer;return new f.constructor(F,f.byteOffset,f.byteLength)}function z6(f){var w=new f.constructor(f.source,Vo.exec(f));return w.lastIndex=f.lastIndex,w}function U6(f){return yc?Pn(yc.call(f)):{}}function i3(f,w){var F=w?gm(f.buffer):f.buffer;return new f.constructor(F,f.byteOffset,f.length)}function r3(f,w){if(f!==w){var F=f!==n,J=f===null,pe=f===f,Te=Ar(f),Oe=w!==n,ze=w===null,Ye=w===w,ot=Ar(w);if(!ze&&!ot&&!Te&&f>w||Te&&Oe&&Ye&&!ze&&!ot||J&&Oe&&Ye||!F&&Ye||!pe)return 1;if(!J&&!Te&&!ot&&f=ze)return Ye;var ot=F[J];return Ye*(ot=="desc"?-1:1)}}return f.index-w.index}function s3(f,w,F,J){for(var pe=-1,Te=f.length,Oe=F.length,ze=-1,Ye=w.length,ot=Kt(Te-Oe,0),at=tt(Ye+ot),ct=!J;++ze1?F[pe-1]:n,Oe=pe>2?F[2]:n;for(Te=f.length>3&&typeof Te=="function"?(pe--,Te):n,Oe&&Qi(F[0],F[1],Oe)&&(Te=pe<3?n:Te,pe=1),w=Pn(w);++J-1?pe[Te?w[Oe]:Oe]:n}}function h3(f){return vo(function(w){var F=w.length,J=F,pe=Xr.prototype.thru;for(f&&w.reverse();J--;){var Te=w[J];if(typeof Te!="function")throw new pr(a);if(pe&&!Oe&&Nd(Te)=="wrapper")var Oe=new Xr([],!0)}for(J=Oe?J:F;++J1&&dn.reverse(),at&&Yeze))return!1;var ot=Te.get(f),at=Te.get(w);if(ot&&at)return ot==w&&at==f;var ct=-1,wt=!0,Ot=F&x?new Ga:n;for(Te.set(f,w),Te.set(w,f);++ct1?"& ":"")+w[J],w=w.join(F>2?", ":" "),f.replace(xl,`{ -/* [wrapped with `+w+`] */ -`)}function o7(f){return Yt(f)||Ha(f)||!!(it&&f&&f[it])}function So(f,w){var F=typeof f;return w=w??L,!!w&&(F=="number"||F!="symbol"&&Qt.test(f))&&f>-1&&f%1==0&&f0){if(++w>=U)return arguments[0]}else w=0;return f.apply(n,arguments)}}function Od(f,w){var F=-1,J=f.length,pe=J-1;for(w=w===n?J:w;++F1?f[w-1]:n;return F=typeof F=="function"?(f.pop(),F):n,F3(f,F)});function B3(f){var w=xe(f);return w.__chain__=!0,w}function b8(f,w){return w(f),f}function Fd(f,w){return w(f)}var y8=vo(function(f){var w=f.length,F=w?f[0]:0,J=this.__wrapped__,pe=function(Te){return em(Te,f)};return w>1||this.__actions__.length||!(J instanceof on)||!So(F)?this.thru(pe):(J=J.slice(F,+F+(w?1:0)),J.__actions__.push({func:Fd,args:[pe],thisArg:n}),new Xr(J,this.__chain__).thru(function(Te){return w&&!Te.length&&Te.push(n),Te}))});function v8(){return B3(this)}function S8(){return new Xr(this.value(),this.__chain__)}function E8(){this.__values__===n&&(this.__values__=Q3(this.value()));var f=this.__index__>=this.__values__.length,w=f?n:this.__values__[this.__index__++];return{done:f,value:w}}function x8(){return this}function w8(f){for(var w,F=this;F instanceof Ed;){var J=A3(F);J.__index__=0,J.__values__=n,w?pe.__wrapped__=J:w=J;var pe=J;F=F.__wrapped__}return pe.__wrapped__=f,w}function _8(){var f=this.__wrapped__;if(f instanceof on){var w=f;return this.__actions__.length&&(w=new on(this)),w=w.reverse(),w.__actions__.push({func:Fd,args:[Cm],thisArg:n}),new Xr(w,this.__chain__)}return this.thru(Cm)}function T8(){return Jb(this.__wrapped__,this.__actions__)}var P8=Cd(function(f,w,F){wn.call(f,F)?++f[F]:bo(f,F,1)});function M8(f,w,F){var J=Yt(f)?dr:b6;return F&&Qi(f,w,F)&&(w=n),J(f,Vt(w,3))}function C8(f,w){var F=Yt(f)?$s:Fb;return F(f,Vt(w,3))}var L8=c3(R3),A8=c3(I3);function R8(f,w){return Ri(Bd(f,w),1)}function I8(f,w){return Ri(Bd(f,w),X)}function N8(f,w,F){return F=F===n?1:qt(F),Ri(Bd(f,w),F)}function D3(f,w){var F=Yt(f)?hr:Xo;return F(f,Vt(w,3))}function V3(f,w){var F=Yt(f)?A1:Ob;return F(f,Vt(w,3))}var k8=Cd(function(f,w,F){wn.call(f,F)?f[F].push(w):bo(f,F,[w])});function O8(f,w,F,J){f=gr(f)?f:Wl(f),F=F&&!J?qt(F):0;var pe=f.length;return F<0&&(F=Kt(pe+F,0)),zd(f)?F<=pe&&f.indexOf(w,F)>-1:!!pe&&$o(f,w,F)>-1}var F8=en(function(f,w,F){var J=-1,pe=typeof w=="function",Te=gr(f)?tt(f.length):[];return Xo(f,function(Oe){Te[++J]=pe?Yi(w,Oe,F):Ec(Oe,w,F)}),Te}),B8=Cd(function(f,w,F){bo(f,F,w)});function Bd(f,w){var F=Yt(f)?Rn:zb;return F(f,Vt(w,3))}function D8(f,w,F,J){return f==null?[]:(Yt(w)||(w=w==null?[]:[w]),F=J?n:F,Yt(F)||(F=F==null?[]:[F]),jb(f,w,F))}var V8=Cd(function(f,w,F){f[F?0:1].push(w)},function(){return[[],[]]});function G8(f,w,F){var J=Yt(f)?sc:cd,pe=arguments.length<3;return J(f,Vt(w,4),F,pe,Xo)}function W8(f,w,F){var J=Yt(f)?R1:cd,pe=arguments.length<3;return J(f,Vt(w,4),F,pe,Ob)}function z8(f,w){var F=Yt(f)?$s:Fb;return F(f,Gd(Vt(w,3)))}function U8(f){var w=Yt(f)?Rb:O6;return w(f)}function $8(f,w,F){(F?Qi(f,w,F):w===n)?w=1:w=qt(w);var J=Yt(f)?d6:F6;return J(f,w)}function H8(f){var w=Yt(f)?f6:D6;return w(f)}function j8(f){if(f==null)return 0;if(gr(f))return zd(f)?ho(f):f.length;var w=Vi(f);return w==Y||w==Me?f.size:om(f).length}function X8(f,w,F){var J=Yt(f)?Hs:V6;return F&&Qi(f,w,F)&&(w=n),J(f,Vt(w,3))}var Y8=en(function(f,w){if(f==null)return[];var F=w.length;return F>1&&Qi(f,w[0],w[1])?w=[]:F>2&&Qi(w[0],w[1],w[2])&&(w=[w[0]]),jb(f,Ri(w,1),[])}),Dd=vt||function(){return Dn.Date.now()};function K8(f,w){if(typeof w!="function")throw new pr(a);return f=qt(f),function(){if(--f<1)return w.apply(this,arguments)}}function G3(f,w,F){return w=F?n:w,w=f&&w==null?f.length:w,yo(f,M,n,n,n,n,w)}function W3(f,w){var F;if(typeof w!="function")throw new pr(a);return f=qt(f),function(){return--f>0&&(F=w.apply(this,arguments)),f<=1&&(w=n),F}}var Am=en(function(f,w,F){var J=p;if(F.length){var pe=js(F,Vl(Am));J|=_}return yo(f,J,w,F,pe)}),z3=en(function(f,w,F){var J=p|v;if(F.length){var pe=js(F,Vl(z3));J|=_}return yo(w,J,f,F,pe)});function U3(f,w,F){w=F?n:w;var J=yo(f,T,n,n,n,n,n,w);return J.placeholder=U3.placeholder,J}function $3(f,w,F){w=F?n:w;var J=yo(f,P,n,n,n,n,n,w);return J.placeholder=$3.placeholder,J}function H3(f,w,F){var J,pe,Te,Oe,ze,Ye,ot=0,at=!1,ct=!1,wt=!0;if(typeof f!="function")throw new pr(a);w=Qr(w)||0,Kn(F)&&(at=!!F.leading,ct="maxWait"in F,Te=ct?Kt(Qr(F.maxWait)||0,w):Te,wt="trailing"in F?!!F.trailing:wt);function Ot(li){var Ts=J,wo=pe;return J=pe=n,ot=li,Oe=f.apply(wo,Ts),Oe}function Gt(li){return ot=li,ze=Pc(rn,w),at?Ot(li):Oe}function Zt(li){var Ts=li-Ye,wo=li-ot,cy=w-Ts;return ct?yi(cy,Te-wo):cy}function Wt(li){var Ts=li-Ye,wo=li-ot;return Ye===n||Ts>=w||Ts<0||ct&&wo>=Te}function rn(){var li=Dd();if(Wt(li))return dn(li);ze=Pc(rn,Zt(li))}function dn(li){return ze=n,wt&&J?Ot(li):(J=pe=n,Oe)}function Rr(){ze!==n&&t3(ze),ot=0,J=Ye=pe=ze=n}function Zi(){return ze===n?Oe:dn(Dd())}function Ir(){var li=Dd(),Ts=Wt(li);if(J=arguments,pe=this,Ye=li,Ts){if(ze===n)return Gt(Ye);if(ct)return t3(ze),ze=Pc(rn,w),Ot(Ye)}return ze===n&&(ze=Pc(rn,w)),Oe}return Ir.cancel=Rr,Ir.flush=Zi,Ir}var q8=en(function(f,w){return kb(f,1,w)}),Q8=en(function(f,w,F){return kb(f,Qr(w)||0,F)});function Z8(f){return yo(f,I)}function Vd(f,w){if(typeof f!="function"||w!=null&&typeof w!="function")throw new pr(a);var F=function(){var J=arguments,pe=w?w.apply(this,J):J[0],Te=F.cache;if(Te.has(pe))return Te.get(pe);var Oe=f.apply(this,J);return F.cache=Te.set(pe,Oe)||Te,Oe};return F.cache=new(Vd.Cache||go),F}Vd.Cache=go;function Gd(f){if(typeof f!="function")throw new pr(a);return function(){var w=arguments;switch(w.length){case 0:return!f.call(this);case 1:return!f.call(this,w[0]);case 2:return!f.call(this,w[0],w[1]);case 3:return!f.call(this,w[0],w[1],w[2])}return!f.apply(this,w)}}function J8(f){return W3(2,f)}var ew=G6(function(f,w){w=w.length==1&&Yt(w[0])?Rn(w[0],Ki(Vt())):Rn(Ri(w,1),Ki(Vt()));var F=w.length;return en(function(J){for(var pe=-1,Te=yi(J.length,F);++pe=w}),Ha=Vb(function(){return arguments}())?Vb:function(f){return ni(f)&&wn.call(f,"callee")&&!De.call(f,"callee")},Yt=tt.isArray,mw=Ml?Ki(Ml):w6;function gr(f){return f!=null&&Wd(f.length)&&!Eo(f)}function ai(f){return ni(f)&&gr(f)}function gw(f){return f===!0||f===!1||ni(f)&&qi(f)==Ee}var Qo=Pt||zm,bw=id?Ki(id):_6;function yw(f){return ni(f)&&f.nodeType===1&&!Mc(f)}function vw(f){if(f==null)return!0;if(gr(f)&&(Yt(f)||typeof f=="string"||typeof f.splice=="function"||Qo(f)||Gl(f)||Ha(f)))return!f.length;var w=Vi(f);if(w==Y||w==Me)return!f.size;if(Tc(f))return!om(f).length;for(var F in f)if(wn.call(f,F))return!1;return!0}function Sw(f,w){return xc(f,w)}function Ew(f,w,F){F=typeof F=="function"?F:n;var J=F?F(f,w):n;return J===n?xc(f,w,n,F):!!J}function Im(f){if(!ni(f))return!1;var w=qi(f);return w==re||w==te||typeof f.message=="string"&&typeof f.name=="string"&&!Mc(f)}function xw(f){return typeof f=="number"&&On(f)}function Eo(f){if(!Kn(f))return!1;var w=qi(f);return w==O||w==z||w==ye||w==me}function X3(f){return typeof f=="number"&&f==qt(f)}function Wd(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=L}function Kn(f){var w=typeof f;return f!=null&&(w=="object"||w=="function")}function ni(f){return f!=null&&typeof f=="object"}var Y3=ic?Ki(ic):P6;function ww(f,w){return f===w||sm(f,w,xm(w))}function _w(f,w,F){return F=typeof F=="function"?F:n,sm(f,w,xm(w),F)}function Tw(f){return K3(f)&&f!=+f}function Pw(f){if(u7(f))throw new $t(b);return Gb(f)}function Mw(f){return f===null}function Cw(f){return f==null}function K3(f){return typeof f=="number"||ni(f)&&qi(f)==q}function Mc(f){if(!ni(f)||qi(f)!=le)return!1;var w=Le(f);if(w===null)return!0;var F=wn.call(w,"constructor")&&w.constructor;return typeof F=="function"&&F instanceof F&&Da.call(F)==q1}var Nm=rd?Ki(rd):M6;function Lw(f){return X3(f)&&f>=-L&&f<=L}var q3=sd?Ki(sd):C6;function zd(f){return typeof f=="string"||!Yt(f)&&ni(f)&&qi(f)==Ue}function Ar(f){return typeof f=="symbol"||ni(f)&&qi(f)==Ge}var Gl=Cl?Ki(Cl):L6;function Aw(f){return f===n}function Rw(f){return ni(f)&&Vi(f)==Re}function Iw(f){return ni(f)&&qi(f)==We}var Nw=Id(am),kw=Id(function(f,w){return f<=w});function Q3(f){if(!f)return[];if(gr(f))return zd(f)?fr(f):mr(f);if(rt&&f[rt])return W1(f[rt]());var w=Vi(f),F=w==Y?fc:w==Me?Rl:Wl;return F(f)}function xo(f){if(!f)return f===0?f:0;if(f=Qr(f),f===X||f===-X){var w=f<0?-1:1;return w*H}return f===f?f:0}function qt(f){var w=xo(f),F=w%1;return w===w?F?w-F:w:0}function Z3(f){return f?Wa(qt(f),0,ie):0}function Qr(f){if(typeof f=="number")return f;if(Ar(f))return ne;if(Kn(f)){var w=typeof f.valueOf=="function"?f.valueOf():f;f=Kn(w)?w+"":w}if(typeof f!="string")return f===0?f:+f;f=hd(f);var F=wl.test(f);return F||xn.test(f)?zs(f.slice(2),F?2:8):Ds.test(f)?ne:+f}function J3(f){return Ys(f,br(f))}function Ow(f){return f?Wa(qt(f),-L,L):f===0?f:0}function Mn(f){return f==null?"":Lr(f)}var Fw=Bl(function(f,w){if(Tc(w)||gr(w)){Ys(w,_i(w),f);return}for(var F in w)wn.call(w,F)&&vc(f,F,w[F])}),ey=Bl(function(f,w){Ys(w,br(w),f)}),Ud=Bl(function(f,w,F,J){Ys(w,br(w),f,J)}),Bw=Bl(function(f,w,F,J){Ys(w,_i(w),f,J)}),Dw=vo(em);function Vw(f,w){var F=Fl(f);return w==null?F:Ib(F,w)}var Gw=en(function(f,w){f=Pn(f);var F=-1,J=w.length,pe=J>2?w[2]:n;for(pe&&Qi(w[0],w[1],pe)&&(J=1);++F1),Te}),Ys(f,Sm(f),F),J&&(F=Yr(F,c|o|u,Q6));for(var pe=w.length;pe--;)dm(F,w[pe]);return F});function r_(f,w){return ny(f,Gd(Vt(w)))}var s_=vo(function(f,w){return f==null?{}:I6(f,w)});function ny(f,w){if(f==null)return{};var F=Rn(Sm(f),function(J){return[J]});return w=Vt(w),Xb(f,F,function(J,pe){return w(J,pe[0])})}function o_(f,w,F){w=Ko(w,f);var J=-1,pe=w.length;for(pe||(pe=1,f=n);++Jw){var J=f;f=w,w=J}if(F||f%1||w%1){var pe=Cb();return yi(f+pe*(w-f+Es("1e-"+((pe+"").length-1))),w)}return um(f,w)}var b_=Dl(function(f,w,F){return w=w.toLowerCase(),f+(F?sy(w):w)});function sy(f){return Fm(Mn(f).toLowerCase())}function oy(f){return f=Mn(f),f&&f.replace(xi,B1).replace(Cn,"")}function y_(f,w,F){f=Mn(f),w=Lr(w);var J=f.length;F=F===n?J:Wa(qt(F),0,J);var pe=F;return F-=w.length,F>=0&&f.slice(F,pe)==w}function v_(f){return f=Mn(f),f&&sn.test(f)?f.replace(Lt,Fa):f}function S_(f){return f=Mn(f),f&&Bs.test(f)?f.replace(oi,"\\$&"):f}var E_=Dl(function(f,w,F){return f+(F?"-":"")+w.toLowerCase()}),x_=Dl(function(f,w,F){return f+(F?" ":"")+w.toLowerCase()}),w_=u3("toLowerCase");function __(f,w,F){f=Mn(f),w=qt(w);var J=w?ho(f):0;if(!w||J>=w)return f;var pe=(w-J)/2;return Rd(yn(pe),F)+f+Rd(Xt(pe),F)}function T_(f,w,F){f=Mn(f),w=qt(w);var J=w?ho(f):0;return w&&J>>0,F?(f=Mn(f),f&&(typeof w=="string"||w!=null&&!Nm(w))&&(w=Lr(w),!w&&Ho(f))?qo(fr(f),0,F):f.split(w,F)):[]}var I_=Dl(function(f,w,F){return f+(F?" ":"")+Fm(w)});function N_(f,w,F){return f=Mn(f),F=F==null?0:Wa(qt(F),0,f.length),w=Lr(w),f.slice(F,F+w.length)==w}function k_(f,w,F){var J=xe.templateSettings;F&&Qi(f,w,F)&&(w=n),f=Mn(f),w=Ud({},w,J,g3);var pe=Ud({},w.imports,J.imports,g3),Te=_i(pe),Oe=hc(pe,Te),ze,Ye,ot=0,at=w.interpolate||gs,ct="__p += '",wt=jr((w.escape||gs).source+"|"+at.source+"|"+(at===kn?Hi:gs).source+"|"+(w.evaluate||gs).source+"|$","g"),Ot="//# sourceURL="+(wn.call(w,"sourceURL")?(w.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ur+"]")+` -`;f.replace(wt,function(Wt,rn,dn,Rr,Zi,Ir){return dn||(dn=Rr),ct+=f.slice(ot,Ir).replace(_l,D1),rn&&(ze=!0,ct+=`' + -__e(`+rn+`) + -'`),Zi&&(Ye=!0,ct+=`'; -`+Zi+`; -__p += '`),dn&&(ct+=`' + -((__t = (`+dn+`)) == null ? '' : __t) + -'`),ot=Ir+Wt.length,Wt}),ct+=`'; -`;var Gt=wn.call(w,"variable")&&w.variable;if(!Gt)ct=`with (obj) { -`+ct+` -} -`;else if(Do.test(Gt))throw new $t(r);ct=(Ye?ct.replace(Jt,""):ct).replace(hi,"$1").replace(jn,"$1;"),ct="function("+(Gt||"obj")+`) { -`+(Gt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ze?", __e = _.escape":"")+(Ye?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+ct+`return __p -}`;var Zt=ly(function(){return bn(Te,Ot+"return "+ct).apply(n,Oe)});if(Zt.source=ct,Im(Zt))throw Zt;return Zt}function O_(f){return Mn(f).toLowerCase()}function F_(f){return Mn(f).toUpperCase()}function B_(f,w,F){if(f=Mn(f),f&&(F||w===n))return hd(f);if(!f||!(w=Lr(w)))return f;var J=fr(f),pe=fr(w),Te=dd(J,pe),Oe=fd(J,pe)+1;return qo(J,Te,Oe).join("")}function D_(f,w,F){if(f=Mn(f),f&&(F||w===n))return f.slice(0,md(f)+1);if(!f||!(w=Lr(w)))return f;var J=fr(f),pe=fd(J,fr(w))+1;return qo(J,0,pe).join("")}function V_(f,w,F){if(f=Mn(f),f&&(F||w===n))return f.replace(Dt,"");if(!f||!(w=Lr(w)))return f;var J=fr(f),pe=dd(J,fr(w));return qo(J,pe).join("")}function G_(f,w){var F=R,J=V;if(Kn(w)){var pe="separator"in w?w.separator:pe;F="length"in w?qt(w.length):F,J="omission"in w?Lr(w.omission):J}f=Mn(f);var Te=f.length;if(Ho(f)){var Oe=fr(f);Te=Oe.length}if(F>=Te)return f;var ze=F-ho(J);if(ze<1)return J;var Ye=Oe?qo(Oe,0,ze).join(""):f.slice(0,ze);if(pe===n)return Ye+J;if(Oe&&(ze+=Ye.length-ze),Nm(pe)){if(f.slice(ze).search(pe)){var ot,at=Ye;for(pe.global||(pe=jr(pe.source,Mn(Vo.exec(pe))+"g")),pe.lastIndex=0;ot=pe.exec(at);)var ct=ot.index;Ye=Ye.slice(0,ct===n?ze:ct)}}else if(f.indexOf(Lr(pe),ze)!=ze){var wt=Ye.lastIndexOf(pe);wt>-1&&(Ye=Ye.slice(0,wt))}return Ye+J}function W_(f){return f=Mn(f),f&&Bn.test(f)?f.replace($r,gd):f}var z_=Dl(function(f,w,F){return f+(F?" ":"")+w.toUpperCase()}),Fm=u3("toUpperCase");function ay(f,w,F){return f=Mn(f),w=F?n:w,w===n?G1(f)?j1(f):k1(f):f.match(w)||[]}var ly=en(function(f,w){try{return Yi(f,n,w)}catch(F){return Im(F)?F:new $t(F)}}),U_=vo(function(f,w){return hr(w,function(F){F=Ks(F),bo(f,F,Am(f[F],f))}),f});function $_(f){var w=f==null?0:f.length,F=Vt();return f=w?Rn(f,function(J){if(typeof J[1]!="function")throw new pr(a);return[F(J[0]),J[1]]}):[],en(function(J){for(var pe=-1;++peL)return[];var F=ie,J=yi(f,ie);w=Vt(w),f-=ie;for(var pe=cc(J,w);++F0||w<0)?new on(F):(f<0?F=F.takeRight(-f):f&&(F=F.drop(f)),w!==n&&(w=qt(w),F=w<0?F.dropRight(-w):F.take(w-f)),F)},on.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},on.prototype.toArray=function(){return this.take(ie)},Xs(on.prototype,function(f,w){var F=/^(?:filter|find|map|reject)|While$/.test(w),J=/^(?:head|last)$/.test(w),pe=xe[J?"take"+(w=="last"?"Right":""):w],Te=J||/^find/.test(w);pe&&(xe.prototype[w]=function(){var Oe=this.__wrapped__,ze=J?[1]:arguments,Ye=Oe instanceof on,ot=ze[0],at=Ye||Yt(Oe),ct=function(rn){var dn=pe.apply(xe,xs([rn],ze));return J&&wt?dn[0]:dn};at&&F&&typeof ot=="function"&&ot.length!=1&&(Ye=at=!1);var wt=this.__chain__,Ot=!!this.__actions__.length,Gt=Te&&!wt,Zt=Ye&&!Ot;if(!Te&&at){Oe=Zt?Oe:new on(this);var Wt=f.apply(Oe,ze);return Wt.__actions__.push({func:Fd,args:[ct],thisArg:n}),new Xr(Wt,wt)}return Gt&&Zt?f.apply(this,ze):(Wt=this.thru(ct),Gt?J?Wt.value()[0]:Wt.value():Wt)})}),hr(["pop","push","shift","sort","splice","unshift"],function(f){var w=Ba[f],F=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",J=/^(?:pop|shift)$/.test(f);xe.prototype[f]=function(){var pe=arguments;if(J&&!this.__chain__){var Te=this.value();return w.apply(Yt(Te)?Te:[],pe)}return this[F](function(Oe){return w.apply(Yt(Oe)?Oe:[],pe)})}}),Xs(on.prototype,function(f,w){var F=xe[w];if(F){var J=F.name+"";wn.call(Ol,J)||(Ol[J]=[]),Ol[J].push({name:w,func:F})}}),Ol[Ld(n,v).name]=[{name:"wrapper",func:n}],on.prototype.clone=Wx,on.prototype.reverse=zx,on.prototype.value=Ux,xe.prototype.at=y8,xe.prototype.chain=v8,xe.prototype.commit=S8,xe.prototype.next=E8,xe.prototype.plant=w8,xe.prototype.reverse=_8,xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=T8,xe.prototype.first=xe.prototype.head,rt&&(xe.prototype[rt]=x8),xe},fo=X1();Us?((Us.exports=fo)._=fo,nc._=fo):Dn._=fo}).call(ql)})(lp,lp.exports);var Ct=lp.exports;const BM={black:"#000",white:"#fff"},Ch=BM,DM={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ul=DM,VM={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},$l=VM,GM={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Hl=GM,WM={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},jl=WM,zM={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Xl=zM,UM={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Fc=UM,$M={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},HM=$M;function Ma(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n=0)&&(n[g]=e[g]);return n}function cE(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var jM=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,XM=cE(function(e){return jM.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function YM(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ni(Qu,--Mr):0,$u--,mi===10&&($u=1,Vp--),mi}function Vr(){return mi=Mr2||Ah(mi)>3?"":" "}function aC(e,t){for(;--t&&Vr()&&!(mi<48||mi>102||mi>57&&mi<65||mi>70&&mi<97););return Qh(e,Rf()+(t<6&&lo()==32&&Vr()==32))}function kg(e){for(;Vr();)switch(mi){case e:return Mr;case 34:case 39:e!==34&&e!==39&&kg(mi);break;case 40:e===41&&kg(e);break;case 92:Vr();break}return Mr}function lC(e,t){for(;Vr()&&e+mi!==57;)if(e+mi===84&&lo()===47)break;return"/*"+Qh(t,Mr-1)+"*"+Dp(e===47?e:Vr())}function uC(e){for(;!Ah(lo());)Vr();return Qh(e,Mr)}function cC(e){return gE(Nf("",null,null,null,[""],e=mE(e),0,[0],e))}function Nf(e,t,n,l,g,b,a,r,h){for(var s=0,m=0,c=a,o=0,u=0,d=0,x=1,p=1,v=1,S=0,T="",P=g,_=b,E=l,M=T;p;)switch(d=S,S=Vr()){case 40:if(d!=108&&Ni(M,c-1)==58){Ng(M+=Tn(If(S),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:M+=If(S);break;case 9:case 10:case 13:case 32:M+=oC(d);break;case 92:M+=aC(Rf()-1,7);continue;case 47:switch(lo()){case 42:case 47:cf(hC(lC(Vr(),Rf()),t,n),h);break;default:M+="/"}break;case 123*x:r[s++]=no(M)*v;case 125*x:case 59:case 0:switch(S){case 0:case 125:p=0;case 59+m:v==-1&&(M=Tn(M,/\f/g,"")),u>0&&no(M)-c&&cf(u>32?Cv(M+";",l,n,c-1):Cv(Tn(M," ","")+";",l,n,c-2),h);break;case 59:M+=";";default:if(cf(E=Mv(M,t,n,s,m,g,r,T,P=[],_=[],c),b),S===123)if(m===0)Nf(M,t,E,E,P,b,c,r,_);else switch(o===99&&Ni(M,3)===110?100:o){case 100:case 108:case 109:case 115:Nf(e,E,E,l&&cf(Mv(e,E,E,0,0,g,r,T,g,P=[],c),_),g,_,c,r,l?P:_);break;default:Nf(M,E,E,E,[""],_,0,r,_)}}s=m=u=0,x=v=1,T=M="",c=a;break;case 58:c=1+no(M),u=d;default:if(x<1){if(S==123)--x;else if(S==125&&x++==0&&sC()==125)continue}switch(M+=Dp(S),S*x){case 38:v=m>0?1:(M+="\f",-1);break;case 44:r[s++]=(no(M)-1)*v,v=1;break;case 64:lo()===45&&(M+=If(Vr())),o=lo(),m=c=no(T=M+=uC(Rf())),S++;break;case 45:d===45&&no(M)==2&&(x=0)}}return b}function Mv(e,t,n,l,g,b,a,r,h,s,m){for(var c=g-1,o=g===0?b:[""],u=$2(o),d=0,x=0,p=0;d0?o[v]+" "+S:Tn(S,/&\f/g,o[v])))&&(h[p++]=T);return Gp(e,t,n,g===0?z2:r,h,s,m)}function hC(e,t,n){return Gp(e,t,n,hE,Dp(rC()),Lh(e,2,-2),0)}function Cv(e,t,n,l){return Gp(e,t,n,U2,Lh(e,0,l),Lh(e,l+1,-1),l)}function yu(e,t){for(var n="",l=$2(e),g=0;g6)switch(Ni(e,t+1)){case 109:if(Ni(e,t+4)!==45)break;case 102:return Tn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+up+(Ni(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ng(e,"stretch")?bE(Tn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ni(e,t+1)!==115)break;case 6444:switch(Ni(e,no(e)-3-(~Ng(e,"!important")&&10))){case 107:return Tn(e,":",":"+_n)+e;case 101:return Tn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Ni(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+zi+"$2box$3")+e}break;case 5936:switch(Ni(e,t+11)){case 114:return _n+e+zi+Tn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+zi+Tn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+zi+Tn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+zi+e+e}return e}var SC=function(t,n,l,g){if(t.length>-1&&!t.return)switch(t.type){case U2:t.return=bE(t.value,t.length);break;case dE:return yu([Bc(t,{value:Tn(t.value,"@","@"+_n)})],g);case z2:if(t.length)return iC(t.props,function(b){switch(nC(b,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return yu([Bc(t,{props:[Tn(b,/:(read-\w+)/,":"+up+"$1")]})],g);case"::placeholder":return yu([Bc(t,{props:[Tn(b,/:(plac\w+)/,":"+_n+"input-$1")]}),Bc(t,{props:[Tn(b,/:(plac\w+)/,":"+up+"$1")]}),Bc(t,{props:[Tn(b,/:(plac\w+)/,zi+"input-$1")]})],g)}return""})}},EC=[SC],xC=function(t){var n=t.key;if(n==="css"){var l=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(l,function(x){var p=x.getAttribute("data-emotion");p.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var g=t.stylisPlugins||EC,b={},a,r=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var p=x.getAttribute("data-emotion").split(" "),v=1;v=4;++l,g-=4)n=e.charCodeAt(l)&255|(e.charCodeAt(++l)&255)<<8|(e.charCodeAt(++l)&255)<<16|(e.charCodeAt(++l)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(g){case 3:t^=(e.charCodeAt(l+2)&255)<<16;case 2:t^=(e.charCodeAt(l+1)&255)<<8;case 1:t^=e.charCodeAt(l)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var kC={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},OC=/[A-Z]|^ms/g,FC=/_EMO_([^_]+?)_([^]*?)_EMO_/g,_E=function(t){return t.charCodeAt(1)===45},Av=function(t){return t!=null&&typeof t!="boolean"},y0=cE(function(e){return _E(e)?e:e.replace(OC,"-$&").toLowerCase()}),Rv=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(FC,function(l,g,b){return io={name:g,styles:b,next:io},g})}return kC[t]!==1&&!_E(t)&&typeof n=="number"&&n!==0?n+"px":n};function Rh(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return io={name:n.name,styles:n.styles,next:io},n.name;if(n.styles!==void 0){var l=n.next;if(l!==void 0)for(;l!==void 0;)io={name:l.name,styles:l.styles,next:io},l=l.next;var g=n.styles+";";return g}return BC(e,t,n)}case"function":{if(e!==void 0){var b=io,a=n(e);return io=b,Rh(e,t,a)}break}}if(t==null)return n;var r=t[n];return r!==void 0?r:n}function BC(e,t,n){var l="";if(Array.isArray(n))for(var g=0;g96?WC:zC},Ov=function(t,n,l){var g;if(n){var b=n.shouldForwardProp;g=t.__emotion_forwardProp&&b?function(a){return t.__emotion_forwardProp(a)&&b(a)}:b}return typeof g!="function"&&l&&(g=t.__emotion_forwardProp),g},UC=function(t){var n=t.cache,l=t.serialized,g=t.isStringTag;return xE(n,l,g),VC(function(){return wE(n,l,g)}),null},$C=function e(t,n){var l=t.__emotion_real===t,g=l&&t.__emotion_base||t,b,a;n!==void 0&&(b=n.label,a=n.target);var r=Ov(t,n,l),h=r||kv(g),s=!h("as");return function(){var m=arguments,c=l&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(b!==void 0&&c.push("label:"+b+";"),m[0]==null||m[0].raw===void 0)c.push.apply(c,m);else{c.push(m[0][0]);for(var o=m.length,u=1;ut(jC(g)?n:g):t;return Be.jsx(GC,{styles:l})}function YC(e,t){return Og(e,t)}const KC=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))};function aa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CE(e){if(!aa(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=CE(e[n])}),t}function ls(e,t,n={clone:!0}){const l=n.clone?Ne({},e):e;return aa(e)&&aa(t)&&Object.keys(t).forEach(g=>{g!=="__proto__"&&(aa(t[g])&&g in e&&aa(e[g])?l[g]=ls(e[g],t[g],n):n.clone?l[g]=aa(t[g])?CE(t[g]):t[g]:l[g]=t[g])}),l}var Nn={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Q2=Symbol.for("react.element"),Z2=Symbol.for("react.portal"),Qp=Symbol.for("react.fragment"),Zp=Symbol.for("react.strict_mode"),Jp=Symbol.for("react.profiler"),e1=Symbol.for("react.provider"),t1=Symbol.for("react.context"),qC=Symbol.for("react.server_context"),n1=Symbol.for("react.forward_ref"),i1=Symbol.for("react.suspense"),r1=Symbol.for("react.suspense_list"),s1=Symbol.for("react.memo"),o1=Symbol.for("react.lazy"),QC=Symbol.for("react.offscreen"),LE;LE=Symbol.for("react.module.reference");function ds(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Q2:switch(e=e.type,e){case Qp:case Jp:case Zp:case i1:case r1:return e;default:switch(e=e&&e.$$typeof,e){case qC:case t1:case n1:case o1:case s1:case e1:return e;default:return t}}case Z2:return t}}}Nn.ContextConsumer=t1;Nn.ContextProvider=e1;Nn.Element=Q2;Nn.ForwardRef=n1;Nn.Fragment=Qp;Nn.Lazy=o1;Nn.Memo=s1;Nn.Portal=Z2;Nn.Profiler=Jp;Nn.StrictMode=Zp;Nn.Suspense=i1;Nn.SuspenseList=r1;Nn.isAsyncMode=function(){return!1};Nn.isConcurrentMode=function(){return!1};Nn.isContextConsumer=function(e){return ds(e)===t1};Nn.isContextProvider=function(e){return ds(e)===e1};Nn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Q2};Nn.isForwardRef=function(e){return ds(e)===n1};Nn.isFragment=function(e){return ds(e)===Qp};Nn.isLazy=function(e){return ds(e)===o1};Nn.isMemo=function(e){return ds(e)===s1};Nn.isPortal=function(e){return ds(e)===Z2};Nn.isProfiler=function(e){return ds(e)===Jp};Nn.isStrictMode=function(e){return ds(e)===Zp};Nn.isSuspense=function(e){return ds(e)===i1};Nn.isSuspenseList=function(e){return ds(e)===r1};Nn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Qp||e===Jp||e===Zp||e===i1||e===r1||e===QC||typeof e=="object"&&e!==null&&(e.$$typeof===o1||e.$$typeof===s1||e.$$typeof===e1||e.$$typeof===t1||e.$$typeof===n1||e.$$typeof===LE||e.getModuleId!==void 0)};Nn.typeOf=ds;function Ht(e){if(typeof e!="string")throw new Error(Ma(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Fg(...e){return e.reduce((t,n)=>n==null?t:function(...g){t.apply(this,g),n.apply(this,g)},()=>{})}function J2(e,t=166){let n;function l(...g){const b=()=>{e.apply(this,g)};clearTimeout(n),n=setTimeout(b,t)}return l.clear=()=>{clearTimeout(n)},l}function ZC(e,t){return()=>null}function kf(e,t){var n,l;return ke.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(l=e.type)==null||(l=l._payload)==null||(l=l.value)==null?void 0:l.muiName)!==-1}function Pr(e){return e&&e.ownerDocument||document}function Ca(e){return Pr(e).defaultView||window}function JC(e,t){return()=>null}function cp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const La=typeof window<"u"?ke.useLayoutEffect:ke.useEffect;let Fv=0;function eL(e){const[t,n]=ke.useState(e),l=e||t;return ke.useEffect(()=>{t==null&&(Fv+=1,n(`mui-${Fv}`))},[t]),l}const Bv=M0.useId;function eb(e){if(Bv!==void 0){const t=Bv();return e??t}return eL(e)}function tL(e,t,n,l,g){return null}function hp({controlled:e,default:t,name:n,state:l="value"}){const{current:g}=ke.useRef(e!==void 0),[b,a]=ke.useState(t),r=g?e:b,h=ke.useCallback(s=>{g||a(s)},[]);return[r,h]}function el(e){const t=ke.useRef(e);return La(()=>{t.current=e}),ke.useRef((...n)=>(0,t.current)(...n)).current}function Bi(...e){return ke.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{cp(n,t)})},e)}const Dv={};function nL(e,t){const n=ke.useRef(Dv);return n.current===Dv&&(n.current=e(t)),n}const iL=[];function rL(e){ke.useEffect(e,iL)}class a1{constructor(){this.currentId=0,this.clear=()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)},this.disposeEffect=()=>this.clear}static create(){return new a1}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,n()},t)}}function tb(){const e=nL(a1.create).current;return rL(e.disposeEffect),e}let l1=!0,Bg=!1;const sL=new a1,oL={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function aL(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&oL[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function lL(e){e.metaKey||e.altKey||e.ctrlKey||(l1=!0)}function v0(){l1=!1}function uL(){this.visibilityState==="hidden"&&Bg&&(l1=!0)}function cL(e){e.addEventListener("keydown",lL,!0),e.addEventListener("mousedown",v0,!0),e.addEventListener("pointerdown",v0,!0),e.addEventListener("touchstart",v0,!0),e.addEventListener("visibilitychange",uL,!0)}function hL(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return l1||aL(t)}function AE(){const e=ke.useCallback(g=>{g!=null&&cL(g.ownerDocument)},[]),t=ke.useRef(!1);function n(){return t.current?(Bg=!0,sL.start(100,()=>{Bg=!1}),t.current=!1,!0):!1}function l(g){return hL(g)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:l,onBlur:n,ref:e}}function RE(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function dL(e){return ke.Children.toArray(e).filter(t=>ke.isValidElement(t))}function u1(e,t){const n=Ne({},t);return Object.keys(e).forEach(l=>{if(l.toString().match(/^(components|slots)$/))n[l]=Ne({},e[l],n[l]);else if(l.toString().match(/^(componentsProps|slotProps)$/)){const g=e[l]||{},b=t[l];n[l]={},!b||!Object.keys(b)?n[l]=g:!g||!Object.keys(g)?n[l]=b:(n[l]=Ne({},b),Object.keys(g).forEach(a=>{n[l][a]=u1(g[a],b[a])}))}else n[l]===void 0&&(n[l]=e[l])}),n}function fn(e,t,n=void 0){const l={};return Object.keys(e).forEach(g=>{l[g]=e[g].reduce((b,a)=>{if(a){const r=t(a);r!==""&&b.push(r),n&&n[a]&&b.push(n[a])}return b},[]).join(" ")}),l}const Vv=e=>e,fL=()=>{let e=Vv;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Vv}}},IE=fL(),pL={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ln(e,t,n="Mui"){const l=pL[t];return l?`${n}-${l}`:`${IE.generate(e)}-${t}`}function un(e,t,n="Mui"){const l={};return t.forEach(g=>{l[g]=ln(e,g,n)}),l}function mL(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const gL=["values","unit","step"],bL=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,l)=>n.val-l.val),t.reduce((n,l)=>Ne({},n,{[l.key]:l.val}),{})};function yL(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:l=5}=e,g=Nt(e,gL),b=bL(t),a=Object.keys(b);function r(o){return`@media (min-width:${typeof t[o]=="number"?t[o]:o}${n})`}function h(o){return`@media (max-width:${(typeof t[o]=="number"?t[o]:o)-l/100}${n})`}function s(o,u){const d=a.indexOf(u);return`@media (min-width:${typeof t[o]=="number"?t[o]:o}${n}) and (max-width:${(d!==-1&&typeof t[a[d]]=="number"?t[a[d]]:u)-l/100}${n})`}function m(o){return a.indexOf(o)+1`@media (min-width:${nb[e]}px)`};function hs(e,t,n){const l=e.theme||{};if(Array.isArray(t)){const b=l.breakpoints||Gv;return t.reduce((a,r,h)=>(a[b.up(b.keys[h])]=n(t[h]),a),{})}if(typeof t=="object"){const b=l.breakpoints||Gv;return Object.keys(t).reduce((a,r)=>{if(Object.keys(b.values||nb).indexOf(r)!==-1){const h=b.up(r);a[h]=n(t[r],r)}else{const h=r;a[h]=t[h]}return a},{})}return n(t)}function EL(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((l,g)=>{const b=e.up(g);return l[b]={},l},{}))||{}}function xL(e,t){return e.reduce((n,l)=>{const g=n[l];return(!g||Object.keys(g).length===0)&&delete n[l],n},t)}function wL(e,t){if(typeof e!="object")return{};const n={},l=Object.keys(t);return Array.isArray(e)?l.forEach((g,b)=>{b{e[g]!=null&&(n[g]=!0)}),n}function c1({values:e,breakpoints:t,base:n}){const l=n||wL(e,t),g=Object.keys(l);if(g.length===0)return e;let b;return g.reduce((a,r,h)=>(Array.isArray(e)?(a[r]=e[h]!=null?e[h]:e[b],b=h):typeof e=="object"?(a[r]=e[r]!=null?e[r]:e[b],b=r):a[r]=e,a),{})}function h1(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const l=`vars.${t}`.split(".").reduce((g,b)=>g&&g[b]?g[b]:null,e);if(l!=null)return l}return t.split(".").reduce((l,g)=>l&&l[g]!=null?l[g]:null,e)}function dp(e,t,n,l=n){let g;return typeof e=="function"?g=e(n):Array.isArray(e)?g=e[n]||l:g=h1(e,n)||l,t&&(g=t(g,l,e)),g}function ci(e){const{prop:t,cssProperty:n=e.prop,themeKey:l,transform:g}=e,b=a=>{if(a[t]==null)return null;const r=a[t],h=a.theme,s=h1(h,l)||{};return hs(a,r,c=>{let o=dp(s,g,c);return c===o&&typeof c=="string"&&(o=dp(s,g,`${t}${c==="default"?"":Ht(c)}`,c)),n===!1?o:{[n]:o}})};return b.propTypes={},b.filterProps=[t],b}function _L(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const TL={m:"margin",p:"padding"},PL={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Wv={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ML=_L(e=>{if(e.length>2)if(Wv[e])e=Wv[e];else return[e];const[t,n]=e.split(""),l=TL[t],g=PL[n]||"";return Array.isArray(g)?g.map(b=>l+b):[l+g]}),ib=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],rb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...ib,...rb];function Jh(e,t,n,l){var g;const b=(g=h1(e,t,!1))!=null?g:n;return typeof b=="number"?a=>typeof a=="string"?a:b*a:Array.isArray(b)?a=>typeof a=="string"?a:b[a]:typeof b=="function"?b:()=>{}}function NE(e){return Jh(e,"spacing",8)}function ed(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),l=e(n);return t>=0?l:typeof l=="number"?-l:`-${l}`}function CL(e,t){return n=>e.reduce((l,g)=>(l[g]=ed(t,n),l),{})}function LL(e,t,n,l){if(t.indexOf(n)===-1)return null;const g=ML(n),b=CL(g,l),a=e[n];return hs(e,a,b)}function kE(e,t){const n=NE(e.theme);return Object.keys(e).map(l=>LL(e,t,l,n)).reduce(sh,{})}function ii(e){return kE(e,ib)}ii.propTypes={};ii.filterProps=ib;function ri(e){return kE(e,rb)}ri.propTypes={};ri.filterProps=rb;function AL(e=8){if(e.mui)return e;const t=NE({spacing:e}),n=(...l)=>(l.length===0?[1]:l).map(b=>{const a=t(b);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function d1(...e){const t=e.reduce((l,g)=>(g.filterProps.forEach(b=>{l[b]=g}),l),{}),n=l=>Object.keys(l).reduce((g,b)=>t[b]?sh(g,t[b](l)):g,{});return n.propTypes={},n.filterProps=e.reduce((l,g)=>l.concat(g.filterProps),[]),n}function ss(e){return typeof e!="number"?e:`${e}px solid`}function fs(e,t){return ci({prop:e,themeKey:"borders",transform:t})}const RL=fs("border",ss),IL=fs("borderTop",ss),NL=fs("borderRight",ss),kL=fs("borderBottom",ss),OL=fs("borderLeft",ss),FL=fs("borderColor"),BL=fs("borderTopColor"),DL=fs("borderRightColor"),VL=fs("borderBottomColor"),GL=fs("borderLeftColor"),WL=fs("outline",ss),zL=fs("outlineColor"),f1=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Jh(e.theme,"shape.borderRadius",4),n=l=>({borderRadius:ed(t,l)});return hs(e,e.borderRadius,n)}return null};f1.propTypes={};f1.filterProps=["borderRadius"];d1(RL,IL,NL,kL,OL,FL,BL,DL,VL,GL,f1,WL,zL);const p1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Jh(e.theme,"spacing",8),n=l=>({gap:ed(t,l)});return hs(e,e.gap,n)}return null};p1.propTypes={};p1.filterProps=["gap"];const m1=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Jh(e.theme,"spacing",8),n=l=>({columnGap:ed(t,l)});return hs(e,e.columnGap,n)}return null};m1.propTypes={};m1.filterProps=["columnGap"];const g1=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Jh(e.theme,"spacing",8),n=l=>({rowGap:ed(t,l)});return hs(e,e.rowGap,n)}return null};g1.propTypes={};g1.filterProps=["rowGap"];const UL=ci({prop:"gridColumn"}),$L=ci({prop:"gridRow"}),HL=ci({prop:"gridAutoFlow"}),jL=ci({prop:"gridAutoColumns"}),XL=ci({prop:"gridAutoRows"}),YL=ci({prop:"gridTemplateColumns"}),KL=ci({prop:"gridTemplateRows"}),qL=ci({prop:"gridTemplateAreas"}),QL=ci({prop:"gridArea"});d1(p1,m1,g1,UL,$L,HL,jL,XL,YL,KL,qL,QL);function vu(e,t){return t==="grey"?t:e}const ZL=ci({prop:"color",themeKey:"palette",transform:vu}),JL=ci({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:vu}),eA=ci({prop:"backgroundColor",themeKey:"palette",transform:vu});d1(ZL,JL,eA);function Or(e){return e<=1&&e!==0?`${e*100}%`:e}const tA=ci({prop:"width",transform:Or}),sb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var l,g;const b=((l=e.theme)==null||(l=l.breakpoints)==null||(l=l.values)==null?void 0:l[n])||nb[n];return b?((g=e.theme)==null||(g=g.breakpoints)==null?void 0:g.unit)!=="px"?{maxWidth:`${b}${e.theme.breakpoints.unit}`}:{maxWidth:b}:{maxWidth:Or(n)}};return hs(e,e.maxWidth,t)}return null};sb.filterProps=["maxWidth"];const nA=ci({prop:"minWidth",transform:Or}),iA=ci({prop:"height",transform:Or}),rA=ci({prop:"maxHeight",transform:Or}),sA=ci({prop:"minHeight",transform:Or});ci({prop:"size",cssProperty:"width",transform:Or});ci({prop:"size",cssProperty:"height",transform:Or});const oA=ci({prop:"boxSizing"});d1(tA,sb,nA,iA,rA,sA,oA);const aA={border:{themeKey:"borders",transform:ss},borderTop:{themeKey:"borders",transform:ss},borderRight:{themeKey:"borders",transform:ss},borderBottom:{themeKey:"borders",transform:ss},borderLeft:{themeKey:"borders",transform:ss},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ss},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:f1},color:{themeKey:"palette",transform:vu},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:vu},backgroundColor:{themeKey:"palette",transform:vu},p:{style:ri},pt:{style:ri},pr:{style:ri},pb:{style:ri},pl:{style:ri},px:{style:ri},py:{style:ri},padding:{style:ri},paddingTop:{style:ri},paddingRight:{style:ri},paddingBottom:{style:ri},paddingLeft:{style:ri},paddingX:{style:ri},paddingY:{style:ri},paddingInline:{style:ri},paddingInlineStart:{style:ri},paddingInlineEnd:{style:ri},paddingBlock:{style:ri},paddingBlockStart:{style:ri},paddingBlockEnd:{style:ri},m:{style:ii},mt:{style:ii},mr:{style:ii},mb:{style:ii},ml:{style:ii},mx:{style:ii},my:{style:ii},margin:{style:ii},marginTop:{style:ii},marginRight:{style:ii},marginBottom:{style:ii},marginLeft:{style:ii},marginX:{style:ii},marginY:{style:ii},marginInline:{style:ii},marginInlineStart:{style:ii},marginInlineEnd:{style:ii},marginBlock:{style:ii},marginBlockStart:{style:ii},marginBlockEnd:{style:ii},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:p1},rowGap:{style:g1},columnGap:{style:m1},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Or},maxWidth:{style:sb},minWidth:{transform:Or},height:{transform:Or},maxHeight:{transform:Or},minHeight:{transform:Or},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},b1=aA;function lA(...e){const t=e.reduce((l,g)=>l.concat(Object.keys(g)),[]),n=new Set(t);return e.every(l=>n.size===Object.keys(l).length)}function uA(e,t){return typeof e=="function"?e(t):e}function cA(){function e(n,l,g,b){const a={[n]:l,theme:g},r=b[n];if(!r)return{[n]:l};const{cssProperty:h=n,themeKey:s,transform:m,style:c}=r;if(l==null)return null;if(s==="typography"&&l==="inherit")return{[n]:l};const o=h1(g,s)||{};return c?c(a):hs(a,l,d=>{let x=dp(o,m,d);return d===x&&typeof d=="string"&&(x=dp(o,m,`${n}${d==="default"?"":Ht(d)}`,d)),h===!1?x:{[h]:x}})}function t(n){var l;const{sx:g,theme:b={}}=n||{};if(!g)return null;const a=(l=b.unstable_sxConfig)!=null?l:b1;function r(h){let s=h;if(typeof h=="function")s=h(b);else if(typeof h!="object")return h;if(!s)return null;const m=EL(b.breakpoints),c=Object.keys(m);let o=m;return Object.keys(s).forEach(u=>{const d=uA(s[u],b);if(d!=null)if(typeof d=="object")if(a[u])o=sh(o,e(u,d,b,a));else{const x=hs({theme:b},d,p=>({[u]:p}));lA(x,d)?o[u]=t({sx:d,theme:b}):o=sh(o,x)}else o=sh(o,e(u,d,b,a))}),xL(c,o)}return Array.isArray(g)?g.map(r):r(g)}return t}const y1=cA();y1.filterProps=["sx"];function hA(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const dA=["breakpoints","palette","spacing","shape"];function ob(e={},...t){const{breakpoints:n={},palette:l={},spacing:g,shape:b={}}=e,a=Nt(e,dA),r=yL(n),h=AL(g);let s=ls({breakpoints:r,direction:"ltr",components:{},palette:Ne({mode:"light"},l),spacing:h,shape:Ne({},SL,b)},a);return s.applyStyles=hA,s=t.reduce((m,c)=>ls(m,c),s),s.unstable_sxConfig=Ne({},b1,a==null?void 0:a.unstable_sxConfig),s.unstable_sx=function(c){return y1({sx:c,theme:this})},s}function fA(e){return Object.keys(e).length===0}function pA(e=null){const t=ke.useContext(K2);return!t||fA(t)?e:t}const mA=ob();function ab(e=mA){return pA(e)}function gA({styles:e,themeId:t,defaultTheme:n={}}){const l=ab(n),g=typeof e=="function"?e(t&&l[t]||l):e;return Be.jsx(XC,{styles:g})}const bA=["sx"],yA=e=>{var t,n;const l={systemProps:{},otherProps:{}},g=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:b1;return Object.keys(e).forEach(b=>{g[b]?l.systemProps[b]=e[b]:l.otherProps[b]=e[b]}),l};function OE(e){const{sx:t}=e,n=Nt(e,bA),{systemProps:l,otherProps:g}=yA(n);let b;return Array.isArray(t)?b=[l,...t]:typeof t=="function"?b=(...a)=>{const r=t(...a);return aa(r)?Ne({},l,r):l}:b=Ne({},l,t),Ne({},g,{sx:b})}function FE(e){var t,n,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var g=e.length;for(t=0;t96}function oh(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const _A=ob(),TA=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function hf({defaultTheme:e,theme:t,themeId:n}){return xA(t)?e:t[n]||t}function PA(e){return e?(t,n)=>n[e]:null}function Of(e,t){let{ownerState:n}=t,l=Nt(t,vA);const g=typeof e=="function"?e(Ne({ownerState:n},l)):e;if(Array.isArray(g))return g.flatMap(b=>Of(b,Ne({ownerState:n},l)));if(g&&typeof g=="object"&&Array.isArray(g.variants)){const{variants:b=[]}=g;let r=Nt(g,SA);return b.forEach(h=>{let s=!0;typeof h.props=="function"?s=h.props(Ne({ownerState:n},l)):Object.keys(h.props).forEach(m=>{(n==null?void 0:n[m])!==h.props[m]&&l[m]!==h.props[m]&&(s=!1)}),s&&(Array.isArray(r)||(r=[r]),r.push(typeof h.style=="function"?h.style(Ne({ownerState:n},l)):h.style))}),r}return g}function MA(e={}){const{themeId:t,defaultTheme:n=_A,rootShouldForwardProp:l=oh,slotShouldForwardProp:g=oh}=e,b=a=>y1(Ne({},a,{theme:hf(Ne({},a,{defaultTheme:n,themeId:t}))}));return b.__mui_systemSx=!0,(a,r={})=>{KC(a,_=>_.filter(E=>!(E!=null&&E.__mui_systemSx)));const{name:h,slot:s,skipVariantsResolver:m,skipSx:c,overridesResolver:o=PA(TA(s))}=r,u=Nt(r,EA),d=m!==void 0?m:s&&s!=="Root"&&s!=="root"||!1,x=c||!1;let p,v=oh;s==="Root"||s==="root"?v=l:s?v=g:wA(a)&&(v=void 0);const S=YC(a,Ne({shouldForwardProp:v,label:p},u)),T=_=>typeof _=="function"&&_.__emotion_real!==_||aa(_)?E=>Of(_,Ne({},E,{theme:hf({theme:E.theme,defaultTheme:n,themeId:t})})):_,P=(_,...E)=>{let M=T(_);const N=E?E.map(T):[];h&&o&&N.push(V=>{const U=hf(Ne({},V,{defaultTheme:n,themeId:t}));if(!U.components||!U.components[h]||!U.components[h].styleOverrides)return null;const K=U.components[h].styleOverrides,k={};return Object.entries(K).forEach(([W,G])=>{k[W]=Of(G,Ne({},V,{theme:U}))}),o(V,k)}),h&&!d&&N.push(V=>{var U;const K=hf(Ne({},V,{defaultTheme:n,themeId:t})),k=K==null||(U=K.components)==null||(U=U[h])==null?void 0:U.variants;return Of({variants:k},Ne({},V,{theme:K}))}),x||N.push(b);const I=N.length-E.length;if(Array.isArray(_)&&I>0){const V=new Array(I).fill("");M=[..._,...V],M.raw=[..._.raw,...V]}const R=S(M,...N);return a.muiName&&(R.muiName=a.muiName),R};return S.withConfig&&(P.withConfig=S.withConfig),P}}function CA(e){const{theme:t,name:n,props:l}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?l:u1(t.components[n].defaultProps,l)}function LA({props:e,name:t,defaultTheme:n,themeId:l}){let g=ab(n);return l&&(g=g[l]||g),CA({theme:g,name:t,props:e})}function lb(e,t=0,n=1){return mL(e,t,n)}function AA(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(l=>l+l)),n?`rgb${n.length===4?"a":""}(${n.map((l,g)=>g<3?parseInt(l,16):Math.round(parseInt(l,16)/255*1e3)/1e3).join(", ")})`:""}function yl(e){if(e.type)return e;if(e.charAt(0)==="#")return yl(AA(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Ma(9,e));let l=e.substring(t+1,e.length-1),g;if(n==="color"){if(l=l.split(" "),g=l.shift(),l.length===4&&l[3].charAt(0)==="/"&&(l[3]=l[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(g)===-1)throw new Error(Ma(10,g))}else l=l.split(",");return l=l.map(b=>parseFloat(b)),{type:n,values:l,colorSpace:g}}function v1(e){const{type:t,colorSpace:n}=e;let{values:l}=e;return t.indexOf("rgb")!==-1?l=l.map((g,b)=>b<3?parseInt(g,10):g):t.indexOf("hsl")!==-1&&(l[1]=`${l[1]}%`,l[2]=`${l[2]}%`),t.indexOf("color")!==-1?l=`${n} ${l.join(" ")}`:l=`${l.join(", ")}`,`${t}(${l})`}function RA(e){e=yl(e);const{values:t}=e,n=t[0],l=t[1]/100,g=t[2]/100,b=l*Math.min(g,1-g),a=(s,m=(s+n/30)%12)=>g-b*Math.max(Math.min(m-3,9-m,1),-1);let r="rgb";const h=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(r+="a",h.push(t[3])),v1({type:r,values:h})}function zv(e){e=yl(e);let t=e.type==="hsl"||e.type==="hsla"?yl(RA(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function IA(e,t){const n=zv(e),l=zv(t);return(Math.max(n,l)+.05)/(Math.min(n,l)+.05)}function tr(e,t){return e=yl(e),t=lb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,v1(e)}function BE(e,t){if(e=yl(e),t=lb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return v1(e)}function DE(e,t){if(e=yl(e),t=lb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return v1(e)}function NA(e,t){return Ne({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const kA=["mode","contrastThreshold","tonalOffset"],Uv={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ch.white,default:Ch.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},S0={text:{primary:Ch.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ch.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function $v(e,t,n,l){const g=l.light||l,b=l.dark||l*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=DE(e.main,g):t==="dark"&&(e.dark=BE(e.main,b)))}function OA(e="light"){return e==="dark"?{main:Hl[200],light:Hl[50],dark:Hl[400]}:{main:Hl[700],light:Hl[400],dark:Hl[800]}}function FA(e="light"){return e==="dark"?{main:$l[200],light:$l[50],dark:$l[400]}:{main:$l[500],light:$l[300],dark:$l[700]}}function BA(e="light"){return e==="dark"?{main:Ul[500],light:Ul[300],dark:Ul[700]}:{main:Ul[700],light:Ul[400],dark:Ul[800]}}function DA(e="light"){return e==="dark"?{main:jl[400],light:jl[300],dark:jl[700]}:{main:jl[700],light:jl[500],dark:jl[900]}}function VA(e="light"){return e==="dark"?{main:Xl[400],light:Xl[300],dark:Xl[700]}:{main:Xl[800],light:Xl[500],dark:Xl[900]}}function GA(e="light"){return e==="dark"?{main:Fc[400],light:Fc[300],dark:Fc[700]}:{main:"#ed6c02",light:Fc[500],dark:Fc[900]}}function WA(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:l=.2}=e,g=Nt(e,kA),b=e.primary||OA(t),a=e.secondary||FA(t),r=e.error||BA(t),h=e.info||DA(t),s=e.success||VA(t),m=e.warning||GA(t);function c(x){return IA(x,S0.text.primary)>=n?S0.text.primary:Uv.text.primary}const o=({color:x,name:p,mainShade:v=500,lightShade:S=300,darkShade:T=700})=>{if(x=Ne({},x),!x.main&&x[v]&&(x.main=x[v]),!x.hasOwnProperty("main"))throw new Error(Ma(11,p?` (${p})`:"",v));if(typeof x.main!="string")throw new Error(Ma(12,p?` (${p})`:"",JSON.stringify(x.main)));return $v(x,"light",S,l),$v(x,"dark",T,l),x.contrastText||(x.contrastText=c(x.main)),x},u={dark:S0,light:Uv};return ls(Ne({common:Ne({},Ch),mode:t,primary:o({color:b,name:"primary"}),secondary:o({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:o({color:r,name:"error"}),warning:o({color:m,name:"warning"}),info:o({color:h,name:"info"}),success:o({color:s,name:"success"}),grey:HM,contrastThreshold:n,getContrastText:c,augmentColor:o,tonalOffset:l},u[t]),g)}const zA=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function UA(e){return Math.round(e*1e5)/1e5}const Hv={textTransform:"uppercase"},jv='"Roboto", "Helvetica", "Arial", sans-serif';function $A(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:l=jv,fontSize:g=14,fontWeightLight:b=300,fontWeightRegular:a=400,fontWeightMedium:r=500,fontWeightBold:h=700,htmlFontSize:s=16,allVariants:m,pxToRem:c}=n,o=Nt(n,zA),u=g/14,d=c||(v=>`${v/s*u}rem`),x=(v,S,T,P,_)=>Ne({fontFamily:l,fontWeight:v,fontSize:d(S),lineHeight:T},l===jv?{letterSpacing:`${UA(P/S)}em`}:{},_,m),p={h1:x(b,96,1.167,-1.5),h2:x(b,60,1.2,-.5),h3:x(a,48,1.167,0),h4:x(a,34,1.235,.25),h5:x(a,24,1.334,0),h6:x(r,20,1.6,.15),subtitle1:x(a,16,1.75,.15),subtitle2:x(r,14,1.57,.1),body1:x(a,16,1.5,.15),body2:x(a,14,1.43,.15),button:x(r,14,1.75,.4,Hv),caption:x(a,12,1.66,.4),overline:x(a,12,2.66,1,Hv),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ls(Ne({htmlFontSize:s,pxToRem:d,fontFamily:l,fontSize:g,fontWeightLight:b,fontWeightRegular:a,fontWeightMedium:r,fontWeightBold:h},p),o,{clone:!1})}const HA=.2,jA=.14,XA=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${HA})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${jA})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${XA})`].join(",")}const YA=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],KA=["duration","easing","delay"],qA={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},VE={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Xv(e){return`${Math.round(e)}ms`}function QA(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function ZA(e){const t=Ne({},qA,e.easing),n=Ne({},VE,e.duration);return Ne({getAutoHeightDuration:QA,create:(g=["all"],b={})=>{const{duration:a=n.standard,easing:r=t.easeInOut,delay:h=0}=b;return Nt(b,KA),(Array.isArray(g)?g:[g]).map(s=>`${s} ${typeof a=="string"?a:Xv(a)} ${r} ${typeof h=="string"?h:Xv(h)}`).join(",")}},e,{easing:t,duration:n})}const JA={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},eR=JA,tR=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function nR(e={},...t){const{mixins:n={},palette:l={},transitions:g={},typography:b={}}=e,a=Nt(e,tR);if(e.vars)throw new Error(Ma(18));const r=WA(l),h=ob(e);let s=ls(h,{mixins:NA(h.breakpoints,n),palette:r,shadows:YA.slice(),typography:$A(r,b),transitions:ZA(g),zIndex:Ne({},eR)});return s=ls(s,a),s=t.reduce((m,c)=>ls(m,c),s),s.unstable_sxConfig=Ne({},b1,a==null?void 0:a.unstable_sxConfig),s.unstable_sx=function(c){return y1({sx:c,theme:this})},s}const iR=nR(),S1=iR;function td(){const e=ab(S1);return e[Bp]||e}function pn({props:e,name:t}){return LA({props:e,name:t,defaultTheme:S1,themeId:Bp})}const Os=e=>oh(e)&&e!=="classes",rR=oh,Rt=MA({themeId:Bp,defaultTheme:S1,rootShouldForwardProp:Os}),sR=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Yv=sR;function oR(e){return ln("MuiSvgIcon",e)}un("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const aR=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],lR=e=>{const{color:t,fontSize:n,classes:l}=e,g={root:["root",t!=="inherit"&&`color${Ht(t)}`,`fontSize${Ht(n)}`]};return fn(g,oR,l)},uR=Rt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ht(n.color)}`],t[`fontSize${Ht(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,l,g,b,a,r,h,s,m,c,o,u,d;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(l=n.create)==null?void 0:l.call(n,"fill",{duration:(g=e.transitions)==null||(g=g.duration)==null?void 0:g.shorter}),fontSize:{inherit:"inherit",small:((b=e.typography)==null||(a=b.pxToRem)==null?void 0:a.call(b,20))||"1.25rem",medium:((r=e.typography)==null||(h=r.pxToRem)==null?void 0:h.call(r,24))||"1.5rem",large:((s=e.typography)==null||(m=s.pxToRem)==null?void 0:m.call(s,35))||"2.1875rem"}[t.fontSize],color:(c=(o=(e.vars||e).palette)==null||(o=o[t.color])==null?void 0:o.main)!=null?c:{action:(u=(e.vars||e).palette)==null||(u=u.action)==null?void 0:u.active,disabled:(d=(e.vars||e).palette)==null||(d=d.action)==null?void 0:d.disabled,inherit:void 0}[t.color]}}),Dg=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiSvgIcon"}),{children:g,className:b,color:a="inherit",component:r="svg",fontSize:h="medium",htmlColor:s,inheritViewBox:m=!1,titleAccess:c,viewBox:o="0 0 24 24"}=l,u=Nt(l,aR),d=ke.isValidElement(g)&&g.type==="svg",x=Ne({},l,{color:a,component:r,fontSize:h,instanceFontSize:t.fontSize,inheritViewBox:m,viewBox:o,hasSvgAsChild:d}),p={};m||(p.viewBox=o);const v=lR(x);return Be.jsxs(uR,Ne({as:r,className:Ut(v.root,b),focusable:"false",color:s,"aria-hidden":c?void 0:!0,role:c?"img":void 0,ref:n},p,u,d&&g.props,{ownerState:x,children:[d?g.props.children:g,c?Be.jsx("title",{children:c}):null]}))});Dg.muiName="SvgIcon";function GE(e,t){function n(l,g){return Be.jsx(Dg,Ne({"data-testid":`${t}Icon`,ref:g},l,{children:e}))}return n.muiName=Dg.muiName,ke.memo(ke.forwardRef(n))}const cR={configure:e=>{IE.configure(e)}},hR=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Ht,createChainedFunction:Fg,createSvgIcon:GE,debounce:J2,deprecatedPropType:ZC,isMuiElement:kf,ownerDocument:Pr,ownerWindow:Ca,requirePropFactory:JC,setRef:cp,unstable_ClassNameGenerator:cR,unstable_useEnhancedEffect:La,unstable_useId:eb,unsupportedProp:tL,useControlled:hp,useEventCallback:el,useForkRef:Bi,useIsFocusVisible:AE},Symbol.toStringTag,{value:"Module"}));function Vg(e,t){return Vg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},Vg(e,t)}function WE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Vg(e,t)}const Kv={disabled:!1},fp=Qn.createContext(null);var dR=function(t){return t.scrollTop},Kc="unmounted",Ka="exited",qa="entering",Ql="entered",Gg="exiting",Bo=function(e){WE(t,e);function t(l,g){var b;b=e.call(this,l,g)||this;var a=g,r=a&&!a.isMounting?l.enter:l.appear,h;return b.appearStatus=null,l.in?r?(h=Ka,b.appearStatus=qa):h=Ql:l.unmountOnExit||l.mountOnEnter?h=Kc:h=Ka,b.state={status:h},b.nextCallback=null,b}t.getDerivedStateFromProps=function(g,b){var a=g.in;return a&&b.status===Kc?{status:Ka}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(g){var b=null;if(g!==this.props){var a=this.state.status;this.props.in?a!==qa&&a!==Ql&&(b=qa):(a===qa||a===Ql)&&(b=Gg)}this.updateStatus(!1,b)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var g=this.props.timeout,b,a,r;return b=a=r=g,g!=null&&typeof g!="number"&&(b=g.exit,a=g.enter,r=g.appear!==void 0?g.appear:a),{exit:b,enter:a,appear:r}},n.updateStatus=function(g,b){if(g===void 0&&(g=!1),b!==null)if(this.cancelNextCallback(),b===qa){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:uf.findDOMNode(this);a&&dR(a)}this.performEnter(g)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ka&&this.setState({status:Kc})},n.performEnter=function(g){var b=this,a=this.props.enter,r=this.context?this.context.isMounting:g,h=this.props.nodeRef?[r]:[uf.findDOMNode(this),r],s=h[0],m=h[1],c=this.getTimeouts(),o=r?c.appear:c.enter;if(!g&&!a||Kv.disabled){this.safeSetState({status:Ql},function(){b.props.onEntered(s)});return}this.props.onEnter(s,m),this.safeSetState({status:qa},function(){b.props.onEntering(s,m),b.onTransitionEnd(o,function(){b.safeSetState({status:Ql},function(){b.props.onEntered(s,m)})})})},n.performExit=function(){var g=this,b=this.props.exit,a=this.getTimeouts(),r=this.props.nodeRef?void 0:uf.findDOMNode(this);if(!b||Kv.disabled){this.safeSetState({status:Ka},function(){g.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Gg},function(){g.props.onExiting(r),g.onTransitionEnd(a.exit,function(){g.safeSetState({status:Ka},function(){g.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(g,b){b=this.setNextCallback(b),this.setState(g,b)},n.setNextCallback=function(g){var b=this,a=!0;return this.nextCallback=function(r){a&&(a=!1,b.nextCallback=null,g(r))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(g,b){this.setNextCallback(b);var a=this.props.nodeRef?this.props.nodeRef.current:uf.findDOMNode(this),r=g==null&&!this.props.addEndListener;if(!a||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var h=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],s=h[0],m=h[1];this.props.addEndListener(s,m)}g!=null&&setTimeout(this.nextCallback,g)},n.render=function(){var g=this.state.status;if(g===Kc)return null;var b=this.props,a=b.children;b.in,b.mountOnEnter,b.unmountOnExit,b.appear,b.enter,b.exit,b.timeout,b.addEndListener,b.onEnter,b.onEntering,b.onEntered,b.onExit,b.onExiting,b.onExited,b.nodeRef;var r=Nt(b,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Qn.createElement(fp.Provider,{value:null},typeof a=="function"?a(g,r):Qn.cloneElement(Qn.Children.only(a),r))},t}(Qn.Component);Bo.contextType=fp;Bo.propTypes={};function Yl(){}Bo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yl,onEntering:Yl,onEntered:Yl,onExit:Yl,onExiting:Yl,onExited:Yl};Bo.UNMOUNTED=Kc;Bo.EXITED=Ka;Bo.ENTERING=qa;Bo.ENTERED=Ql;Bo.EXITING=Gg;const ub=Bo;function fR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cb(e,t){var n=function(b){return t&&ke.isValidElement(b)?t(b):b},l=Object.create(null);return e&&ke.Children.map(e,function(g){return g}).forEach(function(g){l[g.key]=n(g)}),l}function pR(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var l=Object.create(null),g=[];for(var b in e)b in t?g.length&&(l[b]=g,g=[]):g.push(b);var a,r={};for(var h in t){if(l[h])for(a=0;ae.scrollTop;function Hu(e,t){var n,l;const{timeout:g,easing:b,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof g=="number"?g:g[t.mode]||0,easing:(l=a.transitionTimingFunction)!=null?l:typeof b=="object"?b[t.mode]:b,delay:a.transitionDelay}}function SR(e){return ln("MuiCollapse",e)}un("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ER=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],xR=e=>{const{orientation:t,classes:n}=e,l={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return fn(l,SR,n)},wR=Rt("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(({theme:e,ownerState:t})=>Ne({height:0,overflow:"hidden",transition:e.transitions.create("height")},t.orientation==="horizontal"&&{height:"auto",width:0,transition:e.transitions.create("width")},t.state==="entered"&&Ne({height:"auto",overflow:"visible"},t.orientation==="horizontal"&&{width:"auto"}),t.state==="exited"&&!t.in&&t.collapsedSize==="0px"&&{visibility:"hidden"})),_R=Rt("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})(({ownerState:e})=>Ne({display:"flex",width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),TR=Rt("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})(({ownerState:e})=>Ne({width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),UE=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiCollapse"}),{addEndListener:g,children:b,className:a,collapsedSize:r="0px",component:h,easing:s,in:m,onEnter:c,onEntered:o,onEntering:u,onExit:d,onExited:x,onExiting:p,orientation:v="vertical",style:S,timeout:T=VE.standard,TransitionComponent:P=ub}=l,_=Nt(l,ER),E=Ne({},l,{orientation:v,collapsedSize:r}),M=xR(E),N=td(),I=tb(),R=ke.useRef(null),V=ke.useRef(),U=typeof r=="number"?`${r}px`:r,K=v==="horizontal",k=K?"width":"height",W=ke.useRef(null),G=Bi(n,W),X=ee=>ye=>{if(ee){const Ee=W.current;ye===void 0?ee(Ee):ee(Ee,ye)}},L=()=>R.current?R.current[K?"clientWidth":"clientHeight"]:0,H=X((ee,ye)=>{R.current&&K&&(R.current.style.position="absolute"),ee.style[k]=U,c&&c(ee,ye)}),ne=X((ee,ye)=>{const Ee=L();R.current&&K&&(R.current.style.position="");const{duration:j,easing:te}=Hu({style:S,timeout:T,easing:s},{mode:"enter"});if(T==="auto"){const re=N.transitions.getAutoHeightDuration(Ee);ee.style.transitionDuration=`${re}ms`,V.current=re}else ee.style.transitionDuration=typeof j=="string"?j:`${j}ms`;ee.style[k]=`${Ee}px`,ee.style.transitionTimingFunction=te,u&&u(ee,ye)}),ie=X((ee,ye)=>{ee.style[k]="auto",o&&o(ee,ye)}),be=X(ee=>{ee.style[k]=`${L()}px`,d&&d(ee)}),ae=X(x),ge=X(ee=>{const ye=L(),{duration:Ee,easing:j}=Hu({style:S,timeout:T,easing:s},{mode:"exit"});if(T==="auto"){const te=N.transitions.getAutoHeightDuration(ye);ee.style.transitionDuration=`${te}ms`,V.current=te}else ee.style.transitionDuration=typeof Ee=="string"?Ee:`${Ee}ms`;ee.style[k]=U,ee.style.transitionTimingFunction=j,p&&p(ee)}),ce=ee=>{T==="auto"&&I.start(V.current||0,ee),g&&g(W.current,ee)};return Be.jsx(P,Ne({in:m,onEnter:H,onEntered:ie,onEntering:ne,onExit:be,onExited:ae,onExiting:ge,addEndListener:ce,nodeRef:W,timeout:T==="auto"?null:T},_,{children:(ee,ye)=>Be.jsx(wR,Ne({as:h,className:Ut(M.root,a,{entered:M.entered,exited:!m&&U==="0px"&&M.hidden}[ee]),style:Ne({[K?"minWidth":"minHeight"]:U},S),ownerState:Ne({},E,{state:ee}),ref:G},ye,{children:Be.jsx(_R,{ownerState:Ne({},E,{state:ee}),className:M.wrapper,ref:R,children:Be.jsx(TR,{ownerState:Ne({},E,{state:ee}),className:M.wrapperInner,children:b})})}))}))});UE.muiSupportAuto=!0;const PR=UE;function MR(e){return ln("MuiPaper",e)}un("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const CR=["className","component","elevation","square","variant"],LR=e=>{const{square:t,elevation:n,variant:l,classes:g}=e,b={root:["root",l,!t&&"rounded",l==="elevation"&&`elevation${n}`]};return fn(b,MR,g)},AR=Rt("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return Ne({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&Ne({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${tr("#fff",Yv(t.elevation))}, ${tr("#fff",Yv(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),RR=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiPaper"}),{className:g,component:b="div",elevation:a=1,square:r=!1,variant:h="elevation"}=l,s=Nt(l,CR),m=Ne({},l,{component:b,elevation:a,square:r,variant:h}),c=LR(m);return Be.jsx(AR,Ne({as:b,ownerState:m,className:Ut(c.root,g),ref:n},s))}),pp=RR,$E=ke.createContext({});function mp(e){return typeof e=="string"}function HE(e,t,n){return e===void 0||mp(e)?t:Ne({},t,{ownerState:Ne({},t.ownerState,n)})}function jE(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(l=>l.match(/^on[A-Z]/)&&typeof e[l]=="function"&&!t.includes(l)).forEach(l=>{n[l]=e[l]}),n}function XE(e,t,n){return typeof e=="function"?e(t,n):e}function qv(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function YE(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:l,externalForwardedProps:g,className:b}=e;if(!t){const u=Ut(n==null?void 0:n.className,b,g==null?void 0:g.className,l==null?void 0:l.className),d=Ne({},n==null?void 0:n.style,g==null?void 0:g.style,l==null?void 0:l.style),x=Ne({},n,g,l);return u.length>0&&(x.className=u),Object.keys(d).length>0&&(x.style=d),{props:x,internalRef:void 0}}const a=jE(Ne({},g,l)),r=qv(l),h=qv(g),s=t(a),m=Ut(s==null?void 0:s.className,n==null?void 0:n.className,b,g==null?void 0:g.className,l==null?void 0:l.className),c=Ne({},s==null?void 0:s.style,n==null?void 0:n.style,g==null?void 0:g.style,l==null?void 0:l.style),o=Ne({},s,n,h,r);return m.length>0&&(o.className=m),Object.keys(c).length>0&&(o.style=c),{props:o,internalRef:s.ref}}const IR=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function ju(e){var t;const{elementType:n,externalSlotProps:l,ownerState:g,skipResolvingSlotProps:b=!1}=e,a=Nt(e,IR),r=b?{}:XE(l,g),{props:h,internalRef:s}=YE(Ne({},a,{externalSlotProps:r})),m=Bi(s,r==null?void 0:r.ref,(t=e.additionalProps)==null?void 0:t.ref);return HE(n,Ne({},h,{ref:m}),g)}const NR=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],kR=["component","slots","slotProps"],OR=["component"];function FR(e,t){const{className:n,elementType:l,ownerState:g,externalForwardedProps:b,getSlotOwnerState:a,internalForwardedProps:r}=t,h=Nt(t,NR),{component:s,slots:m={[e]:void 0},slotProps:c={[e]:void 0}}=b,o=Nt(b,kR),u=m[e]||l,d=XE(c[e],g),x=YE(Ne({className:n},h,{externalForwardedProps:e==="root"?o:void 0,externalSlotProps:d})),{props:{component:p},internalRef:v}=x,S=Nt(x.props,OR),T=Bi(v,d==null?void 0:d.ref,t.ref),P=a?a(S):{},_=Ne({},g,P),E=e==="root"?p||s:p,M=HE(u,Ne({},e==="root"&&!s&&!m[e]&&r,e!=="root"&&!m[e]&&r,S,E&&{as:E},{ref:T}),_);return Object.keys(P).forEach(N=>{delete M[N]}),[u,M]}function BR(e){return ln("MuiAccordion",e)}const DR=un("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),df=DR,VR=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],GR=e=>{const{classes:t,square:n,expanded:l,disabled:g,disableGutters:b}=e;return fn({root:["root",!n&&"rounded",l&&"expanded",g&&"disabled",!b&&"gutters"],region:["region"]},BR,t)},WR=Rt(pp,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${df.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${df.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${df.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}},({theme:e,ownerState:t})=>Ne({},!t.square&&{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},!t.disableGutters&&{[`&.${df.expanded}`]:{margin:"16px 0"}})),zR=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiAccordion"}),{children:g,className:b,defaultExpanded:a=!1,disabled:r=!1,disableGutters:h=!1,expanded:s,onChange:m,square:c=!1,slots:o={},slotProps:u={},TransitionComponent:d,TransitionProps:x}=l,p=Nt(l,VR),[v,S]=hp({controlled:s,default:a,name:"Accordion",state:"expanded"}),T=ke.useCallback(K=>{S(!v),m&&m(K,!v)},[v,m,S]),[P,..._]=ke.Children.toArray(g),E=ke.useMemo(()=>({expanded:v,disabled:r,disableGutters:h,toggle:T}),[v,r,h,T]),M=Ne({},l,{square:c,disabled:r,disableGutters:h,expanded:v}),N=GR(M),I=Ne({transition:d},o),R=Ne({transition:x},u),[V,U]=FR("transition",{elementType:PR,externalForwardedProps:{slots:I,slotProps:R},ownerState:M});return delete U.ownerState,Be.jsxs(WR,Ne({className:Ut(N.root,b),ref:n,ownerState:M,square:c},p,{children:[Be.jsx($E.Provider,{value:E,children:P}),Be.jsx(V,Ne({in:v,timeout:"auto"},U,{children:Be.jsx("div",{"aria-labelledby":P.props.id,id:P.props["aria-controls"],role:"region",className:N.region,children:_})}))]}))}),KE=zR;function UR(e){return ln("MuiAccordionDetails",e)}un("MuiAccordionDetails",["root"]);const $R=["className"],HR=e=>{const{classes:t}=e;return fn({root:["root"]},UR,t)},jR=Rt("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(1,2,2)})),XR=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiAccordionDetails"}),{className:g}=l,b=Nt(l,$R),a=l,r=HR(a);return Be.jsx(jR,Ne({className:Ut(r.root,g),ref:n,ownerState:a},b))}),qE=XR;function YR(e){const{className:t,classes:n,pulsate:l=!1,rippleX:g,rippleY:b,rippleSize:a,in:r,onExited:h,timeout:s}=e,[m,c]=ke.useState(!1),o=Ut(t,n.ripple,n.rippleVisible,l&&n.ripplePulsate),u={width:a,height:a,top:-(a/2)+b,left:-(a/2)+g},d=Ut(n.child,m&&n.childLeaving,l&&n.childPulsate);return!r&&!m&&c(!0),ke.useEffect(()=>{if(!r&&h!=null){const x=setTimeout(h,s);return()=>{clearTimeout(x)}}},[h,r,s]),Be.jsx("span",{className:o,style:u,children:Be.jsx("span",{className:d})})}const ns=un("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),KR=["center","classes","className"];let E1=e=>e,Qv,Zv,Jv,e4;const Wg=550,qR=80,QR=Zh(Qv||(Qv=E1` - 0% { - transform: scale(0); - opacity: 0.1; - } - - 100% { - transform: scale(1); - opacity: 0.3; - } -`)),ZR=Zh(Zv||(Zv=E1` - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -`)),JR=Zh(Jv||(Jv=E1` - 0% { - transform: scale(1); - } - - 50% { - transform: scale(0.92); - } - - 100% { - transform: scale(1); - } -`)),eI=Rt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),tI=Rt(YR,{name:"MuiTouchRipple",slot:"Ripple"})(e4||(e4=E1` - opacity: 0; - position: absolute; - - &.${0} { - opacity: 0.3; - transform: scale(1); - animation-name: ${0}; - animation-duration: ${0}ms; - animation-timing-function: ${0}; - } - - &.${0} { - animation-duration: ${0}ms; - } - - & .${0} { - opacity: 1; - display: block; - width: 100%; - height: 100%; - border-radius: 50%; - background-color: currentColor; - } - - & .${0} { - opacity: 0; - animation-name: ${0}; - animation-duration: ${0}ms; - animation-timing-function: ${0}; - } - - & .${0} { - position: absolute; - /* @noflip */ - left: 0px; - top: 0; - animation-name: ${0}; - animation-duration: 2500ms; - animation-timing-function: ${0}; - animation-iteration-count: infinite; - animation-delay: 200ms; - } -`),ns.rippleVisible,QR,Wg,({theme:e})=>e.transitions.easing.easeInOut,ns.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,ns.child,ns.childLeaving,ZR,Wg,({theme:e})=>e.transitions.easing.easeInOut,ns.childPulsate,JR,({theme:e})=>e.transitions.easing.easeInOut),nI=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTouchRipple"}),{center:g=!1,classes:b={},className:a}=l,r=Nt(l,KR),[h,s]=ke.useState([]),m=ke.useRef(0),c=ke.useRef(null);ke.useEffect(()=>{c.current&&(c.current(),c.current=null)},[h]);const o=ke.useRef(!1),u=tb(),d=ke.useRef(null),x=ke.useRef(null),p=ke.useCallback(P=>{const{pulsate:_,rippleX:E,rippleY:M,rippleSize:N,cb:I}=P;s(R=>[...R,Be.jsx(tI,{classes:{ripple:Ut(b.ripple,ns.ripple),rippleVisible:Ut(b.rippleVisible,ns.rippleVisible),ripplePulsate:Ut(b.ripplePulsate,ns.ripplePulsate),child:Ut(b.child,ns.child),childLeaving:Ut(b.childLeaving,ns.childLeaving),childPulsate:Ut(b.childPulsate,ns.childPulsate)},timeout:Wg,pulsate:_,rippleX:E,rippleY:M,rippleSize:N},m.current)]),m.current+=1,c.current=I},[b]),v=ke.useCallback((P={},_={},E=()=>{})=>{const{pulsate:M=!1,center:N=g||_.pulsate,fakeElement:I=!1}=_;if((P==null?void 0:P.type)==="mousedown"&&o.current){o.current=!1;return}(P==null?void 0:P.type)==="touchstart"&&(o.current=!0);const R=I?null:x.current,V=R?R.getBoundingClientRect():{width:0,height:0,left:0,top:0};let U,K,k;if(N||P===void 0||P.clientX===0&&P.clientY===0||!P.clientX&&!P.touches)U=Math.round(V.width/2),K=Math.round(V.height/2);else{const{clientX:W,clientY:G}=P.touches&&P.touches.length>0?P.touches[0]:P;U=Math.round(W-V.left),K=Math.round(G-V.top)}if(N)k=Math.sqrt((2*V.width**2+V.height**2)/3),k%2===0&&(k+=1);else{const W=Math.max(Math.abs((R?R.clientWidth:0)-U),U)*2+2,G=Math.max(Math.abs((R?R.clientHeight:0)-K),K)*2+2;k=Math.sqrt(W**2+G**2)}P!=null&&P.touches?d.current===null&&(d.current=()=>{p({pulsate:M,rippleX:U,rippleY:K,rippleSize:k,cb:E})},u.start(qR,()=>{d.current&&(d.current(),d.current=null)})):p({pulsate:M,rippleX:U,rippleY:K,rippleSize:k,cb:E})},[g,p,u]),S=ke.useCallback(()=>{v({},{pulsate:!0})},[v]),T=ke.useCallback((P,_)=>{if(u.clear(),(P==null?void 0:P.type)==="touchend"&&d.current){d.current(),d.current=null,u.start(0,()=>{T(P,_)});return}d.current=null,s(E=>E.length>0?E.slice(1):E),c.current=_},[u]);return ke.useImperativeHandle(n,()=>({pulsate:S,start:v,stop:T}),[S,v,T]),Be.jsx(eI,Ne({className:Ut(ns.root,b.root,a),ref:x},r,{children:Be.jsx(vR,{component:null,exit:!0,children:h})}))}),iI=nI;function rI(e){return ln("MuiButtonBase",e)}const sI=un("MuiButtonBase",["root","disabled","focusVisible"]),oI=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],aI=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:l,classes:g}=e,a=fn({root:["root",t&&"disabled",n&&"focusVisible"]},rI,g);return n&&l&&(a.root+=` ${l}`),a},lI=Rt("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${sI.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),uI=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiButtonBase"}),{action:g,centerRipple:b=!1,children:a,className:r,component:h="button",disabled:s=!1,disableRipple:m=!1,disableTouchRipple:c=!1,focusRipple:o=!1,LinkComponent:u="a",onBlur:d,onClick:x,onContextMenu:p,onDragLeave:v,onFocus:S,onFocusVisible:T,onKeyDown:P,onKeyUp:_,onMouseDown:E,onMouseLeave:M,onMouseUp:N,onTouchEnd:I,onTouchMove:R,onTouchStart:V,tabIndex:U=0,TouchRippleProps:K,touchRippleRef:k,type:W}=l,G=Nt(l,oI),X=ke.useRef(null),L=ke.useRef(null),H=Bi(L,k),{isFocusVisibleRef:ne,onFocus:ie,onBlur:be,ref:ae}=AE(),[ge,ce]=ke.useState(!1);s&&ge&&ce(!1),ke.useImperativeHandle(g,()=>({focusVisible:()=>{ce(!0),X.current.focus()}}),[]);const[ee,ye]=ke.useState(!1);ke.useEffect(()=>{ye(!0)},[]);const Ee=ee&&!m&&!s;ke.useEffect(()=>{ge&&o&&!m&&ee&&L.current.pulsate()},[m,o,ge,ee]);function j(Ze,st,ft=c){return el(xt=>(st&&st(xt),!ft&&L.current&&L.current[Ze](xt),!0))}const te=j("start",E),re=j("stop",p),O=j("stop",v),z=j("stop",N),Y=j("stop",Ze=>{ge&&Ze.preventDefault(),M&&M(Ze)}),q=j("start",V),de=j("stop",I),le=j("stop",R),he=j("stop",Ze=>{be(Ze),ne.current===!1&&ce(!1),d&&d(Ze)},!1),me=el(Ze=>{X.current||(X.current=Ze.currentTarget),ie(Ze),ne.current===!0&&(ce(!0),T&&T(Ze)),S&&S(Ze)}),_e=()=>{const Ze=X.current;return h&&h!=="button"&&!(Ze.tagName==="A"&&Ze.href)},Me=ke.useRef(!1),Ue=el(Ze=>{o&&!Me.current&&ge&&L.current&&Ze.key===" "&&(Me.current=!0,L.current.stop(Ze,()=>{L.current.start(Ze)})),Ze.target===Ze.currentTarget&&_e()&&Ze.key===" "&&Ze.preventDefault(),P&&P(Ze),Ze.target===Ze.currentTarget&&_e()&&Ze.key==="Enter"&&!s&&(Ze.preventDefault(),x&&x(Ze))}),Ge=el(Ze=>{o&&Ze.key===" "&&L.current&&ge&&!Ze.defaultPrevented&&(Me.current=!1,L.current.stop(Ze,()=>{L.current.pulsate(Ze)})),_&&_(Ze),x&&Ze.target===Ze.currentTarget&&_e()&&Ze.key===" "&&!Ze.defaultPrevented&&x(Ze)});let Qe=h;Qe==="button"&&(G.href||G.to)&&(Qe=u);const Re={};Qe==="button"?(Re.type=W===void 0?"button":W,Re.disabled=s):(!G.href&&!G.to&&(Re.role="button"),s&&(Re["aria-disabled"]=s));const We=Bi(n,ae,X),qe=Ne({},l,{centerRipple:b,component:h,disabled:s,disableRipple:m,disableTouchRipple:c,focusRipple:o,tabIndex:U,focusVisible:ge}),Ke=aI(qe);return Be.jsxs(lI,Ne({as:Qe,className:Ut(Ke.root,r),ownerState:qe,onBlur:he,onClick:x,onContextMenu:re,onFocus:me,onKeyDown:Ue,onKeyUp:Ge,onMouseDown:te,onMouseLeave:Y,onMouseUp:z,onDragLeave:O,onTouchEnd:de,onTouchMove:le,onTouchStart:q,ref:We,tabIndex:s?-1:U,type:W},Re,G,{children:[a,Ee?Be.jsx(iI,Ne({ref:H,center:b},K)):null]}))}),db=uI;function cI(e){return ln("MuiAccordionSummary",e)}const hI=un("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),cu=hI,dI=["children","className","expandIcon","focusVisibleClassName","onClick"],fI=e=>{const{classes:t,expanded:n,disabled:l,disableGutters:g}=e;return fn({root:["root",n&&"expanded",l&&"disabled",!g&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!g&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},cI,t)},pI=Rt(db,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{const n={duration:e.transitions.duration.shortest};return Ne({display:"flex",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],n),[`&.${cu.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${cu.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${cu.disabled})`]:{cursor:"pointer"}},!t.disableGutters&&{[`&.${cu.expanded}`]:{minHeight:64}})}),mI=Rt("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(({theme:e,ownerState:t})=>Ne({display:"flex",flexGrow:1,margin:"12px 0"},!t.disableGutters&&{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${cu.expanded}`]:{margin:"20px 0"}})),gI=Rt("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${cu.expanded}`]:{transform:"rotate(180deg)"}})),bI=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiAccordionSummary"}),{children:g,className:b,expandIcon:a,focusVisibleClassName:r,onClick:h}=l,s=Nt(l,dI),{disabled:m=!1,disableGutters:c,expanded:o,toggle:u}=ke.useContext($E),d=v=>{u&&u(v),h&&h(v)},x=Ne({},l,{expanded:o,disabled:m,disableGutters:c}),p=fI(x);return Be.jsxs(pI,Ne({focusRipple:!1,disableRipple:!0,disabled:m,component:"div","aria-expanded":o,className:Ut(p.root,b),focusVisibleClassName:Ut(p.focusVisible,r),onClick:d,ref:n,ownerState:x},s,{children:[Be.jsx(mI,{className:p.content,ownerState:x,children:g}),a&&Be.jsx(gI,{className:p.expandIconWrapper,ownerState:x,children:a})]}))}),QE=bI;function yI(e){return ln("MuiTypography",e)}un("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const vI=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],SI=e=>{const{align:t,gutterBottom:n,noWrap:l,paragraph:g,variant:b,classes:a}=e,r={root:["root",b,e.align!=="inherit"&&`align${Ht(t)}`,n&&"gutterBottom",l&&"noWrap",g&&"paragraph"]};return fn(r,yI,a)},EI=Rt("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Ht(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>Ne({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),t4={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},xI={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},wI=e=>xI[e]||e,_I=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTypography"}),g=wI(l.color),b=OE(Ne({},l,{color:g})),{align:a="inherit",className:r,component:h,gutterBottom:s=!1,noWrap:m=!1,paragraph:c=!1,variant:o="body1",variantMapping:u=t4}=b,d=Nt(b,vI),x=Ne({},b,{align:a,color:g,className:r,component:h,gutterBottom:s,noWrap:m,paragraph:c,variant:o,variantMapping:u}),p=h||(c?"p":u[o]||t4[o])||"span",v=SI(x);return Be.jsx(EI,Ne({as:p,ref:n,ownerState:x,className:Ut(v.root,r)},d))}),di=_I,TI=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function PI(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function MI(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=l=>e.ownerDocument.querySelector(`input[type="radio"]${l}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function CI(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||MI(e))}function LI(e){const t=[],n=[];return Array.from(e.querySelectorAll(TI)).forEach((l,g)=>{const b=PI(l);b===-1||!CI(l)||(b===0?t.push(l):n.push({documentOrder:g,tabIndex:b,node:l}))}),n.sort((l,g)=>l.tabIndex===g.tabIndex?l.documentOrder-g.documentOrder:l.tabIndex-g.tabIndex).map(l=>l.node).concat(t)}function AI(){return!0}function RI(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:l=!1,disableRestoreFocus:g=!1,getTabbable:b=LI,isEnabled:a=AI,open:r}=e,h=ke.useRef(!1),s=ke.useRef(null),m=ke.useRef(null),c=ke.useRef(null),o=ke.useRef(null),u=ke.useRef(!1),d=ke.useRef(null),x=Bi(t.ref,d),p=ke.useRef(null);ke.useEffect(()=>{!r||!d.current||(u.current=!n)},[n,r]),ke.useEffect(()=>{if(!r||!d.current)return;const T=Pr(d.current);return d.current.contains(T.activeElement)||(d.current.hasAttribute("tabIndex")||d.current.setAttribute("tabIndex","-1"),u.current&&d.current.focus()),()=>{g||(c.current&&c.current.focus&&(h.current=!0,c.current.focus()),c.current=null)}},[r]),ke.useEffect(()=>{if(!r||!d.current)return;const T=Pr(d.current),P=M=>{p.current=M,!(l||!a()||M.key!=="Tab")&&T.activeElement===d.current&&M.shiftKey&&(h.current=!0,m.current&&m.current.focus())},_=()=>{const M=d.current;if(M===null)return;if(!T.hasFocus()||!a()||h.current){h.current=!1;return}if(M.contains(T.activeElement)||l&&T.activeElement!==s.current&&T.activeElement!==m.current)return;if(T.activeElement!==o.current)o.current=null;else if(o.current!==null)return;if(!u.current)return;let N=[];if((T.activeElement===s.current||T.activeElement===m.current)&&(N=b(d.current)),N.length>0){var I,R;const V=!!((I=p.current)!=null&&I.shiftKey&&((R=p.current)==null?void 0:R.key)==="Tab"),U=N[0],K=N[N.length-1];typeof U!="string"&&typeof K!="string"&&(V?K.focus():U.focus())}else M.focus()};T.addEventListener("focusin",_),T.addEventListener("keydown",P,!0);const E=setInterval(()=>{T.activeElement&&T.activeElement.tagName==="BODY"&&_()},50);return()=>{clearInterval(E),T.removeEventListener("focusin",_),T.removeEventListener("keydown",P,!0)}},[n,l,g,a,r,b]);const v=T=>{c.current===null&&(c.current=T.relatedTarget),u.current=!0,o.current=T.target;const P=t.props.onFocus;P&&P(T)},S=T=>{c.current===null&&(c.current=T.relatedTarget),u.current=!0};return Be.jsxs(ke.Fragment,{children:[Be.jsx("div",{tabIndex:r?0:-1,onFocus:S,ref:s,"data-testid":"sentinelStart"}),ke.cloneElement(t,{ref:x,onFocus:v}),Be.jsx("div",{tabIndex:r?0:-1,onFocus:S,ref:m,"data-testid":"sentinelEnd"})]})}function II(e){return typeof e=="function"?e():e}const NI=ke.forwardRef(function(t,n){const{children:l,container:g,disablePortal:b=!1}=t,[a,r]=ke.useState(null),h=Bi(ke.isValidElement(l)?l.ref:null,n);if(La(()=>{b||r(II(g)||document.body)},[g,b]),La(()=>{if(a&&!b)return cp(n,a),()=>{cp(n,null)}},[n,a,b]),b){if(ke.isValidElement(l)){const s={ref:h};return ke.cloneElement(l,s)}return Be.jsx(ke.Fragment,{children:l})}return Be.jsx(ke.Fragment,{children:a&&Fp.createPortal(l,a)})});function kI(e){const t=Pr(e);return t.body===e?Ca(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function ah(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function n4(e){return parseInt(Ca(e).getComputedStyle(e).paddingRight,10)||0}function OI(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,l=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||l}function i4(e,t,n,l,g){const b=[t,n,...l];[].forEach.call(e.children,a=>{const r=b.indexOf(a)===-1,h=!OI(a);r&&h&&ah(a,g)})}function E0(e,t){let n=-1;return e.some((l,g)=>t(l)?(n=g,!0):!1),n}function FI(e,t){const n=[],l=e.container;if(!t.disableScrollLock){if(kI(l)){const a=RE(Pr(l));n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${n4(l)+a}px`;const r=Pr(l).querySelectorAll(".mui-fixed");[].forEach.call(r,h=>{n.push({value:h.style.paddingRight,property:"padding-right",el:h}),h.style.paddingRight=`${n4(h)+a}px`})}let b;if(l.parentNode instanceof DocumentFragment)b=Pr(l).body;else{const a=l.parentElement,r=Ca(l);b=(a==null?void 0:a.nodeName)==="HTML"&&r.getComputedStyle(a).overflowY==="scroll"?a:l}n.push({value:b.style.overflow,property:"overflow",el:b},{value:b.style.overflowX,property:"overflow-x",el:b},{value:b.style.overflowY,property:"overflow-y",el:b}),b.style.overflow="hidden"}return()=>{n.forEach(({value:b,el:a,property:r})=>{b?a.style.setProperty(r,b):a.style.removeProperty(r)})}}function BI(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class DI{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let l=this.modals.indexOf(t);if(l!==-1)return l;l=this.modals.length,this.modals.push(t),t.modalRef&&ah(t.modalRef,!1);const g=BI(n);i4(n,t.mount,t.modalRef,g,!0);const b=E0(this.containers,a=>a.container===n);return b!==-1?(this.containers[b].modals.push(t),l):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:g}),l)}mount(t,n){const l=E0(this.containers,b=>b.modals.indexOf(t)!==-1),g=this.containers[l];g.restore||(g.restore=FI(g,n))}remove(t,n=!0){const l=this.modals.indexOf(t);if(l===-1)return l;const g=E0(this.containers,a=>a.modals.indexOf(t)!==-1),b=this.containers[g];if(b.modals.splice(b.modals.indexOf(t),1),this.modals.splice(l,1),b.modals.length===0)b.restore&&b.restore(),t.modalRef&&ah(t.modalRef,n),i4(b.container,t.mount,t.modalRef,b.hiddenSiblings,!1),this.containers.splice(g,1);else{const a=b.modals[b.modals.length-1];a.modalRef&&ah(a.modalRef,!1)}return l}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function VI(e){return typeof e=="function"?e():e}function GI(e){return e?e.props.hasOwnProperty("in"):!1}const WI=new DI;function zI(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:l=!1,manager:g=WI,closeAfterTransition:b=!1,onTransitionEnter:a,onTransitionExited:r,children:h,onClose:s,open:m,rootRef:c}=e,o=ke.useRef({}),u=ke.useRef(null),d=ke.useRef(null),x=Bi(d,c),[p,v]=ke.useState(!m),S=GI(h);let T=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(T=!1);const P=()=>Pr(u.current),_=()=>(o.current.modalRef=d.current,o.current.mount=u.current,o.current),E=()=>{g.mount(_(),{disableScrollLock:l}),d.current&&(d.current.scrollTop=0)},M=el(()=>{const G=VI(t)||P().body;g.add(_(),G),d.current&&E()}),N=ke.useCallback(()=>g.isTopModal(_()),[g]),I=el(G=>{u.current=G,G&&(m&&N()?E():d.current&&ah(d.current,T))}),R=ke.useCallback(()=>{g.remove(_(),T)},[T,g]);ke.useEffect(()=>()=>{R()},[R]),ke.useEffect(()=>{m?M():(!S||!b)&&R()},[m,R,S,b,M]);const V=G=>X=>{var L;(L=G.onKeyDown)==null||L.call(G,X),!(X.key!=="Escape"||X.which===229||!N())&&(n||(X.stopPropagation(),s&&s(X,"escapeKeyDown")))},U=G=>X=>{var L;(L=G.onClick)==null||L.call(G,X),X.target===X.currentTarget&&s&&s(X,"backdropClick")};return{getRootProps:(G={})=>{const X=jE(e);delete X.onTransitionEnter,delete X.onTransitionExited;const L=Ne({},X,G);return Ne({role:"presentation"},L,{onKeyDown:V(L),ref:x})},getBackdropProps:(G={})=>{const X=G;return Ne({"aria-hidden":!0},X,{onClick:U(X),open:m})},getTransitionProps:()=>{const G=()=>{v(!1),a&&a()},X=()=>{v(!0),r&&r(),b&&R()};return{onEnter:Fg(G,h==null?void 0:h.props.onEnter),onExited:Fg(X,h==null?void 0:h.props.onExited)}},rootRef:x,portalRef:I,isTopModal:N,exited:p,hasTransition:S}}const UI=["onChange","maxRows","minRows","style","value"];function ff(e){return parseInt(e,10)||0}const $I={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function r4(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflow}const HI=ke.forwardRef(function(t,n){const{onChange:l,maxRows:g,minRows:b=1,style:a,value:r}=t,h=Nt(t,UI),{current:s}=ke.useRef(r!=null),m=ke.useRef(null),c=Bi(n,m),o=ke.useRef(null),u=ke.useRef(0),[d,x]=ke.useState({outerHeightStyle:0}),p=ke.useCallback(()=>{const P=m.current,E=Ca(P).getComputedStyle(P);if(E.width==="0px")return{outerHeightStyle:0};const M=o.current;M.style.width=E.width,M.value=P.value||t.placeholder||"x",M.value.slice(-1)===` -`&&(M.value+=" ");const N=E.boxSizing,I=ff(E.paddingBottom)+ff(E.paddingTop),R=ff(E.borderBottomWidth)+ff(E.borderTopWidth),V=M.scrollHeight;M.value="x";const U=M.scrollHeight;let K=V;b&&(K=Math.max(Number(b)*U,K)),g&&(K=Math.min(Number(g)*U,K)),K=Math.max(K,U);const k=K+(N==="border-box"?I+R:0),W=Math.abs(K-V)<=1;return{outerHeightStyle:k,overflow:W}},[g,b,t.placeholder]),v=(P,_)=>{const{outerHeightStyle:E,overflow:M}=_;return u.current<20&&(E>0&&Math.abs((P.outerHeightStyle||0)-E)>1||P.overflow!==M)?(u.current+=1,{overflow:M,outerHeightStyle:E}):P},S=ke.useCallback(()=>{const P=p();r4(P)||x(_=>v(_,P))},[p]);La(()=>{const P=()=>{const V=p();r4(V)||Fp.flushSync(()=>{x(U=>v(U,V))})},_=()=>{u.current=0,P()};let E;const M=J2(_),N=m.current,I=Ca(N);I.addEventListener("resize",M);let R;return typeof ResizeObserver<"u"&&(R=new ResizeObserver(_),R.observe(N)),()=>{M.clear(),cancelAnimationFrame(E),I.removeEventListener("resize",M),R&&R.disconnect()}},[p]),La(()=>{S()}),ke.useEffect(()=>{u.current=0},[r]);const T=P=>{u.current=0,s||S(),l&&l(P)};return Be.jsxs(ke.Fragment,{children:[Be.jsx("textarea",Ne({value:r,onChange:T,ref:c,rows:b,style:Ne({height:d.outerHeightStyle,overflow:d.overflow?"hidden":void 0},a)},h)),Be.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:o,tabIndex:-1,style:Ne({},$I.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function Zu({props:e,states:t,muiFormControl:n}){return t.reduce((l,g)=>(l[g]=e[g],n&&typeof e[g]>"u"&&(l[g]=n[g]),l),{})}const jI=ke.createContext(void 0),fb=jI;function Ju(){return ke.useContext(fb)}function XI(e){return Be.jsx(gA,Ne({},e,{defaultTheme:S1,themeId:Bp}))}function s4(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function gp(e,t=!1){return e&&(s4(e.value)&&e.value!==""||t&&s4(e.defaultValue)&&e.defaultValue!=="")}function YI(e){return e.startAdornment}function KI(e){return ln("MuiInputBase",e)}const qI=un("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Xu=qI,QI=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],x1=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ht(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},w1=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},ZI=e=>{const{classes:t,color:n,disabled:l,error:g,endAdornment:b,focused:a,formControl:r,fullWidth:h,hiddenLabel:s,multiline:m,readOnly:c,size:o,startAdornment:u,type:d}=e,x={root:["root",`color${Ht(n)}`,l&&"disabled",g&&"error",h&&"fullWidth",a&&"focused",r&&"formControl",o&&o!=="medium"&&`size${Ht(o)}`,m&&"multiline",u&&"adornedStart",b&&"adornedEnd",s&&"hiddenLabel",c&&"readOnly"],input:["input",l&&"disabled",d==="search"&&"inputTypeSearch",m&&"inputMultiline",o==="small"&&"inputSizeSmall",s&&"inputHiddenLabel",u&&"inputAdornedStart",b&&"inputAdornedEnd",c&&"readOnly"]};return fn(x,KI,t)},_1=Rt("div",{name:"MuiInputBase",slot:"Root",overridesResolver:x1})(({theme:e,ownerState:t})=>Ne({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xu.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&Ne({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),T1=Rt("input",{name:"MuiInputBase",slot:"Input",overridesResolver:w1})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",l=Ne({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),g={opacity:"0 !important"},b=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return Ne({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":l,"&::-moz-placeholder":l,"&:-ms-input-placeholder":l,"&::-ms-input-placeholder":l,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xu.formControl} &`]:{"&::-webkit-input-placeholder":g,"&::-moz-placeholder":g,"&:-ms-input-placeholder":g,"&::-ms-input-placeholder":g,"&:focus::-webkit-input-placeholder":b,"&:focus::-moz-placeholder":b,"&:focus:-ms-input-placeholder":b,"&:focus::-ms-input-placeholder":b},[`&.${Xu.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),JI=Be.jsx(XI,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),eN=ke.forwardRef(function(t,n){var l;const g=pn({props:t,name:"MuiInputBase"}),{"aria-describedby":b,autoComplete:a,autoFocus:r,className:h,components:s={},componentsProps:m={},defaultValue:c,disabled:o,disableInjectingGlobalStyles:u,endAdornment:d,fullWidth:x=!1,id:p,inputComponent:v="input",inputProps:S={},inputRef:T,maxRows:P,minRows:_,multiline:E=!1,name:M,onBlur:N,onChange:I,onClick:R,onFocus:V,onKeyDown:U,onKeyUp:K,placeholder:k,readOnly:W,renderSuffix:G,rows:X,slotProps:L={},slots:H={},startAdornment:ne,type:ie="text",value:be}=g,ae=Nt(g,QI),ge=S.value!=null?S.value:be,{current:ce}=ke.useRef(ge!=null),ee=ke.useRef(),ye=ke.useCallback(Ke=>{},[]),Ee=Bi(ee,T,S.ref,ye),[j,te]=ke.useState(!1),re=Ju(),O=Zu({props:g,muiFormControl:re,states:["color","disabled","error","hiddenLabel","size","required","filled"]});O.focused=re?re.focused:j,ke.useEffect(()=>{!re&&o&&j&&(te(!1),N&&N())},[re,o,j,N]);const z=re&&re.onFilled,Y=re&&re.onEmpty,q=ke.useCallback(Ke=>{gp(Ke)?z&&z():Y&&Y()},[z,Y]);La(()=>{ce&&q({value:ge})},[ge,q,ce]);const de=Ke=>{if(O.disabled){Ke.stopPropagation();return}V&&V(Ke),S.onFocus&&S.onFocus(Ke),re&&re.onFocus?re.onFocus(Ke):te(!0)},le=Ke=>{N&&N(Ke),S.onBlur&&S.onBlur(Ke),re&&re.onBlur?re.onBlur(Ke):te(!1)},he=(Ke,...Ze)=>{if(!ce){const st=Ke.target||ee.current;if(st==null)throw new Error(Ma(1));q({value:st.value})}S.onChange&&S.onChange(Ke,...Ze),I&&I(Ke,...Ze)};ke.useEffect(()=>{q(ee.current)},[]);const me=Ke=>{ee.current&&Ke.currentTarget===Ke.target&&ee.current.focus(),R&&R(Ke)};let _e=v,Me=S;E&&_e==="input"&&(X?Me=Ne({type:void 0,minRows:X,maxRows:X},Me):Me=Ne({type:void 0,maxRows:P,minRows:_},Me),_e=HI);const Ue=Ke=>{q(Ke.animationName==="mui-auto-fill-cancel"?ee.current:{value:"x"})};ke.useEffect(()=>{re&&re.setAdornedStart(!!ne)},[re,ne]);const Ge=Ne({},g,{color:O.color||"primary",disabled:O.disabled,endAdornment:d,error:O.error,focused:O.focused,formControl:re,fullWidth:x,hiddenLabel:O.hiddenLabel,multiline:E,size:O.size,startAdornment:ne,type:ie}),Qe=ZI(Ge),Re=H.root||s.Root||_1,We=L.root||m.root||{},qe=H.input||s.Input||T1;return Me=Ne({},Me,(l=L.input)!=null?l:m.input),Be.jsxs(ke.Fragment,{children:[!u&&JI,Be.jsxs(Re,Ne({},We,!mp(Re)&&{ownerState:Ne({},Ge,We.ownerState)},{ref:n,onClick:me},ae,{className:Ut(Qe.root,We.className,h,W&&"MuiInputBase-readOnly"),children:[ne,Be.jsx(fb.Provider,{value:null,children:Be.jsx(qe,Ne({ownerState:Ge,"aria-invalid":O.error,"aria-describedby":b,autoComplete:a,autoFocus:r,defaultValue:c,disabled:O.disabled,id:p,onAnimationStart:Ue,name:M,placeholder:k,readOnly:W,required:O.required,rows:X,value:ge,onKeyDown:U,onKeyUp:K,type:ie},Me,!mp(qe)&&{as:_e,ownerState:Ne({},Ge,Me.ownerState)},{ref:Ee,className:Ut(Qe.input,Me.className,W&&"MuiInputBase-readOnly"),onBlur:le,onChange:he,onFocus:de}))}),d,G?G(Ne({},O,{startAdornment:ne})):null]}))]})}),pb=eN;function tN(e){return ln("MuiInput",e)}const nN=Ne({},Xu,un("MuiInput",["root","underline","input"])),Dc=nN;function iN(e){return ln("MuiOutlinedInput",e)}const rN=Ne({},Xu,un("MuiOutlinedInput",["root","notchedOutline","input"])),Jo=rN;function sN(e){return ln("MuiFilledInput",e)}const oN=Ne({},Xu,un("MuiFilledInput",["root","underline","input"])),ja=oN,aN=GE(Be.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),lN=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],uN={entering:{opacity:1},entered:{opacity:1}},cN=ke.forwardRef(function(t,n){const l=td(),g={enter:l.transitions.duration.enteringScreen,exit:l.transitions.duration.leavingScreen},{addEndListener:b,appear:a=!0,children:r,easing:h,in:s,onEnter:m,onEntered:c,onEntering:o,onExit:u,onExited:d,onExiting:x,style:p,timeout:v=g,TransitionComponent:S=ub}=t,T=Nt(t,lN),P=ke.useRef(null),_=Bi(P,r.ref,n),E=k=>W=>{if(k){const G=P.current;W===void 0?k(G):k(G,W)}},M=E(o),N=E((k,W)=>{zE(k);const G=Hu({style:p,timeout:v,easing:h},{mode:"enter"});k.style.webkitTransition=l.transitions.create("opacity",G),k.style.transition=l.transitions.create("opacity",G),m&&m(k,W)}),I=E(c),R=E(x),V=E(k=>{const W=Hu({style:p,timeout:v,easing:h},{mode:"exit"});k.style.webkitTransition=l.transitions.create("opacity",W),k.style.transition=l.transitions.create("opacity",W),u&&u(k)}),U=E(d),K=k=>{b&&b(P.current,k)};return Be.jsx(S,Ne({appear:a,in:s,nodeRef:P,onEnter:N,onEntered:I,onEntering:M,onExit:V,onExited:U,onExiting:R,addEndListener:K,timeout:v},T,{children:(k,W)=>ke.cloneElement(r,Ne({style:Ne({opacity:0,visibility:k==="exited"&&!s?"hidden":void 0},uN[k],p,r.props.style),ref:_},W))}))}),hN=cN;function dN(e){return ln("MuiBackdrop",e)}un("MuiBackdrop",["root","invisible"]);const fN=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],pN=e=>{const{classes:t,invisible:n}=e;return fn({root:["root",n&&"invisible"]},dN,t)},mN=Rt("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>Ne({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),gN=ke.forwardRef(function(t,n){var l,g,b;const a=pn({props:t,name:"MuiBackdrop"}),{children:r,className:h,component:s="div",components:m={},componentsProps:c={},invisible:o=!1,open:u,slotProps:d={},slots:x={},TransitionComponent:p=hN,transitionDuration:v}=a,S=Nt(a,fN),T=Ne({},a,{component:s,invisible:o}),P=pN(T),_=(l=d.root)!=null?l:c.root;return Be.jsx(p,Ne({in:u,timeout:v},S,{children:Be.jsx(mN,Ne({"aria-hidden":!0},_,{as:(g=(b=x.root)!=null?b:m.Root)!=null?g:s,className:Ut(P.root,h,_==null?void 0:_.className),ownerState:Ne({},T,_==null?void 0:_.ownerState),classes:P,ref:n,children:r}))}))}),bN=gN;function yN(e){return ln("MuiButton",e)}const vN=un("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),pf=vN,SN=ke.createContext({}),EN=SN,xN=ke.createContext(void 0),wN=xN,_N=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],TN=e=>{const{color:t,disableElevation:n,fullWidth:l,size:g,variant:b,classes:a}=e,r={root:["root",b,`${b}${Ht(t)}`,`size${Ht(g)}`,`${b}Size${Ht(g)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",l&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${Ht(g)}`],endIcon:["endIcon",`iconSize${Ht(g)}`]},h=fn(r,yN,a);return Ne({},a,h)},ZE=e=>Ne({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),PN=Rt(db,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ht(n.color)}`],t[`size${Ht(n.size)}`],t[`${n.variant}Size${Ht(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,l;const g=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],b=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return Ne({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Ne({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:tr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:tr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:tr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:b,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Ne({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${pf.focusVisible}`]:Ne({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${pf.disabled}`]:Ne({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${tr(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(l=e.palette).getContrastText)==null?void 0:n.call(l,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:g,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${pf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${pf.disabled}`]:{boxShadow:"none"}}),MN=Rt("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${Ht(n.size)}`]]}})(({ownerState:e})=>Ne({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},ZE(e))),CN=Rt("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${Ht(n.size)}`]]}})(({ownerState:e})=>Ne({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},ZE(e))),LN=ke.forwardRef(function(t,n){const l=ke.useContext(EN),g=ke.useContext(wN),b=u1(l,t),a=pn({props:b,name:"MuiButton"}),{children:r,color:h="primary",component:s="button",className:m,disabled:c=!1,disableElevation:o=!1,disableFocusRipple:u=!1,endIcon:d,focusVisibleClassName:x,fullWidth:p=!1,size:v="medium",startIcon:S,type:T,variant:P="text"}=a,_=Nt(a,_N),E=Ne({},a,{color:h,component:s,disabled:c,disableElevation:o,disableFocusRipple:u,fullWidth:p,size:v,type:T,variant:P}),M=TN(E),N=S&&Be.jsx(MN,{className:M.startIcon,ownerState:E,children:S}),I=d&&Be.jsx(CN,{className:M.endIcon,ownerState:E,children:d}),R=g||"";return Be.jsxs(PN,Ne({ownerState:E,className:Ut(l.className,M.root,m,R),component:s,disabled:c,focusRipple:!u,focusVisibleClassName:Ut(M.focusVisible,x),ref:n,type:T},_,{classes:M,children:[N,r,I]}))}),JE=LN;function AN(e){return ln("MuiCircularProgress",e)}un("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const RN=["className","color","disableShrink","size","style","thickness","value","variant"];let P1=e=>e,o4,a4,l4,u4;const ea=44,IN=Zh(o4||(o4=P1` - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -`)),NN=Zh(a4||(a4=P1` - 0% { - stroke-dasharray: 1px, 200px; - stroke-dashoffset: 0; - } - - 50% { - stroke-dasharray: 100px, 200px; - stroke-dashoffset: -15px; - } - - 100% { - stroke-dasharray: 100px, 200px; - stroke-dashoffset: -125px; - } -`)),kN=e=>{const{classes:t,variant:n,color:l,disableShrink:g}=e,b={root:["root",n,`color${Ht(l)}`],svg:["svg"],circle:["circle",`circle${Ht(n)}`,g&&"circleDisableShrink"]};return fn(b,AN,t)},ON=Rt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Ht(n.color)}`]]}})(({ownerState:e,theme:t})=>Ne({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&q2(l4||(l4=P1` - animation: ${0} 1.4s linear infinite; - `),IN)),FN=Rt("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),BN=Rt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Ht(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>Ne({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&q2(u4||(u4=P1` - animation: ${0} 1.4s ease-in-out infinite; - `),NN)),DN=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiCircularProgress"}),{className:g,color:b="primary",disableShrink:a=!1,size:r=40,style:h,thickness:s=3.6,value:m=0,variant:c="indeterminate"}=l,o=Nt(l,RN),u=Ne({},l,{color:b,disableShrink:a,size:r,thickness:s,value:m,variant:c}),d=kN(u),x={},p={},v={};if(c==="determinate"){const S=2*Math.PI*((ea-s)/2);x.strokeDasharray=S.toFixed(3),v["aria-valuenow"]=Math.round(m),x.strokeDashoffset=`${((100-m)/100*S).toFixed(3)}px`,p.transform="rotate(-90deg)"}return Be.jsx(ON,Ne({className:Ut(d.root,g),style:Ne({width:r,height:r},p,h),ownerState:u,ref:n,role:"progressbar"},v,o,{children:Be.jsx(FN,{className:d.svg,ownerState:u,viewBox:`${ea/2} ${ea/2} ${ea} ${ea}`,children:Be.jsx(BN,{className:d.circle,style:x,ownerState:u,cx:ea,cy:ea,r:(ea-s)/2,fill:"none",strokeWidth:s})})}))}),mf=DN;function VN(e){return ln("MuiModal",e)}un("MuiModal",["root","hidden","backdrop"]);const GN=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],WN=e=>{const{open:t,exited:n,classes:l}=e;return fn({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},VN,l)},zN=Rt("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>Ne({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),UN=Rt(bN,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),$N=ke.forwardRef(function(t,n){var l,g,b,a,r,h;const s=pn({name:"MuiModal",props:t}),{BackdropComponent:m=UN,BackdropProps:c,className:o,closeAfterTransition:u=!1,children:d,container:x,component:p,components:v={},componentsProps:S={},disableAutoFocus:T=!1,disableEnforceFocus:P=!1,disableEscapeKeyDown:_=!1,disablePortal:E=!1,disableRestoreFocus:M=!1,disableScrollLock:N=!1,hideBackdrop:I=!1,keepMounted:R=!1,onBackdropClick:V,open:U,slotProps:K,slots:k}=s,W=Nt(s,GN),G=Ne({},s,{closeAfterTransition:u,disableAutoFocus:T,disableEnforceFocus:P,disableEscapeKeyDown:_,disablePortal:E,disableRestoreFocus:M,disableScrollLock:N,hideBackdrop:I,keepMounted:R}),{getRootProps:X,getBackdropProps:L,getTransitionProps:H,portalRef:ne,isTopModal:ie,exited:be,hasTransition:ae}=zI(Ne({},G,{rootRef:n})),ge=Ne({},G,{exited:be}),ce=WN(ge),ee={};if(d.props.tabIndex===void 0&&(ee.tabIndex="-1"),ae){const{onEnter:z,onExited:Y}=H();ee.onEnter=z,ee.onExited=Y}const ye=(l=(g=k==null?void 0:k.root)!=null?g:v.Root)!=null?l:zN,Ee=(b=(a=k==null?void 0:k.backdrop)!=null?a:v.Backdrop)!=null?b:m,j=(r=K==null?void 0:K.root)!=null?r:S.root,te=(h=K==null?void 0:K.backdrop)!=null?h:S.backdrop,re=ju({elementType:ye,externalSlotProps:j,externalForwardedProps:W,getSlotProps:X,additionalProps:{ref:n,as:p},ownerState:ge,className:Ut(o,j==null?void 0:j.className,ce==null?void 0:ce.root,!ge.open&&ge.exited&&(ce==null?void 0:ce.hidden))}),O=ju({elementType:Ee,externalSlotProps:te,additionalProps:c,getSlotProps:z=>L(Ne({},z,{onClick:Y=>{V&&V(Y),z!=null&&z.onClick&&z.onClick(Y)}})),className:Ut(te==null?void 0:te.className,c==null?void 0:c.className,ce==null?void 0:ce.backdrop),ownerState:ge});return!R&&!U&&(!ae||be)?null:Be.jsx(NI,{ref:ne,container:x,disablePortal:E,children:Be.jsxs(ye,Ne({},re,{children:[!I&&m?Be.jsx(Ee,Ne({},O)):null,Be.jsx(RI,{disableEnforceFocus:P,disableAutoFocus:T,disableRestoreFocus:M,isEnabled:ie,open:U,children:ke.cloneElement(d,ee)})]}))})}),HN=$N;function jN(e){return ln("MuiDivider",e)}un("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const XN=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],YN=e=>{const{absolute:t,children:n,classes:l,flexItem:g,light:b,orientation:a,textAlign:r,variant:h}=e;return fn({root:["root",t&&"absolute",h,b&&"light",a==="vertical"&&"vertical",g&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",r==="right"&&a!=="vertical"&&"textAlignRight",r==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},jN,l)},KN=Rt("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>Ne({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:tr(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>Ne({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>Ne({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`}}),({theme:e,ownerState:t})=>Ne({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`}}),({ownerState:e})=>Ne({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),qN=Rt("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>Ne({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),ex=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiDivider"}),{absolute:g=!1,children:b,className:a,component:r=b?"div":"hr",flexItem:h=!1,light:s=!1,orientation:m="horizontal",role:c=r!=="hr"?"separator":void 0,textAlign:o="center",variant:u="fullWidth"}=l,d=Nt(l,XN),x=Ne({},l,{absolute:g,component:r,flexItem:h,light:s,orientation:m,role:c,textAlign:o,variant:u}),p=YN(x);return Be.jsx(KN,Ne({as:r,className:Ut(p.root,a),role:c,ref:n,ownerState:x},d,{children:b?Be.jsx(qN,{className:p.wrapper,ownerState:x,children:b}):null}))});ex.muiSkipListHighlight=!0;const zg=ex,QN=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],ZN=e=>{const{classes:t,disableUnderline:n}=e,g=fn({root:["root",!n&&"underline"],input:["input"]},sN,t);return Ne({},t,g)},JN=Rt(_1,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...x1(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var n;const l=e.palette.mode==="light",g=l?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",b=l?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=l?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",r=l?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return Ne({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b}},[`&.${ja.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b},[`&.${ja.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:r}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(e.vars||e).palette[t.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ja.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ja.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:g}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ja.disabled}, .${ja.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ja.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&Ne({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),ek=Rt(T1,{name:"MuiFilledInput",slot:"Input",overridesResolver:w1})(({theme:e,ownerState:t})=>Ne({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),tx=ke.forwardRef(function(t,n){var l,g,b,a;const r=pn({props:t,name:"MuiFilledInput"}),{components:h={},componentsProps:s,fullWidth:m=!1,inputComponent:c="input",multiline:o=!1,slotProps:u,slots:d={},type:x="text"}=r,p=Nt(r,QN),v=Ne({},r,{fullWidth:m,inputComponent:c,multiline:o,type:x}),S=ZN(r),T={root:{ownerState:v},input:{ownerState:v}},P=u??s?ls(T,u??s):T,_=(l=(g=d.root)!=null?g:h.Root)!=null?l:JN,E=(b=(a=d.input)!=null?a:h.Input)!=null?b:ek;return Be.jsx(pb,Ne({slots:{root:_,input:E},componentsProps:P,fullWidth:m,inputComponent:c,multiline:o,ref:n,type:x},p,{classes:S}))});tx.muiName="Input";const nx=tx;function tk(e){return ln("MuiFormControl",e)}un("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const nk=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],ik=e=>{const{classes:t,margin:n,fullWidth:l}=e,g={root:["root",n!=="none"&&`margin${Ht(n)}`,l&&"fullWidth"]};return fn(g,tk,t)},rk=Rt("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>Ne({},t.root,t[`margin${Ht(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>Ne({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),sk=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiFormControl"}),{children:g,className:b,color:a="primary",component:r="div",disabled:h=!1,error:s=!1,focused:m,fullWidth:c=!1,hiddenLabel:o=!1,margin:u="none",required:d=!1,size:x="medium",variant:p="outlined"}=l,v=Nt(l,nk),S=Ne({},l,{color:a,component:r,disabled:h,error:s,fullWidth:c,hiddenLabel:o,margin:u,required:d,size:x,variant:p}),T=ik(S),[P,_]=ke.useState(()=>{let K=!1;return g&&ke.Children.forEach(g,k=>{if(!kf(k,["Input","Select"]))return;const W=kf(k,["Select"])?k.props.input:k;W&&YI(W.props)&&(K=!0)}),K}),[E,M]=ke.useState(()=>{let K=!1;return g&&ke.Children.forEach(g,k=>{kf(k,["Input","Select"])&&(gp(k.props,!0)||gp(k.props.inputProps,!0))&&(K=!0)}),K}),[N,I]=ke.useState(!1);h&&N&&I(!1);const R=m!==void 0&&!h?m:N;let V;const U=ke.useMemo(()=>({adornedStart:P,setAdornedStart:_,color:a,disabled:h,error:s,filled:E,focused:R,fullWidth:c,hiddenLabel:o,size:x,onBlur:()=>{I(!1)},onEmpty:()=>{M(!1)},onFilled:()=>{M(!0)},onFocus:()=>{I(!0)},registerEffect:V,required:d,variant:p}),[P,a,h,s,E,R,c,o,V,d,x,p]);return Be.jsx(fb.Provider,{value:U,children:Be.jsx(rk,Ne({as:r,ownerState:S,className:Ut(T.root,b),ref:n},v,{children:g}))})}),ok=sk;function ak(e){return ln("MuiFormHelperText",e)}const lk=un("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),c4=lk;var h4;const uk=["children","className","component","disabled","error","filled","focused","margin","required","variant"],ck=e=>{const{classes:t,contained:n,size:l,disabled:g,error:b,filled:a,focused:r,required:h}=e,s={root:["root",g&&"disabled",b&&"error",l&&`size${Ht(l)}`,n&&"contained",r&&"focused",a&&"filled",h&&"required"]};return fn(s,ak,t)},hk=Rt("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ht(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(({theme:e,ownerState:t})=>Ne({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${c4.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${c4.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),dk=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiFormHelperText"}),{children:g,className:b,component:a="p"}=l,r=Nt(l,uk),h=Ju(),s=Zu({props:l,muiFormControl:h,states:["variant","size","disabled","error","filled","focused","required"]}),m=Ne({},l,{component:a,contained:s.variant==="filled"||s.variant==="outlined",variant:s.variant,size:s.size,disabled:s.disabled,error:s.error,filled:s.filled,focused:s.focused,required:s.required}),c=ck(m);return Be.jsx(hk,Ne({as:a,ownerState:m,className:Ut(c.root,b),ref:n},r,{children:g===" "?h4||(h4=Be.jsx("span",{className:"notranslate",children:"​"})):g}))}),fk=dk;function pk(e){return ln("MuiFormLabel",e)}const mk=un("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),lh=mk,gk=["children","className","color","component","disabled","error","filled","focused","required"],bk=e=>{const{classes:t,color:n,focused:l,disabled:g,error:b,filled:a,required:r}=e,h={root:["root",`color${Ht(n)}`,g&&"disabled",b&&"error",a&&"filled",l&&"focused",r&&"required"],asterisk:["asterisk",b&&"error"]};return fn(h,pk,t)},yk=Rt("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>Ne({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>Ne({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${lh.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${lh.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${lh.error}`]:{color:(e.vars||e).palette.error.main}})),vk=Rt("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${lh.error}`]:{color:(e.vars||e).palette.error.main}})),Sk=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiFormLabel"}),{children:g,className:b,component:a="label"}=l,r=Nt(l,gk),h=Ju(),s=Zu({props:l,muiFormControl:h,states:["color","required","focused","disabled","error","filled"]}),m=Ne({},l,{color:s.color||"primary",component:a,disabled:s.disabled,error:s.error,filled:s.filled,focused:s.focused,required:s.required}),c=bk(m);return Be.jsxs(yk,Ne({as:a,ownerState:m,className:Ut(c.root,b),ref:n},r,{children:[g,s.required&&Be.jsxs(vk,{ownerState:m,"aria-hidden":!0,className:c.asterisk,children:[" ","*"]})]}))}),Ek=Sk,xk=ke.createContext(),d4=xk;function wk(e){return ln("MuiGrid",e)}const _k=[0,1,2,3,4,5,6,7,8,9,10],Tk=["column-reverse","column","row-reverse","row"],Pk=["nowrap","wrap-reverse","wrap"],Vc=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Ih=un("MuiGrid",["root","container","item","zeroMinWidth",..._k.map(e=>`spacing-xs-${e}`),...Tk.map(e=>`direction-xs-${e}`),...Pk.map(e=>`wrap-xs-${e}`),...Vc.map(e=>`grid-xs-${e}`),...Vc.map(e=>`grid-sm-${e}`),...Vc.map(e=>`grid-md-${e}`),...Vc.map(e=>`grid-lg-${e}`),...Vc.map(e=>`grid-xl-${e}`)]),Mk=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Su(e){const t=parseFloat(e);return`${t}${String(e).replace(String(t),"")||"px"}`}function Ck({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((l,g)=>{let b={};if(t[g]&&(n=t[g]),!n)return l;if(n===!0)b={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")b={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const a=c1({values:t.columns,breakpoints:e.breakpoints.values}),r=typeof a=="object"?a[g]:a;if(r==null)return l;const h=`${Math.round(n/r*1e8)/1e6}%`;let s={};if(t.container&&t.item&&t.columnSpacing!==0){const m=e.spacing(t.columnSpacing);if(m!=="0px"){const c=`calc(${h} + ${Su(m)})`;s={flexBasis:c,maxWidth:c}}}b=Ne({flexBasis:h,flexGrow:0,maxWidth:h},s)}return e.breakpoints.values[g]===0?Object.assign(l,b):l[e.breakpoints.up(g)]=b,l},{})}function Lk({theme:e,ownerState:t}){const n=c1({values:t.direction,breakpoints:e.breakpoints.values});return hs({theme:e},n,l=>{const g={flexDirection:l};return l.indexOf("column")===0&&(g[`& > .${Ih.item}`]={maxWidth:"none"}),g})}function ix({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(g=>{n===""&&t[g]!==0&&(n=g)});const l=Object.keys(e).sort((g,b)=>e[g]-e[b]);return l.slice(0,l.indexOf(n))}function Ak({theme:e,ownerState:t}){const{container:n,rowSpacing:l}=t;let g={};if(n&&l!==0){const b=c1({values:l,breakpoints:e.breakpoints.values});let a;typeof b=="object"&&(a=ix({breakpoints:e.breakpoints.values,values:b})),g=hs({theme:e},b,(r,h)=>{var s;const m=e.spacing(r);return m!=="0px"?{marginTop:`-${Su(m)}`,[`& > .${Ih.item}`]:{paddingTop:Su(m)}}:(s=a)!=null&&s.includes(h)?{}:{marginTop:0,[`& > .${Ih.item}`]:{paddingTop:0}}})}return g}function Rk({theme:e,ownerState:t}){const{container:n,columnSpacing:l}=t;let g={};if(n&&l!==0){const b=c1({values:l,breakpoints:e.breakpoints.values});let a;typeof b=="object"&&(a=ix({breakpoints:e.breakpoints.values,values:b})),g=hs({theme:e},b,(r,h)=>{var s;const m=e.spacing(r);return m!=="0px"?{width:`calc(100% + ${Su(m)})`,marginLeft:`-${Su(m)}`,[`& > .${Ih.item}`]:{paddingLeft:Su(m)}}:(s=a)!=null&&s.includes(h)?{}:{width:"100%",marginLeft:0,[`& > .${Ih.item}`]:{paddingLeft:0}}})}return g}function Ik(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const l=[];return t.forEach(g=>{const b=e[g];Number(b)>0&&l.push(n[`spacing-${g}-${String(b)}`])}),l}const Nk=Rt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:l,direction:g,item:b,spacing:a,wrap:r,zeroMinWidth:h,breakpoints:s}=n;let m=[];l&&(m=Ik(a,s,t));const c=[];return s.forEach(o=>{const u=n[o];u&&c.push(t[`grid-${o}-${String(u)}`])}),[t.root,l&&t.container,b&&t.item,h&&t.zeroMinWidth,...m,g!=="row"&&t[`direction-xs-${String(g)}`],r!=="wrap"&&t[`wrap-xs-${String(r)}`],...c]}})(({ownerState:e})=>Ne({boxSizing:"border-box"},e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},e.item&&{margin:0},e.zeroMinWidth&&{minWidth:0},e.wrap!=="wrap"&&{flexWrap:e.wrap}),Lk,Ak,Rk,Ck);function kk(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(l=>{const g=e[l];if(Number(g)>0){const b=`spacing-${l}-${String(g)}`;n.push(b)}}),n}const Ok=e=>{const{classes:t,container:n,direction:l,item:g,spacing:b,wrap:a,zeroMinWidth:r,breakpoints:h}=e;let s=[];n&&(s=kk(b,h));const m=[];h.forEach(o=>{const u=e[o];u&&m.push(`grid-${o}-${String(u)}`)});const c={root:["root",n&&"container",g&&"item",r&&"zeroMinWidth",...s,l!=="row"&&`direction-xs-${String(l)}`,a!=="wrap"&&`wrap-xs-${String(a)}`,...m]};return fn(c,wk,t)},Fk=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiGrid"}),{breakpoints:g}=td(),b=OE(l),{className:a,columns:r,columnSpacing:h,component:s="div",container:m=!1,direction:c="row",item:o=!1,rowSpacing:u,spacing:d=0,wrap:x="wrap",zeroMinWidth:p=!1}=b,v=Nt(b,Mk),S=u||d,T=h||d,P=ke.useContext(d4),_=m?r||12:P,E={},M=Ne({},v);g.keys.forEach(R=>{v[R]!=null&&(E[R]=v[R],delete M[R])});const N=Ne({},b,{columns:_,container:m,direction:c,item:o,rowSpacing:S,columnSpacing:T,wrap:x,zeroMinWidth:p,spacing:d},E,{breakpoints:g.keys}),I=Ok(N);return Be.jsx(d4.Provider,{value:_,children:Be.jsx(Nk,Ne({ownerState:N,className:Ut(I.root,a),as:s,ref:n},M))})}),pi=Fk,Bk=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Ug(e){return`scale(${e}, ${e**2})`}const Dk={entering:{opacity:1,transform:Ug(1)},entered:{opacity:1,transform:"none"}},x0=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),rx=ke.forwardRef(function(t,n){const{addEndListener:l,appear:g=!0,children:b,easing:a,in:r,onEnter:h,onEntered:s,onEntering:m,onExit:c,onExited:o,onExiting:u,style:d,timeout:x="auto",TransitionComponent:p=ub}=t,v=Nt(t,Bk),S=tb(),T=ke.useRef(),P=td(),_=ke.useRef(null),E=Bi(_,b.ref,n),M=W=>G=>{if(W){const X=_.current;G===void 0?W(X):W(X,G)}},N=M(m),I=M((W,G)=>{zE(W);const{duration:X,delay:L,easing:H}=Hu({style:d,timeout:x,easing:a},{mode:"enter"});let ne;x==="auto"?(ne=P.transitions.getAutoHeightDuration(W.clientHeight),T.current=ne):ne=X,W.style.transition=[P.transitions.create("opacity",{duration:ne,delay:L}),P.transitions.create("transform",{duration:x0?ne:ne*.666,delay:L,easing:H})].join(","),h&&h(W,G)}),R=M(s),V=M(u),U=M(W=>{const{duration:G,delay:X,easing:L}=Hu({style:d,timeout:x,easing:a},{mode:"exit"});let H;x==="auto"?(H=P.transitions.getAutoHeightDuration(W.clientHeight),T.current=H):H=G,W.style.transition=[P.transitions.create("opacity",{duration:H,delay:X}),P.transitions.create("transform",{duration:x0?H:H*.666,delay:x0?X:X||H*.333,easing:L})].join(","),W.style.opacity=0,W.style.transform=Ug(.75),c&&c(W)}),K=M(o),k=W=>{x==="auto"&&S.start(T.current||0,W),l&&l(_.current,W)};return Be.jsx(p,Ne({appear:g,in:r,nodeRef:_,onEnter:I,onEntered:R,onEntering:N,onExit:U,onExited:K,onExiting:V,addEndListener:k,timeout:x==="auto"?null:x},v,{children:(W,G)=>ke.cloneElement(b,Ne({style:Ne({opacity:0,transform:Ug(.75),visibility:W==="exited"&&!r?"hidden":void 0},Dk[W],d,b.props.style),ref:E},G))}))});rx.muiSupportAuto=!0;const Vk=rx,Gk=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Wk=e=>{const{classes:t,disableUnderline:n}=e,g=fn({root:["root",!n&&"underline"],input:["input"]},tN,t);return Ne({},t,g)},zk=Rt(_1,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...x1(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let l=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(l=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),Ne({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Dc.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Dc.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${l}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Dc.disabled}, .${Dc.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${l}`}},[`&.${Dc.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Uk=Rt(T1,{name:"MuiInput",slot:"Input",overridesResolver:w1})({}),sx=ke.forwardRef(function(t,n){var l,g,b,a;const r=pn({props:t,name:"MuiInput"}),{disableUnderline:h,components:s={},componentsProps:m,fullWidth:c=!1,inputComponent:o="input",multiline:u=!1,slotProps:d,slots:x={},type:p="text"}=r,v=Nt(r,Gk),S=Wk(r),P={root:{ownerState:{disableUnderline:h}}},_=d??m?ls(d??m,P):P,E=(l=(g=x.root)!=null?g:s.Root)!=null?l:zk,M=(b=(a=x.input)!=null?a:s.Input)!=null?b:Uk;return Be.jsx(pb,Ne({slots:{root:E,input:M},slotProps:_,fullWidth:c,inputComponent:o,multiline:u,ref:n,type:p},v,{classes:S}))});sx.muiName="Input";const ox=sx;function $k(e){return ln("MuiInputLabel",e)}un("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Hk=["disableAnimation","margin","shrink","variant","className"],jk=e=>{const{classes:t,formControl:n,size:l,shrink:g,disableAnimation:b,variant:a,required:r}=e,h={root:["root",n&&"formControl",!b&&"animated",g&&"shrink",l&&l!=="normal"&&`size${Ht(l)}`,a],asterisk:[r&&"asterisk"]},s=fn(h,$k,t);return Ne({},t,s)},Xk=Rt(Ek,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${lh.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(({theme:e,ownerState:t})=>Ne({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&Ne({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&Ne({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&Ne({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Yk=ke.forwardRef(function(t,n){const l=pn({name:"MuiInputLabel",props:t}),{disableAnimation:g=!1,shrink:b,className:a}=l,r=Nt(l,Hk),h=Ju();let s=b;typeof s>"u"&&h&&(s=h.filled||h.focused||h.adornedStart);const m=Zu({props:l,muiFormControl:h,states:["size","variant","required","focused"]}),c=Ne({},l,{disableAnimation:g,formControl:h,shrink:s,size:m.size,variant:m.variant,required:m.required,focused:m.focused}),o=jk(c);return Be.jsx(Xk,Ne({"data-shrink":s,ownerState:c,ref:n,className:Ut(o.root,a)},r,{classes:o}))}),Kk=Yk,qk=ke.createContext({}),Qk=qk;function Zk(e){return ln("MuiList",e)}un("MuiList",["root","padding","dense","subheader"]);const Jk=["children","className","component","dense","disablePadding","subheader"],eO=e=>{const{classes:t,disablePadding:n,dense:l,subheader:g}=e;return fn({root:["root",!n&&"padding",l&&"dense",g&&"subheader"]},Zk,t)},tO=Rt("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>Ne({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),nO=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiList"}),{children:g,className:b,component:a="ul",dense:r=!1,disablePadding:h=!1,subheader:s}=l,m=Nt(l,Jk),c=ke.useMemo(()=>({dense:r}),[r]),o=Ne({},l,{component:a,dense:r,disablePadding:h}),u=eO(o);return Be.jsx(Qk.Provider,{value:c,children:Be.jsxs(tO,Ne({as:a,className:Ut(u.root,b),ref:n,ownerState:o},m,{children:[s,g]}))})}),iO=nO,rO=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function w0(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function f4(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function ax(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.indexOf(t.keys.join(""))===0}function Gc(e,t,n,l,g,b){let a=!1,r=g(e,t,t?n:!1);for(;r;){if(r===e.firstChild){if(a)return!1;a=!0}const h=l?!1:r.disabled||r.getAttribute("aria-disabled")==="true";if(!r.hasAttribute("tabindex")||!ax(r,b)||h)r=g(e,r,n);else return r.focus(),!0}return!1}const sO=ke.forwardRef(function(t,n){const{actions:l,autoFocus:g=!1,autoFocusItem:b=!1,children:a,className:r,disabledItemsFocusable:h=!1,disableListWrap:s=!1,onKeyDown:m,variant:c="selectedMenu"}=t,o=Nt(t,rO),u=ke.useRef(null),d=ke.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});La(()=>{g&&u.current.focus()},[g]),ke.useImperativeHandle(l,()=>({adjustStyleForScrollbar:(T,P)=>{const _=!u.current.style.width;if(T.clientHeight{const P=u.current,_=T.key,E=Pr(P).activeElement;if(_==="ArrowDown")T.preventDefault(),Gc(P,E,s,h,w0);else if(_==="ArrowUp")T.preventDefault(),Gc(P,E,s,h,f4);else if(_==="Home")T.preventDefault(),Gc(P,null,s,h,w0);else if(_==="End")T.preventDefault(),Gc(P,null,s,h,f4);else if(_.length===1){const M=d.current,N=_.toLowerCase(),I=performance.now();M.keys.length>0&&(I-M.lastTime>500?(M.keys=[],M.repeating=!0,M.previousKeyMatched=!0):M.repeating&&N!==M.keys[0]&&(M.repeating=!1)),M.lastTime=I,M.keys.push(N);const R=E&&!M.repeating&&ax(E,M);M.previousKeyMatched&&(R||Gc(P,E,!1,h,w0,M))?T.preventDefault():M.previousKeyMatched=!1}m&&m(T)},p=Bi(u,n);let v=-1;ke.Children.forEach(a,(T,P)=>{if(!ke.isValidElement(T)){v===P&&(v+=1,v>=a.length&&(v=-1));return}T.props.disabled||(c==="selectedMenu"&&T.props.selected||v===-1)&&(v=P),v===P&&(T.props.disabled||T.props.muiSkipListHighlight||T.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const S=ke.Children.map(a,(T,P)=>{if(P===v){const _={};return b&&(_.autoFocus=!0),T.props.tabIndex===void 0&&c==="selectedMenu"&&(_.tabIndex=0),ke.cloneElement(T,_)}return T});return Be.jsx(iO,Ne({role:"menu",ref:p,className:r,onKeyDown:x,tabIndex:g?0:-1},o,{children:S}))}),oO=sO;function aO(e){return ln("MuiPopover",e)}un("MuiPopover",["root","paper"]);const lO=["onEntering"],uO=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],cO=["slotProps"];function p4(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function m4(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function g4(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function _0(e){return typeof e=="function"?e():e}const hO=e=>{const{classes:t}=e;return fn({root:["root"],paper:["paper"]},aO,t)},dO=Rt(HN,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),lx=Rt(pp,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),fO=ke.forwardRef(function(t,n){var l,g,b;const a=pn({props:t,name:"MuiPopover"}),{action:r,anchorEl:h,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:m,anchorReference:c="anchorEl",children:o,className:u,container:d,elevation:x=8,marginThreshold:p=16,open:v,PaperProps:S={},slots:T,slotProps:P,transformOrigin:_={vertical:"top",horizontal:"left"},TransitionComponent:E=Vk,transitionDuration:M="auto",TransitionProps:{onEntering:N}={},disableScrollLock:I=!1}=a,R=Nt(a.TransitionProps,lO),V=Nt(a,uO),U=(l=P==null?void 0:P.paper)!=null?l:S,K=ke.useRef(),k=Bi(K,U.ref),W=Ne({},a,{anchorOrigin:s,anchorReference:c,elevation:x,marginThreshold:p,externalPaperSlotProps:U,transformOrigin:_,TransitionComponent:E,transitionDuration:M,TransitionProps:R}),G=hO(W),X=ke.useCallback(()=>{if(c==="anchorPosition")return m;const z=_0(h),q=(z&&z.nodeType===1?z:Pr(K.current).body).getBoundingClientRect();return{top:q.top+p4(q,s.vertical),left:q.left+m4(q,s.horizontal)}},[h,s.horizontal,s.vertical,m,c]),L=ke.useCallback(z=>({vertical:p4(z,_.vertical),horizontal:m4(z,_.horizontal)}),[_.horizontal,_.vertical]),H=ke.useCallback(z=>{const Y={width:z.offsetWidth,height:z.offsetHeight},q=L(Y);if(c==="none")return{top:null,left:null,transformOrigin:g4(q)};const de=X();let le=de.top-q.vertical,he=de.left-q.horizontal;const me=le+Y.height,_e=he+Y.width,Me=Ca(_0(h)),Ue=Me.innerHeight-p,Ge=Me.innerWidth-p;if(p!==null&&leUe){const Qe=me-Ue;le-=Qe,q.vertical+=Qe}if(p!==null&&heGe){const Qe=_e-Ge;he-=Qe,q.horizontal+=Qe}return{top:`${Math.round(le)}px`,left:`${Math.round(he)}px`,transformOrigin:g4(q)}},[h,c,X,L,p]),[ne,ie]=ke.useState(v),be=ke.useCallback(()=>{const z=K.current;if(!z)return;const Y=H(z);Y.top!==null&&(z.style.top=Y.top),Y.left!==null&&(z.style.left=Y.left),z.style.transformOrigin=Y.transformOrigin,ie(!0)},[H]);ke.useEffect(()=>(I&&window.addEventListener("scroll",be),()=>window.removeEventListener("scroll",be)),[h,I,be]);const ae=(z,Y)=>{N&&N(z,Y),be()},ge=()=>{ie(!1)};ke.useEffect(()=>{v&&be()}),ke.useImperativeHandle(r,()=>v?{updatePosition:()=>{be()}}:null,[v,be]),ke.useEffect(()=>{if(!v)return;const z=J2(()=>{be()}),Y=Ca(h);return Y.addEventListener("resize",z),()=>{z.clear(),Y.removeEventListener("resize",z)}},[h,v,be]);let ce=M;M==="auto"&&!E.muiSupportAuto&&(ce=void 0);const ee=d||(h?Pr(_0(h)).body:void 0),ye=(g=T==null?void 0:T.root)!=null?g:dO,Ee=(b=T==null?void 0:T.paper)!=null?b:lx,j=ju({elementType:Ee,externalSlotProps:Ne({},U,{style:ne?U.style:Ne({},U.style,{opacity:0})}),additionalProps:{elevation:x,ref:k},ownerState:W,className:Ut(G.paper,U==null?void 0:U.className)}),te=ju({elementType:ye,externalSlotProps:(P==null?void 0:P.root)||{},externalForwardedProps:V,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:ee,open:v},ownerState:W,className:Ut(G.root,u)}),{slotProps:re}=te,O=Nt(te,cO);return Be.jsx(ye,Ne({},O,!mp(ye)&&{slotProps:re,disableScrollLock:I},{children:Be.jsx(E,Ne({appear:!0,in:v,onEntering:ae,onExited:ge,timeout:ce},R,{children:Be.jsx(Ee,Ne({},j,{children:o}))}))}))}),pO=fO;function mO(e){return ln("MuiMenu",e)}un("MuiMenu",["root","paper","list"]);const gO=["onEntering"],bO=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],yO={vertical:"top",horizontal:"right"},vO={vertical:"top",horizontal:"left"},SO=e=>{const{classes:t}=e;return fn({root:["root"],paper:["paper"],list:["list"]},mO,t)},EO=Rt(pO,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),xO=Rt(lx,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),wO=Rt(oO,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),_O=ke.forwardRef(function(t,n){var l,g;const b=pn({props:t,name:"MuiMenu"}),{autoFocus:a=!0,children:r,className:h,disableAutoFocusItem:s=!1,MenuListProps:m={},onClose:c,open:o,PaperProps:u={},PopoverClasses:d,transitionDuration:x="auto",TransitionProps:{onEntering:p}={},variant:v="selectedMenu",slots:S={},slotProps:T={}}=b,P=Nt(b.TransitionProps,gO),_=Nt(b,bO),E=td(),M=E.direction==="rtl",N=Ne({},b,{autoFocus:a,disableAutoFocusItem:s,MenuListProps:m,onEntering:p,PaperProps:u,transitionDuration:x,TransitionProps:P,variant:v}),I=SO(N),R=a&&!s&&o,V=ke.useRef(null),U=(H,ne)=>{V.current&&V.current.adjustStyleForScrollbar(H,E),p&&p(H,ne)},K=H=>{H.key==="Tab"&&(H.preventDefault(),c&&c(H,"tabKeyDown"))};let k=-1;ke.Children.map(r,(H,ne)=>{ke.isValidElement(H)&&(H.props.disabled||(v==="selectedMenu"&&H.props.selected||k===-1)&&(k=ne))});const W=(l=S.paper)!=null?l:xO,G=(g=T.paper)!=null?g:u,X=ju({elementType:S.root,externalSlotProps:T.root,ownerState:N,className:[I.root,h]}),L=ju({elementType:W,externalSlotProps:G,ownerState:N,className:I.paper});return Be.jsx(EO,Ne({onClose:c,anchorOrigin:{vertical:"bottom",horizontal:M?"right":"left"},transformOrigin:M?yO:vO,slots:{paper:W,root:S.root},slotProps:{root:X,paper:L},open:o,ref:n,transitionDuration:x,TransitionProps:Ne({onEntering:U},P),ownerState:N},_,{classes:d,children:Be.jsx(wO,Ne({onKeyDown:K,actions:V,autoFocus:a&&(k===-1||s),autoFocusItem:R,variant:v},m,{className:Ut(I.list,m.className),children:r}))}))}),TO=_O;function PO(e){return ln("MuiNativeSelect",e)}const MO=un("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),mb=MO,CO=["className","disabled","error","IconComponent","inputRef","variant"],LO=e=>{const{classes:t,variant:n,disabled:l,multiple:g,open:b,error:a}=e,r={select:["select",n,l&&"disabled",g&&"multiple",a&&"error"],icon:["icon",`icon${Ht(n)}`,b&&"iconOpen",l&&"disabled"]};return fn(r,PO,t)},ux=({ownerState:e,theme:t})=>Ne({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":Ne({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${mb.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),AO=Rt("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Os,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${mb.multiple}`]:t.multiple}]}})(ux),cx=({ownerState:e,theme:t})=>Ne({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${mb.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),RO=Rt("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ht(n.variant)}`],n.open&&t.iconOpen]}})(cx),IO=ke.forwardRef(function(t,n){const{className:l,disabled:g,error:b,IconComponent:a,inputRef:r,variant:h="standard"}=t,s=Nt(t,CO),m=Ne({},t,{disabled:g,variant:h,error:b}),c=LO(m);return Be.jsxs(ke.Fragment,{children:[Be.jsx(AO,Ne({ownerState:m,className:Ut(c.select,l),disabled:g,ref:r||n},s)),t.multiple?null:Be.jsx(RO,{as:a,ownerState:m,className:c.icon})]})}),NO=IO;var b4;const kO=["children","classes","className","label","notched"],OO=Rt("fieldset",{shouldForwardProp:Os})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),FO=Rt("legend",{shouldForwardProp:Os})(({ownerState:e,theme:t})=>Ne({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&Ne({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function BO(e){const{className:t,label:n,notched:l}=e,g=Nt(e,kO),b=n!=null&&n!=="",a=Ne({},e,{notched:l,withLabel:b});return Be.jsx(OO,Ne({"aria-hidden":!0,className:t,ownerState:a},g,{children:Be.jsx(FO,{ownerState:a,children:b?Be.jsx("span",{children:n}):b4||(b4=Be.jsx("span",{className:"notranslate",children:"​"}))})}))}const DO=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],VO=e=>{const{classes:t}=e,l=fn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},iN,t);return Ne({},t,l)},GO=Rt(_1,{shouldForwardProp:e=>Os(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:x1})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return Ne({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Jo.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Jo.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Jo.focused} .${Jo.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${Jo.error} .${Jo.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Jo.disabled} .${Jo.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&Ne({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),WO=Rt(BO,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),zO=Rt(T1,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:w1})(({theme:e,ownerState:t})=>Ne({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),hx=ke.forwardRef(function(t,n){var l,g,b,a,r;const h=pn({props:t,name:"MuiOutlinedInput"}),{components:s={},fullWidth:m=!1,inputComponent:c="input",label:o,multiline:u=!1,notched:d,slots:x={},type:p="text"}=h,v=Nt(h,DO),S=VO(h),T=Ju(),P=Zu({props:h,muiFormControl:T,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),_=Ne({},h,{color:P.color||"primary",disabled:P.disabled,error:P.error,focused:P.focused,formControl:T,fullWidth:m,hiddenLabel:P.hiddenLabel,multiline:u,size:P.size,type:p}),E=(l=(g=x.root)!=null?g:s.Root)!=null?l:GO,M=(b=(a=x.input)!=null?a:s.Input)!=null?b:zO;return Be.jsx(pb,Ne({slots:{root:E,input:M},renderSuffix:N=>Be.jsx(WO,{ownerState:_,className:S.notchedOutline,label:o!=null&&o!==""&&P.required?r||(r=Be.jsxs(ke.Fragment,{children:[o," ","*"]})):o,notched:typeof d<"u"?d:!!(N.startAdornment||N.filled||N.focused)}),fullWidth:m,inputComponent:c,multiline:u,ref:n,type:p},v,{classes:Ne({},S,{notchedOutline:null})}))});hx.muiName="Input";const dx=hx;function UO(e){return ln("MuiSelect",e)}const Wc=un("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var y4;const $O=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],HO=Rt("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Wc.select}`]:t.select},{[`&.${Wc.select}`]:t[n.variant]},{[`&.${Wc.error}`]:t.error},{[`&.${Wc.multiple}`]:t.multiple}]}})(ux,{[`&.${Wc.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),jO=Rt("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ht(n.variant)}`],n.open&&t.iconOpen]}})(cx),XO=Rt("input",{shouldForwardProp:e=>rR(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function v4(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function YO(e){return e==null||typeof e=="string"&&!e.trim()}const KO=e=>{const{classes:t,variant:n,disabled:l,multiple:g,open:b,error:a}=e,r={select:["select",n,l&&"disabled",g&&"multiple",a&&"error"],icon:["icon",`icon${Ht(n)}`,b&&"iconOpen",l&&"disabled"],nativeInput:["nativeInput"]};return fn(r,UO,t)},qO=ke.forwardRef(function(t,n){var l;const{"aria-describedby":g,"aria-label":b,autoFocus:a,autoWidth:r,children:h,className:s,defaultOpen:m,defaultValue:c,disabled:o,displayEmpty:u,error:d=!1,IconComponent:x,inputRef:p,labelId:v,MenuProps:S={},multiple:T,name:P,onBlur:_,onChange:E,onClose:M,onFocus:N,onOpen:I,open:R,readOnly:V,renderValue:U,SelectDisplayProps:K={},tabIndex:k,value:W,variant:G="standard"}=t,X=Nt(t,$O),[L,H]=hp({controlled:W,default:c,name:"Select"}),[ne,ie]=hp({controlled:R,default:m,name:"Select"}),be=ke.useRef(null),ae=ke.useRef(null),[ge,ce]=ke.useState(null),{current:ee}=ke.useRef(R!=null),[ye,Ee]=ke.useState(),j=Bi(n,p),te=ke.useCallback(ut=>{ae.current=ut,ut&&ce(ut)},[]),re=ge==null?void 0:ge.parentNode;ke.useImperativeHandle(j,()=>({focus:()=>{ae.current.focus()},node:be.current,value:L}),[L]),ke.useEffect(()=>{m&&ne&&ge&&!ee&&(Ee(r?null:re.clientWidth),ae.current.focus())},[ge,r]),ke.useEffect(()=>{a&&ae.current.focus()},[a]),ke.useEffect(()=>{if(!v)return;const ut=Pr(ae.current).getElementById(v);if(ut){const Et=()=>{getSelection().isCollapsed&&ae.current.focus()};return ut.addEventListener("click",Et),()=>{ut.removeEventListener("click",Et)}}},[v]);const O=(ut,Et)=>{ut?I&&I(Et):M&&M(Et),ee||(Ee(r?null:re.clientWidth),ie(ut))},z=ut=>{ut.button===0&&(ut.preventDefault(),ae.current.focus(),O(!0,ut))},Y=ut=>{O(!1,ut)},q=ke.Children.toArray(h),de=ut=>{const Et=q.find(dt=>dt.props.value===ut.target.value);Et!==void 0&&(H(Et.props.value),E&&E(ut,Et))},le=ut=>Et=>{let dt;if(Et.currentTarget.hasAttribute("tabindex")){if(T){dt=Array.isArray(L)?L.slice():[];const Tt=L.indexOf(ut.props.value);Tt===-1?dt.push(ut.props.value):dt.splice(Tt,1)}else dt=ut.props.value;if(ut.props.onClick&&ut.props.onClick(Et),L!==dt&&(H(dt),E)){const Tt=Et.nativeEvent||Et,It=new Tt.constructor(Tt.type,Tt);Object.defineProperty(It,"target",{writable:!0,value:{value:dt,name:P}}),E(It,ut)}T||O(!1,Et)}},he=ut=>{V||[" ","ArrowUp","ArrowDown","Enter"].indexOf(ut.key)!==-1&&(ut.preventDefault(),O(!0,ut))},me=ge!==null&&ne,_e=ut=>{!me&&_&&(Object.defineProperty(ut,"target",{writable:!0,value:{value:L,name:P}}),_(ut))};delete X["aria-invalid"];let Me,Ue;const Ge=[];let Qe=!1;(gp({value:L})||u)&&(U?Me=U(L):Qe=!0);const Re=q.map(ut=>{if(!ke.isValidElement(ut))return null;let Et;if(T){if(!Array.isArray(L))throw new Error(Ma(2));Et=L.some(dt=>v4(dt,ut.props.value)),Et&&Qe&&Ge.push(ut.props.children)}else Et=v4(L,ut.props.value),Et&&Qe&&(Ue=ut.props.children);return ke.cloneElement(ut,{"aria-selected":Et?"true":"false",onClick:le(ut),onKeyUp:dt=>{dt.key===" "&&dt.preventDefault(),ut.props.onKeyUp&&ut.props.onKeyUp(dt)},role:"option",selected:Et,value:void 0,"data-value":ut.props.value})});Qe&&(T?Ge.length===0?Me=null:Me=Ge.reduce((ut,Et,dt)=>(ut.push(Et),dt{const{classes:t}=e;return t},gb={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Os(e)&&e!=="variant",slot:"Root"},tF=Rt(ox,gb)(""),nF=Rt(dx,gb)(""),iF=Rt(nx,gb)(""),fx=ke.forwardRef(function(t,n){const l=pn({name:"MuiSelect",props:t}),{autoWidth:g=!1,children:b,classes:a={},className:r,defaultOpen:h=!1,displayEmpty:s=!1,IconComponent:m=aN,id:c,input:o,inputProps:u,label:d,labelId:x,MenuProps:p,multiple:v=!1,native:S=!1,onClose:T,onOpen:P,open:_,renderValue:E,SelectDisplayProps:M,variant:N="outlined"}=l,I=Nt(l,ZO),R=S?NO:QO,V=Ju(),U=Zu({props:l,muiFormControl:V,states:["variant","error"]}),K=U.variant||N,k=Ne({},l,{variant:K,classes:a}),W=eF(k),G=Nt(W,JO),X=o||{standard:Be.jsx(tF,{ownerState:k}),outlined:Be.jsx(nF,{label:d,ownerState:k}),filled:Be.jsx(iF,{ownerState:k})}[K],L=Bi(n,X.ref);return Be.jsx(ke.Fragment,{children:ke.cloneElement(X,Ne({inputComponent:R,inputProps:Ne({children:b,error:U.error,IconComponent:m,variant:K,type:void 0,multiple:v},S?{id:c}:{autoWidth:g,defaultOpen:h,displayEmpty:s,labelId:x,MenuProps:p,onClose:T,onOpen:P,open:_,renderValue:E,SelectDisplayProps:Ne({id:c},M)},u,{classes:u?ls(G,u.classes):G},o?o.props.inputProps:{})},(v&&S||s)&&K==="outlined"?{notched:!0}:{},{ref:L,className:Ut(X.props.className,r,W.root)},!o&&{variant:K},I))})});fx.muiName="Select";const rF=fx,sF=ke.createContext(),px=sF;function oF(e){return ln("MuiTable",e)}un("MuiTable",["root","stickyHeader"]);const aF=["className","component","padding","size","stickyHeader"],lF=e=>{const{classes:t,stickyHeader:n}=e;return fn({root:["root",n&&"stickyHeader"]},oF,t)},uF=Rt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>Ne({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":Ne({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),S4="table",cF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTable"}),{className:g,component:b=S4,padding:a="normal",size:r="medium",stickyHeader:h=!1}=l,s=Nt(l,aF),m=Ne({},l,{component:b,padding:a,size:r,stickyHeader:h}),c=lF(m),o=ke.useMemo(()=>({padding:a,size:r,stickyHeader:h}),[a,r,h]);return Be.jsx(px.Provider,{value:o,children:Be.jsx(uF,Ne({as:b,role:b===S4?null:"table",ref:n,className:Ut(c.root,g),ownerState:m},s))})}),hF=cF,dF=ke.createContext(),M1=dF;function fF(e){return ln("MuiTableBody",e)}un("MuiTableBody",["root"]);const pF=["className","component"],mF=e=>{const{classes:t}=e;return fn({root:["root"]},fF,t)},gF=Rt("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),bF={variant:"body"},E4="tbody",yF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTableBody"}),{className:g,component:b=E4}=l,a=Nt(l,pF),r=Ne({},l,{component:b}),h=mF(r);return Be.jsx(M1.Provider,{value:bF,children:Be.jsx(gF,Ne({className:Ut(h.root,g),as:b,ref:n,role:b===E4?null:"rowgroup",ownerState:r},a))})}),vF=yF;function SF(e){return ln("MuiTableCell",e)}const EF=un("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),xF=EF,wF=["align","className","component","padding","scope","size","sortDirection","variant"],_F=e=>{const{classes:t,variant:n,align:l,padding:g,size:b,stickyHeader:a}=e,r={root:["root",n,a&&"stickyHeader",l!=="inherit"&&`align${Ht(l)}`,g!=="normal"&&`padding${Ht(g)}`,`size${Ht(b)}`]};return fn(r,SF,t)},TF=Rt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Ht(n.size)}`],n.padding!=="normal"&&t[`padding${Ht(n.padding)}`],n.align!=="inherit"&&t[`align${Ht(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>Ne({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid - ${e.palette.mode==="light"?DE(tr(e.palette.divider,1),.88):BE(tr(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${xF.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),PF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTableCell"}),{align:g="inherit",className:b,component:a,padding:r,scope:h,size:s,sortDirection:m,variant:c}=l,o=Nt(l,wF),u=ke.useContext(px),d=ke.useContext(M1),x=d&&d.variant==="head";let p;a?p=a:p=x?"th":"td";let v=h;p==="td"?v=void 0:!v&&x&&(v="col");const S=c||d&&d.variant,T=Ne({},l,{align:g,component:p,padding:r||(u&&u.padding?u.padding:"normal"),size:s||(u&&u.size?u.size:"medium"),sortDirection:m,stickyHeader:S==="head"&&u&&u.stickyHeader,variant:S}),P=_F(T);let _=null;return m&&(_=m==="asc"?"ascending":"descending"),Be.jsx(TF,Ne({as:p,ref:n,className:Ut(P.root,b),"aria-sort":_,scope:v,ownerState:T},o))}),Kl=PF;function MF(e){return ln("MuiTableHead",e)}un("MuiTableHead",["root"]);const CF=["className","component"],LF=e=>{const{classes:t}=e;return fn({root:["root"]},MF,t)},AF=Rt("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),RF={variant:"head"},x4="thead",IF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTableHead"}),{className:g,component:b=x4}=l,a=Nt(l,CF),r=Ne({},l,{component:b}),h=LF(r);return Be.jsx(M1.Provider,{value:RF,children:Be.jsx(AF,Ne({as:b,className:Ut(h.root,g),ref:n,role:b===x4?null:"rowgroup",ownerState:r},a))})}),NF=IF;function kF(e){return ln("MuiTableRow",e)}const OF=un("MuiTableRow",["root","selected","hover","head","footer"]),w4=OF,FF=["className","component","hover","selected"],BF=e=>{const{classes:t,selected:n,hover:l,head:g,footer:b}=e;return fn({root:["root",n&&"selected",l&&"hover",g&&"head",b&&"footer"]},kF,t)},DF=Rt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${w4.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${w4.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:tr(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:tr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),_4="tr",VF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTableRow"}),{className:g,component:b=_4,hover:a=!1,selected:r=!1}=l,h=Nt(l,FF),s=ke.useContext(M1),m=Ne({},l,{component:b,hover:a,selected:r,head:s&&s.variant==="head",footer:s&&s.variant==="footer"}),c=BF(m);return Be.jsx(DF,Ne({as:b,ref:n,className:Ut(c.root,g),role:b===_4?null:"row",ownerState:m},h))}),T4=VF;function GF(e){return ln("MuiTextField",e)}un("MuiTextField",["root"]);const WF=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],zF={standard:ox,filled:nx,outlined:dx},UF=e=>{const{classes:t}=e;return fn({root:["root"]},GF,t)},$F=Rt(ok,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),HF=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiTextField"}),{autoComplete:g,autoFocus:b=!1,children:a,className:r,color:h="primary",defaultValue:s,disabled:m=!1,error:c=!1,FormHelperTextProps:o,fullWidth:u=!1,helperText:d,id:x,InputLabelProps:p,inputProps:v,InputProps:S,inputRef:T,label:P,maxRows:_,minRows:E,multiline:M=!1,name:N,onBlur:I,onChange:R,onFocus:V,placeholder:U,required:K=!1,rows:k,select:W=!1,SelectProps:G,type:X,value:L,variant:H="outlined"}=l,ne=Nt(l,WF),ie=Ne({},l,{autoFocus:b,color:h,disabled:m,error:c,fullWidth:u,multiline:M,required:K,select:W,variant:H}),be=UF(ie),ae={};H==="outlined"&&(p&&typeof p.shrink<"u"&&(ae.notched=p.shrink),ae.label=P),W&&((!G||!G.native)&&(ae.id=void 0),ae["aria-describedby"]=void 0);const ge=eb(x),ce=d&&ge?`${ge}-helper-text`:void 0,ee=P&&ge?`${ge}-label`:void 0,ye=zF[H],Ee=Be.jsx(ye,Ne({"aria-describedby":ce,autoComplete:g,autoFocus:b,defaultValue:s,fullWidth:u,multiline:M,name:N,rows:k,maxRows:_,minRows:E,type:X,value:L,id:ge,inputRef:T,onBlur:I,onChange:R,onFocus:V,placeholder:U,inputProps:v},ae,S));return Be.jsxs($F,Ne({className:Ut(be.root,r),disabled:m,error:c,fullWidth:u,ref:n,required:K,color:h,variant:H,ownerState:ie},ne,{children:[P!=null&&P!==""&&Be.jsx(Kk,Ne({htmlFor:ge,id:ee},p,{children:P})),W?Be.jsx(rF,Ne({"aria-describedby":ce,id:ge,labelId:ee,value:L,input:Ee},G,{children:a})):Ee,d&&Be.jsx(fk,Ne({id:ce},o,{children:d}))]}))}),jF=HF;function XF(e){return ln("MuiToggleButton",e)}const YF=un("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),hu=YF,KF=ke.createContext({}),mx=KF,qF=ke.createContext(void 0),gx=qF;function QF(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.indexOf(e)>=0:e===t}const ZF=["value"],JF=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],eB=e=>{const{classes:t,fullWidth:n,selected:l,disabled:g,size:b,color:a}=e,r={root:["root",l&&"selected",g&&"disabled",n&&"fullWidth",`size${Ht(b)}`,a]};return fn(r,XF,t)},tB=Rt(db,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${Ht(n.size)}`]]}})(({theme:e,ownerState:t})=>{let n=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,l;return e.vars&&(n=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,l=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),Ne({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${hu.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:tr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${hu.selected}`]:{color:n,backgroundColor:e.vars?`rgba(${l} / ${e.vars.palette.action.selectedOpacity})`:tr(n,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${l} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:tr(n,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${l} / ${e.vars.palette.action.selectedOpacity})`:tr(n,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),nB=ke.forwardRef(function(t,n){const l=ke.useContext(mx),{value:g}=l,b=Nt(l,ZF),a=ke.useContext(gx),r=u1(Ne({},b,{selected:QF(t.value,g)}),t),h=pn({props:r,name:"MuiToggleButton"}),{children:s,className:m,color:c="standard",disabled:o=!1,disableFocusRipple:u=!1,fullWidth:d=!1,onChange:x,onClick:p,selected:v,size:S="medium",value:T}=h,P=Nt(h,JF),_=Ne({},h,{color:c,disabled:o,disableFocusRipple:u,fullWidth:d,size:S}),E=eB(_),M=I=>{p&&(p(I,T),I.defaultPrevented)||x&&x(I,T)},N=a||"";return Be.jsx(tB,Ne({className:Ut(b.className,E.root,m,N),disabled:o,focusRipple:!u,ref:n,onClick:M,onChange:x,value:T,ownerState:_,"aria-pressed":v},P,{children:s}))}),gf=nB;function iB(e){return ln("MuiToggleButtonGroup",e)}const rB=un("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),$n=rB,sB=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],oB=e=>{const{classes:t,orientation:n,fullWidth:l,disabled:g}=e,b={root:["root",n==="vertical"&&"vertical",l&&"fullWidth"],grouped:["grouped",`grouped${Ht(n)}`,g&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return fn(b,iB,t)},aB=Rt("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${$n.grouped}`]:t.grouped},{[`& .${$n.grouped}`]:t[`grouped${Ht(n.orientation)}`]},{[`& .${$n.firstButton}`]:t.firstButton},{[`& .${$n.lastButton}`]:t.lastButton},{[`& .${$n.middleButton}`]:t.middleButton},t.root,n.orientation==="vertical"&&t.vertical,n.fullWidth&&t.fullWidth]}})(({ownerState:e,theme:t})=>Ne({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},e.orientation==="vertical"&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{[`& .${$n.grouped}`]:Ne({},e.orientation==="horizontal"?{[`&.${$n.selected} + .${$n.grouped}.${$n.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${$n.selected} + .${$n.grouped}.${$n.selected}`]:{borderTop:0,marginTop:0}})},e.orientation==="horizontal"?{[`& .${$n.firstButton},& .${$n.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${$n.lastButton},& .${$n.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${$n.firstButton},& .${$n.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${$n.lastButton},& .${$n.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},e.orientation==="horizontal"?{[`& .${$n.lastButton}.${hu.disabled},& .${$n.middleButton}.${hu.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${$n.lastButton}.${hu.disabled},& .${$n.middleButton}.${hu.disabled}`]:{borderTop:"1px solid transparent"}})),lB=ke.forwardRef(function(t,n){const l=pn({props:t,name:"MuiToggleButtonGroup"}),{children:g,className:b,color:a="standard",disabled:r=!1,exclusive:h=!1,fullWidth:s=!1,onChange:m,orientation:c="horizontal",size:o="medium",value:u}=l,d=Nt(l,sB),x=Ne({},l,{disabled:r,fullWidth:s,orientation:c,size:o}),p=oB(x),v=ke.useCallback((M,N)=>{if(!m)return;const I=u&&u.indexOf(N);let R;u&&I>=0?(R=u.slice(),R.splice(I,1)):R=u?u.concat(N):[N],m(M,R)},[m,u]),S=ke.useCallback((M,N)=>{m&&m(M,u===N?null:N)},[m,u]),T=ke.useMemo(()=>({className:p.grouped,onChange:h?S:v,value:u,size:o,fullWidth:s,color:a,disabled:r}),[p.grouped,h,S,v,u,o,s,a,r]),P=dL(g),_=P.length,E=M=>{const N=M===0,I=M===_-1;return N&&I?"":N?p.firstButton:I?p.lastButton:p.middleButton};return Be.jsx(aB,Ne({role:"group",className:Ut(p.root,b),ref:n,ownerState:x},d,{children:Be.jsx(mx.Provider,{value:T,children:P.map((M,N)=>Be.jsx(gx.Provider,{value:E(N),children:M},N))})}))}),uB=lB;var bb={},bx={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(bx);var ec=bx.exports,T0={};const cB=R9(hR);var P4;function tc(){return P4||(P4=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=cB}(T0)),T0}var hB=ec;Object.defineProperty(bb,"__esModule",{value:!0});var yb=bb.default=void 0,dB=hB(tc()),fB=Be;yb=bb.default=(0,dB.default)((0,fB.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var vb={},pB=ec;Object.defineProperty(vb,"__esModule",{value:!0});var yx=vb.default=void 0,mB=pB(tc()),gB=Be;yx=vb.default=(0,mB.default)((0,gB.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");const P0={"{} { &":["æ","hAt"],"A O":["ɑ ɔ","cAUGHt, cOt"],I:["ɪ","bIt"],E:["ɛ","lEt"],"@ V":["ə ʌ","cUb"],U:["ʊ","lOOk"],"@` 3`":["ɚ ɝ","bIRd"],i:["i","sEEd"],N:["ŋ","haNG"],tS:["tʃ","CHild"],dZ:["dʒ","Jet"],T:["θ","THing"],D:["ð","wiTHer"],S:["ʃ","SHock"],Z:["ʒ","meaSure"],oU:["oʊ","dOE"],eI:["eɪ","hAY"],aI:["aɪ","lIE"],OI:["ɔɪ","OIl"],aU:["aʊ","OWl"],l:["l","Long"],r:["r","Red"],w:["w","Wonder"],j:["j","Yard"],m:["m","Mat"],n:["n","No"],h:["h","Hay"],k:["k","Cut"],g:["g","God"],p:["p","Pile"],b:["b","Bay"],t:["t","Toad"],d:["d","Dine"],f:["f","Fast"],v:["v","Vase"],s:["s","Sad"],z:["z","Zany"],u:["u","nEW"]},bB=()=>Be.jsxs(pi,{item:!0,container:!0,direction:"column",mt:2,gap:3,width:"80%",alignItems:"flex-start",children:[Be.jsx(pi,{item:!0,children:Be.jsx(di,{variant:"h2",children:"About"})}),Be.jsxs(pi,{item:!0,container:!0,gap:3,children:[Be.jsx(di,{textAlign:"start",variant:"body1",children:"OddVoices is a project to create free and open source singing synthesizers for American English. This is a Web frontend for OddVoices, whose C++ source has been compiled to WebAssembly, so everything happens in your browser and nothing is sent to a server. Please note that this is experimental alpha software and has many bugs."}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["See ",Be.jsx("a",{href:"https://gitlab.com/oddvoices/oddvoices",children:"oddvoices/oddvoices"})," on GitLab for the core DSP code and command-line version of OddVoices, and"," ",Be.jsx("a",{href:"https://gitlab.com/oddvoices/oddvoices-web",children:"oddvoices/oddvoices-web"})," for the source code of this Web application."]}),Be.jsx(di,{textAlign:"start",variant:"body1",children:'To use the application, enter some English text into the box, upload a monophonic MIDI file, and select which voice you want to use. You may also leave the text blank, and the app will look for MIDI lyric events. Click "Sing," wait a few seconds, and play the audio file with the controls. To save as a WAV file, use the three dots to the right (Chrome) or right click and press Save Audio As... (Firefox).'}),Be.jsx(di,{textAlign:"start",variant:"body1",children:"There are no limits on the length of text or length of MIDI files, but you might stub your toe by running into browser memory limitations. If you encounter this, or need some form of batch processing, consider using the native command-line version."})]}),Be.jsx(pi,{item:!0,children:Be.jsx(di,{variant:"h2",children:"Phonetic entry"})}),Be.jsxs(pi,{item:!0,container:!0,gap:3,children:[Be.jsxs(di,{textAlign:"start",variant:"body1",children:["OddVoices uses the"," ",Be.jsx("a",{href:"http://www.speech.cs.cmu.edu/cgi-bin/cmudict",children:"CMU Pronouncing Dictionary"}),' to pronounce most words. OddVoices does not identify parts of speech, so heteronyms like "lead" and "read" are not handled intelligently. For OOV (out-of-vocabulary) words, OddVoices will guess the pronunciation by converting individual letters and pairs of letters to phonemes.']}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["To supply custom pronunciations to override the defaults,"," ",Be.jsx("a",{href:"https://en.wikipedia.org/wiki/X-SAMPA",children:"X-SAMPA"})," notation is supported. Surround the X-SAMPA pronunciation with forward slashes (like this: /hEloU/ ) and make sure no additional punctuation immediately precedes or follows the slashes. The table of phonemes is:"]})]}),Be.jsx(pi,{item:!0,width:"100%",children:Be.jsxs(KE,{children:[Be.jsx(QE,{expandIcon:Be.jsx(yb,{}),children:Be.jsx(di,{variant:"h3",children:"Phoneme Guide"})}),Be.jsx(qE,{children:Be.jsxs(hF,{id:"phoneme-guide",stickyHeader:!0,sx:{"& td":{fontSize:18},"& th":{fontSize:24}},children:[Be.jsx(NF,{children:Be.jsxs(T4,{children:[Be.jsx(Kl,{children:"X-SAMPA"}),Be.jsx(Kl,{children:"IPA"}),Be.jsx(Kl,{children:"Pronunciation"})]})}),Be.jsx(vF,{children:Ct.map(Ct.keys(P0),e=>Be.jsxs(T4,{children:[Be.jsx(Kl,{children:Ct.map(Ct.split(e," "),t=>`/${t}/`).join(", ")}),Be.jsx(Kl,{children:Ct.map(Ct.split(P0[e][0]," "),t=>`/${t}/`).join(", ")}),Be.jsx(Kl,{children:Ct.map(P0[e][1],(t,n)=>t!==t.toLowerCase()?Be.jsx("strong",{children:t.toLowerCase()},`${t}-${n}`):Be.jsx("span",{children:t},`${t}-${n}`))})]},e))})]})})]})}),Be.jsxs(pi,{item:!0,container:!0,gap:3,children:[Be.jsxs(di,{textAlign:"start",variant:"body1",children:["There are some peculiarities worth noting here. First is the"," ",Be.jsx("a",{href:"https://en.wikipedia.org/wiki/Cot%E2%80%93caught_merger",children:"cot-caught merger"})," that equates /ɑ/ and /ɔ/ along with other low back vowels. This admittedly reflects a bias towards the American West Coast and towards a younger demographic of singers. The exception to this merger is that /ɔr/ (h",Be.jsx("strong",{children:"or"}),"de) and /ɑr/ (h",Be.jsx("strong",{children:"ar"}),"d) are distinct. If you enter /O/ or /A/ they will sound the same in OddVoices, but /Or/ and /Ar/ are different."]}),Be.jsx(di,{textAlign:"start",variant:"body1",children:`Second is the unification of /ə/ and /ʌ/. When sung, the English schwa is difficult to pin down and really represents a multitude of vowels. In varieties of North American English, /ə/ and /ʌ/ are closely linked and differ primarily by stress, so /ʌ/ is the best candidate for absorbing /ə/. Similarly, OddVoices doesn't distinguish /ɚ/ and /ɝ/. The CMU Pronouncing Dictionary unfortunately uses schwas a lot, so OddVoices enunciates a lot of words weirdly, like "im-uh-tate" for "imitate."`}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["Finally, X-SAMPA's /{/ causes bracket matching issues in some text editors, so /","/ and /&/ are provided as alternatives. The latter is borrowed from the so-called"," ",Be.jsx("a",{href:"https://www.vulgarlang.com/ipa-x-sampa-cxs-converter/",children:"Conlang X-SAMPA"})," or CXS."]})]}),Be.jsx(zg,{}),Be.jsx(pi,{item:!0,children:Be.jsx(di,{variant:"h2",children:"Copyrights"})}),Be.jsxs(pi,{item:!0,container:!0,gap:3,children:[Be.jsxs(di,{textAlign:"start",variant:"body1",children:["The source code for this project is released under the"," ",Be.jsx("a",{href:"https://github.com/VehpuS/singing-synthesis/blob/main/LICENSE",children:"GNU GPL v3.0"})," license."]}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["OddVoices is copyright © 2021-2022 ",Be.jsx("a",{href:"https://nathan.ho.name/",children:"Nathan Ho"})," and is available under the"," ",Be.jsx("a",{href:"https://github.com/oddvoices/oddvoices/blob/develop/LICENSE",children:"Apache License"}),". Its voice files are in the Public Domain."]}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["Midifile is copyright © 1999-2018 Craig Stuart Sapp and is available under the"," ",Be.jsx("a",{href:"https://github.com/craigsapp/midifile",children:"BSD 2-Clause License"}),"."]}),Be.jsxs(di,{textAlign:"start",variant:"body1",children:["The CMU Pronouncing Dictionary is copyright © 1993-2015 Carnegie Mellon University and available under the"," ",Be.jsx("a",{href:"http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/",children:"BSD 2-Clause License"}),"."]})]})]});var vx={exports:{}};/*! For license information please see opensheetmusicdisplay.min.js.LICENSE.txt */(function(e,t){(function(n,l){e.exports=l()})(ql,()=>(()=>{var n={5733:(b,a,r)=>{b.exports=function h(s,m,c){function o(x,p){if(!m[x]){if(!s[x]){if(u)return u(x,!0);var v=new Error("Cannot find module '"+x+"'");throw v.code="MODULE_NOT_FOUND",v}var S=m[x]={exports:{}};s[x][0].call(S.exports,function(T){return o(s[x][1][T]||T)},S,S.exports,h,s,m,c)}return m[x].exports}for(var u=void 0,d=0;d>2,T=(3&x)<<4|p>>4,P=1>6:64,_=2>4,p=(15&S)<<4|(T=u.indexOf(d.charAt(_++)))>>2,v=(3&T)<<6|(P=u.indexOf(d.charAt(_++))),N[E++]=x,T!==64&&(N[E++]=p),P!==64&&(N[E++]=v);return N}},{"./support":30,"./utils":32}],2:[function(h,s,m){var c=h("./external"),o=h("./stream/DataWorker"),u=h("./stream/Crc32Probe"),d=h("./stream/DataLengthProbe");function x(p,v,S,T,P){this.compressedSize=p,this.uncompressedSize=v,this.crc32=S,this.compression=T,this.compressedContent=P}x.prototype={getContentWorker:function(){var p=new o(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),v=this;return p.on("end",function(){if(this.streamInfo.data_length!==v.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new o(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},x.createWorkerFrom=function(p,v,S){return p.pipe(new u).pipe(new d("uncompressedSize")).pipe(v.compressWorker(S)).pipe(new d("compressedSize")).withStreamInfo("compression",v)},s.exports=x},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(h,s,m){var c=h("./stream/GenericWorker");m.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},m.DEFLATE=h("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(h,s,m){var c=h("./utils"),o=function(){for(var u,d=[],x=0;x<256;x++){u=x;for(var p=0;p<8;p++)u=1&u?3988292384^u>>>1:u>>>1;d[x]=u}return d}();s.exports=function(u,d){return u!==void 0&&u.length?c.getTypeOf(u)!=="string"?function(x,p,v,S){var T=o,P=0+v;x^=-1;for(var _=0;_>>8^T[255&(x^p[_])];return-1^x}(0|d,u,u.length):function(x,p,v,S){var T=o,P=0+v;x^=-1;for(var _=0;_>>8^T[255&(x^p.charCodeAt(_))];return-1^x}(0|d,u,u.length):0}},{"./utils":32}],5:[function(h,s,m){m.base64=!1,m.binary=!1,m.dir=!1,m.createFolders=!0,m.date=null,m.compression=null,m.compressionOptions=null,m.comment=null,m.unixPermissions=null,m.dosPermissions=null},{}],6:[function(h,s,m){var c;c=typeof Promise<"u"?Promise:h("lie"),s.exports={Promise:c}},{lie:37}],7:[function(h,s,m){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=h("pako"),u=h("./utils"),d=h("./stream/GenericWorker"),x=c?"uint8array":"array";function p(v,S){d.call(this,"FlateWorker/"+v),this._pako=null,this._pakoAction=v,this._pakoOptions=S,this.meta={}}m.magic="\b\0",u.inherits(p,d),p.prototype.processChunk=function(v){this.meta=v.meta,this._pako===null&&this._createPako(),this._pako.push(u.transformTo(x,v.data),!1)},p.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var v=this;this._pako.onData=function(S){v.push({data:S,meta:v.meta})}},m.compressWorker=function(v){return new p("Deflate",v)},m.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(h,s,m){function c(T,P){var _,E="";for(_=0;_>>=8;return E}function o(T,P,_,E,M,N){var I,R,V=T.file,U=T.compression,K=N!==x.utf8encode,k=u.transformTo("string",N(V.name)),W=u.transformTo("string",x.utf8encode(V.name)),G=V.comment,X=u.transformTo("string",N(G)),L=u.transformTo("string",x.utf8encode(G)),H=W.length!==V.name.length,ne=L.length!==G.length,ie="",be="",ae="",ge=V.dir,ce=V.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};P&&!_||(ee.crc32=T.crc32,ee.compressedSize=T.compressedSize,ee.uncompressedSize=T.uncompressedSize);var ye=0;P&&(ye|=8),K||!H&&!ne||(ye|=2048);var Ee=0,j=0;ge&&(Ee|=16),M==="UNIX"?(j=798,Ee|=function(re,O){var z=re;return re||(z=O?16893:33204),(65535&z)<<16}(V.unixPermissions,ge)):(j=20,Ee|=function(re){return 63&(re||0)}(V.dosPermissions)),I=ce.getUTCHours(),I<<=6,I|=ce.getUTCMinutes(),I<<=5,I|=ce.getUTCSeconds()/2,R=ce.getUTCFullYear()-1980,R<<=4,R|=ce.getUTCMonth()+1,R<<=5,R|=ce.getUTCDate(),H&&(be=c(1,1)+c(p(k),4)+W,ie+="up"+c(be.length,2)+be),ne&&(ae=c(1,1)+c(p(X),4)+L,ie+="uc"+c(ae.length,2)+ae);var te="";return te+=` -\0`,te+=c(ye,2),te+=U.magic,te+=c(I,2),te+=c(R,2),te+=c(ee.crc32,4),te+=c(ee.compressedSize,4),te+=c(ee.uncompressedSize,4),te+=c(k.length,2),te+=c(ie.length,2),{fileRecord:v.LOCAL_FILE_HEADER+te+k+ie,dirRecord:v.CENTRAL_FILE_HEADER+c(j,2)+te+c(X.length,2)+"\0\0\0\0"+c(Ee,4)+c(E,4)+k+ie+X}}var u=h("../utils"),d=h("../stream/GenericWorker"),x=h("../utf8"),p=h("../crc32"),v=h("../signature");function S(T,P,_,E){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=P,this.zipPlatform=_,this.encodeFileName=E,this.streamFiles=T,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(S,d),S.prototype.push=function(T){var P=T.meta.percent||0,_=this.entriesCount,E=this._sources.length;this.accumulate?this.contentBuffer.push(T):(this.bytesWritten+=T.data.length,d.prototype.push.call(this,{data:T.data,meta:{currentFile:this.currentFile,percent:_?(P+100*(_-E-1))/_:100}}))},S.prototype.openedSource=function(T){this.currentSourceOffset=this.bytesWritten,this.currentFile=T.file.name;var P=this.streamFiles&&!T.file.dir;if(P){var _=o(T,P,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},S.prototype.closedSource=function(T){this.accumulate=!1;var P=this.streamFiles&&!T.file.dir,_=o(T,P,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),P)this.push({data:function(E){return v.DATA_DESCRIPTOR+c(E.crc32,4)+c(E.compressedSize,4)+c(E.uncompressedSize,4)}(T),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},S.prototype.flush=function(){for(var T=this.bytesWritten,P=0;P=this.index;d--)x=(x<<8)+this.byteAt(d);return this.index+=u,x},readString:function(u){return c.transformTo("string",this.readData(u))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var u=this.readInt(4);return new Date(Date.UTC(1980+(u>>25&127),(u>>21&15)-1,u>>16&31,u>>11&31,u>>5&63,(31&u)<<1))}},s.exports=o},{"../utils":32}],19:[function(h,s,m){var c=h("./Uint8ArrayReader");function o(u){c.call(this,u)}h("../utils").inherits(o,c),o.prototype.readData=function(u){this.checkOffset(u);var d=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,d},s.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(h,s,m){var c=h("./DataReader");function o(u){c.call(this,u)}h("../utils").inherits(o,c),o.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},o.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},o.prototype.readAndCheckSignature=function(u){return u===this.readData(4)},o.prototype.readData=function(u){this.checkOffset(u);var d=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,d},s.exports=o},{"../utils":32,"./DataReader":18}],21:[function(h,s,m){var c=h("./ArrayReader");function o(u){c.call(this,u)}h("../utils").inherits(o,c),o.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,d},s.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(h,s,m){var c=h("../utils"),o=h("../support"),u=h("./ArrayReader"),d=h("./StringReader"),x=h("./NodeBufferReader"),p=h("./Uint8ArrayReader");s.exports=function(v){var S=c.getTypeOf(v);return c.checkSupport(S),S!=="string"||o.uint8array?S==="nodebuffer"?new x(v):o.uint8array?new p(c.transformTo("uint8array",v)):new u(c.transformTo("array",v)):new d(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(h,s,m){m.LOCAL_FILE_HEADER="PK",m.CENTRAL_FILE_HEADER="PK",m.CENTRAL_DIRECTORY_END="PK",m.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",m.ZIP64_CENTRAL_DIRECTORY_END="PK",m.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(h,s,m){var c=h("./GenericWorker"),o=h("../utils");function u(d){c.call(this,"ConvertWorker to "+d),this.destType=d}o.inherits(u,c),u.prototype.processChunk=function(d){this.push({data:o.transformTo(this.destType,d.data),meta:d.meta})},s.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(h,s,m){var c=h("./GenericWorker"),o=h("../crc32");function u(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}h("../utils").inherits(u,c),u.prototype.processChunk=function(d){this.streamInfo.crc32=o(d.data,this.streamInfo.crc32||0),this.push(d)},s.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(h,s,m){var c=h("../utils"),o=h("./GenericWorker");function u(d){o.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}c.inherits(u,o),u.prototype.processChunk=function(d){if(d){var x=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=x+d.data.length}o.prototype.processChunk.call(this,d)},s.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(h,s,m){var c=h("../utils"),o=h("./GenericWorker");function u(d){o.call(this,"DataWorker");var x=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(p){x.dataIsReady=!0,x.data=p,x.max=p&&p.length||0,x.type=c.getTypeOf(p),x.isPaused||x._tickAndRepeat()},function(p){x.error(p)})}c.inherits(u,o),u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,x=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,x);break;case"uint8array":d=this.data.subarray(this.index,x);break;case"array":case"nodebuffer":d=this.data.slice(this.index,x)}return this.index=x,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(h,s,m){function c(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,u){return this._listeners[o].push(u),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,u){if(this._listeners[o])for(var d=0;d "+o:o}},s.exports=c},{}],29:[function(h,s,m){var c=h("../utils"),o=h("./ConvertWorker"),u=h("./GenericWorker"),d=h("../base64"),x=h("../support"),p=h("../external"),v=null;if(x.nodestream)try{v=h("../nodejs/NodejsStreamOutputAdapter")}catch{}function S(T,P,_){var E=P;switch(P){case"blob":case"arraybuffer":E="uint8array";break;case"base64":E="string"}try{this._internalType=E,this._outputType=P,this._mimeType=_,c.checkSupport(E),this._worker=T.pipe(new o(E)),T.lock()}catch(M){this._worker=new u("error"),this._worker.error(M)}}S.prototype={accumulate:function(T){return function(P,_){return new p.Promise(function(E,M){var N=[],I=P._internalType,R=P._outputType,V=P._mimeType;P.on("data",function(U,K){N.push(U),_&&_(K)}).on("error",function(U){N=[],M(U)}).on("end",function(){try{var U=function(K,k,W){switch(K){case"blob":return c.newBlob(c.transformTo("arraybuffer",k),W);case"base64":return d.encode(k);default:return c.transformTo(K,k)}}(R,function(K,k){var W,G=0,X=null,L=0;for(W=0;W"u")m.blob=!1;else{var c=new ArrayBuffer(0);try{m.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(c),m.blob=o.getBlob("application/zip").size===0}catch{m.blob=!1}}}try{m.nodestream=!!h("readable-stream").Readable}catch{m.nodestream=!1}},{"readable-stream":16}],31:[function(h,s,m){for(var c=h("./utils"),o=h("./support"),u=h("./nodejsUtils"),d=h("./stream/GenericWorker"),x=new Array(256),p=0;p<256;p++)x[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;function v(){d.call(this,"utf-8 decode"),this.leftOver=null}function S(){d.call(this,"utf-8 encode")}x[254]=x[254]=1,m.utf8encode=function(T){return o.nodebuffer?u.newBufferFrom(T,"utf-8"):function(P){var _,E,M,N,I,R=P.length,V=0;for(N=0;N>>6:(E<65536?_[I++]=224|E>>>12:(_[I++]=240|E>>>18,_[I++]=128|E>>>12&63),_[I++]=128|E>>>6&63),_[I++]=128|63&E);return _}(T)},m.utf8decode=function(T){return o.nodebuffer?c.transformTo("nodebuffer",T).toString("utf-8"):function(P){var _,E,M,N,I=P.length,R=new Array(2*I);for(_=E=0;_>10&1023,R[E++]=56320|1023&M)}return R.length!==E&&(R.subarray?R=R.subarray(0,E):R.length=E),c.applyFromCharCode(R)}(T=c.transformTo(o.uint8array?"uint8array":"array",T))},c.inherits(v,d),v.prototype.processChunk=function(T){var P=c.transformTo(o.uint8array?"uint8array":"array",T.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var _=P;(P=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),P.set(_,this.leftOver.length)}else P=this.leftOver.concat(P);this.leftOver=null}var E=function(N,I){var R;for((I=I||N.length)>N.length&&(I=N.length),R=I-1;0<=R&&(192&N[R])==128;)R--;return R<0||R===0?I:R+x[N[R]]>I?R:I}(P),M=P;E!==P.length&&(o.uint8array?(M=P.subarray(0,E),this.leftOver=P.subarray(E,P.length)):(M=P.slice(0,E),this.leftOver=P.slice(E,P.length))),this.push({data:m.utf8decode(M),meta:T.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:m.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},m.Utf8DecodeWorker=v,c.inherits(S,d),S.prototype.processChunk=function(T){this.push({data:m.utf8encode(T.data),meta:T.meta})},m.Utf8EncodeWorker=S},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(h,s,m){var c=h("./support"),o=h("./base64"),u=h("./nodejsUtils"),d=h("./external");function x(_){return _}function p(_,E){for(var M=0;M<_.length;++M)E[M]=255&_.charCodeAt(M);return E}h("setimmediate"),m.newBlob=function(_,E){m.checkSupport("blob");try{return new Blob([_],{type:E})}catch{try{var M=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return M.append(_),M.getBlob(E)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(_,E,M){var N=[],I=0,R=_.length;if(R<=M)return String.fromCharCode.apply(null,_);for(;I>8;this.dir=!!(16&this.externalFileAttributes),T==0&&(this.dosPermissions=63&this.externalFileAttributes),T==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var T=c(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=T.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=T.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=T.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=T.readInt(4))}},readExtraFields:function(T){var P,_,E,M=T.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});T.index+4>>6:(T<65536?S[E++]=224|T>>>12:(S[E++]=240|T>>>18,S[E++]=128|T>>>12&63),S[E++]=128|T>>>6&63),S[E++]=128|63&T);return S},m.buf2binstring=function(v){return p(v,v.length)},m.binstring2buf=function(v){for(var S=new c.Buf8(v.length),T=0,P=S.length;T>10&1023,N[P++]=56320|1023&_)}return p(N,P)},m.utf8border=function(v,S){var T;for((S=S||v.length)>v.length&&(S=v.length),T=S-1;0<=T&&(192&v[T])==128;)T--;return T<0||T===0?S:T+d[v[T]]>S?T:S}},{"./common":41}],43:[function(h,s,m){s.exports=function(c,o,u,d){for(var x=65535&c|0,p=c>>>16&65535|0,v=0;u!==0;){for(u-=v=2e3>>1:o>>>1;u[d]=o}return u}();s.exports=function(o,u,d,x){var p=c,v=x+d;o^=-1;for(var S=x;S>>8^p[255&(o^u[S])];return-1^o}},{}],46:[function(h,s,m){var c,o=h("../utils/common"),u=h("./trees"),d=h("./adler32"),x=h("./crc32"),p=h("./messages"),v=0,S=0,T=-2,P=2,_=8,E=286,M=30,N=19,I=2*E+1,R=15,V=3,U=258,K=U+V+1,k=42,W=113;function G(O,z){return O.msg=p[z],z}function X(O){return(O<<1)-(4O.avail_out&&(Y=O.avail_out),Y!==0&&(o.arraySet(O.output,z.pending_buf,z.pending_out,Y,O.next_out),O.next_out+=Y,z.pending_out+=Y,O.total_out+=Y,O.avail_out-=Y,z.pending-=Y,z.pending===0&&(z.pending_out=0))}function ne(O,z){u._tr_flush_block(O,0<=O.block_start?O.block_start:-1,O.strstart-O.block_start,z),O.block_start=O.strstart,H(O.strm)}function ie(O,z){O.pending_buf[O.pending++]=z}function be(O,z){O.pending_buf[O.pending++]=z>>>8&255,O.pending_buf[O.pending++]=255&z}function ae(O,z){var Y,q,de=O.max_chain_length,le=O.strstart,he=O.prev_length,me=O.nice_match,_e=O.strstart>O.w_size-K?O.strstart-(O.w_size-K):0,Me=O.window,Ue=O.w_mask,Ge=O.prev,Qe=O.strstart+U,Re=Me[le+he-1],We=Me[le+he];O.prev_length>=O.good_match&&(de>>=2),me>O.lookahead&&(me=O.lookahead);do if(Me[(Y=z)+he]===We&&Me[Y+he-1]===Re&&Me[Y]===Me[le]&&Me[++Y]===Me[le+1]){le+=2,Y++;do;while(Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&Me[++le]===Me[++Y]&&le_e&&--de!=0);return he<=O.lookahead?he:O.lookahead}function ge(O){var z,Y,q,de,le,he,me,_e,Me,Ue,Ge=O.w_size;do{if(de=O.window_size-O.lookahead-O.strstart,O.strstart>=Ge+(Ge-K)){for(o.arraySet(O.window,O.window,Ge,Ge,0),O.match_start-=Ge,O.strstart-=Ge,O.block_start-=Ge,z=Y=O.hash_size;q=O.head[--z],O.head[z]=Ge<=q?q-Ge:0,--Y;);for(z=Y=Ge;q=O.prev[--z],O.prev[z]=Ge<=q?q-Ge:0,--Y;);de+=Ge}if(O.strm.avail_in===0)break;if(he=O.strm,me=O.window,_e=O.strstart+O.lookahead,Ue=void 0,(Me=de)<(Ue=he.avail_in)&&(Ue=Me),Y=Ue===0?0:(he.avail_in-=Ue,o.arraySet(me,he.input,he.next_in,Ue,_e),he.state.wrap===1?he.adler=d(he.adler,me,Ue,_e):he.state.wrap===2&&(he.adler=x(he.adler,me,Ue,_e)),he.next_in+=Ue,he.total_in+=Ue,Ue),O.lookahead+=Y,O.lookahead+O.insert>=V)for(le=O.strstart-O.insert,O.ins_h=O.window[le],O.ins_h=(O.ins_h<=V&&(O.ins_h=(O.ins_h<=V)if(q=u._tr_tally(O,O.strstart-O.match_start,O.match_length-V),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=V){for(O.match_length--;O.strstart++,O.ins_h=(O.ins_h<=V&&(O.ins_h=(O.ins_h<=V&&O.match_length<=O.prev_length){for(de=O.strstart+O.lookahead-V,q=u._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-V),O.lookahead-=O.prev_length-1,O.prev_length-=2;++O.strstart<=de&&(O.ins_h=(O.ins_h<O.pending_buf_size-5&&(Y=O.pending_buf_size-5);;){if(O.lookahead<=1){if(ge(O),O.lookahead===0&&z===v)return 1;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var q=O.block_start+Y;if((O.strstart===0||O.strstart>=q)&&(O.lookahead=O.strstart-q,O.strstart=q,ne(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-K&&(ne(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,z===4?(ne(O,!0),O.strm.avail_out===0?3:4):(O.strstart>O.block_start&&(ne(O,!1),O.strm.avail_out),1)}),new ye(4,4,8,4,ce),new ye(4,5,16,8,ce),new ye(4,6,32,32,ce),new ye(4,4,16,16,ee),new ye(8,16,32,32,ee),new ye(8,16,128,128,ee),new ye(8,32,128,256,ee),new ye(32,128,258,1024,ee),new ye(32,258,258,4096,ee)],m.deflateInit=function(O,z){return re(O,z,_,15,8,0)},m.deflateInit2=re,m.deflateReset=te,m.deflateResetKeep=j,m.deflateSetHeader=function(O,z){return O&&O.state?O.state.wrap!==2?T:(O.state.gzhead=z,S):T},m.deflate=function(O,z){var Y,q,de,le;if(!O||!O.state||5>8&255),ie(q,q.gzhead.time>>16&255),ie(q,q.gzhead.time>>24&255),ie(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),ie(q,255&q.gzhead.os),q.gzhead.extra&&q.gzhead.extra.length&&(ie(q,255&q.gzhead.extra.length),ie(q,q.gzhead.extra.length>>8&255)),q.gzhead.hcrc&&(O.adler=x(O.adler,q.pending_buf,q.pending,0)),q.gzindex=0,q.status=69):(ie(q,0),ie(q,0),ie(q,0),ie(q,0),ie(q,0),ie(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),ie(q,3),q.status=W);else{var he=_+(q.w_bits-8<<4)<<8;he|=(2<=q.strategy||q.level<2?0:q.level<6?1:q.level===6?2:3)<<6,q.strstart!==0&&(he|=32),he+=31-he%31,q.status=W,be(q,he),q.strstart!==0&&(be(q,O.adler>>>16),be(q,65535&O.adler)),O.adler=1}if(q.status===69)if(q.gzhead.extra){for(de=q.pending;q.gzindex<(65535&q.gzhead.extra.length)&&(q.pending!==q.pending_buf_size||(q.gzhead.hcrc&&q.pending>de&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),H(O),de=q.pending,q.pending!==q.pending_buf_size));)ie(q,255&q.gzhead.extra[q.gzindex]),q.gzindex++;q.gzhead.hcrc&&q.pending>de&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),q.gzindex===q.gzhead.extra.length&&(q.gzindex=0,q.status=73)}else q.status=73;if(q.status===73)if(q.gzhead.name){de=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>de&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),H(O),de=q.pending,q.pending===q.pending_buf_size)){le=1;break}le=q.gzindexde&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),le===0&&(q.gzindex=0,q.status=91)}else q.status=91;if(q.status===91)if(q.gzhead.comment){de=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>de&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),H(O),de=q.pending,q.pending===q.pending_buf_size)){le=1;break}le=q.gzindexde&&(O.adler=x(O.adler,q.pending_buf,q.pending-de,de)),le===0&&(q.status=103)}else q.status=103;if(q.status===103&&(q.gzhead.hcrc?(q.pending+2>q.pending_buf_size&&H(O),q.pending+2<=q.pending_buf_size&&(ie(q,255&O.adler),ie(q,O.adler>>8&255),O.adler=0,q.status=W)):q.status=W),q.pending!==0){if(H(O),O.avail_out===0)return q.last_flush=-1,S}else if(O.avail_in===0&&X(z)<=X(Y)&&z!==4)return G(O,-5);if(q.status===666&&O.avail_in!==0)return G(O,-5);if(O.avail_in!==0||q.lookahead!==0||z!==v&&q.status!==666){var me=q.strategy===2?function(_e,Me){for(var Ue;;){if(_e.lookahead===0&&(ge(_e),_e.lookahead===0)){if(Me===v)return 1;break}if(_e.match_length=0,Ue=u._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++,Ue&&(ne(_e,!1),_e.strm.avail_out===0))return 1}return _e.insert=0,Me===4?(ne(_e,!0),_e.strm.avail_out===0?3:4):_e.last_lit&&(ne(_e,!1),_e.strm.avail_out===0)?1:2}(q,z):q.strategy===3?function(_e,Me){for(var Ue,Ge,Qe,Re,We=_e.window;;){if(_e.lookahead<=U){if(ge(_e),_e.lookahead<=U&&Me===v)return 1;if(_e.lookahead===0)break}if(_e.match_length=0,_e.lookahead>=V&&0<_e.strstart&&(Ge=We[Qe=_e.strstart-1])===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]){Re=_e.strstart+U;do;while(Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Ge===We[++Qe]&&Qe_e.lookahead&&(_e.match_length=_e.lookahead)}if(_e.match_length>=V?(Ue=u._tr_tally(_e,1,_e.match_length-V),_e.lookahead-=_e.match_length,_e.strstart+=_e.match_length,_e.match_length=0):(Ue=u._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++),Ue&&(ne(_e,!1),_e.strm.avail_out===0))return 1}return _e.insert=0,Me===4?(ne(_e,!0),_e.strm.avail_out===0?3:4):_e.last_lit&&(ne(_e,!1),_e.strm.avail_out===0)?1:2}(q,z):c[q.level].func(q,z);if(me!==3&&me!==4||(q.status=666),me===1||me===3)return O.avail_out===0&&(q.last_flush=-1),S;if(me===2&&(z===1?u._tr_align(q):z!==5&&(u._tr_stored_block(q,0,0,!1),z===3&&(L(q.head),q.lookahead===0&&(q.strstart=0,q.block_start=0,q.insert=0))),H(O),O.avail_out===0))return q.last_flush=-1,S}return z!==4?S:q.wrap<=0?1:(q.wrap===2?(ie(q,255&O.adler),ie(q,O.adler>>8&255),ie(q,O.adler>>16&255),ie(q,O.adler>>24&255),ie(q,255&O.total_in),ie(q,O.total_in>>8&255),ie(q,O.total_in>>16&255),ie(q,O.total_in>>24&255)):(be(q,O.adler>>>16),be(q,65535&O.adler)),H(O),0=Y.w_size&&(le===0&&(L(Y.head),Y.strstart=0,Y.block_start=0,Y.insert=0),Me=new o.Buf8(Y.w_size),o.arraySet(Me,z,Ue-Y.w_size,Y.w_size,0),z=Me,Ue=Y.w_size),he=O.avail_in,me=O.next_in,_e=O.input,O.avail_in=Ue,O.next_in=0,O.input=z,ge(Y);Y.lookahead>=V;){for(q=Y.strstart,de=Y.lookahead-(V-1);Y.ins_h=(Y.ins_h<>>=W=k>>>24,I-=W,(W=k>>>16&255)==0)ie[p++]=65535&k;else{if(!(16&W)){if(!(64&W)){k=R[(65535&k)+(N&(1<>>=W,I-=W),I<15&&(N+=ne[d++]<>>=W=k>>>24,I-=W,!(16&(W=k>>>16&255))){if(!(64&W)){k=V[(65535&k)+(N&(1<>>=W,I-=W,(W=p-v)>3,N&=(1<<(I-=G<<3))-1,c.next_in=d,c.next_out=p,c.avail_in=d>>24&255)+(G>>>8&65280)+((65280&G)<<8)+((255&G)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(G){var X;return G&&G.state?(X=G.state,G.total_in=G.total_out=X.total=0,G.msg="",X.wrap&&(G.adler=1&X.wrap),X.mode=S,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new c.Buf32(T),X.distcode=X.distdyn=new c.Buf32(P),X.sane=1,X.back=-1,p):v}function N(G){var X;return G&&G.state?((X=G.state).wsize=0,X.whave=0,X.wnext=0,M(G)):v}function I(G,X){var L,H;return G&&G.state?(H=G.state,X<0?(L=0,X=-X):(L=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15=ie.wsize?(c.arraySet(ie.window,X,L-ie.wsize,ie.wsize,0),ie.wnext=0,ie.whave=ie.wsize):(H<(ne=ie.wsize-ie.wnext)&&(ne=H),c.arraySet(ie.window,X,L-H,ne,ie.wnext),(H-=ne)?(c.arraySet(ie.window,X,L-H,H,0),ie.wnext=H,ie.whave=ie.wsize):(ie.wnext+=ne,ie.wnext===ie.wsize&&(ie.wnext=0),ie.whave>>8&255,L.check=u(L.check,Ge,2,0),ee=ce=0,L.mode=2;break}if(L.flags=0,L.head&&(L.head.done=!1),!(1&L.wrap)||(((255&ce)<<8)+(ce>>8))%31){G.msg="incorrect header check",L.mode=30;break}if((15&ce)!=8){G.msg="unknown compression method",L.mode=30;break}if(ee-=4,he=8+(15&(ce>>>=4)),L.wbits===0)L.wbits=he;else if(he>L.wbits){G.msg="invalid window size",L.mode=30;break}L.dmax=1<>8&1),512&L.flags&&(Ge[0]=255&ce,Ge[1]=ce>>>8&255,L.check=u(L.check,Ge,2,0)),ee=ce=0,L.mode=3;case 3:for(;ee<32;){if(ae===0)break e;ae--,ce+=H[ie++]<>>8&255,Ge[2]=ce>>>16&255,Ge[3]=ce>>>24&255,L.check=u(L.check,Ge,4,0)),ee=ce=0,L.mode=4;case 4:for(;ee<16;){if(ae===0)break e;ae--,ce+=H[ie++]<>8),512&L.flags&&(Ge[0]=255&ce,Ge[1]=ce>>>8&255,L.check=u(L.check,Ge,2,0)),ee=ce=0,L.mode=5;case 5:if(1024&L.flags){for(;ee<16;){if(ae===0)break e;ae--,ce+=H[ie++]<>>8&255,L.check=u(L.check,Ge,2,0)),ee=ce=0}else L.head&&(L.head.extra=null);L.mode=6;case 6:if(1024&L.flags&&(ae<(j=L.length)&&(j=ae),j&&(L.head&&(he=L.head.extra_len-L.length,L.head.extra||(L.head.extra=new Array(L.head.extra_len)),c.arraySet(L.head.extra,H,ie,j,he)),512&L.flags&&(L.check=u(L.check,H,j,ie)),ae-=j,ie+=j,L.length-=j),L.length))break e;L.length=0,L.mode=7;case 7:if(2048&L.flags){if(ae===0)break e;for(j=0;he=H[ie+j++],L.head&&he&&L.length<65536&&(L.head.name+=String.fromCharCode(he)),he&&j>9&1,L.head.done=!0),G.adler=L.check=0,L.mode=12;break;case 10:for(;ee<32;){if(ae===0)break e;ae--,ce+=H[ie++]<>>=7&ee,ee-=7&ee,L.mode=27;break}for(;ee<3;){if(ae===0)break e;ae--,ce+=H[ie++]<>>=1)){case 0:L.mode=14;break;case 1:if(k(L),L.mode=20,X!==6)break;ce>>>=2,ee-=2;break e;case 2:L.mode=17;break;case 3:G.msg="invalid block type",L.mode=30}ce>>>=2,ee-=2;break;case 14:for(ce>>>=7&ee,ee-=7ⅇee<32;){if(ae===0)break e;ae--,ce+=H[ie++]<>>16^65535)){G.msg="invalid stored block lengths",L.mode=30;break}if(L.length=65535&ce,ee=ce=0,L.mode=15,X===6)break e;case 15:L.mode=16;case 16:if(j=L.length){if(ae>>=5,ee-=5,L.ndist=1+(31&ce),ce>>>=5,ee-=5,L.ncode=4+(15&ce),ce>>>=4,ee-=4,286>>=3,ee-=3}for(;L.have<19;)L.lens[Qe[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,_e={bits:L.lenbits},me=x(0,L.lens,0,19,L.lencode,0,L.work,_e),L.lenbits=_e.bits,me){G.msg="invalid code lengths set",L.mode=30;break}L.have=0,L.mode=19;case 19:for(;L.have>>16&255,Y=65535&Ue,!((O=Ue>>>24)<=ee);){if(ae===0)break e;ae--,ce+=H[ie++]<>>=O,ee-=O,L.lens[L.have++]=Y;else{if(Y===16){for(Me=O+2;ee>>=O,ee-=O,L.have===0){G.msg="invalid bit length repeat",L.mode=30;break}he=L.lens[L.have-1],j=3+(3&ce),ce>>>=2,ee-=2}else if(Y===17){for(Me=O+3;ee>>=O)),ce>>>=3,ee-=3}else{for(Me=O+7;ee>>=O)),ce>>>=7,ee-=7}if(L.have+j>L.nlen+L.ndist){G.msg="invalid bit length repeat",L.mode=30;break}for(;j--;)L.lens[L.have++]=he}}if(L.mode===30)break;if(L.lens[256]===0){G.msg="invalid code -- missing end-of-block",L.mode=30;break}if(L.lenbits=9,_e={bits:L.lenbits},me=x(1,L.lens,0,L.nlen,L.lencode,0,L.work,_e),L.lenbits=_e.bits,me){G.msg="invalid literal/lengths set",L.mode=30;break}if(L.distbits=6,L.distcode=L.distdyn,_e={bits:L.distbits},me=x(2,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,_e),L.distbits=_e.bits,me){G.msg="invalid distances set",L.mode=30;break}if(L.mode=20,X===6)break e;case 20:L.mode=21;case 21:if(6<=ae&&258<=ge){G.next_out=be,G.avail_out=ge,G.next_in=ie,G.avail_in=ae,L.hold=ce,L.bits=ee,d(G,Ee),be=G.next_out,ne=G.output,ge=G.avail_out,ie=G.next_in,H=G.input,ae=G.avail_in,ce=L.hold,ee=L.bits,L.mode===12&&(L.back=-1);break}for(L.back=0;z=(Ue=L.lencode[ce&(1<>>16&255,Y=65535&Ue,!((O=Ue>>>24)<=ee);){if(ae===0)break e;ae--,ce+=H[ie++]<>q)])>>>16&255,Y=65535&Ue,!(q+(O=Ue>>>24)<=ee);){if(ae===0)break e;ae--,ce+=H[ie++]<>>=q,ee-=q,L.back+=q}if(ce>>>=O,ee-=O,L.back+=O,L.length=Y,z===0){L.mode=26;break}if(32&z){L.back=-1,L.mode=12;break}if(64&z){G.msg="invalid literal/length code",L.mode=30;break}L.extra=15&z,L.mode=22;case 22:if(L.extra){for(Me=L.extra;ee>>=L.extra,ee-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=23;case 23:for(;z=(Ue=L.distcode[ce&(1<>>16&255,Y=65535&Ue,!((O=Ue>>>24)<=ee);){if(ae===0)break e;ae--,ce+=H[ie++]<>q)])>>>16&255,Y=65535&Ue,!(q+(O=Ue>>>24)<=ee);){if(ae===0)break e;ae--,ce+=H[ie++]<>>=q,ee-=q,L.back+=q}if(ce>>>=O,ee-=O,L.back+=O,64&z){G.msg="invalid distance code",L.mode=30;break}L.offset=Y,L.extra=15&z,L.mode=24;case 24:if(L.extra){for(Me=L.extra;ee>>=L.extra,ee-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){G.msg="invalid distance too far back",L.mode=30;break}L.mode=25;case 25:if(ge===0)break e;if(j=Ee-ge,L.offset>j){if((j=L.offset-j)>L.whave&&L.sane){G.msg="invalid distance too far back",L.mode=30;break}te=j>L.wnext?(j-=L.wnext,L.wsize-j):L.wnext-j,j>L.length&&(j=L.length),re=L.window}else re=ne,te=be-L.offset,j=L.length;for(geK?(W=O[z+E[H]],Ee[j+E[H]]):(W=96,0),N=1<>ge)+(I-=N)]=k<<24|W<<16|G|0,I!==0;);for(N=1<>=1;if(N!==0?(ye&=N-1,ye+=N):ye=0,H++,--te[L]==0){if(L===ie)break;L=v[S+E[H]]}if(be>>7)]}function L(z,Y){z.pending_buf[z.pending++]=255&Y,z.pending_buf[z.pending++]=Y>>>8&255}function H(z,Y,q){z.bi_valid>v-q?(z.bi_buf|=Y<>v-z.bi_valid,z.bi_valid+=q-v):(z.bi_buf|=Y<>>=1,q<<=1,0<--Y;);return q>>>1}function be(z,Y,q){var de,le,he=new Array(p+1),me=0;for(de=1;de<=p;de++)he[de]=me=me+q[de-1]<<1;for(le=0;le<=Y;le++){var _e=z[2*le+1];_e!==0&&(z[2*le]=ie(he[_e]++,_e))}}function ae(z){var Y;for(Y=0;Y>1;1<=q;q--)ee(z,he,q);for(le=Me;q=z.heap[1],z.heap[1]=z.heap[z.heap_len--],ee(z,he,1),de=z.heap[1],z.heap[--z.heap_max]=q,z.heap[--z.heap_max]=de,he[2*le]=he[2*q]+he[2*de],z.depth[le]=(z.depth[q]>=z.depth[de]?z.depth[q]:z.depth[de])+1,he[2*q+1]=he[2*de+1]=le,z.heap[1]=le++,ee(z,he,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],function(Ge,Qe){var Re,We,qe,Ke,Ze,st,ft=Qe.dyn_tree,xt=Qe.max_code,ut=Qe.stat_desc.static_tree,Et=Qe.stat_desc.has_stree,dt=Qe.stat_desc.extra_bits,Tt=Qe.stat_desc.extra_base,It=Qe.stat_desc.max_length,Jt=0;for(Ke=0;Ke<=p;Ke++)Ge.bl_count[Ke]=0;for(ft[2*Ge.heap[Ge.heap_max]+1]=0,Re=Ge.heap_max+1;Re<573;Re++)It<(Ke=ft[2*ft[2*(We=Ge.heap[Re])+1]+1]+1)&&(Ke=It,Jt++),ft[2*We+1]=Ke,xt>=7;le>>=1)if(1&Ue&&_e.dyn_ltree[2*Me]!==0)return 0;if(_e.dyn_ltree[18]!==0||_e.dyn_ltree[20]!==0||_e.dyn_ltree[26]!==0)return 1;for(Me=32;Me>>3,(he=z.static_len+3+7>>>3)<=le&&(le=he)):le=he=q+5,q+4<=le&&Y!==-1?O(z,Y,q,de):z.strategy===4||he===le?(H(z,2+(de?1:0),3),ye(z,E,M)):(H(z,4+(de?1:0),3),function(_e,Me,Ue,Ge){var Qe;for(H(_e,Me-257,5),H(_e,Ue-1,5),H(_e,Ge-4,4),Qe=0;Qe>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&Y,z.pending_buf[z.l_buf+z.last_lit]=255&q,z.last_lit++,Y===0?z.dyn_ltree[2*q]++:(z.matches++,Y--,z.dyn_ltree[2*(I[q]+u+1)]++,z.dyn_dtree[2*X(Y)]++),z.last_lit===z.lit_bufsize-1},m._tr_align=function(z){H(z,2,3),ne(z,256,E),function(Y){Y.bi_valid===16?(L(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(z)}},{"../utils/common":41}],53:[function(h,s,m){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(h,s,m){(function(c){(function(o,u){if(!o.setImmediate){var d,x,p,v,S=1,T={},P=!1,_=o.document,E=Object.getPrototypeOf&&Object.getPrototypeOf(o);E=E&&E.setTimeout?E:o,d={}.toString.call(o.process)==="[object process]"?function(R){process.nextTick(function(){N(R)})}:function(){if(o.postMessage&&!o.importScripts){var R=!0,V=o.onmessage;return o.onmessage=function(){R=!1},o.postMessage("","*"),o.onmessage=V,R}}()?(v="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",I,!1):o.attachEvent("onmessage",I),function(R){o.postMessage(v+R,"*")}):o.MessageChannel?((p=new MessageChannel).port1.onmessage=function(R){N(R.data)},function(R){p.port2.postMessage(R)}):_&&"onreadystatechange"in _.createElement("script")?(x=_.documentElement,function(R){var V=_.createElement("script");V.onreadystatechange=function(){N(R),V.onreadystatechange=null,x.removeChild(V),V=null},x.appendChild(V)}):function(R){setTimeout(N,0,R)},E.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var V=new Array(arguments.length-1),U=0;U"u"?c===void 0?this:c:self)}).call(this,r.g!==void 0?r.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)},2043:function(b,a,r){var h,s;(function(m,c){h=function(){var o=function(){},u="undefined",d=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),x=["trace","debug","info","warn","error"];function p(I,R){var V=I[R];if(typeof V.bind=="function")return V.bind(I);try{return Function.prototype.bind.call(V,I)}catch{return function(){return Function.prototype.apply.apply(V,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function S(I,R){for(var V=0;V=0&&X<=K.levels.SILENT))throw"log.setLevel() called with invalid level: "+X;if(U=X,L!==!1&&function(H){var ne=(x[H]||"silent").toUpperCase();if(typeof window!==u&&k){try{return void(window.localStorage[k]=ne)}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+ne+";"}catch{}}}(X),S.call(K,X,I),typeof console===u&&X{Object.defineProperty(a,"__esModule",{value:!0}),a.Fraction=void 0;class r{constructor(s=0,m=1,c=0,o=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=s,this.denominator=m,this.wholeValue=c,o&&this.simplify(),this.setRealValue()}static max(s,m){return s.RealValue>m.RealValue?s:m}static Equal(s,m){return s.wholeValue===m.wholeValue&&s.Denominator===m.Denominator&&s.Numerator===m.Numerator}static createFromFraction(s){return new r(s.numerator,s.denominator,s.wholeValue,!1)}static plus(s,m){const c=s.clone();return c.Add(m),c}static minus(s,m){const c=s.clone();return c.Sub(m),c}static multiply(s,m){return new r((s.wholeValue*s.denominator+s.numerator)*(m.wholeValue*m.denominator+m.numerator),s.denominator*m.denominator)}static greatestCommonDenominator(s,m){if(s===0)return m;if(m===1)return 1;for(;Math.abs(m)>1e-8&&Math.abs(s)>1e-8;)s>m?s-=m:m-=s;return Math.round(s)}toString(){let s=this.numerator+"/"+this.denominator;return this.wholeValue!==0&&(s=this.wholeValue+" "+s),s}clone(){return new r(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(s){this.numerator!==s&&(this.numerator=s,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(s){this.denominator!==s&&(this.denominator=s,this.numerator!==0&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(s){this.wholeValue!==s&&(this.wholeValue=s,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let s=1,m=2;const c=this.GetExpandedNumerator();for(;ms;)m.Numerator++;if(this.numerator>this.denominator){const c=new r(this.numerator-1,this.denominator,this.wholeValue);for(;c.Denominator>s;)c.Numerator--;if(c.Denominatorr.maximumAllowedNumber){const c=this.denominator/r.maximumAllowedNumber;this.numerator=Math.round(this.numerator/c),this.denominator=Math.round(this.denominator/c)}if(this.numerator>r.maximumAllowedNumber){const c=this.numerator/r.maximumAllowedNumber;this.numerator=Math.round(this.numerator/c),this.denominator=Math.round(this.denominator/c)}}isOnBeat(s){const m=this.distanceFromBeat(s);return Math.abs(m){Object.defineProperty(a,"__esModule",{value:!0}),a.Matrix2D=void 0;const h=r(9086);class s{constructor(){this.matrix=[];for(let c=0;c<2;c++){this.matrix[c]=[];for(let o=0;o<2;o++)this.matrix[c][o]=0}}static getRotationMatrix(c){const o=new s,u=Math.cos(c),d=Math.sin(c);return o.matrix[0][0]=u,o.matrix[0][1]=-d,o.matrix[1][0]=d,o.matrix[1][1]=u,o}scalarMultiplication(c){for(let o=0;o<2;o++)for(let u=0;u<2;u++)this.matrix[o][u]*=c}getTransposeMatrix(){const c=new s;for(let o=0;o<2;o++)for(let u=0;u<2;u++)c.matrix[o][u]=this.matrix[u][o];return c}vectorMultiplication(c){const o=new h.PointF2D;return o.x=c.x*this.matrix[0][0]+c.y*this.matrix[0][1],o.y=c.x*this.matrix[1][0]+c.y*this.matrix[1][1],o}}a.Matrix2D=s},9651:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSheetErrors=void 0,a.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(r){let h=this.measureErrors[r];h||(h=[]),this.measureErrors[r]=h.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(r){this.tempErrors.push(r)}push(r){this.errors.push(r)}}},9855:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OSMDColor=void 0;class r{constructor(s,m,c){this.alpha=255,this.red=s,this.green=m,this.blue=c}static get Black(){return new r(0,0,0)}static get DeepSkyBlue(){return new r(0,191,255)}static get Green(){return new r(20,160,20)}static get Magenta(){return new r(255,0,255)}static get Orange(){return new r(255,128,0)}static get Red(){return new r(240,20,20)}static get Disabled(){return new r(225,225,225)}static get DarkBlue(){return new r(0,0,140)}static get Debug1(){return new r(200,0,140)}static get Debug2(){return new r(100,100,200)}static get Debug3(){return new r(0,50,140)}toString(){return"rgb("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}a.OSMDColor=r},8640:(b,a)=>{var r,h;Object.defineProperty(a,"__esModule",{value:!0}),a.Pitch=a.AccidentalEnum=a.NoteEnum=void 0,function(m){m[m.C=0]="C",m[m.D=2]="D",m[m.E=4]="E",m[m.F=5]="F",m[m.G=7]="G",m[m.A=9]="A",m[m.B=11]="B"}(r=a.NoteEnum||(a.NoteEnum={})),function(m){m[m.SHARP=0]="SHARP",m[m.FLAT=1]="FLAT",m[m.NONE=2]="NONE",m[m.NATURAL=3]="NATURAL",m[m.DOUBLESHARP=4]="DOUBLESHARP",m[m.DOUBLEFLAT=5]="DOUBLEFLAT",m[m.TRIPLESHARP=6]="TRIPLESHARP",m[m.TRIPLEFLAT=7]="TRIPLEFLAT",m[m.QUARTERTONESHARP=8]="QUARTERTONESHARP",m[m.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",m[m.SLASHFLAT=10]="SLASHFLAT",m[m.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",m[m.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",m[m.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",m[m.SLASHSHARP=14]="SLASHSHARP",m[m.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",m[m.SORI=16]="SORI",m[m.KORON=17]="KORON"}(h=a.AccidentalEnum||(a.AccidentalEnum={}));class s{constructor(c,o,u,d=void 0,x=!1){this.accidental=h.NONE,this.fundamentalNote=c,this.octave=o,this.accidental=u,this.accidentalXml=d,this.halfTone=c+12*(o+s.octXmlDiff)+s.HalfTonesFromAccidental(u),x||(this.frequency=s.calcFrequency(this))}static getNoteEnumString(c){switch(c){case r.C:return"C";case r.D:return"D";case r.E:return"E";case r.F:return"F";case r.G:return"G";case r.A:return"A";case r.B:return"B";default:return""}}static lineShiftFromNoteEnum(c,o){if(o===0)return[c,0];const u=s.pitchEnumValues,d=u.indexOf(c);let x=0,p=(d+o)%u.length;return d+o>u.length-1&&(x=1),p<0&&(p=u.length+p,x=-1),[u[p],x]}static CalculateTransposedHalfTone(c,o){const u=c.fundamentalNote+c.AccidentalHalfTones+o;return s.WrapAroundCheck(u,12)}static WrapAroundCheck(c,o){let u=0;for(;c<0;)c+=o,u--;for(;c>=o;)c-=o,u++;return{overflow:u,halftone:c}}static calcFrequency(c){let o,u=0;if(c instanceof s){const d=c;u=d.octave-1,o=d.fundamentalNote-r.A+d.AccidentalHalfTones}else typeof c=="number"&&(o=c-57);return 440*Math.pow(2,u)*Math.pow(2,o/12)}static calcFractionalKey(c){return Math.log(c/440)/Math.LN10*s.halftoneFactor+57}static fromFrequency(c){const o=s.calcFractionalKey(c)+.5,u=Math.floor(o/12)-s.octXmlDiff,d=Math.floor(o)%12;let x=d,p=h.NONE;return this.pitchEnumValues.indexOf(x)===-1&&(x=d-1,p=h.SHARP),new s(x,u,p)}static fromHalftone(c){const o=Math.floor(c/12)-s.octXmlDiff,u=c%12;let d=u,x=h.NONE;return this.pitchEnumValues.indexOf(d)===-1&&(d=u-1,x=h.SHARP),new s(d,o,x)}static ceiling(c){let o=c%=12;return this.pitchEnumValues.indexOf(o)===-1&&(o=c+1),o}static floor(c){let o=c%=12;return this.pitchEnumValues.indexOf(o)===-1&&(o=c-1),o}static HalfTonesFromAccidental(c){switch(c){case h.NONE:return 0;case h.SHARP:return 1;case h.FLAT:return-1;case h.NATURAL:return 0;case h.DOUBLESHARP:return 2;case h.DOUBLEFLAT:return-2;case h.TRIPLESHARP:return 3;case h.TRIPLEFLAT:return-3;case h.QUARTERTONESHARP:return .5;case h.QUARTERTONEFLAT:return-.5;case h.SLASHFLAT:return-.51;case h.THREEQUARTERSSHARP:return 1.5;case h.THREEQUARTERSFLAT:return-1.5;case h.SLASHQUARTERSHARP:return .0013;case h.SLASHSHARP:return .0014;case h.DOUBLESLASHFLAT:return-.0015;case h.SORI:return .0016;case h.KORON:return .0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(c){switch(c){case 0:return h.NONE;case 1:return h.SHARP;case-1:return h.FLAT;case 2:return h.DOUBLESHARP;case-2:return h.DOUBLEFLAT;case 3:return h.TRIPLESHARP;case-3:return h.TRIPLEFLAT;case .5:return h.QUARTERTONESHARP;case-.5:return h.QUARTERTONEFLAT;case 1.5:return h.THREEQUARTERSSHARP;case-1.5:return h.THREEQUARTERSFLAT;default:return c>0&&c<1?h.QUARTERTONESHARP:c<0&&c>-1?h.QUARTERTONEFLAT:h.QUARTERTONESHARP}}static accidentalVexflow(c){let o;switch(c){case h.NATURAL:o="n";break;case h.FLAT:o="b";break;case h.SHARP:o="#";break;case h.DOUBLESHARP:o="##";break;case h.TRIPLESHARP:o="###";break;case h.DOUBLEFLAT:o="bb";break;case h.TRIPLEFLAT:o="bbs";break;case h.QUARTERTONESHARP:o="+";break;case h.QUARTERTONEFLAT:o="d";break;case h.SLASHFLAT:o="bs";break;case h.THREEQUARTERSSHARP:o="++";break;case h.THREEQUARTERSFLAT:o="db";break;case h.SLASHQUARTERSHARP:o="+-";break;case h.SLASHSHARP:o="++-";break;case h.DOUBLESLASHFLAT:o="bss";break;case h.SORI:o="o";break;case h.KORON:o="k"}return o}get AccidentalHalfTones(){return s.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return s.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(c){if(c>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return c>0?this.getHigherPitchByTransposeFactor(c):c<0?this.getLowerPitchByTransposeFactor(-c):this}DoEnharmonicChange(){switch(this.accidental){case h.FLAT:case h.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;case h.SHARP:case h.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=s.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+s.octXmlDiff)));break;default:return}}ToString(){let c=s.accidentalVexflow(this.accidental);return c||(c=""),"Key: "+s.getNoteEnumString(this.fundamentalNote)+c+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}ToStringShort(c=0){let o=s.accidentalVexflow(this.accidental);o||(o="");const u=this.octave+c;return s.getNoteEnumString(this.fundamentalNote)+o+u}get ToStringShortGet(){return this.ToStringShort(0)}OperatorEquals(c){const o=this;return!(!o||!c)&&o.FundamentalNote===c.FundamentalNote&&o.Octave===c.Octave&&o.Accidental===c.Accidental}OperatorNotEqual(c){return this!==c}OperatorFundamentalGreaterThan(c){const o=this;return o.Octave===c.Octave?o.FundamentalNote>c.FundamentalNote:o.Octave>c.Octave}OperatorFundamentalLessThan(c){const o=this;return o.Octave===c.Octave?o.FundamentalNotes.pitchEnumValues.length-1?(u=s.pitchEnumValues[o+c-s.pitchEnumValues.length],d++):u=s.pitchEnumValues[o+c],new s(u,d,h.NONE)}getLowerPitchByTransposeFactor(c){const o=s.pitchEnumValues.indexOf(this.fundamentalNote);let u,d=this.octave;return o-c<0?(u=s.pitchEnumValues[s.pitchEnumValues.length+o-c],d--):u=s.pitchEnumValues[o-c],new s(u,d,h.NONE)}getNextFundamentalNote(c){let o=s.pitchEnumValues.indexOf(c);return o=(o+1)%s.pitchEnumValues.length,s.pitchEnumValues[o]}getPreviousFundamentalNote(c){const o=s.pitchEnumValues.indexOf(c);return o>0?s.pitchEnumValues[o-1]:s.pitchEnumValues[s.pitchEnumValues.length-1]}}a.Pitch=s,s.pitchEnumValues=[r.C,r.D,r.E,r.F,r.G,r.A,r.B],s.halftoneFactor=12/(Math.LN2/Math.LN10),s.octXmlDiff=3},9086:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PointF2D=void 0;class r{constructor(s=0,m=0){this.x=0,this.y=0,this.x=s,this.y=m}static get Empty(){return new r}static pointsAreEqual(s,m){return s.x===m.x&&s.y===m.y}ToString(){return"["+this.x+", "+this.y+"]"}}a.PointF2D=r},3278:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RectangleF2D=void 0;const h=r(739),s=r(9086);class m{constructor(o,u,d,x){this.x=0,this.y=0,this.width=0,this.height=0,this.x=o,this.y=u,this.width=d,this.height=x}static createFromLocationAndSize(o,u){return new m(o.x,o.y,u.width,u.height)}get Location(){return new s.PointF2D(this.x,this.y)}get Size(){return new h.SizeF2D(this.width,this.height)}}a.RectangleF2D=m},739:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SizeF2D=void 0,a.SizeF2D=class{constructor(r=0,h=0){this.width=r,this.height=h}}},8918:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(1797),a),s(r(8363),a),s(r(9651),a),s(r(9855),a),s(r(8640),a),s(r(9086),a),s(r(3278),a),s(r(739),a)},2562:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.FontStyles=void 0,(r=a.FontStyles||(a.FontStyles={}))[r.Regular=0]="Regular",r[r.Bold=1]="Bold",r[r.Italic=2]="Italic",r[r.BoldItalic=3]="BoldItalic",r[r.Underlined=4]="Underlined"},96:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.Fonts=void 0,(r=a.Fonts||(a.Fonts={}))[r.TimesNewRoman=0]="TimesNewRoman",r[r.Kokila=1]="Kokila"},1274:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.TextAlignment=a.TextAlignmentEnum=void 0,function(h){h[h.LeftTop=0]="LeftTop",h[h.LeftCenter=1]="LeftCenter",h[h.LeftBottom=2]="LeftBottom",h[h.CenterTop=3]="CenterTop",h[h.CenterCenter=4]="CenterCenter",h[h.CenterBottom=5]="CenterBottom",h[h.RightTop=6]="RightTop",h[h.RightCenter=7]="RightCenter",h[h.RightBottom=8]="RightBottom"}(r=a.TextAlignmentEnum||(a.TextAlignmentEnum={})),a.TextAlignment=class{static IsLeft(h){return h===r.LeftTop||h===r.LeftCenter||h===r.LeftBottom}static IsCenterAligned(h){return h===r.CenterTop||h===r.CenterCenter||h===r.CenterBottom}static IsRight(h){return h===r.RightTop||h===r.RightCenter||h===r.RightBottom}}},7119:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.TieTypes=void 0,(r=a.TieTypes||(a.TieTypes={})).SIMPLE="",r.HAMMERON="H",r.PULLOFF="P",r.SLIDE="S",r.TAPPING="T"},5544:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(2562),a),s(r(96),a),s(r(1274),a),s(r(7119),a)},7056:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.MXLHelper=void 0;const s=r(9228),m=h(r(5733)),c=h(r(2043));a.MXLHelper=class{static MXLtoIXmlElement(o){const u=new m.default;return u.loadAsync(o).then(d=>u.file("META-INF/container.xml").async("text"),d=>{throw d}).then(d=>{const x=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return u.file(x).async("text")},d=>{throw d}).then(d=>{const x=new DOMParser().parseFromString(d,"text/xml"),p=new s.IXmlElement(x.documentElement);return Promise.resolve(p)},d=>{throw d}).then(d=>d,d=>{throw new Error("extractSheetFromMxl: "+d.message)})}static MXLtoXMLstring(o){const u=new m.default;return u.loadAsync(o).then(d=>u.file("META-INF/container.xml").async("text"),d=>{throw c.default.error(d),d}).then(d=>{const x=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return u.file(x).async("text")},d=>{throw d})}}},9228:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IXmlElement=void 0;class r{constructor(s){if(this.hasAttributes=!1,!s)throw new Error("IXmlElement: expected Element, got undefined");this.elem=s,this.name=s.nodeName.toLowerCase(),s.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=s.attributes[0]),this.hasElements=s.hasChildNodes(),s.childNodes.length===1&&s.childNodes[0].nodeType===Node.TEXT_NODE?this.value=s.childNodes[0].nodeValue:this.value=""}attribute(s){return this.elem.attributes.getNamedItem(s)}attributes(){if(!this.attrs){const s=this.elem.attributes,m=[];for(let c=0;c0){let c;for(let o=0,u=m.length;o{Object.defineProperty(a,"__esModule",{value:!0}),a.StringUtil=void 0,a.StringUtil=class{static StringContainsSeparatedWord(r,h,s=!1){return new RegExp("( |^)"+h+"([ .]|$)",s?"i":void 0).test(r)}}},5205:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(8918),a),s(r(5544),a),s(r(9633),a)},1703:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidEnumArgumentException=a.ArgumentOutOfRangeException=a.MusicSheetReadingException=void 0,a.MusicSheetReadingException=class{constructor(r,h){this.message=r,h&&(this.message+=" "+h.toString())}},a.ArgumentOutOfRangeException=class{constructor(r){this.message=r}},a.InvalidEnumArgumentException=class{constructor(r){this.message=r}}},6791:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractGraphicalExpression=void 0;const h=r(4785),s=r(8911);class m extends h.GraphicalObject{constructor(o,u,d){super(),this.expression=u,this.parentMeasure=d,this.boundingBox=new s.BoundingBox(this,o.PositionAndShape),this.parentStaffLine=o,this.parentStaffLine.AbstractExpressions.push(this),this.rules=o.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}a.AbstractGraphicalExpression=m},6055:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractGraphicalInstruction=void 0;const h=r(4785);class s extends h.GraphicalObject{constructor(c){super(),this.parent=c}get Parent(){return this.parent}set Parent(c){this.parent=c}}a.AbstractGraphicalInstruction=s},1070:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AccidentalCalculator=void 0;const h=r(8640),s=r(8640),m=r(1649),c=r(4040);a.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new m.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new m.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(o){this.activeKeyInstruction=o,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const o of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(o,this.keySignatureNoteAlterationsDict.getValue(o))}checkAccidental(o,u){if(!u)return;const d=u.FundamentalNote+12*u.Octave,x=this.currentAlterationsComparedToKeyInstructionList.indexOf(d)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(d)){if(x&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(d),1),this.currentInMeasureNoteAlterationsDict.getValue(d)!==u.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(d)&&this.keySignatureNoteAlterationsDict.getValue(d)!==u.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(d),this.currentInMeasureNoteAlterationsDict.setValue(d,u.AccidentalHalfTones)):u.Accidental!==h.AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(d);const p=this.currentInMeasureNoteAlterationsDict.getValue(d);if(u.Accidental===h.AccidentalEnum.NONE&&(u=Math.abs(p)===.5?new s.Pitch(u.FundamentalNote,u.Octave,h.AccidentalEnum.NONE):new s.Pitch(u.FundamentalNote,u.Octave,h.AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(u.Accidental)&&!u.AccidentalXml)return;c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(o,u)}}else if(u.Accidental!==h.AccidentalEnum.NONE){if(x||this.currentAlterationsComparedToKeyInstructionList.push(d),this.currentInMeasureNoteAlterationsDict.setValue(d,u.AccidentalHalfTones),this.isAlterAmbiguousAccidental(u.Accidental)&&!u.AccidentalXml)return;c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(o,u)}else x&&(u=new s.Pitch(u.FundamentalNote,u.Octave,h.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(d),1),c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(o,u))}isAlterAmbiguousAccidental(o){return o===h.AccidentalEnum.SLASHFLAT||o===h.AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const o=this.activeKeyInstruction.AlteratedNotes;let u;u=this.activeKeyInstruction.Key>0?h.AccidentalEnum.SHARP:h.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let d=-9;d<9;d++)for(let x=0;xthis.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(p){this.borderMarginLeft=p,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(p){this.borderMarginTop=p,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(v,1)}this.parent=p,this.parent.ChildElements.indexOf(this)>-1?s.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new c.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let p=this.parent;for(;p;)this.absolutePosition.x+=p.relativePosition.x,this.absolutePosition.y+=p.relativePosition.y,p=p.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let p=0,v=this.ChildElements.length;p.001;break;case x.Up:case x.Down:T=this.relativePosition.y,p.calculateMarginPositionAlongDirection(this,v),P=Math.abs(T-this.relativePosition.y)>.001;break;default:throw new m.ArgumentOutOfRangeException("direction")}while(P)}collisionDetection(p){const v=Math.min(this.AbsolutePosition.x+this.borderRight,p.absolutePosition.x+p.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,p.absolutePosition.x+p.borderLeft),S=Math.min(this.AbsolutePosition.y+this.borderBottom,p.absolutePosition.y+p.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,p.absolutePosition.y+p.borderTop);return v>0&&S>0}liesInsideBorders(p){const v=this.AbsolutePosition.x+this.borderLeft<=p.absolutePosition.x+p.borderLeft&&p.absolutePosition.x+p.borderLeft<=this.AbsolutePosition.x+this.borderRight,S=this.AbsolutePosition.x+this.borderLeft<=p.absolutePosition.x+p.borderRight&&p.absolutePosition.x+p.borderRight<=this.AbsolutePosition.x+this.borderRight;if(v&&S){const T=this.AbsolutePosition.y+this.borderTop<=p.absolutePosition.y+p.borderTop&&p.absolutePosition.y+p.borderTop<=this.AbsolutePosition.y+this.borderBottom,P=this.AbsolutePosition.y+this.borderTop<=p.absolutePosition.y+p.borderBottom&&p.absolutePosition.y+p.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(T&&P)return!0}return!1}pointLiesInsideBorders(p){return this.AbsolutePosition.x+this.borderLeft<=p.x&&p.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=p.y&&p.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(p){const v=Math.min(this.AbsolutePosition.x+this.borderMarginRight,p.absolutePosition.x+p.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,p.absolutePosition.x+p.borderMarginLeft),S=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,p.absolutePosition.y+p.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,p.absolutePosition.y+p.borderMarginTop);return v>0&&S>0}liesInsideMargins(p){const v=this.AbsolutePosition.x+this.borderMarginLeft<=p.absolutePosition.x+p.borderMarginLeft&&p.absolutePosition.x+p.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,S=this.AbsolutePosition.x+this.borderMarginLeft<=p.absolutePosition.x+p.borderMarginRight&&p.absolutePosition.x+p.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(v&&S){const T=this.AbsolutePosition.y+this.borderMarginTop<=p.absolutePosition.y+p.borderMarginTop&&p.absolutePosition.y+p.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,P=this.AbsolutePosition.y+this.borderMarginTop<=p.absolutePosition.y+p.borderMarginBottom&&p.absolutePosition.y+p.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(T&&P)return!0}return!1}pointLiesInsideMargins(p){return this.AbsolutePosition.x+this.borderMarginLeft<=p.x&&p.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=p.y&&p.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(p,v,S){this.RelativePosition=new c.PointF2D(S.x,S.y),this.setAbsolutePositionFromParent();let T=0,P=!1;do switch(v){case x.Left:case x.Right:T=this.relativePosition.x,p.calculatePositionAlongDirection(this,v),P=Math.abs(T-this.relativePosition.x)>1e-4;break;case x.Up:case x.Down:T=this.relativePosition.y,p.calculatePositionAlongDirection(this,v),P=Math.abs(T-this.relativePosition.y)>1e-4;break;default:throw new m.ArgumentOutOfRangeException("direction")}while(P)}getClickedObjectOfType(p){const v=this.dataObject;if(this.pointLiesInsideBorders(p)&&v)return v;for(let S=0,T=this.childElements.length;S{Object.defineProperty(a,"__esModule",{value:!0}),a.Clickable=void 0;const h=r(4785);class s extends h.GraphicalObject{}a.Clickable=s},8155:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AutoColorSet=a.NoteState=a.GraphicalLayers=a.StyleSets=a.OUTLINE_AND_FILL_STYLE_DICT=a.OutlineAndFillStyleEnum=void 0;const h=r(1649);var s,m,c,o,u;(function(d){d[d.BaseWritingColor=0]="BaseWritingColor",d[d.FollowingCursor=1]="FollowingCursor",d[d.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",d[d.PlaybackCursor=3]="PlaybackCursor",d[d.Highlighted=4]="Highlighted",d[d.ErrorUnderlay=5]="ErrorUnderlay",d[d.Selected=6]="Selected",d[d.SelectionSymbol=7]="SelectionSymbol",d[d.DebugColor1=8]="DebugColor1",d[d.DebugColor2=9]="DebugColor2",d[d.DebugColor3=10]="DebugColor3",d[d.SplitScreenDivision=11]="SplitScreenDivision",d[d.GreyTransparentOverlay=12]="GreyTransparentOverlay",d[d.MarkedArea1=13]="MarkedArea1",d[d.MarkedArea2=14]="MarkedArea2",d[d.MarkedArea3=15]="MarkedArea3",d[d.MarkedArea4=16]="MarkedArea4",d[d.MarkedArea5=17]="MarkedArea5",d[d.MarkedArea6=18]="MarkedArea6",d[d.MarkedArea7=19]="MarkedArea7",d[d.MarkedArea8=20]="MarkedArea8",d[d.MarkedArea9=21]="MarkedArea9",d[d.MarkedArea10=22]="MarkedArea10",d[d.Comment1=23]="Comment1",d[d.Comment2=24]="Comment2",d[d.Comment3=25]="Comment3",d[d.Comment4=26]="Comment4",d[d.Comment5=27]="Comment5",d[d.Comment6=28]="Comment6",d[d.Comment7=29]="Comment7",d[d.Comment8=30]="Comment8",d[d.Comment9=31]="Comment9",d[d.Comment10=32]="Comment10"})(s=a.OutlineAndFillStyleEnum||(a.OutlineAndFillStyleEnum={})),a.OUTLINE_AND_FILL_STYLE_DICT=new h.Dictionary,a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.BaseWritingColor,"Thistle"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.FollowingCursor,"Aqua"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.AlternativeFollowingCursor,"Azure"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.PlaybackCursor,"Bisque"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Highlighted,"CadetBlue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.ErrorUnderlay,"DarkBlue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Selected,"DarkGoldenRod"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SelectionSymbol,"BlanchedAlmond"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor1,"Chartreuse"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor2,"DarkGreen"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor3,"DarkOrange"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SplitScreenDivision,"FireBrick"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.GreyTransparentOverlay,"DarkSalmon"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea1,"DarkSeaGreen"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea2,"DarkOrchid"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea3,"Aquamarine"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea4,"DarkKhaki"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea5,"ForestGreen"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea6,"AliceBlue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea7,"DeepPink"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea8,"Coral"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea9,"DarkOliveGreen"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea10,"Chocolate"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment1,"DodgerBlue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment2,"Blue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment3,"Beige"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment4,"Crimson"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment5,"Fuchsia"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment6,"Brown"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment7,"BlanchedAlmond"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment8,"CornflowerBlue"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment9,"Cornsilk"),a.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment10,"DarkGrey"),(u=a.StyleSets||(a.StyleSets={}))[u.MarkedArea=0]="MarkedArea",u[u.Comment=1]="Comment",(o=a.GraphicalLayers||(a.GraphicalLayers={}))[o.Background=0]="Background",o[o.Highlight=1]="Highlight",o[o.MeasureError=2]="MeasureError",o[o.SelectionSymbol=3]="SelectionSymbol",o[o.Cursor=4]="Cursor",o[o.PSI_Debug=5]="PSI_Debug",o[o.Notes=6]="Notes",o[o.Comment=7]="Comment",o[o.Debug_above=8]="Debug_above",(c=a.NoteState||(a.NoteState={}))[c.Normal=0]="Normal",c[c.Selected=1]="Selected",c[c.Follow_Confirmed=2]="Follow_Confirmed",c[c.QFeedback_NotFound=3]="QFeedback_NotFound",c[c.QFeedback_OK=4]="QFeedback_OK",c[c.QFeedback_Perfect=5]="QFeedback_Perfect",c[c.Debug1=6]="Debug1",c[c.Debug2=7]="Debug2",c[c.Debug3=8]="Debug3",(m=a.AutoColorSet||(a.AutoColorSet={})).C="#d82c6b",m.D="#F89D15",m.E="#FFE21A",m.F="#4dbd5c",m.G="#009D96",m.A="#43469d",m.B="#76429c",m.Rest="#000000"},5074:(b,a)=>{var r,h,s;Object.defineProperty(a,"__esModule",{value:!0}),a.PhonicScoreModes=a.MusicSymbolDrawingStyle=a.DrawingMode=void 0,(s=a.DrawingMode||(a.DrawingMode={}))[s.All=0]="All",s[s.NoOverlays=1]="NoOverlays",s[s.Leadsheet=2]="Leadsheet",(h=a.MusicSymbolDrawingStyle||(a.MusicSymbolDrawingStyle={}))[h.Normal=0]="Normal",h[h.Disabled=1]="Disabled",h[h.Selected=2]="Selected",h[h.Clickable=3]="Clickable",h[h.PlaybackSymbols=4]="PlaybackSymbols",h[h.FollowSymbols=5]="FollowSymbols",h[h.QFeedbackNotFound=6]="QFeedbackNotFound",h[h.QFeedbackOk=7]="QFeedbackOk",h[h.QFeedbackPerfect=8]="QFeedbackPerfect",h[h.Debug1=9]="Debug1",h[h.Debug2=10]="Debug2",h[h.Debug3=11]="Debug3",(r=a.PhonicScoreModes||(a.PhonicScoreModes={}))[r.Following=0]="Following",r[r.Midi=1]="Midi",r[r.Manual=2]="Manual"},7459:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DrawingParameters=a.DrawingParametersEnum=a.ColoringModes=void 0;const h=r(1405),s=r(3748);var m,c;(c=a.ColoringModes||(a.ColoringModes={}))[c.XML=0]="XML",c[c.AutoColoring=1]="AutoColoring",c[c.CustomColorSet=2]="CustomColorSet",function(o){o.allon="allon",o.compact="compact",o.compacttight="compacttight",o.default="default",o.leadsheet="leadsheet",o.preview="preview",o.thumbnail="thumbnail"}(m=a.DrawingParametersEnum||(a.DrawingParametersEnum={})),a.DrawingParameters=class{constructor(o=m.default,u){this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCopyright=!1,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=s.PlacementEnum.Left,this.drawHiddenNotes=!1,this.rules=u,this.rules||(this.rules=new h.EngravingRules),this.DrawingParametersEnum=o}set DrawingParametersEnum(o){switch(this.drawingParametersEnum=o,o){case m.allon:this.setForAllOn();break;case m.thumbnail:this.setForThumbnail();break;case m.leadsheet:this.setForLeadsheet();break;case m.compact:this.setForCompactMode();break;case m.compacttight:this.setForCompactTightMode();break;case m.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(o){this.drawCredits=o,this.DrawComposer=o,this.DrawTitle=o,this.DrawSubtitle=o,this.DrawLyricist=o,this.DrawCopyright=o}get DrawTitle(){return this.drawTitle}set DrawTitle(o){this.drawTitle=o,this.rules.RenderTitle=o,o||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(o){this.drawSubtitle=o,this.rules.RenderSubtitle=o,o&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(o){this.drawComposer=o,this.rules.RenderComposer=o}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(o){this.drawLyricist=o,this.rules.RenderLyricist=o}get DrawCopyright(){return this.drawCopyright}set DrawCopyright(o){this.drawCopyright=o,this.rules.RenderCopyright=o}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(o){this.drawPartNames=o,this.rules.RenderPartNames=o,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(o){this.fingeringPosition=o,this.rules.FingeringPosition=o}get Rules(){return this.rules}set Rules(o){this.rules=o}}},1405:function(b,a,r){var h=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(a,"__esModule",{value:!0}),a.PageFormat=a.EngravingRules=void 0;const s=r(599),m=h(r(2043)),c=r(1274),o=r(3748),u=r(41),d=r(7459),x=r(1649),p=r(5544),v=r(8640),S=r(4123),T=r(3486);class P{constructor(){this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.RenderCount=0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*P.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.SheetCopyrightHeight=1.5,this.SheetCopyrightMargin=2,this.SheetComposerSubtitleUseLegacyParsing=!1,this.CompactMode=!1,this.PagePlacementEnum=s.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=P.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=P.unit/2,this.BeamSpaceWidth=P.unit/3,this.BeamForwardLength=1.25*P.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.PercussionUseCajon2NoteSystem=!1,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.GraceNoteGroupXMargin=0,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.SoftAccentWedgePadding=.4,this.SoftAccentSizeFactor=.6,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=c.TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolExtraXShiftForShortChordSymbols=.3,this.ChordSymbolExtraXShiftWidthThreshold=2,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolWholeMeasureRestXOffset=0,this.ChordSymbolWholeMeasureRestXOffsetMeasure1=-2,this.ChordAccidentalTexts=new x.Dictionary,this.resetChordAccidentalTexts(this.ChordAccidentalTexts,!1),this.ChordSymbolLabelTexts=new x.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RepetitionEndInstructionXShiftAsPercentOfStaveWidth=.4,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*P.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletsBracketedUseXMLValue=!0,this.TupletNumberLabelHeight=1.5*P.unit,this.TupletNumberYOffset=.5,this.TupletNumberLimitConsecutiveRepetitions=!0,this.TupletNumberMaxConsecutiveRepetitions=2,this.TupletNumberAlwaysDisableAfterFirstMax=!0,this.TupletNumberUseShowNoneXMLValue=!0,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.TabBeamsRendered=!0,this.TabKeySignatureRendered=!1,this.TabKeySignatureSpacingAdded=!0,this.TabTimeSignatureRendered=!1,this.TabTimeSignatureSpacingAdded=!0,this.TabFingeringsRendered=!1,this.SlurPlacementFromXML=!0,this.SlurPlacementAtStems=!1,this.SlurPlacementUseSkyBottomLine=!1,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurEndArticulationYOffset=.8,this.SlurStartArticulationYOffsetOfArticulation=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.GlissandoNoteOffset=.5,this.GlissandoStafflineStartMinimumWidth=1,this.GlissandoStafflineStartYDistanceToNote=.8,this.GlissandoStafflineEndOffset=1,this.GlissandoDefaultWidth=.1,this.RepetitionAllowFirstMeasureBeginningRepeatBarline=!0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=c.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.LyricsYMarginToBottomLine=.2,this.LyricsExtraXShiftForShortLyrics=.5,this.LyricsExtraXShiftForShortLyricsWidthThreshold=1.4,this.LyricsUseXPaddingForLongLyrics=!0,this.LyricsXPaddingFactorForLongLyrics=1,this.LyricsXPaddingWidthThreshold=1.7,this.LyricsXPaddingReductionForLongNotes=.7,this.LyricsXPaddingReductionForLastNoteInMeasure=1.2,this.LyricsXPaddingForLastNoteInMeasure=!0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.TempoYSpacing=.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.IgnoreRepeatedDynamics=!1,this.ExpressionsUseXMLColor=!0,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.TremoloBuzzRollThickness=.25,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=P.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=P.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=P.unit,this.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure=!1,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MultipleRestMeasureAddKeySignature=!0,this.FixedMeasureWidth=!1,this.FixedMeasureWidthFixedValue=void 0,this.FixedMeasureWidthUseForPickupMeasures=!1,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.PickupMeasureRepetitionSpacing=.8,this.PickupMeasureSpacingSingleNoteAddend=1.6,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-1,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=u.AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=u.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.RenderGlissandi=!0,this.ColoringMode=d.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=p.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderCopyright=!1,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderSystemLabelsAfterFirstPage=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMultipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.RenderPedals=!0,this.ArticulationPlacementFromXML=!0,this.BreathMarkDistance=.8,this.FingeringPosition=o.PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=o.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.NewSystemAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,this.IgnoreBracketsWords=!0,this.PlaceWordsInsideStafflineFromXml=!1,this.PlaceWordsInsideStafflineYOffset=.9,this.PageFormat=_.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new x.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0,this.SkyBottomLineBatchMinMeasures=5,this.SkyBottomLineWebGLMinMeasures=80,this.AlwaysSetPreferredSkyBottomLineBackendAutomatically=!0,this.DisableWebGLInFirefox=!0,this.DisableWebGLInSafariAndIOS=!0,this.setPreferredSkyBottomLineBackendAutomatically();try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(M){m.default.info("EngravingRules()",M)}}setPreferredSkyBottomLineBackendAutomatically(M=-1){var N,I,R,V;let U="",K="";typeof globalThis=="object"&&(U=(I=(N=globalThis.navigator)===null||N===void 0?void 0:N.vendor)!==null&&I!==void 0?I:"",K=(V=(R=globalThis.navigator)===null||R===void 0?void 0:R.userAgent)!==null&&V!==void 0?V:"");let k=!1;(this.DisableWebGLInSafariAndIOS&&/apple/i.test(U)||this.DisableWebGLInFirefox&&K.includes("Firefox"))&&(k=!0),this.PreferredSkyBottomLineBatchCalculatorBackend=u.SkyBottomLineBatchCalculatorBackendType.Plain,k||M>=this.SkyBottomLineWebGLMinMeasures&&(this.PreferredSkyBottomLineBatchCalculatorBackend=u.SkyBottomLineBatchCalculatorBackendType.WebGL)}applyDefaultColorMusic(M){this.DefaultColorMusic=M,this.DefaultColorNotehead=M,this.DefaultColorRest=M,this.DefaultColorStem=M,this.DefaultColorLabel=M,this.DefaultColorLyrics=M,this.DefaultColorTitle=M,this.LedgerLineColorDefault=M}addGraphicalNoteToNoteMap(M,N){M.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(M.NoteToGraphicalNoteObjectId,N),this.NoteToGraphicalNoteMapObjectCount++}GNote(M){return T.GraphicalNote.FromNote(M,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new x.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}resetChordAccidentalTexts(M,N){M.setValue(v.AccidentalEnum.SHARP,N?"♯":"#"),M.setValue(v.AccidentalEnum.FLAT,N?"♭":"b"),M.setValue(v.AccidentalEnum.DOUBLEFLAT,N?"𝄫":"bb"),M.setValue(v.AccidentalEnum.DOUBLESHARP,N?"𝄪":"x")}setChordSymbolLabelText(M,N){this.ChordSymbolLabelTexts.setValue(M,N)}resetChordSymbolLabelTexts(M){return M.setValue(S.ChordSymbolEnum.minor,"m"),M.setValue(S.ChordSymbolEnum.augmented,"aug"),M.setValue(S.ChordSymbolEnum.diminished,"dim"),M.setValue(S.ChordSymbolEnum.dominant,"7"),M.setValue(S.ChordSymbolEnum.majorseventh,"maj7"),M.setValue(S.ChordSymbolEnum.minorseventh,"m7"),M.setValue(S.ChordSymbolEnum.diminishedseventh,"dim7"),M.setValue(S.ChordSymbolEnum.augmentedseventh,"aug7"),M.setValue(S.ChordSymbolEnum.halfdiminished,`m7${this.ChordAccidentalTexts.getValue(v.AccidentalEnum.FLAT)}5`),M.setValue(S.ChordSymbolEnum.majorminor,"m(maj7)"),M.setValue(S.ChordSymbolEnum.majorsixth,"maj6"),M.setValue(S.ChordSymbolEnum.minorsixth,"m6"),M.setValue(S.ChordSymbolEnum.dominantninth,"9"),M.setValue(S.ChordSymbolEnum.majorninth,"maj9"),M.setValue(S.ChordSymbolEnum.minorninth,"m9"),M.setValue(S.ChordSymbolEnum.dominant11th,"11"),M.setValue(S.ChordSymbolEnum.major11th,"maj11"),M.setValue(S.ChordSymbolEnum.minor11th,"m11"),M.setValue(S.ChordSymbolEnum.dominant13th,"13"),M.setValue(S.ChordSymbolEnum.major13th,"maj13"),M.setValue(S.ChordSymbolEnum.minor13th,"m13"),M.setValue(S.ChordSymbolEnum.suspendedsecond,"sus2"),M.setValue(S.ChordSymbolEnum.suspendedfourth,"sus4"),M.setValue(S.ChordSymbolEnum.power,"5"),M.setValue(S.ChordSymbolEnum.none,"N.C."),M}addChordName(M,N,I,R,V){if(S.ChordSymbolEnum[N]!==void 0){const U={adds:I,alts:R,subs:V};this.CustomChords.push(S.CustomChord.createCustomChord(M,S.ChordSymbolEnum[N],U))}}renameChord(M,N){S.CustomChord.renameCustomChord(M,N,this.CustomChords)}resetChordNames(){const M=this.ChordAccidentalTexts.getValue(v.AccidentalEnum.SHARP),N=this.ChordAccidentalTexts.getValue(v.AccidentalEnum.FLAT);this.addChordName("alt","major",[`${M}5`,`${N}9`,`${M}9`],[`${N}5`],[]),this.addChordName("7alt","dominant",[`${M}5`,`${N}9`,`${M}9`],[`${N}5`],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName(`m7${N}5`,"minorseventh",[],[`${N}5`],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let M=0;M{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalChordSymbolContainer=void 0;const h=r(2255),s=r(9946),m=r(4123),c=r(8911),o=r(4785),u=r(9086);class d extends o.GraphicalObject{constructor(p,v,S,T,P,_){super(),this.chordSymbolContainer=p,this.boundingBox=new c.BoundingBox(this,v),this.rules=_,this.calculateLabel(S,P,T)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(p,v,S){const T=m.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,v,S);this.graphicalLabel=new s.GraphicalLabel(new h.Label(T),p,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new u.PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}a.GraphicalChordSymbolContainer=d},3442:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalComment=void 0,a.GraphicalComment=class{constructor(r,h){this.label=r,this.settings=h}}},374:function(b,a,r){var h=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalContinuousDynamicExpression=void 0;const s=r(6729),m=r(7839),c=r(9086),o=r(6791),u=r(3748),d=h(r(2043));class x extends o.AbstractGraphicalExpression{constructor(v,S,T){super(S,v,T),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(v){this.startMeasure=v}get EndMeasure(){return this.endMeasure}set EndMeasure(v){this.endMeasure=v}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(v){this.isSplittedPart=v}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(v){this.notToBeRemoved=v}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var v;const S=this.parentStaffLine.SkyBottomLineCalculator,T=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,P=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsSoftAccent&&!this.IsVerbal&&this.lines.length<2&&d.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==m.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==m.ContDynamicEnum.diminuendo&&d.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+((v=this.startMeasure)===null||v===void 0?void 0:v.MeasureNumber)),this.Placement){case u.PlacementEnum.Above:if(this.IsSoftAccent)S.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End),S.updateSkyLineWithWedge(this.lines[2].End,this.lines[2].Start),S.updateSkyLineWithLine(this.lines[0].End,this.lines[2].End,this.lines[0].End.y);else if(this.IsVerbal){const _=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;S.updateSkyLineInRange(T,P,_)}else this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?S.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.diminuendo&&S.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case u.PlacementEnum.Below:if(this.IsVerbal){const _=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;S.updateBottomLineInRange(T,P,_)}else this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?S.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.diminuendo&&S.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:d.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(v,S,T,P=this.rules.WedgeOpeningLength,_=this.rules.WedgeLineWidth){const E=new c.PointF2D(v,T),M=new c.PointF2D(S,T-P/2),N=new c.PointF2D(S,T+P/2);this.addWedgeLines(E,M,N,_)}createFirstHalfCrescendoLines(v,S,T,P=this.rules.WedgeMeasureEndOpeningLength,_=this.rules.WedgeLineWidth){const E=new c.PointF2D(v,T),M=new c.PointF2D(S,T-P/2),N=new c.PointF2D(S,T+P/2);this.addWedgeLines(E,M,N,_)}createSecondHalfCrescendoLines(v,S,T,P=this.rules.WedgeMeasureBeginOpeningLength,_=this.rules.WedgeOpeningLength,E=this.rules.WedgeLineWidth){const M=new c.PointF2D(v,T-P/2),N=new c.PointF2D(v,T+P/2),I=new c.PointF2D(S,T-_/2),R=new c.PointF2D(S,T+_/2);this.addDoubleLines(M,I,N,R,E)}recalculateCrescendoLines(v,S,T){const P=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),P?this.createSecondHalfCrescendoLines(v,S,T):this.isSplittedPart?this.createFirstHalfCrescendoLines(v,S,T):this.createCrescendoLines(v,S,T)}createDiminuendoLines(v,S,T,P=this.rules.WedgeOpeningLength,_=this.rules.WedgeLineWidth){const E=new c.PointF2D(v,T-P/2),M=new c.PointF2D(v,T+P/2),N=new c.PointF2D(S,T);this.addWedgeLines(N,E,M,_)}createFirstHalfDiminuendoLines(v,S,T,P=this.rules.WedgeOpeningLength,_=this.rules.WedgeMeasureEndOpeningLength,E=this.rules.WedgeLineWidth){const M=new c.PointF2D(v,T-P/2),N=new c.PointF2D(v,T+P/2),I=new c.PointF2D(S,T-_/2),R=new c.PointF2D(S,T+_/2);this.addDoubleLines(M,I,N,R,E)}createSecondHalfDiminuendoLines(v,S,T,P=this.rules.WedgeMeasureBeginOpeningLength,_=this.rules.WedgeLineWidth){const E=new c.PointF2D(v,T-P/2),M=new c.PointF2D(v,T+P/2),N=new c.PointF2D(S,T);this.addWedgeLines(N,E,M,_)}recalculateDiminuendoLines(v,S,T){const P=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),P?this.createFirstHalfDiminuendoLines(v,S,T):this.isSplittedPart?this.createSecondHalfDiminuendoLines(v,S,T):this.createDiminuendoLines(v,S,T)}createFirstHalfLines(v,S,T,P=this.rules.WedgeOpeningLength,_=this.rules.WedgeMeasureEndOpeningLength,E=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?this.createFirstHalfCrescendoLines(v,S,T,_,E):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.diminuendo&&this.createFirstHalfDiminuendoLines(v,S,T,P,_,E)}createSecondHalfLines(v,S,T,P=this.rules.WedgeMeasureBeginOpeningLength,_=this.rules.WedgeOpeningLength,E=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?this.createSecondHalfCrescendoLines(v,S,T,P,_,E):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.diminuendo&&this.createSecondHalfDiminuendoLines(v,S,T,P,E)}createLines(v,S,T,P=this.rules.WedgeOpeningLength,_=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?this.createCrescendoLines(v,S,T,P,_):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.diminuendo&&this.createDiminuendoLines(v,S,T,P,_)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.IsSoftAccent?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[3].Start.x-this.lines[0].Start.x):this.ContinuousDynamic.DynamicType===m.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(v){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=v,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=v,this.lines[0].End.y+=v,this.lines[1].End.y+=v)}squeeze(v){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=v:(this.lines[0].End.x+=v,this.lines[1].End.x+=v):v<0?this.lines[0].Start.x+=v:(this.lines[0].End.x+=v,this.lines[1].End.x+=v),this.calcPsi())}addWedgeLines(v,S,T,P){const _=new s.GraphicalLine(v,S,P),E=new s.GraphicalLine(v,T,P);this.rules.DefaultColorMusic&&(_.colorHex=this.rules.DefaultColorMusic,E.colorHex=this.rules.DefaultColorMusic),this.lines.push(_),this.lines.push(E)}addDoubleLines(v,S,T,P,_){const E=new s.GraphicalLine(v,S,_),M=new s.GraphicalLine(T,P,_);this.rules.DefaultColorMusic&&(E.colorHex=this.rules.DefaultColorMusic,M.colorHex=this.rules.DefaultColorMusic),this.lines.push(E),this.lines.push(M)}}a.GraphicalContinuousDynamicExpression=x},5330:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalCurve=void 0;const h=r(9086);class s{constructor(){s.tPow3=new Array(s.bezierCurveStepSize),s.oneMinusTPow3=new Array(s.bezierCurveStepSize),s.bezierFactorOne=new Array(s.bezierCurveStepSize),s.bezierFactorTwo=new Array(s.bezierCurveStepSize);for(let c=0;c=s.bezierCurveStepSize?new h.PointF2D:new h.PointF2D(s.oneMinusTPow3[o]*this.bezierStartPt.x+s.bezierFactorOne[o]*this.bezierStartControlPt.x+s.bezierFactorTwo[o]*this.bezierEndControlPt.x+s.tPow3[o]*this.bezierEndPt.x,s.oneMinusTPow3[o]*this.bezierStartPt.y+s.bezierFactorOne[o]*this.bezierStartControlPt.y+s.bezierFactorTwo[o]*this.bezierEndControlPt.y+s.tPow3[o]*this.bezierEndPt.y)}}a.GraphicalCurve=s,s.bezierCurveStepSize=1e3},1443:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalGlissando=void 0;const h=r(9086),s=r(8911),m=r(6729);a.GraphicalGlissando=class{constructor(c){this.Glissando=c,this.staffEntries=[]}calculateLine(c){const o=this.staffEntries[0],u=this.staffEntries[this.staffEntries.length-1],d=o.findGraphicalNoteFromNote(this.Glissando.StartNote),x=u.findGraphicalNoteFromNote(this.Glissando.EndNote);if(!d&&!x)return;const p=o.parentMeasure.ParentStaffLine;let v,S,T,P;if(d&&o.parentMeasure.ParentStaffLine===this.StaffLine)v=d.PositionAndShape.RelativePosition.x+d.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+d.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x+c.GlissandoNoteOffset,T=d.PositionAndShape.AbsolutePosition.y;else{v=u.parentMeasure.beginInstructionsWidth-.4;const M=this.Glissando.Direction===s.ColDirEnum.Down?-1:1;T=x.PositionAndShape.AbsolutePosition.y+M*c.GlissandoStafflineStartYDistanceToNote}if(x&&u.parentMeasure.ParentStaffLine===this.StaffLine)S=x.PositionAndShape.RelativePosition.x+x.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+x.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x-.5-c.GlissandoNoteOffset,v>S&&(v=S-c.GlissandoStafflineStartMinimumWidth),P=x.PositionAndShape.AbsolutePosition.y;else{if(p.Measures.last().parentSourceMeasure.HasEndLine)return;S=p.PositionAndShape.Size.width,S-v>c.GlissandoStafflineEndOffset&&(v=S-c.GlissandoStafflineEndOffset);const M=this.Glissando.Direction===s.ColDirEnum.Down?1:-1;P=d.PositionAndShape.AbsolutePosition.y+M*c.GlissandoStafflineStartYDistanceToNote}const _=new h.PointF2D(v,T),E=new h.PointF2D(S,P);this.Width===void 0&&(this.Width=c.GlissandoDefaultWidth),this.Line=new m.GraphicalLine(_,E,this.Width)}}},9428:function(b,a,r){var h=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalInstantaneousDynamicExpression=void 0;const s=r(6791),m=r(3748),c=h(r(2043));class o extends s.AbstractGraphicalExpression{constructor(d,x,p){super(x,d,p.parentSourceMeasure),this.mInstantaneousDynamicExpression=d,this.mMeasure=p}updateSkyBottomLine(){const d=this.parentStaffLine.SkyBottomLineCalculator,x=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,p=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let v=0;switch(this.Placement){case m.PlacementEnum.Above:v=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,d.updateSkyLineInRange(x,p,v);break;case m.PlacementEnum.Below:v=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,d.updateBottomLineInRange(x,p,v);break;default:c.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}a.GraphicalInstantaneousDynamicExpression=o},5277:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalInstantaneousTempoExpression=void 0;const h=r(6791);class s extends h.AbstractGraphicalExpression{constructor(c,o){super(o.PositionAndShape.Parent.DataObject,c,c.parentMeasure),this.label=o}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}a.GraphicalInstantaneousTempoExpression=s},9946:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalLabel=void 0;const h=r(1274),s=r(8911),m=r(4278),c=r(4040);class o extends m.Clickable{constructor(d,x,p,v,S=void 0){super(),this.CenteringXShift=0,this.label=d,this.boundingBox=new s.BoundingBox(this,S),this.label.fontHeight=x,this.label.textAlignment=p,this.rules=v}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var d,x;if(this.Label.text.trim()==="")return;this.TextLines=[];const p=(x=(d=this.rules)===null||d===void 0?void 0:d.LabelMarginBorderFactor)!==null&&x!==void 0?x:.1,v=this.Label.text.split(/[\n\r]+/g),S=v.length;let T=0;for(let E=0;E0&&this.TextLines.length>1&&(P+=this.rules.SpacingBetweenTextLines*S/10);const _=this.PositionAndShape;switch(this.Label.textAlignment){case h.TextAlignmentEnum.CenterBottom:_.BorderTop=-P,_.BorderLeft=-T/2,_.BorderBottom=0,_.BorderRight=T/2;break;case h.TextAlignmentEnum.CenterCenter:_.BorderTop=-P/2,_.BorderLeft=-T/2,_.BorderBottom=P/2,_.BorderRight=T/2;break;case h.TextAlignmentEnum.CenterTop:_.BorderTop=0,_.BorderLeft=-T/2,_.BorderBottom=P,_.BorderRight=T/2;break;case h.TextAlignmentEnum.LeftBottom:_.BorderTop=-P,_.BorderLeft=0,_.BorderBottom=0,_.BorderRight=T;break;case h.TextAlignmentEnum.LeftCenter:_.BorderTop=-P/2,_.BorderLeft=0,_.BorderBottom=P/2,_.BorderRight=T;break;case h.TextAlignmentEnum.LeftTop:_.BorderTop=0,_.BorderLeft=0,_.BorderBottom=P,_.BorderRight=T;break;case h.TextAlignmentEnum.RightBottom:_.BorderTop=-P,_.BorderLeft=-T,_.BorderBottom=0,_.BorderRight=0;break;case h.TextAlignmentEnum.RightCenter:_.BorderTop=-P/2,_.BorderLeft=-T,_.BorderBottom=P/2,_.BorderRight=0;break;case h.TextAlignmentEnum.RightTop:_.BorderTop=0,_.BorderLeft=-T,_.BorderBottom=P,_.BorderRight=0}_.BorderMarginTop=_.BorderTop-P*p,_.BorderMarginLeft=_.BorderLeft-P*p,_.BorderMarginBottom=_.BorderBottom+P*p,_.BorderMarginRight=_.BorderRight+P*p}}a.GraphicalLabel=o},6729:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalLine=void 0;const h=r(8155);a.GraphicalLine=class{constructor(s,m,c=0,o=h.OutlineAndFillStyleEnum.BaseWritingColor,u=void 0){this.start=s,this.end=m,this.width=c,this.styleId=o,this.colorHex=u}get Start(){return this.start}set Start(s){this.start=s}get End(){return this.end}set End(s){this.end=s}get Width(){return this.width}set Width(s){this.width=s}}},5091:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalLyricEntry=void 0;const h=r(9946),s=r(2255),m=r(9086),c=r(1274);a.GraphicalLyricEntry=class{constructor(o,u,d,x){this.lyricsEntry=o,this.graphicalStaffEntry=u;const p=u.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;o.Text.length>=4&&o.Parent.Notes[0].Length.Denominator>4&&c.TextAlignmentEnum.LeftBottom;const v=new s.Label(o.Text),S=this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules;this.graphicalLabel=new h.GraphicalLabel(v,d,p,S,u.PositionAndShape),this.graphicalLabel.Label.colorDefault=S.DefaultColorLyrics,this.graphicalLabel.PositionAndShape.RelativePosition=new m.PointF2D(0,x),this.graphicalLabel.setLabelPositionAndShapeBorders(),this.graphicalLabel.PositionAndShape.Size.width1&&o{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalLyricWord=void 0,a.GraphicalLyricWord=class{constructor(r){this.graphicalLyricsEntries=[],this.lyricWord=r,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(r){this.graphicalLyricsEntries=r}isFilled(){for(let r=0;r{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalMarkedArea=void 0,a.GraphicalMarkedArea=class{constructor(r,h=void 0,s=void 0,m=void 0){this.systemRectangle=r,this.labelRectangle=h,this.label=s,this.settings=m}}},1513:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalMeasure=void 0;const h=r(4785),s=r(1797),m=r(8911),c=r(9086);class o extends h.GraphicalObject{constructor(d=void 0,x=void 0,p=void 0){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.ShowTimeSignature=!0,this.ShowKeySignature=!0,this.isTabMeasure=!1,this.parentStaff=d,this.parentSourceMeasure=x,this.parentStaffLine=p,p?(this.parentStaff=p.ParentStaff,this.PositionAndShape=new m.BoundingBox(this,p.PositionAndShape)):this.PositionAndShape=new m.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(d){this.parentMusicSystem=d}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(d){this.firstInstructionStaffEntry=d}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(d){this.lastInstructionStaffEntry=d}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(d){this.parentStaffLine=d,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(d){throw new Error("not implemented")}addClefAtBegin(d){throw new Error("not implemented")}addKeyAtBegin(d,x,p){throw new Error("not implemented")}addRhythmAtBegin(d){throw new Error("not implemented")}addClefAtEnd(d,x=!0){throw new Error("not implemented")}setPositionInStaffline(d){this.PositionAndShape.RelativePosition=new c.PointF2D(d,0)}setWidth(d){this.PositionAndShape.BorderRight=d}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(d){var x;for(let p=0,v=this.staffEntries.length;p1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let d=new s.Fraction(0,1);const x=[];for(let p=0,v=this.staffEntries.length;p0&&T.Add(_.notes[0].graphicalNoteLength);d.lt(T)&&(d=s.Fraction.createFromFraction(T))}return d}addGraphicalStaffEntry(d){this.staffEntries.push(d)}addGraphicalStaffEntryAtTimestamp(d){if(d)if(this.staffEntries.length===0||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(d.relInMeasureTimestamp))this.staffEntries.push(d);else for(let x=this.staffEntries.length-1;x>=0;x--){if(this.staffEntries[x].relInMeasureTimestamp.lt(d.relInMeasureTimestamp)){this.staffEntries.splice(x+1,0,d);break}x===0&&this.staffEntries.splice(x,0,d)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length!==1&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const d=this.parentSourceMeasure;return!!d&&d.beginsWithLineRepetition()}endsWithLineRepetition(){const d=this.parentSourceMeasure;return!!d&&d.endsWithLineRepetition()}beginsWithWordRepetition(){const d=this.parentSourceMeasure;return!!d&&d.beginsWithWordRepetition()}endsWithWordRepetition(){const d=this.parentSourceMeasure;return!!d&&d.endsWithWordRepetition()}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}a.GraphicalMeasure=o},599:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PagePlacementEnum=a.GraphicalMusicPage=void 0;const h=r(8911),s=r(4785),m=r(9086);class c extends s.GraphicalObject{constructor(d){super(),this.musicSystems=[],this.labels=[],this.parent=d,this.boundingBox=new h.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(d){this.musicSystems=d}get Labels(){return this.labels}set Labels(d){this.labels=d}get Parent(){return this.parent}set Parent(d){this.parent=d}get PageNumber(){return this.pageNumber}set PageNumber(d){this.pageNumber=d}setMusicPageAbsolutePosition(d,x){return new m.PointF2D(0,0)}}var o;a.GraphicalMusicPage=c,(o=a.PagePlacementEnum||(a.PagePlacementEnum={}))[o.Down=0]="Down",o[o.Right=1]="Right",o[o.RightDown=2]="RightDown"},4324:function(b,a,r){var h=this&&this.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(a,"__esModule",{value:!0}),a.SystemImageProperties=a.GraphicalMusicSheet=void 0;const s=r(525),m=r(6729),c=r(9086),o=r(289),u=r(5198),d=r(1797),x=r(8911),p=h(r(2043)),v=r(2337),S=r(5974),T=r(4785);a.GraphicalMusicSheet=class{constructor(P,_){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=P,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=_,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(P){this.musicPages=P}get MeasureList(){return this.measureList}set MeasureList(P){this.measureList=P}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(P){this.verticalGraphicalStaffEntryContainers=P}get Title(){return this.title}set Title(P){this.title=P}get Subtitle(){return this.subtitle}set Subtitle(P){this.subtitle=P}get Composer(){return this.composer}set Composer(P){this.composer=P}get Lyricist(){return this.lyricist}set Lyricist(P){this.lyricist=P}get Copyright(){return this.copyright}set Copyright(P){this.copyright=P}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(P){this.minAllowedSystemWidth=P}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(P){this.leadSheet=P}static transformRelativeToAbsolutePosition(P){for(let _=0;_=0;M--){const N=(E=this.measureList[M])===null||E===void 0?void 0:E[_];if(N)return N}}findGraphicalStaffEntryFromMeasureList(P,_,E){for(let M=_;M0)return I.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(P,_){const E=[],M=this.measureList[0].length;for(let N=P;N<=_;N++)for(let I=0;I=0;_--){if(this.verticalGraphicalStaffEntryContainers[_].AbsoluteTimestamp.lt(P)){const E=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,P);return this.verticalGraphicalStaffEntryContainers.splice(_+1,0,E),E}if(this.verticalGraphicalStaffEntryContainers[_].AbsoluteTimestamp.Equals(P))return this.verticalGraphicalStaffEntryContainers[_]}}GetVerticalContainerFromTimestamp(P,_=0){const E=v.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new s.VerticalGraphicalStaffEntryContainer(0,P),s.VerticalGraphicalStaffEntryContainer.compareByTimestamp,_);if(E>=0)return this.verticalGraphicalStaffEntryContainers[E]}GetInterpolatedIndexInVerticalContainers(P){const _=this.verticalGraphicalStaffEntryContainers;if(_.length===1)return 0;let E,M,N=0,I=_.length-1;if(P.lte(_[_.length-1].AbsoluteTimestamp)){for(;I-N>1;){const U=Math.floor((I+N)/2);if(_[N].AbsoluteTimestamp.Equals(P)){I=N;break}if(_[I].AbsoluteTimestamp.Equals(P)){N=I;break}if(_[U].AbsoluteTimestamp.Equals(P))return this.verticalGraphicalStaffEntryContainers.indexOf(_[U]);P.lt(_[U].AbsoluteTimestamp)?I=U:N=U}if(N===I)return this.verticalGraphicalStaffEntryContainers.indexOf(_[N]);E=_[N].AbsoluteTimestamp,M=_[I].AbsoluteTimestamp}else E=_[_.length-1].AbsoluteTimestamp,M=d.Fraction.plus(this.getLongestStaffEntryDuration(_.length-1),E),I=_.length;const R=M.RealValue-E.RealValue,V=I-(M.RealValue-P.RealValue)/R;return Math.min(V,this.verticalGraphicalStaffEntryContainers.length-1)}getVisibleStavesIndicesFromSourceMeasure(P){const _=[],E=[];for(let M=0,N=P.length;M=0;)M=this.measureList[--E][P];return this.measureList[E][P]}getMeasureIndex(P,_,E){for(_=0;_{var E;return((E=_.parentStaffEntry)===null||E===void 0?void 0:E.relInMeasureTimestamp)!==void 0})}GetNearestNote(P,_){const E=this.GetNearestVoiceEntry(P);if(!E)return;let M,N=Number.MAX_SAFE_INTEGER;for(const I of E.notes){const R=I.PositionAndShape.AbsolutePosition.y,V=Math.abs(I.PositionAndShape.AbsolutePosition.x-P.x),U=Math.abs(R-P.y);V+UI.PositionAndShape.RelativePosition.x&&(E=I):E=I)}}catch(M){p.default.info("GraphicalMusicSheet.getStaffEntry",M)}return E}GetPreviousVisibleContainerIndex(P){for(let _=P-1;_>=0;_--){const E=this.verticalGraphicalStaffEntryContainers[_].StaffEntries;for(let M=0,N=E.length;M=0;N--)if(E=this.getStaffEntry(N),E&&(!_||E.sourceStaffEntry.ParentStaff.ParentInstrument.Visible))return E}findClosestRightStaffEntry(P,_){let E;for(let M=Math.max(0,Math.ceil(P));M{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalNote=void 0;const h=r(8640),s=r(4785),m=r(4040),c=r(8911);class o extends s.GraphicalObject{constructor(d,x,p,v=void 0){super(),this.DrawnAccidental=h.AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=d,this.parentVoiceEntry=x,this.PositionAndShape=new c.BoundingBox(this,x.PositionAndShape),this.graphicalNoteLength=v||d.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=p,this.rules.addGraphicalNoteToNoteMap(d,this)}Transpose(d,x,p,v){let S=this.sourceNote.Pitch;return m.MusicSheetCalculator.transposeCalculator&&(S=m.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,d,p)),S}calculateNumberOfNeededDots(d){return this.sourceNote&&this.sourceNote.NoteTuplet?0:d.calculateNumberOfNeededDots()}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(d,x){return x.NoteToGraphicalNoteMap.getValue(d.NoteToGraphicalNoteObjectId)}ToStringShort(d=0){var x;return(x=this.sourceNote)===null||x===void 0?void 0:x.ToStringShort(d)}get ToStringShortGet(){return this.ToStringShort(0)}}a.GraphicalNote=o},4785:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalObject=void 0;const h=r(1035);class s extends h.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(c){this.boundingBox=c}}a.GraphicalObject=s},873:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalOctaveShift=void 0;const h=r(4785),s=r(5853),m=r(8911),c=r(158),o=r(1703);class u extends h.GraphicalObject{constructor(x,p){super(),this.getOctaveShift=x,this.setSymbol(),this.PositionAndShape=new m.BoundingBox(this,p)}setSymbol(){switch(this.getOctaveShift.Type){case s.OctaveEnum.VA8:this.octaveSymbol=c.MusicSymbol.VA8;break;case s.OctaveEnum.VB8:this.octaveSymbol=c.MusicSymbol.VB8;break;case s.OctaveEnum.MA15:this.octaveSymbol=c.MusicSymbol.MA15;break;case s.OctaveEnum.MB15:this.octaveSymbol=c.MusicSymbol.MB15;break;default:throw new o.ArgumentOutOfRangeException("")}}}a.GraphicalOctaveShift=u},4082:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalPedal=void 0;const h=r(4785),s=r(8911),m=r(158);class c extends h.GraphicalObject{constructor(u,d){super(),this.getPedal=u,this.setSymbol(),this.PositionAndShape=new s.BoundingBox(this,d)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=m.MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=m.MusicSymbol.PEDAL_MIXED:this.pedalSymbol=m.MusicSymbol.PEDAL_BRACKET}}a.GraphicalPedal=c},3411:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalRectangle=void 0;const h=r(8911),s=r(4785);class m extends s.GraphicalObject{constructor(o,u,d,x){super(),this.boundingBox=new h.BoundingBox(this,d),this.boundingBox.RelativePosition=o,this.boundingBox.BorderRight=u.x-o.x,this.boundingBox.BorderBottom=u.y-o.y,this.style=x}}a.GraphicalRectangle=m},9876:function(b,a,r){var h=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalSlur=void 0;const s=r(9086),m=r(5330),c=r(3748),o=r(8363),u=r(2947),d=r(1797),x=r(908);var p=h(r(6368)).default.Flow;class v extends m.GraphicalCurve{constructor(T,P){super(),this.staffEntries=[],this.slur=T,this.rules=P}static Compare(T,P){if(T.staffEntries.length<1)return-1;if(P.staffEntries.length<1)return 1;const _=d.Fraction.minus(T.staffEntries[T.staffEntries.length-1].getAbsoluteTimestamp(),T.staffEntries[0].getAbsoluteTimestamp()),E=d.Fraction.minus(P.staffEntries[P.staffEntries.length-1].getAbsoluteTimestamp(),P.staffEntries[0].getAbsoluteTimestamp());return _.RealValue>E.RealValue?1:E.RealValue>_.RealValue?-1:0}calculateCurve(T){const P=this.staffEntries[0],_=this.staffEntries[this.staffEntries.length-1];let E=P.findGraphicalNoteFromNote(this.slur.StartNote);!E&&this.graceStart&&(E=P.findGraphicalNoteFromGraceNote(this.slur.StartNote)),E||(E=P.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let M=_.findGraphicalNoteFromNote(this.slur.EndNote);!M&&this.graceEnd&&(M=_.findGraphicalNoteFromGraceNote(this.slur.EndNote));const N=P.parentMeasure.ParentStaffLine,I=N.SkyBottomLineCalculator;this.calculatePlacement(I,N);const R=this.calculateStartAndEnd(E,M,N,T,I),V=R.startX,U=R.endX;let K=R.startY,k=R.endY;const W=T.SlurTangentMinAngle,G=T.SlurTangentMaxAngle;let X;if(this.placement===c.PlacementEnum.Above){K-=T.SlurNoteHeadYOffset,k-=T.SlurNoteHeadYOffset;const L=new s.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,K);E?L.x+=this.staffEntries[0].PositionAndShape.BorderRight:L.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(L.x+=_.PositionAndShape.RelativePosition.x);const H=new s.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,k);if(M?H.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:H.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(H.x+=_.staffEntryParent.PositionAndShape.RelativePosition.x),X=this.calculateTopPoints(L,H,N,I),X.length===0){const Re=new s.PointF2D((H.x-L.x)/2+L.x,(H.y-L.y)/2+L.y);X.push(Re)}const ne=Math.atan((k-K)/(U-V)),ie=new s.PointF2D(0,0);let be=new s.PointF2D(U-V,-(k-K));const ae=o.Matrix2D.getRotationMatrix(ne),ge=ae.getTransposeMatrix();be=ae.vectorMultiplication(be);const ce=this.calculateTranslatedAndRotatedPointListAbove(X,V,K,ae),ee=this.calculateMaxLeftSlope(ce,ie,be),ye=this.calculateMaxRightSlope(ce,ie,be),Ee=ie.y-ie.x*ee,j=be.y-be.x*ye,te=new s.PointF2D;let re=!1;Math.abs(Math.abs(ee)-Math.abs(ye))<1e-4?(te.x=be.x/2,te.y=0,re=!0):(te.x=(j-Ee)/(ee-ye),te.y=ee*te.x+Ee);const O=this.calculateHeightWidthRatio(be.x,ce),z=0,Y=0;let q=W,de=-W;if(!re){const Re=this.calculateAngles(W,ee,ye,G);q=Re.startAngle,de=Re.endAngle}const le=this.calculateControlPoints(be.x,q,de,ce,O,K,k);let he=le.startControlPoint,me=le.endControlPoint;he=ge.vectorMultiplication(he),he.x+=V,he.y=-he.y+K,me=ge.vectorMultiplication(me),me.x+=V,me.y=-me.y+K,this.bezierStartPt=new s.PointF2D(V,K-z),this.bezierStartControlPt=new s.PointF2D(he.x,he.y-z),this.bezierEndControlPt=new s.PointF2D(me.x,me.y-Y),this.bezierEndPt=new s.PointF2D(U,k-Y);const _e=N.SkyLine.length,Me=I.getLeftIndexForPointX(this.bezierStartPt.x,_e),Ue=I.getLeftIndexForPointX(this.bezierEndPt.x,_e),Ge=this.bezierEndPt.x-this.bezierStartPt.x,Qe=I.SamplingUnit;for(let Re=Me;Re=Me&&(N.SkyLine[Ke]=Math.min(N.SkyLine[Ke],qe.y)),Ke++,Ke<_e&&(N.SkyLine[Ke]=Math.min(N.SkyLine[Ke],qe.y))}}else{K+=T.SlurNoteHeadYOffset,k+=T.SlurNoteHeadYOffset;const L=new s.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,K);E?L.x+=this.staffEntries[0].PositionAndShape.BorderRight:L.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(L.x+=_.PositionAndShape.RelativePosition.x);const H=new s.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,k);if(M?H.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:H.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(H.x+=_.staffEntryParent.PositionAndShape.RelativePosition.x),X=this.calculateBottomPoints(L,H,N,I),X.length===0){const Re=new s.PointF2D((H.x-L.x)/2+L.x,(H.y-L.y)/2+L.y);X.push(Re)}const ne=Math.atan((k-K)/(U-V)),ie=new s.PointF2D(0,0);let be=new s.PointF2D(U-V,k-K);const ae=o.Matrix2D.getRotationMatrix(-ne),ge=ae.getTransposeMatrix();be=ae.vectorMultiplication(be);const ce=this.calculateTranslatedAndRotatedPointListBelow(X,V,K,ae),ee=this.calculateMaxLeftSlope(ce,ie,be),ye=this.calculateMaxRightSlope(ce,ie,be),Ee=ie.y-ie.x*ee,j=be.y-be.x*ye,te=new s.PointF2D;let re=!1;Math.abs(Math.abs(ee)-Math.abs(ye))<1e-4?(te.x=be.x/2,te.y=0,re=!0):(te.x=(j-Ee)/(ee-ye),te.y=ee*te.x+Ee);const O=this.calculateHeightWidthRatio(be.x,ce),z=0,Y=0;let q=W,de=-W;if(!re){const Re=this.calculateAngles(W,ee,ye,G);q=Re.startAngle,de=Re.endAngle}const le=this.calculateControlPoints(be.x,q,de,ce,O,K,k);let he=le.startControlPoint,me=le.endControlPoint;he=ge.vectorMultiplication(he),he.x+=V,he.y+=K,me=ge.vectorMultiplication(me),me.x+=V,me.y+=K,this.bezierStartPt=new s.PointF2D(V,K+z),this.bezierStartControlPt=new s.PointF2D(he.x,he.y+z),this.bezierEndControlPt=new s.PointF2D(me.x,me.y+Y),this.bezierEndPt=new s.PointF2D(U,k+Y);const _e=N.BottomLine.length,Me=I.getLeftIndexForPointX(this.bezierStartPt.x,_e),Ue=I.getLeftIndexForPointX(this.bezierEndPt.x,_e),Ge=this.bezierEndPt.x-this.bezierStartPt.x,Qe=I.SamplingUnit;for(let Re=Me;Re=Me&&(N.BottomLine[Ke]=Math.max(N.BottomLine[Ke],qe.y)),Ke++,Ke<_e&&(N.BottomLine[Ke]=Math.max(N.BottomLine[Ke],qe.y))}}}calculateStartAndEnd(T,P,_,E,M){let N=0,I=0,R=0,V=0;if(T){N=T.PositionAndShape.RelativePosition.x+T.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+T.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceStart&&(N+=T.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const U=T.parentVoiceEntry;this.placement===c.PlacementEnum.Above?(I=U.PositionAndShape.RelativePosition.y+U.PositionAndShape.BorderTop,this.rules.SlurPlacementUseSkyBottomLine&&(I=Math.min(V,U.parentStaffEntry.getSkylineMin()))):(I=U.PositionAndShape.RelativePosition.y+U.PositionAndShape.BorderBottom,this.rules.SlurPlacementUseSkyBottomLine&&(I=Math.max(V,U.parentStaffEntry.getBottomlineMax()))),U.parentVoiceEntry.StemDirection===x.StemDirectionType.Down&&this.placement===c.PlacementEnum.Below&&(N-=.5),U.parentVoiceEntry.StemDirection===x.StemDirectionType.Up&&this.placement===c.PlacementEnum.Above&&(N+=.5)}else N=0;if(P){R=P.PositionAndShape.RelativePosition.x+P.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+P.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceEnd&&(R+=P.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const U=P.parentVoiceEntry;let K;for(const k of U.parentVoiceEntry.Articulations)if(K=k.placement,k.placement===c.PlacementEnum.NotYetDefined){for(const W of P.vfnote[0].modifiers)if(W.getCategory()===p.Articulation.CATEGORY){W.position===p.Modifier.Position.ABOVE?(k.placement=c.PlacementEnum.Above,K=c.PlacementEnum.Above):W.position===p.Modifier.Position.BELOW&&(k.placement=c.PlacementEnum.Below,K=c.PlacementEnum.Below);break}}this.placement===c.PlacementEnum.Above?(V=U.PositionAndShape.RelativePosition.y+U.PositionAndShape.BorderTop,this.rules.SlurPlacementUseSkyBottomLine&&(V=Math.min(V,U.parentStaffEntry.getSkylineMin())),K===c.PlacementEnum.Above&&(V-=this.rules.SlurEndArticulationYOffset)):(V=U.PositionAndShape.RelativePosition.y+U.PositionAndShape.BorderBottom,this.rules.SlurPlacementUseSkyBottomLine&&(V=Math.max(V,U.parentStaffEntry.getBottomlineMax())),K===c.PlacementEnum.Below&&(V+=this.rules.SlurEndArticulationYOffset)),U.parentVoiceEntry.StemDirection===x.StemDirectionType.Down&&this.placement===c.PlacementEnum.Below&&(R-=.5),U.parentVoiceEntry.StemDirection===x.StemDirectionType.Up&&this.placement===c.PlacementEnum.Above&&(R+=.5)}else R=_.PositionAndShape.Size.width;return T||P||(I=-1.5,V=-1.5),T||(I=this.placement===c.PlacementEnum.Above?V-1:V+1),P||(V=this.placement===c.PlacementEnum.Above?I-1:I+1),this.slur.startNoteHasMoreStartingSlurs()&&this.slur.isSlurLonger()&&(this.placement===c.PlacementEnum.Above?I-=E.SlursStartingAtSameStaffEntryYOffset:I+=E.SlursStartingAtSameStaffEntryYOffset),this.slur.endNoteHasMoreEndingSlurs()&&this.slur.isSlurLonger()&&(this.placement===c.PlacementEnum.Above?V-=E.SlursStartingAtSameStaffEntryYOffset:V+=E.SlursStartingAtSameStaffEntryYOffset),this.placement===c.PlacementEnum.Above?(I=Math.min(I,1.5),V=Math.min(V,1.5)):(I=Math.max(I,_.StaffHeight-1.5),V=Math.max(V,_.StaffHeight-1.5)),{startX:N,startY:I,endX:R,endY:V}}calculatePlacement(T,P){if(this.rules.SlurPlacementFromXML&&this.slur.PlacementXml!==c.PlacementEnum.NotYetDefined)return void(this.placement=this.slur.PlacementXml);for(let N=0,I=this.staffEntries.length;N0)return void(this.placement=c.PlacementEnum.Above);const _=this.staffEntries[0],E=this.staffEntries[this.staffEntries.length-1],M=_.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(M===E.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=M===x.StemDirectionType.Up?c.PlacementEnum.Below:c.PlacementEnum.Above,this.rules.SlurPlacementAtStems&&(this.placement=M===x.StemDirectionType.Up?c.PlacementEnum.Above:c.PlacementEnum.Below);else{let N=_.PositionAndShape.BorderLeft+_.PositionAndShape.RelativePosition.x+_.parentMeasure.PositionAndShape.RelativePosition.x,I=E.PositionAndShape.BorderRight+E.PositionAndShape.RelativePosition.x+E.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(N+=E.PositionAndShape.RelativePosition.x),this.graceEnd&&(I+=E.staffEntryParent.PositionAndShape.RelativePosition.x);const R=-1*T.getSkyLineMinInRange(N,I),V=T.getBottomLineMaxInRange(N,I)-P.StaffHeight;this.placement=V>R?c.PlacementEnum.Above:c.PlacementEnum.Below}}calculateTopPoints(T,P,_,E){const M=[];let N=E.getRightIndexForPointX(T.x,_.SkyLine.length),I=E.getLeftIndexForPointX(P.x,_.SkyLine.length);N<0&&(N=0),I>=_.SkyLine.length&&(I=_.SkyLine.length-1);for(let R=N;R=_.BottomLine.length&&(I=_.BottomLine.length-1);for(let R=N;RU&&T>K&&(V+=T/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,V*=1+P/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,R/=V);const k=Math.min(.5,Math.max(.1,1.7*P/80*R*Math.pow(Math.max(M,.05),.4))),W=Math.min(.5,Math.max(.1,1.7*-_/80*R*Math.pow(Math.max(M,.05),.4))),G=new s.PointF2D;G.x=T*k*Math.cos(P*v.degreesToRadiansFactor),G.y=T*k*Math.sin(P*v.degreesToRadiansFactor);const X=new s.PointF2D;X.x=T-T*W*Math.cos(_*v.degreesToRadiansFactor),X.y=-T*W*Math.sin(_*v.degreesToRadiansFactor);let L=G.y-X.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(L)>this.rules.SlurMaximumYControlPointDistance;)L<0?(G.y+=1,X.y-=1):(G.y-=1,X.y+=1),L=G.y-X.y;return{startControlPoint:G,endControlPoint:X}}calculateAngles(T,P,_,E){let M=Math.atan(P)/v.degreesToRadiansFactor;P>0?M+=20:M-=20;let N=Math.atan(_)/v.degreesToRadiansFactor;return _<0?N-=20:N+=20,{startAngle:Math.min(Math.max(T,M),E),endAngle:Math.max(Math.min(-T,N),-E)}}}a.GraphicalSlur=v,v.degreesToRadiansFactor=Math.PI/180},3023:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalStaffEntry=void 0;const h=r(8911),s=r(1797),m=r(4785),c=r(2337),o=r(4040);class u extends m.GraphicalObject{constructor(x,p=void 0,v=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=x,this.graphicalVoiceEntries=[],this.sourceStaffEntry=p,v?(this.staffEntryParent=v,this.parentVerticalContainer=v.parentVerticalContainer,this.PositionAndShape=new h.BoundingBox(this,v.PositionAndShape)):this.PositionAndShape=new h.BoundingBox(this,x.PositionAndShape),p&&(this.relInMeasureTimestamp=p.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(x){this.lyricsEntries=x}getAbsoluteTimestamp(){const x=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&x.Add(this.relInMeasureTimestamp),x}findTieGraphicalNoteFromNote(x){for(const p of this.graphicalVoiceEntries)for(const v of p.notes){const S=v.sourceNote;if(!S.isRest()&&S.Pitch.FundamentalNote===x.Pitch.FundamentalNote&&S.Pitch.Octave===x.Pitch.Octave&&S.getAbsoluteTimestamp().Equals(x.getAbsoluteTimestamp()))return v}}findEndTieGraphicalNoteFromNoteWithStartingSlur(x,p){if(x){for(const v of this.graphicalVoiceEntries)if(v.parentVoiceEntry===x.ParentVoiceEntry)for(const S of v.notes){const T=S.sourceNote;if(T.NoteTie&&T.NoteSlurs.indexOf(p)!==-1)return S}}}findGraphicalNoteFromGraceNote(x){if(x){for(const p of this.graphicalVoiceEntries)if(p.parentVoiceEntry===x.ParentVoiceEntry){for(const v of p.notes)if(v.sourceNote===x)return v}}}findGraphicalNoteFromNote(x){if(x){for(const p of this.graphicalVoiceEntries)if(p.parentVoiceEntry===x.ParentVoiceEntry){for(const v of p.notes)if(v.sourceNote===x&&this.getAbsoluteTimestamp().Equals(x.getAbsoluteTimestamp()))return v}}}getGraphicalNoteDurationFromVoice(x){for(const p of this.graphicalVoiceEntries)if(p.parentVoiceEntry.ParentVoice===x)return p.notes[0].graphicalNoteLength;return new s.Fraction(0,1)}findVoiceEntryGraphicalNotes(x){for(const p of this.graphicalVoiceEntries)if(p.parentVoiceEntry===x)return p.notes}isVoiceEntryPartOfLinkedVoiceEntry(x){if(this.sourceStaffEntry.Link)for(let p=0,v=this.sourceStaffEntry.Link.LinkStaffEntries.length;p0&&(x=S)}return x}findStaffEntryMaxNoteLength(){let x=new s.Fraction(0,1);for(const p of this.graphicalVoiceEntries)for(const v of p.notes){const S=v.graphicalNoteLength;x.lt(S)&&S.GetExpandedNumerator()>0&&(x=S)}return x}findOrCreateGraphicalVoiceEntry(x){for(const v of this.graphicalVoiceEntries)if(v.parentVoiceEntry===x)return v;const p=o.MusicSheetCalculator.symbolFactory.createVoiceEntry(x,this);return this.graphicalVoiceEntries.push(p),p}findOrCreateGraphicalVoiceEntryFromGraphicalNote(x){for(const v of this.graphicalVoiceEntries)if(v===x.parentVoiceEntry)return v;const p=o.MusicSheetCalculator.symbolFactory.createVoiceEntry(x.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(p),p}addGraphicalNoteToListAtCorrectYPosition(x,p){const v=x.notes;if(v.length===0||p.PositionAndShape.RelativePosition.y=0;S--){if(v[S].PositionAndShape.RelativePosition.y>p.PositionAndShape.RelativePosition.y){v.splice(S+1,0,p);break}if(S===0){v.splice(0,0,p);break}}}hasOnlyRests(){return this.sourceStaffEntry.hasOnlyRests}getSkylineMin(){var x;const p=(x=this.parentMeasure)===null||x===void 0?void 0:x.ParentStaffLine.SkyBottomLineCalculator;if(!p)return;const[v,S]=this.getAbsoluteStartAndEnd();return p.getSkyLineMinInRange(v,S)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var x;const p=(x=this.parentMeasure)===null||x===void 0?void 0:x.ParentStaffLine.SkyBottomLineCalculator;if(!p)return;const[v,S]=this.getAbsoluteStartAndEnd();return p.getBottomLineMaxInRange(v,S)}getAbsoluteStartAndEnd(){let x=this.PositionAndShape.AbsolutePosition.x;return x-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,[x,x+this.PositionAndShape.Size.width]}}a.GraphicalStaffEntry=u},8898:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalStaffEntryLink=void 0,a.GraphicalStaffEntryLink=class{constructor(r){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=r,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(r){this.graphicalLinkedStaffEntries=r}isFilled(){for(let r=0;r{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalTie=void 0,a.GraphicalTie=class{constructor(r,h=void 0,s=void 0){this.tie=r,this.startNote=h,this.endNote=s}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(r){this.startNote=r}get EndNote(){return this.endNote}set EndNote(r){this.endNote=r}}},4462:function(b,a,r){var h=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalUnknownExpression=void 0;const s=r(6791),m=r(3748),c=h(r(2043));class o extends s.AbstractGraphicalExpression{constructor(d,x,p,v,S=void 0){super(d,new m.AbstractExpression(p),v),this.label=x,this.sourceMultiExpression=S}updateSkyBottomLine(){const d=this.parentStaffLine.SkyBottomLineCalculator,x=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,p=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case m.PlacementEnum.Above:const v=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;d.updateSkyLineInRange(x,p,v);break;case m.PlacementEnum.Below:const S=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;d.updateBottomLineInRange(x,p,S);break;default:c.default.error("Placement for GraphicalUnknownExpression is unknown")}}}a.GraphicalUnknownExpression=o},5974:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GraphicalVoiceEntry=void 0;const h=r(4785),s=r(8911),m=r(1405);class c extends h.GraphicalObject{constructor(u,d,x){super(),this.parentVoiceEntry=u,this.parentStaffEntry=d,this.PositionAndShape=new s.BoundingBox(this,d?d.PositionAndShape:void 0,!0),this.notes=[],this.rules=x||(d?d.parentMeasure.parentSourceMeasure.Rules:new m.EngravingRules)}sort(){return this.notes.sort((u,d)=>{var x,p,v,S;return((p=(x=d.sourceNote.Pitch)===null||x===void 0?void 0:x.getHalfTone())!==null&&p!==void 0?p:0)-((S=(v=u.sourceNote.Pitch)===null||v===void 0?void 0:v.getHalfTone())!==null&&S!==void 0?S:0)}),this.notes}sortForVexflow(){return this.notes.sort((u,d)=>{var x,p,v;return((p=(x=u.sourceNote.Pitch)===null||x===void 0?void 0:x.getHalfTone())!==null&&p!==void 0?p:0)-((v=d.sourceNote.Pitch.getHalfTone())!==null&&v!==void 0?v:0)}),this.notes}color(){}}a.GraphicalVoiceEntry=c},8823:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},4040:function(b,a,r){var h=this&&this.__importDefault||function(Ee){return Ee&&Ee.__esModule?Ee:{default:Ee}};Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSheetCalculator=void 0;const s=r(4324),m=r(1797),c=r(5253),o=r(1513),u=r(289),d=r(5853),x=r(908),p=r(5623),v=r(9086),S=r(9050),T=r(9946),P=r(1274),_=r(5198),E=r(1357),M=r(2947),N=r(8911),I=r(4574),R=r(1070),V=r(289),U=h(r(2043)),K=r(1649),k=r(6729),W=r(2255),G=r(141),X=r(3748),L=r(5277),H=r(9667),ne=r(280),ie=r(7839),be=r(374),ae=r(41),ge=r(4462),ce=r(3884),ee=r(2953);class ye{constructor(){this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalLyricWords=[],this.abstractNotImplementedErrorMessage="abstract, not implemented",this.dynamicExpressionMap=new Map}static get TextMeasurer(){return ye.textMeasurer}static set TextMeasurer(j){ye.textMeasurer=j}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}static setMeasuresMinStaffEntriesWidth(j,te){for(let re=0,O=j.length;re0&&this.rules.RenderMultipleRestMeasures){me.isReducedToMultiRest=!0,me.multipleRestMeasureNumber=1;const Me=me.multipleRestMeasures-1;le+=Me;for(let Ue=1;Ue<=Me;Ue++){const Ge=j.SourceMeasures.indexOf(me)+Ue;if(Ge>=j.SourceMeasures.length)break;const Qe=j.SourceMeasures[Ge];Qe.multipleRestMeasureNumber=Ue+1,Qe.isReducedToMultiRest=!0,te.push([void 0])}}}if(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let le,he=0;for(let me=0,_e=j.SourceMeasures.length;me<_e;++me){const Me=j.SourceMeasures[me];if(!Me.isReducedToMultiRest&&Me.canBeReducedToMultiRest())if(he>0){le.isReducedToMultiRest=!0,le.multipleRestMeasureNumber=1,he++,Me.multipleRestMeasureNumber=he,Me.isReducedToMultiRest=!0;for(let Ue=0;Ue1){le.multipleRestMeasures=he;const Ue=this.createGraphicalMeasuresForSourceMeasure(le,re,z,q,O);te[le.measureListIndex]=Ue,he=0,le=void 0}else he=0,le=void 0}if(he>1){le.multipleRestMeasures=he,le.isReducedToMultiRest=!0;const me=this.createGraphicalMeasuresForSourceMeasure(le,re,z,q,O);te[le.measureListIndex]=me,he=0,le=void 0}}const de=O.map(le=>le.ClefType===u.ClefEnum.percussion);this.handleStaffEntries(de),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),s.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(j,te){var re;if(this.graphicalMusicSheet.MeasureList.length>0){let O,z=0;for(let Y=0;Yz&&(z=q),ye.setMeasuresMinStaffEntriesWidth(O,q)}if(this.rules.FixedMeasureWidth){let Y=z;this.rules.FixedMeasureWidthFixedValue&&(Y=this.rules.FixedMeasureWidthFixedValue);for(let q=0;q1;if(z===1&&te.Measures[0].parentSourceMeasure.ImplicitMeasure&&(q=!1),q)return;Y.MeasureNumber!==0&&Y.MeasureNumber!==1||(re=Y.MeasureNumber),O=Y!==te.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const de=this.rules.UseXMLMeasureNumbers&&Y.MeasureNumber===1&&Y.parentSourceMeasure.getPrintedMeasureNumber()!==1;((Y.MeasureNumber===re||Y.MeasureNumber>=re+this.rules.MeasureNumberLabelOffset)&&!Y.parentSourceMeasure.ImplicitMeasure||de)&&((Y.MeasureNumber!==1||Y.MeasureNumber===1&&Y!==te.Measures[0]||de)&&this.calculateSingleMeasureNumberPlacement(Y,te,j,O),re=Y.MeasureNumber)}}calculateSingleMeasureNumberPlacement(j,te,re,O=0){const z=j.parentSourceMeasure.getPrintedMeasureNumber().toString(),Y=new W.Label(z),q=new T.GraphicalLabel(Y,this.rules.MeasureNumberLabelHeight,P.TextAlignmentEnum.LeftBottom,this.rules),de=te.SkyBottomLineCalculator;q.setLabelPositionAndShapeBorders(),q.PositionAndShape.Parent=re.PositionAndShape;const le=te.PositionAndShape.RelativePosition.x+j.PositionAndShape.RelativePosition.x-q.PositionAndShape.BorderMarginLeft+O;let he,me=le,_e=le-q.PositionAndShape.BorderLeft+q.PositionAndShape.BorderRight;me-=te.PositionAndShape.RelativePosition.x,_e-=te.PositionAndShape.RelativePosition.x;const Me=me+.5,Ue=_e-.5,Ge=de.getSkyLineMinInRange(Me,Ue);if(j===te.Measures[0]){let Qe=0;if(re.GroupBrackets.length>0)for(const Re of re.GroupBrackets)Qe=Math.min(Qe,Re.PositionAndShape.BorderTop);else j.ParentStaff.ParentInstrument.Parent&&(Qe=-1);he=Math.min(Ge,Qe)}else he=Ge;he=Math.min(0,he),q.PositionAndShape.RelativePosition=new v.PointF2D(le,he),re.MeasureNumberLabels.push(q)}calculateMeasureNumberSkyline(j){const te=j.StaffLines[0];for(const re of j.MeasureNumberLabels){let O=re.PositionAndShape.RelativePosition.x,z=O-re.PositionAndShape.BorderLeft+re.PositionAndShape.BorderRight;O-=te.PositionAndShape.RelativePosition.x,z-=te.PositionAndShape.RelativePosition.x,te.SkyBottomLineCalculator.updateSkyLineInRange(O,z,re.PositionAndShape.RelativePosition.y+re.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(j,te,re){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(j,te){let re=0,O=this.rules.StaffHeight;const z=new Map,Y=[],q=j.SkyBottomLineCalculator;let de=j.Measures.length;for(let he=0;he0){Y.push(Ge),re=Math.max(re,Ge.LyricsEntries.length);const Re=Ge.PositionAndShape.RelativePosition.x+_e.x;let We=Number.MAX_VALUE,qe=Number.MIN_VALUE;for(let Ze=0;Ze0){const he=j.PositionAndShape.Size.width;let me=Y[0].PositionAndShape.RelativePosition.x+Y[0].PositionAndShape.BorderMarginLeft+Y[0].parentMeasure.PositionAndShape.RelativePosition.x;me=me>he?he:me,q.updateBottomLineInRange(me,he,le)}return Y}calculateLyricsExtendsAndDashes(j){for(let te=0,re=j.length;te0||j.UnknownList.length>0){let he="";for(let Qe=0,Re=j.EntriesList.length;Qe-50){let Qe=le/10;Qe+=this.rules.PlaceWordsInsideStafflineYOffset,Ue.PositionAndShape.RelativePosition.y=Qe}const Ge=new ge.GraphicalUnknownExpression(me,Ue,Me,(z=q[re])===null||z===void 0?void 0:z.parentSourceMeasure,j);me.AbstractExpressions.push(Ge)}}clearRecreatedObjects(){for(let j=0,te=this.staffEntriesWithGraphicalTies.length;jj.length-1&&(U.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=j.length-1);const te=[];for(let z=this.rules.MinMeasureToDrawIndex,Y=j.length;z0){let Re=0;Y.staffEntries[0].relInMeasureTimestamp.RealValue===0&&(Re=Y.staffEntries[0].PositionAndShape.RelativePosition.x,Y.MeasureNumber===1&&(Re+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1));let We=Re+(Y.PositionAndShape.Size.width-Y.endInstructionsWidth-Re)*(de.relInMeasureTimestamp.RealValue/Y.parentSourceMeasure.Duration.RealValue)+he.PositionAndShape.BorderMarginLeft;q&&(We=Math.max(We,q.PositionAndShape.RelativePosition.x+q.GraphicalLabel.PositionAndShape.Size.width+this.rules.ChordSymbolXSpacing)),he.PositionAndShape.RelativePosition.x=We,he.PositionAndShape.Parent=Y.staffEntries[0].PositionAndShape.Parent}const me=he.PositionAndShape,_e=me.Parent;if(_e.DataObject instanceof o.GraphicalMeasure&&de.relInMeasureTimestamp.RealValue===0&&(me.RelativePosition.x=Math.max(Y.beginInstructionsWidth,me.RelativePosition.x),Y.MeasureNumber===1&&me.RelativePosition.x>3&&(me.RelativePosition.x+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1)),de.PositionAndShape.RelativePosition.x===0){const Re=j.GraphicalMeasures[z];for(const We of Re){let qe=!1;for(const Ke of We.staffEntries)if(Ke.relInMeasureTimestamp===de.relInMeasureTimestamp&&Ke.PositionAndShape.RelativePosition.x!==0){me.RelativePosition.x=Ke.PositionAndShape.RelativePosition.x,qe=!0;break}if(qe)break}}const Me=me.BorderMarginLeft+_e.AbsolutePosition.x+me.RelativePosition.x,Ue=me.BorderMarginRight+_e.AbsolutePosition.x+me.RelativePosition.x;(!this.rules.ChordSymbolYAlignment||O>0)&&(O=re.getSkyLineMinInRange(Me,Ue));let Ge=0;le===0?(Ge+=this.rules.ChordSymbolYOffset,Ge+=.1):Ge+=this.rules.ChordSymbolYPadding,Ge*=-1;const Qe=he.GraphicalLabel;Qe.PositionAndShape.RelativePosition.y=O+Ge,Qe.setLabelPositionAndShapeBorders(),Qe.PositionAndShape.calculateBoundingBox(),re.updateSkyLineInRange(Me,Ue,O+Qe.PositionAndShape.BorderMarginTop),q=he}}}}calculateAlignedChordSymbolsOffset(j,te){let re=Number.MAX_SAFE_INTEGER;for(const O of j)for(const z of O.graphicalChordContainers){const Y=z.PositionAndShape,q=Y.Parent;let de=Y.BorderMarginLeft+q.AbsolutePosition.x,le=Y.BorderMarginRight+q.AbsolutePosition.x;q.DataObject instanceof o.GraphicalMeasure&&(de+=q.DataObject.beginInstructionsWidth,le+=q.DataObject.beginInstructionsWidth),re=Math.min(re,te.getSkyLineMinInRange(de,le))}return re}layoutMeasureWithWholeRest(j,te,re){}layoutBeams(j){}layoutArticulationMarks(j,te,re){}layoutOrnament(j,te,re){}calculateRestNotePlacementWithinGraphicalBeam(j,te,re,O,z){}calculateTupletNumbers(){if(!this.rules.TupletNumberLimitConsecutiveRepetitions)return;let j,te,re,O=-1,z=0;const Y={};for(const q of this.graphicalMusicSheet.ParentMusicSheet.Instruments)for(const de of q.Voices){z=0,Y[de.VoiceId]={};for(const le of de.VoiceEntries)if(le.Notes.length>0){const he=le.Notes[0];if(!he.NoteTuplet||he.NoteTuplet.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed)){O=-1,z=0,te=void 0,j=void 0;continue}if(he.NoteTuplet===re)continue;let me=he.TypeLength;if(me||(U.default.warn("note missing TypeLength"),me=he.NoteTuplet.Fractions[0]),he.NoteTuplet!==te&&Y[de.VoiceId][he.NoteTuplet.TupletLabelNumber]&&Y[de.VoiceId][he.NoteTuplet.TupletLabelNumber][me.RealValue]){he.NoteTuplet.RenderTupletNumber=!1,re=he.NoteTuplet;continue}he.NoteTuplet.TupletLabelNumber===O&&me.Equals(j)&&!he.NoteTuplet.Bracket||(O=he.NoteTuplet.TupletLabelNumber,j=me,z=0),te=he.NoteTuplet,z++,z<=this.rules.TupletNumberMaxConsecutiveRepetitions&&(he.NoteTuplet.RenderTupletNumber=!0),z>this.rules.TupletNumberMaxConsecutiveRepetitions&&(he.NoteTuplet.RenderTupletNumber=!1,this.rules.TupletNumberAlwaysDisableAfterFirstMax&&(Y[de.VoiceId][O]||(Y[de.VoiceId][O]={}),Y[de.VoiceId][O][me.RealValue]=!0)),re=te}}}calculateSlurs(){}calculateGlissandi(){}calculateDynamicExpressionsForMultiExpression(j,te,re){}calculateGraphicalVerbalContinuousDynamic(j,te){const re=j.Label,O=te.x+re.PositionAndShape.BorderMarginLeft,z=te.x+re.PositionAndShape.BorderMarginRight,Y=j.ContinuousDynamic.Placement,q=j.ParentStaffLine.SkyBottomLineCalculator;let de;Y===X.PlacementEnum.Below?(de=q.getBottomLineMaxInRange(O,z),re.PositionAndShape.RelativePosition=new v.PointF2D(te.x,de-re.PositionAndShape.BorderMarginTop)):(de=q.getSkyLineMinInRange(O,z),re.PositionAndShape.RelativePosition=new v.PointF2D(te.x,de-re.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(j,te){var re;const O=j.IsSoftAccent,z=j.ParentStaffLine.ParentStaff.idInMusicSheet,Y=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,z);if(!Y)return void U.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");j.EndMeasure=Y;const q=j.ParentStaffLine,de=Y.ParentStaffLine,le=de&&q===de;let he=!1;de?he=de==null?void 0:de.isPartOfMultiStaffInstrument():q&&(he=q==null?void 0:q.isPartOfMultiStaffInstrument());const me=m.Fraction.createFromFraction(j.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),_e=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(me),Me=_e.getFirstNonNullStaffEntry().parentMeasure,Ue=Me.PositionAndShape.AbsolutePosition.x+Me.PositionAndShape.BorderRight;let Ge=new m.Fraction(0,0,0);for(const sn of _e.StaffEntries){const jt=(re=sn==null?void 0:sn.sourceStaffEntry)===null||re===void 0?void 0:re.calculateMaxNoteLength(!1);jt!=null&&jt.gt(Ge)&&(Ge=jt)}const Qe=!O&&j.ContinuousDynamic.DynamicType===ie.ContDynamicEnum.diminuendo,Re=this.getRelativePositionInStaffLineFromTimestamp(me,z,de,he,0,Qe),We=m.Fraction.plus(me,Ge),qe=this.getRelativePositionInStaffLineFromTimestamp(We,z,de,he,0,j.ContinuousDynamic.DynamicType===ie.ContDynamicEnum.diminuendo),Ke=this.rules.SoftAccentWedgePadding,Ze=_e.getFirstNonNullStaffEntry().PositionAndShape.Size.width,st=this.rules.SoftAccentSizeFactor;O?(te.x-=Ze/2*st+Ke,Re.x=te.x+Ze/2*st):qe.x>Re.x&&qe.xut){const kn=xt.StaffLines[sn].PositionAndShape.RelativePosition.y-q.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;Lt=this.rules.StaffHeight+kn/2}else Lt=this.rules.WedgePlacementBelowY;Lt-=this.rules.WedgeOpeningLength/2,le||(Bn=Lt);let jt=Et.getBottomLineMaxInRange(It,hi);jt>Lt&&(Lt=jt);const Xn=!1;if(utthis.rules.StaffHeight?oi-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,j.NotToBeRemoved=!0}}le||(jt=de.SkyBottomLineCalculator.getBottomLineMaxInRange(Jt,jn),jt>Bn&&(Bn=jt),Bn+=this.rules.WedgeOpeningLength/2,Bn+=this.rules.WedgeVerticalMargin),Lt+=this.rules.WedgeOpeningLength/2,Lt+=this.rules.WedgeVerticalMargin}else if(dt===X.PlacementEnum.Above){if(q.ParentStaff.ParentInstrument.Staves.length===1)Lt=this.rules.WedgePlacementAboveY;else{let jt=0;ut>0&&(jt=ut-1);const Xn=xt.StaffLines[jt];Lt=-(q.PositionAndShape.RelativePosition.y-Xn.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}Lt+=this.rules.WedgeOpeningLength/2,le||(Bn=Lt);let sn=Et.getSkyLineMinInRange(It,hi);if(sn1&&ut>0){const jt=q.findClosestStaffEntry(It),Xn=q.findClosestStaffEntry(hi);jt&&Xn&&jt.parentVerticalContainer}le||(sn=de.SkyBottomLineCalculator.getSkyLineMinInRange(Jt,jn),snkn&&(kn=Yn),kn+=this.rules.WedgeOpeningLength/2,kn+=this.rules.WedgeVerticalMargin}else if(dt===X.PlacementEnum.Above){const Yn=Xn.SkyBottomLineCalculator.getSkyLineMinInRange(Jt,jn);Yn-me/2?-me/2:le-j.PositionAndShape.BorderMarginBottom}else de=le-j.PositionAndShape.BorderMarginBottom;j.PositionAndShape.RelativePosition=new v.PointF2D(te.x,de)}else if(j.Placement===X.PlacementEnum.Below){const le=q.getBottomLineMaxInRange(z,Y),he=O.ParentStaff.ParentInstrument.Staves[O.ParentStaff.ParentInstrument.Staves.length-1];if(O.isPartOfMultiStaffInstrument()&&O.ParentStaff!==he){const me=O.ParentMusicSystem.StaffLines[O.ParentMusicSystem.StaffLines.indexOf(O)+1].PositionAndShape.RelativePosition.y-O.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;de=le+j.PositionAndShape.BorderMarginBottomj.PositionAndShape.Size.width&&(Ue=j.PositionAndShape.Size.width-this.rules.MeasureRightMargin,Me=Ue-he.PositionAndShape.MarginSize.width,te.x=Me-he.PositionAndShape.BorderMarginLeft);const Ge=j.SkyBottomLineCalculator;return _e=z===X.PlacementEnum.Below?Ge.getBottomLineMaxInRange(Me,Ue)+de:Ge.getSkyLineMinInRange(Me,Ue)-de,he.PositionAndShape.RelativePosition=new v.PointF2D(te.x,_e),z===X.PlacementEnum.Below?Ge.updateBottomLineInRange(Me,Ue,he.PositionAndShape.BorderMarginBottom+_e):Ge.updateSkyLineInRange(Me,Ue,he.PositionAndShape.BorderMarginTop+_e),he}calculateTempoExpressionsForMultiTempoExpression(j,te,re){const O=m.Fraction.plus(j.AbsoluteTimestamp,te.Timestamp),z=this.graphicalMusicSheet.MeasureList[re];let Y=new v.PointF2D;if(te.ContinuousTempo||te.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!z[0])return;let q=z[0].ParentStaffLine,de=z[0].PositionAndShape.RelativePosition.x,le=0;for(let he=0;he0){q=z[he].ParentStaffLine,de=z[he].PositionAndShape.RelativePosition.x,le=he;break}if(Y=this.getRelativePositionInStaffLineFromTimestamp(O,le,q,q.isPartOfMultiStaffInstrument(),de),te.EntriesList.length>0&&te.EntriesList[0].Expression instanceof H.InstantaneousTempoExpression&&(te.EntriesList[0].Expression.Placement=X.PlacementEnum.Above,q.Measures[0].staffEntries.length>0&&Math.abs(Y.x-q.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)===0&&q.ParentMusicSystem===this.musicSystems[0])){const he=q.Measures[0].FirstInstructionStaffEntry;if(he){const me=he.GraphicalInstructions.last();Y.x=me.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(Y.x=q.PositionAndShape.RelativePosition.x+q.Measures[0].PositionAndShape.RelativePosition.x)}for(const he of te.EntriesList){let me=P.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(me=P.TextAlignmentEnum.LeftBottom);const _e=this.calculateLabel(q,Y,he.label,te.getFontstyleOfFirstEntry(),he.Expression.Placement,this.rules.UnknownTextHeight,me,this.rules.TempoYSpacing);if(he.Expression.ColorXML&&this.rules.ExpressionsUseXMLColor&&(_e.ColorXML=he.Expression.ColorXML),he.Expression instanceof H.InstantaneousTempoExpression){for(const Me of q.AbstractExpressions)Me instanceof L.GraphicalInstantaneousTempoExpression&&(Me.SourceExpression.Label,he.Expression.Label);if(new L.GraphicalInstantaneousTempoExpression(he.Expression,_e).ParentStaffLine||U.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&he.Expression.Enum===H.TempoEnum.metronomeMark){this.createMetronomeMark(he.Expression);continue}}else if(he.Expression instanceof ne.ContinuousTempoExpression){for(const Me of q.AbstractExpressions)Me instanceof L.GraphicalInstantaneousTempoExpression&&(Me.SourceExpression.Label,he.Expression.Label);q.AbstractExpressions.push(new L.GraphicalInstantaneousTempoExpression(he.Expression,_e))}}}}createMetronomeMark(j){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(j){}clearSystemsAndMeasures(){for(let j=0,te=this.graphicalMusicSheet.MusicPages.length;j-1&&_e.PositionAndShape.ChildElements.splice(Me,1),_e.FirstInstructionStaffEntry=void 0,_e.beginInstructionsWidth=0}if(_e.LastInstructionStaffEntry){const Me=_e.PositionAndShape.ChildElements.indexOf(_e.LastInstructionStaffEntry.PositionAndShape);Me>-1&&_e.PositionAndShape.ChildElements.splice(Me,1),_e.LastInstructionStaffEntry=void 0,_e.endInstructionsWidth=0}}le.Measures=[],le.PositionAndShape.ChildElements=[]}Y.StaffLines.length=0,Y.PositionAndShape.ChildElements=[]}re.MusicSystems=[],re.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(j,te,re,O,z,Y,q,de,le,he=void 0,me=void 0){j.StemDirectionXml!==x.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&j.StemDirectionXml!==void 0?j.WantedStemDirection=j.StemDirectionXml:this.calculateStemDirectionFromVoices(j);const _e=te.findOrCreateGraphicalVoiceEntry(j);_e.octaveShiftValue=de;const Me=te.tabStaffEntry;let Ue;Me&&(Ue=Me.findOrCreateGraphicalVoiceEntry(j));for(let Ge=0,Qe=j.Notes.length;Ge-1)continue;let We;if(j.IsGrace?We=ye.symbolFactory.createGraceNote(Re,_e,z,this.rules,de):(We=ye.symbolFactory.createNote(Re,_e,z,de,this.rules,void 0),ye.stafflineNoteCalculator.trackNote(We)),Re.Pitch&&this.checkNoteForAccidental(We,re,z,de),this.resetYPositionForLeadSheet(We.PositionAndShape),te.addGraphicalNoteToListAtCorrectYPosition(_e,We),We.PositionAndShape.calculateBoundingBox(),this.leadSheet||(Re.NoteBeam!==void 0&&Re.PrintObject&&(Re instanceof ee.TabNote&&!this.rules.TabBeamsRendered||this.handleBeam(We,Re.NoteBeam,q)),Re.NoteTuplet!==void 0&&Re.PrintObject&&this.handleTuplet(We,Re.NoteTuplet,Y)),Ue){const qe=ye.symbolFactory.createNote(Re,Ue,z,de,this.rules,void 0);Me.addGraphicalNoteToListAtCorrectYPosition(Ue,qe),qe.PositionAndShape.calculateBoundingBox(),this.leadSheet||Re.NoteTuplet&&this.handleTuplet(qe,Re.NoteTuplet,Y)}}return j.Articulations.length>0&&this.handleVoiceEntryArticulations(j.Articulations,j,te),j.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(j.TechnicalInstructions,j,te),j.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(j,te,O),j.OrnamentContainer&&this.handleVoiceEntryOrnaments(j.OrnamentContainer,j,te),de}resetYPositionForLeadSheet(j){this.leadSheet&&(j.RelativePosition=new v.PointF2D(j.RelativePosition.x,0))}layoutVoiceEntries(j,te){if(j.PositionAndShape.RelativePosition=new v.PointF2D(0,0),!this.leadSheet)for(const re of j.graphicalVoiceEntries){const O=re.notes;if(O.length===0)continue;const z=O[0].sourceNote.ParentVoiceEntry,Y=O[0].sourceNote.Pitch!==void 0;this.layoutVoiceEntry(z,O,j,Y)}}maxInstrNameLabelLength(){var j;let te=0;for(const re of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if(!((j=re.NameLabel)===null||j===void 0)&&j.print&&re.Voices.length>0&&re.Voices[0].Visible){let O=re.NameLabel;this.rules.RenderPartNames||(O=new W.Label("",O.textAlignment,O.font));const z=new T.GraphicalLabel(O,this.rules.InstrumentLabelTextHeight,P.TextAlignmentEnum.LeftCenter,this.rules);z.setLabelPositionAndShapeBorders(),te=Math.max(te,z.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?te:0}calculateSheetLabelBoundingBoxes(){const j=this.graphicalMusicSheet.ParentMusicSheet,te=this.rules.DefaultColorTitle;if(j.Title!==void 0&&this.rules.RenderTitle){const re=new T.GraphicalLabel(j.Title,this.rules.SheetTitleHeight,P.TextAlignmentEnum.CenterBottom,this.rules);re.Label.IsCreditLabel=!0,re.Label.colorDefault=te,this.graphicalMusicSheet.Title=re,re.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(j.Subtitle!==void 0&&this.rules.RenderSubtitle){const re=new T.GraphicalLabel(j.Subtitle,this.rules.SheetSubtitleHeight,P.TextAlignmentEnum.CenterCenter,this.rules);re.Label.IsCreditLabel=!0,re.Label.colorDefault=te,this.graphicalMusicSheet.Subtitle=re,re.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(j.Composer!==void 0&&this.rules.RenderComposer){const re=new T.GraphicalLabel(j.Composer,this.rules.SheetComposerHeight,P.TextAlignmentEnum.RightCenter,this.rules);re.Label.IsCreditLabel=!0,re.Label.colorDefault=te,this.graphicalMusicSheet.Composer=re,re.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(j.Lyricist!==void 0&&this.rules.RenderLyricist){const re=new T.GraphicalLabel(j.Lyricist,this.rules.SheetAuthorHeight,P.TextAlignmentEnum.LeftCenter,this.rules);re.Label.IsCreditLabel=!0,re.Label.colorDefault=te,this.graphicalMusicSheet.Lyricist=re,re.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);if(j.Copyright!==void 0&&this.rules.RenderCopyright){const re=new T.GraphicalLabel(j.Copyright,this.rules.SheetCopyrightHeight,P.TextAlignmentEnum.CenterBottom,this.rules);re.Label.IsCreditLabel=!0,re.Label.colorDefault=te,this.graphicalMusicSheet.Copyright=re,re.setLabelPositionAndShapeBorders()}else this.rules.RenderCopyright||(this.graphicalMusicSheet.Copyright=void 0)}checkMeasuresForWholeRestNotes(){for(let j=0,te=this.musicSystems.length;j0&&he.graphicalVoiceEntries[0].notes.length===1){const me=he.graphicalVoiceEntries[0].notes[0];!me.sourceNote.Pitch&&new m.Fraction(1,2).lt(me.sourceNote.Length)&&this.layoutMeasureWithWholeRest(me,he,le)}}}}}}optimizeRestNotePlacement(j,te){if(j.graphicalVoiceEntries.length===0)return;const re=j.graphicalVoiceEntries[0].notes;if(re.length===0)return;const O=re[0],z=O.sourceNote.isRest();if(j.graphicalVoiceEntries.length===2){let Y=!1;const q=j.graphicalVoiceEntries[1].notes;q.length>0&&(Y=q[0].sourceNote.isRest()),z&&Y?this.calculateTwoRestNotesPlacementWithCollisionDetection(j):(z||Y)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(j)}else if(z&&j!==te.staffEntries[0]&&j!==te.staffEntries[te.staffEntries.length-1]){const Y=te.staffEntries.indexOf(j),q=te.staffEntries[Y-1],de=te.staffEntries[Y+1];if(q.graphicalVoiceEntries.length===1){const le=q.graphicalVoiceEntries[0].notes[0];if(le.sourceNote.NoteBeam!==void 0&&de.graphicalVoiceEntries.length===1){const he=de.graphicalVoiceEntries[0].notes[0];he.sourceNote.NoteBeam!==void 0&&le.sourceNote.NoteBeam===he.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(j,O,le,de,he),j.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(j,te,re,O,z=0,Y=!1){let q,de,le=new v.PointF2D;const he=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,me=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(j),_e=Math.min(Math.floor(me),he-1),Me=Math.min(Math.ceil(me),he-1);if(_e<0||te<0)return le;if(q=this.getFirstLeftNotNullStaffEntryFromContainer(_e,te,O),de=this.getFirstRightNotNullStaffEntryFromContainer(Me,te,O),q&&de){let Ue=q.parentMeasure.PositionAndShape.RelativePosition.x;z>0&&(Ue=z);let Ge=q.PositionAndShape.RelativePosition.x+Ue,Qe=de.PositionAndShape.RelativePosition.x+de.parentMeasure.PositionAndShape.RelativePosition.x;const Re=j.RealValue>de.getAbsoluteTimestamp().RealValue;z>0?Qe=de.PositionAndShape.RelativePosition.x+Ue:Y&&(q.getAbsoluteTimestamp().RealValue===j.RealValue||Re)&&(Ge=q.PositionAndShape.RelativePosition.x+q.PositionAndShape.BorderLeft+Ue,Qe=Ge);let We=0;if(q!==de){const qe=q.getAbsoluteTimestamp(),Ke=de.getAbsoluteTimestamp();We=m.Fraction.minus(j,qe).RealValue/m.Fraction.minus(Ke,qe).RealValue}q.parentMeasure.ParentStaffLine!==de.parentMeasure.ParentStaffLine&&(q.parentMeasure.ParentStaffLine===re?Qe=re.PositionAndShape.Size.width:Ge=re.PositionAndShape.RelativePosition.x),le=new v.PointF2D(Ge+(Qe-Ge)*We,0)}return le}getRelativeXPositionFromTimestamp(j){const te=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,re=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(j),O=Math.max(0,Math.min(Math.round(re),te-1)),z=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].getFirstNonNullStaffEntry();return z.PositionAndShape.RelativePosition.x+z.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(j){var te,re;this.rules.RenderSingleHorizontalStaffline&&(j.PositionAndShape.BorderRight=j.PositionAndShape.Size.width,j.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=j.PositionAndShape.Size.width);let O=10,z=-1;if(j.MusicSystems.length>0){const he=j.MusicSystems[0];O=he.PositionAndShape.RelativePosition.y+he.PositionAndShape.BorderTop;const me=j.MusicSystems[j.MusicSystems.length-1];z=me.PositionAndShape.RelativePosition.y+me.PositionAndShape.BorderBottom}if(this.graphicalMusicSheet.Title&&this.rules.RenderTitle){const he=this.graphicalMusicSheet.Title;he.PositionAndShape.Parent=j.PositionAndShape;const me=new v.PointF2D;me.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,me.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,he.PositionAndShape.RelativePosition=me,j.Labels.push(he)}if(this.graphicalMusicSheet.Subtitle&&this.rules.RenderTitle&&this.rules.RenderSubtitle){const he=this.graphicalMusicSheet.Subtitle;he.PositionAndShape.Parent=j.PositionAndShape;const me=new v.PointF2D;me.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,me.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;const _e=(te=he.TextLines)===null||te===void 0?void 0:te.length;_e>1&&(me.y+=he.PositionAndShape.BorderBottom*(_e-1)/_e),he.PositionAndShape.RelativePosition=me,j.Labels.push(he)}const Y=this.graphicalMusicSheet.Composer;let q;if(Y&&this.rules.RenderComposer){Y.PositionAndShape.Parent=j.PositionAndShape,Y.setLabelPositionAndShapeBorders();const he=new v.PointF2D;he.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,he.y=O,he.y-=this.rules.SystemComposerDistance;const me=(re=Y.TextLines)===null||re===void 0?void 0:re.length;me>1&&(he.y-=Y.PositionAndShape.BorderBottom*(me-1)/me),q=he.y,Y.PositionAndShape.RelativePosition=he,j.Labels.push(Y)}const de=this.graphicalMusicSheet.Lyricist;if(de&&this.rules.RenderLyricist){de.PositionAndShape.Parent=j.PositionAndShape,de.setLabelPositionAndShapeBorders();const he=new v.PointF2D;he.x=this.rules.PageLeftMargin,he.y=O,he.y+=de.PositionAndShape.BorderBottom,he.y=Math.min(he.y,q??Number.MAX_SAFE_INTEGER),de.PositionAndShape.RelativePosition=he,j.Labels.push(de)}const le=this.graphicalMusicSheet.Copyright;if(le&&this.rules.RenderCopyright){le.PositionAndShape.Parent=j.PositionAndShape,le.setLabelPositionAndShapeBorders();const he=new v.PointF2D;he.x=j.PositionAndShape.Size.width/2,he.y=z+this.rules.SheetCopyrightMargin,he.y-=le.PositionAndShape.BorderTop,le.PositionAndShape.RelativePosition=he,j.Labels.push(le)}}createGraphicalTies(){for(let j=0;j=0&&this.staffEntriesWithGraphicalTies.push(de)}de=Y}}setTieDirections(j){if(!j)return;const te=j.ties;if(te.length===1){const re=te[0];if(re.TieDirection===X.PlacementEnum.NotYetDefined){const O=re.Notes[0].ParentVoiceEntry.ParentVoice.VoiceId;O!==2&&O!==6||(re.TieDirection=X.PlacementEnum.Below)}}if(te.length>1){let re;for(const O of te){const z=O.Notes[0];(!re||z.Pitch.getHalfTone()>re.Pitch.getHalfTone())&&(re=z)}for(const O of te)O.TieDirection===X.PlacementEnum.NotYetDefined&&(O.Notes[0]===re?O.TieDirection=X.PlacementEnum.Above:O.TieDirection=X.PlacementEnum.Below)}}createAccidentalCalculators(){const j=[],te=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(te)for(let re=0;re1)return;Ge=ye.symbolFactory.createGraphicalMeasure(j,Ue)}if(Ge.hasError=j.getErrorInMeasure(de),j.FirstInstructionsStaffEntries[de])for(let Re=0,We=j.FirstInstructionsStaffEntries[de].Instructions.length;Re0){const st=We.Instructions[0];ye.symbolFactory.createInStaffClef(qe,st)}this.rules.RenderChordSymbols&&((Me=We.ChordContainers)===null||Me===void 0?void 0:Me.length)>0&&(We.ParentStaff.ParentInstrument.HasChordSymbols=!0,ye.symbolFactory.createChordSymbols(We,qe,O.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(O.doCalculationsAtEndOfMeasure(),j.LastInstructionsStaffEntries[de]){const Re=j.LastInstructionsStaffEntries[de];for(let We=0,qe=Re.Instructions.length;We=1&&Ge.staffEntries.length===0){const Re=new S.SourceStaffEntry(new G.VerticalSourceStaffEntryContainer(Ge.parentSourceMeasure,Ge.parentSourceMeasure.AbsoluteTimestamp,Ge.parentSourceMeasure.CompleteNumberOfStaves),Ue);if(Ue.Voices.length===0){const xt=new ce.Voice(Ge.ParentStaff.ParentInstrument,-1);Ue.Voices.push(xt)}const We=new x.VoiceEntry(new m.Fraction(0,1),Ue.Voices[0],Re);let qe=j.Duration;qe.RealValue===0&&(qe=j.ActiveTimeSignature.clone());const Ke=new c.Note(We,Re,qe,void 0,j,!0);Ke.IsWholeMeasureRest=!0,Ke.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===ae.FillEmptyMeasuresWithWholeRests.YesVisible,We.Notes.push(Ke);const Ze=ye.symbolFactory.createStaffEntry(Re,Ge);Ge.addGraphicalStaffEntry(Ze),Ze.relInMeasureTimestamp=We.Timestamp;const st=ye.symbolFactory.createVoiceEntry(We,Ze);Ze.graphicalVoiceEntries.push(st);const ft=ye.symbolFactory.createNote(Ke,st,new u.ClefInstruction,d.OctaveEnum.NONE,this.rules);ye.stafflineNoteCalculator.trackNote(ft),st.notes.push(ft)}Ge.hasOnlyRests=!0;for(const Re of Ge.staffEntries)if(Ge.hasOnlyRests=Re.hasOnlyRests(),!Ge.hasOnlyRests)break;return Ge}checkNoteForAccidental(j,te,re,O){let z=j.sourceNote.Pitch;const Y=j.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();Y!==0&&j.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==V.MidiInstrument.Percussion&&(z=j.Transpose(te.ActiveKeyInstruction,re,Y,O),j.sourceNote.TransposedPitch=z),j.sourceNote.halfTone=z.getHalfTone(),te.checkAccidental(j,z)}handleStaffEntries(j){for(let te=0,re=this.graphicalMusicSheet.MeasureList.length;te0&&!this.rules.PercussionUseCajon2NoteSystem&&j[z]&&(this.rules.PercussionOneLineCutoff===-1||ye.stafflineNoteCalculator.getStafflineUniquePositionCount(z)0&&de.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(de,z),this.layoutStaffEntry(de));this.graphicalMeasureCreatedCalculations(q)}}}}calculateSkyBottomLines(){}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let j=0,te=this.musicSystems.length;j0&&this.layoutArticulationMarks(Ge.Articulations,Ge,_e)}}}}}}calculateOrnaments(){for(let j=0,te=this.musicSystems.length;j0&&O.LyricVersesNumbers.sort()}for(let te=0,re=this.musicSystems.length;te=0&&(O=te.GraphicalLyricsEntries[re+1]),!O)return;const z=j.StaffEntryParent.parentMeasure.ParentStaffLine,Y=O.StaffEntryParent.parentMeasure.ParentStaffLine,q=j.StaffEntryParent,de=O.StaffEntryParent;if(j.StaffEntryParent.parentMeasure.ParentStaffLine===O.StaffEntryParent.parentMeasure.ParentStaffLine){const le=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.BorderMarginRight-j.GraphicalLabel.CenteringXShift,he=de.parentMeasure.PositionAndShape.RelativePosition.x+de.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.RelativePosition.x+O.GraphicalLabel.PositionAndShape.BorderMarginLeft,me=j.GraphicalLabel.PositionAndShape.RelativePosition.y;let _e=1;he-le>3*this.rules.MinimumDistanceBetweenDashes&&(_e=Math.floor((he-le)/this.rules.MinimumDistanceBetweenDashes)-1),_e===1?this.calculateSingleDashForLyricWord(z,le,he,me):this.calculateDashes(z,le,he,me)}else{const le=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.BorderMarginRight,he=z.Measures[z.Measures.length-1],me=he.PositionAndShape.RelativePosition.x+he.PositionAndShape.Size.width;let _e=j.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(z,le,me,_e),Y&&Y.Measures[0]&&de.parentMeasure.ParentStaffLine&&(de!==de.parentMeasure.staffEntries[0]||de.parentMeasure!==de.parentMeasure.ParentStaffLine.Measures[0])){const Me=Y.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,Ue=de.parentMeasure.PositionAndShape.RelativePosition.x+de.PositionAndShape.RelativePosition.x+O.GraphicalLabel.PositionAndShape.BorderMarginLeft;_e=O.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(Y,Me,Ue,_e)}}}calculateDashes(j,te,re,O){let z=re-te;if(z<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(j,te,re,O);else{const Y=Math.floor(z/this.rules.MinimumDistanceBetweenDashes)-1,q=z/(Y+1);let de=0;for(te+=q,re-=q;de<=Math.floor(Y/2)&&re>te;)z=this.calculateRightAndLeftDashesForLyricWord(j,te,re,O),te+=q,re-=q,de++;z>2*q&&this.calculateSingleDashForLyricWord(j,te,re,O)}}calculateSingleDashForLyricWord(j,te,re,O){const z=new W.Label("-");z.colorDefault=this.rules.DefaultColorLyrics;let Y=this.rules.LyricsHeight;re-te<.8&&(Y*=.8,O-=.1*Y);const q=new T.GraphicalLabel(z,Y,P.TextAlignmentEnum.CenterBottom,this.rules);q.setLabelPositionAndShapeBorders(),j.LyricsDashes.push(q),this.staffLinesWithLyricWords.indexOf(j)===-1&&this.staffLinesWithLyricWords.push(j),q.PositionAndShape.Parent=j.PositionAndShape;const de=new v.PointF2D(te+(re-te)/2,O);q.PositionAndShape.RelativePosition=de}calculateLyricExtend(j){let te=j.GraphicalLabel.PositionAndShape.RelativePosition.y;const re=j.StaffEntryParent,O=re.parentMeasure.ParentStaffLine;let z,Y;const q=re.parentMeasure.ParentStaff.idInMusicSheet;for(let de=re.parentVerticalContainer.Index+1;de0)break;z=le,Y=z.parentMeasure.ParentStaffLine,Y||(Y=re.parentMeasure.ParentStaffLine)}}if(z&&Y)if(O===Y&&z.parentMeasure.ParentStaffLine){const de=re.parentMeasure.PositionAndShape.RelativePosition.x+re.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.BorderMarginRight,le=z.parentMeasure.PositionAndShape.RelativePosition.x+z.PositionAndShape.RelativePosition.x+z.PositionAndShape.BorderMarginRight;te-=j.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(O,de,le,te)}else{const de=O.Measures[O.Measures.length-1].PositionAndShape,le=re.parentMeasure.PositionAndShape.RelativePosition.x+re.PositionAndShape.RelativePosition.x+j.GraphicalLabel.PositionAndShape.BorderMarginRight,he=de.RelativePosition.x+de.Size.width;if(te-=j.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(O,le,he,te),!z)return;if(z.parentMeasure.ParentStaffLine&&z.parentMeasure.staffEntries&&(z!==z.parentMeasure.staffEntries[0]||z.parentMeasure!==z.parentMeasure.ParentStaffLine.Measures[0])){const me=Y.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,_e=z.parentMeasure.PositionAndShape.RelativePosition.x+z.PositionAndShape.RelativePosition.x+z.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(Y,me,_e,te)}}}calculateSingleLyricWordWithUnderscore(j,te,re,O){const z=new v.PointF2D(te,O),Y=new v.PointF2D(re,O),q=new k.GraphicalLine(z,Y,this.rules.LyricUnderscoreLineWidth);q.colorHex=this.rules.DefaultColorLyrics,j.LyricLines.push(q),this.staffLinesWithLyricWords.indexOf(j)===-1&&this.staffLinesWithLyricWords.push(j)}calculateRightAndLeftDashesForLyricWord(j,te,re,O){const z=new W.Label("-");z.colorDefault=this.rules.DefaultColorLyrics;const Y=new T.GraphicalLabel(z,this.rules.LyricsHeight,P.TextAlignmentEnum.CenterBottom,this.rules);Y.setLabelPositionAndShapeBorders(),j.LyricsDashes.push(Y),this.staffLinesWithLyricWords.indexOf(j)===-1&&this.staffLinesWithLyricWords.push(j),Y.PositionAndShape.Parent=j.PositionAndShape;const q=new v.PointF2D(te,O);Y.PositionAndShape.RelativePosition=q;const de=new W.Label("-"),le=new T.GraphicalLabel(de,this.rules.LyricsHeight,P.TextAlignmentEnum.CenterBottom,this.rules);le.setLabelPositionAndShapeBorders(),j.LyricsDashes.push(le),le.PositionAndShape.Parent=j.PositionAndShape;const he=new v.PointF2D(re,O);return le.PositionAndShape.RelativePosition=he,le.PositionAndShape.RelativePosition.x-Y.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const j=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let te=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);te<=j;te++){const re=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[te];this.dynamicExpressionMap.clear();for(let O=0;O=0;O--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].StaffEntries[te])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].StaffEntries[te]}getFirstRightNotNullStaffEntryFromContainer(j,te,re){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[j].StaffEntries[te])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[j].StaffEntries[te];for(let O=j+1;O0||te.StaffLinkedExpressions[re][O].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(te.StaffLinkedExpressions[re][O],j,re)}}calculateStemDirectionFromVoices(j){if(j.ParentSourceStaffEntry.Link!==void 0)return j===j.ParentSourceStaffEntry.VoiceEntries[0]?void(j.WantedStemDirection=x.StemDirectionType.Up):void(j.WantedStemDirection=x.StemDirectionType.Down);j.ParentVoice instanceof M.LinkedVoice?j.WantedStemDirection=x.StemDirectionType.Down:j.ParentSourceStaffEntry.VoiceEntries.length>1&&(j.WantedStemDirection=x.StemDirectionType.Up)}setBeamNotesWantedStemDirections(j){if(!(j.Notes.length>0))return;const te=j.Notes[0].NoteBeam;if(te){for(const re of te.Notes)if(re.ParentVoiceEntry.WantedStemDirection!==x.StemDirectionType.Undefined&&re.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===j.ParentSourceStaffEntry.ParentStaff.Id){j.WantedStemDirection=re.ParentVoiceEntry.WantedStemDirection;break}}}}a.MusicSheetCalculator=ye},1494:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSheetDrawer=void 0;const h=r(8911),s=r(8155),m=r(6729),c=r(3278),o=r(9086),u=r(9946),d=r(2255),x=r(1274),p=r(1703),v=r(7771),S=r(158),T=r(5074),P=r(9839),_=r(4196);a.MusicSheetDrawer=class{constructor(E,M){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=T.PhonicScoreModes.Manual,this.textMeasurer=E,this.splitScreenLineColor=-1,this.drawingParameters=M,this.rules=M.Rules}set Mode(E){this.phonicScoreMode=E}drawSheet(E){if(this.graphicalMusicSheet=E,this.rules=E.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const N of E.Cursors){if(!N)continue;const I=new h.BoundingBox(N);I.AbsolutePosition=N.Start,I.BorderBottom=N.End.y-N.Start.y,I.BorderRight=N.Width/2,I.BorderLeft=-N.Width/2,this.isVisible(I)&&this.drawLineAsVerticalRectangle(N,s.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const M=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let N=0;N0&&this.drawDashes(K.LyricsDashes),K.LyricLines.length>0&&this.drawLyricLines(K.LyricLines,K));for(const K of E.SystemLines)this.drawSystemLineObject(K);if(this.rules.RenderSystemLabelsAfterFirstPage||E.Parent===E.Parent.Parent.MusicPages[0])for(const K of E.Labels)K.SVGNode=this.drawLabel(K,s.GraphicalLayers.Notes);const V=this.graphicalMusicSheet.ParentMusicSheet.Instruments,U=V.filter(K=>K.Visible).length;for(const K of E.InstrumentBrackets)this.drawInstrumentBrace(K,E);if(V.length>0)if(U>1)for(const K of E.GroupBrackets)this.drawGroupBracket(K,E);else for(const K of E.GroupBrackets)K.Visible=!1;if(!this.leadSheet)for(const K of E.MeasureNumberLabels)K.SVGNode=this.drawLabel(K,s.GraphicalLayers.Notes);for(const K of E.StaffLines)this.drawStaffLineSymbols(K);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(E),this.drawingParameters.drawComments&&this.drawComment(E)}activateSystemRendering(E,M,N,I){return!0}drawSystemLineObject(E){}drawStaffLine(E){for(const M of E.Measures)this.drawMeasure(M);this.rules.RenderLyrics&&E.LyricsDashes.length>0&&this.drawDashes(E.LyricsDashes),this.drawOctaveShifts(E),this.drawPedals(E),this.drawExpressions(E),this.skyLineVisible&&this.drawSkyLine(E),this.bottomLineVisible&&this.drawBottomLine(E)}drawLyricLines(E,M){M.LyricLines.forEach(N=>{N.Start.y+=M.PositionAndShape.AbsolutePosition.y,N.End.y+=M.PositionAndShape.AbsolutePosition.y,N.Start.x+=M.PositionAndShape.AbsolutePosition.x,N.End.x+=M.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(N,this.rules.LyricUnderscoreLineWidth,N.colorHex)})}drawExpressions(E){}drawGraphicalLine(E,M,N="black"){return this.drawLine(E.Start,E.End,N,M)}drawLine(E,M,N="#FF0000FF",I){}drawDashes(E){E.forEach(M=>M.SVGNode=this.drawLabel(M,s.GraphicalLayers.Notes))}drawOctaveShifts(E){}drawStaffLines(E){if(E.StaffLines){const M=E.PositionAndShape.AbsolutePosition;for(let N=0;N<5;N++)this.drawLineAsHorizontalRectangleWithOffset(E.StaffLines[N],M,s.GraphicalLayers.Notes)}}drawInstantaneousDynamic(E){throw new Error("not implemented")}drawContinuousDynamic(E){throw new Error("not implemented")}drawSymbol(E,M,N,I=1,R=s.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(E){this.graphicalMusicSheet.LeadSheet=E}drawPage(E){if(this.isVisible(E.PositionAndShape)){for(const M of E.MusicSystems)this.isVisible(M.PositionAndShape)&&this.drawMusicSystem(M);if(E===E.Parent.MusicPages[0])for(const M of E.Labels)M.SVGNode=this.drawLabel(M,s.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(E.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(E,M=0,N="all"){const I=E.DataObject.constructor.name;let R=!1;N==="all"?R=!0:N==="VexFlowStaffEntry"?R=E.DataObject instanceof P.VexFlowStaffEntry:N==="VexFlowMeasure"?R=E.DataObject instanceof P.VexFlowMeasure:N==="VexFlowGraphicalNote"?R=E.DataObject instanceof P.VexFlowGraphicalNote:N==="VexFlowVoiceEntry"?R=E.DataObject instanceof P.VexFlowVoiceEntry:N==="GraphicalLabel"?R=E.DataObject instanceof u.GraphicalLabel:N==="VexFlowStaffLine"?R=E.DataObject instanceof P.VexFlowStaffLine:N==="SystemLine"?R=E.DataObject instanceof v.SystemLine:N==="StaffLineActivitySymbol"?R=E.DataObject instanceof _.StaffLineActivitySymbol:N==="VexFlowContinuousDynamicExpression"&&(R=E.DataObject instanceof P.VexFlowContinuousDynamicExpression),(R||I===N)&&this.drawBoundingBox(E,void 0,!0,I,M),M++,E.ChildElements.forEach(V=>this.drawBoundingBoxes(V,M,N))}drawBoundingBox(E,M=void 0,N=!1,I=void 0,R=0){let V=new c.RectangleF2D(E.AbsolutePosition.x+E.BorderMarginLeft,E.AbsolutePosition.y+E.BorderMarginTop,E.BorderMarginRight-E.BorderMarginLeft,E.BorderMarginBottom-E.BorderMarginTop);N&&(this.drawLineAsHorizontalRectangle(new m.GraphicalLine(new o.PointF2D(E.AbsolutePosition.x-1,E.AbsolutePosition.y),new o.PointF2D(E.AbsolutePosition.x+1,E.AbsolutePosition.y),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,M),R-1),this.drawLineAsVerticalRectangle(new m.GraphicalLine(new o.PointF2D(E.AbsolutePosition.x,E.AbsolutePosition.y-1),new o.PointF2D(E.AbsolutePosition.x,E.AbsolutePosition.y+1),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,M),R-1)),V=this.applyScreenTransformationForRect(V);const U=this.renderRectangle(V,s.GraphicalLayers.Background,R,M,.5);if(I){const K=new d.Label(I);this.renderLabel(new u.GraphicalLabel(K,.8,x.TextAlignmentEnum.CenterCenter,this.rules),R,V.width,V.height,V.height,new o.PointF2D(V.x,V.y+12))}return U}drawMarkedAreas(E){for(const M of E.GraphicalMarkedAreas)M&&(M.systemRectangle&&this.drawRectangle(M.systemRectangle,s.GraphicalLayers.Background),M.settings&&(M.settings.SVGNode=this.drawLabel(M.settings,s.GraphicalLayers.Comment)),M.labelRectangle&&this.drawRectangle(M.labelRectangle,s.GraphicalLayers.Background),M.label&&(M.label.SVGNode=this.drawLabel(M.label,s.GraphicalLayers.Comment)))}drawComment(E){for(const M of E.GraphicalComments)M&&(M.settings&&(M.settings.SVGNode=this.drawLabel(M.settings,s.GraphicalLayers.Comment)),M.label&&(M.label.SVGNode=this.drawLabel(M.label,s.GraphicalLayers.Comment)))}drawStaffLineSymbols(E){const M=E.ParentStaff.ParentInstrument,N=E.PositionAndShape.AbsolutePosition.x,I=E.PositionAndShape.AbsolutePosition.y+2,R=E.PositionAndShape.BorderRight;M.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new m.GraphicalLine(new o.PointF2D(N,I),new o.PointF2D(N+R,I),4,s.OutlineAndFillStyleEnum.Highlighted),s.GraphicalLayers.Highlight);let V=T.MusicSymbolDrawingStyle.Disabled,U=S.MusicSymbol.PLAY,K=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case T.PhonicScoreModes.Midi:U=S.MusicSymbol.PLAY,this.midiPlaybackAvailable&&E.ParentStaff.audible&&(V=T.MusicSymbolDrawingStyle.PlaybackSymbols);break;case T.PhonicScoreModes.Following:U=S.MusicSymbol.MIC,E.ParentStaff.following&&(V=T.MusicSymbolDrawingStyle.FollowSymbols);break;default:K=!1}if(K){const k=new o.PointF2D(N+R+2,I);this.drawSymbol(U,V,k)}if(this.drawingParameters.drawErrors)for(const k of E.Measures){const W=k.PositionAndShape,G=W.AbsolutePosition.x,X=W.AbsolutePosition.y+2;k.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new m.GraphicalLine(new o.PointF2D(G,X),new o.PointF2D(G+W.BorderRight,X),4,s.OutlineAndFillStyleEnum.ErrorUnderlay),s.GraphicalLayers.MeasureError)}}}},158:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSymbol=void 0,(r=a.MusicSymbol||(a.MusicSymbol={}))[r.Unused_first_Symbol=0]="Unused_first_Symbol",r[r.BLACK_HEAD=1]="BLACK_HEAD",r[r.UPWARDS_TAIL=2]="UPWARDS_TAIL",r[r.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",r[r.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",r[r.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",r[r.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",r[r.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",r[r.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",r[r.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",r[r.ROUND_HEAD=10]="ROUND_HEAD",r[r.WHITE_HEAD=11]="WHITE_HEAD",r[r.G_CLEF=12]="G_CLEF",r[r.F_CLEF=13]="F_CLEF",r[r.C_CLEF=14]="C_CLEF",r[r.BREVE=15]="BREVE",r[r.BREVE_REST=16]="BREVE_REST",r[r.COMMON_TIME=17]="COMMON_TIME",r[r.CUT_TIME=18]="CUT_TIME",r[r.WHOLE_REST=19]="WHOLE_REST",r[r.HALF_REST=20]="HALF_REST",r[r.QUARTER_REST=21]="QUARTER_REST",r[r.EIGHTH_REST=22]="EIGHTH_REST",r[r.SIXTEENTH_REST=23]="SIXTEENTH_REST",r[r.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",r[r.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",r[r.FLAT=26]="FLAT",r[r.SHARP=27]="SHARP",r[r.NATURAL=28]="NATURAL",r[r.DOUBLE_FLAT=29]="DOUBLE_FLAT",r[r.DOUBLE_SHARP=30]="DOUBLE_SHARP",r[r.ZERO=31]="ZERO",r[r.ONE=32]="ONE",r[r.TWO=33]="TWO",r[r.THREE=34]="THREE",r[r.FOUR=35]="FOUR",r[r.FIVE=36]="FIVE",r[r.SIX=37]="SIX",r[r.SEVEN=38]="SEVEN",r[r.EIGHT=39]="EIGHT",r[r.NINE=40]="NINE",r[r.DOT=41]="DOT",r[r.FERMATA=42]="FERMATA",r[r.INVERTED_FERMATA=43]="INVERTED_FERMATA",r[r.SPICCATO=44]="SPICCATO",r[r.TENUTO=45]="TENUTO",r[r.MARCATO=46]="MARCATO",r[r.MARCATISSIMO=47]="MARCATISSIMO",r[r.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",r[r.P=49]="P",r[r.F=50]="F",r[r.S=51]="S",r[r.Z=52]="Z",r[r.M=53]="M",r[r.R=54]="R",r[r.SEGNO=55]="SEGNO",r[r.CODA=56]="CODA",r[r.DRUM_CLEF=57]="DRUM_CLEF",r[r.G_CLEF_SUB8=58]="G_CLEF_SUB8",r[r.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",r[r.G_CLEF_SUB15=60]="G_CLEF_SUB15",r[r.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",r[r.F_CLEF_SUB8=62]="F_CLEF_SUB8",r[r.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",r[r.F_CLEF_SUB15=64]="F_CLEF_SUB15",r[r.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",r[r.DOWN_BOW=66]="DOWN_BOW",r[r.MORDENT=67]="MORDENT",r[r.INVERTED_MORDENT=68]="INVERTED_MORDENT",r[r.TURN=69]="TURN",r[r.INVERTED_TURN=70]="INVERTED_TURN",r[r.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",r[r.RELEASE_PED=72]="RELEASE_PED",r[r.ENGAGE_PED=73]="ENGAGE_PED",r[r.VA8=74]="VA8",r[r.VB8=75]="VB8",r[r.TRILL=76]="TRILL",r[r.MA15=77]="MA15",r[r.MB15=78]="MB15",r[r.HIGH=79]="HIGH",r[r.PLAY=80]="PLAY",r[r.MIC=81]="MIC",r[r.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",r[r.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",r[r.EditPen=84]="EditPen",r[r.PEDAL_BRACKET=85]="PEDAL_BRACKET",r[r.PEDAL_MIXED=86]="PEDAL_MIXED",r[r.PEDAL_SYMBOL=87]="PEDAL_SYMBOL"},7142:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSystem=void 0;const h=r(6842),s=r(8911),m=r(1797),c=r(1274),o=r(9946),u=r(4785),d=r(9086),x=r(6894),p=r(1649),v=r(1225),S=r(2255);class T extends u.GraphicalObject{constructor(_){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new p.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=_,this.boundingBox=new s.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(_){if(this.parent){const E=this.parent.MusicSystems.indexOf(this,0);E>-1&&this.parent.MusicSystems.splice(E,1)}this.parent=_,this.boundingBox.Parent=_.PositionAndShape}get NextSystem(){const _=this.Parent.MusicSystems.indexOf(this);return _!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[_+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get GraphicalComments(){return this.graphicalComments}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(_,E,M){let N=-_/2;M&&(N=this.maxLabelLength+E-_/2);const I=this.staffLines[0].Measures[0];let R;this.staffLines.length>1&&(R=this.staffLines[this.staffLines.length-1].Measures[0]);const V=this.createSystemLine(N,_,x.SystemLinesEnum.SingleThin,v.SystemLinePosition.MeasureBegin,this,I,R);this.SystemLines.push(V),V.PositionAndShape.RelativePosition=new d.PointF2D(N,0),V.PositionAndShape.BorderLeft=0,V.PositionAndShape.BorderRight=_,V.PositionAndShape.BorderTop=V.PositionAndShape.Parent.BorderTop,V.PositionAndShape.BorderBottom=V.PositionAndShape.Parent.BorderBottom,this.createLinesForSystemLine(V)}createVerticalLineForMeasure(_,E,M,N,I,R){const V=R.ParentStaffLine,U=new d.PointF2D(V.PositionAndShape.RelativePosition.x,V.PositionAndShape.RelativePosition.y),K=V.ParentStaff.ParentInstrument.Staves;if(V.ParentStaff===K[0]){let k;K.length>1&&(k=this.getBottomStaffLine(V).Measures[I]);const W=this.createSystemLine(_,E,M,N,this,R,k),G=U.x+_;W.PositionAndShape.RelativePosition=new d.PointF2D(G,0),W.PositionAndShape.BorderLeft=0,W.PositionAndShape.BorderRight=E,this.SystemLines.push(W)}}setYPositionsToVerticalLineObjectsAndCreateLines(_){}calculateBorders(_){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(_){for(let E=0,M=_.length;E1){let R,V;for(let U=0,K=this.staffLines.length;Uthis.maxLabelLength&&(this.maxLabelLength=k.PositionAndShape.Size.width,E=R)}this.updateMusicSystemStaffLineXPosition(E)}setMusicSystemLabelsYPosition(){this.labels.forEach((_,E)=>{let M=0,N=0;for(let I=0;I0&&(E.PositionAndShape.RelativePosition=new d.PointF2D(0,M/N+2))})}checkStaffEntriesForStaffEntryLink(){let _=!1,E=!1;for(let M=0;M=0;M--){if(E=_.InstrumentalGroups[M],!(E instanceof h.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(E);if(E.Visible===!0)return E}}updateMusicSystemStaffLineXPosition(_){for(let E=0,M=this.StaffLines.length;E{Object.defineProperty(a,"__esModule",{value:!0}),a.MeasureBuildParameters=a.SystemBuildParameters=a.MusicSystemBuilder=void 0;const h=r(599),s=r(3331),m=r(5198),c=r(289),o=r(9086),u=r(6729),d=r(6894),x=r(4040),p=r(289),v=r(2337),S=r(1225);a.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(P,_,E){this.leadSheet=P.LeadSheet,this.graphicalMusicSheet=P,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=_,this.numberOfVisibleStaffLines=E,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){var P,_,E;const M=this.getFullPageSystemWidth();let N=!1;for(this.measureListIndex=0,this.currentSystemParams=new T,this.currentSystemParams.currentSystem=this.initMusicSystem();this.measureListIndex0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const P of this.musicSystems)this.optimizeDistanceBetweenStaffLines(P);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(P,_,E,M){for(let N=0,I=P.length;N0&&(R.beginInstructionsWidth=E),M>0&&(R.endInstructionsWidth=M)}}finalizeCurrentAndCreateNewSystem(P,_=!1,E=!0,M=!1){this.finalizeCurrentSystem(P,_,E,M),this.currentSystemParams=new T,P!==void 0&&this.measureListIndex=1){const _=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let E=0;const M=P[P.length-1];M.endLine===d.SystemLinesEnum.DotsBoldBoldDots&&(M.endLine=d.SystemLinesEnum.DotsThinBold,E=_[0].getLineWidth(d.SystemLinesEnum.DotsBoldBoldDots)/2-_[0].getLineWidth(d.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=E;for(let N=0,I=_.length;N1){I=!0;break}}let R=0;for(let V=0;V=0&&this.measureList[L]){const H=(I=this.measureList[L][0])===null||I===void 0?void 0:I.parentSourceMeasure;H!=null&&H.ImplicitMeasure&&(H!=null&&H.RhythmPrinted)&&(X=!1)}X&&(_.addRhythmAtBegin(U),_.parentSourceMeasure.RhythmPrinted=U,G=!0)}return(k||W||G)&&(K+=_.beginInstructionsWidth,G&&(K+=this.rules.RhythmRightMargin)),K}addInstructionsAtMeasureEnd(P,_,E){if(!P||!P.Instructions||P.Instructions.length===0)return 0;for(let M=0,N=P.Instructions.length;M0&&(this.currentSystemParams.systemMeasures.push({beginLine:d.SystemLinesEnum.None,endLine:d.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=M,this.currentSystemParams.currentSystemFixWidth+=M)}addExtraInstructionMeasure(P,_,E){const M=this.currentSystemParams.currentSystem,N=x.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(M.StaffLines[P]);_&&N.addKeyAtBegin(_,this.activeKeys[P],this.activeClefs[P]),E!==void 0&&E.PrintObject&&N.addRhythmAtBegin(E),N.PositionAndShape.BorderLeft=0,N.PositionAndShape.BorderTop=0,N.PositionAndShape.BorderBottom=this.rules.StaffHeight;const I=this.rules.MeasureLeftMargin+N.beginInstructionsWidth+this.rules.MeasureRightMargin;return N.PositionAndShape.BorderRight=I,M.StaffLines[P].Measures.push(N),I}addStaveMeasuresToSystem(P){if(P[0]){const _=[];for(let M=0;M1){const _=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,P.measureListIndex+P.multipleRestMeasures-1);P=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[_]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?d.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?d.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?d.SystemLinesEnum.DoubleThin:P&&P.endingBarStyleEnum!==void 0?P.endingBarStyleEnum:d.SystemLinesEnum.SingleThin}getLineWidth(P,_,E){let M=P.getLineWidth(_);return _===d.SystemLinesEnum.DotsBoldBoldDots&&(M/=2),E&&_===d.SystemLinesEnum.BoldThinDots&&(M+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),M}previousMeasureEndsLineRepetition(){if(this.measureListIndex===0)return!1;for(let P=0,_=this.measureList[this.measureListIndex-1].length;P<_;++P)if(this.measureList[this.measureListIndex-1][P].endsWithLineRepetition())return!0;return!1}thisMeasureBeginsLineRepetition(){for(let P=0,_=this.measureList[this.measureListIndex].length;P<_;++P)if(this.measureList[this.measureListIndex][P].beginsWithLineRepetition())return!0;return!1}nextMeasureBeginsLineRepetition(){const P=this.measureListIndex+1;if(P>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[P])return!1;for(let _=0,E=this.measureList[P].length;_=V))break;I=K,V=K.multipleRestMeasureNumber}return I.endsWithLineRepetition()}}return!1}nextMeasureBeginsWordRepetition(){const P=this.measureListIndex+1;if(P>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||P>this.measureList.length-1)return!1;for(let _=0,E=this.measureList[P].length;_this.rules.PageHeight-this.rules.PageBottomMargin&&(M++,M<=4&&console.log(`warning: could not fit a single system on page ${P.PageNumber} and measure number ${E.GraphicalMeasures[0][0].MeasureNumber}. - The PageFormat may be too small for this sheet." - Will not give further warnings for all pages, only total.`))}else{const I=this.musicSystems[N-1],R=I.StaffLines[I.StaffLines.length-1],V=R.PositionAndShape;let U=this.findRequiredDistanceWithSkyBottomLine(I,E);U+=this.rules.MinSkyBottomDistBetweenSystems,U=Math.max(U,this.rules.MinimumDistanceBetweenSystems+R.StaffHeight);const K=_+V.RelativePosition.y+U,k=K+E.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&I.breaksPage||!(k0&&console.log(`total amount of pages that couldn't fit a single music system: ${M} of ${P.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(P,_){const E=P.StaffLines[P.StaffLines.length-1],M=_.StaffLines[0],N=E.BottomLine,I=M.SkyLine,R=E.PositionAndShape,V=M.PositionAndShape,U=1/this.rules.SamplingUnit;let K=0;for(let k=0;k=I.length)break;const X=Math.max(0,G-6),L=Math.min(I.length-1,G+6);let H=0;for(let ie=X;ie<=L;ie++)H=Math.min(H,I[ie]);const ne=W-H;K=Math.max(ne,K)}return K===0&&(K=R.BorderBottom-V.BorderTop),K}};class T{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return this.systemMeasureIndex===0}}a.SystemBuildParameters=T,a.MeasureBuildParameters=class{}},4574:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OctaveShiftParams=void 0,a.OctaveShiftParams=class{constructor(r,h,s){this.getOpenOctaveShift=r,this.getAbsoluteStartTimestamp=h,this.getAbsoluteEndTimestamp=s}}},9059:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PlainSkyBottomLineBatchCalculatorBackend=void 0;const h=r(1378),s=r(9531);class m extends s.SkyBottomLineBatchCalculatorBackend{constructor(o,u){super(o,u)}getPreferredRenderingConfiguration(o,u){return{elementWidth:Math.ceil(o),numColumns:6,numRows:6}}onInitialize(o){}calculateFromCanvas(o,u,d,x,p){const v=o.width,S=u.getImageData(0,0,o.width,o.height),{elementWidth:T,elementHeight:P,numColumns:_}=p,E=[];for(let M=0;M0){W[H-V]=ne-K;break}}G[H-V]=P;for(let ne=k-1;ne>=K;ne--){const ie=ne*v*4+4*H;if(S.data[ie+3]>0){G[H-V]=ne-K;break}}}const X=Math.max(...W),L=Math.min(...G);for(let H=0;H{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionEndSymbol=void 0;const h=r(4785),s=r(8155),m=r(9086),c=r(8911),o=r(6729),u=r(2337);class d extends h.GraphicalObject{constructor(p,v){super();const S=v,T=p.PositionAndShape.AbsolutePosition.y,P=u.CollectionUtil.last(p.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new o.GraphicalLine(new m.PointF2D(S,T),new m.PointF2D(S,T+P),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let _=0,E=p.StaffLines.length;_{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionStartSymbol=void 0;const h=r(9086),s=r(8155),m=r(6729),c=r(4785),o=r(8911),u=r(2337);class d extends c.GraphicalObject{constructor(p,v){super();const S=v,T=p.PositionAndShape.AbsolutePosition.y,P=u.CollectionUtil.last(p.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new m.GraphicalLine(new h.PointF2D(S,T),new h.PointF2D(S,T+P),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let _=0,E=p.StaffLines.length;_{if(p.has(S))return p.get(S);{const T=[];return p.set(S,T),T}})().push({skyBottomLineCalculator:v.SkyBottomLineCalculator,measures:v.Measures})}this.batches=new Map;for(const[v,S]of p.entries()){const T=u.CollectionUtil.flat(S.map(_=>_.measures)),P=(()=>{if(x===s.SkyBottomLineBatchCalculatorBackendType.Plain)return new m.PlainSkyBottomLineBatchCalculatorBackend(v,T).initialize();try{return new c.WebGLSkyBottomLineBatchCalculatorBackend(v,T).initialize()}catch{return o.default.info("Couldn't create WebGLBackend for Skyline. Using fallback."),new m.PlainSkyBottomLineBatchCalculatorBackend(v,T).initialize()}})();P.initialize(),this.batches.set(v,{backend:P,entries:S})}}calculateLines(){for(const[,{backend:d,entries:x}]of this.batches){const p=d.calculateLines();let v=0;for(const{skyBottomLineCalculator:S,measures:T}of x){const P=v+T.length;S.updateLines(p.slice(v,P)),v=P}}}}},9531:function(b,a,r){var h=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(a,"__esModule",{value:!0}),a.SkyBottomLineBatchCalculatorBackend=void 0;const s=r(4028),m=h(r(2043));a.SkyBottomLineBatchCalculatorBackend=class{constructor(c,o){this.elementHeight=300,this.canvas=new s.CanvasVexFlowBackend(c),this.measures=o,this.maxWidth=Math.max(...this.measures.map(u=>{let d=u.getVFStave().getWidth();return d>0||u.IsExtraGraphicalMeasure||(m.default.warn("SkyBottomLineBatchCalculatorBackend: width not > 0 in measure "+u.MeasureNumber),d=50),d})),this.samplingUnit=c.SamplingUnit}initialize(){if(this.tableConfiguration=Object.assign(Object.assign({},this.getPreferredRenderingConfiguration(this.maxWidth,this.elementHeight)),{elementHeight:this.elementHeight}),this.tableConfiguration.numRows<1||this.tableConfiguration.numColumns<1)throw m.default.warn("SkyBottomLineBatchCalculatorBackend: numRows or numColumns in tableConfiguration is 0"),new Error("numRows or numColumns in tableConfiguration is 0");this.tableConfiguration.elementWidth0||N.IsExtraGraphicalMeasure||(U=50),U=Math.floor(U),N.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),I.setX(0);const k=I.y+100;I.setY(k);const W=I.getWidth();I.setWidth(U),N.format(),I.setWidth(W);try{v.translate(R*u,V*d),N.draw(p),v.translate(-R*u,-V*d)}catch(G){m.default.warn("SkyBottomLineBatchCalculatorBackend.calculateLines.draw",G)}}const E=this.calculateFromCanvas(S,p,_,this.samplingUnit,this.tableConfiguration);T.push(...E)}return T}}},1378:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SkyBottomLineCalculationResult=void 0,a.SkyBottomLineCalculationResult=class{constructor(r,h){this.skyLine=r,this.bottomLine=h}}},6040:function(b,a,r){var h=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(a,"__esModule",{value:!0}),a.SkyBottomLineCalculator=void 0,r(9086);const s=r(5820),m=h(r(2043)),c=r(1378),o=r(4028);a.SkyBottomLineCalculator=class{constructor(u){this.mStaffLineParent=u,this.mRules=u.ParentMusicSystem.rules}updateLines(u){const d=this.StaffLineParent.Measures;if(u.length!==d.length)if(m.default.warn("SkyBottomLineCalculator: lengths of calculation result array and measure array do not match"),u.length(_-T)/s.unitInPixels+this.StaffLineParent.TopLineOffset);const P=Math.min(...this.mBottomLine);this.mBottomLine=this.mBottomLine.map(_=>(_-P)/s.unitInPixels+this.StaffLineParent.BottomLineOffset)}calculateLines(){const u=this.mRules.SamplingUnit,d=[],x=new o.CanvasVexFlowBackend(this.mRules);for(const p of this.StaffLineParent.Measures){p.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const v=p.getVFStave();let S=v.getWidth();S>0||p.IsExtraGraphicalMeasure||(m.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+p.MeasureNumber),S=50),x.initializeHeadless(S);const T=x.getContext(),P=x.getCanvas();S=P.width;const _=P.height;v.setY(v.y+100);const E=v.getWidth();v.setWidth(S),p.format(),v.setWidth(E);try{p.draw(T)}catch(U){m.default.warn("SkyBottomLineCalculator.calculateLines.draw",U)}const M=T.getImageData(0,0,S,_),N=4,I=Math.max(Math.ceil(p.PositionAndShape.Size.width*u),1),R=new Array(I),V=new Array(I);for(let U=0;U0){R[U]=K;break}}for(let K=_;K>0;K--){const k=K*S*N+U*N;if(M.data[k+3]>0){V[U]=K;break}}}for(let U=0;U=this.BottomLine.length&&(x=this.BottomLine.length-1),p<0&&(p=0),p>=this.BottomLine.length&&(p=this.BottomLine.length),this.SkyLine[x]=u.y;for(let S=x+1;S=this.BottomLine.length&&(x=this.BottomLine.length-1),p<0&&(p=0),p>=this.BottomLine.length&&(p=this.BottomLine.length),this.BottomLine[x]=u.y;for(let S=x+1;Su)}setBottomLineWithValue(u){this.BottomLine.forEach(d=>u)}getLeftIndexForPointX(u,d){const x=Math.floor(u*this.SamplingUnit);return x<0?0:x>=d?d-1:x}getRightIndexForPointX(u,d){const x=Math.ceil(u*this.SamplingUnit);return x<0?0:x>=d?d-1:x}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter(u=>!isNaN(u)))}getSkyLineMinAtPoint(u){const d=Math.round(u*this.SamplingUnit);return this.mSkyLine[d]}getSkyLineMinInRange(u,d){return this.getMinInRange(this.SkyLine,u,d)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(u=>!isNaN(u)))}getBottomLineMaxAtPoint(u){const d=Math.round(u*this.SamplingUnit);return this.mBottomLine[d]}getBottomLineMaxInRange(u,d){return this.getMaxInRange(this.BottomLine,u,d)}getBottomLineMaxInBoundingBox(u){const d=Math.floor(u.AbsolutePosition.x+u.BorderLeft),x=Math.ceil(u.AbsolutePosition.x+u.BorderRight);return this.getMaxInRange(this.mBottomLine,d,x)}updateWithBoundingBoxRecursively(u){if(u.ChildElements&&u.ChildElements.length>0)this.updateWithBoundingBoxRecursively(u);else{const d=u.BorderTop+u.AbsolutePosition.y,x=u.BorderBottom+u.AbsolutePosition.y;if(d<0){const p=Math.floor(u.AbsolutePosition.x+u.BorderLeft),v=Math.ceil(u.AbsolutePosition.x+u.BorderRight);this.updateInRange(this.mSkyLine,p,v,d)}else if(x>this.StaffLineParent.StaffHeight){const p=Math.floor(u.AbsolutePosition.x+u.BorderLeft),v=Math.ceil(u.AbsolutePosition.x+u.BorderRight);this.updateInRange(this.mBottomLine,p,v,x)}}}findPreviousValidNumber(u,d){for(let x=u;x>=0;x--)if(!isNaN(d[x]))return d[x];return 0}findNextValidNumber(u,d){if(u>=d.length)return d[u-1];for(let x=u;xu.length&&(x=u.length);for(let v=d;vMath.abs(u[v])?p:u[v]}setInRange(u,d=0,x=u.length,p=0){if(d=Math.floor(d*this.SamplingUnit),(x=Math.ceil(x*this.SamplingUnit))u.length&&(x=u.length);for(let v=d;v=u.length&&(d=u.length-1),x<0&&(x=0),x>=u.length&&(x=u.length),d>=0&&x<=u.length?Math.min(...u.slice(d,x+1)):void 0):Number.MAX_VALUE}getMaxInRange(u,d,x){return d=Math.floor(d*this.SamplingUnit),x=Math.ceil(x*this.SamplingUnit),u?(d<0&&(d=0),d>=u.length&&(d=u.length-1),x<0&&(x=0),x>=u.length&&(x=u.length),d>=0&&x<=u.length?Math.max(...u.slice(d,x+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},9953:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StaffLine=void 0;const h=r(8911),s=r(4785),m=r(4196),c=r(9086),o=r(6040);class u extends s.GraphicalObject{constructor(x,p){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.graphicalGlissandi=[],this.Pedals=[],this.parentMusicSystem=x,this.parentStaff=p,this.boundingBox=new h.BoundingBox(this,x.PositionAndShape),this.skyBottomLine=new o.SkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)this.ParentStaff.StafflineCount===5?this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(x){this.measures=x}get StaffLines(){return this.staffLines}set StaffLines(x){this.staffLines=x}get NextStaffLine(){const x=this.parentMusicSystem.StaffLines.indexOf(this);return x!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[x+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(x){this.abstractExpressions=x}set LyricLines(x){this.lyricLines=x}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(x){this.lyricsDashes=x}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(x){this.parentMusicSystem=x}get ParentStaff(){return this.parentStaff}set ParentStaff(x){this.parentStaff=x}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(x){this.octaveShifts=x}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}get GraphicalGlissandi(){return this.graphicalGlissandi}addSlurToStaffline(x){this.graphicalSlurs.push(x)}addGlissandoToStaffline(x){this.graphicalGlissandi.push(x),x.StaffLine=this}addActivitySymbolClickArea(){const x=new m.StaffLineActivitySymbol(this),p=this.PositionAndShape;x.PositionAndShape.RelativePosition=new c.PointF2D(p.RelativePosition.x+p.BorderRight+.5,p.RelativePosition.y+.5),x.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(x){let p;for(let v=0,S=this.Measures.length;v{Object.defineProperty(a,"__esModule",{value:!0}),a.StaffLineActivitySymbol=void 0;const h=r(4785),s=r(8911);class m extends h.GraphicalObject{constructor(o){super(),this.parentStaffLine=o;const u=o.PositionAndShape;this.boundingBox=new s.BoundingBox(this,u),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}a.StaffLineActivitySymbol=m},7771:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SystemLine=void 0;const h=r(6894),s=r(8911),m=r(4785);class c extends m.GraphicalObject{constructor(u,d,x,p,v=void 0){super(),this.lineType=u,this.linePosition=d,this.parentMusicSystem=x,this.topMeasure=p,this.bottomMeasure=v,this.parentTopStaffLine=p==null?void 0:p.ParentStaffLine,this.boundingBox=new s.BoundingBox(this,x.PositionAndShape)}static getObjectWidthForLineType(u,d){switch(d){case h.SystemLinesEnum.SingleThin:return u.SystemThinLineWidth;case h.SystemLinesEnum.DoubleThin:return 2*u.SystemThinLineWidth+u.DistanceBetweenVerticalSystemLines;case h.SystemLinesEnum.ThinBold:return u.SystemThinLineWidth+u.SystemBoldLineWidth+u.DistanceBetweenVerticalSystemLines;case h.SystemLinesEnum.BoldThinDots:case h.SystemLinesEnum.DotsThinBold:return u.SystemThinLineWidth+u.SystemBoldLineWidth+u.DistanceBetweenVerticalSystemLines+u.SystemDotWidth+u.DistanceBetweenDotAndLine;case h.SystemLinesEnum.DotsBoldBoldDots:return 2*u.SystemBoldLineWidth+2*u.SystemDotWidth+2*u.DistanceBetweenDotAndLine+u.DistanceBetweenVerticalSystemLines;default:return 0}}}a.SystemLine=c},1225:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.SystemLinePosition=void 0,(r=a.SystemLinePosition||(a.SystemLinePosition={}))[r.MeasureBegin=0]="MeasureBegin",r[r.MeasureEnd=1]="MeasureEnd"},6894:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.SystemLinesEnumHelper=a.SystemLinesEnum=void 0,function(h){h[h.SingleThin=0]="SingleThin",h[h.DoubleThin=1]="DoubleThin",h[h.ThinBold=2]="ThinBold",h[h.BoldThinDots=3]="BoldThinDots",h[h.DotsThinBold=4]="DotsThinBold",h[h.DotsBoldBoldDots=5]="DotsBoldBoldDots",h[h.None=6]="None",h[h.Dotted=7]="Dotted",h[h.Dashed=8]="Dashed",h[h.Bold=9]="Bold",h[h.BoldThin=10]="BoldThin",h[h.DoubleBold=11]="DoubleBold",h[h.Tick=12]="Tick",h[h.Short=13]="Short"}(r=a.SystemLinesEnum||(a.SystemLinesEnum={})),a.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(h){return h==="regular"?r.SingleThin:h==="dotted"?r.Dotted:h==="dashed"?r.Dashed:h==="heavy"?r.Bold:h==="light-light"?r.DoubleThin:h==="light-heavy"?r.ThinBold:h==="heavy-light"?r.BoldThin:h==="heavy-heavy"?r.DoubleBold:h==="tick"?r.Tick:h==="short"?r.Short:h==="none"?r.None:r.SingleThin}}},525:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VerticalGraphicalStaffEntryContainer=void 0,a.VerticalGraphicalStaffEntryContainer=class{constructor(r,h){this.staffEntries=[],this.absoluteTimestamp=h,this.staffEntries=new Array(r)}get Index(){return this.index}set Index(r){this.index=r}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(r){this.staffEntries=r}static compareByTimestamp(r,h){const s=r.absoluteTimestamp.RealValue,m=h.absoluteTimestamp.RealValue;return sm?1:0}getFirstNonNullStaffEntry(){for(let r=0,h=this.staffEntries.length;r{Object.defineProperty(a,"__esModule",{value:!0}),a.AlignmentManager=void 0;const h=r(9344),s=r(9086);a.AlignmentManager=class{constructor(m){this.parentStaffline=m,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var m,c;const o=[];let u=new Array;for(let d=0;d0){const x=d.map(v=>v.PositionAndShape.Center.y),p=Math.max(...x);for(let v=0;v0?d[v-1]:void 0;if(P){const E=this.getOverlap(S.PositionAndShape,P.PositionAndShape);S.squeeze(-(E.x+this.rules.DynamicExpressionSpacer))}if(_){const E=this.getOverlap(_.PositionAndShape,S.PositionAndShape);S.squeeze(E.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(m,c){const o=m.RelativePosition.x+m.BorderMarginRight,u=c.RelativePosition.x+c.BorderMarginLeft,d=m.RelativePosition.y+m.BorderMarginBottom,x=c.RelativePosition.y+c.BorderMarginTop;return new s.PointF2D(u-o,x-d)}getOverlap(m,c){return new s.PointF2D(m.RelativePosition.x+m.BorderMarginRight-(c.RelativePosition.x+c.BorderMarginLeft),m.RelativePosition.y+m.BorderMarginBottom-(c.RelativePosition.y+c.BorderMarginTop))}}},4028:function(b,a,r){var h=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasVexFlowBackend=void 0;var s=h(r(6368)).default.Flow;const m=r(709),c=r(8129),o=r(41),u=r(599);class d extends m.VexFlowBackend{constructor(p){super(),this.rules=p}getVexflowBackendType(){return s.Renderer.Backends.CANVAS}getOSMDBackendType(){return o.BackendType.Canvas}getCanvasSize(){var p;return(p=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))===null||p===void 0?void 0:p.offsetHeight}initialize(p,v){this.zoom=v,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new u.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),p.appendChild(this.inner),this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(p=300,v=300){this.graphicalMusicPage||(this.graphicalMusicPage=new u.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=p,this.canvas.height=v,this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}free(){this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas,this.canvas=null)}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(p){this.ctx.scale(p,p)}translate(p,v){this.CanvasRenderingCtx.translate(p,v)}renderText(p,v,S,T,P,_,E=void 0,M=void 0){const N=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=c.VexFlowConverter.font(p,v,S,this.rules,M),this.CanvasRenderingCtx.fillStyle=E,this.CanvasRenderingCtx.strokeStyle=E,this.CanvasRenderingCtx.fillText(T,_.x,_.y+P),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=N}renderRectangle(p,v,S,T=1){const P=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=S||c.VexFlowConverter.style(v),this.CanvasRenderingCtx.globalAlpha=T,this.ctx.fillRect(p.x,p.y,p.width,p.height),this.CanvasRenderingCtx.fillStyle=P,this.CanvasRenderingCtx.globalAlpha=1}renderLine(p,v,S="#FF0000FF",T=2,P){const _=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=S,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(p.x,p.y),this.CanvasRenderingCtx.lineTo(v.x,v.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=_}renderCurve(p){this.ctx.beginPath(),this.ctx.moveTo(p[0].x,p[0].y),this.ctx.bezierCurveTo(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y),this.ctx.lineTo(p[7].x,p[7].y),this.ctx.bezierCurveTo(p[6].x,p[6].y,p[5].x,p[5].y,p[4].x,p[4].y),this.ctx.lineTo(p[0].x,p[0].y),this.ctx.closePath(),this.ctx.fill()}renderPath(p,v=!0,S){let T;this.ctx.beginPath();for(const P of p)T?this.ctx.lineTo(P.x,P.y):(this.ctx.moveTo(P.x,P.y),T=P);this.ctx.closePath(),v?this.ctx.fill():this.ctx.stroke()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}a.CanvasVexFlowBackend=d},9505:function(b,a,r){var h=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0}),a.SvgVexFlowBackend=void 0;var s=h(r(6368)).default.Flow;const m=r(709),c=r(8129),o=r(2562),u=r(41),d=h(r(2043));class x extends m.VexFlowBackend{constructor(v){super(),this.rules=v}getVexflowBackendType(){return s.Renderer.Backends.SVG}getOSMDBackendType(){return u.BackendType.SVG}getCanvasSize(){var v;return(v=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))===null||v===void 0?void 0:v.offsetHeight}initialize(v,S){this.zoom=S,this.canvas=document.createElement("div"),this.canvas.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",v.appendChild(this.inner),this.renderer=new s.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id="osmdSvgPage"+this.graphicalMusicPage.PageNumber}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(v){var S;const T=(S=this.ctx)===null||S===void 0?void 0:S.svg;if(!T)return!1;try{T.removeChild(v)}catch(P){return d.default.error(P),!1}return!0}free(){const v=this.ctx.svg;for(;v.lastChild;)v.removeChild(v.lastChild)}clear(){this.ctx&&(this.free(),this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor))}scale(v){this.ctx.scale(v,v)}translate(v,S){}renderText(v,S,T,P,_,E,M=void 0,N=void 0){this.ctx.save();const I=this.ctx.openGroup("text");M&&(this.ctx.attributes.fill=M,this.ctx.attributes.stroke=M);let R=N;N&&N!=="default"||(R=this.rules.DefaultFontFamily),this.ctx.setFont(R,v,c.VexFlowConverter.fontStyle(S)),this.ctx.attributes["font-size"]=`${v}px`,this.ctx.state["font-size"]=`${v}px`;let V="normal",U="normal";switch(S){case o.FontStyles.Bold:V="bold";break;case o.FontStyles.Italic:U="italic";break;case o.FontStyles.BoldItalic:V="bold",U="italic";break;default:V="normal"}return this.ctx.attributes["font-weight"]=V,this.ctx.state["font-weight"]=V,this.ctx.attributes["font-style"]=U,this.ctx.state["font-style"]=U,this.ctx.fillText(P,E.x,E.y+_),this.ctx.closeGroup(),this.ctx.restore(),I}renderRectangle(v,S,T,P=1){this.ctx.save();const _=this.ctx.openGroup("rect");return this.ctx.attributes.fill=T||c.VexFlowConverter.style(S),this.ctx.attributes["fill-opacity"]=P,this.ctx.fillRect(v.x,v.y,v.width,v.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),_}renderLine(v,S,T="#FF0000FF",P=2,_){this.ctx.save();const E=this.ctx.openGroup("line",_);return this.ctx.beginPath(),this.ctx.moveTo(v.x,v.y),this.ctx.lineTo(S.x,S.y),this.ctx.attributes.stroke=T,this.ctx.lineWidth=P,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),E}renderCurve(v){const S=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(v[0].x,v[0].y),this.ctx.bezierCurveTo(v[1].x,v[1].y,v[2].x,v[2].y,v[3].x,v[3].y),this.ctx.lineTo(v[7].x,v[7].y),this.ctx.bezierCurveTo(v[6].x,v[6].y,v[5].x,v[5].y,v[4].x,v[4].y),this.ctx.lineTo(v[0].x,v[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),S}renderPath(v,S=!0,T){const P=this.ctx.openGroup("path",T);let _;this.ctx.beginPath();for(const E of v)_?this.ctx.lineTo(E.x,E.y):(this.ctx.moveTo(E.x,E.y),_=E);return this.ctx.closePath(),S?this.ctx.fill():this.ctx.stroke(),this.ctx.stroke(),this.ctx.closeGroup(),P}export(){const v=this.ctx.svg.cloneNode(!0),S=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),T=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",S);T.replaceChild(v,T.documentElement);const P=new XMLSerializer().serializeToString(T),_=document.createElement("a");_.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(P.replace(/> -\r<`)),_.download="opensheetmusicdisplay_download.svg",_.innerHTML=window.location.href+"/download",document.body.appendChild(_)}}a.SvgVexFlowBackend=x},709:function(b,a,r){var h=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowBackend=a.VexFlowBackends=void 0;var s=h(r(6368)).default.Flow;a.VexFlowBackends=class{},a.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let m=this.canvas;return this.getVexflowBackendType()===s.Renderer.Backends.CANVAS&&(m=this.inner),m}getRenderer(){return this.renderer}removeAllChildrenFromContainer(m){for(;m.children.length!==0;)m.removeChild(m.children.item(0))}removeFromContainer(m){const c=this.getRenderElement();for(let o=0;o{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowContinuousDynamicExpression=void 0;const h=r(374),s=r(9946),m=r(2255),c=r(1274),o=r(2562);class u extends h.GraphicalContinuousDynamicExpression{constructor(x,p,v,S){if(super(x,p,v),this.IsVerbal){const T=new m.Label(x.Label);this.label=new s.GraphicalLabel(T,S||this.rules.ContinuousDynamicTextHeight,c.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=o.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}}}a.VexFlowContinuousDynamicExpression=u},8129:function(b,a,r){var h=this&&this.__importDefault||function(W){return W&&W.__esModule?W:{default:W}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowConverter=void 0;var s=h(r(6368)).default.Flow;const m=r(289),c=r(8640),o=r(1797),u=r(3331),d=r(5198),x=r(8640),p=r(8640),v=r(6894),S=r(2562),T=r(96),P=r(8155),_=h(r(2043)),E=r(908),M=r(1225),N=r(5922),I=r(766),R=r(5820),V=r(3029),U=r(2953),K=r(3748);class k{static durations(G,X){const L=[],H=G.clone();for(;H.RealValue>0;){const ne=H.RealValue;if(ne>=2)L.push("1/2"),H.Sub(new o.Fraction(2,1));else if(ne>=1)L.push("w"),H.Sub(new o.Fraction(1,1));else if(ne<1&&ne>=.5){if(X&&ne>.5)return["w"];L.push("h"),H.Sub(new o.Fraction(1,2))}else if(ne<.5&&ne>=.25){if(X&&ne>.25)return["h"];L.push("q"),H.Sub(new o.Fraction(1,4))}else if(ne<.25&&ne>=.125){if(X&&ne>.125)return["q"];L.push("8"),H.Sub(new o.Fraction(1,8))}else if(ne<.125&&ne>=.0625){if(X&&ne>.0625)return["8"];L.push("16"),H.Sub(new o.Fraction(1,16))}else if(ne<.0625&&ne>=.03125){if(X&&ne>.03125)return["16"];L.push("32"),H.Sub(new o.Fraction(1,32))}else if(ne<.03125&&ne>=.015625){if(X&&ne>.015625)return["32"];L.push("64"),H.Sub(new o.Fraction(1,64))}else{if(X)return["64"];L.push("128"),H.Sub(new o.Fraction(1,128))}}return L}static pitch(G,X,L,H=void 0,ne=void 0){let ie=ne;ne===void 0&&(ie=3),X&&ne===void 0&&(ie=0,L.ClefType===m.ClefEnum.F&&(ie=2),L.ClefType===m.ClefEnum.C&&(ie=2));const be=p.NoteEnum[G.FundamentalNote].toLowerCase(),ae=c.Pitch.accidentalVexflow(G.Accidental),ge=G.Octave-L.OctaveOffset+ie;let ce="";return H&&(ce=this.NoteHeadCode(H)),[be+"n/"+ge+ce,ae,L]}static restToNotePitch(G,X){let L=G.Octave;switch(X){case m.ClefEnum.C:case m.ClefEnum.F:L+=2;case m.ClefEnum.G:}return new c.Pitch(G.FundamentalNote,L,x.AccidentalEnum.NONE)}static NoteHeadCode(G){const X=G.Filled?"2":"1";switch(G.Shape){case I.NoteHeadShape.NORMAL:return"";case I.NoteHeadShape.DIAMOND:return"/D"+X;case I.NoteHeadShape.TRIANGLE:return"/T"+X;case I.NoteHeadShape.TRIANGLE_INVERTED:return"/TI";case I.NoteHeadShape.X:return"/X"+X;case I.NoteHeadShape.CIRCLEX:return"/X3";case I.NoteHeadShape.RECTANGLE:return"/R"+X;case I.NoteHeadShape.SQUARE:return"/S"+X;case I.NoteHeadShape.SLASH:default:return""}}static GhostNotes(G){const X=[],L=k.durations(G,!1);for(const H of L)X.push(new s.GhostNote({duration:H}));return X}static StaveNote(G){var X,L,H,ne,ie,be,ae,ge,ce,ee;G.sortForVexflow();const ye=G.notes,Ee=G.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,j=ye[0];let te=[];const re=[],O=j.graphicalNoteLength,z=j.sourceNote.NoteTuplet!==void 0;let Y,q=k.durations(O,z)[0];j.sourceNote.TypeLength!==void 0&&j.sourceNote.TypeLength!==O&&j.sourceNote.TypeLength.RealValue!==0&&(q=k.durations(j.sourceNote.TypeLength,z)[0],j.numberOfDots=j.sourceNote.DotsXml);let de,le,he=j.numberOfDots,me=!1,_e=0,Me=!1;for(const Re of ye){if(he=1&&Ke.length-1>=ft+1&&(Ze=(ie=(ne=Ke[ft-1])===null||ne===void 0?void 0:ne.graphicalVoiceEntries[0])===null||ie===void 0?void 0:ie.parentVoiceEntry,st=(ae=(be=Ke[ft+1])===null||be===void 0?void 0:be.graphicalVoiceEntries[0])===null||ae===void 0?void 0:ae.parentVoiceEntry,Ze&&st)){const xt=Ze.Notes[0],ut=st.Notes[0];if(!((ge=xt.NoteBeam)===null||ge===void 0)&&ge.Notes.includes(ut)){const Et=Ze.Notes.last().Pitch,dt=Re.Clef();te=[k.pitch(k.restToNotePitch(Et.getTransposedPitch(-2),dt.ClefType),!1,dt)[0]]}}}}if((Re.sourceNote.IsWholeMeasureRest||O.RealValue===Re.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue)&&(te=["d/5"],G.parentStaffEntry.parentMeasure.ParentStaff.StafflineCount===1&&(te=["b/4"]),q="w",he=0,me=!0,_e=Ee.WholeRestXShiftVexflow*R.unitInPixels),Re.sourceNote.ParentStaff.Voices.length>1){const qe=Re.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,Ke=Re.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let Ze,st;for(const ft of qe)for(const xt of ft.notes){if(xt===Re||xt.sourceNote.isRest()||!xt.sourceNote.PrintObject)continue;const ut=xt.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,Et=Ke===1||Ke===5,dt=Et?1:-1,Tt=xt.sourceNote.Pitch.getHalfTone();(!Ze||dt===1&&Tt>Ze||dt===-1&&Tt0){let ft=3;const xt=Re.Clef();switch(xt.ClefType){case m.ClefEnum.F:ft=5;break;case m.ClefEnum.C:ft=4}de=c.Pitch.fromHalftone(Ze),te=[k.pitch(de,!0,xt,void 0,ft)[0]]}}break}const We=Re.vfpitch;te.push(We[0]),re.push(We[1]),Y||(Y=k.Clef(We[2]).type)}for(let Re=0,We=he;Re0&&Ee.RenderLyrics&&Ee.LyricsUseXPaddingForLongLyrics){const Ke=G.parentStaffEntry.parentMeasure,Ze=[];for(let xt=Ke.staffEntries.indexOf(G.parentStaffEntry)+1;xt.25){We=!1;break}if(xt.LyricsEntries.length>0)break;qe+=32*o.Fraction.minus(ut,ft).RealValue,ft=ut}}if(Ee.RenderLyrics&&Ee.LyricsUseXPaddingForLongLyrics&&Re.length>0&&We){let Ke=!1,Ze=0;for(const ft of ye)if(ft.sourceNote.Length.RealValue<=.125){Ke=!0;break}let st=!1;for(const ft of Re){const xt=Ee.LyricsXPaddingWidthThreshold;let ut=ft.GraphicalLabel.PositionAndShape.Size.width;if(ft.hasDashFromLyricWord()&&(ut+=.5),ut>xt){Ze+=ut-xt;const Et=G.parentStaffEntry,dt=Et.parentMeasure.staffEntries,Tt=dt.indexOf(Et)===dt.length-1;Tt&&(qe+=Ee.LyricsXPaddingReductionForLastNoteInMeasure),Ke||(qe+=Ee.LyricsXPaddingReductionForLongNotes),!Ee.LyricsXPaddingForLastNoteInMeasure&&Tt||ut>xt+qe&&(st=!0,Ze-=qe);break}}st&&(le.paddingRight=10*Ee.LyricsXPaddingFactorForLongLyrics*Ze)}}const Qe=G.notes[0].lineShift;if(Qe!==0&&(le.getKeyProps()[0].line+=Qe),ye.length>1)for(let Re=0;ReG.notes[We].staffLine=Re),(Ee.LedgerLineWidth||Ee.LedgerLineStrokeStyle)&&(le.ledgerLineStyle||(le.ledgerLineStyle={}),Ee.LedgerLineWidth&&(le.ledgerLineStyle.lineWidth=Ee.LedgerLineWidth),Ee.LedgerLineStrokeStyle&&(le.ledgerLineStyle.strokeStyle=Ee.LedgerLineStrokeStyle)),Ee.ColoringEnabled){const Re=Ee.DefaultColorStem;let We=G.parentVoiceEntry.StemColor;!We&&Re&&(We=Re);const qe={fillStyle:We,strokeStyle:We};We&&(le.setStemStyle(qe),le.flag&&Ee.ColorFlags&&le.setFlagStyle(qe))}if(le.x_shift=_e,G.parentVoiceEntry.IsGrace&&G.notes[0].sourceNote.NoteBeam&&(G.parentVoiceEntry.WantedStemDirection=G.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),G.parentVoiceEntry)switch(G.parentVoiceEntry.WantedStemDirection){case E.StemDirectionType.Up:le.setStemDirection(s.Stem.UP),G.parentVoiceEntry.StemDirection=E.StemDirectionType.Up;break;case E.StemDirectionType.Down:le.setStemDirection(s.Stem.DOWN),G.parentVoiceEntry.StemDirection=E.StemDirectionType.Down}for(let Re=0,We=ye.length;Re0){const Ke=new s.Tremolo(qe);Ke.extra_stroke_scale=Ee.TremoloStrokeScale,Ke.y_spacing_scale=Ee.TremoloYSpacingScale,le.addModifier(Re,Ke)}}if(Ge.Length.RealValue===.25&&Ge.Notehead&&Ge.Notehead.Filled===!1){const Re=le.getKeyProps();for(let We=0;We");const ae=X.sourceNote.NoteSlurs;for(const ge of ae)ge.StartNote===X.sourceNote&&(ge.PlacementXml===K.PlacementEnum.Above?ne.setYShift(10*-L.SlurStartArticulationYOffsetOfArticulation):ge.PlacementXml===K.PlacementEnum.Below&&ne.setYShift(10*L.SlurStartArticulationYOffsetOfArticulation));break}case E.ArticulationEnum.breathmark:ne=new s.Articulation("abr"),H.placement===K.PlacementEnum.Above&&(ie=s.Modifier.Position.ABOVE),ne.breathMarkDistance=L.BreathMarkDistance;break;case E.ArticulationEnum.downbow:ne=new s.Articulation("am"),H.placement===void 0&&(ie=s.Modifier.Position.ABOVE,H.placement=K.PlacementEnum.Above);break;case E.ArticulationEnum.fermata:ne=new s.Articulation("a@a"),ie=s.Modifier.Position.ABOVE,H.placement=K.PlacementEnum.Above;break;case E.ArticulationEnum.marcatodown:ne=new s.Articulation("a|");break;case E.ArticulationEnum.marcatoup:ne=new s.Articulation("a^"),ie=s.Modifier.Position.ABOVE;break;case E.ArticulationEnum.invertedfermata:{const ae=X.sourceNote.ParentVoiceEntry;if(ae!==X.sourceNote.ParentVoiceEntry.ParentSourceStaffEntry.VoiceEntries.last()){ae.Articulations=ae.Articulations.slice(ae.Articulations.indexOf(H)),ae.ParentSourceStaffEntry.VoiceEntries.last().Articulations.push(H);continue}ne=new s.Articulation("a@u"),ie=s.Modifier.Position.BELOW,H.placement=K.PlacementEnum.Below;break}case E.ArticulationEnum.lefthandpizzicato:ne=new s.Articulation("a+");break;case E.ArticulationEnum.naturalharmonic:ne=new s.Articulation("ah");break;case E.ArticulationEnum.snappizzicato:ne=new s.Articulation("ao");break;case E.ArticulationEnum.staccatissimo:ne=new s.Articulation("av");break;case E.ArticulationEnum.staccato:ne=new s.Articulation("a.");break;case E.ArticulationEnum.tenuto:ne=new s.Articulation("a-");break;case E.ArticulationEnum.upbow:ne=new s.Articulation("a|"),H.placement===void 0&&(ie=s.Modifier.Position.ABOVE,H.placement=K.PlacementEnum.Above);break;case E.ArticulationEnum.strongaccent:ne=new s.Articulation("a^")}ne&&(ne.setPosition(ie),G.addModifier(0,ne))}}static generateOrnaments(G,X){let L,H=s.Modifier.Position.ABOVE;switch(X.placement===K.PlacementEnum.Below&&(H=s.Modifier.Position.BELOW),X.GetOrnament){case N.OrnamentEnum.DelayedInvertedTurn:L=new s.Ornament("turn_inverted"),L.setDelayed(!0);break;case N.OrnamentEnum.DelayedTurn:L=new s.Ornament("turn"),L.setDelayed(!0);break;case N.OrnamentEnum.InvertedMordent:L=new s.Ornament("mordent"),L.setDelayed(!1);break;case N.OrnamentEnum.InvertedTurn:L=new s.Ornament("turn_inverted"),L.setDelayed(!1);break;case N.OrnamentEnum.Mordent:L=new s.Ornament("mordent_inverted"),L.setDelayed(!1);break;case N.OrnamentEnum.Trill:L=new s.Ornament("tr"),L.setDelayed(!1);break;case N.OrnamentEnum.Turn:L=new s.Ornament("turn"),L.setDelayed(!1);break;default:return void _.default.warn("unhandled OrnamentEnum type: "+X.GetOrnament)}L&&(X.AccidentalBelow!==x.AccidentalEnum.NONE&&L.setLowerAccidental(c.Pitch.accidentalVexflow(X.AccidentalBelow)),X.AccidentalAbove!==x.AccidentalEnum.NONE&&L.setUpperAccidental(c.Pitch.accidentalVexflow(X.AccidentalAbove)),L.setPosition(H),G.addModifier(0,L))}static StrokeTypeFromArpeggioType(G){switch(G){case V.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case V.ArpeggioType.BRUSH_DOWN:return s.Stroke.Type.BRUSH_UP;case V.ArpeggioType.BRUSH_UP:return s.Stroke.Type.BRUSH_DOWN;case V.ArpeggioType.RASQUEDO_DOWN:return s.Stroke.Type.RASQUEDO_UP;case V.ArpeggioType.RASQUEDO_UP:return s.Stroke.Type.RASQUEDO_DOWN;case V.ArpeggioType.ROLL_DOWN:return s.Stroke.Type.ROLL_UP;case V.ArpeggioType.ROLL_UP:return s.Stroke.Type.ROLL_DOWN;default:return s.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(G){const X=[],L=G.notes.reverse(),H=[],ne=G.notes[0].graphicalNoteLength,ie=G.notes[0].sourceNote.NoteTuplet!==void 0;let be=k.durations(ne,ie)[0],ae=0,ge=!1;for(const ee of G.notes){const ye=ee.sourceNote;let Ee={str:ye.StringNumberTab,fret:ye.FretNumber};ee.sourceNote instanceof U.TabNote||(_.default.info(`invalid tab note: ${ee.sourceNote.Pitch.ToString()} in measure ${G.parentStaffEntry.parentMeasure.MeasureNumber}, likely missing XML string+fret number.`),Ee={str:1,fret:0}),X.push(Ee),ye.BendArray&&ye.BendArray.forEach(function(j){let te;const re=j.bendalter-Ee.fret;te=re>1?"Full":re===1?"1/2":"1/4",j.direction==="up"?H.push({type:s.Bend.UP,text:te,width:10}):H.push({type:s.Bend.DOWN,text:te,width:10})}),ye.VibratoStroke&&(ge=!0),ae{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowGlissando=void 0;const h=r(1443);class s extends h.GraphicalGlissando{}a.VexFlowGlissando=s},4679:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowGraphicalNote=void 0;const h=r(3486),s=r(8129),m=r(5853);class c extends h.GraphicalNote{constructor(u,d,x,p=m.OctaveEnum.NONE,v,S=void 0){if(super(u,d,v,S),this.clef=x,this.octaveShift=p,u.Pitch){const T=u.isRest()?u.Pitch:m.OctaveShift.getPitchFromOctaveShift(u.Pitch,p);this.vfpitch=s.VexFlowConverter.pitch(T,u.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(u){const d=this.drawPitch(u);this.vfpitch=s.VexFlowConverter.pitch(d,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=d.Accidental}drawPitch(u){return m.OctaveShift.getPitchFromOctaveShift(u,this.octaveShift)}Transpose(u,d,x,p){const v=super.Transpose(u,d,x,p),S=m.OctaveShift.getPitchFromOctaveShift(v,this.octaveShift);return this.vfpitch=s.VexFlowConverter.pitch(S,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,S}setIndex(u,d){this.vfnote=[u,d],this.vfnoteIndex=d}notehead(u=void 0){let d=u;d||(d=this.vfnote[0]);const x=d.note_heads;return x&&x.length>this.vfnoteIndex&&x[this.vfnoteIndex]?d.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const u=[];for(let d=0;;d++){const x=document.getElementById(`vf-${this.getSVGId()}-beam${d}`);if(!x)break;u.push(x)}return u}}a.VexFlowGraphicalNote=c},8144:function(b,a,r){var h=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowGraphicalSymbolFactory=void 0;var s=h(r(6368)).default.Flow;const m=r(8494),c=r(7330),o=r(9252),u=r(5853),d=r(4679),x=r(4146),p=r(5460),v=r(8129),S=r(8790),T=r(4828),P=r(4405);a.VexFlowGraphicalSymbolFactory=class{createMusicSystem(_,E){return new m.VexFlowMusicSystem(_,E)}createStaffLine(_,E){return new T.VexFlowStaffLine(_,E)}createGraphicalMeasure(_,E,M=!1){return new c.VexFlowMeasure(E,_,void 0)}createMultiRestMeasure(_,E,M){return new P.VexFlowMultiRestMeasure(E,_,M)}createTabStaffMeasure(_,E){return new S.VexFlowTabMeasure(E,_)}createExtraGraphicalMeasure(_){const E=new c.VexFlowMeasure(_.ParentStaff,void 0,_);return E.IsExtraGraphicalMeasure=!0,E.ExtraGraphicalMeasurePreviousMeasure=_.Measures.last(),E}createStaffEntry(_,E){return new o.VexFlowStaffEntry(E,_,void 0)}createVoiceEntry(_,E){return new p.VexFlowVoiceEntry(_,E)}createNote(_,E,M,N=u.OctaveEnum.NONE,I,R=void 0){return new d.VexFlowGraphicalNote(_,E,M,N,I,R)}createGraceNote(_,E,M,N,I=u.OctaveEnum.NONE){return new d.VexFlowGraphicalNote(_,E,M,I,N)}addGraphicalAccidental(_,E){_.setAccidental(E)}addFermataAtTiedEndNote(_,E){}createInStaffClef(_,E){const M=_,N=v.VexFlowConverter.Clef(E,"small");M.vfClefBefore=new s.ClefNote(N.type,N.size,N.annotation)}createChordSymbols(_,E,M,N){const I=E.parentMeasure.parentSourceMeasure.Rules;let R=0;const V=I.ChordSymbolXSpacing;for(const U of _.ChordContainers){let K=E.PositionAndShape;E.graphicalVoiceEntries.length===1&&E.graphicalVoiceEntries[0].notes.length===1&&E.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeRest()&&(K=E.parentMeasure.PositionAndShape,R+=E.parentMeasure.beginInstructionsWidth,R+=I.ChordSymbolWholeMeasureRestXOffset);const k=new x.GraphicalChordSymbolContainer(U,K,I.ChordSymbolTextHeight,M,N,E.parentMeasure.parentSourceMeasure.Rules),W=k.GraphicalLabel;W.PositionAndShape.RelativePosition.y-=I.ChordSymbolYOffset,W.setLabelPositionAndShapeBorders();let G=0;W.PositionAndShape.Size.width{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowInstantaneousDynamicExpression=void 0;const h=r(9428),s=r(9793),m=r(9946),c=r(2255),o=r(1274),u=r(2562);class d extends h.GraphicalInstantaneousDynamicExpression{constructor(p,v,S){super(p,v,S);const T=new c.Label(this.Expression);this.label=new m.GraphicalLabel(T,this.rules.ContinuousDynamicTextHeight,o.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=u.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return s.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}a.VexFlowInstantaneousDynamicExpression=d},8939:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowInstrumentBrace=void 0;var s=h(r(6368)).default.Flow;const m=r(5575);class c extends m.VexFlowInstrumentBracket{constructor(u,d,x=0){super(u,d,x),this.vexflowConnector.setType(s.StaveConnector.type.BRACE)}}a.VexFlowInstrumentBrace=c},5575:function(b,a,r){var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowInstrumentBracket=void 0;var s=h(r(6368)).default.Flow;const m=r(4785),c=r(8911),o=r(5820);class u extends m.GraphicalObject{constructor(x,p,v=0){super(),this.Visible=!0,this.PositionAndShape=new c.BoundingBox(this,x.ParentMusicSystem.PositionAndShape);const S=x.Measures[0],T=p.Measures[0];this.addConnector(S.getVFStave(),T.getVFStave(),s.StaveConnector.type.BRACKET,v)}draw(x){this.Visible&&this.vexflowConnector.setContext(x).draw();const p=this.vexflowConnector,v=p.top_stave.getYForLine(0),S=p.bottom_stave.getYForLine(p.bottom_stave.getNumLines()-1)+p.thickness;this.PositionAndShape.AbsolutePosition.x=(p.top_stave.getX()-2+p.x_shift)/o.unitInPixels,this.PositionAndShape.AbsolutePosition.y=v/o.unitInPixels,this.PositionAndShape.Size.height=(S-v)/o.unitInPixels,this.PositionAndShape.Size.width=12/o.unitInPixels}addConnector(x,p,v,S){this.vexflowConnector=new s.StaveConnector(x,p).setType(v).setXShift(-5*S)}}a.VexFlowInstrumentBracket=u},7330:function(b,a,r){var h=this&&this.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};Object.defineProperty(a,"__esModule",{value:!0}),a.StavePositionEnum=a.VexFlowMeasure=void 0;var s=h(r(6368)).default.Flow;const m=r(1513),c=r(6894),o=r(289),u=r(8129),d=r(9224);var x=s.NoteSubGroup;const p=h(r(2043)),v=r(5820),S=r(6189),T=r(1225),P=r(908),_=r(5460),E=r(1797),M=r(1405),N=r(1357),I=r(3748),R=r(2478);class V extends m.GraphicalMeasure{constructor(k,W,G){super(k,W,G),this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.hasMetronomeMark=!1,this.connectors=[],this.beams={},this.autoVfBeams=[],this.autoTupletVfBeams=[],this.vfbeams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,this.rules=G?G.ParentMusicSystem.rules:W?W.Rules:new M.EngravingRules,this.resetLayout()}setAbsoluteCoordinates(k,W){this.stave.setX(k).setY(W)}resetLayout(){this.stave=new s.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.InitiallyActiveClef&&(this.stave.clef=u.VexFlowConverter.Clef(this.InitiallyActiveClef).type),this.stave.MeasureNumber=this.MeasureNumber,this.hasMetronomeMark=!1,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(s.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===c.SystemLinesEnum.None&&this.stave.setEndBarType(s.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(k){switch(k){case c.SystemLinesEnum.BoldThinDots:case c.SystemLinesEnum.DotsThinBold:return 10/v.unitInPixels;case c.SystemLinesEnum.DotsBoldBoldDots:return 10/v.unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}addClefAtBegin(k){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=k.OctaveOffset,k.ClefType===o.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const W=u.VexFlowConverter.Clef(k,"default");this.stave.addClef(W.type,W.size,W.annotation,s.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}setLineNumber(k){k!==5&&(k===0?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):k===1?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):k===2?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):k===3?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(k),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(k,W,G){var X;if(this.rules.RenderKeySignatures&&this.ShowKeySignature&&(!this.isTabMeasure||this.rules.TabKeySignatureRendered||this.rules.TabKeySignatureSpacingAdded)&&(!(!((X=this.parentSourceMeasure)===null||X===void 0)&&X.isReducedToMultiRest)||this.rules.MultipleRestMeasureAddKeySignature)){if(this.stave.setKeySignature(u.VexFlowConverter.keySignature(k),u.VexFlowConverter.keySignature(W),void 0),this.isTabMeasure&&!this.rules.TabKeySignatureRendered){const L=this.stave.getModifiers();for(const H of L)if(H instanceof s.KeySignature){H.setStyle({fillStyle:"#00000000"}),H.hidden=!0;break}}this.updateInstructionWidth()}}addRhythmAtBegin(k){if(this.isTabMeasure&&!this.rules.TabTimeSignatureRendered&&!this.rules.TabTimeSignatureSpacingAdded)return;const W=u.VexFlowConverter.TimeSignature(k);this.stave.addModifier(W,s.StaveModifier.Position.BEGIN),(!this.ShowTimeSignature||this.isTabMeasure&&!this.rules.TabTimeSignatureRendered)&&(W.setStyle({fillStyle:"#00000000"}),W.hidden=!0),this.updateInstructionWidth()}addClefAtEnd(k,W=!0){const G=u.VexFlowConverter.Clef(k,"small");if(W||!this.stave.endClef){this.stave.setEndClef(G.type,G.size,G.annotation);for(const X of this.stave.getModifiers())if(W){const L=X.originalStrokeStyle,H=X.originalFillStyle;X.getStyle()&&(L&&H?(X.getStyle().strokeStyle=L,X.getStyle().fillStyle=H):(X.getStyle().strokeStyle=null,X.getStyle().fillStyle=null))}else if(X.getCategory()==="clefs"&&X.getPosition()===s.StaveModifier.Position.END&&X.type===G.type){const L="#12345600",H=X.getStyle();H&&(X.originalStrokeStyle=H.strokeStyle,X.originalFillStyle=H.fillStyle),X.setStyle({strokeStyle:L,fillStyle:L})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(k,W,G=!0){switch(W){case T.SystemLinePosition.MeasureBegin:k===c.SystemLinesEnum.BoldThinDots&&(G||(this.stave.modifiers[0].draw=function(X){switch(X.checkContext(),this.setRendered(),this.type){case s.Barline.type.SINGLE:this.drawVerticalBar(X,this.x,!1);break;case s.Barline.type.DOUBLE:this.drawVerticalBar(X,this.x,!0);break;case s.Barline.type.END:this.drawVerticalEndBar(X,this.x);break;case s.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(X,this.x,!0);break;case s.Barline.type.REPEAT_END:this.drawRepeatBar(X,this.x,!1);break;case s.Barline.type.REPEAT_BOTH:this.drawRepeatBar(X,this.x,!1),this.drawRepeatBar(X,this.x,!0)}}),this.stave.setBegBarType(s.Barline.type.REPEAT_BEGIN));break;case T.SystemLinePosition.MeasureEnd:switch(k){case c.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(s.Barline.type.REPEAT_BOTH);break;case c.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(s.Barline.type.REPEAT_END);break;case c.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(s.Barline.type.DOUBLE);break;case c.SystemLinesEnum.ThinBold:this.stave.setEndBarType(s.Barline.type.END);break;case c.SystemLinesEnum.None:this.stave.setEndBarType(s.Barline.type.NONE)}}}addMeasureNumber(){const k=this.MeasureNumber.toString(),W=U.ABOVE;this.stave.setText(k,W,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(k){let W,G=s.StaveModifier.Position.END;const X=this.beginInstructionsWidth;switch(k.type){case S.RepetitionInstructionEnum.Segno:W=s.Repetition.type.SEGNO_LEFT,G=s.StaveModifier.Position.LEFT;break;case S.RepetitionInstructionEnum.Coda:W=s.Repetition.type.CODA_LEFT,G=s.StaveModifier.Position.LEFT;break;case S.RepetitionInstructionEnum.DaCapo:W=s.Repetition.type.DC;break;case S.RepetitionInstructionEnum.DalSegno:W=s.Repetition.type.DS;break;case S.RepetitionInstructionEnum.Fine:W=s.Repetition.type.FINE;break;case S.RepetitionInstructionEnum.ToCoda:W=s.Repetition.type.TO_CODA;break;case S.RepetitionInstructionEnum.DaCapoAlFine:W=s.Repetition.type.DC_AL_FINE;break;case S.RepetitionInstructionEnum.DaCapoAlCoda:W=s.Repetition.type.DC_AL_CODA;break;case S.RepetitionInstructionEnum.DalSegnoAlFine:W=s.Repetition.type.DS_AL_FINE;break;case S.RepetitionInstructionEnum.DalSegnoAlCoda:W=s.Repetition.type.DS_AL_CODA}if(W){const L=new s.Repetition(W,X,-this.rules.RepetitionSymbolsYOffset);return L.xShiftAsPercentOfStaveWidth=this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth,void this.stave.addModifier(L,G)}this.addVolta(k)}addVolta(k){var W;let G=s.Volta.type.BEGIN;if(k.type===S.RepetitionInstructionEnum.Ending){switch(k.alignment){case S.AlignmentType.Begin:G=this.parentSourceMeasure.endsRepetitionEnding()?s.Volta.type.BEGIN_END:s.Volta.type.BEGIN;break;case S.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;G=s.Volta.type.END}const X=this.ParentStaffLine.SkyBottomLineCalculator,L=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,H=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,L+.4),ne=X.getSkyLineMinInRange(L,H)-2;let ie,be=-6.1+this.rules.VoltaOffset,ae=this.rules.VoltaOffset;ne0){p.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const ge=this.createGhostGves(ae);G.splice(H,0,...ge),H+=ge.length}}else{const ae=E.Fraction.minus(ie,this.parentSourceMeasure.AbsoluteTimestamp);if(ae.RealValue>0){p.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const ge=this.createGhostGves(ae);G.splice(0,0,...ge),H+=ge.length}}W=be}const X=E.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),L=E.Fraction.minus(X,W);if(L.RealValue>0){p.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const H=this.createGhostGves(L);G=G.concat(H)}return G}createGhostGves(k){const W=u.VexFlowConverter.GhostNotes(k),G=[];for(const X of W){const L=new _.VexFlowVoiceEntry(void 0,void 0,this.rules);L.vfStaveNote=X,G.push(L)}return G}handleBeam(k,W){const G=k.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let X,L=this.beams[G];L||(L=this.beams[G]=[]);for(const ne of L)ne[0]===W&&(X=ne);X||(X=[W,[]],L.push(X));const H=k.parentVoiceEntry;X[1].indexOf(H)<0&&X[1].push(H)}handleTuplet(k,W){const G=k.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;W=k.sourceNote.NoteTuplet;let X,L=this.tuplets[G];L||(L=this.tuplets[G]=[]);for(const ne of L)ne[0]===W&&(X=ne);X||(X=[W,[]],L.push(X));const H=k.parentVoiceEntry;X[1].indexOf(H)<0&&X[1].push(H)}finalizeBeams(){this.vfbeams={};const k=[];for(const W in this.beams)if(this.beams.hasOwnProperty(W)){let G=this.vfbeams[W];G||(G=this.vfbeams[W]=[]);for(const X of this.beams[W]){let L=!1;for(const ee of X[0].Notes)if(ee.Length.RealValue>=new E.Fraction(1,4).RealValue&&(!ee.TypeLength||ee.TypeLength.RealValue>.125)){L=!0;break}if(L){p.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const H=[],ne=X[0],ie=X[1];let be=!0;for(const ee of ie)ee.parentVoiceEntry.ParentVoice===ne.Notes[0].ParentVoiceEntry.ParentVoice&&(be=ee.parentVoiceEntry.WantedStemDirection===P.StemDirectionType.Undefined);let ae,ge=!1;const ce=[];for(const ee of ie){const ye=ee.vfStaveNote;ye&&(H.push(ye),k.push(ye)),ee.parentVoiceEntry.IsGrace&&(ge=!0),ee.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&ce.push(ee.parentVoiceEntry.StemColor)}if(H.length>1){const ee=new s.Beam(H,be);if(ge&&(ee.render_options.beam_width=3,ee.render_options.partial_beam_length=4),ce.length>=2&&this.rules.ColorBeams){ae=ce[0];for(const ye of ce)if(ye!==ae){ae=void 0;break}ee.setStyle({fillStyle:ae,strokeStyle:ae})}this.rules.FlatBeams&&(ee.render_options.flat_beams=!0,ee.render_options.flat_beam_offset=this.rules.FlatBeamOffset,ee.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),G.push(ee)}else p.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(k)}autoBeamNotes(k){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let W,G=60,X=[],L=[],H=[];this.autoTupletVfBeams=[];const ne=[];this.autoVfBeams=[];let ie=this.parentSourceMeasure.ActiveTimeSignature;ie||(ie=this.parentSourceMeasure.Duration);for(const ge of this.staffEntries)for(const ce of ge.graphicalVoiceEntries){const ee=ce.vfStaveNote,ye=ce.notes[0],Ee={vfStaveNote:ee,sourceNote:ye.sourceNote},j=ge.relInMeasureTimestamp.isOnBeat(ie),te=L.length>=2,re=ye.sourceNote.Length.RealValue-new E.Fraction(1,4).RealValue>-E.Fraction.FloatInaccuracyTolerance,O=ce.parentVoiceEntry.IsGrace||re||k.contains(ee);if(O||j){if(te){for(const Y of L)X.push(Y);ne.push(X.slice()),X=[]}if(L=[],O)continue}const z=ce.notes[0].sourceNote.NoteTuplet;if(z){let Y=!1;for(const q of z.Notes){for(const de of q)if(de.NoteTypeXml>=R.NoteType.QUARTER||de.ParentVoiceEntry.IsGrace||de.isRest()&&!this.rules.AutoBeamOptions.beam_rests){Y=!0;break}if(Y)break}if(W){if(W!==z){if(H.length>1){const q=[];for(const he of H)q.push(he.vfStaveNote);const de=new s.Beam(q,!0);this.rules.FlatBeams&&(de.render_options.flat_beams=!0,de.render_options.flat_beam_offset=this.rules.FlatBeamOffset,de.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(de);const le=new d.Beam(G++);le.AutoGenerated=!0;for(const he of H)le.addNoteToBeam(he.sourceNote)}H=[],W=z}}else W=z;Y||H.push(Ee)}else W=void 0,L.push(Ee)}if(H.length>=2){const ge=[];for(const ye of H)ge.push(ye.vfStaveNote);const ce=new s.Beam(ge,!0);this.rules.FlatBeams&&(ce.render_options.flat_beams=!0,ce.render_options.flat_beam_offset=this.rules.FlatBeamOffset,ce.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(ce);const ee=new d.Beam(G++);ee.AutoGenerated=!0;for(const ye of H)ee.addNoteToBeam(ye.sourceNote)}if(L.length>=2){for(const ge of L)X.push(ge);ne.push(X)}const be=this.rules.AutoBeamOptions,ae={beam_middle_only:be.beam_middle_rests_only,beam_rests:be.beam_rests,maintain_stem_directions:be.maintain_stem_directions};if(be.groups&&be.groups.length){const ge=[];for(const ce of be.groups)ge.push(new s.Fraction(ce[0],ce[1]));ae.groups=ge}for(const ge of ne){const ce=[];for(const ye of ge)ce.push(ye.vfStaveNote);const ee=s.Beam.generateBeams(ce,ae);for(const ye of ee)this.rules.FlatBeams&&(ye.render_options.flat_beams=!0,ye.render_options.flat_beam_offset=this.rules.FlatBeamOffset,ye.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(ye)}}finalizeTuplets(){this.vftuplets={};for(const k in this.tuplets)if(this.tuplets.hasOwnProperty(k)){let W=this.vftuplets[k];W||(W=this.vftuplets[k]=[]);for(const G of this.tuplets[k]){const X=[],L=G[1];for(const H of L)X.push(H.vfStaveNote);if(X.length>1){const H=G[0],ne=H.Notes[0][0].NormalNotes,ie=H.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed);let be=s.Tuplet.LOCATION_TOP;H.tupletLabelNumberPlacement===I.PlacementEnum.Below&&(be=s.Tuplet.LOCATION_BOTTOM);const ae=new s.Tuplet(X,{bracketed:ie,location:be,notes_occupied:ne,num_notes:H.TupletLabelNumber,ratioed:this.rules.TupletsRatioed});W.push(ae)}else p.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(k){}graphicalMeasureCreatedCalculations(){let k,W=[];const G=[];for(const L of this.staffEntries){k=!1,W=[];for(const H of L.graphicalVoiceEntries)if(H.parentVoiceEntry.IsGrace)W.push(H),G.push(H),k||(k=H.parentVoiceEntry.GraceSlur);else if(H.vfStaveNote=u.VexFlowConverter.StaveNote(H),W.length>0){const ne=[];for(let be=0;be0&&(ae.GraceSlash=!1);const ge=u.VexFlowConverter.StaveNote(ae);ae.vfStaveNote=ge,ne.push(ge)}const ie=new s.GraceNoteGroup(ne,k);ie.spacing=10*this.rules.GraceNoteGroupXMargin,H.vfStaveNote.addModifier(0,ie),W=[]}}if(W.length>0)for(const L of W)L.vfStaveNote=u.VexFlowConverter.StaveNote(L),L.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const X=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const L of this.staffEntries)L.setModifierXOffsets();for(const L of X){if(!L)continue;this.vfVoices[L.VoiceId]=new s.Voice({beat_value:this.parentSourceMeasure.ActiveTimeSignature.Denominator,num_beats:this.parentSourceMeasure.ActiveTimeSignature.Numerator,resolution:s.RESOLUTION}).setMode(s.Voice.Mode.SOFT);const H=this.getRestFilledVexFlowStaveNotesPerVoice(L);for(const ne of H){if(ne.parentVoiceEntry&&ne.parentVoiceEntry.IsGrace&&!ne.parentVoiceEntry.GraceAfterMainNote)continue;const ie=ne;if(ie.vfStaveNote.getTicks().denominator===0&&(ie.vfStaveNote.getTicks().denominator=1),ne.notes.length===0||!ne.notes[0]||!ne.notes[0].sourceNote.PrintObject){this.vfVoices[L.VoiceId].addTickable(ie.vfStaveNote);continue}const be=ie.parentStaffEntry;if(be&&be.vfClefBefore){const ae=new x([be.vfClefBefore]);ie.vfStaveNote.getCategory&&ie.vfStaveNote.getCategory()==="stavenotes"&&ie.vfStaveNote.addModifier(0,ae)}ne.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==I.PlacementEnum.Left&&this.rules.FingeringPosition!==I.PlacementEnum.Right||this.createFingerings(ne),this.createStringNumber(ne)),this.createArpeggio(ne),this.vfVoices[L.VoiceId].addTickable(ie.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const L of G)this.createFingerings(L),this.createStringNumber(L),this.createArpeggio(L);this.createArticulations(),this.createOrnaments()}createArpeggio(k){if(k.parentVoiceEntry&&k.parentVoiceEntry.Arpeggio){const W=k.parentVoiceEntry.Arpeggio;if(k.notes&&k.notes.length>1){const G=u.VexFlowConverter.StrokeTypeFromArpeggioType(W.type),X=new s.Stroke(G,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&k.vfStaveNote.addStroke(0,X)}else p.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. - voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const k of this.staffEntries)for(const W of k.graphicalVoiceEntries)for(const G of W.notes){const X=G.vfnote;if(X&&X[0])switch(X[0].getStemDirection()){case s.Stem.UP:W.parentVoiceEntry.StemDirection=P.StemDirectionType.Up;break;case s.Stem.DOWN:W.parentVoiceEntry.StemDirection=P.StemDirectionType.Down}}}createArticulations(){for(let k=0,W=this.staffEntries.length;kG){for(const H of k.notes)if(!H.sourceNote.Fingering&&(H.sourceNote.Fingering=X.pop(),G++,X.length===0))break}let L=-1;for(const H of k.notes){const ne=H.sourceNote.Fingering;if(!ne){L++;continue}L++;let ie=this.rules.FingeringPosition;this.rules.FingeringPositionGrace===I.PlacementEnum.AboveOrBelow&&(this.isUpperStaffOfInstrument()?ie=I.PlacementEnum.Above:this.isLowerStaffOfInstrument()&&(ie=I.PlacementEnum.Below)),ne.placement!==I.PlacementEnum.NotYetDefined&&(ie=ne.placement);let be,ae=this.rules.FingeringOffsetX;switch(ie){default:case I.PlacementEnum.Left:be=s.StaveModifier.Position.LEFT,ae-=H.baseFingeringXOffset*v.unitInPixels;break;case I.PlacementEnum.Right:be=s.StaveModifier.Position.RIGHT,ae+=H.baseFingeringXOffset*v.unitInPixels;break;case I.PlacementEnum.Above:be=s.StaveModifier.Position.ABOVE;break;case I.PlacementEnum.Below:be=s.StaveModifier.Position.BELOW;break;case I.PlacementEnum.NotYetDefined:const ce=k.parentStaffEntry.sourceStaffEntry.ParentStaff;k.notes.length>1||k.parentStaffEntry.graphicalVoiceEntries.length>1?be=s.StaveModifier.Position.LEFT:ce.idInMusicSheet===0?(be=s.StaveModifier.Position.ABOVE,ie=I.PlacementEnum.Above):(be=s.StaveModifier.Position.BELOW,ie=I.PlacementEnum.Below)}const ge=new s.FretHandFinger(ne.value);if(ge.setPosition(be),ge.setOffsetX(ae),ie===I.PlacementEnum.Above||ie===I.PlacementEnum.Below){const ce=ie===I.PlacementEnum.Above?-1:1,ee=ie===I.PlacementEnum.Above?L:G-1-L;if(this.rules.FingeringInsideStafflines&&G>1){const ye=ge.getWidth()/2,Ee=2.5*G;ge.setOffsetY(ce*(ee+Ee)*ye)}else if(!this.rules.FingeringInsideStafflines){const ye=new s.StringNumber(ne.value);ye.radius=0,ye.setPosition(be),ye.setOffsetY(ce*ee*ye.getWidth()*2/3),W.vfStaveNote.addModifier(L,ye);continue}}W.vfStaveNote.addModifier(L,ge)}}createStringNumber(k){if(!this.rules.RenderStringNumbersClassical)return;const W=k;k.notes.forEach((G,X)=>{const L=G.sourceNote.StringInstruction;if(L){let H=L.value;switch(H){case"1":H="I";break;case"2":H="II";break;case"3":H="III";break;case"4":H="IV";break;case"5":H="V";break;case"6":H="VI"}const ne=new s.StringNumber(H);ne.radius=0;const ie=-this.rules.StringNumberOffsetY;k.notes.length>1||k.parentStaffEntry.graphicalVoiceEntries.length>1?(ne.setOffsetX(13*G.baseStringNumberXOffset),ne.setPosition(s.Modifier.Position.RIGHT)):ne.setPosition(s.Modifier.Position.ABOVE),ne.setOffsetY(ie),W.vfStaveNote.addModifier(X,ne)}})}lineTo(k,W){const G=new s.StaveConnector(k.getVFStave(),this.stave);G.setType(W),this.connectors.push(G)}getVFStave(){return this.stave}updateInstructionWidth(){let k=0,W=0;const G=this.stave.getModifiers();for(const X of G)X.getPosition()===U.BEGIN?k+=X.getWidth()+X.getPadding(void 0):X.getPosition()===U.END&&(W+=X.getWidth()+X.getPadding(void 0));this.beginInstructionsWidth=(k??0)/v.unitInPixels,this.endInstructionsWidth=(W??0)/v.unitInPixels}addStaveTie(k,W){this.vfTies.push(k),W.vfTie=k,W.Tie.TieDirection===I.PlacementEnum.Below&&k.setDirection(1)}}var U;a.VexFlowMeasure=V,function(K){K[K.LEFT=1]="LEFT",K[K.RIGHT=2]="RIGHT",K[K.ABOVE=3]="ABOVE",K[K.BELOW=4]="BELOW",K[K.BEGIN=5]="BEGIN",K[K.END=6]="END"}(U=a.StavePositionEnum||(a.StavePositionEnum={}))},4405:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowMultiRestMeasure=void 0;var s=h(r(6368)).default.Flow;const m=r(7330);class c extends m.VexFlowMeasure{constructor(u,d=void 0,x=void 0){super(u,d,x),this.minimumStaffEntriesWidth=-1,x?this.rules=x.ParentMusicSystem.rules:d&&(this.rules=d.Rules),this.resetLayout(),this.multiRestElement=new s.MultiMeasureRest(d.multipleRestMeasures,{})}draw(u){this.stave.setContext(u).draw(),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(u),this.multiRestElement.draw();for(const d of this.connectors)d.setContext(u).draw()}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(u){return[]}getRestFilledVexFlowStaveNotesPerVoice(u){return[]}handleBeam(u,d){}handleTuplet(u,d){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(u){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(u){}getVFStave(){return this.stave}}a.VexFlowMultiRestMeasure=c},8738:function(b,a,r){var h=this&&this.__importDefault||function(ae){return ae&&ae.__esModule?ae:{default:ae}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowMusicSheetCalculator=void 0;const s=r(4040),m=r(8144),c=r(1513),o=r(1659),u=r(5309),d=r(2942),x=h(r(6368));var p=x.default.Flow;const v=h(r(2043)),S=r(5820),T=r(5091),P=r(8720),_=r(9520),E=r(6351),M=r(1274),N=r(9876),I=r(9344),R=r(9667),V=r(41),U=r(7781),K=r(2478),k=r(8129),W=r(2343),G=r(4146),X=r(6894),L=r(3010),H=r(158),ne=r(2337),ie=r(3602);class be extends s.MusicSheetCalculator{constructor(ge){var ce,ee,ye,Ee,j,te,re,O;super(),this.beamsNeedUpdate=!1,this.rules=ge,s.MusicSheetCalculator.symbolFactory=new m.VexFlowGraphicalSymbolFactory,s.MusicSheetCalculator.TextMeasurer=new d.VexFlowTextMeasurer(this.rules),s.MusicSheetCalculator.stafflineNoteCalculator=new U.VexflowStafflineNoteCalculator(this.rules),((ce=this.rules.DefaultVexFlowNoteFont)===null||ce===void 0?void 0:ce.toLowerCase())==="gonville"?x.default.Flow.DEFAULT_FONT_STACK=[(ee=x.default.Flow.Fonts)===null||ee===void 0?void 0:ee.Gonville,(ye=x.default.Flow.Fonts)===null||ye===void 0?void 0:ye.Bravura,(Ee=x.default.Flow.Fonts)===null||Ee===void 0?void 0:Ee.Custom]:((j=this.rules.DefaultVexFlowNoteFont)===null||j===void 0?void 0:j.toLowerCase())==="petaluma"&&(x.default.Flow.DEFAULT_FONT_STACK=[(te=x.default.Flow.Fonts)===null||te===void 0?void 0:te.Petaluma,(re=x.default.Flow.Fonts)===null||re===void 0?void 0:re.Gonville,(O=x.default.Flow.Fonts)===null||O===void 0?void 0:O.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),s.MusicSheetCalculator.stafflineNoteCalculator=new U.VexflowStafflineNoteCalculator(this.rules);for(const ge of this.graphicalMusicSheet.MeasureList)for(const ce of ge)ce==null||ce.clean()}formatMeasures(){for(const ge of this.graphicalMusicSheet.MeasureList)if(ge&&ge[0]){ge.find(ce=>ce==null?void 0:ce.isVisible()).format();for(const ce of ge){for(const ee of ce.staffEntries)ee.calculateXPosition();ce.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(ge){const ce=[];for(const O of ge)O!=null&&O.isVisible()&&ce.push(O);if(ce.length===0)return 0;ge=ce;const ee=[],ye=new p.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let Ee=ge[0].staffEntries.length,j=1;for(const O of ge){if(!O)continue;let z=0;for(const de of O.staffEntries)z+=de.setMaxAccidentals();O.parentSourceMeasure.ImplicitMeasure&&(Ee=Math.max(O.staffEntries.length,Ee),j=Math.max(O.staffEntries.length+z,j));const Y=O.vfVoices,q=[];for(const de in Y)if(Y.hasOwnProperty(de)){const le=Y[de];O.hasOnlyRests&&!le.ticksUsed.equals(le.totalTicks)&&(le.ticksUsed=le.totalTicks),q.push(le),ee.push(le)}q.length!==0?ye.joinVoices(q):v.default.debug("Found a measure with no voices. Continuing anyway.",Y)}let te=12;const re=ge[0].parentSourceMeasure;if(ee.length>0){if(te=ye.preCalculateMinTotalWidth(ee)/S.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*Ee,re==null?void 0:re.ImplicitMeasure){te=re.Duration.RealValue/re.ActiveTimeSignature.RealValue*te;let Y=0;const q=re.measureListIndex;if(q>1)for(const de of this.graphicalMusicSheet.MeasureList[q-1]){const le=de==null?void 0:de.parentSourceMeasure.endingBarStyleEnum;if(le===X.SystemLinesEnum.ThinBold||le===X.SystemLinesEnum.DotsThinBold){Y=this.rules.PickupMeasureRepetitionSpacing;break}}te+=Y,Ee>1?te+=.3*j*1.5:q>1&&Ee===1&&(te+=this.rules.PickupMeasureSpacingSingleNoteAddend),te*=this.rules.PickupMeasureWidthMultiplier}s.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(ge,te);const O=(Y,q)=>{ye.formatToStave(ee,q.getVFStave())},z=(Y,q)=>{ye.formatToStave(ee,q.getVFStave(),{align_rests:!0,context:void 0})};for(const Y of ge){if(this.rules.AlignRests===V.AlignRestOption.Never)Y.formatVoices=O;else if(this.rules.AlignRests===V.AlignRestOption.Always)Y.formatVoices=z;else if(this.rules.AlignRests===V.AlignRestOption.Auto){let q=!1;for(const de of Y.staffEntries){let le=0,he=0;for(const me of de.graphicalVoiceEntries)if(me.parentVoiceEntry.IsGrace||me&&me.notes&&me.notes[0]&&me.notes[0].sourceNote&&me.notes[0].sourceNote.PrintObject&&le++,me&&me.notes&&me.notes[0]&&me.notes[0].sourceNote&&me.notes[0].sourceNote.isRest()&&me.notes[0].sourceNote.PrintObject&&he++,le>1&&he>=1){q=!0;break}if(q)break}Y.formatVoices=q?z:O}if(Y===ge[0]){const q=Y;q.formatVoices(te*S.unitInPixels,q)}}}for(const O of ge)if(O)for(const z of O.staffEntries)z.calculateXPosition();for(const O of ge){if(!O)continue;const z=O.vfVoices,Y=[];for(const q in z)z.hasOwnProperty(q)&&Y.push(z[q]);Y.length!==0?ye.joinVoices(Y):v.default.debug("Found a measure with no voices. Continuing anyway.",z)}return te}calculateElongationFactor(ge,ce,ee,ye,Ee,j,te,re){let O=Ee,z=0;for(const Y of ge){const q=Y.GraphicalLabel.Label.textAlignment;let de=te,le=re;if(Y instanceof T.GraphicalLyricEntry&&Y.ParentLyricWord){Y.LyricsEntry.SyllableIndex>0&&(de=this.rules.BetweenSyllableMinimumDistance,M.TextAlignment.IsCenterAligned(q)&&(de+=1));const st=Y.ParentLyricWord.GetLyricWord.Syllables;st.length>1&&Y.LyricsEntry.SyllableIndex4&&(Ke*=1.1)):ee[z]&&(Ke=_e/Me),We=Math.max(qe,Ke),O=Math.max(O,We);let Ze=Math.max(_e-Me||0,0);ee[z]&&(Ze+=ee[z].cumulativeOverlap),ee[z]={cumulativeOverlap:Ze,extend:Y instanceof T.GraphicalLyricEntry&&Y.LyricsEntry.extend,labelWidth:me,measureNumber:j,sourceNoteDuration:Y instanceof T.GraphicalLyricEntry&&Y.LyricsEntry&&Y.LyricsEntry.Parent.Notes[0].Length,text:Y instanceof T.GraphicalLyricEntry?Y.LyricsEntry.Text:Y.GraphicalLabel.Label.text,xPosition:Qe},z++}return O}calculateElongationFactorFromStaffEntries(ge,ce,ee,ye){let Ee=ee;const j={},te={};for(const re of ge)re.LyricsEntries.length>0&&this.rules.RenderLyrics&&(Ee=this.calculateElongationFactor(re.LyricsEntries,re,j,ce,Ee,ye,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),re.graphicalChordContainers.length>0&&this.rules.RenderChordSymbols&&(Ee=this.calculateElongationFactor(re.graphicalChordContainers,re,te,ce,Ee,ye,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return Ee}calculateMeasureWidthFromStaffEntries(ge,ce){let ee=1;for(const ye of ge)ye&&ye.staffEntries.length!==0&&(ee=this.calculateElongationFactorFromStaffEntries(ye.staffEntries,ce,ee,ye.MeasureNumber));return ee=Math.min(ee,this.rules.MaximumLyricsElongationFactor),ce*ee}createGraphicalTie(ge,ce,ee,ye,Ee){return new u.GraphicalTie(ge,ye,Ee)}updateStaffLineBorders(ge){ge.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(ge){ge.rules=this.rules,ge.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(ge,ce,ee,ye){for(let Ee=0;Ee=2&&(j=ye.vfnote[0],re=ye.vfnote[1]);let O=0;if(Ee&&Ee.vfnote&&Ee.vfnote.length>=2&&(te=Ee.vfnote[0],O=Ee.vfnote[1]),ce){if(j){const z=new p.StaveTie({first_indices:[re],first_note:j});ye.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}if(te){const z=new p.StaveTie({last_indices:[O],last_note:te});Ee.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}}else if(j||te){let z;if(ee)if(ge.Tie.Type==="S"){const Y=ge.StartNote.sourceNote,q=ge.EndNote.sourceNote;let de=1;Y.FretNumber>q.FretNumber&&(de=-1),z=new p.TabSlide({first_indices:[re],first_note:j,last_indices:[O],last_note:te},de)}else z=new p.TabTie({first_indices:[re],first_note:j,last_indices:[O],last_note:te},ge.Tie.Type);else{z=new p.StaveTie({first_indices:[re],first_note:j,last_indices:[O],last_note:te});const Y=ge.Tie.getTieDirection(ye.sourceNote);Y===W.PlacementEnum.Below?z.setDirection(1):Y===W.PlacementEnum.Above&&z.setDirection(-1)}Ee.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}}calculateDynamicExpressionsForMultiExpression(ge,ce,ee){if(cethis.rules.MaxMeasureToDrawIndex)return;const ye=ge.AbsoluteTimestamp,Ee=this.graphicalMusicSheet.MeasureList[ce],j=Ee[ee].ParentStaffLine,te=Ee[ee],re=ge.StartingContinuousDynamic,O=re!==void 0&&!re.IsStartOfSoftAccent,z=this.getRelativePositionInStaffLineFromTimestamp(ye,ee,j,j==null?void 0:j.isPartOfMultiStaffInstrument(),void 0,O);if(z.x<=0&&(z.x=te.beginInstructionsWidth+this.rules.RhythmRightMargin),ge.InstantaneousDynamic){const Y=new E.VexFlowInstantaneousDynamicExpression(ge.InstantaneousDynamic,j,te);this.calculateGraphicalInstantaneousDynamicExpression(Y,z,ye),this.dynamicExpressionMap.set(ye.RealValue,Y.PositionAndShape)}if(re){const Y=new I.VexFlowContinuousDynamicExpression(re,j,te.parentSourceMeasure);if(Y.StartMeasure=te,Y.IsSoftAccent=ge.StartingContinuousDynamic.IsStartOfSoftAccent,!Y.IsVerbal&&re.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(Y,z),Y.updateSkyBottomLine()}catch{}else Y.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(Y,z):v.default.warn("This continuous dynamic is not covered. measure"+ge.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(ge){var ce,ee;const ye=Math.max(ge.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),Ee=Math.max(ge.StaffNumber-1,0),j=ye===0&&Ee===0,te=this.graphicalMusicSheet.MeasureList[ye][Ee];if(te.hasMetronomeMark)return;const re=te.getVFStave();let O="q";if(ge.beatUnit){const le=K.NoteTypeHandler.getNoteDurationFromType(ge.beatUnit);O=k.VexFlowConverter.durations(le,!1)[0]}let z=this.rules.MetronomeMarkYShift,Y=!1;for(const le of ge.parentMeasure.TempoExpressions){const he=((ce=le.InstantaneousTempo)===null||ce===void 0?void 0:ce.Enum)===R.TempoEnum.metronomeMark;if(le.getPlacementOfFirstEntry()===W.PlacementEnum.Above&&!he){Y=!0;break}}Y&&(z-=1.4);const q=(ee=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)===null||ee===void 0?void 0:ee.SkyLine;re.setTempo({bpm:ge.TempoInBpm,dots:ge.dotted,duration:O},z*S.unitInPixels);const de=j?this.rules.MetronomeMarkXShift*S.unitInPixels:0;re.getModifiers()[re.getModifiers().length-1].setShiftX(de),te.hasMetronomeMark=!0,q&&(q[0]=Math.min(q[0],-4.5+z))}calculateRehearsalMark(ge){var ce;const ee=ge.rehearsalExpression;if(!ee)return;const ye=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,Ee=Math.max(ge.MeasureNumber-ye,0),j=(ce=this.graphicalMusicSheet.MeasureList[Ee][0])===null||ce===void 0?void 0:ce.getVFStave();if(!j)return;const te=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let re=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;ge.IsSystemStartMeasure&&(re+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const O=this.rules.RehearsalMarkFontSize;j.setSection(ee.label,te,re,O)}calculateSingleOctaveShift(ge,ce,ee,ye){var Ee;const j=ce.OctaveShiftStart,te=j.ParentStartMultiExpression.Timestamp,re=(Ee=j.ParentEndMultiExpression)===null||Ee===void 0?void 0:Ee.Timestamp,O=this.rules.MinMeasureToDrawIndex,z=this.rules.MaxMeasureToDrawIndex;let Y,q,de=this.graphicalMusicSheet.MeasureList[ee][ye].ParentStaffLine;if(de||(de=this.graphicalMusicSheet.MeasureList[O][ye].ParentStaffLine),Y=j.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ParentEndMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0),Y.MeasureNumber>z+1&&(Y=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0)),q=j.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ParentStartMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.MeasureList[O][ye],q.MeasureNumberz+1||Y.MeasureNumberz+1)return;let le=Y.ParentStaffLine;if(le||(le=de),Y&&de&&le){const he=new _.VexFlowOctaveShift(j,de.PositionAndShape);if(!he.startNote){let Me;for(const Ue of q.staffEntries)if(Ue){Me=Ue;break}if(!Me||(he.setStartNote(Me),!he.startNote))return}if(!he.endNote){let Me;for(let Ue=Y.staffEntries.length-1;Ue>=0;Ue++)if(Y.staffEntries[Ue]){Me=Y.staffEntries[Ue];break}if(!Me)return void(he.graphicalEndAtMeasureEnd=!0);if(he.setEndNote(Me),!he.endNote)return}let me=q.findGraphicalStaffEntryFromTimestamp(te);me||(me=q.staffEntries[0]);let _e=Y.findGraphicalStaffEntryFromTimestamp(re);if(_e||(_e=Y.staffEntries[Y.staffEntries.length-1]),he.setStartNote(me),le!==de){he.endsOnDifferentStaffLine=!0;let Me=this.findLastStafflineMeasure(de);Me===void 0&&(Me=Y);const Ue=Me.staffEntries[Me.staffEntries.length-1];he.setEndNote(Ue),he.graphicalEndAtMeasureEnd=!0,he.endMeasure=Me;const Ge=le.ParentMusicSystem.Id-de.ParentMusicSystem.Id;if(Ge>0)for(let Qe=de.ParentMusicSystem.Id;Qe=0;ce--){const ee=ge.Measures[ce];if(ee.staffEntries.length>0)return ee}}calculateSinglePedal(ge,ce,ee,ye){var Ee;const j=ce.PedalStart,te=j.ParentStartMultiExpression.Timestamp,re=(Ee=j.ParentEndMultiExpression)===null||Ee===void 0?void 0:Ee.Timestamp,O=this.rules.MinMeasureToDrawIndex,z=this.rules.MaxMeasureToDrawIndex;let Y,q,de=this.graphicalMusicSheet.MeasureList[ee][ye].ParentStaffLine;if(de||(de=this.graphicalMusicSheet.MeasureList[O][ye].ParentStaffLine),Y=j.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ParentEndMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0),Y.MeasureNumber>z+1&&(Y=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0)),j.ParentEndMultiExpression?q=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ParentStartMultiExpression.SourceMeasureParent,ye):(q=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(j.ParentStartMultiExpression.SourceMeasureParent,ye),q||(q=this.graphicalMusicSheet.MeasureList[O][ye])),q.MeasureNumberz||Y.parentSourceMeasure.measureListIndexz)return;let le=Y.ParentStaffLine;if(le||(le=de),Y&&de&&le){let he=!1;de!==le&&(he=!0);const me=new L.VexFlowPedal(j,de.PositionAndShape,!1,he);me.setEndsStave(Y,re);let _e=q.findGraphicalStaffEntryFromTimestamp(te);_e||(_e=q.staffEntries[0]);let Me=Y.findGraphicalStaffEntryFromTimestamp(re);if(Me||(Me=Y.staffEntries[Y.staffEntries.length-1]),!me.setStartNote(_e))return;if(me.setBeginsStave(me.startNote.isRest(),te),le!==de)if(me.pedalSymbol===H.MusicSymbol.PEDAL_SYMBOL){me.setEndNote(Me),me.setEndMeasure(Y),me.ReleaseText=" ",me.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(me.startVfVoiceEntry,me.endVfVoiceEntry,me,de);const Ue=le.Measures[0],Ge=new L.VexFlowPedal(j,Ue.PositionAndShape);me.setEndsStave(Y,re);const Qe=Ue.staffEntries[0];if(!Ge.setStartNote(Qe))return;Ge.setEndNote(Me),Ge.setEndMeasure(Y),me.setEndMeasure(Y),le.Pedals.push(Ge),Ge.CalculateBoundingBox(),Ge.DepressText=" ",this.calculatePedalSkyBottomLine(Ge.startVfVoiceEntry,Ge.endVfVoiceEntry,Ge,le)}else{let Ue=this.findLastStafflineMeasure(de);Ue===void 0&&(Ue=Y);const Ge=Ue.staffEntries[Ue.staffEntries.length-1];me.setEndNote(Ge),me.setEndMeasure(Y),me.ChangeEnd=!1;const Qe=le.ParentMusicSystem.Id-de.ParentMusicSystem.Id;if(Qe>0){let Re=1;for(let We=de.ParentMusicSystem.Id;Wele){const Ue=le;le=he,he=Ue}ye.SkyBottomLineCalculator.updateBottomLineInRange(he,le,me+_e)}for(const _e of ye.Pedals){const Me=_e,Ue=Me.getPedalMarking();if(me>Ue.line+3+(ye.StaffLines.length-1)){const Ge=Ue.render_options.text_margin_right/10;let Qe,Re=Me.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-Ge;Me.setLine(me-3-(ye.StaffLines.length-1));let We=(j=Me.endVfVoiceEntry)===null||j===void 0?void 0:j.PositionAndShape;if(We||(We=Me.endMeasure.PositionAndShape),Me.EndSymbolPositionAndShape){const qe=Y.render_options.glyph_point_size/20;Qe=Re+3.4;const Ke=We.AbsolutePosition.x-Ge,Ze=Ke+1.5;ye.SkyBottomLineCalculator.updateBottomLineInRange(Re,Qe,me+qe),ye.SkyBottomLineCalculator.updateBottomLineInRange(Ke,Ze,me+qe)}else{const qe=Ue.render_options.bracket_height/10;if(Ue.EndsStave)Qe=We.AbsolutePosition.x+We.Size.width-Ge;else switch(Y.style){case z.BRACKET_OPEN_END:case z.BRACKET_OPEN_BOTH:case z.MIXED_OPEN_END:Qe=We.AbsolutePosition.x+We.BorderRight-Ge;break;default:Qe=We.AbsolutePosition.x+We.BorderLeft-Ge}const Ke=(re=(te=Me.endVfVoiceEntry)===null||te===void 0?void 0:te.parentStaffEntry)===null||re===void 0?void 0:re.vfClefBefore;if(Ke&&(Qe+=Ke.getWidth()/10),Re>Qe){const Ze=Re;Re=Qe,Qe=Ze}ye.SkyBottomLineCalculator.updateBottomLineInRange(Re,Qe,me+qe)}}}}calculateOctaveShiftSkyBottomLine(ge,ce,ee,ye){if(!ce)return void v.default.warn("octaveshift: no endStaffEntry");let Ee=ce.PositionAndShape;ee.graphicalEndAtMeasureEnd&&(Ee=ce.parentMeasure.PositionAndShape);let j=ge.PositionAndShape.Size.width,te=Ee.Size.width;ge.hasOnlyRests()?j=-j:j/=2,ee.graphicalEndAtMeasureEnd||(ce.hasOnlyRests()?te*=2:te/=2,ge===ce&&(te*=2));let re=ge.PositionAndShape.AbsolutePosition.x-j,O=Ee.AbsolutePosition.x+te;if(re>O){const q=re;re=O,O=q}ee.PositionAndShape.Size.width=O-re;const z=ee.getTextBracket(),Y=z.font.size/10;if(z.position===p.TextBracket.Positions.TOP){const q=Math.ceil(ye.SkyBottomLineCalculator.getSkyLineMinInRange(re,O));if(q===1/0)return;z.start.getStave().options.top_text_position=Math.abs(q),ye.SkyBottomLineCalculator.updateSkyLineInRange(re,O,q-2*Y)}else{const q=ye.SkyBottomLineCalculator.getBottomLineMaxInRange(re,O);if(q===1/0)return;z.start.getStave().options.bottom_text_position=q,ye.SkyBottomLineCalculator.updateBottomLineInRange(re,O,q+1.5*Y)}}calculateWordRepetitionInstruction(ge,ce){let ee;const ye=this.graphicalMusicSheet.MeasureList[ce];for(let Ee=0,j=ye.length;Eeee.StaffLines));let ce=0;for(const ee of ge)for(const ye of ee.Measures)ye&&ce++;if(this.rules.AlwaysSetPreferredSkyBottomLineBackendAutomatically&&this.rules.setPreferredSkyBottomLineBackendAutomatically(ce),ce>=this.rules.SkyBottomLineBatchMinMeasures)new o.SkyBottomLineBatchCalculator(ge,this.rules.PreferredSkyBottomLineBatchCalculatorBackend).calculateLines();else for(const ee of ge)ee.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){for(const ge of this.musicSystems)for(const ce of ge.StaffLines)try{ce.AlignmentManager.alignDynamicExpressions(),ce.AbstractExpressions.forEach(ee=>{ee.updateSkyBottomLine()})}catch{}}handleTiedGraphicalNote(ge,ce,ee,ye,Ee,j,te,re){}handleBeam(ge,ce,ee){ge.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(ge,ce)}handleVoiceEntryLyrics(ge,ce,ee){ge.LyricsEntries.forEach((ye,Ee)=>{const j=new T.GraphicalLyricEntry(Ee,ce,this.rules.LyricsHeight,this.rules.StaffHeight);if(ce.LyricsEntries.push(j),j.GraphicalLabel.setLabelPositionAndShapeBorders(),Ee.Word){const te=Ee.Word.Syllables.indexOf(Ee);let re=ee.indexOf(Ee.Word);if(re===-1&&(ee.push(Ee.Word),re=ee.indexOf(Ee.Word)),this.graphicalLyricWords.length===0||re>this.graphicalLyricWords.length-1){const O=new P.GraphicalLyricWord(Ee.Word);j.ParentLyricWord=O,O.GraphicalLyricsEntries[te]=j,this.graphicalLyricWords.push(O)}else{const O=this.graphicalLyricWords[re];j.ParentLyricWord=O,O.GraphicalLyricsEntries[te]=j,O.isFilled()&&(ee.splice(re,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(O),1))}}})}handleVoiceEntryOrnaments(ge,ce,ee){}handleVoiceEntryArticulations(ge,ce,ee){}handleVoiceEntryTechnicalInstructions(ge,ce,ee){}handleTuplet(ge,ce,ee){ge.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(ge,ce)}findIndexGraphicalSlurFromSlur(ge,ce){for(let ee=0;ee=0){const Y=ye[z];Y.staffEntries.indexOf(j)===-1&&Y.staffEntries.push(j),ye.splice(z,1)}}}for(const te of ye)te.staffEntries.indexOf(j)===-1&&te.staffEntries.push(j)}}for(const ce of this.musicSystems)for(const ee of ce.StaffLines){const ye=ee.GraphicalSlurs.sort(N.GraphicalSlur.Compare);for(const Ee of ye)Ee.slur.isCrossed()||Ee.calculateCurve(this.rules)}}calculateGlissandi(){const ge={};for(const ce of this.graphicalMusicSheet.MeasureList[0])ge[ce.ParentStaff.idInMusicSheet]=[];for(const ce of this.musicSystems)for(const ee of ce.StaffLines){const ye=ge[ee.ParentStaff.idInMusicSheet];for(let Ee=0;Ee=0){const Y=ye[z];Y.staffEntries.indexOf(j)===-1&&Y.staffEntries.push(j),ye.splice(z,1)}}}}for(const te of ye)te.staffEntries.indexOf(j)===-1&&te.staffEntries.push(j)}}for(const ce of this.musicSystems)for(const ee of ce.StaffLines)for(const ye of ee.GraphicalGlissandi)if(ee.ParentStaff.isTab){const Ee=ye.Glissando.StartNote,j=ye.Glissando.EndNote,te=ye.staffEntries[0].findGraphicalNoteFromNote(Ee),re=ye.staffEntries.last().findGraphicalNoteFromNote(j);if(!te&&!re)return;let O,z,Y,q,de=1;Ee.FretNumber>j.FretNumber&&(de=-1),te&&te.vfnote&&te.vfnote.length>=2&&(Y=te.vfnote[0],O=[0]),re&&re.vfnote&&re.vfnote.length>=2&&(q=re.vfnote[0],z=[0]);const le=new p.TabSlide({first_indices:O,first_note:Y,last_indices:z,last_note:q},de),he=te==null?void 0:te.parentVoiceEntry.parentStaffEntry.parentMeasure;he&&(he.vfTies.push(le),ye.vfTie=le);const me=re==null?void 0:re.parentVoiceEntry.parentStaffEntry.parentMeasure;me&&(me.vfTies.push(le),ye.vfTie=le)}}}a.VexFlowMusicSheetCalculator=be},5820:function(b,a,r){var h=this&&this.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowMusicSheetDrawer=a.unitInPixels=void 0;const s=h(r(6368)),m=r(1494),c=r(3278),o=r(9086),u=r(2942),d=r(8155),x=r(3748),p=r(5277),v=r(9428),S=h(r(2043)),T=r(374),P=r(7459),_=r(4462),E=r(9505);a.unitInPixels=10;class M extends m.MusicSheetDrawer{constructor(I=new P.DrawingParameters){super(new u.VexFlowTextMeasurer(I.Rules),I),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(I){var R,V,U;this.rules.DefaultVexFlowNoteFont==="gonville"&&(s.default.Flow.DEFAULT_FONT_STACK=[(R=s.default.Flow.Fonts)===null||R===void 0?void 0:R.Gonville,(V=s.default.Flow.Fonts)===null||V===void 0?void 0:V.Bravura,(U=s.default.Flow.Fonts)===null||U===void 0?void 0:U.Custom]),s.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*a.unitInPixels,s.default.Flow.STEM_WIDTH=this.rules.StemWidth*a.unitInPixels,s.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,s.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const K of I.MusicPages){if(K.PageNumber>this.rules.MaxPageToDrawNumber)break;const k=this.backends[this.pageIdx];k.graphicalMusicPage=K,k.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(I)}drawPage(I){I&&(this.backend=this.backends[I.PageNumber-1],super.drawPage(I),this.pageIdx+=1)}clear(){for(const I of this.backends)I.clear()}setZoom(I){this.zoom=I}calculatePixelDistance(I){return I*a.unitInPixels}drawStaffLine(I){super.drawStaffLine(I);const R=I.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(I,R),this.rules.RenderGlissandi&&this.drawGlissandi(I,R)}drawSlurs(I,R){for(const V of I.GraphicalSlurs)V.slur.isCrossed()||this.drawSlur(V,R)}drawGlissandi(I,R){for(const V of I.GraphicalGlissandi)this.drawGlissando(V,R)}drawGlissando(I,R){if(I.StaffLine.ParentStaff.isTab||I.calculateLine(this.rules),I.Line){const V=new o.PointF2D(I.Line.Start.x+R.x,I.Line.Start.y),U=new o.PointF2D(I.Line.End.x+R.x,I.Line.End.y);this.drawLine(V,U,I.Color,I.Width)}else{const V=I.vfTie;if(V){const U=this.backend.getContext();V.setContext(U),V.draw()}}}drawSlur(I,R){const V=[],U=new o.PointF2D(I.bezierStartPt.x+R.x,I.bezierStartPt.y+R.y),K=new o.PointF2D(I.bezierStartControlPt.x+R.x,I.bezierStartControlPt.y+R.y),k=new o.PointF2D(I.bezierEndControlPt.x+R.x,I.bezierEndControlPt.y+R.y),W=new o.PointF2D(I.bezierEndPt.x+R.x,I.bezierEndPt.y+R.y);V.push(this.applyScreenTransformation(U)),V.push(this.applyScreenTransformation(K)),V.push(this.applyScreenTransformation(k)),V.push(this.applyScreenTransformation(W)),I.placement===x.PlacementEnum.Above?(U.y-=.05,K.y-=.3,k.y-=.3,W.y-=.05):(U.y+=.05,K.y+=.3,k.y+=.3,W.y+=.05),V.push(this.applyScreenTransformation(U)),V.push(this.applyScreenTransformation(K)),V.push(this.applyScreenTransformation(k)),V.push(this.applyScreenTransformation(W)),I.SVGElement=this.backend.renderCurve(V)}drawMeasure(I){I.setAbsoluteCoordinates(I.PositionAndShape.AbsolutePosition.x*a.unitInPixels,I.PositionAndShape.AbsolutePosition.y*a.unitInPixels);try{I.draw(this.backend.getContext())}catch(V){S.default.warn("VexFlowMusicSheetDrawer.drawMeasure",V)}let R=0;for(const V of I.staffEntries)this.drawStaffEntry(V),R=this.drawBuzzRolls(V,R)}drawBuzzRolls(I,R){var V;for(const U of I.graphicalVoiceEntries)for(const K of U.notes)if(!((V=K.sourceNote.TremoloInfo)===null||V===void 0)&&V.tremoloUnmeasured){const k=this.rules.TremoloBuzzRollThickness,W=.9,G=.5,X=K;let L,H;const ne=X.vfnote[0].getStemDirection();let ie;if(this.backend instanceof E.SvgVexFlowBackend&&(ie=X.getStemSVG()),(ie==null?void 0:ie.getBbox)!==void 0){const Ee=ie.getBBox();L=new o.PointF2D(Ee.x/10,Ee.y/10),H=Ee.height/10}else H=X.vfnote[0].getStemLength()/10,L=new o.PointF2D(X.vfnote[0].getStem().x_begin/10,X.vfnote[0].getStem().y_top/10),ne===1&&(L.y-=H);let be=L.y+H/3;X.vfnote[0].getBeamCount()>1&&(be=L.y+H/2,ne===-1&&(be-=G+.2));const ae=L.x-.5,ge=be,ce=[],ee=[new o.PointF2D(0,-k),new o.PointF2D(W-k,0),new o.PointF2D(-W+k,-G),new o.PointF2D(0,-k),new o.PointF2D(W,0),new o.PointF2D(0,k),new o.PointF2D(-W+k,0),new o.PointF2D(W-k,G),new o.PointF2D(0,k),new o.PointF2D(-W,0)];let ye=new o.PointF2D(ae,ge);ce.push(ye);for(const Ee of ee)ye=ce.last(),ce.push(new o.PointF2D(ye.x+Ee.x,ye.y-Ee.y));this.DrawPath(ce,X.ParentMusicPage,!0,`buzzRoll${R}`),R++}return R}drawLine(I,R,V="#000000FF",U=.2){return I=this.applyScreenTransformation(I),R=this.applyScreenTransformation(R),this.backend.renderLine(I,R,V,U*a.unitInPixels)}DrawOverlayLine(I,R,V,U="#FF0000FF",K=.2,k){if(!V.PageNumber||V.PageNumber>this.backends.length||V.PageNumber<1)return void console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const W=V.PageNumber-1,G=this.backends[W];return I=this.applyScreenTransformation(I),R=this.applyScreenTransformation(R),k||(k=`overlayLine ${I.x}/${I.y}`),G.renderLine(I,R,U,K*a.unitInPixels,k)}DrawPath(I,R,V=!0,U){const K=R.PageNumber-1,k=this.backends[K],W=[];for(const G of I)W.push(this.applyScreenTransformation(G));return k.renderPath(W,V,U)}drawSkyLine(I){const R=I.PositionAndShape.AbsolutePosition,V=I.PositionAndShape.Size.width;this.drawSampledLine(I.SkyLine,R,V)}drawBottomLine(I){const R=new o.PointF2D(I.PositionAndShape.AbsolutePosition.x,I.PositionAndShape.AbsolutePosition.y),V=I.PositionAndShape.Size.width;this.drawSampledLine(I.BottomLine,R,V,"#0000FFFF")}drawSampledLine(I,R,V,U="#FF0000FF"){const K=[];let k=0;for(let G=0;G0){const G=this.rules.SamplingUnit;let X,L,H=new o.PointF2D(W.x,W.y),ne=new o.PointF2D(K[0]/G+W.x,W.y);this.drawLine(H,ne,U),I[0]>=0&&(X=new o.PointF2D(K[0]/G+W.x,W.y),L=new o.PointF2D(K[0]/G+W.x,W.y+I[K[0]]),this.drawLine(X,L,U));for(let ie=1;ie0)for(const R of I.FingeringEntries)R.SVGNode=this.drawLabel(R,d.GraphicalLayers.Notes);if(I.graphicalChordContainers!==void 0&&I.graphicalChordContainers.length>0)for(const R of I.graphicalChordContainers){const V=R.GraphicalLabel;V.SVGNode=this.drawLabel(V,d.GraphicalLayers.Notes)}this.rules.RenderLyrics&&I.LyricsEntries.length>0&&this.drawLyrics(I.LyricsEntries,d.GraphicalLayers.Notes)}drawLyrics(I,R){I.forEach(V=>{const U=V.GraphicalLabel;U.Label.colorDefault=this.rules.DefaultColorLyrics,U.SVGNode=this.drawLabel(U,R)})}drawInstrumentBrace(I,R){I.draw(this.backend.getContext())}drawGroupBracket(I,R){I.draw(this.backend.getContext())}drawOctaveShifts(I){for(const R of I.OctaveShifts)if(R){const V=R,U=this.backend.getContext(),K=V.getTextBracket();this.rules.DefaultColorMusic&&(K.render_options.color=this.rules.DefaultColorMusic),K.setContext(U);try{K.draw()}catch(k){S.default.warn(k)}}}drawPedals(I){for(const R of I.Pedals)if(R){const V=R,U=this.backend.getContext(),K=V.getPedalMarking();K.render_options.color=this.rules.DefaultColorMusic,K.setContext(U),K.draw()}}drawExpressions(I){for(const R of I.AbstractExpressions)if(R instanceof v.GraphicalInstantaneousDynamicExpression)this.drawInstantaneousDynamic(R);else if(R instanceof p.GraphicalInstantaneousTempoExpression){const V=R.GraphicalLabel;V.SVGNode=this.drawLabel(V,d.GraphicalLayers.Notes)}else if(R instanceof T.GraphicalContinuousDynamicExpression)this.drawContinuousDynamic(R);else if(R instanceof _.GraphicalUnknownExpression){const V=R.Label;V.SVGNode=this.drawLabel(V,d.GraphicalLayers.Notes)}else S.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(I){const R=I.Label;R.SVGNode=this.drawLabel(R,d.GraphicalLayers.Notes)}drawContinuousDynamic(I){var R;if(I.IsVerbal){const V=I.Label;V.SVGNode=this.drawLabel(V,d.GraphicalLayers.Notes)}else for(const V of I.Lines){const U=new o.PointF2D(I.ParentStaffLine.PositionAndShape.AbsolutePosition.x+V.Start.x,I.ParentStaffLine.PositionAndShape.AbsolutePosition.y+V.Start.y),K=new o.PointF2D(I.ParentStaffLine.PositionAndShape.AbsolutePosition.x+V.End.x,I.ParentStaffLine.PositionAndShape.AbsolutePosition.y+V.End.y);this.drawLine(U,K,(R=V.colorHex)!==null&&R!==void 0?R:"#000000",V.Width)}}renderLabel(I,R,V,U,K,k){var W;if(!I.Label.print)return;const G=I.Label.fontHeight*a.unitInPixels,{font:X}=I.Label;let L;this.rules.ColoringEnabled&&(L=I.Label.colorDefault,I.ColorXML&&(L=I.ColorXML),L||(L=this.rules.DefaultColorLabel));let H,{fontStyle:ne,fontFamily:ie}=I.Label;ne||(ne=this.rules.DefaultFontStyle),ie||(ie=this.rules.DefaultFontFamily);for(let be=0;be<((W=I.TextLines)===null||W===void 0?void 0:W.length);be++){const ae=I.TextLines[be],ge=this.calculatePixelDistance(ae.xOffset),ce=new o.PointF2D(k.x+ge,k.y),ee=this.backend.renderText(G,ne,X,ae.text,K,ce,L,I.Label.fontFamily);H?H.appendChild(ee):H=ee,k.y=k.y+K,I.TextLines.length>1&&(k.y+=this.rules.SpacingBetweenTextLines)}return H}renderRectangle(I,R,V,U,K){return this.backend.renderRectangle(I,V,U,K)}applyScreenTransformation(I){return new o.PointF2D(I.x*a.unitInPixels,I.y*a.unitInPixels)}applyScreenTransformationForRect(I){return new c.RectangleF2D(I.x*a.unitInPixels,I.y*a.unitInPixels,I.width*a.unitInPixels,I.height*a.unitInPixels)}}a.VexFlowMusicSheetDrawer=M},8494:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowMusicSystem=void 0;const h=r(7142),s=r(6894),m=r(7771),c=r(8129),o=r(5575),u=r(8939);class d extends h.MusicSystem{constructor(p,v){super(p),this.rules=v}calculateBorders(p){if(this.staffLines.length===0)return;const v=this.calcBracketsWidth();this.boundingBox.BorderLeft=-v,this.boundingBox.BorderMarginLeft=-v,this.boundingBox.XBordersHaveBeenSet=!0;const S=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=S,this.boundingBox.BorderMarginTop=S;const T=this.staffLines[this.staffLines.length-1],P=T.SkyBottomLineCalculator.getBottomLineMax()+T.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=P,this.boundingBox.BorderMarginBottom=P,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(p,v,S,T,P,_,E=void 0){const M=_;let N=!1;if(E&&(N=!0,E.lineTo(_,c.VexFlowConverter.line(S,T)),E.addMeasureLine(S,T),S===s.SystemLinesEnum.DotsBoldBoldDots)){const I=E.ParentStaffLine.Measures.indexOf(E)+1,R=E.ParentStaffLine.Measures[I],V=_.ParentStaffLine.Measures[I];R&&V&&(R.lineTo(V,c.VexFlowConverter.line(s.SystemLinesEnum.BoldThinDots,T)),R.addMeasureLine(s.SystemLinesEnum.BoldThinDots,T))}return M&&M.addMeasureLine(S,T,N),new m.SystemLine(S,T,this,_,E)}createInstrumentBracket(p,v){const S=p,T=v,P=new u.VexFlowInstrumentBrace(S,T);this.InstrumentBrackets.push(P)}createGroupBracket(p,v,S){const T=p,P=v;if(S===0){const _=new o.VexFlowInstrumentBracket(T,P,S);this.GroupBrackets.push(_)}else{const _=new u.VexFlowInstrumentBrace(T,P,S);this.GroupBrackets.push(_)}}}a.VexFlowMusicSystem=d},9520:function(b,a,r){var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowOctaveShift=void 0;var s=h(r(6368)).default.Flow;const m=r(873),c=r(5853),o=h(r(2043));class u extends m.GraphicalOctaveShift{constructor(x,p){switch(super(x,p),x.Type){case c.OctaveEnum.VA8:this.position=s.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case c.OctaveEnum.MA15:this.position=s.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case c.OctaveEnum.VB8:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case c.OctaveEnum.MB15:this.position=s.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:o.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(x){for(const p of x.graphicalVoiceEntries){const v=p;if(v!=null&&v.vfStaveNote)return this.startNote=v.vfStaveNote,!0}return!1}setEndNote(x){var p;for(const v of x.graphicalVoiceEntries){const S=v;if(S!=null&&S.vfStaveNote)return this.endNote=S.vfStaveNote,this.endMeasure=x.parentMeasure,!((p=this.endMeasure)===null||p===void 0)&&p.parentSourceMeasure.Rules.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure&&S.notes[0].sourceNote.isWholeMeasureNote()&&(this.graphicalEndAtMeasureEnd=!0),!0}return!1}getTextBracket(){let x,p=this.endNote;const v=this;this.graphicalEndAtMeasureEnd&&(x={getAbsoluteX:()=>10*(v.endMeasure.PositionAndShape.AbsolutePosition.x+v.endMeasure.PositionAndShape.Size.width),getGlyph:()=>({getWidth:()=>0})}),x&&(p=x);const S=new s.TextBracket({position:this.position,start:this.startNote,stop:p,superscript:this.supscript,text:this.text});return this.endsOnDifferentStaffLine&&(S.render_options.show_bracket=!1),S}}a.VexFlowOctaveShift=u},3010:function(b,a,r){var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowPedal=void 0;const s=h(r(6368)),m=r(8911),c=r(4082),o=r(158);class u extends c.GraphicalPedal{constructor(x,p,v=!1,S=!1){switch(super(x,p),this.vfStyle=s.default.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=x.ChangeBegin,this.ChangeEnd=x.ChangeEnd,this.pedalSymbol){case o.MusicSymbol.PEDAL_SYMBOL:this.vfStyle=s.default.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new m.BoundingBox(this,p);break;case o.MusicSymbol.PEDAL_MIXED:this.vfStyle=v&&S?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:v?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:S?s.default.Flow.PedalMarking.Styles.MIXED_OPEN_END:s.default.Flow.PedalMarking.Styles.MIXED;break;case o.MusicSymbol.PEDAL_BRACKET:default:this.vfStyle=v&&S?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:v?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:S?s.default.Flow.PedalMarking.Styles.BRACKET_OPEN_END:s.default.Flow.PedalMarking.Styles.BRACKET}}setStartNote(x){if(!x)return!1;for(const p of x.graphicalVoiceEntries){const v=p;if(v!=null&&v.vfStaveNote)return this.startNote=v.vfStaveNote,this.startVfVoiceEntry=v,!0}return!1}setEndNote(x){if(!x)return!1;for(const p of x.graphicalVoiceEntries){const v=p;if(v!=null&&v.vfStaveNote)return this.endNote=v.vfStaveNote,this.endVfVoiceEntry=v,!0}return!1}setEndMeasure(x){this.endMeasure=x}CalculateBoundingBox(){}setLine(x){this.line=x}getPedalMarking(){const x=new s.default.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&x.setEndStave(this.endMeasure.getVFStave()),x.setStyle(this.vfStyle),x.setLine(this.line),x.setCustomText(this.DepressText,this.ReleaseText),this.endVfVoiceEntry&&!this.getPedal.EndsStave||(x.EndsStave=!0),this.getPedal.BeginsStave&&(x.BeginsStave=!0),x.ChangeBegin=this.ChangeBegin,x.ChangeEnd=this.ChangeEnd,x}setEndsStave(x,p){p!=null&&p.gte(x.parentSourceMeasure.Duration)&&(this.getPedal.EndsStave=!0)}setBeginsStave(x,p){x&&p.RealValue===0&&(this.getPedal.BeginsStave=!0)}}a.VexFlowPedal=u},8041:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowSlur=a.CurvePositionEnum=void 0;var s,m=h(r(6368)).default.Flow;(function(o){o[o.NEAR_HEAD=1]="NEAR_HEAD",o[o.NEAR_TOP=2]="NEAR_TOP"})(s=a.CurvePositionEnum||(a.CurvePositionEnum={}));class c{constructor(u){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=u}static createFromVexflowSlur(u){return new c(u.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:s.NEAR_TOP,position_end:s.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new m.Curve(this.vfStartNote,this.vfEndNote,void 0)}}a.VexFlowSlur=c},9252:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowStaffEntry=void 0;const h=r(3023),s=r(5820),m=r(8640);class c extends h.GraphicalStaffEntry{constructor(u,d,x){super(u,d,x)}calculateXPosition(){const u=this.parentMeasure.getVFStave();let d=0;for(const x of this.graphicalVoiceEntries)if(x.vfStaveNote){if(x.vfStaveNote.setStave(u),!x.vfStaveNote.preFormatted)continue;x.applyBordersFromVexflow();let p=!1,v=this.PositionAndShape;x.notes[0].sourceNote.isWholeRest()&&!this.hasOnlyRests()&&(p=!0,v=x.PositionAndShape),this.parentMeasure.ParentStaff.isTab?v.RelativePosition.x=(x.vfStaveNote.getAbsoluteX()+x.vfStaveNote.glyph.getWidth())/s.unitInPixels:(v.RelativePosition.x=x.vfStaveNote.getBoundingBox().getX()/s.unitInPixels,p&&(v.RelativePosition.x-=u.getNoteStartX()/s.unitInPixels,v.RelativePosition.x-=1.3));const S=x.notes[0].sourceNote;S.isRest()&&S.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(v.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,x.PositionAndShape.BorderLeft=-.7,x.PositionAndShape.BorderRight=.7),x.PositionAndShape.BorderLeftv.staffLine),x=this.calculateModifierXOffsets(d,1),p=this.calculateModifierXOffsets(d,.5);u.forEach((v,S)=>{v.baseFingeringXOffset=p[S],v.baseStringNumberXOffset=x[S]})}calculateModifierXOffsets(u,d){const x=[];for(let p=0;p=0;T--){if(Math.abs(u[p]-u[T])<=d&&v===x[T]){v++,S=!0;break}S=!1}x.push(v)}return x}}a.VexFlowStaffEntry=c},4828:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowStaffLine=void 0;const h=r(9953),s=r(449);class m extends h.StaffLine{constructor(o,u){super(o,u),this.slursInVFStaffLine=[],this.alignmentManager=new s.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(o){this.slursInVFStaffLine.push(o)}get AlignmentManager(){return this.alignmentManager}}a.VexFlowStaffLine=m},8790:function(b,a,r){var h=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowTabMeasure=void 0;var s=h(r(6368)).default.Flow;const m=r(7330),c=r(8129),o=h(r(2043));class u extends m.VexFlowMeasure{constructor(x,p=void 0,v=void 0){super(x,p,v),this.isTabMeasure=!0}resetLayout(){var x;const p=(x=this.ParentStaff.StafflineCount)!==null&&x!==void 0?x:6;this.stave=new s.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:p}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let p=0,v=this.staffEntries.length;p1){const _=c.VexFlowConverter.StrokeTypeFromArpeggioType(P.type),E=new s.Stroke(_,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&T.vfStaveNote.addStroke(0,E)}else o.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. - voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}if(T.vfGhostNotes)for(const P of T.vfGhostNotes)this.vfVoices[p.VoiceId].addTickable(P);else this.vfVoices[p.VoiceId].addTickable(T.vfStaveNote)}else if(T.vfGhostNotes)for(const P of T.vfGhostNotes)this.vfVoices[p.VoiceId].addTickable(P);else this.vfVoices[p.VoiceId].addTickable(T.vfStaveNote)}}}}a.VexFlowTabMeasure=u},2942:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowTextMeasurer=void 0;const h=r(8129);a.VexFlowTextMeasurer=class{constructor(s){this.fontSize=20,this.fontSizeStandard=this.fontSize;const m=document.createElement("canvas");this.context=m.getContext("2d"),this.rules=s}computeTextWidthToHeightRatio(s,m,c,o=void 0,u=this.fontSize){return this.context.font=h.VexFlowConverter.font(u,c,m,this.rules,o),this.context.measureText(s).width/u}setFontSize(s=this.fontSizeStandard){return this.fontSize=s,s}}},5460:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.VexFlowVoiceEntry=void 0;const h=r(5974),s=r(5820),m=r(7459);class c extends h.GraphicalVoiceEntry{constructor(u,d,x){super(u,d,x)}applyBordersFromVexflow(){var u;const d=this.vfStaveNote;if(!d.getNoteHeadBeginX)return;const x=d.getBoundingBox(),p=d.getNoteHeadBeginX()-x.x;this.PositionAndShape.RelativePosition.y=x.y/s.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=x.h/s.unitInPixels;const v=(d.width-((u=d.paddingRight)!==null&&u!==void 0?u:0))/2;this.PositionAndShape.BorderLeft=-(p+v)/s.unitInPixels,this.PositionAndShape.BorderRight=(x.w-p)/s.unitInPixels}set vfStaveNote(u){this.mVexFlowStaveNote=u}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var u;const d=this.rules.DefaultColorNotehead,x=this.rules.DefaultColorRest,p=this.rules.DefaultColorStem,v="#00000000";let S,T;const P=this.vfStaveNote;for(let I=0;I{Object.defineProperty(a,"__esModule",{value:!0}),a.VexflowStafflineNoteCalculator=void 0;const h=r(8640),s=r(4679),m=r(1649),c=r(289),o=r(908);class u{constructor(x){this.staffPitchListMapping=new m.Dictionary,this.baseLineNote=h.NoteEnum.B,this.baseLineOctave=1,this.rules=x}trackNote(x){if(!(x instanceof s.VexFlowGraphicalNote)||x.Clef().ClefType!==c.ClefEnum.percussion||x.sourceNote.isRest()||this.rules.PercussionOneLineCutoff===0||this.rules.PercussionForceVoicesOneLineCutoff===-1)return;const p=x.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let v;this.staffPitchListMapping.containsKey(p)||this.staffPitchListMapping.setValue(p,new Array),v=this.staffPitchListMapping.getValue(p);const S=x.sourceNote.Pitch;u.findOrInsert(v,S)}static PitchIndexOf(x,p,v=0){if(v>x.length-1)return-1;for(let S=v;Sthis.rules.PercussionOneLineCutoff&&!S&&!this.rules.PercussionUseCajon2NoteSystem)return x;const T=x,P=x.sourceNote.Pitch;let _=this.baseLineNote,E=this.baseLineOctave;if(this.rules.PercussionUseCajon2NoteSystem?P.FundamentalNote===h.NoteEnum.C&&(_=h.NoteEnum.G,E=1):this.rules.PercussionUseXMLDisplayStep&&x.sourceNote.displayStepUnpitched!==void 0&&(_=x.sourceNote.displayStepUnpitched,E=x.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),v.length<=this.rules.PercussionForceVoicesOneLineCutoff)T.setAccidental(new h.Pitch(_,E,P.Accidental));else{const M=u.PitchIndexOf(v,P);if(M>-1){const N=Math.ceil(v.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(M>=N)switch(E=2,(M-N)%5){case 1:_=h.NoteEnum.E;break;case 2:_=h.NoteEnum.G;break;case 3:_=h.NoteEnum.B;break;case 4:_=h.NoteEnum.D,E=3;break;default:_=h.NoteEnum.C}else switch(M%5){case 1:_=h.NoteEnum.F;break;case 2:_=h.NoteEnum.D;break;case 3:_=h.NoteEnum.B,E=0;break;case 4:_=h.NoteEnum.G,E=0;break;default:_=h.NoteEnum.A}const I=new h.Pitch(_,E,P.Accidental);T.setAccidental(I);const R=T.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&R.Notes.length<2&&(I.Octave>this.baseLineOctave||I.FundamentalNote===this.baseLineNote&&I.Octave===this.baseLineOctave?T.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=o.StemDirectionType.Up:T.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=o.StemDirectionType.Down)}}return T}getStafflineUniquePositionCount(x){return this.staffPitchListMapping.containsKey(x)?this.staffPitchListMapping.getValue(x).length:0}}a.VexflowStafflineNoteCalculator=u},9839:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(449),a),s(r(4028),a),s(r(9505),a),s(r(709),a),s(r(9344),a),s(r(8129),a),s(r(3602),a),s(r(4679),a),s(r(8144),a),s(r(6351),a),s(r(8939),a),s(r(5575),a),s(r(7330),a),s(r(4405),a),s(r(8738),a),s(r(5820),a),s(r(8494),a),s(r(9520),a),s(r(8041),a),s(r(9252),a),s(r(4828),a),s(r(7781),a),s(r(8790),a),s(r(2942),a),s(r(5460),a)},7636:function(b,a,r){var h=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(a,"__esModule",{value:!0}),a.WebGLSkyBottomLineBatchCalculatorBackend=void 0;const s=r(1378),m=r(9531),c=h(r(6357)),o=h(r(6150)),u=h(r(2043)),d=r(2337);function x(v,S,T){const P=v.createShader(S);if(!P)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL shader"),new Error("Could not create a WebGL shader");if(v.shaderSource(P,T),v.compileShader(P),!v.getShaderParameter(P,v.COMPILE_STATUS))throw u.default.warn(`Shader compilation failed -`+v.getShaderInfoLog(P)),v.deleteShader(P),new Error("WebGL shader compilation failed");return P}class p extends m.SkyBottomLineBatchCalculatorBackend{constructor(S,T){super(S,T)}getPreferredRenderingConfiguration(S,T){const P=Math.min(4096,function(){const E=document.createElement("canvas").getContext("webgl");return E.getParameter(E.MAX_TEXTURE_SIZE)}()),_=Math.ceil(S);return{elementWidth:_,numColumns:Math.min(5,Math.floor(P/_)),numRows:Math.min(5,Math.floor(P/T))}}onInitialize(S){const{elementWidth:T,elementHeight:P,numColumns:_,numRows:E}=S,M=document.createElement("canvas");M.width=T*_,M.height=E;const N=M.getContext("webgl");if(!N)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: No WebGL support"),new Error("No WebGL support");this.gl=N;const I=function(R,V,U){const K=R.createProgram();if(!K)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL program"),new Error("Could not create a WebGL program");if(R.attachShader(K,V),R.attachShader(K,U),R.linkProgram(K),!R.getProgramParameter(K,R.LINK_STATUS))throw u.default.warn(`WebGLSkyBottomLineCalculatorBackend: WebGL program link failed -`+R.getProgramInfoLog(K)),R.deleteProgram(K),new Error("WebGL program link failed");return K}(N,x(N,N.VERTEX_SHADER,c.default),x(N,N.FRAGMENT_SHADER,function(R,V){let U=R;for(const[K,k]of Object.entries(V)){const W=new RegExp(`#define ${K} .*`);U=U.replace(W,`#define ${K} ${k}`)}return U}(o.default,{NUM_ROWS:E,ELEMENT_HEIGHT:P})));(function(R,V,U,K){const k=R.createBuffer();if(!k)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL buffer creation failed"),new Error("WebGL buffer creation failed");R.bindBuffer(R.ARRAY_BUFFER,k),R.bufferData(R.ARRAY_BUFFER,new Float32Array(d.CollectionUtil.flat([[-1,-1],[1,-1],[1,1],[-1,-1],[1,1],[-1,1]])),R.STATIC_DRAW),R.useProgram(V);const W=R.getAttribLocation(V,"a_position");R.enableVertexAttribArray(W),R.vertexAttribPointer(W,2,R.FLOAT,!1,0,0)})(N,I),this.texture=function(R,V,U,K){const k=R.createTexture();if(!k)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL texture creation failed"),new Error("WebGL texture creation failed");R.activeTexture(R.TEXTURE0+0),R.bindTexture(R.TEXTURE_2D,k),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.NEAREST),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MAG_FILTER,R.NEAREST);const W=R.getUniformLocation(V,"u_image");if(!W)throw u.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL invalid uniform name"),new Error("WebGL invalid uniform name");return R.uniform1i(W,0),k}(N,I)}calculateFromCanvas(S,T,P,_,E){const M=this.gl,{elementWidth:N,elementHeight:I,numColumns:R}=E;M.viewport(0,0,M.canvas.width,M.canvas.height),M.bindTexture(M.TEXTURE_2D,this.texture),M.texImage2D(M.TEXTURE_2D,0,M.RGBA,M.RGBA,M.UNSIGNED_BYTE,S),M.drawArrays(M.TRIANGLES,0,6);const V=new Uint8Array(M.canvas.width*M.canvas.height*4);M.readPixels(0,0,M.canvas.width,M.canvas.height,M.RGBA,M.UNSIGNED_BYTE,V);const U=[];for(let K=0;K{Object.defineProperty(a,"__esModule",{value:!0}),a.Instrument=void 0;const h=r(884),s=r(2255),m=r(0);class c extends h.InstrumentalGroup{constructor(u,d,x,p){super(void 0,x,p),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=u,this.idString=d,this.nameLabel=new s.Label(d)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(u){this.hasLyrics=u}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(u){this.hasChordSymbols=u}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(u){this.lyricVersesNumbers=u}get Name(){return this.nameLabel.text}set Name(u){this.nameLabel.text=u}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(u){this.subInstruments[0].midiInstrumentID=u}get Volume(){return this.subInstruments[0].volume}set Volume(u){for(let d=0,x=this.subInstruments.length;d0&&this.Voices[0].Visible}set Visible(u){for(let d=0,x=this.Voices.length;d{Object.defineProperty(a,"__esModule",{value:!0}),a.InstrumentalGroup=void 0,a.InstrumentalGroup=class{constructor(r,h,s){this.instrumentalGroups=[],this.name=r,this.musicSheet=h,this.parent=s}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(r){this.name=r}get GetMusicSheet(){return this.musicSheet}}},1035:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AClassHierarchyTrackable=void 0,a.AClassHierarchyTrackable=class{isInstanceOfClass(r){let h=this.constructor.prototype;for(;h;){if(r===h.constructor.name)return!0;h=h.__proto__}return!1}}},9603:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},7058:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},6287:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},4543:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},4207:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},6331:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ITextTranslation=void 0,a.ITextTranslation=class{static translateText(r,h){if(!this.defaultTextTranslation)return h}}},9984:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},4854:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0})},4143:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(9603),a),s(r(7058),a),s(r(6287),a),s(r(4207),a),s(r(6331),a),s(r(9984),a),s(r(4854),a),s(r(1035),a),s(r(4543),a)},2255:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Label=void 0;const h=r(1274);a.Label=class{constructor(s="",m=h.TextAlignmentEnum.CenterBottom,c=void 0,o=!0){this.IsCreditLabel=!1,this.text=s,this.print=o,this.textAlignment=m,this.font=c,this.fontFamily=void 0}ToString(){return this.text}}},5278:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimestampTransform=a.MusicPartManager=void 0;const h=r(1797),s=r(301);a.MusicPartManager=class{constructor(c){this.musicSheet=c}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new h.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(c){let o;for(let u=this.timestamps.length-1;u>=0;u--)if(o=this.timestamps[u],c.gte(o.$from))return o;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(c){if(this.timestamps.length===0)return c;const o=this.getCurrentRepetitionTimestampTransform(c);return h.Fraction.plus(c,h.Fraction.minus(o.to,o.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(c){return c?new s.MusicPartManagerIterator(this.musicSheet,c,void 0):new s.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(c){this.musicSheet.SelectionStart=c,this.musicSheet.SelectionEnd=void 0}setSelectionRange(c,o){this.musicSheet.SelectionStart=c??this.sheetStart,this.musicSheet.SelectionEnd=o??this.sheetEnd}calcMapping(){const c=[],o=this.getIterator();let u=o.CurrentRepetition,d=new m(o.CurrentEnrolledTimestamp.clone(),o.CurrentSourceTimestamp.clone(),void 0,0);for(c.push(d);!o.EndReached;){if(o.JumpOccurred||u!==o.CurrentRepetition){if(u=o.CurrentRepetition,o.backJumpOccurred){const x=o.JumpResponsibleRepetition;d.nextBackJump=o.CurrentEnrolledTimestamp,d.curRepetition=x,d.curRepetitionIteration=o.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let p=this.timestamps.length-2;p>=0&&!c[p].to.lt(x.AbsoluteTimestamp)&&!c[p].curRepetition;p--)c[p].nextBackJump=d.nextBackJump,c[p].curRepetition=x,c[p].curRepetitionIteration=d.curRepetitionIteration}d=new m(o.CurrentEnrolledTimestamp.clone(),o.CurrentSourceTimestamp.clone(),void 0,0),c.push(d)}o.moveToNext()}this.timestamps=c}};class m{constructor(o,u,d,x){this.$from=o,this.to=u,this.curRepetition=d,this.curRepetitionIteration=x,this.nextBackJump=void 0,this.nextForwardJump=void 0}}a.TimestampTransform=m},301:function(b,a,r){var h=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(a,"__esModule",{value:!0}),a.MusicPartManagerIterator=void 0;const s=r(1797),m=r(5356),c=r(3331),o=r(7839),u=h(r(2043));class d{constructor(p,v,S){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new s.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new s.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new s.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new s.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[],this.SkipInvisibleNotes=!0;try{this.frontReached=!0,this.musicSheet=p,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const T of this.musicSheet.Repetitions)this.setRepetitionIterationCount(T,1);if(this.activeDynamicExpressions=new Array(this.musicSheet.getCompleteNumberOfStaves()),this.currentMeasure=this.musicSheet.SourceMeasures[0],!v)return;do this.moveToNext();while((!this.currentVoiceEntries||this.currentTimeStamp.lt(v))&&!this.endReached);for(let T=0;T=this.JumpResponsibleRepetition.StartIndex&&T.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(T)}}handleRepetitionsAtMeasureEnd(){for(let p=0,v=this.currentMeasure.LastRepetitionInstructions.length;p-1&&this.getRepetitionIterationCount(T)=this.JumpResponsibleRepetition.StartIndex&&T.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(T);const P=T.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(T));if(P>=0)return this.currentMeasureIndex=P,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=T,void(this.forwardJumpOccurred=!0);P===-2&&(this.endReached=!0)}}}this.currentMeasureIndex++,this.JumpResponsibleRepetition!==void 0&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(p){this.currentMeasureIndex=p.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(p),this.jumpResponsibleRepetition=p}activateCurrentRhythmInstructions(){if(this.currentMeasure!==void 0&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&this.currentMeasure.FirstInstructionsStaffEntries[0]!==void 0){const p=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let v=0,S=p.length;v0&&(this.currentDynamicEntryIndex>=p.length||this.CurrentSourceTimestamp.lte(p[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=v.length||this.CurrentSourceTimestamp.lte(v[this.currentTempoEntryIndex].AbsoluteTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex0){this.currentVoiceEntryIndex--;const p=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(p),this.currentVerticalContainerInMeasureTimestamp=p.Timestamp,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.activateCurrentDynamicOrTempoInstructions();const v=this.musicSheet.SelectionEnd;return v&&this.currentTimeStamp.lt(v)&&(this.endReached=!1),void(this.currentMeasureIndex=this.musicSheet.SourceMeasures.indexOf(this.CurrentMeasure))}if(this.currentVoiceEntryIndex!==0||this.currentMeasureIndex===0)this.frontReached=!0,this.currentTimeStamp=new s.Fraction(-1,1);else{const p=this.musicSheet.SourceMeasures[this.currentMeasureIndex-1];this.currentMeasureIndex--,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex];const v=p.VerticalSourceStaffEntryContainers[p.VerticalSourceStaffEntryContainers.length-1];this.currentVoiceEntries=this.getVoiceEntries(v),this.currentVerticalContainerInMeasureTimestamp=v.Timestamp,this.currentVoiceEntryIndex=p.VerticalSourceStaffEntryContainers.length-1,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,v.Timestamp),this.activateCurrentDynamicOrTempoInstructions();const S=this.musicSheet.SelectionEnd;S&&this.currentTimeStamp.lt(S)&&(this.endReached=!1)}}recursiveMove(){if(this.currentVoiceEntryIndex++,this.currentVoiceEntryIndex===0&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!p)return!0;for(let S=0,T=v.length;S0){const E=this.TimestampSortedTempoExpressionsList[0];if(E.InstantaneousTempo)return E.InstantaneousTempo.TempoInBpm;if(E.ContinuousTempo)return E.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(E){return v.default.info("MusicSheet.FirstMeasureNumber: ",E),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(E){return v.default.info("MusicSheet.LastMeasureNumber: ",E),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(E){this.currentEnrolledPosition=E.clone()}get Transpose(){return this.transpose}set Transpose(E){this.transpose=E}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(E){this.idString=E}getEnrolledSelectionStartTimeStampWorkaround(){const E=this.MusicPartManager.getIterator(this.SelectionStart);return s.Fraction.createFromFraction(E.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const E=this.getLastSourceMeasure();return s.Fraction.plus(E.AbsoluteTimestamp,E.Duration)}getSourceMeasureFromTimeStamp(E){for(let M=0,N=this.sourceMeasures.length;M0&&I.Voices[0].Visible&&E.push(I)}return E}}a.MusicSheet=P,P.defaultTitle="defaultTitle"},6656:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MappingSourceMusicPart=void 0,a.MappingSourceMusicPart=class{constructor(r,h,s,m=-1,c=!1){this.repetitionRun=-1,this.sourceMusicPart=r,this.parentPartListEntry=s,this.startTimestamp=h.clone(),this.repetitionRun=m,this.parentRepetition=s,this.isEnding=c}get IsRepetition(){return this.parentRepetition!==void 0}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(r){return r?this.startTimestamp.CompareTo(r.startTimestamp):1}}},3766:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PartListEntry=void 0,a.PartListEntry=class{constructor(r){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=r}get Visible(){return this.visible}set Visible(r){this.visible=r}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},1717:function(b,a,r){var h=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(a,"__esModule",{value:!0}),a.RepetitionEndingPart=a.Repetition=void 0;const s=r(8817),m=r(1797),c=r(3766),o=h(r(2043));class u extends c.PartListEntry{constructor(p,v){super(p),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=p,this.virtualOverallRepetition=v}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(p){this.visibles=p}get DefaultNumberOfRepetitions(){let p=2;return this.virtualOverallRepetition&&(p=1),Math.max(p,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(p){this.userNumberOfRepetitions=p,this.repetitonIterationOrder=[];const v=this.userNumberOfRepetitions-this.NumberOfEndings;for(let S=1;S<=this.userNumberOfRepetitions;S++)S<=v?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(S-v)}getForwardJumpTargetForIteration(p){const v=this.repetitonIterationOrder[p-1];return this.endingIndexDict[v]?this.endingIndexDict[v].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}SetEndingStartIndex(p,v){const S=new d(new s.SourceMusicPart(this.musicSheet2,v,v));this.endingParts.push(S);for(const T of p)try{this.endingIndexDict[T]=S,S.endingIndices.push(T),this.numberOfEndings{Object.defineProperty(a,"__esModule",{value:!0}),a.SourceMusicPart=void 0;const h=r(3766),s=r(1797);class m extends h.PartListEntry{constructor(o,u,d){super(o),this.musicSheet=o,this.startIndex=u,this.endIndex=d}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(o){this.parentRepetition=o}get AbsoluteTimestamp(){return s.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(o){this.startIndex=o}setEndIndex(o){this.endIndex=o}}a.SourceMusicPart=m},4990:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(6656),a),s(r(3766),a),s(r(1717),a),s(r(8817),a)},2393:function(b,a,r){var h=this&&this.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(a,"__esModule",{value:!0}),a.InstrumentReader=void 0;const s=r(8109),m=r(9050),c=r(289),o=r(5198),u=r(3331),d=r(1797),x=r(6331),p=r(1703),v=r(289),S=r(3331),T=r(5198),P=h(r(2043)),_=r(289),E=r(2905),M=r(4671),N=r(3755),I=r(908),R=r(2478),V=r(6894);a.InstrumentReader=class{constructor(U,K,k,W){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.repetitionInstructionReader=K,this.xmlMeasureList=k,this.musicSheet=W.GetMusicSheet,this.instrument=W,this.activeClefs=new Array(W.Staves.length),this.activeClefsHaveBeenInitialized=new Array(W.Staves.length);for(let G=0;G=this.xmlMeasureList.length)return!1;this.currentMeasure=U,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(U,this.currentXmlMeasureIndex);let L=new d.Fraction(0,1),H=new d.Fraction(0,1),ne=!1;this.maxTieNoteFraction=new d.Fraction(0,1);let ie=!1;try{const be=this.xmlMeasureList[this.currentXmlMeasureIndex],ae=be.elements();if(U.Rules.UseXMLMeasureNumbers&&!Number.isInteger(U.MeasureNumberXML)){const ce=parseInt((W=be.attribute("number"))===null||W===void 0?void 0:W.value,10);Number.isInteger(ce)&&(U.MeasureNumberXML=ce)}let ge;for(let ce=0;ce0&&(ge=ae[ce-1]),ee.name==="print"){const ye=ee.attribute("new-system");(ye==null?void 0:ye.value)==="yes"&&(U.printNewSystemXml=!0);const Ee=ee.attribute("new-page");(Ee==null?void 0:Ee.value)==="yes"&&(U.printNewPageXml=!0)}else if(ee.name==="attributes"){const ye=ee.element("divisions");if(ye&&(this.divisions=parseInt(ye.value,10),isNaN(this.divisions))){const te=x.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(P.default.debug("InstrumentReader.readNextXmlMeasure",te),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw ne=!0,new p.MusicSheetReadingException(te+this.instrument.Name);this.musicSheet.SheetErrors.push(te+this.instrument.Name)}if(!ee.element("divisions")&&this.divisions===0&&this.currentXmlMeasureIndex===0){const te=x.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw ne=!0,new p.MusicSheetReadingException(te+this.instrument.Name);this.musicSheet.SheetErrors.push(te+this.instrument.Name)}this.addAbstractInstruction(ee,k,ge,L.clone()),L.Equals(new d.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],ee)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],ee,L)&&this.saveClefInstructionAtEndOfMeasure();const Ee=ee.elements("staff-details");for(const te of Ee){const re=te.element("staff-lines");if(re){let O=1;const z=te.attribute("number");z&&(O=parseInt(z.value,10)),this.instrument.Staves[O-1].StafflineCount=parseInt(re.value,10)}}const j=ee.element("measure-style");if(j){const te=j.element("multiple-rest");if(te){const re=te.value;let O=0;try{O=Number.parseInt(re,10),U.multipleRestMeasures!==void 0&&O!==U.multipleRestMeasures?U.multipleRestMeasures=0:(U.multipleRestMeasures=O,this.currentMultirestStartMeasure=U,this.followingMultirestMeasures=O+1)}catch(z){console.log("multirest parse error: "+z)}}}}else if(ee.name==="note"){let ye=!0;((G=ee.attribute("print-object"))===null||G===void 0?void 0:G.value)==="no"&&(ye=!1);const Ee=this.getNoteStaff(ee);this.currentStaff=this.instrument.Staves[Ee-1];const j=ee.element("chord")!==void 0;if(ee.element("voice")){const st=parseInt(ee.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(st,Ee-1)}else j&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,Ee-1));let te,re=0,O=new d.Fraction(0,1),z=2,Y=!1;if(ee.element("duration")){if(re=parseInt(ee.element("duration").value,10),isNaN(re)){const st=x.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(st),P.default.debug("InstrumentReader.readNextXmlMeasure",st);continue}if(O=new d.Fraction(re,4*this.divisions),re===0?O=this.getNoteDurationFromTypeNode(ee):te=this.getNoteDurationFromTypeNode(ee),ee.element("time-modification")){O=this.getNoteDurationForTuplet(ee);const st=ee.element("time-modification");st!=null&&st.element("normal-notes")&&(z=parseInt(st.element("normal-notes").value,10)),Y=!0}}const q=ee.element("rest")!==void 0,de=ee.combinedElement("notations"),le=ee.element("grace")!==void 0||re===0||j&&ie;let he=!1,me=!1;if(le){const st=ee.element("grace");st&&st.attributes()&&st.attribute("slash")&&st.attribute("slash").value==="yes"&&(he=!0),O=this.getNoteDurationFromTypeNode(ee),de&&de.element("slur")&&(me=!0)}const[_e,Me]=this.getCueNoteAndNoteTypeXml(ee),[Ue,Ge,Qe]=this.getStemDirectionAndColors(ee);let Re,We=!1;if(de){const st=de.element("ornaments");st&&(Re=this.getTremoloInfo(st),We=this.getVibratoStrokes(st))}const qe=j?H.clone():L.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(qe,this.inSourceMeasureInstrumentIndex+Ee-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!j&&!le&&!ie||le&&!ie||le&&!j||!le&&ie)&&this.currentVoiceGenerator.createVoiceEntry(qe,this.currentStaffEntry,!q&&!le,le,he,me),le||j||(H=L.clone(),L.Add(O)),j&&this.currentStaffEntry!==void 0&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+Ee-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const Ke=this.currentStaffEntry!==void 0&&this.currentStaffEntry.Timestamp!==void 0&&this.currentStaffEntry.Timestamp.Equals(new d.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,Ke),this.activeRhythm,Y||le||(O=new d.Fraction(re,4*this.divisions));const Ze=ee.elements("dot").length;if(this.currentVoiceGenerator.read(ee,O,te,Me,z,q,this.currentStaffEntry,this.currentMeasure,K,this.maxTieNoteFraction,j,k,ye,_e,le,Ue,Re,Ge,Qe,We,Ze),de!==void 0&&de.element("dynamics")){const st=this.expressionReaders[this.readExpressionStaffNumber(ee)-1];st&&(st.readExpressionParameters(ee,this.instrument,this.divisions,L,H,this.currentMeasure.MeasureNumber,!1),st.read(ee,this.currentMeasure,H))}ie=le}else if(ee.name==="forward"){const ye=parseInt(ee.element("duration").value,10);L.Add(new d.Fraction(ye,4*this.divisions))}else if(ee.name==="backup"){const ye=parseInt(ee.element("duration").value,10);L.Sub(new d.Fraction(ye,4*this.divisions)),L.IsNegative()&&(L=new d.Fraction(0,1)),H.Sub(new d.Fraction(ye,4*this.divisions)),H.IsNegative()&&(H=new d.Fraction(0,1))}else if(ee.name==="direction"){const ye=ee.element("direction-type");let Ee=Math.min(1,L.RealValue);this.activeRhythm!==void 0&&this.activeRhythm.Rhythm&&(Ee/=this.activeRhythm.Rhythm.RealValue);let j=!1;if(this.repetitionInstructionReader&&(j=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(ye,Ee)),!j){let te=this.expressionReaders[0];const re=this.readExpressionStaffNumber(ee)-1;re0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const k=new c.ClefInstruction(v.ClefEnum.G,0,2);let W;K.FirstInstructionsStaffEntries[U]?(W=K.FirstInstructionsStaffEntries[U],W.removeFirstInstructionOfTypeClefInstruction()):(W=new m.SourceStaffEntry(void 0,void 0),K.FirstInstructionsStaffEntries[U]=W),k.Parent=W,W.Instructions.splice(0,0,k)}createDefaultKeyInstruction(){let U;U=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const K=new o.KeyInstruction(void 0,0,T.KeyEnum.major);for(let k=this.inSourceMeasureInstrumentIndex;k0&&k[W-1].name==="backup")return!0;let G=-1;for(let X=0;X0||G<0}isAttributesNodeAtEndOfMeasure(U,K,k){var W;if(k.Equals((W=this.ActiveRhythm)===null||W===void 0?void 0:W.Rhythm))return!0;const G=U.elements().slice();let X=0;for(let H=0;HL}getNoteDurationFromTypeNode(U){const K=U.element("type");if(K){const k=K.value;return R.NoteTypeHandler.getNoteDurationFromType(k)}return new d.Fraction(0,4*this.divisions)}addAbstractInstruction(U,K,k,W){if(U.element("divisions")&&U.elements().length===1)return;const G=U.element("transpose");if(G){const H=G.element("chromatic");H&&(this.instrument.PlaybackTranspose=parseInt(H.value,10))}const X=U.elements("clef");let L;if(X.length>0)for(let H=0,ne=X.length;Hthis.currentClefNumber&&(ge=this.currentClefNumber),this.currentClefNumber=ge+1}catch{L=x.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(L),ge=1,this.currentClefNumber=ge+1}const j=new c.ClefInstruction(be,ce,ae);this.abstractInstructions.push([ge,j,W])}if(U.element("key")!==void 0&&this.instrument.MidiInstrumentId!==_.MidiInstrument.Percussion){let H=0;const ne=U.element("key").element("fifths");if(ne)try{H=parseInt(ne.value,10)}catch(ge){L=x.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(L),H=0,P.default.debug("InstrumentReader.addAbstractInstruction",L,ge)}let ie=T.KeyEnum.none,be=U.element("key");if(be&&(be=be.element("mode")),be)try{ie=T.KeyEnum[be.value]}catch(ge){L=x.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key/mode. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(L),ie=T.KeyEnum.major,P.default.debug("InstrumentReader.addAbstractInstruction",L,ge)}const ae=new o.KeyInstruction(void 0,H,ie);this.abstractInstructions.push([1,ae,W])}if(U.element("time")){const H=U.element("time");let ne=S.RhythmSymbolEnum.NONE,ie=!0;if(H!==void 0&&H.hasAttributes){const Ee=H.attribute("symbol");Ee&&(Ee.value==="common"?ne=S.RhythmSymbolEnum.COMMON:Ee.value==="cut"&&(ne=S.RhythmSymbolEnum.CUT));const j=H.attribute("print-object");j&&j.value==="no"&&(ie=!1)}let be=0,ae=0;const ge=H&&H.element("senza-misura")!==void 0,ce=U.elements("time"),ee=[],ye=[];for(let Ee=0,j=ce.length;Ee0&&ye!==void 0&&ee.length===ye.length){const j=ee.length,te=new Array(j);let re=0;for(let O=0;O=0;k--){const W=this.abstractInstructions[k],G=W[0],X=W[1],L=W[2];if(X instanceof c.ClefInstruction){const H=X;if(this.currentXmlMeasureIndex===0||G<=this.activeClefs.length&&H!==this.activeClefs[G-1])if(K||this.currentStaffEntry===void 0||this.currentStaffEntry.hasNotes()||G-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(K){if(L.RealValue!==0)continue;let ne;if(this.currentMeasure){const ie=H,be=this.inSourceMeasureInstrumentIndex+G-1,ae=this.currentMeasure.FirstInstructionsStaffEntries[be];if(this.currentXmlMeasureIndex===0)if(ae)if(this.currentMeasure.FirstInstructionsStaffEntries[be]===void 0||ae.Instructions[0]instanceof c.ClefInstruction){const ge=new m.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[be]=ge,ie.Parent=ge,ge.Instructions.push(ie)}else ne=ae,ie.Parent=ne,ne.removeFirstInstructionOfTypeClefInstruction(),ne.Instructions.splice(0,0,ie),this.activeClefsHaveBeenInitialized[G-1]=!0;else ne=new m.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[be]=ne,ie.Parent=ne,ne.Instructions.push(ie),this.activeClefsHaveBeenInitialized[G-1]=!0;else if(this.activeClefsHaveBeenInitialized[G-1]){let ge=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(ge=this.currentMultirestStartMeasure);const ce=new m.SourceStaffEntry(void 0,void 0);ge.LastInstructionsStaffEntries[be]=ce,ie.Parent=ce,ce.Instructions.push(ie)}else{const ge=this.musicSheet.SourceMeasures[0];ge.FirstInstructionsStaffEntries[be]?(ne=ge.FirstInstructionsStaffEntries[be],ne.removeFirstInstructionOfTypeClefInstruction()):ne=new m.SourceStaffEntry(void 0,void 0),ie.Parent=ne,ne.Instructions.splice(0,0,ie),this.activeClefsHaveBeenInitialized[G-1]=!0}this.activeClefs[G-1]=H,this.abstractInstructions.splice(k,1)}}else{let ne;const ie=this.activeRhythm.Rhythm;ie.RealValue>0&&L.RealValue/ie.RealValue>.9&&ie.RealValue!==L.RealValue&&(this.currentMeasure.LastInstructionsStaffEntries[G-1]||(this.currentMeasure.LastInstructionsStaffEntries[G-1]=new m.SourceStaffEntry(void 0,this.instrument.Staves[G-1])),ne=this.currentMeasure.LastInstructionsStaffEntries[G-1]),ne&&(H.Parent=ne,ne.Instructions.push(H),this.activeClefs[G-1]=H,this.abstractInstructions.splice(k,1))}else{const ne=H,ie=this.currentStaffEntry;if(L&&Math.abs(L.RealValue-ie.Timestamp.RealValue)>.01)continue;ne.Parent=ie,ie.removeFirstInstructionOfTypeClefInstruction(),ie.Instructions.push(ne),this.activeClefs[G-1]=H,this.abstractInstructions.splice(k,1)}else G<=this.activeClefs.length&&H===this.activeClefs[G-1]&&this.abstractInstructions.splice(k,1)}if(X instanceof o.KeyInstruction){const H=X;if(this.activeKey&&this.activeKey.Key===H.Key)this.abstractInstructions.splice(k,1);else{let ne;if(this.activeKey=H,this.abstractInstructions.splice(k,1),this.activeKeyHasBeenInitialized?ne=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,ne=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),ne)for(let ie=this.inSourceMeasureInstrumentIndex;ie=0;U--){const K=this.abstractInstructions[U][0],k=this.abstractInstructions[U][1];if(k instanceof c.ClefInstruction){const W=k;if(!this.activeClefs[K-1]||W.ClefType!==this.activeClefs[K-1].ClefType||W.ClefType===this.activeClefs[K-1].ClefType&&W.Line!==this.activeClefs[K-1].Line){const G=new m.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+K-1]=G;const X=W;X.Parent=G,G.Instructions.push(X),this.activeClefs[K-1]=W,this.abstractInstructions.splice(U,1)}}}}getNoteDurationForTuplet(U){let K=new d.Fraction(0,1);const k=this.getNoteDurationFromTypeNode(U);if(U.element("time-modification")){const W=U.element("time-modification");if(W&&W.element("actual-notes")!==void 0&&W.element("normal-notes")){const G=W.element("actual-notes"),X=W.element("normal-notes");if(G!==void 0&&X){const L=parseInt(G.value,10),H=parseInt(X.value,10);K=new d.Fraction(H*k.Numerator,L*k.Denominator)}}}return K}readExpressionStaffNumber(U){let K=1;if(U.element("staff")){const k=U.element("staff");if(k)try{K=parseInt(k.value,10)}catch(W){const G=x.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number. Set to default.");this.musicSheet.SheetErrors.pushMeasureError(G),K=1,P.default.debug("InstrumentReader.readExpressionStaffNumber",G,W)}}return K}readDivisionsFromNotes(){let U=0,K=this.currentXmlMeasureIndex,k=!1;for(;!k;){const W=this.xmlMeasureList[K].elements();for(let G=0,X=W.length;G0){k=!0;break}}if(U===0&&(K++,K===this.xmlMeasureList.length)){const G=x.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new p.MusicSheetReadingException(G+this.instrument.Name)}}return U}getCueNoteAndNoteTypeXml(U){let K=!1;U.element("cue")&&(K=!0);const k=U.element("type");let W=R.NoteType.UNDEFINED;if(k){const G=k.attribute("size");(G==null?void 0:G.value)==="cue"&&(K=!0),W=R.NoteTypeHandler.StringToNoteType(k.value)}return[K,W]}getStemDirectionType(U){switch(U.value){case"down":return I.StemDirectionType.Down;case"up":return I.StemDirectionType.Up;case"double":return I.StemDirectionType.Double;case"none":return I.StemDirectionType.None;default:return I.StemDirectionType.Undefined}}getNoteHeadColorXml(U){const K=U.element("notehead");if(K){const k=K.attribute("color");if(k)return this.parseXmlColor(k.value)}return null}getNoteColorXml(U){const K=U.attribute("color");return K?this.parseXmlColor(K.value):null}getTremoloInfo(U){let K,k;const W=U.element("tremolo");if(W){const G=W.attribute("type");if(G){if(G.value==="single"){const X=parseInt(W.value,10);X>0&&(K=X)}else K=0;G.value==="unmeasured"&&(k=!0)}}return{tremoloStrokes:K,tremoloUnmeasured:k}}getVibratoStrokes(U){const K=U.element("wavy-line");if(K!==void 0){const k=K.attribute("type");if(k&&k.value==="start")return!0}return!1}getNoteStaff(U){let K=1;return this.instrument.Staves.length>1&&U.element("staff")&&(K=parseInt(U.element("staff").value,10),isNaN(K)&&(P.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),K=1)),K}}},1372:function(b,a,r){var h=this&&this.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSheetReader=void 0;const s=r(7514),m=r(5942),c=r(1797),o=r(2393),u=r(6842),d=r(6331),x=r(1703),p=h(r(2043)),v=r(3331),S=r(3331),T=r(9050),P=r(884),_=r(5142),E=r(289),M=r(2255),N=r(8736),I=r(1405),R=r(2458),V=r(1274);class U{constructor(k=void 0,W=new I.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new R.ReaderPluginManager,this.afterSheetReadingModules=k||[],this.repetitionInstructionReader=N.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=N.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=W}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(k){for(const W of k)W.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(k,W){try{return this._createMusicSheet(k,W)}catch(G){return void p.default.error("MusicSheetReader.CreateMusicSheet",G)}}_removeFromArray(k,W){const G=k.indexOf(W);G!==-1&&k.splice(G,1)}trimString(k){return k.replace(/^\s+|\s+$/g,"")}_lastElement(k){return k[k.length-1]}_createMusicSheet(k,W){const G=[];let X=0;if(this.musicSheet=new s.MusicSheet,this.musicSheet.Path=W,this.musicSheet.Rules=this.rules,!k)throw new x.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(k,W);const L=k.element("part-list");if(!L)throw new x.MusicSheetReadingException("Undefined partListNode");const H=k.elements("part"),ne=L.elements();this.initializeReading(ne,H,G);let ie=!0;this.currentFraction=new c.Fraction(0,1);let be=!1,ae=k.element("identification");for(ae&&(ae=ae.element("encoding")),ae&&(ae=ae.element("software")),ae!==void 0&&ae.value==="Guitar Pro 5"&&(be=!0);ie;){this.currentMeasure!==void 0&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(X=0),this.currentMeasure=new m.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const ge of G)try{ie=ie&&ge.readNextXmlMeasure(this.currentMeasure,this.currentFraction,be)}catch(ce){const ee=d.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new x.MusicSheetReadingException(ee,ce)}ie&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(G),this.checkSourceMeasureForNullEntries(),X=this.setSourceMeasureDuration(G,X),U.doCalculationsAfterDurationHasBeenSet(G),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let ge=0,ce=this.afterSheetReadingModules.length;geG){if(this.areRhythmInstructionsMixed(W)&&ne.SymbolEnum!==S.RhythmSymbolEnum.NONE)continue;G=ne.Rhythm.RealValue,X=W.indexOf(ne)}}if(W.length>0&&W.lengthk.Denominator){const G=W.Denominator/k.Denominator;k.expand(G)}}checkIfMeasureIsImplicit(k,W){return!(this.previousMeasure||!k.lt(W))||!!this.previousMeasure&&c.Fraction.plus(this.previousMeasure.Duration,k).Equals(W)}allInstrumentsHaveSameDuration(k,W){let G=0;for(let X=0,L=k.length;X=0;k--)for(let W=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries.length-1;W>=0;W--){const G=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries[W];if(G)for(let X=G.VoiceEntries.length-1;X>=0;X--){const L=G.VoiceEntries[X];L.Notes.length===0&&(this._removeFromArray(L.ParentVoice.VoiceEntries,L),this._removeFromArray(G.VoiceEntries,L))}G!==void 0&&G.VoiceEntries.length===0&&G.ChordContainers.length===0&&(this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries[W]=void 0)}for(let k=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;k>=0;k--){let W=0;for(let G=0,X=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries.length;G0){const G=W[0].elements("rights");if(G.length>0)for(let X=0,L=G.length;Xne||O)if(ie||O){if(te||q==="right")ae?ae+=` -`+Y:ae=Y;else if(j||q!=="right"&&q!=="left")be?be+=` -`+Y:be=Y;else if(q==="left"){this.musicSheet.Lyricist||(this.musicSheet.Lyricist=new M.Label(Y));break}}else ie=Y}}}}if(!this.musicSheet.Title&&ie&&(this.musicSheet.Title=new M.Label(this.trimString(ie))),!this.musicSheet.Subtitle&&be&&(this.musicSheet.Subtitle=new M.Label(this.trimString(be))),ae){let ce=!1;this.musicSheet.Composer?((L=ae.match(` -`))!==null&&L!==void 0?L:[]).length+1>=((H=this.musicSheet.Composer.text.match(` -`))!==null&&H!==void 0?H:[]).length+1&&(ce=!0):ce=!0,ce&&(this.musicSheet.Composer=new M.Label(this.trimString(ae)))}}readTitleAndComposerFromCreditsLegacy(k){var W,G,X;const L=this.computeSystemYCoordinates(k);if(L===0)return;let H,ne,ie,be=1,ae=0;const ge=k.elements("credit");for(let ce=0,ee=ge.length;ceL||z){if(!this.musicSheet.Title&&!z){const q=(X=Ee.attribute("font-size"))===null||X===void 0?void 0:X.value;if(q){const de=parseFloat(q);be0&&ae.MidiInstrumentId!==E.MidiInstrument.Percussion&&(Ee.midiInstrumentID=Math.max(0,parseInt(O.value,10)-1));else if(O.name==="midi-unpitched")Ee.fixedKey=Math.max(0,parseInt(O.value,10));else if(O.name==="volume")try{const z=parseFloat(O.value);Ee.volume=z/127}catch(z){p.default.debug("ExpressionReader.readExpressionParameters","read volume",z)}else if(O.name==="pan")try{const z=parseFloat(O.value);Ee.pan=z/64}catch(z){p.default.debug("ExpressionReader.readExpressionParameters","read pan",z)}}catch(z){p.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",z)}}}}catch(Ee){p.default.info("MusicSheetReader.createInstrumentGroups: ",Ee)}}if(ae.SubInstruments.length===0){const ce=new _.SubInstrument(ae);ae.SubInstruments.push(ce)}G[be]=ae,X?(X.InstrumentalGroups.push(ae),this.musicSheet.Instruments.push(ae)):(this.musicSheet.InstrumentalGroups.push(ae),this.musicSheet.Instruments.push(ae))}else if(ie.name==="part-group"&&ie.attribute("type").value==="start"){const be=new P.InstrumentalGroup("group",this.musicSheet,X);X?X.InstrumentalGroups.push(be):this.musicSheet.InstrumentalGroups.push(be),X=be}else if(ie.name==="part-group"&&ie.attribute("type").value==="stop"&&X){if(X.InstrumentalGroups.length===1){const be=X.InstrumentalGroups[0];X.Parent?(X.Parent.InstrumentalGroups.push(be),this._removeFromArray(X.Parent.InstrumentalGroups,X)):(this.musicSheet.InstrumentalGroups.push(be),this._removeFromArray(this.musicSheet.InstrumentalGroups,X))}X=X.Parent}}}catch(L){const H=d.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new x.MusicSheetReadingException(H,L)}for(let L=0,H=this.musicSheet.Instruments.length;L0){const L=X[0];if(L){let H=L.element("attributes");H&&(H=H.element("staves")),H?W+=parseInt(H.value,10):W++}}}if(isNaN(W)||W<=0){const G=d.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new x.MusicSheetReadingException(G)}return W}getInstrumentNumberOfStavesFromXml(k){let W=0;const G=k.element("measure");if(G){const X=G.element("attributes");let L;X&&(L=X.element("staves")),W=X&&L?parseInt(L.value,10):1}if(isNaN(W)||W<=0){const X=d.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new x.MusicSheetReadingException(X)}return W}}a.MusicSheetReader=U},8736:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MusicSymbolModuleFactory=void 0;const h=r(9934),s=r(6789);a.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new h.RepetitionInstructionReader}static createRepetitionCalculator(){return new s.RepetitionCalculator}}},7677:function(b,a,r){var h=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(a,"__esModule",{value:!0}),a.ArticulationReader=void 0;const s=r(908),m=h(r(2043)),c=r(1357),o=r(5922),u=r(3748),d=r(8640),x=r(1662),p=r(6943),v=r(8084);a.ArticulationReader=class{constructor(S){this.rules=S}getAccEnumFromString(S){switch(S){case"sharp":return d.AccidentalEnum.SHARP;case"flat":return d.AccidentalEnum.FLAT;case"natural":return d.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return d.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return d.AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return d.AccidentalEnum.TRIPLESHARP;case"triple-flat":return d.AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return d.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return d.AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return d.AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return d.AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return d.AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return d.AccidentalEnum.SLASHSHARP;case"double-slash-flat":return d.AccidentalEnum.DOUBLESLASHFLAT;case"sori":return d.AccidentalEnum.SORI;case"koron":return d.AccidentalEnum.KORON;default:return d.AccidentalEnum.NONE}}addArticulationExpression(S,T){var P,_;if(S!==void 0&&S.elements().length>0){const E=S.elements();for(let M=0,N=E.length;M0&&T.Articulations[0].articulationEnum!==s.ArticulationEnum.staccato&&T.Articulations.splice(0,0,k);else if(R==="breathmark")U===u.PlacementEnum.NotYetDefined&&(k.placement=u.PlacementEnum.Above);else if(R==="strongaccent"){const W=(_=I==null?void 0:I.attribute("type"))===null||_===void 0?void 0:_.value;W==="up"?k.articulationEnum=s.ArticulationEnum.marcatoup:W==="down"&&(k.articulationEnum=s.ArticulationEnum.marcatodown)}else if(V===s.ArticulationEnum.softaccent){const W=T.ParentSourceStaffEntry.ParentStaff.Id-1;U===u.PlacementEnum.NotYetDefined&&(U=u.PlacementEnum.Above,W>0&&(U=u.PlacementEnum.Below));const G=T.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure,X=new p.MultiExpression(G,T.Timestamp);X.StartingContinuousDynamic=new v.ContinuousDynamicExpression(v.ContDynamicEnum.crescendo,U,W,G,-1),X.StartingContinuousDynamic.IsStartOfSoftAccent=!0,X.StartingContinuousDynamic.StartMultiExpression=X,X.StartingContinuousDynamic.EndMultiExpression=X,X.EndingContinuousDynamic=new v.ContinuousDynamicExpression(v.ContDynamicEnum.diminuendo,U,W,G,-1),X.EndingContinuousDynamic.StartMultiExpression=X,X.EndingContinuousDynamic.EndMultiExpression=X,G.StaffLinkedExpressions[W].push(X)}T.hasArticulation(k)||T.Articulations.push(k)}}catch(V){return void m.default.debug("addArticulationExpression","Invalid note articulation.",V)}}}}addFermata(S,T){var P;let _=s.ArticulationEnum.fermata;S.attributes().length>0&&S.attribute("type")&&S.attribute("type").value==="inverted"&&(_=s.ArticulationEnum.invertedfermata);let E=u.PlacementEnum.Above;((P=S.attribute("placement"))===null||P===void 0?void 0:P.value)==="below"&&(E=u.PlacementEnum.Below),T.Articulations.push(new x.Articulation(_,E))}addTechnicalArticulations(S,T,P){var _,E;const M={bend:s.ArticulationEnum.bend,"down-bow":s.ArticulationEnum.downbow,"open-string":s.ArticulationEnum.naturalharmonic,"snap-pizzicato":s.ArticulationEnum.snappizzicato,stopped:s.ArticulationEnum.lefthandpizzicato,"up-bow":s.ArticulationEnum.upbow,harmonic:s.ArticulationEnum.naturalharmonic};for(const R in M){if(!M.hasOwnProperty(R))continue;const V=M[R],U=S.element(R);if(U){let K;((_=U.attribute("placement"))===null||_===void 0?void 0:_.value)==="above"&&(K=u.PlacementEnum.Above),((E=U.attribute("placement"))===null||E===void 0?void 0:E.value)==="below"&&(K=u.PlacementEnum.Below);const k=new x.Articulation(V,K);T.hasArticulation(k)||T.Articulations.push(k)}}const N=S.elements("fingering");for(const R of N){const V=this.createTechnicalInstruction(R,P);V.type=c.TechnicalInstructionType.Fingering,P.Fingering||(P.Fingering=V),T.TechnicalInstructions.push(V)}const I=S.element("string");if(I){const R=this.createTechnicalInstruction(I,P);R.type=c.TechnicalInstructionType.String,P.StringInstruction=R,T.TechnicalInstructions.push(R)}}createTechnicalInstruction(S,T){const P=new c.TechnicalInstruction;P.sourceNote=T,P.value=S.value;const _=S.attribute("placement");return this.rules.FingeringPositionFromXML&&(P.placement=this.getPlacement(_)),P}getPlacement(S,T=u.PlacementEnum.NotYetDefined){if(T!==u.PlacementEnum.NotYetDefined)return T;if(!S)return u.PlacementEnum.NotYetDefined;switch(S.value){case"above":return u.PlacementEnum.Above;case"below":return u.PlacementEnum.Below;case"left":return u.PlacementEnum.Left;case"right":return u.PlacementEnum.Right;default:return u.PlacementEnum.NotYetDefined}}addOrnament(S,T){if(S){let P;const _={"delayed-inverted-turn":o.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":o.OrnamentEnum.DelayedTurn,"inverted-mordent":o.OrnamentEnum.InvertedMordent,"inverted-turn":o.OrnamentEnum.InvertedTurn,mordent:o.OrnamentEnum.Mordent,"trill-mark":o.OrnamentEnum.Trill,turn:o.OrnamentEnum.Turn};for(const E in _){if(!_.hasOwnProperty(E))continue;const M=S.element(E);if(M){P=new o.OrnamentContainer(_[E]);const N=M.attribute("placement");N&&N.value==="below"&&(P.placement=u.PlacementEnum.Below)}}if(P){const E=S.elements("accidental-mark");if(E){let M=u.PlacementEnum.Below,N=d.AccidentalEnum.NONE;const I=E;for(let R=0,V=I.length;R0?K.RealValue>0?(H=s.Fraction.multiply(s.Fraction.minus(K,k),H),this.directionTimestamp=s.Fraction.plus(H,K)):this.directionTimestamp=s.Fraction.createFromFraction(H):this.offsetDivisions<0&&(K.RealValue>0?(H=s.Fraction.multiply(s.Fraction.minus(K,k),H),this.directionTimestamp=s.Fraction.minus(K,H)):this.directionTimestamp=s.Fraction.createFromFraction(H));const ne=R.element("direction-type");let ie;if(ne&&(ie=ne.element("wedge"),ie)){const ae=ie.attribute("default-y");ae&&(L=this.readPosition(ae))}this.WedgeYPosXml=L;const be=R.attribute("placement");if(be)try{const ae=be.value;ae==="below"?this.placement=T.PlacementEnum.Below:ae==="above"&&(this.placement=T.PlacementEnum.Above)}catch(ae){const ge=_.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");E.default.debug("ExpressionReader.readExpressionParameters",ge,ae),this.musicSheet.SheetErrors.pushMeasureError(ge),this.placement=T.PlacementEnum.Below}if(this.placement===T.PlacementEnum.NotYetDefined)try{if(ne){const ae=ne.element("dynamics");if(ae){const ee=ae.attribute("default-y");ee&&this.readExpressionPlacement(ee,"read dynamics y pos")}if(ie){const ee=ie.attribute("default-y");ee&&this.readExpressionPlacement(ee,"read wedge y pos")}const ge=ne.element("words");if(ge){const ee=ge.attribute("default-y");ee&&this.readExpressionPlacement(ee,"read words y pos")}const ce=ne.element("rehearsal");if(ce){const ee=ce.attribute("default-y");ee&&this.readExpressionPlacement(ee,"read rehearsal pos")}}}catch(ae){const ge=_.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement. Set to default.");E.default.debug("ExpressionReader.readExpressionParameters",ge,ae),this.musicSheet.SheetErrors.pushMeasureError(ge),this.placement=T.PlacementEnum.Below}this.placement===T.PlacementEnum.NotYetDefined&&(V.Staves.length>1?this.placement=T.PlacementEnum.Below:V.HasLyrics?this.placement=T.PlacementEnum.Above:this.placement=T.PlacementEnum.Below)}read(R,V,U,K=void 0){let k=!1,W=!1;const G=R.element("sound");if(G){const H=G.attribute("tempo"),ne=G.attribute("dynamics");if(H){const ie=H.value.match(/^(\d+)(\.\d+)?$/);(ie==null?void 0:ie.length)>0?this.soundTempo=Math.round(Number.parseFloat(H.value)):(E.default.info("invalid xml tempo: "+H.value),this.soundTempo=100),V.TempoInBPM=this.soundTempo,this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,k=!0}if(ne){const ie=ne.value.match(/\d+/);this.soundDynamic=ie!==void 0?parseInt(ie[0],10):100,W=!0}}const X=R.element("direction-type");if(!X)return;let L=X.element("metronome");if(L){const H=L.element("beat-unit"),ne=L.element("beat-unit-dot")!==void 0,ie=L.element("per-minute");if(H!==void 0&&ie){L.hasAttributes&&L.attribute("default-x")!==void 0&&(this.directionTimestamp=s.Fraction.createFromFraction(U));const be=parseFloat(ie.value);this.createNewTempoExpressionIfNeeded(V);const ae=new p.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,be,this.currentMultiTempoExpression,!0);ae.parentMeasure=V,this.soundTempo=be,V.TempoInBPM=this.soundTempo*(ne?1.5:1),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,ae.dotted=ne,ae.beatUnit=H.value,this.currentMultiTempoExpression.addExpression(ae,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(L=X.element("dynamics"),L){const H=R.element("notations")!==void 0;this.interpretInstantaneousDynamics(L,V,U,H)}else if(L=X.element("words"),L)if(k){this.createNewTempoExpressionIfNeeded(V),this.currentMultiTempoExpression.CombinedExpressionsText=L.value;const H=new p.InstantaneousTempoExpression(L.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(H,"")}else W||this.interpretWords(L,V,U);else L=X.element("wedge"),L?this.interpretWedge(L,V,K,V.MeasureNumber):(L=X.element("rehearsal"),L&&this.interpretRehearsalMark(L,V,U,V.MeasureNumber))}closeOpenExpressions(R,V){for(const U of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(R,U.NumberXml,V),this.closeOpenContinuousDynamic(U,R,V);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(s.Fraction.plus(R.AbsoluteTimestamp,V))}addOctaveShift(R,V,U){var K;let k=1;const W=R.element("staff");if(W)try{k=parseInt(W.value,10)}catch(X){const L=_.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number. Set to default");this.musicSheet.SheetErrors.pushMeasureError(L),k=1,E.default.debug("ExpressionReader.addOctaveShift",L,X)}const G=R.element("direction-type");if(G){const X=G.element("octave-shift"),L=this.readPlacement(R);if(X!==void 0&&X.hasAttributes)try{const H=this.readNumber(X);if(X.attribute("size")){const ne=parseInt(X.attribute("size").value,10);let ie=0;ne===8?ie=1:ne===15&&(ie=2);let be=(K=X.attribute("type"))===null||K===void 0?void 0:K.value;if(be||(L===T.PlacementEnum.Above?be="down":L===T.PlacementEnum.Below&&(be="up")),be==="up"||be==="down"){const ae=new d.OctaveShift(be,ie);ae.StaffNumber=k,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(V,H),this.getMultiExpression.OctaveShiftStart=ae,ae.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=ae}else be==="stop"?this.openOctaveShift&&(this.getMultiExpression=this.createNewMultiExpressionIfNeeded(V,this.openOctaveShift.numberXml,U),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0):be||E.default.debug("octave-shift missing type in xml")}}catch(H){const ne=_.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(ne),E.default.debug("ExpressionReader.addOctaveShift",ne,H)}}}addPedalMarking(R,V,U){var K,k,W;const G=R.element("direction-type");if(G){const X=G.element("pedal");if(X!==void 0&&X.hasAttributes){let L=!1,H=!1;try{switch(((K=X.attribute("line"))===null||K===void 0?void 0:K.value)==="yes"?H=!0:((k=X.attribute("line"))===null||k===void 0?void 0:k.value)==="no"?(H=!1,L=!0):((W=X.attribute("sign"))===null||W===void 0?void 0:W.value)==="yes"?L=!0:(L=!1,H=!0),X.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(V),this.createNewMultiExpressionIfNeeded(V,-1),this.openPedal=new I.Pedal(H,L),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(V,U);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(V,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(V,-1),this.openPedal=new I.Pedal(H,L),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(ne){const ie=_.ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(ie),E.default.debug("ExpressionReader.addPedalMarking",ie,ne)}}}}endOpenPedal(R,V){this.createNewMultiExpressionIfNeeded(R,-1,V),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}initialize(){this.placement=T.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(R){var V;const U=(V=R.attribute("placement"))===null||V===void 0?void 0:V.value;return U==="above"?T.PlacementEnum.Above:U==="below"?T.PlacementEnum.Below:T.PlacementEnum.NotYetDefined}readExpressionPlacement(R,V){try{const U=this.readPosition(R);U<0?this.placement=T.PlacementEnum.Below:U>0&&(this.placement=T.PlacementEnum.Above)}catch(U){E.default.debug("ExpressionReader.readExpressionParameters",V,U)}}readPosition(R){try{const V=parseInt(R.value,10);return V<0?this.placement=T.PlacementEnum.Below:V>0&&(this.placement=T.PlacementEnum.Above),V}catch(V){E.default.debug("ExpressionReader.readExpressionParameters",V)}}interpretInstantaneousDynamics(R,V,U,K){var k,W,G;if(R.hasElements){R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(U));const X=this.readNumber(R);let L=(k=R.elements()[0])===null||k===void 0?void 0:k.name;if(L==="other-dynamics"&&(L=R.elements()[0].value),L){if(!((W=V.Rules)===null||W===void 0)&&W.IgnoreRepeatedDynamics){let ne;try{ne=u.DynamicEnum[L]}catch{const be=_.ITextTranslation.translateText("ReaderErrorMessages/DynamicError","Error while reading dynamic.");return void this.musicSheet.SheetErrors.pushMeasureError(be)}if(((G=this.activeInstantaneousDynamic)===null||G===void 0?void 0:G.DynEnum)===ne)return}K?this.createNewMultiExpressionIfNeeded(V,X,s.Fraction.createFromFraction(U)):this.createNewMultiExpressionIfNeeded(V,X);const H=new u.InstantaneousDynamicExpression(L,this.soundDynamic,this.placement,this.staffNumber,V);H.InMeasureTimestamp=U.clone(),this.getMultiExpression.addExpression(H,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=H.DynEnum:this.activeInstantaneousDynamic=new u.InstantaneousDynamicExpression(L,0,T.PlacementEnum.NotYetDefined,1,V)}}}interpretWords(R,V,U){var K;const k=R.value;if(V.Rules.IgnoreBracketsWords&&(/^\(\s*\)$/.test(k)||/^\[\s*\]$/.test(k)))return;let W;const G=R.attribute("font-style");let X,L,H;G&&(X=G.value,X==="italic"&&(W=M.FontStyles.Italic));const ne=R.attribute("font-weight");ne&&(L=ne.value,L==="bold"&&(W=M.FontStyles.Bold,X==="italic"&&(W=M.FontStyles.BoldItalic)));const ie=R.attribute("color");let be;if(ie&&(H=ie.value),V.Rules.PlaceWordsInsideStafflineFromXml){const ae=(K=R.attribute("default-y"))===null||K===void 0?void 0:K.value;(ae==null?void 0:ae.length)>0&&(be=Number.parseInt(ae,10))}if(k.length>0){if(R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(U)),this.checkIfWordsNodeIsRepetitionInstruction(k))return;this.fillMultiOrTempoExpression(k,V,U,W,H,be),this.initialize()}}readNumber(R){var V;let U=1;const K=(V=R.attribute("number"))===null||V===void 0?void 0:V.value;return K&&(U=Number.parseInt(K,10)),U}interpretWedge(R,V,U,K){var k,W;R!==void 0&&R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(U));const G=this.readNumber(R),X=(W=(k=R.attribute("type"))===null||k===void 0?void 0:k.value)===null||W===void 0?void 0:W.toLowerCase();this.lastWedge&&this.lastWedge.parentMeasure.MeasureNumberXML===V.MeasureNumberXML&&this.lastWedge.StaffNumber===this.staffNumber&&this.placement===this.lastWedge.Placement&&this.WedgeYPosXml!==void 0&&this.lastWedge.YPosXml===this.WedgeYPosXml&&this.lastWedge.StartMultiExpression.Timestamp.Equals(this.directionTimestamp)&&this.lastWedge.DynamicType===c.ContDynamicEnum[X]||(X==="stop"?this.createNewMultiExpressionIfNeeded(V,G,U):this.createNewMultiExpressionIfNeeded(V,G),this.addWedge(R,V,U),this.initialize())}interpretRehearsalMark(R,V,U,K){V.rehearsalExpression=new N.RehearsalExpression(R.value,this.placement)}createNewMultiExpressionIfNeeded(R,V,U=void 0){U||(U=this.directionTimestamp);let K=this.getMultiExpression;return(!K||K&&(K.SourceMeasureParent!==R||K.numberXml!==V||K.SourceMeasureParent===R&&K.Timestamp!==U))&&(this.getMultiExpression=K=new x.MultiExpression(R,s.Fraction.createFromFraction(U)),R.StaffLinkedExpressions[this.globalStaffIndex].push(K)),K}createNewTempoExpressionIfNeeded(R){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===R&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new m.MultiTempoExpression(R,s.Fraction.createFromFraction(this.directionTimestamp)),R.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(R,V,U){if(R!==void 0&&R.hasAttributes){const K=this.readNumber(R),k=R.attribute("type").value.toLowerCase();try{if(k==="crescendo"||k==="diminuendo"){const W=new c.ContinuousDynamicExpression(c.ContDynamicEnum[k],this.placement,this.staffNumber,V,K);this.lastWedge=W,this.lastWedge.YPosXml=this.WedgeYPosXml,this.openContinuousDynamicExpressions.push(W);let G=this.getMultiExpression;G||(G=this.createNewMultiExpressionIfNeeded(V,K)),G.StartingContinuousDynamic=W,W.StartMultiExpression=G,this.activeInstantaneousDynamic!==void 0&&this.activeInstantaneousDynamic.StaffNumber===W.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if(k==="stop")for(const W of this.openContinuousDynamicExpressions)W.NumberXml===K&&this.closeOpenContinuousDynamic(W,V,U)}catch(W){const G="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(G),E.default.debug("ExpressionReader.addWedge",G,W)}}}fillMultiOrTempoExpression(R,V,U,K,k,W=void 0){if(!R)return;const G=R.trim();this.createExpressionFromString("",G,V,U,R,K,k,W)}createExpressionFromString(R,V,U,K,k,W,G,X=void 0){if(p.InstantaneousTempoExpression.isInputStringInstantaneousTempo(V)||o.ContinuousTempoExpression.isInputStringContinuousTempo(V)){if(U.TempoExpressions.length>0)for(let ie=0,be=U.TempoExpressions.length;ie0)for(let ie=0,be=U.TempoExpressions.length;ie0&&!this.hasDigit(V)&&this.globalStaffIndex>0){if(ae.EntriesList[0].label.indexOf(V)>=0)return!1;break}}let H=P.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(H=P.TextAlignmentEnum.LeftBottom);const ne=new S.UnknownExpression(V,this.placement,H,this.staffNumber);return ne.fontStyle=W,ne.ColorXML=G,ne.defaultYXml=X,L.addExpression(ne,R),!1}closeOpenContinuousDynamic(R,V,U){if(!R)return;const K=R.NumberXml;R.EndMultiExpression=this.createNewMultiExpressionIfNeeded(V,K,U),R.StartMultiExpression.EndingContinuousDynamic=R,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(k=>k!==R)}closeOpenContinuousTempo(R){this.openContinuousTempoExpression.AbsoluteEndTimestamp=R,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(R){return(R=R.trim().toLowerCase())==="coda"||R==="tocoda"||R==="to coda"||R==="fine"||R==="d.c."||R==="dacapo"||R==="da capo"||R==="d.s."||R==="dalsegno"||R==="dal segno"||R==="d.c. al fine"||R==="d.s. al fine"||R==="d.c. al coda"||R==="d.s. al coda"}hasDigit(R){return/\d/.test(R)}}},2535:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LyricsReader=void 0;const h=r(2672),s=r(7274),m=r(6331);a.LyricsReader=class{constructor(c){this.openLyricWords={},this.musicSheet=c}addLyricEntry(c,o){var u,d;if(c){const x=c;for(let p=0,v=x.length;p0)for(let K=U;K{Object.defineProperty(a,"__esModule",{value:!0}),a.RepetitionCalculator=void 0;const h=r(6189),s=r(6189),m=r(1703);a.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[]}calculateRepetitions(c,o){this.musicSheet=c,this.repetitionInstructions=o;const u=this.musicSheet.SourceMeasures;for(let d=0,x=this.repetitionInstructions.length;d1&&p.FirstRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare),p.LastRepetitionInstructions.length>1&&p.LastRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(c){if(!this.currentMeasure)return!1;switch(c.type){case h.RepetitionInstructionEnum.StartLine:this.currentMeasure.FirstRepetitionInstructions.push(c);break;case h.RepetitionInstructionEnum.BackJumpLine:this.currentMeasure.LastRepetitionInstructions.push(c);break;case h.RepetitionInstructionEnum.Ending:if(c.alignment===h.AlignmentType.Begin)this.currentMeasure.FirstRepetitionInstructions.push(c);else for(let o=0,u=c.endingIndices.length;o{Object.defineProperty(a,"__esModule",{value:!0}),a.RepetitionInstructionReader=void 0;const h=r(6189),s=r(6189),m=r(1211);a.RepetitionInstructionReader=class{set MusicSheet(c){this.musicSheet=c,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(c,o){this.currentMeasureIndex=o}handleLineRepetitionInstructions(c){var o;let u=!1;if(c.elements().length>0){let d="",x=!1,p="",v="",S="";const T=[],P=c.element("bar-style");P&&(S=P.value),d=c.attributes().length>0&&c.attribute("location")?c.attribute("location").value:"right";const _=c.elements();for(let E=0,M=_.length;E0)if(d==="left"){if(v==="start"){const E=new h.RepetitionInstruction(this.currentMeasureIndex,h.RepetitionInstructionEnum.Ending,h.AlignmentType.Begin,void 0,T);this.addInstruction(this.repetitionInstructions,E)}if(p==="forward"){const E=new h.RepetitionInstruction(this.currentMeasureIndex,h.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,E)}}else{if(v==="stop"){const E=new h.RepetitionInstruction(this.currentMeasureIndex,h.RepetitionInstructionEnum.Ending,h.AlignmentType.End,void 0,T);this.addInstruction(this.repetitionInstructions,E)}if(p==="backward"){const E=new h.RepetitionInstruction(this.currentMeasureIndex,h.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,E)}}}return u}handleRepetitionInstructionsFromWordsOrSymbols(c,o){const u=c.element("words"),d=this.currentMeasureIndex;if(u){const x="d\\s?\\.s\\.",p=u.value.trim().toLowerCase();if(m.StringUtil.StringContainsSeparatedWord(p,x+" al fine",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,S),!0}const v="d\\.\\s?c\\.";if(m.StringUtil.StringContainsSeparatedWord(p,v+" al coda",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,v+" al fine",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,v+" al coda",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,v)||m.StringUtil.StringContainsSeparatedWord(p,"da\\s?capo",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,x,!0)||m.StringUtil.StringContainsSeparatedWord(p,"dal\\s?segno",!0)){let S;return S=m.StringUtil.StringContainsSeparatedWord(p,"al\\s?coda",!0)?new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DalSegnoAlCoda):new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,"to\\s?coda",!0)||m.StringUtil.StringContainsSeparatedWord(p,"a (la )?coda",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,"fine",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,"coda",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,S),!0}if(m.StringUtil.StringContainsSeparatedWord(p,"segno",!0)){const S=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,S),!0}}else{if(c.element("segno")){const x=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,x),!0}if(c.element("coda")){const x=new h.RepetitionInstruction(d,h.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,x),!0}}return!1}removeRedundantInstructions(){let c=0,o=0,u=0,d=0;for(let x=0;x0&&this.findInstructionInPreviousMeasure(x,p.measureIndex,h.RepetitionInstructionEnum.ToCoda)&&(p.type=h.RepetitionInstructionEnum.None);break;case h.RepetitionInstructionEnum.Segno:if(c-d>0){let v=!1;for(let S=0,T=this.repetitionInstructions.length;S0?h.RepetitionInstructionEnum.DalSegnoAlCoda:h.RepetitionInstructionEnum.DalSegno,p.type=h.RepetitionInstructionEnum.None,v=!0;break;case h.RepetitionInstructionEnum.DalSegno:case h.RepetitionInstructionEnum.DalSegnoAlFine:case h.RepetitionInstructionEnum.DalSegnoAlCoda:p.type=h.RepetitionInstructionEnum.None,v=!0}if(v)break}if(v)break;p.type=u-o>0?h.RepetitionInstructionEnum.DalSegnoAlCoda:h.RepetitionInstructionEnum.DalSegno,p.alignment=h.AlignmentType.End,p.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(x,p)||p.type===h.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(x,1),x--;else switch(p.type){case h.RepetitionInstructionEnum.Fine:break;case h.RepetitionInstructionEnum.ToCoda:u++;break;case h.RepetitionInstructionEnum.Coda:o++;break;case h.RepetitionInstructionEnum.Segno:c++;break;case h.RepetitionInstructionEnum.DalSegnoAlFine:case h.RepetitionInstructionEnum.DalSegnoAlCoda:d++}}this.repetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(c,o,u){for(let d=c-1;d>=0;d--){const x=this.repetitionInstructions[d];if(o-x.measureIndex==1&&x.type===u)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(c,o){for(let u=c-1;u>=0;u--)if(this.repetitionInstructions[u].equals(o))return!0;return!1}addInstruction(c,o){let u=!0;for(let d=0,x=c.length;d0){const v=p.attribute("type").value;let S=1;try{p.attribute("number")&&(S=parseInt(p.attribute("number").value,10))}catch(E){m.default.debug("VoiceGenerator.addSlur number: ",E)}let T=o.PlacementEnum.NotYetDefined;const P=p.attribute("placement");P&&P.value&&(P.value==="above"?T=o.PlacementEnum.Above:P.value==="below"&&(T=o.PlacementEnum.Below));const _=p.attribute("orientation");if(_&&_.value&&(_.value==="over"?T=o.PlacementEnum.Above:_.value==="under"&&(T=o.PlacementEnum.Below)),v==="start"){let E=this.openSlurDict[S];E||(E=new s.Slur,this.openSlurDict[S]=E),E.StartNote=x,E.PlacementXml=T}else if(v==="stop"){const E=this.openSlurDict[S];if(E){const M=p.name;if(M==="slide"||M==="glissando"){const N=E.StartNote,I=new u.Glissando(N);I.AddNote(x),I.EndNote=x,x.NoteGlissando=I,delete this.openSlurDict[S]}else E.EndNote=x,x.isDuplicateSlur(E)||(x.NoteSlurs.push(E),E.StartNote.NoteSlurs.push(E)),delete this.openSlurDict[S]}}}}}catch{const v=c.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(v)}}}},1651:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(7677),a),s(r(2905),a),s(r(4671),a),s(r(2535),a),s(r(6789),a),s(r(9934),a),s(r(3755),a)},2458:function(b,a,r){var h=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(a,"__esModule",{value:!0}),a.ReaderPluginManager=void 0;const s=h(r(2043));a.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(m){this.voiceMeasureReadPlugins.push(m)}processVoiceMeasureReadPlugins(m,c,o){for(const u of this.voiceMeasureReadPlugins)try{u.measureReadCalculations(m,c,o)}catch(d){s.default.info("VoiceGenerator.addSingleNote: ",d)}}}},8109:function(b,a,r){var h=this&&this.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(a,"__esModule",{value:!0}),a.VoiceGenerator=void 0;const s=r(2947),m=r(3884),c=r(908),o=r(5253),u=r(9050),d=r(9224),x=r(4555),p=r(5544),v=r(8069),S=r(1797),T=r(6331),P=r(2535),_=r(1703),E=r(8640),M=r(8640),N=r(4447),I=h(r(2043)),R=r(8640),V=r(2337),U=r(7677),K=r(766),k=r(3029),W=r(2478),G=r(2953),X=r(3748);a.VoiceGenerator=class{constructor(L,H,ne,ie,be=void 0){this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.staff=H,this.instrument=H.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=ie,this.pluginManager=L,this.voice=be?new s.LinkedVoice(this.instrument,ne,be):new m.Voice(this.instrument,ne),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new P.LyricsReader(this.musicSheet),this.articulationReader=new U.ArticulationReader(this.musicSheet.Rules)}get openTieDict(){return this.staff.openTieDict}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(L){this.currentOctaveShift=L}createVoiceEntry(L,H,ne,ie=!1,be=!1,ae=!1){this.currentVoiceEntry=new c.VoiceEntry(L.clone(),this.voice,H,ie,be,ae),ne&&this.voice.VoiceEntries.push(this.currentVoiceEntry)}read(L,H,ne,ie,be,ae,ge,ce,ee,ye,Ee,j,te,re,O,z,Y,q,de,le,he){this.currentStaffEntry=ge,this.currentMeasure=ce;try{this.currentNote=ae?this.addRestNote(L.element("rest"),H,ie,ne,be,te,re,de):this.addSingleNote(L,H,ie,ne,be,Ee,j,te,re,O,z,Y,q,de,le),this.currentNote.DotsXml=he;const me=L.elements("lyric");this.lyricsReader!==void 0&&me&&(this.lyricsReader.addLyricEntry(me,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let _e=!1;const Me=L.element("notations");if(Me){this.articulationReader&&this.readArticulations(Me,this.currentVoiceEntry,this.currentNote);const Ue=Me.elements("slur"),Ge=Me.elements("slide"),Qe=Me.elements("glissando");this.slurReader!==void 0&&(Ue.length>0||Ge.length>0)&&!this.currentNote.ParentVoiceEntry.IsGrace&&(this.slurReader.addSlur(Ue,this.currentNote),Ge.length>0&&this.slurReader.addSlur(Ge,this.currentNote),Qe.length>0&&this.slurReader.addSlur(Qe,this.currentNote));const Re=Me.elements("tuplet");Re.length>0&&(this.openTupletNumber=this.addTuplet(L,Re),_e=!0);const We=Me.element("arpeggiate");if(We!==void 0){let Ze;if(this.currentVoiceEntry.Arpeggio)Ze=this.currentVoiceEntry.Arpeggio;else{let st=!1;for(const ft of this.currentStaffEntry.VoiceEntries)if(ft.Arpeggio){st=!0,Ze=ft.Arpeggio;break}if(!st){let ft=k.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const xt=We.attribute("direction");if(xt)switch(xt.value){case"up":ft=k.ArpeggioType.ROLL_UP;break;case"down":ft=k.ArpeggioType.ROLL_DOWN;break;default:ft=k.ArpeggioType.ARPEGGIO_DIRECTIONLESS}Ze=new k.Arpeggio(this.currentVoiceEntry,ft),this.currentVoiceEntry.Arpeggio=Ze}}Ze.addNote(this.currentNote)}const qe=Me.elements("tied");qe.length>0&&this.addTie(qe,ee,ye,p.TieTypes.SIMPLE);const Ke=Me.element("technical");if(Ke){const Ze=Ke.elements("hammer-on");Ze.length>0&&this.addTie(Ze,ee,ye,p.TieTypes.HAMMERON);const st=Ke.elements("pull-off");st.length>0&&this.addTie(st,ee,ye,p.TieTypes.PULLOFF)}}L.element("time-modification")===void 0||_e||this.handleTimeModificationNode(L)}catch(me){I.default.warn(me);const _e=T.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(_e),this.musicSheet.SheetErrors.pushMeasureError(me)}return this.currentNote}checkForStaffEntryLink(L,H,ne,ie){const be=new N.StaffEntryLink(this.currentVoiceEntry);be.LinkStaffEntries.push(ne),ne.Link=be;const ae=this.currentVoiceEntry.Timestamp.clone(),ge=ie.getVerticalContainerByTimestamp(ae);return(ne=ge.StaffEntries[L])||(ne=new u.SourceStaffEntry(ge,H),ge.StaffEntries[L]=ne),ne.VoiceEntries.push(this.currentVoiceEntry),be.LinkStaffEntries.push(ne),ne.Link=be,ne}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const L=this.openTieDict;for(const H in L)if(L.hasOwnProperty(H)){const ne=L[H];S.Fraction.plus(ne.StartNote.ParentStaffEntry.Timestamp,ne.Duration).lt(ne.StartNote.SourceMeasure.Duration)&&delete L[H]}}hasVoiceEntry(){return this.currentVoiceEntry!==void 0}readArticulations(L,H,ne){const ie=L.element("articulations");ie&&this.articulationReader.addArticulationExpression(ie,H);const be=L.element("fermata");be&&this.articulationReader.addFermata(be,H);const ae=L.element("technical");ae&&this.articulationReader.addTechnicalArticulations(ae,H,ne);const ge=L.element("ornaments");ge&&this.articulationReader.addOrnament(ge,H)}addSingleNote(L,H,ne,ie,be,ae,ge,ce,ee,ye,Ee,j,te,re,O){let z,Y,q,de,le=0,he=E.AccidentalEnum.NONE,me=M.NoteEnum.C,_e=M.NoteEnum.C,Me=0,Ue=0;const Ge=L.elements();for(let ft=0,xt=Ge.length;ft0&&this.openBeams.last().ExtendedNoteList.push(O),O}addNoteInfo(L,H,ne,ie,be,ae,ge,ce,ee){L.NoteTypeXml=H,L.PrintObject=ne,L.IsCueNote=ie,L.NormalNotes=be,L.displayStepUnpitched=ae,L.displayOctaveUnpitched=ge,L.NoteheadColorXml=ce,L.NoteheadColor=ce}createBeam(L,H){var ne;try{const ie=L.element("beam");let be;if(ie!==void 0&&ie.hasAttributes&&(be=ie.attribute("number")),be){let ae=parseInt(be.value,10);const ge=L.elements("beam"),ce=ge[0].value;ge&&(ce==="begin"?(ae===((ne=this.openBeams.last())===null||ne===void 0?void 0:ne.BeamNumber)?(this.beamNumberOffset++,ae+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new d.Beam(ae,this.beamNumberOffset))):ae+=this.beamNumberOffset);let ee=!1;if(!(ae>0&&ae<=this.openBeams.length&&this.openBeams[ae-1]))return void I.default.debug("[OSMD] invalid beamnumber");for(let ye=0,Ee=this.openBeams[ae-1].Notes.length;ye1){let be=L.element("time-modification");be&&(be=be.element("actual-notes"));const ae=H;for(let ge=0,ce=ae.length;ge1&&this.openTupletNumber--),this.tupletDict[te]=O;const Y=[];Y.push(this.currentNote),O.Notes.push(Y),O.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=O,this.openTupletNumber=te}else if(j.value==="stop"){let te=1;ee.attribute("number")&&(te=parseInt(ee.attribute("number").value,10));const re=this.tupletDict[te];if(re){const O=ee.attribute("placement");O&&(O.value==="below"?re.tupletLabelNumberPlacement=X.PlacementEnum.Below:re.tupletLabelNumberPlacement=X.PlacementEnum.Above,re.PlacementFromXml=!0);const z=[];if(z.push(this.currentNote),re.Notes.push(z),!re.PlacementFromXml){let Y=!1;for(const q of re.Notes){for(const de of q)if(!de.isRest()){de.StemDirectionXml===c.StemDirectionType.Down?re.tupletLabelNumberPlacement=X.PlacementEnum.Below:re.tupletLabelNumberPlacement=X.PlacementEnum.Above,Y=!0;break}if(Y)break}}re.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=re,delete this.tupletDict[te],Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(H[0]){const be=H[0];if(be.hasAttributes){const ae=be.attribute("type").value;let ge=1;be.attribute("number")&&(ge=parseInt(be.attribute("number").value,10));const ce=isNaN(ge),ee=this.readShowNumberNoneGiven(be),ye=be.attribute("bracket");if(ye&&ye.value==="yes"?(ie=!0,ne=!0):ye&&ye.value==="no"&&(ne=!1),ae==="start"){let Ee=0,j=L.element("time-modification");if(j&&(j=j.element("actual-notes")),j&&(Ee=parseInt(j.value,10),isNaN(Ee))){const z=T.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(z),new _.MusicSheetReadingException(z)}ce&&(this.openTupletNumber++,ge=this.openTupletNumber);let te=this.tupletDict[ge];te||(te=this.tupletDict[ge]=new v.Tuplet(Ee,ie),te.BracketedXmlValue=ne,te.ShowNumberNoneGivenInXml=ee,te.tupletLabelNumberPlacement=X.PlacementEnum.Above);const re=be.attribute("placement");re&&(re.value==="below"?te.tupletLabelNumberPlacement=X.PlacementEnum.Below:te.tupletLabelNumberPlacement=X.PlacementEnum.Above,te.PlacementFromXml=!0);const O=[];O.push(this.currentNote),te.Notes.push(O),te.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=te,this.openTupletNumber=ge}else if(ae==="stop"){ce&&(ge=this.openTupletNumber);const Ee=this.tupletDict[this.openTupletNumber];if(Ee){const j=be.attribute("placement");j&&(j.value==="below"?Ee.tupletLabelNumberPlacement=X.PlacementEnum.Below:Ee.tupletLabelNumberPlacement=X.PlacementEnum.Above,Ee.PlacementFromXml=!0);const te=[];if(te.push(this.currentNote),Ee.Notes.push(te),!Ee.PlacementFromXml){let re=!1;for(const O of Ee.Notes){for(const z of O)if(!z.isRest()){z.StemDirectionXml===c.StemDirectionType.Down?Ee.tupletLabelNumberPlacement=X.PlacementEnum.Below:Ee.tupletLabelNumberPlacement=X.PlacementEnum.Above,re=!0;break}if(re)break}}Ee.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=Ee,Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[ge]}}}}return this.openTupletNumber}readShowNumberNoneGiven(L){const H=L.attribute("show-number");return!(!(H!=null&&H.value)||H.value!=="none")}handleTimeModificationNode(L){if(this.tupletDict[this.openTupletNumber])try{const H=this.tupletDict[this.openTupletNumber],ne=V.CollectionUtil.last(H.Notes);let ie;ne[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?ie=ne:(ie=[],H.Notes.push(ie),H.Fractions.push(this.getTupletNoteDurationFromType(L))),ie.push(this.currentNote),this.currentNote.NoteTuplet=H}catch(H){const ne=T.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(ne),H}else if(this.currentVoiceEntry.Notes.length>0){const H=this.currentVoiceEntry.Notes[0];if(H.NoteTuplet){const ne=H.NoteTuplet;V.CollectionUtil.last(ne.Notes).push(this.currentNote),this.currentNote.NoteTuplet=ne}}}addTie(L,H,ne,ie){if(L){if(L.length===1){const be=L[0];if(be!==void 0&&be.attributes()){const ae=this.getTieDirection(be),ge=be.attribute("type").value;try{if(ge==="start"){const ce=this.findCurrentNoteInTieDict(this.currentNote);ce<0&&delete this.openTieDict[ce];const ee=this.getNextAvailableNumberForTie(),ye=new x.Tie(this.currentNote,ie);this.openTieDict[ee]=ye,ye.TieNumber=ee,ye.TieDirection=ae}else if(ge==="stop"){const ce=this.findCurrentNoteInTieDict(this.currentNote),ee=this.openTieDict[ce];ee&&(ee.AddNote(this.currentNote),delete this.openTieDict[ce])}}catch{const ee=T.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(ee)}}}else if(L.length===2){const be=this.findCurrentNoteInTieDict(this.currentNote);if(be>=0){const ae=this.openTieDict[be];ae.AddNote(this.currentNote);for(const ge of L)if(ge.attribute("type").value==="start"){const ce=this.getTieDirection(ge);ae.NoteIndexToTieDirection[ae.Notes.length-1]=ce}}}}}getTieDirection(L){let H=X.PlacementEnum.NotYetDefined;const ne=L.attribute("placement");ne&&(ne.value==="above"?H=X.PlacementEnum.Above:ne.value==="below"&&(H=X.PlacementEnum.Below));const ie=L.attribute("orientation");return ie&&(ie.value==="over"?H=X.PlacementEnum.Above:ie.value==="under"&&(H=X.PlacementEnum.Below)),H}getNextAvailableNumberForTie(){const L=Object.keys(this.openTieDict);if(L.length===0)return 1;L.sort((H,ne)=>+H-+ne);for(let H=0;H{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.ArpeggioType=a.Arpeggio=void 0,a.Arpeggio=class{constructor(h,s=r.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=h,this.type=s,this.notes=[]}addNote(h){this.notes.push(h),h.Arpeggio=this}},function(h){h[h.BRUSH_DOWN=1]="BRUSH_DOWN",h[h.BRUSH_UP=2]="BRUSH_UP",h[h.ROLL_DOWN=3]="ROLL_DOWN",h[h.ROLL_UP=4]="ROLL_UP",h[h.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",h[h.RASQUEDO_UP=6]="RASQUEDO_UP",h[h.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"}(r=a.ArpeggioType||(a.ArpeggioType={}))},1662:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Articulation=void 0,a.Articulation=class{constructor(r,h){this.articulationEnum=r,this.placement=h}Equals(r){return r.articulationEnum===this.articulationEnum&&r.placement===this.placement}}},9224:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.BeamEnum=a.Beam=void 0,a.Beam=class{constructor(h=1,s=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.AutoGenerated=!1,this.BeamNumber=h,this.BeamNumberOffsetToXML=s}get Notes(){return this.notes}set Notes(h){this.notes=h}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(h){this.extendedNoteList=h}addNoteToBeam(h){h&&(h.NoteBeam=this,this.notes.push(h),this.extendedNoteList.push(h))}},(r=a.BeamEnum||(a.BeamEnum={}))[r.BeamNone=-1]="BeamNone",r[r.BeamBegin=0]="BeamBegin",r[r.BeamContinue=1]="BeamContinue",r[r.BeamEnd=2]="BeamEnd",r[r.BeamForward=3]="BeamForward",r[r.BeamBackward=4]="BeamBackward"},4123:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ChordSymbolEnum=a.ChordDegreeText=a.CustomChord=a.Degree=a.ChordSymbolContainer=void 0;const h=r(8640),s=r(4040),m=r(8640);a.ChordSymbolContainer=class{constructor(d,x,p,v,S){this.rootPitch=d,this.chordKind=x,this.bassPitch=p,this.degrees=v,this.rules=S}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(d,x,p){let v=d.RootPitch;if(s.MusicSheetCalculator.transposeCalculator&&(v=s.MusicSheetCalculator.transposeCalculator.transposePitch(d.RootPitch,p,x)),d.ChordKind===u.none)return d.getTextFromChordKindEnum(d.ChordKind);let S=h.Pitch.getNoteEnumString(v.FundamentalNote);v.Accidental!==m.AccidentalEnum.NONE&&(S+=d.getTextForAccidental(v.Accidental));const T={adds:[],alts:[],subs:[]};for(const M of d.ChordDegrees)if(M){let N="";switch(M.alteration!==m.AccidentalEnum.NONE&&(N+=d.getTextForAccidental(M.alteration)),N+=M.value,M.text){case o.add:T.adds.push(N);break;case o.alter:T.alts.push(N);break;case o.subtract:T.subs.push(N)}}let P=d.getTextFromChordKindEnum(d.ChordKind);const _=["adds","alts","subs"],E=d.rules.CustomChords;for(const M of E){if(M.chordKind!==d.chordKind)continue;let N=!0;for(const I of _){for(const R of M.degrees[I]||[])if(T[I].indexOf(R)<0){N=!1;break}if(!N)break}if(N){for(const I of _)for(const R of M.degrees[I]||[])T[I].splice(T[I].indexOf(R),1);P=M.alternateName}}if(S+=P,T.adds.length>0&&(S+="("+T.adds.join(",")+")"),T.alts.length>0&&(S+="(alt "+T.alts.join(",")+")"),T.subs.length>0&&(S+="(omit "+T.subs.join(",")+")"),d.BassPitch){let M=d.BassPitch;s.MusicSheetCalculator.transposeCalculator&&(M=s.MusicSheetCalculator.transposeCalculator.transposePitch(d.BassPitch,p,x)),S+="/",S+=h.Pitch.getNoteEnumString(M.FundamentalNote),S+=d.getTextForAccidental(M.Accidental)}return S}getTextForAccidental(d){const x=this.rules.ChordAccidentalTexts.getValue(d);return x!==void 0?x:""}getTextFromChordKindEnum(d){var x;return(x=this.rules.ChordSymbolLabelTexts.getValue(d))!==null&&x!==void 0?x:""}},a.Degree=class{constructor(d,x,p){this.value=d,this.alteration=x,this.text=p}};class c{constructor(x,p,v){this.alternateName=x,this.chordKind=p,this.degrees=v}static createCustomChord(x,p,v){return new c(x,p,v)}static renameCustomChord(x,p,v){for(const S of v)S.alternateName===x&&(S.alternateName=p)}}var o,u;a.CustomChord=c,function(d){d[d.add=0]="add",d[d.alter=1]="alter",d[d.subtract=2]="subtract"}(o=a.ChordDegreeText||(a.ChordDegreeText={})),function(d){d[d.major=0]="major",d[d.minor=1]="minor",d[d.augmented=2]="augmented",d[d.diminished=3]="diminished",d[d.dominant=4]="dominant",d[d.majorseventh=5]="majorseventh",d[d.minorseventh=6]="minorseventh",d[d.diminishedseventh=7]="diminishedseventh",d[d.augmentedseventh=8]="augmentedseventh",d[d.halfdiminished=9]="halfdiminished",d[d.majorminor=10]="majorminor",d[d.majorsixth=11]="majorsixth",d[d.minorsixth=12]="minorsixth",d[d.dominantninth=13]="dominantninth",d[d.majorninth=14]="majorninth",d[d.minorninth=15]="minorninth",d[d.dominant11th=16]="dominant11th",d[d.major11th=17]="major11th",d[d.minor11th=18]="minor11th",d[d.dominant13th=19]="dominant13th",d[d.major13th=20]="major13th",d[d.minor13th=21]="minor13th",d[d.suspendedsecond=22]="suspendedsecond",d[d.suspendedfourth=23]="suspendedfourth",d[d.Neapolitan=24]="Neapolitan",d[d.Italian=25]="Italian",d[d.French=26]="French",d[d.German=27]="German",d[d.pedal=28]="pedal",d[d.power=29]="power",d[d.Tristan=30]="Tristan",d[d.none=31]="none"}(u=a.ChordSymbolEnum||(a.ChordSymbolEnum={}))},3748:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.PlacementEnum=a.AbstractExpression=void 0,a.AbstractExpression=class{constructor(h){this.placement=h}static isStringInStringList(h,s){for(let m=0,c=h.length;m{Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractTempoExpression=void 0;const h=r(3748);class s extends h.AbstractExpression{constructor(c,o,u,d){super(o),this.label=c,this.staffNumber=u,this.parentMultiTempoExpression=d}get Label(){return this.label}set Label(c){this.label=c}get Placement(){return this.placement}set Placement(c){this.placement=c}get StaffNumber(){return this.staffNumber}set StaffNumber(c){this.staffNumber=c}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(c,o){for(const u of c)if(s.stringContainsSeparatedWord(o.toLowerCase().trim(),u.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(c,o){return c===o||c.indexOf(" "+o)!==-1||c.indexOf(o+" ")!==-1}}a.AbstractTempoExpression=s},7839:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ContDynamicEnum=a.ContinuousDynamicExpression=void 0;const h=r(3748),s=r(1797);class m extends h.AbstractExpression{constructor(u,d,x,p,v,S=""){super(d),super.parentMeasure=p,this.NumberXml=v,this.dynamicType=u,this.label=S,this.staffNumber=x,this.startVolume=-1,this.endVolume=-1,S!==""&&this.setType()}get DynamicType(){return this.dynamicType}set DynamicType(u){this.dynamicType=u}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(u){this.startMultiExpression=u}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(u){this.endMultiExpression=u}get Placement(){return this.placement}set Placement(u){this.placement=u}get StartVolume(){return this.startVolume}set StartVolume(u){this.startVolume=u}get EndVolume(){return this.endVolume}set EndVolume(u){this.endVolume=u}get StaffNumber(){return this.staffNumber}set StaffNumber(u){this.staffNumber=u}get Label(){return this.label}set Label(u){this.label=u,this.setType()}static isInputStringContinuousDynamic(u){return!!u&&(m.isStringInStringList(m.listContinuousDynamicIncreasing,u)||m.isStringInStringList(m.listContinuousDynamicDecreasing,u))}getInterpolatedDynamic(u){const d=this.StartMultiExpression.AbsoluteTimestamp;let x;if(x=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:s.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),u.lt(d))return-1;if(x.lt(u))return-2;const p=s.Fraction.minus(u,d).RealValue/s.Fraction.minus(x,d).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*p))}isWedge(){return!this.label}setType(){m.isStringInStringList(m.listContinuousDynamicIncreasing,this.label)?this.dynamicType=c.crescendo:m.isStringInStringList(m.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=c.diminuendo)}}var c;a.ContinuousDynamicExpression=m,m.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],m.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],function(o){o[o.crescendo=0]="crescendo",o[o.diminuendo=1]="diminuendo"}(c=a.ContDynamicEnum||(a.ContDynamicEnum={}))},280:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ContinuousTempoType=a.ContinuousTempoExpression=void 0;const h=r(1797),s=r(9775);class m extends s.AbstractTempoExpression{constructor(u,d,x,p){super(u,d,x,p),this.setTempoType()}static isInputStringContinuousTempo(u){return!!u&&(m.isStringInStringList(m.listContinuousTempoFaster,u)||m.isStringInStringList(m.listContinuousTempoSlower,u))}static isIncreasingTempo(u){return u<=c.piuMosso}static isDecreasingTempo(u){return u>=c.allargando&&u<=c.ritenuto}get TempoType(){return this.tempoType}set TempoType(u){this.tempoType=u}get StartTempo(){return this.startTempo}set StartTempo(u){this.startTempo=u}get EndTempo(){return this.endTempo}set EndTempo(u){this.endTempo=u}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(u){this.absoluteEndTimestamp=u}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(u){const d=h.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(u.lt(d))return-1;if(this.absoluteEndTimestamp.lt(u))return-2;const x=h.Fraction.minus(u,d).RealValue/h.Fraction.minus(this.absoluteEndTimestamp,d).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*x))}setTempoType(){m.isStringInStringList(m.listContinuousTempoFaster,this.label)?this.tempoType=c.accelerando:m.isStringInStringList(m.listContinuousTempoSlower,this.label)&&(this.tempoType=c.ritardando)}}var c;a.ContinuousTempoExpression=m,m.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],m.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],function(o){o[o.accelerando=0]="accelerando",o[o.stretto=1]="stretto",o[o.stringendo=2]="stringendo",o[o.mosso=3]="mosso",o[o.piuMosso=4]="piuMosso",o[o.allargando=5]="allargando",o[o.calando=6]="calando",o[o.menoMosso=7]="menoMosso",o[o.rallentando=8]="rallentando",o[o.ritardando=9]="ritardando",o[o.ritard=10]="ritard",o[o.rit=11]="rit",o[o.ritenuto=12]="ritenuto",o[o.rubato=13]="rubato",o[o.precipitando=14]="precipitando"}(c=a.ContinuousTempoType||(a.ContinuousTempoType={}))},5853:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OctaveEnum=a.OctaveShift=void 0;const h=r(8640);var s;a.OctaveShift=class{constructor(m,c){this.numberXml=1,this.setOctaveShiftValue(m,c)}get Type(){return this.octaveValue}set Type(m){this.octaveValue=m}get StaffNumber(){return this.staffNumber}set StaffNumber(m){this.staffNumber=m}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(m){this.startMultiExpression=m}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(m){this.endMultiExpression=m}setOctaveShiftValue(m,c){this.octaveValue=c===1&&m==="down"?s.VA8:c===1&&m==="up"?s.VB8:c===2&&m==="down"?s.MA15:c===2&&m==="up"?s.MB15:s.NONE}static getPitchFromOctaveShift(m,c){if(!m)return;let o=m.Octave;switch(c){case s.VA8:o-=1;break;case s.VB8:o+=1;break;case s.MA15:o-=2;break;case s.MB15:o+=2;break;case s.NONE:default:o+=0}return new h.Pitch(m.FundamentalNote,o,m.Accidental)}},function(m){m[m.VA8=0]="VA8",m[m.VB8=1]="VB8",m[m.MA15=2]="MA15",m[m.MB15=3]="MB15",m[m.NONE=4]="NONE"}(s=a.OctaveEnum||(a.OctaveEnum={}))},308:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Pedal=void 0,a.Pedal=class{constructor(r=!1,h=!0){this.ChangeEnd=!1,this.ChangeBegin=!1,this.EndsStave=!1,this.BeginsStave=!1,this.line=r,this.sign=h}get IsLine(){return this.line}get IsSign(){return this.sign}}},1928:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Slur=void 0;const h=r(1797);a.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(s){this.startNote=s}get EndNote(){return this.endNote}set EndNote(s){this.endNote=s}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let s=0,m=this.startNote.NoteSlurs.length;s{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.DynamicExpressionSymbolEnum=void 0,(r=a.DynamicExpressionSymbolEnum||(a.DynamicExpressionSymbolEnum={}))[r.p=0]="p",r[r.f=1]="f",r[r.s=2]="s",r[r.z=3]="z",r[r.m=4]="m",r[r.r=5]="r"},9793:function(b,a,r){var h=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0}),a.DynamicEnum=a.InstantaneousDynamicExpression=void 0;const s=r(3748),m=r(4802),c=r(1703),o=h(r(2043)),u=r(1649);class d extends s.AbstractExpression{constructor(v,S,T,P,_){super(T),super.parentMeasure=_,this.dynamicEnum=x[v.toLowerCase()],this.soundDynamic=S,this.staffNumber=P}static staticConstructor(){d.dynamicToRelativeVolumeDict.setValue(x.ffffff,1),d.dynamicToRelativeVolumeDict.setValue(x.fffff,.9921259842519685),d.dynamicToRelativeVolumeDict.setValue(x.ffff,.984251968503937),d.dynamicToRelativeVolumeDict.setValue(x.fff,.9763779527559056),d.dynamicToRelativeVolumeDict.setValue(x.ff,.9606299212598425),d.dynamicToRelativeVolumeDict.setValue(x.f,.8503937007874016),d.dynamicToRelativeVolumeDict.setValue(x.mf,.5984251968503937),d.dynamicToRelativeVolumeDict.setValue(x.sf,.5),d.dynamicToRelativeVolumeDict.setValue(x.sfp,.5),d.dynamicToRelativeVolumeDict.setValue(x.sfpp,.5),d.dynamicToRelativeVolumeDict.setValue(x.fp,.5),d.dynamicToRelativeVolumeDict.setValue(x.rf,.5),d.dynamicToRelativeVolumeDict.setValue(x.rfz,.5),d.dynamicToRelativeVolumeDict.setValue(x.sfz,.5),d.dynamicToRelativeVolumeDict.setValue(x.sffz,.5),d.dynamicToRelativeVolumeDict.setValue(x.fz,.5),d.dynamicToRelativeVolumeDict.setValue(x.mp,.47244094488188976),d.dynamicToRelativeVolumeDict.setValue(x.p,.2204724409448819),d.dynamicToRelativeVolumeDict.setValue(x.pp,.09448818897637795),d.dynamicToRelativeVolumeDict.setValue(x.ppp,.07874015748031496),d.dynamicToRelativeVolumeDict.setValue(x.pppp,.05511811023622047),d.dynamicToRelativeVolumeDict.setValue(x.ppppp,.03937007874015748),d.dynamicToRelativeVolumeDict.setValue(x.pppppp,.031496062992125984)}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(v){this.multiExpression=v}get DynEnum(){return this.dynamicEnum}set DynEnum(v){this.dynamicEnum=v}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(v){this.soundDynamic=v}get Placement(){return this.placement}set Placement(v){this.placement=v}get StaffNumber(){return this.staffNumber}set StaffNumber(v){this.staffNumber=v}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return d.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(v){return!!v&&d.isStringInStringList(d.listInstantaneousDynamics,v)}getDynamicExpressionSymbol(v){switch(v){case"p":return m.DynamicExpressionSymbolEnum.p;case"f":return m.DynamicExpressionSymbolEnum.f;case"s":return m.DynamicExpressionSymbolEnum.s;case"z":return m.DynamicExpressionSymbolEnum.z;case"m":return m.DynamicExpressionSymbolEnum.m;case"r":return m.DynamicExpressionSymbolEnum.r;default:throw new c.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+v)}}calculateLength(){return o.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var x;a.InstantaneousDynamicExpression=d,d.dynamicToRelativeVolumeDict=new u.Dictionary,d.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],function(p){p[p.pppppp=0]="pppppp",p[p.ppppp=1]="ppppp",p[p.pppp=2]="pppp",p[p.ppp=3]="ppp",p[p.pp=4]="pp",p[p.p=5]="p",p[p.mp=6]="mp",p[p.mf=7]="mf",p[p.f=8]="f",p[p.ff=9]="ff",p[p.fff=10]="fff",p[p.ffff=11]="ffff",p[p.fffff=12]="fffff",p[p.ffffff=13]="ffffff",p[p.sf=14]="sf",p[p.sff=15]="sff",p[p.sfp=16]="sfp",p[p.sfpp=17]="sfpp",p[p.fp=18]="fp",p[p.rf=19]="rf",p[p.rfz=20]="rfz",p[p.sfz=21]="sfz",p[p.sffz=22]="sffz",p[p.fz=23]="fz",p[p.other=24]="other"}(x=a.DynamicEnum||(a.DynamicEnum={})),d.staticConstructor()},9667:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TempoEnum=a.InstantaneousTempoExpression=void 0;const h=r(9775),s=r(1703),m=r(1797);class c extends h.AbstractTempoExpression{constructor(d,x,p,v,S,T=!1){super(d,x,p,S),this.isMetronomeMark=T,this.setTempoAndTempoType(v)}static getDefaultValueForTempoType(d){switch(d){case o.larghissimo:return 20;case o.grave:return 30;case o.lento:return 48;case o.largo:return 52;case o.larghetto:return 63;case o.adagio:return 70;case o.adagietto:return 75;case o.andanteModerato:return 88;case o.andante:return 92;case o.andantino:return 96;case o.moderato:return 106;case o.allegretto:return 112;case o.allegroModerato:return 118;case o.allegro:return 130;case o.vivace:return 140;case o.vivacissimo:return 155;case o.allegrissimo:return 170;case o.presto:return 184;case o.prestissimo:return 200;default:throw new s.ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(d){return!!d&&(c.isStringInStringList(c.listInstantaneousTempoLarghissimo,d)||c.isStringInStringList(c.listInstantaneousTempoGrave,d)||c.isStringInStringList(c.listInstantaneousTempoLento,d)||c.isStringInStringList(c.listInstantaneousTempoLargo,d)||c.isStringInStringList(c.listInstantaneousTempoLarghetto,d)||c.isStringInStringList(c.listInstantaneousTempoAdagio,d)||c.isStringInStringList(c.listInstantaneousTempoAdagietto,d)||c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAndante,d)||c.isStringInStringList(c.listInstantaneousTempoAndantino,d)||c.isStringInStringList(c.listInstantaneousTempoModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAllegretto,d)||c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAllegro,d)||c.isStringInStringList(c.listInstantaneousTempoVivace,d)||c.isStringInStringList(c.listInstantaneousTempoVivacissimo,d)||c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,d)||c.isStringInStringList(c.listInstantaneousTempoPresto,d)||c.isStringInStringList(c.listInstantaneousTempoPrestissimo,d)||c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,d))}get Label(){return this.label}set Label(d){this.label=d}get Placement(){return this.placement}set Placement(d){this.placement=d}get StaffNumber(){return this.staffNumber}set StaffNumber(d){this.staffNumber=d}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(d){this.tempoInBpm=d}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return m.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return m.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(d){return this.label?c.isStringInStringList(c.listInstantaneousTempoLarghissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.larghissimo)),this.tempoInBpm=d,void(this.tempoEnum=o.larghissimo)):c.isStringInStringList(c.listInstantaneousTempoGrave,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.grave)),this.tempoInBpm=d,void(this.tempoEnum=o.grave)):c.isStringInStringList(c.listInstantaneousTempoLento,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.lento)),this.tempoInBpm=d,void(this.tempoEnum=o.lento)):c.isStringInStringList(c.listInstantaneousTempoLargo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.largo)),this.tempoInBpm=d,void(this.tempoEnum=o.largo)):c.isStringInStringList(c.listInstantaneousTempoLarghetto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.larghetto)),this.tempoInBpm=d,void(this.tempoEnum=o.larghetto)):c.isStringInStringList(c.listInstantaneousTempoAdagio,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.adagio)),this.tempoInBpm=d,void(this.tempoEnum=o.adagio)):c.isStringInStringList(c.listInstantaneousTempoAdagietto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.adagietto)),this.tempoInBpm=d,void(this.tempoEnum=o.adagietto)):c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.andanteModerato)),this.tempoInBpm=d,void(this.tempoEnum=o.andanteModerato)):c.isStringInStringList(c.listInstantaneousTempoAndante,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.andante)),this.tempoInBpm=d,void(this.tempoEnum=o.andante)):c.isStringInStringList(c.listInstantaneousTempoAndantino,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.andantino)),this.tempoInBpm=d,void(this.tempoEnum=o.andantino)):c.isStringInStringList(c.listInstantaneousTempoModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.moderato)),this.tempoInBpm=d,void(this.tempoEnum=o.moderato)):c.isStringInStringList(c.listInstantaneousTempoAllegretto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.allegretto)),this.tempoInBpm=d,void(this.tempoEnum=o.allegretto)):c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.allegroModerato)),this.tempoInBpm=d,void(this.tempoEnum=o.allegroModerato)):c.isStringInStringList(c.listInstantaneousTempoAllegro,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.allegro)),this.tempoInBpm=d,void(this.tempoEnum=o.allegro)):c.isStringInStringList(c.listInstantaneousTempoVivace,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.vivace)),this.tempoInBpm=d,void(this.tempoEnum=o.vivace)):c.isStringInStringList(c.listInstantaneousTempoVivacissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.vivacissimo)),this.tempoInBpm=d,void(this.tempoEnum=o.vivacissimo)):c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.allegrissimo)),this.tempoInBpm=d,void(this.tempoEnum=o.allegrissimo)):c.isStringInStringList(c.listInstantaneousTempoPresto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.presto)),this.tempoInBpm=d,void(this.tempoEnum=o.presto)):c.isStringInStringList(c.listInstantaneousTempoPrestissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(o.prestissimo)),this.tempoInBpm=d,void(this.tempoEnum=o.prestissimo)):c.isStringInStringList(c.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=o.addon)):c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=o.changes)):void 0:(this.tempoInBpm=d,void(this.tempoEnum=o.metronomeMark))}}var o;a.InstantaneousTempoExpression=c,c.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],c.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],c.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],c.listInstantaneousTempoLargo=["Largo","Breit","broadly"],c.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],c.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],c.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],c.listInstantaneousTempoAndanteModerato=["Andante moderato"],c.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],c.listInstantaneousTempoAndantino=["Andantino","Maestoso"],c.listInstantaneousTempoModerato=["Moderato","Mäßig","Modéré","moderately"],c.listInstantaneousTempoAllegretto=["Allegretto","Animato","fast"],c.listInstantaneousTempoAllegroModerato=["Allegro moderato"],c.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fröhlich"],c.listInstantaneousTempoVivace=["Vivace","Allegro Assai","Lebhaft","Lebendig","lively and fast"],c.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],c.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],c.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],c.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],c.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento","rallentando","ritardando","ritard.","rit.","ritard","rall...","accelerando","accel"],c.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],function(u){u[u.none=0]="none",u[u.larghissimo=1]="larghissimo",u[u.grave=2]="grave",u[u.lento=3]="lento",u[u.largo=4]="largo",u[u.larghetto=5]="larghetto",u[u.adagio=6]="adagio",u[u.adagietto=7]="adagietto",u[u.andanteModerato=8]="andanteModerato",u[u.andante=9]="andante",u[u.andantino=10]="andantino",u[u.moderato=11]="moderato",u[u.allegretto=12]="allegretto",u[u.allegroModerato=13]="allegroModerato",u[u.allegro=14]="allegro",u[u.vivace=15]="vivace",u[u.vivacissimo=16]="vivacissimo",u[u.allegrissimo=17]="allegrissimo",u[u.presto=18]="presto",u[u.prestissimo=19]="prestissimo",u[u.lastRealTempo=20]="lastRealTempo",u[u.addon=21]="addon",u[u.changes=22]="changes",u[u.metronomeMark=23]="metronomeMark"}(o=a.TempoEnum||(a.TempoEnum={}))},7527:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MoodEnum=a.MoodExpression=void 0;const h=r(3748);class s extends h.AbstractExpression{constructor(o,u,d){super(u),this.label=o,this.staffNumber=d,this.setMoodType()}static isInputStringMood(o){return!!o&&(s.isStringInStringList(s.listMoodAffettuoso,o)||s.isStringInStringList(s.listMoodAgitato,o)||s.isStringInStringList(s.listMoodAnimato,o)||s.isStringInStringList(s.listMoodAppassionato,o)||s.isStringInStringList(s.listMoodBrillante,o)||s.isStringInStringList(s.listMoodCantabile,o)||s.isStringInStringList(s.listMoodDolce,o)||s.isStringInStringList(s.listMoodEnergico,o)||s.isStringInStringList(s.listMoodEroico,o)||s.isStringInStringList(s.listMoodEspressivo,o)||s.isStringInStringList(s.listMoodFurioso,o)||s.isStringInStringList(s.listMoodGiocoso,o)||s.isStringInStringList(s.listMoodGioioso,o)||s.isStringInStringList(s.listMoodGrandioso,o)||s.isStringInStringList(s.listMoodGrazioso,o)||s.isStringInStringList(s.listMoodLacrimoso,o)||s.isStringInStringList(s.listMoodLeggiero,o)||s.isStringInStringList(s.listMoodMaestoso,o)||s.isStringInStringList(s.listMoodMalinconico,o)||s.isStringInStringList(s.listMoodMarcato,o)||s.isStringInStringList(s.listMoodMarziale,o)||s.isStringInStringList(s.listMoodMesto,o)||s.isStringInStringList(s.listMoodMorendo,o)||s.isStringInStringList(s.listMoodNobilmente,o)||s.isStringInStringList(s.listMoodPatetico,o)||s.isStringInStringList(s.listMoodPesante,o)||s.isStringInStringList(s.listMoodSaltando,o)||s.isStringInStringList(s.listMoodSautille,o)||s.isStringInStringList(s.listMoodScherzando,o)||s.isStringInStringList(s.listMoodSostenuto,o)||s.isStringInStringList(s.listMoodSpiccato,o)||s.isStringInStringList(s.listMoodTenerezza,o)||s.isStringInStringList(s.listMoodTranquillamente,o)||s.isStringInStringList(s.listMoodTrionfante,o))}get Label(){return this.label}set Label(o){this.label=o}get Mood(){return this.moodType}set Mood(o){this.moodType=o}get StaffNumber(){return this.staffNumber}set StaffNumber(o){this.staffNumber=o}get Placement(){return this.placement}set Placement(o){this.placement=o}setMoodType(){s.isStringInStringList(s.listMoodAffettuoso,this.label)?this.moodType=m.Affettuoso:s.isStringInStringList(s.listMoodAgitato,this.label)?this.moodType=m.Agitato:s.isStringInStringList(s.listMoodAnimato,this.label)?this.moodType=m.Animato:s.isStringInStringList(s.listMoodAppassionato,this.label)?this.moodType=m.Appassionato:s.isStringInStringList(s.listMoodBrillante,this.label)?this.moodType=m.Brillante:s.isStringInStringList(s.listMoodCantabile,this.label)?this.moodType=m.Cantabile:s.isStringInStringList(s.listMoodDolce,this.label)?this.moodType=m.Dolce:s.isStringInStringList(s.listMoodEnergico,this.label)?this.moodType=m.Energico:s.isStringInStringList(s.listMoodEroico,this.label)?this.moodType=m.Eroico:s.isStringInStringList(s.listMoodEspressivo,this.label)?this.moodType=m.Espressivo:s.isStringInStringList(s.listMoodFurioso,this.label)?this.moodType=m.Furioso:s.isStringInStringList(s.listMoodGiocoso,this.label)?this.moodType=m.Giocoso:s.isStringInStringList(s.listMoodGioioso,this.label)?this.moodType=m.Gioioso:s.isStringInStringList(s.listMoodGrandioso,this.label)?this.moodType=m.Grandioso:s.isStringInStringList(s.listMoodGrazioso,this.label)?this.moodType=m.Grazioso:s.isStringInStringList(s.listMoodLacrimoso,this.label)?this.moodType=m.Lacrimoso:s.isStringInStringList(s.listMoodLeggiero,this.label)?this.moodType=m.Leggiero:s.isStringInStringList(s.listMoodMaestoso,this.label)?this.moodType=m.Maestoso:s.isStringInStringList(s.listMoodMalinconico,this.label)?this.moodType=m.Malinconico:s.isStringInStringList(s.listMoodMarcato,this.label)?this.moodType=m.Marcato:s.isStringInStringList(s.listMoodMarziale,this.label)?this.moodType=m.Marziale:s.isStringInStringList(s.listMoodMesto,this.label)?this.moodType=m.Mesto:s.isStringInStringList(s.listMoodMorendo,this.label)?this.moodType=m.Morendo:s.isStringInStringList(s.listMoodNobilmente,this.label)?this.moodType=m.Nobilmente:s.isStringInStringList(s.listMoodPatetico,this.label)?this.moodType=m.Patetico:s.isStringInStringList(s.listMoodPesante,this.label)?this.moodType=m.Pesante:s.isStringInStringList(s.listMoodSaltando,this.label)?this.moodType=m.Saltando:s.isStringInStringList(s.listMoodSautille,this.label)?this.moodType=m.Sautille:s.isStringInStringList(s.listMoodScherzando,this.label)?this.moodType=m.Scherzando:s.isStringInStringList(s.listMoodSostenuto,this.label)?this.moodType=m.Sostenuto:s.isStringInStringList(s.listMoodSpiccato,this.label)?this.moodType=m.Spiccato:s.isStringInStringList(s.listMoodTenerezza,this.label)?this.moodType=m.Tenerezza:s.isStringInStringList(s.listMoodTranquillamente,this.label)?this.moodType=m.Tranquillamente:s.isStringInStringList(s.listMoodTrionfante,this.label)&&(this.moodType=m.Trionfante)}}var m;a.MoodExpression=s,s.listMoodAffettuoso=["affettuoso"],s.listMoodAgitato=["agitato"],s.listMoodAppassionato=["appassionato"],s.listMoodAnimato=["animato","lively"],s.listMoodBrillante=["brillante"],s.listMoodCantabile=["cantabile"],s.listMoodDolce=["dolce"],s.listMoodEnergico=["energico"],s.listMoodEroico=["eroico"],s.listMoodEspressivo=["espressivo"],s.listMoodFurioso=["furioso"],s.listMoodGiocoso=["giocoso"],s.listMoodGioioso=["gioioso"],s.listMoodLacrimoso=["lacrimoso"],s.listMoodGrandioso=["grandioso"],s.listMoodGrazioso=["grazioso"],s.listMoodLeggiero=["leggiero"],s.listMoodMaestoso=["maestoso"],s.listMoodMalinconico=["malinconico"],s.listMoodMarcato=["marcato"],s.listMoodMarziale=["marziale"],s.listMoodMesto=["mesto"],s.listMoodMorendo=["morendo"],s.listMoodNobilmente=["nobilmente"],s.listMoodPatetico=["patetico"],s.listMoodPesante=["pesante"],s.listMoodSautille=["sautille"],s.listMoodSaltando=["saltando"],s.listMoodScherzando=["scherzando"],s.listMoodSostenuto=["sostenuto"],s.listMoodSpiccato=["spiccato"],s.listMoodTenerezza=["tenerezza"],s.listMoodTranquillamente=["tranquillamente"],s.listMoodTrionfante=["trionfante"],function(c){c[c.Affettuoso=0]="Affettuoso",c[c.Agitato=1]="Agitato",c[c.Appassionato=2]="Appassionato",c[c.Animato=3]="Animato",c[c.Brillante=4]="Brillante",c[c.Cantabile=5]="Cantabile",c[c.Dolce=6]="Dolce",c[c.Energico=7]="Energico",c[c.Eroico=8]="Eroico",c[c.Espressivo=9]="Espressivo",c[c.Furioso=10]="Furioso",c[c.Giocoso=11]="Giocoso",c[c.Gioioso=12]="Gioioso",c[c.Lacrimoso=13]="Lacrimoso",c[c.Grandioso=14]="Grandioso",c[c.Grazioso=15]="Grazioso",c[c.Leggiero=16]="Leggiero",c[c.Maestoso=17]="Maestoso",c[c.Malinconico=18]="Malinconico",c[c.Marcato=19]="Marcato",c[c.Marziale=20]="Marziale",c[c.Mesto=21]="Mesto",c[c.Morendo=22]="Morendo",c[c.Nobilmente=23]="Nobilmente",c[c.Patetico=24]="Patetico",c[c.Pesante=25]="Pesante",c[c.Sautille=26]="Sautille",c[c.Saltando=27]="Saltando",c[c.Scherzando=28]="Scherzando",c[c.Sostenuto=29]="Sostenuto",c[c.Spiccato=30]="Spiccato",c[c.Tenerezza=31]="Tenerezza",c[c.Tranquillamente=32]="Tranquillamente",c[c.Trionfante=33]="Trionfante",c[c.Vivace=34]="Vivace"}(m=a.MoodEnum||(a.MoodEnum={}))},6943:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MultiExpressionEntry=a.MultiExpression=void 0;const h=r(1797),s=r(9793),m=r(7839),c=r(7527),o=r(1614),u=r(3748),d=r(2562);a.MultiExpression=class{constructor(p,v){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=p,this.timestamp=v}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(p){this.sourceMeasure=p}get StaffNumber(){return this.staffNumber}set StaffNumber(p){this.staffNumber=p}get Timestamp(){return this.timestamp}set Timestamp(p){this.timestamp=p}get AbsoluteTimestamp(){return h.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(p){this.instantaneousDynamic=p}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(p){this.endingContinuousDynamic=p}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(p){this.startingContinuousDynamic=p}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(p){this.octaveShiftStart=p}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(p){this.octaveShiftEnd=p}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(p){this.combinedExpressionsText=p}getPlacementOfFirstEntry(){let p=u.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof s.InstantaneousDynamicExpression||this.expressions[0].expression instanceof m.ContinuousDynamicExpression||this.expressions[0].expression instanceof c.MoodExpression||this.expressions[0].expression instanceof o.UnknownExpression)&&(p=this.expressions[0].expression.Placement),p}getFontstyleOfFirstEntry(){var p;let v=d.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof m.ContinuousDynamicExpression||this.expressions[0].expression instanceof c.MoodExpression?v=d.FontStyles.Italic:this.expressions[0].expression instanceof o.UnknownExpression&&(v=(p=this.expressions[0].expression.fontStyle)!==null&&p!==void 0?p:d.FontStyles.Regular)),v}addExpression(p,v){p instanceof s.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=p,this.instantaneousDynamic.ParentMultiExpression=this):p instanceof m.ContinuousDynamicExpression?this.startingContinuousDynamic=p:p instanceof c.MoodExpression?this.moodList.push(p):p instanceof o.UnknownExpression&&this.unknownList.push(p),this.addExpressionToEntryList(p,v)}CompareTo(p){return this.Timestamp.RealValue>p.Timestamp.RealValue?1:this.Timestamp.RealValue{Object.defineProperty(a,"__esModule",{value:!0}),a.TempoExpressionEntry=a.MultiTempoExpression=void 0;const h=r(1797),s=r(9667),m=r(3748),c=r(2562),o=r(280);a.MultiTempoExpression=class{constructor(d,x){this.expressions=[],this.sourceMeasure=d,this.timestamp=x}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return h.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(d){this.sourceMeasure=d}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(d){this.combinedExpressionsText=d}getPlacementOfFirstEntry(){let d=m.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof s.InstantaneousTempoExpression||this.expressions[0].Expression instanceof o.ContinuousTempoExpression)&&(d=this.expressions[0].Expression.Placement),d}getFontstyleOfFirstEntry(){let d=c.FontStyles.Regular;return this.expressions[0].Expression instanceof s.InstantaneousTempoExpression?d=c.FontStyles.Bold:this.expressions[0].Expression instanceof o.ContinuousTempoExpression&&(d=c.FontStyles.Italic),d}addExpression(d,x){if(this.checkIfAlreadyExists(d))return;d instanceof s.InstantaneousTempoExpression?this.instantaneousTempo=d:d instanceof o.ContinuousTempoExpression&&(this.continuousTempo=d);const p=new u;p.prefix=x,p.Expression=d,p.label=d.Label,this.expressions.push(p)}CompareTo(d){return this.Timestamp.RealValue>d.Timestamp.RealValue?1:this.Timestamp.RealValue{Object.defineProperty(a,"__esModule",{value:!0}),a.RehearsalExpression=void 0;const h=r(3748);class s extends h.AbstractExpression{constructor(c,o){super(o),this.label=c}}a.RehearsalExpression=s},1614:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnknownExpression=void 0;const h=r(3748),s=r(1274);class m extends h.AbstractExpression{constructor(o,u,d,x){super(u),this.label=o,this.staffNumber=x,d===void 0&&(d=s.TextAlignmentEnum.LeftBottom),this.textAlignment=d}get Label(){return this.label}get Placement(){return this.placement}set Placement(o){this.placement=o}get StaffNumber(){return this.staffNumber}set StaffNumber(o){this.staffNumber=o}get TextAlignment(){return this.textAlignment}}a.UnknownExpression=m},2343:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(3748),a),s(r(9775),a),s(r(4802),a),s(r(9793),a),s(r(9667),a),s(r(7527),a),s(r(6943),a),s(r(6124),a),s(r(7513),a),s(r(1614),a)},7198:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Glissando=void 0;const h=r(1797),s=r(8911);a.Glissando=class{constructor(m){this.notes=[],this.XMLNumber=1,this.AddNote(m),this.StartNote=m,this.Direction=s.ColDirEnum.NotYetDefined}get Notes(){return this.notes}get Duration(){const m=new h.Fraction;for(const c of this.notes)m.Add(c.Length);return m}get Pitch(){return this.StartNote.Pitch}AddNote(m){this.notes.push(m),m.NoteGlissando=this,this.notes.length===2&&(this.notes[0].Pitch.getHalfTone(){Object.defineProperty(a,"__esModule",{value:!0}),a.DynamicsContainer=void 0;const h=r(7839),s=r(9793);a.DynamicsContainer=class{constructor(m,c){m instanceof h.ContinuousDynamicExpression?this.continuousDynamicExpression=m:m instanceof s.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=m),this.staffNumber=c}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}CompareTo(m){return this.parMultiExpression().AbsoluteTimestamp.CompareTo(m.parMultiExpression().AbsoluteTimestamp)}}},1877:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AbstractNotationInstruction=void 0,a.AbstractNotationInstruction=class{constructor(r){this.printObject=!0,this.parent=r}get Parent(){return this.parent}set Parent(r){this.parent=r}get PrintObject(){return this.printObject}set PrintObject(r){this.printObject=r}}},289:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.MidiInstrument=a.ClefEnum=a.ClefInstruction=void 0;const h=r(8640),s=r(1877),m=r(8640),c=r(8640),o=r(1703);class u extends s.AbstractNotationInstruction{constructor(v=d.G,S=0,T=2){super(void 0),this.clefType=d.G,this.line=2,this.octaveOffset=0,this.line=T,this.clefType=v,this.octaveOffset=S,this.calcParameters()}static getDefaultClefFromMidiInstrument(v){switch(v){case x.Acoustic_Grand_Piano:case x.Electric_Bass_finger:case x.Electric_Bass_pick:case x.Fretless_Bass:case x.Slap_Bass_1:case x.Slap_Bass_2:case x.Synth_Bass_1:case x.Synth_Bass_2:case x.Contrabass:return new u(d.F,0,4);default:return new u(d.G,0,2)}}static getAllPossibleClefs(){const v=[];for(let S=0;S<=2;S++){const T=new u(d.G,S,2);v.push(T)}for(let S=-2;S<=0;S++){const T=new u(d.F,S,4);v.push(T)}return v}static isSupportedClef(v){switch(v){case d.G:case d.F:case d.C:case d.percussion:case d.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(v){this.clefType=v}get Line(){return this.line}set Line(v){this.line=v}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(v){this.octaveOffset=v}get ClefPitch(){return this.clefPitch}set ClefPitch(v){this.clefPitch=v}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(v){this.referenceCyPosition=v}Equals(v){return this===v||!(!this||!v)&&this.clefPitch===v.clefPitch&&this.Line===v.Line}NotEqual(v){return!this.Equals(v)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case d.G:this.clefPitch=new h.Pitch(m.NoteEnum.G,1+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case d.F:this.clefPitch=new h.Pitch(m.NoteEnum.F,0+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case d.C:this.clefPitch=new h.Pitch(m.NoteEnum.C,1+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case d.percussion:this.clefPitch=new h.Pitch(m.NoteEnum.C,2,c.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case d.TAB:this.clefPitch=new h.Pitch(m.NoteEnum.G,0,c.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new o.ArgumentOutOfRangeException("clefType")}}}var d,x;a.ClefInstruction=u,function(p){p[p.G=0]="G",p[p.F=1]="F",p[p.C=2]="C",p[p.percussion=3]="percussion",p[p.TAB=4]="TAB"}(d=a.ClefEnum||(a.ClefEnum={})),function(p){p[p.None=-1]="None",p[p.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",p[p.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",p[p.Electric_Grand_Piano=2]="Electric_Grand_Piano",p[p.Honky_tonk_Piano=3]="Honky_tonk_Piano",p[p.Electric_Piano_1=4]="Electric_Piano_1",p[p.Electric_Piano_2=5]="Electric_Piano_2",p[p.Harpsichord=6]="Harpsichord",p[p.Clavinet=7]="Clavinet",p[p.Celesta=8]="Celesta",p[p.Glockenspiel=9]="Glockenspiel",p[p.Music_Box=10]="Music_Box",p[p.Vibraphone=11]="Vibraphone",p[p.Marimba=12]="Marimba",p[p.Xylophone=13]="Xylophone",p[p.Tubular_Bells=14]="Tubular_Bells",p[p.Dulcimer=15]="Dulcimer",p[p.Drawbar_Organ=16]="Drawbar_Organ",p[p.Percussive_Organ=17]="Percussive_Organ",p[p.Rock_Organ=18]="Rock_Organ",p[p.Church_Organ=19]="Church_Organ",p[p.Reed_Organ=20]="Reed_Organ",p[p.Accordion=21]="Accordion",p[p.Harmonica=22]="Harmonica",p[p.Tango_Accordion=23]="Tango_Accordion",p[p.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",p[p.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",p[p.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",p[p.Electric_Guitar_clean=27]="Electric_Guitar_clean",p[p.Electric_Guitar_muted=28]="Electric_Guitar_muted",p[p.Overdriven_Guitar=29]="Overdriven_Guitar",p[p.Distortion_Guitar=30]="Distortion_Guitar",p[p.Guitar_harmonics=31]="Guitar_harmonics",p[p.Acoustic_Bass=32]="Acoustic_Bass",p[p.Electric_Bass_finger=33]="Electric_Bass_finger",p[p.Electric_Bass_pick=34]="Electric_Bass_pick",p[p.Fretless_Bass=35]="Fretless_Bass",p[p.Slap_Bass_1=36]="Slap_Bass_1",p[p.Slap_Bass_2=37]="Slap_Bass_2",p[p.Synth_Bass_1=38]="Synth_Bass_1",p[p.Synth_Bass_2=39]="Synth_Bass_2",p[p.Violin=40]="Violin",p[p.Viola=41]="Viola",p[p.Cello=42]="Cello",p[p.Contrabass=43]="Contrabass",p[p.Tremolo_Strings=44]="Tremolo_Strings",p[p.Pizzicato_Strings=45]="Pizzicato_Strings",p[p.Orchestral_Harp=46]="Orchestral_Harp",p[p.Timpani=47]="Timpani",p[p.String_Ensemble_1=48]="String_Ensemble_1",p[p.String_Ensemble_2=49]="String_Ensemble_2",p[p.Synth_Strings_1=50]="Synth_Strings_1",p[p.Synth_Strings_2=51]="Synth_Strings_2",p[p.Choir_Aahs=52]="Choir_Aahs",p[p.Voice_Oohs=53]="Voice_Oohs",p[p.Synth_Voice=54]="Synth_Voice",p[p.Orchestra_Hit=55]="Orchestra_Hit",p[p.Trumpet=56]="Trumpet",p[p.Trombone=57]="Trombone",p[p.Tuba=58]="Tuba",p[p.Muted_Trumpet=59]="Muted_Trumpet",p[p.French_Horn=60]="French_Horn",p[p.Brass_Section=61]="Brass_Section",p[p.Synth_Brass_1=62]="Synth_Brass_1",p[p.Synth_Brass_2=63]="Synth_Brass_2",p[p.Soprano_Sax=64]="Soprano_Sax",p[p.Alto_Sax=65]="Alto_Sax",p[p.Tenor_Sax=66]="Tenor_Sax",p[p.Baritone_Sax=67]="Baritone_Sax",p[p.Oboe=68]="Oboe",p[p.English_Horn=69]="English_Horn",p[p.Bassoon=70]="Bassoon",p[p.Clarinet=71]="Clarinet",p[p.Piccolo=72]="Piccolo",p[p.Flute=73]="Flute",p[p.Recorder=74]="Recorder",p[p.Pan_Flute=75]="Pan_Flute",p[p.Blown_Bottle=76]="Blown_Bottle",p[p.Shakuhachi=77]="Shakuhachi",p[p.Whistle=78]="Whistle",p[p.Ocarina=79]="Ocarina",p[p.Lead_1_square=80]="Lead_1_square",p[p.Lead_2_sawtooth=81]="Lead_2_sawtooth",p[p.Lead_3_calliope=82]="Lead_3_calliope",p[p.Lead_4_chiff=83]="Lead_4_chiff",p[p.Lead_5_charang=84]="Lead_5_charang",p[p.Lead_6_voice=85]="Lead_6_voice",p[p.Lead_7_fifths=86]="Lead_7_fifths",p[p.Lead_8_bass_lead=87]="Lead_8_bass_lead",p[p.Pad_1_new_age=88]="Pad_1_new_age",p[p.Pad_2_warm=89]="Pad_2_warm",p[p.Pad_3_polysynth=90]="Pad_3_polysynth",p[p.Pad_4_choir=91]="Pad_4_choir",p[p.Pad_5_bowed=92]="Pad_5_bowed",p[p.Pad_6_metallic=93]="Pad_6_metallic",p[p.Pad_7_halo=94]="Pad_7_halo",p[p.Pad_8_sweep=95]="Pad_8_sweep",p[p.FX_1_rain=96]="FX_1_rain",p[p.FX_2_soundtrack=97]="FX_2_soundtrack",p[p.FX_3_crystal=98]="FX_3_crystal",p[p.FX_4_atmosphere=99]="FX_4_atmosphere",p[p.FX_5_brightness=100]="FX_5_brightness",p[p.FX_6_goblins=101]="FX_6_goblins",p[p.FX_7_echoes=102]="FX_7_echoes",p[p.FX_8_scifi=103]="FX_8_scifi",p[p.Sitar=104]="Sitar",p[p.Banjo=105]="Banjo",p[p.Shamisen=106]="Shamisen",p[p.Koto=107]="Koto",p[p.Kalimba=108]="Kalimba",p[p.Bag_pipe=109]="Bag_pipe",p[p.Fiddle=110]="Fiddle",p[p.Shanai=111]="Shanai",p[p.Tinkle_Bell=112]="Tinkle_Bell",p[p.Agogo=113]="Agogo",p[p.Steel_Drums=114]="Steel_Drums",p[p.Woodblock=115]="Woodblock",p[p.Taiko_Drum=116]="Taiko_Drum",p[p.Melodic_Tom=117]="Melodic_Tom",p[p.Synth_Drum=118]="Synth_Drum",p[p.Reverse_Cymbal=119]="Reverse_Cymbal",p[p.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",p[p.Breath_Noise=121]="Breath_Noise",p[p.Seashore=122]="Seashore",p[p.Bird_Tweet=123]="Bird_Tweet",p[p.Telephone_Ring=124]="Telephone_Ring",p[p.Helicopter=125]="Helicopter",p[p.Applause=126]="Applause",p[p.Gunshot=127]="Gunshot",p[p.Percussion=128]="Percussion"}(x=a.MidiInstrument||(a.MidiInstrument={}))},5198:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.KeyEnum=a.NoteEnumToHalfToneLink=a.KeyInstruction=void 0;const h=r(1877),s=r(8640),m=r(8640);class c extends h.AbstractNotationInstruction{constructor(d=void 0,x=0,p=o.major){super(d),this.isTransposedBy=0,this.Key=x,this.keyTypeOriginal=x,this.mode=p,this.alteratedNotes=this.calcAlteratedNotes()}static copy(d){const x=new c(d.parent,d.Key,d.Mode);return x.keyTypeOriginal=d.keyTypeOriginal,x}static getAllPossibleMajorKeyInstructions(){const d=[];for(let x=-7;x<7;x++){const p=new c(void 0,x,o.major);d.push(p)}return d}get Key(){return this.keyType}set Key(d){this.keyType=d,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(d){this.mode=d}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const d=[];if(this.keyType>0)for(let x=0;x=0}getAlterationForPitch(d){return this.keyType>0&&this.alteratedNotes.indexOf(d.FundamentalNote)<=this.keyType?m.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(d.FundamentalNote)<=Math.abs(this.keyType)?m.AccidentalEnum.FLAT:m.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(d){const x=this;return x===d||!(!x||!d)&&x.Key===d.Key&&x.Mode===d.Mode}OperatorNotEqual(d){return!this.OperatorEquals(d)}}var o;a.KeyInstruction=c,c.sharpPositionList=[s.NoteEnum.F,s.NoteEnum.C,s.NoteEnum.G,s.NoteEnum.D,s.NoteEnum.A,s.NoteEnum.E,s.NoteEnum.B],c.flatPositionList=[s.NoteEnum.B,s.NoteEnum.E,s.NoteEnum.A,s.NoteEnum.D,s.NoteEnum.G,s.NoteEnum.C,s.NoteEnum.F],a.NoteEnumToHalfToneLink=class{constructor(u,d){this.note=u,this.halfTone=d}},function(u){u[u.major=0]="major",u[u.minor=1]="minor",u[u.none=2]="none",u[u.dorian=3]="dorian",u[u.phrygian=4]="phrygian",u[u.lydian=5]="lydian",u[u.mixolydian=6]="mixolydian",u[u.aeolian=7]="aeolian",u[u.ionian=8]="ionian",u[u.locrian=9]="locrian"}(o=a.KeyEnum||(a.KeyEnum={}))},6189:(b,a)=>{var r,h;Object.defineProperty(a,"__esModule",{value:!0}),a.AlignmentType=a.RepetitionInstructionEnum=a.RepetitionInstruction=a.RepetitionInstructionComparer=void 0,a.RepetitionInstructionComparer=class{static Compare(s,m){if(s.parentRepetition!==void 0&&m.parentRepetition){if(s.alignment===h.End&&m.alignment===h.End){if(s.parentRepetition.StartIndexm.parentRepetition.StartIndex)return-1}if(s.alignment===h.Begin&&m.alignment===h.Begin){if(s.parentRepetition.EndIndexm.parentRepetition.EndIndex)return-1}}return 0}},a.RepetitionInstruction=class{constructor(s,m,c=h.End,o=void 0,u=void 0){this.endingIndices=void 0,this.measureIndex=s,u&&(this.endingIndices=u.slice()),this.type=m,this.alignment=c,this.parentRepetition=o}CompareTo(s){const m=s;if(this.measureIndex>m.measureIndex)return 1;if(this.measureIndex{Object.defineProperty(a,"__esModule",{value:!0}),a.RhythmSymbolEnum=a.RhythmInstruction=void 0;const h=r(1877);class s extends h.AbstractNotationInstruction{constructor(o,u){super(void 0),this.rhythm=o,this.numerator=o.Numerator,this.denominator=o.Denominator,this.symbolEnum=u}get Rhythm(){return this.rhythm}set Rhythm(o){this.rhythm=o}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(o){this.symbolEnum=o}clone(){return new s(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(o){const u=this;return u===o||!(!u||!o)&&u.numerator===o.numerator&&u.denominator===o.denominator}OperatorNotEqual(o){return this!==o}ToString(){return"Rhythm: "+this.rhythm.toString()}}var m;a.RhythmInstruction=s,(m=a.RhythmSymbolEnum||(a.RhythmSymbolEnum={}))[m.NONE=0]="NONE",m[m.COMMON=1]="COMMON",m[m.CUT=2]="CUT"},1357:(b,a)=>{var r;Object.defineProperty(a,"__esModule",{value:!0}),a.TechnicalInstruction=a.TechnicalInstructionType=void 0,(r=a.TechnicalInstructionType||(a.TechnicalInstructionType={}))[r.Fingering=0]="Fingering",r[r.String=1]="String",a.TechnicalInstruction=class{}},6065:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(1877),a),s(r(289),a),s(r(5198),a),s(r(6189),a),s(r(3331),a),s(r(1357),a)},2947:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkedVoice=void 0;const h=r(3884);class s extends h.Voice{constructor(c,o,u){super(c,o),this.master=u}get Master(){return this.master}}a.LinkedVoice=s},7274:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LyricsEntry=void 0;const h=r(2562);a.LyricsEntry=class{constructor(s,m,c,o,u=-1){this.text=s,this.word=c,this.parent=o,this.verseNumber=m,u>=0&&(this.syllableIndex=u)}get Text(){return this.text}set Text(s){this.text=s}get Word(){return this.word}get Parent(){return this.parent}set Parent(s){this.parent=s}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}get IsTranslation(){return this.VerseNumber.endsWith("translation")}get IsChorus(){return this.VerseNumber.startsWith("chorus")}get FontStyle(){return this.IsChorus||this.IsTranslation?h.FontStyles.Italic:h.FontStyles.Regular}}},2672:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LyricWord=void 0,a.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(r){for(let h=0,s=this.Syllables.length;h{Object.defineProperty(a,"__esModule",{value:!0}),a.Appearance=a.Note=void 0;const h=r(1797);var s;a.Note=class{constructor(m,c,o,u,d,x){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=m,this.parentStaffEntry=c,this.length=o,this.pitch=u,this.sourceMeasure=d,this.isRestFlag=x!=null&&x,this.halfTone=u?u.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}ToStringShort(m=0){var c;return!this.Pitch||this.isRest()?"rest":(c=this.Pitch)===null||c===void 0?void 0:c.ToStringShort(m)}get ToStringShortGet(){return this.ToStringShort(0)}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(m){this.voiceEntry=m}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set Length(m){this.length=m}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(m){this.typeLength=m}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(m){this.noteTypeXml=m}get NormalNotes(){return this.normalNotes}set NormalNotes(m){this.normalNotes=m}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(m){this.beam=m}set Notehead(m){this.notehead=m}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(m){this.tuplet=m}get NoteGlissando(){return this.glissando}set NoteGlissando(m){this.glissando=m}get NoteTie(){return this.tie}set NoteTie(m){this.tie=m}get NoteSlurs(){return this.slurs}set NoteSlurs(m){this.slurs=m}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(m){this.playbackInstrumentId=m}get PrintObject(){return this.printObject}set PrintObject(m){this.printObject=m}get Arpeggio(){return this.arpeggio}set Arpeggio(m){this.arpeggio=m}get IsCueNote(){return this.isCueNote}set IsCueNote(m){this.isCueNote=m}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(m){this.stemDirectionXml=m}get TremoloStrokes(){var m;return(m=this.TremoloInfo)===null||m===void 0?void 0:m.tremoloStrokes}get StemColorXml(){return this.stemColorXml}set StemColorXml(m){this.stemColorXml=m}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(m){this.noteheadColorXml=m}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(m){this.noteheadColor=m}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(m){this.noteheadColorCurrentlyRendered=m}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}isWholeMeasureNote(){return this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return h.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}isDuplicateSlur(m){for(let c=0,o=this.slurs.length;c{Object.defineProperty(a,"__esModule",{value:!0}),a.NoteTypeHandler=a.NoteType=void 0;const h=r(1797),s=r(6331),m=r(1703);var c;(function(u){u[u.UNDEFINED=0]="UNDEFINED",u[u._1024th=1]="_1024th",u[u._512th=2]="_512th",u[u._256th=3]="_256th",u[u._128th=4]="_128th",u[u._64th=5]="_64th",u[u._32nd=6]="_32nd",u[u._16th=7]="_16th",u[u.EIGTH=8]="EIGTH",u[u.QUARTER=9]="QUARTER",u[u.HALF=10]="HALF",u[u.WHOLE=11]="WHOLE",u[u.BREVE=12]="BREVE",u[u.LONG=13]="LONG",u[u.MAXIMA=14]="MAXIMA"})(c=a.NoteType||(a.NoteType={}));class o{static NoteTypeToString(d){return this.NoteTypeXmlValues[d]}static StringToNoteType(d){const x=this.NoteTypeXmlValues.indexOf(d);return x!==-1?x:c.UNDEFINED}static getNoteDurationFromType(d){switch(d){case"1024th":return new h.Fraction(1,1024);case"512th":return new h.Fraction(1,512);case"256th":return new h.Fraction(1,256);case"128th":return new h.Fraction(1,128);case"64th":return new h.Fraction(1,64);case"32th":case"32nd":return new h.Fraction(1,32);case"16th":return new h.Fraction(1,16);case"eighth":return new h.Fraction(1,8);case"quarter":return new h.Fraction(1,4);case"half":return new h.Fraction(1,2);case"whole":return new h.Fraction(1,1);case"breve":return new h.Fraction(2,1);case"long":return new h.Fraction(4,1);case"maxima":return new h.Fraction(8,1);default:{const x=s.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new m.MusicSheetReadingException(x)}}}}a.NoteTypeHandler=o,o.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},766:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.NoteHeadShape=a.Notehead=void 0;const s=h(r(2043));class m{constructor(u,d,x=void 0){this.sourceNote=u,this.setShapeFromXml(d,x)}setShapeFromXml(u,d=void 0){this.shape=m.ShapeTypeXmlToShape(u);let x=d;x===void 0&&(this.sourceNote?x=this.sourceNote.Length.Denominator>2:(s.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),x=!0)),this.filled=x}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(u){switch(u.toLowerCase()){case"normal":return c.NORMAL;case"x":return c.X;case"slash":return c.SLASH;case"diamond":return c.DIAMOND;case"square":case"la":return c.SQUARE;case"do":case"triangle":return c.TRIANGLE;case"inverted triangle":return c.TRIANGLE_INVERTED;case"rectangle":return c.RECTANGLE;case"circle-x":return c.CIRCLEX;default:return s.default.info("unsupported/unhandled xml notehead '"+u+"'. Using normal notehead."),c.NORMAL}}}var c;a.Notehead=m,function(o){o[o.CIRCLEX=0]="CIRCLEX",o[o.DIAMOND=1]="DIAMOND",o[o.NORMAL=2]="NORMAL",o[o.RECTANGLE=3]="RECTANGLE",o[o.SLASH=4]="SLASH",o[o.SQUARE=5]="SQUARE",o[o.TRIANGLE=6]="TRIANGLE",o[o.TRIANGLE_INVERTED=7]="TRIANGLE_INVERTED",o[o.X=8]="X"}(c=a.NoteHeadShape||(a.NoteHeadShape={}))},5922:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OrnamentEnum=a.OrnamentContainer=void 0;const h=r(8640),s=r(3748);var m;a.OrnamentContainer=class{constructor(c){this.placement=s.PlacementEnum.Above,this.accidentalAbove=h.AccidentalEnum.NONE,this.accidentalBelow=h.AccidentalEnum.NONE,this.ornament=c}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(c){this.accidentalAbove=c}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(c){this.accidentalBelow=c}},(m=a.OrnamentEnum||(a.OrnamentEnum={}))[m.Trill=0]="Trill",m[m.Turn=1]="Turn",m[m.InvertedTurn=2]="InvertedTurn",m[m.DelayedTurn=3]="DelayedTurn",m[m.DelayedInvertedTurn=4]="DelayedInvertedTurn",m[m.Mordent=5]="Mordent",m[m.InvertedMordent=6]="InvertedMordent"},5942:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SourceMeasure=void 0;const h=r(1797),s=r(141),m=r(9050),c=r(6189),o=r(908),u=r(289),d=r(5198),x=r(6894);a.SourceMeasure=class{constructor(p,v){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.completeNumberOfStaves=p,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=x.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(p),this.lastInstructionsStaffEntries=new Array(p),this.rules=v,this.TempoInBPM=0;for(let S=0;S1)return p[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(p){this.verticalMeasureList=p}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(p){this.tempoInBPM=p}findOrCreateStaffEntry(p,v,S){let T,P;for(const E of this.verticalSourceStaffEntryContainers)if(E.Timestamp.Equals(p)){P=E;break}if(P)return P.StaffEntries[v]?T=P.StaffEntries[v]:(T=new m.SourceStaffEntry(P,S),P.StaffEntries[v]=T),{createdNewContainer:!1,staffEntry:T};const _=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(this.verticalSourceStaffEntryContainers.length===0||_.Timestamp.lt(p)){const E=new s.VerticalSourceStaffEntryContainer(this,p.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(E),T=new m.SourceStaffEntry(E,S),E.StaffEntries[v]=T}else for(let E=this.verticalSourceStaffEntryContainers.length-1;E>=0;E--){if(this.verticalSourceStaffEntryContainers[E].Timestamp.lt(p)){const M=new s.VerticalSourceStaffEntryContainer(this,p.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(E+1,0,M),T=new m.SourceStaffEntry(M,S),M.StaffEntries[v]=T;break}if(E===0){const M=new s.VerticalSourceStaffEntryContainer(this,p.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(E,0,M),T=new m.SourceStaffEntry(M,S),M.StaffEntries[v]=T;break}}return{createdNewContainer:!0,staffEntry:T}}findOrCreateVoiceEntry(p,v){let S,T=!1;for(const P of p.VoiceEntries)if(P.ParentVoice===v){S=P;break}return S||(S=new o.VoiceEntry(p.Timestamp,v,p),T=!0),{createdVoiceEntry:T,voiceEntry:S}}getPreviousSourceStaffEntryFromIndex(p,v){for(let S=v-1;S>=0;S--)if(this.verticalSourceStaffEntryContainers[S][p])return this.verticalSourceStaffEntryContainers[S][p]}getVerticalContainerIndexByTimestamp(p){for(let v=0,S=this.VerticalSourceStaffEntryContainers.length;v=0;I--){const R=this.verticalSourceStaffEntryContainers[I][E+M];if(R!==void 0&&R.hasTie()&&_.lt(h.Fraction.plus(R.Timestamp,R.calculateMaxNoteLength()))){_=h.Fraction.plus(R.Timestamp,R.calculateMaxNoteLength());break}}}T.push(_)}for(let P=0,_=T.length;P<_;++P){const E=T[P];S.lt(E)&&(S=E)}return h.Fraction.max(S,v)}calculateInstrumentsDuration(p,v){const S=[];for(let T=0;T0)return!0}return!1}beginsWithLineRepetition(){for(let p=0,v=this.FirstRepetitionInstructions.length;p=0;T--)if(S=this.verticalSourceStaffEntryContainers[T].StaffEntries[p],S&&(!v||S.VoiceEntries.length>0))return S}canBeReducedToMultiRest(){var p,v;if(this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;let S=!0,T=!1;for(const P of this.verticalSourceStaffEntryContainers)if(P){for(const _ of P.StaffEntries)if(_&&_.ParentStaff.ParentInstrument.Visible){if(_.ChordContainers.length>0)return!1;_.ParentStaff.hasLyrics&&(T=!0);for(const E of _.VoiceEntries){for(const M of E.Notes)if(!M.isRest()){S=!1;break}if(!S)break}}}if(!S||T||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const P of this.staffLinkedExpressions)if(P.length>0)return!1;for(const P of this.lastInstructionsStaffEntries)for(let _=0,E=P==null?void 0:P.Instructions.length;_{Object.defineProperty(a,"__esModule",{value:!0}),a.SourceStaffEntry=void 0;const h=r(1797),s=r(289),m=r(5198),c=r(3331);a.SourceStaffEntry=class{constructor(o,u){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=o,this.parentStaff=u}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return h.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(o){this.voiceEntries=o}get Link(){return this.staffEntryLink}set Link(o){this.staffEntryLink=o}get Instructions(){return this.instructions}set Instructions(o){this.instructions=o}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(o){this.chordSymbolContainers=o}removeAllInstructionsOfTypeClefInstruction(){let o=0,u=0;for(;o0)return!0;return!1}hasTie(){for(let o=0,u=this.VoiceEntries.length;o{Object.defineProperty(a,"__esModule",{value:!0}),a.Staff=void 0,a.Staff=class{constructor(r,h){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.hasLyrics=!1,this.openTieDict={},this.parentInstrument=r,this.id=h,this.audible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(r){this.parentInstrument=r}get Voices(){return this.voices}get Id(){return this.id}get Volume(){return this.volume}set Volume(r){this.volume=r}get StafflineCount(){return this.stafflineCount}set StafflineCount(r){this.stafflineCount=r}}},4447:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StaffEntryLink=void 0,a.StaffEntryLink=class{constructor(r){this.linkStaffEntries=[],this.voiceEntry=r}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(r){this.linkStaffEntries=r}}},2953:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TabNote=void 0;const h=r(5253);class s extends h.Note{constructor(c,o,u,d,x,p,v,S,T){super(c,o,u,d,x),this.stringNumberTab=p,this.fretNumber=v,this.bendArray=S,this.vibratoStroke=T}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}get VibratoStroke(){return this.vibratoStroke}}a.TabNote=s},4555:function(b,a,r){var h=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(a,"__esModule",{value:!0}),a.Tie=void 0;const s=r(1797),m=r(3748),c=h(r(2043));a.Tie=class{constructor(o,u){this.notes=[],this.TieNumber=1,this.TieDirection=m.PlacementEnum.NotYetDefined,this.NoteIndexToTieDirection={},this.AddNote(o),this.type=u}getTieDirection(o){if(!o)return this.TieDirection;for(let u=0;u{Object.defineProperty(a,"__esModule",{value:!0}),a.Tuplet=void 0,a.Tuplet=class{constructor(r,h=!1){this.PlacementFromXml=!1,this.RenderTupletNumber=!0,this.notes=[],this.fractions=[],this.tupletLabelNumber=r,this.bracket=h}shouldBeBracketed(r,h,s){if(r&&this.BracketedXmlValue!==void 0)return this.BracketedXmlValue;const m=this.Notes[0][0].NoteBeam;if(!m)return!0;for(const c of this.Notes)if(c[0].NoteBeam!==m)return!0;return this.Bracket||this.TupletLabelNumber===3&&s||this.TupletLabelNumber!==3&&h}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(r){this.tupletLabelNumber=r}get Notes(){return this.notes}set Notes(r){this.notes=r}get Fractions(){return this.fractions}set Fractions(r){this.fractions=r}get Bracket(){return this.bracket}set Bracket(r){this.bracket=r}getNoteIndex(r){for(let h=this.notes.length-1;h>=0;h--)for(let s=0;s{Object.defineProperty(a,"__esModule",{value:!0}),a.VerticalSourceStaffEntryContainer=void 0;const h=r(1797);a.VerticalSourceStaffEntryContainer=class{constructor(s,m,c){this.staffEntries=[],this.comments=[],this.timestamp=m,this.staffEntries=new Array(c),this.parentMeasure=s}$get$(s){return this.staffEntries[s]}$set$(s,m){this.staffEntries[s]=m}get Timestamp(){return this.timestamp}set Timestamp(s){this.timestamp=s}get StaffEntries(){return this.staffEntries}set StaffEntries(s){this.staffEntries=s}get Comments(){return this.comments}set Comments(s){this.comments=s}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(s){this.parentMeasure=s}getAbsoluteTimestamp(){return h.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},3884:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Voice=void 0,a.Voice=class{constructor(r,h){this.voiceEntries=[],this.volume=1,this.parent=r,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=h}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(r){this.visible=r}get Audible(){return this.audible}set Audible(r){this.audible=r}get Following(){return this.following}set Following(r){this.following=r}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(r){this.volume=r}}},908:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StemDirectionType=a.ArticulationEnum=a.VoiceEntry=void 0;const h=r(1797),s=r(5253),m=r(8640),c=r(5922),o=r(8640),u=r(1649);class d{constructor(S,T,P,_=!1,E=!1,M=!1){if(this.notes=[],this.articulations=[],this.technicalInstructions=[],this.lyricsEntries=new u.Dictionary,this.wantedStemDirection=p.Undefined,this.stemDirectionXml=p.Undefined,this.stemDirection=p.Undefined,this.timestamp=S,this.parentVoice=T,this.parentSourceStaffEntry=P,this.isGrace=_,this.graceAfterMainNote=!1,this.graceNoteSlash=E,this.graceSlur=M,P!==void 0){const N=P.VoiceEntries;N.indexOf(this)===-1&&N.push(this)}}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(S){this.timestamp=S}get Notes(){return this.notes}get IsGrace(){return this.isGrace}set IsGrace(S){this.isGrace=S}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(S){this.graceAfterMainNote=S}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(S){this.graceNoteSlash=S}get GraceSlur(){return this.graceSlur}set GraceSlur(S){this.graceSlur=S}get Articulations(){return this.articulations}set Articulations(S){this.articulations=S}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(S){this.arpeggio=S}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(S){this.ornamentContainer=S}set WantedStemDirection(S){this.wantedStemDirection=S}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(S){this.stemDirectionXml=S}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(S){this.stemDirection=S}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(S){this.stemColorXml=S}get StemColor(){return this.stemColor}set StemColor(S){this.stemColor=S}hasArticulation(S){for(const T of this.articulations)if(T.Equals(S))return!0;return!1}static isSupportedArticulation(S){switch(S){case x.accent:case x.strongaccent:case x.softaccent:case x.invertedstrongaccent:case x.staccato:case x.staccatissimo:case x.spiccato:case x.tenuto:case x.fermata:case x.invertedfermata:case x.breathmark:case x.caesura:case x.lefthandpizzicato:case x.naturalharmonic:case x.snappizzicato:case x.upbow:case x.downbow:case x.bend:return!0;default:return!1}}hasTie(){for(let S=0,T=this.Notes.length;S0)return!0;return!1}isStaccato(){for(const S of this.Articulations)if(S.articulationEnum===x.staccato)return!0;return!1}isAccent(){for(const S of this.Articulations)if(S.articulationEnum===x.accent||S.articulationEnum===x.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(S){let T="1";return this.lyricsEntries.forEach((P,_)=>{S===_&&(T=P)}),T}createVoiceEntriesForOrnament(S,T){S||(S=this);const P=[];if(!S.ornamentContainer)return;const _=this.notes[0],E=_.Length,M=S.ParentVoice,N=S.Timestamp;let I=h.Fraction.createFromFraction(N);switch(S.ornamentContainer.GetOrnament){case c.OrnamentEnum.Trill:{const R=new h.Fraction(E.Numerator,8*E.Denominator),V=_.Pitch.getTransposedPitch(1);let U=T.getAlterationForPitch(V);S.OrnamentContainer.AccidentalAbove!==o.AccidentalEnum.NONE&&(U=S.ornamentContainer.AccidentalAbove);for(let K=0;K<8;K++)I=h.Fraction.plus(N,new h.Fraction(K*R.Numerator,R.Denominator)),K%2==0?this.createBaseVoiceEntry(I,R,M,_,P):this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P);break}case c.OrnamentEnum.Turn:{const R=new h.Fraction(E.Numerator,4*E.Denominator),V=_.Pitch.getTransposedPitch(-1),U=T.getAlterationForPitch(V),K=_.Pitch.getTransposedPitch(1),k=T.getAlterationForPitch(K);this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,K,k,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P);break}case c.OrnamentEnum.InvertedTurn:{const R=new h.Fraction(E.Numerator,4*E.Denominator),V=_.Pitch.getTransposedPitch(-1),U=T.getAlterationForPitch(V),K=_.Pitch.getTransposedPitch(1),k=T.getAlterationForPitch(K);this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,K,k,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P);break}case c.OrnamentEnum.DelayedTurn:{const R=new h.Fraction(E.Numerator,2*E.Denominator),V=_.Pitch.getTransposedPitch(-1),U=T.getAlterationForPitch(V),K=_.Pitch.getTransposedPitch(1),k=T.getAlterationForPitch(K);this.createBaseVoiceEntry(I,R,M,_,P),I=h.Fraction.plus(N,R),R.Denominator=8*E.Denominator,this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,K,k,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P);break}case c.OrnamentEnum.DelayedInvertedTurn:{const R=new h.Fraction(E.Numerator,2*E.Denominator),V=_.Pitch.getTransposedPitch(-1),U=T.getAlterationForPitch(V),K=_.Pitch.getTransposedPitch(1),k=T.getAlterationForPitch(K);this.createBaseVoiceEntry(I,R,M,_,P),I=h.Fraction.plus(N,R),R.Denominator=8*E.Denominator,this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,K,k,P),I.Add(R),this.createBaseVoiceEntry(I,R,M,_,P);break}case c.OrnamentEnum.Mordent:{const R=new h.Fraction(E.Numerator,4*E.Denominator),V=_.Pitch.getTransposedPitch(1),U=T.getAlterationForPitch(V);this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),R.Denominator=2*E.Denominator,I=h.Fraction.plus(N,R),this.createBaseVoiceEntry(I,R,M,_,P);break}case c.OrnamentEnum.InvertedMordent:{const R=new h.Fraction(E.Numerator,4*E.Denominator),V=_.Pitch.getTransposedPitch(-1),U=T.getAlterationForPitch(V);this.createBaseVoiceEntry(I,R,M,_,P),I.Add(R),this.createAlteratedVoiceEntry(I,R,M,_.SourceMeasure,V,U,P),R.Denominator=2*E.Denominator,I=h.Fraction.plus(N,R),this.createBaseVoiceEntry(I,R,M,_,P);break}default:throw new RangeError}return P}createBaseVoiceEntry(S,T,P,_,E){const M=new d(S,P,_.ParentStaffEntry),N=new m.Pitch(_.Pitch.FundamentalNote,_.Pitch.Octave,_.Pitch.Accidental),I=new s.Note(M,void 0,T,N,_.SourceMeasure);M.Notes.push(I),E.push(M)}createAlteratedVoiceEntry(S,T,P,_,E,M,N){const I=new d(S,P,void 0),R=new m.Pitch(E.FundamentalNote,E.Octave,M),V=new s.Note(I,void 0,T,R,_);I.Notes.push(V),N.push(I)}}var x,p;a.VoiceEntry=d,function(v){v[v.accent=0]="accent",v[v.strongaccent=1]="strongaccent",v[v.softaccent=2]="softaccent",v[v.marcatoup=3]="marcatoup",v[v.marcatodown=4]="marcatodown",v[v.invertedstrongaccent=5]="invertedstrongaccent",v[v.staccato=6]="staccato",v[v.staccatissimo=7]="staccatissimo",v[v.spiccato=8]="spiccato",v[v.tenuto=9]="tenuto",v[v.fermata=10]="fermata",v[v.invertedfermata=11]="invertedfermata",v[v.breathmark=12]="breathmark",v[v.caesura=13]="caesura",v[v.lefthandpizzicato=14]="lefthandpizzicato",v[v.naturalharmonic=15]="naturalharmonic",v[v.snappizzicato=16]="snappizzicato",v[v.upbow=17]="upbow",v[v.downbow=18]="downbow",v[v.scoop=19]="scoop",v[v.plop=20]="plop",v[v.doit=21]="doit",v[v.falloff=22]="falloff",v[v.stress=23]="stress",v[v.unstress=24]="unstress",v[v.detachedlegato=25]="detachedlegato",v[v.otherarticulation=26]="otherarticulation",v[v.bend=27]="bend"}(x=a.ArticulationEnum||(a.ArticulationEnum={})),function(v){v[v.Undefined=-1]="Undefined",v[v.Up=0]="Up",v[v.Down=1]="Down",v[v.None=2]="None",v[v.Double=3]="Double"}(p=a.StemDirectionType||(a.StemDirectionType={}))},6550:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(3029),a),s(r(9224),a),s(r(4123),a),s(r(7198),a),s(r(2947),a),s(r(5253),a),s(r(766),a),s(r(2478),a),s(r(5922),a),s(r(5942),a),s(r(9050),a),s(r(0),a),s(r(4447),a),s(r(4555),a),s(r(8069),a),s(r(141),a),s(r(3884),a),s(r(908),a),s(r(6065),a),s(r(5253),a),s(r(2478),a),s(r(5942),a),s(r(9050),a),s(r(141),a),s(r(4555),a)},4761:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(1703),a),s(r(6842),a),s(r(884),a),s(r(2255),a),s(r(7514),a),s(r(5142),a),s(r(6550),a),s(r(4990),a),s(r(4257),a),s(r(9714),a),s(r(4759),a),s(r(4143),a)},3495:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AJAX=void 0,a.AJAX=class{static ajax(r,h=9e3){let s;const m=r.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)s=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));s=new ActiveXObject("Microsoft.XMLHTTP")}return s.timeout=h,new Promise((c,o)=>{s.onreadystatechange=()=>{s.readyState===XMLHttpRequest.DONE&&(s.status===200||s.status===0&&s.responseText?c(s.responseText):o(new Error("Could not retrieve requested URL "+s.status)))},s.ontimeout=u=>{o(new Error("Server request Timeout"))},s.overrideMimeType(m),s.open("GET",r,!0),s.send()})}}},530:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Cursor=void 0;const h=r(1797);a.Cursor=class{constructor(s,m,c){this.hidden=!0,this.currentPageNumber=1,this.skipInvisibleNotes=!0,this.container=s,this.openSheetMusicDisplay=m,this.rules=this.openSheetMusicDisplay.EngravingRules,this.cursorOptions=c;let o=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)o++,this.cursorElementId=`cursorImg-${o}`;const u=document.createElement("img");u.id=this.cursorElementId,u.style.position="absolute",this.cursorOptions.follow===!0?(this.wantedZIndex="-1",u.style.zIndex=this.wantedZIndex):(this.wantedZIndex="-2",u.style.zIndex=this.wantedZIndex),this.cursorElement=u,this.container.appendChild(u)}adjustToBackgroundColor(){let s;s=this.rules.PageBackgroundColor?"1":this.wantedZIndex,this.cursorElement.style.zIndex=s}init(s,m){this.manager=s,this.graphic=m,this.reset(),this.hidden=!0,this.hide()}show(){this.hidden=!1,this.update(),this.adjustToBackgroundColor()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const s=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let m=this.rules.MinMeasureToDrawIndex;m=Math.min(m,s);let c=this.rules.MaxMeasureToDrawIndex;if(c=Math.min(c,s),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>m&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[m].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>c){const o=this.openSheetMusicDisplay.Sheet.SourceMeasures[c];this.openSheetMusicDisplay.Sheet.SelectionEnd=h.Fraction.plus(o.AbsoluteTimestamp,o.Duration)}this.iterator=this.manager.getIterator(),this.iterator.SkipInvisibleNotes=this.skipInvisibleNotes}getStaffEntryFromVoiceEntry(s){const m=s.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,c=s.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(c,m,s.ParentSourceStaffEntry)}update(){if(this.hidden||this.hidden===void 0||this.hidden===null)return;this.updateCurrentPage();const s=this.iterator;let m,c=s.CurrentVisibleVoiceEntries(),o=s.CurrentMeasureIndex,u=0,d=0,x=0;if(c.length!==0||s.FrontReached||s.EndReached||(s.moveToPrevious(),c=s.CurrentVisibleVoiceEntries(),s.moveToNext()),s.FrontReached&&c.length===0){s.moveToNext(),c=s.CurrentVisibleVoiceEntries();const P=this.findVisibleGraphicalMeasure(s.CurrentMeasureIndex);u=P.PositionAndShape.AbsolutePosition.x,m=P.ParentMusicSystem,s.moveToPrevious()}else if(s.EndReached||!s.CurrentVoiceEntries||c.length===0){s.moveToPrevious(),c=s.CurrentVisibleVoiceEntries(),o=s.CurrentMeasureIndex;const P=this.findVisibleGraphicalMeasure(s.CurrentMeasureIndex);u=P.PositionAndShape.AbsolutePosition.x+P.PositionAndShape.Size.width,m=P.ParentMusicSystem,s.moveToNext()}else if(s.CurrentMeasure.isReducedToMultiRest){const P=this.findVisibleGraphicalMeasure(s.CurrentMeasureIndex),_=P.parentSourceMeasure.multipleRestMeasures,E=s.CurrentMeasure.multipleRestMeasureNumber/(_+1),M=P.PositionAndShape.Size.width-P.beginInstructionsWidth;u=P.PositionAndShape.AbsolutePosition.x+P.beginInstructionsWidth+E*M,m=P.ParentMusicSystem}else{const P=c.map(_=>this.getStaffEntryFromVoiceEntry(_)).sort((_,E)=>{var M,N,I,R;return((N=(M=_==null?void 0:_.PositionAndShape)===null||M===void 0?void 0:M.AbsolutePosition)===null||N===void 0?void 0:N.x)<=((R=(I=E==null?void 0:E.PositionAndShape)===null||I===void 0?void 0:I.AbsolutePosition)===null||R===void 0?void 0:R.x)?-1:1})[0];P&&(u=P.PositionAndShape.AbsolutePosition.x,m=P.parentMeasure.ParentMusicSystem)}if(!m)return;d=m.PositionAndShape.AbsolutePosition.y+m.StaffLines[0].PositionAndShape.RelativePosition.y;let p=m.PositionAndShape.AbsolutePosition.y;const v=m.StaffLines[m.StaffLines.length-1];v&&(p+=v.PositionAndShape.RelativePosition.y+v.StaffHeight),x=p-d;const S=this.findVisibleGraphicalMeasure(o);if(!S)return;const T=S.PositionAndShape;if(this.updateWidthAndStyle(T,u,d,x),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const P=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:P<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}findVisibleGraphicalMeasure(s){for(let m=0;m{c.push.apply(c,o.Notes)}),c}GNotesUnderCursor(s){const m=this.VoicesUnderCursor(s),c=[];return m.forEach(o=>{c.push(...o.Notes.map(u=>this.rules.GNote(u)))}),c}updateCurrentPage(){let s=this.iterator.currentTimeStamp;s.RealValue<0&&(s=new h.Fraction(0,0));for(const m of this.graphic.MusicPages)if(m.MusicSystems.last().GetSystemsLastTimeStamp().gt(s)){const c=m.PageNumber;return c!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+c),this.container.appendChild(this.cursorElement)),this.currentPageNumber=c}return 1}get SkipInvisibleNotes(){return this.skipInvisibleNotes}set SkipInvisibleNotes(s){this.skipInvisibleNotes=s,this.iterator.SkipInvisibleNotes=s}get CursorOptions(){return this.cursorOptions}set CursorOptions(s){this.cursorOptions=s}}},41:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OSMDOptions=a.SkyBottomLineBatchCalculatorBackendType=a.BackendType=a.FillEmptyMeasuresWithWholeRests=a.AlignRestOption=a.CursorType=void 0;const h=r(7459);var s,m,c,o,u;(u=a.CursorType||(a.CursorType={}))[u.Standard=0]="Standard",u[u.ThinLeft=1]="ThinLeft",u[u.ShortThinTopLeft=2]="ShortThinTopLeft",u[u.CurrentArea=3]="CurrentArea",u[u.CurrentAreaLeft=4]="CurrentAreaLeft",(o=a.AlignRestOption||(a.AlignRestOption={}))[o.Never=0]="Never",o[o.Always=1]="Always",o[o.Auto=2]="Auto",(c=a.FillEmptyMeasuresWithWholeRests||(a.FillEmptyMeasuresWithWholeRests={}))[c.No=0]="No",c[c.YesVisible=1]="YesVisible",c[c.YesInvisible=2]="YesInvisible",function(d){d[d.SVG=0]="SVG",d[d.Canvas=1]="Canvas"}(s=a.BackendType||(a.BackendType={})),(m=a.SkyBottomLineBatchCalculatorBackendType||(a.SkyBottomLineBatchCalculatorBackendType={}))[m.Plain=0]="Plain",m[m.WebGL=1]="WebGL",a.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:h.DrawingParametersEnum.default}}static BackendTypeFromString(d){return d&&d.toLowerCase()==="canvas"?s.Canvas:s.SVG}}},9629:function(b,a,r){var h=this&&this.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};Object.defineProperty(a,"__esModule",{value:!0}),a.OpenSheetMusicDisplay=void 0;const s=r(9228),m=r(8738),c=r(1372),o=r(4324),u=r(4040),d=r(5820),x=r(9505),p=r(4028),v=r(530),S=r(7056),T=r(3495),P=h(r(2043)),_=r(7459),E=r(41),M=r(1405),N=r(3748),I=r(1649),R=r(8155),V=r(8640);class U{constructor(k,W=E.OSMDOptions.OSMDOptionsStandard()){if(this.version="1.8.6-release",this.cursorsOptions=[],this.cursors=[],this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,typeof k=="string"?this.container=document.getElementById(k):k&&"appendChild"in k&&(this.container=k),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");W.autoResize===void 0&&(W.autoResize=!0),this.backendType=E.BackendType.SVG,this.setOptions(W)}get cursor(){return this.cursors[0]}load(k,W="Untitled Score"){if(this.reset(),typeof k=="string"){const ie=k,be=this;if(ie.substr(0,4)==="PK")return P.default.debug("[OSMD] This is a zip file, unpack it first: "+ie),S.MXLHelper.MXLtoXMLstring(ie).then(ge=>be.load(ge),ge=>{throw P.default.debug(ge),new Error("OpenSheetMusicDisplay: Invalid MXL file")});if(ie.substr(0,3)==="")return P.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+ie),be.load(ie.substr(3));let ae=ie;if(/^\s/.test(ae)&&(ae=ae.trim()),ae.substr(0,6).includes("be.load(ge),ge=>{throw ge});console.error("[OSMD] osmd.load(string): Could not process string. Did not find {W.init(this.sheet.MusicPartManager,this.graphic)}),this.drawingParameters.DrawingParametersEnum===_.DrawingParametersEnum.leadsheet&&(this.graphic.LeadSheet=!0)}render(){var k;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");(k=this.drawer)===null||k===void 0||k.clear();let W=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(W=this.rules.SheetMaximumWidth),this.sheet.pageWidth=W/this.zoom/10,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,P.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(P.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(G=>{G.update()}),this.zoomUpdated=!1,this.rules.RenderCount++}createOrRefreshRenderBackend(){if(this.drawer&&this.drawer.Backends){this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container);for(const X of this.drawer.Backends)X.free();this.drawer.Backends.clear()}this.drawingParameters.Rules=this.rules,this.drawer=new d.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let k,W=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(W=10*(this.EngravingRules.PageLeftMargin+this.graphic.MusicPages[0].PositionAndShape.Size.width+this.EngravingRules.PageRightMargin)*this.zoom);const G=32767;for(const X of this.graphic.MusicPages){if(X.PageNumber>this.rules.MaxPageToDrawNumber)break;const L=this.createBackend(this.backendType,X),H=" exceeds CanvasBackend limit of 32767. Cutting off score.";L.getOSMDBackendType()===E.BackendType.Canvas&&W>G&&(P.default.warn("[OSMD] Warning: width of "+W+H),W=G),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?k=W/this.rules.PageFormat.aspectRatio:(k=X.PositionAndShape.Size.height,k+=this.rules.PageBottomMargin,L.getOSMDBackendType()===E.BackendType.Canvas&&(k+=.1),k+=X.PositionAndShape.BorderTop,this.rules.RenderTitle&&(k+=this.rules.TitleTopDistance),k*=10*this.zoom),L.getOSMDBackendType()===E.BackendType.Canvas&&k>G&&(P.default.warn("[OSMD] Warning: height of "+k+H),k=Math.min(k,G)),L.resize(W,k),L.clear(),L.getContext().setFillStyle(this.rules.DefaultColorMusic),L.getContext().setStrokeStyle(this.rules.DefaultColorMusic),this.drawer.Backends.push(L),this.graphic.drawer=this.drawer}}exportSVG(){var k;for(const W of(k=this.drawer)===null||k===void 0?void 0:k.Backends)W instanceof x.SvgVexFlowBackend&&W.export()}IsReadyToRender(){return this.graphic!==void 0}clear(){var k;(k=this.drawer)===null||k===void 0||k.clear(),this.reset()}setOptions(k){if(this.rules||(this.rules=new M.EngravingRules),this.drawingParameters||k.drawingParameters?k.drawingParameters&&(this.drawingParameters?this.drawingParameters.DrawingParametersEnum=_.DrawingParametersEnum[k.drawingParameters.toLowerCase()]:this.drawingParameters=new _.DrawingParameters(_.DrawingParametersEnum[k.drawingParameters],this.rules)):this.drawingParameters=new _.DrawingParameters(_.DrawingParametersEnum.default,this.rules),k==null)return void P.default.warn(`warning: osmd.setOptions() called without an options parameter, has no effect. -example usage: osmd.setOptions({drawCredits: false, drawPartNames: false})`);this.OnXMLRead=function(X){return X},k.onXMLRead&&(this.OnXMLRead=k.onXMLRead);let W=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(k.backend!==void 0){const X=E.OSMDOptions.BackendTypeFromString(k.backend);W=W||this.backendType!==X,this.backendType=X}this.needBackendUpdate=W,k.autoBeam!==void 0&&(this.rules.AutoBeamNotes=k.autoBeam);const G=k.autoBeamOptions;if(G&&(G.maintain_stem_directions===void 0&&(G.maintain_stem_directions=!1),this.rules.AutoBeamOptions=G,G.groups&&G.groups.length)){for(const X of G.groups)if(X.length!==2)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}k.percussionOneLineCutoff!==void 0&&(this.rules.PercussionOneLineCutoff=k.percussionOneLineCutoff),this.rules.PercussionOneLineCutoff!==0&&k.percussionForceVoicesOneLineCutoff!==void 0&&(this.rules.PercussionForceVoicesOneLineCutoff=k.percussionForceVoicesOneLineCutoff),k.alignRests!==void 0&&(this.rules.AlignRests=k.alignRests),k.coloringMode!==void 0&&this.setColoringMode(k),k.coloringEnabled!==void 0&&(this.rules.ColoringEnabled=k.coloringEnabled),k.colorStemsLikeNoteheads!==void 0&&(this.rules.ColorStemsLikeNoteheads=k.colorStemsLikeNoteheads),k.disableCursor&&(this.drawingParameters.drawCursors=!1),k.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),k.drawCredits!==void 0&&(this.drawingParameters.DrawCredits=k.drawCredits),k.drawComposer!==void 0&&(this.drawingParameters.DrawComposer=k.drawComposer),k.drawTitle!==void 0&&(this.drawingParameters.DrawTitle=k.drawTitle),k.drawSubtitle!==void 0&&(this.drawingParameters.DrawSubtitle=k.drawSubtitle),k.drawLyricist!==void 0&&(this.drawingParameters.DrawLyricist=k.drawLyricist),k.drawMetronomeMarks!==void 0&&(this.rules.MetronomeMarksDrawn=k.drawMetronomeMarks),k.drawPartNames!==void 0&&(this.drawingParameters.DrawPartNames=k.drawPartNames,k.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=k.drawPartNames)),k.drawPartAbbreviations!==void 0&&(this.rules.RenderPartAbbreviations=k.drawPartAbbreviations),k.drawFingerings===!1&&(this.rules.RenderFingerings=!1),k.drawMeasureNumbers!==void 0&&(this.rules.RenderMeasureNumbers=k.drawMeasureNumbers),k.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=k.drawMeasureNumbersOnlyAtSystemStart),k.drawLyrics!==void 0&&(this.rules.RenderLyrics=k.drawLyrics),k.drawTimeSignatures!==void 0&&(this.rules.RenderTimeSignatures=k.drawTimeSignatures),k.drawSlurs!==void 0&&(this.rules.RenderSlurs=k.drawSlurs),k.measureNumberInterval!==void 0&&(this.rules.MeasureNumberLabelOffset=k.measureNumberInterval),k.useXMLMeasureNumbers!==void 0&&(this.rules.UseXMLMeasureNumbers=k.useXMLMeasureNumbers),k.fingeringPosition!==void 0&&(this.rules.FingeringPosition=N.AbstractExpression.PlacementEnumFromString(k.fingeringPosition)),k.fingeringInsideStafflines!==void 0&&(this.rules.FingeringInsideStafflines=k.fingeringInsideStafflines),k.newSystemFromXML!==void 0&&(this.rules.NewSystemAtXMLNewSystemAttribute=k.newSystemFromXML),k.newSystemFromNewPageInXML!==void 0&&(this.rules.NewSystemAtXMLNewPageAttribute=k.newSystemFromNewPageInXML),k.newPageFromXML!==void 0&&(this.rules.NewPageAtXMLNewPageAttribute=k.newPageFromXML),k.fillEmptyMeasuresWithWholeRest!==void 0&&(this.rules.FillEmptyMeasuresWithWholeRest=k.fillEmptyMeasuresWithWholeRest),k.followCursor!==void 0&&(this.FollowCursor=k.followCursor),k.setWantedStemDirectionByXml!==void 0&&(this.rules.SetWantedStemDirectionByXml=k.setWantedStemDirectionByXml),k.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):k.darkMode===!1&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),k.defaultColorMusic&&this.rules.applyDefaultColorMusic(k.defaultColorMusic),k.defaultColorNotehead&&(this.rules.DefaultColorNotehead=k.defaultColorNotehead),k.defaultColorRest&&(this.rules.DefaultColorRest=k.defaultColorRest),k.defaultColorStem&&(this.rules.DefaultColorStem=k.defaultColorStem),k.defaultColorLabel&&(this.rules.DefaultColorLabel=k.defaultColorLabel),k.defaultColorTitle&&(this.rules.DefaultColorTitle=k.defaultColorTitle),k.defaultFontFamily&&(this.rules.DefaultFontFamily=k.defaultFontFamily),k.defaultFontStyle&&(this.rules.DefaultFontStyle=k.defaultFontStyle),k.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=k.drawUpToMeasureNumber-1),k.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=k.drawFromMeasureNumber-1),k.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=k.drawUpToPageNumber),k.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=k.drawUpToSystemNumber),k.tupletsRatioed&&(this.rules.TupletsRatioed=!0),k.tupletsBracketed&&(this.rules.TupletsBracketed=!0),k.tripletsBracketed&&(this.rules.TripletsBracketed=!0),k.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):k.autoResize===!1&&(this.autoResizeEnabled=!1),k.pageFormat!==void 0&&this.setPageFormat(k.pageFormat),k.pageBackgroundColor!==void 0&&(this.rules.PageBackgroundColor=k.pageBackgroundColor),k.renderSingleHorizontalStaffline!==void 0&&(this.rules.RenderSingleHorizontalStaffline=k.renderSingleHorizontalStaffline),k.spacingFactorSoftmax!==void 0&&(this.rules.SoftmaxFactorVexFlow=k.spacingFactorSoftmax),k.spacingBetweenTextLines!==void 0&&(this.rules.SpacingBetweenTextLines=k.spacingBetweenTextLines),k.stretchLastSystemLine!==void 0&&(this.rules.StretchLastSystemLine=k.stretchLastSystemLine),k.autoGenerateMultipleRestMeasuresFromRestMeasures!==void 0&&(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures=k.autoGenerateMultipleRestMeasuresFromRestMeasures),k.cursorsOptions!==void 0?this.cursorsOptions=k.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}],k.preferredSkyBottomLineBatchCalculatorBackend!==void 0&&(this.rules.PreferredSkyBottomLineBatchCalculatorBackend=k.preferredSkyBottomLineBatchCalculatorBackend),k.skyBottomLineBatchMinMeasures!==void 0&&(this.rules.SkyBottomLineBatchMinMeasures=k.skyBottomLineBatchMinMeasures)}setColoringMode(k){if(k.coloringMode===_.ColoringModes.XML)return void(this.rules.ColoringMode=_.ColoringModes.XML);const W=[V.NoteEnum.C,V.NoteEnum.D,V.NoteEnum.E,V.NoteEnum.F,V.NoteEnum.G,V.NoteEnum.A,V.NoteEnum.B];let G;if(k.coloringMode===_.ColoringModes.CustomColorSet){if(!k.coloringSetCustom||k.coloringSetCustom.length!==8)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter (array) with 8 strings (C to B, rest note).");for(const L of k.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(L))throw new Error(`One of the color strings in options.coloringSetCustom was not a valid HTML Hex color: -`+L);G=k.coloringSetCustom}else if(k.coloringMode===_.ColoringModes.AutoColoring){G=[];const L=Object.keys(R.AutoColorSet);for(let H=0;H{k.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1,this.rules.RenderCount=0}autoResize(){const k=this;this.handleResize(()=>{},()=>{var W;((W=this.graphic)===null||W===void 0?void 0:W.GetCalculator)instanceof m.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),k.IsReadyToRender()&&k.render()})}handleResize(k,W){let G,X;const L=this;function H(){L.AutoResizeEnabled&&(G=new Date().getTime(),X||(k(),G=new Date().getTime(),X=window.setTimeout(ne,200)))}function ne(){X=void 0,window.clearTimeout(X),new Date().getTime()-G<200?X=window.setTimeout(ne,200):W()}window.attachEvent?window.attachEvent("onresize",H):window.addEventListener("resize",H),this.resizeHandlerAttached=!0,window.setTimeout(k,0),window.setTimeout(W,1)}enableOrDisableCursors(k){var W,G,X,L;if(this.drawingParameters.drawCursors=k,k)for(let H=0;H{H.hide()})}createBackend(k,W){let G;return G=k===void 0||k===E.BackendType.SVG?new x.SvgVexFlowBackend(this.rules):new p.CanvasVexFlowBackend(this.rules),G.graphicalMusicPage=W,G.initialize(this.container,this.zoom),G}static StringToPageFormat(k){let W=M.PageFormat.UndefinedPageFormat;if(k.match("^[0-9]+x[0-9]+$")){const G=k.split("x"),X=Number.parseInt(G[0],10),L=Number.parseInt(G[1],10);X>0&&X<32768&&L>0&&L<32768&&(W=new M.PageFormat(X,L,`customPageFormat${k}`))}return k=(k=(k=k.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),U.PageFormatStandards.hasOwnProperty(k)&&(W=U.PageFormatStandards[k]),W}setPageFormat(k){const W=U.StringToPageFormat(k);this.needBackendUpdate=!W.Equals(this.rules.PageFormat),this.rules.PageFormat=W}setCustomPageFormat(k,W){if(k>0&&W>0){const G=new M.PageFormat(k,W);this.rules.PageFormat=G}}set DrawSkyLine(k){this.drawSkyLine=k,this.drawer&&(this.drawer.skyLineVisible=k)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(k){this.drawBottomLine=k,this.drawer&&(this.drawer.bottomLineVisible=k)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(k){this.setDrawBoundingBox(k,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(k,W=!1){this.drawBoundingBox=k,this.drawer&&(this.drawer.drawableBoundingBoxElement=k),W&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(k){this.autoResizeEnabled=k}get Zoom(){return this.zoom}set Zoom(k){var W;this.zoom=k,this.zoomUpdated=!0,((W=this.graphic)===null||W===void 0?void 0:W.GetCalculator)instanceof m.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(k){this.followCursor=k}get FollowCursor(){return this.followCursor}set TransposeCalculator(k){u.MusicSheetCalculator.transposeCalculator=k}get TransposeCalculator(){return u.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get Version(){return this.version}}a.OpenSheetMusicDisplay=U,U.PageFormatStandards={A3_L:new M.PageFormat(420,297,"A3_L"),A3_P:new M.PageFormat(297,420,"A3_P"),A4_L:new M.PageFormat(297,210,"A4_L"),A4_P:new M.PageFormat(210,297,"A4_P"),A5_L:new M.PageFormat(210,148,"A5_L"),A5_P:new M.PageFormat(148,210,"A5_P"),A6_L:new M.PageFormat(148,105,"A6_L"),A6_P:new M.PageFormat(105,148,"A6_P"),Endless:M.PageFormat.UndefinedPageFormat,Letter_L:new M.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new M.PageFormat(215.9,279.4,"Letter_P")}},2861:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(3495),a),s(r(530),a),s(r(41),a),s(r(9629),a)},8265:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TransposeCalculator=void 0;const h=r(8918);class s{transposePitch(c,o,u){let d=h.NoteEnum.C,x=0,p=h.AccidentalEnum.NONE;const v=h.Pitch.CalculateTransposedHalfTone(c,u);let S=v.halftone,T=v.overflow;for(let P=0;PS)break}for(let P=0;PS){let _=P;const E=h.Pitch.HalfTonesFromAccidental(c.Accidental);for((E>0||E===0&&o.Key>=0)&&_--;_<0;)_+=7,S+=12,T--;for(;_>=7;)_-=7,S-=12,T++;d=s.noteEnums[_],p=h.Pitch.AccidentalFromHalfTones(S-d),x=c.Octave+T;break}return new h.Pitch(d,x,p)}transposeKey(c,o){let u=0,d=0;for(;u=12;)x-=12;for(;x<0;)x+=12;c.Key=s.keyMapping[x],c.isTransposedBy=o}}a.TransposeCalculator=s,s.keyMapping=[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],s.noteEnums=[h.NoteEnum.C,h.NoteEnum.D,h.NoteEnum.E,h.NoteEnum.F,h.NoteEnum.G,h.NoteEnum.A,h.NoteEnum.B]},5742:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(8265),a)},8447:function(b,a,r){var h=this&&this.__createBinding||(Object.create?function(m,c,o,u){u===void 0&&(u=o);var d=Object.getOwnPropertyDescriptor(c,o);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(m,u,d)}:function(m,c,o,u){u===void 0&&(u=o),m[u]=c[o]}),s=this&&this.__exportStar||function(m,c){for(var o in m)o==="default"||Object.prototype.hasOwnProperty.call(c,o)||h(c,m,o)};Object.defineProperty(a,"__esModule",{value:!0}),s(r(5742),a)},2337:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CollectionUtil=void 0,Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,writable:!0,value:function(){return this[this.length-1]}}),Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,writable:!0,value:function(){this.length=0}}),Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,writable:!0,value:function(r){return this.indexOf(r)!==-1}}),a.CollectionUtil=class{static contains2(r,h){for(let s=0;s{Object.defineProperty(a,"__esModule",{value:!0}),a.PSMath=void 0;class r{static log(s,m){return Math.log(m)/Math.log(s)}static log10(s){return r.log(10,s)}static meanSimple(s){let m=0;for(let c=0;c{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(278),m=function(){function c(o){this.root=null,this.compare=o||h.defaultCompare,this.nElements=0}return c.prototype.add=function(o){return!h.isUndefined(o)&&this.insertNode(this.createNode(o))!==null&&(this.nElements++,!0)},c.prototype.clear=function(){this.root=null,this.nElements=0},c.prototype.isEmpty=function(){return this.nElements===0},c.prototype.size=function(){return this.nElements},c.prototype.contains=function(o){return!h.isUndefined(o)&&this.searchNode(this.root,o)!==null},c.prototype.search=function(o){var u=this.searchNode(this.root,o);if(u!==null)return u.element},c.prototype.remove=function(o){var u=this.searchNode(this.root,o);return u!==null&&(this.removeNode(u),this.nElements--,!0)},c.prototype.inorderTraversal=function(o){this.inorderTraversalAux(this.root,o,{stop:!1})},c.prototype.preorderTraversal=function(o){this.preorderTraversalAux(this.root,o,{stop:!1})},c.prototype.postorderTraversal=function(o){this.postorderTraversalAux(this.root,o,{stop:!1})},c.prototype.levelTraversal=function(o){this.levelTraversalAux(this.root,o)},c.prototype.minimum=function(){if(!this.isEmpty()&&this.root!==null)return this.minimumAux(this.root).element},c.prototype.maximum=function(){if(!this.isEmpty()&&this.root!==null)return this.maximumAux(this.root).element},c.prototype.forEach=function(o){this.inorderTraversal(o)},c.prototype.toArray=function(){var o=[];return this.inorderTraversal(function(u){return o.push(u),!0}),o},c.prototype.height=function(){return this.heightAux(this.root)},c.prototype.searchNode=function(o,u){for(var d=1;o!==null&&d!==0;)(d=this.compare(u,o.element))<0?o=o.leftCh:d>0&&(o=o.rightCh);return o},c.prototype.transplant=function(o,u){o.parent===null?this.root=u:o===o.parent.leftCh?o.parent.leftCh=u:o.parent.rightCh=u,u!==null&&(u.parent=o.parent)},c.prototype.removeNode=function(o){if(o.leftCh===null)this.transplant(o,o.rightCh);else if(o.rightCh===null)this.transplant(o,o.leftCh);else{var u=this.minimumAux(o.rightCh);u.parent!==o&&(this.transplant(u,u.rightCh),u.rightCh=o.rightCh,u.rightCh.parent=u),this.transplant(o,u),u.leftCh=o.leftCh,u.leftCh.parent=u}},c.prototype.inorderTraversalAux=function(o,u,d){o===null||d.stop||(this.inorderTraversalAux(o.leftCh,u,d),d.stop||(d.stop=u(o.element)===!1,d.stop||this.inorderTraversalAux(o.rightCh,u,d)))},c.prototype.levelTraversalAux=function(o,u){var d=new s.default;for(o!==null&&d.enqueue(o),o=d.dequeue()||null;o!=null;){if(u(o.element)===!1)return;o.leftCh!==null&&d.enqueue(o.leftCh),o.rightCh!==null&&d.enqueue(o.rightCh),o=d.dequeue()||null}},c.prototype.preorderTraversalAux=function(o,u,d){o===null||d.stop||(d.stop=u(o.element)===!1,d.stop||(this.preorderTraversalAux(o.leftCh,u,d),d.stop||this.preorderTraversalAux(o.rightCh,u,d)))},c.prototype.postorderTraversalAux=function(o,u,d){o===null||d.stop||(this.postorderTraversalAux(o.leftCh,u,d),d.stop||(this.postorderTraversalAux(o.rightCh,u,d),d.stop||(d.stop=u(o.element)===!1)))},c.prototype.minimumAux=function(o){for(;o!=null&&o.leftCh!==null;)o=o.leftCh;return o},c.prototype.maximumAux=function(o){for(;o!=null&&o.rightCh!==null;)o=o.rightCh;return o},c.prototype.heightAux=function(o){return o===null?-1:Math.max(this.heightAux(o.leftCh),this.heightAux(o.rightCh))+1},c.prototype.insertNode=function(o){for(var u=null,d=this.root;d!==null;){var x=this.compare(o.element,d.element);if(x===0)return null;x<0?(u=d,d=d.leftCh):(u=d,d=d.rightCh)}return o.parent=u,u===null?this.root=o:this.compare(o.element,u.element)<0?u.leftCh=o:u.rightCh=o,o},c.prototype.createNode=function(o){return{element:o,leftCh:null,rightCh:null,parent:null}},c}();a.default=m},2070:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(8805),m=r(7818),c=function(){function o(u){this.toStrF=u||h.defaultToString,this.dictionary=new s.default(this.toStrF),this.nElements=0}return o.prototype.add=function(u,d){if(d===void 0&&(d=1),h.isUndefined(u)||d<=0)return!1;if(this.contains(u))this.dictionary.getValue(u).copies+=d;else{var x={value:u,copies:d};this.dictionary.setValue(u,x)}return this.nElements+=d,!0},o.prototype.count=function(u){return this.contains(u)?this.dictionary.getValue(u).copies:0},o.prototype.contains=function(u){return this.dictionary.containsKey(u)},o.prototype.remove=function(u,d){if(d===void 0&&(d=1),h.isUndefined(u)||d<=0)return!1;if(this.contains(u)){var x=this.dictionary.getValue(u);return d>x.copies?this.nElements-=x.copies:this.nElements-=d,x.copies-=d,x.copies<=0&&this.dictionary.remove(u),!0}return!1},o.prototype.toArray=function(){for(var u=[],d=0,x=this.dictionary.values();d{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=function(){function m(c){this.table={},this.nElements=0,this.toStr=c||h.defaultToString}return m.prototype.getValue=function(c){var o=this.table["$"+this.toStr(c)];if(!h.isUndefined(o))return o.value},m.prototype.setValue=function(c,o){if(!h.isUndefined(c)&&!h.isUndefined(o)){var u,d="$"+this.toStr(c),x=this.table[d];return h.isUndefined(x)?(this.nElements++,u=void 0):u=x.value,this.table[d]={key:c,value:o},u}},m.prototype.remove=function(c){var o="$"+this.toStr(c),u=this.table[o];if(!h.isUndefined(u))return delete this.table[o],this.nElements--,u.value},m.prototype.keys=function(){var c=[];for(var o in this.table)if(h.has(this.table,o)){var u=this.table[o];c.push(u.key)}return c},m.prototype.values=function(){var c=[];for(var o in this.table)if(h.has(this.table,o)){var u=this.table[o];c.push(u.value)}return c},m.prototype.forEach=function(c){for(var o in this.table)if(h.has(this.table,o)){var u=this.table[o];if(c(u.key,u.value)===!1)return}},m.prototype.containsKey=function(c){return!h.isUndefined(this.getValue(c))},m.prototype.clear=function(){this.table={},this.nElements=0},m.prototype.size=function(){return this.nElements},m.prototype.isEmpty=function(){return this.nElements<=0},m.prototype.toString=function(){var c="{";return this.forEach(function(o,u){c+=` - `+o+" : "+u}),c+` -}`},m}();a.default=s},2734:function(b,a,r){var h,s=this&&this.__extends||(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var x in d)d.hasOwnProperty(x)&&(u[x]=d[x])},function(u,d){function x(){this.constructor=u}h(u,d),u.prototype=d===null?Object.create(d):(x.prototype=d.prototype,new x)});Object.defineProperty(a,"__esModule",{value:!0});var m=r(8805),c=r(9205),o=function(u){function d(x,p){var v=u.call(this,p)||this;return v.defaultFactoryFunction=x,v}return s(d,u),d.prototype.setDefault=function(x,p){var v=u.prototype.getValue.call(this,x);return c.isUndefined(v)?(this.setValue(x,p),p):v},d.prototype.getValue=function(x){return this.setDefault(x,this.defaultFactoryFunction())},d}(m.default);a.default=o},2422:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(1229),m=function(){function c(o){this.data=[],this.compare=o||h.defaultCompare}return c.prototype.leftChildIndex=function(o){return 2*o+1},c.prototype.rightChildIndex=function(o){return 2*o+2},c.prototype.parentIndex=function(o){return Math.floor((o-1)/2)},c.prototype.minIndex=function(o,u){return u>=this.data.length?o>=this.data.length?-1:o:this.compare(this.data[o],this.data[u])<=0?o:u},c.prototype.siftUp=function(o){for(var u=this.parentIndex(o);o>0&&this.compare(this.data[u],this.data[o])>0;)s.swap(this.data,u,o),o=u,u=this.parentIndex(o)},c.prototype.siftDown=function(o){for(var u=this.minIndex(this.leftChildIndex(o),this.rightChildIndex(o));u>=0&&this.compare(this.data[o],this.data[u])>0;)s.swap(this.data,u,o),o=u,u=this.minIndex(this.leftChildIndex(o),this.rightChildIndex(o))},c.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},c.prototype.add=function(o){return!h.isUndefined(o)&&(this.data.push(o),this.siftUp(this.data.length-1),!0)},c.prototype.removeRoot=function(){if(this.data.length>0){var o=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),o}},c.prototype.contains=function(o){var u=h.compareToEquals(this.compare);return s.contains(this.data,o,u)},c.prototype.size=function(){return this.data.length},c.prototype.isEmpty=function(){return this.data.length<=0},c.prototype.clear=function(){this.data.length=0},c.prototype.forEach=function(o){s.forEach(this.data,o)},c}();a.default=m},3272:function(b,a,r){var h,s=this&&this.__extends||(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,p){x.__proto__=p}||function(x,p){for(var v in p)p.hasOwnProperty(v)&&(x[v]=p[v])},function(x,p){function v(){this.constructor=x}h(x,p),x.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)});Object.defineProperty(a,"__esModule",{value:!0});var m=r(8805),c=r(9205),o=function(){function x(p,v){this.key=p,this.value=v}return x.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},x}(),u=function(){function x(){this.key=null,this.value=null}return x.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},x}(),d=function(x){function p(v){var S=x.call(this,v)||this;return S.head=new u,S.tail=new u,S.head.next=S.tail,S.tail.prev=S.head,S}return s(p,x),p.prototype.appendToTail=function(v){var S=this.tail.prev;S.next=v,v.prev=S,v.next=this.tail,this.tail.prev=v},p.prototype.getLinkedDictionaryPair=function(v){if(!c.isUndefined(v)){var S="$"+this.toStr(v);return this.table[S]}},p.prototype.getValue=function(v){var S=this.getLinkedDictionaryPair(v);if(!c.isUndefined(S))return S.value},p.prototype.remove=function(v){var S=this.getLinkedDictionaryPair(v);if(!c.isUndefined(S))return x.prototype.remove.call(this,v),S.unlink(),S.value},p.prototype.clear=function(){x.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},p.prototype.replace=function(v,S){var T="$"+this.toStr(S.key);S.next=v.next,S.prev=v.prev,this.remove(v.key),S.prev.next=S,S.next.prev=S,this.table[T]=S,++this.nElements},p.prototype.setValue=function(v,S){if(!c.isUndefined(v)&&!c.isUndefined(S)){var T=this.getLinkedDictionaryPair(v),P=new o(v,S),_="$"+this.toStr(v);return c.isUndefined(T)?(this.appendToTail(P),this.table[_]=P,void++this.nElements):(this.replace(T,P),T.value)}},p.prototype.keys=function(){var v=[];return this.forEach(function(S,T){v.push(S)}),v},p.prototype.values=function(){var v=[];return this.forEach(function(S,T){v.push(T)}),v},p.prototype.forEach=function(v){for(var S=this.head.next;S.next;){if(v(S.key,S.value)===!1)return;S=S.next}},p}(m.default);a.default=d},5456:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(1229),m=function(){function c(){this.firstNode=null,this.lastNode=null,this.nElements=0}return c.prototype.add=function(o,u){if(h.isUndefined(u)&&(u=this.nElements),u<0||u>this.nElements||h.isUndefined(o))return!1;var d=this.createNode(o);if(this.nElements===0||this.lastNode===null)this.firstNode=d,this.lastNode=d;else if(u===this.nElements)this.lastNode.next=d,this.lastNode=d;else if(u===0)d.next=this.firstNode,this.firstNode=d;else{var x=this.nodeAtIndex(u-1);if(x===null)return!1;d.next=x.next,x.next=d}return this.nElements++,!0},c.prototype.first=function(){if(this.firstNode!==null)return this.firstNode.element},c.prototype.last=function(){if(this.lastNode!==null)return this.lastNode.element},c.prototype.elementAtIndex=function(o){var u=this.nodeAtIndex(o);if(u!==null)return u.element},c.prototype.indexOf=function(o,u){var d=u||h.defaultEquals;if(h.isUndefined(o))return-1;for(var x=this.firstNode,p=0;x!==null;){if(d(x.element,o))return p;p++,x=x.next}return-1},c.prototype.contains=function(o,u){return this.indexOf(o,u)>=0},c.prototype.remove=function(o,u){var d=u||h.defaultEquals;if(this.nElements<1||h.isUndefined(o))return!1;for(var x=null,p=this.firstNode;p!==null;){if(d(p.element,o))return x===null?(this.firstNode=p.next,p===this.lastNode&&(this.lastNode=null)):p===this.lastNode?(this.lastNode=x,x.next=p.next,p.next=null):(x.next=p.next,p.next=null),this.nElements--,!0;x=p,p=p.next}return!1},c.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},c.prototype.equals=function(o,u){var d=u||h.defaultEquals;return o instanceof c&&this.size()===o.size()&&this.equalsAux(this.firstNode,o.firstNode,d)},c.prototype.equalsAux=function(o,u,d){for(;o!==null&&u!==null;){if(!d(o.element,u.element))return!1;o=o.next,u=u.next}return!0},c.prototype.removeElementAtIndex=function(o){if(!(o<0||o>=this.nElements||this.firstNode===null||this.lastNode===null)){var u;if(this.nElements===1)u=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var d=this.nodeAtIndex(o-1);d===null?(u=this.firstNode.element,this.firstNode=this.firstNode.next):d.next===this.lastNode&&(u=this.lastNode.element,this.lastNode=d),d!==null&&d.next!==null&&(u=d.next.element,d.next=d.next.next)}return this.nElements--,u}},c.prototype.forEach=function(o){for(var u=this.firstNode;u!==null&&o(u.element)!==!1;)u=u.next},c.prototype.reverse=function(){for(var o=null,u=this.firstNode,d=null;u!==null;)d=u.next,u.next=o,o=u,u=d;d=this.firstNode,this.firstNode=this.lastNode,this.lastNode=d},c.prototype.toArray=function(){for(var o=[],u=this.firstNode;u!==null;)o.push(u.element),u=u.next;return o},c.prototype.size=function(){return this.nElements},c.prototype.isEmpty=function(){return this.nElements<=0},c.prototype.toString=function(){return s.toString(this.toArray())},c.prototype.nodeAtIndex=function(o){if(o<0||o>=this.nElements)return null;if(o===this.nElements-1)return this.lastNode;for(var u=this.firstNode,d=0;d{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(8805),m=r(1229),c=function(){function o(u,d,x){x===void 0&&(x=!1),this.dict=new s.default(u),this.equalsF=d||h.defaultEquals,this.allowDuplicate=x}return o.prototype.getValue=function(u){var d=this.dict.getValue(u);return h.isUndefined(d)?[]:m.copy(d)},o.prototype.setValue=function(u,d){if(h.isUndefined(u)||h.isUndefined(d))return!1;var x=this.dict.getValue(u);return h.isUndefined(x)?(this.dict.setValue(u,[d]),!0):!(!this.allowDuplicate&&m.contains(x,d,this.equalsF)||(x.push(d),0))},o.prototype.remove=function(u,d){if(h.isUndefined(d)){var x=this.dict.remove(u);return!h.isUndefined(x)}var p=this.dict.getValue(u);return!(h.isUndefined(p)||!m.remove(p,d,this.equalsF)||(p.length===0&&this.dict.remove(u),0))},o.prototype.keys=function(){return this.dict.keys()},o.prototype.values=function(){for(var u=[],d=0,x=this.dict.values();d{var r;Object.defineProperty(a,"__esModule",{value:!0}),function(s){s[s.BEFORE=0]="BEFORE",s[s.AFTER=1]="AFTER",s[s.INSIDE_AT_END=2]="INSIDE_AT_END",s[s.INSIDE_AT_START=3]="INSIDE_AT_START"}(r||(r={}));var h=function(){function s(m,c){m===void 0&&(m=[]),c===void 0&&(c={}),this.rootIds=m,this.nodes=c,this.initRootIds(),this.initNodes()}return s.prototype.initRootIds=function(){for(var m=0,c=this.rootIds;m-1&&this.insertIdIntoRoot(c,o),this.nodes)if(this.nodes.hasOwnProperty(u)){var d=this.findNodeId(u,m);d>-1&&this.insertIdIntoNode(u,c,d)}},s.prototype.insertIdAfterId=function(m,c){var o=this.findRootId(m);for(var u in o>-1&&this.insertIdIntoRoot(c,o+1),this.nodes)if(this.nodes.hasOwnProperty(u)){var d=this.findNodeId(u,m);d>-1&&this.insertIdIntoNode(u,c,d+1)}},s.prototype.insertIdIntoId=function(m,c){this.nodeInsertAtEnd(m,c),this.nodes[c]=[]},s.prototype.insertIdIntoRoot=function(m,c){if(c===void 0)this.rootInsertAtEnd(m);else if(c<0){var o=this.rootIds.length;this.rootIds.splice(c+o+1,0,m)}else this.rootIds.splice(c,0,m);this.nodes[m]=this.nodes[m]||[]},s.prototype.insertIdIntoNode=function(m,c,o){if(this.nodes[m]=this.nodes[m]||[],this.nodes[c]=this.nodes[c]||[],o===void 0)this.nodeInsertAtEnd(m,c);else if(o<0){var u=this.nodes[m].length;this.nodes[m].splice(o+u+1,0,c)}else this.nodes[m].splice(o,0,c)},s.prototype.moveId=function(m,c,o){var u=m,d=this.findRootId(u);for(var x in this.nodes[c],this.nodes)if(this.nodes.hasOwnProperty(x)){this.findNodeId(x,c);break}var p=c,v=this.findRootId(p);for(var x in this.nodes[c],this.nodes)if(this.nodes.hasOwnProperty(x)){this.findNodeId(x,c);break}if(d>-1){if(v>-1)switch(this.rootDelete(d),v>d&&v--,o){case r.BEFORE:this.insertIdIntoRoot(u,v);break;case r.AFTER:this.insertIdIntoRoot(u,v+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(p,u);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(p,u)}else for(var x in this.rootDelete(d),this.nodes)if(this.nodes.hasOwnProperty(x)&&(S=this.findNodeId(x,p))>-1){switch(o){case r.BEFORE:this.insertIdIntoNode(x,u,S);break;case r.AFTER:this.insertIdIntoNode(x,u,S+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(p,u);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(p,u)}break}}else if(v>-1){for(var x in this.nodes)if(this.nodes.hasOwnProperty(x)&&(S=this.findNodeId(x,u))>-1){this.nodeDeleteAtIndex(x,S);break}switch(o){case r.BEFORE:this.insertIdIntoRoot(u,v);break;case r.AFTER:this.insertIdIntoRoot(u,v+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(p,u);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(p,u)}}else{for(var x in this.nodes)if(this.nodes.hasOwnProperty(x)&&(S=this.findNodeId(x,u))>-1){this.nodeDeleteAtIndex(x,S);break}for(var x in this.nodes){var S;if(this.nodes.hasOwnProperty(x)&&(S=this.findNodeId(x,p))>-1){switch(o){case r.BEFORE:this.insertIdIntoNode(x,u,S);break;case r.AFTER:this.insertIdIntoNode(x,u,S+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(p,u);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(p,u)}break}}}},s.prototype.swapArrayElements=function(m,c,o){var u=m[c];return m[c]=m[o],m[o]=u,m},s.prototype.rootDeleteId=function(m){var c=this.findRootId(m);c>-1&&this.rootDelete(c)},s.prototype.nodeAndSubNodesDelete=function(m){for(var c=[],o=0;o{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(2422),m=function(){function c(o){this.heap=new s.default(h.reverseCompareFunction(o))}return c.prototype.enqueue=function(o){return this.heap.add(o)},c.prototype.add=function(o){return this.heap.add(o)},c.prototype.dequeue=function(){if(this.heap.size()!==0){var o=this.heap.peek();return this.heap.removeRoot(),o}},c.prototype.peek=function(){return this.heap.peek()},c.prototype.contains=function(o){return this.heap.contains(o)},c.prototype.isEmpty=function(){return this.heap.isEmpty()},c.prototype.size=function(){return this.heap.size()},c.prototype.clear=function(){this.heap.clear()},c.prototype.forEach=function(o){this.heap.forEach(o)},c}();a.default=m},278:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(5456),s=function(){function m(){this.list=new h.default}return m.prototype.enqueue=function(c){return this.list.add(c)},m.prototype.add=function(c){return this.list.add(c)},m.prototype.dequeue=function(){if(this.list.size()!==0){var c=this.list.first();return this.list.removeElementAtIndex(0),c}},m.prototype.peek=function(){if(this.list.size()!==0)return this.list.first()},m.prototype.size=function(){return this.list.size()},m.prototype.contains=function(c,o){return this.list.contains(c,o)},m.prototype.isEmpty=function(){return this.list.size()<=0},m.prototype.clear=function(){this.list.clear()},m.prototype.forEach=function(c){this.list.forEach(c)},m}();a.default=s},7818:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205),s=r(1229),m=r(8805),c=function(){function o(u){this.dictionary=new m.default(u)}return o.prototype.contains=function(u){return this.dictionary.containsKey(u)},o.prototype.add=function(u){return!this.contains(u)&&!h.isUndefined(u)&&(this.dictionary.setValue(u,u),!0)},o.prototype.intersection=function(u){var d=this;this.forEach(function(x){return u.contains(x)||d.remove(x),!0})},o.prototype.union=function(u){var d=this;u.forEach(function(x){return d.add(x),!0})},o.prototype.difference=function(u){var d=this;u.forEach(function(x){return d.remove(x),!0})},o.prototype.isSubsetOf=function(u){if(this.size()>u.size())return!1;var d=!0;return this.forEach(function(x){return!!u.contains(x)||(d=!1,!1)}),d},o.prototype.remove=function(u){return!!this.contains(u)&&(this.dictionary.remove(u),!0)},o.prototype.forEach=function(u){this.dictionary.forEach(function(d,x){return u(x)})},o.prototype.toArray=function(){return this.dictionary.values()},o.prototype.isEmpty=function(){return this.dictionary.isEmpty()},o.prototype.size=function(){return this.dictionary.size()},o.prototype.clear=function(){this.dictionary.clear()},o.prototype.toString=function(){return s.toString(this.toArray())},o}();a.default=c},5669:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(5456),s=function(){function m(){this.list=new h.default}return m.prototype.push=function(c){return this.list.add(c,0)},m.prototype.add=function(c){return this.list.add(c,0)},m.prototype.pop=function(){return this.list.removeElementAtIndex(0)},m.prototype.peek=function(){return this.list.first()},m.prototype.size=function(){return this.list.size()},m.prototype.contains=function(c,o){return this.list.contains(c,o)},m.prototype.isEmpty=function(){return this.list.isEmpty()},m.prototype.clear=function(){this.list.clear()},m.prototype.forEach=function(c){this.list.forEach(c)},m}();a.default=s},1229:(b,a,r)=>{Object.defineProperty(a,"__esModule",{value:!0});var h=r(9205);function s(m,c,o){for(var u=o||h.defaultEquals,d=m.length,x=0;x=0;d--)if(u(m[d],c))return d;return-1},a.contains=function(m,c,o){return s(m,c,o)>=0},a.remove=function(m,c,o){var u=s(m,c,o);return!(u<0||(m.splice(u,1),0))},a.frequency=function(m,c,o){for(var u=o||h.defaultEquals,d=m.length,x=0,p=0;p=m.length||o<0||o>=m.length)return!1;var u=m[c];return m[c]=m[o],m[o]=u,!0},a.toString=function(m){return"["+m.toString()+"]"},a.forEach=function(m,c){for(var o=0,u=m;o{Object.defineProperty(a,"__esModule",{value:!0});var h=r(1229);a.arrays=h;var s=r(2070);a.Bag=s.default;var m=r(8071);a.BSTree=m.default;var c=r(3176);a.BSTreeKV=c.default;var o=r(8805);a.Dictionary=o.default;var u=r(2422);a.Heap=u.default;var d=r(3272);a.LinkedDictionary=d.default;var x=r(5456);a.LinkedList=x.default;var p=r(6072);a.MultiDictionary=p.default;var v=r(2734);a.FactoryDictionary=v.default;var S=r(2734);a.DefaultDictionary=S.default;var T=r(278);a.Queue=T.default;var P=r(5994);a.PriorityQueue=P.default;var _=r(7818);a.Set=_.default;var E=r(5669);a.Stack=E.default;var M=r(1489);a.MultiRootTree=M.default;var N=r(9205);a.util=N},9205:(b,a)=>{Object.defineProperty(a,"__esModule",{value:!0});var r=Object.prototype.hasOwnProperty;function h(c){return typeof c=="function"}function s(c){return c===void 0}function m(c){return Object.prototype.toString.call(c)==="[object String]"}a.has=function(c,o){return r.call(c,o)},a.defaultCompare=function(c,o){return c{r.r(a),r.d(a,{default:()=>Gs});const h=()=>{};h.L=(Ie,i)=>{if(!i)return;const y=Array.prototype.slice.call(i).join(" ");window.console.log(Ie+": "+y)},h.MakeException=Ie=>class extends Error{constructor(i,y){super(i),this.name=Ie,this.message=i,this.data=y}},h.RERR=h.RuntimeError=class{constructor(Ie,i){this.code=Ie,this.message=i}toString(){return"[RuntimeError] "+this.code+":"+this.message}},h.Merge=(Ie,i)=>{for(const y in i)Ie[y]=i[y];return Ie},h.Min=Math.min,h.Max=Math.max,h.forEach=(Ie,i)=>{for(let y=0;yIe%i>=i/2?parseInt(Ie/i,10)*i+i:parseInt(Ie/i,10)*i,h.MidLine=(Ie,i)=>{let y=i+(Ie-i)/2;return y%2>0&&(y=h.RoundN(10*y,5)/10),y},h.SortAndUnique=(Ie,i,y)=>{if(Ie.length>1){const C=[];let B;Ie.sort(i);for(let $=0;${let y=Ie.length;for(;y--;)if(Ie[y]===i)return!0;return!1},h.getCanvasContext=Ie=>{if(!Ie)throw new h.RERR("BadArgument","Invalid canvas selector: "+Ie);const i=document.getElementById(Ie);if(!i||!i.getContext)throw new h.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return i.getContext("2d")},h.drawDot=(Ie,i,y,C="#55")=>{Ie.save(),Ie.setFillStyle(C),Ie.beginPath(),Ie.arc(i,y,3,0,2*Math.PI,!0),Ie.closePath(),Ie.fill(),Ie.restore()},h.BM=(Ie,i)=>{const y=new Date().getTime();i();const C=new Date().getTime()-y;h.L(Ie+C+"ms")},h.StackTrace=()=>new Error().stack,h.W=(...Ie)=>{const i=Ie.join(" ");window.console.log("Warning: ",i,h.StackTrace())},(h.Prefix=Ie=>h.Prefix.prefix+Ie).prefix="vf-";class s{static GCD(i,y){if(typeof i!="number"||typeof y!="number")throw new h.RERR("BadArgument",`Invalid numbers: ${i}, ${y}`);let C;for(;y!==0;)C=y,y=i%y,i=C;return i}static LCM(i,y){return i*y/s.GCD(i,y)}static LCMM(i){if(i.length===0)return 0;if(i.length===1)return i[0];if(i.length===2)return s.LCM(i[0],i[1]);{const y=i[0];return i.shift(),s.LCM(y,s.LCMM(i))}}constructor(i,y){this.set(i,y)}set(i,y){return this.numerator=i===void 0?1:i,this.denominator=y===void 0?1:y,this}value(){return this.numerator/this.denominator}simplify(){let i=this.numerator,y=this.denominator;const C=s.GCD(i,y);return i/=C,y/=C,y<0&&(y=-y,i=-i),this.set(i,y)}add(i,y){let C,B;i instanceof s?(C=i.numerator,B=i.denominator):(C=i!==void 0?i:0,B=y!==void 0?y:1);const $=s.LCM(this.denominator,B),Z=$/this.denominator,se=$/B,ue=this.numerator*Z+C*se;return this.set(ue,$)}subtract(i,y){let C,B;i instanceof s?(C=i.numerator,B=i.denominator):(C=i!==void 0?i:0,B=y!==void 0?y:1);const $=s.LCM(this.denominator,B),Z=$/this.denominator,se=$/B,ue=this.numerator*Z-C*se;return this.set(ue,$)}multiply(i,y){let C,B;return i instanceof s?(C=i.numerator,B=i.denominator):(C=i!==void 0?i:1,B=y!==void 0?y:1),this.set(this.numerator*C,this.denominator*B)}divide(i,y){let C,B;return i instanceof s?(C=i.numerator,B=i.denominator):(C=i!==void 0?i:1,B=y!==void 0?y:1),this.set(this.numerator*B,this.denominator*C)}equals(i){const y=s.__compareA.copy(i).simplify(),C=s.__compareB.copy(this).simplify();return y.numerator===C.numerator&&y.denominator===C.denominator}greaterThan(i){const y=s.__compareB.copy(this);return y.subtract(i),y.numerator>0}greaterThanEquals(i){const y=s.__compareB.copy(this);return y.subtract(i),y.numerator>=0}lessThan(i){return!this.greaterThanEquals(i)}lessThanEquals(i){return!this.greaterThan(i)}clone(){return new s(this.numerator,this.denominator)}copy(i){return typeof i=="number"?this.set(i||0,1):this.set(i.numerator,i.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return s.__tmp.copy(this).simplify().toString()}toMixedString(){let i="";const y=this.quotient(),C=s.__tmp.copy(this);return y<0?C.abs().fraction():C.fraction(),y!==0?(i+=y,C.numerator!==0&&(i+=" "+C.toSimplifiedString())):i=C.numerator===0?"0":C.toSimplifiedString(),i}parse(i){const y=i.split("/"),C=parseInt(y[0],10),B=y[1]?parseInt(y[1],10):1;return this.set(C,B)}}s.__compareA=new s,s.__compareB=new s,s.__tmp=new s;const m=h.MakeException("RegistryError");function c(Ie,i,y,C,B){Ie[i][y]||(Ie[i][y]={}),Ie[i][y][C]=B}class o{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(i){o.defaultRegistry=i}static getDefaultRegistry(){return o.defaultRegistry}static disableDefaultRegistry(){o.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:i,name:y,value:C,oldValue:B}){const $=this.getElementById(i);B!==null&&this.index[y][B]&&delete this.index[y][B][i],C!==null&&c(this.index,y,C,$.getAttribute("id"),$)}register(i,y){if(!(y=y||i.getAttribute("id")))throw new m("Can't add element without `id` attribute to registry",i);return i.setAttribute("id",y),c(this.index,"id",y,y,i),o.INDEXES.forEach(C=>{this.updateIndex({id:y,name:C,value:i.getAttribute(C),oldValue:null})}),i.onRegister(this),this}getElementById(i){return this.index.id[i]?this.index.id[i][i]:null}getElementsByAttribute(i,y){const C=this.index[i];return C&&C[y]?Object.keys(C[y]).map(B=>C[y][B]):[]}getElementsByType(i){return this.getElementsByAttribute("type",i)}getElementsByClass(i){return this.getElementsByAttribute("class",i)}onUpdate({id:i,name:y,value:C,oldValue:B}){return function($,Z){return $.filter(se=>se===Z).length>0}(o.INDEXES.concat(["id","class"]),y)?(this.updateIndex({id:i,name:y,value:C,oldValue:B}),this):this}}o.defaultRegistry=null;class u{static newID(){return"auto"+u.ID++}constructor({type:i}={}){this.attrs={id:u.newID(),el:null,type:i||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,o.getDefaultRegistry()&&o.getDefaultRegistry().register(this)}setStyle(i){return this.style=i,this}getStyle(){return this.style}applyStyle(i=this.context,y=this.getStyle()){return y?(i.save(),y.shadowColor&&i.setShadowColor(y.shadowColor),y.shadowBlur&&i.setShadowBlur(y.shadowBlur),y.fillStyle&&i.setFillStyle(y.fillStyle),y.strokeStyle&&i.setStrokeStyle(y.strokeStyle),y.lineWidth&&i.setLineWidth(y.lineWidth),this):this}restoreStyle(i=this.context,y=this.getStyle()){return y?(i.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(i){return this.attrs.classes[i]===!0}addClass(i){return this.attrs.classes[i]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:i,oldValue:null}),this}removeClass(i){return delete this.attrs.classes[i],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:i}),this}onRegister(i){return this.registry=i,this}isRendered(){return this.rendered}setRendered(i=!0){return this.rendered=i,this}getAttributes(){return this.attrs}getAttribute(i){return this.attrs[i]}setAttribute(i,y){const C=this.attrs.id,B=this.attrs[i];return this.attrs[i]=y,this.registry&&this.registry.onUpdate({id:C,name:i,value:y,oldValue:B}),this}getContext(){return this.context}setContext(i){return this.context=i,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new h.RERR("NoContext","No rendering context attached to instance");return this.context}}u.ID=1e3;class d{constructor(i,y,C,B){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(i,y),this.addPoint(C,B)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(i,y){i!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=i,this.x2=i),ithis.x2&&(this.x2=i)),y!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=y,this.y2=y),ythis.y2&&(this.y2=y))}addX(i){this.addPoint(i,null)}addY(i){this.addPoint(null,i)}addQuadraticCurve(i,y,C,B,$,Z){const se=i+.6666666666666666*(C-i),ue=y+2/3*(B-y),ve=se+1/3*($-i),we=ue+1/3*(Z-y);this.addBezierCurve(i,y,se,ue,ve,we,$,Z)}addBezierCurve(i,y,C,B,$,Z,se,ue){const ve=[i,y],we=[C,B],Pe=[$,Z],Ae=[se,ue];let Ce;this.addPoint(ve[0],ve[1]),this.addPoint(Ae[0],Ae[1]);const Ve=(je,$e)=>Math.pow(1-je,3)*ve[$e]+3*Math.pow(1-je,2)*je*we[$e]+3*(1-je)*Math.pow(je,2)*Pe[$e]+Math.pow(je,3)*Ae[$e];for(Ce=0;Ce<=1;Ce++){const je=6*ve[Ce]-12*we[Ce]+6*Pe[Ce],$e=-3*ve[Ce]+9*we[Ce]-9*Pe[Ce]+3*Ae[Ce],Je=3*we[Ce]-3*ve[Ce];if($e===0){if(je===0)continue;const kt=-Je/je;0{if(!Ie)throw new h.RERR("BadArgument","Invalid clef: "+Ie);const i=T.clefProperties.values[Ie];if(!i)throw new h.RERR("BadArgument","Invalid clef: "+Ie);return i}};T.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},T.keyProperties=(Ie,i,y)=>{i===void 0&&(i="treble");const C={octave_shift:0};typeof y=="object"&&h.Merge(C,y);const B=Ie.split("/");if(B.length<2)throw new h.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${Ie}`);const $=B[0].toUpperCase(),Z=T.keyProperties.note_values[$];if(!Z)throw new h.RERR("BadArguments","Invalid key name: "+$);Z.octave&&(B[1]=Z.octave);let se=parseInt(B[1],10);se-=C.octave_shift;let ue=(7*se-28+Z.index)/2;ue+=T.clefProperties(i).line_shift;let ve=0;ue<=0&&2*ue%2==0&&(ve=1),ue>=6&&2*ue%2==0&&(ve=-1);const we=Z.int_val!==void 0?12*se+Z.int_val:null,Pe=Z.code,Ae=Z.shift_right;let Ce={};if(B.length>2&&B[2]){const Ve=B[2].toUpperCase();Ce=T.keyProperties.customNoteHeads[Ve]||{}}return{key:$,octave:se,line:ue,int_value:we,accidental:Z.accidental,code:Pe,stroke:ve,shift_right:Ae,displaced:!1,...Ce}},T.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},T.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},TI:{code:"v11",shift_right:0,stem_up_y_shift:5,stem_down_y_shift:5,stem_up_x_offset:6,stem_down_x_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0},rwl:{code:"rwl",shift_right:0},rhl:{code:"rhl",shift_right:0}},T.integerToNote=Ie=>{if(Ie===void 0)throw new h.RERR("BadArguments","Undefined integer for integerToNote");if(Ie<-2)throw new h.RERR("BadArguments",`integerToNote requires integer > -2: ${Ie}`);const i=T.integerToNote.table[Ie];if(!i)throw new h.RERR("BadArguments",`Unknown note value for integer: ${Ie}`);return i},T.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},T.tabToGlyph=(Ie,i=1)=>{let y=null,C=0,B=0;if(Ie.toString().toUpperCase()==="X"){const $=new S("v7f",T.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();y="v7f",C=$.width,B=-$.height/2}else C=T.textWidth(Ie.toString());return{text:Ie,code:y,getWidth:()=>C*i,shift_y:B}},T.textWidth=Ie=>7*Ie.toString().length,T.articulationCodes=Ie=>T.articulationCodes.articulations[Ie],T.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},T.accidentalCodes=Ie=>T.accidentalCodes.accidentals[Ie],T.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},T.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},T.ornamentCodes=Ie=>T.ornamentCodes.ornaments[Ie],T.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},T.keySignature=Ie=>{const i=T.keySignature.keySpecs[Ie];if(!i)throw new h.RERR("BadKeySignature",`Bad key signature spec: '${Ie}'`);if(!i.acc)return[];const y=T.keySignature.accidentalList(i.acc),C=[];for(let B=0;B({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]})[Ie],T.parseNoteDurationString=Ie=>{if(typeof Ie!="string")return null;const i=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(Ie);if(!i)return null;const y=i[1],C=i[2].length;let B=i[3];return B.length===0&&(B="n"),{duration:y,dots:C,type:B}},T.parseNoteStruct=Ie=>{const i=Ie.duration,y=T.parseNoteDurationString(i);if(!y)return null;let C=T.durationToTicks(y.duration);if(C==null)return null;let B=Ie.type;const $=[];if(B){if(!T.getGlyphProps.validTypes[B])return null}else B=y.type||"n",Ie.keys!==void 0&&Ie.keys.forEach((ue,ve)=>{const we=ue.split("/");we&&we.length===3&&($[ve]=we[2])});const Z=Ie.dots?Ie.dots:y.dots;if(typeof Z!="number")return null;let se=C;for(let ue=0;ue{const i=T.durationAliases[Ie];if(i!==void 0&&(Ie=i),T.durationToTicks.durations[Ie]===void 0)throw new h.RERR("BadArguments",`The provided duration is not valid: ${Ie}`);return Ie},T.durationToFraction=Ie=>new s().parse(T.sanitizeDuration(Ie)),T.durationToNumber=Ie=>T.durationToFraction(Ie).value(),T.durationToTicks=Ie=>{Ie=T.sanitizeDuration(Ie);const i=T.durationToTicks.durations[Ie];return i===void 0?null:i},T.durationToTicks.durations={"1/2":2*T.RESOLUTION,1:T.RESOLUTION/1,2:T.RESOLUTION/2,4:T.RESOLUTION/4,8:T.RESOLUTION/8,16:T.RESOLUTION/16,32:T.RESOLUTION/32,64:T.RESOLUTION/64,128:T.RESOLUTION/128,256:T.RESOLUTION/256},T.durationAliases={w:"1",h:"2",q:"4",b:"256"},T.getGlyphProps=(Ie,i)=>{Ie=T.sanitizeDuration(Ie);const y=T.getGlyphProps.duration_codes[Ie];if(y===void 0)return null;i||(i="n");let C=y.type[i];if(C===void 0){const B=T.keyProperties.customNoteHeads[i.toUpperCase()];if(B===void 0)return null;C={code_head:B.code,...B}}return{...y.common,...C}},T.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},T.getGlyphProps.duration_codes={"1/2":{common:{getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v53",Ie).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-T.STEM_HEIGHT,stem_down_extension:-T.STEM_HEIGHT,tabnote_stem_up_extension:-T.STEM_HEIGHT,tabnote_stem_down_extension:-T.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v1d",Ie).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-T.STEM_HEIGHT,stem_down_extension:-T.STEM_HEIGHT,tabnote_stem_up_extension:-T.STEM_HEIGHT,tabnote_stem_down_extension:-T.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v81",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(Ie=T.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Ie).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>T.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},T.smufl={},T.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},T.TIME4_4={num_beats:4,beat_value:4,resolution:T.RESOLUTION};class P{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(i,y){return Math.max(i,y)>this.CANVAS_BROWSER_SIZE_LIMIT&&(h.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),i>this.CANVAS_BROWSER_SIZE_LIMIT&&(i=this.CANVAS_BROWSER_SIZE_LIMIT),y>this.CANVAS_BROWSER_SIZE_LIMIT&&(y=this.CANVAS_BROWSER_SIZE_LIMIT)),[i,y]}constructor(i){this.vexFlowCanvasContext=i,i.canvas?this.canvas=i.canvas:this.canvas={width:P.WIDTH,height:P.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(i,y,C){return this.vexFlowCanvasContext.font=(C||"")+" "+y+"pt "+i,this}setRawFont(i){return this.vexFlowCanvasContext.font=i,this}setFillStyle(i){return this.vexFlowCanvasContext.fillStyle=i,this}setBackgroundFillStyle(i){return this.background_fillStyle=i,this}setStrokeStyle(i){return this.vexFlowCanvasContext.strokeStyle=i,this}setShadowColor(i){return this.vexFlowCanvasContext.shadowColor=i,this}setShadowBlur(i){return this.vexFlowCanvasContext.shadowBlur=i,this}setLineWidth(i){return this.vexFlowCanvasContext.lineWidth=i,this}setLineCap(i){return this.vexFlowCanvasContext.lineCap=i,this}setLineDash(i){return this.vexFlowCanvasContext.lineDash=i,this}scale(i,y){return this.vexFlowCanvasContext.scale(parseFloat(i),parseFloat(y))}resize(i,y){return[i,y]=this.SanitizeCanvasDims(parseInt(i,10),parseInt(y,10)),this.vexFlowCanvasContext.resize(i,y)}rect(i,y,C,B){return this.vexFlowCanvasContext.rect(i,y,C,B)}fillRect(i,y,C,B){return this.vexFlowCanvasContext.fillRect(i,y,C,B)}clearRect(i,y,C,B){return this.vexFlowCanvasContext.clearRect(i,y,C,B)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(i,y){return this.vexFlowCanvasContext.moveTo(i,y)}lineTo(i,y){return this.vexFlowCanvasContext.lineTo(i,y)}bezierCurveTo(i,y,C,B,$,Z){return this.vexFlowCanvasContext.bezierCurveTo(i,y,C,B,$,Z)}quadraticCurveTo(i,y,C,B){return this.vexFlowCanvasContext.quadraticCurveTo(i,y,C,B)}arc(i,y,C,B,$,Z){return this.vexFlowCanvasContext.arc(i,y,C,B,$,Z)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(i){return this.vexFlowCanvasContext.measureText(i)}fillText(i,y,C){return this.vexFlowCanvasContext.fillText(i,y,C)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class _{constructor(i){this.element=i,this.paper=Raphael(i),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(i,y,C){return this.state.font_family=i,this.state.font_size=y,this.state.font_weight=C,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(i){return this.attributes.font=i,this}setFillStyle(i){return this.attributes.fill=i,this}setBackgroundFillStyle(i){return this.background_attributes.fill=i,this.background_attributes.stroke=i,this}setStrokeStyle(i){return this.attributes.stroke=i,this}setShadowColor(i){return this.shadow_attributes.color=i,this}setShadowBlur(i){return this.shadow_attributes.width=i,this}setLineWidth(i){this.attributes["stroke-width"]=i,this.lineWidth=i}setLineDash(){return this}setLineCap(){return this}scale(i,y){return this.state.scale={x:i,y},this.attributes.transform="S"+i+","+y+",0,0",this.attributes.scale=i+","+y+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+i+","+y+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(i,y){return this.element.style.width=i,this.paper.setSize(i,y),this}setViewBox(i){this.paper.canvas.setAttribute("viewBox",i)}rect(i,y,C,B){return B<0&&(y+=B,B=-B),this.paper.rect(i,y,C-.5,B-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(i,y,C,B){return B<0&&(y+=B,B=-B),this.paper.rect(i,y,C-.5,B-.5).attr(this.attributes),this}clearRect(i,y,C,B){return B<0&&(y+=B,B=-B),this.paper.rect(i,y,C-.5,B-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(i,y){return this.path+="M"+i+","+y,this.pen.x=i,this.pen.y=y,this}lineTo(i,y){return this.path+="L"+i+","+y,this.pen.x=i,this.pen.y=y,this}bezierCurveTo(i,y,C,B,$,Z){return this.path+="C"+i+","+y+","+C+","+B+","+$+","+Z,this.pen.x=$,this.pen.y=Z,this}quadraticCurveTo(i,y,C,B){return this.path+="Q"+i+","+y+","+C+","+B,this.pen.x=C,this.pen.y=B,this}arc(i,y,C,B,$,Z){function se(ve){for(;ve<0;)ve+=2*Math.PI;for(;ve>2*Math.PI;)ve-=2*Math.PI;return ve}if((B=se(B))>($=se($))){const ve=B;B=$,$=ve,Z=!Z}const ue=$-B;return ue>Math.PI?(this.arcHelper(i,y,C,B,B+ue/2,Z),this.arcHelper(i,y,C,B+ue/2,$,Z)):this.arcHelper(i,y,C,B,$,Z),this}arcHelper(i,y,C,B,$,Z){const se=i+C*Math.cos(B),ue=y+C*Math.sin(B),ve=i+C*Math.cos($),we=y+C*Math.sin($);let Pe=0,Ae=0;Z?(Ae=1,$-BMath.PI&&(Pe=1),this.path+="M"+se+","+ue+",A"+C+","+C+",0,"+Pe+","+Ae+","+ve+","+we+"M"+this.pen.x+","+this.pen.y}glow(){const i=this.paper.set();if(this.shadow_attributes.width>0){const y=this.shadow_attributes,C=y.width/2;for(let B=1;B<=C;B++)i.push(this.paper.path(this.path).attr({stroke:y.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(y.width/C*B).toFixed(3),opacity:+((y.opacity||.3)/C).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return i}fill(){const i=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(i),this}stroke(){const i=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,y=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",i);return this.glow(y),this}closePath(){return this.path+="Z",this}measureText(i){const y=this.paper.text(0,0,i).attr(this.attributes).attr("fill","none").attr("stroke","none"),C=y.getBBox();return y.remove(),{width:C.width,height:C.height}}fillText(i,y,C){return this.paper.text(y+this.measureText(i).width/2,C-this.state.font_size/(2.25*this.state.scale.y),i).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const i=this.state_stack.pop();return this.state.font_family=i.state.font_family,this.attributes.font=i.attributes.font,this.attributes.fill=i.attributes.fill,this.attributes.stroke=i.attributes.stroke,this.attributes["stroke-width"]=i.attributes["stroke-width"],this.shadow_attributes.width=i.shadow_attributes.width,this.shadow_attributes.color=i.shadow_attributes.color,this}}const E={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const Ie={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};h.Merge(E.rect,Ie),h.Merge(E.path,Ie)}class M{constructor(i){this.element=i,this.svgNS="http://www.w3.org/2000/svg";const y=this.create("svg");this.element.appendChild(y),this.svg=y,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(i){return document.createElementNS(this.svgNS,i)}openGroup(i,y,C){const B=this.create("g");return this.groups.push(B),this.parent.appendChild(B),this.parent=B,i&&B.setAttribute("class",h.Prefix(i)),y&&B.setAttribute("id",h.Prefix(y)),C&&C.pointerBBox&&B.setAttribute("pointer-events","bounding-box"),B}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(i){this.parent.appendChild(i)}iePolyfill(){typeof navigator<"u"&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(i,y,C){let B=!1,$=!1,Z="normal";typeof C=="string"&&(C.indexOf("italic")!==-1&&(C=C.replace(/italic/g,""),$=!0),C.indexOf("bold")!==-1&&(C=C.replace(/bold/g,""),B=!0),C=C.replace(/ /g,"")),Z=$?"italic":Z;const se={"font-family":i,"font-size":y+"pt","font-weight":C=(C=B?"bold":C)===void 0||C===""?"normal":C,"font-style":Z};return this.fontSize=Number(y),h.Merge(this.attributes,se),h.Merge(this.state,se),this}setRawFont(i){const y=(i=i.trim()).split(" ");return this.attributes["font-family"]=y[1],this.state["font-family"]=y[1],this.attributes["font-size"]=y[0],this.state["font-size"]=y[0],this.fontSize=Number(y[0].match(/\d+/)),this}setFillStyle(i){return this.attributes.fill=i,this}setBackgroundFillStyle(i){return this.background_attributes.fill=i,this.background_attributes.stroke=i,this}setStrokeStyle(i){return this.attributes.stroke=i,this}setShadowColor(i){return this.shadow_attributes.color=i,this}setShadowBlur(i){return this.shadow_attributes.width=i,this}setLineWidth(i){this.attributes["stroke-width"]=i,this.lineWidth=i}setLineDash(i){if(Object.prototype.toString.call(i)==="[object Array]")return i=i.join(", "),this.attributes["stroke-dasharray"]=i,this;throw new h.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(i){return this.attributes["stroke-linecap"]=i,this}resize(i,y){this.width=i,this.height=y,this.element.style.width=i;const C={width:i,height:y};return this.applyAttributes(this.svg,C),this.scale(this.state.scale.x,this.state.scale.y),this}scale(i,y){this.state.scale={x:i,y};const C=this.width/i,B=this.height/y;return this.setViewBox(0,0,C,B),this}setViewBox(...i){if(i.length===1){const[y]=i;this.svg.setAttribute("viewBox",y)}else{const[y,C,B,$]=i,Z=y+" "+C+" "+B+" "+$;this.svg.setAttribute("viewBox",Z)}}applyAttributes(i,y){const C=E[i.nodeName];return Object.keys(y).forEach(B=>{C&&C[B]||i.setAttributeNS(null,B,y[B])}),i}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(i,y,C,B,$){B<0&&(y+=B,B*=-1);const Z=this.create("rect");return $===void 0&&($={fill:"none","stroke-width":this.lineWidth,stroke:this.attributes.stroke}),h.Merge($,{x:i,y,width:C,height:B}),this.applyAttributes(Z,$),this.add(Z),this}fillRect(i,y,C,B){return B<0&&(y+=B,B*=-1),this.rect(i,y,C,B,this.attributes),this}clearRect(i,y,C,B){return this.rect(i,y,C,B,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(i,y){return this.path+="M"+i+" "+y,this.pen.x=i,this.pen.y=y,this}lineTo(i,y){return this.path+="L"+i+" "+y,this.pen.x=i,this.pen.y=y,this}bezierCurveTo(i,y,C,B,$,Z){return this.path+="C"+i+" "+y+","+C+" "+B+","+$+" "+Z,this.pen.x=$,this.pen.y=Z,this}quadraticCurveTo(i,y,C,B){return this.path+="Q"+i+" "+y+","+C+" "+B,this.pen.x=C,this.pen.y=B,this}arc(i,y,C,B,$,Z){function se(ve){for(;ve<0;)ve+=2*Math.PI;for(;ve>2*Math.PI;)ve-=2*Math.PI;return ve}if((B=se(B))>($=se($))){const ve=B;B=$,$=ve,Z=!Z}const ue=$-B;return ue>Math.PI?(this.arcHelper(i,y,C,B,B+ue/2,Z),this.arcHelper(i,y,C,B+ue/2,$,Z)):this.arcHelper(i,y,C,B,$,Z),this}arcHelper(i,y,C,B,$,Z){const se=i+C*Math.cos(B),ue=y+C*Math.sin(B),ve=i+C*Math.cos($),we=y+C*Math.sin($);let Pe=0,Ae=0;Z?(Ae=1,$-BMath.PI&&(Pe=1),this.path+="M"+se+" "+ue+" A"+C+" "+C+" 0 "+Pe+" "+Ae+" "+ve+" "+we,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const i=this.shadow_attributes,y=i.width/2;for(let C=1;C<=y;C++){const B={stroke:i.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*i.width/y*C).toFixed(3),opacity:+((i.opacity||.3)/y).toFixed(3)},$=this.create("path");B.d=this.path,this.applyAttributes($,B),this.add($)}}return this}fill(i){this.glow();const y=this.create("path");let C=i;return i===void 0?(h.Merge(i={},this.attributes),i.stroke="none",C=i):(C=i,h.Merge(C,this.attributes),i.class&&(C.class=i.class),i.id&&(C.id=i.id)),i.d=this.path,this.applyAttributes(y,i),this.add(y),this}stroke(i=void 0){this.glow();const y=this.create("path"),C={};return h.Merge(C,this.attributes),i&&h.Merge(C,i),C.fill="none",C["stroke-width"]=this.lineWidth,C.d=this.path,this.applyAttributes(y,C),this.add(y),this}measureText(i){const y=this.create("text");if(typeof y.getBBox!="function")return{x:0,y:0,width:0,height:0};y.textContent=i,this.applyAttributes(y,this.attributes),this.svg.appendChild(y);let C=y.getBBox();return this.ie&&i!==""&&this.attributes["font-style"]==="italic"&&(C=this.ieMeasureTextFix(C,i)),this.svg.removeChild(y),C}ieMeasureTextFix(i){const y=1.196*Number(this.fontSize)+1.9598,C=i.width-y,B=i.height-1.5;return{x:i.x,y:i.y,width:C,height:B}}fillText(i,y,C){if(!i||i.length<=0)return;const B={};h.Merge(B,this.attributes),B.stroke="none",B.x=y,B.y=C;const $=this.create("text");$.textContent=i,this.applyAttributes($,B),this.add($)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const i=this.state_stack.pop();return this.state["font-family"]=i.state["font-family"],this.state["font-weight"]=i.state["font-weight"],this.state["font-style"]=i.state["font-style"],this.state["font-size"]=i.state["font-size"],this.state.scale=i.state.scale,this.attributes["font-family"]=i.attributes["font-family"],this.attributes["font-weight"]=i.attributes["font-weight"],this.attributes["font-style"]=i.attributes["font-style"],this.attributes["font-size"]=i.attributes["font-size"],this.attributes.fill=i.attributes.fill,this.attributes.stroke=i.attributes.stroke,this.attributes["stroke-width"]=i.attributes["stroke-width"],this.attributes["stroke-dasharray"]=i.attributes["stroke-dasharray"],this.shadow_attributes.width=i.shadow_attributes.width,this.shadow_attributes.color=i.shadow_attributes.color,this.lineWidth=i.lineWidth,this}}let N=null;class I{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return N}static set lastContext(i){N=i}static buildContext(i,y,C,B,$){const Z=new I(i,y);C&&B&&Z.resize(C,B),$||($="#FFF");const se=Z.getContext();return se.setBackgroundFillStyle($),I.lastContext=se,se}static getCanvasContext(i,y,C,B){return I.buildContext(i,I.Backends.CANVAS,y,C,B)}static getRaphaelContext(i,y,C,B){return I.buildContext(i,I.Backends.RAPHAEL,y,C,B)}static getSVGContext(i,y,C,B){return I.buildContext(i,I.Backends.SVG,y,C,B)}static bolsterCanvasContext(i){return I.USE_CANVAS_PROXY?new P(i):(i.vexFlowCanvasContext=i,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach(y=>{i[y]=i[y]||P.prototype[y]}),i)}static drawDashedLine(i,y,C,B,$,Z){i.beginPath();const se=B-y,ue=$-C,ve=Math.atan2(ue,se);let we=y,Pe=C;i.moveTo(y,C);let Ae=0,Ce=!0;for(;!(se<0?we<=B:we>=B)||!(ue<0?Pe<=$:Pe>=$);){const Ve=Z[Ae++%Z.length],je=we+Math.cos(ve)*Ve;we=se<0?Math.max(B,je):Math.min(B,je);const $e=Pe+Math.sin(ve)*Ve;Pe=ue<0?Math.max($,$e):Math.min($,$e),Ce?i.lineTo(we,Pe):i.moveTo(we,Pe),Ce=!Ce}i.closePath(),i.stroke()}constructor(i,y){if(this.elementId=i,!this.elementId)throw new h.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(i),this.element||(this.element=i),this.ctx=null,this.paper=null,this.backend=y,this.backend===I.Backends.CANVAS){if(!this.element.getContext)throw new h.RERR("BadElement",`Can't get canvas context from element: ${i}`);this.ctx=I.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0}))}else if(this.backend===I.Backends.RAPHAEL)this.ctx=new _(this.element);else{if(this.backend!==I.Backends.SVG)throw new h.RERR("InvalidBackend",`No support for backend: ${this.backend}`);this.ctx=new M(this.element)}}resize(i,y){if(this.backend===I.Backends.CANVAS){if(!this.element.getContext)throw new h.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[i,y]=P.SanitizeCanvasDims(i,y);const C=window.devicePixelRatio||1;this.element.width=i*C,this.element.height=y*C,this.element.style.width=i+"px",this.element.style.height=y+"px",this.ctx=I.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0})),this.ctx.scale(C,C)}else this.ctx.resize(i,y);return this}getContext(){return this.ctx}}class R extends u{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return T.STEM_WIDTH}static get HEIGHT(){return T.STEM_HEIGHT}constructor(i={}){super(),this.setAttribute("type","Stem"),this.x_begin=i.x_begin||0,this.x_end=i.x_end||0,this.y_top=i.y_top||0,this.y_bottom=i.y_bottom||0,this.stem_extension=i.stem_extension||0,this.stem_direction=i.stem_direction||0,this.hide=i.hide||!1,this.isStemlet=i.isStemlet||!1,this.stemletHeight=i.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(i)}setOptions(i){this.stem_up_y_offset=i.stem_up_y_offset||0,this.stem_down_y_offset=i.stem_down_y_offset||0}setNoteHeadXBounds(i,y){return this.x_begin=i,this.x_end=y,this}setDirection(i){this.stem_direction=i}setExtension(i){this.stem_extension=i}getExtension(){return this.stem_extension}setYBounds(i,y){this.y_top=i,this.y_bottom=y}getCategory(){return R.CATEGORY}getHeight(){const i=this.stem_direction===R.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(R.HEIGHT-i+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new h.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const i=this.stem_direction===R.UP,y=[this.y_top,this.y_bottom],C=R.HEIGHT+this.stem_extension,B=(i?Math.min:Math.max)(...y),$=(i?Math.max:Math.min)(...y);return{topY:B+C*-this.stem_direction,baseY:$}}setVisibility(i){return this.hide=!i,this}setStemlet(i,y){return this.isStemlet=i,this.stemletHeight=y,this}draw(){if(this.setRendered(),this.hide)return;const i=this.checkContext();let y,C;const B=this.stem_direction;B===R.DOWN?(y=this.x_begin,C=this.y_top+this.stem_down_y_offset):(y=this.x_end,C=this.y_bottom-this.stem_up_y_offset);const $=this.getHeight();(function(...se){R.DEBUG&&h.L("Vex.Flow.Stem",se)})("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const Z=this.isStemlet?$-this.stemletHeight*this.stem_direction:0;if(i.save(),this.applyStyle(i),i.beginPath(),i.setLineWidth(R.WIDTH),i.moveTo(y,C-Z),i.lineTo(y,C-$-this.renderHeightAdjustment*B),i.svg){const se={class:h.Prefix("stem")};this.id&&(se.id=this.id),i.stroke(se)}else i.stroke();this.restoreStyle(i),i.restore()}}class V extends u{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(i,y){if(super(),this.setAttribute("type","Tuplet"),!i||!i.length)throw new h.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=h.Merge({},y),this.notes=i,this.num_notes="num_notes"in this.options?this.options.num_notes:i.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=i.some(C=>C.beam===null),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||V.LOCATION_TOP,Et.AlignRestsToNotes(i,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let i=0;i=1;)this.numerator_glyphs.unshift(new S("v"+i%10,this.point)),i=parseInt(i/10,10);for(this.denom_glyphs=[],i=this.notes_occupied;i>=1;)this.denom_glyphs.unshift(new S("v"+i%10,this.point)),i=parseInt(i/10,10)}getNestedTupletCount(){const i=this.location,y=this.notes[0];let C=$(y,i),B=$(y,i);function $(Z,se){return Z.tupletStack.filter(ue=>ue.location===se).length}return this.notes.forEach(Z=>{const se=$(Z,i);C=se>C?se:C,B=seB&&(B=Z)}}return B+i+y}draw(){this.checkContext(),this.setRendered();const i=this.notes[0],y=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=i.getTieLeftX()-5,this.width=y.getTieRightX()-this.x_pos+5):(this.x_pos=i.getStemX(),this.width=y.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const C=(Z,se)=>Z+se.getMetrics().width;let B=this.numerator_glyphs.reduce(C,0);this.ratioed&&(B=this.denom_glyphs.reduce(C,B),B+=.32*this.point);const $=this.x_pos+this.width/2-B/2;if(this.bracketed){const Z=this.width/2-B/2-5;Z>0&&(this.context.fillRect(this.x_pos,this.y_pos,Z,1),this.context.fillRect(this.x_pos+this.width/2+B/2+5,this.y_pos,Z,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===V.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===V.LOCATION_BOTTOM),1,10*this.location))}if(this.RenderTupletNumber!==!1){let Z=0;this.numerator_glyphs.forEach(se=>{se.render(this.context,$+Z,this.y_pos+this.point/3-2),Z+=se.getMetrics().width})}if(this.ratioed){const Z=$+x_offset+.16*this.point,se=.06*this.point;this.context.beginPath(),this.context.arc(Z,this.y_pos-.08*this.point,se,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(Z,this.y_pos+.12*this.point,se,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),x_offset+=.32*this.point,this.denom_glyphs.forEach(ue=>{ue.render(this.context,$+x_offset,this.y_pos+this.point/3-2),x_offset+=ue.getMetrics().width})}}}function U(Ie){let i=0;return Ie.forEach(y=>{y.keyProps&&y.keyProps.forEach(C=>{i+=C.line-3})}),i>=0?R.DOWN:R.UP}const K="L",k="B";class W extends u{static getDefaultBeamGroups(i){i&&i!=="c"||(i="4/4");const y={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[i];if(y!==void 0)return y.map(C=>new s().parse(C));{const C=parseInt(i.split("/")[0],10),B=parseInt(i.split("/")[1],10);if(C%3==0)return[new s(3,B)];if(B>4)return[new s(2,B)];if(B<=4)return[new s(1,B)]}return[new s(1,4)]}static applyAndGetBeams(i,y,C){return W.generateBeams(i.getTickables(),{groups:C,stem_direction:y})}static generateBeams(i,y){y||(y={}),y.groups&&y.groups.length||(y.groups=[new s(2,8)]);const C=y.groups.map(Ae=>{if(!Ae.multiply)throw new h.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return Ae.clone().multiply(T.RESOLUTION,1)}),B=i;let $=0,Z=[],se=[];function ue(){C.length-1>$?$+=1:$=0}(function(){let Ae=[];B.forEach(Ce=>{if(Ae=[],Ce.shouldIgnoreTicks())return Z.push(se),void(se=Ae);se.push(Ce);const Ve=C[$].clone(),je=se.reduce((Je,pt)=>pt.getTicks().clone().add(Je),new s(0,1)),$e=T.durationToNumber(Ce.duration)<8;$e&&Ce.tuplet&&(Ve.numerator*=2),je.greaterThan(Ve)?($e||Ae.push(se.pop()),Z.push(se),se=Ae,ue()):je.equals(Ve)&&(Z.push(se),se=Ae,ue())}),se.length>0&&Z.push(se)})(),function(){const Ae=[];Z.forEach(Ce=>{let Ve=[];Ce.forEach((je,$e,Je)=>{const pt=$e===0||$e===Je.length-1,ht=Je[$e-1],bt=!y.beam_rests&&je.isRest(),kt=y.beam_rests&&y.beam_middle_only&&je.isRest()&&pt;let zt=!1;if(y.maintain_stem_directions&&ht&&!je.isRest()&&!ht.isRest()){const Cn=ht.getStemDirection();zt=je.getStemDirection()!==Cn}const tn=parseInt(je.duration,10)<8;bt||kt||zt||tn?(Ve.length>0&&Ae.push(Ve),Ve=zt?[je]:[]):Ve.push(je)}),Ve.length>0&&Ae.push(Ve)}),Z=Ae}(),Z.forEach(Ae=>{let Ce;if(y.maintain_stem_directions){const Ve=function(je){for(let $e=0;$e{$e.setStemDirection(je)})})(Ae,Ce)});const ve=Z.filter(Ae=>{if(Ae.length>1){let Ce=!0;return Ae.forEach(Ve=>{Ve.getIntrinsicTicks()>=T.durationToTicks("4")&&(Ce=!1)}),Ce}return!1}),we=function(){const Ae=[];return Z.forEach(Ce=>{let Ve=null;Ce.forEach(je=>{je.tuplet&&Ve!==je.tuplet&&(Ve=je.tuplet,Ae.push(Ve))})}),Ae}(),Pe=[];return ve.forEach(Ae=>{const Ce=new W(Ae);y.show_stemlets&&(Ce.render_options.show_stemlets=!0),y.secondary_breaks&&(Ce.render_options.secondary_break_ticks=T.durationToTicks(y.secondary_breaks)),y.flat_beams===!0&&(Ce.render_options.flat_beams=!0,Ce.render_options.flat_beam_offset=y.flat_beam_offset),Pe.push(Ce)}),we.forEach(Ae=>{const Ce=Ae.notes[0].stem_direction===R.DOWN?V.LOCATION_BOTTOM:V.LOCATION_TOP;Ae.setTupletLocation(Ce);let Ve=!1;for(let je=0;je=T.durationToTicks("4"))throw new h.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let C,B;for(this.stem_direction=R.UP,C=0;Cse+ue.stem_direction,0)>-1?R.UP:R.DOWN),C=0;Ci.getGlyph().beam_count).reduce((i,y)=>y>i?y:i)}breakSecondaryAt(i){return this.break_on_indices=i,this}getSlopeY(i,y,C,B){return C+(i-y)*B}calculateSlope(){const{notes:i,stem_direction:y,render_options:{max_slope:C,min_slope:B,slope_iterations:$,slope_cost:Z}}=this,se=i[0],ue=((Ce,Ve)=>{const je=Ce.getStemExtents().topY,$e=Ce.getStemX();return(Ve.getStemExtents().topY-je)/(Ve.getStemX()-$e)})(se,i[i.length-1]),ve=(C-B)/$;let we=Number.MAX_VALUE,Pe=0,Ae=0;for(let Ce=B;Ce<=C;Ce+=ve){let Ve=0,je=0;for(let pt=1;ptje)&&(ve=je,se=Math.min(...Ve.getYs()),ue=Ve.getBeamCount())}let we=Z/i.length;const Pe=B+ue*(1.5*C),Ae=se+Pe*-y;y===R.DOWN&&weAe&&(we=se-Pe),$+this.render_options.flat_beam_offset_per_beam>0?(y===R.DOWN&&we>$&&!this.render_options.flat_beams||y===R.UP&&we<$&&!this.render_options.flat_beams)&&(this.render_options.flat_beam_offset=we):this.render_options.flat_beam_offset=we,this.slope=0,this.y_shift=0}getBeamYToDraw(){let i=this.notes[0].getStemExtents().topY;if(this.render_options.flat_beams&&this.render_options.flat_beam_offset+this.render_options.flat_beam_offset_per_beam>0){let y=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(y+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let C=this.notes[0].note_heads[0].y;const B=this.stem_direction>0?Math.min:Math.max;for(const $ of this.notes)for(const Z of $.note_heads)C=B(C,Z.y);i=C+y*-this.stem_direction}return i}applyStemExtensions(){const{notes:i,slope:y,y_shift:C,stem_direction:B,beam_count:$,render_options:{show_stemlets:Z,stemlet_extension:se,beam_width:ue}}=this,ve=i[0],we=this.getBeamYToDraw(),Pe=ve.getStemX();for(let Ae=0;Ae=8&&(Ae=this.break_on_indices.indexOf(we)!==-1,this.render_options.secondary_break_ticks&&ue>=this.render_options.secondary_break_ticks&&(ue=0,Ae=!0));const Ce=Pe.getIntrinsicTicks(){i.getStem()&&(this.context.openGroup("stem",i.getAttribute("id")+"-stem"),i.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const i=["4","8","16","32","64"],y=this.notes[0];let C=this.getBeamYToDraw();const B=y.getStemX(),$=this.render_options.beam_width*this.stem_direction,Z={};for(const se of this.notes)Z[se.getAttribute("id")]=0;for(let se=0;se{i.getStave()||i.setStave(this.stave)}),this.preFormatted=!0),this}draw(i=this.context,y=this.stave){this.setRendered();let C=null;for(let B=0;B0&&C){const Z=$.getBoundingBox();Z&&C.mergeWith(Z)}$.setContext(i),$.drawWithStyle()}this.boundingBox=C}}function X(Ie,i,y,C,B){if(i!==L.type.BOLD_DOUBLE_LEFT&&i!==L.type.BOLD_DOUBLE_RIGHT)throw new h.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let $=3,Z=3.5;i===L.type.BOLD_DOUBLE_RIGHT&&($=-5,Z=3),Ie.fillRect(y+$,C,1,B-C),Ie.fillRect(y-2,C,Z,B-C)}class L extends u{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:L.type.SINGLE_RIGHT,singleLeft:L.type.SINGLE_LEFT,single:L.type.SINGLE,double:L.type.DOUBLE,brace:L.type.BRACE,bracket:L.type.BRACKET,boldDoubleLeft:L.type.BOLD_DOUBLE_LEFT,boldDoubleRight:L.type.BOLD_DOUBLE_RIGHT,thinDouble:L.type.THIN_DOUBLE,none:L.type.NONE}}constructor(i,y){super(),this.setAttribute("type","StaveConnector"),this.thickness=T.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=i,this.bottom_stave=y,this.type=L.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(i){return(i=typeof i=="string"?L.typeString[i]:i)>=L.type.SINGLE_RIGHT&&i<=L.type.NONE&&(this.type=i),this}setText(i,y){return this.texts.push({content:i,options:h.Merge({shift_x:0,shift_y:0},y)}),this}setFont(i){h.Merge(this.font,i)}setXShift(i){if(typeof i!="number")throw h.RERR("InvalidType","x_shift must be a Number");return this.x_shift=i,this}draw(){const i=this.checkContext();this.setRendered();let y=this.top_stave.getYForLine(0),C=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,B=this.width,$=this.top_stave.getX();(this.type===L.type.SINGLE_RIGHT||this.type===L.type.BOLD_DOUBLE_RIGHT||this.type===L.type.THIN_DOUBLE)&&($=this.top_stave.getX()+this.top_stave.width);let Z=C-y;switch(this.type){case L.type.SINGLE:case L.type.SINGLE_LEFT:case L.type.SINGLE_RIGHT:B=1;break;case L.type.DOUBLE:$-=this.width+2;break;case L.type.BRACE:{B=12;const se=this.top_stave.getX()-2+this.x_shift,ue=y,ve=se,we=C,Pe=se-B,Ae=ue+Z/2,Ce=Pe-.9*B,Ve=ue+.2*Z,je=se+1.1*B,$e=Ae-.135*Z,Je=je,pt=Ae+.135*Z,ht=Ce,bt=we-.2*Z,kt=Pe-B,zt=bt,tn=se+.4*B,Cn=Ae+.135*Z,Sn=tn,Ai=Ae-.135*Z,ei=kt,ti=Ve;i.beginPath(),i.moveTo(se,ue),i.bezierCurveTo(Ce,Ve,je,$e,Pe,Ae),i.bezierCurveTo(Je,pt,ht,bt,ve,we),i.bezierCurveTo(kt,zt,tn,Cn,Pe,Ae),i.bezierCurveTo(Sn,Ai,ei,ti,se,ue),i.fill(),i.stroke();break}case L.type.BRACKET:y-=4,C+=4,Z=C-y,S.renderGlyph(i,$-5,y-3,40,"v1b",!0),S.renderGlyph(i,$-5,C+3,40,"v10",!0),$-=this.width+2;break;case L.type.BOLD_DOUBLE_LEFT:X(i,this.type,$+this.x_shift,y,C);break;case L.type.BOLD_DOUBLE_RIGHT:X(i,this.type,$,y,C);break;case L.type.THIN_DOUBLE:B=1;break;case L.type.NONE:break;default:throw new h.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==L.type.BRACE&&this.type!==L.type.BOLD_DOUBLE_LEFT&&this.type!==L.type.BOLD_DOUBLE_RIGHT&&this.type!==L.type.NONE&&i.fillRect($,y,B,Z),this.type===L.type.THIN_DOUBLE&&i.fillRect($-3,y,B,Z),i.save(),i.lineWidth=2,i.setFont(this.font.family,this.font.size,this.font.weight);for(let se=0;se0){const $e=je.space.deviation,Je=$e>=0?"+":"";i.setFillStyle("red"),i.fillText(Je+Math.round($e),se+y.getXShift(),C-10)}i.restore()}constructor(i){if(super(),this.setAttribute("type","Note"),!i)throw new h.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const y=T.parseNoteStruct(i);if(!y)throw new h.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(i)}`);if(this.duration=y.duration,this.dots=y.dots,this.noteType=y.type,this.customTypes=y.customTypes,i.duration_override?this.setDuration(i.duration_override):this.setIntrinsicTicks(y.ticks),this.modifiers=[],this.glyph=T.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(C=>T.getGlyphProps(this.duration,C)),this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new h.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],i.align_center&&this.setCenterAlignment(i.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:ne.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(i){return this.playNote=i,this}isRest(){return!1}addStroke(i,y){return y.setNote(this),y.setIndex(i),this.modifiers.push(y),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(i){return this.stave=i,this.setYs([i.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return ne.CATEGORY}setContext(i){return this.context=i,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(i){return this.extraLeftPx=i,this}setExtraRightPx(i){return this.extraRightPx=i,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth(this.render_options.glyph_font_scale)}setYs(i){return this.ys=i,this}getYs(){if(this.ys.length===0)throw new h.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(i){if(!this.stave)throw new h.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(i)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new h.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(i){return this.voice=i,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(i){return this.tickContext=i,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(i){return this.modifierContext=i,this}addModifier(i,y=0){return i.setNote(this),i.setIndex(y),this.modifiers.push(i),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let i=0,y=0;this.modifierContext!=null&&(i=this.modifierContext.state.left_shift,y=this.modifierContext.state.right_shift);const C=this.getWidth();return{width:C,noteWidth:C-i-y-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:i,modRightPx:y,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(i){this.width=i}getWidth(){if(!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(i){return this.x_shift=i,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new h.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new h.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let i=this.tickContext.getX();return this.stave&&(i+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(i+=this.getCenterXShift()),i}setPreFormatted(i){if(this.preFormatted=i,this.preFormatted){const y=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,y.left),this.right_modPx=Math.max(this.right_modPx,y.right)}}}class ie extends ne{static get CATEGORY(){return"notehead"}constructor(i){if(super(i),this.setAttribute("type","NoteHead"),this.index=i.index,this.x_shift=i.x_shift||0,this.x=(i.x||0)+this.x_shift,this.y=i.y||0,this.note_type=i.note_type,this.duration=i.duration,this.displaced=i.displaced||!1,this.stem_direction=i.stem_direction||ee.STEM_UP,this.line=i.line,this.glyph=T.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new h.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift_ledger_rest=0,this.y_shift_ledger_rest=0,this.x_shift=i.x_shift||0,this.glyph.rest&&(this.line>5||this.line<0)&&(this.isLedgerLinedRest=!0,this.duration==="h"?(i.custom_glyph_code="rhl",this.x_shift_ledger_rest-=4):this.duration==="w"&&(i.custom_glyph_code="rwl",this.x_shift_ledger_rest-=4,this.y_shift_ledger_rest=-5)),i.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=i.custom_glyph_code,this.stem_up_x_offset=i.stem_up_x_offset||0,this.stem_down_x_offset=i.stem_down_x_offset||0,this.stem_up_y_shift=i.stem_up_y_shift||0,this.stem_down_y_shift=i.stem_down_y_shift||0),this.style=i.style,this.slashed=i.slashed,h.Merge(this.render_options,{glyph_font_scale:i.glyph_font_scale||T.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return ie.CATEGORY}getWidth(){return this.width}isDisplaced(){return this.displaced===!0}getGlyph(){return this.glyph}setX(i){return this.x=i,this}getY(){return this.y}setY(i){return this.y=i,this}getLine(){return this.line}setLine(i){return this.line=i,this}getAbsoluteX(){const i=this.preFormatted?super.getAbsoluteX():this.x,y=R.WIDTH/2;return i+(this.displaced?(this.width-y)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const i=this.stave.getSpacingBetweenLines(),y=i/2,C=this.y-y;return new T.BoundingBox(this.getAbsoluteX(),C,this.width,i)}setStave(i){const y=this.getLine();return this.stave=i,this.setY(i.getYForNote(y)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const i=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(i),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const i=this.context;let y=this.getAbsoluteX(),C=this.y;this.custom_glyph&&(y+=this.x_shift_ledger_rest,this.stem_direction===R.UP?(y+=this.stem_up_x_offset,C+=this.stem_up_y_shift||0):this.stem_direction===R.DOWN&&(y+=this.stem_down_x_offset,C+=this.stem_down_y_shift||0),C+=this.y_shift_ledger_rest),function(...Z){ie.DEBUG&&h.L("Vex.Flow.NoteHead",Z)}("Drawing note head '",this.note_type,this.duration,"' at",y,C);const B=this.stem_direction,$=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(i),this.note_type==="s"){const Z=this.stave.getSpacingBetweenLines();(function(se,ue,ve,we,Pe,Ae){const Ce=T.SLASH_NOTEHEAD_WIDTH;se.save(),se.setLineWidth(T.STEM_WIDTH);let Ve=!1;if(T.durationToNumber(ue)>2&&(Ve=!0),Ve||(ve-=T.STEM_WIDTH/2*Pe),se.beginPath(),se.moveTo(ve,we+Ae),se.lineTo(ve,we+1),se.lineTo(ve+Ce,we-Ae),se.lineTo(ve+Ce,we),se.lineTo(ve,we+Ae),se.closePath(),Ve?se.fill():se.stroke(),T.durationToFraction(ue).equals(.5)){const je=[-3,-1,Ce+1,Ce+3];for(let $e=0;$e{const se=Z.getTickContext();Z.setStave(y.stave),se.setXOffset($)})}}class ge extends ae{static get CATEGORY(){return"dots"}static format(i,y){const C=y.right_shift;if(!i||i.length===0)return!1;const B=[],$={};for(let Ae=0;AeCe.line-Ae.line);let Z=C,se=0,ue=null,ve=null,we=null,Pe=0;for(let Ae=0;Aese?Z:se,ue=$e,ve=Ve}return y.right_shift+=se,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=ae.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return ge.CATEGORY}setNote(i){this.note=i,this.note.getCategory()==="gracenotes"&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(i){return this.dot_shiftY=i,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index===null)throw new h.RERR("NoAttachedNote","Can't draw dot without a note and index.");const i=this.note.stave.options.spacing_between_lines_px,y=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.note.getCategory()==="tabnotes"&&(y.y=this.note.getStemExtents().baseY);const C=y.x+this.x_shift+this.width-this.radius,B=y.y+this.y_shift+this.dot_shiftY*i,$=this.context;$.beginPath(),$.arc(C,B,this.radius,0,2*Math.PI,!1),$.fill()}}function ce(Ie,i,y){if(Ie.note.shiftRestVerticalDisabled)return;const C=(i.isrest?0:1)*y;Ie.line+=C,Ie.maxLine+=C,Ie.minLine+=C,Ie.note.setKeyLine(0,Ie.note.getKeyLine(0)+C)}class ee extends be{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return R.UP}static get STEM_DOWN(){return R.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static format(i,y){if(!i||i.length<2)return!1;const C=[],B=i[0].stagger_same_whole_notes;for(let Ae=0;Ae2?C[1]:null;let ue=$>2?C[2]:C[1];$!==2||Z.stemDirection!==-1||ue.stemDirection!==1||Z.isrest||ue.isRest||(Z=C[1],ue=C[0]);const ve=Math.max(Z.voice_shift,ue.voice_shift);let we,Pe=0;if($===2){const Ae=Z.stemDirection===ue.stemDirection?0:.5;if(Z.stemDirection===ue.stemDirection&&Z.minLine<=ue.maxLine&&(Z.isrest||(we=Math.abs(Z.line-(ue.maxLine+.5)),we=Math.max(we,Z.stemMin),Z.minLine=Z.line-we,Z.note.setStemLength(10*we))),Z.minLine<=ue.maxLine+Ae)if(Z.isrest)ce(Z,ue,1),Z.note.hasLedgerLinedRest&&(Z.note.shiftRestVerticalDisabled=!0);else if(ue.isrest)ce(ue,Z,-1),ue.note.hasLedgerLinedRest&&(ue.note.shiftRestVerticalDisabled=!0);else{Pe=ve;const Ce=Math.abs(Z.line-ue.line);let Ve=0,je=0;Z.note.duration==="h"?Ve++:Z.note.duration==="w"&&je++,ue.note.duration==="h"?Ve++:ue.note.duration==="w"&&je++;let $e=Ve===1||je===1||Z.note.dots!==ue.note.dots;if(B&&($e=$e||je===2),Ce===0&&$e){if(ue.note.setXShift(Pe),Z.note.dots>0){let Je=0;for(const pt of Z.note.modifiers)if(pt instanceof ge&&(Je++,pt.setYShift(-10*(ue.maxLine-Z.line+1)),Je===Z.note.dots))break}}else Ce<1&&Ce>0?ue.note.setXShift(Pe):Z.note.voice!==ue.note.voice&&Z.stemDirection===ue.stemDirection&&(Z.line>ue.line?Z.stemDirection===1?ue.note.renderFlag=!1:Z.note.renderFlag=!1:ue.line>Z.line?ue.stemDirection===1?Z.note.renderFlag=!1:ue.note.renderFlag=!1:ue.stemDirection===1&&(ue.stemDirection=-1,ue.note.setStemDirection(-1)))}return!0}return se!==null&&se.minLiney.postFormat()),!0)}constructor(i){if(super(i),this.setAttribute("type","StaveNote"),this.keys=i.keys,this.clef=i.clef,this.octave_shift=i.octave_shift,this.beam=null,this.glyph=T.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new h.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(i)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.paddingRight=0,this.note_heads=[],this.modifiers=[],h.Merge(this.render_options,{glyph_font_scale:i.glyph_font_scale||T.DEFAULT_NOTATION_FONT_SCALE,stroke_px:i.stroke_px||ee.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),i.auto_stem?this.autoStem():this.setStemDirection(i.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const i=this.note_heads.map(C=>C.getStyle()),y=[];this.note_heads.forEach(C=>y.push(C.note_type)),this.buildNoteHeads(),this.note_heads.forEach((C,B)=>{C.setStyle(i[B]),y[B]&&(C.note_type=y[B])}),this.stave&&this.note_heads.forEach(C=>C.setStave(this.stave)),this.calcExtraPx()}setBeam(i){return this.beam=i,this.calcExtraPx(),this}getCategory(){return ee.CATEGORY}buildStem(){this.setStem(new R({hide:!!this.isRest()})),this.stem.id=h.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const i=this.getStemDirection(),y=this.getKeys();let C,B,$,Z=null,se=null,ue=!1;i===R.UP?(C=0,B=y.length,$=1):i===R.DOWN&&(C=y.length-1,B=-1,$=-1);for(let ve=C;ve!==B;ve+=$){const we=this.keyProps[ve],Pe=we.line;Z===null?Z=Pe:(se=Math.abs(Z-Pe),se===0||se===.5?ue=!ue:(ue=!1,this.use_default_head_x=!0)),Z=Pe;const Ae=new ie({duration:this.duration,note_type:this.noteType,displaced:ue,stem_direction:i,custom_glyph_code:we.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:we.shift_right,stem_up_x_offset:we.stem_up_x_offset,stem_down_x_offset:we.stem_down_x_offset,stem_up_y_shift:we.stem_up_y_shift,stem_down_y_shift:we.stem_down_y_shift,line:we.line});Ae.isLedgerLinedRest&&(this.hasLedgerLinedRest=!0),this.note_heads[ve]=Ae}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const i=(this.minLine+this.maxLine)/2<3?R.UP:R.DOWN;this.setStemDirection(i)}calculateKeyProps(){let i=null;for(let y=0;y0&&(this.keyProps[y-1].displaced=!0)),i=Z,this.keyProps.push($)}i=-1/0,this.keyProps.forEach(y=>{y.liney.line-C.line)}getBoundingBox(){if(!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:i,modLeftPx:y,extraLeftPx:C}=this.getMetrics(),B=this.getAbsoluteX()-y-C-this.paddingRight;let $=0,Z=0;const se=this.getStave().getSpacingBetweenLines()/2,ue=2*se;if(this.isRest()){const ve=this.ys[0],we=T.durationToFraction(this.duration);we.equals(1)||we.equals(2)?($=ve-se,Z=ve+se):($=ve-this.glyph.line_above*ue,Z=ve+this.glyph.line_below*ue)}else if(this.glyph.stem){const ve=this.getStemExtents();ve.baseY+=se*this.stem_direction,$=Math.min(ve.topY,ve.baseY),Z=Math.max(ve.topY,ve.baseY)}else{$=null,Z=null;for(let ve=0;vey&&(y=B):B1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return this.noteType==="r"?this.getCenterGlyphX():super.getStemX()+R.WIDTH/(2*-this.getStemDirection())}getYForTopText(i){const y=this.getStemExtents();return Math.min(this.stave.getYForTopText(i),y.topY-this.render_options.annotation_spacing*(i+1))}getYForBottomText(i){const y=this.getStemExtents();return Math.max(this.stave.getYForTopText(i),y.baseY+this.render_options.annotation_spacing*i)}setStave(i){super.setStave(i);const y=this.note_heads.map(C=>(C.setStave(i),C.getY()));if(this.setYs(y),this.stem){const{y_top:C,y_bottom:B}=this.getNoteHeadBounds();this.stem.setYBounds(C,B)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(i){return this.displaced=i,this}getTieRightX(){let i=this.getAbsoluteX();return i+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(i+=this.modifierContext.getExtraRightPx()),i}getTieLeftX(){let i=this.getAbsoluteX();return i+=this.x_shift-this.extraLeftPx,i}getLineForRest(){let i=this.keyProps[0].line;if(this.keyProps.length>1){const y=this.keyProps[this.keyProps.length-1].line,C=Math.max(i,y),B=Math.min(i,y);i=h.MidLine(C,B)}return i}getModifierStartXY(i,y,C){if(C=C||{},!this.preFormatted)throw new h.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length===0)throw new h.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:B,BELOW:$,LEFT:Z,RIGHT:se}=ae.Position;let ue=0;return i===Z?ue=-2:i===se?(ue=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===R.UP&&this.hasFlag()&&(C.forceFlagRight||((ve,we)=>we===(ve.getStemDirection()===R.UP?ve.keyProps.length-1:0))(this,y))&&(ue+=this.flag.getMetrics().width)):i!==$&&i!==B||(ue=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+ue,y:this.ys[y]}}setStyle(i){super.setStyle(i),this.note_heads.forEach(y=>y.setStyle(i)),this.stem&&this.stem.setStyle(i)}setStemStyle(i){this.stem&&this.getStem().setStyle(i)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(i){this.ledgerLineStyle=i}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(i){this.flagStyle=i}getFlagStyle(){return this.flagStyle}setKeyStyle(i,y){return this.note_heads[i].setStyle(y),this}setKeyLine(i,y){return this.keyProps[i].line=y,this.reset(),this}getKeyLine(i){return this.keyProps[i].line}addToModifierContext(i){this.setModifierContext(i);for(let y=0;y{const Ae=Pe.getLine(),Ce=Pe.getY();(i===null||Cey)&&(y=Ce),B===null&&Pe.isDisplaced()&&(B=Pe.getAbsoluteX()),C!==null||Pe.isDisplaced()||(C=Pe.getAbsoluteX()),$=Ae>$?Ae:$,Z=Ae{let kt;kt=bt&&ht?je-C:ht?Ve-C:Ce-C;const zt=ht&&bt?Z:$;B.beginPath(),B.moveTo(kt,pt),B.lineTo(kt+zt,pt),B.stroke()},Je={...i.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(B,Je);for(let pt=6;pt<=se;++pt){const ht=Ve!==null&&pt<=we,bt=Ce!==null&&pt<=ve;$e(i.getYForNote(pt),ht,bt)}for(let pt=0;pt>=ue;--pt){const ht=Ve!==null&&pt>=Ae,bt=Ce!==null&&pt>=Pe;$e(i.getYForNote(pt),ht,bt)}this.restoreStyle(B,Je)}drawModifiers(){if(!this.context)throw new h.RERR("NoCanvasContext","Can't draw without a canvas context.");const i=this.context;i.openGroup("modifiers");for(let y=0;y{this.context.openGroup("notehead",null,{pointerBBox:!0}),i.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(i){if(!this.context)throw new h.RERR("NoCanvasContext","Can't draw without a canvas context.");i&&this.setStem(new R(i)),this.stem.id=h.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new h.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new h.RERR("NoStave","Can't draw without a stave.");if(this.ys.length===0)throw new h.RERR("NoYValues","Can't draw note without Y values.");const i=this.getNoteHeadBeginX(),y=this.hasStem()&&!this.beam;if(this.note_heads.forEach(C=>C.setX(i)),this.stem){const C=this.getStemX();this.stem.setNoteHeadXBounds(C,C)}(function(...C){ee.DEBUG&&h.L("Vex.Flow.StaveNote",C)})("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),y&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class ye extends ae{static get CATEGORY(){return"frethandfinger"}static format(i,y){const{left_shift:C,right_shift:B}=y;if(!i||i.length===0)return!1;const $=[];let Z=null,se=0,ue=0;for(let je=0;je$e.line-je.line);let ve=0,we=0,Pe=0,Ae=0,Ce=null,Ve=null;for(let je=0;je<$.length;++je){let $e=0;const{note:Je,pos:pt,num:ht,line:bt,shiftL:kt,shiftR:zt}=$[je];bt===Ce&&Je===Ve||(ve=C+kt,we=B+zt);const tn=ht.getWidth()+1;pt===ae.Position.LEFT?(ht.setXShift(C+ve),$e=C+tn,Pe=$e>Pe?$e:Pe):pt===ae.Position.RIGHT&&(ht.setXShift(we),$e=ue+tn,Ae=$e>Ae?$e:Ae),Ce=bt,Ve=Je}return y.left_shift+=Pe,y.right_shift+=Ae,!0}constructor(i){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=i,this.width=7,this.position=ae.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return ye.CATEGORY}setFretHandFinger(i){return this.finger=i,this}setOffsetX(i){return this.x_offset=i,this}setOffsetY(i){return this.y_offset=i,this}draw(){if(this.checkContext(),!this.note||this.index==null)throw new h.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const i=this.context,y=this.note.getModifierStartXY(this.position,this.index);let C=y.x+this.x_shift+this.x_offset,B=y.y+this.y_shift+this.y_offset+5;switch(this.position){case ae.Position.ABOVE:C-=4,B-=12;break;case ae.Position.BELOW:C-=2,B+=10;break;case ae.Position.LEFT:C-=this.width;break;case ae.Position.RIGHT:C+=1;break;default:throw new h.RERR("InvalidPostion",`The position ${this.position} does not exist`)}i.save(),i.setFont(this.font.family,this.font.size,this.font.weight),i.fillText(""+this.finger,C,B),i.restore()}}class Ee{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:Ee.scales.major,m:Ee.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(i){return!(i==null||i<0||i>=Ee.NUM_TONES)}isValidIntervalValue(i){return this.isValidNoteValue(i)}getNoteParts(i){if(!i||i.length<1)throw new h.RERR("BadArguments","Invalid note name: "+i);if(i.length>3)throw new h.RERR("BadArguments","Invalid note name: "+i);const y=i.toLowerCase(),C=/^([cdefgab])(b|bb|n|#|##)?$/.exec(y);if(C!=null)return{root:C[1],accidental:C[2]};throw new h.RERR("BadArguments","Invalid note name: "+i)}getKeyParts(i){if(!i||i.length<1)throw new h.RERR("BadArguments","Invalid key: "+i);const y=i.toLowerCase(),C=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(y);if(C!=null){const B=C[1],$=C[2];let Z=C[3];return Z||(Z="M"),{root:B,accidental:$,type:Z}}throw new h.RERR("BadArguments",`Invalid key: ${i}`)}getNoteValue(i){const y=Ee.noteValues[i];if(y==null)throw new h.RERR("BadArguments",`Invalid note name: ${i}`);return y.int_val}getIntervalValue(i){const y=Ee.intervals[i];if(y==null)throw new h.RERR("BadArguments",`Invalid interval name: ${i}`);return y}getCanonicalNoteName(i){if(!this.isValidNoteValue(i))throw new h.RERR("BadArguments",`Invalid note value: ${i}`);return Ee.canonical_notes[i]}getCanonicalIntervalName(i){if(!this.isValidIntervalValue(i))throw new h.RERR("BadArguments",`Invalid interval value: ${i}`);return Ee.diatonic_intervals[i]}getRelativeNoteValue(i,y,C){if(C==null&&(C=1),C!==1&&C!==-1)throw new h.RERR("BadArguments",`Invalid direction: ${C}`);let B=(i+C*y)%Ee.NUM_TONES;return B<0&&(B+=Ee.NUM_TONES),B}getRelativeNoteName(i,y){const C=this.getNoteParts(i),B=this.getNoteValue(C.root);let $=y-B;if(Math.abs($)>Ee.NUM_TONES-3){let se=1;$>0&&(se=-1);const ue=(y+1+(B+1))%Ee.NUM_TONES*se;if(Math.abs(ue)>2)throw new h.RERR("BadArguments",`Notes not related: ${i}, ${y})`);$=ue}if(Math.abs($)>2)throw new h.RERR("BadArguments",`Notes not related: ${i}, ${y})`);let Z=C.root;if($>0)for(let se=1;se<=$;++se)Z+="#";else if($<0)for(let se=-1;se>=$;--se)Z+="b";return Z}getScaleTones(i,y){const C=[i];let B=i;for(let $=0;$Ie.getMetrics().width;class re extends ae{static get CATEGORY(){return"accidentals"}static format(i,y){const C=y.left_shift+1;if(!i||i.length===0)return;const B=[];let $,Z=null,se=0;for(let $e=0;$eJe.line-$e.line);const ue=[];let ve=0,we=null;for(let $e=0;$eve?Je.shift:ve,we=Je.line}let Pe=0;for(let $e=0;$eue[pt+ti],kt=ti=>ti.map(bt),zt=(ti,ji)=>{const[ur,gn]=kt([ti,ji]).map(hn=>hn.line);return ur-gn},tn=(...ti)=>ti.map(kt).every(ji=>!this.checkCollision(...ji)),Cn=ht-pt+1;let Sn,Ai,ei=this.checkCollision(ue[pt],ue[ht])?"a":"b";switch(Cn){case 3:ei==="a"&&zt(1,2)===.5&&zt(0,1)!==.5&&(ei="second_on_bottom");break;case 4:tn([0,2],[1,3])&&(ei="spaced_out_tetrachord");break;case 5:ei==="b"&&tn([1,3])&&(ei="spaced_out_pentachord",tn([0,2],[2,4])&&(ei="very_spaced_out_pentachord"));break;case 6:tn([0,3],[1,4],[2,5])&&(ei="spaced_out_hexachord"),tn([0,2],[2,4],[1,3],[3,5])&&(ei="very_spaced_out_hexachord")}if(Cn>=7){let ti=2,ji=!0;for(;ji===!0;){ji=!1;for(let ur=0;ur+tiAi?Pe:Ai}else for(Sn=$e;Sn<=ht;Sn++)Ai=T.accidentalColumnsTable[Cn][ei][Sn-$e],ue[Sn].column=Ai,Pe=Pe>Ai?Pe:Ai;$e=ht}const Ae=[],Ce=[];for(let $e=0;$e<=Pe;$e++)Ae[$e]=0,Ce[$e]=0;Ae[0]=ve+C,Ce[0]=ve+C,ue.forEach($e=>{$e.width>Ae[$e.column]&&(Ae[$e.column]=$e.width)});for(let $e=1;$e{let Je=0;const pt=je+$e.numAcc;for(;je0?(B=y.flatLine||y.dblSharpLine?2.5:3,i.dblSharpLine&&(C-=.5)):(B=i.flatLine||i.dblSharpLine?2.5:3,y.dblSharpLine&&(C-=.5));const $=Math.abs(C){const ue=new s(0,1);se.getTickables().forEach(ve=>{if(ve.shouldIgnoreTicks())return;const we=B[ue.value()];we?we.push(ve):(C.push(ue.value()),B[ue.value()]=[ve]),ue.add(ve.getTicks())})});const $=new Ee;y||(y="C");const Z=$.createScaleMap(y);C.forEach(se=>{const ue=B[se],ve=[],we=Pe=>{Pe.isRest()||Pe.shouldIgnoreTicks()||(Pe.keys.forEach((Ae,Ce)=>{const Ve=$.getNoteParts(Ae.split("/")[0]),je=Ve.accidental||"n",$e=Ve.root+je,Je=Z[Ve.root]===$e,pt=ve.indexOf($e)>-1;if(!Je||Je&&pt){Z[Ve.root]=$e;const ht=new re(je);Pe.addAccidental(Ce,ht),ve.push($e)}}),Pe.getModifiers().forEach(Ae=>{Ae.getCategory()==="gracenotegroups"&&Ae.getGraceNotes().forEach(we)}))};ue.forEach(we)})}constructor(i=null){if(super(),this.setAttribute("type","Accidental"),j("New accidental: ",i),this.note=null,this.index=null,this.type=i,this.position=ae.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=T.accidentalCodes(this.type),!this.accidental)throw new h.RERR("ArgumentError",`Unknown accidental type: ${i}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const i=this.render_options.font_scale;this.glyph=new S(this.accidental.code,i),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new S(T.accidentalCodes("{").code,i),this.parenRight=new S(T.accidentalCodes("}").code,i),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return re.CATEGORY}getWidth(){const i=this.cautionary?te(this.parenLeft)+te(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return te(this.glyph)+i}setNote(i){if(!i)throw new h.RERR("ArgumentError",`Bad note value: ${i}`);this.note=i,this.note.getCategory()==="gracenotes"&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:i,type:y,position:C,note:B,index:$,cautionary:Z,x_shift:se,y_shift:ue,glyph:ve,parenLeft:we,parenRight:Pe,render_options:{parenLeftPadding:Ae,parenRightPadding:Ce}}=this;if(this.checkContext(),!B||$==null)throw new h.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const Ve=B.getModifierStartXY(C,$);let je=Ve.x+se;const $e=Ve.y+ue;j("Rendering: ",y,je,$e),Z?(Pe.render(i,je,$e),je-=te(Pe),je-=Ce,je-=this.accidental.parenRightPaddingAdjustment,ve.render(i,je,$e),je-=te(ve),je-=Ae,we.render(i,je,$e)):ve.render(i,je,$e),this.setRendered()}}class O extends ae{static get CATEGORY(){return"notesubgroup"}static format(i,y){if(!i||i.length===0)return!1;let C=0;for(let B=0;B{y.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Et,this.voice=new G({num_beats:4,beat_value:4,resolution:T.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return O.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(i){this.note=i}setWidth(i){this.width=i}getWidth(){return this.width}draw(){this.checkContext();const i=this.getNote();if(!i||this.index===null)throw new h.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,i),this.subNotes.forEach(y=>y.setContext(this.context).drawWithStyle())}}class z extends u{constructor(i,y){super(),this.setAttribute("type","StaveTie"),this.notes=i,this.context=null,this.text=y,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:10,style:""}},this.font=this.render_options.font,this.setNotes(i)}setFont(i){return this.font=i,this}setDirection(i){return this.direction=i,this}setNotes(i){if(!i.first_note&&!i.last_note)throw new h.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(i.first_indices||(i.first_indices=[0]),i.last_indices||(i.last_indices=[0]),i.first_indices.length!==i.last_indices.length)throw new h.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=i.first_note,this.first_indices=i.first_indices,this.last_note=i.last_note,this.last_indices=i.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(i){if(i.first_ys.length===0||i.last_ys.length===0)throw new h.RERR("BadArguments","No Y-values to render");const y=this.context;let C=this.render_options.cp1,B=this.render_options.cp2;Math.abs(i.last_x_px-i.first_x_px)<10&&(C=2,B=8);const $=this.render_options.first_x_shift,Z=this.render_options.last_x_shift,se=this.render_options.y_shift*i.direction;for(let ue=0;ue1){const y=new W(i);y.render_options.beam_width=3,y.render_options.partial_beam_length=4,this.beams.push(y)}return this}setNote(i){this.note=i}setWidth(i){this.width=i}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const i=this.getNote();if(function(...y){q.DEBUG&&h.L("Vex.Flow.GraceNoteGroup",y)}("Drawing grace note group for:",i),!i||this.index===null)throw new h.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),i),this.grace_notes.forEach(y=>{y.setContext(this.context).draw()}),this.beams.forEach(y=>{y.setContext(this.context).draw()}),this.show_slur){const y=this.getNote().getCategory()===ee.CATEGORY,C=y?z:Y;this.slur=new C({last_note:this.grace_notes[0],first_note:i,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(y?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class de extends ae{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(i,y){const C=y.left_shift;if(!i||i.length===0)return this;const B=i.map(se=>{const ue=se.getNote();if(ue instanceof ee){const{line:ve,displaced:we}=ue.getKeyProps()[se.getIndex()];return{line:ve,shift:we?ue.getExtraLeftPx():0,stroke:se}}{const{str:ve}=ue.getPositions()[se.getIndex()];return{line:ve,shift:0,stroke:se}}}),$=C,Z=B.reduce((se,{stroke:ue,shift:ve})=>(ue.setXShift($+ve),Math.max(ue.getWidth()+0,se)),0);return y.left_shift+=Z,!0}constructor(i,y){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=h.Merge({},y),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=i,this.position=ae.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return de.CATEGORY}getPosition(){return this.position}addEndNote(i){return this.note_end=i,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index==null)throw new h.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const i=this.note.getModifierStartXY(this.position,this.index);let y=this.note.getYs(),C=i.y,B=i.y;const $=i.x-5,Z=this.note.stave.options.spacing_between_lines_px,se=this.getModifierContext().getModifiers(this.note.getCategory());for(let Ce=0;Cebt.line-ht.line);let Ve=0,je=0,$e=0,Je=null,pt=null;for(Z=0;Z<$.length;++Z){let ht=0;ue=$[Z].note,ve=$[Z].pos,se=$[Z].num;const bt=$[Z].line;$[Z].shiftL;const kt=$[Z].shiftR;bt===Je&&ue===pt||(Ve=B+kt);const zt=se.getWidth()+1;ve===ae.Position.LEFT?(se.setXShift(C),ht=Ae+zt,je=ht>je?ht:je):ve===ae.Position.RIGHT&&(se.setXShift(Ve),ht+=zt,$e=ht>$e?ht:$e),Je=bt,pt=ue}return y.left_shift+=je,y.right_shift+=$e,!0}constructor(i){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=i,this.setWidth(20),this.position=ae.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=I.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return le.CATEGORY}getNote(){return this.note}setNote(i){return this.note=i,this}getIndex(){return this.index}setIndex(i){return this.index=i,this}setLineEndType(i){return i>=I.LineEndType.NONE&&i<=I.LineEndType.DOWN&&(this.leg=i),this}setStringNumber(i){return this.string_number=i,this}setOffsetX(i){return this.x_offset=i,this}setOffsetY(i){return this.y_offset=i,this}setLastNote(i){return this.last_note=i,this}setDashed(i){return this.dashed=i,this}draw(){const i=this.checkContext();if(!this.note||this.index==null)throw new h.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const y=this.note.stave.options.spacing_between_lines_px,C=this.note.getModifierStartXY(this.position,this.index);let B=C.x+this.x_shift+this.x_offset,$=C.y+this.y_shift+this.y_offset;switch(this.position){case ae.Position.ABOVE:case ae.Position.BELOW:{const se=this.note.getStemExtents();let ue=se.topY,ve=se.baseY+2;this.note.stem_direction===ee.STEM_DOWN&&(ue=se.baseY,ve=se.topY-2),$=this.position===ae.Position.ABOVE?this.note.hasStem()?ue-1.75*y:C.y-1.75*y:this.note.hasStem()?ve+1.5*y:C.y+1.75*y,$+=this.y_shift+this.y_offset;break}case ae.Position.LEFT:B-=this.radius/2+5;break;case ae.Position.RIGHT:B+=this.radius/2+6;break;default:throw new h.RERR("InvalidPosition",`The position ${this.position} is invalid`)}i.save(),i.beginPath(),i.arc(B,$,this.radius,0,2*Math.PI,!1),i.lineWidth=1.5,i.stroke(),i.setFont(this.font.family,this.font.size,this.font.weight);const Z=B-i.measureText(this.string_number).width/2;if(i.fillText(""+this.string_number,Z,$+4.5),this.last_note!=null){const se=this.last_note.getStemX()-this.note.getX()+5;let ue,ve;switch(i.strokeStyle="#000000",i.lineCap="round",i.lineWidth=.6,this.dashed?I.drawDashedLine(i,B+10,$,B+se,$,[3,3]):I.drawDashedLine(i,B+10,$,B+se,$,[3,0]),this.leg){case I.LineEndType.UP:ue=-10,ve=this.dashed?[3,3]:[3,0],I.drawDashedLine(i,B+se,$,B+se,$+ue,ve);break;case I.LineEndType.DOWN:ue=10,ve=this.dashed?[3,3]:[3,0],I.drawDashedLine(i,B+se,$,B+se,$+ue,ve)}}i.restore()}}class he extends H{static getNextContext(i){const y=i.tContexts,C=y.indexOf(i);return y[C+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new s(0,1),this.maxTicks=new s(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(i){return this.x=i,this.xBase=i,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(i){this.xBase=i,this.x=i+this.xOffset}getXOffset(){return this.xOffset}setXOffset(i){this.xOffset=i,this.x=this.xBase+i}getWidth(){return this.width+2*this.padding}setPadding(i){return this.padding=i,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(i=>i.isCenterAligned())}getMetrics(){const{width:i,notePx:y,extraLeftPx:C,extraRightPx:B}=this;return{width:i,notePx:y,extraLeftPx:C,extraRightPx:B}}getCurrentTick(){return this.currentTick}setCurrentTick(i){this.currentTick=i,this.preFormatted=!1}getExtraPx(){let i=0,y=0,C=0,B=0;for(let $=0;$.5*Ie(i/.5),Ue=(Ie,i)=>i===me?Ie<=5:Ie>=1,Ge=(Ie,i)=>Ue(Ie,i)?i===me?Math.ceil:Math.floor:Math.round,Qe=Ie=>{const i=Ie.getCategory();return i==="stavenotes"||i==="gracenotes"};class Re extends ae{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(i,y){if(!i||i.length===0)return!1;const C=($,Z,se)=>Me(Ge(Z,se),$.glyph.getMetrics().height/10+.5);i.filter($=>$.getPosition()===me).forEach($=>{$.setTextLine(y.top_text_line),y.top_text_line+=C($,y.top_text_line,me)}),i.filter($=>$.getPosition()===_e).forEach($=>{$.setTextLine(y.text_line),y.text_line+=C($,y.text_line,_e)});const B=i.map($=>$.getWidth()).reduce(($,Z)=>Math.max(Z,$));return y.left_shift+=B/2,y.right_shift+=B/2,!0}static easyScoreHook({articulations:i},y,C){if(!i)return;const B={staccato:"a.",tenuto:"a-"};i.split(",").map($=>$.trim().split(".")).map(([$,Z])=>{const se={type:B[$]};return Z&&(se.position=ae.PositionString[Z]),C.getFactory().Articulation(se)}).map($=>y.addModifier(0,$))}constructor(i){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=i,this.position=_e,this.render_options={font_scale:38},this.breathMarkDistance=.8,this.articulation=T.articulationCodes(this.type),this.type==="abr"&&(this.articulation={code:"v6c",between_lines:!1}),!this.articulation)throw new h.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new S(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return Re.CATEGORY}draw(){const{note:i,index:y,position:C,glyph:B,articulation:{between_lines:$},text_line:Z,context:se}=this;if(this.checkContext(),!i||y==null)throw new h.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const ue=i.getStave(),ve=ue.getSpacingBetweenLines(),we=i.getCategory()==="tabnotes";let{x:Pe}=i.getModifierStartXY(C,y);if(this.type==="abr"){let $e=0;const Je=i.getTickContext(),pt=he.getNextContext(Je),ht=i.getTickContext().getX();if(pt)$e=(pt.getX()-ht)*this.breathMarkDistance;else{const bt=i.getStave();$e=(bt.getX()+bt.getWidth()-ht)*this.breathMarkDistance}Pe+=$e}const Ae=this.getXShift();Ae&&(Pe+=Ae);const Ce=!$||we,Ve=(($e,Je)=>{const pt=Je===me&&$e.getStemDirection()===R.UP||Je===_e&&$e.getStemDirection()===R.DOWN;return Qe($e)?$e.hasStem()&&pt?.5:1:$e.hasStem()&&pt?1:0})(i,C);let je={[me]:()=>{B.setOrigin(.5,1);const $e=((Je,pt)=>{const ht=Je.getStave(),bt=Je.getStemDirection(),{topY:kt,baseY:zt}=Je.getStemExtents();if(Qe(Je))return Je.hasStem()?bt===R.UP?kt:zt:Math.min(...Je.getYs());if(Je.getCategory()==="tabnotes")return Je.hasStem()&&bt===R.UP?kt:ht.getYForTopText(pt);throw new h.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(i,Z)-(Z+Ve)*ve;return Ce?Math.min(ue.getYForTopText(Re.INITIAL_OFFSET),$e):$e},[_e]:()=>{B.setOrigin(.5,0);const $e=((Je,pt)=>{const ht=Je.getStave(),bt=Je.getStemDirection(),{topY:kt,baseY:zt}=Je.getStemExtents();if(Qe(Je))return Je.hasStem()?bt===R.UP?zt:kt:Math.max(...Je.getYs());if(Je.getCategory()==="tabnotes")return Je.hasStem()?bt===R.UP?ht.getYForBottomText(pt):kt:ht.getYForBottomText(pt);throw new h.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(i,Z)+(Z+Ve)*ve;return Ce?Math.max(ue.getYForBottomText(Re.INITIAL_OFFSET),$e):$e}}[C]();if(this.y_shift&&(je+=this.y_shift),!we){const $e=C===me?-1:1,Je=we?i.positions[y].str:i.getKeyProps()[y].line,pt=(i.getYs()[y]-je)/ve+Je,ht=((bt,kt,zt,tn)=>{const Cn=Me(Ge(kt,zt),kt);return bt&&Ue(Cn,zt)&&Cn%1==0?Cn+.5*-tn:Cn})($,pt,C,$e);Ue(ht,C)&&B.setOrigin(.5,.5),je+=Math.abs(ht-pt)*ve*$e}(function(...$e){Re.DEBUG&&h.L("Vex.Flow.Articulation",$e)})(`Rendering articulation at (x: ${Pe}, y: ${je})`),B.render(se,Pe,je)}}class We extends ae{static get CATEGORY(){return"ornaments"}static format(i,y){if(!i||i.length===0)return!1;let C=0;for(let B=0;B0&&B--;for(let ue=0;ue{st("Preformatting ModifierContext: ",i.CATEGORY),i.format(this.getModifiers(i.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(i=>{st("Postformatting ModifierContext: ",i.CATEGORY),i.postFormat(this.getModifiers(i.CATEGORY),this)})}}function xt(Ie,i,y,C){let B=i;for(y+=1;y{if(ue.getMode()===G.Mode.STRICT&&!ue.isComplete())throw new h.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(se,s.LCM(se,ue.getResolutionMultiplier()))},1),B={},$=[],Z=[];return Ie.forEach(se=>{const ue=new s(0,C);se.getTickables().forEach(ve=>{const we=ue.numerator;if(!B[we]){const Pe=new i;Z.push(Pe),B[we]=Pe}y(ve,B[we]),$.push(we),ue.add(ve.getTicks())})}),{map:B,array:Z,list:h.SortAndUnique($,(se,ue)=>se-ue,(se,ue)=>se===ue),resolutionMultiplier:C}}class Et{static SimpleFormat(i,y=0,{paddingBetween:C=10}={}){i.reduce((B,$)=>{$.addToModifierContext(new ft);const Z=new he().addTickable($).preFormat(),se=Z.getExtraPx();return Z.setX(B+se.left),B+Z.getWidth()+se.right+C},y)}static plotDebugging(i,y,C,B,$){const Z=C+ne.STAVEPADDING,se=y.contextGaps;i.save(),i.setFont("Arial",8,""),se.gaps.forEach(ue=>{var ve,we,Pe;ve=Z+ue.x1,we=Z+ue.x2,Pe="#aaa",i.beginPath(),i.setStrokeStyle(Pe),i.setFillStyle(Pe),i.setLineWidth(1),i.fillRect(ve,B,we-ve,$-B),i.fillText(Math.round(ue.x2-ue.x1),Z+ue.x1,$+12)}),i.fillText(Math.round(se.total)+"px",Z-20,$+12),i.setFillStyle("red"),i.fillText("Loss: "+y.lossHistory.map(ue=>Math.round(ue)),Z-20,$+22),i.restore()}static FormatAndDraw(i,y,C,B){const $={auto_beam:!1,align_rests:!1};typeof B=="object"?h.Merge($,B):typeof B=="boolean"&&($.auto_beam=B);const Z=new G(T.TIME4_4).setMode(G.Mode.SOFT).addTickables(C),se=$.auto_beam?W.applyAndGetBeams(Z):[];return new Et().joinVoices([Z],{align_rests:$.align_rests}).formatToStave([Z],y,{align_rests:$.align_rests,stave:y}),Z.setStave(y).draw(i,y),se.forEach(ue=>ue.setContext(i).draw()),Z.getBoundingBox()}static FormatAndDrawTab(i,y,C,B,$,Z,se){const ue={auto_beam:Z,align_rests:!1};typeof se=="object"?h.Merge(ue,se):typeof se=="boolean"&&(ue.auto_beam=se);const ve=new G(T.TIME4_4).setMode(G.Mode.SOFT).addTickables($),we=new G(T.TIME4_4).setMode(G.Mode.SOFT).addTickables(B),Pe=ue.auto_beam?W.applyAndGetBeams(ve):[];new Et().joinVoices([ve],{align_rests:ue.align_rests}).joinVoices([we]).formatToStave([ve,we],C,{align_rests:ue.align_rests}),ve.draw(i,C),we.draw(i,y),Pe.forEach(Ae=>Ae.setContext(i).draw()),new L(C,y).setContext(i).draw()}static AlignRestsToNotes(i,y,C){return i.forEach((B,$)=>{if(B instanceof ee&&B.isRest()){if(B.tuplet&&!C)return;const Z=B.getGlyph().position.toUpperCase();if(Z!=="R/4"&&Z!=="B/4")return;if(y||B.beam!=null){const se=B.getKeyProps()[0];if($===0)se.line=xt(i,se.line,$,!1),B.setKeyLine(0,se.line);else if($>0&&$Et.AlignRestsToNotes(C.getTickables(),y))}preCalculateMinTotalWidth(i){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!i)throw new h.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(i)}const{list:y,map:C}=this.tickContexts;return this.minTotalWidth=y.map(B=>{const $=C[B];return $.preFormat(),$.getWidth()}).reduce((B,$)=>B+$,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new h.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(i){const y=ut(i,ft,(C,B)=>C.addToModifierContext(B));return this.modiferContexts=y,y}createTickContexts(i){const y=ut(i,he,(C,B)=>B.addTickable(C));return y.array.forEach(C=>{C.tContexts=y.array}),this.totalTicks=i[0].getTicksUsed().clone(),this.tickContexts=y,y}preFormat(i=0,y,C,B){const $=this.tickContexts,{list:Z,map:se,resolutionMultiplier:ue}=$;C&&B&&C.forEach($e=>$e.setStave(B).preFormat());let ve=0,we=0;const Pe=i/2;if(this.minTotalWidth=0,Z.forEach($e=>{const Je=se[$e];y&&Je.setContext(y),Je.preFormat();const pt=Je.getWidth();this.minTotalWidth+=pt;const ht=Je.getMetrics();ve=ve+we+ht.extraLeftPx,Je.setX(ve),we=pt-ht.extraLeftPx}),this.minTotalWidth=ve+we,this.hasMinTotalWidth=!0,i<=0)return;const Ae=i-this.minTotalWidth;let Ce=this.totalTicks.value();Ce===0&&(Ce=1);const Ve=Ae/(Ce*ue);let je=0;Z.forEach(($e,Je)=>{const pt=Z[Je-1]||0,ht=se[$e];je+=($e-pt)*Ve,ht.setX(ht.getX()+je),ht.getCenterAlignedTickables().forEach(bt=>{bt.center_x_shift=Pe-ht.getX()})}),Z.length!==1&&(this.justifyWidth=i,this.lossHistory=[],this.evaluate())}evaluate(){const i=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((B,$)=>{if($===0)return;const Z=this.tickContexts.list[$-1],se=this.tickContexts.map[Z],ue=this.tickContexts.map[B],ve=se.getMetrics(),we=se.getX()+ve.width,Pe=ue.getX(),Ae=Pe-we;this.contextGaps.total+=Ae,this.contextGaps.gaps.push({x1:we,x2:Pe}),ue.getFormatterMetrics().freedom.left=Ae,se.getFormatterMetrics().freedom.right=Ae});const y=this.durationStats={};this.voices.forEach(B=>{B.getTickables().forEach(($,Z,se)=>{const ue=$.getTicks().clone().simplify().toString(),ve=$.getMetrics(),we=$.getFormatterMetrics(),Pe=$.getX()+ve.noteWidth+ve.modRightPx+ve.extraRightPx;let Ae=0;if(Z{B.getTickables().forEach($=>{const Z=$.getTicks().clone().simplify().toString(),se=$.getFormatterMetrics();se.iterations+=1,se.space.deviation=se.space.used-y[Z].mean,se.duration=Z,se.space.mean=y[Z].mean,C+=Math.pow(y[Z].mean,2)})}),this.totalCost=Math.sqrt(C),this.lossHistory.push(this.totalCost),this}tune(){let i=0;return this.tickContexts.list.forEach((y,C,B)=>{const $=this.tickContexts.map[y],Z=C>0?this.tickContexts.map[B[C-1]]:null,se=Cwe.getFormatterMetrics().space.deviation).reduce((we,Pe)=>we+Pe);ue>0?i=-Math.min($.getFormatterMetrics().freedom.right,Math.abs(ue)):ue<0&&(i=se?Math.min(se.getFormatterMetrics().freedom.right,Math.abs(ue)):0);const ve=Math.min(5,Math.abs(i));i=i>0?ve:-ve}),this.evaluate()}postFormat(){const i=y=>y.list.forEach(C=>y.map[C].postFormat());return i(this.modiferContexts),i(this.tickContexts),this}joinVoices(i){return this.createModifierContexts(i),this.hasMinTotalWidth=!1,this}format(i,y,C){const B={align_rests:!1,context:null,stave:null};return h.Merge(B,C),this.voices=i,this.alignRests(i,B.align_rests),this.createTickContexts(i),this.preFormat(y,B.context,i,B.stave),this}formatToStave(i,y,C){const B=y.getNoteEndX()-y.getNoteStartX()-10;(function(...Z){Et.DEBUG&&h.L("Vex.Flow.Formatter",Z)})("Formatting voices to width: ",B);const $={context:y.getContext()};return h.Merge($,C),this.format(i,B,$)}}class dt extends u{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=dt.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(i){return this.position=i,this}getStave(){return this.stave}setStave(i){return this.stave=i,this}getWidth(){return this.width}setWidth(i){return this.width=i,this}getX(){return this.x}setX(i){return this.x=i,this}getCategory(){return""}makeSpacer(i){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:i})}}placeGlyphOnLine(i,y,C){i.setYShift(y.getYForLine(C)-y.getYForGlyphs())}getPadding(i){return i!==void 0&&i<2?0:this.padding}setPadding(i){return this.padding=i,this}setLayoutMetrics(i){return this.layoutMetrics=i,this}getLayoutMetrics(){return this.layoutMetrics}}class Tt extends dt{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:Tt.type.SINGLE,double:Tt.type.DOUBLE,end:Tt.type.END,repeatBegin:Tt.type.REPEAT_BEGIN,repeatEnd:Tt.type.REPEAT_END,repeatBoth:Tt.type.REPEAT_BOTH,none:Tt.type.NONE}}constructor(i){super(),this.setAttribute("type","Barline"),this.thickness=T.STAVE_LINE_THICKNESS;const y=Tt.type;this.widths={},this.widths[y.SINGLE]=5,this.widths[y.DOUBLE]=5,this.widths[y.END]=5,this.widths[y.REPEAT_BEGIN]=5,this.widths[y.REPEAT_END]=5,this.widths[y.REPEAT_BOTH]=5,this.widths[y.NONE]=5,this.paddings={},this.paddings[y.SINGLE]=0,this.paddings[y.DOUBLE]=0,this.paddings[y.END]=0,this.paddings[y.REPEAT_BEGIN]=15,this.paddings[y.REPEAT_END]=15,this.paddings[y.REPEAT_BOTH]=15,this.paddings[y.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[y.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[y.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(dt.Position.BEGIN),this.setType(i)}getCategory(){return Tt.CATEGORY}getType(){return this.type}setType(i){return this.type=typeof i=="string"?Tt.typeString[i]:i,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(i){switch(i.checkContext(),this.setRendered(),this.type){case Tt.type.SINGLE:this.drawVerticalBar(i,this.x,!1);break;case Tt.type.DOUBLE:this.drawVerticalBar(i,this.x,!0);break;case Tt.type.END:this.drawVerticalEndBar(i,this.x);break;case Tt.type.REPEAT_BEGIN:this.drawRepeatBar(i,this.x,!0),i.getX()!==this.x&&this.drawVerticalBar(i,i.getX());break;case Tt.type.REPEAT_END:this.drawRepeatBar(i,this.x,!1);break;case Tt.type.REPEAT_BOTH:this.drawRepeatBar(i,this.x,!1),this.drawRepeatBar(i,this.x,!0)}}drawVerticalBar(i,y,C){i.checkContext();const B=i.getTopLineTopY(),$=i.getBottomLineBottomY();C&&i.context.fillRect(y-3,B,1,$-B),i.context.fillRect(y,B,1,$-B)}drawVerticalEndBar(i,y){i.checkContext();const C=i.getTopLineTopY(),B=i.getBottomLineBottomY();i.context.fillRect(y-5,C,1,B-C),i.context.fillRect(y-2,C,3,B-C)}drawRepeatBar(i,y,C){i.checkContext();const B=i.getTopLineTopY(),$=i.getBottomLineBottomY();let Z=3;C||(Z=-5),i.context.fillRect(y+Z,B,1,$-B),i.context.fillRect(y-2,B,3,$-B),C?Z+=4:Z-=4;const se=y+Z+1;let ue=(i.getNumLines()-1)*i.getSpacingBetweenLines();ue=ue/2-i.getSpacingBetweenLines()/2;let ve=B+ue+1;i.context.beginPath(),i.context.arc(se,ve,2,0,2*Math.PI,!1),i.context.fill(),ve+=i.getSpacingBetweenLines(),i.context.beginPath(),i.context.arc(se,ve,2,0,2*Math.PI,!1),i.context.fill()}}class It extends dt{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(i,y,C){super(),this.setAttribute("type","Repetition"),this.symbol_type=i,this.x=y,this.x_shift=0,this.y_shift=C,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return It.CATEGORY}setShiftX(i){return this.x_shift=i,this}setShiftY(i){return this.y_shift=i,this}setX(i){return this.x=i,this}draw(i,y){switch(this.setRendered(),this.symbol_type){case It.type.CODA_RIGHT:this.drawCodaFixed(i,y+i.width);break;case It.type.CODA_LEFT:this.drawSymbolText(i,y,"Coda",!0);break;case It.type.SEGNO_LEFT:this.drawSignoFixed(i,y);break;case It.type.SEGNO_RIGHT:this.drawSignoFixed(i,y+i.width);break;case It.type.DC:this.drawSymbolText(i,y,"D.C.",!1);break;case It.type.DC_AL_CODA:this.drawSymbolText(i,y,"D.C. al",!0);break;case It.type.DC_AL_FINE:this.drawSymbolText(i,y,"D.C. al Fine",!1);break;case It.type.DS:this.drawSymbolText(i,y,"D.S.",!1);break;case It.type.DS_AL_CODA:this.drawSymbolText(i,y,"D.S. al",!0);break;case It.type.DS_AL_FINE:this.drawSymbolText(i,y,"D.S. al Fine",!1);break;case It.type.FINE:this.drawSymbolText(i,y,"Fine",!1);break;case It.type.TO_CODA:this.drawSymbolText(i,y,"To",!0)}return this}drawCodaFixed(i,y){const C=i.getYForTopText(i.options.num_lines)+this.y_shift;return S.renderGlyph(i.context,this.x+y+this.x_shift,C+25,40,"v4d",!0),this}drawSignoFixed(i,y){const C=i.getYForTopText(i.options.num_lines)+this.y_shift;return S.renderGlyph(i.context,this.x+y+this.x_shift,C+25,30,"v8c",!0),this}drawSymbolText(i,y,C,B){const $=i.checkContext();$.save(),$.setFont(this.font.family,this.font.size,this.font.weight);let Z=0+this.x_shift,se=y+this.x_shift;if(this.symbol_type===It.type.CODA_LEFT?(Z=this.x+this.x_shift,se=Z+$.measureText(C).width+12):(this.x_shift=-(Z+$.measureText(C).width+12+i.options.vertical_bar_width+12),Z=this.x+this.x_shift+i.options.vertical_bar_width,se=Z+$.measureText(C).width+12),this.xShiftAsPercentOfStaveWidth){const ve=i.width*this.xShiftAsPercentOfStaveWidth;this.symbol_type!==It.type.DC_AL_FINE&&this.symbol_type!==It.type.FINE&&this.symbol_type!==It.type.DC&&this.symbol_type!==It.type.DS_AL_FINE&&this.symbol_type!==It.type.DS&&this.symbol_type!==It.type.FINE||(Z+=ve)}const ue=i.getYForTopText(i.options.num_lines)+this.y_shift+25;return B&&S.renderGlyph($,se,ue,40,"v4d",!0),$.fillText(C,Z,ue+5),$.restore(),this}}class Jt extends dt{static get CATEGORY(){return"stavesection"}constructor(i,y,C){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=i,this.x=y,this.shift_x=0,this.shift_y=C,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return Jt.CATEGORY}setStaveSection(i){return this.section=i,this}setShiftX(i){return this.shift_x=i,this}setShiftY(i){return this.shift_y=i,this}draw(i,y){const C=i.checkContext();this.setRendered(),C.save(),C.lineWidth=2,C.setFont(this.font.family,this.font.size,this.font.weight);const B=C.measureText(""+this.section),$=B.width;let Z=B.height;!Z&&B.emHeightAscent>=0&&(Z=B.emHeightAscent+2),Z||(Z=B.fontBoundingBoxAscent+3);let se=$+6;se<18&&(se=18);const ue=Z+this.font.size/10,ve=i.getYForTopText(3)+19-1.15*ue+this.shift_y;let we=this.x+y;return C.beginPath(),C.lineWidth=2,C.rect(we,ve+Z/4,se,ue),C.stroke(),we+=(se-$)/2,C.fillText(""+this.section,we,ve+ue),C.restore(),this}}class hi extends dt{static get CATEGORY(){return"stavetempo"}constructor(i,y,C){super(),this.setAttribute("type","StaveTempo"),this.tempo=i,this.position=ae.Position.ABOVE,this.x=y,this.shift_x=10,this.shift_y=C,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return hi.CATEGORY}setTempo(i){return this.tempo=i,this}setShiftX(i){return this.shift_x=i,this}setShiftY(i){return this.shift_y=i,this}draw(i,y){const C=i.checkContext();this.setRendered();const B=this.render_options,$=B.glyph_font_scale/38,Z=this.tempo.name,se=this.tempo.duration,ue=this.tempo.dots,ve=this.tempo.bpm,we=this.font;let Pe=this.x+this.shift_x+y;const Ae=i.getYForTopText(1)+this.shift_y;if(C.save(),Z&&(C.setFont(we.family,we.size,we.weight),C.fillText(Z,Pe,Ae),Pe+=C.measureText(Z).width),se&&ve){C.setFont(we.family,we.size,"normal"),Z&&(Pe+=C.measureText(" ").width,C.fillText("(",Pe,Ae),Pe+=C.measureText("(").width);const Ce=T.getGlyphProps(se);if(Pe+=3*$,S.renderGlyph(C,Pe,Ae,B.glyph_font_scale,Ce.code_head),Pe+=Ce.getWidth()*$,Ce.stem){let Ve=30;Ce.beam_count&&(Ve+=3*(Ce.beam_count-1)),Ve*=$;const je=Ae-Ve;C.fillRect(Pe-$,je,$,Ve),Ce.flag&&(S.renderGlyph(C,Pe,je,B.glyph_font_scale,Ce.code_flag_upstem),ue||(Pe+=6*$))}for(let Ve=0;Ve=i.line?ue.above:ue.below)}this.placeGlyphOnLine(B,this.stave,i.line),this.glyphs.push(B);const Z=this.xPositions[this.xPositions.length-1],se=B.getMetrics().width+$;this.xPositions.push(Z+se),this.width+=se}cancelKey(i){return this.formatted=!1,this.cancelKeySpec=i,this}convertToCancelAccList(i){const y=T.keySignature(i),C=this.accList.length>0&&y.length>0&&y[0].type!==this.accList[0].type,B=C?y.length:y.length-this.accList.length;if(B<1)return;const $=[];for(let Z=0;Z0?i[0].type:null;let C;if(this.cancelKeySpec&&(C=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const B=(this.position===dt.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;C&&this.convertAccLines(B,C.type,C.accList),this.convertAccLines(B,y,i);for(let $=0;$0){const i=this.stave.context.openGroup("keysignature");for(let y=0;y{const $=B.split("/").filter(Z=>Z!=="");if($.length!==2)throw new h.RERR("BadTimeSignature",`Invalid time spec: ${B}. Must be in the form "/"`);$.forEach(Z=>{if(isNaN(Number(Z)))throw new h.RERR("BadTimeSignature",`Invalid time spec: ${B}. Must contain two valid numbers.`)})})(i);const[y,C]=i.split("/").map(B=>B.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(y,C)}}makeTimeSignatureGlyph(i,y){const C=new S("v0",this.point);C.topGlyphs=[],C.botGlyphs=[];let B=0;for(let Pe=0;Pe$?B:$,se=C.getMetrics().x_min;C.getMetrics=()=>({x_min:se,x_max:se+Z,width:Z});const ue=(Z-B)/2,ve=(Z-$)/2,we=this;return C.renderToStave=function(Pe){let Ae=Pe+ue;for(let Ce=0;Ce{C.getNoteStartX()>y&&(y=C.getNoteStartX())}),i.forEach(C=>{C.setNoteStartX(y)}),y=0,i.forEach(C=>{C.getModifiers(dt.Position.BEGIN,Tt.CATEGORY).forEach(B=>{B.getType()==Tt.type.REPEAT_BEGIN&&B.getX()>y&&(y=B.getX())})}),i.forEach(C=>{C.getModifiers(dt.Position.BEGIN,Tt.CATEGORY).forEach(B=>{B.getType()==Tt.type.REPEAT_BEGIN&&B.setX(y)})}),y=0,i.forEach(C=>{C.getModifiers(dt.Position.BEGIN,sn.CATEGORY).forEach(B=>{B.getX()>y&&(y=B.getX())})}),i.forEach(C=>{C.getModifiers(dt.Position.BEGIN,sn.CATEGORY).forEach(B=>{B.setX(y)})})}getOptions(){return this.options}setNoteStartX(i){return this.formatted||this.format(),this.setStartX(i),this}setStartX(i){this.start_x=i}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(i){return this.options.num_lines=parseInt(i,10),this.resetLines(),this}setY(i){return this.y=i,this}getTopLineTopY(){return this.getYForLine(0)-T.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getYForLine(this.getNumLines()-1)+T.STAVE_LINE_THICKNESS/2}setX(i){const y=i-this.x;this.formatted=!1,this.x=i,this.start_x+=y,this.end_x+=y;for(let C=0;CC.getWidth()&&(y-=C.getWidth()),y}setRepetitionTypeLeft(i,y){return this.modifiers.push(new It(i,this.x,y)),this}setRepetitionTypeRight(i,y){return this.modifiers.push(new It(i,this.x,y)),this}setVoltaType(i,y,C){return this.modifiers.push(new jt(i,y,this.x,C)),this}setSection(i,y,C=0,B=12){const $=new Jt(i,this.x+C,y);return $.font.size=B,this.modifiers.push($),this}setTempo(i,y){return this.modifiers.push(new hi(i,this.x,y)),this}setText(i,y,C){return this.modifiers.push(new $r(i,y,C)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new x(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const i=this.options,y=i.spacing_between_lines_px;return this.getYForLine(i.num_lines)+i.space_below_staff_ln*y}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(i){const y=this.options,C=y.spacing_between_lines_px,B=y.space_above_staff_ln;return this.y+i*C+B*C}getLineForY(i){const y=this.options,C=y.spacing_between_lines_px,B=y.space_above_staff_ln;return(i-this.y)/C-B}getYForTopText(i){const y=i||0;return this.getYForLine(-y-this.options.top_text_position)}getYForBottomText(i){const y=i||0;return this.getYForLine(this.options.bottom_text_position+y)}getYForNote(i){const y=this.options,C=y.spacing_between_lines_px,B=y.space_above_staff_ln;return this.y+B*C+5*C-i*C}getYForGlyphs(){return this.getYForLine(3)}addModifier(i,y){return y!==void 0&&i.setPosition(y),i.setStave(this),this.formatted=!1,this.modifiers.push(i),this}addEndModifier(i){return this.addModifier(i,dt.Position.END),this}setBegBarType(i){const{SINGLE:y,REPEAT_BEGIN:C,NONE:B}=Tt.type;return i!==y&&i!==C&&i!==B||(this.modifiers[0].setType(i),this.formatted=!1),this}setEndBarType(i){return i!==Tt.type.REPEAT_BEGIN&&(this.modifiers[1].setType(i),this.formatted=!1),this}setClef(i,y,C,B){B===void 0&&(B=dt.Position.BEGIN),B===dt.Position.END?this.endClef=i:this.clef=i;const $=this.getModifiers(B,Lt.CATEGORY);return $.length===0?this.addClef(i,y,C,B):$[0].setType(i,y,C),this}setEndClef(i,y,C){return this.setClef(i,y,C,dt.Position.END),this}setKeySignature(i,y,C){C===void 0&&(C=dt.Position.BEGIN);const B=this.getModifiers(C,Bn.CATEGORY);return B.length===0?this.addKeySignature(i,y,C):B[0].setKeySig(i,y),this}setEndKeySignature(i,y){return this.setKeySignature(i,y,dt.Position.END),this}setTimeSignature(i,y,C){C===void 0&&(C=dt.Position.BEGIN);const B=this.getModifiers(C,sn.CATEGORY);return B.length===0?this.addTimeSignature(i,y,C):B[0].setTimeSig(i),this}setEndTimeSignature(i,y){return this.setTimeSignature(i,y,dt.Position.END),this}addKeySignature(i,y,C){return C===void 0&&(C=dt.Position.BEGIN),this.addModifier(new Bn(i,y).setPosition(C),C),this}addClef(i,y,C,B){return B===void 0||B===dt.Position.BEGIN?this.clef=i:B===dt.Position.END&&(this.endClef=i),this.addModifier(new Lt(i,y,C),B),this}addEndClef(i,y,C){return this.addClef(i,y,C,dt.Position.END),this}addTimeSignature(i,y,C){return this.addModifier(new sn(i,y),C),this}addEndTimeSignature(i,y){return this.addTimeSignature(i,y,dt.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(i,y){return i===void 0&&y===void 0?this.modifiers:this.modifiers.filter(C=>!(i!==void 0&&i!==C.getPosition()||y!==void 0&&y!==C.getCategory()))}sortByCategory(i,y){for(let C=i.length-1;C>=0;C--)for(let B=0;By[i[B+1].getCategory()]){const $=i[B];i[B]=i[B+1],i[B+1]=$}}format(){const i=this.modifiers[0],y=this.modifiers[1],C=this.getModifiers(dt.Position.BEGIN),B=this.getModifiers(dt.Position.END);let $,Z,se;this.sortByCategory(C,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(B,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),C.length>1&&i.getType()===Tt.type.REPEAT_BEGIN&&(C.push(C.splice(0,1)[0]),C.splice(0,0,new Tt(Tt.type.SINGLE))),B.indexOf(y)>0&&B.splice(0,0,new Tt(Tt.type.NONE));let ue=0,ve=this.x;for(let Ae=0;Aeve?ve=Ce:se.setX(ve),ve+=$,Z+$===0&&ue--}ve>this.start_x&&this.setStartX(ve),ve=this.x+this.width;const we={left:0,right:0,paddingRight:0,paddingLeft:0};let Pe=0;for(let Ae=0;Ae0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const $=this.context.measureText(""+this.measure).width;B=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-$/2,B),this.context.restore()}return this}drawVertical(i,y){this.drawVerticalFixed(this.x+i,y)}drawVerticalFixed(i,y){this.checkContext();const C=this.getYForLine(0),B=this.getYForLine(this.options.num_lines-1);y&&this.context.fillRect(i-3,C,1,B-C+1),this.context.fillRect(i,C,1,B-C+1)}drawVerticalBar(i){this.drawVerticalBarFixed(this.x+i,!1)}drawVerticalBarFixed(i){this.checkContext();const y=this.getYForLine(0),C=this.getYForLine(this.options.num_lines-1);this.context.fillRect(i,y,1,C-y+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(i,y){if(i>=this.options.num_lines||i<0)throw new h.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(y.visible===void 0)throw new h.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if(typeof y.visible!="boolean")throw new h.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[i]=y,this}setConfigForLines(i){if(i.length!==this.options.num_lines)throw new h.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const y in i)i[y]||(i[y]=this.options.line_config[y]),h.Merge(this.options.line_config[y],i[y]);return this.options.line_config=i,this}}class kn extends Xn{constructor(i,y,C,B){const $={spacing_between_lines_px:13,num_lines:6,top_text_position:1};h.Merge($,B),super(i,y,C,$),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class Yn extends be{static get CATEGORY(){return"tabnotes"}constructor(i,y){if(super(i),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=i.positions,h.Merge(this.render_options,{glyph_font_scale:T.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:y,draw_dots:y,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=T.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new h.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(i)}`);this.buildStem(),i.stem_direction?this.setStemDirection(i.stem_direction):this.setStemDirection(R.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return Yn.CATEGORY}setGhost(i){return this.ghost=i,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const i=this.getGlyph();return this.stem_extension_override!=null?this.stem_extension_override:i?this.getStemDirection()===1?i.tabnote_stem_up_extension:i.tabnote_stem_down_extension:0}addDot(){const i=new ge;return this.dots+=1,this.addModifier(i,0)}updateWidth(){this.glyphs=[],this.width=0;for(let i=0;ithis.width}setStave(i){let y;if(super.setStave(i),this.context=i.context,this.context){const B=this.context;for(this.width=0,y=0;y$.width),this.width=Math.max($.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const C=this.positions.map(({str:B})=>i.getYForLine(B-1));return this.setYs(C),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(i){this.setModifierContext(i);for(let y=0;y{(i.getCategory()!=="dots"||this.render_options.draw_dots)&&(i.setContext(this.context),i.drawWithStyle())})}drawStemThrough(){const i=this.getStemX(),y=this.getStemY(),C=this.context,B=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&B){const $=function(se,ue){const ve=[];let we=[];for(let Pe=1;Pe<=se;Pe++)ue.indexOf(Pe)>-1?(ve.push(we),we=[]):we.push(Pe);return we.length>0&&ve.push(we),ve}(this.stave.getNumLines(),this.positions.map(se=>se.str)),Z=function(se,ue,ve,we){const Pe=we!==1,Ae=we!==-1,Ce=ve.getSpacingBetweenLines(),Ve=ve.getNumLines(),je=[];return ue.forEach($e=>{const Je=$e.indexOf(Ve)>-1,pt=$e.indexOf(1)>-1;if(Pe&&pt||Ae&&Je)return;$e.length===1&&$e.push($e[0]);const ht=[];$e.forEach((bt,kt,zt)=>{const tn=bt===1,Cn=bt===Ve;let Sn=ve.getYForLine(bt-1);kt!==0||tn?kt!==zt.length-1||Cn||(Sn+=Ce/2-1):Sn-=Ce/2-1,ht.push(Sn),we===1&&tn?ht.push(se-2):we===-1&&Cn&&ht.push(se+2)}),je.push(ht.sort((bt,kt)=>bt-kt))}),je}(y,$,this.getStave(),this.getStemDirection());C.save(),C.setLineWidth(R.WIDTH),Z.forEach(se=>{se.length!==0&&(C.beginPath(),C.moveTo(i,se[0]),C.lineTo(i,se[se.length-1]),C.stroke(),C.closePath())}),C.restore()}}drawPositions(){const i=this.context,y=this.getAbsoluteX(),C=this.ys;for(let B=0;BparseInt(B,10)?sr.SLIDE_DOWN:sr.SLIDE_UP}this.slide_direction=y,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(i)}renderTie(i){if(i.first_ys.length===0||i.last_ys.length===0)throw new h.RERR("BadArguments","No Y-values to render");const y=this.context,C=i.first_x_px,B=i.first_ys,$=i.last_x_px,Z=this.slide_direction;if(Z!==sr.SLIDE_UP&&Z!==sr.SLIDE_DOWN)throw new h.RERR("BadSlide","Invalid slide direction");for(let se=0;sethis.numStrings)throw new h.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${i}`);return this.tuningValues[y-1]}getValueForFret(i,y){const C=this.getValueForString(y),B=parseInt(i,10);if(B<0)throw new h.RERR("BadArguments","Fret number must be 0 or higher: "+i);return C+B}getNoteForFret(i,y){const C=this.getValueForFret(i,y),B=Math.floor(C/12),$=C%12;return T.integerToNote($)+"/"+B}}class ms extends u{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(i,y,C,B,$,Z){const se=y.pixelsPerTick;if(se==null)throw new h.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const ue=se*Z.left_shift_ticks,ve=se*Z.right_shift_ticks,we={height:Z.height,y_shift:Z.y_shift,left_shift_px:ue,right_shift_px:ve};new ms({first_note:C.first_note,last_note:C.last_note},B).setContext(i).setRenderOptions(we).setPosition($).draw()}constructor(i,y){super(),this.setAttribute("type","StaveHairpin"),this.notes=i,this.hairpin=y,this.position=ae.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(i)}setPosition(i){return i!==ae.Position.ABOVE&&i!==ae.Position.BELOW||(this.position=i),this}setRenderOptions(i){return i.height!=null&&i.y_shift!=null&&i.left_shift_px!=null&&i.right_shift_px!=null&&(this.render_options=i),this}setNotes(i){if(!i.first_note&&!i.last_note)throw new h.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=i.first_note,this.last_note=i.last_note,this}renderHairpin(i){const y=this.checkContext();let C=this.render_options.y_shift+20,B=i.first_y;this.position===ae.Position.ABOVE&&(C=30-C,B=i.first_y-i.staff_height);const $=this.render_options.left_shift_px,Z=this.render_options.right_shift_px;switch(y.beginPath(),this.hairpin){case ms.type.CRESC:y.moveTo(i.last_x+Z,B+C),y.lineTo(i.first_x+$,B+this.render_options.height/2+C),y.lineTo(i.last_x+Z,B+this.render_options.height+C);break;case ms.type.DECRESC:y.moveTo(i.first_x+$,B+C),y.lineTo(i.last_x+Z,B+this.render_options.height/2+C),y.lineTo(i.first_x+$,B+this.render_options.height+C)}y.stroke(),y.closePath()}draw(){this.checkContext(),this.setRendered();const i=this.first_note,y=this.last_note,C=i.getModifierStartXY(this.position,0),B=y.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:C.x,last_x:B.x,first_y:i.getStave().y+i.getStave().height,last_y:y.getStave().y+y.getStave().height,staff_height:i.getStave().height}),!0}}class Hi extends u{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:Hi.Position.NEAR_HEAD,nearTop:Hi.Position.NEAR_TOP}}constructor(i,y,C){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:Hi.Position.NEAR_HEAD,position_end:Hi.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},h.Merge(this.render_options,C),this.setNotes(i,y)}setNotes(i,y){if(!i&&!y)throw new h.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=i,this.to=y,this}isPartial(){return!this.from||!this.to}renderCurve(i){const y=this.context,C=this.render_options.cps,B=this.render_options.x_shift,$=this.render_options.y_shift*i.direction,Z=i.first_x+B,se=i.first_y+$,ue=i.last_x-B,ve=i.last_y+$,we=this.render_options.thickness,Pe=(ue-Z)/(C.length+2);y.beginPath(),y.moveTo(Z,se),y.bezierCurveTo(Z+Pe+C[0].x,se+C[0].y*i.direction,ue-Pe+C[1].x,ve+C[1].y*i.direction,ue,ve),y.bezierCurveTo(ue-Pe+C[1].x,ve+(C[1].y+we)*i.direction,Z+Pe+C[0].x,se+(C[0].y+we)*i.direction,Z,se),y.stroke(),y.closePath(),y.fill()}draw(){this.checkContext(),this.setRendered();const i=this.from,y=this.to;let C,B,$,Z,se,ue="baseY",ve="baseY";function we(Ce){return typeof Ce=="string"?Hi.PositionString[Ce]:Ce}const Pe=we(this.render_options.position),Ae=we(this.render_options.position_end);return Pe===Hi.Position.NEAR_TOP&&(ue="topY",ve="topY"),Ae===Hi.Position.NEAR_HEAD?ve="baseY":Ae===Hi.Position.NEAR_TOP&&(ve="topY"),i?(C=i.getTieRightX(),se=i.getStemDirection(),$=i.getStemExtents()[ue]):(C=y.getStave().getTieStartX(),$=y.getStemExtents()[ue]),y?(B=y.getTieLeftX(),se=y.getStemDirection(),Z=y.getStemExtents()[ve]):(B=i.getStave().getTieEndX(),Z=i.getStemExtents()[ve]),this.renderCurve({first_x:C,last_x:B,first_y:$,last_y:Z,direction:se*(this.render_options.invert===!0?-1:1)}),!0}}function Vo(...Ie){Ds.DEBUG&&h.L("Vex.Flow.TextDynamics",Ie)}class Ds extends ne{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(i){super(i),this.setAttribute("type","TextDynamics"),this.sequence=i.text.toLowerCase(),this.line=i.line||0,this.glyphs=[],h.Merge(this.render_options,{glyph_font_size:40}),Vo("New Dynamics Text: ",this.sequence)}setLine(i){return this.line=i,this}preFormat(){let i=0;return this.sequence.split("").forEach(y=>{const C=Ds.GLYPHS[y];if(!C)throw new h.RERR("Invalid dynamics character: "+y);const B=this.render_options.glyph_font_size,$=new S(C.code,B);this.glyphs.push($),i+=C.width}),this.setWidth(i),this.preFormatted=!0,this}draw(){this.setRendered();const i=this.getAbsoluteX(),y=this.stave.getYForLine(this.line+-3);Vo("Rendering Dynamics: ",this.sequence);let C=i;this.glyphs.forEach((B,$)=>{const Z=this.sequence[$];B.render(this.context,C,y),C+=Ds.GLYPHS[Z].width})}}function wl(Ie,i,y,C,B,$,Z){Ie.beginPath(),Ie.moveTo(i,y),Ie.lineTo(C,B),Ie.lineTo($,Z),Ie.lineTo(i,y),Ie.closePath(),Ie.fill()}class fe extends u{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(i){super(),this.setAttribute("type","StaveLine"),this.notes=i,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:fe.TextVerticalPosition.TOP,text_justification:fe.TextJustification.CENTER},this.setNotes(i)}setFont(i){return this.font=i,this}setText(i){return this.text=i,this}setNotes(i){if(!i.first_note&&!i.last_note)throw new h.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(i.first_indices||(i.first_indices=[0]),i.last_indices||(i.last_indices=[0]),i.first_indices.length!==i.last_indices.length)throw new h.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=i.first_note,this.first_indices=i.first_indices,this.last_note=i.last_note,this.last_indices=i.last_indices,this}applyLineStyle(){const i=this.checkContext(),y=this.render_options;y.line_dash&&i.setLineDash(y.line_dash),y.line_width&&i.setLineWidth(y.line_width),y.rounded_end?i.setLineCap("round"):i.setLineCap("square")}applyFontStyle(){const i=this.checkContext();this.font&&i.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color))}draw(){const i=this.checkContext();this.setRendered();const y=this.first_note,C=this.last_note,B=this.render_options;let $,Z;i.save(),this.applyLineStyle(),this.first_indices.forEach((Ae,Ce)=>{const Ve=this.last_indices[Ce];$=y.getModifierStartXY(2,Ae),Z=C.getModifierStartXY(1,Ve);const je=$.y>Z.y;$.x+=y.getMetrics().modRightPx+B.padding_left,Z.x-=C.getMetrics().modLeftPx+B.padding_right;const $e=y.getGlyph().getWidth();y.getKeyProps()[Ae].displaced&&y.getStemDirection()===1&&($.x+=$e+B.padding_left),C.getKeyProps()[Ve].displaced&&C.getStemDirection()===-1&&(Z.x-=$e+B.padding_right),$.y+=je?-3:1,Z.y+=je?2:0,function(Je,pt,ht,bt){const kt=bt.draw_start_arrow&&bt.draw_end_arrow,zt=pt.x,tn=pt.y,Cn=ht.x,Sn=ht.y,Ai=Math.sqrt((Cn-zt)*(Cn-zt)+(Sn-tn)*(Sn-tn)),ei=(Ai-bt.arrowhead_length/3)/Ai;let ti,ji,ur,gn;bt.draw_end_arrow||kt?(ti=Math.round(zt+(Cn-zt)*ei),ji=Math.round(tn+(Sn-tn)*ei)):(ti=Cn,ji=Sn),bt.draw_start_arrow||kt?(ur=zt+(Cn-zt)*(1-ei),gn=tn+(Sn-tn)*(1-ei)):(ur=zt,gn=tn),bt.color&&(Je.setStrokeStyle(bt.color),Je.setFillStyle(bt.color)),Je.beginPath(),Je.moveTo(ur,gn),Je.lineTo(ti,ji),Je.stroke(),Je.closePath();const hn=Math.atan2(Sn-tn,Cn-zt),Xi=Math.abs(bt.arrowhead_length/Math.cos(bt.arrowhead_angle));let vs,Ws,Ss,Es,zs,co;(bt.draw_end_arrow||kt)&&(vs=hn+Math.PI+bt.arrowhead_angle,Ss=Cn+Math.cos(vs)*Xi,Es=Sn+Math.sin(vs)*Xi,Ws=hn+Math.PI-bt.arrowhead_angle,zs=Cn+Math.cos(Ws)*Xi,co=Sn+Math.sin(Ws)*Xi,wl(Je,Ss,Es,Cn,Sn,zs,co)),(bt.draw_start_arrow||kt)&&(vs=hn+bt.arrowhead_angle,Ss=zt+Math.cos(vs)*Xi,Es=tn+Math.sin(vs)*Xi,Ws=hn-bt.arrowhead_angle,zs=zt+Math.cos(Ws)*Xi,co=tn+Math.sin(Ws)*Xi,wl(Je,Ss,Es,zt,tn,zs,co))}(i,$,Z,this.render_options)}),i.restore();const se=i.measureText(this.text).width,ue=B.text_justification;let ve,we=0;ue===fe.TextJustification.LEFT?we=$.x:ue===fe.TextJustification.CENTER?we=(Z.x-$.x)/2+$.x-se/2:ue===fe.TextJustification.RIGHT&&(we=Z.x-se);const Pe=B.text_position_vertical;return Pe===fe.TextVerticalPosition.TOP?ve=y.getStave().getYForTopText():Pe===fe.TextVerticalPosition.BOTTOM&&(ve=y.getStave().getYForBottomText(T.TEXT_HEIGHT_OFFSET_HACK)),i.save(),this.applyFontStyle(),i.fillText(this.text,we,ve),i.restore(),this}}function xn(Ie,i,y,C,B){const $=Qt.GLYPHS[Ie];new S($.code,B).render(i,y+$.x_shift,C+$.y_shift)}class Qt extends u{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:Qt.Styles.TEXT,bracket:Qt.Styles.BRACKET,mixed:Qt.Styles.MIXED,mixed_open_end:Qt.Styles.MIXED_OPEN_END,bracket_open_begin:Qt.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:Qt.Styles.BRACKET_OPEN_END,bracket_open_both:Qt.Styles.BRACKET_OPEN_BOTH}}static createSustain(i){return new Qt(i)}static createSostenuto(i){const y=new Qt(i);return y.setStyle(Qt.Styles.MIXED),y.setCustomText("Sost. Ped."),y}static createUnaCorda(i){const y=new Qt(i);return y.setStyle(Qt.Styles.TEXT),y.setCustomText("una corda","tre corda"),y}constructor(i){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=i,this.style=Qt.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(i){if(this.endStave=i,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let y=0;y3)throw new h.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=i,this}setLine(i){return this.line=i,this}drawBracketed(){const i=this.context;let y,C,B=!1;const $=this;this.notes.forEach((Z,se,ue)=>{B=!B;let ve=0;if(Z?(ve=Z.getNoteHeadBeginX(),this.BeginsStave&&(ve=Z.getStave().getNoteStartX())):ve=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)B?this.ChangeBegin&&(ve=Z.getAbsoluteX()):(ve=Z?this.ChangeEnd?Z.getAbsoluteX():Z.getStave().end_x+this.endStaveAddedWidth-$.render_options.text_margin_right:this.endStave.end_x+this.endStaveAddedWidth-$.render_options.text_margin_right,this.endMargin=-$.render_options.text_margin_right);else if(Z)if(B)this.ChangeBegin&&(ve=Z.getAbsoluteX());else switch($.style){case Qt.Styles.BRACKET_OPEN_END:case Qt.Styles.BRACKET_OPEN_BOTH:case Qt.Styles.MIXED_OPEN_END:ve=Z.getNoteHeadEndX();break;default:this.ChangeEnd?ve=Z.getAbsoluteX():(ve=Z.getNoteHeadBeginX()-$.render_options.text_margin_right,this.startMargin=-$.render_options.text_margin_right)}let we=this.endStave;Z&&(we=Z.getStave());let Pe=we.getYForBottomText($.line+3);C&&C>Pe&&(Pe=C);const Ae=ue[se+1]===Z,Ce=ue[se-1]===Z;let Ve=0;if(B)if(Ve=Ce?5:0,$.style!==Qt.Styles.MIXED&&$.style!==Qt.Styles.MIXED_OPEN_END||Ce)i.beginPath(),$.style===Qt.Styles.BRACKET_OPEN_BEGIN||$.style===Qt.Styles.BRACKET_OPEN_BOTH?i.moveTo(ve+Ve,Pe):(this.ChangeBegin&&(ve+=5),i.moveTo(ve,Pe-$.render_options.bracket_height),this.ChangeBegin&&(ve+=5),i.lineTo(ve+Ve,Pe)),i.stroke(),i.closePath();else if($.custom_depress_text){const je=i.measureText($.custom_depress_text).width;i.fillText($.custom_depress_text,ve-je/2,Pe),Ve=je/2+$.render_options.text_margin_right}else xn("pedal_depress",i,ve,Pe,$.render_options.glyph_point_size),Ve=20+$.render_options.text_margin_right;else Ve=Ae&&!this.EndsStave?-5:0,i.beginPath(),i.moveTo(y,C),i.lineTo(ve+Ve,Pe),$.style!==Qt.Styles.BRACKET_OPEN_END&&$.style!==Qt.Styles.MIXED_OPEN_END&&$.style!==Qt.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(ve+=5),i.lineTo(ve,Pe-$.render_options.bracket_height)),i.stroke(),i.closePath();y=ve+Ve,C=Pe})}drawText(){const i=this.context;let y=!1;const C=this,B=C.render_options.glyph_point_size;this.notes.forEach($=>{if(!$)return;y=!y;const Z=$.getStave(),se=$.getAbsoluteX(),ue=Z.getYForBottomText(C.line+3);let ve=0;y?C.custom_depress_text?(ve=i.measureText(C.custom_depress_text).width,i.fillText(C.custom_depress_text,se-ve/2,ue)):xn("pedal_depress",i,se,ue,B):C.custom_release_text?(ve=i.measureText(C.custom_release_text).width,i.fillText(C.custom_release_text,se-ve/2,ue)):xn("pedal_release",i,se,ue,B)})}draw(){const i=this.checkContext();this.setRendered(),i.save(),i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color),i.setFont(this.font.family,this.font.size,this.font.weight),Qt.DEBUG&&h.L("Vex.Flow.PedalMarking",["Rendering Pedal Marking"]),this.style===Qt.Styles.BRACKET||this.style===Qt.Styles.MIXED||this.style===Qt.Styles.MIXED_OPEN_END||this.style===Qt.Styles.BRACKET_OPEN_BEGIN||this.style===Qt.Styles.BRACKET_OPEN_END||this.style===Qt.Styles.BRACKET_OPEN_BOTH?(i.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===Qt.Styles.TEXT&&this.drawText(),i.restore()}}class xi extends u{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:xi.Positions.TOP,bottom:xi.Positions.BOTTOM}}constructor({start:i,stop:y,text:C="",superscript:B="",position:$=xi.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=i,this.stop=y,this.text=C,this.superscript=B,this.position=typeof $=="string"?xi.PositionString[$]:$,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(i){return i.setFont(this.font.family,this.font.size,this.font.weight),i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color),i.setLineWidth(this.render_options.line_width),this}setDashed(i,y){return this.render_options.dashed=i,y&&(this.render_options.dash=y),this}setFont(i){return this.font={...this.font,...i},this}setLine(i){return this.line=i,this}draw(){const i=this.context;this.setRendered();let y=0;switch(this.position){case xi.Positions.TOP:y=this.start.getStave().getYForTopText(this.line);break;case xi.Positions.BOTTOM:y=this.start.getStave().getYForBottomText(this.line+T.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new h.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const C={x:this.start.getAbsoluteX(),y},B={x:this.stop.getAbsoluteX(),y};(function(...Ve){xi.DEBUG&&h.L("Vex.Flow.TextBracket",Ve)})("Rendering TextBracket: start:",C,"stop:",B,"y:",y);const $=this.render_options.bracket_height*this.position;i.save(),this.applyStyle(i),i.fillText(this.text,C.x,C.y);let Z=i.measureText(this.text).width;Z>0||(Z=10*this.text.length);let se=i.measureText("M").width;se>0||(se=20);const ue=C.y-se/2.5;i.setFont(this.font.family,this.font.size/1.4,this.font.weight),i.fillText(this.superscript,C.x+Z+1,ue);let ve=i.measureText(this.superscript).width;ve>0||(ve=12,this.superscript.includes("m")&&(ve+=5));let we=i.measureText("M").width;we>0||(we=10);let Pe=C.x,Ae=ue,Ce=B.x+this.stop.getGlyph().getWidth();this.position===xi.Positions.TOP?(Pe+=Z+ve+5,Ae-=we/2.7):this.position===xi.Positions.BOTTOM&&(Ae+=we/2.7,Pe+=Z+2,this.render_options.underline_superscript||(Pe+=ve)),this.render_options.dashed?(Ce0||y===!0;return!y||$>0||(this.pos=B),se?this.matchSuccess():this.matchFail(B),{success:se,results:C,numMatches:$}}expectZeroOrMore(i){return this.expectOneOrMore(i,!0)}expect(i){let y;if(function(...B){ar.DEBUG&&h.L("Vex.Flow.Parser",B)}("Evaluating rules:",i),!i)throw new Li("Invalid Rule: "+i,i);const C=i.bind(this.grammar)();if(C.token)y=this.matchToken(C.token,C.noSpace===!0),y.success&&(this.pos+=y.incrementPos);else{if(!C.expect)throw new Li("Bad grammar! No `token` or `expect` property",C);y=C.oneOrMore?this.expectOneOrMore(C):C.zeroOrMore?this.expectZeroOrMore(C):this.expectOne(C)}return y.matches=[],y.results&&y.results.forEach(B=>y.matches.push(Cr(B))),C.run&&y.success&&C.run(y),y}}function wi(...Ie){zo.DEBUG&&h.L("Vex.Flow.EasyScore",Ie)}const bs=h.MakeException("EasyScoreError");class cn{constructor(i){this.builder=i}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:i=>this.builder.addChord(i.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:i=>this.builder.addSingleNote(i.matches[0],i.matches[1],i.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:i=>this.builder.setNoteDots(i.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:i=>this.builder.setNoteType(i.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:i=>this.builder.setNoteDuration(i.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:i=>this.builder.addNoteOption(i.matches[0],i.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class Tl{constructor(i){this.factory=i,this.commitHooks=[],this.reset()}reset(i={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,i)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(i){this.commitHooks.push(i)}resetPiece(){wi("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(i){wi("setNoteDots:",i),i&&(this.piece.dots=i.length)}setNoteDuration(i){wi("setNoteDuration:",i),this.rollingDuration=this.piece.duration=i||this.rollingDuration}setNoteType(i){wi("setNoteType:",i),i&&(this.piece.type=i)}addNoteOption(i,y){wi("addNoteOption: key:",i,"value:",y),this.piece.options[i]=y}addNote(i,y,C){wi("addNote:",i,y,C),this.piece.chord.push({key:i,accid:y,octave:C})}addSingleNote(i,y,C){wi("addSingleNote:",i,y,C),this.addNote(i,y,C)}addChord(i){wi("startChord"),typeof i[0]!="object"?this.addSingleNote(i[0]):i.forEach(y=>{y&&this.addNote(...y)}),wi("endChord")}commitPiece(){wi("commitPiece");const{factory:i}=this;if(!i)return;const y={...this.options,...this.piece.options},{stem:C,clef:B}=y,$=C.toLowerCase()==="auto",Z=$||C.toLowerCase()!=="up"?ee.STEM_DOWN:ee.STEM_UP,{chord:se,duration:ue,dots:ve,type:we}=this.piece,Pe=se.map(Ve=>Ve.key+"/"+Ve.octave),Ae=i.StaveNote({keys:Pe,duration:ue,dots:ve,type:we,clef:B,auto_stem:$});$||Ae.setStemDirection(Z);const Ce=se.map(Ve=>Ve.accid||null);Ce.forEach((Ve,je)=>{Ve&&Ae.addAccidental(je,i.Accidental({type:Ve}))});for(let Ve=0;VeVe(y,Ae,this)),this.elements.notes.push(Ae),this.elements.accidentals.concat(Ce),this.resetPiece()}}function Wo({id:Ie},i){Ie!==void 0&&i.setAttribute("id",Ie)}function Vs(Ie,i){Ie.class&&Ie.class.split(/\s*,\s*/).forEach(y=>i.addClass(y))}class zo{constructor(i={}){this.setOptions(i),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(i){return Object.assign(this.defaults,i),this}setOptions(i){return this.options={factory:null,builder:null,commitHooks:[Wo,Vs,Re.easyScoreHook],throwOnError:!1,...i},this.factory=this.options.factory,this.builder=this.options.builder||new Tl(this.factory),this.grammar=new cn(this.builder),this.parser=new ar(this.grammar),this.options.commitHooks.forEach(y=>this.addCommitHook(y)),this}setContext(i){return this.factory&&this.factory.setContext(i),this}parse(i,y={}){this.builder.reset(y);const C=this.parser.parse(i);if(!C.success&&this.options.throwOnError)throw new bs("Error parsing line: "+i,C);return C}beam(i,y={}){return this.factory.Beam({notes:i,options:y}),i}tuplet(i,y={}){return this.factory.Tuplet({notes:i,options:y}),i}notes(i,y={}){return y={clef:this.defaults.clef,stem:this.defaults.stem,...y},this.parse(i,y),this.builder.getElements().notes}voice(i,y){return y={time:this.defaults.time,...y},this.factory.Voice(y).addTickables(i)}addCommitHook(i){return this.builder.addCommitHook(i)}}const lr=h.MakeException("FactoryError");function mn(Ie={},i){const y=i.options;return(Ie=Object.assign(i,Ie)).options=Object.assign(y,Ie.options),Ie}class ys{constructor(i){(function(...C){ys.DEBUG&&h.L("Vex.Flow.Factory",C)})("New factory: ",i);const y={stave:{space:10},renderer:{context:null,elementId:"",backend:I.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=y,this.setOptions(i)}static newFromElementId(i,y=500,C=200){return new ys({renderer:{elementId:i,width:y,height:C}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(i){for(const y of["stave","renderer","font"])Object.assign(this.options[y],i[y]);(this.options.renderer.elementId!==null||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:i,backend:y,width:C,height:B,background:$}=this.options.renderer;if(i==="")throw new lr("HTML DOM element not set in Factory");this.context=I.buildContext(i,y,C,B,$)}getContext(){return this.context}setContext(i){return this.context=i,this}getStave(){return this.stave}getVoices(){return this.voices}space(i){return this.options.stave.space*i}Stave(i){i=mn(i,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const y=new Xn(i.x,i.y,i.width,i.options);return this.staves.push(y),y.setContext(this.context),this.stave=y,y}TabStave(i){i=mn(i,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const y=new kn(i.x,i.y,i.width,i.options);return this.staves.push(y),y.setContext(this.context),this.stave=y,y}StaveNote(i){const y=new ee(i);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}GhostNote(i){const y=new _l(i);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}TextNote(i){const y=new jn(i);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}BarNote(i){i=mn(i,{type:"single",options:{}});const y=new gs(i.type);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}ClefNote(i){i=mn(i,{type:"treble",options:{size:"default"}});const y=new Dt(i.type,i.options.size,i.options.annotation);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}TimeSigNote(i){i=mn(i,{time:"4/4",options:{}});const y=new xl(i.time);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}KeySigNote(i){const y=new El(i.key,i.cancelKey,i.alterKey);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}TabNote(i){const y=new Yn(i);return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}GraceNote(i){const y=new ps(i);return this.stave&&y.setStave(this.stave),y.setContext(this.context),y}GraceNoteGroup(i){const y=new q(i.notes,i.slur);return y.setContext(this.context),y}Accidental(i){i=mn(i,{type:null,options:{}});const y=new re(i.type);return y.setContext(this.context),y}Annotation(i){i=mn(i,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const y=new qe(i.text);return y.setJustification(i.hJustify),y.setVerticalJustification(i.vJustify),y.setFont(i.fontFamily,i.fontSize,i.fontWeight),y.setContext(this.context),y}Articulation(i){i=mn(i,{type:"a.",position:"above",options:{}});const y=new Re(i.type);return y.setPosition(i.position),y.setContext(this.context),y}TextDynamics(i){i=mn(i,{text:"p",duration:"q",dots:0,line:0,options:{}});const y=new Ds({text:i.text,line:i.line,duration:i.duration,dots:i.dots});return this.stave&&y.setStave(this.stave),y.setContext(this.context),this.renderQ.push(y),y}Fingering(i){i=mn(i,{number:"0",position:"left",options:{}});const y=new ye(i.number);return y.setPosition(i.position),y.setContext(this.context),y}StringNumber(i){i=mn(i,{number:"0",position:"left",options:{}});const y=new le(i.number);return y.setPosition(i.position),y.setContext(this.context),y}TickContext(){return new he().setContext(this.context)}ModifierContext(){return new ft}MultiMeasureRest(i){const y=new Bs(i.number_of_measures,i);return y.setContext(this.context),this.renderQ.push(y),y}Voice(i){i=mn(i,{time:"4/4",options:{}});const y=new G(i.time);return this.voices.push(y),y}StaveConnector(i){i=mn(i,{top_stave:null,bottom_stave:null,type:"double",options:{}});const y=new L(i.top_stave,i.bottom_stave);return y.setType(i.type).setContext(this.context),this.renderQ.push(y),y}Formatter(){return new Et}Tuplet(i){i=mn(i,{notes:[],options:{}});const y=new V(i.notes,i.options).setContext(this.context);return this.renderQ.push(y),y}Beam(i){i=mn(i,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const y=new W(i.notes,i.options.autoStem).setContext(this.context);return y.breakSecondaryAt(i.options.secondaryBeamBreaks),this.renderQ.push(y),y}Curve(i){i=mn(i,{from:null,to:null,options:{}});const y=new Hi(i.from,i.to,i.options).setContext(this.context);return this.renderQ.push(y),y}StaveTie(i){i=mn(i,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const y=new z({first_note:i.from,last_note:i.to,first_indices:i.first_indices,last_indices:i.last_indices},i.text);return i.options.direction&&y.setDirection(i.options.direction),y.setContext(this.context),this.renderQ.push(y),y}StaveLine(i){i=mn(i,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const y=new fe({first_note:i.from,last_note:i.to,first_indices:i.first_indices,last_indices:i.last_indices});return i.options.text&&y.setText(i.options.text),i.options.font&&y.setFont(i.options.font),y.setContext(this.context),this.renderQ.push(y),y}VibratoBracket(i){i=mn(i,{from:null,to:null,options:{harsh:!1}});const y=new Di({start:i.from,stop:i.to});return i.options.line&&y.setLine(i.options.line),i.options.harsh&&y.setHarsh(i.options.harsh),y.setContext(this.context),this.renderQ.push(y),y}TextBracket(i){i=mn(i,{from:null,to:null,text:"",options:{superscript:"",position:1}});const y=new xi({start:i.from,stop:i.to,text:i.text,superscript:i.options.superscript,position:i.options.position});return i.options.line&&y.setLine(i.options.line),i.options.font&&y.setFont(i.options.font),y.setContext(this.context),this.renderQ.push(y),y}System(i={}){i.factory=this;const y=new uo(i).setContext(this.context);return this.systems.push(y),y}EasyScore(i={}){return i.factory=this,new zo(i)}PedalMarking(i={}){i=mn(i,{notes:[],options:{style:"mixed"}});const y=new Qt(i.notes);return y.setStyle(Qt.StylesString[i.options.style]),y.setContext(this.context),this.renderQ.push(y),y}NoteSubGroup(i={}){i=mn(i,{notes:[],options:{}});const y=new O(i.notes);return y.setContext(this.context),y}draw(){this.systems.forEach(i=>i.setContext(this.context).format()),this.staves.forEach(i=>i.setContext(this.context).draw()),this.voices.forEach(i=>i.setContext(this.context).draw()),this.renderQ.forEach(i=>{i.isRendered()||i.setContext(this.context).draw()}),this.systems.forEach(i=>i.setContext(this.context).draw()),this.reset()}}function Pl(Ie,i){const y=i.options;return(Ie=Object.assign(i,Ie)).options=Object.assign(y,Ie.options),Ie}class uo extends u{constructor(i={}){super(),this.setAttribute("type","System"),this.setOptions(i),this.parts=[]}setOptions(i={}){this.options=Pl(i,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new ys({renderer:{el:null}})}setContext(i){return super.setContext(i),this.factory.setContext(i),this}addConnector(i="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:i}),this.connector}addStave(i){return(i=Pl(i,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(i.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:i.options})),i.voices.forEach(y=>y.setContext(this.context).setStave(i.stave).getTickables().forEach(C=>C.setStave(i.stave))),this.parts.push(i),i.stave}format(){const i=new Et;this.formatter=i;let y=this.options.y,C=0,B=[];const $=[];this.parts.forEach(se=>{y+=se.stave.space(se.spaceAbove),se.stave.setY(y),i.joinVoices(se.voices),y+=se.stave.space(se.spaceBelow),y+=se.stave.space(this.options.spaceBetweenStaves),se.debugNoteMetrics&&($.push({y,voice:se.voices[0]}),y+=15),B=B.concat(se.voices),C=Math.max(C,se.stave.getNoteStartX())}),this.parts.forEach(se=>se.stave.setNoteStartX(C));const Z=this.options.width-(C-this.options.x)-ne.STAVEPADDING;i.format(B,Z);for(let se=0;se{y.voice.getTickables().forEach(C=>ne.plotMetrics(i,C,y.y))})}}(h.Flow=T).Element=u,h.Flow.Fraction=s,h.Flow.Renderer=I,h.Flow.Formatter=Et,h.Flow.Music=Ee,h.Flow.Glyph=S,h.Flow.Stave=Xn,h.Flow.StaveNote=ee,h.Flow.StaveModifier=dt,h.Flow.StaveTempo=hi,h.Flow.Voice=G,h.Flow.Accidental=re,h.Flow.Beam=W,h.Flow.StaveTie=z,h.Flow.TabStave=kn,h.Flow.TabNote=Yn,h.Flow.Bend=Ke,h.Flow.Vibrato=Ze,h.Flow.VibratoBracket=Di,h.Flow.Note=ne,h.Flow.ModifierContext=ft,h.Flow.MultiMeasureRest=Bs,h.Flow.TickContext=he,h.Flow.Articulation=Re,h.Flow.Annotation=qe,h.Flow.Barline=Tt,h.Flow.NoteHead=ie,h.Flow.StaveConnector=L,h.Flow.ClefNote=Dt,h.Flow.KeySignature=Bn,h.Flow.KeySigNote=El,h.Flow.TimeSignature=sn,h.Flow.TimeSigNote=xl,h.Flow.Stem=R,h.Flow.TabTie=Y,h.Flow.Clef=Lt,h.Flow.Dot=ge,h.Flow.Modifier=ae,h.Flow.TabSlide=sr,h.Flow.Tuplet=V,h.Flow.GraceNote=ps,h.Flow.GraceTabNote=ka,h.Flow.Tuning=Do,h.Flow.KeyManager=class{constructor(Ie){this.music=new Ee,this.setKey(Ie)}setKey(Ie){return this.key=Ie,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!Ee.scaleTypes[this.keyParts.type])throw new h.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Ee.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const Ie=Ee.root_indices[this.keyParts.root];for(let i=0;i{b.exports=`precision mediump float; -uniform sampler2D u_image; -varying vec4 v_position; - -#define NUM_ROWS 5 -#define ELEMENT_HEIGHT 300 - -void main() { - const float halfPixel = 1.0 / float(ELEMENT_HEIGHT * 2); - - vec2 absolutePosition = (v_position.xy + vec2(1.0)) / vec2(2.0); - float absX = absolutePosition.x; - float absY = absolutePosition.y; - - int skyLine = 0; - for (int i = 0; i < ELEMENT_HEIGHT; ++i) { - float ratioY = float(i) / float(ELEMENT_HEIGHT); - float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS); - float x = absX; - float y = absY + relY; - - float currentAlpha = texture2D(u_image, vec2(x, y)).a; - if (currentAlpha > 0.0) { - skyLine = i; - break; - } - } - - int bottomLine = ELEMENT_HEIGHT; - for (int i = ELEMENT_HEIGHT - 1; i >= 0; --i) { - float ratioY = float(i) / float(ELEMENT_HEIGHT); - float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS); - float x = absX; - float y = absY + relY; - - float currentAlpha = texture2D(u_image, vec2(x, y)).a; - if (currentAlpha > 0.0) { - bottomLine = i; - break; - } - } - - int r = skyLine; - if (r > 256) { - r -= 256; - } - int g = bottomLine; - if (g > 256) { - g -= 256; - } - int b = (skyLine / 256 * 16) + (bottomLine / 256); - - gl_FragColor = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, 1.0); -} -`},6357:b=>{b.exports=`attribute vec4 a_position; -varying vec4 v_position; - -void main() { - gl_Position = a_position; - v_position = a_position; -} -`}},l={};function g(b){var a=l[b];if(a!==void 0)return a.exports;var r=l[b]={exports:{}};return n[b].call(r.exports,r,r.exports,g),r.exports}return g.d=(b,a)=>{for(var r in a)g.o(a,r)&&!g.o(b,r)&&Object.defineProperty(b,r,{enumerable:!0,get:a[r]})},g.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),g.o=(b,a)=>Object.prototype.hasOwnProperty.call(b,a),g.r=b=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},g(3607)})())})(vx);var yB=vx.exports;class vB extends ke.Component{constructor(n){super(n);Um(this,"osmd");Um(this,"divRef");this.state={dataReady:!1},this.osmd=void 0,this.divRef=Qn.createRef()}async setupOsmd(){var n,l,g;await((n=this.osmd)==null?void 0:n.load(this.props.file)),(l=this.osmd)!=null&&l.IsReadyToRender()?(g=this.osmd)==null||g.render():console.error("OSMD not ready to render")}componentDidUpdate(n){var l;this.props.drawTitle!==n.drawTitle&&this.initOsmd(),this.props.file&&((l=this.osmd)==null||l.load(this.props.file).then(()=>{var g;return(g=this.osmd)==null?void 0:g.render()}))}initOsmd(){this.divRef.current&&(this.osmd=new yB.OpenSheetMusicDisplay(this.divRef.current,{drawFromMeasureNumber:0,autoResize:this.props.autoResize!==void 0?this.props.autoResize:!0,drawTitle:this.props.drawTitle!==void 0?this.props.drawTitle:!0,drawingParameters:"compacttight"}))}componentDidMount(){var n;this.initOsmd(),this.props.file&&((n=this.osmd)==null||n.load(this.props.file).then(()=>{var l;return(l=this.osmd)==null?void 0:l.render()}))}render(){return Be.jsx("div",{ref:this.divRef})}}function bf(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65}function SB(e){let t=2,n="";for(let l=e.length,g=0,b=0;b0&&b*4/3%76===0&&(n+=`\r -`),g|=e[b]<<(16>>>t&24),(t===2||e.length-b===1)&&(n+=String.fromCharCode(bf(g>>>18&63),bf(g>>>12&63),bf(g>>>6&63),bf(g&63)),g=0);return n.substring(0,n.length-2+t)+(t===2?"":t===1?"=":"==")}const EB="voices/";var Sx=(e=>(e.air="air",e.cicada="cicada",e.quake="quake",e))(Sx||{}),xB=(()=>{var e=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(t={}){var n=t,l,g;n.ready=new Promise((A,D)=>{l=A,g=D}),["_memory","___indirect_function_table","onRuntimeInitialized"].forEach(A=>{Object.getOwnPropertyDescriptor(n.ready,A)||Object.defineProperty(n.ready,A,{get:()=>Y("You are getting "+A+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>Y("You are setting "+A+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}),n.expectedDataFileDownloads||(n.expectedDataFileDownloads=0),n.expectedDataFileDownloads++,function(){if(!(n.ENVIRONMENT_IS_PTHREAD||n.$ww)){var A=function(D){typeof window=="object"?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var Q="../../../public/oddvoices_wasm.data",oe="oddvoices_wasm.data";typeof n.locateFilePackage=="function"&&!n.locateFile&&(n.locateFile=n.locateFilePackage,v("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var Se=n.locateFile?n.locateFile(oe,""):oe,Le=D.remote_package_size;function Fe(rt,gt,yt,St){var vt=new XMLHttpRequest;vt.open("GET",rt,!0),vt.responseType="arraybuffer",vt.onprogress=function(Bt){var Xt=rt,yn=gt;if(Bt.total&&(yn=Bt.total),Bt.loaded){vt.addedTotal?n.dataFileDownloads[Xt].loaded=Bt.loaded:(vt.addedTotal=!0,n.dataFileDownloads||(n.dataFileDownloads={}),n.dataFileDownloads[Xt]={loaded:Bt.loaded,total:yn});var lt=0,Pt=0,On=0;for(var En in n.dataFileDownloads){var bi=n.dataFileDownloads[En];lt+=bi.total,Pt+=bi.loaded,On++}lt=Math.ceil(lt*n.expectedDataFileDownloads/On),n.setStatus&&n.setStatus(`Downloading data... (${Pt}/${lt})`)}else n.dataFileDownloads||n.setStatus&&n.setStatus("Downloading data...")},vt.onerror=function(Bt){throw new Error("NetworkError for: "+rt)},vt.onload=function(Bt){if(vt.status==200||vt.status==304||vt.status==206||vt.status==0&&vt.response){var Xt=vt.response;yt(Xt)}else throw new Error(vt.statusText+" : "+vt.responseURL)},vt.send(null)}var De=null,et=n.getPreloadedPackage?n.getPreloadedPackage(Se,Le):null;et||Fe(Se,Le,function(rt){De?(De(rt),De=null):et=rt});function it(){function rt(Bt,Xt){if(!Bt)throw Xt+new Error().stack}n.FS_createPath("/","oddvoices",!0,!0);function gt(Bt,Xt,yn){this.start=Bt,this.end=Xt,this.audio=yn}gt.prototype={requests:{},open:function(Bt,Xt){this.name=Xt,this.requests[Xt]=this,n.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var Bt=this.byteArray.subarray(this.start,this.end);this.finish(Bt)},finish:function(Bt){var Xt=this;n.FS_createDataFile(this.name,null,Bt,!0,!0,!0),n.removeRunDependency(`fp ${Xt.name}`),this.requests[this.name]=null}};for(var yt=D.files,St=0;St{var D=new XMLHttpRequest;return D.open("GET",A,!1),D.send(null),D.responseText},x=(A,D,Q)=>{var oe=new XMLHttpRequest;oe.open("GET",A,!0),oe.responseType="arraybuffer",oe.onload=()=>{if(oe.status==200||oe.status==0&&oe.response){D(oe.response);return}Q()},oe.onerror=Q,oe.send(null)}}var p=n.print||console.log.bind(console),v=n.printErr||console.error.bind(console);Object.assign(n,a),a=null,$t(),n.arguments&&n.arguments,qe("arguments","arguments_"),n.thisProgram&&(r=n.thisProgram),qe("thisProgram","thisProgram"),n.quit&&n.quit,qe("quit","quit_"),_(typeof n.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),_(typeof n.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),_(typeof n.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),_(typeof n.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),_(typeof n.read>"u","Module.read option was removed (modify read_ in JS)"),_(typeof n.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),_(typeof n.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),_(typeof n.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),_(typeof n.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),qe("asm","wasmExports"),qe("read","read_"),qe("readAsync","readAsync"),qe("readBinary","readBinary"),qe("setWindowTitle","setWindowTitle"),_(!s,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),_(!m,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),_(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var S;n.wasmBinary&&(S=n.wasmBinary),qe("wasmBinary","wasmBinary"),typeof WebAssembly!="object"&&Y("no native wasm support detected");var T,P=!1;function _(A,D){A||Y("Assertion failed"+(D?": "+D:""))}var E,M,N,I,R,V,U,K;function k(){var A=T.buffer;n.HEAP8=E=new Int8Array(A),n.HEAP16=N=new Int16Array(A),n.HEAPU8=M=new Uint8Array(A),n.HEAPU16=I=new Uint16Array(A),n.HEAP32=R=new Int32Array(A),n.HEAPU32=V=new Uint32Array(A),n.HEAPF32=U=new Float32Array(A),n.HEAPF64=K=new Float64Array(A)}_(!n.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),_(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),_(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),_(!n.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function W(){var A=pc();_((A&3)==0),A==0&&(A+=4),V[A>>2]=34821223,V[A+4>>2]=2310721022,V[0]=1668509029}function G(){if(!P){var A=pc();A==0&&(A+=4);var D=V[A>>2],Q=V[A+4>>2];(D!=34821223||Q!=2310721022)&&Y(`Stack overflow! Stack cookie has been overwritten at ${Et(A)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${Et(Q)} ${Et(D)}`),V[0]!=1668509029&&Y("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(function(){var A=new Int16Array(1),D=new Int8Array(A.buffer);if(A[0]=25459,D[0]!==115||D[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var X=[],L=[],H=[],ne=!1;function ie(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)ge(n.preRun.shift());ut(X)}function be(){_(!ne),ne=!0,G(),!n.noFSInit&&!fe.init.initialized&&fe.init(),fe.ignorePermissions=!1,ut(L)}function ae(){if(G(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)ee(n.postRun.shift());ut(H)}function ge(A){X.unshift(A)}function ce(A){L.unshift(A)}function ee(A){H.unshift(A)}_(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),_(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var ye=0,Ee=null,j=null,te={};function re(A){for(var D=A;;){if(!te[A])return A;A=D+Math.random()}}function O(A){var D;ye++,(D=n.monitorRunDependencies)==null||D.call(n,ye),A?(_(!te[A]),te[A]=1,Ee===null&&typeof setInterval<"u"&&(Ee=setInterval(()=>{if(P){clearInterval(Ee),Ee=null;return}var Q=!1;for(var oe in te)Q||(Q=!0,v("still waiting on run dependencies:")),v(`dependency: ${oe}`);Q&&v("(end of list)")},1e4))):v("warning: run dependency added without ID")}function z(A){var Q;if(ye--,(Q=n.monitorRunDependencies)==null||Q.call(n,ye),A?(_(te[A]),delete te[A]):v("warning: run dependency removed without ID"),ye==0&&(Ee!==null&&(clearInterval(Ee),Ee=null),j)){var D=j;j=null,D()}}function Y(A){var Q;(Q=n.onAbort)==null||Q.call(n,A),A="Aborted("+A+")",v(A),P=!0;var D=new WebAssembly.RuntimeError(A);throw g(D),D}var q="data:application/octet-stream;base64,",de=A=>A.startsWith(q),le=A=>A.startsWith("file://");function he(A){return function(){_(ne,`native function \`${A}\` called before runtime initialization`);var D=In[A];return _(D,`exported native function \`${A}\` not found`),D.apply(null,arguments)}}var me;me="oddvoices_wasm.wasm",de(me)||(me=u(me));function _e(A){if(A==me&&S)return new Uint8Array(S);throw"both async and sync fetching of the wasm failed"}function Me(A){return!S&&h&&typeof fetch=="function"?fetch(A,{credentials:"same-origin"}).then(D=>{if(!D.ok)throw"failed to load wasm binary file at '"+A+"'";return D.arrayBuffer()}).catch(()=>_e(A)):Promise.resolve().then(()=>_e(A))}function Ue(A,D,Q){return Me(A).then(oe=>WebAssembly.instantiate(oe,D)).then(oe=>oe).then(Q,oe=>{v(`failed to asynchronously prepare wasm: ${oe}`),le(me)&&v(`warning: Loading from a file URI (${me}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),Y(oe)})}function Ge(A,D,Q,oe){return!A&&typeof WebAssembly.instantiateStreaming=="function"&&!de(D)&&typeof fetch=="function"?fetch(D,{credentials:"same-origin"}).then(Se=>{var Le=WebAssembly.instantiateStreaming(Se,Q);return Le.then(oe,function(Fe){return v(`wasm streaming compile failed: ${Fe}`),v("falling back to ArrayBuffer instantiation"),Ue(D,Q,oe)})}):Ue(D,Q,oe)}function Qe(){var A={env:bn,wasi_snapshot_preview1:bn};function D(Se,Le){return In=Se.exports,T=In.memory,_(T,"memory not found in wasm exports"),k(),Es=In.__indirect_function_table,_(Es,"table not found in wasm exports"),ce(In.__wasm_call_ctors),z("wasm-instantiate"),In}O("wasm-instantiate");var Q=n;function oe(Se){_(n===Q,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),Q=null,D(Se.instance)}if(n.instantiateWasm)try{return n.instantiateWasm(A,D)}catch(Se){v(`Module.instantiateWasm callback failed with error: ${Se}`),g(Se)}return Ge(S,me,A,oe).catch(g),{}}var Re,We;function qe(A,D,Q=!0){Object.getOwnPropertyDescriptor(n,A)||Object.defineProperty(n,A,{configurable:!0,get(){let oe=Q?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";Y(`\`Module.${A}\` has been replaced by \`${D}\``+oe)}})}function Ke(A){Object.getOwnPropertyDescriptor(n,A)&&Y(`\`Module.${A}\` was supplied but \`${A}\` not included in INCOMING_MODULE_JS_API`)}function Ze(A){return A==="FS_createPath"||A==="FS_createDataFile"||A==="FS_createPreloadedFile"||A==="FS_unlink"||A==="addRunDependency"||A==="FS_createLazyFile"||A==="FS_createDevice"||A==="removeRunDependency"}function st(A,D){typeof globalThis<"u"&&Object.defineProperty(globalThis,A,{configurable:!0,get(){dt(`\`${A}\` is not longer defined by emscripten. ${D}`)}})}st("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),st("asm","Please use wasmExports instead");function ft(A){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,A)&&Object.defineProperty(globalThis,A,{configurable:!0,get(){var D=`\`${A}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,Q=A;Q.startsWith("_")||(Q="$"+A),D+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${Q}')`,Ze(A)&&(D+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),dt(D)}}),xt(A)}function xt(A){Object.getOwnPropertyDescriptor(n,A)||Object.defineProperty(n,A,{configurable:!0,get(){var D=`'${A}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Ze(A)&&(D+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),Y(D)}})}var ut=A=>{for(;A.length>0;)A.shift()(n)};n.noExitRuntime;var Et=A=>(_(typeof A=="number"),A>>>=0,"0x"+A.toString(16).padStart(8,"0")),dt=A=>{dt.shown||(dt.shown={}),dt.shown[A]||(dt.shown[A]=1,v(A))},Tt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,It=(A,D,Q)=>{for(var oe=D+Q,Se=D;A[Se]&&!(Se>=oe);)++Se;if(Se-D>16&&A.buffer&&Tt)return Tt.decode(A.subarray(D,Se));for(var Le="";D>10,56320|it&1023)}}return Le},Jt=(A,D)=>(_(typeof A=="number",`UTF8ToString expects a number (got ${typeof A})`),A?It(M,A,D):""),hi=(A,D,Q,oe)=>{Y(`Assertion failed: ${Jt(A)}, at: `+[D?Jt(D):"unknown filename",Q,oe?Jt(oe):"unknown function"])};class jn{constructor(D){this.excPtr=D,this.ptr=D-24}set_type(D){V[this.ptr+4>>2]=D}get_type(){return V[this.ptr+4>>2]}set_destructor(D){V[this.ptr+8>>2]=D}get_destructor(){return V[this.ptr+8>>2]}set_caught(D){D=D?1:0,E[this.ptr+12>>0]=D}get_caught(){return E[this.ptr+12>>0]!=0}set_rethrown(D){D=D?1:0,E[this.ptr+13>>0]=D}get_rethrown(){return E[this.ptr+13>>0]!=0}init(D,Q){this.set_adjusted_ptr(0),this.set_type(D),this.set_destructor(Q)}set_adjusted_ptr(D){V[this.ptr+16>>2]=D}get_adjusted_ptr(){return V[this.ptr+16>>2]}get_exception_ptr(){var D=wn(this.get_type());if(D)return V[this.excPtr>>2];var Q=this.get_adjusted_ptr();return Q!==0?Q:this.excPtr}}var $r=(A,D,Q)=>{var oe=new jn(A);oe.init(D,Q),_(!1,"Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.")},Lt={isAbs:A=>A.charAt(0)==="/",splitPath:A=>{var D=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return D.exec(A).slice(1)},normalizeArray:(A,D)=>{for(var Q=0,oe=A.length-1;oe>=0;oe--){var Se=A[oe];Se==="."?A.splice(oe,1):Se===".."?(A.splice(oe,1),Q++):Q&&(A.splice(oe,1),Q--)}if(D)for(;Q;Q--)A.unshift("..");return A},normalize:A=>{var D=Lt.isAbs(A),Q=A.substr(-1)==="/";return A=Lt.normalizeArray(A.split("/").filter(oe=>!!oe),!D).join("/"),!A&&!D&&(A="."),A&&Q&&(A+="/"),(D?"/":"")+A},dirname:A=>{var D=Lt.splitPath(A),Q=D[0],oe=D[1];return!Q&&!oe?".":(oe&&(oe=oe.substr(0,oe.length-1)),Q+oe)},basename:A=>{if(A==="/")return"/";A=Lt.normalize(A),A=A.replace(/\/$/,"");var D=A.lastIndexOf("/");return D===-1?A:A.substr(D+1)},join:function(){var A=Array.prototype.slice.call(arguments);return Lt.normalize(A.join("/"))},join2:(A,D)=>Lt.normalize(A+"/"+D)},Bn=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return A=>crypto.getRandomValues(A);Y("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")},sn=A=>(sn=Bn())(A),jt={resolve:function(){for(var A="",D=!1,Q=arguments.length-1;Q>=-1&&!D;Q--){var oe=Q>=0?arguments[Q]:fe.cwd();if(typeof oe!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!oe)return"";A=oe+"/"+A,D=Lt.isAbs(oe)}return A=Lt.normalizeArray(A.split("/").filter(Se=>!!Se),!D).join("/"),(D?"/":"")+A||"."},relative:(A,D)=>{A=jt.resolve(A).substr(1),D=jt.resolve(D).substr(1);function Q(it){for(var rt=0;rt=0&&it[gt]==="";gt--);return rt>gt?[]:it.slice(rt,gt-rt+1)}for(var oe=Q(A.split("/")),Se=Q(D.split("/")),Le=Math.min(oe.length,Se.length),Fe=Le,De=0;De{for(var D=0,Q=0;Q=55296&&oe<=57343?(D+=4,++Q):D+=3}return D},Yn=(A,D,Q,oe)=>{if(_(typeof A=="string",`stringToUTF8Array expects a string (got ${typeof A})`),!(oe>0))return 0;for(var Se=Q,Le=Q+oe-1,Fe=0;Fe=55296&&De<=57343){var et=A.charCodeAt(++Fe);De=65536+((De&1023)<<10)|et&1023}if(De<=127){if(Q>=Le)break;D[Q++]=De}else if(De<=2047){if(Q+1>=Le)break;D[Q++]=192|De>>6,D[Q++]=128|De&63}else if(De<=65535){if(Q+2>=Le)break;D[Q++]=224|De>>12,D[Q++]=128|De>>6&63,D[Q++]=128|De&63}else{if(Q+3>=Le)break;De>1114111&&dt("Invalid Unicode code point "+Et(De)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),D[Q++]=240|De>>18,D[Q++]=128|De>>12&63,D[Q++]=128|De>>6&63,D[Q++]=128|De&63}}return D[Q]=0,Q-Se};function Di(A,D,Q){var oe=Q>0?Q:kn(A)+1,Se=new Array(oe),Le=Yn(A,Se,0,Se.length);return D&&(Se.length=Le),Se}var Hr=()=>{if(!Xn.length){var A=null;if(typeof window<"u"&&typeof window.prompt=="function"?(A=window.prompt("Input: "),A!==null&&(A+=` -`)):typeof readline=="function"&&(A=readline(),A!==null&&(A+=` -`)),!A)return null;Xn=Di(A,!0)}return Xn.shift()},oi={ttys:[],init(){},shutdown(){},register(A,D){oi.ttys[A]={input:[],output:[],ops:D},fe.registerDevice(A,oi.stream_ops)},stream_ops:{open(A){var D=oi.ttys[A.node.rdev];if(!D)throw new fe.ErrnoError(43);A.tty=D,A.seekable=!1},close(A){A.tty.ops.fsync(A.tty)},fsync(A){A.tty.ops.fsync(A.tty)},read(A,D,Q,oe,Se){if(!A.tty||!A.tty.ops.get_char)throw new fe.ErrnoError(60);for(var Le=0,Fe=0;Fe0&&(p(It(A.output,0)),A.output=[])},ioctl_tcgets(A){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(A,D,Q){return 0},ioctl_tiocgwinsz(A){return[24,80]}},default_tty1_ops:{put_char(A,D){D===null||D===10?(v(It(A.output,0)),A.output=[]):D!=0&&A.output.push(D)},fsync(A){A.output&&A.output.length>0&&(v(It(A.output,0)),A.output=[])}}},Bs=A=>{Y("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},Dt={ops_table:null,mount(A){return Dt.createNode(null,"/",16895,0)},createNode(A,D,Q,oe){if(fe.isBlkdev(Q)||fe.isFIFO(Q))throw new fe.ErrnoError(63);Dt.ops_table||(Dt.ops_table={dir:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr,lookup:Dt.node_ops.lookup,mknod:Dt.node_ops.mknod,rename:Dt.node_ops.rename,unlink:Dt.node_ops.unlink,rmdir:Dt.node_ops.rmdir,readdir:Dt.node_ops.readdir,symlink:Dt.node_ops.symlink},stream:{llseek:Dt.stream_ops.llseek}},file:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr},stream:{llseek:Dt.stream_ops.llseek,read:Dt.stream_ops.read,write:Dt.stream_ops.write,allocate:Dt.stream_ops.allocate,mmap:Dt.stream_ops.mmap,msync:Dt.stream_ops.msync}},link:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr,readlink:Dt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr},stream:fe.chrdev_stream_ops}});var Se=fe.createNode(A,D,Q,oe);return fe.isDir(Se.mode)?(Se.node_ops=Dt.ops_table.dir.node,Se.stream_ops=Dt.ops_table.dir.stream,Se.contents={}):fe.isFile(Se.mode)?(Se.node_ops=Dt.ops_table.file.node,Se.stream_ops=Dt.ops_table.file.stream,Se.usedBytes=0,Se.contents=null):fe.isLink(Se.mode)?(Se.node_ops=Dt.ops_table.link.node,Se.stream_ops=Dt.ops_table.link.stream):fe.isChrdev(Se.mode)&&(Se.node_ops=Dt.ops_table.chrdev.node,Se.stream_ops=Dt.ops_table.chrdev.stream),Se.timestamp=Date.now(),A&&(A.contents[D]=Se,A.timestamp=Se.timestamp),Se},getFileDataAsTypedArray(A){return A.contents?A.contents.subarray?A.contents.subarray(0,A.usedBytes):new Uint8Array(A.contents):new Uint8Array(0)},expandFileStorage(A,D){var Q=A.contents?A.contents.length:0;if(!(Q>=D)){var oe=1024*1024;D=Math.max(D,Q*(Q>>0),Q!=0&&(D=Math.max(D,256));var Se=A.contents;A.contents=new Uint8Array(D),A.usedBytes>0&&A.contents.set(Se.subarray(0,A.usedBytes),0)}},resizeFileStorage(A,D){if(A.usedBytes!=D)if(D==0)A.contents=null,A.usedBytes=0;else{var Q=A.contents;A.contents=new Uint8Array(D),Q&&A.contents.set(Q.subarray(0,Math.min(D,A.usedBytes))),A.usedBytes=D}},node_ops:{getattr(A){var D={};return D.dev=fe.isChrdev(A.mode)?A.id:1,D.ino=A.id,D.mode=A.mode,D.nlink=1,D.uid=0,D.gid=0,D.rdev=A.rdev,fe.isDir(A.mode)?D.size=4096:fe.isFile(A.mode)?D.size=A.usedBytes:fe.isLink(A.mode)?D.size=A.link.length:D.size=0,D.atime=new Date(A.timestamp),D.mtime=new Date(A.timestamp),D.ctime=new Date(A.timestamp),D.blksize=4096,D.blocks=Math.ceil(D.size/D.blksize),D},setattr(A,D){D.mode!==void 0&&(A.mode=D.mode),D.timestamp!==void 0&&(A.timestamp=D.timestamp),D.size!==void 0&&Dt.resizeFileStorage(A,D.size)},lookup(A,D){throw fe.genericErrors[44]},mknod(A,D,Q,oe){return Dt.createNode(A,D,Q,oe)},rename(A,D,Q){if(fe.isDir(A.mode)){var oe;try{oe=fe.lookupNode(D,Q)}catch{}if(oe)for(var Se in oe.contents)throw new fe.ErrnoError(55)}delete A.parent.contents[A.name],A.parent.timestamp=Date.now(),A.name=Q,D.contents[Q]=A,D.timestamp=A.parent.timestamp,A.parent=D},unlink(A,D){delete A.contents[D],A.timestamp=Date.now()},rmdir(A,D){var Q=fe.lookupNode(A,D);for(var oe in Q.contents)throw new fe.ErrnoError(55);delete A.contents[D],A.timestamp=Date.now()},readdir(A){var D=[".",".."];for(var Q of Object.keys(A.contents))D.push(Q);return D},symlink(A,D,Q){var oe=Dt.createNode(A,D,41471,0);return oe.link=Q,oe},readlink(A){if(!fe.isLink(A.mode))throw new fe.ErrnoError(28);return A.link}},stream_ops:{read(A,D,Q,oe,Se){var Le=A.node.contents;if(Se>=A.node.usedBytes)return 0;var Fe=Math.min(A.node.usedBytes-Se,oe);if(_(Fe>=0),Fe>8&&Le.subarray)D.set(Le.subarray(Se,Se+Fe),Q);else for(var De=0;De0||Q+D{var Se=oe?"":re(`al ${A}`);x(A,Le=>{_(Le,`Loading data file "${A}" failed (no arrayBuffer).`),D(new Uint8Array(Le)),Se&&z(Se)},Le=>{if(Q)Q();else throw`Loading data file "${A}" failed.`}),Se&&O(Se)},xl=(A,D,Q,oe,Se,Le)=>{fe.createDataFile(A,D,Q,oe,Se,Le)},sr=n.preloadPlugins||[],ps=(A,D,Q,oe)=>{typeof Browser<"u"&&Browser.init();var Se=!1;return sr.forEach(Le=>{Se||Le.canHandle(D)&&(Le.handle(A,D,Q,oe),Se=!0)}),Se},ka=(A,D,Q,oe,Se,Le,Fe,De,et,it)=>{var rt=D?jt.resolve(Lt.join2(A,D)):A,gt=re(`cp ${rt}`);function yt(St){function vt(Bt){it==null||it(),De||xl(A,D,Bt,oe,Se,et),Le==null||Le(),z(gt)}ps(St,rt,vt,()=>{Fe==null||Fe(),z(gt)})||vt(St)}O(gt),typeof Q=="string"?El(Q,yt,Fe):yt(Q)},Do=A=>{var D={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Q=D[A];if(typeof Q>"u")throw new Error(`Unknown file open mode: ${A}`);return Q},ms=(A,D)=>{var Q=0;return A&&(Q|=365),D&&(Q|=146),Q},Hi={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},Vo={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Ds=A=>(dt("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),A),wl=A=>{var D=/\b_Z[\w\d_]+/g;return A.replace(D,function(Q){var oe=Ds(Q);return Q===oe?Q:oe+" ["+Q+"]"})},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(A,D={}){if(A=jt.resolve(A),!A)return{path:"",node:null};var Q={follow_mount:!0,recurse_count:0};if(D=Object.assign(Q,D),D.recurse_count>8)throw new fe.ErrnoError(32);for(var oe=A.split("/").filter(gt=>!!gt),Se=fe.root,Le="/",Fe=0;Fe40)throw new fe.ErrnoError(32)}}return{path:Le,node:Se}},getPath(A){for(var D;;){if(fe.isRoot(A)){var Q=A.mount.mountpoint;return D?Q[Q.length-1]!=="/"?`${Q}/${D}`:Q+D:Q}D=D?`${A.name}/${D}`:A.name,A=A.parent}},hashName(A,D){for(var Q=0,oe=0;oe>>0)%fe.nameTable.length},hashAddNode(A){var D=fe.hashName(A.parent.id,A.name);A.name_next=fe.nameTable[D],fe.nameTable[D]=A},hashRemoveNode(A){var D=fe.hashName(A.parent.id,A.name);if(fe.nameTable[D]===A)fe.nameTable[D]=A.name_next;else for(var Q=fe.nameTable[D];Q;){if(Q.name_next===A){Q.name_next=A.name_next;break}Q=Q.name_next}},lookupNode(A,D){var Q=fe.mayLookup(A);if(Q)throw new fe.ErrnoError(Q,A);for(var oe=fe.hashName(A.id,D),Se=fe.nameTable[oe];Se;Se=Se.name_next){var Le=Se.name;if(Se.parent.id===A.id&&Le===D)return Se}return fe.lookup(A,D)},createNode(A,D,Q,oe){_(typeof A=="object");var Se=new fe.FSNode(A,D,Q,oe);return fe.hashAddNode(Se),Se},destroyNode(A){fe.hashRemoveNode(A)},isRoot(A){return A===A.parent},isMountpoint(A){return!!A.mounted},isFile(A){return(A&61440)===32768},isDir(A){return(A&61440)===16384},isLink(A){return(A&61440)===40960},isChrdev(A){return(A&61440)===8192},isBlkdev(A){return(A&61440)===24576},isFIFO(A){return(A&61440)===4096},isSocket(A){return(A&49152)===49152},flagsToPermissionString(A){var D=["r","w","rw"][A&3];return A&512&&(D+="w"),D},nodePermissions(A,D){return fe.ignorePermissions?0:D.includes("r")&&!(A.mode&292)||D.includes("w")&&!(A.mode&146)||D.includes("x")&&!(A.mode&73)?2:0},mayLookup(A){var D=fe.nodePermissions(A,"x");return D||(A.node_ops.lookup?0:2)},mayCreate(A,D){try{var Q=fe.lookupNode(A,D);return 20}catch{}return fe.nodePermissions(A,"wx")},mayDelete(A,D,Q){var oe;try{oe=fe.lookupNode(A,D)}catch(Le){return Le.errno}var Se=fe.nodePermissions(A,"wx");if(Se)return Se;if(Q){if(!fe.isDir(oe.mode))return 54;if(fe.isRoot(oe)||fe.getPath(oe)===fe.cwd())return 10}else if(fe.isDir(oe.mode))return 31;return 0},mayOpen(A,D){return A?fe.isLink(A.mode)?32:fe.isDir(A.mode)&&(fe.flagsToPermissionString(D)!=="r"||D&512)?31:fe.nodePermissions(A,fe.flagsToPermissionString(D)):44},MAX_OPEN_FDS:4096,nextfd(){for(var A=0;A<=fe.MAX_OPEN_FDS;A++)if(!fe.streams[A])return A;throw new fe.ErrnoError(33)},getStreamChecked(A){var D=fe.getStream(A);if(!D)throw new fe.ErrnoError(8);return D},getStream:A=>fe.streams[A],createStream(A,D=-1){return fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={},Object.defineProperties(fe.FSStream.prototype,{object:{get(){return this.node},set(Q){this.node=Q}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(Q){this.shared.flags=Q}},position:{get(){return this.shared.position},set(Q){this.shared.position=Q}}})),A=Object.assign(new fe.FSStream,A),D==-1&&(D=fe.nextfd()),A.fd=D,fe.streams[D]=A,A},closeStream(A){fe.streams[A]=null},chrdev_stream_ops:{open(A){var Q,oe;var D=fe.getDevice(A.node.rdev);A.stream_ops=D.stream_ops,(oe=(Q=A.stream_ops).open)==null||oe.call(Q,A)},llseek(){throw new fe.ErrnoError(70)}},major:A=>A>>8,minor:A=>A&255,makedev:(A,D)=>A<<8|D,registerDevice(A,D){fe.devices[A]={stream_ops:D}},getDevice:A=>fe.devices[A],getMounts(A){for(var D=[],Q=[A];Q.length;){var oe=Q.pop();D.push(oe),Q.push.apply(Q,oe.mounts)}return D},syncfs(A,D){typeof A=="function"&&(D=A,A=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&v(`warning: ${fe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var Q=fe.getMounts(fe.root.mount),oe=0;function Se(Fe){return _(fe.syncFSRequests>0),fe.syncFSRequests--,D(Fe)}function Le(Fe){if(Fe)return Le.errored?void 0:(Le.errored=!0,Se(Fe));++oe>=Q.length&&Se(null)}Q.forEach(Fe=>{if(!Fe.type.syncfs)return Le(null);Fe.type.syncfs(Fe,A,Le)})},mount(A,D,Q){if(typeof A=="string")throw A;var oe=Q==="/",Se=!Q,Le;if(oe&&fe.root)throw new fe.ErrnoError(10);if(!oe&&!Se){var Fe=fe.lookupPath(Q,{follow_mount:!1});if(Q=Fe.path,Le=Fe.node,fe.isMountpoint(Le))throw new fe.ErrnoError(10);if(!fe.isDir(Le.mode))throw new fe.ErrnoError(54)}var De={type:A,opts:D,mountpoint:Q,mounts:[]},et=A.mount(De);return et.mount=De,De.root=et,oe?fe.root=et:Le&&(Le.mounted=De,Le.mount&&Le.mount.mounts.push(De)),et},unmount(A){var D=fe.lookupPath(A,{follow_mount:!1});if(!fe.isMountpoint(D.node))throw new fe.ErrnoError(28);var Q=D.node,oe=Q.mounted,Se=fe.getMounts(oe);Object.keys(fe.nameTable).forEach(Fe=>{for(var De=fe.nameTable[Fe];De;){var et=De.name_next;Se.includes(De.mount)&&fe.destroyNode(De),De=et}}),Q.mounted=null;var Le=Q.mount.mounts.indexOf(oe);_(Le!==-1),Q.mount.mounts.splice(Le,1)},lookup(A,D){return A.node_ops.lookup(A,D)},mknod(A,D,Q){var oe=fe.lookupPath(A,{parent:!0}),Se=oe.node,Le=Lt.basename(A);if(!Le||Le==="."||Le==="..")throw new fe.ErrnoError(28);var Fe=fe.mayCreate(Se,Le);if(Fe)throw new fe.ErrnoError(Fe);if(!Se.node_ops.mknod)throw new fe.ErrnoError(63);return Se.node_ops.mknod(Se,Le,D,Q)},create(A,D){return D=D!==void 0?D:438,D&=4095,D|=32768,fe.mknod(A,D,0)},mkdir(A,D){return D=D!==void 0?D:511,D&=1023,D|=16384,fe.mknod(A,D,0)},mkdirTree(A,D){for(var Q=A.split("/"),oe="",Se=0;Se"u"&&(Q=D,D=438),D|=8192,fe.mknod(A,D,Q)},symlink(A,D){if(!jt.resolve(A))throw new fe.ErrnoError(44);var Q=fe.lookupPath(D,{parent:!0}),oe=Q.node;if(!oe)throw new fe.ErrnoError(44);var Se=Lt.basename(D),Le=fe.mayCreate(oe,Se);if(Le)throw new fe.ErrnoError(Le);if(!oe.node_ops.symlink)throw new fe.ErrnoError(63);return oe.node_ops.symlink(oe,Se,A)},rename(A,D){var Q=Lt.dirname(A),oe=Lt.dirname(D),Se=Lt.basename(A),Le=Lt.basename(D),Fe,De,et;if(Fe=fe.lookupPath(A,{parent:!0}),De=Fe.node,Fe=fe.lookupPath(D,{parent:!0}),et=Fe.node,!De||!et)throw new fe.ErrnoError(44);if(De.mount!==et.mount)throw new fe.ErrnoError(75);var it=fe.lookupNode(De,Se),rt=jt.relative(A,oe);if(rt.charAt(0)!==".")throw new fe.ErrnoError(28);if(rt=jt.relative(D,Q),rt.charAt(0)!==".")throw new fe.ErrnoError(55);var gt;try{gt=fe.lookupNode(et,Le)}catch{}if(it!==gt){var yt=fe.isDir(it.mode),St=fe.mayDelete(De,Se,yt);if(St)throw new fe.ErrnoError(St);if(St=gt?fe.mayDelete(et,Le,yt):fe.mayCreate(et,Le),St)throw new fe.ErrnoError(St);if(!De.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(it)||gt&&fe.isMountpoint(gt))throw new fe.ErrnoError(10);if(et!==De&&(St=fe.nodePermissions(De,"w"),St))throw new fe.ErrnoError(St);fe.hashRemoveNode(it);try{De.node_ops.rename(it,et,Le)}catch(vt){throw vt}finally{fe.hashAddNode(it)}}},rmdir(A){var D=fe.lookupPath(A,{parent:!0}),Q=D.node,oe=Lt.basename(A),Se=fe.lookupNode(Q,oe),Le=fe.mayDelete(Q,oe,!0);if(Le)throw new fe.ErrnoError(Le);if(!Q.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(Se))throw new fe.ErrnoError(10);Q.node_ops.rmdir(Q,oe),fe.destroyNode(Se)},readdir(A){var D=fe.lookupPath(A,{follow:!0}),Q=D.node;if(!Q.node_ops.readdir)throw new fe.ErrnoError(54);return Q.node_ops.readdir(Q)},unlink(A){var D=fe.lookupPath(A,{parent:!0}),Q=D.node;if(!Q)throw new fe.ErrnoError(44);var oe=Lt.basename(A),Se=fe.lookupNode(Q,oe),Le=fe.mayDelete(Q,oe,!1);if(Le)throw new fe.ErrnoError(Le);if(!Q.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(Se))throw new fe.ErrnoError(10);Q.node_ops.unlink(Q,oe),fe.destroyNode(Se)},readlink(A){var D=fe.lookupPath(A),Q=D.node;if(!Q)throw new fe.ErrnoError(44);if(!Q.node_ops.readlink)throw new fe.ErrnoError(28);return jt.resolve(fe.getPath(Q.parent),Q.node_ops.readlink(Q))},stat(A,D){var Q=fe.lookupPath(A,{follow:!D}),oe=Q.node;if(!oe)throw new fe.ErrnoError(44);if(!oe.node_ops.getattr)throw new fe.ErrnoError(63);return oe.node_ops.getattr(oe)},lstat(A){return fe.stat(A,!0)},chmod(A,D,Q){var oe;if(typeof A=="string"){var Se=fe.lookupPath(A,{follow:!Q});oe=Se.node}else oe=A;if(!oe.node_ops.setattr)throw new fe.ErrnoError(63);oe.node_ops.setattr(oe,{mode:D&4095|oe.mode&-4096,timestamp:Date.now()})},lchmod(A,D){fe.chmod(A,D,!0)},fchmod(A,D){var Q=fe.getStreamChecked(A);fe.chmod(Q.node,D)},chown(A,D,Q,oe){var Se;if(typeof A=="string"){var Le=fe.lookupPath(A,{follow:!oe});Se=Le.node}else Se=A;if(!Se.node_ops.setattr)throw new fe.ErrnoError(63);Se.node_ops.setattr(Se,{timestamp:Date.now()})},lchown(A,D,Q){fe.chown(A,D,Q,!0)},fchown(A,D,Q){var oe=fe.getStreamChecked(A);fe.chown(oe.node,D,Q)},truncate(A,D){if(D<0)throw new fe.ErrnoError(28);var Q;if(typeof A=="string"){var oe=fe.lookupPath(A,{follow:!0});Q=oe.node}else Q=A;if(!Q.node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(Q.mode))throw new fe.ErrnoError(31);if(!fe.isFile(Q.mode))throw new fe.ErrnoError(28);var Se=fe.nodePermissions(Q,"w");if(Se)throw new fe.ErrnoError(Se);Q.node_ops.setattr(Q,{size:D,timestamp:Date.now()})},ftruncate(A,D){var Q=fe.getStreamChecked(A);if(!(Q.flags&2097155))throw new fe.ErrnoError(28);fe.truncate(Q.node,D)},utime(A,D,Q){var oe=fe.lookupPath(A,{follow:!0}),Se=oe.node;Se.node_ops.setattr(Se,{timestamp:Math.max(D,Q)})},open(A,D,Q){if(A==="")throw new fe.ErrnoError(44);D=typeof D=="string"?Do(D):D,Q=typeof Q>"u"?438:Q,D&64?Q=Q&4095|32768:Q=0;var oe;if(typeof A=="object")oe=A;else{A=Lt.normalize(A);try{var Se=fe.lookupPath(A,{follow:!(D&131072)});oe=Se.node}catch{}}var Le=!1;if(D&64)if(oe){if(D&128)throw new fe.ErrnoError(20)}else oe=fe.mknod(A,Q,0),Le=!0;if(!oe)throw new fe.ErrnoError(44);if(fe.isChrdev(oe.mode)&&(D&=-513),D&65536&&!fe.isDir(oe.mode))throw new fe.ErrnoError(54);if(!Le){var Fe=fe.mayOpen(oe,D);if(Fe)throw new fe.ErrnoError(Fe)}D&512&&!Le&&fe.truncate(oe,0),D&=-131713;var De=fe.createStream({node:oe,path:fe.getPath(oe),flags:D,seekable:!0,position:0,stream_ops:oe.stream_ops,ungotten:[],error:!1});return De.stream_ops.open&&De.stream_ops.open(De),n.logReadFiles&&!(D&1)&&(fe.readFiles||(fe.readFiles={}),A in fe.readFiles||(fe.readFiles[A]=1)),De},close(A){if(fe.isClosed(A))throw new fe.ErrnoError(8);A.getdents&&(A.getdents=null);try{A.stream_ops.close&&A.stream_ops.close(A)}catch(D){throw D}finally{fe.closeStream(A.fd)}A.fd=null},isClosed(A){return A.fd===null},llseek(A,D,Q){if(fe.isClosed(A))throw new fe.ErrnoError(8);if(!A.seekable||!A.stream_ops.llseek)throw new fe.ErrnoError(70);if(Q!=0&&Q!=1&&Q!=2)throw new fe.ErrnoError(28);return A.position=A.stream_ops.llseek(A,D,Q),A.ungotten=[],A.position},read(A,D,Q,oe,Se){if(_(Q>=0),oe<0||Se<0)throw new fe.ErrnoError(28);if(fe.isClosed(A))throw new fe.ErrnoError(8);if((A.flags&2097155)===1)throw new fe.ErrnoError(8);if(fe.isDir(A.node.mode))throw new fe.ErrnoError(31);if(!A.stream_ops.read)throw new fe.ErrnoError(28);var Le=typeof Se<"u";if(!Le)Se=A.position;else if(!A.seekable)throw new fe.ErrnoError(70);var Fe=A.stream_ops.read(A,D,Q,oe,Se);return Le||(A.position+=Fe),Fe},write(A,D,Q,oe,Se,Le){if(_(Q>=0),oe<0||Se<0)throw new fe.ErrnoError(28);if(fe.isClosed(A))throw new fe.ErrnoError(8);if(!(A.flags&2097155))throw new fe.ErrnoError(8);if(fe.isDir(A.node.mode))throw new fe.ErrnoError(31);if(!A.stream_ops.write)throw new fe.ErrnoError(28);A.seekable&&A.flags&1024&&fe.llseek(A,0,2);var Fe=typeof Se<"u";if(!Fe)Se=A.position;else if(!A.seekable)throw new fe.ErrnoError(70);var De=A.stream_ops.write(A,D,Q,oe,Se,Le);return Fe||(A.position+=De),De},allocate(A,D,Q){if(fe.isClosed(A))throw new fe.ErrnoError(8);if(D<0||Q<=0)throw new fe.ErrnoError(28);if(!(A.flags&2097155))throw new fe.ErrnoError(8);if(!fe.isFile(A.node.mode)&&!fe.isDir(A.node.mode))throw new fe.ErrnoError(43);if(!A.stream_ops.allocate)throw new fe.ErrnoError(138);A.stream_ops.allocate(A,D,Q)},mmap(A,D,Q,oe,Se){if(oe&2&&!(Se&2)&&(A.flags&2097155)!==2)throw new fe.ErrnoError(2);if((A.flags&2097155)===1)throw new fe.ErrnoError(2);if(!A.stream_ops.mmap)throw new fe.ErrnoError(43);return A.stream_ops.mmap(A,D,Q,oe,Se)},msync(A,D,Q,oe,Se){return _(Q>=0),A.stream_ops.msync?A.stream_ops.msync(A,D,Q,oe,Se):0},munmap:A=>0,ioctl(A,D,Q){if(!A.stream_ops.ioctl)throw new fe.ErrnoError(59);return A.stream_ops.ioctl(A,D,Q)},readFile(A,D={}){if(D.flags=D.flags||0,D.encoding=D.encoding||"binary",D.encoding!=="utf8"&&D.encoding!=="binary")throw new Error(`Invalid encoding type "${D.encoding}"`);var Q,oe=fe.open(A,D.flags),Se=fe.stat(A),Le=Se.size,Fe=new Uint8Array(Le);return fe.read(oe,Fe,0,Le,0),D.encoding==="utf8"?Q=It(Fe,0):D.encoding==="binary"&&(Q=Fe),fe.close(oe),Q},writeFile(A,D,Q={}){Q.flags=Q.flags||577;var oe=fe.open(A,Q.flags,Q.mode);if(typeof D=="string"){var Se=new Uint8Array(kn(D)+1),Le=Yn(D,Se,0,Se.length);fe.write(oe,Se,0,Le,void 0,Q.canOwn)}else if(ArrayBuffer.isView(D))fe.write(oe,D,0,D.byteLength,void 0,Q.canOwn);else throw new Error("Unsupported data type");fe.close(oe)},cwd:()=>fe.currentPath,chdir(A){var D=fe.lookupPath(A,{follow:!0});if(D.node===null)throw new fe.ErrnoError(44);if(!fe.isDir(D.node.mode))throw new fe.ErrnoError(54);var Q=fe.nodePermissions(D.node,"x");if(Q)throw new fe.ErrnoError(Q);fe.currentPath=D.path},createDefaultDirectories(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(oe,Se,Le,Fe,De)=>Fe}),fe.mkdev("/dev/null",fe.makedev(1,3)),oi.register(fe.makedev(5,0),oi.default_tty_ops),oi.register(fe.makedev(6,0),oi.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var A=new Uint8Array(1024),D=0,Q=()=>(D===0&&(D=sn(A).byteLength),A[--D]);fe.createDevice("/dev","random",Q),fe.createDevice("/dev","urandom",Q),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){fe.mkdir("/proc");var A=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount(){var D=fe.createNode(A,"fd",16895,73);return D.node_ops={lookup(Q,oe){var Se=+oe,Le=fe.getStreamChecked(Se),Fe={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>Le.path}};return Fe.parent=Fe,Fe}},D}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?fe.createDevice("/dev","stdin",n.stdin):fe.symlink("/dev/tty","/dev/stdin"),n.stdout?fe.createDevice("/dev","stdout",null,n.stdout):fe.symlink("/dev/tty","/dev/stdout"),n.stderr?fe.createDevice("/dev","stderr",null,n.stderr):fe.symlink("/dev/tty1","/dev/stderr");var A=fe.open("/dev/stdin",0),D=fe.open("/dev/stdout",1),Q=fe.open("/dev/stderr",1);_(A.fd===0,`invalid handle for stdin (${A.fd})`),_(D.fd===1,`invalid handle for stdout (${D.fd})`),_(Q.fd===2,`invalid handle for stderr (${Q.fd})`)},ensureErrnoError(){fe.ErrnoError||(fe.ErrnoError=function(D,Q){this.name="ErrnoError",this.node=Q,this.setErrno=function(oe){this.errno=oe;for(var Se in Vo)if(Vo[Se]===oe){this.code=Se;break}},this.setErrno(D),this.message=Hi[D],this.stack&&(Object.defineProperty(this,"stack",{value:new Error().stack,writable:!0}),this.stack=wl(this.stack))},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach(A=>{fe.genericErrors[A]=new fe.ErrnoError(A),fe.genericErrors[A].stack=""}))},staticInit(){fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(Dt,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:Dt}},init(A,D,Q){_(!fe.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),fe.init.initialized=!0,fe.ensureErrnoError(),n.stdin=A||n.stdin,n.stdout=D||n.stdout,n.stderr=Q||n.stderr,fe.createStandardStreams()},quit(){fe.init.initialized=!1,pr(0);for(var A=0;Athis.length-1||St<0)){var vt=St%this.chunkSize,Bt=St/this.chunkSize|0;return this.getter(Bt)[vt]}},Le.prototype.setDataGetter=function(St){this.getter=St},Le.prototype.cacheLength=function(){var St=new XMLHttpRequest;if(St.open("HEAD",Q,!1),St.send(null),!(St.status>=200&&St.status<300||St.status===304))throw new Error("Couldn't load "+Q+". Status: "+St.status);var vt=Number(St.getResponseHeader("Content-length")),Bt,Xt=(Bt=St.getResponseHeader("Accept-Ranges"))&&Bt==="bytes",yn=(Bt=St.getResponseHeader("Content-Encoding"))&&Bt==="gzip",lt=1024*1024;Xt||(lt=vt);var Pt=(En,bi)=>{if(En>bi)throw new Error("invalid range ("+En+", "+bi+") or no bytes requested!");if(bi>vt-1)throw new Error("only "+vt+" bytes available! programmer error!");var Kt=new XMLHttpRequest;if(Kt.open("GET",Q,!1),vt!==lt&&Kt.setRequestHeader("Range","bytes="+En+"-"+bi),Kt.responseType="arraybuffer",Kt.overrideMimeType&&Kt.overrideMimeType("text/plain; charset=x-user-defined"),Kt.send(null),!(Kt.status>=200&&Kt.status<300||Kt.status===304))throw new Error("Couldn't load "+Q+". Status: "+Kt.status);return Kt.response!==void 0?new Uint8Array(Kt.response||[]):Di(Kt.responseText||"",!0)},On=this;On.setDataGetter(En=>{var bi=En*lt,Kt=(En+1)*lt-1;if(Kt=Math.min(Kt,vt-1),typeof On.chunks[En]>"u"&&(On.chunks[En]=Pt(bi,Kt)),typeof On.chunks[En]>"u")throw new Error("doXHR failed!");return On.chunks[En]}),(yn||!vt)&&(lt=vt=1,vt=this.getter(0).length,lt=vt,p("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=vt,this._chunkSize=lt,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var Fe,De}else var De={isDevice:!1,url:Q};var et=fe.createFile(A,D,De,oe,Se);De.contents?et.contents=De.contents:De.url&&(et.contents=null,et.url=De.url),Object.defineProperties(et,{usedBytes:{get:function(){return this.contents.length}}});var it={},rt=Object.keys(et.stream_ops);rt.forEach(yt=>{var St=et.stream_ops[yt];it[yt]=function(){return fe.forceLoadFile(et),St.apply(null,arguments)}});function gt(yt,St,vt,Bt,Xt){var yn=yt.node.contents;if(Xt>=yn.length)return 0;var lt=Math.min(yn.length-Xt,Bt);if(_(lt>=0),yn.slice)for(var Pt=0;Pt(fe.forceLoadFile(et),gt(yt,St,vt,Bt,Xt)),it.mmap=(yt,St,vt,Bt,Xt)=>{fe.forceLoadFile(et);var yn=Bs();if(!yn)throw new fe.ErrnoError(48);return gt(yt,E,yn,St,vt),{ptr:yn,allocated:!0}},et.stream_ops=it,et},absolutePath(){Y("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){Y("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){Y("FS.createLink has been removed; use FS.symlink instead")},joinPath(){Y("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){Y("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){Y("FS.standardizePath has been removed; use PATH.normalize instead")}},xn={DEFAULT_POLLMASK:5,calculateAt(A,D,Q){if(Lt.isAbs(D))return D;var oe;if(A===-100)oe=fe.cwd();else{var Se=xn.getStreamFromFD(A);oe=Se.path}if(D.length==0){if(!Q)throw new fe.ErrnoError(44);return oe}return Lt.join2(oe,D)},doStat(A,D,Q){try{var oe=A(D)}catch(De){if(De&&De.node&&Lt.normalize(D)!==Lt.normalize(fe.getPath(De.node)))return-54;throw De}R[Q>>2]=oe.dev,R[Q+4>>2]=oe.mode,V[Q+8>>2]=oe.nlink,R[Q+12>>2]=oe.uid,R[Q+16>>2]=oe.gid,R[Q+20>>2]=oe.rdev,We=[oe.size>>>0,(Re=oe.size,+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Q+24>>2]=We[0],R[Q+28>>2]=We[1],R[Q+32>>2]=4096,R[Q+36>>2]=oe.blocks;var Se=oe.atime.getTime(),Le=oe.mtime.getTime(),Fe=oe.ctime.getTime();return We=[Math.floor(Se/1e3)>>>0,(Re=Math.floor(Se/1e3),+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Q+40>>2]=We[0],R[Q+44>>2]=We[1],V[Q+48>>2]=Se%1e3*1e3,We=[Math.floor(Le/1e3)>>>0,(Re=Math.floor(Le/1e3),+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Q+56>>2]=We[0],R[Q+60>>2]=We[1],V[Q+64>>2]=Le%1e3*1e3,We=[Math.floor(Fe/1e3)>>>0,(Re=Math.floor(Fe/1e3),+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Q+72>>2]=We[0],R[Q+76>>2]=We[1],V[Q+80>>2]=Fe%1e3*1e3,We=[oe.ino>>>0,(Re=oe.ino,+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Q+88>>2]=We[0],R[Q+92>>2]=We[1],0},doMsync(A,D,Q,oe,Se){if(!fe.isFile(D.node.mode))throw new fe.ErrnoError(43);if(oe&2)return 0;var Le=M.slice(A,A+Q);fe.msync(D,Le,Se,Q,oe)},varargs:void 0,get(){_(xn.varargs!=null);var A=R[+xn.varargs>>2];return xn.varargs+=4,A},getp(){return xn.get()},getStr(A){var D=Jt(A);return D},getStreamFromFD(A){var D=fe.getStreamChecked(A);return D}};function Qt(A,D,Q){xn.varargs=Q;try{var oe=xn.getStreamFromFD(A);switch(D){case 0:{var Se=xn.get();if(Se<0)return-28;for(;fe.streams[Se];)Se++;var Le;return Le=fe.createStream(oe,Se),Le.fd}case 1:case 2:return 0;case 3:return oe.flags;case 4:{var Se=xn.get();return oe.flags|=Se,0}case 12:{var Se=xn.getp(),Fe=0;return N[Se+Fe>>1]=2,0}case 13:case 14:return 0}return-28}catch(De){if(typeof fe>"u"||De.name!=="ErrnoError")throw De;return-De.errno}}function xi(A,D,Q){xn.varargs=Q;try{var oe=xn.getStreamFromFD(A);switch(D){case 21509:return oe.tty?0:-59;case 21505:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tcgets){var Se=oe.tty.ops.ioctl_tcgets(oe),Le=xn.getp();R[Le>>2]=Se.c_iflag||0,R[Le+4>>2]=Se.c_oflag||0,R[Le+8>>2]=Se.c_cflag||0,R[Le+12>>2]=Se.c_lflag||0;for(var Fe=0;Fe<32;Fe++)E[Le+Fe+17>>0]=Se.c_cc[Fe]||0;return 0}return 0}case 21510:case 21511:case 21512:return oe.tty?0:-59;case 21506:case 21507:case 21508:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tcsets){for(var Le=xn.getp(),De=R[Le>>2],et=R[Le+4>>2],it=R[Le+8>>2],rt=R[Le+12>>2],gt=[],Fe=0;Fe<32;Fe++)gt.push(E[Le+Fe+17>>0]);return oe.tty.ops.ioctl_tcsets(oe.tty,D,{c_iflag:De,c_oflag:et,c_cflag:it,c_lflag:rt,c_cc:gt})}return 0}case 21519:{if(!oe.tty)return-59;var Le=xn.getp();return R[Le>>2]=0,0}case 21520:return oe.tty?-28:-59;case 21531:{var Le=xn.getp();return fe.ioctl(oe,D,Le)}case 21523:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tiocgwinsz){var yt=oe.tty.ops.ioctl_tiocgwinsz(oe.tty),Le=xn.getp();N[Le>>1]=yt[0],N[Le+2>>1]=yt[1]}return 0}case 21524:return oe.tty?0:-59;case 21515:return oe.tty?0:-59;default:return-28}}catch(St){if(typeof fe>"u"||St.name!=="ErrnoError")throw St;return-St.errno}}function gs(A,D,Q,oe){xn.varargs=oe;try{D=xn.getStr(D),D=xn.calculateAt(A,D);var Se=oe?xn.get():0;return fe.open(D,Q,Se).fd}catch(Le){if(typeof fe>"u"||Le.name!=="ErrnoError")throw Le;return-Le.errno}}var _l=(A,D,Q,oe,Se)=>{},or=()=>{for(var A=new Array(256),D=0;D<256;++D)A[D]=String.fromCharCode(D);Go=A},Go,Li=A=>{for(var D="",Q=A;M[Q];)D+=Go[M[Q++]];return D},Cr={},ar={},wi={},bs,cn=A=>{throw new bs(A)},Tl,Wo=A=>{throw new Tl(A)},Vs=(A,D,Q)=>{A.forEach(function(De){wi[De]=D});function oe(De){var et=Q(De);et.length!==A.length&&Wo("Mismatched type converter count");for(var it=0;it{ar.hasOwnProperty(De)?Se[et]=ar[De]:(Le.push(De),Cr.hasOwnProperty(De)||(Cr[De]=[]),Cr[De].push(()=>{Se[et]=ar[De],++Fe,Fe===Le.length&&oe(Se)}))}),Le.length===0&&oe(Se)};function zo(A,D,Q={}){var oe=D.name;if(A||cn(`type "${oe}" must have a positive integer typeid pointer`),ar.hasOwnProperty(A)){if(Q.ignoreDuplicateRegistrations)return;cn(`Cannot register type '${oe}' twice`)}if(ar[A]=D,delete wi[A],Cr.hasOwnProperty(A)){var Se=Cr[A];delete Cr[A],Se.forEach(Le=>Le())}}function lr(A,D,Q={}){if(!("argPackAdvance"in D))throw new TypeError("registerType registeredInstance requires argPackAdvance");return zo(A,D,Q)}var mn=8,ys=(A,D,Q,oe)=>{D=Li(D),lr(A,{name:D,fromWireType:function(Se){return!!Se},toWireType:function(Se,Le){return Le?Q:oe},argPackAdvance:mn,readValueFromPointer:function(Se){return this.fromWireType(M[Se])},destructorFunction:null})},Pl=A=>({count:A.count,deleteScheduled:A.deleteScheduled,preservePointerOnDelete:A.preservePointerOnDelete,ptr:A.ptr,ptrType:A.ptrType,smartPtr:A.smartPtr,smartPtrType:A.smartPtrType}),uo=A=>{function D(Q){return Q.$$.ptrType.registeredClass.name}cn(D(A)+" instance already deleted")},Gs=!1,Ie=A=>{},i=A=>{A.smartPtr?A.smartPtrType.rawDestructor(A.smartPtr):A.ptrType.registeredClass.rawDestructor(A.ptr)},y=A=>{A.count.value-=1;var D=A.count.value===0;D&&i(A)},C=(A,D,Q)=>{if(D===Q)return A;if(Q.baseClass===void 0)return null;var oe=C(A,D,Q.baseClass);return oe===null?null:Q.downcast(oe)},B={},$=()=>Object.keys(Ae).length,Z=()=>{var A=[];for(var D in Ae)Ae.hasOwnProperty(D)&&A.push(Ae[D]);return A},se=[],ue=()=>{for(;se.length;){var A=se.pop();A.$$.deleteScheduled=!1,A.delete()}},ve,we=A=>{ve=A,se.length&&ve&&ve(ue)},Pe=()=>{n.getInheritedInstanceCount=$,n.getLiveInheritedInstances=Z,n.flushPendingDeletes=ue,n.setDelayFunction=we},Ae={},Ce=(A,D)=>{for(D===void 0&&cn("ptr should not be undefined");A.baseClass;)D=A.upcast(D),A=A.baseClass;return D},Ve=(A,D)=>(D=Ce(A,D),Ae[D]),je=(A,D)=>{(!D.ptrType||!D.ptr)&&Wo("makeClassHandle requires ptr and ptrType");var Q=!!D.smartPtrType,oe=!!D.smartPtr;return Q!==oe&&Wo("Both smartPtrType and smartPtr must be specified"),D.count={value:1},Je(Object.create(A,{$$:{value:D,writable:!0}}))};function $e(A){var D=this.getPointee(A);if(!D)return this.destructor(A),null;var Q=Ve(this.registeredClass,D);if(Q!==void 0){if(Q.$$.count.value===0)return Q.$$.ptr=D,Q.$$.smartPtr=A,Q.clone();var oe=Q.clone();return this.destructor(A),oe}function Se(){return this.isSmartPointer?je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:D,smartPtrType:this,smartPtr:A}):je(this.registeredClass.instancePrototype,{ptrType:this,ptr:A})}var Le=this.registeredClass.getActualType(D),Fe=B[Le];if(!Fe)return Se.call(this);var De;this.isConst?De=Fe.constPointerType:De=Fe.pointerType;var et=C(D,this.registeredClass,De.registeredClass);return et===null?Se.call(this):this.isSmartPointer?je(De.registeredClass.instancePrototype,{ptrType:De,ptr:et,smartPtrType:this,smartPtr:A}):je(De.registeredClass.instancePrototype,{ptrType:De,ptr:et})}var Je=A=>typeof FinalizationRegistry>"u"?(Je=D=>D,A):(Gs=new FinalizationRegistry(D=>{console.warn(D.leakWarning.stack.replace(/^Error: /,"")),y(D.$$)}),Je=D=>{var Q=D.$$,oe=!!Q.smartPtr;if(oe){var Se={$$:Q},Le=Q.ptrType.registeredClass;Se.leakWarning=new Error(`Embind found a leaked C++ instance ${Le.name} <${Et(Q.ptr)}>. -We'll free it automatically in this case, but this functionality is not reliable across various environments. -Make sure to invoke .delete() manually once you're done with the instance instead. -Originally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(Se.leakWarning,$e),Gs.register(D,Se,D)}return D},Ie=D=>Gs.unregister(D),Je(A)),pt=()=>{Object.assign(ht.prototype,{isAliasOf(A){if(!(this instanceof ht)||!(A instanceof ht))return!1;var D=this.$$.ptrType.registeredClass,Q=this.$$.ptr;A.$$=A.$$;for(var oe=A.$$.ptrType.registeredClass,Se=A.$$.ptr;D.baseClass;)Q=D.upcast(Q),D=D.baseClass;for(;oe.baseClass;)Se=oe.upcast(Se),oe=oe.baseClass;return D===oe&&Q===Se},clone(){if(this.$$.ptr||uo(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var A=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:Pl(this.$$)}}));return A.$$.count.value+=1,A.$$.deleteScheduled=!1,A},delete(){this.$$.ptr||uo(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&cn("Object already scheduled for deletion"),Ie(this),y(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||uo(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&cn("Object already scheduled for deletion"),se.push(this),se.length===1&&ve&&ve(ue),this.$$.deleteScheduled=!0,this}})};function ht(){}var bt=(A,D)=>Object.defineProperty(D,"name",{value:A}),kt=(A,D,Q)=>{if(A[D].overloadTable===void 0){var oe=A[D];A[D]=function(){return A[D].overloadTable.hasOwnProperty(arguments.length)||cn(`Function '${Q}' called with an invalid number of arguments (${arguments.length}) - expects one of (${A[D].overloadTable})!`),A[D].overloadTable[arguments.length].apply(this,arguments)},A[D].overloadTable=[],A[D].overloadTable[oe.argCount]=oe}},zt=(A,D,Q)=>{n.hasOwnProperty(A)?((Q===void 0||n[A].overloadTable!==void 0&&n[A].overloadTable[Q]!==void 0)&&cn(`Cannot register public name '${A}' twice`),kt(n,A,A),n.hasOwnProperty(Q)&&cn(`Cannot register multiple overloads of a function with the same number of arguments (${Q})!`),n[A].overloadTable[Q]=D):(n[A]=D,Q!==void 0&&(n[A].numArguments=Q))},tn=48,Cn=57,Sn=A=>{if(A===void 0)return"_unknown";A=A.replace(/[^a-zA-Z0-9_]/g,"$");var D=A.charCodeAt(0);return D>=tn&&D<=Cn?`_${A}`:A};function Ai(A,D,Q,oe,Se,Le,Fe,De){this.name=A,this.constructor=D,this.instancePrototype=Q,this.rawDestructor=oe,this.baseClass=Se,this.getActualType=Le,this.upcast=Fe,this.downcast=De,this.pureVirtualFunctions=[]}var ei=(A,D,Q)=>{for(;D!==Q;)D.upcast||cn(`Expected null or instance of ${Q.name}, got an instance of ${D.name}`),A=D.upcast(A),D=D.baseClass;return A};function ti(A,D){if(D===null)return this.isReference&&cn(`null is not a valid ${this.name}`),0;D.$$||cn(`Cannot pass "${Hs(D)}" as a ${this.name}`),D.$$.ptr||cn(`Cannot pass deleted object as a pointer of type ${this.name}`);var Q=D.$$.ptrType.registeredClass,oe=ei(D.$$.ptr,Q,this.registeredClass);return oe}function ji(A,D){var Q;if(D===null)return this.isReference&&cn(`null is not a valid ${this.name}`),this.isSmartPointer?(Q=this.rawConstructor(),A!==null&&A.push(this.rawDestructor,Q),Q):0;(!D||!D.$$)&&cn(`Cannot pass "${Hs(D)}" as a ${this.name}`),D.$$.ptr||cn(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&D.$$.ptrType.isConst&&cn(`Cannot convert argument of type ${D.$$.smartPtrType?D.$$.smartPtrType.name:D.$$.ptrType.name} to parameter type ${this.name}`);var oe=D.$$.ptrType.registeredClass;if(Q=ei(D.$$.ptr,oe,this.registeredClass),this.isSmartPointer)switch(D.$$.smartPtr===void 0&&cn("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:D.$$.smartPtrType===this?Q=D.$$.smartPtr:cn(`Cannot convert argument of type ${D.$$.smartPtrType?D.$$.smartPtrType.name:D.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:Q=D.$$.smartPtr;break;case 2:if(D.$$.smartPtrType===this)Q=D.$$.smartPtr;else{var Se=D.clone();Q=this.rawShare(Q,Rn.toHandle(()=>Se.delete())),A!==null&&A.push(this.rawDestructor,Q)}break;default:cn("Unsupporting sharing policy")}return Q}function ur(A,D){if(D===null)return this.isReference&&cn(`null is not a valid ${this.name}`),0;D.$$||cn(`Cannot pass "${Hs(D)}" as a ${this.name}`),D.$$.ptr||cn(`Cannot pass deleted object as a pointer of type ${this.name}`),D.$$.ptrType.isConst&&cn(`Cannot convert argument of type ${D.$$.ptrType.name} to parameter type ${this.name}`);var Q=D.$$.ptrType.registeredClass,oe=ei(D.$$.ptr,Q,this.registeredClass);return oe}function gn(A){return this.fromWireType(V[A>>2])}var hn=()=>{Object.assign(Xi.prototype,{getPointee(A){return this.rawGetPointee&&(A=this.rawGetPointee(A)),A},destructor(A){var D;(D=this.rawDestructor)==null||D.call(this,A)},argPackAdvance:mn,readValueFromPointer:gn,fromWireType:$e})};function Xi(A,D,Q,oe,Se,Le,Fe,De,et,it,rt){this.name=A,this.registeredClass=D,this.isReference=Q,this.isConst=oe,this.isSmartPointer=Se,this.pointeeType=Le,this.sharingPolicy=Fe,this.rawGetPointee=De,this.rawConstructor=et,this.rawShare=it,this.rawDestructor=rt,!Se&&D.baseClass===void 0?oe?(this.toWireType=ti,this.destructorFunction=null):(this.toWireType=ur,this.destructorFunction=null):this.toWireType=ji}var vs=(A,D,Q)=>{n.hasOwnProperty(A)||Wo("Replacing nonexistant public symbol"),n[A].overloadTable!==void 0&&Q!==void 0?n[A].overloadTable[Q]=D:(n[A]=D,n[A].argCount=Q)},Ws=(A,D,Q)=>{_("dynCall_"+A in n,`bad function pointer type - dynCall function not found for sig '${A}'`),Q!=null&&Q.length?_(Q.length===A.substring(1).replace(/j/g,"--").length):_(A.length==1);var oe=n["dynCall_"+A];return Q&&Q.length?oe.apply(null,[D].concat(Q)):oe.call(null,D)},Ss=[],Es,zs=A=>{var D=Ss[A];return D||(A>=Ss.length&&(Ss.length=A+1),Ss[A]=D=Es.get(A)),_(Es.get(A)==D,"JavaScript-side Wasm function table mirror is out of date!"),D},co=(A,D,Q)=>{if(A.includes("j"))return Ws(A,D,Q);_(zs(D),`missing table entry in dynCall: ${D}`);var oe=zs(D).apply(null,Q);return oe},L1=(A,D)=>{_(A.includes("j")||A.includes("p"),"getDynCaller should only be called with i64 sigs");var Q=[];return function(){return Q.length=0,Object.assign(Q,arguments),co(A,D,Q)}},Dn=(A,D)=>{A=Li(A);function Q(){return A.includes("j")?L1(A,D):zs(D)}var oe=Q();return typeof oe!="function"&&cn(`unknown function pointer with signature ${A}: ${D}`),oe},nc=(A,D)=>{var Q=bt(D,function(oe){this.name=D,this.message=oe;var Se=new Error(oe).stack;Se!==void 0&&(this.stack=this.toString()+` -`+Se.replace(/^Error(:[^\n]*)?\n/,""))});return Q.prototype=Object.create(A.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},Q},Us,nd=A=>{var D=Y1(A),Q=Li(D);return jr(D),Q},Uo=(A,D)=>{var Q=[],oe={};function Se(Le){if(!oe[Le]&&!ar[Le]){if(wi[Le]){wi[Le].forEach(Se);return}Q.push(Le),oe[Le]=!0}}throw D.forEach(Se),new Us(`${A}: `+Q.map(nd).join([", "]))},cr=(A,D,Q,oe,Se,Le,Fe,De,et,it,rt,gt,yt)=>{rt=Li(rt),Le=Dn(Se,Le),De&&(De=Dn(Fe,De)),it&&(it=Dn(et,it)),yt=Dn(gt,yt);var St=Sn(rt);zt(St,function(){Uo(`Cannot construct ${rt} due to unbound types`,[oe])}),Vs([A,D,Q],oe?[oe]:[],function(vt){var Kt;vt=vt[0];var Bt,Xt;oe?(Bt=vt.registeredClass,Xt=Bt.instancePrototype):Xt=ht.prototype;var yn=bt(rt,function(){if(Object.getPrototypeOf(this)!==lt)throw new bs("Use 'new' to construct "+rt);if(Pt.constructor_body===void 0)throw new bs(rt+" has no accessible constructor");var yi=Pt.constructor_body[arguments.length];if(yi===void 0)throw new bs(`Tried to invoke ctor of ${rt} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(Pt.constructor_body).toString()}) parameters instead!`);return yi.apply(this,arguments)}),lt=Object.create(Xt,{constructor:{value:yn}});yn.prototype=lt;var Pt=new Ai(rt,yn,lt,yt,Bt,Le,De,it);Pt.baseClass&&((Kt=Pt.baseClass).__derivedClasses??(Kt.__derivedClasses=[]),Pt.baseClass.__derivedClasses.push(Pt));var On=new Xi(rt,Pt,!0,!1,!1),En=new Xi(rt+"*",Pt,!1,!1,!1),bi=new Xi(rt+" const*",Pt,!1,!0,!1);return B[A]={pointerType:En,constPointerType:bi},vs(St,yn),[On,En,bi]})},Ml=(A,D)=>{for(var Q=[],oe=0;oe>2]);return Q},id=A=>{for(;A.length;){var D=A.pop(),Q=A.pop();Q(D)}};function ic(A){for(var D=1;D0?", ":"")+et),rt+=(oe||Se?"var rv = ":"")+"invoker(fn"+(et.length>0?", ":"")+et+`); -`,Le)rt+=`runDestructors(destructors); -`;else for(var it=Q?1:2;it{_(D>0);var Fe=Ml(D,Q);Se=Dn(oe,Se),Vs([],[A],function(De){De=De[0];var et=`constructor ${De.name}`;if(De.registeredClass.constructor_body===void 0&&(De.registeredClass.constructor_body=[]),De.registeredClass.constructor_body[D-1]!==void 0)throw new bs(`Cannot register multiple constructors with identical number of parameters (${D-1}) for class '${De.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return De.registeredClass.constructor_body[D-1]=()=>{Uo(`Cannot construct ${De.name} due to unbound types`,Fe)},Vs([],Fe,it=>(it.splice(1,0,null),De.registeredClass.constructor_body[D-1]=Cl(et,it,null,Se,Le),[])),[]})},od=A=>{A=A.trim();const D=A.indexOf("(");return D!==-1?(_(A[A.length-1]==")","Parentheses for argument names should match."),A.substr(0,D)):A},hr=(A,D,Q,oe,Se,Le,Fe,De,et)=>{var it=Ml(Q,oe);D=Li(D),D=od(D),Le=Dn(Se,Le),Vs([],[A],function(rt){rt=rt[0];var gt=`${rt.name}.${D}`;D.startsWith("@@")&&(D=Symbol[D.substring(2)]),De&&rt.registeredClass.pureVirtualFunctions.push(D);function yt(){Uo(`Cannot call ${gt} due to unbound types`,it)}var St=rt.registeredClass.instancePrototype,vt=St[D];return vt===void 0||vt.overloadTable===void 0&&vt.className!==rt.name&&vt.argCount===Q-2?(yt.argCount=Q-2,yt.className=rt.name,St[D]=yt):(kt(St,D,gt),St[D].overloadTable[Q-2]=yt),Vs([],it,function(Bt){var Xt=Cl(gt,Bt,rt,Le,Fe,et);return St[D].overloadTable===void 0?(Xt.argCount=Q-2,St[D]=Xt):St[D].overloadTable[Q-2]=Xt,[]}),[]})};class A1{constructor(){this.allocated=[void 0],this.freelist=[]}get(D){return _(this.allocated[D]!==void 0,`invalid handle: ${D}`),this.allocated[D]}has(D){return this.allocated[D]!==void 0}allocate(D){var Q=this.freelist.pop()||this.allocated.length;return this.allocated[Q]=D,Q}free(D){_(this.allocated[D]!==void 0),this.allocated[D]=void 0,this.freelist.push(D)}}var dr=new A1,$s=A=>{A>=dr.reserved&&--dr.get(A).refcount===0&&dr.free(A)},Ll=()=>{for(var A=0,D=dr.reserved;D{dr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(dr,{reserved:dr.allocated.length}),n.count_emval_handles=Ll},Rn={toValue:A=>(A||cn("Cannot use deleted val. handle = "+A),dr.get(A).value),toHandle:A=>{switch(A){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return dr.allocate({refcount:1,value:A})}}};function xs(A){return this.fromWireType(R[A>>2])}var sc={name:"emscripten::val",fromWireType:A=>{var D=Rn.toValue(A);return $s(A),D},toWireType:(A,D)=>Rn.toHandle(D),argPackAdvance:mn,readValueFromPointer:xs,destructorFunction:null},R1=A=>lr(A,sc),Hs=A=>{if(A===null)return"null";var D=typeof A;return D==="object"||D==="array"||D==="function"?A.toString():""+A},I1=(A,D)=>{switch(D){case 4:return function(Q){return this.fromWireType(U[Q>>2])};case 8:return function(Q){return this.fromWireType(K[Q>>3])};default:throw new TypeError(`invalid float width (${D}): ${A}`)}},N1=(A,D,Q)=>{D=Li(D),lr(A,{name:D,fromWireType:oe=>oe,toWireType:(oe,Se)=>{if(typeof Se!="number"&&typeof Se!="boolean")throw new TypeError(`Cannot convert ${Hs(Se)} to ${this.name}`);return Se},argPackAdvance:mn,readValueFromPointer:I1(D,Q),destructorFunction:null})},k1=(A,D,Q,oe,Se,Le,Fe)=>{var De=Ml(D,Q);A=Li(A),A=od(A),Se=Dn(oe,Se),zt(A,function(){Uo(`Cannot call ${A} due to unbound types`,De)},D-1),Vs([],De,function(et){var it=[et[0],null].concat(et.slice(1));return vs(A,Cl(A,it,null,Se,Le,Fe),D-1),[]})},ad=(A,D,Q)=>{switch(D){case 1:return Q?oe=>E[oe>>0]:oe=>M[oe>>0];case 2:return Q?oe=>N[oe>>1]:oe=>I[oe>>1];case 4:return Q?oe=>R[oe>>2]:oe=>V[oe>>2];default:throw new TypeError(`invalid integer width (${D}): ${A}`)}},Al=(A,D,Q,oe,Se)=>{D=Li(D),Se===-1&&(Se=4294967295);var Le=rt=>rt;if(oe===0){var Fe=32-8*Q;Le=rt=>rt<>>Fe}var De=D.includes("unsigned"),et=(rt,gt)=>{if(typeof rt!="number"&&typeof rt!="boolean")throw new TypeError(`Cannot convert "${Hs(rt)}" to ${gt}`);if(rtSe)throw new TypeError(`Passing a number "${Hs(rt)}" from JS side to C/C++ side to an argument of type "${D}", which is outside the valid range [${oe}, ${Se}]!`)},it;De?it=function(rt,gt){return et(gt,this.name),gt>>>0}:it=function(rt,gt){return et(gt,this.name),gt},lr(A,{name:D,fromWireType:Le,toWireType:it,argPackAdvance:mn,readValueFromPointer:ad(D,Q,oe!==0),destructorFunction:null})},$o=(A,D,Q)=>{var oe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Se=oe[D];function Le(Fe){var De=V[Fe>>2],et=V[Fe+4>>2];return new Se(E.buffer,et,De)}Q=Li(Q),lr(A,{name:Q,fromWireType:Le,argPackAdvance:mn,readValueFromPointer:Le},{ignoreDuplicateRegistrations:!0})},ld=(A,D,Q)=>(_(typeof Q=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Yn(A,M,D,Q)),ud=(A,D)=>{D=Li(D);var Q=D==="std::string";lr(A,{name:D,fromWireType(oe){var Se=V[oe>>2],Le=oe+4,Fe;if(Q)for(var De=Le,et=0;et<=Se;++et){var it=Le+et;if(et==Se||M[it]==0){var rt=it-De,gt=Jt(De,rt);Fe===void 0?Fe=gt:(Fe+="\0",Fe+=gt),De=it+1}}else{for(var yt=new Array(Se),et=0;et>2]=Le,Q&&Fe)ld(Se,et,Le+1);else if(Fe)for(var it=0;it255&&(jr(et),cn("String has UTF-16 code units that do not fit in 8 bits")),M[et+it]=rt}else for(var it=0;it{_(A%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var Q=A,oe=Q>>1,Se=oe+D/2;!(oe>=Se)&&I[oe];)++oe;if(Q=oe<<1,Q-A>32&&oc)return oc.decode(M.subarray(A,Q));for(var Le="",Fe=0;!(Fe>=D/2);++Fe){var De=N[A+Fe*2>>1];if(De==0)break;Le+=String.fromCharCode(De)}return Le},lc=(A,D,Q)=>{if(_(D%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),_(typeof Q=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q??(Q=2147483647),Q<2)return 0;Q-=2;for(var oe=D,Se=Q>1]=Fe,D+=2}return N[D>>1]=0,D-oe},cd=A=>A.length*2,O1=(A,D)=>{_(A%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var Q=0,oe="";!(Q>=D/4);){var Se=R[A+Q*4>>2];if(Se==0)break;if(++Q,Se>=65536){var Le=Se-65536;oe+=String.fromCharCode(55296|Le>>10,56320|Le&1023)}else oe+=String.fromCharCode(Se)}return oe},uc=(A,D,Q)=>{if(_(D%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),_(typeof Q=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q??(Q=2147483647),Q<4)return 0;for(var oe=D,Se=oe+Q-4,Le=0;Le=55296&&Fe<=57343){var De=A.charCodeAt(++Le);Fe=65536+((Fe&1023)<<10)|De&1023}if(R[D>>2]=Fe,D+=4,D+4>Se)break}return R[D>>2]=0,D-oe},cc=A=>{for(var D=0,Q=0;Q=55296&&oe<=57343&&++Q,D+=4}return D},F1=(A,D,Q)=>{Q=Li(Q);var oe,Se,Le,Fe,De;D===2?(oe=ac,Se=lc,Fe=cd,Le=()=>I,De=1):D===4&&(oe=O1,Se=uc,Fe=cc,Le=()=>V,De=2),lr(A,{name:Q,fromWireType:et=>{for(var it=V[et>>2],rt=Le(),gt,yt=et+4,St=0;St<=it;++St){var vt=et+4+St*D;if(St==it||rt[vt>>De]==0){var Bt=vt-yt,Xt=oe(yt,Bt);gt===void 0?gt=Xt:(gt+="\0",gt+=Xt),yt=vt+D}}return jr(et),gt},toWireType:(et,it)=>{typeof it!="string"&&cn(`Cannot pass non-string to C++ string type ${Q}`);var rt=Fe(it),gt=Pn(4+rt+D);return V[gt>>2]=rt>>De,Se(it,gt+4,rt+D),et!==null&&et.push(jr,gt),gt},argPackAdvance:mn,readValueFromPointer:xs,destructorFunction(et){jr(et)}})},hd=(A,D)=>{D=Li(D),lr(A,{isVoid:!0,name:D,argPackAdvance:0,fromWireType:()=>{},toWireType:(Q,oe)=>{}})},Ki=()=>{Y("native code called abort()")},hc=(A,D,Q)=>M.copyWithin(A,D,D+Q),Oa=()=>2147483648,dd=A=>{var D=T.buffer,Q=(A-D.byteLength+65535)/65536;try{return T.grow(Q),k(),1}catch(oe){v(`growMemory: Attempted to grow heap from ${D.byteLength} bytes to ${A} bytes, but got error: ${oe}`)}},fd=A=>{var D=M.length;A>>>=0,_(A>D);var Q=Oa();if(A>Q)return v(`Cannot enlarge memory, requested ${A} bytes, but the limit is ${Q} bytes!`),!1;for(var oe=(et,it)=>et+(it-et%it)%it,Se=1;Se<=4;Se*=2){var Le=D*(1+.2/Se);Le=Math.min(Le,A+100663296);var Fe=Math.min(Q,oe(Math.max(A,Le),65536)),De=dd(Fe);if(De)return!0}return v(`Failed to grow the heap from ${D} bytes to ${Fe} bytes, not enough memory!`),!1},dc={},B1=()=>r||"./this.program",Fa=()=>{if(!Fa.strings){var A=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",D={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:A,_:B1()};for(var Q in dc)dc[Q]===void 0?delete D[Q]:D[Q]=dc[Q];var oe=[];for(var Q in D)oe.push(`${Q}=${D[Q]}`);Fa.strings=oe}return Fa.strings},D1=(A,D)=>{for(var Q=0;Q>0]=A.charCodeAt(Q);E[D>>0]=0},V1=(A,D)=>{var Q=0;return Fa().forEach((oe,Se)=>{var Le=D+Q;V[A+Se*4>>2]=Le,D1(oe,Le),Q+=oe.length+1}),0},Ho=(A,D)=>{var Q=Fa();V[A>>2]=Q.length;var oe=0;return Q.forEach(Se=>oe+=Se.length+1),V[D>>2]=oe,0};function G1(A){try{var D=xn.getStreamFromFD(A);return fe.close(D),0}catch(Q){if(typeof fe>"u"||Q.name!=="ErrnoError")throw Q;return Q.errno}}var W1=(A,D,Q,oe)=>{for(var Se=0,Le=0;Le>2],De=V[D+4>>2];D+=8;var et=fe.read(A,E,Fe,De,oe);if(et<0)return-1;if(Se+=et,et>2]=Le,0}catch(Fe){if(typeof fe>"u"||Fe.name!=="ErrnoError")throw Fe;return Fe.errno}}var pd=(A,D)=>(_(A==A>>>0||A==(A|0)),_(D===(D|0)),D+2097152>>>0<4194305-!!A?(A>>>0)+D*4294967296:NaN);function js(A,D,Q,oe,Se){var Le=pd(D,Q);try{if(isNaN(Le))return 61;var Fe=xn.getStreamFromFD(A);return fe.llseek(Fe,Le,oe),We=[Fe.position>>>0,(Re=Fe.position,+Math.abs(Re)>=1?Re>0?+Math.floor(Re/4294967296)>>>0:~~+Math.ceil((Re-+(~~Re>>>0))/4294967296)>>>0:0)],R[Se>>2]=We[0],R[Se+4>>2]=We[1],Fe.getdents&&Le===0&&oe===0&&(Fe.getdents=null),0}catch(De){if(typeof fe>"u"||De.name!=="ErrnoError")throw De;return De.errno}}var Rl=(A,D,Q,oe)=>{for(var Se=0,Le=0;Le>2],De=V[D+4>>2];D+=8;var et=fe.write(A,E,Fe,De,oe);if(et<0)return-1;Se+=et,typeof oe<"u"&&(oe+=et)}return Se};function z1(A,D,Q,oe){try{var Se=xn.getStreamFromFD(A),Le=Rl(Se,D,Q);return V[oe>>2]=Le,0}catch(Fe){if(typeof fe>"u"||Fe.name!=="ErrnoError")throw Fe;return Fe.errno}}var Il=A=>A%4===0&&(A%100!==0||A%400===0),U1=(A,D)=>{for(var Q=0,oe=0;oe<=D;Q+=A[oe++]);return Q},ho=[31,29,31,30,31,30,31,31,30,31,30,31],fr=[31,28,31,30,31,30,31,31,30,31,30,31],md=(A,D)=>{for(var Q=new Date(A.getTime());D>0;){var oe=Il(Q.getFullYear()),Se=Q.getMonth(),Le=(oe?ho:fr)[Se];if(D>Le-Q.getDate())D-=Le-Q.getDate()+1,Q.setDate(1),Se<11?Q.setMonth(Se+1):(Q.setMonth(0),Q.setFullYear(Q.getFullYear()+1));else return Q.setDate(Q.getDate()+D),Q}return Q},gd=(A,D)=>{_(A.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),E.set(A,D)},$1=(A,D,Q,oe)=>{var Se=V[oe+40>>2],Le={tm_sec:R[oe>>2],tm_min:R[oe+4>>2],tm_hour:R[oe+8>>2],tm_mday:R[oe+12>>2],tm_mon:R[oe+16>>2],tm_year:R[oe+20>>2],tm_wday:R[oe+24>>2],tm_yday:R[oe+28>>2],tm_isdst:R[oe+32>>2],tm_gmtoff:R[oe+36>>2],tm_zone:Se?Jt(Se):""},Fe=Jt(Q),De={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var et in De)Fe=Fe.replace(new RegExp(et,"g"),De[et]);var it=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],rt=["January","February","March","April","May","June","July","August","September","October","November","December"];function gt(lt,Pt,On){for(var En=typeof lt=="number"?lt.toString():lt||"";En.length0?1:0}var En;return(En=On(lt.getFullYear()-Pt.getFullYear()))===0&&(En=On(lt.getMonth()-Pt.getMonth()))===0&&(En=On(lt.getDate()-Pt.getDate())),En}function vt(lt){switch(lt.getDay()){case 0:return new Date(lt.getFullYear()-1,11,29);case 1:return lt;case 2:return new Date(lt.getFullYear(),0,3);case 3:return new Date(lt.getFullYear(),0,2);case 4:return new Date(lt.getFullYear(),0,1);case 5:return new Date(lt.getFullYear()-1,11,31);case 6:return new Date(lt.getFullYear()-1,11,30)}}function Bt(lt){var Pt=md(new Date(lt.tm_year+1900,0,1),lt.tm_yday),On=new Date(Pt.getFullYear(),0,4),En=new Date(Pt.getFullYear()+1,0,4),bi=vt(On),Kt=vt(En);return St(bi,Pt)<=0?St(Kt,Pt)<=0?Pt.getFullYear()+1:Pt.getFullYear():Pt.getFullYear()-1}var Xt={"%a":lt=>it[lt.tm_wday].substring(0,3),"%A":lt=>it[lt.tm_wday],"%b":lt=>rt[lt.tm_mon].substring(0,3),"%B":lt=>rt[lt.tm_mon],"%C":lt=>{var Pt=lt.tm_year+1900;return yt(Pt/100|0,2)},"%d":lt=>yt(lt.tm_mday,2),"%e":lt=>gt(lt.tm_mday,2," "),"%g":lt=>Bt(lt).toString().substring(2),"%G":Bt,"%H":lt=>yt(lt.tm_hour,2),"%I":lt=>{var Pt=lt.tm_hour;return Pt==0?Pt=12:Pt>12&&(Pt-=12),yt(Pt,2)},"%j":lt=>yt(lt.tm_mday+U1(Il(lt.tm_year+1900)?ho:fr,lt.tm_mon-1),3),"%m":lt=>yt(lt.tm_mon+1,2),"%M":lt=>yt(lt.tm_min,2),"%n":()=>` -`,"%p":lt=>lt.tm_hour>=0&<.tm_hour<12?"AM":"PM","%S":lt=>yt(lt.tm_sec,2),"%t":()=>" ","%u":lt=>lt.tm_wday||7,"%U":lt=>{var Pt=lt.tm_yday+7-lt.tm_wday;return yt(Math.floor(Pt/7),2)},"%V":lt=>{var Pt=Math.floor((lt.tm_yday+7-(lt.tm_wday+6)%7)/7);if((lt.tm_wday+371-lt.tm_yday-2)%7<=2&&Pt++,Pt){if(Pt==53){var En=(lt.tm_wday+371-lt.tm_yday)%7;En!=4&&(En!=3||!Il(lt.tm_year))&&(Pt=1)}}else{Pt=52;var On=(lt.tm_wday+7-lt.tm_yday-1)%7;(On==4||On==5&&Il(lt.tm_year%400-1))&&Pt++}return yt(Pt,2)},"%w":lt=>lt.tm_wday,"%W":lt=>{var Pt=lt.tm_yday+7-(lt.tm_wday+6)%7;return yt(Math.floor(Pt/7),2)},"%y":lt=>(lt.tm_year+1900).toString().substring(2),"%Y":lt=>lt.tm_year+1900,"%z":lt=>{var Pt=lt.tm_gmtoff,On=Pt>=0;return Pt=Math.abs(Pt)/60,Pt=Pt/60*100+Pt%60,(On?"+":"-")+("0000"+Pt).slice(-4)},"%Z":lt=>lt.tm_zone,"%%":()=>"%"};Fe=Fe.replace(/%%/g,"\0\0");for(var et in Xt)Fe.includes(et)&&(Fe=Fe.replace(new RegExp(et,"g"),Xt[et](Le)));Fe=Fe.replace(/\0\0/g,"%");var yn=Di(Fe,!1);return yn.length>D?0:(gd(yn,A),yn.length-1)},H1=(A,D,Q,oe,Se)=>$1(A,D,Q,oe),j1=A=>{var D=n["_"+A];return _(D,"Cannot call unknown function "+A+", make sure it is exported"),D},X1=A=>{var D=kn(A)+1,Q=Da(D);return ld(A,Q,D),Q},fo=(A,D,Q,oe,Se)=>{var Le={string:vt=>{var Bt=0;return vt!=null&&vt!==0&&(Bt=X1(vt)),Bt},array:vt=>{var Bt=Da(vt.length);return gd(vt,Bt),Bt}};function Fe(vt){return D==="string"?Jt(vt):D==="boolean"?!!vt:vt}var De=j1(A),et=[],it=0;if(_(D!=="array",'Return type should not be "array".'),oe)for(var rt=0;rtfunction(){return fo(A,D,Q,arguments)},nt=function(A,D,Q,oe){A||(A=this),this.parent=A,this.mount=A.mount,this.mounted=null,this.id=fe.nextInode++,this.name=D,this.mode=Q,this.node_ops={},this.stream_ops={},this.rdev=oe},tt=365,_t=146;Object.defineProperties(nt.prototype,{read:{get:function(){return(this.mode&tt)===tt},set:function(A){A?this.mode|=tt:this.mode&=~tt}},write:{get:function(){return(this.mode&_t)===_t},set:function(A){A?this.mode|=_t:this.mode&=~_t}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=nt,fe.createPreloadedFile=ka,fe.staticInit(),n.FS_createPath=fe.createPath,n.FS_createDataFile=fe.createDataFile,n.FS_createPreloadedFile=fe.createPreloadedFile,n.FS_unlink=fe.unlink,n.FS_createLazyFile=fe.createLazyFile,n.FS_createDevice=fe.createDevice,or(),bs=n.BindingError=class extends Error{constructor(D){super(D),this.name="BindingError"}},Tl=n.InternalError=class extends Error{constructor(D){super(D),this.name="InternalError"}},pt(),Pe(),hn(),Us=n.UnboundTypeError=nc(Error,"UnboundTypeError"),rc();function $t(){Ke("fetchSettings")}var bn={__assert_fail:hi,__cxa_throw:$r,__syscall_fcntl64:Qt,__syscall_ioctl:xi,__syscall_openat:gs,_embind_register_bigint:_l,_embind_register_bool:ys,_embind_register_class:cr,_embind_register_class_constructor:Yi,_embind_register_class_function:hr,_embind_register_emval:R1,_embind_register_float:N1,_embind_register_function:k1,_embind_register_integer:Al,_embind_register_memory_view:$o,_embind_register_std_string:ud,_embind_register_std_wstring:F1,_embind_register_void:hd,abort:Ki,emscripten_memcpy_js:hc,emscripten_resize_heap:fd,environ_get:V1,environ_sizes_get:Ho,fd_close:G1,fd_read:fc,fd_seek:js,fd_write:z1,strftime_l:H1},In=Qe(),Pn=he("malloc"),jr=he("free"),Y1=he("__getTypeName"),pr=he("fflush"),Ba=()=>(Ba=In.emscripten_stack_init)(),pc=()=>(pc=In.emscripten_stack_get_end)(),jo=he("stackSave"),Nl=he("stackRestore"),Da=he("stackAlloc"),wn=he("__cxa_is_pointer_type");n.dynCall_jiji=he("dynCall_jiji"),n.dynCall_viijii=he("dynCall_viijii"),n.dynCall_iiiiij=he("dynCall_iiiiij"),n.dynCall_iiiiijj=he("dynCall_iiiiijj"),n.dynCall_iiiiiijj=he("dynCall_iiiiiijj"),n.addRunDependency=O,n.removeRunDependency=z,n.FS_createPath=fe.createPath,n.FS_createLazyFile=fe.createLazyFile,n.FS_createDevice=fe.createDevice,n.ccall=fo,n.cwrap=He,n.FS_createPreloadedFile=fe.createPreloadedFile,n.FS=fe,n.FS_createDataFile=fe.createDataFile,n.FS_unlink=fe.unlink;var K1=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","exitJS","ydayFromDate","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","getFunctionArgsName","requireRegisteredType","registerInheritedInstance","unregisterInheritedInstance","enumReadValueFromPointer","validateThis","getStringOrSymbol","emval_get_global","emval_returnValue","emval_lookupTypes","emval_addMethodCaller"];K1.forEach(ft);var bd=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","jstoi_s","getExecutableName","dynCallLegacy","getDynCaller","dynCall","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","wasmTable","noExitRuntime","getCFunc","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_methodCallers","reflectConstruct"];bd.forEach(xt);var po;j=function A(){po||yd(),po||(j=A)};function q1(){Ba(),W()}function yd(){if(ye>0||(q1(),ie(),ye>0))return;function A(){po||(po=!0,n.calledRun=!0,!P&&(be(),l(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),_(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),ae()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),A()},1)):A(),G()}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return yd(),t.ready}})();const wB=()=>{const[e,t]=Qn.useState(!1),[n,l]=Qn.useState(Sx.air),[g,b]=Qn.useState(null);Qn.useEffect(()=>{(async()=>b(await xB()))()},[]),Qn.useEffect(()=>{g&&(g==null||g.FS.mkdir("/voices/"),t(!0))},[g]);const{data:a,isLoading:r,error:h}=NT({queryKey:["oddVoices",n],queryFn:async()=>{if(!g||!n)return;const c=await(await fetch(`${EB}${n}.voice`)).arrayBuffer(),o=`/voices/${n}.voice`;g.FS.writeFile(o,new Uint8Array(c));const u=new g.Voice;return u.initFromFile(o),u},enabled:!!(e&&n&&g),retry:!1}),s=m=>{if(!g){console.error("OddVoice app not initialized");return}if(!a){console.error("Voice data not loaded");return}const c=g.sing(a,JSON.stringify(m),"out.wav","");if(c!==""){console.error(c);return}const o=g.FS.readFile("out.wav");if(!o||o.length===0){console.error("No buffer");return}return o};return h&&console.error(h),{isLoadingApp:!g,isLoadingVoice:r,generateVoiceFromOddVoiceJson:s,activeVoice:n,setActiveVoice:l,voiceLoadingFailed:!r&&!a}};var Sb={},_B=ec;Object.defineProperty(Sb,"__esModule",{value:!0});var Ex=Sb.default=void 0,TB=_B(tc()),PB=Be;Ex=Sb.default=(0,TB.default)((0,PB.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var Eb={},MB=ec;Object.defineProperty(Eb,"__esModule",{value:!0});var xx=Eb.default=void 0,CB=MB(tc()),LB=Be;xx=Eb.default=(0,CB.default)((0,LB.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause");var xb={},AB=ec;Object.defineProperty(xb,"__esModule",{value:!0});var wx=xb.default=void 0,RB=AB(tc()),IB=Be;wx=xb.default=(0,RB.default)((0,IB.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");const NB=()=>{const[e,t]=Qn.useState(0);return Be.jsxs(uB,{size:"small",exclusive:!0,onChange:(n,l)=>{const g=document.querySelectorAll("audio");Ct.forEach(g,b=>{l==="play"?b.play():l==="pause"?b.pause():l==="stop"?(b.pause(),b.currentTime=0):l==="jump"&&Ct.forEach(g,a=>{a.currentTime=e})})},"aria-label":"text formatting",children:[Be.jsx(gf,{value:"play","aria-label":"italic",children:Be.jsx(Ex,{})}),Be.jsx(gf,{value:"pause","aria-label":"underlined",children:Be.jsx(xx,{})}),Be.jsx(gf,{value:"stop","aria-label":"color",children:Be.jsx(wx,{})}),Be.jsx(gf,{value:"jump","aria-label":"color",children:"Jump to"}),Be.jsx(jF,{type:"number",value:e,placeholder:"Enter time in seconds",onChange:n=>{t(Number(n.target.value))},inputProps:{min:0,step:1}})]})};var wb={},kB=ec;Object.defineProperty(wb,"__esModule",{value:!0});var _x=wb.default=void 0,OB=kB(tc()),FB=Be;_x=wb.default=(0,OB.default)((0,FB.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");var To=(e=>(e.SetFrequencyImmediate="setFrequencyImmediate",e.SetTargetFrequency="setTargetFrequency",e.NoteOn="noteOn",e.NoteOff="noteOff",e.SetFormantShift="setFormantShift",e.SetPhonemeSpeed="setPhonemeSpeed",e.Empty="empty",e))(To||{});const ta=({eventType:e,time:t,frequency:n=0,formantShift:l=1,phonemeSpeed:g=1})=>({type:e,time:t,frequency:n,formantShift:l,phonemeSpeed:g}),BB={C:0,D:2,E:4,F:5,G:7,A:9,B:11};var _b={},C1={};(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",l="["+t+"]["+n+"]*",g=new RegExp("^"+l+"$"),b=function(r,h){const s=[];let m=h.exec(r);for(;m;){const c=[];c.startIndex=h.lastIndex-m[0].length;const o=m.length;for(let u=0;u"u")};e.isExist=function(r){return typeof r<"u"},e.isEmptyObject=function(r){return Object.keys(r).length===0},e.merge=function(r,h,s){if(h){const m=Object.keys(h),c=m.length;for(let o=0;o"&&e[b]!==" "&&e[b]!==" "&&e[b]!==` -`&&e[b]!=="\r";b++)h+=e[b];if(h=h.trim(),h[h.length-1]==="/"&&(h=h.substring(0,h.length-1),b--),!jB(h)){let c;return h.trim().length===0?c="Invalid space after '<'.":c="Tag '"+h+"' is an invalid name.",fi("InvalidTag",c,vr(e,b))}const s=WB(e,b);if(s===!1)return fi("InvalidAttr","Attributes for '"+h+"' have open quote.",vr(e,b));let m=s.value;if(b=s.index,m[m.length-1]==="/"){const c=b-m.length;m=m.substring(0,m.length-1);const o=A4(m,t);if(o===!0)l=!0;else return fi(o.err.code,o.err.msg,vr(e,c+o.err.line))}else if(r)if(s.tagClosed){if(m.trim().length>0)return fi("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",vr(e,a));{const c=n.pop();if(h!==c.tagName){let o=vr(e,c.tagStartPos);return fi("InvalidTag","Expected closing tag '"+c.tagName+"' (opened in line "+o.line+", col "+o.col+") instead of closing tag '"+h+"'.",vr(e,a))}n.length==0&&(g=!0)}}else return fi("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",vr(e,b));else{const c=A4(m,t);if(c!==!0)return fi(c.err.code,c.err.msg,vr(e,b-m.length+c.err.line));if(g===!0)return fi("InvalidXml","Multiple possible root nodes found.",vr(e,b));t.unpairedTags.indexOf(h)!==-1||n.push({tagName:h,tagStartPos:a}),l=!0}for(b++;b0)return fi("InvalidXml","Invalid '"+JSON.stringify(n.map(b=>b.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return fi("InvalidXml","Start tag expected.",1);return!0};function M4(e){return e===" "||e===" "||e===` -`||e==="\r"}function C4(e,t){const n=t;for(;t5&&l==="xml")return fi("InvalidXml","XML declaration allowed only at the start of the document.",vr(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function L4(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}const VB='"',GB="'";function WB(e,t){let n="",l="",g=!1;for(;t"&&l===""){g=!0;break}n+=e[t]}return l!==""?!1:{value:n,index:t,tagClosed:g}}const zB=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function A4(e,t){const n=Tb.getAllMatches(e,zB),l={};for(let g=0;g!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}},XB=function(e){return Object.assign({},Tx,e)};Pb.buildOptions=XB;Pb.defaultOptions=Tx;class YB{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var KB=YB;const qB=C1;function QB(e,t){const n={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let l=1,g=!1,b=!1,a="";for(;t"){if(b?e[t-1]==="-"&&e[t-2]==="-"&&(b=!1,l--):l--,l===0)break}else e[t]==="["?g=!0:a+=e[t];if(l!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:t}}function ZB(e,t){let n="";for(;t0&&g&&n[2]!==".")return e;if(!t.leadingZeros&&b.length>0&&!g&&n[1]!==".")return e;{const h=Number(n),s=""+h;return s.search(/[eE]/)!==-1||r?t.eNotation?h:e:n.indexOf(".")!==-1?s==="0"&&a===""||s===a||g&&s==="-"+a?h:e:b?a===s||g+a===s?h:e:n===s||n===g+s?h:e}}else return e}}function cD(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}var hD=uD;const Px=C1,Uc=KB,dD=sD,fD=hD;let pD=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=mD,this.parseXml=SD,this.parseTextData=gD,this.resolveNameSpace=bD,this.buildAttributesMap=vD,this.isItStopNode=_D,this.replaceEntitiesValue=xD,this.readStopNodeData=PD,this.saveTextToParentTag=wD,this.addChild=ED}};function mD(e){const t=Object.keys(e);for(let n=0;n0)){a||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,g,b);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues?Hg(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?Hg(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function bD(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const yD=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function vD(e,t,n){if(!this.options.ignoreAttributes&&typeof e=="string"){const l=Px.getAllMatches(e,yD),g=l.length,b={};for(let a=0;a",b,"Closing Tag is not closed.");let h=e.substring(b+2,r).trim();if(this.options.removeNSPrefix){const c=h.indexOf(":");c!==-1&&(h=h.substr(c+1))}this.options.transformTagName&&(h=this.options.transformTagName(h)),n&&(l=this.saveTextToParentTag(l,n,g));const s=g.substring(g.lastIndexOf(".")+1);if(h&&this.options.unpairedTags.indexOf(h)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let m=0;s&&this.options.unpairedTags.indexOf(s)!==-1?(m=g.lastIndexOf(".",g.lastIndexOf(".")-1),this.tagsNodeStack.pop()):m=g.lastIndexOf("."),g=g.substring(0,m),n=this.tagsNodeStack.pop(),l="",b=r}else if(e[b+1]==="?"){let r=$g(e,b,!1,"?>");if(!r)throw new Error("Pi Tag is not closed.");if(l=this.saveTextToParentTag(l,n,g),!(this.options.ignoreDeclaration&&r.tagName==="?xml"||this.options.ignorePiTags)){const h=new Uc(r.tagName);h.add(this.options.textNodeName,""),r.tagName!==r.tagExp&&r.attrExpPresent&&(h[":@"]=this.buildAttributesMap(r.tagExp,g,r.tagName)),this.addChild(n,h,g)}b=r.closeIndex+1}else if(e.substr(b+1,3)==="!--"){const r=nl(e,"-->",b+4,"Comment is not closed.");if(this.options.commentPropName){const h=e.substring(b+4,r-2);l=this.saveTextToParentTag(l,n,g),n.add(this.options.commentPropName,[{[this.options.textNodeName]:h}])}b=r}else if(e.substr(b+1,2)==="!D"){const r=dD(e,b);this.docTypeEntities=r.entities,b=r.i}else if(e.substr(b+1,2)==="!["){const r=nl(e,"]]>",b,"CDATA is not closed.")-2,h=e.substring(b+9,r);if(l=this.saveTextToParentTag(l,n,g),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:h}]);else{let s=this.parseTextData(h,n.tagname,g,!0,!1,!0);s==null&&(s=""),n.add(this.options.textNodeName,s)}b=r+2}else{let r=$g(e,b,this.options.removeNSPrefix),h=r.tagName;const s=r.rawTagName;let m=r.tagExp,c=r.attrExpPresent,o=r.closeIndex;this.options.transformTagName&&(h=this.options.transformTagName(h)),n&&l&&n.tagname!=="!xml"&&(l=this.saveTextToParentTag(l,n,g,!1));const u=n;if(u&&this.options.unpairedTags.indexOf(u.tagname)!==-1&&(n=this.tagsNodeStack.pop(),g=g.substring(0,g.lastIndexOf("."))),h!==t.tagname&&(g+=g?"."+h:h),this.isItStopNode(this.options.stopNodes,g,h)){let d="";if(m.length>0&&m.lastIndexOf("/")===m.length-1)b=r.closeIndex;else if(this.options.unpairedTags.indexOf(h)!==-1)b=r.closeIndex;else{const p=this.readStopNodeData(e,s,o+1);if(!p)throw new Error(`Unexpected end of ${s}`);b=p.i,d=p.tagContent}const x=new Uc(h);h!==m&&c&&(x[":@"]=this.buildAttributesMap(m,g,h)),d&&(d=this.parseTextData(d,h,g,!0,c,!0,!0)),g=g.substr(0,g.lastIndexOf(".")),x.add(this.options.textNodeName,d),this.addChild(n,x,g)}else{if(m.length>0&&m.lastIndexOf("/")===m.length-1){h[h.length-1]==="/"?(h=h.substr(0,h.length-1),g=g.substr(0,g.length-1),m=h):m=m.substr(0,m.length-1),this.options.transformTagName&&(h=this.options.transformTagName(h));const d=new Uc(h);h!==m&&c&&(d[":@"]=this.buildAttributesMap(m,g,h)),this.addChild(n,d,g),g=g.substr(0,g.lastIndexOf("."))}else{const d=new Uc(h);this.tagsNodeStack.push(n),h!==m&&c&&(d[":@"]=this.buildAttributesMap(m,g,h)),this.addChild(n,d,g),n=d}l="",b=o}}else l+=e[b];return t.child};function ED(e,t,n){const l=this.options.updateTag(t.tagname,n,t[":@"]);l===!1||(typeof l=="string"&&(t.tagname=l),e.addChild(t))}const xD=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function wD(e,t,n,l){return e&&(l===void 0&&(l=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,l),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function _D(e,t,n){const l="*."+n;for(const g in e){const b=e[g];if(l===b||t===b)return!0}return!1}function TD(e,t,n=">"){let l,g="";for(let b=t;b",n,`${t} is not closed`);if(e.substring(n+2,b).trim()===t&&(g--,g===0))return{tagContent:e.substring(l,n),i:b};n=b}else if(e[n+1]==="?")n=nl(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=nl(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=nl(e,"]]>",n,"StopNode is not closed.")-2;else{const b=$g(e,n,">");b&&((b&&b.tagName)===t&&b.tagExp[b.tagExp.length-1]!=="/"&&g++,n=b.closeIndex)}}function Hg(e,t,n){if(t&&typeof e=="string"){const l=e.trim();return l==="true"?!0:l==="false"?!1:fD(e,n)}else return Px.isExist(e)?e:""}var MD=pD,Mx={};function CD(e,t){return Cx(e,t)}function Cx(e,t,n){let l;const g={};for(let b=0;b0&&(g[t.textNodeName]=l):l!==void 0&&(g[t.textNodeName]=l),g}function LD(e){const t=Object.keys(e);for(let n=0;n0&&(n=DD),Lx(e,t,"",n)}function Lx(e,t,n,l){let g="",b=!1;for(let a=0;a`,b=!1;continue}else if(h===t.commentPropName){g+=l+``,b=!0;continue}else if(h[0]==="?"){const d=R4(r[":@"],t),x=h==="?xml"?"":l;let p=r[h][0][t.textNodeName];p=p.length!==0?" "+p:"",g+=x+`<${h}${p}${d}?>`,b=!0;continue}let m=l;m!==""&&(m+=t.indentBy);const c=R4(r[":@"],t),o=l+`<${h}${c}`,u=Lx(r[h],t,s,m);t.unpairedTags.indexOf(h)!==-1?t.suppressUnpairedNode?g+=o+">":g+=o+"/>":(!u||u.length===0)&&t.suppressEmptyNode?g+=o+"/>":u&&u.endsWith(">")?g+=o+`>${u}${l}`:(g+=o+">",u&&l!==""&&(u.includes("/>")||u.includes("`),b=!0}return g}function GD(e){const t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Na(e){this.options=Object.assign({},$D,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=XD),this.processTextOrObjNode=HD,this.options.format?(this.indentate=jD,this.tagEndChar=`> -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Na.prototype.build=function(e){return this.options.preserveOrder?UD(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};Na.prototype.j2x=function(e,t){let n="",l="";for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g))if(typeof e[g]>"u")this.isAttribute(g)&&(l+="");else if(e[g]===null)this.isAttribute(g)?l+="":g[0]==="?"?l+=this.indentate(t)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(t)+"<"+g+"/"+this.tagEndChar;else if(e[g]instanceof Date)l+=this.buildTextValNode(e[g],g,"",t);else if(typeof e[g]!="object"){const b=this.isAttribute(g);if(b)n+=this.buildAttrPairStr(b,""+e[g]);else if(g===this.options.textNodeName){let a=this.options.tagValueProcessor(g,""+e[g]);l+=this.replaceEntitiesValue(a)}else l+=this.buildTextValNode(e[g],g,"",t)}else if(Array.isArray(e[g])){const b=e[g].length;let a="";for(let r=0;r"u"||(h===null?g[0]==="?"?l+=this.indentate(t)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(t)+"<"+g+"/"+this.tagEndChar:typeof h=="object"?this.options.oneListGroup?a+=this.j2x(h,t+1).val:a+=this.processTextOrObjNode(h,g,t):a+=this.buildTextValNode(h,g,"",t))}this.options.oneListGroup&&(a=this.buildObjectNode(a,g,"",t)),l+=a}else if(this.options.attributesGroupName&&g===this.options.attributesGroupName){const b=Object.keys(e[g]),a=b.length;for(let r=0;r"+e+g:this.options.commentPropName!==!1&&t===this.options.commentPropName&&b.length===0?this.indentate(l)+``+this.newLine:this.indentate(l)+"<"+t+n+b+this.tagEndChar+e+this.indentate(l)+g}};Na.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(l)+``+this.newLine;if(t[0]==="?")return this.indentate(l)+"<"+t+n+"?"+this.tagEndChar;{let g=this.options.tagValueProcessor(t,e);return g=this.replaceEntitiesValue(g),g===""?this.indentate(l)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(l)+"<"+t+n+">"+g+"0&&this.options.processEntities)for(let t=0;tCt.includes(["part","score-part","measure","credit","note"],e),trimValues:!0,preserveOrder:!0};function eV(e){try{return new ZD.XMLParser(JD).parse(e)}catch(t){throw new Error(`Error reading XML: ${t}`)}}const Fs=e=>{if(!e||!Ct.isPlainObject(e))return!1;const t=Ct.filter(Ct.keys(e),n=>n!==":@");return t.length===1&&Ct.isArray(e[Ct.first(t)])},Ns=e=>Fs(e)?Ct.first(Ct.filter(Ct.keys(e),t=>t!==":@")):void 0,Ro=e=>{const t=Ns(e);return t?e[t]:[]},Wn=(e,t)=>{if(!Fs(e))return;const n=Ro(e);return Ct.find(n,l=>Ns(l)===t)},Fr=e=>{var n;if(!Fs(e))return;const t=Ro(e);return(n=Ct.find(t,l=>!!l["#text"]))==null?void 0:n["#text"]},Mb=(e,t)=>{var n;if(Fs(e))return(n=e[":@"])==null?void 0:n[t]},so=(e,t)=>{if(!Fs(e))return[];const n=Ro(e);return Ct.filter(n,l=>!!(l!=null&&l[t]))},tV=120;class nV{constructor(t,n,l,g){this.partName=t,this.partIdx=n,this.voices=l,this.largestChordPerVoice=g}}function iV(e){const t=Wn(e,"part-list"),n=so(t,"score-part");return Ct.compact(Ct.map(n,l=>Fr(Wn(l,"part-name"))))}const rV=e=>{const t=Ro(e),n=Ct.first(t),l=Wn(n,"attributes"),g=Wn(l,"clef"),b=Wn(g,"sign");return Fr(b)};function sV(e){const t=iV(e),n=so(e,"part"),l=[];for(let g=0;gCt.map(so(c,"note"),o=>Fr(Wn(o,"voice"))))));if(s.length===0){console.log(`Found no voices in part ${b}`);continue}const m=Ct.times(s.length,()=>1);for(let c=0;cFs(e)&&Ns(e)==="measure",Rx=e=>Fs(e)&&Ns(e)==="attributes",Ix=e=>Fs(e)&&Ns(e)==="direction",bp=e=>Fs(e)&&Ns(e)==="note",cV=e=>Fs(e)&&Ns(e)==="lyric",hV=["","-","_","..."],dV=["a","e","i","o","u","h"],fV=({measureChild:e,timeElapsed:t,currentDivisions:n,currentTempo:l,partIdx:g,partName:b,measureIdx:a})=>{const r=[];if(Rx(e)){const h=Wn(e,"divisions"),s=Fr(h);s&&(console.info(`Found new divisions ${s}`),n=parseInt(s,10),r.push({time:t,partIdx:g,partName:b,measureIdx:a,tempo:l,divisions:n}))}else if(Ix(e)){console.info("Looking for tempo changes in measure direction");const h=so(e,"sound"),s=Ct.compact(Ct.map(h,m=>{const c=Mb(m,"tempo");return c?parseFloat(c):null}));s.length>0&&(console.info(`Found new tempo ${Ct.last(s)}`),l=Ct.last(s),r.push({time:t,partIdx:g,partName:b,measureIdx:a,tempo:l,divisions:n}))}return{newTempoEvents:r,newTempo:l,newDivisions:n}},pV=e=>{var m,c,o;const t=e[1],n=Wn(t,"part-list");if(!n)throw new Error("Could not find part-list");const l=Ct.compact(Ct.map(so(n,"score-part"),u=>{const d=Wn(u,"part-name");return d?Fr(d):void 0})),g=so(t,"part"),b=Ct.map(g,u=>so(u,"measure")),a=[],r=[],h=[],s=Math.max(...Ct.map(b,u=>u.length));for(let u=0;u{const S=(p?Ro(p):[])[u];if(S&&Fs(S)){const T=so(S,"sound");return Ct.some(T,P=>Mb(P,"tempo"))}return!1}),x=Ct.sortBy(Ct.times(l.length),p=>d[p]?0:1);for(const p of x){const v=l[p],S=(m=b[p])==null?void 0:m[u],T=Ro(S),P=Math.max(...Ct.compact(Ct.map(Ct.filter(r,V=>V.partIdx===p&&V.measureIdxNumber(V??0)+Number(U??0))),0),_={};let E=((c=Ct.findLast(a,V=>V.measureIdx<=u&&!isNaN(Number(V.tempo))))==null?void 0:c.divisions)??1,M=1,N=((o=Ct.findLast(a,V=>V.measureIdx<=u&&!isNaN(Number(V.tempo))))==null?void 0:o.tempo)??tV;const I={};let R=1;Ct.forEach(T,(V,U)=>{var W,G,X,L,H,ne;const K=Wn(V,"voice"),k=Fr(K);if(k&&(M=parseInt(k,10)),Rx(V)||Ix(V)){const ie=((W=_==null?void 0:_[p])==null?void 0:W[M])??P,{newTempoEvents:be,newTempo:ae,newDivisions:ge}=fV({measureChild:V,timeElapsed:ie,currentDivisions:E,currentTempo:N,partIdx:p,partName:v,measureIdx:u});a.push(...be),N=ae,E=ge}else{if(Wn(V,"chord"))R+=1;else{R=1;const ge=((G=_==null?void 0:_[p])==null?void 0:G[M])??P,ce=((X=I==null?void 0:I[p])==null?void 0:X[M])??0;_[p]=(_==null?void 0:_[p])||{},_[p][M]=ge+ce,I[p]=(I==null?void 0:I[p])||{},I[p][M]=0}const be=Wn(V,"duration"),ae=Fr(be);if(!bp(V)||Wn(V,"rest")){console.log("Not a note / is a rest",{measureChild:V,measureChildIdx:U});const ge=Wn(V,"duration");if(ge){if(!ae)throw new Error(`No duration text content: ${JSON.stringify(ge)}`);const ce=Ns(V)==="backup",ee=parseFloat(ae)*(ce?-1:1),ye=I4(ee,E,N),Ee=((L=_==null?void 0:_[p])==null?void 0:L[M])??P;r.push({time:Ee,partIdx:p,partName:v,measureIdx:u,voice:M,chordLevel:R,eventSeconds:ye,isRest:!0}),_[p]=(_==null?void 0:_[p])||{},_[p][M]=Ee+ye}}else{if(!bp(V))throw new Error(`Unexpected measure child: ${JSON.stringify(V)}`);const ge=Ct.findLastIndex(h,me=>!me.continuesPrevious&&me.partIdx===p&&me.voice===u),ce=ge!==-1,ee=ce?-1:Ct.findLastIndex(h,me=>!me.continuesPrevious&&me.partIdx===p),Ee=ce?Ct.filter(Ct.slice(h,ge!==-1?ge:ee),me=>me.partIdx===p&&me.voice===M):ee!==-1?Ct.filter(Ct.slice(h,ee),me=>me.partIdx===p):[],j=Ct.reduce(Ee,(me,_e)=>(me+(_e.continuesPrevious?"":" ")+_e.lyric).trim(),"");let te="";const re=((H=_==null?void 0:_[p])==null?void 0:H[M])??P;Ct.forEach(Ro(V),me=>{var qe;if(!cV(me))return;const _e=Wn(me,"text");if(!_e){console.log("No text in the lyric",{lyricEl:me});return}const Me=((qe=Fr(_e))==null?void 0:qe.trim())??"";if(!Me||hV.includes(Me)){console.log("Lyrics continues previous",{lyricEl:me,newTextString:Me});return}if(!j){te+=Me,console.log("First lyric",{lyricEl:me,newTextString:Me,newLyricText:te}),h.push({time:re,partIdx:p,partName:v,measureIdx:u,voice:M,chordLevel:R,lyric:Me,continuesPrevious:!1});return}const Ue=Wn(me,"syllabic"),Ge=Fr(Ue);if(!Ge||Ge==="single"||Ge==="begin"||!Ct.includes(dV,Me[0])){te+=` ${Me}`,console.log("Adding new syllable",{lyricEl:me,newTextString:Me,newLyricText:te}),h.push({time:re,partIdx:p,partName:v,measureIdx:u,voice:M,chordLevel:R,lyric:Me,continuesPrevious:!1});return}const Qe=Ct.last(j);let Re=Me.length;for(let Ke=0;Ke{const n={lyrics:"",events:[]},l=Ct.filter(t,b=>b.partIdx===e.partIdx&&b.voice===e.voice&&b.chordLevel===e.chordLvl);n.lyrics=Ct.map(l,b=>b.lyrics??"").join("").trim(),n.events=Ct.flatMap(l,(b,a)=>{const{time:r,frequency:h,lyricsChanged:s,isStaccato:m,eventSeconds:c,isRest:o}=b,u=[];return o?(u.push(ta({eventType:To.NoteOff,time:r})),u.push(ta({eventType:To.Empty,time:r}))):(s&&(console.log("Found new lyrics"),u.push(ta({eventType:To.NoteOff,time:r}))),u.push(ta({eventType:To.SetTargetFrequency,time:r,frequency:h})),s&&(u.push(ta({eventType:To.NoteOn,time:r})),m&&(u.push(ta({eventType:To.SetPhonemeSpeed,time:r,phonemeSpeed:1.5})),u.push(ta({eventType:To.SetPhonemeSpeed,time:r+(c??0),phonemeSpeed:1}))))),console.log({noteEvent:b,noteEventIdx:a,newEvents:u}),u});const g=Ct.last(l);return g&&(g.isRest||n.events.push(ta({eventType:To.NoteOff,time:g.time+(g.eventSeconds??0)}))),n},gV=e=>{const t=e[1],n=sV(t),l=Ct.flatMap(n,b=>Ct.flatMap(b.voices,(a,r)=>Ct.times(b.largestChordPerVoice[r],h=>({partIdx:b.partIdx,partName:b.partName,voice:a,chordLvl:h+1,largestChordLvl:b.largestChordPerVoice[r]})))),g=pV(e);return Ct.map(l,b=>({...g,splitParams:b,output:mV({splitParams:b,...g})}))},bV=Rt("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1}),yV=({isLoadingVoice:e,generateVoiceFromOddVoiceJson:t,setIsGeneratingAudio:n,setOddVoiceOutputs:l,setAudioOutputs:g,setRawFile:b})=>{const[,a]=Qn.useTransition();return Be.jsxs(JE,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:Be.jsx(_x,{}),disabled:e,children:["Upload file",Be.jsx(bV,{type:"file",onChange:r=>{var m,c;const h=(c=(m=r==null?void 0:r.target)==null?void 0:m.files)==null?void 0:c[0];if(!h)return;const s=new FileReader;s.onload=o=>{var u;if((u=o==null?void 0:o.target)!=null&&u.result){n(!0);const d=o.target.result;a(()=>{const x=gV(eV(d));l(x),b(d),Ct.forEach(x,(p,v)=>{const S=t(p.output);if(!S||S.length===0){console.error("Failed to generate audio output.");return}g(T=>{const P=[...T];return P[v]=S,P})}),n(!1)})}},s.readAsText(h)}})]})};function vV(){const[e,t]=Qn.useState(""),[n,l]=Qn.useState([]),[g,b]=Qn.useState([]);n.length>0&&console.log({oddVoiceOutputs:n});const{isLoadingApp:a,isLoadingVoice:r,voiceLoadingFailed:h,generateVoiceFromOddVoiceJson:s}=wB(),[m,c]=Qn.useState(!1);return Be.jsxs(pp,{children:[Be.jsxs(KE,{variant:"outlined",sx:{top:0,position:"sticky",zIndex:1,backgroundColor:o=>o.palette.background.paper},children:[Be.jsx(QE,{disabled:!e,expandIcon:e?Be.jsx(yb,{}):null,children:Be.jsx(di,{variant:"body1",textAlign:"center",width:"100%",children:a?Be.jsxs(Be.Fragment,{children:[Be.jsx(mf,{}),"Loading app..."]}):h?Be.jsxs(Be.Fragment,{children:[Be.jsx(yx,{}),"Error loading voice!"]}):m?Be.jsxs(Be.Fragment,{children:[Be.jsx(mf,{size:16})," Generating audio..."]}):r?Be.jsxs(Be.Fragment,{children:[Be.jsx(mf,{size:16})," Loading voice..."]}):e?"View MusicXML":"Upload a MusicXML file to view it here."})}),Be.jsx(qE,{sx:{overflow:"auto",height:300},children:Be.jsx(vB,{autoResize:!0,file:e})})]}),a?Be.jsx(mf,{}):Be.jsxs(Be.Fragment,{children:[Be.jsx(pi,{item:!0,sx:{top:50,position:"sticky",zIndex:1},children:Be.jsxs(pp,{elevation:0,sx:{display:"flex",border:o=>`1px solid ${o.palette.divider}`,flexWrap:"wrap"},children:[Be.jsx(yV,{isLoadingVoice:r,setIsGeneratingAudio:c,setOddVoiceOutputs:l,setAudioOutputs:b,setRawFile:t,generateVoiceFromOddVoiceJson:s}),g.length>0&&Be.jsx(NB,{})]})}),Be.jsx(zg,{}),!m&&Be.jsx(pi,{container:!0,direction:"column",gap:3,alignItems:"center",paddingBlock:2,children:Be.jsxs(pi,{item:!0,container:!0,direction:"column",gap:3,alignItems:"center",alignSelf:"center",children:[Ct.map(n,(o,u)=>{const d=`${o.splitParams.partName}_(voice_${o.splitParams.voice})${o.splitParams.largestChordLvl>1?`_chord-level_${o.splitParams.chordLvl}-${o.splitParams.largestChordLvl}`:""}`;return Be.jsxs(pi,{item:!0,container:!0,direction:"column",children:[Be.jsx(pi,{item:!0,children:Be.jsxs(di,{variant:"h6",children:["Part ",u+1]})}),Be.jsx(pi,{item:!0,children:Be.jsxs(di,{variant:"body1",children:[o.splitParams.partName," (voice"," ",o.splitParams.voice,")",o.splitParams.largestChordLvl>1?` - chord level ${o.splitParams.chordLvl}/${o.splitParams.largestChordLvl}`:""]})}),Be.jsx(pi,{item:!0,children:Be.jsx("audio",{controls:!0,src:g[u]?"data:audio/wav;base64,"+SB(g[u]):void 0})}),Be.jsx(pi,{item:!0,children:Be.jsx("a",{className:"audio-download",href:URL.createObjectURL(new Blob([g[u]],{type:"audio/wav"})),download:d+".wav",children:"Download Audio (wav)"})}),Be.jsx(pi,{item:!0,children:Be.jsx("a",{className:"part-downloads",href:`data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(o.output,null,2))}`,download:d+".json",children:"Download JSON"})})]},u)}),Be.jsx(zg,{})]})}),Be.jsx(pi,{item:!0,children:n.length>0&&Be.jsx(JE,{onClick:()=>{document.querySelectorAll("a.part-downloads").forEach(u=>{u.click()})},children:"Download All JSON Files"})}),Be.jsx(pi,{container:!0,direction:"column",gap:3,alignItems:"center",paddingBlock:2,children:Be.jsx(bB,{})})]})]})}const SV=new mT;G0.createRoot(document.getElementById("root")).render(Be.jsx(Qn.StrictMode,{children:Be.jsx(ST,{client:SV,children:Be.jsx(vV,{})})})); diff --git a/musicxml-singer-with-oddvoices/dist/assets/index-rEEADXRV.js b/musicxml-singer-with-oddvoices/dist/assets/index-rEEADXRV.js new file mode 100644 index 0000000..8e907da --- /dev/null +++ b/musicxml-singer-with-oddvoices/dist/assets/index-rEEADXRV.js @@ -0,0 +1,289 @@ +var aP=Object.defineProperty;var lP=(e,t,n)=>t in e?aP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L0=(e,t,n)=>(lP(e,typeof t!="symbol"?t+"":t,n),n),A0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Xe=(e,t,n)=>(A0(e,t,"read from private field"),n?n.call(e):t.get(e)),Vt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rt=(e,t,n,s)=>(A0(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);var Mf=(e,t,n,s)=>({set _(m){Rt(e,t,m,n)},get _(){return Xe(e,t,s)}}),un=(e,t,n)=>(A0(e,t,"access private method"),n);function uP(e,t){for(var n=0;ns[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))s(m);new MutationObserver(m=>{for(const b of m)if(b.type==="childList")for(const o of b.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(m){const b={};return m.integrity&&(b.integrity=m.integrity),m.referrerPolicy&&(b.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?b.credentials="include":m.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function s(m){if(m.ep)return;m.ep=!0;const b=n(m);fetch(m.href,b)}})();var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function D2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var m=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,m.get?m:{enumerable:!0,get:function(){return e[s]}})}),n}var o5={exports:{}},r1={},a5={exports:{}},dn={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Td=Symbol.for("react.element"),hP=Symbol.for("react.portal"),dP=Symbol.for("react.fragment"),fP=Symbol.for("react.strict_mode"),pP=Symbol.for("react.profiler"),mP=Symbol.for("react.provider"),gP=Symbol.for("react.context"),bP=Symbol.for("react.forward_ref"),yP=Symbol.for("react.suspense"),vP=Symbol.for("react.memo"),SP=Symbol.for("react.lazy"),fv=Symbol.iterator;function EP(e){return e===null||typeof e!="object"?null:(e=fv&&e[fv]||e["@@iterator"],typeof e=="function"?e:null)}var l5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},u5=Object.assign,c5={};function xc(e,t,n){this.props=e,this.context=t,this.refs=c5,this.updater=n||l5}xc.prototype.isReactComponent={};xc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};xc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function h5(){}h5.prototype=xc.prototype;function V2(e,t,n){this.props=e,this.context=t,this.refs=c5,this.updater=n||l5}var G2=V2.prototype=new h5;G2.constructor=V2;u5(G2,xc.prototype);G2.isPureReactComponent=!0;var pv=Array.isArray,d5=Object.prototype.hasOwnProperty,W2={current:null},f5={key:!0,ref:!0,__self:!0,__source:!0};function p5(e,t,n){var s,m={},b=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(b=""+t.key),t)d5.call(t,s)&&!f5.hasOwnProperty(s)&&(m[s]=t[s]);var r=arguments.length-2;if(r===1)m.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oc=typeof window>"u"||"Deno"in window;function ps(){}function IP(e,t){return typeof e=="function"?e(t):e}function bg(e){return typeof e=="number"&&e>=0&&e!==1/0}function g5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gv(e,t){const{type:n="all",exact:s,fetchStatus:m,predicate:b,queryKey:o,stale:r}=e;if(o){if(s){if(t.queryHash!==U2(o,t.options))return!1}else if(!Wh(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof r=="boolean"&&t.isStale()!==r||typeof m<"u"&&m!==t.state.fetchStatus||b&&!b(t))}function bv(e,t){const{exact:n,status:s,predicate:m,mutationKey:b}=e;if(b){if(!t.options.mutationKey)return!1;if(n){if(Gh(t.options.mutationKey)!==Gh(b))return!1}else if(!Wh(t.options.mutationKey,b))return!1}return!(s&&t.state.status!==s||m&&!m(t))}function U2(e,t){return((t==null?void 0:t.queryKeyHashFn)||Gh)(e)}function Gh(e){return JSON.stringify(e,(t,n)=>vg(n)?Object.keys(n).sort().reduce((s,m)=>(s[m]=n[m],s),{}):n)}function Wh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Wh(e[n],t[n])):!1}function b5(e,t){if(e===t)return e;const n=yv(e)&&yv(t);if(n||vg(e)&&vg(t)){const s=n?e:Object.keys(e),m=s.length,b=n?t:Object.keys(t),o=b.length,r=n?[]:{};let u=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!vv(n)||!n.hasOwnProperty("isPrototypeOf"))}function vv(e){return Object.prototype.toString.call(e)==="[object Object]"}function NP(e){return new Promise(t=>{setTimeout(t,e)})}function Sg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?b5(e,t):t}function kP(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function OP(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var xl,Ma,ju,QS,FP=(QS=class extends Pd{constructor(){super();Vt(this,xl,void 0);Vt(this,Ma,void 0);Vt(this,ju,void 0);Rt(this,ju,t=>{if(!oc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Xe(this,Ma)||this.setEventListener(Xe(this,ju))}onUnsubscribe(){var t;this.hasListeners()||((t=Xe(this,Ma))==null||t.call(this),Rt(this,Ma,void 0))}setEventListener(t){var n;Rt(this,ju,t),(n=Xe(this,Ma))==null||n.call(this),Rt(this,Ma,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){Xe(this,xl)!==t&&(Rt(this,xl,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Xe(this,xl)=="boolean"?Xe(this,xl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xl=new WeakMap,Ma=new WeakMap,ju=new WeakMap,QS),Ep=new FP,Hu,Ca,Xu,JS,BP=(JS=class extends Pd{constructor(){super();Vt(this,Hu,!0);Vt(this,Ca,void 0);Vt(this,Xu,void 0);Rt(this,Xu,t=>{if(!oc&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){Xe(this,Ca)||this.setEventListener(Xe(this,Xu))}onUnsubscribe(){var t;this.hasListeners()||((t=Xe(this,Ca))==null||t.call(this),Rt(this,Ca,void 0))}setEventListener(t){var n;Rt(this,Xu,t),(n=Xe(this,Ca))==null||n.call(this),Rt(this,Ca,t(this.setOnline.bind(this)))}setOnline(t){Xe(this,Hu)!==t&&(Rt(this,Hu,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return Xe(this,Hu)}},Hu=new WeakMap,Ca=new WeakMap,Xu=new WeakMap,JS),xp=new BP;function DP(e){return Math.min(1e3*2**e,3e4)}function s1(e){return(e??"online")==="online"?xp.isOnline():!0}var y5=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function I0(e){return e instanceof y5}function v5(e){let t=!1,n=0,s=!1,m,b,o;const r=new Promise((f,y)=>{b=f,o=y}),u=f=>{var y;s||(h(new y5(f)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},g=()=>{t=!1},c=()=>!Ep.isFocused()||e.networkMode!=="always"&&!xp.isOnline(),l=f=>{var y;s||(s=!0,(y=e.onSuccess)==null||y.call(e,f),m==null||m(),b(f))},h=f=>{var y;s||(s=!0,(y=e.onError)==null||y.call(e,f),m==null||m(),o(f))},d=()=>new Promise(f=>{var y;m=S=>{const _=s||!c();return _&&f(S),_},(y=e.onPause)==null||y.call(e)}).then(()=>{var f;m=void 0,s||(f=e.onContinue)==null||f.call(e)}),E=()=>{if(s)return;let f;try{f=e.fn()}catch(y){f=Promise.reject(y)}Promise.resolve(f).then(l).catch(y=>{var x;if(s)return;const S=e.retry??(oc?0:3),_=e.retryDelay??DP,P=typeof _=="function"?_(n,y):_,w=S===!0||typeof S=="number"&&n{if(c())return d()}).then(()=>{t?h(y):E()})})};return s1(e.networkMode)?E():d().then(E),{promise:r,cancel:u,continue:()=>(m==null?void 0:m())?r:Promise.resolve(),cancelRetry:a,continueRetry:g}}function VP(){let e=[],t=0,n=l=>{l()},s=l=>{l()},m=l=>setTimeout(l,0);const b=l=>{m=l},o=l=>{let h;t++;try{h=l()}finally{t--,t||a()}return h},r=l=>{t?e.push(l):m(()=>{n(l)})},u=l=>(...h)=>{r(()=>{l(...h)})},a=()=>{const l=e;e=[],l.length&&m(()=>{s(()=>{l.forEach(h=>{n(h)})})})};return{batch:o,batchCalls:u,schedule:r,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:b}}var Ui=VP(),wl,ZS,S5=(ZS=class{constructor(){Vt(this,wl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bg(this.gcTime)&&Rt(this,wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(oc?1/0:5*60*1e3))}clearGcTimeout(){Xe(this,wl)&&(clearTimeout(Xe(this,wl)),Rt(this,wl,void 0))}},wl=new WeakMap,ZS),Yu,Ku,hs,La,ds,ki,fd,_l,qu,rp,zs,zo,e5,GP=(e5=class extends S5{constructor(t){super();Vt(this,qu);Vt(this,zs);Vt(this,Yu,void 0);Vt(this,Ku,void 0);Vt(this,hs,void 0);Vt(this,La,void 0);Vt(this,ds,void 0);Vt(this,ki,void 0);Vt(this,fd,void 0);Vt(this,_l,void 0);Rt(this,_l,!1),Rt(this,fd,t.defaultOptions),un(this,qu,rp).call(this,t.options),Rt(this,ki,[]),Rt(this,hs,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Rt(this,Yu,t.state||WP(this.options)),this.state=Xe(this,Yu),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Xe(this,ki).length&&this.state.fetchStatus==="idle"&&Xe(this,hs).remove(this)}setData(t,n){const s=Sg(this.state.data,t,this.options);return un(this,zs,zo).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t,n){un(this,zs,zo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var s;const n=Xe(this,La);return(s=Xe(this,ds))==null||s.cancel(t),n?n.then(ps).catch(ps):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Xe(this,Yu))}isActive(){return Xe(this,ki).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Xe(this,ki).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!g5(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Xe(this,ki).find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Xe(this,ds))==null||n.continue()}onOnline(){var n;const t=Xe(this,ki).find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Xe(this,ds))==null||n.continue()}addObserver(t){Xe(this,ki).includes(t)||(Xe(this,ki).push(t),this.clearGcTimeout(),Xe(this,hs).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Xe(this,ki).includes(t)&&(Rt(this,ki,Xe(this,ki).filter(n=>n!==t)),Xe(this,ki).length||(Xe(this,ds)&&(Xe(this,_l)?Xe(this,ds).cancel({revert:!0}):Xe(this,ds).cancelRetry()),this.scheduleGc()),Xe(this,hs).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Xe(this,ki).length}invalidate(){this.state.isInvalidated||un(this,zs,zo).call(this,{type:"invalidate"})}fetch(t,n){var a,g,c,l;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Xe(this,La))return(a=Xe(this,ds))==null||a.continueRetry(),Xe(this,La)}if(t&&un(this,qu,rp).call(this,t),!this.options.queryFn){const h=Xe(this,ki).find(d=>d.options.queryFn);h&&un(this,qu,rp).call(this,h.options)}const s=new AbortController,m={queryKey:this.queryKey,meta:this.meta},b=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Rt(this,_l,!0),s.signal)})};b(m);const o=()=>this.options.queryFn?(Rt(this,_l,!1),this.options.persister?this.options.persister(this.options.queryFn,m,this):this.options.queryFn(m)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),r={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};b(r),(g=this.options.behavior)==null||g.onFetch(r,this),Rt(this,Ku,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=r.fetchOptions)==null?void 0:c.meta))&&un(this,zs,zo).call(this,{type:"fetch",meta:(l=r.fetchOptions)==null?void 0:l.meta});const u=h=>{var d,E,f,y;I0(h)&&h.silent||un(this,zs,zo).call(this,{type:"error",error:h}),I0(h)||((E=(d=Xe(this,hs).config).onError)==null||E.call(d,h,this),(y=(f=Xe(this,hs).config).onSettled)==null||y.call(f,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Rt(this,ds,v5({fn:r.fetchFn,abort:s.abort.bind(s),onSuccess:h=>{var d,E,f,y;if(typeof h>"u"){u(new Error(`${this.queryHash} data is undefined`));return}this.setData(h),(E=(d=Xe(this,hs).config).onSuccess)==null||E.call(d,h,this),(y=(f=Xe(this,hs).config).onSettled)==null||y.call(f,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:u,onFail:(h,d)=>{un(this,zs,zo).call(this,{type:"failed",failureCount:h,error:d})},onPause:()=>{un(this,zs,zo).call(this,{type:"pause"})},onContinue:()=>{un(this,zs,zo).call(this,{type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode})),Rt(this,La,Xe(this,ds).promise),Xe(this,La)}},Yu=new WeakMap,Ku=new WeakMap,hs=new WeakMap,La=new WeakMap,ds=new WeakMap,ki=new WeakMap,fd=new WeakMap,_l=new WeakMap,qu=new WeakSet,rp=function(t){this.options={...Xe(this,fd),...t},this.updateGcTime(this.options.gcTime)},zs=new WeakSet,zo=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:s1(this.options.networkMode)?"fetching":"paused",...!s.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const m=t.error;return I0(m)&&m.revert&&Xe(this,Ku)?{...Xe(this,Ku),fetchStatus:"idle"}:{...s,error:m,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:m,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),Ui.batch(()=>{Xe(this,ki).forEach(s=>{s.onQueryUpdate()}),Xe(this,hs).notify({query:this,type:"updated",action:t})})},e5);function WP(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ho,t5,zP=(t5=class extends Pd{constructor(t={}){super();Vt(this,ho,void 0);this.config=t,Rt(this,ho,new Map)}build(t,n,s){const m=n.queryKey,b=n.queryHash??U2(m,n);let o=this.get(b);return o||(o=new GP({cache:this,queryKey:m,queryHash:b,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(m)}),this.add(o)),o}add(t){Xe(this,ho).has(t.queryHash)||(Xe(this,ho).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Xe(this,ho).get(t.queryHash);n&&(t.destroy(),n===t&&Xe(this,ho).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ui.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Xe(this,ho).get(t)}getAll(){return[...Xe(this,ho).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>gv(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>gv(t,s)):n}notify(t){Ui.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ui.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ui.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ho=new WeakMap,t5),fo,pd,jr,Qu,po,Ea,n5,UP=(n5=class extends S5{constructor(t){super();Vt(this,po);Vt(this,fo,void 0);Vt(this,pd,void 0);Vt(this,jr,void 0);Vt(this,Qu,void 0);this.mutationId=t.mutationId,Rt(this,pd,t.defaultOptions),Rt(this,jr,t.mutationCache),Rt(this,fo,[]),this.state=t.state||$P(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Xe(this,pd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Xe(this,fo).includes(t)||(Xe(this,fo).push(t),this.clearGcTimeout(),Xe(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Rt(this,fo,Xe(this,fo).filter(n=>n!==t)),this.scheduleGc(),Xe(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Xe(this,fo).length||(this.state.status==="pending"?this.scheduleGc():Xe(this,jr).remove(this))}continue(){var t;return((t=Xe(this,Qu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var m,b,o,r,u,a,g,c,l,h,d,E,f,y,S,_,P,w,x,M;const n=()=>(Rt(this,Qu,v5({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(N,R)=>{un(this,po,Ea).call(this,{type:"failed",failureCount:N,error:R})},onPause:()=>{un(this,po,Ea).call(this,{type:"pause"})},onContinue:()=>{un(this,po,Ea).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Xe(this,Qu).promise),s=this.state.status==="pending";try{if(!s){un(this,po,Ea).call(this,{type:"pending",variables:t}),await((b=(m=Xe(this,jr).config).onMutate)==null?void 0:b.call(m,t,this));const R=await((r=(o=this.options).onMutate)==null?void 0:r.call(o,t));R!==this.state.context&&un(this,po,Ea).call(this,{type:"pending",context:R,variables:t})}const N=await n();return await((a=(u=Xe(this,jr).config).onSuccess)==null?void 0:a.call(u,N,t,this.state.context,this)),await((c=(g=this.options).onSuccess)==null?void 0:c.call(g,N,t,this.state.context)),await((h=(l=Xe(this,jr).config).onSettled)==null?void 0:h.call(l,N,null,this.state.variables,this.state.context,this)),await((E=(d=this.options).onSettled)==null?void 0:E.call(d,N,null,t,this.state.context)),un(this,po,Ea).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(f=Xe(this,jr).config).onError)==null?void 0:y.call(f,N,t,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,N,t,this.state.context)),await((w=(P=Xe(this,jr).config).onSettled)==null?void 0:w.call(P,void 0,N,this.state.variables,this.state.context,this)),await((M=(x=this.options).onSettled)==null?void 0:M.call(x,void 0,N,t,this.state.context)),N}finally{un(this,po,Ea).call(this,{type:"error",error:N})}}}},fo=new WeakMap,pd=new WeakMap,jr=new WeakMap,Qu=new WeakMap,po=new WeakSet,Ea=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!s1(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ui.batch(()=>{Xe(this,fo).forEach(s=>{s.onMutationUpdate(t)}),Xe(this,jr).notify({mutation:this,type:"updated",action:t})})},n5);function $P(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fs,md,Tl,i5,jP=(i5=class extends Pd{constructor(t={}){super();Vt(this,fs,void 0);Vt(this,md,void 0);Vt(this,Tl,void 0);this.config=t,Rt(this,fs,[]),Rt(this,md,0)}build(t,n,s){const m=new UP({mutationCache:this,mutationId:++Mf(this,md)._,options:t.defaultMutationOptions(n),state:s});return this.add(m),m}add(t){Xe(this,fs).push(t),this.notify({type:"added",mutation:t})}remove(t){Rt(this,fs,Xe(this,fs).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Ui.batch(()=>{Xe(this,fs).forEach(t=>{this.remove(t)})})}getAll(){return Xe(this,fs)}find(t){const n={exact:!0,...t};return Xe(this,fs).find(s=>bv(n,s))}findAll(t={}){return Xe(this,fs).filter(n=>bv(t,n))}notify(t){Ui.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Rt(this,Tl,(Xe(this,Tl)??Promise.resolve()).then(()=>{const t=Xe(this,fs).filter(n=>n.state.isPaused);return Ui.batch(()=>t.reduce((n,s)=>n.then(()=>s.continue().catch(ps)),Promise.resolve()))}).then(()=>{Rt(this,Tl,void 0)})),Xe(this,Tl)}},fs=new WeakMap,md=new WeakMap,Tl=new WeakMap,i5);function HP(e){return{onFetch:(t,n)=>{const s=async()=>{var d,E,f,y,S;const m=t.options,b=(f=(E=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:E.fetchMore)==null?void 0:f.direction,o=((y=t.state.data)==null?void 0:y.pages)||[],r=((S=t.state.data)==null?void 0:S.pageParams)||[],u={pages:[],pageParams:[]};let a=!1;const g=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?a=!0:t.signal.addEventListener("abort",()=>{a=!0}),t.signal)})},c=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),l=async(_,P,w)=>{if(a)return Promise.reject();if(P==null&&_.pages.length)return Promise.resolve(_);const x={queryKey:t.queryKey,pageParam:P,direction:w?"backward":"forward",meta:t.options.meta};g(x);const M=await c(x),{maxPages:N}=t.options,R=w?OP:kP;return{pages:R(_.pages,M,N),pageParams:R(_.pageParams,P,N)}};let h;if(b&&o.length){const _=b==="backward",P=_?XP:Sv,w={pages:o,pageParams:r},x=P(m,w);h=await l(w,x,_)}else{h=await l(u,r[0]??m.initialPageParam);const _=e??o.length;for(let P=1;P<_;P++){const w=Sv(m,h);h=await l(h,w)}}return h};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,s,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=s}}}function Sv(e,{pages:t,pageParams:n}){const s=t.length-1;return e.getNextPageParam(t[s],t,n[s],n)}function XP(e,{pages:t,pageParams:n}){var s;return(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n)}var Pi,Aa,Ra,Ju,Zu,Ia,ec,tc,r5,YP=(r5=class{constructor(e={}){Vt(this,Pi,void 0);Vt(this,Aa,void 0);Vt(this,Ra,void 0);Vt(this,Ju,void 0);Vt(this,Zu,void 0);Vt(this,Ia,void 0);Vt(this,ec,void 0);Vt(this,tc,void 0);Rt(this,Pi,e.queryCache||new zP),Rt(this,Aa,e.mutationCache||new jP),Rt(this,Ra,e.defaultOptions||{}),Rt(this,Ju,new Map),Rt(this,Zu,new Map),Rt(this,Ia,0)}mount(){Mf(this,Ia)._++,Xe(this,Ia)===1&&(Rt(this,ec,Ep.subscribe(()=>{Ep.isFocused()&&(this.resumePausedMutations(),Xe(this,Pi).onFocus())})),Rt(this,tc,xp.subscribe(()=>{xp.isOnline()&&(this.resumePausedMutations(),Xe(this,Pi).onOnline())})))}unmount(){var e,t;Mf(this,Ia)._--,Xe(this,Ia)===0&&((e=Xe(this,ec))==null||e.call(this),Rt(this,ec,void 0),(t=Xe(this,tc))==null||t.call(this),Rt(this,tc,void 0))}isFetching(e){return Xe(this,Pi).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Xe(this,Aa).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Xe(this,Pi).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=Xe(this,Pi).find({queryKey:e}),m=s==null?void 0:s.state.data,b=IP(t,m);if(typeof b>"u")return;const o=this.defaultQueryOptions({queryKey:e});return Xe(this,Pi).build(this,o).setData(b,{...n,manual:!0})}setQueriesData(e,t,n){return Ui.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var t;return(t=Xe(this,Pi).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Xe(this,Pi);Ui.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Xe(this,Pi),s={type:"active",...e};return Ui.batch(()=>(n.findAll(e).forEach(m=>{m.reset()}),this.refetchQueries(s,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},s=Ui.batch(()=>Xe(this,Pi).findAll(e).map(m=>m.cancel(n)));return Promise.all(s).then(ps).catch(ps)}invalidateQueries(e={},t={}){return Ui.batch(()=>{if(Xe(this,Pi).findAll(e).forEach(s=>{s.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},s=Ui.batch(()=>Xe(this,Pi).findAll(e).filter(m=>!m.isDisabled()).map(m=>{let b=m.fetch(void 0,n);return n.throwOnError||(b=b.catch(ps)),m.state.fetchStatus==="paused"?Promise.resolve():b}));return Promise.all(s).then(ps)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Xe(this,Pi).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ps).catch(ps)}fetchInfiniteQuery(e){return e.behavior=HP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ps).catch(ps)}resumePausedMutations(){return Xe(this,Aa).resumePausedMutations()}getQueryCache(){return Xe(this,Pi)}getMutationCache(){return Xe(this,Aa)}getDefaultOptions(){return Xe(this,Ra)}setDefaultOptions(e){Rt(this,Ra,e)}setQueryDefaults(e,t){Xe(this,Ju).set(Gh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Xe(this,Ju).values()];let n={};return t.forEach(s=>{Wh(e,s.queryKey)&&(n={...n,...s.defaultOptions})}),n}setMutationDefaults(e,t){Xe(this,Zu).set(Gh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Xe(this,Zu).values()];let n={};return t.forEach(s=>{Wh(e,s.mutationKey)&&(n={...n,...s.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Xe(this,Ra).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=U2(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Xe(this,Ra).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Xe(this,Pi).clear(),Xe(this,Aa).clear()}},Pi=new WeakMap,Aa=new WeakMap,Ra=new WeakMap,Ju=new WeakMap,Zu=new WeakMap,Ia=new WeakMap,ec=new WeakMap,tc=new WeakMap,r5),Cr,qn,gd,or,Pl,nc,mo,bd,ic,rc,Ml,Cl,Na,sc,Ll,vh,yd,Eg,vd,xg,Sd,wg,Ed,_g,xd,Tg,wd,Pg,_d,Mg,i1,E5,s5,KP=(s5=class extends Pd{constructor(t,n){super();Vt(this,Ll);Vt(this,yd);Vt(this,vd);Vt(this,Sd);Vt(this,Ed);Vt(this,xd);Vt(this,wd);Vt(this,_d);Vt(this,i1);Vt(this,Cr,void 0);Vt(this,qn,void 0);Vt(this,gd,void 0);Vt(this,or,void 0);Vt(this,Pl,void 0);Vt(this,nc,void 0);Vt(this,mo,void 0);Vt(this,bd,void 0);Vt(this,ic,void 0);Vt(this,rc,void 0);Vt(this,Ml,void 0);Vt(this,Cl,void 0);Vt(this,Na,void 0);Vt(this,sc,new Set);this.options=n,Rt(this,Cr,t),Rt(this,mo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Xe(this,qn).addObserver(this),Ev(Xe(this,qn),this.options)?un(this,Ll,vh).call(this):this.updateResult(),un(this,Ed,_g).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Cg(Xe(this,qn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Cg(Xe(this,qn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,un(this,xd,Tg).call(this),un(this,wd,Pg).call(this),Xe(this,qn).removeObserver(this)}setOptions(t,n){const s=this.options,m=Xe(this,qn);if(this.options=Xe(this,Cr).defaultQueryOptions(t),yg(s,this.options)||Xe(this,Cr).getQueryCache().notify({type:"observerOptionsUpdated",query:Xe(this,qn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),un(this,_d,Mg).call(this);const b=this.hasListeners();b&&xv(Xe(this,qn),m,this.options,s)&&un(this,Ll,vh).call(this),this.updateResult(n),b&&(Xe(this,qn)!==m||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&un(this,yd,Eg).call(this);const o=un(this,vd,xg).call(this);b&&(Xe(this,qn)!==m||this.options.enabled!==s.enabled||o!==Xe(this,Na))&&un(this,Sd,wg).call(this,o)}getOptimisticResult(t){const n=Xe(this,Cr).getQueryCache().build(Xe(this,Cr),t),s=this.createResult(n,t);return QP(this,s)&&(Rt(this,or,s),Rt(this,nc,this.options),Rt(this,Pl,Xe(this,qn).state)),s}getCurrentResult(){return Xe(this,or)}trackResult(t){const n={};return Object.keys(t).forEach(s=>{Object.defineProperty(n,s,{configurable:!1,enumerable:!0,get:()=>(Xe(this,sc).add(s),t[s])})}),n}getCurrentQuery(){return Xe(this,qn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Xe(this,Cr).defaultQueryOptions(t),s=Xe(this,Cr).getQueryCache().build(Xe(this,Cr),n);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,n))}fetch(t){return un(this,Ll,vh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Xe(this,or)))}createResult(t,n){var x;const s=Xe(this,qn),m=this.options,b=Xe(this,or),o=Xe(this,Pl),r=Xe(this,nc),a=t!==s?t.state:Xe(this,gd),{state:g}=t;let{error:c,errorUpdatedAt:l,fetchStatus:h,status:d}=g,E=!1,f;if(n._optimisticResults){const M=this.hasListeners(),N=!M&&Ev(t,n),R=M&&xv(t,s,n,m);(N||R)&&(h=s1(t.options.networkMode)?"fetching":"paused",g.dataUpdatedAt||(d="pending")),n._optimisticResults==="isRestoring"&&(h="idle")}if(n.select&&typeof g.data<"u")if(b&&g.data===(o==null?void 0:o.data)&&n.select===Xe(this,bd))f=Xe(this,ic);else try{Rt(this,bd,n.select),f=n.select(g.data),f=Sg(b==null?void 0:b.data,f,n),Rt(this,ic,f),Rt(this,mo,null)}catch(M){Rt(this,mo,M)}else f=g.data;if(typeof n.placeholderData<"u"&&typeof f>"u"&&d==="pending"){let M;if(b!=null&&b.isPlaceholderData&&n.placeholderData===(r==null?void 0:r.placeholderData))M=b.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((x=Xe(this,rc))==null?void 0:x.state.data,Xe(this,rc)):n.placeholderData,n.select&&typeof M<"u")try{M=n.select(M),Rt(this,mo,null)}catch(N){Rt(this,mo,N)}typeof M<"u"&&(d="success",f=Sg(b==null?void 0:b.data,M,n),E=!0)}Xe(this,mo)&&(c=Xe(this,mo),f=Xe(this,ic),l=Date.now(),d="error");const y=h==="fetching",S=d==="pending",_=d==="error",P=S&&y;return{status:d,fetchStatus:h,isPending:S,isSuccess:d==="success",isError:_,isInitialLoading:P,isLoading:P,data:f,dataUpdatedAt:g.dataUpdatedAt,error:c,errorUpdatedAt:l,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>a.dataUpdateCount||g.errorUpdateCount>a.errorUpdateCount,isFetching:y,isRefetching:y&&!S,isLoadingError:_&&g.dataUpdatedAt===0,isPaused:h==="paused",isPlaceholderData:E,isRefetchError:_&&g.dataUpdatedAt!==0,isStale:$2(t,n),refetch:this.refetch}}updateResult(t){const n=Xe(this,or),s=this.createResult(Xe(this,qn),this.options);if(Rt(this,Pl,Xe(this,qn).state),Rt(this,nc,this.options),Xe(this,Pl).data!==void 0&&Rt(this,rc,Xe(this,qn)),yg(s,n))return;Rt(this,or,s);const m={},b=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,r=typeof o=="function"?o():o;if(r==="all"||!r&&!Xe(this,sc).size)return!0;const u=new Set(r??Xe(this,sc));return this.options.throwOnError&&u.add("error"),Object.keys(Xe(this,or)).some(a=>{const g=a;return Xe(this,or)[g]!==n[g]&&u.has(g)})};(t==null?void 0:t.listeners)!==!1&&b()&&(m.listeners=!0),un(this,i1,E5).call(this,{...m,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&un(this,Ed,_g).call(this)}},Cr=new WeakMap,qn=new WeakMap,gd=new WeakMap,or=new WeakMap,Pl=new WeakMap,nc=new WeakMap,mo=new WeakMap,bd=new WeakMap,ic=new WeakMap,rc=new WeakMap,Ml=new WeakMap,Cl=new WeakMap,Na=new WeakMap,sc=new WeakMap,Ll=new WeakSet,vh=function(t){un(this,_d,Mg).call(this);let n=Xe(this,qn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ps)),n},yd=new WeakSet,Eg=function(){if(un(this,xd,Tg).call(this),oc||Xe(this,or).isStale||!bg(this.options.staleTime))return;const n=g5(Xe(this,or).dataUpdatedAt,this.options.staleTime)+1;Rt(this,Ml,setTimeout(()=>{Xe(this,or).isStale||this.updateResult()},n))},vd=new WeakSet,xg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Xe(this,qn)):this.options.refetchInterval)??!1},Sd=new WeakSet,wg=function(t){un(this,wd,Pg).call(this),Rt(this,Na,t),!(oc||this.options.enabled===!1||!bg(Xe(this,Na))||Xe(this,Na)===0)&&Rt(this,Cl,setInterval(()=>{(this.options.refetchIntervalInBackground||Ep.isFocused())&&un(this,Ll,vh).call(this)},Xe(this,Na)))},Ed=new WeakSet,_g=function(){un(this,yd,Eg).call(this),un(this,Sd,wg).call(this,un(this,vd,xg).call(this))},xd=new WeakSet,Tg=function(){Xe(this,Ml)&&(clearTimeout(Xe(this,Ml)),Rt(this,Ml,void 0))},wd=new WeakSet,Pg=function(){Xe(this,Cl)&&(clearInterval(Xe(this,Cl)),Rt(this,Cl,void 0))},_d=new WeakSet,Mg=function(){const t=Xe(this,Cr).getQueryCache().build(Xe(this,Cr),this.options);if(t===Xe(this,qn))return;const n=Xe(this,qn);Rt(this,qn,t),Rt(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},i1=new WeakSet,E5=function(t){Ui.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Xe(this,or))}),Xe(this,Cr).getQueryCache().notify({query:Xe(this,qn),type:"observerResultsUpdated"})})},s5);function qP(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ev(e,t){return qP(e,t)||e.state.dataUpdatedAt>0&&Cg(e,t,t.refetchOnMount)}function Cg(e,t,n){if(t.enabled!==!1){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&$2(e,t)}return!1}function xv(e,t,n,s){return n.enabled!==!1&&(e!==t||s.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&$2(e,n)}function $2(e,t){return e.isStaleByTime(t.staleTime)}function QP(e,t){return!yg(e.getCurrentResult(),t)}var x5=Pe.createContext(void 0),JP=e=>{const t=Pe.useContext(x5);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ZP=({client:e,children:t})=>(Pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Re.jsx(x5.Provider,{value:e,children:t})),w5=Pe.createContext(!1),eM=()=>Pe.useContext(w5);w5.Provider;function tM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nM=Pe.createContext(tM()),iM=()=>Pe.useContext(nM);function rM(e,t){return typeof e=="function"?e(...t):!!e}var sM=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},oM=e=>{Pe.useEffect(()=>{e.clearReset()},[e])},aM=({result:e,errorResetBoundary:t,throwOnError:n,query:s})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&rM(n,[e.error,s]),lM=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},uM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,cM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function hM(e,t,n){const s=JP(n),m=eM(),b=iM(),o=s.defaultQueryOptions(e);o._optimisticResults=m?"isRestoring":"optimistic",lM(o),sM(o,b),oM(b);const[r]=Pe.useState(()=>new t(s,o)),u=r.getOptimisticResult(o);if(Pe.useSyncExternalStore(Pe.useCallback(a=>{const g=m?()=>{}:r.subscribe(Ui.batchCalls(a));return r.updateResult(),g},[r,m]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),Pe.useEffect(()=>{r.setOptions(o,{listeners:!1})},[o,r]),uM(o,u))throw cM(o,r,b);if(aM({result:u,errorResetBoundary:b,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash)}))throw u.error;return o.notifyOnChangeProps?u:r.trackResult(u)}function dM(e,t){return hM(e,KP,t)}var Lg={},_5={exports:{}},es={},T5={exports:{}},P5={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(L,$){var ie=L.length;L.push($);e:for(;0>>1,be=L[re];if(0>>1;rem(le,ie))Zm(ye,le)?(L[re]=ye,L[Z]=ie,re=Z):(L[re]=le,L[ge]=ie,re=ge);else if(Zm(ye,ie))L[re]=ye,L[Z]=ie,re=Z;else break e}}return $}function m(L,$){var ie=L.sortIndex-$.sortIndex;return ie!==0?ie:L.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var b=performance;e.unstable_now=function(){return b.now()}}else{var o=Date,r=o.now();e.unstable_now=function(){return o.now()-r}}var u=[],a=[],g=1,c=null,l=3,h=!1,d=!1,E=!1,f=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(L){for(var $=n(a);$!==null;){if($.callback===null)s(a);else if($.startTime<=L)s(a),$.sortIndex=$.expirationTime,t(u,$);else break;$=n(a)}}function P(L){if(E=!1,_(L),!d)if(n(u)!==null)d=!0,G(w);else{var $=n(a);$!==null&&H(P,$.startTime-L)}}function w(L,$){d=!1,E&&(E=!1,y(N),N=-1),h=!0;var ie=l;try{for(_($),c=n(u);c!==null&&(!(c.expirationTime>$)||L&&!F());){var re=c.callback;if(typeof re=="function"){c.callback=null,l=c.priorityLevel;var be=re(c.expirationTime<=$);$=e.unstable_now(),typeof be=="function"?c.callback=be:c===n(u)&&s(u),_($)}else s(u);c=n(u)}if(c!==null)var ae=!0;else{var ge=n(a);ge!==null&&H(P,ge.startTime-$),ae=!1}return ae}finally{c=null,l=ie,h=!1}}var x=!1,M=null,N=-1,R=5,A=-1;function F(){return!(e.unstable_now()-AL||125re?(L.sortIndex=ie,t(a,L),n(u)===null&&L===n(a)&&(E?(y(N),N=-1):E=!0,H(P,ie-re))):(L.sortIndex=be,t(u,L),d||h||(d=!0,G(w))),L},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(L){var $=l;return function(){var ie=l;l=$;try{return L.apply(this,arguments)}finally{l=ie}}}})(P5);T5.exports=P5;var fM=T5.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var M5=Pe,Jr=fM;function mt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ag=Object.prototype.hasOwnProperty,pM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,wv={},_v={};function mM(e){return Ag.call(_v,e)?!0:Ag.call(wv,e)?!1:pM.test(e)?_v[e]=!0:(wv[e]=!0,!1)}function gM(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bM(e,t,n,s){if(t===null||typeof t>"u"||gM(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function cr(e,t,n,s,m,b,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=m,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=b,this.removeEmptyString=o}var ji={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ji[e]=new cr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ji[t]=new cr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ji[e]=new cr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ji[e]=new cr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ji[e]=new cr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ji[e]=new cr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ji[e]=new cr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ji[e]=new cr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ji[e]=new cr(e,5,!1,e.toLowerCase(),null,!1,!1)});var j2=/[\-:]([a-z])/g;function H2(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(j2,H2);ji[t]=new cr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(j2,H2);ji[t]=new cr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(j2,H2);ji[t]=new cr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ji[e]=new cr(e,1,!1,e.toLowerCase(),null,!1,!1)});ji.xlinkHref=new cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ji[e]=new cr(e,1,!1,e.toLowerCase(),null,!0,!0)});function X2(e,t,n,s){var m=ji.hasOwnProperty(t)?ji[t]:null;(m!==null?m.type!==0:s||!(2r||m[o]!==b[r]){var u=` +`+m[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=r);break}}}finally{k0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sh(e):""}function yM(e){switch(e.tag){case 5:return Sh(e.type);case 16:return Sh("Lazy");case 13:return Sh("Suspense");case 19:return Sh("SuspenseList");case 0:case 2:case 15:return e=O0(e.type,!1),e;case 11:return e=O0(e.type.render,!1),e;case 1:return e=O0(e.type,!0),e;default:return""}}function kg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case vu:return"Fragment";case yu:return"Portal";case Rg:return"Profiler";case Y2:return"StrictMode";case Ig:return"Suspense";case Ng:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case A5:return(e.displayName||"Context")+".Consumer";case L5:return(e._context.displayName||"Context")+".Provider";case K2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q2:return t=e.displayName||null,t!==null?t:kg(e.type)||"Memo";case xa:t=e._payload,e=e._init;try{return kg(e(t))}catch{}}return null}function vM(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kg(t);case 8:return t===Y2?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ja(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function I5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SM(e){var t=I5(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var m=n.get,b=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(o){s=""+o,b.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Af(e){e._valueTracker||(e._valueTracker=SM(e))}function N5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=I5(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function wp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Og(e,t){var n=t.checked;return ai({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pv(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=ja(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function k5(e,t){t=t.checked,t!=null&&X2(e,"checked",t,!1)}function Fg(e,t){k5(e,t);var n=ja(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bg(e,t.type,ja(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Bg(e,t,n){(t!=="number"||wp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Eh=Array.isArray;function Nu(e,t,n,s){if(e=e.options,t){t={};for(var m=0;m"+t.valueOf().toString()+"",t=Rf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Th={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},EM=["Webkit","ms","Moz","O"];Object.keys(Th).forEach(function(e){EM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Th[t]=Th[e]})});function D5(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Th.hasOwnProperty(e)&&Th[e]?(""+t).trim():t+"px"}function V5(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,m=D5(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,m):e[n]=m}}var xM=ai({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gg(e,t){if(t){if(xM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(mt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(mt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(mt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(mt(62))}}function Wg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zg=null;function Q2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ug=null,ku=null,Ou=null;function Av(e){if(e=Ld(e)){if(typeof Ug!="function")throw Error(mt(280));var t=e.stateNode;t&&(t=c1(t),Ug(e.stateNode,e.type,t))}}function G5(e){ku?Ou?Ou.push(e):Ou=[e]:ku=e}function W5(){if(ku){var e=ku,t=Ou;if(Ou=ku=null,Av(e),t)for(e=0;e>>=0,e===0?32:31-(NM(e)/kM|0)|0}var If=64,Nf=4194304;function xh(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mp(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,m=e.suspendedLanes,b=e.pingedLanes,o=n&268435455;if(o!==0){var r=o&~m;r!==0?s=xh(r):(b&=o,b!==0&&(s=xh(b)))}else o=n&~m,o!==0?s=xh(o):b!==0&&(s=xh(b));if(s===0)return 0;if(t!==0&&t!==s&&!(t&m)&&(m=s&-s,b=t&-t,m>=b||m===16&&(b&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0n;n++)t.push(e);return t}function Md(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-js(t),e[t]=n}function DM(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Mh),Vv=" ",Gv=!1;function aE(e,t){switch(e){case"keyup":return dC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Su=!1;function pC(e,t){switch(e){case"compositionend":return lE(t);case"keypress":return t.which!==32?null:(Gv=!0,Vv);case"textInput":return e=t.data,e===Vv&&Gv?null:e;default:return null}}function mC(e,t){if(Su)return e==="compositionend"||!sb&&aE(e,t)?(e=sE(),op=nb=ka=null,Su=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$v(n)}}function dE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fE(){for(var e=window,t=wp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wp(e.document)}return t}function ob(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function _C(e){var t=fE(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dE(n.ownerDocument.documentElement,n)){if(s!==null&&ob(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var m=n.textContent.length,b=Math.min(s.start,m);s=s.end===void 0?b:Math.min(s.end,m),!e.extend&&b>s&&(m=s,s=b,b=m),m=jv(n,b);var o=jv(n,s);m&&o&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(m.node,m.offset),e.removeAllRanges(),b>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Eu=null,Kg=null,Lh=null,qg=!1;function Hv(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qg||Eu==null||Eu!==wp(s)||(s=Eu,"selectionStart"in s&&ob(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Lh&&Kh(Lh,s)||(Lh=s,s=Ap(Kg,"onSelect"),0_u||(e.current=n2[_u],n2[_u]=null,_u--)}function Un(e,t){_u++,n2[_u]=e.current,e.current=t}var Ha={},Ji=qa(Ha),Rr=qa(!1),kl=Ha;function lc(e,t){var n=e.type.contextTypes;if(!n)return Ha;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var m={},b;for(b in n)m[b]=t[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ir(e){return e=e.childContextTypes,e!=null}function Ip(){Jn(Rr),Jn(Ji)}function Zv(e,t,n){if(Ji.current!==Ha)throw Error(mt(168));Un(Ji,t),Un(Rr,n)}function xE(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var m in s)if(!(m in t))throw Error(mt(108,vM(e)||"Unknown",m));return ai({},n,s)}function Np(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ha,kl=Ji.current,Un(Ji,e),Un(Rr,Rr.current),!0}function e4(e,t,n){var s=e.stateNode;if(!s)throw Error(mt(169));n?(e=xE(e,t,kl),s.__reactInternalMemoizedMergedChildContext=e,Jn(Rr),Jn(Ji),Un(Ji,e)):Jn(Rr),Un(Rr,n)}var jo=null,h1=!1,K0=!1;function wE(e){jo===null?jo=[e]:jo.push(e)}function FC(e){h1=!0,wE(e)}function Qa(){if(!K0&&jo!==null){K0=!0;var e=0,t=Nn;try{var n=jo;for(Nn=1;e>=o,m-=o,Ho=1<<32-js(t)+m|n<N?(R=M,M=null):R=M.sibling;var A=l(y,M,_[N],P);if(A===null){M===null&&(M=R);break}e&&M&&A.alternate===null&&t(y,M),S=b(A,S,N),x===null?w=A:x.sibling=A,x=A,M=R}if(N===_.length)return n(y,M),ni&&dl(y,N),w;if(M===null){for(;N<_.length;N++)M=c(y,_[N],P),M!==null&&(S=b(M,S,N),x===null?w=M:x.sibling=M,x=M);return ni&&dl(y,N),w}for(M=s(y,M);N<_.length;N++)R=h(M,y,N,_[N],P),R!==null&&(e&&R.alternate!==null&&M.delete(R.key===null?N:R.key),S=b(R,S,N),x===null?w=R:x.sibling=R,x=R);return e&&M.forEach(function(F){return t(y,F)}),ni&&dl(y,N),w}function E(y,S,_,P){var w=th(_);if(typeof w!="function")throw Error(mt(150));if(_=w.call(_),_==null)throw Error(mt(151));for(var x=w=null,M=S,N=S=0,R=null,A=_.next();M!==null&&!A.done;N++,A=_.next()){M.index>N?(R=M,M=null):R=M.sibling;var F=l(y,M,A.value,P);if(F===null){M===null&&(M=R);break}e&&M&&F.alternate===null&&t(y,M),S=b(F,S,N),x===null?w=F:x.sibling=F,x=F,M=R}if(A.done)return n(y,M),ni&&dl(y,N),w;if(M===null){for(;!A.done;N++,A=_.next())A=c(y,A.value,P),A!==null&&(S=b(A,S,N),x===null?w=A:x.sibling=A,x=A);return ni&&dl(y,N),w}for(M=s(y,M);!A.done;N++,A=_.next())A=h(M,y,N,A.value,P),A!==null&&(e&&A.alternate!==null&&M.delete(A.key===null?N:A.key),S=b(A,S,N),x===null?w=A:x.sibling=A,x=A);return e&&M.forEach(function(U){return t(y,U)}),ni&&dl(y,N),w}function f(y,S,_,P){if(typeof _=="object"&&_!==null&&_.type===vu&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Lf:e:{for(var w=_.key,x=S;x!==null;){if(x.key===w){if(w=_.type,w===vu){if(x.tag===7){n(y,x.sibling),S=m(x,_.props.children),S.return=y,y=S;break e}}else if(x.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xa&&a4(w)===x.type){n(y,x.sibling),S=m(x,_.props),S.ref=oh(y,x,_),S.return=y,y=S;break e}n(y,x);break}else t(y,x);x=x.sibling}_.type===vu?(S=Rl(_.props.children,y.mode,P,_.key),S.return=y,y=S):(P=pp(_.type,_.key,_.props,null,y.mode,P),P.ref=oh(y,S,_),P.return=y,y=P)}return o(y);case yu:e:{for(x=_.key;S!==null;){if(S.key===x)if(S.tag===4&&S.stateNode.containerInfo===_.containerInfo&&S.stateNode.implementation===_.implementation){n(y,S.sibling),S=m(S,_.children||[]),S.return=y,y=S;break e}else{n(y,S);break}else t(y,S);S=S.sibling}S=ig(_,y.mode,P),S.return=y,y=S}return o(y);case xa:return x=_._init,f(y,S,x(_._payload),P)}if(Eh(_))return d(y,S,_,P);if(th(_))return E(y,S,_,P);Gf(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,S!==null&&S.tag===6?(n(y,S.sibling),S=m(S,_),S.return=y,y=S):(n(y,S),S=ng(_,y.mode,P),S.return=y,y=S),o(y)):n(y,S)}return f}var cc=RE(!0),IE=RE(!1),Ad={},Eo=qa(Ad),Zh=qa(Ad),ed=qa(Ad);function yl(e){if(e===Ad)throw Error(mt(174));return e}function mb(e,t){switch(Un(ed,t),Un(Zh,e),Un(Eo,Ad),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vg(t,e)}Jn(Eo),Un(Eo,t)}function hc(){Jn(Eo),Jn(Zh),Jn(ed)}function NE(e){yl(ed.current);var t=yl(Eo.current),n=Vg(t,e.type);t!==n&&(Un(Zh,e),Un(Eo,n))}function gb(e){Zh.current===e&&(Jn(Eo),Jn(Zh))}var ri=qa(0);function Vp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q0=[];function bb(){for(var e=0;en?n:4,e(!0);var s=Q0.transition;Q0.transition={};try{e(!1),t()}finally{Nn=n,Q0.transition=s}}function KE(){return _s().memoizedState}function GC(e,t,n){var s=Ua(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},qE(e))QE(t,n);else if(n=ME(e,t,n,s),n!==null){var m=lr();Hs(n,e,s,m),JE(n,t,s)}}function WC(e,t,n){var s=Ua(e),m={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(qE(e))QE(t,m);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=t.lastRenderedReducer,b!==null))try{var o=t.lastRenderedState,r=b(o,n);if(m.hasEagerState=!0,m.eagerState=r,Ys(r,o)){var u=t.interleaved;u===null?(m.next=m,fb(t)):(m.next=u.next,u.next=m),t.interleaved=m;return}}catch{}finally{}n=ME(e,t,m,s),n!==null&&(m=lr(),Hs(n,e,s,m),JE(n,t,s))}}function qE(e){var t=e.alternate;return e===oi||t!==null&&t===oi}function QE(e,t){Ah=Gp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function JE(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Z2(e,n)}}var Wp={readContext:ws,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useInsertionEffect:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useSyncExternalStore:Xi,useId:Xi,unstable_isNewReconciler:!1},zC={readContext:ws,useCallback:function(e,t){return co().memoizedState=[e,t===void 0?null:t],e},useContext:ws,useEffect:u4,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,cp(4194308,4,$E.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cp(4194308,4,e,t)},useInsertionEffect:function(e,t){return cp(4,2,e,t)},useMemo:function(e,t){var n=co();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=co();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=GC.bind(null,oi,e),[s.memoizedState,e]},useRef:function(e){var t=co();return e={current:e},t.memoizedState=e},useState:l4,useDebugValue:xb,useDeferredValue:function(e){return co().memoizedState=e},useTransition:function(){var e=l4(!1),t=e[0];return e=VC.bind(null,e[1]),co().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=oi,m=co();if(ni){if(n===void 0)throw Error(mt(407));n=n()}else{if(n=t(),Fi===null)throw Error(mt(349));Fl&30||FE(s,t,n)}m.memoizedState=n;var b={value:n,getSnapshot:t};return m.queue=b,u4(DE.bind(null,s,b,e),[e]),s.flags|=2048,id(9,BE.bind(null,s,b,n,t),void 0,null),n},useId:function(){var e=co(),t=Fi.identifierPrefix;if(ni){var n=Xo,s=Ho;n=(s&~(1<<32-js(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=td++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[yo]=t,e[Jh]=s,ax(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wg(n,s),n){case"dialog":Kn("cancel",e),Kn("close",e),m=s;break;case"iframe":case"object":case"embed":Kn("load",e),m=s;break;case"video":case"audio":for(m=0;mfc&&(t.flags|=128,s=!0,ah(b,!1),t.lanes=4194304)}else{if(!s)if(e=Vp(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ah(b,!0),b.tail===null&&b.tailMode==="hidden"&&!o.alternate&&!ni)return Yi(t),null}else 2*bi()-b.renderingStartTime>fc&&n!==1073741824&&(t.flags|=128,s=!0,ah(b,!1),t.lanes=4194304);b.isBackwards?(o.sibling=t.child,t.child=o):(n=b.last,n!==null?n.sibling=o:t.child=o,b.last=o)}return b.tail!==null?(t=b.tail,b.rendering=t,b.tail=t.sibling,b.renderingStartTime=bi(),t.sibling=null,n=ri.current,Un(ri,s?n&1|2:n&1),t):(Yi(t),null);case 22:case 23:return Cb(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Hr&1073741824&&(Yi(t),t.subtreeFlags&6&&(t.flags|=8192)):Yi(t),null;case 24:return null;case 25:return null}throw Error(mt(156,t.tag))}function qC(e,t){switch(lb(t),t.tag){case 1:return Ir(t.type)&&Ip(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hc(),Jn(Rr),Jn(Ji),bb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gb(t),null;case 13:if(Jn(ri),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(mt(340));uc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jn(ri),null;case 4:return hc(),null;case 10:return db(t.type._context),null;case 22:case 23:return Cb(),null;case 24:return null;default:return null}}var zf=!1,qi=!1,QC=typeof WeakSet=="function"?WeakSet:Set,kt=null;function Cu(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){pi(e,t,s)}else n.current=null}function p2(e,t,n){try{n()}catch(s){pi(e,t,s)}}var y4=!1;function JC(e,t){if(Qg=Cp,e=fE(),ob(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var m=s.anchorOffset,b=s.focusNode;s=s.focusOffset;try{n.nodeType,b.nodeType}catch{n=null;break e}var o=0,r=-1,u=-1,a=0,g=0,c=e,l=null;t:for(;;){for(var h;c!==n||m!==0&&c.nodeType!==3||(r=o+m),c!==b||s!==0&&c.nodeType!==3||(u=o+s),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)l=c,c=h;for(;;){if(c===e)break t;if(l===n&&++a===m&&(r=o),l===b&&++g===s&&(u=o),(h=c.nextSibling)!==null)break;c=l,l=c.parentNode}c=h}n=r===-1||u===-1?null:{start:r,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jg={focusedElem:e,selectionRange:n},Cp=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){t=kt;try{var d=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var E=d.memoizedProps,f=d.memoizedState,y=t.stateNode,S=y.getSnapshotBeforeUpdate(t.elementType===t.type?E:Ws(t.type,E),f);y.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(mt(163))}}catch(P){pi(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}return d=y4,y4=!1,d}function Rh(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var m=s=s.next;do{if((m.tag&e)===e){var b=m.destroy;m.destroy=void 0,b!==void 0&&p2(t,n,b)}m=m.next}while(m!==s)}}function p1(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function m2(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function cx(e){var t=e.alternate;t!==null&&(e.alternate=null,cx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yo],delete t[Jh],delete t[t2],delete t[kC],delete t[OC])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hx(e){return e.tag===5||e.tag===3||e.tag===4}function v4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function g2(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Rp));else if(s!==4&&(e=e.child,e!==null))for(g2(e,t,n),e=e.sibling;e!==null;)g2(e,t,n),e=e.sibling}function b2(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(b2(e,t,n),e=e.sibling;e!==null;)b2(e,t,n),e=e.sibling}var Wi=null,Us=!1;function ba(e,t,n){for(n=n.child;n!==null;)dx(e,t,n),n=n.sibling}function dx(e,t,n){if(So&&typeof So.onCommitFiberUnmount=="function")try{So.onCommitFiberUnmount(o1,n)}catch{}switch(n.tag){case 5:qi||Cu(n,t);case 6:var s=Wi,m=Us;Wi=null,ba(e,t,n),Wi=s,Us=m,Wi!==null&&(Us?(e=Wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wi.removeChild(n.stateNode));break;case 18:Wi!==null&&(Us?(e=Wi,n=n.stateNode,e.nodeType===8?Y0(e.parentNode,n):e.nodeType===1&&Y0(e,n),Xh(e)):Y0(Wi,n.stateNode));break;case 4:s=Wi,m=Us,Wi=n.stateNode.containerInfo,Us=!0,ba(e,t,n),Wi=s,Us=m;break;case 0:case 11:case 14:case 15:if(!qi&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){m=s=s.next;do{var b=m,o=b.destroy;b=b.tag,o!==void 0&&(b&2||b&4)&&p2(n,t,o),m=m.next}while(m!==s)}ba(e,t,n);break;case 1:if(!qi&&(Cu(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(r){pi(n,t,r)}ba(e,t,n);break;case 21:ba(e,t,n);break;case 22:n.mode&1?(qi=(s=qi)||n.memoizedState!==null,ba(e,t,n),qi=s):ba(e,t,n);break;default:ba(e,t,n)}}function S4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new QC),t.forEach(function(s){var m=aL.bind(null,e,s);n.has(s)||(n.add(s),s.then(m,m))})}}function Gs(e,t){var n=t.deletions;if(n!==null)for(var s=0;sm&&(m=o),s&=~b}if(s=m,s=bi()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*eL(s/1960))-s,10e?16:e,Oa===null)var s=!1;else{if(e=Oa,Oa=null,$p=0,En&6)throw Error(mt(331));var m=En;for(En|=4,kt=e.current;kt!==null;){var b=kt,o=b.child;if(kt.flags&16){var r=b.deletions;if(r!==null){for(var u=0;ubi()-Pb?Al(e,0):Tb|=n),Nr(e,t)}function Sx(e,t){t===0&&(e.mode&1?(t=Nf,Nf<<=1,!(Nf&130023424)&&(Nf=4194304)):t=1);var n=lr();e=Zo(e,t),e!==null&&(Md(e,t,n),Nr(e,n))}function oL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sx(e,n)}function aL(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,m=e.memoizedState;m!==null&&(n=m.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(mt(314))}s!==null&&s.delete(t),Sx(e,n)}var Ex;Ex=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Rr.current)Ar=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ar=!1,YC(e,t,n);Ar=!!(e.flags&131072)}else Ar=!1,ni&&t.flags&1048576&&_E(t,Op,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;hp(e,t),e=t.pendingProps;var m=lc(t,Ji.current);Bu(t,n),m=vb(null,t,s,e,m,n);var b=Sb();return t.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ir(s)?(b=!0,Np(t)):b=!1,t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,pb(t),m.updater=d1,t.stateNode=m,m._reactInternals=t,a2(t,s,e,n),t=c2(null,t,s,!0,b,n)):(t.tag=0,ni&&b&&ab(t),ar(null,t,m,n),t=t.child),t;case 16:s=t.elementType;e:{switch(hp(e,t),e=t.pendingProps,m=s._init,s=m(s._payload),t.type=s,m=t.tag=uL(s),e=Ws(s,e),m){case 0:t=u2(null,t,s,e,n);break e;case 1:t=m4(null,t,s,e,n);break e;case 11:t=f4(null,t,s,e,n);break e;case 14:t=p4(null,t,s,Ws(s.type,e),n);break e}throw Error(mt(306,s,""))}return t;case 0:return s=t.type,m=t.pendingProps,m=t.elementType===s?m:Ws(s,m),u2(e,t,s,m,n);case 1:return s=t.type,m=t.pendingProps,m=t.elementType===s?m:Ws(s,m),m4(e,t,s,m,n);case 3:e:{if(rx(t),e===null)throw Error(mt(387));s=t.pendingProps,b=t.memoizedState,m=b.element,CE(e,t),Dp(t,s,null,n);var o=t.memoizedState;if(s=o.element,b.isDehydrated)if(b={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=b,t.memoizedState=b,t.flags&256){m=dc(Error(mt(423)),t),t=g4(e,t,s,n,m);break e}else if(s!==m){m=dc(Error(mt(424)),t),t=g4(e,t,s,n,m);break e}else for(Kr=Ga(t.stateNode.containerInfo.firstChild),qr=t,ni=!0,$s=null,n=IE(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uc(),s===m){t=ea(e,t,n);break e}ar(e,t,s,n)}t=t.child}return t;case 5:return NE(t),e===null&&r2(t),s=t.type,m=t.pendingProps,b=e!==null?e.memoizedProps:null,o=m.children,Zg(s,m)?o=null:b!==null&&Zg(s,b)&&(t.flags|=32),ix(e,t),ar(e,t,o,n),t.child;case 6:return e===null&&r2(t),null;case 13:return sx(e,t,n);case 4:return mb(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=cc(t,null,s,n):ar(e,t,s,n),t.child;case 11:return s=t.type,m=t.pendingProps,m=t.elementType===s?m:Ws(s,m),f4(e,t,s,m,n);case 7:return ar(e,t,t.pendingProps,n),t.child;case 8:return ar(e,t,t.pendingProps.children,n),t.child;case 12:return ar(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,m=t.pendingProps,b=t.memoizedProps,o=m.value,Un(Fp,s._currentValue),s._currentValue=o,b!==null)if(Ys(b.value,o)){if(b.children===m.children&&!Rr.current){t=ea(e,t,n);break e}}else for(b=t.child,b!==null&&(b.return=t);b!==null;){var r=b.dependencies;if(r!==null){o=b.child;for(var u=r.firstContext;u!==null;){if(u.context===s){if(b.tag===1){u=Ko(-1,n&-n),u.tag=2;var a=b.updateQueue;if(a!==null){a=a.shared;var g=a.pending;g===null?u.next=u:(u.next=g.next,g.next=u),a.pending=u}}b.lanes|=n,u=b.alternate,u!==null&&(u.lanes|=n),s2(b.return,n,t),r.lanes|=n;break}u=u.next}}else if(b.tag===10)o=b.type===t.type?null:b.child;else if(b.tag===18){if(o=b.return,o===null)throw Error(mt(341));o.lanes|=n,r=o.alternate,r!==null&&(r.lanes|=n),s2(o,n,t),o=b.sibling}else o=b.child;if(o!==null)o.return=b;else for(o=b;o!==null;){if(o===t){o=null;break}if(b=o.sibling,b!==null){b.return=o.return,o=b;break}o=o.return}b=o}ar(e,t,m.children,n),t=t.child}return t;case 9:return m=t.type,s=t.pendingProps.children,Bu(t,n),m=ws(m),s=s(m),t.flags|=1,ar(e,t,s,n),t.child;case 14:return s=t.type,m=Ws(s,t.pendingProps),m=Ws(s.type,m),p4(e,t,s,m,n);case 15:return tx(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,m=t.pendingProps,m=t.elementType===s?m:Ws(s,m),hp(e,t),t.tag=1,Ir(s)?(e=!0,Np(t)):e=!1,Bu(t,n),AE(t,s,m),a2(t,s,m,n),c2(null,t,s,!0,e,n);case 19:return ox(e,t,n);case 22:return nx(e,t,n)}throw Error(mt(156,t.tag))};function xx(e,t){return Y5(e,t)}function lL(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vs(e,t,n,s){return new lL(e,t,n,s)}function Ab(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uL(e){if(typeof e=="function")return Ab(e)?1:0;if(e!=null){if(e=e.$$typeof,e===K2)return 11;if(e===q2)return 14}return 2}function $a(e,t){var n=e.alternate;return n===null?(n=vs(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pp(e,t,n,s,m,b){var o=2;if(s=e,typeof e=="function")Ab(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case vu:return Rl(n.children,m,b,t);case Y2:o=8,m|=8;break;case Rg:return e=vs(12,n,t,m|2),e.elementType=Rg,e.lanes=b,e;case Ig:return e=vs(13,n,t,m),e.elementType=Ig,e.lanes=b,e;case Ng:return e=vs(19,n,t,m),e.elementType=Ng,e.lanes=b,e;case R5:return g1(n,m,b,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L5:o=10;break e;case A5:o=9;break e;case K2:o=11;break e;case q2:o=14;break e;case xa:o=16,s=null;break e}throw Error(mt(130,e==null?e:typeof e,""))}return t=vs(o,n,t,m),t.elementType=e,t.type=s,t.lanes=b,t}function Rl(e,t,n,s){return e=vs(7,e,s,t),e.lanes=n,e}function g1(e,t,n,s){return e=vs(22,e,s,t),e.elementType=R5,e.lanes=n,e.stateNode={isHidden:!1},e}function ng(e,t,n){return e=vs(6,e,null,t),e.lanes=n,e}function ig(e,t,n){return t=vs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cL(e,t,n,s,m){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=B0(0),this.expirationTimes=B0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=B0(0),this.identifierPrefix=s,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Rb(e,t,n,s,m,b,o,r,u){return e=new cL(e,t,n,r,u),t===1?(t=1,b===!0&&(t|=8)):t=0,b=vs(3,null,null,t),e.current=b,b.stateNode=e,b.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pb(b),e}function hL(e,t,n){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Px)}catch(e){console.error(e)}}Px(),_5.exports=es;var E1=_5.exports;const jf=D2(E1);var C4=E1;Lg.createRoot=C4.createRoot,Lg.hydrateRoot=C4.hydrateRoot;var Xp={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Xp.exports;(function(e,t){(function(){var n,s="4.17.21",m=200,b="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",r="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",a=500,g="__lodash_placeholder__",c=1,l=2,h=4,d=1,E=2,f=1,y=2,S=4,_=8,P=16,w=32,x=64,M=128,N=256,R=512,A=30,F="...",U=800,Y=16,k=1,W=2,G=3,H=1/0,L=9007199254740991,$=17976931348623157e292,ie=NaN,re=4294967295,be=re-1,ae=re>>>1,ge=[["ary",M],["bind",f],["bindKey",y],["curry",_],["curryRight",P],["flip",R],["partial",w],["partialRight",x],["rearg",N]],le="[object Arguments]",Z="[object Array]",ye="[object AsyncFunction]",Se="[object Boolean]",X="[object Date]",ee="[object DOMException]",ne="[object Error]",O="[object Function]",z="[object GeneratorFunction]",K="[object Map]",q="[object Number]",de="[object Null]",ue="[object Object]",ce="[object Promise]",pe="[object Proxy]",we="[object RegExp]",Me="[object Set]",ze="[object String]",De="[object Symbol]",Qe="[object Undefined]",ke="[object WeakMap]",We="[object WeakSet]",qe="[object ArrayBuffer]",Ye="[object DataView]",Je="[object Float32Array]",it="[object Float64Array]",ht="[object Int8Array]",vt="[object Int16Array]",ot="[object Int32Array]",Et="[object Uint8Array]",ct="[object Uint8ClampedArray]",_t="[object Uint16Array]",Nt="[object Uint32Array]",qt=/\b__p \+= '';/g,li=/\b(__p \+=) '' \+/g,$n=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hr=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,On=RegExp(hr.source),tn=RegExp(At.source),Ht=/<%-([\s\S]+?)%>/g,Vn=/<%([\s\S]+?)%>/g,An=/<%=([\s\S]+?)%>/g,jn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Li=/^\w*$/,dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hn=/[\\^$.*+?()[\]{}|]/g,is=RegExp(Hn.source),Dt=/^\s+/,Qs=/\s/,Ai=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Si=/\{\n\/\* \[wrapped with (.+)\] \*/,Br=/,? & /,Dr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rs=/[()=,{}\[\]\/\s]/,fr=/\\(\\)?/g,Ri=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,As=/\w*$/,Vr=/^[-+]0x[0-9a-f]+$/i,ra=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,vn=/^0o[0-7]+$/i,Qt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xn=/($^)/,$l=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",sa="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",Gr="\\u20d0-\\u20ff",mr=sa+Di+Gr,Ii="\\u2700-\\u27bf",Rs="a-z\\xdf-\\xf6\\xf8-\\xff",fn="\\xac\\xb1\\xd7\\xf7",jl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oa="\\u2000-\\u206f",Js=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aa="A-Z\\xc0-\\xd6\\xd8-\\xde",gr="\\ufe0e\\ufe0f",gn=fn+jl+oa+Js,Is="['’]",Hl="["+pr+"]",Co="["+gn+"]",Zs="["+mr+"]",Oe="\\d+",i="["+Ii+"]",v="["+Rs+"]",C="[^"+pr+gn+Oe+Ii+Rs+aa+"]",D="\\ud83c[\\udffb-\\udfff]",j="(?:"+Zs+"|"+D+")",J="[^"+pr+"]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",ve="["+aa+"]",_e="\\u200d",Ce="(?:"+v+"|"+C+")",Ne="(?:"+ve+"|"+C+")",Ae="(?:"+Is+"(?:d|ll|m|re|s|t|ve))?",Ge="(?:"+Is+"(?:D|LL|M|RE|S|T|VE))?",He=j+"?",$e="["+gr+"]?",Ze="(?:"+_e+"(?:"+[J,se,he].join("|")+")"+$e+He+")*",pt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bt=$e+He+Ze,Ot="(?:"+[i,se,he].join("|")+")"+bt,jt="(?:"+[J+Zs+"?",Zs,se,he,Hl].join("|")+")",ln=RegExp(Is,"g"),Rn=RegExp(Zs,"g"),xn=RegExp(D+"(?="+D+")|"+jt+bt,"g"),Vi=RegExp([ve+"?"+v+"+"+Ae+"(?="+[Co,ve,"$"].join("|")+")",Ne+"+"+Ge+"(?="+[Co,ve+Ce,"$"].join("|")+")",ve+"?"+Ce+"+"+Ae,ve+"+"+Ge,ft,pt,Oe,Ot].join("|"),"g"),ui=RegExp("["+_e+pr+mr+gr+"]"),ci=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zi=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],br=-1,bn={};bn[Je]=bn[it]=bn[ht]=bn[vt]=bn[ot]=bn[Et]=bn[ct]=bn[_t]=bn[Nt]=!0,bn[le]=bn[Z]=bn[qe]=bn[Se]=bn[Ye]=bn[X]=bn[ne]=bn[O]=bn[K]=bn[q]=bn[ue]=bn[we]=bn[Me]=bn[ze]=bn[ke]=!1;var pn={};pn[le]=pn[Z]=pn[qe]=pn[Ye]=pn[Se]=pn[X]=pn[Je]=pn[it]=pn[ht]=pn[vt]=pn[ot]=pn[K]=pn[q]=pn[ue]=pn[we]=pn[Me]=pn[ze]=pn[De]=pn[Et]=pn[ct]=pn[_t]=pn[Nt]=!0,pn[ne]=pn[O]=pn[ke]=!1;var er={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ns={"&":"&","<":"<",">":">",'"':""","'":"'"},eo={"&":"&","<":"<",">":">",""":'"',"'":"'"},ks={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Os=parseFloat,to=parseInt,Lo=typeof gu=="object"&&gu&&gu.Object===Object&&gu,mm=typeof self=="object"&&self&&self.Object===Object&&self,Yn=Lo||mm||Function("return this")(),Lc=t&&!t.nodeType&&t,no=Lc&&!0&&e&&!e.nodeType&&e,Dd=no&&no.exports===Lc,la=Dd&&Lo.process,yr=function(){try{var je=no&&no.require&&no.require("util").types;return je||la&&la.binding&&la.binding("util")}catch{}}(),Xl=yr&&yr.isArrayBuffer,Vd=yr&&yr.isDate,Ac=yr&&yr.isMap,Gd=yr&&yr.isRegExp,Wd=yr&&yr.isSet,Yl=yr&&yr.isTypedArray;function tr(je,nt,tt){switch(tt.length){case 0:return je.call(nt);case 1:return je.call(nt,tt[0]);case 2:return je.call(nt,tt[0],tt[1]);case 3:return je.call(nt,tt[0],tt[1],tt[2])}return je.apply(nt,tt)}function zd(je,nt,tt,Pt){for(var Xt=-1,yn=je==null?0:je.length;++Xt-1}function Rc(je,nt,tt){for(var Pt=-1,Xt=je==null?0:je.length;++Pt-1;);return tt}function Kd(je,nt){for(var tt=je.length;tt--&&ua(nt,je[tt],0)>-1;);return tt}function Vc(je,nt){for(var tt=je.length,Pt=0;tt--;)je[tt]===nt&&++Pt;return Pt}var wm=Oc(er),tl=Oc(Ns);function _m(je){return"\\"+ks[je]}function Tm(je,nt){return je==null?n:je[nt]}function ca(je){return ui.test(je)}function Pm(je){return ci.test(je)}function Mm(je){for(var nt,tt=[];!(nt=je.next()).done;)tt.push(nt.value);return tt}function Gc(je){var nt=-1,tt=Array(je.size);return je.forEach(function(Pt,Xt){tt[++nt]=[Xt,Pt]}),tt}function qd(je,nt){return function(tt){return je(nt(tt))}}function so(je,nt){for(var tt=-1,Pt=je.length,Xt=0,yn=[];++tt-1}function I7(p,T){var B=this.__data__,te=sf(B,p);return te<0?(++this.size,B.push([p,T])):B[te][1]=T,this}No.prototype.clear=C7,No.prototype.delete=L7,No.prototype.get=A7,No.prototype.has=R7,No.prototype.set=I7;function ko(p){var T=-1,B=p==null?0:p.length;for(this.clear();++T=T?p:T)),p}function as(p,T,B,te,me,Te){var Fe,Ue=T&c,Ke=T&l,at=T&h;if(B&&(Fe=me?B(p,te,me,Te):B(p)),Fe!==n)return Fe;if(!ii(p))return p;var lt=Kt(p);if(lt){if(Fe=Fw(p),!Ue)return wr(p,Fe)}else{var dt=Hi(p),Tt=dt==O||dt==z;if(ga(p))return r3(p,Ue);if(dt==ue||dt==le||Tt&&!me){if(Fe=Ke||Tt?{}:w3(p),!Ue)return Ke?Tw(p,Y7(Fe,p)):_w(p,ky(Fe,p))}else{if(!pn[dt])return me?p:{};Fe=Bw(p,dt,Ue)}}Te||(Te=new Bs);var Ft=Te.get(p);if(Ft)return Ft;Te.set(p,Fe),J3(p)?p.forEach(function($t){Fe.add(as($t,T,B,$t,p,Te))}):q3(p)&&p.forEach(function($t,cn){Fe.set(cn,as($t,T,B,cn,p,Te))});var Ut=at?Ke?o0:s0:Ke?Tr:Ni,en=lt?n:Ut(p);return vr(en||p,function($t,cn){en&&(cn=$t,$t=p[cn]),Hc(Fe,cn,as($t,T,B,cn,p,Te))}),Fe}function K7(p){var T=Ni(p);return function(B){return Oy(B,p,T)}}function Oy(p,T,B){var te=B.length;if(p==null)return!te;for(p=Cn(p);te--;){var me=B[te],Te=T[me],Fe=p[me];if(Fe===n&&!(me in p)||!Te(Fe))return!1}return!0}function Fy(p,T,B){if(typeof p!="function")throw new xr(o);return Zc(function(){p.apply(n,B)},T)}function Xc(p,T,B,te){var me=-1,Te=Kl,Fe=!0,Ue=p.length,Ke=[],at=T.length;if(!Ue)return Ke;B&&(T=Fn(T,nr(B))),te?(Te=Rc,Fe=!1):T.length>=m&&(Te=el,Fe=!1,T=new sl(T));e:for(;++meme?0:me+B),te=te===n||te>me?me:Zt(te),te<0&&(te+=me),te=B>te?0:ev(te);B0&&B(Ue)?T>1?Gi(Ue,T-1,B,te,me):Fs(me,Ue):te||(me[me.length]=Ue)}return me}var Wm=c3(),Vy=c3(!0);function oo(p,T){return p&&Wm(p,T,Ni)}function zm(p,T){return p&&Vy(p,T,Ni)}function af(p,T){return io(T,function(B){return Vo(p[B])})}function al(p,T){T=pa(T,p);for(var B=0,te=T.length;p!=null&&BT}function J7(p,T){return p!=null&&Tn.call(p,T)}function Z7(p,T){return p!=null&&T in Cn(p)}function ew(p,T,B){return p>=Ti(T,B)&&p=120&<.length>=120)?new sl(Fe&<):n}lt=p[0];var dt=-1,Tt=Ue[0];e:for(;++dt-1;)Ue!==p&&et.call(Ue,Ke,1),et.call(p,Ke,1);return p}function qy(p,T){for(var B=p?T.length:0,te=B-1;B--;){var me=T[B];if(B==te||me!==Te){var Te=me;Do(me)?et.call(p,me,1):Jm(p,me)}}return p}function Km(p,T){return p+Sn(Ay()*(T-p+1))}function fw(p,T,B,te){for(var me=-1,Te=Jt(Yt((T-p)/(B||1)),0),Fe=tt(Te);Te--;)Fe[te?Te:++me]=p,p+=B;return Fe}function qm(p,T){var B="";if(!p||T<1||T>L)return B;do T%2&&(B+=p),T=Sn(T/2),T&&(p+=p);while(T);return B}function nn(p,T){return f0(P3(p,T,Pr),p+"")}function pw(p){return Ny(au(p))}function mw(p,T){var B=au(p);return yf(B,ol(T,0,B.length))}function qc(p,T,B,te){if(!ii(p))return p;T=pa(T,p);for(var me=-1,Te=T.length,Fe=Te-1,Ue=p;Ue!=null&&++meme?0:me+T),B=B>me?me:B,B<0&&(B+=me),me=T>B?0:B-T>>>0,T>>>=0;for(var Te=tt(me);++te>>1,Fe=p[Te];Fe!==null&&!zr(Fe)&&(B?Fe<=T:Fe=m){var at=T?null:Lw(p);if(at)return Ql(at);Fe=!1,me=el,Ke=new sl}else Ke=T?[]:Ue;e:for(;++te=te?p:ls(p,T,B)}var i3=xt||function(p){return Yn.clearTimeout(p)};function r3(p,T){if(T)return p.slice();var B=p.length,te=Ee?Ee(B):new p.constructor(B);return p.copy(te),te}function n0(p){var T=new p.constructor(p.byteLength);return new oe(T).set(new oe(p)),T}function Sw(p,T){var B=T?n0(p.buffer):p.buffer;return new p.constructor(B,p.byteOffset,p.byteLength)}function Ew(p){var T=new p.constructor(p.source,As.exec(p));return T.lastIndex=p.lastIndex,T}function xw(p){return jc?Cn(jc.call(p)):{}}function s3(p,T){var B=T?n0(p.buffer):p.buffer;return new p.constructor(B,p.byteOffset,p.length)}function o3(p,T){if(p!==T){var B=p!==n,te=p===null,me=p===p,Te=zr(p),Fe=T!==n,Ue=T===null,Ke=T===T,at=zr(T);if(!Ue&&!at&&!Te&&p>T||Te&&Fe&&Ke&&!Ue&&!at||te&&Fe&&Ke||!B&&Ke||!me)return 1;if(!te&&!Te&&!at&&p=Ue)return Ke;var at=B[te];return Ke*(at=="desc"?-1:1)}}return p.index-T.index}function a3(p,T,B,te){for(var me=-1,Te=p.length,Fe=B.length,Ue=-1,Ke=T.length,at=Jt(Te-Fe,0),lt=tt(Ke+at),dt=!te;++Ue1?B[me-1]:n,Fe=me>2?B[2]:n;for(Te=p.length>3&&typeof Te=="function"?(me--,Te):n,Fe&&rr(B[0],B[1],Fe)&&(Te=me<3?n:Te,me=1),T=Cn(T);++te-1?me[Te?T[Fe]:Fe]:n}}function f3(p){return Bo(function(T){var B=T.length,te=B,me=os.prototype.thru;for(p&&T.reverse();te--;){var Te=T[te];if(typeof Te!="function")throw new xr(o);if(me&&!Fe&&gf(Te)=="wrapper")var Fe=new os([],!0)}for(te=Fe?te:B;++te1&&mn.reverse(),lt&&KeUe))return!1;var at=Te.get(p),lt=Te.get(T);if(at&<)return at==T&<==p;var dt=-1,Tt=!0,Ft=B&E?new sl:n;for(Te.set(p,T),Te.set(T,p);++dt1?"& ":"")+T[te],T=T.join(B>2?", ":" "),p.replace(Ai,`{ +/* [wrapped with `+T+`] */ +`)}function Vw(p){return Kt(p)||cl(p)||!!(rt&&p&&p[rt])}function Do(p,T){var B=typeof p;return T=T??L,!!T&&(B=="number"||B!="symbol"&&Qt.test(p))&&p>-1&&p%1==0&&p0){if(++T>=U)return arguments[0]}else T=0;return p.apply(n,arguments)}}function yf(p,T){var B=-1,te=p.length,me=te-1;for(T=T===n?te:T;++B1?p[T-1]:n;return B=typeof B=="function"?(p.pop(),B):n,D3(p,B)});function V3(p){var T=xe(p);return T.__chain__=!0,T}function q8(p,T){return T(p),p}function vf(p,T){return T(p)}var Q8=Bo(function(p){var T=p.length,B=T?p[0]:0,te=this.__wrapped__,me=function(Te){return Gm(Te,p)};return T>1||this.__actions__.length||!(te instanceof hn)||!Do(B)?this.thru(me):(te=te.slice(B,+B+(T?1:0)),te.__actions__.push({func:vf,args:[me],thisArg:n}),new os(te,this.__chain__).thru(function(Te){return T&&!Te.length&&Te.push(n),Te}))});function J8(){return V3(this)}function Z8(){return new os(this.value(),this.__chain__)}function e_(){this.__values__===n&&(this.__values__=Z3(this.value()));var p=this.__index__>=this.__values__.length,T=p?n:this.__values__[this.__index__++];return{done:p,value:T}}function t_(){return this}function n_(p){for(var T,B=this;B instanceof rf;){var te=I3(B);te.__index__=0,te.__values__=n,T?me.__wrapped__=te:T=te;var me=te;B=B.__wrapped__}return me.__wrapped__=p,T}function i_(){var p=this.__wrapped__;if(p instanceof hn){var T=p;return this.__actions__.length&&(T=new hn(this)),T=T.reverse(),T.__actions__.push({func:vf,args:[p0],thisArg:n}),new os(T,this.__chain__)}return this.thru(p0)}function r_(){return t3(this.__wrapped__,this.__actions__)}var s_=hf(function(p,T,B){Tn.call(p,B)?++p[B]:Oo(p,B,1)});function o_(p,T,B){var te=Kt(p)?Sr:q7;return B&&rr(p,T,B)&&(T=n),te(p,zt(T,3))}function a_(p,T){var B=Kt(p)?io:Dy;return B(p,zt(T,3))}var l_=d3(N3),u_=d3(k3);function c_(p,T){return Gi(Sf(p,T),1)}function h_(p,T){return Gi(Sf(p,T),H)}function d_(p,T,B){return B=B===n?1:Zt(B),Gi(Sf(p,T),B)}function G3(p,T){var B=Kt(p)?vr:da;return B(p,zt(T,3))}function W3(p,T){var B=Kt(p)?gm:By;return B(p,zt(T,3))}var f_=hf(function(p,T,B){Tn.call(p,B)?p[B].push(T):Oo(p,B,[T])});function p_(p,T,B,te){p=_r(p)?p:au(p),B=B&&!te?Zt(B):0;var me=p.length;return B<0&&(B=Jt(me+B,0)),Tf(p)?B<=me&&p.indexOf(T,B)>-1:!!me&&ua(p,T,B)>-1}var m_=nn(function(p,T,B){var te=-1,me=typeof T=="function",Te=_r(p)?tt(p.length):[];return da(p,function(Fe){Te[++te]=me?tr(T,Fe,B):Yc(Fe,T,B)}),Te}),g_=hf(function(p,T,B){Oo(p,B,T)});function Sf(p,T){var B=Kt(p)?Fn:$y;return B(p,zt(T,3))}function b_(p,T,B,te){return p==null?[]:(Kt(T)||(T=T==null?[]:[T]),B=te?n:B,Kt(B)||(B=B==null?[]:[B]),Yy(p,T,B))}var y_=hf(function(p,T,B){p[B?0:1].push(T)},function(){return[[],[]]});function v_(p,T,B){var te=Kt(p)?Ic:Hd,me=arguments.length<3;return te(p,zt(T,4),B,me,da)}function S_(p,T,B){var te=Kt(p)?bm:Hd,me=arguments.length<3;return te(p,zt(T,4),B,me,By)}function E_(p,T){var B=Kt(p)?io:Dy;return B(p,wf(zt(T,3)))}function x_(p){var T=Kt(p)?Ny:pw;return T(p)}function w_(p,T,B){(B?rr(p,T,B):T===n)?T=1:T=Zt(T);var te=Kt(p)?j7:mw;return te(p,T)}function __(p){var T=Kt(p)?H7:bw;return T(p)}function T_(p){if(p==null)return 0;if(_r(p))return Tf(p)?Ao(p):p.length;var T=Hi(p);return T==K||T==Me?p.size:Hm(p).length}function P_(p,T,B){var te=Kt(p)?ro:yw;return B&&rr(p,T,B)&&(T=n),te(p,zt(T,3))}var M_=nn(function(p,T){if(p==null)return[];var B=T.length;return B>1&&rr(p,T[0],T[1])?T=[]:B>2&&rr(T[0],T[1],T[2])&&(T=[T[0]]),Yy(p,Gi(T,1),[])}),Ef=St||function(){return Yn.Date.now()};function C_(p,T){if(typeof T!="function")throw new xr(o);return p=Zt(p),function(){if(--p<1)return T.apply(this,arguments)}}function z3(p,T,B){return T=B?n:T,T=p&&T==null?p.length:T,Fo(p,M,n,n,n,n,T)}function U3(p,T){var B;if(typeof T!="function")throw new xr(o);return p=Zt(p),function(){return--p>0&&(B=T.apply(this,arguments)),p<=1&&(T=n),B}}var g0=nn(function(p,T,B){var te=f;if(B.length){var me=so(B,su(g0));te|=w}return Fo(p,te,T,B,me)}),$3=nn(function(p,T,B){var te=f|y;if(B.length){var me=so(B,su($3));te|=w}return Fo(T,te,p,B,me)});function j3(p,T,B){T=B?n:T;var te=Fo(p,_,n,n,n,n,n,T);return te.placeholder=j3.placeholder,te}function H3(p,T,B){T=B?n:T;var te=Fo(p,P,n,n,n,n,n,T);return te.placeholder=H3.placeholder,te}function X3(p,T,B){var te,me,Te,Fe,Ue,Ke,at=0,lt=!1,dt=!1,Tt=!0;if(typeof p!="function")throw new xr(o);T=cs(T)||0,ii(B)&&(lt=!!B.leading,dt="maxWait"in B,Te=dt?Jt(cs(B.maxWait)||0,T):Te,Tt="trailing"in B?!!B.trailing:Tt);function Ft(gi){var Vs=te,Wo=me;return te=me=n,at=gi,Fe=p.apply(Wo,Vs),Fe}function Ut(gi){return at=gi,Ue=Zc(cn,T),lt?Ft(gi):Fe}function en(gi){var Vs=gi-Ke,Wo=gi-at,dv=T-Vs;return dt?Ti(dv,Te-Wo):dv}function $t(gi){var Vs=gi-Ke,Wo=gi-at;return Ke===n||Vs>=T||Vs<0||dt&&Wo>=Te}function cn(){var gi=Ef();if($t(gi))return mn(gi);Ue=Zc(cn,en(gi))}function mn(gi){return Ue=n,Tt&&te?Ft(gi):(te=me=n,Fe)}function Ur(){Ue!==n&&i3(Ue),at=0,te=Ke=me=Ue=n}function sr(){return Ue===n?Fe:mn(Ef())}function $r(){var gi=Ef(),Vs=$t(gi);if(te=arguments,me=this,Ke=gi,Vs){if(Ue===n)return Ut(Ke);if(dt)return i3(Ue),Ue=Zc(cn,T),Ft(Ke)}return Ue===n&&(Ue=Zc(cn,T)),Fe}return $r.cancel=Ur,$r.flush=sr,$r}var L_=nn(function(p,T){return Fy(p,1,T)}),A_=nn(function(p,T,B){return Fy(p,cs(T)||0,B)});function R_(p){return Fo(p,R)}function xf(p,T){if(typeof p!="function"||T!=null&&typeof T!="function")throw new xr(o);var B=function(){var te=arguments,me=T?T.apply(this,te):te[0],Te=B.cache;if(Te.has(me))return Te.get(me);var Fe=p.apply(this,te);return B.cache=Te.set(me,Fe)||Te,Fe};return B.cache=new(xf.Cache||ko),B}xf.Cache=ko;function wf(p){if(typeof p!="function")throw new xr(o);return function(){var T=arguments;switch(T.length){case 0:return!p.call(this);case 1:return!p.call(this,T[0]);case 2:return!p.call(this,T[0],T[1]);case 3:return!p.call(this,T[0],T[1],T[2])}return!p.apply(this,T)}}function I_(p){return U3(2,p)}var N_=vw(function(p,T){T=T.length==1&&Kt(T[0])?Fn(T[0],nr(zt())):Fn(Gi(T,1),nr(zt()));var B=T.length;return nn(function(te){for(var me=-1,Te=Ti(te.length,B);++me=T}),cl=Wy(function(){return arguments}())?Wy:function(p){return hi(p)&&Tn.call(p,"callee")&&!Ve.call(p,"callee")},Kt=tt.isArray,Y_=Xl?nr(Xl):nw;function _r(p){return p!=null&&_f(p.length)&&!Vo(p)}function mi(p){return hi(p)&&_r(p)}function K_(p){return p===!0||p===!1||hi(p)&&ir(p)==Se}var ga=Ct||C0,q_=Vd?nr(Vd):iw;function Q_(p){return hi(p)&&p.nodeType===1&&!eh(p)}function J_(p){if(p==null)return!0;if(_r(p)&&(Kt(p)||typeof p=="string"||typeof p.splice=="function"||ga(p)||ou(p)||cl(p)))return!p.length;var T=Hi(p);if(T==K||T==Me)return!p.size;if(Jc(p))return!Hm(p).length;for(var B in p)if(Tn.call(p,B))return!1;return!0}function Z_(p,T){return Kc(p,T)}function e9(p,T,B){B=typeof B=="function"?B:n;var te=B?B(p,T):n;return te===n?Kc(p,T,n,B):!!te}function y0(p){if(!hi(p))return!1;var T=ir(p);return T==ne||T==ee||typeof p.message=="string"&&typeof p.name=="string"&&!eh(p)}function t9(p){return typeof p=="number"&&Gn(p)}function Vo(p){if(!ii(p))return!1;var T=ir(p);return T==O||T==z||T==ye||T==pe}function K3(p){return typeof p=="number"&&p==Zt(p)}function _f(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=L}function ii(p){var T=typeof p;return p!=null&&(T=="object"||T=="function")}function hi(p){return p!=null&&typeof p=="object"}var q3=Ac?nr(Ac):sw;function n9(p,T){return p===T||jm(p,T,l0(T))}function i9(p,T,B){return B=typeof B=="function"?B:n,jm(p,T,l0(T),B)}function r9(p){return Q3(p)&&p!=+p}function s9(p){if(zw(p))throw new Xt(b);return zy(p)}function o9(p){return p===null}function a9(p){return p==null}function Q3(p){return typeof p=="number"||hi(p)&&ir(p)==q}function eh(p){if(!hi(p)||ir(p)!=ue)return!1;var T=Ie(p);if(T===null)return!0;var B=Tn.call(T,"constructor")&&T.constructor;return typeof B=="function"&&B instanceof B&&il.call(B)==Fm}var v0=Gd?nr(Gd):ow;function l9(p){return K3(p)&&p>=-L&&p<=L}var J3=Wd?nr(Wd):aw;function Tf(p){return typeof p=="string"||!Kt(p)&&hi(p)&&ir(p)==ze}function zr(p){return typeof p=="symbol"||hi(p)&&ir(p)==De}var ou=Yl?nr(Yl):lw;function u9(p){return p===n}function c9(p){return hi(p)&&Hi(p)==ke}function h9(p){return hi(p)&&ir(p)==We}var d9=mf(Xm),f9=mf(function(p,T){return p<=T});function Z3(p){if(!p)return[];if(_r(p))return Tf(p)?Er(p):wr(p);if(st&&p[st])return Mm(p[st]());var T=Hi(p),B=T==K?Gc:T==Me?Ql:au;return B(p)}function Go(p){if(!p)return p===0?p:0;if(p=cs(p),p===H||p===-H){var T=p<0?-1:1;return T*$}return p===p?p:0}function Zt(p){var T=Go(p),B=T%1;return T===T?B?T-B:T:0}function ev(p){return p?ol(Zt(p),0,re):0}function cs(p){if(typeof p=="number")return p;if(zr(p))return ie;if(ii(p)){var T=typeof p.valueOf=="function"?p.valueOf():p;p=ii(T)?T+"":T}if(typeof p!="string")return p===0?p:+p;p=Xd(p);var B=ra.test(p);return B||vn.test(p)?to(p.slice(2),B?2:8):Vr.test(p)?ie:+p}function tv(p){return ao(p,Tr(p))}function p9(p){return p?ol(Zt(p),-L,L):p===0?p:0}function Ln(p){return p==null?"":Wr(p)}var m9=iu(function(p,T){if(Jc(T)||_r(T)){ao(T,Ni(T),p);return}for(var B in T)Tn.call(T,B)&&Hc(p,B,T[B])}),nv=iu(function(p,T){ao(T,Tr(T),p)}),Pf=iu(function(p,T,B,te){ao(T,Tr(T),p,te)}),g9=iu(function(p,T,B,te){ao(T,Ni(T),p,te)}),b9=Bo(Gm);function y9(p,T){var B=nu(p);return T==null?B:ky(B,T)}var v9=nn(function(p,T){p=Cn(p);var B=-1,te=T.length,me=te>2?T[2]:n;for(me&&rr(T[0],T[1],me)&&(te=1);++B1),Te}),ao(p,o0(p),B),te&&(B=as(B,c|l|h,Aw));for(var me=T.length;me--;)Jm(B,T[me]);return B});function B9(p,T){return rv(p,wf(zt(T)))}var D9=Bo(function(p,T){return p==null?{}:hw(p,T)});function rv(p,T){if(p==null)return{};var B=Fn(o0(p),function(te){return[te]});return T=zt(T),Ky(p,B,function(te,me){return T(te,me[0])})}function V9(p,T,B){T=pa(T,p);var te=-1,me=T.length;for(me||(me=1,p=n);++teT){var te=p;p=T,T=te}if(B||p%1||T%1){var me=Ay();return Ti(p+me*(T-p+Os("1e-"+((me+"").length-1))),T)}return Km(p,T)}var q9=ru(function(p,T,B){return T=T.toLowerCase(),p+(B?av(T):T)});function av(p){return x0(Ln(p).toLowerCase())}function lv(p){return p=Ln(p),p&&p.replace(Gt,wm).replace(Rn,"")}function Q9(p,T,B){p=Ln(p),T=Wr(T);var te=p.length;B=B===n?te:ol(Zt(B),0,te);var me=B;return B-=T.length,B>=0&&p.slice(B,me)==T}function J9(p){return p=Ln(p),p&&tn.test(p)?p.replace(At,tl):p}function Z9(p){return p=Ln(p),p&&is.test(p)?p.replace(Hn,"\\$&"):p}var eT=ru(function(p,T,B){return p+(B?"-":"")+T.toLowerCase()}),tT=ru(function(p,T,B){return p+(B?" ":"")+T.toLowerCase()}),nT=h3("toLowerCase");function iT(p,T,B){p=Ln(p),T=Zt(T);var te=T?Ao(p):0;if(!T||te>=T)return p;var me=(T-te)/2;return pf(Sn(me),B)+p+pf(Yt(me),B)}function rT(p,T,B){p=Ln(p),T=Zt(T);var te=T?Ao(p):0;return T&&te>>0,B?(p=Ln(p),p&&(typeof T=="string"||T!=null&&!v0(T))&&(T=Wr(T),!T&&ca(p))?ma(Er(p),0,B):p.split(T,B)):[]}var hT=ru(function(p,T,B){return p+(B?" ":"")+x0(T)});function dT(p,T,B){return p=Ln(p),B=B==null?0:ol(Zt(B),0,p.length),T=Wr(T),p.slice(B,B+T.length)==T}function fT(p,T,B){var te=xe.templateSettings;B&&rr(p,T,B)&&(T=n),p=Ln(p),T=Pf({},T,te,y3);var me=Pf({},T.imports,te.imports,y3),Te=Ni(me),Fe=Dc(me,Te),Ue,Ke,at=0,lt=T.interpolate||Xn,dt="__p += '",Tt=ss((T.escape||Xn).source+"|"+lt.source+"|"+(lt===An?Ri:Xn).source+"|"+(T.evaluate||Xn).source+"|$","g"),Ft="//# sourceURL="+(Tn.call(T,"sourceURL")?(T.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++br+"]")+` +`;p.replace(Tt,function($t,cn,mn,Ur,sr,$r){return mn||(mn=Ur),dt+=p.slice(at,$r).replace($l,_m),cn&&(Ue=!0,dt+=`' + +__e(`+cn+`) + +'`),sr&&(Ke=!0,dt+=`'; +`+sr+`; +__p += '`),mn&&(dt+=`' + +((__t = (`+mn+`)) == null ? '' : __t) + +'`),at=$r+$t.length,$t}),dt+=`'; +`;var Ut=Tn.call(T,"variable")&&T.variable;if(!Ut)dt=`with (obj) { +`+dt+` +} +`;else if(rs.test(Ut))throw new Xt(r);dt=(Ke?dt.replace(qt,""):dt).replace(li,"$1").replace($n,"$1;"),dt="function("+(Ut||"obj")+`) { +`+(Ut?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Ue?", __e = _.escape":"")+(Ke?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+dt+`return __p +}`;var en=cv(function(){return yn(Te,Ft+"return "+dt).apply(n,Fe)});if(en.source=dt,y0(en))throw en;return en}function pT(p){return Ln(p).toLowerCase()}function mT(p){return Ln(p).toUpperCase()}function gT(p,T,B){if(p=Ln(p),p&&(B||T===n))return Xd(p);if(!p||!(T=Wr(T)))return p;var te=Er(p),me=Er(T),Te=Yd(te,me),Fe=Kd(te,me)+1;return ma(te,Te,Fe).join("")}function bT(p,T,B){if(p=Ln(p),p&&(B||T===n))return p.slice(0,Qd(p)+1);if(!p||!(T=Wr(T)))return p;var te=Er(p),me=Kd(te,Er(T))+1;return ma(te,0,me).join("")}function yT(p,T,B){if(p=Ln(p),p&&(B||T===n))return p.replace(Dt,"");if(!p||!(T=Wr(T)))return p;var te=Er(p),me=Yd(te,Er(T));return ma(te,me).join("")}function vT(p,T){var B=A,te=F;if(ii(T)){var me="separator"in T?T.separator:me;B="length"in T?Zt(T.length):B,te="omission"in T?Wr(T.omission):te}p=Ln(p);var Te=p.length;if(ca(p)){var Fe=Er(p);Te=Fe.length}if(B>=Te)return p;var Ue=B-Ao(te);if(Ue<1)return te;var Ke=Fe?ma(Fe,0,Ue).join(""):p.slice(0,Ue);if(me===n)return Ke+te;if(Fe&&(Ue+=Ke.length-Ue),v0(me)){if(p.slice(Ue).search(me)){var at,lt=Ke;for(me.global||(me=ss(me.source,Ln(As.exec(me))+"g")),me.lastIndex=0;at=me.exec(lt);)var dt=at.index;Ke=Ke.slice(0,dt===n?Ue:dt)}}else if(p.indexOf(Wr(me),Ue)!=Ue){var Tt=Ke.lastIndexOf(me);Tt>-1&&(Ke=Ke.slice(0,Tt))}return Ke+te}function ST(p){return p=Ln(p),p&&On.test(p)?p.replace(hr,Jd):p}var ET=ru(function(p,T,B){return p+(B?" ":"")+T.toUpperCase()}),x0=h3("toUpperCase");function uv(p,T,B){return p=Ln(p),T=B?n:T,T===n?Pm(p)?Im(p):Sm(p):p.match(T)||[]}var cv=nn(function(p,T){try{return tr(p,n,T)}catch(B){return y0(B)?B:new Xt(B)}}),xT=Bo(function(p,T){return vr(T,function(B){B=lo(B),Oo(p,B,g0(p[B],p))}),p});function wT(p){var T=p==null?0:p.length,B=zt();return p=T?Fn(p,function(te){if(typeof te[1]!="function")throw new xr(o);return[B(te[0]),te[1]]}):[],nn(function(te){for(var me=-1;++meL)return[];var B=re,te=Ti(p,re);T=zt(T),p-=re;for(var me=Bc(te,T);++B0||T<0)?new hn(B):(p<0?B=B.takeRight(-p):p&&(B=B.drop(p)),T!==n&&(T=Zt(T),B=T<0?B.dropRight(-T):B.take(T-p)),B)},hn.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},hn.prototype.toArray=function(){return this.take(re)},oo(hn.prototype,function(p,T){var B=/^(?:filter|find|map|reject)|While$/.test(T),te=/^(?:head|last)$/.test(T),me=xe[te?"take"+(T=="last"?"Right":""):T],Te=te||/^find/.test(T);me&&(xe.prototype[T]=function(){var Fe=this.__wrapped__,Ue=te?[1]:arguments,Ke=Fe instanceof hn,at=Ue[0],lt=Ke||Kt(Fe),dt=function(cn){var mn=me.apply(xe,Fs([cn],Ue));return te&&Tt?mn[0]:mn};lt&&B&&typeof at=="function"&&at.length!=1&&(Ke=lt=!1);var Tt=this.__chain__,Ft=!!this.__actions__.length,Ut=Te&&!Tt,en=Ke&&!Ft;if(!Te&<){Fe=en?Fe:new hn(this);var $t=p.apply(Fe,Ue);return $t.__actions__.push({func:vf,args:[dt],thisArg:n}),new os($t,Tt)}return Ut&&en?p.apply(this,Ue):($t=this.thru(dt),Ut?te?$t.value()[0]:$t.value():$t)})}),vr(["pop","push","shift","sort","splice","unshift"],function(p){var T=nl[p],B=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",te=/^(?:pop|shift)$/.test(p);xe.prototype[p]=function(){var me=arguments;if(te&&!this.__chain__){var Te=this.value();return T.apply(Kt(Te)?Te:[],me)}return this[B](function(Fe){return T.apply(Kt(Fe)?Fe:[],me)})}}),oo(hn.prototype,function(p,T){var B=xe[T];if(B){var te=B.name+"";Tn.call(tu,te)||(tu[te]=[]),tu[te].push({name:T,func:B})}}),tu[df(n,y).name]=[{name:"wrapper",func:n}],hn.prototype.clone=S7,hn.prototype.reverse=E7,hn.prototype.value=x7,xe.prototype.at=Q8,xe.prototype.chain=J8,xe.prototype.commit=Z8,xe.prototype.next=e_,xe.prototype.plant=n_,xe.prototype.reverse=i_,xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=r_,xe.prototype.first=xe.prototype.head,st&&(xe.prototype[st]=t_),xe},Ro=Nm();no?((no.exports=Ro)._=Ro,Lc._=Ro):Yn._=Ro}).call(gu)})(Xp,Xp.exports);var Lt=Xp.exports;const gL={black:"#000",white:"#fff"},sd=gL,bL={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},uu=bL,yL={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},cu=yL,vL={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},hu=vL,SL={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},du=SL,EL={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},fu=EL,xL={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},uh=xL,wL={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},_L=wL;function Xa(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n=0)&&(n[m]=e[m]);return n}function Mx(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var TL=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,PL=Mx(function(e){return TL.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function ML(e){if(e.sheet)return e.sheet;for(var t=0;t0?zi(Tc,--Fr):0,pc--,xi===10&&(pc=1,_1--),xi}function Qr(){return xi=Fr2||ad(xi)>3?"":" "}function GL(e,t){for(;--t&&Qr()&&!(xi<48||xi>102||xi>57&&xi<65||xi>70&&xi<97););return Rd(e,mp()+(t<6&&xo()==32&&Qr()==32))}function w2(e){for(;Qr();)switch(xi){case e:return Fr;case 34:case 39:e!==34&&e!==39&&w2(xi);break;case 40:e===41&&w2(e);break;case 92:Qr();break}return Fr}function WL(e,t){for(;Qr()&&e+xi!==57;)if(e+xi===84&&xo()===47)break;return"/*"+Rd(t,Fr-1)+"*"+w1(e===47?e:Qr())}function zL(e){for(;!ad(xo());)Qr();return Rd(e,Fr)}function UL(e){return Nx(bp("",null,null,null,[""],e=Ix(e),0,[0],e))}function bp(e,t,n,s,m,b,o,r,u){for(var a=0,g=0,c=o,l=0,h=0,d=0,E=1,f=1,y=1,S=0,_="",P=m,w=b,x=s,M=_;f;)switch(d=S,S=Qr()){case 40:if(d!=108&&zi(M,c-1)==58){x2(M+=Mn(gp(S),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:M+=gp(S);break;case 9:case 10:case 13:case 32:M+=VL(d);break;case 92:M+=GL(mp()-1,7);continue;case 47:switch(xo()){case 42:case 47:Hf($L(WL(Qr(),mp()),t,n),u);break;default:M+="/"}break;case 123*E:r[a++]=go(M)*y;case 125*E:case 59:case 0:switch(S){case 0:case 125:f=0;case 59+g:y==-1&&(M=Mn(M,/\f/g,"")),h>0&&go(M)-c&&Hf(h>32?A4(M+";",s,n,c-1):A4(Mn(M," ","")+";",s,n,c-2),u);break;case 59:M+=";";default:if(Hf(x=L4(M,t,n,a,g,m,r,_,P=[],w=[],c),b),S===123)if(g===0)bp(M,t,x,x,P,b,c,r,w);else switch(l===99&&zi(M,3)===110?100:l){case 100:case 108:case 109:case 115:bp(e,x,x,s&&Hf(L4(e,x,x,0,0,m,r,_,m,P=[],c),w),m,w,c,r,s?P:w);break;default:bp(M,x,x,x,[""],w,0,r,w)}}a=g=h=0,E=y=1,_=M="",c=o;break;case 58:c=1+go(M),h=d;default:if(E<1){if(S==123)--E;else if(S==125&&E++==0&&DL()==125)continue}switch(M+=w1(S),S*E){case 38:y=g>0?1:(M+="\f",-1);break;case 44:r[a++]=(go(M)-1)*y,y=1;break;case 64:xo()===45&&(M+=gp(Qr())),l=xo(),g=c=go(_=M+=zL(mp())),S++;break;case 45:d===45&&go(M)==2&&(E=0)}}return b}function L4(e,t,n,s,m,b,o,r,u,a,g){for(var c=m-1,l=m===0?b:[""],h=Bb(l),d=0,E=0,f=0;d0?l[y]+" "+S:Mn(S,/&\f/g,l[y])))&&(u[f++]=_);return T1(e,t,n,m===0?Ob:r,u,a,g)}function $L(e,t,n){return T1(e,t,n,Cx,w1(BL()),od(e,2,-2),0)}function A4(e,t,n,s){return T1(e,t,n,Fb,od(e,0,s),od(e,s+1,-1),s)}function Vu(e,t){for(var n="",s=Bb(e),m=0;m6)switch(zi(e,t+1)){case 109:if(zi(e,t+4)!==45)break;case 102:return Mn(e,/(.+:)(.+)-([^]+)/,"$1"+Pn+"$2-$3$1"+Yp+(zi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~x2(e,"stretch")?kx(Mn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(zi(e,t+1)!==115)break;case 6444:switch(zi(e,go(e)-3-(~x2(e,"!important")&&10))){case 107:return Mn(e,":",":"+Pn)+e;case 101:return Mn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Pn+(zi(e,14)===45?"inline-":"")+"box$3$1"+Pn+"$2$3$1"+Ki+"$2box$3")+e}break;case 5936:switch(zi(e,t+11)){case 114:return Pn+e+Ki+Mn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Pn+e+Ki+Mn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Pn+e+Ki+Mn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Pn+e+Ki+e+e}return e}var ZL=function(t,n,s,m){if(t.length>-1&&!t.return)switch(t.type){case Fb:t.return=kx(t.value,t.length);break;case Lx:return Vu([ch(t,{value:Mn(t.value,"@","@"+Pn)})],m);case Ob:if(t.length)return FL(t.props,function(b){switch(OL(b,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Vu([ch(t,{props:[Mn(b,/:(read-\w+)/,":"+Yp+"$1")]})],m);case"::placeholder":return Vu([ch(t,{props:[Mn(b,/:(plac\w+)/,":"+Pn+"input-$1")]}),ch(t,{props:[Mn(b,/:(plac\w+)/,":"+Yp+"$1")]}),ch(t,{props:[Mn(b,/:(plac\w+)/,Ki+"input-$1")]})],m)}return""})}},eA=[ZL],tA=function(t){var n=t.key;if(n==="css"){var s=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(s,function(E){var f=E.getAttribute("data-emotion");f.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var m=t.stylisPlugins||eA,b={},o,r=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(E){for(var f=E.getAttribute("data-emotion").split(" "),y=1;y=4;++s,m-=4)n=e.charCodeAt(s)&255|(e.charCodeAt(++s)&255)<<8|(e.charCodeAt(++s)&255)<<16|(e.charCodeAt(++s)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(m){case 3:t^=(e.charCodeAt(s+2)&255)<<16;case 2:t^=(e.charCodeAt(s+1)&255)<<8;case 1:t^=e.charCodeAt(s)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var fA={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},pA=/[A-Z]|^ms/g,mA=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wx=function(t){return t.charCodeAt(1)===45},I4=function(t){return t!=null&&typeof t!="boolean"},rg=Mx(function(e){return Wx(e)?e:e.replace(pA,"-$&").toLowerCase()}),N4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(mA,function(s,m,b){return bo={name:m,styles:b,next:bo},m})}return fA[t]!==1&&!Wx(t)&&typeof n=="number"&&n!==0?n+"px":n};function ld(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return bo={name:n.name,styles:n.styles,next:bo},n.name;if(n.styles!==void 0){var s=n.next;if(s!==void 0)for(;s!==void 0;)bo={name:s.name,styles:s.styles,next:bo},s=s.next;var m=n.styles+";";return m}return gA(e,t,n)}case"function":{if(e!==void 0){var b=bo,o=n(e);return bo=b,ld(e,t,o)}break}}if(t==null)return n;var r=t[n];return r!==void 0?r:n}function gA(e,t,n){var s="";if(Array.isArray(n))for(var m=0;m96?SA:EA},B4=function(t,n,s){var m;if(n){var b=n.shouldForwardProp;m=t.__emotion_forwardProp&&b?function(o){return t.__emotion_forwardProp(o)&&b(o)}:b}return typeof m!="function"&&s&&(m=t.__emotion_forwardProp),m},xA=function(t){var n=t.cache,s=t.serialized,m=t.isStringTag;return Vx(n,s,m),yA(function(){return Gx(n,s,m)}),null},wA=function e(t,n){var s=t.__emotion_real===t,m=s&&t.__emotion_base||t,b,o;n!==void 0&&(b=n.label,o=n.target);var r=B4(t,n,s),u=r||F4(m),a=!u("as");return function(){var g=arguments,c=s&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(b!==void 0&&c.push("label:"+b+";"),g[0]==null||g[0].raw===void 0)c.push.apply(c,g);else{c.push(g[0][0]);for(var l=g.length,h=1;ht(TA(m)?n:m):t;return Re.jsx(vA,{styles:s})}function MA(e,t){return _2(e,t)}const CA=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))};function Pa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jx(e){if(!Pa(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=jx(e[n])}),t}function Es(e,t,n={clone:!0}){const s=n.clone?Le({},e):e;return Pa(e)&&Pa(t)&&Object.keys(t).forEach(m=>{m!=="__proto__"&&(Pa(t[m])&&m in e&&Pa(e[m])?s[m]=Es(e[m],t[m],n):n.clone?s[m]=Pa(t[m])?jx(t[m]):t[m]:s[m]=t[m])}),s}var Dn={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $b=Symbol.for("react.element"),jb=Symbol.for("react.portal"),F1=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),D1=Symbol.for("react.profiler"),V1=Symbol.for("react.provider"),G1=Symbol.for("react.context"),LA=Symbol.for("react.server_context"),W1=Symbol.for("react.forward_ref"),z1=Symbol.for("react.suspense"),U1=Symbol.for("react.suspense_list"),$1=Symbol.for("react.memo"),j1=Symbol.for("react.lazy"),AA=Symbol.for("react.offscreen"),Hx;Hx=Symbol.for("react.module.reference");function Cs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $b:switch(e=e.type,e){case F1:case D1:case B1:case z1:case U1:return e;default:switch(e=e&&e.$$typeof,e){case LA:case G1:case W1:case j1:case $1:case V1:return e;default:return t}}case jb:return t}}}Dn.ContextConsumer=G1;Dn.ContextProvider=V1;Dn.Element=$b;Dn.ForwardRef=W1;Dn.Fragment=F1;Dn.Lazy=j1;Dn.Memo=$1;Dn.Portal=jb;Dn.Profiler=D1;Dn.StrictMode=B1;Dn.Suspense=z1;Dn.SuspenseList=U1;Dn.isAsyncMode=function(){return!1};Dn.isConcurrentMode=function(){return!1};Dn.isContextConsumer=function(e){return Cs(e)===G1};Dn.isContextProvider=function(e){return Cs(e)===V1};Dn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$b};Dn.isForwardRef=function(e){return Cs(e)===W1};Dn.isFragment=function(e){return Cs(e)===F1};Dn.isLazy=function(e){return Cs(e)===j1};Dn.isMemo=function(e){return Cs(e)===$1};Dn.isPortal=function(e){return Cs(e)===jb};Dn.isProfiler=function(e){return Cs(e)===D1};Dn.isStrictMode=function(e){return Cs(e)===B1};Dn.isSuspense=function(e){return Cs(e)===z1};Dn.isSuspenseList=function(e){return Cs(e)===U1};Dn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===F1||e===D1||e===B1||e===z1||e===U1||e===AA||typeof e=="object"&&e!==null&&(e.$$typeof===j1||e.$$typeof===$1||e.$$typeof===V1||e.$$typeof===G1||e.$$typeof===W1||e.$$typeof===Hx||e.getModuleId!==void 0)};Dn.typeOf=Cs;function wt(e){if(typeof e!="string")throw new Error(Xa(7));return e.charAt(0).toUpperCase()+e.slice(1)}function T2(...e){return e.reduce((t,n)=>n==null?t:function(...m){t.apply(this,m),n.apply(this,m)},()=>{})}function Hb(e,t=166){let n;function s(...m){const b=()=>{e.apply(this,m)};clearTimeout(n),n=setTimeout(b,t)}return s.clear=()=>{clearTimeout(n)},s}function RA(e,t){return()=>null}function yp(e,t){var n,s;return Pe.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(s=e.type)==null||(s=s._payload)==null||(s=s.value)==null?void 0:s.muiName)!==-1}function Qi(e){return e&&e.ownerDocument||document}function Ya(e){return Qi(e).defaultView||window}function IA(e,t){return()=>null}function Kp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const _o=typeof window<"u"?Pe.useLayoutEffect:Pe.useEffect;let D4=0;function NA(e){const[t,n]=Pe.useState(e),s=e||t;return Pe.useEffect(()=>{t==null&&(D4+=1,n(`mui-${D4}`))},[t]),s}const V4=gg.useId;function H1(e){if(V4!==void 0){const t=V4();return e??t}return NA(e)}function kA(e,t,n,s,m){return null}function ud({controlled:e,default:t,name:n,state:s="value"}){const{current:m}=Pe.useRef(e!==void 0),[b,o]=Pe.useState(t),r=m?e:b,u=Pe.useCallback(a=>{m||o(a)},[]);return[r,u]}function Yo(e){const t=Pe.useRef(e);return _o(()=>{t.current=e}),Pe.useRef((...n)=>(0,t.current)(...n)).current}function yi(...e){return Pe.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Kp(n,t)})},e)}const G4={};function OA(e,t){const n=Pe.useRef(G4);return n.current===G4&&(n.current=e(t)),n}const FA=[];function BA(e){Pe.useEffect(e,FA)}class Nd{constructor(){this.currentId=0,this.clear=()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)},this.disposeEffect=()=>this.clear}static create(){return new Nd}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,n()},t)}}function vl(){const e=OA(Nd.create).current;return BA(e.disposeEffect),e}let X1=!0,P2=!1;const DA=new Nd,VA={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function GA(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&VA[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function WA(e){e.metaKey||e.altKey||e.ctrlKey||(X1=!0)}function sg(){X1=!1}function zA(){this.visibilityState==="hidden"&&P2&&(X1=!0)}function UA(e){e.addEventListener("keydown",WA,!0),e.addEventListener("mousedown",sg,!0),e.addEventListener("pointerdown",sg,!0),e.addEventListener("touchstart",sg,!0),e.addEventListener("visibilitychange",zA,!0)}function $A(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return X1||GA(t)}function Xb(){const e=Pe.useCallback(m=>{m!=null&&UA(m.ownerDocument)},[]),t=Pe.useRef(!1);function n(){return t.current?(P2=!0,DA.start(100,()=>{P2=!1}),t.current=!1,!0):!1}function s(m){return $A(m)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:s,onBlur:n,ref:e}}function Xx(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function jA(e){return Pe.Children.toArray(e).filter(t=>Pe.isValidElement(t))}function Y1(e,t){const n=Le({},t);return Object.keys(e).forEach(s=>{if(s.toString().match(/^(components|slots)$/))n[s]=Le({},e[s],n[s]);else if(s.toString().match(/^(componentsProps|slotProps)$/)){const m=e[s]||{},b=t[s];n[s]={},!b||!Object.keys(b)?n[s]=m:!m||!Object.keys(m)?n[s]=b:(n[s]=Le({},b),Object.keys(m).forEach(o=>{n[s][o]=Y1(m[o],b[o])}))}else n[s]===void 0&&(n[s]=e[s])}),n}function rn(e,t,n=void 0){const s={};return Object.keys(e).forEach(m=>{s[m]=e[m].reduce((b,o)=>{if(o){const r=t(o);r!==""&&b.push(r),n&&n[o]&&b.push(n[o])}return b},[]).join(" ")}),s}const W4=e=>e,HA=()=>{let e=W4;return{configure(t){e=t},generate(t){return e(t)},reset(){e=W4}}},Yx=HA(),Kx={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function sn(e,t,n="Mui"){const s=Kx[t];return s?`${n}-${s}`:`${Yx.generate(e)}-${t}`}function on(e,t,n="Mui"){const s={};return t.forEach(m=>{s[m]=sn(e,m,n)}),s}function XA(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const YA=["values","unit","step"],KA=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,s)=>n.val-s.val),t.reduce((n,s)=>Le({},n,{[s.key]:s.val}),{})};function qA(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:s=5}=e,m=It(e,YA),b=KA(t),o=Object.keys(b);function r(l){return`@media (min-width:${typeof t[l]=="number"?t[l]:l}${n})`}function u(l){return`@media (max-width:${(typeof t[l]=="number"?t[l]:l)-s/100}${n})`}function a(l,h){const d=o.indexOf(h);return`@media (min-width:${typeof t[l]=="number"?t[l]:l}${n}) and (max-width:${(d!==-1&&typeof t[o[d]]=="number"?t[o[d]]:h)-s/100}${n})`}function g(l){return o.indexOf(l)+1`@media (min-width:${Yb[e]}px)`};function Ts(e,t,n){const s=e.theme||{};if(Array.isArray(t)){const b=s.breakpoints||z4;return t.reduce((o,r,u)=>(o[b.up(b.keys[u])]=n(t[u]),o),{})}if(typeof t=="object"){const b=s.breakpoints||z4;return Object.keys(t).reduce((o,r)=>{if(Object.keys(b.values||Yb).indexOf(r)!==-1){const u=b.up(r);o[u]=n(t[r],r)}else{const u=r;o[u]=t[u]}return o},{})}return n(t)}function ZA(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((s,m)=>{const b=e.up(m);return s[b]={},s},{}))||{}}function eR(e,t){return e.reduce((n,s)=>{const m=n[s];return(!m||Object.keys(m).length===0)&&delete n[s],n},t)}function tR(e,t){if(typeof e!="object")return{};const n={},s=Object.keys(t);return Array.isArray(e)?s.forEach((m,b)=>{b{e[m]!=null&&(n[m]=!0)}),n}function K1({values:e,breakpoints:t,base:n}){const s=n||tR(e,t),m=Object.keys(s);if(m.length===0)return e;let b;return m.reduce((o,r,u)=>(Array.isArray(e)?(o[r]=e[u]!=null?e[u]:e[b],b=u):typeof e=="object"?(o[r]=e[r]!=null?e[r]:e[b],b=r):o[r]=e,o),{})}function q1(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const s=`vars.${t}`.split(".").reduce((m,b)=>m&&m[b]?m[b]:null,e);if(s!=null)return s}return t.split(".").reduce((s,m)=>s&&s[m]!=null?s[m]:null,e)}function qp(e,t,n,s=n){let m;return typeof e=="function"?m=e(n):Array.isArray(e)?m=e[n]||s:m=q1(e,n)||s,t&&(m=t(m,s,e)),m}function vi(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:m}=e,b=o=>{if(o[t]==null)return null;const r=o[t],u=o.theme,a=q1(u,s)||{};return Ts(o,r,c=>{let l=qp(a,m,c);return c===l&&typeof c=="string"&&(l=qp(a,m,`${t}${c==="default"?"":wt(c)}`,c)),n===!1?l:{[n]:l}})};return b.propTypes={},b.filterProps=[t],b}function nR(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const iR={m:"margin",p:"padding"},rR={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},U4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},sR=nR(e=>{if(e.length>2)if(U4[e])e=U4[e];else return[e];const[t,n]=e.split(""),s=iR[t],m=rR[n]||"";return Array.isArray(m)?m.map(b=>s+b):[s+m]}),Kb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],qb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Kb,...qb];function kd(e,t,n,s){var m;const b=(m=q1(e,t,!1))!=null?m:n;return typeof b=="number"?o=>typeof o=="string"?o:b*o:Array.isArray(b)?o=>typeof o=="string"?o:b[o]:typeof b=="function"?b:()=>{}}function qx(e){return kd(e,"spacing",8)}function Od(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),s=e(n);return t>=0?s:typeof s=="number"?-s:`-${s}`}function oR(e,t){return n=>e.reduce((s,m)=>(s[m]=Od(t,n),s),{})}function aR(e,t,n,s){if(t.indexOf(n)===-1)return null;const m=sR(n),b=oR(m,s),o=e[n];return Ts(e,o,b)}function Qx(e,t){const n=qx(e.theme);return Object.keys(e).map(s=>aR(e,t,s,n)).reduce(kh,{})}function di(e){return Qx(e,Kb)}di.propTypes={};di.filterProps=Kb;function fi(e){return Qx(e,qb)}fi.propTypes={};fi.filterProps=qb;function lR(e=8){if(e.mui)return e;const t=qx({spacing:e}),n=(...s)=>(s.length===0?[1]:s).map(b=>{const o=t(b);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function Q1(...e){const t=e.reduce((s,m)=>(m.filterProps.forEach(b=>{s[b]=m}),s),{}),n=s=>Object.keys(s).reduce((m,b)=>t[b]?kh(m,t[b](s)):m,{});return n.propTypes={},n.filterProps=e.reduce((s,m)=>s.concat(m.filterProps),[]),n}function ys(e){return typeof e!="number"?e:`${e}px solid`}function Ls(e,t){return vi({prop:e,themeKey:"borders",transform:t})}const uR=Ls("border",ys),cR=Ls("borderTop",ys),hR=Ls("borderRight",ys),dR=Ls("borderBottom",ys),fR=Ls("borderLeft",ys),pR=Ls("borderColor"),mR=Ls("borderTopColor"),gR=Ls("borderRightColor"),bR=Ls("borderBottomColor"),yR=Ls("borderLeftColor"),vR=Ls("outline",ys),SR=Ls("outlineColor"),J1=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=kd(e.theme,"shape.borderRadius",4),n=s=>({borderRadius:Od(t,s)});return Ts(e,e.borderRadius,n)}return null};J1.propTypes={};J1.filterProps=["borderRadius"];Q1(uR,cR,hR,dR,fR,pR,mR,gR,bR,yR,J1,vR,SR);const Z1=e=>{if(e.gap!==void 0&&e.gap!==null){const t=kd(e.theme,"spacing",8),n=s=>({gap:Od(t,s)});return Ts(e,e.gap,n)}return null};Z1.propTypes={};Z1.filterProps=["gap"];const em=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=kd(e.theme,"spacing",8),n=s=>({columnGap:Od(t,s)});return Ts(e,e.columnGap,n)}return null};em.propTypes={};em.filterProps=["columnGap"];const tm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=kd(e.theme,"spacing",8),n=s=>({rowGap:Od(t,s)});return Ts(e,e.rowGap,n)}return null};tm.propTypes={};tm.filterProps=["rowGap"];const ER=vi({prop:"gridColumn"}),xR=vi({prop:"gridRow"}),wR=vi({prop:"gridAutoFlow"}),_R=vi({prop:"gridAutoColumns"}),TR=vi({prop:"gridAutoRows"}),PR=vi({prop:"gridTemplateColumns"}),MR=vi({prop:"gridTemplateRows"}),CR=vi({prop:"gridTemplateAreas"}),LR=vi({prop:"gridArea"});Q1(Z1,em,tm,ER,xR,wR,_R,TR,PR,MR,CR,LR);function Gu(e,t){return t==="grey"?t:e}const AR=vi({prop:"color",themeKey:"palette",transform:Gu}),RR=vi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Gu}),IR=vi({prop:"backgroundColor",themeKey:"palette",transform:Gu});Q1(AR,RR,IR);function Xr(e){return e<=1&&e!==0?`${e*100}%`:e}const NR=vi({prop:"width",transform:Xr}),Qb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var s,m;const b=((s=e.theme)==null||(s=s.breakpoints)==null||(s=s.values)==null?void 0:s[n])||Yb[n];return b?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${b}${e.theme.breakpoints.unit}`}:{maxWidth:b}:{maxWidth:Xr(n)}};return Ts(e,e.maxWidth,t)}return null};Qb.filterProps=["maxWidth"];const kR=vi({prop:"minWidth",transform:Xr}),OR=vi({prop:"height",transform:Xr}),FR=vi({prop:"maxHeight",transform:Xr}),BR=vi({prop:"minHeight",transform:Xr});vi({prop:"size",cssProperty:"width",transform:Xr});vi({prop:"size",cssProperty:"height",transform:Xr});const DR=vi({prop:"boxSizing"});Q1(NR,Qb,kR,OR,FR,BR,DR);const VR={border:{themeKey:"borders",transform:ys},borderTop:{themeKey:"borders",transform:ys},borderRight:{themeKey:"borders",transform:ys},borderBottom:{themeKey:"borders",transform:ys},borderLeft:{themeKey:"borders",transform:ys},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ys},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:J1},color:{themeKey:"palette",transform:Gu},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Gu},backgroundColor:{themeKey:"palette",transform:Gu},p:{style:fi},pt:{style:fi},pr:{style:fi},pb:{style:fi},pl:{style:fi},px:{style:fi},py:{style:fi},padding:{style:fi},paddingTop:{style:fi},paddingRight:{style:fi},paddingBottom:{style:fi},paddingLeft:{style:fi},paddingX:{style:fi},paddingY:{style:fi},paddingInline:{style:fi},paddingInlineStart:{style:fi},paddingInlineEnd:{style:fi},paddingBlock:{style:fi},paddingBlockStart:{style:fi},paddingBlockEnd:{style:fi},m:{style:di},mt:{style:di},mr:{style:di},mb:{style:di},ml:{style:di},mx:{style:di},my:{style:di},margin:{style:di},marginTop:{style:di},marginRight:{style:di},marginBottom:{style:di},marginLeft:{style:di},marginX:{style:di},marginY:{style:di},marginInline:{style:di},marginInlineStart:{style:di},marginInlineEnd:{style:di},marginBlock:{style:di},marginBlockStart:{style:di},marginBlockEnd:{style:di},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Z1},rowGap:{style:tm},columnGap:{style:em},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Xr},maxWidth:{style:Qb},minWidth:{transform:Xr},height:{transform:Xr},maxHeight:{transform:Xr},minHeight:{transform:Xr},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},nm=VR;function GR(...e){const t=e.reduce((s,m)=>s.concat(Object.keys(m)),[]),n=new Set(t);return e.every(s=>n.size===Object.keys(s).length)}function WR(e,t){return typeof e=="function"?e(t):e}function zR(){function e(n,s,m,b){const o={[n]:s,theme:m},r=b[n];if(!r)return{[n]:s};const{cssProperty:u=n,themeKey:a,transform:g,style:c}=r;if(s==null)return null;if(a==="typography"&&s==="inherit")return{[n]:s};const l=q1(m,a)||{};return c?c(o):Ts(o,s,d=>{let E=qp(l,g,d);return d===E&&typeof d=="string"&&(E=qp(l,g,`${n}${d==="default"?"":wt(d)}`,d)),u===!1?E:{[u]:E}})}function t(n){var s;const{sx:m,theme:b={}}=n||{};if(!m)return null;const o=(s=b.unstable_sxConfig)!=null?s:nm;function r(u){let a=u;if(typeof u=="function")a=u(b);else if(typeof u!="object")return u;if(!a)return null;const g=ZA(b.breakpoints),c=Object.keys(g);let l=g;return Object.keys(a).forEach(h=>{const d=WR(a[h],b);if(d!=null)if(typeof d=="object")if(o[h])l=kh(l,e(h,d,b,o));else{const E=Ts({theme:b},d,f=>({[h]:f}));GR(E,d)?l[h]=t({sx:d,theme:b}):l=kh(l,E)}else l=kh(l,e(h,d,b,o))}),eR(c,l)}return Array.isArray(m)?m.map(r):r(m)}return t}const im=zR();im.filterProps=["sx"];function UR(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const $R=["breakpoints","palette","spacing","shape"];function Jb(e={},...t){const{breakpoints:n={},palette:s={},spacing:m,shape:b={}}=e,o=It(e,$R),r=qA(n),u=lR(m);let a=Es({breakpoints:r,direction:"ltr",components:{},palette:Le({mode:"light"},s),spacing:u,shape:Le({},JA,b)},o);return a.applyStyles=UR,a=t.reduce((g,c)=>Es(g,c),a),a.unstable_sxConfig=Le({},nm,o==null?void 0:o.unstable_sxConfig),a.unstable_sx=function(c){return im({sx:c,theme:this})},a}function jR(e){return Object.keys(e).length===0}function Jx(e=null){const t=Pe.useContext(zb);return!t||jR(t)?e:t}const HR=Jb();function Zb(e=HR){return Jx(e)}function XR({styles:e,themeId:t,defaultTheme:n={}}){const s=Zb(n),m=typeof e=="function"?e(t&&s[t]||s):e;return Re.jsx(PA,{styles:m})}const YR=["sx"],KR=e=>{var t,n;const s={systemProps:{},otherProps:{}},m=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:nm;return Object.keys(e).forEach(b=>{m[b]?s.systemProps[b]=e[b]:s.otherProps[b]=e[b]}),s};function Zx(e){const{sx:t}=e,n=It(e,YR),{systemProps:s,otherProps:m}=KR(n);let b;return Array.isArray(t)?b=[s,...t]:typeof t=="function"?b=(...o)=>{const r=t(...o);return Pa(r)?Le({},s,r):s}:b=Le({},s,t),Le({},m,{sx:b})}function e6(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var m=e.length;for(t=0;t96}function Oh(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const tI=Jb(),nI=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Xf({defaultTheme:e,theme:t,themeId:n}){return ZR(t)?e:t[n]||t}function iI(e){return e?(t,n)=>n[e]:null}function vp(e,t){let{ownerState:n}=t,s=It(t,qR);const m=typeof e=="function"?e(Le({ownerState:n},s)):e;if(Array.isArray(m))return m.flatMap(b=>vp(b,Le({ownerState:n},s)));if(m&&typeof m=="object"&&Array.isArray(m.variants)){const{variants:b=[]}=m;let r=It(m,QR);return b.forEach(u=>{let a=!0;typeof u.props=="function"?a=u.props(Le({ownerState:n},s)):Object.keys(u.props).forEach(g=>{(n==null?void 0:n[g])!==u.props[g]&&s[g]!==u.props[g]&&(a=!1)}),a&&(Array.isArray(r)||(r=[r]),r.push(typeof u.style=="function"?u.style(Le({ownerState:n},s)):u.style))}),r}return m}function rI(e={}){const{themeId:t,defaultTheme:n=tI,rootShouldForwardProp:s=Oh,slotShouldForwardProp:m=Oh}=e,b=o=>im(Le({},o,{theme:Xf(Le({},o,{defaultTheme:n,themeId:t}))}));return b.__mui_systemSx=!0,(o,r={})=>{CA(o,w=>w.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:u,slot:a,skipVariantsResolver:g,skipSx:c,overridesResolver:l=iI(nI(a))}=r,h=It(r,JR),d=g!==void 0?g:a&&a!=="Root"&&a!=="root"||!1,E=c||!1;let f,y=Oh;a==="Root"||a==="root"?y=s:a?y=m:eI(o)&&(y=void 0);const S=MA(o,Le({shouldForwardProp:y,label:f},h)),_=w=>typeof w=="function"&&w.__emotion_real!==w||Pa(w)?x=>vp(w,Le({},x,{theme:Xf({theme:x.theme,defaultTheme:n,themeId:t})})):w,P=(w,...x)=>{let M=_(w);const N=x?x.map(_):[];u&&l&&N.push(F=>{const U=Xf(Le({},F,{defaultTheme:n,themeId:t}));if(!U.components||!U.components[u]||!U.components[u].styleOverrides)return null;const Y=U.components[u].styleOverrides,k={};return Object.entries(Y).forEach(([W,G])=>{k[W]=vp(G,Le({},F,{theme:U}))}),l(F,k)}),u&&!d&&N.push(F=>{var U;const Y=Xf(Le({},F,{defaultTheme:n,themeId:t})),k=Y==null||(U=Y.components)==null||(U=U[u])==null?void 0:U.variants;return vp({variants:k},Le({},F,{theme:Y}))}),E||N.push(b);const R=N.length-x.length;if(Array.isArray(w)&&R>0){const F=new Array(R).fill("");M=[...w,...F],M.raw=[...w.raw,...F]}const A=S(M,...N);return o.muiName&&(A.muiName=o.muiName),A};return S.withConfig&&(P.withConfig=S.withConfig),P}}function sI(e){const{theme:t,name:n,props:s}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?s:Y1(t.components[n].defaultProps,s)}function oI({props:e,name:t,defaultTheme:n,themeId:s}){let m=Zb(n);return s&&(m=m[s]||m),sI({theme:m,name:t,props:e})}function ey(e,t=0,n=1){return XA(e,t,n)}function aI(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(s=>s+s)),n?`rgb${n.length===4?"a":""}(${n.map((s,m)=>m<3?parseInt(s,16):Math.round(parseInt(s,16)/255*1e3)/1e3).join(", ")})`:""}function Vl(e){if(e.type)return e;if(e.charAt(0)==="#")return Vl(aI(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Xa(9,e));let s=e.substring(t+1,e.length-1),m;if(n==="color"){if(s=s.split(" "),m=s.shift(),s.length===4&&s[3].charAt(0)==="/"&&(s[3]=s[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error(Xa(10,m))}else s=s.split(",");return s=s.map(b=>parseFloat(b)),{type:n,values:s,colorSpace:m}}function rm(e){const{type:t,colorSpace:n}=e;let{values:s}=e;return t.indexOf("rgb")!==-1?s=s.map((m,b)=>b<3?parseInt(m,10):m):t.indexOf("hsl")!==-1&&(s[1]=`${s[1]}%`,s[2]=`${s[2]}%`),t.indexOf("color")!==-1?s=`${n} ${s.join(" ")}`:s=`${s.join(", ")}`,`${t}(${s})`}function lI(e){e=Vl(e);const{values:t}=e,n=t[0],s=t[1]/100,m=t[2]/100,b=s*Math.min(m,1-m),o=(a,g=(a+n/30)%12)=>m-b*Math.max(Math.min(g-3,9-g,1),-1);let r="rgb";const u=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(r+="a",u.push(t[3])),rm({type:r,values:u})}function $4(e){e=Vl(e);let t=e.type==="hsl"||e.type==="hsla"?Vl(lI(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function uI(e,t){const n=$4(e),s=$4(t);return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}function In(e,t){return e=Vl(e),t=ey(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,rm(e)}function t6(e,t){if(e=Vl(e),t=ey(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return rm(e)}function n6(e,t){if(e=Vl(e),t=ey(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return rm(e)}function cI(e,t){return Le({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const hI=["mode","contrastThreshold","tonalOffset"],j4={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:sd.white,default:sd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},og={text:{primary:sd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:sd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function H4(e,t,n,s){const m=s.light||s,b=s.dark||s*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=n6(e.main,m):t==="dark"&&(e.dark=t6(e.main,b)))}function dI(e="light"){return e==="dark"?{main:hu[200],light:hu[50],dark:hu[400]}:{main:hu[700],light:hu[400],dark:hu[800]}}function fI(e="light"){return e==="dark"?{main:cu[200],light:cu[50],dark:cu[400]}:{main:cu[500],light:cu[300],dark:cu[700]}}function pI(e="light"){return e==="dark"?{main:uu[500],light:uu[300],dark:uu[700]}:{main:uu[700],light:uu[400],dark:uu[800]}}function mI(e="light"){return e==="dark"?{main:du[400],light:du[300],dark:du[700]}:{main:du[700],light:du[500],dark:du[900]}}function gI(e="light"){return e==="dark"?{main:fu[400],light:fu[300],dark:fu[700]}:{main:fu[800],light:fu[500],dark:fu[900]}}function bI(e="light"){return e==="dark"?{main:uh[400],light:uh[300],dark:uh[700]}:{main:"#ed6c02",light:uh[500],dark:uh[900]}}function yI(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2}=e,m=It(e,hI),b=e.primary||dI(t),o=e.secondary||fI(t),r=e.error||pI(t),u=e.info||mI(t),a=e.success||gI(t),g=e.warning||bI(t);function c(E){return uI(E,og.text.primary)>=n?og.text.primary:j4.text.primary}const l=({color:E,name:f,mainShade:y=500,lightShade:S=300,darkShade:_=700})=>{if(E=Le({},E),!E.main&&E[y]&&(E.main=E[y]),!E.hasOwnProperty("main"))throw new Error(Xa(11,f?` (${f})`:"",y));if(typeof E.main!="string")throw new Error(Xa(12,f?` (${f})`:"",JSON.stringify(E.main)));return H4(E,"light",S,s),H4(E,"dark",_,s),E.contrastText||(E.contrastText=c(E.main)),E},h={dark:og,light:j4};return Es(Le({common:Le({},sd),mode:t,primary:l({color:b,name:"primary"}),secondary:l({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:l({color:r,name:"error"}),warning:l({color:g,name:"warning"}),info:l({color:u,name:"info"}),success:l({color:a,name:"success"}),grey:_L,contrastThreshold:n,getContrastText:c,augmentColor:l,tonalOffset:s},h[t]),m)}const vI=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function SI(e){return Math.round(e*1e5)/1e5}const X4={textTransform:"uppercase"},Y4='"Roboto", "Helvetica", "Arial", sans-serif';function EI(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:s=Y4,fontSize:m=14,fontWeightLight:b=300,fontWeightRegular:o=400,fontWeightMedium:r=500,fontWeightBold:u=700,htmlFontSize:a=16,allVariants:g,pxToRem:c}=n,l=It(n,vI),h=m/14,d=c||(y=>`${y/a*h}rem`),E=(y,S,_,P,w)=>Le({fontFamily:s,fontWeight:y,fontSize:d(S),lineHeight:_},s===Y4?{letterSpacing:`${SI(P/S)}em`}:{},w,g),f={h1:E(b,96,1.167,-1.5),h2:E(b,60,1.2,-.5),h3:E(o,48,1.167,0),h4:E(o,34,1.235,.25),h5:E(o,24,1.334,0),h6:E(r,20,1.6,.15),subtitle1:E(o,16,1.75,.15),subtitle2:E(r,14,1.57,.1),body1:E(o,16,1.5,.15),body2:E(o,14,1.43,.15),button:E(r,14,1.75,.4,X4),caption:E(o,12,1.66,.4),overline:E(o,12,2.66,1,X4),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Es(Le({htmlFontSize:a,pxToRem:d,fontFamily:s,fontSize:m,fontWeightLight:b,fontWeightRegular:o,fontWeightMedium:r,fontWeightBold:u},f),l,{clone:!1})}const xI=.2,wI=.14,_I=.12;function Zn(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${xI})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${wI})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${_I})`].join(",")}const TI=["none",Zn(0,2,1,-1,0,1,1,0,0,1,3,0),Zn(0,3,1,-2,0,2,2,0,0,1,5,0),Zn(0,3,3,-2,0,3,4,0,0,1,8,0),Zn(0,2,4,-1,0,4,5,0,0,1,10,0),Zn(0,3,5,-1,0,5,8,0,0,1,14,0),Zn(0,3,5,-1,0,6,10,0,0,1,18,0),Zn(0,4,5,-2,0,7,10,1,0,2,16,1),Zn(0,5,5,-3,0,8,10,1,0,3,14,2),Zn(0,5,6,-3,0,9,12,1,0,3,16,2),Zn(0,6,6,-3,0,10,14,1,0,4,18,3),Zn(0,6,7,-4,0,11,15,1,0,4,20,3),Zn(0,7,8,-4,0,12,17,2,0,5,22,4),Zn(0,7,8,-4,0,13,19,2,0,5,24,4),Zn(0,7,9,-4,0,14,21,2,0,5,26,4),Zn(0,8,9,-5,0,15,22,2,0,6,28,5),Zn(0,8,10,-5,0,16,24,2,0,6,30,5),Zn(0,8,11,-5,0,17,26,2,0,6,32,5),Zn(0,9,11,-5,0,18,28,2,0,7,34,6),Zn(0,9,12,-6,0,19,29,2,0,7,36,6),Zn(0,10,13,-6,0,20,31,3,0,8,38,7),Zn(0,10,13,-6,0,21,33,3,0,8,40,7),Zn(0,10,14,-6,0,22,35,3,0,8,42,7),Zn(0,11,14,-7,0,23,36,3,0,9,44,8),Zn(0,11,15,-7,0,24,38,3,0,9,46,8)],PI=["duration","easing","delay"],MI={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},i6={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function K4(e){return`${Math.round(e)}ms`}function CI(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function LI(e){const t=Le({},MI,e.easing),n=Le({},i6,e.duration);return Le({getAutoHeightDuration:CI,create:(m=["all"],b={})=>{const{duration:o=n.standard,easing:r=t.easeInOut,delay:u=0}=b;return It(b,PI),(Array.isArray(m)?m:[m]).map(a=>`${a} ${typeof o=="string"?o:K4(o)} ${r} ${typeof u=="string"?u:K4(u)}`).join(",")}},e,{easing:t,duration:n})}const AI={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},RI=AI,II=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function NI(e={},...t){const{mixins:n={},palette:s={},transitions:m={},typography:b={}}=e,o=It(e,II);if(e.vars)throw new Error(Xa(18));const r=yI(s),u=Jb(e);let a=Es(u,{mixins:cI(u.breakpoints,n),palette:r,shadows:TI.slice(),typography:EI(r,b),transitions:LI(m),zIndex:Le({},RI)});return a=Es(a,o),a=t.reduce((g,c)=>Es(g,c),a),a.unstable_sxConfig=Le({},nm,o==null?void 0:o.unstable_sxConfig),a.unstable_sx=function(c){return im({sx:c,theme:this})},a}const kI=NI(),sm=kI;function Pc(){const e=Zb(sm);return e[x1]||e}function an({props:e,name:t}){return oI({props:e,name:t,defaultTheme:sm,themeId:x1})}const Ks=e=>Oh(e)&&e!=="classes",OI=Oh,Mt=rI({themeId:x1,defaultTheme:sm,rootShouldForwardProp:Ks}),FI=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},q4=FI;function BI(e){return sn("MuiSvgIcon",e)}on("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const DI=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],VI=e=>{const{color:t,fontSize:n,classes:s}=e,m={root:["root",t!=="inherit"&&`color${wt(t)}`,`fontSize${wt(n)}`]};return rn(m,BI,s)},GI=Mt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${wt(n.color)}`],t[`fontSize${wt(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,s,m,b,o,r,u,a,g,c,l,h,d;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(s=n.create)==null?void 0:s.call(n,"fill",{duration:(m=e.transitions)==null||(m=m.duration)==null?void 0:m.shorter}),fontSize:{inherit:"inherit",small:((b=e.typography)==null||(o=b.pxToRem)==null?void 0:o.call(b,20))||"1.25rem",medium:((r=e.typography)==null||(u=r.pxToRem)==null?void 0:u.call(r,24))||"1.5rem",large:((a=e.typography)==null||(g=a.pxToRem)==null?void 0:g.call(a,35))||"2.1875rem"}[t.fontSize],color:(c=(l=(e.vars||e).palette)==null||(l=l[t.color])==null?void 0:l.main)!=null?c:{action:(h=(e.vars||e).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(d=(e.vars||e).palette)==null||(d=d.action)==null?void 0:d.disabled,inherit:void 0}[t.color]}}),M2=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiSvgIcon"}),{children:m,className:b,color:o="inherit",component:r="svg",fontSize:u="medium",htmlColor:a,inheritViewBox:g=!1,titleAccess:c,viewBox:l="0 0 24 24"}=s,h=It(s,DI),d=Pe.isValidElement(m)&&m.type==="svg",E=Le({},s,{color:o,component:r,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:g,viewBox:l,hasSvgAsChild:d}),f={};g||(f.viewBox=l);const y=VI(E);return Re.jsxs(GI,Le({as:r,className:Bt(y.root,b),focusable:"false",color:a,"aria-hidden":c?void 0:!0,role:c?"img":void 0,ref:n},f,h,d&&m.props,{ownerState:E,children:[d?m.props.children:m,c?Re.jsx("title",{children:c}):null]}))});M2.muiName="SvgIcon";function ty(e,t){function n(s,m){return Re.jsx(M2,Le({"data-testid":`${t}Icon`,ref:m},s,{children:e}))}return n.muiName=M2.muiName,Pe.memo(Pe.forwardRef(n))}const WI={configure:e=>{Yx.configure(e)}},zI=Object.freeze(Object.defineProperty({__proto__:null,capitalize:wt,createChainedFunction:T2,createSvgIcon:ty,debounce:Hb,deprecatedPropType:RA,isMuiElement:yp,ownerDocument:Qi,ownerWindow:Ya,requirePropFactory:IA,setRef:Kp,unstable_ClassNameGenerator:WI,unstable_useEnhancedEffect:_o,unstable_useId:H1,unsupportedProp:kA,useControlled:ud,useEventCallback:Yo,useForkRef:yi,useIsFocusVisible:Xb},Symbol.toStringTag,{value:"Module"}));function C2(e,t){return C2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,m){return s.__proto__=m,s},C2(e,t)}function r6(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,C2(e,t)}const Q4={disabled:!1},Qp=si.createContext(null);var UI=function(t){return t.scrollTop},_h="unmounted",pl="exited",ml="entering",bu="entered",L2="exiting",ia=function(e){r6(t,e);function t(s,m){var b;b=e.call(this,s,m)||this;var o=m,r=o&&!o.isMounting?s.enter:s.appear,u;return b.appearStatus=null,s.in?r?(u=pl,b.appearStatus=ml):u=bu:s.unmountOnExit||s.mountOnEnter?u=_h:u=pl,b.state={status:u},b.nextCallback=null,b}t.getDerivedStateFromProps=function(m,b){var o=m.in;return o&&b.status===_h?{status:pl}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(m){var b=null;if(m!==this.props){var o=this.state.status;this.props.in?o!==ml&&o!==bu&&(b=ml):(o===ml||o===bu)&&(b=L2)}this.updateStatus(!1,b)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var m=this.props.timeout,b,o,r;return b=o=r=m,m!=null&&typeof m!="number"&&(b=m.exit,o=m.enter,r=m.appear!==void 0?m.appear:o),{exit:b,enter:o,appear:r}},n.updateStatus=function(m,b){if(m===void 0&&(m=!1),b!==null)if(this.cancelNextCallback(),b===ml){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:jf.findDOMNode(this);o&&UI(o)}this.performEnter(m)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pl&&this.setState({status:_h})},n.performEnter=function(m){var b=this,o=this.props.enter,r=this.context?this.context.isMounting:m,u=this.props.nodeRef?[r]:[jf.findDOMNode(this),r],a=u[0],g=u[1],c=this.getTimeouts(),l=r?c.appear:c.enter;if(!m&&!o||Q4.disabled){this.safeSetState({status:bu},function(){b.props.onEntered(a)});return}this.props.onEnter(a,g),this.safeSetState({status:ml},function(){b.props.onEntering(a,g),b.onTransitionEnd(l,function(){b.safeSetState({status:bu},function(){b.props.onEntered(a,g)})})})},n.performExit=function(){var m=this,b=this.props.exit,o=this.getTimeouts(),r=this.props.nodeRef?void 0:jf.findDOMNode(this);if(!b||Q4.disabled){this.safeSetState({status:pl},function(){m.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:L2},function(){m.props.onExiting(r),m.onTransitionEnd(o.exit,function(){m.safeSetState({status:pl},function(){m.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(m,b){b=this.setNextCallback(b),this.setState(m,b)},n.setNextCallback=function(m){var b=this,o=!0;return this.nextCallback=function(r){o&&(o=!1,b.nextCallback=null,m(r))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(m,b){this.setNextCallback(b);var o=this.props.nodeRef?this.props.nodeRef.current:jf.findDOMNode(this),r=m==null&&!this.props.addEndListener;if(!o||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],a=u[0],g=u[1];this.props.addEndListener(a,g)}m!=null&&setTimeout(this.nextCallback,m)},n.render=function(){var m=this.state.status;if(m===_h)return null;var b=this.props,o=b.children;b.in,b.mountOnEnter,b.unmountOnExit,b.appear,b.enter,b.exit,b.timeout,b.addEndListener,b.onEnter,b.onEntering,b.onEntered,b.onExit,b.onExiting,b.onExited,b.nodeRef;var r=It(b,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return si.createElement(Qp.Provider,{value:null},typeof o=="function"?o(m,r):si.cloneElement(si.Children.only(o),r))},t}(si.Component);ia.contextType=Qp;ia.propTypes={};function pu(){}ia.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:pu,onEntering:pu,onEntered:pu,onExit:pu,onExiting:pu,onExited:pu};ia.UNMOUNTED=_h;ia.EXITED=pl;ia.ENTERING=ml;ia.ENTERED=bu;ia.EXITING=L2;const ny=ia;function $I(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iy(e,t){var n=function(b){return t&&Pe.isValidElement(b)?t(b):b},s=Object.create(null);return e&&Pe.Children.map(e,function(m){return m}).forEach(function(m){s[m.key]=n(m)}),s}function jI(e,t){e=e||{},t=t||{};function n(g){return g in t?t[g]:e[g]}var s=Object.create(null),m=[];for(var b in e)b in t?m.length&&(s[b]=m,m=[]):m.push(b);var o,r={};for(var u in t){if(s[u])for(o=0;oe.scrollTop;function mc(e,t){var n,s;const{timeout:m,easing:b,style:o={}}=e;return{duration:(n=o.transitionDuration)!=null?n:typeof m=="number"?m:m[t.mode]||0,easing:(s=o.transitionTimingFunction)!=null?s:typeof b=="object"?b[t.mode]:b,delay:o.transitionDelay}}function QI(e){return sn("MuiCollapse",e)}on("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const JI=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],ZI=e=>{const{orientation:t,classes:n}=e,s={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return rn(s,QI,n)},eN=Mt("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(({theme:e,ownerState:t})=>Le({height:0,overflow:"hidden",transition:e.transitions.create("height")},t.orientation==="horizontal"&&{height:"auto",width:0,transition:e.transitions.create("width")},t.state==="entered"&&Le({height:"auto",overflow:"visible"},t.orientation==="horizontal"&&{width:"auto"}),t.state==="exited"&&!t.in&&t.collapsedSize==="0px"&&{visibility:"hidden"})),tN=Mt("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})(({ownerState:e})=>Le({display:"flex",width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),nN=Mt("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})(({ownerState:e})=>Le({width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),o6=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiCollapse"}),{addEndListener:m,children:b,className:o,collapsedSize:r="0px",component:u,easing:a,in:g,onEnter:c,onEntered:l,onEntering:h,onExit:d,onExited:E,onExiting:f,orientation:y="vertical",style:S,timeout:_=i6.standard,TransitionComponent:P=ny}=s,w=It(s,JI),x=Le({},s,{orientation:y,collapsedSize:r}),M=ZI(x),N=Pc(),R=vl(),A=Pe.useRef(null),F=Pe.useRef(),U=typeof r=="number"?`${r}px`:r,Y=y==="horizontal",k=Y?"width":"height",W=Pe.useRef(null),G=yi(n,W),H=Z=>ye=>{if(Z){const Se=W.current;ye===void 0?Z(Se):Z(Se,ye)}},L=()=>A.current?A.current[Y?"clientWidth":"clientHeight"]:0,$=H((Z,ye)=>{A.current&&Y&&(A.current.style.position="absolute"),Z.style[k]=U,c&&c(Z,ye)}),ie=H((Z,ye)=>{const Se=L();A.current&&Y&&(A.current.style.position="");const{duration:X,easing:ee}=mc({style:S,timeout:_,easing:a},{mode:"enter"});if(_==="auto"){const ne=N.transitions.getAutoHeightDuration(Se);Z.style.transitionDuration=`${ne}ms`,F.current=ne}else Z.style.transitionDuration=typeof X=="string"?X:`${X}ms`;Z.style[k]=`${Se}px`,Z.style.transitionTimingFunction=ee,h&&h(Z,ye)}),re=H((Z,ye)=>{Z.style[k]="auto",l&&l(Z,ye)}),be=H(Z=>{Z.style[k]=`${L()}px`,d&&d(Z)}),ae=H(E),ge=H(Z=>{const ye=L(),{duration:Se,easing:X}=mc({style:S,timeout:_,easing:a},{mode:"exit"});if(_==="auto"){const ee=N.transitions.getAutoHeightDuration(ye);Z.style.transitionDuration=`${ee}ms`,F.current=ee}else Z.style.transitionDuration=typeof Se=="string"?Se:`${Se}ms`;Z.style[k]=U,Z.style.transitionTimingFunction=X,f&&f(Z)}),le=Z=>{_==="auto"&&R.start(F.current||0,Z),m&&m(W.current,Z)};return Re.jsx(P,Le({in:g,onEnter:$,onEntered:re,onEntering:ie,onExit:be,onExited:ae,onExiting:ge,addEndListener:le,nodeRef:W,timeout:_==="auto"?null:_},w,{children:(Z,ye)=>Re.jsx(eN,Le({as:u,className:Bt(M.root,o,{entered:M.entered,exited:!g&&U==="0px"&&M.hidden}[Z]),style:Le({[Y?"minWidth":"minHeight"]:U},S),ownerState:Le({},x,{state:Z}),ref:G},ye,{children:Re.jsx(tN,{ownerState:Le({},x,{state:Z}),className:M.wrapper,ref:A,children:Re.jsx(nN,{ownerState:Le({},x,{state:Z}),className:M.wrapperInner,children:b})})}))}))});o6.muiSupportAuto=!0;const iN=o6;function rN(e){return sn("MuiPaper",e)}on("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const sN=["className","component","elevation","square","variant"],oN=e=>{const{square:t,elevation:n,variant:s,classes:m}=e,b={root:["root",s,!t&&"rounded",s==="elevation"&&`elevation${n}`]};return rn(b,rN,m)},aN=Mt("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return Le({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&Le({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${In("#fff",q4(t.elevation))}, ${In("#fff",q4(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),lN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiPaper"}),{className:m,component:b="div",elevation:o=1,square:r=!1,variant:u="elevation"}=s,a=It(s,sN),g=Le({},s,{component:b,elevation:o,square:r,variant:u}),c=oN(g);return Re.jsx(aN,Le({as:b,ownerState:g,className:Bt(c.root,m),ref:n},a))}),Jp=lN,a6=Pe.createContext({});function Zp(e){return typeof e=="string"}function Au(e,t,n){return e===void 0||Zp(e)?t:Le({},t,{ownerState:Le({},t.ownerState,n)})}const uN={disableDefaultClasses:!1},cN=Pe.createContext(uN);function hN(e){const{disableDefaultClasses:t}=Pe.useContext(cN);return n=>t?"":e(n)}function l6(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(s=>s.match(/^on[A-Z]/)&&typeof e[s]=="function"&&!t.includes(s)).forEach(s=>{n[s]=e[s]}),n}function u6(e,t,n){return typeof e=="function"?e(t,n):e}function J4(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function c6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:s,externalForwardedProps:m,className:b}=e;if(!t){const h=Bt(n==null?void 0:n.className,b,m==null?void 0:m.className,s==null?void 0:s.className),d=Le({},n==null?void 0:n.style,m==null?void 0:m.style,s==null?void 0:s.style),E=Le({},n,m,s);return h.length>0&&(E.className=h),Object.keys(d).length>0&&(E.style=d),{props:E,internalRef:void 0}}const o=l6(Le({},m,s)),r=J4(s),u=J4(m),a=t(o),g=Bt(a==null?void 0:a.className,n==null?void 0:n.className,b,m==null?void 0:m.className,s==null?void 0:s.className),c=Le({},a==null?void 0:a.style,n==null?void 0:n.style,m==null?void 0:m.style,s==null?void 0:s.style),l=Le({},a,n,u,r);return g.length>0&&(l.className=g),Object.keys(c).length>0&&(l.style=c),{props:l,internalRef:a.ref}}const dN=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Gl(e){var t;const{elementType:n,externalSlotProps:s,ownerState:m,skipResolvingSlotProps:b=!1}=e,o=It(e,dN),r=b?{}:u6(s,m),{props:u,internalRef:a}=c6(Le({},o,{externalSlotProps:r})),g=yi(a,r==null?void 0:r.ref,(t=e.additionalProps)==null?void 0:t.ref);return Au(n,Le({},u,{ref:g}),m)}const fN=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],pN=["component","slots","slotProps"],mN=["component"];function gN(e,t){const{className:n,elementType:s,ownerState:m,externalForwardedProps:b,getSlotOwnerState:o,internalForwardedProps:r}=t,u=It(t,fN),{component:a,slots:g={[e]:void 0},slotProps:c={[e]:void 0}}=b,l=It(b,pN),h=g[e]||s,d=u6(c[e],m),E=c6(Le({className:n},u,{externalForwardedProps:e==="root"?l:void 0,externalSlotProps:d})),{props:{component:f},internalRef:y}=E,S=It(E.props,mN),_=yi(y,d==null?void 0:d.ref,t.ref),P=o?o(S):{},w=Le({},m,P),x=e==="root"?f||a:f,M=Au(h,Le({},e==="root"&&!a&&!g[e]&&r,e!=="root"&&!g[e]&&r,S,x&&{as:x},{ref:_}),w);return Object.keys(P).forEach(N=>{delete M[N]}),[h,M]}function bN(e){return sn("MuiAccordion",e)}const yN=on("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),Yf=yN,vN=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],SN=e=>{const{classes:t,square:n,expanded:s,disabled:m,disableGutters:b}=e;return rn({root:["root",!n&&"rounded",s&&"expanded",m&&"disabled",!b&&"gutters"],region:["region"]},bN,t)},EN=Mt(Jp,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Yf.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Yf.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Yf.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}},({theme:e,ownerState:t})=>Le({},!t.square&&{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},!t.disableGutters&&{[`&.${Yf.expanded}`]:{margin:"16px 0"}})),xN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiAccordion"}),{children:m,className:b,defaultExpanded:o=!1,disabled:r=!1,disableGutters:u=!1,expanded:a,onChange:g,square:c=!1,slots:l={},slotProps:h={},TransitionComponent:d,TransitionProps:E}=s,f=It(s,vN),[y,S]=ud({controlled:a,default:o,name:"Accordion",state:"expanded"}),_=Pe.useCallback(Y=>{S(!y),g&&g(Y,!y)},[y,g,S]),[P,...w]=Pe.Children.toArray(m),x=Pe.useMemo(()=>({expanded:y,disabled:r,disableGutters:u,toggle:_}),[y,r,u,_]),M=Le({},s,{square:c,disabled:r,disableGutters:u,expanded:y}),N=SN(M),R=Le({transition:d},l),A=Le({transition:E},h),[F,U]=gN("transition",{elementType:iN,externalForwardedProps:{slots:R,slotProps:A},ownerState:M});return delete U.ownerState,Re.jsxs(EN,Le({className:Bt(N.root,b),ref:n,ownerState:M,square:c},f,{children:[Re.jsx(a6.Provider,{value:x,children:P}),Re.jsx(F,Le({in:y,timeout:"auto"},U,{children:Re.jsx("div",{"aria-labelledby":P.props.id,id:P.props["aria-controls"],role:"region",className:N.region,children:w})}))]}))}),Wu=xN;function wN(e){return sn("MuiAccordionDetails",e)}on("MuiAccordionDetails",["root"]);const _N=["className"],TN=e=>{const{classes:t}=e;return rn({root:["root"]},wN,t)},PN=Mt("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(1,2,2)})),MN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiAccordionDetails"}),{className:m}=s,b=It(s,_N),o=s,r=TN(o);return Re.jsx(PN,Le({className:Bt(r.root,m),ref:n,ownerState:o},b))}),zu=MN;function CN(e){const{className:t,classes:n,pulsate:s=!1,rippleX:m,rippleY:b,rippleSize:o,in:r,onExited:u,timeout:a}=e,[g,c]=Pe.useState(!1),l=Bt(t,n.ripple,n.rippleVisible,s&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+b,left:-(o/2)+m},d=Bt(n.child,g&&n.childLeaving,s&&n.childPulsate);return!r&&!g&&c(!0),Pe.useEffect(()=>{if(!r&&u!=null){const E=setTimeout(u,a);return()=>{clearTimeout(E)}}},[u,r,a]),Re.jsx("span",{className:l,style:h,children:Re.jsx("span",{className:d})})}const ms=on("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),LN=["center","classes","className"];let om=e=>e,Z4,eS,tS,nS;const A2=550,AN=80,RN=Id(Z4||(Z4=om` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),IN=Id(eS||(eS=om` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),NN=Id(tS||(tS=om` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),kN=Mt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),ON=Mt(CN,{name:"MuiTouchRipple",slot:"Ripple"})(nS||(nS=om` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),ms.rippleVisible,RN,A2,({theme:e})=>e.transitions.easing.easeInOut,ms.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,ms.child,ms.childLeaving,IN,A2,({theme:e})=>e.transitions.easing.easeInOut,ms.childPulsate,NN,({theme:e})=>e.transitions.easing.easeInOut),FN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTouchRipple"}),{center:m=!1,classes:b={},className:o}=s,r=It(s,LN),[u,a]=Pe.useState([]),g=Pe.useRef(0),c=Pe.useRef(null);Pe.useEffect(()=>{c.current&&(c.current(),c.current=null)},[u]);const l=Pe.useRef(!1),h=vl(),d=Pe.useRef(null),E=Pe.useRef(null),f=Pe.useCallback(P=>{const{pulsate:w,rippleX:x,rippleY:M,rippleSize:N,cb:R}=P;a(A=>[...A,Re.jsx(ON,{classes:{ripple:Bt(b.ripple,ms.ripple),rippleVisible:Bt(b.rippleVisible,ms.rippleVisible),ripplePulsate:Bt(b.ripplePulsate,ms.ripplePulsate),child:Bt(b.child,ms.child),childLeaving:Bt(b.childLeaving,ms.childLeaving),childPulsate:Bt(b.childPulsate,ms.childPulsate)},timeout:A2,pulsate:w,rippleX:x,rippleY:M,rippleSize:N},g.current)]),g.current+=1,c.current=R},[b]),y=Pe.useCallback((P={},w={},x=()=>{})=>{const{pulsate:M=!1,center:N=m||w.pulsate,fakeElement:R=!1}=w;if((P==null?void 0:P.type)==="mousedown"&&l.current){l.current=!1;return}(P==null?void 0:P.type)==="touchstart"&&(l.current=!0);const A=R?null:E.current,F=A?A.getBoundingClientRect():{width:0,height:0,left:0,top:0};let U,Y,k;if(N||P===void 0||P.clientX===0&&P.clientY===0||!P.clientX&&!P.touches)U=Math.round(F.width/2),Y=Math.round(F.height/2);else{const{clientX:W,clientY:G}=P.touches&&P.touches.length>0?P.touches[0]:P;U=Math.round(W-F.left),Y=Math.round(G-F.top)}if(N)k=Math.sqrt((2*F.width**2+F.height**2)/3),k%2===0&&(k+=1);else{const W=Math.max(Math.abs((A?A.clientWidth:0)-U),U)*2+2,G=Math.max(Math.abs((A?A.clientHeight:0)-Y),Y)*2+2;k=Math.sqrt(W**2+G**2)}P!=null&&P.touches?d.current===null&&(d.current=()=>{f({pulsate:M,rippleX:U,rippleY:Y,rippleSize:k,cb:x})},h.start(AN,()=>{d.current&&(d.current(),d.current=null)})):f({pulsate:M,rippleX:U,rippleY:Y,rippleSize:k,cb:x})},[m,f,h]),S=Pe.useCallback(()=>{y({},{pulsate:!0})},[y]),_=Pe.useCallback((P,w)=>{if(h.clear(),(P==null?void 0:P.type)==="touchend"&&d.current){d.current(),d.current=null,h.start(0,()=>{_(P,w)});return}d.current=null,a(x=>x.length>0?x.slice(1):x),c.current=w},[h]);return Pe.useImperativeHandle(n,()=>({pulsate:S,start:y,stop:_}),[S,y,_]),Re.jsx(kN,Le({className:Bt(ms.root,b.root,o),ref:E},r,{children:Re.jsx(qI,{component:null,exit:!0,children:u})}))}),BN=FN;function DN(e){return sn("MuiButtonBase",e)}const VN=on("MuiButtonBase",["root","disabled","focusVisible"]),GN=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],WN=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:s,classes:m}=e,o=rn({root:["root",t&&"disabled",n&&"focusVisible"]},DN,m);return n&&s&&(o.root+=` ${s}`),o},zN=Mt("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${VN.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),UN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiButtonBase"}),{action:m,centerRipple:b=!1,children:o,className:r,component:u="button",disabled:a=!1,disableRipple:g=!1,disableTouchRipple:c=!1,focusRipple:l=!1,LinkComponent:h="a",onBlur:d,onClick:E,onContextMenu:f,onDragLeave:y,onFocus:S,onFocusVisible:_,onKeyDown:P,onKeyUp:w,onMouseDown:x,onMouseLeave:M,onMouseUp:N,onTouchEnd:R,onTouchMove:A,onTouchStart:F,tabIndex:U=0,TouchRippleProps:Y,touchRippleRef:k,type:W}=s,G=It(s,GN),H=Pe.useRef(null),L=Pe.useRef(null),$=yi(L,k),{isFocusVisibleRef:ie,onFocus:re,onBlur:be,ref:ae}=Xb(),[ge,le]=Pe.useState(!1);a&&ge&&le(!1),Pe.useImperativeHandle(m,()=>({focusVisible:()=>{le(!0),H.current.focus()}}),[]);const[Z,ye]=Pe.useState(!1);Pe.useEffect(()=>{ye(!0)},[]);const Se=Z&&!g&&!a;Pe.useEffect(()=>{ge&&l&&!g&&Z&&L.current.pulsate()},[g,l,ge,Z]);function X(Je,it,ht=c){return Yo(vt=>(it&&it(vt),!ht&&L.current&&L.current[Je](vt),!0))}const ee=X("start",x),ne=X("stop",f),O=X("stop",y),z=X("stop",N),K=X("stop",Je=>{ge&&Je.preventDefault(),M&&M(Je)}),q=X("start",F),de=X("stop",R),ue=X("stop",A),ce=X("stop",Je=>{be(Je),ie.current===!1&&le(!1),d&&d(Je)},!1),pe=Yo(Je=>{H.current||(H.current=Je.currentTarget),re(Je),ie.current===!0&&(le(!0),_&&_(Je)),S&&S(Je)}),we=()=>{const Je=H.current;return u&&u!=="button"&&!(Je.tagName==="A"&&Je.href)},Me=Pe.useRef(!1),ze=Yo(Je=>{l&&!Me.current&&ge&&L.current&&Je.key===" "&&(Me.current=!0,L.current.stop(Je,()=>{L.current.start(Je)})),Je.target===Je.currentTarget&&we()&&Je.key===" "&&Je.preventDefault(),P&&P(Je),Je.target===Je.currentTarget&&we()&&Je.key==="Enter"&&!a&&(Je.preventDefault(),E&&E(Je))}),De=Yo(Je=>{l&&Je.key===" "&&L.current&&ge&&!Je.defaultPrevented&&(Me.current=!1,L.current.stop(Je,()=>{L.current.pulsate(Je)})),w&&w(Je),E&&Je.target===Je.currentTarget&&we()&&Je.key===" "&&!Je.defaultPrevented&&E(Je)});let Qe=u;Qe==="button"&&(G.href||G.to)&&(Qe=h);const ke={};Qe==="button"?(ke.type=W===void 0?"button":W,ke.disabled=a):(!G.href&&!G.to&&(ke.role="button"),a&&(ke["aria-disabled"]=a));const We=yi(n,ae,H),qe=Le({},s,{centerRipple:b,component:u,disabled:a,disableRipple:g,disableTouchRipple:c,focusRipple:l,tabIndex:U,focusVisible:ge}),Ye=WN(qe);return Re.jsxs(zN,Le({as:Qe,className:Bt(Ye.root,r),ownerState:qe,onBlur:ce,onClick:E,onContextMenu:ne,onFocus:pe,onKeyDown:ze,onKeyUp:De,onMouseDown:ee,onMouseLeave:K,onMouseUp:z,onDragLeave:O,onTouchEnd:de,onTouchMove:ue,onTouchStart:q,ref:We,tabIndex:a?-1:U,type:W},ke,G,{children:[o,Se?Re.jsx(BN,Le({ref:$,center:b},Y)):null]}))}),gc=UN;function $N(e){return sn("MuiAccordionSummary",e)}const jN=on("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),Ru=jN,HN=["children","className","expandIcon","focusVisibleClassName","onClick"],XN=e=>{const{classes:t,expanded:n,disabled:s,disableGutters:m}=e;return rn({root:["root",n&&"expanded",s&&"disabled",!m&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!m&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},$N,t)},YN=Mt(gc,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{const n={duration:e.transitions.duration.shortest};return Le({display:"flex",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],n),[`&.${Ru.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ru.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${Ru.disabled})`]:{cursor:"pointer"}},!t.disableGutters&&{[`&.${Ru.expanded}`]:{minHeight:64}})}),KN=Mt("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(({theme:e,ownerState:t})=>Le({display:"flex",flexGrow:1,margin:"12px 0"},!t.disableGutters&&{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${Ru.expanded}`]:{margin:"20px 0"}})),qN=Mt("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${Ru.expanded}`]:{transform:"rotate(180deg)"}})),QN=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiAccordionSummary"}),{children:m,className:b,expandIcon:o,focusVisibleClassName:r,onClick:u}=s,a=It(s,HN),{disabled:g=!1,disableGutters:c,expanded:l,toggle:h}=Pe.useContext(a6),d=y=>{h&&h(y),u&&u(y)},E=Le({},s,{expanded:l,disabled:g,disableGutters:c}),f=XN(E);return Re.jsxs(YN,Le({focusRipple:!1,disableRipple:!0,disabled:g,component:"div","aria-expanded":l,className:Bt(f.root,b),focusVisibleClassName:Bt(f.focusVisible,r),onClick:d,ref:n,ownerState:E},a,{children:[Re.jsx(KN,{className:f.content,ownerState:E,children:m}),o&&Re.jsx(qN,{className:f.expandIconWrapper,ownerState:E,children:o})]}))}),Uu=QN;function JN(e){return sn("MuiIconButton",e)}const ZN=on("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),ek=["edge","children","className","color","disabled","disableFocusRipple","size"],tk=e=>{const{classes:t,disabled:n,color:s,edge:m,size:b}=e,o={root:["root",n&&"disabled",s!=="default"&&`color${wt(s)}`,m&&`edge${wt(m)}`,`size${wt(b)}`]};return rn(o,JN,t)},nk=Mt(gc,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${wt(n.color)}`],n.edge&&t[`edge${wt(n.edge)}`],t[`size${wt(n.size)}`]]}})(({theme:e,ownerState:t})=>Le({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var n;const s=(n=(e.vars||e).palette)==null?void 0:n[t.color];return Le({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&Le({color:s==null?void 0:s.main},!t.disableRipple&&{"&:hover":Le({},s&&{backgroundColor:e.vars?`rgba(${s.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:In(s.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${ZN.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),ik=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiIconButton"}),{edge:m=!1,children:b,className:o,color:r="default",disabled:u=!1,disableFocusRipple:a=!1,size:g="medium"}=s,c=It(s,ek),l=Le({},s,{edge:m,color:r,disabled:u,disableFocusRipple:a,size:g}),h=tk(l);return Re.jsx(nk,Le({className:Bt(h.root,o),centerRipple:!0,focusRipple:!a,disabled:u,ref:n,ownerState:l},c,{children:b}))}),rk=ik;function sk(e){return sn("MuiTypography",e)}on("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const ok=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],ak=e=>{const{align:t,gutterBottom:n,noWrap:s,paragraph:m,variant:b,classes:o}=e,r={root:["root",b,e.align!=="inherit"&&`align${wt(t)}`,n&&"gutterBottom",s&&"noWrap",m&&"paragraph"]};return rn(r,sk,o)},lk=Mt("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${wt(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>Le({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),iS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},uk={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},ck=e=>uk[e]||e,hk=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTypography"}),m=ck(s.color),b=Zx(Le({},s,{color:m})),{align:o="inherit",className:r,component:u,gutterBottom:a=!1,noWrap:g=!1,paragraph:c=!1,variant:l="body1",variantMapping:h=iS}=b,d=It(b,ok),E=Le({},b,{align:o,color:m,className:r,component:u,gutterBottom:a,noWrap:g,paragraph:c,variant:l,variantMapping:h}),f=u||(c?"p":h[l]||iS[l])||"span",y=ak(E);return Re.jsx(lk,Le({as:f,ref:n,ownerState:E,className:Bt(y.root,r)},d))}),ti=hk,h6="base";function dk(e){return`${h6}--${e}`}function fk(e,t){return`${h6}-${e}-${t}`}function d6(e,t){const n=Kx[t];return n?dk(n):fk(e,t)}function pk(e,t){const n={};return t.forEach(s=>{n[s]=d6(e,s)}),n}const mk=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function gk(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function bk(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=s=>e.ownerDocument.querySelector(`input[type="radio"]${s}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function yk(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||bk(e))}function vk(e){const t=[],n=[];return Array.from(e.querySelectorAll(mk)).forEach((s,m)=>{const b=gk(s);b===-1||!yk(s)||(b===0?t.push(s):n.push({documentOrder:m,tabIndex:b,node:s}))}),n.sort((s,m)=>s.tabIndex===m.tabIndex?s.documentOrder-m.documentOrder:s.tabIndex-m.tabIndex).map(s=>s.node).concat(t)}function Sk(){return!0}function Ek(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:s=!1,disableRestoreFocus:m=!1,getTabbable:b=vk,isEnabled:o=Sk,open:r}=e,u=Pe.useRef(!1),a=Pe.useRef(null),g=Pe.useRef(null),c=Pe.useRef(null),l=Pe.useRef(null),h=Pe.useRef(!1),d=Pe.useRef(null),E=yi(t.ref,d),f=Pe.useRef(null);Pe.useEffect(()=>{!r||!d.current||(h.current=!n)},[n,r]),Pe.useEffect(()=>{if(!r||!d.current)return;const _=Qi(d.current);return d.current.contains(_.activeElement)||(d.current.hasAttribute("tabIndex")||d.current.setAttribute("tabIndex","-1"),h.current&&d.current.focus()),()=>{m||(c.current&&c.current.focus&&(u.current=!0,c.current.focus()),c.current=null)}},[r]),Pe.useEffect(()=>{if(!r||!d.current)return;const _=Qi(d.current),P=M=>{f.current=M,!(s||!o()||M.key!=="Tab")&&_.activeElement===d.current&&M.shiftKey&&(u.current=!0,g.current&&g.current.focus())},w=()=>{const M=d.current;if(M===null)return;if(!_.hasFocus()||!o()||u.current){u.current=!1;return}if(M.contains(_.activeElement)||s&&_.activeElement!==a.current&&_.activeElement!==g.current)return;if(_.activeElement!==l.current)l.current=null;else if(l.current!==null)return;if(!h.current)return;let N=[];if((_.activeElement===a.current||_.activeElement===g.current)&&(N=b(d.current)),N.length>0){var R,A;const F=!!((R=f.current)!=null&&R.shiftKey&&((A=f.current)==null?void 0:A.key)==="Tab"),U=N[0],Y=N[N.length-1];typeof U!="string"&&typeof Y!="string"&&(F?Y.focus():U.focus())}else M.focus()};_.addEventListener("focusin",w),_.addEventListener("keydown",P,!0);const x=setInterval(()=>{_.activeElement&&_.activeElement.tagName==="BODY"&&w()},50);return()=>{clearInterval(x),_.removeEventListener("focusin",w),_.removeEventListener("keydown",P,!0)}},[n,s,m,o,r,b]);const y=_=>{c.current===null&&(c.current=_.relatedTarget),h.current=!0,l.current=_.target;const P=t.props.onFocus;P&&P(_)},S=_=>{c.current===null&&(c.current=_.relatedTarget),h.current=!0};return Re.jsxs(Pe.Fragment,{children:[Re.jsx("div",{tabIndex:r?0:-1,onFocus:S,ref:a,"data-testid":"sentinelStart"}),Pe.cloneElement(t,{ref:E,onFocus:y}),Re.jsx("div",{tabIndex:r?0:-1,onFocus:S,ref:g,"data-testid":"sentinelEnd"})]})}function xk(e){return typeof e=="function"?e():e}const f6=Pe.forwardRef(function(t,n){const{children:s,container:m,disablePortal:b=!1}=t,[o,r]=Pe.useState(null),u=yi(Pe.isValidElement(s)?s.ref:null,n);if(_o(()=>{b||r(xk(m)||document.body)},[m,b]),_o(()=>{if(o&&!b)return Kp(n,o),()=>{Kp(n,null)}},[n,o,b]),b){if(Pe.isValidElement(s)){const a={ref:u};return Pe.cloneElement(s,a)}return Re.jsx(Pe.Fragment,{children:s})}return Re.jsx(Pe.Fragment,{children:o&&E1.createPortal(s,o)})});function wk(e){const t=Qi(e);return t.body===e?Ya(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Fh(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function rS(e){return parseInt(Ya(e).getComputedStyle(e).paddingRight,10)||0}function _k(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,s=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||s}function sS(e,t,n,s,m){const b=[t,n,...s];[].forEach.call(e.children,o=>{const r=b.indexOf(o)===-1,u=!_k(o);r&&u&&Fh(o,m)})}function ag(e,t){let n=-1;return e.some((s,m)=>t(s)?(n=m,!0):!1),n}function Tk(e,t){const n=[],s=e.container;if(!t.disableScrollLock){if(wk(s)){const o=Xx(Qi(s));n.push({value:s.style.paddingRight,property:"padding-right",el:s}),s.style.paddingRight=`${rS(s)+o}px`;const r=Qi(s).querySelectorAll(".mui-fixed");[].forEach.call(r,u=>{n.push({value:u.style.paddingRight,property:"padding-right",el:u}),u.style.paddingRight=`${rS(u)+o}px`})}let b;if(s.parentNode instanceof DocumentFragment)b=Qi(s).body;else{const o=s.parentElement,r=Ya(s);b=(o==null?void 0:o.nodeName)==="HTML"&&r.getComputedStyle(o).overflowY==="scroll"?o:s}n.push({value:b.style.overflow,property:"overflow",el:b},{value:b.style.overflowX,property:"overflow-x",el:b},{value:b.style.overflowY,property:"overflow-y",el:b}),b.style.overflow="hidden"}return()=>{n.forEach(({value:b,el:o,property:r})=>{b?o.style.setProperty(r,b):o.style.removeProperty(r)})}}function Pk(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Mk{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let s=this.modals.indexOf(t);if(s!==-1)return s;s=this.modals.length,this.modals.push(t),t.modalRef&&Fh(t.modalRef,!1);const m=Pk(n);sS(n,t.mount,t.modalRef,m,!0);const b=ag(this.containers,o=>o.container===n);return b!==-1?(this.containers[b].modals.push(t),s):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:m}),s)}mount(t,n){const s=ag(this.containers,b=>b.modals.indexOf(t)!==-1),m=this.containers[s];m.restore||(m.restore=Tk(m,n))}remove(t,n=!0){const s=this.modals.indexOf(t);if(s===-1)return s;const m=ag(this.containers,o=>o.modals.indexOf(t)!==-1),b=this.containers[m];if(b.modals.splice(b.modals.indexOf(t),1),this.modals.splice(s,1),b.modals.length===0)b.restore&&b.restore(),t.modalRef&&Fh(t.modalRef,n),sS(b.container,t.mount,t.modalRef,b.hiddenSiblings,!1),this.containers.splice(m,1);else{const o=b.modals[b.modals.length-1];o.modalRef&&Fh(o.modalRef,!1)}return s}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function Ck(e){return typeof e=="function"?e():e}function Lk(e){return e?e.props.hasOwnProperty("in"):!1}const Ak=new Mk;function Rk(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:s=!1,manager:m=Ak,closeAfterTransition:b=!1,onTransitionEnter:o,onTransitionExited:r,children:u,onClose:a,open:g,rootRef:c}=e,l=Pe.useRef({}),h=Pe.useRef(null),d=Pe.useRef(null),E=yi(d,c),[f,y]=Pe.useState(!g),S=Lk(u);let _=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(_=!1);const P=()=>Qi(h.current),w=()=>(l.current.modalRef=d.current,l.current.mount=h.current,l.current),x=()=>{m.mount(w(),{disableScrollLock:s}),d.current&&(d.current.scrollTop=0)},M=Yo(()=>{const G=Ck(t)||P().body;m.add(w(),G),d.current&&x()}),N=Pe.useCallback(()=>m.isTopModal(w()),[m]),R=Yo(G=>{h.current=G,G&&(g&&N()?x():d.current&&Fh(d.current,_))}),A=Pe.useCallback(()=>{m.remove(w(),_)},[_,m]);Pe.useEffect(()=>()=>{A()},[A]),Pe.useEffect(()=>{g?M():(!S||!b)&&A()},[g,A,S,b,M]);const F=G=>H=>{var L;(L=G.onKeyDown)==null||L.call(G,H),!(H.key!=="Escape"||H.which===229||!N())&&(n||(H.stopPropagation(),a&&a(H,"escapeKeyDown")))},U=G=>H=>{var L;(L=G.onClick)==null||L.call(G,H),H.target===H.currentTarget&&a&&a(H,"backdropClick")};return{getRootProps:(G={})=>{const H=l6(e);delete H.onTransitionEnter,delete H.onTransitionExited;const L=Le({},H,G);return Le({role:"presentation"},L,{onKeyDown:F(L),ref:E})},getBackdropProps:(G={})=>{const H=G;return Le({"aria-hidden":!0},H,{onClick:U(H),open:g})},getTransitionProps:()=>{const G=()=>{y(!1),o&&o()},H=()=>{y(!0),r&&r(),b&&A()};return{onEnter:T2(G,u==null?void 0:u.props.onEnter),onExited:T2(H,u==null?void 0:u.props.onExited)}},rootRef:E,portalRef:R,isTopModal:N,exited:f,hasTransition:S}}var kr="top",Ps="bottom",Ms="right",Or="left",sy="auto",Fd=[kr,Ps,Ms,Or],bc="start",cd="end",Ik="clippingParents",p6="viewport",hh="popper",Nk="reference",oS=Fd.reduce(function(e,t){return e.concat([t+"-"+bc,t+"-"+cd])},[]),m6=[].concat(Fd,[sy]).reduce(function(e,t){return e.concat([t,t+"-"+bc,t+"-"+cd])},[]),kk="beforeRead",Ok="read",Fk="afterRead",Bk="beforeMain",Dk="main",Vk="afterMain",Gk="beforeWrite",Wk="write",zk="afterWrite",Uk=[kk,Ok,Fk,Bk,Dk,Vk,Gk,Wk,zk];function To(e){return e?(e.nodeName||"").toLowerCase():null}function Zr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wl(e){var t=Zr(e).Element;return e instanceof t||e instanceof Element}function xs(e){var t=Zr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function oy(e){if(typeof ShadowRoot>"u")return!1;var t=Zr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $k(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},m=t.attributes[n]||{},b=t.elements[n];!xs(b)||!To(b)||(Object.assign(b.style,s),Object.keys(m).forEach(function(o){var r=m[o];r===!1?b.removeAttribute(o):b.setAttribute(o,r===!0?"":r)}))})}function jk(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var m=t.elements[s],b=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),r=o.reduce(function(u,a){return u[a]="",u},{});!xs(m)||!To(m)||(Object.assign(m.style,r),Object.keys(b).forEach(function(u){m.removeAttribute(u)}))})}}const Hk={name:"applyStyles",enabled:!0,phase:"write",fn:$k,effect:jk,requires:["computeStyles"]};function wo(e){return e.split("-")[0]}var Il=Math.max,e1=Math.min,yc=Math.round;function R2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function g6(){return!/^((?!chrome|android).)*safari/i.test(R2())}function vc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),m=1,b=1;t&&xs(e)&&(m=e.offsetWidth>0&&yc(s.width)/e.offsetWidth||1,b=e.offsetHeight>0&&yc(s.height)/e.offsetHeight||1);var o=Wl(e)?Zr(e):window,r=o.visualViewport,u=!g6()&&n,a=(s.left+(u&&r?r.offsetLeft:0))/m,g=(s.top+(u&&r?r.offsetTop:0))/b,c=s.width/m,l=s.height/b;return{width:c,height:l,top:g,right:a+c,bottom:g+l,left:a,x:a,y:g}}function ay(e){var t=vc(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function b6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&oy(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function ta(e){return Zr(e).getComputedStyle(e)}function Xk(e){return["table","td","th"].indexOf(To(e))>=0}function Ja(e){return((Wl(e)?e.ownerDocument:e.document)||window.document).documentElement}function am(e){return To(e)==="html"?e:e.assignedSlot||e.parentNode||(oy(e)?e.host:null)||Ja(e)}function aS(e){return!xs(e)||ta(e).position==="fixed"?null:e.offsetParent}function Yk(e){var t=/firefox/i.test(R2()),n=/Trident/i.test(R2());if(n&&xs(e)){var s=ta(e);if(s.position==="fixed")return null}var m=am(e);for(oy(m)&&(m=m.host);xs(m)&&["html","body"].indexOf(To(m))<0;){var b=ta(m);if(b.transform!=="none"||b.perspective!=="none"||b.contain==="paint"||["transform","perspective"].indexOf(b.willChange)!==-1||t&&b.willChange==="filter"||t&&b.filter&&b.filter!=="none")return m;m=m.parentNode}return null}function Bd(e){for(var t=Zr(e),n=aS(e);n&&Xk(n)&&ta(n).position==="static";)n=aS(n);return n&&(To(n)==="html"||To(n)==="body"&&ta(n).position==="static")?t:n||Yk(e)||t}function ly(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bh(e,t,n){return Il(e,e1(t,n))}function Kk(e,t,n){var s=Bh(e,t,n);return s>n?n:s}function y6(){return{top:0,right:0,bottom:0,left:0}}function v6(e){return Object.assign({},y6(),e)}function S6(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var qk=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,v6(typeof t!="number"?t:S6(t,Fd))};function Qk(e){var t,n=e.state,s=e.name,m=e.options,b=n.elements.arrow,o=n.modifiersData.popperOffsets,r=wo(n.placement),u=ly(r),a=[Or,Ms].indexOf(r)>=0,g=a?"height":"width";if(!(!b||!o)){var c=qk(m.padding,n),l=ay(b),h=u==="y"?kr:Or,d=u==="y"?Ps:Ms,E=n.rects.reference[g]+n.rects.reference[u]-o[u]-n.rects.popper[g],f=o[u]-n.rects.reference[u],y=Bd(b),S=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,_=E/2-f/2,P=c[h],w=S-l[g]-c[d],x=S/2-l[g]/2+_,M=Bh(P,x,w),N=u;n.modifiersData[s]=(t={},t[N]=M,t.centerOffset=M-x,t)}}function Jk(e){var t=e.state,n=e.options,s=n.element,m=s===void 0?"[data-popper-arrow]":s;m!=null&&(typeof m=="string"&&(m=t.elements.popper.querySelector(m),!m)||b6(t.elements.popper,m)&&(t.elements.arrow=m))}const Zk={name:"arrow",enabled:!0,phase:"main",fn:Qk,effect:Jk,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sc(e){return e.split("-")[1]}var eO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tO(e,t){var n=e.x,s=e.y,m=t.devicePixelRatio||1;return{x:yc(n*m)/m||0,y:yc(s*m)/m||0}}function lS(e){var t,n=e.popper,s=e.popperRect,m=e.placement,b=e.variation,o=e.offsets,r=e.position,u=e.gpuAcceleration,a=e.adaptive,g=e.roundOffsets,c=e.isFixed,l=o.x,h=l===void 0?0:l,d=o.y,E=d===void 0?0:d,f=typeof g=="function"?g({x:h,y:E}):{x:h,y:E};h=f.x,E=f.y;var y=o.hasOwnProperty("x"),S=o.hasOwnProperty("y"),_=Or,P=kr,w=window;if(a){var x=Bd(n),M="clientHeight",N="clientWidth";if(x===Zr(n)&&(x=Ja(n),ta(x).position!=="static"&&r==="absolute"&&(M="scrollHeight",N="scrollWidth")),x=x,m===kr||(m===Or||m===Ms)&&b===cd){P=Ps;var R=c&&x===w&&w.visualViewport?w.visualViewport.height:x[M];E-=R-s.height,E*=u?1:-1}if(m===Or||(m===kr||m===Ps)&&b===cd){_=Ms;var A=c&&x===w&&w.visualViewport?w.visualViewport.width:x[N];h-=A-s.width,h*=u?1:-1}}var F=Object.assign({position:r},a&&eO),U=g===!0?tO({x:h,y:E},Zr(n)):{x:h,y:E};if(h=U.x,E=U.y,u){var Y;return Object.assign({},F,(Y={},Y[P]=S?"0":"",Y[_]=y?"0":"",Y.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+E+"px)":"translate3d("+h+"px, "+E+"px, 0)",Y))}return Object.assign({},F,(t={},t[P]=S?E+"px":"",t[_]=y?h+"px":"",t.transform="",t))}function nO(e){var t=e.state,n=e.options,s=n.gpuAcceleration,m=s===void 0?!0:s,b=n.adaptive,o=b===void 0?!0:b,r=n.roundOffsets,u=r===void 0?!0:r,a={placement:wo(t.placement),variation:Sc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:m,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lS(Object.assign({},a,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lS(Object.assign({},a,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const iO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:nO,data:{}};var Kf={passive:!0};function rO(e){var t=e.state,n=e.instance,s=e.options,m=s.scroll,b=m===void 0?!0:m,o=s.resize,r=o===void 0?!0:o,u=Zr(t.elements.popper),a=[].concat(t.scrollParents.reference,t.scrollParents.popper);return b&&a.forEach(function(g){g.addEventListener("scroll",n.update,Kf)}),r&&u.addEventListener("resize",n.update,Kf),function(){b&&a.forEach(function(g){g.removeEventListener("scroll",n.update,Kf)}),r&&u.removeEventListener("resize",n.update,Kf)}}const sO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rO,data:{}};var oO={left:"right",right:"left",bottom:"top",top:"bottom"};function Sp(e){return e.replace(/left|right|bottom|top/g,function(t){return oO[t]})}var aO={start:"end",end:"start"};function uS(e){return e.replace(/start|end/g,function(t){return aO[t]})}function uy(e){var t=Zr(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function cy(e){return vc(Ja(e)).left+uy(e).scrollLeft}function lO(e,t){var n=Zr(e),s=Ja(e),m=n.visualViewport,b=s.clientWidth,o=s.clientHeight,r=0,u=0;if(m){b=m.width,o=m.height;var a=g6();(a||!a&&t==="fixed")&&(r=m.offsetLeft,u=m.offsetTop)}return{width:b,height:o,x:r+cy(e),y:u}}function uO(e){var t,n=Ja(e),s=uy(e),m=(t=e.ownerDocument)==null?void 0:t.body,b=Il(n.scrollWidth,n.clientWidth,m?m.scrollWidth:0,m?m.clientWidth:0),o=Il(n.scrollHeight,n.clientHeight,m?m.scrollHeight:0,m?m.clientHeight:0),r=-s.scrollLeft+cy(e),u=-s.scrollTop;return ta(m||n).direction==="rtl"&&(r+=Il(n.clientWidth,m?m.clientWidth:0)-b),{width:b,height:o,x:r,y:u}}function hy(e){var t=ta(e),n=t.overflow,s=t.overflowX,m=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+m+s)}function E6(e){return["html","body","#document"].indexOf(To(e))>=0?e.ownerDocument.body:xs(e)&&hy(e)?e:E6(am(e))}function Dh(e,t){var n;t===void 0&&(t=[]);var s=E6(e),m=s===((n=e.ownerDocument)==null?void 0:n.body),b=Zr(s),o=m?[b].concat(b.visualViewport||[],hy(s)?s:[]):s,r=t.concat(o);return m?r:r.concat(Dh(am(o)))}function I2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cO(e,t){var n=vc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function cS(e,t,n){return t===p6?I2(lO(e,n)):Wl(t)?cO(t,n):I2(uO(Ja(e)))}function hO(e){var t=Dh(am(e)),n=["absolute","fixed"].indexOf(ta(e).position)>=0,s=n&&xs(e)?Bd(e):e;return Wl(s)?t.filter(function(m){return Wl(m)&&b6(m,s)&&To(m)!=="body"}):[]}function dO(e,t,n,s){var m=t==="clippingParents"?hO(e):[].concat(t),b=[].concat(m,[n]),o=b[0],r=b.reduce(function(u,a){var g=cS(e,a,s);return u.top=Il(g.top,u.top),u.right=e1(g.right,u.right),u.bottom=e1(g.bottom,u.bottom),u.left=Il(g.left,u.left),u},cS(e,o,s));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function x6(e){var t=e.reference,n=e.element,s=e.placement,m=s?wo(s):null,b=s?Sc(s):null,o=t.x+t.width/2-n.width/2,r=t.y+t.height/2-n.height/2,u;switch(m){case kr:u={x:o,y:t.y-n.height};break;case Ps:u={x:o,y:t.y+t.height};break;case Ms:u={x:t.x+t.width,y:r};break;case Or:u={x:t.x-n.width,y:r};break;default:u={x:t.x,y:t.y}}var a=m?ly(m):null;if(a!=null){var g=a==="y"?"height":"width";switch(b){case bc:u[a]=u[a]-(t[g]/2-n[g]/2);break;case cd:u[a]=u[a]+(t[g]/2-n[g]/2);break}}return u}function hd(e,t){t===void 0&&(t={});var n=t,s=n.placement,m=s===void 0?e.placement:s,b=n.strategy,o=b===void 0?e.strategy:b,r=n.boundary,u=r===void 0?Ik:r,a=n.rootBoundary,g=a===void 0?p6:a,c=n.elementContext,l=c===void 0?hh:c,h=n.altBoundary,d=h===void 0?!1:h,E=n.padding,f=E===void 0?0:E,y=v6(typeof f!="number"?f:S6(f,Fd)),S=l===hh?Nk:hh,_=e.rects.popper,P=e.elements[d?S:l],w=dO(Wl(P)?P:P.contextElement||Ja(e.elements.popper),u,g,o),x=vc(e.elements.reference),M=x6({reference:x,element:_,strategy:"absolute",placement:m}),N=I2(Object.assign({},_,M)),R=l===hh?N:x,A={top:w.top-R.top+y.top,bottom:R.bottom-w.bottom+y.bottom,left:w.left-R.left+y.left,right:R.right-w.right+y.right},F=e.modifiersData.offset;if(l===hh&&F){var U=F[m];Object.keys(A).forEach(function(Y){var k=[Ms,Ps].indexOf(Y)>=0?1:-1,W=[kr,Ps].indexOf(Y)>=0?"y":"x";A[Y]+=U[W]*k})}return A}function fO(e,t){t===void 0&&(t={});var n=t,s=n.placement,m=n.boundary,b=n.rootBoundary,o=n.padding,r=n.flipVariations,u=n.allowedAutoPlacements,a=u===void 0?m6:u,g=Sc(s),c=g?r?oS:oS.filter(function(d){return Sc(d)===g}):Fd,l=c.filter(function(d){return a.indexOf(d)>=0});l.length===0&&(l=c);var h=l.reduce(function(d,E){return d[E]=hd(e,{placement:E,boundary:m,rootBoundary:b,padding:o})[wo(E)],d},{});return Object.keys(h).sort(function(d,E){return h[d]-h[E]})}function pO(e){if(wo(e)===sy)return[];var t=Sp(e);return[uS(e),t,uS(t)]}function mO(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var m=n.mainAxis,b=m===void 0?!0:m,o=n.altAxis,r=o===void 0?!0:o,u=n.fallbackPlacements,a=n.padding,g=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.flipVariations,d=h===void 0?!0:h,E=n.allowedAutoPlacements,f=t.options.placement,y=wo(f),S=y===f,_=u||(S||!d?[Sp(f)]:pO(f)),P=[f].concat(_).reduce(function(ge,le){return ge.concat(wo(le)===sy?fO(t,{placement:le,boundary:g,rootBoundary:c,padding:a,flipVariations:d,allowedAutoPlacements:E}):le)},[]),w=t.rects.reference,x=t.rects.popper,M=new Map,N=!0,R=P[0],A=0;A=0,W=k?"width":"height",G=hd(t,{placement:F,boundary:g,rootBoundary:c,altBoundary:l,padding:a}),H=k?Y?Ms:Or:Y?Ps:kr;w[W]>x[W]&&(H=Sp(H));var L=Sp(H),$=[];if(b&&$.push(G[U]<=0),r&&$.push(G[H]<=0,G[L]<=0),$.every(function(ge){return ge})){R=F,N=!1;break}M.set(F,$)}if(N)for(var ie=d?3:1,re=function(le){var Z=P.find(function(ye){var Se=M.get(ye);if(Se)return Se.slice(0,le).every(function(X){return X})});if(Z)return R=Z,"break"},be=ie;be>0;be--){var ae=re(be);if(ae==="break")break}t.placement!==R&&(t.modifiersData[s]._skip=!0,t.placement=R,t.reset=!0)}}const gO={name:"flip",enabled:!0,phase:"main",fn:mO,requiresIfExists:["offset"],data:{_skip:!1}};function hS(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function dS(e){return[kr,Ms,Ps,Or].some(function(t){return e[t]>=0})}function bO(e){var t=e.state,n=e.name,s=t.rects.reference,m=t.rects.popper,b=t.modifiersData.preventOverflow,o=hd(t,{elementContext:"reference"}),r=hd(t,{altBoundary:!0}),u=hS(o,s),a=hS(r,m,b),g=dS(u),c=dS(a);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:a,isReferenceHidden:g,hasPopperEscaped:c},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":c})}const yO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bO};function vO(e,t,n){var s=wo(e),m=[Or,kr].indexOf(s)>=0?-1:1,b=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=b[0],r=b[1];return o=o||0,r=(r||0)*m,[Or,Ms].indexOf(s)>=0?{x:r,y:o}:{x:o,y:r}}function SO(e){var t=e.state,n=e.options,s=e.name,m=n.offset,b=m===void 0?[0,0]:m,o=m6.reduce(function(g,c){return g[c]=vO(c,t.rects,b),g},{}),r=o[t.placement],u=r.x,a=r.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=a),t.modifiersData[s]=o}const EO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:SO};function xO(e){var t=e.state,n=e.name;t.modifiersData[n]=x6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const wO={name:"popperOffsets",enabled:!0,phase:"read",fn:xO,data:{}};function _O(e){return e==="x"?"y":"x"}function TO(e){var t=e.state,n=e.options,s=e.name,m=n.mainAxis,b=m===void 0?!0:m,o=n.altAxis,r=o===void 0?!1:o,u=n.boundary,a=n.rootBoundary,g=n.altBoundary,c=n.padding,l=n.tether,h=l===void 0?!0:l,d=n.tetherOffset,E=d===void 0?0:d,f=hd(t,{boundary:u,rootBoundary:a,padding:c,altBoundary:g}),y=wo(t.placement),S=Sc(t.placement),_=!S,P=ly(y),w=_O(P),x=t.modifiersData.popperOffsets,M=t.rects.reference,N=t.rects.popper,R=typeof E=="function"?E(Object.assign({},t.rects,{placement:t.placement})):E,A=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(x){if(b){var Y,k=P==="y"?kr:Or,W=P==="y"?Ps:Ms,G=P==="y"?"height":"width",H=x[P],L=H+f[k],$=H-f[W],ie=h?-N[G]/2:0,re=S===bc?M[G]:N[G],be=S===bc?-N[G]:-M[G],ae=t.elements.arrow,ge=h&&ae?ay(ae):{width:0,height:0},le=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:y6(),Z=le[k],ye=le[W],Se=Bh(0,M[G],ge[G]),X=_?M[G]/2-ie-Se-Z-A.mainAxis:re-Se-Z-A.mainAxis,ee=_?-M[G]/2+ie+Se+ye+A.mainAxis:be+Se+ye+A.mainAxis,ne=t.elements.arrow&&Bd(t.elements.arrow),O=ne?P==="y"?ne.clientTop||0:ne.clientLeft||0:0,z=(Y=F==null?void 0:F[P])!=null?Y:0,K=H+X-z-O,q=H+ee-z,de=Bh(h?e1(L,K):L,H,h?Il($,q):$);x[P]=de,U[P]=de-H}if(r){var ue,ce=P==="x"?kr:Or,pe=P==="x"?Ps:Ms,we=x[w],Me=w==="y"?"height":"width",ze=we+f[ce],De=we-f[pe],Qe=[kr,Or].indexOf(y)!==-1,ke=(ue=F==null?void 0:F[w])!=null?ue:0,We=Qe?ze:we-M[Me]-N[Me]-ke+A.altAxis,qe=Qe?we+M[Me]+N[Me]-ke-A.altAxis:De,Ye=h&&Qe?Kk(We,we,qe):Bh(h?We:ze,we,h?qe:De);x[w]=Ye,U[w]=Ye-we}t.modifiersData[s]=U}}const PO={name:"preventOverflow",enabled:!0,phase:"main",fn:TO,requiresIfExists:["offset"]};function MO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function CO(e){return e===Zr(e)||!xs(e)?uy(e):MO(e)}function LO(e){var t=e.getBoundingClientRect(),n=yc(t.width)/e.offsetWidth||1,s=yc(t.height)/e.offsetHeight||1;return n!==1||s!==1}function AO(e,t,n){n===void 0&&(n=!1);var s=xs(t),m=xs(t)&&LO(t),b=Ja(t),o=vc(e,m,n),r={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&((To(t)!=="body"||hy(b))&&(r=CO(t)),xs(t)?(u=vc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):b&&(u.x=cy(b))),{x:o.left+r.scrollLeft-u.x,y:o.top+r.scrollTop-u.y,width:o.width,height:o.height}}function RO(e){var t=new Map,n=new Set,s=[];e.forEach(function(b){t.set(b.name,b)});function m(b){n.add(b.name);var o=[].concat(b.requires||[],b.requiresIfExists||[]);o.forEach(function(r){if(!n.has(r)){var u=t.get(r);u&&m(u)}}),s.push(b)}return e.forEach(function(b){n.has(b.name)||m(b)}),s}function IO(e){var t=RO(e);return Uk.reduce(function(n,s){return n.concat(t.filter(function(m){return m.phase===s}))},[])}function NO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function kO(e){var t=e.reduce(function(n,s){var m=n[s.name];return n[s.name]=m?Object.assign({},m,s,{options:Object.assign({},m.options,s.options),data:Object.assign({},m.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var fS={placement:"bottom",modifiers:[],strategy:"absolute"};function pS(){for(var e=arguments.length,t=new Array(e),n=0;nrn({root:["root"]},hN(DO)),$O={},jO=Pe.forwardRef(function(t,n){var s;const{anchorEl:m,children:b,direction:o,disablePortal:r,modifiers:u,open:a,placement:g,popperOptions:c,popperRef:l,slotProps:h={},slots:d={},TransitionProps:E}=t,f=It(t,VO),y=Pe.useRef(null),S=yi(y,n),_=Pe.useRef(null),P=yi(_,l),w=Pe.useRef(P);_o(()=>{w.current=P},[P]),Pe.useImperativeHandle(l,()=>_.current,[]);const x=WO(g,o),[M,N]=Pe.useState(x),[R,A]=Pe.useState(N2(m));Pe.useEffect(()=>{_.current&&_.current.forceUpdate()}),Pe.useEffect(()=>{m&&A(N2(m))},[m]),_o(()=>{if(!R||!a)return;const W=L=>{N(L.placement)};let G=[{name:"preventOverflow",options:{altBoundary:r}},{name:"flip",options:{altBoundary:r}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:L})=>{W(L)}}];u!=null&&(G=G.concat(u)),c&&c.modifiers!=null&&(G=G.concat(c.modifiers));const H=BO(R,y.current,Le({placement:x},c,{modifiers:G}));return w.current(H),()=>{H.destroy(),w.current(null)}},[R,r,u,a,c,x]);const F={placement:M};E!==null&&(F.TransitionProps=E);const U=UO(),Y=(s=d.root)!=null?s:"div",k=Gl({elementType:Y,externalSlotProps:h.root,externalForwardedProps:f,additionalProps:{role:"tooltip",ref:S},ownerState:t,className:U.root});return Re.jsx(Y,Le({},k,{children:typeof b=="function"?b(F):b}))}),HO=Pe.forwardRef(function(t,n){const{anchorEl:s,children:m,container:b,direction:o="ltr",disablePortal:r=!1,keepMounted:u=!1,modifiers:a,open:g,placement:c="bottom",popperOptions:l=$O,popperRef:h,style:d,transition:E=!1,slotProps:f={},slots:y={}}=t,S=It(t,GO),[_,P]=Pe.useState(!0),w=()=>{P(!1)},x=()=>{P(!0)};if(!u&&!g&&(!E||_))return null;let M;if(b)M=b;else if(s){const A=N2(s);M=A&&zO(A)?Qi(A).body:Qi(null).body}const N=!g&&u&&(!E||_)?"none":void 0,R=E?{in:g,onEnter:w,onExited:x}:void 0;return Re.jsx(f6,{disablePortal:r,container:M,children:Re.jsx(jO,Le({anchorEl:s,direction:o,disablePortal:r,modifiers:a,ref:n,open:E?!_:g,placement:c,popperOptions:l,popperRef:h,slotProps:f,slots:y},S,{style:Le({position:"fixed",top:0,left:0,display:N},d),TransitionProps:R,children:m}))})}),XO=["onChange","maxRows","minRows","style","value"];function qf(e){return parseInt(e,10)||0}const YO={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function mS(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflow}const KO=Pe.forwardRef(function(t,n){const{onChange:s,maxRows:m,minRows:b=1,style:o,value:r}=t,u=It(t,XO),{current:a}=Pe.useRef(r!=null),g=Pe.useRef(null),c=yi(n,g),l=Pe.useRef(null),h=Pe.useRef(0),[d,E]=Pe.useState({outerHeightStyle:0}),f=Pe.useCallback(()=>{const P=g.current,x=Ya(P).getComputedStyle(P);if(x.width==="0px")return{outerHeightStyle:0};const M=l.current;M.style.width=x.width,M.value=P.value||t.placeholder||"x",M.value.slice(-1)===` +`&&(M.value+=" ");const N=x.boxSizing,R=qf(x.paddingBottom)+qf(x.paddingTop),A=qf(x.borderBottomWidth)+qf(x.borderTopWidth),F=M.scrollHeight;M.value="x";const U=M.scrollHeight;let Y=F;b&&(Y=Math.max(Number(b)*U,Y)),m&&(Y=Math.min(Number(m)*U,Y)),Y=Math.max(Y,U);const k=Y+(N==="border-box"?R+A:0),W=Math.abs(Y-F)<=1;return{outerHeightStyle:k,overflow:W}},[m,b,t.placeholder]),y=(P,w)=>{const{outerHeightStyle:x,overflow:M}=w;return h.current<20&&(x>0&&Math.abs((P.outerHeightStyle||0)-x)>1||P.overflow!==M)?(h.current+=1,{overflow:M,outerHeightStyle:x}):P},S=Pe.useCallback(()=>{const P=f();mS(P)||E(w=>y(w,P))},[f]);_o(()=>{const P=()=>{const F=f();mS(F)||E1.flushSync(()=>{E(U=>y(U,F))})},w=()=>{h.current=0,P()};let x;const M=Hb(w),N=g.current,R=Ya(N);R.addEventListener("resize",M);let A;return typeof ResizeObserver<"u"&&(A=new ResizeObserver(w),A.observe(N)),()=>{M.clear(),cancelAnimationFrame(x),R.removeEventListener("resize",M),A&&A.disconnect()}},[f]),_o(()=>{S()}),Pe.useEffect(()=>{h.current=0},[r]);const _=P=>{h.current=0,a||S(),s&&s(P)};return Re.jsxs(Pe.Fragment,{children:[Re.jsx("textarea",Le({value:r,onChange:_,ref:c,rows:b,style:Le({height:d.outerHeightStyle,overflow:d.overflow?"hidden":void 0},o)},u)),Re.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:l,tabIndex:-1,style:Le({},YO.shadow,o,{paddingTop:0,paddingBottom:0})})]})}),qO=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],QO=Mt(HO,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),JO=Pe.forwardRef(function(t,n){var s;const m=Jx(),b=an({props:t,name:"MuiPopper"}),{anchorEl:o,component:r,components:u,componentsProps:a,container:g,disablePortal:c,keepMounted:l,modifiers:h,open:d,placement:E,popperOptions:f,popperRef:y,transition:S,slots:_,slotProps:P}=b,w=It(b,qO),x=(s=_==null?void 0:_.root)!=null?s:u==null?void 0:u.Root,M=Le({anchorEl:o,container:g,disablePortal:c,keepMounted:l,modifiers:h,open:d,placement:E,popperOptions:f,popperRef:y,transition:S},w);return Re.jsx(QO,Le({as:r,direction:m==null?void 0:m.direction,slots:{root:x},slotProps:P??a},M,{ref:n}))}),_6=JO,ZO=ty(Re.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function eF(e){return sn("MuiChip",e)}const tF=on("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),_n=tF,nF=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],iF=e=>{const{classes:t,disabled:n,size:s,color:m,iconColor:b,onDelete:o,clickable:r,variant:u}=e,a={root:["root",u,n&&"disabled",`size${wt(s)}`,`color${wt(m)}`,r&&"clickable",r&&`clickableColor${wt(m)}`,o&&"deletable",o&&`deletableColor${wt(m)}`,`${u}${wt(m)}`],label:["label",`label${wt(s)}`],avatar:["avatar",`avatar${wt(s)}`,`avatarColor${wt(m)}`],icon:["icon",`icon${wt(s)}`,`iconColor${wt(b)}`],deleteIcon:["deleteIcon",`deleteIcon${wt(s)}`,`deleteIconColor${wt(m)}`,`deleteIcon${wt(u)}Color${wt(m)}`]};return rn(a,eF,t)},rF=Mt("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:s,iconColor:m,clickable:b,onDelete:o,size:r,variant:u}=n;return[{[`& .${_n.avatar}`]:t.avatar},{[`& .${_n.avatar}`]:t[`avatar${wt(r)}`]},{[`& .${_n.avatar}`]:t[`avatarColor${wt(s)}`]},{[`& .${_n.icon}`]:t.icon},{[`& .${_n.icon}`]:t[`icon${wt(r)}`]},{[`& .${_n.icon}`]:t[`iconColor${wt(m)}`]},{[`& .${_n.deleteIcon}`]:t.deleteIcon},{[`& .${_n.deleteIcon}`]:t[`deleteIcon${wt(r)}`]},{[`& .${_n.deleteIcon}`]:t[`deleteIconColor${wt(s)}`]},{[`& .${_n.deleteIcon}`]:t[`deleteIcon${wt(u)}Color${wt(s)}`]},t.root,t[`size${wt(r)}`],t[`color${wt(s)}`],b&&t.clickable,b&&s!=="default"&&t[`clickableColor${wt(s)})`],o&&t.deletable,o&&s!=="default"&&t[`deletableColor${wt(s)}`],t[u],t[`${u}${wt(s)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return Le({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${_n.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${_n.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:n,fontSize:e.typography.pxToRem(12)},[`& .${_n.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${_n.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${_n.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${_n.icon}`]:Le({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&Le({color:e.vars?e.vars.palette.Chip.defaultIconColor:n},t.color!=="default"&&{color:"inherit"})),[`& .${_n.deleteIcon}`]:Le({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:In(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:In(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:In(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${_n.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:In(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${_n.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>Le({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:In(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${_n.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:In(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${_n.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>Le({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${_n.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${_n.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${_n.avatar}`]:{marginLeft:4},[`& .${_n.avatarSmall}`]:{marginLeft:2},[`& .${_n.icon}`]:{marginLeft:4},[`& .${_n.iconSmall}`]:{marginLeft:2},[`& .${_n.deleteIcon}`]:{marginRight:5},[`& .${_n.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:In(e.palette[t.color].main,.7)}`,[`&.${_n.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${_n.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:In(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${_n.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:In(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),sF=Mt("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:s}=n;return[t.label,t[`label${wt(s)}`]]}})(({ownerState:e})=>Le({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function gS(e){return e.key==="Backspace"||e.key==="Delete"}const oF=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiChip"}),{avatar:m,className:b,clickable:o,color:r="default",component:u,deleteIcon:a,disabled:g=!1,icon:c,label:l,onClick:h,onDelete:d,onKeyDown:E,onKeyUp:f,size:y="medium",variant:S="filled",tabIndex:_,skipFocusWhenDisabled:P=!1}=s,w=It(s,nF),x=Pe.useRef(null),M=yi(x,n),N=$=>{$.stopPropagation(),d&&d($)},R=$=>{$.currentTarget===$.target&&gS($)&&$.preventDefault(),E&&E($)},A=$=>{$.currentTarget===$.target&&(d&&gS($)?d($):$.key==="Escape"&&x.current&&x.current.blur()),f&&f($)},F=o!==!1&&h?!0:o,U=F||d?gc:u||"div",Y=Le({},s,{component:U,disabled:g,size:y,color:r,iconColor:Pe.isValidElement(c)&&c.props.color||r,onDelete:!!d,clickable:F,variant:S}),k=iF(Y),W=U===gc?Le({component:u||"div",focusVisibleClassName:k.focusVisible},d&&{disableRipple:!0}):{};let G=null;d&&(G=a&&Pe.isValidElement(a)?Pe.cloneElement(a,{className:Bt(a.props.className,k.deleteIcon),onClick:N}):Re.jsx(ZO,{className:Bt(k.deleteIcon),onClick:N}));let H=null;m&&Pe.isValidElement(m)&&(H=Pe.cloneElement(m,{className:Bt(k.avatar,m.props.className)}));let L=null;return c&&Pe.isValidElement(c)&&(L=Pe.cloneElement(c,{className:Bt(k.icon,c.props.className)})),Re.jsxs(rF,Le({as:U,className:Bt(k.root,b),disabled:F&&g?!0:void 0,onClick:h,onKeyDown:R,onKeyUp:A,ref:M,tabIndex:P&&g?-1:_,ownerState:Y},W,w,{children:[H||L,Re.jsx(sF,{className:Bt(k.label),ownerState:Y,children:l}),G]}))}),bS=oF;function Mc({props:e,states:t,muiFormControl:n}){return t.reduce((s,m)=>(s[m]=e[m],n&&typeof e[m]>"u"&&(s[m]=n[m]),s),{})}const aF=Pe.createContext(void 0),dy=aF;function Cc(){return Pe.useContext(dy)}function lF(e){return Re.jsx(XR,Le({},e,{defaultTheme:sm,themeId:x1}))}function yS(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function t1(e,t=!1){return e&&(yS(e.value)&&e.value!==""||t&&yS(e.defaultValue)&&e.defaultValue!=="")}function uF(e){return e.startAdornment}function cF(e){return sn("MuiInputBase",e)}const hF=on("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Ec=hF,dF=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],lm=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${wt(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},um=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},fF=e=>{const{classes:t,color:n,disabled:s,error:m,endAdornment:b,focused:o,formControl:r,fullWidth:u,hiddenLabel:a,multiline:g,readOnly:c,size:l,startAdornment:h,type:d}=e,E={root:["root",`color${wt(n)}`,s&&"disabled",m&&"error",u&&"fullWidth",o&&"focused",r&&"formControl",l&&l!=="medium"&&`size${wt(l)}`,g&&"multiline",h&&"adornedStart",b&&"adornedEnd",a&&"hiddenLabel",c&&"readOnly"],input:["input",s&&"disabled",d==="search"&&"inputTypeSearch",g&&"inputMultiline",l==="small"&&"inputSizeSmall",a&&"inputHiddenLabel",h&&"inputAdornedStart",b&&"inputAdornedEnd",c&&"readOnly"]};return rn(E,cF,t)},cm=Mt("div",{name:"MuiInputBase",slot:"Root",overridesResolver:lm})(({theme:e,ownerState:t})=>Le({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Ec.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&Le({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),hm=Mt("input",{name:"MuiInputBase",slot:"Input",overridesResolver:um})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",s=Le({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),m={opacity:"0 !important"},b=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return Le({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Ec.formControl} &`]:{"&::-webkit-input-placeholder":m,"&::-moz-placeholder":m,"&:-ms-input-placeholder":m,"&::-ms-input-placeholder":m,"&:focus::-webkit-input-placeholder":b,"&:focus::-moz-placeholder":b,"&:focus:-ms-input-placeholder":b,"&:focus::-ms-input-placeholder":b},[`&.${Ec.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),pF=Re.jsx(lF,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),mF=Pe.forwardRef(function(t,n){var s;const m=an({props:t,name:"MuiInputBase"}),{"aria-describedby":b,autoComplete:o,autoFocus:r,className:u,components:a={},componentsProps:g={},defaultValue:c,disabled:l,disableInjectingGlobalStyles:h,endAdornment:d,fullWidth:E=!1,id:f,inputComponent:y="input",inputProps:S={},inputRef:_,maxRows:P,minRows:w,multiline:x=!1,name:M,onBlur:N,onChange:R,onClick:A,onFocus:F,onKeyDown:U,onKeyUp:Y,placeholder:k,readOnly:W,renderSuffix:G,rows:H,slotProps:L={},slots:$={},startAdornment:ie,type:re="text",value:be}=m,ae=It(m,dF),ge=S.value!=null?S.value:be,{current:le}=Pe.useRef(ge!=null),Z=Pe.useRef(),ye=Pe.useCallback(Ye=>{},[]),Se=yi(Z,_,S.ref,ye),[X,ee]=Pe.useState(!1),ne=Cc(),O=Mc({props:m,muiFormControl:ne,states:["color","disabled","error","hiddenLabel","size","required","filled"]});O.focused=ne?ne.focused:X,Pe.useEffect(()=>{!ne&&l&&X&&(ee(!1),N&&N())},[ne,l,X,N]);const z=ne&&ne.onFilled,K=ne&&ne.onEmpty,q=Pe.useCallback(Ye=>{t1(Ye)?z&&z():K&&K()},[z,K]);_o(()=>{le&&q({value:ge})},[ge,q,le]);const de=Ye=>{if(O.disabled){Ye.stopPropagation();return}F&&F(Ye),S.onFocus&&S.onFocus(Ye),ne&&ne.onFocus?ne.onFocus(Ye):ee(!0)},ue=Ye=>{N&&N(Ye),S.onBlur&&S.onBlur(Ye),ne&&ne.onBlur?ne.onBlur(Ye):ee(!1)},ce=(Ye,...Je)=>{if(!le){const it=Ye.target||Z.current;if(it==null)throw new Error(Xa(1));q({value:it.value})}S.onChange&&S.onChange(Ye,...Je),R&&R(Ye,...Je)};Pe.useEffect(()=>{q(Z.current)},[]);const pe=Ye=>{Z.current&&Ye.currentTarget===Ye.target&&Z.current.focus(),A&&A(Ye)};let we=y,Me=S;x&&we==="input"&&(H?Me=Le({type:void 0,minRows:H,maxRows:H},Me):Me=Le({type:void 0,maxRows:P,minRows:w},Me),we=KO);const ze=Ye=>{q(Ye.animationName==="mui-auto-fill-cancel"?Z.current:{value:"x"})};Pe.useEffect(()=>{ne&&ne.setAdornedStart(!!ie)},[ne,ie]);const De=Le({},m,{color:O.color||"primary",disabled:O.disabled,endAdornment:d,error:O.error,focused:O.focused,formControl:ne,fullWidth:E,hiddenLabel:O.hiddenLabel,multiline:x,size:O.size,startAdornment:ie,type:re}),Qe=fF(De),ke=$.root||a.Root||cm,We=L.root||g.root||{},qe=$.input||a.Input||hm;return Me=Le({},Me,(s=L.input)!=null?s:g.input),Re.jsxs(Pe.Fragment,{children:[!h&&pF,Re.jsxs(ke,Le({},We,!Zp(ke)&&{ownerState:Le({},De,We.ownerState)},{ref:n,onClick:pe},ae,{className:Bt(Qe.root,We.className,u,W&&"MuiInputBase-readOnly"),children:[ie,Re.jsx(dy.Provider,{value:null,children:Re.jsx(qe,Le({ownerState:De,"aria-invalid":O.error,"aria-describedby":b,autoComplete:o,autoFocus:r,defaultValue:c,disabled:O.disabled,id:f,onAnimationStart:ze,name:M,placeholder:k,readOnly:W,required:O.required,rows:H,value:ge,onKeyDown:U,onKeyUp:Y,type:re},Me,!Zp(qe)&&{as:we,ownerState:Le({},De,Me.ownerState)},{ref:Se,className:Bt(Qe.input,Me.className,W&&"MuiInputBase-readOnly"),onBlur:ue,onChange:ce,onFocus:de}))}),d,G?G(Le({},O,{startAdornment:ie})):null]}))]})}),fy=mF;function gF(e){return sn("MuiInput",e)}const bF=Le({},Ec,on("MuiInput",["root","underline","input"])),dh=bF;function yF(e){return sn("MuiOutlinedInput",e)}const vF=Le({},Ec,on("MuiOutlinedInput",["root","notchedOutline","input"])),ya=vF;function SF(e){return sn("MuiFilledInput",e)}const EF=Le({},Ec,on("MuiFilledInput",["root","underline","input"])),hl=EF,xF=ty(Re.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),wF=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],_F={entering:{opacity:1},entered:{opacity:1}},TF=Pe.forwardRef(function(t,n){const s=Pc(),m={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{addEndListener:b,appear:o=!0,children:r,easing:u,in:a,onEnter:g,onEntered:c,onEntering:l,onExit:h,onExited:d,onExiting:E,style:f,timeout:y=m,TransitionComponent:S=ny}=t,_=It(t,wF),P=Pe.useRef(null),w=yi(P,r.ref,n),x=k=>W=>{if(k){const G=P.current;W===void 0?k(G):k(G,W)}},M=x(l),N=x((k,W)=>{s6(k);const G=mc({style:f,timeout:y,easing:u},{mode:"enter"});k.style.webkitTransition=s.transitions.create("opacity",G),k.style.transition=s.transitions.create("opacity",G),g&&g(k,W)}),R=x(c),A=x(E),F=x(k=>{const W=mc({style:f,timeout:y,easing:u},{mode:"exit"});k.style.webkitTransition=s.transitions.create("opacity",W),k.style.transition=s.transitions.create("opacity",W),h&&h(k)}),U=x(d),Y=k=>{b&&b(P.current,k)};return Re.jsx(S,Le({appear:o,in:a,nodeRef:P,onEnter:N,onEntered:R,onEntering:M,onExit:F,onExited:U,onExiting:A,addEndListener:Y,timeout:y},_,{children:(k,W)=>Pe.cloneElement(r,Le({style:Le({opacity:0,visibility:k==="exited"&&!a?"hidden":void 0},_F[k],f,r.props.style),ref:w},W))}))}),PF=TF;function MF(e){return sn("MuiBackdrop",e)}on("MuiBackdrop",["root","invisible"]);const CF=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],LF=e=>{const{classes:t,invisible:n}=e;return rn({root:["root",n&&"invisible"]},MF,t)},AF=Mt("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>Le({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),RF=Pe.forwardRef(function(t,n){var s,m,b;const o=an({props:t,name:"MuiBackdrop"}),{children:r,className:u,component:a="div",components:g={},componentsProps:c={},invisible:l=!1,open:h,slotProps:d={},slots:E={},TransitionComponent:f=PF,transitionDuration:y}=o,S=It(o,CF),_=Le({},o,{component:a,invisible:l}),P=LF(_),w=(s=d.root)!=null?s:c.root;return Re.jsx(f,Le({in:h,timeout:y},S,{children:Re.jsx(AF,Le({"aria-hidden":!0},w,{as:(m=(b=E.root)!=null?b:g.Root)!=null?m:a,className:Bt(P.root,u,w==null?void 0:w.className),ownerState:Le({},_,w==null?void 0:w.ownerState),classes:P,ref:n,children:r}))}))}),IF=RF;function NF(e){return sn("MuiButton",e)}const kF=on("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Qf=kF,OF=Pe.createContext({}),FF=OF,BF=Pe.createContext(void 0),DF=BF,VF=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],GF=e=>{const{color:t,disableElevation:n,fullWidth:s,size:m,variant:b,classes:o}=e,r={root:["root",b,`${b}${wt(t)}`,`size${wt(m)}`,`${b}Size${wt(m)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",s&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${wt(m)}`],endIcon:["endIcon",`iconSize${wt(m)}`]},u=rn(r,NF,o);return Le({},o,u)},T6=e=>Le({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),WF=Mt(gc,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${wt(n.color)}`],t[`size${wt(n.size)}`],t[`${n.variant}Size${wt(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,s;const m=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],b=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return Le({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Le({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:b,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Le({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Qf.focusVisible}`]:Le({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Qf.disabled}`]:Le({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${In(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(s=e.palette).getContrastText)==null?void 0:n.call(s,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:m,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Qf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Qf.disabled}`]:{boxShadow:"none"}}),zF=Mt("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${wt(n.size)}`]]}})(({ownerState:e})=>Le({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},T6(e))),UF=Mt("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${wt(n.size)}`]]}})(({ownerState:e})=>Le({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},T6(e))),$F=Pe.forwardRef(function(t,n){const s=Pe.useContext(FF),m=Pe.useContext(DF),b=Y1(s,t),o=an({props:b,name:"MuiButton"}),{children:r,color:u="primary",component:a="button",className:g,disabled:c=!1,disableElevation:l=!1,disableFocusRipple:h=!1,endIcon:d,focusVisibleClassName:E,fullWidth:f=!1,size:y="medium",startIcon:S,type:_,variant:P="text"}=o,w=It(o,VF),x=Le({},o,{color:u,component:a,disabled:c,disableElevation:l,disableFocusRipple:h,fullWidth:f,size:y,type:_,variant:P}),M=GF(x),N=S&&Re.jsx(zF,{className:M.startIcon,ownerState:x,children:S}),R=d&&Re.jsx(UF,{className:M.endIcon,ownerState:x,children:d}),A=m||"";return Re.jsxs(WF,Le({ownerState:x,className:Bt(s.className,M.root,g,A),component:a,disabled:c,focusRipple:!h,focusVisibleClassName:Bt(M.focusVisible,E),ref:n,type:_},w,{classes:M,children:[N,r,R]}))}),jF=$F;function HF(e){return sn("MuiCircularProgress",e)}on("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const XF=["className","color","disableShrink","size","style","thickness","value","variant"];let dm=e=>e,vS,SS,ES,xS;const va=44,YF=Id(vS||(vS=dm` + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +`)),KF=Id(SS||(SS=dm` + 0% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -15px; + } + + 100% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -125px; + } +`)),qF=e=>{const{classes:t,variant:n,color:s,disableShrink:m}=e,b={root:["root",n,`color${wt(s)}`],svg:["svg"],circle:["circle",`circle${wt(n)}`,m&&"circleDisableShrink"]};return rn(b,HF,t)},QF=Mt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${wt(n.color)}`]]}})(({ownerState:e,theme:t})=>Le({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&Ub(ES||(ES=dm` + animation: ${0} 1.4s linear infinite; + `),YF)),JF=Mt("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),ZF=Mt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${wt(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>Le({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Ub(xS||(xS=dm` + animation: ${0} 1.4s ease-in-out infinite; + `),KF)),eB=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiCircularProgress"}),{className:m,color:b="primary",disableShrink:o=!1,size:r=40,style:u,thickness:a=3.6,value:g=0,variant:c="indeterminate"}=s,l=It(s,XF),h=Le({},s,{color:b,disableShrink:o,size:r,thickness:a,value:g,variant:c}),d=qF(h),E={},f={},y={};if(c==="determinate"){const S=2*Math.PI*((va-a)/2);E.strokeDasharray=S.toFixed(3),y["aria-valuenow"]=Math.round(g),E.strokeDashoffset=`${((100-g)/100*S).toFixed(3)}px`,f.transform="rotate(-90deg)"}return Re.jsx(QF,Le({className:Bt(d.root,m),style:Le({width:r,height:r},f,u),ownerState:h,ref:n,role:"progressbar"},y,l,{children:Re.jsx(JF,{className:d.svg,ownerState:h,viewBox:`${va/2} ${va/2} ${va} ${va}`,children:Re.jsx(ZF,{className:d.circle,style:E,ownerState:h,cx:va,cy:va,r:(va-a)/2,fill:"none",strokeWidth:a})})}))}),lg=eB;function tB(e){return sn("MuiModal",e)}on("MuiModal",["root","hidden","backdrop"]);const nB=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],iB=e=>{const{open:t,exited:n,classes:s}=e;return rn({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},tB,s)},rB=Mt("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>Le({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),sB=Mt(IF,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),oB=Pe.forwardRef(function(t,n){var s,m,b,o,r,u;const a=an({name:"MuiModal",props:t}),{BackdropComponent:g=sB,BackdropProps:c,className:l,closeAfterTransition:h=!1,children:d,container:E,component:f,components:y={},componentsProps:S={},disableAutoFocus:_=!1,disableEnforceFocus:P=!1,disableEscapeKeyDown:w=!1,disablePortal:x=!1,disableRestoreFocus:M=!1,disableScrollLock:N=!1,hideBackdrop:R=!1,keepMounted:A=!1,onBackdropClick:F,open:U,slotProps:Y,slots:k}=a,W=It(a,nB),G=Le({},a,{closeAfterTransition:h,disableAutoFocus:_,disableEnforceFocus:P,disableEscapeKeyDown:w,disablePortal:x,disableRestoreFocus:M,disableScrollLock:N,hideBackdrop:R,keepMounted:A}),{getRootProps:H,getBackdropProps:L,getTransitionProps:$,portalRef:ie,isTopModal:re,exited:be,hasTransition:ae}=Rk(Le({},G,{rootRef:n})),ge=Le({},G,{exited:be}),le=iB(ge),Z={};if(d.props.tabIndex===void 0&&(Z.tabIndex="-1"),ae){const{onEnter:z,onExited:K}=$();Z.onEnter=z,Z.onExited=K}const ye=(s=(m=k==null?void 0:k.root)!=null?m:y.Root)!=null?s:rB,Se=(b=(o=k==null?void 0:k.backdrop)!=null?o:y.Backdrop)!=null?b:g,X=(r=Y==null?void 0:Y.root)!=null?r:S.root,ee=(u=Y==null?void 0:Y.backdrop)!=null?u:S.backdrop,ne=Gl({elementType:ye,externalSlotProps:X,externalForwardedProps:W,getSlotProps:H,additionalProps:{ref:n,as:f},ownerState:ge,className:Bt(l,X==null?void 0:X.className,le==null?void 0:le.root,!ge.open&&ge.exited&&(le==null?void 0:le.hidden))}),O=Gl({elementType:Se,externalSlotProps:ee,additionalProps:c,getSlotProps:z=>L(Le({},z,{onClick:K=>{F&&F(K),z!=null&&z.onClick&&z.onClick(K)}})),className:Bt(ee==null?void 0:ee.className,c==null?void 0:c.className,le==null?void 0:le.backdrop),ownerState:ge});return!A&&!U&&(!ae||be)?null:Re.jsx(f6,{ref:ie,container:E,disablePortal:x,children:Re.jsxs(ye,Le({},ne,{children:[!R&&g?Re.jsx(Se,Le({},O)):null,Re.jsx(Ek,{disableEnforceFocus:P,disableAutoFocus:_,disableRestoreFocus:M,isEnabled:re,open:U,children:Pe.cloneElement(d,Z)})]}))})}),aB=oB;function lB(e){return sn("MuiDivider",e)}on("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const uB=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],cB=e=>{const{absolute:t,children:n,classes:s,flexItem:m,light:b,orientation:o,textAlign:r,variant:u}=e;return rn({root:["root",t&&"absolute",u,b&&"light",o==="vertical"&&"vertical",m&&"flexItem",n&&"withChildren",n&&o==="vertical"&&"withChildrenVertical",r==="right"&&o!=="vertical"&&"textAlignRight",r==="left"&&o!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",o==="vertical"&&"wrapperVertical"]},lB,s)},hB=Mt("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>Le({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:In(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>Le({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>Le({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`}}),({theme:e,ownerState:t})=>Le({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`}}),({ownerState:e})=>Le({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),dB=Mt("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>Le({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),P6=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiDivider"}),{absolute:m=!1,children:b,className:o,component:r=b?"div":"hr",flexItem:u=!1,light:a=!1,orientation:g="horizontal",role:c=r!=="hr"?"separator":void 0,textAlign:l="center",variant:h="fullWidth"}=s,d=It(s,uB),E=Le({},s,{absolute:m,component:r,flexItem:u,light:a,orientation:g,role:c,textAlign:l,variant:h}),f=cB(E);return Re.jsx(hB,Le({as:r,className:Bt(f.root,o),role:c,ref:n,ownerState:E},d,{children:b?Re.jsx(dB,{className:f.wrapper,ownerState:E,children:b}):null}))});P6.muiSkipListHighlight=!0;const ug=P6,fB=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],pB=e=>{const{classes:t,disableUnderline:n}=e,m=rn({root:["root",!n&&"underline"],input:["input"]},SF,t);return Le({},t,m)},mB=Mt(cm,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...lm(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var n;const s=e.palette.mode==="light",m=s?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",b=s?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=s?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",r=s?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return Le({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b}},[`&.${hl.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:b},[`&.${hl.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:r}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(e.vars||e).palette[t.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${hl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${hl.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:m}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${hl.disabled}, .${hl.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${hl.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&Le({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),gB=Mt(hm,{name:"MuiFilledInput",slot:"Input",overridesResolver:um})(({theme:e,ownerState:t})=>Le({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),M6=Pe.forwardRef(function(t,n){var s,m,b,o;const r=an({props:t,name:"MuiFilledInput"}),{components:u={},componentsProps:a,fullWidth:g=!1,inputComponent:c="input",multiline:l=!1,slotProps:h,slots:d={},type:E="text"}=r,f=It(r,fB),y=Le({},r,{fullWidth:g,inputComponent:c,multiline:l,type:E}),S=pB(r),_={root:{ownerState:y},input:{ownerState:y}},P=h??a?Es(_,h??a):_,w=(s=(m=d.root)!=null?m:u.Root)!=null?s:mB,x=(b=(o=d.input)!=null?o:u.Input)!=null?b:gB;return Re.jsx(fy,Le({slots:{root:w,input:x},componentsProps:P,fullWidth:g,inputComponent:c,multiline:l,ref:n,type:E},f,{classes:S}))});M6.muiName="Input";const C6=M6;function bB(e){return sn("MuiFormControl",e)}on("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const yB=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],vB=e=>{const{classes:t,margin:n,fullWidth:s}=e,m={root:["root",n!=="none"&&`margin${wt(n)}`,s&&"fullWidth"]};return rn(m,bB,t)},SB=Mt("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>Le({},t.root,t[`margin${wt(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>Le({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),EB=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiFormControl"}),{children:m,className:b,color:o="primary",component:r="div",disabled:u=!1,error:a=!1,focused:g,fullWidth:c=!1,hiddenLabel:l=!1,margin:h="none",required:d=!1,size:E="medium",variant:f="outlined"}=s,y=It(s,yB),S=Le({},s,{color:o,component:r,disabled:u,error:a,fullWidth:c,hiddenLabel:l,margin:h,required:d,size:E,variant:f}),_=vB(S),[P,w]=Pe.useState(()=>{let Y=!1;return m&&Pe.Children.forEach(m,k=>{if(!yp(k,["Input","Select"]))return;const W=yp(k,["Select"])?k.props.input:k;W&&uF(W.props)&&(Y=!0)}),Y}),[x,M]=Pe.useState(()=>{let Y=!1;return m&&Pe.Children.forEach(m,k=>{yp(k,["Input","Select"])&&(t1(k.props,!0)||t1(k.props.inputProps,!0))&&(Y=!0)}),Y}),[N,R]=Pe.useState(!1);u&&N&&R(!1);const A=g!==void 0&&!u?g:N;let F;const U=Pe.useMemo(()=>({adornedStart:P,setAdornedStart:w,color:o,disabled:u,error:a,filled:x,focused:A,fullWidth:c,hiddenLabel:l,size:E,onBlur:()=>{R(!1)},onEmpty:()=>{M(!1)},onFilled:()=>{M(!0)},onFocus:()=>{R(!0)},registerEffect:F,required:d,variant:f}),[P,o,u,a,x,A,c,l,F,d,E,f]);return Re.jsx(dy.Provider,{value:U,children:Re.jsx(SB,Le({as:r,ownerState:S,className:Bt(_.root,b),ref:n},y,{children:m}))})}),xB=EB;function wB(e){return sn("MuiFormHelperText",e)}const _B=on("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),wS=_B;var _S;const TB=["children","className","component","disabled","error","filled","focused","margin","required","variant"],PB=e=>{const{classes:t,contained:n,size:s,disabled:m,error:b,filled:o,focused:r,required:u}=e,a={root:["root",m&&"disabled",b&&"error",s&&`size${wt(s)}`,n&&"contained",r&&"focused",o&&"filled",u&&"required"]};return rn(a,wB,t)},MB=Mt("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${wt(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(({theme:e,ownerState:t})=>Le({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${wS.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${wS.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),CB=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiFormHelperText"}),{children:m,className:b,component:o="p"}=s,r=It(s,TB),u=Cc(),a=Mc({props:s,muiFormControl:u,states:["variant","size","disabled","error","filled","focused","required"]}),g=Le({},s,{component:o,contained:a.variant==="filled"||a.variant==="outlined",variant:a.variant,size:a.size,disabled:a.disabled,error:a.error,filled:a.filled,focused:a.focused,required:a.required}),c=PB(g);return Re.jsx(MB,Le({as:o,ownerState:g,className:Bt(c.root,b),ref:n},r,{children:m===" "?_S||(_S=Re.jsx("span",{className:"notranslate",children:"​"})):m}))}),LB=CB;function AB(e){return sn("MuiFormLabel",e)}const RB=on("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Vh=RB,IB=["children","className","color","component","disabled","error","filled","focused","required"],NB=e=>{const{classes:t,color:n,focused:s,disabled:m,error:b,filled:o,required:r}=e,u={root:["root",`color${wt(n)}`,m&&"disabled",b&&"error",o&&"filled",s&&"focused",r&&"required"],asterisk:["asterisk",b&&"error"]};return rn(u,AB,t)},kB=Mt("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>Le({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>Le({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Vh.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${Vh.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Vh.error}`]:{color:(e.vars||e).palette.error.main}})),OB=Mt("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${Vh.error}`]:{color:(e.vars||e).palette.error.main}})),FB=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiFormLabel"}),{children:m,className:b,component:o="label"}=s,r=It(s,IB),u=Cc(),a=Mc({props:s,muiFormControl:u,states:["color","required","focused","disabled","error","filled"]}),g=Le({},s,{color:a.color||"primary",component:o,disabled:a.disabled,error:a.error,filled:a.filled,focused:a.focused,required:a.required}),c=NB(g);return Re.jsxs(kB,Le({as:o,ownerState:g,className:Bt(c.root,b),ref:n},r,{children:[m,a.required&&Re.jsxs(OB,{ownerState:g,"aria-hidden":!0,className:c.asterisk,children:[" ","*"]})]}))}),BB=FB,DB=Pe.createContext(),TS=DB;function VB(e){return sn("MuiGrid",e)}const GB=[0,1,2,3,4,5,6,7,8,9,10],WB=["column-reverse","column","row-reverse","row"],zB=["nowrap","wrap-reverse","wrap"],fh=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],dd=on("MuiGrid",["root","container","item","zeroMinWidth",...GB.map(e=>`spacing-xs-${e}`),...WB.map(e=>`direction-xs-${e}`),...zB.map(e=>`wrap-xs-${e}`),...fh.map(e=>`grid-xs-${e}`),...fh.map(e=>`grid-sm-${e}`),...fh.map(e=>`grid-md-${e}`),...fh.map(e=>`grid-lg-${e}`),...fh.map(e=>`grid-xl-${e}`)]),UB=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function $u(e){const t=parseFloat(e);return`${t}${String(e).replace(String(t),"")||"px"}`}function $B({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((s,m)=>{let b={};if(t[m]&&(n=t[m]),!n)return s;if(n===!0)b={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")b={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const o=K1({values:t.columns,breakpoints:e.breakpoints.values}),r=typeof o=="object"?o[m]:o;if(r==null)return s;const u=`${Math.round(n/r*1e8)/1e6}%`;let a={};if(t.container&&t.item&&t.columnSpacing!==0){const g=e.spacing(t.columnSpacing);if(g!=="0px"){const c=`calc(${u} + ${$u(g)})`;a={flexBasis:c,maxWidth:c}}}b=Le({flexBasis:u,flexGrow:0,maxWidth:u},a)}return e.breakpoints.values[m]===0?Object.assign(s,b):s[e.breakpoints.up(m)]=b,s},{})}function jB({theme:e,ownerState:t}){const n=K1({values:t.direction,breakpoints:e.breakpoints.values});return Ts({theme:e},n,s=>{const m={flexDirection:s};return s.indexOf("column")===0&&(m[`& > .${dd.item}`]={maxWidth:"none"}),m})}function L6({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(m=>{n===""&&t[m]!==0&&(n=m)});const s=Object.keys(e).sort((m,b)=>e[m]-e[b]);return s.slice(0,s.indexOf(n))}function HB({theme:e,ownerState:t}){const{container:n,rowSpacing:s}=t;let m={};if(n&&s!==0){const b=K1({values:s,breakpoints:e.breakpoints.values});let o;typeof b=="object"&&(o=L6({breakpoints:e.breakpoints.values,values:b})),m=Ts({theme:e},b,(r,u)=>{var a;const g=e.spacing(r);return g!=="0px"?{marginTop:`-${$u(g)}`,[`& > .${dd.item}`]:{paddingTop:$u(g)}}:(a=o)!=null&&a.includes(u)?{}:{marginTop:0,[`& > .${dd.item}`]:{paddingTop:0}}})}return m}function XB({theme:e,ownerState:t}){const{container:n,columnSpacing:s}=t;let m={};if(n&&s!==0){const b=K1({values:s,breakpoints:e.breakpoints.values});let o;typeof b=="object"&&(o=L6({breakpoints:e.breakpoints.values,values:b})),m=Ts({theme:e},b,(r,u)=>{var a;const g=e.spacing(r);return g!=="0px"?{width:`calc(100% + ${$u(g)})`,marginLeft:`-${$u(g)}`,[`& > .${dd.item}`]:{paddingLeft:$u(g)}}:(a=o)!=null&&a.includes(u)?{}:{width:"100%",marginLeft:0,[`& > .${dd.item}`]:{paddingLeft:0}}})}return m}function YB(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const s=[];return t.forEach(m=>{const b=e[m];Number(b)>0&&s.push(n[`spacing-${m}-${String(b)}`])}),s}const KB=Mt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:s,direction:m,item:b,spacing:o,wrap:r,zeroMinWidth:u,breakpoints:a}=n;let g=[];s&&(g=YB(o,a,t));const c=[];return a.forEach(l=>{const h=n[l];h&&c.push(t[`grid-${l}-${String(h)}`])}),[t.root,s&&t.container,b&&t.item,u&&t.zeroMinWidth,...g,m!=="row"&&t[`direction-xs-${String(m)}`],r!=="wrap"&&t[`wrap-xs-${String(r)}`],...c]}})(({ownerState:e})=>Le({boxSizing:"border-box"},e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},e.item&&{margin:0},e.zeroMinWidth&&{minWidth:0},e.wrap!=="wrap"&&{flexWrap:e.wrap}),jB,HB,XB,$B);function qB(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(s=>{const m=e[s];if(Number(m)>0){const b=`spacing-${s}-${String(m)}`;n.push(b)}}),n}const QB=e=>{const{classes:t,container:n,direction:s,item:m,spacing:b,wrap:o,zeroMinWidth:r,breakpoints:u}=e;let a=[];n&&(a=qB(b,u));const g=[];u.forEach(l=>{const h=e[l];h&&g.push(`grid-${l}-${String(h)}`)});const c={root:["root",n&&"container",m&&"item",r&&"zeroMinWidth",...a,s!=="row"&&`direction-xs-${String(s)}`,o!=="wrap"&&`wrap-xs-${String(o)}`,...g]};return rn(c,VB,t)},JB=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiGrid"}),{breakpoints:m}=Pc(),b=Zx(s),{className:o,columns:r,columnSpacing:u,component:a="div",container:g=!1,direction:c="row",item:l=!1,rowSpacing:h,spacing:d=0,wrap:E="wrap",zeroMinWidth:f=!1}=b,y=It(b,UB),S=h||d,_=u||d,P=Pe.useContext(TS),w=g?r||12:P,x={},M=Le({},y);m.keys.forEach(A=>{y[A]!=null&&(x[A]=y[A],delete M[A])});const N=Le({},b,{columns:w,container:g,direction:c,item:l,rowSpacing:S,columnSpacing:_,wrap:E,zeroMinWidth:f,spacing:d},x,{breakpoints:m.keys}),R=QB(N);return Re.jsx(TS.Provider,{value:w,children:Re.jsx(KB,Le({ownerState:N,className:Bt(R.root,o),as:a,ref:n},M))})}),Wn=JB,ZB=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function k2(e){return`scale(${e}, ${e**2})`}const eD={entering:{opacity:1,transform:k2(1)},entered:{opacity:1,transform:"none"}},cg=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),A6=Pe.forwardRef(function(t,n){const{addEndListener:s,appear:m=!0,children:b,easing:o,in:r,onEnter:u,onEntered:a,onEntering:g,onExit:c,onExited:l,onExiting:h,style:d,timeout:E="auto",TransitionComponent:f=ny}=t,y=It(t,ZB),S=vl(),_=Pe.useRef(),P=Pc(),w=Pe.useRef(null),x=yi(w,b.ref,n),M=W=>G=>{if(W){const H=w.current;G===void 0?W(H):W(H,G)}},N=M(g),R=M((W,G)=>{s6(W);const{duration:H,delay:L,easing:$}=mc({style:d,timeout:E,easing:o},{mode:"enter"});let ie;E==="auto"?(ie=P.transitions.getAutoHeightDuration(W.clientHeight),_.current=ie):ie=H,W.style.transition=[P.transitions.create("opacity",{duration:ie,delay:L}),P.transitions.create("transform",{duration:cg?ie:ie*.666,delay:L,easing:$})].join(","),u&&u(W,G)}),A=M(a),F=M(h),U=M(W=>{const{duration:G,delay:H,easing:L}=mc({style:d,timeout:E,easing:o},{mode:"exit"});let $;E==="auto"?($=P.transitions.getAutoHeightDuration(W.clientHeight),_.current=$):$=G,W.style.transition=[P.transitions.create("opacity",{duration:$,delay:H}),P.transitions.create("transform",{duration:cg?$:$*.666,delay:cg?H:H||$*.333,easing:L})].join(","),W.style.opacity=0,W.style.transform=k2(.75),c&&c(W)}),Y=M(l),k=W=>{E==="auto"&&S.start(_.current||0,W),s&&s(w.current,W)};return Re.jsx(f,Le({appear:m,in:r,nodeRef:w,onEnter:R,onEntered:A,onEntering:N,onExit:U,onExited:Y,onExiting:F,addEndListener:k,timeout:E==="auto"?null:E},y,{children:(W,G)=>Pe.cloneElement(b,Le({style:Le({opacity:0,transform:k2(.75),visibility:W==="exited"&&!r?"hidden":void 0},eD[W],d,b.props.style),ref:x},G))}))});A6.muiSupportAuto=!0;const O2=A6,tD=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],nD=e=>{const{classes:t,disableUnderline:n}=e,m=rn({root:["root",!n&&"underline"],input:["input"]},gF,t);return Le({},t,m)},iD=Mt(cm,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...lm(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let s=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(s=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),Le({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${dh.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${dh.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${dh.disabled}, .${dh.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${s}`}},[`&.${dh.disabled}:before`]:{borderBottomStyle:"dotted"}})}),rD=Mt(hm,{name:"MuiInput",slot:"Input",overridesResolver:um})({}),R6=Pe.forwardRef(function(t,n){var s,m,b,o;const r=an({props:t,name:"MuiInput"}),{disableUnderline:u,components:a={},componentsProps:g,fullWidth:c=!1,inputComponent:l="input",multiline:h=!1,slotProps:d,slots:E={},type:f="text"}=r,y=It(r,tD),S=nD(r),P={root:{ownerState:{disableUnderline:u}}},w=d??g?Es(d??g,P):P,x=(s=(m=E.root)!=null?m:a.Root)!=null?s:iD,M=(b=(o=E.input)!=null?o:a.Input)!=null?b:rD;return Re.jsx(fy,Le({slots:{root:x,input:M},slotProps:w,fullWidth:c,inputComponent:l,multiline:h,ref:n,type:f},y,{classes:S}))});R6.muiName="Input";const I6=R6;function sD(e){return sn("MuiInputLabel",e)}on("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const oD=["disableAnimation","margin","shrink","variant","className"],aD=e=>{const{classes:t,formControl:n,size:s,shrink:m,disableAnimation:b,variant:o,required:r}=e,u={root:["root",n&&"formControl",!b&&"animated",m&&"shrink",s&&s!=="normal"&&`size${wt(s)}`,o],asterisk:[r&&"asterisk"]},a=rn(u,sD,t);return Le({},t,a)},lD=Mt(BB,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Vh.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(({theme:e,ownerState:t})=>Le({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&Le({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&Le({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&Le({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),uD=Pe.forwardRef(function(t,n){const s=an({name:"MuiInputLabel",props:t}),{disableAnimation:m=!1,shrink:b,className:o}=s,r=It(s,oD),u=Cc();let a=b;typeof a>"u"&&u&&(a=u.filled||u.focused||u.adornedStart);const g=Mc({props:s,muiFormControl:u,states:["size","variant","required","focused"]}),c=Le({},s,{disableAnimation:m,formControl:u,shrink:a,size:g.size,variant:g.variant,required:g.required,focused:g.focused}),l=aD(c);return Re.jsx(lD,Le({"data-shrink":a,ownerState:c,ref:n,className:Bt(l.root,o)},r,{classes:l}))}),cD=uD,hD=Pe.createContext({}),dD=hD;function fD(e){return sn("MuiList",e)}on("MuiList",["root","padding","dense","subheader"]);const pD=["children","className","component","dense","disablePadding","subheader"],mD=e=>{const{classes:t,disablePadding:n,dense:s,subheader:m}=e;return rn({root:["root",!n&&"padding",s&&"dense",m&&"subheader"]},fD,t)},gD=Mt("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>Le({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),bD=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiList"}),{children:m,className:b,component:o="ul",dense:r=!1,disablePadding:u=!1,subheader:a}=s,g=It(s,pD),c=Pe.useMemo(()=>({dense:r}),[r]),l=Le({},s,{component:o,dense:r,disablePadding:u}),h=mD(l);return Re.jsx(dD.Provider,{value:c,children:Re.jsxs(gD,Le({as:o,className:Bt(h.root,b),ref:n,ownerState:l},g,{children:[a,m]}))})}),yD=bD,vD=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function hg(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function PS(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function N6(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.indexOf(t.keys.join(""))===0}function ph(e,t,n,s,m,b){let o=!1,r=m(e,t,t?n:!1);for(;r;){if(r===e.firstChild){if(o)return!1;o=!0}const u=s?!1:r.disabled||r.getAttribute("aria-disabled")==="true";if(!r.hasAttribute("tabindex")||!N6(r,b)||u)r=m(e,r,n);else return r.focus(),!0}return!1}const SD=Pe.forwardRef(function(t,n){const{actions:s,autoFocus:m=!1,autoFocusItem:b=!1,children:o,className:r,disabledItemsFocusable:u=!1,disableListWrap:a=!1,onKeyDown:g,variant:c="selectedMenu"}=t,l=It(t,vD),h=Pe.useRef(null),d=Pe.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});_o(()=>{m&&h.current.focus()},[m]),Pe.useImperativeHandle(s,()=>({adjustStyleForScrollbar:(_,P)=>{const w=!h.current.style.width;if(_.clientHeight{const P=h.current,w=_.key,x=Qi(P).activeElement;if(w==="ArrowDown")_.preventDefault(),ph(P,x,a,u,hg);else if(w==="ArrowUp")_.preventDefault(),ph(P,x,a,u,PS);else if(w==="Home")_.preventDefault(),ph(P,null,a,u,hg);else if(w==="End")_.preventDefault(),ph(P,null,a,u,PS);else if(w.length===1){const M=d.current,N=w.toLowerCase(),R=performance.now();M.keys.length>0&&(R-M.lastTime>500?(M.keys=[],M.repeating=!0,M.previousKeyMatched=!0):M.repeating&&N!==M.keys[0]&&(M.repeating=!1)),M.lastTime=R,M.keys.push(N);const A=x&&!M.repeating&&N6(x,M);M.previousKeyMatched&&(A||ph(P,x,!1,u,hg,M))?_.preventDefault():M.previousKeyMatched=!1}g&&g(_)},f=yi(h,n);let y=-1;Pe.Children.forEach(o,(_,P)=>{if(!Pe.isValidElement(_)){y===P&&(y+=1,y>=o.length&&(y=-1));return}_.props.disabled||(c==="selectedMenu"&&_.props.selected||y===-1)&&(y=P),y===P&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(y+=1,y>=o.length&&(y=-1))});const S=Pe.Children.map(o,(_,P)=>{if(P===y){const w={};return b&&(w.autoFocus=!0),_.props.tabIndex===void 0&&c==="selectedMenu"&&(w.tabIndex=0),Pe.cloneElement(_,w)}return _});return Re.jsx(yD,Le({role:"menu",ref:f,className:r,onKeyDown:E,tabIndex:m?0:-1},l,{children:S}))}),ED=SD;function xD(e){return sn("MuiPopover",e)}on("MuiPopover",["root","paper"]);const wD=["onEntering"],_D=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],TD=["slotProps"];function MS(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function CS(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function LS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function dg(e){return typeof e=="function"?e():e}const PD=e=>{const{classes:t}=e;return rn({root:["root"],paper:["paper"]},xD,t)},MD=Mt(aB,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),k6=Mt(Jp,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),CD=Pe.forwardRef(function(t,n){var s,m,b;const o=an({props:t,name:"MuiPopover"}),{action:r,anchorEl:u,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:g,anchorReference:c="anchorEl",children:l,className:h,container:d,elevation:E=8,marginThreshold:f=16,open:y,PaperProps:S={},slots:_,slotProps:P,transformOrigin:w={vertical:"top",horizontal:"left"},TransitionComponent:x=O2,transitionDuration:M="auto",TransitionProps:{onEntering:N}={},disableScrollLock:R=!1}=o,A=It(o.TransitionProps,wD),F=It(o,_D),U=(s=P==null?void 0:P.paper)!=null?s:S,Y=Pe.useRef(),k=yi(Y,U.ref),W=Le({},o,{anchorOrigin:a,anchorReference:c,elevation:E,marginThreshold:f,externalPaperSlotProps:U,transformOrigin:w,TransitionComponent:x,transitionDuration:M,TransitionProps:A}),G=PD(W),H=Pe.useCallback(()=>{if(c==="anchorPosition")return g;const z=dg(u),q=(z&&z.nodeType===1?z:Qi(Y.current).body).getBoundingClientRect();return{top:q.top+MS(q,a.vertical),left:q.left+CS(q,a.horizontal)}},[u,a.horizontal,a.vertical,g,c]),L=Pe.useCallback(z=>({vertical:MS(z,w.vertical),horizontal:CS(z,w.horizontal)}),[w.horizontal,w.vertical]),$=Pe.useCallback(z=>{const K={width:z.offsetWidth,height:z.offsetHeight},q=L(K);if(c==="none")return{top:null,left:null,transformOrigin:LS(q)};const de=H();let ue=de.top-q.vertical,ce=de.left-q.horizontal;const pe=ue+K.height,we=ce+K.width,Me=Ya(dg(u)),ze=Me.innerHeight-f,De=Me.innerWidth-f;if(f!==null&&ueze){const Qe=pe-ze;ue-=Qe,q.vertical+=Qe}if(f!==null&&ceDe){const Qe=we-De;ce-=Qe,q.horizontal+=Qe}return{top:`${Math.round(ue)}px`,left:`${Math.round(ce)}px`,transformOrigin:LS(q)}},[u,c,H,L,f]),[ie,re]=Pe.useState(y),be=Pe.useCallback(()=>{const z=Y.current;if(!z)return;const K=$(z);K.top!==null&&(z.style.top=K.top),K.left!==null&&(z.style.left=K.left),z.style.transformOrigin=K.transformOrigin,re(!0)},[$]);Pe.useEffect(()=>(R&&window.addEventListener("scroll",be),()=>window.removeEventListener("scroll",be)),[u,R,be]);const ae=(z,K)=>{N&&N(z,K),be()},ge=()=>{re(!1)};Pe.useEffect(()=>{y&&be()}),Pe.useImperativeHandle(r,()=>y?{updatePosition:()=>{be()}}:null,[y,be]),Pe.useEffect(()=>{if(!y)return;const z=Hb(()=>{be()}),K=Ya(u);return K.addEventListener("resize",z),()=>{z.clear(),K.removeEventListener("resize",z)}},[u,y,be]);let le=M;M==="auto"&&!x.muiSupportAuto&&(le=void 0);const Z=d||(u?Qi(dg(u)).body:void 0),ye=(m=_==null?void 0:_.root)!=null?m:MD,Se=(b=_==null?void 0:_.paper)!=null?b:k6,X=Gl({elementType:Se,externalSlotProps:Le({},U,{style:ie?U.style:Le({},U.style,{opacity:0})}),additionalProps:{elevation:E,ref:k},ownerState:W,className:Bt(G.paper,U==null?void 0:U.className)}),ee=Gl({elementType:ye,externalSlotProps:(P==null?void 0:P.root)||{},externalForwardedProps:F,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:Z,open:y},ownerState:W,className:Bt(G.root,h)}),{slotProps:ne}=ee,O=It(ee,TD);return Re.jsx(ye,Le({},O,!Zp(ye)&&{slotProps:ne,disableScrollLock:R},{children:Re.jsx(x,Le({appear:!0,in:y,onEntering:ae,onExited:ge,timeout:le},A,{children:Re.jsx(Se,Le({},X,{children:l}))}))}))}),LD=CD;function AD(e){return sn("MuiMenu",e)}on("MuiMenu",["root","paper","list"]);const RD=["onEntering"],ID=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],ND={vertical:"top",horizontal:"right"},kD={vertical:"top",horizontal:"left"},OD=e=>{const{classes:t}=e;return rn({root:["root"],paper:["paper"],list:["list"]},AD,t)},FD=Mt(LD,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),BD=Mt(k6,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),DD=Mt(ED,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),VD=Pe.forwardRef(function(t,n){var s,m;const b=an({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:r,className:u,disableAutoFocusItem:a=!1,MenuListProps:g={},onClose:c,open:l,PaperProps:h={},PopoverClasses:d,transitionDuration:E="auto",TransitionProps:{onEntering:f}={},variant:y="selectedMenu",slots:S={},slotProps:_={}}=b,P=It(b.TransitionProps,RD),w=It(b,ID),x=Pc(),M=x.direction==="rtl",N=Le({},b,{autoFocus:o,disableAutoFocusItem:a,MenuListProps:g,onEntering:f,PaperProps:h,transitionDuration:E,TransitionProps:P,variant:y}),R=OD(N),A=o&&!a&&l,F=Pe.useRef(null),U=($,ie)=>{F.current&&F.current.adjustStyleForScrollbar($,x),f&&f($,ie)},Y=$=>{$.key==="Tab"&&($.preventDefault(),c&&c($,"tabKeyDown"))};let k=-1;Pe.Children.map(r,($,ie)=>{Pe.isValidElement($)&&($.props.disabled||(y==="selectedMenu"&&$.props.selected||k===-1)&&(k=ie))});const W=(s=S.paper)!=null?s:BD,G=(m=_.paper)!=null?m:h,H=Gl({elementType:S.root,externalSlotProps:_.root,ownerState:N,className:[R.root,u]}),L=Gl({elementType:W,externalSlotProps:G,ownerState:N,className:R.paper});return Re.jsx(FD,Le({onClose:c,anchorOrigin:{vertical:"bottom",horizontal:M?"right":"left"},transformOrigin:M?ND:kD,slots:{paper:W,root:S.root},slotProps:{root:H,paper:L},open:l,ref:n,transitionDuration:E,TransitionProps:Le({onEntering:U},P),ownerState:N},w,{classes:d,children:Re.jsx(DD,Le({onKeyDown:Y,actions:F,autoFocus:o&&(k===-1||a),autoFocusItem:A,variant:y},g,{className:Bt(R.list,g.className),children:r}))}))}),GD=VD;function WD(e){return sn("MuiNativeSelect",e)}const zD=on("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),py=zD,UD=["className","disabled","error","IconComponent","inputRef","variant"],$D=e=>{const{classes:t,variant:n,disabled:s,multiple:m,open:b,error:o}=e,r={select:["select",n,s&&"disabled",m&&"multiple",o&&"error"],icon:["icon",`icon${wt(n)}`,b&&"iconOpen",s&&"disabled"]};return rn(r,WD,t)},O6=({ownerState:e,theme:t})=>Le({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":Le({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${py.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),jD=Mt("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Ks,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${py.multiple}`]:t.multiple}]}})(O6),F6=({ownerState:e,theme:t})=>Le({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${py.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),HD=Mt("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${wt(n.variant)}`],n.open&&t.iconOpen]}})(F6),XD=Pe.forwardRef(function(t,n){const{className:s,disabled:m,error:b,IconComponent:o,inputRef:r,variant:u="standard"}=t,a=It(t,UD),g=Le({},t,{disabled:m,variant:u,error:b}),c=$D(g);return Re.jsxs(Pe.Fragment,{children:[Re.jsx(jD,Le({ownerState:g,className:Bt(c.select,s),disabled:m,ref:r||n},a)),t.multiple?null:Re.jsx(HD,{as:o,ownerState:g,className:c.icon})]})}),YD=XD;var AS;const KD=["children","classes","className","label","notched"],qD=Mt("fieldset",{shouldForwardProp:Ks})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),QD=Mt("legend",{shouldForwardProp:Ks})(({ownerState:e,theme:t})=>Le({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&Le({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function JD(e){const{className:t,label:n,notched:s}=e,m=It(e,KD),b=n!=null&&n!=="",o=Le({},e,{notched:s,withLabel:b});return Re.jsx(qD,Le({"aria-hidden":!0,className:t,ownerState:o},m,{children:Re.jsx(QD,{ownerState:o,children:b?Re.jsx("span",{children:n}):AS||(AS=Re.jsx("span",{className:"notranslate",children:"​"}))})}))}const ZD=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],eV=e=>{const{classes:t}=e,s=rn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},yF,t);return Le({},t,s)},tV=Mt(cm,{shouldForwardProp:e=>Ks(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:lm})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return Le({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ya.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ya.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${ya.focused} .${ya.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${ya.error} .${ya.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${ya.disabled} .${ya.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&Le({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),nV=Mt(JD,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),iV=Mt(hm,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:um})(({theme:e,ownerState:t})=>Le({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),B6=Pe.forwardRef(function(t,n){var s,m,b,o,r;const u=an({props:t,name:"MuiOutlinedInput"}),{components:a={},fullWidth:g=!1,inputComponent:c="input",label:l,multiline:h=!1,notched:d,slots:E={},type:f="text"}=u,y=It(u,ZD),S=eV(u),_=Cc(),P=Mc({props:u,muiFormControl:_,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),w=Le({},u,{color:P.color||"primary",disabled:P.disabled,error:P.error,focused:P.focused,formControl:_,fullWidth:g,hiddenLabel:P.hiddenLabel,multiline:h,size:P.size,type:f}),x=(s=(m=E.root)!=null?m:a.Root)!=null?s:tV,M=(b=(o=E.input)!=null?o:a.Input)!=null?b:iV;return Re.jsx(fy,Le({slots:{root:x,input:M},renderSuffix:N=>Re.jsx(nV,{ownerState:w,className:S.notchedOutline,label:l!=null&&l!==""&&P.required?r||(r=Re.jsxs(Pe.Fragment,{children:[l," ","*"]})):l,notched:typeof d<"u"?d:!!(N.startAdornment||N.filled||N.focused)}),fullWidth:g,inputComponent:c,multiline:h,ref:n,type:f},y,{classes:Le({},S,{notchedOutline:null})}))});B6.muiName="Input";const D6=B6;function rV(e){return sn("MuiSelect",e)}const mh=on("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var RS;const sV=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],oV=Mt("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${mh.select}`]:t.select},{[`&.${mh.select}`]:t[n.variant]},{[`&.${mh.error}`]:t.error},{[`&.${mh.multiple}`]:t.multiple}]}})(O6,{[`&.${mh.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),aV=Mt("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${wt(n.variant)}`],n.open&&t.iconOpen]}})(F6),lV=Mt("input",{shouldForwardProp:e=>OI(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function IS(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function uV(e){return e==null||typeof e=="string"&&!e.trim()}const cV=e=>{const{classes:t,variant:n,disabled:s,multiple:m,open:b,error:o}=e,r={select:["select",n,s&&"disabled",m&&"multiple",o&&"error"],icon:["icon",`icon${wt(n)}`,b&&"iconOpen",s&&"disabled"],nativeInput:["nativeInput"]};return rn(r,rV,t)},hV=Pe.forwardRef(function(t,n){var s;const{"aria-describedby":m,"aria-label":b,autoFocus:o,autoWidth:r,children:u,className:a,defaultOpen:g,defaultValue:c,disabled:l,displayEmpty:h,error:d=!1,IconComponent:E,inputRef:f,labelId:y,MenuProps:S={},multiple:_,name:P,onBlur:w,onChange:x,onClose:M,onFocus:N,onOpen:R,open:A,readOnly:F,renderValue:U,SelectDisplayProps:Y={},tabIndex:k,value:W,variant:G="standard"}=t,H=It(t,sV),[L,$]=ud({controlled:W,default:c,name:"Select"}),[ie,re]=ud({controlled:A,default:g,name:"Select"}),be=Pe.useRef(null),ae=Pe.useRef(null),[ge,le]=Pe.useState(null),{current:Z}=Pe.useRef(A!=null),[ye,Se]=Pe.useState(),X=yi(n,f),ee=Pe.useCallback(ot=>{ae.current=ot,ot&&le(ot)},[]),ne=ge==null?void 0:ge.parentNode;Pe.useImperativeHandle(X,()=>({focus:()=>{ae.current.focus()},node:be.current,value:L}),[L]),Pe.useEffect(()=>{g&&ie&&ge&&!Z&&(Se(r?null:ne.clientWidth),ae.current.focus())},[ge,r]),Pe.useEffect(()=>{o&&ae.current.focus()},[o]),Pe.useEffect(()=>{if(!y)return;const ot=Qi(ae.current).getElementById(y);if(ot){const Et=()=>{getSelection().isCollapsed&&ae.current.focus()};return ot.addEventListener("click",Et),()=>{ot.removeEventListener("click",Et)}}},[y]);const O=(ot,Et)=>{ot?R&&R(Et):M&&M(Et),Z||(Se(r?null:ne.clientWidth),re(ot))},z=ot=>{ot.button===0&&(ot.preventDefault(),ae.current.focus(),O(!0,ot))},K=ot=>{O(!1,ot)},q=Pe.Children.toArray(u),de=ot=>{const Et=q.find(ct=>ct.props.value===ot.target.value);Et!==void 0&&($(Et.props.value),x&&x(ot,Et))},ue=ot=>Et=>{let ct;if(Et.currentTarget.hasAttribute("tabindex")){if(_){ct=Array.isArray(L)?L.slice():[];const _t=L.indexOf(ot.props.value);_t===-1?ct.push(ot.props.value):ct.splice(_t,1)}else ct=ot.props.value;if(ot.props.onClick&&ot.props.onClick(Et),L!==ct&&($(ct),x)){const _t=Et.nativeEvent||Et,Nt=new _t.constructor(_t.type,_t);Object.defineProperty(Nt,"target",{writable:!0,value:{value:ct,name:P}}),x(Nt,ot)}_||O(!1,Et)}},ce=ot=>{F||[" ","ArrowUp","ArrowDown","Enter"].indexOf(ot.key)!==-1&&(ot.preventDefault(),O(!0,ot))},pe=ge!==null&&ie,we=ot=>{!pe&&w&&(Object.defineProperty(ot,"target",{writable:!0,value:{value:L,name:P}}),w(ot))};delete H["aria-invalid"];let Me,ze;const De=[];let Qe=!1;(t1({value:L})||h)&&(U?Me=U(L):Qe=!0);const ke=q.map(ot=>{if(!Pe.isValidElement(ot))return null;let Et;if(_){if(!Array.isArray(L))throw new Error(Xa(2));Et=L.some(ct=>IS(ct,ot.props.value)),Et&&Qe&&De.push(ot.props.children)}else Et=IS(L,ot.props.value),Et&&Qe&&(ze=ot.props.children);return Pe.cloneElement(ot,{"aria-selected":Et?"true":"false",onClick:ue(ot),onKeyUp:ct=>{ct.key===" "&&ct.preventDefault(),ot.props.onKeyUp&&ot.props.onKeyUp(ct)},role:"option",selected:Et,value:void 0,"data-value":ot.props.value})});Qe&&(_?De.length===0?Me=null:Me=De.reduce((ot,Et,ct)=>(ot.push(Et),ct{const{classes:t}=e;return t},my={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ks(e)&&e!=="variant",slot:"Root"},gV=Mt(I6,my)(""),bV=Mt(D6,my)(""),yV=Mt(C6,my)(""),V6=Pe.forwardRef(function(t,n){const s=an({name:"MuiSelect",props:t}),{autoWidth:m=!1,children:b,classes:o={},className:r,defaultOpen:u=!1,displayEmpty:a=!1,IconComponent:g=xF,id:c,input:l,inputProps:h,label:d,labelId:E,MenuProps:f,multiple:y=!1,native:S=!1,onClose:_,onOpen:P,open:w,renderValue:x,SelectDisplayProps:M,variant:N="outlined"}=s,R=It(s,fV),A=S?YD:dV,F=Cc(),U=Mc({props:s,muiFormControl:F,states:["variant","error"]}),Y=U.variant||N,k=Le({},s,{variant:Y,classes:o}),W=mV(k),G=It(W,pV),H=l||{standard:Re.jsx(gV,{ownerState:k}),outlined:Re.jsx(bV,{label:d,ownerState:k}),filled:Re.jsx(yV,{ownerState:k})}[Y],L=yi(n,H.ref);return Re.jsx(Pe.Fragment,{children:Pe.cloneElement(H,Le({inputComponent:A,inputProps:Le({children:b,error:U.error,IconComponent:g,variant:Y,type:void 0,multiple:y},S?{id:c}:{autoWidth:m,defaultOpen:u,displayEmpty:a,labelId:E,MenuProps:f,onClose:_,onOpen:P,open:w,renderValue:x,SelectDisplayProps:Le({id:c},M)},h,{classes:h?Es(G,h.classes):G},l?l.props.inputProps:{})},(y&&S||a)&&Y==="outlined"?{notched:!0}:{},{ref:L,className:Bt(H.props.className,r,W.root)},!l&&{variant:Y},R))})});V6.muiName="Select";const vV=V6;function SV(e){return sn("MuiTooltip",e)}const EV=on("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Fa=EV,xV=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function wV(e){return Math.round(e*1e5)/1e5}const _V=e=>{const{classes:t,disableInteractive:n,arrow:s,touch:m,placement:b}=e,o={popper:["popper",!n&&"popperInteractive",s&&"popperArrow"],tooltip:["tooltip",s&&"tooltipArrow",m&&"touch",`tooltipPlacement${wt(b.split("-")[0])}`],arrow:["arrow"]};return rn(o,SV,t)},TV=Mt(_6,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(({theme:e,ownerState:t,open:n})=>Le({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Fa.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Fa.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Fa.arrow}`]:Le({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Fa.arrow}`]:Le({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),PV=Mt("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${wt(n.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>Le({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:In(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${wV(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Fa.popper}[data-popper-placement*="left"] &`]:Le({transformOrigin:"right center"},t.isRtl?Le({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):Le({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Fa.popper}[data-popper-placement*="right"] &`]:Le({transformOrigin:"left center"},t.isRtl?Le({marginRight:"14px"},t.touch&&{marginRight:"24px"}):Le({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Fa.popper}[data-popper-placement*="top"] &`]:Le({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Fa.popper}[data-popper-placement*="bottom"] &`]:Le({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),MV=Mt("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:In(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Jf=!1;const NS=new Nd;let gh={x:0,y:0};function Zf(e,t){return n=>{t&&t(n),e(n)}}const CV=Pe.forwardRef(function(t,n){var s,m,b,o,r,u,a,g,c,l,h,d,E,f,y,S,_,P,w;const x=an({props:t,name:"MuiTooltip"}),{arrow:M=!1,children:N,components:R={},componentsProps:A={},describeChild:F=!1,disableFocusListener:U=!1,disableHoverListener:Y=!1,disableInteractive:k=!1,disableTouchListener:W=!1,enterDelay:G=100,enterNextDelay:H=0,enterTouchDelay:L=700,followCursor:$=!1,id:ie,leaveDelay:re=0,leaveTouchDelay:be=1500,onClose:ae,onOpen:ge,open:le,placement:Z="bottom",PopperComponent:ye,PopperProps:Se={},slotProps:X={},slots:ee={},title:ne,TransitionComponent:O=O2,TransitionProps:z}=x,K=It(x,xV),q=Pe.isValidElement(N)?N:Re.jsx("span",{children:N}),de=Pc(),ue=de.direction==="rtl",[ce,pe]=Pe.useState(),[we,Me]=Pe.useState(null),ze=Pe.useRef(!1),De=k||$,Qe=vl(),ke=vl(),We=vl(),qe=vl(),[Ye,Je]=ud({controlled:le,default:!1,name:"Tooltip",state:"open"});let it=Ye;const ht=H1(ie),vt=Pe.useRef(),ot=Yo(()=>{vt.current!==void 0&&(document.body.style.WebkitUserSelect=vt.current,vt.current=void 0),qe.clear()});Pe.useEffect(()=>ot,[ot]);const Et=Gt=>{NS.clear(),Jf=!0,Je(!0),ge&&!it&&ge(Gt)},ct=Yo(Gt=>{NS.start(800+re,()=>{Jf=!1}),Je(!1),ae&&it&&ae(Gt),Qe.start(de.transitions.duration.shortest,()=>{ze.current=!1})}),_t=Gt=>{ze.current&&Gt.type!=="touchstart"||(ce&&ce.removeAttribute("title"),ke.clear(),We.clear(),G||Jf&&H?ke.start(Jf?H:G,()=>{Et(Gt)}):Et(Gt))},Nt=Gt=>{ke.clear(),We.start(re,()=>{ct(Gt)})},{isFocusVisibleRef:qt,onBlur:li,onFocus:$n,ref:hr}=Xb(),[,At]=Pe.useState(!1),On=Gt=>{li(Gt),qt.current===!1&&(At(!1),Nt(Gt))},tn=Gt=>{ce||pe(Gt.currentTarget),$n(Gt),qt.current===!0&&(At(!0),_t(Gt))},Ht=Gt=>{ze.current=!0;const Xn=q.props;Xn.onTouchStart&&Xn.onTouchStart(Gt)},Vn=_t,An=Nt,jn=Gt=>{Ht(Gt),We.clear(),Qe.clear(),ot(),vt.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",qe.start(L,()=>{document.body.style.WebkitUserSelect=vt.current,_t(Gt)})},Li=Gt=>{q.props.onTouchEnd&&q.props.onTouchEnd(Gt),ot(),We.start(be,()=>{ct(Gt)})};Pe.useEffect(()=>{if(!it)return;function Gt(Xn){(Xn.key==="Escape"||Xn.key==="Esc")&&ct(Xn)}return document.addEventListener("keydown",Gt),()=>{document.removeEventListener("keydown",Gt)}},[ct,it]);const dr=yi(q.ref,hr,pe,n);!ne&&ne!==0&&(it=!1);const Hn=Pe.useRef(),is=Gt=>{const Xn=q.props;Xn.onMouseMove&&Xn.onMouseMove(Gt),gh={x:Gt.clientX,y:Gt.clientY},Hn.current&&Hn.current.update()},Dt={},Qs=typeof ne=="string";F?(Dt.title=!it&&Qs&&!Y?ne:null,Dt["aria-describedby"]=it?ht:null):(Dt["aria-label"]=Qs?ne:null,Dt["aria-labelledby"]=it&&!Qs?ht:null);const Ai=Le({},Dt,K,q.props,{className:Bt(K.className,q.props.className),onTouchStart:Ht,ref:dr},$?{onMouseMove:is}:{}),Si={};W||(Ai.onTouchStart=jn,Ai.onTouchEnd=Li),Y||(Ai.onMouseOver=Zf(Vn,Ai.onMouseOver),Ai.onMouseLeave=Zf(An,Ai.onMouseLeave),De||(Si.onMouseOver=Vn,Si.onMouseLeave=An)),U||(Ai.onFocus=Zf(tn,Ai.onFocus),Ai.onBlur=Zf(On,Ai.onBlur),De||(Si.onFocus=tn,Si.onBlur=On));const Br=Pe.useMemo(()=>{var Gt;let Xn=[{name:"arrow",enabled:!!we,options:{element:we,padding:4}}];return(Gt=Se.popperOptions)!=null&&Gt.modifiers&&(Xn=Xn.concat(Se.popperOptions.modifiers)),Le({},Se.popperOptions,{modifiers:Xn})},[we,Se]),Dr=Le({},x,{isRtl:ue,arrow:M,disableInteractive:De,placement:Z,PopperComponentProp:ye,touch:ze.current}),rs=_V(Dr),fr=(s=(m=ee.popper)!=null?m:R.Popper)!=null?s:TV,Ri=(b=(o=(r=ee.transition)!=null?r:R.Transition)!=null?o:O)!=null?b:O2,As=(u=(a=ee.tooltip)!=null?a:R.Tooltip)!=null?u:PV,Vr=(g=(c=ee.arrow)!=null?c:R.Arrow)!=null?g:MV,ra=Au(fr,Le({},Se,(l=X.popper)!=null?l:A.popper,{className:Bt(rs.popper,Se==null?void 0:Se.className,(h=(d=X.popper)!=null?d:A.popper)==null?void 0:h.className)}),Dr),fe=Au(Ri,Le({},z,(E=X.transition)!=null?E:A.transition),Dr),vn=Au(As,Le({},(f=X.tooltip)!=null?f:A.tooltip,{className:Bt(rs.tooltip,(y=(S=X.tooltip)!=null?S:A.tooltip)==null?void 0:y.className)}),Dr),Qt=Au(Vr,Le({},(_=X.arrow)!=null?_:A.arrow,{className:Bt(rs.arrow,(P=(w=X.arrow)!=null?w:A.arrow)==null?void 0:P.className)}),Dr);return Re.jsxs(Pe.Fragment,{children:[Pe.cloneElement(q,Ai),Re.jsx(fr,Le({as:ye??_6,placement:Z,anchorEl:$?{getBoundingClientRect:()=>({top:gh.y,left:gh.x,right:gh.x,bottom:gh.y,width:0,height:0})}:ce,popperRef:Hn,open:ce?it:!1,id:ht,transition:!0},Si,ra,{popperOptions:Br,children:({TransitionProps:Gt})=>Re.jsx(Ri,Le({timeout:de.transitions.duration.shorter},Gt,fe,{children:Re.jsxs(As,Le({},vn,{children:[ne,M?Re.jsx(Vr,Le({},Qt,{ref:Me})):null]}))}))}))]})}),LV=CV,AV=Pe.createContext(),G6=AV;function RV(e){return sn("MuiTable",e)}on("MuiTable",["root","stickyHeader"]);const IV=["className","component","padding","size","stickyHeader"],NV=e=>{const{classes:t,stickyHeader:n}=e;return rn({root:["root",n&&"stickyHeader"]},RV,t)},kV=Mt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>Le({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":Le({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),kS="table",OV=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTable"}),{className:m,component:b=kS,padding:o="normal",size:r="medium",stickyHeader:u=!1}=s,a=It(s,IV),g=Le({},s,{component:b,padding:o,size:r,stickyHeader:u}),c=NV(g),l=Pe.useMemo(()=>({padding:o,size:r,stickyHeader:u}),[o,r,u]);return Re.jsx(G6.Provider,{value:l,children:Re.jsx(kV,Le({as:b,role:b===kS?null:"table",ref:n,className:Bt(c.root,m),ownerState:g},a))})}),FV=OV,BV=Pe.createContext(),fm=BV;function DV(e){return sn("MuiTableBody",e)}on("MuiTableBody",["root"]);const VV=["className","component"],GV=e=>{const{classes:t}=e;return rn({root:["root"]},DV,t)},WV=Mt("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),zV={variant:"body"},OS="tbody",UV=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTableBody"}),{className:m,component:b=OS}=s,o=It(s,VV),r=Le({},s,{component:b}),u=GV(r);return Re.jsx(fm.Provider,{value:zV,children:Re.jsx(WV,Le({className:Bt(u.root,m),as:b,ref:n,role:b===OS?null:"rowgroup",ownerState:r},o))})}),$V=UV;function jV(e){return sn("MuiTableCell",e)}const HV=on("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),XV=HV,YV=["align","className","component","padding","scope","size","sortDirection","variant"],KV=e=>{const{classes:t,variant:n,align:s,padding:m,size:b,stickyHeader:o}=e,r={root:["root",n,o&&"stickyHeader",s!=="inherit"&&`align${wt(s)}`,m!=="normal"&&`padding${wt(m)}`,`size${wt(b)}`]};return rn(r,jV,t)},qV=Mt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${wt(n.size)}`],n.padding!=="normal"&&t[`padding${wt(n.padding)}`],n.align!=="inherit"&&t[`align${wt(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>Le({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid + ${e.palette.mode==="light"?n6(In(e.palette.divider,1),.88):t6(In(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${XV.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),QV=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTableCell"}),{align:m="inherit",className:b,component:o,padding:r,scope:u,size:a,sortDirection:g,variant:c}=s,l=It(s,YV),h=Pe.useContext(G6),d=Pe.useContext(fm),E=d&&d.variant==="head";let f;o?f=o:f=E?"th":"td";let y=u;f==="td"?y=void 0:!y&&E&&(y="col");const S=c||d&&d.variant,_=Le({},s,{align:m,component:f,padding:r||(h&&h.padding?h.padding:"normal"),size:a||(h&&h.size?h.size:"medium"),sortDirection:g,stickyHeader:S==="head"&&h&&h.stickyHeader,variant:S}),P=KV(_);let w=null;return g&&(w=g==="asc"?"ascending":"descending"),Re.jsx(qV,Le({as:f,ref:n,className:Bt(P.root,b),"aria-sort":w,scope:y,ownerState:_},l))}),mu=QV;function JV(e){return sn("MuiTableHead",e)}on("MuiTableHead",["root"]);const ZV=["className","component"],eG=e=>{const{classes:t}=e;return rn({root:["root"]},JV,t)},tG=Mt("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),nG={variant:"head"},FS="thead",iG=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTableHead"}),{className:m,component:b=FS}=s,o=It(s,ZV),r=Le({},s,{component:b}),u=eG(r);return Re.jsx(fm.Provider,{value:nG,children:Re.jsx(tG,Le({as:b,className:Bt(u.root,m),ref:n,role:b===FS?null:"rowgroup",ownerState:r},o))})}),rG=iG;function sG(e){return sn("MuiTableRow",e)}const oG=on("MuiTableRow",["root","selected","hover","head","footer"]),BS=oG,aG=["className","component","hover","selected"],lG=e=>{const{classes:t,selected:n,hover:s,head:m,footer:b}=e;return rn({root:["root",n&&"selected",s&&"hover",m&&"head",b&&"footer"]},sG,t)},uG=Mt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${BS.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${BS.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:In(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:In(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),DS="tr",cG=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTableRow"}),{className:m,component:b=DS,hover:o=!1,selected:r=!1}=s,u=It(s,aG),a=Pe.useContext(fm),g=Le({},s,{component:b,hover:o,selected:r,head:a&&a.variant==="head",footer:a&&a.variant==="footer"}),c=lG(g);return Re.jsx(uG,Le({as:b,ref:n,className:Bt(c.root,m),role:b===DS?null:"row",ownerState:g},u))}),VS=cG;function hG(e){return sn("MuiTextField",e)}on("MuiTextField",["root"]);const dG=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],fG={standard:I6,filled:C6,outlined:D6},pG=e=>{const{classes:t}=e;return rn({root:["root"]},hG,t)},mG=Mt(xB,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),gG=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiTextField"}),{autoComplete:m,autoFocus:b=!1,children:o,className:r,color:u="primary",defaultValue:a,disabled:g=!1,error:c=!1,FormHelperTextProps:l,fullWidth:h=!1,helperText:d,id:E,InputLabelProps:f,inputProps:y,InputProps:S,inputRef:_,label:P,maxRows:w,minRows:x,multiline:M=!1,name:N,onBlur:R,onChange:A,onFocus:F,placeholder:U,required:Y=!1,rows:k,select:W=!1,SelectProps:G,type:H,value:L,variant:$="outlined"}=s,ie=It(s,dG),re=Le({},s,{autoFocus:b,color:u,disabled:g,error:c,fullWidth:h,multiline:M,required:Y,select:W,variant:$}),be=pG(re),ae={};$==="outlined"&&(f&&typeof f.shrink<"u"&&(ae.notched=f.shrink),ae.label=P),W&&((!G||!G.native)&&(ae.id=void 0),ae["aria-describedby"]=void 0);const ge=H1(E),le=d&&ge?`${ge}-helper-text`:void 0,Z=P&&ge?`${ge}-label`:void 0,ye=fG[$],Se=Re.jsx(ye,Le({"aria-describedby":le,autoComplete:m,autoFocus:b,defaultValue:a,fullWidth:h,multiline:M,name:N,rows:k,maxRows:w,minRows:x,type:H,value:L,id:ge,inputRef:_,onBlur:R,onChange:A,onFocus:F,placeholder:U,inputProps:y},ae,S));return Re.jsxs(mG,Le({className:Bt(be.root,r),disabled:g,error:c,fullWidth:h,ref:n,required:Y,color:u,variant:$,ownerState:re},ie,{children:[P!=null&&P!==""&&Re.jsx(cD,Le({htmlFor:ge,id:Z},f,{children:P})),W?Re.jsx(vV,Le({"aria-describedby":le,id:ge,labelId:Z,value:L,input:Se},G,{children:o})):Se,d&&Re.jsx(LB,Le({id:le},l,{children:d}))]}))}),bG=gG;function yG(e){return sn("MuiToggleButton",e)}const vG=on("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),Iu=vG,SG=Pe.createContext({}),W6=SG,EG=Pe.createContext(void 0),z6=EG;function xG(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.indexOf(e)>=0:e===t}const wG=["value"],_G=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],TG=e=>{const{classes:t,fullWidth:n,selected:s,disabled:m,size:b,color:o}=e,r={root:["root",s&&"selected",m&&"disabled",n&&"fullWidth",`size${wt(b)}`,o]};return rn(r,yG,t)},PG=Mt(gc,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${wt(n.size)}`]]}})(({theme:e,ownerState:t})=>{let n=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,s;return e.vars&&(n=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,s=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),Le({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${Iu.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:In(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Iu.selected}`]:{color:n,backgroundColor:e.vars?`rgba(${s} / ${e.vars.palette.action.selectedOpacity})`:In(n,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${s} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:In(n,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${s} / ${e.vars.palette.action.selectedOpacity})`:In(n,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),MG=Pe.forwardRef(function(t,n){const s=Pe.useContext(W6),{value:m}=s,b=It(s,wG),o=Pe.useContext(z6),r=Y1(Le({},b,{selected:xG(t.value,m)}),t),u=an({props:r,name:"MuiToggleButton"}),{children:a,className:g,color:c="standard",disabled:l=!1,disableFocusRipple:h=!1,fullWidth:d=!1,onChange:E,onClick:f,selected:y,size:S="medium",value:_}=u,P=It(u,_G),w=Le({},u,{color:c,disabled:l,disableFocusRipple:h,fullWidth:d,size:S}),x=TG(w),M=R=>{f&&(f(R,_),R.defaultPrevented)||E&&E(R,_)},N=o||"";return Re.jsx(PG,Le({className:Bt(b.className,x.root,g,N),disabled:l,focusRipple:!h,ref:n,onClick:M,onChange:E,value:_,ownerState:w,"aria-pressed":y},P,{children:a}))}),ep=MG;function CG(e){return sn("MuiToggleButtonGroup",e)}const LG=on("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),ei=LG,AG=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],RG=e=>{const{classes:t,orientation:n,fullWidth:s,disabled:m}=e,b={root:["root",n==="vertical"&&"vertical",s&&"fullWidth"],grouped:["grouped",`grouped${wt(n)}`,m&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return rn(b,CG,t)},IG=Mt("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ei.grouped}`]:t.grouped},{[`& .${ei.grouped}`]:t[`grouped${wt(n.orientation)}`]},{[`& .${ei.firstButton}`]:t.firstButton},{[`& .${ei.lastButton}`]:t.lastButton},{[`& .${ei.middleButton}`]:t.middleButton},t.root,n.orientation==="vertical"&&t.vertical,n.fullWidth&&t.fullWidth]}})(({ownerState:e,theme:t})=>Le({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},e.orientation==="vertical"&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{[`& .${ei.grouped}`]:Le({},e.orientation==="horizontal"?{[`&.${ei.selected} + .${ei.grouped}.${ei.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${ei.selected} + .${ei.grouped}.${ei.selected}`]:{borderTop:0,marginTop:0}})},e.orientation==="horizontal"?{[`& .${ei.firstButton},& .${ei.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ei.lastButton},& .${ei.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${ei.firstButton},& .${ei.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ei.lastButton},& .${ei.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},e.orientation==="horizontal"?{[`& .${ei.lastButton}.${Iu.disabled},& .${ei.middleButton}.${Iu.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${ei.lastButton}.${Iu.disabled},& .${ei.middleButton}.${Iu.disabled}`]:{borderTop:"1px solid transparent"}})),NG=Pe.forwardRef(function(t,n){const s=an({props:t,name:"MuiToggleButtonGroup"}),{children:m,className:b,color:o="standard",disabled:r=!1,exclusive:u=!1,fullWidth:a=!1,onChange:g,orientation:c="horizontal",size:l="medium",value:h}=s,d=It(s,AG),E=Le({},s,{disabled:r,fullWidth:a,orientation:c,size:l}),f=RG(E),y=Pe.useCallback((M,N)=>{if(!g)return;const R=h&&h.indexOf(N);let A;h&&R>=0?(A=h.slice(),A.splice(R,1)):A=h?h.concat(N):[N],g(M,A)},[g,h]),S=Pe.useCallback((M,N)=>{g&&g(M,h===N?null:N)},[g,h]),_=Pe.useMemo(()=>({className:f.grouped,onChange:u?S:y,value:h,size:l,fullWidth:a,color:o,disabled:r}),[f.grouped,u,S,y,h,l,a,o,r]),P=jA(m),w=P.length,x=M=>{const N=M===0,R=M===w-1;return N&&R?"":N?f.firstButton:R?f.lastButton:f.middleButton};return Re.jsx(IG,Le({role:"group",className:Bt(f.root,b),ref:n,ownerState:E},d,{children:Re.jsx(W6.Provider,{value:_,children:P.map((M,N)=>Re.jsx(z6.Provider,{value:x(N),children:M},N))})}))}),kG=NG;var gy={},U6={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(U6);var Po=U6.exports,fg={};const OG=cP(zI);var GS;function Mo(){return GS||(GS=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=OG}(fg)),fg}var FG=Po;Object.defineProperty(gy,"__esModule",{value:!0});var Nl=gy.default=void 0,BG=FG(Mo()),DG=Re;Nl=gy.default=(0,BG.default)((0,DG.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var by={},VG=Po;Object.defineProperty(by,"__esModule",{value:!0});var $6=by.default=void 0,GG=VG(Mo()),WG=Re;$6=by.default=(0,GG.default)((0,WG.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");const pg={"{} { &":["æ","hAt"],"A O":["ɑ ɔ","cAUGHt, cOt"],I:["ɪ","bIt"],E:["ɛ","lEt"],"@ V":["ə ʌ","cUb"],U:["ʊ","lOOk"],"@` 3`":["ɚ ɝ","bIRd"],i:["i","sEEd"],N:["ŋ","haNG"],tS:["tʃ","CHild"],dZ:["dʒ","Jet"],T:["θ","THing"],D:["ð","wiTHer"],S:["ʃ","SHock"],Z:["ʒ","meaSure"],oU:["oʊ","dOE"],eI:["eɪ","hAY"],aI:["aɪ","lIE"],OI:["ɔɪ","OIl"],aU:["aʊ","OWl"],l:["l","Long"],r:["r","Red"],w:["w","Wonder"],j:["j","Yard"],m:["m","Mat"],n:["n","No"],h:["h","Hay"],k:["k","Cut"],g:["g","God"],p:["p","Pile"],b:["b","Bay"],t:["t","Toad"],d:["d","Dine"],f:["f","Fast"],v:["v","Vase"],s:["s","Sad"],z:["z","Zany"],u:["u","nEW"]},zG=()=>Re.jsxs(Wn,{item:!0,container:!0,direction:"column",mt:2,gap:3,width:"80%",alignItems:"flex-start",children:[Re.jsxs(Wn,{item:!0,container:!0,gap:3,children:[Re.jsx(ti,{textAlign:"start",variant:"body1",children:"OddVoices is a project to create free and open source singing synthesizers for American English. This is a Web frontend for OddVoices, whose C++ source has been compiled to WebAssembly, so everything happens in your browser and nothing is sent to a server. Please note that this is experimental alpha software and has many bugs."}),Re.jsxs(ti,{textAlign:"start",variant:"body1",children:["See ",Re.jsx("a",{href:"https://gitlab.com/oddvoices/oddvoices",children:"oddvoices/oddvoices"})," on GitLab for the core DSP code and command-line version of OddVoices, and"," ",Re.jsx("a",{href:"https://gitlab.com/oddvoices/oddvoices-web",children:"oddvoices/oddvoices-web"})," for the source code of this Web application."]}),Re.jsx(ti,{textAlign:"start",variant:"body1",children:'To use the application, enter some English text into the box, upload a monophonic MIDI file, and select which voice you want to use. You may also leave the text blank, and the app will look for MIDI lyric events. Click "Sing," wait a few seconds, and play the audio file with the controls. To save as a WAV file, use the three dots to the right (Chrome) or right click and press Save Audio As... (Firefox).'}),Re.jsx(ti,{textAlign:"start",variant:"body1",children:"There are no limits on the length of text or length of MIDI files, but you might stub your toe by running into browser memory limitations. If you encounter this, or need some form of batch processing, consider using the native command-line version."})]}),Re.jsx(Wn,{item:!0,children:Re.jsx(ti,{variant:"h6",children:"Phonetic entry"})}),Re.jsxs(Wn,{item:!0,container:!0,gap:3,children:[Re.jsxs(ti,{textAlign:"start",variant:"body1",children:["OddVoices uses the"," ",Re.jsx("a",{href:"http://www.speech.cs.cmu.edu/cgi-bin/cmudict",children:"CMU Pronouncing Dictionary"}),' to pronounce most words. OddVoices does not identify parts of speech, so heteronyms like "lead" and "read" are not handled intelligently. For OOV (out-of-vocabulary) words, OddVoices will guess the pronunciation by converting individual letters and pairs of letters to phonemes.']}),Re.jsxs(ti,{textAlign:"start",variant:"body1",children:["To supply custom pronunciations to override the defaults,"," ",Re.jsx("a",{href:"https://en.wikipedia.org/wiki/X-SAMPA",children:"X-SAMPA"})," notation is supported. Surround the X-SAMPA pronunciation with forward slashes (like this: /hEloU/ ) and make sure no additional punctuation immediately precedes or follows the slashes. The table of phonemes is:"]})]}),Re.jsx(Wn,{item:!0,width:"100%",children:Re.jsxs(Wu,{children:[Re.jsx(Uu,{expandIcon:Re.jsx(Nl,{}),children:Re.jsx(ti,{variant:"subtitle1",children:"Phoneme Guide"})}),Re.jsx(zu,{children:Re.jsxs(FV,{id:"phoneme-guide",stickyHeader:!0,sx:{"& td":{fontSize:18},"& th":{fontSize:24}},children:[Re.jsx(rG,{children:Re.jsxs(VS,{children:[Re.jsx(mu,{children:"X-SAMPA"}),Re.jsx(mu,{children:"IPA"}),Re.jsx(mu,{children:"Pronunciation"})]})}),Re.jsx($V,{children:Lt.map(Lt.keys(pg),e=>Re.jsxs(VS,{children:[Re.jsx(mu,{children:Lt.map(Lt.split(e," "),t=>`/${t}/`).join(", ")}),Re.jsx(mu,{children:Lt.map(Lt.split(pg[e][0]," "),t=>`/${t}/`).join(", ")}),Re.jsx(mu,{children:Lt.map(pg[e][1],(t,n)=>t!==t.toLowerCase()?Re.jsx("strong",{children:t.toLowerCase()},`${t}-${n}`):Re.jsx("span",{children:t},`${t}-${n}`))})]},e))})]})})]})}),Re.jsxs(Wn,{item:!0,container:!0,gap:3,children:[Re.jsxs(ti,{textAlign:"start",variant:"body1",children:["There are some peculiarities worth noting here. First is the"," ",Re.jsx("a",{href:"https://en.wikipedia.org/wiki/Cot%E2%80%93caught_merger",children:"cot-caught merger"})," that equates /ɑ/ and /ɔ/ along with other low back vowels. This admittedly reflects a bias towards the American West Coast and towards a younger demographic of singers. The exception to this merger is that /ɔr/ (h",Re.jsx("strong",{children:"or"}),"de) and /ɑr/ (h",Re.jsx("strong",{children:"ar"}),"d) are distinct. If you enter /O/ or /A/ they will sound the same in OddVoices, but /Or/ and /Ar/ are different."]}),Re.jsx(ti,{textAlign:"start",variant:"body1",children:`Second is the unification of /ə/ and /ʌ/. When sung, the English schwa is difficult to pin down and really represents a multitude of vowels. In varieties of North American English, /ə/ and /ʌ/ are closely linked and differ primarily by stress, so /ʌ/ is the best candidate for absorbing /ə/. Similarly, OddVoices doesn't distinguish /ɚ/ and /ɝ/. The CMU Pronouncing Dictionary unfortunately uses schwas a lot, so OddVoices enunciates a lot of words weirdly, like "im-uh-tate" for "imitate."`}),Re.jsxs(ti,{textAlign:"start",variant:"body1",children:["Finally, X-SAMPA's /{/ causes bracket matching issues in some text editors, so /","/ and /&/ are provided as alternatives. The latter is borrowed from the so-called"," ",Re.jsx("a",{href:"https://www.vulgarlang.com/ipa-x-sampa-cxs-converter/",children:"Conlang X-SAMPA"})," or CXS."]})]})]});var j6={exports:{}};/*! For license information please see opensheetmusicdisplay.min.js.LICENSE.txt */(function(e,t){(function(n,s){e.exports=s()})(gu,()=>(()=>{var n={5733:(b,o,r)=>{b.exports=function u(a,g,c){function l(E,f){if(!g[E]){if(!a[E]){if(h)return h(E,!0);var y=new Error("Cannot find module '"+E+"'");throw y.code="MODULE_NOT_FOUND",y}var S=g[E]={exports:{}};a[E][0].call(S.exports,function(_){return l(a[E][1][_]||_)},S,S.exports,u,a,g,c)}return g[E].exports}for(var h=void 0,d=0;d>2,_=(3&E)<<4|f>>4,P=1>6:64,w=2>4,f=(15&S)<<4|(_=h.indexOf(d.charAt(w++)))>>2,y=(3&_)<<6|(P=h.indexOf(d.charAt(w++))),N[x++]=E,_!==64&&(N[x++]=f),P!==64&&(N[x++]=y);return N}},{"./support":30,"./utils":32}],2:[function(u,a,g){var c=u("./external"),l=u("./stream/DataWorker"),h=u("./stream/Crc32Probe"),d=u("./stream/DataLengthProbe");function E(f,y,S,_,P){this.compressedSize=f,this.uncompressedSize=y,this.crc32=S,this.compression=_,this.compressedContent=P}E.prototype={getContentWorker:function(){var f=new l(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),y=this;return f.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new l(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},E.createWorkerFrom=function(f,y,S){return f.pipe(new h).pipe(new d("uncompressedSize")).pipe(y.compressWorker(S)).pipe(new d("compressedSize")).withStreamInfo("compression",y)},a.exports=E},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(u,a,g){var c=u("./stream/GenericWorker");g.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},g.DEFLATE=u("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(u,a,g){var c=u("./utils"),l=function(){for(var h,d=[],E=0;E<256;E++){h=E;for(var f=0;f<8;f++)h=1&h?3988292384^h>>>1:h>>>1;d[E]=h}return d}();a.exports=function(h,d){return h!==void 0&&h.length?c.getTypeOf(h)!=="string"?function(E,f,y,S){var _=l,P=0+y;E^=-1;for(var w=0;w>>8^_[255&(E^f[w])];return-1^E}(0|d,h,h.length):function(E,f,y,S){var _=l,P=0+y;E^=-1;for(var w=0;w>>8^_[255&(E^f.charCodeAt(w))];return-1^E}(0|d,h,h.length):0}},{"./utils":32}],5:[function(u,a,g){g.base64=!1,g.binary=!1,g.dir=!1,g.createFolders=!0,g.date=null,g.compression=null,g.compressionOptions=null,g.comment=null,g.unixPermissions=null,g.dosPermissions=null},{}],6:[function(u,a,g){var c;c=typeof Promise<"u"?Promise:u("lie"),a.exports={Promise:c}},{lie:37}],7:[function(u,a,g){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",l=u("pako"),h=u("./utils"),d=u("./stream/GenericWorker"),E=c?"uint8array":"array";function f(y,S){d.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=S,this.meta={}}g.magic="\b\0",h.inherits(f,d),f.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(E,y.data),!1)},f.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new l[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(S){y.push({data:S,meta:y.meta})}},g.compressWorker=function(y){return new f("Deflate",y)},g.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(u,a,g){function c(_,P){var w,x="";for(w=0;w>>=8;return x}function l(_,P,w,x,M,N){var R,A,F=_.file,U=_.compression,Y=N!==E.utf8encode,k=h.transformTo("string",N(F.name)),W=h.transformTo("string",E.utf8encode(F.name)),G=F.comment,H=h.transformTo("string",N(G)),L=h.transformTo("string",E.utf8encode(G)),$=W.length!==F.name.length,ie=L.length!==G.length,re="",be="",ae="",ge=F.dir,le=F.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};P&&!w||(Z.crc32=_.crc32,Z.compressedSize=_.compressedSize,Z.uncompressedSize=_.uncompressedSize);var ye=0;P&&(ye|=8),Y||!$&&!ie||(ye|=2048);var Se=0,X=0;ge&&(Se|=16),M==="UNIX"?(X=798,Se|=function(ne,O){var z=ne;return ne||(z=O?16893:33204),(65535&z)<<16}(F.unixPermissions,ge)):(X=20,Se|=function(ne){return 63&(ne||0)}(F.dosPermissions)),R=le.getUTCHours(),R<<=6,R|=le.getUTCMinutes(),R<<=5,R|=le.getUTCSeconds()/2,A=le.getUTCFullYear()-1980,A<<=4,A|=le.getUTCMonth()+1,A<<=5,A|=le.getUTCDate(),$&&(be=c(1,1)+c(f(k),4)+W,re+="up"+c(be.length,2)+be),ie&&(ae=c(1,1)+c(f(H),4)+L,re+="uc"+c(ae.length,2)+ae);var ee="";return ee+=` +\0`,ee+=c(ye,2),ee+=U.magic,ee+=c(R,2),ee+=c(A,2),ee+=c(Z.crc32,4),ee+=c(Z.compressedSize,4),ee+=c(Z.uncompressedSize,4),ee+=c(k.length,2),ee+=c(re.length,2),{fileRecord:y.LOCAL_FILE_HEADER+ee+k+re,dirRecord:y.CENTRAL_FILE_HEADER+c(X,2)+ee+c(H.length,2)+"\0\0\0\0"+c(Se,4)+c(x,4)+k+re+H}}var h=u("../utils"),d=u("../stream/GenericWorker"),E=u("../utf8"),f=u("../crc32"),y=u("../signature");function S(_,P,w,x){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=P,this.zipPlatform=w,this.encodeFileName=x,this.streamFiles=_,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(S,d),S.prototype.push=function(_){var P=_.meta.percent||0,w=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(_):(this.bytesWritten+=_.data.length,d.prototype.push.call(this,{data:_.data,meta:{currentFile:this.currentFile,percent:w?(P+100*(w-x-1))/w:100}}))},S.prototype.openedSource=function(_){this.currentSourceOffset=this.bytesWritten,this.currentFile=_.file.name;var P=this.streamFiles&&!_.file.dir;if(P){var w=l(_,P,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:w.fileRecord,meta:{percent:0}})}else this.accumulate=!0},S.prototype.closedSource=function(_){this.accumulate=!1;var P=this.streamFiles&&!_.file.dir,w=l(_,P,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(w.dirRecord),P)this.push({data:function(x){return y.DATA_DESCRIPTOR+c(x.crc32,4)+c(x.compressedSize,4)+c(x.uncompressedSize,4)}(_),meta:{percent:100}});else for(this.push({data:w.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},S.prototype.flush=function(){for(var _=this.bytesWritten,P=0;P=this.index;d--)E=(E<<8)+this.byteAt(d);return this.index+=h,E},readString:function(h){return c.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},a.exports=l},{"../utils":32}],19:[function(u,a,g){var c=u("./Uint8ArrayReader");function l(h){c.call(this,h)}u("../utils").inherits(l,c),l.prototype.readData=function(h){this.checkOffset(h);var d=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,d},a.exports=l},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(u,a,g){var c=u("./DataReader");function l(h){c.call(this,h)}u("../utils").inherits(l,c),l.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},l.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},l.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},l.prototype.readData=function(h){this.checkOffset(h);var d=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,d},a.exports=l},{"../utils":32,"./DataReader":18}],21:[function(u,a,g){var c=u("./ArrayReader");function l(h){c.call(this,h)}u("../utils").inherits(l,c),l.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,d},a.exports=l},{"../utils":32,"./ArrayReader":17}],22:[function(u,a,g){var c=u("../utils"),l=u("../support"),h=u("./ArrayReader"),d=u("./StringReader"),E=u("./NodeBufferReader"),f=u("./Uint8ArrayReader");a.exports=function(y){var S=c.getTypeOf(y);return c.checkSupport(S),S!=="string"||l.uint8array?S==="nodebuffer"?new E(y):l.uint8array?new f(c.transformTo("uint8array",y)):new h(c.transformTo("array",y)):new d(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(u,a,g){g.LOCAL_FILE_HEADER="PK",g.CENTRAL_FILE_HEADER="PK",g.CENTRAL_DIRECTORY_END="PK",g.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",g.ZIP64_CENTRAL_DIRECTORY_END="PK",g.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(u,a,g){var c=u("./GenericWorker"),l=u("../utils");function h(d){c.call(this,"ConvertWorker to "+d),this.destType=d}l.inherits(h,c),h.prototype.processChunk=function(d){this.push({data:l.transformTo(this.destType,d.data),meta:d.meta})},a.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(u,a,g){var c=u("./GenericWorker"),l=u("../crc32");function h(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}u("../utils").inherits(h,c),h.prototype.processChunk=function(d){this.streamInfo.crc32=l(d.data,this.streamInfo.crc32||0),this.push(d)},a.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(u,a,g){var c=u("../utils"),l=u("./GenericWorker");function h(d){l.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}c.inherits(h,l),h.prototype.processChunk=function(d){if(d){var E=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=E+d.data.length}l.prototype.processChunk.call(this,d)},a.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(u,a,g){var c=u("../utils"),l=u("./GenericWorker");function h(d){l.call(this,"DataWorker");var E=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(f){E.dataIsReady=!0,E.data=f,E.max=f&&f.length||0,E.type=c.getTypeOf(f),E.isPaused||E._tickAndRepeat()},function(f){E.error(f)})}c.inherits(h,l),h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,E=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,E);break;case"uint8array":d=this.data.subarray(this.index,E);break;case"array":case"nodebuffer":d=this.data.slice(this.index,E)}return this.index=E,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},a.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(u,a,g){function c(l){this.name=l||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(l){this.emit("data",l)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(l){this.emit("error",l)}return!0},error:function(l){return!this.isFinished&&(this.isPaused?this.generatedError=l:(this.isFinished=!0,this.emit("error",l),this.previous&&this.previous.error(l),this.cleanUp()),!0)},on:function(l,h){return this._listeners[l].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(l,h){if(this._listeners[l])for(var d=0;d "+l:l}},a.exports=c},{}],29:[function(u,a,g){var c=u("../utils"),l=u("./ConvertWorker"),h=u("./GenericWorker"),d=u("../base64"),E=u("../support"),f=u("../external"),y=null;if(E.nodestream)try{y=u("../nodejs/NodejsStreamOutputAdapter")}catch{}function S(_,P,w){var x=P;switch(P){case"blob":case"arraybuffer":x="uint8array";break;case"base64":x="string"}try{this._internalType=x,this._outputType=P,this._mimeType=w,c.checkSupport(x),this._worker=_.pipe(new l(x)),_.lock()}catch(M){this._worker=new h("error"),this._worker.error(M)}}S.prototype={accumulate:function(_){return function(P,w){return new f.Promise(function(x,M){var N=[],R=P._internalType,A=P._outputType,F=P._mimeType;P.on("data",function(U,Y){N.push(U),w&&w(Y)}).on("error",function(U){N=[],M(U)}).on("end",function(){try{var U=function(Y,k,W){switch(Y){case"blob":return c.newBlob(c.transformTo("arraybuffer",k),W);case"base64":return d.encode(k);default:return c.transformTo(Y,k)}}(A,function(Y,k){var W,G=0,H=null,L=0;for(W=0;W"u")g.blob=!1;else{var c=new ArrayBuffer(0);try{g.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);l.append(c),g.blob=l.getBlob("application/zip").size===0}catch{g.blob=!1}}}try{g.nodestream=!!u("readable-stream").Readable}catch{g.nodestream=!1}},{"readable-stream":16}],31:[function(u,a,g){for(var c=u("./utils"),l=u("./support"),h=u("./nodejsUtils"),d=u("./stream/GenericWorker"),E=new Array(256),f=0;f<256;f++)E[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function y(){d.call(this,"utf-8 decode"),this.leftOver=null}function S(){d.call(this,"utf-8 encode")}E[254]=E[254]=1,g.utf8encode=function(_){return l.nodebuffer?h.newBufferFrom(_,"utf-8"):function(P){var w,x,M,N,R,A=P.length,F=0;for(N=0;N>>6:(x<65536?w[R++]=224|x>>>12:(w[R++]=240|x>>>18,w[R++]=128|x>>>12&63),w[R++]=128|x>>>6&63),w[R++]=128|63&x);return w}(_)},g.utf8decode=function(_){return l.nodebuffer?c.transformTo("nodebuffer",_).toString("utf-8"):function(P){var w,x,M,N,R=P.length,A=new Array(2*R);for(w=x=0;w>10&1023,A[x++]=56320|1023&M)}return A.length!==x&&(A.subarray?A=A.subarray(0,x):A.length=x),c.applyFromCharCode(A)}(_=c.transformTo(l.uint8array?"uint8array":"array",_))},c.inherits(y,d),y.prototype.processChunk=function(_){var P=c.transformTo(l.uint8array?"uint8array":"array",_.data);if(this.leftOver&&this.leftOver.length){if(l.uint8array){var w=P;(P=new Uint8Array(w.length+this.leftOver.length)).set(this.leftOver,0),P.set(w,this.leftOver.length)}else P=this.leftOver.concat(P);this.leftOver=null}var x=function(N,R){var A;for((R=R||N.length)>N.length&&(R=N.length),A=R-1;0<=A&&(192&N[A])==128;)A--;return A<0||A===0?R:A+E[N[A]]>R?A:R}(P),M=P;x!==P.length&&(l.uint8array?(M=P.subarray(0,x),this.leftOver=P.subarray(x,P.length)):(M=P.slice(0,x),this.leftOver=P.slice(x,P.length))),this.push({data:g.utf8decode(M),meta:_.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:g.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},g.Utf8DecodeWorker=y,c.inherits(S,d),S.prototype.processChunk=function(_){this.push({data:g.utf8encode(_.data),meta:_.meta})},g.Utf8EncodeWorker=S},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(u,a,g){var c=u("./support"),l=u("./base64"),h=u("./nodejsUtils"),d=u("./external");function E(w){return w}function f(w,x){for(var M=0;M>8;this.dir=!!(16&this.externalFileAttributes),_==0&&(this.dosPermissions=63&this.externalFileAttributes),_==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var _=c(this.extraFields[1].value);this.uncompressedSize===l.MAX_VALUE_32BITS&&(this.uncompressedSize=_.readInt(8)),this.compressedSize===l.MAX_VALUE_32BITS&&(this.compressedSize=_.readInt(8)),this.localHeaderOffset===l.MAX_VALUE_32BITS&&(this.localHeaderOffset=_.readInt(8)),this.diskNumberStart===l.MAX_VALUE_32BITS&&(this.diskNumberStart=_.readInt(4))}},readExtraFields:function(_){var P,w,x,M=_.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});_.index+4>>6:(_<65536?S[x++]=224|_>>>12:(S[x++]=240|_>>>18,S[x++]=128|_>>>12&63),S[x++]=128|_>>>6&63),S[x++]=128|63&_);return S},g.buf2binstring=function(y){return f(y,y.length)},g.binstring2buf=function(y){for(var S=new c.Buf8(y.length),_=0,P=S.length;_>10&1023,N[P++]=56320|1023&w)}return f(N,P)},g.utf8border=function(y,S){var _;for((S=S||y.length)>y.length&&(S=y.length),_=S-1;0<=_&&(192&y[_])==128;)_--;return _<0||_===0?S:_+d[y[_]]>S?_:S}},{"./common":41}],43:[function(u,a,g){a.exports=function(c,l,h,d){for(var E=65535&c|0,f=c>>>16&65535|0,y=0;h!==0;){for(h-=y=2e3>>1:l>>>1;h[d]=l}return h}();a.exports=function(l,h,d,E){var f=c,y=E+d;l^=-1;for(var S=E;S>>8^f[255&(l^h[S])];return-1^l}},{}],46:[function(u,a,g){var c,l=u("../utils/common"),h=u("./trees"),d=u("./adler32"),E=u("./crc32"),f=u("./messages"),y=0,S=0,_=-2,P=2,w=8,x=286,M=30,N=19,R=2*x+1,A=15,F=3,U=258,Y=U+F+1,k=42,W=113;function G(O,z){return O.msg=f[z],z}function H(O){return(O<<1)-(4O.avail_out&&(K=O.avail_out),K!==0&&(l.arraySet(O.output,z.pending_buf,z.pending_out,K,O.next_out),O.next_out+=K,z.pending_out+=K,O.total_out+=K,O.avail_out-=K,z.pending-=K,z.pending===0&&(z.pending_out=0))}function ie(O,z){h._tr_flush_block(O,0<=O.block_start?O.block_start:-1,O.strstart-O.block_start,z),O.block_start=O.strstart,$(O.strm)}function re(O,z){O.pending_buf[O.pending++]=z}function be(O,z){O.pending_buf[O.pending++]=z>>>8&255,O.pending_buf[O.pending++]=255&z}function ae(O,z){var K,q,de=O.max_chain_length,ue=O.strstart,ce=O.prev_length,pe=O.nice_match,we=O.strstart>O.w_size-Y?O.strstart-(O.w_size-Y):0,Me=O.window,ze=O.w_mask,De=O.prev,Qe=O.strstart+U,ke=Me[ue+ce-1],We=Me[ue+ce];O.prev_length>=O.good_match&&(de>>=2),pe>O.lookahead&&(pe=O.lookahead);do if(Me[(K=z)+ce]===We&&Me[K+ce-1]===ke&&Me[K]===Me[ue]&&Me[++K]===Me[ue+1]){ue+=2,K++;do;while(Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&Me[++ue]===Me[++K]&&uewe&&--de!=0);return ce<=O.lookahead?ce:O.lookahead}function ge(O){var z,K,q,de,ue,ce,pe,we,Me,ze,De=O.w_size;do{if(de=O.window_size-O.lookahead-O.strstart,O.strstart>=De+(De-Y)){for(l.arraySet(O.window,O.window,De,De,0),O.match_start-=De,O.strstart-=De,O.block_start-=De,z=K=O.hash_size;q=O.head[--z],O.head[z]=De<=q?q-De:0,--K;);for(z=K=De;q=O.prev[--z],O.prev[z]=De<=q?q-De:0,--K;);de+=De}if(O.strm.avail_in===0)break;if(ce=O.strm,pe=O.window,we=O.strstart+O.lookahead,ze=void 0,(Me=de)<(ze=ce.avail_in)&&(ze=Me),K=ze===0?0:(ce.avail_in-=ze,l.arraySet(pe,ce.input,ce.next_in,ze,we),ce.state.wrap===1?ce.adler=d(ce.adler,pe,ze,we):ce.state.wrap===2&&(ce.adler=E(ce.adler,pe,ze,we)),ce.next_in+=ze,ce.total_in+=ze,ze),O.lookahead+=K,O.lookahead+O.insert>=F)for(ue=O.strstart-O.insert,O.ins_h=O.window[ue],O.ins_h=(O.ins_h<=F&&(O.ins_h=(O.ins_h<=F)if(q=h._tr_tally(O,O.strstart-O.match_start,O.match_length-F),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=F){for(O.match_length--;O.strstart++,O.ins_h=(O.ins_h<=F&&(O.ins_h=(O.ins_h<=F&&O.match_length<=O.prev_length){for(de=O.strstart+O.lookahead-F,q=h._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-F),O.lookahead-=O.prev_length-1,O.prev_length-=2;++O.strstart<=de&&(O.ins_h=(O.ins_h<O.pending_buf_size-5&&(K=O.pending_buf_size-5);;){if(O.lookahead<=1){if(ge(O),O.lookahead===0&&z===y)return 1;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var q=O.block_start+K;if((O.strstart===0||O.strstart>=q)&&(O.lookahead=O.strstart-q,O.strstart=q,ie(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-Y&&(ie(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,z===4?(ie(O,!0),O.strm.avail_out===0?3:4):(O.strstart>O.block_start&&(ie(O,!1),O.strm.avail_out),1)}),new ye(4,4,8,4,le),new ye(4,5,16,8,le),new ye(4,6,32,32,le),new ye(4,4,16,16,Z),new ye(8,16,32,32,Z),new ye(8,16,128,128,Z),new ye(8,32,128,256,Z),new ye(32,128,258,1024,Z),new ye(32,258,258,4096,Z)],g.deflateInit=function(O,z){return ne(O,z,w,15,8,0)},g.deflateInit2=ne,g.deflateReset=ee,g.deflateResetKeep=X,g.deflateSetHeader=function(O,z){return O&&O.state?O.state.wrap!==2?_:(O.state.gzhead=z,S):_},g.deflate=function(O,z){var K,q,de,ue;if(!O||!O.state||5>8&255),re(q,q.gzhead.time>>16&255),re(q,q.gzhead.time>>24&255),re(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),re(q,255&q.gzhead.os),q.gzhead.extra&&q.gzhead.extra.length&&(re(q,255&q.gzhead.extra.length),re(q,q.gzhead.extra.length>>8&255)),q.gzhead.hcrc&&(O.adler=E(O.adler,q.pending_buf,q.pending,0)),q.gzindex=0,q.status=69):(re(q,0),re(q,0),re(q,0),re(q,0),re(q,0),re(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),re(q,3),q.status=W);else{var ce=w+(q.w_bits-8<<4)<<8;ce|=(2<=q.strategy||q.level<2?0:q.level<6?1:q.level===6?2:3)<<6,q.strstart!==0&&(ce|=32),ce+=31-ce%31,q.status=W,be(q,ce),q.strstart!==0&&(be(q,O.adler>>>16),be(q,65535&O.adler)),O.adler=1}if(q.status===69)if(q.gzhead.extra){for(de=q.pending;q.gzindex<(65535&q.gzhead.extra.length)&&(q.pending!==q.pending_buf_size||(q.gzhead.hcrc&&q.pending>de&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),$(O),de=q.pending,q.pending!==q.pending_buf_size));)re(q,255&q.gzhead.extra[q.gzindex]),q.gzindex++;q.gzhead.hcrc&&q.pending>de&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),q.gzindex===q.gzhead.extra.length&&(q.gzindex=0,q.status=73)}else q.status=73;if(q.status===73)if(q.gzhead.name){de=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>de&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),$(O),de=q.pending,q.pending===q.pending_buf_size)){ue=1;break}ue=q.gzindexde&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),ue===0&&(q.gzindex=0,q.status=91)}else q.status=91;if(q.status===91)if(q.gzhead.comment){de=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>de&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),$(O),de=q.pending,q.pending===q.pending_buf_size)){ue=1;break}ue=q.gzindexde&&(O.adler=E(O.adler,q.pending_buf,q.pending-de,de)),ue===0&&(q.status=103)}else q.status=103;if(q.status===103&&(q.gzhead.hcrc?(q.pending+2>q.pending_buf_size&&$(O),q.pending+2<=q.pending_buf_size&&(re(q,255&O.adler),re(q,O.adler>>8&255),O.adler=0,q.status=W)):q.status=W),q.pending!==0){if($(O),O.avail_out===0)return q.last_flush=-1,S}else if(O.avail_in===0&&H(z)<=H(K)&&z!==4)return G(O,-5);if(q.status===666&&O.avail_in!==0)return G(O,-5);if(O.avail_in!==0||q.lookahead!==0||z!==y&&q.status!==666){var pe=q.strategy===2?function(we,Me){for(var ze;;){if(we.lookahead===0&&(ge(we),we.lookahead===0)){if(Me===y)return 1;break}if(we.match_length=0,ze=h._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++,ze&&(ie(we,!1),we.strm.avail_out===0))return 1}return we.insert=0,Me===4?(ie(we,!0),we.strm.avail_out===0?3:4):we.last_lit&&(ie(we,!1),we.strm.avail_out===0)?1:2}(q,z):q.strategy===3?function(we,Me){for(var ze,De,Qe,ke,We=we.window;;){if(we.lookahead<=U){if(ge(we),we.lookahead<=U&&Me===y)return 1;if(we.lookahead===0)break}if(we.match_length=0,we.lookahead>=F&&0we.lookahead&&(we.match_length=we.lookahead)}if(we.match_length>=F?(ze=h._tr_tally(we,1,we.match_length-F),we.lookahead-=we.match_length,we.strstart+=we.match_length,we.match_length=0):(ze=h._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++),ze&&(ie(we,!1),we.strm.avail_out===0))return 1}return we.insert=0,Me===4?(ie(we,!0),we.strm.avail_out===0?3:4):we.last_lit&&(ie(we,!1),we.strm.avail_out===0)?1:2}(q,z):c[q.level].func(q,z);if(pe!==3&&pe!==4||(q.status=666),pe===1||pe===3)return O.avail_out===0&&(q.last_flush=-1),S;if(pe===2&&(z===1?h._tr_align(q):z!==5&&(h._tr_stored_block(q,0,0,!1),z===3&&(L(q.head),q.lookahead===0&&(q.strstart=0,q.block_start=0,q.insert=0))),$(O),O.avail_out===0))return q.last_flush=-1,S}return z!==4?S:q.wrap<=0?1:(q.wrap===2?(re(q,255&O.adler),re(q,O.adler>>8&255),re(q,O.adler>>16&255),re(q,O.adler>>24&255),re(q,255&O.total_in),re(q,O.total_in>>8&255),re(q,O.total_in>>16&255),re(q,O.total_in>>24&255)):(be(q,O.adler>>>16),be(q,65535&O.adler)),$(O),0=K.w_size&&(ue===0&&(L(K.head),K.strstart=0,K.block_start=0,K.insert=0),Me=new l.Buf8(K.w_size),l.arraySet(Me,z,ze-K.w_size,K.w_size,0),z=Me,ze=K.w_size),ce=O.avail_in,pe=O.next_in,we=O.input,O.avail_in=ze,O.next_in=0,O.input=z,ge(K);K.lookahead>=F;){for(q=K.strstart,de=K.lookahead-(F-1);K.ins_h=(K.ins_h<>>=W=k>>>24,R-=W,(W=k>>>16&255)==0)re[f++]=65535&k;else{if(!(16&W)){if(!(64&W)){k=A[(65535&k)+(N&(1<>>=W,R-=W),R<15&&(N+=ie[d++]<>>=W=k>>>24,R-=W,!(16&(W=k>>>16&255))){if(!(64&W)){k=F[(65535&k)+(N&(1<>>=W,R-=W,(W=f-y)>3,N&=(1<<(R-=G<<3))-1,c.next_in=d,c.next_out=f,c.avail_in=d>>24&255)+(G>>>8&65280)+((65280&G)<<8)+((255&G)<<24)}function x(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(G){var H;return G&&G.state?(H=G.state,G.total_in=G.total_out=H.total=0,G.msg="",H.wrap&&(G.adler=1&H.wrap),H.mode=S,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new c.Buf32(_),H.distcode=H.distdyn=new c.Buf32(P),H.sane=1,H.back=-1,f):y}function N(G){var H;return G&&G.state?((H=G.state).wsize=0,H.whave=0,H.wnext=0,M(G)):y}function R(G,H){var L,$;return G&&G.state?($=G.state,H<0?(L=0,H=-H):(L=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15=re.wsize?(c.arraySet(re.window,H,L-re.wsize,re.wsize,0),re.wnext=0,re.whave=re.wsize):($<(ie=re.wsize-re.wnext)&&(ie=$),c.arraySet(re.window,H,L-$,ie,re.wnext),($-=ie)?(c.arraySet(re.window,H,L-$,$,0),re.wnext=$,re.whave=re.wsize):(re.wnext+=ie,re.wnext===re.wsize&&(re.wnext=0),re.whave>>8&255,L.check=h(L.check,De,2,0),Z=le=0,L.mode=2;break}if(L.flags=0,L.head&&(L.head.done=!1),!(1&L.wrap)||(((255&le)<<8)+(le>>8))%31){G.msg="incorrect header check",L.mode=30;break}if((15&le)!=8){G.msg="unknown compression method",L.mode=30;break}if(Z-=4,ce=8+(15&(le>>>=4)),L.wbits===0)L.wbits=ce;else if(ce>L.wbits){G.msg="invalid window size",L.mode=30;break}L.dmax=1<>8&1),512&L.flags&&(De[0]=255&le,De[1]=le>>>8&255,L.check=h(L.check,De,2,0)),Z=le=0,L.mode=3;case 3:for(;Z<32;){if(ae===0)break e;ae--,le+=$[re++]<>>8&255,De[2]=le>>>16&255,De[3]=le>>>24&255,L.check=h(L.check,De,4,0)),Z=le=0,L.mode=4;case 4:for(;Z<16;){if(ae===0)break e;ae--,le+=$[re++]<>8),512&L.flags&&(De[0]=255&le,De[1]=le>>>8&255,L.check=h(L.check,De,2,0)),Z=le=0,L.mode=5;case 5:if(1024&L.flags){for(;Z<16;){if(ae===0)break e;ae--,le+=$[re++]<>>8&255,L.check=h(L.check,De,2,0)),Z=le=0}else L.head&&(L.head.extra=null);L.mode=6;case 6:if(1024&L.flags&&(ae<(X=L.length)&&(X=ae),X&&(L.head&&(ce=L.head.extra_len-L.length,L.head.extra||(L.head.extra=new Array(L.head.extra_len)),c.arraySet(L.head.extra,$,re,X,ce)),512&L.flags&&(L.check=h(L.check,$,X,re)),ae-=X,re+=X,L.length-=X),L.length))break e;L.length=0,L.mode=7;case 7:if(2048&L.flags){if(ae===0)break e;for(X=0;ce=$[re+X++],L.head&&ce&&L.length<65536&&(L.head.name+=String.fromCharCode(ce)),ce&&X>9&1,L.head.done=!0),G.adler=L.check=0,L.mode=12;break;case 10:for(;Z<32;){if(ae===0)break e;ae--,le+=$[re++]<>>=7&Z,Z-=7&Z,L.mode=27;break}for(;Z<3;){if(ae===0)break e;ae--,le+=$[re++]<>>=1)){case 0:L.mode=14;break;case 1:if(k(L),L.mode=20,H!==6)break;le>>>=2,Z-=2;break e;case 2:L.mode=17;break;case 3:G.msg="invalid block type",L.mode=30}le>>>=2,Z-=2;break;case 14:for(le>>>=7&Z,Z-=7&Z;Z<32;){if(ae===0)break e;ae--,le+=$[re++]<>>16^65535)){G.msg="invalid stored block lengths",L.mode=30;break}if(L.length=65535&le,Z=le=0,L.mode=15,H===6)break e;case 15:L.mode=16;case 16:if(X=L.length){if(ae>>=5,Z-=5,L.ndist=1+(31&le),le>>>=5,Z-=5,L.ncode=4+(15&le),le>>>=4,Z-=4,286>>=3,Z-=3}for(;L.have<19;)L.lens[Qe[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,we={bits:L.lenbits},pe=E(0,L.lens,0,19,L.lencode,0,L.work,we),L.lenbits=we.bits,pe){G.msg="invalid code lengths set",L.mode=30;break}L.have=0,L.mode=19;case 19:for(;L.have>>16&255,K=65535&ze,!((O=ze>>>24)<=Z);){if(ae===0)break e;ae--,le+=$[re++]<>>=O,Z-=O,L.lens[L.have++]=K;else{if(K===16){for(Me=O+2;Z>>=O,Z-=O,L.have===0){G.msg="invalid bit length repeat",L.mode=30;break}ce=L.lens[L.have-1],X=3+(3&le),le>>>=2,Z-=2}else if(K===17){for(Me=O+3;Z>>=O)),le>>>=3,Z-=3}else{for(Me=O+7;Z>>=O)),le>>>=7,Z-=7}if(L.have+X>L.nlen+L.ndist){G.msg="invalid bit length repeat",L.mode=30;break}for(;X--;)L.lens[L.have++]=ce}}if(L.mode===30)break;if(L.lens[256]===0){G.msg="invalid code -- missing end-of-block",L.mode=30;break}if(L.lenbits=9,we={bits:L.lenbits},pe=E(1,L.lens,0,L.nlen,L.lencode,0,L.work,we),L.lenbits=we.bits,pe){G.msg="invalid literal/lengths set",L.mode=30;break}if(L.distbits=6,L.distcode=L.distdyn,we={bits:L.distbits},pe=E(2,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,we),L.distbits=we.bits,pe){G.msg="invalid distances set",L.mode=30;break}if(L.mode=20,H===6)break e;case 20:L.mode=21;case 21:if(6<=ae&&258<=ge){G.next_out=be,G.avail_out=ge,G.next_in=re,G.avail_in=ae,L.hold=le,L.bits=Z,d(G,Se),be=G.next_out,ie=G.output,ge=G.avail_out,re=G.next_in,$=G.input,ae=G.avail_in,le=L.hold,Z=L.bits,L.mode===12&&(L.back=-1);break}for(L.back=0;z=(ze=L.lencode[le&(1<>>16&255,K=65535&ze,!((O=ze>>>24)<=Z);){if(ae===0)break e;ae--,le+=$[re++]<>q)])>>>16&255,K=65535&ze,!(q+(O=ze>>>24)<=Z);){if(ae===0)break e;ae--,le+=$[re++]<>>=q,Z-=q,L.back+=q}if(le>>>=O,Z-=O,L.back+=O,L.length=K,z===0){L.mode=26;break}if(32&z){L.back=-1,L.mode=12;break}if(64&z){G.msg="invalid literal/length code",L.mode=30;break}L.extra=15&z,L.mode=22;case 22:if(L.extra){for(Me=L.extra;Z>>=L.extra,Z-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=23;case 23:for(;z=(ze=L.distcode[le&(1<>>16&255,K=65535&ze,!((O=ze>>>24)<=Z);){if(ae===0)break e;ae--,le+=$[re++]<>q)])>>>16&255,K=65535&ze,!(q+(O=ze>>>24)<=Z);){if(ae===0)break e;ae--,le+=$[re++]<>>=q,Z-=q,L.back+=q}if(le>>>=O,Z-=O,L.back+=O,64&z){G.msg="invalid distance code",L.mode=30;break}L.offset=K,L.extra=15&z,L.mode=24;case 24:if(L.extra){for(Me=L.extra;Z>>=L.extra,Z-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){G.msg="invalid distance too far back",L.mode=30;break}L.mode=25;case 25:if(ge===0)break e;if(X=Se-ge,L.offset>X){if((X=L.offset-X)>L.whave&&L.sane){G.msg="invalid distance too far back",L.mode=30;break}ee=X>L.wnext?(X-=L.wnext,L.wsize-X):L.wnext-X,X>L.length&&(X=L.length),ne=L.window}else ne=ie,ee=be-L.offset,X=L.length;for(geY?(W=O[z+x[$]],Se[X+x[$]]):(W=96,0),N=1<>ge)+(R-=N)]=k<<24|W<<16|G|0,R!==0;);for(N=1<>=1;if(N!==0?(ye&=N-1,ye+=N):ye=0,$++,--ee[L]==0){if(L===re)break;L=y[S+x[$]]}if(be>>7)]}function L(z,K){z.pending_buf[z.pending++]=255&K,z.pending_buf[z.pending++]=K>>>8&255}function $(z,K,q){z.bi_valid>y-q?(z.bi_buf|=K<>y-z.bi_valid,z.bi_valid+=q-y):(z.bi_buf|=K<>>=1,q<<=1,0<--K;);return q>>>1}function be(z,K,q){var de,ue,ce=new Array(f+1),pe=0;for(de=1;de<=f;de++)ce[de]=pe=pe+q[de-1]<<1;for(ue=0;ue<=K;ue++){var we=z[2*ue+1];we!==0&&(z[2*ue]=re(ce[we]++,we))}}function ae(z){var K;for(K=0;K>1;1<=q;q--)Z(z,ce,q);for(ue=Me;q=z.heap[1],z.heap[1]=z.heap[z.heap_len--],Z(z,ce,1),de=z.heap[1],z.heap[--z.heap_max]=q,z.heap[--z.heap_max]=de,ce[2*ue]=ce[2*q]+ce[2*de],z.depth[ue]=(z.depth[q]>=z.depth[de]?z.depth[q]:z.depth[de])+1,ce[2*q+1]=ce[2*de+1]=ue,z.heap[1]=ue++,Z(z,ce,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],function(De,Qe){var ke,We,qe,Ye,Je,it,ht=Qe.dyn_tree,vt=Qe.max_code,ot=Qe.stat_desc.static_tree,Et=Qe.stat_desc.has_stree,ct=Qe.stat_desc.extra_bits,_t=Qe.stat_desc.extra_base,Nt=Qe.stat_desc.max_length,qt=0;for(Ye=0;Ye<=f;Ye++)De.bl_count[Ye]=0;for(ht[2*De.heap[De.heap_max]+1]=0,ke=De.heap_max+1;ke<573;ke++)Nt<(Ye=ht[2*ht[2*(We=De.heap[ke])+1]+1]+1)&&(Ye=Nt,qt++),ht[2*We+1]=Ye,vt>=7;ue>>=1)if(1&ze&&we.dyn_ltree[2*Me]!==0)return 0;if(we.dyn_ltree[18]!==0||we.dyn_ltree[20]!==0||we.dyn_ltree[26]!==0)return 1;for(Me=32;Me>>3,(ce=z.static_len+3+7>>>3)<=ue&&(ue=ce)):ue=ce=q+5,q+4<=ue&&K!==-1?O(z,K,q,de):z.strategy===4||ce===ue?($(z,2+(de?1:0),3),ye(z,x,M)):($(z,4+(de?1:0),3),function(we,Me,ze,De){var Qe;for($(we,Me-257,5),$(we,ze-1,5),$(we,De-4,4),Qe=0;Qe>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&K,z.pending_buf[z.l_buf+z.last_lit]=255&q,z.last_lit++,K===0?z.dyn_ltree[2*q]++:(z.matches++,K--,z.dyn_ltree[2*(R[q]+h+1)]++,z.dyn_dtree[2*H(K)]++),z.last_lit===z.lit_bufsize-1},g._tr_align=function(z){$(z,2,3),ie(z,256,x),function(K){K.bi_valid===16?(L(K,K.bi_buf),K.bi_buf=0,K.bi_valid=0):8<=K.bi_valid&&(K.pending_buf[K.pending++]=255&K.bi_buf,K.bi_buf>>=8,K.bi_valid-=8)}(z)}},{"../utils/common":41}],53:[function(u,a,g){a.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(u,a,g){(function(c){(function(l,h){if(!l.setImmediate){var d,E,f,y,S=1,_={},P=!1,w=l.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(l);x=x&&x.setTimeout?x:l,d={}.toString.call(l.process)==="[object process]"?function(A){process.nextTick(function(){N(A)})}:function(){if(l.postMessage&&!l.importScripts){var A=!0,F=l.onmessage;return l.onmessage=function(){A=!1},l.postMessage("","*"),l.onmessage=F,A}}()?(y="setImmediate$"+Math.random()+"$",l.addEventListener?l.addEventListener("message",R,!1):l.attachEvent("onmessage",R),function(A){l.postMessage(y+A,"*")}):l.MessageChannel?((f=new MessageChannel).port1.onmessage=function(A){N(A.data)},function(A){f.port2.postMessage(A)}):w&&"onreadystatechange"in w.createElement("script")?(E=w.documentElement,function(A){var F=w.createElement("script");F.onreadystatechange=function(){N(A),F.onreadystatechange=null,E.removeChild(F),F=null},E.appendChild(F)}):function(A){setTimeout(N,0,A)},x.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var F=new Array(arguments.length-1),U=0;U"u"?c===void 0?this:c:self)}).call(this,r.g!==void 0?r.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)},2043:function(b,o,r){var u,a;(function(g,c){u=function(){var l=function(){},h="undefined",d=typeof window!==h&&typeof window.navigator!==h&&/Trident\/|MSIE /.test(window.navigator.userAgent),E=["trace","debug","info","warn","error"];function f(R,A){var F=R[A];if(typeof F.bind=="function")return F.bind(R);try{return Function.prototype.bind.call(F,R)}catch{return function(){return Function.prototype.apply.apply(F,[R,arguments])}}}function y(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function S(R,A){for(var F=0;F=0&&H<=Y.levels.SILENT))throw"log.setLevel() called with invalid level: "+H;if(U=H,L!==!1&&function($){var ie=(E[$]||"silent").toUpperCase();if(typeof window!==h&&k){try{return void(window.localStorage[k]=ie)}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+ie+";"}catch{}}}(H),S.call(Y,H,R),typeof console===h&&H{Object.defineProperty(o,"__esModule",{value:!0}),o.Fraction=void 0;class r{constructor(a=0,g=1,c=0,l=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=a,this.denominator=g,this.wholeValue=c,l&&this.simplify(),this.setRealValue()}static max(a,g){return a.RealValue>g.RealValue?a:g}static Equal(a,g){return a.wholeValue===g.wholeValue&&a.Denominator===g.Denominator&&a.Numerator===g.Numerator}static createFromFraction(a){return new r(a.numerator,a.denominator,a.wholeValue,!1)}static plus(a,g){const c=a.clone();return c.Add(g),c}static minus(a,g){const c=a.clone();return c.Sub(g),c}static multiply(a,g){return new r((a.wholeValue*a.denominator+a.numerator)*(g.wholeValue*g.denominator+g.numerator),a.denominator*g.denominator)}static greatestCommonDenominator(a,g){if(a===0)return g;if(g===1)return 1;for(;Math.abs(g)>1e-8&&Math.abs(a)>1e-8;)a>g?a-=g:g-=a;return Math.round(a)}toString(){let a=this.numerator+"/"+this.denominator;return this.wholeValue!==0&&(a=this.wholeValue+" "+a),a}clone(){return new r(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(a){this.numerator!==a&&(this.numerator=a,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(a){this.denominator!==a&&(this.denominator=a,this.numerator!==0&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(a){this.wholeValue!==a&&(this.wholeValue=a,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let a=1,g=2;const c=this.GetExpandedNumerator();for(;ga;)g.Numerator++;if(this.numerator>this.denominator){const c=new r(this.numerator-1,this.denominator,this.wholeValue);for(;c.Denominator>a;)c.Numerator--;if(c.Denominatorr.maximumAllowedNumber){const c=this.denominator/r.maximumAllowedNumber;this.numerator=Math.round(this.numerator/c),this.denominator=Math.round(this.denominator/c)}if(this.numerator>r.maximumAllowedNumber){const c=this.numerator/r.maximumAllowedNumber;this.numerator=Math.round(this.numerator/c),this.denominator=Math.round(this.denominator/c)}}isOnBeat(a){const g=this.distanceFromBeat(a);return Math.abs(g){Object.defineProperty(o,"__esModule",{value:!0}),o.Matrix2D=void 0;const u=r(9086);class a{constructor(){this.matrix=[];for(let c=0;c<2;c++){this.matrix[c]=[];for(let l=0;l<2;l++)this.matrix[c][l]=0}}static getRotationMatrix(c){const l=new a,h=Math.cos(c),d=Math.sin(c);return l.matrix[0][0]=h,l.matrix[0][1]=-d,l.matrix[1][0]=d,l.matrix[1][1]=h,l}scalarMultiplication(c){for(let l=0;l<2;l++)for(let h=0;h<2;h++)this.matrix[l][h]*=c}getTransposeMatrix(){const c=new a;for(let l=0;l<2;l++)for(let h=0;h<2;h++)c.matrix[l][h]=this.matrix[h][l];return c}vectorMultiplication(c){const l=new u.PointF2D;return l.x=c.x*this.matrix[0][0]+c.y*this.matrix[0][1],l.y=c.x*this.matrix[1][0]+c.y*this.matrix[1][1],l}}o.Matrix2D=a},9651:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSheetErrors=void 0,o.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(r){let u=this.measureErrors[r];u||(u=[]),this.measureErrors[r]=u.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(r){this.tempErrors.push(r)}push(r){this.errors.push(r)}}},9855:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OSMDColor=void 0;class r{constructor(a,g,c){this.alpha=255,this.red=a,this.green=g,this.blue=c}static get Black(){return new r(0,0,0)}static get DeepSkyBlue(){return new r(0,191,255)}static get Green(){return new r(20,160,20)}static get Magenta(){return new r(255,0,255)}static get Orange(){return new r(255,128,0)}static get Red(){return new r(240,20,20)}static get Disabled(){return new r(225,225,225)}static get DarkBlue(){return new r(0,0,140)}static get Debug1(){return new r(200,0,140)}static get Debug2(){return new r(100,100,200)}static get Debug3(){return new r(0,50,140)}toString(){return"rgb("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}o.OSMDColor=r},8640:(b,o)=>{var r,u;Object.defineProperty(o,"__esModule",{value:!0}),o.Pitch=o.AccidentalEnum=o.NoteEnum=void 0,function(g){g[g.C=0]="C",g[g.D=2]="D",g[g.E=4]="E",g[g.F=5]="F",g[g.G=7]="G",g[g.A=9]="A",g[g.B=11]="B"}(r=o.NoteEnum||(o.NoteEnum={})),function(g){g[g.SHARP=0]="SHARP",g[g.FLAT=1]="FLAT",g[g.NONE=2]="NONE",g[g.NATURAL=3]="NATURAL",g[g.DOUBLESHARP=4]="DOUBLESHARP",g[g.DOUBLEFLAT=5]="DOUBLEFLAT",g[g.TRIPLESHARP=6]="TRIPLESHARP",g[g.TRIPLEFLAT=7]="TRIPLEFLAT",g[g.QUARTERTONESHARP=8]="QUARTERTONESHARP",g[g.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",g[g.SLASHFLAT=10]="SLASHFLAT",g[g.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",g[g.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",g[g.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",g[g.SLASHSHARP=14]="SLASHSHARP",g[g.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",g[g.SORI=16]="SORI",g[g.KORON=17]="KORON"}(u=o.AccidentalEnum||(o.AccidentalEnum={}));class a{constructor(c,l,h,d=void 0,E=!1){this.accidental=u.NONE,this.fundamentalNote=c,this.octave=l,this.accidental=h,this.accidentalXml=d,this.halfTone=c+12*(l+a.octXmlDiff)+a.HalfTonesFromAccidental(h),E||(this.frequency=a.calcFrequency(this))}static getNoteEnumString(c){switch(c){case r.C:return"C";case r.D:return"D";case r.E:return"E";case r.F:return"F";case r.G:return"G";case r.A:return"A";case r.B:return"B";default:return""}}static lineShiftFromNoteEnum(c,l){if(l===0)return[c,0];const h=a.pitchEnumValues,d=h.indexOf(c);let E=0,f=(d+l)%h.length;return d+l>h.length-1&&(E=1),f<0&&(f=h.length+f,E=-1),[h[f],E]}static CalculateTransposedHalfTone(c,l){const h=c.fundamentalNote+c.AccidentalHalfTones+l;return a.WrapAroundCheck(h,12)}static WrapAroundCheck(c,l){let h=0;for(;c<0;)c+=l,h--;for(;c>=l;)c-=l,h++;return{overflow:h,halftone:c}}static calcFrequency(c){let l,h=0;if(c instanceof a){const d=c;h=d.octave-1,l=d.fundamentalNote-r.A+d.AccidentalHalfTones}else typeof c=="number"&&(l=c-57);return 440*Math.pow(2,h)*Math.pow(2,l/12)}static calcFractionalKey(c){return Math.log(c/440)/Math.LN10*a.halftoneFactor+57}static fromFrequency(c){const l=a.calcFractionalKey(c)+.5,h=Math.floor(l/12)-a.octXmlDiff,d=Math.floor(l)%12;let E=d,f=u.NONE;return this.pitchEnumValues.indexOf(E)===-1&&(E=d-1,f=u.SHARP),new a(E,h,f)}static fromHalftone(c){const l=Math.floor(c/12)-a.octXmlDiff,h=c%12;let d=h,E=u.NONE;return this.pitchEnumValues.indexOf(d)===-1&&(d=h-1,E=u.SHARP),new a(d,l,E)}static ceiling(c){let l=c%=12;return this.pitchEnumValues.indexOf(l)===-1&&(l=c+1),l}static floor(c){let l=c%=12;return this.pitchEnumValues.indexOf(l)===-1&&(l=c-1),l}static HalfTonesFromAccidental(c){switch(c){case u.NONE:return 0;case u.SHARP:return 1;case u.FLAT:return-1;case u.NATURAL:return 0;case u.DOUBLESHARP:return 2;case u.DOUBLEFLAT:return-2;case u.TRIPLESHARP:return 3;case u.TRIPLEFLAT:return-3;case u.QUARTERTONESHARP:return .5;case u.QUARTERTONEFLAT:return-.5;case u.SLASHFLAT:return-.51;case u.THREEQUARTERSSHARP:return 1.5;case u.THREEQUARTERSFLAT:return-1.5;case u.SLASHQUARTERSHARP:return .0013;case u.SLASHSHARP:return .0014;case u.DOUBLESLASHFLAT:return-.0015;case u.SORI:return .0016;case u.KORON:return .0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(c){switch(c){case 0:return u.NONE;case 1:return u.SHARP;case-1:return u.FLAT;case 2:return u.DOUBLESHARP;case-2:return u.DOUBLEFLAT;case 3:return u.TRIPLESHARP;case-3:return u.TRIPLEFLAT;case .5:return u.QUARTERTONESHARP;case-.5:return u.QUARTERTONEFLAT;case 1.5:return u.THREEQUARTERSSHARP;case-1.5:return u.THREEQUARTERSFLAT;default:return c>0&&c<1?u.QUARTERTONESHARP:c<0&&c>-1?u.QUARTERTONEFLAT:u.QUARTERTONESHARP}}static accidentalVexflow(c){let l;switch(c){case u.NATURAL:l="n";break;case u.FLAT:l="b";break;case u.SHARP:l="#";break;case u.DOUBLESHARP:l="##";break;case u.TRIPLESHARP:l="###";break;case u.DOUBLEFLAT:l="bb";break;case u.TRIPLEFLAT:l="bbs";break;case u.QUARTERTONESHARP:l="+";break;case u.QUARTERTONEFLAT:l="d";break;case u.SLASHFLAT:l="bs";break;case u.THREEQUARTERSSHARP:l="++";break;case u.THREEQUARTERSFLAT:l="db";break;case u.SLASHQUARTERSHARP:l="+-";break;case u.SLASHSHARP:l="++-";break;case u.DOUBLESLASHFLAT:l="bss";break;case u.SORI:l="o";break;case u.KORON:l="k"}return l}get AccidentalHalfTones(){return a.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return a.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(c){if(c>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return c>0?this.getHigherPitchByTransposeFactor(c):c<0?this.getLowerPitchByTransposeFactor(-c):this}DoEnharmonicChange(){switch(this.accidental){case u.FLAT:case u.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=a.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+a.octXmlDiff)));break;case u.SHARP:case u.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=a.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+a.octXmlDiff)));break;default:return}}ToString(){let c=a.accidentalVexflow(this.accidental);return c||(c=""),"Key: "+a.getNoteEnumString(this.fundamentalNote)+c+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}ToStringShort(c=0){let l=a.accidentalVexflow(this.accidental);l||(l="");const h=this.octave+c;return a.getNoteEnumString(this.fundamentalNote)+l+h}get ToStringShortGet(){return this.ToStringShort(0)}OperatorEquals(c){const l=this;return!(!l||!c)&&l.FundamentalNote===c.FundamentalNote&&l.Octave===c.Octave&&l.Accidental===c.Accidental}OperatorNotEqual(c){return this!==c}OperatorFundamentalGreaterThan(c){const l=this;return l.Octave===c.Octave?l.FundamentalNote>c.FundamentalNote:l.Octave>c.Octave}OperatorFundamentalLessThan(c){const l=this;return l.Octave===c.Octave?l.FundamentalNotea.pitchEnumValues.length-1?(h=a.pitchEnumValues[l+c-a.pitchEnumValues.length],d++):h=a.pitchEnumValues[l+c],new a(h,d,u.NONE)}getLowerPitchByTransposeFactor(c){const l=a.pitchEnumValues.indexOf(this.fundamentalNote);let h,d=this.octave;return l-c<0?(h=a.pitchEnumValues[a.pitchEnumValues.length+l-c],d--):h=a.pitchEnumValues[l-c],new a(h,d,u.NONE)}getNextFundamentalNote(c){let l=a.pitchEnumValues.indexOf(c);return l=(l+1)%a.pitchEnumValues.length,a.pitchEnumValues[l]}getPreviousFundamentalNote(c){const l=a.pitchEnumValues.indexOf(c);return l>0?a.pitchEnumValues[l-1]:a.pitchEnumValues[a.pitchEnumValues.length-1]}}o.Pitch=a,a.pitchEnumValues=[r.C,r.D,r.E,r.F,r.G,r.A,r.B],a.halftoneFactor=12/(Math.LN2/Math.LN10),a.octXmlDiff=3},9086:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PointF2D=void 0;class r{constructor(a=0,g=0){this.x=0,this.y=0,this.x=a,this.y=g}static get Empty(){return new r}static pointsAreEqual(a,g){return a.x===g.x&&a.y===g.y}ToString(){return"["+this.x+", "+this.y+"]"}}o.PointF2D=r},3278:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RectangleF2D=void 0;const u=r(739),a=r(9086);class g{constructor(l,h,d,E){this.x=0,this.y=0,this.width=0,this.height=0,this.x=l,this.y=h,this.width=d,this.height=E}static createFromLocationAndSize(l,h){return new g(l.x,l.y,h.width,h.height)}get Location(){return new a.PointF2D(this.x,this.y)}get Size(){return new u.SizeF2D(this.width,this.height)}}o.RectangleF2D=g},739:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SizeF2D=void 0,o.SizeF2D=class{constructor(r=0,u=0){this.width=r,this.height=u}}},8918:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(1797),o),a(r(8363),o),a(r(9651),o),a(r(9855),o),a(r(8640),o),a(r(9086),o),a(r(3278),o),a(r(739),o)},2562:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.FontStyles=void 0,(r=o.FontStyles||(o.FontStyles={}))[r.Regular=0]="Regular",r[r.Bold=1]="Bold",r[r.Italic=2]="Italic",r[r.BoldItalic=3]="BoldItalic",r[r.Underlined=4]="Underlined"},96:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.Fonts=void 0,(r=o.Fonts||(o.Fonts={}))[r.TimesNewRoman=0]="TimesNewRoman",r[r.Kokila=1]="Kokila"},1274:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.TextAlignment=o.TextAlignmentEnum=void 0,function(u){u[u.LeftTop=0]="LeftTop",u[u.LeftCenter=1]="LeftCenter",u[u.LeftBottom=2]="LeftBottom",u[u.CenterTop=3]="CenterTop",u[u.CenterCenter=4]="CenterCenter",u[u.CenterBottom=5]="CenterBottom",u[u.RightTop=6]="RightTop",u[u.RightCenter=7]="RightCenter",u[u.RightBottom=8]="RightBottom"}(r=o.TextAlignmentEnum||(o.TextAlignmentEnum={})),o.TextAlignment=class{static IsLeft(u){return u===r.LeftTop||u===r.LeftCenter||u===r.LeftBottom}static IsCenterAligned(u){return u===r.CenterTop||u===r.CenterCenter||u===r.CenterBottom}static IsRight(u){return u===r.RightTop||u===r.RightCenter||u===r.RightBottom}}},7119:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.TieTypes=void 0,(r=o.TieTypes||(o.TieTypes={})).SIMPLE="",r.HAMMERON="H",r.PULLOFF="P",r.SLIDE="S",r.TAPPING="T"},5544:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(2562),o),a(r(96),o),a(r(1274),o),a(r(7119),o)},7056:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.MXLHelper=void 0;const a=r(9228),g=u(r(5733)),c=u(r(2043));o.MXLHelper=class{static MXLtoIXmlElement(l){const h=new g.default;return h.loadAsync(l).then(d=>h.file("META-INF/container.xml").async("text"),d=>{throw d}).then(d=>{const E=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return h.file(E).async("text")},d=>{throw d}).then(d=>{const E=new DOMParser().parseFromString(d,"text/xml"),f=new a.IXmlElement(E.documentElement);return Promise.resolve(f)},d=>{throw d}).then(d=>d,d=>{throw new Error("extractSheetFromMxl: "+d.message)})}static MXLtoXMLstring(l){const h=new g.default;return h.loadAsync(l).then(d=>h.file("META-INF/container.xml").async("text"),d=>{throw c.default.error(d),d}).then(d=>{const E=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return h.file(E).async("text")},d=>{throw d})}}},9228:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IXmlElement=void 0;class r{constructor(a){if(this.hasAttributes=!1,!a)throw new Error("IXmlElement: expected Element, got undefined");this.elem=a,this.name=a.nodeName.toLowerCase(),a.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=a.attributes[0]),this.hasElements=a.hasChildNodes(),a.childNodes.length===1&&a.childNodes[0].nodeType===Node.TEXT_NODE?this.value=a.childNodes[0].nodeValue:this.value=""}attribute(a){return this.elem.attributes.getNamedItem(a)}attributes(){if(!this.attrs){const a=this.elem.attributes,g=[];for(let c=0;c0){let c;for(let l=0,h=g.length;l{Object.defineProperty(o,"__esModule",{value:!0}),o.StringUtil=void 0,o.StringUtil=class{static StringContainsSeparatedWord(r,u,a=!1){return new RegExp("( |^)"+u+"([ .]|$)",a?"i":void 0).test(r)}}},5205:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(8918),o),a(r(5544),o),a(r(9633),o)},1703:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InvalidEnumArgumentException=o.ArgumentOutOfRangeException=o.MusicSheetReadingException=void 0,o.MusicSheetReadingException=class{constructor(r,u){this.message=r,u&&(this.message+=" "+u.toString())}},o.ArgumentOutOfRangeException=class{constructor(r){this.message=r}},o.InvalidEnumArgumentException=class{constructor(r){this.message=r}}},6791:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AbstractGraphicalExpression=void 0;const u=r(4785),a=r(8911);class g extends u.GraphicalObject{constructor(l,h,d){super(),this.expression=h,this.parentMeasure=d,this.boundingBox=new a.BoundingBox(this,l.PositionAndShape),this.parentStaffLine=l,this.parentStaffLine.AbstractExpressions.push(this),this.rules=l.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}o.AbstractGraphicalExpression=g},6055:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AbstractGraphicalInstruction=void 0;const u=r(4785);class a extends u.GraphicalObject{constructor(c){super(),this.parent=c}get Parent(){return this.parent}set Parent(c){this.parent=c}}o.AbstractGraphicalInstruction=a},1070:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AccidentalCalculator=void 0;const u=r(8640),a=r(8640),g=r(1649),c=r(4040);o.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new g.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new g.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(l){this.activeKeyInstruction=l,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const l of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(l,this.keySignatureNoteAlterationsDict.getValue(l))}checkAccidental(l,h){if(!h)return;const d=h.FundamentalNote+12*h.Octave,E=this.currentAlterationsComparedToKeyInstructionList.indexOf(d)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(d)){if(E&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(d),1),this.currentInMeasureNoteAlterationsDict.getValue(d)!==h.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(d)&&this.keySignatureNoteAlterationsDict.getValue(d)!==h.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(d),this.currentInMeasureNoteAlterationsDict.setValue(d,h.AccidentalHalfTones)):h.Accidental!==u.AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(d);const f=this.currentInMeasureNoteAlterationsDict.getValue(d);if(h.Accidental===u.AccidentalEnum.NONE&&(h=Math.abs(f)===.5?new a.Pitch(h.FundamentalNote,h.Octave,u.AccidentalEnum.NONE):new a.Pitch(h.FundamentalNote,h.Octave,u.AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(h.Accidental)&&!h.AccidentalXml)return;c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(l,h)}}else if(h.Accidental!==u.AccidentalEnum.NONE){if(E||this.currentAlterationsComparedToKeyInstructionList.push(d),this.currentInMeasureNoteAlterationsDict.setValue(d,h.AccidentalHalfTones),this.isAlterAmbiguousAccidental(h.Accidental)&&!h.AccidentalXml)return;c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(l,h)}else E&&(h=new a.Pitch(h.FundamentalNote,h.Octave,u.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(d),1),c.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(l,h))}isAlterAmbiguousAccidental(l){return l===u.AccidentalEnum.SLASHFLAT||l===u.AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const l=this.activeKeyInstruction.AlteratedNotes;let h;h=this.activeKeyInstruction.Key>0?u.AccidentalEnum.SHARP:u.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let d=-9;d<9;d++)for(let E=0;Ethis.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(f){this.borderMarginLeft=f,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(f){this.borderMarginTop=f,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(y,1)}this.parent=f,this.parent.ChildElements.indexOf(this)>-1?a.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new c.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let f=this.parent;for(;f;)this.absolutePosition.x+=f.relativePosition.x,this.absolutePosition.y+=f.relativePosition.y,f=f.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let f=0,y=this.ChildElements.length;f.001;break;case E.Up:case E.Down:_=this.relativePosition.y,f.calculateMarginPositionAlongDirection(this,y),P=Math.abs(_-this.relativePosition.y)>.001;break;default:throw new g.ArgumentOutOfRangeException("direction")}while(P)}collisionDetection(f){const y=Math.min(this.AbsolutePosition.x+this.borderRight,f.absolutePosition.x+f.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,f.absolutePosition.x+f.borderLeft),S=Math.min(this.AbsolutePosition.y+this.borderBottom,f.absolutePosition.y+f.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,f.absolutePosition.y+f.borderTop);return y>0&&S>0}liesInsideBorders(f){const y=this.AbsolutePosition.x+this.borderLeft<=f.absolutePosition.x+f.borderLeft&&f.absolutePosition.x+f.borderLeft<=this.AbsolutePosition.x+this.borderRight,S=this.AbsolutePosition.x+this.borderLeft<=f.absolutePosition.x+f.borderRight&&f.absolutePosition.x+f.borderRight<=this.AbsolutePosition.x+this.borderRight;if(y&&S){const _=this.AbsolutePosition.y+this.borderTop<=f.absolutePosition.y+f.borderTop&&f.absolutePosition.y+f.borderTop<=this.AbsolutePosition.y+this.borderBottom,P=this.AbsolutePosition.y+this.borderTop<=f.absolutePosition.y+f.borderBottom&&f.absolutePosition.y+f.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(_&&P)return!0}return!1}pointLiesInsideBorders(f){return this.AbsolutePosition.x+this.borderLeft<=f.x&&f.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=f.y&&f.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(f){const y=Math.min(this.AbsolutePosition.x+this.borderMarginRight,f.absolutePosition.x+f.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,f.absolutePosition.x+f.borderMarginLeft),S=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,f.absolutePosition.y+f.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,f.absolutePosition.y+f.borderMarginTop);return y>0&&S>0}liesInsideMargins(f){const y=this.AbsolutePosition.x+this.borderMarginLeft<=f.absolutePosition.x+f.borderMarginLeft&&f.absolutePosition.x+f.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,S=this.AbsolutePosition.x+this.borderMarginLeft<=f.absolutePosition.x+f.borderMarginRight&&f.absolutePosition.x+f.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(y&&S){const _=this.AbsolutePosition.y+this.borderMarginTop<=f.absolutePosition.y+f.borderMarginTop&&f.absolutePosition.y+f.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,P=this.AbsolutePosition.y+this.borderMarginTop<=f.absolutePosition.y+f.borderMarginBottom&&f.absolutePosition.y+f.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(_&&P)return!0}return!1}pointLiesInsideMargins(f){return this.AbsolutePosition.x+this.borderMarginLeft<=f.x&&f.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=f.y&&f.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(f,y,S){this.RelativePosition=new c.PointF2D(S.x,S.y),this.setAbsolutePositionFromParent();let _=0,P=!1;do switch(y){case E.Left:case E.Right:_=this.relativePosition.x,f.calculatePositionAlongDirection(this,y),P=Math.abs(_-this.relativePosition.x)>1e-4;break;case E.Up:case E.Down:_=this.relativePosition.y,f.calculatePositionAlongDirection(this,y),P=Math.abs(_-this.relativePosition.y)>1e-4;break;default:throw new g.ArgumentOutOfRangeException("direction")}while(P)}getClickedObjectOfType(f){const y=this.dataObject;if(this.pointLiesInsideBorders(f)&&y)return y;for(let S=0,_=this.childElements.length;S<_;++S){const P=this.childElements[S].getClickedObjectOfType(f);if(P)return P}}getObjectsInRegion(f,y=!0,S=d.GraphicalObject.name){let _=[];for(const P of this.childElements)_=_.concat(P.getObjectsInRegion(f,y,S));return this.dataObject&&this.dataObject.isInstanceOfClass(S)&&(y?f.liesInsideBorders(this)&&_.push(this.dataObject):f.collisionDetection(this)&&_.push(this.dataObject)),_}calculateRectangle(){this.upperLeftCorner=new c.PointF2D(this.BorderLeft,this.BorderTop),this.size=new l.SizeF2D(this.BorderRight-this.BorderLeft,this.BorderBottom-this.BorderTop),this.boundingRectangle=h.RectangleF2D.createFromLocationAndSize(this.upperLeftCorner,this.size)}calculateMarginRectangle(){this.upperLeftMarginCorner=new c.PointF2D(this.BorderMarginLeft,this.BorderMarginTop),this.marginSize=new l.SizeF2D(this.BorderMarginRight-this.BorderMarginLeft,this.BorderMarginBottom-this.BorderMarginTop),this.boundingMarginRectangle=h.RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner,this.marginSize)}calculateMarginPositionAlongDirection(f,y){if(this!==f){if(this.isSymbol&&this.marginCollisionDetection(f)){let S=0;switch(y){case E.Left:return S=this.absolutePosition.x+this.borderMarginLeft-(f.absolutePosition.x+f.borderMarginRight),f.relativePosition.x+=S,void(f.absolutePosition.x+=S);case E.Right:return S=this.absolutePosition.x+this.borderMarginRight-(f.absolutePosition.x+f.borderMarginLeft),f.relativePosition.x+=S,void(f.absolutePosition.x+=S);case E.Up:return S=this.absolutePosition.y+this.borderMarginTop-(f.absolutePosition.y+f.borderMarginBottom),f.relativePosition.y+=S,void(f.absolutePosition.y+=S);case E.Down:return S=this.absolutePosition.y+this.borderMarginBottom-(f.absolutePosition.y+f.borderMarginTop),f.relativePosition.y+=S,void(f.absolutePosition.y+=S);default:throw new g.ArgumentOutOfRangeException("direction")}}for(let S=0,_=this.ChildElements.length;S<_;++S)this.ChildElements[S].calculateMarginPositionAlongDirection(f,y)}}calculatePositionAlongDirection(f,y){if(this!==f){if(this.isSymbol&&this.collisionDetection(f)){let S;switch(y){case E.Left:return S=this.absolutePosition.x+this.borderLeft-(f.absolutePosition.x+f.borderRight),f.relativePosition.x+=S,void(f.absolutePosition.x+=S);case E.Right:return S=this.absolutePosition.x+this.borderRight-(f.absolutePosition.x+f.borderLeft),f.relativePosition.x+=S,void(f.absolutePosition.x+=S);case E.Up:return S=this.absolutePosition.y+this.borderTop-(f.absolutePosition.y+f.borderBottom),f.relativePosition.y+=S,void(f.absolutePosition.y+=S);case E.Down:return S=this.absolutePosition.y+this.borderBottom-(f.absolutePosition.y+f.borderTop),f.relativePosition.y+=S,void(f.absolutePosition.y+=S);default:throw new g.ArgumentOutOfRangeException("direction")}}for(let S=0,_=this.ChildElements.length;S<_;++S)this.ChildElements[S].calculatePositionAlongDirection(f,y)}}},function(f){f[f.Left=0]="Left",f[f.Right=1]="Right",f[f.Up=2]="Up",f[f.Down=3]="Down",f[f.NotYetDefined=4]="NotYetDefined"}(E=o.ColDirEnum||(o.ColDirEnum={}))},4278:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Clickable=void 0;const u=r(4785);class a extends u.GraphicalObject{}o.Clickable=a},8155:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AutoColorSet=o.NoteState=o.GraphicalLayers=o.StyleSets=o.OUTLINE_AND_FILL_STYLE_DICT=o.OutlineAndFillStyleEnum=void 0;const u=r(1649);var a,g,c,l,h;(function(d){d[d.BaseWritingColor=0]="BaseWritingColor",d[d.FollowingCursor=1]="FollowingCursor",d[d.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",d[d.PlaybackCursor=3]="PlaybackCursor",d[d.Highlighted=4]="Highlighted",d[d.ErrorUnderlay=5]="ErrorUnderlay",d[d.Selected=6]="Selected",d[d.SelectionSymbol=7]="SelectionSymbol",d[d.DebugColor1=8]="DebugColor1",d[d.DebugColor2=9]="DebugColor2",d[d.DebugColor3=10]="DebugColor3",d[d.SplitScreenDivision=11]="SplitScreenDivision",d[d.GreyTransparentOverlay=12]="GreyTransparentOverlay",d[d.MarkedArea1=13]="MarkedArea1",d[d.MarkedArea2=14]="MarkedArea2",d[d.MarkedArea3=15]="MarkedArea3",d[d.MarkedArea4=16]="MarkedArea4",d[d.MarkedArea5=17]="MarkedArea5",d[d.MarkedArea6=18]="MarkedArea6",d[d.MarkedArea7=19]="MarkedArea7",d[d.MarkedArea8=20]="MarkedArea8",d[d.MarkedArea9=21]="MarkedArea9",d[d.MarkedArea10=22]="MarkedArea10",d[d.Comment1=23]="Comment1",d[d.Comment2=24]="Comment2",d[d.Comment3=25]="Comment3",d[d.Comment4=26]="Comment4",d[d.Comment5=27]="Comment5",d[d.Comment6=28]="Comment6",d[d.Comment7=29]="Comment7",d[d.Comment8=30]="Comment8",d[d.Comment9=31]="Comment9",d[d.Comment10=32]="Comment10"})(a=o.OutlineAndFillStyleEnum||(o.OutlineAndFillStyleEnum={})),o.OUTLINE_AND_FILL_STYLE_DICT=new u.Dictionary,o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.BaseWritingColor,"Thistle"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.FollowingCursor,"Aqua"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.AlternativeFollowingCursor,"Azure"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.PlaybackCursor,"Bisque"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Highlighted,"CadetBlue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.ErrorUnderlay,"DarkBlue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Selected,"DarkGoldenRod"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.SelectionSymbol,"BlanchedAlmond"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.DebugColor1,"Chartreuse"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.DebugColor2,"DarkGreen"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.DebugColor3,"DarkOrange"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.SplitScreenDivision,"FireBrick"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.GreyTransparentOverlay,"DarkSalmon"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea1,"DarkSeaGreen"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea2,"DarkOrchid"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea3,"Aquamarine"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea4,"DarkKhaki"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea5,"ForestGreen"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea6,"AliceBlue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea7,"DeepPink"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea8,"Coral"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea9,"DarkOliveGreen"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.MarkedArea10,"Chocolate"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment1,"DodgerBlue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment2,"Blue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment3,"Beige"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment4,"Crimson"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment5,"Fuchsia"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment6,"Brown"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment7,"BlanchedAlmond"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment8,"CornflowerBlue"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment9,"Cornsilk"),o.OUTLINE_AND_FILL_STYLE_DICT.setValue(a.Comment10,"DarkGrey"),(h=o.StyleSets||(o.StyleSets={}))[h.MarkedArea=0]="MarkedArea",h[h.Comment=1]="Comment",(l=o.GraphicalLayers||(o.GraphicalLayers={}))[l.Background=0]="Background",l[l.Highlight=1]="Highlight",l[l.MeasureError=2]="MeasureError",l[l.SelectionSymbol=3]="SelectionSymbol",l[l.Cursor=4]="Cursor",l[l.PSI_Debug=5]="PSI_Debug",l[l.Notes=6]="Notes",l[l.Comment=7]="Comment",l[l.Debug_above=8]="Debug_above",(c=o.NoteState||(o.NoteState={}))[c.Normal=0]="Normal",c[c.Selected=1]="Selected",c[c.Follow_Confirmed=2]="Follow_Confirmed",c[c.QFeedback_NotFound=3]="QFeedback_NotFound",c[c.QFeedback_OK=4]="QFeedback_OK",c[c.QFeedback_Perfect=5]="QFeedback_Perfect",c[c.Debug1=6]="Debug1",c[c.Debug2=7]="Debug2",c[c.Debug3=8]="Debug3",(g=o.AutoColorSet||(o.AutoColorSet={})).C="#d82c6b",g.D="#F89D15",g.E="#FFE21A",g.F="#4dbd5c",g.G="#009D96",g.A="#43469d",g.B="#76429c",g.Rest="#000000"},5074:(b,o)=>{var r,u,a;Object.defineProperty(o,"__esModule",{value:!0}),o.PhonicScoreModes=o.MusicSymbolDrawingStyle=o.DrawingMode=void 0,(a=o.DrawingMode||(o.DrawingMode={}))[a.All=0]="All",a[a.NoOverlays=1]="NoOverlays",a[a.Leadsheet=2]="Leadsheet",(u=o.MusicSymbolDrawingStyle||(o.MusicSymbolDrawingStyle={}))[u.Normal=0]="Normal",u[u.Disabled=1]="Disabled",u[u.Selected=2]="Selected",u[u.Clickable=3]="Clickable",u[u.PlaybackSymbols=4]="PlaybackSymbols",u[u.FollowSymbols=5]="FollowSymbols",u[u.QFeedbackNotFound=6]="QFeedbackNotFound",u[u.QFeedbackOk=7]="QFeedbackOk",u[u.QFeedbackPerfect=8]="QFeedbackPerfect",u[u.Debug1=9]="Debug1",u[u.Debug2=10]="Debug2",u[u.Debug3=11]="Debug3",(r=o.PhonicScoreModes||(o.PhonicScoreModes={}))[r.Following=0]="Following",r[r.Midi=1]="Midi",r[r.Manual=2]="Manual"},7459:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DrawingParameters=o.DrawingParametersEnum=o.ColoringModes=void 0;const u=r(1405),a=r(3748);var g,c;(c=o.ColoringModes||(o.ColoringModes={}))[c.XML=0]="XML",c[c.AutoColoring=1]="AutoColoring",c[c.CustomColorSet=2]="CustomColorSet",function(l){l.allon="allon",l.compact="compact",l.compacttight="compacttight",l.default="default",l.leadsheet="leadsheet",l.preview="preview",l.thumbnail="thumbnail"}(g=o.DrawingParametersEnum||(o.DrawingParametersEnum={})),o.DrawingParameters=class{constructor(l=g.default,h){this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCopyright=!1,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=a.PlacementEnum.Left,this.drawHiddenNotes=!1,this.rules=h,this.rules||(this.rules=new u.EngravingRules),this.DrawingParametersEnum=l}set DrawingParametersEnum(l){switch(this.drawingParametersEnum=l,l){case g.allon:this.setForAllOn();break;case g.thumbnail:this.setForThumbnail();break;case g.leadsheet:this.setForLeadsheet();break;case g.compact:this.setForCompactMode();break;case g.compacttight:this.setForCompactTightMode();break;case g.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(l){this.drawCredits=l,this.DrawComposer=l,this.DrawTitle=l,this.DrawSubtitle=l,this.DrawLyricist=l,this.DrawCopyright=l}get DrawTitle(){return this.drawTitle}set DrawTitle(l){this.drawTitle=l,this.rules.RenderTitle=l,l||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(l){this.drawSubtitle=l,this.rules.RenderSubtitle=l,l&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(l){this.drawComposer=l,this.rules.RenderComposer=l}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(l){this.drawLyricist=l,this.rules.RenderLyricist=l}get DrawCopyright(){return this.drawCopyright}set DrawCopyright(l){this.drawCopyright=l,this.rules.RenderCopyright=l}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(l){this.drawPartNames=l,this.rules.RenderPartNames=l,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(l){this.fingeringPosition=l,this.rules.FingeringPosition=l}get Rules(){return this.rules}set Rules(l){this.rules=l}}},1405:function(b,o,r){var u=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(o,"__esModule",{value:!0}),o.PageFormat=o.EngravingRules=void 0;const a=r(599),g=u(r(2043)),c=r(1274),l=r(3748),h=r(41),d=r(7459),E=r(1649),f=r(5544),y=r(8640),S=r(4123),_=r(3486);class P{constructor(){this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.RenderCount=0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*P.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.SheetCopyrightHeight=1.5,this.SheetCopyrightMargin=2,this.SheetComposerSubtitleUseLegacyParsing=!1,this.CompactMode=!1,this.PagePlacementEnum=a.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=P.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=P.unit/2,this.BeamSpaceWidth=P.unit/3,this.BeamForwardLength=1.25*P.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.PercussionUseCajon2NoteSystem=!1,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.GraceNoteGroupXMargin=0,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.SoftAccentWedgePadding=.4,this.SoftAccentSizeFactor=.6,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=c.TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolExtraXShiftForShortChordSymbols=.3,this.ChordSymbolExtraXShiftWidthThreshold=2,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolWholeMeasureRestXOffset=0,this.ChordSymbolWholeMeasureRestXOffsetMeasure1=-2,this.ChordAccidentalTexts=new E.Dictionary,this.resetChordAccidentalTexts(this.ChordAccidentalTexts,!1),this.ChordSymbolLabelTexts=new E.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RepetitionEndInstructionXShiftAsPercentOfStaveWidth=.4,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*P.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletsBracketedUseXMLValue=!0,this.TupletNumberLabelHeight=1.5*P.unit,this.TupletNumberYOffset=.5,this.TupletNumberLimitConsecutiveRepetitions=!0,this.TupletNumberMaxConsecutiveRepetitions=2,this.TupletNumberAlwaysDisableAfterFirstMax=!0,this.TupletNumberUseShowNoneXMLValue=!0,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.TabBeamsRendered=!0,this.TabKeySignatureRendered=!1,this.TabKeySignatureSpacingAdded=!0,this.TabTimeSignatureRendered=!1,this.TabTimeSignatureSpacingAdded=!0,this.TabFingeringsRendered=!1,this.SlurPlacementFromXML=!0,this.SlurPlacementAtStems=!1,this.SlurPlacementUseSkyBottomLine=!1,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurEndArticulationYOffset=.8,this.SlurStartArticulationYOffsetOfArticulation=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.GlissandoNoteOffset=.5,this.GlissandoStafflineStartMinimumWidth=1,this.GlissandoStafflineStartYDistanceToNote=.8,this.GlissandoStafflineEndOffset=1,this.GlissandoDefaultWidth=.1,this.RepetitionAllowFirstMeasureBeginningRepeatBarline=!0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=c.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.LyricsYMarginToBottomLine=.2,this.LyricsExtraXShiftForShortLyrics=.5,this.LyricsExtraXShiftForShortLyricsWidthThreshold=1.4,this.LyricsUseXPaddingForLongLyrics=!0,this.LyricsXPaddingFactorForLongLyrics=1,this.LyricsXPaddingWidthThreshold=1.7,this.LyricsXPaddingReductionForLongNotes=.7,this.LyricsXPaddingReductionForLastNoteInMeasure=1.2,this.LyricsXPaddingForLastNoteInMeasure=!0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.TempoYSpacing=.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.IgnoreRepeatedDynamics=!1,this.ExpressionsUseXMLColor=!0,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.TremoloBuzzRollThickness=.25,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=P.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=P.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=P.unit,this.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure=!1,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MultipleRestMeasureAddKeySignature=!0,this.FixedMeasureWidth=!1,this.FixedMeasureWidthFixedValue=void 0,this.FixedMeasureWidthUseForPickupMeasures=!1,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.PickupMeasureRepetitionSpacing=.8,this.PickupMeasureSpacingSingleNoteAddend=1.6,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-1,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=h.AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=h.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.RenderGlissandi=!0,this.ColoringMode=d.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=f.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderCopyright=!1,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderSystemLabelsAfterFirstPage=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMultipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.RenderPedals=!0,this.ArticulationPlacementFromXML=!0,this.BreathMarkDistance=.8,this.FingeringPosition=l.PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=l.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.NewSystemAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,this.IgnoreBracketsWords=!0,this.PlaceWordsInsideStafflineFromXml=!1,this.PlaceWordsInsideStafflineYOffset=.9,this.PageFormat=w.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new E.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0,this.SkyBottomLineBatchMinMeasures=5,this.SkyBottomLineWebGLMinMeasures=80,this.AlwaysSetPreferredSkyBottomLineBackendAutomatically=!0,this.DisableWebGLInFirefox=!0,this.DisableWebGLInSafariAndIOS=!0,this.setPreferredSkyBottomLineBackendAutomatically();try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(M){g.default.info("EngravingRules()",M)}}setPreferredSkyBottomLineBackendAutomatically(M=-1){var N,R,A,F;let U="",Y="";typeof globalThis=="object"&&(U=(R=(N=globalThis.navigator)===null||N===void 0?void 0:N.vendor)!==null&&R!==void 0?R:"",Y=(F=(A=globalThis.navigator)===null||A===void 0?void 0:A.userAgent)!==null&&F!==void 0?F:"");let k=!1;(this.DisableWebGLInSafariAndIOS&&/apple/i.test(U)||this.DisableWebGLInFirefox&&Y.includes("Firefox"))&&(k=!0),this.PreferredSkyBottomLineBatchCalculatorBackend=h.SkyBottomLineBatchCalculatorBackendType.Plain,k||M>=this.SkyBottomLineWebGLMinMeasures&&(this.PreferredSkyBottomLineBatchCalculatorBackend=h.SkyBottomLineBatchCalculatorBackendType.WebGL)}applyDefaultColorMusic(M){this.DefaultColorMusic=M,this.DefaultColorNotehead=M,this.DefaultColorRest=M,this.DefaultColorStem=M,this.DefaultColorLabel=M,this.DefaultColorLyrics=M,this.DefaultColorTitle=M,this.LedgerLineColorDefault=M}addGraphicalNoteToNoteMap(M,N){M.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(M.NoteToGraphicalNoteObjectId,N),this.NoteToGraphicalNoteMapObjectCount++}GNote(M){return _.GraphicalNote.FromNote(M,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new E.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}resetChordAccidentalTexts(M,N){M.setValue(y.AccidentalEnum.SHARP,N?"♯":"#"),M.setValue(y.AccidentalEnum.FLAT,N?"♭":"b"),M.setValue(y.AccidentalEnum.DOUBLEFLAT,N?"𝄫":"bb"),M.setValue(y.AccidentalEnum.DOUBLESHARP,N?"𝄪":"x")}setChordSymbolLabelText(M,N){this.ChordSymbolLabelTexts.setValue(M,N)}resetChordSymbolLabelTexts(M){return M.setValue(S.ChordSymbolEnum.minor,"m"),M.setValue(S.ChordSymbolEnum.augmented,"aug"),M.setValue(S.ChordSymbolEnum.diminished,"dim"),M.setValue(S.ChordSymbolEnum.dominant,"7"),M.setValue(S.ChordSymbolEnum.majorseventh,"maj7"),M.setValue(S.ChordSymbolEnum.minorseventh,"m7"),M.setValue(S.ChordSymbolEnum.diminishedseventh,"dim7"),M.setValue(S.ChordSymbolEnum.augmentedseventh,"aug7"),M.setValue(S.ChordSymbolEnum.halfdiminished,`m7${this.ChordAccidentalTexts.getValue(y.AccidentalEnum.FLAT)}5`),M.setValue(S.ChordSymbolEnum.majorminor,"m(maj7)"),M.setValue(S.ChordSymbolEnum.majorsixth,"maj6"),M.setValue(S.ChordSymbolEnum.minorsixth,"m6"),M.setValue(S.ChordSymbolEnum.dominantninth,"9"),M.setValue(S.ChordSymbolEnum.majorninth,"maj9"),M.setValue(S.ChordSymbolEnum.minorninth,"m9"),M.setValue(S.ChordSymbolEnum.dominant11th,"11"),M.setValue(S.ChordSymbolEnum.major11th,"maj11"),M.setValue(S.ChordSymbolEnum.minor11th,"m11"),M.setValue(S.ChordSymbolEnum.dominant13th,"13"),M.setValue(S.ChordSymbolEnum.major13th,"maj13"),M.setValue(S.ChordSymbolEnum.minor13th,"m13"),M.setValue(S.ChordSymbolEnum.suspendedsecond,"sus2"),M.setValue(S.ChordSymbolEnum.suspendedfourth,"sus4"),M.setValue(S.ChordSymbolEnum.power,"5"),M.setValue(S.ChordSymbolEnum.none,"N.C."),M}addChordName(M,N,R,A,F){if(S.ChordSymbolEnum[N]!==void 0){const U={adds:R,alts:A,subs:F};this.CustomChords.push(S.CustomChord.createCustomChord(M,S.ChordSymbolEnum[N],U))}}renameChord(M,N){S.CustomChord.renameCustomChord(M,N,this.CustomChords)}resetChordNames(){const M=this.ChordAccidentalTexts.getValue(y.AccidentalEnum.SHARP),N=this.ChordAccidentalTexts.getValue(y.AccidentalEnum.FLAT);this.addChordName("alt","major",[`${M}5`,`${N}9`,`${M}9`],[`${N}5`],[]),this.addChordName("7alt","dominant",[`${M}5`,`${N}9`,`${M}9`],[`${N}5`],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName(`m7${N}5`,"minorseventh",[],[`${N}5`],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let M=0;M{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalChordSymbolContainer=void 0;const u=r(2255),a=r(9946),g=r(4123),c=r(8911),l=r(4785),h=r(9086);class d extends l.GraphicalObject{constructor(f,y,S,_,P,w){super(),this.chordSymbolContainer=f,this.boundingBox=new c.BoundingBox(this,y),this.rules=w,this.calculateLabel(S,P,_)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(f,y,S){const _=g.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,y,S);this.graphicalLabel=new a.GraphicalLabel(new u.Label(_),f,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new h.PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}o.GraphicalChordSymbolContainer=d},3442:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalComment=void 0,o.GraphicalComment=class{constructor(r,u){this.label=r,this.settings=u}}},374:function(b,o,r){var u=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalContinuousDynamicExpression=void 0;const a=r(6729),g=r(7839),c=r(9086),l=r(6791),h=r(3748),d=u(r(2043));class E extends l.AbstractGraphicalExpression{constructor(y,S,_){super(S,y,_),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(y){this.startMeasure=y}get EndMeasure(){return this.endMeasure}set EndMeasure(y){this.endMeasure=y}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(y){this.isSplittedPart=y}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(y){this.notToBeRemoved=y}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var y;const S=this.parentStaffLine.SkyBottomLineCalculator,_=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,P=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsSoftAccent&&!this.IsVerbal&&this.lines.length<2&&d.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==g.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==g.ContDynamicEnum.diminuendo&&d.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+((y=this.startMeasure)===null||y===void 0?void 0:y.MeasureNumber)),this.Placement){case h.PlacementEnum.Above:if(this.IsSoftAccent)S.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End),S.updateSkyLineWithWedge(this.lines[2].End,this.lines[2].Start),S.updateSkyLineWithLine(this.lines[0].End,this.lines[2].End,this.lines[0].End.y);else if(this.IsVerbal){const w=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;S.updateSkyLineInRange(_,P,w)}else this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?S.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.diminuendo&&S.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case h.PlacementEnum.Below:if(this.IsVerbal){const w=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;S.updateBottomLineInRange(_,P,w)}else this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?S.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.diminuendo&&S.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:d.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(y,S,_,P=this.rules.WedgeOpeningLength,w=this.rules.WedgeLineWidth){const x=new c.PointF2D(y,_),M=new c.PointF2D(S,_-P/2),N=new c.PointF2D(S,_+P/2);this.addWedgeLines(x,M,N,w)}createFirstHalfCrescendoLines(y,S,_,P=this.rules.WedgeMeasureEndOpeningLength,w=this.rules.WedgeLineWidth){const x=new c.PointF2D(y,_),M=new c.PointF2D(S,_-P/2),N=new c.PointF2D(S,_+P/2);this.addWedgeLines(x,M,N,w)}createSecondHalfCrescendoLines(y,S,_,P=this.rules.WedgeMeasureBeginOpeningLength,w=this.rules.WedgeOpeningLength,x=this.rules.WedgeLineWidth){const M=new c.PointF2D(y,_-P/2),N=new c.PointF2D(y,_+P/2),R=new c.PointF2D(S,_-w/2),A=new c.PointF2D(S,_+w/2);this.addDoubleLines(M,R,N,A,x)}recalculateCrescendoLines(y,S,_){const P=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),P?this.createSecondHalfCrescendoLines(y,S,_):this.isSplittedPart?this.createFirstHalfCrescendoLines(y,S,_):this.createCrescendoLines(y,S,_)}createDiminuendoLines(y,S,_,P=this.rules.WedgeOpeningLength,w=this.rules.WedgeLineWidth){const x=new c.PointF2D(y,_-P/2),M=new c.PointF2D(y,_+P/2),N=new c.PointF2D(S,_);this.addWedgeLines(N,x,M,w)}createFirstHalfDiminuendoLines(y,S,_,P=this.rules.WedgeOpeningLength,w=this.rules.WedgeMeasureEndOpeningLength,x=this.rules.WedgeLineWidth){const M=new c.PointF2D(y,_-P/2),N=new c.PointF2D(y,_+P/2),R=new c.PointF2D(S,_-w/2),A=new c.PointF2D(S,_+w/2);this.addDoubleLines(M,R,N,A,x)}createSecondHalfDiminuendoLines(y,S,_,P=this.rules.WedgeMeasureBeginOpeningLength,w=this.rules.WedgeLineWidth){const x=new c.PointF2D(y,_-P/2),M=new c.PointF2D(y,_+P/2),N=new c.PointF2D(S,_);this.addWedgeLines(N,x,M,w)}recalculateDiminuendoLines(y,S,_){const P=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),P?this.createFirstHalfDiminuendoLines(y,S,_):this.isSplittedPart?this.createSecondHalfDiminuendoLines(y,S,_):this.createDiminuendoLines(y,S,_)}createFirstHalfLines(y,S,_,P=this.rules.WedgeOpeningLength,w=this.rules.WedgeMeasureEndOpeningLength,x=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?this.createFirstHalfCrescendoLines(y,S,_,w,x):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.diminuendo&&this.createFirstHalfDiminuendoLines(y,S,_,P,w,x)}createSecondHalfLines(y,S,_,P=this.rules.WedgeMeasureBeginOpeningLength,w=this.rules.WedgeOpeningLength,x=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?this.createSecondHalfCrescendoLines(y,S,_,P,w,x):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.diminuendo&&this.createSecondHalfDiminuendoLines(y,S,_,P,x)}createLines(y,S,_,P=this.rules.WedgeOpeningLength,w=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?this.createCrescendoLines(y,S,_,P,w):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.diminuendo&&this.createDiminuendoLines(y,S,_,P,w)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.IsSoftAccent?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[3].Start.x-this.lines[0].Start.x):this.ContinuousDynamic.DynamicType===g.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(y){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=y,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=y,this.lines[0].End.y+=y,this.lines[1].End.y+=y)}squeeze(y){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=y:(this.lines[0].End.x+=y,this.lines[1].End.x+=y):y<0?this.lines[0].Start.x+=y:(this.lines[0].End.x+=y,this.lines[1].End.x+=y),this.calcPsi())}addWedgeLines(y,S,_,P){const w=new a.GraphicalLine(y,S,P),x=new a.GraphicalLine(y,_,P);this.rules.DefaultColorMusic&&(w.colorHex=this.rules.DefaultColorMusic,x.colorHex=this.rules.DefaultColorMusic),this.lines.push(w),this.lines.push(x)}addDoubleLines(y,S,_,P,w){const x=new a.GraphicalLine(y,S,w),M=new a.GraphicalLine(_,P,w);this.rules.DefaultColorMusic&&(x.colorHex=this.rules.DefaultColorMusic,M.colorHex=this.rules.DefaultColorMusic),this.lines.push(x),this.lines.push(M)}}o.GraphicalContinuousDynamicExpression=E},5330:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalCurve=void 0;const u=r(9086);class a{constructor(){a.tPow3=new Array(a.bezierCurveStepSize),a.oneMinusTPow3=new Array(a.bezierCurveStepSize),a.bezierFactorOne=new Array(a.bezierCurveStepSize),a.bezierFactorTwo=new Array(a.bezierCurveStepSize);for(let c=0;c=a.bezierCurveStepSize?new u.PointF2D:new u.PointF2D(a.oneMinusTPow3[l]*this.bezierStartPt.x+a.bezierFactorOne[l]*this.bezierStartControlPt.x+a.bezierFactorTwo[l]*this.bezierEndControlPt.x+a.tPow3[l]*this.bezierEndPt.x,a.oneMinusTPow3[l]*this.bezierStartPt.y+a.bezierFactorOne[l]*this.bezierStartControlPt.y+a.bezierFactorTwo[l]*this.bezierEndControlPt.y+a.tPow3[l]*this.bezierEndPt.y)}}o.GraphicalCurve=a,a.bezierCurveStepSize=1e3},1443:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalGlissando=void 0;const u=r(9086),a=r(8911),g=r(6729);o.GraphicalGlissando=class{constructor(c){this.Glissando=c,this.staffEntries=[]}calculateLine(c){const l=this.staffEntries[0],h=this.staffEntries[this.staffEntries.length-1],d=l.findGraphicalNoteFromNote(this.Glissando.StartNote),E=h.findGraphicalNoteFromNote(this.Glissando.EndNote);if(!d&&!E)return;const f=l.parentMeasure.ParentStaffLine;let y,S,_,P;if(d&&l.parentMeasure.ParentStaffLine===this.StaffLine)y=d.PositionAndShape.RelativePosition.x+d.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+d.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x+c.GlissandoNoteOffset,_=d.PositionAndShape.AbsolutePosition.y;else{y=h.parentMeasure.beginInstructionsWidth-.4;const M=this.Glissando.Direction===a.ColDirEnum.Down?-1:1;_=E.PositionAndShape.AbsolutePosition.y+M*c.GlissandoStafflineStartYDistanceToNote}if(E&&h.parentMeasure.ParentStaffLine===this.StaffLine)S=E.PositionAndShape.RelativePosition.x+E.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+E.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x-.5-c.GlissandoNoteOffset,y>S&&(y=S-c.GlissandoStafflineStartMinimumWidth),P=E.PositionAndShape.AbsolutePosition.y;else{if(f.Measures.last().parentSourceMeasure.HasEndLine)return;S=f.PositionAndShape.Size.width,S-y>c.GlissandoStafflineEndOffset&&(y=S-c.GlissandoStafflineEndOffset);const M=this.Glissando.Direction===a.ColDirEnum.Down?1:-1;P=d.PositionAndShape.AbsolutePosition.y+M*c.GlissandoStafflineStartYDistanceToNote}const w=new u.PointF2D(y,_),x=new u.PointF2D(S,P);this.Width===void 0&&(this.Width=c.GlissandoDefaultWidth),this.Line=new g.GraphicalLine(w,x,this.Width)}}},9428:function(b,o,r){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalInstantaneousDynamicExpression=void 0;const a=r(6791),g=r(3748),c=u(r(2043));class l extends a.AbstractGraphicalExpression{constructor(d,E,f){super(E,d,f.parentSourceMeasure),this.mInstantaneousDynamicExpression=d,this.mMeasure=f}updateSkyBottomLine(){const d=this.parentStaffLine.SkyBottomLineCalculator,E=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,f=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let y=0;switch(this.Placement){case g.PlacementEnum.Above:y=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,d.updateSkyLineInRange(E,f,y);break;case g.PlacementEnum.Below:y=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,d.updateBottomLineInRange(E,f,y);break;default:c.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}o.GraphicalInstantaneousDynamicExpression=l},5277:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalInstantaneousTempoExpression=void 0;const u=r(6791);class a extends u.AbstractGraphicalExpression{constructor(c,l){super(l.PositionAndShape.Parent.DataObject,c,c.parentMeasure),this.label=l}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}o.GraphicalInstantaneousTempoExpression=a},9946:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalLabel=void 0;const u=r(1274),a=r(8911),g=r(4278),c=r(4040);class l extends g.Clickable{constructor(d,E,f,y,S=void 0){super(),this.CenteringXShift=0,this.label=d,this.boundingBox=new a.BoundingBox(this,S),this.label.fontHeight=E,this.label.textAlignment=f,this.rules=y}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var d,E;if(this.Label.text.trim()==="")return;this.TextLines=[];const f=(E=(d=this.rules)===null||d===void 0?void 0:d.LabelMarginBorderFactor)!==null&&E!==void 0?E:.1,y=this.Label.text.split(/[\n\r]+/g),S=y.length;let _=0;for(let x=0;x0&&this.TextLines.length>1&&(P+=this.rules.SpacingBetweenTextLines*S/10);const w=this.PositionAndShape;switch(this.Label.textAlignment){case u.TextAlignmentEnum.CenterBottom:w.BorderTop=-P,w.BorderLeft=-_/2,w.BorderBottom=0,w.BorderRight=_/2;break;case u.TextAlignmentEnum.CenterCenter:w.BorderTop=-P/2,w.BorderLeft=-_/2,w.BorderBottom=P/2,w.BorderRight=_/2;break;case u.TextAlignmentEnum.CenterTop:w.BorderTop=0,w.BorderLeft=-_/2,w.BorderBottom=P,w.BorderRight=_/2;break;case u.TextAlignmentEnum.LeftBottom:w.BorderTop=-P,w.BorderLeft=0,w.BorderBottom=0,w.BorderRight=_;break;case u.TextAlignmentEnum.LeftCenter:w.BorderTop=-P/2,w.BorderLeft=0,w.BorderBottom=P/2,w.BorderRight=_;break;case u.TextAlignmentEnum.LeftTop:w.BorderTop=0,w.BorderLeft=0,w.BorderBottom=P,w.BorderRight=_;break;case u.TextAlignmentEnum.RightBottom:w.BorderTop=-P,w.BorderLeft=-_,w.BorderBottom=0,w.BorderRight=0;break;case u.TextAlignmentEnum.RightCenter:w.BorderTop=-P/2,w.BorderLeft=-_,w.BorderBottom=P/2,w.BorderRight=0;break;case u.TextAlignmentEnum.RightTop:w.BorderTop=0,w.BorderLeft=-_,w.BorderBottom=P,w.BorderRight=0}w.BorderMarginTop=w.BorderTop-P*f,w.BorderMarginLeft=w.BorderLeft-P*f,w.BorderMarginBottom=w.BorderBottom+P*f,w.BorderMarginRight=w.BorderRight+P*f}}o.GraphicalLabel=l},6729:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalLine=void 0;const u=r(8155);o.GraphicalLine=class{constructor(a,g,c=0,l=u.OutlineAndFillStyleEnum.BaseWritingColor,h=void 0){this.start=a,this.end=g,this.width=c,this.styleId=l,this.colorHex=h}get Start(){return this.start}set Start(a){this.start=a}get End(){return this.end}set End(a){this.end=a}get Width(){return this.width}set Width(a){this.width=a}}},5091:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalLyricEntry=void 0;const u=r(9946),a=r(2255),g=r(9086),c=r(1274);o.GraphicalLyricEntry=class{constructor(l,h,d,E){this.lyricsEntry=l,this.graphicalStaffEntry=h;const f=h.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;l.Text.length>=4&&l.Parent.Notes[0].Length.Denominator>4&&c.TextAlignmentEnum.LeftBottom;const y=new a.Label(l.Text),S=this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules;this.graphicalLabel=new u.GraphicalLabel(y,d,f,S,h.PositionAndShape),this.graphicalLabel.Label.colorDefault=S.DefaultColorLyrics,this.graphicalLabel.PositionAndShape.RelativePosition=new g.PointF2D(0,E),this.graphicalLabel.setLabelPositionAndShapeBorders(),this.graphicalLabel.PositionAndShape.Size.width1&&l{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalLyricWord=void 0,o.GraphicalLyricWord=class{constructor(r){this.graphicalLyricsEntries=[],this.lyricWord=r,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(r){this.graphicalLyricsEntries=r}isFilled(){for(let r=0;r{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalMarkedArea=void 0,o.GraphicalMarkedArea=class{constructor(r,u=void 0,a=void 0,g=void 0){this.systemRectangle=r,this.labelRectangle=u,this.label=a,this.settings=g}}},1513:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalMeasure=void 0;const u=r(4785),a=r(1797),g=r(8911),c=r(9086);class l extends u.GraphicalObject{constructor(d=void 0,E=void 0,f=void 0){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.ShowTimeSignature=!0,this.ShowKeySignature=!0,this.isTabMeasure=!1,this.parentStaff=d,this.parentSourceMeasure=E,this.parentStaffLine=f,f?(this.parentStaff=f.ParentStaff,this.PositionAndShape=new g.BoundingBox(this,f.PositionAndShape)):this.PositionAndShape=new g.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(d){this.parentMusicSystem=d}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(d){this.firstInstructionStaffEntry=d}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(d){this.lastInstructionStaffEntry=d}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(d){this.parentStaffLine=d,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(d){throw new Error("not implemented")}addClefAtBegin(d){throw new Error("not implemented")}addKeyAtBegin(d,E,f){throw new Error("not implemented")}addRhythmAtBegin(d){throw new Error("not implemented")}addClefAtEnd(d,E=!0){throw new Error("not implemented")}setPositionInStaffline(d){this.PositionAndShape.RelativePosition=new c.PointF2D(d,0)}setWidth(d){this.PositionAndShape.BorderRight=d}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(d){var E;for(let f=0,y=this.staffEntries.length;f1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let d=new a.Fraction(0,1);const E=[];for(let f=0,y=this.staffEntries.length;f0&&_.Add(w.notes[0].graphicalNoteLength);d.lt(_)&&(d=a.Fraction.createFromFraction(_))}return d}addGraphicalStaffEntry(d){this.staffEntries.push(d)}addGraphicalStaffEntryAtTimestamp(d){if(d)if(this.staffEntries.length===0||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(d.relInMeasureTimestamp))this.staffEntries.push(d);else for(let E=this.staffEntries.length-1;E>=0;E--){if(this.staffEntries[E].relInMeasureTimestamp.lt(d.relInMeasureTimestamp)){this.staffEntries.splice(E+1,0,d);break}E===0&&this.staffEntries.splice(E,0,d)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1||this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length!==1&&this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const d=this.parentSourceMeasure;return!!d&&d.beginsWithLineRepetition()}endsWithLineRepetition(){const d=this.parentSourceMeasure;return!!d&&d.endsWithLineRepetition()}beginsWithWordRepetition(){const d=this.parentSourceMeasure;return!!d&&d.beginsWithWordRepetition()}endsWithWordRepetition(){const d=this.parentSourceMeasure;return!!d&&d.endsWithWordRepetition()}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}o.GraphicalMeasure=l},599:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PagePlacementEnum=o.GraphicalMusicPage=void 0;const u=r(8911),a=r(4785),g=r(9086);class c extends a.GraphicalObject{constructor(d){super(),this.musicSystems=[],this.labels=[],this.parent=d,this.boundingBox=new u.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(d){this.musicSystems=d}get Labels(){return this.labels}set Labels(d){this.labels=d}get Parent(){return this.parent}set Parent(d){this.parent=d}get PageNumber(){return this.pageNumber}set PageNumber(d){this.pageNumber=d}setMusicPageAbsolutePosition(d,E){return new g.PointF2D(0,0)}}var l;o.GraphicalMusicPage=c,(l=o.PagePlacementEnum||(o.PagePlacementEnum={}))[l.Down=0]="Down",l[l.Right=1]="Right",l[l.RightDown=2]="RightDown"},4324:function(b,o,r){var u=this&&this.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(o,"__esModule",{value:!0}),o.SystemImageProperties=o.GraphicalMusicSheet=void 0;const a=r(525),g=r(6729),c=r(9086),l=r(289),h=r(5198),d=r(1797),E=r(8911),f=u(r(2043)),y=r(2337),S=r(5974),_=r(4785);o.GraphicalMusicSheet=class{constructor(P,w){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=P,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=w,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(P){this.musicPages=P}get MeasureList(){return this.measureList}set MeasureList(P){this.measureList=P}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(P){this.verticalGraphicalStaffEntryContainers=P}get Title(){return this.title}set Title(P){this.title=P}get Subtitle(){return this.subtitle}set Subtitle(P){this.subtitle=P}get Composer(){return this.composer}set Composer(P){this.composer=P}get Lyricist(){return this.lyricist}set Lyricist(P){this.lyricist=P}get Copyright(){return this.copyright}set Copyright(P){this.copyright=P}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(P){this.minAllowedSystemWidth=P}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(P){this.leadSheet=P}static transformRelativeToAbsolutePosition(P){for(let w=0;w=0;M--){const N=(x=this.measureList[M])===null||x===void 0?void 0:x[w];if(N)return N}}findGraphicalStaffEntryFromMeasureList(P,w,x){for(let M=w;M0)return R.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(P,w){const x=[],M=this.measureList[0].length;for(let N=P;N<=w;N++)for(let R=0;R=0;w--){if(this.verticalGraphicalStaffEntryContainers[w].AbsoluteTimestamp.lt(P)){const x=new a.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,P);return this.verticalGraphicalStaffEntryContainers.splice(w+1,0,x),x}if(this.verticalGraphicalStaffEntryContainers[w].AbsoluteTimestamp.Equals(P))return this.verticalGraphicalStaffEntryContainers[w]}}GetVerticalContainerFromTimestamp(P,w=0){const x=y.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new a.VerticalGraphicalStaffEntryContainer(0,P),a.VerticalGraphicalStaffEntryContainer.compareByTimestamp,w);if(x>=0)return this.verticalGraphicalStaffEntryContainers[x]}GetInterpolatedIndexInVerticalContainers(P){const w=this.verticalGraphicalStaffEntryContainers;if(w.length===1)return 0;let x,M,N=0,R=w.length-1;if(P.lte(w[w.length-1].AbsoluteTimestamp)){for(;R-N>1;){const U=Math.floor((R+N)/2);if(w[N].AbsoluteTimestamp.Equals(P)){R=N;break}if(w[R].AbsoluteTimestamp.Equals(P)){N=R;break}if(w[U].AbsoluteTimestamp.Equals(P))return this.verticalGraphicalStaffEntryContainers.indexOf(w[U]);P.lt(w[U].AbsoluteTimestamp)?R=U:N=U}if(N===R)return this.verticalGraphicalStaffEntryContainers.indexOf(w[N]);x=w[N].AbsoluteTimestamp,M=w[R].AbsoluteTimestamp}else x=w[w.length-1].AbsoluteTimestamp,M=d.Fraction.plus(this.getLongestStaffEntryDuration(w.length-1),x),R=w.length;const A=M.RealValue-x.RealValue,F=R-(M.RealValue-P.RealValue)/A;return Math.min(F,this.verticalGraphicalStaffEntryContainers.length-1)}getVisibleStavesIndicesFromSourceMeasure(P){const w=[],x=[];for(let M=0,N=P.length;M=0;)M=this.measureList[--x][P];return this.measureList[x][P]}getMeasureIndex(P,w,x){for(w=0;w{var x;return((x=w.parentStaffEntry)===null||x===void 0?void 0:x.relInMeasureTimestamp)!==void 0})}GetNearestNote(P,w){const x=this.GetNearestVoiceEntry(P);if(!x)return;let M,N=Number.MAX_SAFE_INTEGER;for(const R of x.notes){const A=R.PositionAndShape.AbsolutePosition.y,F=Math.abs(R.PositionAndShape.AbsolutePosition.x-P.x),U=Math.abs(A-P.y);F+UR.PositionAndShape.RelativePosition.x&&(x=R):x=R)}}catch(M){f.default.info("GraphicalMusicSheet.getStaffEntry",M)}return x}GetPreviousVisibleContainerIndex(P){for(let w=P-1;w>=0;w--){const x=this.verticalGraphicalStaffEntryContainers[w].StaffEntries;for(let M=0,N=x.length;M=0;N--)if(x=this.getStaffEntry(N),x&&(!w||x.sourceStaffEntry.ParentStaff.ParentInstrument.Visible))return x}findClosestRightStaffEntry(P,w){let x;for(let M=Math.max(0,Math.ceil(P));M{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalNote=void 0;const u=r(8640),a=r(4785),g=r(4040),c=r(8911);class l extends a.GraphicalObject{constructor(d,E,f,y=void 0){super(),this.DrawnAccidental=u.AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=d,this.parentVoiceEntry=E,this.PositionAndShape=new c.BoundingBox(this,E.PositionAndShape),this.graphicalNoteLength=y||d.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=f,this.rules.addGraphicalNoteToNoteMap(d,this)}Transpose(d,E,f,y){let S=this.sourceNote.Pitch;return g.MusicSheetCalculator.transposeCalculator&&(S=g.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,d,f)),S}calculateNumberOfNeededDots(d){return this.sourceNote&&this.sourceNote.NoteTuplet?0:d.calculateNumberOfNeededDots()}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(d,E){return E.NoteToGraphicalNoteMap.getValue(d.NoteToGraphicalNoteObjectId)}ToStringShort(d=0){var E;return(E=this.sourceNote)===null||E===void 0?void 0:E.ToStringShort(d)}get ToStringShortGet(){return this.ToStringShort(0)}}o.GraphicalNote=l},4785:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalObject=void 0;const u=r(1035);class a extends u.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(c){this.boundingBox=c}}o.GraphicalObject=a},873:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalOctaveShift=void 0;const u=r(4785),a=r(5853),g=r(8911),c=r(158),l=r(1703);class h extends u.GraphicalObject{constructor(E,f){super(),this.getOctaveShift=E,this.setSymbol(),this.PositionAndShape=new g.BoundingBox(this,f)}setSymbol(){switch(this.getOctaveShift.Type){case a.OctaveEnum.VA8:this.octaveSymbol=c.MusicSymbol.VA8;break;case a.OctaveEnum.VB8:this.octaveSymbol=c.MusicSymbol.VB8;break;case a.OctaveEnum.MA15:this.octaveSymbol=c.MusicSymbol.MA15;break;case a.OctaveEnum.MB15:this.octaveSymbol=c.MusicSymbol.MB15;break;default:throw new l.ArgumentOutOfRangeException("")}}}o.GraphicalOctaveShift=h},4082:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalPedal=void 0;const u=r(4785),a=r(8911),g=r(158);class c extends u.GraphicalObject{constructor(h,d){super(),this.getPedal=h,this.setSymbol(),this.PositionAndShape=new a.BoundingBox(this,d)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=g.MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=g.MusicSymbol.PEDAL_MIXED:this.pedalSymbol=g.MusicSymbol.PEDAL_BRACKET}}o.GraphicalPedal=c},3411:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalRectangle=void 0;const u=r(8911),a=r(4785);class g extends a.GraphicalObject{constructor(l,h,d,E){super(),this.boundingBox=new u.BoundingBox(this,d),this.boundingBox.RelativePosition=l,this.boundingBox.BorderRight=h.x-l.x,this.boundingBox.BorderBottom=h.y-l.y,this.style=E}}o.GraphicalRectangle=g},9876:function(b,o,r){var u=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalSlur=void 0;const a=r(9086),g=r(5330),c=r(3748),l=r(8363),h=r(2947),d=r(1797),E=r(908);var f=u(r(6368)).default.Flow;class y extends g.GraphicalCurve{constructor(_,P){super(),this.staffEntries=[],this.slur=_,this.rules=P}static Compare(_,P){if(_.staffEntries.length<1)return-1;if(P.staffEntries.length<1)return 1;const w=d.Fraction.minus(_.staffEntries[_.staffEntries.length-1].getAbsoluteTimestamp(),_.staffEntries[0].getAbsoluteTimestamp()),x=d.Fraction.minus(P.staffEntries[P.staffEntries.length-1].getAbsoluteTimestamp(),P.staffEntries[0].getAbsoluteTimestamp());return w.RealValue>x.RealValue?1:x.RealValue>w.RealValue?-1:0}calculateCurve(_){const P=this.staffEntries[0],w=this.staffEntries[this.staffEntries.length-1];let x=P.findGraphicalNoteFromNote(this.slur.StartNote);!x&&this.graceStart&&(x=P.findGraphicalNoteFromGraceNote(this.slur.StartNote)),x||(x=P.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let M=w.findGraphicalNoteFromNote(this.slur.EndNote);!M&&this.graceEnd&&(M=w.findGraphicalNoteFromGraceNote(this.slur.EndNote));const N=P.parentMeasure.ParentStaffLine,R=N.SkyBottomLineCalculator;this.calculatePlacement(R,N);const A=this.calculateStartAndEnd(x,M,N,_,R),F=A.startX,U=A.endX;let Y=A.startY,k=A.endY;const W=_.SlurTangentMinAngle,G=_.SlurTangentMaxAngle;let H;if(this.placement===c.PlacementEnum.Above){Y-=_.SlurNoteHeadYOffset,k-=_.SlurNoteHeadYOffset;const L=new a.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,Y);x?L.x+=this.staffEntries[0].PositionAndShape.BorderRight:L.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(L.x+=w.PositionAndShape.RelativePosition.x);const $=new a.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,k);if(M?$.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:$.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&($.x+=w.staffEntryParent.PositionAndShape.RelativePosition.x),H=this.calculateTopPoints(L,$,N,R),H.length===0){const ke=new a.PointF2D(($.x-L.x)/2+L.x,($.y-L.y)/2+L.y);H.push(ke)}const ie=Math.atan((k-Y)/(U-F)),re=new a.PointF2D(0,0);let be=new a.PointF2D(U-F,-(k-Y));const ae=l.Matrix2D.getRotationMatrix(ie),ge=ae.getTransposeMatrix();be=ae.vectorMultiplication(be);const le=this.calculateTranslatedAndRotatedPointListAbove(H,F,Y,ae),Z=this.calculateMaxLeftSlope(le,re,be),ye=this.calculateMaxRightSlope(le,re,be),Se=re.y-re.x*Z,X=be.y-be.x*ye,ee=new a.PointF2D;let ne=!1;Math.abs(Math.abs(Z)-Math.abs(ye))<1e-4?(ee.x=be.x/2,ee.y=0,ne=!0):(ee.x=(X-Se)/(Z-ye),ee.y=Z*ee.x+Se);const O=this.calculateHeightWidthRatio(be.x,le),z=0,K=0;let q=W,de=-W;if(!ne){const ke=this.calculateAngles(W,Z,ye,G);q=ke.startAngle,de=ke.endAngle}const ue=this.calculateControlPoints(be.x,q,de,le,O,Y,k);let ce=ue.startControlPoint,pe=ue.endControlPoint;ce=ge.vectorMultiplication(ce),ce.x+=F,ce.y=-ce.y+Y,pe=ge.vectorMultiplication(pe),pe.x+=F,pe.y=-pe.y+Y,this.bezierStartPt=new a.PointF2D(F,Y-z),this.bezierStartControlPt=new a.PointF2D(ce.x,ce.y-z),this.bezierEndControlPt=new a.PointF2D(pe.x,pe.y-K),this.bezierEndPt=new a.PointF2D(U,k-K);const we=N.SkyLine.length,Me=R.getLeftIndexForPointX(this.bezierStartPt.x,we),ze=R.getLeftIndexForPointX(this.bezierEndPt.x,we),De=this.bezierEndPt.x-this.bezierStartPt.x,Qe=R.SamplingUnit;for(let ke=Me;ke=Me&&(N.SkyLine[Ye]=Math.min(N.SkyLine[Ye],qe.y)),Ye++,Ye=Me&&(N.BottomLine[Ye]=Math.max(N.BottomLine[Ye],qe.y)),Ye++,Ye0)return void(this.placement=c.PlacementEnum.Above);const w=this.staffEntries[0],x=this.staffEntries[this.staffEntries.length-1],M=w.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(M===x.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=M===E.StemDirectionType.Up?c.PlacementEnum.Below:c.PlacementEnum.Above,this.rules.SlurPlacementAtStems&&(this.placement=M===E.StemDirectionType.Up?c.PlacementEnum.Above:c.PlacementEnum.Below);else{let N=w.PositionAndShape.BorderLeft+w.PositionAndShape.RelativePosition.x+w.parentMeasure.PositionAndShape.RelativePosition.x,R=x.PositionAndShape.BorderRight+x.PositionAndShape.RelativePosition.x+x.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(N+=x.PositionAndShape.RelativePosition.x),this.graceEnd&&(R+=x.staffEntryParent.PositionAndShape.RelativePosition.x);const A=-1*_.getSkyLineMinInRange(N,R),F=_.getBottomLineMaxInRange(N,R)-P.StaffHeight;this.placement=F>A?c.PlacementEnum.Above:c.PlacementEnum.Below}}calculateTopPoints(_,P,w,x){const M=[];let N=x.getRightIndexForPointX(_.x,w.SkyLine.length),R=x.getLeftIndexForPointX(P.x,w.SkyLine.length);N<0&&(N=0),R>=w.SkyLine.length&&(R=w.SkyLine.length-1);for(let A=N;A=w.BottomLine.length&&(R=w.BottomLine.length-1);for(let A=N;AU&&_>Y&&(F+=_/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,F*=1+P/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,A/=F);const k=Math.min(.5,Math.max(.1,1.7*P/80*A*Math.pow(Math.max(M,.05),.4))),W=Math.min(.5,Math.max(.1,1.7*-w/80*A*Math.pow(Math.max(M,.05),.4))),G=new a.PointF2D;G.x=_*k*Math.cos(P*y.degreesToRadiansFactor),G.y=_*k*Math.sin(P*y.degreesToRadiansFactor);const H=new a.PointF2D;H.x=_-_*W*Math.cos(w*y.degreesToRadiansFactor),H.y=-_*W*Math.sin(w*y.degreesToRadiansFactor);let L=G.y-H.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(L)>this.rules.SlurMaximumYControlPointDistance;)L<0?(G.y+=1,H.y-=1):(G.y-=1,H.y+=1),L=G.y-H.y;return{startControlPoint:G,endControlPoint:H}}calculateAngles(_,P,w,x){let M=Math.atan(P)/y.degreesToRadiansFactor;P>0?M+=20:M-=20;let N=Math.atan(w)/y.degreesToRadiansFactor;return w<0?N-=20:N+=20,{startAngle:Math.min(Math.max(_,M),x),endAngle:Math.max(Math.min(-_,N),-x)}}}o.GraphicalSlur=y,y.degreesToRadiansFactor=Math.PI/180},3023:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalStaffEntry=void 0;const u=r(8911),a=r(1797),g=r(4785),c=r(2337),l=r(4040);class h extends g.GraphicalObject{constructor(E,f=void 0,y=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=E,this.graphicalVoiceEntries=[],this.sourceStaffEntry=f,y?(this.staffEntryParent=y,this.parentVerticalContainer=y.parentVerticalContainer,this.PositionAndShape=new u.BoundingBox(this,y.PositionAndShape)):this.PositionAndShape=new u.BoundingBox(this,E.PositionAndShape),f&&(this.relInMeasureTimestamp=f.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(E){this.lyricsEntries=E}getAbsoluteTimestamp(){const E=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&E.Add(this.relInMeasureTimestamp),E}findTieGraphicalNoteFromNote(E){for(const f of this.graphicalVoiceEntries)for(const y of f.notes){const S=y.sourceNote;if(!S.isRest()&&S.Pitch.FundamentalNote===E.Pitch.FundamentalNote&&S.Pitch.Octave===E.Pitch.Octave&&S.getAbsoluteTimestamp().Equals(E.getAbsoluteTimestamp()))return y}}findEndTieGraphicalNoteFromNoteWithStartingSlur(E,f){if(E){for(const y of this.graphicalVoiceEntries)if(y.parentVoiceEntry===E.ParentVoiceEntry)for(const S of y.notes){const _=S.sourceNote;if(_.NoteTie&&_.NoteSlurs.indexOf(f)!==-1)return S}}}findGraphicalNoteFromGraceNote(E){if(E){for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry===E.ParentVoiceEntry){for(const y of f.notes)if(y.sourceNote===E)return y}}}findGraphicalNoteFromNote(E){if(E){for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry===E.ParentVoiceEntry){for(const y of f.notes)if(y.sourceNote===E&&this.getAbsoluteTimestamp().Equals(E.getAbsoluteTimestamp()))return y}}}getGraphicalNoteDurationFromVoice(E){for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry.ParentVoice===E)return f.notes[0].graphicalNoteLength;return new a.Fraction(0,1)}findVoiceEntryGraphicalNotes(E){for(const f of this.graphicalVoiceEntries)if(f.parentVoiceEntry===E)return f.notes}isVoiceEntryPartOfLinkedVoiceEntry(E){if(this.sourceStaffEntry.Link)for(let f=0,y=this.sourceStaffEntry.Link.LinkStaffEntries.length;f0&&(E=S)}return E}findStaffEntryMaxNoteLength(){let E=new a.Fraction(0,1);for(const f of this.graphicalVoiceEntries)for(const y of f.notes){const S=y.graphicalNoteLength;E.lt(S)&&S.GetExpandedNumerator()>0&&(E=S)}return E}findOrCreateGraphicalVoiceEntry(E){for(const y of this.graphicalVoiceEntries)if(y.parentVoiceEntry===E)return y;const f=l.MusicSheetCalculator.symbolFactory.createVoiceEntry(E,this);return this.graphicalVoiceEntries.push(f),f}findOrCreateGraphicalVoiceEntryFromGraphicalNote(E){for(const y of this.graphicalVoiceEntries)if(y===E.parentVoiceEntry)return y;const f=l.MusicSheetCalculator.symbolFactory.createVoiceEntry(E.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(f),f}addGraphicalNoteToListAtCorrectYPosition(E,f){const y=E.notes;if(y.length===0||f.PositionAndShape.RelativePosition.y=0;S--){if(y[S].PositionAndShape.RelativePosition.y>f.PositionAndShape.RelativePosition.y){y.splice(S+1,0,f);break}if(S===0){y.splice(0,0,f);break}}}hasOnlyRests(){return this.sourceStaffEntry.hasOnlyRests}getSkylineMin(){var E;const f=(E=this.parentMeasure)===null||E===void 0?void 0:E.ParentStaffLine.SkyBottomLineCalculator;if(!f)return;const[y,S]=this.getAbsoluteStartAndEnd();return f.getSkyLineMinInRange(y,S)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var E;const f=(E=this.parentMeasure)===null||E===void 0?void 0:E.ParentStaffLine.SkyBottomLineCalculator;if(!f)return;const[y,S]=this.getAbsoluteStartAndEnd();return f.getBottomLineMaxInRange(y,S)}getAbsoluteStartAndEnd(){let E=this.PositionAndShape.AbsolutePosition.x;return E-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x,[E,E+this.PositionAndShape.Size.width]}}o.GraphicalStaffEntry=h},8898:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalStaffEntryLink=void 0,o.GraphicalStaffEntryLink=class{constructor(r){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=r,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(r){this.graphicalLinkedStaffEntries=r}isFilled(){for(let r=0;r{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalTie=void 0,o.GraphicalTie=class{constructor(r,u=void 0,a=void 0){this.tie=r,this.startNote=u,this.endNote=a}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(r){this.startNote=r}get EndNote(){return this.endNote}set EndNote(r){this.endNote=r}}},4462:function(b,o,r){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalUnknownExpression=void 0;const a=r(6791),g=r(3748),c=u(r(2043));class l extends a.AbstractGraphicalExpression{constructor(d,E,f,y,S=void 0){super(d,new g.AbstractExpression(f),y),this.label=E,this.sourceMultiExpression=S}updateSkyBottomLine(){const d=this.parentStaffLine.SkyBottomLineCalculator,E=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,f=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case g.PlacementEnum.Above:const y=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;d.updateSkyLineInRange(E,f,y);break;case g.PlacementEnum.Below:const S=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;d.updateBottomLineInRange(E,f,S);break;default:c.default.error("Placement for GraphicalUnknownExpression is unknown")}}}o.GraphicalUnknownExpression=l},5974:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GraphicalVoiceEntry=void 0;const u=r(4785),a=r(8911),g=r(1405);class c extends u.GraphicalObject{constructor(h,d,E){super(),this.parentVoiceEntry=h,this.parentStaffEntry=d,this.PositionAndShape=new a.BoundingBox(this,d?d.PositionAndShape:void 0,!0),this.notes=[],this.rules=E||(d?d.parentMeasure.parentSourceMeasure.Rules:new g.EngravingRules)}sort(){return this.notes.sort((h,d)=>{var E,f,y,S;return((f=(E=d.sourceNote.Pitch)===null||E===void 0?void 0:E.getHalfTone())!==null&&f!==void 0?f:0)-((S=(y=h.sourceNote.Pitch)===null||y===void 0?void 0:y.getHalfTone())!==null&&S!==void 0?S:0)}),this.notes}sortForVexflow(){return this.notes.sort((h,d)=>{var E,f,y;return((f=(E=h.sourceNote.Pitch)===null||E===void 0?void 0:E.getHalfTone())!==null&&f!==void 0?f:0)-((y=d.sourceNote.Pitch.getHalfTone())!==null&&y!==void 0?y:0)}),this.notes}color(){}}o.GraphicalVoiceEntry=c},8823:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},4040:function(b,o,r){var u=this&&this.__importDefault||function(Se){return Se&&Se.__esModule?Se:{default:Se}};Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSheetCalculator=void 0;const a=r(4324),g=r(1797),c=r(5253),l=r(1513),h=r(289),d=r(5853),E=r(908),f=r(5623),y=r(9086),S=r(9050),_=r(9946),P=r(1274),w=r(5198),x=r(1357),M=r(2947),N=r(8911),R=r(4574),A=r(1070),F=r(289),U=u(r(2043)),Y=r(1649),k=r(6729),W=r(2255),G=r(141),H=r(3748),L=r(5277),$=r(9667),ie=r(280),re=r(7839),be=r(374),ae=r(41),ge=r(4462),le=r(3884),Z=r(2953);class ye{constructor(){this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalLyricWords=[],this.abstractNotImplementedErrorMessage="abstract, not implemented",this.dynamicExpressionMap=new Map}static get TextMeasurer(){return ye.textMeasurer}static set TextMeasurer(X){ye.textMeasurer=X}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}static setMeasuresMinStaffEntriesWidth(X,ee){for(let ne=0,O=X.length;ne0&&this.rules.RenderMultipleRestMeasures){pe.isReducedToMultiRest=!0,pe.multipleRestMeasureNumber=1;const Me=pe.multipleRestMeasures-1;ue+=Me;for(let ze=1;ze<=Me;ze++){const De=X.SourceMeasures.indexOf(pe)+ze;if(De>=X.SourceMeasures.length)break;const Qe=X.SourceMeasures[De];Qe.multipleRestMeasureNumber=ze+1,Qe.isReducedToMultiRest=!0,ee.push([void 0])}}}if(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let ue,ce=0;for(let pe=0,we=X.SourceMeasures.length;pe0){ue.isReducedToMultiRest=!0,ue.multipleRestMeasureNumber=1,ce++,Me.multipleRestMeasureNumber=ce,Me.isReducedToMultiRest=!0;for(let ze=0;ze1){ue.multipleRestMeasures=ce;const ze=this.createGraphicalMeasuresForSourceMeasure(ue,ne,z,q,O);ee[ue.measureListIndex]=ze,ce=0,ue=void 0}else ce=0,ue=void 0}if(ce>1){ue.multipleRestMeasures=ce,ue.isReducedToMultiRest=!0;const pe=this.createGraphicalMeasuresForSourceMeasure(ue,ne,z,q,O);ee[ue.measureListIndex]=pe,ce=0,ue=void 0}}const de=O.map(ue=>ue.ClefType===h.ClefEnum.percussion);this.handleStaffEntries(de),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),a.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(X,ee){var ne;if(this.graphicalMusicSheet.MeasureList.length>0){let O,z=0;for(let K=0;Kz&&(z=q),ye.setMeasuresMinStaffEntriesWidth(O,q)}if(this.rules.FixedMeasureWidth){let K=z;this.rules.FixedMeasureWidthFixedValue&&(K=this.rules.FixedMeasureWidthFixedValue);for(let q=0;q1;if(z===1&&ee.Measures[0].parentSourceMeasure.ImplicitMeasure&&(q=!1),q)return;K.MeasureNumber!==0&&K.MeasureNumber!==1||(ne=K.MeasureNumber),O=K!==ee.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const de=this.rules.UseXMLMeasureNumbers&&K.MeasureNumber===1&&K.parentSourceMeasure.getPrintedMeasureNumber()!==1;((K.MeasureNumber===ne||K.MeasureNumber>=ne+this.rules.MeasureNumberLabelOffset)&&!K.parentSourceMeasure.ImplicitMeasure||de)&&((K.MeasureNumber!==1||K.MeasureNumber===1&&K!==ee.Measures[0]||de)&&this.calculateSingleMeasureNumberPlacement(K,ee,X,O),ne=K.MeasureNumber)}}calculateSingleMeasureNumberPlacement(X,ee,ne,O=0){const z=X.parentSourceMeasure.getPrintedMeasureNumber().toString(),K=new W.Label(z),q=new _.GraphicalLabel(K,this.rules.MeasureNumberLabelHeight,P.TextAlignmentEnum.LeftBottom,this.rules),de=ee.SkyBottomLineCalculator;q.setLabelPositionAndShapeBorders(),q.PositionAndShape.Parent=ne.PositionAndShape;const ue=ee.PositionAndShape.RelativePosition.x+X.PositionAndShape.RelativePosition.x-q.PositionAndShape.BorderMarginLeft+O;let ce,pe=ue,we=ue-q.PositionAndShape.BorderLeft+q.PositionAndShape.BorderRight;pe-=ee.PositionAndShape.RelativePosition.x,we-=ee.PositionAndShape.RelativePosition.x;const Me=pe+.5,ze=we-.5,De=de.getSkyLineMinInRange(Me,ze);if(X===ee.Measures[0]){let Qe=0;if(ne.GroupBrackets.length>0)for(const ke of ne.GroupBrackets)Qe=Math.min(Qe,ke.PositionAndShape.BorderTop);else X.ParentStaff.ParentInstrument.Parent&&(Qe=-1);ce=Math.min(De,Qe)}else ce=De;ce=Math.min(0,ce),q.PositionAndShape.RelativePosition=new y.PointF2D(ue,ce),ne.MeasureNumberLabels.push(q)}calculateMeasureNumberSkyline(X){const ee=X.StaffLines[0];for(const ne of X.MeasureNumberLabels){let O=ne.PositionAndShape.RelativePosition.x,z=O-ne.PositionAndShape.BorderLeft+ne.PositionAndShape.BorderRight;O-=ee.PositionAndShape.RelativePosition.x,z-=ee.PositionAndShape.RelativePosition.x,ee.SkyBottomLineCalculator.updateSkyLineInRange(O,z,ne.PositionAndShape.RelativePosition.y+ne.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(X,ee,ne){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(X,ee){let ne=0,O=this.rules.StaffHeight;const z=new Map,K=[],q=X.SkyBottomLineCalculator;let de=X.Measures.length;for(let ce=0;ce0){K.push(De),ne=Math.max(ne,De.LyricsEntries.length);const ke=De.PositionAndShape.RelativePosition.x+we.x;let We=Number.MAX_VALUE,qe=Number.MIN_VALUE;for(let Je=0;Je0){const ce=X.PositionAndShape.Size.width;let pe=K[0].PositionAndShape.RelativePosition.x+K[0].PositionAndShape.BorderMarginLeft+K[0].parentMeasure.PositionAndShape.RelativePosition.x;pe=pe>ce?ce:pe,q.updateBottomLineInRange(pe,ce,ue)}return K}calculateLyricsExtendsAndDashes(X){for(let ee=0,ne=X.length;ee0||X.UnknownList.length>0){let ce="";for(let Qe=0,ke=X.EntriesList.length;Qe-50){let Qe=ue/10;Qe+=this.rules.PlaceWordsInsideStafflineYOffset,ze.PositionAndShape.RelativePosition.y=Qe}const De=new ge.GraphicalUnknownExpression(pe,ze,Me,(z=q[ne])===null||z===void 0?void 0:z.parentSourceMeasure,X);pe.AbstractExpressions.push(De)}}clearRecreatedObjects(){for(let X=0,ee=this.staffEntriesWithGraphicalTies.length;XX.length-1&&(U.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=X.length-1);const ee=[];for(let z=this.rules.MinMeasureToDrawIndex,K=X.length;z0){let ke=0;K.staffEntries[0].relInMeasureTimestamp.RealValue===0&&(ke=K.staffEntries[0].PositionAndShape.RelativePosition.x,K.MeasureNumber===1&&(ke+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1));let We=ke+(K.PositionAndShape.Size.width-K.endInstructionsWidth-ke)*(de.relInMeasureTimestamp.RealValue/K.parentSourceMeasure.Duration.RealValue)+ce.PositionAndShape.BorderMarginLeft;q&&(We=Math.max(We,q.PositionAndShape.RelativePosition.x+q.GraphicalLabel.PositionAndShape.Size.width+this.rules.ChordSymbolXSpacing)),ce.PositionAndShape.RelativePosition.x=We,ce.PositionAndShape.Parent=K.staffEntries[0].PositionAndShape.Parent}const pe=ce.PositionAndShape,we=pe.Parent;if(we.DataObject instanceof l.GraphicalMeasure&&de.relInMeasureTimestamp.RealValue===0&&(pe.RelativePosition.x=Math.max(K.beginInstructionsWidth,pe.RelativePosition.x),K.MeasureNumber===1&&pe.RelativePosition.x>3&&(pe.RelativePosition.x+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1)),de.PositionAndShape.RelativePosition.x===0){const ke=X.GraphicalMeasures[z];for(const We of ke){let qe=!1;for(const Ye of We.staffEntries)if(Ye.relInMeasureTimestamp===de.relInMeasureTimestamp&&Ye.PositionAndShape.RelativePosition.x!==0){pe.RelativePosition.x=Ye.PositionAndShape.RelativePosition.x,qe=!0;break}if(qe)break}}const Me=pe.BorderMarginLeft+we.AbsolutePosition.x+pe.RelativePosition.x,ze=pe.BorderMarginRight+we.AbsolutePosition.x+pe.RelativePosition.x;(!this.rules.ChordSymbolYAlignment||O>0)&&(O=ne.getSkyLineMinInRange(Me,ze));let De=0;ue===0?(De+=this.rules.ChordSymbolYOffset,De+=.1):De+=this.rules.ChordSymbolYPadding,De*=-1;const Qe=ce.GraphicalLabel;Qe.PositionAndShape.RelativePosition.y=O+De,Qe.setLabelPositionAndShapeBorders(),Qe.PositionAndShape.calculateBoundingBox(),ne.updateSkyLineInRange(Me,ze,O+Qe.PositionAndShape.BorderMarginTop),q=ce}}}}calculateAlignedChordSymbolsOffset(X,ee){let ne=Number.MAX_SAFE_INTEGER;for(const O of X)for(const z of O.graphicalChordContainers){const K=z.PositionAndShape,q=K.Parent;let de=K.BorderMarginLeft+q.AbsolutePosition.x,ue=K.BorderMarginRight+q.AbsolutePosition.x;q.DataObject instanceof l.GraphicalMeasure&&(de+=q.DataObject.beginInstructionsWidth,ue+=q.DataObject.beginInstructionsWidth),ne=Math.min(ne,ee.getSkyLineMinInRange(de,ue))}return ne}layoutMeasureWithWholeRest(X,ee,ne){}layoutBeams(X){}layoutArticulationMarks(X,ee,ne){}layoutOrnament(X,ee,ne){}calculateRestNotePlacementWithinGraphicalBeam(X,ee,ne,O,z){}calculateTupletNumbers(){if(!this.rules.TupletNumberLimitConsecutiveRepetitions)return;let X,ee,ne,O=-1,z=0;const K={};for(const q of this.graphicalMusicSheet.ParentMusicSheet.Instruments)for(const de of q.Voices){z=0,K[de.VoiceId]={};for(const ue of de.VoiceEntries)if(ue.Notes.length>0){const ce=ue.Notes[0];if(!ce.NoteTuplet||ce.NoteTuplet.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed)){O=-1,z=0,ee=void 0,X=void 0;continue}if(ce.NoteTuplet===ne)continue;let pe=ce.TypeLength;if(pe||(U.default.warn("note missing TypeLength"),pe=ce.NoteTuplet.Fractions[0]),ce.NoteTuplet!==ee&&K[de.VoiceId][ce.NoteTuplet.TupletLabelNumber]&&K[de.VoiceId][ce.NoteTuplet.TupletLabelNumber][pe.RealValue]){ce.NoteTuplet.RenderTupletNumber=!1,ne=ce.NoteTuplet;continue}ce.NoteTuplet.TupletLabelNumber===O&&pe.Equals(X)&&!ce.NoteTuplet.Bracket||(O=ce.NoteTuplet.TupletLabelNumber,X=pe,z=0),ee=ce.NoteTuplet,z++,z<=this.rules.TupletNumberMaxConsecutiveRepetitions&&(ce.NoteTuplet.RenderTupletNumber=!0),z>this.rules.TupletNumberMaxConsecutiveRepetitions&&(ce.NoteTuplet.RenderTupletNumber=!1,this.rules.TupletNumberAlwaysDisableAfterFirstMax&&(K[de.VoiceId][O]||(K[de.VoiceId][O]={}),K[de.VoiceId][O][pe.RealValue]=!0)),ne=ee}}}calculateSlurs(){}calculateGlissandi(){}calculateDynamicExpressionsForMultiExpression(X,ee,ne){}calculateGraphicalVerbalContinuousDynamic(X,ee){const ne=X.Label,O=ee.x+ne.PositionAndShape.BorderMarginLeft,z=ee.x+ne.PositionAndShape.BorderMarginRight,K=X.ContinuousDynamic.Placement,q=X.ParentStaffLine.SkyBottomLineCalculator;let de;K===H.PlacementEnum.Below?(de=q.getBottomLineMaxInRange(O,z),ne.PositionAndShape.RelativePosition=new y.PointF2D(ee.x,de-ne.PositionAndShape.BorderMarginTop)):(de=q.getSkyLineMinInRange(O,z),ne.PositionAndShape.RelativePosition=new y.PointF2D(ee.x,de-ne.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(X,ee){var ne;const O=X.IsSoftAccent,z=X.ParentStaffLine.ParentStaff.idInMusicSheet,K=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,z);if(!K)return void U.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");X.EndMeasure=K;const q=X.ParentStaffLine,de=K.ParentStaffLine,ue=de&&q===de;let ce=!1;de?ce=de==null?void 0:de.isPartOfMultiStaffInstrument():q&&(ce=q==null?void 0:q.isPartOfMultiStaffInstrument());const pe=g.Fraction.createFromFraction(X.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),we=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(pe),Me=we.getFirstNonNullStaffEntry().parentMeasure,ze=Me.PositionAndShape.AbsolutePosition.x+Me.PositionAndShape.BorderRight;let De=new g.Fraction(0,0,0);for(const tn of we.StaffEntries){const Ht=(ne=tn==null?void 0:tn.sourceStaffEntry)===null||ne===void 0?void 0:ne.calculateMaxNoteLength(!1);Ht!=null&&Ht.gt(De)&&(De=Ht)}const Qe=!O&&X.ContinuousDynamic.DynamicType===re.ContDynamicEnum.diminuendo,ke=this.getRelativePositionInStaffLineFromTimestamp(pe,z,de,ce,0,Qe),We=g.Fraction.plus(pe,De),qe=this.getRelativePositionInStaffLineFromTimestamp(We,z,de,ce,0,X.ContinuousDynamic.DynamicType===re.ContDynamicEnum.diminuendo),Ye=this.rules.SoftAccentWedgePadding,Je=we.getFirstNonNullStaffEntry().PositionAndShape.Size.width,it=this.rules.SoftAccentSizeFactor;O?(ee.x-=Je/2*it+Ye,ke.x=ee.x+Je/2*it):qe.x>ke.x&&qe.xot){const An=vt.StaffLines[tn].PositionAndShape.RelativePosition.y-q.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;At=this.rules.StaffHeight+An/2}else At=this.rules.WedgePlacementBelowY;At-=this.rules.WedgeOpeningLength/2,ue||(On=At);let Ht=Et.getBottomLineMaxInRange(Nt,li);Ht>At&&(At=Ht);const Vn=!1;if(otthis.rules.StaffHeight?Hn-this.rules.WedgeVerticalMargin:this.rules.StaffHeight+this.rules.WedgeOpeningLength,X.NotToBeRemoved=!0}}ue||(Ht=de.SkyBottomLineCalculator.getBottomLineMaxInRange(qt,$n),Ht>On&&(On=Ht),On+=this.rules.WedgeOpeningLength/2,On+=this.rules.WedgeVerticalMargin),At+=this.rules.WedgeOpeningLength/2,At+=this.rules.WedgeVerticalMargin}else if(ct===H.PlacementEnum.Above){if(q.ParentStaff.ParentInstrument.Staves.length===1)At=this.rules.WedgePlacementAboveY;else{let Ht=0;ot>0&&(Ht=ot-1);const Vn=vt.StaffLines[Ht];At=-(q.PositionAndShape.RelativePosition.y-Vn.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}At+=this.rules.WedgeOpeningLength/2,ue||(On=At);let tn=Et.getSkyLineMinInRange(Nt,li);if(tn1&&ot>0){const Ht=q.findClosestStaffEntry(Nt),Vn=q.findClosestStaffEntry(li);Ht&&Vn&&Ht.parentVerticalContainer}ue||(tn=de.SkyBottomLineCalculator.getSkyLineMinInRange(qt,$n),tnAn&&(An=jn),An+=this.rules.WedgeOpeningLength/2,An+=this.rules.WedgeVerticalMargin}else if(ct===H.PlacementEnum.Above){const jn=Vn.SkyBottomLineCalculator.getSkyLineMinInRange(qt,$n);jn-pe/2?-pe/2:ue-X.PositionAndShape.BorderMarginBottom}else de=ue-X.PositionAndShape.BorderMarginBottom;X.PositionAndShape.RelativePosition=new y.PointF2D(ee.x,de)}else if(X.Placement===H.PlacementEnum.Below){const ue=q.getBottomLineMaxInRange(z,K),ce=O.ParentStaff.ParentInstrument.Staves[O.ParentStaff.ParentInstrument.Staves.length-1];if(O.isPartOfMultiStaffInstrument()&&O.ParentStaff!==ce){const pe=O.ParentMusicSystem.StaffLines[O.ParentMusicSystem.StaffLines.indexOf(O)+1].PositionAndShape.RelativePosition.y-O.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;de=ue+X.PositionAndShape.BorderMarginBottomX.PositionAndShape.Size.width&&(ze=X.PositionAndShape.Size.width-this.rules.MeasureRightMargin,Me=ze-ce.PositionAndShape.MarginSize.width,ee.x=Me-ce.PositionAndShape.BorderMarginLeft);const De=X.SkyBottomLineCalculator;return we=z===H.PlacementEnum.Below?De.getBottomLineMaxInRange(Me,ze)+de:De.getSkyLineMinInRange(Me,ze)-de,ce.PositionAndShape.RelativePosition=new y.PointF2D(ee.x,we),z===H.PlacementEnum.Below?De.updateBottomLineInRange(Me,ze,ce.PositionAndShape.BorderMarginBottom+we):De.updateSkyLineInRange(Me,ze,ce.PositionAndShape.BorderMarginTop+we),ce}calculateTempoExpressionsForMultiTempoExpression(X,ee,ne){const O=g.Fraction.plus(X.AbsoluteTimestamp,ee.Timestamp),z=this.graphicalMusicSheet.MeasureList[ne];let K=new y.PointF2D;if(ee.ContinuousTempo||ee.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!z[0])return;let q=z[0].ParentStaffLine,de=z[0].PositionAndShape.RelativePosition.x,ue=0;for(let ce=0;ce0){q=z[ce].ParentStaffLine,de=z[ce].PositionAndShape.RelativePosition.x,ue=ce;break}if(K=this.getRelativePositionInStaffLineFromTimestamp(O,ue,q,q.isPartOfMultiStaffInstrument(),de),ee.EntriesList.length>0&&ee.EntriesList[0].Expression instanceof $.InstantaneousTempoExpression&&(ee.EntriesList[0].Expression.Placement=H.PlacementEnum.Above,q.Measures[0].staffEntries.length>0&&Math.abs(K.x-q.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)===0&&q.ParentMusicSystem===this.musicSystems[0])){const ce=q.Measures[0].FirstInstructionStaffEntry;if(ce){const pe=ce.GraphicalInstructions.last();K.x=pe.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(K.x=q.PositionAndShape.RelativePosition.x+q.Measures[0].PositionAndShape.RelativePosition.x)}for(const ce of ee.EntriesList){let pe=P.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(pe=P.TextAlignmentEnum.LeftBottom);const we=this.calculateLabel(q,K,ce.label,ee.getFontstyleOfFirstEntry(),ce.Expression.Placement,this.rules.UnknownTextHeight,pe,this.rules.TempoYSpacing);if(ce.Expression.ColorXML&&this.rules.ExpressionsUseXMLColor&&(we.ColorXML=ce.Expression.ColorXML),ce.Expression instanceof $.InstantaneousTempoExpression){for(const Me of q.AbstractExpressions)Me instanceof L.GraphicalInstantaneousTempoExpression&&(Me.SourceExpression.Label,ce.Expression.Label);if(new L.GraphicalInstantaneousTempoExpression(ce.Expression,we).ParentStaffLine||U.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&ce.Expression.Enum===$.TempoEnum.metronomeMark){this.createMetronomeMark(ce.Expression);continue}}else if(ce.Expression instanceof ie.ContinuousTempoExpression){for(const Me of q.AbstractExpressions)Me instanceof L.GraphicalInstantaneousTempoExpression&&(Me.SourceExpression.Label,ce.Expression.Label);q.AbstractExpressions.push(new L.GraphicalInstantaneousTempoExpression(ce.Expression,we))}}}}createMetronomeMark(X){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(X){}clearSystemsAndMeasures(){for(let X=0,ee=this.graphicalMusicSheet.MusicPages.length;X-1&&we.PositionAndShape.ChildElements.splice(Me,1),we.FirstInstructionStaffEntry=void 0,we.beginInstructionsWidth=0}if(we.LastInstructionStaffEntry){const Me=we.PositionAndShape.ChildElements.indexOf(we.LastInstructionStaffEntry.PositionAndShape);Me>-1&&we.PositionAndShape.ChildElements.splice(Me,1),we.LastInstructionStaffEntry=void 0,we.endInstructionsWidth=0}}ue.Measures=[],ue.PositionAndShape.ChildElements=[]}K.StaffLines.length=0,K.PositionAndShape.ChildElements=[]}ne.MusicSystems=[],ne.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(X,ee,ne,O,z,K,q,de,ue,ce=void 0,pe=void 0){X.StemDirectionXml!==E.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&X.StemDirectionXml!==void 0?X.WantedStemDirection=X.StemDirectionXml:this.calculateStemDirectionFromVoices(X);const we=ee.findOrCreateGraphicalVoiceEntry(X);we.octaveShiftValue=de;const Me=ee.tabStaffEntry;let ze;Me&&(ze=Me.findOrCreateGraphicalVoiceEntry(X));for(let De=0,Qe=X.Notes.length;De-1)continue;let We;if(X.IsGrace?We=ye.symbolFactory.createGraceNote(ke,we,z,this.rules,de):(We=ye.symbolFactory.createNote(ke,we,z,de,this.rules,void 0),ye.stafflineNoteCalculator.trackNote(We)),ke.Pitch&&this.checkNoteForAccidental(We,ne,z,de),this.resetYPositionForLeadSheet(We.PositionAndShape),ee.addGraphicalNoteToListAtCorrectYPosition(we,We),We.PositionAndShape.calculateBoundingBox(),this.leadSheet||(ke.NoteBeam!==void 0&&ke.PrintObject&&(ke instanceof Z.TabNote&&!this.rules.TabBeamsRendered||this.handleBeam(We,ke.NoteBeam,q)),ke.NoteTuplet!==void 0&&ke.PrintObject&&this.handleTuplet(We,ke.NoteTuplet,K)),ze){const qe=ye.symbolFactory.createNote(ke,ze,z,de,this.rules,void 0);Me.addGraphicalNoteToListAtCorrectYPosition(ze,qe),qe.PositionAndShape.calculateBoundingBox(),this.leadSheet||ke.NoteTuplet&&this.handleTuplet(qe,ke.NoteTuplet,K)}}return X.Articulations.length>0&&this.handleVoiceEntryArticulations(X.Articulations,X,ee),X.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(X.TechnicalInstructions,X,ee),X.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(X,ee,O),X.OrnamentContainer&&this.handleVoiceEntryOrnaments(X.OrnamentContainer,X,ee),de}resetYPositionForLeadSheet(X){this.leadSheet&&(X.RelativePosition=new y.PointF2D(X.RelativePosition.x,0))}layoutVoiceEntries(X,ee){if(X.PositionAndShape.RelativePosition=new y.PointF2D(0,0),!this.leadSheet)for(const ne of X.graphicalVoiceEntries){const O=ne.notes;if(O.length===0)continue;const z=O[0].sourceNote.ParentVoiceEntry,K=O[0].sourceNote.Pitch!==void 0;this.layoutVoiceEntry(z,O,X,K)}}maxInstrNameLabelLength(){var X;let ee=0;for(const ne of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if(!((X=ne.NameLabel)===null||X===void 0)&&X.print&&ne.Voices.length>0&&ne.Voices[0].Visible){let O=ne.NameLabel;this.rules.RenderPartNames||(O=new W.Label("",O.textAlignment,O.font));const z=new _.GraphicalLabel(O,this.rules.InstrumentLabelTextHeight,P.TextAlignmentEnum.LeftCenter,this.rules);z.setLabelPositionAndShapeBorders(),ee=Math.max(ee,z.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?ee:0}calculateSheetLabelBoundingBoxes(){const X=this.graphicalMusicSheet.ParentMusicSheet,ee=this.rules.DefaultColorTitle;if(X.Title!==void 0&&this.rules.RenderTitle){const ne=new _.GraphicalLabel(X.Title,this.rules.SheetTitleHeight,P.TextAlignmentEnum.CenterBottom,this.rules);ne.Label.IsCreditLabel=!0,ne.Label.colorDefault=ee,this.graphicalMusicSheet.Title=ne,ne.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(X.Subtitle!==void 0&&this.rules.RenderSubtitle){const ne=new _.GraphicalLabel(X.Subtitle,this.rules.SheetSubtitleHeight,P.TextAlignmentEnum.CenterCenter,this.rules);ne.Label.IsCreditLabel=!0,ne.Label.colorDefault=ee,this.graphicalMusicSheet.Subtitle=ne,ne.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(X.Composer!==void 0&&this.rules.RenderComposer){const ne=new _.GraphicalLabel(X.Composer,this.rules.SheetComposerHeight,P.TextAlignmentEnum.RightCenter,this.rules);ne.Label.IsCreditLabel=!0,ne.Label.colorDefault=ee,this.graphicalMusicSheet.Composer=ne,ne.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(X.Lyricist!==void 0&&this.rules.RenderLyricist){const ne=new _.GraphicalLabel(X.Lyricist,this.rules.SheetAuthorHeight,P.TextAlignmentEnum.LeftCenter,this.rules);ne.Label.IsCreditLabel=!0,ne.Label.colorDefault=ee,this.graphicalMusicSheet.Lyricist=ne,ne.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);if(X.Copyright!==void 0&&this.rules.RenderCopyright){const ne=new _.GraphicalLabel(X.Copyright,this.rules.SheetCopyrightHeight,P.TextAlignmentEnum.CenterBottom,this.rules);ne.Label.IsCreditLabel=!0,ne.Label.colorDefault=ee,this.graphicalMusicSheet.Copyright=ne,ne.setLabelPositionAndShapeBorders()}else this.rules.RenderCopyright||(this.graphicalMusicSheet.Copyright=void 0)}checkMeasuresForWholeRestNotes(){for(let X=0,ee=this.musicSystems.length;X0&&ce.graphicalVoiceEntries[0].notes.length===1){const pe=ce.graphicalVoiceEntries[0].notes[0];!pe.sourceNote.Pitch&&new g.Fraction(1,2).lt(pe.sourceNote.Length)&&this.layoutMeasureWithWholeRest(pe,ce,ue)}}}}}}optimizeRestNotePlacement(X,ee){if(X.graphicalVoiceEntries.length===0)return;const ne=X.graphicalVoiceEntries[0].notes;if(ne.length===0)return;const O=ne[0],z=O.sourceNote.isRest();if(X.graphicalVoiceEntries.length===2){let K=!1;const q=X.graphicalVoiceEntries[1].notes;q.length>0&&(K=q[0].sourceNote.isRest()),z&&K?this.calculateTwoRestNotesPlacementWithCollisionDetection(X):(z||K)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(X)}else if(z&&X!==ee.staffEntries[0]&&X!==ee.staffEntries[ee.staffEntries.length-1]){const K=ee.staffEntries.indexOf(X),q=ee.staffEntries[K-1],de=ee.staffEntries[K+1];if(q.graphicalVoiceEntries.length===1){const ue=q.graphicalVoiceEntries[0].notes[0];if(ue.sourceNote.NoteBeam!==void 0&&de.graphicalVoiceEntries.length===1){const ce=de.graphicalVoiceEntries[0].notes[0];ce.sourceNote.NoteBeam!==void 0&&ue.sourceNote.NoteBeam===ce.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(X,O,ue,de,ce),X.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(X,ee,ne,O,z=0,K=!1){let q,de,ue=new y.PointF2D;const ce=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,pe=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(X),we=Math.min(Math.floor(pe),ce-1),Me=Math.min(Math.ceil(pe),ce-1);if(we<0||ee<0)return ue;if(q=this.getFirstLeftNotNullStaffEntryFromContainer(we,ee,O),de=this.getFirstRightNotNullStaffEntryFromContainer(Me,ee,O),q&&de){let ze=q.parentMeasure.PositionAndShape.RelativePosition.x;z>0&&(ze=z);let De=q.PositionAndShape.RelativePosition.x+ze,Qe=de.PositionAndShape.RelativePosition.x+de.parentMeasure.PositionAndShape.RelativePosition.x;const ke=X.RealValue>de.getAbsoluteTimestamp().RealValue;z>0?Qe=de.PositionAndShape.RelativePosition.x+ze:K&&(q.getAbsoluteTimestamp().RealValue===X.RealValue||ke)&&(De=q.PositionAndShape.RelativePosition.x+q.PositionAndShape.BorderLeft+ze,Qe=De);let We=0;if(q!==de){const qe=q.getAbsoluteTimestamp(),Ye=de.getAbsoluteTimestamp();We=g.Fraction.minus(X,qe).RealValue/g.Fraction.minus(Ye,qe).RealValue}q.parentMeasure.ParentStaffLine!==de.parentMeasure.ParentStaffLine&&(q.parentMeasure.ParentStaffLine===ne?Qe=ne.PositionAndShape.Size.width:De=ne.PositionAndShape.RelativePosition.x),ue=new y.PointF2D(De+(Qe-De)*We,0)}return ue}getRelativeXPositionFromTimestamp(X){const ee=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,ne=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(X),O=Math.max(0,Math.min(Math.round(ne),ee-1)),z=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].getFirstNonNullStaffEntry();return z.PositionAndShape.RelativePosition.x+z.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(X){var ee,ne;this.rules.RenderSingleHorizontalStaffline&&(X.PositionAndShape.BorderRight=X.PositionAndShape.Size.width,X.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=X.PositionAndShape.Size.width);let O=10,z=-1;if(X.MusicSystems.length>0){const ce=X.MusicSystems[0];O=ce.PositionAndShape.RelativePosition.y+ce.PositionAndShape.BorderTop;const pe=X.MusicSystems[X.MusicSystems.length-1];z=pe.PositionAndShape.RelativePosition.y+pe.PositionAndShape.BorderBottom}if(this.graphicalMusicSheet.Title&&this.rules.RenderTitle){const ce=this.graphicalMusicSheet.Title;ce.PositionAndShape.Parent=X.PositionAndShape;const pe=new y.PointF2D;pe.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,pe.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,ce.PositionAndShape.RelativePosition=pe,X.Labels.push(ce)}if(this.graphicalMusicSheet.Subtitle&&this.rules.RenderTitle&&this.rules.RenderSubtitle){const ce=this.graphicalMusicSheet.Subtitle;ce.PositionAndShape.Parent=X.PositionAndShape;const pe=new y.PointF2D;pe.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,pe.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;const we=(ee=ce.TextLines)===null||ee===void 0?void 0:ee.length;we>1&&(pe.y+=ce.PositionAndShape.BorderBottom*(we-1)/we),ce.PositionAndShape.RelativePosition=pe,X.Labels.push(ce)}const K=this.graphicalMusicSheet.Composer;let q;if(K&&this.rules.RenderComposer){K.PositionAndShape.Parent=X.PositionAndShape,K.setLabelPositionAndShapeBorders();const ce=new y.PointF2D;ce.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,ce.y=O,ce.y-=this.rules.SystemComposerDistance;const pe=(ne=K.TextLines)===null||ne===void 0?void 0:ne.length;pe>1&&(ce.y-=K.PositionAndShape.BorderBottom*(pe-1)/pe),q=ce.y,K.PositionAndShape.RelativePosition=ce,X.Labels.push(K)}const de=this.graphicalMusicSheet.Lyricist;if(de&&this.rules.RenderLyricist){de.PositionAndShape.Parent=X.PositionAndShape,de.setLabelPositionAndShapeBorders();const ce=new y.PointF2D;ce.x=this.rules.PageLeftMargin,ce.y=O,ce.y+=de.PositionAndShape.BorderBottom,ce.y=Math.min(ce.y,q??Number.MAX_SAFE_INTEGER),de.PositionAndShape.RelativePosition=ce,X.Labels.push(de)}const ue=this.graphicalMusicSheet.Copyright;if(ue&&this.rules.RenderCopyright){ue.PositionAndShape.Parent=X.PositionAndShape,ue.setLabelPositionAndShapeBorders();const ce=new y.PointF2D;ce.x=X.PositionAndShape.Size.width/2,ce.y=z+this.rules.SheetCopyrightMargin,ce.y-=ue.PositionAndShape.BorderTop,ue.PositionAndShape.RelativePosition=ce,X.Labels.push(ue)}}createGraphicalTies(){for(let X=0;X=0&&this.staffEntriesWithGraphicalTies.push(de)}de=K}}setTieDirections(X){if(!X)return;const ee=X.ties;if(ee.length===1){const ne=ee[0];if(ne.TieDirection===H.PlacementEnum.NotYetDefined){const O=ne.Notes[0].ParentVoiceEntry.ParentVoice.VoiceId;O!==2&&O!==6||(ne.TieDirection=H.PlacementEnum.Below)}}if(ee.length>1){let ne;for(const O of ee){const z=O.Notes[0];(!ne||z.Pitch.getHalfTone()>ne.Pitch.getHalfTone())&&(ne=z)}for(const O of ee)O.TieDirection===H.PlacementEnum.NotYetDefined&&(O.Notes[0]===ne?O.TieDirection=H.PlacementEnum.Above:O.TieDirection=H.PlacementEnum.Below)}}createAccidentalCalculators(){const X=[],ee=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(ee)for(let ne=0;ne1)return;De=ye.symbolFactory.createGraphicalMeasure(X,ze)}if(De.hasError=X.getErrorInMeasure(de),X.FirstInstructionsStaffEntries[de])for(let ke=0,We=X.FirstInstructionsStaffEntries[de].Instructions.length;ke0){const it=We.Instructions[0];ye.symbolFactory.createInStaffClef(qe,it)}this.rules.RenderChordSymbols&&((Me=We.ChordContainers)===null||Me===void 0?void 0:Me.length)>0&&(We.ParentStaff.ParentInstrument.HasChordSymbols=!0,ye.symbolFactory.createChordSymbols(We,qe,O.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(O.doCalculationsAtEndOfMeasure(),X.LastInstructionsStaffEntries[de]){const ke=X.LastInstructionsStaffEntries[de];for(let We=0,qe=ke.Instructions.length;We=1&&De.staffEntries.length===0){const ke=new S.SourceStaffEntry(new G.VerticalSourceStaffEntryContainer(De.parentSourceMeasure,De.parentSourceMeasure.AbsoluteTimestamp,De.parentSourceMeasure.CompleteNumberOfStaves),ze);if(ze.Voices.length===0){const vt=new le.Voice(De.ParentStaff.ParentInstrument,-1);ze.Voices.push(vt)}const We=new E.VoiceEntry(new g.Fraction(0,1),ze.Voices[0],ke);let qe=X.Duration;qe.RealValue===0&&(qe=X.ActiveTimeSignature.clone());const Ye=new c.Note(We,ke,qe,void 0,X,!0);Ye.IsWholeMeasureRest=!0,Ye.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===ae.FillEmptyMeasuresWithWholeRests.YesVisible,We.Notes.push(Ye);const Je=ye.symbolFactory.createStaffEntry(ke,De);De.addGraphicalStaffEntry(Je),Je.relInMeasureTimestamp=We.Timestamp;const it=ye.symbolFactory.createVoiceEntry(We,Je);Je.graphicalVoiceEntries.push(it);const ht=ye.symbolFactory.createNote(Ye,it,new h.ClefInstruction,d.OctaveEnum.NONE,this.rules);ye.stafflineNoteCalculator.trackNote(ht),it.notes.push(ht)}De.hasOnlyRests=!0;for(const ke of De.staffEntries)if(De.hasOnlyRests=ke.hasOnlyRests(),!De.hasOnlyRests)break;return De}checkNoteForAccidental(X,ee,ne,O){let z=X.sourceNote.Pitch;const K=X.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();K!==0&&X.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==F.MidiInstrument.Percussion&&(z=X.Transpose(ee.ActiveKeyInstruction,ne,K,O),X.sourceNote.TransposedPitch=z),X.sourceNote.halfTone=z.getHalfTone(),ee.checkAccidental(X,z)}handleStaffEntries(X){for(let ee=0,ne=this.graphicalMusicSheet.MeasureList.length;ee0&&!this.rules.PercussionUseCajon2NoteSystem&&X[z]&&(this.rules.PercussionOneLineCutoff===-1||ye.stafflineNoteCalculator.getStafflineUniquePositionCount(z)0&&de.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(de,z),this.layoutStaffEntry(de));this.graphicalMeasureCreatedCalculations(q)}}}}calculateSkyBottomLines(){}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let X=0,ee=this.musicSystems.length;X0&&this.layoutArticulationMarks(De.Articulations,De,we)}}}}}}calculateOrnaments(){for(let X=0,ee=this.musicSystems.length;X0&&O.LyricVersesNumbers.sort()}for(let ee=0,ne=this.musicSystems.length;ee=0&&(O=ee.GraphicalLyricsEntries[ne+1]),!O)return;const z=X.StaffEntryParent.parentMeasure.ParentStaffLine,K=O.StaffEntryParent.parentMeasure.ParentStaffLine,q=X.StaffEntryParent,de=O.StaffEntryParent;if(X.StaffEntryParent.parentMeasure.ParentStaffLine===O.StaffEntryParent.parentMeasure.ParentStaffLine){const ue=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginRight-X.GraphicalLabel.CenteringXShift,ce=de.parentMeasure.PositionAndShape.RelativePosition.x+de.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.RelativePosition.x+O.GraphicalLabel.PositionAndShape.BorderMarginLeft,pe=X.GraphicalLabel.PositionAndShape.RelativePosition.y;let we=1;ce-ue>3*this.rules.MinimumDistanceBetweenDashes&&(we=Math.floor((ce-ue)/this.rules.MinimumDistanceBetweenDashes)-1),we===1?this.calculateSingleDashForLyricWord(z,ue,ce,pe):this.calculateDashes(z,ue,ce,pe)}else{const ue=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginRight,ce=z.Measures[z.Measures.length-1],pe=ce.PositionAndShape.RelativePosition.x+ce.PositionAndShape.Size.width;let we=X.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(z,ue,pe,we),K&&K.Measures[0]&&de.parentMeasure.ParentStaffLine&&(de!==de.parentMeasure.staffEntries[0]||de.parentMeasure!==de.parentMeasure.ParentStaffLine.Measures[0])){const Me=K.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,ze=de.parentMeasure.PositionAndShape.RelativePosition.x+de.PositionAndShape.RelativePosition.x+O.GraphicalLabel.PositionAndShape.BorderMarginLeft;we=O.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(K,Me,ze,we)}}}calculateDashes(X,ee,ne,O){let z=ne-ee;if(z<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(X,ee,ne,O);else{const K=Math.floor(z/this.rules.MinimumDistanceBetweenDashes)-1,q=z/(K+1);let de=0;for(ee+=q,ne-=q;de<=Math.floor(K/2)&&ne>ee;)z=this.calculateRightAndLeftDashesForLyricWord(X,ee,ne,O),ee+=q,ne-=q,de++;z>2*q&&this.calculateSingleDashForLyricWord(X,ee,ne,O)}}calculateSingleDashForLyricWord(X,ee,ne,O){const z=new W.Label("-");z.colorDefault=this.rules.DefaultColorLyrics;let K=this.rules.LyricsHeight;ne-ee<.8&&(K*=.8,O-=.1*K);const q=new _.GraphicalLabel(z,K,P.TextAlignmentEnum.CenterBottom,this.rules);q.setLabelPositionAndShapeBorders(),X.LyricsDashes.push(q),this.staffLinesWithLyricWords.indexOf(X)===-1&&this.staffLinesWithLyricWords.push(X),q.PositionAndShape.Parent=X.PositionAndShape;const de=new y.PointF2D(ee+(ne-ee)/2,O);q.PositionAndShape.RelativePosition=de}calculateLyricExtend(X){let ee=X.GraphicalLabel.PositionAndShape.RelativePosition.y;const ne=X.StaffEntryParent,O=ne.parentMeasure.ParentStaffLine;let z,K;const q=ne.parentMeasure.ParentStaff.idInMusicSheet;for(let de=ne.parentVerticalContainer.Index+1;de0)break;z=ue,K=z.parentMeasure.ParentStaffLine,K||(K=ne.parentMeasure.ParentStaffLine)}}if(z&&K)if(O===K&&z.parentMeasure.ParentStaffLine){const de=ne.parentMeasure.PositionAndShape.RelativePosition.x+ne.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginRight,ue=z.parentMeasure.PositionAndShape.RelativePosition.x+z.PositionAndShape.RelativePosition.x+z.PositionAndShape.BorderMarginRight;ee-=X.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(O,de,ue,ee)}else{const de=O.Measures[O.Measures.length-1].PositionAndShape,ue=ne.parentMeasure.PositionAndShape.RelativePosition.x+ne.PositionAndShape.RelativePosition.x+X.GraphicalLabel.PositionAndShape.BorderMarginRight,ce=de.RelativePosition.x+de.Size.width;if(ee-=X.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(O,ue,ce,ee),!z)return;if(z.parentMeasure.ParentStaffLine&&z.parentMeasure.staffEntries&&(z!==z.parentMeasure.staffEntries[0]||z.parentMeasure!==z.parentMeasure.ParentStaffLine.Measures[0])){const pe=K.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,we=z.parentMeasure.PositionAndShape.RelativePosition.x+z.PositionAndShape.RelativePosition.x+z.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(K,pe,we,ee)}}}calculateSingleLyricWordWithUnderscore(X,ee,ne,O){const z=new y.PointF2D(ee,O),K=new y.PointF2D(ne,O),q=new k.GraphicalLine(z,K,this.rules.LyricUnderscoreLineWidth);q.colorHex=this.rules.DefaultColorLyrics,X.LyricLines.push(q),this.staffLinesWithLyricWords.indexOf(X)===-1&&this.staffLinesWithLyricWords.push(X)}calculateRightAndLeftDashesForLyricWord(X,ee,ne,O){const z=new W.Label("-");z.colorDefault=this.rules.DefaultColorLyrics;const K=new _.GraphicalLabel(z,this.rules.LyricsHeight,P.TextAlignmentEnum.CenterBottom,this.rules);K.setLabelPositionAndShapeBorders(),X.LyricsDashes.push(K),this.staffLinesWithLyricWords.indexOf(X)===-1&&this.staffLinesWithLyricWords.push(X),K.PositionAndShape.Parent=X.PositionAndShape;const q=new y.PointF2D(ee,O);K.PositionAndShape.RelativePosition=q;const de=new W.Label("-"),ue=new _.GraphicalLabel(de,this.rules.LyricsHeight,P.TextAlignmentEnum.CenterBottom,this.rules);ue.setLabelPositionAndShapeBorders(),X.LyricsDashes.push(ue),ue.PositionAndShape.Parent=X.PositionAndShape;const ce=new y.PointF2D(ne,O);return ue.PositionAndShape.RelativePosition=ce,ue.PositionAndShape.RelativePosition.x-K.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const X=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let ee=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);ee<=X;ee++){const ne=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[ee];this.dynamicExpressionMap.clear();for(let O=0;O=0;O--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].StaffEntries[ee])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[O].StaffEntries[ee]}getFirstRightNotNullStaffEntryFromContainer(X,ee,ne){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[ee])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[X].StaffEntries[ee];for(let O=X+1;O0||ee.StaffLinkedExpressions[ne][O].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(ee.StaffLinkedExpressions[ne][O],X,ne)}}calculateStemDirectionFromVoices(X){if(X.ParentSourceStaffEntry.Link!==void 0)return X===X.ParentSourceStaffEntry.VoiceEntries[0]?void(X.WantedStemDirection=E.StemDirectionType.Up):void(X.WantedStemDirection=E.StemDirectionType.Down);X.ParentVoice instanceof M.LinkedVoice?X.WantedStemDirection=E.StemDirectionType.Down:X.ParentSourceStaffEntry.VoiceEntries.length>1&&(X.WantedStemDirection=E.StemDirectionType.Up)}setBeamNotesWantedStemDirections(X){if(!(X.Notes.length>0))return;const ee=X.Notes[0].NoteBeam;if(ee){for(const ne of ee.Notes)if(ne.ParentVoiceEntry.WantedStemDirection!==E.StemDirectionType.Undefined&&ne.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===X.ParentSourceStaffEntry.ParentStaff.Id){X.WantedStemDirection=ne.ParentVoiceEntry.WantedStemDirection;break}}}}o.MusicSheetCalculator=ye},1494:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSheetDrawer=void 0;const u=r(8911),a=r(8155),g=r(6729),c=r(3278),l=r(9086),h=r(9946),d=r(2255),E=r(1274),f=r(1703),y=r(7771),S=r(158),_=r(5074),P=r(9839),w=r(4196);o.MusicSheetDrawer=class{constructor(x,M){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=_.PhonicScoreModes.Manual,this.textMeasurer=x,this.splitScreenLineColor=-1,this.drawingParameters=M,this.rules=M.Rules}set Mode(x){this.phonicScoreMode=x}drawSheet(x){if(this.graphicalMusicSheet=x,this.rules=x.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const N of x.Cursors){if(!N)continue;const R=new u.BoundingBox(N);R.AbsolutePosition=N.Start,R.BorderBottom=N.End.y-N.Start.y,R.BorderRight=N.Width/2,R.BorderLeft=-N.Width/2,this.isVisible(R)&&this.drawLineAsVerticalRectangle(N,a.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const M=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let N=0;N0&&this.drawDashes(Y.LyricsDashes),Y.LyricLines.length>0&&this.drawLyricLines(Y.LyricLines,Y));for(const Y of x.SystemLines)this.drawSystemLineObject(Y);if(this.rules.RenderSystemLabelsAfterFirstPage||x.Parent===x.Parent.Parent.MusicPages[0])for(const Y of x.Labels)Y.SVGNode=this.drawLabel(Y,a.GraphicalLayers.Notes);const F=this.graphicalMusicSheet.ParentMusicSheet.Instruments,U=F.filter(Y=>Y.Visible).length;for(const Y of x.InstrumentBrackets)this.drawInstrumentBrace(Y,x);if(F.length>0)if(U>1)for(const Y of x.GroupBrackets)this.drawGroupBracket(Y,x);else for(const Y of x.GroupBrackets)Y.Visible=!1;if(!this.leadSheet)for(const Y of x.MeasureNumberLabels)Y.SVGNode=this.drawLabel(Y,a.GraphicalLayers.Notes);for(const Y of x.StaffLines)this.drawStaffLineSymbols(Y);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(x),this.drawingParameters.drawComments&&this.drawComment(x)}activateSystemRendering(x,M,N,R){return!0}drawSystemLineObject(x){}drawStaffLine(x){for(const M of x.Measures)this.drawMeasure(M);this.rules.RenderLyrics&&x.LyricsDashes.length>0&&this.drawDashes(x.LyricsDashes),this.drawOctaveShifts(x),this.drawPedals(x),this.drawExpressions(x),this.skyLineVisible&&this.drawSkyLine(x),this.bottomLineVisible&&this.drawBottomLine(x)}drawLyricLines(x,M){M.LyricLines.forEach(N=>{N.Start.y+=M.PositionAndShape.AbsolutePosition.y,N.End.y+=M.PositionAndShape.AbsolutePosition.y,N.Start.x+=M.PositionAndShape.AbsolutePosition.x,N.End.x+=M.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(N,this.rules.LyricUnderscoreLineWidth,N.colorHex)})}drawExpressions(x){}drawGraphicalLine(x,M,N="black"){return this.drawLine(x.Start,x.End,N,M)}drawLine(x,M,N="#FF0000FF",R){}drawDashes(x){x.forEach(M=>M.SVGNode=this.drawLabel(M,a.GraphicalLayers.Notes))}drawOctaveShifts(x){}drawStaffLines(x){if(x.StaffLines){const M=x.PositionAndShape.AbsolutePosition;for(let N=0;N<5;N++)this.drawLineAsHorizontalRectangleWithOffset(x.StaffLines[N],M,a.GraphicalLayers.Notes)}}drawInstantaneousDynamic(x){throw new Error("not implemented")}drawContinuousDynamic(x){throw new Error("not implemented")}drawSymbol(x,M,N,R=1,A=a.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(x){this.graphicalMusicSheet.LeadSheet=x}drawPage(x){if(this.isVisible(x.PositionAndShape)){for(const M of x.MusicSystems)this.isVisible(M.PositionAndShape)&&this.drawMusicSystem(M);if(x===x.Parent.MusicPages[0])for(const M of x.Labels)M.SVGNode=this.drawLabel(M,a.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(x.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(x,M=0,N="all"){const R=x.DataObject.constructor.name;let A=!1;N==="all"?A=!0:N==="VexFlowStaffEntry"?A=x.DataObject instanceof P.VexFlowStaffEntry:N==="VexFlowMeasure"?A=x.DataObject instanceof P.VexFlowMeasure:N==="VexFlowGraphicalNote"?A=x.DataObject instanceof P.VexFlowGraphicalNote:N==="VexFlowVoiceEntry"?A=x.DataObject instanceof P.VexFlowVoiceEntry:N==="GraphicalLabel"?A=x.DataObject instanceof h.GraphicalLabel:N==="VexFlowStaffLine"?A=x.DataObject instanceof P.VexFlowStaffLine:N==="SystemLine"?A=x.DataObject instanceof y.SystemLine:N==="StaffLineActivitySymbol"?A=x.DataObject instanceof w.StaffLineActivitySymbol:N==="VexFlowContinuousDynamicExpression"&&(A=x.DataObject instanceof P.VexFlowContinuousDynamicExpression),(A||R===N)&&this.drawBoundingBox(x,void 0,!0,R,M),M++,x.ChildElements.forEach(F=>this.drawBoundingBoxes(F,M,N))}drawBoundingBox(x,M=void 0,N=!1,R=void 0,A=0){let F=new c.RectangleF2D(x.AbsolutePosition.x+x.BorderMarginLeft,x.AbsolutePosition.y+x.BorderMarginTop,x.BorderMarginRight-x.BorderMarginLeft,x.BorderMarginBottom-x.BorderMarginTop);N&&(this.drawLineAsHorizontalRectangle(new g.GraphicalLine(new l.PointF2D(x.AbsolutePosition.x-1,x.AbsolutePosition.y),new l.PointF2D(x.AbsolutePosition.x+1,x.AbsolutePosition.y),.1,a.OutlineAndFillStyleEnum.BaseWritingColor,M),A-1),this.drawLineAsVerticalRectangle(new g.GraphicalLine(new l.PointF2D(x.AbsolutePosition.x,x.AbsolutePosition.y-1),new l.PointF2D(x.AbsolutePosition.x,x.AbsolutePosition.y+1),.1,a.OutlineAndFillStyleEnum.BaseWritingColor,M),A-1)),F=this.applyScreenTransformationForRect(F);const U=this.renderRectangle(F,a.GraphicalLayers.Background,A,M,.5);if(R){const Y=new d.Label(R);this.renderLabel(new h.GraphicalLabel(Y,.8,E.TextAlignmentEnum.CenterCenter,this.rules),A,F.width,F.height,F.height,new l.PointF2D(F.x,F.y+12))}return U}drawMarkedAreas(x){for(const M of x.GraphicalMarkedAreas)M&&(M.systemRectangle&&this.drawRectangle(M.systemRectangle,a.GraphicalLayers.Background),M.settings&&(M.settings.SVGNode=this.drawLabel(M.settings,a.GraphicalLayers.Comment)),M.labelRectangle&&this.drawRectangle(M.labelRectangle,a.GraphicalLayers.Background),M.label&&(M.label.SVGNode=this.drawLabel(M.label,a.GraphicalLayers.Comment)))}drawComment(x){for(const M of x.GraphicalComments)M&&(M.settings&&(M.settings.SVGNode=this.drawLabel(M.settings,a.GraphicalLayers.Comment)),M.label&&(M.label.SVGNode=this.drawLabel(M.label,a.GraphicalLayers.Comment)))}drawStaffLineSymbols(x){const M=x.ParentStaff.ParentInstrument,N=x.PositionAndShape.AbsolutePosition.x,R=x.PositionAndShape.AbsolutePosition.y+2,A=x.PositionAndShape.BorderRight;M.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new g.GraphicalLine(new l.PointF2D(N,R),new l.PointF2D(N+A,R),4,a.OutlineAndFillStyleEnum.Highlighted),a.GraphicalLayers.Highlight);let F=_.MusicSymbolDrawingStyle.Disabled,U=S.MusicSymbol.PLAY,Y=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case _.PhonicScoreModes.Midi:U=S.MusicSymbol.PLAY,this.midiPlaybackAvailable&&x.ParentStaff.audible&&(F=_.MusicSymbolDrawingStyle.PlaybackSymbols);break;case _.PhonicScoreModes.Following:U=S.MusicSymbol.MIC,x.ParentStaff.following&&(F=_.MusicSymbolDrawingStyle.FollowSymbols);break;default:Y=!1}if(Y){const k=new l.PointF2D(N+A+2,R);this.drawSymbol(U,F,k)}if(this.drawingParameters.drawErrors)for(const k of x.Measures){const W=k.PositionAndShape,G=W.AbsolutePosition.x,H=W.AbsolutePosition.y+2;k.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new g.GraphicalLine(new l.PointF2D(G,H),new l.PointF2D(G+W.BorderRight,H),4,a.OutlineAndFillStyleEnum.ErrorUnderlay),a.GraphicalLayers.MeasureError)}}}},158:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSymbol=void 0,(r=o.MusicSymbol||(o.MusicSymbol={}))[r.Unused_first_Symbol=0]="Unused_first_Symbol",r[r.BLACK_HEAD=1]="BLACK_HEAD",r[r.UPWARDS_TAIL=2]="UPWARDS_TAIL",r[r.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",r[r.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",r[r.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",r[r.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",r[r.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",r[r.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",r[r.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",r[r.ROUND_HEAD=10]="ROUND_HEAD",r[r.WHITE_HEAD=11]="WHITE_HEAD",r[r.G_CLEF=12]="G_CLEF",r[r.F_CLEF=13]="F_CLEF",r[r.C_CLEF=14]="C_CLEF",r[r.BREVE=15]="BREVE",r[r.BREVE_REST=16]="BREVE_REST",r[r.COMMON_TIME=17]="COMMON_TIME",r[r.CUT_TIME=18]="CUT_TIME",r[r.WHOLE_REST=19]="WHOLE_REST",r[r.HALF_REST=20]="HALF_REST",r[r.QUARTER_REST=21]="QUARTER_REST",r[r.EIGHTH_REST=22]="EIGHTH_REST",r[r.SIXTEENTH_REST=23]="SIXTEENTH_REST",r[r.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",r[r.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",r[r.FLAT=26]="FLAT",r[r.SHARP=27]="SHARP",r[r.NATURAL=28]="NATURAL",r[r.DOUBLE_FLAT=29]="DOUBLE_FLAT",r[r.DOUBLE_SHARP=30]="DOUBLE_SHARP",r[r.ZERO=31]="ZERO",r[r.ONE=32]="ONE",r[r.TWO=33]="TWO",r[r.THREE=34]="THREE",r[r.FOUR=35]="FOUR",r[r.FIVE=36]="FIVE",r[r.SIX=37]="SIX",r[r.SEVEN=38]="SEVEN",r[r.EIGHT=39]="EIGHT",r[r.NINE=40]="NINE",r[r.DOT=41]="DOT",r[r.FERMATA=42]="FERMATA",r[r.INVERTED_FERMATA=43]="INVERTED_FERMATA",r[r.SPICCATO=44]="SPICCATO",r[r.TENUTO=45]="TENUTO",r[r.MARCATO=46]="MARCATO",r[r.MARCATISSIMO=47]="MARCATISSIMO",r[r.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",r[r.P=49]="P",r[r.F=50]="F",r[r.S=51]="S",r[r.Z=52]="Z",r[r.M=53]="M",r[r.R=54]="R",r[r.SEGNO=55]="SEGNO",r[r.CODA=56]="CODA",r[r.DRUM_CLEF=57]="DRUM_CLEF",r[r.G_CLEF_SUB8=58]="G_CLEF_SUB8",r[r.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",r[r.G_CLEF_SUB15=60]="G_CLEF_SUB15",r[r.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",r[r.F_CLEF_SUB8=62]="F_CLEF_SUB8",r[r.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",r[r.F_CLEF_SUB15=64]="F_CLEF_SUB15",r[r.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",r[r.DOWN_BOW=66]="DOWN_BOW",r[r.MORDENT=67]="MORDENT",r[r.INVERTED_MORDENT=68]="INVERTED_MORDENT",r[r.TURN=69]="TURN",r[r.INVERTED_TURN=70]="INVERTED_TURN",r[r.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",r[r.RELEASE_PED=72]="RELEASE_PED",r[r.ENGAGE_PED=73]="ENGAGE_PED",r[r.VA8=74]="VA8",r[r.VB8=75]="VB8",r[r.TRILL=76]="TRILL",r[r.MA15=77]="MA15",r[r.MB15=78]="MB15",r[r.HIGH=79]="HIGH",r[r.PLAY=80]="PLAY",r[r.MIC=81]="MIC",r[r.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",r[r.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",r[r.EditPen=84]="EditPen",r[r.PEDAL_BRACKET=85]="PEDAL_BRACKET",r[r.PEDAL_MIXED=86]="PEDAL_MIXED",r[r.PEDAL_SYMBOL=87]="PEDAL_SYMBOL"},7142:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSystem=void 0;const u=r(6842),a=r(8911),g=r(1797),c=r(1274),l=r(9946),h=r(4785),d=r(9086),E=r(6894),f=r(1649),y=r(1225),S=r(2255);class _ extends h.GraphicalObject{constructor(w){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new f.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=w,this.boundingBox=new a.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(w){if(this.parent){const x=this.parent.MusicSystems.indexOf(this,0);x>-1&&this.parent.MusicSystems.splice(x,1)}this.parent=w,this.boundingBox.Parent=w.PositionAndShape}get NextSystem(){const w=this.Parent.MusicSystems.indexOf(this);return w!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[w+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get GraphicalComments(){return this.graphicalComments}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(w,x,M){let N=-w/2;M&&(N=this.maxLabelLength+x-w/2);const R=this.staffLines[0].Measures[0];let A;this.staffLines.length>1&&(A=this.staffLines[this.staffLines.length-1].Measures[0]);const F=this.createSystemLine(N,w,E.SystemLinesEnum.SingleThin,y.SystemLinePosition.MeasureBegin,this,R,A);this.SystemLines.push(F),F.PositionAndShape.RelativePosition=new d.PointF2D(N,0),F.PositionAndShape.BorderLeft=0,F.PositionAndShape.BorderRight=w,F.PositionAndShape.BorderTop=F.PositionAndShape.Parent.BorderTop,F.PositionAndShape.BorderBottom=F.PositionAndShape.Parent.BorderBottom,this.createLinesForSystemLine(F)}createVerticalLineForMeasure(w,x,M,N,R,A){const F=A.ParentStaffLine,U=new d.PointF2D(F.PositionAndShape.RelativePosition.x,F.PositionAndShape.RelativePosition.y),Y=F.ParentStaff.ParentInstrument.Staves;if(F.ParentStaff===Y[0]){let k;Y.length>1&&(k=this.getBottomStaffLine(F).Measures[R]);const W=this.createSystemLine(w,x,M,N,this,A,k),G=U.x+w;W.PositionAndShape.RelativePosition=new d.PointF2D(G,0),W.PositionAndShape.BorderLeft=0,W.PositionAndShape.BorderRight=x,this.SystemLines.push(W)}}setYPositionsToVerticalLineObjectsAndCreateLines(w){}calculateBorders(w){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(w){for(let x=0,M=w.length;x1){let A,F;for(let U=0,Y=this.staffLines.length;Uthis.maxLabelLength&&(this.maxLabelLength=k.PositionAndShape.Size.width,x=A)}this.updateMusicSystemStaffLineXPosition(x)}setMusicSystemLabelsYPosition(){this.labels.forEach((w,x)=>{let M=0,N=0;for(let R=0;R0&&(x.PositionAndShape.RelativePosition=new d.PointF2D(0,M/N+2))})}checkStaffEntriesForStaffEntryLink(){let w=!1,x=!1;for(let M=0;M=0;M--){if(x=w.InstrumentalGroups[M],!(x instanceof u.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(x);if(x.Visible===!0)return x}}updateMusicSystemStaffLineXPosition(w){for(let x=0,M=this.StaffLines.length;x{Object.defineProperty(o,"__esModule",{value:!0}),o.MeasureBuildParameters=o.SystemBuildParameters=o.MusicSystemBuilder=void 0;const u=r(599),a=r(3331),g=r(5198),c=r(289),l=r(9086),h=r(6729),d=r(6894),E=r(4040),f=r(289),y=r(2337),S=r(1225);o.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(P,w,x){this.leadSheet=P.LeadSheet,this.graphicalMusicSheet=P,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=w,this.numberOfVisibleStaffLines=x,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){var P,w,x;const M=this.getFullPageSystemWidth();let N=!1;for(this.measureListIndex=0,this.currentSystemParams=new _,this.currentSystemParams.currentSystem=this.initMusicSystem();this.measureListIndex0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const P of this.musicSystems)this.optimizeDistanceBetweenStaffLines(P);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(P,w,x,M){for(let N=0,R=P.length;N0&&(A.beginInstructionsWidth=x),M>0&&(A.endInstructionsWidth=M)}}finalizeCurrentAndCreateNewSystem(P,w=!1,x=!0,M=!1){this.finalizeCurrentSystem(P,w,x,M),this.currentSystemParams=new _,P!==void 0&&this.measureListIndex=1){const w=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let x=0;const M=P[P.length-1];M.endLine===d.SystemLinesEnum.DotsBoldBoldDots&&(M.endLine=d.SystemLinesEnum.DotsThinBold,x=w[0].getLineWidth(d.SystemLinesEnum.DotsBoldBoldDots)/2-w[0].getLineWidth(d.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=x;for(let N=0,R=w.length;N1){R=!0;break}}let A=0;for(let F=0;F=0&&this.measureList[L]){const $=(R=this.measureList[L][0])===null||R===void 0?void 0:R.parentSourceMeasure;$!=null&&$.ImplicitMeasure&&($!=null&&$.RhythmPrinted)&&(H=!1)}H&&(w.addRhythmAtBegin(U),w.parentSourceMeasure.RhythmPrinted=U,G=!0)}return(k||W||G)&&(Y+=w.beginInstructionsWidth,G&&(Y+=this.rules.RhythmRightMargin)),Y}addInstructionsAtMeasureEnd(P,w,x){if(!P||!P.Instructions||P.Instructions.length===0)return 0;for(let M=0,N=P.Instructions.length;M0&&(this.currentSystemParams.systemMeasures.push({beginLine:d.SystemLinesEnum.None,endLine:d.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=M,this.currentSystemParams.currentSystemFixWidth+=M)}addExtraInstructionMeasure(P,w,x){const M=this.currentSystemParams.currentSystem,N=E.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(M.StaffLines[P]);w&&N.addKeyAtBegin(w,this.activeKeys[P],this.activeClefs[P]),x!==void 0&&x.PrintObject&&N.addRhythmAtBegin(x),N.PositionAndShape.BorderLeft=0,N.PositionAndShape.BorderTop=0,N.PositionAndShape.BorderBottom=this.rules.StaffHeight;const R=this.rules.MeasureLeftMargin+N.beginInstructionsWidth+this.rules.MeasureRightMargin;return N.PositionAndShape.BorderRight=R,M.StaffLines[P].Measures.push(N),R}addStaveMeasuresToSystem(P){if(P[0]){const w=[];for(let M=0;M1){const w=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,P.measureListIndex+P.multipleRestMeasures-1);P=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[w]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?d.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?d.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?d.SystemLinesEnum.DoubleThin:P&&P.endingBarStyleEnum!==void 0?P.endingBarStyleEnum:d.SystemLinesEnum.SingleThin}getLineWidth(P,w,x){let M=P.getLineWidth(w);return w===d.SystemLinesEnum.DotsBoldBoldDots&&(M/=2),x&&w===d.SystemLinesEnum.BoldThinDots&&(M+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),M}previousMeasureEndsLineRepetition(){if(this.measureListIndex===0)return!1;for(let P=0,w=this.measureList[this.measureListIndex-1].length;P=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[P])return!1;for(let w=0,x=this.measureList[P].length;w=F))break;R=Y,F=Y.multipleRestMeasureNumber}return R.endsWithLineRepetition()}}return!1}nextMeasureBeginsWordRepetition(){const P=this.measureListIndex+1;if(P>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||P>this.measureList.length-1)return!1;for(let w=0,x=this.measureList[P].length;wthis.rules.PageHeight-this.rules.PageBottomMargin&&(M++,M<=4&&console.log(`warning: could not fit a single system on page ${P.PageNumber} and measure number ${x.GraphicalMeasures[0][0].MeasureNumber}. + The PageFormat may be too small for this sheet." + Will not give further warnings for all pages, only total.`))}else{const R=this.musicSystems[N-1],A=R.StaffLines[R.StaffLines.length-1],F=A.PositionAndShape;let U=this.findRequiredDistanceWithSkyBottomLine(R,x);U+=this.rules.MinSkyBottomDistBetweenSystems,U=Math.max(U,this.rules.MinimumDistanceBetweenSystems+A.StaffHeight);const Y=w+F.RelativePosition.y+U,k=Y+x.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&R.breaksPage||!(k0&&console.log(`total amount of pages that couldn't fit a single music system: ${M} of ${P.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(P,w){const x=P.StaffLines[P.StaffLines.length-1],M=w.StaffLines[0],N=x.BottomLine,R=M.SkyLine,A=x.PositionAndShape,F=M.PositionAndShape,U=1/this.rules.SamplingUnit;let Y=0;for(let k=0;k=R.length)break;const H=Math.max(0,G-6),L=Math.min(R.length-1,G+6);let $=0;for(let re=H;re<=L;re++)$=Math.min($,R[re]);const ie=W-$;Y=Math.max(ie,Y)}return Y===0&&(Y=A.BorderBottom-F.BorderTop),Y}};class _{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return this.systemMeasureIndex===0}}o.SystemBuildParameters=_,o.MeasureBuildParameters=class{}},4574:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OctaveShiftParams=void 0,o.OctaveShiftParams=class{constructor(r,u,a){this.getOpenOctaveShift=r,this.getAbsoluteStartTimestamp=u,this.getAbsoluteEndTimestamp=a}}},9059:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PlainSkyBottomLineBatchCalculatorBackend=void 0;const u=r(1378),a=r(9531);class g extends a.SkyBottomLineBatchCalculatorBackend{constructor(l,h){super(l,h)}getPreferredRenderingConfiguration(l,h){return{elementWidth:Math.ceil(l),numColumns:6,numRows:6}}onInitialize(l){}calculateFromCanvas(l,h,d,E,f){const y=l.width,S=h.getImageData(0,0,l.width,l.height),{elementWidth:_,elementHeight:P,numColumns:w}=f,x=[];for(let M=0;M0){W[$-F]=ie-Y;break}}G[$-F]=P;for(let ie=k-1;ie>=Y;ie--){const re=ie*y*4+4*$;if(S.data[re+3]>0){G[$-F]=ie-Y;break}}}const H=Math.max(...W),L=Math.min(...G);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionEndSymbol=void 0;const u=r(4785),a=r(8155),g=r(9086),c=r(8911),l=r(6729),h=r(2337);class d extends u.GraphicalObject{constructor(f,y){super();const S=y,_=f.PositionAndShape.AbsolutePosition.y,P=h.CollectionUtil.last(f.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new l.GraphicalLine(new g.PointF2D(S,_),new g.PointF2D(S,_+P),.4,a.OutlineAndFillStyleEnum.SelectionSymbol);for(let w=0,x=f.StaffLines.length;w{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionStartSymbol=void 0;const u=r(9086),a=r(8155),g=r(6729),c=r(4785),l=r(8911),h=r(2337);class d extends c.GraphicalObject{constructor(f,y){super();const S=y,_=f.PositionAndShape.AbsolutePosition.y,P=h.CollectionUtil.last(f.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new g.GraphicalLine(new u.PointF2D(S,_),new u.PointF2D(S,_+P),.4,a.OutlineAndFillStyleEnum.SelectionSymbol);for(let w=0,x=f.StaffLines.length;w{if(f.has(S))return f.get(S);{const _=[];return f.set(S,_),_}})().push({skyBottomLineCalculator:y.SkyBottomLineCalculator,measures:y.Measures})}this.batches=new Map;for(const[y,S]of f.entries()){const _=h.CollectionUtil.flat(S.map(w=>w.measures)),P=(()=>{if(E===a.SkyBottomLineBatchCalculatorBackendType.Plain)return new g.PlainSkyBottomLineBatchCalculatorBackend(y,_).initialize();try{return new c.WebGLSkyBottomLineBatchCalculatorBackend(y,_).initialize()}catch{return l.default.info("Couldn't create WebGLBackend for Skyline. Using fallback."),new g.PlainSkyBottomLineBatchCalculatorBackend(y,_).initialize()}})();P.initialize(),this.batches.set(y,{backend:P,entries:S})}}calculateLines(){for(const[,{backend:d,entries:E}]of this.batches){const f=d.calculateLines();let y=0;for(const{skyBottomLineCalculator:S,measures:_}of E){const P=y+_.length;S.updateLines(f.slice(y,P)),y=P}}}}},9531:function(b,o,r){var u=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(o,"__esModule",{value:!0}),o.SkyBottomLineBatchCalculatorBackend=void 0;const a=r(4028),g=u(r(2043));o.SkyBottomLineBatchCalculatorBackend=class{constructor(c,l){this.elementHeight=300,this.canvas=new a.CanvasVexFlowBackend(c),this.measures=l,this.maxWidth=Math.max(...this.measures.map(h=>{let d=h.getVFStave().getWidth();return d>0||h.IsExtraGraphicalMeasure||(g.default.warn("SkyBottomLineBatchCalculatorBackend: width not > 0 in measure "+h.MeasureNumber),d=50),d})),this.samplingUnit=c.SamplingUnit}initialize(){if(this.tableConfiguration=Object.assign(Object.assign({},this.getPreferredRenderingConfiguration(this.maxWidth,this.elementHeight)),{elementHeight:this.elementHeight}),this.tableConfiguration.numRows<1||this.tableConfiguration.numColumns<1)throw g.default.warn("SkyBottomLineBatchCalculatorBackend: numRows or numColumns in tableConfiguration is 0"),new Error("numRows or numColumns in tableConfiguration is 0");this.tableConfiguration.elementWidth0||N.IsExtraGraphicalMeasure||(U=50),U=Math.floor(U),N.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),R.setX(0);const k=R.y+100;R.setY(k);const W=R.getWidth();R.setWidth(U),N.format(),R.setWidth(W);try{y.translate(A*h,F*d),N.draw(f),y.translate(-A*h,-F*d)}catch(G){g.default.warn("SkyBottomLineBatchCalculatorBackend.calculateLines.draw",G)}}const x=this.calculateFromCanvas(S,f,w,this.samplingUnit,this.tableConfiguration);_.push(...x)}return _}}},1378:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SkyBottomLineCalculationResult=void 0,o.SkyBottomLineCalculationResult=class{constructor(r,u){this.skyLine=r,this.bottomLine=u}}},6040:function(b,o,r){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.SkyBottomLineCalculator=void 0,r(9086);const a=r(5820),g=u(r(2043)),c=r(1378),l=r(4028);o.SkyBottomLineCalculator=class{constructor(h){this.mStaffLineParent=h,this.mRules=h.ParentMusicSystem.rules}updateLines(h){const d=this.StaffLineParent.Measures;if(h.length!==d.length)if(g.default.warn("SkyBottomLineCalculator: lengths of calculation result array and measure array do not match"),h.length(w-_)/a.unitInPixels+this.StaffLineParent.TopLineOffset);const P=Math.min(...this.mBottomLine);this.mBottomLine=this.mBottomLine.map(w=>(w-P)/a.unitInPixels+this.StaffLineParent.BottomLineOffset)}calculateLines(){const h=this.mRules.SamplingUnit,d=[],E=new l.CanvasVexFlowBackend(this.mRules);for(const f of this.StaffLineParent.Measures){f.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const y=f.getVFStave();let S=y.getWidth();S>0||f.IsExtraGraphicalMeasure||(g.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+f.MeasureNumber),S=50),E.initializeHeadless(S);const _=E.getContext(),P=E.getCanvas();S=P.width;const w=P.height;y.setY(y.y+100);const x=y.getWidth();y.setWidth(S),f.format(),y.setWidth(x);try{f.draw(_)}catch(U){g.default.warn("SkyBottomLineCalculator.calculateLines.draw",U)}const M=_.getImageData(0,0,S,w),N=4,R=Math.max(Math.ceil(f.PositionAndShape.Size.width*h),1),A=new Array(R),F=new Array(R);for(let U=0;U0){A[U]=Y;break}}for(let Y=w;Y>0;Y--){const k=Y*S*N+U*N;if(M.data[k+3]>0){F[U]=Y;break}}}for(let U=0;U=this.BottomLine.length&&(E=this.BottomLine.length-1),f<0&&(f=0),f>=this.BottomLine.length&&(f=this.BottomLine.length),this.SkyLine[E]=h.y;for(let S=E+1;S=this.BottomLine.length&&(E=this.BottomLine.length-1),f<0&&(f=0),f>=this.BottomLine.length&&(f=this.BottomLine.length),this.BottomLine[E]=h.y;for(let S=E+1;Sh)}setBottomLineWithValue(h){this.BottomLine.forEach(d=>h)}getLeftIndexForPointX(h,d){const E=Math.floor(h*this.SamplingUnit);return E<0?0:E>=d?d-1:E}getRightIndexForPointX(h,d){const E=Math.ceil(h*this.SamplingUnit);return E<0?0:E>=d?d-1:E}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter(h=>!isNaN(h)))}getSkyLineMinAtPoint(h){const d=Math.round(h*this.SamplingUnit);return this.mSkyLine[d]}getSkyLineMinInRange(h,d){return this.getMinInRange(this.SkyLine,h,d)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(h=>!isNaN(h)))}getBottomLineMaxAtPoint(h){const d=Math.round(h*this.SamplingUnit);return this.mBottomLine[d]}getBottomLineMaxInRange(h,d){return this.getMaxInRange(this.BottomLine,h,d)}getBottomLineMaxInBoundingBox(h){const d=Math.floor(h.AbsolutePosition.x+h.BorderLeft),E=Math.ceil(h.AbsolutePosition.x+h.BorderRight);return this.getMaxInRange(this.mBottomLine,d,E)}updateWithBoundingBoxRecursively(h){if(h.ChildElements&&h.ChildElements.length>0)this.updateWithBoundingBoxRecursively(h);else{const d=h.BorderTop+h.AbsolutePosition.y,E=h.BorderBottom+h.AbsolutePosition.y;if(d<0){const f=Math.floor(h.AbsolutePosition.x+h.BorderLeft),y=Math.ceil(h.AbsolutePosition.x+h.BorderRight);this.updateInRange(this.mSkyLine,f,y,d)}else if(E>this.StaffLineParent.StaffHeight){const f=Math.floor(h.AbsolutePosition.x+h.BorderLeft),y=Math.ceil(h.AbsolutePosition.x+h.BorderRight);this.updateInRange(this.mBottomLine,f,y,E)}}}findPreviousValidNumber(h,d){for(let E=h;E>=0;E--)if(!isNaN(d[E]))return d[E];return 0}findNextValidNumber(h,d){if(h>=d.length)return d[h-1];for(let E=h;Eh.length&&(E=h.length);for(let y=d;yMath.abs(h[y])?f:h[y]}setInRange(h,d=0,E=h.length,f=0){if(d=Math.floor(d*this.SamplingUnit),(E=Math.ceil(E*this.SamplingUnit))h.length&&(E=h.length);for(let y=d;y=h.length&&(d=h.length-1),E<0&&(E=0),E>=h.length&&(E=h.length),d>=0&&E<=h.length?Math.min(...h.slice(d,E+1)):void 0):Number.MAX_VALUE}getMaxInRange(h,d,E){return d=Math.floor(d*this.SamplingUnit),E=Math.ceil(E*this.SamplingUnit),h?(d<0&&(d=0),d>=h.length&&(d=h.length-1),E<0&&(E=0),E>=h.length&&(E=h.length),d>=0&&E<=h.length?Math.max(...h.slice(d,E+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},9953:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StaffLine=void 0;const u=r(8911),a=r(4785),g=r(4196),c=r(9086),l=r(6040);class h extends a.GraphicalObject{constructor(E,f){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.graphicalGlissandi=[],this.Pedals=[],this.parentMusicSystem=E,this.parentStaff=f,this.boundingBox=new u.BoundingBox(this,E.PositionAndShape),this.skyBottomLine=new l.SkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)this.ParentStaff.StafflineCount===5?this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(E){this.measures=E}get StaffLines(){return this.staffLines}set StaffLines(E){this.staffLines=E}get NextStaffLine(){const E=this.parentMusicSystem.StaffLines.indexOf(this);return E!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[E+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(E){this.abstractExpressions=E}set LyricLines(E){this.lyricLines=E}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(E){this.lyricsDashes=E}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(E){this.parentMusicSystem=E}get ParentStaff(){return this.parentStaff}set ParentStaff(E){this.parentStaff=E}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(E){this.octaveShifts=E}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}get GraphicalGlissandi(){return this.graphicalGlissandi}addSlurToStaffline(E){this.graphicalSlurs.push(E)}addGlissandoToStaffline(E){this.graphicalGlissandi.push(E),E.StaffLine=this}addActivitySymbolClickArea(){const E=new g.StaffLineActivitySymbol(this),f=this.PositionAndShape;E.PositionAndShape.RelativePosition=new c.PointF2D(f.RelativePosition.x+f.BorderRight+.5,f.RelativePosition.y+.5),E.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(E){let f;for(let y=0,S=this.Measures.length;y{Object.defineProperty(o,"__esModule",{value:!0}),o.StaffLineActivitySymbol=void 0;const u=r(4785),a=r(8911);class g extends u.GraphicalObject{constructor(l){super(),this.parentStaffLine=l;const h=l.PositionAndShape;this.boundingBox=new a.BoundingBox(this,h),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}o.StaffLineActivitySymbol=g},7771:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SystemLine=void 0;const u=r(6894),a=r(8911),g=r(4785);class c extends g.GraphicalObject{constructor(h,d,E,f,y=void 0){super(),this.lineType=h,this.linePosition=d,this.parentMusicSystem=E,this.topMeasure=f,this.bottomMeasure=y,this.parentTopStaffLine=f==null?void 0:f.ParentStaffLine,this.boundingBox=new a.BoundingBox(this,E.PositionAndShape)}static getObjectWidthForLineType(h,d){switch(d){case u.SystemLinesEnum.SingleThin:return h.SystemThinLineWidth;case u.SystemLinesEnum.DoubleThin:return 2*h.SystemThinLineWidth+h.DistanceBetweenVerticalSystemLines;case u.SystemLinesEnum.ThinBold:return h.SystemThinLineWidth+h.SystemBoldLineWidth+h.DistanceBetweenVerticalSystemLines;case u.SystemLinesEnum.BoldThinDots:case u.SystemLinesEnum.DotsThinBold:return h.SystemThinLineWidth+h.SystemBoldLineWidth+h.DistanceBetweenVerticalSystemLines+h.SystemDotWidth+h.DistanceBetweenDotAndLine;case u.SystemLinesEnum.DotsBoldBoldDots:return 2*h.SystemBoldLineWidth+2*h.SystemDotWidth+2*h.DistanceBetweenDotAndLine+h.DistanceBetweenVerticalSystemLines;default:return 0}}}o.SystemLine=c},1225:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.SystemLinePosition=void 0,(r=o.SystemLinePosition||(o.SystemLinePosition={}))[r.MeasureBegin=0]="MeasureBegin",r[r.MeasureEnd=1]="MeasureEnd"},6894:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.SystemLinesEnumHelper=o.SystemLinesEnum=void 0,function(u){u[u.SingleThin=0]="SingleThin",u[u.DoubleThin=1]="DoubleThin",u[u.ThinBold=2]="ThinBold",u[u.BoldThinDots=3]="BoldThinDots",u[u.DotsThinBold=4]="DotsThinBold",u[u.DotsBoldBoldDots=5]="DotsBoldBoldDots",u[u.None=6]="None",u[u.Dotted=7]="Dotted",u[u.Dashed=8]="Dashed",u[u.Bold=9]="Bold",u[u.BoldThin=10]="BoldThin",u[u.DoubleBold=11]="DoubleBold",u[u.Tick=12]="Tick",u[u.Short=13]="Short"}(r=o.SystemLinesEnum||(o.SystemLinesEnum={})),o.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(u){return u==="regular"?r.SingleThin:u==="dotted"?r.Dotted:u==="dashed"?r.Dashed:u==="heavy"?r.Bold:u==="light-light"?r.DoubleThin:u==="light-heavy"?r.ThinBold:u==="heavy-light"?r.BoldThin:u==="heavy-heavy"?r.DoubleBold:u==="tick"?r.Tick:u==="short"?r.Short:u==="none"?r.None:r.SingleThin}}},525:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VerticalGraphicalStaffEntryContainer=void 0,o.VerticalGraphicalStaffEntryContainer=class{constructor(r,u){this.staffEntries=[],this.absoluteTimestamp=u,this.staffEntries=new Array(r)}get Index(){return this.index}set Index(r){this.index=r}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(r){this.staffEntries=r}static compareByTimestamp(r,u){const a=r.absoluteTimestamp.RealValue,g=u.absoluteTimestamp.RealValue;return ag?1:0}getFirstNonNullStaffEntry(){for(let r=0,u=this.staffEntries.length;r{Object.defineProperty(o,"__esModule",{value:!0}),o.AlignmentManager=void 0;const u=r(9344),a=r(9086);o.AlignmentManager=class{constructor(g){this.parentStaffline=g,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var g,c;const l=[];let h=new Array;for(let d=0;d0){const E=d.map(y=>y.PositionAndShape.Center.y),f=Math.max(...E);for(let y=0;y0?d[y-1]:void 0;if(P){const x=this.getOverlap(S.PositionAndShape,P.PositionAndShape);S.squeeze(-(x.x+this.rules.DynamicExpressionSpacer))}if(w){const x=this.getOverlap(w.PositionAndShape,S.PositionAndShape);S.squeeze(x.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(g,c){const l=g.RelativePosition.x+g.BorderMarginRight,h=c.RelativePosition.x+c.BorderMarginLeft,d=g.RelativePosition.y+g.BorderMarginBottom,E=c.RelativePosition.y+c.BorderMarginTop;return new a.PointF2D(h-l,E-d)}getOverlap(g,c){return new a.PointF2D(g.RelativePosition.x+g.BorderMarginRight-(c.RelativePosition.x+c.BorderMarginLeft),g.RelativePosition.y+g.BorderMarginBottom-(c.RelativePosition.y+c.BorderMarginTop))}}},4028:function(b,o,r){var u=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(o,"__esModule",{value:!0}),o.CanvasVexFlowBackend=void 0;var a=u(r(6368)).default.Flow;const g=r(709),c=r(8129),l=r(41),h=r(599);class d extends g.VexFlowBackend{constructor(f){super(),this.rules=f}getVexflowBackendType(){return a.Renderer.Backends.CANVAS}getOSMDBackendType(){return l.BackendType.Canvas}getCanvasSize(){var f;return(f=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))===null||f===void 0?void 0:f.offsetHeight}initialize(f,y){this.zoom=y,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new h.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),f.appendChild(this.inner),this.renderer=new a.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(f=300,y=300){this.graphicalMusicPage||(this.graphicalMusicPage=new h.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=f,this.canvas.height=y,this.renderer=new a.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}free(){this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas,this.canvas=null)}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(f){this.ctx.scale(f,f)}translate(f,y){this.CanvasRenderingCtx.translate(f,y)}renderText(f,y,S,_,P,w,x=void 0,M=void 0){const N=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=c.VexFlowConverter.font(f,y,S,this.rules,M),this.CanvasRenderingCtx.fillStyle=x,this.CanvasRenderingCtx.strokeStyle=x,this.CanvasRenderingCtx.fillText(_,w.x,w.y+P),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=N}renderRectangle(f,y,S,_=1){const P=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=S||c.VexFlowConverter.style(y),this.CanvasRenderingCtx.globalAlpha=_,this.ctx.fillRect(f.x,f.y,f.width,f.height),this.CanvasRenderingCtx.fillStyle=P,this.CanvasRenderingCtx.globalAlpha=1}renderLine(f,y,S="#FF0000FF",_=2,P){const w=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=S,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(f.x,f.y),this.CanvasRenderingCtx.lineTo(y.x,y.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=w}renderCurve(f){this.ctx.beginPath(),this.ctx.moveTo(f[0].x,f[0].y),this.ctx.bezierCurveTo(f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y),this.ctx.lineTo(f[7].x,f[7].y),this.ctx.bezierCurveTo(f[6].x,f[6].y,f[5].x,f[5].y,f[4].x,f[4].y),this.ctx.lineTo(f[0].x,f[0].y),this.ctx.closePath(),this.ctx.fill()}renderPath(f,y=!0,S){let _;this.ctx.beginPath();for(const P of f)_?this.ctx.lineTo(P.x,P.y):(this.ctx.moveTo(P.x,P.y),_=P);this.ctx.closePath(),y?this.ctx.fill():this.ctx.stroke()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}o.CanvasVexFlowBackend=d},9505:function(b,o,r){var u=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(o,"__esModule",{value:!0}),o.SvgVexFlowBackend=void 0;var a=u(r(6368)).default.Flow;const g=r(709),c=r(8129),l=r(2562),h=r(41),d=u(r(2043));class E extends g.VexFlowBackend{constructor(y){super(),this.rules=y}getVexflowBackendType(){return a.Renderer.Backends.SVG}getOSMDBackendType(){return h.BackendType.SVG}getCanvasSize(){var y;return(y=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))===null||y===void 0?void 0:y.offsetHeight}initialize(y,S){this.zoom=S,this.canvas=document.createElement("div"),this.canvas.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",y.appendChild(this.inner),this.renderer=new a.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id="osmdSvgPage"+this.graphicalMusicPage.PageNumber}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(y){var S;const _=(S=this.ctx)===null||S===void 0?void 0:S.svg;if(!_)return!1;try{_.removeChild(y)}catch(P){return d.default.error(P),!1}return!0}free(){const y=this.ctx.svg;for(;y.lastChild;)y.removeChild(y.lastChild)}clear(){this.ctx&&(this.free(),this.rules.PageBackgroundColor&&(this.ctx.svg.style["background-color"]=this.rules.PageBackgroundColor))}scale(y){this.ctx.scale(y,y)}translate(y,S){}renderText(y,S,_,P,w,x,M=void 0,N=void 0){this.ctx.save();const R=this.ctx.openGroup("text");M&&(this.ctx.attributes.fill=M,this.ctx.attributes.stroke=M);let A=N;N&&N!=="default"||(A=this.rules.DefaultFontFamily),this.ctx.setFont(A,y,c.VexFlowConverter.fontStyle(S)),this.ctx.attributes["font-size"]=`${y}px`,this.ctx.state["font-size"]=`${y}px`;let F="normal",U="normal";switch(S){case l.FontStyles.Bold:F="bold";break;case l.FontStyles.Italic:U="italic";break;case l.FontStyles.BoldItalic:F="bold",U="italic";break;default:F="normal"}return this.ctx.attributes["font-weight"]=F,this.ctx.state["font-weight"]=F,this.ctx.attributes["font-style"]=U,this.ctx.state["font-style"]=U,this.ctx.fillText(P,x.x,x.y+w),this.ctx.closeGroup(),this.ctx.restore(),R}renderRectangle(y,S,_,P=1){this.ctx.save();const w=this.ctx.openGroup("rect");return this.ctx.attributes.fill=_||c.VexFlowConverter.style(S),this.ctx.attributes["fill-opacity"]=P,this.ctx.fillRect(y.x,y.y,y.width,y.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),w}renderLine(y,S,_="#FF0000FF",P=2,w){this.ctx.save();const x=this.ctx.openGroup("line",w);return this.ctx.beginPath(),this.ctx.moveTo(y.x,y.y),this.ctx.lineTo(S.x,S.y),this.ctx.attributes.stroke=_,this.ctx.lineWidth=P,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),x}renderCurve(y){const S=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(y[0].x,y[0].y),this.ctx.bezierCurveTo(y[1].x,y[1].y,y[2].x,y[2].y,y[3].x,y[3].y),this.ctx.lineTo(y[7].x,y[7].y),this.ctx.bezierCurveTo(y[6].x,y[6].y,y[5].x,y[5].y,y[4].x,y[4].y),this.ctx.lineTo(y[0].x,y[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),S}renderPath(y,S=!0,_){const P=this.ctx.openGroup("path",_);let w;this.ctx.beginPath();for(const x of y)w?this.ctx.lineTo(x.x,x.y):(this.ctx.moveTo(x.x,x.y),w=x);return this.ctx.closePath(),S?this.ctx.fill():this.ctx.stroke(),this.ctx.stroke(),this.ctx.closeGroup(),P}export(){const y=this.ctx.svg.cloneNode(!0),S=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),_=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",S);_.replaceChild(y,_.documentElement);const P=new XMLSerializer().serializeToString(_),w=document.createElement("a");w.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(P.replace(/> +\r<`)),w.download="opensheetmusicdisplay_download.svg",w.innerHTML=window.location.href+"/download",document.body.appendChild(w)}}o.SvgVexFlowBackend=E},709:function(b,o,r){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowBackend=o.VexFlowBackends=void 0;var a=u(r(6368)).default.Flow;o.VexFlowBackends=class{},o.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let g=this.canvas;return this.getVexflowBackendType()===a.Renderer.Backends.CANVAS&&(g=this.inner),g}getRenderer(){return this.renderer}removeAllChildrenFromContainer(g){for(;g.children.length!==0;)g.removeChild(g.children.item(0))}removeFromContainer(g){const c=this.getRenderElement();for(let l=0;l{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowContinuousDynamicExpression=void 0;const u=r(374),a=r(9946),g=r(2255),c=r(1274),l=r(2562);class h extends u.GraphicalContinuousDynamicExpression{constructor(E,f,y,S){if(super(E,f,y),this.IsVerbal){const _=new g.Label(E.Label);this.label=new a.GraphicalLabel(_,S||this.rules.ContinuousDynamicTextHeight,c.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=l.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}}}o.VexFlowContinuousDynamicExpression=h},8129:function(b,o,r){var u=this&&this.__importDefault||function(W){return W&&W.__esModule?W:{default:W}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowConverter=void 0;var a=u(r(6368)).default.Flow;const g=r(289),c=r(8640),l=r(1797),h=r(3331),d=r(5198),E=r(8640),f=r(8640),y=r(6894),S=r(2562),_=r(96),P=r(8155),w=u(r(2043)),x=r(908),M=r(1225),N=r(5922),R=r(766),A=r(5820),F=r(3029),U=r(2953),Y=r(3748);class k{static durations(G,H){const L=[],$=G.clone();for(;$.RealValue>0;){const ie=$.RealValue;if(ie>=2)L.push("1/2"),$.Sub(new l.Fraction(2,1));else if(ie>=1)L.push("w"),$.Sub(new l.Fraction(1,1));else if(ie<1&&ie>=.5){if(H&&ie>.5)return["w"];L.push("h"),$.Sub(new l.Fraction(1,2))}else if(ie<.5&&ie>=.25){if(H&&ie>.25)return["h"];L.push("q"),$.Sub(new l.Fraction(1,4))}else if(ie<.25&&ie>=.125){if(H&&ie>.125)return["q"];L.push("8"),$.Sub(new l.Fraction(1,8))}else if(ie<.125&&ie>=.0625){if(H&&ie>.0625)return["8"];L.push("16"),$.Sub(new l.Fraction(1,16))}else if(ie<.0625&&ie>=.03125){if(H&&ie>.03125)return["16"];L.push("32"),$.Sub(new l.Fraction(1,32))}else if(ie<.03125&&ie>=.015625){if(H&&ie>.015625)return["32"];L.push("64"),$.Sub(new l.Fraction(1,64))}else{if(H)return["64"];L.push("128"),$.Sub(new l.Fraction(1,128))}}return L}static pitch(G,H,L,$=void 0,ie=void 0){let re=ie;ie===void 0&&(re=3),H&&ie===void 0&&(re=0,L.ClefType===g.ClefEnum.F&&(re=2),L.ClefType===g.ClefEnum.C&&(re=2));const be=f.NoteEnum[G.FundamentalNote].toLowerCase(),ae=c.Pitch.accidentalVexflow(G.Accidental),ge=G.Octave-L.OctaveOffset+re;let le="";return $&&(le=this.NoteHeadCode($)),[be+"n/"+ge+le,ae,L]}static restToNotePitch(G,H){let L=G.Octave;switch(H){case g.ClefEnum.C:case g.ClefEnum.F:L+=2;case g.ClefEnum.G:}return new c.Pitch(G.FundamentalNote,L,E.AccidentalEnum.NONE)}static NoteHeadCode(G){const H=G.Filled?"2":"1";switch(G.Shape){case R.NoteHeadShape.NORMAL:return"";case R.NoteHeadShape.DIAMOND:return"/D"+H;case R.NoteHeadShape.TRIANGLE:return"/T"+H;case R.NoteHeadShape.TRIANGLE_INVERTED:return"/TI";case R.NoteHeadShape.X:return"/X"+H;case R.NoteHeadShape.CIRCLEX:return"/X3";case R.NoteHeadShape.RECTANGLE:return"/R"+H;case R.NoteHeadShape.SQUARE:return"/S"+H;case R.NoteHeadShape.SLASH:default:return""}}static GhostNotes(G){const H=[],L=k.durations(G,!1);for(const $ of L)H.push(new a.GhostNote({duration:$}));return H}static StaveNote(G){var H,L,$,ie,re,be,ae,ge,le,Z;G.sortForVexflow();const ye=G.notes,Se=G.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,X=ye[0];let ee=[];const ne=[],O=X.graphicalNoteLength,z=X.sourceNote.NoteTuplet!==void 0;let K,q=k.durations(O,z)[0];X.sourceNote.TypeLength!==void 0&&X.sourceNote.TypeLength!==O&&X.sourceNote.TypeLength.RealValue!==0&&(q=k.durations(X.sourceNote.TypeLength,z)[0],X.numberOfDots=X.sourceNote.DotsXml);let de,ue,ce=X.numberOfDots,pe=!1,we=0,Me=!1;for(const ke of ye){if(ce=1&&Ye.length-1>=ht+1&&(Je=(re=(ie=Ye[ht-1])===null||ie===void 0?void 0:ie.graphicalVoiceEntries[0])===null||re===void 0?void 0:re.parentVoiceEntry,it=(ae=(be=Ye[ht+1])===null||be===void 0?void 0:be.graphicalVoiceEntries[0])===null||ae===void 0?void 0:ae.parentVoiceEntry,Je&&it)){const vt=Je.Notes[0],ot=it.Notes[0];if(!((ge=vt.NoteBeam)===null||ge===void 0)&&ge.Notes.includes(ot)){const Et=Je.Notes.last().Pitch,ct=ke.Clef();ee=[k.pitch(k.restToNotePitch(Et.getTransposedPitch(-2),ct.ClefType),!1,ct)[0]]}}}}if((ke.sourceNote.IsWholeMeasureRest||O.RealValue===ke.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue)&&(ee=["d/5"],G.parentStaffEntry.parentMeasure.ParentStaff.StafflineCount===1&&(ee=["b/4"]),q="w",ce=0,pe=!0,we=Se.WholeRestXShiftVexflow*A.unitInPixels),ke.sourceNote.ParentStaff.Voices.length>1){const qe=ke.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,Ye=ke.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let Je,it;for(const ht of qe)for(const vt of ht.notes){if(vt===ke||vt.sourceNote.isRest()||!vt.sourceNote.PrintObject)continue;const ot=vt.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,Et=Ye===1||Ye===5,ct=Et?1:-1,_t=vt.sourceNote.Pitch.getHalfTone();(!Je||ct===1&&_t>Je||ct===-1&&_t0){let ht=3;const vt=ke.Clef();switch(vt.ClefType){case g.ClefEnum.F:ht=5;break;case g.ClefEnum.C:ht=4}de=c.Pitch.fromHalftone(Je),ee=[k.pitch(de,!0,vt,void 0,ht)[0]]}}break}const We=ke.vfpitch;ee.push(We[0]),ne.push(We[1]),K||(K=k.Clef(We[2]).type)}for(let ke=0,We=ce;ke0&&Se.RenderLyrics&&Se.LyricsUseXPaddingForLongLyrics){const Ye=G.parentStaffEntry.parentMeasure,Je=[];for(let vt=Ye.staffEntries.indexOf(G.parentStaffEntry)+1;vt.25){We=!1;break}if(vt.LyricsEntries.length>0)break;qe+=32*l.Fraction.minus(ot,ht).RealValue,ht=ot}}if(Se.RenderLyrics&&Se.LyricsUseXPaddingForLongLyrics&&ke.length>0&&We){let Ye=!1,Je=0;for(const ht of ye)if(ht.sourceNote.Length.RealValue<=.125){Ye=!0;break}let it=!1;for(const ht of ke){const vt=Se.LyricsXPaddingWidthThreshold;let ot=ht.GraphicalLabel.PositionAndShape.Size.width;if(ht.hasDashFromLyricWord()&&(ot+=.5),ot>vt){Je+=ot-vt;const Et=G.parentStaffEntry,ct=Et.parentMeasure.staffEntries,_t=ct.indexOf(Et)===ct.length-1;_t&&(qe+=Se.LyricsXPaddingReductionForLastNoteInMeasure),Ye||(qe+=Se.LyricsXPaddingReductionForLongNotes),!Se.LyricsXPaddingForLastNoteInMeasure&&_t||ot>vt+qe&&(it=!0,Je-=qe);break}}it&&(ue.paddingRight=10*Se.LyricsXPaddingFactorForLongLyrics*Je)}}const Qe=G.notes[0].lineShift;if(Qe!==0&&(ue.getKeyProps()[0].line+=Qe),ye.length>1)for(let ke=0;keG.notes[We].staffLine=ke),(Se.LedgerLineWidth||Se.LedgerLineStrokeStyle)&&(ue.ledgerLineStyle||(ue.ledgerLineStyle={}),Se.LedgerLineWidth&&(ue.ledgerLineStyle.lineWidth=Se.LedgerLineWidth),Se.LedgerLineStrokeStyle&&(ue.ledgerLineStyle.strokeStyle=Se.LedgerLineStrokeStyle)),Se.ColoringEnabled){const ke=Se.DefaultColorStem;let We=G.parentVoiceEntry.StemColor;!We&&ke&&(We=ke);const qe={fillStyle:We,strokeStyle:We};We&&(ue.setStemStyle(qe),ue.flag&&Se.ColorFlags&&ue.setFlagStyle(qe))}if(ue.x_shift=we,G.parentVoiceEntry.IsGrace&&G.notes[0].sourceNote.NoteBeam&&(G.parentVoiceEntry.WantedStemDirection=G.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),G.parentVoiceEntry)switch(G.parentVoiceEntry.WantedStemDirection){case x.StemDirectionType.Up:ue.setStemDirection(a.Stem.UP),G.parentVoiceEntry.StemDirection=x.StemDirectionType.Up;break;case x.StemDirectionType.Down:ue.setStemDirection(a.Stem.DOWN),G.parentVoiceEntry.StemDirection=x.StemDirectionType.Down}for(let ke=0,We=ye.length;ke0){const Ye=new a.Tremolo(qe);Ye.extra_stroke_scale=Se.TremoloStrokeScale,Ye.y_spacing_scale=Se.TremoloYSpacingScale,ue.addModifier(ke,Ye)}}if(De.Length.RealValue===.25&&De.Notehead&&De.Notehead.Filled===!1){const ke=ue.getKeyProps();for(let We=0;We");const ae=H.sourceNote.NoteSlurs;for(const ge of ae)ge.StartNote===H.sourceNote&&(ge.PlacementXml===Y.PlacementEnum.Above?ie.setYShift(10*-L.SlurStartArticulationYOffsetOfArticulation):ge.PlacementXml===Y.PlacementEnum.Below&&ie.setYShift(10*L.SlurStartArticulationYOffsetOfArticulation));break}case x.ArticulationEnum.breathmark:ie=new a.Articulation("abr"),$.placement===Y.PlacementEnum.Above&&(re=a.Modifier.Position.ABOVE),ie.breathMarkDistance=L.BreathMarkDistance;break;case x.ArticulationEnum.downbow:ie=new a.Articulation("am"),$.placement===void 0&&(re=a.Modifier.Position.ABOVE,$.placement=Y.PlacementEnum.Above);break;case x.ArticulationEnum.fermata:ie=new a.Articulation("a@a"),re=a.Modifier.Position.ABOVE,$.placement=Y.PlacementEnum.Above;break;case x.ArticulationEnum.marcatodown:ie=new a.Articulation("a|");break;case x.ArticulationEnum.marcatoup:ie=new a.Articulation("a^"),re=a.Modifier.Position.ABOVE;break;case x.ArticulationEnum.invertedfermata:{const ae=H.sourceNote.ParentVoiceEntry;if(ae!==H.sourceNote.ParentVoiceEntry.ParentSourceStaffEntry.VoiceEntries.last()){ae.Articulations=ae.Articulations.slice(ae.Articulations.indexOf($)),ae.ParentSourceStaffEntry.VoiceEntries.last().Articulations.push($);continue}ie=new a.Articulation("a@u"),re=a.Modifier.Position.BELOW,$.placement=Y.PlacementEnum.Below;break}case x.ArticulationEnum.lefthandpizzicato:ie=new a.Articulation("a+");break;case x.ArticulationEnum.naturalharmonic:ie=new a.Articulation("ah");break;case x.ArticulationEnum.snappizzicato:ie=new a.Articulation("ao");break;case x.ArticulationEnum.staccatissimo:ie=new a.Articulation("av");break;case x.ArticulationEnum.staccato:ie=new a.Articulation("a.");break;case x.ArticulationEnum.tenuto:ie=new a.Articulation("a-");break;case x.ArticulationEnum.upbow:ie=new a.Articulation("a|"),$.placement===void 0&&(re=a.Modifier.Position.ABOVE,$.placement=Y.PlacementEnum.Above);break;case x.ArticulationEnum.strongaccent:ie=new a.Articulation("a^")}ie&&(ie.setPosition(re),G.addModifier(0,ie))}}static generateOrnaments(G,H){let L,$=a.Modifier.Position.ABOVE;switch(H.placement===Y.PlacementEnum.Below&&($=a.Modifier.Position.BELOW),H.GetOrnament){case N.OrnamentEnum.DelayedInvertedTurn:L=new a.Ornament("turn_inverted"),L.setDelayed(!0);break;case N.OrnamentEnum.DelayedTurn:L=new a.Ornament("turn"),L.setDelayed(!0);break;case N.OrnamentEnum.InvertedMordent:L=new a.Ornament("mordent"),L.setDelayed(!1);break;case N.OrnamentEnum.InvertedTurn:L=new a.Ornament("turn_inverted"),L.setDelayed(!1);break;case N.OrnamentEnum.Mordent:L=new a.Ornament("mordent_inverted"),L.setDelayed(!1);break;case N.OrnamentEnum.Trill:L=new a.Ornament("tr"),L.setDelayed(!1);break;case N.OrnamentEnum.Turn:L=new a.Ornament("turn"),L.setDelayed(!1);break;default:return void w.default.warn("unhandled OrnamentEnum type: "+H.GetOrnament)}L&&(H.AccidentalBelow!==E.AccidentalEnum.NONE&&L.setLowerAccidental(c.Pitch.accidentalVexflow(H.AccidentalBelow)),H.AccidentalAbove!==E.AccidentalEnum.NONE&&L.setUpperAccidental(c.Pitch.accidentalVexflow(H.AccidentalAbove)),L.setPosition($),G.addModifier(0,L))}static StrokeTypeFromArpeggioType(G){switch(G){case F.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return a.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case F.ArpeggioType.BRUSH_DOWN:return a.Stroke.Type.BRUSH_UP;case F.ArpeggioType.BRUSH_UP:return a.Stroke.Type.BRUSH_DOWN;case F.ArpeggioType.RASQUEDO_DOWN:return a.Stroke.Type.RASQUEDO_UP;case F.ArpeggioType.RASQUEDO_UP:return a.Stroke.Type.RASQUEDO_DOWN;case F.ArpeggioType.ROLL_DOWN:return a.Stroke.Type.ROLL_UP;case F.ArpeggioType.ROLL_UP:return a.Stroke.Type.ROLL_DOWN;default:return a.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(G){const H=[],L=G.notes.reverse(),$=[],ie=G.notes[0].graphicalNoteLength,re=G.notes[0].sourceNote.NoteTuplet!==void 0;let be=k.durations(ie,re)[0],ae=0,ge=!1;for(const Z of G.notes){const ye=Z.sourceNote;let Se={str:ye.StringNumberTab,fret:ye.FretNumber};Z.sourceNote instanceof U.TabNote||(w.default.info(`invalid tab note: ${Z.sourceNote.Pitch.ToString()} in measure ${G.parentStaffEntry.parentMeasure.MeasureNumber}, likely missing XML string+fret number.`),Se={str:1,fret:0}),H.push(Se),ye.BendArray&&ye.BendArray.forEach(function(X){let ee;const ne=X.bendalter-Se.fret;ee=ne>1?"Full":ne===1?"1/2":"1/4",X.direction==="up"?$.push({type:a.Bend.UP,text:ee,width:10}):$.push({type:a.Bend.DOWN,text:ee,width:10})}),ye.VibratoStroke&&(ge=!0),ae{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowGlissando=void 0;const u=r(1443);class a extends u.GraphicalGlissando{}o.VexFlowGlissando=a},4679:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowGraphicalNote=void 0;const u=r(3486),a=r(8129),g=r(5853);class c extends u.GraphicalNote{constructor(h,d,E,f=g.OctaveEnum.NONE,y,S=void 0){if(super(h,d,y,S),this.clef=E,this.octaveShift=f,h.Pitch){const _=h.isRest()?h.Pitch:g.OctaveShift.getPitchFromOctaveShift(h.Pitch,f);this.vfpitch=a.VexFlowConverter.pitch(_,h.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(h){const d=this.drawPitch(h);this.vfpitch=a.VexFlowConverter.pitch(d,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=d.Accidental}drawPitch(h){return g.OctaveShift.getPitchFromOctaveShift(h,this.octaveShift)}Transpose(h,d,E,f){const y=super.Transpose(h,d,E,f),S=g.OctaveShift.getPitchFromOctaveShift(y,this.octaveShift);return this.vfpitch=a.VexFlowConverter.pitch(S,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,S}setIndex(h,d){this.vfnote=[h,d],this.vfnoteIndex=d}notehead(h=void 0){let d=h;d||(d=this.vfnote[0]);const E=d.note_heads;return E&&E.length>this.vfnoteIndex&&E[this.vfnoteIndex]?d.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const h=[];for(let d=0;;d++){const E=document.getElementById(`vf-${this.getSVGId()}-beam${d}`);if(!E)break;h.push(E)}return h}}o.VexFlowGraphicalNote=c},8144:function(b,o,r){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowGraphicalSymbolFactory=void 0;var a=u(r(6368)).default.Flow;const g=r(8494),c=r(7330),l=r(9252),h=r(5853),d=r(4679),E=r(4146),f=r(5460),y=r(8129),S=r(8790),_=r(4828),P=r(4405);o.VexFlowGraphicalSymbolFactory=class{createMusicSystem(w,x){return new g.VexFlowMusicSystem(w,x)}createStaffLine(w,x){return new _.VexFlowStaffLine(w,x)}createGraphicalMeasure(w,x,M=!1){return new c.VexFlowMeasure(x,w,void 0)}createMultiRestMeasure(w,x,M){return new P.VexFlowMultiRestMeasure(x,w,M)}createTabStaffMeasure(w,x){return new S.VexFlowTabMeasure(x,w)}createExtraGraphicalMeasure(w){const x=new c.VexFlowMeasure(w.ParentStaff,void 0,w);return x.IsExtraGraphicalMeasure=!0,x.ExtraGraphicalMeasurePreviousMeasure=w.Measures.last(),x}createStaffEntry(w,x){return new l.VexFlowStaffEntry(x,w,void 0)}createVoiceEntry(w,x){return new f.VexFlowVoiceEntry(w,x)}createNote(w,x,M,N=h.OctaveEnum.NONE,R,A=void 0){return new d.VexFlowGraphicalNote(w,x,M,N,R,A)}createGraceNote(w,x,M,N,R=h.OctaveEnum.NONE){return new d.VexFlowGraphicalNote(w,x,M,R,N)}addGraphicalAccidental(w,x){w.setAccidental(x)}addFermataAtTiedEndNote(w,x){}createInStaffClef(w,x){const M=w,N=y.VexFlowConverter.Clef(x,"small");M.vfClefBefore=new a.ClefNote(N.type,N.size,N.annotation)}createChordSymbols(w,x,M,N){const R=x.parentMeasure.parentSourceMeasure.Rules;let A=0;const F=R.ChordSymbolXSpacing;for(const U of w.ChordContainers){let Y=x.PositionAndShape;x.graphicalVoiceEntries.length===1&&x.graphicalVoiceEntries[0].notes.length===1&&x.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeRest()&&(Y=x.parentMeasure.PositionAndShape,A+=x.parentMeasure.beginInstructionsWidth,A+=R.ChordSymbolWholeMeasureRestXOffset);const k=new E.GraphicalChordSymbolContainer(U,Y,R.ChordSymbolTextHeight,M,N,x.parentMeasure.parentSourceMeasure.Rules),W=k.GraphicalLabel;W.PositionAndShape.RelativePosition.y-=R.ChordSymbolYOffset,W.setLabelPositionAndShapeBorders();let G=0;W.PositionAndShape.Size.width{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowInstantaneousDynamicExpression=void 0;const u=r(9428),a=r(9793),g=r(9946),c=r(2255),l=r(1274),h=r(2562);class d extends u.GraphicalInstantaneousDynamicExpression{constructor(f,y,S){super(f,y,S);const _=new c.Label(this.Expression);this.label=new g.GraphicalLabel(_,this.rules.ContinuousDynamicTextHeight,l.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=h.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return a.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}o.VexFlowInstantaneousDynamicExpression=d},8939:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowInstrumentBrace=void 0;var a=u(r(6368)).default.Flow;const g=r(5575);class c extends g.VexFlowInstrumentBracket{constructor(h,d,E=0){super(h,d,E),this.vexflowConnector.setType(a.StaveConnector.type.BRACE)}}o.VexFlowInstrumentBrace=c},5575:function(b,o,r){var u=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowInstrumentBracket=void 0;var a=u(r(6368)).default.Flow;const g=r(4785),c=r(8911),l=r(5820);class h extends g.GraphicalObject{constructor(E,f,y=0){super(),this.Visible=!0,this.PositionAndShape=new c.BoundingBox(this,E.ParentMusicSystem.PositionAndShape);const S=E.Measures[0],_=f.Measures[0];this.addConnector(S.getVFStave(),_.getVFStave(),a.StaveConnector.type.BRACKET,y)}draw(E){this.Visible&&this.vexflowConnector.setContext(E).draw();const f=this.vexflowConnector,y=f.top_stave.getYForLine(0),S=f.bottom_stave.getYForLine(f.bottom_stave.getNumLines()-1)+f.thickness;this.PositionAndShape.AbsolutePosition.x=(f.top_stave.getX()-2+f.x_shift)/l.unitInPixels,this.PositionAndShape.AbsolutePosition.y=y/l.unitInPixels,this.PositionAndShape.Size.height=(S-y)/l.unitInPixels,this.PositionAndShape.Size.width=12/l.unitInPixels}addConnector(E,f,y,S){this.vexflowConnector=new a.StaveConnector(E,f).setType(y).setXShift(-5*S)}}o.VexFlowInstrumentBracket=h},7330:function(b,o,r){var u=this&&this.__importDefault||function(Y){return Y&&Y.__esModule?Y:{default:Y}};Object.defineProperty(o,"__esModule",{value:!0}),o.StavePositionEnum=o.VexFlowMeasure=void 0;var a=u(r(6368)).default.Flow;const g=r(1513),c=r(6894),l=r(289),h=r(8129),d=r(9224);var E=a.NoteSubGroup;const f=u(r(2043)),y=r(5820),S=r(6189),_=r(1225),P=r(908),w=r(5460),x=r(1797),M=r(1405),N=r(1357),R=r(3748),A=r(2478);class F extends g.GraphicalMeasure{constructor(k,W,G){super(k,W,G),this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.hasMetronomeMark=!1,this.connectors=[],this.beams={},this.autoVfBeams=[],this.autoTupletVfBeams=[],this.vfbeams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,this.rules=G?G.ParentMusicSystem.rules:W?W.Rules:new M.EngravingRules,this.resetLayout()}setAbsoluteCoordinates(k,W){this.stave.setX(k).setY(W)}resetLayout(){this.stave=new a.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.InitiallyActiveClef&&(this.stave.clef=h.VexFlowConverter.Clef(this.InitiallyActiveClef).type),this.stave.MeasureNumber=this.MeasureNumber,this.hasMetronomeMark=!1,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(a.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===c.SystemLinesEnum.None&&this.stave.setEndBarType(a.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(k){switch(k){case c.SystemLinesEnum.BoldThinDots:case c.SystemLinesEnum.DotsThinBold:return 10/y.unitInPixels;case c.SystemLinesEnum.DotsBoldBoldDots:return 10/y.unitInPixels+this.rules.RepeatEndStartPadding;default:return 0}}addClefAtBegin(k){if(this.rules.RenderClefsAtBeginningOfStaffline){if(this.octaveOffset=k.OctaveOffset,k.ClefType===l.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const W=h.VexFlowConverter.Clef(k,"default");this.stave.addClef(W.type,W.size,W.annotation,a.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}}setLineNumber(k){k!==5&&(k===0?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):k===1?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):k===2?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):k===3?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(k),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(k,W,G){var H;if(this.rules.RenderKeySignatures&&this.ShowKeySignature&&(!this.isTabMeasure||this.rules.TabKeySignatureRendered||this.rules.TabKeySignatureSpacingAdded)&&(!(!((H=this.parentSourceMeasure)===null||H===void 0)&&H.isReducedToMultiRest)||this.rules.MultipleRestMeasureAddKeySignature)){if(this.stave.setKeySignature(h.VexFlowConverter.keySignature(k),h.VexFlowConverter.keySignature(W),void 0),this.isTabMeasure&&!this.rules.TabKeySignatureRendered){const L=this.stave.getModifiers();for(const $ of L)if($ instanceof a.KeySignature){$.setStyle({fillStyle:"#00000000"}),$.hidden=!0;break}}this.updateInstructionWidth()}}addRhythmAtBegin(k){if(this.isTabMeasure&&!this.rules.TabTimeSignatureRendered&&!this.rules.TabTimeSignatureSpacingAdded)return;const W=h.VexFlowConverter.TimeSignature(k);this.stave.addModifier(W,a.StaveModifier.Position.BEGIN),(!this.ShowTimeSignature||this.isTabMeasure&&!this.rules.TabTimeSignatureRendered)&&(W.setStyle({fillStyle:"#00000000"}),W.hidden=!0),this.updateInstructionWidth()}addClefAtEnd(k,W=!0){const G=h.VexFlowConverter.Clef(k,"small");if(W||!this.stave.endClef){this.stave.setEndClef(G.type,G.size,G.annotation);for(const H of this.stave.getModifiers())if(W){const L=H.originalStrokeStyle,$=H.originalFillStyle;H.getStyle()&&(L&&$?(H.getStyle().strokeStyle=L,H.getStyle().fillStyle=$):(H.getStyle().strokeStyle=null,H.getStyle().fillStyle=null))}else if(H.getCategory()==="clefs"&&H.getPosition()===a.StaveModifier.Position.END&&H.type===G.type){const L="#12345600",$=H.getStyle();$&&(H.originalStrokeStyle=$.strokeStyle,H.originalFillStyle=$.fillStyle),H.setStyle({strokeStyle:L,fillStyle:L})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(k,W,G=!0){switch(W){case _.SystemLinePosition.MeasureBegin:k===c.SystemLinesEnum.BoldThinDots&&(G||(this.stave.modifiers[0].draw=function(H){switch(H.checkContext(),this.setRendered(),this.type){case a.Barline.type.SINGLE:this.drawVerticalBar(H,this.x,!1);break;case a.Barline.type.DOUBLE:this.drawVerticalBar(H,this.x,!0);break;case a.Barline.type.END:this.drawVerticalEndBar(H,this.x);break;case a.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(H,this.x,!0);break;case a.Barline.type.REPEAT_END:this.drawRepeatBar(H,this.x,!1);break;case a.Barline.type.REPEAT_BOTH:this.drawRepeatBar(H,this.x,!1),this.drawRepeatBar(H,this.x,!0)}}),this.stave.setBegBarType(a.Barline.type.REPEAT_BEGIN));break;case _.SystemLinePosition.MeasureEnd:switch(k){case c.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(a.Barline.type.REPEAT_BOTH);break;case c.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(a.Barline.type.REPEAT_END);break;case c.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(a.Barline.type.DOUBLE);break;case c.SystemLinesEnum.ThinBold:this.stave.setEndBarType(a.Barline.type.END);break;case c.SystemLinesEnum.None:this.stave.setEndBarType(a.Barline.type.NONE)}}}addMeasureNumber(){const k=this.MeasureNumber.toString(),W=U.ABOVE;this.stave.setText(k,W,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(k){let W,G=a.StaveModifier.Position.END;const H=this.beginInstructionsWidth;switch(k.type){case S.RepetitionInstructionEnum.Segno:W=a.Repetition.type.SEGNO_LEFT,G=a.StaveModifier.Position.LEFT;break;case S.RepetitionInstructionEnum.Coda:W=a.Repetition.type.CODA_LEFT,G=a.StaveModifier.Position.LEFT;break;case S.RepetitionInstructionEnum.DaCapo:W=a.Repetition.type.DC;break;case S.RepetitionInstructionEnum.DalSegno:W=a.Repetition.type.DS;break;case S.RepetitionInstructionEnum.Fine:W=a.Repetition.type.FINE;break;case S.RepetitionInstructionEnum.ToCoda:W=a.Repetition.type.TO_CODA;break;case S.RepetitionInstructionEnum.DaCapoAlFine:W=a.Repetition.type.DC_AL_FINE;break;case S.RepetitionInstructionEnum.DaCapoAlCoda:W=a.Repetition.type.DC_AL_CODA;break;case S.RepetitionInstructionEnum.DalSegnoAlFine:W=a.Repetition.type.DS_AL_FINE;break;case S.RepetitionInstructionEnum.DalSegnoAlCoda:W=a.Repetition.type.DS_AL_CODA}if(W){const L=new a.Repetition(W,H,-this.rules.RepetitionSymbolsYOffset);return L.xShiftAsPercentOfStaveWidth=this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth,void this.stave.addModifier(L,G)}this.addVolta(k)}addVolta(k){var W;let G=a.Volta.type.BEGIN;if(k.type===S.RepetitionInstructionEnum.Ending){switch(k.alignment){case S.AlignmentType.Begin:G=this.parentSourceMeasure.endsRepetitionEnding()?a.Volta.type.BEGIN_END:a.Volta.type.BEGIN;break;case S.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;G=a.Volta.type.END}const H=this.ParentStaffLine.SkyBottomLineCalculator,L=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,$=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,L+.4),ie=H.getSkyLineMinInRange(L,$)-2;let re,be=-6.1+this.rules.VoltaOffset,ae=this.rules.VoltaOffset;ie0){f.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const ge=this.createGhostGves(ae);G.splice($,0,...ge),$+=ge.length}}else{const ae=x.Fraction.minus(re,this.parentSourceMeasure.AbsoluteTimestamp);if(ae.RealValue>0){f.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const ge=this.createGhostGves(ae);G.splice(0,0,...ge),$+=ge.length}}W=be}const H=x.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),L=x.Fraction.minus(H,W);if(L.RealValue>0){f.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const $=this.createGhostGves(L);G=G.concat($)}return G}createGhostGves(k){const W=h.VexFlowConverter.GhostNotes(k),G=[];for(const H of W){const L=new w.VexFlowVoiceEntry(void 0,void 0,this.rules);L.vfStaveNote=H,G.push(L)}return G}handleBeam(k,W){const G=k.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let H,L=this.beams[G];L||(L=this.beams[G]=[]);for(const ie of L)ie[0]===W&&(H=ie);H||(H=[W,[]],L.push(H));const $=k.parentVoiceEntry;H[1].indexOf($)<0&&H[1].push($)}handleTuplet(k,W){const G=k.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;W=k.sourceNote.NoteTuplet;let H,L=this.tuplets[G];L||(L=this.tuplets[G]=[]);for(const ie of L)ie[0]===W&&(H=ie);H||(H=[W,[]],L.push(H));const $=k.parentVoiceEntry;H[1].indexOf($)<0&&H[1].push($)}finalizeBeams(){this.vfbeams={};const k=[];for(const W in this.beams)if(this.beams.hasOwnProperty(W)){let G=this.vfbeams[W];G||(G=this.vfbeams[W]=[]);for(const H of this.beams[W]){let L=!1;for(const Z of H[0].Notes)if(Z.Length.RealValue>=new x.Fraction(1,4).RealValue&&(!Z.TypeLength||Z.TypeLength.RealValue>.125)){L=!0;break}if(L){f.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const $=[],ie=H[0],re=H[1];let be=!0;for(const Z of re)Z.parentVoiceEntry.ParentVoice===ie.Notes[0].ParentVoiceEntry.ParentVoice&&(be=Z.parentVoiceEntry.WantedStemDirection===P.StemDirectionType.Undefined);let ae,ge=!1;const le=[];for(const Z of re){const ye=Z.vfStaveNote;ye&&($.push(ye),k.push(ye)),Z.parentVoiceEntry.IsGrace&&(ge=!0),Z.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&le.push(Z.parentVoiceEntry.StemColor)}if($.length>1){const Z=new a.Beam($,be);if(ge&&(Z.render_options.beam_width=3,Z.render_options.partial_beam_length=4),le.length>=2&&this.rules.ColorBeams){ae=le[0];for(const ye of le)if(ye!==ae){ae=void 0;break}Z.setStyle({fillStyle:ae,strokeStyle:ae})}this.rules.FlatBeams&&(Z.render_options.flat_beams=!0,Z.render_options.flat_beam_offset=this.rules.FlatBeamOffset,Z.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),G.push(Z)}else f.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(k)}autoBeamNotes(k){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let W,G=60,H=[],L=[],$=[];this.autoTupletVfBeams=[];const ie=[];this.autoVfBeams=[];let re=this.parentSourceMeasure.ActiveTimeSignature;re||(re=this.parentSourceMeasure.Duration);for(const ge of this.staffEntries)for(const le of ge.graphicalVoiceEntries){const Z=le.vfStaveNote,ye=le.notes[0],Se={vfStaveNote:Z,sourceNote:ye.sourceNote},X=ge.relInMeasureTimestamp.isOnBeat(re),ee=L.length>=2,ne=ye.sourceNote.Length.RealValue-new x.Fraction(1,4).RealValue>-x.Fraction.FloatInaccuracyTolerance,O=le.parentVoiceEntry.IsGrace||ne||k.contains(Z);if(O||X){if(ee){for(const K of L)H.push(K);ie.push(H.slice()),H=[]}if(L=[],O)continue}const z=le.notes[0].sourceNote.NoteTuplet;if(z){let K=!1;for(const q of z.Notes){for(const de of q)if(de.NoteTypeXml>=A.NoteType.QUARTER||de.ParentVoiceEntry.IsGrace||de.isRest()&&!this.rules.AutoBeamOptions.beam_rests){K=!0;break}if(K)break}if(W){if(W!==z){if($.length>1){const q=[];for(const ce of $)q.push(ce.vfStaveNote);const de=new a.Beam(q,!0);this.rules.FlatBeams&&(de.render_options.flat_beams=!0,de.render_options.flat_beam_offset=this.rules.FlatBeamOffset,de.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(de);const ue=new d.Beam(G++);ue.AutoGenerated=!0;for(const ce of $)ue.addNoteToBeam(ce.sourceNote)}$=[],W=z}}else W=z;K||$.push(Se)}else W=void 0,L.push(Se)}if($.length>=2){const ge=[];for(const ye of $)ge.push(ye.vfStaveNote);const le=new a.Beam(ge,!0);this.rules.FlatBeams&&(le.render_options.flat_beams=!0,le.render_options.flat_beam_offset=this.rules.FlatBeamOffset,le.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(le);const Z=new d.Beam(G++);Z.AutoGenerated=!0;for(const ye of $)Z.addNoteToBeam(ye.sourceNote)}if(L.length>=2){for(const ge of L)H.push(ge);ie.push(H)}const be=this.rules.AutoBeamOptions,ae={beam_middle_only:be.beam_middle_rests_only,beam_rests:be.beam_rests,maintain_stem_directions:be.maintain_stem_directions};if(be.groups&&be.groups.length){const ge=[];for(const le of be.groups)ge.push(new a.Fraction(le[0],le[1]));ae.groups=ge}for(const ge of ie){const le=[];for(const ye of ge)le.push(ye.vfStaveNote);const Z=a.Beam.generateBeams(le,ae);for(const ye of Z)this.rules.FlatBeams&&(ye.render_options.flat_beams=!0,ye.render_options.flat_beam_offset=this.rules.FlatBeamOffset,ye.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(ye)}}finalizeTuplets(){this.vftuplets={};for(const k in this.tuplets)if(this.tuplets.hasOwnProperty(k)){let W=this.vftuplets[k];W||(W=this.vftuplets[k]=[]);for(const G of this.tuplets[k]){const H=[],L=G[1];for(const $ of L)H.push($.vfStaveNote);if(H.length>1){const $=G[0],ie=$.Notes[0][0].NormalNotes,re=$.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed);let be=a.Tuplet.LOCATION_TOP;$.tupletLabelNumberPlacement===R.PlacementEnum.Below&&(be=a.Tuplet.LOCATION_BOTTOM);const ae=new a.Tuplet(H,{bracketed:re,location:be,notes_occupied:ie,num_notes:$.TupletLabelNumber,ratioed:this.rules.TupletsRatioed});W.push(ae)}else f.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(k){}graphicalMeasureCreatedCalculations(){let k,W=[];const G=[];for(const L of this.staffEntries){k=!1,W=[];for(const $ of L.graphicalVoiceEntries)if($.parentVoiceEntry.IsGrace)W.push($),G.push($),k||(k=$.parentVoiceEntry.GraceSlur);else if($.vfStaveNote=h.VexFlowConverter.StaveNote($),W.length>0){const ie=[];for(let be=0;be0&&(ae.GraceSlash=!1);const ge=h.VexFlowConverter.StaveNote(ae);ae.vfStaveNote=ge,ie.push(ge)}const re=new a.GraceNoteGroup(ie,k);re.spacing=10*this.rules.GraceNoteGroupXMargin,$.vfStaveNote.addModifier(0,re),W=[]}}if(W.length>0)for(const L of W)L.vfStaveNote=h.VexFlowConverter.StaveNote(L),L.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const H=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const L of this.staffEntries)L.setModifierXOffsets();for(const L of H){if(!L)continue;this.vfVoices[L.VoiceId]=new a.Voice({beat_value:this.parentSourceMeasure.ActiveTimeSignature.Denominator,num_beats:this.parentSourceMeasure.ActiveTimeSignature.Numerator,resolution:a.RESOLUTION}).setMode(a.Voice.Mode.SOFT);const $=this.getRestFilledVexFlowStaveNotesPerVoice(L);for(const ie of $){if(ie.parentVoiceEntry&&ie.parentVoiceEntry.IsGrace&&!ie.parentVoiceEntry.GraceAfterMainNote)continue;const re=ie;if(re.vfStaveNote.getTicks().denominator===0&&(re.vfStaveNote.getTicks().denominator=1),ie.notes.length===0||!ie.notes[0]||!ie.notes[0].sourceNote.PrintObject){this.vfVoices[L.VoiceId].addTickable(re.vfStaveNote);continue}const be=re.parentStaffEntry;if(be&&be.vfClefBefore){const ae=new E([be.vfClefBefore]);re.vfStaveNote.getCategory&&re.vfStaveNote.getCategory()==="stavenotes"&&re.vfStaveNote.addModifier(0,ae)}ie.parentVoiceEntry&&this.rules.RenderFingerings&&(this.rules.FingeringPosition!==R.PlacementEnum.Left&&this.rules.FingeringPosition!==R.PlacementEnum.Right||this.createFingerings(ie),this.createStringNumber(ie)),this.createArpeggio(ie),this.vfVoices[L.VoiceId].addTickable(re.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const L of G)this.createFingerings(L),this.createStringNumber(L),this.createArpeggio(L);this.createArticulations(),this.createOrnaments()}createArpeggio(k){if(k.parentVoiceEntry&&k.parentVoiceEntry.Arpeggio){const W=k.parentVoiceEntry.Arpeggio;if(k.notes&&k.notes.length>1){const G=h.VexFlowConverter.StrokeTypeFromArpeggioType(W.type),H=new a.Stroke(G,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&k.vfStaveNote.addStroke(0,H)}else f.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. + voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const k of this.staffEntries)for(const W of k.graphicalVoiceEntries)for(const G of W.notes){const H=G.vfnote;if(H&&H[0])switch(H[0].getStemDirection()){case a.Stem.UP:W.parentVoiceEntry.StemDirection=P.StemDirectionType.Up;break;case a.Stem.DOWN:W.parentVoiceEntry.StemDirection=P.StemDirectionType.Down}}}createArticulations(){for(let k=0,W=this.staffEntries.length;kG){for(const $ of k.notes)if(!$.sourceNote.Fingering&&($.sourceNote.Fingering=H.pop(),G++,H.length===0))break}let L=-1;for(const $ of k.notes){const ie=$.sourceNote.Fingering;if(!ie){L++;continue}L++;let re=this.rules.FingeringPosition;this.rules.FingeringPositionGrace===R.PlacementEnum.AboveOrBelow&&(this.isUpperStaffOfInstrument()?re=R.PlacementEnum.Above:this.isLowerStaffOfInstrument()&&(re=R.PlacementEnum.Below)),ie.placement!==R.PlacementEnum.NotYetDefined&&(re=ie.placement);let be,ae=this.rules.FingeringOffsetX;switch(re){default:case R.PlacementEnum.Left:be=a.StaveModifier.Position.LEFT,ae-=$.baseFingeringXOffset*y.unitInPixels;break;case R.PlacementEnum.Right:be=a.StaveModifier.Position.RIGHT,ae+=$.baseFingeringXOffset*y.unitInPixels;break;case R.PlacementEnum.Above:be=a.StaveModifier.Position.ABOVE;break;case R.PlacementEnum.Below:be=a.StaveModifier.Position.BELOW;break;case R.PlacementEnum.NotYetDefined:const le=k.parentStaffEntry.sourceStaffEntry.ParentStaff;k.notes.length>1||k.parentStaffEntry.graphicalVoiceEntries.length>1?be=a.StaveModifier.Position.LEFT:le.idInMusicSheet===0?(be=a.StaveModifier.Position.ABOVE,re=R.PlacementEnum.Above):(be=a.StaveModifier.Position.BELOW,re=R.PlacementEnum.Below)}const ge=new a.FretHandFinger(ie.value);if(ge.setPosition(be),ge.setOffsetX(ae),re===R.PlacementEnum.Above||re===R.PlacementEnum.Below){const le=re===R.PlacementEnum.Above?-1:1,Z=re===R.PlacementEnum.Above?L:G-1-L;if(this.rules.FingeringInsideStafflines&&G>1){const ye=ge.getWidth()/2,Se=2.5*G;ge.setOffsetY(le*(Z+Se)*ye)}else if(!this.rules.FingeringInsideStafflines){const ye=new a.StringNumber(ie.value);ye.radius=0,ye.setPosition(be),ye.setOffsetY(le*Z*ye.getWidth()*2/3),W.vfStaveNote.addModifier(L,ye);continue}}W.vfStaveNote.addModifier(L,ge)}}createStringNumber(k){if(!this.rules.RenderStringNumbersClassical)return;const W=k;k.notes.forEach((G,H)=>{const L=G.sourceNote.StringInstruction;if(L){let $=L.value;switch($){case"1":$="I";break;case"2":$="II";break;case"3":$="III";break;case"4":$="IV";break;case"5":$="V";break;case"6":$="VI"}const ie=new a.StringNumber($);ie.radius=0;const re=-this.rules.StringNumberOffsetY;k.notes.length>1||k.parentStaffEntry.graphicalVoiceEntries.length>1?(ie.setOffsetX(13*G.baseStringNumberXOffset),ie.setPosition(a.Modifier.Position.RIGHT)):ie.setPosition(a.Modifier.Position.ABOVE),ie.setOffsetY(re),W.vfStaveNote.addModifier(H,ie)}})}lineTo(k,W){const G=new a.StaveConnector(k.getVFStave(),this.stave);G.setType(W),this.connectors.push(G)}getVFStave(){return this.stave}updateInstructionWidth(){let k=0,W=0;const G=this.stave.getModifiers();for(const H of G)H.getPosition()===U.BEGIN?k+=H.getWidth()+H.getPadding(void 0):H.getPosition()===U.END&&(W+=H.getWidth()+H.getPadding(void 0));this.beginInstructionsWidth=(k??0)/y.unitInPixels,this.endInstructionsWidth=(W??0)/y.unitInPixels}addStaveTie(k,W){this.vfTies.push(k),W.vfTie=k,W.Tie.TieDirection===R.PlacementEnum.Below&&k.setDirection(1)}}var U;o.VexFlowMeasure=F,function(Y){Y[Y.LEFT=1]="LEFT",Y[Y.RIGHT=2]="RIGHT",Y[Y.ABOVE=3]="ABOVE",Y[Y.BELOW=4]="BELOW",Y[Y.BEGIN=5]="BEGIN",Y[Y.END=6]="END"}(U=o.StavePositionEnum||(o.StavePositionEnum={}))},4405:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowMultiRestMeasure=void 0;var a=u(r(6368)).default.Flow;const g=r(7330);class c extends g.VexFlowMeasure{constructor(h,d=void 0,E=void 0){super(h,d,E),this.minimumStaffEntriesWidth=-1,E?this.rules=E.ParentMusicSystem.rules:d&&(this.rules=d.Rules),this.resetLayout(),this.multiRestElement=new a.MultiMeasureRest(d.multipleRestMeasures,{})}draw(h){this.stave.setContext(h).draw(),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(h),this.multiRestElement.draw();for(const d of this.connectors)d.setContext(h).draw()}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(h){return[]}getRestFilledVexFlowStaveNotesPerVoice(h){return[]}handleBeam(h,d){}handleTuplet(h,d){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(h){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(h){}getVFStave(){return this.stave}}o.VexFlowMultiRestMeasure=c},8738:function(b,o,r){var u=this&&this.__importDefault||function(ae){return ae&&ae.__esModule?ae:{default:ae}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowMusicSheetCalculator=void 0;const a=r(4040),g=r(8144),c=r(1513),l=r(1659),h=r(5309),d=r(2942),E=u(r(6368));var f=E.default.Flow;const y=u(r(2043)),S=r(5820),_=r(5091),P=r(8720),w=r(9520),x=r(6351),M=r(1274),N=r(9876),R=r(9344),A=r(9667),F=r(41),U=r(7781),Y=r(2478),k=r(8129),W=r(2343),G=r(4146),H=r(6894),L=r(3010),$=r(158),ie=r(2337),re=r(3602);class be extends a.MusicSheetCalculator{constructor(ge){var le,Z,ye,Se,X,ee,ne,O;super(),this.beamsNeedUpdate=!1,this.rules=ge,a.MusicSheetCalculator.symbolFactory=new g.VexFlowGraphicalSymbolFactory,a.MusicSheetCalculator.TextMeasurer=new d.VexFlowTextMeasurer(this.rules),a.MusicSheetCalculator.stafflineNoteCalculator=new U.VexflowStafflineNoteCalculator(this.rules),((le=this.rules.DefaultVexFlowNoteFont)===null||le===void 0?void 0:le.toLowerCase())==="gonville"?E.default.Flow.DEFAULT_FONT_STACK=[(Z=E.default.Flow.Fonts)===null||Z===void 0?void 0:Z.Gonville,(ye=E.default.Flow.Fonts)===null||ye===void 0?void 0:ye.Bravura,(Se=E.default.Flow.Fonts)===null||Se===void 0?void 0:Se.Custom]:((X=this.rules.DefaultVexFlowNoteFont)===null||X===void 0?void 0:X.toLowerCase())==="petaluma"&&(E.default.Flow.DEFAULT_FONT_STACK=[(ee=E.default.Flow.Fonts)===null||ee===void 0?void 0:ee.Petaluma,(ne=E.default.Flow.Fonts)===null||ne===void 0?void 0:ne.Gonville,(O=E.default.Flow.Fonts)===null||O===void 0?void 0:O.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),a.MusicSheetCalculator.stafflineNoteCalculator=new U.VexflowStafflineNoteCalculator(this.rules);for(const ge of this.graphicalMusicSheet.MeasureList)for(const le of ge)le==null||le.clean()}formatMeasures(){for(const ge of this.graphicalMusicSheet.MeasureList)if(ge&&ge[0]){ge.find(le=>le==null?void 0:le.isVisible()).format();for(const le of ge){for(const Z of le.staffEntries)Z.calculateXPosition();le.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(ge){const le=[];for(const O of ge)O!=null&&O.isVisible()&&le.push(O);if(le.length===0)return 0;ge=le;const Z=[],ye=new f.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let Se=ge[0].staffEntries.length,X=1;for(const O of ge){if(!O)continue;let z=0;for(const de of O.staffEntries)z+=de.setMaxAccidentals();O.parentSourceMeasure.ImplicitMeasure&&(Se=Math.max(O.staffEntries.length,Se),X=Math.max(O.staffEntries.length+z,X));const K=O.vfVoices,q=[];for(const de in K)if(K.hasOwnProperty(de)){const ue=K[de];O.hasOnlyRests&&!ue.ticksUsed.equals(ue.totalTicks)&&(ue.ticksUsed=ue.totalTicks),q.push(ue),Z.push(ue)}q.length!==0?ye.joinVoices(q):y.default.debug("Found a measure with no voices. Continuing anyway.",K)}let ee=12;const ne=ge[0].parentSourceMeasure;if(Z.length>0){if(ee=ye.preCalculateMinTotalWidth(Z)/S.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+.3*Se,ne==null?void 0:ne.ImplicitMeasure){ee=ne.Duration.RealValue/ne.ActiveTimeSignature.RealValue*ee;let K=0;const q=ne.measureListIndex;if(q>1)for(const de of this.graphicalMusicSheet.MeasureList[q-1]){const ue=de==null?void 0:de.parentSourceMeasure.endingBarStyleEnum;if(ue===H.SystemLinesEnum.ThinBold||ue===H.SystemLinesEnum.DotsThinBold){K=this.rules.PickupMeasureRepetitionSpacing;break}}ee+=K,Se>1?ee+=.3*X*1.5:q>1&&Se===1&&(ee+=this.rules.PickupMeasureSpacingSingleNoteAddend),ee*=this.rules.PickupMeasureWidthMultiplier}a.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(ge,ee);const O=(K,q)=>{ye.formatToStave(Z,q.getVFStave())},z=(K,q)=>{ye.formatToStave(Z,q.getVFStave(),{align_rests:!0,context:void 0})};for(const K of ge){if(this.rules.AlignRests===F.AlignRestOption.Never)K.formatVoices=O;else if(this.rules.AlignRests===F.AlignRestOption.Always)K.formatVoices=z;else if(this.rules.AlignRests===F.AlignRestOption.Auto){let q=!1;for(const de of K.staffEntries){let ue=0,ce=0;for(const pe of de.graphicalVoiceEntries)if(pe.parentVoiceEntry.IsGrace||pe&&pe.notes&&pe.notes[0]&&pe.notes[0].sourceNote&&pe.notes[0].sourceNote.PrintObject&&ue++,pe&&pe.notes&&pe.notes[0]&&pe.notes[0].sourceNote&&pe.notes[0].sourceNote.isRest()&&pe.notes[0].sourceNote.PrintObject&&ce++,ue>1&&ce>=1){q=!0;break}if(q)break}K.formatVoices=q?z:O}if(K===ge[0]){const q=K;q.formatVoices(ee*S.unitInPixels,q)}}}for(const O of ge)if(O)for(const z of O.staffEntries)z.calculateXPosition();for(const O of ge){if(!O)continue;const z=O.vfVoices,K=[];for(const q in z)z.hasOwnProperty(q)&&K.push(z[q]);K.length!==0?ye.joinVoices(K):y.default.debug("Found a measure with no voices. Continuing anyway.",z)}return ee}calculateElongationFactor(ge,le,Z,ye,Se,X,ee,ne){let O=Se,z=0;for(const K of ge){const q=K.GraphicalLabel.Label.textAlignment;let de=ee,ue=ne;if(K instanceof _.GraphicalLyricEntry&&K.ParentLyricWord){K.LyricsEntry.SyllableIndex>0&&(de=this.rules.BetweenSyllableMinimumDistance,M.TextAlignment.IsCenterAligned(q)&&(de+=1));const it=K.ParentLyricWord.GetLyricWord.Syllables;it.length>1&&K.LyricsEntry.SyllableIndex4&&(Ye*=1.1)):Z[z]&&(Ye=we/Me),We=Math.max(qe,Ye),O=Math.max(O,We);let Je=Math.max(we-Me||0,0);Z[z]&&(Je+=Z[z].cumulativeOverlap),Z[z]={cumulativeOverlap:Je,extend:K instanceof _.GraphicalLyricEntry&&K.LyricsEntry.extend,labelWidth:pe,measureNumber:X,sourceNoteDuration:K instanceof _.GraphicalLyricEntry&&K.LyricsEntry&&K.LyricsEntry.Parent.Notes[0].Length,text:K instanceof _.GraphicalLyricEntry?K.LyricsEntry.Text:K.GraphicalLabel.Label.text,xPosition:Qe},z++}return O}calculateElongationFactorFromStaffEntries(ge,le,Z,ye){let Se=Z;const X={},ee={};for(const ne of ge)ne.LyricsEntries.length>0&&this.rules.RenderLyrics&&(Se=this.calculateElongationFactor(ne.LyricsEntries,ne,X,le,Se,ye,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),ne.graphicalChordContainers.length>0&&this.rules.RenderChordSymbols&&(Se=this.calculateElongationFactor(ne.graphicalChordContainers,ne,ee,le,Se,ye,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return Se}calculateMeasureWidthFromStaffEntries(ge,le){let Z=1;for(const ye of ge)ye&&ye.staffEntries.length!==0&&(Z=this.calculateElongationFactorFromStaffEntries(ye.staffEntries,le,Z,ye.MeasureNumber));return Z=Math.min(Z,this.rules.MaximumLyricsElongationFactor),le*Z}createGraphicalTie(ge,le,Z,ye,Se){return new h.GraphicalTie(ge,ye,Se)}updateStaffLineBorders(ge){ge.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(ge){ge.rules=this.rules,ge.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(ge,le,Z,ye){for(let Se=0;Se=2&&(X=ye.vfnote[0],ne=ye.vfnote[1]);let O=0;if(Se&&Se.vfnote&&Se.vfnote.length>=2&&(ee=Se.vfnote[0],O=Se.vfnote[1]),le){if(X){const z=new f.StaveTie({first_indices:[ne],first_note:X});ye.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}if(ee){const z=new f.StaveTie({last_indices:[O],last_note:ee});Se.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}}else if(X||ee){let z;if(Z)if(ge.Tie.Type==="S"){const K=ge.StartNote.sourceNote,q=ge.EndNote.sourceNote;let de=1;K.FretNumber>q.FretNumber&&(de=-1),z=new f.TabSlide({first_indices:[ne],first_note:X,last_indices:[O],last_note:ee},de)}else z=new f.TabTie({first_indices:[ne],first_note:X,last_indices:[O],last_note:ee},ge.Tie.Type);else{z=new f.StaveTie({first_indices:[ne],first_note:X,last_indices:[O],last_note:ee});const K=ge.Tie.getTieDirection(ye.sourceNote);K===W.PlacementEnum.Below?z.setDirection(1):K===W.PlacementEnum.Above&&z.setDirection(-1)}Se.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(z,ge)}}calculateDynamicExpressionsForMultiExpression(ge,le,Z){if(lethis.rules.MaxMeasureToDrawIndex)return;const ye=ge.AbsoluteTimestamp,Se=this.graphicalMusicSheet.MeasureList[le],X=Se[Z].ParentStaffLine,ee=Se[Z],ne=ge.StartingContinuousDynamic,O=ne!==void 0&&!ne.IsStartOfSoftAccent,z=this.getRelativePositionInStaffLineFromTimestamp(ye,Z,X,X==null?void 0:X.isPartOfMultiStaffInstrument(),void 0,O);if(z.x<=0&&(z.x=ee.beginInstructionsWidth+this.rules.RhythmRightMargin),ge.InstantaneousDynamic){const K=new x.VexFlowInstantaneousDynamicExpression(ge.InstantaneousDynamic,X,ee);this.calculateGraphicalInstantaneousDynamicExpression(K,z,ye),this.dynamicExpressionMap.set(ye.RealValue,K.PositionAndShape)}if(ne){const K=new R.VexFlowContinuousDynamicExpression(ne,X,ee.parentSourceMeasure);if(K.StartMeasure=ee,K.IsSoftAccent=ge.StartingContinuousDynamic.IsStartOfSoftAccent,!K.IsVerbal&&ne.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(K,z),K.updateSkyBottomLine()}catch{}else K.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(K,z):y.default.warn("This continuous dynamic is not covered. measure"+ge.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(ge){var le,Z;const ye=Math.max(ge.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),Se=Math.max(ge.StaffNumber-1,0),X=ye===0&&Se===0,ee=this.graphicalMusicSheet.MeasureList[ye][Se];if(ee.hasMetronomeMark)return;const ne=ee.getVFStave();let O="q";if(ge.beatUnit){const ue=Y.NoteTypeHandler.getNoteDurationFromType(ge.beatUnit);O=k.VexFlowConverter.durations(ue,!1)[0]}let z=this.rules.MetronomeMarkYShift,K=!1;for(const ue of ge.parentMeasure.TempoExpressions){const ce=((le=ue.InstantaneousTempo)===null||le===void 0?void 0:le.Enum)===A.TempoEnum.metronomeMark;if(ue.getPlacementOfFirstEntry()===W.PlacementEnum.Above&&!ce){K=!0;break}}K&&(z-=1.4);const q=(Z=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)===null||Z===void 0?void 0:Z.SkyLine;ne.setTempo({bpm:ge.TempoInBpm,dots:ge.dotted,duration:O},z*S.unitInPixels);const de=X?this.rules.MetronomeMarkXShift*S.unitInPixels:0;ne.getModifiers()[ne.getModifiers().length-1].setShiftX(de),ee.hasMetronomeMark=!0,q&&(q[0]=Math.min(q[0],-4.5+z))}calculateRehearsalMark(ge){var le;const Z=ge.rehearsalExpression;if(!Z)return;const ye=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,Se=Math.max(ge.MeasureNumber-ye,0),X=(le=this.graphicalMusicSheet.MeasureList[Se][0])===null||le===void 0?void 0:le.getVFStave();if(!X)return;const ee=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let ne=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;ge.IsSystemStartMeasure&&(ne+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const O=this.rules.RehearsalMarkFontSize;X.setSection(Z.label,ee,ne,O)}calculateSingleOctaveShift(ge,le,Z,ye){var Se;const X=le.OctaveShiftStart,ee=X.ParentStartMultiExpression.Timestamp,ne=(Se=X.ParentEndMultiExpression)===null||Se===void 0?void 0:Se.Timestamp,O=this.rules.MinMeasureToDrawIndex,z=this.rules.MaxMeasureToDrawIndex;let K,q,de=this.graphicalMusicSheet.MeasureList[Z][ye].ParentStaffLine;if(de||(de=this.graphicalMusicSheet.MeasureList[O][ye].ParentStaffLine),K=X.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ParentEndMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0),K.MeasureNumber>z+1&&(K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0)),q=X.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ParentStartMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.MeasureList[O][ye],q.MeasureNumberz+1||K.MeasureNumberz+1)return;let ue=K.ParentStaffLine;if(ue||(ue=de),K&&de&&ue){const ce=new w.VexFlowOctaveShift(X,de.PositionAndShape);if(!ce.startNote){let Me;for(const ze of q.staffEntries)if(ze){Me=ze;break}if(!Me||(ce.setStartNote(Me),!ce.startNote))return}if(!ce.endNote){let Me;for(let ze=K.staffEntries.length-1;ze>=0;ze++)if(K.staffEntries[ze]){Me=K.staffEntries[ze];break}if(!Me)return void(ce.graphicalEndAtMeasureEnd=!0);if(ce.setEndNote(Me),!ce.endNote)return}let pe=q.findGraphicalStaffEntryFromTimestamp(ee);pe||(pe=q.staffEntries[0]);let we=K.findGraphicalStaffEntryFromTimestamp(ne);if(we||(we=K.staffEntries[K.staffEntries.length-1]),ce.setStartNote(pe),ue!==de){ce.endsOnDifferentStaffLine=!0;let Me=this.findLastStafflineMeasure(de);Me===void 0&&(Me=K);const ze=Me.staffEntries[Me.staffEntries.length-1];ce.setEndNote(ze),ce.graphicalEndAtMeasureEnd=!0,ce.endMeasure=Me;const De=ue.ParentMusicSystem.Id-de.ParentMusicSystem.Id;if(De>0)for(let Qe=de.ParentMusicSystem.Id;Qe=0;le--){const Z=ge.Measures[le];if(Z.staffEntries.length>0)return Z}}calculateSinglePedal(ge,le,Z,ye){var Se;const X=le.PedalStart,ee=X.ParentStartMultiExpression.Timestamp,ne=(Se=X.ParentEndMultiExpression)===null||Se===void 0?void 0:Se.Timestamp,O=this.rules.MinMeasureToDrawIndex,z=this.rules.MaxMeasureToDrawIndex;let K,q,de=this.graphicalMusicSheet.MeasureList[Z][ye].ParentStaffLine;if(de||(de=this.graphicalMusicSheet.MeasureList[O][ye].ParentStaffLine),K=X.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ParentEndMultiExpression.SourceMeasureParent,ye):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0),K.MeasureNumber>z+1&&(K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(ye,!0)),X.ParentEndMultiExpression?q=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ParentStartMultiExpression.SourceMeasureParent,ye):(q=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(X.ParentStartMultiExpression.SourceMeasureParent,ye),q||(q=this.graphicalMusicSheet.MeasureList[O][ye])),q.MeasureNumberz||K.parentSourceMeasure.measureListIndexz)return;let ue=K.ParentStaffLine;if(ue||(ue=de),K&&de&&ue){let ce=!1;de!==ue&&(ce=!0);const pe=new L.VexFlowPedal(X,de.PositionAndShape,!1,ce);pe.setEndsStave(K,ne);let we=q.findGraphicalStaffEntryFromTimestamp(ee);we||(we=q.staffEntries[0]);let Me=K.findGraphicalStaffEntryFromTimestamp(ne);if(Me||(Me=K.staffEntries[K.staffEntries.length-1]),!pe.setStartNote(we))return;if(pe.setBeginsStave(pe.startNote.isRest(),ee),ue!==de)if(pe.pedalSymbol===$.MusicSymbol.PEDAL_SYMBOL){pe.setEndNote(Me),pe.setEndMeasure(K),pe.ReleaseText=" ",pe.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(pe.startVfVoiceEntry,pe.endVfVoiceEntry,pe,de);const ze=ue.Measures[0],De=new L.VexFlowPedal(X,ze.PositionAndShape);pe.setEndsStave(K,ne);const Qe=ze.staffEntries[0];if(!De.setStartNote(Qe))return;De.setEndNote(Me),De.setEndMeasure(K),pe.setEndMeasure(K),ue.Pedals.push(De),De.CalculateBoundingBox(),De.DepressText=" ",this.calculatePedalSkyBottomLine(De.startVfVoiceEntry,De.endVfVoiceEntry,De,ue)}else{let ze=this.findLastStafflineMeasure(de);ze===void 0&&(ze=K);const De=ze.staffEntries[ze.staffEntries.length-1];pe.setEndNote(De),pe.setEndMeasure(K),pe.ChangeEnd=!1;const Qe=ue.ParentMusicSystem.Id-de.ParentMusicSystem.Id;if(Qe>0){let ke=1;for(let We=de.ParentMusicSystem.Id;Weue){const ze=ue;ue=ce,ce=ze}ye.SkyBottomLineCalculator.updateBottomLineInRange(ce,ue,pe+we)}for(const we of ye.Pedals){const Me=we,ze=Me.getPedalMarking();if(pe>ze.line+3+(ye.StaffLines.length-1)){const De=ze.render_options.text_margin_right/10;let Qe,ke=Me.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-De;Me.setLine(pe-3-(ye.StaffLines.length-1));let We=(X=Me.endVfVoiceEntry)===null||X===void 0?void 0:X.PositionAndShape;if(We||(We=Me.endMeasure.PositionAndShape),Me.EndSymbolPositionAndShape){const qe=K.render_options.glyph_point_size/20;Qe=ke+3.4;const Ye=We.AbsolutePosition.x-De,Je=Ye+1.5;ye.SkyBottomLineCalculator.updateBottomLineInRange(ke,Qe,pe+qe),ye.SkyBottomLineCalculator.updateBottomLineInRange(Ye,Je,pe+qe)}else{const qe=ze.render_options.bracket_height/10;if(ze.EndsStave)Qe=We.AbsolutePosition.x+We.Size.width-De;else switch(K.style){case z.BRACKET_OPEN_END:case z.BRACKET_OPEN_BOTH:case z.MIXED_OPEN_END:Qe=We.AbsolutePosition.x+We.BorderRight-De;break;default:Qe=We.AbsolutePosition.x+We.BorderLeft-De}const Ye=(ne=(ee=Me.endVfVoiceEntry)===null||ee===void 0?void 0:ee.parentStaffEntry)===null||ne===void 0?void 0:ne.vfClefBefore;if(Ye&&(Qe+=Ye.getWidth()/10),ke>Qe){const Je=ke;ke=Qe,Qe=Je}ye.SkyBottomLineCalculator.updateBottomLineInRange(ke,Qe,pe+qe)}}}}calculateOctaveShiftSkyBottomLine(ge,le,Z,ye){if(!le)return void y.default.warn("octaveshift: no endStaffEntry");let Se=le.PositionAndShape;Z.graphicalEndAtMeasureEnd&&(Se=le.parentMeasure.PositionAndShape);let X=ge.PositionAndShape.Size.width,ee=Se.Size.width;ge.hasOnlyRests()?X=-X:X/=2,Z.graphicalEndAtMeasureEnd||(le.hasOnlyRests()?ee*=2:ee/=2,ge===le&&(ee*=2));let ne=ge.PositionAndShape.AbsolutePosition.x-X,O=Se.AbsolutePosition.x+ee;if(ne>O){const q=ne;ne=O,O=q}Z.PositionAndShape.Size.width=O-ne;const z=Z.getTextBracket(),K=z.font.size/10;if(z.position===f.TextBracket.Positions.TOP){const q=Math.ceil(ye.SkyBottomLineCalculator.getSkyLineMinInRange(ne,O));if(q===1/0)return;z.start.getStave().options.top_text_position=Math.abs(q),ye.SkyBottomLineCalculator.updateSkyLineInRange(ne,O,q-2*K)}else{const q=ye.SkyBottomLineCalculator.getBottomLineMaxInRange(ne,O);if(q===1/0)return;z.start.getStave().options.bottom_text_position=q,ye.SkyBottomLineCalculator.updateBottomLineInRange(ne,O,q+1.5*K)}}calculateWordRepetitionInstruction(ge,le){let Z;const ye=this.graphicalMusicSheet.MeasureList[le];for(let Se=0,X=ye.length;SeZ.StaffLines));let le=0;for(const Z of ge)for(const ye of Z.Measures)ye&&le++;if(this.rules.AlwaysSetPreferredSkyBottomLineBackendAutomatically&&this.rules.setPreferredSkyBottomLineBackendAutomatically(le),le>=this.rules.SkyBottomLineBatchMinMeasures)new l.SkyBottomLineBatchCalculator(ge,this.rules.PreferredSkyBottomLineBatchCalculatorBackend).calculateLines();else for(const Z of ge)Z.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){for(const ge of this.musicSystems)for(const le of ge.StaffLines)try{le.AlignmentManager.alignDynamicExpressions(),le.AbstractExpressions.forEach(Z=>{Z.updateSkyBottomLine()})}catch{}}handleTiedGraphicalNote(ge,le,Z,ye,Se,X,ee,ne){}handleBeam(ge,le,Z){ge.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(ge,le)}handleVoiceEntryLyrics(ge,le,Z){ge.LyricsEntries.forEach((ye,Se)=>{const X=new _.GraphicalLyricEntry(Se,le,this.rules.LyricsHeight,this.rules.StaffHeight);if(le.LyricsEntries.push(X),X.GraphicalLabel.setLabelPositionAndShapeBorders(),Se.Word){const ee=Se.Word.Syllables.indexOf(Se);let ne=Z.indexOf(Se.Word);if(ne===-1&&(Z.push(Se.Word),ne=Z.indexOf(Se.Word)),this.graphicalLyricWords.length===0||ne>this.graphicalLyricWords.length-1){const O=new P.GraphicalLyricWord(Se.Word);X.ParentLyricWord=O,O.GraphicalLyricsEntries[ee]=X,this.graphicalLyricWords.push(O)}else{const O=this.graphicalLyricWords[ne];X.ParentLyricWord=O,O.GraphicalLyricsEntries[ee]=X,O.isFilled()&&(Z.splice(ne,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(O),1))}}})}handleVoiceEntryOrnaments(ge,le,Z){}handleVoiceEntryArticulations(ge,le,Z){}handleVoiceEntryTechnicalInstructions(ge,le,Z){}handleTuplet(ge,le,Z){ge.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(ge,le)}findIndexGraphicalSlurFromSlur(ge,le){for(let Z=0;Z=0){const K=ye[z];K.staffEntries.indexOf(X)===-1&&K.staffEntries.push(X),ye.splice(z,1)}}}for(const ee of ye)ee.staffEntries.indexOf(X)===-1&&ee.staffEntries.push(X)}}for(const le of this.musicSystems)for(const Z of le.StaffLines){const ye=Z.GraphicalSlurs.sort(N.GraphicalSlur.Compare);for(const Se of ye)Se.slur.isCrossed()||Se.calculateCurve(this.rules)}}calculateGlissandi(){const ge={};for(const le of this.graphicalMusicSheet.MeasureList[0])ge[le.ParentStaff.idInMusicSheet]=[];for(const le of this.musicSystems)for(const Z of le.StaffLines){const ye=ge[Z.ParentStaff.idInMusicSheet];for(let Se=0;Se=0){const K=ye[z];K.staffEntries.indexOf(X)===-1&&K.staffEntries.push(X),ye.splice(z,1)}}}}for(const ee of ye)ee.staffEntries.indexOf(X)===-1&&ee.staffEntries.push(X)}}for(const le of this.musicSystems)for(const Z of le.StaffLines)for(const ye of Z.GraphicalGlissandi)if(Z.ParentStaff.isTab){const Se=ye.Glissando.StartNote,X=ye.Glissando.EndNote,ee=ye.staffEntries[0].findGraphicalNoteFromNote(Se),ne=ye.staffEntries.last().findGraphicalNoteFromNote(X);if(!ee&&!ne)return;let O,z,K,q,de=1;Se.FretNumber>X.FretNumber&&(de=-1),ee&&ee.vfnote&&ee.vfnote.length>=2&&(K=ee.vfnote[0],O=[0]),ne&&ne.vfnote&&ne.vfnote.length>=2&&(q=ne.vfnote[0],z=[0]);const ue=new f.TabSlide({first_indices:O,first_note:K,last_indices:z,last_note:q},de),ce=ee==null?void 0:ee.parentVoiceEntry.parentStaffEntry.parentMeasure;ce&&(ce.vfTies.push(ue),ye.vfTie=ue);const pe=ne==null?void 0:ne.parentVoiceEntry.parentStaffEntry.parentMeasure;pe&&(pe.vfTies.push(ue),ye.vfTie=ue)}}}o.VexFlowMusicSheetCalculator=be},5820:function(b,o,r){var u=this&&this.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowMusicSheetDrawer=o.unitInPixels=void 0;const a=u(r(6368)),g=r(1494),c=r(3278),l=r(9086),h=r(2942),d=r(8155),E=r(3748),f=r(5277),y=r(9428),S=u(r(2043)),_=r(374),P=r(7459),w=r(4462),x=r(9505);o.unitInPixels=10;class M extends g.MusicSheetDrawer{constructor(R=new P.DrawingParameters){super(new h.VexFlowTextMeasurer(R.Rules),R),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(R){var A,F,U;this.rules.DefaultVexFlowNoteFont==="gonville"&&(a.default.Flow.DEFAULT_FONT_STACK=[(A=a.default.Flow.Fonts)===null||A===void 0?void 0:A.Gonville,(F=a.default.Flow.Fonts)===null||F===void 0?void 0:F.Bravura,(U=a.default.Flow.Fonts)===null||U===void 0?void 0:U.Custom]),a.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*o.unitInPixels,a.default.Flow.STEM_WIDTH=this.rules.StemWidth*o.unitInPixels,a.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,a.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const Y of R.MusicPages){if(Y.PageNumber>this.rules.MaxPageToDrawNumber)break;const k=this.backends[this.pageIdx];k.graphicalMusicPage=Y,k.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(R)}drawPage(R){R&&(this.backend=this.backends[R.PageNumber-1],super.drawPage(R),this.pageIdx+=1)}clear(){for(const R of this.backends)R.clear()}setZoom(R){this.zoom=R}calculatePixelDistance(R){return R*o.unitInPixels}drawStaffLine(R){super.drawStaffLine(R);const A=R.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(R,A),this.rules.RenderGlissandi&&this.drawGlissandi(R,A)}drawSlurs(R,A){for(const F of R.GraphicalSlurs)F.slur.isCrossed()||this.drawSlur(F,A)}drawGlissandi(R,A){for(const F of R.GraphicalGlissandi)this.drawGlissando(F,A)}drawGlissando(R,A){if(R.StaffLine.ParentStaff.isTab||R.calculateLine(this.rules),R.Line){const F=new l.PointF2D(R.Line.Start.x+A.x,R.Line.Start.y),U=new l.PointF2D(R.Line.End.x+A.x,R.Line.End.y);this.drawLine(F,U,R.Color,R.Width)}else{const F=R.vfTie;if(F){const U=this.backend.getContext();F.setContext(U),F.draw()}}}drawSlur(R,A){const F=[],U=new l.PointF2D(R.bezierStartPt.x+A.x,R.bezierStartPt.y+A.y),Y=new l.PointF2D(R.bezierStartControlPt.x+A.x,R.bezierStartControlPt.y+A.y),k=new l.PointF2D(R.bezierEndControlPt.x+A.x,R.bezierEndControlPt.y+A.y),W=new l.PointF2D(R.bezierEndPt.x+A.x,R.bezierEndPt.y+A.y);F.push(this.applyScreenTransformation(U)),F.push(this.applyScreenTransformation(Y)),F.push(this.applyScreenTransformation(k)),F.push(this.applyScreenTransformation(W)),R.placement===E.PlacementEnum.Above?(U.y-=.05,Y.y-=.3,k.y-=.3,W.y-=.05):(U.y+=.05,Y.y+=.3,k.y+=.3,W.y+=.05),F.push(this.applyScreenTransformation(U)),F.push(this.applyScreenTransformation(Y)),F.push(this.applyScreenTransformation(k)),F.push(this.applyScreenTransformation(W)),R.SVGElement=this.backend.renderCurve(F)}drawMeasure(R){R.setAbsoluteCoordinates(R.PositionAndShape.AbsolutePosition.x*o.unitInPixels,R.PositionAndShape.AbsolutePosition.y*o.unitInPixels);try{R.draw(this.backend.getContext())}catch(F){S.default.warn("VexFlowMusicSheetDrawer.drawMeasure",F)}let A=0;for(const F of R.staffEntries)this.drawStaffEntry(F),A=this.drawBuzzRolls(F,A)}drawBuzzRolls(R,A){var F;for(const U of R.graphicalVoiceEntries)for(const Y of U.notes)if(!((F=Y.sourceNote.TremoloInfo)===null||F===void 0)&&F.tremoloUnmeasured){const k=this.rules.TremoloBuzzRollThickness,W=.9,G=.5,H=Y;let L,$;const ie=H.vfnote[0].getStemDirection();let re;if(this.backend instanceof x.SvgVexFlowBackend&&(re=H.getStemSVG()),(re==null?void 0:re.getBbox)!==void 0){const Se=re.getBBox();L=new l.PointF2D(Se.x/10,Se.y/10),$=Se.height/10}else $=H.vfnote[0].getStemLength()/10,L=new l.PointF2D(H.vfnote[0].getStem().x_begin/10,H.vfnote[0].getStem().y_top/10),ie===1&&(L.y-=$);let be=L.y+$/3;H.vfnote[0].getBeamCount()>1&&(be=L.y+$/2,ie===-1&&(be-=G+.2));const ae=L.x-.5,ge=be,le=[],Z=[new l.PointF2D(0,-k),new l.PointF2D(W-k,0),new l.PointF2D(-W+k,-G),new l.PointF2D(0,-k),new l.PointF2D(W,0),new l.PointF2D(0,k),new l.PointF2D(-W+k,0),new l.PointF2D(W-k,G),new l.PointF2D(0,k),new l.PointF2D(-W,0)];let ye=new l.PointF2D(ae,ge);le.push(ye);for(const Se of Z)ye=le.last(),le.push(new l.PointF2D(ye.x+Se.x,ye.y-Se.y));this.DrawPath(le,H.ParentMusicPage,!0,`buzzRoll${A}`),A++}return A}drawLine(R,A,F="#000000FF",U=.2){return R=this.applyScreenTransformation(R),A=this.applyScreenTransformation(A),this.backend.renderLine(R,A,F,U*o.unitInPixels)}DrawOverlayLine(R,A,F,U="#FF0000FF",Y=.2,k){if(!F.PageNumber||F.PageNumber>this.backends.length||F.PageNumber<1)return void console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const W=F.PageNumber-1,G=this.backends[W];return R=this.applyScreenTransformation(R),A=this.applyScreenTransformation(A),k||(k=`overlayLine ${R.x}/${R.y}`),G.renderLine(R,A,U,Y*o.unitInPixels,k)}DrawPath(R,A,F=!0,U){const Y=A.PageNumber-1,k=this.backends[Y],W=[];for(const G of R)W.push(this.applyScreenTransformation(G));return k.renderPath(W,F,U)}drawSkyLine(R){const A=R.PositionAndShape.AbsolutePosition,F=R.PositionAndShape.Size.width;this.drawSampledLine(R.SkyLine,A,F)}drawBottomLine(R){const A=new l.PointF2D(R.PositionAndShape.AbsolutePosition.x,R.PositionAndShape.AbsolutePosition.y),F=R.PositionAndShape.Size.width;this.drawSampledLine(R.BottomLine,A,F,"#0000FFFF")}drawSampledLine(R,A,F,U="#FF0000FF"){const Y=[];let k=0;for(let G=0;G0){const G=this.rules.SamplingUnit;let H,L,$=new l.PointF2D(W.x,W.y),ie=new l.PointF2D(Y[0]/G+W.x,W.y);this.drawLine($,ie,U),R[0]>=0&&(H=new l.PointF2D(Y[0]/G+W.x,W.y),L=new l.PointF2D(Y[0]/G+W.x,W.y+R[Y[0]]),this.drawLine(H,L,U));for(let re=1;re0)for(const A of R.FingeringEntries)A.SVGNode=this.drawLabel(A,d.GraphicalLayers.Notes);if(R.graphicalChordContainers!==void 0&&R.graphicalChordContainers.length>0)for(const A of R.graphicalChordContainers){const F=A.GraphicalLabel;F.SVGNode=this.drawLabel(F,d.GraphicalLayers.Notes)}this.rules.RenderLyrics&&R.LyricsEntries.length>0&&this.drawLyrics(R.LyricsEntries,d.GraphicalLayers.Notes)}drawLyrics(R,A){R.forEach(F=>{const U=F.GraphicalLabel;U.Label.colorDefault=this.rules.DefaultColorLyrics,U.SVGNode=this.drawLabel(U,A)})}drawInstrumentBrace(R,A){R.draw(this.backend.getContext())}drawGroupBracket(R,A){R.draw(this.backend.getContext())}drawOctaveShifts(R){for(const A of R.OctaveShifts)if(A){const F=A,U=this.backend.getContext(),Y=F.getTextBracket();this.rules.DefaultColorMusic&&(Y.render_options.color=this.rules.DefaultColorMusic),Y.setContext(U);try{Y.draw()}catch(k){S.default.warn(k)}}}drawPedals(R){for(const A of R.Pedals)if(A){const F=A,U=this.backend.getContext(),Y=F.getPedalMarking();Y.render_options.color=this.rules.DefaultColorMusic,Y.setContext(U),Y.draw()}}drawExpressions(R){for(const A of R.AbstractExpressions)if(A instanceof y.GraphicalInstantaneousDynamicExpression)this.drawInstantaneousDynamic(A);else if(A instanceof f.GraphicalInstantaneousTempoExpression){const F=A.GraphicalLabel;F.SVGNode=this.drawLabel(F,d.GraphicalLayers.Notes)}else if(A instanceof _.GraphicalContinuousDynamicExpression)this.drawContinuousDynamic(A);else if(A instanceof w.GraphicalUnknownExpression){const F=A.Label;F.SVGNode=this.drawLabel(F,d.GraphicalLayers.Notes)}else S.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(R){const A=R.Label;A.SVGNode=this.drawLabel(A,d.GraphicalLayers.Notes)}drawContinuousDynamic(R){var A;if(R.IsVerbal){const F=R.Label;F.SVGNode=this.drawLabel(F,d.GraphicalLayers.Notes)}else for(const F of R.Lines){const U=new l.PointF2D(R.ParentStaffLine.PositionAndShape.AbsolutePosition.x+F.Start.x,R.ParentStaffLine.PositionAndShape.AbsolutePosition.y+F.Start.y),Y=new l.PointF2D(R.ParentStaffLine.PositionAndShape.AbsolutePosition.x+F.End.x,R.ParentStaffLine.PositionAndShape.AbsolutePosition.y+F.End.y);this.drawLine(U,Y,(A=F.colorHex)!==null&&A!==void 0?A:"#000000",F.Width)}}renderLabel(R,A,F,U,Y,k){var W;if(!R.Label.print)return;const G=R.Label.fontHeight*o.unitInPixels,{font:H}=R.Label;let L;this.rules.ColoringEnabled&&(L=R.Label.colorDefault,R.ColorXML&&(L=R.ColorXML),L||(L=this.rules.DefaultColorLabel));let $,{fontStyle:ie,fontFamily:re}=R.Label;ie||(ie=this.rules.DefaultFontStyle),re||(re=this.rules.DefaultFontFamily);for(let be=0;be<((W=R.TextLines)===null||W===void 0?void 0:W.length);be++){const ae=R.TextLines[be],ge=this.calculatePixelDistance(ae.xOffset),le=new l.PointF2D(k.x+ge,k.y),Z=this.backend.renderText(G,ie,H,ae.text,Y,le,L,R.Label.fontFamily);$?$.appendChild(Z):$=Z,k.y=k.y+Y,R.TextLines.length>1&&(k.y+=this.rules.SpacingBetweenTextLines)}return $}renderRectangle(R,A,F,U,Y){return this.backend.renderRectangle(R,F,U,Y)}applyScreenTransformation(R){return new l.PointF2D(R.x*o.unitInPixels,R.y*o.unitInPixels)}applyScreenTransformationForRect(R){return new c.RectangleF2D(R.x*o.unitInPixels,R.y*o.unitInPixels,R.width*o.unitInPixels,R.height*o.unitInPixels)}}o.VexFlowMusicSheetDrawer=M},8494:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowMusicSystem=void 0;const u=r(7142),a=r(6894),g=r(7771),c=r(8129),l=r(5575),h=r(8939);class d extends u.MusicSystem{constructor(f,y){super(f),this.rules=y}calculateBorders(f){if(this.staffLines.length===0)return;const y=this.calcBracketsWidth();this.boundingBox.BorderLeft=-y,this.boundingBox.BorderMarginLeft=-y,this.boundingBox.XBordersHaveBeenSet=!0;const S=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=S,this.boundingBox.BorderMarginTop=S;const _=this.staffLines[this.staffLines.length-1],P=_.SkyBottomLineCalculator.getBottomLineMax()+_.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=P,this.boundingBox.BorderMarginBottom=P,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(f,y,S,_,P,w,x=void 0){const M=w;let N=!1;if(x&&(N=!0,x.lineTo(w,c.VexFlowConverter.line(S,_)),x.addMeasureLine(S,_),S===a.SystemLinesEnum.DotsBoldBoldDots)){const R=x.ParentStaffLine.Measures.indexOf(x)+1,A=x.ParentStaffLine.Measures[R],F=w.ParentStaffLine.Measures[R];A&&F&&(A.lineTo(F,c.VexFlowConverter.line(a.SystemLinesEnum.BoldThinDots,_)),A.addMeasureLine(a.SystemLinesEnum.BoldThinDots,_))}return M&&M.addMeasureLine(S,_,N),new g.SystemLine(S,_,this,w,x)}createInstrumentBracket(f,y){const S=f,_=y,P=new h.VexFlowInstrumentBrace(S,_);this.InstrumentBrackets.push(P)}createGroupBracket(f,y,S){const _=f,P=y;if(S===0){const w=new l.VexFlowInstrumentBracket(_,P,S);this.GroupBrackets.push(w)}else{const w=new h.VexFlowInstrumentBrace(_,P,S);this.GroupBrackets.push(w)}}}o.VexFlowMusicSystem=d},9520:function(b,o,r){var u=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowOctaveShift=void 0;var a=u(r(6368)).default.Flow;const g=r(873),c=r(5853),l=u(r(2043));class h extends g.GraphicalOctaveShift{constructor(E,f){switch(super(E,f),E.Type){case c.OctaveEnum.VA8:this.position=a.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case c.OctaveEnum.MA15:this.position=a.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case c.OctaveEnum.VB8:this.position=a.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case c.OctaveEnum.MB15:this.position=a.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:l.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(E){for(const f of E.graphicalVoiceEntries){const y=f;if(y!=null&&y.vfStaveNote)return this.startNote=y.vfStaveNote,!0}return!1}setEndNote(E){var f;for(const y of E.graphicalVoiceEntries){const S=y;if(S!=null&&S.vfStaveNote)return this.endNote=S.vfStaveNote,this.endMeasure=E.parentMeasure,!((f=this.endMeasure)===null||f===void 0)&&f.parentSourceMeasure.Rules.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure&&S.notes[0].sourceNote.isWholeMeasureNote()&&(this.graphicalEndAtMeasureEnd=!0),!0}return!1}getTextBracket(){let E,f=this.endNote;const y=this;this.graphicalEndAtMeasureEnd&&(E={getAbsoluteX:()=>10*(y.endMeasure.PositionAndShape.AbsolutePosition.x+y.endMeasure.PositionAndShape.Size.width),getGlyph:()=>({getWidth:()=>0})}),E&&(f=E);const S=new a.TextBracket({position:this.position,start:this.startNote,stop:f,superscript:this.supscript,text:this.text});return this.endsOnDifferentStaffLine&&(S.render_options.show_bracket=!1),S}}o.VexFlowOctaveShift=h},3010:function(b,o,r){var u=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowPedal=void 0;const a=u(r(6368)),g=r(8911),c=r(4082),l=r(158);class h extends c.GraphicalPedal{constructor(E,f,y=!1,S=!1){switch(super(E,f),this.vfStyle=a.default.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=E.ChangeBegin,this.ChangeEnd=E.ChangeEnd,this.pedalSymbol){case l.MusicSymbol.PEDAL_SYMBOL:this.vfStyle=a.default.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new g.BoundingBox(this,f);break;case l.MusicSymbol.PEDAL_MIXED:this.vfStyle=y&&S?a.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:y?a.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:S?a.default.Flow.PedalMarking.Styles.MIXED_OPEN_END:a.default.Flow.PedalMarking.Styles.MIXED;break;case l.MusicSymbol.PEDAL_BRACKET:default:this.vfStyle=y&&S?a.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:y?a.default.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:S?a.default.Flow.PedalMarking.Styles.BRACKET_OPEN_END:a.default.Flow.PedalMarking.Styles.BRACKET}}setStartNote(E){if(!E)return!1;for(const f of E.graphicalVoiceEntries){const y=f;if(y!=null&&y.vfStaveNote)return this.startNote=y.vfStaveNote,this.startVfVoiceEntry=y,!0}return!1}setEndNote(E){if(!E)return!1;for(const f of E.graphicalVoiceEntries){const y=f;if(y!=null&&y.vfStaveNote)return this.endNote=y.vfStaveNote,this.endVfVoiceEntry=y,!0}return!1}setEndMeasure(E){this.endMeasure=E}CalculateBoundingBox(){}setLine(E){this.line=E}getPedalMarking(){const E=new a.default.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&E.setEndStave(this.endMeasure.getVFStave()),E.setStyle(this.vfStyle),E.setLine(this.line),E.setCustomText(this.DepressText,this.ReleaseText),this.endVfVoiceEntry&&!this.getPedal.EndsStave||(E.EndsStave=!0),this.getPedal.BeginsStave&&(E.BeginsStave=!0),E.ChangeBegin=this.ChangeBegin,E.ChangeEnd=this.ChangeEnd,E}setEndsStave(E,f){f!=null&&f.gte(E.parentSourceMeasure.Duration)&&(this.getPedal.EndsStave=!0)}setBeginsStave(E,f){E&&f.RealValue===0&&(this.getPedal.BeginsStave=!0)}}o.VexFlowPedal=h},8041:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowSlur=o.CurvePositionEnum=void 0;var a,g=u(r(6368)).default.Flow;(function(l){l[l.NEAR_HEAD=1]="NEAR_HEAD",l[l.NEAR_TOP=2]="NEAR_TOP"})(a=o.CurvePositionEnum||(o.CurvePositionEnum={}));class c{constructor(h){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=h}static createFromVexflowSlur(h){return new c(h.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:a.NEAR_TOP,position_end:a.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new g.Curve(this.vfStartNote,this.vfEndNote,void 0)}}o.VexFlowSlur=c},9252:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowStaffEntry=void 0;const u=r(3023),a=r(5820),g=r(8640);class c extends u.GraphicalStaffEntry{constructor(h,d,E){super(h,d,E)}calculateXPosition(){const h=this.parentMeasure.getVFStave();let d=0;for(const E of this.graphicalVoiceEntries)if(E.vfStaveNote){if(E.vfStaveNote.setStave(h),!E.vfStaveNote.preFormatted)continue;E.applyBordersFromVexflow();let f=!1,y=this.PositionAndShape;E.notes[0].sourceNote.isWholeRest()&&!this.hasOnlyRests()&&(f=!0,y=E.PositionAndShape),this.parentMeasure.ParentStaff.isTab?y.RelativePosition.x=(E.vfStaveNote.getAbsoluteX()+E.vfStaveNote.glyph.getWidth())/a.unitInPixels:(y.RelativePosition.x=E.vfStaveNote.getBoundingBox().getX()/a.unitInPixels,f&&(y.RelativePosition.x-=h.getNoteStartX()/a.unitInPixels,y.RelativePosition.x-=1.3));const S=E.notes[0].sourceNote;S.isRest()&&S.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(y.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,E.PositionAndShape.BorderLeft=-.7,E.PositionAndShape.BorderRight=.7),E.PositionAndShape.BorderLefty.staffLine),E=this.calculateModifierXOffsets(d,1),f=this.calculateModifierXOffsets(d,.5);h.forEach((y,S)=>{y.baseFingeringXOffset=f[S],y.baseStringNumberXOffset=E[S]})}calculateModifierXOffsets(h,d){const E=[];for(let f=0;f=0;_--){if(Math.abs(h[f]-h[_])<=d&&y===E[_]){y++,S=!0;break}S=!1}E.push(y)}return E}}o.VexFlowStaffEntry=c},4828:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowStaffLine=void 0;const u=r(9953),a=r(449);class g extends u.StaffLine{constructor(l,h){super(l,h),this.slursInVFStaffLine=[],this.alignmentManager=new a.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(l){this.slursInVFStaffLine.push(l)}get AlignmentManager(){return this.alignmentManager}}o.VexFlowStaffLine=g},8790:function(b,o,r){var u=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowTabMeasure=void 0;var a=u(r(6368)).default.Flow;const g=r(7330),c=r(8129),l=u(r(2043));class h extends g.VexFlowMeasure{constructor(E,f=void 0,y=void 0){super(E,f,y),this.isTabMeasure=!0}resetLayout(){var E;const f=(E=this.ParentStaff.StafflineCount)!==null&&E!==void 0?E:6;this.stave=new a.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:f}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let f=0,y=this.staffEntries.length;f1){const w=c.VexFlowConverter.StrokeTypeFromArpeggioType(P.type),x=new a.Stroke(w,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&_.vfStaveNote.addStroke(0,x)}else l.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. + voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}if(_.vfGhostNotes)for(const P of _.vfGhostNotes)this.vfVoices[f.VoiceId].addTickable(P);else this.vfVoices[f.VoiceId].addTickable(_.vfStaveNote)}else if(_.vfGhostNotes)for(const P of _.vfGhostNotes)this.vfVoices[f.VoiceId].addTickable(P);else this.vfVoices[f.VoiceId].addTickable(_.vfStaveNote)}}}}o.VexFlowTabMeasure=h},2942:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowTextMeasurer=void 0;const u=r(8129);o.VexFlowTextMeasurer=class{constructor(a){this.fontSize=20,this.fontSizeStandard=this.fontSize;const g=document.createElement("canvas");this.context=g.getContext("2d"),this.rules=a}computeTextWidthToHeightRatio(a,g,c,l=void 0,h=this.fontSize){return this.context.font=u.VexFlowConverter.font(h,c,g,this.rules,l),this.context.measureText(a).width/h}setFontSize(a=this.fontSizeStandard){return this.fontSize=a,a}}},5460:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VexFlowVoiceEntry=void 0;const u=r(5974),a=r(5820),g=r(7459);class c extends u.GraphicalVoiceEntry{constructor(h,d,E){super(h,d,E)}applyBordersFromVexflow(){var h;const d=this.vfStaveNote;if(!d.getNoteHeadBeginX)return;const E=d.getBoundingBox(),f=d.getNoteHeadBeginX()-E.x;this.PositionAndShape.RelativePosition.y=E.y/a.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=E.h/a.unitInPixels;const y=(d.width-((h=d.paddingRight)!==null&&h!==void 0?h:0))/2;this.PositionAndShape.BorderLeft=-(f+y)/a.unitInPixels,this.PositionAndShape.BorderRight=(E.w-f)/a.unitInPixels}set vfStaveNote(h){this.mVexFlowStaveNote=h}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var h;const d=this.rules.DefaultColorNotehead,E=this.rules.DefaultColorRest,f=this.rules.DefaultColorStem,y="#00000000";let S,_;const P=this.vfStaveNote;for(let R=0;R{Object.defineProperty(o,"__esModule",{value:!0}),o.VexflowStafflineNoteCalculator=void 0;const u=r(8640),a=r(4679),g=r(1649),c=r(289),l=r(908);class h{constructor(E){this.staffPitchListMapping=new g.Dictionary,this.baseLineNote=u.NoteEnum.B,this.baseLineOctave=1,this.rules=E}trackNote(E){if(!(E instanceof a.VexFlowGraphicalNote)||E.Clef().ClefType!==c.ClefEnum.percussion||E.sourceNote.isRest()||this.rules.PercussionOneLineCutoff===0||this.rules.PercussionForceVoicesOneLineCutoff===-1)return;const f=E.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let y;this.staffPitchListMapping.containsKey(f)||this.staffPitchListMapping.setValue(f,new Array),y=this.staffPitchListMapping.getValue(f);const S=E.sourceNote.Pitch;h.findOrInsert(y,S)}static PitchIndexOf(E,f,y=0){if(y>E.length-1)return-1;for(let S=y;Sthis.rules.PercussionOneLineCutoff&&!S&&!this.rules.PercussionUseCajon2NoteSystem)return E;const _=E,P=E.sourceNote.Pitch;let w=this.baseLineNote,x=this.baseLineOctave;if(this.rules.PercussionUseCajon2NoteSystem?P.FundamentalNote===u.NoteEnum.C&&(w=u.NoteEnum.G,x=1):this.rules.PercussionUseXMLDisplayStep&&E.sourceNote.displayStepUnpitched!==void 0&&(w=E.sourceNote.displayStepUnpitched,x=E.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),y.length<=this.rules.PercussionForceVoicesOneLineCutoff)_.setAccidental(new u.Pitch(w,x,P.Accidental));else{const M=h.PitchIndexOf(y,P);if(M>-1){const N=Math.ceil(y.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(M>=N)switch(x=2,(M-N)%5){case 1:w=u.NoteEnum.E;break;case 2:w=u.NoteEnum.G;break;case 3:w=u.NoteEnum.B;break;case 4:w=u.NoteEnum.D,x=3;break;default:w=u.NoteEnum.C}else switch(M%5){case 1:w=u.NoteEnum.F;break;case 2:w=u.NoteEnum.D;break;case 3:w=u.NoteEnum.B,x=0;break;case 4:w=u.NoteEnum.G,x=0;break;default:w=u.NoteEnum.A}const R=new u.Pitch(w,x,P.Accidental);_.setAccidental(R);const A=_.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&A.Notes.length<2&&(R.Octave>this.baseLineOctave||R.FundamentalNote===this.baseLineNote&&R.Octave===this.baseLineOctave?_.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=l.StemDirectionType.Up:_.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=l.StemDirectionType.Down)}}return _}getStafflineUniquePositionCount(E){return this.staffPitchListMapping.containsKey(E)?this.staffPitchListMapping.getValue(E).length:0}}o.VexflowStafflineNoteCalculator=h},9839:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(449),o),a(r(4028),o),a(r(9505),o),a(r(709),o),a(r(9344),o),a(r(8129),o),a(r(3602),o),a(r(4679),o),a(r(8144),o),a(r(6351),o),a(r(8939),o),a(r(5575),o),a(r(7330),o),a(r(4405),o),a(r(8738),o),a(r(5820),o),a(r(8494),o),a(r(9520),o),a(r(8041),o),a(r(9252),o),a(r(4828),o),a(r(7781),o),a(r(8790),o),a(r(2942),o),a(r(5460),o)},7636:function(b,o,r){var u=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(o,"__esModule",{value:!0}),o.WebGLSkyBottomLineBatchCalculatorBackend=void 0;const a=r(1378),g=r(9531),c=u(r(6357)),l=u(r(6150)),h=u(r(2043)),d=r(2337);function E(y,S,_){const P=y.createShader(S);if(!P)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL shader"),new Error("Could not create a WebGL shader");if(y.shaderSource(P,_),y.compileShader(P),!y.getShaderParameter(P,y.COMPILE_STATUS))throw h.default.warn(`Shader compilation failed +`+y.getShaderInfoLog(P)),y.deleteShader(P),new Error("WebGL shader compilation failed");return P}class f extends g.SkyBottomLineBatchCalculatorBackend{constructor(S,_){super(S,_)}getPreferredRenderingConfiguration(S,_){const P=Math.min(4096,function(){const x=document.createElement("canvas").getContext("webgl");return x.getParameter(x.MAX_TEXTURE_SIZE)}()),w=Math.ceil(S);return{elementWidth:w,numColumns:Math.min(5,Math.floor(P/w)),numRows:Math.min(5,Math.floor(P/_))}}onInitialize(S){const{elementWidth:_,elementHeight:P,numColumns:w,numRows:x}=S,M=document.createElement("canvas");M.width=_*w,M.height=x;const N=M.getContext("webgl");if(!N)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: No WebGL support"),new Error("No WebGL support");this.gl=N;const R=function(A,F,U){const Y=A.createProgram();if(!Y)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: Could not create a WebGL program"),new Error("Could not create a WebGL program");if(A.attachShader(Y,F),A.attachShader(Y,U),A.linkProgram(Y),!A.getProgramParameter(Y,A.LINK_STATUS))throw h.default.warn(`WebGLSkyBottomLineCalculatorBackend: WebGL program link failed +`+A.getProgramInfoLog(Y)),A.deleteProgram(Y),new Error("WebGL program link failed");return Y}(N,E(N,N.VERTEX_SHADER,c.default),E(N,N.FRAGMENT_SHADER,function(A,F){let U=A;for(const[Y,k]of Object.entries(F)){const W=new RegExp(`#define ${Y} .*`);U=U.replace(W,`#define ${Y} ${k}`)}return U}(l.default,{NUM_ROWS:x,ELEMENT_HEIGHT:P})));(function(A,F,U,Y){const k=A.createBuffer();if(!k)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL buffer creation failed"),new Error("WebGL buffer creation failed");A.bindBuffer(A.ARRAY_BUFFER,k),A.bufferData(A.ARRAY_BUFFER,new Float32Array(d.CollectionUtil.flat([[-1,-1],[1,-1],[1,1],[-1,-1],[1,1],[-1,1]])),A.STATIC_DRAW),A.useProgram(F);const W=A.getAttribLocation(F,"a_position");A.enableVertexAttribArray(W),A.vertexAttribPointer(W,2,A.FLOAT,!1,0,0)})(N,R),this.texture=function(A,F,U,Y){const k=A.createTexture();if(!k)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL texture creation failed"),new Error("WebGL texture creation failed");A.activeTexture(A.TEXTURE0+0),A.bindTexture(A.TEXTURE_2D,k),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.NEAREST),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.NEAREST);const W=A.getUniformLocation(F,"u_image");if(!W)throw h.default.warn("WebGLSkyBottomLineCalculatorBackend: WebGL invalid uniform name"),new Error("WebGL invalid uniform name");return A.uniform1i(W,0),k}(N,R)}calculateFromCanvas(S,_,P,w,x){const M=this.gl,{elementWidth:N,elementHeight:R,numColumns:A}=x;M.viewport(0,0,M.canvas.width,M.canvas.height),M.bindTexture(M.TEXTURE_2D,this.texture),M.texImage2D(M.TEXTURE_2D,0,M.RGBA,M.RGBA,M.UNSIGNED_BYTE,S),M.drawArrays(M.TRIANGLES,0,6);const F=new Uint8Array(M.canvas.width*M.canvas.height*4);M.readPixels(0,0,M.canvas.width,M.canvas.height,M.RGBA,M.UNSIGNED_BYTE,F);const U=[];for(let Y=0;Y{Object.defineProperty(o,"__esModule",{value:!0}),o.Instrument=void 0;const u=r(884),a=r(2255),g=r(0);class c extends u.InstrumentalGroup{constructor(h,d,E,f){super(void 0,E,f),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=h,this.idString=d,this.nameLabel=new a.Label(d)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(h){this.hasLyrics=h}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(h){this.hasChordSymbols=h}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(h){this.lyricVersesNumbers=h}get Name(){return this.nameLabel.text}set Name(h){this.nameLabel.text=h}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(h){this.subInstruments[0].midiInstrumentID=h}get Volume(){return this.subInstruments[0].volume}set Volume(h){for(let d=0,E=this.subInstruments.length;d0&&this.Voices[0].Visible}set Visible(h){for(let d=0,E=this.Voices.length;d{Object.defineProperty(o,"__esModule",{value:!0}),o.InstrumentalGroup=void 0,o.InstrumentalGroup=class{constructor(r,u,a){this.instrumentalGroups=[],this.name=r,this.musicSheet=u,this.parent=a}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(r){this.name=r}get GetMusicSheet(){return this.musicSheet}}},1035:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AClassHierarchyTrackable=void 0,o.AClassHierarchyTrackable=class{isInstanceOfClass(r){let u=this.constructor.prototype;for(;u;){if(r===u.constructor.name)return!0;u=u.__proto__}return!1}}},9603:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},7058:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},6287:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},4543:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},4207:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},6331:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ITextTranslation=void 0,o.ITextTranslation=class{static translateText(r,u){if(!this.defaultTextTranslation)return u}}},9984:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},4854:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},4143:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(9603),o),a(r(7058),o),a(r(6287),o),a(r(4207),o),a(r(6331),o),a(r(9984),o),a(r(4854),o),a(r(1035),o),a(r(4543),o)},2255:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Label=void 0;const u=r(1274);o.Label=class{constructor(a="",g=u.TextAlignmentEnum.CenterBottom,c=void 0,l=!0){this.IsCreditLabel=!1,this.text=a,this.print=l,this.textAlignment=g,this.font=c,this.fontFamily=void 0}ToString(){return this.text}}},5278:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimestampTransform=o.MusicPartManager=void 0;const u=r(1797),a=r(301);o.MusicPartManager=class{constructor(c){this.musicSheet=c}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new u.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(c){let l;for(let h=this.timestamps.length-1;h>=0;h--)if(l=this.timestamps[h],c.gte(l.$from))return l;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(c){if(this.timestamps.length===0)return c;const l=this.getCurrentRepetitionTimestampTransform(c);return u.Fraction.plus(c,u.Fraction.minus(l.to,l.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(c){return c?new a.MusicPartManagerIterator(this.musicSheet,c,void 0):new a.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(c){this.musicSheet.SelectionStart=c,this.musicSheet.SelectionEnd=void 0}setSelectionRange(c,l){this.musicSheet.SelectionStart=c??this.sheetStart,this.musicSheet.SelectionEnd=l??this.sheetEnd}calcMapping(){const c=[],l=this.getIterator();let h=l.CurrentRepetition,d=new g(l.CurrentEnrolledTimestamp.clone(),l.CurrentSourceTimestamp.clone(),void 0,0);for(c.push(d);!l.EndReached;){if(l.JumpOccurred||h!==l.CurrentRepetition){if(h=l.CurrentRepetition,l.backJumpOccurred){const E=l.JumpResponsibleRepetition;d.nextBackJump=l.CurrentEnrolledTimestamp,d.curRepetition=E,d.curRepetitionIteration=l.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let f=this.timestamps.length-2;f>=0&&!c[f].to.lt(E.AbsoluteTimestamp)&&!c[f].curRepetition;f--)c[f].nextBackJump=d.nextBackJump,c[f].curRepetition=E,c[f].curRepetitionIteration=d.curRepetitionIteration}d=new g(l.CurrentEnrolledTimestamp.clone(),l.CurrentSourceTimestamp.clone(),void 0,0),c.push(d)}l.moveToNext()}this.timestamps=c}};class g{constructor(l,h,d,E){this.$from=l,this.to=h,this.curRepetition=d,this.curRepetitionIteration=E,this.nextBackJump=void 0,this.nextForwardJump=void 0}}o.TimestampTransform=g},301:function(b,o,r){var u=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(o,"__esModule",{value:!0}),o.MusicPartManagerIterator=void 0;const a=r(1797),g=r(5356),c=r(3331),l=r(7839),h=u(r(2043));class d{constructor(f,y,S){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new a.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new a.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new a.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new a.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[],this.SkipInvisibleNotes=!0;try{this.frontReached=!0,this.musicSheet=f,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const _ of this.musicSheet.Repetitions)this.setRepetitionIterationCount(_,1);if(this.activeDynamicExpressions=new Array(this.musicSheet.getCompleteNumberOfStaves()),this.currentMeasure=this.musicSheet.SourceMeasures[0],!y)return;do this.moveToNext();while((!this.currentVoiceEntries||this.currentTimeStamp.lt(y))&&!this.endReached);for(let _=0;_=this.JumpResponsibleRepetition.StartIndex&&_.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(_)}}handleRepetitionsAtMeasureEnd(){for(let f=0,y=this.currentMeasure.LastRepetitionInstructions.length;f-1&&this.getRepetitionIterationCount(_)<_.UserNumberOfRepetitions)return this.doBackJump(_),void(this.backJumpOccurred=!0);if(S===_.forwardJumpInstruction){this.JumpResponsibleRepetition!==void 0&&_!==this.JumpResponsibleRepetition&&_.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&_.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(_);const P=_.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(_));if(P>=0)return this.currentMeasureIndex=P,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=_,void(this.forwardJumpOccurred=!0);P===-2&&(this.endReached=!0)}}}this.currentMeasureIndex++,this.JumpResponsibleRepetition!==void 0&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(f){this.currentMeasureIndex=f.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(f),this.jumpResponsibleRepetition=f}activateCurrentRhythmInstructions(){if(this.currentMeasure!==void 0&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&this.currentMeasure.FirstInstructionsStaffEntries[0]!==void 0){const f=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let y=0,S=f.length;y0&&(this.currentDynamicEntryIndex>=f.length||this.CurrentSourceTimestamp.lte(f[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=y.length||this.CurrentSourceTimestamp.lte(y[this.currentTempoEntryIndex].AbsoluteTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex0){this.currentVoiceEntryIndex--;const f=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(f),this.currentVerticalContainerInMeasureTimestamp=f.Timestamp,this.currentTimeStamp=a.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.activateCurrentDynamicOrTempoInstructions();const y=this.musicSheet.SelectionEnd;return y&&this.currentTimeStamp.lt(y)&&(this.endReached=!1),void(this.currentMeasureIndex=this.musicSheet.SourceMeasures.indexOf(this.CurrentMeasure))}if(this.currentVoiceEntryIndex!==0||this.currentMeasureIndex===0)this.frontReached=!0,this.currentTimeStamp=new a.Fraction(-1,1);else{const f=this.musicSheet.SourceMeasures[this.currentMeasureIndex-1];this.currentMeasureIndex--,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex];const y=f.VerticalSourceStaffEntryContainers[f.VerticalSourceStaffEntryContainers.length-1];this.currentVoiceEntries=this.getVoiceEntries(y),this.currentVerticalContainerInMeasureTimestamp=y.Timestamp,this.currentVoiceEntryIndex=f.VerticalSourceStaffEntryContainers.length-1,this.currentTimeStamp=a.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,y.Timestamp),this.activateCurrentDynamicOrTempoInstructions();const S=this.musicSheet.SelectionEnd;S&&this.currentTimeStamp.lt(S)&&(this.endReached=!1)}}recursiveMove(){if(this.currentVoiceEntryIndex++,this.currentVoiceEntryIndex===0&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!f)return!0;for(let S=0,_=y.length;S<_;++S)if(y[S].Notes[0].Pitch)return!0}return!1}getVisibleEntries(f,y){if(f.ParentVoice.Visible){let S=!1;for(const _ of f.Notes)if(_.PrintObject){S=!0;break}if(!S&&this.SkipInvisibleNotes)return;y.push(f)}}getAudibleEntries(f,y){f.ParentVoice.Audible&&y.push(f)}getScoreFollowingEntries(f,y){f.ParentVoice.Following&&f.ParentVoice.Parent.Following&&y.push(f)}getVoiceEntries(f){const y=[];for(const S of f.StaffEntries)if(S)for(const _ of S.VoiceEntries)y.push(_);return y}}o.MusicPartManagerIterator=d},4257:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(5278),o),a(r(301),o)},7514:function(b,o,r){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSheet=o.PlaybackSettings=void 0;const a=r(1797),g=r(5278),c=r(1717),l=r(2255),h=r(3884),d=r(9651),E=r(1405),f=r(8155),y=u(r(2043)),S=r(1274);class _{}o.PlaybackSettings=_;class P{constructor(){this.idString="uninitialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new d.MusicSheetErrors,this.staves=[],this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new a.Fraction(0,1),this.playbackSettings=new _,this.playbackSettings.rhythm=new a.Fraction(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new g.MusicPartManager(this),this.hasBPMInfo=!1}static getIndexFromStaff(x){return x.idInMusicSheet}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(x){this.sourceMeasures=x}get Repetitions(){return this.repetitions}set Repetitions(x){this.repetitions=x}get DynListStaves(){return this.dynListStaves}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(x){this.playbackSettings=x}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(x){this.drawErroneousMeasures=x}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(x){this.hasBeenOpenedForTheFirstTime=x}InitializeStartTempoInBPM(x){this.userStartTempoInBPM=x}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(x){this.defaultStartTempoInBpm=x,this.InitializeStartTempoInBPM(x)}get Path(){return this.path}set Path(x){this.path=x}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(x){this.Title=new l.Label(x)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(x){this.Subtitle=new l.Label(x)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(x){this.Composer=new l.Label(x)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(x){this.Lyricist=new l.Label(x)}get CopyrightString(){return this.copyright?this.copyright.text:""}set CopyrightString(x){this.Copyright=new l.Label(x,S.TextAlignmentEnum.CenterBottom,void 0,!0)}get Title(){return this.title}set Title(x){this.title=x}get Subtitle(){return this.subtitle}set Subtitle(x){this.subtitle=x}get Composer(){return this.composer}set Composer(x){this.composer=x}get Lyricist(){return this.lyricist}set Lyricist(x){this.lyricist=x}get Copyright(){return this.copyright}set Copyright(x){this.copyright=x}get Rules(){return this.rules||(y.default.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new E.EngravingRules),this.rules}set Rules(x){this.rules=x}get SheetErrors(){return this.musicSheetErrors}get SelectionStart(){return this.selectionStart}set SelectionStart(x){this.selectionStart=x.clone(),this.currentEnrolledPosition=x.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(x){this.selectionEnd=x}set HasBPMInfo(x){this.hasBPMInfo=x}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(x){this.sourceMeasures.push(x),x.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let x=0,M=this.instruments.length;x0){const x=this.TimestampSortedTempoExpressionsList[0];if(x.InstantaneousTempo)return x.InstantaneousTempo.TempoInBpm;if(x.ContinuousTempo)return x.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(x){return y.default.info("MusicSheet.FirstMeasureNumber: ",x),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(x){return y.default.info("MusicSheet.LastMeasureNumber: ",x),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(x){this.currentEnrolledPosition=x.clone()}get Transpose(){return this.transpose}set Transpose(x){this.transpose=x}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(x){this.idString=x}getEnrolledSelectionStartTimeStampWorkaround(){const x=this.MusicPartManager.getIterator(this.SelectionStart);return a.Fraction.createFromFraction(x.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const x=this.getLastSourceMeasure();return a.Fraction.plus(x.AbsoluteTimestamp,x.Duration)}getSourceMeasureFromTimeStamp(x){for(let M=0,N=this.sourceMeasures.length;M0&&R.Voices[0].Visible&&x.push(R)}return x}}o.MusicSheet=P,P.defaultTitle="defaultTitle"},6656:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MappingSourceMusicPart=void 0,o.MappingSourceMusicPart=class{constructor(r,u,a,g=-1,c=!1){this.repetitionRun=-1,this.sourceMusicPart=r,this.parentPartListEntry=a,this.startTimestamp=u.clone(),this.repetitionRun=g,this.parentRepetition=a,this.isEnding=c}get IsRepetition(){return this.parentRepetition!==void 0}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(r){return r?this.startTimestamp.CompareTo(r.startTimestamp):1}}},3766:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PartListEntry=void 0,o.PartListEntry=class{constructor(r){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=r}get Visible(){return this.visible}set Visible(r){this.visible=r}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},1717:function(b,o,r){var u=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(o,"__esModule",{value:!0}),o.RepetitionEndingPart=o.Repetition=void 0;const a=r(8817),g=r(1797),c=r(3766),l=u(r(2043));class h extends c.PartListEntry{constructor(f,y){super(f),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=f,this.virtualOverallRepetition=y}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(f){this.visibles=f}get DefaultNumberOfRepetitions(){let f=2;return this.virtualOverallRepetition&&(f=1),Math.max(f,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(f){this.userNumberOfRepetitions=f,this.repetitonIterationOrder=[];const y=this.userNumberOfRepetitions-this.NumberOfEndings;for(let S=1;S<=this.userNumberOfRepetitions;S++)S<=y?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(S-y)}getForwardJumpTargetForIteration(f){const y=this.repetitonIterationOrder[f-1];return this.endingIndexDict[y]?this.endingIndexDict[y].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}SetEndingStartIndex(f,y){const S=new d(new a.SourceMusicPart(this.musicSheet2,y,y));this.endingParts.push(S);for(const _ of f)try{this.endingIndexDict[_]=S,S.endingIndices.push(_),this.numberOfEndings<_&&(this.numberOfEndings=_)}catch(P){l.default.error("Repetition: Exception.",P)}}setEndingEndIndex(f,y){this.endingIndexDict[f]&&this.endingIndexDict[f].part.setEndIndex(y)}get NumberOfEndings(){return this.numberOfEndings}get FromWords(){return this.fromWords}set FromWords(f){this.fromWords=f}get AbsoluteTimestamp(){return g.Fraction.createFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp)}get StartIndex(){return this.startMarker.measureIndex}get EndIndex(){if(this.BackwardJumpInstructions.length===0)return this.StartIndex;let f=this.backwardJumpInstructions[this.backwardJumpInstructions.length-1].measureIndex;return this.endingIndexDict[this.NumberOfEndings]&&(f=Math.max(this.endingIndexDict[this.NumberOfEndings].part.EndIndex,f)),f}checkRepetitionForMultipleLyricVerses(){let f=0;const y=this.StartIndex,S=this.EndIndex;for(let _=y;_<=S;_++){const P=this.musicSheet2.SourceMeasures[_];for(let w=0;w{Object.defineProperty(o,"__esModule",{value:!0}),o.SourceMusicPart=void 0;const u=r(3766),a=r(1797);class g extends u.PartListEntry{constructor(l,h,d){super(l),this.musicSheet=l,this.startIndex=h,this.endIndex=d}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(l){this.parentRepetition=l}get AbsoluteTimestamp(){return a.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(l){this.startIndex=l}setEndIndex(l){this.endIndex=l}}o.SourceMusicPart=g},4990:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(6656),o),a(r(3766),o),a(r(1717),o),a(r(8817),o)},2393:function(b,o,r){var u=this&&this.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(o,"__esModule",{value:!0}),o.InstrumentReader=void 0;const a=r(8109),g=r(9050),c=r(289),l=r(5198),h=r(3331),d=r(1797),E=r(6331),f=r(1703),y=r(289),S=r(3331),_=r(5198),P=u(r(2043)),w=r(289),x=r(2905),M=r(4671),N=r(3755),R=r(908),A=r(2478),F=r(6894);o.InstrumentReader=class{constructor(U,Y,k,W){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.repetitionInstructionReader=Y,this.xmlMeasureList=k,this.musicSheet=W.GetMusicSheet,this.instrument=W,this.activeClefs=new Array(W.Staves.length),this.activeClefsHaveBeenInitialized=new Array(W.Staves.length);for(let G=0;G=this.xmlMeasureList.length)return!1;this.currentMeasure=U,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(U,this.currentXmlMeasureIndex);let L=new d.Fraction(0,1),$=new d.Fraction(0,1),ie=!1;this.maxTieNoteFraction=new d.Fraction(0,1);let re=!1;try{const be=this.xmlMeasureList[this.currentXmlMeasureIndex],ae=be.elements();if(U.Rules.UseXMLMeasureNumbers&&!Number.isInteger(U.MeasureNumberXML)){const le=parseInt((W=be.attribute("number"))===null||W===void 0?void 0:W.value,10);Number.isInteger(le)&&(U.MeasureNumberXML=le)}let ge;for(let le=0;le0&&(ge=ae[le-1]),Z.name==="print"){const ye=Z.attribute("new-system");(ye==null?void 0:ye.value)==="yes"&&(U.printNewSystemXml=!0);const Se=Z.attribute("new-page");(Se==null?void 0:Se.value)==="yes"&&(U.printNewPageXml=!0)}else if(Z.name==="attributes"){const ye=Z.element("divisions");if(ye&&(this.divisions=parseInt(ye.value,10),isNaN(this.divisions))){const ee=E.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(P.default.debug("InstrumentReader.readNextXmlMeasure",ee),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw ie=!0,new f.MusicSheetReadingException(ee+this.instrument.Name);this.musicSheet.SheetErrors.push(ee+this.instrument.Name)}if(!Z.element("divisions")&&this.divisions===0&&this.currentXmlMeasureIndex===0){const ee=E.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw ie=!0,new f.MusicSheetReadingException(ee+this.instrument.Name);this.musicSheet.SheetErrors.push(ee+this.instrument.Name)}this.addAbstractInstruction(Z,k,ge,L.clone()),L.Equals(new d.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],Z)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],Z,L)&&this.saveClefInstructionAtEndOfMeasure();const Se=Z.elements("staff-details");for(const ee of Se){const ne=ee.element("staff-lines");if(ne){let O=1;const z=ee.attribute("number");z&&(O=parseInt(z.value,10)),this.instrument.Staves[O-1].StafflineCount=parseInt(ne.value,10)}}const X=Z.element("measure-style");if(X){const ee=X.element("multiple-rest");if(ee){const ne=ee.value;let O=0;try{O=Number.parseInt(ne,10),U.multipleRestMeasures!==void 0&&O!==U.multipleRestMeasures?U.multipleRestMeasures=0:(U.multipleRestMeasures=O,this.currentMultirestStartMeasure=U,this.followingMultirestMeasures=O+1)}catch(z){console.log("multirest parse error: "+z)}}}}else if(Z.name==="note"){let ye=!0;((G=Z.attribute("print-object"))===null||G===void 0?void 0:G.value)==="no"&&(ye=!1);const Se=this.getNoteStaff(Z);this.currentStaff=this.instrument.Staves[Se-1];const X=Z.element("chord")!==void 0;if(Z.element("voice")){const it=parseInt(Z.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(it,Se-1)}else X&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,Se-1));let ee,ne=0,O=new d.Fraction(0,1),z=2,K=!1;if(Z.element("duration")){if(ne=parseInt(Z.element("duration").value,10),isNaN(ne)){const it=E.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(it),P.default.debug("InstrumentReader.readNextXmlMeasure",it);continue}if(O=new d.Fraction(ne,4*this.divisions),ne===0?O=this.getNoteDurationFromTypeNode(Z):ee=this.getNoteDurationFromTypeNode(Z),Z.element("time-modification")){O=this.getNoteDurationForTuplet(Z);const it=Z.element("time-modification");it!=null&&it.element("normal-notes")&&(z=parseInt(it.element("normal-notes").value,10)),K=!0}}const q=Z.element("rest")!==void 0,de=Z.combinedElement("notations"),ue=Z.element("grace")!==void 0||ne===0||X&&re;let ce=!1,pe=!1;if(ue){const it=Z.element("grace");it&&it.attributes()&&it.attribute("slash")&&it.attribute("slash").value==="yes"&&(ce=!0),O=this.getNoteDurationFromTypeNode(Z),de&&de.element("slur")&&(pe=!0)}const[we,Me]=this.getCueNoteAndNoteTypeXml(Z),[ze,De,Qe]=this.getStemDirectionAndColors(Z);let ke,We=!1;if(de){const it=de.element("ornaments");it&&(ke=this.getTremoloInfo(it),We=this.getVibratoStrokes(it))}const qe=X?$.clone():L.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(qe,this.inSourceMeasureInstrumentIndex+Se-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!X&&!ue&&!re||ue&&!re||ue&&!X||!ue&&re)&&this.currentVoiceGenerator.createVoiceEntry(qe,this.currentStaffEntry,!q&&!ue,ue,ce,pe),ue||X||($=L.clone(),L.Add(O)),X&&this.currentStaffEntry!==void 0&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+Se-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const Ye=this.currentStaffEntry!==void 0&&this.currentStaffEntry.Timestamp!==void 0&&this.currentStaffEntry.Timestamp.Equals(new d.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,Ye),this.activeRhythm,K||ue||(O=new d.Fraction(ne,4*this.divisions));const Je=Z.elements("dot").length;if(this.currentVoiceGenerator.read(Z,O,ee,Me,z,q,this.currentStaffEntry,this.currentMeasure,Y,this.maxTieNoteFraction,X,k,ye,we,ue,ze,ke,De,Qe,We,Je),de!==void 0&&de.element("dynamics")){const it=this.expressionReaders[this.readExpressionStaffNumber(Z)-1];it&&(it.readExpressionParameters(Z,this.instrument,this.divisions,L,$,this.currentMeasure.MeasureNumber,!1),it.read(Z,this.currentMeasure,$))}re=ue}else if(Z.name==="forward"){const ye=parseInt(Z.element("duration").value,10);L.Add(new d.Fraction(ye,4*this.divisions))}else if(Z.name==="backup"){const ye=parseInt(Z.element("duration").value,10);L.Sub(new d.Fraction(ye,4*this.divisions)),L.IsNegative()&&(L=new d.Fraction(0,1)),$.Sub(new d.Fraction(ye,4*this.divisions)),$.IsNegative()&&($=new d.Fraction(0,1))}else if(Z.name==="direction"){const ye=Z.element("direction-type");let Se=Math.min(1,L.RealValue);this.activeRhythm!==void 0&&this.activeRhythm.Rhythm&&(Se/=this.activeRhythm.Rhythm.RealValue);let X=!1;if(this.repetitionInstructionReader&&(X=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(ye,Se)),!X){let ee=this.expressionReaders[0];const ne=this.readExpressionStaffNumber(Z)-1;ne0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const k=new c.ClefInstruction(y.ClefEnum.G,0,2);let W;Y.FirstInstructionsStaffEntries[U]?(W=Y.FirstInstructionsStaffEntries[U],W.removeFirstInstructionOfTypeClefInstruction()):(W=new g.SourceStaffEntry(void 0,void 0),Y.FirstInstructionsStaffEntries[U]=W),k.Parent=W,W.Instructions.splice(0,0,k)}createDefaultKeyInstruction(){let U;U=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const Y=new l.KeyInstruction(void 0,0,_.KeyEnum.major);for(let k=this.inSourceMeasureInstrumentIndex;k0&&k[W-1].name==="backup")return!0;let G=-1;for(let H=0;H0||G<0}isAttributesNodeAtEndOfMeasure(U,Y,k){var W;if(k.Equals((W=this.ActiveRhythm)===null||W===void 0?void 0:W.Rhythm))return!0;const G=U.elements().slice();let H=0;for(let $=0;$L}getNoteDurationFromTypeNode(U){const Y=U.element("type");if(Y){const k=Y.value;return A.NoteTypeHandler.getNoteDurationFromType(k)}return new d.Fraction(0,4*this.divisions)}addAbstractInstruction(U,Y,k,W){if(U.element("divisions")&&U.elements().length===1)return;const G=U.element("transpose");if(G){const $=G.element("chromatic");$&&(this.instrument.PlaybackTranspose=parseInt($.value,10))}const H=U.elements("clef");let L;if(H.length>0)for(let $=0,ie=H.length;$this.currentClefNumber&&(ge=this.currentClefNumber),this.currentClefNumber=ge+1}catch{L=E.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(L),ge=1,this.currentClefNumber=ge+1}const X=new c.ClefInstruction(be,le,ae);this.abstractInstructions.push([ge,X,W])}if(U.element("key")!==void 0&&this.instrument.MidiInstrumentId!==w.MidiInstrument.Percussion){let $=0;const ie=U.element("key").element("fifths");if(ie)try{$=parseInt(ie.value,10)}catch(ge){L=E.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(L),$=0,P.default.debug("InstrumentReader.addAbstractInstruction",L,ge)}let re=_.KeyEnum.none,be=U.element("key");if(be&&(be=be.element("mode")),be)try{re=_.KeyEnum[be.value]}catch(ge){L=E.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key/mode. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(L),re=_.KeyEnum.major,P.default.debug("InstrumentReader.addAbstractInstruction",L,ge)}const ae=new l.KeyInstruction(void 0,$,re);this.abstractInstructions.push([1,ae,W])}if(U.element("time")){const $=U.element("time");let ie=S.RhythmSymbolEnum.NONE,re=!0;if($!==void 0&&$.hasAttributes){const Se=$.attribute("symbol");Se&&(Se.value==="common"?ie=S.RhythmSymbolEnum.COMMON:Se.value==="cut"&&(ie=S.RhythmSymbolEnum.CUT));const X=$.attribute("print-object");X&&X.value==="no"&&(re=!1)}let be=0,ae=0;const ge=$&&$.element("senza-misura")!==void 0,le=U.elements("time"),Z=[],ye=[];for(let Se=0,X=le.length;Se0&&ye!==void 0&&Z.length===ye.length){const X=Z.length,ee=new Array(X);let ne=0;for(let O=0;O=0;k--){const W=this.abstractInstructions[k],G=W[0],H=W[1],L=W[2];if(H instanceof c.ClefInstruction){const $=H;if(this.currentXmlMeasureIndex===0||G<=this.activeClefs.length&&$!==this.activeClefs[G-1])if(Y||this.currentStaffEntry===void 0||this.currentStaffEntry.hasNotes()||G-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff))if(Y){if(L.RealValue!==0)continue;let ie;if(this.currentMeasure){const re=$,be=this.inSourceMeasureInstrumentIndex+G-1,ae=this.currentMeasure.FirstInstructionsStaffEntries[be];if(this.currentXmlMeasureIndex===0)if(ae)if(this.currentMeasure.FirstInstructionsStaffEntries[be]===void 0||ae.Instructions[0]instanceof c.ClefInstruction){const ge=new g.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[be]=ge,re.Parent=ge,ge.Instructions.push(re)}else ie=ae,re.Parent=ie,ie.removeFirstInstructionOfTypeClefInstruction(),ie.Instructions.splice(0,0,re),this.activeClefsHaveBeenInitialized[G-1]=!0;else ie=new g.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[be]=ie,re.Parent=ie,ie.Instructions.push(re),this.activeClefsHaveBeenInitialized[G-1]=!0;else if(this.activeClefsHaveBeenInitialized[G-1]){let ge=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(ge=this.currentMultirestStartMeasure);const le=new g.SourceStaffEntry(void 0,void 0);ge.LastInstructionsStaffEntries[be]=le,re.Parent=le,le.Instructions.push(re)}else{const ge=this.musicSheet.SourceMeasures[0];ge.FirstInstructionsStaffEntries[be]?(ie=ge.FirstInstructionsStaffEntries[be],ie.removeFirstInstructionOfTypeClefInstruction()):ie=new g.SourceStaffEntry(void 0,void 0),re.Parent=ie,ie.Instructions.splice(0,0,re),this.activeClefsHaveBeenInitialized[G-1]=!0}this.activeClefs[G-1]=$,this.abstractInstructions.splice(k,1)}}else{let ie;const re=this.activeRhythm.Rhythm;re.RealValue>0&&L.RealValue/re.RealValue>.9&&re.RealValue!==L.RealValue&&(this.currentMeasure.LastInstructionsStaffEntries[G-1]||(this.currentMeasure.LastInstructionsStaffEntries[G-1]=new g.SourceStaffEntry(void 0,this.instrument.Staves[G-1])),ie=this.currentMeasure.LastInstructionsStaffEntries[G-1]),ie&&($.Parent=ie,ie.Instructions.push($),this.activeClefs[G-1]=$,this.abstractInstructions.splice(k,1))}else{const ie=$,re=this.currentStaffEntry;if(L&&Math.abs(L.RealValue-re.Timestamp.RealValue)>.01)continue;ie.Parent=re,re.removeFirstInstructionOfTypeClefInstruction(),re.Instructions.push(ie),this.activeClefs[G-1]=$,this.abstractInstructions.splice(k,1)}else G<=this.activeClefs.length&&$===this.activeClefs[G-1]&&this.abstractInstructions.splice(k,1)}if(H instanceof l.KeyInstruction){const $=H;if(this.activeKey&&this.activeKey.Key===$.Key)this.abstractInstructions.splice(k,1);else{let ie;if(this.activeKey=$,this.abstractInstructions.splice(k,1),this.activeKeyHasBeenInitialized?ie=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,ie=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),ie)for(let re=this.inSourceMeasureInstrumentIndex;re=0;U--){const Y=this.abstractInstructions[U][0],k=this.abstractInstructions[U][1];if(k instanceof c.ClefInstruction){const W=k;if(!this.activeClefs[Y-1]||W.ClefType!==this.activeClefs[Y-1].ClefType||W.ClefType===this.activeClefs[Y-1].ClefType&&W.Line!==this.activeClefs[Y-1].Line){const G=new g.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+Y-1]=G;const H=W;H.Parent=G,G.Instructions.push(H),this.activeClefs[Y-1]=W,this.abstractInstructions.splice(U,1)}}}}getNoteDurationForTuplet(U){let Y=new d.Fraction(0,1);const k=this.getNoteDurationFromTypeNode(U);if(U.element("time-modification")){const W=U.element("time-modification");if(W&&W.element("actual-notes")!==void 0&&W.element("normal-notes")){const G=W.element("actual-notes"),H=W.element("normal-notes");if(G!==void 0&&H){const L=parseInt(G.value,10),$=parseInt(H.value,10);Y=new d.Fraction($*k.Numerator,L*k.Denominator)}}}return Y}readExpressionStaffNumber(U){let Y=1;if(U.element("staff")){const k=U.element("staff");if(k)try{Y=parseInt(k.value,10)}catch(W){const G=E.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number. Set to default.");this.musicSheet.SheetErrors.pushMeasureError(G),Y=1,P.default.debug("InstrumentReader.readExpressionStaffNumber",G,W)}}return Y}readDivisionsFromNotes(){let U=0,Y=this.currentXmlMeasureIndex,k=!1;for(;!k;){const W=this.xmlMeasureList[Y].elements();for(let G=0,H=W.length;G0){k=!0;break}}if(U===0&&(Y++,Y===this.xmlMeasureList.length)){const G=E.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new f.MusicSheetReadingException(G+this.instrument.Name)}}return U}getCueNoteAndNoteTypeXml(U){let Y=!1;U.element("cue")&&(Y=!0);const k=U.element("type");let W=A.NoteType.UNDEFINED;if(k){const G=k.attribute("size");(G==null?void 0:G.value)==="cue"&&(Y=!0),W=A.NoteTypeHandler.StringToNoteType(k.value)}return[Y,W]}getStemDirectionType(U){switch(U.value){case"down":return R.StemDirectionType.Down;case"up":return R.StemDirectionType.Up;case"double":return R.StemDirectionType.Double;case"none":return R.StemDirectionType.None;default:return R.StemDirectionType.Undefined}}getNoteHeadColorXml(U){const Y=U.element("notehead");if(Y){const k=Y.attribute("color");if(k)return this.parseXmlColor(k.value)}return null}getNoteColorXml(U){const Y=U.attribute("color");return Y?this.parseXmlColor(Y.value):null}getTremoloInfo(U){let Y,k;const W=U.element("tremolo");if(W){const G=W.attribute("type");if(G){if(G.value==="single"){const H=parseInt(W.value,10);H>0&&(Y=H)}else Y=0;G.value==="unmeasured"&&(k=!0)}}return{tremoloStrokes:Y,tremoloUnmeasured:k}}getVibratoStrokes(U){const Y=U.element("wavy-line");if(Y!==void 0){const k=Y.attribute("type");if(k&&k.value==="start")return!0}return!1}getNoteStaff(U){let Y=1;return this.instrument.Staves.length>1&&U.element("staff")&&(Y=parseInt(U.element("staff").value,10),isNaN(Y)&&(P.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),Y=1)),Y}}},1372:function(b,o,r){var u=this&&this.__importDefault||function(Y){return Y&&Y.__esModule?Y:{default:Y}};Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSheetReader=void 0;const a=r(7514),g=r(5942),c=r(1797),l=r(2393),h=r(6842),d=r(6331),E=r(1703),f=u(r(2043)),y=r(3331),S=r(3331),_=r(9050),P=r(884),w=r(5142),x=r(289),M=r(2255),N=r(8736),R=r(1405),A=r(2458),F=r(1274);class U{constructor(k=void 0,W=new R.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new A.ReaderPluginManager,this.afterSheetReadingModules=k||[],this.repetitionInstructionReader=N.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=N.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=W}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(k){for(const W of k)W.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(k,W){try{return this._createMusicSheet(k,W)}catch(G){return void f.default.error("MusicSheetReader.CreateMusicSheet",G)}}_removeFromArray(k,W){const G=k.indexOf(W);G!==-1&&k.splice(G,1)}trimString(k){return k.replace(/^\s+|\s+$/g,"")}_lastElement(k){return k[k.length-1]}_createMusicSheet(k,W){const G=[];let H=0;if(this.musicSheet=new a.MusicSheet,this.musicSheet.Path=W,this.musicSheet.Rules=this.rules,!k)throw new E.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(k,W);const L=k.element("part-list");if(!L)throw new E.MusicSheetReadingException("Undefined partListNode");const $=k.elements("part"),ie=L.elements();this.initializeReading(ie,$,G);let re=!0;this.currentFraction=new c.Fraction(0,1);let be=!1,ae=k.element("identification");for(ae&&(ae=ae.element("encoding")),ae&&(ae=ae.element("software")),ae!==void 0&&ae.value==="Guitar Pro 5"&&(be=!0);re;){this.currentMeasure!==void 0&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(H=0),this.currentMeasure=new g.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const ge of G)try{re=re&&ge.readNextXmlMeasure(this.currentMeasure,this.currentFraction,be)}catch(le){const Z=d.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new E.MusicSheetReadingException(Z,le)}re&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(G),this.checkSourceMeasureForNullEntries(),H=this.setSourceMeasureDuration(G,H),U.doCalculationsAfterDurationHasBeenSet(G),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let ge=0,le=this.afterSheetReadingModules.length;geG){if(this.areRhythmInstructionsMixed(W)&&ie.SymbolEnum!==S.RhythmSymbolEnum.NONE)continue;G=ie.Rhythm.RealValue,H=W.indexOf(ie)}}if(W.length>0&&W.lengthk.Denominator){const G=W.Denominator/k.Denominator;k.expand(G)}}checkIfMeasureIsImplicit(k,W){return!(this.previousMeasure||!k.lt(W))||!!this.previousMeasure&&c.Fraction.plus(this.previousMeasure.Duration,k).Equals(W)}allInstrumentsHaveSameDuration(k,W){let G=0;for(let H=0,L=k.length;H=0;k--)for(let W=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries.length-1;W>=0;W--){const G=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries[W];if(G)for(let H=G.VoiceEntries.length-1;H>=0;H--){const L=G.VoiceEntries[H];L.Notes.length===0&&(this._removeFromArray(L.ParentVoice.VoiceEntries,L),this._removeFromArray(G.VoiceEntries,L))}G!==void 0&&G.VoiceEntries.length===0&&G.ChordContainers.length===0&&(this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries[W]=void 0)}for(let k=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;k>=0;k--){let W=0;for(let G=0,H=this.currentMeasure.VerticalSourceStaffEntryContainers[k].StaffEntries.length;G0){const G=W[0].elements("rights");if(G.length>0)for(let H=0,L=G.length;Hie||O)if(re||O){if(ee||q==="right")ae?ae+=` +`+K:ae=K;else if(X||q!=="right"&&q!=="left")be?be+=` +`+K:be=K;else if(q==="left"){this.musicSheet.Lyricist||(this.musicSheet.Lyricist=new M.Label(K));break}}else re=K}}}}if(!this.musicSheet.Title&&re&&(this.musicSheet.Title=new M.Label(this.trimString(re))),!this.musicSheet.Subtitle&&be&&(this.musicSheet.Subtitle=new M.Label(this.trimString(be))),ae){let le=!1;this.musicSheet.Composer?((L=ae.match(` +`))!==null&&L!==void 0?L:[]).length+1>=(($=this.musicSheet.Composer.text.match(` +`))!==null&&$!==void 0?$:[]).length+1&&(le=!0):le=!0,le&&(this.musicSheet.Composer=new M.Label(this.trimString(ae)))}}readTitleAndComposerFromCreditsLegacy(k){var W,G,H;const L=this.computeSystemYCoordinates(k);if(L===0)return;let $,ie,re,be=1,ae=0;const ge=k.elements("credit");for(let le=0,Z=ge.length;leL||z){if(!this.musicSheet.Title&&!z){const q=(H=Se.attribute("font-size"))===null||H===void 0?void 0:H.value;if(q){const de=parseFloat(q);be0&&ae.MidiInstrumentId!==x.MidiInstrument.Percussion&&(Se.midiInstrumentID=Math.max(0,parseInt(O.value,10)-1));else if(O.name==="midi-unpitched")Se.fixedKey=Math.max(0,parseInt(O.value,10));else if(O.name==="volume")try{const z=parseFloat(O.value);Se.volume=z/127}catch(z){f.default.debug("ExpressionReader.readExpressionParameters","read volume",z)}else if(O.name==="pan")try{const z=parseFloat(O.value);Se.pan=z/64}catch(z){f.default.debug("ExpressionReader.readExpressionParameters","read pan",z)}}catch(z){f.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",z)}}}}catch(Se){f.default.info("MusicSheetReader.createInstrumentGroups: ",Se)}}if(ae.SubInstruments.length===0){const le=new w.SubInstrument(ae);ae.SubInstruments.push(le)}G[be]=ae,H?(H.InstrumentalGroups.push(ae),this.musicSheet.Instruments.push(ae)):(this.musicSheet.InstrumentalGroups.push(ae),this.musicSheet.Instruments.push(ae))}else if(re.name==="part-group"&&re.attribute("type").value==="start"){const be=new P.InstrumentalGroup("group",this.musicSheet,H);H?H.InstrumentalGroups.push(be):this.musicSheet.InstrumentalGroups.push(be),H=be}else if(re.name==="part-group"&&re.attribute("type").value==="stop"&&H){if(H.InstrumentalGroups.length===1){const be=H.InstrumentalGroups[0];H.Parent?(H.Parent.InstrumentalGroups.push(be),this._removeFromArray(H.Parent.InstrumentalGroups,H)):(this.musicSheet.InstrumentalGroups.push(be),this._removeFromArray(this.musicSheet.InstrumentalGroups,H))}H=H.Parent}}}catch(L){const $=d.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new E.MusicSheetReadingException($,L)}for(let L=0,$=this.musicSheet.Instruments.length;L<$;++L){const ie=this.musicSheet.Instruments[L];ie.Name||(ie.Name="Instr. "+ie.IdString)}return G}getCompleteNumberOfStavesFromXml(k){let W=0;for(const G of k){const H=G.elements("measure");if(H.length>0){const L=H[0];if(L){let $=L.element("attributes");$&&($=$.element("staves")),$?W+=parseInt($.value,10):W++}}}if(isNaN(W)||W<=0){const G=d.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new E.MusicSheetReadingException(G)}return W}getInstrumentNumberOfStavesFromXml(k){let W=0;const G=k.element("measure");if(G){const H=G.element("attributes");let L;H&&(L=H.element("staves")),W=H&&L?parseInt(L.value,10):1}if(isNaN(W)||W<=0){const H=d.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new E.MusicSheetReadingException(H)}return W}}o.MusicSheetReader=U},8736:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MusicSymbolModuleFactory=void 0;const u=r(9934),a=r(6789);o.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new u.RepetitionInstructionReader}static createRepetitionCalculator(){return new a.RepetitionCalculator}}},7677:function(b,o,r){var u=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(o,"__esModule",{value:!0}),o.ArticulationReader=void 0;const a=r(908),g=u(r(2043)),c=r(1357),l=r(5922),h=r(3748),d=r(8640),E=r(1662),f=r(6943),y=r(8084);o.ArticulationReader=class{constructor(S){this.rules=S}getAccEnumFromString(S){switch(S){case"sharp":return d.AccidentalEnum.SHARP;case"flat":return d.AccidentalEnum.FLAT;case"natural":return d.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return d.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return d.AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return d.AccidentalEnum.TRIPLESHARP;case"triple-flat":return d.AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return d.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return d.AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return d.AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return d.AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return d.AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return d.AccidentalEnum.SLASHSHARP;case"double-slash-flat":return d.AccidentalEnum.DOUBLESLASHFLAT;case"sori":return d.AccidentalEnum.SORI;case"koron":return d.AccidentalEnum.KORON;default:return d.AccidentalEnum.NONE}}addArticulationExpression(S,_){var P,w;if(S!==void 0&&S.elements().length>0){const x=S.elements();for(let M=0,N=x.length;M0&&_.Articulations[0].articulationEnum!==a.ArticulationEnum.staccato&&_.Articulations.splice(0,0,k);else if(A==="breathmark")U===h.PlacementEnum.NotYetDefined&&(k.placement=h.PlacementEnum.Above);else if(A==="strongaccent"){const W=(w=R==null?void 0:R.attribute("type"))===null||w===void 0?void 0:w.value;W==="up"?k.articulationEnum=a.ArticulationEnum.marcatoup:W==="down"&&(k.articulationEnum=a.ArticulationEnum.marcatodown)}else if(F===a.ArticulationEnum.softaccent){const W=_.ParentSourceStaffEntry.ParentStaff.Id-1;U===h.PlacementEnum.NotYetDefined&&(U=h.PlacementEnum.Above,W>0&&(U=h.PlacementEnum.Below));const G=_.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure,H=new f.MultiExpression(G,_.Timestamp);H.StartingContinuousDynamic=new y.ContinuousDynamicExpression(y.ContDynamicEnum.crescendo,U,W,G,-1),H.StartingContinuousDynamic.IsStartOfSoftAccent=!0,H.StartingContinuousDynamic.StartMultiExpression=H,H.StartingContinuousDynamic.EndMultiExpression=H,H.EndingContinuousDynamic=new y.ContinuousDynamicExpression(y.ContDynamicEnum.diminuendo,U,W,G,-1),H.EndingContinuousDynamic.StartMultiExpression=H,H.EndingContinuousDynamic.EndMultiExpression=H,G.StaffLinkedExpressions[W].push(H)}_.hasArticulation(k)||_.Articulations.push(k)}}catch(F){return void g.default.debug("addArticulationExpression","Invalid note articulation.",F)}}}}addFermata(S,_){var P;let w=a.ArticulationEnum.fermata;S.attributes().length>0&&S.attribute("type")&&S.attribute("type").value==="inverted"&&(w=a.ArticulationEnum.invertedfermata);let x=h.PlacementEnum.Above;((P=S.attribute("placement"))===null||P===void 0?void 0:P.value)==="below"&&(x=h.PlacementEnum.Below),_.Articulations.push(new E.Articulation(w,x))}addTechnicalArticulations(S,_,P){var w,x;const M={bend:a.ArticulationEnum.bend,"down-bow":a.ArticulationEnum.downbow,"open-string":a.ArticulationEnum.naturalharmonic,"snap-pizzicato":a.ArticulationEnum.snappizzicato,stopped:a.ArticulationEnum.lefthandpizzicato,"up-bow":a.ArticulationEnum.upbow,harmonic:a.ArticulationEnum.naturalharmonic};for(const A in M){if(!M.hasOwnProperty(A))continue;const F=M[A],U=S.element(A);if(U){let Y;((w=U.attribute("placement"))===null||w===void 0?void 0:w.value)==="above"&&(Y=h.PlacementEnum.Above),((x=U.attribute("placement"))===null||x===void 0?void 0:x.value)==="below"&&(Y=h.PlacementEnum.Below);const k=new E.Articulation(F,Y);_.hasArticulation(k)||_.Articulations.push(k)}}const N=S.elements("fingering");for(const A of N){const F=this.createTechnicalInstruction(A,P);F.type=c.TechnicalInstructionType.Fingering,P.Fingering||(P.Fingering=F),_.TechnicalInstructions.push(F)}const R=S.element("string");if(R){const A=this.createTechnicalInstruction(R,P);A.type=c.TechnicalInstructionType.String,P.StringInstruction=A,_.TechnicalInstructions.push(A)}}createTechnicalInstruction(S,_){const P=new c.TechnicalInstruction;P.sourceNote=_,P.value=S.value;const w=S.attribute("placement");return this.rules.FingeringPositionFromXML&&(P.placement=this.getPlacement(w)),P}getPlacement(S,_=h.PlacementEnum.NotYetDefined){if(_!==h.PlacementEnum.NotYetDefined)return _;if(!S)return h.PlacementEnum.NotYetDefined;switch(S.value){case"above":return h.PlacementEnum.Above;case"below":return h.PlacementEnum.Below;case"left":return h.PlacementEnum.Left;case"right":return h.PlacementEnum.Right;default:return h.PlacementEnum.NotYetDefined}}addOrnament(S,_){if(S){let P;const w={"delayed-inverted-turn":l.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":l.OrnamentEnum.DelayedTurn,"inverted-mordent":l.OrnamentEnum.InvertedMordent,"inverted-turn":l.OrnamentEnum.InvertedTurn,mordent:l.OrnamentEnum.Mordent,"trill-mark":l.OrnamentEnum.Trill,turn:l.OrnamentEnum.Turn};for(const x in w){if(!w.hasOwnProperty(x))continue;const M=S.element(x);if(M){P=new l.OrnamentContainer(w[x]);const N=M.attribute("placement");N&&N.value==="below"&&(P.placement=h.PlacementEnum.Below)}}if(P){const x=S.elements("accidental-mark");if(x){let M=h.PlacementEnum.Below,N=d.AccidentalEnum.NONE;const R=x;for(let A=0,F=R.length;A0?Y.RealValue>0?($=a.Fraction.multiply(a.Fraction.minus(Y,k),$),this.directionTimestamp=a.Fraction.plus($,Y)):this.directionTimestamp=a.Fraction.createFromFraction($):this.offsetDivisions<0&&(Y.RealValue>0?($=a.Fraction.multiply(a.Fraction.minus(Y,k),$),this.directionTimestamp=a.Fraction.minus(Y,$)):this.directionTimestamp=a.Fraction.createFromFraction($));const ie=A.element("direction-type");let re;if(ie&&(re=ie.element("wedge"),re)){const ae=re.attribute("default-y");ae&&(L=this.readPosition(ae))}this.WedgeYPosXml=L;const be=A.attribute("placement");if(be)try{const ae=be.value;ae==="below"?this.placement=_.PlacementEnum.Below:ae==="above"&&(this.placement=_.PlacementEnum.Above)}catch(ae){const ge=w.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");x.default.debug("ExpressionReader.readExpressionParameters",ge,ae),this.musicSheet.SheetErrors.pushMeasureError(ge),this.placement=_.PlacementEnum.Below}if(this.placement===_.PlacementEnum.NotYetDefined)try{if(ie){const ae=ie.element("dynamics");if(ae){const Z=ae.attribute("default-y");Z&&this.readExpressionPlacement(Z,"read dynamics y pos")}if(re){const Z=re.attribute("default-y");Z&&this.readExpressionPlacement(Z,"read wedge y pos")}const ge=ie.element("words");if(ge){const Z=ge.attribute("default-y");Z&&this.readExpressionPlacement(Z,"read words y pos")}const le=ie.element("rehearsal");if(le){const Z=le.attribute("default-y");Z&&this.readExpressionPlacement(Z,"read rehearsal pos")}}}catch(ae){const ge=w.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement. Set to default.");x.default.debug("ExpressionReader.readExpressionParameters",ge,ae),this.musicSheet.SheetErrors.pushMeasureError(ge),this.placement=_.PlacementEnum.Below}this.placement===_.PlacementEnum.NotYetDefined&&(F.Staves.length>1?this.placement=_.PlacementEnum.Below:F.HasLyrics?this.placement=_.PlacementEnum.Above:this.placement=_.PlacementEnum.Below)}read(A,F,U,Y=void 0){let k=!1,W=!1;const G=A.element("sound");if(G){const $=G.attribute("tempo"),ie=G.attribute("dynamics");if($){const re=$.value.match(/^(\d+)(\.\d+)?$/);(re==null?void 0:re.length)>0?this.soundTempo=Math.round(Number.parseFloat($.value)):(x.default.info("invalid xml tempo: "+$.value),this.soundTempo=100),F.TempoInBPM=this.soundTempo,this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,k=!0}if(ie){const re=ie.value.match(/\d+/);this.soundDynamic=re!==void 0?parseInt(re[0],10):100,W=!0}}const H=A.element("direction-type");if(!H)return;let L=H.element("metronome");if(L){const $=L.element("beat-unit"),ie=L.element("beat-unit-dot")!==void 0,re=L.element("per-minute");if($!==void 0&&re){L.hasAttributes&&L.attribute("default-x")!==void 0&&(this.directionTimestamp=a.Fraction.createFromFraction(U));const be=parseFloat(re.value);this.createNewTempoExpressionIfNeeded(F);const ae=new f.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,be,this.currentMultiTempoExpression,!0);ae.parentMeasure=F,this.soundTempo=be,F.TempoInBPM=this.soundTempo*(ie?1.5:1),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,ae.dotted=ie,ae.beatUnit=$.value,this.currentMultiTempoExpression.addExpression(ae,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(L=H.element("dynamics"),L){const $=A.element("notations")!==void 0;this.interpretInstantaneousDynamics(L,F,U,$)}else if(L=H.element("words"),L)if(k){this.createNewTempoExpressionIfNeeded(F),this.currentMultiTempoExpression.CombinedExpressionsText=L.value;const $=new f.InstantaneousTempoExpression(L.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression($,"")}else W||this.interpretWords(L,F,U);else L=H.element("wedge"),L?this.interpretWedge(L,F,Y,F.MeasureNumber):(L=H.element("rehearsal"),L&&this.interpretRehearsalMark(L,F,U,F.MeasureNumber))}closeOpenExpressions(A,F){for(const U of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(A,U.NumberXml,F),this.closeOpenContinuousDynamic(U,A,F);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(a.Fraction.plus(A.AbsoluteTimestamp,F))}addOctaveShift(A,F,U){var Y;let k=1;const W=A.element("staff");if(W)try{k=parseInt(W.value,10)}catch(H){const L=w.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number. Set to default");this.musicSheet.SheetErrors.pushMeasureError(L),k=1,x.default.debug("ExpressionReader.addOctaveShift",L,H)}const G=A.element("direction-type");if(G){const H=G.element("octave-shift"),L=this.readPlacement(A);if(H!==void 0&&H.hasAttributes)try{const $=this.readNumber(H);if(H.attribute("size")){const ie=parseInt(H.attribute("size").value,10);let re=0;ie===8?re=1:ie===15&&(re=2);let be=(Y=H.attribute("type"))===null||Y===void 0?void 0:Y.value;if(be||(L===_.PlacementEnum.Above?be="down":L===_.PlacementEnum.Below&&(be="up")),be==="up"||be==="down"){const ae=new d.OctaveShift(be,re);ae.StaffNumber=k,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(F,$),this.getMultiExpression.OctaveShiftStart=ae,ae.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=ae}else be==="stop"?this.openOctaveShift&&(this.getMultiExpression=this.createNewMultiExpressionIfNeeded(F,this.openOctaveShift.numberXml,U),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0):be||x.default.debug("octave-shift missing type in xml")}}catch($){const ie=w.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(ie),x.default.debug("ExpressionReader.addOctaveShift",ie,$)}}}addPedalMarking(A,F,U){var Y,k,W;const G=A.element("direction-type");if(G){const H=G.element("pedal");if(H!==void 0&&H.hasAttributes){let L=!1,$=!1;try{switch(((Y=H.attribute("line"))===null||Y===void 0?void 0:Y.value)==="yes"?$=!0:((k=H.attribute("line"))===null||k===void 0?void 0:k.value)==="no"?($=!1,L=!0):((W=H.attribute("sign"))===null||W===void 0?void 0:W.value)==="yes"?L=!0:(L=!1,$=!0),H.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(F),this.createNewMultiExpressionIfNeeded(F,-1),this.openPedal=new R.Pedal($,L),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(F,U);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(F,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(F,-1),this.openPedal=new R.Pedal($,L),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression)}}catch(ie){const re=w.ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(re),x.default.debug("ExpressionReader.addPedalMarking",re,ie)}}}}endOpenPedal(A,F){this.createNewMultiExpressionIfNeeded(A,-1,F),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}initialize(){this.placement=_.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(A){var F;const U=(F=A.attribute("placement"))===null||F===void 0?void 0:F.value;return U==="above"?_.PlacementEnum.Above:U==="below"?_.PlacementEnum.Below:_.PlacementEnum.NotYetDefined}readExpressionPlacement(A,F){try{const U=this.readPosition(A);U<0?this.placement=_.PlacementEnum.Below:U>0&&(this.placement=_.PlacementEnum.Above)}catch(U){x.default.debug("ExpressionReader.readExpressionParameters",F,U)}}readPosition(A){try{const F=parseInt(A.value,10);return F<0?this.placement=_.PlacementEnum.Below:F>0&&(this.placement=_.PlacementEnum.Above),F}catch(F){x.default.debug("ExpressionReader.readExpressionParameters",F)}}interpretInstantaneousDynamics(A,F,U,Y){var k,W,G;if(A.hasElements){A.hasAttributes&&A.attribute("default-x")&&(this.directionTimestamp=a.Fraction.createFromFraction(U));const H=this.readNumber(A);let L=(k=A.elements()[0])===null||k===void 0?void 0:k.name;if(L==="other-dynamics"&&(L=A.elements()[0].value),L){if(!((W=F.Rules)===null||W===void 0)&&W.IgnoreRepeatedDynamics){let ie;try{ie=h.DynamicEnum[L]}catch{const be=w.ITextTranslation.translateText("ReaderErrorMessages/DynamicError","Error while reading dynamic.");return void this.musicSheet.SheetErrors.pushMeasureError(be)}if(((G=this.activeInstantaneousDynamic)===null||G===void 0?void 0:G.DynEnum)===ie)return}Y?this.createNewMultiExpressionIfNeeded(F,H,a.Fraction.createFromFraction(U)):this.createNewMultiExpressionIfNeeded(F,H);const $=new h.InstantaneousDynamicExpression(L,this.soundDynamic,this.placement,this.staffNumber,F);$.InMeasureTimestamp=U.clone(),this.getMultiExpression.addExpression($,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=$.DynEnum:this.activeInstantaneousDynamic=new h.InstantaneousDynamicExpression(L,0,_.PlacementEnum.NotYetDefined,1,F)}}}interpretWords(A,F,U){var Y;const k=A.value;if(F.Rules.IgnoreBracketsWords&&(/^\(\s*\)$/.test(k)||/^\[\s*\]$/.test(k)))return;let W;const G=A.attribute("font-style");let H,L,$;G&&(H=G.value,H==="italic"&&(W=M.FontStyles.Italic));const ie=A.attribute("font-weight");ie&&(L=ie.value,L==="bold"&&(W=M.FontStyles.Bold,H==="italic"&&(W=M.FontStyles.BoldItalic)));const re=A.attribute("color");let be;if(re&&($=re.value),F.Rules.PlaceWordsInsideStafflineFromXml){const ae=(Y=A.attribute("default-y"))===null||Y===void 0?void 0:Y.value;(ae==null?void 0:ae.length)>0&&(be=Number.parseInt(ae,10))}if(k.length>0){if(A.hasAttributes&&A.attribute("default-x")&&(this.directionTimestamp=a.Fraction.createFromFraction(U)),this.checkIfWordsNodeIsRepetitionInstruction(k))return;this.fillMultiOrTempoExpression(k,F,U,W,$,be),this.initialize()}}readNumber(A){var F;let U=1;const Y=(F=A.attribute("number"))===null||F===void 0?void 0:F.value;return Y&&(U=Number.parseInt(Y,10)),U}interpretWedge(A,F,U,Y){var k,W;A!==void 0&&A.hasAttributes&&A.attribute("default-x")&&(this.directionTimestamp=a.Fraction.createFromFraction(U));const G=this.readNumber(A),H=(W=(k=A.attribute("type"))===null||k===void 0?void 0:k.value)===null||W===void 0?void 0:W.toLowerCase();this.lastWedge&&this.lastWedge.parentMeasure.MeasureNumberXML===F.MeasureNumberXML&&this.lastWedge.StaffNumber===this.staffNumber&&this.placement===this.lastWedge.Placement&&this.WedgeYPosXml!==void 0&&this.lastWedge.YPosXml===this.WedgeYPosXml&&this.lastWedge.StartMultiExpression.Timestamp.Equals(this.directionTimestamp)&&this.lastWedge.DynamicType===c.ContDynamicEnum[H]||(H==="stop"?this.createNewMultiExpressionIfNeeded(F,G,U):this.createNewMultiExpressionIfNeeded(F,G),this.addWedge(A,F,U),this.initialize())}interpretRehearsalMark(A,F,U,Y){F.rehearsalExpression=new N.RehearsalExpression(A.value,this.placement)}createNewMultiExpressionIfNeeded(A,F,U=void 0){U||(U=this.directionTimestamp);let Y=this.getMultiExpression;return(!Y||Y&&(Y.SourceMeasureParent!==A||Y.numberXml!==F||Y.SourceMeasureParent===A&&Y.Timestamp!==U))&&(this.getMultiExpression=Y=new E.MultiExpression(A,a.Fraction.createFromFraction(U)),A.StaffLinkedExpressions[this.globalStaffIndex].push(Y)),Y}createNewTempoExpressionIfNeeded(A){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===A&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new g.MultiTempoExpression(A,a.Fraction.createFromFraction(this.directionTimestamp)),A.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(A,F,U){if(A!==void 0&&A.hasAttributes){const Y=this.readNumber(A),k=A.attribute("type").value.toLowerCase();try{if(k==="crescendo"||k==="diminuendo"){const W=new c.ContinuousDynamicExpression(c.ContDynamicEnum[k],this.placement,this.staffNumber,F,Y);this.lastWedge=W,this.lastWedge.YPosXml=this.WedgeYPosXml,this.openContinuousDynamicExpressions.push(W);let G=this.getMultiExpression;G||(G=this.createNewMultiExpressionIfNeeded(F,Y)),G.StartingContinuousDynamic=W,W.StartMultiExpression=G,this.activeInstantaneousDynamic!==void 0&&this.activeInstantaneousDynamic.StaffNumber===W.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if(k==="stop")for(const W of this.openContinuousDynamicExpressions)W.NumberXml===Y&&this.closeOpenContinuousDynamic(W,F,U)}catch(W){const G="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(G),x.default.debug("ExpressionReader.addWedge",G,W)}}}fillMultiOrTempoExpression(A,F,U,Y,k,W=void 0){if(!A)return;const G=A.trim();this.createExpressionFromString("",G,F,U,A,Y,k,W)}createExpressionFromString(A,F,U,Y,k,W,G,H=void 0){if(f.InstantaneousTempoExpression.isInputStringInstantaneousTempo(F)||l.ContinuousTempoExpression.isInputStringContinuousTempo(F)){if(U.TempoExpressions.length>0)for(let re=0,be=U.TempoExpressions.length;re0)for(let re=0,be=U.TempoExpressions.length;re0&&!this.hasDigit(F)&&this.globalStaffIndex>0){if(ae.EntriesList[0].label.indexOf(F)>=0)return!1;break}}let $=P.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&($=P.TextAlignmentEnum.LeftBottom);const ie=new S.UnknownExpression(F,this.placement,$,this.staffNumber);return ie.fontStyle=W,ie.ColorXML=G,ie.defaultYXml=H,L.addExpression(ie,A),!1}closeOpenContinuousDynamic(A,F,U){if(!A)return;const Y=A.NumberXml;A.EndMultiExpression=this.createNewMultiExpressionIfNeeded(F,Y,U),A.StartMultiExpression.EndingContinuousDynamic=A,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(k=>k!==A)}closeOpenContinuousTempo(A){this.openContinuousTempoExpression.AbsoluteEndTimestamp=A,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(A){return(A=A.trim().toLowerCase())==="coda"||A==="tocoda"||A==="to coda"||A==="fine"||A==="d.c."||A==="dacapo"||A==="da capo"||A==="d.s."||A==="dalsegno"||A==="dal segno"||A==="d.c. al fine"||A==="d.s. al fine"||A==="d.c. al coda"||A==="d.s. al coda"}hasDigit(A){return/\d/.test(A)}}},2535:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LyricsReader=void 0;const u=r(2672),a=r(7274),g=r(6331);o.LyricsReader=class{constructor(c){this.openLyricWords={},this.musicSheet=c}addLyricEntry(c,l){var h,d;if(c){const E=c;for(let f=0,y=E.length;f0)for(let Y=U;Y{Object.defineProperty(o,"__esModule",{value:!0}),o.RepetitionCalculator=void 0;const u=r(6189),a=r(6189),g=r(1703);o.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[]}calculateRepetitions(c,l){this.musicSheet=c,this.repetitionInstructions=l;const h=this.musicSheet.SourceMeasures;for(let d=0,E=this.repetitionInstructions.length;d1&&f.FirstRepetitionInstructions.sort(a.RepetitionInstructionComparer.Compare),f.LastRepetitionInstructions.length>1&&f.LastRepetitionInstructions.sort(a.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(c){if(!this.currentMeasure)return!1;switch(c.type){case u.RepetitionInstructionEnum.StartLine:this.currentMeasure.FirstRepetitionInstructions.push(c);break;case u.RepetitionInstructionEnum.BackJumpLine:this.currentMeasure.LastRepetitionInstructions.push(c);break;case u.RepetitionInstructionEnum.Ending:if(c.alignment===u.AlignmentType.Begin)this.currentMeasure.FirstRepetitionInstructions.push(c);else for(let l=0,h=c.endingIndices.length;l{Object.defineProperty(o,"__esModule",{value:!0}),o.RepetitionInstructionReader=void 0;const u=r(6189),a=r(6189),g=r(1211);o.RepetitionInstructionReader=class{set MusicSheet(c){this.musicSheet=c,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(c,l){this.currentMeasureIndex=l}handleLineRepetitionInstructions(c){var l;let h=!1;if(c.elements().length>0){let d="",E=!1,f="",y="",S="";const _=[],P=c.element("bar-style");P&&(S=P.value),d=c.attributes().length>0&&c.attribute("location")?c.attribute("location").value:"right";const w=c.elements();for(let x=0,M=w.length;x0)if(d==="left"){if(y==="start"){const x=new u.RepetitionInstruction(this.currentMeasureIndex,u.RepetitionInstructionEnum.Ending,u.AlignmentType.Begin,void 0,_);this.addInstruction(this.repetitionInstructions,x)}if(f==="forward"){const x=new u.RepetitionInstruction(this.currentMeasureIndex,u.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,x)}}else{if(y==="stop"){const x=new u.RepetitionInstruction(this.currentMeasureIndex,u.RepetitionInstructionEnum.Ending,u.AlignmentType.End,void 0,_);this.addInstruction(this.repetitionInstructions,x)}if(f==="backward"){const x=new u.RepetitionInstruction(this.currentMeasureIndex,u.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,x)}}}return h}handleRepetitionInstructionsFromWordsOrSymbols(c,l){const h=c.element("words"),d=this.currentMeasureIndex;if(h){const E="d\\s?\\.s\\.",f=h.value.trim().toLowerCase();if(g.StringUtil.StringContainsSeparatedWord(f,E+" al fine",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,S),!0}const y="d\\.\\s?c\\.";if(g.StringUtil.StringContainsSeparatedWord(f,y+" al coda",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,y+" al fine",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,y+" al coda",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,y)||g.StringUtil.StringContainsSeparatedWord(f,"da\\s?capo",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,E,!0)||g.StringUtil.StringContainsSeparatedWord(f,"dal\\s?segno",!0)){let S;return S=g.StringUtil.StringContainsSeparatedWord(f,"al\\s?coda",!0)?new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DalSegnoAlCoda):new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,"to\\s?coda",!0)||g.StringUtil.StringContainsSeparatedWord(f,"a (la )?coda",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,"fine",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,"coda",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,S),!0}if(g.StringUtil.StringContainsSeparatedWord(f,"segno",!0)){const S=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,S),!0}}else{if(c.element("segno")){const E=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,E),!0}if(c.element("coda")){const E=new u.RepetitionInstruction(d,u.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,E),!0}}return!1}removeRedundantInstructions(){let c=0,l=0,h=0,d=0;for(let E=0;E0&&this.findInstructionInPreviousMeasure(E,f.measureIndex,u.RepetitionInstructionEnum.ToCoda)&&(f.type=u.RepetitionInstructionEnum.None);break;case u.RepetitionInstructionEnum.Segno:if(c-d>0){let y=!1;for(let S=0,_=this.repetitionInstructions.length;S<_;++S){const P=this.repetitionInstructions[S];if(f.measureIndex-P.measureIndex==1)switch(P.type){case u.RepetitionInstructionEnum.BackJumpLine:P.type=h-l>0?u.RepetitionInstructionEnum.DalSegnoAlCoda:u.RepetitionInstructionEnum.DalSegno,f.type=u.RepetitionInstructionEnum.None,y=!0;break;case u.RepetitionInstructionEnum.DalSegno:case u.RepetitionInstructionEnum.DalSegnoAlFine:case u.RepetitionInstructionEnum.DalSegnoAlCoda:f.type=u.RepetitionInstructionEnum.None,y=!0}if(y)break}if(y)break;f.type=h-l>0?u.RepetitionInstructionEnum.DalSegnoAlCoda:u.RepetitionInstructionEnum.DalSegno,f.alignment=u.AlignmentType.End,f.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(E,f)||f.type===u.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(E,1),E--;else switch(f.type){case u.RepetitionInstructionEnum.Fine:break;case u.RepetitionInstructionEnum.ToCoda:h++;break;case u.RepetitionInstructionEnum.Coda:l++;break;case u.RepetitionInstructionEnum.Segno:c++;break;case u.RepetitionInstructionEnum.DalSegnoAlFine:case u.RepetitionInstructionEnum.DalSegnoAlCoda:d++}}this.repetitionInstructions.sort(a.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(c,l,h){for(let d=c-1;d>=0;d--){const E=this.repetitionInstructions[d];if(l-E.measureIndex==1&&E.type===h)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(c,l){for(let h=c-1;h>=0;h--)if(this.repetitionInstructions[h].equals(l))return!0;return!1}addInstruction(c,l){let h=!0;for(let d=0,E=c.length;d0){const y=f.attribute("type").value;let S=1;try{f.attribute("number")&&(S=parseInt(f.attribute("number").value,10))}catch(x){g.default.debug("VoiceGenerator.addSlur number: ",x)}let _=l.PlacementEnum.NotYetDefined;const P=f.attribute("placement");P&&P.value&&(P.value==="above"?_=l.PlacementEnum.Above:P.value==="below"&&(_=l.PlacementEnum.Below));const w=f.attribute("orientation");if(w&&w.value&&(w.value==="over"?_=l.PlacementEnum.Above:w.value==="under"&&(_=l.PlacementEnum.Below)),y==="start"){let x=this.openSlurDict[S];x||(x=new a.Slur,this.openSlurDict[S]=x),x.StartNote=E,x.PlacementXml=_}else if(y==="stop"){const x=this.openSlurDict[S];if(x){const M=f.name;if(M==="slide"||M==="glissando"){const N=x.StartNote,R=new h.Glissando(N);R.AddNote(E),R.EndNote=E,E.NoteGlissando=R,delete this.openSlurDict[S]}else x.EndNote=E,E.isDuplicateSlur(x)||(E.NoteSlurs.push(x),x.StartNote.NoteSlurs.push(x)),delete this.openSlurDict[S]}}}}}catch{const y=c.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(y)}}}},1651:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(7677),o),a(r(2905),o),a(r(4671),o),a(r(2535),o),a(r(6789),o),a(r(9934),o),a(r(3755),o)},2458:function(b,o,r){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReaderPluginManager=void 0;const a=u(r(2043));o.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(g){this.voiceMeasureReadPlugins.push(g)}processVoiceMeasureReadPlugins(g,c,l){for(const h of this.voiceMeasureReadPlugins)try{h.measureReadCalculations(g,c,l)}catch(d){a.default.info("VoiceGenerator.addSingleNote: ",d)}}}},8109:function(b,o,r){var u=this&&this.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(o,"__esModule",{value:!0}),o.VoiceGenerator=void 0;const a=r(2947),g=r(3884),c=r(908),l=r(5253),h=r(9050),d=r(9224),E=r(4555),f=r(5544),y=r(8069),S=r(1797),_=r(6331),P=r(2535),w=r(1703),x=r(8640),M=r(8640),N=r(4447),R=u(r(2043)),A=r(8640),F=r(2337),U=r(7677),Y=r(766),k=r(3029),W=r(2478),G=r(2953),H=r(3748);o.VoiceGenerator=class{constructor(L,$,ie,re,be=void 0){this.openBeams=[],this.beamNumberOffset=0,this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.staff=$,this.instrument=$.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=re,this.pluginManager=L,this.voice=be?new a.LinkedVoice(this.instrument,ie,be):new g.Voice(this.instrument,ie),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new P.LyricsReader(this.musicSheet),this.articulationReader=new U.ArticulationReader(this.musicSheet.Rules)}get openTieDict(){return this.staff.openTieDict}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(L){this.currentOctaveShift=L}createVoiceEntry(L,$,ie,re=!1,be=!1,ae=!1){this.currentVoiceEntry=new c.VoiceEntry(L.clone(),this.voice,$,re,be,ae),ie&&this.voice.VoiceEntries.push(this.currentVoiceEntry)}read(L,$,ie,re,be,ae,ge,le,Z,ye,Se,X,ee,ne,O,z,K,q,de,ue,ce){this.currentStaffEntry=ge,this.currentMeasure=le;try{this.currentNote=ae?this.addRestNote(L.element("rest"),$,re,ie,be,ee,ne,de):this.addSingleNote(L,$,re,ie,be,Se,X,ee,ne,O,z,K,q,de,ue),this.currentNote.DotsXml=ce;const pe=L.elements("lyric");this.lyricsReader!==void 0&&pe&&(this.lyricsReader.addLyricEntry(pe,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let we=!1;const Me=L.element("notations");if(Me){this.articulationReader&&this.readArticulations(Me,this.currentVoiceEntry,this.currentNote);const ze=Me.elements("slur"),De=Me.elements("slide"),Qe=Me.elements("glissando");this.slurReader!==void 0&&(ze.length>0||De.length>0)&&!this.currentNote.ParentVoiceEntry.IsGrace&&(this.slurReader.addSlur(ze,this.currentNote),De.length>0&&this.slurReader.addSlur(De,this.currentNote),Qe.length>0&&this.slurReader.addSlur(Qe,this.currentNote));const ke=Me.elements("tuplet");ke.length>0&&(this.openTupletNumber=this.addTuplet(L,ke),we=!0);const We=Me.element("arpeggiate");if(We!==void 0){let Je;if(this.currentVoiceEntry.Arpeggio)Je=this.currentVoiceEntry.Arpeggio;else{let it=!1;for(const ht of this.currentStaffEntry.VoiceEntries)if(ht.Arpeggio){it=!0,Je=ht.Arpeggio;break}if(!it){let ht=k.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const vt=We.attribute("direction");if(vt)switch(vt.value){case"up":ht=k.ArpeggioType.ROLL_UP;break;case"down":ht=k.ArpeggioType.ROLL_DOWN;break;default:ht=k.ArpeggioType.ARPEGGIO_DIRECTIONLESS}Je=new k.Arpeggio(this.currentVoiceEntry,ht),this.currentVoiceEntry.Arpeggio=Je}}Je.addNote(this.currentNote)}const qe=Me.elements("tied");qe.length>0&&this.addTie(qe,Z,ye,f.TieTypes.SIMPLE);const Ye=Me.element("technical");if(Ye){const Je=Ye.elements("hammer-on");Je.length>0&&this.addTie(Je,Z,ye,f.TieTypes.HAMMERON);const it=Ye.elements("pull-off");it.length>0&&this.addTie(it,Z,ye,f.TieTypes.PULLOFF)}}L.element("time-modification")===void 0||we||this.handleTimeModificationNode(L)}catch(pe){R.default.warn(pe);const we=_.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(we),this.musicSheet.SheetErrors.pushMeasureError(pe)}return this.currentNote}checkForStaffEntryLink(L,$,ie,re){const be=new N.StaffEntryLink(this.currentVoiceEntry);be.LinkStaffEntries.push(ie),ie.Link=be;const ae=this.currentVoiceEntry.Timestamp.clone(),ge=re.getVerticalContainerByTimestamp(ae);return(ie=ge.StaffEntries[L])||(ie=new h.SourceStaffEntry(ge,$),ge.StaffEntries[L]=ie),ie.VoiceEntries.push(this.currentVoiceEntry),be.LinkStaffEntries.push(ie),ie.Link=be,ie}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const L=this.openTieDict;for(const $ in L)if(L.hasOwnProperty($)){const ie=L[$];S.Fraction.plus(ie.StartNote.ParentStaffEntry.Timestamp,ie.Duration).lt(ie.StartNote.SourceMeasure.Duration)&&delete L[$]}}hasVoiceEntry(){return this.currentVoiceEntry!==void 0}readArticulations(L,$,ie){const re=L.element("articulations");re&&this.articulationReader.addArticulationExpression(re,$);const be=L.element("fermata");be&&this.articulationReader.addFermata(be,$);const ae=L.element("technical");ae&&this.articulationReader.addTechnicalArticulations(ae,$,ie);const ge=L.element("ornaments");ge&&this.articulationReader.addOrnament(ge,$)}addSingleNote(L,$,ie,re,be,ae,ge,le,Z,ye,Se,X,ee,ne,O){let z,K,q,de,ue=0,ce=x.AccidentalEnum.NONE,pe=M.NoteEnum.C,we=M.NoteEnum.C,Me=0,ze=0;const De=L.elements();for(let ht=0,vt=De.length;ht0&&this.openBeams.last().ExtendedNoteList.push(O),O}addNoteInfo(L,$,ie,re,be,ae,ge,le,Z){L.NoteTypeXml=$,L.PrintObject=ie,L.IsCueNote=re,L.NormalNotes=be,L.displayStepUnpitched=ae,L.displayOctaveUnpitched=ge,L.NoteheadColorXml=le,L.NoteheadColor=le}createBeam(L,$){var ie;try{const re=L.element("beam");let be;if(re!==void 0&&re.hasAttributes&&(be=re.attribute("number")),be){let ae=parseInt(be.value,10);const ge=L.elements("beam"),le=ge[0].value;ge&&(le==="begin"?(ae===((ie=this.openBeams.last())===null||ie===void 0?void 0:ie.BeamNumber)?(this.beamNumberOffset++,ae+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new d.Beam(ae,this.beamNumberOffset))):ae+=this.beamNumberOffset);let Z=!1;if(!(ae>0&&ae<=this.openBeams.length&&this.openBeams[ae-1]))return void R.default.debug("[OSMD] invalid beamnumber");for(let ye=0,Se=this.openBeams[ae-1].Notes.length;ye1){let be=L.element("time-modification");be&&(be=be.element("actual-notes"));const ae=$;for(let ge=0,le=ae.length;ge1&&this.openTupletNumber--),this.tupletDict[ee]=O;const K=[];K.push(this.currentNote),O.Notes.push(K),O.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=O,this.openTupletNumber=ee}else if(X.value==="stop"){let ee=1;Z.attribute("number")&&(ee=parseInt(Z.attribute("number").value,10));const ne=this.tupletDict[ee];if(ne){const O=Z.attribute("placement");O&&(O.value==="below"?ne.tupletLabelNumberPlacement=H.PlacementEnum.Below:ne.tupletLabelNumberPlacement=H.PlacementEnum.Above,ne.PlacementFromXml=!0);const z=[];if(z.push(this.currentNote),ne.Notes.push(z),!ne.PlacementFromXml){let K=!1;for(const q of ne.Notes){for(const de of q)if(!de.isRest()){de.StemDirectionXml===c.StemDirectionType.Down?ne.tupletLabelNumberPlacement=H.PlacementEnum.Below:ne.tupletLabelNumberPlacement=H.PlacementEnum.Above,K=!0;break}if(K)break}}ne.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=ne,delete this.tupletDict[ee],Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if($[0]){const be=$[0];if(be.hasAttributes){const ae=be.attribute("type").value;let ge=1;be.attribute("number")&&(ge=parseInt(be.attribute("number").value,10));const le=isNaN(ge),Z=this.readShowNumberNoneGiven(be),ye=be.attribute("bracket");if(ye&&ye.value==="yes"?(re=!0,ie=!0):ye&&ye.value==="no"&&(ie=!1),ae==="start"){let Se=0,X=L.element("time-modification");if(X&&(X=X.element("actual-notes")),X&&(Se=parseInt(X.value,10),isNaN(Se))){const z=_.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(z),new w.MusicSheetReadingException(z)}le&&(this.openTupletNumber++,ge=this.openTupletNumber);let ee=this.tupletDict[ge];ee||(ee=this.tupletDict[ge]=new y.Tuplet(Se,re),ee.BracketedXmlValue=ie,ee.ShowNumberNoneGivenInXml=Z,ee.tupletLabelNumberPlacement=H.PlacementEnum.Above);const ne=be.attribute("placement");ne&&(ne.value==="below"?ee.tupletLabelNumberPlacement=H.PlacementEnum.Below:ee.tupletLabelNumberPlacement=H.PlacementEnum.Above,ee.PlacementFromXml=!0);const O=[];O.push(this.currentNote),ee.Notes.push(O),ee.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=ee,this.openTupletNumber=ge}else if(ae==="stop"){le&&(ge=this.openTupletNumber);const Se=this.tupletDict[this.openTupletNumber];if(Se){const X=be.attribute("placement");X&&(X.value==="below"?Se.tupletLabelNumberPlacement=H.PlacementEnum.Below:Se.tupletLabelNumberPlacement=H.PlacementEnum.Above,Se.PlacementFromXml=!0);const ee=[];if(ee.push(this.currentNote),Se.Notes.push(ee),!Se.PlacementFromXml){let ne=!1;for(const O of Se.Notes){for(const z of O)if(!z.isRest()){z.StemDirectionXml===c.StemDirectionType.Down?Se.tupletLabelNumberPlacement=H.PlacementEnum.Below:Se.tupletLabelNumberPlacement=H.PlacementEnum.Above,ne=!0;break}if(ne)break}}Se.Fractions.push(this.getTupletNoteDurationFromType(L)),this.currentNote.NoteTuplet=Se,Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[ge]}}}}return this.openTupletNumber}readShowNumberNoneGiven(L){const $=L.attribute("show-number");return!(!($!=null&&$.value)||$.value!=="none")}handleTimeModificationNode(L){if(this.tupletDict[this.openTupletNumber])try{const $=this.tupletDict[this.openTupletNumber],ie=F.CollectionUtil.last($.Notes);let re;ie[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?re=ie:(re=[],$.Notes.push(re),$.Fractions.push(this.getTupletNoteDurationFromType(L))),re.push(this.currentNote),this.currentNote.NoteTuplet=$}catch($){const ie=_.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(ie),$}else if(this.currentVoiceEntry.Notes.length>0){const $=this.currentVoiceEntry.Notes[0];if($.NoteTuplet){const ie=$.NoteTuplet;F.CollectionUtil.last(ie.Notes).push(this.currentNote),this.currentNote.NoteTuplet=ie}}}addTie(L,$,ie,re){if(L){if(L.length===1){const be=L[0];if(be!==void 0&&be.attributes()){const ae=this.getTieDirection(be),ge=be.attribute("type").value;try{if(ge==="start"){const le=this.findCurrentNoteInTieDict(this.currentNote);le<0&&delete this.openTieDict[le];const Z=this.getNextAvailableNumberForTie(),ye=new E.Tie(this.currentNote,re);this.openTieDict[Z]=ye,ye.TieNumber=Z,ye.TieDirection=ae}else if(ge==="stop"){const le=this.findCurrentNoteInTieDict(this.currentNote),Z=this.openTieDict[le];Z&&(Z.AddNote(this.currentNote),delete this.openTieDict[le])}}catch{const Z=_.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(Z)}}}else if(L.length===2){const be=this.findCurrentNoteInTieDict(this.currentNote);if(be>=0){const ae=this.openTieDict[be];ae.AddNote(this.currentNote);for(const ge of L)if(ge.attribute("type").value==="start"){const le=this.getTieDirection(ge);ae.NoteIndexToTieDirection[ae.Notes.length-1]=le}}}}}getTieDirection(L){let $=H.PlacementEnum.NotYetDefined;const ie=L.attribute("placement");ie&&(ie.value==="above"?$=H.PlacementEnum.Above:ie.value==="below"&&($=H.PlacementEnum.Below));const re=L.attribute("orientation");return re&&(re.value==="over"?$=H.PlacementEnum.Above:re.value==="under"&&($=H.PlacementEnum.Below)),$}getNextAvailableNumberForTie(){const L=Object.keys(this.openTieDict);if(L.length===0)return 1;L.sort(($,ie)=>+$-+ie);for(let $=0;${var r;Object.defineProperty(o,"__esModule",{value:!0}),o.ArpeggioType=o.Arpeggio=void 0,o.Arpeggio=class{constructor(u,a=r.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=u,this.type=a,this.notes=[]}addNote(u){this.notes.push(u),u.Arpeggio=this}},function(u){u[u.BRUSH_DOWN=1]="BRUSH_DOWN",u[u.BRUSH_UP=2]="BRUSH_UP",u[u.ROLL_DOWN=3]="ROLL_DOWN",u[u.ROLL_UP=4]="ROLL_UP",u[u.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",u[u.RASQUEDO_UP=6]="RASQUEDO_UP",u[u.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"}(r=o.ArpeggioType||(o.ArpeggioType={}))},1662:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Articulation=void 0,o.Articulation=class{constructor(r,u){this.articulationEnum=r,this.placement=u}Equals(r){return r.articulationEnum===this.articulationEnum&&r.placement===this.placement}}},9224:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.BeamEnum=o.Beam=void 0,o.Beam=class{constructor(u=1,a=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.AutoGenerated=!1,this.BeamNumber=u,this.BeamNumberOffsetToXML=a}get Notes(){return this.notes}set Notes(u){this.notes=u}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(u){this.extendedNoteList=u}addNoteToBeam(u){u&&(u.NoteBeam=this,this.notes.push(u),this.extendedNoteList.push(u))}},(r=o.BeamEnum||(o.BeamEnum={}))[r.BeamNone=-1]="BeamNone",r[r.BeamBegin=0]="BeamBegin",r[r.BeamContinue=1]="BeamContinue",r[r.BeamEnd=2]="BeamEnd",r[r.BeamForward=3]="BeamForward",r[r.BeamBackward=4]="BeamBackward"},4123:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ChordSymbolEnum=o.ChordDegreeText=o.CustomChord=o.Degree=o.ChordSymbolContainer=void 0;const u=r(8640),a=r(4040),g=r(8640);o.ChordSymbolContainer=class{constructor(d,E,f,y,S){this.rootPitch=d,this.chordKind=E,this.bassPitch=f,this.degrees=y,this.rules=S}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(d,E,f){let y=d.RootPitch;if(a.MusicSheetCalculator.transposeCalculator&&(y=a.MusicSheetCalculator.transposeCalculator.transposePitch(d.RootPitch,f,E)),d.ChordKind===h.none)return d.getTextFromChordKindEnum(d.ChordKind);let S=u.Pitch.getNoteEnumString(y.FundamentalNote);y.Accidental!==g.AccidentalEnum.NONE&&(S+=d.getTextForAccidental(y.Accidental));const _={adds:[],alts:[],subs:[]};for(const M of d.ChordDegrees)if(M){let N="";switch(M.alteration!==g.AccidentalEnum.NONE&&(N+=d.getTextForAccidental(M.alteration)),N+=M.value,M.text){case l.add:_.adds.push(N);break;case l.alter:_.alts.push(N);break;case l.subtract:_.subs.push(N)}}let P=d.getTextFromChordKindEnum(d.ChordKind);const w=["adds","alts","subs"],x=d.rules.CustomChords;for(const M of x){if(M.chordKind!==d.chordKind)continue;let N=!0;for(const R of w){for(const A of M.degrees[R]||[])if(_[R].indexOf(A)<0){N=!1;break}if(!N)break}if(N){for(const R of w)for(const A of M.degrees[R]||[])_[R].splice(_[R].indexOf(A),1);P=M.alternateName}}if(S+=P,_.adds.length>0&&(S+="("+_.adds.join(",")+")"),_.alts.length>0&&(S+="(alt "+_.alts.join(",")+")"),_.subs.length>0&&(S+="(omit "+_.subs.join(",")+")"),d.BassPitch){let M=d.BassPitch;a.MusicSheetCalculator.transposeCalculator&&(M=a.MusicSheetCalculator.transposeCalculator.transposePitch(d.BassPitch,f,E)),S+="/",S+=u.Pitch.getNoteEnumString(M.FundamentalNote),S+=d.getTextForAccidental(M.Accidental)}return S}getTextForAccidental(d){const E=this.rules.ChordAccidentalTexts.getValue(d);return E!==void 0?E:""}getTextFromChordKindEnum(d){var E;return(E=this.rules.ChordSymbolLabelTexts.getValue(d))!==null&&E!==void 0?E:""}},o.Degree=class{constructor(d,E,f){this.value=d,this.alteration=E,this.text=f}};class c{constructor(E,f,y){this.alternateName=E,this.chordKind=f,this.degrees=y}static createCustomChord(E,f,y){return new c(E,f,y)}static renameCustomChord(E,f,y){for(const S of y)S.alternateName===E&&(S.alternateName=f)}}var l,h;o.CustomChord=c,function(d){d[d.add=0]="add",d[d.alter=1]="alter",d[d.subtract=2]="subtract"}(l=o.ChordDegreeText||(o.ChordDegreeText={})),function(d){d[d.major=0]="major",d[d.minor=1]="minor",d[d.augmented=2]="augmented",d[d.diminished=3]="diminished",d[d.dominant=4]="dominant",d[d.majorseventh=5]="majorseventh",d[d.minorseventh=6]="minorseventh",d[d.diminishedseventh=7]="diminishedseventh",d[d.augmentedseventh=8]="augmentedseventh",d[d.halfdiminished=9]="halfdiminished",d[d.majorminor=10]="majorminor",d[d.majorsixth=11]="majorsixth",d[d.minorsixth=12]="minorsixth",d[d.dominantninth=13]="dominantninth",d[d.majorninth=14]="majorninth",d[d.minorninth=15]="minorninth",d[d.dominant11th=16]="dominant11th",d[d.major11th=17]="major11th",d[d.minor11th=18]="minor11th",d[d.dominant13th=19]="dominant13th",d[d.major13th=20]="major13th",d[d.minor13th=21]="minor13th",d[d.suspendedsecond=22]="suspendedsecond",d[d.suspendedfourth=23]="suspendedfourth",d[d.Neapolitan=24]="Neapolitan",d[d.Italian=25]="Italian",d[d.French=26]="French",d[d.German=27]="German",d[d.pedal=28]="pedal",d[d.power=29]="power",d[d.Tristan=30]="Tristan",d[d.none=31]="none"}(h=o.ChordSymbolEnum||(o.ChordSymbolEnum={}))},3748:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.PlacementEnum=o.AbstractExpression=void 0,o.AbstractExpression=class{constructor(u){this.placement=u}static isStringInStringList(u,a){for(let g=0,c=u.length;g{Object.defineProperty(o,"__esModule",{value:!0}),o.AbstractTempoExpression=void 0;const u=r(3748);class a extends u.AbstractExpression{constructor(c,l,h,d){super(l),this.label=c,this.staffNumber=h,this.parentMultiTempoExpression=d}get Label(){return this.label}set Label(c){this.label=c}get Placement(){return this.placement}set Placement(c){this.placement=c}get StaffNumber(){return this.staffNumber}set StaffNumber(c){this.staffNumber=c}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(c,l){for(const h of c)if(a.stringContainsSeparatedWord(l.toLowerCase().trim(),h.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(c,l){return c===l||c.indexOf(" "+l)!==-1||c.indexOf(l+" ")!==-1}}o.AbstractTempoExpression=a},7839:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ContDynamicEnum=o.ContinuousDynamicExpression=void 0;const u=r(3748),a=r(1797);class g extends u.AbstractExpression{constructor(h,d,E,f,y,S=""){super(d),super.parentMeasure=f,this.NumberXml=y,this.dynamicType=h,this.label=S,this.staffNumber=E,this.startVolume=-1,this.endVolume=-1,S!==""&&this.setType()}get DynamicType(){return this.dynamicType}set DynamicType(h){this.dynamicType=h}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(h){this.startMultiExpression=h}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(h){this.endMultiExpression=h}get Placement(){return this.placement}set Placement(h){this.placement=h}get StartVolume(){return this.startVolume}set StartVolume(h){this.startVolume=h}get EndVolume(){return this.endVolume}set EndVolume(h){this.endVolume=h}get StaffNumber(){return this.staffNumber}set StaffNumber(h){this.staffNumber=h}get Label(){return this.label}set Label(h){this.label=h,this.setType()}static isInputStringContinuousDynamic(h){return!!h&&(g.isStringInStringList(g.listContinuousDynamicIncreasing,h)||g.isStringInStringList(g.listContinuousDynamicDecreasing,h))}getInterpolatedDynamic(h){const d=this.StartMultiExpression.AbsoluteTimestamp;let E;if(E=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:a.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),h.lt(d))return-1;if(E.lt(h))return-2;const f=a.Fraction.minus(h,d).RealValue/a.Fraction.minus(E,d).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*f))}isWedge(){return!this.label}setType(){g.isStringInStringList(g.listContinuousDynamicIncreasing,this.label)?this.dynamicType=c.crescendo:g.isStringInStringList(g.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=c.diminuendo)}}var c;o.ContinuousDynamicExpression=g,g.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],g.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],function(l){l[l.crescendo=0]="crescendo",l[l.diminuendo=1]="diminuendo"}(c=o.ContDynamicEnum||(o.ContDynamicEnum={}))},280:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ContinuousTempoType=o.ContinuousTempoExpression=void 0;const u=r(1797),a=r(9775);class g extends a.AbstractTempoExpression{constructor(h,d,E,f){super(h,d,E,f),this.setTempoType()}static isInputStringContinuousTempo(h){return!!h&&(g.isStringInStringList(g.listContinuousTempoFaster,h)||g.isStringInStringList(g.listContinuousTempoSlower,h))}static isIncreasingTempo(h){return h<=c.piuMosso}static isDecreasingTempo(h){return h>=c.allargando&&h<=c.ritenuto}get TempoType(){return this.tempoType}set TempoType(h){this.tempoType=h}get StartTempo(){return this.startTempo}set StartTempo(h){this.startTempo=h}get EndTempo(){return this.endTempo}set EndTempo(h){this.endTempo=h}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(h){this.absoluteEndTimestamp=h}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(h){const d=u.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(h.lt(d))return-1;if(this.absoluteEndTimestamp.lt(h))return-2;const E=u.Fraction.minus(h,d).RealValue/u.Fraction.minus(this.absoluteEndTimestamp,d).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*E))}setTempoType(){g.isStringInStringList(g.listContinuousTempoFaster,this.label)?this.tempoType=c.accelerando:g.isStringInStringList(g.listContinuousTempoSlower,this.label)&&(this.tempoType=c.ritardando)}}var c;o.ContinuousTempoExpression=g,g.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],g.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],function(l){l[l.accelerando=0]="accelerando",l[l.stretto=1]="stretto",l[l.stringendo=2]="stringendo",l[l.mosso=3]="mosso",l[l.piuMosso=4]="piuMosso",l[l.allargando=5]="allargando",l[l.calando=6]="calando",l[l.menoMosso=7]="menoMosso",l[l.rallentando=8]="rallentando",l[l.ritardando=9]="ritardando",l[l.ritard=10]="ritard",l[l.rit=11]="rit",l[l.ritenuto=12]="ritenuto",l[l.rubato=13]="rubato",l[l.precipitando=14]="precipitando"}(c=o.ContinuousTempoType||(o.ContinuousTempoType={}))},5853:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OctaveEnum=o.OctaveShift=void 0;const u=r(8640);var a;o.OctaveShift=class{constructor(g,c){this.numberXml=1,this.setOctaveShiftValue(g,c)}get Type(){return this.octaveValue}set Type(g){this.octaveValue=g}get StaffNumber(){return this.staffNumber}set StaffNumber(g){this.staffNumber=g}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(g){this.startMultiExpression=g}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(g){this.endMultiExpression=g}setOctaveShiftValue(g,c){this.octaveValue=c===1&&g==="down"?a.VA8:c===1&&g==="up"?a.VB8:c===2&&g==="down"?a.MA15:c===2&&g==="up"?a.MB15:a.NONE}static getPitchFromOctaveShift(g,c){if(!g)return;let l=g.Octave;switch(c){case a.VA8:l-=1;break;case a.VB8:l+=1;break;case a.MA15:l-=2;break;case a.MB15:l+=2;break;case a.NONE:default:l+=0}return new u.Pitch(g.FundamentalNote,l,g.Accidental)}},function(g){g[g.VA8=0]="VA8",g[g.VB8=1]="VB8",g[g.MA15=2]="MA15",g[g.MB15=3]="MB15",g[g.NONE=4]="NONE"}(a=o.OctaveEnum||(o.OctaveEnum={}))},308:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Pedal=void 0,o.Pedal=class{constructor(r=!1,u=!0){this.ChangeEnd=!1,this.ChangeBegin=!1,this.EndsStave=!1,this.BeginsStave=!1,this.line=r,this.sign=u}get IsLine(){return this.line}get IsSign(){return this.sign}}},1928:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Slur=void 0;const u=r(1797);o.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(a){this.startNote=a}get EndNote(){return this.endNote}set EndNote(a){this.endNote=a}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let a=0,g=this.startNote.NoteSlurs.length;a{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.DynamicExpressionSymbolEnum=void 0,(r=o.DynamicExpressionSymbolEnum||(o.DynamicExpressionSymbolEnum={}))[r.p=0]="p",r[r.f=1]="f",r[r.s=2]="s",r[r.z=3]="z",r[r.m=4]="m",r[r.r=5]="r"},9793:function(b,o,r){var u=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(o,"__esModule",{value:!0}),o.DynamicEnum=o.InstantaneousDynamicExpression=void 0;const a=r(3748),g=r(4802),c=r(1703),l=u(r(2043)),h=r(1649);class d extends a.AbstractExpression{constructor(y,S,_,P,w){super(_),super.parentMeasure=w,this.dynamicEnum=E[y.toLowerCase()],this.soundDynamic=S,this.staffNumber=P}static staticConstructor(){d.dynamicToRelativeVolumeDict.setValue(E.ffffff,1),d.dynamicToRelativeVolumeDict.setValue(E.fffff,.9921259842519685),d.dynamicToRelativeVolumeDict.setValue(E.ffff,.984251968503937),d.dynamicToRelativeVolumeDict.setValue(E.fff,.9763779527559056),d.dynamicToRelativeVolumeDict.setValue(E.ff,.9606299212598425),d.dynamicToRelativeVolumeDict.setValue(E.f,.8503937007874016),d.dynamicToRelativeVolumeDict.setValue(E.mf,.5984251968503937),d.dynamicToRelativeVolumeDict.setValue(E.sf,.5),d.dynamicToRelativeVolumeDict.setValue(E.sfp,.5),d.dynamicToRelativeVolumeDict.setValue(E.sfpp,.5),d.dynamicToRelativeVolumeDict.setValue(E.fp,.5),d.dynamicToRelativeVolumeDict.setValue(E.rf,.5),d.dynamicToRelativeVolumeDict.setValue(E.rfz,.5),d.dynamicToRelativeVolumeDict.setValue(E.sfz,.5),d.dynamicToRelativeVolumeDict.setValue(E.sffz,.5),d.dynamicToRelativeVolumeDict.setValue(E.fz,.5),d.dynamicToRelativeVolumeDict.setValue(E.mp,.47244094488188976),d.dynamicToRelativeVolumeDict.setValue(E.p,.2204724409448819),d.dynamicToRelativeVolumeDict.setValue(E.pp,.09448818897637795),d.dynamicToRelativeVolumeDict.setValue(E.ppp,.07874015748031496),d.dynamicToRelativeVolumeDict.setValue(E.pppp,.05511811023622047),d.dynamicToRelativeVolumeDict.setValue(E.ppppp,.03937007874015748),d.dynamicToRelativeVolumeDict.setValue(E.pppppp,.031496062992125984)}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(y){this.multiExpression=y}get DynEnum(){return this.dynamicEnum}set DynEnum(y){this.dynamicEnum=y}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(y){this.soundDynamic=y}get Placement(){return this.placement}set Placement(y){this.placement=y}get StaffNumber(){return this.staffNumber}set StaffNumber(y){this.staffNumber=y}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return d.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(y){return!!y&&d.isStringInStringList(d.listInstantaneousDynamics,y)}getDynamicExpressionSymbol(y){switch(y){case"p":return g.DynamicExpressionSymbolEnum.p;case"f":return g.DynamicExpressionSymbolEnum.f;case"s":return g.DynamicExpressionSymbolEnum.s;case"z":return g.DynamicExpressionSymbolEnum.z;case"m":return g.DynamicExpressionSymbolEnum.m;case"r":return g.DynamicExpressionSymbolEnum.r;default:throw new c.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+y)}}calculateLength(){return l.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var E;o.InstantaneousDynamicExpression=d,d.dynamicToRelativeVolumeDict=new h.Dictionary,d.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],function(f){f[f.pppppp=0]="pppppp",f[f.ppppp=1]="ppppp",f[f.pppp=2]="pppp",f[f.ppp=3]="ppp",f[f.pp=4]="pp",f[f.p=5]="p",f[f.mp=6]="mp",f[f.mf=7]="mf",f[f.f=8]="f",f[f.ff=9]="ff",f[f.fff=10]="fff",f[f.ffff=11]="ffff",f[f.fffff=12]="fffff",f[f.ffffff=13]="ffffff",f[f.sf=14]="sf",f[f.sff=15]="sff",f[f.sfp=16]="sfp",f[f.sfpp=17]="sfpp",f[f.fp=18]="fp",f[f.rf=19]="rf",f[f.rfz=20]="rfz",f[f.sfz=21]="sfz",f[f.sffz=22]="sffz",f[f.fz=23]="fz",f[f.other=24]="other"}(E=o.DynamicEnum||(o.DynamicEnum={})),d.staticConstructor()},9667:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TempoEnum=o.InstantaneousTempoExpression=void 0;const u=r(9775),a=r(1703),g=r(1797);class c extends u.AbstractTempoExpression{constructor(d,E,f,y,S,_=!1){super(d,E,f,S),this.isMetronomeMark=_,this.setTempoAndTempoType(y)}static getDefaultValueForTempoType(d){switch(d){case l.larghissimo:return 20;case l.grave:return 30;case l.lento:return 48;case l.largo:return 52;case l.larghetto:return 63;case l.adagio:return 70;case l.adagietto:return 75;case l.andanteModerato:return 88;case l.andante:return 92;case l.andantino:return 96;case l.moderato:return 106;case l.allegretto:return 112;case l.allegroModerato:return 118;case l.allegro:return 130;case l.vivace:return 140;case l.vivacissimo:return 155;case l.allegrissimo:return 170;case l.presto:return 184;case l.prestissimo:return 200;default:throw new a.ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(d){return!!d&&(c.isStringInStringList(c.listInstantaneousTempoLarghissimo,d)||c.isStringInStringList(c.listInstantaneousTempoGrave,d)||c.isStringInStringList(c.listInstantaneousTempoLento,d)||c.isStringInStringList(c.listInstantaneousTempoLargo,d)||c.isStringInStringList(c.listInstantaneousTempoLarghetto,d)||c.isStringInStringList(c.listInstantaneousTempoAdagio,d)||c.isStringInStringList(c.listInstantaneousTempoAdagietto,d)||c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAndante,d)||c.isStringInStringList(c.listInstantaneousTempoAndantino,d)||c.isStringInStringList(c.listInstantaneousTempoModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAllegretto,d)||c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,d)||c.isStringInStringList(c.listInstantaneousTempoAllegro,d)||c.isStringInStringList(c.listInstantaneousTempoVivace,d)||c.isStringInStringList(c.listInstantaneousTempoVivacissimo,d)||c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,d)||c.isStringInStringList(c.listInstantaneousTempoPresto,d)||c.isStringInStringList(c.listInstantaneousTempoPrestissimo,d)||c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,d))}get Label(){return this.label}set Label(d){this.label=d}get Placement(){return this.placement}set Placement(d){this.placement=d}get StaffNumber(){return this.staffNumber}set StaffNumber(d){this.staffNumber=d}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(d){this.tempoInBpm=d}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return g.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return g.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(d){return this.label?c.isStringInStringList(c.listInstantaneousTempoLarghissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.larghissimo)),this.tempoInBpm=d,void(this.tempoEnum=l.larghissimo)):c.isStringInStringList(c.listInstantaneousTempoGrave,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.grave)),this.tempoInBpm=d,void(this.tempoEnum=l.grave)):c.isStringInStringList(c.listInstantaneousTempoLento,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.lento)),this.tempoInBpm=d,void(this.tempoEnum=l.lento)):c.isStringInStringList(c.listInstantaneousTempoLargo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.largo)),this.tempoInBpm=d,void(this.tempoEnum=l.largo)):c.isStringInStringList(c.listInstantaneousTempoLarghetto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.larghetto)),this.tempoInBpm=d,void(this.tempoEnum=l.larghetto)):c.isStringInStringList(c.listInstantaneousTempoAdagio,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.adagio)),this.tempoInBpm=d,void(this.tempoEnum=l.adagio)):c.isStringInStringList(c.listInstantaneousTempoAdagietto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.adagietto)),this.tempoInBpm=d,void(this.tempoEnum=l.adagietto)):c.isStringInStringList(c.listInstantaneousTempoAndanteModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.andanteModerato)),this.tempoInBpm=d,void(this.tempoEnum=l.andanteModerato)):c.isStringInStringList(c.listInstantaneousTempoAndante,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.andante)),this.tempoInBpm=d,void(this.tempoEnum=l.andante)):c.isStringInStringList(c.listInstantaneousTempoAndantino,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.andantino)),this.tempoInBpm=d,void(this.tempoEnum=l.andantino)):c.isStringInStringList(c.listInstantaneousTempoModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.moderato)),this.tempoInBpm=d,void(this.tempoEnum=l.moderato)):c.isStringInStringList(c.listInstantaneousTempoAllegretto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.allegretto)),this.tempoInBpm=d,void(this.tempoEnum=l.allegretto)):c.isStringInStringList(c.listInstantaneousTempoAllegroModerato,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.allegroModerato)),this.tempoInBpm=d,void(this.tempoEnum=l.allegroModerato)):c.isStringInStringList(c.listInstantaneousTempoAllegro,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.allegro)),this.tempoInBpm=d,void(this.tempoEnum=l.allegro)):c.isStringInStringList(c.listInstantaneousTempoVivace,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.vivace)),this.tempoInBpm=d,void(this.tempoEnum=l.vivace)):c.isStringInStringList(c.listInstantaneousTempoVivacissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.vivacissimo)),this.tempoInBpm=d,void(this.tempoEnum=l.vivacissimo)):c.isStringInStringList(c.listInstantaneousTempoAllegrissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.allegrissimo)),this.tempoInBpm=d,void(this.tempoEnum=l.allegrissimo)):c.isStringInStringList(c.listInstantaneousTempoPresto,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.presto)),this.tempoInBpm=d,void(this.tempoEnum=l.presto)):c.isStringInStringList(c.listInstantaneousTempoPrestissimo,this.label)?(d===0&&(d=c.getDefaultValueForTempoType(l.prestissimo)),this.tempoInBpm=d,void(this.tempoEnum=l.prestissimo)):c.isStringInStringList(c.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=l.addon)):c.isStringInStringList(c.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=l.changes)):void 0:(this.tempoInBpm=d,void(this.tempoEnum=l.metronomeMark))}}var l;o.InstantaneousTempoExpression=c,c.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],c.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],c.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],c.listInstantaneousTempoLargo=["Largo","Breit","broadly"],c.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],c.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],c.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],c.listInstantaneousTempoAndanteModerato=["Andante moderato"],c.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],c.listInstantaneousTempoAndantino=["Andantino","Maestoso"],c.listInstantaneousTempoModerato=["Moderato","Mäßig","Modéré","moderately"],c.listInstantaneousTempoAllegretto=["Allegretto","Animato","fast"],c.listInstantaneousTempoAllegroModerato=["Allegro moderato"],c.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fröhlich"],c.listInstantaneousTempoVivace=["Vivace","Allegro Assai","Lebhaft","Lebendig","lively and fast"],c.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],c.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],c.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],c.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],c.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento","rallentando","ritardando","ritard.","rit.","ritard","rall...","accelerando","accel"],c.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],function(h){h[h.none=0]="none",h[h.larghissimo=1]="larghissimo",h[h.grave=2]="grave",h[h.lento=3]="lento",h[h.largo=4]="largo",h[h.larghetto=5]="larghetto",h[h.adagio=6]="adagio",h[h.adagietto=7]="adagietto",h[h.andanteModerato=8]="andanteModerato",h[h.andante=9]="andante",h[h.andantino=10]="andantino",h[h.moderato=11]="moderato",h[h.allegretto=12]="allegretto",h[h.allegroModerato=13]="allegroModerato",h[h.allegro=14]="allegro",h[h.vivace=15]="vivace",h[h.vivacissimo=16]="vivacissimo",h[h.allegrissimo=17]="allegrissimo",h[h.presto=18]="presto",h[h.prestissimo=19]="prestissimo",h[h.lastRealTempo=20]="lastRealTempo",h[h.addon=21]="addon",h[h.changes=22]="changes",h[h.metronomeMark=23]="metronomeMark"}(l=o.TempoEnum||(o.TempoEnum={}))},7527:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MoodEnum=o.MoodExpression=void 0;const u=r(3748);class a extends u.AbstractExpression{constructor(l,h,d){super(h),this.label=l,this.staffNumber=d,this.setMoodType()}static isInputStringMood(l){return!!l&&(a.isStringInStringList(a.listMoodAffettuoso,l)||a.isStringInStringList(a.listMoodAgitato,l)||a.isStringInStringList(a.listMoodAnimato,l)||a.isStringInStringList(a.listMoodAppassionato,l)||a.isStringInStringList(a.listMoodBrillante,l)||a.isStringInStringList(a.listMoodCantabile,l)||a.isStringInStringList(a.listMoodDolce,l)||a.isStringInStringList(a.listMoodEnergico,l)||a.isStringInStringList(a.listMoodEroico,l)||a.isStringInStringList(a.listMoodEspressivo,l)||a.isStringInStringList(a.listMoodFurioso,l)||a.isStringInStringList(a.listMoodGiocoso,l)||a.isStringInStringList(a.listMoodGioioso,l)||a.isStringInStringList(a.listMoodGrandioso,l)||a.isStringInStringList(a.listMoodGrazioso,l)||a.isStringInStringList(a.listMoodLacrimoso,l)||a.isStringInStringList(a.listMoodLeggiero,l)||a.isStringInStringList(a.listMoodMaestoso,l)||a.isStringInStringList(a.listMoodMalinconico,l)||a.isStringInStringList(a.listMoodMarcato,l)||a.isStringInStringList(a.listMoodMarziale,l)||a.isStringInStringList(a.listMoodMesto,l)||a.isStringInStringList(a.listMoodMorendo,l)||a.isStringInStringList(a.listMoodNobilmente,l)||a.isStringInStringList(a.listMoodPatetico,l)||a.isStringInStringList(a.listMoodPesante,l)||a.isStringInStringList(a.listMoodSaltando,l)||a.isStringInStringList(a.listMoodSautille,l)||a.isStringInStringList(a.listMoodScherzando,l)||a.isStringInStringList(a.listMoodSostenuto,l)||a.isStringInStringList(a.listMoodSpiccato,l)||a.isStringInStringList(a.listMoodTenerezza,l)||a.isStringInStringList(a.listMoodTranquillamente,l)||a.isStringInStringList(a.listMoodTrionfante,l))}get Label(){return this.label}set Label(l){this.label=l}get Mood(){return this.moodType}set Mood(l){this.moodType=l}get StaffNumber(){return this.staffNumber}set StaffNumber(l){this.staffNumber=l}get Placement(){return this.placement}set Placement(l){this.placement=l}setMoodType(){a.isStringInStringList(a.listMoodAffettuoso,this.label)?this.moodType=g.Affettuoso:a.isStringInStringList(a.listMoodAgitato,this.label)?this.moodType=g.Agitato:a.isStringInStringList(a.listMoodAnimato,this.label)?this.moodType=g.Animato:a.isStringInStringList(a.listMoodAppassionato,this.label)?this.moodType=g.Appassionato:a.isStringInStringList(a.listMoodBrillante,this.label)?this.moodType=g.Brillante:a.isStringInStringList(a.listMoodCantabile,this.label)?this.moodType=g.Cantabile:a.isStringInStringList(a.listMoodDolce,this.label)?this.moodType=g.Dolce:a.isStringInStringList(a.listMoodEnergico,this.label)?this.moodType=g.Energico:a.isStringInStringList(a.listMoodEroico,this.label)?this.moodType=g.Eroico:a.isStringInStringList(a.listMoodEspressivo,this.label)?this.moodType=g.Espressivo:a.isStringInStringList(a.listMoodFurioso,this.label)?this.moodType=g.Furioso:a.isStringInStringList(a.listMoodGiocoso,this.label)?this.moodType=g.Giocoso:a.isStringInStringList(a.listMoodGioioso,this.label)?this.moodType=g.Gioioso:a.isStringInStringList(a.listMoodGrandioso,this.label)?this.moodType=g.Grandioso:a.isStringInStringList(a.listMoodGrazioso,this.label)?this.moodType=g.Grazioso:a.isStringInStringList(a.listMoodLacrimoso,this.label)?this.moodType=g.Lacrimoso:a.isStringInStringList(a.listMoodLeggiero,this.label)?this.moodType=g.Leggiero:a.isStringInStringList(a.listMoodMaestoso,this.label)?this.moodType=g.Maestoso:a.isStringInStringList(a.listMoodMalinconico,this.label)?this.moodType=g.Malinconico:a.isStringInStringList(a.listMoodMarcato,this.label)?this.moodType=g.Marcato:a.isStringInStringList(a.listMoodMarziale,this.label)?this.moodType=g.Marziale:a.isStringInStringList(a.listMoodMesto,this.label)?this.moodType=g.Mesto:a.isStringInStringList(a.listMoodMorendo,this.label)?this.moodType=g.Morendo:a.isStringInStringList(a.listMoodNobilmente,this.label)?this.moodType=g.Nobilmente:a.isStringInStringList(a.listMoodPatetico,this.label)?this.moodType=g.Patetico:a.isStringInStringList(a.listMoodPesante,this.label)?this.moodType=g.Pesante:a.isStringInStringList(a.listMoodSaltando,this.label)?this.moodType=g.Saltando:a.isStringInStringList(a.listMoodSautille,this.label)?this.moodType=g.Sautille:a.isStringInStringList(a.listMoodScherzando,this.label)?this.moodType=g.Scherzando:a.isStringInStringList(a.listMoodSostenuto,this.label)?this.moodType=g.Sostenuto:a.isStringInStringList(a.listMoodSpiccato,this.label)?this.moodType=g.Spiccato:a.isStringInStringList(a.listMoodTenerezza,this.label)?this.moodType=g.Tenerezza:a.isStringInStringList(a.listMoodTranquillamente,this.label)?this.moodType=g.Tranquillamente:a.isStringInStringList(a.listMoodTrionfante,this.label)&&(this.moodType=g.Trionfante)}}var g;o.MoodExpression=a,a.listMoodAffettuoso=["affettuoso"],a.listMoodAgitato=["agitato"],a.listMoodAppassionato=["appassionato"],a.listMoodAnimato=["animato","lively"],a.listMoodBrillante=["brillante"],a.listMoodCantabile=["cantabile"],a.listMoodDolce=["dolce"],a.listMoodEnergico=["energico"],a.listMoodEroico=["eroico"],a.listMoodEspressivo=["espressivo"],a.listMoodFurioso=["furioso"],a.listMoodGiocoso=["giocoso"],a.listMoodGioioso=["gioioso"],a.listMoodLacrimoso=["lacrimoso"],a.listMoodGrandioso=["grandioso"],a.listMoodGrazioso=["grazioso"],a.listMoodLeggiero=["leggiero"],a.listMoodMaestoso=["maestoso"],a.listMoodMalinconico=["malinconico"],a.listMoodMarcato=["marcato"],a.listMoodMarziale=["marziale"],a.listMoodMesto=["mesto"],a.listMoodMorendo=["morendo"],a.listMoodNobilmente=["nobilmente"],a.listMoodPatetico=["patetico"],a.listMoodPesante=["pesante"],a.listMoodSautille=["sautille"],a.listMoodSaltando=["saltando"],a.listMoodScherzando=["scherzando"],a.listMoodSostenuto=["sostenuto"],a.listMoodSpiccato=["spiccato"],a.listMoodTenerezza=["tenerezza"],a.listMoodTranquillamente=["tranquillamente"],a.listMoodTrionfante=["trionfante"],function(c){c[c.Affettuoso=0]="Affettuoso",c[c.Agitato=1]="Agitato",c[c.Appassionato=2]="Appassionato",c[c.Animato=3]="Animato",c[c.Brillante=4]="Brillante",c[c.Cantabile=5]="Cantabile",c[c.Dolce=6]="Dolce",c[c.Energico=7]="Energico",c[c.Eroico=8]="Eroico",c[c.Espressivo=9]="Espressivo",c[c.Furioso=10]="Furioso",c[c.Giocoso=11]="Giocoso",c[c.Gioioso=12]="Gioioso",c[c.Lacrimoso=13]="Lacrimoso",c[c.Grandioso=14]="Grandioso",c[c.Grazioso=15]="Grazioso",c[c.Leggiero=16]="Leggiero",c[c.Maestoso=17]="Maestoso",c[c.Malinconico=18]="Malinconico",c[c.Marcato=19]="Marcato",c[c.Marziale=20]="Marziale",c[c.Mesto=21]="Mesto",c[c.Morendo=22]="Morendo",c[c.Nobilmente=23]="Nobilmente",c[c.Patetico=24]="Patetico",c[c.Pesante=25]="Pesante",c[c.Sautille=26]="Sautille",c[c.Saltando=27]="Saltando",c[c.Scherzando=28]="Scherzando",c[c.Sostenuto=29]="Sostenuto",c[c.Spiccato=30]="Spiccato",c[c.Tenerezza=31]="Tenerezza",c[c.Tranquillamente=32]="Tranquillamente",c[c.Trionfante=33]="Trionfante",c[c.Vivace=34]="Vivace"}(g=o.MoodEnum||(o.MoodEnum={}))},6943:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MultiExpressionEntry=o.MultiExpression=void 0;const u=r(1797),a=r(9793),g=r(7839),c=r(7527),l=r(1614),h=r(3748),d=r(2562);o.MultiExpression=class{constructor(f,y){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=f,this.timestamp=y}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(f){this.sourceMeasure=f}get StaffNumber(){return this.staffNumber}set StaffNumber(f){this.staffNumber=f}get Timestamp(){return this.timestamp}set Timestamp(f){this.timestamp=f}get AbsoluteTimestamp(){return u.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(f){this.instantaneousDynamic=f}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(f){this.endingContinuousDynamic=f}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(f){this.startingContinuousDynamic=f}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(f){this.octaveShiftStart=f}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(f){this.octaveShiftEnd=f}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(f){this.combinedExpressionsText=f}getPlacementOfFirstEntry(){let f=h.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof a.InstantaneousDynamicExpression||this.expressions[0].expression instanceof g.ContinuousDynamicExpression||this.expressions[0].expression instanceof c.MoodExpression||this.expressions[0].expression instanceof l.UnknownExpression)&&(f=this.expressions[0].expression.Placement),f}getFontstyleOfFirstEntry(){var f;let y=d.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof g.ContinuousDynamicExpression||this.expressions[0].expression instanceof c.MoodExpression?y=d.FontStyles.Italic:this.expressions[0].expression instanceof l.UnknownExpression&&(y=(f=this.expressions[0].expression.fontStyle)!==null&&f!==void 0?f:d.FontStyles.Regular)),y}addExpression(f,y){f instanceof a.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=f,this.instantaneousDynamic.ParentMultiExpression=this):f instanceof g.ContinuousDynamicExpression?this.startingContinuousDynamic=f:f instanceof c.MoodExpression?this.moodList.push(f):f instanceof l.UnknownExpression&&this.unknownList.push(f),this.addExpressionToEntryList(f,y)}CompareTo(f){return this.Timestamp.RealValue>f.Timestamp.RealValue?1:this.Timestamp.RealValue{Object.defineProperty(o,"__esModule",{value:!0}),o.TempoExpressionEntry=o.MultiTempoExpression=void 0;const u=r(1797),a=r(9667),g=r(3748),c=r(2562),l=r(280);o.MultiTempoExpression=class{constructor(d,E){this.expressions=[],this.sourceMeasure=d,this.timestamp=E}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return u.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(d){this.sourceMeasure=d}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(d){this.combinedExpressionsText=d}getPlacementOfFirstEntry(){let d=g.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof a.InstantaneousTempoExpression||this.expressions[0].Expression instanceof l.ContinuousTempoExpression)&&(d=this.expressions[0].Expression.Placement),d}getFontstyleOfFirstEntry(){let d=c.FontStyles.Regular;return this.expressions[0].Expression instanceof a.InstantaneousTempoExpression?d=c.FontStyles.Bold:this.expressions[0].Expression instanceof l.ContinuousTempoExpression&&(d=c.FontStyles.Italic),d}addExpression(d,E){if(this.checkIfAlreadyExists(d))return;d instanceof a.InstantaneousTempoExpression?this.instantaneousTempo=d:d instanceof l.ContinuousTempoExpression&&(this.continuousTempo=d);const f=new h;f.prefix=E,f.Expression=d,f.label=d.Label,this.expressions.push(f)}CompareTo(d){return this.Timestamp.RealValue>d.Timestamp.RealValue?1:this.Timestamp.RealValue{Object.defineProperty(o,"__esModule",{value:!0}),o.RehearsalExpression=void 0;const u=r(3748);class a extends u.AbstractExpression{constructor(c,l){super(l),this.label=c}}o.RehearsalExpression=a},1614:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnknownExpression=void 0;const u=r(3748),a=r(1274);class g extends u.AbstractExpression{constructor(l,h,d,E){super(h),this.label=l,this.staffNumber=E,d===void 0&&(d=a.TextAlignmentEnum.LeftBottom),this.textAlignment=d}get Label(){return this.label}get Placement(){return this.placement}set Placement(l){this.placement=l}get StaffNumber(){return this.staffNumber}set StaffNumber(l){this.staffNumber=l}get TextAlignment(){return this.textAlignment}}o.UnknownExpression=g},2343:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(3748),o),a(r(9775),o),a(r(4802),o),a(r(9793),o),a(r(9667),o),a(r(7527),o),a(r(6943),o),a(r(6124),o),a(r(7513),o),a(r(1614),o)},7198:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Glissando=void 0;const u=r(1797),a=r(8911);o.Glissando=class{constructor(g){this.notes=[],this.XMLNumber=1,this.AddNote(g),this.StartNote=g,this.Direction=a.ColDirEnum.NotYetDefined}get Notes(){return this.notes}get Duration(){const g=new u.Fraction;for(const c of this.notes)g.Add(c.Length);return g}get Pitch(){return this.StartNote.Pitch}AddNote(g){this.notes.push(g),g.NoteGlissando=this,this.notes.length===2&&(this.notes[0].Pitch.getHalfTone(){Object.defineProperty(o,"__esModule",{value:!0}),o.DynamicsContainer=void 0;const u=r(7839),a=r(9793);o.DynamicsContainer=class{constructor(g,c){g instanceof u.ContinuousDynamicExpression?this.continuousDynamicExpression=g:g instanceof a.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=g),this.staffNumber=c}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}CompareTo(g){return this.parMultiExpression().AbsoluteTimestamp.CompareTo(g.parMultiExpression().AbsoluteTimestamp)}}},1877:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AbstractNotationInstruction=void 0,o.AbstractNotationInstruction=class{constructor(r){this.printObject=!0,this.parent=r}get Parent(){return this.parent}set Parent(r){this.parent=r}get PrintObject(){return this.printObject}set PrintObject(r){this.printObject=r}}},289:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MidiInstrument=o.ClefEnum=o.ClefInstruction=void 0;const u=r(8640),a=r(1877),g=r(8640),c=r(8640),l=r(1703);class h extends a.AbstractNotationInstruction{constructor(y=d.G,S=0,_=2){super(void 0),this.clefType=d.G,this.line=2,this.octaveOffset=0,this.line=_,this.clefType=y,this.octaveOffset=S,this.calcParameters()}static getDefaultClefFromMidiInstrument(y){switch(y){case E.Acoustic_Grand_Piano:case E.Electric_Bass_finger:case E.Electric_Bass_pick:case E.Fretless_Bass:case E.Slap_Bass_1:case E.Slap_Bass_2:case E.Synth_Bass_1:case E.Synth_Bass_2:case E.Contrabass:return new h(d.F,0,4);default:return new h(d.G,0,2)}}static getAllPossibleClefs(){const y=[];for(let S=0;S<=2;S++){const _=new h(d.G,S,2);y.push(_)}for(let S=-2;S<=0;S++){const _=new h(d.F,S,4);y.push(_)}return y}static isSupportedClef(y){switch(y){case d.G:case d.F:case d.C:case d.percussion:case d.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(y){this.clefType=y}get Line(){return this.line}set Line(y){this.line=y}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(y){this.octaveOffset=y}get ClefPitch(){return this.clefPitch}set ClefPitch(y){this.clefPitch=y}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(y){this.referenceCyPosition=y}Equals(y){return this===y||!(!this||!y)&&this.clefPitch===y.clefPitch&&this.Line===y.Line}NotEqual(y){return!this.Equals(y)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case d.G:this.clefPitch=new u.Pitch(g.NoteEnum.G,1+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case d.F:this.clefPitch=new u.Pitch(g.NoteEnum.F,0+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case d.C:this.clefPitch=new u.Pitch(g.NoteEnum.C,1+this.octaveOffset,c.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case d.percussion:this.clefPitch=new u.Pitch(g.NoteEnum.C,2,c.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case d.TAB:this.clefPitch=new u.Pitch(g.NoteEnum.G,0,c.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new l.ArgumentOutOfRangeException("clefType")}}}var d,E;o.ClefInstruction=h,function(f){f[f.G=0]="G",f[f.F=1]="F",f[f.C=2]="C",f[f.percussion=3]="percussion",f[f.TAB=4]="TAB"}(d=o.ClefEnum||(o.ClefEnum={})),function(f){f[f.None=-1]="None",f[f.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",f[f.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",f[f.Electric_Grand_Piano=2]="Electric_Grand_Piano",f[f.Honky_tonk_Piano=3]="Honky_tonk_Piano",f[f.Electric_Piano_1=4]="Electric_Piano_1",f[f.Electric_Piano_2=5]="Electric_Piano_2",f[f.Harpsichord=6]="Harpsichord",f[f.Clavinet=7]="Clavinet",f[f.Celesta=8]="Celesta",f[f.Glockenspiel=9]="Glockenspiel",f[f.Music_Box=10]="Music_Box",f[f.Vibraphone=11]="Vibraphone",f[f.Marimba=12]="Marimba",f[f.Xylophone=13]="Xylophone",f[f.Tubular_Bells=14]="Tubular_Bells",f[f.Dulcimer=15]="Dulcimer",f[f.Drawbar_Organ=16]="Drawbar_Organ",f[f.Percussive_Organ=17]="Percussive_Organ",f[f.Rock_Organ=18]="Rock_Organ",f[f.Church_Organ=19]="Church_Organ",f[f.Reed_Organ=20]="Reed_Organ",f[f.Accordion=21]="Accordion",f[f.Harmonica=22]="Harmonica",f[f.Tango_Accordion=23]="Tango_Accordion",f[f.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",f[f.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",f[f.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",f[f.Electric_Guitar_clean=27]="Electric_Guitar_clean",f[f.Electric_Guitar_muted=28]="Electric_Guitar_muted",f[f.Overdriven_Guitar=29]="Overdriven_Guitar",f[f.Distortion_Guitar=30]="Distortion_Guitar",f[f.Guitar_harmonics=31]="Guitar_harmonics",f[f.Acoustic_Bass=32]="Acoustic_Bass",f[f.Electric_Bass_finger=33]="Electric_Bass_finger",f[f.Electric_Bass_pick=34]="Electric_Bass_pick",f[f.Fretless_Bass=35]="Fretless_Bass",f[f.Slap_Bass_1=36]="Slap_Bass_1",f[f.Slap_Bass_2=37]="Slap_Bass_2",f[f.Synth_Bass_1=38]="Synth_Bass_1",f[f.Synth_Bass_2=39]="Synth_Bass_2",f[f.Violin=40]="Violin",f[f.Viola=41]="Viola",f[f.Cello=42]="Cello",f[f.Contrabass=43]="Contrabass",f[f.Tremolo_Strings=44]="Tremolo_Strings",f[f.Pizzicato_Strings=45]="Pizzicato_Strings",f[f.Orchestral_Harp=46]="Orchestral_Harp",f[f.Timpani=47]="Timpani",f[f.String_Ensemble_1=48]="String_Ensemble_1",f[f.String_Ensemble_2=49]="String_Ensemble_2",f[f.Synth_Strings_1=50]="Synth_Strings_1",f[f.Synth_Strings_2=51]="Synth_Strings_2",f[f.Choir_Aahs=52]="Choir_Aahs",f[f.Voice_Oohs=53]="Voice_Oohs",f[f.Synth_Voice=54]="Synth_Voice",f[f.Orchestra_Hit=55]="Orchestra_Hit",f[f.Trumpet=56]="Trumpet",f[f.Trombone=57]="Trombone",f[f.Tuba=58]="Tuba",f[f.Muted_Trumpet=59]="Muted_Trumpet",f[f.French_Horn=60]="French_Horn",f[f.Brass_Section=61]="Brass_Section",f[f.Synth_Brass_1=62]="Synth_Brass_1",f[f.Synth_Brass_2=63]="Synth_Brass_2",f[f.Soprano_Sax=64]="Soprano_Sax",f[f.Alto_Sax=65]="Alto_Sax",f[f.Tenor_Sax=66]="Tenor_Sax",f[f.Baritone_Sax=67]="Baritone_Sax",f[f.Oboe=68]="Oboe",f[f.English_Horn=69]="English_Horn",f[f.Bassoon=70]="Bassoon",f[f.Clarinet=71]="Clarinet",f[f.Piccolo=72]="Piccolo",f[f.Flute=73]="Flute",f[f.Recorder=74]="Recorder",f[f.Pan_Flute=75]="Pan_Flute",f[f.Blown_Bottle=76]="Blown_Bottle",f[f.Shakuhachi=77]="Shakuhachi",f[f.Whistle=78]="Whistle",f[f.Ocarina=79]="Ocarina",f[f.Lead_1_square=80]="Lead_1_square",f[f.Lead_2_sawtooth=81]="Lead_2_sawtooth",f[f.Lead_3_calliope=82]="Lead_3_calliope",f[f.Lead_4_chiff=83]="Lead_4_chiff",f[f.Lead_5_charang=84]="Lead_5_charang",f[f.Lead_6_voice=85]="Lead_6_voice",f[f.Lead_7_fifths=86]="Lead_7_fifths",f[f.Lead_8_bass_lead=87]="Lead_8_bass_lead",f[f.Pad_1_new_age=88]="Pad_1_new_age",f[f.Pad_2_warm=89]="Pad_2_warm",f[f.Pad_3_polysynth=90]="Pad_3_polysynth",f[f.Pad_4_choir=91]="Pad_4_choir",f[f.Pad_5_bowed=92]="Pad_5_bowed",f[f.Pad_6_metallic=93]="Pad_6_metallic",f[f.Pad_7_halo=94]="Pad_7_halo",f[f.Pad_8_sweep=95]="Pad_8_sweep",f[f.FX_1_rain=96]="FX_1_rain",f[f.FX_2_soundtrack=97]="FX_2_soundtrack",f[f.FX_3_crystal=98]="FX_3_crystal",f[f.FX_4_atmosphere=99]="FX_4_atmosphere",f[f.FX_5_brightness=100]="FX_5_brightness",f[f.FX_6_goblins=101]="FX_6_goblins",f[f.FX_7_echoes=102]="FX_7_echoes",f[f.FX_8_scifi=103]="FX_8_scifi",f[f.Sitar=104]="Sitar",f[f.Banjo=105]="Banjo",f[f.Shamisen=106]="Shamisen",f[f.Koto=107]="Koto",f[f.Kalimba=108]="Kalimba",f[f.Bag_pipe=109]="Bag_pipe",f[f.Fiddle=110]="Fiddle",f[f.Shanai=111]="Shanai",f[f.Tinkle_Bell=112]="Tinkle_Bell",f[f.Agogo=113]="Agogo",f[f.Steel_Drums=114]="Steel_Drums",f[f.Woodblock=115]="Woodblock",f[f.Taiko_Drum=116]="Taiko_Drum",f[f.Melodic_Tom=117]="Melodic_Tom",f[f.Synth_Drum=118]="Synth_Drum",f[f.Reverse_Cymbal=119]="Reverse_Cymbal",f[f.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",f[f.Breath_Noise=121]="Breath_Noise",f[f.Seashore=122]="Seashore",f[f.Bird_Tweet=123]="Bird_Tweet",f[f.Telephone_Ring=124]="Telephone_Ring",f[f.Helicopter=125]="Helicopter",f[f.Applause=126]="Applause",f[f.Gunshot=127]="Gunshot",f[f.Percussion=128]="Percussion"}(E=o.MidiInstrument||(o.MidiInstrument={}))},5198:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.KeyEnum=o.NoteEnumToHalfToneLink=o.KeyInstruction=void 0;const u=r(1877),a=r(8640),g=r(8640);class c extends u.AbstractNotationInstruction{constructor(d=void 0,E=0,f=l.major){super(d),this.isTransposedBy=0,this.Key=E,this.keyTypeOriginal=E,this.mode=f,this.alteratedNotes=this.calcAlteratedNotes()}static copy(d){const E=new c(d.parent,d.Key,d.Mode);return E.keyTypeOriginal=d.keyTypeOriginal,E}static getAllPossibleMajorKeyInstructions(){const d=[];for(let E=-7;E<7;E++){const f=new c(void 0,E,l.major);d.push(f)}return d}get Key(){return this.keyType}set Key(d){this.keyType=d,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(d){this.mode=d}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const d=[];if(this.keyType>0)for(let E=0;E=0}getAlterationForPitch(d){return this.keyType>0&&this.alteratedNotes.indexOf(d.FundamentalNote)<=this.keyType?g.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(d.FundamentalNote)<=Math.abs(this.keyType)?g.AccidentalEnum.FLAT:g.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(d){const E=this;return E===d||!(!E||!d)&&E.Key===d.Key&&E.Mode===d.Mode}OperatorNotEqual(d){return!this.OperatorEquals(d)}}var l;o.KeyInstruction=c,c.sharpPositionList=[a.NoteEnum.F,a.NoteEnum.C,a.NoteEnum.G,a.NoteEnum.D,a.NoteEnum.A,a.NoteEnum.E,a.NoteEnum.B],c.flatPositionList=[a.NoteEnum.B,a.NoteEnum.E,a.NoteEnum.A,a.NoteEnum.D,a.NoteEnum.G,a.NoteEnum.C,a.NoteEnum.F],o.NoteEnumToHalfToneLink=class{constructor(h,d){this.note=h,this.halfTone=d}},function(h){h[h.major=0]="major",h[h.minor=1]="minor",h[h.none=2]="none",h[h.dorian=3]="dorian",h[h.phrygian=4]="phrygian",h[h.lydian=5]="lydian",h[h.mixolydian=6]="mixolydian",h[h.aeolian=7]="aeolian",h[h.ionian=8]="ionian",h[h.locrian=9]="locrian"}(l=o.KeyEnum||(o.KeyEnum={}))},6189:(b,o)=>{var r,u;Object.defineProperty(o,"__esModule",{value:!0}),o.AlignmentType=o.RepetitionInstructionEnum=o.RepetitionInstruction=o.RepetitionInstructionComparer=void 0,o.RepetitionInstructionComparer=class{static Compare(a,g){if(a.parentRepetition!==void 0&&g.parentRepetition){if(a.alignment===u.End&&g.alignment===u.End){if(a.parentRepetition.StartIndexg.parentRepetition.StartIndex)return-1}if(a.alignment===u.Begin&&g.alignment===u.Begin){if(a.parentRepetition.EndIndexg.parentRepetition.EndIndex)return-1}}return 0}},o.RepetitionInstruction=class{constructor(a,g,c=u.End,l=void 0,h=void 0){this.endingIndices=void 0,this.measureIndex=a,h&&(this.endingIndices=h.slice()),this.type=g,this.alignment=c,this.parentRepetition=l}CompareTo(a){const g=a;if(this.measureIndex>g.measureIndex)return 1;if(this.measureIndex{Object.defineProperty(o,"__esModule",{value:!0}),o.RhythmSymbolEnum=o.RhythmInstruction=void 0;const u=r(1877);class a extends u.AbstractNotationInstruction{constructor(l,h){super(void 0),this.rhythm=l,this.numerator=l.Numerator,this.denominator=l.Denominator,this.symbolEnum=h}get Rhythm(){return this.rhythm}set Rhythm(l){this.rhythm=l}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(l){this.symbolEnum=l}clone(){return new a(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(l){const h=this;return h===l||!(!h||!l)&&h.numerator===l.numerator&&h.denominator===l.denominator}OperatorNotEqual(l){return this!==l}ToString(){return"Rhythm: "+this.rhythm.toString()}}var g;o.RhythmInstruction=a,(g=o.RhythmSymbolEnum||(o.RhythmSymbolEnum={}))[g.NONE=0]="NONE",g[g.COMMON=1]="COMMON",g[g.CUT=2]="CUT"},1357:(b,o)=>{var r;Object.defineProperty(o,"__esModule",{value:!0}),o.TechnicalInstruction=o.TechnicalInstructionType=void 0,(r=o.TechnicalInstructionType||(o.TechnicalInstructionType={}))[r.Fingering=0]="Fingering",r[r.String=1]="String",o.TechnicalInstruction=class{}},6065:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(1877),o),a(r(289),o),a(r(5198),o),a(r(6189),o),a(r(3331),o),a(r(1357),o)},2947:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkedVoice=void 0;const u=r(3884);class a extends u.Voice{constructor(c,l,h){super(c,l),this.master=h}get Master(){return this.master}}o.LinkedVoice=a},7274:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LyricsEntry=void 0;const u=r(2562);o.LyricsEntry=class{constructor(a,g,c,l,h=-1){this.text=a,this.word=c,this.parent=l,this.verseNumber=g,h>=0&&(this.syllableIndex=h)}get Text(){return this.text}set Text(a){this.text=a}get Word(){return this.word}get Parent(){return this.parent}set Parent(a){this.parent=a}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}get IsTranslation(){return this.VerseNumber.endsWith("translation")}get IsChorus(){return this.VerseNumber.startsWith("chorus")}get FontStyle(){return this.IsChorus||this.IsTranslation?u.FontStyles.Italic:u.FontStyles.Regular}}},2672:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LyricWord=void 0,o.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(r){for(let u=0,a=this.Syllables.length;u{Object.defineProperty(o,"__esModule",{value:!0}),o.Appearance=o.Note=void 0;const u=r(1797);var a;o.Note=class{constructor(g,c,l,h,d,E){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=g,this.parentStaffEntry=c,this.length=l,this.pitch=h,this.sourceMeasure=d,this.isRestFlag=E!=null&&E,this.halfTone=h?h.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}ToStringShort(g=0){var c;return!this.Pitch||this.isRest()?"rest":(c=this.Pitch)===null||c===void 0?void 0:c.ToStringShort(g)}get ToStringShortGet(){return this.ToStringShort(0)}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(g){this.voiceEntry=g}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set Length(g){this.length=g}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(g){this.typeLength=g}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(g){this.noteTypeXml=g}get NormalNotes(){return this.normalNotes}set NormalNotes(g){this.normalNotes=g}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(g){this.beam=g}set Notehead(g){this.notehead=g}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(g){this.tuplet=g}get NoteGlissando(){return this.glissando}set NoteGlissando(g){this.glissando=g}get NoteTie(){return this.tie}set NoteTie(g){this.tie=g}get NoteSlurs(){return this.slurs}set NoteSlurs(g){this.slurs=g}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(g){this.playbackInstrumentId=g}get PrintObject(){return this.printObject}set PrintObject(g){this.printObject=g}get Arpeggio(){return this.arpeggio}set Arpeggio(g){this.arpeggio=g}get IsCueNote(){return this.isCueNote}set IsCueNote(g){this.isCueNote=g}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(g){this.stemDirectionXml=g}get TremoloStrokes(){var g;return(g=this.TremoloInfo)===null||g===void 0?void 0:g.tremoloStrokes}get StemColorXml(){return this.stemColorXml}set StemColorXml(g){this.stemColorXml=g}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(g){this.noteheadColorXml=g}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(g){this.noteheadColor=g}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(g){this.noteheadColorCurrentlyRendered=g}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}isWholeMeasureNote(){return this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return u.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}isDuplicateSlur(g){for(let c=0,l=this.slurs.length;c{Object.defineProperty(o,"__esModule",{value:!0}),o.NoteTypeHandler=o.NoteType=void 0;const u=r(1797),a=r(6331),g=r(1703);var c;(function(h){h[h.UNDEFINED=0]="UNDEFINED",h[h._1024th=1]="_1024th",h[h._512th=2]="_512th",h[h._256th=3]="_256th",h[h._128th=4]="_128th",h[h._64th=5]="_64th",h[h._32nd=6]="_32nd",h[h._16th=7]="_16th",h[h.EIGTH=8]="EIGTH",h[h.QUARTER=9]="QUARTER",h[h.HALF=10]="HALF",h[h.WHOLE=11]="WHOLE",h[h.BREVE=12]="BREVE",h[h.LONG=13]="LONG",h[h.MAXIMA=14]="MAXIMA"})(c=o.NoteType||(o.NoteType={}));class l{static NoteTypeToString(d){return this.NoteTypeXmlValues[d]}static StringToNoteType(d){const E=this.NoteTypeXmlValues.indexOf(d);return E!==-1?E:c.UNDEFINED}static getNoteDurationFromType(d){switch(d){case"1024th":return new u.Fraction(1,1024);case"512th":return new u.Fraction(1,512);case"256th":return new u.Fraction(1,256);case"128th":return new u.Fraction(1,128);case"64th":return new u.Fraction(1,64);case"32th":case"32nd":return new u.Fraction(1,32);case"16th":return new u.Fraction(1,16);case"eighth":return new u.Fraction(1,8);case"quarter":return new u.Fraction(1,4);case"half":return new u.Fraction(1,2);case"whole":return new u.Fraction(1,1);case"breve":return new u.Fraction(2,1);case"long":return new u.Fraction(4,1);case"maxima":return new u.Fraction(8,1);default:{const E=a.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new g.MusicSheetReadingException(E)}}}}o.NoteTypeHandler=l,l.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},766:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.NoteHeadShape=o.Notehead=void 0;const a=u(r(2043));class g{constructor(h,d,E=void 0){this.sourceNote=h,this.setShapeFromXml(d,E)}setShapeFromXml(h,d=void 0){this.shape=g.ShapeTypeXmlToShape(h);let E=d;E===void 0&&(this.sourceNote?E=this.sourceNote.Length.Denominator>2:(a.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),E=!0)),this.filled=E}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(h){switch(h.toLowerCase()){case"normal":return c.NORMAL;case"x":return c.X;case"slash":return c.SLASH;case"diamond":return c.DIAMOND;case"square":case"la":return c.SQUARE;case"do":case"triangle":return c.TRIANGLE;case"inverted triangle":return c.TRIANGLE_INVERTED;case"rectangle":return c.RECTANGLE;case"circle-x":return c.CIRCLEX;default:return a.default.info("unsupported/unhandled xml notehead '"+h+"'. Using normal notehead."),c.NORMAL}}}var c;o.Notehead=g,function(l){l[l.CIRCLEX=0]="CIRCLEX",l[l.DIAMOND=1]="DIAMOND",l[l.NORMAL=2]="NORMAL",l[l.RECTANGLE=3]="RECTANGLE",l[l.SLASH=4]="SLASH",l[l.SQUARE=5]="SQUARE",l[l.TRIANGLE=6]="TRIANGLE",l[l.TRIANGLE_INVERTED=7]="TRIANGLE_INVERTED",l[l.X=8]="X"}(c=o.NoteHeadShape||(o.NoteHeadShape={}))},5922:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OrnamentEnum=o.OrnamentContainer=void 0;const u=r(8640),a=r(3748);var g;o.OrnamentContainer=class{constructor(c){this.placement=a.PlacementEnum.Above,this.accidentalAbove=u.AccidentalEnum.NONE,this.accidentalBelow=u.AccidentalEnum.NONE,this.ornament=c}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(c){this.accidentalAbove=c}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(c){this.accidentalBelow=c}},(g=o.OrnamentEnum||(o.OrnamentEnum={}))[g.Trill=0]="Trill",g[g.Turn=1]="Turn",g[g.InvertedTurn=2]="InvertedTurn",g[g.DelayedTurn=3]="DelayedTurn",g[g.DelayedInvertedTurn=4]="DelayedInvertedTurn",g[g.Mordent=5]="Mordent",g[g.InvertedMordent=6]="InvertedMordent"},5942:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SourceMeasure=void 0;const u=r(1797),a=r(141),g=r(9050),c=r(6189),l=r(908),h=r(289),d=r(5198),E=r(6894);o.SourceMeasure=class{constructor(f,y){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.completeNumberOfStaves=f,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=E.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(f),this.lastInstructionsStaffEntries=new Array(f),this.rules=y,this.TempoInBPM=0;for(let S=0;S1)return f[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(f){this.verticalMeasureList=f}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(f){this.tempoInBPM=f}findOrCreateStaffEntry(f,y,S){let _,P;for(const x of this.verticalSourceStaffEntryContainers)if(x.Timestamp.Equals(f)){P=x;break}if(P)return P.StaffEntries[y]?_=P.StaffEntries[y]:(_=new g.SourceStaffEntry(P,S),P.StaffEntries[y]=_),{createdNewContainer:!1,staffEntry:_};const w=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(this.verticalSourceStaffEntryContainers.length===0||w.Timestamp.lt(f)){const x=new a.VerticalSourceStaffEntryContainer(this,f.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(x),_=new g.SourceStaffEntry(x,S),x.StaffEntries[y]=_}else for(let x=this.verticalSourceStaffEntryContainers.length-1;x>=0;x--){if(this.verticalSourceStaffEntryContainers[x].Timestamp.lt(f)){const M=new a.VerticalSourceStaffEntryContainer(this,f.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(x+1,0,M),_=new g.SourceStaffEntry(M,S),M.StaffEntries[y]=_;break}if(x===0){const M=new a.VerticalSourceStaffEntryContainer(this,f.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(x,0,M),_=new g.SourceStaffEntry(M,S),M.StaffEntries[y]=_;break}}return{createdNewContainer:!0,staffEntry:_}}findOrCreateVoiceEntry(f,y){let S,_=!1;for(const P of f.VoiceEntries)if(P.ParentVoice===y){S=P;break}return S||(S=new l.VoiceEntry(f.Timestamp,y,f),_=!0),{createdVoiceEntry:_,voiceEntry:S}}getPreviousSourceStaffEntryFromIndex(f,y){for(let S=y-1;S>=0;S--)if(this.verticalSourceStaffEntryContainers[S][f])return this.verticalSourceStaffEntryContainers[S][f]}getVerticalContainerIndexByTimestamp(f){for(let y=0,S=this.VerticalSourceStaffEntryContainers.length;y=0;R--){const A=this.verticalSourceStaffEntryContainers[R][x+M];if(A!==void 0&&A.hasTie()&&w.lt(u.Fraction.plus(A.Timestamp,A.calculateMaxNoteLength()))){w=u.Fraction.plus(A.Timestamp,A.calculateMaxNoteLength());break}}}_.push(w)}for(let P=0,w=_.length;P0)return!0}return!1}beginsWithLineRepetition(){for(let f=0,y=this.FirstRepetitionInstructions.length;f=0;_--)if(S=this.verticalSourceStaffEntryContainers[_].StaffEntries[f],S&&(!y||S.VoiceEntries.length>0))return S}canBeReducedToMultiRest(){var f,y;if(this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;let S=!0,_=!1;for(const P of this.verticalSourceStaffEntryContainers)if(P){for(const w of P.StaffEntries)if(w&&w.ParentStaff.ParentInstrument.Visible){if(w.ChordContainers.length>0)return!1;w.ParentStaff.hasLyrics&&(_=!0);for(const x of w.VoiceEntries){for(const M of x.Notes)if(!M.isRest()){S=!1;break}if(!S)break}}}if(!S||_||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const P of this.staffLinkedExpressions)if(P.length>0)return!1;for(const P of this.lastInstructionsStaffEntries)for(let w=0,x=P==null?void 0:P.Instructions.length;w{Object.defineProperty(o,"__esModule",{value:!0}),o.SourceStaffEntry=void 0;const u=r(1797),a=r(289),g=r(5198),c=r(3331);o.SourceStaffEntry=class{constructor(l,h){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=l,this.parentStaff=h}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return u.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(l){this.voiceEntries=l}get Link(){return this.staffEntryLink}set Link(l){this.staffEntryLink=l}get Instructions(){return this.instructions}set Instructions(l){this.instructions=l}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(l){this.chordSymbolContainers=l}removeAllInstructionsOfTypeClefInstruction(){let l=0,h=0;for(;l0)return!0;return!1}hasTie(){for(let l=0,h=this.VoiceEntries.length;l{Object.defineProperty(o,"__esModule",{value:!0}),o.Staff=void 0,o.Staff=class{constructor(r,u){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.hasLyrics=!1,this.openTieDict={},this.parentInstrument=r,this.id=u,this.audible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(r){this.parentInstrument=r}get Voices(){return this.voices}get Id(){return this.id}get Volume(){return this.volume}set Volume(r){this.volume=r}get StafflineCount(){return this.stafflineCount}set StafflineCount(r){this.stafflineCount=r}}},4447:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StaffEntryLink=void 0,o.StaffEntryLink=class{constructor(r){this.linkStaffEntries=[],this.voiceEntry=r}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(r){this.linkStaffEntries=r}}},2953:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TabNote=void 0;const u=r(5253);class a extends u.Note{constructor(c,l,h,d,E,f,y,S,_){super(c,l,h,d,E),this.stringNumberTab=f,this.fretNumber=y,this.bendArray=S,this.vibratoStroke=_}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}get VibratoStroke(){return this.vibratoStroke}}o.TabNote=a},4555:function(b,o,r){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0}),o.Tie=void 0;const a=r(1797),g=r(3748),c=u(r(2043));o.Tie=class{constructor(l,h){this.notes=[],this.TieNumber=1,this.TieDirection=g.PlacementEnum.NotYetDefined,this.NoteIndexToTieDirection={},this.AddNote(l),this.type=h}getTieDirection(l){if(!l)return this.TieDirection;for(let h=0;h{Object.defineProperty(o,"__esModule",{value:!0}),o.Tuplet=void 0,o.Tuplet=class{constructor(r,u=!1){this.PlacementFromXml=!1,this.RenderTupletNumber=!0,this.notes=[],this.fractions=[],this.tupletLabelNumber=r,this.bracket=u}shouldBeBracketed(r,u,a){if(r&&this.BracketedXmlValue!==void 0)return this.BracketedXmlValue;const g=this.Notes[0][0].NoteBeam;if(!g)return!0;for(const c of this.Notes)if(c[0].NoteBeam!==g)return!0;return this.Bracket||this.TupletLabelNumber===3&&a||this.TupletLabelNumber!==3&&u}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(r){this.tupletLabelNumber=r}get Notes(){return this.notes}set Notes(r){this.notes=r}get Fractions(){return this.fractions}set Fractions(r){this.fractions=r}get Bracket(){return this.bracket}set Bracket(r){this.bracket=r}getNoteIndex(r){for(let u=this.notes.length-1;u>=0;u--)for(let a=0;a{Object.defineProperty(o,"__esModule",{value:!0}),o.VerticalSourceStaffEntryContainer=void 0;const u=r(1797);o.VerticalSourceStaffEntryContainer=class{constructor(a,g,c){this.staffEntries=[],this.comments=[],this.timestamp=g,this.staffEntries=new Array(c),this.parentMeasure=a}$get$(a){return this.staffEntries[a]}$set$(a,g){this.staffEntries[a]=g}get Timestamp(){return this.timestamp}set Timestamp(a){this.timestamp=a}get StaffEntries(){return this.staffEntries}set StaffEntries(a){this.staffEntries=a}get Comments(){return this.comments}set Comments(a){this.comments=a}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(a){this.parentMeasure=a}getAbsoluteTimestamp(){return u.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},3884:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Voice=void 0,o.Voice=class{constructor(r,u){this.voiceEntries=[],this.volume=1,this.parent=r,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=u}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(r){this.visible=r}get Audible(){return this.audible}set Audible(r){this.audible=r}get Following(){return this.following}set Following(r){this.following=r}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(r){this.volume=r}}},908:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StemDirectionType=o.ArticulationEnum=o.VoiceEntry=void 0;const u=r(1797),a=r(5253),g=r(8640),c=r(5922),l=r(8640),h=r(1649);class d{constructor(S,_,P,w=!1,x=!1,M=!1){if(this.notes=[],this.articulations=[],this.technicalInstructions=[],this.lyricsEntries=new h.Dictionary,this.wantedStemDirection=f.Undefined,this.stemDirectionXml=f.Undefined,this.stemDirection=f.Undefined,this.timestamp=S,this.parentVoice=_,this.parentSourceStaffEntry=P,this.isGrace=w,this.graceAfterMainNote=!1,this.graceNoteSlash=x,this.graceSlur=M,P!==void 0){const N=P.VoiceEntries;N.indexOf(this)===-1&&N.push(this)}}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(S){this.timestamp=S}get Notes(){return this.notes}get IsGrace(){return this.isGrace}set IsGrace(S){this.isGrace=S}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(S){this.graceAfterMainNote=S}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(S){this.graceNoteSlash=S}get GraceSlur(){return this.graceSlur}set GraceSlur(S){this.graceSlur=S}get Articulations(){return this.articulations}set Articulations(S){this.articulations=S}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(S){this.arpeggio=S}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(S){this.ornamentContainer=S}set WantedStemDirection(S){this.wantedStemDirection=S}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(S){this.stemDirectionXml=S}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(S){this.stemDirection=S}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(S){this.stemColorXml=S}get StemColor(){return this.stemColor}set StemColor(S){this.stemColor=S}hasArticulation(S){for(const _ of this.articulations)if(_.Equals(S))return!0;return!1}static isSupportedArticulation(S){switch(S){case E.accent:case E.strongaccent:case E.softaccent:case E.invertedstrongaccent:case E.staccato:case E.staccatissimo:case E.spiccato:case E.tenuto:case E.fermata:case E.invertedfermata:case E.breathmark:case E.caesura:case E.lefthandpizzicato:case E.naturalharmonic:case E.snappizzicato:case E.upbow:case E.downbow:case E.bend:return!0;default:return!1}}hasTie(){for(let S=0,_=this.Notes.length;S<_;++S)if(this.Notes[S].NoteTie)return!0;return!1}hasSlur(){for(let S=0,_=this.Notes.length;S<_;++S)if(this.Notes[S].NoteSlurs.length>0)return!0;return!1}isStaccato(){for(const S of this.Articulations)if(S.articulationEnum===E.staccato)return!0;return!1}isAccent(){for(const S of this.Articulations)if(S.articulationEnum===E.accent||S.articulationEnum===E.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(S){let _="1";return this.lyricsEntries.forEach((P,w)=>{S===w&&(_=P)}),_}createVoiceEntriesForOrnament(S,_){S||(S=this);const P=[];if(!S.ornamentContainer)return;const w=this.notes[0],x=w.Length,M=S.ParentVoice,N=S.Timestamp;let R=u.Fraction.createFromFraction(N);switch(S.ornamentContainer.GetOrnament){case c.OrnamentEnum.Trill:{const A=new u.Fraction(x.Numerator,8*x.Denominator),F=w.Pitch.getTransposedPitch(1);let U=_.getAlterationForPitch(F);S.OrnamentContainer.AccidentalAbove!==l.AccidentalEnum.NONE&&(U=S.ornamentContainer.AccidentalAbove);for(let Y=0;Y<8;Y++)R=u.Fraction.plus(N,new u.Fraction(Y*A.Numerator,A.Denominator)),Y%2==0?this.createBaseVoiceEntry(R,A,M,w,P):this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P);break}case c.OrnamentEnum.Turn:{const A=new u.Fraction(x.Numerator,4*x.Denominator),F=w.Pitch.getTransposedPitch(-1),U=_.getAlterationForPitch(F),Y=w.Pitch.getTransposedPitch(1),k=_.getAlterationForPitch(Y);this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,Y,k,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P);break}case c.OrnamentEnum.InvertedTurn:{const A=new u.Fraction(x.Numerator,4*x.Denominator),F=w.Pitch.getTransposedPitch(-1),U=_.getAlterationForPitch(F),Y=w.Pitch.getTransposedPitch(1),k=_.getAlterationForPitch(Y);this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,Y,k,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P);break}case c.OrnamentEnum.DelayedTurn:{const A=new u.Fraction(x.Numerator,2*x.Denominator),F=w.Pitch.getTransposedPitch(-1),U=_.getAlterationForPitch(F),Y=w.Pitch.getTransposedPitch(1),k=_.getAlterationForPitch(Y);this.createBaseVoiceEntry(R,A,M,w,P),R=u.Fraction.plus(N,A),A.Denominator=8*x.Denominator,this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,Y,k,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P);break}case c.OrnamentEnum.DelayedInvertedTurn:{const A=new u.Fraction(x.Numerator,2*x.Denominator),F=w.Pitch.getTransposedPitch(-1),U=_.getAlterationForPitch(F),Y=w.Pitch.getTransposedPitch(1),k=_.getAlterationForPitch(Y);this.createBaseVoiceEntry(R,A,M,w,P),R=u.Fraction.plus(N,A),A.Denominator=8*x.Denominator,this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,Y,k,P),R.Add(A),this.createBaseVoiceEntry(R,A,M,w,P);break}case c.OrnamentEnum.Mordent:{const A=new u.Fraction(x.Numerator,4*x.Denominator),F=w.Pitch.getTransposedPitch(1),U=_.getAlterationForPitch(F);this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),A.Denominator=2*x.Denominator,R=u.Fraction.plus(N,A),this.createBaseVoiceEntry(R,A,M,w,P);break}case c.OrnamentEnum.InvertedMordent:{const A=new u.Fraction(x.Numerator,4*x.Denominator),F=w.Pitch.getTransposedPitch(-1),U=_.getAlterationForPitch(F);this.createBaseVoiceEntry(R,A,M,w,P),R.Add(A),this.createAlteratedVoiceEntry(R,A,M,w.SourceMeasure,F,U,P),A.Denominator=2*x.Denominator,R=u.Fraction.plus(N,A),this.createBaseVoiceEntry(R,A,M,w,P);break}default:throw new RangeError}return P}createBaseVoiceEntry(S,_,P,w,x){const M=new d(S,P,w.ParentStaffEntry),N=new g.Pitch(w.Pitch.FundamentalNote,w.Pitch.Octave,w.Pitch.Accidental),R=new a.Note(M,void 0,_,N,w.SourceMeasure);M.Notes.push(R),x.push(M)}createAlteratedVoiceEntry(S,_,P,w,x,M,N){const R=new d(S,P,void 0),A=new g.Pitch(x.FundamentalNote,x.Octave,M),F=new a.Note(R,void 0,_,A,w);R.Notes.push(F),N.push(R)}}var E,f;o.VoiceEntry=d,function(y){y[y.accent=0]="accent",y[y.strongaccent=1]="strongaccent",y[y.softaccent=2]="softaccent",y[y.marcatoup=3]="marcatoup",y[y.marcatodown=4]="marcatodown",y[y.invertedstrongaccent=5]="invertedstrongaccent",y[y.staccato=6]="staccato",y[y.staccatissimo=7]="staccatissimo",y[y.spiccato=8]="spiccato",y[y.tenuto=9]="tenuto",y[y.fermata=10]="fermata",y[y.invertedfermata=11]="invertedfermata",y[y.breathmark=12]="breathmark",y[y.caesura=13]="caesura",y[y.lefthandpizzicato=14]="lefthandpizzicato",y[y.naturalharmonic=15]="naturalharmonic",y[y.snappizzicato=16]="snappizzicato",y[y.upbow=17]="upbow",y[y.downbow=18]="downbow",y[y.scoop=19]="scoop",y[y.plop=20]="plop",y[y.doit=21]="doit",y[y.falloff=22]="falloff",y[y.stress=23]="stress",y[y.unstress=24]="unstress",y[y.detachedlegato=25]="detachedlegato",y[y.otherarticulation=26]="otherarticulation",y[y.bend=27]="bend"}(E=o.ArticulationEnum||(o.ArticulationEnum={})),function(y){y[y.Undefined=-1]="Undefined",y[y.Up=0]="Up",y[y.Down=1]="Down",y[y.None=2]="None",y[y.Double=3]="Double"}(f=o.StemDirectionType||(o.StemDirectionType={}))},6550:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(3029),o),a(r(9224),o),a(r(4123),o),a(r(7198),o),a(r(2947),o),a(r(5253),o),a(r(766),o),a(r(2478),o),a(r(5922),o),a(r(5942),o),a(r(9050),o),a(r(0),o),a(r(4447),o),a(r(4555),o),a(r(8069),o),a(r(141),o),a(r(3884),o),a(r(908),o),a(r(6065),o),a(r(5253),o),a(r(2478),o),a(r(5942),o),a(r(9050),o),a(r(141),o),a(r(4555),o)},4761:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(1703),o),a(r(6842),o),a(r(884),o),a(r(2255),o),a(r(7514),o),a(r(5142),o),a(r(6550),o),a(r(4990),o),a(r(4257),o),a(r(9714),o),a(r(4759),o),a(r(4143),o)},3495:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AJAX=void 0,o.AJAX=class{static ajax(r,u=9e3){let a;const g=r.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)a=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));a=new ActiveXObject("Microsoft.XMLHTTP")}return a.timeout=u,new Promise((c,l)=>{a.onreadystatechange=()=>{a.readyState===XMLHttpRequest.DONE&&(a.status===200||a.status===0&&a.responseText?c(a.responseText):l(new Error("Could not retrieve requested URL "+a.status)))},a.ontimeout=h=>{l(new Error("Server request Timeout"))},a.overrideMimeType(g),a.open("GET",r,!0),a.send()})}}},530:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Cursor=void 0;const u=r(1797);o.Cursor=class{constructor(a,g,c){this.hidden=!0,this.currentPageNumber=1,this.skipInvisibleNotes=!0,this.container=a,this.openSheetMusicDisplay=g,this.rules=this.openSheetMusicDisplay.EngravingRules,this.cursorOptions=c;let l=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)l++,this.cursorElementId=`cursorImg-${l}`;const h=document.createElement("img");h.id=this.cursorElementId,h.style.position="absolute",this.cursorOptions.follow===!0?(this.wantedZIndex="-1",h.style.zIndex=this.wantedZIndex):(this.wantedZIndex="-2",h.style.zIndex=this.wantedZIndex),this.cursorElement=h,this.container.appendChild(h)}adjustToBackgroundColor(){let a;a=this.rules.PageBackgroundColor?"1":this.wantedZIndex,this.cursorElement.style.zIndex=a}init(a,g){this.manager=a,this.graphic=g,this.reset(),this.hidden=!0,this.hide()}show(){this.hidden=!1,this.update(),this.adjustToBackgroundColor()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void console.log("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const a=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let g=this.rules.MinMeasureToDrawIndex;g=Math.min(g,a);let c=this.rules.MaxMeasureToDrawIndex;if(c=Math.min(c,a),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>g&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[g].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>c){const l=this.openSheetMusicDisplay.Sheet.SourceMeasures[c];this.openSheetMusicDisplay.Sheet.SelectionEnd=u.Fraction.plus(l.AbsoluteTimestamp,l.Duration)}this.iterator=this.manager.getIterator(),this.iterator.SkipInvisibleNotes=this.skipInvisibleNotes}getStaffEntryFromVoiceEntry(a){const g=a.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,c=a.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(c,g,a.ParentSourceStaffEntry)}update(){if(this.hidden||this.hidden===void 0||this.hidden===null)return;this.updateCurrentPage();const a=this.iterator;let g,c=a.CurrentVisibleVoiceEntries(),l=a.CurrentMeasureIndex,h=0,d=0,E=0;if(c.length!==0||a.FrontReached||a.EndReached||(a.moveToPrevious(),c=a.CurrentVisibleVoiceEntries(),a.moveToNext()),a.FrontReached&&c.length===0){a.moveToNext(),c=a.CurrentVisibleVoiceEntries();const P=this.findVisibleGraphicalMeasure(a.CurrentMeasureIndex);h=P.PositionAndShape.AbsolutePosition.x,g=P.ParentMusicSystem,a.moveToPrevious()}else if(a.EndReached||!a.CurrentVoiceEntries||c.length===0){a.moveToPrevious(),c=a.CurrentVisibleVoiceEntries(),l=a.CurrentMeasureIndex;const P=this.findVisibleGraphicalMeasure(a.CurrentMeasureIndex);h=P.PositionAndShape.AbsolutePosition.x+P.PositionAndShape.Size.width,g=P.ParentMusicSystem,a.moveToNext()}else if(a.CurrentMeasure.isReducedToMultiRest){const P=this.findVisibleGraphicalMeasure(a.CurrentMeasureIndex),w=P.parentSourceMeasure.multipleRestMeasures,x=a.CurrentMeasure.multipleRestMeasureNumber/(w+1),M=P.PositionAndShape.Size.width-P.beginInstructionsWidth;h=P.PositionAndShape.AbsolutePosition.x+P.beginInstructionsWidth+x*M,g=P.ParentMusicSystem}else{const P=c.map(w=>this.getStaffEntryFromVoiceEntry(w)).sort((w,x)=>{var M,N,R,A;return((N=(M=w==null?void 0:w.PositionAndShape)===null||M===void 0?void 0:M.AbsolutePosition)===null||N===void 0?void 0:N.x)<=((A=(R=x==null?void 0:x.PositionAndShape)===null||R===void 0?void 0:R.AbsolutePosition)===null||A===void 0?void 0:A.x)?-1:1})[0];P&&(h=P.PositionAndShape.AbsolutePosition.x,g=P.parentMeasure.ParentMusicSystem)}if(!g)return;d=g.PositionAndShape.AbsolutePosition.y+g.StaffLines[0].PositionAndShape.RelativePosition.y;let f=g.PositionAndShape.AbsolutePosition.y;const y=g.StaffLines[g.StaffLines.length-1];y&&(f+=y.PositionAndShape.RelativePosition.y+y.StaffHeight),E=f-d;const S=this.findVisibleGraphicalMeasure(l);if(!S)return;const _=S.PositionAndShape;if(this.updateWidthAndStyle(_,h,d,E),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const P=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:P<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}findVisibleGraphicalMeasure(a){for(let g=0;g{c.push.apply(c,l.Notes)}),c}GNotesUnderCursor(a){const g=this.VoicesUnderCursor(a),c=[];return g.forEach(l=>{c.push(...l.Notes.map(h=>this.rules.GNote(h)))}),c}updateCurrentPage(){let a=this.iterator.currentTimeStamp;a.RealValue<0&&(a=new u.Fraction(0,0));for(const g of this.graphic.MusicPages)if(g.MusicSystems.last().GetSystemsLastTimeStamp().gt(a)){const c=g.PageNumber;return c!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+c),this.container.appendChild(this.cursorElement)),this.currentPageNumber=c}return 1}get SkipInvisibleNotes(){return this.skipInvisibleNotes}set SkipInvisibleNotes(a){this.skipInvisibleNotes=a,this.iterator.SkipInvisibleNotes=a}get CursorOptions(){return this.cursorOptions}set CursorOptions(a){this.cursorOptions=a}}},41:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OSMDOptions=o.SkyBottomLineBatchCalculatorBackendType=o.BackendType=o.FillEmptyMeasuresWithWholeRests=o.AlignRestOption=o.CursorType=void 0;const u=r(7459);var a,g,c,l,h;(h=o.CursorType||(o.CursorType={}))[h.Standard=0]="Standard",h[h.ThinLeft=1]="ThinLeft",h[h.ShortThinTopLeft=2]="ShortThinTopLeft",h[h.CurrentArea=3]="CurrentArea",h[h.CurrentAreaLeft=4]="CurrentAreaLeft",(l=o.AlignRestOption||(o.AlignRestOption={}))[l.Never=0]="Never",l[l.Always=1]="Always",l[l.Auto=2]="Auto",(c=o.FillEmptyMeasuresWithWholeRests||(o.FillEmptyMeasuresWithWholeRests={}))[c.No=0]="No",c[c.YesVisible=1]="YesVisible",c[c.YesInvisible=2]="YesInvisible",function(d){d[d.SVG=0]="SVG",d[d.Canvas=1]="Canvas"}(a=o.BackendType||(o.BackendType={})),(g=o.SkyBottomLineBatchCalculatorBackendType||(o.SkyBottomLineBatchCalculatorBackendType={}))[g.Plain=0]="Plain",g[g.WebGL=1]="WebGL",o.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:u.DrawingParametersEnum.default}}static BackendTypeFromString(d){return d&&d.toLowerCase()==="canvas"?a.Canvas:a.SVG}}},9629:function(b,o,r){var u=this&&this.__importDefault||function(Y){return Y&&Y.__esModule?Y:{default:Y}};Object.defineProperty(o,"__esModule",{value:!0}),o.OpenSheetMusicDisplay=void 0;const a=r(9228),g=r(8738),c=r(1372),l=r(4324),h=r(4040),d=r(5820),E=r(9505),f=r(4028),y=r(530),S=r(7056),_=r(3495),P=u(r(2043)),w=r(7459),x=r(41),M=r(1405),N=r(3748),R=r(1649),A=r(8155),F=r(8640);class U{constructor(k,W=x.OSMDOptions.OSMDOptionsStandard()){if(this.version="1.8.6-release",this.cursorsOptions=[],this.cursors=[],this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,typeof k=="string"?this.container=document.getElementById(k):k&&"appendChild"in k&&(this.container=k),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");W.autoResize===void 0&&(W.autoResize=!0),this.backendType=x.BackendType.SVG,this.setOptions(W)}get cursor(){return this.cursors[0]}load(k,W="Untitled Score"){if(this.reset(),typeof k=="string"){const re=k,be=this;if(re.substr(0,4)==="PK")return P.default.debug("[OSMD] This is a zip file, unpack it first: "+re),S.MXLHelper.MXLtoXMLstring(re).then(ge=>be.load(ge),ge=>{throw P.default.debug(ge),new Error("OpenSheetMusicDisplay: Invalid MXL file")});if(re.substr(0,3)==="")return P.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+re),be.load(re.substr(3));let ae=re;if(/^\s/.test(ae)&&(ae=ae.trim()),ae.substr(0,6).includes("be.load(ge),ge=>{throw ge});console.error("[OSMD] osmd.load(string): Could not process string. Did not find {W.init(this.sheet.MusicPartManager,this.graphic)}),this.drawingParameters.DrawingParametersEnum===w.DrawingParametersEnum.leadsheet&&(this.graphic.LeadSheet=!0)}render(){var k;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");(k=this.drawer)===null||k===void 0||k.clear();let W=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(W=this.rules.SheetMaximumWidth),this.sheet.pageWidth=W/this.zoom/10,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,P.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(P.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(G=>{G.update()}),this.zoomUpdated=!1,this.rules.RenderCount++}createOrRefreshRenderBackend(){if(this.drawer&&this.drawer.Backends){this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container);for(const H of this.drawer.Backends)H.free();this.drawer.Backends.clear()}this.drawingParameters.Rules=this.rules,this.drawer=new d.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let k,W=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(W=10*(this.EngravingRules.PageLeftMargin+this.graphic.MusicPages[0].PositionAndShape.Size.width+this.EngravingRules.PageRightMargin)*this.zoom);const G=32767;for(const H of this.graphic.MusicPages){if(H.PageNumber>this.rules.MaxPageToDrawNumber)break;const L=this.createBackend(this.backendType,H),$=" exceeds CanvasBackend limit of 32767. Cutting off score.";L.getOSMDBackendType()===x.BackendType.Canvas&&W>G&&(P.default.warn("[OSMD] Warning: width of "+W+$),W=G),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?k=W/this.rules.PageFormat.aspectRatio:(k=H.PositionAndShape.Size.height,k+=this.rules.PageBottomMargin,L.getOSMDBackendType()===x.BackendType.Canvas&&(k+=.1),k+=H.PositionAndShape.BorderTop,this.rules.RenderTitle&&(k+=this.rules.TitleTopDistance),k*=10*this.zoom),L.getOSMDBackendType()===x.BackendType.Canvas&&k>G&&(P.default.warn("[OSMD] Warning: height of "+k+$),k=Math.min(k,G)),L.resize(W,k),L.clear(),L.getContext().setFillStyle(this.rules.DefaultColorMusic),L.getContext().setStrokeStyle(this.rules.DefaultColorMusic),this.drawer.Backends.push(L),this.graphic.drawer=this.drawer}}exportSVG(){var k;for(const W of(k=this.drawer)===null||k===void 0?void 0:k.Backends)W instanceof E.SvgVexFlowBackend&&W.export()}IsReadyToRender(){return this.graphic!==void 0}clear(){var k;(k=this.drawer)===null||k===void 0||k.clear(),this.reset()}setOptions(k){if(this.rules||(this.rules=new M.EngravingRules),this.drawingParameters||k.drawingParameters?k.drawingParameters&&(this.drawingParameters?this.drawingParameters.DrawingParametersEnum=w.DrawingParametersEnum[k.drawingParameters.toLowerCase()]:this.drawingParameters=new w.DrawingParameters(w.DrawingParametersEnum[k.drawingParameters],this.rules)):this.drawingParameters=new w.DrawingParameters(w.DrawingParametersEnum.default,this.rules),k==null)return void P.default.warn(`warning: osmd.setOptions() called without an options parameter, has no effect. +example usage: osmd.setOptions({drawCredits: false, drawPartNames: false})`);this.OnXMLRead=function(H){return H},k.onXMLRead&&(this.OnXMLRead=k.onXMLRead);let W=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(k.backend!==void 0){const H=x.OSMDOptions.BackendTypeFromString(k.backend);W=W||this.backendType!==H,this.backendType=H}this.needBackendUpdate=W,k.autoBeam!==void 0&&(this.rules.AutoBeamNotes=k.autoBeam);const G=k.autoBeamOptions;if(G&&(G.maintain_stem_directions===void 0&&(G.maintain_stem_directions=!1),this.rules.AutoBeamOptions=G,G.groups&&G.groups.length)){for(const H of G.groups)if(H.length!==2)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}k.percussionOneLineCutoff!==void 0&&(this.rules.PercussionOneLineCutoff=k.percussionOneLineCutoff),this.rules.PercussionOneLineCutoff!==0&&k.percussionForceVoicesOneLineCutoff!==void 0&&(this.rules.PercussionForceVoicesOneLineCutoff=k.percussionForceVoicesOneLineCutoff),k.alignRests!==void 0&&(this.rules.AlignRests=k.alignRests),k.coloringMode!==void 0&&this.setColoringMode(k),k.coloringEnabled!==void 0&&(this.rules.ColoringEnabled=k.coloringEnabled),k.colorStemsLikeNoteheads!==void 0&&(this.rules.ColorStemsLikeNoteheads=k.colorStemsLikeNoteheads),k.disableCursor&&(this.drawingParameters.drawCursors=!1),k.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),k.drawCredits!==void 0&&(this.drawingParameters.DrawCredits=k.drawCredits),k.drawComposer!==void 0&&(this.drawingParameters.DrawComposer=k.drawComposer),k.drawTitle!==void 0&&(this.drawingParameters.DrawTitle=k.drawTitle),k.drawSubtitle!==void 0&&(this.drawingParameters.DrawSubtitle=k.drawSubtitle),k.drawLyricist!==void 0&&(this.drawingParameters.DrawLyricist=k.drawLyricist),k.drawMetronomeMarks!==void 0&&(this.rules.MetronomeMarksDrawn=k.drawMetronomeMarks),k.drawPartNames!==void 0&&(this.drawingParameters.DrawPartNames=k.drawPartNames,k.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=k.drawPartNames)),k.drawPartAbbreviations!==void 0&&(this.rules.RenderPartAbbreviations=k.drawPartAbbreviations),k.drawFingerings===!1&&(this.rules.RenderFingerings=!1),k.drawMeasureNumbers!==void 0&&(this.rules.RenderMeasureNumbers=k.drawMeasureNumbers),k.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=k.drawMeasureNumbersOnlyAtSystemStart),k.drawLyrics!==void 0&&(this.rules.RenderLyrics=k.drawLyrics),k.drawTimeSignatures!==void 0&&(this.rules.RenderTimeSignatures=k.drawTimeSignatures),k.drawSlurs!==void 0&&(this.rules.RenderSlurs=k.drawSlurs),k.measureNumberInterval!==void 0&&(this.rules.MeasureNumberLabelOffset=k.measureNumberInterval),k.useXMLMeasureNumbers!==void 0&&(this.rules.UseXMLMeasureNumbers=k.useXMLMeasureNumbers),k.fingeringPosition!==void 0&&(this.rules.FingeringPosition=N.AbstractExpression.PlacementEnumFromString(k.fingeringPosition)),k.fingeringInsideStafflines!==void 0&&(this.rules.FingeringInsideStafflines=k.fingeringInsideStafflines),k.newSystemFromXML!==void 0&&(this.rules.NewSystemAtXMLNewSystemAttribute=k.newSystemFromXML),k.newSystemFromNewPageInXML!==void 0&&(this.rules.NewSystemAtXMLNewPageAttribute=k.newSystemFromNewPageInXML),k.newPageFromXML!==void 0&&(this.rules.NewPageAtXMLNewPageAttribute=k.newPageFromXML),k.fillEmptyMeasuresWithWholeRest!==void 0&&(this.rules.FillEmptyMeasuresWithWholeRest=k.fillEmptyMeasuresWithWholeRest),k.followCursor!==void 0&&(this.FollowCursor=k.followCursor),k.setWantedStemDirectionByXml!==void 0&&(this.rules.SetWantedStemDirectionByXml=k.setWantedStemDirectionByXml),k.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):k.darkMode===!1&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),k.defaultColorMusic&&this.rules.applyDefaultColorMusic(k.defaultColorMusic),k.defaultColorNotehead&&(this.rules.DefaultColorNotehead=k.defaultColorNotehead),k.defaultColorRest&&(this.rules.DefaultColorRest=k.defaultColorRest),k.defaultColorStem&&(this.rules.DefaultColorStem=k.defaultColorStem),k.defaultColorLabel&&(this.rules.DefaultColorLabel=k.defaultColorLabel),k.defaultColorTitle&&(this.rules.DefaultColorTitle=k.defaultColorTitle),k.defaultFontFamily&&(this.rules.DefaultFontFamily=k.defaultFontFamily),k.defaultFontStyle&&(this.rules.DefaultFontStyle=k.defaultFontStyle),k.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=k.drawUpToMeasureNumber-1),k.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=k.drawFromMeasureNumber-1),k.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=k.drawUpToPageNumber),k.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=k.drawUpToSystemNumber),k.tupletsRatioed&&(this.rules.TupletsRatioed=!0),k.tupletsBracketed&&(this.rules.TupletsBracketed=!0),k.tripletsBracketed&&(this.rules.TripletsBracketed=!0),k.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):k.autoResize===!1&&(this.autoResizeEnabled=!1),k.pageFormat!==void 0&&this.setPageFormat(k.pageFormat),k.pageBackgroundColor!==void 0&&(this.rules.PageBackgroundColor=k.pageBackgroundColor),k.renderSingleHorizontalStaffline!==void 0&&(this.rules.RenderSingleHorizontalStaffline=k.renderSingleHorizontalStaffline),k.spacingFactorSoftmax!==void 0&&(this.rules.SoftmaxFactorVexFlow=k.spacingFactorSoftmax),k.spacingBetweenTextLines!==void 0&&(this.rules.SpacingBetweenTextLines=k.spacingBetweenTextLines),k.stretchLastSystemLine!==void 0&&(this.rules.StretchLastSystemLine=k.stretchLastSystemLine),k.autoGenerateMultipleRestMeasuresFromRestMeasures!==void 0&&(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures=k.autoGenerateMultipleRestMeasuresFromRestMeasures),k.cursorsOptions!==void 0?this.cursorsOptions=k.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}],k.preferredSkyBottomLineBatchCalculatorBackend!==void 0&&(this.rules.PreferredSkyBottomLineBatchCalculatorBackend=k.preferredSkyBottomLineBatchCalculatorBackend),k.skyBottomLineBatchMinMeasures!==void 0&&(this.rules.SkyBottomLineBatchMinMeasures=k.skyBottomLineBatchMinMeasures)}setColoringMode(k){if(k.coloringMode===w.ColoringModes.XML)return void(this.rules.ColoringMode=w.ColoringModes.XML);const W=[F.NoteEnum.C,F.NoteEnum.D,F.NoteEnum.E,F.NoteEnum.F,F.NoteEnum.G,F.NoteEnum.A,F.NoteEnum.B];let G;if(k.coloringMode===w.ColoringModes.CustomColorSet){if(!k.coloringSetCustom||k.coloringSetCustom.length!==8)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter (array) with 8 strings (C to B, rest note).");for(const L of k.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(L))throw new Error(`One of the color strings in options.coloringSetCustom was not a valid HTML Hex color: +`+L);G=k.coloringSetCustom}else if(k.coloringMode===w.ColoringModes.AutoColoring){G=[];const L=Object.keys(A.AutoColorSet);for(let $=0;${k.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1,this.rules.RenderCount=0}autoResize(){const k=this;this.handleResize(()=>{},()=>{var W;((W=this.graphic)===null||W===void 0?void 0:W.GetCalculator)instanceof g.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),k.IsReadyToRender()&&k.render()})}handleResize(k,W){let G,H;const L=this;function $(){L.AutoResizeEnabled&&(G=new Date().getTime(),H||(k(),G=new Date().getTime(),H=window.setTimeout(ie,200)))}function ie(){H=void 0,window.clearTimeout(H),new Date().getTime()-G<200?H=window.setTimeout(ie,200):W()}window.attachEvent?window.attachEvent("onresize",$):window.addEventListener("resize",$),this.resizeHandlerAttached=!0,window.setTimeout(k,0),window.setTimeout(W,1)}enableOrDisableCursors(k){var W,G,H,L;if(this.drawingParameters.drawCursors=k,k)for(let $=0;${$.hide()})}createBackend(k,W){let G;return G=k===void 0||k===x.BackendType.SVG?new E.SvgVexFlowBackend(this.rules):new f.CanvasVexFlowBackend(this.rules),G.graphicalMusicPage=W,G.initialize(this.container,this.zoom),G}static StringToPageFormat(k){let W=M.PageFormat.UndefinedPageFormat;if(k.match("^[0-9]+x[0-9]+$")){const G=k.split("x"),H=Number.parseInt(G[0],10),L=Number.parseInt(G[1],10);H>0&&H<32768&&L>0&&L<32768&&(W=new M.PageFormat(H,L,`customPageFormat${k}`))}return k=(k=(k=k.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),U.PageFormatStandards.hasOwnProperty(k)&&(W=U.PageFormatStandards[k]),W}setPageFormat(k){const W=U.StringToPageFormat(k);this.needBackendUpdate=!W.Equals(this.rules.PageFormat),this.rules.PageFormat=W}setCustomPageFormat(k,W){if(k>0&&W>0){const G=new M.PageFormat(k,W);this.rules.PageFormat=G}}set DrawSkyLine(k){this.drawSkyLine=k,this.drawer&&(this.drawer.skyLineVisible=k)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(k){this.drawBottomLine=k,this.drawer&&(this.drawer.bottomLineVisible=k)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(k){this.setDrawBoundingBox(k,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(k,W=!1){this.drawBoundingBox=k,this.drawer&&(this.drawer.drawableBoundingBoxElement=k),W&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(k){this.autoResizeEnabled=k}get Zoom(){return this.zoom}set Zoom(k){var W;this.zoom=k,this.zoomUpdated=!0,((W=this.graphic)===null||W===void 0?void 0:W.GetCalculator)instanceof g.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(k){this.followCursor=k}get FollowCursor(){return this.followCursor}set TransposeCalculator(k){h.MusicSheetCalculator.transposeCalculator=k}get TransposeCalculator(){return h.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get Version(){return this.version}}o.OpenSheetMusicDisplay=U,U.PageFormatStandards={A3_L:new M.PageFormat(420,297,"A3_L"),A3_P:new M.PageFormat(297,420,"A3_P"),A4_L:new M.PageFormat(297,210,"A4_L"),A4_P:new M.PageFormat(210,297,"A4_P"),A5_L:new M.PageFormat(210,148,"A5_L"),A5_P:new M.PageFormat(148,210,"A5_P"),A6_L:new M.PageFormat(148,105,"A6_L"),A6_P:new M.PageFormat(105,148,"A6_P"),Endless:M.PageFormat.UndefinedPageFormat,Letter_L:new M.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new M.PageFormat(215.9,279.4,"Letter_P")}},2861:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(3495),o),a(r(530),o),a(r(41),o),a(r(9629),o)},8265:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TransposeCalculator=void 0;const u=r(8918);class a{transposePitch(c,l,h){let d=u.NoteEnum.C,E=0,f=u.AccidentalEnum.NONE;const y=u.Pitch.CalculateTransposedHalfTone(c,h);let S=y.halftone,_=y.overflow;for(let P=0;PS)break}for(let P=0;PS){let w=P;const x=u.Pitch.HalfTonesFromAccidental(c.Accidental);for((x>0||x===0&&l.Key>=0)&&w--;w<0;)w+=7,S+=12,_--;for(;w>=7;)w-=7,S-=12,_++;d=a.noteEnums[w],f=u.Pitch.AccidentalFromHalfTones(S-d),E=c.Octave+_;break}return new u.Pitch(d,E,f)}transposeKey(c,l){let h=0,d=0;for(;h=12;)E-=12;for(;E<0;)E+=12;c.Key=a.keyMapping[E],c.isTransposedBy=l}}o.TransposeCalculator=a,a.keyMapping=[0,-5,2,-3,4,-1,6,1,-4,3,-2,5],a.noteEnums=[u.NoteEnum.C,u.NoteEnum.D,u.NoteEnum.E,u.NoteEnum.F,u.NoteEnum.G,u.NoteEnum.A,u.NoteEnum.B]},5742:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(8265),o)},8447:function(b,o,r){var u=this&&this.__createBinding||(Object.create?function(g,c,l,h){h===void 0&&(h=l);var d=Object.getOwnPropertyDescriptor(c,l);d&&!("get"in d?!c.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(g,h,d)}:function(g,c,l,h){h===void 0&&(h=l),g[h]=c[l]}),a=this&&this.__exportStar||function(g,c){for(var l in g)l==="default"||Object.prototype.hasOwnProperty.call(c,l)||u(c,g,l)};Object.defineProperty(o,"__esModule",{value:!0}),a(r(5742),o)},2337:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CollectionUtil=void 0,Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,writable:!0,value:function(){return this[this.length-1]}}),Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,writable:!0,value:function(){this.length=0}}),Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,writable:!0,value:function(r){return this.indexOf(r)!==-1}}),o.CollectionUtil=class{static contains2(r,u){for(let a=0;a{Object.defineProperty(o,"__esModule",{value:!0}),o.PSMath=void 0;class r{static log(a,g){return Math.log(g)/Math.log(a)}static log10(a){return r.log(10,a)}static meanSimple(a){let g=0;for(let c=0;c{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(278),g=function(){function c(l){this.root=null,this.compare=l||u.defaultCompare,this.nElements=0}return c.prototype.add=function(l){return!u.isUndefined(l)&&this.insertNode(this.createNode(l))!==null&&(this.nElements++,!0)},c.prototype.clear=function(){this.root=null,this.nElements=0},c.prototype.isEmpty=function(){return this.nElements===0},c.prototype.size=function(){return this.nElements},c.prototype.contains=function(l){return!u.isUndefined(l)&&this.searchNode(this.root,l)!==null},c.prototype.search=function(l){var h=this.searchNode(this.root,l);if(h!==null)return h.element},c.prototype.remove=function(l){var h=this.searchNode(this.root,l);return h!==null&&(this.removeNode(h),this.nElements--,!0)},c.prototype.inorderTraversal=function(l){this.inorderTraversalAux(this.root,l,{stop:!1})},c.prototype.preorderTraversal=function(l){this.preorderTraversalAux(this.root,l,{stop:!1})},c.prototype.postorderTraversal=function(l){this.postorderTraversalAux(this.root,l,{stop:!1})},c.prototype.levelTraversal=function(l){this.levelTraversalAux(this.root,l)},c.prototype.minimum=function(){if(!this.isEmpty()&&this.root!==null)return this.minimumAux(this.root).element},c.prototype.maximum=function(){if(!this.isEmpty()&&this.root!==null)return this.maximumAux(this.root).element},c.prototype.forEach=function(l){this.inorderTraversal(l)},c.prototype.toArray=function(){var l=[];return this.inorderTraversal(function(h){return l.push(h),!0}),l},c.prototype.height=function(){return this.heightAux(this.root)},c.prototype.searchNode=function(l,h){for(var d=1;l!==null&&d!==0;)(d=this.compare(h,l.element))<0?l=l.leftCh:d>0&&(l=l.rightCh);return l},c.prototype.transplant=function(l,h){l.parent===null?this.root=h:l===l.parent.leftCh?l.parent.leftCh=h:l.parent.rightCh=h,h!==null&&(h.parent=l.parent)},c.prototype.removeNode=function(l){if(l.leftCh===null)this.transplant(l,l.rightCh);else if(l.rightCh===null)this.transplant(l,l.leftCh);else{var h=this.minimumAux(l.rightCh);h.parent!==l&&(this.transplant(h,h.rightCh),h.rightCh=l.rightCh,h.rightCh.parent=h),this.transplant(l,h),h.leftCh=l.leftCh,h.leftCh.parent=h}},c.prototype.inorderTraversalAux=function(l,h,d){l===null||d.stop||(this.inorderTraversalAux(l.leftCh,h,d),d.stop||(d.stop=h(l.element)===!1,d.stop||this.inorderTraversalAux(l.rightCh,h,d)))},c.prototype.levelTraversalAux=function(l,h){var d=new a.default;for(l!==null&&d.enqueue(l),l=d.dequeue()||null;l!=null;){if(h(l.element)===!1)return;l.leftCh!==null&&d.enqueue(l.leftCh),l.rightCh!==null&&d.enqueue(l.rightCh),l=d.dequeue()||null}},c.prototype.preorderTraversalAux=function(l,h,d){l===null||d.stop||(d.stop=h(l.element)===!1,d.stop||(this.preorderTraversalAux(l.leftCh,h,d),d.stop||this.preorderTraversalAux(l.rightCh,h,d)))},c.prototype.postorderTraversalAux=function(l,h,d){l===null||d.stop||(this.postorderTraversalAux(l.leftCh,h,d),d.stop||(this.postorderTraversalAux(l.rightCh,h,d),d.stop||(d.stop=h(l.element)===!1)))},c.prototype.minimumAux=function(l){for(;l!=null&&l.leftCh!==null;)l=l.leftCh;return l},c.prototype.maximumAux=function(l){for(;l!=null&&l.rightCh!==null;)l=l.rightCh;return l},c.prototype.heightAux=function(l){return l===null?-1:Math.max(this.heightAux(l.leftCh),this.heightAux(l.rightCh))+1},c.prototype.insertNode=function(l){for(var h=null,d=this.root;d!==null;){var E=this.compare(l.element,d.element);if(E===0)return null;E<0?(h=d,d=d.leftCh):(h=d,d=d.rightCh)}return l.parent=h,h===null?this.root=l:this.compare(l.element,h.element)<0?h.leftCh=l:h.rightCh=l,l},c.prototype.createNode=function(l){return{element:l,leftCh:null,rightCh:null,parent:null}},c}();o.default=g},2070:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(8805),g=r(7818),c=function(){function l(h){this.toStrF=h||u.defaultToString,this.dictionary=new a.default(this.toStrF),this.nElements=0}return l.prototype.add=function(h,d){if(d===void 0&&(d=1),u.isUndefined(h)||d<=0)return!1;if(this.contains(h))this.dictionary.getValue(h).copies+=d;else{var E={value:h,copies:d};this.dictionary.setValue(h,E)}return this.nElements+=d,!0},l.prototype.count=function(h){return this.contains(h)?this.dictionary.getValue(h).copies:0},l.prototype.contains=function(h){return this.dictionary.containsKey(h)},l.prototype.remove=function(h,d){if(d===void 0&&(d=1),u.isUndefined(h)||d<=0)return!1;if(this.contains(h)){var E=this.dictionary.getValue(h);return d>E.copies?this.nElements-=E.copies:this.nElements-=d,E.copies-=d,E.copies<=0&&this.dictionary.remove(h),!0}return!1},l.prototype.toArray=function(){for(var h=[],d=0,E=this.dictionary.values();d{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=function(){function g(c){this.table={},this.nElements=0,this.toStr=c||u.defaultToString}return g.prototype.getValue=function(c){var l=this.table["$"+this.toStr(c)];if(!u.isUndefined(l))return l.value},g.prototype.setValue=function(c,l){if(!u.isUndefined(c)&&!u.isUndefined(l)){var h,d="$"+this.toStr(c),E=this.table[d];return u.isUndefined(E)?(this.nElements++,h=void 0):h=E.value,this.table[d]={key:c,value:l},h}},g.prototype.remove=function(c){var l="$"+this.toStr(c),h=this.table[l];if(!u.isUndefined(h))return delete this.table[l],this.nElements--,h.value},g.prototype.keys=function(){var c=[];for(var l in this.table)if(u.has(this.table,l)){var h=this.table[l];c.push(h.key)}return c},g.prototype.values=function(){var c=[];for(var l in this.table)if(u.has(this.table,l)){var h=this.table[l];c.push(h.value)}return c},g.prototype.forEach=function(c){for(var l in this.table)if(u.has(this.table,l)){var h=this.table[l];if(c(h.key,h.value)===!1)return}},g.prototype.containsKey=function(c){return!u.isUndefined(this.getValue(c))},g.prototype.clear=function(){this.table={},this.nElements=0},g.prototype.size=function(){return this.nElements},g.prototype.isEmpty=function(){return this.nElements<=0},g.prototype.toString=function(){var c="{";return this.forEach(function(l,h){c+=` + `+l+" : "+h}),c+` +}`},g}();o.default=a},2734:function(b,o,r){var u,a=this&&this.__extends||(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var E in d)d.hasOwnProperty(E)&&(h[E]=d[E])},function(h,d){function E(){this.constructor=h}u(h,d),h.prototype=d===null?Object.create(d):(E.prototype=d.prototype,new E)});Object.defineProperty(o,"__esModule",{value:!0});var g=r(8805),c=r(9205),l=function(h){function d(E,f){var y=h.call(this,f)||this;return y.defaultFactoryFunction=E,y}return a(d,h),d.prototype.setDefault=function(E,f){var y=h.prototype.getValue.call(this,E);return c.isUndefined(y)?(this.setValue(E,f),f):y},d.prototype.getValue=function(E){return this.setDefault(E,this.defaultFactoryFunction())},d}(g.default);o.default=l},2422:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(1229),g=function(){function c(l){this.data=[],this.compare=l||u.defaultCompare}return c.prototype.leftChildIndex=function(l){return 2*l+1},c.prototype.rightChildIndex=function(l){return 2*l+2},c.prototype.parentIndex=function(l){return Math.floor((l-1)/2)},c.prototype.minIndex=function(l,h){return h>=this.data.length?l>=this.data.length?-1:l:this.compare(this.data[l],this.data[h])<=0?l:h},c.prototype.siftUp=function(l){for(var h=this.parentIndex(l);l>0&&this.compare(this.data[h],this.data[l])>0;)a.swap(this.data,h,l),l=h,h=this.parentIndex(l)},c.prototype.siftDown=function(l){for(var h=this.minIndex(this.leftChildIndex(l),this.rightChildIndex(l));h>=0&&this.compare(this.data[l],this.data[h])>0;)a.swap(this.data,h,l),l=h,h=this.minIndex(this.leftChildIndex(l),this.rightChildIndex(l))},c.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},c.prototype.add=function(l){return!u.isUndefined(l)&&(this.data.push(l),this.siftUp(this.data.length-1),!0)},c.prototype.removeRoot=function(){if(this.data.length>0){var l=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),l}},c.prototype.contains=function(l){var h=u.compareToEquals(this.compare);return a.contains(this.data,l,h)},c.prototype.size=function(){return this.data.length},c.prototype.isEmpty=function(){return this.data.length<=0},c.prototype.clear=function(){this.data.length=0},c.prototype.forEach=function(l){a.forEach(this.data,l)},c}();o.default=g},3272:function(b,o,r){var u,a=this&&this.__extends||(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,f){E.__proto__=f}||function(E,f){for(var y in f)f.hasOwnProperty(y)&&(E[y]=f[y])},function(E,f){function y(){this.constructor=E}u(E,f),E.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)});Object.defineProperty(o,"__esModule",{value:!0});var g=r(8805),c=r(9205),l=function(){function E(f,y){this.key=f,this.value=y}return E.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},E}(),h=function(){function E(){this.key=null,this.value=null}return E.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},E}(),d=function(E){function f(y){var S=E.call(this,y)||this;return S.head=new h,S.tail=new h,S.head.next=S.tail,S.tail.prev=S.head,S}return a(f,E),f.prototype.appendToTail=function(y){var S=this.tail.prev;S.next=y,y.prev=S,y.next=this.tail,this.tail.prev=y},f.prototype.getLinkedDictionaryPair=function(y){if(!c.isUndefined(y)){var S="$"+this.toStr(y);return this.table[S]}},f.prototype.getValue=function(y){var S=this.getLinkedDictionaryPair(y);if(!c.isUndefined(S))return S.value},f.prototype.remove=function(y){var S=this.getLinkedDictionaryPair(y);if(!c.isUndefined(S))return E.prototype.remove.call(this,y),S.unlink(),S.value},f.prototype.clear=function(){E.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},f.prototype.replace=function(y,S){var _="$"+this.toStr(S.key);S.next=y.next,S.prev=y.prev,this.remove(y.key),S.prev.next=S,S.next.prev=S,this.table[_]=S,++this.nElements},f.prototype.setValue=function(y,S){if(!c.isUndefined(y)&&!c.isUndefined(S)){var _=this.getLinkedDictionaryPair(y),P=new l(y,S),w="$"+this.toStr(y);return c.isUndefined(_)?(this.appendToTail(P),this.table[w]=P,void++this.nElements):(this.replace(_,P),_.value)}},f.prototype.keys=function(){var y=[];return this.forEach(function(S,_){y.push(S)}),y},f.prototype.values=function(){var y=[];return this.forEach(function(S,_){y.push(_)}),y},f.prototype.forEach=function(y){for(var S=this.head.next;S.next;){if(y(S.key,S.value)===!1)return;S=S.next}},f}(g.default);o.default=d},5456:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(1229),g=function(){function c(){this.firstNode=null,this.lastNode=null,this.nElements=0}return c.prototype.add=function(l,h){if(u.isUndefined(h)&&(h=this.nElements),h<0||h>this.nElements||u.isUndefined(l))return!1;var d=this.createNode(l);if(this.nElements===0||this.lastNode===null)this.firstNode=d,this.lastNode=d;else if(h===this.nElements)this.lastNode.next=d,this.lastNode=d;else if(h===0)d.next=this.firstNode,this.firstNode=d;else{var E=this.nodeAtIndex(h-1);if(E===null)return!1;d.next=E.next,E.next=d}return this.nElements++,!0},c.prototype.first=function(){if(this.firstNode!==null)return this.firstNode.element},c.prototype.last=function(){if(this.lastNode!==null)return this.lastNode.element},c.prototype.elementAtIndex=function(l){var h=this.nodeAtIndex(l);if(h!==null)return h.element},c.prototype.indexOf=function(l,h){var d=h||u.defaultEquals;if(u.isUndefined(l))return-1;for(var E=this.firstNode,f=0;E!==null;){if(d(E.element,l))return f;f++,E=E.next}return-1},c.prototype.contains=function(l,h){return this.indexOf(l,h)>=0},c.prototype.remove=function(l,h){var d=h||u.defaultEquals;if(this.nElements<1||u.isUndefined(l))return!1;for(var E=null,f=this.firstNode;f!==null;){if(d(f.element,l))return E===null?(this.firstNode=f.next,f===this.lastNode&&(this.lastNode=null)):f===this.lastNode?(this.lastNode=E,E.next=f.next,f.next=null):(E.next=f.next,f.next=null),this.nElements--,!0;E=f,f=f.next}return!1},c.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},c.prototype.equals=function(l,h){var d=h||u.defaultEquals;return l instanceof c&&this.size()===l.size()&&this.equalsAux(this.firstNode,l.firstNode,d)},c.prototype.equalsAux=function(l,h,d){for(;l!==null&&h!==null;){if(!d(l.element,h.element))return!1;l=l.next,h=h.next}return!0},c.prototype.removeElementAtIndex=function(l){if(!(l<0||l>=this.nElements||this.firstNode===null||this.lastNode===null)){var h;if(this.nElements===1)h=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var d=this.nodeAtIndex(l-1);d===null?(h=this.firstNode.element,this.firstNode=this.firstNode.next):d.next===this.lastNode&&(h=this.lastNode.element,this.lastNode=d),d!==null&&d.next!==null&&(h=d.next.element,d.next=d.next.next)}return this.nElements--,h}},c.prototype.forEach=function(l){for(var h=this.firstNode;h!==null&&l(h.element)!==!1;)h=h.next},c.prototype.reverse=function(){for(var l=null,h=this.firstNode,d=null;h!==null;)d=h.next,h.next=l,l=h,h=d;d=this.firstNode,this.firstNode=this.lastNode,this.lastNode=d},c.prototype.toArray=function(){for(var l=[],h=this.firstNode;h!==null;)l.push(h.element),h=h.next;return l},c.prototype.size=function(){return this.nElements},c.prototype.isEmpty=function(){return this.nElements<=0},c.prototype.toString=function(){return a.toString(this.toArray())},c.prototype.nodeAtIndex=function(l){if(l<0||l>=this.nElements)return null;if(l===this.nElements-1)return this.lastNode;for(var h=this.firstNode,d=0;d{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(8805),g=r(1229),c=function(){function l(h,d,E){E===void 0&&(E=!1),this.dict=new a.default(h),this.equalsF=d||u.defaultEquals,this.allowDuplicate=E}return l.prototype.getValue=function(h){var d=this.dict.getValue(h);return u.isUndefined(d)?[]:g.copy(d)},l.prototype.setValue=function(h,d){if(u.isUndefined(h)||u.isUndefined(d))return!1;var E=this.dict.getValue(h);return u.isUndefined(E)?(this.dict.setValue(h,[d]),!0):!(!this.allowDuplicate&&g.contains(E,d,this.equalsF)||(E.push(d),0))},l.prototype.remove=function(h,d){if(u.isUndefined(d)){var E=this.dict.remove(h);return!u.isUndefined(E)}var f=this.dict.getValue(h);return!(u.isUndefined(f)||!g.remove(f,d,this.equalsF)||(f.length===0&&this.dict.remove(h),0))},l.prototype.keys=function(){return this.dict.keys()},l.prototype.values=function(){for(var h=[],d=0,E=this.dict.values();d{var r;Object.defineProperty(o,"__esModule",{value:!0}),function(a){a[a.BEFORE=0]="BEFORE",a[a.AFTER=1]="AFTER",a[a.INSIDE_AT_END=2]="INSIDE_AT_END",a[a.INSIDE_AT_START=3]="INSIDE_AT_START"}(r||(r={}));var u=function(){function a(g,c){g===void 0&&(g=[]),c===void 0&&(c={}),this.rootIds=g,this.nodes=c,this.initRootIds(),this.initNodes()}return a.prototype.initRootIds=function(){for(var g=0,c=this.rootIds;g-1&&this.insertIdIntoRoot(c,l),this.nodes)if(this.nodes.hasOwnProperty(h)){var d=this.findNodeId(h,g);d>-1&&this.insertIdIntoNode(h,c,d)}},a.prototype.insertIdAfterId=function(g,c){var l=this.findRootId(g);for(var h in l>-1&&this.insertIdIntoRoot(c,l+1),this.nodes)if(this.nodes.hasOwnProperty(h)){var d=this.findNodeId(h,g);d>-1&&this.insertIdIntoNode(h,c,d+1)}},a.prototype.insertIdIntoId=function(g,c){this.nodeInsertAtEnd(g,c),this.nodes[c]=[]},a.prototype.insertIdIntoRoot=function(g,c){if(c===void 0)this.rootInsertAtEnd(g);else if(c<0){var l=this.rootIds.length;this.rootIds.splice(c+l+1,0,g)}else this.rootIds.splice(c,0,g);this.nodes[g]=this.nodes[g]||[]},a.prototype.insertIdIntoNode=function(g,c,l){if(this.nodes[g]=this.nodes[g]||[],this.nodes[c]=this.nodes[c]||[],l===void 0)this.nodeInsertAtEnd(g,c);else if(l<0){var h=this.nodes[g].length;this.nodes[g].splice(l+h+1,0,c)}else this.nodes[g].splice(l,0,c)},a.prototype.moveId=function(g,c,l){var h=g,d=this.findRootId(h);for(var E in this.nodes[c],this.nodes)if(this.nodes.hasOwnProperty(E)){this.findNodeId(E,c);break}var f=c,y=this.findRootId(f);for(var E in this.nodes[c],this.nodes)if(this.nodes.hasOwnProperty(E)){this.findNodeId(E,c);break}if(d>-1){if(y>-1)switch(this.rootDelete(d),y>d&&y--,l){case r.BEFORE:this.insertIdIntoRoot(h,y);break;case r.AFTER:this.insertIdIntoRoot(h,y+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(f,h);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(f,h)}else for(var E in this.rootDelete(d),this.nodes)if(this.nodes.hasOwnProperty(E)&&(S=this.findNodeId(E,f))>-1){switch(l){case r.BEFORE:this.insertIdIntoNode(E,h,S);break;case r.AFTER:this.insertIdIntoNode(E,h,S+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(f,h);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(f,h)}break}}else if(y>-1){for(var E in this.nodes)if(this.nodes.hasOwnProperty(E)&&(S=this.findNodeId(E,h))>-1){this.nodeDeleteAtIndex(E,S);break}switch(l){case r.BEFORE:this.insertIdIntoRoot(h,y);break;case r.AFTER:this.insertIdIntoRoot(h,y+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(f,h);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(f,h)}}else{for(var E in this.nodes)if(this.nodes.hasOwnProperty(E)&&(S=this.findNodeId(E,h))>-1){this.nodeDeleteAtIndex(E,S);break}for(var E in this.nodes){var S;if(this.nodes.hasOwnProperty(E)&&(S=this.findNodeId(E,f))>-1){switch(l){case r.BEFORE:this.insertIdIntoNode(E,h,S);break;case r.AFTER:this.insertIdIntoNode(E,h,S+1);break;case r.INSIDE_AT_START:this.nodeInsertAtStart(f,h);break;case r.INSIDE_AT_END:this.nodeInsertAtEnd(f,h)}break}}}},a.prototype.swapArrayElements=function(g,c,l){var h=g[c];return g[c]=g[l],g[l]=h,g},a.prototype.rootDeleteId=function(g){var c=this.findRootId(g);c>-1&&this.rootDelete(c)},a.prototype.nodeAndSubNodesDelete=function(g){for(var c=[],l=0;l{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(2422),g=function(){function c(l){this.heap=new a.default(u.reverseCompareFunction(l))}return c.prototype.enqueue=function(l){return this.heap.add(l)},c.prototype.add=function(l){return this.heap.add(l)},c.prototype.dequeue=function(){if(this.heap.size()!==0){var l=this.heap.peek();return this.heap.removeRoot(),l}},c.prototype.peek=function(){return this.heap.peek()},c.prototype.contains=function(l){return this.heap.contains(l)},c.prototype.isEmpty=function(){return this.heap.isEmpty()},c.prototype.size=function(){return this.heap.size()},c.prototype.clear=function(){this.heap.clear()},c.prototype.forEach=function(l){this.heap.forEach(l)},c}();o.default=g},278:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(5456),a=function(){function g(){this.list=new u.default}return g.prototype.enqueue=function(c){return this.list.add(c)},g.prototype.add=function(c){return this.list.add(c)},g.prototype.dequeue=function(){if(this.list.size()!==0){var c=this.list.first();return this.list.removeElementAtIndex(0),c}},g.prototype.peek=function(){if(this.list.size()!==0)return this.list.first()},g.prototype.size=function(){return this.list.size()},g.prototype.contains=function(c,l){return this.list.contains(c,l)},g.prototype.isEmpty=function(){return this.list.size()<=0},g.prototype.clear=function(){this.list.clear()},g.prototype.forEach=function(c){this.list.forEach(c)},g}();o.default=a},7818:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205),a=r(1229),g=r(8805),c=function(){function l(h){this.dictionary=new g.default(h)}return l.prototype.contains=function(h){return this.dictionary.containsKey(h)},l.prototype.add=function(h){return!this.contains(h)&&!u.isUndefined(h)&&(this.dictionary.setValue(h,h),!0)},l.prototype.intersection=function(h){var d=this;this.forEach(function(E){return h.contains(E)||d.remove(E),!0})},l.prototype.union=function(h){var d=this;h.forEach(function(E){return d.add(E),!0})},l.prototype.difference=function(h){var d=this;h.forEach(function(E){return d.remove(E),!0})},l.prototype.isSubsetOf=function(h){if(this.size()>h.size())return!1;var d=!0;return this.forEach(function(E){return!!h.contains(E)||(d=!1,!1)}),d},l.prototype.remove=function(h){return!!this.contains(h)&&(this.dictionary.remove(h),!0)},l.prototype.forEach=function(h){this.dictionary.forEach(function(d,E){return h(E)})},l.prototype.toArray=function(){return this.dictionary.values()},l.prototype.isEmpty=function(){return this.dictionary.isEmpty()},l.prototype.size=function(){return this.dictionary.size()},l.prototype.clear=function(){this.dictionary.clear()},l.prototype.toString=function(){return a.toString(this.toArray())},l}();o.default=c},5669:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(5456),a=function(){function g(){this.list=new u.default}return g.prototype.push=function(c){return this.list.add(c,0)},g.prototype.add=function(c){return this.list.add(c,0)},g.prototype.pop=function(){return this.list.removeElementAtIndex(0)},g.prototype.peek=function(){return this.list.first()},g.prototype.size=function(){return this.list.size()},g.prototype.contains=function(c,l){return this.list.contains(c,l)},g.prototype.isEmpty=function(){return this.list.isEmpty()},g.prototype.clear=function(){this.list.clear()},g.prototype.forEach=function(c){this.list.forEach(c)},g}();o.default=a},1229:(b,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0});var u=r(9205);function a(g,c,l){for(var h=l||u.defaultEquals,d=g.length,E=0;E=0;d--)if(h(g[d],c))return d;return-1},o.contains=function(g,c,l){return a(g,c,l)>=0},o.remove=function(g,c,l){var h=a(g,c,l);return!(h<0||(g.splice(h,1),0))},o.frequency=function(g,c,l){for(var h=l||u.defaultEquals,d=g.length,E=0,f=0;f=g.length||l<0||l>=g.length)return!1;var h=g[c];return g[c]=g[l],g[l]=h,!0},o.toString=function(g){return"["+g.toString()+"]"},o.forEach=function(g,c){for(var l=0,h=g;l{Object.defineProperty(o,"__esModule",{value:!0});var u=r(1229);o.arrays=u;var a=r(2070);o.Bag=a.default;var g=r(8071);o.BSTree=g.default;var c=r(3176);o.BSTreeKV=c.default;var l=r(8805);o.Dictionary=l.default;var h=r(2422);o.Heap=h.default;var d=r(3272);o.LinkedDictionary=d.default;var E=r(5456);o.LinkedList=E.default;var f=r(6072);o.MultiDictionary=f.default;var y=r(2734);o.FactoryDictionary=y.default;var S=r(2734);o.DefaultDictionary=S.default;var _=r(278);o.Queue=_.default;var P=r(5994);o.PriorityQueue=P.default;var w=r(7818);o.Set=w.default;var x=r(5669);o.Stack=x.default;var M=r(1489);o.MultiRootTree=M.default;var N=r(9205);o.util=N},9205:(b,o)=>{Object.defineProperty(o,"__esModule",{value:!0});var r=Object.prototype.hasOwnProperty;function u(c){return typeof c=="function"}function a(c){return c===void 0}function g(c){return Object.prototype.toString.call(c)==="[object String]"}o.has=function(c,l){return r.call(c,l)},o.defaultCompare=function(c,l){return c{r.r(o),r.d(o,{default:()=>Zs});const u=()=>{};u.L=(Oe,i)=>{if(!i)return;const v=Array.prototype.slice.call(i).join(" ");window.console.log(Oe+": "+v)},u.MakeException=Oe=>class extends Error{constructor(i,v){super(i),this.name=Oe,this.message=i,this.data=v}},u.RERR=u.RuntimeError=class{constructor(Oe,i){this.code=Oe,this.message=i}toString(){return"[RuntimeError] "+this.code+":"+this.message}},u.Merge=(Oe,i)=>{for(const v in i)Oe[v]=i[v];return Oe},u.Min=Math.min,u.Max=Math.max,u.forEach=(Oe,i)=>{for(let v=0;vOe%i>=i/2?parseInt(Oe/i,10)*i+i:parseInt(Oe/i,10)*i,u.MidLine=(Oe,i)=>{let v=i+(Oe-i)/2;return v%2>0&&(v=u.RoundN(10*v,5)/10),v},u.SortAndUnique=(Oe,i,v)=>{if(Oe.length>1){const C=[];let D;Oe.sort(i);for(let j=0;j{let v=Oe.length;for(;v--;)if(Oe[v]===i)return!0;return!1},u.getCanvasContext=Oe=>{if(!Oe)throw new u.RERR("BadArgument","Invalid canvas selector: "+Oe);const i=document.getElementById(Oe);if(!i||!i.getContext)throw new u.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return i.getContext("2d")},u.drawDot=(Oe,i,v,C="#55")=>{Oe.save(),Oe.setFillStyle(C),Oe.beginPath(),Oe.arc(i,v,3,0,2*Math.PI,!0),Oe.closePath(),Oe.fill(),Oe.restore()},u.BM=(Oe,i)=>{const v=new Date().getTime();i();const C=new Date().getTime()-v;u.L(Oe+C+"ms")},u.StackTrace=()=>new Error().stack,u.W=(...Oe)=>{const i=Oe.join(" ");window.console.log("Warning: ",i,u.StackTrace())},(u.Prefix=Oe=>u.Prefix.prefix+Oe).prefix="vf-";class a{static GCD(i,v){if(typeof i!="number"||typeof v!="number")throw new u.RERR("BadArgument",`Invalid numbers: ${i}, ${v}`);let C;for(;v!==0;)C=v,v=i%v,i=C;return i}static LCM(i,v){return i*v/a.GCD(i,v)}static LCMM(i){if(i.length===0)return 0;if(i.length===1)return i[0];if(i.length===2)return a.LCM(i[0],i[1]);{const v=i[0];return i.shift(),a.LCM(v,a.LCMM(i))}}constructor(i,v){this.set(i,v)}set(i,v){return this.numerator=i===void 0?1:i,this.denominator=v===void 0?1:v,this}value(){return this.numerator/this.denominator}simplify(){let i=this.numerator,v=this.denominator;const C=a.GCD(i,v);return i/=C,v/=C,v<0&&(v=-v,i=-i),this.set(i,v)}add(i,v){let C,D;i instanceof a?(C=i.numerator,D=i.denominator):(C=i!==void 0?i:0,D=v!==void 0?v:1);const j=a.LCM(this.denominator,D),J=j/this.denominator,se=j/D,he=this.numerator*J+C*se;return this.set(he,j)}subtract(i,v){let C,D;i instanceof a?(C=i.numerator,D=i.denominator):(C=i!==void 0?i:0,D=v!==void 0?v:1);const j=a.LCM(this.denominator,D),J=j/this.denominator,se=j/D,he=this.numerator*J-C*se;return this.set(he,j)}multiply(i,v){let C,D;return i instanceof a?(C=i.numerator,D=i.denominator):(C=i!==void 0?i:1,D=v!==void 0?v:1),this.set(this.numerator*C,this.denominator*D)}divide(i,v){let C,D;return i instanceof a?(C=i.numerator,D=i.denominator):(C=i!==void 0?i:1,D=v!==void 0?v:1),this.set(this.numerator*D,this.denominator*C)}equals(i){const v=a.__compareA.copy(i).simplify(),C=a.__compareB.copy(this).simplify();return v.numerator===C.numerator&&v.denominator===C.denominator}greaterThan(i){const v=a.__compareB.copy(this);return v.subtract(i),v.numerator>0}greaterThanEquals(i){const v=a.__compareB.copy(this);return v.subtract(i),v.numerator>=0}lessThan(i){return!this.greaterThanEquals(i)}lessThanEquals(i){return!this.greaterThan(i)}clone(){return new a(this.numerator,this.denominator)}copy(i){return typeof i=="number"?this.set(i||0,1):this.set(i.numerator,i.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return a.__tmp.copy(this).simplify().toString()}toMixedString(){let i="";const v=this.quotient(),C=a.__tmp.copy(this);return v<0?C.abs().fraction():C.fraction(),v!==0?(i+=v,C.numerator!==0&&(i+=" "+C.toSimplifiedString())):i=C.numerator===0?"0":C.toSimplifiedString(),i}parse(i){const v=i.split("/"),C=parseInt(v[0],10),D=v[1]?parseInt(v[1],10):1;return this.set(C,D)}}a.__compareA=new a,a.__compareB=new a,a.__tmp=new a;const g=u.MakeException("RegistryError");function c(Oe,i,v,C,D){Oe[i][v]||(Oe[i][v]={}),Oe[i][v][C]=D}class l{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(i){l.defaultRegistry=i}static getDefaultRegistry(){return l.defaultRegistry}static disableDefaultRegistry(){l.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:i,name:v,value:C,oldValue:D}){const j=this.getElementById(i);D!==null&&this.index[v][D]&&delete this.index[v][D][i],C!==null&&c(this.index,v,C,j.getAttribute("id"),j)}register(i,v){if(!(v=v||i.getAttribute("id")))throw new g("Can't add element without `id` attribute to registry",i);return i.setAttribute("id",v),c(this.index,"id",v,v,i),l.INDEXES.forEach(C=>{this.updateIndex({id:v,name:C,value:i.getAttribute(C),oldValue:null})}),i.onRegister(this),this}getElementById(i){return this.index.id[i]?this.index.id[i][i]:null}getElementsByAttribute(i,v){const C=this.index[i];return C&&C[v]?Object.keys(C[v]).map(D=>C[v][D]):[]}getElementsByType(i){return this.getElementsByAttribute("type",i)}getElementsByClass(i){return this.getElementsByAttribute("class",i)}onUpdate({id:i,name:v,value:C,oldValue:D}){return function(j,J){return j.filter(se=>se===J).length>0}(l.INDEXES.concat(["id","class"]),v)?(this.updateIndex({id:i,name:v,value:C,oldValue:D}),this):this}}l.defaultRegistry=null;class h{static newID(){return"auto"+h.ID++}constructor({type:i}={}){this.attrs={id:h.newID(),el:null,type:i||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,l.getDefaultRegistry()&&l.getDefaultRegistry().register(this)}setStyle(i){return this.style=i,this}getStyle(){return this.style}applyStyle(i=this.context,v=this.getStyle()){return v?(i.save(),v.shadowColor&&i.setShadowColor(v.shadowColor),v.shadowBlur&&i.setShadowBlur(v.shadowBlur),v.fillStyle&&i.setFillStyle(v.fillStyle),v.strokeStyle&&i.setStrokeStyle(v.strokeStyle),v.lineWidth&&i.setLineWidth(v.lineWidth),this):this}restoreStyle(i=this.context,v=this.getStyle()){return v?(i.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(i){return this.attrs.classes[i]===!0}addClass(i){return this.attrs.classes[i]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:i,oldValue:null}),this}removeClass(i){return delete this.attrs.classes[i],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:i}),this}onRegister(i){return this.registry=i,this}isRendered(){return this.rendered}setRendered(i=!0){return this.rendered=i,this}getAttributes(){return this.attrs}getAttribute(i){return this.attrs[i]}setAttribute(i,v){const C=this.attrs.id,D=this.attrs[i];return this.attrs[i]=v,this.registry&&this.registry.onUpdate({id:C,name:i,value:v,oldValue:D}),this}getContext(){return this.context}setContext(i){return this.context=i,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new u.RERR("NoContext","No rendering context attached to instance");return this.context}}h.ID=1e3;class d{constructor(i,v,C,D){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(i,v),this.addPoint(C,D)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(i,v){i!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=i,this.x2=i),ithis.x2&&(this.x2=i)),v!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=v,this.y2=v),vthis.y2&&(this.y2=v))}addX(i){this.addPoint(i,null)}addY(i){this.addPoint(null,i)}addQuadraticCurve(i,v,C,D,j,J){const se=i+.6666666666666666*(C-i),he=v+2/3*(D-v),ve=se+1/3*(j-i),_e=he+1/3*(J-v);this.addBezierCurve(i,v,se,he,ve,_e,j,J)}addBezierCurve(i,v,C,D,j,J,se,he){const ve=[i,v],_e=[C,D],Ce=[j,J],Ne=[se,he];let Ae;this.addPoint(ve[0],ve[1]),this.addPoint(Ne[0],Ne[1]);const Ge=(He,$e)=>Math.pow(1-He,3)*ve[$e]+3*Math.pow(1-He,2)*He*_e[$e]+3*(1-He)*Math.pow(He,2)*Ce[$e]+Math.pow(He,3)*Ne[$e];for(Ae=0;Ae<=1;Ae++){const He=6*ve[Ae]-12*_e[Ae]+6*Ce[Ae],$e=-3*ve[Ae]+9*_e[Ae]-9*Ce[Ae]+3*Ne[Ae],Ze=3*_e[Ae]-3*ve[Ae];if($e===0){if(He===0)continue;const Ot=-Ze/He;0{if(!Oe)throw new u.RERR("BadArgument","Invalid clef: "+Oe);const i=_.clefProperties.values[Oe];if(!i)throw new u.RERR("BadArgument","Invalid clef: "+Oe);return i}};_.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},_.keyProperties=(Oe,i,v)=>{i===void 0&&(i="treble");const C={octave_shift:0};typeof v=="object"&&u.Merge(C,v);const D=Oe.split("/");if(D.length<2)throw new u.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${Oe}`);const j=D[0].toUpperCase(),J=_.keyProperties.note_values[j];if(!J)throw new u.RERR("BadArguments","Invalid key name: "+j);J.octave&&(D[1]=J.octave);let se=parseInt(D[1],10);se-=C.octave_shift;let he=(7*se-28+J.index)/2;he+=_.clefProperties(i).line_shift;let ve=0;he<=0&&2*he%2==0&&(ve=1),he>=6&&2*he%2==0&&(ve=-1);const _e=J.int_val!==void 0?12*se+J.int_val:null,Ce=J.code,Ne=J.shift_right;let Ae={};if(D.length>2&&D[2]){const Ge=D[2].toUpperCase();Ae=_.keyProperties.customNoteHeads[Ge]||{}}return{key:j,octave:se,line:he,int_value:_e,accidental:J.accidental,code:Ce,stroke:ve,shift_right:Ne,displaced:!1,...Ae}},_.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},_.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},TI:{code:"v11",shift_right:0,stem_up_y_shift:5,stem_down_y_shift:5,stem_up_x_offset:6,stem_down_x_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0},rwl:{code:"rwl",shift_right:0},rhl:{code:"rhl",shift_right:0}},_.integerToNote=Oe=>{if(Oe===void 0)throw new u.RERR("BadArguments","Undefined integer for integerToNote");if(Oe<-2)throw new u.RERR("BadArguments",`integerToNote requires integer > -2: ${Oe}`);const i=_.integerToNote.table[Oe];if(!i)throw new u.RERR("BadArguments",`Unknown note value for integer: ${Oe}`);return i},_.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},_.tabToGlyph=(Oe,i=1)=>{let v=null,C=0,D=0;if(Oe.toString().toUpperCase()==="X"){const j=new S("v7f",_.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();v="v7f",C=j.width,D=-j.height/2}else C=_.textWidth(Oe.toString());return{text:Oe,code:v,getWidth:()=>C*i,shift_y:D}},_.textWidth=Oe=>7*Oe.toString().length,_.articulationCodes=Oe=>_.articulationCodes.articulations[Oe],_.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},_.accidentalCodes=Oe=>_.accidentalCodes.accidentals[Oe],_.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},_.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},_.ornamentCodes=Oe=>_.ornamentCodes.ornaments[Oe],_.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},_.keySignature=Oe=>{const i=_.keySignature.keySpecs[Oe];if(!i)throw new u.RERR("BadKeySignature",`Bad key signature spec: '${Oe}'`);if(!i.acc)return[];const v=_.keySignature.accidentalList(i.acc),C=[];for(let D=0;D({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]})[Oe],_.parseNoteDurationString=Oe=>{if(typeof Oe!="string")return null;const i=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(Oe);if(!i)return null;const v=i[1],C=i[2].length;let D=i[3];return D.length===0&&(D="n"),{duration:v,dots:C,type:D}},_.parseNoteStruct=Oe=>{const i=Oe.duration,v=_.parseNoteDurationString(i);if(!v)return null;let C=_.durationToTicks(v.duration);if(C==null)return null;let D=Oe.type;const j=[];if(D){if(!_.getGlyphProps.validTypes[D])return null}else D=v.type||"n",Oe.keys!==void 0&&Oe.keys.forEach((he,ve)=>{const _e=he.split("/");_e&&_e.length===3&&(j[ve]=_e[2])});const J=Oe.dots?Oe.dots:v.dots;if(typeof J!="number")return null;let se=C;for(let he=0;he{const i=_.durationAliases[Oe];if(i!==void 0&&(Oe=i),_.durationToTicks.durations[Oe]===void 0)throw new u.RERR("BadArguments",`The provided duration is not valid: ${Oe}`);return Oe},_.durationToFraction=Oe=>new a().parse(_.sanitizeDuration(Oe)),_.durationToNumber=Oe=>_.durationToFraction(Oe).value(),_.durationToTicks=Oe=>{Oe=_.sanitizeDuration(Oe);const i=_.durationToTicks.durations[Oe];return i===void 0?null:i},_.durationToTicks.durations={"1/2":2*_.RESOLUTION,1:_.RESOLUTION/1,2:_.RESOLUTION/2,4:_.RESOLUTION/4,8:_.RESOLUTION/8,16:_.RESOLUTION/16,32:_.RESOLUTION/32,64:_.RESOLUTION/64,128:_.RESOLUTION/128,256:_.RESOLUTION/256},_.durationAliases={w:"1",h:"2",q:"4",b:"256"},_.getGlyphProps=(Oe,i)=>{Oe=_.sanitizeDuration(Oe);const v=_.getGlyphProps.duration_codes[Oe];if(v===void 0)return null;i||(i="n");let C=v.type[i];if(C===void 0){const D=_.keyProperties.customNoteHeads[i.toUpperCase()];if(D===void 0)return null;C={code_head:D.code,...D}}return{...v.common,...C}},_.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},_.getGlyphProps.duration_codes={"1/2":{common:{getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v53",Oe).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-_.STEM_HEIGHT,stem_down_extension:-_.STEM_HEIGHT,tabnote_stem_up_extension:-_.STEM_HEIGHT,tabnote_stem_down_extension:-_.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v1d",Oe).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-_.STEM_HEIGHT,stem_down_extension:-_.STEM_HEIGHT,tabnote_stem_up_extension:-_.STEM_HEIGHT,tabnote_stem_down_extension:-_.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"v81",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(Oe=_.DEFAULT_NOTATION_FONT_SCALE){return new S(this.code_head||"vb",Oe).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>_.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},_.smufl={},_.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},_.TIME4_4={num_beats:4,beat_value:4,resolution:_.RESOLUTION};class P{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(i,v){return Math.max(i,v)>this.CANVAS_BROWSER_SIZE_LIMIT&&(u.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),i>this.CANVAS_BROWSER_SIZE_LIMIT&&(i=this.CANVAS_BROWSER_SIZE_LIMIT),v>this.CANVAS_BROWSER_SIZE_LIMIT&&(v=this.CANVAS_BROWSER_SIZE_LIMIT)),[i,v]}constructor(i){this.vexFlowCanvasContext=i,i.canvas?this.canvas=i.canvas:this.canvas={width:P.WIDTH,height:P.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(i,v,C){return this.vexFlowCanvasContext.font=(C||"")+" "+v+"pt "+i,this}setRawFont(i){return this.vexFlowCanvasContext.font=i,this}setFillStyle(i){return this.vexFlowCanvasContext.fillStyle=i,this}setBackgroundFillStyle(i){return this.background_fillStyle=i,this}setStrokeStyle(i){return this.vexFlowCanvasContext.strokeStyle=i,this}setShadowColor(i){return this.vexFlowCanvasContext.shadowColor=i,this}setShadowBlur(i){return this.vexFlowCanvasContext.shadowBlur=i,this}setLineWidth(i){return this.vexFlowCanvasContext.lineWidth=i,this}setLineCap(i){return this.vexFlowCanvasContext.lineCap=i,this}setLineDash(i){return this.vexFlowCanvasContext.lineDash=i,this}scale(i,v){return this.vexFlowCanvasContext.scale(parseFloat(i),parseFloat(v))}resize(i,v){return[i,v]=this.SanitizeCanvasDims(parseInt(i,10),parseInt(v,10)),this.vexFlowCanvasContext.resize(i,v)}rect(i,v,C,D){return this.vexFlowCanvasContext.rect(i,v,C,D)}fillRect(i,v,C,D){return this.vexFlowCanvasContext.fillRect(i,v,C,D)}clearRect(i,v,C,D){return this.vexFlowCanvasContext.clearRect(i,v,C,D)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(i,v){return this.vexFlowCanvasContext.moveTo(i,v)}lineTo(i,v){return this.vexFlowCanvasContext.lineTo(i,v)}bezierCurveTo(i,v,C,D,j,J){return this.vexFlowCanvasContext.bezierCurveTo(i,v,C,D,j,J)}quadraticCurveTo(i,v,C,D){return this.vexFlowCanvasContext.quadraticCurveTo(i,v,C,D)}arc(i,v,C,D,j,J){return this.vexFlowCanvasContext.arc(i,v,C,D,j,J)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(i){return this.vexFlowCanvasContext.measureText(i)}fillText(i,v,C){return this.vexFlowCanvasContext.fillText(i,v,C)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class w{constructor(i){this.element=i,this.paper=Raphael(i),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(i,v,C){return this.state.font_family=i,this.state.font_size=v,this.state.font_weight=C,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(i){return this.attributes.font=i,this}setFillStyle(i){return this.attributes.fill=i,this}setBackgroundFillStyle(i){return this.background_attributes.fill=i,this.background_attributes.stroke=i,this}setStrokeStyle(i){return this.attributes.stroke=i,this}setShadowColor(i){return this.shadow_attributes.color=i,this}setShadowBlur(i){return this.shadow_attributes.width=i,this}setLineWidth(i){this.attributes["stroke-width"]=i,this.lineWidth=i}setLineDash(){return this}setLineCap(){return this}scale(i,v){return this.state.scale={x:i,y:v},this.attributes.transform="S"+i+","+v+",0,0",this.attributes.scale=i+","+v+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+i+","+v+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(i,v){return this.element.style.width=i,this.paper.setSize(i,v),this}setViewBox(i){this.paper.canvas.setAttribute("viewBox",i)}rect(i,v,C,D){return D<0&&(v+=D,D=-D),this.paper.rect(i,v,C-.5,D-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(i,v,C,D){return D<0&&(v+=D,D=-D),this.paper.rect(i,v,C-.5,D-.5).attr(this.attributes),this}clearRect(i,v,C,D){return D<0&&(v+=D,D=-D),this.paper.rect(i,v,C-.5,D-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(i,v){return this.path+="M"+i+","+v,this.pen.x=i,this.pen.y=v,this}lineTo(i,v){return this.path+="L"+i+","+v,this.pen.x=i,this.pen.y=v,this}bezierCurveTo(i,v,C,D,j,J){return this.path+="C"+i+","+v+","+C+","+D+","+j+","+J,this.pen.x=j,this.pen.y=J,this}quadraticCurveTo(i,v,C,D){return this.path+="Q"+i+","+v+","+C+","+D,this.pen.x=C,this.pen.y=D,this}arc(i,v,C,D,j,J){function se(ve){for(;ve<0;)ve+=2*Math.PI;for(;ve>2*Math.PI;)ve-=2*Math.PI;return ve}if((D=se(D))>(j=se(j))){const ve=D;D=j,j=ve,J=!J}const he=j-D;return he>Math.PI?(this.arcHelper(i,v,C,D,D+he/2,J),this.arcHelper(i,v,C,D+he/2,j,J)):this.arcHelper(i,v,C,D,j,J),this}arcHelper(i,v,C,D,j,J){const se=i+C*Math.cos(D),he=v+C*Math.sin(D),ve=i+C*Math.cos(j),_e=v+C*Math.sin(j);let Ce=0,Ne=0;J?(Ne=1,j-DMath.PI&&(Ce=1),this.path+="M"+se+","+he+",A"+C+","+C+",0,"+Ce+","+Ne+","+ve+","+_e+"M"+this.pen.x+","+this.pen.y}glow(){const i=this.paper.set();if(this.shadow_attributes.width>0){const v=this.shadow_attributes,C=v.width/2;for(let D=1;D<=C;D++)i.push(this.paper.path(this.path).attr({stroke:v.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(v.width/C*D).toFixed(3),opacity:+((v.opacity||.3)/C).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return i}fill(){const i=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(i),this}stroke(){const i=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,v=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",i);return this.glow(v),this}closePath(){return this.path+="Z",this}measureText(i){const v=this.paper.text(0,0,i).attr(this.attributes).attr("fill","none").attr("stroke","none"),C=v.getBBox();return v.remove(),{width:C.width,height:C.height}}fillText(i,v,C){return this.paper.text(v+this.measureText(i).width/2,C-this.state.font_size/(2.25*this.state.scale.y),i).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const i=this.state_stack.pop();return this.state.font_family=i.state.font_family,this.attributes.font=i.attributes.font,this.attributes.fill=i.attributes.fill,this.attributes.stroke=i.attributes.stroke,this.attributes["stroke-width"]=i.attributes["stroke-width"],this.shadow_attributes.width=i.shadow_attributes.width,this.shadow_attributes.color=i.shadow_attributes.color,this}}const x={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const Oe={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};u.Merge(x.rect,Oe),u.Merge(x.path,Oe)}class M{constructor(i){this.element=i,this.svgNS="http://www.w3.org/2000/svg";const v=this.create("svg");this.element.appendChild(v),this.svg=v,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(i){return document.createElementNS(this.svgNS,i)}openGroup(i,v,C){const D=this.create("g");return this.groups.push(D),this.parent.appendChild(D),this.parent=D,i&&D.setAttribute("class",u.Prefix(i)),v&&D.setAttribute("id",u.Prefix(v)),C&&C.pointerBBox&&D.setAttribute("pointer-events","bounding-box"),D}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(i){this.parent.appendChild(i)}iePolyfill(){typeof navigator<"u"&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(i,v,C){let D=!1,j=!1,J="normal";typeof C=="string"&&(C.indexOf("italic")!==-1&&(C=C.replace(/italic/g,""),j=!0),C.indexOf("bold")!==-1&&(C=C.replace(/bold/g,""),D=!0),C=C.replace(/ /g,"")),J=j?"italic":J;const se={"font-family":i,"font-size":v+"pt","font-weight":C=(C=D?"bold":C)===void 0||C===""?"normal":C,"font-style":J};return this.fontSize=Number(v),u.Merge(this.attributes,se),u.Merge(this.state,se),this}setRawFont(i){const v=(i=i.trim()).split(" ");return this.attributes["font-family"]=v[1],this.state["font-family"]=v[1],this.attributes["font-size"]=v[0],this.state["font-size"]=v[0],this.fontSize=Number(v[0].match(/\d+/)),this}setFillStyle(i){return this.attributes.fill=i,this}setBackgroundFillStyle(i){return this.background_attributes.fill=i,this.background_attributes.stroke=i,this}setStrokeStyle(i){return this.attributes.stroke=i,this}setShadowColor(i){return this.shadow_attributes.color=i,this}setShadowBlur(i){return this.shadow_attributes.width=i,this}setLineWidth(i){this.attributes["stroke-width"]=i,this.lineWidth=i}setLineDash(i){if(Object.prototype.toString.call(i)==="[object Array]")return i=i.join(", "),this.attributes["stroke-dasharray"]=i,this;throw new u.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(i){return this.attributes["stroke-linecap"]=i,this}resize(i,v){this.width=i,this.height=v,this.element.style.width=i;const C={width:i,height:v};return this.applyAttributes(this.svg,C),this.scale(this.state.scale.x,this.state.scale.y),this}scale(i,v){this.state.scale={x:i,y:v};const C=this.width/i,D=this.height/v;return this.setViewBox(0,0,C,D),this}setViewBox(...i){if(i.length===1){const[v]=i;this.svg.setAttribute("viewBox",v)}else{const[v,C,D,j]=i,J=v+" "+C+" "+D+" "+j;this.svg.setAttribute("viewBox",J)}}applyAttributes(i,v){const C=x[i.nodeName];return Object.keys(v).forEach(D=>{C&&C[D]||i.setAttributeNS(null,D,v[D])}),i}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(i,v,C,D,j){D<0&&(v+=D,D*=-1);const J=this.create("rect");return j===void 0&&(j={fill:"none","stroke-width":this.lineWidth,stroke:this.attributes.stroke}),u.Merge(j,{x:i,y:v,width:C,height:D}),this.applyAttributes(J,j),this.add(J),this}fillRect(i,v,C,D){return D<0&&(v+=D,D*=-1),this.rect(i,v,C,D,this.attributes),this}clearRect(i,v,C,D){return this.rect(i,v,C,D,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(i,v){return this.path+="M"+i+" "+v,this.pen.x=i,this.pen.y=v,this}lineTo(i,v){return this.path+="L"+i+" "+v,this.pen.x=i,this.pen.y=v,this}bezierCurveTo(i,v,C,D,j,J){return this.path+="C"+i+" "+v+","+C+" "+D+","+j+" "+J,this.pen.x=j,this.pen.y=J,this}quadraticCurveTo(i,v,C,D){return this.path+="Q"+i+" "+v+","+C+" "+D,this.pen.x=C,this.pen.y=D,this}arc(i,v,C,D,j,J){function se(ve){for(;ve<0;)ve+=2*Math.PI;for(;ve>2*Math.PI;)ve-=2*Math.PI;return ve}if((D=se(D))>(j=se(j))){const ve=D;D=j,j=ve,J=!J}const he=j-D;return he>Math.PI?(this.arcHelper(i,v,C,D,D+he/2,J),this.arcHelper(i,v,C,D+he/2,j,J)):this.arcHelper(i,v,C,D,j,J),this}arcHelper(i,v,C,D,j,J){const se=i+C*Math.cos(D),he=v+C*Math.sin(D),ve=i+C*Math.cos(j),_e=v+C*Math.sin(j);let Ce=0,Ne=0;J?(Ne=1,j-DMath.PI&&(Ce=1),this.path+="M"+se+" "+he+" A"+C+" "+C+" 0 "+Ce+" "+Ne+" "+ve+" "+_e,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const i=this.shadow_attributes,v=i.width/2;for(let C=1;C<=v;C++){const D={stroke:i.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*i.width/v*C).toFixed(3),opacity:+((i.opacity||.3)/v).toFixed(3)},j=this.create("path");D.d=this.path,this.applyAttributes(j,D),this.add(j)}}return this}fill(i){this.glow();const v=this.create("path");let C=i;return i===void 0?(u.Merge(i={},this.attributes),i.stroke="none",C=i):(C=i,u.Merge(C,this.attributes),i.class&&(C.class=i.class),i.id&&(C.id=i.id)),i.d=this.path,this.applyAttributes(v,i),this.add(v),this}stroke(i=void 0){this.glow();const v=this.create("path"),C={};return u.Merge(C,this.attributes),i&&u.Merge(C,i),C.fill="none",C["stroke-width"]=this.lineWidth,C.d=this.path,this.applyAttributes(v,C),this.add(v),this}measureText(i){const v=this.create("text");if(typeof v.getBBox!="function")return{x:0,y:0,width:0,height:0};v.textContent=i,this.applyAttributes(v,this.attributes),this.svg.appendChild(v);let C=v.getBBox();return this.ie&&i!==""&&this.attributes["font-style"]==="italic"&&(C=this.ieMeasureTextFix(C,i)),this.svg.removeChild(v),C}ieMeasureTextFix(i){const v=1.196*Number(this.fontSize)+1.9598,C=i.width-v,D=i.height-1.5;return{x:i.x,y:i.y,width:C,height:D}}fillText(i,v,C){if(!i||i.length<=0)return;const D={};u.Merge(D,this.attributes),D.stroke="none",D.x=v,D.y=C;const j=this.create("text");j.textContent=i,this.applyAttributes(j,D),this.add(j)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const i=this.state_stack.pop();return this.state["font-family"]=i.state["font-family"],this.state["font-weight"]=i.state["font-weight"],this.state["font-style"]=i.state["font-style"],this.state["font-size"]=i.state["font-size"],this.state.scale=i.state.scale,this.attributes["font-family"]=i.attributes["font-family"],this.attributes["font-weight"]=i.attributes["font-weight"],this.attributes["font-style"]=i.attributes["font-style"],this.attributes["font-size"]=i.attributes["font-size"],this.attributes.fill=i.attributes.fill,this.attributes.stroke=i.attributes.stroke,this.attributes["stroke-width"]=i.attributes["stroke-width"],this.attributes["stroke-dasharray"]=i.attributes["stroke-dasharray"],this.shadow_attributes.width=i.shadow_attributes.width,this.shadow_attributes.color=i.shadow_attributes.color,this.lineWidth=i.lineWidth,this}}let N=null;class R{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return N}static set lastContext(i){N=i}static buildContext(i,v,C,D,j){const J=new R(i,v);C&&D&&J.resize(C,D),j||(j="#FFF");const se=J.getContext();return se.setBackgroundFillStyle(j),R.lastContext=se,se}static getCanvasContext(i,v,C,D){return R.buildContext(i,R.Backends.CANVAS,v,C,D)}static getRaphaelContext(i,v,C,D){return R.buildContext(i,R.Backends.RAPHAEL,v,C,D)}static getSVGContext(i,v,C,D){return R.buildContext(i,R.Backends.SVG,v,C,D)}static bolsterCanvasContext(i){return R.USE_CANVAS_PROXY?new P(i):(i.vexFlowCanvasContext=i,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach(v=>{i[v]=i[v]||P.prototype[v]}),i)}static drawDashedLine(i,v,C,D,j,J){i.beginPath();const se=D-v,he=j-C,ve=Math.atan2(he,se);let _e=v,Ce=C;i.moveTo(v,C);let Ne=0,Ae=!0;for(;!(se<0?_e<=D:_e>=D)||!(he<0?Ce<=j:Ce>=j);){const Ge=J[Ne++%J.length],He=_e+Math.cos(ve)*Ge;_e=se<0?Math.max(D,He):Math.min(D,He);const $e=Ce+Math.sin(ve)*Ge;Ce=he<0?Math.max(j,$e):Math.min(j,$e),Ae?i.lineTo(_e,Ce):i.moveTo(_e,Ce),Ae=!Ae}i.closePath(),i.stroke()}constructor(i,v){if(this.elementId=i,!this.elementId)throw new u.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(i),this.element||(this.element=i),this.ctx=null,this.paper=null,this.backend=v,this.backend===R.Backends.CANVAS){if(!this.element.getContext)throw new u.RERR("BadElement",`Can't get canvas context from element: ${i}`);this.ctx=R.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0}))}else if(this.backend===R.Backends.RAPHAEL)this.ctx=new w(this.element);else{if(this.backend!==R.Backends.SVG)throw new u.RERR("InvalidBackend",`No support for backend: ${this.backend}`);this.ctx=new M(this.element)}}resize(i,v){if(this.backend===R.Backends.CANVAS){if(!this.element.getContext)throw new u.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[i,v]=P.SanitizeCanvasDims(i,v);const C=window.devicePixelRatio||1;this.element.width=i*C,this.element.height=v*C,this.element.style.width=i+"px",this.element.style.height=v+"px",this.ctx=R.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0})),this.ctx.scale(C,C)}else this.ctx.resize(i,v);return this}getContext(){return this.ctx}}class A extends h{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return _.STEM_WIDTH}static get HEIGHT(){return _.STEM_HEIGHT}constructor(i={}){super(),this.setAttribute("type","Stem"),this.x_begin=i.x_begin||0,this.x_end=i.x_end||0,this.y_top=i.y_top||0,this.y_bottom=i.y_bottom||0,this.stem_extension=i.stem_extension||0,this.stem_direction=i.stem_direction||0,this.hide=i.hide||!1,this.isStemlet=i.isStemlet||!1,this.stemletHeight=i.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(i)}setOptions(i){this.stem_up_y_offset=i.stem_up_y_offset||0,this.stem_down_y_offset=i.stem_down_y_offset||0}setNoteHeadXBounds(i,v){return this.x_begin=i,this.x_end=v,this}setDirection(i){this.stem_direction=i}setExtension(i){this.stem_extension=i}getExtension(){return this.stem_extension}setYBounds(i,v){this.y_top=i,this.y_bottom=v}getCategory(){return A.CATEGORY}getHeight(){const i=this.stem_direction===A.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(A.HEIGHT-i+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new u.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const i=this.stem_direction===A.UP,v=[this.y_top,this.y_bottom],C=A.HEIGHT+this.stem_extension,D=(i?Math.min:Math.max)(...v),j=(i?Math.max:Math.min)(...v);return{topY:D+C*-this.stem_direction,baseY:j}}setVisibility(i){return this.hide=!i,this}setStemlet(i,v){return this.isStemlet=i,this.stemletHeight=v,this}draw(){if(this.setRendered(),this.hide)return;const i=this.checkContext();let v,C;const D=this.stem_direction;D===A.DOWN?(v=this.x_begin,C=this.y_top+this.stem_down_y_offset):(v=this.x_end,C=this.y_bottom-this.stem_up_y_offset);const j=this.getHeight();(function(...se){A.DEBUG&&u.L("Vex.Flow.Stem",se)})("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const J=this.isStemlet?j-this.stemletHeight*this.stem_direction:0;if(i.save(),this.applyStyle(i),i.beginPath(),i.setLineWidth(A.WIDTH),i.moveTo(v,C-J),i.lineTo(v,C-j-this.renderHeightAdjustment*D),i.svg){const se={class:u.Prefix("stem")};this.id&&(se.id=this.id),i.stroke(se)}else i.stroke();this.restoreStyle(i),i.restore()}}class F extends h{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(i,v){if(super(),this.setAttribute("type","Tuplet"),!i||!i.length)throw new u.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=u.Merge({},v),this.notes=i,this.num_notes="num_notes"in this.options?this.options.num_notes:i.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=i.some(C=>C.beam===null),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||F.LOCATION_TOP,Et.AlignRestsToNotes(i,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let i=0;i=1;)this.numerator_glyphs.unshift(new S("v"+i%10,this.point)),i=parseInt(i/10,10);for(this.denom_glyphs=[],i=this.notes_occupied;i>=1;)this.denom_glyphs.unshift(new S("v"+i%10,this.point)),i=parseInt(i/10,10)}getNestedTupletCount(){const i=this.location,v=this.notes[0];let C=j(v,i),D=j(v,i);function j(J,se){return J.tupletStack.filter(he=>he.location===se).length}return this.notes.forEach(J=>{const se=j(J,i);C=se>C?se:C,D=seD&&(D=J)}}return D+i+v}draw(){this.checkContext(),this.setRendered();const i=this.notes[0],v=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=i.getTieLeftX()-5,this.width=v.getTieRightX()-this.x_pos+5):(this.x_pos=i.getStemX(),this.width=v.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const C=(J,se)=>J+se.getMetrics().width;let D=this.numerator_glyphs.reduce(C,0);this.ratioed&&(D=this.denom_glyphs.reduce(C,D),D+=.32*this.point);const j=this.x_pos+this.width/2-D/2;if(this.bracketed){const J=this.width/2-D/2-5;J>0&&(this.context.fillRect(this.x_pos,this.y_pos,J,1),this.context.fillRect(this.x_pos+this.width/2+D/2+5,this.y_pos,J,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===F.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===F.LOCATION_BOTTOM),1,10*this.location))}if(this.RenderTupletNumber!==!1){let J=0;this.numerator_glyphs.forEach(se=>{se.render(this.context,j+J,this.y_pos+this.point/3-2),J+=se.getMetrics().width})}if(this.ratioed){const J=j+x_offset+.16*this.point,se=.06*this.point;this.context.beginPath(),this.context.arc(J,this.y_pos-.08*this.point,se,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(J,this.y_pos+.12*this.point,se,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),x_offset+=.32*this.point,this.denom_glyphs.forEach(he=>{he.render(this.context,j+x_offset,this.y_pos+this.point/3-2),x_offset+=he.getMetrics().width})}}}function U(Oe){let i=0;return Oe.forEach(v=>{v.keyProps&&v.keyProps.forEach(C=>{i+=C.line-3})}),i>=0?A.DOWN:A.UP}const Y="L",k="B";class W extends h{static getDefaultBeamGroups(i){i&&i!=="c"||(i="4/4");const v={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[i];if(v!==void 0)return v.map(C=>new a().parse(C));{const C=parseInt(i.split("/")[0],10),D=parseInt(i.split("/")[1],10);if(C%3==0)return[new a(3,D)];if(D>4)return[new a(2,D)];if(D<=4)return[new a(1,D)]}return[new a(1,4)]}static applyAndGetBeams(i,v,C){return W.generateBeams(i.getTickables(),{groups:C,stem_direction:v})}static generateBeams(i,v){v||(v={}),v.groups&&v.groups.length||(v.groups=[new a(2,8)]);const C=v.groups.map(Ne=>{if(!Ne.multiply)throw new u.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return Ne.clone().multiply(_.RESOLUTION,1)}),D=i;let j=0,J=[],se=[];function he(){C.length-1>j?j+=1:j=0}(function(){let Ne=[];D.forEach(Ae=>{if(Ne=[],Ae.shouldIgnoreTicks())return J.push(se),void(se=Ne);se.push(Ae);const Ge=C[j].clone(),He=se.reduce((Ze,pt)=>pt.getTicks().clone().add(Ze),new a(0,1)),$e=_.durationToNumber(Ae.duration)<8;$e&&Ae.tuplet&&(Ge.numerator*=2),He.greaterThan(Ge)?($e||Ne.push(se.pop()),J.push(se),se=Ne,he()):He.equals(Ge)&&(J.push(se),se=Ne,he())}),se.length>0&&J.push(se)})(),function(){const Ne=[];J.forEach(Ae=>{let Ge=[];Ae.forEach((He,$e,Ze)=>{const pt=$e===0||$e===Ze.length-1,ft=Ze[$e-1],bt=!v.beam_rests&&He.isRest(),Ot=v.beam_rests&&v.beam_middle_only&&He.isRest()&&pt;let jt=!1;if(v.maintain_stem_directions&&ft&&!He.isRest()&&!ft.isRest()){const Rn=ft.getStemDirection();jt=He.getStemDirection()!==Rn}const ln=parseInt(He.duration,10)<8;bt||Ot||jt||ln?(Ge.length>0&&Ne.push(Ge),Ge=jt?[He]:[]):Ge.push(He)}),Ge.length>0&&Ne.push(Ge)}),J=Ne}(),J.forEach(Ne=>{let Ae;if(v.maintain_stem_directions){const Ge=function(He){for(let $e=0;$e{$e.setStemDirection(He)})})(Ne,Ae)});const ve=J.filter(Ne=>{if(Ne.length>1){let Ae=!0;return Ne.forEach(Ge=>{Ge.getIntrinsicTicks()>=_.durationToTicks("4")&&(Ae=!1)}),Ae}return!1}),_e=function(){const Ne=[];return J.forEach(Ae=>{let Ge=null;Ae.forEach(He=>{He.tuplet&&Ge!==He.tuplet&&(Ge=He.tuplet,Ne.push(Ge))})}),Ne}(),Ce=[];return ve.forEach(Ne=>{const Ae=new W(Ne);v.show_stemlets&&(Ae.render_options.show_stemlets=!0),v.secondary_breaks&&(Ae.render_options.secondary_break_ticks=_.durationToTicks(v.secondary_breaks)),v.flat_beams===!0&&(Ae.render_options.flat_beams=!0,Ae.render_options.flat_beam_offset=v.flat_beam_offset),Ce.push(Ae)}),_e.forEach(Ne=>{const Ae=Ne.notes[0].stem_direction===A.DOWN?F.LOCATION_BOTTOM:F.LOCATION_TOP;Ne.setTupletLocation(Ae);let Ge=!1;for(let He=0;He=_.durationToTicks("4"))throw new u.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let C,D;for(this.stem_direction=A.UP,C=0;Cse+he.stem_direction,0)>-1?A.UP:A.DOWN),C=0;Ci.getGlyph().beam_count).reduce((i,v)=>v>i?v:i)}breakSecondaryAt(i){return this.break_on_indices=i,this}getSlopeY(i,v,C,D){return C+(i-v)*D}calculateSlope(){const{notes:i,stem_direction:v,render_options:{max_slope:C,min_slope:D,slope_iterations:j,slope_cost:J}}=this,se=i[0],he=((Ae,Ge)=>{const He=Ae.getStemExtents().topY,$e=Ae.getStemX();return(Ge.getStemExtents().topY-He)/(Ge.getStemX()-$e)})(se,i[i.length-1]),ve=(C-D)/j;let _e=Number.MAX_VALUE,Ce=0,Ne=0;for(let Ae=D;Ae<=C;Ae+=ve){let Ge=0,He=0;for(let pt=1;ptHe)&&(ve=He,se=Math.min(...Ge.getYs()),he=Ge.getBeamCount())}let _e=J/i.length;const Ce=D+he*(1.5*C),Ne=se+Ce*-v;v===A.DOWN&&_eNe&&(_e=se-Ce),j+this.render_options.flat_beam_offset_per_beam>0?(v===A.DOWN&&_e>j&&!this.render_options.flat_beams||v===A.UP&&_e0){let v=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(v+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let C=this.notes[0].note_heads[0].y;const D=this.stem_direction>0?Math.min:Math.max;for(const j of this.notes)for(const J of j.note_heads)C=D(C,J.y);i=C+v*-this.stem_direction}return i}applyStemExtensions(){const{notes:i,slope:v,y_shift:C,stem_direction:D,beam_count:j,render_options:{show_stemlets:J,stemlet_extension:se,beam_width:he}}=this,ve=i[0],_e=this.getBeamYToDraw(),Ce=ve.getStemX();for(let Ne=0;Ne=8&&(Ne=this.break_on_indices.indexOf(_e)!==-1,this.render_options.secondary_break_ticks&&he>=this.render_options.secondary_break_ticks&&(he=0,Ne=!0));const Ae=Ce.getIntrinsicTicks(){i.getStem()&&(this.context.openGroup("stem",i.getAttribute("id")+"-stem"),i.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const i=["4","8","16","32","64"],v=this.notes[0];let C=this.getBeamYToDraw();const D=v.getStemX(),j=this.render_options.beam_width*this.stem_direction,J={};for(const se of this.notes)J[se.getAttribute("id")]=0;for(let se=0;se{i.getStave()||i.setStave(this.stave)}),this.preFormatted=!0),this}draw(i=this.context,v=this.stave){this.setRendered();let C=null;for(let D=0;D0&&C){const J=j.getBoundingBox();J&&C.mergeWith(J)}j.setContext(i),j.drawWithStyle()}this.boundingBox=C}}function H(Oe,i,v,C,D){if(i!==L.type.BOLD_DOUBLE_LEFT&&i!==L.type.BOLD_DOUBLE_RIGHT)throw new u.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let j=3,J=3.5;i===L.type.BOLD_DOUBLE_RIGHT&&(j=-5,J=3),Oe.fillRect(v+j,C,1,D-C),Oe.fillRect(v-2,C,J,D-C)}class L extends h{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:L.type.SINGLE_RIGHT,singleLeft:L.type.SINGLE_LEFT,single:L.type.SINGLE,double:L.type.DOUBLE,brace:L.type.BRACE,bracket:L.type.BRACKET,boldDoubleLeft:L.type.BOLD_DOUBLE_LEFT,boldDoubleRight:L.type.BOLD_DOUBLE_RIGHT,thinDouble:L.type.THIN_DOUBLE,none:L.type.NONE}}constructor(i,v){super(),this.setAttribute("type","StaveConnector"),this.thickness=_.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=i,this.bottom_stave=v,this.type=L.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(i){return(i=typeof i=="string"?L.typeString[i]:i)>=L.type.SINGLE_RIGHT&&i<=L.type.NONE&&(this.type=i),this}setText(i,v){return this.texts.push({content:i,options:u.Merge({shift_x:0,shift_y:0},v)}),this}setFont(i){u.Merge(this.font,i)}setXShift(i){if(typeof i!="number")throw u.RERR("InvalidType","x_shift must be a Number");return this.x_shift=i,this}draw(){const i=this.checkContext();this.setRendered();let v=this.top_stave.getYForLine(0),C=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,D=this.width,j=this.top_stave.getX();(this.type===L.type.SINGLE_RIGHT||this.type===L.type.BOLD_DOUBLE_RIGHT||this.type===L.type.THIN_DOUBLE)&&(j=this.top_stave.getX()+this.top_stave.width);let J=C-v;switch(this.type){case L.type.SINGLE:case L.type.SINGLE_LEFT:case L.type.SINGLE_RIGHT:D=1;break;case L.type.DOUBLE:j-=this.width+2;break;case L.type.BRACE:{D=12;const se=this.top_stave.getX()-2+this.x_shift,he=v,ve=se,_e=C,Ce=se-D,Ne=he+J/2,Ae=Ce-.9*D,Ge=he+.2*J,He=se+1.1*D,$e=Ne-.135*J,Ze=He,pt=Ne+.135*J,ft=Ae,bt=_e-.2*J,Ot=Ce-D,jt=bt,ln=se+.4*D,Rn=Ne+.135*J,xn=ln,Vi=Ne-.135*J,ui=Ot,ci=Ge;i.beginPath(),i.moveTo(se,he),i.bezierCurveTo(Ae,Ge,He,$e,Ce,Ne),i.bezierCurveTo(Ze,pt,ft,bt,ve,_e),i.bezierCurveTo(Ot,jt,ln,Rn,Ce,Ne),i.bezierCurveTo(xn,Vi,ui,ci,se,he),i.fill(),i.stroke();break}case L.type.BRACKET:v-=4,C+=4,J=C-v,S.renderGlyph(i,j-5,v-3,40,"v1b",!0),S.renderGlyph(i,j-5,C+3,40,"v10",!0),j-=this.width+2;break;case L.type.BOLD_DOUBLE_LEFT:H(i,this.type,j+this.x_shift,v,C);break;case L.type.BOLD_DOUBLE_RIGHT:H(i,this.type,j,v,C);break;case L.type.THIN_DOUBLE:D=1;break;case L.type.NONE:break;default:throw new u.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==L.type.BRACE&&this.type!==L.type.BOLD_DOUBLE_LEFT&&this.type!==L.type.BOLD_DOUBLE_RIGHT&&this.type!==L.type.NONE&&i.fillRect(j,v,D,J),this.type===L.type.THIN_DOUBLE&&i.fillRect(j-3,v,D,J),i.save(),i.lineWidth=2,i.setFont(this.font.family,this.font.size,this.font.weight);for(let se=0;se0){const $e=He.space.deviation,Ze=$e>=0?"+":"";i.setFillStyle("red"),i.fillText(Ze+Math.round($e),se+v.getXShift(),C-10)}i.restore()}constructor(i){if(super(),this.setAttribute("type","Note"),!i)throw new u.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const v=_.parseNoteStruct(i);if(!v)throw new u.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(i)}`);if(this.duration=v.duration,this.dots=v.dots,this.noteType=v.type,this.customTypes=v.customTypes,i.duration_override?this.setDuration(i.duration_override):this.setIntrinsicTicks(v.ticks),this.modifiers=[],this.glyph=_.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(C=>_.getGlyphProps(this.duration,C)),this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new u.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],i.align_center&&this.setCenterAlignment(i.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:ie.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(i){return this.playNote=i,this}isRest(){return!1}addStroke(i,v){return v.setNote(this),v.setIndex(i),this.modifiers.push(v),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(i){return this.stave=i,this.setYs([i.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return ie.CATEGORY}setContext(i){return this.context=i,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(i){return this.extraLeftPx=i,this}setExtraRightPx(i){return this.extraRightPx=i,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth(this.render_options.glyph_font_scale)}setYs(i){return this.ys=i,this}getYs(){if(this.ys.length===0)throw new u.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(i){if(!this.stave)throw new u.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(i)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new u.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(i){return this.voice=i,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(i){return this.tickContext=i,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(i){return this.modifierContext=i,this}addModifier(i,v=0){return i.setNote(this),i.setIndex(v),this.modifiers.push(i),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let i=0,v=0;this.modifierContext!=null&&(i=this.modifierContext.state.left_shift,v=this.modifierContext.state.right_shift);const C=this.getWidth();return{width:C,noteWidth:C-i-v-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:i,modRightPx:v,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(i){this.width=i}getWidth(){if(!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(i){return this.x_shift=i,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new u.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new u.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let i=this.tickContext.getX();return this.stave&&(i+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(i+=this.getCenterXShift()),i}setPreFormatted(i){if(this.preFormatted=i,this.preFormatted){const v=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,v.left),this.right_modPx=Math.max(this.right_modPx,v.right)}}}class re extends ie{static get CATEGORY(){return"notehead"}constructor(i){if(super(i),this.setAttribute("type","NoteHead"),this.index=i.index,this.x_shift=i.x_shift||0,this.x=(i.x||0)+this.x_shift,this.y=i.y||0,this.note_type=i.note_type,this.duration=i.duration,this.displaced=i.displaced||!1,this.stem_direction=i.stem_direction||Z.STEM_UP,this.line=i.line,this.glyph=_.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new u.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift_ledger_rest=0,this.y_shift_ledger_rest=0,this.x_shift=i.x_shift||0,this.glyph.rest&&(this.line>5||this.line<0)&&(this.isLedgerLinedRest=!0,this.duration==="h"?(i.custom_glyph_code="rhl",this.x_shift_ledger_rest-=4):this.duration==="w"&&(i.custom_glyph_code="rwl",this.x_shift_ledger_rest-=4,this.y_shift_ledger_rest=-5)),i.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=i.custom_glyph_code,this.stem_up_x_offset=i.stem_up_x_offset||0,this.stem_down_x_offset=i.stem_down_x_offset||0,this.stem_up_y_shift=i.stem_up_y_shift||0,this.stem_down_y_shift=i.stem_down_y_shift||0),this.style=i.style,this.slashed=i.slashed,u.Merge(this.render_options,{glyph_font_scale:i.glyph_font_scale||_.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return re.CATEGORY}getWidth(){return this.width}isDisplaced(){return this.displaced===!0}getGlyph(){return this.glyph}setX(i){return this.x=i,this}getY(){return this.y}setY(i){return this.y=i,this}getLine(){return this.line}setLine(i){return this.line=i,this}getAbsoluteX(){const i=this.preFormatted?super.getAbsoluteX():this.x,v=A.WIDTH/2;return i+(this.displaced?(this.width-v)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const i=this.stave.getSpacingBetweenLines(),v=i/2,C=this.y-v;return new _.BoundingBox(this.getAbsoluteX(),C,this.width,i)}setStave(i){const v=this.getLine();return this.stave=i,this.setY(i.getYForNote(v)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const i=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(i),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const i=this.context;let v=this.getAbsoluteX(),C=this.y;this.custom_glyph&&(v+=this.x_shift_ledger_rest,this.stem_direction===A.UP?(v+=this.stem_up_x_offset,C+=this.stem_up_y_shift||0):this.stem_direction===A.DOWN&&(v+=this.stem_down_x_offset,C+=this.stem_down_y_shift||0),C+=this.y_shift_ledger_rest),function(...J){re.DEBUG&&u.L("Vex.Flow.NoteHead",J)}("Drawing note head '",this.note_type,this.duration,"' at",v,C);const D=this.stem_direction,j=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(i),this.note_type==="s"){const J=this.stave.getSpacingBetweenLines();(function(se,he,ve,_e,Ce,Ne){const Ae=_.SLASH_NOTEHEAD_WIDTH;se.save(),se.setLineWidth(_.STEM_WIDTH);let Ge=!1;if(_.durationToNumber(he)>2&&(Ge=!0),Ge||(ve-=_.STEM_WIDTH/2*Ce),se.beginPath(),se.moveTo(ve,_e+Ne),se.lineTo(ve,_e+1),se.lineTo(ve+Ae,_e-Ne),se.lineTo(ve+Ae,_e),se.lineTo(ve,_e+Ne),se.closePath(),Ge?se.fill():se.stroke(),_.durationToFraction(he).equals(.5)){const He=[-3,-1,Ae+1,Ae+3];for(let $e=0;$e{const se=J.getTickContext();J.setStave(v.stave),se.setXOffset(j)})}}class ge extends ae{static get CATEGORY(){return"dots"}static format(i,v){const C=v.right_shift;if(!i||i.length===0)return!1;const D=[],j={};for(let Ne=0;NeAe.line-Ne.line);let J=C,se=0,he=null,ve=null,_e=null,Ce=0;for(let Ne=0;Nese?J:se,he=$e,ve=Ge}return v.right_shift+=se,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=ae.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return ge.CATEGORY}setNote(i){this.note=i,this.note.getCategory()==="gracenotes"&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(i){return this.dot_shiftY=i,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index===null)throw new u.RERR("NoAttachedNote","Can't draw dot without a note and index.");const i=this.note.stave.options.spacing_between_lines_px,v=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.note.getCategory()==="tabnotes"&&(v.y=this.note.getStemExtents().baseY);const C=v.x+this.x_shift+this.width-this.radius,D=v.y+this.y_shift+this.dot_shiftY*i,j=this.context;j.beginPath(),j.arc(C,D,this.radius,0,2*Math.PI,!1),j.fill()}}function le(Oe,i,v){if(Oe.note.shiftRestVerticalDisabled)return;const C=(i.isrest?0:1)*v;Oe.line+=C,Oe.maxLine+=C,Oe.minLine+=C,Oe.note.setKeyLine(0,Oe.note.getKeyLine(0)+C)}class Z extends be{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return A.UP}static get STEM_DOWN(){return A.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static format(i,v){if(!i||i.length<2)return!1;const C=[],D=i[0].stagger_same_whole_notes;for(let Ne=0;Ne2?C[1]:null;let he=j>2?C[2]:C[1];j!==2||J.stemDirection!==-1||he.stemDirection!==1||J.isrest||he.isRest||(J=C[1],he=C[0]);const ve=Math.max(J.voice_shift,he.voice_shift);let _e,Ce=0;if(j===2){const Ne=J.stemDirection===he.stemDirection?0:.5;if(J.stemDirection===he.stemDirection&&J.minLine<=he.maxLine&&(J.isrest||(_e=Math.abs(J.line-(he.maxLine+.5)),_e=Math.max(_e,J.stemMin),J.minLine=J.line-_e,J.note.setStemLength(10*_e))),J.minLine<=he.maxLine+Ne)if(J.isrest)le(J,he,1),J.note.hasLedgerLinedRest&&(J.note.shiftRestVerticalDisabled=!0);else if(he.isrest)le(he,J,-1),he.note.hasLedgerLinedRest&&(he.note.shiftRestVerticalDisabled=!0);else{Ce=ve;const Ae=Math.abs(J.line-he.line);let Ge=0,He=0;J.note.duration==="h"?Ge++:J.note.duration==="w"&&He++,he.note.duration==="h"?Ge++:he.note.duration==="w"&&He++;let $e=Ge===1||He===1||J.note.dots!==he.note.dots;if(D&&($e=$e||He===2),Ae===0&&$e){if(he.note.setXShift(Ce),J.note.dots>0){let Ze=0;for(const pt of J.note.modifiers)if(pt instanceof ge&&(Ze++,pt.setYShift(-10*(he.maxLine-J.line+1)),Ze===J.note.dots))break}}else Ae<1&&Ae>0?he.note.setXShift(Ce):J.note.voice!==he.note.voice&&J.stemDirection===he.stemDirection&&(J.line>he.line?J.stemDirection===1?he.note.renderFlag=!1:J.note.renderFlag=!1:he.line>J.line?he.stemDirection===1?J.note.renderFlag=!1:he.note.renderFlag=!1:he.stemDirection===1&&(he.stemDirection=-1,he.note.setStemDirection(-1)))}return!0}return se!==null&&se.minLinev.postFormat()),!0)}constructor(i){if(super(i),this.setAttribute("type","StaveNote"),this.keys=i.keys,this.clef=i.clef,this.octave_shift=i.octave_shift,this.beam=null,this.glyph=_.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new u.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(i)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.paddingRight=0,this.note_heads=[],this.modifiers=[],u.Merge(this.render_options,{glyph_font_scale:i.glyph_font_scale||_.DEFAULT_NOTATION_FONT_SCALE,stroke_px:i.stroke_px||Z.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),i.auto_stem?this.autoStem():this.setStemDirection(i.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const i=this.note_heads.map(C=>C.getStyle()),v=[];this.note_heads.forEach(C=>v.push(C.note_type)),this.buildNoteHeads(),this.note_heads.forEach((C,D)=>{C.setStyle(i[D]),v[D]&&(C.note_type=v[D])}),this.stave&&this.note_heads.forEach(C=>C.setStave(this.stave)),this.calcExtraPx()}setBeam(i){return this.beam=i,this.calcExtraPx(),this}getCategory(){return Z.CATEGORY}buildStem(){this.setStem(new A({hide:!!this.isRest()})),this.stem.id=u.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const i=this.getStemDirection(),v=this.getKeys();let C,D,j,J=null,se=null,he=!1;i===A.UP?(C=0,D=v.length,j=1):i===A.DOWN&&(C=v.length-1,D=-1,j=-1);for(let ve=C;ve!==D;ve+=j){const _e=this.keyProps[ve],Ce=_e.line;J===null?J=Ce:(se=Math.abs(J-Ce),se===0||se===.5?he=!he:(he=!1,this.use_default_head_x=!0)),J=Ce;const Ne=new re({duration:this.duration,note_type:this.noteType,displaced:he,stem_direction:i,custom_glyph_code:_e.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:_e.shift_right,stem_up_x_offset:_e.stem_up_x_offset,stem_down_x_offset:_e.stem_down_x_offset,stem_up_y_shift:_e.stem_up_y_shift,stem_down_y_shift:_e.stem_down_y_shift,line:_e.line});Ne.isLedgerLinedRest&&(this.hasLedgerLinedRest=!0),this.note_heads[ve]=Ne}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const i=(this.minLine+this.maxLine)/2<3?A.UP:A.DOWN;this.setStemDirection(i)}calculateKeyProps(){let i=null;for(let v=0;v0&&(this.keyProps[v-1].displaced=!0)),i=J,this.keyProps.push(j)}i=-1/0,this.keyProps.forEach(v=>{v.linev.line-C.line)}getBoundingBox(){if(!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:i,modLeftPx:v,extraLeftPx:C}=this.getMetrics(),D=this.getAbsoluteX()-v-C-this.paddingRight;let j=0,J=0;const se=this.getStave().getSpacingBetweenLines()/2,he=2*se;if(this.isRest()){const ve=this.ys[0],_e=_.durationToFraction(this.duration);_e.equals(1)||_e.equals(2)?(j=ve-se,J=ve+se):(j=ve-this.glyph.line_above*he,J=ve+this.glyph.line_below*he)}else if(this.glyph.stem){const ve=this.getStemExtents();ve.baseY+=se*this.stem_direction,j=Math.min(ve.topY,ve.baseY),J=Math.max(ve.topY,ve.baseY)}else{j=null,J=null;for(let ve=0;vev&&(v=D):D1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return this.noteType==="r"?this.getCenterGlyphX():super.getStemX()+A.WIDTH/(2*-this.getStemDirection())}getYForTopText(i){const v=this.getStemExtents();return Math.min(this.stave.getYForTopText(i),v.topY-this.render_options.annotation_spacing*(i+1))}getYForBottomText(i){const v=this.getStemExtents();return Math.max(this.stave.getYForTopText(i),v.baseY+this.render_options.annotation_spacing*i)}setStave(i){super.setStave(i);const v=this.note_heads.map(C=>(C.setStave(i),C.getY()));if(this.setYs(v),this.stem){const{y_top:C,y_bottom:D}=this.getNoteHeadBounds();this.stem.setYBounds(C,D)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(i){return this.displaced=i,this}getTieRightX(){let i=this.getAbsoluteX();return i+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(i+=this.modifierContext.getExtraRightPx()),i}getTieLeftX(){let i=this.getAbsoluteX();return i+=this.x_shift-this.extraLeftPx,i}getLineForRest(){let i=this.keyProps[0].line;if(this.keyProps.length>1){const v=this.keyProps[this.keyProps.length-1].line,C=Math.max(i,v),D=Math.min(i,v);i=u.MidLine(C,D)}return i}getModifierStartXY(i,v,C){if(C=C||{},!this.preFormatted)throw new u.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length===0)throw new u.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:D,BELOW:j,LEFT:J,RIGHT:se}=ae.Position;let he=0;return i===J?he=-2:i===se?(he=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===A.UP&&this.hasFlag()&&(C.forceFlagRight||((ve,_e)=>_e===(ve.getStemDirection()===A.UP?ve.keyProps.length-1:0))(this,v))&&(he+=this.flag.getMetrics().width)):i!==j&&i!==D||(he=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+he,y:this.ys[v]}}setStyle(i){super.setStyle(i),this.note_heads.forEach(v=>v.setStyle(i)),this.stem&&this.stem.setStyle(i)}setStemStyle(i){this.stem&&this.getStem().setStyle(i)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(i){this.ledgerLineStyle=i}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(i){this.flagStyle=i}getFlagStyle(){return this.flagStyle}setKeyStyle(i,v){return this.note_heads[i].setStyle(v),this}setKeyLine(i,v){return this.keyProps[i].line=v,this.reset(),this}getKeyLine(i){return this.keyProps[i].line}addToModifierContext(i){this.setModifierContext(i);for(let v=0;v{const Ne=Ce.getLine(),Ae=Ce.getY();(i===null||Aev)&&(v=Ae),D===null&&Ce.isDisplaced()&&(D=Ce.getAbsoluteX()),C!==null||Ce.isDisplaced()||(C=Ce.getAbsoluteX()),j=Ne>j?Ne:j,J=Ne{let Ot;Ot=bt&&ft?He-C:ft?Ge-C:Ae-C;const jt=ft&&bt?J:j;D.beginPath(),D.moveTo(Ot,pt),D.lineTo(Ot+jt,pt),D.stroke()},Ze={...i.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(D,Ze);for(let pt=6;pt<=se;++pt){const ft=Ge!==null&&pt<=_e,bt=Ae!==null&&pt<=ve;$e(i.getYForNote(pt),ft,bt)}for(let pt=0;pt>=he;--pt){const ft=Ge!==null&&pt>=Ne,bt=Ae!==null&&pt>=Ce;$e(i.getYForNote(pt),ft,bt)}this.restoreStyle(D,Ze)}drawModifiers(){if(!this.context)throw new u.RERR("NoCanvasContext","Can't draw without a canvas context.");const i=this.context;i.openGroup("modifiers");for(let v=0;v{this.context.openGroup("notehead",null,{pointerBBox:!0}),i.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(i){if(!this.context)throw new u.RERR("NoCanvasContext","Can't draw without a canvas context.");i&&this.setStem(new A(i)),this.stem.id=u.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new u.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new u.RERR("NoStave","Can't draw without a stave.");if(this.ys.length===0)throw new u.RERR("NoYValues","Can't draw note without Y values.");const i=this.getNoteHeadBeginX(),v=this.hasStem()&&!this.beam;if(this.note_heads.forEach(C=>C.setX(i)),this.stem){const C=this.getStemX();this.stem.setNoteHeadXBounds(C,C)}(function(...C){Z.DEBUG&&u.L("Vex.Flow.StaveNote",C)})("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),v&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class ye extends ae{static get CATEGORY(){return"frethandfinger"}static format(i,v){const{left_shift:C,right_shift:D}=v;if(!i||i.length===0)return!1;const j=[];let J=null,se=0,he=0;for(let He=0;He$e.line-He.line);let ve=0,_e=0,Ce=0,Ne=0,Ae=null,Ge=null;for(let He=0;HeCe?$e:Ce):pt===ae.Position.RIGHT&&(ft.setXShift(_e),$e=he+ln,Ne=$e>Ne?$e:Ne),Ae=bt,Ge=Ze}return v.left_shift+=Ce,v.right_shift+=Ne,!0}constructor(i){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=i,this.width=7,this.position=ae.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return ye.CATEGORY}setFretHandFinger(i){return this.finger=i,this}setOffsetX(i){return this.x_offset=i,this}setOffsetY(i){return this.y_offset=i,this}draw(){if(this.checkContext(),!this.note||this.index==null)throw new u.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const i=this.context,v=this.note.getModifierStartXY(this.position,this.index);let C=v.x+this.x_shift+this.x_offset,D=v.y+this.y_shift+this.y_offset+5;switch(this.position){case ae.Position.ABOVE:C-=4,D-=12;break;case ae.Position.BELOW:C-=2,D+=10;break;case ae.Position.LEFT:C-=this.width;break;case ae.Position.RIGHT:C+=1;break;default:throw new u.RERR("InvalidPostion",`The position ${this.position} does not exist`)}i.save(),i.setFont(this.font.family,this.font.size,this.font.weight),i.fillText(""+this.finger,C,D),i.restore()}}class Se{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:Se.scales.major,m:Se.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(i){return!(i==null||i<0||i>=Se.NUM_TONES)}isValidIntervalValue(i){return this.isValidNoteValue(i)}getNoteParts(i){if(!i||i.length<1)throw new u.RERR("BadArguments","Invalid note name: "+i);if(i.length>3)throw new u.RERR("BadArguments","Invalid note name: "+i);const v=i.toLowerCase(),C=/^([cdefgab])(b|bb|n|#|##)?$/.exec(v);if(C!=null)return{root:C[1],accidental:C[2]};throw new u.RERR("BadArguments","Invalid note name: "+i)}getKeyParts(i){if(!i||i.length<1)throw new u.RERR("BadArguments","Invalid key: "+i);const v=i.toLowerCase(),C=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(v);if(C!=null){const D=C[1],j=C[2];let J=C[3];return J||(J="M"),{root:D,accidental:j,type:J}}throw new u.RERR("BadArguments",`Invalid key: ${i}`)}getNoteValue(i){const v=Se.noteValues[i];if(v==null)throw new u.RERR("BadArguments",`Invalid note name: ${i}`);return v.int_val}getIntervalValue(i){const v=Se.intervals[i];if(v==null)throw new u.RERR("BadArguments",`Invalid interval name: ${i}`);return v}getCanonicalNoteName(i){if(!this.isValidNoteValue(i))throw new u.RERR("BadArguments",`Invalid note value: ${i}`);return Se.canonical_notes[i]}getCanonicalIntervalName(i){if(!this.isValidIntervalValue(i))throw new u.RERR("BadArguments",`Invalid interval value: ${i}`);return Se.diatonic_intervals[i]}getRelativeNoteValue(i,v,C){if(C==null&&(C=1),C!==1&&C!==-1)throw new u.RERR("BadArguments",`Invalid direction: ${C}`);let D=(i+C*v)%Se.NUM_TONES;return D<0&&(D+=Se.NUM_TONES),D}getRelativeNoteName(i,v){const C=this.getNoteParts(i),D=this.getNoteValue(C.root);let j=v-D;if(Math.abs(j)>Se.NUM_TONES-3){let se=1;j>0&&(se=-1);const he=(v+1+(D+1))%Se.NUM_TONES*se;if(Math.abs(he)>2)throw new u.RERR("BadArguments",`Notes not related: ${i}, ${v})`);j=he}if(Math.abs(j)>2)throw new u.RERR("BadArguments",`Notes not related: ${i}, ${v})`);let J=C.root;if(j>0)for(let se=1;se<=j;++se)J+="#";else if(j<0)for(let se=-1;se>=j;--se)J+="b";return J}getScaleTones(i,v){const C=[i];let D=i;for(let j=0;jOe.getMetrics().width;class ne extends ae{static get CATEGORY(){return"accidentals"}static format(i,v){const C=v.left_shift+1;if(!i||i.length===0)return;const D=[];let j,J=null,se=0;for(let $e=0;$eZe.line-$e.line);const he=[];let ve=0,_e=null;for(let $e=0;$eve?Ze.shift:ve,_e=Ze.line}let Ce=0;for(let $e=0;$ehe[pt+ci],Ot=ci=>ci.map(bt),jt=(ci,Zi)=>{const[br,bn]=Ot([ci,Zi]).map(pn=>pn.line);return br-bn},ln=(...ci)=>ci.map(Ot).every(Zi=>!this.checkCollision(...Zi)),Rn=ft-pt+1;let xn,Vi,ui=this.checkCollision(he[pt],he[ft])?"a":"b";switch(Rn){case 3:ui==="a"&&jt(1,2)===.5&&jt(0,1)!==.5&&(ui="second_on_bottom");break;case 4:ln([0,2],[1,3])&&(ui="spaced_out_tetrachord");break;case 5:ui==="b"&&ln([1,3])&&(ui="spaced_out_pentachord",ln([0,2],[2,4])&&(ui="very_spaced_out_pentachord"));break;case 6:ln([0,3],[1,4],[2,5])&&(ui="spaced_out_hexachord"),ln([0,2],[2,4],[1,3],[3,5])&&(ui="very_spaced_out_hexachord")}if(Rn>=7){let ci=2,Zi=!0;for(;Zi===!0;){Zi=!1;for(let br=0;br+ciVi?Ce:Vi}else for(xn=$e;xn<=ft;xn++)Vi=_.accidentalColumnsTable[Rn][ui][xn-$e],he[xn].column=Vi,Ce=Ce>Vi?Ce:Vi;$e=ft}const Ne=[],Ae=[];for(let $e=0;$e<=Ce;$e++)Ne[$e]=0,Ae[$e]=0;Ne[0]=ve+C,Ae[0]=ve+C,he.forEach($e=>{$e.width>Ne[$e.column]&&(Ne[$e.column]=$e.width)});for(let $e=1;$e{let Ze=0;const pt=He+$e.numAcc;for(;He0?(D=v.flatLine||v.dblSharpLine?2.5:3,i.dblSharpLine&&(C-=.5)):(D=i.flatLine||i.dblSharpLine?2.5:3,v.dblSharpLine&&(C-=.5));const j=Math.abs(C){const he=new a(0,1);se.getTickables().forEach(ve=>{if(ve.shouldIgnoreTicks())return;const _e=D[he.value()];_e?_e.push(ve):(C.push(he.value()),D[he.value()]=[ve]),he.add(ve.getTicks())})});const j=new Se;v||(v="C");const J=j.createScaleMap(v);C.forEach(se=>{const he=D[se],ve=[],_e=Ce=>{Ce.isRest()||Ce.shouldIgnoreTicks()||(Ce.keys.forEach((Ne,Ae)=>{const Ge=j.getNoteParts(Ne.split("/")[0]),He=Ge.accidental||"n",$e=Ge.root+He,Ze=J[Ge.root]===$e,pt=ve.indexOf($e)>-1;if(!Ze||Ze&&pt){J[Ge.root]=$e;const ft=new ne(He);Ce.addAccidental(Ae,ft),ve.push($e)}}),Ce.getModifiers().forEach(Ne=>{Ne.getCategory()==="gracenotegroups"&&Ne.getGraceNotes().forEach(_e)}))};he.forEach(_e)})}constructor(i=null){if(super(),this.setAttribute("type","Accidental"),X("New accidental: ",i),this.note=null,this.index=null,this.type=i,this.position=ae.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=_.accidentalCodes(this.type),!this.accidental)throw new u.RERR("ArgumentError",`Unknown accidental type: ${i}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const i=this.render_options.font_scale;this.glyph=new S(this.accidental.code,i),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new S(_.accidentalCodes("{").code,i),this.parenRight=new S(_.accidentalCodes("}").code,i),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return ne.CATEGORY}getWidth(){const i=this.cautionary?ee(this.parenLeft)+ee(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return ee(this.glyph)+i}setNote(i){if(!i)throw new u.RERR("ArgumentError",`Bad note value: ${i}`);this.note=i,this.note.getCategory()==="gracenotes"&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:i,type:v,position:C,note:D,index:j,cautionary:J,x_shift:se,y_shift:he,glyph:ve,parenLeft:_e,parenRight:Ce,render_options:{parenLeftPadding:Ne,parenRightPadding:Ae}}=this;if(this.checkContext(),!D||j==null)throw new u.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const Ge=D.getModifierStartXY(C,j);let He=Ge.x+se;const $e=Ge.y+he;X("Rendering: ",v,He,$e),J?(Ce.render(i,He,$e),He-=ee(Ce),He-=Ae,He-=this.accidental.parenRightPaddingAdjustment,ve.render(i,He,$e),He-=ee(ve),He-=Ne,_e.render(i,He,$e)):ve.render(i,He,$e),this.setRendered()}}class O extends ae{static get CATEGORY(){return"notesubgroup"}static format(i,v){if(!i||i.length===0)return!1;let C=0;for(let D=0;D{v.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Et,this.voice=new G({num_beats:4,beat_value:4,resolution:_.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return O.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(i){this.note=i}setWidth(i){this.width=i}getWidth(){return this.width}draw(){this.checkContext();const i=this.getNote();if(!i||this.index===null)throw new u.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,i),this.subNotes.forEach(v=>v.setContext(this.context).drawWithStyle())}}class z extends h{constructor(i,v){super(),this.setAttribute("type","StaveTie"),this.notes=i,this.context=null,this.text=v,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:10,style:""}},this.font=this.render_options.font,this.setNotes(i)}setFont(i){return this.font=i,this}setDirection(i){return this.direction=i,this}setNotes(i){if(!i.first_note&&!i.last_note)throw new u.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(i.first_indices||(i.first_indices=[0]),i.last_indices||(i.last_indices=[0]),i.first_indices.length!==i.last_indices.length)throw new u.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=i.first_note,this.first_indices=i.first_indices,this.last_note=i.last_note,this.last_indices=i.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(i){if(i.first_ys.length===0||i.last_ys.length===0)throw new u.RERR("BadArguments","No Y-values to render");const v=this.context;let C=this.render_options.cp1,D=this.render_options.cp2;Math.abs(i.last_x_px-i.first_x_px)<10&&(C=2,D=8);const j=this.render_options.first_x_shift,J=this.render_options.last_x_shift,se=this.render_options.y_shift*i.direction;for(let he=0;he1){const v=new W(i);v.render_options.beam_width=3,v.render_options.partial_beam_length=4,this.beams.push(v)}return this}setNote(i){this.note=i}setWidth(i){this.width=i}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const i=this.getNote();if(function(...v){q.DEBUG&&u.L("Vex.Flow.GraceNoteGroup",v)}("Drawing grace note group for:",i),!i||this.index===null)throw new u.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),i),this.grace_notes.forEach(v=>{v.setContext(this.context).draw()}),this.beams.forEach(v=>{v.setContext(this.context).draw()}),this.show_slur){const v=this.getNote().getCategory()===Z.CATEGORY,C=v?z:K;this.slur=new C({last_note:this.grace_notes[0],first_note:i,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(v?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class de extends ae{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(i,v){const C=v.left_shift;if(!i||i.length===0)return this;const D=i.map(se=>{const he=se.getNote();if(he instanceof Z){const{line:ve,displaced:_e}=he.getKeyProps()[se.getIndex()];return{line:ve,shift:_e?he.getExtraLeftPx():0,stroke:se}}{const{str:ve}=he.getPositions()[se.getIndex()];return{line:ve,shift:0,stroke:se}}}),j=C,J=D.reduce((se,{stroke:he,shift:ve})=>(he.setXShift(j+ve),Math.max(he.getWidth()+0,se)),0);return v.left_shift+=J,!0}constructor(i,v){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=u.Merge({},v),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=i,this.position=ae.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return de.CATEGORY}getPosition(){return this.position}addEndNote(i){return this.note_end=i,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index==null)throw new u.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const i=this.note.getModifierStartXY(this.position,this.index);let v=this.note.getYs(),C=i.y,D=i.y;const j=i.x-5,J=this.note.stave.options.spacing_between_lines_px,se=this.getModifierContext().getModifiers(this.note.getCategory());for(let Ae=0;Aebt.line-ft.line);let Ge=0,He=0,$e=0,Ze=null,pt=null;for(J=0;JHe?ft:He):ve===ae.Position.RIGHT&&(se.setXShift(Ge),ft+=jt,$e=ft>$e?ft:$e),Ze=bt,pt=he}return v.left_shift+=He,v.right_shift+=$e,!0}constructor(i){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=i,this.setWidth(20),this.position=ae.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=R.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return ue.CATEGORY}getNote(){return this.note}setNote(i){return this.note=i,this}getIndex(){return this.index}setIndex(i){return this.index=i,this}setLineEndType(i){return i>=R.LineEndType.NONE&&i<=R.LineEndType.DOWN&&(this.leg=i),this}setStringNumber(i){return this.string_number=i,this}setOffsetX(i){return this.x_offset=i,this}setOffsetY(i){return this.y_offset=i,this}setLastNote(i){return this.last_note=i,this}setDashed(i){return this.dashed=i,this}draw(){const i=this.checkContext();if(!this.note||this.index==null)throw new u.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const v=this.note.stave.options.spacing_between_lines_px,C=this.note.getModifierStartXY(this.position,this.index);let D=C.x+this.x_shift+this.x_offset,j=C.y+this.y_shift+this.y_offset;switch(this.position){case ae.Position.ABOVE:case ae.Position.BELOW:{const se=this.note.getStemExtents();let he=se.topY,ve=se.baseY+2;this.note.stem_direction===Z.STEM_DOWN&&(he=se.baseY,ve=se.topY-2),j=this.position===ae.Position.ABOVE?this.note.hasStem()?he-1.75*v:C.y-1.75*v:this.note.hasStem()?ve+1.5*v:C.y+1.75*v,j+=this.y_shift+this.y_offset;break}case ae.Position.LEFT:D-=this.radius/2+5;break;case ae.Position.RIGHT:D+=this.radius/2+6;break;default:throw new u.RERR("InvalidPosition",`The position ${this.position} is invalid`)}i.save(),i.beginPath(),i.arc(D,j,this.radius,0,2*Math.PI,!1),i.lineWidth=1.5,i.stroke(),i.setFont(this.font.family,this.font.size,this.font.weight);const J=D-i.measureText(this.string_number).width/2;if(i.fillText(""+this.string_number,J,j+4.5),this.last_note!=null){const se=this.last_note.getStemX()-this.note.getX()+5;let he,ve;switch(i.strokeStyle="#000000",i.lineCap="round",i.lineWidth=.6,this.dashed?R.drawDashedLine(i,D+10,j,D+se,j,[3,3]):R.drawDashedLine(i,D+10,j,D+se,j,[3,0]),this.leg){case R.LineEndType.UP:he=-10,ve=this.dashed?[3,3]:[3,0],R.drawDashedLine(i,D+se,j,D+se,j+he,ve);break;case R.LineEndType.DOWN:he=10,ve=this.dashed?[3,3]:[3,0],R.drawDashedLine(i,D+se,j,D+se,j+he,ve)}}i.restore()}}class ce extends ${static getNextContext(i){const v=i.tContexts,C=v.indexOf(i);return v[C+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new a(0,1),this.maxTicks=new a(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(i){return this.x=i,this.xBase=i,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(i){this.xBase=i,this.x=i+this.xOffset}getXOffset(){return this.xOffset}setXOffset(i){this.xOffset=i,this.x=this.xBase+i}getWidth(){return this.width+2*this.padding}setPadding(i){return this.padding=i,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(i=>i.isCenterAligned())}getMetrics(){const{width:i,notePx:v,extraLeftPx:C,extraRightPx:D}=this;return{width:i,notePx:v,extraLeftPx:C,extraRightPx:D}}getCurrentTick(){return this.currentTick}setCurrentTick(i){this.currentTick=i,this.preFormatted=!1}getExtraPx(){let i=0,v=0,C=0,D=0;for(let j=0;j.5*Oe(i/.5),ze=(Oe,i)=>i===pe?Oe<=5:Oe>=1,De=(Oe,i)=>ze(Oe,i)?i===pe?Math.ceil:Math.floor:Math.round,Qe=Oe=>{const i=Oe.getCategory();return i==="stavenotes"||i==="gracenotes"};class ke extends ae{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(i,v){if(!i||i.length===0)return!1;const C=(j,J,se)=>Me(De(J,se),j.glyph.getMetrics().height/10+.5);i.filter(j=>j.getPosition()===pe).forEach(j=>{j.setTextLine(v.top_text_line),v.top_text_line+=C(j,v.top_text_line,pe)}),i.filter(j=>j.getPosition()===we).forEach(j=>{j.setTextLine(v.text_line),v.text_line+=C(j,v.text_line,we)});const D=i.map(j=>j.getWidth()).reduce((j,J)=>Math.max(J,j));return v.left_shift+=D/2,v.right_shift+=D/2,!0}static easyScoreHook({articulations:i},v,C){if(!i)return;const D={staccato:"a.",tenuto:"a-"};i.split(",").map(j=>j.trim().split(".")).map(([j,J])=>{const se={type:D[j]};return J&&(se.position=ae.PositionString[J]),C.getFactory().Articulation(se)}).map(j=>v.addModifier(0,j))}constructor(i){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=i,this.position=we,this.render_options={font_scale:38},this.breathMarkDistance=.8,this.articulation=_.articulationCodes(this.type),this.type==="abr"&&(this.articulation={code:"v6c",between_lines:!1}),!this.articulation)throw new u.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new S(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return ke.CATEGORY}draw(){const{note:i,index:v,position:C,glyph:D,articulation:{between_lines:j},text_line:J,context:se}=this;if(this.checkContext(),!i||v==null)throw new u.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const he=i.getStave(),ve=he.getSpacingBetweenLines(),_e=i.getCategory()==="tabnotes";let{x:Ce}=i.getModifierStartXY(C,v);if(this.type==="abr"){let $e=0;const Ze=i.getTickContext(),pt=ce.getNextContext(Ze),ft=i.getTickContext().getX();if(pt)$e=(pt.getX()-ft)*this.breathMarkDistance;else{const bt=i.getStave();$e=(bt.getX()+bt.getWidth()-ft)*this.breathMarkDistance}Ce+=$e}const Ne=this.getXShift();Ne&&(Ce+=Ne);const Ae=!j||_e,Ge=(($e,Ze)=>{const pt=Ze===pe&&$e.getStemDirection()===A.UP||Ze===we&&$e.getStemDirection()===A.DOWN;return Qe($e)?$e.hasStem()&&pt?.5:1:$e.hasStem()&&pt?1:0})(i,C);let He={[pe]:()=>{D.setOrigin(.5,1);const $e=((Ze,pt)=>{const ft=Ze.getStave(),bt=Ze.getStemDirection(),{topY:Ot,baseY:jt}=Ze.getStemExtents();if(Qe(Ze))return Ze.hasStem()?bt===A.UP?Ot:jt:Math.min(...Ze.getYs());if(Ze.getCategory()==="tabnotes")return Ze.hasStem()&&bt===A.UP?Ot:ft.getYForTopText(pt);throw new u.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(i,J)-(J+Ge)*ve;return Ae?Math.min(he.getYForTopText(ke.INITIAL_OFFSET),$e):$e},[we]:()=>{D.setOrigin(.5,0);const $e=((Ze,pt)=>{const ft=Ze.getStave(),bt=Ze.getStemDirection(),{topY:Ot,baseY:jt}=Ze.getStemExtents();if(Qe(Ze))return Ze.hasStem()?bt===A.UP?jt:Ot:Math.max(...Ze.getYs());if(Ze.getCategory()==="tabnotes")return Ze.hasStem()?bt===A.UP?ft.getYForBottomText(pt):Ot:ft.getYForBottomText(pt);throw new u.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(i,J)+(J+Ge)*ve;return Ae?Math.max(he.getYForBottomText(ke.INITIAL_OFFSET),$e):$e}}[C]();if(this.y_shift&&(He+=this.y_shift),!_e){const $e=C===pe?-1:1,Ze=_e?i.positions[v].str:i.getKeyProps()[v].line,pt=(i.getYs()[v]-He)/ve+Ze,ft=((bt,Ot,jt,ln)=>{const Rn=Me(De(Ot,jt),Ot);return bt&&ze(Rn,jt)&&Rn%1==0?Rn+.5*-ln:Rn})(j,pt,C,$e);ze(ft,C)&&D.setOrigin(.5,.5),He+=Math.abs(ft-pt)*ve*$e}(function(...$e){ke.DEBUG&&u.L("Vex.Flow.Articulation",$e)})(`Rendering articulation at (x: ${Ce}, y: ${He})`),D.render(se,Ce,He)}}class We extends ae{static get CATEGORY(){return"ornaments"}static format(i,v){if(!i||i.length===0)return!1;let C=0;for(let D=0;D0&&D--;for(let he=0;he{it("Preformatting ModifierContext: ",i.CATEGORY),i.format(this.getModifiers(i.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(i=>{it("Postformatting ModifierContext: ",i.CATEGORY),i.postFormat(this.getModifiers(i.CATEGORY),this)})}}function vt(Oe,i,v,C){let D=i;for(v+=1;v{if(he.getMode()===G.Mode.STRICT&&!he.isComplete())throw new u.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(se,a.LCM(se,he.getResolutionMultiplier()))},1),D={},j=[],J=[];return Oe.forEach(se=>{const he=new a(0,C);se.getTickables().forEach(ve=>{const _e=he.numerator;if(!D[_e]){const Ce=new i;J.push(Ce),D[_e]=Ce}v(ve,D[_e]),j.push(_e),he.add(ve.getTicks())})}),{map:D,array:J,list:u.SortAndUnique(j,(se,he)=>se-he,(se,he)=>se===he),resolutionMultiplier:C}}class Et{static SimpleFormat(i,v=0,{paddingBetween:C=10}={}){i.reduce((D,j)=>{j.addToModifierContext(new ht);const J=new ce().addTickable(j).preFormat(),se=J.getExtraPx();return J.setX(D+se.left),D+J.getWidth()+se.right+C},v)}static plotDebugging(i,v,C,D,j){const J=C+ie.STAVEPADDING,se=v.contextGaps;i.save(),i.setFont("Arial",8,""),se.gaps.forEach(he=>{var ve,_e,Ce;ve=J+he.x1,_e=J+he.x2,Ce="#aaa",i.beginPath(),i.setStrokeStyle(Ce),i.setFillStyle(Ce),i.setLineWidth(1),i.fillRect(ve,D,_e-ve,j-D),i.fillText(Math.round(he.x2-he.x1),J+he.x1,j+12)}),i.fillText(Math.round(se.total)+"px",J-20,j+12),i.setFillStyle("red"),i.fillText("Loss: "+v.lossHistory.map(he=>Math.round(he)),J-20,j+22),i.restore()}static FormatAndDraw(i,v,C,D){const j={auto_beam:!1,align_rests:!1};typeof D=="object"?u.Merge(j,D):typeof D=="boolean"&&(j.auto_beam=D);const J=new G(_.TIME4_4).setMode(G.Mode.SOFT).addTickables(C),se=j.auto_beam?W.applyAndGetBeams(J):[];return new Et().joinVoices([J],{align_rests:j.align_rests}).formatToStave([J],v,{align_rests:j.align_rests,stave:v}),J.setStave(v).draw(i,v),se.forEach(he=>he.setContext(i).draw()),J.getBoundingBox()}static FormatAndDrawTab(i,v,C,D,j,J,se){const he={auto_beam:J,align_rests:!1};typeof se=="object"?u.Merge(he,se):typeof se=="boolean"&&(he.auto_beam=se);const ve=new G(_.TIME4_4).setMode(G.Mode.SOFT).addTickables(j),_e=new G(_.TIME4_4).setMode(G.Mode.SOFT).addTickables(D),Ce=he.auto_beam?W.applyAndGetBeams(ve):[];new Et().joinVoices([ve],{align_rests:he.align_rests}).joinVoices([_e]).formatToStave([ve,_e],C,{align_rests:he.align_rests}),ve.draw(i,C),_e.draw(i,v),Ce.forEach(Ne=>Ne.setContext(i).draw()),new L(C,v).setContext(i).draw()}static AlignRestsToNotes(i,v,C){return i.forEach((D,j)=>{if(D instanceof Z&&D.isRest()){if(D.tuplet&&!C)return;const J=D.getGlyph().position.toUpperCase();if(J!=="R/4"&&J!=="B/4")return;if(v||D.beam!=null){const se=D.getKeyProps()[0];if(j===0)se.line=vt(i,se.line,j,!1),D.setKeyLine(0,se.line);else if(j>0&&jEt.AlignRestsToNotes(C.getTickables(),v))}preCalculateMinTotalWidth(i){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!i)throw new u.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(i)}const{list:v,map:C}=this.tickContexts;return this.minTotalWidth=v.map(D=>{const j=C[D];return j.preFormat(),j.getWidth()}).reduce((D,j)=>D+j,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new u.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(i){const v=ot(i,ht,(C,D)=>C.addToModifierContext(D));return this.modiferContexts=v,v}createTickContexts(i){const v=ot(i,ce,(C,D)=>D.addTickable(C));return v.array.forEach(C=>{C.tContexts=v.array}),this.totalTicks=i[0].getTicksUsed().clone(),this.tickContexts=v,v}preFormat(i=0,v,C,D){const j=this.tickContexts,{list:J,map:se,resolutionMultiplier:he}=j;C&&D&&C.forEach($e=>$e.setStave(D).preFormat());let ve=0,_e=0;const Ce=i/2;if(this.minTotalWidth=0,J.forEach($e=>{const Ze=se[$e];v&&Ze.setContext(v),Ze.preFormat();const pt=Ze.getWidth();this.minTotalWidth+=pt;const ft=Ze.getMetrics();ve=ve+_e+ft.extraLeftPx,Ze.setX(ve),_e=pt-ft.extraLeftPx}),this.minTotalWidth=ve+_e,this.hasMinTotalWidth=!0,i<=0)return;const Ne=i-this.minTotalWidth;let Ae=this.totalTicks.value();Ae===0&&(Ae=1);const Ge=Ne/(Ae*he);let He=0;J.forEach(($e,Ze)=>{const pt=J[Ze-1]||0,ft=se[$e];He+=($e-pt)*Ge,ft.setX(ft.getX()+He),ft.getCenterAlignedTickables().forEach(bt=>{bt.center_x_shift=Ce-ft.getX()})}),J.length!==1&&(this.justifyWidth=i,this.lossHistory=[],this.evaluate())}evaluate(){const i=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((D,j)=>{if(j===0)return;const J=this.tickContexts.list[j-1],se=this.tickContexts.map[J],he=this.tickContexts.map[D],ve=se.getMetrics(),_e=se.getX()+ve.width,Ce=he.getX(),Ne=Ce-_e;this.contextGaps.total+=Ne,this.contextGaps.gaps.push({x1:_e,x2:Ce}),he.getFormatterMetrics().freedom.left=Ne,se.getFormatterMetrics().freedom.right=Ne});const v=this.durationStats={};this.voices.forEach(D=>{D.getTickables().forEach((j,J,se)=>{const he=j.getTicks().clone().simplify().toString(),ve=j.getMetrics(),_e=j.getFormatterMetrics(),Ce=j.getX()+ve.noteWidth+ve.modRightPx+ve.extraRightPx;let Ne=0;if(J{D.getTickables().forEach(j=>{const J=j.getTicks().clone().simplify().toString(),se=j.getFormatterMetrics();se.iterations+=1,se.space.deviation=se.space.used-v[J].mean,se.duration=J,se.space.mean=v[J].mean,C+=Math.pow(v[J].mean,2)})}),this.totalCost=Math.sqrt(C),this.lossHistory.push(this.totalCost),this}tune(){let i=0;return this.tickContexts.list.forEach((v,C,D)=>{const j=this.tickContexts.map[v],J=C>0?this.tickContexts.map[D[C-1]]:null,se=C_e.getFormatterMetrics().space.deviation).reduce((_e,Ce)=>_e+Ce);he>0?i=-Math.min(j.getFormatterMetrics().freedom.right,Math.abs(he)):he<0&&(i=se?Math.min(se.getFormatterMetrics().freedom.right,Math.abs(he)):0);const ve=Math.min(5,Math.abs(i));i=i>0?ve:-ve}),this.evaluate()}postFormat(){const i=v=>v.list.forEach(C=>v.map[C].postFormat());return i(this.modiferContexts),i(this.tickContexts),this}joinVoices(i){return this.createModifierContexts(i),this.hasMinTotalWidth=!1,this}format(i,v,C){const D={align_rests:!1,context:null,stave:null};return u.Merge(D,C),this.voices=i,this.alignRests(i,D.align_rests),this.createTickContexts(i),this.preFormat(v,D.context,i,D.stave),this}formatToStave(i,v,C){const D=v.getNoteEndX()-v.getNoteStartX()-10;(function(...J){Et.DEBUG&&u.L("Vex.Flow.Formatter",J)})("Formatting voices to width: ",D);const j={context:v.getContext()};return u.Merge(j,C),this.format(i,D,j)}}class ct extends h{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=ct.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(i){return this.position=i,this}getStave(){return this.stave}setStave(i){return this.stave=i,this}getWidth(){return this.width}setWidth(i){return this.width=i,this}getX(){return this.x}setX(i){return this.x=i,this}getCategory(){return""}makeSpacer(i){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:i})}}placeGlyphOnLine(i,v,C){i.setYShift(v.getYForLine(C)-v.getYForGlyphs())}getPadding(i){return i!==void 0&&i<2?0:this.padding}setPadding(i){return this.padding=i,this}setLayoutMetrics(i){return this.layoutMetrics=i,this}getLayoutMetrics(){return this.layoutMetrics}}class _t extends ct{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:_t.type.SINGLE,double:_t.type.DOUBLE,end:_t.type.END,repeatBegin:_t.type.REPEAT_BEGIN,repeatEnd:_t.type.REPEAT_END,repeatBoth:_t.type.REPEAT_BOTH,none:_t.type.NONE}}constructor(i){super(),this.setAttribute("type","Barline"),this.thickness=_.STAVE_LINE_THICKNESS;const v=_t.type;this.widths={},this.widths[v.SINGLE]=5,this.widths[v.DOUBLE]=5,this.widths[v.END]=5,this.widths[v.REPEAT_BEGIN]=5,this.widths[v.REPEAT_END]=5,this.widths[v.REPEAT_BOTH]=5,this.widths[v.NONE]=5,this.paddings={},this.paddings[v.SINGLE]=0,this.paddings[v.DOUBLE]=0,this.paddings[v.END]=0,this.paddings[v.REPEAT_BEGIN]=15,this.paddings[v.REPEAT_END]=15,this.paddings[v.REPEAT_BOTH]=15,this.paddings[v.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[v.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[v.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(ct.Position.BEGIN),this.setType(i)}getCategory(){return _t.CATEGORY}getType(){return this.type}setType(i){return this.type=typeof i=="string"?_t.typeString[i]:i,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(i){switch(i.checkContext(),this.setRendered(),this.type){case _t.type.SINGLE:this.drawVerticalBar(i,this.x,!1);break;case _t.type.DOUBLE:this.drawVerticalBar(i,this.x,!0);break;case _t.type.END:this.drawVerticalEndBar(i,this.x);break;case _t.type.REPEAT_BEGIN:this.drawRepeatBar(i,this.x,!0),i.getX()!==this.x&&this.drawVerticalBar(i,i.getX());break;case _t.type.REPEAT_END:this.drawRepeatBar(i,this.x,!1);break;case _t.type.REPEAT_BOTH:this.drawRepeatBar(i,this.x,!1),this.drawRepeatBar(i,this.x,!0)}}drawVerticalBar(i,v,C){i.checkContext();const D=i.getTopLineTopY(),j=i.getBottomLineBottomY();C&&i.context.fillRect(v-3,D,1,j-D),i.context.fillRect(v,D,1,j-D)}drawVerticalEndBar(i,v){i.checkContext();const C=i.getTopLineTopY(),D=i.getBottomLineBottomY();i.context.fillRect(v-5,C,1,D-C),i.context.fillRect(v-2,C,3,D-C)}drawRepeatBar(i,v,C){i.checkContext();const D=i.getTopLineTopY(),j=i.getBottomLineBottomY();let J=3;C||(J=-5),i.context.fillRect(v+J,D,1,j-D),i.context.fillRect(v-2,D,3,j-D),C?J+=4:J-=4;const se=v+J+1;let he=(i.getNumLines()-1)*i.getSpacingBetweenLines();he=he/2-i.getSpacingBetweenLines()/2;let ve=D+he+1;i.context.beginPath(),i.context.arc(se,ve,2,0,2*Math.PI,!1),i.context.fill(),ve+=i.getSpacingBetweenLines(),i.context.beginPath(),i.context.arc(se,ve,2,0,2*Math.PI,!1),i.context.fill()}}class Nt extends ct{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(i,v,C){super(),this.setAttribute("type","Repetition"),this.symbol_type=i,this.x=v,this.x_shift=0,this.y_shift=C,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return Nt.CATEGORY}setShiftX(i){return this.x_shift=i,this}setShiftY(i){return this.y_shift=i,this}setX(i){return this.x=i,this}draw(i,v){switch(this.setRendered(),this.symbol_type){case Nt.type.CODA_RIGHT:this.drawCodaFixed(i,v+i.width);break;case Nt.type.CODA_LEFT:this.drawSymbolText(i,v,"Coda",!0);break;case Nt.type.SEGNO_LEFT:this.drawSignoFixed(i,v);break;case Nt.type.SEGNO_RIGHT:this.drawSignoFixed(i,v+i.width);break;case Nt.type.DC:this.drawSymbolText(i,v,"D.C.",!1);break;case Nt.type.DC_AL_CODA:this.drawSymbolText(i,v,"D.C. al",!0);break;case Nt.type.DC_AL_FINE:this.drawSymbolText(i,v,"D.C. al Fine",!1);break;case Nt.type.DS:this.drawSymbolText(i,v,"D.S.",!1);break;case Nt.type.DS_AL_CODA:this.drawSymbolText(i,v,"D.S. al",!0);break;case Nt.type.DS_AL_FINE:this.drawSymbolText(i,v,"D.S. al Fine",!1);break;case Nt.type.FINE:this.drawSymbolText(i,v,"Fine",!1);break;case Nt.type.TO_CODA:this.drawSymbolText(i,v,"To",!0)}return this}drawCodaFixed(i,v){const C=i.getYForTopText(i.options.num_lines)+this.y_shift;return S.renderGlyph(i.context,this.x+v+this.x_shift,C+25,40,"v4d",!0),this}drawSignoFixed(i,v){const C=i.getYForTopText(i.options.num_lines)+this.y_shift;return S.renderGlyph(i.context,this.x+v+this.x_shift,C+25,30,"v8c",!0),this}drawSymbolText(i,v,C,D){const j=i.checkContext();j.save(),j.setFont(this.font.family,this.font.size,this.font.weight);let J=0+this.x_shift,se=v+this.x_shift;if(this.symbol_type===Nt.type.CODA_LEFT?(J=this.x+this.x_shift,se=J+j.measureText(C).width+12):(this.x_shift=-(J+j.measureText(C).width+12+i.options.vertical_bar_width+12),J=this.x+this.x_shift+i.options.vertical_bar_width,se=J+j.measureText(C).width+12),this.xShiftAsPercentOfStaveWidth){const ve=i.width*this.xShiftAsPercentOfStaveWidth;this.symbol_type!==Nt.type.DC_AL_FINE&&this.symbol_type!==Nt.type.FINE&&this.symbol_type!==Nt.type.DC&&this.symbol_type!==Nt.type.DS_AL_FINE&&this.symbol_type!==Nt.type.DS&&this.symbol_type!==Nt.type.FINE||(J+=ve)}const he=i.getYForTopText(i.options.num_lines)+this.y_shift+25;return D&&S.renderGlyph(j,se,he,40,"v4d",!0),j.fillText(C,J,he+5),j.restore(),this}}class qt extends ct{static get CATEGORY(){return"stavesection"}constructor(i,v,C){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=i,this.x=v,this.shift_x=0,this.shift_y=C,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return qt.CATEGORY}setStaveSection(i){return this.section=i,this}setShiftX(i){return this.shift_x=i,this}setShiftY(i){return this.shift_y=i,this}draw(i,v){const C=i.checkContext();this.setRendered(),C.save(),C.lineWidth=2,C.setFont(this.font.family,this.font.size,this.font.weight);const D=C.measureText(""+this.section),j=D.width;let J=D.height;!J&&D.emHeightAscent>=0&&(J=D.emHeightAscent+2),J||(J=D.fontBoundingBoxAscent+3);let se=j+6;se<18&&(se=18);const he=J+this.font.size/10,ve=i.getYForTopText(3)+19-1.15*he+this.shift_y;let _e=this.x+v;return C.beginPath(),C.lineWidth=2,C.rect(_e,ve+J/4,se,he),C.stroke(),_e+=(se-j)/2,C.fillText(""+this.section,_e,ve+he),C.restore(),this}}class li extends ct{static get CATEGORY(){return"stavetempo"}constructor(i,v,C){super(),this.setAttribute("type","StaveTempo"),this.tempo=i,this.position=ae.Position.ABOVE,this.x=v,this.shift_x=10,this.shift_y=C,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return li.CATEGORY}setTempo(i){return this.tempo=i,this}setShiftX(i){return this.shift_x=i,this}setShiftY(i){return this.shift_y=i,this}draw(i,v){const C=i.checkContext();this.setRendered();const D=this.render_options,j=D.glyph_font_scale/38,J=this.tempo.name,se=this.tempo.duration,he=this.tempo.dots,ve=this.tempo.bpm,_e=this.font;let Ce=this.x+this.shift_x+v;const Ne=i.getYForTopText(1)+this.shift_y;if(C.save(),J&&(C.setFont(_e.family,_e.size,_e.weight),C.fillText(J,Ce,Ne),Ce+=C.measureText(J).width),se&&ve){C.setFont(_e.family,_e.size,"normal"),J&&(Ce+=C.measureText(" ").width,C.fillText("(",Ce,Ne),Ce+=C.measureText("(").width);const Ae=_.getGlyphProps(se);if(Ce+=3*j,S.renderGlyph(C,Ce,Ne,D.glyph_font_scale,Ae.code_head),Ce+=Ae.getWidth()*j,Ae.stem){let Ge=30;Ae.beam_count&&(Ge+=3*(Ae.beam_count-1)),Ge*=j;const He=Ne-Ge;C.fillRect(Ce-j,He,j,Ge),Ae.flag&&(S.renderGlyph(C,Ce,He,D.glyph_font_scale,Ae.code_flag_upstem),he||(Ce+=6*j))}for(let Ge=0;Ge=i.line?he.above:he.below)}this.placeGlyphOnLine(D,this.stave,i.line),this.glyphs.push(D);const J=this.xPositions[this.xPositions.length-1],se=D.getMetrics().width+j;this.xPositions.push(J+se),this.width+=se}cancelKey(i){return this.formatted=!1,this.cancelKeySpec=i,this}convertToCancelAccList(i){const v=_.keySignature(i),C=this.accList.length>0&&v.length>0&&v[0].type!==this.accList[0].type,D=C?v.length:v.length-this.accList.length;if(D<1)return;const j=[];for(let J=0;J0?i[0].type:null;let C;if(this.cancelKeySpec&&(C=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const D=(this.position===ct.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;C&&this.convertAccLines(D,C.type,C.accList),this.convertAccLines(D,v,i);for(let j=0;j0){const i=this.stave.context.openGroup("keysignature");for(let v=0;v{const j=D.split("/").filter(J=>J!=="");if(j.length!==2)throw new u.RERR("BadTimeSignature",`Invalid time spec: ${D}. Must be in the form "/"`);j.forEach(J=>{if(isNaN(Number(J)))throw new u.RERR("BadTimeSignature",`Invalid time spec: ${D}. Must contain two valid numbers.`)})})(i);const[v,C]=i.split("/").map(D=>D.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(v,C)}}makeTimeSignatureGlyph(i,v){const C=new S("v0",this.point);C.topGlyphs=[],C.botGlyphs=[];let D=0;for(let Ce=0;Cej?D:j,se=C.getMetrics().x_min;C.getMetrics=()=>({x_min:se,x_max:se+J,width:J});const he=(J-D)/2,ve=(J-j)/2,_e=this;return C.renderToStave=function(Ce){let Ne=Ce+he;for(let Ae=0;Ae{C.getNoteStartX()>v&&(v=C.getNoteStartX())}),i.forEach(C=>{C.setNoteStartX(v)}),v=0,i.forEach(C=>{C.getModifiers(ct.Position.BEGIN,_t.CATEGORY).forEach(D=>{D.getType()==_t.type.REPEAT_BEGIN&&D.getX()>v&&(v=D.getX())})}),i.forEach(C=>{C.getModifiers(ct.Position.BEGIN,_t.CATEGORY).forEach(D=>{D.getType()==_t.type.REPEAT_BEGIN&&D.setX(v)})}),v=0,i.forEach(C=>{C.getModifiers(ct.Position.BEGIN,tn.CATEGORY).forEach(D=>{D.getX()>v&&(v=D.getX())})}),i.forEach(C=>{C.getModifiers(ct.Position.BEGIN,tn.CATEGORY).forEach(D=>{D.setX(v)})})}getOptions(){return this.options}setNoteStartX(i){return this.formatted||this.format(),this.setStartX(i),this}setStartX(i){this.start_x=i}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(i){return this.options.num_lines=parseInt(i,10),this.resetLines(),this}setY(i){return this.y=i,this}getTopLineTopY(){return this.getYForLine(0)-_.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getYForLine(this.getNumLines()-1)+_.STAVE_LINE_THICKNESS/2}setX(i){const v=i-this.x;this.formatted=!1,this.x=i,this.start_x+=v,this.end_x+=v;for(let C=0;CC.getWidth()&&(v-=C.getWidth()),v}setRepetitionTypeLeft(i,v){return this.modifiers.push(new Nt(i,this.x,v)),this}setRepetitionTypeRight(i,v){return this.modifiers.push(new Nt(i,this.x,v)),this}setVoltaType(i,v,C){return this.modifiers.push(new Ht(i,v,this.x,C)),this}setSection(i,v,C=0,D=12){const j=new qt(i,this.x+C,v);return j.font.size=D,this.modifiers.push(j),this}setTempo(i,v){return this.modifiers.push(new li(i,this.x,v)),this}setText(i,v,C){return this.modifiers.push(new hr(i,v,C)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new E(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const i=this.options,v=i.spacing_between_lines_px;return this.getYForLine(i.num_lines)+i.space_below_staff_ln*v}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(i){const v=this.options,C=v.spacing_between_lines_px,D=v.space_above_staff_ln;return this.y+i*C+D*C}getLineForY(i){const v=this.options,C=v.spacing_between_lines_px,D=v.space_above_staff_ln;return(i-this.y)/C-D}getYForTopText(i){const v=i||0;return this.getYForLine(-v-this.options.top_text_position)}getYForBottomText(i){const v=i||0;return this.getYForLine(this.options.bottom_text_position+v)}getYForNote(i){const v=this.options,C=v.spacing_between_lines_px,D=v.space_above_staff_ln;return this.y+D*C+5*C-i*C}getYForGlyphs(){return this.getYForLine(3)}addModifier(i,v){return v!==void 0&&i.setPosition(v),i.setStave(this),this.formatted=!1,this.modifiers.push(i),this}addEndModifier(i){return this.addModifier(i,ct.Position.END),this}setBegBarType(i){const{SINGLE:v,REPEAT_BEGIN:C,NONE:D}=_t.type;return i!==v&&i!==C&&i!==D||(this.modifiers[0].setType(i),this.formatted=!1),this}setEndBarType(i){return i!==_t.type.REPEAT_BEGIN&&(this.modifiers[1].setType(i),this.formatted=!1),this}setClef(i,v,C,D){D===void 0&&(D=ct.Position.BEGIN),D===ct.Position.END?this.endClef=i:this.clef=i;const j=this.getModifiers(D,At.CATEGORY);return j.length===0?this.addClef(i,v,C,D):j[0].setType(i,v,C),this}setEndClef(i,v,C){return this.setClef(i,v,C,ct.Position.END),this}setKeySignature(i,v,C){C===void 0&&(C=ct.Position.BEGIN);const D=this.getModifiers(C,On.CATEGORY);return D.length===0?this.addKeySignature(i,v,C):D[0].setKeySig(i,v),this}setEndKeySignature(i,v){return this.setKeySignature(i,v,ct.Position.END),this}setTimeSignature(i,v,C){C===void 0&&(C=ct.Position.BEGIN);const D=this.getModifiers(C,tn.CATEGORY);return D.length===0?this.addTimeSignature(i,v,C):D[0].setTimeSig(i),this}setEndTimeSignature(i,v){return this.setTimeSignature(i,v,ct.Position.END),this}addKeySignature(i,v,C){return C===void 0&&(C=ct.Position.BEGIN),this.addModifier(new On(i,v).setPosition(C),C),this}addClef(i,v,C,D){return D===void 0||D===ct.Position.BEGIN?this.clef=i:D===ct.Position.END&&(this.endClef=i),this.addModifier(new At(i,v,C),D),this}addEndClef(i,v,C){return this.addClef(i,v,C,ct.Position.END),this}addTimeSignature(i,v,C){return this.addModifier(new tn(i,v),C),this}addEndTimeSignature(i,v){return this.addTimeSignature(i,v,ct.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(i,v){return i===void 0&&v===void 0?this.modifiers:this.modifiers.filter(C=>!(i!==void 0&&i!==C.getPosition()||v!==void 0&&v!==C.getCategory()))}sortByCategory(i,v){for(let C=i.length-1;C>=0;C--)for(let D=0;Dv[i[D+1].getCategory()]){const j=i[D];i[D]=i[D+1],i[D+1]=j}}format(){const i=this.modifiers[0],v=this.modifiers[1],C=this.getModifiers(ct.Position.BEGIN),D=this.getModifiers(ct.Position.END);let j,J,se;this.sortByCategory(C,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(D,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),C.length>1&&i.getType()===_t.type.REPEAT_BEGIN&&(C.push(C.splice(0,1)[0]),C.splice(0,0,new _t(_t.type.SINGLE))),D.indexOf(v)>0&&D.splice(0,0,new _t(_t.type.NONE));let he=0,ve=this.x;for(let Ne=0;Neve?ve=Ae:se.setX(ve),ve+=j,J+j===0&&he--}ve>this.start_x&&this.setStartX(ve),ve=this.x+this.width;const _e={left:0,right:0,paddingRight:0,paddingLeft:0};let Ce=0;for(let Ne=0;Ne0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const j=this.context.measureText(""+this.measure).width;D=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-j/2,D),this.context.restore()}return this}drawVertical(i,v){this.drawVerticalFixed(this.x+i,v)}drawVerticalFixed(i,v){this.checkContext();const C=this.getYForLine(0),D=this.getYForLine(this.options.num_lines-1);v&&this.context.fillRect(i-3,C,1,D-C+1),this.context.fillRect(i,C,1,D-C+1)}drawVerticalBar(i){this.drawVerticalBarFixed(this.x+i,!1)}drawVerticalBarFixed(i){this.checkContext();const v=this.getYForLine(0),C=this.getYForLine(this.options.num_lines-1);this.context.fillRect(i,v,1,C-v+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(i,v){if(i>=this.options.num_lines||i<0)throw new u.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(v.visible===void 0)throw new u.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if(typeof v.visible!="boolean")throw new u.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[i]=v,this}setConfigForLines(i){if(i.length!==this.options.num_lines)throw new u.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const v in i)i[v]||(i[v]=this.options.line_config[v]),u.Merge(this.options.line_config[v],i[v]);return this.options.line_config=i,this}}class An extends Vn{constructor(i,v,C,D){const j={spacing_between_lines_px:13,num_lines:6,top_text_position:1};u.Merge(j,D),super(i,v,C,j),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class jn extends be{static get CATEGORY(){return"tabnotes"}constructor(i,v){if(super(i),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=i.positions,u.Merge(this.render_options,{glyph_font_scale:_.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:v,draw_dots:v,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=_.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new u.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(i)}`);this.buildStem(),i.stem_direction?this.setStemDirection(i.stem_direction):this.setStemDirection(A.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return jn.CATEGORY}setGhost(i){return this.ghost=i,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const i=this.getGlyph();return this.stem_extension_override!=null?this.stem_extension_override:i?this.getStemDirection()===1?i.tabnote_stem_up_extension:i.tabnote_stem_down_extension:0}addDot(){const i=new ge;return this.dots+=1,this.addModifier(i,0)}updateWidth(){this.glyphs=[],this.width=0;for(let i=0;ithis.width}setStave(i){let v;if(super.setStave(i),this.context=i.context,this.context){const D=this.context;for(this.width=0,v=0;vj.width),this.width=Math.max(j.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const C=this.positions.map(({str:D})=>i.getYForLine(D-1));return this.setYs(C),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(i){this.setModifierContext(i);for(let v=0;v{(i.getCategory()!=="dots"||this.render_options.draw_dots)&&(i.setContext(this.context),i.drawWithStyle())})}drawStemThrough(){const i=this.getStemX(),v=this.getStemY(),C=this.context,D=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&D){const j=function(se,he){const ve=[];let _e=[];for(let Ce=1;Ce<=se;Ce++)he.indexOf(Ce)>-1?(ve.push(_e),_e=[]):_e.push(Ce);return _e.length>0&&ve.push(_e),ve}(this.stave.getNumLines(),this.positions.map(se=>se.str)),J=function(se,he,ve,_e){const Ce=_e!==1,Ne=_e!==-1,Ae=ve.getSpacingBetweenLines(),Ge=ve.getNumLines(),He=[];return he.forEach($e=>{const Ze=$e.indexOf(Ge)>-1,pt=$e.indexOf(1)>-1;if(Ce&&pt||Ne&&Ze)return;$e.length===1&&$e.push($e[0]);const ft=[];$e.forEach((bt,Ot,jt)=>{const ln=bt===1,Rn=bt===Ge;let xn=ve.getYForLine(bt-1);Ot!==0||ln?Ot!==jt.length-1||Rn||(xn+=Ae/2-1):xn-=Ae/2-1,ft.push(xn),_e===1&&ln?ft.push(se-2):_e===-1&&Rn&&ft.push(se+2)}),He.push(ft.sort((bt,Ot)=>bt-Ot))}),He}(v,j,this.getStave(),this.getStemDirection());C.save(),C.setLineWidth(A.WIDTH),J.forEach(se=>{se.length!==0&&(C.beginPath(),C.moveTo(i,se[0]),C.lineTo(i,se[se.length-1]),C.stroke(),C.closePath())}),C.restore()}}drawPositions(){const i=this.context,v=this.getAbsoluteX(),C=this.ys;for(let D=0;DparseInt(D,10)?Si.SLIDE_DOWN:Si.SLIDE_UP}this.slide_direction=v,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(i)}renderTie(i){if(i.first_ys.length===0||i.last_ys.length===0)throw new u.RERR("BadArguments","No Y-values to render");const v=this.context,C=i.first_x_px,D=i.first_ys,j=i.last_x_px,J=this.slide_direction;if(J!==Si.SLIDE_UP&&J!==Si.SLIDE_DOWN)throw new u.RERR("BadSlide","Invalid slide direction");for(let se=0;sethis.numStrings)throw new u.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${i}`);return this.tuningValues[v-1]}getValueForFret(i,v){const C=this.getValueForString(v),D=parseInt(i,10);if(D<0)throw new u.RERR("BadArguments","Fret number must be 0 or higher: "+i);return C+D}getNoteForFret(i,v){const C=this.getValueForFret(i,v),D=Math.floor(C/12),j=C%12;return _.integerToNote(j)+"/"+D}}class fr extends h{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(i,v,C,D,j,J){const se=v.pixelsPerTick;if(se==null)throw new u.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const he=se*J.left_shift_ticks,ve=se*J.right_shift_ticks,_e={height:J.height,y_shift:J.y_shift,left_shift_px:he,right_shift_px:ve};new fr({first_note:C.first_note,last_note:C.last_note},D).setContext(i).setRenderOptions(_e).setPosition(j).draw()}constructor(i,v){super(),this.setAttribute("type","StaveHairpin"),this.notes=i,this.hairpin=v,this.position=ae.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(i)}setPosition(i){return i!==ae.Position.ABOVE&&i!==ae.Position.BELOW||(this.position=i),this}setRenderOptions(i){return i.height!=null&&i.y_shift!=null&&i.left_shift_px!=null&&i.right_shift_px!=null&&(this.render_options=i),this}setNotes(i){if(!i.first_note&&!i.last_note)throw new u.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=i.first_note,this.last_note=i.last_note,this}renderHairpin(i){const v=this.checkContext();let C=this.render_options.y_shift+20,D=i.first_y;this.position===ae.Position.ABOVE&&(C=30-C,D=i.first_y-i.staff_height);const j=this.render_options.left_shift_px,J=this.render_options.right_shift_px;switch(v.beginPath(),this.hairpin){case fr.type.CRESC:v.moveTo(i.last_x+J,D+C),v.lineTo(i.first_x+j,D+this.render_options.height/2+C),v.lineTo(i.last_x+J,D+this.render_options.height+C);break;case fr.type.DECRESC:v.moveTo(i.first_x+j,D+C),v.lineTo(i.last_x+J,D+this.render_options.height/2+C),v.lineTo(i.first_x+j,D+this.render_options.height+C)}v.stroke(),v.closePath()}draw(){this.checkContext(),this.setRendered();const i=this.first_note,v=this.last_note,C=i.getModifierStartXY(this.position,0),D=v.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:C.x,last_x:D.x,first_y:i.getStave().y+i.getStave().height,last_y:v.getStave().y+v.getStave().height,staff_height:i.getStave().height}),!0}}class Ri extends h{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:Ri.Position.NEAR_HEAD,nearTop:Ri.Position.NEAR_TOP}}constructor(i,v,C){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:Ri.Position.NEAR_HEAD,position_end:Ri.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},u.Merge(this.render_options,C),this.setNotes(i,v)}setNotes(i,v){if(!i&&!v)throw new u.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=i,this.to=v,this}isPartial(){return!this.from||!this.to}renderCurve(i){const v=this.context,C=this.render_options.cps,D=this.render_options.x_shift,j=this.render_options.y_shift*i.direction,J=i.first_x+D,se=i.first_y+j,he=i.last_x-D,ve=i.last_y+j,_e=this.render_options.thickness,Ce=(he-J)/(C.length+2);v.beginPath(),v.moveTo(J,se),v.bezierCurveTo(J+Ce+C[0].x,se+C[0].y*i.direction,he-Ce+C[1].x,ve+C[1].y*i.direction,he,ve),v.bezierCurveTo(he-Ce+C[1].x,ve+(C[1].y+_e)*i.direction,J+Ce+C[0].x,se+(C[0].y+_e)*i.direction,J,se),v.stroke(),v.closePath(),v.fill()}draw(){this.checkContext(),this.setRendered();const i=this.from,v=this.to;let C,D,j,J,se,he="baseY",ve="baseY";function _e(Ae){return typeof Ae=="string"?Ri.PositionString[Ae]:Ae}const Ce=_e(this.render_options.position),Ne=_e(this.render_options.position_end);return Ce===Ri.Position.NEAR_TOP&&(he="topY",ve="topY"),Ne===Ri.Position.NEAR_HEAD?ve="baseY":Ne===Ri.Position.NEAR_TOP&&(ve="topY"),i?(C=i.getTieRightX(),se=i.getStemDirection(),j=i.getStemExtents()[he]):(C=v.getStave().getTieStartX(),j=v.getStemExtents()[he]),v?(D=v.getTieLeftX(),se=v.getStemDirection(),J=v.getStemExtents()[ve]):(D=i.getStave().getTieEndX(),J=i.getStemExtents()[ve]),this.renderCurve({first_x:C,last_x:D,first_y:j,last_y:J,direction:se*(this.render_options.invert===!0?-1:1)}),!0}}function As(...Oe){Vr.DEBUG&&u.L("Vex.Flow.TextDynamics",Oe)}class Vr extends ie{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(i){super(i),this.setAttribute("type","TextDynamics"),this.sequence=i.text.toLowerCase(),this.line=i.line||0,this.glyphs=[],u.Merge(this.render_options,{glyph_font_size:40}),As("New Dynamics Text: ",this.sequence)}setLine(i){return this.line=i,this}preFormat(){let i=0;return this.sequence.split("").forEach(v=>{const C=Vr.GLYPHS[v];if(!C)throw new u.RERR("Invalid dynamics character: "+v);const D=this.render_options.glyph_font_size,j=new S(C.code,D);this.glyphs.push(j),i+=C.width}),this.setWidth(i),this.preFormatted=!0,this}draw(){this.setRendered();const i=this.getAbsoluteX(),v=this.stave.getYForLine(this.line+-3);As("Rendering Dynamics: ",this.sequence);let C=i;this.glyphs.forEach((D,j)=>{const J=this.sequence[j];D.render(this.context,C,v),C+=Vr.GLYPHS[J].width})}}function ra(Oe,i,v,C,D,j,J){Oe.beginPath(),Oe.moveTo(i,v),Oe.lineTo(C,D),Oe.lineTo(j,J),Oe.lineTo(i,v),Oe.closePath(),Oe.fill()}class fe extends h{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(i){super(),this.setAttribute("type","StaveLine"),this.notes=i,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:fe.TextVerticalPosition.TOP,text_justification:fe.TextJustification.CENTER},this.setNotes(i)}setFont(i){return this.font=i,this}setText(i){return this.text=i,this}setNotes(i){if(!i.first_note&&!i.last_note)throw new u.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(i.first_indices||(i.first_indices=[0]),i.last_indices||(i.last_indices=[0]),i.first_indices.length!==i.last_indices.length)throw new u.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=i.first_note,this.first_indices=i.first_indices,this.last_note=i.last_note,this.last_indices=i.last_indices,this}applyLineStyle(){const i=this.checkContext(),v=this.render_options;v.line_dash&&i.setLineDash(v.line_dash),v.line_width&&i.setLineWidth(v.line_width),v.rounded_end?i.setLineCap("round"):i.setLineCap("square")}applyFontStyle(){const i=this.checkContext();this.font&&i.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color))}draw(){const i=this.checkContext();this.setRendered();const v=this.first_note,C=this.last_note,D=this.render_options;let j,J;i.save(),this.applyLineStyle(),this.first_indices.forEach((Ne,Ae)=>{const Ge=this.last_indices[Ae];j=v.getModifierStartXY(2,Ne),J=C.getModifierStartXY(1,Ge);const He=j.y>J.y;j.x+=v.getMetrics().modRightPx+D.padding_left,J.x-=C.getMetrics().modLeftPx+D.padding_right;const $e=v.getGlyph().getWidth();v.getKeyProps()[Ne].displaced&&v.getStemDirection()===1&&(j.x+=$e+D.padding_left),C.getKeyProps()[Ge].displaced&&C.getStemDirection()===-1&&(J.x-=$e+D.padding_right),j.y+=He?-3:1,J.y+=He?2:0,function(Ze,pt,ft,bt){const Ot=bt.draw_start_arrow&&bt.draw_end_arrow,jt=pt.x,ln=pt.y,Rn=ft.x,xn=ft.y,Vi=Math.sqrt((Rn-jt)*(Rn-jt)+(xn-ln)*(xn-ln)),ui=(Vi-bt.arrowhead_length/3)/Vi;let ci,Zi,br,bn;bt.draw_end_arrow||Ot?(ci=Math.round(jt+(Rn-jt)*ui),Zi=Math.round(ln+(xn-ln)*ui)):(ci=Rn,Zi=xn),bt.draw_start_arrow||Ot?(br=jt+(Rn-jt)*(1-ui),bn=ln+(xn-ln)*(1-ui)):(br=jt,bn=ln),bt.color&&(Ze.setStrokeStyle(bt.color),Ze.setFillStyle(bt.color)),Ze.beginPath(),Ze.moveTo(br,bn),Ze.lineTo(ci,Zi),Ze.stroke(),Ze.closePath();const pn=Math.atan2(xn-ln,Rn-jt),er=Math.abs(bt.arrowhead_length/Math.cos(bt.arrowhead_angle));let Ns,eo,ks,Os,to,Lo;(bt.draw_end_arrow||Ot)&&(Ns=pn+Math.PI+bt.arrowhead_angle,ks=Rn+Math.cos(Ns)*er,Os=xn+Math.sin(Ns)*er,eo=pn+Math.PI-bt.arrowhead_angle,to=Rn+Math.cos(eo)*er,Lo=xn+Math.sin(eo)*er,ra(Ze,ks,Os,Rn,xn,to,Lo)),(bt.draw_start_arrow||Ot)&&(Ns=pn+bt.arrowhead_angle,ks=jt+Math.cos(Ns)*er,Os=ln+Math.sin(Ns)*er,eo=pn-bt.arrowhead_angle,to=jt+Math.cos(eo)*er,Lo=ln+Math.sin(eo)*er,ra(Ze,ks,Os,jt,ln,to,Lo))}(i,j,J,this.render_options)}),i.restore();const se=i.measureText(this.text).width,he=D.text_justification;let ve,_e=0;he===fe.TextJustification.LEFT?_e=j.x:he===fe.TextJustification.CENTER?_e=(J.x-j.x)/2+j.x-se/2:he===fe.TextJustification.RIGHT&&(_e=J.x-se);const Ce=D.text_position_vertical;return Ce===fe.TextVerticalPosition.TOP?ve=v.getStave().getYForTopText():Ce===fe.TextVerticalPosition.BOTTOM&&(ve=v.getStave().getYForBottomText(_.TEXT_HEIGHT_OFFSET_HACK)),i.save(),this.applyFontStyle(),i.fillText(this.text,_e,ve),i.restore(),this}}function vn(Oe,i,v,C,D){const j=Qt.GLYPHS[Oe];new S(j.code,D).render(i,v+j.x_shift,C+j.y_shift)}class Qt extends h{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:Qt.Styles.TEXT,bracket:Qt.Styles.BRACKET,mixed:Qt.Styles.MIXED,mixed_open_end:Qt.Styles.MIXED_OPEN_END,bracket_open_begin:Qt.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:Qt.Styles.BRACKET_OPEN_END,bracket_open_both:Qt.Styles.BRACKET_OPEN_BOTH}}static createSustain(i){return new Qt(i)}static createSostenuto(i){const v=new Qt(i);return v.setStyle(Qt.Styles.MIXED),v.setCustomText("Sost. Ped."),v}static createUnaCorda(i){const v=new Qt(i);return v.setStyle(Qt.Styles.TEXT),v.setCustomText("una corda","tre corda"),v}constructor(i){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=i,this.style=Qt.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(i){if(this.endStave=i,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let v=0;v3)throw new u.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=i,this}setLine(i){return this.line=i,this}drawBracketed(){const i=this.context;let v,C,D=!1;const j=this;this.notes.forEach((J,se,he)=>{D=!D;let ve=0;if(J?(ve=J.getNoteHeadBeginX(),this.BeginsStave&&(ve=J.getStave().getNoteStartX())):ve=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)D?this.ChangeBegin&&(ve=J.getAbsoluteX()):(ve=J?this.ChangeEnd?J.getAbsoluteX():J.getStave().end_x+this.endStaveAddedWidth-j.render_options.text_margin_right:this.endStave.end_x+this.endStaveAddedWidth-j.render_options.text_margin_right,this.endMargin=-j.render_options.text_margin_right);else if(J)if(D)this.ChangeBegin&&(ve=J.getAbsoluteX());else switch(j.style){case Qt.Styles.BRACKET_OPEN_END:case Qt.Styles.BRACKET_OPEN_BOTH:case Qt.Styles.MIXED_OPEN_END:ve=J.getNoteHeadEndX();break;default:this.ChangeEnd?ve=J.getAbsoluteX():(ve=J.getNoteHeadBeginX()-j.render_options.text_margin_right,this.startMargin=-j.render_options.text_margin_right)}let _e=this.endStave;J&&(_e=J.getStave());let Ce=_e.getYForBottomText(j.line+3);C&&C>Ce&&(Ce=C);const Ne=he[se+1]===J,Ae=he[se-1]===J;let Ge=0;if(D)if(Ge=Ae?5:0,j.style!==Qt.Styles.MIXED&&j.style!==Qt.Styles.MIXED_OPEN_END||Ae)i.beginPath(),j.style===Qt.Styles.BRACKET_OPEN_BEGIN||j.style===Qt.Styles.BRACKET_OPEN_BOTH?i.moveTo(ve+Ge,Ce):(this.ChangeBegin&&(ve+=5),i.moveTo(ve,Ce-j.render_options.bracket_height),this.ChangeBegin&&(ve+=5),i.lineTo(ve+Ge,Ce)),i.stroke(),i.closePath();else if(j.custom_depress_text){const He=i.measureText(j.custom_depress_text).width;i.fillText(j.custom_depress_text,ve-He/2,Ce),Ge=He/2+j.render_options.text_margin_right}else vn("pedal_depress",i,ve,Ce,j.render_options.glyph_point_size),Ge=20+j.render_options.text_margin_right;else Ge=Ne&&!this.EndsStave?-5:0,i.beginPath(),i.moveTo(v,C),i.lineTo(ve+Ge,Ce),j.style!==Qt.Styles.BRACKET_OPEN_END&&j.style!==Qt.Styles.MIXED_OPEN_END&&j.style!==Qt.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(ve+=5),i.lineTo(ve,Ce-j.render_options.bracket_height)),i.stroke(),i.closePath();v=ve+Ge,C=Ce})}drawText(){const i=this.context;let v=!1;const C=this,D=C.render_options.glyph_point_size;this.notes.forEach(j=>{if(!j)return;v=!v;const J=j.getStave(),se=j.getAbsoluteX(),he=J.getYForBottomText(C.line+3);let ve=0;v?C.custom_depress_text?(ve=i.measureText(C.custom_depress_text).width,i.fillText(C.custom_depress_text,se-ve/2,he)):vn("pedal_depress",i,se,he,D):C.custom_release_text?(ve=i.measureText(C.custom_release_text).width,i.fillText(C.custom_release_text,se-ve/2,he)):vn("pedal_release",i,se,he,D)})}draw(){const i=this.checkContext();this.setRendered(),i.save(),i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color),i.setFont(this.font.family,this.font.size,this.font.weight),Qt.DEBUG&&u.L("Vex.Flow.PedalMarking",["Rendering Pedal Marking"]),this.style===Qt.Styles.BRACKET||this.style===Qt.Styles.MIXED||this.style===Qt.Styles.MIXED_OPEN_END||this.style===Qt.Styles.BRACKET_OPEN_BEGIN||this.style===Qt.Styles.BRACKET_OPEN_END||this.style===Qt.Styles.BRACKET_OPEN_BOTH?(i.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===Qt.Styles.TEXT&&this.drawText(),i.restore()}}class Gt extends h{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:Gt.Positions.TOP,bottom:Gt.Positions.BOTTOM}}constructor({start:i,stop:v,text:C="",superscript:D="",position:j=Gt.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=i,this.stop=v,this.text=C,this.superscript=D,this.position=typeof j=="string"?Gt.PositionString[j]:j,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(i){return i.setFont(this.font.family,this.font.size,this.font.weight),i.setStrokeStyle(this.render_options.color),i.setFillStyle(this.render_options.color),i.setLineWidth(this.render_options.line_width),this}setDashed(i,v){return this.render_options.dashed=i,v&&(this.render_options.dash=v),this}setFont(i){return this.font={...this.font,...i},this}setLine(i){return this.line=i,this}draw(){const i=this.context;this.setRendered();let v=0;switch(this.position){case Gt.Positions.TOP:v=this.start.getStave().getYForTopText(this.line);break;case Gt.Positions.BOTTOM:v=this.start.getStave().getYForBottomText(this.line+_.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new u.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const C={x:this.start.getAbsoluteX(),y:v},D={x:this.stop.getAbsoluteX(),y:v};(function(...Ge){Gt.DEBUG&&u.L("Vex.Flow.TextBracket",Ge)})("Rendering TextBracket: start:",C,"stop:",D,"y:",v);const j=this.render_options.bracket_height*this.position;i.save(),this.applyStyle(i),i.fillText(this.text,C.x,C.y);let J=i.measureText(this.text).width;J>0||(J=10*this.text.length);let se=i.measureText("M").width;se>0||(se=20);const he=C.y-se/2.5;i.setFont(this.font.family,this.font.size/1.4,this.font.weight),i.fillText(this.superscript,C.x+J+1,he);let ve=i.measureText(this.superscript).width;ve>0||(ve=12,this.superscript.includes("m")&&(ve+=5));let _e=i.measureText("M").width;_e>0||(_e=10);let Ce=C.x,Ne=he,Ae=D.x+this.stop.getGlyph().getWidth();this.position===Gt.Positions.TOP?(Ce+=J+ve+5,Ne-=_e/2.7):this.position===Gt.Positions.BOTTOM&&(Ne+=_e/2.7,Ce+=J+2,this.render_options.underline_superscript||(Ce+=ve)),this.render_options.dashed?(Ae0||v===!0;return!v||j>0||(this.pos=D),se?this.matchSuccess():this.matchFail(D),{success:se,results:C,numMatches:j}}expectZeroOrMore(i){return this.expectOneOrMore(i,!0)}expect(i){let v;if(function(...D){mr.DEBUG&&u.L("Vex.Flow.Parser",D)}("Evaluating rules:",i),!i)throw new Di("Invalid Rule: "+i,i);const C=i.bind(this.grammar)();if(C.token)v=this.matchToken(C.token,C.noSpace===!0),v.success&&(this.pos+=v.incrementPos);else{if(!C.expect)throw new Di("Bad grammar! No `token` or `expect` property",C);v=C.oneOrMore?this.expectOneOrMore(C):C.zeroOrMore?this.expectZeroOrMore(C):this.expectOne(C)}return v.matches=[],v.results&&v.results.forEach(D=>v.matches.push(Gr(D))),C.run&&v.success&&C.run(v),v}}function Ii(...Oe){aa.DEBUG&&u.L("Vex.Flow.EasyScore",Oe)}const Rs=u.MakeException("EasyScoreError");class fn{constructor(i){this.builder=i}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:i=>this.builder.addChord(i.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:i=>this.builder.addSingleNote(i.matches[0],i.matches[1],i.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:i=>this.builder.setNoteDots(i.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:i=>this.builder.setNoteType(i.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:i=>this.builder.setNoteDuration(i.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:i=>this.builder.addNoteOption(i.matches[0],i.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class jl{constructor(i){this.factory=i,this.commitHooks=[],this.reset()}reset(i={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,i)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(i){this.commitHooks.push(i)}resetPiece(){Ii("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(i){Ii("setNoteDots:",i),i&&(this.piece.dots=i.length)}setNoteDuration(i){Ii("setNoteDuration:",i),this.rollingDuration=this.piece.duration=i||this.rollingDuration}setNoteType(i){Ii("setNoteType:",i),i&&(this.piece.type=i)}addNoteOption(i,v){Ii("addNoteOption: key:",i,"value:",v),this.piece.options[i]=v}addNote(i,v,C){Ii("addNote:",i,v,C),this.piece.chord.push({key:i,accid:v,octave:C})}addSingleNote(i,v,C){Ii("addSingleNote:",i,v,C),this.addNote(i,v,C)}addChord(i){Ii("startChord"),typeof i[0]!="object"?this.addSingleNote(i[0]):i.forEach(v=>{v&&this.addNote(...v)}),Ii("endChord")}commitPiece(){Ii("commitPiece");const{factory:i}=this;if(!i)return;const v={...this.options,...this.piece.options},{stem:C,clef:D}=v,j=C.toLowerCase()==="auto",J=j||C.toLowerCase()!=="up"?Z.STEM_DOWN:Z.STEM_UP,{chord:se,duration:he,dots:ve,type:_e}=this.piece,Ce=se.map(Ge=>Ge.key+"/"+Ge.octave),Ne=i.StaveNote({keys:Ce,duration:he,dots:ve,type:_e,clef:D,auto_stem:j});j||Ne.setStemDirection(J);const Ae=se.map(Ge=>Ge.accid||null);Ae.forEach((Ge,He)=>{Ge&&Ne.addAccidental(He,i.Accidental({type:Ge}))});for(let Ge=0;GeGe(v,Ne,this)),this.elements.notes.push(Ne),this.elements.accidentals.concat(Ae),this.resetPiece()}}function oa({id:Oe},i){Oe!==void 0&&i.setAttribute("id",Oe)}function Js(Oe,i){Oe.class&&Oe.class.split(/\s*,\s*/).forEach(v=>i.addClass(v))}class aa{constructor(i={}){this.setOptions(i),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(i){return Object.assign(this.defaults,i),this}setOptions(i){return this.options={factory:null,builder:null,commitHooks:[oa,Js,ke.easyScoreHook],throwOnError:!1,...i},this.factory=this.options.factory,this.builder=this.options.builder||new jl(this.factory),this.grammar=new fn(this.builder),this.parser=new mr(this.grammar),this.options.commitHooks.forEach(v=>this.addCommitHook(v)),this}setContext(i){return this.factory&&this.factory.setContext(i),this}parse(i,v={}){this.builder.reset(v);const C=this.parser.parse(i);if(!C.success&&this.options.throwOnError)throw new Rs("Error parsing line: "+i,C);return C}beam(i,v={}){return this.factory.Beam({notes:i,options:v}),i}tuplet(i,v={}){return this.factory.Tuplet({notes:i,options:v}),i}notes(i,v={}){return v={clef:this.defaults.clef,stem:this.defaults.stem,...v},this.parse(i,v),this.builder.getElements().notes}voice(i,v){return v={time:this.defaults.time,...v},this.factory.Voice(v).addTickables(i)}addCommitHook(i){return this.builder.addCommitHook(i)}}const gr=u.MakeException("FactoryError");function gn(Oe={},i){const v=i.options;return(Oe=Object.assign(i,Oe)).options=Object.assign(v,Oe.options),Oe}class Is{constructor(i){(function(...C){Is.DEBUG&&u.L("Vex.Flow.Factory",C)})("New factory: ",i);const v={stave:{space:10},renderer:{context:null,elementId:"",backend:R.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=v,this.setOptions(i)}static newFromElementId(i,v=500,C=200){return new Is({renderer:{elementId:i,width:v,height:C}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(i){for(const v of["stave","renderer","font"])Object.assign(this.options[v],i[v]);(this.options.renderer.elementId!==null||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:i,backend:v,width:C,height:D,background:j}=this.options.renderer;if(i==="")throw new gr("HTML DOM element not set in Factory");this.context=R.buildContext(i,v,C,D,j)}getContext(){return this.context}setContext(i){return this.context=i,this}getStave(){return this.stave}getVoices(){return this.voices}space(i){return this.options.stave.space*i}Stave(i){i=gn(i,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const v=new Vn(i.x,i.y,i.width,i.options);return this.staves.push(v),v.setContext(this.context),this.stave=v,v}TabStave(i){i=gn(i,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const v=new An(i.x,i.y,i.width,i.options);return this.staves.push(v),v.setContext(this.context),this.stave=v,v}StaveNote(i){const v=new Z(i);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}GhostNote(i){const v=new $l(i);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}TextNote(i){const v=new $n(i);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}BarNote(i){i=gn(i,{type:"single",options:{}});const v=new Xn(i.type);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}ClefNote(i){i=gn(i,{type:"treble",options:{size:"default"}});const v=new Dt(i.type,i.options.size,i.options.annotation);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}TimeSigNote(i){i=gn(i,{time:"4/4",options:{}});const v=new Ai(i.time);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}KeySigNote(i){const v=new Qs(i.key,i.cancelKey,i.alterKey);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}TabNote(i){const v=new jn(i);return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}GraceNote(i){const v=new Br(i);return this.stave&&v.setStave(this.stave),v.setContext(this.context),v}GraceNoteGroup(i){const v=new q(i.notes,i.slur);return v.setContext(this.context),v}Accidental(i){i=gn(i,{type:null,options:{}});const v=new ne(i.type);return v.setContext(this.context),v}Annotation(i){i=gn(i,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const v=new qe(i.text);return v.setJustification(i.hJustify),v.setVerticalJustification(i.vJustify),v.setFont(i.fontFamily,i.fontSize,i.fontWeight),v.setContext(this.context),v}Articulation(i){i=gn(i,{type:"a.",position:"above",options:{}});const v=new ke(i.type);return v.setPosition(i.position),v.setContext(this.context),v}TextDynamics(i){i=gn(i,{text:"p",duration:"q",dots:0,line:0,options:{}});const v=new Vr({text:i.text,line:i.line,duration:i.duration,dots:i.dots});return this.stave&&v.setStave(this.stave),v.setContext(this.context),this.renderQ.push(v),v}Fingering(i){i=gn(i,{number:"0",position:"left",options:{}});const v=new ye(i.number);return v.setPosition(i.position),v.setContext(this.context),v}StringNumber(i){i=gn(i,{number:"0",position:"left",options:{}});const v=new ue(i.number);return v.setPosition(i.position),v.setContext(this.context),v}TickContext(){return new ce().setContext(this.context)}ModifierContext(){return new ht}MultiMeasureRest(i){const v=new is(i.number_of_measures,i);return v.setContext(this.context),this.renderQ.push(v),v}Voice(i){i=gn(i,{time:"4/4",options:{}});const v=new G(i.time);return this.voices.push(v),v}StaveConnector(i){i=gn(i,{top_stave:null,bottom_stave:null,type:"double",options:{}});const v=new L(i.top_stave,i.bottom_stave);return v.setType(i.type).setContext(this.context),this.renderQ.push(v),v}Formatter(){return new Et}Tuplet(i){i=gn(i,{notes:[],options:{}});const v=new F(i.notes,i.options).setContext(this.context);return this.renderQ.push(v),v}Beam(i){i=gn(i,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const v=new W(i.notes,i.options.autoStem).setContext(this.context);return v.breakSecondaryAt(i.options.secondaryBeamBreaks),this.renderQ.push(v),v}Curve(i){i=gn(i,{from:null,to:null,options:{}});const v=new Ri(i.from,i.to,i.options).setContext(this.context);return this.renderQ.push(v),v}StaveTie(i){i=gn(i,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const v=new z({first_note:i.from,last_note:i.to,first_indices:i.first_indices,last_indices:i.last_indices},i.text);return i.options.direction&&v.setDirection(i.options.direction),v.setContext(this.context),this.renderQ.push(v),v}StaveLine(i){i=gn(i,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const v=new fe({first_note:i.from,last_note:i.to,first_indices:i.first_indices,last_indices:i.last_indices});return i.options.text&&v.setText(i.options.text),i.options.font&&v.setFont(i.options.font),v.setContext(this.context),this.renderQ.push(v),v}VibratoBracket(i){i=gn(i,{from:null,to:null,options:{harsh:!1}});const v=new Li({start:i.from,stop:i.to});return i.options.line&&v.setLine(i.options.line),i.options.harsh&&v.setHarsh(i.options.harsh),v.setContext(this.context),this.renderQ.push(v),v}TextBracket(i){i=gn(i,{from:null,to:null,text:"",options:{superscript:"",position:1}});const v=new Gt({start:i.from,stop:i.to,text:i.text,superscript:i.options.superscript,position:i.options.position});return i.options.line&&v.setLine(i.options.line),i.options.font&&v.setFont(i.options.font),v.setContext(this.context),this.renderQ.push(v),v}System(i={}){i.factory=this;const v=new Co(i).setContext(this.context);return this.systems.push(v),v}EasyScore(i={}){return i.factory=this,new aa(i)}PedalMarking(i={}){i=gn(i,{notes:[],options:{style:"mixed"}});const v=new Qt(i.notes);return v.setStyle(Qt.StylesString[i.options.style]),v.setContext(this.context),this.renderQ.push(v),v}NoteSubGroup(i={}){i=gn(i,{notes:[],options:{}});const v=new O(i.notes);return v.setContext(this.context),v}draw(){this.systems.forEach(i=>i.setContext(this.context).format()),this.staves.forEach(i=>i.setContext(this.context).draw()),this.voices.forEach(i=>i.setContext(this.context).draw()),this.renderQ.forEach(i=>{i.isRendered()||i.setContext(this.context).draw()}),this.systems.forEach(i=>i.setContext(this.context).draw()),this.reset()}}function Hl(Oe,i){const v=i.options;return(Oe=Object.assign(i,Oe)).options=Object.assign(v,Oe.options),Oe}class Co extends h{constructor(i={}){super(),this.setAttribute("type","System"),this.setOptions(i),this.parts=[]}setOptions(i={}){this.options=Hl(i,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Is({renderer:{el:null}})}setContext(i){return super.setContext(i),this.factory.setContext(i),this}addConnector(i="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:i}),this.connector}addStave(i){return(i=Hl(i,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(i.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:i.options})),i.voices.forEach(v=>v.setContext(this.context).setStave(i.stave).getTickables().forEach(C=>C.setStave(i.stave))),this.parts.push(i),i.stave}format(){const i=new Et;this.formatter=i;let v=this.options.y,C=0,D=[];const j=[];this.parts.forEach(se=>{v+=se.stave.space(se.spaceAbove),se.stave.setY(v),i.joinVoices(se.voices),v+=se.stave.space(se.spaceBelow),v+=se.stave.space(this.options.spaceBetweenStaves),se.debugNoteMetrics&&(j.push({y:v,voice:se.voices[0]}),v+=15),D=D.concat(se.voices),C=Math.max(C,se.stave.getNoteStartX())}),this.parts.forEach(se=>se.stave.setNoteStartX(C));const J=this.options.width-(C-this.options.x)-ie.STAVEPADDING;i.format(D,J);for(let se=0;se{v.voice.getTickables().forEach(C=>ie.plotMetrics(i,C,v.y))})}}(u.Flow=_).Element=h,u.Flow.Fraction=a,u.Flow.Renderer=R,u.Flow.Formatter=Et,u.Flow.Music=Se,u.Flow.Glyph=S,u.Flow.Stave=Vn,u.Flow.StaveNote=Z,u.Flow.StaveModifier=ct,u.Flow.StaveTempo=li,u.Flow.Voice=G,u.Flow.Accidental=ne,u.Flow.Beam=W,u.Flow.StaveTie=z,u.Flow.TabStave=An,u.Flow.TabNote=jn,u.Flow.Bend=Ye,u.Flow.Vibrato=Je,u.Flow.VibratoBracket=Li,u.Flow.Note=ie,u.Flow.ModifierContext=ht,u.Flow.MultiMeasureRest=is,u.Flow.TickContext=ce,u.Flow.Articulation=ke,u.Flow.Annotation=qe,u.Flow.Barline=_t,u.Flow.NoteHead=re,u.Flow.StaveConnector=L,u.Flow.ClefNote=Dt,u.Flow.KeySignature=On,u.Flow.KeySigNote=Qs,u.Flow.TimeSignature=tn,u.Flow.TimeSigNote=Ai,u.Flow.Stem=A,u.Flow.TabTie=K,u.Flow.Clef=At,u.Flow.Dot=ge,u.Flow.Modifier=ae,u.Flow.TabSlide=Si,u.Flow.Tuplet=F,u.Flow.GraceNote=Br,u.Flow.GraceTabNote=Dr,u.Flow.Tuning=rs,u.Flow.KeyManager=class{constructor(Oe){this.music=new Se,this.setKey(Oe)}setKey(Oe){return this.key=Oe,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!Se.scaleTypes[this.keyParts.type])throw new u.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Se.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const Oe=Se.root_indices[this.keyParts.root];for(let i=0;i{b.exports=`precision mediump float; +uniform sampler2D u_image; +varying vec4 v_position; + +#define NUM_ROWS 5 +#define ELEMENT_HEIGHT 300 + +void main() { + const float halfPixel = 1.0 / float(ELEMENT_HEIGHT * 2); + + vec2 absolutePosition = (v_position.xy + vec2(1.0)) / vec2(2.0); + float absX = absolutePosition.x; + float absY = absolutePosition.y; + + int skyLine = 0; + for (int i = 0; i < ELEMENT_HEIGHT; ++i) { + float ratioY = float(i) / float(ELEMENT_HEIGHT); + float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS); + float x = absX; + float y = absY + relY; + + float currentAlpha = texture2D(u_image, vec2(x, y)).a; + if (currentAlpha > 0.0) { + skyLine = i; + break; + } + } + + int bottomLine = ELEMENT_HEIGHT; + for (int i = ELEMENT_HEIGHT - 1; i >= 0; --i) { + float ratioY = float(i) / float(ELEMENT_HEIGHT); + float relY = (ratioY - 0.5 + halfPixel) / float(NUM_ROWS); + float x = absX; + float y = absY + relY; + + float currentAlpha = texture2D(u_image, vec2(x, y)).a; + if (currentAlpha > 0.0) { + bottomLine = i; + break; + } + } + + int r = skyLine; + if (r > 256) { + r -= 256; + } + int g = bottomLine; + if (g > 256) { + g -= 256; + } + int b = (skyLine / 256 * 16) + (bottomLine / 256); + + gl_FragColor = vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, 1.0); +} +`},6357:b=>{b.exports=`attribute vec4 a_position; +varying vec4 v_position; + +void main() { + gl_Position = a_position; + v_position = a_position; +} +`}},s={};function m(b){var o=s[b];if(o!==void 0)return o.exports;var r=s[b]={exports:{}};return n[b].call(r.exports,r,r.exports,m),r.exports}return m.d=(b,o)=>{for(var r in o)m.o(o,r)&&!m.o(b,r)&&Object.defineProperty(b,r,{enumerable:!0,get:o[r]})},m.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),m.o=(b,o)=>Object.prototype.hasOwnProperty.call(b,o),m.r=b=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},m(3607)})())})(j6);var UG=j6.exports;class $G extends Pe.Component{constructor(n){super(n);L0(this,"osmd");L0(this,"divRef");this.state={dataReady:!1},this.osmd=void 0,this.divRef=si.createRef()}async setupOsmd(){var n,s,m;await((n=this.osmd)==null?void 0:n.load(this.props.file)),(s=this.osmd)!=null&&s.IsReadyToRender()?(m=this.osmd)==null||m.render():console.error("OSMD not ready to render")}componentDidUpdate(n){var s;this.props.drawTitle!==n.drawTitle&&this.initOsmd(),this.props.file&&((s=this.osmd)==null||s.load(this.props.file).then(()=>{var m;return(m=this.osmd)==null?void 0:m.render()}))}initOsmd(){this.divRef.current&&(this.osmd=new UG.OpenSheetMusicDisplay(this.divRef.current,{drawFromMeasureNumber:0,autoResize:this.props.autoResize!==void 0?this.props.autoResize:!0,drawTitle:this.props.drawTitle!==void 0?this.props.drawTitle:!0,drawingParameters:"compacttight"}))}componentDidMount(){var n;this.initOsmd(),this.props.file&&((n=this.osmd)==null||n.load(this.props.file).then(()=>{var s;return(s=this.osmd)==null?void 0:s.render()}))}render(){return Re.jsx("div",{ref:this.divRef})}}var jG=(()=>{var e=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(t={}){var n=t,s,m;n.ready=new Promise((I,V)=>{s=I,m=V}),["_memory","___indirect_function_table","onRuntimeInitialized"].forEach(I=>{Object.getOwnPropertyDescriptor(n.ready,I)||Object.defineProperty(n.ready,I,{get:()=>K("You are getting "+I+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>K("You are setting "+I+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}),n.expectedDataFileDownloads||(n.expectedDataFileDownloads=0),n.expectedDataFileDownloads++,function(){if(!(n.ENVIRONMENT_IS_PTHREAD||n.$ww)){var I=function(V){typeof window=="object"?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var Q="../../../public/oddvoices_wasm.data",oe="oddvoices_wasm.data";typeof n.locateFilePackage=="function"&&!n.locateFile&&(n.locateFile=n.locateFilePackage,y("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var Ee=n.locateFile?n.locateFile(oe,""):oe,Ie=V.remote_package_size;function Be(st,gt,yt,xt){var St=new XMLHttpRequest;St.open("GET",st,!0),St.responseType="arraybuffer",St.onprogress=function(Wt){var Yt=st,Sn=gt;if(Wt.total&&(Sn=Wt.total),Wt.loaded){St.addedTotal?n.dataFileDownloads[Yt].loaded=Wt.loaded:(St.addedTotal=!0,n.dataFileDownloads||(n.dataFileDownloads={}),n.dataFileDownloads[Yt]={loaded:Wt.loaded,total:Sn});var ut=0,Ct=0,Gn=0;for(var wn in n.dataFileDownloads){var _i=n.dataFileDownloads[wn];ut+=_i.total,Ct+=_i.loaded,Gn++}ut=Math.ceil(ut*n.expectedDataFileDownloads/Gn),n.setStatus&&n.setStatus(`Downloading data... (${Ct}/${ut})`)}else n.dataFileDownloads||n.setStatus&&n.setStatus("Downloading data...")},St.onerror=function(Wt){throw new Error("NetworkError for: "+st)},St.onload=function(Wt){if(St.status==200||St.status==304||St.status==206||St.status==0&&St.response){var Yt=St.response;yt(Yt)}else throw new Error(St.statusText+" : "+St.responseURL)},St.send(null)}var Ve=null,et=n.getPreloadedPackage?n.getPreloadedPackage(Ee,Ie):null;et||Be(Ee,Ie,function(st){Ve?(Ve(st),Ve=null):et=st});function rt(){function st(Wt,Yt){if(!Wt)throw Yt+new Error().stack}n.FS_createPath("/","oddvoices",!0,!0);function gt(Wt,Yt,Sn){this.start=Wt,this.end=Yt,this.audio=Sn}gt.prototype={requests:{},open:function(Wt,Yt){this.name=Yt,this.requests[Yt]=this,n.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var Wt=this.byteArray.subarray(this.start,this.end);this.finish(Wt)},finish:function(Wt){var Yt=this;n.FS_createDataFile(this.name,null,Wt,!0,!0,!0),n.removeRunDependency(`fp ${Yt.name}`),this.requests[this.name]=null}};for(var yt=V.files,xt=0;xt{var V=new XMLHttpRequest;return V.open("GET",I,!1),V.send(null),V.responseText},E=(I,V,Q)=>{var oe=new XMLHttpRequest;oe.open("GET",I,!0),oe.responseType="arraybuffer",oe.onload=()=>{if(oe.status==200||oe.status==0&&oe.response){V(oe.response);return}Q()},oe.onerror=Q,oe.send(null)}}var f=n.print||console.log.bind(console),y=n.printErr||console.error.bind(console);Object.assign(n,o),o=null,Xt(),n.arguments&&n.arguments,qe("arguments","arguments_"),n.thisProgram&&(r=n.thisProgram),qe("thisProgram","thisProgram"),n.quit&&n.quit,qe("quit","quit_"),w(typeof n.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),w(typeof n.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),w(typeof n.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),w(typeof n.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),w(typeof n.read>"u","Module.read option was removed (modify read_ in JS)"),w(typeof n.readAsync>"u","Module.readAsync option was removed (modify readAsync in JS)"),w(typeof n.readBinary>"u","Module.readBinary option was removed (modify readBinary in JS)"),w(typeof n.setWindowTitle>"u","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),w(typeof n.TOTAL_MEMORY>"u","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),qe("asm","wasmExports"),qe("read","read_"),qe("readAsync","readAsync"),qe("readBinary","readBinary"),qe("setWindowTitle","setWindowTitle"),w(!a,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),w(!g,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),w(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var S;n.wasmBinary&&(S=n.wasmBinary),qe("wasmBinary","wasmBinary"),typeof WebAssembly!="object"&&K("no native wasm support detected");var _,P=!1;function w(I,V){I||K("Assertion failed"+(V?": "+V:""))}var x,M,N,R,A,F,U,Y;function k(){var I=_.buffer;n.HEAP8=x=new Int8Array(I),n.HEAP16=N=new Int16Array(I),n.HEAPU8=M=new Uint8Array(I),n.HEAPU16=R=new Uint16Array(I),n.HEAP32=A=new Int32Array(I),n.HEAPU32=F=new Uint32Array(I),n.HEAPF32=U=new Float32Array(I),n.HEAPF64=Y=new Float64Array(I)}w(!n.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),w(typeof Int32Array<"u"&&typeof Float64Array<"u"&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,"JS engine does not provide full typed array support"),w(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),w(!n.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function W(){var I=Wc();w((I&3)==0),I==0&&(I+=4),F[I>>2]=34821223,F[I+4>>2]=2310721022,F[0]=1668509029}function G(){if(!P){var I=Wc();I==0&&(I+=4);var V=F[I>>2],Q=F[I+4>>2];(V!=34821223||Q!=2310721022)&&K(`Stack overflow! Stack cookie has been overwritten at ${Et(I)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${Et(Q)} ${Et(V)}`),F[0]!=1668509029&&K("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(function(){var I=new Int16Array(1),V=new Int8Array(I.buffer);if(I[0]=25459,V[0]!==115||V[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var H=[],L=[],$=[],ie=!1;function re(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)ge(n.preRun.shift());ot(H)}function be(){w(!ie),ie=!0,G(),!n.noFSInit&&!fe.init.initialized&&fe.init(),fe.ignorePermissions=!1,ot(L)}function ae(){if(G(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Z(n.postRun.shift());ot($)}function ge(I){H.unshift(I)}function le(I){L.unshift(I)}function Z(I){$.unshift(I)}w(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),w(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var ye=0,Se=null,X=null,ee={};function ne(I){for(var V=I;;){if(!ee[I])return I;I=V+Math.random()}}function O(I){var V;ye++,(V=n.monitorRunDependencies)==null||V.call(n,ye),I?(w(!ee[I]),ee[I]=1,Se===null&&typeof setInterval<"u"&&(Se=setInterval(()=>{if(P){clearInterval(Se),Se=null;return}var Q=!1;for(var oe in ee)Q||(Q=!0,y("still waiting on run dependencies:")),y(`dependency: ${oe}`);Q&&y("(end of list)")},1e4))):y("warning: run dependency added without ID")}function z(I){var Q;if(ye--,(Q=n.monitorRunDependencies)==null||Q.call(n,ye),I?(w(ee[I]),delete ee[I]):y("warning: run dependency removed without ID"),ye==0&&(Se!==null&&(clearInterval(Se),Se=null),X)){var V=X;X=null,V()}}function K(I){var Q;(Q=n.onAbort)==null||Q.call(n,I),I="Aborted("+I+")",y(I),P=!0;var V=new WebAssembly.RuntimeError(I);throw m(V),V}var q="data:application/octet-stream;base64,",de=I=>I.startsWith(q),ue=I=>I.startsWith("file://");function ce(I){return function(){w(ie,`native function \`${I}\` called before runtime initialization`);var V=Bn[I];return w(V,`exported native function \`${I}\` not found`),V.apply(null,arguments)}}var pe;pe="oddvoices_wasm.wasm",de(pe)||(pe=h(pe));function we(I){if(I==pe&&S)return new Uint8Array(S);throw"both async and sync fetching of the wasm failed"}function Me(I){return!S&&u&&typeof fetch=="function"?fetch(I,{credentials:"same-origin"}).then(V=>{if(!V.ok)throw"failed to load wasm binary file at '"+I+"'";return V.arrayBuffer()}).catch(()=>we(I)):Promise.resolve().then(()=>we(I))}function ze(I,V,Q){return Me(I).then(oe=>WebAssembly.instantiate(oe,V)).then(oe=>oe).then(Q,oe=>{y(`failed to asynchronously prepare wasm: ${oe}`),ue(pe)&&y(`warning: Loading from a file URI (${pe}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),K(oe)})}function De(I,V,Q,oe){return!I&&typeof WebAssembly.instantiateStreaming=="function"&&!de(V)&&typeof fetch=="function"?fetch(V,{credentials:"same-origin"}).then(Ee=>{var Ie=WebAssembly.instantiateStreaming(Ee,Q);return Ie.then(oe,function(Be){return y(`wasm streaming compile failed: ${Be}`),y("falling back to ArrayBuffer instantiation"),ze(V,Q,oe)})}):ze(V,Q,oe)}function Qe(){var I={env:yn,wasi_snapshot_preview1:yn};function V(Ee,Ie){return Bn=Ee.exports,_=Bn.memory,w(_,"memory not found in wasm exports"),k(),Os=Bn.__indirect_function_table,w(Os,"table not found in wasm exports"),le(Bn.__wasm_call_ctors),z("wasm-instantiate"),Bn}O("wasm-instantiate");var Q=n;function oe(Ee){w(n===Q,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),Q=null,V(Ee.instance)}if(n.instantiateWasm)try{return n.instantiateWasm(I,V)}catch(Ee){y(`Module.instantiateWasm callback failed with error: ${Ee}`),m(Ee)}return De(S,pe,I,oe).catch(m),{}}var ke,We;function qe(I,V,Q=!0){Object.getOwnPropertyDescriptor(n,I)||Object.defineProperty(n,I,{configurable:!0,get(){let oe=Q?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";K(`\`Module.${I}\` has been replaced by \`${V}\``+oe)}})}function Ye(I){Object.getOwnPropertyDescriptor(n,I)&&K(`\`Module.${I}\` was supplied but \`${I}\` not included in INCOMING_MODULE_JS_API`)}function Je(I){return I==="FS_createPath"||I==="FS_createDataFile"||I==="FS_createPreloadedFile"||I==="FS_unlink"||I==="addRunDependency"||I==="FS_createLazyFile"||I==="FS_createDevice"||I==="removeRunDependency"}function it(I,V){typeof globalThis<"u"&&Object.defineProperty(globalThis,I,{configurable:!0,get(){ct(`\`${I}\` is not longer defined by emscripten. ${V}`)}})}it("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),it("asm","Please use wasmExports instead");function ht(I){typeof globalThis<"u"&&!Object.getOwnPropertyDescriptor(globalThis,I)&&Object.defineProperty(globalThis,I,{configurable:!0,get(){var V=`\`${I}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,Q=I;Q.startsWith("_")||(Q="$"+I),V+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${Q}')`,Je(I)&&(V+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ct(V)}}),vt(I)}function vt(I){Object.getOwnPropertyDescriptor(n,I)||Object.defineProperty(n,I,{configurable:!0,get(){var V=`'${I}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Je(I)&&(V+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),K(V)}})}var ot=I=>{for(;I.length>0;)I.shift()(n)};n.noExitRuntime;var Et=I=>(w(typeof I=="number"),I>>>=0,"0x"+I.toString(16).padStart(8,"0")),ct=I=>{ct.shown||(ct.shown={}),ct.shown[I]||(ct.shown[I]=1,y(I))},_t=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Nt=(I,V,Q)=>{for(var oe=V+Q,Ee=V;I[Ee]&&!(Ee>=oe);)++Ee;if(Ee-V>16&&I.buffer&&_t)return _t.decode(I.subarray(V,Ee));for(var Ie="";V>10,56320|rt&1023)}}return Ie},qt=(I,V)=>(w(typeof I=="number",`UTF8ToString expects a number (got ${typeof I})`),I?Nt(M,I,V):""),li=(I,V,Q,oe)=>{K(`Assertion failed: ${qt(I)}, at: `+[V?qt(V):"unknown filename",Q,oe?qt(oe):"unknown function"])};class $n{constructor(V){this.excPtr=V,this.ptr=V-24}set_type(V){F[this.ptr+4>>2]=V}get_type(){return F[this.ptr+4>>2]}set_destructor(V){F[this.ptr+8>>2]=V}get_destructor(){return F[this.ptr+8>>2]}set_caught(V){V=V?1:0,x[this.ptr+12>>0]=V}get_caught(){return x[this.ptr+12>>0]!=0}set_rethrown(V){V=V?1:0,x[this.ptr+13>>0]=V}get_rethrown(){return x[this.ptr+13>>0]!=0}init(V,Q){this.set_adjusted_ptr(0),this.set_type(V),this.set_destructor(Q)}set_adjusted_ptr(V){F[this.ptr+16>>2]=V}get_adjusted_ptr(){return F[this.ptr+16>>2]}get_exception_ptr(){var V=Tn(this.get_type());if(V)return F[this.excPtr>>2];var Q=this.get_adjusted_ptr();return Q!==0?Q:this.excPtr}}var hr=(I,V,Q)=>{var oe=new $n(I);oe.init(V,Q),w(!1,"Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.")},At={isAbs:I=>I.charAt(0)==="/",splitPath:I=>{var V=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return V.exec(I).slice(1)},normalizeArray:(I,V)=>{for(var Q=0,oe=I.length-1;oe>=0;oe--){var Ee=I[oe];Ee==="."?I.splice(oe,1):Ee===".."?(I.splice(oe,1),Q++):Q&&(I.splice(oe,1),Q--)}if(V)for(;Q;Q--)I.unshift("..");return I},normalize:I=>{var V=At.isAbs(I),Q=I.substr(-1)==="/";return I=At.normalizeArray(I.split("/").filter(oe=>!!oe),!V).join("/"),!I&&!V&&(I="."),I&&Q&&(I+="/"),(V?"/":"")+I},dirname:I=>{var V=At.splitPath(I),Q=V[0],oe=V[1];return!Q&&!oe?".":(oe&&(oe=oe.substr(0,oe.length-1)),Q+oe)},basename:I=>{if(I==="/")return"/";I=At.normalize(I),I=I.replace(/\/$/,"");var V=I.lastIndexOf("/");return V===-1?I:I.substr(V+1)},join:function(){var I=Array.prototype.slice.call(arguments);return At.normalize(I.join("/"))},join2:(I,V)=>At.normalize(I+"/"+V)},On=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return I=>crypto.getRandomValues(I);K("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")},tn=I=>(tn=On())(I),Ht={resolve:function(){for(var I="",V=!1,Q=arguments.length-1;Q>=-1&&!V;Q--){var oe=Q>=0?arguments[Q]:fe.cwd();if(typeof oe!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!oe)return"";I=oe+"/"+I,V=At.isAbs(oe)}return I=At.normalizeArray(I.split("/").filter(Ee=>!!Ee),!V).join("/"),(V?"/":"")+I||"."},relative:(I,V)=>{I=Ht.resolve(I).substr(1),V=Ht.resolve(V).substr(1);function Q(rt){for(var st=0;st=0&&rt[gt]==="";gt--);return st>gt?[]:rt.slice(st,gt-st+1)}for(var oe=Q(I.split("/")),Ee=Q(V.split("/")),Ie=Math.min(oe.length,Ee.length),Be=Ie,Ve=0;Ve{for(var V=0,Q=0;Q=55296&&oe<=57343?(V+=4,++Q):V+=3}return V},jn=(I,V,Q,oe)=>{if(w(typeof I=="string",`stringToUTF8Array expects a string (got ${typeof I})`),!(oe>0))return 0;for(var Ee=Q,Ie=Q+oe-1,Be=0;Be=55296&&Ve<=57343){var et=I.charCodeAt(++Be);Ve=65536+((Ve&1023)<<10)|et&1023}if(Ve<=127){if(Q>=Ie)break;V[Q++]=Ve}else if(Ve<=2047){if(Q+1>=Ie)break;V[Q++]=192|Ve>>6,V[Q++]=128|Ve&63}else if(Ve<=65535){if(Q+2>=Ie)break;V[Q++]=224|Ve>>12,V[Q++]=128|Ve>>6&63,V[Q++]=128|Ve&63}else{if(Q+3>=Ie)break;Ve>1114111&&ct("Invalid Unicode code point "+Et(Ve)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),V[Q++]=240|Ve>>18,V[Q++]=128|Ve>>12&63,V[Q++]=128|Ve>>6&63,V[Q++]=128|Ve&63}}return V[Q]=0,Q-Ee};function Li(I,V,Q){var oe=Q>0?Q:An(I)+1,Ee=new Array(oe),Ie=jn(I,Ee,0,Ee.length);return V&&(Ee.length=Ie),Ee}var dr=()=>{if(!Vn.length){var I=null;if(typeof window<"u"&&typeof window.prompt=="function"?(I=window.prompt("Input: "),I!==null&&(I+=` +`)):typeof readline=="function"&&(I=readline(),I!==null&&(I+=` +`)),!I)return null;Vn=Li(I,!0)}return Vn.shift()},Hn={ttys:[],init(){},shutdown(){},register(I,V){Hn.ttys[I]={input:[],output:[],ops:V},fe.registerDevice(I,Hn.stream_ops)},stream_ops:{open(I){var V=Hn.ttys[I.node.rdev];if(!V)throw new fe.ErrnoError(43);I.tty=V,I.seekable=!1},close(I){I.tty.ops.fsync(I.tty)},fsync(I){I.tty.ops.fsync(I.tty)},read(I,V,Q,oe,Ee){if(!I.tty||!I.tty.ops.get_char)throw new fe.ErrnoError(60);for(var Ie=0,Be=0;Be0&&(f(Nt(I.output,0)),I.output=[])},ioctl_tcgets(I){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(I,V,Q){return 0},ioctl_tiocgwinsz(I){return[24,80]}},default_tty1_ops:{put_char(I,V){V===null||V===10?(y(Nt(I.output,0)),I.output=[]):V!=0&&I.output.push(V)},fsync(I){I.output&&I.output.length>0&&(y(Nt(I.output,0)),I.output=[])}}},is=I=>{K("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")},Dt={ops_table:null,mount(I){return Dt.createNode(null,"/",16895,0)},createNode(I,V,Q,oe){if(fe.isBlkdev(Q)||fe.isFIFO(Q))throw new fe.ErrnoError(63);Dt.ops_table||(Dt.ops_table={dir:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr,lookup:Dt.node_ops.lookup,mknod:Dt.node_ops.mknod,rename:Dt.node_ops.rename,unlink:Dt.node_ops.unlink,rmdir:Dt.node_ops.rmdir,readdir:Dt.node_ops.readdir,symlink:Dt.node_ops.symlink},stream:{llseek:Dt.stream_ops.llseek}},file:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr},stream:{llseek:Dt.stream_ops.llseek,read:Dt.stream_ops.read,write:Dt.stream_ops.write,allocate:Dt.stream_ops.allocate,mmap:Dt.stream_ops.mmap,msync:Dt.stream_ops.msync}},link:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr,readlink:Dt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Dt.node_ops.getattr,setattr:Dt.node_ops.setattr},stream:fe.chrdev_stream_ops}});var Ee=fe.createNode(I,V,Q,oe);return fe.isDir(Ee.mode)?(Ee.node_ops=Dt.ops_table.dir.node,Ee.stream_ops=Dt.ops_table.dir.stream,Ee.contents={}):fe.isFile(Ee.mode)?(Ee.node_ops=Dt.ops_table.file.node,Ee.stream_ops=Dt.ops_table.file.stream,Ee.usedBytes=0,Ee.contents=null):fe.isLink(Ee.mode)?(Ee.node_ops=Dt.ops_table.link.node,Ee.stream_ops=Dt.ops_table.link.stream):fe.isChrdev(Ee.mode)&&(Ee.node_ops=Dt.ops_table.chrdev.node,Ee.stream_ops=Dt.ops_table.chrdev.stream),Ee.timestamp=Date.now(),I&&(I.contents[V]=Ee,I.timestamp=Ee.timestamp),Ee},getFileDataAsTypedArray(I){return I.contents?I.contents.subarray?I.contents.subarray(0,I.usedBytes):new Uint8Array(I.contents):new Uint8Array(0)},expandFileStorage(I,V){var Q=I.contents?I.contents.length:0;if(!(Q>=V)){var oe=1024*1024;V=Math.max(V,Q*(Q>>0),Q!=0&&(V=Math.max(V,256));var Ee=I.contents;I.contents=new Uint8Array(V),I.usedBytes>0&&I.contents.set(Ee.subarray(0,I.usedBytes),0)}},resizeFileStorage(I,V){if(I.usedBytes!=V)if(V==0)I.contents=null,I.usedBytes=0;else{var Q=I.contents;I.contents=new Uint8Array(V),Q&&I.contents.set(Q.subarray(0,Math.min(V,I.usedBytes))),I.usedBytes=V}},node_ops:{getattr(I){var V={};return V.dev=fe.isChrdev(I.mode)?I.id:1,V.ino=I.id,V.mode=I.mode,V.nlink=1,V.uid=0,V.gid=0,V.rdev=I.rdev,fe.isDir(I.mode)?V.size=4096:fe.isFile(I.mode)?V.size=I.usedBytes:fe.isLink(I.mode)?V.size=I.link.length:V.size=0,V.atime=new Date(I.timestamp),V.mtime=new Date(I.timestamp),V.ctime=new Date(I.timestamp),V.blksize=4096,V.blocks=Math.ceil(V.size/V.blksize),V},setattr(I,V){V.mode!==void 0&&(I.mode=V.mode),V.timestamp!==void 0&&(I.timestamp=V.timestamp),V.size!==void 0&&Dt.resizeFileStorage(I,V.size)},lookup(I,V){throw fe.genericErrors[44]},mknod(I,V,Q,oe){return Dt.createNode(I,V,Q,oe)},rename(I,V,Q){if(fe.isDir(I.mode)){var oe;try{oe=fe.lookupNode(V,Q)}catch{}if(oe)for(var Ee in oe.contents)throw new fe.ErrnoError(55)}delete I.parent.contents[I.name],I.parent.timestamp=Date.now(),I.name=Q,V.contents[Q]=I,V.timestamp=I.parent.timestamp,I.parent=V},unlink(I,V){delete I.contents[V],I.timestamp=Date.now()},rmdir(I,V){var Q=fe.lookupNode(I,V);for(var oe in Q.contents)throw new fe.ErrnoError(55);delete I.contents[V],I.timestamp=Date.now()},readdir(I){var V=[".",".."];for(var Q of Object.keys(I.contents))V.push(Q);return V},symlink(I,V,Q){var oe=Dt.createNode(I,V,41471,0);return oe.link=Q,oe},readlink(I){if(!fe.isLink(I.mode))throw new fe.ErrnoError(28);return I.link}},stream_ops:{read(I,V,Q,oe,Ee){var Ie=I.node.contents;if(Ee>=I.node.usedBytes)return 0;var Be=Math.min(I.node.usedBytes-Ee,oe);if(w(Be>=0),Be>8&&Ie.subarray)V.set(Ie.subarray(Ee,Ee+Be),Q);else for(var Ve=0;Ve0||Q+V{var Ee=oe?"":ne(`al ${I}`);E(I,Ie=>{w(Ie,`Loading data file "${I}" failed (no arrayBuffer).`),V(new Uint8Array(Ie)),Ee&&z(Ee)},Ie=>{if(Q)Q();else throw`Loading data file "${I}" failed.`}),Ee&&O(Ee)},Ai=(I,V,Q,oe,Ee,Ie)=>{fe.createDataFile(I,V,Q,oe,Ee,Ie)},Si=n.preloadPlugins||[],Br=(I,V,Q,oe)=>{typeof Browser<"u"&&Browser.init();var Ee=!1;return Si.forEach(Ie=>{Ee||Ie.canHandle(V)&&(Ie.handle(I,V,Q,oe),Ee=!0)}),Ee},Dr=(I,V,Q,oe,Ee,Ie,Be,Ve,et,rt)=>{var st=V?Ht.resolve(At.join2(I,V)):I,gt=ne(`cp ${st}`);function yt(xt){function St(Wt){rt==null||rt(),Ve||Ai(I,V,Wt,oe,Ee,et),Ie==null||Ie(),z(gt)}Br(xt,st,St,()=>{Be==null||Be(),z(gt)})||St(xt)}O(gt),typeof Q=="string"?Qs(Q,yt,Be):yt(Q)},rs=I=>{var V={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Q=V[I];if(typeof Q>"u")throw new Error(`Unknown file open mode: ${I}`);return Q},fr=(I,V)=>{var Q=0;return I&&(Q|=365),V&&(Q|=146),Q},Ri={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},As={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Vr=I=>(ct("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),I),ra=I=>{var V=/\b_Z[\w\d_]+/g;return I.replace(V,function(Q){var oe=Vr(Q);return Q===oe?Q:oe+" ["+Q+"]"})},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(I,V={}){if(I=Ht.resolve(I),!I)return{path:"",node:null};var Q={follow_mount:!0,recurse_count:0};if(V=Object.assign(Q,V),V.recurse_count>8)throw new fe.ErrnoError(32);for(var oe=I.split("/").filter(gt=>!!gt),Ee=fe.root,Ie="/",Be=0;Be40)throw new fe.ErrnoError(32)}}return{path:Ie,node:Ee}},getPath(I){for(var V;;){if(fe.isRoot(I)){var Q=I.mount.mountpoint;return V?Q[Q.length-1]!=="/"?`${Q}/${V}`:Q+V:Q}V=V?`${I.name}/${V}`:I.name,I=I.parent}},hashName(I,V){for(var Q=0,oe=0;oe>>0)%fe.nameTable.length},hashAddNode(I){var V=fe.hashName(I.parent.id,I.name);I.name_next=fe.nameTable[V],fe.nameTable[V]=I},hashRemoveNode(I){var V=fe.hashName(I.parent.id,I.name);if(fe.nameTable[V]===I)fe.nameTable[V]=I.name_next;else for(var Q=fe.nameTable[V];Q;){if(Q.name_next===I){Q.name_next=I.name_next;break}Q=Q.name_next}},lookupNode(I,V){var Q=fe.mayLookup(I);if(Q)throw new fe.ErrnoError(Q,I);for(var oe=fe.hashName(I.id,V),Ee=fe.nameTable[oe];Ee;Ee=Ee.name_next){var Ie=Ee.name;if(Ee.parent.id===I.id&&Ie===V)return Ee}return fe.lookup(I,V)},createNode(I,V,Q,oe){w(typeof I=="object");var Ee=new fe.FSNode(I,V,Q,oe);return fe.hashAddNode(Ee),Ee},destroyNode(I){fe.hashRemoveNode(I)},isRoot(I){return I===I.parent},isMountpoint(I){return!!I.mounted},isFile(I){return(I&61440)===32768},isDir(I){return(I&61440)===16384},isLink(I){return(I&61440)===40960},isChrdev(I){return(I&61440)===8192},isBlkdev(I){return(I&61440)===24576},isFIFO(I){return(I&61440)===4096},isSocket(I){return(I&49152)===49152},flagsToPermissionString(I){var V=["r","w","rw"][I&3];return I&512&&(V+="w"),V},nodePermissions(I,V){return fe.ignorePermissions?0:V.includes("r")&&!(I.mode&292)||V.includes("w")&&!(I.mode&146)||V.includes("x")&&!(I.mode&73)?2:0},mayLookup(I){var V=fe.nodePermissions(I,"x");return V||(I.node_ops.lookup?0:2)},mayCreate(I,V){try{var Q=fe.lookupNode(I,V);return 20}catch{}return fe.nodePermissions(I,"wx")},mayDelete(I,V,Q){var oe;try{oe=fe.lookupNode(I,V)}catch(Ie){return Ie.errno}var Ee=fe.nodePermissions(I,"wx");if(Ee)return Ee;if(Q){if(!fe.isDir(oe.mode))return 54;if(fe.isRoot(oe)||fe.getPath(oe)===fe.cwd())return 10}else if(fe.isDir(oe.mode))return 31;return 0},mayOpen(I,V){return I?fe.isLink(I.mode)?32:fe.isDir(I.mode)&&(fe.flagsToPermissionString(V)!=="r"||V&512)?31:fe.nodePermissions(I,fe.flagsToPermissionString(V)):44},MAX_OPEN_FDS:4096,nextfd(){for(var I=0;I<=fe.MAX_OPEN_FDS;I++)if(!fe.streams[I])return I;throw new fe.ErrnoError(33)},getStreamChecked(I){var V=fe.getStream(I);if(!V)throw new fe.ErrnoError(8);return V},getStream:I=>fe.streams[I],createStream(I,V=-1){return fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={},Object.defineProperties(fe.FSStream.prototype,{object:{get(){return this.node},set(Q){this.node=Q}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(Q){this.shared.flags=Q}},position:{get(){return this.shared.position},set(Q){this.shared.position=Q}}})),I=Object.assign(new fe.FSStream,I),V==-1&&(V=fe.nextfd()),I.fd=V,fe.streams[V]=I,I},closeStream(I){fe.streams[I]=null},chrdev_stream_ops:{open(I){var Q,oe;var V=fe.getDevice(I.node.rdev);I.stream_ops=V.stream_ops,(oe=(Q=I.stream_ops).open)==null||oe.call(Q,I)},llseek(){throw new fe.ErrnoError(70)}},major:I=>I>>8,minor:I=>I&255,makedev:(I,V)=>I<<8|V,registerDevice(I,V){fe.devices[I]={stream_ops:V}},getDevice:I=>fe.devices[I],getMounts(I){for(var V=[],Q=[I];Q.length;){var oe=Q.pop();V.push(oe),Q.push.apply(Q,oe.mounts)}return V},syncfs(I,V){typeof I=="function"&&(V=I,I=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&y(`warning: ${fe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var Q=fe.getMounts(fe.root.mount),oe=0;function Ee(Be){return w(fe.syncFSRequests>0),fe.syncFSRequests--,V(Be)}function Ie(Be){if(Be)return Ie.errored?void 0:(Ie.errored=!0,Ee(Be));++oe>=Q.length&&Ee(null)}Q.forEach(Be=>{if(!Be.type.syncfs)return Ie(null);Be.type.syncfs(Be,I,Ie)})},mount(I,V,Q){if(typeof I=="string")throw I;var oe=Q==="/",Ee=!Q,Ie;if(oe&&fe.root)throw new fe.ErrnoError(10);if(!oe&&!Ee){var Be=fe.lookupPath(Q,{follow_mount:!1});if(Q=Be.path,Ie=Be.node,fe.isMountpoint(Ie))throw new fe.ErrnoError(10);if(!fe.isDir(Ie.mode))throw new fe.ErrnoError(54)}var Ve={type:I,opts:V,mountpoint:Q,mounts:[]},et=I.mount(Ve);return et.mount=Ve,Ve.root=et,oe?fe.root=et:Ie&&(Ie.mounted=Ve,Ie.mount&&Ie.mount.mounts.push(Ve)),et},unmount(I){var V=fe.lookupPath(I,{follow_mount:!1});if(!fe.isMountpoint(V.node))throw new fe.ErrnoError(28);var Q=V.node,oe=Q.mounted,Ee=fe.getMounts(oe);Object.keys(fe.nameTable).forEach(Be=>{for(var Ve=fe.nameTable[Be];Ve;){var et=Ve.name_next;Ee.includes(Ve.mount)&&fe.destroyNode(Ve),Ve=et}}),Q.mounted=null;var Ie=Q.mount.mounts.indexOf(oe);w(Ie!==-1),Q.mount.mounts.splice(Ie,1)},lookup(I,V){return I.node_ops.lookup(I,V)},mknod(I,V,Q){var oe=fe.lookupPath(I,{parent:!0}),Ee=oe.node,Ie=At.basename(I);if(!Ie||Ie==="."||Ie==="..")throw new fe.ErrnoError(28);var Be=fe.mayCreate(Ee,Ie);if(Be)throw new fe.ErrnoError(Be);if(!Ee.node_ops.mknod)throw new fe.ErrnoError(63);return Ee.node_ops.mknod(Ee,Ie,V,Q)},create(I,V){return V=V!==void 0?V:438,V&=4095,V|=32768,fe.mknod(I,V,0)},mkdir(I,V){return V=V!==void 0?V:511,V&=1023,V|=16384,fe.mknod(I,V,0)},mkdirTree(I,V){for(var Q=I.split("/"),oe="",Ee=0;Ee"u"&&(Q=V,V=438),V|=8192,fe.mknod(I,V,Q)},symlink(I,V){if(!Ht.resolve(I))throw new fe.ErrnoError(44);var Q=fe.lookupPath(V,{parent:!0}),oe=Q.node;if(!oe)throw new fe.ErrnoError(44);var Ee=At.basename(V),Ie=fe.mayCreate(oe,Ee);if(Ie)throw new fe.ErrnoError(Ie);if(!oe.node_ops.symlink)throw new fe.ErrnoError(63);return oe.node_ops.symlink(oe,Ee,I)},rename(I,V){var Q=At.dirname(I),oe=At.dirname(V),Ee=At.basename(I),Ie=At.basename(V),Be,Ve,et;if(Be=fe.lookupPath(I,{parent:!0}),Ve=Be.node,Be=fe.lookupPath(V,{parent:!0}),et=Be.node,!Ve||!et)throw new fe.ErrnoError(44);if(Ve.mount!==et.mount)throw new fe.ErrnoError(75);var rt=fe.lookupNode(Ve,Ee),st=Ht.relative(I,oe);if(st.charAt(0)!==".")throw new fe.ErrnoError(28);if(st=Ht.relative(V,Q),st.charAt(0)!==".")throw new fe.ErrnoError(55);var gt;try{gt=fe.lookupNode(et,Ie)}catch{}if(rt!==gt){var yt=fe.isDir(rt.mode),xt=fe.mayDelete(Ve,Ee,yt);if(xt)throw new fe.ErrnoError(xt);if(xt=gt?fe.mayDelete(et,Ie,yt):fe.mayCreate(et,Ie),xt)throw new fe.ErrnoError(xt);if(!Ve.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(rt)||gt&&fe.isMountpoint(gt))throw new fe.ErrnoError(10);if(et!==Ve&&(xt=fe.nodePermissions(Ve,"w"),xt))throw new fe.ErrnoError(xt);fe.hashRemoveNode(rt);try{Ve.node_ops.rename(rt,et,Ie)}catch(St){throw St}finally{fe.hashAddNode(rt)}}},rmdir(I){var V=fe.lookupPath(I,{parent:!0}),Q=V.node,oe=At.basename(I),Ee=fe.lookupNode(Q,oe),Ie=fe.mayDelete(Q,oe,!0);if(Ie)throw new fe.ErrnoError(Ie);if(!Q.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(Ee))throw new fe.ErrnoError(10);Q.node_ops.rmdir(Q,oe),fe.destroyNode(Ee)},readdir(I){var V=fe.lookupPath(I,{follow:!0}),Q=V.node;if(!Q.node_ops.readdir)throw new fe.ErrnoError(54);return Q.node_ops.readdir(Q)},unlink(I){var V=fe.lookupPath(I,{parent:!0}),Q=V.node;if(!Q)throw new fe.ErrnoError(44);var oe=At.basename(I),Ee=fe.lookupNode(Q,oe),Ie=fe.mayDelete(Q,oe,!1);if(Ie)throw new fe.ErrnoError(Ie);if(!Q.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(Ee))throw new fe.ErrnoError(10);Q.node_ops.unlink(Q,oe),fe.destroyNode(Ee)},readlink(I){var V=fe.lookupPath(I),Q=V.node;if(!Q)throw new fe.ErrnoError(44);if(!Q.node_ops.readlink)throw new fe.ErrnoError(28);return Ht.resolve(fe.getPath(Q.parent),Q.node_ops.readlink(Q))},stat(I,V){var Q=fe.lookupPath(I,{follow:!V}),oe=Q.node;if(!oe)throw new fe.ErrnoError(44);if(!oe.node_ops.getattr)throw new fe.ErrnoError(63);return oe.node_ops.getattr(oe)},lstat(I){return fe.stat(I,!0)},chmod(I,V,Q){var oe;if(typeof I=="string"){var Ee=fe.lookupPath(I,{follow:!Q});oe=Ee.node}else oe=I;if(!oe.node_ops.setattr)throw new fe.ErrnoError(63);oe.node_ops.setattr(oe,{mode:V&4095|oe.mode&-4096,timestamp:Date.now()})},lchmod(I,V){fe.chmod(I,V,!0)},fchmod(I,V){var Q=fe.getStreamChecked(I);fe.chmod(Q.node,V)},chown(I,V,Q,oe){var Ee;if(typeof I=="string"){var Ie=fe.lookupPath(I,{follow:!oe});Ee=Ie.node}else Ee=I;if(!Ee.node_ops.setattr)throw new fe.ErrnoError(63);Ee.node_ops.setattr(Ee,{timestamp:Date.now()})},lchown(I,V,Q){fe.chown(I,V,Q,!0)},fchown(I,V,Q){var oe=fe.getStreamChecked(I);fe.chown(oe.node,V,Q)},truncate(I,V){if(V<0)throw new fe.ErrnoError(28);var Q;if(typeof I=="string"){var oe=fe.lookupPath(I,{follow:!0});Q=oe.node}else Q=I;if(!Q.node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(Q.mode))throw new fe.ErrnoError(31);if(!fe.isFile(Q.mode))throw new fe.ErrnoError(28);var Ee=fe.nodePermissions(Q,"w");if(Ee)throw new fe.ErrnoError(Ee);Q.node_ops.setattr(Q,{size:V,timestamp:Date.now()})},ftruncate(I,V){var Q=fe.getStreamChecked(I);if(!(Q.flags&2097155))throw new fe.ErrnoError(28);fe.truncate(Q.node,V)},utime(I,V,Q){var oe=fe.lookupPath(I,{follow:!0}),Ee=oe.node;Ee.node_ops.setattr(Ee,{timestamp:Math.max(V,Q)})},open(I,V,Q){if(I==="")throw new fe.ErrnoError(44);V=typeof V=="string"?rs(V):V,Q=typeof Q>"u"?438:Q,V&64?Q=Q&4095|32768:Q=0;var oe;if(typeof I=="object")oe=I;else{I=At.normalize(I);try{var Ee=fe.lookupPath(I,{follow:!(V&131072)});oe=Ee.node}catch{}}var Ie=!1;if(V&64)if(oe){if(V&128)throw new fe.ErrnoError(20)}else oe=fe.mknod(I,Q,0),Ie=!0;if(!oe)throw new fe.ErrnoError(44);if(fe.isChrdev(oe.mode)&&(V&=-513),V&65536&&!fe.isDir(oe.mode))throw new fe.ErrnoError(54);if(!Ie){var Be=fe.mayOpen(oe,V);if(Be)throw new fe.ErrnoError(Be)}V&512&&!Ie&&fe.truncate(oe,0),V&=-131713;var Ve=fe.createStream({node:oe,path:fe.getPath(oe),flags:V,seekable:!0,position:0,stream_ops:oe.stream_ops,ungotten:[],error:!1});return Ve.stream_ops.open&&Ve.stream_ops.open(Ve),n.logReadFiles&&!(V&1)&&(fe.readFiles||(fe.readFiles={}),I in fe.readFiles||(fe.readFiles[I]=1)),Ve},close(I){if(fe.isClosed(I))throw new fe.ErrnoError(8);I.getdents&&(I.getdents=null);try{I.stream_ops.close&&I.stream_ops.close(I)}catch(V){throw V}finally{fe.closeStream(I.fd)}I.fd=null},isClosed(I){return I.fd===null},llseek(I,V,Q){if(fe.isClosed(I))throw new fe.ErrnoError(8);if(!I.seekable||!I.stream_ops.llseek)throw new fe.ErrnoError(70);if(Q!=0&&Q!=1&&Q!=2)throw new fe.ErrnoError(28);return I.position=I.stream_ops.llseek(I,V,Q),I.ungotten=[],I.position},read(I,V,Q,oe,Ee){if(w(Q>=0),oe<0||Ee<0)throw new fe.ErrnoError(28);if(fe.isClosed(I))throw new fe.ErrnoError(8);if((I.flags&2097155)===1)throw new fe.ErrnoError(8);if(fe.isDir(I.node.mode))throw new fe.ErrnoError(31);if(!I.stream_ops.read)throw new fe.ErrnoError(28);var Ie=typeof Ee<"u";if(!Ie)Ee=I.position;else if(!I.seekable)throw new fe.ErrnoError(70);var Be=I.stream_ops.read(I,V,Q,oe,Ee);return Ie||(I.position+=Be),Be},write(I,V,Q,oe,Ee,Ie){if(w(Q>=0),oe<0||Ee<0)throw new fe.ErrnoError(28);if(fe.isClosed(I))throw new fe.ErrnoError(8);if(!(I.flags&2097155))throw new fe.ErrnoError(8);if(fe.isDir(I.node.mode))throw new fe.ErrnoError(31);if(!I.stream_ops.write)throw new fe.ErrnoError(28);I.seekable&&I.flags&1024&&fe.llseek(I,0,2);var Be=typeof Ee<"u";if(!Be)Ee=I.position;else if(!I.seekable)throw new fe.ErrnoError(70);var Ve=I.stream_ops.write(I,V,Q,oe,Ee,Ie);return Be||(I.position+=Ve),Ve},allocate(I,V,Q){if(fe.isClosed(I))throw new fe.ErrnoError(8);if(V<0||Q<=0)throw new fe.ErrnoError(28);if(!(I.flags&2097155))throw new fe.ErrnoError(8);if(!fe.isFile(I.node.mode)&&!fe.isDir(I.node.mode))throw new fe.ErrnoError(43);if(!I.stream_ops.allocate)throw new fe.ErrnoError(138);I.stream_ops.allocate(I,V,Q)},mmap(I,V,Q,oe,Ee){if(oe&2&&!(Ee&2)&&(I.flags&2097155)!==2)throw new fe.ErrnoError(2);if((I.flags&2097155)===1)throw new fe.ErrnoError(2);if(!I.stream_ops.mmap)throw new fe.ErrnoError(43);return I.stream_ops.mmap(I,V,Q,oe,Ee)},msync(I,V,Q,oe,Ee){return w(Q>=0),I.stream_ops.msync?I.stream_ops.msync(I,V,Q,oe,Ee):0},munmap:I=>0,ioctl(I,V,Q){if(!I.stream_ops.ioctl)throw new fe.ErrnoError(59);return I.stream_ops.ioctl(I,V,Q)},readFile(I,V={}){if(V.flags=V.flags||0,V.encoding=V.encoding||"binary",V.encoding!=="utf8"&&V.encoding!=="binary")throw new Error(`Invalid encoding type "${V.encoding}"`);var Q,oe=fe.open(I,V.flags),Ee=fe.stat(I),Ie=Ee.size,Be=new Uint8Array(Ie);return fe.read(oe,Be,0,Ie,0),V.encoding==="utf8"?Q=Nt(Be,0):V.encoding==="binary"&&(Q=Be),fe.close(oe),Q},writeFile(I,V,Q={}){Q.flags=Q.flags||577;var oe=fe.open(I,Q.flags,Q.mode);if(typeof V=="string"){var Ee=new Uint8Array(An(V)+1),Ie=jn(V,Ee,0,Ee.length);fe.write(oe,Ee,0,Ie,void 0,Q.canOwn)}else if(ArrayBuffer.isView(V))fe.write(oe,V,0,V.byteLength,void 0,Q.canOwn);else throw new Error("Unsupported data type");fe.close(oe)},cwd:()=>fe.currentPath,chdir(I){var V=fe.lookupPath(I,{follow:!0});if(V.node===null)throw new fe.ErrnoError(44);if(!fe.isDir(V.node.mode))throw new fe.ErrnoError(54);var Q=fe.nodePermissions(V.node,"x");if(Q)throw new fe.ErrnoError(Q);fe.currentPath=V.path},createDefaultDirectories(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(oe,Ee,Ie,Be,Ve)=>Be}),fe.mkdev("/dev/null",fe.makedev(1,3)),Hn.register(fe.makedev(5,0),Hn.default_tty_ops),Hn.register(fe.makedev(6,0),Hn.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var I=new Uint8Array(1024),V=0,Q=()=>(V===0&&(V=tn(I).byteLength),I[--V]);fe.createDevice("/dev","random",Q),fe.createDevice("/dev","urandom",Q),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){fe.mkdir("/proc");var I=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount(){var V=fe.createNode(I,"fd",16895,73);return V.node_ops={lookup(Q,oe){var Ee=+oe,Ie=fe.getStreamChecked(Ee),Be={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>Ie.path}};return Be.parent=Be,Be}},V}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?fe.createDevice("/dev","stdin",n.stdin):fe.symlink("/dev/tty","/dev/stdin"),n.stdout?fe.createDevice("/dev","stdout",null,n.stdout):fe.symlink("/dev/tty","/dev/stdout"),n.stderr?fe.createDevice("/dev","stderr",null,n.stderr):fe.symlink("/dev/tty1","/dev/stderr");var I=fe.open("/dev/stdin",0),V=fe.open("/dev/stdout",1),Q=fe.open("/dev/stderr",1);w(I.fd===0,`invalid handle for stdin (${I.fd})`),w(V.fd===1,`invalid handle for stdout (${V.fd})`),w(Q.fd===2,`invalid handle for stderr (${Q.fd})`)},ensureErrnoError(){fe.ErrnoError||(fe.ErrnoError=function(V,Q){this.name="ErrnoError",this.node=Q,this.setErrno=function(oe){this.errno=oe;for(var Ee in As)if(As[Ee]===oe){this.code=Ee;break}},this.setErrno(V),this.message=Ri[V],this.stack&&(Object.defineProperty(this,"stack",{value:new Error().stack,writable:!0}),this.stack=ra(this.stack))},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach(I=>{fe.genericErrors[I]=new fe.ErrnoError(I),fe.genericErrors[I].stack=""}))},staticInit(){fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(Dt,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:Dt}},init(I,V,Q){w(!fe.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),fe.init.initialized=!0,fe.ensureErrnoError(),n.stdin=I||n.stdin,n.stdout=V||n.stdout,n.stderr=Q||n.stderr,fe.createStandardStreams()},quit(){fe.init.initialized=!1,xr(0);for(var I=0;Ithis.length-1||xt<0)){var St=xt%this.chunkSize,Wt=xt/this.chunkSize|0;return this.getter(Wt)[St]}},Ie.prototype.setDataGetter=function(xt){this.getter=xt},Ie.prototype.cacheLength=function(){var xt=new XMLHttpRequest;if(xt.open("HEAD",Q,!1),xt.send(null),!(xt.status>=200&&xt.status<300||xt.status===304))throw new Error("Couldn't load "+Q+". Status: "+xt.status);var St=Number(xt.getResponseHeader("Content-length")),Wt,Yt=(Wt=xt.getResponseHeader("Accept-Ranges"))&&Wt==="bytes",Sn=(Wt=xt.getResponseHeader("Content-Encoding"))&&Wt==="gzip",ut=1024*1024;Yt||(ut=St);var Ct=(wn,_i)=>{if(wn>_i)throw new Error("invalid range ("+wn+", "+_i+") or no bytes requested!");if(_i>St-1)throw new Error("only "+St+" bytes available! programmer error!");var Jt=new XMLHttpRequest;if(Jt.open("GET",Q,!1),St!==ut&&Jt.setRequestHeader("Range","bytes="+wn+"-"+_i),Jt.responseType="arraybuffer",Jt.overrideMimeType&&Jt.overrideMimeType("text/plain; charset=x-user-defined"),Jt.send(null),!(Jt.status>=200&&Jt.status<300||Jt.status===304))throw new Error("Couldn't load "+Q+". Status: "+Jt.status);return Jt.response!==void 0?new Uint8Array(Jt.response||[]):Li(Jt.responseText||"",!0)},Gn=this;Gn.setDataGetter(wn=>{var _i=wn*ut,Jt=(wn+1)*ut-1;if(Jt=Math.min(Jt,St-1),typeof Gn.chunks[wn]>"u"&&(Gn.chunks[wn]=Ct(_i,Jt)),typeof Gn.chunks[wn]>"u")throw new Error("doXHR failed!");return Gn.chunks[wn]}),(Sn||!St)&&(ut=St=1,St=this.getter(0).length,ut=St,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=St,this._chunkSize=ut,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var Be,Ve}else var Ve={isDevice:!1,url:Q};var et=fe.createFile(I,V,Ve,oe,Ee);Ve.contents?et.contents=Ve.contents:Ve.url&&(et.contents=null,et.url=Ve.url),Object.defineProperties(et,{usedBytes:{get:function(){return this.contents.length}}});var rt={},st=Object.keys(et.stream_ops);st.forEach(yt=>{var xt=et.stream_ops[yt];rt[yt]=function(){return fe.forceLoadFile(et),xt.apply(null,arguments)}});function gt(yt,xt,St,Wt,Yt){var Sn=yt.node.contents;if(Yt>=Sn.length)return 0;var ut=Math.min(Sn.length-Yt,Wt);if(w(ut>=0),Sn.slice)for(var Ct=0;Ct(fe.forceLoadFile(et),gt(yt,xt,St,Wt,Yt)),rt.mmap=(yt,xt,St,Wt,Yt)=>{fe.forceLoadFile(et);var Sn=is();if(!Sn)throw new fe.ErrnoError(48);return gt(yt,x,Sn,xt,St),{ptr:Sn,allocated:!0}},et.stream_ops=rt,et},absolutePath(){K("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){K("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){K("FS.createLink has been removed; use FS.symlink instead")},joinPath(){K("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){K("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){K("FS.standardizePath has been removed; use PATH.normalize instead")}},vn={DEFAULT_POLLMASK:5,calculateAt(I,V,Q){if(At.isAbs(V))return V;var oe;if(I===-100)oe=fe.cwd();else{var Ee=vn.getStreamFromFD(I);oe=Ee.path}if(V.length==0){if(!Q)throw new fe.ErrnoError(44);return oe}return At.join2(oe,V)},doStat(I,V,Q){try{var oe=I(V)}catch(Ve){if(Ve&&Ve.node&&At.normalize(V)!==At.normalize(fe.getPath(Ve.node)))return-54;throw Ve}A[Q>>2]=oe.dev,A[Q+4>>2]=oe.mode,F[Q+8>>2]=oe.nlink,A[Q+12>>2]=oe.uid,A[Q+16>>2]=oe.gid,A[Q+20>>2]=oe.rdev,We=[oe.size>>>0,(ke=oe.size,+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Q+24>>2]=We[0],A[Q+28>>2]=We[1],A[Q+32>>2]=4096,A[Q+36>>2]=oe.blocks;var Ee=oe.atime.getTime(),Ie=oe.mtime.getTime(),Be=oe.ctime.getTime();return We=[Math.floor(Ee/1e3)>>>0,(ke=Math.floor(Ee/1e3),+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Q+40>>2]=We[0],A[Q+44>>2]=We[1],F[Q+48>>2]=Ee%1e3*1e3,We=[Math.floor(Ie/1e3)>>>0,(ke=Math.floor(Ie/1e3),+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Q+56>>2]=We[0],A[Q+60>>2]=We[1],F[Q+64>>2]=Ie%1e3*1e3,We=[Math.floor(Be/1e3)>>>0,(ke=Math.floor(Be/1e3),+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Q+72>>2]=We[0],A[Q+76>>2]=We[1],F[Q+80>>2]=Be%1e3*1e3,We=[oe.ino>>>0,(ke=oe.ino,+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Q+88>>2]=We[0],A[Q+92>>2]=We[1],0},doMsync(I,V,Q,oe,Ee){if(!fe.isFile(V.node.mode))throw new fe.ErrnoError(43);if(oe&2)return 0;var Ie=M.slice(I,I+Q);fe.msync(V,Ie,Ee,Q,oe)},varargs:void 0,get(){w(vn.varargs!=null);var I=A[+vn.varargs>>2];return vn.varargs+=4,I},getp(){return vn.get()},getStr(I){var V=qt(I);return V},getStreamFromFD(I){var V=fe.getStreamChecked(I);return V}};function Qt(I,V,Q){vn.varargs=Q;try{var oe=vn.getStreamFromFD(I);switch(V){case 0:{var Ee=vn.get();if(Ee<0)return-28;for(;fe.streams[Ee];)Ee++;var Ie;return Ie=fe.createStream(oe,Ee),Ie.fd}case 1:case 2:return 0;case 3:return oe.flags;case 4:{var Ee=vn.get();return oe.flags|=Ee,0}case 12:{var Ee=vn.getp(),Be=0;return N[Ee+Be>>1]=2,0}case 13:case 14:return 0}return-28}catch(Ve){if(typeof fe>"u"||Ve.name!=="ErrnoError")throw Ve;return-Ve.errno}}function Gt(I,V,Q){vn.varargs=Q;try{var oe=vn.getStreamFromFD(I);switch(V){case 21509:return oe.tty?0:-59;case 21505:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tcgets){var Ee=oe.tty.ops.ioctl_tcgets(oe),Ie=vn.getp();A[Ie>>2]=Ee.c_iflag||0,A[Ie+4>>2]=Ee.c_oflag||0,A[Ie+8>>2]=Ee.c_cflag||0,A[Ie+12>>2]=Ee.c_lflag||0;for(var Be=0;Be<32;Be++)x[Ie+Be+17>>0]=Ee.c_cc[Be]||0;return 0}return 0}case 21510:case 21511:case 21512:return oe.tty?0:-59;case 21506:case 21507:case 21508:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tcsets){for(var Ie=vn.getp(),Ve=A[Ie>>2],et=A[Ie+4>>2],rt=A[Ie+8>>2],st=A[Ie+12>>2],gt=[],Be=0;Be<32;Be++)gt.push(x[Ie+Be+17>>0]);return oe.tty.ops.ioctl_tcsets(oe.tty,V,{c_iflag:Ve,c_oflag:et,c_cflag:rt,c_lflag:st,c_cc:gt})}return 0}case 21519:{if(!oe.tty)return-59;var Ie=vn.getp();return A[Ie>>2]=0,0}case 21520:return oe.tty?-28:-59;case 21531:{var Ie=vn.getp();return fe.ioctl(oe,V,Ie)}case 21523:{if(!oe.tty)return-59;if(oe.tty.ops.ioctl_tiocgwinsz){var yt=oe.tty.ops.ioctl_tiocgwinsz(oe.tty),Ie=vn.getp();N[Ie>>1]=yt[0],N[Ie+2>>1]=yt[1]}return 0}case 21524:return oe.tty?0:-59;case 21515:return oe.tty?0:-59;default:return-28}}catch(xt){if(typeof fe>"u"||xt.name!=="ErrnoError")throw xt;return-xt.errno}}function Xn(I,V,Q,oe){vn.varargs=oe;try{V=vn.getStr(V),V=vn.calculateAt(I,V);var Ee=oe?vn.get():0;return fe.open(V,Q,Ee).fd}catch(Ie){if(typeof fe>"u"||Ie.name!=="ErrnoError")throw Ie;return-Ie.errno}}var $l=(I,V,Q,oe,Ee)=>{},pr=()=>{for(var I=new Array(256),V=0;V<256;++V)I[V]=String.fromCharCode(V);sa=I},sa,Di=I=>{for(var V="",Q=I;M[Q];)V+=sa[M[Q++]];return V},Gr={},mr={},Ii={},Rs,fn=I=>{throw new Rs(I)},jl,oa=I=>{throw new jl(I)},Js=(I,V,Q)=>{I.forEach(function(Ve){Ii[Ve]=V});function oe(Ve){var et=Q(Ve);et.length!==I.length&&oa("Mismatched type converter count");for(var rt=0;rt{mr.hasOwnProperty(Ve)?Ee[et]=mr[Ve]:(Ie.push(Ve),Gr.hasOwnProperty(Ve)||(Gr[Ve]=[]),Gr[Ve].push(()=>{Ee[et]=mr[Ve],++Be,Be===Ie.length&&oe(Ee)}))}),Ie.length===0&&oe(Ee)};function aa(I,V,Q={}){var oe=V.name;if(I||fn(`type "${oe}" must have a positive integer typeid pointer`),mr.hasOwnProperty(I)){if(Q.ignoreDuplicateRegistrations)return;fn(`Cannot register type '${oe}' twice`)}if(mr[I]=V,delete Ii[I],Gr.hasOwnProperty(I)){var Ee=Gr[I];delete Gr[I],Ee.forEach(Ie=>Ie())}}function gr(I,V,Q={}){if(!("argPackAdvance"in V))throw new TypeError("registerType registeredInstance requires argPackAdvance");return aa(I,V,Q)}var gn=8,Is=(I,V,Q,oe)=>{V=Di(V),gr(I,{name:V,fromWireType:function(Ee){return!!Ee},toWireType:function(Ee,Ie){return Ie?Q:oe},argPackAdvance:gn,readValueFromPointer:function(Ee){return this.fromWireType(M[Ee])},destructorFunction:null})},Hl=I=>({count:I.count,deleteScheduled:I.deleteScheduled,preservePointerOnDelete:I.preservePointerOnDelete,ptr:I.ptr,ptrType:I.ptrType,smartPtr:I.smartPtr,smartPtrType:I.smartPtrType}),Co=I=>{function V(Q){return Q.$$.ptrType.registeredClass.name}fn(V(I)+" instance already deleted")},Zs=!1,Oe=I=>{},i=I=>{I.smartPtr?I.smartPtrType.rawDestructor(I.smartPtr):I.ptrType.registeredClass.rawDestructor(I.ptr)},v=I=>{I.count.value-=1;var V=I.count.value===0;V&&i(I)},C=(I,V,Q)=>{if(V===Q)return I;if(Q.baseClass===void 0)return null;var oe=C(I,V,Q.baseClass);return oe===null?null:Q.downcast(oe)},D={},j=()=>Object.keys(Ne).length,J=()=>{var I=[];for(var V in Ne)Ne.hasOwnProperty(V)&&I.push(Ne[V]);return I},se=[],he=()=>{for(;se.length;){var I=se.pop();I.$$.deleteScheduled=!1,I.delete()}},ve,_e=I=>{ve=I,se.length&&ve&&ve(he)},Ce=()=>{n.getInheritedInstanceCount=j,n.getLiveInheritedInstances=J,n.flushPendingDeletes=he,n.setDelayFunction=_e},Ne={},Ae=(I,V)=>{for(V===void 0&&fn("ptr should not be undefined");I.baseClass;)V=I.upcast(V),I=I.baseClass;return V},Ge=(I,V)=>(V=Ae(I,V),Ne[V]),He=(I,V)=>{(!V.ptrType||!V.ptr)&&oa("makeClassHandle requires ptr and ptrType");var Q=!!V.smartPtrType,oe=!!V.smartPtr;return Q!==oe&&oa("Both smartPtrType and smartPtr must be specified"),V.count={value:1},Ze(Object.create(I,{$$:{value:V,writable:!0}}))};function $e(I){var V=this.getPointee(I);if(!V)return this.destructor(I),null;var Q=Ge(this.registeredClass,V);if(Q!==void 0){if(Q.$$.count.value===0)return Q.$$.ptr=V,Q.$$.smartPtr=I,Q.clone();var oe=Q.clone();return this.destructor(I),oe}function Ee(){return this.isSmartPointer?He(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:V,smartPtrType:this,smartPtr:I}):He(this.registeredClass.instancePrototype,{ptrType:this,ptr:I})}var Ie=this.registeredClass.getActualType(V),Be=D[Ie];if(!Be)return Ee.call(this);var Ve;this.isConst?Ve=Be.constPointerType:Ve=Be.pointerType;var et=C(V,this.registeredClass,Ve.registeredClass);return et===null?Ee.call(this):this.isSmartPointer?He(Ve.registeredClass.instancePrototype,{ptrType:Ve,ptr:et,smartPtrType:this,smartPtr:I}):He(Ve.registeredClass.instancePrototype,{ptrType:Ve,ptr:et})}var Ze=I=>typeof FinalizationRegistry>"u"?(Ze=V=>V,I):(Zs=new FinalizationRegistry(V=>{console.warn(V.leakWarning.stack.replace(/^Error: /,"")),v(V.$$)}),Ze=V=>{var Q=V.$$,oe=!!Q.smartPtr;if(oe){var Ee={$$:Q},Ie=Q.ptrType.registeredClass;Ee.leakWarning=new Error(`Embind found a leaked C++ instance ${Ie.name} <${Et(Q.ptr)}>. +We'll free it automatically in this case, but this functionality is not reliable across various environments. +Make sure to invoke .delete() manually once you're done with the instance instead. +Originally allocated`),"captureStackTrace"in Error&&Error.captureStackTrace(Ee.leakWarning,$e),Zs.register(V,Ee,V)}return V},Oe=V=>Zs.unregister(V),Ze(I)),pt=()=>{Object.assign(ft.prototype,{isAliasOf(I){if(!(this instanceof ft)||!(I instanceof ft))return!1;var V=this.$$.ptrType.registeredClass,Q=this.$$.ptr;I.$$=I.$$;for(var oe=I.$$.ptrType.registeredClass,Ee=I.$$.ptr;V.baseClass;)Q=V.upcast(Q),V=V.baseClass;for(;oe.baseClass;)Ee=oe.upcast(Ee),oe=oe.baseClass;return V===oe&&Q===Ee},clone(){if(this.$$.ptr||Co(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var I=Ze(Object.create(Object.getPrototypeOf(this),{$$:{value:Hl(this.$$)}}));return I.$$.count.value+=1,I.$$.deleteScheduled=!1,I},delete(){this.$$.ptr||Co(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&fn("Object already scheduled for deletion"),Oe(this),v(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Co(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&fn("Object already scheduled for deletion"),se.push(this),se.length===1&&ve&&ve(he),this.$$.deleteScheduled=!0,this}})};function ft(){}var bt=(I,V)=>Object.defineProperty(V,"name",{value:I}),Ot=(I,V,Q)=>{if(I[V].overloadTable===void 0){var oe=I[V];I[V]=function(){return I[V].overloadTable.hasOwnProperty(arguments.length)||fn(`Function '${Q}' called with an invalid number of arguments (${arguments.length}) - expects one of (${I[V].overloadTable})!`),I[V].overloadTable[arguments.length].apply(this,arguments)},I[V].overloadTable=[],I[V].overloadTable[oe.argCount]=oe}},jt=(I,V,Q)=>{n.hasOwnProperty(I)?((Q===void 0||n[I].overloadTable!==void 0&&n[I].overloadTable[Q]!==void 0)&&fn(`Cannot register public name '${I}' twice`),Ot(n,I,I),n.hasOwnProperty(Q)&&fn(`Cannot register multiple overloads of a function with the same number of arguments (${Q})!`),n[I].overloadTable[Q]=V):(n[I]=V,Q!==void 0&&(n[I].numArguments=Q))},ln=48,Rn=57,xn=I=>{if(I===void 0)return"_unknown";I=I.replace(/[^a-zA-Z0-9_]/g,"$");var V=I.charCodeAt(0);return V>=ln&&V<=Rn?`_${I}`:I};function Vi(I,V,Q,oe,Ee,Ie,Be,Ve){this.name=I,this.constructor=V,this.instancePrototype=Q,this.rawDestructor=oe,this.baseClass=Ee,this.getActualType=Ie,this.upcast=Be,this.downcast=Ve,this.pureVirtualFunctions=[]}var ui=(I,V,Q)=>{for(;V!==Q;)V.upcast||fn(`Expected null or instance of ${Q.name}, got an instance of ${V.name}`),I=V.upcast(I),V=V.baseClass;return I};function ci(I,V){if(V===null)return this.isReference&&fn(`null is not a valid ${this.name}`),0;V.$$||fn(`Cannot pass "${ro(V)}" as a ${this.name}`),V.$$.ptr||fn(`Cannot pass deleted object as a pointer of type ${this.name}`);var Q=V.$$.ptrType.registeredClass,oe=ui(V.$$.ptr,Q,this.registeredClass);return oe}function Zi(I,V){var Q;if(V===null)return this.isReference&&fn(`null is not a valid ${this.name}`),this.isSmartPointer?(Q=this.rawConstructor(),I!==null&&I.push(this.rawDestructor,Q),Q):0;(!V||!V.$$)&&fn(`Cannot pass "${ro(V)}" as a ${this.name}`),V.$$.ptr||fn(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&V.$$.ptrType.isConst&&fn(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);var oe=V.$$.ptrType.registeredClass;if(Q=ui(V.$$.ptr,oe,this.registeredClass),this.isSmartPointer)switch(V.$$.smartPtr===void 0&&fn("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:V.$$.smartPtrType===this?Q=V.$$.smartPtr:fn(`Cannot convert argument of type ${V.$$.smartPtrType?V.$$.smartPtrType.name:V.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:Q=V.$$.smartPtr;break;case 2:if(V.$$.smartPtrType===this)Q=V.$$.smartPtr;else{var Ee=V.clone();Q=this.rawShare(Q,Fn.toHandle(()=>Ee.delete())),I!==null&&I.push(this.rawDestructor,Q)}break;default:fn("Unsupporting sharing policy")}return Q}function br(I,V){if(V===null)return this.isReference&&fn(`null is not a valid ${this.name}`),0;V.$$||fn(`Cannot pass "${ro(V)}" as a ${this.name}`),V.$$.ptr||fn(`Cannot pass deleted object as a pointer of type ${this.name}`),V.$$.ptrType.isConst&&fn(`Cannot convert argument of type ${V.$$.ptrType.name} to parameter type ${this.name}`);var Q=V.$$.ptrType.registeredClass,oe=ui(V.$$.ptr,Q,this.registeredClass);return oe}function bn(I){return this.fromWireType(F[I>>2])}var pn=()=>{Object.assign(er.prototype,{getPointee(I){return this.rawGetPointee&&(I=this.rawGetPointee(I)),I},destructor(I){var V;(V=this.rawDestructor)==null||V.call(this,I)},argPackAdvance:gn,readValueFromPointer:bn,fromWireType:$e})};function er(I,V,Q,oe,Ee,Ie,Be,Ve,et,rt,st){this.name=I,this.registeredClass=V,this.isReference=Q,this.isConst=oe,this.isSmartPointer=Ee,this.pointeeType=Ie,this.sharingPolicy=Be,this.rawGetPointee=Ve,this.rawConstructor=et,this.rawShare=rt,this.rawDestructor=st,!Ee&&V.baseClass===void 0?oe?(this.toWireType=ci,this.destructorFunction=null):(this.toWireType=br,this.destructorFunction=null):this.toWireType=Zi}var Ns=(I,V,Q)=>{n.hasOwnProperty(I)||oa("Replacing nonexistant public symbol"),n[I].overloadTable!==void 0&&Q!==void 0?n[I].overloadTable[Q]=V:(n[I]=V,n[I].argCount=Q)},eo=(I,V,Q)=>{w("dynCall_"+I in n,`bad function pointer type - dynCall function not found for sig '${I}'`),Q!=null&&Q.length?w(Q.length===I.substring(1).replace(/j/g,"--").length):w(I.length==1);var oe=n["dynCall_"+I];return Q&&Q.length?oe.apply(null,[V].concat(Q)):oe.call(null,V)},ks=[],Os,to=I=>{var V=ks[I];return V||(I>=ks.length&&(ks.length=I+1),ks[I]=V=Os.get(I)),w(Os.get(I)==V,"JavaScript-side Wasm function table mirror is out of date!"),V},Lo=(I,V,Q)=>{if(I.includes("j"))return eo(I,V,Q);w(to(V),`missing table entry in dynCall: ${V}`);var oe=to(V).apply(null,Q);return oe},mm=(I,V)=>{w(I.includes("j")||I.includes("p"),"getDynCaller should only be called with i64 sigs");var Q=[];return function(){return Q.length=0,Object.assign(Q,arguments),Lo(I,V,Q)}},Yn=(I,V)=>{I=Di(I);function Q(){return I.includes("j")?mm(I,V):to(V)}var oe=Q();return typeof oe!="function"&&fn(`unknown function pointer with signature ${I}: ${V}`),oe},Lc=(I,V)=>{var Q=bt(V,function(oe){this.name=V,this.message=oe;var Ee=new Error(oe).stack;Ee!==void 0&&(this.stack=this.toString()+` +`+Ee.replace(/^Error(:[^\n]*)?\n/,""))});return Q.prototype=Object.create(I.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},Q},no,Dd=I=>{var V=km(I),Q=Di(V);return ss(V),Q},la=(I,V)=>{var Q=[],oe={};function Ee(Ie){if(!oe[Ie]&&!mr[Ie]){if(Ii[Ie]){Ii[Ie].forEach(Ee);return}Q.push(Ie),oe[Ie]=!0}}throw V.forEach(Ee),new no(`${I}: `+Q.map(Dd).join([", "]))},yr=(I,V,Q,oe,Ee,Ie,Be,Ve,et,rt,st,gt,yt)=>{st=Di(st),Ie=Yn(Ee,Ie),Ve&&(Ve=Yn(Be,Ve)),rt&&(rt=Yn(et,rt)),yt=Yn(gt,yt);var xt=xn(st);jt(xt,function(){la(`Cannot construct ${st} due to unbound types`,[oe])}),Js([I,V,Q],oe?[oe]:[],function(St){var Jt;St=St[0];var Wt,Yt;oe?(Wt=St.registeredClass,Yt=Wt.instancePrototype):Yt=ft.prototype;var Sn=bt(st,function(){if(Object.getPrototypeOf(this)!==ut)throw new Rs("Use 'new' to construct "+st);if(Ct.constructor_body===void 0)throw new Rs(st+" has no accessible constructor");var Ti=Ct.constructor_body[arguments.length];if(Ti===void 0)throw new Rs(`Tried to invoke ctor of ${st} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(Ct.constructor_body).toString()}) parameters instead!`);return Ti.apply(this,arguments)}),ut=Object.create(Yt,{constructor:{value:Sn}});Sn.prototype=ut;var Ct=new Vi(st,Sn,ut,yt,Wt,Ie,Ve,rt);Ct.baseClass&&((Jt=Ct.baseClass).__derivedClasses??(Jt.__derivedClasses=[]),Ct.baseClass.__derivedClasses.push(Ct));var Gn=new er(st,Ct,!0,!1,!1),wn=new er(st+"*",Ct,!1,!1,!1),_i=new er(st+" const*",Ct,!1,!0,!1);return D[I]={pointerType:wn,constPointerType:_i},Ns(xt,Sn),[Gn,wn,_i]})},Xl=(I,V)=>{for(var Q=[],oe=0;oe>2]);return Q},Vd=I=>{for(;I.length;){var V=I.pop(),Q=I.pop();Q(V)}};function Ac(I){for(var V=1;V0?", ":"")+et),st+=(oe||Ee?"var rv = ":"")+"invoker(fn"+(et.length>0?", ":"")+et+`); +`,Ie)st+=`runDestructors(destructors); +`;else for(var rt=Q?1:2;rt{w(V>0);var Be=Xl(V,Q);Ee=Yn(oe,Ee),Js([],[I],function(Ve){Ve=Ve[0];var et=`constructor ${Ve.name}`;if(Ve.registeredClass.constructor_body===void 0&&(Ve.registeredClass.constructor_body=[]),Ve.registeredClass.constructor_body[V-1]!==void 0)throw new Rs(`Cannot register multiple constructors with identical number of parameters (${V-1}) for class '${Ve.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Ve.registeredClass.constructor_body[V-1]=()=>{la(`Cannot construct ${Ve.name} due to unbound types`,Be)},Js([],Be,rt=>(rt.splice(1,0,null),Ve.registeredClass.constructor_body[V-1]=Yl(et,rt,null,Ee,Ie),[])),[]})},zd=I=>{I=I.trim();const V=I.indexOf("(");return V!==-1?(w(I[I.length-1]==")","Parentheses for argument names should match."),I.substr(0,V)):I},vr=(I,V,Q,oe,Ee,Ie,Be,Ve,et)=>{var rt=Xl(Q,oe);V=Di(V),V=zd(V),Ie=Yn(Ee,Ie),Js([],[I],function(st){st=st[0];var gt=`${st.name}.${V}`;V.startsWith("@@")&&(V=Symbol[V.substring(2)]),Ve&&st.registeredClass.pureVirtualFunctions.push(V);function yt(){la(`Cannot call ${gt} due to unbound types`,rt)}var xt=st.registeredClass.instancePrototype,St=xt[V];return St===void 0||St.overloadTable===void 0&&St.className!==st.name&&St.argCount===Q-2?(yt.argCount=Q-2,yt.className=st.name,xt[V]=yt):(Ot(xt,V,gt),xt[V].overloadTable[Q-2]=yt),Js([],rt,function(Wt){var Yt=Yl(gt,Wt,st,Ie,Be,et);return xt[V].overloadTable===void 0?(Yt.argCount=Q-2,xt[V]=Yt):xt[V].overloadTable[Q-2]=Yt,[]}),[]})};class gm{constructor(){this.allocated=[void 0],this.freelist=[]}get(V){return w(this.allocated[V]!==void 0,`invalid handle: ${V}`),this.allocated[V]}has(V){return this.allocated[V]!==void 0}allocate(V){var Q=this.freelist.pop()||this.allocated.length;return this.allocated[Q]=V,Q}free(V){w(this.allocated[V]!==void 0),this.allocated[V]=void 0,this.freelist.push(V)}}var Sr=new gm,io=I=>{I>=Sr.reserved&&--Sr.get(I).refcount===0&&Sr.free(I)},Kl=()=>{for(var I=0,V=Sr.reserved;V{Sr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(Sr,{reserved:Sr.allocated.length}),n.count_emval_handles=Kl},Fn={toValue:I=>(I||fn("Cannot use deleted val. handle = "+I),Sr.get(I).value),toHandle:I=>{switch(I){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Sr.allocate({refcount:1,value:I})}}};function Fs(I){return this.fromWireType(A[I>>2])}var Ic={name:"emscripten::val",fromWireType:I=>{var V=Fn.toValue(I);return io(I),V},toWireType:(I,V)=>Fn.toHandle(V),argPackAdvance:gn,readValueFromPointer:Fs,destructorFunction:null},bm=I=>gr(I,Ic),ro=I=>{if(I===null)return"null";var V=typeof I;return V==="object"||V==="array"||V==="function"?I.toString():""+I},ym=(I,V)=>{switch(V){case 4:return function(Q){return this.fromWireType(U[Q>>2])};case 8:return function(Q){return this.fromWireType(Y[Q>>3])};default:throw new TypeError(`invalid float width (${V}): ${I}`)}},vm=(I,V,Q)=>{V=Di(V),gr(I,{name:V,fromWireType:oe=>oe,toWireType:(oe,Ee)=>{if(typeof Ee!="number"&&typeof Ee!="boolean")throw new TypeError(`Cannot convert ${ro(Ee)} to ${this.name}`);return Ee},argPackAdvance:gn,readValueFromPointer:ym(V,Q),destructorFunction:null})},Sm=(I,V,Q,oe,Ee,Ie,Be)=>{var Ve=Xl(V,Q);I=Di(I),I=zd(I),Ee=Yn(oe,Ee),jt(I,function(){la(`Cannot call ${I} due to unbound types`,Ve)},V-1),Js([],Ve,function(et){var rt=[et[0],null].concat(et.slice(1));return Ns(I,Yl(I,rt,null,Ee,Ie,Be),V-1),[]})},Ud=(I,V,Q)=>{switch(V){case 1:return Q?oe=>x[oe>>0]:oe=>M[oe>>0];case 2:return Q?oe=>N[oe>>1]:oe=>R[oe>>1];case 4:return Q?oe=>A[oe>>2]:oe=>F[oe>>2];default:throw new TypeError(`invalid integer width (${V}): ${I}`)}},ql=(I,V,Q,oe,Ee)=>{V=Di(V),Ee===-1&&(Ee=4294967295);var Ie=st=>st;if(oe===0){var Be=32-8*Q;Ie=st=>st<>>Be}var Ve=V.includes("unsigned"),et=(st,gt)=>{if(typeof st!="number"&&typeof st!="boolean")throw new TypeError(`Cannot convert "${ro(st)}" to ${gt}`);if(stEe)throw new TypeError(`Passing a number "${ro(st)}" from JS side to C/C++ side to an argument of type "${V}", which is outside the valid range [${oe}, ${Ee}]!`)},rt;Ve?rt=function(st,gt){return et(gt,this.name),gt>>>0}:rt=function(st,gt){return et(gt,this.name),gt},gr(I,{name:V,fromWireType:Ie,toWireType:rt,argPackAdvance:gn,readValueFromPointer:Ud(V,Q,oe!==0),destructorFunction:null})},ua=(I,V,Q)=>{var oe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ee=oe[V];function Ie(Be){var Ve=F[Be>>2],et=F[Be+4>>2];return new Ee(x.buffer,et,Ve)}Q=Di(Q),gr(I,{name:Q,fromWireType:Ie,argPackAdvance:gn,readValueFromPointer:Ie},{ignoreDuplicateRegistrations:!0})},$d=(I,V,Q)=>(w(typeof Q=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),jn(I,M,V,Q)),jd=(I,V)=>{V=Di(V);var Q=V==="std::string";gr(I,{name:V,fromWireType(oe){var Ee=F[oe>>2],Ie=oe+4,Be;if(Q)for(var Ve=Ie,et=0;et<=Ee;++et){var rt=Ie+et;if(et==Ee||M[rt]==0){var st=rt-Ve,gt=qt(Ve,st);Be===void 0?Be=gt:(Be+="\0",Be+=gt),Ve=rt+1}}else{for(var yt=new Array(Ee),et=0;et>2]=Ie,Q&&Be)$d(Ee,et,Ie+1);else if(Be)for(var rt=0;rt255&&(ss(et),fn("String has UTF-16 code units that do not fit in 8 bits")),M[et+rt]=st}else for(var rt=0;rt{w(I%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var Q=I,oe=Q>>1,Ee=oe+V/2;!(oe>=Ee)&&R[oe];)++oe;if(Q=oe<<1,Q-I>32&&Nc)return Nc.decode(M.subarray(I,Q));for(var Ie="",Be=0;!(Be>=V/2);++Be){var Ve=N[I+Be*2>>1];if(Ve==0)break;Ie+=String.fromCharCode(Ve)}return Ie},Oc=(I,V,Q)=>{if(w(V%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),w(typeof Q=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q??(Q=2147483647),Q<2)return 0;Q-=2;for(var oe=V,Ee=Q>1]=Be,V+=2}return N[V>>1]=0,V-oe},Hd=I=>I.length*2,Em=(I,V)=>{w(I%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var Q=0,oe="";!(Q>=V/4);){var Ee=A[I+Q*4>>2];if(Ee==0)break;if(++Q,Ee>=65536){var Ie=Ee-65536;oe+=String.fromCharCode(55296|Ie>>10,56320|Ie&1023)}else oe+=String.fromCharCode(Ee)}return oe},Fc=(I,V,Q)=>{if(w(V%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),w(typeof Q=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q??(Q=2147483647),Q<4)return 0;for(var oe=V,Ee=oe+Q-4,Ie=0;Ie=55296&&Be<=57343){var Ve=I.charCodeAt(++Ie);Be=65536+((Be&1023)<<10)|Ve&1023}if(A[V>>2]=Be,V+=4,V+4>Ee)break}return A[V>>2]=0,V-oe},Bc=I=>{for(var V=0,Q=0;Q=55296&&oe<=57343&&++Q,V+=4}return V},xm=(I,V,Q)=>{Q=Di(Q);var oe,Ee,Ie,Be,Ve;V===2?(oe=kc,Ee=Oc,Be=Hd,Ie=()=>R,Ve=1):V===4&&(oe=Em,Ee=Fc,Be=Bc,Ie=()=>F,Ve=2),gr(I,{name:Q,fromWireType:et=>{for(var rt=F[et>>2],st=Ie(),gt,yt=et+4,xt=0;xt<=rt;++xt){var St=et+4+xt*V;if(xt==rt||st[St>>Ve]==0){var Wt=St-yt,Yt=oe(yt,Wt);gt===void 0?gt=Yt:(gt+="\0",gt+=Yt),yt=St+V}}return ss(et),gt},toWireType:(et,rt)=>{typeof rt!="string"&&fn(`Cannot pass non-string to C++ string type ${Q}`);var st=Be(rt),gt=Cn(4+st+V);return F[gt>>2]=st>>Ve,Ee(rt,gt+4,st+V),et!==null&&et.push(ss,gt),gt},argPackAdvance:gn,readValueFromPointer:Fs,destructorFunction(et){ss(et)}})},Xd=(I,V)=>{V=Di(V),gr(I,{isVoid:!0,name:V,argPackAdvance:0,fromWireType:()=>{},toWireType:(Q,oe)=>{}})},nr=()=>{K("native code called abort()")},Dc=(I,V,Q)=>M.copyWithin(I,V,V+Q),el=()=>2147483648,Yd=I=>{var V=_.buffer,Q=(I-V.byteLength+65535)/65536;try{return _.grow(Q),k(),1}catch(oe){y(`growMemory: Attempted to grow heap from ${V.byteLength} bytes to ${I} bytes, but got error: ${oe}`)}},Kd=I=>{var V=M.length;I>>>=0,w(I>V);var Q=el();if(I>Q)return y(`Cannot enlarge memory, requested ${I} bytes, but the limit is ${Q} bytes!`),!1;for(var oe=(et,rt)=>et+(rt-et%rt)%rt,Ee=1;Ee<=4;Ee*=2){var Ie=V*(1+.2/Ee);Ie=Math.min(Ie,I+100663296);var Be=Math.min(Q,oe(Math.max(I,Ie),65536)),Ve=Yd(Be);if(Ve)return!0}return y(`Failed to grow the heap from ${V} bytes to ${Be} bytes, not enough memory!`),!1},Vc={},wm=()=>r||"./this.program",tl=()=>{if(!tl.strings){var I=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",V={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:I,_:wm()};for(var Q in Vc)Vc[Q]===void 0?delete V[Q]:V[Q]=Vc[Q];var oe=[];for(var Q in V)oe.push(`${Q}=${V[Q]}`);tl.strings=oe}return tl.strings},_m=(I,V)=>{for(var Q=0;Q>0]=I.charCodeAt(Q);x[V>>0]=0},Tm=(I,V)=>{var Q=0;return tl().forEach((oe,Ee)=>{var Ie=V+Q;F[I+Ee*4>>2]=Ie,_m(oe,Ie),Q+=oe.length+1}),0},ca=(I,V)=>{var Q=tl();F[I>>2]=Q.length;var oe=0;return Q.forEach(Ee=>oe+=Ee.length+1),F[V>>2]=oe,0};function Pm(I){try{var V=vn.getStreamFromFD(I);return fe.close(V),0}catch(Q){if(typeof fe>"u"||Q.name!=="ErrnoError")throw Q;return Q.errno}}var Mm=(I,V,Q,oe)=>{for(var Ee=0,Ie=0;Ie>2],Ve=F[V+4>>2];V+=8;var et=fe.read(I,x,Be,Ve,oe);if(et<0)return-1;if(Ee+=et,et>2]=Ie,0}catch(Be){if(typeof fe>"u"||Be.name!=="ErrnoError")throw Be;return Be.errno}}var qd=(I,V)=>(w(I==I>>>0||I==(I|0)),w(V===(V|0)),V+2097152>>>0<4194305-!!I?(I>>>0)+V*4294967296:NaN);function so(I,V,Q,oe,Ee){var Ie=qd(V,Q);try{if(isNaN(Ie))return 61;var Be=vn.getStreamFromFD(I);return fe.llseek(Be,Ie,oe),We=[Be.position>>>0,(ke=Be.position,+Math.abs(ke)>=1?ke>0?+Math.floor(ke/4294967296)>>>0:~~+Math.ceil((ke-+(~~ke>>>0))/4294967296)>>>0:0)],A[Ee>>2]=We[0],A[Ee+4>>2]=We[1],Be.getdents&&Ie===0&&oe===0&&(Be.getdents=null),0}catch(Ve){if(typeof fe>"u"||Ve.name!=="ErrnoError")throw Ve;return Ve.errno}}var Ql=(I,V,Q,oe)=>{for(var Ee=0,Ie=0;Ie>2],Ve=F[V+4>>2];V+=8;var et=fe.write(I,x,Be,Ve,oe);if(et<0)return-1;Ee+=et,typeof oe<"u"&&(oe+=et)}return Ee};function Cm(I,V,Q,oe){try{var Ee=vn.getStreamFromFD(I),Ie=Ql(Ee,V,Q);return F[oe>>2]=Ie,0}catch(Be){if(typeof fe>"u"||Be.name!=="ErrnoError")throw Be;return Be.errno}}var Jl=I=>I%4===0&&(I%100!==0||I%400===0),Lm=(I,V)=>{for(var Q=0,oe=0;oe<=V;Q+=I[oe++]);return Q},Ao=[31,29,31,30,31,30,31,31,30,31,30,31],Er=[31,28,31,30,31,30,31,31,30,31,30,31],Qd=(I,V)=>{for(var Q=new Date(I.getTime());V>0;){var oe=Jl(Q.getFullYear()),Ee=Q.getMonth(),Ie=(oe?Ao:Er)[Ee];if(V>Ie-Q.getDate())V-=Ie-Q.getDate()+1,Q.setDate(1),Ee<11?Q.setMonth(Ee+1):(Q.setMonth(0),Q.setFullYear(Q.getFullYear()+1));else return Q.setDate(Q.getDate()+V),Q}return Q},Jd=(I,V)=>{w(I.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),x.set(I,V)},Am=(I,V,Q,oe)=>{var Ee=F[oe+40>>2],Ie={tm_sec:A[oe>>2],tm_min:A[oe+4>>2],tm_hour:A[oe+8>>2],tm_mday:A[oe+12>>2],tm_mon:A[oe+16>>2],tm_year:A[oe+20>>2],tm_wday:A[oe+24>>2],tm_yday:A[oe+28>>2],tm_isdst:A[oe+32>>2],tm_gmtoff:A[oe+36>>2],tm_zone:Ee?qt(Ee):""},Be=qt(Q),Ve={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var et in Ve)Be=Be.replace(new RegExp(et,"g"),Ve[et]);var rt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],st=["January","February","March","April","May","June","July","August","September","October","November","December"];function gt(ut,Ct,Gn){for(var wn=typeof ut=="number"?ut.toString():ut||"";wn.length0?1:0}var wn;return(wn=Gn(ut.getFullYear()-Ct.getFullYear()))===0&&(wn=Gn(ut.getMonth()-Ct.getMonth()))===0&&(wn=Gn(ut.getDate()-Ct.getDate())),wn}function St(ut){switch(ut.getDay()){case 0:return new Date(ut.getFullYear()-1,11,29);case 1:return ut;case 2:return new Date(ut.getFullYear(),0,3);case 3:return new Date(ut.getFullYear(),0,2);case 4:return new Date(ut.getFullYear(),0,1);case 5:return new Date(ut.getFullYear()-1,11,31);case 6:return new Date(ut.getFullYear()-1,11,30)}}function Wt(ut){var Ct=Qd(new Date(ut.tm_year+1900,0,1),ut.tm_yday),Gn=new Date(Ct.getFullYear(),0,4),wn=new Date(Ct.getFullYear()+1,0,4),_i=St(Gn),Jt=St(wn);return xt(_i,Ct)<=0?xt(Jt,Ct)<=0?Ct.getFullYear()+1:Ct.getFullYear():Ct.getFullYear()-1}var Yt={"%a":ut=>rt[ut.tm_wday].substring(0,3),"%A":ut=>rt[ut.tm_wday],"%b":ut=>st[ut.tm_mon].substring(0,3),"%B":ut=>st[ut.tm_mon],"%C":ut=>{var Ct=ut.tm_year+1900;return yt(Ct/100|0,2)},"%d":ut=>yt(ut.tm_mday,2),"%e":ut=>gt(ut.tm_mday,2," "),"%g":ut=>Wt(ut).toString().substring(2),"%G":Wt,"%H":ut=>yt(ut.tm_hour,2),"%I":ut=>{var Ct=ut.tm_hour;return Ct==0?Ct=12:Ct>12&&(Ct-=12),yt(Ct,2)},"%j":ut=>yt(ut.tm_mday+Lm(Jl(ut.tm_year+1900)?Ao:Er,ut.tm_mon-1),3),"%m":ut=>yt(ut.tm_mon+1,2),"%M":ut=>yt(ut.tm_min,2),"%n":()=>` +`,"%p":ut=>ut.tm_hour>=0&&ut.tm_hour<12?"AM":"PM","%S":ut=>yt(ut.tm_sec,2),"%t":()=>" ","%u":ut=>ut.tm_wday||7,"%U":ut=>{var Ct=ut.tm_yday+7-ut.tm_wday;return yt(Math.floor(Ct/7),2)},"%V":ut=>{var Ct=Math.floor((ut.tm_yday+7-(ut.tm_wday+6)%7)/7);if((ut.tm_wday+371-ut.tm_yday-2)%7<=2&&Ct++,Ct){if(Ct==53){var wn=(ut.tm_wday+371-ut.tm_yday)%7;wn!=4&&(wn!=3||!Jl(ut.tm_year))&&(Ct=1)}}else{Ct=52;var Gn=(ut.tm_wday+7-ut.tm_yday-1)%7;(Gn==4||Gn==5&&Jl(ut.tm_year%400-1))&&Ct++}return yt(Ct,2)},"%w":ut=>ut.tm_wday,"%W":ut=>{var Ct=ut.tm_yday+7-(ut.tm_wday+6)%7;return yt(Math.floor(Ct/7),2)},"%y":ut=>(ut.tm_year+1900).toString().substring(2),"%Y":ut=>ut.tm_year+1900,"%z":ut=>{var Ct=ut.tm_gmtoff,Gn=Ct>=0;return Ct=Math.abs(Ct)/60,Ct=Ct/60*100+Ct%60,(Gn?"+":"-")+("0000"+Ct).slice(-4)},"%Z":ut=>ut.tm_zone,"%%":()=>"%"};Be=Be.replace(/%%/g,"\0\0");for(var et in Yt)Be.includes(et)&&(Be=Be.replace(new RegExp(et,"g"),Yt[et](Ie)));Be=Be.replace(/\0\0/g,"%");var Sn=Li(Be,!1);return Sn.length>V?0:(Jd(Sn,I),Sn.length-1)},Rm=(I,V,Q,oe,Ee)=>Am(I,V,Q,oe),Im=I=>{var V=n["_"+I];return w(V,"Cannot call unknown function "+I+", make sure it is exported"),V},Nm=I=>{var V=An(I)+1,Q=il(V);return $d(I,Q,V),Q},Ro=(I,V,Q,oe,Ee)=>{var Ie={string:St=>{var Wt=0;return St!=null&&St!==0&&(Wt=Nm(St)),Wt},array:St=>{var Wt=il(St.length);return Jd(St,Wt),Wt}};function Be(St){return V==="string"?qt(St):V==="boolean"?!!St:St}var Ve=Im(I),et=[],rt=0;if(w(V!=="array",'Return type should not be "array".'),oe)for(var st=0;stfunction(){return Ro(I,V,Q,arguments)},nt=function(I,V,Q,oe){I||(I=this),this.parent=I,this.mount=I.mount,this.mounted=null,this.id=fe.nextInode++,this.name=V,this.mode=Q,this.node_ops={},this.stream_ops={},this.rdev=oe},tt=365,Pt=146;Object.defineProperties(nt.prototype,{read:{get:function(){return(this.mode&tt)===tt},set:function(I){I?this.mode|=tt:this.mode&=~tt}},write:{get:function(){return(this.mode&Pt)===Pt},set:function(I){I?this.mode|=Pt:this.mode&=~Pt}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=nt,fe.createPreloadedFile=Dr,fe.staticInit(),n.FS_createPath=fe.createPath,n.FS_createDataFile=fe.createDataFile,n.FS_createPreloadedFile=fe.createPreloadedFile,n.FS_unlink=fe.unlink,n.FS_createLazyFile=fe.createLazyFile,n.FS_createDevice=fe.createDevice,pr(),Rs=n.BindingError=class extends Error{constructor(V){super(V),this.name="BindingError"}},jl=n.InternalError=class extends Error{constructor(V){super(V),this.name="InternalError"}},pt(),Ce(),pn(),no=n.UnboundTypeError=Lc(Error,"UnboundTypeError"),Rc();function Xt(){Ye("fetchSettings")}var yn={__assert_fail:li,__cxa_throw:hr,__syscall_fcntl64:Qt,__syscall_ioctl:Gt,__syscall_openat:Xn,_embind_register_bigint:$l,_embind_register_bool:Is,_embind_register_class:yr,_embind_register_class_constructor:tr,_embind_register_class_function:vr,_embind_register_emval:bm,_embind_register_float:vm,_embind_register_function:Sm,_embind_register_integer:ql,_embind_register_memory_view:ua,_embind_register_std_string:jd,_embind_register_std_wstring:xm,_embind_register_void:Xd,abort:nr,emscripten_memcpy_js:Dc,emscripten_resize_heap:Kd,environ_get:Tm,environ_sizes_get:ca,fd_close:Pm,fd_read:Gc,fd_seek:so,fd_write:Cm,strftime_l:Rm},Bn=Qe(),Cn=ce("malloc"),ss=ce("free"),km=ce("__getTypeName"),xr=ce("fflush"),nl=()=>(nl=Bn.emscripten_stack_init)(),Wc=()=>(Wc=Bn.emscripten_stack_get_end)(),ha=ce("stackSave"),Zl=ce("stackRestore"),il=ce("stackAlloc"),Tn=ce("__cxa_is_pointer_type");n.dynCall_jiji=ce("dynCall_jiji"),n.dynCall_viijii=ce("dynCall_viijii"),n.dynCall_iiiiij=ce("dynCall_iiiiij"),n.dynCall_iiiiijj=ce("dynCall_iiiiijj"),n.dynCall_iiiiiijj=ce("dynCall_iiiiiijj"),n.addRunDependency=O,n.removeRunDependency=z,n.FS_createPath=fe.createPath,n.FS_createLazyFile=fe.createLazyFile,n.FS_createDevice=fe.createDevice,n.ccall=Ro,n.cwrap=je,n.FS_createPreloadedFile=fe.createPreloadedFile,n.FS=fe,n.FS_createDataFile=fe.createDataFile,n.FS_unlink=fe.unlink;var Om=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","exitJS","ydayFromDate","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","getFunctionArgsName","requireRegisteredType","registerInheritedInstance","unregisterInheritedInstance","enumReadValueFromPointer","validateThis","getStringOrSymbol","emval_get_global","emval_returnValue","emval_lookupTypes","emval_addMethodCaller"];Om.forEach(ht);var Zd=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","convertI32PairToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","jstoi_s","getExecutableName","dynCallLegacy","getDynCaller","dynCall","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","wasmTable","noExitRuntime","getCFunc","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","Browser","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","char_0","char_9","makeLegalFunctionName","emval_handles","emval_symbols","init_emval","count_emval_handles","Emval","emval_methodCallers","reflectConstruct"];Zd.forEach(vt);var Io;X=function I(){Io||ef(),Io||(X=I)};function Fm(){nl(),W()}function ef(){if(ye>0||(Fm(),re(),ye>0))return;function I(){Io||(Io=!0,n.calledRun=!0,!P&&(be(),s(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),w(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),ae()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),I()},1)):I(),G()}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return ef(),t.ready}})();function tp(e){return e<26?e+65:e<52?e+71:e<62?e-4:e===62?43:e===63?47:65}function HG(e){let t=2,n="";for(let s=e.length,m=0,b=0;b0&&b*4/3%76===0&&(n+=`\r +`),m|=e[b]<<(16>>>t&24),(t===2||e.length-b===1)&&(n+=String.fromCharCode(tp(m>>>18&63),tp(m>>>12&63),tp(m>>>6&63),tp(m&63)),m=0);return n.substring(0,n.length-2+t)+(t===2?"":t===1?"=":"==")}const XG="voices/";var H6=(e=>(e.air="air",e.cicada="cicada",e.quake="quake",e))(H6||{});const YG=()=>{const[e,t]=si.useState(!1),[n,s]=si.useState(H6.air),[m,b]=si.useState(null);si.useEffect(()=>{(async()=>b(await jG()))()},[]),si.useEffect(()=>{m&&(m==null||m.FS.mkdir("/voices/"),t(!0))},[m]);const{data:o,isLoading:r,error:u}=dM({queryKey:["oddVoices",n],queryFn:async()=>{if(!m||!n)return;const c=await(await fetch(`${XG}${n}.voice`)).arrayBuffer(),l=`/voices/${n}.voice`;m.FS.writeFile(l,new Uint8Array(c));const h=new m.Voice;return h.initFromFile(l),h},enabled:!!(e&&n&&m),retry:!1}),a=g=>{if(!m){console.error("OddVoice app not initialized");return}if(!o){console.error("Voice data not loaded");return}const c=m.sing(o,JSON.stringify(g),"out.wav","");if(c!==""){console.error(c);return}const l=m.FS.readFile("out.wav");if(!l||l.length===0){console.error("No buffer");return}return l};return u&&console.error(u),{isLoadingApp:!m,isLoadingVoice:r,generateVoiceFromOddVoiceJson:a,activeVoice:n,setActiveVoice:s,voiceLoadingFailed:!r&&!o}};var yy={},KG=Po;Object.defineProperty(yy,"__esModule",{value:!0});var X6=yy.default=void 0,qG=KG(Mo()),QG=Re;X6=yy.default=(0,qG.default)((0,QG.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var vy={},JG=Po;Object.defineProperty(vy,"__esModule",{value:!0});var Y6=vy.default=void 0,ZG=JG(Mo()),eW=Re;Y6=vy.default=(0,ZG.default)((0,eW.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause");var Sy={},tW=Po;Object.defineProperty(Sy,"__esModule",{value:!0});var K6=Sy.default=void 0,nW=tW(Mo()),iW=Re;K6=Sy.default=(0,nW.default)((0,iW.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");const rW=()=>{const[e,t]=si.useState(0);return Re.jsxs(kG,{size:"small",exclusive:!0,onChange:(n,s)=>{const m=document.querySelectorAll("audio");Lt.forEach(m,b=>{s==="play"?b.play():s==="pause"?b.pause():s==="stop"?(b.pause(),b.currentTime=0):s==="jump"&&Lt.forEach(m,o=>{o.currentTime=e})})},"aria-label":"text formatting",children:[Re.jsx(ep,{value:"play","aria-label":"italic",children:Re.jsx(X6,{})}),Re.jsx(ep,{value:"pause","aria-label":"underlined",children:Re.jsx(Y6,{})}),Re.jsx(ep,{value:"stop","aria-label":"color",children:Re.jsx(K6,{})}),Re.jsx(ep,{value:"jump","aria-label":"color",children:"Jump to"}),Re.jsx(bG,{type:"number",value:e,placeholder:"Enter time in seconds",onChange:n=>{t(Number(n.target.value))},inputProps:{min:0,step:1}})]})};var Ey={},sW=Po;Object.defineProperty(Ey,"__esModule",{value:!0});var q6=Ey.default=void 0,oW=sW(Mo()),aW=Re;q6=Ey.default=(0,oW.default)((0,aW.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");var Uo=(e=>(e.SetFrequencyImmediate="setFrequencyImmediate",e.SetTargetFrequency="setTargetFrequency",e.NoteOn="noteOn",e.NoteOff="noteOff",e.SetFormantShift="setFormantShift",e.SetPhonemeSpeed="setPhonemeSpeed",e.Empty="empty",e))(Uo||{});const Sa=({eventType:e,time:t,frequency:n=0,formantShift:s=1,phonemeSpeed:m=1})=>({type:e,time:t,frequency:n,formantShift:s,phonemeSpeed:m}),lW={C:0,D:2,E:4,F:5,G:7,A:9,B:11};var xy={},pm={};(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+t+"]["+n+"]*",m=new RegExp("^"+s+"$"),b=function(r,u){const a=[];let g=u.exec(r);for(;g;){const c=[];c.startIndex=u.lastIndex-g[0].length;const l=g.length;for(let h=0;h"u")};e.isExist=function(r){return typeof r<"u"},e.isEmptyObject=function(r){return Object.keys(r).length===0},e.merge=function(r,u,a){if(u){const g=Object.keys(u),c=g.length;for(let l=0;l"&&e[b]!==" "&&e[b]!==" "&&e[b]!==` +`&&e[b]!=="\r";b++)u+=e[b];if(u=u.trim(),u[u.length-1]==="/"&&(u=u.substring(0,u.length-1),b--),!bW(u)){let c;return u.trim().length===0?c="Invalid space after '<'.":c="Tag '"+u+"' is an invalid name.",Ei("InvalidTag",c,Mr(e,b))}const a=dW(e,b);if(a===!1)return Ei("InvalidAttr","Attributes for '"+u+"' have open quote.",Mr(e,b));let g=a.value;if(b=a.index,g[g.length-1]==="/"){const c=b-g.length;g=g.substring(0,g.length-1);const l=$S(g,t);if(l===!0)s=!0;else return Ei(l.err.code,l.err.msg,Mr(e,c+l.err.line))}else if(r)if(a.tagClosed){if(g.trim().length>0)return Ei("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",Mr(e,o));{const c=n.pop();if(u!==c.tagName){let l=Mr(e,c.tagStartPos);return Ei("InvalidTag","Expected closing tag '"+c.tagName+"' (opened in line "+l.line+", col "+l.col+") instead of closing tag '"+u+"'.",Mr(e,o))}n.length==0&&(m=!0)}}else return Ei("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",Mr(e,b));else{const c=$S(g,t);if(c!==!0)return Ei(c.err.code,c.err.msg,Mr(e,b-g.length+c.err.line));if(m===!0)return Ei("InvalidXml","Multiple possible root nodes found.",Mr(e,b));t.unpairedTags.indexOf(u)!==-1||n.push({tagName:u,tagStartPos:o}),s=!0}for(b++;b0)return Ei("InvalidXml","Invalid '"+JSON.stringify(n.map(b=>b.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ei("InvalidXml","Start tag expected.",1);return!0};function WS(e){return e===" "||e===" "||e===` +`||e==="\r"}function zS(e,t){const n=t;for(;t5&&s==="xml")return Ei("InvalidXml","XML declaration allowed only at the start of the document.",Mr(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function US(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}const cW='"',hW="'";function dW(e,t){let n="",s="",m=!1;for(;t"&&s===""){m=!0;break}n+=e[t]}return s!==""?!1:{value:n,index:t,tagClosed:m}}const fW=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $S(e,t){const n=wy.getAllMatches(e,fW),s={};for(let m=0;m!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}},yW=function(e){return Object.assign({},Q6,e)};_y.buildOptions=yW;_y.defaultOptions=Q6;class vW{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var SW=vW;const EW=pm;function xW(e,t){const n={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,m=!1,b=!1,o="";for(;t"){if(b?e[t-1]==="-"&&e[t-2]==="-"&&(b=!1,s--):s--,s===0)break}else e[t]==="["?m=!0:o+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:t}}function wW(e,t){let n="";for(;t0&&m&&n[2]!==".")return e;if(!t.leadingZeros&&b.length>0&&!m&&n[1]!==".")return e;{const u=Number(n),a=""+u;return a.search(/[eE]/)!==-1||r?t.eNotation?u:e:n.indexOf(".")!==-1?a==="0"&&o===""||a===o||m&&a==="-"+o?u:e:b?o===a||m+o===a?u:e:n===a||n===m+a?u:e}}else return e}}function OW(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}var FW=kW;const J6=pm,yh=SW,BW=AW,DW=FW;let VW=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=GW,this.parseXml=jW,this.parseTextData=WW,this.resolveNameSpace=zW,this.buildAttributesMap=$W,this.isItStopNode=KW,this.replaceEntitiesValue=XW,this.readStopNodeData=QW,this.saveTextToParentTag=YW,this.addChild=HW}};function GW(e){const t=Object.keys(e);for(let n=0;n0)){o||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,m,b);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues?B2(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?B2(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function zW(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const UW=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function $W(e,t,n){if(!this.options.ignoreAttributes&&typeof e=="string"){const s=J6.getAllMatches(e,UW),m=s.length,b={};for(let o=0;o",b,"Closing Tag is not closed.");let u=e.substring(b+2,r).trim();if(this.options.removeNSPrefix){const c=u.indexOf(":");c!==-1&&(u=u.substr(c+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&(s=this.saveTextToParentTag(s,n,m));const a=m.substring(m.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let g=0;a&&this.options.unpairedTags.indexOf(a)!==-1?(g=m.lastIndexOf(".",m.lastIndexOf(".")-1),this.tagsNodeStack.pop()):g=m.lastIndexOf("."),m=m.substring(0,g),n=this.tagsNodeStack.pop(),s="",b=r}else if(e[b+1]==="?"){let r=F2(e,b,!1,"?>");if(!r)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,n,m),!(this.options.ignoreDeclaration&&r.tagName==="?xml"||this.options.ignorePiTags)){const u=new yh(r.tagName);u.add(this.options.textNodeName,""),r.tagName!==r.tagExp&&r.attrExpPresent&&(u[":@"]=this.buildAttributesMap(r.tagExp,m,r.tagName)),this.addChild(n,u,m)}b=r.closeIndex+1}else if(e.substr(b+1,3)==="!--"){const r=El(e,"-->",b+4,"Comment is not closed.");if(this.options.commentPropName){const u=e.substring(b+4,r-2);s=this.saveTextToParentTag(s,n,m),n.add(this.options.commentPropName,[{[this.options.textNodeName]:u}])}b=r}else if(e.substr(b+1,2)==="!D"){const r=BW(e,b);this.docTypeEntities=r.entities,b=r.i}else if(e.substr(b+1,2)==="!["){const r=El(e,"]]>",b,"CDATA is not closed.")-2,u=e.substring(b+9,r);if(s=this.saveTextToParentTag(s,n,m),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:u}]);else{let a=this.parseTextData(u,n.tagname,m,!0,!1,!0);a==null&&(a=""),n.add(this.options.textNodeName,a)}b=r+2}else{let r=F2(e,b,this.options.removeNSPrefix),u=r.tagName;const a=r.rawTagName;let g=r.tagExp,c=r.attrExpPresent,l=r.closeIndex;this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&s&&n.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,n,m,!1));const h=n;if(h&&this.options.unpairedTags.indexOf(h.tagname)!==-1&&(n=this.tagsNodeStack.pop(),m=m.substring(0,m.lastIndexOf("."))),u!==t.tagname&&(m+=m?"."+u:u),this.isItStopNode(this.options.stopNodes,m,u)){let d="";if(g.length>0&&g.lastIndexOf("/")===g.length-1)b=r.closeIndex;else if(this.options.unpairedTags.indexOf(u)!==-1)b=r.closeIndex;else{const f=this.readStopNodeData(e,a,l+1);if(!f)throw new Error(`Unexpected end of ${a}`);b=f.i,d=f.tagContent}const E=new yh(u);u!==g&&c&&(E[":@"]=this.buildAttributesMap(g,m,u)),d&&(d=this.parseTextData(d,u,m,!0,c,!0,!0)),m=m.substr(0,m.lastIndexOf(".")),E.add(this.options.textNodeName,d),this.addChild(n,E,m)}else{if(g.length>0&&g.lastIndexOf("/")===g.length-1){u[u.length-1]==="/"?(u=u.substr(0,u.length-1),m=m.substr(0,m.length-1),g=u):g=g.substr(0,g.length-1),this.options.transformTagName&&(u=this.options.transformTagName(u));const d=new yh(u);u!==g&&c&&(d[":@"]=this.buildAttributesMap(g,m,u)),this.addChild(n,d,m),m=m.substr(0,m.lastIndexOf("."))}else{const d=new yh(u);this.tagsNodeStack.push(n),u!==g&&c&&(d[":@"]=this.buildAttributesMap(g,m,u)),this.addChild(n,d,m),n=d}s="",b=l}}else s+=e[b];return t.child};function HW(e,t,n){const s=this.options.updateTag(t.tagname,n,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t))}const XW=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function YW(e,t,n,s){return e&&(s===void 0&&(s=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function KW(e,t,n){const s="*."+n;for(const m in e){const b=e[m];if(s===b||t===b)return!0}return!1}function qW(e,t,n=">"){let s,m="";for(let b=t;b",n,`${t} is not closed`);if(e.substring(n+2,b).trim()===t&&(m--,m===0))return{tagContent:e.substring(s,n),i:b};n=b}else if(e[n+1]==="?")n=El(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=El(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=El(e,"]]>",n,"StopNode is not closed.")-2;else{const b=F2(e,n,">");b&&((b&&b.tagName)===t&&b.tagExp[b.tagExp.length-1]!=="/"&&m++,n=b.closeIndex)}}function B2(e,t,n){if(t&&typeof e=="string"){const s=e.trim();return s==="true"?!0:s==="false"?!1:DW(e,n)}else return J6.isExist(e)?e:""}var JW=VW,Z6={};function ZW(e,t){return e7(e,t)}function e7(e,t,n){let s;const m={};for(let b=0;b0&&(m[t.textNodeName]=s):s!==void 0&&(m[t.textNodeName]=s),m}function ez(e){const t=Object.keys(e);for(let n=0;n0&&(n=uz),t7(e,t,"",n)}function t7(e,t,n,s){let m="",b=!1;for(let o=0;o`,b=!1;continue}else if(u===t.commentPropName){m+=s+``,b=!0;continue}else if(u[0]==="?"){const d=jS(r[":@"],t),E=u==="?xml"?"":s;let f=r[u][0][t.textNodeName];f=f.length!==0?" "+f:"",m+=E+`<${u}${f}${d}?>`,b=!0;continue}let g=s;g!==""&&(g+=t.indentBy);const c=jS(r[":@"],t),l=s+`<${u}${c}`,h=t7(r[u],t,a,g);t.unpairedTags.indexOf(u)!==-1?t.suppressUnpairedNode?m+=l+">":m+=l+"/>":(!h||h.length===0)&&t.suppressEmptyNode?m+=l+"/>":h&&h.endsWith(">")?m+=l+`>${h}${s}`:(m+=l+">",h&&s!==""&&(h.includes("/>")||h.includes("`),b=!0}return m}function hz(e){const t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Za(e){this.options=Object.assign({},mz,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=yz),this.processTextOrObjNode=gz,this.options.format?(this.indentate=bz,this.tagEndChar=`> +`,this.newLine=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Za.prototype.build=function(e){return this.options.preserveOrder?pz(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};Za.prototype.j2x=function(e,t){let n="",s="";for(let m in e)if(Object.prototype.hasOwnProperty.call(e,m))if(typeof e[m]>"u")this.isAttribute(m)&&(s+="");else if(e[m]===null)this.isAttribute(m)?s+="":m[0]==="?"?s+=this.indentate(t)+"<"+m+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+m+"/"+this.tagEndChar;else if(e[m]instanceof Date)s+=this.buildTextValNode(e[m],m,"",t);else if(typeof e[m]!="object"){const b=this.isAttribute(m);if(b)n+=this.buildAttrPairStr(b,""+e[m]);else if(m===this.options.textNodeName){let o=this.options.tagValueProcessor(m,""+e[m]);s+=this.replaceEntitiesValue(o)}else s+=this.buildTextValNode(e[m],m,"",t)}else if(Array.isArray(e[m])){const b=e[m].length;let o="";for(let r=0;r"u"||(u===null?m[0]==="?"?s+=this.indentate(t)+"<"+m+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+m+"/"+this.tagEndChar:typeof u=="object"?this.options.oneListGroup?o+=this.j2x(u,t+1).val:o+=this.processTextOrObjNode(u,m,t):o+=this.buildTextValNode(u,m,"",t))}this.options.oneListGroup&&(o=this.buildObjectNode(o,m,"",t)),s+=o}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const b=Object.keys(e[m]),o=b.length;for(let r=0;r"+e+m:this.options.commentPropName!==!1&&t===this.options.commentPropName&&b.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+t+n+b+this.tagEndChar+e+this.indentate(s)+m}};Za.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+n+"?"+this.tagEndChar;{let m=this.options.tagValueProcessor(t,e);return m=this.replaceEntitiesValue(m),m===""?this.indentate(s)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+n+">"+m+"0&&this.options.processEntities)for(let t=0;tLt.includes(["part","score-part","measure","credit","note"],e),trimValues:!0,preserveOrder:!0};function Tz(e){try{return new wz.XMLParser(_z).parse(e)}catch(t){throw new Error(`Error reading XML: ${t}`)}}const qs=e=>{if(!e||!Lt.isPlainObject(e))return!1;const t=Lt.filter(Lt.keys(e),n=>n!==":@");return t.length===1&&Lt.isArray(e[Lt.first(t)])},Xs=e=>qs(e)?Lt.first(Lt.filter(Lt.keys(e),t=>t!==":@")):void 0,qo=e=>{const t=Xs(e);return t?e[t]:[]},Qn=(e,t)=>{if(!qs(e))return;const n=qo(e);return Lt.find(n,s=>Xs(s)===t)},Yr=e=>{var n;if(!qs(e))return;const t=qo(e);return(n=Lt.find(t,s=>!!s["#text"]))==null?void 0:n["#text"]},Ty=(e,t)=>{var n;if(qs(e))return(n=e[":@"])==null?void 0:n[t]},vo=(e,t)=>{if(!qs(e))return[];const n=qo(e);return Lt.filter(n,s=>!!(s!=null&&s[t]))},Pz=120;class Mz{constructor(t,n,s,m){this.partName=t,this.partIdx=n,this.voices=s,this.largestChordPerVoice=m}}function Cz(e){const t=Qn(e,"part-list"),n=vo(t,"score-part");return Lt.compact(Lt.map(n,s=>Yr(Qn(s,"part-name"))))}const Lz=e=>{const t=qo(e),n=Lt.first(t),s=Qn(n,"attributes"),m=Qn(s,"clef"),b=Qn(m,"sign");return Yr(b)};function Az(e){const t=Cz(e),n=vo(e,"part"),s=[];for(let m=0;mLt.map(vo(c,"note"),l=>Yr(Qn(l,"voice"))))));if(a.length===0){console.log(`Found no voices in part ${b}`);continue}const g=Lt.times(a.length,()=>1);for(let c=0;cqs(e)&&Xs(e)==="measure",i7=e=>qs(e)&&Xs(e)==="attributes",r7=e=>qs(e)&&Xs(e)==="direction",n1=e=>qs(e)&&Xs(e)==="note",Oz=e=>qs(e)&&Xs(e)==="lyric",Fz=["","-","_","..."],Bz=["a","e","i","o","u","h"],Dz=({measureChild:e,timeElapsed:t,currentDivisions:n,currentTempo:s,partIdx:m,partName:b,measureIdx:o})=>{const r=[];if(i7(e)){const u=Qn(e,"divisions"),a=Yr(u);a&&(console.info(`Found new divisions ${a}`),n=parseInt(a,10),r.push({time:t,partIdx:m,partName:b,measureIdx:o,tempo:s,divisions:n}))}else if(r7(e)){console.info("Looking for tempo changes in measure direction");const u=vo(e,"sound"),a=Lt.compact(Lt.map(u,g=>{const c=Ty(g,"tempo");return c?parseFloat(c):null}));a.length>0&&(console.info(`Found new tempo ${Lt.last(a)}`),s=Lt.last(a),r.push({time:t,partIdx:m,partName:b,measureIdx:o,tempo:s,divisions:n}))}return{newTempoEvents:r,newTempo:s,newDivisions:n}},Vz=e=>{var g,c,l;const t=e[1],n=Qn(t,"part-list");if(!n)throw new Error("Could not find part-list");const s=Lt.compact(Lt.map(vo(n,"score-part"),h=>{const d=Qn(h,"part-name");return d?Yr(d):void 0})),m=vo(t,"part"),b=Lt.map(m,h=>vo(h,"measure")),o=[],r=[],u=[],a=Math.max(...Lt.map(b,h=>h.length));for(let h=0;h{const S=(f?qo(f):[])[h];if(S&&qs(S)){const _=vo(S,"sound");return Lt.some(_,P=>Ty(P,"tempo"))}return!1}),E=Lt.sortBy(Lt.times(s.length),f=>d[f]?0:1);for(const f of E){const y=s[f],S=(g=b[f])==null?void 0:g[h],_=qo(S),P=Math.max(...Lt.compact(Lt.map(Lt.filter(r,F=>F.partIdx===f&&F.measureIdxNumber(F??0)+Number(U??0))),0),w={};let x=((c=Lt.findLast(o,F=>F.measureIdx<=h&&!isNaN(Number(F.tempo))))==null?void 0:c.divisions)??1,M=1,N=((l=Lt.findLast(o,F=>F.measureIdx<=h&&!isNaN(Number(F.tempo))))==null?void 0:l.tempo)??Pz;const R={};let A=1;Lt.forEach(_,(F,U)=>{var W,G,H,L,$,ie;const Y=Qn(F,"voice"),k=Yr(Y);if(k&&(M=parseInt(k,10)),i7(F)||r7(F)){const re=((W=w==null?void 0:w[f])==null?void 0:W[M])??P,{newTempoEvents:be,newTempo:ae,newDivisions:ge}=Dz({measureChild:F,timeElapsed:re,currentDivisions:x,currentTempo:N,partIdx:f,partName:y,measureIdx:h});o.push(...be),N=ae,x=ge}else{if(Qn(F,"chord"))A+=1;else{A=1;const ge=((G=w==null?void 0:w[f])==null?void 0:G[M])??P,le=((H=R==null?void 0:R[f])==null?void 0:H[M])??0;w[f]=(w==null?void 0:w[f])||{},w[f][M]=ge+le,R[f]=(R==null?void 0:R[f])||{},R[f][M]=0}const be=Qn(F,"duration"),ae=Yr(be);if(!n1(F)||Qn(F,"rest")){console.log("Not a note / is a rest",{measureChild:F,measureChildIdx:U});const ge=Qn(F,"duration");if(ge){if(!ae)throw new Error(`No duration text content: ${JSON.stringify(ge)}`);const le=Xs(F)==="backup",Z=parseFloat(ae)*(le?-1:1),ye=HS(Z,x,N),Se=((L=w==null?void 0:w[f])==null?void 0:L[M])??P;r.push({time:Se,partIdx:f,partName:y,measureIdx:h,voice:M,chordLevel:A,eventSeconds:ye,isRest:!0}),w[f]=(w==null?void 0:w[f])||{},w[f][M]=Se+ye}}else{if(!n1(F))throw new Error(`Unexpected measure child: ${JSON.stringify(F)}`);const ge=Lt.findLastIndex(u,pe=>!pe.continuesPrevious&&pe.partIdx===f&&pe.voice===h),le=ge!==-1,Z=le?-1:Lt.findLastIndex(u,pe=>!pe.continuesPrevious&&pe.partIdx===f),Se=le?Lt.filter(Lt.slice(u,ge!==-1?ge:Z),pe=>pe.partIdx===f&&pe.voice===M):Z!==-1?Lt.filter(Lt.slice(u,Z),pe=>pe.partIdx===f):[],X=Lt.reduce(Se,(pe,we)=>(pe+(we.continuesPrevious?"":" ")+we.lyric).trim(),"");let ee="";const ne=(($=w==null?void 0:w[f])==null?void 0:$[M])??P;Lt.forEach(qo(F),pe=>{var qe;if(!Oz(pe))return;const we=Qn(pe,"text");if(!we){console.log("No text in the lyric",{lyricEl:pe});return}const Me=((qe=Yr(we))==null?void 0:qe.trim())??"";if(!Me||Fz.includes(Me)){console.log("Lyrics continues previous",{lyricEl:pe,newTextString:Me});return}if(!X){ee+=Me,console.log("First lyric",{lyricEl:pe,newTextString:Me,newLyricText:ee}),u.push({time:ne,partIdx:f,partName:y,measureIdx:h,voice:M,chordLevel:A,lyric:Me,continuesPrevious:!1});return}const ze=Qn(pe,"syllabic"),De=Yr(ze);if(!De||De==="single"||De==="begin"||!Lt.includes(Bz,Me[0])){ee+=` ${Me}`,console.log("Adding new syllable",{lyricEl:pe,newTextString:Me,newLyricText:ee}),u.push({time:ne,partIdx:f,partName:y,measureIdx:h,voice:M,chordLevel:A,lyric:Me,continuesPrevious:!1});return}const Qe=Lt.last(X);let ke=Me.length;for(let Ye=0;Ye{const n={lyrics:"",events:[]},s=Lt.filter(t,b=>b.partIdx===e.partIdx&&b.voice===e.voice&&b.chordLevel===e.chordLvl);n.lyrics=Lt.map(s,b=>b.lyrics??"").join("").trim(),n.events=Lt.flatMap(s,(b,o)=>{const{time:r,frequency:u,lyricsChanged:a,isStaccato:g,eventSeconds:c,isRest:l}=b,h=[];return l?(h.push(Sa({eventType:Uo.NoteOff,time:r})),h.push(Sa({eventType:Uo.Empty,time:r}))):(a&&(console.log("Found new lyrics"),h.push(Sa({eventType:Uo.NoteOff,time:r}))),h.push(Sa({eventType:Uo.SetTargetFrequency,time:r,frequency:u})),a&&(h.push(Sa({eventType:Uo.NoteOn,time:r})),g&&(h.push(Sa({eventType:Uo.SetPhonemeSpeed,time:r,phonemeSpeed:1.5})),h.push(Sa({eventType:Uo.SetPhonemeSpeed,time:r+(c??0),phonemeSpeed:1}))))),console.log({noteEvent:b,noteEventIdx:o,newEvents:h}),h});const m=Lt.last(s);return m&&(m.isRest||n.events.push(Sa({eventType:Uo.NoteOff,time:m.time+(m.eventSeconds??0)}))),n},Wz=e=>{const t=e[1],n=Az(t),s=Lt.flatMap(n,b=>Lt.flatMap(b.voices,(o,r)=>Lt.times(b.largestChordPerVoice[r],u=>({partIdx:b.partIdx,partName:b.partName,voice:o,chordLvl:u+1,largestChordLvl:b.largestChordPerVoice[r],numVoices:b.voices.length})))),m=Vz(e);return Lt.map(s,b=>({splitParams:b,output:Gz({splitParams:b,...m}),unparsedPartEvents:{tempoEvents:m==null?void 0:m.tempoEvents,noteEvents:Lt.filter(m==null?void 0:m.noteEvents,o=>o.partIdx===b.partIdx&&o.voice===b.voice&&o.chordLevel===b.chordLvl),lyricsEvents:Lt.filter(m==null?void 0:m.lyricsEvents,o=>o.partIdx===b.partIdx&&o.voice===b.voice&&o.chordLevel===b.chordLvl)}}))},zz=Mt("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1}),Uz=({isLoadingVoice:e,generateVoiceFromOddVoiceJson:t,setIsGeneratingAudio:n,setOddVoiceOutputs:s,setAudioOutputs:m,setRawFile:b})=>{const[,o]=si.useTransition();return Re.jsxs(jF,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:Re.jsx(q6,{}),disabled:e,children:["Upload file",Re.jsx(zz,{type:"file",onChange:r=>{var g,c;const u=(c=(g=r==null?void 0:r.target)==null?void 0:g.files)==null?void 0:c[0];if(!u)return;const a=new FileReader;a.onload=l=>{var d;if(!((d=l==null?void 0:l.target)!=null&&d.result))return;n(!0),s([]),m([]),b("");const h=l.target.result;o(()=>{const E=Wz(Tz(h));s(E),b(h);const f=new Array(E.length);Lt.forEach(E,(y,S)=>{const _=t(y.output);if(!_||_.length===0){console.error("Failed to generate audio output.");return}f[S]=_}),m(f),n(!1)})},a.readAsText(u)}})]})},$z=()=>Re.jsxs(Wn,{item:!0,container:!0,direction:"column",p:2,gap:3,alignItems:"flex-start",children:[Re.jsx(Wn,{item:!0,children:Re.jsx(ti,{variant:"h6",textAlign:"start",children:"Copyrights"})}),Re.jsxs(Wn,{item:!0,container:!0,gap:3,children:[Re.jsxs(ti,{textAlign:"start",variant:"caption",children:["The source code for this project is released under the"," ",Re.jsx("a",{href:"https://github.com/VehpuS/singing-synthesis/blob/main/LICENSE",children:"GNU GPL v3.0"})," license."]}),Re.jsxs(ti,{textAlign:"start",variant:"caption",children:["OddVoices is copyright © 2021-2022 ",Re.jsx("a",{href:"https://nathan.ho.name/",children:"Nathan Ho"})," and is available under the"," ",Re.jsx("a",{href:"https://github.com/oddvoices/oddvoices/blob/develop/LICENSE",children:"Apache License"}),". Its voice files are in the Public Domain."]}),Re.jsxs(ti,{textAlign:"start",variant:"caption",children:["Midifile is copyright © 1999-2018 Craig Stuart Sapp and is available under the"," ",Re.jsx("a",{href:"https://github.com/craigsapp/midifile",children:"BSD 2-Clause License"}),"."]}),Re.jsxs(ti,{textAlign:"start",variant:"caption",children:["The CMU Pronouncing Dictionary is copyright © 1993-2015 Carnegie Mellon University and available under the"," ",Re.jsx("a",{href:"http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/",children:"BSD 2-Clause License"}),"."]})]})]}),jz=e=>typeof e=="boolean"||e instanceof Boolean,Hz=e=>typeof e=="number"||e instanceof Number,Xz=e=>typeof e=="bigint"||e instanceof BigInt,s7=e=>!!e&&e instanceof Date,Yz=e=>typeof e=="string"||e instanceof String,Kz=e=>Array.isArray(e),qz=e=>e instanceof Object&&e!==null;function Qz(e){const[t,n]=Pe.useState(e());return[t,()=>n(m=>!m),n]}let Jz=1;const Zz=()=>Jz++;function eU(){const e=Pe.useRef();return e.current===void 0&&(e.current=`:jsnvw:${Zz()}:`),e.current}function o7(e){let{field:t,value:n,data:s,lastElement:m,openBracket:b,closeBracket:o,level:r,style:u,shouldExpandNode:a}=e;const g=Pe.useRef(!1),[c,l,h]=Qz(()=>a(r,n,t));Pe.useEffect(()=>{g.current?h(a(r,n,t)):g.current=!0},[a]);const d=c?u.collapseIcon:u.expandIcon,E=c?"collapse JSON":"expand JSON",f=eU(),y=r+1,S=s.length-1,_=P=>{P.key===" "&&l()};return Pe.createElement("div",{className:u.basicChildStyle,role:"list"},Pe.createElement("span",{className:d,onClick:l,onKeyDown:_,role:"button",tabIndex:0,"aria-label":E,"aria-expanded":c,"aria-controls":c?f:void 0}),t&&Pe.createElement("span",{className:u.label},t,":"),Pe.createElement("span",{className:u.punctuation},b),c?Pe.createElement("div",{id:f},s.map((P,w)=>Pe.createElement(a7,{key:P[0]||w,field:P[0],value:P[1],style:u,lastElement:w===S,level:y,shouldExpandNode:a}))):Pe.createElement("span",{className:u.collapsedContent,onClick:l,onKeyDown:_,role:"button",tabIndex:-1,"aria-hidden":!0,"aria-label":E,"aria-expanded":c}),Pe.createElement("span",{className:u.punctuation},o),!m&&Pe.createElement("span",{className:u.punctuation},","))}function tU(e){let{field:t,value:n,style:s,lastElement:m,shouldExpandNode:b,level:o}=e;return o7({field:t,value:n,lastElement:m||!1,level:o,openBracket:"{",closeBracket:"}",style:s,shouldExpandNode:b,data:Object.keys(n).map(r=>[r,n[r]])})}function nU(e){let{field:t,value:n,style:s,lastElement:m,level:b,shouldExpandNode:o}=e;return o7({field:t,value:n,lastElement:m||!1,level:b,openBracket:"[",closeBracket:"]",style:s,shouldExpandNode:o,data:n.map(r=>[void 0,r])})}function iU(e){let{field:t,value:n,style:s,lastElement:m}=e,b=n,o=s.otherValue;return n===null?(b="null",o=s.nullValue):n===void 0?(b="undefined",o=s.undefinedValue):Yz(n)?(b=`"${n}"`,o=s.stringValue):jz(n)?(b=n?"true":"false",o=s.booleanValue):Hz(n)?(b=n.toString(),o=s.numberValue):Xz(n)?(b=`${n.toString()}n`,o=s.numberValue):s7(n)?b=n.toISOString():b=n.toString(),t===""&&(t='""'),Pe.createElement("div",{className:s.basicChildStyle,role:"listitem"},t&&Pe.createElement("span",{className:s.label},t,":"),Pe.createElement("span",{className:o},b),!m&&Pe.createElement("span",{className:s.punctuation},","))}function a7(e){const t=e.value;return Kz(t)?Pe.createElement(nU,Object.assign({},e)):qz(t)&&!s7(t)?Pe.createElement(tU,Object.assign({},e)):Pe.createElement(iU,Object.assign({},e))}var zn={"container-base":"_GzYRV","punctuation-base":"_3eOF8",pointer:"_1MFti","expander-base":"_f10Tu _1MFti","expand-icon":"_1UmXx","collapse-icon":"_1LId0","collapsed-content-base":"_1pNG9 _1MFti","container-light":"_2IvMF _GzYRV","basic-element-style":"_2bkNM","label-light":"_1MGIk","punctuation-light":"_3uHL6 _3eOF8","value-null-light":"_2T6PJ","value-undefined-light":"_1Gho6","value-string-light":"_vGjyY","value-number-light":"_1bQdo","value-boolean-light":"_3zQKs","value-other-light":"_1xvuR","collapse-icon-light":"_oLqym _f10Tu _1MFti _1LId0","expand-icon-light":"_2AXVT _f10Tu _1MFti _1UmXx","collapsed-content-light":"_2KJWg _1pNG9 _1MFti","container-dark":"_11RoI _GzYRV","expand-icon-dark":"_17H2C _f10Tu _1MFti _1UmXx","collapse-icon-dark":"_3QHg2 _f10Tu _1MFti _1LId0","collapsed-content-dark":"_3fDAz _1pNG9 _1MFti","label-dark":"_2bSDX","punctuation-dark":"_gsbQL _3eOF8","value-null-dark":"_LaAZe","value-undefined-dark":"_GTKgm","value-string-dark":"_Chy1W","value-number-dark":"_2bveF","value-boolean-dark":"_2vRm-","value-other-dark":"_1prJR"};const rU={container:zn["container-light"],basicChildStyle:zn["basic-element-style"],label:zn["label-light"],nullValue:zn["value-null-light"],undefinedValue:zn["value-undefined-light"],stringValue:zn["value-string-light"],booleanValue:zn["value-boolean-light"],numberValue:zn["value-number-light"],otherValue:zn["value-other-light"],punctuation:zn["punctuation-light"],collapseIcon:zn["collapse-icon-light"],expandIcon:zn["expand-icon-light"],collapsedContent:zn["collapsed-content-light"]},XS={container:zn["container-dark"],basicChildStyle:zn["basic-element-style"],label:zn["label-dark"],nullValue:zn["value-null-dark"],undefinedValue:zn["value-undefined-dark"],stringValue:zn["value-string-dark"],booleanValue:zn["value-boolean-dark"],numberValue:zn["value-number-dark"],otherValue:zn["value-other-dark"],punctuation:zn["punctuation-dark"],collapseIcon:zn["collapse-icon-dark"],expandIcon:zn["expand-icon-dark"],collapsedContent:zn["collapsed-content-dark"]},sU=()=>!0,YS=e=>e<1,KS=e=>{let{data:t,style:n=rU,shouldExpandNode:s=sU}=e;return Pe.createElement("div",{className:n.container},Pe.createElement(a7,{value:t,style:n,lastElement:!0,level:0,shouldExpandNode:s}))};var Py={},oU=Po;Object.defineProperty(Py,"__esModule",{value:!0});var l7=Py.default=void 0,aU=oU(Mo()),lU=Re;l7=Py.default=(0,aU.default)((0,lU.jsx)("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject");var My={},uU=Po;Object.defineProperty(My,"__esModule",{value:!0});var u7=My.default=void 0,cU=uU(Mo()),hU=Re;u7=My.default=(0,cU.default)((0,hU.jsx)("path",{d:"M7 18h2V6H7zm4 4h2V2h-2zm-8-8h2v-4H3zm12 4h2V6h-2zm4-8v4h2v-4z"}),"GraphicEq");var dU=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],s=0;s"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var c=qS[t.format]||qS.default;window.clipboardData.setData(c,e)}else g.clipboardData.clearData(),g.clipboardData.setData(t.format,e);t.onCopy&&(g.preventDefault(),t.onCopy(g.clipboardData))}),document.body.appendChild(r),b.selectNodeContents(r),o.addRange(b);var a=document.execCommand("copy");if(!a)throw new Error("copy command was unsuccessful");u=!0}catch(g){n&&console.error("unable to copy using execCommand: ",g),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(c){n&&console.error("unable to copy using clipboardData: ",c),n&&console.error("falling back to prompt"),s=mU("message"in t?t.message:pU),window.prompt(s,e)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(b):o.removeAllRanges()),r&&document.body.removeChild(r),m()}return u}var bU=gU;const yU=D2(bU);function vU(e,t){var n=Pe.useState(!1),s=n[0],m=n[1],b=t&&t.successDuration;return Pe.useEffect(function(){if(s&&b){var o=setTimeout(function(){m(!1)},b);return function(){clearTimeout(o)}}},[s,b]),[s,function(){var o=yU(e);m(o)}]}var Cy={},SU=Po;Object.defineProperty(Cy,"__esModule",{value:!0});var c7=Cy.default=void 0,EU=SU(Mo()),xU=Re;c7=Cy.default=(0,EU.default)((0,xU.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");var Ly={},wU=Po;Object.defineProperty(Ly,"__esModule",{value:!0});var h7=Ly.default=void 0,_U=wU(Mo()),TU=Re;h7=Ly.default=(0,_U.default)((0,TU.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");const mg=({text:e,successDuration:t=1e3})=>{const[n,s]=vU(e,{successDuration:t});return Re.jsx(LV,{title:n?"Copied!":"Copy",placement:"top",children:Re.jsx(rk,{size:"small",onClick:m=>{m.stopPropagation(),s()},color:"primary",children:n?Re.jsx(h7,{}):Re.jsx(c7,{})})})},PU=({output:e,splitParams:t,audioOutput:n,partIndex:s,debugInfo:m})=>{const b=`${t.partName}${t.numVoices>1?`_(voice_${t.voice})`:""}${t.largestChordLvl>1?`_chord-level_${t.chordLvl}-${t.largestChordLvl}`:""}`;return Re.jsxs(Wn,{item:!0,container:!0,direction:"column",children:[Re.jsxs(Wn,{item:!0,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",gap:2,pb:1,children:[Re.jsx(Wn,{item:!0,children:Re.jsxs(ti,{variant:"subtitle1",children:["Part ",s+1]})}),Re.jsx(Wn,{item:!0,children:Re.jsxs(ti,{variant:"h6",color:"primary",children:[t.partName,t.numVoices>1?` (voice ${t.voice})`:"",t.largestChordLvl>1?` - chord level ${t.chordLvl}/${t.largestChordLvl}`:""]})})]}),Re.jsxs(Wn,{item:!0,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[Re.jsx(Wn,{item:!0,children:Re.jsx("audio",{controls:!0,src:n?"data:audio/wav;base64,"+HG(n):void 0})}),Re.jsx(Wn,{item:!0,children:Re.jsx(bS,{clickable:!0,color:"primary",label:"Download Audio (.wav)",component:"a",href:n?URL.createObjectURL(new Blob([n],{type:"audio/wav"})):void 0,download:b+".wav",icon:Re.jsx(u7,{}),sx:{"&:hover":{color:"grey.50"}}})}),Re.jsx(Wn,{item:!0,children:Re.jsx(bS,{color:"secondary",label:"Download JSON",component:"a",href:`data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(e,null,2))}`,download:b+".json",clickable:!0,icon:Re.jsx(l7,{}),sx:{"&:hover":{color:"grey.50"}}})})]}),Re.jsxs(Wu,{children:[Re.jsx(Uu,{expandIcon:Re.jsx(Nl,{}),children:Re.jsxs(Wn,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[Re.jsx(mg,{text:e.lyrics}),Re.jsx(ti,{variant:"subtitle2",children:"Lyrics"})]})}),Re.jsx(zu,{children:Re.jsx(ti,{variant:"body2",children:e.lyrics})})]}),Re.jsxs(Wu,{children:[Re.jsx(Uu,{expandIcon:Re.jsx(Nl,{}),children:Re.jsxs(Wn,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[Re.jsx(mg,{text:JSON.stringify(e.events,null,2)}),Re.jsx(ti,{variant:"subtitle2",children:"Events"})]})}),Re.jsx(zu,{children:Re.jsx(Wn,{item:!0,justifyContent:"flex-start",children:Re.jsx(KS,{data:e.events,style:XS,shouldExpandNode:YS})})})]}),m&&Re.jsxs(Wu,{children:[Re.jsx(Uu,{expandIcon:Re.jsx(Nl,{}),children:Re.jsxs(Wn,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[Re.jsx(mg,{text:JSON.stringify(m,null,2)}),Re.jsx(ti,{variant:"subtitle2",children:"Debug Info"})]})}),Re.jsx(zu,{children:Re.jsx(Wn,{item:!0,justifyContent:"flex-start",children:Re.jsx(KS,{data:m,style:XS,shouldExpandNode:YS})})})]})]})};function MU(){const[e,t]=si.useState(""),[n,s]=si.useState([]),[m,b]=si.useState([]);n.length>0&&console.log({oddVoiceOutputs:n});const{isLoadingApp:o,isLoadingVoice:r,voiceLoadingFailed:u,generateVoiceFromOddVoiceJson:a}=YG(),[g,c]=si.useState(!1);return Re.jsxs(Jp,{elevation:1,sx:{maxWidth:800,paddingInline:3,marginInline:1},children:[Re.jsxs(Wu,{variant:"outlined",sx:{top:0,position:"sticky",zIndex:1,backgroundColor:l=>l.palette.background.paper},children:[Re.jsx(Uu,{disabled:!e,expandIcon:e?Re.jsx(Nl,{}):null,children:Re.jsx(ti,{variant:"body1",textAlign:"center",width:"100%",children:o?Re.jsxs(Re.Fragment,{children:[Re.jsx(lg,{}),"Loading app..."]}):u?Re.jsxs(Re.Fragment,{children:[Re.jsx($6,{}),"Error loading voice!"]}):g?Re.jsxs(Re.Fragment,{children:[Re.jsx(lg,{size:16})," Generating audio..."]}):r?Re.jsxs(Re.Fragment,{children:[Re.jsx(lg,{size:16})," Loading voice..."]}):e?"View MusicXML":"Upload a MusicXML file to view it here."})}),Re.jsx(zu,{sx:{overflow:"auto",height:300},children:Re.jsx($G,{autoResize:!0,file:e})})]}),!o&&Re.jsxs(Re.Fragment,{children:[Re.jsx(Wn,{item:!0,sx:{top:50,position:"sticky",zIndex:1},children:Re.jsxs(Jp,{elevation:0,sx:{display:"flex",border:l=>`1px solid ${l.palette.divider}`,flexWrap:"wrap"},children:[Re.jsx(Uz,{isLoadingVoice:r,setIsGeneratingAudio:c,setOddVoiceOutputs:s,setAudioOutputs:b,setRawFile:t,generateVoiceFromOddVoiceJson:a}),m.length>0&&Re.jsx(rW,{})]})}),Re.jsx(ug,{}),Re.jsx(Wn,{container:!0,direction:"column",gap:3,alignItems:"center",paddingBlock:2,children:Re.jsxs(Wn,{item:!0,container:!0,direction:"column",gap:3,alignItems:"center",alignSelf:"center",children:[Lt.map(n,(l,h)=>Re.jsx(PU,{partIndex:h,output:l.output,splitParams:l.splitParams,debugInfo:l.unparsedPartEvents,audioOutput:m[h]},h)),Re.jsx(ug,{})]})})]}),Re.jsx(Wn,{container:!0,direction:"column",gap:3,alignItems:"center",paddingBlock:2,children:Re.jsxs(Wu,{children:[Re.jsx(Uu,{expandIcon:Re.jsx(Nl,{}),children:Re.jsx(ti,{variant:"h6",children:"About Oddvoices"})}),Re.jsx(zu,{children:Re.jsx(zG,{})})]})}),Re.jsx(ug,{}),Re.jsx($z,{})]})}const CU=new YP;Lg.createRoot(document.getElementById("root")).render(Re.jsx(si.StrictMode,{children:Re.jsx(ZP,{client:CU,children:Re.jsx(MU,{})})})); diff --git a/musicxml-singer-with-oddvoices/dist/index.html b/musicxml-singer-with-oddvoices/dist/index.html index ef4b5f0..9323d75 100644 --- a/musicxml-singer-with-oddvoices/dist/index.html +++ b/musicxml-singer-with-oddvoices/dist/index.html @@ -5,8 +5,8 @@ MusicXML Singer with Odd Voices - - + +