From 99a41865ef90a727bd63d8d35a2ed6e5fffcc505 Mon Sep 17 00:00:00 2001 From: Alex Carrasco Date: Sun, 18 Aug 2024 17:34:23 -0600 Subject: [PATCH] bunch of improvements --- ...{index-CJhaY39H.css => index-dLEbky80.css} | 2 +- .../{index-BTmNnDlk.js => index-n_aAWccm.js} | 86 ++++++++++--------- index.html | 4 +- 3 files changed, 49 insertions(+), 43 deletions(-) rename assets/{index-CJhaY39H.css => index-dLEbky80.css} (61%) rename assets/{index-BTmNnDlk.js => index-n_aAWccm.js} (68%) diff --git a/assets/index-CJhaY39H.css b/assets/index-dLEbky80.css similarity index 61% rename from assets/index-CJhaY39H.css rename to assets/index-dLEbky80.css index 776adc9..f32868f 100644 --- a/assets/index-CJhaY39H.css +++ b/assets/index-dLEbky80.css @@ -1 +1 @@ -.at-cursor-bar{background:#fff20040}.at-selection div{background:#4040ff33}.at-cursor-beat{background:#4040ffbf;width:3px}.at-highlight *{fill:#0078ff;stroke:#0078ff} +.at-cursor-bar{background:#fff20040}.at-selection div{background:#4040ff33}.at-cursor-beat{background:#4040ff00;width:0px}.at-highlight *{fill:#0078ff;stroke:#0078ff} diff --git a/assets/index-BTmNnDlk.js b/assets/index-n_aAWccm.js similarity index 68% rename from assets/index-BTmNnDlk.js rename to assets/index-n_aAWccm.js index 7e7d307..7c6d5ed 100644 --- a/assets/index-BTmNnDlk.js +++ b/assets/index-n_aAWccm.js @@ -1,4 +1,4 @@ -function RT(t,e){for(var r=0;ri[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ro(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Go(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var MT={exports:{}},km={},DT={exports:{}},Kt={};/** +function RT(t,e){for(var r=0;ri[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function io(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var MT={exports:{}},km={},DT={exports:{}},Kt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function RT(t,e){for(var r=0;r>>1,ne=N[Q];if(0>>1;Qn(j,W))Jn(pe,j)?(N[Q]=pe,N[J]=W,Q=J):(N[Q]=j,N[te]=W,Q=te);else if(Jn(pe,W))N[Q]=pe,N[J]=W,Q=J;else break e}}return V}function n(N,V){var W=N.sortIndex-V.sortIndex;return W!==0?W:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,d=null,h=3,p=!1,f=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(N){for(var V=r(c);V!==null;){if(V.callback===null)i(c);else if(V.startTime<=N)i(c),V.sortIndex=V.expirationTime,e(l,V);else break;V=r(c)}}function k(N){if(m=!1,b(N),!f)if(r(l)!==null)f=!0,O(C);else{var V=r(c);V!==null&&A(k,V.startTime-N)}}function C(N,V){f=!1,m&&(m=!1,v(P),P=-1),p=!0;var W=h;try{for(b(V),d=r(l);d!==null&&(!(d.expirationTime>V)||N&&!D());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,h=d.priorityLevel;var ne=Q(d.expirationTime<=V);V=t.unstable_now(),typeof ne=="function"?d.callback=ne:d===r(l)&&i(l),b(V)}else i(l);d=r(l)}if(d!==null)var ie=!0;else{var te=r(c);te!==null&&A(k,te.startTime-V),ie=!1}return ie}finally{d=null,h=W,p=!1}}var x=!1,_=null,P=-1,R=5,E=-1;function D(){return!(t.unstable_now()-EN||125Q?(N.sortIndex=W,e(c,N),r(l)===null&&N===r(c)&&(m?(v(P),P=-1):m=!0,A(k,W-Q))):(N.sortIndex=ne,e(l,N),f||p||(f=!0,O(C))),N},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(N){var V=h;return function(){var W=h;h=V;try{return N.apply(this,arguments)}finally{h=W}}}})(UT);HT.exports=UT;var lD=HT.exports;/** + */(function(t){function e(N,V){var W=N.length;N.push(V);e:for(;0>>1,ne=N[Q];if(0>>1;Qn(j,W))Jn(me,j)?(N[Q]=me,N[J]=W,Q=J):(N[Q]=j,N[te]=W,Q=te);else if(Jn(me,W))N[Q]=me,N[J]=W,Q=J;else break e}}return V}function n(N,V){var W=N.sortIndex-V.sortIndex;return W!==0?W:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,d=null,h=3,p=!1,f=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(N){for(var V=r(c);V!==null;){if(V.callback===null)i(c);else if(V.startTime<=N)i(c),V.sortIndex=V.expirationTime,e(l,V);else break;V=r(c)}}function k(N){if(m=!1,b(N),!f)if(r(l)!==null)f=!0,O(C);else{var V=r(c);V!==null&&A(k,V.startTime-N)}}function C(N,V){f=!1,m&&(m=!1,v(P),P=-1),p=!0;var W=h;try{for(b(V),d=r(l);d!==null&&(!(d.expirationTime>V)||N&&!D());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,h=d.priorityLevel;var ne=Q(d.expirationTime<=V);V=t.unstable_now(),typeof ne=="function"?d.callback=ne:d===r(l)&&i(l),b(V)}else i(l);d=r(l)}if(d!==null)var ie=!0;else{var te=r(c);te!==null&&A(k,te.startTime-V),ie=!1}return ie}finally{d=null,h=W,p=!1}}var x=!1,_=null,P=-1,R=5,E=-1;function D(){return!(t.unstable_now()-EN||125Q?(N.sortIndex=W,e(c,N),r(l)===null&&N===r(c)&&(m?(v(P),P=-1):m=!0,A(k,W-Q))):(N.sortIndex=ne,e(l,N),f||p||(f=!0,O(C))),N},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(N){var V=h;return function(){var W=h;h=V;try{return N.apply(this,arguments)}finally{h=W}}}})(UT);HT.exports=UT;var uD=HT.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function RT(t,e){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ab=Object.prototype.hasOwnProperty,cD=/^[: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]*$/,JS={},ZS={};function uD(t){return Ab.call(ZS,t)?!0:Ab.call(JS,t)?!1:cD.test(t)?ZS[t]=!0:(JS[t]=!0,!1)}function dD(t,e,r,i){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function hD(t,e,r,i){if(e===null||typeof e>"u"||dD(t,e,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vn(t,e,r,i,n,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Yi[t]=new vn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Yi[e]=new vn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Yi[t]=new vn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Yi[t]=new vn(t,2,!1,t,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(t){Yi[t]=new vn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Yi[t]=new vn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Yi[t]=new vn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Yi[t]=new vn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Yi[t]=new vn(t,5,!1,t.toLowerCase(),null,!1,!1)});var xv=/[\-:]([a-z])/g;function kv(t){return t[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(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Yi[t]=new vn(t,1,!1,t.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Yi[t]=new vn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Cv(t,e,r,i){var n=Yi.hasOwnProperty(e)?Yi[e]:null;(n!==null?n.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ab=Object.prototype.hasOwnProperty,dD=/^[: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]*$/,JS={},ZS={};function hD(t){return Ab.call(ZS,t)?!0:Ab.call(JS,t)?!1:dD.test(t)?ZS[t]=!0:(JS[t]=!0,!1)}function fD(t,e,r,i){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function pD(t,e,r,i){if(e===null||typeof e>"u"||fD(t,e,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vn(t,e,r,i,n,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Yi[t]=new vn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Yi[e]=new vn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Yi[t]=new vn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Yi[t]=new vn(t,2,!1,t,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(t){Yi[t]=new vn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Yi[t]=new vn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Yi[t]=new vn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Yi[t]=new vn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Yi[t]=new vn(t,5,!1,t.toLowerCase(),null,!1,!1)});var xv=/[\-:]([a-z])/g;function kv(t){return t[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(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(xv,kv);Yi[e]=new vn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Yi[t]=new vn(t,1,!1,t.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Yi[t]=new vn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Cv(t,e,r,i){var n=Yi.hasOwnProperty(e)?Yi[e]:null;(n!==null?n.type!==0:i||!(2o||n[a]!==s[o]){var l=` -`+n[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{fy=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?sd(t):""}function fD(t){switch(t.tag){case 5:return sd(t.type);case 16:return sd("Lazy");case 13:return sd("Suspense");case 19:return sd("SuspenseList");case 0:case 2:case 15:return t=py(t.type,!1),t;case 11:return t=py(t.type.render,!1),t;case 1:return t=py(t.type,!0),t;default:return""}}function Wb(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case yc:return"Fragment";case gc:return"Portal";case Vb:return"Profiler";case Tv:return"StrictMode";case $b:return"Suspense";case zb:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case XT:return(t.displayName||"Context")+".Consumer";case YT:return(t._context.displayName||"Context")+".Provider";case _v:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bv:return e=t.displayName||null,e!==null?e:Wb(t.type)||"Memo";case yo:e=t._payload,t=t._init;try{return Wb(t(e))}catch{}}return null}function pD(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Wb(e);case 8:return e===Tv?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ao(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function KT(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function mD(t){var e=KT(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function af(t){t._valueTracker||(t._valueTracker=mD(t))}function QT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),i="";return t&&(i=KT(t)?t.checked?"true":"false":t.value),t=i,t!==r?(e.setValue(t),!0):!1}function xp(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Hb(t,e){var r=e.checked;return qr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function tx(t,e){var r=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;r=Ao(e.value!=null?e.value:r),t._wrapperState={initialChecked:i,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function JT(t,e){e=e.checked,e!=null&&Cv(t,"checked",e,!1)}function Ub(t,e){JT(t,e);var r=Ao(e.value),i=e.type;if(r!=null)i==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gb(t,e.type,r):e.hasOwnProperty("defaultValue")&&Gb(t,e.type,Ao(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rx(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Gb(t,e,r){(e!=="number"||xp(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var ad=Array.isArray;function Lc(t,e,r,i){if(t=t.options,e){e={};for(var n=0;n"+e.valueOf().toString()+"",e=of.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Od(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var md={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},gD=["Webkit","ms","Moz","O"];Object.keys(md).forEach(function(t){gD.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),md[e]=md[t]})});function r_(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||md.hasOwnProperty(t)&&md[t]?(""+e).trim():e+"px"}function i_(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=r_(r,e[r],i);r==="float"&&(r="cssFloat"),i?t.setProperty(r,n):t[r]=n}}var yD=qr({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 Xb(t,e){if(e){if(yD[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Oe(62))}}function qb(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Kb=null;function Pv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qb=null,Fc=null,Ic=null;function sx(t){if(t=Rh(t)){if(typeof Qb!="function")throw Error(Oe(280));var e=t.stateNode;e&&(e=Pm(e),Qb(t.stateNode,t.type,e))}}function n_(t){Fc?Ic?Ic.push(t):Ic=[t]:Fc=t}function s_(){if(Fc){var t=Fc,e=Ic;if(Ic=Fc=null,sx(t),e)for(t=0;t>>=0,t===0?32:31-(PD(t)/ND|0)|0}var lf=64,cf=4194304;function od(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _p(t,e){var r=t.pendingLanes;if(r===0)return 0;var i=0,n=t.suspendedLanes,s=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~n;o!==0?i=od(o):(s&=a,s!==0&&(i=od(s)))}else a=r&~n,a!==0?i=od(a):s!==0&&(i=od(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&n)&&(n=i&-i,s=e&-e,n>=s||n===16&&(s&4194240)!==0))return e;if(i&4&&(i|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0r;r++)e.push(t);return e}function Nh(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Xs(e),t[e]=r}function DD(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=yd),px=" ",mx=!1;function T_(t,e){switch(t){case"keyup":return oL.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function __(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bc=!1;function cL(t,e){switch(t){case"compositionend":return __(e);case"keypress":return e.which!==32?null:(mx=!0,px);case"textInput":return t=e.data,t===px&&mx?null:t;default:return null}}function uL(t,e){if(bc)return t==="compositionend"||!Iv&&T_(t,e)?(t=k_(),Zf=Dv=xo=null,bc=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vx(r)}}function E_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?E_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function R_(){for(var t=window,e=xp();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=xp(t.document)}return e}function Ov(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function vL(t){var e=R_(),r=t.focusedElem,i=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&E_(r.ownerDocument.documentElement,r)){if(i!==null&&Ov(r)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var n=r.textContent.length,s=Math.min(i.start,n);i=i.end===void 0?s:Math.min(i.end,n),!t.extend&&s>i&&(n=i,i=s,s=n),n=wx(r,s);var a=wx(r,i);n&&a&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(n.node,n.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,vc=null,i0=null,vd=null,n0=!1;function Sx(t,e,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;n0||vc==null||vc!==xp(i)||(i=vc,"selectionStart"in i&&Ov(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),vd&&Hd(vd,i)||(vd=i,i=Np(i0,"onSelect"),0xc||(t.current=u0[xc],u0[xc]=null,xc--)}function Cr(t,e){xc++,u0[xc]=t.current,t.current=e}var Vo={},Zi=Yo(Vo),Nn=Yo(!1),Rl=Vo;function Yc(t,e){var r=t.type.contextTypes;if(!r)return Vo;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var n={},s;for(s in r)n[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=n),n}function En(t){return t=t.childContextTypes,t!=null}function Rp(){Rr(Nn),Rr(Zi)}function Px(t,e,r){if(Zi.current!==Vo)throw Error(Oe(168));Cr(Zi,e),Cr(Nn,r)}function $_(t,e,r){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in e))throw Error(Oe(108,pD(t)||"Unknown",n));return qr({},r,i)}function Mp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vo,Rl=Zi.current,Cr(Zi,t),Cr(Nn,Nn.current),!0}function Nx(t,e,r){var i=t.stateNode;if(!i)throw Error(Oe(169));r?(t=$_(t,e,Rl),i.__reactInternalMemoizedMergedChildContext=t,Rr(Nn),Rr(Zi),Cr(Zi,t)):Rr(Nn),Cr(Nn,r)}var Ra=null,Nm=!1,Py=!1;function z_(t){Ra===null?Ra=[t]:Ra.push(t)}function RL(t){Nm=!0,z_(t)}function Xo(){if(!Py&&Ra!==null){Py=!0;var t=0,e=lr;try{var r=Ra;for(lr=1;t>=a,n-=a,Oa=1<<32-Xs(e)+n|r<P?(R=_,_=null):R=_.sibling;var E=h(v,_,b[P],k);if(E===null){_===null&&(_=R);break}t&&_&&E.alternate===null&&e(v,_),g=s(E,g,P),x===null?C=E:x.sibling=E,x=E,_=R}if(P===b.length)return r(v,_),$r&&ol(v,P),C;if(_===null){for(;PP?(R=_,_=null):R=_.sibling;var D=h(v,_,E.value,k);if(D===null){_===null&&(_=R);break}t&&_&&D.alternate===null&&e(v,_),g=s(D,g,P),x===null?C=D:x.sibling=D,x=D,_=R}if(E.done)return r(v,_),$r&&ol(v,P),C;if(_===null){for(;!E.done;P++,E=b.next())E=d(v,E.value,k),E!==null&&(g=s(E,g,P),x===null?C=E:x.sibling=E,x=E);return $r&&ol(v,P),C}for(_=i(v,_);!E.done;P++,E=b.next())E=p(_,v,P,E.value,k),E!==null&&(t&&E.alternate!==null&&_.delete(E.key===null?P:E.key),g=s(E,g,P),x===null?C=E:x.sibling=E,x=E);return t&&_.forEach(function($){return e(v,$)}),$r&&ol(v,P),C}function y(v,g,b,k){if(typeof b=="object"&&b!==null&&b.type===yc&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case sf:e:{for(var C=b.key,x=g;x!==null;){if(x.key===C){if(C=b.type,C===yc){if(x.tag===7){r(v,x.sibling),g=n(x,b.props.children),g.return=v,v=g;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yo&&Ix(C)===x.type){r(v,x.sibling),g=n(x,b.props),g.ref=Iu(v,x,b),g.return=v,v=g;break e}r(v,x);break}else e(v,x);x=x.sibling}b.type===yc?(g=_l(b.props.children,v.mode,k,b.key),g.return=v,v=g):(k=op(b.type,b.key,b.props,null,v.mode,k),k.ref=Iu(v,g,b),k.return=v,v=k)}return a(v);case gc:e:{for(x=b.key;g!==null;){if(g.key===x)if(g.tag===4&&g.stateNode.containerInfo===b.containerInfo&&g.stateNode.implementation===b.implementation){r(v,g.sibling),g=n(g,b.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else e(v,g);g=g.sibling}g=Iy(b,v.mode,k),g.return=v,v=g}return a(v);case yo:return x=b._init,y(v,g,x(b._payload),k)}if(ad(b))return f(v,g,b,k);if(Ru(b))return m(v,g,b,k);gf(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,g!==null&&g.tag===6?(r(v,g.sibling),g=n(g,b),g.return=v,v=g):(r(v,g),g=Fy(b,v.mode,k),g.return=v,v=g),a(v)):r(v,g)}return y}var qc=q_(!0),K_=q_(!1),Mh={},va=Yo(Mh),Yd=Yo(Mh),Xd=Yo(Mh);function gl(t){if(t===Mh)throw Error(Oe(174));return t}function jv(t,e){switch(Cr(Xd,e),Cr(Yd,t),Cr(va,Mh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Yb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Yb(e,t)}Rr(va),Cr(va,e)}function Kc(){Rr(va),Rr(Yd),Rr(Xd)}function Q_(t){gl(Xd.current);var e=gl(va.current),r=Yb(e,t.type);e!==r&&(Cr(Yd,t),Cr(va,r))}function Yv(t){Yd.current===t&&(Rr(va),Rr(Yd))}var Ur=Yo(0);function Ap(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ny=[];function Xv(){for(var t=0;tr?r:4,t(!0);var i=Ey.transition;Ey.transition={};try{t(!1),e()}finally{lr=r,Ey.transition=i}}function fB(){return Ss().memoizedState}function FL(t,e,r){var i=Do(t);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},pB(t))mB(e,r);else if(r=G_(t,e,r,i),r!==null){var n=mn();qs(r,t,i,n),gB(r,e,i)}}function IL(t,e,r){var i=Do(t),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(pB(t))mB(e,n);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,r);if(n.hasEagerState=!0,n.eagerState=o,Js(o,a)){var l=e.interleaved;l===null?(n.next=n,Uv(e)):(n.next=l.next,l.next=n),e.interleaved=n;return}}catch{}finally{}r=G_(t,e,n,i),r!==null&&(n=mn(),qs(r,t,i,n),gB(r,e,i))}}function pB(t){var e=t.alternate;return t===Yr||e!==null&&e===Yr}function mB(t,e){wd=Vp=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function gB(t,e,r){if(r&4194240){var i=e.lanes;i&=t.pendingLanes,r|=i,e.lanes=r,Ev(t,r)}}var $p={readContext:ws,useCallback:qi,useContext:qi,useEffect:qi,useImperativeHandle:qi,useInsertionEffect:qi,useLayoutEffect:qi,useMemo:qi,useReducer:qi,useRef:qi,useState:qi,useDebugValue:qi,useDeferredValue:qi,useTransition:qi,useMutableSource:qi,useSyncExternalStore:qi,useId:qi,unstable_isNewReconciler:!1},OL={readContext:ws,useCallback:function(t,e){return oa().memoizedState=[t,e===void 0?null:e],t},useContext:ws,useEffect:Ax,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,ip(4194308,4,lB.bind(null,e,t),r)},useLayoutEffect:function(t,e){return ip(4194308,4,t,e)},useInsertionEffect:function(t,e){return ip(4,2,t,e)},useMemo:function(t,e){var r=oa();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var i=oa();return e=r!==void 0?r(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=FL.bind(null,Yr,t),[i.memoizedState,t]},useRef:function(t){var e=oa();return t={current:t},e.memoizedState=t},useState:Ox,useDebugValue:Zv,useDeferredValue:function(t){return oa().memoizedState=t},useTransition:function(){var t=Ox(!1),e=t[0];return t=LL.bind(null,t[1]),oa().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var i=Yr,n=oa();if($r){if(r===void 0)throw Error(Oe(407));r=r()}else{if(r=e(),Vi===null)throw Error(Oe(349));Dl&30||eB(i,e,r)}n.memoizedState=r;var s={value:r,getSnapshot:e};return n.queue=s,Ax(rB.bind(null,i,s,t),[t]),i.flags|=2048,Qd(9,tB.bind(null,i,s,r,e),void 0,null),r},useId:function(){var t=oa(),e=Vi.identifierPrefix;if($r){var r=Aa,i=Oa;r=(i&~(1<<32-Xs(i)-1)).toString(32)+r,e=":"+e+"R"+r,r=qd++,0")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{fy=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?sd(t):""}function mD(t){switch(t.tag){case 5:return sd(t.type);case 16:return sd("Lazy");case 13:return sd("Suspense");case 19:return sd("SuspenseList");case 0:case 2:case 15:return t=py(t.type,!1),t;case 11:return t=py(t.type.render,!1),t;case 1:return t=py(t.type,!0),t;default:return""}}function Wb(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case yc:return"Fragment";case gc:return"Portal";case Vb:return"Profiler";case Tv:return"StrictMode";case $b:return"Suspense";case zb:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case XT:return(t.displayName||"Context")+".Consumer";case YT:return(t._context.displayName||"Context")+".Provider";case _v:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bv:return e=t.displayName||null,e!==null?e:Wb(t.type)||"Memo";case bo:e=t._payload,t=t._init;try{return Wb(t(e))}catch{}}return null}function gD(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Wb(e);case 8:return e===Tv?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Vo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function KT(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yD(t){var e=KT(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function af(t){t._valueTracker||(t._valueTracker=yD(t))}function QT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),i="";return t&&(i=KT(t)?t.checked?"true":"false":t.value),t=i,t!==r?(e.setValue(t),!0):!1}function xp(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Hb(t,e){var r=e.checked;return Kr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function tx(t,e){var r=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;r=Vo(e.value!=null?e.value:r),t._wrapperState={initialChecked:i,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function JT(t,e){e=e.checked,e!=null&&Cv(t,"checked",e,!1)}function Ub(t,e){JT(t,e);var r=Vo(e.value),i=e.type;if(r!=null)i==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gb(t,e.type,r):e.hasOwnProperty("defaultValue")&&Gb(t,e.type,Vo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rx(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Gb(t,e,r){(e!=="number"||xp(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var ad=Array.isArray;function Lc(t,e,r,i){if(t=t.options,e){e={};for(var n=0;n"+e.valueOf().toString()+"",e=of.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Od(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var md={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},bD=["Webkit","ms","Moz","O"];Object.keys(md).forEach(function(t){bD.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),md[e]=md[t]})});function r_(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||md.hasOwnProperty(t)&&md[t]?(""+e).trim():e+"px"}function i_(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=r_(r,e[r],i);r==="float"&&(r="cssFloat"),i?t.setProperty(r,n):t[r]=n}}var vD=Kr({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 Xb(t,e){if(e){if(vD[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ae(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ae(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ae(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ae(62))}}function qb(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Kb=null;function Pv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qb=null,Fc=null,Ic=null;function sx(t){if(t=Rh(t)){if(typeof Qb!="function")throw Error(Ae(280));var e=t.stateNode;e&&(e=Pm(e),Qb(t.stateNode,t.type,e))}}function n_(t){Fc?Ic?Ic.push(t):Ic=[t]:Fc=t}function s_(){if(Fc){var t=Fc,e=Ic;if(Ic=Fc=null,sx(t),e)for(t=0;t>>=0,t===0?32:31-(ED(t)/RD|0)|0}var lf=64,cf=4194304;function od(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _p(t,e){var r=t.pendingLanes;if(r===0)return 0;var i=0,n=t.suspendedLanes,s=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~n;o!==0?i=od(o):(s&=a,s!==0&&(i=od(s)))}else a=r&~n,a!==0?i=od(a):s!==0&&(i=od(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&n)&&(n=i&-i,s=e&-e,n>=s||n===16&&(s&4194240)!==0))return e;if(i&4&&(i|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0r;r++)e.push(t);return e}function Nh(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Xs(e),t[e]=r}function FD(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=yd),px=" ",mx=!1;function T_(t,e){switch(t){case"keyup":return c2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function __(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bc=!1;function d2(t,e){switch(t){case"compositionend":return __(e);case"keypress":return e.which!==32?null:(mx=!0,px);case"textInput":return t=e.data,t===px&&mx?null:t;default:return null}}function h2(t,e){if(bc)return t==="compositionend"||!Iv&&T_(t,e)?(t=k_(),Zf=Dv=ko=null,bc=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vx(r)}}function E_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?E_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function R_(){for(var t=window,e=xp();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=xp(t.document)}return e}function Ov(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function S2(t){var e=R_(),r=t.focusedElem,i=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&E_(r.ownerDocument.documentElement,r)){if(i!==null&&Ov(r)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var n=r.textContent.length,s=Math.min(i.start,n);i=i.end===void 0?s:Math.min(i.end,n),!t.extend&&s>i&&(n=i,i=s,s=n),n=wx(r,s);var a=wx(r,i);n&&a&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(n.node,n.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,vc=null,i0=null,vd=null,n0=!1;function Sx(t,e,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;n0||vc==null||vc!==xp(i)||(i=vc,"selectionStart"in i&&Ov(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),vd&&Hd(vd,i)||(vd=i,i=Np(i0,"onSelect"),0xc||(t.current=u0[xc],u0[xc]=null,xc--)}function Cr(t,e){xc++,u0[xc]=t.current,t.current=e}var $o={},Zi=Xo($o),Nn=Xo(!1),Rl=$o;function Yc(t,e){var r=t.type.contextTypes;if(!r)return $o;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var n={},s;for(s in r)n[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=n),n}function En(t){return t=t.childContextTypes,t!=null}function Rp(){Rr(Nn),Rr(Zi)}function Px(t,e,r){if(Zi.current!==$o)throw Error(Ae(168));Cr(Zi,e),Cr(Nn,r)}function $_(t,e,r){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in e))throw Error(Ae(108,gD(t)||"Unknown",n));return Kr({},r,i)}function Mp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||$o,Rl=Zi.current,Cr(Zi,t),Cr(Nn,Nn.current),!0}function Nx(t,e,r){var i=t.stateNode;if(!i)throw Error(Ae(169));r?(t=$_(t,e,Rl),i.__reactInternalMemoizedMergedChildContext=t,Rr(Nn),Rr(Zi),Cr(Zi,t)):Rr(Nn),Cr(Nn,r)}var Ra=null,Nm=!1,Py=!1;function z_(t){Ra===null?Ra=[t]:Ra.push(t)}function D2(t){Nm=!0,z_(t)}function qo(){if(!Py&&Ra!==null){Py=!0;var t=0,e=lr;try{var r=Ra;for(lr=1;t>=a,n-=a,Aa=1<<32-Xs(e)+n|r<P?(R=_,_=null):R=_.sibling;var E=h(v,_,b[P],k);if(E===null){_===null&&(_=R);break}t&&_&&E.alternate===null&&e(v,_),g=s(E,g,P),x===null?C=E:x.sibling=E,x=E,_=R}if(P===b.length)return r(v,_),$r&&ll(v,P),C;if(_===null){for(;PP?(R=_,_=null):R=_.sibling;var D=h(v,_,E.value,k);if(D===null){_===null&&(_=R);break}t&&_&&D.alternate===null&&e(v,_),g=s(D,g,P),x===null?C=D:x.sibling=D,x=D,_=R}if(E.done)return r(v,_),$r&&ll(v,P),C;if(_===null){for(;!E.done;P++,E=b.next())E=d(v,E.value,k),E!==null&&(g=s(E,g,P),x===null?C=E:x.sibling=E,x=E);return $r&&ll(v,P),C}for(_=i(v,_);!E.done;P++,E=b.next())E=p(_,v,P,E.value,k),E!==null&&(t&&E.alternate!==null&&_.delete(E.key===null?P:E.key),g=s(E,g,P),x===null?C=E:x.sibling=E,x=E);return t&&_.forEach(function($){return e(v,$)}),$r&&ll(v,P),C}function y(v,g,b,k){if(typeof b=="object"&&b!==null&&b.type===yc&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case sf:e:{for(var C=b.key,x=g;x!==null;){if(x.key===C){if(C=b.type,C===yc){if(x.tag===7){r(v,x.sibling),g=n(x,b.props.children),g.return=v,v=g;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===bo&&Ix(C)===x.type){r(v,x.sibling),g=n(x,b.props),g.ref=Iu(v,x,b),g.return=v,v=g;break e}r(v,x);break}else e(v,x);x=x.sibling}b.type===yc?(g=_l(b.props.children,v.mode,k,b.key),g.return=v,v=g):(k=op(b.type,b.key,b.props,null,v.mode,k),k.ref=Iu(v,g,b),k.return=v,v=k)}return a(v);case gc:e:{for(x=b.key;g!==null;){if(g.key===x)if(g.tag===4&&g.stateNode.containerInfo===b.containerInfo&&g.stateNode.implementation===b.implementation){r(v,g.sibling),g=n(g,b.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else e(v,g);g=g.sibling}g=Iy(b,v.mode,k),g.return=v,v=g}return a(v);case bo:return x=b._init,y(v,g,x(b._payload),k)}if(ad(b))return f(v,g,b,k);if(Ru(b))return m(v,g,b,k);gf(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,g!==null&&g.tag===6?(r(v,g.sibling),g=n(g,b),g.return=v,v=g):(r(v,g),g=Fy(b,v.mode,k),g.return=v,v=g),a(v)):r(v,g)}return y}var qc=q_(!0),K_=q_(!1),Mh={},va=Xo(Mh),Yd=Xo(Mh),Xd=Xo(Mh);function gl(t){if(t===Mh)throw Error(Ae(174));return t}function jv(t,e){switch(Cr(Xd,e),Cr(Yd,t),Cr(va,Mh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Yb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Yb(e,t)}Rr(va),Cr(va,e)}function Kc(){Rr(va),Rr(Yd),Rr(Xd)}function Q_(t){gl(Xd.current);var e=gl(va.current),r=Yb(e,t.type);e!==r&&(Cr(Yd,t),Cr(va,r))}function Yv(t){Yd.current===t&&(Rr(va),Rr(Yd))}var Ur=Xo(0);function Ap(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ny=[];function Xv(){for(var t=0;tr?r:4,t(!0);var i=Ey.transition;Ey.transition={};try{t(!1),e()}finally{lr=r,Ey.transition=i}}function fB(){return Ss().memoizedState}function O2(t,e,r){var i=Lo(t);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},pB(t))mB(e,r);else if(r=G_(t,e,r,i),r!==null){var n=mn();qs(r,t,i,n),gB(r,e,i)}}function A2(t,e,r){var i=Lo(t),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(pB(t))mB(e,n);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,r);if(n.hasEagerState=!0,n.eagerState=o,Js(o,a)){var l=e.interleaved;l===null?(n.next=n,Uv(e)):(n.next=l.next,l.next=n),e.interleaved=n;return}}catch{}finally{}r=G_(t,e,n,i),r!==null&&(n=mn(),qs(r,t,i,n),gB(r,e,i))}}function pB(t){var e=t.alternate;return t===Xr||e!==null&&e===Xr}function mB(t,e){wd=Vp=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function gB(t,e,r){if(r&4194240){var i=e.lanes;i&=t.pendingLanes,r|=i,e.lanes=r,Ev(t,r)}}var $p={readContext:ws,useCallback:qi,useContext:qi,useEffect:qi,useImperativeHandle:qi,useInsertionEffect:qi,useLayoutEffect:qi,useMemo:qi,useReducer:qi,useRef:qi,useState:qi,useDebugValue:qi,useDeferredValue:qi,useTransition:qi,useMutableSource:qi,useSyncExternalStore:qi,useId:qi,unstable_isNewReconciler:!1},V2={readContext:ws,useCallback:function(t,e){return oa().memoizedState=[t,e===void 0?null:e],t},useContext:ws,useEffect:Ax,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,ip(4194308,4,lB.bind(null,e,t),r)},useLayoutEffect:function(t,e){return ip(4194308,4,t,e)},useInsertionEffect:function(t,e){return ip(4,2,t,e)},useMemo:function(t,e){var r=oa();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var i=oa();return e=r!==void 0?r(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=O2.bind(null,Xr,t),[i.memoizedState,t]},useRef:function(t){var e=oa();return t={current:t},e.memoizedState=t},useState:Ox,useDebugValue:Zv,useDeferredValue:function(t){return oa().memoizedState=t},useTransition:function(){var t=Ox(!1),e=t[0];return t=I2.bind(null,t[1]),oa().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var i=Xr,n=oa();if($r){if(r===void 0)throw Error(Ae(407));r=r()}else{if(r=e(),Vi===null)throw Error(Ae(349));Dl&30||eB(i,e,r)}n.memoizedState=r;var s={value:r,getSnapshot:e};return n.queue=s,Ax(rB.bind(null,i,s,t),[t]),i.flags|=2048,Qd(9,tB.bind(null,i,s,r,e),void 0,null),r},useId:function(){var t=oa(),e=Vi.identifierPrefix;if($r){var r=Va,i=Aa;r=(i&~(1<<32-Xs(i)-1)).toString(32)+r,e=":"+e+"R"+r,r=qd++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=a.createElement(r,{is:i.is}):(t=a.createElement(r),r==="select"&&(a=t,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):t=a.createElementNS(t,r),t[ha]=e,t[jd]=i,TB(t,e,!1,!1),e.stateNode=t;e:{switch(a=qb(r,i),r){case"dialog":Br("cancel",t),Br("close",t),n=i;break;case"iframe":case"object":case"embed":Br("load",t),n=i;break;case"video":case"audio":for(n=0;nJc&&(e.flags|=128,i=!0,Ou(s,!1),e.lanes=4194304)}else{if(!i)if(t=Ap(a),t!==null){if(e.flags|=128,i=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ou(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!$r)return Ki(e),null}else 2*fi()-s.renderingStartTime>Jc&&r!==1073741824&&(e.flags|=128,i=!0,Ou(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(r=s.last,r!==null?r.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=fi(),e.sibling=null,r=Ur.current,Cr(Ur,i?r&1|2:r&1),e):(Ki(e),null);case 22:case 23:return sw(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Vn&1073741824&&(Ki(e),e.subtreeFlags&6&&(e.flags|=8192)):Ki(e),null;case 24:return null;case 25:return null}throw Error(Oe(156,e.tag))}function GL(t,e){switch(Vv(e),e.tag){case 1:return En(e.type)&&Rp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Kc(),Rr(Nn),Rr(Zi),Xv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Yv(e),null;case 13:if(Rr(Ur),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Oe(340));Xc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rr(Ur),null;case 4:return Kc(),null;case 10:return Hv(e.type._context),null;case 22:case 23:return sw(),null;case 24:return null;default:return null}}var bf=!1,Ji=!1,jL=typeof WeakSet=="function"?WeakSet:Set,et=null;function _c(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ri(t,e,i)}else r.current=null}function x0(t,e,r){try{r()}catch(i){ri(t,e,i)}}var Yx=!1;function YL(t,e){if(s0=Bp,t=R_(),Ov(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=0,o=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var p;d!==r||n!==0&&d.nodeType!==3||(o=a+n),d!==s||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===t)break t;if(h===r&&++c===n&&(o=a),h===s&&++u===i&&(l=a),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(a0={focusedElem:t,selectionRange:r},Bp=!1,et=e;et!==null;)if(e=et,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,et=t;else for(;et!==null;){e=et;try{var f=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var m=f.memoizedProps,y=f.memoizedState,v=e.stateNode,g=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:Is(e.type,m),y);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Oe(163))}}catch(k){ri(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,et=t;break}et=e.return}return f=Yx,Yx=!1,f}function Sd(t,e,r){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&t)===t){var s=n.destroy;n.destroy=void 0,s!==void 0&&x0(e,r,s)}n=n.next}while(n!==i)}}function Mm(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var i=r.create;r.destroy=i()}r=r.next}while(r!==e)}}function k0(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function PB(t){var e=t.alternate;e!==null&&(t.alternate=null,PB(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ha],delete e[jd],delete e[c0],delete e[NL],delete e[EL])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function NB(t){return t.tag===5||t.tag===3||t.tag===4}function Xx(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NB(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function C0(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ep));else if(i!==4&&(t=t.child,t!==null))for(C0(t,e,r),t=t.sibling;t!==null;)C0(t,e,r),t=t.sibling}function T0(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(T0(t,e,r),t=t.sibling;t!==null;)T0(t,e,r),t=t.sibling}var Hi=null,Os=!1;function uo(t,e,r){for(r=r.child;r!==null;)EB(t,e,r),r=r.sibling}function EB(t,e,r){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(Cm,r)}catch{}switch(r.tag){case 5:Ji||_c(r,e);case 6:var i=Hi,n=Os;Hi=null,uo(t,e,r),Hi=i,Os=n,Hi!==null&&(Os?(t=Hi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Hi.removeChild(r.stateNode));break;case 18:Hi!==null&&(Os?(t=Hi,r=r.stateNode,t.nodeType===8?By(t.parentNode,r):t.nodeType===1&&By(t,r),zd(t)):By(Hi,r.stateNode));break;case 4:i=Hi,n=Os,Hi=r.stateNode.containerInfo,Os=!0,uo(t,e,r),Hi=i,Os=n;break;case 0:case 11:case 14:case 15:if(!Ji&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var s=n,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&x0(r,e,a),n=n.next}while(n!==i)}uo(t,e,r);break;case 1:if(!Ji&&(_c(r,e),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){ri(r,e,o)}uo(t,e,r);break;case 21:uo(t,e,r);break;case 22:r.mode&1?(Ji=(i=Ji)||r.memoizedState!==null,uo(t,e,r),Ji=i):uo(t,e,r);break;default:uo(t,e,r)}}function qx(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new jL),e.forEach(function(i){var n=r2.bind(null,t,i);r.has(i)||(r.add(i),i.then(n,n))})}}function Ds(t,e){var r=e.deletions;if(r!==null)for(var i=0;in&&(n=a),i&=~s}if(i=n,i=fi()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qL(i/1960))-i,10t?16:t,ko===null)var i=!1;else{if(t=ko,ko=null,Hp=0,tr&6)throw Error(Oe(331));var n=tr;for(tr|=4,et=t.current;et!==null;){var s=et,a=s.child;if(et.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lfi()-iw?Tl(t,0):rw|=r),Rn(t,e)}function AB(t,e){e===0&&(t.mode&1?(e=cf,cf<<=1,!(cf&130023424)&&(cf=4194304)):e=1);var r=mn();t=qa(t,e),t!==null&&(Nh(t,e,r),Rn(t,r))}function t2(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),AB(t,r)}function r2(t,e){var r=0;switch(t.tag){case 13:var i=t.stateNode,n=t.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(Oe(314))}i!==null&&i.delete(e),AB(t,r)}var VB;VB=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Nn.current)_n=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return _n=!1,HL(t,e,r);_n=!!(t.flags&131072)}else _n=!1,$r&&e.flags&1048576&&W_(e,Lp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;np(t,e),t=e.pendingProps;var n=Yc(e,Zi.current);Ac(e,r),n=Kv(null,e,i,t,n,r);var s=Qv();return e.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,En(i)?(s=!0,Mp(e)):s=!1,e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Gv(e),n.updater=Em,e.stateNode=n,n._reactInternals=e,m0(e,i,t,r),e=b0(null,e,i,!0,s,r)):(e.tag=0,$r&&s&&Av(e),cn(null,e,n,r),e=e.child),e;case 16:i=e.elementType;e:{switch(np(t,e),t=e.pendingProps,n=i._init,i=n(i._payload),e.type=i,n=e.tag=n2(i),t=Is(i,t),n){case 0:e=y0(null,e,i,t,r);break e;case 1:e=Ux(null,e,i,t,r);break e;case 11:e=Wx(null,e,i,t,r);break e;case 14:e=Hx(null,e,i,Is(i.type,t),r);break e}throw Error(Oe(306,i,""))}return e;case 0:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),y0(t,e,i,n,r);case 1:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),Ux(t,e,i,n,r);case 3:e:{if(xB(e),t===null)throw Error(Oe(387));i=e.pendingProps,s=e.memoizedState,n=s.element,j_(t,e),Op(e,i,null,r);var a=e.memoizedState;if(i=a.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){n=Qc(Error(Oe(423)),e),e=Gx(t,e,i,r,n);break e}else if(i!==n){n=Qc(Error(Oe(424)),e),e=Gx(t,e,i,r,n);break e}else for(Gn=Eo(e.stateNode.containerInfo.firstChild),Yn=e,$r=!0,$s=null,r=K_(e,null,i,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Xc(),i===n){e=Ka(t,e,r);break e}cn(t,e,i,r)}e=e.child}return e;case 5:return Q_(e),t===null&&h0(e),i=e.type,n=e.pendingProps,s=t!==null?t.memoizedProps:null,a=n.children,o0(i,n)?a=null:s!==null&&o0(i,s)&&(e.flags|=32),SB(t,e),cn(t,e,a,r),e.child;case 6:return t===null&&h0(e),null;case 13:return kB(t,e,r);case 4:return jv(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=qc(e,null,i,r):cn(t,e,i,r),e.child;case 11:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),Wx(t,e,i,n,r);case 7:return cn(t,e,e.pendingProps,r),e.child;case 8:return cn(t,e,e.pendingProps.children,r),e.child;case 12:return cn(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(i=e.type._context,n=e.pendingProps,s=e.memoizedProps,a=n.value,Cr(Fp,i._currentValue),i._currentValue=a,s!==null)if(Js(s.value,a)){if(s.children===n.children&&!Nn.current){e=Ka(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ua(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),f0(s.return,r,e),o.lanes|=r;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(Oe(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),f0(a,r,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}cn(t,e,n.children,r),e=e.child}return e;case 9:return n=e.type,i=e.pendingProps.children,Ac(e,r),n=ws(n),i=i(n),e.flags|=1,cn(t,e,i,r),e.child;case 14:return i=e.type,n=Is(i,e.pendingProps),n=Is(i.type,n),Hx(t,e,i,n,r);case 15:return vB(t,e,e.type,e.pendingProps,r);case 17:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),np(t,e),e.tag=1,En(i)?(t=!0,Mp(e)):t=!1,Ac(e,r),X_(e,i,n),m0(e,i,n,r),b0(null,e,i,!0,t,r);case 19:return CB(t,e,r);case 22:return wB(t,e,r)}throw Error(Oe(156,e.tag))};function $B(t,e){return h_(t,e)}function i2(t,e,r,i){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gs(t,e,r,i){return new i2(t,e,r,i)}function ow(t){return t=t.prototype,!(!t||!t.isReactComponent)}function n2(t){if(typeof t=="function")return ow(t)?1:0;if(t!=null){if(t=t.$$typeof,t===_v)return 11;if(t===Bv)return 14}return 2}function Lo(t,e){var r=t.alternate;return r===null?(r=gs(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function op(t,e,r,i,n,s){var a=2;if(i=t,typeof t=="function")ow(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case yc:return _l(r.children,n,s,e);case Tv:a=8,n|=8;break;case Vb:return t=gs(12,r,e,n|2),t.elementType=Vb,t.lanes=s,t;case $b:return t=gs(13,r,e,n),t.elementType=$b,t.lanes=s,t;case zb:return t=gs(19,r,e,n),t.elementType=zb,t.lanes=s,t;case qT:return Lm(r,n,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case YT:a=10;break e;case XT:a=9;break e;case _v:a=11;break e;case Bv:a=14;break e;case yo:a=16,i=null;break e}throw Error(Oe(130,t==null?t:typeof t,""))}return e=gs(a,r,e,n),e.elementType=t,e.type=i,e.lanes=s,e}function _l(t,e,r,i){return t=gs(7,t,i,e),t.lanes=r,t}function Lm(t,e,r,i){return t=gs(22,t,i,e),t.elementType=qT,t.lanes=r,t.stateNode={isHidden:!1},t}function Fy(t,e,r){return t=gs(6,t,null,e),t.lanes=r,t}function Iy(t,e,r){return e=gs(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function s2(t,e,r,i,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gy(0),this.expirationTimes=gy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gy(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function lw(t,e,r,i,n,s,a,o,l){return t=new s2(t,e,r,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=gs(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gv(s),t}function a2(t,e,r){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UB)}catch(t){console.error(t)}}UB(),WT.exports=es;var Vm=WT.exports;const cd=ro(Vm),d2=RT({__proto__:null,default:cd},[Vm]);var ik=Vm;Ob.createRoot=ik.createRoot,Ob.hydrateRoot=ik.hydrateRoot;/** +`+s.stack}return{value:t,source:e,stack:n,digest:null}}function Dy(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function g0(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var W2=typeof WeakMap=="function"?WeakMap:Map;function yB(t,e,r){r=Ga(-1,r),r.tag=3,r.payload={element:null};var i=e.value;return r.callback=function(){Wp||(Wp=!0,_0=i),g0(t,e)},r}function bB(t,e,r){r=Ga(-1,r),r.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var n=e.value;r.payload=function(){return i(n)},r.callback=function(){g0(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){g0(t,e),typeof i!="function"&&(Do===null?Do=new Set([this]):Do.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}function Vx(t,e,r){var i=t.pingCache;if(i===null){i=t.pingCache=new W2;var n=new Set;i.set(e,n)}else n=i.get(e),n===void 0&&(n=new Set,i.set(e,n));n.has(r)||(n.add(r),t=rL.bind(null,t,e,r),e.then(t,t))}function $x(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function zx(t,e,r,i,n){return t.mode&1?(t.flags|=65536,t.lanes=n,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Ga(-1,1),e.tag=2,Mo(r,e,1))),r.lanes|=1),t)}var H2=no.ReactCurrentOwner,_n=!1;function cn(t,e,r,i){e.child=t===null?K_(e,null,r,i):qc(e,t.child,r,i)}function Wx(t,e,r,i,n){r=r.render;var s=e.ref;return Ac(e,n),i=Kv(t,e,r,i,s,n),r=Qv(),t!==null&&!_n?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,Qa(t,e,n)):($r&&r&&Av(e),e.flags|=1,cn(t,e,i,n),e.child)}function Hx(t,e,r,i,n){if(t===null){var s=r.type;return typeof s=="function"&&!ow(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,vB(t,e,s,i,n)):(t=op(r.type,null,i,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&n)){var a=s.memoizedProps;if(r=r.compare,r=r!==null?r:Hd,r(a,i)&&t.ref===e.ref)return Qa(t,e,n)}return e.flags|=1,t=Fo(s,i),t.ref=e.ref,t.return=e,e.child=t}function vB(t,e,r,i,n){if(t!==null){var s=t.memoizedProps;if(Hd(s,i)&&t.ref===e.ref)if(_n=!1,e.pendingProps=i=s,(t.lanes&n)!==0)t.flags&131072&&(_n=!0);else return e.lanes=t.lanes,Qa(t,e,n)}return y0(t,e,r,i,n)}function wB(t,e,r){var i=e.pendingProps,n=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Cr(Bc,Vn),Vn|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Cr(Bc,Vn),Vn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:r,Cr(Bc,Vn),Vn|=i}else s!==null?(i=s.baseLanes|r,e.memoizedState=null):i=r,Cr(Bc,Vn),Vn|=i;return cn(t,e,n,r),e.child}function SB(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function y0(t,e,r,i,n){var s=En(r)?Rl:Zi.current;return s=Yc(e,s),Ac(e,n),r=Kv(t,e,r,i,s,n),i=Qv(),t!==null&&!_n?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,Qa(t,e,n)):($r&&i&&Av(e),e.flags|=1,cn(t,e,r,n),e.child)}function Ux(t,e,r,i,n){if(En(r)){var s=!0;Mp(e)}else s=!1;if(Ac(e,n),e.stateNode===null)np(t,e),X_(e,r,i),m0(e,r,i,n),i=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=r.contextType;typeof c=="object"&&c!==null?c=ws(c):(c=En(r)?Rl:Zi.current,c=Yc(e,c));var u=r.getDerivedStateFromProps,d=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==i||l!==c)&&Fx(e,a,i,c),vo=!1;var h=e.memoizedState;a.state=h,Op(e,i,a,n),l=e.memoizedState,o!==i||h!==l||Nn.current||vo?(typeof u=="function"&&(p0(e,r,u,i),l=e.memoizedState),(o=vo||Lx(e,r,o,i,h,l,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=c,i=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,j_(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:Is(e.type,o),a.props=c,d=e.pendingProps,h=a.context,l=r.contextType,typeof l=="object"&&l!==null?l=ws(l):(l=En(r)?Rl:Zi.current,l=Yc(e,l));var p=r.getDerivedStateFromProps;(u=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||h!==l)&&Fx(e,a,i,l),vo=!1,h=e.memoizedState,a.state=h,Op(e,i,a,n);var f=e.memoizedState;o!==d||h!==f||Nn.current||vo?(typeof p=="function"&&(p0(e,r,p,i),f=e.memoizedState),(c=vo||Lx(e,r,c,i,h,f,l)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,f,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,f,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=f),a.props=i,a.state=f,a.context=l,i=c):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return b0(t,e,r,i,s,n)}function b0(t,e,r,i,n,s){SB(t,e);var a=(e.flags&128)!==0;if(!i&&!a)return n&&Nx(e,r,!1),Qa(t,e,s);i=e.stateNode,H2.current=e;var o=a&&typeof r.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,t!==null&&a?(e.child=qc(e,t.child,null,s),e.child=qc(e,null,o,s)):cn(t,e,o,s),e.memoizedState=i.state,n&&Nx(e,r,!0),e.child}function xB(t){var e=t.stateNode;e.pendingContext?Px(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Px(t,e.context,!1),jv(t,e.containerInfo)}function Gx(t,e,r,i,n){return Xc(),$v(n),e.flags|=256,cn(t,e,r,i),e.child}var v0={dehydrated:null,treeContext:null,retryLane:0};function w0(t){return{baseLanes:t,cachePool:null,transitions:null}}function kB(t,e,r){var i=e.pendingProps,n=Ur.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(n&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(n|=1),Cr(Ur,n&1),t===null)return h0(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=i.children,t=i.fallback,s?(i=e.mode,s=e.child,a={mode:"hidden",children:a},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Lm(a,i,0,null),t=_l(t,i,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=w0(r),e.memoizedState=v0,t):ew(e,a));if(n=t.memoizedState,n!==null&&(o=n.dehydrated,o!==null))return U2(t,e,a,i,o,n,r);if(s){s=i.fallback,a=e.mode,n=t.child,o=n.sibling;var l={mode:"hidden",children:i.children};return!(a&1)&&e.child!==n?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=Fo(n,l),i.subtreeFlags=n.subtreeFlags&14680064),o!==null?s=Fo(o,s):(s=_l(s,a,r,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,a=t.child.memoizedState,a=a===null?w0(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~r,e.memoizedState=v0,i}return s=t.child,t=s.sibling,i=Fo(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=r),i.return=e,i.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=i,e.memoizedState=null,i}function ew(t,e){return e=Lm({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function yf(t,e,r,i){return i!==null&&$v(i),qc(e,t.child,null,r),t=ew(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function U2(t,e,r,i,n,s,a){if(r)return e.flags&256?(e.flags&=-257,i=Dy(Error(Ae(422))),yf(t,e,a,i)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=i.fallback,n=e.mode,i=Lm({mode:"visible",children:i.children},n,0,null),s=_l(s,n,a,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&qc(e,t.child,null,a),e.child.memoizedState=w0(a),e.memoizedState=v0,s);if(!(e.mode&1))return yf(t,e,a,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var o=i.dgst;return i=o,s=Error(Ae(419)),i=Dy(s,i,void 0),yf(t,e,a,i)}if(o=(a&t.childLanes)!==0,_n||o){if(i=Vi,i!==null){switch(a&-a){case 4:n=2;break;case 16:n=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|a)?0:n,n!==0&&n!==s.retryLane&&(s.retryLane=n,Ka(t,n),qs(i,t,n,-1))}return aw(),i=Dy(Error(Ae(421))),yf(t,e,a,i)}return n.data==="$?"?(e.flags|=128,e.child=t.child,e=iL.bind(null,t),n._reactRetry=e,null):(t=s.treeContext,Gn=Ro(n.nextSibling),Yn=e,$r=!0,$s=null,t!==null&&(ls[cs++]=Aa,ls[cs++]=Va,ls[cs++]=Ml,Aa=t.id,Va=t.overflow,Ml=e),e=ew(e,i.children),e.flags|=4096,e)}function jx(t,e,r){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),f0(t.return,e,r)}function Ly(t,e,r,i,n){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=r,s.tailMode=n)}function CB(t,e,r){var i=e.pendingProps,n=i.revealOrder,s=i.tail;if(cn(t,e,i.children,r),i=Ur.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&jx(t,r,e);else if(t.tag===19)jx(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(Cr(Ur,i),!(e.mode&1))e.memoizedState=null;else switch(n){case"forwards":for(r=e.child,n=null;r!==null;)t=r.alternate,t!==null&&Ap(t)===null&&(n=r),r=r.sibling;r=n,r===null?(n=e.child,e.child=null):(n=r.sibling,r.sibling=null),Ly(e,!1,n,r,s);break;case"backwards":for(r=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&Ap(t)===null){e.child=n;break}t=n.sibling,n.sibling=r,r=n,n=t}Ly(e,!0,r,null,s);break;case"together":Ly(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function np(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Qa(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Ll|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Ae(153));if(e.child!==null){for(t=e.child,r=Fo(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Fo(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function G2(t,e,r){switch(e.tag){case 3:xB(e),Xc();break;case 5:Q_(e);break;case 1:En(e.type)&&Mp(e);break;case 4:jv(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,n=e.memoizedProps.value;Cr(Fp,i._currentValue),i._currentValue=n;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Cr(Ur,Ur.current&1),e.flags|=128,null):r&e.child.childLanes?kB(t,e,r):(Cr(Ur,Ur.current&1),t=Qa(t,e,r),t!==null?t.sibling:null);Cr(Ur,Ur.current&1);break;case 19:if(i=(r&e.childLanes)!==0,t.flags&128){if(i)return CB(t,e,r);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Cr(Ur,Ur.current),i)break;return null;case 22:case 23:return e.lanes=0,wB(t,e,r)}return Qa(t,e,r)}var TB,S0,_B,BB;TB=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};S0=function(){};_B=function(t,e,r,i){var n=t.memoizedProps;if(n!==i){t=e.stateNode,gl(va.current);var s=null;switch(r){case"input":n=Hb(t,n),i=Hb(t,i),s=[];break;case"select":n=Kr({},n,{value:void 0}),i=Kr({},i,{value:void 0}),s=[];break;case"textarea":n=jb(t,n),i=jb(t,i),s=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=Ep)}Xb(r,i);var a;r=null;for(c in n)if(!i.hasOwnProperty(c)&&n.hasOwnProperty(c)&&n[c]!=null)if(c==="style"){var o=n[c];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Id.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in i){var l=i[c];if(o=n!=null?n[c]:void 0,i.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(r||(r={}),r[a]=l[a])}else r||(s||(s=[]),s.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Id.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Br("scroll",t),s||o===l||(s=[])):(s=s||[]).push(c,l))}r&&(s=s||[]).push("style",r);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};BB=function(t,e,r,i){r!==i&&(e.flags|=4)};function Ou(t,e){if(!$r)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Ki(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,i=0;if(e)for(var n=t.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=i,t.childLanes=r,e}function j2(t,e,r){var i=e.pendingProps;switch(Vv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ki(e),null;case 1:return En(e.type)&&Rp(),Ki(e),null;case 3:return i=e.stateNode,Kc(),Rr(Nn),Rr(Zi),Xv(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(mf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,$s!==null&&(N0($s),$s=null))),S0(t,e),Ki(e),null;case 5:Yv(e);var n=gl(Xd.current);if(r=e.type,t!==null&&e.stateNode!=null)_B(t,e,r,i,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Ae(166));return Ki(e),null}if(t=gl(va.current),mf(e)){i=e.stateNode,r=e.type;var s=e.memoizedProps;switch(i[ha]=e,i[jd]=s,t=(e.mode&1)!==0,r){case"dialog":Br("cancel",i),Br("close",i);break;case"iframe":case"object":case"embed":Br("load",i);break;case"video":case"audio":for(n=0;n<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=a.createElement(r,{is:i.is}):(t=a.createElement(r),r==="select"&&(a=t,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):t=a.createElementNS(t,r),t[ha]=e,t[jd]=i,TB(t,e,!1,!1),e.stateNode=t;e:{switch(a=qb(r,i),r){case"dialog":Br("cancel",t),Br("close",t),n=i;break;case"iframe":case"object":case"embed":Br("load",t),n=i;break;case"video":case"audio":for(n=0;nJc&&(e.flags|=128,i=!0,Ou(s,!1),e.lanes=4194304)}else{if(!i)if(t=Ap(a),t!==null){if(e.flags|=128,i=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ou(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!$r)return Ki(e),null}else 2*fi()-s.renderingStartTime>Jc&&r!==1073741824&&(e.flags|=128,i=!0,Ou(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(r=s.last,r!==null?r.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=fi(),e.sibling=null,r=Ur.current,Cr(Ur,i?r&1|2:r&1),e):(Ki(e),null);case 22:case 23:return sw(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Vn&1073741824&&(Ki(e),e.subtreeFlags&6&&(e.flags|=8192)):Ki(e),null;case 24:return null;case 25:return null}throw Error(Ae(156,e.tag))}function Y2(t,e){switch(Vv(e),e.tag){case 1:return En(e.type)&&Rp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Kc(),Rr(Nn),Rr(Zi),Xv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Yv(e),null;case 13:if(Rr(Ur),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ae(340));Xc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rr(Ur),null;case 4:return Kc(),null;case 10:return Hv(e.type._context),null;case 22:case 23:return sw(),null;case 24:return null;default:return null}}var bf=!1,Ji=!1,X2=typeof WeakSet=="function"?WeakSet:Set,tt=null;function _c(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ii(t,e,i)}else r.current=null}function x0(t,e,r){try{r()}catch(i){ii(t,e,i)}}var Yx=!1;function q2(t,e){if(s0=Bp,t=R_(),Ov(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=0,o=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var p;d!==r||n!==0&&d.nodeType!==3||(o=a+n),d!==s||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===t)break t;if(h===r&&++c===n&&(o=a),h===s&&++u===i&&(l=a),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(a0={focusedElem:t,selectionRange:r},Bp=!1,tt=e;tt!==null;)if(e=tt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,tt=t;else for(;tt!==null;){e=tt;try{var f=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var m=f.memoizedProps,y=f.memoizedState,v=e.stateNode,g=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:Is(e.type,m),y);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ae(163))}}catch(k){ii(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,tt=t;break}tt=e.return}return f=Yx,Yx=!1,f}function Sd(t,e,r){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&t)===t){var s=n.destroy;n.destroy=void 0,s!==void 0&&x0(e,r,s)}n=n.next}while(n!==i)}}function Mm(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var i=r.create;r.destroy=i()}r=r.next}while(r!==e)}}function k0(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function PB(t){var e=t.alternate;e!==null&&(t.alternate=null,PB(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ha],delete e[jd],delete e[c0],delete e[R2],delete e[M2])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function NB(t){return t.tag===5||t.tag===3||t.tag===4}function Xx(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NB(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function C0(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ep));else if(i!==4&&(t=t.child,t!==null))for(C0(t,e,r),t=t.sibling;t!==null;)C0(t,e,r),t=t.sibling}function T0(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(T0(t,e,r),t=t.sibling;t!==null;)T0(t,e,r),t=t.sibling}var Hi=null,Os=!1;function ho(t,e,r){for(r=r.child;r!==null;)EB(t,e,r),r=r.sibling}function EB(t,e,r){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(Cm,r)}catch{}switch(r.tag){case 5:Ji||_c(r,e);case 6:var i=Hi,n=Os;Hi=null,ho(t,e,r),Hi=i,Os=n,Hi!==null&&(Os?(t=Hi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Hi.removeChild(r.stateNode));break;case 18:Hi!==null&&(Os?(t=Hi,r=r.stateNode,t.nodeType===8?By(t.parentNode,r):t.nodeType===1&&By(t,r),zd(t)):By(Hi,r.stateNode));break;case 4:i=Hi,n=Os,Hi=r.stateNode.containerInfo,Os=!0,ho(t,e,r),Hi=i,Os=n;break;case 0:case 11:case 14:case 15:if(!Ji&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var s=n,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&x0(r,e,a),n=n.next}while(n!==i)}ho(t,e,r);break;case 1:if(!Ji&&(_c(r,e),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){ii(r,e,o)}ho(t,e,r);break;case 21:ho(t,e,r);break;case 22:r.mode&1?(Ji=(i=Ji)||r.memoizedState!==null,ho(t,e,r),Ji=i):ho(t,e,r);break;default:ho(t,e,r)}}function qx(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new X2),e.forEach(function(i){var n=nL.bind(null,t,i);r.has(i)||(r.add(i),i.then(n,n))})}}function Ds(t,e){var r=e.deletions;if(r!==null)for(var i=0;in&&(n=a),i&=~s}if(i=n,i=fi()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Q2(i/1960))-i,10t?16:t,Co===null)var i=!1;else{if(t=Co,Co=null,Hp=0,tr&6)throw Error(Ae(331));var n=tr;for(tr|=4,tt=t.current;tt!==null;){var s=tt,a=s.child;if(tt.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lfi()-iw?Tl(t,0):rw|=r),Rn(t,e)}function AB(t,e){e===0&&(t.mode&1?(e=cf,cf<<=1,!(cf&130023424)&&(cf=4194304)):e=1);var r=mn();t=Ka(t,e),t!==null&&(Nh(t,e,r),Rn(t,r))}function iL(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),AB(t,r)}function nL(t,e){var r=0;switch(t.tag){case 13:var i=t.stateNode,n=t.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(Ae(314))}i!==null&&i.delete(e),AB(t,r)}var VB;VB=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Nn.current)_n=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return _n=!1,G2(t,e,r);_n=!!(t.flags&131072)}else _n=!1,$r&&e.flags&1048576&&W_(e,Lp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;np(t,e),t=e.pendingProps;var n=Yc(e,Zi.current);Ac(e,r),n=Kv(null,e,i,t,n,r);var s=Qv();return e.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,En(i)?(s=!0,Mp(e)):s=!1,e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Gv(e),n.updater=Em,e.stateNode=n,n._reactInternals=e,m0(e,i,t,r),e=b0(null,e,i,!0,s,r)):(e.tag=0,$r&&s&&Av(e),cn(null,e,n,r),e=e.child),e;case 16:i=e.elementType;e:{switch(np(t,e),t=e.pendingProps,n=i._init,i=n(i._payload),e.type=i,n=e.tag=aL(i),t=Is(i,t),n){case 0:e=y0(null,e,i,t,r);break e;case 1:e=Ux(null,e,i,t,r);break e;case 11:e=Wx(null,e,i,t,r);break e;case 14:e=Hx(null,e,i,Is(i.type,t),r);break e}throw Error(Ae(306,i,""))}return e;case 0:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),y0(t,e,i,n,r);case 1:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),Ux(t,e,i,n,r);case 3:e:{if(xB(e),t===null)throw Error(Ae(387));i=e.pendingProps,s=e.memoizedState,n=s.element,j_(t,e),Op(e,i,null,r);var a=e.memoizedState;if(i=a.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){n=Qc(Error(Ae(423)),e),e=Gx(t,e,i,r,n);break e}else if(i!==n){n=Qc(Error(Ae(424)),e),e=Gx(t,e,i,r,n);break e}else for(Gn=Ro(e.stateNode.containerInfo.firstChild),Yn=e,$r=!0,$s=null,r=K_(e,null,i,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Xc(),i===n){e=Qa(t,e,r);break e}cn(t,e,i,r)}e=e.child}return e;case 5:return Q_(e),t===null&&h0(e),i=e.type,n=e.pendingProps,s=t!==null?t.memoizedProps:null,a=n.children,o0(i,n)?a=null:s!==null&&o0(i,s)&&(e.flags|=32),SB(t,e),cn(t,e,a,r),e.child;case 6:return t===null&&h0(e),null;case 13:return kB(t,e,r);case 4:return jv(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=qc(e,null,i,r):cn(t,e,i,r),e.child;case 11:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),Wx(t,e,i,n,r);case 7:return cn(t,e,e.pendingProps,r),e.child;case 8:return cn(t,e,e.pendingProps.children,r),e.child;case 12:return cn(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(i=e.type._context,n=e.pendingProps,s=e.memoizedProps,a=n.value,Cr(Fp,i._currentValue),i._currentValue=a,s!==null)if(Js(s.value,a)){if(s.children===n.children&&!Nn.current){e=Qa(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ga(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),f0(s.return,r,e),o.lanes|=r;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(Ae(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),f0(a,r,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}cn(t,e,n.children,r),e=e.child}return e;case 9:return n=e.type,i=e.pendingProps.children,Ac(e,r),n=ws(n),i=i(n),e.flags|=1,cn(t,e,i,r),e.child;case 14:return i=e.type,n=Is(i,e.pendingProps),n=Is(i.type,n),Hx(t,e,i,n,r);case 15:return vB(t,e,e.type,e.pendingProps,r);case 17:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Is(i,n),np(t,e),e.tag=1,En(i)?(t=!0,Mp(e)):t=!1,Ac(e,r),X_(e,i,n),m0(e,i,n,r),b0(null,e,i,!0,t,r);case 19:return CB(t,e,r);case 22:return wB(t,e,r)}throw Error(Ae(156,e.tag))};function $B(t,e){return h_(t,e)}function sL(t,e,r,i){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gs(t,e,r,i){return new sL(t,e,r,i)}function ow(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aL(t){if(typeof t=="function")return ow(t)?1:0;if(t!=null){if(t=t.$$typeof,t===_v)return 11;if(t===Bv)return 14}return 2}function Fo(t,e){var r=t.alternate;return r===null?(r=gs(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function op(t,e,r,i,n,s){var a=2;if(i=t,typeof t=="function")ow(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case yc:return _l(r.children,n,s,e);case Tv:a=8,n|=8;break;case Vb:return t=gs(12,r,e,n|2),t.elementType=Vb,t.lanes=s,t;case $b:return t=gs(13,r,e,n),t.elementType=$b,t.lanes=s,t;case zb:return t=gs(19,r,e,n),t.elementType=zb,t.lanes=s,t;case qT:return Lm(r,n,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case YT:a=10;break e;case XT:a=9;break e;case _v:a=11;break e;case Bv:a=14;break e;case bo:a=16,i=null;break e}throw Error(Ae(130,t==null?t:typeof t,""))}return e=gs(a,r,e,n),e.elementType=t,e.type=i,e.lanes=s,e}function _l(t,e,r,i){return t=gs(7,t,i,e),t.lanes=r,t}function Lm(t,e,r,i){return t=gs(22,t,i,e),t.elementType=qT,t.lanes=r,t.stateNode={isHidden:!1},t}function Fy(t,e,r){return t=gs(6,t,null,e),t.lanes=r,t}function Iy(t,e,r){return e=gs(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function oL(t,e,r,i,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gy(0),this.expirationTimes=gy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gy(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function lw(t,e,r,i,n,s,a,o,l){return t=new oL(t,e,r,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=gs(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gv(s),t}function lL(t,e,r){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UB)}catch(t){console.error(t)}}UB(),WT.exports=es;var Vm=WT.exports;const cd=io(Vm),fL=RT({__proto__:null,default:cd},[Vm]);var ik=Vm;Ob.createRoot=ik.createRoot,Ob.hydrateRoot=ik.hydrateRoot;/** * @remix-run/router v1.15.3 * * Copyright (c) Remix Software Inc. @@ -46,8 +46,8 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ii(){return ii=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Il(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function f2(){return Math.random().toString(36).substr(2,8)}function sk(t,e){return{usr:t.state,key:t.key,idx:e}}function Zd(t,e,r,i){return r===void 0&&(r=null),ii({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Pa(e):e,{state:r,key:e&&e.key||i||f2()})}function Ol(t){let{pathname:e="/",search:r="",hash:i=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Pa(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function p2(t,e,r,i){i===void 0&&(i={});let{window:n=document.defaultView,v5Compat:s=!1}=i,a=n.history,o=ui.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(ii({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){o=ui.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:o,location:m.location,delta:v})}function h(y,v){o=ui.Push;let g=Zd(m.location,y,v);r&&r(g,y),c=u()+1;let b=sk(g,c),k=m.createHref(g);try{a.pushState(b,"",k)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(k)}s&&l&&l({action:o,location:m.location,delta:1})}function p(y,v){o=ui.Replace;let g=Zd(m.location,y,v);r&&r(g,y),c=u();let b=sk(g,c),k=m.createHref(g);a.replaceState(b,"",k),s&&l&&l({action:o,location:m.location,delta:0})}function f(y){let v=n.location.origin!=="null"?n.location.origin:n.location.href,g=typeof y=="string"?y:Ol(y);return g=g.replace(/ $/,"%20"),Xt(v,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,v)}let m={get action(){return o},get location(){return t(n,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(nk,d),l=y,()=>{n.removeEventListener(nk,d),l=null}},createHref(y){return e(n,y)},createURL:f,encodeLocation(y){let v=f(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(y){return a.go(y)}};return m}var ei;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(ei||(ei={}));const m2=new Set(["lazy","caseSensitive","path","id","index","children"]);function g2(t){return t.index===!0}function E0(t,e,r,i){return r===void 0&&(r=[]),i===void 0&&(i={}),t.map((n,s)=>{let a=[...r,s],o=typeof n.id=="string"?n.id:a.join("-");if(Xt(n.index!==!0||!n.children,"Cannot specify children on an index route"),Xt(!i[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),g2(n)){let l=ii({},n,e(n),{id:o});return i[o]=l,l}else{let l=ii({},n,e(n),{id:o,children:void 0});return i[o]=l,n.children&&(l.children=E0(n.children,e,a,i)),l}})}function Pc(t,e,r){r===void 0&&(r="/");let i=typeof e=="string"?Pa(e):e,n=bu(i.pathname||"/",r);if(n==null)return null;let s=GB(t);b2(s);let a=null;for(let o=0;a==null&&o{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(Xt(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=Ga([i,l.relativePath]),u=r.concat(l);s.children&&s.children.length>0&&(Xt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),GB(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:T2(c,s.index),routesMeta:u})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))n(s,a);else for(let l of jB(s.path))n(s,a,l)}),e}function jB(t){let e=t.split("/");if(e.length===0)return[];let[r,...i]=e,n=r.endsWith("?"),s=r.replace(/\?$/,"");if(i.length===0)return n?[s,""]:[s];let a=jB(i.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),n&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function b2(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:_2(e.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}const v2=/^:[\w-]+$/,w2=3,S2=2,x2=1,k2=10,C2=-2,ak=t=>t==="*";function T2(t,e){let r=t.split("/"),i=r.length;return r.some(ak)&&(i+=C2),e&&(i+=S2),r.filter(n=>!ak(n)).reduce((n,s)=>n+(v2.test(s)?w2:s===""?x2:k2),i)}function _2(t,e){return t.length===e.length&&t.slice(0,-1).every((i,n)=>i===e[n])?t[t.length-1]-e[e.length-1]:0}function B2(t,e){let{routesMeta:r}=t,i={},n="/",s=[];for(let a=0;a{let{paramName:h,isOptional:p}=u;if(h==="*"){let m=o[d]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const f=o[d];return p&&!f?c[h]=void 0:c[h]=(f||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:t}}function N2(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Il(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],n="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(i.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),n+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":t!==""&&t!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,e?void 0:"i"),i]}function E2(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Il(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function bu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,i=t.charAt(r);return i&&i!=="/"?null:t.slice(r)||"/"}function R2(t,e){e===void 0&&(e="/");let{pathname:r,search:i="",hash:n=""}=typeof t=="string"?Pa(t):t;return{pathname:r?r.startsWith("/")?r:M2(r,e):e,search:L2(i),hash:F2(n)}}function M2(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Oy(t,e,r,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function YB(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function hw(t,e){let r=YB(t);return e?r.map((i,n)=>n===t.length-1?i.pathname:i.pathnameBase):r.map(i=>i.pathnameBase)}function fw(t,e,r,i){i===void 0&&(i=!1);let n;typeof t=="string"?n=Pa(t):(n=ii({},t),Xt(!n.pathname||!n.pathname.includes("?"),Oy("?","pathname","search",n)),Xt(!n.pathname||!n.pathname.includes("#"),Oy("#","pathname","hash",n)),Xt(!n.search||!n.search.includes("#"),Oy("#","search","hash",n)));let s=t===""||n.pathname==="",a=s?"/":n.pathname,o;if(a==null)o=r;else{let d=e.length-1;if(!i&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;n.pathname=h.join("/")}o=d>=0?e[d]:"/"}let l=R2(n,o),c=a&&a!=="/"&&a.endsWith("/"),u=(s||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ga=t=>t.join("/").replace(/\/\/+/g,"/"),D2=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),L2=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,F2=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class pw{constructor(e,r,i,n){n===void 0&&(n=!1),this.status=e,this.statusText=r||"",this.internal=n,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}}function XB(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const qB=["post","put","patch","delete"],I2=new Set(qB),O2=["get",...qB],A2=new Set(O2),V2=new Set([301,302,303,307,308]),$2=new Set([307,308]),Ay={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},KB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,W2=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),QB="remix-router-transitions";function H2(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",i=!r;Xt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let n;if(t.mapRouteProperties)n=t.mapRouteProperties;else if(t.detectErrorBoundary){let Z=t.detectErrorBoundary;n=se=>({hasErrorBoundary:Z(se)})}else n=W2;let s={},a=E0(t.routes,n,void 0,s),o,l=t.basename||"/",c=ii({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,d=new Set,h=null,p=null,f=null,m=t.hydrationData!=null,y=Pc(a,t.history.location,l),v=null;if(y==null){let Z=ss(404,{pathname:t.history.location.pathname}),{matches:se,route:Te}=pk(a);y=se,v={[Te.id]:Z}}let g,b=y.some(Z=>Z.route.lazy),k=y.some(Z=>Z.route.loader);if(b)g=!1;else if(!k)g=!0;else if(c.v7_partialHydration){let Z=t.hydrationData?t.hydrationData.loaderData:null,se=t.hydrationData?t.hydrationData.errors:null,Te=We=>We.route.loader?We.route.loader.hydrate===!0?!1:Z&&Z[We.route.id]!==void 0||se&&se[We.route.id]!==void 0:!0;if(se){let We=y.findIndex(rt=>se[rt.route.id]!==void 0);g=y.slice(0,We+1).every(Te)}else g=y.every(Te)}else g=t.hydrationData!=null;let C,x={historyAction:t.history.action,location:t.history.location,matches:y,initialized:g,navigation:Ay,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||v,fetchers:new Map,blockers:new Map},_=ui.Pop,P=!1,R,E=!1,D=new Map,$=null,I=!1,F=!1,M=[],O=[],A=new Map,N=0,V=-1,W=new Map,Q=new Set,ne=new Map,ie=new Map,te=new Set,j=new Map,J=new Map,pe=!1;function fe(){if(u=t.history.listen(Z=>{let{action:se,location:Te,delta:We}=Z;if(pe){pe=!1;return}Il(J.size===0||We!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let rt=Ie({currentLocation:x.location,nextLocation:Te,historyAction:se});if(rt&&We!=null){pe=!0,t.history.go(We*-1),De(rt,{state:"blocked",location:Te,proceed(){De(rt,{state:"proceeding",proceed:void 0,reset:void 0,location:Te}),t.history.go(We)},reset(){let It=new Map(x.blockers);It.set(rt,Vu),ke({blockers:It})}});return}return Y(se,Te)}),r){eF(e,D);let Z=()=>tF(e,D);e.addEventListener("pagehide",Z),$=()=>e.removeEventListener("pagehide",Z)}return x.initialized||Y(ui.Pop,x.location,{initialHydration:!0}),C}function Me(){u&&u(),$&&$(),d.clear(),R&&R.abort(),x.fetchers.forEach((Z,se)=>Pt(se)),x.blockers.forEach((Z,se)=>xt(se))}function _e(Z){return d.add(Z),()=>d.delete(Z)}function ke(Z,se){se===void 0&&(se={}),x=ii({},x,Z);let Te=[],We=[];c.v7_fetcherPersist&&x.fetchers.forEach((rt,It)=>{rt.state==="idle"&&(te.has(It)?We.push(It):Te.push(It))}),[...d].forEach(rt=>rt(x,{deletedFetchers:We,unstable_viewTransitionOpts:se.viewTransitionOpts,unstable_flushSync:se.flushSync===!0})),c.v7_fetcherPersist&&(Te.forEach(rt=>x.fetchers.delete(rt)),We.forEach(rt=>Pt(rt)))}function Ce(Z,se,Te){var We,rt;let{flushSync:It}=Te===void 0?{}:Te,kt=x.actionData!=null&&x.navigation.formMethod!=null&&As(x.navigation.formMethod)&&x.navigation.state==="loading"&&((We=Z.state)==null?void 0:We._isRedirect)!==!0,St;se.actionData?Object.keys(se.actionData).length>0?St=se.actionData:St=null:kt?St=x.actionData:St=null;let dt=se.loaderData?fk(x.loaderData,se.loaderData,se.matches||[],se.errors):x.loaderData,Ut=x.blockers;Ut.size>0&&(Ut=new Map(Ut),Ut.forEach((dr,li)=>Ut.set(li,Vu)));let wi=P===!0||x.navigation.formMethod!=null&&As(x.navigation.formMethod)&&((rt=Z.state)==null?void 0:rt._isRedirect)!==!0;o&&(a=o,o=void 0),I||_===ui.Pop||(_===ui.Push?t.history.push(Z,Z.state):_===ui.Replace&&t.history.replace(Z,Z.state));let Ot;if(_===ui.Pop){let dr=D.get(x.location.pathname);dr&&dr.has(Z.pathname)?Ot={currentLocation:x.location,nextLocation:Z}:D.has(Z.pathname)&&(Ot={currentLocation:Z,nextLocation:x.location})}else if(E){let dr=D.get(x.location.pathname);dr?dr.add(Z.pathname):(dr=new Set([Z.pathname]),D.set(x.location.pathname,dr)),Ot={currentLocation:x.location,nextLocation:Z}}ke(ii({},se,{actionData:St,loaderData:dt,historyAction:_,location:Z,initialized:!0,navigation:Ay,revalidation:"idle",restoreScrollPosition:_r(Z,se.matches||x.matches),preventScrollReset:wi,blockers:Ut}),{viewTransitionOpts:Ot,flushSync:It===!0}),_=ui.Pop,P=!1,E=!1,I=!1,F=!1,M=[],O=[]}async function X(Z,se){if(typeof Z=="number"){t.history.go(Z);return}let Te=R0(x.location,x.matches,l,c.v7_prependBasename,Z,c.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:We,submission:rt,error:It}=ok(c.v7_normalizeFormMethod,!1,Te,se),kt=x.location,St=Zd(x.location,We,se&&se.state);St=ii({},St,t.history.encodeLocation(St));let dt=se&&se.replace!=null?se.replace:void 0,Ut=ui.Push;dt===!0?Ut=ui.Replace:dt===!1||rt!=null&&As(rt.formMethod)&&rt.formAction===x.location.pathname+x.location.search&&(Ut=ui.Replace);let wi=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,Ot=(se&&se.unstable_flushSync)===!0,dr=Ie({currentLocation:kt,nextLocation:St,historyAction:Ut});if(dr){De(dr,{state:"blocked",location:St,proceed(){De(dr,{state:"proceeding",proceed:void 0,reset:void 0,location:St}),X(Z,se)},reset(){let li=new Map(x.blockers);li.set(dr,Vu),ke({blockers:li})}});return}return await Y(Ut,St,{submission:rt,pendingError:It,preventScrollReset:wi,replace:se&&se.replace,enableViewTransition:se&&se.unstable_viewTransition,flushSync:Ot})}function ee(){if(me(),ke({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){Y(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}Y(_||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation})}}async function Y(Z,se,Te){R&&R.abort(),R=null,_=Z,I=(Te&&Te.startUninterruptedRevalidation)===!0,Sr(x.location,x.matches),P=(Te&&Te.preventScrollReset)===!0,E=(Te&&Te.enableViewTransition)===!0;let We=o||a,rt=Te&&Te.overrideNavigation,It=Pc(We,se,l),kt=(Te&&Te.flushSync)===!0;if(!It){let li=ss(404,{pathname:se.pathname}),{matches:nn,route:Kr}=pk(We);wt(),Ce(se,{matches:nn,loaderData:{},errors:{[Kr.id]:li}},{flushSync:kt});return}if(x.initialized&&!F&&X2(x.location,se)&&!(Te&&Te.submission&&As(Te.submission.formMethod))){Ce(se,{matches:It},{flushSync:kt});return}R=new AbortController;let St=zu(t.history,se,R.signal,Te&&Te.submission),dt,Ut;if(Te&&Te.pendingError)Ut={[Cd(It).route.id]:Te.pendingError};else if(Te&&Te.submission&&As(Te.submission.formMethod)){let li=await Be(St,se,Te.submission,It,{replace:Te.replace,flushSync:kt});if(li.shortCircuited)return;dt=li.pendingActionData,Ut=li.pendingActionError,rt=Vy(se,Te.submission),kt=!1,St=new Request(St.url,{signal:St.signal})}let{shortCircuited:wi,loaderData:Ot,errors:dr}=await ce(St,se,It,rt,Te&&Te.submission,Te&&Te.fetcherSubmission,Te&&Te.replace,Te&&Te.initialHydration===!0,kt,dt,Ut);wi||(R=null,Ce(se,ii({matches:It},dt?{actionData:dt}:{},{loaderData:Ot,errors:dr})))}async function Be(Z,se,Te,We,rt){rt===void 0&&(rt={}),me();let It=J2(se,Te);ke({navigation:It},{flushSync:rt.flushSync===!0});let kt,St=D0(We,se);if(!St.route.action&&!St.route.lazy)kt={type:ei.error,error:ss(405,{method:Z.method,pathname:se.pathname,routeId:St.route.id})};else if(kt=await $u("action",Z,St,We,s,n,l,c.v7_relativeSplatPath),Z.signal.aborted)return{shortCircuited:!0};if(bl(kt)){let dt;return rt&&rt.replace!=null?dt=rt.replace:dt=kt.location===x.location.pathname+x.location.search,await re(x,kt,{submission:Te,replace:dt}),{shortCircuited:!0}}if(Nc(kt)){let dt=Cd(We,St.route.id);return(rt&&rt.replace)!==!0&&(_=ui.Push),{pendingActionData:{},pendingActionError:{[dt.route.id]:kt.error}}}if(yl(kt))throw ss(400,{type:"defer-action"});return{pendingActionData:{[St.route.id]:kt.data}}}async function ce(Z,se,Te,We,rt,It,kt,St,dt,Ut,wi){let Ot=We||Vy(se,rt),dr=rt||It||yk(Ot),li=o||a,[nn,Kr]=lk(t.history,x,Te,dr,se,c.v7_partialHydration&&St===!0,F,M,O,te,ne,Q,li,l,Ut,wi);if(wt(nr=>!(Te&&Te.some(hr=>hr.route.id===nr))||nn&&nn.some(hr=>hr.route.id===nr)),V=++N,nn.length===0&&Kr.length===0){let nr=bt();return Ce(se,ii({matches:Te,loaderData:{},errors:wi||null},Ut?{actionData:Ut}:{},nr?{fetchers:new Map(x.fetchers)}:{}),{flushSync:dt}),{shortCircuited:!0}}if(!I&&(!c.v7_partialHydration||!St)){Kr.forEach(hr=>{let wn=x.fetchers.get(hr.key),rf=Wu(void 0,wn?wn.data:void 0);x.fetchers.set(hr.key,rf)});let nr=Ut||x.actionData;ke(ii({navigation:Ot},nr?Object.keys(nr).length===0?{actionData:null}:{actionData:nr}:{},Kr.length>0?{fetchers:new Map(x.fetchers)}:{}),{flushSync:dt})}Kr.forEach(nr=>{A.has(nr.key)&&le(nr.key),nr.controller&&A.set(nr.key,nr.controller)});let sa=()=>Kr.forEach(nr=>le(nr.key));R&&R.signal.addEventListener("abort",sa);let{results:Eu,loaderResults:gr,fetcherResults:xr}=await we(x.matches,Te,nn,Kr,Z);if(Z.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",sa),Kr.forEach(nr=>A.delete(nr.key));let Ms=mk(Eu);if(Ms){if(Ms.idx>=nn.length){let nr=Kr[Ms.idx-nn.length].key;Q.add(nr)}return await re(x,Ms.result,{replace:kt}),{shortCircuited:!0}}let{loaderData:co,errors:sn}=hk(x,Te,nn,gr,wi,Kr,xr,j);j.forEach((nr,hr)=>{nr.subscribe(wn=>{(wn||nr.done)&&j.delete(hr)})}),c.v7_partialHydration&&St&&x.errors&&Object.entries(x.errors).filter(nr=>{let[hr]=nr;return!nn.some(wn=>wn.route.id===hr)}).forEach(nr=>{let[hr,wn]=nr;sn=Object.assign(sn||{},{[hr]:wn})});let uy=bt(),Zl=Tt(V),tf=uy||Zl||Kr.length>0;return ii({loaderData:co,errors:sn},tf?{fetchers:new Map(x.fetchers)}:{})}function L(Z,se,Te,We){if(i)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");A.has(Z)&&le(Z);let rt=(We&&We.unstable_flushSync)===!0,It=o||a,kt=R0(x.location,x.matches,l,c.v7_prependBasename,Te,c.v7_relativeSplatPath,se,We==null?void 0:We.relative),St=Pc(It,kt,l);if(!St){qe(Z,se,ss(404,{pathname:kt}),{flushSync:rt});return}let{path:dt,submission:Ut,error:wi}=ok(c.v7_normalizeFormMethod,!0,kt,We);if(wi){qe(Z,se,wi,{flushSync:rt});return}let Ot=D0(St,dt);if(P=(We&&We.preventScrollReset)===!0,Ut&&As(Ut.formMethod)){U(Z,se,dt,Ot,St,rt,Ut);return}ne.set(Z,{routeId:se,path:dt}),G(Z,se,dt,Ot,St,rt,Ut)}async function U(Z,se,Te,We,rt,It,kt){if(me(),ne.delete(Z),!We.route.action&&!We.route.lazy){let hr=ss(405,{method:kt.formMethod,pathname:Te,routeId:se});qe(Z,se,hr,{flushSync:It});return}let St=x.fetchers.get(Z);Ee(Z,Z2(kt,St),{flushSync:It});let dt=new AbortController,Ut=zu(t.history,Te,dt.signal,kt);A.set(Z,dt);let wi=N,Ot=await $u("action",Ut,We,rt,s,n,l,c.v7_relativeSplatPath);if(Ut.signal.aborted){A.get(Z)===dt&&A.delete(Z);return}if(c.v7_fetcherPersist&&te.has(Z)){if(bl(Ot)||Nc(Ot)){Ee(Z,go(void 0));return}}else{if(bl(Ot))if(A.delete(Z),V>wi){Ee(Z,go(void 0));return}else return Q.add(Z),Ee(Z,Wu(kt)),re(x,Ot,{fetcherSubmission:kt});if(Nc(Ot)){qe(Z,se,Ot.error);return}}if(yl(Ot))throw ss(400,{type:"defer-action"});let dr=x.navigation.location||x.location,li=zu(t.history,dr,dt.signal),nn=o||a,Kr=x.navigation.state!=="idle"?Pc(nn,x.navigation.location,l):x.matches;Xt(Kr,"Didn't find any matches after fetcher action");let sa=++N;W.set(Z,sa);let Eu=Wu(kt,Ot.data);x.fetchers.set(Z,Eu);let[gr,xr]=lk(t.history,x,Kr,kt,dr,!1,F,M,O,te,ne,Q,nn,l,{[We.route.id]:Ot.data},void 0);xr.filter(hr=>hr.key!==Z).forEach(hr=>{let wn=hr.key,rf=x.fetchers.get(wn),$M=Wu(void 0,rf?rf.data:void 0);x.fetchers.set(wn,$M),A.has(wn)&&le(wn),hr.controller&&A.set(wn,hr.controller)}),ke({fetchers:new Map(x.fetchers)});let Ms=()=>xr.forEach(hr=>le(hr.key));dt.signal.addEventListener("abort",Ms);let{results:co,loaderResults:sn,fetcherResults:uy}=await we(x.matches,Kr,gr,xr,li);if(dt.signal.aborted)return;dt.signal.removeEventListener("abort",Ms),W.delete(Z),A.delete(Z),xr.forEach(hr=>A.delete(hr.key));let Zl=mk(co);if(Zl){if(Zl.idx>=gr.length){let hr=xr[Zl.idx-gr.length].key;Q.add(hr)}return re(x,Zl.result)}let{loaderData:tf,errors:nr}=hk(x,x.matches,gr,sn,void 0,xr,uy,j);if(x.fetchers.has(Z)){let hr=go(Ot.data);x.fetchers.set(Z,hr)}Tt(sa),x.navigation.state==="loading"&&sa>V?(Xt(_,"Expected pending action"),R&&R.abort(),Ce(x.navigation.location,{matches:Kr,loaderData:tf,errors:nr,fetchers:new Map(x.fetchers)})):(ke({errors:nr,loaderData:fk(x.loaderData,tf,Kr,nr),fetchers:new Map(x.fetchers)}),F=!1)}async function G(Z,se,Te,We,rt,It,kt){let St=x.fetchers.get(Z);Ee(Z,Wu(kt,St?St.data:void 0),{flushSync:It});let dt=new AbortController,Ut=zu(t.history,Te,dt.signal);A.set(Z,dt);let wi=N,Ot=await $u("loader",Ut,We,rt,s,n,l,c.v7_relativeSplatPath);if(yl(Ot)&&(Ot=await eP(Ot,Ut.signal,!0)||Ot),A.get(Z)===dt&&A.delete(Z),!Ut.signal.aborted){if(te.has(Z)){Ee(Z,go(void 0));return}if(bl(Ot))if(V>wi){Ee(Z,go(void 0));return}else{Q.add(Z),await re(x,Ot);return}if(Nc(Ot)){qe(Z,se,Ot.error);return}Xt(!yl(Ot),"Unhandled fetcher deferred data"),Ee(Z,go(Ot.data))}}async function re(Z,se,Te){let{submission:We,fetcherSubmission:rt,replace:It}=Te===void 0?{}:Te;se.revalidate&&(F=!0);let kt=Zd(Z.location,se.location,{_isRedirect:!0});if(Xt(kt,"Expected a location on the redirect navigation"),r){let dr=!1;if(se.reloadDocument)dr=!0;else if(KB.test(se.location)){const li=t.history.createURL(se.location);dr=li.origin!==e.location.origin||bu(li.pathname,l)==null}if(dr){It?e.location.replace(se.location):e.location.assign(se.location);return}}R=null;let St=It===!0?ui.Replace:ui.Push,{formMethod:dt,formAction:Ut,formEncType:wi}=Z.navigation;!We&&!rt&&dt&&Ut&&wi&&(We=yk(Z.navigation));let Ot=We||rt;if($2.has(se.status)&&Ot&&As(Ot.formMethod))await Y(St,kt,{submission:ii({},Ot,{formAction:se.location}),preventScrollReset:P});else{let dr=Vy(kt,We);await Y(St,kt,{overrideNavigation:dr,fetcherSubmission:rt,preventScrollReset:P})}}async function we(Z,se,Te,We,rt){let It=await Promise.all([...Te.map(dt=>$u("loader",rt,dt,se,s,n,l,c.v7_relativeSplatPath)),...We.map(dt=>dt.matches&&dt.match&&dt.controller?$u("loader",zu(t.history,dt.path,dt.controller.signal),dt.match,dt.matches,s,n,l,c.v7_relativeSplatPath):{type:ei.error,error:ss(404,{pathname:dt.path})})]),kt=It.slice(0,Te.length),St=It.slice(Te.length);return await Promise.all([gk(Z,Te,kt,kt.map(()=>rt.signal),!1,x.loaderData),gk(Z,We.map(dt=>dt.match),St,We.map(dt=>dt.controller?dt.controller.signal:null),!0)]),{results:It,loaderResults:kt,fetcherResults:St}}function me(){F=!0,M.push(...wt()),ne.forEach((Z,se)=>{A.has(se)&&(O.push(se),le(se))})}function Ee(Z,se,Te){Te===void 0&&(Te={}),x.fetchers.set(Z,se),ke({fetchers:new Map(x.fetchers)},{flushSync:(Te&&Te.flushSync)===!0})}function qe(Z,se,Te,We){We===void 0&&(We={});let rt=Cd(x.matches,se);Pt(Z),ke({errors:{[rt.route.id]:Te},fetchers:new Map(x.fetchers)},{flushSync:(We&&We.flushSync)===!0})}function ct(Z){return c.v7_fetcherPersist&&(ie.set(Z,(ie.get(Z)||0)+1),te.has(Z)&&te.delete(Z)),x.fetchers.get(Z)||z2}function Pt(Z){let se=x.fetchers.get(Z);A.has(Z)&&!(se&&se.state==="loading"&&W.has(Z))&&le(Z),ne.delete(Z),W.delete(Z),Q.delete(Z),te.delete(Z),x.fetchers.delete(Z)}function be(Z){if(c.v7_fetcherPersist){let se=(ie.get(Z)||0)-1;se<=0?(ie.delete(Z),te.add(Z)):ie.set(Z,se)}else Pt(Z);ke({fetchers:new Map(x.fetchers)})}function le(Z){let se=A.get(Z);Xt(se,"Expected fetch controller: "+Z),se.abort(),A.delete(Z)}function Ke(Z){for(let se of Z){let Te=ct(se),We=go(Te.data);x.fetchers.set(se,We)}}function bt(){let Z=[],se=!1;for(let Te of Q){let We=x.fetchers.get(Te);Xt(We,"Expected fetcher: "+Te),We.state==="loading"&&(Q.delete(Te),Z.push(Te),se=!0)}return Ke(Z),se}function Tt(Z){let se=[];for(let[Te,We]of W)if(We0}function Fe(Z,se){let Te=x.blockers.get(Z)||Vu;return J.get(Z)!==se&&J.set(Z,se),Te}function xt(Z){x.blockers.delete(Z),J.delete(Z)}function De(Z,se){let Te=x.blockers.get(Z)||Vu;Xt(Te.state==="unblocked"&&se.state==="blocked"||Te.state==="blocked"&&se.state==="blocked"||Te.state==="blocked"&&se.state==="proceeding"||Te.state==="blocked"&&se.state==="unblocked"||Te.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+Te.state+" -> "+se.state);let We=new Map(x.blockers);We.set(Z,se),ke({blockers:We})}function Ie(Z){let{currentLocation:se,nextLocation:Te,historyAction:We}=Z;if(J.size===0)return;J.size>1&&Il(!1,"A router only supports one blocker at a time");let rt=Array.from(J.entries()),[It,kt]=rt[rt.length-1],St=x.blockers.get(It);if(!(St&&St.state==="proceeding")&&kt({currentLocation:se,nextLocation:Te,historyAction:We}))return It}function wt(Z){let se=[];return j.forEach((Te,We)=>{(!Z||Z(We))&&(Te.cancel(),se.push(We),j.delete(We))}),se}function nt(Z,se,Te){if(h=Z,f=se,p=Te||null,!m&&x.navigation===Ay){m=!0;let We=_r(x.location,x.matches);We!=null&&ke({restoreScrollPosition:We})}return()=>{h=null,f=null,p=null}}function Ht(Z,se){return p&&p(Z,se.map(We=>y2(We,x.loaderData)))||Z.key}function Sr(Z,se){if(h&&f){let Te=Ht(Z,se);h[Te]=f()}}function _r(Z,se){if(h){let Te=Ht(Z,se),We=h[Te];if(typeof We=="number")return We}return null}function Rs(Z){s={},o=E0(Z,n,void 0,s)}return C={get basename(){return l},get future(){return c},get state(){return x},get routes(){return a},get window(){return e},initialize:fe,subscribe:_e,enableScrollRestoration:nt,navigate:X,fetch:L,revalidate:ee,createHref:Z=>t.history.createHref(Z),encodeLocation:Z=>t.history.encodeLocation(Z),getFetcher:ct,deleteFetcher:be,dispose:Me,getBlocker:Fe,deleteBlocker:xt,_internalFetchControllers:A,_internalActiveDeferreds:j,_internalSetRoutes:Rs},C}function U2(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function R0(t,e,r,i,n,s,a,o){let l,c;if(a){l=[];for(let d of e)if(l.push(d),d.route.id===a){c=d;break}}else l=e,c=e[e.length-1];let u=fw(n||".",hw(l,s),bu(t.pathname,r)||t.pathname,o==="path");return n==null&&(u.search=t.search,u.hash=t.hash),(n==null||n===""||n===".")&&c&&c.route.index&&!mw(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i&&r!=="/"&&(u.pathname=u.pathname==="/"?r:Ga([r,u.pathname])),Ol(u)}function ok(t,e,r,i){if(!i||!U2(i))return{path:r};if(i.formMethod&&!Q2(i.formMethod))return{path:r,error:ss(405,{method:i.formMethod})};let n=()=>({path:r,error:ss(400,{type:"invalid-body"})}),s=i.formMethod||"get",a=t?s.toUpperCase():s.toLowerCase(),o=ZB(r);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!As(a))return n();let h=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((p,f)=>{let[m,y]=f;return""+p+m+"="+y+` -`},""):String(i.body);return{path:r,submission:{formMethod:a,formAction:o,formEncType:i.formEncType,formData:void 0,json:void 0,text:h}}}else if(i.formEncType==="application/json"){if(!As(a))return n();try{let h=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:r,submission:{formMethod:a,formAction:o,formEncType:i.formEncType,formData:void 0,json:h,text:void 0}}}catch{return n()}}}Xt(typeof FormData=="function","FormData is not available in this environment");let l,c;if(i.formData)l=M0(i.formData),c=i.formData;else if(i.body instanceof FormData)l=M0(i.body),c=i.body;else if(i.body instanceof URLSearchParams)l=i.body,c=dk(l);else if(i.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(i.body),c=dk(l)}catch{return n()}let u={formMethod:a,formAction:o,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(As(u.formMethod))return{path:r,submission:u};let d=Pa(r);return e&&d.search&&mw(d.search)&&l.append("index",""),d.search="?"+l,{path:Ol(d),submission:u}}function G2(t,e){let r=t;if(e){let i=t.findIndex(n=>n.route.id===e);i>=0&&(r=t.slice(0,i))}return r}function lk(t,e,r,i,n,s,a,o,l,c,u,d,h,p,f,m){let y=m?Object.values(m)[0]:f?Object.values(f)[0]:void 0,v=t.createURL(e.location),g=t.createURL(n),b=m?Object.keys(m)[0]:void 0,C=G2(r,b).filter((_,P)=>{let{route:R}=_;if(R.lazy)return!0;if(R.loader==null)return!1;if(s)return R.loader.hydrate?!0:e.loaderData[R.id]===void 0&&(!e.errors||e.errors[R.id]===void 0);if(j2(e.loaderData,e.matches[P],_)||o.some($=>$===_.route.id))return!0;let E=e.matches[P],D=_;return ck(_,ii({currentUrl:v,currentParams:E.params,nextUrl:g,nextParams:D.params},i,{actionResult:y,defaultShouldRevalidate:a||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||JB(E,D)}))}),x=[];return u.forEach((_,P)=>{if(s||!r.some(I=>I.route.id===_.routeId)||c.has(P))return;let R=Pc(h,_.path,p);if(!R){x.push({key:P,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let E=e.fetchers.get(P),D=D0(R,_.path),$=!1;d.has(P)?$=!1:l.includes(P)?$=!0:E&&E.state!=="idle"&&E.data===void 0?$=a:$=ck(D,ii({currentUrl:v,currentParams:e.matches[e.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},i,{actionResult:y,defaultShouldRevalidate:a})),$&&x.push({key:P,routeId:_.routeId,path:_.path,matches:R,match:D,controller:new AbortController})}),[C,x]}function j2(t,e,r){let i=!e||r.route.id!==e.route.id,n=t[r.route.id]===void 0;return i||n}function JB(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function ck(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function uk(t,e,r){if(!t.lazy)return;let i=await t.lazy();if(!t.lazy)return;let n=r[t.id];Xt(n,"No route found in manifest");let s={};for(let a in i){let l=n[a]!==void 0&&a!=="hasErrorBoundary";Il(!l,'Route "'+n.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!m2.has(a)&&(s[a]=i[a])}Object.assign(n,s),Object.assign(n,ii({},e(n),{lazy:void 0}))}async function $u(t,e,r,i,n,s,a,o,l){l===void 0&&(l={});let c,u,d,h=m=>{let y,v=new Promise((g,b)=>y=b);return d=()=>y(),e.signal.addEventListener("abort",d),Promise.race([m({request:e,params:r.params,context:l.requestContext}),v])};try{let m=r.route[t];if(r.route.lazy)if(m){let y,v=await Promise.all([h(m).catch(g=>{y=g}),uk(r.route,s,n)]);if(y)throw y;u=v[0]}else if(await uk(r.route,s,n),m=r.route[t],m)u=await h(m);else if(t==="action"){let y=new URL(e.url),v=y.pathname+y.search;throw ss(405,{method:e.method,pathname:v,routeId:r.route.id})}else return{type:ei.data,data:void 0};else if(m)u=await h(m);else{let y=new URL(e.url),v=y.pathname+y.search;throw ss(404,{pathname:v})}Xt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(m){c=ei.error,u=m}finally{d&&e.signal.removeEventListener("abort",d)}if(K2(u)){let m=u.status;if(V2.has(m)){let v=u.headers.get("Location");if(Xt(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!KB.test(v))v=R0(new URL(e.url),i.slice(0,i.indexOf(r)+1),a,!0,v,o);else if(!l.isStaticRequest){let g=new URL(e.url),b=v.startsWith("//")?new URL(g.protocol+v):new URL(v),k=bu(b.pathname,a)!=null;b.origin===g.origin&&k&&(v=b.pathname+b.search+b.hash)}if(l.isStaticRequest)throw u.headers.set("Location",v),u;return{type:ei.redirect,status:m,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===ei.error?ei.error:ei.data,response:u};let y;try{let v=u.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?u.body==null?y=null:y=await u.json():y=await u.text()}catch(v){return{type:ei.error,error:v}}return c===ei.error?{type:c,error:new pw(m,u.statusText,y),headers:u.headers}:{type:ei.data,data:y,statusCode:u.status,headers:u.headers}}if(c===ei.error)return{type:c,error:u};if(q2(u)){var p,f;return{type:ei.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((f=u.init)==null?void 0:f.headers)&&new Headers(u.init.headers)}}return{type:ei.data,data:u}}function zu(t,e,r,i){let n=t.createURL(ZB(e)).toString(),s={signal:r};if(i&&As(i.formMethod)){let{formMethod:a,formEncType:o}=i;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(i.json)):o==="text/plain"?s.body=i.text:o==="application/x-www-form-urlencoded"&&i.formData?s.body=M0(i.formData):s.body=i.formData}return new Request(n,s)}function M0(t){let e=new URLSearchParams;for(let[r,i]of t.entries())e.append(r,typeof i=="string"?i:i.name);return e}function dk(t){let e=new FormData;for(let[r,i]of t.entries())e.append(r,i);return e}function Y2(t,e,r,i,n){let s={},a=null,o,l=!1,c={};return r.forEach((u,d)=>{let h=e[d].route.id;if(Xt(!bl(u),"Cannot handle redirect results in processLoaderData"),Nc(u)){let p=Cd(t,h),f=u.error;i&&(f=Object.values(i)[0],i=void 0),a=a||{},a[p.route.id]==null&&(a[p.route.id]=f),s[h]=void 0,l||(l=!0,o=XB(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else yl(u)?(n.set(h,u.deferredData),s[h]=u.deferredData.data):s[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(o=u.statusCode),u.headers&&(c[h]=u.headers)}),i&&(a=i,s[Object.keys(i)[0]]=void 0),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:c}}function hk(t,e,r,i,n,s,a,o){let{loaderData:l,errors:c}=Y2(e,r,i,n,o);for(let u=0;ui.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function pk(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function ss(t,e){let{pathname:r,routeId:i,method:n,type:s}=e===void 0?{}:e,a="Unknown Server Error",o="Unknown @remix-run/router error";return t===400?(a="Bad Request",n&&r&&i?o="You made a "+n+' request to "'+r+'" but '+('did not provide a `loader` for route "'+i+'", ')+"so there is no way to handle the request.":s==="defer-action"?o="defer() is not supported in actions":s==="invalid-body"&&(o="Unable to encode submission body")):t===403?(a="Forbidden",o='Route "'+i+'" does not match URL "'+r+'"'):t===404?(a="Not Found",o='No route matches URL "'+r+'"'):t===405&&(a="Method Not Allowed",n&&r&&i?o="You made a "+n.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+i+'", ')+"so there is no way to handle the request.":n&&(o='Invalid request method "'+n.toUpperCase()+'"')),new pw(t||500,a,new Error(o),!0)}function mk(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(bl(r))return{result:r,idx:e}}}function ZB(t){let e=typeof t=="string"?Pa(t):t;return Ol(ii({},e,{hash:""}))}function X2(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function yl(t){return t.type===ei.deferred}function Nc(t){return t.type===ei.error}function bl(t){return(t&&t.type)===ei.redirect}function q2(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function K2(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Q2(t){return A2.has(t.toLowerCase())}function As(t){return I2.has(t.toLowerCase())}async function gk(t,e,r,i,n,s){for(let a=0;ad.route.id===l.route.id),u=c!=null&&!JB(c,l)&&(s&&s[l.route.id])!==void 0;if(yl(o)&&(n||u)){let d=i[a];Xt(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await eP(o,d,n).then(h=>{h&&(r[a]=h||r[a])})}}}async function eP(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:ei.data,data:t.deferredData.unwrappedData}}catch(n){return{type:ei.error,error:n}}return{type:ei.data,data:t.deferredData.data}}}function mw(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function D0(t,e){let r=typeof e=="string"?Pa(e).search:e.search;if(t[t.length-1].route.index&&mw(r||""))return t[t.length-1];let i=YB(t);return i[i.length-1]}function yk(t){let{formMethod:e,formAction:r,formEncType:i,text:n,formData:s,json:a}=t;if(!(!e||!r||!i)){if(n!=null)return{formMethod:e,formAction:r,formEncType:i,formData:void 0,json:void 0,text:n};if(s!=null)return{formMethod:e,formAction:r,formEncType:i,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:r,formEncType:i,formData:void 0,json:a,text:void 0}}}function Vy(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function J2(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Wu(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Z2(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function go(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function eF(t,e){try{let r=t.sessionStorage.getItem(QB);if(r){let i=JSON.parse(r);for(let[n,s]of Object.entries(i||{}))s&&Array.isArray(s)&&e.set(n,new Set(s||[]))}}catch{}}function tF(t,e){if(e.size>0){let r={};for(let[i,n]of e)r[i]=[...n];try{t.sessionStorage.setItem(QB,JSON.stringify(r))}catch(i){Il(!1,"Failed to save applied view transitions in sessionStorage ("+i+").")}}}/** + */function ni(){return ni=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Il(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function mL(){return Math.random().toString(36).substr(2,8)}function sk(t,e){return{usr:t.state,key:t.key,idx:e}}function Zd(t,e,r,i){return r===void 0&&(r=null),ni({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Pa(e):e,{state:r,key:e&&e.key||i||mL()})}function Ol(t){let{pathname:e="/",search:r="",hash:i=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Pa(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function gL(t,e,r,i){i===void 0&&(i={});let{window:n=document.defaultView,v5Compat:s=!1}=i,a=n.history,o=di.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(ni({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){o=di.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:o,location:m.location,delta:v})}function h(y,v){o=di.Push;let g=Zd(m.location,y,v);r&&r(g,y),c=u()+1;let b=sk(g,c),k=m.createHref(g);try{a.pushState(b,"",k)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(k)}s&&l&&l({action:o,location:m.location,delta:1})}function p(y,v){o=di.Replace;let g=Zd(m.location,y,v);r&&r(g,y),c=u();let b=sk(g,c),k=m.createHref(g);a.replaceState(b,"",k),s&&l&&l({action:o,location:m.location,delta:0})}function f(y){let v=n.location.origin!=="null"?n.location.origin:n.location.href,g=typeof y=="string"?y:Ol(y);return g=g.replace(/ $/,"%20"),Xt(v,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,v)}let m={get action(){return o},get location(){return t(n,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(nk,d),l=y,()=>{n.removeEventListener(nk,d),l=null}},createHref(y){return e(n,y)},createURL:f,encodeLocation(y){let v=f(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(y){return a.go(y)}};return m}var ti;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(ti||(ti={}));const yL=new Set(["lazy","caseSensitive","path","id","index","children"]);function bL(t){return t.index===!0}function E0(t,e,r,i){return r===void 0&&(r=[]),i===void 0&&(i={}),t.map((n,s)=>{let a=[...r,s],o=typeof n.id=="string"?n.id:a.join("-");if(Xt(n.index!==!0||!n.children,"Cannot specify children on an index route"),Xt(!i[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),bL(n)){let l=ni({},n,e(n),{id:o});return i[o]=l,l}else{let l=ni({},n,e(n),{id:o,children:void 0});return i[o]=l,n.children&&(l.children=E0(n.children,e,a,i)),l}})}function Pc(t,e,r){r===void 0&&(r="/");let i=typeof e=="string"?Pa(e):e,n=bu(i.pathname||"/",r);if(n==null)return null;let s=GB(t);wL(s);let a=null;for(let o=0;a==null&&o{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(Xt(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=ja([i,l.relativePath]),u=r.concat(l);s.children&&s.children.length>0&&(Xt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),GB(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:BL(c,s.index),routesMeta:u})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))n(s,a);else for(let l of jB(s.path))n(s,a,l)}),e}function jB(t){let e=t.split("/");if(e.length===0)return[];let[r,...i]=e,n=r.endsWith("?"),s=r.replace(/\?$/,"");if(i.length===0)return n?[s,""]:[s];let a=jB(i.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),n&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function wL(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:PL(e.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}const SL=/^:[\w-]+$/,xL=3,kL=2,CL=1,TL=10,_L=-2,ak=t=>t==="*";function BL(t,e){let r=t.split("/"),i=r.length;return r.some(ak)&&(i+=_L),e&&(i+=kL),r.filter(n=>!ak(n)).reduce((n,s)=>n+(SL.test(s)?xL:s===""?CL:TL),i)}function PL(t,e){return t.length===e.length&&t.slice(0,-1).every((i,n)=>i===e[n])?t[t.length-1]-e[e.length-1]:0}function NL(t,e){let{routesMeta:r}=t,i={},n="/",s=[];for(let a=0;a{let{paramName:h,isOptional:p}=u;if(h==="*"){let m=o[d]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const f=o[d];return p&&!f?c[h]=void 0:c[h]=(f||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:t}}function RL(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Il(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],n="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(i.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),n+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":t!==""&&t!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,e?void 0:"i"),i]}function ML(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Il(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function bu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,i=t.charAt(r);return i&&i!=="/"?null:t.slice(r)||"/"}function DL(t,e){e===void 0&&(e="/");let{pathname:r,search:i="",hash:n=""}=typeof t=="string"?Pa(t):t;return{pathname:r?r.startsWith("/")?r:LL(r,e):e,search:IL(i),hash:OL(n)}}function LL(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Oy(t,e,r,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function YB(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function hw(t,e){let r=YB(t);return e?r.map((i,n)=>n===t.length-1?i.pathname:i.pathnameBase):r.map(i=>i.pathnameBase)}function fw(t,e,r,i){i===void 0&&(i=!1);let n;typeof t=="string"?n=Pa(t):(n=ni({},t),Xt(!n.pathname||!n.pathname.includes("?"),Oy("?","pathname","search",n)),Xt(!n.pathname||!n.pathname.includes("#"),Oy("#","pathname","hash",n)),Xt(!n.search||!n.search.includes("#"),Oy("#","search","hash",n)));let s=t===""||n.pathname==="",a=s?"/":n.pathname,o;if(a==null)o=r;else{let d=e.length-1;if(!i&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;n.pathname=h.join("/")}o=d>=0?e[d]:"/"}let l=DL(n,o),c=a&&a!=="/"&&a.endsWith("/"),u=(s||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const ja=t=>t.join("/").replace(/\/\/+/g,"/"),FL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),IL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,OL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class pw{constructor(e,r,i,n){n===void 0&&(n=!1),this.status=e,this.statusText=r||"",this.internal=n,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}}function XB(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const qB=["post","put","patch","delete"],AL=new Set(qB),VL=["get",...qB],$L=new Set(VL),zL=new Set([301,302,303,307,308]),WL=new Set([307,308]),Ay={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},HL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},KB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UL=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),QB="remix-router-transitions";function GL(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",i=!r;Xt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let n;if(t.mapRouteProperties)n=t.mapRouteProperties;else if(t.detectErrorBoundary){let Z=t.detectErrorBoundary;n=se=>({hasErrorBoundary:Z(se)})}else n=UL;let s={},a=E0(t.routes,n,void 0,s),o,l=t.basename||"/",c=ni({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,d=new Set,h=null,p=null,f=null,m=t.hydrationData!=null,y=Pc(a,t.history.location,l),v=null;if(y==null){let Z=ss(404,{pathname:t.history.location.pathname}),{matches:se,route:_e}=pk(a);y=se,v={[_e.id]:Z}}let g,b=y.some(Z=>Z.route.lazy),k=y.some(Z=>Z.route.loader);if(b)g=!1;else if(!k)g=!0;else if(c.v7_partialHydration){let Z=t.hydrationData?t.hydrationData.loaderData:null,se=t.hydrationData?t.hydrationData.errors:null,_e=He=>He.route.loader?He.route.loader.hydrate===!0?!1:Z&&Z[He.route.id]!==void 0||se&&se[He.route.id]!==void 0:!0;if(se){let He=y.findIndex(it=>se[it.route.id]!==void 0);g=y.slice(0,He+1).every(_e)}else g=y.every(_e)}else g=t.hydrationData!=null;let C,x={historyAction:t.history.action,location:t.history.location,matches:y,initialized:g,navigation:Ay,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||v,fetchers:new Map,blockers:new Map},_=di.Pop,P=!1,R,E=!1,D=new Map,$=null,I=!1,F=!1,M=[],O=[],A=new Map,N=0,V=-1,W=new Map,Q=new Set,ne=new Map,ie=new Map,te=new Set,j=new Map,J=new Map,me=!1;function pe(){if(u=t.history.listen(Z=>{let{action:se,location:_e,delta:He}=Z;if(me){me=!1;return}Il(J.size===0||He!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let it=Oe({currentLocation:x.location,nextLocation:_e,historyAction:se});if(it&&He!=null){me=!0,t.history.go(He*-1),Le(it,{state:"blocked",location:_e,proceed(){Le(it,{state:"proceeding",proceed:void 0,reset:void 0,location:_e}),t.history.go(He)},reset(){let It=new Map(x.blockers);It.set(it,Vu),Ce({blockers:It})}});return}return Y(se,_e)}),r){rF(e,D);let Z=()=>iF(e,D);e.addEventListener("pagehide",Z),$=()=>e.removeEventListener("pagehide",Z)}return x.initialized||Y(di.Pop,x.location,{initialHydration:!0}),C}function De(){u&&u(),$&&$(),d.clear(),R&&R.abort(),x.fetchers.forEach((Z,se)=>Pt(se)),x.blockers.forEach((Z,se)=>xt(se))}function Be(Z){return d.add(Z),()=>d.delete(Z)}function Ce(Z,se){se===void 0&&(se={}),x=ni({},x,Z);let _e=[],He=[];c.v7_fetcherPersist&&x.fetchers.forEach((it,It)=>{it.state==="idle"&&(te.has(It)?He.push(It):_e.push(It))}),[...d].forEach(it=>it(x,{deletedFetchers:He,unstable_viewTransitionOpts:se.viewTransitionOpts,unstable_flushSync:se.flushSync===!0})),c.v7_fetcherPersist&&(_e.forEach(it=>x.fetchers.delete(it)),He.forEach(it=>Pt(it)))}function Te(Z,se,_e){var He,it;let{flushSync:It}=_e===void 0?{}:_e,kt=x.actionData!=null&&x.navigation.formMethod!=null&&As(x.navigation.formMethod)&&x.navigation.state==="loading"&&((He=Z.state)==null?void 0:He._isRedirect)!==!0,St;se.actionData?Object.keys(se.actionData).length>0?St=se.actionData:St=null:kt?St=x.actionData:St=null;let dt=se.loaderData?fk(x.loaderData,se.loaderData,se.matches||[],se.errors):x.loaderData,Ut=x.blockers;Ut.size>0&&(Ut=new Map(Ut),Ut.forEach((dr,ci)=>Ut.set(ci,Vu)));let wi=P===!0||x.navigation.formMethod!=null&&As(x.navigation.formMethod)&&((it=Z.state)==null?void 0:it._isRedirect)!==!0;o&&(a=o,o=void 0),I||_===di.Pop||(_===di.Push?t.history.push(Z,Z.state):_===di.Replace&&t.history.replace(Z,Z.state));let Ot;if(_===di.Pop){let dr=D.get(x.location.pathname);dr&&dr.has(Z.pathname)?Ot={currentLocation:x.location,nextLocation:Z}:D.has(Z.pathname)&&(Ot={currentLocation:Z,nextLocation:x.location})}else if(E){let dr=D.get(x.location.pathname);dr?dr.add(Z.pathname):(dr=new Set([Z.pathname]),D.set(x.location.pathname,dr)),Ot={currentLocation:x.location,nextLocation:Z}}Ce(ni({},se,{actionData:St,loaderData:dt,historyAction:_,location:Z,initialized:!0,navigation:Ay,revalidation:"idle",restoreScrollPosition:_r(Z,se.matches||x.matches),preventScrollReset:wi,blockers:Ut}),{viewTransitionOpts:Ot,flushSync:It===!0}),_=di.Pop,P=!1,E=!1,I=!1,F=!1,M=[],O=[]}async function X(Z,se){if(typeof Z=="number"){t.history.go(Z);return}let _e=R0(x.location,x.matches,l,c.v7_prependBasename,Z,c.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:He,submission:it,error:It}=ok(c.v7_normalizeFormMethod,!1,_e,se),kt=x.location,St=Zd(x.location,He,se&&se.state);St=ni({},St,t.history.encodeLocation(St));let dt=se&&se.replace!=null?se.replace:void 0,Ut=di.Push;dt===!0?Ut=di.Replace:dt===!1||it!=null&&As(it.formMethod)&&it.formAction===x.location.pathname+x.location.search&&(Ut=di.Replace);let wi=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,Ot=(se&&se.unstable_flushSync)===!0,dr=Oe({currentLocation:kt,nextLocation:St,historyAction:Ut});if(dr){Le(dr,{state:"blocked",location:St,proceed(){Le(dr,{state:"proceeding",proceed:void 0,reset:void 0,location:St}),X(Z,se)},reset(){let ci=new Map(x.blockers);ci.set(dr,Vu),Ce({blockers:ci})}});return}return await Y(Ut,St,{submission:it,pendingError:It,preventScrollReset:wi,replace:se&&se.replace,enableViewTransition:se&&se.unstable_viewTransition,flushSync:Ot})}function ee(){if(ge(),Ce({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){Y(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}Y(_||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation})}}async function Y(Z,se,_e){R&&R.abort(),R=null,_=Z,I=(_e&&_e.startUninterruptedRevalidation)===!0,Sr(x.location,x.matches),P=(_e&&_e.preventScrollReset)===!0,E=(_e&&_e.enableViewTransition)===!0;let He=o||a,it=_e&&_e.overrideNavigation,It=Pc(He,se,l),kt=(_e&&_e.flushSync)===!0;if(!It){let ci=ss(404,{pathname:se.pathname}),{matches:nn,route:Qr}=pk(He);wt(),Te(se,{matches:nn,loaderData:{},errors:{[Qr.id]:ci}},{flushSync:kt});return}if(x.initialized&&!F&&KL(x.location,se)&&!(_e&&_e.submission&&As(_e.submission.formMethod))){Te(se,{matches:It},{flushSync:kt});return}R=new AbortController;let St=zu(t.history,se,R.signal,_e&&_e.submission),dt,Ut;if(_e&&_e.pendingError)Ut={[Cd(It).route.id]:_e.pendingError};else if(_e&&_e.submission&&As(_e.submission.formMethod)){let ci=await Pe(St,se,_e.submission,It,{replace:_e.replace,flushSync:kt});if(ci.shortCircuited)return;dt=ci.pendingActionData,Ut=ci.pendingActionError,it=Vy(se,_e.submission),kt=!1,St=new Request(St.url,{signal:St.signal})}let{shortCircuited:wi,loaderData:Ot,errors:dr}=await ue(St,se,It,it,_e&&_e.submission,_e&&_e.fetcherSubmission,_e&&_e.replace,_e&&_e.initialHydration===!0,kt,dt,Ut);wi||(R=null,Te(se,ni({matches:It},dt?{actionData:dt}:{},{loaderData:Ot,errors:dr})))}async function Pe(Z,se,_e,He,it){it===void 0&&(it={}),ge();let It=eF(se,_e);Ce({navigation:It},{flushSync:it.flushSync===!0});let kt,St=D0(He,se);if(!St.route.action&&!St.route.lazy)kt={type:ti.error,error:ss(405,{method:Z.method,pathname:se.pathname,routeId:St.route.id})};else if(kt=await $u("action",Z,St,He,s,n,l,c.v7_relativeSplatPath),Z.signal.aborted)return{shortCircuited:!0};if(bl(kt)){let dt;return it&&it.replace!=null?dt=it.replace:dt=kt.location===x.location.pathname+x.location.search,await re(x,kt,{submission:_e,replace:dt}),{shortCircuited:!0}}if(Nc(kt)){let dt=Cd(He,St.route.id);return(it&&it.replace)!==!0&&(_=di.Push),{pendingActionData:{},pendingActionError:{[dt.route.id]:kt.error}}}if(yl(kt))throw ss(400,{type:"defer-action"});return{pendingActionData:{[St.route.id]:kt.data}}}async function ue(Z,se,_e,He,it,It,kt,St,dt,Ut,wi){let Ot=He||Vy(se,it),dr=it||It||yk(Ot),ci=o||a,[nn,Qr]=lk(t.history,x,_e,dr,se,c.v7_partialHydration&&St===!0,F,M,O,te,ne,Q,ci,l,Ut,wi);if(wt(nr=>!(_e&&_e.some(hr=>hr.route.id===nr))||nn&&nn.some(hr=>hr.route.id===nr)),V=++N,nn.length===0&&Qr.length===0){let nr=bt();return Te(se,ni({matches:_e,loaderData:{},errors:wi||null},Ut?{actionData:Ut}:{},nr?{fetchers:new Map(x.fetchers)}:{}),{flushSync:dt}),{shortCircuited:!0}}if(!I&&(!c.v7_partialHydration||!St)){Qr.forEach(hr=>{let wn=x.fetchers.get(hr.key),rf=Wu(void 0,wn?wn.data:void 0);x.fetchers.set(hr.key,rf)});let nr=Ut||x.actionData;Ce(ni({navigation:Ot},nr?Object.keys(nr).length===0?{actionData:null}:{actionData:nr}:{},Qr.length>0?{fetchers:new Map(x.fetchers)}:{}),{flushSync:dt})}Qr.forEach(nr=>{A.has(nr.key)&&ce(nr.key),nr.controller&&A.set(nr.key,nr.controller)});let sa=()=>Qr.forEach(nr=>ce(nr.key));R&&R.signal.addEventListener("abort",sa);let{results:Eu,loaderResults:gr,fetcherResults:xr}=await Se(x.matches,_e,nn,Qr,Z);if(Z.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",sa),Qr.forEach(nr=>A.delete(nr.key));let Ms=mk(Eu);if(Ms){if(Ms.idx>=nn.length){let nr=Qr[Ms.idx-nn.length].key;Q.add(nr)}return await re(x,Ms.result,{replace:kt}),{shortCircuited:!0}}let{loaderData:uo,errors:sn}=hk(x,_e,nn,gr,wi,Qr,xr,j);j.forEach((nr,hr)=>{nr.subscribe(wn=>{(wn||nr.done)&&j.delete(hr)})}),c.v7_partialHydration&&St&&x.errors&&Object.entries(x.errors).filter(nr=>{let[hr]=nr;return!nn.some(wn=>wn.route.id===hr)}).forEach(nr=>{let[hr,wn]=nr;sn=Object.assign(sn||{},{[hr]:wn})});let uy=bt(),Zl=Tt(V),tf=uy||Zl||Qr.length>0;return ni({loaderData:uo,errors:sn},tf?{fetchers:new Map(x.fetchers)}:{})}function L(Z,se,_e,He){if(i)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");A.has(Z)&&ce(Z);let it=(He&&He.unstable_flushSync)===!0,It=o||a,kt=R0(x.location,x.matches,l,c.v7_prependBasename,_e,c.v7_relativeSplatPath,se,He==null?void 0:He.relative),St=Pc(It,kt,l);if(!St){Ke(Z,se,ss(404,{pathname:kt}),{flushSync:it});return}let{path:dt,submission:Ut,error:wi}=ok(c.v7_normalizeFormMethod,!0,kt,He);if(wi){Ke(Z,se,wi,{flushSync:it});return}let Ot=D0(St,dt);if(P=(He&&He.preventScrollReset)===!0,Ut&&As(Ut.formMethod)){U(Z,se,dt,Ot,St,it,Ut);return}ne.set(Z,{routeId:se,path:dt}),G(Z,se,dt,Ot,St,it,Ut)}async function U(Z,se,_e,He,it,It,kt){if(ge(),ne.delete(Z),!He.route.action&&!He.route.lazy){let hr=ss(405,{method:kt.formMethod,pathname:_e,routeId:se});Ke(Z,se,hr,{flushSync:It});return}let St=x.fetchers.get(Z);Re(Z,tF(kt,St),{flushSync:It});let dt=new AbortController,Ut=zu(t.history,_e,dt.signal,kt);A.set(Z,dt);let wi=N,Ot=await $u("action",Ut,He,it,s,n,l,c.v7_relativeSplatPath);if(Ut.signal.aborted){A.get(Z)===dt&&A.delete(Z);return}if(c.v7_fetcherPersist&&te.has(Z)){if(bl(Ot)||Nc(Ot)){Re(Z,yo(void 0));return}}else{if(bl(Ot))if(A.delete(Z),V>wi){Re(Z,yo(void 0));return}else return Q.add(Z),Re(Z,Wu(kt)),re(x,Ot,{fetcherSubmission:kt});if(Nc(Ot)){Ke(Z,se,Ot.error);return}}if(yl(Ot))throw ss(400,{type:"defer-action"});let dr=x.navigation.location||x.location,ci=zu(t.history,dr,dt.signal),nn=o||a,Qr=x.navigation.state!=="idle"?Pc(nn,x.navigation.location,l):x.matches;Xt(Qr,"Didn't find any matches after fetcher action");let sa=++N;W.set(Z,sa);let Eu=Wu(kt,Ot.data);x.fetchers.set(Z,Eu);let[gr,xr]=lk(t.history,x,Qr,kt,dr,!1,F,M,O,te,ne,Q,nn,l,{[He.route.id]:Ot.data},void 0);xr.filter(hr=>hr.key!==Z).forEach(hr=>{let wn=hr.key,rf=x.fetchers.get(wn),WM=Wu(void 0,rf?rf.data:void 0);x.fetchers.set(wn,WM),A.has(wn)&&ce(wn),hr.controller&&A.set(wn,hr.controller)}),Ce({fetchers:new Map(x.fetchers)});let Ms=()=>xr.forEach(hr=>ce(hr.key));dt.signal.addEventListener("abort",Ms);let{results:uo,loaderResults:sn,fetcherResults:uy}=await Se(x.matches,Qr,gr,xr,ci);if(dt.signal.aborted)return;dt.signal.removeEventListener("abort",Ms),W.delete(Z),A.delete(Z),xr.forEach(hr=>A.delete(hr.key));let Zl=mk(uo);if(Zl){if(Zl.idx>=gr.length){let hr=xr[Zl.idx-gr.length].key;Q.add(hr)}return re(x,Zl.result)}let{loaderData:tf,errors:nr}=hk(x,x.matches,gr,sn,void 0,xr,uy,j);if(x.fetchers.has(Z)){let hr=yo(Ot.data);x.fetchers.set(Z,hr)}Tt(sa),x.navigation.state==="loading"&&sa>V?(Xt(_,"Expected pending action"),R&&R.abort(),Te(x.navigation.location,{matches:Qr,loaderData:tf,errors:nr,fetchers:new Map(x.fetchers)})):(Ce({errors:nr,loaderData:fk(x.loaderData,tf,Qr,nr),fetchers:new Map(x.fetchers)}),F=!1)}async function G(Z,se,_e,He,it,It,kt){let St=x.fetchers.get(Z);Re(Z,Wu(kt,St?St.data:void 0),{flushSync:It});let dt=new AbortController,Ut=zu(t.history,_e,dt.signal);A.set(Z,dt);let wi=N,Ot=await $u("loader",Ut,He,it,s,n,l,c.v7_relativeSplatPath);if(yl(Ot)&&(Ot=await eP(Ot,Ut.signal,!0)||Ot),A.get(Z)===dt&&A.delete(Z),!Ut.signal.aborted){if(te.has(Z)){Re(Z,yo(void 0));return}if(bl(Ot))if(V>wi){Re(Z,yo(void 0));return}else{Q.add(Z),await re(x,Ot);return}if(Nc(Ot)){Ke(Z,se,Ot.error);return}Xt(!yl(Ot),"Unhandled fetcher deferred data"),Re(Z,yo(Ot.data))}}async function re(Z,se,_e){let{submission:He,fetcherSubmission:it,replace:It}=_e===void 0?{}:_e;se.revalidate&&(F=!0);let kt=Zd(Z.location,se.location,{_isRedirect:!0});if(Xt(kt,"Expected a location on the redirect navigation"),r){let dr=!1;if(se.reloadDocument)dr=!0;else if(KB.test(se.location)){const ci=t.history.createURL(se.location);dr=ci.origin!==e.location.origin||bu(ci.pathname,l)==null}if(dr){It?e.location.replace(se.location):e.location.assign(se.location);return}}R=null;let St=It===!0?di.Replace:di.Push,{formMethod:dt,formAction:Ut,formEncType:wi}=Z.navigation;!He&&!it&&dt&&Ut&&wi&&(He=yk(Z.navigation));let Ot=He||it;if(WL.has(se.status)&&Ot&&As(Ot.formMethod))await Y(St,kt,{submission:ni({},Ot,{formAction:se.location}),preventScrollReset:P});else{let dr=Vy(kt,He);await Y(St,kt,{overrideNavigation:dr,fetcherSubmission:it,preventScrollReset:P})}}async function Se(Z,se,_e,He,it){let It=await Promise.all([..._e.map(dt=>$u("loader",it,dt,se,s,n,l,c.v7_relativeSplatPath)),...He.map(dt=>dt.matches&&dt.match&&dt.controller?$u("loader",zu(t.history,dt.path,dt.controller.signal),dt.match,dt.matches,s,n,l,c.v7_relativeSplatPath):{type:ti.error,error:ss(404,{pathname:dt.path})})]),kt=It.slice(0,_e.length),St=It.slice(_e.length);return await Promise.all([gk(Z,_e,kt,kt.map(()=>it.signal),!1,x.loaderData),gk(Z,He.map(dt=>dt.match),St,He.map(dt=>dt.controller?dt.controller.signal:null),!0)]),{results:It,loaderResults:kt,fetcherResults:St}}function ge(){F=!0,M.push(...wt()),ne.forEach((Z,se)=>{A.has(se)&&(O.push(se),ce(se))})}function Re(Z,se,_e){_e===void 0&&(_e={}),x.fetchers.set(Z,se),Ce({fetchers:new Map(x.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function Ke(Z,se,_e,He){He===void 0&&(He={});let it=Cd(x.matches,se);Pt(Z),Ce({errors:{[it.route.id]:_e},fetchers:new Map(x.fetchers)},{flushSync:(He&&He.flushSync)===!0})}function ct(Z){return c.v7_fetcherPersist&&(ie.set(Z,(ie.get(Z)||0)+1),te.has(Z)&&te.delete(Z)),x.fetchers.get(Z)||HL}function Pt(Z){let se=x.fetchers.get(Z);A.has(Z)&&!(se&&se.state==="loading"&&W.has(Z))&&ce(Z),ne.delete(Z),W.delete(Z),Q.delete(Z),te.delete(Z),x.fetchers.delete(Z)}function ve(Z){if(c.v7_fetcherPersist){let se=(ie.get(Z)||0)-1;se<=0?(ie.delete(Z),te.add(Z)):ie.set(Z,se)}else Pt(Z);Ce({fetchers:new Map(x.fetchers)})}function ce(Z){let se=A.get(Z);Xt(se,"Expected fetch controller: "+Z),se.abort(),A.delete(Z)}function Qe(Z){for(let se of Z){let _e=ct(se),He=yo(_e.data);x.fetchers.set(se,He)}}function bt(){let Z=[],se=!1;for(let _e of Q){let He=x.fetchers.get(_e);Xt(He,"Expected fetcher: "+_e),He.state==="loading"&&(Q.delete(_e),Z.push(_e),se=!0)}return Qe(Z),se}function Tt(Z){let se=[];for(let[_e,He]of W)if(He0}function Ie(Z,se){let _e=x.blockers.get(Z)||Vu;return J.get(Z)!==se&&J.set(Z,se),_e}function xt(Z){x.blockers.delete(Z),J.delete(Z)}function Le(Z,se){let _e=x.blockers.get(Z)||Vu;Xt(_e.state==="unblocked"&&se.state==="blocked"||_e.state==="blocked"&&se.state==="blocked"||_e.state==="blocked"&&se.state==="proceeding"||_e.state==="blocked"&&se.state==="unblocked"||_e.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+_e.state+" -> "+se.state);let He=new Map(x.blockers);He.set(Z,se),Ce({blockers:He})}function Oe(Z){let{currentLocation:se,nextLocation:_e,historyAction:He}=Z;if(J.size===0)return;J.size>1&&Il(!1,"A router only supports one blocker at a time");let it=Array.from(J.entries()),[It,kt]=it[it.length-1],St=x.blockers.get(It);if(!(St&&St.state==="proceeding")&&kt({currentLocation:se,nextLocation:_e,historyAction:He}))return It}function wt(Z){let se=[];return j.forEach((_e,He)=>{(!Z||Z(He))&&(_e.cancel(),se.push(He),j.delete(He))}),se}function st(Z,se,_e){if(h=Z,f=se,p=_e||null,!m&&x.navigation===Ay){m=!0;let He=_r(x.location,x.matches);He!=null&&Ce({restoreScrollPosition:He})}return()=>{h=null,f=null,p=null}}function Ht(Z,se){return p&&p(Z,se.map(He=>vL(He,x.loaderData)))||Z.key}function Sr(Z,se){if(h&&f){let _e=Ht(Z,se);h[_e]=f()}}function _r(Z,se){if(h){let _e=Ht(Z,se),He=h[_e];if(typeof He=="number")return He}return null}function Rs(Z){s={},o=E0(Z,n,void 0,s)}return C={get basename(){return l},get future(){return c},get state(){return x},get routes(){return a},get window(){return e},initialize:pe,subscribe:Be,enableScrollRestoration:st,navigate:X,fetch:L,revalidate:ee,createHref:Z=>t.history.createHref(Z),encodeLocation:Z=>t.history.encodeLocation(Z),getFetcher:ct,deleteFetcher:ve,dispose:De,getBlocker:Ie,deleteBlocker:xt,_internalFetchControllers:A,_internalActiveDeferreds:j,_internalSetRoutes:Rs},C}function jL(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function R0(t,e,r,i,n,s,a,o){let l,c;if(a){l=[];for(let d of e)if(l.push(d),d.route.id===a){c=d;break}}else l=e,c=e[e.length-1];let u=fw(n||".",hw(l,s),bu(t.pathname,r)||t.pathname,o==="path");return n==null&&(u.search=t.search,u.hash=t.hash),(n==null||n===""||n===".")&&c&&c.route.index&&!mw(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i&&r!=="/"&&(u.pathname=u.pathname==="/"?r:ja([r,u.pathname])),Ol(u)}function ok(t,e,r,i){if(!i||!jL(i))return{path:r};if(i.formMethod&&!ZL(i.formMethod))return{path:r,error:ss(405,{method:i.formMethod})};let n=()=>({path:r,error:ss(400,{type:"invalid-body"})}),s=i.formMethod||"get",a=t?s.toUpperCase():s.toLowerCase(),o=ZB(r);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!As(a))return n();let h=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((p,f)=>{let[m,y]=f;return""+p+m+"="+y+` +`},""):String(i.body);return{path:r,submission:{formMethod:a,formAction:o,formEncType:i.formEncType,formData:void 0,json:void 0,text:h}}}else if(i.formEncType==="application/json"){if(!As(a))return n();try{let h=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:r,submission:{formMethod:a,formAction:o,formEncType:i.formEncType,formData:void 0,json:h,text:void 0}}}catch{return n()}}}Xt(typeof FormData=="function","FormData is not available in this environment");let l,c;if(i.formData)l=M0(i.formData),c=i.formData;else if(i.body instanceof FormData)l=M0(i.body),c=i.body;else if(i.body instanceof URLSearchParams)l=i.body,c=dk(l);else if(i.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(i.body),c=dk(l)}catch{return n()}let u={formMethod:a,formAction:o,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(As(u.formMethod))return{path:r,submission:u};let d=Pa(r);return e&&d.search&&mw(d.search)&&l.append("index",""),d.search="?"+l,{path:Ol(d),submission:u}}function YL(t,e){let r=t;if(e){let i=t.findIndex(n=>n.route.id===e);i>=0&&(r=t.slice(0,i))}return r}function lk(t,e,r,i,n,s,a,o,l,c,u,d,h,p,f,m){let y=m?Object.values(m)[0]:f?Object.values(f)[0]:void 0,v=t.createURL(e.location),g=t.createURL(n),b=m?Object.keys(m)[0]:void 0,C=YL(r,b).filter((_,P)=>{let{route:R}=_;if(R.lazy)return!0;if(R.loader==null)return!1;if(s)return R.loader.hydrate?!0:e.loaderData[R.id]===void 0&&(!e.errors||e.errors[R.id]===void 0);if(XL(e.loaderData,e.matches[P],_)||o.some($=>$===_.route.id))return!0;let E=e.matches[P],D=_;return ck(_,ni({currentUrl:v,currentParams:E.params,nextUrl:g,nextParams:D.params},i,{actionResult:y,defaultShouldRevalidate:a||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||JB(E,D)}))}),x=[];return u.forEach((_,P)=>{if(s||!r.some(I=>I.route.id===_.routeId)||c.has(P))return;let R=Pc(h,_.path,p);if(!R){x.push({key:P,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let E=e.fetchers.get(P),D=D0(R,_.path),$=!1;d.has(P)?$=!1:l.includes(P)?$=!0:E&&E.state!=="idle"&&E.data===void 0?$=a:$=ck(D,ni({currentUrl:v,currentParams:e.matches[e.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},i,{actionResult:y,defaultShouldRevalidate:a})),$&&x.push({key:P,routeId:_.routeId,path:_.path,matches:R,match:D,controller:new AbortController})}),[C,x]}function XL(t,e,r){let i=!e||r.route.id!==e.route.id,n=t[r.route.id]===void 0;return i||n}function JB(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function ck(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}async function uk(t,e,r){if(!t.lazy)return;let i=await t.lazy();if(!t.lazy)return;let n=r[t.id];Xt(n,"No route found in manifest");let s={};for(let a in i){let l=n[a]!==void 0&&a!=="hasErrorBoundary";Il(!l,'Route "'+n.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!yL.has(a)&&(s[a]=i[a])}Object.assign(n,s),Object.assign(n,ni({},e(n),{lazy:void 0}))}async function $u(t,e,r,i,n,s,a,o,l){l===void 0&&(l={});let c,u,d,h=m=>{let y,v=new Promise((g,b)=>y=b);return d=()=>y(),e.signal.addEventListener("abort",d),Promise.race([m({request:e,params:r.params,context:l.requestContext}),v])};try{let m=r.route[t];if(r.route.lazy)if(m){let y,v=await Promise.all([h(m).catch(g=>{y=g}),uk(r.route,s,n)]);if(y)throw y;u=v[0]}else if(await uk(r.route,s,n),m=r.route[t],m)u=await h(m);else if(t==="action"){let y=new URL(e.url),v=y.pathname+y.search;throw ss(405,{method:e.method,pathname:v,routeId:r.route.id})}else return{type:ti.data,data:void 0};else if(m)u=await h(m);else{let y=new URL(e.url),v=y.pathname+y.search;throw ss(404,{pathname:v})}Xt(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(m){c=ti.error,u=m}finally{d&&e.signal.removeEventListener("abort",d)}if(JL(u)){let m=u.status;if(zL.has(m)){let v=u.headers.get("Location");if(Xt(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!KB.test(v))v=R0(new URL(e.url),i.slice(0,i.indexOf(r)+1),a,!0,v,o);else if(!l.isStaticRequest){let g=new URL(e.url),b=v.startsWith("//")?new URL(g.protocol+v):new URL(v),k=bu(b.pathname,a)!=null;b.origin===g.origin&&k&&(v=b.pathname+b.search+b.hash)}if(l.isStaticRequest)throw u.headers.set("Location",v),u;return{type:ti.redirect,status:m,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===ti.error?ti.error:ti.data,response:u};let y;try{let v=u.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?u.body==null?y=null:y=await u.json():y=await u.text()}catch(v){return{type:ti.error,error:v}}return c===ti.error?{type:c,error:new pw(m,u.statusText,y),headers:u.headers}:{type:ti.data,data:y,statusCode:u.status,headers:u.headers}}if(c===ti.error)return{type:c,error:u};if(QL(u)){var p,f;return{type:ti.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((f=u.init)==null?void 0:f.headers)&&new Headers(u.init.headers)}}return{type:ti.data,data:u}}function zu(t,e,r,i){let n=t.createURL(ZB(e)).toString(),s={signal:r};if(i&&As(i.formMethod)){let{formMethod:a,formEncType:o}=i;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(i.json)):o==="text/plain"?s.body=i.text:o==="application/x-www-form-urlencoded"&&i.formData?s.body=M0(i.formData):s.body=i.formData}return new Request(n,s)}function M0(t){let e=new URLSearchParams;for(let[r,i]of t.entries())e.append(r,typeof i=="string"?i:i.name);return e}function dk(t){let e=new FormData;for(let[r,i]of t.entries())e.append(r,i);return e}function qL(t,e,r,i,n){let s={},a=null,o,l=!1,c={};return r.forEach((u,d)=>{let h=e[d].route.id;if(Xt(!bl(u),"Cannot handle redirect results in processLoaderData"),Nc(u)){let p=Cd(t,h),f=u.error;i&&(f=Object.values(i)[0],i=void 0),a=a||{},a[p.route.id]==null&&(a[p.route.id]=f),s[h]=void 0,l||(l=!0,o=XB(u.error)?u.error.status:500),u.headers&&(c[h]=u.headers)}else yl(u)?(n.set(h,u.deferredData),s[h]=u.deferredData.data):s[h]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(o=u.statusCode),u.headers&&(c[h]=u.headers)}),i&&(a=i,s[Object.keys(i)[0]]=void 0),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:c}}function hk(t,e,r,i,n,s,a,o){let{loaderData:l,errors:c}=qL(e,r,i,n,o);for(let u=0;ui.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function pk(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function ss(t,e){let{pathname:r,routeId:i,method:n,type:s}=e===void 0?{}:e,a="Unknown Server Error",o="Unknown @remix-run/router error";return t===400?(a="Bad Request",n&&r&&i?o="You made a "+n+' request to "'+r+'" but '+('did not provide a `loader` for route "'+i+'", ')+"so there is no way to handle the request.":s==="defer-action"?o="defer() is not supported in actions":s==="invalid-body"&&(o="Unable to encode submission body")):t===403?(a="Forbidden",o='Route "'+i+'" does not match URL "'+r+'"'):t===404?(a="Not Found",o='No route matches URL "'+r+'"'):t===405&&(a="Method Not Allowed",n&&r&&i?o="You made a "+n.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+i+'", ')+"so there is no way to handle the request.":n&&(o='Invalid request method "'+n.toUpperCase()+'"')),new pw(t||500,a,new Error(o),!0)}function mk(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(bl(r))return{result:r,idx:e}}}function ZB(t){let e=typeof t=="string"?Pa(t):t;return Ol(ni({},e,{hash:""}))}function KL(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function yl(t){return t.type===ti.deferred}function Nc(t){return t.type===ti.error}function bl(t){return(t&&t.type)===ti.redirect}function QL(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function JL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function ZL(t){return $L.has(t.toLowerCase())}function As(t){return AL.has(t.toLowerCase())}async function gk(t,e,r,i,n,s){for(let a=0;ad.route.id===l.route.id),u=c!=null&&!JB(c,l)&&(s&&s[l.route.id])!==void 0;if(yl(o)&&(n||u)){let d=i[a];Xt(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await eP(o,d,n).then(h=>{h&&(r[a]=h||r[a])})}}}async function eP(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:ti.data,data:t.deferredData.unwrappedData}}catch(n){return{type:ti.error,error:n}}return{type:ti.data,data:t.deferredData.data}}}function mw(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function D0(t,e){let r=typeof e=="string"?Pa(e).search:e.search;if(t[t.length-1].route.index&&mw(r||""))return t[t.length-1];let i=YB(t);return i[i.length-1]}function yk(t){let{formMethod:e,formAction:r,formEncType:i,text:n,formData:s,json:a}=t;if(!(!e||!r||!i)){if(n!=null)return{formMethod:e,formAction:r,formEncType:i,formData:void 0,json:void 0,text:n};if(s!=null)return{formMethod:e,formAction:r,formEncType:i,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:r,formEncType:i,formData:void 0,json:a,text:void 0}}}function Vy(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eF(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Wu(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function tF(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function yo(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function rF(t,e){try{let r=t.sessionStorage.getItem(QB);if(r){let i=JSON.parse(r);for(let[n,s]of Object.entries(i||{}))s&&Array.isArray(s)&&e.set(n,new Set(s||[]))}}catch{}}function iF(t,e){if(e.size>0){let r={};for(let[i,n]of e)r[i]=[...n];try{t.sessionStorage.setItem(QB,JSON.stringify(r))}catch(i){Il(!1,"Failed to save applied view transitions in sessionStorage ("+i+").")}}}/** * React Router v6.22.3 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function eh(){return eh=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),w.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){i.go(c);return}let d=fw(c,JSON.parse(a),s,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ga([e,d.pathname])),(u.replace?i.replace:i.push)(d,u.state,u)},[e,i,a,s,t])}function nP(t,e){let{relative:r}=e===void 0?{}:e,{future:i}=w.useContext(jl),{matches:n}=w.useContext(Yl),{pathname:s}=Wm(),a=JSON.stringify(hw(n,i.v7_relativeSplatPath));return w.useMemo(()=>fw(t,JSON.parse(a),s,r==="path"),[t,a,s,r])}function sF(t,e,r,i){Dh()||Xt(!1);let{navigator:n}=w.useContext(jl),{matches:s}=w.useContext(Yl),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=Wm(),u;if(e){var d;let y=typeof e=="string"?Pa(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Xt(!1),u=y}else u=c;let h=u.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let f=Pc(t,{pathname:p}),m=uF(f&&f.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:Ga([l,n.encodeLocation?n.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Ga([l,n.encodeLocation?n.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,r,i);return e&&m?w.createElement(zm.Provider,{value:{location:eh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ui.Pop}},m):m}function aF(){let t=pF(),e=XB(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),r?w.createElement("pre",{style:n},r):null,null)}const oF=w.createElement(aF,null);class lF extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?w.createElement(Yl.Provider,{value:this.props.routeContext},w.createElement(rP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function cF(t){let{routeContext:e,match:r,children:i}=t,n=w.useContext($m);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Yl.Provider,{value:e},i)}function uF(t,e,r,i){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),i===void 0&&(i=null),t==null){var s;if((s=r)!=null&&s.errors)t=r.matches;else return null}let a=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let u=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id]));u>=0||Xt(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(r&&i&&i.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let p,f=!1,m=null,y=null;r&&(p=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||oF,l&&(c<0&&h===0?(gF("route-fallback",!1),f=!0,y=null):c===h&&(f=!0,y=d.route.hydrateFallbackElement||null)));let v=e.concat(a.slice(0,h+1)),g=()=>{let b;return p?b=m:f?b=y:d.route.Component?b=w.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,w.createElement(cF,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:r!=null},children:b})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?w.createElement(lF,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):g()},null)}var sP=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(sP||{}),jp=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(jp||{});function dF(t){let e=w.useContext($m);return e||Xt(!1),e}function hF(t){let e=w.useContext(tP);return e||Xt(!1),e}function fF(t){let e=w.useContext(Yl);return e||Xt(!1),e}function aP(t){let e=fF(),r=e.matches[e.matches.length-1];return r.route.id||Xt(!1),r.route.id}function pF(){var t;let e=w.useContext(rP),r=hF(jp.UseRouteError),i=aP(jp.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[i]}function mF(){let{router:t}=dF(sP.UseNavigateStable),e=aP(jp.UseNavigateStable),r=w.useRef(!1);return iP(()=>{r.current=!0}),w.useCallback(function(n,s){s===void 0&&(s={}),r.current&&(typeof n=="number"?t.navigate(n):t.navigate(n,eh({fromRouteId:e},s)))},[t,e])}const bk={};function gF(t,e,r){!e&&!bk[t]&&(bk[t]=!0)}function yF(t){let{basename:e="/",children:r=null,location:i,navigationType:n=ui.Pop,navigator:s,static:a=!1,future:o}=t;Dh()&&Xt(!1);let l=e.replace(/^\/*/,"/"),c=w.useMemo(()=>({basename:l,navigator:s,static:a,future:eh({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof i=="string"&&(i=Pa(i));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:f="default"}=i,m=w.useMemo(()=>{let y=bu(u,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:f},navigationType:n}},[l,u,d,h,p,f,n]);return m==null?null:w.createElement(jl.Provider,{value:c},w.createElement(zm.Provider,{children:r,value:m}))}new Promise(()=>{});function bF(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:w.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:w.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:w.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function eh(){return eh=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),w.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){i.go(c);return}let d=fw(c,JSON.parse(a),s,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:ja([e,d.pathname])),(u.replace?i.replace:i.push)(d,u.state,u)},[e,i,a,s,t])}function nP(t,e){let{relative:r}=e===void 0?{}:e,{future:i}=w.useContext(jl),{matches:n}=w.useContext(Yl),{pathname:s}=Wm(),a=JSON.stringify(hw(n,i.v7_relativeSplatPath));return w.useMemo(()=>fw(t,JSON.parse(a),s,r==="path"),[t,a,s,r])}function oF(t,e,r,i){Dh()||Xt(!1);let{navigator:n}=w.useContext(jl),{matches:s}=w.useContext(Yl),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=Wm(),u;if(e){var d;let y=typeof e=="string"?Pa(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Xt(!1),u=y}else u=c;let h=u.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let f=Pc(t,{pathname:p}),m=hF(f&&f.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:ja([l,n.encodeLocation?n.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ja([l,n.encodeLocation?n.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,r,i);return e&&m?w.createElement(zm.Provider,{value:{location:eh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:di.Pop}},m):m}function lF(){let t=gF(),e=XB(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),r?w.createElement("pre",{style:n},r):null,null)}const cF=w.createElement(lF,null);class uF extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?w.createElement(Yl.Provider,{value:this.props.routeContext},w.createElement(rP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dF(t){let{routeContext:e,match:r,children:i}=t,n=w.useContext($m);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Yl.Provider,{value:e},i)}function hF(t,e,r,i){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),i===void 0&&(i=null),t==null){var s;if((s=r)!=null&&s.errors)t=r.matches;else return null}let a=t,o=(n=r)==null?void 0:n.errors;if(o!=null){let u=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id]));u>=0||Xt(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(r&&i&&i.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let p,f=!1,m=null,y=null;r&&(p=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||cF,l&&(c<0&&h===0?(bF("route-fallback",!1),f=!0,y=null):c===h&&(f=!0,y=d.route.hydrateFallbackElement||null)));let v=e.concat(a.slice(0,h+1)),g=()=>{let b;return p?b=m:f?b=y:d.route.Component?b=w.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,w.createElement(dF,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:r!=null},children:b})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?w.createElement(uF,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):g()},null)}var sP=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(sP||{}),jp=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(jp||{});function fF(t){let e=w.useContext($m);return e||Xt(!1),e}function pF(t){let e=w.useContext(tP);return e||Xt(!1),e}function mF(t){let e=w.useContext(Yl);return e||Xt(!1),e}function aP(t){let e=mF(),r=e.matches[e.matches.length-1];return r.route.id||Xt(!1),r.route.id}function gF(){var t;let e=w.useContext(rP),r=pF(jp.UseRouteError),i=aP(jp.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[i]}function yF(){let{router:t}=fF(sP.UseNavigateStable),e=aP(jp.UseNavigateStable),r=w.useRef(!1);return iP(()=>{r.current=!0}),w.useCallback(function(n,s){s===void 0&&(s={}),r.current&&(typeof n=="number"?t.navigate(n):t.navigate(n,eh({fromRouteId:e},s)))},[t,e])}const bk={};function bF(t,e,r){!e&&!bk[t]&&(bk[t]=!0)}function vF(t){let{basename:e="/",children:r=null,location:i,navigationType:n=di.Pop,navigator:s,static:a=!1,future:o}=t;Dh()&&Xt(!1);let l=e.replace(/^\/*/,"/"),c=w.useMemo(()=>({basename:l,navigator:s,static:a,future:eh({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof i=="string"&&(i=Pa(i));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:f="default"}=i,m=w.useMemo(()=>{let y=bu(u,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:f},navigationType:n}},[l,u,d,h,p,f,n]);return m==null?null:w.createElement(jl.Provider,{value:c},w.createElement(zm.Provider,{children:r,value:m}))}new Promise(()=>{});function wF(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:w.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:w.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:w.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.22.3 * * Copyright (c) Remix Software Inc. @@ -65,14 +65,14 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function th(){return th=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[n]=t[n]);return r}function wF(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function SF(t,e){return t.button===0&&(!e||e==="_self")&&!wF(t)}const xF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],kF="6";try{window.__reactRouterVersion=kF}catch{}function CF(t,e){return H2({basename:e==null?void 0:e.basename,future:th({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:h2({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||TF(),routes:t,mapRouteProperties:bF,window:e==null?void 0:e.window}).initialize()}function TF(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=th({},e,{errors:_F(e.errors)})),e}function _F(t){if(!t)return null;let e=Object.entries(t),r={};for(let[i,n]of e)if(n&&n.__type==="RouteErrorResponse")r[i]=new pw(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let s=window[n.__subType];if(typeof s=="function")try{let a=new s(n.message);a.stack="",r[i]=a}catch{}}if(r[i]==null){let s=new Error(n.message);s.stack="",r[i]=s}}else r[i]=n;return r}const BF=w.createContext({isTransitioning:!1}),PF=w.createContext(new Map),NF="startTransition",vk=Gc[NF],EF="flushSync",wk=d2[EF];function RF(t){vk?vk(t):t()}function Hu(t){wk?wk(t):t()}class MF{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",r(i))}})}}function DF(t){let{fallbackElement:e,router:r,future:i}=t,[n,s]=w.useState(r.state),[a,o]=w.useState(),[l,c]=w.useState({isTransitioning:!1}),[u,d]=w.useState(),[h,p]=w.useState(),[f,m]=w.useState(),y=w.useRef(new Map),{v7_startTransition:v}=i||{},g=w.useCallback(_=>{v?RF(_):_()},[v]),b=w.useCallback((_,P)=>{let{deletedFetchers:R,unstable_flushSync:E,unstable_viewTransitionOpts:D}=P;R.forEach(I=>y.current.delete(I)),_.fetchers.forEach((I,F)=>{I.data!==void 0&&y.current.set(F,I.data)});let $=r.window==null||typeof r.window.document.startViewTransition!="function";if(!D||$){E?Hu(()=>s(_)):g(()=>s(_));return}if(E){Hu(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let I=r.window.document.startViewTransition(()=>{Hu(()=>s(_))});I.finished.finally(()=>{Hu(()=>{d(void 0),p(void 0),o(void 0),c({isTransitioning:!1})})}),Hu(()=>p(I));return}h?(u&&u.resolve(),h.skipTransition(),m({state:_,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(o(_),c({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[r.window,h,u,y,g]);w.useLayoutEffect(()=>r.subscribe(b),[r,b]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new MF)},[l]),w.useEffect(()=>{if(u&&a&&r.window){let _=a,P=u.promise,R=r.window.document.startViewTransition(async()=>{g(()=>s(_)),await P});R.finished.finally(()=>{d(void 0),p(void 0),o(void 0),c({isTransitioning:!1})}),p(R)}},[g,a,u,r.window]),w.useEffect(()=>{u&&a&&n.location.key===a.location.key&&u.resolve()},[u,h,n.location,a]),w.useEffect(()=>{!l.isTransitioning&&f&&(o(f.state),c({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),m(void 0))},[l.isTransitioning,f]),w.useEffect(()=>{},[]);let k=w.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:_=>r.navigate(_),push:(_,P,R)=>r.navigate(_,{state:P,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(_,P,R)=>r.navigate(_,{replace:!0,state:P,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[r]),C=r.basename||"/",x=w.useMemo(()=>({router:r,navigator:k,static:!1,basename:C}),[r,k,C]);return w.createElement(w.Fragment,null,w.createElement($m.Provider,{value:x},w.createElement(tP.Provider,{value:n},w.createElement(PF.Provider,{value:y.current},w.createElement(BF.Provider,{value:l},w.createElement(yF,{basename:C,location:n.location,navigationType:n.historyAction,navigator:k,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},n.initialized||r.future.v7_partialHydration?w.createElement(LF,{routes:r.routes,future:r.future,state:n}):e))))),null)}function LF(t){let{routes:e,future:r,state:i}=t;return sF(e,void 0,i,r)}const FF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",IF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jo=w.forwardRef(function(e,r){let{onClick:i,relative:n,reloadDocument:s,replace:a,state:o,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=e,h=vF(e,xF),{basename:p}=w.useContext(jl),f,m=!1;if(typeof c=="string"&&IF.test(c)&&(f=c,FF))try{let b=new URL(window.location.href),k=c.startsWith("//")?new URL(b.protocol+c):new URL(c),C=bu(k.pathname,p);k.origin===b.origin&&C!=null?c=C+k.search+k.hash:m=!0}catch{}let y=rF(c,{relative:n}),v=OF(c,{replace:a,state:o,target:l,preventScrollReset:u,relative:n,unstable_viewTransition:d});function g(b){i&&i(b),b.defaultPrevented||v(b)}return w.createElement("a",th({},h,{href:f||y,onClick:m||s?i:g,ref:r,target:l}))});var Sk;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Sk||(Sk={}));var xk;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(xk||(xk={}));function OF(t,e){let{target:r,replace:i,state:n,preventScrollReset:s,relative:a,unstable_viewTransition:o}=e===void 0?{}:e,l=iF(),c=Wm(),u=nP(t,{relative:a});return w.useCallback(d=>{if(SF(d,r)){d.preventDefault();let h=i!==void 0?i:Ol(c)===Ol(u);l(t,{replace:h,state:n,preventScrollReset:s,relative:a,unstable_viewTransition:o})}},[c,l,u,i,n,r,t,s,a,o])}const AF={black:"#000",white:"#fff"},rh=AF,VF={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"},tc=VF,$F={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"},rc=$F,zF={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"},ic=zF,WF={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"},nc=WF,HF={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"},sc=HF,UF={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"},Uu=UF,GF={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"},jF=GF;function Qa(t){let e="https://mui.com/production-error/?code="+t;for(let r=1;r=0)continue;r[i]=t[i]}return r}function oP(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var XF=/^((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|disableRemotePlayback|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)-.*))$/,qF=oP(function(t){return XF.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function KF(t){if(t.sheet)return t.sheet;for(var e=0;e0?Gi(vu,--Fn):0,Zc--,Ti===10&&(Zc=1,Um--),Ti}function Xn(){return Ti=Fn2||nh(Ti)>3?"":" "}function cI(t,e){for(;--e&&Xn()&&!(Ti<48||Ti>102||Ti>57&&Ti<65||Ti>70&&Ti<97););return Fh(t,lp()+(e<6&&wa()==32&&Xn()==32))}function F0(t){for(;Xn();)switch(Ti){case t:return Fn;case 34:case 39:t!==34&&t!==39&&F0(Ti);break;case 40:t===41&&F0(t);break;case 92:Xn();break}return Fn}function uI(t,e){for(;Xn()&&t+Ti!==57;)if(t+Ti===84&&wa()===47)break;return"/*"+Fh(e,Fn-1)+"*"+Hm(t===47?t:Xn())}function dI(t){for(;!nh(wa());)Xn();return Fh(t,Fn)}function hI(t){return fP(up("",null,null,null,[""],t=hP(t),0,[0],t))}function up(t,e,r,i,n,s,a,o,l){for(var c=0,u=0,d=a,h=0,p=0,f=0,m=1,y=1,v=1,g=0,b="",k=n,C=s,x=i,_=b;y;)switch(f=g,g=Xn()){case 40:if(f!=108&&Gi(_,d-1)==58){L0(_+=ar(cp(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:_+=cp(g);break;case 9:case 10:case 13:case 32:_+=lI(f);break;case 92:_+=cI(lp()-1,7);continue;case 47:switch(wa()){case 42:case 47:Sf(fI(uI(Xn(),lp()),e,r),l);break;default:_+="/"}break;case 123*m:o[c++]=ca(_)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:y=0;case 59+u:v==-1&&(_=ar(_,/\f/g,"")),p>0&&ca(_)-d&&Sf(p>32?Ck(_+";",i,r,d-1):Ck(ar(_," ","")+";",i,r,d-2),l);break;case 59:_+=";";default:if(Sf(x=kk(_,e,r,c,u,n,o,b,k=[],C=[],d),s),g===123)if(u===0)up(_,e,x,x,k,s,d,o,C);else switch(h===99&&Gi(_,3)===110?100:h){case 100:case 108:case 109:case 115:up(t,x,x,i&&Sf(kk(t,x,x,0,0,n,o,b,n,k=[],d),C),n,C,d,o,i?k:C);break;default:up(_,x,x,x,[""],C,0,o,C)}}c=u=p=0,m=v=1,b=_="",d=a;break;case 58:d=1+ca(_),p=f;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&oI()==125)continue}switch(_+=Hm(g),g*m){case 38:v=u>0?1:(_+="\f",-1);break;case 44:o[c++]=(ca(_)-1)*v,v=1;break;case 64:wa()===45&&(_+=cp(Xn())),h=wa(),u=d=ca(b=_+=dI(lp())),g++;break;case 45:f===45&&ca(_)==2&&(m=0)}}return s}function kk(t,e,r,i,n,s,a,o,l,c,u){for(var d=n-1,h=n===0?s:[""],p=bw(h),f=0,m=0,y=0;f0?h[v]+" "+g:ar(g,/&\f/g,h[v])))&&(l[y++]=b);return Gm(t,e,r,n===0?gw:o,l,c,u)}function fI(t,e,r){return Gm(t,e,r,lP,Hm(aI()),ih(t,2,-2),0)}function Ck(t,e,r,i){return Gm(t,e,r,yw,ih(t,0,i),ih(t,i+1,-1),i)}function $c(t,e){for(var r="",i=bw(t),n=0;n6)switch(Gi(t,e+1)){case 109:if(Gi(t,e+4)!==45)break;case 102:return ar(t,/(.+:)(.+)-([^]+)/,"$1"+sr+"$2-$3$1"+Yp+(Gi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~L0(t,"stretch")?pP(ar(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Gi(t,e+1)!==115)break;case 6444:switch(Gi(t,ca(t)-3-(~L0(t,"!important")&&10))){case 107:return ar(t,":",":"+sr)+t;case 101:return ar(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+sr+(Gi(t,14)===45?"inline-":"")+"box$3$1"+sr+"$2$3$1"+Qi+"$2box$3")+t}break;case 5936:switch(Gi(t,e+11)){case 114:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return sr+t+Qi+t+t}return t}var xI=function(e,r,i,n){if(e.length>-1&&!e.return)switch(e.type){case yw:e.return=pP(e.value,e.length);break;case cP:return $c([Gu(e,{value:ar(e.value,"@","@"+sr)})],n);case gw:if(e.length)return sI(e.props,function(s){switch(nI(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return $c([Gu(e,{props:[ar(s,/:(read-\w+)/,":"+Yp+"$1")]})],n);case"::placeholder":return $c([Gu(e,{props:[ar(s,/:(plac\w+)/,":"+sr+"input-$1")]}),Gu(e,{props:[ar(s,/:(plac\w+)/,":"+Yp+"$1")]}),Gu(e,{props:[ar(s,/:(plac\w+)/,Qi+"input-$1")]})],n)}return""})}},kI=[xI],mP=function(e){var r=e.key;if(r==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var n=e.stylisPlugins||kI,s={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),v=1;v=0)&&(r[n]=t[n]);return r}function xF(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function kF(t,e){return t.button===0&&(!e||e==="_self")&&!xF(t)}const CF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],TF="6";try{window.__reactRouterVersion=TF}catch{}function _F(t,e){return GL({basename:e==null?void 0:e.basename,future:th({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:pL({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||BF(),routes:t,mapRouteProperties:wF,window:e==null?void 0:e.window}).initialize()}function BF(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=th({},e,{errors:PF(e.errors)})),e}function PF(t){if(!t)return null;let e=Object.entries(t),r={};for(let[i,n]of e)if(n&&n.__type==="RouteErrorResponse")r[i]=new pw(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let s=window[n.__subType];if(typeof s=="function")try{let a=new s(n.message);a.stack="",r[i]=a}catch{}}if(r[i]==null){let s=new Error(n.message);s.stack="",r[i]=s}}else r[i]=n;return r}const NF=w.createContext({isTransitioning:!1}),EF=w.createContext(new Map),RF="startTransition",vk=Gc[RF],MF="flushSync",wk=fL[MF];function DF(t){vk?vk(t):t()}function Hu(t){wk?wk(t):t()}class LF{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",r(i))}})}}function FF(t){let{fallbackElement:e,router:r,future:i}=t,[n,s]=w.useState(r.state),[a,o]=w.useState(),[l,c]=w.useState({isTransitioning:!1}),[u,d]=w.useState(),[h,p]=w.useState(),[f,m]=w.useState(),y=w.useRef(new Map),{v7_startTransition:v}=i||{},g=w.useCallback(_=>{v?DF(_):_()},[v]),b=w.useCallback((_,P)=>{let{deletedFetchers:R,unstable_flushSync:E,unstable_viewTransitionOpts:D}=P;R.forEach(I=>y.current.delete(I)),_.fetchers.forEach((I,F)=>{I.data!==void 0&&y.current.set(F,I.data)});let $=r.window==null||typeof r.window.document.startViewTransition!="function";if(!D||$){E?Hu(()=>s(_)):g(()=>s(_));return}if(E){Hu(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let I=r.window.document.startViewTransition(()=>{Hu(()=>s(_))});I.finished.finally(()=>{Hu(()=>{d(void 0),p(void 0),o(void 0),c({isTransitioning:!1})})}),Hu(()=>p(I));return}h?(u&&u.resolve(),h.skipTransition(),m({state:_,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(o(_),c({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[r.window,h,u,y,g]);w.useLayoutEffect(()=>r.subscribe(b),[r,b]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new LF)},[l]),w.useEffect(()=>{if(u&&a&&r.window){let _=a,P=u.promise,R=r.window.document.startViewTransition(async()=>{g(()=>s(_)),await P});R.finished.finally(()=>{d(void 0),p(void 0),o(void 0),c({isTransitioning:!1})}),p(R)}},[g,a,u,r.window]),w.useEffect(()=>{u&&a&&n.location.key===a.location.key&&u.resolve()},[u,h,n.location,a]),w.useEffect(()=>{!l.isTransitioning&&f&&(o(f.state),c({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),m(void 0))},[l.isTransitioning,f]),w.useEffect(()=>{},[]);let k=w.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:_=>r.navigate(_),push:(_,P,R)=>r.navigate(_,{state:P,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(_,P,R)=>r.navigate(_,{replace:!0,state:P,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[r]),C=r.basename||"/",x=w.useMemo(()=>({router:r,navigator:k,static:!1,basename:C}),[r,k,C]);return w.createElement(w.Fragment,null,w.createElement($m.Provider,{value:x},w.createElement(tP.Provider,{value:n},w.createElement(EF.Provider,{value:y.current},w.createElement(NF.Provider,{value:l},w.createElement(vF,{basename:C,location:n.location,navigationType:n.historyAction,navigator:k,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},n.initialized||r.future.v7_partialHydration?w.createElement(IF,{routes:r.routes,future:r.future,state:n}):e))))),null)}function IF(t){let{routes:e,future:r,state:i}=t;return oF(e,void 0,i,r)}const OF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",AF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zo=w.forwardRef(function(e,r){let{onClick:i,relative:n,reloadDocument:s,replace:a,state:o,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=e,h=SF(e,CF),{basename:p}=w.useContext(jl),f,m=!1;if(typeof c=="string"&&AF.test(c)&&(f=c,OF))try{let b=new URL(window.location.href),k=c.startsWith("//")?new URL(b.protocol+c):new URL(c),C=bu(k.pathname,p);k.origin===b.origin&&C!=null?c=C+k.search+k.hash:m=!0}catch{}let y=nF(c,{relative:n}),v=VF(c,{replace:a,state:o,target:l,preventScrollReset:u,relative:n,unstable_viewTransition:d});function g(b){i&&i(b),b.defaultPrevented||v(b)}return w.createElement("a",th({},h,{href:f||y,onClick:m||s?i:g,ref:r,target:l}))});var Sk;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Sk||(Sk={}));var xk;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(xk||(xk={}));function VF(t,e){let{target:r,replace:i,state:n,preventScrollReset:s,relative:a,unstable_viewTransition:o}=e===void 0?{}:e,l=sF(),c=Wm(),u=nP(t,{relative:a});return w.useCallback(d=>{if(kF(d,r)){d.preventDefault();let h=i!==void 0?i:Ol(c)===Ol(u);l(t,{replace:h,state:n,preventScrollReset:s,relative:a,unstable_viewTransition:o})}},[c,l,u,i,n,r,t,s,a,o])}const $F={black:"#000",white:"#fff"},rh=$F,zF={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"},tc=zF,WF={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"},rc=WF,HF={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"},ic=HF,UF={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"},nc=UF,GF={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"},sc=GF,jF={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"},Uu=jF,YF={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"},XF=YF;function Ja(t){let e="https://mui.com/production-error/?code="+t;for(let r=1;r=0)continue;r[i]=t[i]}return r}function oP(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var KF=/^((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|disableRemotePlayback|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)-.*))$/,QF=oP(function(t){return KF.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function JF(t){if(t.sheet)return t.sheet;for(var e=0;e0?Gi(vu,--Fn):0,Zc--,Ti===10&&(Zc=1,Um--),Ti}function Xn(){return Ti=Fn2||nh(Ti)>3?"":" "}function dI(t,e){for(;--e&&Xn()&&!(Ti<48||Ti>102||Ti>57&&Ti<65||Ti>70&&Ti<97););return Fh(t,lp()+(e<6&&wa()==32&&Xn()==32))}function F0(t){for(;Xn();)switch(Ti){case t:return Fn;case 34:case 39:t!==34&&t!==39&&F0(Ti);break;case 40:t===41&&F0(t);break;case 92:Xn();break}return Fn}function hI(t,e){for(;Xn()&&t+Ti!==57;)if(t+Ti===84&&wa()===47)break;return"/*"+Fh(e,Fn-1)+"*"+Hm(t===47?t:Xn())}function fI(t){for(;!nh(wa());)Xn();return Fh(t,Fn)}function pI(t){return fP(up("",null,null,null,[""],t=hP(t),0,[0],t))}function up(t,e,r,i,n,s,a,o,l){for(var c=0,u=0,d=a,h=0,p=0,f=0,m=1,y=1,v=1,g=0,b="",k=n,C=s,x=i,_=b;y;)switch(f=g,g=Xn()){case 40:if(f!=108&&Gi(_,d-1)==58){L0(_+=ar(cp(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:_+=cp(g);break;case 9:case 10:case 13:case 32:_+=uI(f);break;case 92:_+=dI(lp()-1,7);continue;case 47:switch(wa()){case 42:case 47:Sf(mI(hI(Xn(),lp()),e,r),l);break;default:_+="/"}break;case 123*m:o[c++]=ca(_)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:y=0;case 59+u:v==-1&&(_=ar(_,/\f/g,"")),p>0&&ca(_)-d&&Sf(p>32?Ck(_+";",i,r,d-1):Ck(ar(_," ","")+";",i,r,d-2),l);break;case 59:_+=";";default:if(Sf(x=kk(_,e,r,c,u,n,o,b,k=[],C=[],d),s),g===123)if(u===0)up(_,e,x,x,k,s,d,o,C);else switch(h===99&&Gi(_,3)===110?100:h){case 100:case 108:case 109:case 115:up(t,x,x,i&&Sf(kk(t,x,x,0,0,n,o,b,n,k=[],d),C),n,C,d,o,i?k:C);break;default:up(_,x,x,x,[""],C,0,o,C)}}c=u=p=0,m=v=1,b=_="",d=a;break;case 58:d=1+ca(_),p=f;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&cI()==125)continue}switch(_+=Hm(g),g*m){case 38:v=u>0?1:(_+="\f",-1);break;case 44:o[c++]=(ca(_)-1)*v,v=1;break;case 64:wa()===45&&(_+=cp(Xn())),h=wa(),u=d=ca(b=_+=fI(lp())),g++;break;case 45:f===45&&ca(_)==2&&(m=0)}}return s}function kk(t,e,r,i,n,s,a,o,l,c,u){for(var d=n-1,h=n===0?s:[""],p=bw(h),f=0,m=0,y=0;f0?h[v]+" "+g:ar(g,/&\f/g,h[v])))&&(l[y++]=b);return Gm(t,e,r,n===0?gw:o,l,c,u)}function mI(t,e,r){return Gm(t,e,r,lP,Hm(lI()),ih(t,2,-2),0)}function Ck(t,e,r,i){return Gm(t,e,r,yw,ih(t,0,i),ih(t,i+1,-1),i)}function $c(t,e){for(var r="",i=bw(t),n=0;n6)switch(Gi(t,e+1)){case 109:if(Gi(t,e+4)!==45)break;case 102:return ar(t,/(.+:)(.+)-([^]+)/,"$1"+sr+"$2-$3$1"+Yp+(Gi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~L0(t,"stretch")?pP(ar(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Gi(t,e+1)!==115)break;case 6444:switch(Gi(t,ca(t)-3-(~L0(t,"!important")&&10))){case 107:return ar(t,":",":"+sr)+t;case 101:return ar(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+sr+(Gi(t,14)===45?"inline-":"")+"box$3$1"+sr+"$2$3$1"+Qi+"$2box$3")+t}break;case 5936:switch(Gi(t,e+11)){case 114:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return sr+t+Qi+ar(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return sr+t+Qi+t+t}return t}var CI=function(e,r,i,n){if(e.length>-1&&!e.return)switch(e.type){case yw:e.return=pP(e.value,e.length);break;case cP:return $c([Gu(e,{value:ar(e.value,"@","@"+sr)})],n);case gw:if(e.length)return oI(e.props,function(s){switch(aI(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return $c([Gu(e,{props:[ar(s,/:(read-\w+)/,":"+Yp+"$1")]})],n);case"::placeholder":return $c([Gu(e,{props:[ar(s,/:(plac\w+)/,":"+sr+"input-$1")]}),Gu(e,{props:[ar(s,/:(plac\w+)/,":"+Yp+"$1")]}),Gu(e,{props:[ar(s,/:(plac\w+)/,Qi+"input-$1")]})],n)}return""})}},TI=[CI],mP=function(e){var r=e.key;if(r==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var n=e.stylisPlugins||TI,s={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),v=1;v=4;++i,n-=4)r=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(i+2)&255)<<16;case 2:e^=(t.charCodeAt(i+1)&255)<<8;case 1:e^=t.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var FI={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},II=/[A-Z]|^ms/g,OI=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xP=function(e){return e.charCodeAt(1)===45},_k=function(e){return e!=null&&typeof e!="boolean"},$y=oP(function(t){return xP(t)?t:t.replace(II,"-$&").toLowerCase()}),Bk=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(OI,function(i,n,s){return ua={name:n,styles:s,next:ua},n})}return FI[e]!==1&&!xP(e)&&typeof r=="number"&&r!==0?r+"px":r};function sh(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return ua={name:r.name,styles:r.styles,next:ua},r.name;if(r.styles!==void 0){var i=r.next;if(i!==void 0)for(;i!==void 0;)ua={name:i.name,styles:i.styles,next:ua},i=i.next;var n=r.styles+";";return n}return AI(t,e,r)}case"function":{if(t!==void 0){var s=ua,a=r(t);return ua=s,sh(t,e,a)}break}}if(e==null)return r;var o=e[r];return o!==void 0?o:r}function AI(t,e,r){var i="";if(Array.isArray(r))for(var n=0;n96?HI:UI},Mk=function(e,r,i){var n;if(r){var s=r.shouldForwardProp;n=e.__emotion_forwardProp&&s?function(a){return e.__emotion_forwardProp(a)&&s(a)}:s}return typeof n!="function"&&i&&(n=e.__emotion_forwardProp),n},GI=function(e){var r=e.cache,i=e.serialized,n=e.isStringTag;return wP(r,i,n),$I(function(){return SP(r,i,n)}),null},jI=function t(e,r){var i=e.__emotion_real===e,n=i&&e.__emotion_base||e,s,a;r!==void 0&&(s=r.label,a=r.target);var o=Mk(e,r,i),l=o||Rk(n),c=!l("as");return function(){var u=arguments,d=i&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(s!==void 0&&d.push("label:"+s+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var h=u.length,p=1;pe(eO(n)?r:n):e;return T.jsx(WI,{styles:i})}function kw(t,e){return I0(t,e)}const RP=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},tO=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:EP,StyledEngineProvider:ZI,ThemeContext:rg,css:ig,default:kw,internal_processStyles:RP,keyframes:wu},Symbol.toStringTag,{value:"Module"}));function Da(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function MP(t){if(!Da(t))return t;const e={};return Object.keys(t).forEach(r=>{e[r]=MP(t[r])}),e}function gn(t,e,r={clone:!0}){const i=r.clone?S({},t):t;return Da(t)&&Da(e)&&Object.keys(e).forEach(n=>{Da(e[n])&&Object.prototype.hasOwnProperty.call(t,n)&&Da(t[n])?i[n]=gn(t[n],e[n],r):r.clone?i[n]=Da(e[n])?MP(e[n]):e[n]:i[n]=e[n]}),i}const rO=Object.freeze(Object.defineProperty({__proto__:null,default:gn,isPlainObject:Da},Symbol.toStringTag,{value:"Module"})),iO=["values","unit","step"],nO=t=>{const e=Object.keys(t).map(r=>({key:r,val:t[r]}))||[];return e.sort((r,i)=>r.val-i.val),e.reduce((r,i)=>S({},r,{[i.key]:i.val}),{})};function DP(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:i=5}=t,n=oe(t,iO),s=nO(e),a=Object.keys(s);function o(h){return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${r})`}function l(h){return`@media (max-width:${(typeof e[h]=="number"?e[h]:h)-i/100}${r})`}function c(h,p){const f=a.indexOf(p);return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${r}) and (max-width:${(f!==-1&&typeof e[a[f]]=="number"?e[a[f]]:p)-i/100}${r})`}function u(h){return a.indexOf(h)+1`@media (min-width:${Cw[t]}px)`};function Zs(t,e,r){const i=t.theme||{};if(Array.isArray(e)){const s=i.breakpoints||Dk;return e.reduce((a,o,l)=>(a[s.up(s.keys[l])]=r(e[l]),a),{})}if(typeof e=="object"){const s=i.breakpoints||Dk;return Object.keys(e).reduce((a,o)=>{if(Object.keys(s.values||Cw).indexOf(o)!==-1){const l=s.up(o);a[l]=r(e[o],o)}else{const l=o;a[l]=e[l]}return a},{})}return r(e)}function LP(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((i,n)=>{const s=t.up(n);return i[s]={},i},{}))||{}}function FP(t,e){return t.reduce((r,i)=>{const n=r[i];return(!n||Object.keys(n).length===0)&&delete r[i],r},e)}function oO(t,...e){const r=LP(t),i=[r,...e].reduce((n,s)=>gn(n,s),{});return FP(Object.keys(r),i)}function lO(t,e){if(typeof t!="object")return{};const r={},i=Object.keys(e);return Array.isArray(t)?i.forEach((n,s)=>{s{t[n]!=null&&(r[n]=!0)}),r}function Wy({values:t,breakpoints:e,base:r}){const i=r||lO(t,e),n=Object.keys(i);if(n.length===0)return t;let s;return n.reduce((a,o,l)=>(Array.isArray(t)?(a[o]=t[l]!=null?t[l]:t[s],s=l):typeof t=="object"?(a[o]=t[o]!=null?t[o]:t[s],s=o):a[o]=t,a),{})}function Pe(t){if(typeof t!="string")throw new Error(Qa(7));return t.charAt(0).toUpperCase()+t.slice(1)}const cO=Object.freeze(Object.defineProperty({__proto__:null,default:Pe},Symbol.toStringTag,{value:"Module"}));function ng(t,e,r=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&r){const i=`vars.${e}`.split(".").reduce((n,s)=>n&&n[s]?n[s]:null,t);if(i!=null)return i}return e.split(".").reduce((i,n)=>i&&i[n]!=null?i[n]:null,t)}function Xp(t,e,r,i=r){let n;return typeof t=="function"?n=t(r):Array.isArray(t)?n=t[r]||i:n=ng(t,r)||i,e&&(n=e(n,i,t)),n}function yi(t){const{prop:e,cssProperty:r=t.prop,themeKey:i,transform:n}=t,s=a=>{if(a[e]==null)return null;const o=a[e],l=a.theme,c=ng(l,i)||{};return Zs(a,o,d=>{let h=Xp(c,n,d);return d===h&&typeof d=="string"&&(h=Xp(c,n,`${e}${d==="default"?"":Pe(d)}`,d)),r===!1?h:{[r]:h}})};return s.propTypes={},s.filterProps=[e],s}function uO(t){const e={};return r=>(e[r]===void 0&&(e[r]=t(r)),e[r])}const dO={m:"margin",p:"padding"},hO={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Lk={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},fO=uO(t=>{if(t.length>2)if(Lk[t])t=Lk[t];else return[t];const[e,r]=t.split(""),i=dO[e],n=hO[r]||"";return Array.isArray(n)?n.map(s=>i+s):[i+n]}),Tw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],_w=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Tw,..._w];function Ih(t,e,r,i){var n;const s=(n=ng(t,e,!1))!=null?n:r;return typeof s=="number"?a=>typeof a=="string"?a:s*a:Array.isArray(s)?a=>typeof a=="string"?a:s[a]:typeof s=="function"?s:()=>{}}function Bw(t){return Ih(t,"spacing",8)}function Al(t,e){if(typeof e=="string"||e==null)return e;const r=Math.abs(e),i=t(r);return e>=0?i:typeof i=="number"?-i:`-${i}`}function pO(t,e){return r=>t.reduce((i,n)=>(i[n]=Al(e,r),i),{})}function mO(t,e,r,i){if(e.indexOf(r)===-1)return null;const n=fO(r),s=pO(n,i),a=t[r];return Zs(t,a,s)}function IP(t,e){const r=Bw(t.theme);return Object.keys(t).map(i=>mO(t,e,i,r)).reduce(Td,{})}function Qr(t){return IP(t,Tw)}Qr.propTypes={};Qr.filterProps=Tw;function Jr(t){return IP(t,_w)}Jr.propTypes={};Jr.filterProps=_w;function gO(t=8){if(t.mui)return t;const e=Bw({spacing:t}),r=(...i)=>(i.length===0?[1]:i).map(s=>{const a=e(s);return typeof a=="number"?`${a}px`:a}).join(" ");return r.mui=!0,r}function sg(...t){const e=t.reduce((i,n)=>(n.filterProps.forEach(s=>{i[s]=n}),i),{}),r=i=>Object.keys(i).reduce((n,s)=>e[s]?Td(n,e[s](i)):n,{});return r.propTypes={},r.filterProps=t.reduce((i,n)=>i.concat(n.filterProps),[]),r}function us(t){return typeof t!="number"?t:`${t}px solid`}function Ps(t,e){return yi({prop:t,themeKey:"borders",transform:e})}const yO=Ps("border",us),bO=Ps("borderTop",us),vO=Ps("borderRight",us),wO=Ps("borderBottom",us),SO=Ps("borderLeft",us),xO=Ps("borderColor"),kO=Ps("borderTopColor"),CO=Ps("borderRightColor"),TO=Ps("borderBottomColor"),_O=Ps("borderLeftColor"),BO=Ps("outline",us),PO=Ps("outlineColor"),ag=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=Ih(t.theme,"shape.borderRadius",4),r=i=>({borderRadius:Al(e,i)});return Zs(t,t.borderRadius,r)}return null};ag.propTypes={};ag.filterProps=["borderRadius"];sg(yO,bO,vO,wO,SO,xO,kO,CO,TO,_O,ag,BO,PO);const og=t=>{if(t.gap!==void 0&&t.gap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({gap:Al(e,i)});return Zs(t,t.gap,r)}return null};og.propTypes={};og.filterProps=["gap"];const lg=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({columnGap:Al(e,i)});return Zs(t,t.columnGap,r)}return null};lg.propTypes={};lg.filterProps=["columnGap"];const cg=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({rowGap:Al(e,i)});return Zs(t,t.rowGap,r)}return null};cg.propTypes={};cg.filterProps=["rowGap"];const NO=yi({prop:"gridColumn"}),EO=yi({prop:"gridRow"}),RO=yi({prop:"gridAutoFlow"}),MO=yi({prop:"gridAutoColumns"}),DO=yi({prop:"gridAutoRows"}),LO=yi({prop:"gridTemplateColumns"}),FO=yi({prop:"gridTemplateRows"}),IO=yi({prop:"gridTemplateAreas"}),OO=yi({prop:"gridArea"});sg(og,lg,cg,NO,EO,RO,MO,DO,LO,FO,IO,OO);function zc(t,e){return e==="grey"?e:t}const AO=yi({prop:"color",themeKey:"palette",transform:zc}),VO=yi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:zc}),$O=yi({prop:"backgroundColor",themeKey:"palette",transform:zc});sg(AO,VO,$O);function Hn(t){return t<=1&&t!==0?`${t*100}%`:t}const zO=yi({prop:"width",transform:Hn}),Pw=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=r=>{var i,n;const s=((i=t.theme)==null||(i=i.breakpoints)==null||(i=i.values)==null?void 0:i[r])||Cw[r];return s?((n=t.theme)==null||(n=n.breakpoints)==null?void 0:n.unit)!=="px"?{maxWidth:`${s}${t.theme.breakpoints.unit}`}:{maxWidth:s}:{maxWidth:Hn(r)}};return Zs(t,t.maxWidth,e)}return null};Pw.filterProps=["maxWidth"];const WO=yi({prop:"minWidth",transform:Hn}),HO=yi({prop:"height",transform:Hn}),UO=yi({prop:"maxHeight",transform:Hn}),GO=yi({prop:"minHeight",transform:Hn});yi({prop:"size",cssProperty:"width",transform:Hn});yi({prop:"size",cssProperty:"height",transform:Hn});const jO=yi({prop:"boxSizing"});sg(zO,Pw,WO,HO,UO,GO,jO);const YO={border:{themeKey:"borders",transform:us},borderTop:{themeKey:"borders",transform:us},borderRight:{themeKey:"borders",transform:us},borderBottom:{themeKey:"borders",transform:us},borderLeft:{themeKey:"borders",transform:us},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:us},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:ag},color:{themeKey:"palette",transform:zc},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:zc},backgroundColor:{themeKey:"palette",transform:zc},p:{style:Jr},pt:{style:Jr},pr:{style:Jr},pb:{style:Jr},pl:{style:Jr},px:{style:Jr},py:{style:Jr},padding:{style:Jr},paddingTop:{style:Jr},paddingRight:{style:Jr},paddingBottom:{style:Jr},paddingLeft:{style:Jr},paddingX:{style:Jr},paddingY:{style:Jr},paddingInline:{style:Jr},paddingInlineStart:{style:Jr},paddingInlineEnd:{style:Jr},paddingBlock:{style:Jr},paddingBlockStart:{style:Jr},paddingBlockEnd:{style:Jr},m:{style:Qr},mt:{style:Qr},mr:{style:Qr},mb:{style:Qr},ml:{style:Qr},mx:{style:Qr},my:{style:Qr},margin:{style:Qr},marginTop:{style:Qr},marginRight:{style:Qr},marginBottom:{style:Qr},marginLeft:{style:Qr},marginX:{style:Qr},marginY:{style:Qr},marginInline:{style:Qr},marginInlineStart:{style:Qr},marginInlineEnd:{style:Qr},marginBlock:{style:Qr},marginBlockStart:{style:Qr},marginBlockEnd:{style:Qr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:og},rowGap:{style:cg},columnGap:{style:lg},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Hn},maxWidth:{style:Pw},minWidth:{transform:Hn},height:{transform:Hn},maxHeight:{transform:Hn},minHeight:{transform:Hn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Oh=YO;function XO(...t){const e=t.reduce((i,n)=>i.concat(Object.keys(n)),[]),r=new Set(e);return t.every(i=>r.size===Object.keys(i).length)}function qO(t,e){return typeof t=="function"?t(e):t}function OP(){function t(r,i,n,s){const a={[r]:i,theme:n},o=s[r];if(!o)return{[r]:i};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=o;if(i==null)return null;if(c==="typography"&&i==="inherit")return{[r]:i};const h=ng(n,c)||{};return d?d(a):Zs(a,i,f=>{let m=Xp(h,u,f);return f===m&&typeof f=="string"&&(m=Xp(h,u,`${r}${f==="default"?"":Pe(f)}`,f)),l===!1?m:{[l]:m}})}function e(r){var i;const{sx:n,theme:s={}}=r||{};if(!n)return null;const a=(i=s.unstable_sxConfig)!=null?i:Oh;function o(l){let c=l;if(typeof l=="function")c=l(s);else if(typeof l!="object")return l;if(!c)return null;const u=LP(s.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(p=>{const f=qO(c[p],s);if(f!=null)if(typeof f=="object")if(a[p])h=Td(h,t(p,f,s,a));else{const m=Zs({theme:s},f,y=>({[p]:y}));XO(m,f)?h[p]=e({sx:f,theme:s}):h=Td(h,m)}else h=Td(h,t(p,f,s,a))}),FP(d,h)}return Array.isArray(n)?n.map(o):o(n)}return e}const Su=OP();Su.filterProps=["sx"];function AP(t,e){const r=this;return r.vars&&typeof r.getColorSchemeSelector=="function"?{[r.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:r.palette.mode===t?e:{}}const KO=["breakpoints","palette","spacing","shape"];function Ah(t={},...e){const{breakpoints:r={},palette:i={},spacing:n,shape:s={}}=t,a=oe(t,KO),o=DP(r),l=gO(n);let c=gn({breakpoints:o,direction:"ltr",components:{},palette:S({mode:"light"},i),spacing:l,shape:S({},aO,s)},a);return c.applyStyles=AP,c=e.reduce((u,d)=>gn(u,d),c),c.unstable_sxConfig=S({},Oh,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(d){return Su({sx:d,theme:this})},c}const QO=Object.freeze(Object.defineProperty({__proto__:null,default:Ah,private_createBreakpoints:DP,unstable_applyStyles:AP},Symbol.toStringTag,{value:"Module"}));function JO(t){return Object.keys(t).length===0}function VP(t=null){const e=w.useContext(rg);return!e||JO(e)?t:e}const ZO=Ah();function ug(t=ZO){return VP(t)}function eA({styles:t,themeId:e,defaultTheme:r={}}){const i=ug(r),n=typeof t=="function"?t(e&&i[e]||i):t;return T.jsx(EP,{styles:n})}const tA=["sx"],rA=t=>{var e,r;const i={systemProps:{},otherProps:{}},n=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:Oh;return Object.keys(t).forEach(s=>{n[s]?i.systemProps[s]=t[s]:i.otherProps[s]=t[s]}),i};function dg(t){const{sx:e}=t,r=oe(t,tA),{systemProps:i,otherProps:n}=rA(r);let s;return Array.isArray(e)?s=[i,...e]:typeof e=="function"?s=(...a)=>{const o=e(...a);return Da(o)?S({},i,o):i}:s=S({},i,e),S({},n,{sx:s})}const iA=Object.freeze(Object.defineProperty({__proto__:null,default:Su,extendSxProp:dg,unstable_createStyleFunctionSx:OP,unstable_defaultSxConfig:Oh},Symbol.toStringTag,{value:"Module"})),Fk=t=>t,nA=()=>{let t=Fk;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Fk}}},sA=nA(),$P=sA;function zP(t){var e,r,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;eo!=="theme"&&o!=="sx"&&o!=="as"})(Su);return w.forwardRef(function(l,c){const u=ug(r),d=dg(l),{className:h,component:p="div"}=d,f=oe(d,aA);return T.jsx(s,S({as:p,ref:c,className:xe(h,n?n(i):i),theme:e&&u[e]||u},f))})}const WP={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 He(t,e,r="Mui"){const i=WP[e];return i?`${r}-${i}`:`${$P.generate(t)}-${e}`}function Ue(t,e,r="Mui"){const i={};return e.forEach(n=>{i[n]=He(t,n,r)}),i}var HP={exports:{}},ur={};/** + */var $i=typeof Symbol=="function"&&Symbol.for,vw=$i?Symbol.for("react.element"):60103,ww=$i?Symbol.for("react.portal"):60106,jm=$i?Symbol.for("react.fragment"):60107,Ym=$i?Symbol.for("react.strict_mode"):60108,Xm=$i?Symbol.for("react.profiler"):60114,qm=$i?Symbol.for("react.provider"):60109,Km=$i?Symbol.for("react.context"):60110,Sw=$i?Symbol.for("react.async_mode"):60111,Qm=$i?Symbol.for("react.concurrent_mode"):60111,Jm=$i?Symbol.for("react.forward_ref"):60112,Zm=$i?Symbol.for("react.suspense"):60113,_I=$i?Symbol.for("react.suspense_list"):60120,eg=$i?Symbol.for("react.memo"):60115,tg=$i?Symbol.for("react.lazy"):60116,BI=$i?Symbol.for("react.block"):60121,PI=$i?Symbol.for("react.fundamental"):60117,NI=$i?Symbol.for("react.responder"):60118,EI=$i?Symbol.for("react.scope"):60119;function rs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case vw:switch(t=t.type,t){case Sw:case Qm:case jm:case Xm:case Ym:case Zm:return t;default:switch(t=t&&t.$$typeof,t){case Km:case Jm:case tg:case eg:case qm:return t;default:return e}}case ww:return e}}}function yP(t){return rs(t)===Qm}cr.AsyncMode=Sw;cr.ConcurrentMode=Qm;cr.ContextConsumer=Km;cr.ContextProvider=qm;cr.Element=vw;cr.ForwardRef=Jm;cr.Fragment=jm;cr.Lazy=tg;cr.Memo=eg;cr.Portal=ww;cr.Profiler=Xm;cr.StrictMode=Ym;cr.Suspense=Zm;cr.isAsyncMode=function(t){return yP(t)||rs(t)===Sw};cr.isConcurrentMode=yP;cr.isContextConsumer=function(t){return rs(t)===Km};cr.isContextProvider=function(t){return rs(t)===qm};cr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===vw};cr.isForwardRef=function(t){return rs(t)===Jm};cr.isFragment=function(t){return rs(t)===jm};cr.isLazy=function(t){return rs(t)===tg};cr.isMemo=function(t){return rs(t)===eg};cr.isPortal=function(t){return rs(t)===ww};cr.isProfiler=function(t){return rs(t)===Xm};cr.isStrictMode=function(t){return rs(t)===Ym};cr.isSuspense=function(t){return rs(t)===Zm};cr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===jm||t===Qm||t===Xm||t===Ym||t===Zm||t===_I||typeof t=="object"&&t!==null&&(t.$$typeof===tg||t.$$typeof===eg||t.$$typeof===qm||t.$$typeof===Km||t.$$typeof===Jm||t.$$typeof===PI||t.$$typeof===NI||t.$$typeof===EI||t.$$typeof===BI)};cr.typeOf=rs;gP.exports=cr;var RI=gP.exports,bP=RI,MI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},DI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},vP={};vP[bP.ForwardRef]=MI;vP[bP.Memo]=DI;var LI=!0;function FI(t,e,r){var i="";return r.split(" ").forEach(function(n){t[n]!==void 0?e.push(t[n]+";"):i+=n+" "}),i}var wP=function(e,r,i){var n=e.key+"-"+r.name;(i===!1||LI===!1)&&e.registered[n]===void 0&&(e.registered[n]=r.styles)},SP=function(e,r,i){wP(e,r,i);var n=e.key+"-"+r.name;if(e.inserted[r.name]===void 0){var s=r;do e.insert(r===s?"."+n:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function II(t){for(var e=0,r,i=0,n=t.length;n>=4;++i,n-=4)r=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(i+2)&255)<<16;case 2:e^=(t.charCodeAt(i+1)&255)<<8;case 1:e^=t.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var OI={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},AI=/[A-Z]|^ms/g,VI=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xP=function(e){return e.charCodeAt(1)===45},_k=function(e){return e!=null&&typeof e!="boolean"},$y=oP(function(t){return xP(t)?t:t.replace(AI,"-$&").toLowerCase()}),Bk=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(VI,function(i,n,s){return ua={name:n,styles:s,next:ua},n})}return OI[e]!==1&&!xP(e)&&typeof r=="number"&&r!==0?r+"px":r};function sh(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return ua={name:r.name,styles:r.styles,next:ua},r.name;if(r.styles!==void 0){var i=r.next;if(i!==void 0)for(;i!==void 0;)ua={name:i.name,styles:i.styles,next:ua},i=i.next;var n=r.styles+";";return n}return $I(t,e,r)}case"function":{if(t!==void 0){var s=ua,a=r(t);return ua=s,sh(t,e,a)}break}}if(e==null)return r;var o=e[r];return o!==void 0?o:r}function $I(t,e,r){var i="";if(Array.isArray(r))for(var n=0;n96?GI:jI},Mk=function(e,r,i){var n;if(r){var s=r.shouldForwardProp;n=e.__emotion_forwardProp&&s?function(a){return e.__emotion_forwardProp(a)&&s(a)}:s}return typeof n!="function"&&i&&(n=e.__emotion_forwardProp),n},YI=function(e){var r=e.cache,i=e.serialized,n=e.isStringTag;return wP(r,i,n),WI(function(){return SP(r,i,n)}),null},XI=function t(e,r){var i=e.__emotion_real===e,n=i&&e.__emotion_base||e,s,a;r!==void 0&&(s=r.label,a=r.target);var o=Mk(e,r,i),l=o||Rk(n),c=!l("as");return function(){var u=arguments,d=i&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(s!==void 0&&d.push("label:"+s+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var h=u.length,p=1;pe(rO(n)?r:n):e;return T.jsx(UI,{styles:i})}function kw(t,e){return I0(t,e)}const RP=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},iO=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:EP,StyledEngineProvider:tO,ThemeContext:rg,css:ig,default:kw,internal_processStyles:RP,keyframes:wu},Symbol.toStringTag,{value:"Module"}));function Da(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function MP(t){if(!Da(t))return t;const e={};return Object.keys(t).forEach(r=>{e[r]=MP(t[r])}),e}function gn(t,e,r={clone:!0}){const i=r.clone?S({},t):t;return Da(t)&&Da(e)&&Object.keys(e).forEach(n=>{Da(e[n])&&Object.prototype.hasOwnProperty.call(t,n)&&Da(t[n])?i[n]=gn(t[n],e[n],r):r.clone?i[n]=Da(e[n])?MP(e[n]):e[n]:i[n]=e[n]}),i}const nO=Object.freeze(Object.defineProperty({__proto__:null,default:gn,isPlainObject:Da},Symbol.toStringTag,{value:"Module"})),sO=["values","unit","step"],aO=t=>{const e=Object.keys(t).map(r=>({key:r,val:t[r]}))||[];return e.sort((r,i)=>r.val-i.val),e.reduce((r,i)=>S({},r,{[i.key]:i.val}),{})};function DP(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:i=5}=t,n=le(t,sO),s=aO(e),a=Object.keys(s);function o(h){return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${r})`}function l(h){return`@media (max-width:${(typeof e[h]=="number"?e[h]:h)-i/100}${r})`}function c(h,p){const f=a.indexOf(p);return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${r}) and (max-width:${(f!==-1&&typeof e[a[f]]=="number"?e[a[f]]:p)-i/100}${r})`}function u(h){return a.indexOf(h)+1`@media (min-width:${Cw[t]}px)`};function Zs(t,e,r){const i=t.theme||{};if(Array.isArray(e)){const s=i.breakpoints||Dk;return e.reduce((a,o,l)=>(a[s.up(s.keys[l])]=r(e[l]),a),{})}if(typeof e=="object"){const s=i.breakpoints||Dk;return Object.keys(e).reduce((a,o)=>{if(Object.keys(s.values||Cw).indexOf(o)!==-1){const l=s.up(o);a[l]=r(e[o],o)}else{const l=o;a[l]=e[l]}return a},{})}return r(e)}function LP(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((i,n)=>{const s=t.up(n);return i[s]={},i},{}))||{}}function FP(t,e){return t.reduce((r,i)=>{const n=r[i];return(!n||Object.keys(n).length===0)&&delete r[i],r},e)}function cO(t,...e){const r=LP(t),i=[r,...e].reduce((n,s)=>gn(n,s),{});return FP(Object.keys(r),i)}function uO(t,e){if(typeof t!="object")return{};const r={},i=Object.keys(e);return Array.isArray(t)?i.forEach((n,s)=>{s{t[n]!=null&&(r[n]=!0)}),r}function Wy({values:t,breakpoints:e,base:r}){const i=r||uO(t,e),n=Object.keys(i);if(n.length===0)return t;let s;return n.reduce((a,o,l)=>(Array.isArray(t)?(a[o]=t[l]!=null?t[l]:t[s],s=l):typeof t=="object"?(a[o]=t[o]!=null?t[o]:t[s],s=o):a[o]=t,a),{})}function Ne(t){if(typeof t!="string")throw new Error(Ja(7));return t.charAt(0).toUpperCase()+t.slice(1)}const dO=Object.freeze(Object.defineProperty({__proto__:null,default:Ne},Symbol.toStringTag,{value:"Module"}));function ng(t,e,r=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&r){const i=`vars.${e}`.split(".").reduce((n,s)=>n&&n[s]?n[s]:null,t);if(i!=null)return i}return e.split(".").reduce((i,n)=>i&&i[n]!=null?i[n]:null,t)}function Xp(t,e,r,i=r){let n;return typeof t=="function"?n=t(r):Array.isArray(t)?n=t[r]||i:n=ng(t,r)||i,e&&(n=e(n,i,t)),n}function yi(t){const{prop:e,cssProperty:r=t.prop,themeKey:i,transform:n}=t,s=a=>{if(a[e]==null)return null;const o=a[e],l=a.theme,c=ng(l,i)||{};return Zs(a,o,d=>{let h=Xp(c,n,d);return d===h&&typeof d=="string"&&(h=Xp(c,n,`${e}${d==="default"?"":Ne(d)}`,d)),r===!1?h:{[r]:h}})};return s.propTypes={},s.filterProps=[e],s}function hO(t){const e={};return r=>(e[r]===void 0&&(e[r]=t(r)),e[r])}const fO={m:"margin",p:"padding"},pO={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Lk={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},mO=hO(t=>{if(t.length>2)if(Lk[t])t=Lk[t];else return[t];const[e,r]=t.split(""),i=fO[e],n=pO[r]||"";return Array.isArray(n)?n.map(s=>i+s):[i+n]}),Tw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],_w=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Tw,..._w];function Ih(t,e,r,i){var n;const s=(n=ng(t,e,!1))!=null?n:r;return typeof s=="number"?a=>typeof a=="string"?a:s*a:Array.isArray(s)?a=>typeof a=="string"?a:s[a]:typeof s=="function"?s:()=>{}}function Bw(t){return Ih(t,"spacing",8)}function Al(t,e){if(typeof e=="string"||e==null)return e;const r=Math.abs(e),i=t(r);return e>=0?i:typeof i=="number"?-i:`-${i}`}function gO(t,e){return r=>t.reduce((i,n)=>(i[n]=Al(e,r),i),{})}function yO(t,e,r,i){if(e.indexOf(r)===-1)return null;const n=mO(r),s=gO(n,i),a=t[r];return Zs(t,a,s)}function IP(t,e){const r=Bw(t.theme);return Object.keys(t).map(i=>yO(t,e,i,r)).reduce(Td,{})}function Jr(t){return IP(t,Tw)}Jr.propTypes={};Jr.filterProps=Tw;function Zr(t){return IP(t,_w)}Zr.propTypes={};Zr.filterProps=_w;function bO(t=8){if(t.mui)return t;const e=Bw({spacing:t}),r=(...i)=>(i.length===0?[1]:i).map(s=>{const a=e(s);return typeof a=="number"?`${a}px`:a}).join(" ");return r.mui=!0,r}function sg(...t){const e=t.reduce((i,n)=>(n.filterProps.forEach(s=>{i[s]=n}),i),{}),r=i=>Object.keys(i).reduce((n,s)=>e[s]?Td(n,e[s](i)):n,{});return r.propTypes={},r.filterProps=t.reduce((i,n)=>i.concat(n.filterProps),[]),r}function us(t){return typeof t!="number"?t:`${t}px solid`}function Ps(t,e){return yi({prop:t,themeKey:"borders",transform:e})}const vO=Ps("border",us),wO=Ps("borderTop",us),SO=Ps("borderRight",us),xO=Ps("borderBottom",us),kO=Ps("borderLeft",us),CO=Ps("borderColor"),TO=Ps("borderTopColor"),_O=Ps("borderRightColor"),BO=Ps("borderBottomColor"),PO=Ps("borderLeftColor"),NO=Ps("outline",us),EO=Ps("outlineColor"),ag=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=Ih(t.theme,"shape.borderRadius",4),r=i=>({borderRadius:Al(e,i)});return Zs(t,t.borderRadius,r)}return null};ag.propTypes={};ag.filterProps=["borderRadius"];sg(vO,wO,SO,xO,kO,CO,TO,_O,BO,PO,ag,NO,EO);const og=t=>{if(t.gap!==void 0&&t.gap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({gap:Al(e,i)});return Zs(t,t.gap,r)}return null};og.propTypes={};og.filterProps=["gap"];const lg=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({columnGap:Al(e,i)});return Zs(t,t.columnGap,r)}return null};lg.propTypes={};lg.filterProps=["columnGap"];const cg=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=Ih(t.theme,"spacing",8),r=i=>({rowGap:Al(e,i)});return Zs(t,t.rowGap,r)}return null};cg.propTypes={};cg.filterProps=["rowGap"];const RO=yi({prop:"gridColumn"}),MO=yi({prop:"gridRow"}),DO=yi({prop:"gridAutoFlow"}),LO=yi({prop:"gridAutoColumns"}),FO=yi({prop:"gridAutoRows"}),IO=yi({prop:"gridTemplateColumns"}),OO=yi({prop:"gridTemplateRows"}),AO=yi({prop:"gridTemplateAreas"}),VO=yi({prop:"gridArea"});sg(og,lg,cg,RO,MO,DO,LO,FO,IO,OO,AO,VO);function zc(t,e){return e==="grey"?e:t}const $O=yi({prop:"color",themeKey:"palette",transform:zc}),zO=yi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:zc}),WO=yi({prop:"backgroundColor",themeKey:"palette",transform:zc});sg($O,zO,WO);function Hn(t){return t<=1&&t!==0?`${t*100}%`:t}const HO=yi({prop:"width",transform:Hn}),Pw=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=r=>{var i,n;const s=((i=t.theme)==null||(i=i.breakpoints)==null||(i=i.values)==null?void 0:i[r])||Cw[r];return s?((n=t.theme)==null||(n=n.breakpoints)==null?void 0:n.unit)!=="px"?{maxWidth:`${s}${t.theme.breakpoints.unit}`}:{maxWidth:s}:{maxWidth:Hn(r)}};return Zs(t,t.maxWidth,e)}return null};Pw.filterProps=["maxWidth"];const UO=yi({prop:"minWidth",transform:Hn}),GO=yi({prop:"height",transform:Hn}),jO=yi({prop:"maxHeight",transform:Hn}),YO=yi({prop:"minHeight",transform:Hn});yi({prop:"size",cssProperty:"width",transform:Hn});yi({prop:"size",cssProperty:"height",transform:Hn});const XO=yi({prop:"boxSizing"});sg(HO,Pw,UO,GO,jO,YO,XO);const qO={border:{themeKey:"borders",transform:us},borderTop:{themeKey:"borders",transform:us},borderRight:{themeKey:"borders",transform:us},borderBottom:{themeKey:"borders",transform:us},borderLeft:{themeKey:"borders",transform:us},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:us},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:ag},color:{themeKey:"palette",transform:zc},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:zc},backgroundColor:{themeKey:"palette",transform:zc},p:{style:Zr},pt:{style:Zr},pr:{style:Zr},pb:{style:Zr},pl:{style:Zr},px:{style:Zr},py:{style:Zr},padding:{style:Zr},paddingTop:{style:Zr},paddingRight:{style:Zr},paddingBottom:{style:Zr},paddingLeft:{style:Zr},paddingX:{style:Zr},paddingY:{style:Zr},paddingInline:{style:Zr},paddingInlineStart:{style:Zr},paddingInlineEnd:{style:Zr},paddingBlock:{style:Zr},paddingBlockStart:{style:Zr},paddingBlockEnd:{style:Zr},m:{style:Jr},mt:{style:Jr},mr:{style:Jr},mb:{style:Jr},ml:{style:Jr},mx:{style:Jr},my:{style:Jr},margin:{style:Jr},marginTop:{style:Jr},marginRight:{style:Jr},marginBottom:{style:Jr},marginLeft:{style:Jr},marginX:{style:Jr},marginY:{style:Jr},marginInline:{style:Jr},marginInlineStart:{style:Jr},marginInlineEnd:{style:Jr},marginBlock:{style:Jr},marginBlockStart:{style:Jr},marginBlockEnd:{style:Jr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:og},rowGap:{style:cg},columnGap:{style:lg},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Hn},maxWidth:{style:Pw},minWidth:{transform:Hn},height:{transform:Hn},maxHeight:{transform:Hn},minHeight:{transform:Hn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Oh=qO;function KO(...t){const e=t.reduce((i,n)=>i.concat(Object.keys(n)),[]),r=new Set(e);return t.every(i=>r.size===Object.keys(i).length)}function QO(t,e){return typeof t=="function"?t(e):t}function OP(){function t(r,i,n,s){const a={[r]:i,theme:n},o=s[r];if(!o)return{[r]:i};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=o;if(i==null)return null;if(c==="typography"&&i==="inherit")return{[r]:i};const h=ng(n,c)||{};return d?d(a):Zs(a,i,f=>{let m=Xp(h,u,f);return f===m&&typeof f=="string"&&(m=Xp(h,u,`${r}${f==="default"?"":Ne(f)}`,f)),l===!1?m:{[l]:m}})}function e(r){var i;const{sx:n,theme:s={}}=r||{};if(!n)return null;const a=(i=s.unstable_sxConfig)!=null?i:Oh;function o(l){let c=l;if(typeof l=="function")c=l(s);else if(typeof l!="object")return l;if(!c)return null;const u=LP(s.breakpoints),d=Object.keys(u);let h=u;return Object.keys(c).forEach(p=>{const f=QO(c[p],s);if(f!=null)if(typeof f=="object")if(a[p])h=Td(h,t(p,f,s,a));else{const m=Zs({theme:s},f,y=>({[p]:y}));KO(m,f)?h[p]=e({sx:f,theme:s}):h=Td(h,m)}else h=Td(h,t(p,f,s,a))}),FP(d,h)}return Array.isArray(n)?n.map(o):o(n)}return e}const Su=OP();Su.filterProps=["sx"];function AP(t,e){const r=this;return r.vars&&typeof r.getColorSchemeSelector=="function"?{[r.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:r.palette.mode===t?e:{}}const JO=["breakpoints","palette","spacing","shape"];function Ah(t={},...e){const{breakpoints:r={},palette:i={},spacing:n,shape:s={}}=t,a=le(t,JO),o=DP(r),l=bO(n);let c=gn({breakpoints:o,direction:"ltr",components:{},palette:S({mode:"light"},i),spacing:l,shape:S({},lO,s)},a);return c.applyStyles=AP,c=e.reduce((u,d)=>gn(u,d),c),c.unstable_sxConfig=S({},Oh,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(d){return Su({sx:d,theme:this})},c}const ZO=Object.freeze(Object.defineProperty({__proto__:null,default:Ah,private_createBreakpoints:DP,unstable_applyStyles:AP},Symbol.toStringTag,{value:"Module"}));function eA(t){return Object.keys(t).length===0}function VP(t=null){const e=w.useContext(rg);return!e||eA(e)?t:e}const tA=Ah();function ug(t=tA){return VP(t)}function rA({styles:t,themeId:e,defaultTheme:r={}}){const i=ug(r),n=typeof t=="function"?t(e&&i[e]||i):t;return T.jsx(EP,{styles:n})}const iA=["sx"],nA=t=>{var e,r;const i={systemProps:{},otherProps:{}},n=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:Oh;return Object.keys(t).forEach(s=>{n[s]?i.systemProps[s]=t[s]:i.otherProps[s]=t[s]}),i};function dg(t){const{sx:e}=t,r=le(t,iA),{systemProps:i,otherProps:n}=nA(r);let s;return Array.isArray(e)?s=[i,...e]:typeof e=="function"?s=(...a)=>{const o=e(...a);return Da(o)?S({},i,o):i}:s=S({},i,e),S({},n,{sx:s})}const sA=Object.freeze(Object.defineProperty({__proto__:null,default:Su,extendSxProp:dg,unstable_createStyleFunctionSx:OP,unstable_defaultSxConfig:Oh},Symbol.toStringTag,{value:"Module"})),Fk=t=>t,aA=()=>{let t=Fk;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Fk}}},oA=aA(),$P=oA;function zP(t){var e,r,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;eo!=="theme"&&o!=="sx"&&o!=="as"})(Su);return w.forwardRef(function(l,c){const u=ug(r),d=dg(l),{className:h,component:p="div"}=d,f=le(d,lA);return T.jsx(s,S({as:p,ref:c,className:ke(h,n?n(i):i),theme:e&&u[e]||u},f))})}const WP={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 Ue(t,e,r="Mui"){const i=WP[e];return i?`${r}-${i}`:`${$P.generate(t)}-${e}`}function Ge(t,e,r="Mui"){const i={};return e.forEach(n=>{i[n]=Ue(t,n,r)}),i}var HP={exports:{}},ur={};/** * @license React * react-is.production.min.js * @@ -80,7 +80,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Nw=Symbol.for("react.element"),Ew=Symbol.for("react.portal"),hg=Symbol.for("react.fragment"),fg=Symbol.for("react.strict_mode"),pg=Symbol.for("react.profiler"),mg=Symbol.for("react.provider"),gg=Symbol.for("react.context"),lA=Symbol.for("react.server_context"),yg=Symbol.for("react.forward_ref"),bg=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),wg=Symbol.for("react.memo"),Sg=Symbol.for("react.lazy"),cA=Symbol.for("react.offscreen"),UP;UP=Symbol.for("react.module.reference");function Ns(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Nw:switch(t=t.type,t){case hg:case pg:case fg:case bg:case vg:return t;default:switch(t=t&&t.$$typeof,t){case lA:case gg:case yg:case Sg:case wg:case mg:return t;default:return e}}case Ew:return e}}}ur.ContextConsumer=gg;ur.ContextProvider=mg;ur.Element=Nw;ur.ForwardRef=yg;ur.Fragment=hg;ur.Lazy=Sg;ur.Memo=wg;ur.Portal=Ew;ur.Profiler=pg;ur.StrictMode=fg;ur.Suspense=bg;ur.SuspenseList=vg;ur.isAsyncMode=function(){return!1};ur.isConcurrentMode=function(){return!1};ur.isContextConsumer=function(t){return Ns(t)===gg};ur.isContextProvider=function(t){return Ns(t)===mg};ur.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Nw};ur.isForwardRef=function(t){return Ns(t)===yg};ur.isFragment=function(t){return Ns(t)===hg};ur.isLazy=function(t){return Ns(t)===Sg};ur.isMemo=function(t){return Ns(t)===wg};ur.isPortal=function(t){return Ns(t)===Ew};ur.isProfiler=function(t){return Ns(t)===pg};ur.isStrictMode=function(t){return Ns(t)===fg};ur.isSuspense=function(t){return Ns(t)===bg};ur.isSuspenseList=function(t){return Ns(t)===vg};ur.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===hg||t===pg||t===fg||t===bg||t===vg||t===cA||typeof t=="object"&&t!==null&&(t.$$typeof===Sg||t.$$typeof===wg||t.$$typeof===mg||t.$$typeof===gg||t.$$typeof===yg||t.$$typeof===UP||t.getModuleId!==void 0)};ur.typeOf=Ns;HP.exports=ur;var Ik=HP.exports;const uA=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function GP(t){const e=`${t}`.match(uA);return e&&e[1]||""}function jP(t,e=""){return t.displayName||t.name||GP(t)||e}function Ok(t,e,r){const i=jP(e);return t.displayName||(i!==""?`${r}(${i})`:r)}function dA(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return jP(t,"Component");if(typeof t=="object")switch(t.$$typeof){case Ik.ForwardRef:return Ok(t,t.render,"ForwardRef");case Ik.Memo:return Ok(t,t.type,"memo");default:return}}}const hA=Object.freeze(Object.defineProperty({__proto__:null,default:dA,getFunctionName:GP},Symbol.toStringTag,{value:"Module"})),fA=["ownerState"],pA=["variants"],mA=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function gA(t){return Object.keys(t).length===0}function yA(t){return typeof t=="string"&&t.charCodeAt(0)>96}function dp(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const bA=Ah(),vA=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function xf({defaultTheme:t,theme:e,themeId:r}){return gA(e)?t:e[r]||e}function wA(t){return t?(e,r)=>r[t]:null}function hp(t,e){let{ownerState:r}=e,i=oe(e,fA);const n=typeof t=="function"?t(S({ownerState:r},i)):t;if(Array.isArray(n))return n.flatMap(s=>hp(s,S({ownerState:r},i)));if(n&&typeof n=="object"&&Array.isArray(n.variants)){const{variants:s=[]}=n;let o=oe(n,pA);return s.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(S({ownerState:r},i,r)):Object.keys(l.props).forEach(u=>{(r==null?void 0:r[u])!==l.props[u]&&i[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(o)||(o=[o]),o.push(typeof l.style=="function"?l.style(S({ownerState:r},i,r)):l.style))}),o}return n}function SA(t={}){const{themeId:e,defaultTheme:r=bA,rootShouldForwardProp:i=dp,slotShouldForwardProp:n=dp}=t,s=a=>Su(S({},a,{theme:xf(S({},a,{defaultTheme:r,themeId:e}))}));return s.__mui_systemSx=!0,(a,o={})=>{RP(a,C=>C.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:h=wA(vA(c))}=o,p=oe(o,mA),f=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let y,v=dp;c==="Root"||c==="root"?v=i:c?v=n:yA(a)&&(v=void 0);const g=kw(a,S({shouldForwardProp:v,label:y},p)),b=C=>typeof C=="function"&&C.__emotion_real!==C||Da(C)?x=>hp(C,S({},x,{theme:xf({theme:x.theme,defaultTheme:r,themeId:e})})):C,k=(C,...x)=>{let _=b(C);const P=x?x.map(b):[];l&&h&&P.push(D=>{const $=xf(S({},D,{defaultTheme:r,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const I=$.components[l].styleOverrides,F={};return Object.entries(I).forEach(([M,O])=>{F[M]=hp(O,S({},D,{theme:$}))}),h(D,F)}),l&&!f&&P.push(D=>{var $;const I=xf(S({},D,{defaultTheme:r,themeId:e})),F=I==null||($=I.components)==null||($=$[l])==null?void 0:$.variants;return hp({variants:F},S({},D,{theme:I}))}),m||P.push(s);const R=P.length-x.length;if(Array.isArray(C)&&R>0){const D=new Array(R).fill("");_=[...C,...D],_.raw=[...C.raw,...D]}const E=g(_,...P);return a.muiName&&(E.muiName=a.muiName),E};return g.withConfig&&(k.withConfig=g.withConfig),k}}const xA=SA();function Rw(t,e){const r=S({},e);return Object.keys(t).forEach(i=>{if(i.toString().match(/^(components|slots)$/))r[i]=S({},t[i],r[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){const n=t[i]||{},s=e[i];r[i]={},!s||!Object.keys(s)?r[i]=n:!n||!Object.keys(n)?r[i]=s:(r[i]=S({},s),Object.keys(n).forEach(a=>{r[i][a]=Rw(n[a],s[a])}))}else r[i]===void 0&&(r[i]=t[i])}),r}function YP(t){const{theme:e,name:r,props:i}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?i:Rw(e.components[r].defaultProps,i)}function XP({props:t,name:e,defaultTheme:r,themeId:i}){let n=ug(r);return i&&(n=n[i]||n),YP({theme:n,name:e,props:t})}const zr=typeof window<"u"?w.useLayoutEffect:w.useEffect;function kA(t,e,r,i,n){const[s,a]=w.useState(()=>n&&r?r(t).matches:i?i(t).matches:e);return zr(()=>{let o=!0;if(!r)return;const l=r(t),c=()=>{o&&a(l.matches)};return c(),l.addListener(c),()=>{o=!1,l.removeListener(c)}},[t,r]),s}const qP=w.useSyncExternalStore;function CA(t,e,r,i,n){const s=w.useCallback(()=>e,[e]),a=w.useMemo(()=>{if(n&&r)return()=>r(t).matches;if(i!==null){const{matches:u}=i(t);return()=>u}return s},[s,t,i,n,r]),[o,l]=w.useMemo(()=>{if(r===null)return[s,()=>()=>{}];const u=r(t);return[()=>u.matches,d=>(u.addListener(d),()=>{u.removeListener(d)})]},[s,r,t]);return qP(l,o,a)}function Mw(t,e={}){const r=VP(),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:n=!1,matchMedia:s=i?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:o=!1}=YP({name:"MuiUseMediaQuery",props:e,theme:r});let l=typeof t=="function"?t(r):t;return l=l.replace(/^@media( ?)/m,""),(qP!==void 0?CA:kA)(l,n,s,a,o)}function So(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}const TA=Object.freeze(Object.defineProperty({__proto__:null,default:So},Symbol.toStringTag,{value:"Module"}));function _A(t,e=0,r=1){return So(t,e,r)}function BA(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(e);return r&&r[0].length===1&&(r=r.map(i=>i+i)),r?`rgb${r.length===4?"a":""}(${r.map((i,n)=>n<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function KP(t){if(t.type)return t;if(t.charAt(0)==="#")return KP(BA(t));const e=t.indexOf("("),r=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Qa(9,t));let i=t.substring(e+1,t.length-1),n;if(r==="color"){if(i=i.split(" "),n=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error(Qa(10,n))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:n}}function PA(t){const{type:e,colorSpace:r}=t;let{values:i}=t;return e.indexOf("rgb")!==-1?i=i.map((n,s)=>s<3?parseInt(n,10):n):e.indexOf("hsl")!==-1&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),e.indexOf("color")!==-1?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${e}(${i})`}function Ca(t,e){return t=KP(t),e=_A(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,PA(t)}const NA=z.oneOfType([z.func,z.object]),xg=NA;function Ak(...t){return t.reduce((e,r)=>r==null?e:function(...n){e.apply(this,n),r.apply(this,n)},()=>{})}function Vh(t,e=166){let r;function i(...n){const s=()=>{t.apply(this,n)};clearTimeout(r),r=setTimeout(s,e)}return i.clear=()=>{clearTimeout(r)},i}function fp(t,e){var r,i;return w.isValidElement(t)&&e.indexOf((r=t.type.muiName)!=null?r:(i=t.type)==null||(i=i._payload)==null||(i=i.value)==null?void 0:i.muiName)!==-1}function Xr(t){return t&&t.ownerDocument||document}function ea(t){return Xr(t).defaultView||window}function A0(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let Vk=0;function EA(t){const[e,r]=w.useState(t),i=t||e;return w.useEffect(()=>{e==null&&(Vk+=1,r(`mui-${Vk}`))},[e]),i}const $k=Gc.useId;function ia(t){if($k!==void 0){const e=$k();return t??e}return EA(t)}function xs({controlled:t,default:e,name:r,state:i="value"}){const{current:n}=w.useRef(t!==void 0),[s,a]=w.useState(e),o=n?t:s,l=w.useCallback(c=>{n||a(c)},[]);return[o,l]}function Ye(t){const e=w.useRef(t);return zr(()=>{e.current=t}),w.useRef((...r)=>(0,e.current)(...r)).current}function Wt(...t){return w.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(r=>{A0(r,e)})},t)}const zk={};function RA(t,e){const r=w.useRef(zk);return r.current===zk&&(r.current=t(e)),r}const MA=[];function DA(t){w.useEffect(t,MA)}class kg{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new kg}start(e,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,r()},e)}}function QP(){const t=RA(kg.create).current;return DA(t.disposeEffect),t}let Cg=!0,V0=!1;const LA=new kg,FA={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 IA(t){const{type:e,tagName:r}=t;return!!(r==="INPUT"&&FA[e]&&!t.readOnly||r==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function OA(t){t.metaKey||t.altKey||t.ctrlKey||(Cg=!0)}function Hy(){Cg=!1}function AA(){this.visibilityState==="hidden"&&V0&&(Cg=!0)}function VA(t){t.addEventListener("keydown",OA,!0),t.addEventListener("mousedown",Hy,!0),t.addEventListener("pointerdown",Hy,!0),t.addEventListener("touchstart",Hy,!0),t.addEventListener("visibilitychange",AA,!0)}function $A(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return Cg||IA(e)}function Dw(){const t=w.useCallback(n=>{n!=null&&VA(n.ownerDocument)},[]),e=w.useRef(!1);function r(){return e.current?(V0=!0,LA.start(100,()=>{V0=!1}),e.current=!1,!0):!1}function i(n){return $A(n)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:i,onBlur:r,ref:t}}function JP(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let ac;function ZP(){if(ac)return ac;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),ac="reverse",t.scrollLeft>0?ac="default":(t.scrollLeft=1,t.scrollLeft===0&&(ac="negative")),document.body.removeChild(t),ac}function zA(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(ZP()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}const WA={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},Lw=WA;function $e(t,e,r=void 0){const i={};return Object.keys(t).forEach(n=>{i[n]=t[n].reduce((s,a)=>{if(a){const o=e(a);o!==""&&s.push(o),r&&r[a]&&s.push(r[a])}return s},[]).join(" ")}),i}const HA=w.createContext(),Xi=()=>{const t=w.useContext(HA);return t??!1},UA=["component","direction","spacing","divider","children","className","useFlexGap"],GA=Ah(),jA=xA("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function YA(t){return XP({props:t,name:"MuiStack",defaultTheme:GA})}function XA(t,e){const r=w.Children.toArray(t).filter(Boolean);return r.reduce((i,n,s)=>(i.push(n),s({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],KA=({ownerState:t,theme:e})=>{let r=S({display:"flex",flexDirection:"column"},Zs({theme:e},Wy({values:t.direction,breakpoints:e.breakpoints.values}),i=>({flexDirection:i})));if(t.spacing){const i=Bw(e),n=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),s=Wy({values:t.direction,base:n}),a=Wy({values:t.spacing,base:n});typeof s=="object"&&Object.keys(s).forEach((l,c,u)=>{if(!s[l]){const h=c>0?s[u[c-1]]:"column";s[l]=h}}),r=gn(r,Zs({theme:e},a,(l,c)=>t.useFlexGap?{gap:Al(i,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${qA(c?s[c]:t.direction)}`]:Al(i,l)}}))}return r=oO(e.breakpoints,r),r};function QA(t={}){const{createStyledComponent:e=jA,useThemeProps:r=YA,componentName:i="MuiStack"}=t,n=()=>$e({root:["root"]},l=>He(i,l),{}),s=e(KA);return w.forwardRef(function(l,c){const u=r(l),d=dg(u),{component:h="div",direction:p="column",spacing:f=0,divider:m,children:y,className:v,useFlexGap:g=!1}=d,b=oe(d,UA),k={direction:p,spacing:f,useFlexGap:g},C=n();return T.jsx(s,S({as:h,ownerState:k,ref:c,className:xe(C.root,v)},b,{children:m?XA(y,m):y}))})}function JA(t,e){return S({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var bi={},eN={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(eN);var tN=eN.exports;const ZA=Go(YF),eV=Go(TA);var rN=tN;Object.defineProperty(bi,"__esModule",{value:!0});var Jt=bi.alpha=aN;bi.blend=dV;bi.colorChannel=void 0;var qp=bi.darken=Iw;bi.decomposeColor=ks;bi.emphasize=oN;var tV=bi.getContrastRatio=aV;bi.getLuminance=Qp;bi.hexToRgb=iN;bi.hslToRgb=sN;var Kp=bi.lighten=Ow;bi.private_safeAlpha=oV;bi.private_safeColorChannel=void 0;bi.private_safeDarken=lV;bi.private_safeEmphasize=uV;bi.private_safeLighten=cV;bi.recomposeColor=xu;bi.rgbToHex=sV;var Wk=rN(ZA),rV=rN(eV);function Fw(t,e=0,r=1){return(0,rV.default)(t,e,r)}function iN(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(e);return r&&r[0].length===1&&(r=r.map(i=>i+i)),r?`rgb${r.length===4?"a":""}(${r.map((i,n)=>n<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function iV(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function ks(t){if(t.type)return t;if(t.charAt(0)==="#")return ks(iN(t));const e=t.indexOf("("),r=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error((0,Wk.default)(9,t));let i=t.substring(e+1,t.length-1),n;if(r==="color"){if(i=i.split(" "),n=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error((0,Wk.default)(10,n))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:n}}const nN=t=>{const e=ks(t);return e.values.slice(0,3).map((r,i)=>e.type.indexOf("hsl")!==-1&&i!==0?`${r}%`:r).join(" ")};bi.colorChannel=nN;const nV=(t,e)=>{try{return nN(t)}catch{return t}};bi.private_safeColorChannel=nV;function xu(t){const{type:e,colorSpace:r}=t;let{values:i}=t;return e.indexOf("rgb")!==-1?i=i.map((n,s)=>s<3?parseInt(n,10):n):e.indexOf("hsl")!==-1&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),e.indexOf("color")!==-1?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${e}(${i})`}function sV(t){if(t.indexOf("#")===0)return t;const{values:e}=ks(t);return`#${e.map((r,i)=>iV(i===3?Math.round(255*r):r)).join("")}`}function sN(t){t=ks(t);const{values:e}=t,r=e[0],i=e[1]/100,n=e[2]/100,s=i*Math.min(n,1-n),a=(c,u=(c+r/30)%12)=>n-s*Math.max(Math.min(u-3,9-u,1),-1);let o="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(o+="a",l.push(e[3])),xu({type:o,values:l})}function Qp(t){t=ks(t);let e=t.type==="hsl"||t.type==="hsla"?ks(sN(t)).values:t.values;return e=e.map(r=>(t.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function aV(t,e){const r=Qp(t),i=Qp(e);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function aN(t,e){return t=ks(t),e=Fw(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,xu(t)}function oV(t,e,r){try{return aN(t,e)}catch{return t}}function Iw(t,e){if(t=ks(t),e=Fw(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)t.values[r]*=1-e;return xu(t)}function lV(t,e,r){try{return Iw(t,e)}catch{return t}}function Ow(t,e){if(t=ks(t),e=Fw(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)t.values[r]+=(255-t.values[r])*e;else if(t.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)t.values[r]+=(1-t.values[r])*e;return xu(t)}function cV(t,e,r){try{return Ow(t,e)}catch{return t}}function oN(t,e=.15){return Qp(t)>.5?Iw(t,e):Ow(t,e)}function uV(t,e,r){try{return oN(t,e)}catch{return t}}function dV(t,e,r,i=1){const n=(l,c)=>Math.round((l**(1/i)*(1-r)+c**(1/i)*r)**i),s=ks(t),a=ks(e),o=[n(s.values[0],a.values[0]),n(s.values[1],a.values[1]),n(s.values[2],a.values[2])];return xu({type:"rgb",values:o})}const hV=["mode","contrastThreshold","tonalOffset"],Hk={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:rh.white,default:rh.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}},Uy={text:{primary:rh.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:rh.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 Uk(t,e,r,i){const n=i.light||i,s=i.dark||i*1.5;t[e]||(t.hasOwnProperty(r)?t[e]=t[r]:e==="light"?t.light=Kp(t.main,n):e==="dark"&&(t.dark=qp(t.main,s)))}function fV(t="light"){return t==="dark"?{main:ic[200],light:ic[50],dark:ic[400]}:{main:ic[700],light:ic[400],dark:ic[800]}}function pV(t="light"){return t==="dark"?{main:rc[200],light:rc[50],dark:rc[400]}:{main:rc[500],light:rc[300],dark:rc[700]}}function mV(t="light"){return t==="dark"?{main:tc[500],light:tc[300],dark:tc[700]}:{main:tc[700],light:tc[400],dark:tc[800]}}function gV(t="light"){return t==="dark"?{main:nc[400],light:nc[300],dark:nc[700]}:{main:nc[700],light:nc[500],dark:nc[900]}}function yV(t="light"){return t==="dark"?{main:sc[400],light:sc[300],dark:sc[700]}:{main:sc[800],light:sc[500],dark:sc[900]}}function bV(t="light"){return t==="dark"?{main:Uu[400],light:Uu[300],dark:Uu[700]}:{main:"#ed6c02",light:Uu[500],dark:Uu[900]}}function vV(t){const{mode:e="light",contrastThreshold:r=3,tonalOffset:i=.2}=t,n=oe(t,hV),s=t.primary||fV(e),a=t.secondary||pV(e),o=t.error||mV(e),l=t.info||gV(e),c=t.success||yV(e),u=t.warning||bV(e);function d(m){return tV(m,Uy.text.primary)>=r?Uy.text.primary:Hk.text.primary}const h=({color:m,name:y,mainShade:v=500,lightShade:g=300,darkShade:b=700})=>{if(m=S({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Qa(11,y?` (${y})`:"",v));if(typeof m.main!="string")throw new Error(Qa(12,y?` (${y})`:"",JSON.stringify(m.main)));return Uk(m,"light",g,i),Uk(m,"dark",b,i),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:Uy,light:Hk};return gn(S({common:S({},rh),mode:e,primary:h({color:s,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:o,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:jF,contrastThreshold:r,getContrastText:d,augmentColor:h,tonalOffset:i},p[e]),n)}const wV=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function SV(t){return Math.round(t*1e5)/1e5}const Gk={textTransform:"uppercase"},jk='"Roboto", "Helvetica", "Arial", sans-serif';function xV(t,e){const r=typeof e=="function"?e(t):e,{fontFamily:i=jk,fontSize:n=14,fontWeightLight:s=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,h=oe(r,wV),p=n/14,f=d||(v=>`${v/c*p}rem`),m=(v,g,b,k,C)=>S({fontFamily:i,fontWeight:v,fontSize:f(g),lineHeight:b},i===jk?{letterSpacing:`${SV(k/g)}em`}:{},C,u),y={h1:m(s,96,1.167,-1.5),h2:m(s,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,Gk),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,Gk),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return gn(S({htmlFontSize:c,pxToRem:f,fontFamily:i,fontSize:n,fontWeightLight:s,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:l},y),h,{clone:!1})}const kV=.2,CV=.14,TV=.12;function Lr(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${kV})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${CV})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${TV})`].join(",")}const _V=["none",Lr(0,2,1,-1,0,1,1,0,0,1,3,0),Lr(0,3,1,-2,0,2,2,0,0,1,5,0),Lr(0,3,3,-2,0,3,4,0,0,1,8,0),Lr(0,2,4,-1,0,4,5,0,0,1,10,0),Lr(0,3,5,-1,0,5,8,0,0,1,14,0),Lr(0,3,5,-1,0,6,10,0,0,1,18,0),Lr(0,4,5,-2,0,7,10,1,0,2,16,1),Lr(0,5,5,-3,0,8,10,1,0,3,14,2),Lr(0,5,6,-3,0,9,12,1,0,3,16,2),Lr(0,6,6,-3,0,10,14,1,0,4,18,3),Lr(0,6,7,-4,0,11,15,1,0,4,20,3),Lr(0,7,8,-4,0,12,17,2,0,5,22,4),Lr(0,7,8,-4,0,13,19,2,0,5,24,4),Lr(0,7,9,-4,0,14,21,2,0,5,26,4),Lr(0,8,9,-5,0,15,22,2,0,6,28,5),Lr(0,8,10,-5,0,16,24,2,0,6,30,5),Lr(0,8,11,-5,0,17,26,2,0,6,32,5),Lr(0,9,11,-5,0,18,28,2,0,7,34,6),Lr(0,9,12,-6,0,19,29,2,0,7,36,6),Lr(0,10,13,-6,0,20,31,3,0,8,38,7),Lr(0,10,13,-6,0,21,33,3,0,8,40,7),Lr(0,10,14,-6,0,22,35,3,0,8,42,7),Lr(0,11,14,-7,0,23,36,3,0,9,44,8),Lr(0,11,15,-7,0,24,38,3,0,9,46,8)],BV=["duration","easing","delay"],PV={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)"},NV={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Yk(t){return`${Math.round(t)}ms`}function EV(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function RV(t){const e=S({},PV,t.easing),r=S({},NV,t.duration);return S({getAutoHeightDuration:EV,create:(n=["all"],s={})=>{const{duration:a=r.standard,easing:o=e.easeInOut,delay:l=0}=s;return oe(s,BV),(Array.isArray(n)?n:[n]).map(c=>`${c} ${typeof a=="string"?a:Yk(a)} ${o} ${typeof l=="string"?l:Yk(l)}`).join(",")}},t,{easing:e,duration:r})}const MV={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},DV=MV,LV=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function lN(t={},...e){const{mixins:r={},palette:i={},transitions:n={},typography:s={}}=t,a=oe(t,LV);if(t.vars)throw new Error(Qa(18));const o=vV(i),l=Ah(t);let c=gn(l,{mixins:JA(l.breakpoints,r),palette:o,shadows:_V.slice(),typography:xV(o,s),transitions:RV(n),zIndex:S({},DV)});return c=gn(c,a),c=e.reduce((u,d)=>gn(u,d),c),c.unstable_sxConfig=S({},Oh,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(d){return Su({sx:d,theme:this})},c}const FV=lN(),Tg=FV;function qo(){const t=ug(Tg);return t[Lh]||t}function Ae({props:t,name:e}){return XP({props:t,name:e,defaultTheme:Tg,themeId:Lh})}var $h={},Gy={exports:{}},Xk;function IV(){return Xk||(Xk=1,function(t){function e(r,i){if(r==null)return{};var n={};for(var s in r)if({}.hasOwnProperty.call(r,s)){if(i.indexOf(s)>=0)continue;n[s]=r[s]}return n}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(Gy)),Gy.exports}const cN=Go(tO),OV=Go(rO),AV=Go(cO),VV=Go(hA),$V=Go(QO),zV=Go(iA);var ku=tN;Object.defineProperty($h,"__esModule",{value:!0});var WV=$h.default=t5;$h.shouldForwardProp=pp;$h.systemDefaultTheme=void 0;var as=ku(_P()),$0=ku(IV()),qk=qV(cN),HV=OV;ku(AV);ku(VV);var UV=ku($V),GV=ku(zV);const jV=["ownerState"],YV=["variants"],XV=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function uN(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(uN=function(i){return i?r:e})(t)}function qV(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=uN(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)){var a=n?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function KV(t){return Object.keys(t).length===0}function QV(t){return typeof t=="string"&&t.charCodeAt(0)>96}function pp(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const JV=$h.systemDefaultTheme=(0,UV.default)(),ZV=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function kf({defaultTheme:t,theme:e,themeId:r}){return KV(e)?t:e[r]||e}function e5(t){return t?(e,r)=>r[t]:null}function mp(t,e){let{ownerState:r}=e,i=(0,$0.default)(e,jV);const n=typeof t=="function"?t((0,as.default)({ownerState:r},i)):t;if(Array.isArray(n))return n.flatMap(s=>mp(s,(0,as.default)({ownerState:r},i)));if(n&&typeof n=="object"&&Array.isArray(n.variants)){const{variants:s=[]}=n;let o=(0,$0.default)(n,YV);return s.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,as.default)({ownerState:r},i,r)):Object.keys(l.props).forEach(u=>{(r==null?void 0:r[u])!==l.props[u]&&i[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(o)||(o=[o]),o.push(typeof l.style=="function"?l.style((0,as.default)({ownerState:r},i,r)):l.style))}),o}return n}function t5(t={}){const{themeId:e,defaultTheme:r=JV,rootShouldForwardProp:i=pp,slotShouldForwardProp:n=pp}=t,s=a=>(0,GV.default)((0,as.default)({},a,{theme:kf((0,as.default)({},a,{defaultTheme:r,themeId:e}))}));return s.__mui_systemSx=!0,(a,o={})=>{(0,qk.internal_processStyles)(a,C=>C.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:h=e5(ZV(c))}=o,p=(0,$0.default)(o,XV),f=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let y,v=pp;c==="Root"||c==="root"?v=i:c?v=n:QV(a)&&(v=void 0);const g=(0,qk.default)(a,(0,as.default)({shouldForwardProp:v,label:y},p)),b=C=>typeof C=="function"&&C.__emotion_real!==C||(0,HV.isPlainObject)(C)?x=>mp(C,(0,as.default)({},x,{theme:kf({theme:x.theme,defaultTheme:r,themeId:e})})):C,k=(C,...x)=>{let _=b(C);const P=x?x.map(b):[];l&&h&&P.push(D=>{const $=kf((0,as.default)({},D,{defaultTheme:r,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const I=$.components[l].styleOverrides,F={};return Object.entries(I).forEach(([M,O])=>{F[M]=mp(O,(0,as.default)({},D,{theme:$}))}),h(D,F)}),l&&!f&&P.push(D=>{var $;const I=kf((0,as.default)({},D,{defaultTheme:r,themeId:e})),F=I==null||($=I.components)==null||($=$[l])==null?void 0:$.variants;return mp({variants:F},(0,as.default)({},D,{theme:I}))}),m||P.push(s);const R=P.length-x.length;if(Array.isArray(C)&&R>0){const D=new Array(R).fill("");_=[...C,...D],_.raw=[...C.raw,...D]}const E=g(_,...P);return a.muiName&&(E.muiName=a.muiName),E};return g.withConfig&&(k.withConfig=g.withConfig),k}}function zh(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const tn=t=>zh(t)&&t!=="classes",K=WV({themeId:Lh,defaultTheme:Tg,rootShouldForwardProp:tn}),Kk=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function r5(t){return He("MuiSvgIcon",t)}Ue("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const i5=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],n5=t=>{const{color:e,fontSize:r,classes:i}=t,n={root:["root",e!=="inherit"&&`color${Pe(e)}`,`fontSize${Pe(r)}`]};return $e(n,r5,i)},s5=K("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.color!=="inherit"&&e[`color${Pe(r.color)}`],e[`fontSize${Pe(r.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var r,i,n,s,a,o,l,c,u,d,h,p,f;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=t.transitions)==null||(i=r.create)==null?void 0:i.call(r,"fill",{duration:(n=t.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((s=t.typography)==null||(a=s.pxToRem)==null?void 0:a.call(s,20))||"1.25rem",medium:((o=t.typography)==null||(l=o.pxToRem)==null?void 0:l.call(o,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(d=(h=(t.vars||t).palette)==null||(h=h[e.color])==null?void 0:h.main)!=null?d:{action:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(f=(t.vars||t).palette)==null||(f=f.action)==null?void 0:f.disabled,inherit:void 0}[e.color]}}),z0=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiSvgIcon"}),{children:n,className:s,color:a="inherit",component:o="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24"}=i,p=oe(i,i5),f=w.isValidElement(n)&&n.type==="svg",m=S({},i,{color:a,component:o,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:f}),y={};u||(y.viewBox=h);const v=n5(m);return T.jsxs(s5,S({as:o,className:xe(v.root,s),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:r},y,p,f&&n.props,{ownerState:m,children:[f?n.props.children:n,d?T.jsx("title",{children:d}):null]}))});z0.muiName="SvgIcon";function Tr(t,e){function r(i,n){return T.jsx(z0,S({"data-testid":`${e}Icon`,ref:n},i,{children:t}))}return r.muiName=z0.muiName,w.memo(w.forwardRef(r))}var mr={};/** + */var Nw=Symbol.for("react.element"),Ew=Symbol.for("react.portal"),hg=Symbol.for("react.fragment"),fg=Symbol.for("react.strict_mode"),pg=Symbol.for("react.profiler"),mg=Symbol.for("react.provider"),gg=Symbol.for("react.context"),uA=Symbol.for("react.server_context"),yg=Symbol.for("react.forward_ref"),bg=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),wg=Symbol.for("react.memo"),Sg=Symbol.for("react.lazy"),dA=Symbol.for("react.offscreen"),UP;UP=Symbol.for("react.module.reference");function Ns(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Nw:switch(t=t.type,t){case hg:case pg:case fg:case bg:case vg:return t;default:switch(t=t&&t.$$typeof,t){case uA:case gg:case yg:case Sg:case wg:case mg:return t;default:return e}}case Ew:return e}}}ur.ContextConsumer=gg;ur.ContextProvider=mg;ur.Element=Nw;ur.ForwardRef=yg;ur.Fragment=hg;ur.Lazy=Sg;ur.Memo=wg;ur.Portal=Ew;ur.Profiler=pg;ur.StrictMode=fg;ur.Suspense=bg;ur.SuspenseList=vg;ur.isAsyncMode=function(){return!1};ur.isConcurrentMode=function(){return!1};ur.isContextConsumer=function(t){return Ns(t)===gg};ur.isContextProvider=function(t){return Ns(t)===mg};ur.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Nw};ur.isForwardRef=function(t){return Ns(t)===yg};ur.isFragment=function(t){return Ns(t)===hg};ur.isLazy=function(t){return Ns(t)===Sg};ur.isMemo=function(t){return Ns(t)===wg};ur.isPortal=function(t){return Ns(t)===Ew};ur.isProfiler=function(t){return Ns(t)===pg};ur.isStrictMode=function(t){return Ns(t)===fg};ur.isSuspense=function(t){return Ns(t)===bg};ur.isSuspenseList=function(t){return Ns(t)===vg};ur.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===hg||t===pg||t===fg||t===bg||t===vg||t===dA||typeof t=="object"&&t!==null&&(t.$$typeof===Sg||t.$$typeof===wg||t.$$typeof===mg||t.$$typeof===gg||t.$$typeof===yg||t.$$typeof===UP||t.getModuleId!==void 0)};ur.typeOf=Ns;HP.exports=ur;var Ik=HP.exports;const hA=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function GP(t){const e=`${t}`.match(hA);return e&&e[1]||""}function jP(t,e=""){return t.displayName||t.name||GP(t)||e}function Ok(t,e,r){const i=jP(e);return t.displayName||(i!==""?`${r}(${i})`:r)}function fA(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return jP(t,"Component");if(typeof t=="object")switch(t.$$typeof){case Ik.ForwardRef:return Ok(t,t.render,"ForwardRef");case Ik.Memo:return Ok(t,t.type,"memo");default:return}}}const pA=Object.freeze(Object.defineProperty({__proto__:null,default:fA,getFunctionName:GP},Symbol.toStringTag,{value:"Module"})),mA=["ownerState"],gA=["variants"],yA=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function bA(t){return Object.keys(t).length===0}function vA(t){return typeof t=="string"&&t.charCodeAt(0)>96}function dp(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const wA=Ah(),SA=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function xf({defaultTheme:t,theme:e,themeId:r}){return bA(e)?t:e[r]||e}function xA(t){return t?(e,r)=>r[t]:null}function hp(t,e){let{ownerState:r}=e,i=le(e,mA);const n=typeof t=="function"?t(S({ownerState:r},i)):t;if(Array.isArray(n))return n.flatMap(s=>hp(s,S({ownerState:r},i)));if(n&&typeof n=="object"&&Array.isArray(n.variants)){const{variants:s=[]}=n;let o=le(n,gA);return s.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(S({ownerState:r},i,r)):Object.keys(l.props).forEach(u=>{(r==null?void 0:r[u])!==l.props[u]&&i[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(o)||(o=[o]),o.push(typeof l.style=="function"?l.style(S({ownerState:r},i,r)):l.style))}),o}return n}function kA(t={}){const{themeId:e,defaultTheme:r=wA,rootShouldForwardProp:i=dp,slotShouldForwardProp:n=dp}=t,s=a=>Su(S({},a,{theme:xf(S({},a,{defaultTheme:r,themeId:e}))}));return s.__mui_systemSx=!0,(a,o={})=>{RP(a,C=>C.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:h=xA(SA(c))}=o,p=le(o,yA),f=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let y,v=dp;c==="Root"||c==="root"?v=i:c?v=n:vA(a)&&(v=void 0);const g=kw(a,S({shouldForwardProp:v,label:y},p)),b=C=>typeof C=="function"&&C.__emotion_real!==C||Da(C)?x=>hp(C,S({},x,{theme:xf({theme:x.theme,defaultTheme:r,themeId:e})})):C,k=(C,...x)=>{let _=b(C);const P=x?x.map(b):[];l&&h&&P.push(D=>{const $=xf(S({},D,{defaultTheme:r,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const I=$.components[l].styleOverrides,F={};return Object.entries(I).forEach(([M,O])=>{F[M]=hp(O,S({},D,{theme:$}))}),h(D,F)}),l&&!f&&P.push(D=>{var $;const I=xf(S({},D,{defaultTheme:r,themeId:e})),F=I==null||($=I.components)==null||($=$[l])==null?void 0:$.variants;return hp({variants:F},S({},D,{theme:I}))}),m||P.push(s);const R=P.length-x.length;if(Array.isArray(C)&&R>0){const D=new Array(R).fill("");_=[...C,...D],_.raw=[...C.raw,...D]}const E=g(_,...P);return a.muiName&&(E.muiName=a.muiName),E};return g.withConfig&&(k.withConfig=g.withConfig),k}}const CA=kA();function Rw(t,e){const r=S({},e);return Object.keys(t).forEach(i=>{if(i.toString().match(/^(components|slots)$/))r[i]=S({},t[i],r[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){const n=t[i]||{},s=e[i];r[i]={},!s||!Object.keys(s)?r[i]=n:!n||!Object.keys(n)?r[i]=s:(r[i]=S({},s),Object.keys(n).forEach(a=>{r[i][a]=Rw(n[a],s[a])}))}else r[i]===void 0&&(r[i]=t[i])}),r}function YP(t){const{theme:e,name:r,props:i}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?i:Rw(e.components[r].defaultProps,i)}function XP({props:t,name:e,defaultTheme:r,themeId:i}){let n=ug(r);return i&&(n=n[i]||n),YP({theme:n,name:e,props:t})}const zr=typeof window<"u"?w.useLayoutEffect:w.useEffect;function TA(t,e,r,i,n){const[s,a]=w.useState(()=>n&&r?r(t).matches:i?i(t).matches:e);return zr(()=>{let o=!0;if(!r)return;const l=r(t),c=()=>{o&&a(l.matches)};return c(),l.addListener(c),()=>{o=!1,l.removeListener(c)}},[t,r]),s}const qP=w.useSyncExternalStore;function _A(t,e,r,i,n){const s=w.useCallback(()=>e,[e]),a=w.useMemo(()=>{if(n&&r)return()=>r(t).matches;if(i!==null){const{matches:u}=i(t);return()=>u}return s},[s,t,i,n,r]),[o,l]=w.useMemo(()=>{if(r===null)return[s,()=>()=>{}];const u=r(t);return[()=>u.matches,d=>(u.addListener(d),()=>{u.removeListener(d)})]},[s,r,t]);return qP(l,o,a)}function Mw(t,e={}){const r=VP(),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:n=!1,matchMedia:s=i?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:o=!1}=YP({name:"MuiUseMediaQuery",props:e,theme:r});let l=typeof t=="function"?t(r):t;return l=l.replace(/^@media( ?)/m,""),(qP!==void 0?_A:TA)(l,n,s,a,o)}function xo(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}const BA=Object.freeze(Object.defineProperty({__proto__:null,default:xo},Symbol.toStringTag,{value:"Module"}));function PA(t,e=0,r=1){return xo(t,e,r)}function NA(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(e);return r&&r[0].length===1&&(r=r.map(i=>i+i)),r?`rgb${r.length===4?"a":""}(${r.map((i,n)=>n<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function KP(t){if(t.type)return t;if(t.charAt(0)==="#")return KP(NA(t));const e=t.indexOf("("),r=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Ja(9,t));let i=t.substring(e+1,t.length-1),n;if(r==="color"){if(i=i.split(" "),n=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error(Ja(10,n))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:n}}function EA(t){const{type:e,colorSpace:r}=t;let{values:i}=t;return e.indexOf("rgb")!==-1?i=i.map((n,s)=>s<3?parseInt(n,10):n):e.indexOf("hsl")!==-1&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),e.indexOf("color")!==-1?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${e}(${i})`}function Ca(t,e){return t=KP(t),e=PA(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,EA(t)}const RA=z.oneOfType([z.func,z.object]),xg=RA;function Ak(...t){return t.reduce((e,r)=>r==null?e:function(...n){e.apply(this,n),r.apply(this,n)},()=>{})}function Vh(t,e=166){let r;function i(...n){const s=()=>{t.apply(this,n)};clearTimeout(r),r=setTimeout(s,e)}return i.clear=()=>{clearTimeout(r)},i}function fp(t,e){var r,i;return w.isValidElement(t)&&e.indexOf((r=t.type.muiName)!=null?r:(i=t.type)==null||(i=i._payload)==null||(i=i.value)==null?void 0:i.muiName)!==-1}function qr(t){return t&&t.ownerDocument||document}function ea(t){return qr(t).defaultView||window}function A0(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let Vk=0;function MA(t){const[e,r]=w.useState(t),i=t||e;return w.useEffect(()=>{e==null&&(Vk+=1,r(`mui-${Vk}`))},[e]),i}const $k=Gc.useId;function ia(t){if($k!==void 0){const e=$k();return t??e}return MA(t)}function xs({controlled:t,default:e,name:r,state:i="value"}){const{current:n}=w.useRef(t!==void 0),[s,a]=w.useState(e),o=n?t:s,l=w.useCallback(c=>{n||a(c)},[]);return[o,l]}function Xe(t){const e=w.useRef(t);return zr(()=>{e.current=t}),w.useRef((...r)=>(0,e.current)(...r)).current}function Wt(...t){return w.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(r=>{A0(r,e)})},t)}const zk={};function DA(t,e){const r=w.useRef(zk);return r.current===zk&&(r.current=t(e)),r}const LA=[];function FA(t){w.useEffect(t,LA)}class kg{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new kg}start(e,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,r()},e)}}function QP(){const t=DA(kg.create).current;return FA(t.disposeEffect),t}let Cg=!0,V0=!1;const IA=new kg,OA={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 AA(t){const{type:e,tagName:r}=t;return!!(r==="INPUT"&&OA[e]&&!t.readOnly||r==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function VA(t){t.metaKey||t.altKey||t.ctrlKey||(Cg=!0)}function Hy(){Cg=!1}function $A(){this.visibilityState==="hidden"&&V0&&(Cg=!0)}function zA(t){t.addEventListener("keydown",VA,!0),t.addEventListener("mousedown",Hy,!0),t.addEventListener("pointerdown",Hy,!0),t.addEventListener("touchstart",Hy,!0),t.addEventListener("visibilitychange",$A,!0)}function WA(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return Cg||AA(e)}function Dw(){const t=w.useCallback(n=>{n!=null&&zA(n.ownerDocument)},[]),e=w.useRef(!1);function r(){return e.current?(V0=!0,IA.start(100,()=>{V0=!1}),e.current=!1,!0):!1}function i(n){return WA(n)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:i,onBlur:r,ref:t}}function JP(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let ac;function ZP(){if(ac)return ac;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),ac="reverse",t.scrollLeft>0?ac="default":(t.scrollLeft=1,t.scrollLeft===0&&(ac="negative")),document.body.removeChild(t),ac}function HA(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(ZP()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}const UA={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},Lw=UA;function ze(t,e,r=void 0){const i={};return Object.keys(t).forEach(n=>{i[n]=t[n].reduce((s,a)=>{if(a){const o=e(a);o!==""&&s.push(o),r&&r[a]&&s.push(r[a])}return s},[]).join(" ")}),i}const GA=w.createContext(),Xi=()=>{const t=w.useContext(GA);return t??!1},jA=["component","direction","spacing","divider","children","className","useFlexGap"],YA=Ah(),XA=CA("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function qA(t){return XP({props:t,name:"MuiStack",defaultTheme:YA})}function KA(t,e){const r=w.Children.toArray(t).filter(Boolean);return r.reduce((i,n,s)=>(i.push(n),s({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],JA=({ownerState:t,theme:e})=>{let r=S({display:"flex",flexDirection:"column"},Zs({theme:e},Wy({values:t.direction,breakpoints:e.breakpoints.values}),i=>({flexDirection:i})));if(t.spacing){const i=Bw(e),n=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),s=Wy({values:t.direction,base:n}),a=Wy({values:t.spacing,base:n});typeof s=="object"&&Object.keys(s).forEach((l,c,u)=>{if(!s[l]){const h=c>0?s[u[c-1]]:"column";s[l]=h}}),r=gn(r,Zs({theme:e},a,(l,c)=>t.useFlexGap?{gap:Al(i,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${QA(c?s[c]:t.direction)}`]:Al(i,l)}}))}return r=cO(e.breakpoints,r),r};function ZA(t={}){const{createStyledComponent:e=XA,useThemeProps:r=qA,componentName:i="MuiStack"}=t,n=()=>ze({root:["root"]},l=>Ue(i,l),{}),s=e(JA);return w.forwardRef(function(l,c){const u=r(l),d=dg(u),{component:h="div",direction:p="column",spacing:f=0,divider:m,children:y,className:v,useFlexGap:g=!1}=d,b=le(d,jA),k={direction:p,spacing:f,useFlexGap:g},C=n();return T.jsx(s,S({as:h,ownerState:k,ref:c,className:ke(C.root,v)},b,{children:m?KA(y,m):y}))})}function eV(t,e){return S({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var bi={},eN={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(eN);var tN=eN.exports;const tV=jo(qF),rV=jo(BA);var rN=tN;Object.defineProperty(bi,"__esModule",{value:!0});var Jt=bi.alpha=aN;bi.blend=fV;bi.colorChannel=void 0;var qp=bi.darken=Iw;bi.decomposeColor=ks;bi.emphasize=oN;var iV=bi.getContrastRatio=lV;bi.getLuminance=Qp;bi.hexToRgb=iN;bi.hslToRgb=sN;var Kp=bi.lighten=Ow;bi.private_safeAlpha=cV;bi.private_safeColorChannel=void 0;bi.private_safeDarken=uV;bi.private_safeEmphasize=hV;bi.private_safeLighten=dV;bi.recomposeColor=xu;bi.rgbToHex=oV;var Wk=rN(tV),nV=rN(rV);function Fw(t,e=0,r=1){return(0,nV.default)(t,e,r)}function iN(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(e);return r&&r[0].length===1&&(r=r.map(i=>i+i)),r?`rgb${r.length===4?"a":""}(${r.map((i,n)=>n<3?parseInt(i,16):Math.round(parseInt(i,16)/255*1e3)/1e3).join(", ")})`:""}function sV(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function ks(t){if(t.type)return t;if(t.charAt(0)==="#")return ks(iN(t));const e=t.indexOf("("),r=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error((0,Wk.default)(9,t));let i=t.substring(e+1,t.length-1),n;if(r==="color"){if(i=i.split(" "),n=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error((0,Wk.default)(10,n))}else i=i.split(",");return i=i.map(s=>parseFloat(s)),{type:r,values:i,colorSpace:n}}const nN=t=>{const e=ks(t);return e.values.slice(0,3).map((r,i)=>e.type.indexOf("hsl")!==-1&&i!==0?`${r}%`:r).join(" ")};bi.colorChannel=nN;const aV=(t,e)=>{try{return nN(t)}catch{return t}};bi.private_safeColorChannel=aV;function xu(t){const{type:e,colorSpace:r}=t;let{values:i}=t;return e.indexOf("rgb")!==-1?i=i.map((n,s)=>s<3?parseInt(n,10):n):e.indexOf("hsl")!==-1&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),e.indexOf("color")!==-1?i=`${r} ${i.join(" ")}`:i=`${i.join(", ")}`,`${e}(${i})`}function oV(t){if(t.indexOf("#")===0)return t;const{values:e}=ks(t);return`#${e.map((r,i)=>sV(i===3?Math.round(255*r):r)).join("")}`}function sN(t){t=ks(t);const{values:e}=t,r=e[0],i=e[1]/100,n=e[2]/100,s=i*Math.min(n,1-n),a=(c,u=(c+r/30)%12)=>n-s*Math.max(Math.min(u-3,9-u,1),-1);let o="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(o+="a",l.push(e[3])),xu({type:o,values:l})}function Qp(t){t=ks(t);let e=t.type==="hsl"||t.type==="hsla"?ks(sN(t)).values:t.values;return e=e.map(r=>(t.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function lV(t,e){const r=Qp(t),i=Qp(e);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function aN(t,e){return t=ks(t),e=Fw(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,xu(t)}function cV(t,e,r){try{return aN(t,e)}catch{return t}}function Iw(t,e){if(t=ks(t),e=Fw(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)t.values[r]*=1-e;return xu(t)}function uV(t,e,r){try{return Iw(t,e)}catch{return t}}function Ow(t,e){if(t=ks(t),e=Fw(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)t.values[r]+=(255-t.values[r])*e;else if(t.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)t.values[r]+=(1-t.values[r])*e;return xu(t)}function dV(t,e,r){try{return Ow(t,e)}catch{return t}}function oN(t,e=.15){return Qp(t)>.5?Iw(t,e):Ow(t,e)}function hV(t,e,r){try{return oN(t,e)}catch{return t}}function fV(t,e,r,i=1){const n=(l,c)=>Math.round((l**(1/i)*(1-r)+c**(1/i)*r)**i),s=ks(t),a=ks(e),o=[n(s.values[0],a.values[0]),n(s.values[1],a.values[1]),n(s.values[2],a.values[2])];return xu({type:"rgb",values:o})}const pV=["mode","contrastThreshold","tonalOffset"],Hk={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:rh.white,default:rh.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}},Uy={text:{primary:rh.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:rh.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 Uk(t,e,r,i){const n=i.light||i,s=i.dark||i*1.5;t[e]||(t.hasOwnProperty(r)?t[e]=t[r]:e==="light"?t.light=Kp(t.main,n):e==="dark"&&(t.dark=qp(t.main,s)))}function mV(t="light"){return t==="dark"?{main:ic[200],light:ic[50],dark:ic[400]}:{main:ic[700],light:ic[400],dark:ic[800]}}function gV(t="light"){return t==="dark"?{main:rc[200],light:rc[50],dark:rc[400]}:{main:rc[500],light:rc[300],dark:rc[700]}}function yV(t="light"){return t==="dark"?{main:tc[500],light:tc[300],dark:tc[700]}:{main:tc[700],light:tc[400],dark:tc[800]}}function bV(t="light"){return t==="dark"?{main:nc[400],light:nc[300],dark:nc[700]}:{main:nc[700],light:nc[500],dark:nc[900]}}function vV(t="light"){return t==="dark"?{main:sc[400],light:sc[300],dark:sc[700]}:{main:sc[800],light:sc[500],dark:sc[900]}}function wV(t="light"){return t==="dark"?{main:Uu[400],light:Uu[300],dark:Uu[700]}:{main:"#ed6c02",light:Uu[500],dark:Uu[900]}}function SV(t){const{mode:e="light",contrastThreshold:r=3,tonalOffset:i=.2}=t,n=le(t,pV),s=t.primary||mV(e),a=t.secondary||gV(e),o=t.error||yV(e),l=t.info||bV(e),c=t.success||vV(e),u=t.warning||wV(e);function d(m){return iV(m,Uy.text.primary)>=r?Uy.text.primary:Hk.text.primary}const h=({color:m,name:y,mainShade:v=500,lightShade:g=300,darkShade:b=700})=>{if(m=S({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Ja(11,y?` (${y})`:"",v));if(typeof m.main!="string")throw new Error(Ja(12,y?` (${y})`:"",JSON.stringify(m.main)));return Uk(m,"light",g,i),Uk(m,"dark",b,i),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:Uy,light:Hk};return gn(S({common:S({},rh),mode:e,primary:h({color:s,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:o,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:XF,contrastThreshold:r,getContrastText:d,augmentColor:h,tonalOffset:i},p[e]),n)}const xV=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function kV(t){return Math.round(t*1e5)/1e5}const Gk={textTransform:"uppercase"},jk='"Roboto", "Helvetica", "Arial", sans-serif';function CV(t,e){const r=typeof e=="function"?e(t):e,{fontFamily:i=jk,fontSize:n=14,fontWeightLight:s=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,h=le(r,xV),p=n/14,f=d||(v=>`${v/c*p}rem`),m=(v,g,b,k,C)=>S({fontFamily:i,fontWeight:v,fontSize:f(g),lineHeight:b},i===jk?{letterSpacing:`${kV(k/g)}em`}:{},C,u),y={h1:m(s,96,1.167,-1.5),h2:m(s,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,Gk),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,Gk),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return gn(S({htmlFontSize:c,pxToRem:f,fontFamily:i,fontSize:n,fontWeightLight:s,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:l},y),h,{clone:!1})}const TV=.2,_V=.14,BV=.12;function Lr(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${TV})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${_V})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${BV})`].join(",")}const PV=["none",Lr(0,2,1,-1,0,1,1,0,0,1,3,0),Lr(0,3,1,-2,0,2,2,0,0,1,5,0),Lr(0,3,3,-2,0,3,4,0,0,1,8,0),Lr(0,2,4,-1,0,4,5,0,0,1,10,0),Lr(0,3,5,-1,0,5,8,0,0,1,14,0),Lr(0,3,5,-1,0,6,10,0,0,1,18,0),Lr(0,4,5,-2,0,7,10,1,0,2,16,1),Lr(0,5,5,-3,0,8,10,1,0,3,14,2),Lr(0,5,6,-3,0,9,12,1,0,3,16,2),Lr(0,6,6,-3,0,10,14,1,0,4,18,3),Lr(0,6,7,-4,0,11,15,1,0,4,20,3),Lr(0,7,8,-4,0,12,17,2,0,5,22,4),Lr(0,7,8,-4,0,13,19,2,0,5,24,4),Lr(0,7,9,-4,0,14,21,2,0,5,26,4),Lr(0,8,9,-5,0,15,22,2,0,6,28,5),Lr(0,8,10,-5,0,16,24,2,0,6,30,5),Lr(0,8,11,-5,0,17,26,2,0,6,32,5),Lr(0,9,11,-5,0,18,28,2,0,7,34,6),Lr(0,9,12,-6,0,19,29,2,0,7,36,6),Lr(0,10,13,-6,0,20,31,3,0,8,38,7),Lr(0,10,13,-6,0,21,33,3,0,8,40,7),Lr(0,10,14,-6,0,22,35,3,0,8,42,7),Lr(0,11,14,-7,0,23,36,3,0,9,44,8),Lr(0,11,15,-7,0,24,38,3,0,9,46,8)],NV=["duration","easing","delay"],EV={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)"},RV={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Yk(t){return`${Math.round(t)}ms`}function MV(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function DV(t){const e=S({},EV,t.easing),r=S({},RV,t.duration);return S({getAutoHeightDuration:MV,create:(n=["all"],s={})=>{const{duration:a=r.standard,easing:o=e.easeInOut,delay:l=0}=s;return le(s,NV),(Array.isArray(n)?n:[n]).map(c=>`${c} ${typeof a=="string"?a:Yk(a)} ${o} ${typeof l=="string"?l:Yk(l)}`).join(",")}},t,{easing:e,duration:r})}const LV={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},FV=LV,IV=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function lN(t={},...e){const{mixins:r={},palette:i={},transitions:n={},typography:s={}}=t,a=le(t,IV);if(t.vars)throw new Error(Ja(18));const o=SV(i),l=Ah(t);let c=gn(l,{mixins:eV(l.breakpoints,r),palette:o,shadows:PV.slice(),typography:CV(o,s),transitions:DV(n),zIndex:S({},FV)});return c=gn(c,a),c=e.reduce((u,d)=>gn(u,d),c),c.unstable_sxConfig=S({},Oh,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(d){return Su({sx:d,theme:this})},c}const OV=lN(),Tg=OV;function Ko(){const t=ug(Tg);return t[Lh]||t}function Ve({props:t,name:e}){return XP({props:t,name:e,defaultTheme:Tg,themeId:Lh})}var $h={},Gy={exports:{}},Xk;function AV(){return Xk||(Xk=1,function(t){function e(r,i){if(r==null)return{};var n={};for(var s in r)if({}.hasOwnProperty.call(r,s)){if(i.indexOf(s)>=0)continue;n[s]=r[s]}return n}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(Gy)),Gy.exports}const cN=jo(iO),VV=jo(nO),$V=jo(dO),zV=jo(pA),WV=jo(ZO),HV=jo(sA);var ku=tN;Object.defineProperty($h,"__esModule",{value:!0});var UV=$h.default=i5;$h.shouldForwardProp=pp;$h.systemDefaultTheme=void 0;var as=ku(_P()),$0=ku(AV()),qk=QV(cN),GV=VV;ku($V);ku(zV);var jV=ku(WV),YV=ku(HV);const XV=["ownerState"],qV=["variants"],KV=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function uN(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(uN=function(i){return i?r:e})(t)}function QV(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=uN(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)){var a=n?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function JV(t){return Object.keys(t).length===0}function ZV(t){return typeof t=="string"&&t.charCodeAt(0)>96}function pp(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const e5=$h.systemDefaultTheme=(0,jV.default)(),t5=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function kf({defaultTheme:t,theme:e,themeId:r}){return JV(e)?t:e[r]||e}function r5(t){return t?(e,r)=>r[t]:null}function mp(t,e){let{ownerState:r}=e,i=(0,$0.default)(e,XV);const n=typeof t=="function"?t((0,as.default)({ownerState:r},i)):t;if(Array.isArray(n))return n.flatMap(s=>mp(s,(0,as.default)({ownerState:r},i)));if(n&&typeof n=="object"&&Array.isArray(n.variants)){const{variants:s=[]}=n;let o=(0,$0.default)(n,qV);return s.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,as.default)({ownerState:r},i,r)):Object.keys(l.props).forEach(u=>{(r==null?void 0:r[u])!==l.props[u]&&i[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(o)||(o=[o]),o.push(typeof l.style=="function"?l.style((0,as.default)({ownerState:r},i,r)):l.style))}),o}return n}function i5(t={}){const{themeId:e,defaultTheme:r=e5,rootShouldForwardProp:i=pp,slotShouldForwardProp:n=pp}=t,s=a=>(0,YV.default)((0,as.default)({},a,{theme:kf((0,as.default)({},a,{defaultTheme:r,themeId:e}))}));return s.__mui_systemSx=!0,(a,o={})=>{(0,qk.internal_processStyles)(a,C=>C.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:h=r5(t5(c))}=o,p=(0,$0.default)(o,KV),f=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let y,v=pp;c==="Root"||c==="root"?v=i:c?v=n:ZV(a)&&(v=void 0);const g=(0,qk.default)(a,(0,as.default)({shouldForwardProp:v,label:y},p)),b=C=>typeof C=="function"&&C.__emotion_real!==C||(0,GV.isPlainObject)(C)?x=>mp(C,(0,as.default)({},x,{theme:kf({theme:x.theme,defaultTheme:r,themeId:e})})):C,k=(C,...x)=>{let _=b(C);const P=x?x.map(b):[];l&&h&&P.push(D=>{const $=kf((0,as.default)({},D,{defaultTheme:r,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const I=$.components[l].styleOverrides,F={};return Object.entries(I).forEach(([M,O])=>{F[M]=mp(O,(0,as.default)({},D,{theme:$}))}),h(D,F)}),l&&!f&&P.push(D=>{var $;const I=kf((0,as.default)({},D,{defaultTheme:r,themeId:e})),F=I==null||($=I.components)==null||($=$[l])==null?void 0:$.variants;return mp({variants:F},(0,as.default)({},D,{theme:I}))}),m||P.push(s);const R=P.length-x.length;if(Array.isArray(C)&&R>0){const D=new Array(R).fill("");_=[...C,...D],_.raw=[...C.raw,...D]}const E=g(_,...P);return a.muiName&&(E.muiName=a.muiName),E};return g.withConfig&&(k.withConfig=g.withConfig),k}}function zh(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const tn=t=>zh(t)&&t!=="classes",K=UV({themeId:Lh,defaultTheme:Tg,rootShouldForwardProp:tn}),Kk=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function n5(t){return Ue("MuiSvgIcon",t)}Ge("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const s5=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],a5=t=>{const{color:e,fontSize:r,classes:i}=t,n={root:["root",e!=="inherit"&&`color${Ne(e)}`,`fontSize${Ne(r)}`]};return ze(n,n5,i)},o5=K("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.color!=="inherit"&&e[`color${Ne(r.color)}`],e[`fontSize${Ne(r.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var r,i,n,s,a,o,l,c,u,d,h,p,f;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(r=t.transitions)==null||(i=r.create)==null?void 0:i.call(r,"fill",{duration:(n=t.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((s=t.typography)==null||(a=s.pxToRem)==null?void 0:a.call(s,20))||"1.25rem",medium:((o=t.typography)==null||(l=o.pxToRem)==null?void 0:l.call(o,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(d=(h=(t.vars||t).palette)==null||(h=h[e.color])==null?void 0:h.main)!=null?d:{action:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(f=(t.vars||t).palette)==null||(f=f.action)==null?void 0:f.disabled,inherit:void 0}[e.color]}}),z0=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiSvgIcon"}),{children:n,className:s,color:a="inherit",component:o="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:h="0 0 24 24"}=i,p=le(i,s5),f=w.isValidElement(n)&&n.type==="svg",m=S({},i,{color:a,component:o,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:f}),y={};u||(y.viewBox=h);const v=a5(m);return T.jsxs(o5,S({as:o,className:ke(v.root,s),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:r},y,p,f&&n.props,{ownerState:m,children:[f?n.props.children:n,d?T.jsx("title",{children:d}):null]}))});z0.muiName="SvgIcon";function Tr(t,e){function r(i,n){return T.jsx(z0,S({"data-testid":`${e}Icon`,ref:n},i,{children:t}))}return r.muiName=z0.muiName,w.memo(w.forwardRef(r))}var mr={};/** * @license React * react-is.production.min.js * @@ -88,7 +88,7 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Aw=Symbol.for("react.element"),Vw=Symbol.for("react.portal"),_g=Symbol.for("react.fragment"),Bg=Symbol.for("react.strict_mode"),Pg=Symbol.for("react.profiler"),Ng=Symbol.for("react.provider"),Eg=Symbol.for("react.context"),a5=Symbol.for("react.server_context"),Rg=Symbol.for("react.forward_ref"),Mg=Symbol.for("react.suspense"),Dg=Symbol.for("react.suspense_list"),Lg=Symbol.for("react.memo"),Fg=Symbol.for("react.lazy"),o5=Symbol.for("react.offscreen"),dN;dN=Symbol.for("react.module.reference");function Es(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Aw:switch(t=t.type,t){case _g:case Pg:case Bg:case Mg:case Dg:return t;default:switch(t=t&&t.$$typeof,t){case a5:case Eg:case Rg:case Fg:case Lg:case Ng:return t;default:return e}}case Vw:return e}}}mr.ContextConsumer=Eg;mr.ContextProvider=Ng;mr.Element=Aw;mr.ForwardRef=Rg;mr.Fragment=_g;mr.Lazy=Fg;mr.Memo=Lg;mr.Portal=Vw;mr.Profiler=Pg;mr.StrictMode=Bg;mr.Suspense=Mg;mr.SuspenseList=Dg;mr.isAsyncMode=function(){return!1};mr.isConcurrentMode=function(){return!1};mr.isContextConsumer=function(t){return Es(t)===Eg};mr.isContextProvider=function(t){return Es(t)===Ng};mr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Aw};mr.isForwardRef=function(t){return Es(t)===Rg};mr.isFragment=function(t){return Es(t)===_g};mr.isLazy=function(t){return Es(t)===Fg};mr.isMemo=function(t){return Es(t)===Lg};mr.isPortal=function(t){return Es(t)===Vw};mr.isProfiler=function(t){return Es(t)===Pg};mr.isStrictMode=function(t){return Es(t)===Bg};mr.isSuspense=function(t){return Es(t)===Mg};mr.isSuspenseList=function(t){return Es(t)===Dg};mr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===_g||t===Pg||t===Bg||t===Mg||t===Dg||t===o5||typeof t=="object"&&t!==null&&(t.$$typeof===Fg||t.$$typeof===Lg||t.$$typeof===Ng||t.$$typeof===Eg||t.$$typeof===Rg||t.$$typeof===dN||t.getModuleId!==void 0)};mr.typeOf=Es;function hN(t){return Ae}function W0(t,e){return W0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},W0(t,e)}function $w(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,W0(t,e)}function l5(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function c5(t,e){t.classList?t.classList.add(e):l5(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Qk(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function u5(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Qk(t.className,e):t.setAttribute("class",Qk(t.className&&t.className.baseVal||"",e))}const Jk={disabled:!1},Jp=At.createContext(null);var fN=function(e){return e.scrollTop},ud="unmounted",cl="exited",ul="entering",hc="entered",H0="exiting",no=function(t){$w(e,t);function e(i,n){var s;s=t.call(this,i,n)||this;var a=n,o=a&&!a.isMounting?i.enter:i.appear,l;return s.appearStatus=null,i.in?o?(l=cl,s.appearStatus=ul):l=hc:i.unmountOnExit||i.mountOnEnter?l=ud:l=cl,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(n,s){var a=n.in;return a&&s.status===ud?{status:cl}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(n){var s=null;if(n!==this.props){var a=this.state.status;this.props.in?a!==ul&&a!==hc&&(s=ul):(a===ul||a===hc)&&(s=H0)}this.updateStatus(!1,s)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var n=this.props.timeout,s,a,o;return s=a=o=n,n!=null&&typeof n!="number"&&(s=n.exit,a=n.enter,o=n.appear!==void 0?n.appear:a),{exit:s,enter:a,appear:o}},r.updateStatus=function(n,s){if(n===void 0&&(n=!1),s!==null)if(this.cancelNextCallback(),s===ul){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:cd.findDOMNode(this);a&&fN(a)}this.performEnter(n)}else this.performExit();else this.props.unmountOnExit&&this.state.status===cl&&this.setState({status:ud})},r.performEnter=function(n){var s=this,a=this.props.enter,o=this.context?this.context.isMounting:n,l=this.props.nodeRef?[o]:[cd.findDOMNode(this),o],c=l[0],u=l[1],d=this.getTimeouts(),h=o?d.appear:d.enter;if(!n&&!a||Jk.disabled){this.safeSetState({status:hc},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:ul},function(){s.props.onEntering(c,u),s.onTransitionEnd(h,function(){s.safeSetState({status:hc},function(){s.props.onEntered(c,u)})})})},r.performExit=function(){var n=this,s=this.props.exit,a=this.getTimeouts(),o=this.props.nodeRef?void 0:cd.findDOMNode(this);if(!s||Jk.disabled){this.safeSetState({status:cl},function(){n.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:H0},function(){n.props.onExiting(o),n.onTransitionEnd(a.exit,function(){n.safeSetState({status:cl},function(){n.props.onExited(o)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(n,s){s=this.setNextCallback(s),this.setState(n,s)},r.setNextCallback=function(n){var s=this,a=!0;return this.nextCallback=function(o){a&&(a=!1,s.nextCallback=null,n(o))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(n,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:cd.findDOMNode(this),o=n==null&&!this.props.addEndListener;if(!a||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}n!=null&&setTimeout(this.nextCallback,n)},r.render=function(){var n=this.state.status;if(n===ud)return null;var s=this.props,a=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var o=oe(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return At.createElement(Jp.Provider,{value:null},typeof a=="function"?a(n,o):At.cloneElement(At.Children.only(a),o))},e}(At.Component);no.contextType=Jp;no.propTypes={};function oc(){}no.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:oc,onEntering:oc,onEntered:oc,onExit:oc,onExiting:oc,onExited:oc};no.UNMOUNTED=ud;no.EXITED=cl;no.ENTERING=ul;no.ENTERED=hc;no.EXITING=H0;const Ig=no;var d5=function(e,r){return e&&r&&r.split(" ").forEach(function(i){return c5(e,i)})},jy=function(e,r){return e&&r&&r.split(" ").forEach(function(i){return u5(e,i)})},zw=function(t){$w(e,t);function e(){for(var i,n=arguments.length,s=new Array(n),a=0;at.scrollTop;function eu(t,e){var r,i;const{timeout:n,easing:s,style:a={}}=t;return{duration:(r=a.transitionDuration)!=null?r:typeof n=="number"?n:n[e.mode]||0,easing:(i=a.transitionTimingFunction)!=null?i:typeof s=="object"?s[e.mode]:s,delay:a.transitionDelay}}function v5(t){return He("MuiPaper",t)}Ue("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 w5=["className","component","elevation","square","variant"],S5=t=>{const{square:e,elevation:r,variant:i,classes:n}=t,s={root:["root",i,!e&&"rounded",i==="elevation"&&`elevation${r}`]};return $e(s,v5,n)},x5=K("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],!r.square&&e.rounded,r.variant==="elevation"&&e[`elevation${r.elevation}`]]}})(({theme:t,ownerState:e})=>{var r;return S({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&S({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Jt("#fff",Kk(e.elevation))}, ${Jt("#fff",Kk(e.elevation))})`},t.vars&&{backgroundImage:(r=t.vars.overlays)==null?void 0:r[e.elevation]}))}),k5=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPaper"}),{className:n,component:s="div",elevation:a=1,square:o=!1,variant:l="elevation"}=i,c=oe(i,w5),u=S({},i,{component:s,elevation:a,square:o,variant:l}),d=S5(u);return T.jsx(x5,S({as:s,ownerState:u,className:xe(d.root,n),ref:r},c))}),Xl=k5;function Sa(t){return typeof t=="string"}function C5(t,e,r){return t===void 0||Sa(t)?e:S({},e,{ownerState:S({},e.ownerState,r)})}function T5(t,e,r=(i,n)=>i===n){return t.length===e.length&&t.every((i,n)=>r(i,e[n]))}const _5={disableDefaultClasses:!1},B5=w.createContext(_5);function P5(t){const{disableDefaultClasses:e}=w.useContext(B5);return r=>e?"":t(r)}function _d(t,e=[]){if(t===void 0)return{};const r={};return Object.keys(t).filter(i=>i.match(/^on[A-Z]/)&&typeof t[i]=="function"&&!e.includes(i)).forEach(i=>{r[i]=t[i]}),r}function Wh(t,e,r){return typeof t=="function"?t(e,r):t}function Zk(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(r=>!(r.match(/^on[A-Z]/)&&typeof t[r]=="function")).forEach(r=>{e[r]=t[r]}),e}function N5(t){const{getSlotProps:e,additionalProps:r,externalSlotProps:i,externalForwardedProps:n,className:s}=t;if(!e){const p=xe(r==null?void 0:r.className,s,n==null?void 0:n.className,i==null?void 0:i.className),f=S({},r==null?void 0:r.style,n==null?void 0:n.style,i==null?void 0:i.style),m=S({},r,n,i);return p.length>0&&(m.className=p),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:void 0}}const a=_d(S({},n,i)),o=Zk(i),l=Zk(n),c=e(a),u=xe(c==null?void 0:c.className,r==null?void 0:r.className,s,n==null?void 0:n.className,i==null?void 0:i.className),d=S({},c==null?void 0:c.style,r==null?void 0:r.style,n==null?void 0:n.style,i==null?void 0:i.style),h=S({},c,r,l,o);return u.length>0&&(h.className=u),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:c.ref}}const E5=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ct(t){var e;const{elementType:r,externalSlotProps:i,ownerState:n,skipResolvingSlotProps:s=!1}=t,a=oe(t,E5),o=s?{}:Wh(i,n),{props:l,internalRef:c}=N5(S({},a,{externalSlotProps:o})),u=Wt(c,o==null?void 0:o.ref,(e=t.additionalProps)==null?void 0:e.ref);return C5(r,S({},l,{ref:u}),n)}function R5(t){const{className:e,classes:r,pulsate:i=!1,rippleX:n,rippleY:s,rippleSize:a,in:o,onExited:l,timeout:c}=t,[u,d]=w.useState(!1),h=xe(e,r.ripple,r.rippleVisible,i&&r.ripplePulsate),p={width:a,height:a,top:-(a/2)+s,left:-(a/2)+n},f=xe(r.child,u&&r.childLeaving,i&&r.childPulsate);return!o&&!u&&d(!0),w.useEffect(()=>{if(!o&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,o,c]),T.jsx("span",{className:h,style:p,children:T.jsx("span",{className:f})})}const os=Ue("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),M5=["center","classes","className"];let Og=t=>t,e1,t1,r1,i1;const U0=550,D5=80,L5=wu(e1||(e1=Og` + */var Aw=Symbol.for("react.element"),Vw=Symbol.for("react.portal"),_g=Symbol.for("react.fragment"),Bg=Symbol.for("react.strict_mode"),Pg=Symbol.for("react.profiler"),Ng=Symbol.for("react.provider"),Eg=Symbol.for("react.context"),l5=Symbol.for("react.server_context"),Rg=Symbol.for("react.forward_ref"),Mg=Symbol.for("react.suspense"),Dg=Symbol.for("react.suspense_list"),Lg=Symbol.for("react.memo"),Fg=Symbol.for("react.lazy"),c5=Symbol.for("react.offscreen"),dN;dN=Symbol.for("react.module.reference");function Es(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Aw:switch(t=t.type,t){case _g:case Pg:case Bg:case Mg:case Dg:return t;default:switch(t=t&&t.$$typeof,t){case l5:case Eg:case Rg:case Fg:case Lg:case Ng:return t;default:return e}}case Vw:return e}}}mr.ContextConsumer=Eg;mr.ContextProvider=Ng;mr.Element=Aw;mr.ForwardRef=Rg;mr.Fragment=_g;mr.Lazy=Fg;mr.Memo=Lg;mr.Portal=Vw;mr.Profiler=Pg;mr.StrictMode=Bg;mr.Suspense=Mg;mr.SuspenseList=Dg;mr.isAsyncMode=function(){return!1};mr.isConcurrentMode=function(){return!1};mr.isContextConsumer=function(t){return Es(t)===Eg};mr.isContextProvider=function(t){return Es(t)===Ng};mr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Aw};mr.isForwardRef=function(t){return Es(t)===Rg};mr.isFragment=function(t){return Es(t)===_g};mr.isLazy=function(t){return Es(t)===Fg};mr.isMemo=function(t){return Es(t)===Lg};mr.isPortal=function(t){return Es(t)===Vw};mr.isProfiler=function(t){return Es(t)===Pg};mr.isStrictMode=function(t){return Es(t)===Bg};mr.isSuspense=function(t){return Es(t)===Mg};mr.isSuspenseList=function(t){return Es(t)===Dg};mr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===_g||t===Pg||t===Bg||t===Mg||t===Dg||t===c5||typeof t=="object"&&t!==null&&(t.$$typeof===Fg||t.$$typeof===Lg||t.$$typeof===Ng||t.$$typeof===Eg||t.$$typeof===Rg||t.$$typeof===dN||t.getModuleId!==void 0)};mr.typeOf=Es;function hN(t){return Ve}function W0(t,e){return W0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},W0(t,e)}function $w(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,W0(t,e)}function u5(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function d5(t,e){t.classList?t.classList.add(e):u5(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Qk(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function h5(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Qk(t.className,e):t.setAttribute("class",Qk(t.className&&t.className.baseVal||"",e))}const Jk={disabled:!1},Jp=At.createContext(null);var fN=function(e){return e.scrollTop},ud="unmounted",ul="exited",dl="entering",hc="entered",H0="exiting",so=function(t){$w(e,t);function e(i,n){var s;s=t.call(this,i,n)||this;var a=n,o=a&&!a.isMounting?i.enter:i.appear,l;return s.appearStatus=null,i.in?o?(l=ul,s.appearStatus=dl):l=hc:i.unmountOnExit||i.mountOnEnter?l=ud:l=ul,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(n,s){var a=n.in;return a&&s.status===ud?{status:ul}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(n){var s=null;if(n!==this.props){var a=this.state.status;this.props.in?a!==dl&&a!==hc&&(s=dl):(a===dl||a===hc)&&(s=H0)}this.updateStatus(!1,s)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var n=this.props.timeout,s,a,o;return s=a=o=n,n!=null&&typeof n!="number"&&(s=n.exit,a=n.enter,o=n.appear!==void 0?n.appear:a),{exit:s,enter:a,appear:o}},r.updateStatus=function(n,s){if(n===void 0&&(n=!1),s!==null)if(this.cancelNextCallback(),s===dl){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:cd.findDOMNode(this);a&&fN(a)}this.performEnter(n)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ul&&this.setState({status:ud})},r.performEnter=function(n){var s=this,a=this.props.enter,o=this.context?this.context.isMounting:n,l=this.props.nodeRef?[o]:[cd.findDOMNode(this),o],c=l[0],u=l[1],d=this.getTimeouts(),h=o?d.appear:d.enter;if(!n&&!a||Jk.disabled){this.safeSetState({status:hc},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:dl},function(){s.props.onEntering(c,u),s.onTransitionEnd(h,function(){s.safeSetState({status:hc},function(){s.props.onEntered(c,u)})})})},r.performExit=function(){var n=this,s=this.props.exit,a=this.getTimeouts(),o=this.props.nodeRef?void 0:cd.findDOMNode(this);if(!s||Jk.disabled){this.safeSetState({status:ul},function(){n.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:H0},function(){n.props.onExiting(o),n.onTransitionEnd(a.exit,function(){n.safeSetState({status:ul},function(){n.props.onExited(o)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(n,s){s=this.setNextCallback(s),this.setState(n,s)},r.setNextCallback=function(n){var s=this,a=!0;return this.nextCallback=function(o){a&&(a=!1,s.nextCallback=null,n(o))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(n,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:cd.findDOMNode(this),o=n==null&&!this.props.addEndListener;if(!a||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}n!=null&&setTimeout(this.nextCallback,n)},r.render=function(){var n=this.state.status;if(n===ud)return null;var s=this.props,a=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var o=le(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return At.createElement(Jp.Provider,{value:null},typeof a=="function"?a(n,o):At.cloneElement(At.Children.only(a),o))},e}(At.Component);so.contextType=Jp;so.propTypes={};function oc(){}so.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:oc,onEntering:oc,onEntered:oc,onExit:oc,onExiting:oc,onExited:oc};so.UNMOUNTED=ud;so.EXITED=ul;so.ENTERING=dl;so.ENTERED=hc;so.EXITING=H0;const Ig=so;var f5=function(e,r){return e&&r&&r.split(" ").forEach(function(i){return d5(e,i)})},jy=function(e,r){return e&&r&&r.split(" ").forEach(function(i){return h5(e,i)})},zw=function(t){$w(e,t);function e(){for(var i,n=arguments.length,s=new Array(n),a=0;at.scrollTop;function eu(t,e){var r,i;const{timeout:n,easing:s,style:a={}}=t;return{duration:(r=a.transitionDuration)!=null?r:typeof n=="number"?n:n[e.mode]||0,easing:(i=a.transitionTimingFunction)!=null?i:typeof s=="object"?s[e.mode]:s,delay:a.transitionDelay}}function S5(t){return Ue("MuiPaper",t)}Ge("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 x5=["className","component","elevation","square","variant"],k5=t=>{const{square:e,elevation:r,variant:i,classes:n}=t,s={root:["root",i,!e&&"rounded",i==="elevation"&&`elevation${r}`]};return ze(s,S5,n)},C5=K("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],!r.square&&e.rounded,r.variant==="elevation"&&e[`elevation${r.elevation}`]]}})(({theme:t,ownerState:e})=>{var r;return S({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&S({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Jt("#fff",Kk(e.elevation))}, ${Jt("#fff",Kk(e.elevation))})`},t.vars&&{backgroundImage:(r=t.vars.overlays)==null?void 0:r[e.elevation]}))}),T5=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPaper"}),{className:n,component:s="div",elevation:a=1,square:o=!1,variant:l="elevation"}=i,c=le(i,x5),u=S({},i,{component:s,elevation:a,square:o,variant:l}),d=k5(u);return T.jsx(C5,S({as:s,ownerState:u,className:ke(d.root,n),ref:r},c))}),Xl=T5;function Sa(t){return typeof t=="string"}function _5(t,e,r){return t===void 0||Sa(t)?e:S({},e,{ownerState:S({},e.ownerState,r)})}function B5(t,e,r=(i,n)=>i===n){return t.length===e.length&&t.every((i,n)=>r(i,e[n]))}const P5={disableDefaultClasses:!1},N5=w.createContext(P5);function E5(t){const{disableDefaultClasses:e}=w.useContext(N5);return r=>e?"":t(r)}function _d(t,e=[]){if(t===void 0)return{};const r={};return Object.keys(t).filter(i=>i.match(/^on[A-Z]/)&&typeof t[i]=="function"&&!e.includes(i)).forEach(i=>{r[i]=t[i]}),r}function Wh(t,e,r){return typeof t=="function"?t(e,r):t}function Zk(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(r=>!(r.match(/^on[A-Z]/)&&typeof t[r]=="function")).forEach(r=>{e[r]=t[r]}),e}function R5(t){const{getSlotProps:e,additionalProps:r,externalSlotProps:i,externalForwardedProps:n,className:s}=t;if(!e){const p=ke(r==null?void 0:r.className,s,n==null?void 0:n.className,i==null?void 0:i.className),f=S({},r==null?void 0:r.style,n==null?void 0:n.style,i==null?void 0:i.style),m=S({},r,n,i);return p.length>0&&(m.className=p),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:void 0}}const a=_d(S({},n,i)),o=Zk(i),l=Zk(n),c=e(a),u=ke(c==null?void 0:c.className,r==null?void 0:r.className,s,n==null?void 0:n.className,i==null?void 0:i.className),d=S({},c==null?void 0:c.style,r==null?void 0:r.style,n==null?void 0:n.style,i==null?void 0:i.style),h=S({},c,r,l,o);return u.length>0&&(h.className=u),Object.keys(d).length>0&&(h.style=d),{props:h,internalRef:c.ref}}const M5=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ct(t){var e;const{elementType:r,externalSlotProps:i,ownerState:n,skipResolvingSlotProps:s=!1}=t,a=le(t,M5),o=s?{}:Wh(i,n),{props:l,internalRef:c}=R5(S({},a,{externalSlotProps:o})),u=Wt(c,o==null?void 0:o.ref,(e=t.additionalProps)==null?void 0:e.ref);return _5(r,S({},l,{ref:u}),n)}function D5(t){const{className:e,classes:r,pulsate:i=!1,rippleX:n,rippleY:s,rippleSize:a,in:o,onExited:l,timeout:c}=t,[u,d]=w.useState(!1),h=ke(e,r.ripple,r.rippleVisible,i&&r.ripplePulsate),p={width:a,height:a,top:-(a/2)+s,left:-(a/2)+n},f=ke(r.child,u&&r.childLeaving,i&&r.childPulsate);return!o&&!u&&d(!0),w.useEffect(()=>{if(!o&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,o,c]),T.jsx("span",{className:h,style:p,children:T.jsx("span",{className:f})})}const os=Ge("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),L5=["center","classes","className"];let Og=t=>t,e1,t1,r1,i1;const U0=550,F5=80,I5=wu(e1||(e1=Og` 0% { transform: scale(0); opacity: 0.1; @@ -98,7 +98,7 @@ Error generating stack: `+s.message+` transform: scale(1); opacity: 0.3; } -`)),F5=wu(t1||(t1=Og` +`)),O5=wu(t1||(t1=Og` 0% { opacity: 1; } @@ -106,7 +106,7 @@ Error generating stack: `+s.message+` 100% { opacity: 0; } -`)),I5=wu(r1||(r1=Og` +`)),A5=wu(r1||(r1=Og` 0% { transform: scale(1); } @@ -118,7 +118,7 @@ Error generating stack: `+s.message+` 100% { transform: scale(1); } -`)),O5=K("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),A5=K(R5,{name:"MuiTouchRipple",slot:"Ripple"})(i1||(i1=Og` +`)),V5=K("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),$5=K(D5,{name:"MuiTouchRipple",slot:"Ripple"})(i1||(i1=Og` opacity: 0; position: absolute; @@ -161,8 +161,8 @@ Error generating stack: `+s.message+` animation-iteration-count: infinite; animation-delay: 200ms; } -`),os.rippleVisible,L5,U0,({theme:t})=>t.transitions.easing.easeInOut,os.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,os.child,os.childLeaving,F5,U0,({theme:t})=>t.transitions.easing.easeInOut,os.childPulsate,I5,({theme:t})=>t.transitions.easing.easeInOut),V5=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTouchRipple"}),{center:n=!1,classes:s={},className:a}=i,o=oe(i,M5),[l,c]=w.useState([]),u=w.useRef(0),d=w.useRef(null);w.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const h=w.useRef(!1),p=QP(),f=w.useRef(null),m=w.useRef(null),y=w.useCallback(k=>{const{pulsate:C,rippleX:x,rippleY:_,rippleSize:P,cb:R}=k;c(E=>[...E,T.jsx(A5,{classes:{ripple:xe(s.ripple,os.ripple),rippleVisible:xe(s.rippleVisible,os.rippleVisible),ripplePulsate:xe(s.ripplePulsate,os.ripplePulsate),child:xe(s.child,os.child),childLeaving:xe(s.childLeaving,os.childLeaving),childPulsate:xe(s.childPulsate,os.childPulsate)},timeout:U0,pulsate:C,rippleX:x,rippleY:_,rippleSize:P},u.current)]),u.current+=1,d.current=R},[s]),v=w.useCallback((k={},C={},x=()=>{})=>{const{pulsate:_=!1,center:P=n||C.pulsate,fakeElement:R=!1}=C;if((k==null?void 0:k.type)==="mousedown"&&h.current){h.current=!1;return}(k==null?void 0:k.type)==="touchstart"&&(h.current=!0);const E=R?null:m.current,D=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let $,I,F;if(P||k===void 0||k.clientX===0&&k.clientY===0||!k.clientX&&!k.touches)$=Math.round(D.width/2),I=Math.round(D.height/2);else{const{clientX:M,clientY:O}=k.touches&&k.touches.length>0?k.touches[0]:k;$=Math.round(M-D.left),I=Math.round(O-D.top)}if(P)F=Math.sqrt((2*D.width**2+D.height**2)/3),F%2===0&&(F+=1);else{const M=Math.max(Math.abs((E?E.clientWidth:0)-$),$)*2+2,O=Math.max(Math.abs((E?E.clientHeight:0)-I),I)*2+2;F=Math.sqrt(M**2+O**2)}k!=null&&k.touches?f.current===null&&(f.current=()=>{y({pulsate:_,rippleX:$,rippleY:I,rippleSize:F,cb:x})},p.start(D5,()=>{f.current&&(f.current(),f.current=null)})):y({pulsate:_,rippleX:$,rippleY:I,rippleSize:F,cb:x})},[n,y,p]),g=w.useCallback(()=>{v({},{pulsate:!0})},[v]),b=w.useCallback((k,C)=>{if(p.clear(),(k==null?void 0:k.type)==="touchend"&&f.current){f.current(),f.current=null,p.start(0,()=>{b(k,C)});return}f.current=null,c(x=>x.length>0?x.slice(1):x),d.current=C},[p]);return w.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:b}),[g,v,b]),T.jsx(O5,S({className:xe(os.root,s.root,a),ref:m},o,{children:T.jsx(Uw,{component:null,exit:!0,children:l})}))}),$5=V5;function z5(t){return He("MuiButtonBase",t)}const W5=Ue("MuiButtonBase",["root","disabled","focusVisible"]),H5=["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"],U5=t=>{const{disabled:e,focusVisible:r,focusVisibleClassName:i,classes:n}=t,a=$e({root:["root",e&&"disabled",r&&"focusVisible"]},z5,n);return r&&i&&(a.root+=` ${i}`),a},G5=K("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.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"},[`&.${W5.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),j5=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiButtonBase"}),{action:n,centerRipple:s=!1,children:a,className:o,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:h=!1,LinkComponent:p="a",onBlur:f,onClick:m,onContextMenu:y,onDragLeave:v,onFocus:g,onFocusVisible:b,onKeyDown:k,onKeyUp:C,onMouseDown:x,onMouseLeave:_,onMouseUp:P,onTouchEnd:R,onTouchMove:E,onTouchStart:D,tabIndex:$=0,TouchRippleProps:I,touchRippleRef:F,type:M}=i,O=oe(i,H5),A=w.useRef(null),N=w.useRef(null),V=Wt(N,F),{isFocusVisibleRef:W,onFocus:Q,onBlur:ne,ref:ie}=Dw(),[te,j]=w.useState(!1);c&&te&&j(!1),w.useImperativeHandle(n,()=>({focusVisible:()=>{j(!0),A.current.focus()}}),[]);const[J,pe]=w.useState(!1);w.useEffect(()=>{pe(!0)},[]);const fe=J&&!u&&!c;w.useEffect(()=>{te&&h&&!u&&J&&N.current.pulsate()},[u,h,te,J]);function Me(le,Ke,bt=d){return Ye(Tt=>(Ke&&Ke(Tt),!bt&&N.current&&N.current[le](Tt),!0))}const _e=Me("start",x),ke=Me("stop",y),Ce=Me("stop",v),X=Me("stop",P),ee=Me("stop",le=>{te&&le.preventDefault(),_&&_(le)}),Y=Me("start",D),Be=Me("stop",R),ce=Me("stop",E),L=Me("stop",le=>{ne(le),W.current===!1&&j(!1),f&&f(le)},!1),U=Ye(le=>{A.current||(A.current=le.currentTarget),Q(le),W.current===!0&&(j(!0),b&&b(le)),g&&g(le)}),G=()=>{const le=A.current;return l&&l!=="button"&&!(le.tagName==="A"&&le.href)},re=w.useRef(!1),we=Ye(le=>{h&&!re.current&&te&&N.current&&le.key===" "&&(re.current=!0,N.current.stop(le,()=>{N.current.start(le)})),le.target===le.currentTarget&&G()&&le.key===" "&&le.preventDefault(),k&&k(le),le.target===le.currentTarget&&G()&&le.key==="Enter"&&!c&&(le.preventDefault(),m&&m(le))}),me=Ye(le=>{h&&le.key===" "&&N.current&&te&&!le.defaultPrevented&&(re.current=!1,N.current.stop(le,()=>{N.current.pulsate(le)})),C&&C(le),m&&le.target===le.currentTarget&&G()&&le.key===" "&&!le.defaultPrevented&&m(le)});let Ee=l;Ee==="button"&&(O.href||O.to)&&(Ee=p);const qe={};Ee==="button"?(qe.type=M===void 0?"button":M,qe.disabled=c):(!O.href&&!O.to&&(qe.role="button"),c&&(qe["aria-disabled"]=c));const ct=Wt(r,ie,A),Pt=S({},i,{centerRipple:s,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:h,tabIndex:$,focusVisible:te}),be=U5(Pt);return T.jsxs(G5,S({as:Ee,className:xe(be.root,o),ownerState:Pt,onBlur:L,onClick:m,onContextMenu:ke,onFocus:U,onKeyDown:we,onKeyUp:me,onMouseDown:_e,onMouseLeave:ee,onMouseUp:X,onDragLeave:Ce,onTouchEnd:Be,onTouchMove:ce,onTouchStart:Y,ref:ct,tabIndex:c?-1:$,type:M},qe,O,{children:[a,fe?T.jsx($5,S({ref:V,center:s},I)):null]}))}),Cs=j5;function Y5(t){return He("MuiIconButton",t)}const X5=Ue("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),q5=X5,K5=["edge","children","className","color","disabled","disableFocusRipple","size"],Q5=t=>{const{classes:e,disabled:r,color:i,edge:n,size:s}=t,a={root:["root",r&&"disabled",i!=="default"&&`color${Pe(i)}`,n&&`edge${Pe(n)}`,`size${Pe(s)}`]};return $e(a,Y5,e)},J5=K(Cs,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.color!=="default"&&e[`color${Pe(r.color)}`],r.edge&&e[`edge${Pe(r.edge)}`],e[`size${Pe(r.size)}`]]}})(({theme:t,ownerState:e})=>S({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var r;const i=(r=(t.vars||t).palette)==null?void 0:r[e.color];return S({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&S({color:i==null?void 0:i.main},!e.disableRipple&&{"&:hover":S({},i&&{backgroundColor:t.vars?`rgba(${i.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(i.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${q5.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Z5=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiIconButton"}),{edge:n=!1,children:s,className:a,color:o="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=i,d=oe(i,K5),h=S({},i,{edge:n,color:o,disabled:l,disableFocusRipple:c,size:u}),p=Q5(h);return T.jsx(J5,S({className:xe(p.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:r},d,{ownerState:h,children:s}))}),yn=Z5;function e$(t){return He("MuiTypography",t)}Ue("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const t$=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],r$=t=>{const{align:e,gutterBottom:r,noWrap:i,paragraph:n,variant:s,classes:a}=t,o={root:["root",s,t.align!=="inherit"&&`align${Pe(e)}`,r&&"gutterBottom",i&&"noWrap",n&&"paragraph"]};return $e(o,e$,a)},i$=K("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.variant&&e[r.variant],r.align!=="inherit"&&e[`align${Pe(r.align)}`],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>S({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),n1={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},n$={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},s$=t=>n$[t]||t,a$=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTypography"}),n=s$(i.color),s=dg(S({},i,{color:n})),{align:a="inherit",className:o,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=n1}=s,f=oe(s,t$),m=S({},s,{align:a,color:n,className:o,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:h,variantMapping:p}),y=l||(d?"p":p[h]||n1[h])||"span",v=r$(m);return T.jsx(i$,S({as:y,ref:r,ownerState:m,className:xe(v.root,o)},f))}),Mr=a$;function o$(t){return He("MuiAppBar",t)}Ue("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const l$=["className","color","enableColorOnDark","position"],c$=t=>{const{color:e,position:r,classes:i}=t,n={root:["root",`color${Pe(e)}`,`position${Pe(r)}`]};return $e(n,o$,i)},Cf=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,u$=K(Xl,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`position${Pe(r.position)}`],e[`color${Pe(r.color)}`]]}})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return S({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&S({},e.color==="default"&&{backgroundColor:r,color:t.palette.getContrastText(r)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&S({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&S({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:Cf(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:Cf(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:Cf(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:Cf(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),d$=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiAppBar"}),{className:n,color:s="primary",enableColorOnDark:a=!1,position:o="fixed"}=i,l=oe(i,l$),c=S({},i,{color:s,position:o,enableColorOnDark:a}),u=c$(c);return T.jsx(u$,S({square:!0,component:"header",ownerState:c,elevation:4,className:xe(u.root,n,o==="fixed"&&"mui-fixed"),ref:r},l))}),h$=d$,pN="base";function f$(t){return`${pN}--${t}`}function p$(t,e){return`${pN}-${t}-${e}`}function mN(t,e){const r=WP[e];return r?f$(r):p$(t,e)}function m$(t,e){const r={};return e.forEach(i=>{r[i]=mN(t,i)}),r}const g$=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function y$(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function b$(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=i=>t.ownerDocument.querySelector(`input[type="radio"]${i}`);let r=e(`[name="${t.name}"]:checked`);return r||(r=e(`[name="${t.name}"]`)),r!==t}function v$(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||b$(t))}function w$(t){const e=[],r=[];return Array.from(t.querySelectorAll(g$)).forEach((i,n)=>{const s=y$(i);s===-1||!v$(i)||(s===0?e.push(i):r.push({documentOrder:n,tabIndex:s,node:i}))}),r.sort((i,n)=>i.tabIndex===n.tabIndex?i.documentOrder-n.documentOrder:i.tabIndex-n.tabIndex).map(i=>i.node).concat(e)}function S$(){return!0}function gN(t){const{children:e,disableAutoFocus:r=!1,disableEnforceFocus:i=!1,disableRestoreFocus:n=!1,getTabbable:s=w$,isEnabled:a=S$,open:o}=t,l=w.useRef(!1),c=w.useRef(null),u=w.useRef(null),d=w.useRef(null),h=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),m=Wt(e.ref,f),y=w.useRef(null);w.useEffect(()=>{!o||!f.current||(p.current=!r)},[r,o]),w.useEffect(()=>{if(!o||!f.current)return;const b=Xr(f.current);return f.current.contains(b.activeElement)||(f.current.hasAttribute("tabIndex")||f.current.setAttribute("tabIndex","-1"),p.current&&f.current.focus()),()=>{n||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[o]),w.useEffect(()=>{if(!o||!f.current)return;const b=Xr(f.current),k=_=>{y.current=_,!(i||!a()||_.key!=="Tab")&&b.activeElement===f.current&&_.shiftKey&&(l.current=!0,u.current&&u.current.focus())},C=()=>{const _=f.current;if(_===null)return;if(!b.hasFocus()||!a()||l.current){l.current=!1;return}if(_.contains(b.activeElement)||i&&b.activeElement!==c.current&&b.activeElement!==u.current)return;if(b.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let P=[];if((b.activeElement===c.current||b.activeElement===u.current)&&(P=s(f.current)),P.length>0){var R,E;const D=!!((R=y.current)!=null&&R.shiftKey&&((E=y.current)==null?void 0:E.key)==="Tab"),$=P[0],I=P[P.length-1];typeof $!="string"&&typeof I!="string"&&(D?I.focus():$.focus())}else _.focus()};b.addEventListener("focusin",C),b.addEventListener("keydown",k,!0);const x=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&C()},50);return()=>{clearInterval(x),b.removeEventListener("focusin",C),b.removeEventListener("keydown",k,!0)}},[r,i,n,a,o,s]);const v=b=>{d.current===null&&(d.current=b.relatedTarget),p.current=!0,h.current=b.target;const k=e.props.onFocus;k&&k(b)},g=b=>{d.current===null&&(d.current=b.relatedTarget),p.current=!0};return T.jsxs(w.Fragment,{children:[T.jsx("div",{tabIndex:o?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),w.cloneElement(e,{ref:m,onFocus:v}),T.jsx("div",{tabIndex:o?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}function x$(t){return typeof t=="function"?t():t}const yN=w.forwardRef(function(e,r){const{children:i,container:n,disablePortal:s=!1}=e,[a,o]=w.useState(null),l=Wt(w.isValidElement(i)?i.ref:null,r);if(zr(()=>{s||o(x$(n)||document.body)},[n,s]),zr(()=>{if(a&&!s)return A0(r,a),()=>{A0(r,null)}},[r,a,s]),s){if(w.isValidElement(i)){const c={ref:l};return w.cloneElement(i,c)}return T.jsx(w.Fragment,{children:i})}return T.jsx(w.Fragment,{children:a&&Vm.createPortal(i,a)})});function k$(t){const e=Xr(t);return e.body===t?ea(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Bd(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function s1(t){return parseInt(ea(t).getComputedStyle(t).paddingRight,10)||0}function C$(t){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,i=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return r||i}function a1(t,e,r,i,n){const s=[e,r,...i];[].forEach.call(t.children,a=>{const o=s.indexOf(a)===-1,l=!C$(a);o&&l&&Bd(a,n)})}function Yy(t,e){let r=-1;return t.some((i,n)=>e(i)?(r=n,!0):!1),r}function T$(t,e){const r=[],i=t.container;if(!e.disableScrollLock){if(k$(i)){const a=JP(Xr(i));r.push({value:i.style.paddingRight,property:"padding-right",el:i}),i.style.paddingRight=`${s1(i)+a}px`;const o=Xr(i).querySelectorAll(".mui-fixed");[].forEach.call(o,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${s1(l)+a}px`})}let s;if(i.parentNode instanceof DocumentFragment)s=Xr(i).body;else{const a=i.parentElement,o=ea(i);s=(a==null?void 0:a.nodeName)==="HTML"&&o.getComputedStyle(a).overflowY==="scroll"?a:i}r.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{r.forEach(({value:s,el:a,property:o})=>{s?a.style.setProperty(o,s):a.style.removeProperty(o)})}}function _$(t){const e=[];return[].forEach.call(t.children,r=>{r.getAttribute("aria-hidden")==="true"&&e.push(r)}),e}class B${constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,r){let i=this.modals.indexOf(e);if(i!==-1)return i;i=this.modals.length,this.modals.push(e),e.modalRef&&Bd(e.modalRef,!1);const n=_$(r);a1(r,e.mount,e.modalRef,n,!0);const s=Yy(this.containers,a=>a.container===r);return s!==-1?(this.containers[s].modals.push(e),i):(this.containers.push({modals:[e],container:r,restore:null,hiddenSiblings:n}),i)}mount(e,r){const i=Yy(this.containers,s=>s.modals.indexOf(e)!==-1),n=this.containers[i];n.restore||(n.restore=T$(n,r))}remove(e,r=!0){const i=this.modals.indexOf(e);if(i===-1)return i;const n=Yy(this.containers,a=>a.modals.indexOf(e)!==-1),s=this.containers[n];if(s.modals.splice(s.modals.indexOf(e),1),this.modals.splice(i,1),s.modals.length===0)s.restore&&s.restore(),e.modalRef&&Bd(e.modalRef,r),a1(s.container,e.mount,e.modalRef,s.hiddenSiblings,!1),this.containers.splice(n,1);else{const a=s.modals[s.modals.length-1];a.modalRef&&Bd(a.modalRef,!1)}return i}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function P$(t){return typeof t=="function"?t():t}function N$(t){return t?t.props.hasOwnProperty("in"):!1}const E$=new B$;function R$(t){const{container:e,disableEscapeKeyDown:r=!1,disableScrollLock:i=!1,manager:n=E$,closeAfterTransition:s=!1,onTransitionEnter:a,onTransitionExited:o,children:l,onClose:c,open:u,rootRef:d}=t,h=w.useRef({}),p=w.useRef(null),f=w.useRef(null),m=Wt(f,d),[y,v]=w.useState(!u),g=N$(l);let b=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(b=!1);const k=()=>Xr(p.current),C=()=>(h.current.modalRef=f.current,h.current.mount=p.current,h.current),x=()=>{n.mount(C(),{disableScrollLock:i}),f.current&&(f.current.scrollTop=0)},_=Ye(()=>{const O=P$(e)||k().body;n.add(C(),O),f.current&&x()}),P=w.useCallback(()=>n.isTopModal(C()),[n]),R=Ye(O=>{p.current=O,O&&(u&&P()?x():f.current&&Bd(f.current,b))}),E=w.useCallback(()=>{n.remove(C(),b)},[b,n]);w.useEffect(()=>()=>{E()},[E]),w.useEffect(()=>{u?_():(!g||!s)&&E()},[u,E,g,s,_]);const D=O=>A=>{var N;(N=O.onKeyDown)==null||N.call(O,A),!(A.key!=="Escape"||A.which===229||!P())&&(r||(A.stopPropagation(),c&&c(A,"escapeKeyDown")))},$=O=>A=>{var N;(N=O.onClick)==null||N.call(O,A),A.target===A.currentTarget&&c&&c(A,"backdropClick")};return{getRootProps:(O={})=>{const A=_d(t);delete A.onTransitionEnter,delete A.onTransitionExited;const N=S({},A,O);return S({role:"presentation"},N,{onKeyDown:D(N),ref:m})},getBackdropProps:(O={})=>{const A=O;return S({"aria-hidden":!0},A,{onClick:$(A),open:u})},getTransitionProps:()=>{const O=()=>{v(!1),a&&a()},A=()=>{v(!0),o&&o(),s&&E()};return{onEnter:Ak(O,l==null?void 0:l.props.onEnter),onExited:Ak(A,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:R,isTopModal:P,exited:y,hasTransition:g}}var Mn="top",Ts="bottom",_s="right",Dn="left",jw="auto",Hh=[Mn,Ts,_s,Dn],tu="start",ah="end",M$="clippingParents",bN="viewport",ju="popper",D$="reference",o1=Hh.reduce(function(t,e){return t.concat([e+"-"+tu,e+"-"+ah])},[]),vN=[].concat(Hh,[jw]).reduce(function(t,e){return t.concat([e,e+"-"+tu,e+"-"+ah])},[]),L$="beforeRead",F$="read",I$="afterRead",O$="beforeMain",A$="main",V$="afterMain",$$="beforeWrite",z$="write",W$="afterWrite",H$=[L$,F$,I$,O$,A$,V$,$$,z$,W$];function Ta(t){return t?(t.nodeName||"").toLowerCase():null}function Qn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vl(t){var e=Qn(t).Element;return t instanceof e||t instanceof Element}function vs(t){var e=Qn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Yw(t){if(typeof ShadowRoot>"u")return!1;var e=Qn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function U$(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var i=e.styles[r]||{},n=e.attributes[r]||{},s=e.elements[r];!vs(s)||!Ta(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(a){var o=n[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function G$(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(i){var n=e.elements[i],s=e.attributes[i]||{},a=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:r[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!vs(n)||!Ta(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const j$={name:"applyStyles",enabled:!0,phase:"write",fn:U$,effect:G$,requires:["computeStyles"]};function xa(t){return t.split("-")[0]}var Bl=Math.max,Zp=Math.min,ru=Math.round;function G0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function wN(){return!/^((?!chrome|android).)*safari/i.test(G0())}function iu(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var i=t.getBoundingClientRect(),n=1,s=1;e&&vs(t)&&(n=t.offsetWidth>0&&ru(i.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ru(i.height)/t.offsetHeight||1);var a=Vl(t)?Qn(t):window,o=a.visualViewport,l=!wN()&&r,c=(i.left+(l&&o?o.offsetLeft:0))/n,u=(i.top+(l&&o?o.offsetTop:0))/s,d=i.width/n,h=i.height/s;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function Xw(t){var e=iu(t),r=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function SN(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Yw(r)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ja(t){return Qn(t).getComputedStyle(t)}function Y$(t){return["table","td","th"].indexOf(Ta(t))>=0}function Ko(t){return((Vl(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ag(t){return Ta(t)==="html"?t:t.assignedSlot||t.parentNode||(Yw(t)?t.host:null)||Ko(t)}function l1(t){return!vs(t)||Ja(t).position==="fixed"?null:t.offsetParent}function X$(t){var e=/firefox/i.test(G0()),r=/Trident/i.test(G0());if(r&&vs(t)){var i=Ja(t);if(i.position==="fixed")return null}var n=Ag(t);for(Yw(n)&&(n=n.host);vs(n)&&["html","body"].indexOf(Ta(n))<0;){var s=Ja(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Uh(t){for(var e=Qn(t),r=l1(t);r&&Y$(r)&&Ja(r).position==="static";)r=l1(r);return r&&(Ta(r)==="html"||Ta(r)==="body"&&Ja(r).position==="static")?e:r||X$(t)||e}function qw(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Pd(t,e,r){return Bl(t,Zp(e,r))}function q$(t,e,r){var i=Pd(t,e,r);return i>r?r:i}function xN(){return{top:0,right:0,bottom:0,left:0}}function kN(t){return Object.assign({},xN(),t)}function CN(t,e){return e.reduce(function(r,i){return r[i]=t,r},{})}var K$=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,kN(typeof e!="number"?e:CN(e,Hh))};function Q$(t){var e,r=t.state,i=t.name,n=t.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=xa(r.placement),l=qw(o),c=[Dn,_s].indexOf(o)>=0,u=c?"height":"width";if(!(!s||!a)){var d=K$(n.padding,r),h=Xw(s),p=l==="y"?Mn:Dn,f=l==="y"?Ts:_s,m=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],y=a[l]-r.rects.reference[l],v=Uh(s),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,b=m/2-y/2,k=d[p],C=g-h[u]-d[f],x=g/2-h[u]/2+b,_=Pd(k,x,C),P=l;r.modifiersData[i]=(e={},e[P]=_,e.centerOffset=_-x,e)}}function J$(t){var e=t.state,r=t.options,i=r.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||SN(e.elements.popper,n)&&(e.elements.arrow=n))}const Z$={name:"arrow",enabled:!0,phase:"main",fn:Q$,effect:J$,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function nu(t){return t.split("-")[1]}var e4={top:"auto",right:"auto",bottom:"auto",left:"auto"};function t4(t,e){var r=t.x,i=t.y,n=e.devicePixelRatio||1;return{x:ru(r*n)/n||0,y:ru(i*n)/n||0}}function c1(t){var e,r=t.popper,i=t.popperRect,n=t.placement,s=t.variation,a=t.offsets,o=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=a.x,p=h===void 0?0:h,f=a.y,m=f===void 0?0:f,y=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var v=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=Dn,k=Mn,C=window;if(c){var x=Uh(r),_="clientHeight",P="clientWidth";if(x===Qn(r)&&(x=Ko(r),Ja(x).position!=="static"&&o==="absolute"&&(_="scrollHeight",P="scrollWidth")),x=x,n===Mn||(n===Dn||n===_s)&&s===ah){k=Ts;var R=d&&x===C&&C.visualViewport?C.visualViewport.height:x[_];m-=R-i.height,m*=l?1:-1}if(n===Dn||(n===Mn||n===Ts)&&s===ah){b=_s;var E=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];p-=E-i.width,p*=l?1:-1}}var D=Object.assign({position:o},c&&e4),$=u===!0?t4({x:p,y:m},Qn(r)):{x:p,y:m};if(p=$.x,m=$.y,l){var I;return Object.assign({},D,(I={},I[k]=g?"0":"",I[b]=v?"0":"",I.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},D,(e={},e[k]=g?m+"px":"",e[b]=v?p+"px":"",e.transform="",e))}function r4(t){var e=t.state,r=t.options,i=r.gpuAcceleration,n=i===void 0?!0:i,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,l=o===void 0?!0:o,c={placement:xa(e.placement),variation:nu(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,c1(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,c1(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const i4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:r4,data:{}};var Tf={passive:!0};function n4(t){var e=t.state,r=t.instance,i=t.options,n=i.scroll,s=n===void 0?!0:n,a=i.resize,o=a===void 0?!0:a,l=Qn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",r.update,Tf)}),o&&l.addEventListener("resize",r.update,Tf),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Tf)}),o&&l.removeEventListener("resize",r.update,Tf)}}const s4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:n4,data:{}};var a4={left:"right",right:"left",bottom:"top",top:"bottom"};function gp(t){return t.replace(/left|right|bottom|top/g,function(e){return a4[e]})}var o4={start:"end",end:"start"};function u1(t){return t.replace(/start|end/g,function(e){return o4[e]})}function Kw(t){var e=Qn(t),r=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:r,scrollTop:i}}function Qw(t){return iu(Ko(t)).left+Kw(t).scrollLeft}function l4(t,e){var r=Qn(t),i=Ko(t),n=r.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(n){s=n.width,a=n.height;var c=wN();(c||!c&&e==="fixed")&&(o=n.offsetLeft,l=n.offsetTop)}return{width:s,height:a,x:o+Qw(t),y:l}}function c4(t){var e,r=Ko(t),i=Kw(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=Bl(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Bl(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-i.scrollLeft+Qw(t),l=-i.scrollTop;return Ja(n||r).direction==="rtl"&&(o+=Bl(r.clientWidth,n?n.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function Jw(t){var e=Ja(t),r=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+i)}function TN(t){return["html","body","#document"].indexOf(Ta(t))>=0?t.ownerDocument.body:vs(t)&&Jw(t)?t:TN(Ag(t))}function Nd(t,e){var r;e===void 0&&(e=[]);var i=TN(t),n=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qn(i),a=n?[s].concat(s.visualViewport||[],Jw(i)?i:[]):i,o=e.concat(a);return n?o:o.concat(Nd(Ag(a)))}function j0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function u4(t,e){var r=iu(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function d1(t,e,r){return e===bN?j0(l4(t,r)):Vl(e)?u4(e,r):j0(c4(Ko(t)))}function d4(t){var e=Nd(Ag(t)),r=["absolute","fixed"].indexOf(Ja(t).position)>=0,i=r&&vs(t)?Uh(t):t;return Vl(i)?e.filter(function(n){return Vl(n)&&SN(n,i)&&Ta(n)!=="body"}):[]}function h4(t,e,r,i){var n=e==="clippingParents"?d4(t):[].concat(e),s=[].concat(n,[r]),a=s[0],o=s.reduce(function(l,c){var u=d1(t,c,i);return l.top=Bl(u.top,l.top),l.right=Zp(u.right,l.right),l.bottom=Zp(u.bottom,l.bottom),l.left=Bl(u.left,l.left),l},d1(t,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function _N(t){var e=t.reference,r=t.element,i=t.placement,n=i?xa(i):null,s=i?nu(i):null,a=e.x+e.width/2-r.width/2,o=e.y+e.height/2-r.height/2,l;switch(n){case Mn:l={x:a,y:e.y-r.height};break;case Ts:l={x:a,y:e.y+e.height};break;case _s:l={x:e.x+e.width,y:o};break;case Dn:l={x:e.x-r.width,y:o};break;default:l={x:e.x,y:e.y}}var c=n?qw(n):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case tu:l[c]=l[c]-(e[u]/2-r[u]/2);break;case ah:l[c]=l[c]+(e[u]/2-r[u]/2);break}}return l}function oh(t,e){e===void 0&&(e={});var r=e,i=r.placement,n=i===void 0?t.placement:i,s=r.strategy,a=s===void 0?t.strategy:s,o=r.boundary,l=o===void 0?M$:o,c=r.rootBoundary,u=c===void 0?bN:c,d=r.elementContext,h=d===void 0?ju:d,p=r.altBoundary,f=p===void 0?!1:p,m=r.padding,y=m===void 0?0:m,v=kN(typeof y!="number"?y:CN(y,Hh)),g=h===ju?D$:ju,b=t.rects.popper,k=t.elements[f?g:h],C=h4(Vl(k)?k:k.contextElement||Ko(t.elements.popper),l,u,a),x=iu(t.elements.reference),_=_N({reference:x,element:b,strategy:"absolute",placement:n}),P=j0(Object.assign({},b,_)),R=h===ju?P:x,E={top:C.top-R.top+v.top,bottom:R.bottom-C.bottom+v.bottom,left:C.left-R.left+v.left,right:R.right-C.right+v.right},D=t.modifiersData.offset;if(h===ju&&D){var $=D[n];Object.keys(E).forEach(function(I){var F=[_s,Ts].indexOf(I)>=0?1:-1,M=[Mn,Ts].indexOf(I)>=0?"y":"x";E[I]+=$[M]*F})}return E}function f4(t,e){e===void 0&&(e={});var r=e,i=r.placement,n=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?vN:l,u=nu(i),d=u?o?o1:o1.filter(function(f){return nu(f)===u}):Hh,h=d.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=oh(t,{placement:m,boundary:n,rootBoundary:s,padding:a})[xa(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function p4(t){if(xa(t)===jw)return[];var e=gp(t);return[u1(t),e,u1(e)]}function m4(t){var e=t.state,r=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var n=r.mainAxis,s=n===void 0?!0:n,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,f=p===void 0?!0:p,m=r.allowedAutoPlacements,y=e.options.placement,v=xa(y),g=v===y,b=l||(g||!f?[gp(y)]:p4(y)),k=[y].concat(b).reduce(function(te,j){return te.concat(xa(j)===jw?f4(e,{placement:j,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):j)},[]),C=e.rects.reference,x=e.rects.popper,_=new Map,P=!0,R=k[0],E=0;E=0,M=F?"width":"height",O=oh(e,{placement:D,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),A=F?I?_s:Dn:I?Ts:Mn;C[M]>x[M]&&(A=gp(A));var N=gp(A),V=[];if(s&&V.push(O[$]<=0),o&&V.push(O[A]<=0,O[N]<=0),V.every(function(te){return te})){R=D,P=!1;break}_.set(D,V)}if(P)for(var W=f?3:1,Q=function(j){var J=k.find(function(pe){var fe=_.get(pe);if(fe)return fe.slice(0,j).every(function(Me){return Me})});if(J)return R=J,"break"},ne=W;ne>0;ne--){var ie=Q(ne);if(ie==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}const g4={name:"flip",enabled:!0,phase:"main",fn:m4,requiresIfExists:["offset"],data:{_skip:!1}};function h1(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function f1(t){return[Mn,_s,Ts,Dn].some(function(e){return t[e]>=0})}function y4(t){var e=t.state,r=t.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,a=oh(e,{elementContext:"reference"}),o=oh(e,{altBoundary:!0}),l=h1(a,i),c=h1(o,n,s),u=f1(l),d=f1(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const b4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:y4};function v4(t,e,r){var i=xa(t),n=[Dn,Mn].indexOf(i)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*n,[Dn,_s].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function w4(t){var e=t.state,r=t.options,i=t.name,n=r.offset,s=n===void 0?[0,0]:n,a=vN.reduce(function(u,d){return u[d]=v4(d,e.rects,s),u},{}),o=a[e.placement],l=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}const S4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:w4};function x4(t){var e=t.state,r=t.name;e.modifiersData[r]=_N({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const k4={name:"popperOffsets",enabled:!0,phase:"read",fn:x4,data:{}};function C4(t){return t==="x"?"y":"x"}function T4(t){var e=t.state,r=t.options,i=t.name,n=r.mainAxis,s=n===void 0?!0:n,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,h=r.tether,p=h===void 0?!0:h,f=r.tetherOffset,m=f===void 0?0:f,y=oh(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=xa(e.placement),g=nu(e.placement),b=!g,k=qw(v),C=C4(k),x=e.modifiersData.popperOffsets,_=e.rects.reference,P=e.rects.popper,R=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,E=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(x){if(s){var I,F=k==="y"?Mn:Dn,M=k==="y"?Ts:_s,O=k==="y"?"height":"width",A=x[k],N=A+y[F],V=A-y[M],W=p?-P[O]/2:0,Q=g===tu?_[O]:P[O],ne=g===tu?-P[O]:-_[O],ie=e.elements.arrow,te=p&&ie?Xw(ie):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xN(),J=j[F],pe=j[M],fe=Pd(0,_[O],te[O]),Me=b?_[O]/2-W-fe-J-E.mainAxis:Q-fe-J-E.mainAxis,_e=b?-_[O]/2+W+fe+pe+E.mainAxis:ne+fe+pe+E.mainAxis,ke=e.elements.arrow&&Uh(e.elements.arrow),Ce=ke?k==="y"?ke.clientTop||0:ke.clientLeft||0:0,X=(I=D==null?void 0:D[k])!=null?I:0,ee=A+Me-X-Ce,Y=A+_e-X,Be=Pd(p?Zp(N,ee):N,A,p?Bl(V,Y):V);x[k]=Be,$[k]=Be-A}if(o){var ce,L=k==="x"?Mn:Dn,U=k==="x"?Ts:_s,G=x[C],re=C==="y"?"height":"width",we=G+y[L],me=G-y[U],Ee=[Mn,Dn].indexOf(v)!==-1,qe=(ce=D==null?void 0:D[C])!=null?ce:0,ct=Ee?we:G-_[re]-P[re]-qe+E.altAxis,Pt=Ee?G+_[re]+P[re]-qe-E.altAxis:me,be=p&&Ee?q$(ct,G,Pt):Pd(p?ct:we,G,p?Pt:me);x[C]=be,$[C]=be-G}e.modifiersData[i]=$}}const _4={name:"preventOverflow",enabled:!0,phase:"main",fn:T4,requiresIfExists:["offset"]};function B4(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function P4(t){return t===Qn(t)||!vs(t)?Kw(t):B4(t)}function N4(t){var e=t.getBoundingClientRect(),r=ru(e.width)/t.offsetWidth||1,i=ru(e.height)/t.offsetHeight||1;return r!==1||i!==1}function E4(t,e,r){r===void 0&&(r=!1);var i=vs(e),n=vs(e)&&N4(e),s=Ko(e),a=iu(t,n,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!r)&&((Ta(e)!=="body"||Jw(s))&&(o=P4(e)),vs(e)?(l=iu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Qw(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function R4(t){var e=new Map,r=new Set,i=[];t.forEach(function(s){e.set(s.name,s)});function n(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=e.get(o);l&&n(l)}}),i.push(s)}return t.forEach(function(s){r.has(s.name)||n(s)}),i}function M4(t){var e=R4(t);return H$.reduce(function(r,i){return r.concat(e.filter(function(n){return n.phase===i}))},[])}function D4(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function L4(t){var e=t.reduce(function(r,i){var n=r[i.name];return r[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,r},{});return Object.keys(e).map(function(r){return e[r]})}var p1={placement:"bottom",modifiers:[],strategy:"absolute"};function m1(){for(var t=arguments.length,e=new Array(t),r=0;r$e({root:["root"]},P5(A4)),U4={},G4=w.forwardRef(function(e,r){var i;const{anchorEl:n,children:s,direction:a,disablePortal:o,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:h,slotProps:p={},slots:f={},TransitionProps:m}=e,y=oe(e,V4),v=w.useRef(null),g=Wt(v,r),b=w.useRef(null),k=Wt(b,h),C=w.useRef(k);zr(()=>{C.current=k},[k]),w.useImperativeHandle(h,()=>b.current,[]);const x=z4(u,a),[_,P]=w.useState(x),[R,E]=w.useState(Y0(n));w.useEffect(()=>{b.current&&b.current.forceUpdate()}),w.useEffect(()=>{n&&E(Y0(n))},[n]),zr(()=>{if(!R||!c)return;const M=N=>{P(N.placement)};let O=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:N})=>{M(N)}}];l!=null&&(O=O.concat(l)),d&&d.modifiers!=null&&(O=O.concat(d.modifiers));const A=O4(R,v.current,S({placement:x},d,{modifiers:O}));return C.current(A),()=>{A.destroy(),C.current(null)}},[R,o,l,c,d,x]);const D={placement:_};m!==null&&(D.TransitionProps=m);const $=H4(),I=(i=f.root)!=null?i:"div",F=Ct({elementType:I,externalSlotProps:p.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:g},ownerState:e,className:$.root});return T.jsx(I,S({},F,{children:typeof s=="function"?s(D):s}))}),j4=w.forwardRef(function(e,r){const{anchorEl:i,children:n,container:s,direction:a="ltr",disablePortal:o=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:h=U4,popperRef:p,style:f,transition:m=!1,slotProps:y={},slots:v={}}=e,g=oe(e,$4),[b,k]=w.useState(!0),C=()=>{k(!1)},x=()=>{k(!0)};if(!l&&!u&&(!m||b))return null;let _;if(s)_=s;else if(i){const E=Y0(i);_=E&&W4(E)?Xr(E).body:Xr(null).body}const P=!u&&l&&(!m||b)?"none":void 0,R=m?{in:u,onEnter:C,onExited:x}:void 0;return T.jsx(yN,{disablePortal:o,container:_,children:T.jsx(G4,S({anchorEl:i,direction:a,disablePortal:o,modifiers:c,ref:r,open:m?!b:u,placement:d,popperOptions:h,popperRef:p,slotProps:y,slots:v},g,{style:S({position:"fixed",top:0,left:0,display:P},f),TransitionProps:R,children:n}))})}),Y4=2;function PN(t,e){return t-e}function g1(t,e){var r;const{index:i}=(r=t.reduce((n,s,a)=>{const o=Math.abs(e-s);return n===null||o({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},J4=t=>t;let Nf;function b1(){return Nf===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Nf=CSS.supports("touch-action","none"):Nf=!0),Nf}function Z4(t){const{"aria-labelledby":e,defaultValue:r,disabled:i=!1,disableSwap:n=!1,isRtl:s=!1,marks:a=!1,max:o=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:p,scale:f=J4,step:m=1,shiftStep:y=10,tabIndex:v,value:g}=t,b=w.useRef(),[k,C]=w.useState(-1),[x,_]=w.useState(-1),[P,R]=w.useState(!1),E=w.useRef(0),[D,$]=xs({controlled:g,default:r??l,name:"Slider"}),I=u&&((be,le,Ke)=>{const bt=be.nativeEvent||be,Tt=new bt.constructor(bt.type,bt);Object.defineProperty(Tt,"target",{writable:!0,value:{value:le,name:c}}),u(Tt,le,Ke)}),F=Array.isArray(D);let M=F?D.slice().sort(PN):[D];M=M.map(be=>be==null?l:So(be,l,o));const O=a===!0&&m!==null?[...Array(Math.floor((o-l)/m)+1)].map((be,le)=>({value:l+m*le})):a||[],A=O.map(be=>be.value),{isFocusVisibleRef:N,onBlur:V,onFocus:W,ref:Q}=Dw(),[ne,ie]=w.useState(-1),te=w.useRef(),j=Wt(Q,te),J=Wt(p,j),pe=be=>le=>{var Ke;const bt=Number(le.currentTarget.getAttribute("data-index"));W(le),N.current===!0&&ie(bt),_(bt),be==null||(Ke=be.onFocus)==null||Ke.call(be,le)},fe=be=>le=>{var Ke;V(le),N.current===!1&&ie(-1),_(-1),be==null||(Ke=be.onBlur)==null||Ke.call(be,le)},Me=(be,le)=>{const Ke=Number(be.currentTarget.getAttribute("data-index")),bt=M[Ke],Tt=A.indexOf(bt);let Fe=le;if(O&&m==null){const xt=A[A.length-1];Fe>xt?Fe=xt:Fele=>{var Ke;if(m!==null){const bt=Number(le.currentTarget.getAttribute("data-index")),Tt=M[bt];let Fe=null;(le.key==="ArrowLeft"||le.key==="ArrowDown")&&le.shiftKey||le.key==="PageDown"?Fe=Math.max(Tt-y,l):((le.key==="ArrowRight"||le.key==="ArrowUp")&&le.shiftKey||le.key==="PageUp")&&(Fe=Math.min(Tt+y,o)),Fe!==null&&(Me(le,Fe),le.preventDefault())}be==null||(Ke=be.onKeyDown)==null||Ke.call(be,le)};zr(()=>{if(i&&te.current.contains(document.activeElement)){var be;(be=document.activeElement)==null||be.blur()}},[i]),i&&k!==-1&&C(-1),i&&ne!==-1&&ie(-1);const ke=be=>le=>{var Ke;(Ke=be.onChange)==null||Ke.call(be,le),Me(le,le.target.valueAsNumber)},Ce=w.useRef();let X=h;s&&h==="horizontal"&&(X+="-reverse");const ee=({finger:be,move:le=!1})=>{const{current:Ke}=te,{width:bt,height:Tt,bottom:Fe,left:xt}=Ke.getBoundingClientRect();let De;X.indexOf("vertical")===0?De=(Fe-be.y)/Tt:De=(be.x-xt)/bt,X.indexOf("-reverse")!==-1&&(De=1-De);let Ie;if(Ie=X4(De,l,o),m)Ie=K4(Ie,m,l);else{const nt=g1(A,Ie);Ie=A[nt]}Ie=So(Ie,l,o);let wt=0;if(F){le?wt=Ce.current:wt=g1(M,Ie),n&&(Ie=So(Ie,M[wt-1]||-1/0,M[wt+1]||1/0));const nt=Ie;Ie=y1({values:M,newValue:Ie,index:wt}),n&&le||(wt=Ie.indexOf(nt),Ce.current=wt)}return{newValue:Ie,activeIndex:wt}},Y=Ye(be=>{const le=_f(be,b);if(!le)return;if(E.current+=1,be.type==="mousemove"&&be.buttons===0){Be(be);return}const{newValue:Ke,activeIndex:bt}=ee({finger:le,move:!0});Bf({sliderRef:te,activeIndex:bt,setActive:C}),$(Ke),!P&&E.current>Y4&&R(!0),I&&!Pf(Ke,D)&&I(be,Ke,bt)}),Be=Ye(be=>{const le=_f(be,b);if(R(!1),!le)return;const{newValue:Ke}=ee({finger:le,move:!0});C(-1),be.type==="touchend"&&_(-1),d&&d(be,Ke),b.current=void 0,L()}),ce=Ye(be=>{if(i)return;b1()||be.preventDefault();const le=be.changedTouches[0];le!=null&&(b.current=le.identifier);const Ke=_f(be,b);if(Ke!==!1){const{newValue:Tt,activeIndex:Fe}=ee({finger:Ke});Bf({sliderRef:te,activeIndex:Fe,setActive:C}),$(Tt),I&&!Pf(Tt,D)&&I(be,Tt,Fe)}E.current=0;const bt=Xr(te.current);bt.addEventListener("touchmove",Y,{passive:!0}),bt.addEventListener("touchend",Be,{passive:!0})}),L=w.useCallback(()=>{const be=Xr(te.current);be.removeEventListener("mousemove",Y),be.removeEventListener("mouseup",Be),be.removeEventListener("touchmove",Y),be.removeEventListener("touchend",Be)},[Be,Y]);w.useEffect(()=>{const{current:be}=te;return be.addEventListener("touchstart",ce,{passive:b1()}),()=>{be.removeEventListener("touchstart",ce),L()}},[L,ce]),w.useEffect(()=>{i&&L()},[i,L]);const U=be=>le=>{var Ke;if((Ke=be.onMouseDown)==null||Ke.call(be,le),i||le.defaultPrevented||le.button!==0)return;le.preventDefault();const bt=_f(le,b);if(bt!==!1){const{newValue:Fe,activeIndex:xt}=ee({finger:bt});Bf({sliderRef:te,activeIndex:xt,setActive:C}),$(Fe),I&&!Pf(Fe,D)&&I(le,Fe,xt)}E.current=0;const Tt=Xr(te.current);Tt.addEventListener("mousemove",Y,{passive:!0}),Tt.addEventListener("mouseup",Be)},G=em(F?M[0]:l,l,o),re=em(M[M.length-1],l,o)-G,we=(be={})=>{const le=_d(be),Ke={onMouseDown:U(le||{})},bt=S({},le,Ke);return S({},be,{ref:J},bt)},me=be=>le=>{var Ke;(Ke=be.onMouseOver)==null||Ke.call(be,le);const bt=Number(le.currentTarget.getAttribute("data-index"));_(bt)},Ee=be=>le=>{var Ke;(Ke=be.onMouseLeave)==null||Ke.call(be,le),_(-1)};return{active:k,axis:X,axisProps:Q4,dragging:P,focusedThumbIndex:ne,getHiddenInputProps:(be={})=>{var le;const Ke=_d(be),bt={onChange:ke(Ke||{}),onFocus:pe(Ke||{}),onBlur:fe(Ke||{}),onKeyDown:_e(Ke||{})},Tt=S({},Ke,bt);return S({tabIndex:v,"aria-labelledby":e,"aria-orientation":h,"aria-valuemax":f(o),"aria-valuemin":f(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":(le=t.step)!=null?le:void 0,disabled:i},be,Tt,{style:S({},Lw,{direction:s?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:we,getThumbProps:(be={})=>{const le=_d(be),Ke={onMouseOver:me(le||{}),onMouseLeave:Ee(le||{})};return S({},be,le,Ke)},marks:O,open:x,range:F,rootRef:J,trackLeap:re,trackOffset:G,values:M,getThumbStyle:be=>({pointerEvents:k!==-1&&k!==be?"none":void 0})}}const e3=["onChange","maxRows","minRows","style","value"];function Ef(t){return parseInt(t,10)||0}const t3={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function r3(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const i3=w.forwardRef(function(e,r){const{onChange:i,maxRows:n,minRows:s=1,style:a,value:o}=e,l=oe(e,e3),{current:c}=w.useRef(o!=null),u=w.useRef(null),d=Wt(r,u),h=w.useRef(null),p=w.useCallback(()=>{const y=u.current,g=ea(y).getComputedStyle(y);if(g.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=g.width,b.value=y.value||e.placeholder||"x",b.value.slice(-1)===` -`&&(b.value+=" ");const k=g.boxSizing,C=Ef(g.paddingBottom)+Ef(g.paddingTop),x=Ef(g.borderBottomWidth)+Ef(g.borderTopWidth),_=b.scrollHeight;b.value="x";const P=b.scrollHeight;let R=_;s&&(R=Math.max(Number(s)*P,R)),n&&(R=Math.min(Number(n)*P,R)),R=Math.max(R,P);const E=R+(k==="border-box"?C+x:0),D=Math.abs(R-_)<=1;return{outerHeightStyle:E,overflowing:D}},[n,s,e.placeholder]),f=w.useCallback(()=>{const y=p();if(r3(y))return;const v=u.current;v.style.height=`${y.outerHeightStyle}px`,v.style.overflow=y.overflowing?"hidden":""},[p]);zr(()=>{const y=()=>{f()};let v;const g=Vh(y),b=u.current,k=ea(b);k.addEventListener("resize",g);let C;return typeof ResizeObserver<"u"&&(C=new ResizeObserver(y),C.observe(b)),()=>{g.clear(),cancelAnimationFrame(v),k.removeEventListener("resize",g),C&&C.disconnect()}},[p,f]),zr(()=>{f()});const m=y=>{c||f(),i&&i(y)};return T.jsxs(w.Fragment,{children:[T.jsx("textarea",S({value:o,onChange:m,ref:d,rows:s,style:a},l)),T.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:S({},t3.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var Zw={};Object.defineProperty(Zw,"__esModule",{value:!0});var NN=Zw.default=void 0,n3=a3(w),s3=cN;function EN(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(EN=function(i){return i?r:e})(t)}function a3(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=EN(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)){var a=n?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function o3(t){return Object.keys(t).length===0}function l3(t=null){const e=n3.useContext(s3.ThemeContext);return!e||o3(e)?t:e}NN=Zw.default=l3;const c3=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],u3=K(j4,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),d3=w.forwardRef(function(e,r){var i;const n=NN(),s=Ae({props:e,name:"MuiPopper"}),{anchorEl:a,component:o,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:m,popperOptions:y,popperRef:v,transition:g,slots:b,slotProps:k}=s,C=oe(s,c3),x=(i=b==null?void 0:b.root)!=null?i:l==null?void 0:l.Root,_=S({anchorEl:a,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:m,popperOptions:y,popperRef:v,transition:g},C);return T.jsx(u3,S({as:o,direction:n==null?void 0:n.direction,slots:{root:x},slotProps:k??c},_,{ref:r}))}),h3=d3,f3=Tr(T.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 p3(t){return He("MuiChip",t)}const m3=Ue("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"]),rr=m3,g3=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],y3=t=>{const{classes:e,disabled:r,size:i,color:n,iconColor:s,onDelete:a,clickable:o,variant:l}=t,c={root:["root",l,r&&"disabled",`size${Pe(i)}`,`color${Pe(n)}`,o&&"clickable",o&&`clickableColor${Pe(n)}`,a&&"deletable",a&&`deletableColor${Pe(n)}`,`${l}${Pe(n)}`],label:["label",`label${Pe(i)}`],avatar:["avatar",`avatar${Pe(i)}`,`avatarColor${Pe(n)}`],icon:["icon",`icon${Pe(i)}`,`iconColor${Pe(s)}`],deleteIcon:["deleteIcon",`deleteIcon${Pe(i)}`,`deleteIconColor${Pe(n)}`,`deleteIcon${Pe(l)}Color${Pe(n)}`]};return $e(c,p3,e)},b3=K("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t,{color:i,iconColor:n,clickable:s,onDelete:a,size:o,variant:l}=r;return[{[`& .${rr.avatar}`]:e.avatar},{[`& .${rr.avatar}`]:e[`avatar${Pe(o)}`]},{[`& .${rr.avatar}`]:e[`avatarColor${Pe(i)}`]},{[`& .${rr.icon}`]:e.icon},{[`& .${rr.icon}`]:e[`icon${Pe(o)}`]},{[`& .${rr.icon}`]:e[`iconColor${Pe(n)}`]},{[`& .${rr.deleteIcon}`]:e.deleteIcon},{[`& .${rr.deleteIcon}`]:e[`deleteIcon${Pe(o)}`]},{[`& .${rr.deleteIcon}`]:e[`deleteIconColor${Pe(i)}`]},{[`& .${rr.deleteIcon}`]:e[`deleteIcon${Pe(l)}Color${Pe(i)}`]},e.root,e[`size${Pe(o)}`],e[`color${Pe(i)}`],s&&e.clickable,s&&i!=="default"&&e[`clickableColor${Pe(i)})`],a&&e.deletable,a&&i!=="default"&&e[`deletableColor${Pe(i)}`],e[l],e[`${l}${Pe(i)}`]]}})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return S({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${rr.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${rr.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:r,fontSize:t.typography.pxToRem(12)},[`& .${rr.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${rr.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${rr.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${rr.icon}`]:S({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&S({color:t.vars?t.vars.palette.Chip.defaultIconColor:r},e.color!=="default"&&{color:"inherit"})),[`& .${rr.deleteIcon}`]:S({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:Jt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Jt(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:Jt(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>S({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>S({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${rr.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${rr.avatar}`]:{marginLeft:4},[`& .${rr.avatarSmall}`]:{marginLeft:2},[`& .${rr.icon}`]:{marginLeft:4},[`& .${rr.iconSmall}`]:{marginLeft:2},[`& .${rr.deleteIcon}`]:{marginRight:5},[`& .${rr.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Jt(t.palette[e.color].main,.7)}`,[`&.${rr.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:Jt(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${rr.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Jt(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),v3=K("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:r}=t,{size:i}=r;return[e.label,e[`label${Pe(i)}`]]}})(({ownerState:t})=>S({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function v1(t){return t.key==="Backspace"||t.key==="Delete"}const w3=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiChip"}),{avatar:n,className:s,clickable:a,color:o="default",component:l,deleteIcon:c,disabled:u=!1,icon:d,label:h,onClick:p,onDelete:f,onKeyDown:m,onKeyUp:y,size:v="medium",variant:g="filled",tabIndex:b,skipFocusWhenDisabled:k=!1}=i,C=oe(i,g3),x=w.useRef(null),_=Wt(x,r),P=V=>{V.stopPropagation(),f&&f(V)},R=V=>{V.currentTarget===V.target&&v1(V)&&V.preventDefault(),m&&m(V)},E=V=>{V.currentTarget===V.target&&(f&&v1(V)?f(V):V.key==="Escape"&&x.current&&x.current.blur()),y&&y(V)},D=a!==!1&&p?!0:a,$=D||f?Cs:l||"div",I=S({},i,{component:$,disabled:u,size:v,color:o,iconColor:w.isValidElement(d)&&d.props.color||o,onDelete:!!f,clickable:D,variant:g}),F=y3(I),M=$===Cs?S({component:l||"div",focusVisibleClassName:F.focusVisible},f&&{disableRipple:!0}):{};let O=null;f&&(O=c&&w.isValidElement(c)?w.cloneElement(c,{className:xe(c.props.className,F.deleteIcon),onClick:P}):T.jsx(f3,{className:xe(F.deleteIcon),onClick:P}));let A=null;n&&w.isValidElement(n)&&(A=w.cloneElement(n,{className:xe(F.avatar,n.props.className)}));let N=null;return d&&w.isValidElement(d)&&(N=w.cloneElement(d,{className:xe(F.icon,d.props.className)})),T.jsxs(b3,S({as:$,className:xe(F.root,s),disabled:D&&u?!0:void 0,onClick:p,onKeyDown:R,onKeyUp:E,ref:_,tabIndex:k&&u?-1:b,ownerState:I},M,C,{children:[A||N,T.jsx(v3,{className:xe(F.label),ownerState:I,children:h}),O]}))}),S3=w3;function Qo({props:t,states:e,muiFormControl:r}){return e.reduce((i,n)=>(i[n]=t[n],r&&typeof t[n]>"u"&&(i[n]=r[n]),i),{})}const x3=w.createContext(void 0),Vg=x3;function In(){return w.useContext(Vg)}function k3(t){return T.jsx(eA,S({},t,{defaultTheme:Tg,themeId:Lh}))}function w1(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function tm(t,e=!1){return t&&(w1(t.value)&&t.value!==""||e&&w1(t.defaultValue)&&t.defaultValue!=="")}function C3(t){return t.startAdornment}function T3(t){return He("MuiInputBase",t)}const _3=Ue("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),su=_3,B3=["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"],$g=(t,e)=>{const{ownerState:r}=t;return[e.root,r.formControl&&e.formControl,r.startAdornment&&e.adornedStart,r.endAdornment&&e.adornedEnd,r.error&&e.error,r.size==="small"&&e.sizeSmall,r.multiline&&e.multiline,r.color&&e[`color${Pe(r.color)}`],r.fullWidth&&e.fullWidth,r.hiddenLabel&&e.hiddenLabel]},zg=(t,e)=>{const{ownerState:r}=t;return[e.input,r.size==="small"&&e.inputSizeSmall,r.multiline&&e.inputMultiline,r.type==="search"&&e.inputTypeSearch,r.startAdornment&&e.inputAdornedStart,r.endAdornment&&e.inputAdornedEnd,r.hiddenLabel&&e.inputHiddenLabel]},P3=t=>{const{classes:e,color:r,disabled:i,error:n,endAdornment:s,focused:a,formControl:o,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:d,size:h,startAdornment:p,type:f}=t,m={root:["root",`color${Pe(r)}`,i&&"disabled",n&&"error",l&&"fullWidth",a&&"focused",o&&"formControl",h&&h!=="medium"&&`size${Pe(h)}`,u&&"multiline",p&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",d&&"readOnly"],input:["input",i&&"disabled",f==="search"&&"inputTypeSearch",u&&"inputMultiline",h==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",s&&"inputAdornedEnd",d&&"readOnly"]};return $e(m,T3,e)},Wg=K("div",{name:"MuiInputBase",slot:"Root",overridesResolver:$g})(({theme:t,ownerState:e})=>S({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${su.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&S({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),Hg=K("input",{name:"MuiInputBase",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light",i=S({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),n={opacity:"0 !important"},s=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return S({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":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${su.formControl} &`]:{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":s,"&:focus::-moz-placeholder":s,"&:focus:-ms-input-placeholder":s,"&:focus::-ms-input-placeholder":s},[`&.${su.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),N3=T.jsx(k3,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),E3=w.forwardRef(function(e,r){var i;const n=Ae({props:e,name:"MuiInputBase"}),{"aria-describedby":s,autoComplete:a,autoFocus:o,className:l,components:c={},componentsProps:u={},defaultValue:d,disabled:h,disableInjectingGlobalStyles:p,endAdornment:f,fullWidth:m=!1,id:y,inputComponent:v="input",inputProps:g={},inputRef:b,maxRows:k,minRows:C,multiline:x=!1,name:_,onBlur:P,onChange:R,onClick:E,onFocus:D,onKeyDown:$,onKeyUp:I,placeholder:F,readOnly:M,renderSuffix:O,rows:A,slotProps:N={},slots:V={},startAdornment:W,type:Q="text",value:ne}=n,ie=oe(n,B3),te=g.value!=null?g.value:ne,{current:j}=w.useRef(te!=null),J=w.useRef(),pe=w.useCallback(be=>{},[]),fe=Wt(J,b,g.ref,pe),[Me,_e]=w.useState(!1),ke=In(),Ce=Qo({props:n,muiFormControl:ke,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ce.focused=ke?ke.focused:Me,w.useEffect(()=>{!ke&&h&&Me&&(_e(!1),P&&P())},[ke,h,Me,P]);const X=ke&&ke.onFilled,ee=ke&&ke.onEmpty,Y=w.useCallback(be=>{tm(be)?X&&X():ee&&ee()},[X,ee]);zr(()=>{j&&Y({value:te})},[te,Y,j]);const Be=be=>{if(Ce.disabled){be.stopPropagation();return}D&&D(be),g.onFocus&&g.onFocus(be),ke&&ke.onFocus?ke.onFocus(be):_e(!0)},ce=be=>{P&&P(be),g.onBlur&&g.onBlur(be),ke&&ke.onBlur?ke.onBlur(be):_e(!1)},L=(be,...le)=>{if(!j){const Ke=be.target||J.current;if(Ke==null)throw new Error(Qa(1));Y({value:Ke.value})}g.onChange&&g.onChange(be,...le),R&&R(be,...le)};w.useEffect(()=>{Y(J.current)},[]);const U=be=>{J.current&&be.currentTarget===be.target&&J.current.focus(),E&&E(be)};let G=v,re=g;x&&G==="input"&&(A?re=S({type:void 0,minRows:A,maxRows:A},re):re=S({type:void 0,maxRows:k,minRows:C},re),G=i3);const we=be=>{Y(be.animationName==="mui-auto-fill-cancel"?J.current:{value:"x"})};w.useEffect(()=>{ke&&ke.setAdornedStart(!!W)},[ke,W]);const me=S({},n,{color:Ce.color||"primary",disabled:Ce.disabled,endAdornment:f,error:Ce.error,focused:Ce.focused,formControl:ke,fullWidth:m,hiddenLabel:Ce.hiddenLabel,multiline:x,size:Ce.size,startAdornment:W,type:Q}),Ee=P3(me),qe=V.root||c.Root||Wg,ct=N.root||u.root||{},Pt=V.input||c.Input||Hg;return re=S({},re,(i=N.input)!=null?i:u.input),T.jsxs(w.Fragment,{children:[!p&&N3,T.jsxs(qe,S({},ct,!Sa(qe)&&{ownerState:S({},me,ct.ownerState)},{ref:r,onClick:U},ie,{className:xe(Ee.root,ct.className,l,M&&"MuiInputBase-readOnly"),children:[W,T.jsx(Vg.Provider,{value:null,children:T.jsx(Pt,S({ownerState:me,"aria-invalid":Ce.error,"aria-describedby":s,autoComplete:a,autoFocus:o,defaultValue:d,disabled:Ce.disabled,id:y,onAnimationStart:we,name:_,placeholder:F,readOnly:M,required:Ce.required,rows:A,value:te,onKeyDown:$,onKeyUp:I,type:Q},re,!Sa(Pt)&&{as:G,ownerState:S({},me,re.ownerState)},{ref:fe,className:xe(Ee.input,re.className,M&&"MuiInputBase-readOnly"),onBlur:ce,onChange:L,onFocus:Be}))}),f,O?O(S({},Ce,{startAdornment:W})):null]}))]})}),eS=E3;function R3(t){return He("MuiInput",t)}const M3=S({},su,Ue("MuiInput",["root","underline","input"])),Yu=M3;function D3(t){return He("MuiOutlinedInput",t)}const L3=S({},su,Ue("MuiOutlinedInput",["root","notchedOutline","input"])),ho=L3;function F3(t){return He("MuiFilledInput",t)}const I3=S({},su,Ue("MuiFilledInput",["root","underline","input"])),Zo=I3,O3=Tr(T.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),A3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],V3={entering:{opacity:1},entered:{opacity:1}},$3=w.forwardRef(function(e,r){const i=qo(),n={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:o,easing:l,in:c,onEnter:u,onEntered:d,onEntering:h,onExit:p,onExited:f,onExiting:m,style:y,timeout:v=n,TransitionComponent:g=Ig}=e,b=oe(e,A3),k=w.useRef(null),C=Wt(k,o.ref,r),x=F=>M=>{if(F){const O=k.current;M===void 0?F(O):F(O,M)}},_=x(h),P=x((F,M)=>{Gw(F);const O=eu({style:y,timeout:v,easing:l},{mode:"enter"});F.style.webkitTransition=i.transitions.create("opacity",O),F.style.transition=i.transitions.create("opacity",O),u&&u(F,M)}),R=x(d),E=x(m),D=x(F=>{const M=eu({style:y,timeout:v,easing:l},{mode:"exit"});F.style.webkitTransition=i.transitions.create("opacity",M),F.style.transition=i.transitions.create("opacity",M),p&&p(F)}),$=x(f),I=F=>{s&&s(k.current,F)};return T.jsx(g,S({appear:a,in:c,nodeRef:k,onEnter:P,onEntered:R,onEntering:_,onExit:D,onExited:$,onExiting:E,addEndListener:I,timeout:v},b,{children:(F,M)=>w.cloneElement(o,S({style:S({opacity:0,visibility:F==="exited"&&!c?"hidden":void 0},V3[F],y,o.props.style),ref:C},M))}))}),Cu=$3;function z3(t){return He("MuiBackdrop",t)}Ue("MuiBackdrop",["root","invisible"]);const W3=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],H3=t=>{const{classes:e,invisible:r}=t;return $e({root:["root",r&&"invisible"]},z3,e)},U3=K("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.invisible&&e.invisible]}})(({ownerState:t})=>S({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"},t.invisible&&{backgroundColor:"transparent"})),G3=w.forwardRef(function(e,r){var i,n,s;const a=Ae({props:e,name:"MuiBackdrop"}),{children:o,className:l,component:c="div",components:u={},componentsProps:d={},invisible:h=!1,open:p,slotProps:f={},slots:m={},TransitionComponent:y=Cu,transitionDuration:v}=a,g=oe(a,W3),b=S({},a,{component:c,invisible:h}),k=H3(b),C=(i=f.root)!=null?i:d.root;return T.jsx(y,S({in:p,timeout:v},g,{children:T.jsx(U3,S({"aria-hidden":!0},C,{as:(n=(s=m.root)!=null?s:u.Root)!=null?n:c,className:xe(k.root,l,C==null?void 0:C.className),ownerState:S({},b,C==null?void 0:C.ownerState),classes:k,ref:r,children:o}))}))}),RN=G3,j3=Ue("MuiBox",["root"]),Y3=j3,X3=lN(),q3=oA({themeId:Lh,defaultTheme:X3,defaultClassName:Y3.root,generateClassName:$P.generate}),K3=q3;function Q3(t){return He("MuiButton",t)}const J3=Ue("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","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Rf=J3,Z3=w.createContext({}),ez=Z3,tz=w.createContext(void 0),rz=tz,iz=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],nz=t=>{const{color:e,disableElevation:r,fullWidth:i,size:n,variant:s,classes:a}=t,o={root:["root",s,`${s}${Pe(e)}`,`size${Pe(n)}`,`${s}Size${Pe(n)}`,`color${Pe(e)}`,r&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Pe(n)}`],endIcon:["icon","endIcon",`iconSize${Pe(n)}`]},l=$e(o,Q3,a);return S({},a,l)},MN=t=>S({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),sz=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`${r.variant}${Pe(r.color)}`],e[`size${Pe(r.size)}`],e[`${r.variant}Size${Pe(r.size)}`],r.color==="inherit"&&e.colorInherit,r.disableElevation&&e.disableElevation,r.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var r,i;const n=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],s=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return S({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":S({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:s,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":S({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${Rf.focusVisible}`]:S({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${Rf.disabled}`]:S({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${Jt(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(r=(i=t.palette).getContrastText)==null?void 0:r.call(i,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:n,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Rf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Rf.disabled}`]:{boxShadow:"none"}}),az=K("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.startIcon,e[`iconSize${Pe(r.size)}`]]}})(({ownerState:t})=>S({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},MN(t))),oz=K("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.endIcon,e[`iconSize${Pe(r.size)}`]]}})(({ownerState:t})=>S({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},MN(t))),lz=w.forwardRef(function(e,r){const i=w.useContext(ez),n=w.useContext(rz),s=Rw(i,e),a=Ae({props:s,name:"MuiButton"}),{children:o,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:m,fullWidth:y=!1,size:v="medium",startIcon:g,type:b,variant:k="text"}=a,C=oe(a,iz),x=S({},a,{color:l,component:c,disabled:d,disableElevation:h,disableFocusRipple:p,fullWidth:y,size:v,type:b,variant:k}),_=nz(x),P=g&&T.jsx(az,{className:_.startIcon,ownerState:x,children:g}),R=f&&T.jsx(oz,{className:_.endIcon,ownerState:x,children:f}),E=n||"";return T.jsxs(sz,S({ownerState:x,className:xe(i.className,_.root,u,E),component:c,disabled:d,focusRipple:!p,focusVisibleClassName:xe(_.focusVisible,m),ref:r,type:b},C,{classes:_,children:[P,o,R]}))}),Va=lz;function cz(t){return He("MuiCard",t)}Ue("MuiCard",["root"]);const uz=["className","raised"],dz=t=>{const{classes:e}=t;return $e({root:["root"]},cz,e)},hz=K(Xl,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),fz=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiCard"}),{className:n,raised:s=!1}=i,a=oe(i,uz),o=S({},i,{raised:s}),l=dz(o);return T.jsx(hz,S({className:xe(l.root,n),elevation:s?8:void 0,ref:r,ownerState:o},a))}),pz=fz;function mz(t){return He("MuiCardContent",t)}Ue("MuiCardContent",["root"]);const gz=["className","component"],yz=t=>{const{classes:e}=t;return $e({root:["root"]},mz,e)},bz=K("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),vz=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiCardContent"}),{className:n,component:s="div"}=i,a=oe(i,gz),o=S({},i,{component:s}),l=yz(o);return T.jsx(bz,S({as:s,className:xe(l.root,n),ownerState:o,ref:r},a))}),lh=vz;function wz(t){return He("MuiCardHeader",t)}const Sz=Ue("MuiCardHeader",["root","avatar","action","content","title","subheader"]),S1=Sz,xz=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],kz=t=>{const{classes:e}=t;return $e({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},wz,e)},Cz=K("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>S({[`& .${S1.title}`]:e.title,[`& .${S1.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),Tz=K("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),_z=K("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),Bz=K("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),Pz=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiCardHeader"}),{action:n,avatar:s,className:a,component:o="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:d,titleTypographyProps:h}=i,p=oe(i,xz),f=S({},i,{component:o,disableTypography:l}),m=kz(f);let y=d;y!=null&&y.type!==Mr&&!l&&(y=T.jsx(Mr,S({variant:s?"body2":"h5",className:m.title,component:"span",display:"block"},h,{children:y})));let v=c;return v!=null&&v.type!==Mr&&!l&&(v=T.jsx(Mr,S({variant:s?"body2":"body1",className:m.subheader,color:"text.secondary",component:"span",display:"block"},u,{children:v}))),T.jsxs(Cz,S({className:xe(m.root,a),as:o,ref:r,ownerState:f},p,{children:[s&&T.jsx(Tz,{className:m.avatar,ownerState:f,children:s}),T.jsxs(Bz,{className:m.content,ownerState:f,children:[y,v]}),n&&T.jsx(_z,{className:m.action,ownerState:f,children:n})]}))}),Nz=Pz;function Ez(t){return He("PrivateSwitchBase",t)}Ue("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Rz=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Mz=t=>{const{classes:e,checked:r,disabled:i,edge:n}=t,s={root:["root",r&&"checked",i&&"disabled",n&&`edge${Pe(n)}`],input:["input"]};return $e(s,Ez,e)},Dz=K(Cs)(({ownerState:t})=>S({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Lz=K("input",{shouldForwardProp:tn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Fz=w.forwardRef(function(e,r){const{autoFocus:i,checked:n,checkedIcon:s,className:a,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:d,id:h,inputProps:p,inputRef:f,name:m,onBlur:y,onChange:v,onFocus:g,readOnly:b,required:k=!1,tabIndex:C,type:x,value:_}=e,P=oe(e,Rz),[R,E]=xs({controlled:n,default:!!o,name:"SwitchBase",state:"checked"}),D=In(),$=V=>{g&&g(V),D&&D.onFocus&&D.onFocus(V)},I=V=>{y&&y(V),D&&D.onBlur&&D.onBlur(V)},F=V=>{if(V.nativeEvent.defaultPrevented)return;const W=V.target.checked;E(W),v&&v(V,W)};let M=l;D&&typeof M>"u"&&(M=D.disabled);const O=x==="checkbox"||x==="radio",A=S({},e,{checked:R,disabled:M,disableFocusRipple:c,edge:u}),N=Mz(A);return T.jsxs(Dz,S({component:"span",className:xe(N.root,a),centerRipple:!0,focusRipple:!c,disabled:M,tabIndex:null,role:void 0,onFocus:$,onBlur:I,ownerState:A,ref:r},P,{children:[T.jsx(Lz,S({autoFocus:i,checked:n,defaultChecked:o,className:N.input,disabled:M,id:O?h:void 0,name:m,onChange:F,readOnly:b,ref:f,required:k,ownerState:A,tabIndex:C,type:x},x==="checkbox"&&_===void 0?{}:{value:_},p)),R?s:d]}))}),Iz=Fz;function Oz(t){return He("MuiCircularProgress",t)}Ue("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Az=["className","color","disableShrink","size","style","thickness","value","variant"];let Ug=t=>t,x1,k1,C1,T1;const fo=44,Vz=wu(x1||(x1=Ug` +`),os.rippleVisible,I5,U0,({theme:t})=>t.transitions.easing.easeInOut,os.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,os.child,os.childLeaving,O5,U0,({theme:t})=>t.transitions.easing.easeInOut,os.childPulsate,A5,({theme:t})=>t.transitions.easing.easeInOut),z5=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTouchRipple"}),{center:n=!1,classes:s={},className:a}=i,o=le(i,L5),[l,c]=w.useState([]),u=w.useRef(0),d=w.useRef(null);w.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const h=w.useRef(!1),p=QP(),f=w.useRef(null),m=w.useRef(null),y=w.useCallback(k=>{const{pulsate:C,rippleX:x,rippleY:_,rippleSize:P,cb:R}=k;c(E=>[...E,T.jsx($5,{classes:{ripple:ke(s.ripple,os.ripple),rippleVisible:ke(s.rippleVisible,os.rippleVisible),ripplePulsate:ke(s.ripplePulsate,os.ripplePulsate),child:ke(s.child,os.child),childLeaving:ke(s.childLeaving,os.childLeaving),childPulsate:ke(s.childPulsate,os.childPulsate)},timeout:U0,pulsate:C,rippleX:x,rippleY:_,rippleSize:P},u.current)]),u.current+=1,d.current=R},[s]),v=w.useCallback((k={},C={},x=()=>{})=>{const{pulsate:_=!1,center:P=n||C.pulsate,fakeElement:R=!1}=C;if((k==null?void 0:k.type)==="mousedown"&&h.current){h.current=!1;return}(k==null?void 0:k.type)==="touchstart"&&(h.current=!0);const E=R?null:m.current,D=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let $,I,F;if(P||k===void 0||k.clientX===0&&k.clientY===0||!k.clientX&&!k.touches)$=Math.round(D.width/2),I=Math.round(D.height/2);else{const{clientX:M,clientY:O}=k.touches&&k.touches.length>0?k.touches[0]:k;$=Math.round(M-D.left),I=Math.round(O-D.top)}if(P)F=Math.sqrt((2*D.width**2+D.height**2)/3),F%2===0&&(F+=1);else{const M=Math.max(Math.abs((E?E.clientWidth:0)-$),$)*2+2,O=Math.max(Math.abs((E?E.clientHeight:0)-I),I)*2+2;F=Math.sqrt(M**2+O**2)}k!=null&&k.touches?f.current===null&&(f.current=()=>{y({pulsate:_,rippleX:$,rippleY:I,rippleSize:F,cb:x})},p.start(F5,()=>{f.current&&(f.current(),f.current=null)})):y({pulsate:_,rippleX:$,rippleY:I,rippleSize:F,cb:x})},[n,y,p]),g=w.useCallback(()=>{v({},{pulsate:!0})},[v]),b=w.useCallback((k,C)=>{if(p.clear(),(k==null?void 0:k.type)==="touchend"&&f.current){f.current(),f.current=null,p.start(0,()=>{b(k,C)});return}f.current=null,c(x=>x.length>0?x.slice(1):x),d.current=C},[p]);return w.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:b}),[g,v,b]),T.jsx(V5,S({className:ke(os.root,s.root,a),ref:m},o,{children:T.jsx(Uw,{component:null,exit:!0,children:l})}))}),W5=z5;function H5(t){return Ue("MuiButtonBase",t)}const U5=Ge("MuiButtonBase",["root","disabled","focusVisible"]),G5=["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"],j5=t=>{const{disabled:e,focusVisible:r,focusVisibleClassName:i,classes:n}=t,a=ze({root:["root",e&&"disabled",r&&"focusVisible"]},H5,n);return r&&i&&(a.root+=` ${i}`),a},Y5=K("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.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"},[`&.${U5.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),X5=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiButtonBase"}),{action:n,centerRipple:s=!1,children:a,className:o,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:h=!1,LinkComponent:p="a",onBlur:f,onClick:m,onContextMenu:y,onDragLeave:v,onFocus:g,onFocusVisible:b,onKeyDown:k,onKeyUp:C,onMouseDown:x,onMouseLeave:_,onMouseUp:P,onTouchEnd:R,onTouchMove:E,onTouchStart:D,tabIndex:$=0,TouchRippleProps:I,touchRippleRef:F,type:M}=i,O=le(i,G5),A=w.useRef(null),N=w.useRef(null),V=Wt(N,F),{isFocusVisibleRef:W,onFocus:Q,onBlur:ne,ref:ie}=Dw(),[te,j]=w.useState(!1);c&&te&&j(!1),w.useImperativeHandle(n,()=>({focusVisible:()=>{j(!0),A.current.focus()}}),[]);const[J,me]=w.useState(!1);w.useEffect(()=>{me(!0)},[]);const pe=J&&!u&&!c;w.useEffect(()=>{te&&h&&!u&&J&&N.current.pulsate()},[u,h,te,J]);function De(ce,Qe,bt=d){return Xe(Tt=>(Qe&&Qe(Tt),!bt&&N.current&&N.current[ce](Tt),!0))}const Be=De("start",x),Ce=De("stop",y),Te=De("stop",v),X=De("stop",P),ee=De("stop",ce=>{te&&ce.preventDefault(),_&&_(ce)}),Y=De("start",D),Pe=De("stop",R),ue=De("stop",E),L=De("stop",ce=>{ne(ce),W.current===!1&&j(!1),f&&f(ce)},!1),U=Xe(ce=>{A.current||(A.current=ce.currentTarget),Q(ce),W.current===!0&&(j(!0),b&&b(ce)),g&&g(ce)}),G=()=>{const ce=A.current;return l&&l!=="button"&&!(ce.tagName==="A"&&ce.href)},re=w.useRef(!1),Se=Xe(ce=>{h&&!re.current&&te&&N.current&&ce.key===" "&&(re.current=!0,N.current.stop(ce,()=>{N.current.start(ce)})),ce.target===ce.currentTarget&&G()&&ce.key===" "&&ce.preventDefault(),k&&k(ce),ce.target===ce.currentTarget&&G()&&ce.key==="Enter"&&!c&&(ce.preventDefault(),m&&m(ce))}),ge=Xe(ce=>{h&&ce.key===" "&&N.current&&te&&!ce.defaultPrevented&&(re.current=!1,N.current.stop(ce,()=>{N.current.pulsate(ce)})),C&&C(ce),m&&ce.target===ce.currentTarget&&G()&&ce.key===" "&&!ce.defaultPrevented&&m(ce)});let Re=l;Re==="button"&&(O.href||O.to)&&(Re=p);const Ke={};Re==="button"?(Ke.type=M===void 0?"button":M,Ke.disabled=c):(!O.href&&!O.to&&(Ke.role="button"),c&&(Ke["aria-disabled"]=c));const ct=Wt(r,ie,A),Pt=S({},i,{centerRipple:s,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:h,tabIndex:$,focusVisible:te}),ve=j5(Pt);return T.jsxs(Y5,S({as:Re,className:ke(ve.root,o),ownerState:Pt,onBlur:L,onClick:m,onContextMenu:Ce,onFocus:U,onKeyDown:Se,onKeyUp:ge,onMouseDown:Be,onMouseLeave:ee,onMouseUp:X,onDragLeave:Te,onTouchEnd:Pe,onTouchMove:ue,onTouchStart:Y,ref:ct,tabIndex:c?-1:$,type:M},Ke,O,{children:[a,pe?T.jsx(W5,S({ref:V,center:s},I)):null]}))}),Cs=X5;function q5(t){return Ue("MuiIconButton",t)}const K5=Ge("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Q5=K5,J5=["edge","children","className","color","disabled","disableFocusRipple","size"],Z5=t=>{const{classes:e,disabled:r,color:i,edge:n,size:s}=t,a={root:["root",r&&"disabled",i!=="default"&&`color${Ne(i)}`,n&&`edge${Ne(n)}`,`size${Ne(s)}`]};return ze(a,q5,e)},e$=K(Cs,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.color!=="default"&&e[`color${Ne(r.color)}`],r.edge&&e[`edge${Ne(r.edge)}`],e[`size${Ne(r.size)}`]]}})(({theme:t,ownerState:e})=>S({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var r;const i=(r=(t.vars||t).palette)==null?void 0:r[e.color];return S({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&S({color:i==null?void 0:i.main},!e.disableRipple&&{"&:hover":S({},i&&{backgroundColor:t.vars?`rgba(${i.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(i.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${Q5.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),t$=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiIconButton"}),{edge:n=!1,children:s,className:a,color:o="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=i,d=le(i,J5),h=S({},i,{edge:n,color:o,disabled:l,disableFocusRipple:c,size:u}),p=Z5(h);return T.jsx(e$,S({className:ke(p.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:r},d,{ownerState:h,children:s}))}),yn=t$;function r$(t){return Ue("MuiTypography",t)}Ge("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const i$=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],n$=t=>{const{align:e,gutterBottom:r,noWrap:i,paragraph:n,variant:s,classes:a}=t,o={root:["root",s,t.align!=="inherit"&&`align${Ne(e)}`,r&&"gutterBottom",i&&"noWrap",n&&"paragraph"]};return ze(o,r$,a)},s$=K("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.variant&&e[r.variant],r.align!=="inherit"&&e[`align${Ne(r.align)}`],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>S({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),n1={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},a$={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},o$=t=>a$[t]||t,l$=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTypography"}),n=o$(i.color),s=dg(S({},i,{color:n})),{align:a="inherit",className:o,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=n1}=s,f=le(s,i$),m=S({},s,{align:a,color:n,className:o,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:h,variantMapping:p}),y=l||(d?"p":p[h]||n1[h])||"span",v=n$(m);return T.jsx(s$,S({as:y,ref:r,ownerState:m,className:ke(v.root,o)},f))}),Mr=l$;function c$(t){return Ue("MuiAppBar",t)}Ge("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const u$=["className","color","enableColorOnDark","position"],d$=t=>{const{color:e,position:r,classes:i}=t,n={root:["root",`color${Ne(e)}`,`position${Ne(r)}`]};return ze(n,c$,i)},Cf=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,h$=K(Xl,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`position${Ne(r.position)}`],e[`color${Ne(r.color)}`]]}})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return S({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&S({},e.color==="default"&&{backgroundColor:r,color:t.palette.getContrastText(r)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&S({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&S({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:Cf(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:Cf(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:Cf(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:Cf(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),f$=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiAppBar"}),{className:n,color:s="primary",enableColorOnDark:a=!1,position:o="fixed"}=i,l=le(i,u$),c=S({},i,{color:s,position:o,enableColorOnDark:a}),u=d$(c);return T.jsx(h$,S({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,n,o==="fixed"&&"mui-fixed"),ref:r},l))}),p$=f$,pN="base";function m$(t){return`${pN}--${t}`}function g$(t,e){return`${pN}-${t}-${e}`}function mN(t,e){const r=WP[e];return r?m$(r):g$(t,e)}function y$(t,e){const r={};return e.forEach(i=>{r[i]=mN(t,i)}),r}const b$=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function v$(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function w$(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=i=>t.ownerDocument.querySelector(`input[type="radio"]${i}`);let r=e(`[name="${t.name}"]:checked`);return r||(r=e(`[name="${t.name}"]`)),r!==t}function S$(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||w$(t))}function x$(t){const e=[],r=[];return Array.from(t.querySelectorAll(b$)).forEach((i,n)=>{const s=v$(i);s===-1||!S$(i)||(s===0?e.push(i):r.push({documentOrder:n,tabIndex:s,node:i}))}),r.sort((i,n)=>i.tabIndex===n.tabIndex?i.documentOrder-n.documentOrder:i.tabIndex-n.tabIndex).map(i=>i.node).concat(e)}function k$(){return!0}function gN(t){const{children:e,disableAutoFocus:r=!1,disableEnforceFocus:i=!1,disableRestoreFocus:n=!1,getTabbable:s=x$,isEnabled:a=k$,open:o}=t,l=w.useRef(!1),c=w.useRef(null),u=w.useRef(null),d=w.useRef(null),h=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),m=Wt(e.ref,f),y=w.useRef(null);w.useEffect(()=>{!o||!f.current||(p.current=!r)},[r,o]),w.useEffect(()=>{if(!o||!f.current)return;const b=qr(f.current);return f.current.contains(b.activeElement)||(f.current.hasAttribute("tabIndex")||f.current.setAttribute("tabIndex","-1"),p.current&&f.current.focus()),()=>{n||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[o]),w.useEffect(()=>{if(!o||!f.current)return;const b=qr(f.current),k=_=>{y.current=_,!(i||!a()||_.key!=="Tab")&&b.activeElement===f.current&&_.shiftKey&&(l.current=!0,u.current&&u.current.focus())},C=()=>{const _=f.current;if(_===null)return;if(!b.hasFocus()||!a()||l.current){l.current=!1;return}if(_.contains(b.activeElement)||i&&b.activeElement!==c.current&&b.activeElement!==u.current)return;if(b.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let P=[];if((b.activeElement===c.current||b.activeElement===u.current)&&(P=s(f.current)),P.length>0){var R,E;const D=!!((R=y.current)!=null&&R.shiftKey&&((E=y.current)==null?void 0:E.key)==="Tab"),$=P[0],I=P[P.length-1];typeof $!="string"&&typeof I!="string"&&(D?I.focus():$.focus())}else _.focus()};b.addEventListener("focusin",C),b.addEventListener("keydown",k,!0);const x=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&C()},50);return()=>{clearInterval(x),b.removeEventListener("focusin",C),b.removeEventListener("keydown",k,!0)}},[r,i,n,a,o,s]);const v=b=>{d.current===null&&(d.current=b.relatedTarget),p.current=!0,h.current=b.target;const k=e.props.onFocus;k&&k(b)},g=b=>{d.current===null&&(d.current=b.relatedTarget),p.current=!0};return T.jsxs(w.Fragment,{children:[T.jsx("div",{tabIndex:o?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),w.cloneElement(e,{ref:m,onFocus:v}),T.jsx("div",{tabIndex:o?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}function C$(t){return typeof t=="function"?t():t}const yN=w.forwardRef(function(e,r){const{children:i,container:n,disablePortal:s=!1}=e,[a,o]=w.useState(null),l=Wt(w.isValidElement(i)?i.ref:null,r);if(zr(()=>{s||o(C$(n)||document.body)},[n,s]),zr(()=>{if(a&&!s)return A0(r,a),()=>{A0(r,null)}},[r,a,s]),s){if(w.isValidElement(i)){const c={ref:l};return w.cloneElement(i,c)}return T.jsx(w.Fragment,{children:i})}return T.jsx(w.Fragment,{children:a&&Vm.createPortal(i,a)})});function T$(t){const e=qr(t);return e.body===t?ea(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Bd(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function s1(t){return parseInt(ea(t).getComputedStyle(t).paddingRight,10)||0}function _$(t){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,i=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return r||i}function a1(t,e,r,i,n){const s=[e,r,...i];[].forEach.call(t.children,a=>{const o=s.indexOf(a)===-1,l=!_$(a);o&&l&&Bd(a,n)})}function Yy(t,e){let r=-1;return t.some((i,n)=>e(i)?(r=n,!0):!1),r}function B$(t,e){const r=[],i=t.container;if(!e.disableScrollLock){if(T$(i)){const a=JP(qr(i));r.push({value:i.style.paddingRight,property:"padding-right",el:i}),i.style.paddingRight=`${s1(i)+a}px`;const o=qr(i).querySelectorAll(".mui-fixed");[].forEach.call(o,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${s1(l)+a}px`})}let s;if(i.parentNode instanceof DocumentFragment)s=qr(i).body;else{const a=i.parentElement,o=ea(i);s=(a==null?void 0:a.nodeName)==="HTML"&&o.getComputedStyle(a).overflowY==="scroll"?a:i}r.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{r.forEach(({value:s,el:a,property:o})=>{s?a.style.setProperty(o,s):a.style.removeProperty(o)})}}function P$(t){const e=[];return[].forEach.call(t.children,r=>{r.getAttribute("aria-hidden")==="true"&&e.push(r)}),e}class N${constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,r){let i=this.modals.indexOf(e);if(i!==-1)return i;i=this.modals.length,this.modals.push(e),e.modalRef&&Bd(e.modalRef,!1);const n=P$(r);a1(r,e.mount,e.modalRef,n,!0);const s=Yy(this.containers,a=>a.container===r);return s!==-1?(this.containers[s].modals.push(e),i):(this.containers.push({modals:[e],container:r,restore:null,hiddenSiblings:n}),i)}mount(e,r){const i=Yy(this.containers,s=>s.modals.indexOf(e)!==-1),n=this.containers[i];n.restore||(n.restore=B$(n,r))}remove(e,r=!0){const i=this.modals.indexOf(e);if(i===-1)return i;const n=Yy(this.containers,a=>a.modals.indexOf(e)!==-1),s=this.containers[n];if(s.modals.splice(s.modals.indexOf(e),1),this.modals.splice(i,1),s.modals.length===0)s.restore&&s.restore(),e.modalRef&&Bd(e.modalRef,r),a1(s.container,e.mount,e.modalRef,s.hiddenSiblings,!1),this.containers.splice(n,1);else{const a=s.modals[s.modals.length-1];a.modalRef&&Bd(a.modalRef,!1)}return i}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function E$(t){return typeof t=="function"?t():t}function R$(t){return t?t.props.hasOwnProperty("in"):!1}const M$=new N$;function D$(t){const{container:e,disableEscapeKeyDown:r=!1,disableScrollLock:i=!1,manager:n=M$,closeAfterTransition:s=!1,onTransitionEnter:a,onTransitionExited:o,children:l,onClose:c,open:u,rootRef:d}=t,h=w.useRef({}),p=w.useRef(null),f=w.useRef(null),m=Wt(f,d),[y,v]=w.useState(!u),g=R$(l);let b=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(b=!1);const k=()=>qr(p.current),C=()=>(h.current.modalRef=f.current,h.current.mount=p.current,h.current),x=()=>{n.mount(C(),{disableScrollLock:i}),f.current&&(f.current.scrollTop=0)},_=Xe(()=>{const O=E$(e)||k().body;n.add(C(),O),f.current&&x()}),P=w.useCallback(()=>n.isTopModal(C()),[n]),R=Xe(O=>{p.current=O,O&&(u&&P()?x():f.current&&Bd(f.current,b))}),E=w.useCallback(()=>{n.remove(C(),b)},[b,n]);w.useEffect(()=>()=>{E()},[E]),w.useEffect(()=>{u?_():(!g||!s)&&E()},[u,E,g,s,_]);const D=O=>A=>{var N;(N=O.onKeyDown)==null||N.call(O,A),!(A.key!=="Escape"||A.which===229||!P())&&(r||(A.stopPropagation(),c&&c(A,"escapeKeyDown")))},$=O=>A=>{var N;(N=O.onClick)==null||N.call(O,A),A.target===A.currentTarget&&c&&c(A,"backdropClick")};return{getRootProps:(O={})=>{const A=_d(t);delete A.onTransitionEnter,delete A.onTransitionExited;const N=S({},A,O);return S({role:"presentation"},N,{onKeyDown:D(N),ref:m})},getBackdropProps:(O={})=>{const A=O;return S({"aria-hidden":!0},A,{onClick:$(A),open:u})},getTransitionProps:()=>{const O=()=>{v(!1),a&&a()},A=()=>{v(!0),o&&o(),s&&E()};return{onEnter:Ak(O,l==null?void 0:l.props.onEnter),onExited:Ak(A,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:R,isTopModal:P,exited:y,hasTransition:g}}var Mn="top",Ts="bottom",_s="right",Dn="left",jw="auto",Hh=[Mn,Ts,_s,Dn],tu="start",ah="end",L$="clippingParents",bN="viewport",ju="popper",F$="reference",o1=Hh.reduce(function(t,e){return t.concat([e+"-"+tu,e+"-"+ah])},[]),vN=[].concat(Hh,[jw]).reduce(function(t,e){return t.concat([e,e+"-"+tu,e+"-"+ah])},[]),I$="beforeRead",O$="read",A$="afterRead",V$="beforeMain",$$="main",z$="afterMain",W$="beforeWrite",H$="write",U$="afterWrite",G$=[I$,O$,A$,V$,$$,z$,W$,H$,U$];function Ta(t){return t?(t.nodeName||"").toLowerCase():null}function Qn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vl(t){var e=Qn(t).Element;return t instanceof e||t instanceof Element}function vs(t){var e=Qn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Yw(t){if(typeof ShadowRoot>"u")return!1;var e=Qn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function j$(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var i=e.styles[r]||{},n=e.attributes[r]||{},s=e.elements[r];!vs(s)||!Ta(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(a){var o=n[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function Y$(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(i){var n=e.elements[i],s=e.attributes[i]||{},a=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:r[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!vs(n)||!Ta(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const X$={name:"applyStyles",enabled:!0,phase:"write",fn:j$,effect:Y$,requires:["computeStyles"]};function xa(t){return t.split("-")[0]}var Bl=Math.max,Zp=Math.min,ru=Math.round;function G0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function wN(){return!/^((?!chrome|android).)*safari/i.test(G0())}function iu(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var i=t.getBoundingClientRect(),n=1,s=1;e&&vs(t)&&(n=t.offsetWidth>0&&ru(i.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ru(i.height)/t.offsetHeight||1);var a=Vl(t)?Qn(t):window,o=a.visualViewport,l=!wN()&&r,c=(i.left+(l&&o?o.offsetLeft:0))/n,u=(i.top+(l&&o?o.offsetTop:0))/s,d=i.width/n,h=i.height/s;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function Xw(t){var e=iu(t),r=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function SN(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Yw(r)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Za(t){return Qn(t).getComputedStyle(t)}function q$(t){return["table","td","th"].indexOf(Ta(t))>=0}function Qo(t){return((Vl(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ag(t){return Ta(t)==="html"?t:t.assignedSlot||t.parentNode||(Yw(t)?t.host:null)||Qo(t)}function l1(t){return!vs(t)||Za(t).position==="fixed"?null:t.offsetParent}function K$(t){var e=/firefox/i.test(G0()),r=/Trident/i.test(G0());if(r&&vs(t)){var i=Za(t);if(i.position==="fixed")return null}var n=Ag(t);for(Yw(n)&&(n=n.host);vs(n)&&["html","body"].indexOf(Ta(n))<0;){var s=Za(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Uh(t){for(var e=Qn(t),r=l1(t);r&&q$(r)&&Za(r).position==="static";)r=l1(r);return r&&(Ta(r)==="html"||Ta(r)==="body"&&Za(r).position==="static")?e:r||K$(t)||e}function qw(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Pd(t,e,r){return Bl(t,Zp(e,r))}function Q$(t,e,r){var i=Pd(t,e,r);return i>r?r:i}function xN(){return{top:0,right:0,bottom:0,left:0}}function kN(t){return Object.assign({},xN(),t)}function CN(t,e){return e.reduce(function(r,i){return r[i]=t,r},{})}var J$=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,kN(typeof e!="number"?e:CN(e,Hh))};function Z$(t){var e,r=t.state,i=t.name,n=t.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=xa(r.placement),l=qw(o),c=[Dn,_s].indexOf(o)>=0,u=c?"height":"width";if(!(!s||!a)){var d=J$(n.padding,r),h=Xw(s),p=l==="y"?Mn:Dn,f=l==="y"?Ts:_s,m=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],y=a[l]-r.rects.reference[l],v=Uh(s),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,b=m/2-y/2,k=d[p],C=g-h[u]-d[f],x=g/2-h[u]/2+b,_=Pd(k,x,C),P=l;r.modifiersData[i]=(e={},e[P]=_,e.centerOffset=_-x,e)}}function e4(t){var e=t.state,r=t.options,i=r.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||SN(e.elements.popper,n)&&(e.elements.arrow=n))}const t4={name:"arrow",enabled:!0,phase:"main",fn:Z$,effect:e4,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function nu(t){return t.split("-")[1]}var r4={top:"auto",right:"auto",bottom:"auto",left:"auto"};function i4(t,e){var r=t.x,i=t.y,n=e.devicePixelRatio||1;return{x:ru(r*n)/n||0,y:ru(i*n)/n||0}}function c1(t){var e,r=t.popper,i=t.popperRect,n=t.placement,s=t.variation,a=t.offsets,o=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=a.x,p=h===void 0?0:h,f=a.y,m=f===void 0?0:f,y=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var v=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=Dn,k=Mn,C=window;if(c){var x=Uh(r),_="clientHeight",P="clientWidth";if(x===Qn(r)&&(x=Qo(r),Za(x).position!=="static"&&o==="absolute"&&(_="scrollHeight",P="scrollWidth")),x=x,n===Mn||(n===Dn||n===_s)&&s===ah){k=Ts;var R=d&&x===C&&C.visualViewport?C.visualViewport.height:x[_];m-=R-i.height,m*=l?1:-1}if(n===Dn||(n===Mn||n===Ts)&&s===ah){b=_s;var E=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];p-=E-i.width,p*=l?1:-1}}var D=Object.assign({position:o},c&&r4),$=u===!0?i4({x:p,y:m},Qn(r)):{x:p,y:m};if(p=$.x,m=$.y,l){var I;return Object.assign({},D,(I={},I[k]=g?"0":"",I[b]=v?"0":"",I.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},D,(e={},e[k]=g?m+"px":"",e[b]=v?p+"px":"",e.transform="",e))}function n4(t){var e=t.state,r=t.options,i=r.gpuAcceleration,n=i===void 0?!0:i,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,l=o===void 0?!0:o,c={placement:xa(e.placement),variation:nu(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,c1(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,c1(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const s4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:n4,data:{}};var Tf={passive:!0};function a4(t){var e=t.state,r=t.instance,i=t.options,n=i.scroll,s=n===void 0?!0:n,a=i.resize,o=a===void 0?!0:a,l=Qn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",r.update,Tf)}),o&&l.addEventListener("resize",r.update,Tf),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Tf)}),o&&l.removeEventListener("resize",r.update,Tf)}}const o4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:a4,data:{}};var l4={left:"right",right:"left",bottom:"top",top:"bottom"};function gp(t){return t.replace(/left|right|bottom|top/g,function(e){return l4[e]})}var c4={start:"end",end:"start"};function u1(t){return t.replace(/start|end/g,function(e){return c4[e]})}function Kw(t){var e=Qn(t),r=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:r,scrollTop:i}}function Qw(t){return iu(Qo(t)).left+Kw(t).scrollLeft}function u4(t,e){var r=Qn(t),i=Qo(t),n=r.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(n){s=n.width,a=n.height;var c=wN();(c||!c&&e==="fixed")&&(o=n.offsetLeft,l=n.offsetTop)}return{width:s,height:a,x:o+Qw(t),y:l}}function d4(t){var e,r=Qo(t),i=Kw(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=Bl(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Bl(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-i.scrollLeft+Qw(t),l=-i.scrollTop;return Za(n||r).direction==="rtl"&&(o+=Bl(r.clientWidth,n?n.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function Jw(t){var e=Za(t),r=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+i)}function TN(t){return["html","body","#document"].indexOf(Ta(t))>=0?t.ownerDocument.body:vs(t)&&Jw(t)?t:TN(Ag(t))}function Nd(t,e){var r;e===void 0&&(e=[]);var i=TN(t),n=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qn(i),a=n?[s].concat(s.visualViewport||[],Jw(i)?i:[]):i,o=e.concat(a);return n?o:o.concat(Nd(Ag(a)))}function j0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function h4(t,e){var r=iu(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function d1(t,e,r){return e===bN?j0(u4(t,r)):Vl(e)?h4(e,r):j0(d4(Qo(t)))}function f4(t){var e=Nd(Ag(t)),r=["absolute","fixed"].indexOf(Za(t).position)>=0,i=r&&vs(t)?Uh(t):t;return Vl(i)?e.filter(function(n){return Vl(n)&&SN(n,i)&&Ta(n)!=="body"}):[]}function p4(t,e,r,i){var n=e==="clippingParents"?f4(t):[].concat(e),s=[].concat(n,[r]),a=s[0],o=s.reduce(function(l,c){var u=d1(t,c,i);return l.top=Bl(u.top,l.top),l.right=Zp(u.right,l.right),l.bottom=Zp(u.bottom,l.bottom),l.left=Bl(u.left,l.left),l},d1(t,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function _N(t){var e=t.reference,r=t.element,i=t.placement,n=i?xa(i):null,s=i?nu(i):null,a=e.x+e.width/2-r.width/2,o=e.y+e.height/2-r.height/2,l;switch(n){case Mn:l={x:a,y:e.y-r.height};break;case Ts:l={x:a,y:e.y+e.height};break;case _s:l={x:e.x+e.width,y:o};break;case Dn:l={x:e.x-r.width,y:o};break;default:l={x:e.x,y:e.y}}var c=n?qw(n):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case tu:l[c]=l[c]-(e[u]/2-r[u]/2);break;case ah:l[c]=l[c]+(e[u]/2-r[u]/2);break}}return l}function oh(t,e){e===void 0&&(e={});var r=e,i=r.placement,n=i===void 0?t.placement:i,s=r.strategy,a=s===void 0?t.strategy:s,o=r.boundary,l=o===void 0?L$:o,c=r.rootBoundary,u=c===void 0?bN:c,d=r.elementContext,h=d===void 0?ju:d,p=r.altBoundary,f=p===void 0?!1:p,m=r.padding,y=m===void 0?0:m,v=kN(typeof y!="number"?y:CN(y,Hh)),g=h===ju?F$:ju,b=t.rects.popper,k=t.elements[f?g:h],C=p4(Vl(k)?k:k.contextElement||Qo(t.elements.popper),l,u,a),x=iu(t.elements.reference),_=_N({reference:x,element:b,strategy:"absolute",placement:n}),P=j0(Object.assign({},b,_)),R=h===ju?P:x,E={top:C.top-R.top+v.top,bottom:R.bottom-C.bottom+v.bottom,left:C.left-R.left+v.left,right:R.right-C.right+v.right},D=t.modifiersData.offset;if(h===ju&&D){var $=D[n];Object.keys(E).forEach(function(I){var F=[_s,Ts].indexOf(I)>=0?1:-1,M=[Mn,Ts].indexOf(I)>=0?"y":"x";E[I]+=$[M]*F})}return E}function m4(t,e){e===void 0&&(e={});var r=e,i=r.placement,n=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?vN:l,u=nu(i),d=u?o?o1:o1.filter(function(f){return nu(f)===u}):Hh,h=d.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=oh(t,{placement:m,boundary:n,rootBoundary:s,padding:a})[xa(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function g4(t){if(xa(t)===jw)return[];var e=gp(t);return[u1(t),e,u1(e)]}function y4(t){var e=t.state,r=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var n=r.mainAxis,s=n===void 0?!0:n,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,f=p===void 0?!0:p,m=r.allowedAutoPlacements,y=e.options.placement,v=xa(y),g=v===y,b=l||(g||!f?[gp(y)]:g4(y)),k=[y].concat(b).reduce(function(te,j){return te.concat(xa(j)===jw?m4(e,{placement:j,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):j)},[]),C=e.rects.reference,x=e.rects.popper,_=new Map,P=!0,R=k[0],E=0;E=0,M=F?"width":"height",O=oh(e,{placement:D,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),A=F?I?_s:Dn:I?Ts:Mn;C[M]>x[M]&&(A=gp(A));var N=gp(A),V=[];if(s&&V.push(O[$]<=0),o&&V.push(O[A]<=0,O[N]<=0),V.every(function(te){return te})){R=D,P=!1;break}_.set(D,V)}if(P)for(var W=f?3:1,Q=function(j){var J=k.find(function(me){var pe=_.get(me);if(pe)return pe.slice(0,j).every(function(De){return De})});if(J)return R=J,"break"},ne=W;ne>0;ne--){var ie=Q(ne);if(ie==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}const b4={name:"flip",enabled:!0,phase:"main",fn:y4,requiresIfExists:["offset"],data:{_skip:!1}};function h1(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function f1(t){return[Mn,_s,Ts,Dn].some(function(e){return t[e]>=0})}function v4(t){var e=t.state,r=t.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,a=oh(e,{elementContext:"reference"}),o=oh(e,{altBoundary:!0}),l=h1(a,i),c=h1(o,n,s),u=f1(l),d=f1(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const w4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:v4};function S4(t,e,r){var i=xa(t),n=[Dn,Mn].indexOf(i)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*n,[Dn,_s].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function x4(t){var e=t.state,r=t.options,i=t.name,n=r.offset,s=n===void 0?[0,0]:n,a=vN.reduce(function(u,d){return u[d]=S4(d,e.rects,s),u},{}),o=a[e.placement],l=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}const k4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:x4};function C4(t){var e=t.state,r=t.name;e.modifiersData[r]=_N({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const T4={name:"popperOffsets",enabled:!0,phase:"read",fn:C4,data:{}};function _4(t){return t==="x"?"y":"x"}function B4(t){var e=t.state,r=t.options,i=t.name,n=r.mainAxis,s=n===void 0?!0:n,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,h=r.tether,p=h===void 0?!0:h,f=r.tetherOffset,m=f===void 0?0:f,y=oh(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=xa(e.placement),g=nu(e.placement),b=!g,k=qw(v),C=_4(k),x=e.modifiersData.popperOffsets,_=e.rects.reference,P=e.rects.popper,R=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,E=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(x){if(s){var I,F=k==="y"?Mn:Dn,M=k==="y"?Ts:_s,O=k==="y"?"height":"width",A=x[k],N=A+y[F],V=A-y[M],W=p?-P[O]/2:0,Q=g===tu?_[O]:P[O],ne=g===tu?-P[O]:-_[O],ie=e.elements.arrow,te=p&&ie?Xw(ie):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xN(),J=j[F],me=j[M],pe=Pd(0,_[O],te[O]),De=b?_[O]/2-W-pe-J-E.mainAxis:Q-pe-J-E.mainAxis,Be=b?-_[O]/2+W+pe+me+E.mainAxis:ne+pe+me+E.mainAxis,Ce=e.elements.arrow&&Uh(e.elements.arrow),Te=Ce?k==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,X=(I=D==null?void 0:D[k])!=null?I:0,ee=A+De-X-Te,Y=A+Be-X,Pe=Pd(p?Zp(N,ee):N,A,p?Bl(V,Y):V);x[k]=Pe,$[k]=Pe-A}if(o){var ue,L=k==="x"?Mn:Dn,U=k==="x"?Ts:_s,G=x[C],re=C==="y"?"height":"width",Se=G+y[L],ge=G-y[U],Re=[Mn,Dn].indexOf(v)!==-1,Ke=(ue=D==null?void 0:D[C])!=null?ue:0,ct=Re?Se:G-_[re]-P[re]-Ke+E.altAxis,Pt=Re?G+_[re]+P[re]-Ke-E.altAxis:ge,ve=p&&Re?Q$(ct,G,Pt):Pd(p?ct:Se,G,p?Pt:ge);x[C]=ve,$[C]=ve-G}e.modifiersData[i]=$}}const P4={name:"preventOverflow",enabled:!0,phase:"main",fn:B4,requiresIfExists:["offset"]};function N4(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function E4(t){return t===Qn(t)||!vs(t)?Kw(t):N4(t)}function R4(t){var e=t.getBoundingClientRect(),r=ru(e.width)/t.offsetWidth||1,i=ru(e.height)/t.offsetHeight||1;return r!==1||i!==1}function M4(t,e,r){r===void 0&&(r=!1);var i=vs(e),n=vs(e)&&R4(e),s=Qo(e),a=iu(t,n,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!r)&&((Ta(e)!=="body"||Jw(s))&&(o=E4(e)),vs(e)?(l=iu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Qw(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function D4(t){var e=new Map,r=new Set,i=[];t.forEach(function(s){e.set(s.name,s)});function n(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=e.get(o);l&&n(l)}}),i.push(s)}return t.forEach(function(s){r.has(s.name)||n(s)}),i}function L4(t){var e=D4(t);return G$.reduce(function(r,i){return r.concat(e.filter(function(n){return n.phase===i}))},[])}function F4(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function I4(t){var e=t.reduce(function(r,i){var n=r[i.name];return r[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,r},{});return Object.keys(e).map(function(r){return e[r]})}var p1={placement:"bottom",modifiers:[],strategy:"absolute"};function m1(){for(var t=arguments.length,e=new Array(t),r=0;rze({root:["root"]},E5($4)),j4={},Y4=w.forwardRef(function(e,r){var i;const{anchorEl:n,children:s,direction:a,disablePortal:o,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:h,slotProps:p={},slots:f={},TransitionProps:m}=e,y=le(e,z4),v=w.useRef(null),g=Wt(v,r),b=w.useRef(null),k=Wt(b,h),C=w.useRef(k);zr(()=>{C.current=k},[k]),w.useImperativeHandle(h,()=>b.current,[]);const x=H4(u,a),[_,P]=w.useState(x),[R,E]=w.useState(Y0(n));w.useEffect(()=>{b.current&&b.current.forceUpdate()}),w.useEffect(()=>{n&&E(Y0(n))},[n]),zr(()=>{if(!R||!c)return;const M=N=>{P(N.placement)};let O=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:N})=>{M(N)}}];l!=null&&(O=O.concat(l)),d&&d.modifiers!=null&&(O=O.concat(d.modifiers));const A=V4(R,v.current,S({placement:x},d,{modifiers:O}));return C.current(A),()=>{A.destroy(),C.current(null)}},[R,o,l,c,d,x]);const D={placement:_};m!==null&&(D.TransitionProps=m);const $=G4(),I=(i=f.root)!=null?i:"div",F=Ct({elementType:I,externalSlotProps:p.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:g},ownerState:e,className:$.root});return T.jsx(I,S({},F,{children:typeof s=="function"?s(D):s}))}),X4=w.forwardRef(function(e,r){const{anchorEl:i,children:n,container:s,direction:a="ltr",disablePortal:o=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:h=j4,popperRef:p,style:f,transition:m=!1,slotProps:y={},slots:v={}}=e,g=le(e,W4),[b,k]=w.useState(!0),C=()=>{k(!1)},x=()=>{k(!0)};if(!l&&!u&&(!m||b))return null;let _;if(s)_=s;else if(i){const E=Y0(i);_=E&&U4(E)?qr(E).body:qr(null).body}const P=!u&&l&&(!m||b)?"none":void 0,R=m?{in:u,onEnter:C,onExited:x}:void 0;return T.jsx(yN,{disablePortal:o,container:_,children:T.jsx(Y4,S({anchorEl:i,direction:a,disablePortal:o,modifiers:c,ref:r,open:m?!b:u,placement:d,popperOptions:h,popperRef:p,slotProps:y,slots:v},g,{style:S({position:"fixed",top:0,left:0,display:P},f),TransitionProps:R,children:n}))})}),q4=2;function PN(t,e){return t-e}function g1(t,e){var r;const{index:i}=(r=t.reduce((n,s,a)=>{const o=Math.abs(e-s);return n===null||o({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},e3=t=>t;let Nf;function b1(){return Nf===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Nf=CSS.supports("touch-action","none"):Nf=!0),Nf}function t3(t){const{"aria-labelledby":e,defaultValue:r,disabled:i=!1,disableSwap:n=!1,isRtl:s=!1,marks:a=!1,max:o=100,min:l=0,name:c,onChange:u,onChangeCommitted:d,orientation:h="horizontal",rootRef:p,scale:f=e3,step:m=1,shiftStep:y=10,tabIndex:v,value:g}=t,b=w.useRef(),[k,C]=w.useState(-1),[x,_]=w.useState(-1),[P,R]=w.useState(!1),E=w.useRef(0),[D,$]=xs({controlled:g,default:r??l,name:"Slider"}),I=u&&((ve,ce,Qe)=>{const bt=ve.nativeEvent||ve,Tt=new bt.constructor(bt.type,bt);Object.defineProperty(Tt,"target",{writable:!0,value:{value:ce,name:c}}),u(Tt,ce,Qe)}),F=Array.isArray(D);let M=F?D.slice().sort(PN):[D];M=M.map(ve=>ve==null?l:xo(ve,l,o));const O=a===!0&&m!==null?[...Array(Math.floor((o-l)/m)+1)].map((ve,ce)=>({value:l+m*ce})):a||[],A=O.map(ve=>ve.value),{isFocusVisibleRef:N,onBlur:V,onFocus:W,ref:Q}=Dw(),[ne,ie]=w.useState(-1),te=w.useRef(),j=Wt(Q,te),J=Wt(p,j),me=ve=>ce=>{var Qe;const bt=Number(ce.currentTarget.getAttribute("data-index"));W(ce),N.current===!0&&ie(bt),_(bt),ve==null||(Qe=ve.onFocus)==null||Qe.call(ve,ce)},pe=ve=>ce=>{var Qe;V(ce),N.current===!1&&ie(-1),_(-1),ve==null||(Qe=ve.onBlur)==null||Qe.call(ve,ce)},De=(ve,ce)=>{const Qe=Number(ve.currentTarget.getAttribute("data-index")),bt=M[Qe],Tt=A.indexOf(bt);let Ie=ce;if(O&&m==null){const xt=A[A.length-1];Ie>xt?Ie=xt:Iece=>{var Qe;if(m!==null){const bt=Number(ce.currentTarget.getAttribute("data-index")),Tt=M[bt];let Ie=null;(ce.key==="ArrowLeft"||ce.key==="ArrowDown")&&ce.shiftKey||ce.key==="PageDown"?Ie=Math.max(Tt-y,l):((ce.key==="ArrowRight"||ce.key==="ArrowUp")&&ce.shiftKey||ce.key==="PageUp")&&(Ie=Math.min(Tt+y,o)),Ie!==null&&(De(ce,Ie),ce.preventDefault())}ve==null||(Qe=ve.onKeyDown)==null||Qe.call(ve,ce)};zr(()=>{if(i&&te.current.contains(document.activeElement)){var ve;(ve=document.activeElement)==null||ve.blur()}},[i]),i&&k!==-1&&C(-1),i&&ne!==-1&&ie(-1);const Ce=ve=>ce=>{var Qe;(Qe=ve.onChange)==null||Qe.call(ve,ce),De(ce,ce.target.valueAsNumber)},Te=w.useRef();let X=h;s&&h==="horizontal"&&(X+="-reverse");const ee=({finger:ve,move:ce=!1})=>{const{current:Qe}=te,{width:bt,height:Tt,bottom:Ie,left:xt}=Qe.getBoundingClientRect();let Le;X.indexOf("vertical")===0?Le=(Ie-ve.y)/Tt:Le=(ve.x-xt)/bt,X.indexOf("-reverse")!==-1&&(Le=1-Le);let Oe;if(Oe=K4(Le,l,o),m)Oe=J4(Oe,m,l);else{const st=g1(A,Oe);Oe=A[st]}Oe=xo(Oe,l,o);let wt=0;if(F){ce?wt=Te.current:wt=g1(M,Oe),n&&(Oe=xo(Oe,M[wt-1]||-1/0,M[wt+1]||1/0));const st=Oe;Oe=y1({values:M,newValue:Oe,index:wt}),n&&ce||(wt=Oe.indexOf(st),Te.current=wt)}return{newValue:Oe,activeIndex:wt}},Y=Xe(ve=>{const ce=_f(ve,b);if(!ce)return;if(E.current+=1,ve.type==="mousemove"&&ve.buttons===0){Pe(ve);return}const{newValue:Qe,activeIndex:bt}=ee({finger:ce,move:!0});Bf({sliderRef:te,activeIndex:bt,setActive:C}),$(Qe),!P&&E.current>q4&&R(!0),I&&!Pf(Qe,D)&&I(ve,Qe,bt)}),Pe=Xe(ve=>{const ce=_f(ve,b);if(R(!1),!ce)return;const{newValue:Qe}=ee({finger:ce,move:!0});C(-1),ve.type==="touchend"&&_(-1),d&&d(ve,Qe),b.current=void 0,L()}),ue=Xe(ve=>{if(i)return;b1()||ve.preventDefault();const ce=ve.changedTouches[0];ce!=null&&(b.current=ce.identifier);const Qe=_f(ve,b);if(Qe!==!1){const{newValue:Tt,activeIndex:Ie}=ee({finger:Qe});Bf({sliderRef:te,activeIndex:Ie,setActive:C}),$(Tt),I&&!Pf(Tt,D)&&I(ve,Tt,Ie)}E.current=0;const bt=qr(te.current);bt.addEventListener("touchmove",Y,{passive:!0}),bt.addEventListener("touchend",Pe,{passive:!0})}),L=w.useCallback(()=>{const ve=qr(te.current);ve.removeEventListener("mousemove",Y),ve.removeEventListener("mouseup",Pe),ve.removeEventListener("touchmove",Y),ve.removeEventListener("touchend",Pe)},[Pe,Y]);w.useEffect(()=>{const{current:ve}=te;return ve.addEventListener("touchstart",ue,{passive:b1()}),()=>{ve.removeEventListener("touchstart",ue),L()}},[L,ue]),w.useEffect(()=>{i&&L()},[i,L]);const U=ve=>ce=>{var Qe;if((Qe=ve.onMouseDown)==null||Qe.call(ve,ce),i||ce.defaultPrevented||ce.button!==0)return;ce.preventDefault();const bt=_f(ce,b);if(bt!==!1){const{newValue:Ie,activeIndex:xt}=ee({finger:bt});Bf({sliderRef:te,activeIndex:xt,setActive:C}),$(Ie),I&&!Pf(Ie,D)&&I(ce,Ie,xt)}E.current=0;const Tt=qr(te.current);Tt.addEventListener("mousemove",Y,{passive:!0}),Tt.addEventListener("mouseup",Pe)},G=em(F?M[0]:l,l,o),re=em(M[M.length-1],l,o)-G,Se=(ve={})=>{const ce=_d(ve),Qe={onMouseDown:U(ce||{})},bt=S({},ce,Qe);return S({},ve,{ref:J},bt)},ge=ve=>ce=>{var Qe;(Qe=ve.onMouseOver)==null||Qe.call(ve,ce);const bt=Number(ce.currentTarget.getAttribute("data-index"));_(bt)},Re=ve=>ce=>{var Qe;(Qe=ve.onMouseLeave)==null||Qe.call(ve,ce),_(-1)};return{active:k,axis:X,axisProps:Z4,dragging:P,focusedThumbIndex:ne,getHiddenInputProps:(ve={})=>{var ce;const Qe=_d(ve),bt={onChange:Ce(Qe||{}),onFocus:me(Qe||{}),onBlur:pe(Qe||{}),onKeyDown:Be(Qe||{})},Tt=S({},Qe,bt);return S({tabIndex:v,"aria-labelledby":e,"aria-orientation":h,"aria-valuemax":f(o),"aria-valuemin":f(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":(ce=t.step)!=null?ce:void 0,disabled:i},ve,Tt,{style:S({},Lw,{direction:s?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Se,getThumbProps:(ve={})=>{const ce=_d(ve),Qe={onMouseOver:ge(ce||{}),onMouseLeave:Re(ce||{})};return S({},ve,ce,Qe)},marks:O,open:x,range:F,rootRef:J,trackLeap:re,trackOffset:G,values:M,getThumbStyle:ve=>({pointerEvents:k!==-1&&k!==ve?"none":void 0})}}const r3=["onChange","maxRows","minRows","style","value"];function Ef(t){return parseInt(t,10)||0}const i3={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function n3(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const s3=w.forwardRef(function(e,r){const{onChange:i,maxRows:n,minRows:s=1,style:a,value:o}=e,l=le(e,r3),{current:c}=w.useRef(o!=null),u=w.useRef(null),d=Wt(r,u),h=w.useRef(null),p=w.useCallback(()=>{const y=u.current,g=ea(y).getComputedStyle(y);if(g.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=g.width,b.value=y.value||e.placeholder||"x",b.value.slice(-1)===` +`&&(b.value+=" ");const k=g.boxSizing,C=Ef(g.paddingBottom)+Ef(g.paddingTop),x=Ef(g.borderBottomWidth)+Ef(g.borderTopWidth),_=b.scrollHeight;b.value="x";const P=b.scrollHeight;let R=_;s&&(R=Math.max(Number(s)*P,R)),n&&(R=Math.min(Number(n)*P,R)),R=Math.max(R,P);const E=R+(k==="border-box"?C+x:0),D=Math.abs(R-_)<=1;return{outerHeightStyle:E,overflowing:D}},[n,s,e.placeholder]),f=w.useCallback(()=>{const y=p();if(n3(y))return;const v=u.current;v.style.height=`${y.outerHeightStyle}px`,v.style.overflow=y.overflowing?"hidden":""},[p]);zr(()=>{const y=()=>{f()};let v;const g=Vh(y),b=u.current,k=ea(b);k.addEventListener("resize",g);let C;return typeof ResizeObserver<"u"&&(C=new ResizeObserver(y),C.observe(b)),()=>{g.clear(),cancelAnimationFrame(v),k.removeEventListener("resize",g),C&&C.disconnect()}},[p,f]),zr(()=>{f()});const m=y=>{c||f(),i&&i(y)};return T.jsxs(w.Fragment,{children:[T.jsx("textarea",S({value:o,onChange:m,ref:d,rows:s,style:a},l)),T.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:S({},i3.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var Zw={};Object.defineProperty(Zw,"__esModule",{value:!0});var NN=Zw.default=void 0,a3=l3(w),o3=cN;function EN(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(EN=function(i){return i?r:e})(t)}function l3(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=EN(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)){var a=n?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}return i.default=t,r&&r.set(t,i),i}function c3(t){return Object.keys(t).length===0}function u3(t=null){const e=a3.useContext(o3.ThemeContext);return!e||c3(e)?t:e}NN=Zw.default=u3;const d3=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],h3=K(X4,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),f3=w.forwardRef(function(e,r){var i;const n=NN(),s=Ve({props:e,name:"MuiPopper"}),{anchorEl:a,component:o,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:m,popperOptions:y,popperRef:v,transition:g,slots:b,slotProps:k}=s,C=le(s,d3),x=(i=b==null?void 0:b.root)!=null?i:l==null?void 0:l.Root,_=S({anchorEl:a,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:m,popperOptions:y,popperRef:v,transition:g},C);return T.jsx(h3,S({as:o,direction:n==null?void 0:n.direction,slots:{root:x},slotProps:k??c},_,{ref:r}))}),p3=f3,m3=Tr(T.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 g3(t){return Ue("MuiChip",t)}const y3=Ge("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"]),rr=y3,b3=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],v3=t=>{const{classes:e,disabled:r,size:i,color:n,iconColor:s,onDelete:a,clickable:o,variant:l}=t,c={root:["root",l,r&&"disabled",`size${Ne(i)}`,`color${Ne(n)}`,o&&"clickable",o&&`clickableColor${Ne(n)}`,a&&"deletable",a&&`deletableColor${Ne(n)}`,`${l}${Ne(n)}`],label:["label",`label${Ne(i)}`],avatar:["avatar",`avatar${Ne(i)}`,`avatarColor${Ne(n)}`],icon:["icon",`icon${Ne(i)}`,`iconColor${Ne(s)}`],deleteIcon:["deleteIcon",`deleteIcon${Ne(i)}`,`deleteIconColor${Ne(n)}`,`deleteIcon${Ne(l)}Color${Ne(n)}`]};return ze(c,g3,e)},w3=K("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t,{color:i,iconColor:n,clickable:s,onDelete:a,size:o,variant:l}=r;return[{[`& .${rr.avatar}`]:e.avatar},{[`& .${rr.avatar}`]:e[`avatar${Ne(o)}`]},{[`& .${rr.avatar}`]:e[`avatarColor${Ne(i)}`]},{[`& .${rr.icon}`]:e.icon},{[`& .${rr.icon}`]:e[`icon${Ne(o)}`]},{[`& .${rr.icon}`]:e[`iconColor${Ne(n)}`]},{[`& .${rr.deleteIcon}`]:e.deleteIcon},{[`& .${rr.deleteIcon}`]:e[`deleteIcon${Ne(o)}`]},{[`& .${rr.deleteIcon}`]:e[`deleteIconColor${Ne(i)}`]},{[`& .${rr.deleteIcon}`]:e[`deleteIcon${Ne(l)}Color${Ne(i)}`]},e.root,e[`size${Ne(o)}`],e[`color${Ne(i)}`],s&&e.clickable,s&&i!=="default"&&e[`clickableColor${Ne(i)})`],a&&e.deletable,a&&i!=="default"&&e[`deletableColor${Ne(i)}`],e[l],e[`${l}${Ne(i)}`]]}})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return S({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${rr.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${rr.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:r,fontSize:t.typography.pxToRem(12)},[`& .${rr.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${rr.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${rr.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${rr.icon}`]:S({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&S({color:t.vars?t.vars.palette.Chip.defaultIconColor:r},e.color!=="default"&&{color:"inherit"})),[`& .${rr.deleteIcon}`]:S({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:Jt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Jt(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:Jt(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>S({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>S({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${rr.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${rr.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${rr.avatar}`]:{marginLeft:4},[`& .${rr.avatarSmall}`]:{marginLeft:2},[`& .${rr.icon}`]:{marginLeft:4},[`& .${rr.iconSmall}`]:{marginLeft:2},[`& .${rr.deleteIcon}`]:{marginRight:5},[`& .${rr.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Jt(t.palette[e.color].main,.7)}`,[`&.${rr.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${rr.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:Jt(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${rr.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Jt(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),S3=K("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:r}=t,{size:i}=r;return[e.label,e[`label${Ne(i)}`]]}})(({ownerState:t})=>S({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function v1(t){return t.key==="Backspace"||t.key==="Delete"}const x3=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiChip"}),{avatar:n,className:s,clickable:a,color:o="default",component:l,deleteIcon:c,disabled:u=!1,icon:d,label:h,onClick:p,onDelete:f,onKeyDown:m,onKeyUp:y,size:v="medium",variant:g="filled",tabIndex:b,skipFocusWhenDisabled:k=!1}=i,C=le(i,b3),x=w.useRef(null),_=Wt(x,r),P=V=>{V.stopPropagation(),f&&f(V)},R=V=>{V.currentTarget===V.target&&v1(V)&&V.preventDefault(),m&&m(V)},E=V=>{V.currentTarget===V.target&&(f&&v1(V)?f(V):V.key==="Escape"&&x.current&&x.current.blur()),y&&y(V)},D=a!==!1&&p?!0:a,$=D||f?Cs:l||"div",I=S({},i,{component:$,disabled:u,size:v,color:o,iconColor:w.isValidElement(d)&&d.props.color||o,onDelete:!!f,clickable:D,variant:g}),F=v3(I),M=$===Cs?S({component:l||"div",focusVisibleClassName:F.focusVisible},f&&{disableRipple:!0}):{};let O=null;f&&(O=c&&w.isValidElement(c)?w.cloneElement(c,{className:ke(c.props.className,F.deleteIcon),onClick:P}):T.jsx(m3,{className:ke(F.deleteIcon),onClick:P}));let A=null;n&&w.isValidElement(n)&&(A=w.cloneElement(n,{className:ke(F.avatar,n.props.className)}));let N=null;return d&&w.isValidElement(d)&&(N=w.cloneElement(d,{className:ke(F.icon,d.props.className)})),T.jsxs(w3,S({as:$,className:ke(F.root,s),disabled:D&&u?!0:void 0,onClick:p,onKeyDown:R,onKeyUp:E,ref:_,tabIndex:k&&u?-1:b,ownerState:I},M,C,{children:[A||N,T.jsx(S3,{className:ke(F.label),ownerState:I,children:h}),O]}))}),k3=x3;function Jo({props:t,states:e,muiFormControl:r}){return e.reduce((i,n)=>(i[n]=t[n],r&&typeof t[n]>"u"&&(i[n]=r[n]),i),{})}const C3=w.createContext(void 0),Vg=C3;function In(){return w.useContext(Vg)}function T3(t){return T.jsx(rA,S({},t,{defaultTheme:Tg,themeId:Lh}))}function w1(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function tm(t,e=!1){return t&&(w1(t.value)&&t.value!==""||e&&w1(t.defaultValue)&&t.defaultValue!=="")}function _3(t){return t.startAdornment}function B3(t){return Ue("MuiInputBase",t)}const P3=Ge("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),su=P3,N3=["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"],$g=(t,e)=>{const{ownerState:r}=t;return[e.root,r.formControl&&e.formControl,r.startAdornment&&e.adornedStart,r.endAdornment&&e.adornedEnd,r.error&&e.error,r.size==="small"&&e.sizeSmall,r.multiline&&e.multiline,r.color&&e[`color${Ne(r.color)}`],r.fullWidth&&e.fullWidth,r.hiddenLabel&&e.hiddenLabel]},zg=(t,e)=>{const{ownerState:r}=t;return[e.input,r.size==="small"&&e.inputSizeSmall,r.multiline&&e.inputMultiline,r.type==="search"&&e.inputTypeSearch,r.startAdornment&&e.inputAdornedStart,r.endAdornment&&e.inputAdornedEnd,r.hiddenLabel&&e.inputHiddenLabel]},E3=t=>{const{classes:e,color:r,disabled:i,error:n,endAdornment:s,focused:a,formControl:o,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:d,size:h,startAdornment:p,type:f}=t,m={root:["root",`color${Ne(r)}`,i&&"disabled",n&&"error",l&&"fullWidth",a&&"focused",o&&"formControl",h&&h!=="medium"&&`size${Ne(h)}`,u&&"multiline",p&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",d&&"readOnly"],input:["input",i&&"disabled",f==="search"&&"inputTypeSearch",u&&"inputMultiline",h==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",s&&"inputAdornedEnd",d&&"readOnly"]};return ze(m,B3,e)},Wg=K("div",{name:"MuiInputBase",slot:"Root",overridesResolver:$g})(({theme:t,ownerState:e})=>S({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${su.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&S({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),Hg=K("input",{name:"MuiInputBase",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light",i=S({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),n={opacity:"0 !important"},s=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return S({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":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${su.formControl} &`]:{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":s,"&:focus::-moz-placeholder":s,"&:focus:-ms-input-placeholder":s,"&:focus::-ms-input-placeholder":s},[`&.${su.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),R3=T.jsx(T3,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),M3=w.forwardRef(function(e,r){var i;const n=Ve({props:e,name:"MuiInputBase"}),{"aria-describedby":s,autoComplete:a,autoFocus:o,className:l,components:c={},componentsProps:u={},defaultValue:d,disabled:h,disableInjectingGlobalStyles:p,endAdornment:f,fullWidth:m=!1,id:y,inputComponent:v="input",inputProps:g={},inputRef:b,maxRows:k,minRows:C,multiline:x=!1,name:_,onBlur:P,onChange:R,onClick:E,onFocus:D,onKeyDown:$,onKeyUp:I,placeholder:F,readOnly:M,renderSuffix:O,rows:A,slotProps:N={},slots:V={},startAdornment:W,type:Q="text",value:ne}=n,ie=le(n,N3),te=g.value!=null?g.value:ne,{current:j}=w.useRef(te!=null),J=w.useRef(),me=w.useCallback(ve=>{},[]),pe=Wt(J,b,g.ref,me),[De,Be]=w.useState(!1),Ce=In(),Te=Jo({props:n,muiFormControl:Ce,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Te.focused=Ce?Ce.focused:De,w.useEffect(()=>{!Ce&&h&&De&&(Be(!1),P&&P())},[Ce,h,De,P]);const X=Ce&&Ce.onFilled,ee=Ce&&Ce.onEmpty,Y=w.useCallback(ve=>{tm(ve)?X&&X():ee&&ee()},[X,ee]);zr(()=>{j&&Y({value:te})},[te,Y,j]);const Pe=ve=>{if(Te.disabled){ve.stopPropagation();return}D&&D(ve),g.onFocus&&g.onFocus(ve),Ce&&Ce.onFocus?Ce.onFocus(ve):Be(!0)},ue=ve=>{P&&P(ve),g.onBlur&&g.onBlur(ve),Ce&&Ce.onBlur?Ce.onBlur(ve):Be(!1)},L=(ve,...ce)=>{if(!j){const Qe=ve.target||J.current;if(Qe==null)throw new Error(Ja(1));Y({value:Qe.value})}g.onChange&&g.onChange(ve,...ce),R&&R(ve,...ce)};w.useEffect(()=>{Y(J.current)},[]);const U=ve=>{J.current&&ve.currentTarget===ve.target&&J.current.focus(),E&&E(ve)};let G=v,re=g;x&&G==="input"&&(A?re=S({type:void 0,minRows:A,maxRows:A},re):re=S({type:void 0,maxRows:k,minRows:C},re),G=s3);const Se=ve=>{Y(ve.animationName==="mui-auto-fill-cancel"?J.current:{value:"x"})};w.useEffect(()=>{Ce&&Ce.setAdornedStart(!!W)},[Ce,W]);const ge=S({},n,{color:Te.color||"primary",disabled:Te.disabled,endAdornment:f,error:Te.error,focused:Te.focused,formControl:Ce,fullWidth:m,hiddenLabel:Te.hiddenLabel,multiline:x,size:Te.size,startAdornment:W,type:Q}),Re=E3(ge),Ke=V.root||c.Root||Wg,ct=N.root||u.root||{},Pt=V.input||c.Input||Hg;return re=S({},re,(i=N.input)!=null?i:u.input),T.jsxs(w.Fragment,{children:[!p&&R3,T.jsxs(Ke,S({},ct,!Sa(Ke)&&{ownerState:S({},ge,ct.ownerState)},{ref:r,onClick:U},ie,{className:ke(Re.root,ct.className,l,M&&"MuiInputBase-readOnly"),children:[W,T.jsx(Vg.Provider,{value:null,children:T.jsx(Pt,S({ownerState:ge,"aria-invalid":Te.error,"aria-describedby":s,autoComplete:a,autoFocus:o,defaultValue:d,disabled:Te.disabled,id:y,onAnimationStart:Se,name:_,placeholder:F,readOnly:M,required:Te.required,rows:A,value:te,onKeyDown:$,onKeyUp:I,type:Q},re,!Sa(Pt)&&{as:G,ownerState:S({},ge,re.ownerState)},{ref:pe,className:ke(Re.input,re.className,M&&"MuiInputBase-readOnly"),onBlur:ue,onChange:L,onFocus:Pe}))}),f,O?O(S({},Te,{startAdornment:W})):null]}))]})}),eS=M3;function D3(t){return Ue("MuiInput",t)}const L3=S({},su,Ge("MuiInput",["root","underline","input"])),Yu=L3;function F3(t){return Ue("MuiOutlinedInput",t)}const I3=S({},su,Ge("MuiOutlinedInput",["root","notchedOutline","input"])),fo=I3;function O3(t){return Ue("MuiFilledInput",t)}const A3=S({},su,Ge("MuiFilledInput",["root","underline","input"])),el=A3,V3=Tr(T.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),$3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],z3={entering:{opacity:1},entered:{opacity:1}},W3=w.forwardRef(function(e,r){const i=Ko(),n={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:o,easing:l,in:c,onEnter:u,onEntered:d,onEntering:h,onExit:p,onExited:f,onExiting:m,style:y,timeout:v=n,TransitionComponent:g=Ig}=e,b=le(e,$3),k=w.useRef(null),C=Wt(k,o.ref,r),x=F=>M=>{if(F){const O=k.current;M===void 0?F(O):F(O,M)}},_=x(h),P=x((F,M)=>{Gw(F);const O=eu({style:y,timeout:v,easing:l},{mode:"enter"});F.style.webkitTransition=i.transitions.create("opacity",O),F.style.transition=i.transitions.create("opacity",O),u&&u(F,M)}),R=x(d),E=x(m),D=x(F=>{const M=eu({style:y,timeout:v,easing:l},{mode:"exit"});F.style.webkitTransition=i.transitions.create("opacity",M),F.style.transition=i.transitions.create("opacity",M),p&&p(F)}),$=x(f),I=F=>{s&&s(k.current,F)};return T.jsx(g,S({appear:a,in:c,nodeRef:k,onEnter:P,onEntered:R,onEntering:_,onExit:D,onExited:$,onExiting:E,addEndListener:I,timeout:v},b,{children:(F,M)=>w.cloneElement(o,S({style:S({opacity:0,visibility:F==="exited"&&!c?"hidden":void 0},z3[F],y,o.props.style),ref:C},M))}))}),Cu=W3;function H3(t){return Ue("MuiBackdrop",t)}Ge("MuiBackdrop",["root","invisible"]);const U3=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],G3=t=>{const{classes:e,invisible:r}=t;return ze({root:["root",r&&"invisible"]},H3,e)},j3=K("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.invisible&&e.invisible]}})(({ownerState:t})=>S({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"},t.invisible&&{backgroundColor:"transparent"})),Y3=w.forwardRef(function(e,r){var i,n,s;const a=Ve({props:e,name:"MuiBackdrop"}),{children:o,className:l,component:c="div",components:u={},componentsProps:d={},invisible:h=!1,open:p,slotProps:f={},slots:m={},TransitionComponent:y=Cu,transitionDuration:v}=a,g=le(a,U3),b=S({},a,{component:c,invisible:h}),k=G3(b),C=(i=f.root)!=null?i:d.root;return T.jsx(y,S({in:p,timeout:v},g,{children:T.jsx(j3,S({"aria-hidden":!0},C,{as:(n=(s=m.root)!=null?s:u.Root)!=null?n:c,className:ke(k.root,l,C==null?void 0:C.className),ownerState:S({},b,C==null?void 0:C.ownerState),classes:k,ref:r,children:o}))}))}),RN=Y3,X3=Ge("MuiBox",["root"]),q3=X3,K3=lN(),Q3=cA({themeId:Lh,defaultTheme:K3,defaultClassName:q3.root,generateClassName:$P.generate}),J3=Q3;function Z3(t){return Ue("MuiButton",t)}const ez=Ge("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","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Rf=ez,tz=w.createContext({}),rz=tz,iz=w.createContext(void 0),nz=iz,sz=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],az=t=>{const{color:e,disableElevation:r,fullWidth:i,size:n,variant:s,classes:a}=t,o={root:["root",s,`${s}${Ne(e)}`,`size${Ne(n)}`,`${s}Size${Ne(n)}`,`color${Ne(e)}`,r&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Ne(n)}`],endIcon:["icon","endIcon",`iconSize${Ne(n)}`]},l=ze(o,Z3,a);return S({},a,l)},MN=t=>S({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),oz=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`${r.variant}${Ne(r.color)}`],e[`size${Ne(r.size)}`],e[`${r.variant}Size${Ne(r.size)}`],r.color==="inherit"&&e.colorInherit,r.disableElevation&&e.disableElevation,r.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var r,i;const n=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],s=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return S({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":S({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:s,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":S({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${Rf.focusVisible}`]:S({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${Rf.disabled}`]:S({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${Jt(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(r=(i=t.palette).getContrastText)==null?void 0:r.call(i,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:n,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Rf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Rf.disabled}`]:{boxShadow:"none"}}),lz=K("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.startIcon,e[`iconSize${Ne(r.size)}`]]}})(({ownerState:t})=>S({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},MN(t))),cz=K("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.endIcon,e[`iconSize${Ne(r.size)}`]]}})(({ownerState:t})=>S({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},MN(t))),uz=w.forwardRef(function(e,r){const i=w.useContext(rz),n=w.useContext(nz),s=Rw(i,e),a=Ve({props:s,name:"MuiButton"}),{children:o,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:m,fullWidth:y=!1,size:v="medium",startIcon:g,type:b,variant:k="text"}=a,C=le(a,sz),x=S({},a,{color:l,component:c,disabled:d,disableElevation:h,disableFocusRipple:p,fullWidth:y,size:v,type:b,variant:k}),_=az(x),P=g&&T.jsx(lz,{className:_.startIcon,ownerState:x,children:g}),R=f&&T.jsx(cz,{className:_.endIcon,ownerState:x,children:f}),E=n||"";return T.jsxs(oz,S({ownerState:x,className:ke(i.className,_.root,u,E),component:c,disabled:d,focusRipple:!p,focusVisibleClassName:ke(_.focusVisible,m),ref:r,type:b},C,{classes:_,children:[P,o,R]}))}),$a=uz;function dz(t){return Ue("MuiCard",t)}Ge("MuiCard",["root"]);const hz=["className","raised"],fz=t=>{const{classes:e}=t;return ze({root:["root"]},dz,e)},pz=K(Xl,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),mz=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiCard"}),{className:n,raised:s=!1}=i,a=le(i,hz),o=S({},i,{raised:s}),l=fz(o);return T.jsx(pz,S({className:ke(l.root,n),elevation:s?8:void 0,ref:r,ownerState:o},a))}),gz=mz;function yz(t){return Ue("MuiCardContent",t)}Ge("MuiCardContent",["root"]);const bz=["className","component"],vz=t=>{const{classes:e}=t;return ze({root:["root"]},yz,e)},wz=K("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),Sz=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiCardContent"}),{className:n,component:s="div"}=i,a=le(i,bz),o=S({},i,{component:s}),l=vz(o);return T.jsx(wz,S({as:s,className:ke(l.root,n),ownerState:o,ref:r},a))}),lh=Sz;function xz(t){return Ue("MuiCardHeader",t)}const kz=Ge("MuiCardHeader",["root","avatar","action","content","title","subheader"]),S1=kz,Cz=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],Tz=t=>{const{classes:e}=t;return ze({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},xz,e)},_z=K("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>S({[`& .${S1.title}`]:e.title,[`& .${S1.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),Bz=K("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Pz=K("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),Nz=K("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),Ez=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiCardHeader"}),{action:n,avatar:s,className:a,component:o="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:d,titleTypographyProps:h}=i,p=le(i,Cz),f=S({},i,{component:o,disableTypography:l}),m=Tz(f);let y=d;y!=null&&y.type!==Mr&&!l&&(y=T.jsx(Mr,S({variant:s?"body2":"h5",className:m.title,component:"span",display:"block"},h,{children:y})));let v=c;return v!=null&&v.type!==Mr&&!l&&(v=T.jsx(Mr,S({variant:s?"body2":"body1",className:m.subheader,color:"text.secondary",component:"span",display:"block"},u,{children:v}))),T.jsxs(_z,S({className:ke(m.root,a),as:o,ref:r,ownerState:f},p,{children:[s&&T.jsx(Bz,{className:m.avatar,ownerState:f,children:s}),T.jsxs(Nz,{className:m.content,ownerState:f,children:[y,v]}),n&&T.jsx(Pz,{className:m.action,ownerState:f,children:n})]}))}),Rz=Ez;function Mz(t){return Ue("PrivateSwitchBase",t)}Ge("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Dz=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Lz=t=>{const{classes:e,checked:r,disabled:i,edge:n}=t,s={root:["root",r&&"checked",i&&"disabled",n&&`edge${Ne(n)}`],input:["input"]};return ze(s,Mz,e)},Fz=K(Cs)(({ownerState:t})=>S({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Iz=K("input",{shouldForwardProp:tn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Oz=w.forwardRef(function(e,r){const{autoFocus:i,checked:n,checkedIcon:s,className:a,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:d,id:h,inputProps:p,inputRef:f,name:m,onBlur:y,onChange:v,onFocus:g,readOnly:b,required:k=!1,tabIndex:C,type:x,value:_}=e,P=le(e,Dz),[R,E]=xs({controlled:n,default:!!o,name:"SwitchBase",state:"checked"}),D=In(),$=V=>{g&&g(V),D&&D.onFocus&&D.onFocus(V)},I=V=>{y&&y(V),D&&D.onBlur&&D.onBlur(V)},F=V=>{if(V.nativeEvent.defaultPrevented)return;const W=V.target.checked;E(W),v&&v(V,W)};let M=l;D&&typeof M>"u"&&(M=D.disabled);const O=x==="checkbox"||x==="radio",A=S({},e,{checked:R,disabled:M,disableFocusRipple:c,edge:u}),N=Lz(A);return T.jsxs(Fz,S({component:"span",className:ke(N.root,a),centerRipple:!0,focusRipple:!c,disabled:M,tabIndex:null,role:void 0,onFocus:$,onBlur:I,ownerState:A,ref:r},P,{children:[T.jsx(Iz,S({autoFocus:i,checked:n,defaultChecked:o,className:N.input,disabled:M,id:O?h:void 0,name:m,onChange:F,readOnly:b,ref:f,required:k,ownerState:A,tabIndex:C,type:x},x==="checkbox"&&_===void 0?{}:{value:_},p)),R?s:d]}))}),Az=Oz;function Vz(t){return Ue("MuiCircularProgress",t)}Ge("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const $z=["className","color","disableShrink","size","style","thickness","value","variant"];let Ug=t=>t,x1,k1,C1,T1;const po=44,zz=wu(x1||(x1=Ug` 0% { transform: rotate(0deg); } @@ -170,7 +170,7 @@ Error generating stack: `+s.message+` 100% { transform: rotate(360deg); } -`)),$z=wu(k1||(k1=Ug` +`)),Wz=wu(k1||(k1=Ug` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -185,11 +185,11 @@ Error generating stack: `+s.message+` stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),zz=t=>{const{classes:e,variant:r,color:i,disableShrink:n}=t,s={root:["root",r,`color${Pe(i)}`],svg:["svg"],circle:["circle",`circle${Pe(r)}`,n&&"circleDisableShrink"]};return $e(s,Oz,e)},Wz=K("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`color${Pe(r.color)}`]]}})(({ownerState:t,theme:e})=>S({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&ig(C1||(C1=Ug` +`)),Hz=t=>{const{classes:e,variant:r,color:i,disableShrink:n}=t,s={root:["root",r,`color${Ne(i)}`],svg:["svg"],circle:["circle",`circle${Ne(r)}`,n&&"circleDisableShrink"]};return ze(s,Vz,e)},Uz=K("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`color${Ne(r.color)}`]]}})(({ownerState:t,theme:e})=>S({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&ig(C1||(C1=Ug` animation: ${0} 1.4s linear infinite; - `),Vz)),Hz=K("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),Uz=K("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.circle,e[`circle${Pe(r.variant)}`],r.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>S({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&ig(T1||(T1=Ug` + `),zz)),Gz=K("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),jz=K("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.circle,e[`circle${Ne(r.variant)}`],r.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>S({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&ig(T1||(T1=Ug` animation: ${0} 1.4s ease-in-out infinite; - `),$z)),Gz=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiCircularProgress"}),{className:n,color:s="primary",disableShrink:a=!1,size:o=40,style:l,thickness:c=3.6,value:u=0,variant:d="indeterminate"}=i,h=oe(i,Az),p=S({},i,{color:s,disableShrink:a,size:o,thickness:c,value:u,variant:d}),f=zz(p),m={},y={},v={};if(d==="determinate"){const g=2*Math.PI*((fo-c)/2);m.strokeDasharray=g.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*g).toFixed(3)}px`,y.transform="rotate(-90deg)"}return T.jsx(Wz,S({className:xe(f.root,n),style:S({width:o,height:o},y,l),ownerState:p,ref:r,role:"progressbar"},v,h,{children:T.jsx(Hz,{className:f.svg,ownerState:p,viewBox:`${fo/2} ${fo/2} ${fo} ${fo}`,children:T.jsx(Uz,{className:f.circle,style:m,ownerState:p,cx:fo,cy:fo,r:(fo-c)/2,fill:"none",strokeWidth:c})})}))}),jz=Gz;function Yz(t){return He("MuiModal",t)}Ue("MuiModal",["root","hidden","backdrop"]);const Xz=["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"],qz=t=>{const{open:e,exited:r,classes:i}=t;return $e({root:["root",!e&&r&&"hidden"],backdrop:["backdrop"]},Yz,i)},Kz=K("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.open&&r.exited&&e.hidden]}})(({theme:t,ownerState:e})=>S({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),Qz=K(RN,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Jz=w.forwardRef(function(e,r){var i,n,s,a,o,l;const c=Ae({name:"MuiModal",props:e}),{BackdropComponent:u=Qz,BackdropProps:d,className:h,closeAfterTransition:p=!1,children:f,container:m,component:y,components:v={},componentsProps:g={},disableAutoFocus:b=!1,disableEnforceFocus:k=!1,disableEscapeKeyDown:C=!1,disablePortal:x=!1,disableRestoreFocus:_=!1,disableScrollLock:P=!1,hideBackdrop:R=!1,keepMounted:E=!1,onBackdropClick:D,open:$,slotProps:I,slots:F}=c,M=oe(c,Xz),O=S({},c,{closeAfterTransition:p,disableAutoFocus:b,disableEnforceFocus:k,disableEscapeKeyDown:C,disablePortal:x,disableRestoreFocus:_,disableScrollLock:P,hideBackdrop:R,keepMounted:E}),{getRootProps:A,getBackdropProps:N,getTransitionProps:V,portalRef:W,isTopModal:Q,exited:ne,hasTransition:ie}=R$(S({},O,{rootRef:r})),te=S({},O,{exited:ne}),j=qz(te),J={};if(f.props.tabIndex===void 0&&(J.tabIndex="-1"),ie){const{onEnter:X,onExited:ee}=V();J.onEnter=X,J.onExited=ee}const pe=(i=(n=F==null?void 0:F.root)!=null?n:v.Root)!=null?i:Kz,fe=(s=(a=F==null?void 0:F.backdrop)!=null?a:v.Backdrop)!=null?s:u,Me=(o=I==null?void 0:I.root)!=null?o:g.root,_e=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,ke=Ct({elementType:pe,externalSlotProps:Me,externalForwardedProps:M,getSlotProps:A,additionalProps:{ref:r,as:y},ownerState:te,className:xe(h,Me==null?void 0:Me.className,j==null?void 0:j.root,!te.open&&te.exited&&(j==null?void 0:j.hidden))}),Ce=Ct({elementType:fe,externalSlotProps:_e,additionalProps:d,getSlotProps:X=>N(S({},X,{onClick:ee=>{D&&D(ee),X!=null&&X.onClick&&X.onClick(ee)}})),className:xe(_e==null?void 0:_e.className,d==null?void 0:d.className,j==null?void 0:j.backdrop),ownerState:te});return!E&&!$&&(!ie||ne)?null:T.jsx(yN,{ref:W,container:m,disablePortal:x,children:T.jsxs(pe,S({},ke,{children:[!R&&u?T.jsx(fe,S({},Ce)):null,T.jsx(gN,{disableEnforceFocus:k,disableAutoFocus:b,disableRestoreFocus:_,isEnabled:Q,open:$,children:w.cloneElement(f,J)})]}))})}),tS=Jz;function Zz(t){return He("MuiDialog",t)}const eW=Ue("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Ed=eW,tW=w.createContext({}),DN=tW,rW=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],iW=K(RN,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),nW=t=>{const{classes:e,scroll:r,maxWidth:i,fullWidth:n,fullScreen:s}=t,a={root:["root"],container:["container",`scroll${Pe(r)}`],paper:["paper",`paperScroll${Pe(r)}`,`paperWidth${Pe(String(i))}`,n&&"paperFullWidth",s&&"paperFullScreen"]};return $e(a,Zz,e)},sW=K(tS,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),aW=K("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.container,e[`scroll${Pe(r.scroll)}`]]}})(({ownerState:t})=>S({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),oW=K(Xl,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`scrollPaper${Pe(r.scroll)}`],e[`paperWidth${Pe(String(r.maxWidth))}`],r.fullWidth&&e.paperFullWidth,r.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>S({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${Ed.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${Ed.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Ed.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),lW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDialog"}),n=qo(),s={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,BackdropComponent:l,BackdropProps:c,children:u,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:m="sm",onBackdropClick:y,onClose:v,open:g,PaperComponent:b=Xl,PaperProps:k={},scroll:C="paper",TransitionComponent:x=Cu,transitionDuration:_=s,TransitionProps:P}=i,R=oe(i,rW),E=S({},i,{disableEscapeKeyDown:h,fullScreen:p,fullWidth:f,maxWidth:m,scroll:C}),D=nW(E),$=w.useRef(),I=A=>{$.current=A.target===A.currentTarget},F=A=>{$.current&&($.current=null,y&&y(A),v&&v(A,"backdropClick"))},M=ia(o),O=w.useMemo(()=>({titleId:M}),[M]);return T.jsx(sW,S({className:xe(D.root,d),closeAfterTransition:!0,components:{Backdrop:iW},componentsProps:{backdrop:S({transitionDuration:_,as:l},c)},disableEscapeKeyDown:h,onClose:v,open:g,ref:r,onClick:F,ownerState:E},R,{children:T.jsx(x,S({appear:!0,in:g,timeout:_,role:"presentation"},P,{children:T.jsx(aW,{className:xe(D.container),onMouseDown:I,ownerState:E,children:T.jsx(oW,S({as:b,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":M},k,{className:xe(D.paper,k.className),ownerState:E,children:T.jsx(DN.Provider,{value:O,children:u})}))})}))}))}),Gg=lW;function cW(t){return He("MuiDialogActions",t)}Ue("MuiDialogActions",["root","spacing"]);const uW=["className","disableSpacing"],dW=t=>{const{classes:e,disableSpacing:r}=t;return $e({root:["root",!r&&"spacing"]},cW,e)},hW=K("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableSpacing&&e.spacing]}})(({ownerState:t})=>S({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),fW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:s=!1}=i,a=oe(i,uW),o=S({},i,{disableSpacing:s}),l=dW(o);return T.jsx(hW,S({className:xe(l.root,n),ownerState:o,ref:r},a))}),LN=fW;function pW(t){return He("MuiDialogContent",t)}Ue("MuiDialogContent",["root","dividers"]);function mW(t){return He("MuiDialogTitle",t)}const gW=Ue("MuiDialogTitle",["root"]),yW=gW,bW=["className","dividers"],vW=t=>{const{classes:e,dividers:r}=t;return $e({root:["root",r&&"dividers"]},pW,e)},wW=K("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>S({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${yW.root} + &`]:{paddingTop:0}})),SW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDialogContent"}),{className:n,dividers:s=!1}=i,a=oe(i,bW),o=S({},i,{dividers:s}),l=vW(o);return T.jsx(wW,S({className:xe(l.root,n),ownerState:o,ref:r},a))}),FN=SW,xW=["className","id"],kW=t=>{const{classes:e}=t;return $e({root:["root"]},mW,e)},CW=K(Mr,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),TW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDialogTitle"}),{className:n,id:s}=i,a=oe(i,xW),o=i,l=kW(o),{titleId:c=s}=w.useContext(DN);return T.jsx(CW,S({component:"h2",className:xe(l.root,n),ownerState:o,ref:r,variant:"h6",id:s??c},a))}),IN=TW;function _W(t){return He("MuiDivider",t)}const _1=Ue("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),BW=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],PW=t=>{const{absolute:e,children:r,classes:i,flexItem:n,light:s,orientation:a,textAlign:o,variant:l}=t;return $e({root:["root",e&&"absolute",l,s&&"light",a==="vertical"&&"vertical",n&&"flexItem",r&&"withChildren",r&&a==="vertical"&&"withChildrenVertical",o==="right"&&a!=="vertical"&&"textAlignRight",o==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},_W,i)},NW=K("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.absolute&&e.absolute,e[r.variant],r.light&&e.light,r.orientation==="vertical"&&e.vertical,r.flexItem&&e.flexItem,r.children&&e.withChildren,r.children&&r.orientation==="vertical"&&e.withChildrenVertical,r.textAlign==="right"&&r.orientation!=="vertical"&&e.textAlignRight,r.textAlign==="left"&&r.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>S({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Jt(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>S({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>S({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>S({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>S({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),EW=K("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.wrapper,r.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>S({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),ON=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDivider"}),{absolute:n=!1,children:s,className:a,component:o=s?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:d=o!=="hr"?"separator":void 0,textAlign:h="center",variant:p="fullWidth"}=i,f=oe(i,BW),m=S({},i,{absolute:n,component:o,flexItem:l,light:c,orientation:u,role:d,textAlign:h,variant:p}),y=PW(m);return T.jsx(NW,S({as:o,className:xe(y.root,a),role:d,ref:r,ownerState:m},f,{children:s?T.jsx(EW,{className:y.wrapper,ownerState:m,children:s}):null}))});ON.muiSkipListHighlight=!0;const B1=ON,RW=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function MW(t,e,r){const i=e.getBoundingClientRect(),n=r&&r.getBoundingClientRect(),s=ea(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=s.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let o=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");o=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?n?`translateX(${n.right+o-i.left}px)`:`translateX(${s.innerWidth+o-i.left}px)`:t==="right"?n?`translateX(-${i.right-n.left-o}px)`:`translateX(-${i.left+i.width-o}px)`:t==="up"?n?`translateY(${n.bottom+l-i.top}px)`:`translateY(${s.innerHeight+l-i.top}px)`:n?`translateY(-${i.top-n.top+i.height-l}px)`:`translateY(-${i.top+i.height-l}px)`}function DW(t){return typeof t=="function"?t():t}function Mf(t,e,r){const i=DW(r),n=MW(t,e,i);n&&(e.style.webkitTransform=n,e.style.transform=n)}const LW=w.forwardRef(function(e,r){const i=qo(),n={enter:i.transitions.easing.easeOut,exit:i.transitions.easing.sharp},s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:l,container:c,direction:u="down",easing:d=n,in:h,onEnter:p,onEntered:f,onEntering:m,onExit:y,onExited:v,onExiting:g,style:b,timeout:k=s,TransitionComponent:C=Ig}=e,x=oe(e,RW),_=w.useRef(null),P=Wt(l.ref,_,r),R=N=>V=>{N&&(V===void 0?N(_.current):N(_.current,V))},E=R((N,V)=>{Mf(u,N,c),Gw(N),p&&p(N,V)}),D=R((N,V)=>{const W=eu({timeout:k,style:b,easing:d},{mode:"enter"});N.style.webkitTransition=i.transitions.create("-webkit-transform",S({},W)),N.style.transition=i.transitions.create("transform",S({},W)),N.style.webkitTransform="none",N.style.transform="none",m&&m(N,V)}),$=R(f),I=R(g),F=R(N=>{const V=eu({timeout:k,style:b,easing:d},{mode:"exit"});N.style.webkitTransition=i.transitions.create("-webkit-transform",V),N.style.transition=i.transitions.create("transform",V),Mf(u,N,c),y&&y(N)}),M=R(N=>{N.style.webkitTransition="",N.style.transition="",v&&v(N)}),O=N=>{a&&a(_.current,N)},A=w.useCallback(()=>{_.current&&Mf(u,_.current,c)},[u,c]);return w.useEffect(()=>{if(h||u==="down"||u==="right")return;const N=Vh(()=>{_.current&&Mf(u,_.current,c)}),V=ea(_.current);return V.addEventListener("resize",N),()=>{N.clear(),V.removeEventListener("resize",N)}},[u,h,c]),w.useEffect(()=>{h||A()},[h,A]),T.jsx(C,S({nodeRef:_,onEnter:E,onEntered:$,onEntering:D,onExit:F,onExited:M,onExiting:I,addEndListener:O,appear:o,in:h,timeout:k},x,{children:(N,V)=>w.cloneElement(l,S({ref:P,style:S({visibility:N==="exited"&&!h?"hidden":void 0},b,l.props.style)},V))}))}),FW=LW;function IW(t){return He("MuiDrawer",t)}Ue("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const OW=["BackdropProps"],AW=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],AN=(t,e)=>{const{ownerState:r}=t;return[e.root,(r.variant==="permanent"||r.variant==="persistent")&&e.docked,e.modal]},VW=t=>{const{classes:e,anchor:r,variant:i}=t,n={root:["root"],docked:[(i==="permanent"||i==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Pe(r)}`,i!=="temporary"&&`paperAnchorDocked${Pe(r)}`]};return $e(n,IW,e)},$W=K(tS,{name:"MuiDrawer",slot:"Root",overridesResolver:AN})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),P1=K("div",{shouldForwardProp:tn,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:AN})({flex:"0 0 auto"}),zW=K(Xl,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`paperAnchor${Pe(r.anchor)}`],r.variant!=="temporary"&&e[`paperAnchorDocked${Pe(r.anchor)}`]]}})(({theme:t,ownerState:e})=>S({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},e.anchor==="left"&&{left:0},e.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="right"&&{right:0},e.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="left"&&e.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="top"&&e.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="right"&&e.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="bottom"&&e.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),VN={left:"right",right:"left",top:"down",bottom:"up"};function WW(t){return["left","right"].indexOf(t)!==-1}function HW({direction:t},e){return t==="rtl"&&WW(e)?VN[e]:e}const UW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDrawer"}),n=qo(),s=Xi(),a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{anchor:o="left",BackdropProps:l,children:c,className:u,elevation:d=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:p}={},onClose:f,open:m=!1,PaperProps:y={},SlideProps:v,TransitionComponent:g=FW,transitionDuration:b=a,variant:k="temporary"}=i,C=oe(i.ModalProps,OW),x=oe(i,AW),_=w.useRef(!1);w.useEffect(()=>{_.current=!0},[]);const P=HW({direction:s?"rtl":"ltr"},o),E=S({},i,{anchor:o,elevation:d,open:m,variant:k},x),D=VW(E),$=T.jsx(zW,S({elevation:k==="temporary"?d:0,square:!0},y,{className:xe(D.paper,y.className),ownerState:E,children:c}));if(k==="permanent")return T.jsx(P1,S({className:xe(D.root,D.docked,u),ownerState:E,ref:r},x,{children:$}));const I=T.jsx(g,S({in:m,direction:VN[P],timeout:b,appear:_.current},v,{children:$}));return k==="persistent"?T.jsx(P1,S({className:xe(D.root,D.docked,u),ownerState:E,ref:r},x,{children:I})):T.jsx($W,S({BackdropProps:S({},l,p,{transitionDuration:b}),className:xe(D.root,D.modal,u),open:m,ownerState:E,onClose:f,hideBackdrop:h,ref:r},x,C,{children:I}))}),GW=UW;function jW(t){return He("MuiFab",t)}const YW=Ue("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),N1=YW,XW=["children","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"],qW=t=>{const{color:e,variant:r,classes:i,size:n}=t,s={root:["root",r,`size${Pe(n)}`,e==="inherit"?"colorInherit":e]},a=$e(s,jW,i);return S({},i,a)},KW=K(Cs,{name:"MuiFab",slot:"Root",shouldForwardProp:t=>tn(t)||t==="classes",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`size${Pe(r.size)}`],r.color==="inherit"&&e.colorInherit,e[Pe(r.size)],e[r.color]]}})(({theme:t,ownerState:e})=>{var r,i;return S({},t.typography.button,{minHeight:36,transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(t.vars||t).zIndex.fab,boxShadow:(t.vars||t).shadows[6],"&:active":{boxShadow:(t.vars||t).shadows[12]},color:t.vars?t.vars.palette.text.primary:(r=(i=t.palette).getContrastText)==null?void 0:r.call(i,t.palette.grey[300]),backgroundColor:(t.vars||t).palette.grey[300],"&:hover":{backgroundColor:(t.vars||t).palette.grey.A100,"@media (hover: none)":{backgroundColor:(t.vars||t).palette.grey[300]},textDecoration:"none"},[`&.${N1.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]}},e.size==="small"&&{width:40,height:40},e.size==="medium"&&{width:48,height:48},e.variant==="extended"&&{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48},e.variant==="extended"&&e.size==="small"&&{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34},e.variant==="extended"&&e.size==="medium"&&{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40},e.color==="inherit"&&{color:"inherit"})},({theme:t,ownerState:e})=>S({},e.color!=="inherit"&&e.color!=="default"&&(t.vars||t).palette[e.color]!=null&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}}),({theme:t})=>({[`&.${N1.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}})),QW=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiFab"}),{children:n,className:s,color:a="default",component:o="button",disabled:l=!1,disableFocusRipple:c=!1,focusVisibleClassName:u,size:d="large",variant:h="circular"}=i,p=oe(i,XW),f=S({},i,{color:a,component:o,disabled:l,disableFocusRipple:c,size:d,variant:h}),m=qW(f);return T.jsx(KW,S({className:xe(m.root,s),component:o,disabled:l,focusRipple:!c,focusVisibleClassName:xe(m.focusVisible,u),ownerState:f,ref:r},p,{classes:m,children:n}))}),JW=QW,ZW=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],e6=t=>{const{classes:e,disableUnderline:r}=t,n=$e({root:["root",!r&&"underline"],input:["input"]},F3,e);return S({},e,n)},t6=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...$g(t,e),!r.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var r;const i=t.palette.mode==="light",n=i?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",s=i?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=i?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=i?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return S({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s}},[`&.${Zo.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s},[`&.${Zo.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(r=(t.vars||t).palette[e.color||"primary"])==null?void 0:r.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Zo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Zo.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Zo.disabled}, .${Zo.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${Zo.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&S({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),r6=K(Hg,{name:"MuiFilledInput",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>S({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),$N=w.forwardRef(function(e,r){var i,n,s,a;const o=Ae({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:d="input",multiline:h=!1,slotProps:p,slots:f={},type:m="text"}=o,y=oe(o,ZW),v=S({},o,{fullWidth:u,inputComponent:d,multiline:h,type:m}),g=e6(o),b={root:{ownerState:v},input:{ownerState:v}},k=p??c?gn(b,p??c):b,C=(i=(n=f.root)!=null?n:l.Root)!=null?i:t6,x=(s=(a=f.input)!=null?a:l.Input)!=null?s:r6;return T.jsx(eS,S({slots:{root:C,input:x},componentsProps:k,fullWidth:u,inputComponent:d,multiline:h,ref:r,type:m},y,{classes:g}))});$N.muiName="Input";const zN=$N;function i6(t){return He("MuiFormControl",t)}Ue("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const n6=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],s6=t=>{const{classes:e,margin:r,fullWidth:i}=t,n={root:["root",r!=="none"&&`margin${Pe(r)}`,i&&"fullWidth"]};return $e(n,i6,e)},a6=K("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>S({},e.root,e[`margin${Pe(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>S({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),o6=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiFormControl"}),{children:n,className:s,color:a="primary",component:o="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:d=!1,hiddenLabel:h=!1,margin:p="none",required:f=!1,size:m="medium",variant:y="outlined"}=i,v=oe(i,n6),g=S({},i,{color:a,component:o,disabled:l,error:c,fullWidth:d,hiddenLabel:h,margin:p,required:f,size:m,variant:y}),b=s6(g),[k,C]=w.useState(()=>{let I=!1;return n&&w.Children.forEach(n,F=>{if(!fp(F,["Input","Select"]))return;const M=fp(F,["Select"])?F.props.input:F;M&&C3(M.props)&&(I=!0)}),I}),[x,_]=w.useState(()=>{let I=!1;return n&&w.Children.forEach(n,F=>{fp(F,["Input","Select"])&&(tm(F.props,!0)||tm(F.props.inputProps,!0))&&(I=!0)}),I}),[P,R]=w.useState(!1);l&&P&&R(!1);const E=u!==void 0&&!l?u:P;let D;const $=w.useMemo(()=>({adornedStart:k,setAdornedStart:C,color:a,disabled:l,error:c,filled:x,focused:E,fullWidth:d,hiddenLabel:h,size:m,onBlur:()=>{R(!1)},onEmpty:()=>{_(!1)},onFilled:()=>{_(!0)},onFocus:()=>{R(!0)},registerEffect:D,required:f,variant:y}),[k,a,l,c,x,E,d,h,D,f,m,y]);return T.jsx(Vg.Provider,{value:$,children:T.jsx(a6,S({as:o,ownerState:g,className:xe(b.root,s),ref:r},v,{children:n}))})}),WN=o6,l6=QA({createStyledComponent:K("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>Ae({props:t,name:"MuiStack"})}),c6=l6;function u6(t){return He("MuiFormControlLabel",t)}const d6=Ue("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),dd=d6,h6=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],f6=t=>{const{classes:e,disabled:r,labelPlacement:i,error:n,required:s}=t,a={root:["root",r&&"disabled",`labelPlacement${Pe(i)}`,n&&"error",s&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",n&&"error"]};return $e(a,u6,e)},p6=K("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${dd.label}`]:e.label},e.root,e[`labelPlacement${Pe(r.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${dd.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${dd.label}`]:{[`&.${dd.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),m6=K("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${dd.error}`]:{color:(t.vars||t).palette.error.main}})),g6=w.forwardRef(function(e,r){var i,n;const s=Ae({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:o={},control:l,disabled:c,disableTypography:u,label:d,labelPlacement:h="end",required:p,slotProps:f={}}=s,m=oe(s,h6),y=In(),v=(i=c??l.props.disabled)!=null?i:y==null?void 0:y.disabled,g=p??l.props.required,b={disabled:v,required:g};["checked","name","onChange","value","inputRef"].forEach(R=>{typeof l.props[R]>"u"&&typeof s[R]<"u"&&(b[R]=s[R])});const k=Qo({props:s,muiFormControl:y,states:["error"]}),C=S({},s,{disabled:v,labelPlacement:h,required:g,error:k.error}),x=f6(C),_=(n=f.typography)!=null?n:o.typography;let P=d;return P!=null&&P.type!==Mr&&!u&&(P=T.jsx(Mr,S({component:"span"},_,{className:xe(x.label,_==null?void 0:_.className),children:P}))),T.jsxs(p6,S({className:xe(x.root,a),ownerState:C,ref:r},m,{children:[w.cloneElement(l,b),g?T.jsxs(c6,{display:"block",children:[P,T.jsxs(m6,{ownerState:C,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]}):P]}))}),y6=g6;function b6(t){return He("MuiFormGroup",t)}Ue("MuiFormGroup",["root","row","error"]);const v6=["className","row"],w6=t=>{const{classes:e,row:r,error:i}=t;return $e({root:["root",r&&"row",i&&"error"]},b6,e)},S6=K("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.row&&e.row]}})(({ownerState:t})=>S({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),x6=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiFormGroup"}),{className:n,row:s=!1}=i,a=oe(i,v6),o=In(),l=Qo({props:i,muiFormControl:o,states:["error"]}),c=S({},i,{row:s,error:l.error}),u=w6(c);return T.jsx(S6,S({className:xe(u.root,n),ownerState:c,ref:r},a))}),k6=x6;function C6(t){return He("MuiFormHelperText",t)}const T6=Ue("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),E1=T6;var R1;const _6=["children","className","component","disabled","error","filled","focused","margin","required","variant"],B6=t=>{const{classes:e,contained:r,size:i,disabled:n,error:s,filled:a,focused:o,required:l}=t,c={root:["root",n&&"disabled",s&&"error",i&&`size${Pe(i)}`,r&&"contained",o&&"focused",a&&"filled",l&&"required"]};return $e(c,C6,e)},P6=K("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.size&&e[`size${Pe(r.size)}`],r.contained&&e.contained,r.filled&&e.filled]}})(({theme:t,ownerState:e})=>S({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${E1.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${E1.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),N6=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiFormHelperText"}),{children:n,className:s,component:a="p"}=i,o=oe(i,_6),l=In(),c=Qo({props:i,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=S({},i,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),d=B6(u);return T.jsx(P6,S({as:a,ownerState:u,className:xe(d.root,s),ref:r},o,{children:n===" "?R1||(R1=T.jsx("span",{className:"notranslate",children:"​"})):n}))}),HN=N6;function E6(t){return He("MuiFormLabel",t)}const R6=Ue("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Rd=R6,M6=["children","className","color","component","disabled","error","filled","focused","required"],D6=t=>{const{classes:e,color:r,focused:i,disabled:n,error:s,filled:a,required:o}=t,l={root:["root",`color${Pe(r)}`,n&&"disabled",s&&"error",a&&"filled",i&&"focused",o&&"required"],asterisk:["asterisk",s&&"error"]};return $e(l,E6,e)},L6=K("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>S({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>S({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Rd.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Rd.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Rd.error}`]:{color:(t.vars||t).palette.error.main}})),F6=K("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Rd.error}`]:{color:(t.vars||t).palette.error.main}})),I6=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiFormLabel"}),{children:n,className:s,component:a="label"}=i,o=oe(i,M6),l=In(),c=Qo({props:i,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=S({},i,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),d=D6(u);return T.jsxs(L6,S({as:a,ownerState:u,className:xe(d.root,s),ref:r},o,{children:[n,c.required&&T.jsxs(F6,{ownerState:u,"aria-hidden":!0,className:d.asterisk,children:[" ","*"]})]}))}),O6=I6,A6=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function X0(t){return`scale(${t}, ${t**2})`}const V6={entering:{opacity:1,transform:X0(1)},entered:{opacity:1,transform:"none"}},Xy=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),UN=w.forwardRef(function(e,r){const{addEndListener:i,appear:n=!0,children:s,easing:a,in:o,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:h,onExiting:p,style:f,timeout:m="auto",TransitionComponent:y=Ig}=e,v=oe(e,A6),g=QP(),b=w.useRef(),k=qo(),C=w.useRef(null),x=Wt(C,s.ref,r),_=M=>O=>{if(M){const A=C.current;O===void 0?M(A):M(A,O)}},P=_(u),R=_((M,O)=>{Gw(M);const{duration:A,delay:N,easing:V}=eu({style:f,timeout:m,easing:a},{mode:"enter"});let W;m==="auto"?(W=k.transitions.getAutoHeightDuration(M.clientHeight),b.current=W):W=A,M.style.transition=[k.transitions.create("opacity",{duration:W,delay:N}),k.transitions.create("transform",{duration:Xy?W:W*.666,delay:N,easing:V})].join(","),l&&l(M,O)}),E=_(c),D=_(p),$=_(M=>{const{duration:O,delay:A,easing:N}=eu({style:f,timeout:m,easing:a},{mode:"exit"});let V;m==="auto"?(V=k.transitions.getAutoHeightDuration(M.clientHeight),b.current=V):V=O,M.style.transition=[k.transitions.create("opacity",{duration:V,delay:A}),k.transitions.create("transform",{duration:Xy?V:V*.666,delay:Xy?A:A||V*.333,easing:N})].join(","),M.style.opacity=0,M.style.transform=X0(.75),d&&d(M)}),I=_(h),F=M=>{m==="auto"&&g.start(b.current||0,M),i&&i(C.current,M)};return T.jsx(y,S({appear:n,in:o,nodeRef:C,onEnter:R,onEntered:E,onEntering:P,onExit:$,onExited:I,onExiting:D,addEndListener:F,timeout:m==="auto"?null:m},v,{children:(M,O)=>w.cloneElement(s,S({style:S({opacity:0,transform:X0(.75),visibility:M==="exited"&&!o?"hidden":void 0},V6[M],f,s.props.style),ref:x},O))}))});UN.muiSupportAuto=!0;const GN=UN,$6=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],z6=t=>{const{classes:e,disableUnderline:r}=t,n=$e({root:["root",!r&&"underline"],input:["input"]},R3,e);return S({},e,n)},W6=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...$g(t,e),!r.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let i=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(i=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),S({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Yu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Yu.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Yu.disabled}, .${Yu.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${i}`}},[`&.${Yu.disabled}:before`]:{borderBottomStyle:"dotted"}})}),H6=K(Hg,{name:"MuiInput",slot:"Input",overridesResolver:zg})({}),jN=w.forwardRef(function(e,r){var i,n,s,a;const o=Ae({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:d=!1,inputComponent:h="input",multiline:p=!1,slotProps:f,slots:m={},type:y="text"}=o,v=oe(o,$6),g=z6(o),k={root:{ownerState:{disableUnderline:l}}},C=f??u?gn(f??u,k):k,x=(i=(n=m.root)!=null?n:c.Root)!=null?i:W6,_=(s=(a=m.input)!=null?a:c.Input)!=null?s:H6;return T.jsx(eS,S({slots:{root:x,input:_},slotProps:C,fullWidth:d,inputComponent:h,multiline:p,ref:r,type:y},v,{classes:g}))});jN.muiName="Input";const rS=jN;function U6(t){return He("MuiInputAdornment",t)}const G6=Ue("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),M1=G6;var D1;const j6=["children","className","component","disablePointerEvents","disableTypography","position","variant"],Y6=(t,e)=>{const{ownerState:r}=t;return[e.root,e[`position${Pe(r.position)}`],r.disablePointerEvents===!0&&e.disablePointerEvents,e[r.variant]]},X6=t=>{const{classes:e,disablePointerEvents:r,hiddenLabel:i,position:n,size:s,variant:a}=t,o={root:["root",r&&"disablePointerEvents",n&&`position${Pe(n)}`,a,i&&"hiddenLabel",s&&`size${Pe(s)}`]};return $e(o,U6,e)},q6=K("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Y6})(({theme:t,ownerState:e})=>S({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${M1.positionStart}&:not(.${M1.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),K6=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiInputAdornment"}),{children:n,className:s,component:a="div",disablePointerEvents:o=!1,disableTypography:l=!1,position:c,variant:u}=i,d=oe(i,j6),h=In()||{};let p=u;u&&h.variant,h&&!p&&(p=h.variant);const f=S({},i,{hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:o,position:c,variant:p}),m=X6(f);return T.jsx(Vg.Provider,{value:null,children:T.jsx(q6,S({as:a,ownerState:f,className:xe(m.root,s),ref:r},d,{children:typeof n=="string"&&!l?T.jsx(Mr,{color:"text.secondary",children:n}):T.jsxs(w.Fragment,{children:[c==="start"?D1||(D1=T.jsx("span",{className:"notranslate",children:"​"})):null,n]})}))})}),YN=K6;function Q6(t){return He("MuiInputLabel",t)}Ue("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const J6=["disableAnimation","margin","shrink","variant","className"],Z6=t=>{const{classes:e,formControl:r,size:i,shrink:n,disableAnimation:s,variant:a,required:o}=t,l={root:["root",r&&"formControl",!s&&"animated",n&&"shrink",i&&i!=="normal"&&`size${Pe(i)}`,a],asterisk:[o&&"asterisk"]},c=$e(l,Q6,e);return S({},e,c)},eH=K(O6,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Rd.asterisk}`]:e.asterisk},e.root,r.formControl&&e.formControl,r.size==="small"&&e.sizeSmall,r.shrink&&e.shrink,!r.disableAnimation&&e.animated,r.focused&&e.focused,e[r.variant]]}})(({theme:t,ownerState:e})=>S({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&S({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&S({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&S({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),tH=w.forwardRef(function(e,r){const i=Ae({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,shrink:s,className:a}=i,o=oe(i,J6),l=In();let c=s;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=Qo({props:i,muiFormControl:l,states:["size","variant","required","focused"]}),d=S({},i,{disableAnimation:n,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),h=Z6(d);return T.jsx(eH,S({"data-shrink":c,ownerState:d,ref:r,className:xe(h.root,a)},o,{classes:h}))}),XN=tH,rH=w.createContext({}),Ks=rH;function iH(t){return He("MuiList",t)}Ue("MuiList",["root","padding","dense","subheader"]);const nH=["children","className","component","dense","disablePadding","subheader"],sH=t=>{const{classes:e,disablePadding:r,dense:i,subheader:n}=t;return $e({root:["root",!r&&"padding",i&&"dense",n&&"subheader"]},iH,e)},aH=K("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disablePadding&&e.padding,r.dense&&e.dense,r.subheader&&e.subheader]}})(({ownerState:t})=>S({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),oH=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiList"}),{children:n,className:s,component:a="ul",dense:o=!1,disablePadding:l=!1,subheader:c}=i,u=oe(i,nH),d=w.useMemo(()=>({dense:o}),[o]),h=S({},i,{component:a,dense:o,disablePadding:l}),p=sH(h);return T.jsx(Ks.Provider,{value:d,children:T.jsxs(aH,S({as:a,className:xe(p.root,s),ref:r,ownerState:h},u,{children:[c,n]}))})}),Gh=oH;function lH(t){return He("MuiListItem",t)}const cH=Ue("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),fc=cH;function uH(t){return He("MuiListItemButton",t)}const dH=Ue("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),pc=dH,hH=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],fH=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.alignItems==="flex-start"&&e.alignItemsFlexStart,r.divider&&e.divider,!r.disableGutters&&e.gutters]},pH=t=>{const{alignItems:e,classes:r,dense:i,disabled:n,disableGutters:s,divider:a,selected:o}=t,c=$e({root:["root",i&&"dense",!s&&"gutters",a&&"divider",n&&"disabled",e==="flex-start"&&"alignItemsFlexStart",o&&"selected"]},uH,r);return S({},r,c)},mH=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:fH})(({theme:t,ownerState:e})=>S({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${pc.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${pc.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${pc.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${pc.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${pc.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),gH=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiListItemButton"}),{alignItems:n="center",autoFocus:s=!1,component:a="div",children:o,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:d,selected:h=!1,className:p}=i,f=oe(i,hH),m=w.useContext(Ks),y=w.useMemo(()=>({dense:l||m.dense||!1,alignItems:n,disableGutters:c}),[n,m.dense,l,c]),v=w.useRef(null);zr(()=>{s&&v.current&&v.current.focus()},[s]);const g=S({},i,{alignItems:n,dense:y.dense,disableGutters:c,divider:u,selected:h}),b=pH(g),k=Wt(v,r);return T.jsx(Ks.Provider,{value:y,children:T.jsx(mH,S({ref:k,href:f.href||f.to,component:(f.href||f.to)&&a==="div"?"button":a,focusVisibleClassName:xe(b.focusVisible,d),ownerState:g,className:xe(b.root,p)},f,{classes:b,children:o}))})}),el=gH;function yH(t){return He("MuiListItemSecondaryAction",t)}Ue("MuiListItemSecondaryAction",["root","disableGutters"]);const bH=["className"],vH=t=>{const{disableGutters:e,classes:r}=t;return $e({root:["root",e&&"disableGutters"]},yH,r)},wH=K("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.disableGutters&&e.disableGutters]}})(({ownerState:t})=>S({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),qN=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiListItemSecondaryAction"}),{className:n}=i,s=oe(i,bH),a=w.useContext(Ks),o=S({},i,{disableGutters:a.disableGutters}),l=vH(o);return T.jsx(wH,S({className:xe(l.root,n),ownerState:o,ref:r},s))});qN.muiName="ListItemSecondaryAction";const SH=qN,xH=["className"],kH=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],CH=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.alignItems==="flex-start"&&e.alignItemsFlexStart,r.divider&&e.divider,!r.disableGutters&&e.gutters,!r.disablePadding&&e.padding,r.button&&e.button,r.hasSecondaryAction&&e.secondaryAction]},TH=t=>{const{alignItems:e,button:r,classes:i,dense:n,disabled:s,disableGutters:a,disablePadding:o,divider:l,hasSecondaryAction:c,selected:u}=t;return $e({root:["root",n&&"dense",!a&&"gutters",!o&&"padding",l&&"divider",s&&"disabled",r&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},lH,i)},_H=K("div",{name:"MuiListItem",slot:"Root",overridesResolver:CH})(({theme:t,ownerState:e})=>S({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&S({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${pc.root}`]:{paddingRight:48}},{[`&.${fc.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${fc.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${fc.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${fc.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fc.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),BH=K("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),PH=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiListItem"}),{alignItems:n="center",autoFocus:s=!1,button:a=!1,children:o,className:l,component:c,components:u={},componentsProps:d={},ContainerComponent:h="li",ContainerProps:{className:p}={},dense:f=!1,disabled:m=!1,disableGutters:y=!1,disablePadding:v=!1,divider:g=!1,focusVisibleClassName:b,secondaryAction:k,selected:C=!1,slotProps:x={},slots:_={}}=i,P=oe(i.ContainerProps,xH),R=oe(i,kH),E=w.useContext(Ks),D=w.useMemo(()=>({dense:f||E.dense||!1,alignItems:n,disableGutters:y}),[n,E.dense,f,y]),$=w.useRef(null);zr(()=>{s&&$.current&&$.current.focus()},[s]);const I=w.Children.toArray(o),F=I.length&&fp(I[I.length-1],["ListItemSecondaryAction"]),M=S({},i,{alignItems:n,autoFocus:s,button:a,dense:D.dense,disabled:m,disableGutters:y,disablePadding:v,divider:g,hasSecondaryAction:F,selected:C}),O=TH(M),A=Wt($,r),N=_.root||u.Root||_H,V=x.root||d.root||{},W=S({className:xe(O.root,V.className,l),disabled:m},R);let Q=c||"li";return a&&(W.component=c||"div",W.focusVisibleClassName=xe(fc.focusVisible,b),Q=Cs),F?(Q=!W.component&&!c?"div":Q,h==="li"&&(Q==="li"?Q="div":W.component==="li"&&(W.component="div")),T.jsx(Ks.Provider,{value:D,children:T.jsxs(BH,S({as:h,className:xe(O.container,p),ref:A,ownerState:M},P,{children:[T.jsx(N,S({},V,!Sa(N)&&{as:Q,ownerState:S({},M,V.ownerState)},W,{children:I})),I.pop()]}))})):T.jsx(Ks.Provider,{value:D,children:T.jsxs(N,S({},V,{as:Q,ref:A},!Sa(N)&&{ownerState:S({},M,V.ownerState)},W,{children:[I,k&&T.jsx(SH,{children:k})]}))})}),KN=PH;function NH(t){return He("MuiListItemIcon",t)}const L1=Ue("MuiListItemIcon",["root","alignItemsFlexStart"]),EH=["className"],RH=t=>{const{alignItems:e,classes:r}=t;return $e({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},NH,r)},MH=K("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>S({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),DH=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiListItemIcon"}),{className:n}=i,s=oe(i,EH),a=w.useContext(Ks),o=S({},i,{alignItems:a.alignItems}),l=RH(o);return T.jsx(MH,S({className:xe(l.root,n),ownerState:o,ref:r},s))}),tl=DH;function LH(t){return He("MuiListItemText",t)}const FH=Ue("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),rm=FH,IH=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],OH=t=>{const{classes:e,inset:r,primary:i,secondary:n,dense:s}=t;return $e({root:["root",r&&"inset",s&&"dense",i&&n&&"multiline"],primary:["primary"],secondary:["secondary"]},LH,e)},AH=K("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${rm.primary}`]:e.primary},{[`& .${rm.secondary}`]:e.secondary},e.root,r.inset&&e.inset,r.primary&&r.secondary&&e.multiline,r.dense&&e.dense]}})(({ownerState:t})=>S({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),VH=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiListItemText"}),{children:n,className:s,disableTypography:a=!1,inset:o=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=i,h=oe(i,IH),{dense:p}=w.useContext(Ks);let f=l??n,m=u;const y=S({},i,{disableTypography:a,inset:o,primary:!!f,secondary:!!m,dense:p}),v=OH(y);return f!=null&&f.type!==Mr&&!a&&(f=T.jsx(Mr,S({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:f}))),m!=null&&m.type!==Mr&&!a&&(m=T.jsx(Mr,S({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),T.jsxs(AH,S({className:xe(v.root,s),ownerState:y,ref:r},h,{children:[f,m]}))}),rl=VH,$H=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function qy(t,e,r){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:r?null:t.firstChild}function F1(t,e,r){return t===e?r?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:r?null:t.lastChild}function QN(t,e){if(e===void 0)return!0;let r=t.innerText;return r===void 0&&(r=t.textContent),r=r.trim().toLowerCase(),r.length===0?!1:e.repeating?r[0]===e.keys[0]:r.indexOf(e.keys.join(""))===0}function Xu(t,e,r,i,n,s){let a=!1,o=n(t,e,e?r:!1);for(;o;){if(o===t.firstChild){if(a)return!1;a=!0}const l=i?!1:o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||!QN(o,s)||l)o=n(t,o,r);else return o.focus(),!0}return!1}const zH=w.forwardRef(function(e,r){const{actions:i,autoFocus:n=!1,autoFocusItem:s=!1,children:a,className:o,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=e,h=oe(e,$H),p=w.useRef(null),f=w.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});zr(()=>{n&&p.current.focus()},[n]),w.useImperativeHandle(i,()=>({adjustStyleForScrollbar:(b,{direction:k})=>{const C=!p.current.style.width;if(b.clientHeight{const k=p.current,C=b.key,x=Xr(k).activeElement;if(C==="ArrowDown")b.preventDefault(),Xu(k,x,c,l,qy);else if(C==="ArrowUp")b.preventDefault(),Xu(k,x,c,l,F1);else if(C==="Home")b.preventDefault(),Xu(k,null,c,l,qy);else if(C==="End")b.preventDefault(),Xu(k,null,c,l,F1);else if(C.length===1){const _=f.current,P=C.toLowerCase(),R=performance.now();_.keys.length>0&&(R-_.lastTime>500?(_.keys=[],_.repeating=!0,_.previousKeyMatched=!0):_.repeating&&P!==_.keys[0]&&(_.repeating=!1)),_.lastTime=R,_.keys.push(P);const E=x&&!_.repeating&&QN(x,_);_.previousKeyMatched&&(E||Xu(k,x,!1,l,qy,_))?b.preventDefault():_.previousKeyMatched=!1}u&&u(b)},y=Wt(p,r);let v=-1;w.Children.forEach(a,(b,k)=>{if(!w.isValidElement(b)){v===k&&(v+=1,v>=a.length&&(v=-1));return}b.props.disabled||(d==="selectedMenu"&&b.props.selected||v===-1)&&(v=k),v===k&&(b.props.disabled||b.props.muiSkipListHighlight||b.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const g=w.Children.map(a,(b,k)=>{if(k===v){const C={};return s&&(C.autoFocus=!0),b.props.tabIndex===void 0&&d==="selectedMenu"&&(C.tabIndex=0),w.cloneElement(b,C)}return b});return T.jsx(Gh,S({role:"menu",ref:y,className:o,onKeyDown:m,tabIndex:n?0:-1},h,{children:g}))}),iS=zH;function WH(t){return He("MuiPopover",t)}Ue("MuiPopover",["root","paper"]);const HH=["onEntering"],UH=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],GH=["slotProps"];function I1(t,e){let r=0;return typeof e=="number"?r=e:e==="center"?r=t.height/2:e==="bottom"&&(r=t.height),r}function O1(t,e){let r=0;return typeof e=="number"?r=e:e==="center"?r=t.width/2:e==="right"&&(r=t.width),r}function A1(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function Ky(t){return typeof t=="function"?t():t}const jH=t=>{const{classes:e}=t;return $e({root:["root"],paper:["paper"]},WH,e)},YH=K(tS,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),JN=K(Xl,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),XH=w.forwardRef(function(e,r){var i,n,s;const a=Ae({props:e,name:"MuiPopover"}),{action:o,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:h,className:p,container:f,elevation:m=8,marginThreshold:y=16,open:v,PaperProps:g={},slots:b,slotProps:k,transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:x=GN,transitionDuration:_="auto",TransitionProps:{onEntering:P}={},disableScrollLock:R=!1}=a,E=oe(a.TransitionProps,HH),D=oe(a,UH),$=(i=k==null?void 0:k.paper)!=null?i:g,I=w.useRef(),F=Wt(I,$.ref),M=S({},a,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:y,externalPaperSlotProps:$,transformOrigin:C,TransitionComponent:x,transitionDuration:_,TransitionProps:E}),O=jH(M),A=w.useCallback(()=>{if(d==="anchorPosition")return u;const X=Ky(l),Y=(X&&X.nodeType===1?X:Xr(I.current).body).getBoundingClientRect();return{top:Y.top+I1(Y,c.vertical),left:Y.left+O1(Y,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),N=w.useCallback(X=>({vertical:I1(X,C.vertical),horizontal:O1(X,C.horizontal)}),[C.horizontal,C.vertical]),V=w.useCallback(X=>{const ee={width:X.offsetWidth,height:X.offsetHeight},Y=N(ee);if(d==="none")return{top:null,left:null,transformOrigin:A1(Y)};const Be=A();let ce=Be.top-Y.vertical,L=Be.left-Y.horizontal;const U=ce+ee.height,G=L+ee.width,re=ea(Ky(l)),we=re.innerHeight-y,me=re.innerWidth-y;if(y!==null&&cewe){const Ee=U-we;ce-=Ee,Y.vertical+=Ee}if(y!==null&&Lme){const Ee=G-me;L-=Ee,Y.horizontal+=Ee}return{top:`${Math.round(ce)}px`,left:`${Math.round(L)}px`,transformOrigin:A1(Y)}},[l,d,A,N,y]),[W,Q]=w.useState(v),ne=w.useCallback(()=>{const X=I.current;if(!X)return;const ee=V(X);ee.top!==null&&(X.style.top=ee.top),ee.left!==null&&(X.style.left=ee.left),X.style.transformOrigin=ee.transformOrigin,Q(!0)},[V]);w.useEffect(()=>(R&&window.addEventListener("scroll",ne),()=>window.removeEventListener("scroll",ne)),[l,R,ne]);const ie=(X,ee)=>{P&&P(X,ee),ne()},te=()=>{Q(!1)};w.useEffect(()=>{v&&ne()}),w.useImperativeHandle(o,()=>v?{updatePosition:()=>{ne()}}:null,[v,ne]),w.useEffect(()=>{if(!v)return;const X=Vh(()=>{ne()}),ee=ea(l);return ee.addEventListener("resize",X),()=>{X.clear(),ee.removeEventListener("resize",X)}},[l,v,ne]);let j=_;_==="auto"&&!x.muiSupportAuto&&(j=void 0);const J=f||(l?Xr(Ky(l)).body:void 0),pe=(n=b==null?void 0:b.root)!=null?n:YH,fe=(s=b==null?void 0:b.paper)!=null?s:JN,Me=Ct({elementType:fe,externalSlotProps:S({},$,{style:W?$.style:S({},$.style,{opacity:0})}),additionalProps:{elevation:m,ref:F},ownerState:M,className:xe(O.paper,$==null?void 0:$.className)}),_e=Ct({elementType:pe,externalSlotProps:(k==null?void 0:k.root)||{},externalForwardedProps:D,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:J,open:v},ownerState:M,className:xe(O.root,p)}),{slotProps:ke}=_e,Ce=oe(_e,GH);return T.jsx(pe,S({},Ce,!Sa(pe)&&{slotProps:ke,disableScrollLock:R},{children:T.jsx(x,S({appear:!0,in:v,onEntering:ie,onExited:te,timeout:j},E,{children:T.jsx(fe,S({},Me,{children:h}))}))}))}),qH=XH;function KH(t){return He("MuiMenu",t)}Ue("MuiMenu",["root","paper","list"]);const QH=["onEntering"],JH=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],ZH={vertical:"top",horizontal:"right"},e8={vertical:"top",horizontal:"left"},t8=t=>{const{classes:e}=t;return $e({root:["root"],paper:["paper"],list:["list"]},KH,e)},r8=K(qH,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),i8=K(JN,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),n8=K(iS,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),s8=w.forwardRef(function(e,r){var i,n;const s=Ae({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:o,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:h,PaperProps:p={},PopoverClasses:f,transitionDuration:m="auto",TransitionProps:{onEntering:y}={},variant:v="selectedMenu",slots:g={},slotProps:b={}}=s,k=oe(s.TransitionProps,QH),C=oe(s,JH),x=Xi(),_=S({},s,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:y,PaperProps:p,transitionDuration:m,TransitionProps:k,variant:v}),P=t8(_),R=a&&!c&&h,E=w.useRef(null),D=(N,V)=>{E.current&&E.current.adjustStyleForScrollbar(N,{direction:x?"rtl":"ltr"}),y&&y(N,V)},$=N=>{N.key==="Tab"&&(N.preventDefault(),d&&d(N,"tabKeyDown"))};let I=-1;w.Children.map(o,(N,V)=>{w.isValidElement(N)&&(N.props.disabled||(v==="selectedMenu"&&N.props.selected||I===-1)&&(I=V))});const F=(i=g.paper)!=null?i:i8,M=(n=b.paper)!=null?n:p,O=Ct({elementType:g.root,externalSlotProps:b.root,ownerState:_,className:[P.root,l]}),A=Ct({elementType:F,externalSlotProps:M,ownerState:_,className:P.paper});return T.jsx(r8,S({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:x?"right":"left"},transformOrigin:x?ZH:e8,slots:{paper:F,root:g.root},slotProps:{root:O,paper:A},open:h,ref:r,transitionDuration:m,TransitionProps:S({onEntering:D},k),ownerState:_},C,{classes:f,children:T.jsx(n8,S({onKeyDown:$,actions:E,autoFocus:a&&(I===-1||c),autoFocusItem:R,variant:v},u,{className:xe(P.list,u.className),children:o}))}))}),a8=s8;function o8(t){return He("MuiMenuItem",t)}const l8=Ue("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),qu=l8,c8=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],u8=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.divider&&e.divider,!r.disableGutters&&e.gutters]},d8=t=>{const{disabled:e,dense:r,divider:i,disableGutters:n,selected:s,classes:a}=t,l=$e({root:["root",r&&"dense",e&&"disabled",!n&&"gutters",i&&"divider",s&&"selected"]},o8,a);return S({},a,l)},h8=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:u8})(({theme:t,ownerState:e})=>S({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${qu.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${qu.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${qu.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${qu.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${qu.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${_1.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${_1.inset}`]:{marginLeft:52},[`& .${rm.root}`]:{marginTop:0,marginBottom:0},[`& .${rm.inset}`]:{paddingLeft:36},[`& .${L1.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&S({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${L1.root} svg`]:{fontSize:"1.25rem"}}))),f8=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiMenuItem"}),{autoFocus:n=!1,component:s="li",dense:a=!1,divider:o=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:h}=i,p=oe(i,c8),f=w.useContext(Ks),m=w.useMemo(()=>({dense:a||f.dense||!1,disableGutters:l}),[f.dense,a,l]),y=w.useRef(null);zr(()=>{n&&y.current&&y.current.focus()},[n]);const v=S({},i,{dense:m.dense,divider:o,disableGutters:l}),g=d8(i),b=Wt(y,r);let k;return i.disabled||(k=d!==void 0?d:-1),T.jsx(Ks.Provider,{value:m,children:T.jsx(h8,S({ref:b,role:u,tabIndex:k,component:s,focusVisibleClassName:xe(g.focusVisible,c),className:xe(g.root,h)},p,{ownerState:v,classes:g}))})}),ZN=f8;function p8(t){return He("MuiNativeSelect",t)}const m8=Ue("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nS=m8,g8=["className","disabled","error","IconComponent","inputRef","variant"],y8=t=>{const{classes:e,variant:r,disabled:i,multiple:n,open:s,error:a}=t,o={select:["select",r,i&&"disabled",n&&"multiple",a&&"error"],icon:["icon",`icon${Pe(r)}`,s&&"iconOpen",i&&"disabled"]};return $e(o,p8,e)},eE=({ownerState:t,theme:e})=>S({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":S({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nS.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),b8=K("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:tn,overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.select,e[r.variant],r.error&&e.error,{[`&.${nS.multiple}`]:e.multiple}]}})(eE),tE=({ownerState:t,theme:e})=>S({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${nS.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),v8=K("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Pe(r.variant)}`],r.open&&e.iconOpen]}})(tE),w8=w.forwardRef(function(e,r){const{className:i,disabled:n,error:s,IconComponent:a,inputRef:o,variant:l="standard"}=e,c=oe(e,g8),u=S({},e,{disabled:n,variant:l,error:s}),d=y8(u);return T.jsxs(w.Fragment,{children:[T.jsx(b8,S({ownerState:u,className:xe(d.select,i),disabled:n,ref:o||r},c)),e.multiple?null:T.jsx(v8,{as:a,ownerState:u,className:d.icon})]})}),S8=w8;var V1;const x8=["children","classes","className","label","notched"],k8=K("fieldset",{shouldForwardProp:tn})({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%"}),C8=K("legend",{shouldForwardProp:tn})(({ownerState:t,theme:e})=>S({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&S({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function T8(t){const{className:e,label:r,notched:i}=t,n=oe(t,x8),s=r!=null&&r!=="",a=S({},t,{notched:i,withLabel:s});return T.jsx(k8,S({"aria-hidden":!0,className:e,ownerState:a},n,{children:T.jsx(C8,{ownerState:a,children:s?T.jsx("span",{children:r}):V1||(V1=T.jsx("span",{className:"notranslate",children:"​"}))})}))}const _8=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],B8=t=>{const{classes:e}=t,i=$e({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},D3,e);return S({},e,i)},P8=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:$g})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return S({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${ho.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${ho.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${ho.focused} .${ho.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${ho.error} .${ho.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${ho.disabled} .${ho.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&S({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),N8=K(T8,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),E8=K(Hg,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>S({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),rE=w.forwardRef(function(e,r){var i,n,s,a,o;const l=Ae({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:d="input",label:h,multiline:p=!1,notched:f,slots:m={},type:y="text"}=l,v=oe(l,_8),g=B8(l),b=In(),k=Qo({props:l,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),C=S({},l,{color:k.color||"primary",disabled:k.disabled,error:k.error,focused:k.focused,formControl:b,fullWidth:u,hiddenLabel:k.hiddenLabel,multiline:p,size:k.size,type:y}),x=(i=(n=m.root)!=null?n:c.Root)!=null?i:P8,_=(s=(a=m.input)!=null?a:c.Input)!=null?s:E8;return T.jsx(eS,S({slots:{root:x,input:_},renderSuffix:P=>T.jsx(N8,{ownerState:C,className:g.notchedOutline,label:h!=null&&h!==""&&k.required?o||(o=T.jsxs(w.Fragment,{children:[h," ","*"]})):h,notched:typeof f<"u"?f:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:u,inputComponent:d,multiline:p,ref:r,type:y},v,{classes:S({},g,{notchedOutline:null})}))});rE.muiName="Input";const iE=rE,R8=Tr(T.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),M8=Tr(T.jsx("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}),"StarBorder");function D8(t){return He("MuiRating",t)}const L8=Ue("MuiRating",["root","sizeSmall","sizeMedium","sizeLarge","readOnly","disabled","focusVisible","visuallyHidden","pristine","label","labelEmptyValueActive","icon","iconEmpty","iconFilled","iconHover","iconFocus","iconActive","decimal"]),Ku=L8,F8=["value"],I8=["className","defaultValue","disabled","emptyIcon","emptyLabelText","getLabelText","highlightSelectedOnly","icon","IconContainerComponent","max","name","onChange","onChangeActive","onMouseLeave","onMouseMove","precision","readOnly","size","value"];function O8(t){const e=t.toString().split(".")[1];return e?e.length:0}function Qy(t,e){if(t==null)return t;const r=Math.round(t/e)*e;return Number(r.toFixed(O8(e)))}const A8=t=>{const{classes:e,size:r,readOnly:i,disabled:n,emptyValueFocused:s,focusVisible:a}=t,o={root:["root",`size${Pe(r)}`,n&&"disabled",a&&"focusVisible",i&&"readOnly"],label:["label","pristine"],labelEmptyValue:[s&&"labelEmptyValueActive"],icon:["icon"],iconEmpty:["iconEmpty"],iconFilled:["iconFilled"],iconHover:["iconHover"],iconFocus:["iconFocus"],iconActive:["iconActive"],decimal:["decimal"],visuallyHidden:["visuallyHidden"]};return $e(o,D8,e)},V8=K("span",{name:"MuiRating",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Ku.visuallyHidden}`]:e.visuallyHidden},e.root,e[`size${Pe(r.size)}`],r.readOnly&&e.readOnly]}})(({theme:t,ownerState:e})=>S({display:"inline-flex",position:"relative",fontSize:t.typography.pxToRem(24),color:"#faaf00",cursor:"pointer",textAlign:"left",width:"min-content",WebkitTapHighlightColor:"transparent",[`&.${Ku.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Ku.focusVisible} .${Ku.iconActive}`]:{outline:"1px solid #999"},[`& .${Ku.visuallyHidden}`]:Lw},e.size==="small"&&{fontSize:t.typography.pxToRem(18)},e.size==="large"&&{fontSize:t.typography.pxToRem(30)},e.readOnly&&{pointerEvents:"none"})),nE=K("label",{name:"MuiRating",slot:"Label",overridesResolver:({ownerState:t},e)=>[e.label,t.emptyValueFocused&&e.labelEmptyValueActive]})(({ownerState:t})=>S({cursor:"inherit"},t.emptyValueFocused&&{top:0,bottom:0,position:"absolute",outline:"1px solid #999",width:"100%"})),$8=K("span",{name:"MuiRating",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.iconEmpty&&e.iconEmpty,r.iconFilled&&e.iconFilled,r.iconHover&&e.iconHover,r.iconFocus&&e.iconFocus,r.iconActive&&e.iconActive]}})(({theme:t,ownerState:e})=>S({display:"flex",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),pointerEvents:"none"},e.iconActive&&{transform:"scale(1.2)"},e.iconEmpty&&{color:(t.vars||t).palette.action.disabled})),z8=K("span",{name:"MuiRating",slot:"Decimal",shouldForwardProp:t=>zh(t)&&t!=="iconActive",overridesResolver:(t,e)=>{const{iconActive:r}=t;return[e.decimal,r&&e.iconActive]}})(({iconActive:t})=>S({position:"relative"},t&&{transform:"scale(1.2)"}));function W8(t){const e=oe(t,F8);return T.jsx("span",S({},e))}function $1(t){const{classes:e,disabled:r,emptyIcon:i,focus:n,getLabelText:s,highlightSelectedOnly:a,hover:o,icon:l,IconContainerComponent:c,isActive:u,itemValue:d,labelProps:h,name:p,onBlur:f,onChange:m,onClick:y,onFocus:v,readOnly:g,ownerState:b,ratingValue:k,ratingValueRounded:C}=t,x=a?d===k:d<=k,_=d<=o,P=d<=n,R=d===C,E=ia(),D=T.jsx($8,{as:c,value:d,className:xe(e.icon,x?e.iconFilled:e.iconEmpty,_&&e.iconHover,P&&e.iconFocus,u&&e.iconActive),ownerState:S({},b,{iconEmpty:!x,iconFilled:x,iconHover:_,iconFocus:P,iconActive:u}),children:i&&!x?i:l});return g?T.jsx("span",S({},h,{children:D})):T.jsxs(w.Fragment,{children:[T.jsxs(nE,S({ownerState:S({},b,{emptyValueFocused:void 0}),htmlFor:E},h,{children:[D,T.jsx("span",{className:e.visuallyHidden,children:s(d)})]})),T.jsx("input",{className:e.visuallyHidden,onFocus:v,onBlur:f,onChange:m,onClick:y,disabled:r,value:d,id:E,type:"radio",name:p,checked:R})]})}const H8=T.jsx(R8,{fontSize:"inherit"}),U8=T.jsx(M8,{fontSize:"inherit"});function G8(t){return`${t} Star${t!==1?"s":""}`}const j8=w.forwardRef(function(e,r){const i=Ae({name:"MuiRating",props:e}),{className:n,defaultValue:s=null,disabled:a=!1,emptyIcon:o=U8,emptyLabelText:l="Empty",getLabelText:c=G8,highlightSelectedOnly:u=!1,icon:d=H8,IconContainerComponent:h=W8,max:p=5,name:f,onChange:m,onChangeActive:y,onMouseLeave:v,onMouseMove:g,precision:b=1,readOnly:k=!1,size:C="medium",value:x}=i,_=oe(i,I8),P=ia(f),[R,E]=xs({controlled:x,default:s,name:"Rating"}),D=Qy(R,b),$=Xi(),[{hover:I,focus:F},M]=w.useState({hover:-1,focus:-1});let O=D;I!==-1&&(O=I),F!==-1&&(O=F);const{isFocusVisibleRef:A,onBlur:N,onFocus:V,ref:W}=Dw(),[Q,ne]=w.useState(!1),ie=w.useRef(),te=Wt(W,ie,r),j=Y=>{g&&g(Y);const Be=ie.current,{right:ce,left:L,width:U}=Be.getBoundingClientRect();let G;$?G=(ce-Y.clientX)/U:G=(Y.clientX-L)/U;let re=Qy(p*G+b/2,b);re=So(re,b,p),M(we=>we.hover===re&&we.focus===re?we:{hover:re,focus:re}),ne(!1),y&&I!==re&&y(Y,re)},J=Y=>{v&&v(Y);const Be=-1;M({hover:Be,focus:Be}),y&&I!==Be&&y(Y,Be)},pe=Y=>{let Be=Y.target.value===""?null:parseFloat(Y.target.value);I!==-1&&(Be=I),E(Be),m&&m(Y,Be)},fe=Y=>{Y.clientX===0&&Y.clientY===0||(M({hover:-1,focus:-1}),E(null),m&&parseFloat(Y.target.value)===D&&m(Y,null))},Me=Y=>{V(Y),A.current===!0&&ne(!0);const Be=parseFloat(Y.target.value);M(ce=>({hover:ce.hover,focus:Be}))},_e=Y=>{if(I!==-1)return;N(Y),A.current===!1&&ne(!1);const Be=-1;M(ce=>({hover:ce.hover,focus:Be}))},[ke,Ce]=w.useState(!1),X=S({},i,{defaultValue:s,disabled:a,emptyIcon:o,emptyLabelText:l,emptyValueFocused:ke,focusVisible:Q,getLabelText:c,icon:d,IconContainerComponent:h,max:p,precision:b,readOnly:k,size:C}),ee=A8(X);return T.jsxs(V8,S({ref:te,onMouseMove:j,onMouseLeave:J,className:xe(ee.root,n,k&&"MuiRating-readOnly"),ownerState:X,role:k?"img":null,"aria-label":k?c(O):null},_,{children:[Array.from(new Array(p)).map((Y,Be)=>{const ce=Be+1,L={classes:ee,disabled:a,emptyIcon:o,focus:F,getLabelText:c,highlightSelectedOnly:u,hover:I,icon:d,IconContainerComponent:h,name:P,onBlur:_e,onChange:pe,onClick:fe,onFocus:Me,ratingValue:O,ratingValueRounded:D,readOnly:k,ownerState:X},U=ce===Math.ceil(O)&&(I!==-1||F!==-1);if(b<1){const G=Array.from(new Array(1/b));return T.jsx(z8,{className:xe(ee.decimal,U&&ee.iconActive),ownerState:X,iconActive:U,children:G.map((re,we)=>{const me=Qy(ce-1+(we+1)*b,b);return T.jsx($1,S({},L,{isActive:!1,itemValue:me,labelProps:{style:G.length-1===we?{}:{width:me===O?`${(we+1)*b*100}%`:"0%",overflow:"hidden",position:"absolute"}}}),me)})},ce)}return T.jsx($1,S({},L,{isActive:U,itemValue:ce}),ce)}),!k&&!a&&T.jsxs(nE,{className:xe(ee.label,ee.labelEmptyValue),ownerState:X,children:[T.jsx("input",{className:ee.visuallyHidden,value:"",id:`${P}-empty`,type:"radio",name:P,checked:D==null,onFocus:()=>Ce(!0),onBlur:()=>Ce(!1),onChange:pe}),T.jsx("span",{className:ee.visuallyHidden,children:l})]})]}))}),Y8=j8;function X8(t){return He("MuiSelect",t)}const Qu=Ue("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var z1;const q8=["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"],K8=K("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`&.${Qu.select}`]:e.select},{[`&.${Qu.select}`]:e[r.variant]},{[`&.${Qu.error}`]:e.error},{[`&.${Qu.multiple}`]:e.multiple}]}})(eE,{[`&.${Qu.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Q8=K("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Pe(r.variant)}`],r.open&&e.iconOpen]}})(tE),J8=K("input",{shouldForwardProp:t=>zh(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function W1(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Z8(t){return t==null||typeof t=="string"&&!t.trim()}const eU=t=>{const{classes:e,variant:r,disabled:i,multiple:n,open:s,error:a}=t,o={select:["select",r,i&&"disabled",n&&"multiple",a&&"error"],icon:["icon",`icon${Pe(r)}`,s&&"iconOpen",i&&"disabled"],nativeInput:["nativeInput"]};return $e(o,X8,e)},tU=w.forwardRef(function(e,r){var i;const{"aria-describedby":n,"aria-label":s,autoFocus:a,autoWidth:o,children:l,className:c,defaultOpen:u,defaultValue:d,disabled:h,displayEmpty:p,error:f=!1,IconComponent:m,inputRef:y,labelId:v,MenuProps:g={},multiple:b,name:k,onBlur:C,onChange:x,onClose:_,onFocus:P,onOpen:R,open:E,readOnly:D,renderValue:$,SelectDisplayProps:I={},tabIndex:F,value:M,variant:O="standard"}=e,A=oe(e,q8),[N,V]=xs({controlled:M,default:d,name:"Select"}),[W,Q]=xs({controlled:E,default:u,name:"Select"}),ne=w.useRef(null),ie=w.useRef(null),[te,j]=w.useState(null),{current:J}=w.useRef(E!=null),[pe,fe]=w.useState(),Me=Wt(r,y),_e=w.useCallback(Fe=>{ie.current=Fe,Fe&&j(Fe)},[]),ke=te==null?void 0:te.parentNode;w.useImperativeHandle(Me,()=>({focus:()=>{ie.current.focus()},node:ne.current,value:N}),[N]),w.useEffect(()=>{u&&W&&te&&!J&&(fe(o?null:ke.clientWidth),ie.current.focus())},[te,o]),w.useEffect(()=>{a&&ie.current.focus()},[a]),w.useEffect(()=>{if(!v)return;const Fe=Xr(ie.current).getElementById(v);if(Fe){const xt=()=>{getSelection().isCollapsed&&ie.current.focus()};return Fe.addEventListener("click",xt),()=>{Fe.removeEventListener("click",xt)}}},[v]);const Ce=(Fe,xt)=>{Fe?R&&R(xt):_&&_(xt),J||(fe(o?null:ke.clientWidth),Q(Fe))},X=Fe=>{Fe.button===0&&(Fe.preventDefault(),ie.current.focus(),Ce(!0,Fe))},ee=Fe=>{Ce(!1,Fe)},Y=w.Children.toArray(l),Be=Fe=>{const xt=Y.find(De=>De.props.value===Fe.target.value);xt!==void 0&&(V(xt.props.value),x&&x(Fe,xt))},ce=Fe=>xt=>{let De;if(xt.currentTarget.hasAttribute("tabindex")){if(b){De=Array.isArray(N)?N.slice():[];const Ie=N.indexOf(Fe.props.value);Ie===-1?De.push(Fe.props.value):De.splice(Ie,1)}else De=Fe.props.value;if(Fe.props.onClick&&Fe.props.onClick(xt),N!==De&&(V(De),x)){const Ie=xt.nativeEvent||xt,wt=new Ie.constructor(Ie.type,Ie);Object.defineProperty(wt,"target",{writable:!0,value:{value:De,name:k}}),x(wt,Fe)}b||Ce(!1,xt)}},L=Fe=>{D||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Fe.key)!==-1&&(Fe.preventDefault(),Ce(!0,Fe))},U=te!==null&&W,G=Fe=>{!U&&C&&(Object.defineProperty(Fe,"target",{writable:!0,value:{value:N,name:k}}),C(Fe))};delete A["aria-invalid"];let re,we;const me=[];let Ee=!1;(tm({value:N})||p)&&($?re=$(N):Ee=!0);const qe=Y.map(Fe=>{if(!w.isValidElement(Fe))return null;let xt;if(b){if(!Array.isArray(N))throw new Error(Qa(2));xt=N.some(De=>W1(De,Fe.props.value)),xt&&Ee&&me.push(Fe.props.children)}else xt=W1(N,Fe.props.value),xt&&Ee&&(we=Fe.props.children);return w.cloneElement(Fe,{"aria-selected":xt?"true":"false",onClick:ce(Fe),onKeyUp:De=>{De.key===" "&&De.preventDefault(),Fe.props.onKeyUp&&Fe.props.onKeyUp(De)},role:"option",selected:xt,value:void 0,"data-value":Fe.props.value})});Ee&&(b?me.length===0?re=null:re=me.reduce((Fe,xt,De)=>(Fe.push(xt),De{const{classes:e}=t;return e},sS={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>tn(t)&&t!=="variant",slot:"Root"},aU=K(rS,sS)(""),oU=K(iE,sS)(""),lU=K(zN,sS)(""),sE=w.forwardRef(function(e,r){const i=Ae({name:"MuiSelect",props:e}),{autoWidth:n=!1,children:s,classes:a={},className:o,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=O3,id:d,input:h,inputProps:p,label:f,labelId:m,MenuProps:y,multiple:v=!1,native:g=!1,onClose:b,onOpen:k,open:C,renderValue:x,SelectDisplayProps:_,variant:P="outlined"}=i,R=oe(i,iU),E=g?S8:rU,D=In(),$=Qo({props:i,muiFormControl:D,states:["variant","error"]}),I=$.variant||P,F=S({},i,{variant:I,classes:a}),M=sU(F),O=oe(M,nU),A=h||{standard:T.jsx(aU,{ownerState:F}),outlined:T.jsx(oU,{label:f,ownerState:F}),filled:T.jsx(lU,{ownerState:F})}[I],N=Wt(r,A.ref);return T.jsx(w.Fragment,{children:w.cloneElement(A,S({inputComponent:E,inputProps:S({children:s,error:$.error,IconComponent:u,variant:I,type:void 0,multiple:v},g?{id:d}:{autoWidth:n,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:y,onClose:b,onOpen:k,open:C,renderValue:x,SelectDisplayProps:S({id:d},_)},p,{classes:p?gn(O,p.classes):O},h?h.props.inputProps:{})},(v&&g||c)&&I==="outlined"?{notched:!0}:{},{ref:N,className:xe(A.props.className,o,M.root)},!h&&{variant:I},R))})});sE.muiName="Select";const cU=sE,uU=t=>!t||!Sa(t);function dU(t){return He("MuiSlider",t)}const hU=Ue("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),ys=hU,fU=t=>{const{open:e}=t;return{offset:xe(e&&ys.valueLabelOpen),circle:ys.valueLabelCircle,label:ys.valueLabelLabel}};function pU(t){const{children:e,className:r,value:i}=t,n=fU(t);return e?w.cloneElement(e,{className:xe(e.props.className)},T.jsxs(w.Fragment,{children:[e.props.children,T.jsx("span",{className:xe(n.offset,r),"aria-hidden":!0,children:T.jsx("span",{className:n.circle,children:T.jsx("span",{className:n.label,children:i})})})]})):null}const mU=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],gU=hN();function H1(t){return t}const yU=K("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`color${Pe(r.color)}`],r.size!=="medium"&&e[`size${Pe(r.size)}`],r.marked&&e.marked,r.orientation==="vertical"&&e.vertical,r.track==="inverted"&&e.trackInverted,r.track===!1&&e.trackFalse]}})(({theme:t})=>{var e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${ys.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${ys.dragging}`]:{[`& .${ys.thumb}, & .${ys.track}`]:{transition:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r},style:{color:(t.vars||t).palette[r].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),bU=K("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),vU=K("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>{var e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r,track:"inverted"},style:S({},t.vars?{backgroundColor:t.vars.palette.Slider[`${r}Track`],borderColor:t.vars.palette.Slider[`${r}Track`]}:S({backgroundColor:Kp(t.palette[r].main,.62),borderColor:Kp(t.palette[r].main,.62)},t.applyStyles("dark",{backgroundColor:qp(t.palette[r].main,.5)}),t.applyStyles("dark",{borderColor:qp(t.palette[r].main,.5)})))}))]}}),wU=K("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.thumb,e[`thumbColor${Pe(r.color)}`],r.size!=="medium"&&e[`thumbSize${Pe(r.size)}`]]}})(({theme:t})=>{var e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${ys.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r},style:{[`&:hover, &.${ys.focusVisible}`]:S({},t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Jt(t.palette[r].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${ys.active}`]:S({},t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[r].mainChannel} / 0.16)}`}:{boxShadow:`0px 0px 0px 14px ${Jt(t.palette[r].main,.16)}`})}})),{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}}]}}),SU=K(pU,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(({theme:t})=>S({zIndex:1,whiteSpace:"nowrap"},t.typography.body2,{fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${ys.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${ys.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),xU=K("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>zh(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:r}=t;return[e.mark,r&&e.markActive]}})(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]})),kU=K("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>zh(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(({theme:t})=>S({},t.typography.body2,{color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]})),CU=t=>{const{disabled:e,dragging:r,marked:i,orientation:n,track:s,classes:a,color:o,size:l}=t,c={root:["root",e&&"disabled",r&&"dragging",i&&"marked",n==="vertical"&&"vertical",s==="inverted"&&"trackInverted",s===!1&&"trackFalse",o&&`color${Pe(o)}`,l&&`size${Pe(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${Pe(l)}`,o&&`thumbColor${Pe(o)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return $e(c,dU,a)},TU=({children:t})=>t,_U=w.forwardRef(function(e,r){var i,n,s,a,o,l,c,u,d,h,p,f,m,y,v,g,b,k,C,x,_,P,R,E;const D=gU({props:e,name:"MuiSlider"}),$=Xi(),{"aria-label":I,"aria-valuetext":F,"aria-labelledby":M,component:O="span",components:A={},componentsProps:N={},color:V="primary",classes:W,className:Q,disableSwap:ne=!1,disabled:ie=!1,getAriaLabel:te,getAriaValueText:j,marks:J=!1,max:pe=100,min:fe=0,orientation:Me="horizontal",shiftStep:_e=10,size:ke="medium",step:Ce=1,scale:X=H1,slotProps:ee,slots:Y,track:Be="normal",valueLabelDisplay:ce="off",valueLabelFormat:L=H1}=D,U=oe(D,mU),G=S({},D,{isRtl:$,max:pe,min:fe,classes:W,disabled:ie,disableSwap:ne,orientation:Me,marks:J,color:V,size:ke,step:Ce,shiftStep:_e,scale:X,track:Be,valueLabelDisplay:ce,valueLabelFormat:L}),{axisProps:re,getRootProps:we,getHiddenInputProps:me,getThumbProps:Ee,open:qe,active:ct,axis:Pt,focusedThumbIndex:be,range:le,dragging:Ke,marks:bt,values:Tt,trackOffset:Fe,trackLeap:xt,getThumbStyle:De}=Z4(S({},G,{rootRef:r}));G.marked=bt.length>0&&bt.some(gr=>gr.label),G.dragging=Ke,G.focusedThumbIndex=be;const Ie=CU(G),wt=(i=(n=Y==null?void 0:Y.root)!=null?n:A.Root)!=null?i:yU,nt=(s=(a=Y==null?void 0:Y.rail)!=null?a:A.Rail)!=null?s:bU,Ht=(o=(l=Y==null?void 0:Y.track)!=null?l:A.Track)!=null?o:vU,Sr=(c=(u=Y==null?void 0:Y.thumb)!=null?u:A.Thumb)!=null?c:wU,_r=(d=(h=Y==null?void 0:Y.valueLabel)!=null?h:A.ValueLabel)!=null?d:SU,Rs=(p=(f=Y==null?void 0:Y.mark)!=null?f:A.Mark)!=null?p:xU,Z=(m=(y=Y==null?void 0:Y.markLabel)!=null?y:A.MarkLabel)!=null?m:kU,se=(v=(g=Y==null?void 0:Y.input)!=null?g:A.Input)!=null?v:"input",Te=(b=ee==null?void 0:ee.root)!=null?b:N.root,We=(k=ee==null?void 0:ee.rail)!=null?k:N.rail,rt=(C=ee==null?void 0:ee.track)!=null?C:N.track,It=(x=ee==null?void 0:ee.thumb)!=null?x:N.thumb,kt=(_=ee==null?void 0:ee.valueLabel)!=null?_:N.valueLabel,St=(P=ee==null?void 0:ee.mark)!=null?P:N.mark,dt=(R=ee==null?void 0:ee.markLabel)!=null?R:N.markLabel,Ut=(E=ee==null?void 0:ee.input)!=null?E:N.input,wi=Ct({elementType:wt,getSlotProps:we,externalSlotProps:Te,externalForwardedProps:U,additionalProps:S({},uU(wt)&&{as:O}),ownerState:S({},G,Te==null?void 0:Te.ownerState),className:[Ie.root,Q]}),Ot=Ct({elementType:nt,externalSlotProps:We,ownerState:G,className:Ie.rail}),dr=Ct({elementType:Ht,externalSlotProps:rt,additionalProps:{style:S({},re[Pt].offset(Fe),re[Pt].leap(xt))},ownerState:S({},G,rt==null?void 0:rt.ownerState),className:Ie.track}),li=Ct({elementType:Sr,getSlotProps:Ee,externalSlotProps:It,ownerState:S({},G,It==null?void 0:It.ownerState),className:Ie.thumb}),nn=Ct({elementType:_r,externalSlotProps:kt,ownerState:S({},G,kt==null?void 0:kt.ownerState),className:Ie.valueLabel}),Kr=Ct({elementType:Rs,externalSlotProps:St,ownerState:G,className:Ie.mark}),sa=Ct({elementType:Z,externalSlotProps:dt,ownerState:G,className:Ie.markLabel}),Eu=Ct({elementType:se,getSlotProps:me,externalSlotProps:Ut,ownerState:G});return T.jsxs(wt,S({},wi,{children:[T.jsx(nt,S({},Ot)),T.jsx(Ht,S({},dr)),bt.filter(gr=>gr.value>=fe&&gr.value<=pe).map((gr,xr)=>{const Ms=em(gr.value,fe,pe),co=re[Pt].offset(Ms);let sn;return Be===!1?sn=Tt.indexOf(gr.value)!==-1:sn=Be==="normal"&&(le?gr.value>=Tt[0]&&gr.value<=Tt[Tt.length-1]:gr.value<=Tt[0])||Be==="inverted"&&(le?gr.value<=Tt[0]||gr.value>=Tt[Tt.length-1]:gr.value>=Tt[0]),T.jsxs(w.Fragment,{children:[T.jsx(Rs,S({"data-index":xr},Kr,!Sa(Rs)&&{markActive:sn},{style:S({},co,Kr.style),className:xe(Kr.className,sn&&Ie.markActive)})),gr.label!=null?T.jsx(Z,S({"aria-hidden":!0,"data-index":xr},sa,!Sa(Z)&&{markLabelActive:sn},{style:S({},co,sa.style),className:xe(Ie.markLabel,sa.className,sn&&Ie.markLabelActive),children:gr.label})):null]},xr)}),Tt.map((gr,xr)=>{const Ms=em(gr,fe,pe),co=re[Pt].offset(Ms),sn=ce==="off"?TU:_r;return T.jsx(sn,S({},!Sa(sn)&&{valueLabelFormat:L,valueLabelDisplay:ce,value:typeof L=="function"?L(X(gr),xr):L,index:xr,open:qe===xr||ct===xr||ce==="on",disabled:ie},nn,{children:T.jsx(Sr,S({"data-index":xr},li,{className:xe(Ie.thumb,li.className,ct===xr&&Ie.active,be===xr&&Ie.focusVisible),style:S({},co,De(xr),li.style),children:T.jsx(se,S({"data-index":xr,"aria-label":te?te(xr):I,"aria-valuenow":X(gr),"aria-labelledby":M,"aria-valuetext":j?j(X(gr),xr):F,value:Tt[xr]},Eu))}))}),xr)})]}))}),BU=_U;function PU(t){return He("MuiSwitch",t)}const on=Ue("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),NU=["className","color","edge","size","sx"],EU=hN(),RU=t=>{const{classes:e,edge:r,size:i,color:n,checked:s,disabled:a}=t,o={root:["root",r&&`edge${Pe(r)}`,`size${Pe(i)}`],switchBase:["switchBase",`color${Pe(n)}`,s&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=$e(o,PU,e);return S({},e,l)},MU=K("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.edge&&e[`edge${Pe(r.edge)}`],e[`size${Pe(r.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${on.thumb}`]:{width:16,height:16},[`& .${on.switchBase}`]:{padding:4,[`&.${on.checked}`]:{transform:"translateX(16px)"}}}}]}),DU=K(Iz,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.switchBase,{[`& .${on.input}`]:e.input},r.color!=="default"&&e[`color${Pe(r.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${on.checked}`]:{transform:"translateX(20px)"},[`&.${on.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${on.checked} + .${on.track}`]:{opacity:.5},[`&.${on.disabled} + .${on.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${on.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${on.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${on.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Kp(t.palette[e].main,.62):qp(t.palette[e].main,.55)}`}},[`&.${on.checked} + .${on.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),LU=K("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),FU=K("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),IU=w.forwardRef(function(e,r){const i=EU({props:e,name:"MuiSwitch"}),{className:n,color:s="primary",edge:a=!1,size:o="medium",sx:l}=i,c=oe(i,NU),u=S({},i,{color:s,edge:a,size:o}),d=RU(u),h=T.jsx(FU,{className:d.thumb,ownerState:u});return T.jsxs(MU,{className:xe(d.root,n),sx:l,ownerState:u,children:[T.jsx(DU,S({type:"checkbox",icon:h,checkedIcon:h,ref:r,ownerState:u},c,{classes:S({},d,{root:d.switchBase})})),T.jsx(LU,{className:d.track,ownerState:u})]})}),OU=IU;function AU(t){return He("MuiTab",t)}const VU=Ue("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),il=VU,$U=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],zU=t=>{const{classes:e,textColor:r,fullWidth:i,wrapped:n,icon:s,label:a,selected:o,disabled:l}=t,c={root:["root",s&&a&&"labelIcon",`textColor${Pe(r)}`,i&&"fullWidth",n&&"wrapped",o&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return $e(c,AU,e)},WU=K(Cs,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Pe(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>S({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${il.iconWrapper}`]:S({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${il.selected}`]:{opacity:1},[`&.${il.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${il.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${il.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${il.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${il.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),HU=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTab"}),{className:n,disabled:s=!1,disableFocusRipple:a=!1,fullWidth:o,icon:l,iconPosition:c="top",indicator:u,label:d,onChange:h,onClick:p,onFocus:f,selected:m,selectionFollowsFocus:y,textColor:v="inherit",value:g,wrapped:b=!1}=i,k=oe(i,$U),C=S({},i,{disabled:s,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!d,fullWidth:o,textColor:v,wrapped:b}),x=zU(C),_=l&&d&&w.isValidElement(l)?w.cloneElement(l,{className:xe(x.iconWrapper,l.props.className)}):l,P=E=>{!m&&h&&h(E,g),p&&p(E)},R=E=>{y&&!m&&h&&h(E,g),f&&f(E)};return T.jsxs(WU,S({focusRipple:!a,className:xe(x.root,n),ref:r,role:"tab","aria-selected":m,disabled:s,onClick:P,onFocus:R,ownerState:C,tabIndex:m?0:-1},k,{children:[c==="top"||c==="start"?T.jsxs(w.Fragment,{children:[_,d]}):T.jsxs(w.Fragment,{children:[d,_]}),u]}))}),UU=HU;function GU(t){return He("MuiToolbar",t)}Ue("MuiToolbar",["root","gutters","regular","dense"]);const jU=["className","component","disableGutters","variant"],YU=t=>{const{classes:e,disableGutters:r,variant:i}=t;return $e({root:["root",!r&&"gutters",i]},GU,e)},XU=K("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableGutters&&e.gutters,e[r.variant]]}})(({theme:t,ownerState:e})=>S({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),qU=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiToolbar"}),{className:n,component:s="div",disableGutters:a=!1,variant:o="regular"}=i,l=oe(i,jU),c=S({},i,{component:s,disableGutters:a,variant:o}),u=YU(c);return T.jsx(XU,S({as:s,className:xe(u.root,n),ref:r,ownerState:c},l))}),KU=qU,QU=Tr(T.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),JU=Tr(T.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function ZU(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function eG(t,e,r,i={},n=()=>{}){const{ease:s=ZU,duration:a=300}=i;let o=null;const l=e[t];let c=!1;const u=()=>{c=!0},d=h=>{if(c){n(new Error("Animation cancelled"));return}o===null&&(o=h);const p=Math.min(1,(h-o)/a);if(e[t]=s(p)*(r-l)+l,p>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(d)};return l===r?(n(new Error("Element already at target position")),u):(requestAnimationFrame(d),u)}const tG=["onChange"],rG={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function iG(t){const{onChange:e}=t,r=oe(t,tG),i=w.useRef(),n=w.useRef(null),s=()=>{i.current=n.current.offsetHeight-n.current.clientHeight};return zr(()=>{const a=Vh(()=>{const l=i.current;s(),l!==i.current&&e(i.current)}),o=ea(n.current);return o.addEventListener("resize",a),()=>{a.clear(),o.removeEventListener("resize",a)}},[e]),w.useEffect(()=>{s(),e(i.current)},[e]),T.jsx("div",S({style:rG,ref:n},r))}function nG(t){return He("MuiTabScrollButton",t)}const sG=Ue("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),aG=sG,oG=["className","slots","slotProps","direction","orientation","disabled"],lG=t=>{const{classes:e,orientation:r,disabled:i}=t;return $e({root:["root",r,i&&"disabled"]},nG,e)},cG=K(Cs,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>S({width:40,flexShrink:0,opacity:.8,[`&.${aG.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),uG=w.forwardRef(function(e,r){var i,n;const s=Ae({props:e,name:"MuiTabScrollButton"}),{className:a,slots:o={},slotProps:l={},direction:c}=s,u=oe(s,oG),d=Xi(),h=S({isRtl:d},s),p=lG(h),f=(i=o.StartScrollButtonIcon)!=null?i:QU,m=(n=o.EndScrollButtonIcon)!=null?n:JU,y=Ct({elementType:f,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h}),v=Ct({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h});return T.jsx(cG,S({component:"div",className:xe(p.root,a),ref:r,role:null,ownerState:h,tabIndex:null},u,{children:c==="left"?T.jsx(f,S({},y)):T.jsx(m,S({},v))}))}),dG=uG;function hG(t){return He("MuiTabs",t)}const fG=Ue("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Jy=fG,pG=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],U1=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,G1=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,Df=(t,e,r)=>{let i=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(i)return;i=!0}const s=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||s)n=r(t,n);else{n.focus();return}}},mG=t=>{const{vertical:e,fixed:r,hideScrollbar:i,scrollableX:n,scrollableY:s,centered:a,scrollButtonsHideMobile:o,classes:l}=t;return $e({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",i&&"hideScrollbar",n&&"scrollableX",s&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",o&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[i&&"hideScrollbar"]},hG,l)},gG=K("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Jy.scrollButtons}`]:e.scrollButtons},{[`& .${Jy.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>S({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${Jy.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),yG=K("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>S({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),bG=K("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>S({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),vG=K("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>S({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),wG=K(iG)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),j1={},SG=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTabs"}),n=qo(),s=Xi(),{"aria-label":a,"aria-labelledby":o,action:l,centered:c=!1,children:u,className:d,component:h="div",allowScrollButtonsMobile:p=!1,indicatorColor:f="primary",onChange:m,orientation:y="horizontal",ScrollButtonComponent:v=dG,scrollButtons:g="auto",selectionFollowsFocus:b,slots:k={},slotProps:C={},TabIndicatorProps:x={},TabScrollButtonProps:_={},textColor:P="primary",value:R,variant:E="standard",visibleScrollbar:D=!1}=i,$=oe(i,pG),I=E==="scrollable",F=y==="vertical",M=F?"scrollTop":"scrollLeft",O=F?"top":"left",A=F?"bottom":"right",N=F?"clientHeight":"clientWidth",V=F?"height":"width",W=S({},i,{component:h,allowScrollButtonsMobile:p,indicatorColor:f,orientation:y,vertical:F,scrollButtons:g,textColor:P,variant:E,visibleScrollbar:D,fixed:!I,hideScrollbar:I&&!D,scrollableX:I&&!F,scrollableY:I&&F,centered:c&&!I,scrollButtonsHideMobile:!p}),Q=mG(W),ne=Ct({elementType:k.StartScrollButtonIcon,externalSlotProps:C.startScrollButtonIcon,ownerState:W}),ie=Ct({elementType:k.EndScrollButtonIcon,externalSlotProps:C.endScrollButtonIcon,ownerState:W}),[te,j]=w.useState(!1),[J,pe]=w.useState(j1),[fe,Me]=w.useState(!1),[_e,ke]=w.useState(!1),[Ce,X]=w.useState(!1),[ee,Y]=w.useState({overflow:"hidden",scrollbarWidth:0}),Be=new Map,ce=w.useRef(null),L=w.useRef(null),U=()=>{const De=ce.current;let Ie;if(De){const nt=De.getBoundingClientRect();Ie={clientWidth:De.clientWidth,scrollLeft:De.scrollLeft,scrollTop:De.scrollTop,scrollLeftNormalized:zA(De,s?"rtl":"ltr"),scrollWidth:De.scrollWidth,top:nt.top,bottom:nt.bottom,left:nt.left,right:nt.right}}let wt;if(De&&R!==!1){const nt=L.current.children;if(nt.length>0){const Ht=nt[Be.get(R)];wt=Ht?Ht.getBoundingClientRect():null}}return{tabsMeta:Ie,tabMeta:wt}},G=Ye(()=>{const{tabsMeta:De,tabMeta:Ie}=U();let wt=0,nt;if(F)nt="top",Ie&&De&&(wt=Ie.top-De.top+De.scrollTop);else if(nt=s?"right":"left",Ie&&De){const Sr=s?De.scrollLeftNormalized+De.clientWidth-De.scrollWidth:De.scrollLeft;wt=(s?-1:1)*(Ie[nt]-De[nt]+Sr)}const Ht={[nt]:wt,[V]:Ie?Ie[V]:0};if(isNaN(J[nt])||isNaN(J[V]))pe(Ht);else{const Sr=Math.abs(J[nt]-Ht[nt]),_r=Math.abs(J[V]-Ht[V]);(Sr>=1||_r>=1)&&pe(Ht)}}),re=(De,{animation:Ie=!0}={})=>{Ie?eG(M,ce.current,De,{duration:n.transitions.duration.standard}):ce.current[M]=De},we=De=>{let Ie=ce.current[M];F?Ie+=De:(Ie+=De*(s?-1:1),Ie*=s&&ZP()==="reverse"?-1:1),re(Ie)},me=()=>{const De=ce.current[N];let Ie=0;const wt=Array.from(L.current.children);for(let nt=0;ntDe){nt===0&&(Ie=De);break}Ie+=Ht[N]}return Ie},Ee=()=>{we(-1*me())},qe=()=>{we(me())},ct=w.useCallback(De=>{Y({overflow:null,scrollbarWidth:De})},[]),Pt=()=>{const De={};De.scrollbarSizeListener=I?T.jsx(wG,{onChange:ct,className:xe(Q.scrollableX,Q.hideScrollbar)}):null;const wt=I&&(g==="auto"&&(fe||_e)||g===!0);return De.scrollButtonStart=wt?T.jsx(v,S({slots:{StartScrollButtonIcon:k.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:ne},orientation:y,direction:s?"right":"left",onClick:Ee,disabled:!fe},_,{className:xe(Q.scrollButtons,_.className)})):null,De.scrollButtonEnd=wt?T.jsx(v,S({slots:{EndScrollButtonIcon:k.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:ie},orientation:y,direction:s?"left":"right",onClick:qe,disabled:!_e},_,{className:xe(Q.scrollButtons,_.className)})):null,De},be=Ye(De=>{const{tabsMeta:Ie,tabMeta:wt}=U();if(!(!wt||!Ie)){if(wt[O]Ie[A]){const nt=Ie[M]+(wt[A]-Ie[A]);re(nt,{animation:De})}}}),le=Ye(()=>{I&&g!==!1&&X(!Ce)});w.useEffect(()=>{const De=Vh(()=>{ce.current&&G()});let Ie;const wt=Sr=>{Sr.forEach(_r=>{_r.removedNodes.forEach(Rs=>{var Z;(Z=Ie)==null||Z.unobserve(Rs)}),_r.addedNodes.forEach(Rs=>{var Z;(Z=Ie)==null||Z.observe(Rs)})}),De(),le()},nt=ea(ce.current);nt.addEventListener("resize",De);let Ht;return typeof ResizeObserver<"u"&&(Ie=new ResizeObserver(De),Array.from(L.current.children).forEach(Sr=>{Ie.observe(Sr)})),typeof MutationObserver<"u"&&(Ht=new MutationObserver(wt),Ht.observe(L.current,{childList:!0})),()=>{var Sr,_r;De.clear(),nt.removeEventListener("resize",De),(Sr=Ht)==null||Sr.disconnect(),(_r=Ie)==null||_r.disconnect()}},[G,le]),w.useEffect(()=>{const De=Array.from(L.current.children),Ie=De.length;if(typeof IntersectionObserver<"u"&&Ie>0&&I&&g!==!1){const wt=De[0],nt=De[Ie-1],Ht={root:ce.current,threshold:.99},Sr=se=>{Me(!se[0].isIntersecting)},_r=new IntersectionObserver(Sr,Ht);_r.observe(wt);const Rs=se=>{ke(!se[0].isIntersecting)},Z=new IntersectionObserver(Rs,Ht);return Z.observe(nt),()=>{_r.disconnect(),Z.disconnect()}}},[I,g,Ce,u==null?void 0:u.length]),w.useEffect(()=>{j(!0)},[]),w.useEffect(()=>{G()}),w.useEffect(()=>{be(j1!==J)},[be,J]),w.useImperativeHandle(l,()=>({updateIndicator:G,updateScrollButtons:le}),[G,le]);const Ke=T.jsx(vG,S({},x,{className:xe(Q.indicator,x.className),ownerState:W,style:S({},J,x.style)}));let bt=0;const Tt=w.Children.map(u,De=>{if(!w.isValidElement(De))return null;const Ie=De.props.value===void 0?bt:De.props.value;Be.set(Ie,bt);const wt=Ie===R;return bt+=1,w.cloneElement(De,S({fullWidth:E==="fullWidth",indicator:wt&&!te&&Ke,selected:wt,selectionFollowsFocus:b,onChange:m,textColor:P,value:Ie},bt===1&&R===!1&&!De.props.tabIndex?{tabIndex:0}:{}))}),Fe=De=>{const Ie=L.current,wt=Xr(Ie).activeElement;if(wt.getAttribute("role")!=="tab")return;let Ht=y==="horizontal"?"ArrowLeft":"ArrowUp",Sr=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&s&&(Ht="ArrowRight",Sr="ArrowLeft"),De.key){case Ht:De.preventDefault(),Df(Ie,wt,G1);break;case Sr:De.preventDefault(),Df(Ie,wt,U1);break;case"Home":De.preventDefault(),Df(Ie,null,U1);break;case"End":De.preventDefault(),Df(Ie,null,G1);break}},xt=Pt();return T.jsxs(gG,S({className:xe(Q.root,d),ownerState:W,ref:r,as:h},$,{children:[xt.scrollButtonStart,xt.scrollbarSizeListener,T.jsxs(yG,{className:Q.scroller,ownerState:W,style:{overflow:ee.overflow,[F?`margin${s?"Left":"Right"}`:"marginBottom"]:D?void 0:-ee.scrollbarWidth},ref:ce,children:[T.jsx(bG,{"aria-label":a,"aria-labelledby":o,"aria-orientation":y==="vertical"?"vertical":null,className:Q.flexContainer,ownerState:W,onKeyDown:Fe,ref:L,role:"tablist",children:Tt}),te&&Ke]}),xt.scrollButtonEnd]}))}),xG=SG;function kG(t){return He("MuiTextField",t)}Ue("MuiTextField",["root"]);const CG=["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"],TG={standard:rS,filled:zN,outlined:iE},_G=t=>{const{classes:e}=t;return $e({root:["root"]},kG,e)},BG=K(WN,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),PG=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:s=!1,children:a,className:o,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:f,id:m,InputLabelProps:y,inputProps:v,InputProps:g,inputRef:b,label:k,maxRows:C,minRows:x,multiline:_=!1,name:P,onBlur:R,onChange:E,onFocus:D,placeholder:$,required:I=!1,rows:F,select:M=!1,SelectProps:O,type:A,value:N,variant:V="outlined"}=i,W=oe(i,CG),Q=S({},i,{autoFocus:s,color:l,disabled:u,error:d,fullWidth:p,multiline:_,required:I,select:M,variant:V}),ne=_G(Q),ie={};V==="outlined"&&(y&&typeof y.shrink<"u"&&(ie.notched=y.shrink),ie.label=k),M&&((!O||!O.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const te=ia(m),j=f&&te?`${te}-helper-text`:void 0,J=k&&te?`${te}-label`:void 0,pe=TG[V],fe=T.jsx(pe,S({"aria-describedby":j,autoComplete:n,autoFocus:s,defaultValue:c,fullWidth:p,multiline:_,name:P,rows:F,maxRows:C,minRows:x,type:A,value:N,id:te,inputRef:b,onBlur:R,onChange:E,onFocus:D,placeholder:$,inputProps:v},ie,g));return T.jsxs(BG,S({className:xe(ne.root,o),disabled:u,error:d,fullWidth:p,ref:r,required:I,color:l,variant:V,ownerState:Q},W,{children:[k!=null&&k!==""&&T.jsx(XN,S({htmlFor:te,id:J},y,{children:k})),M?T.jsx(cU,S({"aria-describedby":j,id:te,labelId:J,value:N,input:fe},O,{children:a})):fe,f&&T.jsx(HN,S({id:j},h,{children:f}))]}))}),im=PG,aS=Tr(T.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),NG=Tr(T.jsx("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),aE=Tr(T.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),EG=Tr(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),oE=Tr(T.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),RG=Tr(T.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home"),MG=Tr(T.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Y1=Tr(T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 3c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5"}),"MoodBad"),DG=Tr(T.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),LG=Tr([T.jsx("circle",{cx:"10.01",cy:"17",r:"2",opacity:".3"},"0"),T.jsx("path",{d:"m12 3 .01 10.55c-.59-.34-1.27-.55-2-.55C7.79 13 6 14.79 6 17s1.79 4 4.01 4S14 19.21 14 17V7h4V3zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"1")],"MusicNoteTwoTone"),FG=Tr(T.jsx("path",{d:"m20.5 10 .5-2h-4l1-4h-2l-1 4h-4l1-4h-2L9 8H5l-.5 2h4l-1 4h-4L3 16h4l-1 4h2l1-4h4l-1 4h2l1-4h4l.5-2h-4l1-4zm-7 4h-4l1-4h4z"}),"Numbers"),IG=Tr(T.jsx("path",{d:"M19 13H5v-2h14z"}),"Remove");function Tu(t){const[e,r]=w.useState(!1);return T.jsxs(T.Fragment,{children:[T.jsx(h$,{position:"static",title:"Siuuu",children:T.jsxs(KU,{sx:{display:"flex"},children:[T.jsx(yn,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:()=>{r(!0)},children:T.jsx(MG,{})}),T.jsx(Mr,{variant:"h6",component:"div",sx:{flexGrow:1},children:t.title})]})}),T.jsx("div",{style:{flex:1,display:"flex",overflow:"auto"},children:t.children}),T.jsx(GW,{open:e,onClose:()=>{r(!1)},children:T.jsxs(Gh,{children:[T.jsxs(el,{component:Jo,to:"/",children:[T.jsx(tl,{children:T.jsx(RG,{})}),T.jsx(rl,{children:"Home"})]}),T.jsxs(el,{component:Jo,to:"/todo",children:[T.jsx(tl,{children:T.jsx(NG,{})}),T.jsx(rl,{children:"Todo"})]}),T.jsxs(el,{component:Jo,to:"/counter",children:[T.jsx(tl,{children:T.jsx(FG,{})}),T.jsx(rl,{children:"Counter"})]}),T.jsxs(el,{component:Jo,to:"/rating",children:[T.jsx(tl,{children:T.jsx(Y1,{})}),T.jsx(rl,{children:"Rating"})]}),T.jsxs(el,{component:Jo,to:"/shifts",children:[T.jsx(tl,{children:T.jsx(Y1,{})}),T.jsx(rl,{children:"Shifts"})]}),T.jsxs(el,{component:Jo,to:"/music",children:[T.jsx(tl,{children:T.jsx(DG,{})}),T.jsx(rl,{children:"Chord Generator"})]}),T.jsxs(el,{component:Jo,to:"/alpha",children:[T.jsx(tl,{children:T.jsx(LG,{})}),T.jsx(rl,{children:"Alpha"})]})]})})]})}function OG(){w.useEffect(()=>{setTimeout(()=>{console.log("This text will be displayed after 2 seconds."),e(!0)},500)},[]);const[t,e]=w.useState(!1);return T.jsx(Tu,{title:"Home",children:T.jsx(K3,{justifyContent:"center",alignContent:"center",children:t?"This is the content test":T.jsx("div",{style:{width:700,margin:"auto"},children:T.jsx(jz,{size:700,color:"secondary"})})})})}function AG({todos:t,onChange:e}){const[r,i]=w.useState(""),[n,s]=w.useState(!1),[a,o]=w.useState(-1),[l,c]=w.useState(""),u=d=>{};return T.jsxs(T.Fragment,{children:[T.jsxs(lh,{children:[T.jsxs(Mr,{color:"primary",children:["You have ",t.length," item",t.length<1||t.length>1?"s":""]}),T.jsx(Gh,{children:t.map((d,h)=>T.jsx(KN,{secondaryAction:T.jsxs(T.Fragment,{children:[T.jsx(yn,{edge:"end","aria-label":"edit",onClick:()=>{o(h),c(t[h])},children:T.jsx(oE,{})}),T.jsx(yn,{edge:"end","aria-label":"delete",onClick:()=>{e(t.filter((p,f)=>f!==h))},children:T.jsx(EG,{})})]}),children:d},h))}),T.jsx(im,{error:n,id:"outlined",value:r,label:"New item",onChange:d=>i(d.target.value),helperText:n&&"required",onKeyDown:d=>{d.key==="Enter"&&(console.log("dialog"),r.length>0?(s(!1),e([...t,r]),i("")):s(!0))}})]}),T.jsx(Gg,{open:a>=0,onClose:()=>o(-1),disableRestoreFocus:!0,children:T.jsx(im,{inputRef:u,autoFocus:!0,error:n,id:"outlined",value:l,onChange:d=>c(d.target.value),helperText:n&&"required",onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l.length>0?(s(!1),e(t.map((h,p)=>a===p?l:h)),console.log("setting index"),o(-1)):s(!0))}})})]})}function VG(){const[t,e]=w.useState([[]]),[r,i]=w.useState(0),[n,s]=w.useState(["List 1"]);function a(l){const c=[...t];c[r]=l,e(c)}function o(l,c){i(c)}return T.jsxs(Tu,{title:"Todo",children:[T.jsxs("div",{style:{display:"flex"},children:[T.jsx(xG,{value:r,onChange:o,variant:"scrollable",children:t.map((l,c)=>T.jsx(UU,{style:{textTransform:"none"},label:c==r?T.jsxs("div",{children:[T.jsx(rS,{inputProps:{maxLength:15},style:{width:120,textAlign:"center"},onChange:u=>{const d=n;return d[c]=u.target.value,s(d)},disableUnderline:!0,size:"small",defaultValue:n[c]}),t.length>1&&T.jsx(yn,{onClick:()=>{e([...t].filter((u,d)=>d!==c)),r>0&&i(r-1),s([...n].filter((u,d)=>d!==c))},children:T.jsx(aE,{})})]}):n[c]},c))}),T.jsx(yn,{onClick:()=>{e([...t,[]]),i(t.length),s([...n,`List ${t.length+1}`])},children:T.jsx(aS,{})})]}),T.jsx(AG,{todos:t[r],onChange:l=>a(l)})]})}var lE={exports:{}},cE={};/** + `),Wz)),Yz=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiCircularProgress"}),{className:n,color:s="primary",disableShrink:a=!1,size:o=40,style:l,thickness:c=3.6,value:u=0,variant:d="indeterminate"}=i,h=le(i,$z),p=S({},i,{color:s,disableShrink:a,size:o,thickness:c,value:u,variant:d}),f=Hz(p),m={},y={},v={};if(d==="determinate"){const g=2*Math.PI*((po-c)/2);m.strokeDasharray=g.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*g).toFixed(3)}px`,y.transform="rotate(-90deg)"}return T.jsx(Uz,S({className:ke(f.root,n),style:S({width:o,height:o},y,l),ownerState:p,ref:r,role:"progressbar"},v,h,{children:T.jsx(Gz,{className:f.svg,ownerState:p,viewBox:`${po/2} ${po/2} ${po} ${po}`,children:T.jsx(jz,{className:f.circle,style:m,ownerState:p,cx:po,cy:po,r:(po-c)/2,fill:"none",strokeWidth:c})})}))}),Xz=Yz;function qz(t){return Ue("MuiModal",t)}Ge("MuiModal",["root","hidden","backdrop"]);const Kz=["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"],Qz=t=>{const{open:e,exited:r,classes:i}=t;return ze({root:["root",!e&&r&&"hidden"],backdrop:["backdrop"]},qz,i)},Jz=K("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.open&&r.exited&&e.hidden]}})(({theme:t,ownerState:e})=>S({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),Zz=K(RN,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),e6=w.forwardRef(function(e,r){var i,n,s,a,o,l;const c=Ve({name:"MuiModal",props:e}),{BackdropComponent:u=Zz,BackdropProps:d,className:h,closeAfterTransition:p=!1,children:f,container:m,component:y,components:v={},componentsProps:g={},disableAutoFocus:b=!1,disableEnforceFocus:k=!1,disableEscapeKeyDown:C=!1,disablePortal:x=!1,disableRestoreFocus:_=!1,disableScrollLock:P=!1,hideBackdrop:R=!1,keepMounted:E=!1,onBackdropClick:D,open:$,slotProps:I,slots:F}=c,M=le(c,Kz),O=S({},c,{closeAfterTransition:p,disableAutoFocus:b,disableEnforceFocus:k,disableEscapeKeyDown:C,disablePortal:x,disableRestoreFocus:_,disableScrollLock:P,hideBackdrop:R,keepMounted:E}),{getRootProps:A,getBackdropProps:N,getTransitionProps:V,portalRef:W,isTopModal:Q,exited:ne,hasTransition:ie}=D$(S({},O,{rootRef:r})),te=S({},O,{exited:ne}),j=Qz(te),J={};if(f.props.tabIndex===void 0&&(J.tabIndex="-1"),ie){const{onEnter:X,onExited:ee}=V();J.onEnter=X,J.onExited=ee}const me=(i=(n=F==null?void 0:F.root)!=null?n:v.Root)!=null?i:Jz,pe=(s=(a=F==null?void 0:F.backdrop)!=null?a:v.Backdrop)!=null?s:u,De=(o=I==null?void 0:I.root)!=null?o:g.root,Be=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,Ce=Ct({elementType:me,externalSlotProps:De,externalForwardedProps:M,getSlotProps:A,additionalProps:{ref:r,as:y},ownerState:te,className:ke(h,De==null?void 0:De.className,j==null?void 0:j.root,!te.open&&te.exited&&(j==null?void 0:j.hidden))}),Te=Ct({elementType:pe,externalSlotProps:Be,additionalProps:d,getSlotProps:X=>N(S({},X,{onClick:ee=>{D&&D(ee),X!=null&&X.onClick&&X.onClick(ee)}})),className:ke(Be==null?void 0:Be.className,d==null?void 0:d.className,j==null?void 0:j.backdrop),ownerState:te});return!E&&!$&&(!ie||ne)?null:T.jsx(yN,{ref:W,container:m,disablePortal:x,children:T.jsxs(me,S({},Ce,{children:[!R&&u?T.jsx(pe,S({},Te)):null,T.jsx(gN,{disableEnforceFocus:k,disableAutoFocus:b,disableRestoreFocus:_,isEnabled:Q,open:$,children:w.cloneElement(f,J)})]}))})}),tS=e6;function t6(t){return Ue("MuiDialog",t)}const r6=Ge("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Ed=r6,i6=w.createContext({}),DN=i6,n6=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],s6=K(RN,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),a6=t=>{const{classes:e,scroll:r,maxWidth:i,fullWidth:n,fullScreen:s}=t,a={root:["root"],container:["container",`scroll${Ne(r)}`],paper:["paper",`paperScroll${Ne(r)}`,`paperWidth${Ne(String(i))}`,n&&"paperFullWidth",s&&"paperFullScreen"]};return ze(a,t6,e)},o6=K(tS,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),l6=K("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.container,e[`scroll${Ne(r.scroll)}`]]}})(({ownerState:t})=>S({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),c6=K(Xl,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`scrollPaper${Ne(r.scroll)}`],e[`paperWidth${Ne(String(r.maxWidth))}`],r.fullWidth&&e.paperFullWidth,r.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>S({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${Ed.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${Ed.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Ed.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),u6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDialog"}),n=Ko(),s={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,BackdropComponent:l,BackdropProps:c,children:u,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:m="sm",onBackdropClick:y,onClose:v,open:g,PaperComponent:b=Xl,PaperProps:k={},scroll:C="paper",TransitionComponent:x=Cu,transitionDuration:_=s,TransitionProps:P}=i,R=le(i,n6),E=S({},i,{disableEscapeKeyDown:h,fullScreen:p,fullWidth:f,maxWidth:m,scroll:C}),D=a6(E),$=w.useRef(),I=A=>{$.current=A.target===A.currentTarget},F=A=>{$.current&&($.current=null,y&&y(A),v&&v(A,"backdropClick"))},M=ia(o),O=w.useMemo(()=>({titleId:M}),[M]);return T.jsx(o6,S({className:ke(D.root,d),closeAfterTransition:!0,components:{Backdrop:s6},componentsProps:{backdrop:S({transitionDuration:_,as:l},c)},disableEscapeKeyDown:h,onClose:v,open:g,ref:r,onClick:F,ownerState:E},R,{children:T.jsx(x,S({appear:!0,in:g,timeout:_,role:"presentation"},P,{children:T.jsx(l6,{className:ke(D.container),onMouseDown:I,ownerState:E,children:T.jsx(c6,S({as:b,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":M},k,{className:ke(D.paper,k.className),ownerState:E,children:T.jsx(DN.Provider,{value:O,children:u})}))})}))}))}),Gg=u6;function d6(t){return Ue("MuiDialogActions",t)}Ge("MuiDialogActions",["root","spacing"]);const h6=["className","disableSpacing"],f6=t=>{const{classes:e,disableSpacing:r}=t;return ze({root:["root",!r&&"spacing"]},d6,e)},p6=K("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableSpacing&&e.spacing]}})(({ownerState:t})=>S({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),m6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:s=!1}=i,a=le(i,h6),o=S({},i,{disableSpacing:s}),l=f6(o);return T.jsx(p6,S({className:ke(l.root,n),ownerState:o,ref:r},a))}),LN=m6;function g6(t){return Ue("MuiDialogContent",t)}Ge("MuiDialogContent",["root","dividers"]);function y6(t){return Ue("MuiDialogTitle",t)}const b6=Ge("MuiDialogTitle",["root"]),v6=b6,w6=["className","dividers"],S6=t=>{const{classes:e,dividers:r}=t;return ze({root:["root",r&&"dividers"]},g6,e)},x6=K("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>S({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${v6.root} + &`]:{paddingTop:0}})),k6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDialogContent"}),{className:n,dividers:s=!1}=i,a=le(i,w6),o=S({},i,{dividers:s}),l=S6(o);return T.jsx(x6,S({className:ke(l.root,n),ownerState:o,ref:r},a))}),FN=k6,C6=["className","id"],T6=t=>{const{classes:e}=t;return ze({root:["root"]},y6,e)},_6=K(Mr,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),B6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDialogTitle"}),{className:n,id:s}=i,a=le(i,C6),o=i,l=T6(o),{titleId:c=s}=w.useContext(DN);return T.jsx(_6,S({component:"h2",className:ke(l.root,n),ownerState:o,ref:r,variant:"h6",id:s??c},a))}),IN=B6;function P6(t){return Ue("MuiDivider",t)}const _1=Ge("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),N6=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],E6=t=>{const{absolute:e,children:r,classes:i,flexItem:n,light:s,orientation:a,textAlign:o,variant:l}=t;return ze({root:["root",e&&"absolute",l,s&&"light",a==="vertical"&&"vertical",n&&"flexItem",r&&"withChildren",r&&a==="vertical"&&"withChildrenVertical",o==="right"&&a!=="vertical"&&"textAlignRight",o==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},P6,i)},R6=K("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.absolute&&e.absolute,e[r.variant],r.light&&e.light,r.orientation==="vertical"&&e.vertical,r.flexItem&&e.flexItem,r.children&&e.withChildren,r.children&&r.orientation==="vertical"&&e.withChildrenVertical,r.textAlign==="right"&&r.orientation!=="vertical"&&e.textAlignRight,r.textAlign==="left"&&r.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>S({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Jt(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>S({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>S({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>S({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>S({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),M6=K("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.wrapper,r.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>S({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),ON=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDivider"}),{absolute:n=!1,children:s,className:a,component:o=s?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:d=o!=="hr"?"separator":void 0,textAlign:h="center",variant:p="fullWidth"}=i,f=le(i,N6),m=S({},i,{absolute:n,component:o,flexItem:l,light:c,orientation:u,role:d,textAlign:h,variant:p}),y=E6(m);return T.jsx(R6,S({as:o,className:ke(y.root,a),role:d,ref:r,ownerState:m},f,{children:s?T.jsx(M6,{className:y.wrapper,ownerState:m,children:s}):null}))});ON.muiSkipListHighlight=!0;const B1=ON,D6=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function L6(t,e,r){const i=e.getBoundingClientRect(),n=r&&r.getBoundingClientRect(),s=ea(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=s.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let o=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");o=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?n?`translateX(${n.right+o-i.left}px)`:`translateX(${s.innerWidth+o-i.left}px)`:t==="right"?n?`translateX(-${i.right-n.left-o}px)`:`translateX(-${i.left+i.width-o}px)`:t==="up"?n?`translateY(${n.bottom+l-i.top}px)`:`translateY(${s.innerHeight+l-i.top}px)`:n?`translateY(-${i.top-n.top+i.height-l}px)`:`translateY(-${i.top+i.height-l}px)`}function F6(t){return typeof t=="function"?t():t}function Mf(t,e,r){const i=F6(r),n=L6(t,e,i);n&&(e.style.webkitTransform=n,e.style.transform=n)}const I6=w.forwardRef(function(e,r){const i=Ko(),n={enter:i.transitions.easing.easeOut,exit:i.transitions.easing.sharp},s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:l,container:c,direction:u="down",easing:d=n,in:h,onEnter:p,onEntered:f,onEntering:m,onExit:y,onExited:v,onExiting:g,style:b,timeout:k=s,TransitionComponent:C=Ig}=e,x=le(e,D6),_=w.useRef(null),P=Wt(l.ref,_,r),R=N=>V=>{N&&(V===void 0?N(_.current):N(_.current,V))},E=R((N,V)=>{Mf(u,N,c),Gw(N),p&&p(N,V)}),D=R((N,V)=>{const W=eu({timeout:k,style:b,easing:d},{mode:"enter"});N.style.webkitTransition=i.transitions.create("-webkit-transform",S({},W)),N.style.transition=i.transitions.create("transform",S({},W)),N.style.webkitTransform="none",N.style.transform="none",m&&m(N,V)}),$=R(f),I=R(g),F=R(N=>{const V=eu({timeout:k,style:b,easing:d},{mode:"exit"});N.style.webkitTransition=i.transitions.create("-webkit-transform",V),N.style.transition=i.transitions.create("transform",V),Mf(u,N,c),y&&y(N)}),M=R(N=>{N.style.webkitTransition="",N.style.transition="",v&&v(N)}),O=N=>{a&&a(_.current,N)},A=w.useCallback(()=>{_.current&&Mf(u,_.current,c)},[u,c]);return w.useEffect(()=>{if(h||u==="down"||u==="right")return;const N=Vh(()=>{_.current&&Mf(u,_.current,c)}),V=ea(_.current);return V.addEventListener("resize",N),()=>{N.clear(),V.removeEventListener("resize",N)}},[u,h,c]),w.useEffect(()=>{h||A()},[h,A]),T.jsx(C,S({nodeRef:_,onEnter:E,onEntered:$,onEntering:D,onExit:F,onExited:M,onExiting:I,addEndListener:O,appear:o,in:h,timeout:k},x,{children:(N,V)=>w.cloneElement(l,S({ref:P,style:S({visibility:N==="exited"&&!h?"hidden":void 0},b,l.props.style)},V))}))}),O6=I6;function A6(t){return Ue("MuiDrawer",t)}Ge("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const V6=["BackdropProps"],$6=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],AN=(t,e)=>{const{ownerState:r}=t;return[e.root,(r.variant==="permanent"||r.variant==="persistent")&&e.docked,e.modal]},z6=t=>{const{classes:e,anchor:r,variant:i}=t,n={root:["root"],docked:[(i==="permanent"||i==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Ne(r)}`,i!=="temporary"&&`paperAnchorDocked${Ne(r)}`]};return ze(n,A6,e)},W6=K(tS,{name:"MuiDrawer",slot:"Root",overridesResolver:AN})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),P1=K("div",{shouldForwardProp:tn,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:AN})({flex:"0 0 auto"}),H6=K(Xl,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`paperAnchor${Ne(r.anchor)}`],r.variant!=="temporary"&&e[`paperAnchorDocked${Ne(r.anchor)}`]]}})(({theme:t,ownerState:e})=>S({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},e.anchor==="left"&&{left:0},e.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="right"&&{right:0},e.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="left"&&e.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="top"&&e.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="right"&&e.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="bottom"&&e.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),VN={left:"right",right:"left",top:"down",bottom:"up"};function U6(t){return["left","right"].indexOf(t)!==-1}function G6({direction:t},e){return t==="rtl"&&U6(e)?VN[e]:e}const j6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDrawer"}),n=Ko(),s=Xi(),a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{anchor:o="left",BackdropProps:l,children:c,className:u,elevation:d=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:p}={},onClose:f,open:m=!1,PaperProps:y={},SlideProps:v,TransitionComponent:g=O6,transitionDuration:b=a,variant:k="temporary"}=i,C=le(i.ModalProps,V6),x=le(i,$6),_=w.useRef(!1);w.useEffect(()=>{_.current=!0},[]);const P=G6({direction:s?"rtl":"ltr"},o),E=S({},i,{anchor:o,elevation:d,open:m,variant:k},x),D=z6(E),$=T.jsx(H6,S({elevation:k==="temporary"?d:0,square:!0},y,{className:ke(D.paper,y.className),ownerState:E,children:c}));if(k==="permanent")return T.jsx(P1,S({className:ke(D.root,D.docked,u),ownerState:E,ref:r},x,{children:$}));const I=T.jsx(g,S({in:m,direction:VN[P],timeout:b,appear:_.current},v,{children:$}));return k==="persistent"?T.jsx(P1,S({className:ke(D.root,D.docked,u),ownerState:E,ref:r},x,{children:I})):T.jsx(W6,S({BackdropProps:S({},l,p,{transitionDuration:b}),className:ke(D.root,D.modal,u),open:m,ownerState:E,onClose:f,hideBackdrop:h,ref:r},x,C,{children:I}))}),Y6=j6;function X6(t){return Ue("MuiFab",t)}const q6=Ge("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),N1=q6,K6=["children","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"],Q6=t=>{const{color:e,variant:r,classes:i,size:n}=t,s={root:["root",r,`size${Ne(n)}`,e==="inherit"?"colorInherit":e]},a=ze(s,X6,i);return S({},i,a)},J6=K(Cs,{name:"MuiFab",slot:"Root",shouldForwardProp:t=>tn(t)||t==="classes",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`size${Ne(r.size)}`],r.color==="inherit"&&e.colorInherit,e[Ne(r.size)],e[r.color]]}})(({theme:t,ownerState:e})=>{var r,i;return S({},t.typography.button,{minHeight:36,transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(t.vars||t).zIndex.fab,boxShadow:(t.vars||t).shadows[6],"&:active":{boxShadow:(t.vars||t).shadows[12]},color:t.vars?t.vars.palette.text.primary:(r=(i=t.palette).getContrastText)==null?void 0:r.call(i,t.palette.grey[300]),backgroundColor:(t.vars||t).palette.grey[300],"&:hover":{backgroundColor:(t.vars||t).palette.grey.A100,"@media (hover: none)":{backgroundColor:(t.vars||t).palette.grey[300]},textDecoration:"none"},[`&.${N1.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]}},e.size==="small"&&{width:40,height:40},e.size==="medium"&&{width:48,height:48},e.variant==="extended"&&{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48},e.variant==="extended"&&e.size==="small"&&{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34},e.variant==="extended"&&e.size==="medium"&&{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40},e.color==="inherit"&&{color:"inherit"})},({theme:t,ownerState:e})=>S({},e.color!=="inherit"&&e.color!=="default"&&(t.vars||t).palette[e.color]!=null&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}}),({theme:t})=>({[`&.${N1.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}})),Z6=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiFab"}),{children:n,className:s,color:a="default",component:o="button",disabled:l=!1,disableFocusRipple:c=!1,focusVisibleClassName:u,size:d="large",variant:h="circular"}=i,p=le(i,K6),f=S({},i,{color:a,component:o,disabled:l,disableFocusRipple:c,size:d,variant:h}),m=Q6(f);return T.jsx(J6,S({className:ke(m.root,s),component:o,disabled:l,focusRipple:!c,focusVisibleClassName:ke(m.focusVisible,u),ownerState:f,ref:r},p,{classes:m,children:n}))}),eW=Z6,tW=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],rW=t=>{const{classes:e,disableUnderline:r}=t,n=ze({root:["root",!r&&"underline"],input:["input"]},O3,e);return S({},e,n)},iW=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...$g(t,e),!r.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var r;const i=t.palette.mode==="light",n=i?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",s=i?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=i?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=i?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return S({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s}},[`&.${el.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s},[`&.${el.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(r=(t.vars||t).palette[e.color||"primary"])==null?void 0:r.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${el.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${el.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${el.disabled}, .${el.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${el.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&S({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),nW=K(Hg,{name:"MuiFilledInput",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>S({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),$N=w.forwardRef(function(e,r){var i,n,s,a;const o=Ve({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:d="input",multiline:h=!1,slotProps:p,slots:f={},type:m="text"}=o,y=le(o,tW),v=S({},o,{fullWidth:u,inputComponent:d,multiline:h,type:m}),g=rW(o),b={root:{ownerState:v},input:{ownerState:v}},k=p??c?gn(b,p??c):b,C=(i=(n=f.root)!=null?n:l.Root)!=null?i:iW,x=(s=(a=f.input)!=null?a:l.Input)!=null?s:nW;return T.jsx(eS,S({slots:{root:C,input:x},componentsProps:k,fullWidth:u,inputComponent:d,multiline:h,ref:r,type:m},y,{classes:g}))});$N.muiName="Input";const zN=$N;function sW(t){return Ue("MuiFormControl",t)}Ge("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const aW=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],oW=t=>{const{classes:e,margin:r,fullWidth:i}=t,n={root:["root",r!=="none"&&`margin${Ne(r)}`,i&&"fullWidth"]};return ze(n,sW,e)},lW=K("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>S({},e.root,e[`margin${Ne(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>S({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),cW=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiFormControl"}),{children:n,className:s,color:a="primary",component:o="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:d=!1,hiddenLabel:h=!1,margin:p="none",required:f=!1,size:m="medium",variant:y="outlined"}=i,v=le(i,aW),g=S({},i,{color:a,component:o,disabled:l,error:c,fullWidth:d,hiddenLabel:h,margin:p,required:f,size:m,variant:y}),b=oW(g),[k,C]=w.useState(()=>{let I=!1;return n&&w.Children.forEach(n,F=>{if(!fp(F,["Input","Select"]))return;const M=fp(F,["Select"])?F.props.input:F;M&&_3(M.props)&&(I=!0)}),I}),[x,_]=w.useState(()=>{let I=!1;return n&&w.Children.forEach(n,F=>{fp(F,["Input","Select"])&&(tm(F.props,!0)||tm(F.props.inputProps,!0))&&(I=!0)}),I}),[P,R]=w.useState(!1);l&&P&&R(!1);const E=u!==void 0&&!l?u:P;let D;const $=w.useMemo(()=>({adornedStart:k,setAdornedStart:C,color:a,disabled:l,error:c,filled:x,focused:E,fullWidth:d,hiddenLabel:h,size:m,onBlur:()=>{R(!1)},onEmpty:()=>{_(!1)},onFilled:()=>{_(!0)},onFocus:()=>{R(!0)},registerEffect:D,required:f,variant:y}),[k,a,l,c,x,E,d,h,D,f,m,y]);return T.jsx(Vg.Provider,{value:$,children:T.jsx(lW,S({as:o,ownerState:g,className:ke(b.root,s),ref:r},v,{children:n}))})}),WN=cW,uW=ZA({createStyledComponent:K("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>Ve({props:t,name:"MuiStack"})}),dW=uW;function hW(t){return Ue("MuiFormControlLabel",t)}const fW=Ge("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),dd=fW,pW=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],mW=t=>{const{classes:e,disabled:r,labelPlacement:i,error:n,required:s}=t,a={root:["root",r&&"disabled",`labelPlacement${Ne(i)}`,n&&"error",s&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",n&&"error"]};return ze(a,hW,e)},gW=K("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${dd.label}`]:e.label},e.root,e[`labelPlacement${Ne(r.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${dd.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${dd.label}`]:{[`&.${dd.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),yW=K("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${dd.error}`]:{color:(t.vars||t).palette.error.main}})),bW=w.forwardRef(function(e,r){var i,n;const s=Ve({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:o={},control:l,disabled:c,disableTypography:u,label:d,labelPlacement:h="end",required:p,slotProps:f={}}=s,m=le(s,pW),y=In(),v=(i=c??l.props.disabled)!=null?i:y==null?void 0:y.disabled,g=p??l.props.required,b={disabled:v,required:g};["checked","name","onChange","value","inputRef"].forEach(R=>{typeof l.props[R]>"u"&&typeof s[R]<"u"&&(b[R]=s[R])});const k=Jo({props:s,muiFormControl:y,states:["error"]}),C=S({},s,{disabled:v,labelPlacement:h,required:g,error:k.error}),x=mW(C),_=(n=f.typography)!=null?n:o.typography;let P=d;return P!=null&&P.type!==Mr&&!u&&(P=T.jsx(Mr,S({component:"span"},_,{className:ke(x.label,_==null?void 0:_.className),children:P}))),T.jsxs(gW,S({className:ke(x.root,a),ownerState:C,ref:r},m,{children:[w.cloneElement(l,b),g?T.jsxs(dW,{display:"block",children:[P,T.jsxs(yW,{ownerState:C,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]}):P]}))}),vW=bW;function wW(t){return Ue("MuiFormGroup",t)}Ge("MuiFormGroup",["root","row","error"]);const SW=["className","row"],xW=t=>{const{classes:e,row:r,error:i}=t;return ze({root:["root",r&&"row",i&&"error"]},wW,e)},kW=K("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.row&&e.row]}})(({ownerState:t})=>S({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),CW=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiFormGroup"}),{className:n,row:s=!1}=i,a=le(i,SW),o=In(),l=Jo({props:i,muiFormControl:o,states:["error"]}),c=S({},i,{row:s,error:l.error}),u=xW(c);return T.jsx(kW,S({className:ke(u.root,n),ownerState:c,ref:r},a))}),TW=CW;function _W(t){return Ue("MuiFormHelperText",t)}const BW=Ge("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),E1=BW;var R1;const PW=["children","className","component","disabled","error","filled","focused","margin","required","variant"],NW=t=>{const{classes:e,contained:r,size:i,disabled:n,error:s,filled:a,focused:o,required:l}=t,c={root:["root",n&&"disabled",s&&"error",i&&`size${Ne(i)}`,r&&"contained",o&&"focused",a&&"filled",l&&"required"]};return ze(c,_W,e)},EW=K("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.size&&e[`size${Ne(r.size)}`],r.contained&&e.contained,r.filled&&e.filled]}})(({theme:t,ownerState:e})=>S({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${E1.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${E1.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),RW=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiFormHelperText"}),{children:n,className:s,component:a="p"}=i,o=le(i,PW),l=In(),c=Jo({props:i,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=S({},i,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),d=NW(u);return T.jsx(EW,S({as:a,ownerState:u,className:ke(d.root,s),ref:r},o,{children:n===" "?R1||(R1=T.jsx("span",{className:"notranslate",children:"​"})):n}))}),HN=RW;function MW(t){return Ue("MuiFormLabel",t)}const DW=Ge("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Rd=DW,LW=["children","className","color","component","disabled","error","filled","focused","required"],FW=t=>{const{classes:e,color:r,focused:i,disabled:n,error:s,filled:a,required:o}=t,l={root:["root",`color${Ne(r)}`,n&&"disabled",s&&"error",a&&"filled",i&&"focused",o&&"required"],asterisk:["asterisk",s&&"error"]};return ze(l,MW,e)},IW=K("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>S({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>S({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Rd.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Rd.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Rd.error}`]:{color:(t.vars||t).palette.error.main}})),OW=K("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Rd.error}`]:{color:(t.vars||t).palette.error.main}})),AW=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiFormLabel"}),{children:n,className:s,component:a="label"}=i,o=le(i,LW),l=In(),c=Jo({props:i,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=S({},i,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),d=FW(u);return T.jsxs(IW,S({as:a,ownerState:u,className:ke(d.root,s),ref:r},o,{children:[n,c.required&&T.jsxs(OW,{ownerState:u,"aria-hidden":!0,className:d.asterisk,children:[" ","*"]})]}))}),VW=AW,$W=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function X0(t){return`scale(${t}, ${t**2})`}const zW={entering:{opacity:1,transform:X0(1)},entered:{opacity:1,transform:"none"}},Xy=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),UN=w.forwardRef(function(e,r){const{addEndListener:i,appear:n=!0,children:s,easing:a,in:o,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:h,onExiting:p,style:f,timeout:m="auto",TransitionComponent:y=Ig}=e,v=le(e,$W),g=QP(),b=w.useRef(),k=Ko(),C=w.useRef(null),x=Wt(C,s.ref,r),_=M=>O=>{if(M){const A=C.current;O===void 0?M(A):M(A,O)}},P=_(u),R=_((M,O)=>{Gw(M);const{duration:A,delay:N,easing:V}=eu({style:f,timeout:m,easing:a},{mode:"enter"});let W;m==="auto"?(W=k.transitions.getAutoHeightDuration(M.clientHeight),b.current=W):W=A,M.style.transition=[k.transitions.create("opacity",{duration:W,delay:N}),k.transitions.create("transform",{duration:Xy?W:W*.666,delay:N,easing:V})].join(","),l&&l(M,O)}),E=_(c),D=_(p),$=_(M=>{const{duration:O,delay:A,easing:N}=eu({style:f,timeout:m,easing:a},{mode:"exit"});let V;m==="auto"?(V=k.transitions.getAutoHeightDuration(M.clientHeight),b.current=V):V=O,M.style.transition=[k.transitions.create("opacity",{duration:V,delay:A}),k.transitions.create("transform",{duration:Xy?V:V*.666,delay:Xy?A:A||V*.333,easing:N})].join(","),M.style.opacity=0,M.style.transform=X0(.75),d&&d(M)}),I=_(h),F=M=>{m==="auto"&&g.start(b.current||0,M),i&&i(C.current,M)};return T.jsx(y,S({appear:n,in:o,nodeRef:C,onEnter:R,onEntered:E,onEntering:P,onExit:$,onExited:I,onExiting:D,addEndListener:F,timeout:m==="auto"?null:m},v,{children:(M,O)=>w.cloneElement(s,S({style:S({opacity:0,transform:X0(.75),visibility:M==="exited"&&!o?"hidden":void 0},zW[M],f,s.props.style),ref:x},O))}))});UN.muiSupportAuto=!0;const GN=UN,WW=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],HW=t=>{const{classes:e,disableUnderline:r}=t,n=ze({root:["root",!r&&"underline"],input:["input"]},D3,e);return S({},e,n)},UW=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...$g(t,e),!r.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let i=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(i=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),S({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Yu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Yu.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Yu.disabled}, .${Yu.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${i}`}},[`&.${Yu.disabled}:before`]:{borderBottomStyle:"dotted"}})}),GW=K(Hg,{name:"MuiInput",slot:"Input",overridesResolver:zg})({}),jN=w.forwardRef(function(e,r){var i,n,s,a;const o=Ve({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:d=!1,inputComponent:h="input",multiline:p=!1,slotProps:f,slots:m={},type:y="text"}=o,v=le(o,WW),g=HW(o),k={root:{ownerState:{disableUnderline:l}}},C=f??u?gn(f??u,k):k,x=(i=(n=m.root)!=null?n:c.Root)!=null?i:UW,_=(s=(a=m.input)!=null?a:c.Input)!=null?s:GW;return T.jsx(eS,S({slots:{root:x,input:_},slotProps:C,fullWidth:d,inputComponent:h,multiline:p,ref:r,type:y},v,{classes:g}))});jN.muiName="Input";const rS=jN;function jW(t){return Ue("MuiInputAdornment",t)}const YW=Ge("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),M1=YW;var D1;const XW=["children","className","component","disablePointerEvents","disableTypography","position","variant"],qW=(t,e)=>{const{ownerState:r}=t;return[e.root,e[`position${Ne(r.position)}`],r.disablePointerEvents===!0&&e.disablePointerEvents,e[r.variant]]},KW=t=>{const{classes:e,disablePointerEvents:r,hiddenLabel:i,position:n,size:s,variant:a}=t,o={root:["root",r&&"disablePointerEvents",n&&`position${Ne(n)}`,a,i&&"hiddenLabel",s&&`size${Ne(s)}`]};return ze(o,jW,e)},QW=K("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:qW})(({theme:t,ownerState:e})=>S({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${M1.positionStart}&:not(.${M1.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),JW=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiInputAdornment"}),{children:n,className:s,component:a="div",disablePointerEvents:o=!1,disableTypography:l=!1,position:c,variant:u}=i,d=le(i,XW),h=In()||{};let p=u;u&&h.variant,h&&!p&&(p=h.variant);const f=S({},i,{hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:o,position:c,variant:p}),m=KW(f);return T.jsx(Vg.Provider,{value:null,children:T.jsx(QW,S({as:a,ownerState:f,className:ke(m.root,s),ref:r},d,{children:typeof n=="string"&&!l?T.jsx(Mr,{color:"text.secondary",children:n}):T.jsxs(w.Fragment,{children:[c==="start"?D1||(D1=T.jsx("span",{className:"notranslate",children:"​"})):null,n]})}))})}),YN=JW;function ZW(t){return Ue("MuiInputLabel",t)}Ge("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const eH=["disableAnimation","margin","shrink","variant","className"],tH=t=>{const{classes:e,formControl:r,size:i,shrink:n,disableAnimation:s,variant:a,required:o}=t,l={root:["root",r&&"formControl",!s&&"animated",n&&"shrink",i&&i!=="normal"&&`size${Ne(i)}`,a],asterisk:[o&&"asterisk"]},c=ze(l,ZW,e);return S({},e,c)},rH=K(VW,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Rd.asterisk}`]:e.asterisk},e.root,r.formControl&&e.formControl,r.size==="small"&&e.sizeSmall,r.shrink&&e.shrink,!r.disableAnimation&&e.animated,r.focused&&e.focused,e[r.variant]]}})(({theme:t,ownerState:e})=>S({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&S({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&S({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&S({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),iH=w.forwardRef(function(e,r){const i=Ve({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,shrink:s,className:a}=i,o=le(i,eH),l=In();let c=s;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=Jo({props:i,muiFormControl:l,states:["size","variant","required","focused"]}),d=S({},i,{disableAnimation:n,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),h=tH(d);return T.jsx(rH,S({"data-shrink":c,ownerState:d,ref:r,className:ke(h.root,a)},o,{classes:h}))}),XN=iH,nH=w.createContext({}),Ks=nH;function sH(t){return Ue("MuiList",t)}Ge("MuiList",["root","padding","dense","subheader"]);const aH=["children","className","component","dense","disablePadding","subheader"],oH=t=>{const{classes:e,disablePadding:r,dense:i,subheader:n}=t;return ze({root:["root",!r&&"padding",i&&"dense",n&&"subheader"]},sH,e)},lH=K("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disablePadding&&e.padding,r.dense&&e.dense,r.subheader&&e.subheader]}})(({ownerState:t})=>S({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),cH=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiList"}),{children:n,className:s,component:a="ul",dense:o=!1,disablePadding:l=!1,subheader:c}=i,u=le(i,aH),d=w.useMemo(()=>({dense:o}),[o]),h=S({},i,{component:a,dense:o,disablePadding:l}),p=oH(h);return T.jsx(Ks.Provider,{value:d,children:T.jsxs(lH,S({as:a,className:ke(p.root,s),ref:r,ownerState:h},u,{children:[c,n]}))})}),Gh=cH;function uH(t){return Ue("MuiListItem",t)}const dH=Ge("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),fc=dH;function hH(t){return Ue("MuiListItemButton",t)}const fH=Ge("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),pc=fH,pH=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],mH=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.alignItems==="flex-start"&&e.alignItemsFlexStart,r.divider&&e.divider,!r.disableGutters&&e.gutters]},gH=t=>{const{alignItems:e,classes:r,dense:i,disabled:n,disableGutters:s,divider:a,selected:o}=t,c=ze({root:["root",i&&"dense",!s&&"gutters",a&&"divider",n&&"disabled",e==="flex-start"&&"alignItemsFlexStart",o&&"selected"]},hH,r);return S({},r,c)},yH=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:mH})(({theme:t,ownerState:e})=>S({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${pc.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${pc.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${pc.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${pc.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${pc.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),bH=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiListItemButton"}),{alignItems:n="center",autoFocus:s=!1,component:a="div",children:o,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:d,selected:h=!1,className:p}=i,f=le(i,pH),m=w.useContext(Ks),y=w.useMemo(()=>({dense:l||m.dense||!1,alignItems:n,disableGutters:c}),[n,m.dense,l,c]),v=w.useRef(null);zr(()=>{s&&v.current&&v.current.focus()},[s]);const g=S({},i,{alignItems:n,dense:y.dense,disableGutters:c,divider:u,selected:h}),b=gH(g),k=Wt(v,r);return T.jsx(Ks.Provider,{value:y,children:T.jsx(yH,S({ref:k,href:f.href||f.to,component:(f.href||f.to)&&a==="div"?"button":a,focusVisibleClassName:ke(b.focusVisible,d),ownerState:g,className:ke(b.root,p)},f,{classes:b,children:o}))})}),tl=bH;function vH(t){return Ue("MuiListItemSecondaryAction",t)}Ge("MuiListItemSecondaryAction",["root","disableGutters"]);const wH=["className"],SH=t=>{const{disableGutters:e,classes:r}=t;return ze({root:["root",e&&"disableGutters"]},vH,r)},xH=K("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.disableGutters&&e.disableGutters]}})(({ownerState:t})=>S({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),qN=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiListItemSecondaryAction"}),{className:n}=i,s=le(i,wH),a=w.useContext(Ks),o=S({},i,{disableGutters:a.disableGutters}),l=SH(o);return T.jsx(xH,S({className:ke(l.root,n),ownerState:o,ref:r},s))});qN.muiName="ListItemSecondaryAction";const kH=qN,CH=["className"],TH=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],_H=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.alignItems==="flex-start"&&e.alignItemsFlexStart,r.divider&&e.divider,!r.disableGutters&&e.gutters,!r.disablePadding&&e.padding,r.button&&e.button,r.hasSecondaryAction&&e.secondaryAction]},BH=t=>{const{alignItems:e,button:r,classes:i,dense:n,disabled:s,disableGutters:a,disablePadding:o,divider:l,hasSecondaryAction:c,selected:u}=t;return ze({root:["root",n&&"dense",!a&&"gutters",!o&&"padding",l&&"divider",s&&"disabled",r&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},uH,i)},PH=K("div",{name:"MuiListItem",slot:"Root",overridesResolver:_H})(({theme:t,ownerState:e})=>S({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&S({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${pc.root}`]:{paddingRight:48}},{[`&.${fc.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${fc.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${fc.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${fc.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fc.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),NH=K("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),EH=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiListItem"}),{alignItems:n="center",autoFocus:s=!1,button:a=!1,children:o,className:l,component:c,components:u={},componentsProps:d={},ContainerComponent:h="li",ContainerProps:{className:p}={},dense:f=!1,disabled:m=!1,disableGutters:y=!1,disablePadding:v=!1,divider:g=!1,focusVisibleClassName:b,secondaryAction:k,selected:C=!1,slotProps:x={},slots:_={}}=i,P=le(i.ContainerProps,CH),R=le(i,TH),E=w.useContext(Ks),D=w.useMemo(()=>({dense:f||E.dense||!1,alignItems:n,disableGutters:y}),[n,E.dense,f,y]),$=w.useRef(null);zr(()=>{s&&$.current&&$.current.focus()},[s]);const I=w.Children.toArray(o),F=I.length&&fp(I[I.length-1],["ListItemSecondaryAction"]),M=S({},i,{alignItems:n,autoFocus:s,button:a,dense:D.dense,disabled:m,disableGutters:y,disablePadding:v,divider:g,hasSecondaryAction:F,selected:C}),O=BH(M),A=Wt($,r),N=_.root||u.Root||PH,V=x.root||d.root||{},W=S({className:ke(O.root,V.className,l),disabled:m},R);let Q=c||"li";return a&&(W.component=c||"div",W.focusVisibleClassName=ke(fc.focusVisible,b),Q=Cs),F?(Q=!W.component&&!c?"div":Q,h==="li"&&(Q==="li"?Q="div":W.component==="li"&&(W.component="div")),T.jsx(Ks.Provider,{value:D,children:T.jsxs(NH,S({as:h,className:ke(O.container,p),ref:A,ownerState:M},P,{children:[T.jsx(N,S({},V,!Sa(N)&&{as:Q,ownerState:S({},M,V.ownerState)},W,{children:I})),I.pop()]}))})):T.jsx(Ks.Provider,{value:D,children:T.jsxs(N,S({},V,{as:Q,ref:A},!Sa(N)&&{ownerState:S({},M,V.ownerState)},W,{children:[I,k&&T.jsx(kH,{children:k})]}))})}),KN=EH;function RH(t){return Ue("MuiListItemIcon",t)}const L1=Ge("MuiListItemIcon",["root","alignItemsFlexStart"]),MH=["className"],DH=t=>{const{alignItems:e,classes:r}=t;return ze({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},RH,r)},LH=K("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>S({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),FH=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiListItemIcon"}),{className:n}=i,s=le(i,MH),a=w.useContext(Ks),o=S({},i,{alignItems:a.alignItems}),l=DH(o);return T.jsx(LH,S({className:ke(l.root,n),ownerState:o,ref:r},s))}),rl=FH;function IH(t){return Ue("MuiListItemText",t)}const OH=Ge("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),rm=OH,AH=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],VH=t=>{const{classes:e,inset:r,primary:i,secondary:n,dense:s}=t;return ze({root:["root",r&&"inset",s&&"dense",i&&n&&"multiline"],primary:["primary"],secondary:["secondary"]},IH,e)},$H=K("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${rm.primary}`]:e.primary},{[`& .${rm.secondary}`]:e.secondary},e.root,r.inset&&e.inset,r.primary&&r.secondary&&e.multiline,r.dense&&e.dense]}})(({ownerState:t})=>S({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),zH=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiListItemText"}),{children:n,className:s,disableTypography:a=!1,inset:o=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=i,h=le(i,AH),{dense:p}=w.useContext(Ks);let f=l??n,m=u;const y=S({},i,{disableTypography:a,inset:o,primary:!!f,secondary:!!m,dense:p}),v=VH(y);return f!=null&&f.type!==Mr&&!a&&(f=T.jsx(Mr,S({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:f}))),m!=null&&m.type!==Mr&&!a&&(m=T.jsx(Mr,S({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),T.jsxs($H,S({className:ke(v.root,s),ownerState:y,ref:r},h,{children:[f,m]}))}),il=zH,WH=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function qy(t,e,r){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:r?null:t.firstChild}function F1(t,e,r){return t===e?r?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:r?null:t.lastChild}function QN(t,e){if(e===void 0)return!0;let r=t.innerText;return r===void 0&&(r=t.textContent),r=r.trim().toLowerCase(),r.length===0?!1:e.repeating?r[0]===e.keys[0]:r.indexOf(e.keys.join(""))===0}function Xu(t,e,r,i,n,s){let a=!1,o=n(t,e,e?r:!1);for(;o;){if(o===t.firstChild){if(a)return!1;a=!0}const l=i?!1:o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||!QN(o,s)||l)o=n(t,o,r);else return o.focus(),!0}return!1}const HH=w.forwardRef(function(e,r){const{actions:i,autoFocus:n=!1,autoFocusItem:s=!1,children:a,className:o,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=e,h=le(e,WH),p=w.useRef(null),f=w.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});zr(()=>{n&&p.current.focus()},[n]),w.useImperativeHandle(i,()=>({adjustStyleForScrollbar:(b,{direction:k})=>{const C=!p.current.style.width;if(b.clientHeight{const k=p.current,C=b.key,x=qr(k).activeElement;if(C==="ArrowDown")b.preventDefault(),Xu(k,x,c,l,qy);else if(C==="ArrowUp")b.preventDefault(),Xu(k,x,c,l,F1);else if(C==="Home")b.preventDefault(),Xu(k,null,c,l,qy);else if(C==="End")b.preventDefault(),Xu(k,null,c,l,F1);else if(C.length===1){const _=f.current,P=C.toLowerCase(),R=performance.now();_.keys.length>0&&(R-_.lastTime>500?(_.keys=[],_.repeating=!0,_.previousKeyMatched=!0):_.repeating&&P!==_.keys[0]&&(_.repeating=!1)),_.lastTime=R,_.keys.push(P);const E=x&&!_.repeating&&QN(x,_);_.previousKeyMatched&&(E||Xu(k,x,!1,l,qy,_))?b.preventDefault():_.previousKeyMatched=!1}u&&u(b)},y=Wt(p,r);let v=-1;w.Children.forEach(a,(b,k)=>{if(!w.isValidElement(b)){v===k&&(v+=1,v>=a.length&&(v=-1));return}b.props.disabled||(d==="selectedMenu"&&b.props.selected||v===-1)&&(v=k),v===k&&(b.props.disabled||b.props.muiSkipListHighlight||b.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const g=w.Children.map(a,(b,k)=>{if(k===v){const C={};return s&&(C.autoFocus=!0),b.props.tabIndex===void 0&&d==="selectedMenu"&&(C.tabIndex=0),w.cloneElement(b,C)}return b});return T.jsx(Gh,S({role:"menu",ref:y,className:o,onKeyDown:m,tabIndex:n?0:-1},h,{children:g}))}),iS=HH;function UH(t){return Ue("MuiPopover",t)}Ge("MuiPopover",["root","paper"]);const GH=["onEntering"],jH=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],YH=["slotProps"];function I1(t,e){let r=0;return typeof e=="number"?r=e:e==="center"?r=t.height/2:e==="bottom"&&(r=t.height),r}function O1(t,e){let r=0;return typeof e=="number"?r=e:e==="center"?r=t.width/2:e==="right"&&(r=t.width),r}function A1(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function Ky(t){return typeof t=="function"?t():t}const XH=t=>{const{classes:e}=t;return ze({root:["root"],paper:["paper"]},UH,e)},qH=K(tS,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),JN=K(Xl,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),KH=w.forwardRef(function(e,r){var i,n,s;const a=Ve({props:e,name:"MuiPopover"}),{action:o,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:h,className:p,container:f,elevation:m=8,marginThreshold:y=16,open:v,PaperProps:g={},slots:b,slotProps:k,transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:x=GN,transitionDuration:_="auto",TransitionProps:{onEntering:P}={},disableScrollLock:R=!1}=a,E=le(a.TransitionProps,GH),D=le(a,jH),$=(i=k==null?void 0:k.paper)!=null?i:g,I=w.useRef(),F=Wt(I,$.ref),M=S({},a,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:y,externalPaperSlotProps:$,transformOrigin:C,TransitionComponent:x,transitionDuration:_,TransitionProps:E}),O=XH(M),A=w.useCallback(()=>{if(d==="anchorPosition")return u;const X=Ky(l),Y=(X&&X.nodeType===1?X:qr(I.current).body).getBoundingClientRect();return{top:Y.top+I1(Y,c.vertical),left:Y.left+O1(Y,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),N=w.useCallback(X=>({vertical:I1(X,C.vertical),horizontal:O1(X,C.horizontal)}),[C.horizontal,C.vertical]),V=w.useCallback(X=>{const ee={width:X.offsetWidth,height:X.offsetHeight},Y=N(ee);if(d==="none")return{top:null,left:null,transformOrigin:A1(Y)};const Pe=A();let ue=Pe.top-Y.vertical,L=Pe.left-Y.horizontal;const U=ue+ee.height,G=L+ee.width,re=ea(Ky(l)),Se=re.innerHeight-y,ge=re.innerWidth-y;if(y!==null&&ueSe){const Re=U-Se;ue-=Re,Y.vertical+=Re}if(y!==null&&Lge){const Re=G-ge;L-=Re,Y.horizontal+=Re}return{top:`${Math.round(ue)}px`,left:`${Math.round(L)}px`,transformOrigin:A1(Y)}},[l,d,A,N,y]),[W,Q]=w.useState(v),ne=w.useCallback(()=>{const X=I.current;if(!X)return;const ee=V(X);ee.top!==null&&(X.style.top=ee.top),ee.left!==null&&(X.style.left=ee.left),X.style.transformOrigin=ee.transformOrigin,Q(!0)},[V]);w.useEffect(()=>(R&&window.addEventListener("scroll",ne),()=>window.removeEventListener("scroll",ne)),[l,R,ne]);const ie=(X,ee)=>{P&&P(X,ee),ne()},te=()=>{Q(!1)};w.useEffect(()=>{v&&ne()}),w.useImperativeHandle(o,()=>v?{updatePosition:()=>{ne()}}:null,[v,ne]),w.useEffect(()=>{if(!v)return;const X=Vh(()=>{ne()}),ee=ea(l);return ee.addEventListener("resize",X),()=>{X.clear(),ee.removeEventListener("resize",X)}},[l,v,ne]);let j=_;_==="auto"&&!x.muiSupportAuto&&(j=void 0);const J=f||(l?qr(Ky(l)).body:void 0),me=(n=b==null?void 0:b.root)!=null?n:qH,pe=(s=b==null?void 0:b.paper)!=null?s:JN,De=Ct({elementType:pe,externalSlotProps:S({},$,{style:W?$.style:S({},$.style,{opacity:0})}),additionalProps:{elevation:m,ref:F},ownerState:M,className:ke(O.paper,$==null?void 0:$.className)}),Be=Ct({elementType:me,externalSlotProps:(k==null?void 0:k.root)||{},externalForwardedProps:D,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:J,open:v},ownerState:M,className:ke(O.root,p)}),{slotProps:Ce}=Be,Te=le(Be,YH);return T.jsx(me,S({},Te,!Sa(me)&&{slotProps:Ce,disableScrollLock:R},{children:T.jsx(x,S({appear:!0,in:v,onEntering:ie,onExited:te,timeout:j},E,{children:T.jsx(pe,S({},De,{children:h}))}))}))}),QH=KH;function JH(t){return Ue("MuiMenu",t)}Ge("MuiMenu",["root","paper","list"]);const ZH=["onEntering"],e8=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],t8={vertical:"top",horizontal:"right"},r8={vertical:"top",horizontal:"left"},i8=t=>{const{classes:e}=t;return ze({root:["root"],paper:["paper"],list:["list"]},JH,e)},n8=K(QH,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),s8=K(JN,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),a8=K(iS,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),o8=w.forwardRef(function(e,r){var i,n;const s=Ve({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:o,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:h,PaperProps:p={},PopoverClasses:f,transitionDuration:m="auto",TransitionProps:{onEntering:y}={},variant:v="selectedMenu",slots:g={},slotProps:b={}}=s,k=le(s.TransitionProps,ZH),C=le(s,e8),x=Xi(),_=S({},s,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:y,PaperProps:p,transitionDuration:m,TransitionProps:k,variant:v}),P=i8(_),R=a&&!c&&h,E=w.useRef(null),D=(N,V)=>{E.current&&E.current.adjustStyleForScrollbar(N,{direction:x?"rtl":"ltr"}),y&&y(N,V)},$=N=>{N.key==="Tab"&&(N.preventDefault(),d&&d(N,"tabKeyDown"))};let I=-1;w.Children.map(o,(N,V)=>{w.isValidElement(N)&&(N.props.disabled||(v==="selectedMenu"&&N.props.selected||I===-1)&&(I=V))});const F=(i=g.paper)!=null?i:s8,M=(n=b.paper)!=null?n:p,O=Ct({elementType:g.root,externalSlotProps:b.root,ownerState:_,className:[P.root,l]}),A=Ct({elementType:F,externalSlotProps:M,ownerState:_,className:P.paper});return T.jsx(n8,S({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:x?"right":"left"},transformOrigin:x?t8:r8,slots:{paper:F,root:g.root},slotProps:{root:O,paper:A},open:h,ref:r,transitionDuration:m,TransitionProps:S({onEntering:D},k),ownerState:_},C,{classes:f,children:T.jsx(a8,S({onKeyDown:$,actions:E,autoFocus:a&&(I===-1||c),autoFocusItem:R,variant:v},u,{className:ke(P.list,u.className),children:o}))}))}),l8=o8;function c8(t){return Ue("MuiMenuItem",t)}const u8=Ge("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),qu=u8,d8=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],h8=(t,e)=>{const{ownerState:r}=t;return[e.root,r.dense&&e.dense,r.divider&&e.divider,!r.disableGutters&&e.gutters]},f8=t=>{const{disabled:e,dense:r,divider:i,disableGutters:n,selected:s,classes:a}=t,l=ze({root:["root",r&&"dense",e&&"disabled",!n&&"gutters",i&&"divider",s&&"selected"]},c8,a);return S({},a,l)},p8=K(Cs,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:h8})(({theme:t,ownerState:e})=>S({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${qu.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${qu.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${qu.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Jt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${qu.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${qu.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${_1.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${_1.inset}`]:{marginLeft:52},[`& .${rm.root}`]:{marginTop:0,marginBottom:0},[`& .${rm.inset}`]:{paddingLeft:36},[`& .${L1.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&S({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${L1.root} svg`]:{fontSize:"1.25rem"}}))),m8=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiMenuItem"}),{autoFocus:n=!1,component:s="li",dense:a=!1,divider:o=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:h}=i,p=le(i,d8),f=w.useContext(Ks),m=w.useMemo(()=>({dense:a||f.dense||!1,disableGutters:l}),[f.dense,a,l]),y=w.useRef(null);zr(()=>{n&&y.current&&y.current.focus()},[n]);const v=S({},i,{dense:m.dense,divider:o,disableGutters:l}),g=f8(i),b=Wt(y,r);let k;return i.disabled||(k=d!==void 0?d:-1),T.jsx(Ks.Provider,{value:m,children:T.jsx(p8,S({ref:b,role:u,tabIndex:k,component:s,focusVisibleClassName:ke(g.focusVisible,c),className:ke(g.root,h)},p,{ownerState:v,classes:g}))})}),ZN=m8;function g8(t){return Ue("MuiNativeSelect",t)}const y8=Ge("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nS=y8,b8=["className","disabled","error","IconComponent","inputRef","variant"],v8=t=>{const{classes:e,variant:r,disabled:i,multiple:n,open:s,error:a}=t,o={select:["select",r,i&&"disabled",n&&"multiple",a&&"error"],icon:["icon",`icon${Ne(r)}`,s&&"iconOpen",i&&"disabled"]};return ze(o,g8,e)},eE=({ownerState:t,theme:e})=>S({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":S({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nS.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),w8=K("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:tn,overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.select,e[r.variant],r.error&&e.error,{[`&.${nS.multiple}`]:e.multiple}]}})(eE),tE=({ownerState:t,theme:e})=>S({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${nS.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),S8=K("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Ne(r.variant)}`],r.open&&e.iconOpen]}})(tE),x8=w.forwardRef(function(e,r){const{className:i,disabled:n,error:s,IconComponent:a,inputRef:o,variant:l="standard"}=e,c=le(e,b8),u=S({},e,{disabled:n,variant:l,error:s}),d=v8(u);return T.jsxs(w.Fragment,{children:[T.jsx(w8,S({ownerState:u,className:ke(d.select,i),disabled:n,ref:o||r},c)),e.multiple?null:T.jsx(S8,{as:a,ownerState:u,className:d.icon})]})}),k8=x8;var V1;const C8=["children","classes","className","label","notched"],T8=K("fieldset",{shouldForwardProp:tn})({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%"}),_8=K("legend",{shouldForwardProp:tn})(({ownerState:t,theme:e})=>S({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&S({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function B8(t){const{className:e,label:r,notched:i}=t,n=le(t,C8),s=r!=null&&r!=="",a=S({},t,{notched:i,withLabel:s});return T.jsx(T8,S({"aria-hidden":!0,className:e,ownerState:a},n,{children:T.jsx(_8,{ownerState:a,children:s?T.jsx("span",{children:r}):V1||(V1=T.jsx("span",{className:"notranslate",children:"​"}))})}))}const P8=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],N8=t=>{const{classes:e}=t,i=ze({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},F3,e);return S({},e,i)},E8=K(Wg,{shouldForwardProp:t=>tn(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:$g})(({theme:t,ownerState:e})=>{const r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return S({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${fo.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${fo.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${fo.focused} .${fo.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${fo.error} .${fo.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${fo.disabled} .${fo.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&S({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),R8=K(B8,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),M8=K(Hg,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:zg})(({theme:t,ownerState:e})=>S({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),rE=w.forwardRef(function(e,r){var i,n,s,a,o;const l=Ve({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:d="input",label:h,multiline:p=!1,notched:f,slots:m={},type:y="text"}=l,v=le(l,P8),g=N8(l),b=In(),k=Jo({props:l,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),C=S({},l,{color:k.color||"primary",disabled:k.disabled,error:k.error,focused:k.focused,formControl:b,fullWidth:u,hiddenLabel:k.hiddenLabel,multiline:p,size:k.size,type:y}),x=(i=(n=m.root)!=null?n:c.Root)!=null?i:E8,_=(s=(a=m.input)!=null?a:c.Input)!=null?s:M8;return T.jsx(eS,S({slots:{root:x,input:_},renderSuffix:P=>T.jsx(R8,{ownerState:C,className:g.notchedOutline,label:h!=null&&h!==""&&k.required?o||(o=T.jsxs(w.Fragment,{children:[h," ","*"]})):h,notched:typeof f<"u"?f:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:u,inputComponent:d,multiline:p,ref:r,type:y},v,{classes:S({},g,{notchedOutline:null})}))});rE.muiName="Input";const iE=rE,D8=Tr(T.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),L8=Tr(T.jsx("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}),"StarBorder");function F8(t){return Ue("MuiRating",t)}const I8=Ge("MuiRating",["root","sizeSmall","sizeMedium","sizeLarge","readOnly","disabled","focusVisible","visuallyHidden","pristine","label","labelEmptyValueActive","icon","iconEmpty","iconFilled","iconHover","iconFocus","iconActive","decimal"]),Ku=I8,O8=["value"],A8=["className","defaultValue","disabled","emptyIcon","emptyLabelText","getLabelText","highlightSelectedOnly","icon","IconContainerComponent","max","name","onChange","onChangeActive","onMouseLeave","onMouseMove","precision","readOnly","size","value"];function V8(t){const e=t.toString().split(".")[1];return e?e.length:0}function Qy(t,e){if(t==null)return t;const r=Math.round(t/e)*e;return Number(r.toFixed(V8(e)))}const $8=t=>{const{classes:e,size:r,readOnly:i,disabled:n,emptyValueFocused:s,focusVisible:a}=t,o={root:["root",`size${Ne(r)}`,n&&"disabled",a&&"focusVisible",i&&"readOnly"],label:["label","pristine"],labelEmptyValue:[s&&"labelEmptyValueActive"],icon:["icon"],iconEmpty:["iconEmpty"],iconFilled:["iconFilled"],iconHover:["iconHover"],iconFocus:["iconFocus"],iconActive:["iconActive"],decimal:["decimal"],visuallyHidden:["visuallyHidden"]};return ze(o,F8,e)},z8=K("span",{name:"MuiRating",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Ku.visuallyHidden}`]:e.visuallyHidden},e.root,e[`size${Ne(r.size)}`],r.readOnly&&e.readOnly]}})(({theme:t,ownerState:e})=>S({display:"inline-flex",position:"relative",fontSize:t.typography.pxToRem(24),color:"#faaf00",cursor:"pointer",textAlign:"left",width:"min-content",WebkitTapHighlightColor:"transparent",[`&.${Ku.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Ku.focusVisible} .${Ku.iconActive}`]:{outline:"1px solid #999"},[`& .${Ku.visuallyHidden}`]:Lw},e.size==="small"&&{fontSize:t.typography.pxToRem(18)},e.size==="large"&&{fontSize:t.typography.pxToRem(30)},e.readOnly&&{pointerEvents:"none"})),nE=K("label",{name:"MuiRating",slot:"Label",overridesResolver:({ownerState:t},e)=>[e.label,t.emptyValueFocused&&e.labelEmptyValueActive]})(({ownerState:t})=>S({cursor:"inherit"},t.emptyValueFocused&&{top:0,bottom:0,position:"absolute",outline:"1px solid #999",width:"100%"})),W8=K("span",{name:"MuiRating",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.iconEmpty&&e.iconEmpty,r.iconFilled&&e.iconFilled,r.iconHover&&e.iconHover,r.iconFocus&&e.iconFocus,r.iconActive&&e.iconActive]}})(({theme:t,ownerState:e})=>S({display:"flex",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),pointerEvents:"none"},e.iconActive&&{transform:"scale(1.2)"},e.iconEmpty&&{color:(t.vars||t).palette.action.disabled})),H8=K("span",{name:"MuiRating",slot:"Decimal",shouldForwardProp:t=>zh(t)&&t!=="iconActive",overridesResolver:(t,e)=>{const{iconActive:r}=t;return[e.decimal,r&&e.iconActive]}})(({iconActive:t})=>S({position:"relative"},t&&{transform:"scale(1.2)"}));function U8(t){const e=le(t,O8);return T.jsx("span",S({},e))}function $1(t){const{classes:e,disabled:r,emptyIcon:i,focus:n,getLabelText:s,highlightSelectedOnly:a,hover:o,icon:l,IconContainerComponent:c,isActive:u,itemValue:d,labelProps:h,name:p,onBlur:f,onChange:m,onClick:y,onFocus:v,readOnly:g,ownerState:b,ratingValue:k,ratingValueRounded:C}=t,x=a?d===k:d<=k,_=d<=o,P=d<=n,R=d===C,E=ia(),D=T.jsx(W8,{as:c,value:d,className:ke(e.icon,x?e.iconFilled:e.iconEmpty,_&&e.iconHover,P&&e.iconFocus,u&&e.iconActive),ownerState:S({},b,{iconEmpty:!x,iconFilled:x,iconHover:_,iconFocus:P,iconActive:u}),children:i&&!x?i:l});return g?T.jsx("span",S({},h,{children:D})):T.jsxs(w.Fragment,{children:[T.jsxs(nE,S({ownerState:S({},b,{emptyValueFocused:void 0}),htmlFor:E},h,{children:[D,T.jsx("span",{className:e.visuallyHidden,children:s(d)})]})),T.jsx("input",{className:e.visuallyHidden,onFocus:v,onBlur:f,onChange:m,onClick:y,disabled:r,value:d,id:E,type:"radio",name:p,checked:R})]})}const G8=T.jsx(D8,{fontSize:"inherit"}),j8=T.jsx(L8,{fontSize:"inherit"});function Y8(t){return`${t} Star${t!==1?"s":""}`}const X8=w.forwardRef(function(e,r){const i=Ve({name:"MuiRating",props:e}),{className:n,defaultValue:s=null,disabled:a=!1,emptyIcon:o=j8,emptyLabelText:l="Empty",getLabelText:c=Y8,highlightSelectedOnly:u=!1,icon:d=G8,IconContainerComponent:h=U8,max:p=5,name:f,onChange:m,onChangeActive:y,onMouseLeave:v,onMouseMove:g,precision:b=1,readOnly:k=!1,size:C="medium",value:x}=i,_=le(i,A8),P=ia(f),[R,E]=xs({controlled:x,default:s,name:"Rating"}),D=Qy(R,b),$=Xi(),[{hover:I,focus:F},M]=w.useState({hover:-1,focus:-1});let O=D;I!==-1&&(O=I),F!==-1&&(O=F);const{isFocusVisibleRef:A,onBlur:N,onFocus:V,ref:W}=Dw(),[Q,ne]=w.useState(!1),ie=w.useRef(),te=Wt(W,ie,r),j=Y=>{g&&g(Y);const Pe=ie.current,{right:ue,left:L,width:U}=Pe.getBoundingClientRect();let G;$?G=(ue-Y.clientX)/U:G=(Y.clientX-L)/U;let re=Qy(p*G+b/2,b);re=xo(re,b,p),M(Se=>Se.hover===re&&Se.focus===re?Se:{hover:re,focus:re}),ne(!1),y&&I!==re&&y(Y,re)},J=Y=>{v&&v(Y);const Pe=-1;M({hover:Pe,focus:Pe}),y&&I!==Pe&&y(Y,Pe)},me=Y=>{let Pe=Y.target.value===""?null:parseFloat(Y.target.value);I!==-1&&(Pe=I),E(Pe),m&&m(Y,Pe)},pe=Y=>{Y.clientX===0&&Y.clientY===0||(M({hover:-1,focus:-1}),E(null),m&&parseFloat(Y.target.value)===D&&m(Y,null))},De=Y=>{V(Y),A.current===!0&&ne(!0);const Pe=parseFloat(Y.target.value);M(ue=>({hover:ue.hover,focus:Pe}))},Be=Y=>{if(I!==-1)return;N(Y),A.current===!1&&ne(!1);const Pe=-1;M(ue=>({hover:ue.hover,focus:Pe}))},[Ce,Te]=w.useState(!1),X=S({},i,{defaultValue:s,disabled:a,emptyIcon:o,emptyLabelText:l,emptyValueFocused:Ce,focusVisible:Q,getLabelText:c,icon:d,IconContainerComponent:h,max:p,precision:b,readOnly:k,size:C}),ee=$8(X);return T.jsxs(z8,S({ref:te,onMouseMove:j,onMouseLeave:J,className:ke(ee.root,n,k&&"MuiRating-readOnly"),ownerState:X,role:k?"img":null,"aria-label":k?c(O):null},_,{children:[Array.from(new Array(p)).map((Y,Pe)=>{const ue=Pe+1,L={classes:ee,disabled:a,emptyIcon:o,focus:F,getLabelText:c,highlightSelectedOnly:u,hover:I,icon:d,IconContainerComponent:h,name:P,onBlur:Be,onChange:me,onClick:pe,onFocus:De,ratingValue:O,ratingValueRounded:D,readOnly:k,ownerState:X},U=ue===Math.ceil(O)&&(I!==-1||F!==-1);if(b<1){const G=Array.from(new Array(1/b));return T.jsx(H8,{className:ke(ee.decimal,U&&ee.iconActive),ownerState:X,iconActive:U,children:G.map((re,Se)=>{const ge=Qy(ue-1+(Se+1)*b,b);return T.jsx($1,S({},L,{isActive:!1,itemValue:ge,labelProps:{style:G.length-1===Se?{}:{width:ge===O?`${(Se+1)*b*100}%`:"0%",overflow:"hidden",position:"absolute"}}}),ge)})},ue)}return T.jsx($1,S({},L,{isActive:U,itemValue:ue}),ue)}),!k&&!a&&T.jsxs(nE,{className:ke(ee.label,ee.labelEmptyValue),ownerState:X,children:[T.jsx("input",{className:ee.visuallyHidden,value:"",id:`${P}-empty`,type:"radio",name:P,checked:D==null,onFocus:()=>Te(!0),onBlur:()=>Te(!1),onChange:me}),T.jsx("span",{className:ee.visuallyHidden,children:l})]})]}))}),q8=X8;function K8(t){return Ue("MuiSelect",t)}const Qu=Ge("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var z1;const Q8=["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"],J8=K("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`&.${Qu.select}`]:e.select},{[`&.${Qu.select}`]:e[r.variant]},{[`&.${Qu.error}`]:e.error},{[`&.${Qu.multiple}`]:e.multiple}]}})(eE,{[`&.${Qu.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Z8=K("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Ne(r.variant)}`],r.open&&e.iconOpen]}})(tE),eU=K("input",{shouldForwardProp:t=>zh(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function W1(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function tU(t){return t==null||typeof t=="string"&&!t.trim()}const rU=t=>{const{classes:e,variant:r,disabled:i,multiple:n,open:s,error:a}=t,o={select:["select",r,i&&"disabled",n&&"multiple",a&&"error"],icon:["icon",`icon${Ne(r)}`,s&&"iconOpen",i&&"disabled"],nativeInput:["nativeInput"]};return ze(o,K8,e)},iU=w.forwardRef(function(e,r){var i;const{"aria-describedby":n,"aria-label":s,autoFocus:a,autoWidth:o,children:l,className:c,defaultOpen:u,defaultValue:d,disabled:h,displayEmpty:p,error:f=!1,IconComponent:m,inputRef:y,labelId:v,MenuProps:g={},multiple:b,name:k,onBlur:C,onChange:x,onClose:_,onFocus:P,onOpen:R,open:E,readOnly:D,renderValue:$,SelectDisplayProps:I={},tabIndex:F,value:M,variant:O="standard"}=e,A=le(e,Q8),[N,V]=xs({controlled:M,default:d,name:"Select"}),[W,Q]=xs({controlled:E,default:u,name:"Select"}),ne=w.useRef(null),ie=w.useRef(null),[te,j]=w.useState(null),{current:J}=w.useRef(E!=null),[me,pe]=w.useState(),De=Wt(r,y),Be=w.useCallback(Ie=>{ie.current=Ie,Ie&&j(Ie)},[]),Ce=te==null?void 0:te.parentNode;w.useImperativeHandle(De,()=>({focus:()=>{ie.current.focus()},node:ne.current,value:N}),[N]),w.useEffect(()=>{u&&W&&te&&!J&&(pe(o?null:Ce.clientWidth),ie.current.focus())},[te,o]),w.useEffect(()=>{a&&ie.current.focus()},[a]),w.useEffect(()=>{if(!v)return;const Ie=qr(ie.current).getElementById(v);if(Ie){const xt=()=>{getSelection().isCollapsed&&ie.current.focus()};return Ie.addEventListener("click",xt),()=>{Ie.removeEventListener("click",xt)}}},[v]);const Te=(Ie,xt)=>{Ie?R&&R(xt):_&&_(xt),J||(pe(o?null:Ce.clientWidth),Q(Ie))},X=Ie=>{Ie.button===0&&(Ie.preventDefault(),ie.current.focus(),Te(!0,Ie))},ee=Ie=>{Te(!1,Ie)},Y=w.Children.toArray(l),Pe=Ie=>{const xt=Y.find(Le=>Le.props.value===Ie.target.value);xt!==void 0&&(V(xt.props.value),x&&x(Ie,xt))},ue=Ie=>xt=>{let Le;if(xt.currentTarget.hasAttribute("tabindex")){if(b){Le=Array.isArray(N)?N.slice():[];const Oe=N.indexOf(Ie.props.value);Oe===-1?Le.push(Ie.props.value):Le.splice(Oe,1)}else Le=Ie.props.value;if(Ie.props.onClick&&Ie.props.onClick(xt),N!==Le&&(V(Le),x)){const Oe=xt.nativeEvent||xt,wt=new Oe.constructor(Oe.type,Oe);Object.defineProperty(wt,"target",{writable:!0,value:{value:Le,name:k}}),x(wt,Ie)}b||Te(!1,xt)}},L=Ie=>{D||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Ie.key)!==-1&&(Ie.preventDefault(),Te(!0,Ie))},U=te!==null&&W,G=Ie=>{!U&&C&&(Object.defineProperty(Ie,"target",{writable:!0,value:{value:N,name:k}}),C(Ie))};delete A["aria-invalid"];let re,Se;const ge=[];let Re=!1;(tm({value:N})||p)&&($?re=$(N):Re=!0);const Ke=Y.map(Ie=>{if(!w.isValidElement(Ie))return null;let xt;if(b){if(!Array.isArray(N))throw new Error(Ja(2));xt=N.some(Le=>W1(Le,Ie.props.value)),xt&&Re&&ge.push(Ie.props.children)}else xt=W1(N,Ie.props.value),xt&&Re&&(Se=Ie.props.children);return w.cloneElement(Ie,{"aria-selected":xt?"true":"false",onClick:ue(Ie),onKeyUp:Le=>{Le.key===" "&&Le.preventDefault(),Ie.props.onKeyUp&&Ie.props.onKeyUp(Le)},role:"option",selected:xt,value:void 0,"data-value":Ie.props.value})});Re&&(b?ge.length===0?re=null:re=ge.reduce((Ie,xt,Le)=>(Ie.push(xt),Le{const{classes:e}=t;return e},sS={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>tn(t)&&t!=="variant",slot:"Root"},lU=K(rS,sS)(""),cU=K(iE,sS)(""),uU=K(zN,sS)(""),sE=w.forwardRef(function(e,r){const i=Ve({name:"MuiSelect",props:e}),{autoWidth:n=!1,children:s,classes:a={},className:o,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=V3,id:d,input:h,inputProps:p,label:f,labelId:m,MenuProps:y,multiple:v=!1,native:g=!1,onClose:b,onOpen:k,open:C,renderValue:x,SelectDisplayProps:_,variant:P="outlined"}=i,R=le(i,sU),E=g?k8:nU,D=In(),$=Jo({props:i,muiFormControl:D,states:["variant","error"]}),I=$.variant||P,F=S({},i,{variant:I,classes:a}),M=oU(F),O=le(M,aU),A=h||{standard:T.jsx(lU,{ownerState:F}),outlined:T.jsx(cU,{label:f,ownerState:F}),filled:T.jsx(uU,{ownerState:F})}[I],N=Wt(r,A.ref);return T.jsx(w.Fragment,{children:w.cloneElement(A,S({inputComponent:E,inputProps:S({children:s,error:$.error,IconComponent:u,variant:I,type:void 0,multiple:v},g?{id:d}:{autoWidth:n,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:y,onClose:b,onOpen:k,open:C,renderValue:x,SelectDisplayProps:S({id:d},_)},p,{classes:p?gn(O,p.classes):O},h?h.props.inputProps:{})},(v&&g||c)&&I==="outlined"?{notched:!0}:{},{ref:N,className:ke(A.props.className,o,M.root)},!h&&{variant:I},R))})});sE.muiName="Select";const dU=sE,hU=t=>!t||!Sa(t);function fU(t){return Ue("MuiSlider",t)}const pU=Ge("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),ys=pU,mU=t=>{const{open:e}=t;return{offset:ke(e&&ys.valueLabelOpen),circle:ys.valueLabelCircle,label:ys.valueLabelLabel}};function gU(t){const{children:e,className:r,value:i}=t,n=mU(t);return e?w.cloneElement(e,{className:ke(e.props.className)},T.jsxs(w.Fragment,{children:[e.props.children,T.jsx("span",{className:ke(n.offset,r),"aria-hidden":!0,children:T.jsx("span",{className:n.circle,children:T.jsx("span",{className:n.label,children:i})})})]})):null}const yU=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],bU=hN();function H1(t){return t}const vU=K("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`color${Ne(r.color)}`],r.size!=="medium"&&e[`size${Ne(r.size)}`],r.marked&&e.marked,r.orientation==="vertical"&&e.vertical,r.track==="inverted"&&e.trackInverted,r.track===!1&&e.trackFalse]}})(({theme:t})=>{var e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${ys.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${ys.dragging}`]:{[`& .${ys.thumb}, & .${ys.track}`]:{transition:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r},style:{color:(t.vars||t).palette[r].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),wU=K("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),SU=K("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>{var e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r,track:"inverted"},style:S({},t.vars?{backgroundColor:t.vars.palette.Slider[`${r}Track`],borderColor:t.vars.palette.Slider[`${r}Track`]}:S({backgroundColor:Kp(t.palette[r].main,.62),borderColor:Kp(t.palette[r].main,.62)},t.applyStyles("dark",{backgroundColor:qp(t.palette[r].main,.5)}),t.applyStyles("dark",{borderColor:qp(t.palette[r].main,.5)})))}))]}}),xU=K("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.thumb,e[`thumbColor${Ne(r.color)}`],r.size!=="medium"&&e[`thumbSize${Ne(r.size)}`]]}})(({theme:t})=>{var e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${ys.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(r=>{var i;return((i=t.vars)!=null?i:t).palette[r].main}).map(r=>({props:{color:r},style:{[`&:hover, &.${ys.focusVisible}`]:S({},t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Jt(t.palette[r].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${ys.active}`]:S({},t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[r].mainChannel} / 0.16)}`}:{boxShadow:`0px 0px 0px 14px ${Jt(t.palette[r].main,.16)}`})}})),{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}}]}}),kU=K(gU,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(({theme:t})=>S({zIndex:1,whiteSpace:"nowrap"},t.typography.body2,{fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${ys.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${ys.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),CU=K("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>zh(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:r}=t;return[e.mark,r&&e.markActive]}})(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]})),TU=K("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>zh(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(({theme:t})=>S({},t.typography.body2,{color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]})),_U=t=>{const{disabled:e,dragging:r,marked:i,orientation:n,track:s,classes:a,color:o,size:l}=t,c={root:["root",e&&"disabled",r&&"dragging",i&&"marked",n==="vertical"&&"vertical",s==="inverted"&&"trackInverted",s===!1&&"trackFalse",o&&`color${Ne(o)}`,l&&`size${Ne(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${Ne(l)}`,o&&`thumbColor${Ne(o)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return ze(c,fU,a)},BU=({children:t})=>t,PU=w.forwardRef(function(e,r){var i,n,s,a,o,l,c,u,d,h,p,f,m,y,v,g,b,k,C,x,_,P,R,E;const D=bU({props:e,name:"MuiSlider"}),$=Xi(),{"aria-label":I,"aria-valuetext":F,"aria-labelledby":M,component:O="span",components:A={},componentsProps:N={},color:V="primary",classes:W,className:Q,disableSwap:ne=!1,disabled:ie=!1,getAriaLabel:te,getAriaValueText:j,marks:J=!1,max:me=100,min:pe=0,orientation:De="horizontal",shiftStep:Be=10,size:Ce="medium",step:Te=1,scale:X=H1,slotProps:ee,slots:Y,track:Pe="normal",valueLabelDisplay:ue="off",valueLabelFormat:L=H1}=D,U=le(D,yU),G=S({},D,{isRtl:$,max:me,min:pe,classes:W,disabled:ie,disableSwap:ne,orientation:De,marks:J,color:V,size:Ce,step:Te,shiftStep:Be,scale:X,track:Pe,valueLabelDisplay:ue,valueLabelFormat:L}),{axisProps:re,getRootProps:Se,getHiddenInputProps:ge,getThumbProps:Re,open:Ke,active:ct,axis:Pt,focusedThumbIndex:ve,range:ce,dragging:Qe,marks:bt,values:Tt,trackOffset:Ie,trackLeap:xt,getThumbStyle:Le}=t3(S({},G,{rootRef:r}));G.marked=bt.length>0&&bt.some(gr=>gr.label),G.dragging=Qe,G.focusedThumbIndex=ve;const Oe=_U(G),wt=(i=(n=Y==null?void 0:Y.root)!=null?n:A.Root)!=null?i:vU,st=(s=(a=Y==null?void 0:Y.rail)!=null?a:A.Rail)!=null?s:wU,Ht=(o=(l=Y==null?void 0:Y.track)!=null?l:A.Track)!=null?o:SU,Sr=(c=(u=Y==null?void 0:Y.thumb)!=null?u:A.Thumb)!=null?c:xU,_r=(d=(h=Y==null?void 0:Y.valueLabel)!=null?h:A.ValueLabel)!=null?d:kU,Rs=(p=(f=Y==null?void 0:Y.mark)!=null?f:A.Mark)!=null?p:CU,Z=(m=(y=Y==null?void 0:Y.markLabel)!=null?y:A.MarkLabel)!=null?m:TU,se=(v=(g=Y==null?void 0:Y.input)!=null?g:A.Input)!=null?v:"input",_e=(b=ee==null?void 0:ee.root)!=null?b:N.root,He=(k=ee==null?void 0:ee.rail)!=null?k:N.rail,it=(C=ee==null?void 0:ee.track)!=null?C:N.track,It=(x=ee==null?void 0:ee.thumb)!=null?x:N.thumb,kt=(_=ee==null?void 0:ee.valueLabel)!=null?_:N.valueLabel,St=(P=ee==null?void 0:ee.mark)!=null?P:N.mark,dt=(R=ee==null?void 0:ee.markLabel)!=null?R:N.markLabel,Ut=(E=ee==null?void 0:ee.input)!=null?E:N.input,wi=Ct({elementType:wt,getSlotProps:Se,externalSlotProps:_e,externalForwardedProps:U,additionalProps:S({},hU(wt)&&{as:O}),ownerState:S({},G,_e==null?void 0:_e.ownerState),className:[Oe.root,Q]}),Ot=Ct({elementType:st,externalSlotProps:He,ownerState:G,className:Oe.rail}),dr=Ct({elementType:Ht,externalSlotProps:it,additionalProps:{style:S({},re[Pt].offset(Ie),re[Pt].leap(xt))},ownerState:S({},G,it==null?void 0:it.ownerState),className:Oe.track}),ci=Ct({elementType:Sr,getSlotProps:Re,externalSlotProps:It,ownerState:S({},G,It==null?void 0:It.ownerState),className:Oe.thumb}),nn=Ct({elementType:_r,externalSlotProps:kt,ownerState:S({},G,kt==null?void 0:kt.ownerState),className:Oe.valueLabel}),Qr=Ct({elementType:Rs,externalSlotProps:St,ownerState:G,className:Oe.mark}),sa=Ct({elementType:Z,externalSlotProps:dt,ownerState:G,className:Oe.markLabel}),Eu=Ct({elementType:se,getSlotProps:ge,externalSlotProps:Ut,ownerState:G});return T.jsxs(wt,S({},wi,{children:[T.jsx(st,S({},Ot)),T.jsx(Ht,S({},dr)),bt.filter(gr=>gr.value>=pe&&gr.value<=me).map((gr,xr)=>{const Ms=em(gr.value,pe,me),uo=re[Pt].offset(Ms);let sn;return Pe===!1?sn=Tt.indexOf(gr.value)!==-1:sn=Pe==="normal"&&(ce?gr.value>=Tt[0]&&gr.value<=Tt[Tt.length-1]:gr.value<=Tt[0])||Pe==="inverted"&&(ce?gr.value<=Tt[0]||gr.value>=Tt[Tt.length-1]:gr.value>=Tt[0]),T.jsxs(w.Fragment,{children:[T.jsx(Rs,S({"data-index":xr},Qr,!Sa(Rs)&&{markActive:sn},{style:S({},uo,Qr.style),className:ke(Qr.className,sn&&Oe.markActive)})),gr.label!=null?T.jsx(Z,S({"aria-hidden":!0,"data-index":xr},sa,!Sa(Z)&&{markLabelActive:sn},{style:S({},uo,sa.style),className:ke(Oe.markLabel,sa.className,sn&&Oe.markLabelActive),children:gr.label})):null]},xr)}),Tt.map((gr,xr)=>{const Ms=em(gr,pe,me),uo=re[Pt].offset(Ms),sn=ue==="off"?BU:_r;return T.jsx(sn,S({},!Sa(sn)&&{valueLabelFormat:L,valueLabelDisplay:ue,value:typeof L=="function"?L(X(gr),xr):L,index:xr,open:Ke===xr||ct===xr||ue==="on",disabled:ie},nn,{children:T.jsx(Sr,S({"data-index":xr},ci,{className:ke(Oe.thumb,ci.className,ct===xr&&Oe.active,ve===xr&&Oe.focusVisible),style:S({},uo,Le(xr),ci.style),children:T.jsx(se,S({"data-index":xr,"aria-label":te?te(xr):I,"aria-valuenow":X(gr),"aria-labelledby":M,"aria-valuetext":j?j(X(gr),xr):F,value:Tt[xr]},Eu))}))}),xr)})]}))}),aE=PU;function NU(t){return Ue("MuiSwitch",t)}const on=Ge("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),EU=["className","color","edge","size","sx"],RU=hN(),MU=t=>{const{classes:e,edge:r,size:i,color:n,checked:s,disabled:a}=t,o={root:["root",r&&`edge${Ne(r)}`,`size${Ne(i)}`],switchBase:["switchBase",`color${Ne(n)}`,s&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=ze(o,NU,e);return S({},e,l)},DU=K("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.edge&&e[`edge${Ne(r.edge)}`],e[`size${Ne(r.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${on.thumb}`]:{width:16,height:16},[`& .${on.switchBase}`]:{padding:4,[`&.${on.checked}`]:{transform:"translateX(16px)"}}}}]}),LU=K(Az,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.switchBase,{[`& .${on.input}`]:e.input},r.color!=="default"&&e[`color${Ne(r.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${on.checked}`]:{transform:"translateX(20px)"},[`&.${on.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${on.checked} + .${on.track}`]:{opacity:.5},[`&.${on.disabled} + .${on.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${on.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${on.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${on.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Kp(t.palette[e].main,.62):qp(t.palette[e].main,.55)}`}},[`&.${on.checked} + .${on.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),FU=K("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),IU=K("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),OU=w.forwardRef(function(e,r){const i=RU({props:e,name:"MuiSwitch"}),{className:n,color:s="primary",edge:a=!1,size:o="medium",sx:l}=i,c=le(i,EU),u=S({},i,{color:s,edge:a,size:o}),d=MU(u),h=T.jsx(IU,{className:d.thumb,ownerState:u});return T.jsxs(DU,{className:ke(d.root,n),sx:l,ownerState:u,children:[T.jsx(LU,S({type:"checkbox",icon:h,checkedIcon:h,ref:r,ownerState:u},c,{classes:S({},d,{root:d.switchBase})})),T.jsx(FU,{className:d.track,ownerState:u})]})}),AU=OU;function VU(t){return Ue("MuiTab",t)}const $U=Ge("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),nl=$U,zU=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],WU=t=>{const{classes:e,textColor:r,fullWidth:i,wrapped:n,icon:s,label:a,selected:o,disabled:l}=t,c={root:["root",s&&a&&"labelIcon",`textColor${Ne(r)}`,i&&"fullWidth",n&&"wrapped",o&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return ze(c,VU,e)},HU=K(Cs,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Ne(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>S({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${nl.iconWrapper}`]:S({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${nl.selected}`]:{opacity:1},[`&.${nl.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${nl.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${nl.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${nl.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${nl.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),UU=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTab"}),{className:n,disabled:s=!1,disableFocusRipple:a=!1,fullWidth:o,icon:l,iconPosition:c="top",indicator:u,label:d,onChange:h,onClick:p,onFocus:f,selected:m,selectionFollowsFocus:y,textColor:v="inherit",value:g,wrapped:b=!1}=i,k=le(i,zU),C=S({},i,{disabled:s,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!d,fullWidth:o,textColor:v,wrapped:b}),x=WU(C),_=l&&d&&w.isValidElement(l)?w.cloneElement(l,{className:ke(x.iconWrapper,l.props.className)}):l,P=E=>{!m&&h&&h(E,g),p&&p(E)},R=E=>{y&&!m&&h&&h(E,g),f&&f(E)};return T.jsxs(HU,S({focusRipple:!a,className:ke(x.root,n),ref:r,role:"tab","aria-selected":m,disabled:s,onClick:P,onFocus:R,ownerState:C,tabIndex:m?0:-1},k,{children:[c==="top"||c==="start"?T.jsxs(w.Fragment,{children:[_,d]}):T.jsxs(w.Fragment,{children:[d,_]}),u]}))}),GU=UU;function jU(t){return Ue("MuiToolbar",t)}Ge("MuiToolbar",["root","gutters","regular","dense"]);const YU=["className","component","disableGutters","variant"],XU=t=>{const{classes:e,disableGutters:r,variant:i}=t;return ze({root:["root",!r&&"gutters",i]},jU,e)},qU=K("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableGutters&&e.gutters,e[r.variant]]}})(({theme:t,ownerState:e})=>S({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),KU=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiToolbar"}),{className:n,component:s="div",disableGutters:a=!1,variant:o="regular"}=i,l=le(i,YU),c=S({},i,{component:s,disableGutters:a,variant:o}),u=XU(c);return T.jsx(qU,S({as:s,className:ke(u.root,n),ref:r,ownerState:c},l))}),QU=KU,JU=Tr(T.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ZU=Tr(T.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function eG(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function tG(t,e,r,i={},n=()=>{}){const{ease:s=eG,duration:a=300}=i;let o=null;const l=e[t];let c=!1;const u=()=>{c=!0},d=h=>{if(c){n(new Error("Animation cancelled"));return}o===null&&(o=h);const p=Math.min(1,(h-o)/a);if(e[t]=s(p)*(r-l)+l,p>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(d)};return l===r?(n(new Error("Element already at target position")),u):(requestAnimationFrame(d),u)}const rG=["onChange"],iG={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function nG(t){const{onChange:e}=t,r=le(t,rG),i=w.useRef(),n=w.useRef(null),s=()=>{i.current=n.current.offsetHeight-n.current.clientHeight};return zr(()=>{const a=Vh(()=>{const l=i.current;s(),l!==i.current&&e(i.current)}),o=ea(n.current);return o.addEventListener("resize",a),()=>{a.clear(),o.removeEventListener("resize",a)}},[e]),w.useEffect(()=>{s(),e(i.current)},[e]),T.jsx("div",S({style:iG,ref:n},r))}function sG(t){return Ue("MuiTabScrollButton",t)}const aG=Ge("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),oG=aG,lG=["className","slots","slotProps","direction","orientation","disabled"],cG=t=>{const{classes:e,orientation:r,disabled:i}=t;return ze({root:["root",r,i&&"disabled"]},sG,e)},uG=K(Cs,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>S({width:40,flexShrink:0,opacity:.8,[`&.${oG.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),dG=w.forwardRef(function(e,r){var i,n;const s=Ve({props:e,name:"MuiTabScrollButton"}),{className:a,slots:o={},slotProps:l={},direction:c}=s,u=le(s,lG),d=Xi(),h=S({isRtl:d},s),p=cG(h),f=(i=o.StartScrollButtonIcon)!=null?i:JU,m=(n=o.EndScrollButtonIcon)!=null?n:ZU,y=Ct({elementType:f,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h}),v=Ct({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h});return T.jsx(uG,S({component:"div",className:ke(p.root,a),ref:r,role:null,ownerState:h,tabIndex:null},u,{children:c==="left"?T.jsx(f,S({},y)):T.jsx(m,S({},v))}))}),hG=dG;function fG(t){return Ue("MuiTabs",t)}const pG=Ge("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Jy=pG,mG=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],U1=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,G1=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,Df=(t,e,r)=>{let i=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(i)return;i=!0}const s=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||s)n=r(t,n);else{n.focus();return}}},gG=t=>{const{vertical:e,fixed:r,hideScrollbar:i,scrollableX:n,scrollableY:s,centered:a,scrollButtonsHideMobile:o,classes:l}=t;return ze({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",i&&"hideScrollbar",n&&"scrollableX",s&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",o&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[i&&"hideScrollbar"]},fG,l)},yG=K("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Jy.scrollButtons}`]:e.scrollButtons},{[`& .${Jy.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>S({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${Jy.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),bG=K("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>S({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),vG=K("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>S({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),wG=K("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>S({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),SG=K(nG)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),j1={},xG=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTabs"}),n=Ko(),s=Xi(),{"aria-label":a,"aria-labelledby":o,action:l,centered:c=!1,children:u,className:d,component:h="div",allowScrollButtonsMobile:p=!1,indicatorColor:f="primary",onChange:m,orientation:y="horizontal",ScrollButtonComponent:v=hG,scrollButtons:g="auto",selectionFollowsFocus:b,slots:k={},slotProps:C={},TabIndicatorProps:x={},TabScrollButtonProps:_={},textColor:P="primary",value:R,variant:E="standard",visibleScrollbar:D=!1}=i,$=le(i,mG),I=E==="scrollable",F=y==="vertical",M=F?"scrollTop":"scrollLeft",O=F?"top":"left",A=F?"bottom":"right",N=F?"clientHeight":"clientWidth",V=F?"height":"width",W=S({},i,{component:h,allowScrollButtonsMobile:p,indicatorColor:f,orientation:y,vertical:F,scrollButtons:g,textColor:P,variant:E,visibleScrollbar:D,fixed:!I,hideScrollbar:I&&!D,scrollableX:I&&!F,scrollableY:I&&F,centered:c&&!I,scrollButtonsHideMobile:!p}),Q=gG(W),ne=Ct({elementType:k.StartScrollButtonIcon,externalSlotProps:C.startScrollButtonIcon,ownerState:W}),ie=Ct({elementType:k.EndScrollButtonIcon,externalSlotProps:C.endScrollButtonIcon,ownerState:W}),[te,j]=w.useState(!1),[J,me]=w.useState(j1),[pe,De]=w.useState(!1),[Be,Ce]=w.useState(!1),[Te,X]=w.useState(!1),[ee,Y]=w.useState({overflow:"hidden",scrollbarWidth:0}),Pe=new Map,ue=w.useRef(null),L=w.useRef(null),U=()=>{const Le=ue.current;let Oe;if(Le){const st=Le.getBoundingClientRect();Oe={clientWidth:Le.clientWidth,scrollLeft:Le.scrollLeft,scrollTop:Le.scrollTop,scrollLeftNormalized:HA(Le,s?"rtl":"ltr"),scrollWidth:Le.scrollWidth,top:st.top,bottom:st.bottom,left:st.left,right:st.right}}let wt;if(Le&&R!==!1){const st=L.current.children;if(st.length>0){const Ht=st[Pe.get(R)];wt=Ht?Ht.getBoundingClientRect():null}}return{tabsMeta:Oe,tabMeta:wt}},G=Xe(()=>{const{tabsMeta:Le,tabMeta:Oe}=U();let wt=0,st;if(F)st="top",Oe&&Le&&(wt=Oe.top-Le.top+Le.scrollTop);else if(st=s?"right":"left",Oe&&Le){const Sr=s?Le.scrollLeftNormalized+Le.clientWidth-Le.scrollWidth:Le.scrollLeft;wt=(s?-1:1)*(Oe[st]-Le[st]+Sr)}const Ht={[st]:wt,[V]:Oe?Oe[V]:0};if(isNaN(J[st])||isNaN(J[V]))me(Ht);else{const Sr=Math.abs(J[st]-Ht[st]),_r=Math.abs(J[V]-Ht[V]);(Sr>=1||_r>=1)&&me(Ht)}}),re=(Le,{animation:Oe=!0}={})=>{Oe?tG(M,ue.current,Le,{duration:n.transitions.duration.standard}):ue.current[M]=Le},Se=Le=>{let Oe=ue.current[M];F?Oe+=Le:(Oe+=Le*(s?-1:1),Oe*=s&&ZP()==="reverse"?-1:1),re(Oe)},ge=()=>{const Le=ue.current[N];let Oe=0;const wt=Array.from(L.current.children);for(let st=0;stLe){st===0&&(Oe=Le);break}Oe+=Ht[N]}return Oe},Re=()=>{Se(-1*ge())},Ke=()=>{Se(ge())},ct=w.useCallback(Le=>{Y({overflow:null,scrollbarWidth:Le})},[]),Pt=()=>{const Le={};Le.scrollbarSizeListener=I?T.jsx(SG,{onChange:ct,className:ke(Q.scrollableX,Q.hideScrollbar)}):null;const wt=I&&(g==="auto"&&(pe||Be)||g===!0);return Le.scrollButtonStart=wt?T.jsx(v,S({slots:{StartScrollButtonIcon:k.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:ne},orientation:y,direction:s?"right":"left",onClick:Re,disabled:!pe},_,{className:ke(Q.scrollButtons,_.className)})):null,Le.scrollButtonEnd=wt?T.jsx(v,S({slots:{EndScrollButtonIcon:k.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:ie},orientation:y,direction:s?"left":"right",onClick:Ke,disabled:!Be},_,{className:ke(Q.scrollButtons,_.className)})):null,Le},ve=Xe(Le=>{const{tabsMeta:Oe,tabMeta:wt}=U();if(!(!wt||!Oe)){if(wt[O]Oe[A]){const st=Oe[M]+(wt[A]-Oe[A]);re(st,{animation:Le})}}}),ce=Xe(()=>{I&&g!==!1&&X(!Te)});w.useEffect(()=>{const Le=Vh(()=>{ue.current&&G()});let Oe;const wt=Sr=>{Sr.forEach(_r=>{_r.removedNodes.forEach(Rs=>{var Z;(Z=Oe)==null||Z.unobserve(Rs)}),_r.addedNodes.forEach(Rs=>{var Z;(Z=Oe)==null||Z.observe(Rs)})}),Le(),ce()},st=ea(ue.current);st.addEventListener("resize",Le);let Ht;return typeof ResizeObserver<"u"&&(Oe=new ResizeObserver(Le),Array.from(L.current.children).forEach(Sr=>{Oe.observe(Sr)})),typeof MutationObserver<"u"&&(Ht=new MutationObserver(wt),Ht.observe(L.current,{childList:!0})),()=>{var Sr,_r;Le.clear(),st.removeEventListener("resize",Le),(Sr=Ht)==null||Sr.disconnect(),(_r=Oe)==null||_r.disconnect()}},[G,ce]),w.useEffect(()=>{const Le=Array.from(L.current.children),Oe=Le.length;if(typeof IntersectionObserver<"u"&&Oe>0&&I&&g!==!1){const wt=Le[0],st=Le[Oe-1],Ht={root:ue.current,threshold:.99},Sr=se=>{De(!se[0].isIntersecting)},_r=new IntersectionObserver(Sr,Ht);_r.observe(wt);const Rs=se=>{Ce(!se[0].isIntersecting)},Z=new IntersectionObserver(Rs,Ht);return Z.observe(st),()=>{_r.disconnect(),Z.disconnect()}}},[I,g,Te,u==null?void 0:u.length]),w.useEffect(()=>{j(!0)},[]),w.useEffect(()=>{G()}),w.useEffect(()=>{ve(j1!==J)},[ve,J]),w.useImperativeHandle(l,()=>({updateIndicator:G,updateScrollButtons:ce}),[G,ce]);const Qe=T.jsx(wG,S({},x,{className:ke(Q.indicator,x.className),ownerState:W,style:S({},J,x.style)}));let bt=0;const Tt=w.Children.map(u,Le=>{if(!w.isValidElement(Le))return null;const Oe=Le.props.value===void 0?bt:Le.props.value;Pe.set(Oe,bt);const wt=Oe===R;return bt+=1,w.cloneElement(Le,S({fullWidth:E==="fullWidth",indicator:wt&&!te&&Qe,selected:wt,selectionFollowsFocus:b,onChange:m,textColor:P,value:Oe},bt===1&&R===!1&&!Le.props.tabIndex?{tabIndex:0}:{}))}),Ie=Le=>{const Oe=L.current,wt=qr(Oe).activeElement;if(wt.getAttribute("role")!=="tab")return;let Ht=y==="horizontal"?"ArrowLeft":"ArrowUp",Sr=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&s&&(Ht="ArrowRight",Sr="ArrowLeft"),Le.key){case Ht:Le.preventDefault(),Df(Oe,wt,G1);break;case Sr:Le.preventDefault(),Df(Oe,wt,U1);break;case"Home":Le.preventDefault(),Df(Oe,null,U1);break;case"End":Le.preventDefault(),Df(Oe,null,G1);break}},xt=Pt();return T.jsxs(yG,S({className:ke(Q.root,d),ownerState:W,ref:r,as:h},$,{children:[xt.scrollButtonStart,xt.scrollbarSizeListener,T.jsxs(bG,{className:Q.scroller,ownerState:W,style:{overflow:ee.overflow,[F?`margin${s?"Left":"Right"}`:"marginBottom"]:D?void 0:-ee.scrollbarWidth},ref:ue,children:[T.jsx(vG,{"aria-label":a,"aria-labelledby":o,"aria-orientation":y==="vertical"?"vertical":null,className:Q.flexContainer,ownerState:W,onKeyDown:Ie,ref:L,role:"tablist",children:Tt}),te&&Qe]}),xt.scrollButtonEnd]}))}),kG=xG;function CG(t){return Ue("MuiTextField",t)}Ge("MuiTextField",["root"]);const TG=["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"],_G={standard:rS,filled:zN,outlined:iE},BG=t=>{const{classes:e}=t;return ze({root:["root"]},CG,e)},PG=K(WN,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),NG=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:s=!1,children:a,className:o,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:f,id:m,InputLabelProps:y,inputProps:v,InputProps:g,inputRef:b,label:k,maxRows:C,minRows:x,multiline:_=!1,name:P,onBlur:R,onChange:E,onFocus:D,placeholder:$,required:I=!1,rows:F,select:M=!1,SelectProps:O,type:A,value:N,variant:V="outlined"}=i,W=le(i,TG),Q=S({},i,{autoFocus:s,color:l,disabled:u,error:d,fullWidth:p,multiline:_,required:I,select:M,variant:V}),ne=BG(Q),ie={};V==="outlined"&&(y&&typeof y.shrink<"u"&&(ie.notched=y.shrink),ie.label=k),M&&((!O||!O.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const te=ia(m),j=f&&te?`${te}-helper-text`:void 0,J=k&&te?`${te}-label`:void 0,me=_G[V],pe=T.jsx(me,S({"aria-describedby":j,autoComplete:n,autoFocus:s,defaultValue:c,fullWidth:p,multiline:_,name:P,rows:F,maxRows:C,minRows:x,type:A,value:N,id:te,inputRef:b,onBlur:R,onChange:E,onFocus:D,placeholder:$,inputProps:v},ie,g));return T.jsxs(PG,S({className:ke(ne.root,o),disabled:u,error:d,fullWidth:p,ref:r,required:I,color:l,variant:V,ownerState:Q},W,{children:[k!=null&&k!==""&&T.jsx(XN,S({htmlFor:te,id:J},y,{children:k})),M?T.jsx(dU,S({"aria-describedby":j,id:te,labelId:J,value:N,input:pe},O,{children:a})):pe,f&&T.jsx(HN,S({id:j},h,{children:f}))]}))}),im=NG,aS=Tr(T.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),EG=Tr(T.jsx("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),oE=Tr(T.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),RG=Tr(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),lE=Tr(T.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),MG=Tr(T.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home"),DG=Tr(T.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Y1=Tr(T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 3c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5"}),"MoodBad"),LG=Tr(T.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),FG=Tr([T.jsx("circle",{cx:"10.01",cy:"17",r:"2",opacity:".3"},"0"),T.jsx("path",{d:"m12 3 .01 10.55c-.59-.34-1.27-.55-2-.55C7.79 13 6 14.79 6 17s1.79 4 4.01 4S14 19.21 14 17V7h4V3zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"1")],"MusicNoteTwoTone"),IG=Tr(T.jsx("path",{d:"m20.5 10 .5-2h-4l1-4h-2l-1 4h-4l1-4h-2L9 8H5l-.5 2h4l-1 4h-4L3 16h4l-1 4h2l1-4h4l-1 4h2l1-4h4l.5-2h-4l1-4zm-7 4h-4l1-4h4z"}),"Numbers"),OG=Tr(T.jsx("path",{d:"M19 13H5v-2h14z"}),"Remove");function Tu(t){const[e,r]=w.useState(!1);return T.jsxs(T.Fragment,{children:[T.jsx(p$,{position:"static",title:"Siuuu",children:T.jsxs(QU,{sx:{display:"flex"},children:[T.jsx(yn,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:()=>{r(!0)},children:T.jsx(DG,{})}),T.jsx(Mr,{variant:"h6",component:"div",sx:{flexGrow:1},children:t.title})]})}),T.jsx("div",{style:{flex:1,display:"flex",overflow:"auto"},children:t.children}),T.jsx(Y6,{open:e,onClose:()=>{r(!1)},children:T.jsxs(Gh,{children:[T.jsxs(tl,{component:Zo,to:"/",children:[T.jsx(rl,{children:T.jsx(MG,{})}),T.jsx(il,{children:"Home"})]}),T.jsxs(tl,{component:Zo,to:"/todo",children:[T.jsx(rl,{children:T.jsx(EG,{})}),T.jsx(il,{children:"Todo"})]}),T.jsxs(tl,{component:Zo,to:"/counter",children:[T.jsx(rl,{children:T.jsx(IG,{})}),T.jsx(il,{children:"Counter"})]}),T.jsxs(tl,{component:Zo,to:"/rating",children:[T.jsx(rl,{children:T.jsx(Y1,{})}),T.jsx(il,{children:"Rating"})]}),T.jsxs(tl,{component:Zo,to:"/shifts",children:[T.jsx(rl,{children:T.jsx(Y1,{})}),T.jsx(il,{children:"Shifts"})]}),T.jsxs(tl,{component:Zo,to:"/music",children:[T.jsx(rl,{children:T.jsx(LG,{})}),T.jsx(il,{children:"Chord Generator"})]}),T.jsxs(tl,{component:Zo,to:"/alpha",children:[T.jsx(rl,{children:T.jsx(FG,{})}),T.jsx(il,{children:"Alpha"})]})]})})]})}function AG(){w.useEffect(()=>{setTimeout(()=>{console.log("This text will be displayed after 2 seconds."),e(!0)},500)},[]);const[t,e]=w.useState(!1);return T.jsx(Tu,{title:"Home",children:T.jsx(J3,{justifyContent:"center",alignContent:"center",children:t?"This is the content test":T.jsx("div",{style:{width:700,margin:"auto"},children:T.jsx(Xz,{size:700,color:"secondary"})})})})}function VG({todos:t,onChange:e}){const[r,i]=w.useState(""),[n,s]=w.useState(!1),[a,o]=w.useState(-1),[l,c]=w.useState(""),u=d=>{};return T.jsxs(T.Fragment,{children:[T.jsxs(lh,{children:[T.jsxs(Mr,{color:"primary",children:["You have ",t.length," item",t.length<1||t.length>1?"s":""]}),T.jsx(Gh,{children:t.map((d,h)=>T.jsx(KN,{secondaryAction:T.jsxs(T.Fragment,{children:[T.jsx(yn,{edge:"end","aria-label":"edit",onClick:()=>{o(h),c(t[h])},children:T.jsx(lE,{})}),T.jsx(yn,{edge:"end","aria-label":"delete",onClick:()=>{e(t.filter((p,f)=>f!==h))},children:T.jsx(RG,{})})]}),children:d},h))}),T.jsx(im,{error:n,id:"outlined",value:r,label:"New item",onChange:d=>i(d.target.value),helperText:n&&"required",onKeyDown:d=>{d.key==="Enter"&&(console.log("dialog"),r.length>0?(s(!1),e([...t,r]),i("")):s(!0))}})]}),T.jsx(Gg,{open:a>=0,onClose:()=>o(-1),disableRestoreFocus:!0,children:T.jsx(im,{inputRef:u,autoFocus:!0,error:n,id:"outlined",value:l,onChange:d=>c(d.target.value),helperText:n&&"required",onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l.length>0?(s(!1),e(t.map((h,p)=>a===p?l:h)),console.log("setting index"),o(-1)):s(!0))}})})]})}function $G(){const[t,e]=w.useState([[]]),[r,i]=w.useState(0),[n,s]=w.useState(["List 1"]);function a(l){const c=[...t];c[r]=l,e(c)}function o(l,c){i(c)}return T.jsxs(Tu,{title:"Todo",children:[T.jsxs("div",{style:{display:"flex"},children:[T.jsx(kG,{value:r,onChange:o,variant:"scrollable",children:t.map((l,c)=>T.jsx(GU,{style:{textTransform:"none"},label:c==r?T.jsxs("div",{children:[T.jsx(rS,{inputProps:{maxLength:15},style:{width:120,textAlign:"center"},onChange:u=>{const d=n;return d[c]=u.target.value,s(d)},disableUnderline:!0,size:"small",defaultValue:n[c]}),t.length>1&&T.jsx(yn,{onClick:()=>{e([...t].filter((u,d)=>d!==c)),r>0&&i(r-1),s([...n].filter((u,d)=>d!==c))},children:T.jsx(oE,{})})]}):n[c]},c))}),T.jsx(yn,{onClick:()=>{e([...t,[]]),i(t.length),s([...n,`List ${t.length+1}`])},children:T.jsx(aS,{})})]}),T.jsx(VG,{todos:t[r],onChange:l=>a(l)})]})}var cE={exports:{}},uE={};/** * @license React * use-sync-external-store-with-selector.production.min.js * @@ -197,20 +197,20 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jh=w;function $G(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var zG=typeof Object.is=="function"?Object.is:$G,WG=jh.useSyncExternalStore,HG=jh.useRef,UG=jh.useEffect,GG=jh.useMemo,jG=jh.useDebugValue;cE.useSyncExternalStoreWithSelector=function(t,e,r,i,n){var s=HG(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=GG(function(){function l(p){if(!c){if(c=!0,u=p,p=i(p),n!==void 0&&a.hasValue){var f=a.value;if(n(f,p))return d=f}return d=p}if(f=d,zG(u,p))return f;var m=i(p);return n!==void 0&&n(f,m)?f:(u=p,d=m)}var c=!1,u,d,h=r===void 0?null:r;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,r,i,n]);var o=WG(t,s[0],s[1]);return UG(function(){a.hasValue=!0,a.value=o},[o]),jG(o),o};lE.exports=cE;var YG=lE.exports,jn="default"in Gc?At:Gc,X1=Symbol.for("react-redux-context"),q1=typeof globalThis<"u"?globalThis:{};function XG(){if(!jn.createContext)return{};const t=q1[X1]??(q1[X1]=new Map);let e=t.get(jn.createContext);return e||(e=jn.createContext(null),t.set(jn.createContext,e)),e}var $o=XG(),qG=()=>{throw new Error("uSES not initialized!")};function oS(t=$o){return function(){return jn.useContext(t)}}var uE=oS(),dE=qG,KG=t=>{dE=t},QG=(t,e)=>t===e;function JG(t=$o){const e=t===$o?uE:oS(t),r=(i,n={})=>{const{equalityFn:s=QG,devModeChecks:a={}}=typeof n=="function"?{equalityFn:n}:n,{store:o,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:d}=e();jn.useRef(!0);const h=jn.useCallback({[i.name](f){return i(f)}}[i.name],[i,u,a.stabilityCheck]),p=dE(l.addNestedSub,o.getState,c||o.getState,h,s);return jn.useDebugValue(p),p};return Object.assign(r,{withTypes:()=>r}),r}var ZG=JG();function e7(t){t()}function t7(){let t=null,e=null;return{clear(){t=null,e=null},notify(){e7(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){const r=[];let i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0;const n=e={callback:r,next:null,prev:e};return n.prev?n.prev.next=n:t=n,function(){!i||t===null||(i=!1,n.next?n.next.prev=n.prev:e=n.prev,n.prev?n.prev.next=n.next:t=n.next)}}}}var K1={notify(){},get:()=>[]};function r7(t,e){let r,i=K1,n=0,s=!1;function a(m){u();const y=i.subscribe(m);let v=!1;return()=>{v||(v=!0,y(),d())}}function o(){i.notify()}function l(){f.onStateChange&&f.onStateChange()}function c(){return s}function u(){n++,r||(r=e?e.addNestedSub(l):t.subscribe(l),i=t7())}function d(){n--,r&&n===0&&(r(),r=void 0,i.clear(),i=K1)}function h(){s||(s=!0,u())}function p(){s&&(s=!1,d())}const f={addNestedSub:a,notifyNestedSubs:o,handleChangeWrapper:l,isSubscribed:c,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>i};return f}var i7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",n7=i7?jn.useLayoutEffect:jn.useEffect;function s7({store:t,context:e,children:r,serverState:i,stabilityCheck:n="once",identityFunctionCheck:s="once"}){const a=jn.useMemo(()=>{const c=r7(t);return{store:t,subscription:c,getServerState:i?()=>i:void 0,stabilityCheck:n,identityFunctionCheck:s}},[t,i,n,s]),o=jn.useMemo(()=>t.getState(),[t]);n7(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==t.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=e||$o;return jn.createElement(l.Provider,{value:a},r)}var a7=s7;function hE(t=$o){const e=t===$o?uE:oS(t),r=()=>{const{store:i}=e();return i};return Object.assign(r,{withTypes:()=>r}),r}var o7=hE();function l7(t=$o){const e=t===$o?o7:hE(t),r=()=>e().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var c7=l7();KG(YG.useSyncExternalStoreWithSelector);const u7=c7.withTypes(),d7=ZG.withTypes();function zi(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var h7=typeof Symbol=="function"&&Symbol.observable||"@@observable",Q1=h7,Zy=()=>Math.random().toString(36).substring(7).split("").join("."),f7={INIT:`@@redux/INIT${Zy()}`,REPLACE:`@@redux/REPLACE${Zy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Zy()}`},nm=f7;function lS(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function fE(t,e,r){if(typeof t!="function")throw new Error(zi(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(zi(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(zi(1));return r(fE)(t,e)}let i=t,n=e,s=new Map,a=s,o=0,l=!1;function c(){a===s&&(a=new Map,s.forEach((y,v)=>{a.set(v,y)}))}function u(){if(l)throw new Error(zi(3));return n}function d(y){if(typeof y!="function")throw new Error(zi(4));if(l)throw new Error(zi(5));let v=!0;c();const g=o++;return a.set(g,y),function(){if(v){if(l)throw new Error(zi(6));v=!1,c(),a.delete(g),s=null}}}function h(y){if(!lS(y))throw new Error(zi(7));if(typeof y.type>"u")throw new Error(zi(8));if(typeof y.type!="string")throw new Error(zi(17));if(l)throw new Error(zi(9));try{l=!0,n=i(n,y)}finally{l=!1}return(s=a).forEach(g=>{g()}),y}function p(y){if(typeof y!="function")throw new Error(zi(10));i=y,h({type:nm.REPLACE})}function f(){const y=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(zi(11));function g(){const k=v;k.next&&k.next(u())}return g(),{unsubscribe:y(g)}},[Q1](){return this}}}return h({type:nm.INIT}),{dispatch:h,subscribe:d,getState:u,replaceReducer:p,[Q1]:f}}function p7(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:nm.INIT})>"u")throw new Error(zi(12));if(typeof r(void 0,{type:nm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(zi(13))})}function m7(t){const e=Object.keys(t),r={};for(let s=0;s"u")throw o&&o.type,new Error(zi(14));c[d]=f,l=l||f!==p}return l=l||i.length!==Object.keys(a).length,l?c:a}}function sm(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...i)=>e(r(...i)))}function g7(...t){return e=>(r,i)=>{const n=e(r,i);let s=()=>{throw new Error(zi(15))};const a={getState:n.getState,dispatch:(l,...c)=>s(l,...c)},o=t.map(l=>l(a));return s=sm(...o)(n.dispatch),{...n,dispatch:s}}}function y7(t){return lS(t)&&"type"in t&&typeof t.type=="string"}var pE=Symbol.for("immer-nothing"),J1=Symbol.for("immer-draftable"),Jn=Symbol.for("immer-state");function Hs(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var au=Object.getPrototypeOf;function zo(t){return!!t&&!!t[Jn]}function Za(t){var e;return t?mE(t)||Array.isArray(t)||!!t[J1]||!!((e=t.constructor)!=null&&e[J1])||Yg(t)||Xg(t):!1}var b7=Object.prototype.constructor.toString();function mE(t){if(!t||typeof t!="object")return!1;const e=au(t);if(e===null)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===b7}function am(t,e){jg(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,i)=>e(i,r,t))}function jg(t){const e=t[Jn];return e?e.type_:Array.isArray(t)?1:Yg(t)?2:Xg(t)?3:0}function q0(t,e){return jg(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function gE(t,e,r){const i=jg(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function v7(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function Yg(t){return t instanceof Map}function Xg(t){return t instanceof Set}function dl(t){return t.copy_||t.base_}function K0(t,e){if(Yg(t))return new Map(t);if(Xg(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);if(!e&&mE(t))return au(t)?{...t}:Object.assign(Object.create(null),t);const r=Object.getOwnPropertyDescriptors(t);delete r[Jn];let i=Reflect.ownKeys(r);for(let n=0;n1&&(t.set=t.add=t.clear=t.delete=w7),Object.freeze(t),e&&Object.entries(t).forEach(([r,i])=>cS(i,!0))),t}function w7(){Hs(2)}function qg(t){return Object.isFrozen(t)}var S7={};function $l(t){const e=S7[t];return e||Hs(0,t),e}var ch;function yE(){return ch}function x7(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Z1(t,e){e&&($l("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Q0(t){J0(t),t.drafts_.forEach(k7),t.drafts_=null}function J0(t){t===ch&&(ch=t.parent_)}function eC(t){return ch=x7(ch,t)}function k7(t){const e=t[Jn];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function tC(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[Jn].modified_&&(Q0(e),Hs(4)),Za(t)&&(t=om(e,t),e.parent_||lm(e,t)),e.patches_&&$l("Patches").generateReplacementPatches_(r[Jn].base_,t,e.patches_,e.inversePatches_)):t=om(e,r,[]),Q0(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==pE?t:void 0}function om(t,e,r){if(qg(e))return e;const i=e[Jn];if(!i)return am(e,(n,s)=>rC(t,i,e,n,s,r)),e;if(i.scope_!==t)return e;if(!i.modified_)return lm(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const n=i.copy_;let s=n,a=!1;i.type_===3&&(s=new Set(n),n.clear(),a=!0),am(s,(o,l)=>rC(t,i,n,o,l,r,a)),lm(t,n,!1),r&&t.patches_&&$l("Patches").generatePatches_(i,r,t.patches_,t.inversePatches_)}return i.copy_}function rC(t,e,r,i,n,s,a){if(zo(n)){const o=s&&e&&e.type_!==3&&!q0(e.assigned_,i)?s.concat(i):void 0,l=om(t,n,o);if(gE(r,i,l),zo(l))t.canAutoFreeze_=!1;else return}else a&&r.add(n);if(Za(n)&&!qg(n)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;om(t,n),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&lm(t,n)}}function lm(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&cS(e,r)}function C7(t,e){const r=Array.isArray(t),i={type_:r?1:0,scope_:e?e.scope_:yE(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=i,s=uS;r&&(n=[i],s=uh);const{revoke:a,proxy:o}=Proxy.revocable(n,s);return i.draft_=o,i.revoke_=a,o}var uS={get(t,e){if(e===Jn)return t;const r=dl(t);if(!q0(r,e))return T7(t,r,e);const i=r[e];return t.finalized_||!Za(i)?i:i===eb(t.base_,e)?(tb(t),t.copy_[e]=ev(i,t)):i},has(t,e){return e in dl(t)},ownKeys(t){return Reflect.ownKeys(dl(t))},set(t,e,r){const i=bE(dl(t),e);if(i!=null&&i.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){const n=eb(dl(t),e),s=n==null?void 0:n[Jn];if(s&&s.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(v7(r,n)&&(r!==void 0||q0(t.base_,e)))return!0;tb(t),Z0(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return eb(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,tb(t),Z0(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=dl(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty(){Hs(11)},getPrototypeOf(t){return au(t.base_)},setPrototypeOf(){Hs(12)}},uh={};am(uS,(t,e)=>{uh[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});uh.deleteProperty=function(t,e){return uh.set.call(this,t,e,void 0)};uh.set=function(t,e,r){return uS.set.call(this,t[0],e,r,t[0])};function eb(t,e){const r=t[Jn];return(r?dl(r):t)[e]}function T7(t,e,r){var n;const i=bE(e,r);return i?"value"in i?i.value:(n=i.get)==null?void 0:n.call(t.draft_):void 0}function bE(t,e){if(!(e in t))return;let r=au(t);for(;r;){const i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=au(r)}}function Z0(t){t.modified_||(t.modified_=!0,t.parent_&&Z0(t.parent_))}function tb(t){t.copy_||(t.copy_=K0(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var _7=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,i)=>{if(typeof e=="function"&&typeof r!="function"){const s=r;r=e;const a=this;return function(l=s,...c){return a.produce(l,u=>r.call(this,u,...c))}}typeof r!="function"&&Hs(6),i!==void 0&&typeof i!="function"&&Hs(7);let n;if(Za(e)){const s=eC(this),a=ev(e,void 0);let o=!0;try{n=r(a),o=!1}finally{o?Q0(s):J0(s)}return Z1(s,i),tC(n,s)}else if(!e||typeof e!="object"){if(n=r(e),n===void 0&&(n=e),n===pE&&(n=void 0),this.autoFreeze_&&cS(n,!0),i){const s=[],a=[];$l("Patches").generateReplacementPatches_(e,n,s,a),i(s,a)}return n}else Hs(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(a,...o)=>this.produceWithPatches(a,l=>e(l,...o));let i,n;return[this.produce(e,r,(a,o)=>{i=a,n=o}),i,n]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Za(t)||Hs(8),zo(t)&&(t=vE(t));const e=eC(this),r=ev(t,void 0);return r[Jn].isManual_=!0,J0(e),r}finishDraft(t,e){const r=t&&t[Jn];(!r||!r.isManual_)&&Hs(9);const{scope_:i}=r;return Z1(i,e),tC(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const n=e[r];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}r>-1&&(e=e.slice(r+1));const i=$l("Patches").applyPatches_;return zo(t)?i(t,e):this.produce(t,n=>i(n,e))}};function ev(t,e){const r=Yg(t)?$l("MapSet").proxyMap_(t,e):Xg(t)?$l("MapSet").proxySet_(t,e):C7(t,e);return(e?e.scope_:yE()).drafts_.push(r),r}function vE(t){return zo(t)||Hs(10,t),wE(t)}function wE(t){if(!Za(t)||qg(t))return t;const e=t[Jn];let r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=K0(t,e.scope_.immer_.useStrictShallowCopy_)}else r=K0(t,!0);return am(r,(i,n)=>{gE(r,i,wE(n))}),e&&(e.finalized_=!1),r}var Zn=new _7,SE=Zn.produce;Zn.produceWithPatches.bind(Zn);Zn.setAutoFreeze.bind(Zn);Zn.setUseStrictShallowCopy.bind(Zn);Zn.applyPatches.bind(Zn);Zn.createDraft.bind(Zn);Zn.finishDraft.bind(Zn);function B7(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function P7(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function N7(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(r=>typeof r=="function")){const r=t.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${e}[${r}]`)}}var iC=t=>Array.isArray(t)?t:[t];function E7(t){const e=Array.isArray(t[0])?t[0]:t;return N7(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function R7(t,e){const r=[],{length:i}=t;for(let n=0;n{r=Lf(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function xE(t,...e){const r=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,i=(...n)=>{let s=0,a=0,o,l={},c=n.pop();typeof c=="object"&&(l=c,c=n.pop()),B7(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...r,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:p=dS,argsMemoizeOptions:f=[],devModeChecks:m={}}=u,y=iC(h),v=iC(f),g=E7(n),b=d(function(){return s++,c.apply(null,arguments)},...y),k=p(function(){a++;const x=R7(g,arguments);return o=b.apply(null,x),o},...v);return Object.assign(k,{resultFunc:c,memoizedResultFunc:b,dependencies:g,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>o,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:p})};return Object.assign(i,{withTypes:()=>i}),i}var F7=xE(dS),I7=Object.assign((t,e=F7)=>{P7(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const r=Object.keys(t),i=r.map(s=>t[s]);return e(i,(...s)=>s.reduce((a,o,l)=>(a[r[l]]=o,a),{}))},{withTypes:()=>I7});function kE(t){return({dispatch:r,getState:i})=>n=>s=>typeof s=="function"?s(r,i,t):n(s)}var O7=kE(),A7=kE,V7=(...t)=>{const e=xE(...t),r=Object.assign((...i)=>{const n=e(...i),s=(a,...o)=>n(zo(a)?vE(a):a,...o);return Object.assign(s,n),s},{withTypes:()=>r});return r};V7(dS);var $7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?sm:sm.apply(null,arguments)};function ou(t,e){function r(...i){if(e){let n=e(...i);if(!n)throw new Error(Ln(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:i[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=i=>y7(i)&&i.type===t,r}var CE=class hd extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,hd.prototype)}static get[Symbol.species](){return hd}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new hd(...e[0].concat(this)):new hd(...e.concat(this))}};function sC(t){return Za(t)?SE(t,()=>{}):t}function aC(t,e,r){if(t.has(e)){let n=t.get(e);return r.update&&(n=r.update(n,e,t),t.set(e,n)),n}if(!r.insert)throw new Error(Ln(10));const i=r.insert(e,t);return t.set(e,i),i}function z7(t){return typeof t=="boolean"}var W7=()=>function(e){const{thunk:r=!0,immutableCheck:i=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{};let a=new CE;return r&&(z7(r)?a.push(O7):a.push(A7(r.extraArgument))),a},H7="RTK_autoBatch",TE=t=>e=>{setTimeout(e,t)},U7=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:TE(10),G7=(t={type:"raf"})=>e=>(...r)=>{const i=e(...r);let n=!0,s=!1,a=!1;const o=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?U7:t.type==="callback"?t.queueNotification:TE(t.timeout),c=()=>{a=!1,s&&(s=!1,o.forEach(u=>u()))};return Object.assign({},i,{subscribe(u){const d=()=>n&&u(),h=i.subscribe(d);return o.add(u),()=>{h(),o.delete(u)}},dispatch(u){var d;try{return n=!((d=u==null?void 0:u.meta)!=null&&d[H7]),s=!n,s&&(a||(a=!0,l(c))),i.dispatch(u)}finally{n=!0}}})},j7=t=>function(r){const{autoBatch:i=!0}=r??{};let n=new CE(t);return i&&n.push(G7(typeof i=="object"?i:void 0)),n},Y7=!0;function X7(t){const e=W7(),{reducer:r=void 0,middleware:i,devTools:n=!0,preloadedState:s=void 0,enhancers:a=void 0}=t||{};let o;if(typeof r=="function")o=r;else if(lS(r))o=m7(r);else throw new Error(Ln(1));let l;typeof i=="function"?l=i(e):l=e();let c=sm;n&&(c=$7({trace:!Y7,...typeof n=="object"&&n}));const u=g7(...l),d=j7(u);let h=typeof a=="function"?a(d):d();const p=c(...h);return fE(o,s,p)}function _E(t){const e={},r=[];let i;const n={addCase(s,a){const o=typeof s=="string"?s:s.type;if(!o)throw new Error(Ln(28));if(o in e)throw new Error(Ln(29));return e[o]=a,n},addMatcher(s,a){return r.push({matcher:s,reducer:a}),n},addDefaultCase(s){return i=s,n}};return t(n),[e,r,i]}function q7(t){return typeof t=="function"}function K7(t,e){let[r,i,n]=_E(e),s;if(q7(t))s=()=>sC(t());else{const o=sC(t);s=()=>o}function a(o=s(),l){let c=[r[l.type],...i.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[n]),c.reduce((u,d)=>{if(d)if(zo(u)){const p=d(u,l);return p===void 0?u:p}else{if(Za(u))return SE(u,h=>d(h,l));{const h=d(u,l);if(h===void 0){if(u===null)return u;throw new Error(Ln(9))}return h}}return u},o)}return a.getInitialState=s,a}var Q7="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",J7=(t=21)=>{let e="",r=t;for(;r--;)e+=Q7[Math.random()*64|0];return e},Z7=Symbol.for("rtk-slice-createasyncthunk");function ej(t,e){return`${t}/${e}`}function tj({creators:t}={}){var r;const e=(r=t==null?void 0:t.asyncThunk)==null?void 0:r[Z7];return function(n){const{name:s,reducerPath:a=s}=n;if(!s)throw new Error(Ln(11));typeof process<"u";const o=(typeof n.reducers=="function"?n.reducers(nj()):n.reducers)||{},l=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(b,k){const C=typeof b=="string"?b:b.type;if(!C)throw new Error(Ln(12));if(C in c.sliceCaseReducersByType)throw new Error(Ln(13));return c.sliceCaseReducersByType[C]=k,u},addMatcher(b,k){return c.sliceMatchers.push({matcher:b,reducer:k}),u},exposeAction(b,k){return c.actionCreators[b]=k,u},exposeCaseReducer(b,k){return c.sliceCaseReducersByName[b]=k,u}};l.forEach(b=>{const k=o[b],C={reducerName:b,type:ej(s,b),createNotation:typeof n.reducers=="function"};aj(k)?lj(C,k,u,e):sj(C,k,u)});function d(){const[b={},k=[],C=void 0]=typeof n.extraReducers=="function"?_E(n.extraReducers):[n.extraReducers],x={...b,...c.sliceCaseReducersByType};return K7(n.initialState,_=>{for(let P in x)_.addCase(P,x[P]);for(let P of c.sliceMatchers)_.addMatcher(P.matcher,P.reducer);for(let P of k)_.addMatcher(P.matcher,P.reducer);C&&_.addDefaultCase(C)})}const h=b=>b,p=new Map;let f;function m(b,k){return f||(f=d()),f(b,k)}function y(){return f||(f=d()),f.getInitialState()}function v(b,k=!1){function C(_){let P=_[b];return typeof P>"u"&&k&&(P=y()),P}function x(_=h){const P=aC(p,k,{insert:()=>new WeakMap});return aC(P,_,{insert:()=>{const R={};for(const[E,D]of Object.entries(n.selectors??{}))R[E]=rj(D,_,y,k);return R}})}return{reducerPath:b,getSelectors:x,get selectors(){return x(C)},selectSlice:C}}const g={name:s,reducer:m,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...v(a),injectInto(b,{reducerPath:k,...C}={}){const x=k??a;return b.inject({reducerPath:x,reducer:m},C),{...g,...v(x,!0)}}};return g}}function rj(t,e,r,i){function n(s,...a){let o=e(s);return typeof o>"u"&&i&&(o=r()),t(o,...a)}return n.unwrapped=t,n}var ij=tj();function nj(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function sj({type:t,reducerName:e,createNotation:r},i,n){let s,a;if("reducer"in i){if(r&&!oj(i))throw new Error(Ln(17));s=i.reducer,a=i.prepare}else s=i;n.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,a?ou(t,a):ou(t))}function aj(t){return t._reducerDefinitionType==="asyncThunk"}function oj(t){return t._reducerDefinitionType==="reducerWithPrepare"}function lj({type:t,reducerName:e},r,i,n){if(!n)throw new Error(Ln(18));const{payloadCreator:s,fulfilled:a,pending:o,rejected:l,settled:c,options:u}=r,d=n(t,s,u);i.exposeAction(e,d),a&&i.addCase(d.fulfilled,a),o&&i.addCase(d.pending,o),l&&i.addCase(d.rejected,l),c&&i.addMatcher(d.settled,c),i.exposeCaseReducer(e,{fulfilled:a||Ff,pending:o||Ff,rejected:l||Ff,settled:c||Ff})}function Ff(){}var cj=(t,e)=>{if(typeof t!="function")throw new Error(Ln(32))},hS="listenerMiddleware",uj=t=>{let{type:e,actionCreator:r,matcher:i,predicate:n,effect:s}=t;if(e)n=ou(e).match;else if(r)e=r.type,n=r.match;else if(i)n=i;else if(!n)throw new Error(Ln(21));return cj(s),{predicate:n,type:e,effect:s}},dj=Object.assign(t=>{const{type:e,predicate:r,effect:i}=uj(t);return{id:J7(),effect:i,type:e,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Ln(22))}}},{withTypes:()=>dj}),hj=Object.assign(ou(`${hS}/add`),{withTypes:()=>hj});ou(`${hS}/removeAll`);var fj=Object.assign(ou(`${hS}/remove`),{withTypes:()=>fj});function Ln(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const pj={value:0,lastChange:""},BE=ij({name:"counter",initialState:pj,reducers:{increment(t){t.value+=1},incrementByAmount(t,e){t.value+=e.payload,t.lastChange=e.type}}}),{increment:RZ,incrementByAmount:oC}=BE.actions,mj=BE.reducer;function gj(){const t=u7(),[e,r]=w.useState(50),i=d7(o=>o.counter.value);function n(){const o=oC(e);t(o)}function s(){const o=oC(-e);t(o)}const a=(o,l)=>{r(l)};return T.jsxs(Tu,{title:"Counter",children:[T.jsx(yn,{onClick:s,children:T.jsx(IG,{})}),T.jsx(yn,{onClick:n,children:T.jsx(aS,{})}),T.jsx(lh,{children:T.jsx(BU,{value:e,onChange:a,valueLabelDisplay:"on"})}),T.jsx(Mr,{variant:"h1",align:"center",children:i})]})}function yj(){const[t,e]=w.useState(1),r=(i,n)=>{e(n)};return T.jsx(Tu,{title:"Rating",children:T.jsxs(lh,{children:[T.jsx(pz,{children:T.jsx(lh,{children:T.jsx(Y8,{value:t,onChange:r,size:"large",max:46})})}),T.jsxs(Mr,{color:"pink",variant:"h1",children:["The rating you have chosen is ",t]})]})})}function bj(){return T.jsxs("div",{style:{flexDirection:"column",display:"flex",height:"100%",border:"10px solid green",boxSizing:"border-box"},children:[T.jsx("div",{style:{border:"3px solid blue",height:"100px"}}),T.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",border:"3px solid orange",flex:1},children:[T.jsx("div",{style:{border:"3px solid yellow",width:"100px"}}),T.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",border:"3px solid red",flex:1},children:T.jsx("button",{children:"sIUUUU"})})]}),T.jsx("div",{style:{height:"100px",border:"3px solid pink"}})]})}const vj=["localeText"],tv=w.createContext(null),fS=function(e){const{localeText:r}=e,i=oe(e,vj),{utils:n,localeText:s}=w.useContext(tv)??{utils:void 0,localeText:void 0},a=Ae({props:i,name:"MuiLocalizationProvider"}),{children:o,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:d,localeText:h}=a,p=w.useMemo(()=>S({},h,s,r),[h,s,r]),f=w.useMemo(()=>{if(!l)return n||null;const v=new l({locale:d,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` -`));return v},[l,d,c,u,n]),m=w.useMemo(()=>f?{minDate:f.date("1900-01-01T00:00:00.000"),maxDate:f.date("2099-12-31T00:00:00.000")}:null,[f]),y=w.useMemo(()=>({utils:f,defaultDates:m,localeText:p}),[m,f,p]);return T.jsx(tv.Provider,{value:y,children:o})},wj=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:S({},t)}}}}),PE={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(t,e,r)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${r.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,selectViewText:t=>`Select ${t}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:t=>`Week ${t}`,calendarWeekNumberText:t=>`${t}`,openDatePickerDialogue:(t,e)=>t!==null&&e.isValid(t)?`Choose date, selected date is ${e.format(t,"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t!==null&&e.isValid(t)?`Choose time, selected time is ${e.format(t,"fullTime")}`:"Choose time",fieldClearLabel:"Clear value",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:t=>"Y".repeat(t.digitAmount),fieldMonthPlaceholder:t=>t.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:t=>t.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},Sj=PE;wj(PE);const ql=()=>{const t=w.useContext(tv);if(t===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` + */var jh=w;function zG(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var WG=typeof Object.is=="function"?Object.is:zG,HG=jh.useSyncExternalStore,UG=jh.useRef,GG=jh.useEffect,jG=jh.useMemo,YG=jh.useDebugValue;uE.useSyncExternalStoreWithSelector=function(t,e,r,i,n){var s=UG(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=jG(function(){function l(p){if(!c){if(c=!0,u=p,p=i(p),n!==void 0&&a.hasValue){var f=a.value;if(n(f,p))return d=f}return d=p}if(f=d,WG(u,p))return f;var m=i(p);return n!==void 0&&n(f,m)?f:(u=p,d=m)}var c=!1,u,d,h=r===void 0?null:r;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,r,i,n]);var o=HG(t,s[0],s[1]);return GG(function(){a.hasValue=!0,a.value=o},[o]),YG(o),o};cE.exports=uE;var XG=cE.exports,jn="default"in Gc?At:Gc,X1=Symbol.for("react-redux-context"),q1=typeof globalThis<"u"?globalThis:{};function qG(){if(!jn.createContext)return{};const t=q1[X1]??(q1[X1]=new Map);let e=t.get(jn.createContext);return e||(e=jn.createContext(null),t.set(jn.createContext,e)),e}var zo=qG(),KG=()=>{throw new Error("uSES not initialized!")};function oS(t=zo){return function(){return jn.useContext(t)}}var dE=oS(),hE=KG,QG=t=>{hE=t},JG=(t,e)=>t===e;function ZG(t=zo){const e=t===zo?dE:oS(t),r=(i,n={})=>{const{equalityFn:s=JG,devModeChecks:a={}}=typeof n=="function"?{equalityFn:n}:n,{store:o,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:d}=e();jn.useRef(!0);const h=jn.useCallback({[i.name](f){return i(f)}}[i.name],[i,u,a.stabilityCheck]),p=hE(l.addNestedSub,o.getState,c||o.getState,h,s);return jn.useDebugValue(p),p};return Object.assign(r,{withTypes:()=>r}),r}var e7=ZG();function t7(t){t()}function r7(){let t=null,e=null;return{clear(){t=null,e=null},notify(){t7(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){const r=[];let i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0;const n=e={callback:r,next:null,prev:e};return n.prev?n.prev.next=n:t=n,function(){!i||t===null||(i=!1,n.next?n.next.prev=n.prev:e=n.prev,n.prev?n.prev.next=n.next:t=n.next)}}}}var K1={notify(){},get:()=>[]};function i7(t,e){let r,i=K1,n=0,s=!1;function a(m){u();const y=i.subscribe(m);let v=!1;return()=>{v||(v=!0,y(),d())}}function o(){i.notify()}function l(){f.onStateChange&&f.onStateChange()}function c(){return s}function u(){n++,r||(r=e?e.addNestedSub(l):t.subscribe(l),i=r7())}function d(){n--,r&&n===0&&(r(),r=void 0,i.clear(),i=K1)}function h(){s||(s=!0,u())}function p(){s&&(s=!1,d())}const f={addNestedSub:a,notifyNestedSubs:o,handleChangeWrapper:l,isSubscribed:c,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>i};return f}var n7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",s7=n7?jn.useLayoutEffect:jn.useEffect;function a7({store:t,context:e,children:r,serverState:i,stabilityCheck:n="once",identityFunctionCheck:s="once"}){const a=jn.useMemo(()=>{const c=i7(t);return{store:t,subscription:c,getServerState:i?()=>i:void 0,stabilityCheck:n,identityFunctionCheck:s}},[t,i,n,s]),o=jn.useMemo(()=>t.getState(),[t]);s7(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==t.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=e||zo;return jn.createElement(l.Provider,{value:a},r)}var o7=a7;function fE(t=zo){const e=t===zo?dE:oS(t),r=()=>{const{store:i}=e();return i};return Object.assign(r,{withTypes:()=>r}),r}var l7=fE();function c7(t=zo){const e=t===zo?l7:fE(t),r=()=>e().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var u7=c7();QG(XG.useSyncExternalStoreWithSelector);const d7=u7.withTypes(),h7=e7.withTypes();function zi(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var f7=typeof Symbol=="function"&&Symbol.observable||"@@observable",Q1=f7,Zy=()=>Math.random().toString(36).substring(7).split("").join("."),p7={INIT:`@@redux/INIT${Zy()}`,REPLACE:`@@redux/REPLACE${Zy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Zy()}`},nm=p7;function lS(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function pE(t,e,r){if(typeof t!="function")throw new Error(zi(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(zi(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(zi(1));return r(pE)(t,e)}let i=t,n=e,s=new Map,a=s,o=0,l=!1;function c(){a===s&&(a=new Map,s.forEach((y,v)=>{a.set(v,y)}))}function u(){if(l)throw new Error(zi(3));return n}function d(y){if(typeof y!="function")throw new Error(zi(4));if(l)throw new Error(zi(5));let v=!0;c();const g=o++;return a.set(g,y),function(){if(v){if(l)throw new Error(zi(6));v=!1,c(),a.delete(g),s=null}}}function h(y){if(!lS(y))throw new Error(zi(7));if(typeof y.type>"u")throw new Error(zi(8));if(typeof y.type!="string")throw new Error(zi(17));if(l)throw new Error(zi(9));try{l=!0,n=i(n,y)}finally{l=!1}return(s=a).forEach(g=>{g()}),y}function p(y){if(typeof y!="function")throw new Error(zi(10));i=y,h({type:nm.REPLACE})}function f(){const y=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(zi(11));function g(){const k=v;k.next&&k.next(u())}return g(),{unsubscribe:y(g)}},[Q1](){return this}}}return h({type:nm.INIT}),{dispatch:h,subscribe:d,getState:u,replaceReducer:p,[Q1]:f}}function m7(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:nm.INIT})>"u")throw new Error(zi(12));if(typeof r(void 0,{type:nm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(zi(13))})}function g7(t){const e=Object.keys(t),r={};for(let s=0;s"u")throw o&&o.type,new Error(zi(14));c[d]=f,l=l||f!==p}return l=l||i.length!==Object.keys(a).length,l?c:a}}function sm(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...i)=>e(r(...i)))}function y7(...t){return e=>(r,i)=>{const n=e(r,i);let s=()=>{throw new Error(zi(15))};const a={getState:n.getState,dispatch:(l,...c)=>s(l,...c)},o=t.map(l=>l(a));return s=sm(...o)(n.dispatch),{...n,dispatch:s}}}function b7(t){return lS(t)&&"type"in t&&typeof t.type=="string"}var mE=Symbol.for("immer-nothing"),J1=Symbol.for("immer-draftable"),Jn=Symbol.for("immer-state");function Hs(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var au=Object.getPrototypeOf;function Wo(t){return!!t&&!!t[Jn]}function eo(t){var e;return t?gE(t)||Array.isArray(t)||!!t[J1]||!!((e=t.constructor)!=null&&e[J1])||Yg(t)||Xg(t):!1}var v7=Object.prototype.constructor.toString();function gE(t){if(!t||typeof t!="object")return!1;const e=au(t);if(e===null)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===v7}function am(t,e){jg(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,i)=>e(i,r,t))}function jg(t){const e=t[Jn];return e?e.type_:Array.isArray(t)?1:Yg(t)?2:Xg(t)?3:0}function q0(t,e){return jg(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function yE(t,e,r){const i=jg(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function w7(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function Yg(t){return t instanceof Map}function Xg(t){return t instanceof Set}function hl(t){return t.copy_||t.base_}function K0(t,e){if(Yg(t))return new Map(t);if(Xg(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);if(!e&&gE(t))return au(t)?{...t}:Object.assign(Object.create(null),t);const r=Object.getOwnPropertyDescriptors(t);delete r[Jn];let i=Reflect.ownKeys(r);for(let n=0;n1&&(t.set=t.add=t.clear=t.delete=S7),Object.freeze(t),e&&Object.entries(t).forEach(([r,i])=>cS(i,!0))),t}function S7(){Hs(2)}function qg(t){return Object.isFrozen(t)}var x7={};function $l(t){const e=x7[t];return e||Hs(0,t),e}var ch;function bE(){return ch}function k7(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Z1(t,e){e&&($l("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Q0(t){J0(t),t.drafts_.forEach(C7),t.drafts_=null}function J0(t){t===ch&&(ch=t.parent_)}function eC(t){return ch=k7(ch,t)}function C7(t){const e=t[Jn];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function tC(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[Jn].modified_&&(Q0(e),Hs(4)),eo(t)&&(t=om(e,t),e.parent_||lm(e,t)),e.patches_&&$l("Patches").generateReplacementPatches_(r[Jn].base_,t,e.patches_,e.inversePatches_)):t=om(e,r,[]),Q0(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==mE?t:void 0}function om(t,e,r){if(qg(e))return e;const i=e[Jn];if(!i)return am(e,(n,s)=>rC(t,i,e,n,s,r)),e;if(i.scope_!==t)return e;if(!i.modified_)return lm(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const n=i.copy_;let s=n,a=!1;i.type_===3&&(s=new Set(n),n.clear(),a=!0),am(s,(o,l)=>rC(t,i,n,o,l,r,a)),lm(t,n,!1),r&&t.patches_&&$l("Patches").generatePatches_(i,r,t.patches_,t.inversePatches_)}return i.copy_}function rC(t,e,r,i,n,s,a){if(Wo(n)){const o=s&&e&&e.type_!==3&&!q0(e.assigned_,i)?s.concat(i):void 0,l=om(t,n,o);if(yE(r,i,l),Wo(l))t.canAutoFreeze_=!1;else return}else a&&r.add(n);if(eo(n)&&!qg(n)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;om(t,n),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&lm(t,n)}}function lm(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&cS(e,r)}function T7(t,e){const r=Array.isArray(t),i={type_:r?1:0,scope_:e?e.scope_:bE(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=i,s=uS;r&&(n=[i],s=uh);const{revoke:a,proxy:o}=Proxy.revocable(n,s);return i.draft_=o,i.revoke_=a,o}var uS={get(t,e){if(e===Jn)return t;const r=hl(t);if(!q0(r,e))return _7(t,r,e);const i=r[e];return t.finalized_||!eo(i)?i:i===eb(t.base_,e)?(tb(t),t.copy_[e]=ev(i,t)):i},has(t,e){return e in hl(t)},ownKeys(t){return Reflect.ownKeys(hl(t))},set(t,e,r){const i=vE(hl(t),e);if(i!=null&&i.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){const n=eb(hl(t),e),s=n==null?void 0:n[Jn];if(s&&s.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(w7(r,n)&&(r!==void 0||q0(t.base_,e)))return!0;tb(t),Z0(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return eb(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,tb(t),Z0(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const r=hl(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:r[e]}},defineProperty(){Hs(11)},getPrototypeOf(t){return au(t.base_)},setPrototypeOf(){Hs(12)}},uh={};am(uS,(t,e)=>{uh[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});uh.deleteProperty=function(t,e){return uh.set.call(this,t,e,void 0)};uh.set=function(t,e,r){return uS.set.call(this,t[0],e,r,t[0])};function eb(t,e){const r=t[Jn];return(r?hl(r):t)[e]}function _7(t,e,r){var n;const i=vE(e,r);return i?"value"in i?i.value:(n=i.get)==null?void 0:n.call(t.draft_):void 0}function vE(t,e){if(!(e in t))return;let r=au(t);for(;r;){const i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=au(r)}}function Z0(t){t.modified_||(t.modified_=!0,t.parent_&&Z0(t.parent_))}function tb(t){t.copy_||(t.copy_=K0(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var B7=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,i)=>{if(typeof e=="function"&&typeof r!="function"){const s=r;r=e;const a=this;return function(l=s,...c){return a.produce(l,u=>r.call(this,u,...c))}}typeof r!="function"&&Hs(6),i!==void 0&&typeof i!="function"&&Hs(7);let n;if(eo(e)){const s=eC(this),a=ev(e,void 0);let o=!0;try{n=r(a),o=!1}finally{o?Q0(s):J0(s)}return Z1(s,i),tC(n,s)}else if(!e||typeof e!="object"){if(n=r(e),n===void 0&&(n=e),n===mE&&(n=void 0),this.autoFreeze_&&cS(n,!0),i){const s=[],a=[];$l("Patches").generateReplacementPatches_(e,n,s,a),i(s,a)}return n}else Hs(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(a,...o)=>this.produceWithPatches(a,l=>e(l,...o));let i,n;return[this.produce(e,r,(a,o)=>{i=a,n=o}),i,n]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){eo(t)||Hs(8),Wo(t)&&(t=wE(t));const e=eC(this),r=ev(t,void 0);return r[Jn].isManual_=!0,J0(e),r}finishDraft(t,e){const r=t&&t[Jn];(!r||!r.isManual_)&&Hs(9);const{scope_:i}=r;return Z1(i,e),tC(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const n=e[r];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}r>-1&&(e=e.slice(r+1));const i=$l("Patches").applyPatches_;return Wo(t)?i(t,e):this.produce(t,n=>i(n,e))}};function ev(t,e){const r=Yg(t)?$l("MapSet").proxyMap_(t,e):Xg(t)?$l("MapSet").proxySet_(t,e):T7(t,e);return(e?e.scope_:bE()).drafts_.push(r),r}function wE(t){return Wo(t)||Hs(10,t),SE(t)}function SE(t){if(!eo(t)||qg(t))return t;const e=t[Jn];let r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=K0(t,e.scope_.immer_.useStrictShallowCopy_)}else r=K0(t,!0);return am(r,(i,n)=>{yE(r,i,SE(n))}),e&&(e.finalized_=!1),r}var Zn=new B7,xE=Zn.produce;Zn.produceWithPatches.bind(Zn);Zn.setAutoFreeze.bind(Zn);Zn.setUseStrictShallowCopy.bind(Zn);Zn.applyPatches.bind(Zn);Zn.createDraft.bind(Zn);Zn.finishDraft.bind(Zn);function P7(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function N7(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function E7(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(r=>typeof r=="function")){const r=t.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${e}[${r}]`)}}var iC=t=>Array.isArray(t)?t:[t];function R7(t){const e=Array.isArray(t[0])?t[0]:t;return E7(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function M7(t,e){const r=[],{length:i}=t;for(let n=0;n{r=Lf(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function kE(t,...e){const r=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,i=(...n)=>{let s=0,a=0,o,l={},c=n.pop();typeof c=="object"&&(l=c,c=n.pop()),P7(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...r,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:p=dS,argsMemoizeOptions:f=[],devModeChecks:m={}}=u,y=iC(h),v=iC(f),g=R7(n),b=d(function(){return s++,c.apply(null,arguments)},...y),k=p(function(){a++;const x=M7(g,arguments);return o=b.apply(null,x),o},...v);return Object.assign(k,{resultFunc:c,memoizedResultFunc:b,dependencies:g,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>o,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:p})};return Object.assign(i,{withTypes:()=>i}),i}var I7=kE(dS),O7=Object.assign((t,e=I7)=>{N7(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const r=Object.keys(t),i=r.map(s=>t[s]);return e(i,(...s)=>s.reduce((a,o,l)=>(a[r[l]]=o,a),{}))},{withTypes:()=>O7});function CE(t){return({dispatch:r,getState:i})=>n=>s=>typeof s=="function"?s(r,i,t):n(s)}var A7=CE(),V7=CE,$7=(...t)=>{const e=kE(...t),r=Object.assign((...i)=>{const n=e(...i),s=(a,...o)=>n(Wo(a)?wE(a):a,...o);return Object.assign(s,n),s},{withTypes:()=>r});return r};$7(dS);var z7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?sm:sm.apply(null,arguments)};function ou(t,e){function r(...i){if(e){let n=e(...i);if(!n)throw new Error(Ln(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:i[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=i=>b7(i)&&i.type===t,r}var TE=class hd extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,hd.prototype)}static get[Symbol.species](){return hd}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new hd(...e[0].concat(this)):new hd(...e.concat(this))}};function sC(t){return eo(t)?xE(t,()=>{}):t}function aC(t,e,r){if(t.has(e)){let n=t.get(e);return r.update&&(n=r.update(n,e,t),t.set(e,n)),n}if(!r.insert)throw new Error(Ln(10));const i=r.insert(e,t);return t.set(e,i),i}function W7(t){return typeof t=="boolean"}var H7=()=>function(e){const{thunk:r=!0,immutableCheck:i=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{};let a=new TE;return r&&(W7(r)?a.push(A7):a.push(V7(r.extraArgument))),a},U7="RTK_autoBatch",_E=t=>e=>{setTimeout(e,t)},G7=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:_E(10),j7=(t={type:"raf"})=>e=>(...r)=>{const i=e(...r);let n=!0,s=!1,a=!1;const o=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?G7:t.type==="callback"?t.queueNotification:_E(t.timeout),c=()=>{a=!1,s&&(s=!1,o.forEach(u=>u()))};return Object.assign({},i,{subscribe(u){const d=()=>n&&u(),h=i.subscribe(d);return o.add(u),()=>{h(),o.delete(u)}},dispatch(u){var d;try{return n=!((d=u==null?void 0:u.meta)!=null&&d[U7]),s=!n,s&&(a||(a=!0,l(c))),i.dispatch(u)}finally{n=!0}}})},Y7=t=>function(r){const{autoBatch:i=!0}=r??{};let n=new TE(t);return i&&n.push(j7(typeof i=="object"?i:void 0)),n},X7=!0;function q7(t){const e=H7(),{reducer:r=void 0,middleware:i,devTools:n=!0,preloadedState:s=void 0,enhancers:a=void 0}=t||{};let o;if(typeof r=="function")o=r;else if(lS(r))o=g7(r);else throw new Error(Ln(1));let l;typeof i=="function"?l=i(e):l=e();let c=sm;n&&(c=z7({trace:!X7,...typeof n=="object"&&n}));const u=y7(...l),d=Y7(u);let h=typeof a=="function"?a(d):d();const p=c(...h);return pE(o,s,p)}function BE(t){const e={},r=[];let i;const n={addCase(s,a){const o=typeof s=="string"?s:s.type;if(!o)throw new Error(Ln(28));if(o in e)throw new Error(Ln(29));return e[o]=a,n},addMatcher(s,a){return r.push({matcher:s,reducer:a}),n},addDefaultCase(s){return i=s,n}};return t(n),[e,r,i]}function K7(t){return typeof t=="function"}function Q7(t,e){let[r,i,n]=BE(e),s;if(K7(t))s=()=>sC(t());else{const o=sC(t);s=()=>o}function a(o=s(),l){let c=[r[l.type],...i.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[n]),c.reduce((u,d)=>{if(d)if(Wo(u)){const p=d(u,l);return p===void 0?u:p}else{if(eo(u))return xE(u,h=>d(h,l));{const h=d(u,l);if(h===void 0){if(u===null)return u;throw new Error(Ln(9))}return h}}return u},o)}return a.getInitialState=s,a}var J7="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Z7=(t=21)=>{let e="",r=t;for(;r--;)e+=J7[Math.random()*64|0];return e},ej=Symbol.for("rtk-slice-createasyncthunk");function tj(t,e){return`${t}/${e}`}function rj({creators:t}={}){var r;const e=(r=t==null?void 0:t.asyncThunk)==null?void 0:r[ej];return function(n){const{name:s,reducerPath:a=s}=n;if(!s)throw new Error(Ln(11));typeof process<"u";const o=(typeof n.reducers=="function"?n.reducers(sj()):n.reducers)||{},l=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(b,k){const C=typeof b=="string"?b:b.type;if(!C)throw new Error(Ln(12));if(C in c.sliceCaseReducersByType)throw new Error(Ln(13));return c.sliceCaseReducersByType[C]=k,u},addMatcher(b,k){return c.sliceMatchers.push({matcher:b,reducer:k}),u},exposeAction(b,k){return c.actionCreators[b]=k,u},exposeCaseReducer(b,k){return c.sliceCaseReducersByName[b]=k,u}};l.forEach(b=>{const k=o[b],C={reducerName:b,type:tj(s,b),createNotation:typeof n.reducers=="function"};oj(k)?cj(C,k,u,e):aj(C,k,u)});function d(){const[b={},k=[],C=void 0]=typeof n.extraReducers=="function"?BE(n.extraReducers):[n.extraReducers],x={...b,...c.sliceCaseReducersByType};return Q7(n.initialState,_=>{for(let P in x)_.addCase(P,x[P]);for(let P of c.sliceMatchers)_.addMatcher(P.matcher,P.reducer);for(let P of k)_.addMatcher(P.matcher,P.reducer);C&&_.addDefaultCase(C)})}const h=b=>b,p=new Map;let f;function m(b,k){return f||(f=d()),f(b,k)}function y(){return f||(f=d()),f.getInitialState()}function v(b,k=!1){function C(_){let P=_[b];return typeof P>"u"&&k&&(P=y()),P}function x(_=h){const P=aC(p,k,{insert:()=>new WeakMap});return aC(P,_,{insert:()=>{const R={};for(const[E,D]of Object.entries(n.selectors??{}))R[E]=ij(D,_,y,k);return R}})}return{reducerPath:b,getSelectors:x,get selectors(){return x(C)},selectSlice:C}}const g={name:s,reducer:m,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...v(a),injectInto(b,{reducerPath:k,...C}={}){const x=k??a;return b.inject({reducerPath:x,reducer:m},C),{...g,...v(x,!0)}}};return g}}function ij(t,e,r,i){function n(s,...a){let o=e(s);return typeof o>"u"&&i&&(o=r()),t(o,...a)}return n.unwrapped=t,n}var nj=rj();function sj(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function aj({type:t,reducerName:e,createNotation:r},i,n){let s,a;if("reducer"in i){if(r&&!lj(i))throw new Error(Ln(17));s=i.reducer,a=i.prepare}else s=i;n.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,a?ou(t,a):ou(t))}function oj(t){return t._reducerDefinitionType==="asyncThunk"}function lj(t){return t._reducerDefinitionType==="reducerWithPrepare"}function cj({type:t,reducerName:e},r,i,n){if(!n)throw new Error(Ln(18));const{payloadCreator:s,fulfilled:a,pending:o,rejected:l,settled:c,options:u}=r,d=n(t,s,u);i.exposeAction(e,d),a&&i.addCase(d.fulfilled,a),o&&i.addCase(d.pending,o),l&&i.addCase(d.rejected,l),c&&i.addMatcher(d.settled,c),i.exposeCaseReducer(e,{fulfilled:a||Ff,pending:o||Ff,rejected:l||Ff,settled:c||Ff})}function Ff(){}var uj=(t,e)=>{if(typeof t!="function")throw new Error(Ln(32))},hS="listenerMiddleware",dj=t=>{let{type:e,actionCreator:r,matcher:i,predicate:n,effect:s}=t;if(e)n=ou(e).match;else if(r)e=r.type,n=r.match;else if(i)n=i;else if(!n)throw new Error(Ln(21));return uj(s),{predicate:n,type:e,effect:s}},hj=Object.assign(t=>{const{type:e,predicate:r,effect:i}=dj(t);return{id:Z7(),effect:i,type:e,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Ln(22))}}},{withTypes:()=>hj}),fj=Object.assign(ou(`${hS}/add`),{withTypes:()=>fj});ou(`${hS}/removeAll`);var pj=Object.assign(ou(`${hS}/remove`),{withTypes:()=>pj});function Ln(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const mj={value:0,lastChange:""},PE=nj({name:"counter",initialState:mj,reducers:{increment(t){t.value+=1},incrementByAmount(t,e){t.value+=e.payload,t.lastChange=e.type}}}),{increment:MZ,incrementByAmount:oC}=PE.actions,gj=PE.reducer;function yj(){const t=d7(),[e,r]=w.useState(50),i=h7(o=>o.counter.value);function n(){const o=oC(e);t(o)}function s(){const o=oC(-e);t(o)}const a=(o,l)=>{r(l)};return T.jsxs(Tu,{title:"Counter",children:[T.jsx(yn,{onClick:s,children:T.jsx(OG,{})}),T.jsx(yn,{onClick:n,children:T.jsx(aS,{})}),T.jsx(lh,{children:T.jsx(aE,{value:e,onChange:a,valueLabelDisplay:"on"})}),T.jsx(Mr,{variant:"h1",align:"center",children:i})]})}function bj(){const[t,e]=w.useState(1),r=(i,n)=>{e(n)};return T.jsx(Tu,{title:"Rating",children:T.jsxs(lh,{children:[T.jsx(gz,{children:T.jsx(lh,{children:T.jsx(q8,{value:t,onChange:r,size:"large",max:46})})}),T.jsxs(Mr,{color:"pink",variant:"h1",children:["The rating you have chosen is ",t]})]})})}function vj(){return T.jsxs("div",{style:{flexDirection:"column",display:"flex",height:"100%",border:"10px solid green",boxSizing:"border-box"},children:[T.jsx("div",{style:{border:"3px solid blue",height:"100px"}}),T.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",border:"3px solid orange",flex:1},children:[T.jsx("div",{style:{border:"3px solid yellow",width:"100px"}}),T.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",border:"3px solid red",flex:1},children:T.jsx("button",{children:"sIUUUU"})})]}),T.jsx("div",{style:{height:"100px",border:"3px solid pink"}})]})}const wj=["localeText"],tv=w.createContext(null),fS=function(e){const{localeText:r}=e,i=le(e,wj),{utils:n,localeText:s}=w.useContext(tv)??{utils:void 0,localeText:void 0},a=Ve({props:i,name:"MuiLocalizationProvider"}),{children:o,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:d,localeText:h}=a,p=w.useMemo(()=>S({},h,s,r),[h,s,r]),f=w.useMemo(()=>{if(!l)return n||null;const v=new l({locale:d,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`));return v},[l,d,c,u,n]),m=w.useMemo(()=>f?{minDate:f.date("1900-01-01T00:00:00.000"),maxDate:f.date("2099-12-31T00:00:00.000")}:null,[f]),y=w.useMemo(()=>({utils:f,defaultDates:m,localeText:p}),[m,f,p]);return T.jsx(tv.Provider,{value:y,children:o})},Sj=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:S({},t)}}}}),NE={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(t,e,r)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${r.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,selectViewText:t=>`Select ${t}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:t=>`Week ${t}`,calendarWeekNumberText:t=>`${t}`,openDatePickerDialogue:(t,e)=>t!==null&&e.isValid(t)?`Choose date, selected date is ${e.format(t,"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t!==null&&e.isValid(t)?`Choose time, selected time is ${e.format(t,"fullTime")}`:"Choose time",fieldClearLabel:"Clear value",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:t=>"Y".repeat(t.digitAmount),fieldMonthPlaceholder:t=>t.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:t=>t.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},xj=NE;Sj(NE);const ql=()=>{const t=w.useContext(tv);if(t===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` `));if(t.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` -`));const e=w.useMemo(()=>S({},Sj,t.localeText),[t.localeText]);return w.useMemo(()=>S({},t,{localeText:e}),[t,e])},qt=()=>ql().utils,Yh=()=>ql().defaultDates,rn=()=>ql().localeText,Kl=t=>{const e=qt(),r=w.useRef();return r.current===void 0&&(r.current=e.date(void 0,t)),r.current},xj=Tr(T.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),kj=Tr(T.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Cj=Tr(T.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Tj=Tr(T.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),_j=Tr(T.jsxs(w.Fragment,{children:[T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),T.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");Tr(T.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");Tr(T.jsxs(w.Fragment,{children:[T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),T.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const Bj=Tr(T.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function Pj(t){return He("MuiPickersArrowSwitcher",t)}Ue("MuiPickersArrowSwitcher",["root","spacer","button"]);const Nj=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Ej=["ownerState"],Rj=["ownerState"],Mj=K("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),Dj=K("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),lC=K(yn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Lj=t=>{const{classes:e}=t;return $e({root:["root"],spacer:["spacer"],button:["button"]},Pj,e)},NE=w.forwardRef(function(e,r){const i=Xi(),n=Ae({props:e,name:"MuiPickersArrowSwitcher"}),{children:s,className:a,slots:o,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:d,nextLabel:h,isPreviousDisabled:p,isPreviousHidden:f,onGoToPrevious:m,previousLabel:y,labelId:v}=n,g=oe(n,Nj),b=n,k=Lj(b),C={isDisabled:c,isHidden:u,goTo:d,label:h},x={isDisabled:p,isHidden:f,goTo:m,label:y},_=(o==null?void 0:o.previousIconButton)??lC,P=Ct({elementType:_,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:x.label,"aria-label":x.label,disabled:x.isDisabled,edge:"end",onClick:x.goTo},ownerState:S({},b,{hidden:x.isHidden}),className:k.button}),R=(o==null?void 0:o.nextIconButton)??lC,E=Ct({elementType:R,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:C.label,"aria-label":C.label,disabled:C.isDisabled,edge:"start",onClick:C.goTo},ownerState:S({},b,{hidden:C.isHidden}),className:k.button}),D=(o==null?void 0:o.leftArrowIcon)??kj,$=Ct({elementType:D,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),I=oe($,Ej),F=(o==null?void 0:o.rightArrowIcon)??Cj,M=Ct({elementType:F,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),O=oe(M,Rj);return T.jsxs(Mj,S({ref:r,className:xe(k.root,a),ownerState:b},g,{children:[T.jsx(_,S({},P,{children:i?T.jsx(F,S({},O)):T.jsx(D,S({},I))})),s?T.jsx(Mr,{variant:"subtitle1",component:"span",id:v,children:s}):T.jsx(Dj,{className:k.spacer,ownerState:b}),T.jsx(R,S({},E,{children:i?T.jsx(D,S({},I)):T.jsx(F,S({},O))}))]}))}),fa=(t,e)=>t.length!==e.length?!1:e.every(r=>t.includes(r)),EE=({openTo:t,defaultOpenTo:e,views:r,defaultViews:i})=>{const n=r??i;let s;if(t!=null)s=t;else if(n.includes(e))s=e;else if(n.length>0)s=n[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:n,openTo:s}},RE=["hours","minutes","seconds"],dh=t=>RE.includes(t),Fj=t=>RE.includes(t)||t==="meridiem",Ij=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,hh=(t,e,r)=>r&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,Oj=(t,e,r,i)=>{const n=hh(i.getHours(t),e,r);return i.setHours(t,n)},cC=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Xh=(t,e)=>(r,i)=>t?e.isAfter(r,i):cC(r,e)>cC(i,e),ME=(t,{format:e,views:r,ampm:i})=>{if(e!=null)return e;const n=t.formats;return fa(r,["hours"])?i?`${n.hours12h} ${n.meridiem}`:n.hours24h:fa(r,["minutes"])?n.minutes:fa(r,["seconds"])?n.seconds:fa(r,["minutes","seconds"])?`${n.minutes}:${n.seconds}`:fa(r,["hours","minutes","seconds"])?i?`${n.hours12h}:${n.minutes}:${n.seconds} ${n.meridiem}`:`${n.hours24h}:${n.minutes}:${n.seconds}`:i?`${n.hours12h}:${n.minutes} ${n.meridiem}`:`${n.hours24h}:${n.minutes}`};function qh({onChange:t,onViewChange:e,openTo:r,view:i,views:n,autoFocus:s,focusedView:a,onFocusedViewChange:o}){const l=w.useRef(r),c=w.useRef(n),u=w.useRef(n.includes(r)?r:n[0]),[d,h]=xs({name:"useViews",state:"view",controlled:i,default:u.current}),p=w.useRef(s?d:null),[f,m]=xs({name:"useViews",state:"focusedView",controlled:a,default:p.current});w.useEffect(()=>{(l.current&&l.current!==r||c.current&&c.current.some(_=>!n.includes(_)))&&(h(n.includes(r)?r:n[0]),c.current=n,l.current=r)},[r,h,d,n]);const y=n.indexOf(d),v=n[y-1]??null,g=n[y+1]??null,b=Ye((_,P)=>{m(P?_:R=>_===R?null:R),o==null||o(_,P)}),k=Ye(_=>{b(_,!0),_!==d&&(h(_),e&&e(_))}),C=Ye(()=>{g&&k(g)}),x=Ye((_,P,R)=>{const E=P==="finish",D=R?n.indexOf(R){const s=n.date(void 0,i),a=n.startOfMonth(e&&n.isBefore(s,r)?s:r);return!n.isAfter(a,t)},[e,r,t,n,i])}function Vj(t,{disablePast:e,minDate:r,timezone:i}){const n=qt();return w.useMemo(()=>{const s=n.date(void 0,i),a=n.startOfMonth(e&&n.isAfter(s,r)?s:r);return!n.isBefore(a,t)},[e,r,t,n,i])}function pS(t,e,r,i){const n=qt(),s=Ij(t,n),a=w.useCallback(o=>{const l=t==null?null:Oj(t,o,!!e,n);r(l,i??"partial")},[e,t,r,i,n]);return{meridiemMode:s,handleMeridiemChange:a}}const fh=36,Kg=2,Qg=320,$j=280,mS=336,DE=232,zj=48,Jg=K("div")({overflow:"hidden",width:Qg,maxHeight:mS,display:"flex",flexDirection:"column",margin:"0 auto"});function Wj(t){return He("MuiTimeClock",t)}Ue("MuiTimeClock",["root","arrowSwitcher"]);const lu=220,ka=36,ph={x:lu/2,y:lu/2},LE={x:ph.x,y:0},Hj=LE.x-ph.x,Uj=LE.y-ph.y,Gj=t=>t*(180/Math.PI),FE=(t,e,r)=>{const i=e-ph.x,n=r-ph.y,s=Math.atan2(Hj,Uj)-Math.atan2(i,n);let a=Gj(s);a=Math.round(a/t)*t,a%=360;const o=Math.floor(a/t)||0,l=i**2+n**2,c=Math.sqrt(l);return{value:o,distance:c}},jj=(t,e,r=1)=>{const i=r*6;let{value:n}=FE(i,t,e);return n=n*r%60,n},Yj=(t,e,r)=>{const{value:i,distance:n}=FE(30,t,e);let s=i||12;return r?s%=12:n{const{classes:e}=t;return $e({root:["root"],thumb:["thumb"]},Xj,e)},Qj=K("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Jj=K("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ka/2}px)`,border:`${(ka-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function Zj(t){const e=Ae({props:t,name:"MuiClockPointer"}),{className:r,isInner:i,type:n,viewValue:s}=e,a=oe(e,qj),o=w.useRef(n);w.useEffect(()=>{o.current=n},[n]);const l=S({},e,{shouldAnimate:o.current!==n}),c=Kj(l),u=()=>{let h=360/(n==="hours"?12:60)*s;return n==="hours"&&s>12&&(h-=360),{height:Math.round((i?.26:.4)*lu),transform:`rotateZ(${h}deg)`}};return T.jsx(Qj,S({style:u(),className:xe(r,c.root),ownerState:l},a,{children:T.jsx(Jj,{ownerState:l,className:c.thumb})}))}function e9(t){return He("MuiClock",t)}Ue("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText"]);const cm=(t,e,r)=>{let i=e;return i=t.setHours(i,t.getHours(r)),i=t.setMinutes(i,t.getMinutes(r)),i=t.setSeconds(i,t.getSeconds(r)),i},Md=({date:t,disableFuture:e,disablePast:r,maxDate:i,minDate:n,isDateDisabled:s,utils:a,timezone:o})=>{const l=cm(a,a.date(void 0,o),t);r&&a.isBefore(n,l)&&(n=l),e&&a.isAfter(i,l)&&(i=l);let c=t,u=t;for(a.isBefore(t,n)&&(c=n,u=null),a.isAfter(t,i)&&(u&&(u=i),c=null);c||u;){if(c&&a.isAfter(c,i)&&(c=null),u&&a.isBefore(u,n)&&(u=null),c){if(!s(c))return c;c=a.addDays(c,1)}if(u){if(!s(u))return u;u=a.addDays(u,-1)}}return null},t9=(t,e)=>e==null||!t.isValid(e)?null:e,Bs=(t,e,r)=>e==null||!t.isValid(e)?r:e,r9=(t,e,r)=>!t.isValid(e)&&e!=null&&!t.isValid(r)&&r!=null?!0:t.isEqual(e,r),gS=(t,e)=>{const i=[t.startOfYear(e)];for(;i.length<12;){const n=i[i.length-1];i.push(t.addMonths(n,1))}return i},yS=(t,e,r)=>r==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),Co=(t,e)=>{const r=t.setHours(t.date(),e==="am"?2:14);return t.format(r,"meridiem")},i9=["year","month","day"],uC=t=>i9.includes(t),bS=(t,{format:e,views:r},i)=>{if(e!=null)return e;const n=t.formats;return fa(r,["year"])?n.year:fa(r,["month"])?n.month:fa(r,["day"])?n.dayOfMonth:fa(r,["month","year"])?`${n.month} ${n.year}`:fa(r,["day","month"])?`${n.month} ${n.dayOfMonth}`:i?/en/.test(t.getCurrentLocaleCode())?n.normalDateWithWeekday:n.normalDate:n.keyboardDate},n9=(t,e)=>{const r=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(i=>t.addDays(r,i))},s9=t=>{const{classes:e}=t;return $e({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"],meridiemText:["meridiemText"]},e9,e)},a9=K("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),o9=K("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),l9=K("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),c9=K("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),u9=K("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),d9=K(yn,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>({zIndex:1,position:"absolute",bottom:8,left:8,paddingLeft:4,paddingRight:4,width:ka,variants:[{props:{meridiemMode:"am"},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]})),h9=K(yn,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>({zIndex:1,position:"absolute",bottom:8,right:8,paddingLeft:4,paddingRight:4,width:ka,variants:[{props:{meridiemMode:"pm"},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]})),dC=K(Mr,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function f9(t){const e=Ae({props:t,name:"MuiClock"}),{ampm:r,ampmInClock:i,autoFocus:n,children:s,value:a,handleMeridiemChange:o,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:d,selectedId:h,type:p,viewValue:f,disabled:m=!1,readOnly:y,className:v}=e,g=e,b=qt(),k=rn(),C=w.useRef(!1),x=s9(g),_=l(f,p),P=!r&&p==="hours"&&(f<1||f>12),R=(V,W)=>{m||y||l(V,p)||d(V,W)},E=(V,W)=>{let{offsetX:Q,offsetY:ne}=V;if(Q===void 0){const te=V.target.getBoundingClientRect();Q=V.changedTouches[0].clientX-te.left,ne=V.changedTouches[0].clientY-te.top}const ie=p==="seconds"||p==="minutes"?jj(Q,ne,u):Yj(Q,ne,!!r);R(ie,W)},D=V=>{C.current=!0,E(V,"shallow")},$=V=>{C.current&&(E(V,"finish"),C.current=!1)},I=V=>{V.buttons>0&&E(V.nativeEvent,"shallow")},F=V=>{C.current&&(C.current=!1),E(V.nativeEvent,"finish")},M=w.useMemo(()=>p==="hours"?!0:f%5===0,[p,f]),O=p==="minutes"?u:1,A=w.useRef(null);zr(()=>{n&&A.current.focus()},[n]);const N=V=>{if(!C.current)switch(V.key){case"Home":R(0,"partial"),V.preventDefault();break;case"End":R(p==="minutes"?59:23,"partial"),V.preventDefault();break;case"ArrowUp":R(f+O,"partial"),V.preventDefault();break;case"ArrowDown":R(f-O,"partial"),V.preventDefault();break}};return T.jsxs(a9,{className:xe(v,x.root),children:[T.jsxs(o9,{className:x.clock,children:[T.jsx(c9,{onTouchMove:D,onTouchEnd:$,onMouseUp:F,onMouseMove:I,ownerState:{disabled:m},className:x.squareMask}),!_&&T.jsxs(w.Fragment,{children:[T.jsx(u9,{className:x.pin}),a!=null&&T.jsx(Zj,{type:p,viewValue:f,isInner:P,hasSelected:M})]}),T.jsx(l9,{"aria-activedescendant":h,"aria-label":k.clockLabelText(p,a,b),ref:A,role:"listbox",onKeyDown:N,tabIndex:0,className:x.wrapper,children:s})]}),r&&i&&T.jsxs(w.Fragment,{children:[T.jsx(d9,{onClick:y?void 0:()=>o("am"),disabled:m||c===null,ownerState:g,className:x.amButton,title:Co(b,"am"),children:T.jsx(dC,{variant:"caption",className:x.meridiemText,children:Co(b,"am")})}),T.jsx(h9,{disabled:m||c===null,onClick:y?void 0:()=>o("pm"),ownerState:g,className:x.pmButton,title:Co(b,"pm"),children:T.jsx(dC,{variant:"caption",className:x.meridiemText,children:Co(b,"pm")})})]})]})}function p9(t){return He("MuiClockNumber",t)}const If=Ue("MuiClockNumber",["root","selected","disabled"]),m9=["className","disabled","index","inner","label","selected"],g9=t=>{const{classes:e,selected:r,disabled:i}=t;return $e({root:["root",r&&"selected",i&&"disabled"]},p9,e)},y9=K("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${If.disabled}`]:e.disabled},{[`&.${If.selected}`]:e.selected}]})(({theme:t})=>({height:ka,width:ka,position:"absolute",left:`calc((100% - ${ka}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${If.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${If.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:S({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function IE(t){const e=Ae({props:t,name:"MuiClockNumber"}),{className:r,disabled:i,index:n,inner:s,label:a,selected:o}=e,l=oe(e,m9),c=e,u=g9(c),d=n%12/12*Math.PI*2-Math.PI/2,h=(lu-ka-2)/2*(s?.65:1),p=Math.round(Math.cos(d)*h),f=Math.round(Math.sin(d)*h);return T.jsx(y9,S({className:xe(r,u.root),"aria-disabled":i?!0:void 0,"aria-selected":o?!0:void 0,role:"option",style:{transform:`translate(${p}px, ${f+(lu-ka)/2}px`},ownerState:c},l,{children:a}))}const b9=({ampm:t,value:e,getClockNumberText:r,isDisabled:i,selectedId:n,utils:s})=>{const a=e?s.getHours(e):null,o=[],l=t?1:0,c=t?12:23,u=d=>a===null?!1:t?d===12?a===12||a===0:a===d||a-12===d:a===d;for(let d=l;d<=c;d+=1){let h=d.toString();d===0&&(h="00");const p=!t&&(d===0||d>12);h=s.formatNumber(h);const f=u(d);o.push(T.jsx(IE,{id:f?n:void 0,index:d,inner:p,selected:f,disabled:i(d),label:h,"aria-label":r(h)},d))}return o},hC=({utils:t,value:e,isDisabled:r,getClockNumberText:i,selectedId:n})=>{const s=t.formatNumber;return[[5,s("05")],[10,s("10")],[15,s("15")],[20,s("20")],[25,s("25")],[30,s("30")],[35,s("35")],[40,s("40")],[45,s("45")],[50,s("50")],[55,s("55")],[0,s("00")]].map(([a,o],l)=>{const c=a===e;return T.jsx(IE,{label:o,id:c?n:void 0,index:l+1,inner:!1,disabled:r(a),selected:c,"aria-label":i(o)},a)})},vS=({timezone:t,value:e,defaultValue:r,onChange:i,valueManager:n})=>{const s=qt(),a=w.useRef(r),o=e??a.current??n.emptyValue,l=w.useMemo(()=>n.getTimezone(s,o),[s,n,o]),c=Ye(p=>l==null?p:n.setTimezone(s,l,p)),u=t??l??"default",d=w.useMemo(()=>n.setTimezone(s,u,o),[n,s,u,o]),h=Ye((p,...f)=>{const m=c(p);i==null||i(m,...f)});return{value:d,handleValueChange:h,timezone:u}},_u=({name:t,timezone:e,value:r,defaultValue:i,onChange:n,valueManager:s})=>{const[a,o]=xs({name:t,state:"value",controlled:r,default:i??s.emptyValue}),l=Ye((c,...u)=>{o(c),n==null||n(c,...u)});return vS({timezone:e,value:a,defaultValue:void 0,onChange:l,valueManager:s})},zs={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},v9=t=>Math.max(...t.map(e=>zs[e.type]??1)),Ju=(t,e,r)=>{if(e===zs.year)return t.startOfYear(r);if(e===zs.month)return t.startOfMonth(r);if(e===zs.day)return t.startOfDay(r);let i=r;return e{let s=n?n():Ju(e,r,yS(e,i));t.minDate!=null&&e.isAfterDay(t.minDate,s)&&(s=Ju(e,r,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,s)&&(s=Ju(e,r,t.maxDate));const a=Xh(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&a(t.minTime,s)&&(s=Ju(e,r,t.disableIgnoringDatePartForTimeValidation?t.minTime:cm(e,s,t.minTime))),t.maxTime!=null&&a(s,t.maxTime)&&(s=Ju(e,r,t.disableIgnoringDatePartForTimeValidation?t.maxTime:cm(e,s,t.maxTime))),s},OE=(t,e)=>{const r=t.formatTokenMap[e];if(r==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` -`));return typeof r=="string"?{type:r,contentType:r==="meridiem"?"letter":"digit",maxLength:void 0}:{type:r.sectionType,contentType:r.contentType,maxLength:r.maxLength}},S9=t=>{switch(t){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Zg=(t,e,r)=>{const i=[],n=t.date(void 0,e),s=t.startOfWeek(n),a=t.endOfWeek(n);let o=s;for(;t.isBefore(o,a);)i.push(o),o=t.addDays(o,1);return i.map(l=>t.formatByString(l,r))},AE=(t,e,r,i)=>{switch(r){case"month":return gS(t,t.date(void 0,e)).map(n=>t.formatByString(n,i));case"weekDay":return Zg(t,e,i);case"meridiem":{const n=t.date(void 0,e);return[t.startOfDay(n),t.endOfDay(n)].map(s=>t.formatByString(s,i))}default:return[]}},fC="s",x9=["0","1","2","3","4","5","6","7","8","9"],k9=t=>{const e=t.date(void 0);return t.formatByString(t.setSeconds(e,0),fC)==="0"?x9:Array.from({length:10}).map((i,n)=>t.formatByString(t.setSeconds(e,n),fC))},zl=(t,e)=>{if(e[0]==="0")return t;const r=[];let i="";for(let n=0;n-1&&(r.push(s.toString()),i="")}return r.join("")},wS=(t,e)=>e[0]==="0"?t:t.split("").map(r=>e[Number(r)]).join(""),pC=(t,e)=>{const r=zl(t,e);return r!==" "&&!Number.isNaN(Number(r))},VE=(t,e)=>{let r=t;for(r=Number(r).toString();r.length{if(n.type==="day"&&n.contentType==="digit-with-letter"){const a=t.setDate(r.longestMonth,e);return t.formatByString(a,n.format)}let s=e.toString();return n.hasLeadingZerosInInput&&(s=VE(s,n.maxLength)),wS(s,i)},C9=(t,e,r,i,n,s,a,o)=>{const l=S9(i),c=i==="Home",u=i==="End",d=r.value===""||c||u,h=()=>{const f=n[r.type]({currentDate:a,format:r.format,contentType:r.contentType}),m=b=>$E(t,b,f,s,r),y=r.type==="minutes"&&(o!=null&&o.minutesStep)?o.minutesStep:1;let g=parseInt(zl(r.value,s),10)+l*y;if(d){if(r.type==="year"&&!u&&!c)return t.formatByString(t.date(void 0,e),r.format);l>0||c?g=f.minimum:g=f.maximum}return g%y!==0&&((l<0||c)&&(g+=y-(y+g)%y),(l>0||u)&&(g-=g%y)),g>f.maximum?m(f.minimum+(g-f.maximum-1)%(f.maximum-f.minimum+1)):g{const f=AE(t,e,r.type,r.format);if(f.length===0)return r.value;if(d)return l>0||c?f[0]:f[f.length-1];const v=((f.indexOf(r.value)+l)%f.length+f.length)%f.length;return f[v]};return r.contentType==="digit"||r.contentType==="digit-with-letter"?h():p()},SS=(t,e,r)=>{let i=t.value||t.placeholder;const n=e==="non-input"?t.hasLeadingZerosInFormat:t.hasLeadingZerosInInput;return e==="non-input"&&t.hasLeadingZerosInInput&&!t.hasLeadingZerosInFormat&&(i=Number(zl(i,r)).toString()),["input-rtl","input-ltr"].includes(e)&&t.contentType==="digit"&&!n&&i.length===1&&(i=`${i}‎`),e==="input-rtl"&&(i=`⁨${i}⁩`),i},mC=(t,e,r,i)=>t.formatByString(t.parse(e,r),i),zE=(t,e,r)=>t.formatByString(t.date(void 0,e),r).length===4,WE=(t,e,r,i,n)=>{if(r!=="digit")return!1;const s=t.date(void 0,e);switch(i){case"year":return zE(t,e,n)?t.formatByString(t.setYear(s,1),n)==="0001":t.formatByString(t.setYear(s,2001),n)==="01";case"month":return t.formatByString(t.startOfYear(s),n).length>1;case"day":return t.formatByString(t.startOfMonth(s),n).length>1;case"weekDay":return t.formatByString(t.startOfWeek(s),n).length>1;case"hours":return t.formatByString(t.setHours(s,1),n).length>1;case"minutes":return t.formatByString(t.setMinutes(s,1),n).length>1;case"seconds":return t.formatByString(t.setSeconds(s,1),n).length>1;default:throw new Error("Invalid section type")}},T9=(t,e,r)=>{const i=e.some(l=>l.type==="day"),n=[],s=[];for(let l=0;lt.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),B9=(t,e,r)=>{const n=t.map(s=>{const a=SS(s,r?"input-rtl":"input-ltr",e);return`${s.startSeparator}${a}${s.endSeparator}`}).join("");return r?`⁦${n}⁩`:n},P9=(t,e,r)=>{const i=t.date(void 0,r),n=t.endOfYear(i),s=t.endOfDay(i),{maxDaysInMonth:a,longestMonth:o}=gS(t,i).reduce((l,c)=>{const u=t.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:zE(t,r,l)?9999:99}),month:()=>({minimum:1,maximum:t.getMonth(n)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&t.isValid(l)?t.getDaysInMonth(l):a,longestMonth:o}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=Zg(t,r,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=t.getHours(s);return zl(t.formatByString(t.endOfDay(i),l),e)!==c.toString()?{minimum:1,maximum:Number(zl(t.formatByString(t.startOfDay(i),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:t.getMinutes(s)}),seconds:()=>({minimum:0,maximum:t.getSeconds(s)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},N9=(t,e,r,i,n)=>{switch(r.type){case"year":return t.setYear(n,t.getYear(i));case"month":return t.setMonth(n,t.getMonth(i));case"weekDay":{const s=Zg(t,e,r.format),a=t.formatByString(i,r.format),o=s.indexOf(a),c=s.indexOf(r.value)-o;return t.addDays(i,c)}case"day":return t.setDate(n,t.getDate(i));case"meridiem":{const s=t.getHours(i)<12,a=t.getHours(n);return s&&a>=12?t.addHours(n,-12):!s&&a<12?t.addHours(n,12):n}case"hours":return t.setHours(n,t.getHours(i));case"minutes":return t.setMinutes(n,t.getMinutes(i));case"seconds":return t.setSeconds(n,t.getSeconds(i));default:return n}},gC={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},yC=(t,e,r,i,n,s)=>[...i].sort((a,o)=>gC[a.type]-gC[o.type]).reduce((a,o)=>!s||o.modified?N9(t,e,o,r,a):a,n),E9=()=>navigator.userAgent.toLowerCase().indexOf("android")>-1,R9=(t,e)=>{const r={};if(!e)return t.forEach((l,c)=>{const u=c===0?null:c-1,d=c===t.length-1?null:c+1;r[c]={leftIndex:u,rightIndex:d}}),{neighbors:r,startIndex:0,endIndex:t.length-1};const i={},n={};let s=0,a=0,o=t.length-1;for(;o>=0;){a=t.findIndex((l,c)=>{var u;return c>=s&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),a===-1&&(a=t.length-1);for(let l=a;l>=s;l-=1)n[l]=o,i[o]=l,o-=1;s=a+1}return t.forEach((l,c)=>{const u=n[c],d=u===0?null:i[u-1],h=u===t.length-1?null:i[u+1];r[c]={leftIndex:d,rightIndex:h}}),{neighbors:r,startIndex:i[0],endIndex:i[t.length-1]}},rv=(t,e)=>t==null?null:t==="all"?"all":typeof t=="string"?e.findIndex(r=>r.type===t):t,M9=(t,e)=>{if(t.value)switch(t.type){case"month":{if(t.contentType==="digit")return e.format(e.setMonth(e.date(),Number(t.value)-1),"month");const r=e.parse(t.value,t.format);return r?e.format(r,"month"):void 0}case"day":return t.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(t.value)),"dayOfMonthFull"):t.value;case"weekDay":return;default:return}},D9=(t,e)=>{if(t.value)switch(t.type){case"weekDay":return t.contentType==="letter"?void 0:Number(t.value);case"meridiem":{const r=e.parse(`01:00 ${t.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${t.format}`);return r?e.getHours(r)>=12?1:0:void 0}case"day":return t.contentType==="digit-with-letter"?parseInt(t.value,10):Number(t.value);case"month":{if(t.contentType==="digit")return Number(t.value);const r=e.parse(t.value,t.format);return r?e.getMonth(r)+1:void 0}default:return t.contentType!=="letter"?Number(t.value):void 0}},L9=["value","referenceDate"],en={emptyValue:null,getTodayValue:yS,getInitialReferenceValue:t=>{let{value:e,referenceDate:r}=t,i=oe(t,L9);return e!=null&&i.utils.isValid(e)?e:r??w9(i)},cleanValue:t9,areValuesEqual:r9,isSameError:(t,e)=>t===e,hasError:t=>t!=null,defaultErrorState:null,getTimezone:(t,e)=>e==null||!t.isValid(e)?null:t.getTimezone(e),setTimezone:(t,e,r)=>r==null?null:t.setTimezone(r,e)},HE={updateReferenceValue:(t,e,r)=>e==null||!t.isValid(e)?r:e,getSectionsFromValue:(t,e,r,i)=>!t.isValid(e)&&!!r?r:i(e),getV7HiddenInputValueFromSections:_9,getV6InputValueFromSections:B9,getActiveDateManager:(t,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:r=>r,getNewValuesFromNewActiveDate:r=>({value:r,referenceValue:r==null||!t.isValid(r)?e.referenceValue:r})}),parseValueStr:(t,e,r)=>r(t.trim(),e)},xS=({value:t,referenceDate:e,utils:r,props:i,timezone:n})=>{const s=w.useMemo(()=>en.getInitialReferenceValue({value:t,utils:r,props:i,referenceDate:e,granularity:zs.day,timezone:n,getTodayDate:()=>yS(r,n,"date")}),[]);return t??s},F9=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],I9=t=>{const{classes:e}=t;return $e({root:["root"],arrowSwitcher:["arrowSwitcher"]},Wj,e)},O9=K(Jg,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),A9=K(NE,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),V9=["hours","minutes"],$9=w.forwardRef(function(e,r){const i=qt(),n=Ae({props:e,name:"MuiTimeClock"}),{ampm:s=i.is12HourCycleInCurrentLocale(),ampmInClock:a=!1,autoFocus:o,slots:l,slotProps:c,value:u,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:f,minTime:m,disableFuture:y,disablePast:v,minutesStep:g=1,shouldDisableTime:b,showViewSwitcher:k,onChange:C,view:x,views:_=V9,openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,timezone:M}=n,O=oe(n,F9),{value:A,handleValueChange:N,timezone:V}=_u({name:"TimeClock",timezone:M,value:u,defaultValue:d,onChange:C,valueManager:en}),W=xS({value:A,referenceDate:h,utils:i,props:n,timezone:V}),Q=rn(),ne=Kl(V),{view:ie,setView:te,previousView:j,nextView:J,setValueAndGoToNextView:pe}=qh({view:x,views:_,openTo:P,onViewChange:R,onChange:N,focusedView:E,onFocusedViewChange:D}),{meridiemMode:fe,handleMeridiemChange:Me}=pS(W,s,pe),_e=w.useCallback((Y,Be)=>{const ce=Xh(p,i),L=Be==="hours"||Be==="minutes"&&_.includes("seconds"),U=({start:re,end:we})=>!(m&&ce(m,we)||f&&ce(re,f)||y&&ce(re,ne)||v&&ce(ne,L?we:re)),G=(re,we=1)=>{if(re%we!==0)return!1;if(b)switch(Be){case"hours":return!b(i.setHours(W,re),"hours");case"minutes":return!b(i.setMinutes(W,re),"minutes");case"seconds":return!b(i.setSeconds(W,re),"seconds");default:return!1}return!0};switch(Be){case"hours":{const re=hh(Y,fe,s),we=i.setHours(W,re),me=i.setSeconds(i.setMinutes(we,0),0),Ee=i.setSeconds(i.setMinutes(we,59),59);return!U({start:me,end:Ee})||!G(re)}case"minutes":{const re=i.setMinutes(W,Y),we=i.setSeconds(re,0),me=i.setSeconds(re,59);return!U({start:we,end:me})||!G(Y,g)}case"seconds":{const re=i.setSeconds(W,Y);return!U({start:re,end:re})||!G(Y)}default:throw new Error("not supported")}},[s,W,p,f,fe,m,g,b,i,y,v,ne,_]),ke=ia(),Ce=w.useMemo(()=>{switch(ie){case"hours":{const Y=(Be,ce)=>{const L=hh(Be,fe,s);pe(i.setHours(W,L),ce,"hours")};return{onChange:Y,viewValue:i.getHours(W),children:b9({value:A,utils:i,ampm:s,onChange:Y,getClockNumberText:Q.hoursClockNumberText,isDisabled:Be=>I||_e(Be,"hours"),selectedId:ke})}}case"minutes":{const Y=i.getMinutes(W),Be=(ce,L)=>{pe(i.setMinutes(W,ce),L,"minutes")};return{viewValue:Y,onChange:Be,children:hC({utils:i,value:Y,onChange:Be,getClockNumberText:Q.minutesClockNumberText,isDisabled:ce=>I||_e(ce,"minutes"),selectedId:ke})}}case"seconds":{const Y=i.getSeconds(W),Be=(ce,L)=>{pe(i.setSeconds(W,ce),L,"seconds")};return{viewValue:Y,onChange:Be,children:hC({utils:i,value:Y,onChange:Be,getClockNumberText:Q.secondsClockNumberText,isDisabled:ce=>I||_e(ce,"seconds"),selectedId:ke})}}default:throw new Error("You must provide the type for ClockView")}},[ie,i,A,s,Q.hoursClockNumberText,Q.minutesClockNumberText,Q.secondsClockNumberText,fe,pe,W,_e,ke,I]),X=n,ee=I9(X);return T.jsxs(O9,S({ref:r,className:xe(ee.root,$),ownerState:X},O,{children:[T.jsx(f9,S({autoFocus:o??!!E,ampmInClock:a&&_.includes("hours"),value:A,type:ie,ampm:s,minutesStep:g,isTimeDisabled:_e,meridiemMode:fe,handleMeridiemChange:Me,selectedId:ke,disabled:I,readOnly:F},Ce)),k&&T.jsx(A9,{className:ee.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>te(j),isPreviousDisabled:!j,previousLabel:Q.openPreviousView,onGoToNext:()=>te(J),isNextDisabled:!J,nextLabel:Q.openNextView,ownerState:X})]}))});function z9(t){return He("MuiDigitalClock",t)}Ue("MuiDigitalClock",["root","list","item"]);const W9=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],H9=t=>{const{classes:e}=t;return $e({root:["root"],list:["list"],item:["item"]},z9,e)},U9=K(Jg,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:DE,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),G9=K(iS,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),j9=K(ZN,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity)}})),Y9=w.forwardRef(function(e,r){const i=qt(),n=w.useRef(null),s=Wt(r,n),a=Ae({props:e,name:"MuiDigitalClock"}),{ampm:o=i.is12HourCycleInCurrentLocale(),timeStep:l=30,autoFocus:c,slots:u,slotProps:d,value:h,defaultValue:p,referenceDate:f,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:y,minTime:v,disableFuture:g,disablePast:b,minutesStep:k=1,shouldDisableTime:C,onChange:x,view:_,openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,views:M=["hours"],skipDisabled:O=!1,timezone:A}=a,N=oe(a,W9),{value:V,handleValueChange:W,timezone:Q}=_u({name:"DigitalClock",timezone:A,value:h,defaultValue:p,onChange:x,valueManager:en}),ne=rn(),ie=Kl(Q),te=w.useMemo(()=>S({},a,{alreadyRendered:!!n.current}),[a]),j=H9(te),J=(u==null?void 0:u.digitalClockItem)??j9,pe=Ct({elementType:J,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:j.item}),fe=xS({value:V,referenceDate:f,utils:i,props:a,timezone:Q}),Me=Ye(Y=>W(Y,"finish","hours")),{setValueAndGoToNextView:_e}=qh({view:_,views:M,openTo:P,onViewChange:R,onChange:Me,focusedView:E,onFocusedViewChange:D}),ke=Ye(Y=>{_e(Y,"finish")});w.useEffect(()=>{if(n.current===null)return;const Y=n.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!Y)return;const Be=Y.offsetTop;(c||E)&&Y.focus(),n.current.scrollTop=Be-4});const Ce=w.useCallback(Y=>{const Be=Xh(m,i),ce=()=>!(v&&Be(v,Y)||y&&Be(Y,y)||g&&Be(Y,ie)||b&&Be(ie,Y)),L=()=>i.getMinutes(Y)%k!==0?!1:C?!C(Y,"hours"):!0;return!ce()||!L()},[m,i,v,y,g,ie,b,k,C]),X=w.useMemo(()=>{const Y=i.startOfDay(fe);return[Y,...Array.from({length:Math.ceil(24*60/l)-1},(Be,ce)=>i.addMinutes(Y,l*(ce+1)))]},[fe,l,i]),ee=X.findIndex(Y=>i.isEqual(Y,fe));return T.jsx(U9,S({ref:s,className:xe(j.root,$),ownerState:te},N,{children:T.jsx(G9,{role:"listbox","aria-label":ne.timePickerToolbarTitle,className:j.list,children:X.map((Y,Be)=>{if(O&&Ce(Y))return null;const ce=i.isEqual(Y,V),L=i.format(Y,o?"fullTime12h":"fullTime24h"),U=ee===Be||ee===-1&&Be===0?0:-1;return T.jsx(J,S({onClick:()=>!F&&ke(Y),selected:ce,disabled:I||Ce(Y),disableRipple:F,role:"option","aria-disabled":F,"aria-selected":ce,tabIndex:U},pe,{children:L}),L)})})}))});function X9(t){return He("MuiMultiSectionDigitalClock",t)}Ue("MuiMultiSectionDigitalClock",["root"]);function q9(t){return He("MuiMultiSectionDigitalClockSection",t)}Ue("MuiMultiSectionDigitalClockSection",["root","item"]);const K9=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],Q9=t=>{const{classes:e}=t;return $e({root:["root"],item:["item"]},q9,e)},J9=K(iS,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:DE,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),Z9=K(ZN,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:zj,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity)}})),eY=w.forwardRef(function(e,r){const i=w.useRef(null),n=Wt(r,i),s=w.useRef(null),a=Ae({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:o,onChange:l,className:c,disabled:u,readOnly:d,items:h,active:p,slots:f,slotProps:m,skipDisabled:y}=a,v=oe(a,K9),g=w.useMemo(()=>S({},a,{alreadyRendered:!!i.current}),[a]),b=Q9(g),k=(f==null?void 0:f.digitalClockSectionItem)??Z9;w.useEffect(()=>{if(i.current===null)return;const x=i.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(p&&o&&x&&x.focus(),!x||s.current===x)return;s.current=x;const _=x.offsetTop;i.current.scrollTop=_-4});const C=h.findIndex(x=>x.isFocused(x.value));return T.jsx(J9,S({ref:n,className:xe(b.root,c),ownerState:g,autoFocusItem:o&&p,role:"listbox"},v,{children:h.map((x,_)=>{var $;const P=($=x.isDisabled)==null?void 0:$.call(x,x.value),R=u||P;if(y&&R)return null;const E=x.isSelected(x.value),D=C===_||C===-1&&_===0?0:-1;return T.jsx(k,S({onClick:()=>!d&&l(x.value),selected:E,disabled:R,disableRipple:d,role:"option","aria-disabled":d||R||void 0,"aria-label":x.ariaLabel,"aria-selected":E,tabIndex:D,className:b.item},m==null?void 0:m.digitalClockSectionItem,{children:x.label}),x.label)})}))}),tY=({now:t,value:e,utils:r,ampm:i,isDisabled:n,resolveAriaLabel:s,timeStep:a,valueOrReferenceDate:o})=>{const l=e?r.getHours(e):null,c=[],u=(p,f)=>{const m=f??l;return m===null?!1:i?p===12?m===12||m===0:m===p||m-12===p:m===p},d=p=>u(p,r.getHours(o)),h=i?11:23;for(let p=0;p<=h;p+=a){let f=r.format(r.setHours(t,p),i?"hours12h":"hours24h");const m=s(parseInt(f,10).toString());f=r.formatNumber(f),c.push({value:p,label:f,isSelected:u,isDisabled:n,isFocused:d,ariaLabel:m})}return c},bC=({value:t,utils:e,isDisabled:r,timeStep:i,resolveLabel:n,resolveAriaLabel:s,hasValue:a=!0})=>{const o=c=>t===null?!1:a&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/i)},(c,u)=>{const d=i*u;return{value:d,label:e.formatNumber(n(d)),isDisabled:r,isSelected:o,isFocused:l,ariaLabel:s(d.toString())}})]},rY=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],iY=t=>{const{classes:e}=t;return $e({root:["root"]},X9,e)},nY=K(Jg,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),sY=w.forwardRef(function(e,r){const i=qt(),n=Xi(),s=Ae({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:a=i.is12HourCycleInCurrentLocale(),timeSteps:o,autoFocus:l,slots:c,slotProps:u,value:d,defaultValue:h,referenceDate:p,disableIgnoringDatePartForTimeValidation:f=!1,maxTime:m,minTime:y,disableFuture:v,disablePast:g,minutesStep:b=1,shouldDisableTime:k,onChange:C,view:x,views:_=["hours","minutes"],openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,skipDisabled:M=!1,timezone:O}=s,A=oe(s,rY),{value:N,handleValueChange:V,timezone:W}=_u({name:"MultiSectionDigitalClock",timezone:O,value:d,defaultValue:h,onChange:C,valueManager:en}),Q=rn(),ne=Kl(W),ie=w.useMemo(()=>S({hours:1,minutes:5,seconds:5},o),[o]),te=xS({value:N,referenceDate:p,utils:i,props:s,timezone:W}),j=Ye((U,G,re)=>V(U,G,re)),J=w.useMemo(()=>!a||!_.includes("hours")||_.includes("meridiem")?_:[..._,"meridiem"],[a,_]),{view:pe,setValueAndGoToNextView:fe,focusedView:Me}=qh({view:x,views:J,openTo:P,onViewChange:R,onChange:j,focusedView:E,onFocusedViewChange:D}),_e=Ye(U=>{fe(U,"finish","meridiem")}),{meridiemMode:ke,handleMeridiemChange:Ce}=pS(te,a,_e,"finish"),X=w.useCallback((U,G)=>{const re=Xh(f,i),we=G==="hours"||G==="minutes"&&J.includes("seconds"),me=({start:qe,end:ct})=>!(y&&re(y,ct)||m&&re(qe,m)||v&&re(qe,ne)||g&&re(ne,we?ct:qe)),Ee=(qe,ct=1)=>{if(qe%ct!==0)return!1;if(k)switch(G){case"hours":return!k(i.setHours(te,qe),"hours");case"minutes":return!k(i.setMinutes(te,qe),"minutes");case"seconds":return!k(i.setSeconds(te,qe),"seconds");default:return!1}return!0};switch(G){case"hours":{const qe=hh(U,ke,a),ct=i.setHours(te,qe),Pt=i.setSeconds(i.setMinutes(ct,0),0),be=i.setSeconds(i.setMinutes(ct,59),59);return!me({start:Pt,end:be})||!Ee(qe)}case"minutes":{const qe=i.setMinutes(te,U),ct=i.setSeconds(qe,0),Pt=i.setSeconds(qe,59);return!me({start:ct,end:Pt})||!Ee(U,b)}case"seconds":{const qe=i.setSeconds(te,U);return!me({start:qe,end:qe})||!Ee(U)}default:throw new Error("not supported")}},[a,te,f,m,ke,y,b,k,i,v,g,ne,J]),ee=w.useCallback(U=>{switch(U){case"hours":return{onChange:G=>{const re=hh(G,ke,a);fe(i.setHours(te,re),"finish","hours")},items:tY({now:ne,value:N,ampm:a,utils:i,isDisabled:G=>X(G,"hours"),timeStep:ie.hours,resolveAriaLabel:Q.hoursClockNumberText,valueOrReferenceDate:te})};case"minutes":return{onChange:G=>{fe(i.setMinutes(te,G),"finish","minutes")},items:bC({value:i.getMinutes(te),utils:i,isDisabled:G=>X(G,"minutes"),resolveLabel:G=>i.format(i.setMinutes(ne,G),"minutes"),timeStep:ie.minutes,hasValue:!!N,resolveAriaLabel:Q.minutesClockNumberText})};case"seconds":return{onChange:G=>{fe(i.setSeconds(te,G),"finish","seconds")},items:bC({value:i.getSeconds(te),utils:i,isDisabled:G=>X(G,"seconds"),resolveLabel:G=>i.format(i.setSeconds(ne,G),"seconds"),timeStep:ie.seconds,hasValue:!!N,resolveAriaLabel:Q.secondsClockNumberText})};case"meridiem":{const G=Co(i,"am"),re=Co(i,"pm");return{onChange:Ce,items:[{value:"am",label:G,isSelected:()=>!!N&&ke==="am",isFocused:()=>!!te&&ke==="am",ariaLabel:G},{value:"pm",label:re,isSelected:()=>!!N&&ke==="pm",isFocused:()=>!!te&&ke==="pm",ariaLabel:re}]}}default:throw new Error(`Unknown view: ${U} found.`)}},[ne,N,a,i,ie.hours,ie.minutes,ie.seconds,Q.hoursClockNumberText,Q.minutesClockNumberText,Q.secondsClockNumberText,ke,fe,te,X,Ce]),Y=w.useMemo(()=>{if(!n)return J;const G=J.filter(re=>re!=="meridiem").toReversed();return J.includes("meridiem")&&G.push("meridiem"),G},[n,J]),Be=w.useMemo(()=>J.reduce((U,G)=>S({},U,{[G]:ee(G)}),{}),[J,ee]),ce=s,L=iY(ce);return T.jsx(nY,S({ref:r,className:xe(L.root,$),ownerState:ce,role:"group"},A,{children:Y.map(U=>T.jsx(eY,{items:Be[U].items,onChange:Be[U].onChange,active:pe===U,autoFocus:l??Me===U,disabled:I,readOnly:F,slots:c,slotProps:u,skipDisabled:M,"aria-label":Q.selectViewText(U)},U))}))});function aY(t){return He("MuiPickersDay",t)}const nl=Ue("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),oY=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],lY=t=>{const{selected:e,disableMargin:r,disableHighlightToday:i,today:n,disabled:s,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:o,classes:l}=t,c=a&&!o;return $e({root:["root",e&&!c&&"selected",s&&"disabled",!r&&"dayWithMargin",!i&&n&&"today",a&&o&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},aY,l)},UE=({theme:t})=>S({},t.typography.caption,{width:fh,height:fh,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${nl.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${nl.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${nl.disabled}:not(.${nl.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${nl.disabled}&.${nl.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Kg}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${nl.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),GE=(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableMargin&&e.dayWithMargin,!r.disableHighlightToday&&r.today&&e.today,!r.outsideCurrentMonth&&r.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,r.outsideCurrentMonth&&!r.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},cY=K(Cs,{name:"MuiPickersDay",slot:"Root",overridesResolver:GE})(UE),uY=K("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:GE})(({theme:t})=>S({},UE({theme:t}),{opacity:0,pointerEvents:"none"})),Zu=()=>{},dY=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersDay"}),{autoFocus:n=!1,className:s,day:a,disabled:o=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDaySelect:h,onFocus:p=Zu,onBlur:f=Zu,onKeyDown:m=Zu,onMouseDown:y=Zu,onMouseEnter:v=Zu,outsideCurrentMonth:g,selected:b=!1,showDaysOutsideCurrentMonth:k=!1,children:C,today:x=!1}=i,_=oe(i,oY),P=S({},i,{autoFocus:n,disabled:o,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:k,today:x}),R=lY(P),E=qt(),D=w.useRef(null),$=Wt(D,r);zr(()=>{n&&!o&&!u&&!g&&D.current.focus()},[n,o,u,g]);const I=M=>{y(M),g&&M.preventDefault()},F=M=>{o||h(a),g&&M.currentTarget.focus(),d&&d(M)};return g&&!k?T.jsx(uY,{className:xe(R.root,R.hiddenDaySpacingFiller,s),ownerState:P,role:_.role}):T.jsx(cY,S({className:xe(R.root,s),ref:$,centerRipple:!0,disabled:o,tabIndex:b?0:-1,onKeyDown:M=>m(M,a),onFocus:M=>p(M,a),onBlur:M=>f(M,a),onMouseEnter:M=>v(M,a),onClick:F,onMouseDown:I},_,{ownerState:P,children:C||E.format(a,"dayOfMonth")}))}),hY=w.memo(dY);function jE(t,e,r,i){const{value:n,onError:s}=t,a=ql(),o=w.useRef(i),l=e({adapter:a,value:n,props:t});return w.useEffect(()=>{s&&!r(l,o.current)&&s(l,n),o.current=l},[r,s,o,l,n]),l}const fY=({utils:t,format:e})=>{let r=10,i=e,n=t.expandFormat(e);for(;n!==i;)if(i=n,n=t.expandFormat(i),r-=1,r<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return n},pY=({utils:t,expandedFormat:e})=>{const r=[],{start:i,end:n}=t.escapedCharacters,s=new RegExp(`(\\${i}[^\\${n}]*\\${n})+`,"g");let a=null;for(;a=s.exec(e);)r.push({start:a.index,end:s.lastIndex-1});return r},mY=(t,e,r,i,n)=>{switch(i.type){case"year":return r.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,e),n).length,format:n});case"month":return r.fieldMonthPlaceholder({contentType:i.contentType,format:n});case"day":return r.fieldDayPlaceholder({format:n});case"weekDay":return r.fieldWeekDayPlaceholder({contentType:i.contentType,format:n});case"hours":return r.fieldHoursPlaceholder({format:n});case"minutes":return r.fieldMinutesPlaceholder({format:n});case"seconds":return r.fieldSecondsPlaceholder({format:n});case"meridiem":return r.fieldMeridiemPlaceholder({format:n});default:return n}},gY=({utils:t,timezone:e,date:r,shouldRespectLeadingZeros:i,localeText:n,localizedDigits:s,now:a,token:o,startSeparator:l})=>{if(o==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const c=OE(t,o),u=WE(t,e,c.contentType,c.type,o),d=i?u:c.contentType==="digit",h=r!=null&&t.isValid(r);let p=h?t.formatByString(r,o):"",f=null;if(d)if(u)f=p===""?t.formatByString(a,o).length:p.length;else{if(c.maxLength==null)throw new Error(`MUI X: The token ${o} should have a 'maxDigitNumber' property on it's adapter`);f=c.maxLength,h&&(p=wS(VE(zl(p,s),f),s))}return S({},c,{format:o,maxLength:f,value:p,placeholder:mY(t,e,n,c,o),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:l,endSeparator:"",modified:!1})},yY=t=>{var p;const{utils:e,expandedFormat:r,escapedParts:i}=t,n=e.date(void 0),s=[];let a="";const o=Object.keys(e.formatTokenMap).sort((f,m)=>m.length-f.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${o.join("|")})*$`),u=new RegExp(`^(${o.join("|")})`),d=f=>i.find(m=>m.start<=f&&m.end>=f);let h=0;for(;h0;){const g=u.exec(v)[1];v=v.slice(g.length),s.push(gY(S({},t,{now:n,token:g,startSeparator:a}))),a=""}h+=y.length}else{const v=r[h];m&&(f==null?void 0:f.start)===h||(f==null?void 0:f.end)===h||(s.length===0?a+=v:s[s.length-1].endSeparator+=v),h+=1}}return s.length===0&&a.length>0&&s.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),s},bY=({isRtl:t,formatDensity:e,sections:r})=>r.map(i=>{const n=s=>{let a=s;return t&&a!==null&&a.includes(" ")&&(a=`⁩${a}⁦`),e==="spacious"&&["/",".","-"].includes(a)&&(a=` ${a} `),a};return i.startSeparator=n(i.startSeparator),i.endSeparator=n(i.endSeparator),i}),vC=t=>{let e=fY(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const r=pY(S({},t,{expandedFormat:e})),i=yY(S({},t,{expandedFormat:e,escapedParts:r}));return bY(S({},t,{sections:i}))},vY=t=>{const e=qt(),r=rn(),i=ql(),n=Xi(),{valueManager:s,fieldValueManager:a,valueType:o,validator:l,internalProps:c,internalProps:{value:u,defaultValue:d,referenceDate:h,onChange:p,format:f,formatDensity:m="dense",selectedSections:y,onSelectedSectionsChange:v,shouldRespectLeadingZeros:g=!1,timezone:b,enableAccessibleFieldDOMStructure:k=!1}}=t,{timezone:C,value:x,handleValueChange:_}=vS({timezone:b,value:u,defaultValue:d,onChange:p,valueManager:s}),P=w.useMemo(()=>k9(e),[e]),R=w.useMemo(()=>P9(e,P,C),[e,P,C]),E=w.useCallback((j,J=null)=>a.getSectionsFromValue(e,j,J,pe=>vC({utils:e,timezone:C,localeText:r,localizedDigits:P,format:f,date:pe,formatDensity:m,shouldRespectLeadingZeros:g,enableAccessibleFieldDOMStructure:k,isRtl:n})),[a,f,r,P,n,g,e,m,C,k]),[D,$]=w.useState(()=>{const j=E(x),J={sections:j,value:x,referenceValue:s.emptyValue,tempValueStrAndroid:null},pe=v9(j),fe=s.getInitialReferenceValue({referenceDate:h,value:x,utils:e,props:c,granularity:pe,timezone:C});return S({},J,{referenceValue:fe})}),[I,F]=xs({controlled:y,default:null,name:"useField",state:"selectedSections"}),M=j=>{F(j),v==null||v(j)},O=w.useMemo(()=>rv(I,D.sections),[I,D.sections]),A=O==="all"?0:O,N=({value:j,referenceValue:J,sections:pe})=>{if($(Me=>S({},Me,{sections:pe,value:j,referenceValue:J,tempValueStrAndroid:null})),s.areValuesEqual(e,D.value,j))return;const fe={validationError:l({adapter:i,value:j,props:S({},c,{value:j,timezone:C})})};_(j,fe)},V=(j,J)=>{const pe=[...D.sections];return pe[j]=S({},pe[j],{value:J,modified:!0}),pe},W=()=>{N({value:s.emptyValue,referenceValue:D.referenceValue,sections:E(s.emptyValue)})},Q=()=>{if(A==null)return;const j=D.sections[A],J=a.getActiveDateManager(e,D,j),fe=J.getSections(D.sections).filter(Ce=>Ce.value!=="").length===(j.value===""?0:1),Me=V(A,""),_e=fe?null:e.getInvalidDate(),ke=J.getNewValuesFromNewActiveDate(_e);N(S({},ke,{sections:Me}))},ne=j=>{const J=(Me,_e)=>{const ke=e.parse(Me,f);if(ke==null||!e.isValid(ke))return null;const Ce=vC({utils:e,timezone:C,localeText:r,localizedDigits:P,format:f,date:ke,formatDensity:m,shouldRespectLeadingZeros:g,enableAccessibleFieldDOMStructure:k,isRtl:n});return yC(e,C,ke,Ce,_e,!1)},pe=a.parseValueStr(j,D.referenceValue,J),fe=a.updateReferenceValue(e,pe,D.referenceValue);N({value:pe,referenceValue:fe,sections:E(pe,D.sections)})},ie=({activeSection:j,newSectionValue:J,shouldGoToNextSection:pe})=>{pe&&AS({},ee,Ce,{sections:Me,tempValueStrAndroid:null}))},te=j=>$(J=>S({},J,{tempValueStrAndroid:j}));return w.useEffect(()=>{const j=E(D.value);$(J=>S({},J,{sections:j}))},[f,e.locale,n]),w.useEffect(()=>{let j;s.areValuesEqual(e,D.value,x)?j=s.getTimezone(e,D.value)!==s.getTimezone(e,x):j=!0,j&&$(J=>S({},J,{value:x,referenceValue:a.updateReferenceValue(e,x,J.referenceValue),sections:E(x)}))},[x]),{state:D,activeSectionIndex:A,parsedSelectedSections:O,setSelectedSections:M,clearValue:W,clearActiveSection:Q,updateSectionValue:ie,updateValueFromValueStr:ne,setTempAndroidValueStr:te,getSectionsFromValue:E,sectionsValueBoundaries:R,localizedDigits:P,timezone:C}},wY=5e3,lc=t=>t.saveQuery!=null,SY=({sections:t,updateSectionValue:e,sectionsValueBoundaries:r,localizedDigits:i,setTempAndroidValueStr:n,timezone:s})=>{const a=qt(),[o,l]=w.useState(null),c=Ye(()=>l(null));w.useEffect(()=>{var f;o!=null&&((f=t[o.sectionIndex])==null?void 0:f.type)!==o.sectionType&&c()},[t,o,c]),w.useEffect(()=>{if(o!=null){const f=setTimeout(()=>c(),wY);return()=>{clearTimeout(f)}}return()=>{}},[o,c]);const u=({keyPressed:f,sectionIndex:m},y,v)=>{const g=f.toLowerCase(),b=t[m];if(o!=null&&(!v||v(o.value))&&o.sectionIndex===m){const C=`${o.value}${g}`,x=y(C,b);if(!lc(x))return l({sectionIndex:m,value:C,sectionType:b.type}),x}const k=y(g,b);return lc(k)&&!k.saveQuery?(c(),null):(l({sectionIndex:m,value:g,sectionType:b.type}),lc(k)?null:k)},d=f=>{const m=(g,b,k)=>{const C=b.filter(x=>x.toLowerCase().startsWith(k));return C.length===0?{saveQuery:!1}:{sectionValue:C[0],shouldGoToNextSection:C.length===1}},y=(g,b,k,C)=>{const x=_=>AE(a,s,b.type,_);if(b.contentType==="letter")return m(b.format,x(b.format),g);if(k&&C!=null&&OE(a,k).contentType==="letter"){const _=x(k),P=m(k,_,g);return lc(P)?{saveQuery:!1}:S({},P,{sectionValue:C(P.sectionValue,_)})}return{saveQuery:!1}};return u(f,(g,b)=>{switch(b.type){case"month":{const k=C=>mC(a,C,a.formats.month,b.format);return y(g,b,a.formats.month,k)}case"weekDay":{const k=(C,x)=>x.indexOf(C).toString();return y(g,b,a.formats.weekday,k)}case"meridiem":return y(g,b);default:return{saveQuery:!1}}})},h=f=>{const m=(v,g)=>{const b=zl(v,i),k=Number(b),C=r[g.type]({currentDate:null,format:g.format,contentType:g.contentType});if(k>C.maximum)return{saveQuery:!1};if(kC.maximum||b.length===C.maximum.toString().length;return{sectionValue:$E(a,k,C,i,g),shouldGoToNextSection:x}};return u(f,(v,g)=>{if(g.contentType==="digit"||g.contentType==="digit-with-letter")return m(v,g);if(g.type==="month"){const b=WE(a,s,"digit","month","MM"),k=m(v,{type:g.type,format:"MM",hasLeadingZerosInFormat:b,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(lc(k))return k;const C=mC(a,k.sectionValue,"MM",g.format);return S({},k,{sectionValue:C})}if(g.type==="weekDay"){const b=m(v,g);if(lc(b))return b;const k=Zg(a,s,g.format)[Number(b.sectionValue)-1];return S({},b,{sectionValue:k})}return{saveQuery:!1}},v=>pC(v,i))};return{applyCharacterEditing:Ye(f=>{const m=t[f.sectionIndex],v=pC(f.keyPressed,i)?h(S({},f,{keyPressed:wS(f.keyPressed,i)})):d(f);if(v==null){n(null);return}e({activeSection:m,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function mc(t,e){return Array.isArray(e)?e.every(r=>t.indexOf(r)!==-1):t.indexOf(e)!==-1}const xY=(t,e)=>r=>{(r.key==="Enter"||r.key===" ")&&(t(r),r.preventDefault(),r.stopPropagation()),e&&e(r)},ps=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?ps(e.shadowRoot):e:null},YE="@media (pointer: fine)",kY=t=>{const{internalProps:{disabled:e,readOnly:r=!1},forwardedProps:{sectionListRef:i,onBlur:n,onClick:s,onFocus:a,onInput:o,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:d,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:f,parsedSelectedSections:m,state:y,clearActiveSection:v,clearValue:g,updateSectionValue:b,updateValueFromValueStr:k,sectionOrder:C,areAllSectionsEmpty:x,sectionsValueBoundaries:_}=t,P=w.useRef(null),R=Wt(i,P),E=rn(),D=qt(),$=ia(),[I,F]=w.useState(!1),M=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!P.current)return;const X=document.getSelection();if(!X)return;if(m==null){X.rangeCount>0&&P.current.getRoot().contains(X.getRangeAt(0).startContainer)&&X.removeAllRanges(),I&&P.current.getRoot().blur();return}if(!P.current.getRoot().contains(ps(document)))return;const ee=new window.Range;let Y;m==="all"?Y=P.current.getRoot():y.sections[m].type==="empty"?Y=P.current.getSectionContainer(m):Y=P.current.getSectionContent(m),ee.selectNodeContents(Y),Y.focus(),X.removeAllRanges(),X.addRange(ee)},getActiveSectionIndexFromDOM:()=>{const X=ps(document);return!X||!P.current||!P.current.getRoot().contains(X)?null:P.current.getSectionIndexFromDOMElement(X)},focusField:(X=0)=>{if(!P.current)return;const ee=rv(X,y.sections);F(!0),P.current.getSectionContent(ee).focus()},setSelectedSections:X=>{if(!P.current)return;const ee=rv(X,y.sections);F((ee==="all"?0:ee)!==null),f(X)},isFieldFocused:()=>{const X=ps(document);return!!P.current&&P.current.getRoot().contains(X)}}),[m,f,y.sections,I]),O=Ye(X=>{if(!P.current)return;const ee=y.sections[X];P.current.getSectionContent(X).innerHTML=ee.value||ee.placeholder,M.syncSelectionToDOM()}),A=Ye((X,...ee)=>{X.isDefaultPrevented()||!P.current||(F(!0),s==null||s(X,...ee),m==="all"?setTimeout(()=>{const Y=document.getSelection().getRangeAt(0).startOffset;if(Y===0){f(C.startIndex);return}let Be=0,ce=0;for(;ce{if(o==null||o(X),!P.current||m!=="all")return;const Y=X.target.textContent??"";P.current.getRoot().innerHTML=y.sections.map(Be=>`${Be.startSeparator}${Be.value||Be.placeholder}${Be.endSeparator}`).join(""),M.syncSelectionToDOM(),Y.length===0||Y.charCodeAt(0)===10?(p(),g(),f("all")):Y.length>1?k(Y):h({keyPressed:Y,sectionIndex:0})}),V=Ye(X=>{if(l==null||l(X),r||m!=="all"){X.preventDefault();return}const ee=X.clipboardData.getData("text");X.preventDefault(),p(),k(ee)}),W=Ye((...X)=>{if(a==null||a(...X),I||!P.current)return;F(!0),P.current.getSectionIndexFromDOMElement(ps(document))!=null||f(C.startIndex)}),Q=Ye((...X)=>{n==null||n(...X),setTimeout(()=>{if(!P.current)return;const ee=ps(document);!P.current.getRoot().contains(ee)&&(F(!1),f(null))})}),ne=Ye(X=>ee=>{ee.isDefaultPrevented()||r||f(X)}),ie=Ye(X=>{X.preventDefault()}),te=Ye(X=>()=>{r||f(X)}),j=Ye(X=>{if(X.preventDefault(),r||typeof m!="number")return;const ee=y.sections[m],Y=X.clipboardData.getData("text"),Be=/^[a-zA-Z]+$/.test(Y),ce=/^[0-9]+$/.test(Y),L=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Y);ee.contentType==="letter"&&Be||ee.contentType==="digit"&&ce||ee.contentType==="digit-with-letter"&&L?(p(),b({activeSection:ee,newSectionValue:Y,shouldGoToNextSection:!0})):!Be&&!ce&&(p(),k(Y))}),J=Ye(X=>{X.preventDefault(),X.dataTransfer.dropEffect="none"}),pe=Ye(X=>{if(!P.current)return;const ee=X.target,Y=ee.textContent??"",Be=P.current.getSectionIndexFromDOMElement(ee),ce=y.sections[Be];if(r||!P.current){O(Be);return}if(Y.length===0){if(ce.value===""){O(Be);return}const L=X.nativeEvent.inputType;if(L==="insertParagraph"||L==="insertLineBreak"){O(Be);return}p(),v();return}h({keyPressed:Y,sectionIndex:Be}),O(Be)});zr(()=>{if(!(!I||!P.current)){if(m==="all")P.current.getRoot().focus();else if(typeof m=="number"){const X=P.current.getSectionContent(m);X&&X.focus()}}},[m,I]);const fe=w.useMemo(()=>y.sections.reduce((X,ee)=>(X[ee.type]=_[ee.type]({currentDate:null,contentType:ee.contentType,format:ee.format}),X),{}),[_,y.sections]),Me=m==="all",_e=w.useMemo(()=>y.sections.map((X,ee)=>{const Y=!Me&&!e&&!r;return{container:{"data-sectionindex":ee,onClick:ne(ee)},content:{tabIndex:Me||ee>0?-1:0,contentEditable:!Me&&!e&&!r,role:"spinbutton",id:`${$}-${X.type}`,"aria-labelledby":`${$}-${X.type}`,"aria-readonly":r,"aria-valuenow":D9(X,D),"aria-valuemin":fe[X.type].minimum,"aria-valuemax":fe[X.type].maximum,"aria-valuetext":X.value?M9(X,D):E.empty,"aria-label":E[X.type],"aria-disabled":e,spellCheck:Y?!1:void 0,autoCapitalize:Y?"off":void 0,autoCorrect:Y?"off":void 0,[parseInt(w.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Y?"next":void 0,children:X.value||X.placeholder,onInput:pe,onPaste:j,onFocus:te(ee),onDragOver:J,onMouseUp:ie,inputMode:X.contentType==="letter"?"text":"numeric"},before:{children:X.startSeparator},after:{children:X.endSeparator}}}),[y.sections,te,j,J,pe,ne,ie,e,r,Me,E,D,fe,$]),ke=Ye(X=>{k(X.target.value)}),Ce=w.useMemo(()=>x?"":d.getV7HiddenInputValueFromSections(y.sections),[x,y.sections,d]);return w.useEffect(()=>{if(P.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` -`));u&&P.current&&P.current.getSectionContent(C.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:r,focused:c??I,sectionListRef:R,onBlur:Q,onClick:A,onFocus:W,onInput:N,onPaste:V,enableAccessibleFieldDOMStructure:!0,elements:_e,tabIndex:m===0?-1:0,contentEditable:Me,value:Ce,onChange:ke,areAllSectionsEmpty:x}}},Ec=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),CY=(t,e,r)=>{let i=0,n=r?1:0;const s=[];for(let a=0;a{const e=Xi(),r=w.useRef(),{forwardedProps:{onFocus:i,onClick:n,onPaste:s,onBlur:a,inputRef:o,placeholder:l},internalProps:{readOnly:c=!1},parsedSelectedSections:u,activeSectionIndex:d,state:h,fieldValueManager:p,valueManager:f,applyCharacterEditing:m,resetCharacterQuery:y,updateSectionValue:v,updateValueFromValueStr:g,clearActiveSection:b,clearValue:k,setTempAndroidValueStr:C,setSelectedSections:x,getSectionsFromValue:_,areAllSectionsEmpty:P,localizedDigits:R}=t,E=w.useRef(null),D=Wt(o,E),$=w.useMemo(()=>CY(h.sections,R,e),[h.sections,R,e]),I=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!E.current)return;if(u==null){E.current.scrollLeft&&(E.current.scrollLeft=0);return}if(E.current!==ps(document))return;const j=E.current.scrollTop;if(u==="all")E.current.select();else{const J=$[u],pe=J.type==="empty"?J.startInInput-J.startSeparator.length:J.startInInput,fe=J.type==="empty"?J.endInInput+J.endSeparator.length:J.endInInput;(pe!==E.current.selectionStart||fe!==E.current.selectionEnd)&&E.current===ps(document)&&E.current.setSelectionRange(pe,fe)}E.current.scrollTop=j},getActiveSectionIndexFromDOM:()=>{var Me;const j=E.current.selectionStart??0,J=E.current.selectionEnd??0,pe=!!((Me=E.current)!=null&&Me.readOnly);if(j===0&&J===0||pe)return null;const fe=j<=$[0].startInInput?1:$.findIndex(_e=>_e.startInInput-_e.startSeparator.length>j);return fe===-1?$.length-1:fe-1},focusField:(j=0)=>{var J;(J=E.current)==null||J.focus(),x(j)},setSelectedSections:j=>x(j),isFieldFocused:()=>E.current===ps(document)}),[E,u,$,x]),F=()=>{if(c){x(null);return}const j=E.current.selectionStart??0;let J;j<=$[0].startInInput||j>=$[$.length-1].endInInput?J=1:J=$.findIndex(fe=>fe.startInInput-fe.startSeparator.length>j);const pe=J===-1?$.length-1:J-1;x(pe)},M=Ye((...j)=>{i==null||i(...j);const J=E.current;clearTimeout(r.current),r.current=setTimeout(()=>{!J||J!==E.current||d!=null||c||(J.value.length&&Number(J.selectionEnd)-Number(J.selectionStart)===J.value.length?x("all"):F())})}),O=Ye((j,...J)=>{j.isDefaultPrevented()||(n==null||n(j,...J),F())}),A=Ye(j=>{if(s==null||s(j),j.preventDefault(),c)return;const J=j.clipboardData.getData("text");if(typeof u=="number"){const pe=h.sections[u],fe=/^[a-zA-Z]+$/.test(J),Me=/^[0-9]+$/.test(J),_e=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(J);if(pe.contentType==="letter"&&fe||pe.contentType==="digit"&&Me||pe.contentType==="digit-with-letter"&&_e){y(),v({activeSection:pe,newSectionValue:J,shouldGoToNextSection:!0});return}if(fe||Me)return}y(),g(J)}),N=Ye((...j)=>{a==null||a(...j),x(null)}),V=Ye(j=>{if(c)return;const J=j.target.value;if(J===""){y(),k();return}const pe=j.nativeEvent.data,fe=pe&&pe.length>1,Me=fe?pe:J,_e=Ec(Me);if(d==null||fe){g(fe?pe:_e);return}let ke;if(u==="all"&&_e.length===1)ke=_e;else{const Ce=Ec(p.getV6InputValueFromSections($,R,e));let X=-1,ee=-1;for(let L=0;LY.end)return;const ce=_e.length-Ce.length+Y.end-Ec(Y.endSeparator||"").length;ke=_e.slice(Y.start+Ec(Y.startSeparator||"").length,ce)}if(ke.length===0){E9()?C(Me):(y(),b());return}m({keyPressed:ke,sectionIndex:d})}),W=w.useMemo(()=>l!==void 0?l:p.getV6InputValueFromSections(_(f.emptyValue),R,e),[l,p,_,f.emptyValue,R,e]),Q=w.useMemo(()=>h.tempValueStrAndroid??p.getV6InputValueFromSections(h.sections,R,e),[h.sections,p,h.tempValueStrAndroid,R,e]);w.useEffect(()=>(E.current&&E.current===ps(document)&&x("all"),()=>{clearTimeout(r.current)}),[]);const ne=w.useMemo(()=>d==null||h.sections[d].contentType==="letter"?"text":"numeric",[d,h.sections]),te=!(E.current&&E.current===ps(document))&&P;return{interactions:I,returnedValue:{readOnly:c,onBlur:N,onClick:O,onFocus:M,onPaste:A,inputRef:D,enableAccessibleFieldDOMStructure:!1,placeholder:W,inputMode:ne,autoComplete:"off",value:te?"":Q,onChange:V}}},XE=t=>{const e=qt(),{internalProps:r,internalProps:{unstableFieldRef:i,minutesStep:n,enableAccessibleFieldDOMStructure:s=!1,disabled:a=!1,readOnly:o=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:d},fieldValueManager:h,valueManager:p,validator:f}=t,m=Xi(),y=vY(t),{state:v,activeSectionIndex:g,parsedSelectedSections:b,setSelectedSections:k,clearValue:C,clearActiveSection:x,updateSectionValue:_,setTempAndroidValueStr:P,sectionsValueBoundaries:R,localizedDigits:E,timezone:D}=y,$=SY({sections:v.sections,updateSectionValue:_,sectionsValueBoundaries:R,localizedDigits:E,setTempAndroidValueStr:P,timezone:D}),{resetCharacterQuery:I}=$,F=p.areValuesEqual(e,v.value,p.emptyValue),M=s?kY:TY,O=w.useMemo(()=>R9(v.sections,m&&!s),[v.sections,m,s]),{returnedValue:A,interactions:N}=M(S({},t,y,$,{areAllSectionsEmpty:F,sectionOrder:O})),V=Ye(j=>{switch(l==null||l(j),!0){case((j.ctrlKey||j.metaKey)&&j.key.toLowerCase()==="a"&&!j.shiftKey&&!j.altKey):{j.preventDefault(),k("all");break}case j.key==="ArrowRight":{if(j.preventDefault(),b==null)k(O.startIndex);else if(b==="all")k(O.endIndex);else{const J=O.neighbors[b].rightIndex;J!==null&&k(J)}break}case j.key==="ArrowLeft":{if(j.preventDefault(),b==null)k(O.endIndex);else if(b==="all")k(O.startIndex);else{const J=O.neighbors[b].leftIndex;J!==null&&k(J)}break}case j.key==="Delete":{if(j.preventDefault(),o)break;b==null||b==="all"?C():x(),I();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(j.key):{if(j.preventDefault(),o||g==null)break;const J=v.sections[g],pe=h.getActiveDateManager(e,v,J),fe=C9(e,D,J,j.key,R,E,pe.date,{minutesStep:n});_({activeSection:J,newSectionValue:fe,shouldGoToNextSection:!1});break}}});zr(()=>{N.syncSelectionToDOM()});const W=jE(S({},r,{value:v.value,timezone:D}),f,p.isSameError,p.defaultErrorState),Q=w.useMemo(()=>c!==void 0?c:p.hasError(W),[p,W,c]);w.useEffect(()=>{!Q&&g==null&&I()},[v.referenceValue,g,Q]),w.useEffect(()=>{v.tempValueStrAndroid!=null&&g!=null&&(I(),x())},[v.sections]),w.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:N.getActiveSectionIndexFromDOM,setSelectedSections:N.setSelectedSections,focusField:N.focusField,isFieldFocused:N.isFieldFocused}));const ne=Ye((j,...J)=>{j.preventDefault(),d==null||d(j,...J),C(),N.isFieldFocused()?k(O.startIndex):N.focusField(0)}),ie={onKeyDown:V,onClear:ne,error:Q,clearable:!!(u&&!F&&!o&&!a)},te={disabled:a,readOnly:o};return S({},t.forwardedProps,ie,te,A)},ey=({props:t,value:e,adapter:r})=>{if(e===null)return null;const{shouldDisableDate:i,shouldDisableMonth:n,shouldDisableYear:s,disablePast:a,disableFuture:o,timezone:l}=t,c=r.utils.date(void 0,l),u=Bs(r.utils,t.minDate,r.defaultDates.minDate),d=Bs(r.utils,t.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(e):return"invalidDate";case!!(i&&i(e)):return"shouldDisableDate";case!!(n&&n(e)):return"shouldDisableMonth";case!!(s&&s(e)):return"shouldDisableYear";case!!(o&&r.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(e,u)):return"minDate";case!!(d&&r.utils.isAfterDay(e,d)):return"maxDate";default:return null}},iv=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],nv=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],qE=["minDateTime","maxDateTime"],_Y=[...iv,...nv,...qE],ty=t=>_Y.reduce((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{}),BY=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],KE=(t,e)=>{const r=S({},t),i={},n=s=>{r.hasOwnProperty(s)&&(i[s]=r[s],delete r[s])};return BY.forEach(n),e==="date"?iv.forEach(n):e==="time"?nv.forEach(n):e==="date-time"&&(iv.forEach(n),nv.forEach(n),qE.forEach(n)),{forwardedProps:r,internalProps:i}},PY=t=>{const e=qt(),r=Yh();return S({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??e.formats.keyboardDate,minDate:Bs(e,t.minDate,r.minDate),maxDate:Bs(e,t.maxDate,r.maxDate)})},NY=t=>{const e=qt(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.fullTime12h:e.formats.fullTime24h;return S({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i})},EY=t=>{const e=PY(t),{forwardedProps:r,internalProps:i}=KE(e,"date");return XE({forwardedProps:r,internalProps:i,valueManager:en,fieldValueManager:HE,validator:ey,valueType:"date"})},RY=["clearable","onClear","InputProps","sx","slots","slotProps"],MY=["ownerState"],QE=t=>{const e=rn(),{clearable:r,onClear:i,InputProps:n,sx:s,slots:a,slotProps:o}=t,l=oe(t,RY),c=(a==null?void 0:a.clearButton)??yn,u=Ct({elementType:c,externalSlotProps:o==null?void 0:o.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),d=oe(u,MY),h=(a==null?void 0:a.clearIcon)??Bj,p=Ct({elementType:h,externalSlotProps:o==null?void 0:o.clearIcon,ownerState:{}});return S({},l,{InputProps:S({},n,{endAdornment:T.jsxs(w.Fragment,{children:[r&&T.jsx(YN,{position:"end",sx:{marginRight:n!=null&&n.endAdornment?-1:-1.5},children:T.jsx(c,S({},d,{onClick:i,children:T.jsx(h,S({fontSize:"small"},p))}))}),n==null?void 0:n.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(s)?s:[s]]})};function DY(t){return He("MuiPickersTextField",t)}Ue("MuiPickersTextField",["root","focused","disabled","error","required"]);function LY(t){return He("MuiPickersInputBase",t)}const Wc=Ue("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function FY(t){return He("MuiPickersSectionList",t)}const ed=Ue("MuiPickersSectionList",["root","section","sectionContent"]),IY=["slots","slotProps","elements","sectionListRef"],JE=K("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),ZE=K("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),eR=K("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),tR=K("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),OY=t=>{const{classes:e}=t;return $e({root:["root"],section:["section"],sectionContent:["sectionContent"]},FY,e)};function AY(t){const{slots:e,slotProps:r,element:i,classes:n}=t,s=(e==null?void 0:e.section)??ZE,a=Ct({elementType:s,externalSlotProps:r==null?void 0:r.section,externalForwardedProps:i.container,className:n.section,ownerState:{}}),o=(e==null?void 0:e.sectionContent)??tR,l=Ct({elementType:o,externalSlotProps:r==null?void 0:r.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:n.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??eR,u=Ct({elementType:c,externalSlotProps:r==null?void 0:r.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),d=Ct({elementType:c,externalSlotProps:r==null?void 0:r.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return T.jsxs(s,S({},a,{children:[T.jsx(c,S({},u)),T.jsx(o,S({},l)),T.jsx(c,S({},d))]}))}const VY=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersSectionList"}),{slots:n,slotProps:s,elements:a,sectionListRef:o}=i,l=oe(i,IY),c=OY(i),u=w.useRef(null),d=Wt(r,u),h=m=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${m} before the mount of the component.`);return u.current};w.useImperativeHandle(o,()=>({getRoot(){return h("getRoot")},getSectionContainer(m){return h("getSectionContainer").querySelector(`.${ed.section}[data-sectionindex="${m}"]`)},getSectionContent(m){return h("getSectionContent").querySelector(`.${ed.section}[data-sectionindex="${m}"] .${ed.sectionContent}`)},getSectionIndexFromDOMElement(m){const y=h("getSectionIndexFromDOMElement");if(m==null||!y.contains(m))return null;let v=null;return m.classList.contains(ed.section)?v=m:m.classList.contains(ed.sectionContent)&&(v=m.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const p=(n==null?void 0:n.root)??JE,f=Ct({elementType:p,externalSlotProps:s==null?void 0:s.root,externalForwardedProps:l,additionalProps:{ref:d,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return T.jsx(p,S({},f,{children:f.contentEditable?a.map(({content:m,before:y,after:v})=>`${y.children}${m.children}${v.children}`).join(""):T.jsx(w.Fragment,{children:a.map((m,y)=>T.jsx(AY,{slots:n,slotProps:s,element:m,classes:c},y))})}))}),$Y=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],zY=t=>Math.round(t*1e5)/1e5,ry=K("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>S({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${zY(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),kS=K(JE,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:r,filled:i,label:n})=>!e&&!r&&!i&&n==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),WY=K(ZE,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),HY=K(tR,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),UY=K(eR,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),GY=K("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(S({},Lw)),jY=t=>{const{focused:e,disabled:r,error:i,classes:n,fullWidth:s,readOnly:a,color:o,size:l,endAdornment:c,startAdornment:u}=t,d={root:["root",e&&!r&&"focused",r&&"disabled",a&&"readOnly",i&&"error",s&&"fullWidth",`color${Pe(o)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return $e(d,LY,n)},CS=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersInputBase"}),{elements:n,areAllSectionsEmpty:s,value:a,onChange:o,id:l,endAdornment:c,startAdornment:u,renderSuffix:d,slots:h,slotProps:p,contentEditable:f,tabIndex:m,onInput:y,onPaste:v,onKeyDown:g,name:b,readOnly:k,inputProps:C,inputRef:x,sectionListRef:_}=i,P=oe(i,$Y),R=w.useRef(null),E=Wt(r,R),D=Wt(C==null?void 0:C.ref,x),$=Xi(),I=In();if(!I)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const F=W=>{var Q;if(I.disabled){W.stopPropagation();return}(Q=I.onFocus)==null||Q.call(I,W)};w.useEffect(()=>{I&&I.setAdornedStart(!!u)},[I,u]),w.useEffect(()=>{I&&(s?I.onEmpty():I.onFilled())},[I,s]);const M=S({},i,I,{isRtl:$}),O=jY(M),A=(h==null?void 0:h.root)||ry,N=Ct({elementType:A,externalSlotProps:p==null?void 0:p.root,externalForwardedProps:P,additionalProps:{"aria-invalid":I.error,ref:E},className:O.root,ownerState:M}),V=(h==null?void 0:h.input)||kS;return T.jsxs(A,S({},N,{children:[u,T.jsx(VY,{sectionListRef:_,elements:n,contentEditable:f,tabIndex:m,className:O.sectionsContainer,onFocus:F,onBlur:I.onBlur,onInput:y,onPaste:v,onKeyDown:g,slots:{root:V,section:WY,sectionContent:HY,sectionSeparator:UY},slotProps:{root:{ownerState:M},sectionContent:{className:Wc.sectionContent},sectionSeparator:({position:W})=>({className:W==="before"?Wc.sectionBefore:Wc.sectionAfter})}}),c,d?d(S({},I)):null,T.jsx(GY,S({name:b,className:O.input,value:a,onChange:o,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:k,required:I.required,disabled:I.disabled},C,{ref:D}))]}))});function YY(t){return He("MuiPickersOutlinedInput",t)}const Ls=S({},Wc,Ue("MuiPickersOutlinedInput",["root","notchedOutline","input"])),XY=["children","className","label","notched","shrink"],qY=K("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{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%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),wC=K("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),KY=K("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{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"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function QY(t){const{className:e,label:r}=t,i=oe(t,XY),n=r!=null&&r!=="",s=S({},t,{withLabel:n});return T.jsx(qY,S({"aria-hidden":!0,className:e},i,{ownerState:s,children:T.jsx(KY,{ownerState:s,children:n?T.jsx(wC,{children:r}):T.jsx(wC,{className:"notranslate",children:"​"})})}))}const JY=["label","autoFocus","ownerState","notched"],ZY=K(ry,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ls.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Ls.focused} .${Ls.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Ls.disabled}`]:{[`& .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Ls.error} .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(r=>{var i;return((i=(t.vars??t).palette[r])==null?void 0:i.main)??!1}).map(r=>({props:{color:r},style:{[`&.${Ls.focused}:not(.${Ls.error}) .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}))}}),eX=K(kS,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),tX=t=>{const{classes:e}=t,i=$e({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},YY,e);return S({},e,i)},rR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersOutlinedInput"}),{label:n,ownerState:s,notched:a}=i,o=oe(i,JY),l=In(),c=S({},i,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=tX(c);return T.jsx(CS,S({slots:{root:ZY,input:eX},renderSuffix:d=>T.jsx(QY,{shrink:!!(a||d.adornedStart||d.focused||d.filled),notched:!!(a||d.adornedStart||d.focused||d.filled),className:u.notchedOutline,label:n!=null&&n!==""&&(l!=null&&l.required)?T.jsxs(w.Fragment,{children:[n," ","*"]}):n,ownerState:c})},o,{label:n,classes:u,ref:r}))});rR.muiName="Input";function rX(t){return He("MuiPickersFilledInput",t)}const sl=S({},Wc,Ue("MuiPickersFilledInput",["root","underline","input"])),iX=["label","autoFocus","disableUnderline","ownerState"],nX=K(ry,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>dp(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",r=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",n=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:n,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},[`&.${sl.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},[`&.${sl.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s},variants:[...Object.keys((t.vars??t).palette).filter(a=>(t.vars??t).palette[a].main).map(a=>{var o;return{props:{color:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(o=(t.vars||t).palette[a])==null?void 0:o.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${sl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${sl.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${sl.disabled}, .${sl.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${sl.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:a})=>!!a,style:{paddingLeft:12}},{props:({endAdornment:a})=>!!a,style:{paddingRight:12}}]}}),sX=K(kS,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),aX=t=>{const{classes:e,disableUnderline:r}=t,n=$e({root:["root",!r&&"underline"],input:["input"]},rX,e);return S({},e,n)},iR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersFilledInput"}),{label:n,disableUnderline:s=!1,ownerState:a}=i,o=oe(i,iX),l=In(),c=S({},i,a,l,{color:(l==null?void 0:l.color)||"primary"}),u=aX(c);return T.jsx(CS,S({slots:{root:nX,input:sX},slotProps:{root:{disableUnderline:s}}},o,{label:n,classes:u,ref:r}))});iR.muiName="Input";function oX(t){return He("MuiPickersFilledInput",t)}const td=S({},Wc,Ue("MuiPickersInput",["root","input"])),lX=["label","autoFocus","disableUnderline","ownerState"],cX=K(ry,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(i=>(t.vars??t).palette[i].main).map(i=>({props:{color:i},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[i].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${td.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${td.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${td.disabled}, .${td.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${td.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),uX=t=>{const{classes:e,disableUnderline:r}=t,n=$e({root:["root",!r&&"underline"],input:["input"]},oX,e);return S({},e,n)},nR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersInput"}),{label:n,disableUnderline:s=!1,ownerState:a}=i,o=oe(i,lX),l=In(),c=S({},i,a,l,{disableUnderline:s,color:(l==null?void 0:l.color)||"primary"}),u=uX(c);return T.jsx(CS,S({slots:{root:cX}},o,{label:n,classes:u,ref:r}))});nR.muiName="Input";const dX=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],hX={standard:nR,filled:iR,outlined:rR},fX=K(WN,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),pX=t=>{const{focused:e,disabled:r,classes:i,required:n}=t;return $e({root:["root",e&&!r&&"focused",r&&"disabled",n&&"required"]},DY,i)},sR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersTextField"}),{onFocus:n,onBlur:s,className:a,color:o="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:d=!1,InputProps:h,inputProps:p,inputRef:f,sectionListRef:m,elements:y,areAllSectionsEmpty:v,onClick:g,onKeyDown:b,onPaste:k,onInput:C,endAdornment:x,startAdornment:_,tabIndex:P,contentEditable:R,focused:E,value:D,onChange:$,fullWidth:I,id:F,name:M,helperText:O,FormHelperTextProps:A,label:N,InputLabelProps:V}=i,W=oe(i,dX),Q=w.useRef(null),ne=Wt(r,Q),ie=ia(F),te=O&&ie?`${ie}-helper-text`:void 0,j=N&&ie?`${ie}-label`:void 0,J=S({},i,{color:o,disabled:l,error:c,focused:E,required:d,variant:u}),pe=pX(J),fe=hX[u];return T.jsxs(fX,S({className:xe(pe.root,a),ref:ne,focused:E,onFocus:n,onBlur:s,disabled:l,variant:u,error:c,color:o,fullWidth:I,required:d,ownerState:J},W,{children:[T.jsx(XN,S({htmlFor:ie,id:j},V,{children:N})),T.jsx(fe,S({elements:y,areAllSectionsEmpty:v,onClick:g,onKeyDown:b,onInput:C,onPaste:k,endAdornment:x,startAdornment:_,tabIndex:P,contentEditable:R,value:D,onChange:$,id:ie,fullWidth:I,inputProps:p,inputRef:f,sectionListRef:m,label:N,name:M,role:"group","aria-labelledby":j},h)),O&&T.jsx(HN,S({id:te},A,{children:O}))]}))}),mX=["enableAccessibleFieldDOMStructure"],gX=["InputProps","readOnly"],yX=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],aR=t=>{let{enableAccessibleFieldDOMStructure:e}=t,r=oe(t,mX);if(e){const{InputProps:d,readOnly:h}=r,p=oe(r,gX);return S({},p,{InputProps:S({},d??{},{readOnly:h})})}const{onPaste:i,onKeyDown:n,inputMode:s,readOnly:a,InputProps:o,inputProps:l,inputRef:c}=r,u=oe(r,yX);return S({},u,{InputProps:S({},o??{},{readOnly:a}),inputProps:S({},l??{},{inputMode:s,onPaste:i,onKeyDown:n,ref:c})})},bX=["slots","slotProps","InputProps","inputProps"],oR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDateField"}),{slots:n,slotProps:s,InputProps:a,inputProps:o}=i,l=oe(i,bX),c=i,u=(n==null?void 0:n.textField)??(e.enableAccessibleFieldDOMStructure?sR:im),d=Ct({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,additionalProps:{ref:r},ownerState:c});d.inputProps=S({},o,d.inputProps),d.InputProps=S({},a,d.InputProps);const h=EY(d),p=aR(h),f=QE(S({},p,{slots:n,slotProps:s}));return T.jsx(u,S({},f))}),TS=({adapter:t,value:e,props:r})=>{if(e===null)return null;const{minTime:i,maxTime:n,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:o=!1,disablePast:l,disableFuture:c,timezone:u}=r,d=t.utils.date(void 0,u),h=Xh(o,t.utils);switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&h(i,e)):return"minTime";case!!(n&&h(e,n)):return"maxTime";case!!(c&&t.utils.isAfter(e,d)):return"disableFuture";case!!(l&&t.utils.isBefore(e,d)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(s&&t.utils.getMinutes(e)%s!==0):return"minutesStep";default:return null}},vX=t=>{const e=NY(t),{forwardedProps:r,internalProps:i}=KE(e,"time");return XE({forwardedProps:r,internalProps:i,valueManager:en,fieldValueManager:HE,validator:TS,valueType:"time"})},wX=["slots","slotProps","InputProps","inputProps"],lR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTimeField"}),{slots:n,slotProps:s,InputProps:a,inputProps:o}=i,l=oe(i,wX),c=i,u=(n==null?void 0:n.textField)??(e.enableAccessibleFieldDOMStructure?sR:im),d=Ct({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:r}});d.inputProps=S({},o,d.inputProps),d.InputProps=S({},a,d.InputProps);const h=vX(d),p=aR(h),f=QE(S({},p,{slots:n,slotProps:s}));return T.jsx(u,S({},f))}),cR=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:r,minDate:i,maxDate:n,disableFuture:s,disablePast:a,timezone:o})=>{const l=ql();return w.useCallback(c=>ey({adapter:l,value:c,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:r,minDate:i,maxDate:n,disableFuture:s,disablePast:a,timezone:o}})!==null,[l,t,e,r,i,n,s,a,o])},SX=(t,e,r)=>(i,n)=>{switch(n.type){case"changeMonth":return S({},i,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return S({},i,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(i.focusedDay!=null&&n.focusedDay!=null&&r.isSameDay(n.focusedDay,i.focusedDay))return i;const s=n.focusedDay!=null&&!e&&!r.isSameMonth(i.currentMonth,n.focusedDay);return S({},i,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:s&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:s?r.startOfMonth(n.focusedDay):i.currentMonth,slideDirection:n.focusedDay!=null&&r.isAfterDay(n.focusedDay,i.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},xX=t=>{const{value:e,referenceDate:r,disableFuture:i,disablePast:n,disableSwitchToMonthOnDayFocus:s=!1,maxDate:a,minDate:o,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:d}=t,h=qt(),p=w.useRef(SX(!!c,s,h)).current,f=w.useMemo(()=>en.getInitialReferenceValue({value:e,utils:h,timezone:d,props:t,referenceDate:r,granularity:zs.day}),[]),[m,y]=w.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:f,currentMonth:h.startOfMonth(f),slideDirection:"left"}),v=w.useCallback(x=>{y(S({type:"changeMonth"},x)),l&&l(x.newMonth)},[l]),g=w.useCallback(x=>{const _=x;h.isSameMonth(_,m.currentMonth)||v({newMonth:h.startOfMonth(_),direction:h.isAfterDay(_,m.currentMonth)?"left":"right"})},[m.currentMonth,v,h]),b=cR({shouldDisableDate:u,minDate:o,maxDate:a,disableFuture:i,disablePast:n,timezone:d}),k=w.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),C=Ye((x,_)=>{b(x)||y({type:"changeFocusedDay",focusedDay:x,withoutMonthSwitchingAnimation:_})});return{referenceDate:f,calendarState:m,changeMonth:g,changeFocusedDay:C,isDateDisabled:b,onMonthSwitchingAnimationEnd:k,handleChangeMonth:v}},kX=t=>He("MuiPickersFadeTransitionGroup",t);Ue("MuiPickersFadeTransitionGroup",["root"]);const CX=t=>{const{classes:e}=t;return $e({root:["root"]},kX,e)},TX=K(Uw,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function uR(t){const e=Ae({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:r,className:i,reduceAnimations:n,transKey:s}=e,a=CX(e),o=qo();return n?r:T.jsx(TX,{className:xe(a.root,i),children:T.jsx(Cu,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:o.transitions.duration.enteringScreen,enter:o.transitions.duration.enteringScreen,exit:0},children:r},s)})}const _X=t=>He("MuiPickersSlideTransition",t),is=Ue("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),BX=["children","className","reduceAnimations","slideDirection","transKey","classes"],PX=t=>{const{classes:e,slideDirection:r}=t,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${r}`],exitActive:[`slideExitActiveLeft-${r}`]};return $e(i,_X,e)},NX=K(Uw,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${is["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${is["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${is.slideEnterActive}`]:e.slideEnterActive},{[`.${is.slideExit}`]:e.slideExit},{[`.${is["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${is["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${is["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${is["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${is.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${is.slideExit}`]:{transform:"translate(0%)"},[`& .${is["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${is["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function EX(t){const e=Ae({props:t,name:"MuiPickersSlideTransition"}),{children:r,className:i,reduceAnimations:n,transKey:s}=e,a=oe(e,BX),o=PX(e),l=qo();if(n)return T.jsx("div",{className:xe(o.root,i),children:r});const c={exit:o.exit,enterActive:o.enterActive,enter:o.enter,exitActive:o.exitActive};return T.jsx(NX,{className:xe(o.root,i),childFactory:u=>w.cloneElement(u,{classNames:c}),role:"presentation",children:T.jsx(h5,S({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},a,{children:r}),s)})}const RX=t=>He("MuiDayCalendar",t);Ue("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const MX=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],DX=["ownerState"],LX=t=>{const{classes:e}=t;return $e({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},RX,e)},dR=(fh+Kg*2)*6,FX=K("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),IX=K("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),OX=K(Mr,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(t.vars||t).palette.text.secondary})),AX=K(Mr,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),VX=K(Mr,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>S({},t.typography.caption,{width:fh,height:fh,padding:0,margin:`0 ${Kg}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),$X=K("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:dR}),zX=K(EX,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:dR}),WX=K("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),HX=K("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Kg}px 0`,display:"flex",justifyContent:"center"});function UX(t){let{parentProps:e,day:r,focusableDay:i,selectedDays:n,isDateDisabled:s,currentMonthNumber:a,isViewFocused:o}=t,l=oe(t,MX);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:h,slots:p,slotProps:f,timezone:m}=e,y=qt(),v=Kl(m),g=i!==null&&y.isSameDay(r,i),b=n.some($=>y.isSameDay($,r)),k=y.isSameDay(r,v),C=(p==null?void 0:p.day)??hY,x=Ct({elementType:C,externalSlotProps:f==null?void 0:f.day,additionalProps:S({disableHighlightToday:u,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:d,"data-timestamp":y.toJsDate(r).valueOf()},l),ownerState:S({},e,{day:r,selected:b})}),_=oe(x,DX),P=w.useMemo(()=>c||s(r),[c,s,r]),R=w.useMemo(()=>y.getMonth(r)!==a,[y,r,a]),E=w.useMemo(()=>{const $=y.startOfMonth(y.setMonth(r,a));return h?y.isSameDay(r,y.startOfWeek($)):y.isSameDay(r,$)},[a,r,h,y]),D=w.useMemo(()=>{const $=y.endOfMonth(y.setMonth(r,a));return h?y.isSameDay(r,y.endOfWeek($)):y.isSameDay(r,$)},[a,r,h,y]);return T.jsx(C,S({},_,{day:r,disabled:P,autoFocus:o&&g,today:k,outsideCurrentMonth:R,isFirstVisibleCell:E,isLastVisibleCell:D,selected:b,tabIndex:g?0:-1,"aria-selected":b,"aria-current":k?"date":void 0}))}function GX(t){const e=Ae({props:t,name:"MuiDayCalendar"}),r=qt(),{onFocusedDayChange:i,className:n,currentMonth:s,selectedDays:a,focusedDay:o,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:d,reduceAnimations:h,renderLoading:p=()=>T.jsx("span",{children:"..."}),slideDirection:f,TransitionProps:m,disablePast:y,disableFuture:v,minDate:g,maxDate:b,shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:x,dayOfWeekFormatter:_=ce=>r.format(ce,"weekdayShort").charAt(0).toUpperCase(),hasFocus:P,onFocusedViewChange:R,gridLabelId:E,displayWeekNumber:D,fixedWeekNumber:$,autoFocus:I,timezone:F}=e,M=Kl(F),O=LX(e),A=Xi(),N=cR({shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:x,minDate:g,maxDate:b,disablePast:y,disableFuture:v,timezone:F}),V=rn(),[W,Q]=xs({name:"DayCalendar",state:"hasFocus",controlled:P,default:I??!1}),[ne,ie]=w.useState(()=>o||M),te=Ye(ce=>{d||c(ce)}),j=ce=>{N(ce)||(i(ce),ie(ce),R==null||R(!0),Q(!0))},J=Ye((ce,L)=>{switch(ce.key){case"ArrowUp":j(r.addDays(L,-7)),ce.preventDefault();break;case"ArrowDown":j(r.addDays(L,7)),ce.preventDefault();break;case"ArrowLeft":{const U=r.addDays(L,A?1:-1),G=r.addMonths(L,A?1:-1),re=Md({utils:r,date:U,minDate:A?U:r.startOfMonth(G),maxDate:A?r.endOfMonth(G):U,isDateDisabled:N,timezone:F});j(re||U),ce.preventDefault();break}case"ArrowRight":{const U=r.addDays(L,A?-1:1),G=r.addMonths(L,A?-1:1),re=Md({utils:r,date:U,minDate:A?r.startOfMonth(G):U,maxDate:A?U:r.endOfMonth(G),isDateDisabled:N,timezone:F});j(re||U),ce.preventDefault();break}case"Home":j(r.startOfWeek(L)),ce.preventDefault();break;case"End":j(r.endOfWeek(L)),ce.preventDefault();break;case"PageUp":j(r.addMonths(L,1)),ce.preventDefault();break;case"PageDown":j(r.addMonths(L,-1)),ce.preventDefault();break}}),pe=Ye((ce,L)=>j(L)),fe=Ye((ce,L)=>{W&&r.isSameDay(ne,L)&&(R==null||R(!1))}),Me=r.getMonth(s),_e=r.getYear(s),ke=w.useMemo(()=>a.filter(ce=>!!ce).map(ce=>r.startOfDay(ce)),[r,a]),Ce=`${_e}-${Me}`,X=w.useMemo(()=>w.createRef(),[Ce]),ee=r.startOfWeek(M),Y=w.useMemo(()=>{const ce=r.startOfMonth(s),L=r.endOfMonth(s);return N(ne)||r.isAfterDay(ne,L)||r.isBeforeDay(ne,ce)?Md({utils:r,date:ne,minDate:ce,maxDate:L,disablePast:y,disableFuture:v,isDateDisabled:N,timezone:F}):ne},[s,v,y,ne,N,r,F]),Be=w.useMemo(()=>{const ce=r.setTimezone(s,F),L=r.getWeekArray(ce);let U=r.addMonths(ce,1);for(;$&&L.length<$;){const G=r.getWeekArray(U),re=r.isSameDay(L[L.length-1][0],G[0][0]);G.slice(re?1:0).forEach(we=>{L.length<$&&L.push(we)}),U=r.addMonths(U,1)}return L},[s,$,r,F]);return T.jsxs(FX,{role:"grid","aria-labelledby":E,className:O.root,children:[T.jsxs(IX,{role:"row",className:O.header,children:[D&&T.jsx(AX,{variant:"caption",role:"columnheader","aria-label":V.calendarWeekNumberHeaderLabel,className:O.weekNumberLabel,children:V.calendarWeekNumberHeaderText}),n9(r,M).map((ce,L)=>T.jsx(OX,{variant:"caption",role:"columnheader","aria-label":r.format(r.addDays(ee,L),"weekday"),className:O.weekDayLabel,children:_(ce)},L.toString()))]}),l?T.jsx($X,{className:O.loadingContainer,children:p()}):T.jsx(zX,S({transKey:Ce,onExited:u,reduceAnimations:h,slideDirection:f,className:xe(n,O.slideTransition)},m,{nodeRef:X,children:T.jsx(WX,{ref:X,role:"rowgroup",className:O.monthContainer,children:Be.map((ce,L)=>T.jsxs(HX,{role:"row",className:O.weekContainer,"aria-rowindex":L+1,children:[D&&T.jsx(VX,{className:O.weekNumber,role:"rowheader","aria-label":V.calendarWeekNumberAriaLabelText(r.getWeekNumber(ce[0])),children:V.calendarWeekNumberText(r.getWeekNumber(ce[0]))}),ce.map((U,G)=>T.jsx(UX,{parentProps:e,day:U,selectedDays:ke,focusableDay:Y,onKeyDown:J,onFocus:pe,onBlur:fe,onDaySelect:te,isDateDisabled:N,currentMonthNumber:Me,isViewFocused:W,"aria-colindex":G+1},U.toString()))]},`week-${ce[0]}`))})}))]})}function jX(t){return He("MuiPickersMonth",t)}const Of=Ue("MuiPickersMonth",["root","monthButton","disabled","selected"]),YX=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],XX=t=>{const{disabled:e,selected:r,classes:i}=t;return $e({root:["root"],monthButton:["monthButton",e&&"disabled",r&&"selected"]},jX,i)},qX=K("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),KX=K("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${Of.disabled}`]:e.disabled},{[`&.${Of.selected}`]:e.selected}]})(({theme:t})=>S({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Of.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${Of.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),QX=w.memo(function(e){const r=Ae({props:e,name:"MuiPickersMonth"}),{autoFocus:i,className:n,children:s,disabled:a,selected:o,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:h,onBlur:p,"aria-current":f,"aria-label":m,slots:y,slotProps:v}=r,g=oe(r,YX),b=w.useRef(null),k=XX(r);zr(()=>{var _;i&&((_=b.current)==null||_.focus())},[i]);const C=(y==null?void 0:y.monthButton)??KX,x=Ct({elementType:C,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:s,disabled:a,tabIndex:c,ref:b,type:"button",role:"radio","aria-current":f,"aria-checked":o,"aria-label":m,onClick:_=>u(_,l),onKeyDown:_=>d(_,l),onFocus:_=>h(_,l),onBlur:_=>p(_,l)},ownerState:r,className:k.monthButton});return T.jsx(qX,S({className:xe(k.root,n),ownerState:r},g,{children:T.jsx(C,S({},x))}))});function JX(t){return He("MuiMonthCalendar",t)}Ue("MuiMonthCalendar",["root"]);const ZX=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],eq=t=>{const{classes:e}=t;return $e({root:["root"]},JX,e)};function tq(t,e){const r=qt(),i=Yh(),n=Ae({props:t,name:e});return S({disableFuture:!1,disablePast:!1},n,{minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate)})}const rq=K("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Qg,boxSizing:"border-box"}),iq=w.forwardRef(function(e,r){const i=tq(e,"MuiMonthCalendar"),{className:n,value:s,defaultValue:a,referenceDate:o,disabled:l,disableFuture:c,disablePast:u,maxDate:d,minDate:h,onChange:p,shouldDisableMonth:f,readOnly:m,autoFocus:y=!1,onMonthFocus:v,hasFocus:g,onFocusedViewChange:b,monthsPerRow:k=3,timezone:C,gridLabelId:x,slots:_,slotProps:P}=i,R=oe(i,ZX),{value:E,handleValueChange:D,timezone:$}=_u({name:"MonthCalendar",timezone:C,value:s,defaultValue:a,onChange:p,valueManager:en}),I=Kl($),F=Xi(),M=qt(),O=w.useMemo(()=>en.getInitialReferenceValue({value:E,utils:M,props:i,timezone:$,referenceDate:o,granularity:zs.month}),[]),A=i,N=eq(A),V=w.useMemo(()=>M.getMonth(I),[M,I]),W=w.useMemo(()=>E!=null?M.getMonth(E):null,[E,M]),[Q,ne]=w.useState(()=>W||M.getMonth(O)),[ie,te]=xs({name:"MonthCalendar",state:"hasFocus",controlled:g,default:y??!1}),j=Ye(Ce=>{te(Ce),b&&b(Ce)}),J=w.useCallback(Ce=>{const X=M.startOfMonth(u&&M.isAfter(I,h)?I:h),ee=M.startOfMonth(c&&M.isBefore(I,d)?I:d),Y=M.startOfMonth(Ce);return M.isBefore(Y,X)||M.isAfter(Y,ee)?!0:f?f(Y):!1},[c,u,d,h,I,f,M]),pe=Ye((Ce,X)=>{if(m)return;const ee=M.setMonth(E??O,X);D(ee)}),fe=Ye(Ce=>{J(M.setMonth(E??O,Ce))||(ne(Ce),j(!0),v&&v(Ce))});w.useEffect(()=>{ne(Ce=>W!==null&&Ce!==W?W:Ce)},[W]);const Me=Ye((Ce,X)=>{switch(Ce.key){case"ArrowUp":fe((12+X-3)%12),Ce.preventDefault();break;case"ArrowDown":fe((12+X+3)%12),Ce.preventDefault();break;case"ArrowLeft":fe((12+X+(F?1:-1))%12),Ce.preventDefault();break;case"ArrowRight":fe((12+X+(F?-1:1))%12),Ce.preventDefault();break}}),_e=Ye((Ce,X)=>{fe(X)}),ke=Ye((Ce,X)=>{Q===X&&j(!1)});return T.jsx(rq,S({ref:r,className:xe(N.root,n),ownerState:A,role:"radiogroup","aria-labelledby":x},R,{children:gS(M,E??O).map(Ce=>{const X=M.getMonth(Ce),ee=M.format(Ce,"monthShort"),Y=M.format(Ce,"month"),Be=X===W,ce=l||J(Ce);return T.jsx(QX,{selected:Be,value:X,onClick:pe,onKeyDown:Me,autoFocus:ie&&X===Q,disabled:ce,tabIndex:X===Q&&!ce?0:-1,onFocus:_e,onBlur:ke,"aria-current":V===X?"date":void 0,"aria-label":Y,monthsPerRow:k,slots:_,slotProps:P,children:ee},ee)})}))});function nq(t){return He("MuiPickersYear",t)}const Af=Ue("MuiPickersYear",["root","yearButton","selected","disabled"]),sq=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],aq=t=>{const{disabled:e,selected:r,classes:i}=t;return $e({root:["root"],yearButton:["yearButton",e&&"disabled",r&&"selected"]},nq,i)},oq=K("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),lq=K("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${Af.disabled}`]:e.disabled},{[`&.${Af.selected}`]:e.selected}]})(({theme:t})=>S({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Af.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${Af.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),cq=w.memo(function(e){const r=Ae({props:e,name:"MuiPickersYear"}),{autoFocus:i,className:n,children:s,disabled:a,selected:o,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:h,onBlur:p,"aria-current":f,slots:m,slotProps:y}=r,v=oe(r,sq),g=w.useRef(null),b=aq(r);zr(()=>{var x;i&&((x=g.current)==null||x.focus())},[i]);const k=(m==null?void 0:m.yearButton)??lq,C=Ct({elementType:k,externalSlotProps:y==null?void 0:y.yearButton,additionalProps:{children:s,disabled:a,tabIndex:c,ref:g,type:"button",role:"radio","aria-current":f,"aria-checked":o,onClick:x=>u(x,l),onKeyDown:x=>d(x,l),onFocus:x=>h(x,l),onBlur:x=>p(x,l)},ownerState:r,className:b.yearButton});return T.jsx(oq,S({className:xe(b.root,n),ownerState:r},v,{children:T.jsx(k,S({},C))}))});function uq(t){return He("MuiYearCalendar",t)}Ue("MuiYearCalendar",["root"]);const dq=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsPerRow","timezone","gridLabelId","slots","slotProps"],hq=t=>{const{classes:e}=t;return $e({root:["root"]},uq,e)};function fq(t,e){const r=qt(),i=Yh(),n=Ae({props:t,name:e});return S({disablePast:!1,disableFuture:!1},n,{yearsPerRow:n.yearsPerRow??3,minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate)})}const pq=K("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Qg,maxHeight:$j,boxSizing:"border-box",position:"relative"}),mq=w.forwardRef(function(e,r){const i=fq(e,"MuiYearCalendar"),{autoFocus:n,className:s,value:a,defaultValue:o,referenceDate:l,disabled:c,disableFuture:u,disablePast:d,maxDate:h,minDate:p,onChange:f,readOnly:m,shouldDisableYear:y,onYearFocus:v,hasFocus:g,onFocusedViewChange:b,yearsPerRow:k,timezone:C,gridLabelId:x,slots:_,slotProps:P}=i,R=oe(i,dq),{value:E,handleValueChange:D,timezone:$}=_u({name:"YearCalendar",timezone:C,value:a,defaultValue:o,onChange:f,valueManager:en}),I=Kl($),F=Xi(),M=qt(),O=w.useMemo(()=>en.getInitialReferenceValue({value:E,utils:M,props:i,timezone:$,referenceDate:l,granularity:zs.year}),[]),A=i,N=hq(A),V=w.useMemo(()=>M.getYear(I),[M,I]),W=w.useMemo(()=>E!=null?M.getYear(E):null,[E,M]),[Q,ne]=w.useState(()=>W||M.getYear(O)),[ie,te]=xs({name:"YearCalendar",state:"hasFocus",controlled:g,default:n??!1}),j=Ye(ee=>{te(ee),b&&b(ee)}),J=w.useCallback(ee=>{if(d&&M.isBeforeYear(ee,I)||u&&M.isAfterYear(ee,I)||p&&M.isBeforeYear(ee,p)||h&&M.isAfterYear(ee,h))return!0;if(!y)return!1;const Y=M.startOfYear(ee);return y(Y)},[u,d,h,p,I,y,M]),pe=Ye((ee,Y)=>{if(m)return;const Be=M.setYear(E??O,Y);D(Be)}),fe=Ye(ee=>{J(M.setYear(E??O,ee))||(ne(ee),j(!0),v==null||v(ee))});w.useEffect(()=>{ne(ee=>W!==null&&ee!==W?W:ee)},[W]);const Me=Ye((ee,Y)=>{switch(ee.key){case"ArrowUp":fe(Y-k),ee.preventDefault();break;case"ArrowDown":fe(Y+k),ee.preventDefault();break;case"ArrowLeft":fe(Y+(F?1:-1)),ee.preventDefault();break;case"ArrowRight":fe(Y+(F?-1:1)),ee.preventDefault();break}}),_e=Ye((ee,Y)=>{fe(Y)}),ke=Ye((ee,Y)=>{Q===Y&&j(!1)}),Ce=w.useRef(null),X=Wt(r,Ce);return w.useEffect(()=>{if(n||Ce.current===null)return;const ee=Ce.current.querySelector('[tabindex="0"]');if(!ee)return;const Y=ee.offsetHeight,Be=ee.offsetTop,ce=Ce.current.clientHeight,L=Ce.current.scrollTop,U=Be+Y;Y>ce||Be{const Y=M.getYear(ee),Be=Y===W,ce=c||J(ee);return T.jsx(cq,{selected:Be,value:Y,onClick:pe,onKeyDown:Me,autoFocus:ie&&Y===Q,disabled:ce,tabIndex:Y===Q&&!ce?0:-1,onFocus:_e,onBlur:ke,"aria-current":V===Y?"date":void 0,yearsPerRow:k,slots:_,slotProps:P,children:M.format(ee,"year")},M.format(ee,"year"))})}))}),gq=t=>He("MuiPickersCalendarHeader",t),yq=Ue("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),bq=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],vq=["ownerState"],wq=t=>{const{classes:e}=t;return $e({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},gq,e)},Sq=K("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),xq=K("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>S({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),kq=K("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Cq=K(yn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${yq.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Tq=K(xj,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),_q=w.forwardRef(function(e,r){const i=rn(),n=qt(),s=Ae({props:e,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:o,currentMonth:l,disabled:c,disableFuture:u,disablePast:d,maxDate:h,minDate:p,onMonthChange:f,onViewChange:m,view:y,reduceAnimations:v,views:g,labelId:b,className:k,timezone:C,format:x=`${n.formats.month} ${n.formats.year}`}=s,_=oe(s,bq),P=s,R=wq(s),E=(a==null?void 0:a.switchViewButton)??Cq,D=Ct({elementType:E,externalSlotProps:o==null?void 0:o.switchViewButton,additionalProps:{size:"small","aria-label":i.calendarViewSwitchingButtonAriaLabel(y)},ownerState:P,className:R.switchViewButton}),$=(a==null?void 0:a.switchViewIcon)??Tq,I=Ct({elementType:$,externalSlotProps:o==null?void 0:o.switchViewIcon,ownerState:void 0,className:R.switchViewIcon}),F=oe(I,vq),M=()=>f(n.addMonths(l,1),"left"),O=()=>f(n.addMonths(l,-1),"right"),A=Aj(l,{disableFuture:u,maxDate:h,timezone:C}),N=Vj(l,{disablePast:d,minDate:p,timezone:C}),V=()=>{if(!(g.length===1||!m||c))if(g.length===2)m(g.find(Q=>Q!==y)||g[0]);else{const Q=g.indexOf(y)!==0?0:1;m(g[Q])}};if(g.length===1&&g[0]==="year")return null;const W=n.formatByString(l,x);return T.jsxs(Sq,S({},_,{ownerState:P,className:xe(k,R.root),ref:r,children:[T.jsxs(xq,{role:"presentation",onClick:V,ownerState:P,"aria-live":"polite",className:R.labelContainer,children:[T.jsx(uR,{reduceAnimations:v,transKey:W,children:T.jsx(kq,{id:b,ownerState:P,className:R.label,children:W})}),g.length>1&&!c&&T.jsx(E,S({},D,{children:T.jsx($,S({},F))}))]}),T.jsx(Cu,{in:y==="day",children:T.jsx(NE,{slots:a,slotProps:o,onGoToPrevious:O,isPreviousDisabled:N,previousLabel:i.previousMonth,onGoToNext:M,isNextDisabled:A,nextLabel:i.nextMonth})})]}))}),Bq="@media (prefers-reduced-motion: reduce)",Hc=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),SC=Hc&&Hc[1]?parseInt(Hc[1],10):null,xC=Hc&&Hc[2]?parseInt(Hc[2],10):null,Pq=SC&&SC<10||xC&&xC<13||!1,hR=()=>Mw(Bq,{defaultMatches:!1})||Pq,Nq=t=>He("MuiDateCalendar",t);Ue("MuiDateCalendar",["root","viewTransitionContainer"]);const Eq=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsPerRow","monthsPerRow","timezone"],Rq=t=>{const{classes:e}=t;return $e({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Nq,e)};function Mq(t,e){const r=qt(),i=Yh(),n=hR(),s=Ae({props:t,name:e});return S({},s,{loading:s.loading??!1,disablePast:s.disablePast??!1,disableFuture:s.disableFuture??!1,openTo:s.openTo??"day",views:s.views??["year","day"],reduceAnimations:s.reduceAnimations??n,renderLoading:s.renderLoading??(()=>T.jsx("span",{children:"..."})),minDate:Bs(r,s.minDate,i.minDate),maxDate:Bs(r,s.maxDate,i.maxDate)})}const Dq=K(Jg,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:mS}),Lq=K(uR,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Fq=w.forwardRef(function(e,r){const i=qt(),n=ia(),s=Mq(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:o,value:l,defaultValue:c,referenceDate:u,disableFuture:d,disablePast:h,onChange:p,onYearChange:f,onMonthChange:m,reduceAnimations:y,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:b,view:k,views:C,openTo:x,className:_,disabled:P,readOnly:R,minDate:E,maxDate:D,disableHighlightToday:$,focusedView:I,onFocusedViewChange:F,showDaysOutsideCurrentMonth:M,fixedWeekNumber:O,dayOfWeekFormatter:A,slots:N,slotProps:V,loading:W,renderLoading:Q,displayWeekNumber:ne,yearsPerRow:ie,monthsPerRow:te,timezone:j}=s,J=oe(s,Eq),{value:pe,handleValueChange:fe,timezone:Me}=_u({name:"DateCalendar",timezone:j,value:l,defaultValue:c,onChange:p,valueManager:en}),{view:_e,setView:ke,focusedView:Ce,setFocusedView:X,goToNextView:ee,setValueAndGoToNextView:Y}=qh({view:k,views:C,openTo:x,onChange:fe,onViewChange:o,autoFocus:a,focusedView:I,onFocusedViewChange:F}),{referenceDate:Be,calendarState:ce,changeFocusedDay:L,changeMonth:U,handleChangeMonth:G,isDateDisabled:re,onMonthSwitchingAnimationEnd:we}=xX({value:pe,referenceDate:u,reduceAnimations:y,onMonthChange:m,minDate:E,maxDate:D,shouldDisableDate:v,disablePast:h,disableFuture:d,timezone:Me}),me=P&&pe||E,Ee=P&&pe||D,qe=`${n}-grid-label`,ct=Ce!==null,Pt=(N==null?void 0:N.calendarHeader)??_q,be=Ct({elementType:Pt,externalSlotProps:V==null?void 0:V.calendarHeader,additionalProps:{views:C,view:_e,currentMonth:ce.currentMonth,onViewChange:ke,onMonthChange:(nt,Ht)=>G({newMonth:nt,direction:Ht}),minDate:me,maxDate:Ee,disabled:P,disablePast:h,disableFuture:d,reduceAnimations:y,timezone:Me,labelId:qe},ownerState:s}),le=Ye(nt=>{const Ht=i.startOfMonth(nt),Sr=i.endOfMonth(nt),_r=re(nt)?Md({utils:i,date:nt,minDate:i.isBefore(E,Ht)?Ht:E,maxDate:i.isAfter(D,Sr)?Sr:D,disablePast:h,disableFuture:d,isDateDisabled:re,timezone:Me}):nt;_r?(Y(_r,"finish"),m==null||m(Ht)):(ee(),U(Ht)),L(_r,!0)}),Ke=Ye(nt=>{const Ht=i.startOfYear(nt),Sr=i.endOfYear(nt),_r=re(nt)?Md({utils:i,date:nt,minDate:i.isBefore(E,Ht)?Ht:E,maxDate:i.isAfter(D,Sr)?Sr:D,disablePast:h,disableFuture:d,isDateDisabled:re,timezone:Me}):nt;_r?(Y(_r,"finish"),f==null||f(_r)):(ee(),U(Ht)),L(_r,!0)}),bt=Ye(nt=>fe(nt&&cm(i,nt,pe??Be),"finish",_e));w.useEffect(()=>{pe!=null&&i.isValid(pe)&&U(pe)},[pe]);const Tt=s,Fe=Rq(Tt),xt={disablePast:h,disableFuture:d,maxDate:D,minDate:E},De={disableHighlightToday:$,readOnly:R,disabled:P,timezone:Me,gridLabelId:qe,slots:N,slotProps:V},Ie=w.useRef(_e);w.useEffect(()=>{Ie.current!==_e&&(Ce===Ie.current&&X(_e,!0),Ie.current=_e)},[Ce,X,_e]);const wt=w.useMemo(()=>[pe],[pe]);return T.jsxs(Dq,S({ref:r,className:xe(Fe.root,_),ownerState:Tt},J,{children:[T.jsx(Pt,S({},be,{slots:N,slotProps:V})),T.jsx(Lq,{reduceAnimations:y,className:Fe.viewTransitionContainer,transKey:_e,ownerState:Tt,children:T.jsxs("div",{children:[_e==="year"&&T.jsx(mq,S({},xt,De,{value:pe,onChange:Ke,shouldDisableYear:b,hasFocus:ct,onFocusedViewChange:nt=>X("year",nt),yearsPerRow:ie,referenceDate:Be})),_e==="month"&&T.jsx(iq,S({},xt,De,{hasFocus:ct,className:_,value:pe,onChange:le,shouldDisableMonth:g,onFocusedViewChange:nt=>X("month",nt),monthsPerRow:te,referenceDate:Be})),_e==="day"&&T.jsx(GX,S({},ce,xt,De,{onMonthSwitchingAnimationEnd:we,onFocusedDayChange:L,reduceAnimations:y,selectedDays:wt,onSelectedDaysChange:bt,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:b,hasFocus:ct,onFocusedViewChange:nt=>X("day",nt),showDaysOutsideCurrentMonth:M,fixedWeekNumber:O,dayOfWeekFormatter:A,displayWeekNumber:ne,loading:W,renderLoading:Q}))]})})]}))});function fR(t){return He("MuiPickersToolbar",t)}Ue("MuiPickersToolbar",["root","content"]);const Iq=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Oq=t=>{const{classes:e,isLandscape:r}=t;return $e({root:["root"],content:["content"],penIconButton:["penIconButton",r&&"penIconButtonLandscape"]},fR,e)},Aq=K("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Vq=K("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),pR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersToolbar"}),{children:n,className:s,toolbarTitle:a,hidden:o,titleId:l}=i,c=oe(i,Iq),u=i,d=Oq(u);return o?null:T.jsxs(Aq,S({ref:r,className:xe(d.root,s),ownerState:u},c,{children:[T.jsx(Mr,{color:"text.secondary",variant:"overline",id:l,children:a}),T.jsx(Vq,{className:d.content,ownerState:u,children:n})]}))});function $q(t){return He("MuiDatePickerToolbar",t)}Ue("MuiDatePickerToolbar",["root","title"]);const zq=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],Wq=t=>{const{classes:e}=t;return $e({root:["root"],title:["title"]},$q,e)},Hq=K(pR,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Uq=K(Mr,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(t,e)=>e.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),Gq=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDatePickerToolbar"}),{value:n,isLandscape:s,toolbarFormat:a,toolbarPlaceholder:o="––",views:l,className:c}=i,u=oe(i,zq),d=qt(),h=rn(),p=Wq(i),f=w.useMemo(()=>{if(!n)return o;const y=bS(d,{format:a,views:l},!0);return d.formatByString(n,y)},[n,a,o,d,l]),m=i;return T.jsx(Hq,S({ref:r,toolbarTitle:h.datePickerToolbarTitle,isLandscape:s,className:xe(p.root,c)},u,{children:T.jsx(Uq,{variant:"h4",align:s?"left":"center",ownerState:m,className:p.title,children:f})}))});function mR(t,e){const r=qt(),i=Yh(),n=Ae({props:t,name:e}),s=w.useMemo(()=>{var a;return((a=n.localeText)==null?void 0:a.toolbarTitle)==null?n.localeText:S({},n.localeText,{datePickerToolbarTitle:n.localeText.toolbarTitle})},[n.localeText]);return S({},n,{localeText:s},EE({views:n.views,openTo:n.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:n.disableFuture??!1,disablePast:n.disablePast??!1,minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate),slots:S({toolbar:Gq},n.slots)})}function jq(t){return He("MuiPickersPopper",t)}Ue("MuiPickersPopper",["root","paper"]);const Yq=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Xq=t=>{const{classes:e}=t;return $e({root:["root"],paper:["paper"]},jq,e)},qq=K(h3,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Kq=K(Xl,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function Qq(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){s.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),s.current=!1}},[t]);const a=Ye(l=>{if(!s.current)return;const c=i.current;i.current=!1;const u=Xr(n.current);if(!n.current||"clientX"in l&&Qq(l,u))return;if(r.current){r.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(n.current)>-1:d=!u.documentElement.contains(l.target)||n.current.contains(l.target),!d&&!c&&e(l)}),o=()=>{i.current=!0};return w.useEffect(()=>{if(t){const l=Xr(n.current),c=()=>{r.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[t,a]),w.useEffect(()=>{if(t){const l=Xr(n.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),i.current=!1}}},[t,a]),[n,o,o]}const Zq=w.forwardRef((t,e)=>{const{PaperComponent:r,popperPlacement:i,ownerState:n,children:s,paperSlotProps:a,paperClasses:o,onPaperClick:l,onPaperTouchStart:c}=t,u=oe(t,Yq),d=S({},n,{placement:i}),h=Ct({elementType:r,externalSlotProps:a,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:o,ownerState:d});return T.jsx(r,S({},u,h,{onClick:p=>{var f;l(p),(f=h.onClick)==null||f.call(h,p)},onTouchStart:p=>{var f;c(p),(f=h.onTouchStart)==null||f.call(h,p)},ownerState:d,children:s}))});function eK(t){const e=Ae({props:t,name:"MuiPickersPopper"}),{anchorEl:r,children:i,containerRef:n=null,shouldRestoreFocus:s,onBlur:a,onDismiss:o,open:l,role:c,placement:u,slots:d,slotProps:h,reduceAnimations:p}=e;w.useEffect(()=>{function M(O){l&&O.key==="Escape"&&o()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[o,l]);const f=w.useRef(null);w.useEffect(()=>{c==="tooltip"||s&&!s()||(l?f.current=ps(document):f.current&&f.current instanceof HTMLElement&&setTimeout(()=>{f.current instanceof HTMLElement&&f.current.focus()}))},[l,c,s]);const[m,y,v]=Jq(l,a??o),g=w.useRef(null),b=Wt(g,n),k=Wt(b,m),C=e,x=Xq(C),_=hR(),P=p??_,R=M=>{M.key==="Escape"&&(M.stopPropagation(),o())},E=(d==null?void 0:d.desktopTransition)??P?Cu:GN,D=(d==null?void 0:d.desktopTrapFocus)??gN,$=(d==null?void 0:d.desktopPaper)??Kq,I=(d==null?void 0:d.popper)??qq,F=Ct({elementType:I,externalSlotProps:h==null?void 0:h.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:r,placement:u,onKeyDown:R},className:x.root,ownerState:e});return T.jsx(I,S({},F,{children:({TransitionProps:M,placement:O})=>T.jsx(D,S({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},h==null?void 0:h.desktopTrapFocus,{children:T.jsx(E,S({},M,h==null?void 0:h.desktopTransition,{children:T.jsx(Zq,{PaperComponent:$,ownerState:C,popperPlacement:O,ref:k,onPaperClick:y,onPaperTouchStart:v,paperClasses:x.paper,paperSlotProps:h==null?void 0:h.desktopPaper,children:i})}))}))}))}const tK=({open:t,onOpen:e,onClose:r})=>{const i=w.useRef(typeof t=="boolean").current,[n,s]=w.useState(!1);w.useEffect(()=>{if(i){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");s(t)}},[i,t]);const a=w.useCallback(o=>{i||s(o),o&&e&&e(),!o&&r&&r()},[i,e,r]);return{isOpen:n,setIsOpen:a}},rK=t=>{const{action:e,hasChanged:r,dateState:i,isControlled:n}=t,s=!n&&!i.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:r(i.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?s?!0:r(i.lastPublishedValue):!1},iK=t=>{const{action:e,hasChanged:r,dateState:i,isControlled:n,closeOnSelect:s}=t,a=!n&&!i.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?a&&["accept","today","clear"].includes(e.pickerAction)?!0:r(i.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&s?a?!0:r(i.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&r(i.lastCommittedValue):!1},nK=t=>{const{action:e,closeOnSelect:r}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&r:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},sK=({props:t,valueManager:e,valueType:r,wrapperVariant:i,validator:n})=>{const{onAccept:s,onChange:a,value:o,defaultValue:l,closeOnSelect:c=i==="desktop",timezone:u}=t,{current:d}=w.useRef(l),{current:h}=w.useRef(o!==void 0),p=qt(),f=ql(),{isOpen:m,setIsOpen:y}=tK(t),{timezone:v,value:g,handleValueChange:b}=vS({timezone:u,value:o,defaultValue:d,onChange:a,valueManager:e}),[k,C]=w.useState(()=>{let ie;return g!==void 0?ie=g:d!==void 0?ie=d:ie=e.emptyValue,{draft:ie,lastPublishedValue:ie,lastCommittedValue:ie,lastControlledValue:g,hasBeenModifiedSinceMount:!1}});jE(S({},t,{value:k.draft,timezone:v}),n,e.isSameError,e.defaultErrorState);const x=Ye(ie=>{const te={action:ie,dateState:k,hasChanged:_e=>!e.areValuesEqual(p,ie.value,_e),isControlled:h,closeOnSelect:c},j=rK(te),J=iK(te),pe=nK(te);C(_e=>S({},_e,{draft:ie.value,lastPublishedValue:j?ie.value:_e.lastPublishedValue,lastCommittedValue:J?ie.value:_e.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let fe=null;const Me=()=>(fe||(fe={validationError:ie.name==="setValueFromField"?ie.context.validationError:n({adapter:f,value:ie.value,props:S({},t,{value:ie.value,timezone:v})})},ie.name==="setValueFromShortcut"&&(fe.shortcut=ie.shortcut)),fe);j&&b(ie.value,Me()),J&&s&&s(ie.value,Me()),pe&&y(!1)});if(g!==void 0&&(k.lastControlledValue===void 0||!e.areValuesEqual(p,k.lastControlledValue,g))){const ie=e.areValuesEqual(p,k.draft,g);C(te=>S({},te,{lastControlledValue:g},ie?{}:{lastCommittedValue:g,lastPublishedValue:g,draft:g,hasBeenModifiedSinceMount:!0}))}const _=Ye(()=>{x({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),P=Ye(()=>{x({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),R=Ye(()=>{x({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),E=Ye(()=>{x({value:k.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),D=Ye(()=>{x({value:e.getTodayValue(p,v,r),name:"setValueFromAction",pickerAction:"today"})}),$=Ye(ie=>{ie.preventDefault(),y(!0)}),I=Ye(ie=>{ie==null||ie.preventDefault(),y(!1)}),F=Ye((ie,te="partial")=>x({name:"setValueFromView",value:ie,selectionState:te})),M=Ye((ie,te,j)=>x({name:"setValueFromShortcut",value:ie,changeImportance:te,shortcut:j})),O=Ye((ie,te)=>x({name:"setValueFromField",value:ie,context:te})),A={onClear:_,onAccept:P,onDismiss:R,onCancel:E,onSetToday:D,onOpen:$,onClose:I},N={value:k.draft,onChange:O},V=w.useMemo(()=>e.cleanValue(p,k.draft),[p,e,k.draft]),W={value:V,onChange:F,onClose:I,open:m},ne=S({},A,{value:V,onChange:F,onSelectShortcut:M,isValid:ie=>{const te=n({adapter:f,value:ie,props:S({},t,{value:ie,timezone:v})});return!e.hasError(te)}});return{open:m,fieldProps:N,viewProps:W,layoutProps:ne,actions:A}},aK=["className","sx"],oK=({props:t,propsFromPickerValue:e,additionalViewProps:r,autoFocusView:i,rendererInterceptor:n,fieldRef:s})=>{const{onChange:a,open:o,onClose:l}=e,{view:c,views:u,openTo:d,onViewChange:h,viewRenderers:p,timezone:f}=t,m=oe(t,aK),{view:y,setView:v,defaultView:g,focusedView:b,setFocusedView:k,setValueAndGoToNextView:C}=qh({view:c,views:u,openTo:d,onChange:a,onViewChange:h,autoFocus:i}),{hasUIView:x,viewModeLookup:_}=w.useMemo(()=>u.reduce((F,M)=>{let O;return p[M]!=null?O="UI":O="field",F.viewModeLookup[M]=O,O==="UI"&&(F.hasUIView=!0),F},{hasUIView:!1,viewModeLookup:{}}),[p,u]),P=w.useMemo(()=>u.reduce((F,M)=>p[M]!=null&&dh(M)?F+1:F,0),[p,u]),R=_[y],E=Ye(()=>R==="UI"),[D,$]=w.useState(R==="UI"?y:null);return D!==y&&_[y]==="UI"&&$(y),zr(()=>{R==="field"&&o&&(l(),setTimeout(()=>{var F,M;(F=s==null?void 0:s.current)==null||F.setSelectedSections(y),(M=s==null?void 0:s.current)==null||M.focusField(y)}))},[y]),zr(()=>{if(!o)return;let F=y;R==="field"&&D!=null&&(F=D),F!==g&&_[F]==="UI"&&_[g]==="UI"&&(F=g),F!==y&&v(F),k(F,!0)},[o]),{hasUIView:x,shouldRestoreFocus:E,layoutProps:{views:u,view:D,onViewChange:v},renderCurrentView:()=>{if(D==null)return null;const F=p[D];if(F==null)return null;const M=S({},m,r,e,{views:u,timezone:f,onChange:C,view:D,onViewChange:v,focusedView:b,onFocusedViewChange:k,showViewSwitcher:P>1,timeViewsCount:P});return n?n(p,D,M):F(M)}}};function kC(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const lK=(t,e)=>{const[r,i]=w.useState(kC);return zr(()=>{const s=()=>{i(kC())};return window.addEventListener("orientationchange",s),()=>{window.removeEventListener("orientationchange",s)}},[]),mc(t,["hours","minutes","seconds"])?!1:(e||r)==="landscape"},cK=({props:t,propsFromPickerValue:e,propsFromPickerViews:r,wrapperVariant:i})=>{const{orientation:n}=t,s=lK(r.views,n),a=Xi();return{layoutProps:S({},r,e,{isLandscape:s,isRtl:a,wrapperVariant:i,disabled:t.disabled,readOnly:t.readOnly})}},gR=(t,e="warning")=>{let r=!1;const i=Array.isArray(t)?t.join(` -`):t;return()=>{r||(r=!0,e==="error"?console.error(i):console.warn(i))}};gR(["The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.","You can replace it with the `textField` component slot in most cases.","For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5)."]);const yR=({props:t,valueManager:e,valueType:r,wrapperVariant:i,additionalViewProps:n,validator:s,autoFocusView:a,rendererInterceptor:o,fieldRef:l})=>{const c=sK({props:t,valueManager:e,valueType:r,wrapperVariant:i,validator:s}),u=oK({props:t,additionalViewProps:n,autoFocusView:a,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:o}),d=cK({props:t,wrapperVariant:i,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:d.layoutProps}};function bR(t){return He("MuiPickersLayout",t)}const al=Ue("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),uK=["onAccept","onClear","onCancel","onSetToday","actions"];function dK(t){const{onAccept:e,onClear:r,onCancel:i,onSetToday:n,actions:s}=t,a=oe(t,uK),o=rn();if(s==null||s.length===0)return null;const l=s==null?void 0:s.map(c=>{switch(c){case"clear":return T.jsx(Va,{onClick:r,children:o.clearButtonLabel},c);case"cancel":return T.jsx(Va,{onClick:i,children:o.cancelButtonLabel},c);case"accept":return T.jsx(Va,{onClick:e,children:o.okButtonLabel},c);case"today":return T.jsx(Va,{onClick:n,children:o.todayButtonLabel},c);default:return null}});return T.jsx(LN,S({},a,{children:l}))}const hK=["items","changeImportance","isLandscape","onChange","isValid"],fK=["getValue"];function pK(t){const{items:e,changeImportance:r="accept",onChange:i,isValid:n}=t,s=oe(t,hK);if(e==null||e.length===0)return null;const a=e.map(o=>{let{getValue:l}=o,c=oe(o,fK);const u=l({isValid:n});return S({},c,{label:c.label,onClick:()=>{i(u,r,c)},disabled:!n(u)})});return T.jsx(Gh,S({dense:!0,sx:[{maxHeight:mS,maxWidth:200,overflow:"auto"},...Array.isArray(s.sx)?s.sx:[s.sx]]},s,{children:a.map(o=>T.jsx(KN,{children:T.jsx(S3,S({},o))},o.id??o.label))}))}function mK(t){return t.view!==null}const gK=t=>{const{classes:e,isLandscape:r}=t;return $e({root:["root",r&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},bR,e)},yK=t=>{const{wrapperVariant:e,onAccept:r,onClear:i,onCancel:n,onSetToday:s,view:a,views:o,onViewChange:l,value:c,onChange:u,onSelectShortcut:d,isValid:h,isLandscape:p,disabled:f,readOnly:m,children:y,slots:v,slotProps:g}=t,b=gK(t),k=(v==null?void 0:v.actionBar)??dK,C=Ct({elementType:k,externalSlotProps:g==null?void 0:g.actionBar,additionalProps:{onAccept:r,onClear:i,onCancel:n,onSetToday:s,actions:e==="desktop"?[]:["cancel","accept"]},className:b.actionBar,ownerState:S({},t,{wrapperVariant:e})}),x=T.jsx(k,S({},C)),_=v==null?void 0:v.toolbar,P=Ct({elementType:_,externalSlotProps:g==null?void 0:g.toolbar,additionalProps:{isLandscape:p,onChange:u,value:c,view:a,onViewChange:l,views:o,disabled:f,readOnly:m},className:b.toolbar,ownerState:S({},t,{wrapperVariant:e})}),R=mK(P)&&_?T.jsx(_,S({},P)):null,E=y,D=v==null?void 0:v.tabs,$=a&&D?T.jsx(D,S({view:a,onViewChange:l,className:b.tabs},g==null?void 0:g.tabs)):null,I=(v==null?void 0:v.shortcuts)??pK,F=Ct({elementType:I,externalSlotProps:g==null?void 0:g.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:d},className:b.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:d,wrapperVariant:e}}),M=a&&I?T.jsx(I,S({},F)):null;return{toolbar:R,content:E,tabs:$,actionBar:x,shortcuts:M}},bK=t=>{const{isLandscape:e,classes:r}=t;return $e({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},bR,r)},vK=K("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${al.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${al.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${al.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${al.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${al.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${al.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${al.shortcuts}`]:{gridColumn:3}}}]}),wK=K("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),vR=function(e){const r=Ae({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:n,tabs:s,actionBar:a,shortcuts:o}=yK(r),{sx:l,className:c,isLandscape:u,ref:d,wrapperVariant:h}=r,p=bK(r);return T.jsxs(vK,{ref:d,sx:l,className:xe(c,p.root),ownerState:r,children:[u?o:i,u?i:o,T.jsx(wK,{className:p.contentWrapper,children:h==="desktop"?T.jsxs(w.Fragment,{children:[n,s]}):T.jsxs(w.Fragment,{children:[s,n]})}),a]})},SK=["props","getOpenDialogAriaText"],xK=["ownerState"],kK=["ownerState"],wR=t=>{var X;let{props:e,getOpenDialogAriaText:r}=t,i=oe(t,SK);const{slots:n,slotProps:s,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,name:f,label:m,inputRef:y,readOnly:v,disabled:g,autoFocus:b,localeText:k,reduceAnimations:C}=e,x=qt(),_=w.useRef(null),P=w.useRef(null),R=ia(),E=((X=s==null?void 0:s.toolbar)==null?void 0:X.hidden)??!1,{open:D,actions:$,hasUIView:I,layoutProps:F,renderCurrentView:M,shouldRestoreFocus:O,fieldProps:A}=yR(S({},i,{props:e,fieldRef:P,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),N=n.inputAdornment??YN,V=Ct({elementType:N,externalSlotProps:s==null?void 0:s.inputAdornment,additionalProps:{position:"end"},ownerState:e}),W=oe(V,xK),Q=n.openPickerButton??yn,ne=Ct({elementType:Q,externalSlotProps:s==null?void 0:s.openPickerButton,additionalProps:{disabled:g||v,onClick:D?$.onClose:$.onOpen,"aria-label":r(A.value,x),edge:W.position},ownerState:e}),ie=oe(ne,kK),te=n.openPickerIcon,j=n.field,J=Ct({elementType:j,externalSlotProps:s==null?void 0:s.field,additionalProps:S({},A,E&&{id:R},{readOnly:v,disabled:g,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,label:m,name:f,autoFocus:b&&!e.open,focused:D?!0:void 0},y?{inputRef:y}:{}),ownerState:e});I&&(J.InputProps=S({},J.InputProps,{ref:_},!e.disableOpenPicker&&{[`${W.position}Adornment`]:T.jsx(N,S({},W,{children:T.jsx(Q,S({},ie,{children:T.jsx(te,S({},s==null?void 0:s.openPickerIcon))}))}))}));const pe=S({textField:n.textField,clearIcon:n.clearIcon,clearButton:n.clearButton},J.slots),fe=n.layout??vR;let Me=R;E&&(m?Me=`${R}-label`:Me=void 0);const _e=S({},s,{toolbar:S({},s==null?void 0:s.toolbar,{titleId:R}),popper:S({"aria-labelledby":Me},s==null?void 0:s.popper)}),ke=Wt(P,J.unstableFieldRef);return{renderPicker:()=>T.jsxs(fS,{localeText:k,children:[T.jsx(j,S({},J,{slots:pe,slotProps:_e,unstableFieldRef:ke})),T.jsx(eK,S({role:"dialog",placement:"bottom-start",anchorEl:_.current},$,{open:D,slots:n,slotProps:_e,shouldRestoreFocus:O,reduceAnimations:C,children:T.jsx(fe,S({},F,_e==null?void 0:_e.layout,{slots:n,slotProps:_e,children:M()}))}))]})}},Uc=({view:t,onViewChange:e,views:r,focusedView:i,onFocusedViewChange:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:m,shouldDisableMonth:y,shouldDisableYear:v,reduceAnimations:g,onMonthChange:b,monthsPerRow:k,onYearChange:C,yearsPerRow:x,slots:_,slotProps:P,loading:R,renderLoading:E,disableHighlightToday:D,readOnly:$,disabled:I,showDaysOutsideCurrentMonth:F,dayOfWeekFormatter:M,sx:O,autoFocus:A,fixedWeekNumber:N,displayWeekNumber:V,timezone:W})=>T.jsx(Fq,{view:t,onViewChange:e,views:r.filter(uC),focusedView:i&&uC(i)?i:null,onFocusedViewChange:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:m,shouldDisableMonth:y,shouldDisableYear:v,reduceAnimations:g,onMonthChange:b,monthsPerRow:k,onYearChange:C,yearsPerRow:x,slots:_,slotProps:P,loading:R,renderLoading:E,disableHighlightToday:D,readOnly:$,disabled:I,showDaysOutsideCurrentMonth:F,dayOfWeekFormatter:M,sx:O,autoFocus:A,fixedWeekNumber:N,displayWeekNumber:V,timezone:W}),SR=w.forwardRef(function(e,r){var c,u;const i=rn(),n=qt(),s=mR(e,"MuiDesktopDatePicker"),a=S({day:Uc,month:Uc,year:Uc},s.viewRenderers),o=S({},s,{viewRenderers:a,format:bS(n,s,!1),yearsPerRow:s.yearsPerRow??4,slots:S({openPickerIcon:Tj,field:oR},s.slots),slotProps:S({},s.slotProps,{field:d=>{var h;return S({},Wh((h=s.slotProps)==null?void 0:h.field,d),ty(s),{ref:r})},toolbar:S({hidden:!0},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=wR({props:o,valueManager:en,valueType:"date",getOpenDialogAriaText:((u=o.localeText)==null?void 0:u.openDatePickerDialogue)??i.openDatePickerDialogue,validator:ey});return l()});SR.propTypes={autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,dayOfWeekFormatter:z.func,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableHighlightToday:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,displayWeekNumber:z.bool,enableAccessibleFieldDOMStructure:z.any,fixedWeekNumber:z.number,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,loading:z.bool,localeText:z.object,maxDate:z.object,minDate:z.object,monthsPerRow:z.oneOf([3,4]),name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onMonthChange:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,onYearChange:z.func,open:z.bool,openTo:z.oneOf(["day","month","year"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,renderLoading:z.func,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableDate:z.func,shouldDisableMonth:z.func,shouldDisableYear:z.func,showDaysOutsideCurrentMonth:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["day","month","year"]),viewRenderers:z.shape({day:z.func,month:z.func,year:z.func}),views:z.arrayOf(z.oneOf(["day","month","year"]).isRequired),yearsPerRow:z.oneOf([3,4])};const CK=K(Gg)({[`& .${Ed.container}`]:{outline:0},[`& .${Ed.paper}`]:{outline:0,minWidth:Qg}}),TK=K(FN)({"&:first-of-type":{padding:0}});function _K(t){const{children:e,onDismiss:r,open:i,slots:n,slotProps:s}=t,a=(n==null?void 0:n.dialog)??CK,o=(n==null?void 0:n.mobileTransition)??Cu;return T.jsx(a,S({open:i,onClose:r},s==null?void 0:s.dialog,{TransitionComponent:o,TransitionProps:s==null?void 0:s.mobileTransition,PaperComponent:n==null?void 0:n.mobilePaper,PaperProps:s==null?void 0:s.mobilePaper,children:T.jsx(TK,{children:e})}))}const BK=["props","getOpenDialogAriaText"],xR=t=>{var Q;let{props:e,getOpenDialogAriaText:r}=t,i=oe(t,BK);const{slots:n,slotProps:s,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,name:f,label:m,inputRef:y,readOnly:v,disabled:g,localeText:b}=e,k=qt(),C=w.useRef(null),x=ia(),_=((Q=s==null?void 0:s.toolbar)==null?void 0:Q.hidden)??!1,{open:P,actions:R,layoutProps:E,renderCurrentView:D,fieldProps:$}=yR(S({},i,{props:e,fieldRef:C,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),I=n.field,F=Ct({elementType:I,externalSlotProps:s==null?void 0:s.field,additionalProps:S({},$,_&&{id:x},!(g||v)&&{onClick:R.onOpen,onKeyDown:xY(R.onOpen)},{readOnly:v??!0,disabled:g,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,label:m,name:f},y?{inputRef:y}:{}),ownerState:e});F.inputProps=S({},F.inputProps,{"aria-label":r($.value,k)});const M=S({textField:n.textField},F.slots),O=n.layout??vR;let A=x;_&&(m?A=`${x}-label`:A=void 0);const N=S({},s,{toolbar:S({},s==null?void 0:s.toolbar,{titleId:x}),mobilePaper:S({"aria-labelledby":A},s==null?void 0:s.mobilePaper)}),V=Wt(C,F.unstableFieldRef);return{renderPicker:()=>T.jsxs(fS,{localeText:b,children:[T.jsx(I,S({},F,{slots:M,slotProps:N,unstableFieldRef:V})),T.jsx(_K,S({},R,{open:P,slots:n,slotProps:N,children:T.jsx(O,S({},E,N==null?void 0:N.layout,{slots:n,slotProps:N,children:D()}))}))]})}},kR=w.forwardRef(function(e,r){var c,u;const i=rn(),n=qt(),s=mR(e,"MuiMobileDatePicker"),a=S({day:Uc,month:Uc,year:Uc},s.viewRenderers),o=S({},s,{viewRenderers:a,format:bS(n,s,!1),slots:S({field:oR},s.slots),slotProps:S({},s.slotProps,{field:d=>{var h;return S({},Wh((h=s.slotProps)==null?void 0:h.field,d),ty(s),{ref:r})},toolbar:S({hidden:!1},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=xR({props:o,valueManager:en,valueType:"date",getOpenDialogAriaText:((u=o.localeText)==null?void 0:u.openDatePickerDialogue)??i.openDatePickerDialogue,validator:ey});return l()});kR.propTypes={autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,dayOfWeekFormatter:z.func,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableHighlightToday:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,displayWeekNumber:z.bool,enableAccessibleFieldDOMStructure:z.any,fixedWeekNumber:z.number,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,loading:z.bool,localeText:z.object,maxDate:z.object,minDate:z.object,monthsPerRow:z.oneOf([3,4]),name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onMonthChange:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,onYearChange:z.func,open:z.bool,openTo:z.oneOf(["day","month","year"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,renderLoading:z.func,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableDate:z.func,shouldDisableMonth:z.func,shouldDisableYear:z.func,showDaysOutsideCurrentMonth:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["day","month","year"]),viewRenderers:z.shape({day:z.func,month:z.func,year:z.func}),views:z.arrayOf(z.oneOf(["day","month","year"]).isRequired),yearsPerRow:z.oneOf([3,4])};const PK=["desktopModeMediaQuery"],NK=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:n=YE}=i,s=oe(i,PK);return Mw(n,{defaultMatches:!0})?T.jsx(SR,S({ref:r},s)):T.jsx(kR,S({ref:r},s))});function EK(t){return He("MuiPickersToolbarText",t)}const CC=Ue("MuiPickersToolbarText",["root","selected"]),RK=["className","selected","value"],MK=t=>{const{classes:e,selected:r}=t;return $e({root:["root",r&&"selected"]},EK,e)},DK=K(Mr,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${CC.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${CC.selected}`]:{color:(t.vars||t).palette.text.primary}})),CR=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersToolbarText"}),{className:n,value:s}=i,a=oe(i,RK),o=MK(i);return T.jsx(DK,S({ref:r,className:xe(n,o.root),component:"span"},a,{children:s}))}),LK=["align","className","selected","typographyClassName","value","variant","width"],FK=t=>{const{classes:e}=t;return $e({root:["root"]},fR,e)},IK=K(Va,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),rd=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiPickersToolbarButton"}),{align:n,className:s,selected:a,typographyClassName:o,value:l,variant:c,width:u}=i,d=oe(i,LK),h=FK(i);return T.jsx(IK,S({variant:"text",ref:r,className:xe(s,h.root)},u?{sx:{width:u}}:{},d,{children:T.jsx(CR,{align:n,className:o,variant:c,value:l,selected:a})}))});function OK(t){return He("MuiTimePickerToolbar",t)}const Dd=Ue("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),AK=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],VK=t=>{const{isLandscape:e,classes:r,isRtl:i}=t;return $e({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",e&&"hourMinuteLabelLandscape",i&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",e&&"ampmLandscape"],ampmLabel:["ampmLabel"]},OK,r)},$K=K(pR,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),zK=K(CR,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),WK=K("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(t,e)=>[{[`&.${Dd.hourMinuteLabelLandscape}`]:e.hourMinuteLabelLandscape,[`&.${Dd.hourMinuteLabelReverse}`]:e.hourMinuteLabelReverse},e.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),HK=K("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${Dd.ampmLabel}`]:e.ampmLabel},{[`&.${Dd.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Dd.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function UK(t){const e=Ae({props:t,name:"MuiTimePickerToolbar"}),{ampm:r,ampmInClock:i,value:n,isLandscape:s,onChange:a,view:o,onViewChange:l,views:c,disabled:u,readOnly:d,className:h}=e,p=oe(e,AK),f=qt(),m=rn(),y=Xi(),v=!!(r&&!i&&c.includes("hours")),{meridiemMode:g,handleMeridiemChange:b}=pS(n,r,a),k=P=>r?f.format(P,"hours12h"):f.format(P,"hours24h"),C=S({},e,{isRtl:y}),x=VK(C),_=T.jsx(zK,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:x.separator});return T.jsxs($K,S({landscapeDirection:"row",toolbarTitle:m.timePickerToolbarTitle,isLandscape:s,ownerState:C,className:xe(x.root,h)},p,{children:[T.jsxs(WK,{className:x.hourMinuteLabel,ownerState:C,children:[mc(c,"hours")&&T.jsx(rd,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:o==="hours",value:n?k(n):"--"}),mc(c,["hours","minutes"])&&_,mc(c,"minutes")&&T.jsx(rd,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:o==="minutes",value:n?f.format(n,"minutes"):"--"}),mc(c,["minutes","seconds"])&&_,mc(c,"seconds")&&T.jsx(rd,{variant:"h3",onClick:()=>l("seconds"),selected:o==="seconds",value:n?f.format(n,"seconds"):"--"})]}),v&&T.jsxs(HK,{className:x.ampmSelection,ownerState:C,children:[T.jsx(rd,{disableRipple:!0,variant:"subtitle2",selected:g==="am",typographyClassName:x.ampmLabel,value:Co(f,"am"),onClick:d?void 0:()=>b("am"),disabled:u}),T.jsx(rd,{disableRipple:!0,variant:"subtitle2",selected:g==="pm",typographyClassName:x.ampmLabel,value:Co(f,"pm"),onClick:d?void 0:()=>b("pm"),disabled:u})]})]}))}function TR(t,e){var a;const r=qt(),i=Ae({props:t,name:e}),n=i.ampm??r.is12HourCycleInCurrentLocale(),s=w.useMemo(()=>{var o;return((o=i.localeText)==null?void 0:o.toolbarTitle)==null?i.localeText:S({},i.localeText,{timePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return S({},i,{ampm:n,localeText:s},EE({views:i.views,openTo:i.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,slots:S({toolbar:UK},i.slots),slotProps:S({},i.slotProps,{toolbar:S({ampm:n,ampmInClock:i.ampmInClock},(a=i.slotProps)==null?void 0:a.toolbar)})})}const rb=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,ampmInClock:g,slots:b,slotProps:k,readOnly:C,disabled:x,sx:_,autoFocus:P,showViewSwitcher:R,disableIgnoringDatePartForTimeValidation:E,timezone:D})=>T.jsx($9,{view:t,onViewChange:e,focusedView:r&&dh(r)?r:null,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,ampmInClock:g,slots:b,slotProps:k,readOnly:C,disabled:x,sx:_,autoFocus:P,showViewSwitcher:R,disableIgnoringDatePartForTimeValidation:E,timezone:D}),GK=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D})=>T.jsx(Y9,{view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeStep:R==null?void 0:R.minutes,skipDisabled:E,timezone:D}),TC=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D})=>T.jsx(sY,{view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D}),jK=(t,e,r)=>r?e.filter(i=>!Fj(i)||i==="hours"):t?[...e,"meridiem"]:e,YK=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function XK({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:r,views:i}){const n=t??24,s=S({hours:1,minutes:5,seconds:5},r),a=YK(s,n);return{thresholdToRenderTimeInASingleColumn:n,timeSteps:s,shouldRenderTimeInASingleColumn:a,views:jK(e,i,a)}}const _R=w.forwardRef(function(e,r){var v,g,b,k;const i=rn(),n=qt(),s=TR(e,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:a,views:o,timeSteps:l}=XK(s),c=a?GK:TC,u=S({hours:c,minutes:c,seconds:c,meridiem:c},s.viewRenderers),d=s.ampmInClock??!0,h=a?[]:["accept"],f=((v=u.hours)==null?void 0:v.name)===TC.name?o:o.filter(C=>C!=="meridiem"),m=S({},s,{ampmInClock:d,timeSteps:l,viewRenderers:u,format:ME(n,s),views:a?["hours"]:f,slots:S({field:lR,openPickerIcon:_j},s.slots),slotProps:S({},s.slotProps,{field:C=>{var x;return S({},Wh((x=s.slotProps)==null?void 0:x.field,C),ty(s),{ref:r})},toolbar:S({hidden:!0,ampmInClock:d},(g=s.slotProps)==null?void 0:g.toolbar),actionBar:S({actions:h},(b=s.slotProps)==null?void 0:b.actionBar)})}),{renderPicker:y}=wR({props:m,valueManager:en,valueType:"time",getOpenDialogAriaText:((k=m.localeText)==null?void 0:k.openTimePickerDialogue)??i.openTimePickerDialogue,validator:TS});return y()});_R.propTypes={ampm:z.bool,ampmInClock:z.bool,autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableIgnoringDatePartForTimeValidation:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,enableAccessibleFieldDOMStructure:z.any,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,localeText:z.object,maxTime:z.object,minTime:z.object,minutesStep:z.number,name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,open:z.bool,openTo:z.oneOf(["hours","meridiem","minutes","seconds"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableTime:z.func,skipDisabled:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),thresholdToRenderTimeInASingleColumn:z.number,timeSteps:z.shape({hours:z.number,minutes:z.number,seconds:z.number}),timezone:z.string,value:z.object,view:z.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:z.shape({hours:z.func,meridiem:z.func,minutes:z.func,seconds:z.func}),views:z.arrayOf(z.oneOf(["hours","minutes","seconds"]).isRequired)};const BR=w.forwardRef(function(e,r){var u,d;const i=rn(),n=qt(),s=TR(e,"MuiMobileTimePicker"),a=S({hours:rb,minutes:rb,seconds:rb},s.viewRenderers),o=s.ampmInClock??!1,l=S({},s,{ampmInClock:o,viewRenderers:a,format:ME(n,s),slots:S({field:lR},s.slots),slotProps:S({},s.slotProps,{field:h=>{var p;return S({},Wh((p=s.slotProps)==null?void 0:p.field,h),ty(s),{ref:r})},toolbar:S({hidden:!1,ampmInClock:o},(u=s.slotProps)==null?void 0:u.toolbar)})}),{renderPicker:c}=xR({props:l,valueManager:en,valueType:"time",getOpenDialogAriaText:((d=l.localeText)==null?void 0:d.openTimePickerDialogue)??i.openTimePickerDialogue,validator:TS});return c()});BR.propTypes={ampm:z.bool,ampmInClock:z.bool,autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableIgnoringDatePartForTimeValidation:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,enableAccessibleFieldDOMStructure:z.any,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,localeText:z.object,maxTime:z.object,minTime:z.object,minutesStep:z.number,name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,open:z.bool,openTo:z.oneOf(["hours","minutes","seconds"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableTime:z.func,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["hours","minutes","seconds"]),viewRenderers:z.shape({hours:z.func,minutes:z.func,seconds:z.func}),views:z.arrayOf(z.oneOf(["hours","minutes","seconds"]).isRequired)};const qK=["desktopModeMediaQuery"],_C=w.forwardRef(function(e,r){const i=Ae({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:n=YE}=i,s=oe(i,qK);return Mw(n,{defaultMatches:!0})?T.jsx(_R,S({ref:r},s)):T.jsx(BR,S({ref:r},s))});var Kh=t=>t.type==="checkbox",Rc=t=>t instanceof Date,un=t=>t==null;const PR=t=>typeof t=="object";var Li=t=>!un(t)&&!Array.isArray(t)&&PR(t)&&!Rc(t),NR=t=>Li(t)&&t.target?Kh(t.target)?t.target.checked:t.target.value:t,KK=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,ER=(t,e)=>t.has(KK(e)),QK=t=>{const e=t.constructor&&t.constructor.prototype;return Li(e)&&e.hasOwnProperty("isPrototypeOf")},_S=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Sn(t){let e;const r=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(_S&&(t instanceof Blob||t instanceof FileList))&&(r||Li(t)))if(e=r?[]:{},!r&&!QK(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=Sn(t[i]));else return t;return e}var Qh=t=>Array.isArray(t)?t.filter(Boolean):[],ni=t=>t===void 0,je=(t,e,r)=>{if(!e||!Li(t))return r;const i=Qh(e.split(/[,[\].]+?/)).reduce((n,s)=>un(n)?n:n[s],t);return ni(i)||i===t?ni(t[e])?r:t[e]:i},pa=t=>typeof t=="boolean",BS=t=>/^\w*$/.test(t),RR=t=>Qh(t.replace(/["|']|\]/g,"").split(/\.|\[/)),yr=(t,e,r)=>{let i=-1;const n=BS(e)?[e]:RR(e),s=n.length,a=s-1;for(;++iAt.useContext(JK);var MR=(t,e,r,i=!0)=>{const n={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(n,s,{get:()=>{const a=s;return e._proxyFormState[a]!==Us.all&&(e._proxyFormState[a]=!i||Us.all),r&&(r[a]=!0),t[a]}});return n},An=t=>Li(t)&&!Object.keys(t).length,DR=(t,e,r,i)=>{r(t);const{name:n,...s}=t;return An(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!i||Us.all))},yp=t=>Array.isArray(t)?t:[t],LR=(t,e,r)=>!t||!e||t===e||yp(t).some(i=>i&&(r?i===e:i.startsWith(e)||e.startsWith(i)));function NS(t){const e=At.useRef(t);e.current=t,At.useEffect(()=>{const r=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{r&&r.unsubscribe()}},[t.disabled])}function ZK(t){const e=PS(),{control:r=e.control,disabled:i,name:n,exact:s}=t||{},[a,o]=At.useState(r._formState),l=At.useRef(!0),c=At.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=At.useRef(n);return u.current=n,NS({disabled:i,next:d=>l.current&&LR(u.current,d.name,s)&&DR(d,c.current,r._updateFormState)&&o({...r._formState,...d}),subject:r._subjects.state}),At.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),MR(a,r,c.current,!1)}var ya=t=>typeof t=="string",FR=(t,e,r,i,n)=>ya(t)?(i&&e.watch.add(t),je(r,t,n)):Array.isArray(t)?t.map(s=>(i&&e.watch.add(s),je(r,s))):(i&&(e.watchAll=!0),r);function eQ(t){const e=PS(),{control:r=e.control,name:i,defaultValue:n,disabled:s,exact:a}=t||{},o=At.useRef(i);o.current=i,NS({disabled:s,subject:r._subjects.values,next:u=>{LR(o.current,u.name,a)&&c(Sn(FR(o.current,r._names,u.values||r._formValues,!1,n)))}});const[l,c]=At.useState(r._getWatch(i,n));return At.useEffect(()=>r._removeUnmounted()),l}function tQ(t){const e=PS(),{name:r,disabled:i,control:n=e.control,shouldUnregister:s}=t,a=ER(n._names.array,r),o=eQ({control:n,name:r,defaultValue:je(n._formValues,r,je(n._defaultValues,r,t.defaultValue)),exact:!0}),l=ZK({control:n,name:r}),c=At.useRef(n.register(r,{...t.rules,value:o,...pa(t.disabled)?{disabled:t.disabled}:{}}));return At.useEffect(()=>{const u=n._options.shouldUnregister||s,d=(h,p)=>{const f=je(n._fields,h);f&&f._f&&(f._f.mount=p)};if(d(r,!0),u){const h=Sn(je(n._options.defaultValues,r));yr(n._defaultValues,r,h),ni(je(n._formValues,r))&&yr(n._formValues,r,h)}return()=>{(a?u&&!n._state.action:u)?n.unregister(r):d(r,!1)}},[r,n,a,s]),At.useEffect(()=>{je(n._fields,r)&&n._updateDisabledField({disabled:i,fields:n._fields,name:r,value:je(n._fields,r)._f.value})},[i,r,n]),{field:{name:r,value:o,...pa(i)||l.disabled?{disabled:l.disabled||i}:{},onChange:At.useCallback(u=>c.current.onChange({target:{value:NR(u),name:r},type:um.CHANGE}),[r]),onBlur:At.useCallback(()=>c.current.onBlur({target:{value:je(n._formValues,r),name:r},type:um.BLUR}),[r,n]),ref:u=>{const d=je(n._fields,r);d&&u&&(d._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:h=>u.setCustomValidity(h),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!je(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!je(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!je(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!je(l.validatingFields,r)},error:{enumerable:!0,get:()=>je(l.errors,r)}})}}const ib=t=>t.render(tQ(t));var rQ=(t,e,r,i,n)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[i]:n||!0}}:{},BC=t=>({isOnSubmit:!t||t===Us.onSubmit,isOnBlur:t===Us.onBlur,isOnChange:t===Us.onChange,isOnAll:t===Us.all,isOnTouch:t===Us.onTouched}),PC=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(i=>t.startsWith(i)&&/^\.\w+/.test(t.slice(i.length))));const Ld=(t,e,r,i)=>{for(const n of r||Object.keys(t)){const s=je(t,n);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],n)&&!i)break;if(a.ref&&e(a.ref,a.name)&&!i)break;Ld(o,e)}else Li(o)&&Ld(o,e)}}};var iQ=(t,e,r)=>{const i=Qh(je(t,r));return yr(i,"root",e[r]),yr(t,r,i),t},ES=t=>t.type==="file",To=t=>typeof t=="function",dm=t=>{if(!_S)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},bp=t=>ya(t),RS=t=>t.type==="radio",hm=t=>t instanceof RegExp;const NC={value:!1,isValid:!1},EC={value:!0,isValid:!0};var IR=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!ni(t[0].attributes.value)?ni(t[0].value)||t[0].value===""?EC:{value:t[0].value,isValid:!0}:EC:NC}return NC};const RC={isValid:!1,value:null};var OR=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,RC):RC;function MC(t,e,r="validate"){if(bp(t)||Array.isArray(t)&&t.every(bp)||pa(t)&&!t)return{type:r,message:bp(t)?t:"",ref:e}}var cc=t=>Li(t)&&!hm(t)?t:{value:t,message:""},DC=async(t,e,r,i,n)=>{const{ref:s,refs:a,required:o,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:p,name:f,valueAsNumber:m,mount:y,disabled:v}=t._f,g=je(e,f);if(!y||v)return{};const b=a?a[0]:s,k=$=>{i&&b.reportValidity&&(b.setCustomValidity(pa($)?"":$||""),b.reportValidity())},C={},x=RS(s),_=Kh(s),P=x||_,R=(m||ES(s))&&ni(s.value)&&ni(g)||dm(s)&&s.value===""||g===""||Array.isArray(g)&&!g.length,E=rQ.bind(null,f,r,C),D=($,I,F,M=Na.maxLength,O=Na.minLength)=>{const A=$?I:F;C[f]={type:$?M:O,message:A,ref:s,...E($?M:O,A)}};if(n?!Array.isArray(g)||!g.length:o&&(!P&&(R||un(g))||pa(g)&&!g||_&&!IR(a).isValid||x&&!OR(a).isValid)){const{value:$,message:I}=bp(o)?{value:!!o,message:o}:cc(o);if($&&(C[f]={type:Na.required,message:I,ref:b,...E(Na.required,I)},!r))return k(I),C}if(!R&&(!un(u)||!un(d))){let $,I;const F=cc(d),M=cc(u);if(!un(g)&&!isNaN(g)){const O=s.valueAsNumber||g&&+g;un(F.value)||($=O>F.value),un(M.value)||(I=Onew Date(new Date().toDateString()+" "+W),N=s.type=="time",V=s.type=="week";ya(F.value)&&g&&($=N?A(g)>A(F.value):V?g>F.value:O>new Date(F.value)),ya(M.value)&&g&&(I=N?A(g)+$.value,M=!un(I.value)&&g.length<+I.value;if((F||M)&&(D(F,$.message,I.message),!r))return k(C[f].message),C}if(h&&!R&&ya(g)){const{value:$,message:I}=cc(h);if(hm($)&&!g.match($)&&(C[f]={type:Na.pattern,message:I,ref:s,...E(Na.pattern,I)},!r))return k(I),C}if(p){if(To(p)){const $=await p(g,e),I=MC($,b);if(I&&(C[f]={...I,...E(Na.validate,I.message)},!r))return k(I.message),C}else if(Li(p)){let $={};for(const I in p){if(!An($)&&!r)break;const F=MC(await p[I](g,e),b,I);F&&($={...F,...E(I,F.message)},k(F.message),r&&(C[f]=$))}if(!An($)&&(C[f]={ref:b,...$},!r))return C}}return k(!0),C};function nQ(t,e){const r=e.slice(0,-1).length;let i=0;for(;i{let t=[];return{get observers(){return t},next:n=>{for(const s of t)s.next&&s.next(n)},subscribe:n=>(t.push(n),{unsubscribe:()=>{t=t.filter(s=>s!==n)}}),unsubscribe:()=>{t=[]}}},fm=t=>un(t)||!PR(t);function wl(t,e){if(fm(t)||fm(e))return t===e;if(Rc(t)&&Rc(e))return t.getTime()===e.getTime();const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const n of r){const s=t[n];if(!i.includes(n))return!1;if(n!=="ref"){const a=e[n];if(Rc(s)&&Rc(a)||Li(s)&&Li(a)||Array.isArray(s)&&Array.isArray(a)?!wl(s,a):s!==a)return!1}}return!0}var AR=t=>t.type==="select-multiple",aQ=t=>RS(t)||Kh(t),sb=t=>dm(t)&&t.isConnected,VR=t=>{for(const e in t)if(To(t[e]))return!0;return!1};function pm(t,e={}){const r=Array.isArray(t);if(Li(t)||r)for(const i in t)Array.isArray(t[i])||Li(t[i])&&!VR(t[i])?(e[i]=Array.isArray(t[i])?[]:{},pm(t[i],e[i])):un(t[i])||(e[i]=!0);return e}function $R(t,e,r){const i=Array.isArray(t);if(Li(t)||i)for(const n in t)Array.isArray(t[n])||Li(t[n])&&!VR(t[n])?ni(e)||fm(r[n])?r[n]=Array.isArray(t[n])?pm(t[n],[]):{...pm(t[n])}:$R(t[n],un(e)?{}:e[n],r[n]):r[n]=!wl(t[n],e[n]);return r}var Vf=(t,e)=>$R(t,e,pm(e)),zR=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:i})=>ni(t)?t:e?t===""?NaN:t&&+t:r&&ya(t)?new Date(t):i?i(t):t;function ab(t){const e=t.ref;if(!(t.refs?t.refs.every(r=>r.disabled):e.disabled))return ES(e)?e.files:RS(e)?OR(t.refs).value:AR(e)?[...e.selectedOptions].map(({value:r})=>r):Kh(e)?IR(t.refs).value:zR(ni(e.value)?t.ref.value:e.value,t)}var oQ=(t,e,r,i)=>{const n={};for(const s of t){const a=je(e,s);a&&yr(n,s,a._f)}return{criteriaMode:r,names:[...t],fields:n,shouldUseNativeValidation:i}},id=t=>ni(t)?t:hm(t)?t.source:Li(t)?hm(t.value)?t.value.source:t.value:t,lQ=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function LC(t,e,r){const i=je(t,r);if(i||BS(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const s=n.join("."),a=je(e,s),o=je(t,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};n.pop()}return{name:r}}var cQ=(t,e,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(e||t):(r?i.isOnBlur:n.isOnBlur)?!t:(r?i.isOnChange:n.isOnChange)?t:!0,uQ=(t,e)=>!Qh(je(t,e)).length&&Pi(t,e);const dQ={mode:Us.onSubmit,reValidateMode:Us.onChange,shouldFocusError:!0};function hQ(t={}){let e={...dQ,...t},r={submitCount:0,isDirty:!1,isLoading:To(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},i={},n=Li(e.defaultValues)||Li(e.values)?Sn(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Sn(n),a={action:!1,mount:!1,watch:!1},o={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:nb(),array:nb(),state:nb()},h=BC(e.mode),p=BC(e.reValidateMode),f=e.criteriaMode===Us.all,m=L=>U=>{clearTimeout(c),c=setTimeout(L,U)},y=async L=>{if(u.isValid||L){const U=e.resolver?An((await P()).errors):await E(i,!0);U!==r.isValid&&d.state.next({isValid:U})}},v=(L,U)=>{(u.isValidating||u.validatingFields)&&((L||Array.from(o.mount)).forEach(G=>{G&&(U?yr(r.validatingFields,G,U):Pi(r.validatingFields,G))}),d.state.next({validatingFields:r.validatingFields,isValidating:!An(r.validatingFields)}))},g=(L,U=[],G,re,we=!0,me=!0)=>{if(re&&G){if(a.action=!0,me&&Array.isArray(je(i,L))){const Ee=G(je(i,L),re.argA,re.argB);we&&yr(i,L,Ee)}if(me&&Array.isArray(je(r.errors,L))){const Ee=G(je(r.errors,L),re.argA,re.argB);we&&yr(r.errors,L,Ee),uQ(r.errors,L)}if(u.touchedFields&&me&&Array.isArray(je(r.touchedFields,L))){const Ee=G(je(r.touchedFields,L),re.argA,re.argB);we&&yr(r.touchedFields,L,Ee)}u.dirtyFields&&(r.dirtyFields=Vf(n,s)),d.state.next({name:L,isDirty:$(L,U),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else yr(s,L,U)},b=(L,U)=>{yr(r.errors,L,U),d.state.next({errors:r.errors})},k=L=>{r.errors=L,d.state.next({errors:r.errors,isValid:!1})},C=(L,U,G,re)=>{const we=je(i,L);if(we){const me=je(s,L,ni(G)?je(n,L):G);ni(me)||re&&re.defaultChecked||U?yr(s,L,U?me:ab(we._f)):M(L,me),a.mount&&y()}},x=(L,U,G,re,we)=>{let me=!1,Ee=!1;const qe={name:L},ct=!!(je(i,L)&&je(i,L)._f&&je(i,L)._f.disabled);if(!G||re){u.isDirty&&(Ee=r.isDirty,r.isDirty=qe.isDirty=$(),me=Ee!==qe.isDirty);const Pt=ct||wl(je(n,L),U);Ee=!!(!ct&&je(r.dirtyFields,L)),Pt||ct?Pi(r.dirtyFields,L):yr(r.dirtyFields,L,!0),qe.dirtyFields=r.dirtyFields,me=me||u.dirtyFields&&Ee!==!Pt}if(G){const Pt=je(r.touchedFields,L);Pt||(yr(r.touchedFields,L,G),qe.touchedFields=r.touchedFields,me=me||u.touchedFields&&Pt!==G)}return me&&we&&d.state.next(qe),me?qe:{}},_=(L,U,G,re)=>{const we=je(r.errors,L),me=u.isValid&&pa(U)&&r.isValid!==U;if(t.delayError&&G?(l=m(()=>b(L,G)),l(t.delayError)):(clearTimeout(c),l=null,G?yr(r.errors,L,G):Pi(r.errors,L)),(G?!wl(we,G):we)||!An(re)||me){const Ee={...re,...me&&pa(U)?{isValid:U}:{},errors:r.errors,name:L};r={...r,...Ee},d.state.next(Ee)}},P=async L=>{v(L,!0);const U=await e.resolver(s,e.context,oQ(L||o.mount,i,e.criteriaMode,e.shouldUseNativeValidation));return v(L),U},R=async L=>{const{errors:U}=await P(L);if(L)for(const G of L){const re=je(U,G);re?yr(r.errors,G,re):Pi(r.errors,G)}else r.errors=U;return U},E=async(L,U,G={valid:!0})=>{for(const re in L){const we=L[re];if(we){const{_f:me,...Ee}=we;if(me){const qe=o.array.has(me.name);v([re],!0);const ct=await DC(we,s,f,e.shouldUseNativeValidation&&!U,qe);if(v([re]),ct[me.name]&&(G.valid=!1,U))break;!U&&(je(ct,me.name)?qe?iQ(r.errors,ct,me.name):yr(r.errors,me.name,ct[me.name]):Pi(r.errors,me.name))}Ee&&await E(Ee,U,G)}}return G.valid},D=()=>{for(const L of o.unMount){const U=je(i,L);U&&(U._f.refs?U._f.refs.every(G=>!sb(G)):!sb(U._f.ref))&&J(L)}o.unMount=new Set},$=(L,U)=>(L&&U&&yr(s,L,U),!wl(Q(),n)),I=(L,U,G)=>FR(L,o,{...a.mount?s:ni(U)?n:ya(L)?{[L]:U}:U},G,U),F=L=>Qh(je(a.mount?s:n,L,t.shouldUnregister?je(n,L,[]):[])),M=(L,U,G={})=>{const re=je(i,L);let we=U;if(re){const me=re._f;me&&(!me.disabled&&yr(s,L,zR(U,me)),we=dm(me.ref)&&un(U)?"":U,AR(me.ref)?[...me.ref.options].forEach(Ee=>Ee.selected=we.includes(Ee.value)):me.refs?Kh(me.ref)?me.refs.length>1?me.refs.forEach(Ee=>(!Ee.defaultChecked||!Ee.disabled)&&(Ee.checked=Array.isArray(we)?!!we.find(qe=>qe===Ee.value):we===Ee.value)):me.refs[0]&&(me.refs[0].checked=!!we):me.refs.forEach(Ee=>Ee.checked=Ee.value===we):ES(me.ref)?me.ref.value="":(me.ref.value=we,me.ref.type||d.values.next({name:L,values:{...s}})))}(G.shouldDirty||G.shouldTouch)&&x(L,we,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&W(L)},O=(L,U,G)=>{for(const re in U){const we=U[re],me=`${L}.${re}`,Ee=je(i,me);(o.array.has(L)||!fm(we)||Ee&&!Ee._f)&&!Rc(we)?O(me,we,G):M(me,we,G)}},A=(L,U,G={})=>{const re=je(i,L),we=o.array.has(L),me=Sn(U);yr(s,L,me),we?(d.array.next({name:L,values:{...s}}),(u.isDirty||u.dirtyFields)&&G.shouldDirty&&d.state.next({name:L,dirtyFields:Vf(n,s),isDirty:$(L,me)})):re&&!re._f&&!un(me)?O(L,me,G):M(L,me,G),PC(L,o)&&d.state.next({...r}),d.values.next({name:a.mount?L:void 0,values:{...s}})},N=async L=>{a.mount=!0;const U=L.target;let G=U.name,re=!0;const we=je(i,G),me=()=>U.type?ab(we._f):NR(L),Ee=qe=>{re=Number.isNaN(qe)||qe===je(s,G,qe)};if(we){let qe,ct;const Pt=me(),be=L.type===um.BLUR||L.type===um.FOCUS_OUT,le=!lQ(we._f)&&!e.resolver&&!je(r.errors,G)&&!we._f.deps||cQ(be,je(r.touchedFields,G),r.isSubmitted,p,h),Ke=PC(G,o,be);yr(s,G,Pt),be?(we._f.onBlur&&we._f.onBlur(L),l&&l(0)):we._f.onChange&&we._f.onChange(L);const bt=x(G,Pt,be,!1),Tt=!An(bt)||Ke;if(!be&&d.values.next({name:G,type:L.type,values:{...s}}),le)return u.isValid&&y(),Tt&&d.state.next({name:G,...Ke?{}:bt});if(!be&&Ke&&d.state.next({...r}),e.resolver){const{errors:Fe}=await P([G]);if(Ee(Pt),re){const xt=LC(r.errors,i,G),De=LC(Fe,i,xt.name||G);qe=De.error,G=De.name,ct=An(Fe)}}else v([G],!0),qe=(await DC(we,s,f,e.shouldUseNativeValidation))[G],v([G]),Ee(Pt),re&&(qe?ct=!1:u.isValid&&(ct=await E(i,!0)));re&&(we._f.deps&&W(we._f.deps),_(G,ct,qe,bt))}},V=(L,U)=>{if(je(r.errors,U)&&L.focus)return L.focus(),1},W=async(L,U={})=>{let G,re;const we=yp(L);if(e.resolver){const me=await R(ni(L)?L:we);G=An(me),re=L?!we.some(Ee=>je(me,Ee)):G}else L?(re=(await Promise.all(we.map(async me=>{const Ee=je(i,me);return await E(Ee&&Ee._f?{[me]:Ee}:Ee)}))).every(Boolean),!(!re&&!r.isValid)&&y()):re=G=await E(i);return d.state.next({...!ya(L)||u.isValid&&G!==r.isValid?{}:{name:L},...e.resolver||!L?{isValid:G}:{},errors:r.errors}),U.shouldFocus&&!re&&Ld(i,V,L?we:o.mount),re},Q=L=>{const U={...a.mount?s:n};return ni(L)?U:ya(L)?je(U,L):L.map(G=>je(U,G))},ne=(L,U)=>({invalid:!!je((U||r).errors,L),isDirty:!!je((U||r).dirtyFields,L),error:je((U||r).errors,L),isValidating:!!je(r.validatingFields,L),isTouched:!!je((U||r).touchedFields,L)}),ie=L=>{L&&yp(L).forEach(U=>Pi(r.errors,U)),d.state.next({errors:L?r.errors:{}})},te=(L,U,G)=>{const re=(je(i,L,{_f:{}})._f||{}).ref,we=je(r.errors,L)||{},{ref:me,message:Ee,type:qe,...ct}=we;yr(r.errors,L,{...ct,...U,ref:re}),d.state.next({name:L,errors:r.errors,isValid:!1}),G&&G.shouldFocus&&re&&re.focus&&re.focus()},j=(L,U)=>To(L)?d.values.subscribe({next:G=>L(I(void 0,U),G)}):I(L,U,!0),J=(L,U={})=>{for(const G of L?yp(L):o.mount)o.mount.delete(G),o.array.delete(G),U.keepValue||(Pi(i,G),Pi(s,G)),!U.keepError&&Pi(r.errors,G),!U.keepDirty&&Pi(r.dirtyFields,G),!U.keepTouched&&Pi(r.touchedFields,G),!U.keepIsValidating&&Pi(r.validatingFields,G),!e.shouldUnregister&&!U.keepDefaultValue&&Pi(n,G);d.values.next({values:{...s}}),d.state.next({...r,...U.keepDirty?{isDirty:$()}:{}}),!U.keepIsValid&&y()},pe=({disabled:L,name:U,field:G,fields:re,value:we})=>{if(pa(L)&&a.mount||L){const me=L?void 0:ni(we)?ab(G?G._f:je(re,U)._f):we;yr(s,U,me),x(U,me,!1,!1,!0)}},fe=(L,U={})=>{let G=je(i,L);const re=pa(U.disabled);return yr(i,L,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:L}},name:L,mount:!0,...U}}),o.mount.add(L),G?pe({field:G,disabled:U.disabled,name:L,value:U.value}):C(L,!0,U.value),{...re?{disabled:U.disabled}:{},...e.progressive?{required:!!U.required,min:id(U.min),max:id(U.max),minLength:id(U.minLength),maxLength:id(U.maxLength),pattern:id(U.pattern)}:{},name:L,onChange:N,onBlur:N,ref:we=>{if(we){fe(L,U),G=je(i,L);const me=ni(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Ee=aQ(me),qe=G._f.refs||[];if(Ee?qe.find(ct=>ct===me):me===G._f.ref)return;yr(i,L,{_f:{...G._f,...Ee?{refs:[...qe.filter(sb),me,...Array.isArray(je(n,L))?[{}]:[]],ref:{type:me.type,name:L}}:{ref:me}}}),C(L,!1,void 0,me)}else G=je(i,L,{}),G._f&&(G._f.mount=!1),(e.shouldUnregister||U.shouldUnregister)&&!(ER(o.array,L)&&a.action)&&o.unMount.add(L)}}},Me=()=>e.shouldFocusError&&Ld(i,V,o.mount),_e=L=>{pa(L)&&(d.state.next({disabled:L}),Ld(i,(U,G)=>{const re=je(i,G);re&&(U.disabled=re._f.disabled||L,Array.isArray(re._f.refs)&&re._f.refs.forEach(we=>{we.disabled=re._f.disabled||L}))},0,!1))},ke=(L,U)=>async G=>{let re;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let we=Sn(s);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:me,values:Ee}=await P();r.errors=me,we=Ee}else await E(i);if(Pi(r.errors,"root"),An(r.errors)){d.state.next({errors:{}});try{await L(we,G)}catch(me){re=me}}else U&&await U({...r.errors},G),Me(),setTimeout(Me);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:An(r.errors)&&!re,submitCount:r.submitCount+1,errors:r.errors}),re)throw re},Ce=(L,U={})=>{je(i,L)&&(ni(U.defaultValue)?A(L,Sn(je(n,L))):(A(L,U.defaultValue),yr(n,L,Sn(U.defaultValue))),U.keepTouched||Pi(r.touchedFields,L),U.keepDirty||(Pi(r.dirtyFields,L),r.isDirty=U.defaultValue?$(L,Sn(je(n,L))):$()),U.keepError||(Pi(r.errors,L),u.isValid&&y()),d.state.next({...r}))},X=(L,U={})=>{const G=L?Sn(L):n,re=Sn(G),we=An(L),me=we?n:re;if(U.keepDefaultValues||(n=G),!U.keepValues){if(U.keepDirtyValues)for(const Ee of o.mount)je(r.dirtyFields,Ee)?yr(me,Ee,je(s,Ee)):A(Ee,je(me,Ee));else{if(_S&&ni(L))for(const Ee of o.mount){const qe=je(i,Ee);if(qe&&qe._f){const ct=Array.isArray(qe._f.refs)?qe._f.refs[0]:qe._f.ref;if(dm(ct)){const Pt=ct.closest("form");if(Pt){Pt.reset();break}}}}i={}}s=t.shouldUnregister?U.keepDefaultValues?Sn(n):{}:Sn(me),d.array.next({values:{...me}}),d.values.next({values:{...me}})}o={mount:U.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!U.keepIsValid||!!U.keepDirtyValues,a.watch=!!t.shouldUnregister,d.state.next({submitCount:U.keepSubmitCount?r.submitCount:0,isDirty:we?!1:U.keepDirty?r.isDirty:!!(U.keepDefaultValues&&!wl(L,n)),isSubmitted:U.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:we?[]:U.keepDirtyValues?U.keepDefaultValues&&s?Vf(n,s):r.dirtyFields:U.keepDefaultValues&&L?Vf(n,L):U.keepDirty?r.dirtyFields:{},touchedFields:U.keepTouched?r.touchedFields:{},errors:U.keepErrors?r.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ee=(L,U)=>X(To(L)?L(s):L,U);return{control:{register:fe,unregister:J,getFieldState:ne,handleSubmit:ke,setError:te,_executeSchema:P,_getWatch:I,_getDirty:$,_updateValid:y,_removeUnmounted:D,_updateFieldArray:g,_updateDisabledField:pe,_getFieldArray:F,_reset:X,_resetDefaultValues:()=>To(e.defaultValues)&&e.defaultValues().then(L=>{ee(L,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:L=>{r={...r,...L}},_disableForm:_e,_subjects:d,_proxyFormState:u,_setErrors:k,get _fields(){return i},get _formValues(){return s},get _state(){return a},set _state(L){a=L},get _defaultValues(){return n},get _names(){return o},set _names(L){o=L},get _formState(){return r},set _formState(L){r=L},get _options(){return e},set _options(L){e={...e,...L}}},trigger:W,register:fe,handleSubmit:ke,watch:j,setValue:A,getValues:Q,reset:ee,resetField:Ce,clearErrors:ie,unregister:J,setError:te,setFocus:(L,U={})=>{const G=je(i,L),re=G&&G._f;if(re){const we=re.refs?re.refs[0]:re.ref;we.focus&&(we.focus(),U.shouldSelect&&we.select())}},getFieldState:ne}}function fQ(t={}){const e=At.useRef(),r=At.useRef(),[i,n]=At.useState({isDirty:!1,isValidating:!1,isLoading:To(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:To(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...hQ(t),formState:i});const s=e.current.control;return s._options=t,NS({subject:s._subjects.state,next:a=>{DR(a,s._proxyFormState,s._updateFormState,!0)&&n({...s._formState})}}),At.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),At.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==i.isDirty&&s._subjects.state.next({isDirty:a})}},[s,i.isDirty]),At.useEffect(()=>{t.values&&!wl(t.values,r.current)?(s._reset(t.values,s._options.resetOptions),r.current=t.values,n(a=>({...a}))):s._resetDefaultValues()},[t.values,s]),At.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),At.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),At.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=MR(i,s),e.current}var WR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r=1e3,i=6e4,n=36e5,s="millisecond",a="second",o="minute",l="hour",c="day",u="week",d="month",h="quarter",p="year",f="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var M=["th","st","nd","rd"],O=F%100;return"["+F+(M[(O-20)%10]||M[O]||M[0])+"]"}},b=function(F,M,O){var A=String(F);return!A||A.length>=M?F:""+Array(M+1-A.length).join(O)+F},k={s:b,z:function(F){var M=-F.utcOffset(),O=Math.abs(M),A=Math.floor(O/60),N=O%60;return(M<=0?"+":"-")+b(A,2,"0")+":"+b(N,2,"0")},m:function F(M,O){if(M.date()1)return F(W[0])}else{var Q=M.name;x[Q]=M,N=Q}return!A&&N&&(C=N),N||!A&&C},E=function(F,M){if(P(F))return F.clone();var O=typeof M=="object"?M:{};return O.date=F,O.args=arguments,new $(O)},D=k;D.l=R,D.i=P,D.w=function(F,M){return E(F,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var $=function(){function F(O){this.$L=R(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[_]=!0}var M=F.prototype;return M.parse=function(O){this.$d=function(A){var N=A.date,V=A.utc;if(N===null)return new Date(NaN);if(D.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var W=N.match(y);if(W){var Q=W[2]-1||0,ne=(W[7]||"0").substring(0,3);return V?new Date(Date.UTC(W[1],Q,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ne)):new Date(W[1],Q,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ne)}}return new Date(N)}(O),this.init()},M.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},M.$utils=function(){return D},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(O,A){var N=E(O);return this.startOf(A)<=N&&N<=this.endOf(A)},M.isAfter=function(O,A){return E(O)T.jsx(NK,{value:a.value,onChange:a.onChange})}),T.jsxs("div",{children:[T.jsx(ib,{name:"startTime",control:n,render:({field:a})=>T.jsx(_C,{value:a.value,onChange:a.onChange})}),T.jsx(ib,{name:"endTime",control:n,render:({field:a})=>T.jsx(_C,{value:a.value,onChange:a.onChange})})]})]}),T.jsx(LN,{children:T.jsx(Va,{onClick:s(i),children:"Submit"})})]})}function gQ(){const[t,e]=w.useState([]),[r,i]=w.useState(!1),[n,s]=w.useState(null);function a(l){var c=[...t];c[n]=l,e(c),s(null)}function o(l){e([...t,l]),i(!1)}return T.jsxs(Tu,{title:"Shifts",children:[T.jsx(Gh,{children:t.map((l,c)=>T.jsxs(T.Fragment,{children:[T.jsx(Nz,{title:l.day.format("dddd, MMMM D")+" - "+l.endTime.diff(l.startTime,"hours")+" hours",action:T.jsx(yn,{onClick:()=>s(c),children:T.jsx(oE,{})})}),T.jsx(lh,{children:l.startTime.format("h:mm a")+" to "+l.endTime.format("h:mm a")})]}))}),T.jsx(JW,{color:"primary",sx:{position:"absolute",right:16,bottom:16},onClick:()=>{i(!0)},children:T.jsx(aS,{})}),T.jsx(FC,{open:r,onClose:()=>{i(!1)},_handleSubmit:o}),T.jsx(FC,{open:n!==null,onClose:()=>{s(null)},shift:n!==null?t[n]:void 0,_handleSubmit:a})]})}var HR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r="week",i="year";return function(n,s,a){var o=s.prototype;o.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=a(this).startOf(i).add(1,i).date(c),d=a(this).endOf(r);if(u.isBefore(d))return 1}var h=a(this).startOf(i).date(c).startOf(r).subtract(1,"millisecond"),p=this.diff(h,r,!0);return p<0?a(this).startOf("week").week():Math.ceil(p)},o.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(HR);var yQ=HR.exports;const bQ=ro(yQ);var UR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},l=function(m){return(m=+m)+(m>68?1900:2e3)},c=function(m){return function(y){this[m]=+y}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var v=y.match(/([+-]|\d\d)/g),g=60*v[1]+(+v[2]||0);return g===0?0:v[0]==="+"?-g:g}(m)}],d=function(m){var y=o[m];return y&&(y.indexOf?y:y.s.concat(y.f))},h=function(m,y){var v,g=o.meridiem;if(g){for(var b=1;b<=24;b+=1)if(m.indexOf(g(b,0,y))>-1){v=b>12;break}}else v=m===(y?"pm":"PM");return v},p={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[n,c("day")],Do:[a,function(m){var y=o.ordinal,v=m.match(/\d+/);if(this.day=v[0],y)for(var g=1;g<=31;g+=1)y(g).replace(/\[|\]/g,"")===m&&(this.day=g)}],M:[s,c("month")],MM:[n,c("month")],MMM:[a,function(m){var y=d("months"),v=(d("monthsShort")||y.map(function(g){return g.slice(0,3)})).indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[a,function(m){var y=d("months").indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function f(m){var y,v;y=m,v=o&&o.formats;for(var g=(m=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,E,D){var $=D&&D.toUpperCase();return E||v[D]||r[D]||v[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(I,F,M){return F||M.slice(1)})})).match(i),b=g.length,k=0;k-1)return new Date((A==="X"?1e3:1)*O);var V=f(A)(O),W=V.year,Q=V.month,ne=V.day,ie=V.hours,te=V.minutes,j=V.seconds,J=V.milliseconds,pe=V.zone,fe=new Date,Me=ne||(W||Q?1:fe.getDate()),_e=W||fe.getFullYear(),ke=0;W&&!Q||(ke=Q>0?Q-1:fe.getMonth());var Ce=ie||0,X=te||0,ee=j||0,Y=J||0;return pe?new Date(Date.UTC(_e,ke,Me,Ce,X,ee,Y+60*pe.offset*1e3)):N?new Date(Date.UTC(_e,ke,Me,Ce,X,ee,Y)):new Date(_e,ke,Me,Ce,X,ee,Y)}catch{return new Date("")}}(C,P,x),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),D&&C!=this.format(P)&&(this.$d=new Date("")),o={}}else if(P instanceof Array)for(var I=P.length,F=1;F<=I;F+=1){_[1]=P[F-1];var M=v.apply(this,_);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}F===I&&(this.$d=new Date(""))}else b.call(this,k)}}})})(UR);var vQ=UR.exports;const wQ=ro(vQ);var GR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(i,n,s){var a=n.prototype,o=a.format;s.en.formats=r,a.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=function(d,h){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,f,m){var y=m&&m.toUpperCase();return f||h[m]||r[m]||h[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,g,b){return g||b.slice(1)})})}(l,c===void 0?{}:c);return o.call(this,u)}}})})(GR);var SQ=GR.exports;const xQ=ro(SQ);var jR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){return function(r,i,n){i.prototype.isBetween=function(s,a,o,l){var c=n(s),u=n(a),d=(l=l||"()")[0]==="(",h=l[1]===")";return(d?this.isAfter(c,o):!this.isBefore(c,o))&&(h?this.isBefore(u,o):!this.isAfter(u,o))||(d?this.isBefore(c,o):!this.isAfter(c,o))&&(h?this.isAfter(u,o):!this.isBefore(u,o))}}})})(jR);var kQ=jR.exports;const CQ=ro(kQ);var YR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){return function(r,i){var n=i.prototype,s=n.format;n.format=function(a){var o=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var c=this.$utils(),u=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return c.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}});return s.bind(this)(u)}}})})(YR);var TQ=YR.exports;const _Q=ro(TQ);ci.extend(xQ);ci.extend(bQ);ci.extend(CQ);ci.extend(_Q);const BQ=gR(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),PQ={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},NQ={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},ob=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(` +`));const e=w.useMemo(()=>S({},xj,t.localeText),[t.localeText]);return w.useMemo(()=>S({},t,{localeText:e}),[t,e])},qt=()=>ql().utils,Yh=()=>ql().defaultDates,rn=()=>ql().localeText,Kl=t=>{const e=qt(),r=w.useRef();return r.current===void 0&&(r.current=e.date(void 0,t)),r.current},kj=Tr(T.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Cj=Tr(T.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Tj=Tr(T.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),_j=Tr(T.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),Bj=Tr(T.jsxs(w.Fragment,{children:[T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),T.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");Tr(T.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");Tr(T.jsxs(w.Fragment,{children:[T.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),T.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const Pj=Tr(T.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function Nj(t){return Ue("MuiPickersArrowSwitcher",t)}Ge("MuiPickersArrowSwitcher",["root","spacer","button"]);const Ej=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Rj=["ownerState"],Mj=["ownerState"],Dj=K("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),Lj=K("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),lC=K(yn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Fj=t=>{const{classes:e}=t;return ze({root:["root"],spacer:["spacer"],button:["button"]},Nj,e)},EE=w.forwardRef(function(e,r){const i=Xi(),n=Ve({props:e,name:"MuiPickersArrowSwitcher"}),{children:s,className:a,slots:o,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:d,nextLabel:h,isPreviousDisabled:p,isPreviousHidden:f,onGoToPrevious:m,previousLabel:y,labelId:v}=n,g=le(n,Ej),b=n,k=Fj(b),C={isDisabled:c,isHidden:u,goTo:d,label:h},x={isDisabled:p,isHidden:f,goTo:m,label:y},_=(o==null?void 0:o.previousIconButton)??lC,P=Ct({elementType:_,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:x.label,"aria-label":x.label,disabled:x.isDisabled,edge:"end",onClick:x.goTo},ownerState:S({},b,{hidden:x.isHidden}),className:k.button}),R=(o==null?void 0:o.nextIconButton)??lC,E=Ct({elementType:R,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:C.label,"aria-label":C.label,disabled:C.isDisabled,edge:"start",onClick:C.goTo},ownerState:S({},b,{hidden:C.isHidden}),className:k.button}),D=(o==null?void 0:o.leftArrowIcon)??Cj,$=Ct({elementType:D,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),I=le($,Rj),F=(o==null?void 0:o.rightArrowIcon)??Tj,M=Ct({elementType:F,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),O=le(M,Mj);return T.jsxs(Dj,S({ref:r,className:ke(k.root,a),ownerState:b},g,{children:[T.jsx(_,S({},P,{children:i?T.jsx(F,S({},O)):T.jsx(D,S({},I))})),s?T.jsx(Mr,{variant:"subtitle1",component:"span",id:v,children:s}):T.jsx(Lj,{className:k.spacer,ownerState:b}),T.jsx(R,S({},E,{children:i?T.jsx(D,S({},I)):T.jsx(F,S({},O))}))]}))}),fa=(t,e)=>t.length!==e.length?!1:e.every(r=>t.includes(r)),RE=({openTo:t,defaultOpenTo:e,views:r,defaultViews:i})=>{const n=r??i;let s;if(t!=null)s=t;else if(n.includes(e))s=e;else if(n.length>0)s=n[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:n,openTo:s}},ME=["hours","minutes","seconds"],dh=t=>ME.includes(t),Ij=t=>ME.includes(t)||t==="meridiem",Oj=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,hh=(t,e,r)=>r&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,Aj=(t,e,r,i)=>{const n=hh(i.getHours(t),e,r);return i.setHours(t,n)},cC=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Xh=(t,e)=>(r,i)=>t?e.isAfter(r,i):cC(r,e)>cC(i,e),DE=(t,{format:e,views:r,ampm:i})=>{if(e!=null)return e;const n=t.formats;return fa(r,["hours"])?i?`${n.hours12h} ${n.meridiem}`:n.hours24h:fa(r,["minutes"])?n.minutes:fa(r,["seconds"])?n.seconds:fa(r,["minutes","seconds"])?`${n.minutes}:${n.seconds}`:fa(r,["hours","minutes","seconds"])?i?`${n.hours12h}:${n.minutes}:${n.seconds} ${n.meridiem}`:`${n.hours24h}:${n.minutes}:${n.seconds}`:i?`${n.hours12h}:${n.minutes} ${n.meridiem}`:`${n.hours24h}:${n.minutes}`};function qh({onChange:t,onViewChange:e,openTo:r,view:i,views:n,autoFocus:s,focusedView:a,onFocusedViewChange:o}){const l=w.useRef(r),c=w.useRef(n),u=w.useRef(n.includes(r)?r:n[0]),[d,h]=xs({name:"useViews",state:"view",controlled:i,default:u.current}),p=w.useRef(s?d:null),[f,m]=xs({name:"useViews",state:"focusedView",controlled:a,default:p.current});w.useEffect(()=>{(l.current&&l.current!==r||c.current&&c.current.some(_=>!n.includes(_)))&&(h(n.includes(r)?r:n[0]),c.current=n,l.current=r)},[r,h,d,n]);const y=n.indexOf(d),v=n[y-1]??null,g=n[y+1]??null,b=Xe((_,P)=>{m(P?_:R=>_===R?null:R),o==null||o(_,P)}),k=Xe(_=>{b(_,!0),_!==d&&(h(_),e&&e(_))}),C=Xe(()=>{g&&k(g)}),x=Xe((_,P,R)=>{const E=P==="finish",D=R?n.indexOf(R){const s=n.date(void 0,i),a=n.startOfMonth(e&&n.isBefore(s,r)?s:r);return!n.isAfter(a,t)},[e,r,t,n,i])}function $j(t,{disablePast:e,minDate:r,timezone:i}){const n=qt();return w.useMemo(()=>{const s=n.date(void 0,i),a=n.startOfMonth(e&&n.isAfter(s,r)?s:r);return!n.isBefore(a,t)},[e,r,t,n,i])}function pS(t,e,r,i){const n=qt(),s=Oj(t,n),a=w.useCallback(o=>{const l=t==null?null:Aj(t,o,!!e,n);r(l,i??"partial")},[e,t,r,i,n]);return{meridiemMode:s,handleMeridiemChange:a}}const fh=36,Kg=2,Qg=320,zj=280,mS=336,LE=232,Wj=48,Jg=K("div")({overflow:"hidden",width:Qg,maxHeight:mS,display:"flex",flexDirection:"column",margin:"0 auto"});function Hj(t){return Ue("MuiTimeClock",t)}Ge("MuiTimeClock",["root","arrowSwitcher"]);const lu=220,ka=36,ph={x:lu/2,y:lu/2},FE={x:ph.x,y:0},Uj=FE.x-ph.x,Gj=FE.y-ph.y,jj=t=>t*(180/Math.PI),IE=(t,e,r)=>{const i=e-ph.x,n=r-ph.y,s=Math.atan2(Uj,Gj)-Math.atan2(i,n);let a=jj(s);a=Math.round(a/t)*t,a%=360;const o=Math.floor(a/t)||0,l=i**2+n**2,c=Math.sqrt(l);return{value:o,distance:c}},Yj=(t,e,r=1)=>{const i=r*6;let{value:n}=IE(i,t,e);return n=n*r%60,n},Xj=(t,e,r)=>{const{value:i,distance:n}=IE(30,t,e);let s=i||12;return r?s%=12:n{const{classes:e}=t;return ze({root:["root"],thumb:["thumb"]},qj,e)},Jj=K("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Zj=K("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ka/2}px)`,border:`${(ka-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function e9(t){const e=Ve({props:t,name:"MuiClockPointer"}),{className:r,isInner:i,type:n,viewValue:s}=e,a=le(e,Kj),o=w.useRef(n);w.useEffect(()=>{o.current=n},[n]);const l=S({},e,{shouldAnimate:o.current!==n}),c=Qj(l),u=()=>{let h=360/(n==="hours"?12:60)*s;return n==="hours"&&s>12&&(h-=360),{height:Math.round((i?.26:.4)*lu),transform:`rotateZ(${h}deg)`}};return T.jsx(Jj,S({style:u(),className:ke(r,c.root),ownerState:l},a,{children:T.jsx(Zj,{ownerState:l,className:c.thumb})}))}function t9(t){return Ue("MuiClock",t)}Ge("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText"]);const cm=(t,e,r)=>{let i=e;return i=t.setHours(i,t.getHours(r)),i=t.setMinutes(i,t.getMinutes(r)),i=t.setSeconds(i,t.getSeconds(r)),i},Md=({date:t,disableFuture:e,disablePast:r,maxDate:i,minDate:n,isDateDisabled:s,utils:a,timezone:o})=>{const l=cm(a,a.date(void 0,o),t);r&&a.isBefore(n,l)&&(n=l),e&&a.isAfter(i,l)&&(i=l);let c=t,u=t;for(a.isBefore(t,n)&&(c=n,u=null),a.isAfter(t,i)&&(u&&(u=i),c=null);c||u;){if(c&&a.isAfter(c,i)&&(c=null),u&&a.isBefore(u,n)&&(u=null),c){if(!s(c))return c;c=a.addDays(c,1)}if(u){if(!s(u))return u;u=a.addDays(u,-1)}}return null},r9=(t,e)=>e==null||!t.isValid(e)?null:e,Bs=(t,e,r)=>e==null||!t.isValid(e)?r:e,i9=(t,e,r)=>!t.isValid(e)&&e!=null&&!t.isValid(r)&&r!=null?!0:t.isEqual(e,r),gS=(t,e)=>{const i=[t.startOfYear(e)];for(;i.length<12;){const n=i[i.length-1];i.push(t.addMonths(n,1))}return i},yS=(t,e,r)=>r==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),To=(t,e)=>{const r=t.setHours(t.date(),e==="am"?2:14);return t.format(r,"meridiem")},n9=["year","month","day"],uC=t=>n9.includes(t),bS=(t,{format:e,views:r},i)=>{if(e!=null)return e;const n=t.formats;return fa(r,["year"])?n.year:fa(r,["month"])?n.month:fa(r,["day"])?n.dayOfMonth:fa(r,["month","year"])?`${n.month} ${n.year}`:fa(r,["day","month"])?`${n.month} ${n.dayOfMonth}`:i?/en/.test(t.getCurrentLocaleCode())?n.normalDateWithWeekday:n.normalDate:n.keyboardDate},s9=(t,e)=>{const r=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(i=>t.addDays(r,i))},a9=t=>{const{classes:e}=t;return ze({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"],meridiemText:["meridiemText"]},t9,e)},o9=K("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),l9=K("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),c9=K("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),u9=K("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),d9=K("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),h9=K(yn,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>({zIndex:1,position:"absolute",bottom:8,left:8,paddingLeft:4,paddingRight:4,width:ka,variants:[{props:{meridiemMode:"am"},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]})),f9=K(yn,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>({zIndex:1,position:"absolute",bottom:8,right:8,paddingLeft:4,paddingRight:4,width:ka,variants:[{props:{meridiemMode:"pm"},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]})),dC=K(Mr,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function p9(t){const e=Ve({props:t,name:"MuiClock"}),{ampm:r,ampmInClock:i,autoFocus:n,children:s,value:a,handleMeridiemChange:o,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:d,selectedId:h,type:p,viewValue:f,disabled:m=!1,readOnly:y,className:v}=e,g=e,b=qt(),k=rn(),C=w.useRef(!1),x=a9(g),_=l(f,p),P=!r&&p==="hours"&&(f<1||f>12),R=(V,W)=>{m||y||l(V,p)||d(V,W)},E=(V,W)=>{let{offsetX:Q,offsetY:ne}=V;if(Q===void 0){const te=V.target.getBoundingClientRect();Q=V.changedTouches[0].clientX-te.left,ne=V.changedTouches[0].clientY-te.top}const ie=p==="seconds"||p==="minutes"?Yj(Q,ne,u):Xj(Q,ne,!!r);R(ie,W)},D=V=>{C.current=!0,E(V,"shallow")},$=V=>{C.current&&(E(V,"finish"),C.current=!1)},I=V=>{V.buttons>0&&E(V.nativeEvent,"shallow")},F=V=>{C.current&&(C.current=!1),E(V.nativeEvent,"finish")},M=w.useMemo(()=>p==="hours"?!0:f%5===0,[p,f]),O=p==="minutes"?u:1,A=w.useRef(null);zr(()=>{n&&A.current.focus()},[n]);const N=V=>{if(!C.current)switch(V.key){case"Home":R(0,"partial"),V.preventDefault();break;case"End":R(p==="minutes"?59:23,"partial"),V.preventDefault();break;case"ArrowUp":R(f+O,"partial"),V.preventDefault();break;case"ArrowDown":R(f-O,"partial"),V.preventDefault();break}};return T.jsxs(o9,{className:ke(v,x.root),children:[T.jsxs(l9,{className:x.clock,children:[T.jsx(u9,{onTouchMove:D,onTouchEnd:$,onMouseUp:F,onMouseMove:I,ownerState:{disabled:m},className:x.squareMask}),!_&&T.jsxs(w.Fragment,{children:[T.jsx(d9,{className:x.pin}),a!=null&&T.jsx(e9,{type:p,viewValue:f,isInner:P,hasSelected:M})]}),T.jsx(c9,{"aria-activedescendant":h,"aria-label":k.clockLabelText(p,a,b),ref:A,role:"listbox",onKeyDown:N,tabIndex:0,className:x.wrapper,children:s})]}),r&&i&&T.jsxs(w.Fragment,{children:[T.jsx(h9,{onClick:y?void 0:()=>o("am"),disabled:m||c===null,ownerState:g,className:x.amButton,title:To(b,"am"),children:T.jsx(dC,{variant:"caption",className:x.meridiemText,children:To(b,"am")})}),T.jsx(f9,{disabled:m||c===null,onClick:y?void 0:()=>o("pm"),ownerState:g,className:x.pmButton,title:To(b,"pm"),children:T.jsx(dC,{variant:"caption",className:x.meridiemText,children:To(b,"pm")})})]})]})}function m9(t){return Ue("MuiClockNumber",t)}const If=Ge("MuiClockNumber",["root","selected","disabled"]),g9=["className","disabled","index","inner","label","selected"],y9=t=>{const{classes:e,selected:r,disabled:i}=t;return ze({root:["root",r&&"selected",i&&"disabled"]},m9,e)},b9=K("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${If.disabled}`]:e.disabled},{[`&.${If.selected}`]:e.selected}]})(({theme:t})=>({height:ka,width:ka,position:"absolute",left:`calc((100% - ${ka}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${If.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${If.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:S({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function OE(t){const e=Ve({props:t,name:"MuiClockNumber"}),{className:r,disabled:i,index:n,inner:s,label:a,selected:o}=e,l=le(e,g9),c=e,u=y9(c),d=n%12/12*Math.PI*2-Math.PI/2,h=(lu-ka-2)/2*(s?.65:1),p=Math.round(Math.cos(d)*h),f=Math.round(Math.sin(d)*h);return T.jsx(b9,S({className:ke(r,u.root),"aria-disabled":i?!0:void 0,"aria-selected":o?!0:void 0,role:"option",style:{transform:`translate(${p}px, ${f+(lu-ka)/2}px`},ownerState:c},l,{children:a}))}const v9=({ampm:t,value:e,getClockNumberText:r,isDisabled:i,selectedId:n,utils:s})=>{const a=e?s.getHours(e):null,o=[],l=t?1:0,c=t?12:23,u=d=>a===null?!1:t?d===12?a===12||a===0:a===d||a-12===d:a===d;for(let d=l;d<=c;d+=1){let h=d.toString();d===0&&(h="00");const p=!t&&(d===0||d>12);h=s.formatNumber(h);const f=u(d);o.push(T.jsx(OE,{id:f?n:void 0,index:d,inner:p,selected:f,disabled:i(d),label:h,"aria-label":r(h)},d))}return o},hC=({utils:t,value:e,isDisabled:r,getClockNumberText:i,selectedId:n})=>{const s=t.formatNumber;return[[5,s("05")],[10,s("10")],[15,s("15")],[20,s("20")],[25,s("25")],[30,s("30")],[35,s("35")],[40,s("40")],[45,s("45")],[50,s("50")],[55,s("55")],[0,s("00")]].map(([a,o],l)=>{const c=a===e;return T.jsx(OE,{label:o,id:c?n:void 0,index:l+1,inner:!1,disabled:r(a),selected:c,"aria-label":i(o)},a)})},vS=({timezone:t,value:e,defaultValue:r,onChange:i,valueManager:n})=>{const s=qt(),a=w.useRef(r),o=e??a.current??n.emptyValue,l=w.useMemo(()=>n.getTimezone(s,o),[s,n,o]),c=Xe(p=>l==null?p:n.setTimezone(s,l,p)),u=t??l??"default",d=w.useMemo(()=>n.setTimezone(s,u,o),[n,s,u,o]),h=Xe((p,...f)=>{const m=c(p);i==null||i(m,...f)});return{value:d,handleValueChange:h,timezone:u}},_u=({name:t,timezone:e,value:r,defaultValue:i,onChange:n,valueManager:s})=>{const[a,o]=xs({name:t,state:"value",controlled:r,default:i??s.emptyValue}),l=Xe((c,...u)=>{o(c),n==null||n(c,...u)});return vS({timezone:e,value:a,defaultValue:void 0,onChange:l,valueManager:s})},zs={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},w9=t=>Math.max(...t.map(e=>zs[e.type]??1)),Ju=(t,e,r)=>{if(e===zs.year)return t.startOfYear(r);if(e===zs.month)return t.startOfMonth(r);if(e===zs.day)return t.startOfDay(r);let i=r;return e{let s=n?n():Ju(e,r,yS(e,i));t.minDate!=null&&e.isAfterDay(t.minDate,s)&&(s=Ju(e,r,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,s)&&(s=Ju(e,r,t.maxDate));const a=Xh(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&a(t.minTime,s)&&(s=Ju(e,r,t.disableIgnoringDatePartForTimeValidation?t.minTime:cm(e,s,t.minTime))),t.maxTime!=null&&a(s,t.maxTime)&&(s=Ju(e,r,t.disableIgnoringDatePartForTimeValidation?t.maxTime:cm(e,s,t.maxTime))),s},AE=(t,e)=>{const r=t.formatTokenMap[e];if(r==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` +`));return typeof r=="string"?{type:r,contentType:r==="meridiem"?"letter":"digit",maxLength:void 0}:{type:r.sectionType,contentType:r.contentType,maxLength:r.maxLength}},x9=t=>{switch(t){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Zg=(t,e,r)=>{const i=[],n=t.date(void 0,e),s=t.startOfWeek(n),a=t.endOfWeek(n);let o=s;for(;t.isBefore(o,a);)i.push(o),o=t.addDays(o,1);return i.map(l=>t.formatByString(l,r))},VE=(t,e,r,i)=>{switch(r){case"month":return gS(t,t.date(void 0,e)).map(n=>t.formatByString(n,i));case"weekDay":return Zg(t,e,i);case"meridiem":{const n=t.date(void 0,e);return[t.startOfDay(n),t.endOfDay(n)].map(s=>t.formatByString(s,i))}default:return[]}},fC="s",k9=["0","1","2","3","4","5","6","7","8","9"],C9=t=>{const e=t.date(void 0);return t.formatByString(t.setSeconds(e,0),fC)==="0"?k9:Array.from({length:10}).map((i,n)=>t.formatByString(t.setSeconds(e,n),fC))},zl=(t,e)=>{if(e[0]==="0")return t;const r=[];let i="";for(let n=0;n-1&&(r.push(s.toString()),i="")}return r.join("")},wS=(t,e)=>e[0]==="0"?t:t.split("").map(r=>e[Number(r)]).join(""),pC=(t,e)=>{const r=zl(t,e);return r!==" "&&!Number.isNaN(Number(r))},$E=(t,e)=>{let r=t;for(r=Number(r).toString();r.length{if(n.type==="day"&&n.contentType==="digit-with-letter"){const a=t.setDate(r.longestMonth,e);return t.formatByString(a,n.format)}let s=e.toString();return n.hasLeadingZerosInInput&&(s=$E(s,n.maxLength)),wS(s,i)},T9=(t,e,r,i,n,s,a,o)=>{const l=x9(i),c=i==="Home",u=i==="End",d=r.value===""||c||u,h=()=>{const f=n[r.type]({currentDate:a,format:r.format,contentType:r.contentType}),m=b=>zE(t,b,f,s,r),y=r.type==="minutes"&&(o!=null&&o.minutesStep)?o.minutesStep:1;let g=parseInt(zl(r.value,s),10)+l*y;if(d){if(r.type==="year"&&!u&&!c)return t.formatByString(t.date(void 0,e),r.format);l>0||c?g=f.minimum:g=f.maximum}return g%y!==0&&((l<0||c)&&(g+=y-(y+g)%y),(l>0||u)&&(g-=g%y)),g>f.maximum?m(f.minimum+(g-f.maximum-1)%(f.maximum-f.minimum+1)):g{const f=VE(t,e,r.type,r.format);if(f.length===0)return r.value;if(d)return l>0||c?f[0]:f[f.length-1];const v=((f.indexOf(r.value)+l)%f.length+f.length)%f.length;return f[v]};return r.contentType==="digit"||r.contentType==="digit-with-letter"?h():p()},SS=(t,e,r)=>{let i=t.value||t.placeholder;const n=e==="non-input"?t.hasLeadingZerosInFormat:t.hasLeadingZerosInInput;return e==="non-input"&&t.hasLeadingZerosInInput&&!t.hasLeadingZerosInFormat&&(i=Number(zl(i,r)).toString()),["input-rtl","input-ltr"].includes(e)&&t.contentType==="digit"&&!n&&i.length===1&&(i=`${i}‎`),e==="input-rtl"&&(i=`⁨${i}⁩`),i},mC=(t,e,r,i)=>t.formatByString(t.parse(e,r),i),WE=(t,e,r)=>t.formatByString(t.date(void 0,e),r).length===4,HE=(t,e,r,i,n)=>{if(r!=="digit")return!1;const s=t.date(void 0,e);switch(i){case"year":return WE(t,e,n)?t.formatByString(t.setYear(s,1),n)==="0001":t.formatByString(t.setYear(s,2001),n)==="01";case"month":return t.formatByString(t.startOfYear(s),n).length>1;case"day":return t.formatByString(t.startOfMonth(s),n).length>1;case"weekDay":return t.formatByString(t.startOfWeek(s),n).length>1;case"hours":return t.formatByString(t.setHours(s,1),n).length>1;case"minutes":return t.formatByString(t.setMinutes(s,1),n).length>1;case"seconds":return t.formatByString(t.setSeconds(s,1),n).length>1;default:throw new Error("Invalid section type")}},_9=(t,e,r)=>{const i=e.some(l=>l.type==="day"),n=[],s=[];for(let l=0;lt.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),P9=(t,e,r)=>{const n=t.map(s=>{const a=SS(s,r?"input-rtl":"input-ltr",e);return`${s.startSeparator}${a}${s.endSeparator}`}).join("");return r?`⁦${n}⁩`:n},N9=(t,e,r)=>{const i=t.date(void 0,r),n=t.endOfYear(i),s=t.endOfDay(i),{maxDaysInMonth:a,longestMonth:o}=gS(t,i).reduce((l,c)=>{const u=t.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:WE(t,r,l)?9999:99}),month:()=>({minimum:1,maximum:t.getMonth(n)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&t.isValid(l)?t.getDaysInMonth(l):a,longestMonth:o}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=Zg(t,r,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=t.getHours(s);return zl(t.formatByString(t.endOfDay(i),l),e)!==c.toString()?{minimum:1,maximum:Number(zl(t.formatByString(t.startOfDay(i),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:t.getMinutes(s)}),seconds:()=>({minimum:0,maximum:t.getSeconds(s)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},E9=(t,e,r,i,n)=>{switch(r.type){case"year":return t.setYear(n,t.getYear(i));case"month":return t.setMonth(n,t.getMonth(i));case"weekDay":{const s=Zg(t,e,r.format),a=t.formatByString(i,r.format),o=s.indexOf(a),c=s.indexOf(r.value)-o;return t.addDays(i,c)}case"day":return t.setDate(n,t.getDate(i));case"meridiem":{const s=t.getHours(i)<12,a=t.getHours(n);return s&&a>=12?t.addHours(n,-12):!s&&a<12?t.addHours(n,12):n}case"hours":return t.setHours(n,t.getHours(i));case"minutes":return t.setMinutes(n,t.getMinutes(i));case"seconds":return t.setSeconds(n,t.getSeconds(i));default:return n}},gC={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},yC=(t,e,r,i,n,s)=>[...i].sort((a,o)=>gC[a.type]-gC[o.type]).reduce((a,o)=>!s||o.modified?E9(t,e,o,r,a):a,n),R9=()=>navigator.userAgent.toLowerCase().indexOf("android")>-1,M9=(t,e)=>{const r={};if(!e)return t.forEach((l,c)=>{const u=c===0?null:c-1,d=c===t.length-1?null:c+1;r[c]={leftIndex:u,rightIndex:d}}),{neighbors:r,startIndex:0,endIndex:t.length-1};const i={},n={};let s=0,a=0,o=t.length-1;for(;o>=0;){a=t.findIndex((l,c)=>{var u;return c>=s&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),a===-1&&(a=t.length-1);for(let l=a;l>=s;l-=1)n[l]=o,i[o]=l,o-=1;s=a+1}return t.forEach((l,c)=>{const u=n[c],d=u===0?null:i[u-1],h=u===t.length-1?null:i[u+1];r[c]={leftIndex:d,rightIndex:h}}),{neighbors:r,startIndex:i[0],endIndex:i[t.length-1]}},rv=(t,e)=>t==null?null:t==="all"?"all":typeof t=="string"?e.findIndex(r=>r.type===t):t,D9=(t,e)=>{if(t.value)switch(t.type){case"month":{if(t.contentType==="digit")return e.format(e.setMonth(e.date(),Number(t.value)-1),"month");const r=e.parse(t.value,t.format);return r?e.format(r,"month"):void 0}case"day":return t.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(t.value)),"dayOfMonthFull"):t.value;case"weekDay":return;default:return}},L9=(t,e)=>{if(t.value)switch(t.type){case"weekDay":return t.contentType==="letter"?void 0:Number(t.value);case"meridiem":{const r=e.parse(`01:00 ${t.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${t.format}`);return r?e.getHours(r)>=12?1:0:void 0}case"day":return t.contentType==="digit-with-letter"?parseInt(t.value,10):Number(t.value);case"month":{if(t.contentType==="digit")return Number(t.value);const r=e.parse(t.value,t.format);return r?e.getMonth(r)+1:void 0}default:return t.contentType!=="letter"?Number(t.value):void 0}},F9=["value","referenceDate"],en={emptyValue:null,getTodayValue:yS,getInitialReferenceValue:t=>{let{value:e,referenceDate:r}=t,i=le(t,F9);return e!=null&&i.utils.isValid(e)?e:r??S9(i)},cleanValue:r9,areValuesEqual:i9,isSameError:(t,e)=>t===e,hasError:t=>t!=null,defaultErrorState:null,getTimezone:(t,e)=>e==null||!t.isValid(e)?null:t.getTimezone(e),setTimezone:(t,e,r)=>r==null?null:t.setTimezone(r,e)},UE={updateReferenceValue:(t,e,r)=>e==null||!t.isValid(e)?r:e,getSectionsFromValue:(t,e,r,i)=>!t.isValid(e)&&!!r?r:i(e),getV7HiddenInputValueFromSections:B9,getV6InputValueFromSections:P9,getActiveDateManager:(t,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:r=>r,getNewValuesFromNewActiveDate:r=>({value:r,referenceValue:r==null||!t.isValid(r)?e.referenceValue:r})}),parseValueStr:(t,e,r)=>r(t.trim(),e)},xS=({value:t,referenceDate:e,utils:r,props:i,timezone:n})=>{const s=w.useMemo(()=>en.getInitialReferenceValue({value:t,utils:r,props:i,referenceDate:e,granularity:zs.day,timezone:n,getTodayDate:()=>yS(r,n,"date")}),[]);return t??s},I9=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],O9=t=>{const{classes:e}=t;return ze({root:["root"],arrowSwitcher:["arrowSwitcher"]},Hj,e)},A9=K(Jg,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),V9=K(EE,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),$9=["hours","minutes"],z9=w.forwardRef(function(e,r){const i=qt(),n=Ve({props:e,name:"MuiTimeClock"}),{ampm:s=i.is12HourCycleInCurrentLocale(),ampmInClock:a=!1,autoFocus:o,slots:l,slotProps:c,value:u,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:f,minTime:m,disableFuture:y,disablePast:v,minutesStep:g=1,shouldDisableTime:b,showViewSwitcher:k,onChange:C,view:x,views:_=$9,openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,timezone:M}=n,O=le(n,I9),{value:A,handleValueChange:N,timezone:V}=_u({name:"TimeClock",timezone:M,value:u,defaultValue:d,onChange:C,valueManager:en}),W=xS({value:A,referenceDate:h,utils:i,props:n,timezone:V}),Q=rn(),ne=Kl(V),{view:ie,setView:te,previousView:j,nextView:J,setValueAndGoToNextView:me}=qh({view:x,views:_,openTo:P,onViewChange:R,onChange:N,focusedView:E,onFocusedViewChange:D}),{meridiemMode:pe,handleMeridiemChange:De}=pS(W,s,me),Be=w.useCallback((Y,Pe)=>{const ue=Xh(p,i),L=Pe==="hours"||Pe==="minutes"&&_.includes("seconds"),U=({start:re,end:Se})=>!(m&&ue(m,Se)||f&&ue(re,f)||y&&ue(re,ne)||v&&ue(ne,L?Se:re)),G=(re,Se=1)=>{if(re%Se!==0)return!1;if(b)switch(Pe){case"hours":return!b(i.setHours(W,re),"hours");case"minutes":return!b(i.setMinutes(W,re),"minutes");case"seconds":return!b(i.setSeconds(W,re),"seconds");default:return!1}return!0};switch(Pe){case"hours":{const re=hh(Y,pe,s),Se=i.setHours(W,re),ge=i.setSeconds(i.setMinutes(Se,0),0),Re=i.setSeconds(i.setMinutes(Se,59),59);return!U({start:ge,end:Re})||!G(re)}case"minutes":{const re=i.setMinutes(W,Y),Se=i.setSeconds(re,0),ge=i.setSeconds(re,59);return!U({start:Se,end:ge})||!G(Y,g)}case"seconds":{const re=i.setSeconds(W,Y);return!U({start:re,end:re})||!G(Y)}default:throw new Error("not supported")}},[s,W,p,f,pe,m,g,b,i,y,v,ne,_]),Ce=ia(),Te=w.useMemo(()=>{switch(ie){case"hours":{const Y=(Pe,ue)=>{const L=hh(Pe,pe,s);me(i.setHours(W,L),ue,"hours")};return{onChange:Y,viewValue:i.getHours(W),children:v9({value:A,utils:i,ampm:s,onChange:Y,getClockNumberText:Q.hoursClockNumberText,isDisabled:Pe=>I||Be(Pe,"hours"),selectedId:Ce})}}case"minutes":{const Y=i.getMinutes(W),Pe=(ue,L)=>{me(i.setMinutes(W,ue),L,"minutes")};return{viewValue:Y,onChange:Pe,children:hC({utils:i,value:Y,onChange:Pe,getClockNumberText:Q.minutesClockNumberText,isDisabled:ue=>I||Be(ue,"minutes"),selectedId:Ce})}}case"seconds":{const Y=i.getSeconds(W),Pe=(ue,L)=>{me(i.setSeconds(W,ue),L,"seconds")};return{viewValue:Y,onChange:Pe,children:hC({utils:i,value:Y,onChange:Pe,getClockNumberText:Q.secondsClockNumberText,isDisabled:ue=>I||Be(ue,"seconds"),selectedId:Ce})}}default:throw new Error("You must provide the type for ClockView")}},[ie,i,A,s,Q.hoursClockNumberText,Q.minutesClockNumberText,Q.secondsClockNumberText,pe,me,W,Be,Ce,I]),X=n,ee=O9(X);return T.jsxs(A9,S({ref:r,className:ke(ee.root,$),ownerState:X},O,{children:[T.jsx(p9,S({autoFocus:o??!!E,ampmInClock:a&&_.includes("hours"),value:A,type:ie,ampm:s,minutesStep:g,isTimeDisabled:Be,meridiemMode:pe,handleMeridiemChange:De,selectedId:Ce,disabled:I,readOnly:F},Te)),k&&T.jsx(V9,{className:ee.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>te(j),isPreviousDisabled:!j,previousLabel:Q.openPreviousView,onGoToNext:()=>te(J),isNextDisabled:!J,nextLabel:Q.openNextView,ownerState:X})]}))});function W9(t){return Ue("MuiDigitalClock",t)}Ge("MuiDigitalClock",["root","list","item"]);const H9=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],U9=t=>{const{classes:e}=t;return ze({root:["root"],list:["list"],item:["item"]},W9,e)},G9=K(Jg,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:LE,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),j9=K(iS,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),Y9=K(ZN,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity)}})),X9=w.forwardRef(function(e,r){const i=qt(),n=w.useRef(null),s=Wt(r,n),a=Ve({props:e,name:"MuiDigitalClock"}),{ampm:o=i.is12HourCycleInCurrentLocale(),timeStep:l=30,autoFocus:c,slots:u,slotProps:d,value:h,defaultValue:p,referenceDate:f,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:y,minTime:v,disableFuture:g,disablePast:b,minutesStep:k=1,shouldDisableTime:C,onChange:x,view:_,openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,views:M=["hours"],skipDisabled:O=!1,timezone:A}=a,N=le(a,H9),{value:V,handleValueChange:W,timezone:Q}=_u({name:"DigitalClock",timezone:A,value:h,defaultValue:p,onChange:x,valueManager:en}),ne=rn(),ie=Kl(Q),te=w.useMemo(()=>S({},a,{alreadyRendered:!!n.current}),[a]),j=U9(te),J=(u==null?void 0:u.digitalClockItem)??Y9,me=Ct({elementType:J,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:j.item}),pe=xS({value:V,referenceDate:f,utils:i,props:a,timezone:Q}),De=Xe(Y=>W(Y,"finish","hours")),{setValueAndGoToNextView:Be}=qh({view:_,views:M,openTo:P,onViewChange:R,onChange:De,focusedView:E,onFocusedViewChange:D}),Ce=Xe(Y=>{Be(Y,"finish")});w.useEffect(()=>{if(n.current===null)return;const Y=n.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!Y)return;const Pe=Y.offsetTop;(c||E)&&Y.focus(),n.current.scrollTop=Pe-4});const Te=w.useCallback(Y=>{const Pe=Xh(m,i),ue=()=>!(v&&Pe(v,Y)||y&&Pe(Y,y)||g&&Pe(Y,ie)||b&&Pe(ie,Y)),L=()=>i.getMinutes(Y)%k!==0?!1:C?!C(Y,"hours"):!0;return!ue()||!L()},[m,i,v,y,g,ie,b,k,C]),X=w.useMemo(()=>{const Y=i.startOfDay(pe);return[Y,...Array.from({length:Math.ceil(24*60/l)-1},(Pe,ue)=>i.addMinutes(Y,l*(ue+1)))]},[pe,l,i]),ee=X.findIndex(Y=>i.isEqual(Y,pe));return T.jsx(G9,S({ref:s,className:ke(j.root,$),ownerState:te},N,{children:T.jsx(j9,{role:"listbox","aria-label":ne.timePickerToolbarTitle,className:j.list,children:X.map((Y,Pe)=>{if(O&&Te(Y))return null;const ue=i.isEqual(Y,V),L=i.format(Y,o?"fullTime12h":"fullTime24h"),U=ee===Pe||ee===-1&&Pe===0?0:-1;return T.jsx(J,S({onClick:()=>!F&&Ce(Y),selected:ue,disabled:I||Te(Y),disableRipple:F,role:"option","aria-disabled":F,"aria-selected":ue,tabIndex:U},me,{children:L}),L)})})}))});function q9(t){return Ue("MuiMultiSectionDigitalClock",t)}Ge("MuiMultiSectionDigitalClock",["root"]);function K9(t){return Ue("MuiMultiSectionDigitalClockSection",t)}Ge("MuiMultiSectionDigitalClockSection",["root","item"]);const Q9=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],J9=t=>{const{classes:e}=t;return ze({root:["root"],item:["item"]},K9,e)},Z9=K(iS,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:LE,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),eY=K(ZN,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:Wj,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity)}})),tY=w.forwardRef(function(e,r){const i=w.useRef(null),n=Wt(r,i),s=w.useRef(null),a=Ve({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:o,onChange:l,className:c,disabled:u,readOnly:d,items:h,active:p,slots:f,slotProps:m,skipDisabled:y}=a,v=le(a,Q9),g=w.useMemo(()=>S({},a,{alreadyRendered:!!i.current}),[a]),b=J9(g),k=(f==null?void 0:f.digitalClockSectionItem)??eY;w.useEffect(()=>{if(i.current===null)return;const x=i.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(p&&o&&x&&x.focus(),!x||s.current===x)return;s.current=x;const _=x.offsetTop;i.current.scrollTop=_-4});const C=h.findIndex(x=>x.isFocused(x.value));return T.jsx(Z9,S({ref:n,className:ke(b.root,c),ownerState:g,autoFocusItem:o&&p,role:"listbox"},v,{children:h.map((x,_)=>{var $;const P=($=x.isDisabled)==null?void 0:$.call(x,x.value),R=u||P;if(y&&R)return null;const E=x.isSelected(x.value),D=C===_||C===-1&&_===0?0:-1;return T.jsx(k,S({onClick:()=>!d&&l(x.value),selected:E,disabled:R,disableRipple:d,role:"option","aria-disabled":d||R||void 0,"aria-label":x.ariaLabel,"aria-selected":E,tabIndex:D,className:b.item},m==null?void 0:m.digitalClockSectionItem,{children:x.label}),x.label)})}))}),rY=({now:t,value:e,utils:r,ampm:i,isDisabled:n,resolveAriaLabel:s,timeStep:a,valueOrReferenceDate:o})=>{const l=e?r.getHours(e):null,c=[],u=(p,f)=>{const m=f??l;return m===null?!1:i?p===12?m===12||m===0:m===p||m-12===p:m===p},d=p=>u(p,r.getHours(o)),h=i?11:23;for(let p=0;p<=h;p+=a){let f=r.format(r.setHours(t,p),i?"hours12h":"hours24h");const m=s(parseInt(f,10).toString());f=r.formatNumber(f),c.push({value:p,label:f,isSelected:u,isDisabled:n,isFocused:d,ariaLabel:m})}return c},bC=({value:t,utils:e,isDisabled:r,timeStep:i,resolveLabel:n,resolveAriaLabel:s,hasValue:a=!0})=>{const o=c=>t===null?!1:a&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/i)},(c,u)=>{const d=i*u;return{value:d,label:e.formatNumber(n(d)),isDisabled:r,isSelected:o,isFocused:l,ariaLabel:s(d.toString())}})]},iY=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],nY=t=>{const{classes:e}=t;return ze({root:["root"]},q9,e)},sY=K(Jg,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),aY=w.forwardRef(function(e,r){const i=qt(),n=Xi(),s=Ve({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:a=i.is12HourCycleInCurrentLocale(),timeSteps:o,autoFocus:l,slots:c,slotProps:u,value:d,defaultValue:h,referenceDate:p,disableIgnoringDatePartForTimeValidation:f=!1,maxTime:m,minTime:y,disableFuture:v,disablePast:g,minutesStep:b=1,shouldDisableTime:k,onChange:C,view:x,views:_=["hours","minutes"],openTo:P,onViewChange:R,focusedView:E,onFocusedViewChange:D,className:$,disabled:I,readOnly:F,skipDisabled:M=!1,timezone:O}=s,A=le(s,iY),{value:N,handleValueChange:V,timezone:W}=_u({name:"MultiSectionDigitalClock",timezone:O,value:d,defaultValue:h,onChange:C,valueManager:en}),Q=rn(),ne=Kl(W),ie=w.useMemo(()=>S({hours:1,minutes:5,seconds:5},o),[o]),te=xS({value:N,referenceDate:p,utils:i,props:s,timezone:W}),j=Xe((U,G,re)=>V(U,G,re)),J=w.useMemo(()=>!a||!_.includes("hours")||_.includes("meridiem")?_:[..._,"meridiem"],[a,_]),{view:me,setValueAndGoToNextView:pe,focusedView:De}=qh({view:x,views:J,openTo:P,onViewChange:R,onChange:j,focusedView:E,onFocusedViewChange:D}),Be=Xe(U=>{pe(U,"finish","meridiem")}),{meridiemMode:Ce,handleMeridiemChange:Te}=pS(te,a,Be,"finish"),X=w.useCallback((U,G)=>{const re=Xh(f,i),Se=G==="hours"||G==="minutes"&&J.includes("seconds"),ge=({start:Ke,end:ct})=>!(y&&re(y,ct)||m&&re(Ke,m)||v&&re(Ke,ne)||g&&re(ne,Se?ct:Ke)),Re=(Ke,ct=1)=>{if(Ke%ct!==0)return!1;if(k)switch(G){case"hours":return!k(i.setHours(te,Ke),"hours");case"minutes":return!k(i.setMinutes(te,Ke),"minutes");case"seconds":return!k(i.setSeconds(te,Ke),"seconds");default:return!1}return!0};switch(G){case"hours":{const Ke=hh(U,Ce,a),ct=i.setHours(te,Ke),Pt=i.setSeconds(i.setMinutes(ct,0),0),ve=i.setSeconds(i.setMinutes(ct,59),59);return!ge({start:Pt,end:ve})||!Re(Ke)}case"minutes":{const Ke=i.setMinutes(te,U),ct=i.setSeconds(Ke,0),Pt=i.setSeconds(Ke,59);return!ge({start:ct,end:Pt})||!Re(U,b)}case"seconds":{const Ke=i.setSeconds(te,U);return!ge({start:Ke,end:Ke})||!Re(U)}default:throw new Error("not supported")}},[a,te,f,m,Ce,y,b,k,i,v,g,ne,J]),ee=w.useCallback(U=>{switch(U){case"hours":return{onChange:G=>{const re=hh(G,Ce,a);pe(i.setHours(te,re),"finish","hours")},items:rY({now:ne,value:N,ampm:a,utils:i,isDisabled:G=>X(G,"hours"),timeStep:ie.hours,resolveAriaLabel:Q.hoursClockNumberText,valueOrReferenceDate:te})};case"minutes":return{onChange:G=>{pe(i.setMinutes(te,G),"finish","minutes")},items:bC({value:i.getMinutes(te),utils:i,isDisabled:G=>X(G,"minutes"),resolveLabel:G=>i.format(i.setMinutes(ne,G),"minutes"),timeStep:ie.minutes,hasValue:!!N,resolveAriaLabel:Q.minutesClockNumberText})};case"seconds":return{onChange:G=>{pe(i.setSeconds(te,G),"finish","seconds")},items:bC({value:i.getSeconds(te),utils:i,isDisabled:G=>X(G,"seconds"),resolveLabel:G=>i.format(i.setSeconds(ne,G),"seconds"),timeStep:ie.seconds,hasValue:!!N,resolveAriaLabel:Q.secondsClockNumberText})};case"meridiem":{const G=To(i,"am"),re=To(i,"pm");return{onChange:Te,items:[{value:"am",label:G,isSelected:()=>!!N&&Ce==="am",isFocused:()=>!!te&&Ce==="am",ariaLabel:G},{value:"pm",label:re,isSelected:()=>!!N&&Ce==="pm",isFocused:()=>!!te&&Ce==="pm",ariaLabel:re}]}}default:throw new Error(`Unknown view: ${U} found.`)}},[ne,N,a,i,ie.hours,ie.minutes,ie.seconds,Q.hoursClockNumberText,Q.minutesClockNumberText,Q.secondsClockNumberText,Ce,pe,te,X,Te]),Y=w.useMemo(()=>{if(!n)return J;const G=J.filter(re=>re!=="meridiem").toReversed();return J.includes("meridiem")&&G.push("meridiem"),G},[n,J]),Pe=w.useMemo(()=>J.reduce((U,G)=>S({},U,{[G]:ee(G)}),{}),[J,ee]),ue=s,L=nY(ue);return T.jsx(sY,S({ref:r,className:ke(L.root,$),ownerState:ue,role:"group"},A,{children:Y.map(U=>T.jsx(tY,{items:Pe[U].items,onChange:Pe[U].onChange,active:me===U,autoFocus:l??De===U,disabled:I,readOnly:F,slots:c,slotProps:u,skipDisabled:M,"aria-label":Q.selectViewText(U)},U))}))});function oY(t){return Ue("MuiPickersDay",t)}const sl=Ge("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),lY=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],cY=t=>{const{selected:e,disableMargin:r,disableHighlightToday:i,today:n,disabled:s,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:o,classes:l}=t,c=a&&!o;return ze({root:["root",e&&!c&&"selected",s&&"disabled",!r&&"dayWithMargin",!i&&n&&"today",a&&o&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},oY,l)},GE=({theme:t})=>S({},t.typography.caption,{width:fh,height:fh,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${sl.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${sl.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${sl.disabled}:not(.${sl.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${sl.disabled}&.${sl.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Kg}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${sl.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),jE=(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableMargin&&e.dayWithMargin,!r.disableHighlightToday&&r.today&&e.today,!r.outsideCurrentMonth&&r.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,r.outsideCurrentMonth&&!r.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},uY=K(Cs,{name:"MuiPickersDay",slot:"Root",overridesResolver:jE})(GE),dY=K("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:jE})(({theme:t})=>S({},GE({theme:t}),{opacity:0,pointerEvents:"none"})),Zu=()=>{},hY=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersDay"}),{autoFocus:n=!1,className:s,day:a,disabled:o=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDaySelect:h,onFocus:p=Zu,onBlur:f=Zu,onKeyDown:m=Zu,onMouseDown:y=Zu,onMouseEnter:v=Zu,outsideCurrentMonth:g,selected:b=!1,showDaysOutsideCurrentMonth:k=!1,children:C,today:x=!1}=i,_=le(i,lY),P=S({},i,{autoFocus:n,disabled:o,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:k,today:x}),R=cY(P),E=qt(),D=w.useRef(null),$=Wt(D,r);zr(()=>{n&&!o&&!u&&!g&&D.current.focus()},[n,o,u,g]);const I=M=>{y(M),g&&M.preventDefault()},F=M=>{o||h(a),g&&M.currentTarget.focus(),d&&d(M)};return g&&!k?T.jsx(dY,{className:ke(R.root,R.hiddenDaySpacingFiller,s),ownerState:P,role:_.role}):T.jsx(uY,S({className:ke(R.root,s),ref:$,centerRipple:!0,disabled:o,tabIndex:b?0:-1,onKeyDown:M=>m(M,a),onFocus:M=>p(M,a),onBlur:M=>f(M,a),onMouseEnter:M=>v(M,a),onClick:F,onMouseDown:I},_,{ownerState:P,children:C||E.format(a,"dayOfMonth")}))}),fY=w.memo(hY);function YE(t,e,r,i){const{value:n,onError:s}=t,a=ql(),o=w.useRef(i),l=e({adapter:a,value:n,props:t});return w.useEffect(()=>{s&&!r(l,o.current)&&s(l,n),o.current=l},[r,s,o,l,n]),l}const pY=({utils:t,format:e})=>{let r=10,i=e,n=t.expandFormat(e);for(;n!==i;)if(i=n,n=t.expandFormat(i),r-=1,r<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return n},mY=({utils:t,expandedFormat:e})=>{const r=[],{start:i,end:n}=t.escapedCharacters,s=new RegExp(`(\\${i}[^\\${n}]*\\${n})+`,"g");let a=null;for(;a=s.exec(e);)r.push({start:a.index,end:s.lastIndex-1});return r},gY=(t,e,r,i,n)=>{switch(i.type){case"year":return r.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,e),n).length,format:n});case"month":return r.fieldMonthPlaceholder({contentType:i.contentType,format:n});case"day":return r.fieldDayPlaceholder({format:n});case"weekDay":return r.fieldWeekDayPlaceholder({contentType:i.contentType,format:n});case"hours":return r.fieldHoursPlaceholder({format:n});case"minutes":return r.fieldMinutesPlaceholder({format:n});case"seconds":return r.fieldSecondsPlaceholder({format:n});case"meridiem":return r.fieldMeridiemPlaceholder({format:n});default:return n}},yY=({utils:t,timezone:e,date:r,shouldRespectLeadingZeros:i,localeText:n,localizedDigits:s,now:a,token:o,startSeparator:l})=>{if(o==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const c=AE(t,o),u=HE(t,e,c.contentType,c.type,o),d=i?u:c.contentType==="digit",h=r!=null&&t.isValid(r);let p=h?t.formatByString(r,o):"",f=null;if(d)if(u)f=p===""?t.formatByString(a,o).length:p.length;else{if(c.maxLength==null)throw new Error(`MUI X: The token ${o} should have a 'maxDigitNumber' property on it's adapter`);f=c.maxLength,h&&(p=wS($E(zl(p,s),f),s))}return S({},c,{format:o,maxLength:f,value:p,placeholder:gY(t,e,n,c,o),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:l,endSeparator:"",modified:!1})},bY=t=>{var p;const{utils:e,expandedFormat:r,escapedParts:i}=t,n=e.date(void 0),s=[];let a="";const o=Object.keys(e.formatTokenMap).sort((f,m)=>m.length-f.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${o.join("|")})*$`),u=new RegExp(`^(${o.join("|")})`),d=f=>i.find(m=>m.start<=f&&m.end>=f);let h=0;for(;h0;){const g=u.exec(v)[1];v=v.slice(g.length),s.push(yY(S({},t,{now:n,token:g,startSeparator:a}))),a=""}h+=y.length}else{const v=r[h];m&&(f==null?void 0:f.start)===h||(f==null?void 0:f.end)===h||(s.length===0?a+=v:s[s.length-1].endSeparator+=v),h+=1}}return s.length===0&&a.length>0&&s.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),s},vY=({isRtl:t,formatDensity:e,sections:r})=>r.map(i=>{const n=s=>{let a=s;return t&&a!==null&&a.includes(" ")&&(a=`⁩${a}⁦`),e==="spacious"&&["/",".","-"].includes(a)&&(a=` ${a} `),a};return i.startSeparator=n(i.startSeparator),i.endSeparator=n(i.endSeparator),i}),vC=t=>{let e=pY(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const r=mY(S({},t,{expandedFormat:e})),i=bY(S({},t,{expandedFormat:e,escapedParts:r}));return vY(S({},t,{sections:i}))},wY=t=>{const e=qt(),r=rn(),i=ql(),n=Xi(),{valueManager:s,fieldValueManager:a,valueType:o,validator:l,internalProps:c,internalProps:{value:u,defaultValue:d,referenceDate:h,onChange:p,format:f,formatDensity:m="dense",selectedSections:y,onSelectedSectionsChange:v,shouldRespectLeadingZeros:g=!1,timezone:b,enableAccessibleFieldDOMStructure:k=!1}}=t,{timezone:C,value:x,handleValueChange:_}=vS({timezone:b,value:u,defaultValue:d,onChange:p,valueManager:s}),P=w.useMemo(()=>C9(e),[e]),R=w.useMemo(()=>N9(e,P,C),[e,P,C]),E=w.useCallback((j,J=null)=>a.getSectionsFromValue(e,j,J,me=>vC({utils:e,timezone:C,localeText:r,localizedDigits:P,format:f,date:me,formatDensity:m,shouldRespectLeadingZeros:g,enableAccessibleFieldDOMStructure:k,isRtl:n})),[a,f,r,P,n,g,e,m,C,k]),[D,$]=w.useState(()=>{const j=E(x),J={sections:j,value:x,referenceValue:s.emptyValue,tempValueStrAndroid:null},me=w9(j),pe=s.getInitialReferenceValue({referenceDate:h,value:x,utils:e,props:c,granularity:me,timezone:C});return S({},J,{referenceValue:pe})}),[I,F]=xs({controlled:y,default:null,name:"useField",state:"selectedSections"}),M=j=>{F(j),v==null||v(j)},O=w.useMemo(()=>rv(I,D.sections),[I,D.sections]),A=O==="all"?0:O,N=({value:j,referenceValue:J,sections:me})=>{if($(De=>S({},De,{sections:me,value:j,referenceValue:J,tempValueStrAndroid:null})),s.areValuesEqual(e,D.value,j))return;const pe={validationError:l({adapter:i,value:j,props:S({},c,{value:j,timezone:C})})};_(j,pe)},V=(j,J)=>{const me=[...D.sections];return me[j]=S({},me[j],{value:J,modified:!0}),me},W=()=>{N({value:s.emptyValue,referenceValue:D.referenceValue,sections:E(s.emptyValue)})},Q=()=>{if(A==null)return;const j=D.sections[A],J=a.getActiveDateManager(e,D,j),pe=J.getSections(D.sections).filter(Te=>Te.value!=="").length===(j.value===""?0:1),De=V(A,""),Be=pe?null:e.getInvalidDate(),Ce=J.getNewValuesFromNewActiveDate(Be);N(S({},Ce,{sections:De}))},ne=j=>{const J=(De,Be)=>{const Ce=e.parse(De,f);if(Ce==null||!e.isValid(Ce))return null;const Te=vC({utils:e,timezone:C,localeText:r,localizedDigits:P,format:f,date:Ce,formatDensity:m,shouldRespectLeadingZeros:g,enableAccessibleFieldDOMStructure:k,isRtl:n});return yC(e,C,Ce,Te,Be,!1)},me=a.parseValueStr(j,D.referenceValue,J),pe=a.updateReferenceValue(e,me,D.referenceValue);N({value:me,referenceValue:pe,sections:E(me,D.sections)})},ie=({activeSection:j,newSectionValue:J,shouldGoToNextSection:me})=>{me&&AS({},ee,Te,{sections:De,tempValueStrAndroid:null}))},te=j=>$(J=>S({},J,{tempValueStrAndroid:j}));return w.useEffect(()=>{const j=E(D.value);$(J=>S({},J,{sections:j}))},[f,e.locale,n]),w.useEffect(()=>{let j;s.areValuesEqual(e,D.value,x)?j=s.getTimezone(e,D.value)!==s.getTimezone(e,x):j=!0,j&&$(J=>S({},J,{value:x,referenceValue:a.updateReferenceValue(e,x,J.referenceValue),sections:E(x)}))},[x]),{state:D,activeSectionIndex:A,parsedSelectedSections:O,setSelectedSections:M,clearValue:W,clearActiveSection:Q,updateSectionValue:ie,updateValueFromValueStr:ne,setTempAndroidValueStr:te,getSectionsFromValue:E,sectionsValueBoundaries:R,localizedDigits:P,timezone:C}},SY=5e3,lc=t=>t.saveQuery!=null,xY=({sections:t,updateSectionValue:e,sectionsValueBoundaries:r,localizedDigits:i,setTempAndroidValueStr:n,timezone:s})=>{const a=qt(),[o,l]=w.useState(null),c=Xe(()=>l(null));w.useEffect(()=>{var f;o!=null&&((f=t[o.sectionIndex])==null?void 0:f.type)!==o.sectionType&&c()},[t,o,c]),w.useEffect(()=>{if(o!=null){const f=setTimeout(()=>c(),SY);return()=>{clearTimeout(f)}}return()=>{}},[o,c]);const u=({keyPressed:f,sectionIndex:m},y,v)=>{const g=f.toLowerCase(),b=t[m];if(o!=null&&(!v||v(o.value))&&o.sectionIndex===m){const C=`${o.value}${g}`,x=y(C,b);if(!lc(x))return l({sectionIndex:m,value:C,sectionType:b.type}),x}const k=y(g,b);return lc(k)&&!k.saveQuery?(c(),null):(l({sectionIndex:m,value:g,sectionType:b.type}),lc(k)?null:k)},d=f=>{const m=(g,b,k)=>{const C=b.filter(x=>x.toLowerCase().startsWith(k));return C.length===0?{saveQuery:!1}:{sectionValue:C[0],shouldGoToNextSection:C.length===1}},y=(g,b,k,C)=>{const x=_=>VE(a,s,b.type,_);if(b.contentType==="letter")return m(b.format,x(b.format),g);if(k&&C!=null&&AE(a,k).contentType==="letter"){const _=x(k),P=m(k,_,g);return lc(P)?{saveQuery:!1}:S({},P,{sectionValue:C(P.sectionValue,_)})}return{saveQuery:!1}};return u(f,(g,b)=>{switch(b.type){case"month":{const k=C=>mC(a,C,a.formats.month,b.format);return y(g,b,a.formats.month,k)}case"weekDay":{const k=(C,x)=>x.indexOf(C).toString();return y(g,b,a.formats.weekday,k)}case"meridiem":return y(g,b);default:return{saveQuery:!1}}})},h=f=>{const m=(v,g)=>{const b=zl(v,i),k=Number(b),C=r[g.type]({currentDate:null,format:g.format,contentType:g.contentType});if(k>C.maximum)return{saveQuery:!1};if(kC.maximum||b.length===C.maximum.toString().length;return{sectionValue:zE(a,k,C,i,g),shouldGoToNextSection:x}};return u(f,(v,g)=>{if(g.contentType==="digit"||g.contentType==="digit-with-letter")return m(v,g);if(g.type==="month"){const b=HE(a,s,"digit","month","MM"),k=m(v,{type:g.type,format:"MM",hasLeadingZerosInFormat:b,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(lc(k))return k;const C=mC(a,k.sectionValue,"MM",g.format);return S({},k,{sectionValue:C})}if(g.type==="weekDay"){const b=m(v,g);if(lc(b))return b;const k=Zg(a,s,g.format)[Number(b.sectionValue)-1];return S({},b,{sectionValue:k})}return{saveQuery:!1}},v=>pC(v,i))};return{applyCharacterEditing:Xe(f=>{const m=t[f.sectionIndex],v=pC(f.keyPressed,i)?h(S({},f,{keyPressed:wS(f.keyPressed,i)})):d(f);if(v==null){n(null);return}e({activeSection:m,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function mc(t,e){return Array.isArray(e)?e.every(r=>t.indexOf(r)!==-1):t.indexOf(e)!==-1}const kY=(t,e)=>r=>{(r.key==="Enter"||r.key===" ")&&(t(r),r.preventDefault(),r.stopPropagation()),e&&e(r)},ps=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?ps(e.shadowRoot):e:null},XE="@media (pointer: fine)",CY=t=>{const{internalProps:{disabled:e,readOnly:r=!1},forwardedProps:{sectionListRef:i,onBlur:n,onClick:s,onFocus:a,onInput:o,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:d,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:f,parsedSelectedSections:m,state:y,clearActiveSection:v,clearValue:g,updateSectionValue:b,updateValueFromValueStr:k,sectionOrder:C,areAllSectionsEmpty:x,sectionsValueBoundaries:_}=t,P=w.useRef(null),R=Wt(i,P),E=rn(),D=qt(),$=ia(),[I,F]=w.useState(!1),M=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!P.current)return;const X=document.getSelection();if(!X)return;if(m==null){X.rangeCount>0&&P.current.getRoot().contains(X.getRangeAt(0).startContainer)&&X.removeAllRanges(),I&&P.current.getRoot().blur();return}if(!P.current.getRoot().contains(ps(document)))return;const ee=new window.Range;let Y;m==="all"?Y=P.current.getRoot():y.sections[m].type==="empty"?Y=P.current.getSectionContainer(m):Y=P.current.getSectionContent(m),ee.selectNodeContents(Y),Y.focus(),X.removeAllRanges(),X.addRange(ee)},getActiveSectionIndexFromDOM:()=>{const X=ps(document);return!X||!P.current||!P.current.getRoot().contains(X)?null:P.current.getSectionIndexFromDOMElement(X)},focusField:(X=0)=>{if(!P.current)return;const ee=rv(X,y.sections);F(!0),P.current.getSectionContent(ee).focus()},setSelectedSections:X=>{if(!P.current)return;const ee=rv(X,y.sections);F((ee==="all"?0:ee)!==null),f(X)},isFieldFocused:()=>{const X=ps(document);return!!P.current&&P.current.getRoot().contains(X)}}),[m,f,y.sections,I]),O=Xe(X=>{if(!P.current)return;const ee=y.sections[X];P.current.getSectionContent(X).innerHTML=ee.value||ee.placeholder,M.syncSelectionToDOM()}),A=Xe((X,...ee)=>{X.isDefaultPrevented()||!P.current||(F(!0),s==null||s(X,...ee),m==="all"?setTimeout(()=>{const Y=document.getSelection().getRangeAt(0).startOffset;if(Y===0){f(C.startIndex);return}let Pe=0,ue=0;for(;ue{if(o==null||o(X),!P.current||m!=="all")return;const Y=X.target.textContent??"";P.current.getRoot().innerHTML=y.sections.map(Pe=>`${Pe.startSeparator}${Pe.value||Pe.placeholder}${Pe.endSeparator}`).join(""),M.syncSelectionToDOM(),Y.length===0||Y.charCodeAt(0)===10?(p(),g(),f("all")):Y.length>1?k(Y):h({keyPressed:Y,sectionIndex:0})}),V=Xe(X=>{if(l==null||l(X),r||m!=="all"){X.preventDefault();return}const ee=X.clipboardData.getData("text");X.preventDefault(),p(),k(ee)}),W=Xe((...X)=>{if(a==null||a(...X),I||!P.current)return;F(!0),P.current.getSectionIndexFromDOMElement(ps(document))!=null||f(C.startIndex)}),Q=Xe((...X)=>{n==null||n(...X),setTimeout(()=>{if(!P.current)return;const ee=ps(document);!P.current.getRoot().contains(ee)&&(F(!1),f(null))})}),ne=Xe(X=>ee=>{ee.isDefaultPrevented()||r||f(X)}),ie=Xe(X=>{X.preventDefault()}),te=Xe(X=>()=>{r||f(X)}),j=Xe(X=>{if(X.preventDefault(),r||typeof m!="number")return;const ee=y.sections[m],Y=X.clipboardData.getData("text"),Pe=/^[a-zA-Z]+$/.test(Y),ue=/^[0-9]+$/.test(Y),L=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Y);ee.contentType==="letter"&&Pe||ee.contentType==="digit"&&ue||ee.contentType==="digit-with-letter"&&L?(p(),b({activeSection:ee,newSectionValue:Y,shouldGoToNextSection:!0})):!Pe&&!ue&&(p(),k(Y))}),J=Xe(X=>{X.preventDefault(),X.dataTransfer.dropEffect="none"}),me=Xe(X=>{if(!P.current)return;const ee=X.target,Y=ee.textContent??"",Pe=P.current.getSectionIndexFromDOMElement(ee),ue=y.sections[Pe];if(r||!P.current){O(Pe);return}if(Y.length===0){if(ue.value===""){O(Pe);return}const L=X.nativeEvent.inputType;if(L==="insertParagraph"||L==="insertLineBreak"){O(Pe);return}p(),v();return}h({keyPressed:Y,sectionIndex:Pe}),O(Pe)});zr(()=>{if(!(!I||!P.current)){if(m==="all")P.current.getRoot().focus();else if(typeof m=="number"){const X=P.current.getSectionContent(m);X&&X.focus()}}},[m,I]);const pe=w.useMemo(()=>y.sections.reduce((X,ee)=>(X[ee.type]=_[ee.type]({currentDate:null,contentType:ee.contentType,format:ee.format}),X),{}),[_,y.sections]),De=m==="all",Be=w.useMemo(()=>y.sections.map((X,ee)=>{const Y=!De&&!e&&!r;return{container:{"data-sectionindex":ee,onClick:ne(ee)},content:{tabIndex:De||ee>0?-1:0,contentEditable:!De&&!e&&!r,role:"spinbutton",id:`${$}-${X.type}`,"aria-labelledby":`${$}-${X.type}`,"aria-readonly":r,"aria-valuenow":L9(X,D),"aria-valuemin":pe[X.type].minimum,"aria-valuemax":pe[X.type].maximum,"aria-valuetext":X.value?D9(X,D):E.empty,"aria-label":E[X.type],"aria-disabled":e,spellCheck:Y?!1:void 0,autoCapitalize:Y?"off":void 0,autoCorrect:Y?"off":void 0,[parseInt(w.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Y?"next":void 0,children:X.value||X.placeholder,onInput:me,onPaste:j,onFocus:te(ee),onDragOver:J,onMouseUp:ie,inputMode:X.contentType==="letter"?"text":"numeric"},before:{children:X.startSeparator},after:{children:X.endSeparator}}}),[y.sections,te,j,J,me,ne,ie,e,r,De,E,D,pe,$]),Ce=Xe(X=>{k(X.target.value)}),Te=w.useMemo(()=>x?"":d.getV7HiddenInputValueFromSections(y.sections),[x,y.sections,d]);return w.useEffect(()=>{if(P.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` +`));u&&P.current&&P.current.getSectionContent(C.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:r,focused:c??I,sectionListRef:R,onBlur:Q,onClick:A,onFocus:W,onInput:N,onPaste:V,enableAccessibleFieldDOMStructure:!0,elements:Be,tabIndex:m===0?-1:0,contentEditable:De,value:Te,onChange:Ce,areAllSectionsEmpty:x}}},Ec=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),TY=(t,e,r)=>{let i=0,n=r?1:0;const s=[];for(let a=0;a{const e=Xi(),r=w.useRef(),{forwardedProps:{onFocus:i,onClick:n,onPaste:s,onBlur:a,inputRef:o,placeholder:l},internalProps:{readOnly:c=!1},parsedSelectedSections:u,activeSectionIndex:d,state:h,fieldValueManager:p,valueManager:f,applyCharacterEditing:m,resetCharacterQuery:y,updateSectionValue:v,updateValueFromValueStr:g,clearActiveSection:b,clearValue:k,setTempAndroidValueStr:C,setSelectedSections:x,getSectionsFromValue:_,areAllSectionsEmpty:P,localizedDigits:R}=t,E=w.useRef(null),D=Wt(o,E),$=w.useMemo(()=>TY(h.sections,R,e),[h.sections,R,e]),I=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!E.current)return;if(u==null){E.current.scrollLeft&&(E.current.scrollLeft=0);return}if(E.current!==ps(document))return;const j=E.current.scrollTop;if(u==="all")E.current.select();else{const J=$[u],me=J.type==="empty"?J.startInInput-J.startSeparator.length:J.startInInput,pe=J.type==="empty"?J.endInInput+J.endSeparator.length:J.endInInput;(me!==E.current.selectionStart||pe!==E.current.selectionEnd)&&E.current===ps(document)&&E.current.setSelectionRange(me,pe)}E.current.scrollTop=j},getActiveSectionIndexFromDOM:()=>{var De;const j=E.current.selectionStart??0,J=E.current.selectionEnd??0,me=!!((De=E.current)!=null&&De.readOnly);if(j===0&&J===0||me)return null;const pe=j<=$[0].startInInput?1:$.findIndex(Be=>Be.startInInput-Be.startSeparator.length>j);return pe===-1?$.length-1:pe-1},focusField:(j=0)=>{var J;(J=E.current)==null||J.focus(),x(j)},setSelectedSections:j=>x(j),isFieldFocused:()=>E.current===ps(document)}),[E,u,$,x]),F=()=>{if(c){x(null);return}const j=E.current.selectionStart??0;let J;j<=$[0].startInInput||j>=$[$.length-1].endInInput?J=1:J=$.findIndex(pe=>pe.startInInput-pe.startSeparator.length>j);const me=J===-1?$.length-1:J-1;x(me)},M=Xe((...j)=>{i==null||i(...j);const J=E.current;clearTimeout(r.current),r.current=setTimeout(()=>{!J||J!==E.current||d!=null||c||(J.value.length&&Number(J.selectionEnd)-Number(J.selectionStart)===J.value.length?x("all"):F())})}),O=Xe((j,...J)=>{j.isDefaultPrevented()||(n==null||n(j,...J),F())}),A=Xe(j=>{if(s==null||s(j),j.preventDefault(),c)return;const J=j.clipboardData.getData("text");if(typeof u=="number"){const me=h.sections[u],pe=/^[a-zA-Z]+$/.test(J),De=/^[0-9]+$/.test(J),Be=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(J);if(me.contentType==="letter"&&pe||me.contentType==="digit"&&De||me.contentType==="digit-with-letter"&&Be){y(),v({activeSection:me,newSectionValue:J,shouldGoToNextSection:!0});return}if(pe||De)return}y(),g(J)}),N=Xe((...j)=>{a==null||a(...j),x(null)}),V=Xe(j=>{if(c)return;const J=j.target.value;if(J===""){y(),k();return}const me=j.nativeEvent.data,pe=me&&me.length>1,De=pe?me:J,Be=Ec(De);if(d==null||pe){g(pe?me:Be);return}let Ce;if(u==="all"&&Be.length===1)Ce=Be;else{const Te=Ec(p.getV6InputValueFromSections($,R,e));let X=-1,ee=-1;for(let L=0;LY.end)return;const ue=Be.length-Te.length+Y.end-Ec(Y.endSeparator||"").length;Ce=Be.slice(Y.start+Ec(Y.startSeparator||"").length,ue)}if(Ce.length===0){R9()?C(De):(y(),b());return}m({keyPressed:Ce,sectionIndex:d})}),W=w.useMemo(()=>l!==void 0?l:p.getV6InputValueFromSections(_(f.emptyValue),R,e),[l,p,_,f.emptyValue,R,e]),Q=w.useMemo(()=>h.tempValueStrAndroid??p.getV6InputValueFromSections(h.sections,R,e),[h.sections,p,h.tempValueStrAndroid,R,e]);w.useEffect(()=>(E.current&&E.current===ps(document)&&x("all"),()=>{clearTimeout(r.current)}),[]);const ne=w.useMemo(()=>d==null||h.sections[d].contentType==="letter"?"text":"numeric",[d,h.sections]),te=!(E.current&&E.current===ps(document))&&P;return{interactions:I,returnedValue:{readOnly:c,onBlur:N,onClick:O,onFocus:M,onPaste:A,inputRef:D,enableAccessibleFieldDOMStructure:!1,placeholder:W,inputMode:ne,autoComplete:"off",value:te?"":Q,onChange:V}}},qE=t=>{const e=qt(),{internalProps:r,internalProps:{unstableFieldRef:i,minutesStep:n,enableAccessibleFieldDOMStructure:s=!1,disabled:a=!1,readOnly:o=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:d},fieldValueManager:h,valueManager:p,validator:f}=t,m=Xi(),y=wY(t),{state:v,activeSectionIndex:g,parsedSelectedSections:b,setSelectedSections:k,clearValue:C,clearActiveSection:x,updateSectionValue:_,setTempAndroidValueStr:P,sectionsValueBoundaries:R,localizedDigits:E,timezone:D}=y,$=xY({sections:v.sections,updateSectionValue:_,sectionsValueBoundaries:R,localizedDigits:E,setTempAndroidValueStr:P,timezone:D}),{resetCharacterQuery:I}=$,F=p.areValuesEqual(e,v.value,p.emptyValue),M=s?CY:_Y,O=w.useMemo(()=>M9(v.sections,m&&!s),[v.sections,m,s]),{returnedValue:A,interactions:N}=M(S({},t,y,$,{areAllSectionsEmpty:F,sectionOrder:O})),V=Xe(j=>{switch(l==null||l(j),!0){case((j.ctrlKey||j.metaKey)&&j.key.toLowerCase()==="a"&&!j.shiftKey&&!j.altKey):{j.preventDefault(),k("all");break}case j.key==="ArrowRight":{if(j.preventDefault(),b==null)k(O.startIndex);else if(b==="all")k(O.endIndex);else{const J=O.neighbors[b].rightIndex;J!==null&&k(J)}break}case j.key==="ArrowLeft":{if(j.preventDefault(),b==null)k(O.endIndex);else if(b==="all")k(O.startIndex);else{const J=O.neighbors[b].leftIndex;J!==null&&k(J)}break}case j.key==="Delete":{if(j.preventDefault(),o)break;b==null||b==="all"?C():x(),I();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(j.key):{if(j.preventDefault(),o||g==null)break;const J=v.sections[g],me=h.getActiveDateManager(e,v,J),pe=T9(e,D,J,j.key,R,E,me.date,{minutesStep:n});_({activeSection:J,newSectionValue:pe,shouldGoToNextSection:!1});break}}});zr(()=>{N.syncSelectionToDOM()});const W=YE(S({},r,{value:v.value,timezone:D}),f,p.isSameError,p.defaultErrorState),Q=w.useMemo(()=>c!==void 0?c:p.hasError(W),[p,W,c]);w.useEffect(()=>{!Q&&g==null&&I()},[v.referenceValue,g,Q]),w.useEffect(()=>{v.tempValueStrAndroid!=null&&g!=null&&(I(),x())},[v.sections]),w.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:N.getActiveSectionIndexFromDOM,setSelectedSections:N.setSelectedSections,focusField:N.focusField,isFieldFocused:N.isFieldFocused}));const ne=Xe((j,...J)=>{j.preventDefault(),d==null||d(j,...J),C(),N.isFieldFocused()?k(O.startIndex):N.focusField(0)}),ie={onKeyDown:V,onClear:ne,error:Q,clearable:!!(u&&!F&&!o&&!a)},te={disabled:a,readOnly:o};return S({},t.forwardedProps,ie,te,A)},ey=({props:t,value:e,adapter:r})=>{if(e===null)return null;const{shouldDisableDate:i,shouldDisableMonth:n,shouldDisableYear:s,disablePast:a,disableFuture:o,timezone:l}=t,c=r.utils.date(void 0,l),u=Bs(r.utils,t.minDate,r.defaultDates.minDate),d=Bs(r.utils,t.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(e):return"invalidDate";case!!(i&&i(e)):return"shouldDisableDate";case!!(n&&n(e)):return"shouldDisableMonth";case!!(s&&s(e)):return"shouldDisableYear";case!!(o&&r.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(e,u)):return"minDate";case!!(d&&r.utils.isAfterDay(e,d)):return"maxDate";default:return null}},iv=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],nv=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],KE=["minDateTime","maxDateTime"],BY=[...iv,...nv,...KE],ty=t=>BY.reduce((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{}),PY=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],QE=(t,e)=>{const r=S({},t),i={},n=s=>{r.hasOwnProperty(s)&&(i[s]=r[s],delete r[s])};return PY.forEach(n),e==="date"?iv.forEach(n):e==="time"?nv.forEach(n):e==="date-time"&&(iv.forEach(n),nv.forEach(n),KE.forEach(n)),{forwardedProps:r,internalProps:i}},NY=t=>{const e=qt(),r=Yh();return S({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??e.formats.keyboardDate,minDate:Bs(e,t.minDate,r.minDate),maxDate:Bs(e,t.maxDate,r.maxDate)})},EY=t=>{const e=qt(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.fullTime12h:e.formats.fullTime24h;return S({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i})},RY=t=>{const e=NY(t),{forwardedProps:r,internalProps:i}=QE(e,"date");return qE({forwardedProps:r,internalProps:i,valueManager:en,fieldValueManager:UE,validator:ey,valueType:"date"})},MY=["clearable","onClear","InputProps","sx","slots","slotProps"],DY=["ownerState"],JE=t=>{const e=rn(),{clearable:r,onClear:i,InputProps:n,sx:s,slots:a,slotProps:o}=t,l=le(t,MY),c=(a==null?void 0:a.clearButton)??yn,u=Ct({elementType:c,externalSlotProps:o==null?void 0:o.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),d=le(u,DY),h=(a==null?void 0:a.clearIcon)??Pj,p=Ct({elementType:h,externalSlotProps:o==null?void 0:o.clearIcon,ownerState:{}});return S({},l,{InputProps:S({},n,{endAdornment:T.jsxs(w.Fragment,{children:[r&&T.jsx(YN,{position:"end",sx:{marginRight:n!=null&&n.endAdornment?-1:-1.5},children:T.jsx(c,S({},d,{onClick:i,children:T.jsx(h,S({fontSize:"small"},p))}))}),n==null?void 0:n.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(s)?s:[s]]})};function LY(t){return Ue("MuiPickersTextField",t)}Ge("MuiPickersTextField",["root","focused","disabled","error","required"]);function FY(t){return Ue("MuiPickersInputBase",t)}const Wc=Ge("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function IY(t){return Ue("MuiPickersSectionList",t)}const ed=Ge("MuiPickersSectionList",["root","section","sectionContent"]),OY=["slots","slotProps","elements","sectionListRef"],ZE=K("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),eR=K("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),tR=K("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),rR=K("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),AY=t=>{const{classes:e}=t;return ze({root:["root"],section:["section"],sectionContent:["sectionContent"]},IY,e)};function VY(t){const{slots:e,slotProps:r,element:i,classes:n}=t,s=(e==null?void 0:e.section)??eR,a=Ct({elementType:s,externalSlotProps:r==null?void 0:r.section,externalForwardedProps:i.container,className:n.section,ownerState:{}}),o=(e==null?void 0:e.sectionContent)??rR,l=Ct({elementType:o,externalSlotProps:r==null?void 0:r.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:n.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??tR,u=Ct({elementType:c,externalSlotProps:r==null?void 0:r.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),d=Ct({elementType:c,externalSlotProps:r==null?void 0:r.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return T.jsxs(s,S({},a,{children:[T.jsx(c,S({},u)),T.jsx(o,S({},l)),T.jsx(c,S({},d))]}))}const $Y=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersSectionList"}),{slots:n,slotProps:s,elements:a,sectionListRef:o}=i,l=le(i,OY),c=AY(i),u=w.useRef(null),d=Wt(r,u),h=m=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${m} before the mount of the component.`);return u.current};w.useImperativeHandle(o,()=>({getRoot(){return h("getRoot")},getSectionContainer(m){return h("getSectionContainer").querySelector(`.${ed.section}[data-sectionindex="${m}"]`)},getSectionContent(m){return h("getSectionContent").querySelector(`.${ed.section}[data-sectionindex="${m}"] .${ed.sectionContent}`)},getSectionIndexFromDOMElement(m){const y=h("getSectionIndexFromDOMElement");if(m==null||!y.contains(m))return null;let v=null;return m.classList.contains(ed.section)?v=m:m.classList.contains(ed.sectionContent)&&(v=m.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const p=(n==null?void 0:n.root)??ZE,f=Ct({elementType:p,externalSlotProps:s==null?void 0:s.root,externalForwardedProps:l,additionalProps:{ref:d,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return T.jsx(p,S({},f,{children:f.contentEditable?a.map(({content:m,before:y,after:v})=>`${y.children}${m.children}${v.children}`).join(""):T.jsx(w.Fragment,{children:a.map((m,y)=>T.jsx(VY,{slots:n,slotProps:s,element:m,classes:c},y))})}))}),zY=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],WY=t=>Math.round(t*1e5)/1e5,ry=K("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>S({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${WY(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),kS=K(ZE,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:r,filled:i,label:n})=>!e&&!r&&!i&&n==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),HY=K(eR,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),UY=K(rR,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),GY=K(tR,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),jY=K("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(S({},Lw)),YY=t=>{const{focused:e,disabled:r,error:i,classes:n,fullWidth:s,readOnly:a,color:o,size:l,endAdornment:c,startAdornment:u}=t,d={root:["root",e&&!r&&"focused",r&&"disabled",a&&"readOnly",i&&"error",s&&"fullWidth",`color${Ne(o)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return ze(d,FY,n)},CS=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersInputBase"}),{elements:n,areAllSectionsEmpty:s,value:a,onChange:o,id:l,endAdornment:c,startAdornment:u,renderSuffix:d,slots:h,slotProps:p,contentEditable:f,tabIndex:m,onInput:y,onPaste:v,onKeyDown:g,name:b,readOnly:k,inputProps:C,inputRef:x,sectionListRef:_}=i,P=le(i,zY),R=w.useRef(null),E=Wt(r,R),D=Wt(C==null?void 0:C.ref,x),$=Xi(),I=In();if(!I)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const F=W=>{var Q;if(I.disabled){W.stopPropagation();return}(Q=I.onFocus)==null||Q.call(I,W)};w.useEffect(()=>{I&&I.setAdornedStart(!!u)},[I,u]),w.useEffect(()=>{I&&(s?I.onEmpty():I.onFilled())},[I,s]);const M=S({},i,I,{isRtl:$}),O=YY(M),A=(h==null?void 0:h.root)||ry,N=Ct({elementType:A,externalSlotProps:p==null?void 0:p.root,externalForwardedProps:P,additionalProps:{"aria-invalid":I.error,ref:E},className:O.root,ownerState:M}),V=(h==null?void 0:h.input)||kS;return T.jsxs(A,S({},N,{children:[u,T.jsx($Y,{sectionListRef:_,elements:n,contentEditable:f,tabIndex:m,className:O.sectionsContainer,onFocus:F,onBlur:I.onBlur,onInput:y,onPaste:v,onKeyDown:g,slots:{root:V,section:HY,sectionContent:UY,sectionSeparator:GY},slotProps:{root:{ownerState:M},sectionContent:{className:Wc.sectionContent},sectionSeparator:({position:W})=>({className:W==="before"?Wc.sectionBefore:Wc.sectionAfter})}}),c,d?d(S({},I)):null,T.jsx(jY,S({name:b,className:O.input,value:a,onChange:o,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:k,required:I.required,disabled:I.disabled},C,{ref:D}))]}))});function XY(t){return Ue("MuiPickersOutlinedInput",t)}const Ls=S({},Wc,Ge("MuiPickersOutlinedInput",["root","notchedOutline","input"])),qY=["children","className","label","notched","shrink"],KY=K("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{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%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),wC=K("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),QY=K("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{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"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function JY(t){const{className:e,label:r}=t,i=le(t,qY),n=r!=null&&r!=="",s=S({},t,{withLabel:n});return T.jsx(KY,S({"aria-hidden":!0,className:e},i,{ownerState:s,children:T.jsx(QY,{ownerState:s,children:n?T.jsx(wC,{children:r}):T.jsx(wC,{className:"notranslate",children:"​"})})}))}const ZY=["label","autoFocus","ownerState","notched"],eX=K(ry,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ls.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Ls.focused} .${Ls.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Ls.disabled}`]:{[`& .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Ls.error} .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(r=>{var i;return((i=(t.vars??t).palette[r])==null?void 0:i.main)??!1}).map(r=>({props:{color:r},style:{[`&.${Ls.focused}:not(.${Ls.error}) .${Ls.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}))}}),tX=K(kS,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),rX=t=>{const{classes:e}=t,i=ze({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},XY,e);return S({},e,i)},iR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersOutlinedInput"}),{label:n,ownerState:s,notched:a}=i,o=le(i,ZY),l=In(),c=S({},i,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=rX(c);return T.jsx(CS,S({slots:{root:eX,input:tX},renderSuffix:d=>T.jsx(JY,{shrink:!!(a||d.adornedStart||d.focused||d.filled),notched:!!(a||d.adornedStart||d.focused||d.filled),className:u.notchedOutline,label:n!=null&&n!==""&&(l!=null&&l.required)?T.jsxs(w.Fragment,{children:[n," ","*"]}):n,ownerState:c})},o,{label:n,classes:u,ref:r}))});iR.muiName="Input";function iX(t){return Ue("MuiPickersFilledInput",t)}const al=S({},Wc,Ge("MuiPickersFilledInput",["root","underline","input"])),nX=["label","autoFocus","disableUnderline","ownerState"],sX=K(ry,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>dp(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",r=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",n=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:n,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},[`&.${al.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},[`&.${al.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s},variants:[...Object.keys((t.vars??t).palette).filter(a=>(t.vars??t).palette[a].main).map(a=>{var o;return{props:{color:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(o=(t.vars||t).palette[a])==null?void 0:o.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${al.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${al.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${al.disabled}, .${al.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${al.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:a})=>!!a,style:{paddingLeft:12}},{props:({endAdornment:a})=>!!a,style:{paddingRight:12}}]}}),aX=K(kS,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),oX=t=>{const{classes:e,disableUnderline:r}=t,n=ze({root:["root",!r&&"underline"],input:["input"]},iX,e);return S({},e,n)},nR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersFilledInput"}),{label:n,disableUnderline:s=!1,ownerState:a}=i,o=le(i,nX),l=In(),c=S({},i,a,l,{color:(l==null?void 0:l.color)||"primary"}),u=oX(c);return T.jsx(CS,S({slots:{root:sX,input:aX},slotProps:{root:{disableUnderline:s}}},o,{label:n,classes:u,ref:r}))});nR.muiName="Input";function lX(t){return Ue("MuiPickersFilledInput",t)}const td=S({},Wc,Ge("MuiPickersInput",["root","input"])),cX=["label","autoFocus","disableUnderline","ownerState"],uX=K(ry,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(i=>(t.vars??t).palette[i].main).map(i=>({props:{color:i},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[i].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${td.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${td.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${td.disabled}, .${td.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${td.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),dX=t=>{const{classes:e,disableUnderline:r}=t,n=ze({root:["root",!r&&"underline"],input:["input"]},lX,e);return S({},e,n)},sR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersInput"}),{label:n,disableUnderline:s=!1,ownerState:a}=i,o=le(i,cX),l=In(),c=S({},i,a,l,{disableUnderline:s,color:(l==null?void 0:l.color)||"primary"}),u=dX(c);return T.jsx(CS,S({slots:{root:uX}},o,{label:n,classes:u,ref:r}))});sR.muiName="Input";const hX=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],fX={standard:sR,filled:nR,outlined:iR},pX=K(WN,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),mX=t=>{const{focused:e,disabled:r,classes:i,required:n}=t;return ze({root:["root",e&&!r&&"focused",r&&"disabled",n&&"required"]},LY,i)},aR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersTextField"}),{onFocus:n,onBlur:s,className:a,color:o="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:d=!1,InputProps:h,inputProps:p,inputRef:f,sectionListRef:m,elements:y,areAllSectionsEmpty:v,onClick:g,onKeyDown:b,onPaste:k,onInput:C,endAdornment:x,startAdornment:_,tabIndex:P,contentEditable:R,focused:E,value:D,onChange:$,fullWidth:I,id:F,name:M,helperText:O,FormHelperTextProps:A,label:N,InputLabelProps:V}=i,W=le(i,hX),Q=w.useRef(null),ne=Wt(r,Q),ie=ia(F),te=O&&ie?`${ie}-helper-text`:void 0,j=N&&ie?`${ie}-label`:void 0,J=S({},i,{color:o,disabled:l,error:c,focused:E,required:d,variant:u}),me=mX(J),pe=fX[u];return T.jsxs(pX,S({className:ke(me.root,a),ref:ne,focused:E,onFocus:n,onBlur:s,disabled:l,variant:u,error:c,color:o,fullWidth:I,required:d,ownerState:J},W,{children:[T.jsx(XN,S({htmlFor:ie,id:j},V,{children:N})),T.jsx(pe,S({elements:y,areAllSectionsEmpty:v,onClick:g,onKeyDown:b,onInput:C,onPaste:k,endAdornment:x,startAdornment:_,tabIndex:P,contentEditable:R,value:D,onChange:$,id:ie,fullWidth:I,inputProps:p,inputRef:f,sectionListRef:m,label:N,name:M,role:"group","aria-labelledby":j},h)),O&&T.jsx(HN,S({id:te},A,{children:O}))]}))}),gX=["enableAccessibleFieldDOMStructure"],yX=["InputProps","readOnly"],bX=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],oR=t=>{let{enableAccessibleFieldDOMStructure:e}=t,r=le(t,gX);if(e){const{InputProps:d,readOnly:h}=r,p=le(r,yX);return S({},p,{InputProps:S({},d??{},{readOnly:h})})}const{onPaste:i,onKeyDown:n,inputMode:s,readOnly:a,InputProps:o,inputProps:l,inputRef:c}=r,u=le(r,bX);return S({},u,{InputProps:S({},o??{},{readOnly:a}),inputProps:S({},l??{},{inputMode:s,onPaste:i,onKeyDown:n,ref:c})})},vX=["slots","slotProps","InputProps","inputProps"],lR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDateField"}),{slots:n,slotProps:s,InputProps:a,inputProps:o}=i,l=le(i,vX),c=i,u=(n==null?void 0:n.textField)??(e.enableAccessibleFieldDOMStructure?aR:im),d=Ct({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,additionalProps:{ref:r},ownerState:c});d.inputProps=S({},o,d.inputProps),d.InputProps=S({},a,d.InputProps);const h=RY(d),p=oR(h),f=JE(S({},p,{slots:n,slotProps:s}));return T.jsx(u,S({},f))}),TS=({adapter:t,value:e,props:r})=>{if(e===null)return null;const{minTime:i,maxTime:n,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:o=!1,disablePast:l,disableFuture:c,timezone:u}=r,d=t.utils.date(void 0,u),h=Xh(o,t.utils);switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&h(i,e)):return"minTime";case!!(n&&h(e,n)):return"maxTime";case!!(c&&t.utils.isAfter(e,d)):return"disableFuture";case!!(l&&t.utils.isBefore(e,d)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(s&&t.utils.getMinutes(e)%s!==0):return"minutesStep";default:return null}},wX=t=>{const e=EY(t),{forwardedProps:r,internalProps:i}=QE(e,"time");return qE({forwardedProps:r,internalProps:i,valueManager:en,fieldValueManager:UE,validator:TS,valueType:"time"})},SX=["slots","slotProps","InputProps","inputProps"],cR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTimeField"}),{slots:n,slotProps:s,InputProps:a,inputProps:o}=i,l=le(i,SX),c=i,u=(n==null?void 0:n.textField)??(e.enableAccessibleFieldDOMStructure?aR:im),d=Ct({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:r}});d.inputProps=S({},o,d.inputProps),d.InputProps=S({},a,d.InputProps);const h=wX(d),p=oR(h),f=JE(S({},p,{slots:n,slotProps:s}));return T.jsx(u,S({},f))}),uR=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:r,minDate:i,maxDate:n,disableFuture:s,disablePast:a,timezone:o})=>{const l=ql();return w.useCallback(c=>ey({adapter:l,value:c,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:r,minDate:i,maxDate:n,disableFuture:s,disablePast:a,timezone:o}})!==null,[l,t,e,r,i,n,s,a,o])},xX=(t,e,r)=>(i,n)=>{switch(n.type){case"changeMonth":return S({},i,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return S({},i,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(i.focusedDay!=null&&n.focusedDay!=null&&r.isSameDay(n.focusedDay,i.focusedDay))return i;const s=n.focusedDay!=null&&!e&&!r.isSameMonth(i.currentMonth,n.focusedDay);return S({},i,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:s&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:s?r.startOfMonth(n.focusedDay):i.currentMonth,slideDirection:n.focusedDay!=null&&r.isAfterDay(n.focusedDay,i.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},kX=t=>{const{value:e,referenceDate:r,disableFuture:i,disablePast:n,disableSwitchToMonthOnDayFocus:s=!1,maxDate:a,minDate:o,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:d}=t,h=qt(),p=w.useRef(xX(!!c,s,h)).current,f=w.useMemo(()=>en.getInitialReferenceValue({value:e,utils:h,timezone:d,props:t,referenceDate:r,granularity:zs.day}),[]),[m,y]=w.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:f,currentMonth:h.startOfMonth(f),slideDirection:"left"}),v=w.useCallback(x=>{y(S({type:"changeMonth"},x)),l&&l(x.newMonth)},[l]),g=w.useCallback(x=>{const _=x;h.isSameMonth(_,m.currentMonth)||v({newMonth:h.startOfMonth(_),direction:h.isAfterDay(_,m.currentMonth)?"left":"right"})},[m.currentMonth,v,h]),b=uR({shouldDisableDate:u,minDate:o,maxDate:a,disableFuture:i,disablePast:n,timezone:d}),k=w.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),C=Xe((x,_)=>{b(x)||y({type:"changeFocusedDay",focusedDay:x,withoutMonthSwitchingAnimation:_})});return{referenceDate:f,calendarState:m,changeMonth:g,changeFocusedDay:C,isDateDisabled:b,onMonthSwitchingAnimationEnd:k,handleChangeMonth:v}},CX=t=>Ue("MuiPickersFadeTransitionGroup",t);Ge("MuiPickersFadeTransitionGroup",["root"]);const TX=t=>{const{classes:e}=t;return ze({root:["root"]},CX,e)},_X=K(Uw,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function dR(t){const e=Ve({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:r,className:i,reduceAnimations:n,transKey:s}=e,a=TX(e),o=Ko();return n?r:T.jsx(_X,{className:ke(a.root,i),children:T.jsx(Cu,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:o.transitions.duration.enteringScreen,enter:o.transitions.duration.enteringScreen,exit:0},children:r},s)})}const BX=t=>Ue("MuiPickersSlideTransition",t),is=Ge("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),PX=["children","className","reduceAnimations","slideDirection","transKey","classes"],NX=t=>{const{classes:e,slideDirection:r}=t,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${r}`],exitActive:[`slideExitActiveLeft-${r}`]};return ze(i,BX,e)},EX=K(Uw,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${is["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${is["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${is.slideEnterActive}`]:e.slideEnterActive},{[`.${is.slideExit}`]:e.slideExit},{[`.${is["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${is["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${is["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${is["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${is.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${is.slideExit}`]:{transform:"translate(0%)"},[`& .${is["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${is["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function RX(t){const e=Ve({props:t,name:"MuiPickersSlideTransition"}),{children:r,className:i,reduceAnimations:n,transKey:s}=e,a=le(e,PX),o=NX(e),l=Ko();if(n)return T.jsx("div",{className:ke(o.root,i),children:r});const c={exit:o.exit,enterActive:o.enterActive,enter:o.enter,exitActive:o.exitActive};return T.jsx(EX,{className:ke(o.root,i),childFactory:u=>w.cloneElement(u,{classNames:c}),role:"presentation",children:T.jsx(p5,S({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},a,{children:r}),s)})}const MX=t=>Ue("MuiDayCalendar",t);Ge("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const DX=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],LX=["ownerState"],FX=t=>{const{classes:e}=t;return ze({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},MX,e)},hR=(fh+Kg*2)*6,IX=K("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),OX=K("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),AX=K(Mr,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(t.vars||t).palette.text.secondary})),VX=K(Mr,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),$X=K(Mr,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>S({},t.typography.caption,{width:fh,height:fh,padding:0,margin:`0 ${Kg}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),zX=K("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:hR}),WX=K(RX,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:hR}),HX=K("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),UX=K("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Kg}px 0`,display:"flex",justifyContent:"center"});function GX(t){let{parentProps:e,day:r,focusableDay:i,selectedDays:n,isDateDisabled:s,currentMonthNumber:a,isViewFocused:o}=t,l=le(t,DX);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:h,slots:p,slotProps:f,timezone:m}=e,y=qt(),v=Kl(m),g=i!==null&&y.isSameDay(r,i),b=n.some($=>y.isSameDay($,r)),k=y.isSameDay(r,v),C=(p==null?void 0:p.day)??fY,x=Ct({elementType:C,externalSlotProps:f==null?void 0:f.day,additionalProps:S({disableHighlightToday:u,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:d,"data-timestamp":y.toJsDate(r).valueOf()},l),ownerState:S({},e,{day:r,selected:b})}),_=le(x,LX),P=w.useMemo(()=>c||s(r),[c,s,r]),R=w.useMemo(()=>y.getMonth(r)!==a,[y,r,a]),E=w.useMemo(()=>{const $=y.startOfMonth(y.setMonth(r,a));return h?y.isSameDay(r,y.startOfWeek($)):y.isSameDay(r,$)},[a,r,h,y]),D=w.useMemo(()=>{const $=y.endOfMonth(y.setMonth(r,a));return h?y.isSameDay(r,y.endOfWeek($)):y.isSameDay(r,$)},[a,r,h,y]);return T.jsx(C,S({},_,{day:r,disabled:P,autoFocus:o&&g,today:k,outsideCurrentMonth:R,isFirstVisibleCell:E,isLastVisibleCell:D,selected:b,tabIndex:g?0:-1,"aria-selected":b,"aria-current":k?"date":void 0}))}function jX(t){const e=Ve({props:t,name:"MuiDayCalendar"}),r=qt(),{onFocusedDayChange:i,className:n,currentMonth:s,selectedDays:a,focusedDay:o,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:d,reduceAnimations:h,renderLoading:p=()=>T.jsx("span",{children:"..."}),slideDirection:f,TransitionProps:m,disablePast:y,disableFuture:v,minDate:g,maxDate:b,shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:x,dayOfWeekFormatter:_=ue=>r.format(ue,"weekdayShort").charAt(0).toUpperCase(),hasFocus:P,onFocusedViewChange:R,gridLabelId:E,displayWeekNumber:D,fixedWeekNumber:$,autoFocus:I,timezone:F}=e,M=Kl(F),O=FX(e),A=Xi(),N=uR({shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:x,minDate:g,maxDate:b,disablePast:y,disableFuture:v,timezone:F}),V=rn(),[W,Q]=xs({name:"DayCalendar",state:"hasFocus",controlled:P,default:I??!1}),[ne,ie]=w.useState(()=>o||M),te=Xe(ue=>{d||c(ue)}),j=ue=>{N(ue)||(i(ue),ie(ue),R==null||R(!0),Q(!0))},J=Xe((ue,L)=>{switch(ue.key){case"ArrowUp":j(r.addDays(L,-7)),ue.preventDefault();break;case"ArrowDown":j(r.addDays(L,7)),ue.preventDefault();break;case"ArrowLeft":{const U=r.addDays(L,A?1:-1),G=r.addMonths(L,A?1:-1),re=Md({utils:r,date:U,minDate:A?U:r.startOfMonth(G),maxDate:A?r.endOfMonth(G):U,isDateDisabled:N,timezone:F});j(re||U),ue.preventDefault();break}case"ArrowRight":{const U=r.addDays(L,A?-1:1),G=r.addMonths(L,A?-1:1),re=Md({utils:r,date:U,minDate:A?r.startOfMonth(G):U,maxDate:A?U:r.endOfMonth(G),isDateDisabled:N,timezone:F});j(re||U),ue.preventDefault();break}case"Home":j(r.startOfWeek(L)),ue.preventDefault();break;case"End":j(r.endOfWeek(L)),ue.preventDefault();break;case"PageUp":j(r.addMonths(L,1)),ue.preventDefault();break;case"PageDown":j(r.addMonths(L,-1)),ue.preventDefault();break}}),me=Xe((ue,L)=>j(L)),pe=Xe((ue,L)=>{W&&r.isSameDay(ne,L)&&(R==null||R(!1))}),De=r.getMonth(s),Be=r.getYear(s),Ce=w.useMemo(()=>a.filter(ue=>!!ue).map(ue=>r.startOfDay(ue)),[r,a]),Te=`${Be}-${De}`,X=w.useMemo(()=>w.createRef(),[Te]),ee=r.startOfWeek(M),Y=w.useMemo(()=>{const ue=r.startOfMonth(s),L=r.endOfMonth(s);return N(ne)||r.isAfterDay(ne,L)||r.isBeforeDay(ne,ue)?Md({utils:r,date:ne,minDate:ue,maxDate:L,disablePast:y,disableFuture:v,isDateDisabled:N,timezone:F}):ne},[s,v,y,ne,N,r,F]),Pe=w.useMemo(()=>{const ue=r.setTimezone(s,F),L=r.getWeekArray(ue);let U=r.addMonths(ue,1);for(;$&&L.length<$;){const G=r.getWeekArray(U),re=r.isSameDay(L[L.length-1][0],G[0][0]);G.slice(re?1:0).forEach(Se=>{L.length<$&&L.push(Se)}),U=r.addMonths(U,1)}return L},[s,$,r,F]);return T.jsxs(IX,{role:"grid","aria-labelledby":E,className:O.root,children:[T.jsxs(OX,{role:"row",className:O.header,children:[D&&T.jsx(VX,{variant:"caption",role:"columnheader","aria-label":V.calendarWeekNumberHeaderLabel,className:O.weekNumberLabel,children:V.calendarWeekNumberHeaderText}),s9(r,M).map((ue,L)=>T.jsx(AX,{variant:"caption",role:"columnheader","aria-label":r.format(r.addDays(ee,L),"weekday"),className:O.weekDayLabel,children:_(ue)},L.toString()))]}),l?T.jsx(zX,{className:O.loadingContainer,children:p()}):T.jsx(WX,S({transKey:Te,onExited:u,reduceAnimations:h,slideDirection:f,className:ke(n,O.slideTransition)},m,{nodeRef:X,children:T.jsx(HX,{ref:X,role:"rowgroup",className:O.monthContainer,children:Pe.map((ue,L)=>T.jsxs(UX,{role:"row",className:O.weekContainer,"aria-rowindex":L+1,children:[D&&T.jsx($X,{className:O.weekNumber,role:"rowheader","aria-label":V.calendarWeekNumberAriaLabelText(r.getWeekNumber(ue[0])),children:V.calendarWeekNumberText(r.getWeekNumber(ue[0]))}),ue.map((U,G)=>T.jsx(GX,{parentProps:e,day:U,selectedDays:Ce,focusableDay:Y,onKeyDown:J,onFocus:me,onBlur:pe,onDaySelect:te,isDateDisabled:N,currentMonthNumber:De,isViewFocused:W,"aria-colindex":G+1},U.toString()))]},`week-${ue[0]}`))})}))]})}function YX(t){return Ue("MuiPickersMonth",t)}const Of=Ge("MuiPickersMonth",["root","monthButton","disabled","selected"]),XX=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],qX=t=>{const{disabled:e,selected:r,classes:i}=t;return ze({root:["root"],monthButton:["monthButton",e&&"disabled",r&&"selected"]},YX,i)},KX=K("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),QX=K("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${Of.disabled}`]:e.disabled},{[`&.${Of.selected}`]:e.selected}]})(({theme:t})=>S({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Of.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${Of.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),JX=w.memo(function(e){const r=Ve({props:e,name:"MuiPickersMonth"}),{autoFocus:i,className:n,children:s,disabled:a,selected:o,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:h,onBlur:p,"aria-current":f,"aria-label":m,slots:y,slotProps:v}=r,g=le(r,XX),b=w.useRef(null),k=qX(r);zr(()=>{var _;i&&((_=b.current)==null||_.focus())},[i]);const C=(y==null?void 0:y.monthButton)??QX,x=Ct({elementType:C,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:s,disabled:a,tabIndex:c,ref:b,type:"button",role:"radio","aria-current":f,"aria-checked":o,"aria-label":m,onClick:_=>u(_,l),onKeyDown:_=>d(_,l),onFocus:_=>h(_,l),onBlur:_=>p(_,l)},ownerState:r,className:k.monthButton});return T.jsx(KX,S({className:ke(k.root,n),ownerState:r},g,{children:T.jsx(C,S({},x))}))});function ZX(t){return Ue("MuiMonthCalendar",t)}Ge("MuiMonthCalendar",["root"]);const eq=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],tq=t=>{const{classes:e}=t;return ze({root:["root"]},ZX,e)};function rq(t,e){const r=qt(),i=Yh(),n=Ve({props:t,name:e});return S({disableFuture:!1,disablePast:!1},n,{minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate)})}const iq=K("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Qg,boxSizing:"border-box"}),nq=w.forwardRef(function(e,r){const i=rq(e,"MuiMonthCalendar"),{className:n,value:s,defaultValue:a,referenceDate:o,disabled:l,disableFuture:c,disablePast:u,maxDate:d,minDate:h,onChange:p,shouldDisableMonth:f,readOnly:m,autoFocus:y=!1,onMonthFocus:v,hasFocus:g,onFocusedViewChange:b,monthsPerRow:k=3,timezone:C,gridLabelId:x,slots:_,slotProps:P}=i,R=le(i,eq),{value:E,handleValueChange:D,timezone:$}=_u({name:"MonthCalendar",timezone:C,value:s,defaultValue:a,onChange:p,valueManager:en}),I=Kl($),F=Xi(),M=qt(),O=w.useMemo(()=>en.getInitialReferenceValue({value:E,utils:M,props:i,timezone:$,referenceDate:o,granularity:zs.month}),[]),A=i,N=tq(A),V=w.useMemo(()=>M.getMonth(I),[M,I]),W=w.useMemo(()=>E!=null?M.getMonth(E):null,[E,M]),[Q,ne]=w.useState(()=>W||M.getMonth(O)),[ie,te]=xs({name:"MonthCalendar",state:"hasFocus",controlled:g,default:y??!1}),j=Xe(Te=>{te(Te),b&&b(Te)}),J=w.useCallback(Te=>{const X=M.startOfMonth(u&&M.isAfter(I,h)?I:h),ee=M.startOfMonth(c&&M.isBefore(I,d)?I:d),Y=M.startOfMonth(Te);return M.isBefore(Y,X)||M.isAfter(Y,ee)?!0:f?f(Y):!1},[c,u,d,h,I,f,M]),me=Xe((Te,X)=>{if(m)return;const ee=M.setMonth(E??O,X);D(ee)}),pe=Xe(Te=>{J(M.setMonth(E??O,Te))||(ne(Te),j(!0),v&&v(Te))});w.useEffect(()=>{ne(Te=>W!==null&&Te!==W?W:Te)},[W]);const De=Xe((Te,X)=>{switch(Te.key){case"ArrowUp":pe((12+X-3)%12),Te.preventDefault();break;case"ArrowDown":pe((12+X+3)%12),Te.preventDefault();break;case"ArrowLeft":pe((12+X+(F?1:-1))%12),Te.preventDefault();break;case"ArrowRight":pe((12+X+(F?-1:1))%12),Te.preventDefault();break}}),Be=Xe((Te,X)=>{pe(X)}),Ce=Xe((Te,X)=>{Q===X&&j(!1)});return T.jsx(iq,S({ref:r,className:ke(N.root,n),ownerState:A,role:"radiogroup","aria-labelledby":x},R,{children:gS(M,E??O).map(Te=>{const X=M.getMonth(Te),ee=M.format(Te,"monthShort"),Y=M.format(Te,"month"),Pe=X===W,ue=l||J(Te);return T.jsx(JX,{selected:Pe,value:X,onClick:me,onKeyDown:De,autoFocus:ie&&X===Q,disabled:ue,tabIndex:X===Q&&!ue?0:-1,onFocus:Be,onBlur:Ce,"aria-current":V===X?"date":void 0,"aria-label":Y,monthsPerRow:k,slots:_,slotProps:P,children:ee},ee)})}))});function sq(t){return Ue("MuiPickersYear",t)}const Af=Ge("MuiPickersYear",["root","yearButton","selected","disabled"]),aq=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],oq=t=>{const{disabled:e,selected:r,classes:i}=t;return ze({root:["root"],yearButton:["yearButton",e&&"disabled",r&&"selected"]},sq,i)},lq=K("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),cq=K("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${Af.disabled}`]:e.disabled},{[`&.${Af.selected}`]:e.selected}]})(({theme:t})=>S({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:Ca(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ca(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Af.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${Af.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),uq=w.memo(function(e){const r=Ve({props:e,name:"MuiPickersYear"}),{autoFocus:i,className:n,children:s,disabled:a,selected:o,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:h,onBlur:p,"aria-current":f,slots:m,slotProps:y}=r,v=le(r,aq),g=w.useRef(null),b=oq(r);zr(()=>{var x;i&&((x=g.current)==null||x.focus())},[i]);const k=(m==null?void 0:m.yearButton)??cq,C=Ct({elementType:k,externalSlotProps:y==null?void 0:y.yearButton,additionalProps:{children:s,disabled:a,tabIndex:c,ref:g,type:"button",role:"radio","aria-current":f,"aria-checked":o,onClick:x=>u(x,l),onKeyDown:x=>d(x,l),onFocus:x=>h(x,l),onBlur:x=>p(x,l)},ownerState:r,className:b.yearButton});return T.jsx(lq,S({className:ke(b.root,n),ownerState:r},v,{children:T.jsx(k,S({},C))}))});function dq(t){return Ue("MuiYearCalendar",t)}Ge("MuiYearCalendar",["root"]);const hq=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsPerRow","timezone","gridLabelId","slots","slotProps"],fq=t=>{const{classes:e}=t;return ze({root:["root"]},dq,e)};function pq(t,e){const r=qt(),i=Yh(),n=Ve({props:t,name:e});return S({disablePast:!1,disableFuture:!1},n,{yearsPerRow:n.yearsPerRow??3,minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate)})}const mq=K("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Qg,maxHeight:zj,boxSizing:"border-box",position:"relative"}),gq=w.forwardRef(function(e,r){const i=pq(e,"MuiYearCalendar"),{autoFocus:n,className:s,value:a,defaultValue:o,referenceDate:l,disabled:c,disableFuture:u,disablePast:d,maxDate:h,minDate:p,onChange:f,readOnly:m,shouldDisableYear:y,onYearFocus:v,hasFocus:g,onFocusedViewChange:b,yearsPerRow:k,timezone:C,gridLabelId:x,slots:_,slotProps:P}=i,R=le(i,hq),{value:E,handleValueChange:D,timezone:$}=_u({name:"YearCalendar",timezone:C,value:a,defaultValue:o,onChange:f,valueManager:en}),I=Kl($),F=Xi(),M=qt(),O=w.useMemo(()=>en.getInitialReferenceValue({value:E,utils:M,props:i,timezone:$,referenceDate:l,granularity:zs.year}),[]),A=i,N=fq(A),V=w.useMemo(()=>M.getYear(I),[M,I]),W=w.useMemo(()=>E!=null?M.getYear(E):null,[E,M]),[Q,ne]=w.useState(()=>W||M.getYear(O)),[ie,te]=xs({name:"YearCalendar",state:"hasFocus",controlled:g,default:n??!1}),j=Xe(ee=>{te(ee),b&&b(ee)}),J=w.useCallback(ee=>{if(d&&M.isBeforeYear(ee,I)||u&&M.isAfterYear(ee,I)||p&&M.isBeforeYear(ee,p)||h&&M.isAfterYear(ee,h))return!0;if(!y)return!1;const Y=M.startOfYear(ee);return y(Y)},[u,d,h,p,I,y,M]),me=Xe((ee,Y)=>{if(m)return;const Pe=M.setYear(E??O,Y);D(Pe)}),pe=Xe(ee=>{J(M.setYear(E??O,ee))||(ne(ee),j(!0),v==null||v(ee))});w.useEffect(()=>{ne(ee=>W!==null&&ee!==W?W:ee)},[W]);const De=Xe((ee,Y)=>{switch(ee.key){case"ArrowUp":pe(Y-k),ee.preventDefault();break;case"ArrowDown":pe(Y+k),ee.preventDefault();break;case"ArrowLeft":pe(Y+(F?1:-1)),ee.preventDefault();break;case"ArrowRight":pe(Y+(F?-1:1)),ee.preventDefault();break}}),Be=Xe((ee,Y)=>{pe(Y)}),Ce=Xe((ee,Y)=>{Q===Y&&j(!1)}),Te=w.useRef(null),X=Wt(r,Te);return w.useEffect(()=>{if(n||Te.current===null)return;const ee=Te.current.querySelector('[tabindex="0"]');if(!ee)return;const Y=ee.offsetHeight,Pe=ee.offsetTop,ue=Te.current.clientHeight,L=Te.current.scrollTop,U=Pe+Y;Y>ue||Pe{const Y=M.getYear(ee),Pe=Y===W,ue=c||J(ee);return T.jsx(uq,{selected:Pe,value:Y,onClick:me,onKeyDown:De,autoFocus:ie&&Y===Q,disabled:ue,tabIndex:Y===Q&&!ue?0:-1,onFocus:Be,onBlur:Ce,"aria-current":V===Y?"date":void 0,yearsPerRow:k,slots:_,slotProps:P,children:M.format(ee,"year")},M.format(ee,"year"))})}))}),yq=t=>Ue("MuiPickersCalendarHeader",t),bq=Ge("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),vq=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],wq=["ownerState"],Sq=t=>{const{classes:e}=t;return ze({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},yq,e)},xq=K("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),kq=K("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>S({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),Cq=K("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Tq=K(yn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${bq.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),_q=K(kj,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),Bq=w.forwardRef(function(e,r){const i=rn(),n=qt(),s=Ve({props:e,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:o,currentMonth:l,disabled:c,disableFuture:u,disablePast:d,maxDate:h,minDate:p,onMonthChange:f,onViewChange:m,view:y,reduceAnimations:v,views:g,labelId:b,className:k,timezone:C,format:x=`${n.formats.month} ${n.formats.year}`}=s,_=le(s,vq),P=s,R=Sq(s),E=(a==null?void 0:a.switchViewButton)??Tq,D=Ct({elementType:E,externalSlotProps:o==null?void 0:o.switchViewButton,additionalProps:{size:"small","aria-label":i.calendarViewSwitchingButtonAriaLabel(y)},ownerState:P,className:R.switchViewButton}),$=(a==null?void 0:a.switchViewIcon)??_q,I=Ct({elementType:$,externalSlotProps:o==null?void 0:o.switchViewIcon,ownerState:void 0,className:R.switchViewIcon}),F=le(I,wq),M=()=>f(n.addMonths(l,1),"left"),O=()=>f(n.addMonths(l,-1),"right"),A=Vj(l,{disableFuture:u,maxDate:h,timezone:C}),N=$j(l,{disablePast:d,minDate:p,timezone:C}),V=()=>{if(!(g.length===1||!m||c))if(g.length===2)m(g.find(Q=>Q!==y)||g[0]);else{const Q=g.indexOf(y)!==0?0:1;m(g[Q])}};if(g.length===1&&g[0]==="year")return null;const W=n.formatByString(l,x);return T.jsxs(xq,S({},_,{ownerState:P,className:ke(k,R.root),ref:r,children:[T.jsxs(kq,{role:"presentation",onClick:V,ownerState:P,"aria-live":"polite",className:R.labelContainer,children:[T.jsx(dR,{reduceAnimations:v,transKey:W,children:T.jsx(Cq,{id:b,ownerState:P,className:R.label,children:W})}),g.length>1&&!c&&T.jsx(E,S({},D,{children:T.jsx($,S({},F))}))]}),T.jsx(Cu,{in:y==="day",children:T.jsx(EE,{slots:a,slotProps:o,onGoToPrevious:O,isPreviousDisabled:N,previousLabel:i.previousMonth,onGoToNext:M,isNextDisabled:A,nextLabel:i.nextMonth})})]}))}),Pq="@media (prefers-reduced-motion: reduce)",Hc=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),SC=Hc&&Hc[1]?parseInt(Hc[1],10):null,xC=Hc&&Hc[2]?parseInt(Hc[2],10):null,Nq=SC&&SC<10||xC&&xC<13||!1,fR=()=>Mw(Pq,{defaultMatches:!1})||Nq,Eq=t=>Ue("MuiDateCalendar",t);Ge("MuiDateCalendar",["root","viewTransitionContainer"]);const Rq=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsPerRow","monthsPerRow","timezone"],Mq=t=>{const{classes:e}=t;return ze({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Eq,e)};function Dq(t,e){const r=qt(),i=Yh(),n=fR(),s=Ve({props:t,name:e});return S({},s,{loading:s.loading??!1,disablePast:s.disablePast??!1,disableFuture:s.disableFuture??!1,openTo:s.openTo??"day",views:s.views??["year","day"],reduceAnimations:s.reduceAnimations??n,renderLoading:s.renderLoading??(()=>T.jsx("span",{children:"..."})),minDate:Bs(r,s.minDate,i.minDate),maxDate:Bs(r,s.maxDate,i.maxDate)})}const Lq=K(Jg,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:mS}),Fq=K(dR,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Iq=w.forwardRef(function(e,r){const i=qt(),n=ia(),s=Dq(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:o,value:l,defaultValue:c,referenceDate:u,disableFuture:d,disablePast:h,onChange:p,onYearChange:f,onMonthChange:m,reduceAnimations:y,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:b,view:k,views:C,openTo:x,className:_,disabled:P,readOnly:R,minDate:E,maxDate:D,disableHighlightToday:$,focusedView:I,onFocusedViewChange:F,showDaysOutsideCurrentMonth:M,fixedWeekNumber:O,dayOfWeekFormatter:A,slots:N,slotProps:V,loading:W,renderLoading:Q,displayWeekNumber:ne,yearsPerRow:ie,monthsPerRow:te,timezone:j}=s,J=le(s,Rq),{value:me,handleValueChange:pe,timezone:De}=_u({name:"DateCalendar",timezone:j,value:l,defaultValue:c,onChange:p,valueManager:en}),{view:Be,setView:Ce,focusedView:Te,setFocusedView:X,goToNextView:ee,setValueAndGoToNextView:Y}=qh({view:k,views:C,openTo:x,onChange:pe,onViewChange:o,autoFocus:a,focusedView:I,onFocusedViewChange:F}),{referenceDate:Pe,calendarState:ue,changeFocusedDay:L,changeMonth:U,handleChangeMonth:G,isDateDisabled:re,onMonthSwitchingAnimationEnd:Se}=kX({value:me,referenceDate:u,reduceAnimations:y,onMonthChange:m,minDate:E,maxDate:D,shouldDisableDate:v,disablePast:h,disableFuture:d,timezone:De}),ge=P&&me||E,Re=P&&me||D,Ke=`${n}-grid-label`,ct=Te!==null,Pt=(N==null?void 0:N.calendarHeader)??Bq,ve=Ct({elementType:Pt,externalSlotProps:V==null?void 0:V.calendarHeader,additionalProps:{views:C,view:Be,currentMonth:ue.currentMonth,onViewChange:Ce,onMonthChange:(st,Ht)=>G({newMonth:st,direction:Ht}),minDate:ge,maxDate:Re,disabled:P,disablePast:h,disableFuture:d,reduceAnimations:y,timezone:De,labelId:Ke},ownerState:s}),ce=Xe(st=>{const Ht=i.startOfMonth(st),Sr=i.endOfMonth(st),_r=re(st)?Md({utils:i,date:st,minDate:i.isBefore(E,Ht)?Ht:E,maxDate:i.isAfter(D,Sr)?Sr:D,disablePast:h,disableFuture:d,isDateDisabled:re,timezone:De}):st;_r?(Y(_r,"finish"),m==null||m(Ht)):(ee(),U(Ht)),L(_r,!0)}),Qe=Xe(st=>{const Ht=i.startOfYear(st),Sr=i.endOfYear(st),_r=re(st)?Md({utils:i,date:st,minDate:i.isBefore(E,Ht)?Ht:E,maxDate:i.isAfter(D,Sr)?Sr:D,disablePast:h,disableFuture:d,isDateDisabled:re,timezone:De}):st;_r?(Y(_r,"finish"),f==null||f(_r)):(ee(),U(Ht)),L(_r,!0)}),bt=Xe(st=>pe(st&&cm(i,st,me??Pe),"finish",Be));w.useEffect(()=>{me!=null&&i.isValid(me)&&U(me)},[me]);const Tt=s,Ie=Mq(Tt),xt={disablePast:h,disableFuture:d,maxDate:D,minDate:E},Le={disableHighlightToday:$,readOnly:R,disabled:P,timezone:De,gridLabelId:Ke,slots:N,slotProps:V},Oe=w.useRef(Be);w.useEffect(()=>{Oe.current!==Be&&(Te===Oe.current&&X(Be,!0),Oe.current=Be)},[Te,X,Be]);const wt=w.useMemo(()=>[me],[me]);return T.jsxs(Lq,S({ref:r,className:ke(Ie.root,_),ownerState:Tt},J,{children:[T.jsx(Pt,S({},ve,{slots:N,slotProps:V})),T.jsx(Fq,{reduceAnimations:y,className:Ie.viewTransitionContainer,transKey:Be,ownerState:Tt,children:T.jsxs("div",{children:[Be==="year"&&T.jsx(gq,S({},xt,Le,{value:me,onChange:Qe,shouldDisableYear:b,hasFocus:ct,onFocusedViewChange:st=>X("year",st),yearsPerRow:ie,referenceDate:Pe})),Be==="month"&&T.jsx(nq,S({},xt,Le,{hasFocus:ct,className:_,value:me,onChange:ce,shouldDisableMonth:g,onFocusedViewChange:st=>X("month",st),monthsPerRow:te,referenceDate:Pe})),Be==="day"&&T.jsx(jX,S({},ue,xt,Le,{onMonthSwitchingAnimationEnd:Se,onFocusedDayChange:L,reduceAnimations:y,selectedDays:wt,onSelectedDaysChange:bt,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:b,hasFocus:ct,onFocusedViewChange:st=>X("day",st),showDaysOutsideCurrentMonth:M,fixedWeekNumber:O,dayOfWeekFormatter:A,displayWeekNumber:ne,loading:W,renderLoading:Q}))]})})]}))});function pR(t){return Ue("MuiPickersToolbar",t)}Ge("MuiPickersToolbar",["root","content"]);const Oq=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Aq=t=>{const{classes:e,isLandscape:r}=t;return ze({root:["root"],content:["content"],penIconButton:["penIconButton",r&&"penIconButtonLandscape"]},pR,e)},Vq=K("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),$q=K("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),mR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersToolbar"}),{children:n,className:s,toolbarTitle:a,hidden:o,titleId:l}=i,c=le(i,Oq),u=i,d=Aq(u);return o?null:T.jsxs(Vq,S({ref:r,className:ke(d.root,s),ownerState:u},c,{children:[T.jsx(Mr,{color:"text.secondary",variant:"overline",id:l,children:a}),T.jsx($q,{className:d.content,ownerState:u,children:n})]}))});function zq(t){return Ue("MuiDatePickerToolbar",t)}Ge("MuiDatePickerToolbar",["root","title"]);const Wq=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],Hq=t=>{const{classes:e}=t;return ze({root:["root"],title:["title"]},zq,e)},Uq=K(mR,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Gq=K(Mr,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(t,e)=>e.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),jq=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDatePickerToolbar"}),{value:n,isLandscape:s,toolbarFormat:a,toolbarPlaceholder:o="––",views:l,className:c}=i,u=le(i,Wq),d=qt(),h=rn(),p=Hq(i),f=w.useMemo(()=>{if(!n)return o;const y=bS(d,{format:a,views:l},!0);return d.formatByString(n,y)},[n,a,o,d,l]),m=i;return T.jsx(Uq,S({ref:r,toolbarTitle:h.datePickerToolbarTitle,isLandscape:s,className:ke(p.root,c)},u,{children:T.jsx(Gq,{variant:"h4",align:s?"left":"center",ownerState:m,className:p.title,children:f})}))});function gR(t,e){const r=qt(),i=Yh(),n=Ve({props:t,name:e}),s=w.useMemo(()=>{var a;return((a=n.localeText)==null?void 0:a.toolbarTitle)==null?n.localeText:S({},n.localeText,{datePickerToolbarTitle:n.localeText.toolbarTitle})},[n.localeText]);return S({},n,{localeText:s},RE({views:n.views,openTo:n.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:n.disableFuture??!1,disablePast:n.disablePast??!1,minDate:Bs(r,n.minDate,i.minDate),maxDate:Bs(r,n.maxDate,i.maxDate),slots:S({toolbar:jq},n.slots)})}function Yq(t){return Ue("MuiPickersPopper",t)}Ge("MuiPickersPopper",["root","paper"]);const Xq=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],qq=t=>{const{classes:e}=t;return ze({root:["root"],paper:["paper"]},Yq,e)},Kq=K(p3,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Qq=K(Xl,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function Jq(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){s.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),s.current=!1}},[t]);const a=Xe(l=>{if(!s.current)return;const c=i.current;i.current=!1;const u=qr(n.current);if(!n.current||"clientX"in l&&Jq(l,u))return;if(r.current){r.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(n.current)>-1:d=!u.documentElement.contains(l.target)||n.current.contains(l.target),!d&&!c&&e(l)}),o=()=>{i.current=!0};return w.useEffect(()=>{if(t){const l=qr(n.current),c=()=>{r.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[t,a]),w.useEffect(()=>{if(t){const l=qr(n.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),i.current=!1}}},[t,a]),[n,o,o]}const eK=w.forwardRef((t,e)=>{const{PaperComponent:r,popperPlacement:i,ownerState:n,children:s,paperSlotProps:a,paperClasses:o,onPaperClick:l,onPaperTouchStart:c}=t,u=le(t,Xq),d=S({},n,{placement:i}),h=Ct({elementType:r,externalSlotProps:a,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:o,ownerState:d});return T.jsx(r,S({},u,h,{onClick:p=>{var f;l(p),(f=h.onClick)==null||f.call(h,p)},onTouchStart:p=>{var f;c(p),(f=h.onTouchStart)==null||f.call(h,p)},ownerState:d,children:s}))});function tK(t){const e=Ve({props:t,name:"MuiPickersPopper"}),{anchorEl:r,children:i,containerRef:n=null,shouldRestoreFocus:s,onBlur:a,onDismiss:o,open:l,role:c,placement:u,slots:d,slotProps:h,reduceAnimations:p}=e;w.useEffect(()=>{function M(O){l&&O.key==="Escape"&&o()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[o,l]);const f=w.useRef(null);w.useEffect(()=>{c==="tooltip"||s&&!s()||(l?f.current=ps(document):f.current&&f.current instanceof HTMLElement&&setTimeout(()=>{f.current instanceof HTMLElement&&f.current.focus()}))},[l,c,s]);const[m,y,v]=Zq(l,a??o),g=w.useRef(null),b=Wt(g,n),k=Wt(b,m),C=e,x=qq(C),_=fR(),P=p??_,R=M=>{M.key==="Escape"&&(M.stopPropagation(),o())},E=(d==null?void 0:d.desktopTransition)??P?Cu:GN,D=(d==null?void 0:d.desktopTrapFocus)??gN,$=(d==null?void 0:d.desktopPaper)??Qq,I=(d==null?void 0:d.popper)??Kq,F=Ct({elementType:I,externalSlotProps:h==null?void 0:h.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:r,placement:u,onKeyDown:R},className:x.root,ownerState:e});return T.jsx(I,S({},F,{children:({TransitionProps:M,placement:O})=>T.jsx(D,S({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},h==null?void 0:h.desktopTrapFocus,{children:T.jsx(E,S({},M,h==null?void 0:h.desktopTransition,{children:T.jsx(eK,{PaperComponent:$,ownerState:C,popperPlacement:O,ref:k,onPaperClick:y,onPaperTouchStart:v,paperClasses:x.paper,paperSlotProps:h==null?void 0:h.desktopPaper,children:i})}))}))}))}const rK=({open:t,onOpen:e,onClose:r})=>{const i=w.useRef(typeof t=="boolean").current,[n,s]=w.useState(!1);w.useEffect(()=>{if(i){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");s(t)}},[i,t]);const a=w.useCallback(o=>{i||s(o),o&&e&&e(),!o&&r&&r()},[i,e,r]);return{isOpen:n,setIsOpen:a}},iK=t=>{const{action:e,hasChanged:r,dateState:i,isControlled:n}=t,s=!n&&!i.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:r(i.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?s?!0:r(i.lastPublishedValue):!1},nK=t=>{const{action:e,hasChanged:r,dateState:i,isControlled:n,closeOnSelect:s}=t,a=!n&&!i.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?a&&["accept","today","clear"].includes(e.pickerAction)?!0:r(i.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&s?a?!0:r(i.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&r(i.lastCommittedValue):!1},sK=t=>{const{action:e,closeOnSelect:r}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&r:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},aK=({props:t,valueManager:e,valueType:r,wrapperVariant:i,validator:n})=>{const{onAccept:s,onChange:a,value:o,defaultValue:l,closeOnSelect:c=i==="desktop",timezone:u}=t,{current:d}=w.useRef(l),{current:h}=w.useRef(o!==void 0),p=qt(),f=ql(),{isOpen:m,setIsOpen:y}=rK(t),{timezone:v,value:g,handleValueChange:b}=vS({timezone:u,value:o,defaultValue:d,onChange:a,valueManager:e}),[k,C]=w.useState(()=>{let ie;return g!==void 0?ie=g:d!==void 0?ie=d:ie=e.emptyValue,{draft:ie,lastPublishedValue:ie,lastCommittedValue:ie,lastControlledValue:g,hasBeenModifiedSinceMount:!1}});YE(S({},t,{value:k.draft,timezone:v}),n,e.isSameError,e.defaultErrorState);const x=Xe(ie=>{const te={action:ie,dateState:k,hasChanged:Be=>!e.areValuesEqual(p,ie.value,Be),isControlled:h,closeOnSelect:c},j=iK(te),J=nK(te),me=sK(te);C(Be=>S({},Be,{draft:ie.value,lastPublishedValue:j?ie.value:Be.lastPublishedValue,lastCommittedValue:J?ie.value:Be.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let pe=null;const De=()=>(pe||(pe={validationError:ie.name==="setValueFromField"?ie.context.validationError:n({adapter:f,value:ie.value,props:S({},t,{value:ie.value,timezone:v})})},ie.name==="setValueFromShortcut"&&(pe.shortcut=ie.shortcut)),pe);j&&b(ie.value,De()),J&&s&&s(ie.value,De()),me&&y(!1)});if(g!==void 0&&(k.lastControlledValue===void 0||!e.areValuesEqual(p,k.lastControlledValue,g))){const ie=e.areValuesEqual(p,k.draft,g);C(te=>S({},te,{lastControlledValue:g},ie?{}:{lastCommittedValue:g,lastPublishedValue:g,draft:g,hasBeenModifiedSinceMount:!0}))}const _=Xe(()=>{x({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),P=Xe(()=>{x({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),R=Xe(()=>{x({value:k.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),E=Xe(()=>{x({value:k.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),D=Xe(()=>{x({value:e.getTodayValue(p,v,r),name:"setValueFromAction",pickerAction:"today"})}),$=Xe(ie=>{ie.preventDefault(),y(!0)}),I=Xe(ie=>{ie==null||ie.preventDefault(),y(!1)}),F=Xe((ie,te="partial")=>x({name:"setValueFromView",value:ie,selectionState:te})),M=Xe((ie,te,j)=>x({name:"setValueFromShortcut",value:ie,changeImportance:te,shortcut:j})),O=Xe((ie,te)=>x({name:"setValueFromField",value:ie,context:te})),A={onClear:_,onAccept:P,onDismiss:R,onCancel:E,onSetToday:D,onOpen:$,onClose:I},N={value:k.draft,onChange:O},V=w.useMemo(()=>e.cleanValue(p,k.draft),[p,e,k.draft]),W={value:V,onChange:F,onClose:I,open:m},ne=S({},A,{value:V,onChange:F,onSelectShortcut:M,isValid:ie=>{const te=n({adapter:f,value:ie,props:S({},t,{value:ie,timezone:v})});return!e.hasError(te)}});return{open:m,fieldProps:N,viewProps:W,layoutProps:ne,actions:A}},oK=["className","sx"],lK=({props:t,propsFromPickerValue:e,additionalViewProps:r,autoFocusView:i,rendererInterceptor:n,fieldRef:s})=>{const{onChange:a,open:o,onClose:l}=e,{view:c,views:u,openTo:d,onViewChange:h,viewRenderers:p,timezone:f}=t,m=le(t,oK),{view:y,setView:v,defaultView:g,focusedView:b,setFocusedView:k,setValueAndGoToNextView:C}=qh({view:c,views:u,openTo:d,onChange:a,onViewChange:h,autoFocus:i}),{hasUIView:x,viewModeLookup:_}=w.useMemo(()=>u.reduce((F,M)=>{let O;return p[M]!=null?O="UI":O="field",F.viewModeLookup[M]=O,O==="UI"&&(F.hasUIView=!0),F},{hasUIView:!1,viewModeLookup:{}}),[p,u]),P=w.useMemo(()=>u.reduce((F,M)=>p[M]!=null&&dh(M)?F+1:F,0),[p,u]),R=_[y],E=Xe(()=>R==="UI"),[D,$]=w.useState(R==="UI"?y:null);return D!==y&&_[y]==="UI"&&$(y),zr(()=>{R==="field"&&o&&(l(),setTimeout(()=>{var F,M;(F=s==null?void 0:s.current)==null||F.setSelectedSections(y),(M=s==null?void 0:s.current)==null||M.focusField(y)}))},[y]),zr(()=>{if(!o)return;let F=y;R==="field"&&D!=null&&(F=D),F!==g&&_[F]==="UI"&&_[g]==="UI"&&(F=g),F!==y&&v(F),k(F,!0)},[o]),{hasUIView:x,shouldRestoreFocus:E,layoutProps:{views:u,view:D,onViewChange:v},renderCurrentView:()=>{if(D==null)return null;const F=p[D];if(F==null)return null;const M=S({},m,r,e,{views:u,timezone:f,onChange:C,view:D,onViewChange:v,focusedView:b,onFocusedViewChange:k,showViewSwitcher:P>1,timeViewsCount:P});return n?n(p,D,M):F(M)}}};function kC(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const cK=(t,e)=>{const[r,i]=w.useState(kC);return zr(()=>{const s=()=>{i(kC())};return window.addEventListener("orientationchange",s),()=>{window.removeEventListener("orientationchange",s)}},[]),mc(t,["hours","minutes","seconds"])?!1:(e||r)==="landscape"},uK=({props:t,propsFromPickerValue:e,propsFromPickerViews:r,wrapperVariant:i})=>{const{orientation:n}=t,s=cK(r.views,n),a=Xi();return{layoutProps:S({},r,e,{isLandscape:s,isRtl:a,wrapperVariant:i,disabled:t.disabled,readOnly:t.readOnly})}},yR=(t,e="warning")=>{let r=!1;const i=Array.isArray(t)?t.join(` +`):t;return()=>{r||(r=!0,e==="error"?console.error(i):console.warn(i))}};yR(["The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.","You can replace it with the `textField` component slot in most cases.","For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5)."]);const bR=({props:t,valueManager:e,valueType:r,wrapperVariant:i,additionalViewProps:n,validator:s,autoFocusView:a,rendererInterceptor:o,fieldRef:l})=>{const c=aK({props:t,valueManager:e,valueType:r,wrapperVariant:i,validator:s}),u=lK({props:t,additionalViewProps:n,autoFocusView:a,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:o}),d=uK({props:t,wrapperVariant:i,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:d.layoutProps}};function vR(t){return Ue("MuiPickersLayout",t)}const ol=Ge("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),dK=["onAccept","onClear","onCancel","onSetToday","actions"];function hK(t){const{onAccept:e,onClear:r,onCancel:i,onSetToday:n,actions:s}=t,a=le(t,dK),o=rn();if(s==null||s.length===0)return null;const l=s==null?void 0:s.map(c=>{switch(c){case"clear":return T.jsx($a,{onClick:r,children:o.clearButtonLabel},c);case"cancel":return T.jsx($a,{onClick:i,children:o.cancelButtonLabel},c);case"accept":return T.jsx($a,{onClick:e,children:o.okButtonLabel},c);case"today":return T.jsx($a,{onClick:n,children:o.todayButtonLabel},c);default:return null}});return T.jsx(LN,S({},a,{children:l}))}const fK=["items","changeImportance","isLandscape","onChange","isValid"],pK=["getValue"];function mK(t){const{items:e,changeImportance:r="accept",onChange:i,isValid:n}=t,s=le(t,fK);if(e==null||e.length===0)return null;const a=e.map(o=>{let{getValue:l}=o,c=le(o,pK);const u=l({isValid:n});return S({},c,{label:c.label,onClick:()=>{i(u,r,c)},disabled:!n(u)})});return T.jsx(Gh,S({dense:!0,sx:[{maxHeight:mS,maxWidth:200,overflow:"auto"},...Array.isArray(s.sx)?s.sx:[s.sx]]},s,{children:a.map(o=>T.jsx(KN,{children:T.jsx(k3,S({},o))},o.id??o.label))}))}function gK(t){return t.view!==null}const yK=t=>{const{classes:e,isLandscape:r}=t;return ze({root:["root",r&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},vR,e)},bK=t=>{const{wrapperVariant:e,onAccept:r,onClear:i,onCancel:n,onSetToday:s,view:a,views:o,onViewChange:l,value:c,onChange:u,onSelectShortcut:d,isValid:h,isLandscape:p,disabled:f,readOnly:m,children:y,slots:v,slotProps:g}=t,b=yK(t),k=(v==null?void 0:v.actionBar)??hK,C=Ct({elementType:k,externalSlotProps:g==null?void 0:g.actionBar,additionalProps:{onAccept:r,onClear:i,onCancel:n,onSetToday:s,actions:e==="desktop"?[]:["cancel","accept"]},className:b.actionBar,ownerState:S({},t,{wrapperVariant:e})}),x=T.jsx(k,S({},C)),_=v==null?void 0:v.toolbar,P=Ct({elementType:_,externalSlotProps:g==null?void 0:g.toolbar,additionalProps:{isLandscape:p,onChange:u,value:c,view:a,onViewChange:l,views:o,disabled:f,readOnly:m},className:b.toolbar,ownerState:S({},t,{wrapperVariant:e})}),R=gK(P)&&_?T.jsx(_,S({},P)):null,E=y,D=v==null?void 0:v.tabs,$=a&&D?T.jsx(D,S({view:a,onViewChange:l,className:b.tabs},g==null?void 0:g.tabs)):null,I=(v==null?void 0:v.shortcuts)??mK,F=Ct({elementType:I,externalSlotProps:g==null?void 0:g.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:d},className:b.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:d,wrapperVariant:e}}),M=a&&I?T.jsx(I,S({},F)):null;return{toolbar:R,content:E,tabs:$,actionBar:x,shortcuts:M}},vK=t=>{const{isLandscape:e,classes:r}=t;return ze({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},vR,r)},wK=K("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${ol.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${ol.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${ol.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${ol.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${ol.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${ol.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${ol.shortcuts}`]:{gridColumn:3}}}]}),SK=K("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),wR=function(e){const r=Ve({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:n,tabs:s,actionBar:a,shortcuts:o}=bK(r),{sx:l,className:c,isLandscape:u,ref:d,wrapperVariant:h}=r,p=vK(r);return T.jsxs(wK,{ref:d,sx:l,className:ke(c,p.root),ownerState:r,children:[u?o:i,u?i:o,T.jsx(SK,{className:p.contentWrapper,children:h==="desktop"?T.jsxs(w.Fragment,{children:[n,s]}):T.jsxs(w.Fragment,{children:[s,n]})}),a]})},xK=["props","getOpenDialogAriaText"],kK=["ownerState"],CK=["ownerState"],SR=t=>{var X;let{props:e,getOpenDialogAriaText:r}=t,i=le(t,xK);const{slots:n,slotProps:s,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,name:f,label:m,inputRef:y,readOnly:v,disabled:g,autoFocus:b,localeText:k,reduceAnimations:C}=e,x=qt(),_=w.useRef(null),P=w.useRef(null),R=ia(),E=((X=s==null?void 0:s.toolbar)==null?void 0:X.hidden)??!1,{open:D,actions:$,hasUIView:I,layoutProps:F,renderCurrentView:M,shouldRestoreFocus:O,fieldProps:A}=bR(S({},i,{props:e,fieldRef:P,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),N=n.inputAdornment??YN,V=Ct({elementType:N,externalSlotProps:s==null?void 0:s.inputAdornment,additionalProps:{position:"end"},ownerState:e}),W=le(V,kK),Q=n.openPickerButton??yn,ne=Ct({elementType:Q,externalSlotProps:s==null?void 0:s.openPickerButton,additionalProps:{disabled:g||v,onClick:D?$.onClose:$.onOpen,"aria-label":r(A.value,x),edge:W.position},ownerState:e}),ie=le(ne,CK),te=n.openPickerIcon,j=n.field,J=Ct({elementType:j,externalSlotProps:s==null?void 0:s.field,additionalProps:S({},A,E&&{id:R},{readOnly:v,disabled:g,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,label:m,name:f,autoFocus:b&&!e.open,focused:D?!0:void 0},y?{inputRef:y}:{}),ownerState:e});I&&(J.InputProps=S({},J.InputProps,{ref:_},!e.disableOpenPicker&&{[`${W.position}Adornment`]:T.jsx(N,S({},W,{children:T.jsx(Q,S({},ie,{children:T.jsx(te,S({},s==null?void 0:s.openPickerIcon))}))}))}));const me=S({textField:n.textField,clearIcon:n.clearIcon,clearButton:n.clearButton},J.slots),pe=n.layout??wR;let De=R;E&&(m?De=`${R}-label`:De=void 0);const Be=S({},s,{toolbar:S({},s==null?void 0:s.toolbar,{titleId:R}),popper:S({"aria-labelledby":De},s==null?void 0:s.popper)}),Ce=Wt(P,J.unstableFieldRef);return{renderPicker:()=>T.jsxs(fS,{localeText:k,children:[T.jsx(j,S({},J,{slots:me,slotProps:Be,unstableFieldRef:Ce})),T.jsx(tK,S({role:"dialog",placement:"bottom-start",anchorEl:_.current},$,{open:D,slots:n,slotProps:Be,shouldRestoreFocus:O,reduceAnimations:C,children:T.jsx(pe,S({},F,Be==null?void 0:Be.layout,{slots:n,slotProps:Be,children:M()}))}))]})}},Uc=({view:t,onViewChange:e,views:r,focusedView:i,onFocusedViewChange:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:m,shouldDisableMonth:y,shouldDisableYear:v,reduceAnimations:g,onMonthChange:b,monthsPerRow:k,onYearChange:C,yearsPerRow:x,slots:_,slotProps:P,loading:R,renderLoading:E,disableHighlightToday:D,readOnly:$,disabled:I,showDaysOutsideCurrentMonth:F,dayOfWeekFormatter:M,sx:O,autoFocus:A,fixedWeekNumber:N,displayWeekNumber:V,timezone:W})=>T.jsx(Iq,{view:t,onViewChange:e,views:r.filter(uC),focusedView:i&&uC(i)?i:null,onFocusedViewChange:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:m,shouldDisableMonth:y,shouldDisableYear:v,reduceAnimations:g,onMonthChange:b,monthsPerRow:k,onYearChange:C,yearsPerRow:x,slots:_,slotProps:P,loading:R,renderLoading:E,disableHighlightToday:D,readOnly:$,disabled:I,showDaysOutsideCurrentMonth:F,dayOfWeekFormatter:M,sx:O,autoFocus:A,fixedWeekNumber:N,displayWeekNumber:V,timezone:W}),xR=w.forwardRef(function(e,r){var c,u;const i=rn(),n=qt(),s=gR(e,"MuiDesktopDatePicker"),a=S({day:Uc,month:Uc,year:Uc},s.viewRenderers),o=S({},s,{viewRenderers:a,format:bS(n,s,!1),yearsPerRow:s.yearsPerRow??4,slots:S({openPickerIcon:_j,field:lR},s.slots),slotProps:S({},s.slotProps,{field:d=>{var h;return S({},Wh((h=s.slotProps)==null?void 0:h.field,d),ty(s),{ref:r})},toolbar:S({hidden:!0},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=SR({props:o,valueManager:en,valueType:"date",getOpenDialogAriaText:((u=o.localeText)==null?void 0:u.openDatePickerDialogue)??i.openDatePickerDialogue,validator:ey});return l()});xR.propTypes={autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,dayOfWeekFormatter:z.func,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableHighlightToday:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,displayWeekNumber:z.bool,enableAccessibleFieldDOMStructure:z.any,fixedWeekNumber:z.number,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,loading:z.bool,localeText:z.object,maxDate:z.object,minDate:z.object,monthsPerRow:z.oneOf([3,4]),name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onMonthChange:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,onYearChange:z.func,open:z.bool,openTo:z.oneOf(["day","month","year"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,renderLoading:z.func,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableDate:z.func,shouldDisableMonth:z.func,shouldDisableYear:z.func,showDaysOutsideCurrentMonth:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["day","month","year"]),viewRenderers:z.shape({day:z.func,month:z.func,year:z.func}),views:z.arrayOf(z.oneOf(["day","month","year"]).isRequired),yearsPerRow:z.oneOf([3,4])};const TK=K(Gg)({[`& .${Ed.container}`]:{outline:0},[`& .${Ed.paper}`]:{outline:0,minWidth:Qg}}),_K=K(FN)({"&:first-of-type":{padding:0}});function BK(t){const{children:e,onDismiss:r,open:i,slots:n,slotProps:s}=t,a=(n==null?void 0:n.dialog)??TK,o=(n==null?void 0:n.mobileTransition)??Cu;return T.jsx(a,S({open:i,onClose:r},s==null?void 0:s.dialog,{TransitionComponent:o,TransitionProps:s==null?void 0:s.mobileTransition,PaperComponent:n==null?void 0:n.mobilePaper,PaperProps:s==null?void 0:s.mobilePaper,children:T.jsx(_K,{children:e})}))}const PK=["props","getOpenDialogAriaText"],kR=t=>{var Q;let{props:e,getOpenDialogAriaText:r}=t,i=le(t,PK);const{slots:n,slotProps:s,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,name:f,label:m,inputRef:y,readOnly:v,disabled:g,localeText:b}=e,k=qt(),C=w.useRef(null),x=ia(),_=((Q=s==null?void 0:s.toolbar)==null?void 0:Q.hidden)??!1,{open:P,actions:R,layoutProps:E,renderCurrentView:D,fieldProps:$}=bR(S({},i,{props:e,fieldRef:C,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),I=n.field,F=Ct({elementType:I,externalSlotProps:s==null?void 0:s.field,additionalProps:S({},$,_&&{id:x},!(g||v)&&{onClick:R.onOpen,onKeyDown:kY(R.onOpen)},{readOnly:v??!0,disabled:g,className:a,sx:o,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:h,timezone:p,label:m,name:f},y?{inputRef:y}:{}),ownerState:e});F.inputProps=S({},F.inputProps,{"aria-label":r($.value,k)});const M=S({textField:n.textField},F.slots),O=n.layout??wR;let A=x;_&&(m?A=`${x}-label`:A=void 0);const N=S({},s,{toolbar:S({},s==null?void 0:s.toolbar,{titleId:x}),mobilePaper:S({"aria-labelledby":A},s==null?void 0:s.mobilePaper)}),V=Wt(C,F.unstableFieldRef);return{renderPicker:()=>T.jsxs(fS,{localeText:b,children:[T.jsx(I,S({},F,{slots:M,slotProps:N,unstableFieldRef:V})),T.jsx(BK,S({},R,{open:P,slots:n,slotProps:N,children:T.jsx(O,S({},E,N==null?void 0:N.layout,{slots:n,slotProps:N,children:D()}))}))]})}},CR=w.forwardRef(function(e,r){var c,u;const i=rn(),n=qt(),s=gR(e,"MuiMobileDatePicker"),a=S({day:Uc,month:Uc,year:Uc},s.viewRenderers),o=S({},s,{viewRenderers:a,format:bS(n,s,!1),slots:S({field:lR},s.slots),slotProps:S({},s.slotProps,{field:d=>{var h;return S({},Wh((h=s.slotProps)==null?void 0:h.field,d),ty(s),{ref:r})},toolbar:S({hidden:!1},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=kR({props:o,valueManager:en,valueType:"date",getOpenDialogAriaText:((u=o.localeText)==null?void 0:u.openDatePickerDialogue)??i.openDatePickerDialogue,validator:ey});return l()});CR.propTypes={autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,dayOfWeekFormatter:z.func,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableHighlightToday:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,displayWeekNumber:z.bool,enableAccessibleFieldDOMStructure:z.any,fixedWeekNumber:z.number,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,loading:z.bool,localeText:z.object,maxDate:z.object,minDate:z.object,monthsPerRow:z.oneOf([3,4]),name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onMonthChange:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,onYearChange:z.func,open:z.bool,openTo:z.oneOf(["day","month","year"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,renderLoading:z.func,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableDate:z.func,shouldDisableMonth:z.func,shouldDisableYear:z.func,showDaysOutsideCurrentMonth:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["day","month","year"]),viewRenderers:z.shape({day:z.func,month:z.func,year:z.func}),views:z.arrayOf(z.oneOf(["day","month","year"]).isRequired),yearsPerRow:z.oneOf([3,4])};const NK=["desktopModeMediaQuery"],EK=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:n=XE}=i,s=le(i,NK);return Mw(n,{defaultMatches:!0})?T.jsx(xR,S({ref:r},s)):T.jsx(CR,S({ref:r},s))});function RK(t){return Ue("MuiPickersToolbarText",t)}const CC=Ge("MuiPickersToolbarText",["root","selected"]),MK=["className","selected","value"],DK=t=>{const{classes:e,selected:r}=t;return ze({root:["root",r&&"selected"]},RK,e)},LK=K(Mr,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${CC.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${CC.selected}`]:{color:(t.vars||t).palette.text.primary}})),TR=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersToolbarText"}),{className:n,value:s}=i,a=le(i,MK),o=DK(i);return T.jsx(LK,S({ref:r,className:ke(n,o.root),component:"span"},a,{children:s}))}),FK=["align","className","selected","typographyClassName","value","variant","width"],IK=t=>{const{classes:e}=t;return ze({root:["root"]},pR,e)},OK=K($a,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),rd=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiPickersToolbarButton"}),{align:n,className:s,selected:a,typographyClassName:o,value:l,variant:c,width:u}=i,d=le(i,FK),h=IK(i);return T.jsx(OK,S({variant:"text",ref:r,className:ke(s,h.root)},u?{sx:{width:u}}:{},d,{children:T.jsx(TR,{align:n,className:o,variant:c,value:l,selected:a})}))});function AK(t){return Ue("MuiTimePickerToolbar",t)}const Dd=Ge("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),VK=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],$K=t=>{const{isLandscape:e,classes:r,isRtl:i}=t;return ze({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",e&&"hourMinuteLabelLandscape",i&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",e&&"ampmLandscape"],ampmLabel:["ampmLabel"]},AK,r)},zK=K(mR,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),WK=K(TR,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),HK=K("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(t,e)=>[{[`&.${Dd.hourMinuteLabelLandscape}`]:e.hourMinuteLabelLandscape,[`&.${Dd.hourMinuteLabelReverse}`]:e.hourMinuteLabelReverse},e.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),UK=K("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${Dd.ampmLabel}`]:e.ampmLabel},{[`&.${Dd.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Dd.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function GK(t){const e=Ve({props:t,name:"MuiTimePickerToolbar"}),{ampm:r,ampmInClock:i,value:n,isLandscape:s,onChange:a,view:o,onViewChange:l,views:c,disabled:u,readOnly:d,className:h}=e,p=le(e,VK),f=qt(),m=rn(),y=Xi(),v=!!(r&&!i&&c.includes("hours")),{meridiemMode:g,handleMeridiemChange:b}=pS(n,r,a),k=P=>r?f.format(P,"hours12h"):f.format(P,"hours24h"),C=S({},e,{isRtl:y}),x=$K(C),_=T.jsx(WK,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:x.separator});return T.jsxs(zK,S({landscapeDirection:"row",toolbarTitle:m.timePickerToolbarTitle,isLandscape:s,ownerState:C,className:ke(x.root,h)},p,{children:[T.jsxs(HK,{className:x.hourMinuteLabel,ownerState:C,children:[mc(c,"hours")&&T.jsx(rd,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:o==="hours",value:n?k(n):"--"}),mc(c,["hours","minutes"])&&_,mc(c,"minutes")&&T.jsx(rd,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:o==="minutes",value:n?f.format(n,"minutes"):"--"}),mc(c,["minutes","seconds"])&&_,mc(c,"seconds")&&T.jsx(rd,{variant:"h3",onClick:()=>l("seconds"),selected:o==="seconds",value:n?f.format(n,"seconds"):"--"})]}),v&&T.jsxs(UK,{className:x.ampmSelection,ownerState:C,children:[T.jsx(rd,{disableRipple:!0,variant:"subtitle2",selected:g==="am",typographyClassName:x.ampmLabel,value:To(f,"am"),onClick:d?void 0:()=>b("am"),disabled:u}),T.jsx(rd,{disableRipple:!0,variant:"subtitle2",selected:g==="pm",typographyClassName:x.ampmLabel,value:To(f,"pm"),onClick:d?void 0:()=>b("pm"),disabled:u})]})]}))}function _R(t,e){var a;const r=qt(),i=Ve({props:t,name:e}),n=i.ampm??r.is12HourCycleInCurrentLocale(),s=w.useMemo(()=>{var o;return((o=i.localeText)==null?void 0:o.toolbarTitle)==null?i.localeText:S({},i.localeText,{timePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return S({},i,{ampm:n,localeText:s},RE({views:i.views,openTo:i.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,slots:S({toolbar:GK},i.slots),slotProps:S({},i.slotProps,{toolbar:S({ampm:n,ampmInClock:i.ampmInClock},(a=i.slotProps)==null?void 0:a.toolbar)})})}const rb=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,ampmInClock:g,slots:b,slotProps:k,readOnly:C,disabled:x,sx:_,autoFocus:P,showViewSwitcher:R,disableIgnoringDatePartForTimeValidation:E,timezone:D})=>T.jsx(z9,{view:t,onViewChange:e,focusedView:r&&dh(r)?r:null,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,ampmInClock:g,slots:b,slotProps:k,readOnly:C,disabled:x,sx:_,autoFocus:P,showViewSwitcher:R,disableIgnoringDatePartForTimeValidation:E,timezone:D}),jK=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D})=>T.jsx(X9,{view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeStep:R==null?void 0:R.minutes,skipDisabled:E,timezone:D}),TC=({view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n,value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D})=>T.jsx(aY,{view:t,onViewChange:e,focusedView:r,onFocusedViewChange:i,views:n.filter(dh),value:s,defaultValue:a,referenceDate:o,onChange:l,className:c,classes:u,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:m,minutesStep:y,ampm:v,slots:g,slotProps:b,readOnly:k,disabled:C,sx:x,autoFocus:_,disableIgnoringDatePartForTimeValidation:P,timeSteps:R,skipDisabled:E,timezone:D}),YK=(t,e,r)=>r?e.filter(i=>!Ij(i)||i==="hours"):t?[...e,"meridiem"]:e,XK=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function qK({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:r,views:i}){const n=t??24,s=S({hours:1,minutes:5,seconds:5},r),a=XK(s,n);return{thresholdToRenderTimeInASingleColumn:n,timeSteps:s,shouldRenderTimeInASingleColumn:a,views:YK(e,i,a)}}const BR=w.forwardRef(function(e,r){var v,g,b,k;const i=rn(),n=qt(),s=_R(e,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:a,views:o,timeSteps:l}=qK(s),c=a?jK:TC,u=S({hours:c,minutes:c,seconds:c,meridiem:c},s.viewRenderers),d=s.ampmInClock??!0,h=a?[]:["accept"],f=((v=u.hours)==null?void 0:v.name)===TC.name?o:o.filter(C=>C!=="meridiem"),m=S({},s,{ampmInClock:d,timeSteps:l,viewRenderers:u,format:DE(n,s),views:a?["hours"]:f,slots:S({field:cR,openPickerIcon:Bj},s.slots),slotProps:S({},s.slotProps,{field:C=>{var x;return S({},Wh((x=s.slotProps)==null?void 0:x.field,C),ty(s),{ref:r})},toolbar:S({hidden:!0,ampmInClock:d},(g=s.slotProps)==null?void 0:g.toolbar),actionBar:S({actions:h},(b=s.slotProps)==null?void 0:b.actionBar)})}),{renderPicker:y}=SR({props:m,valueManager:en,valueType:"time",getOpenDialogAriaText:((k=m.localeText)==null?void 0:k.openTimePickerDialogue)??i.openTimePickerDialogue,validator:TS});return y()});BR.propTypes={ampm:z.bool,ampmInClock:z.bool,autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableIgnoringDatePartForTimeValidation:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,enableAccessibleFieldDOMStructure:z.any,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,localeText:z.object,maxTime:z.object,minTime:z.object,minutesStep:z.number,name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,open:z.bool,openTo:z.oneOf(["hours","meridiem","minutes","seconds"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableTime:z.func,skipDisabled:z.bool,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),thresholdToRenderTimeInASingleColumn:z.number,timeSteps:z.shape({hours:z.number,minutes:z.number,seconds:z.number}),timezone:z.string,value:z.object,view:z.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:z.shape({hours:z.func,meridiem:z.func,minutes:z.func,seconds:z.func}),views:z.arrayOf(z.oneOf(["hours","minutes","seconds"]).isRequired)};const PR=w.forwardRef(function(e,r){var u,d;const i=rn(),n=qt(),s=_R(e,"MuiMobileTimePicker"),a=S({hours:rb,minutes:rb,seconds:rb},s.viewRenderers),o=s.ampmInClock??!1,l=S({},s,{ampmInClock:o,viewRenderers:a,format:DE(n,s),slots:S({field:cR},s.slots),slotProps:S({},s.slotProps,{field:h=>{var p;return S({},Wh((p=s.slotProps)==null?void 0:p.field,h),ty(s),{ref:r})},toolbar:S({hidden:!1,ampmInClock:o},(u=s.slotProps)==null?void 0:u.toolbar)})}),{renderPicker:c}=kR({props:l,valueManager:en,valueType:"time",getOpenDialogAriaText:((d=l.localeText)==null?void 0:d.openTimePickerDialogue)??i.openTimePickerDialogue,validator:TS});return c()});PR.propTypes={ampm:z.bool,ampmInClock:z.bool,autoFocus:z.bool,className:z.string,closeOnSelect:z.bool,defaultValue:z.object,disabled:z.bool,disableFuture:z.bool,disableIgnoringDatePartForTimeValidation:z.bool,disableOpenPicker:z.bool,disablePast:z.bool,enableAccessibleFieldDOMStructure:z.any,format:z.string,formatDensity:z.oneOf(["dense","spacious"]),inputRef:xg,label:z.node,localeText:z.object,maxTime:z.object,minTime:z.object,minutesStep:z.number,name:z.string,onAccept:z.func,onChange:z.func,onClose:z.func,onError:z.func,onOpen:z.func,onSelectedSectionsChange:z.func,onViewChange:z.func,open:z.bool,openTo:z.oneOf(["hours","minutes","seconds"]),orientation:z.oneOf(["landscape","portrait"]),readOnly:z.bool,reduceAnimations:z.bool,referenceDate:z.object,selectedSections:z.oneOfType([z.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),z.number]),shouldDisableTime:z.func,slotProps:z.object,slots:z.object,sx:z.oneOfType([z.arrayOf(z.oneOfType([z.func,z.object,z.bool])),z.func,z.object]),timezone:z.string,value:z.object,view:z.oneOf(["hours","minutes","seconds"]),viewRenderers:z.shape({hours:z.func,minutes:z.func,seconds:z.func}),views:z.arrayOf(z.oneOf(["hours","minutes","seconds"]).isRequired)};const KK=["desktopModeMediaQuery"],_C=w.forwardRef(function(e,r){const i=Ve({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:n=XE}=i,s=le(i,KK);return Mw(n,{defaultMatches:!0})?T.jsx(BR,S({ref:r},s)):T.jsx(PR,S({ref:r},s))});var Kh=t=>t.type==="checkbox",Rc=t=>t instanceof Date,un=t=>t==null;const NR=t=>typeof t=="object";var Li=t=>!un(t)&&!Array.isArray(t)&&NR(t)&&!Rc(t),ER=t=>Li(t)&&t.target?Kh(t.target)?t.target.checked:t.target.value:t,QK=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,RR=(t,e)=>t.has(QK(e)),JK=t=>{const e=t.constructor&&t.constructor.prototype;return Li(e)&&e.hasOwnProperty("isPrototypeOf")},_S=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Sn(t){let e;const r=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(_S&&(t instanceof Blob||t instanceof FileList))&&(r||Li(t)))if(e=r?[]:{},!r&&!JK(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=Sn(t[i]));else return t;return e}var Qh=t=>Array.isArray(t)?t.filter(Boolean):[],si=t=>t===void 0,Ye=(t,e,r)=>{if(!e||!Li(t))return r;const i=Qh(e.split(/[,[\].]+?/)).reduce((n,s)=>un(n)?n:n[s],t);return si(i)||i===t?si(t[e])?r:t[e]:i},pa=t=>typeof t=="boolean",BS=t=>/^\w*$/.test(t),MR=t=>Qh(t.replace(/["|']|\]/g,"").split(/\.|\[/)),yr=(t,e,r)=>{let i=-1;const n=BS(e)?[e]:MR(e),s=n.length,a=s-1;for(;++iAt.useContext(ZK);var DR=(t,e,r,i=!0)=>{const n={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(n,s,{get:()=>{const a=s;return e._proxyFormState[a]!==Us.all&&(e._proxyFormState[a]=!i||Us.all),r&&(r[a]=!0),t[a]}});return n},An=t=>Li(t)&&!Object.keys(t).length,LR=(t,e,r,i)=>{r(t);const{name:n,...s}=t;return An(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!i||Us.all))},yp=t=>Array.isArray(t)?t:[t],FR=(t,e,r)=>!t||!e||t===e||yp(t).some(i=>i&&(r?i===e:i.startsWith(e)||e.startsWith(i)));function NS(t){const e=At.useRef(t);e.current=t,At.useEffect(()=>{const r=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{r&&r.unsubscribe()}},[t.disabled])}function eQ(t){const e=PS(),{control:r=e.control,disabled:i,name:n,exact:s}=t||{},[a,o]=At.useState(r._formState),l=At.useRef(!0),c=At.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=At.useRef(n);return u.current=n,NS({disabled:i,next:d=>l.current&&FR(u.current,d.name,s)&&LR(d,c.current,r._updateFormState)&&o({...r._formState,...d}),subject:r._subjects.state}),At.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),DR(a,r,c.current,!1)}var ya=t=>typeof t=="string",IR=(t,e,r,i,n)=>ya(t)?(i&&e.watch.add(t),Ye(r,t,n)):Array.isArray(t)?t.map(s=>(i&&e.watch.add(s),Ye(r,s))):(i&&(e.watchAll=!0),r);function tQ(t){const e=PS(),{control:r=e.control,name:i,defaultValue:n,disabled:s,exact:a}=t||{},o=At.useRef(i);o.current=i,NS({disabled:s,subject:r._subjects.values,next:u=>{FR(o.current,u.name,a)&&c(Sn(IR(o.current,r._names,u.values||r._formValues,!1,n)))}});const[l,c]=At.useState(r._getWatch(i,n));return At.useEffect(()=>r._removeUnmounted()),l}function rQ(t){const e=PS(),{name:r,disabled:i,control:n=e.control,shouldUnregister:s}=t,a=RR(n._names.array,r),o=tQ({control:n,name:r,defaultValue:Ye(n._formValues,r,Ye(n._defaultValues,r,t.defaultValue)),exact:!0}),l=eQ({control:n,name:r}),c=At.useRef(n.register(r,{...t.rules,value:o,...pa(t.disabled)?{disabled:t.disabled}:{}}));return At.useEffect(()=>{const u=n._options.shouldUnregister||s,d=(h,p)=>{const f=Ye(n._fields,h);f&&f._f&&(f._f.mount=p)};if(d(r,!0),u){const h=Sn(Ye(n._options.defaultValues,r));yr(n._defaultValues,r,h),si(Ye(n._formValues,r))&&yr(n._formValues,r,h)}return()=>{(a?u&&!n._state.action:u)?n.unregister(r):d(r,!1)}},[r,n,a,s]),At.useEffect(()=>{Ye(n._fields,r)&&n._updateDisabledField({disabled:i,fields:n._fields,name:r,value:Ye(n._fields,r)._f.value})},[i,r,n]),{field:{name:r,value:o,...pa(i)||l.disabled?{disabled:l.disabled||i}:{},onChange:At.useCallback(u=>c.current.onChange({target:{value:ER(u),name:r},type:um.CHANGE}),[r]),onBlur:At.useCallback(()=>c.current.onBlur({target:{value:Ye(n._formValues,r),name:r},type:um.BLUR}),[r,n]),ref:u=>{const d=Ye(n._fields,r);d&&u&&(d._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:h=>u.setCustomValidity(h),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ye(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!Ye(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Ye(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Ye(l.validatingFields,r)},error:{enumerable:!0,get:()=>Ye(l.errors,r)}})}}const ib=t=>t.render(rQ(t));var iQ=(t,e,r,i,n)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[i]:n||!0}}:{},BC=t=>({isOnSubmit:!t||t===Us.onSubmit,isOnBlur:t===Us.onBlur,isOnChange:t===Us.onChange,isOnAll:t===Us.all,isOnTouch:t===Us.onTouched}),PC=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(i=>t.startsWith(i)&&/^\.\w+/.test(t.slice(i.length))));const Ld=(t,e,r,i)=>{for(const n of r||Object.keys(t)){const s=Ye(t,n);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],n)&&!i)break;if(a.ref&&e(a.ref,a.name)&&!i)break;Ld(o,e)}else Li(o)&&Ld(o,e)}}};var nQ=(t,e,r)=>{const i=Qh(Ye(t,r));return yr(i,"root",e[r]),yr(t,r,i),t},ES=t=>t.type==="file",_o=t=>typeof t=="function",dm=t=>{if(!_S)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},bp=t=>ya(t),RS=t=>t.type==="radio",hm=t=>t instanceof RegExp;const NC={value:!1,isValid:!1},EC={value:!0,isValid:!0};var OR=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!si(t[0].attributes.value)?si(t[0].value)||t[0].value===""?EC:{value:t[0].value,isValid:!0}:EC:NC}return NC};const RC={isValid:!1,value:null};var AR=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,RC):RC;function MC(t,e,r="validate"){if(bp(t)||Array.isArray(t)&&t.every(bp)||pa(t)&&!t)return{type:r,message:bp(t)?t:"",ref:e}}var cc=t=>Li(t)&&!hm(t)?t:{value:t,message:""},DC=async(t,e,r,i,n)=>{const{ref:s,refs:a,required:o,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:p,name:f,valueAsNumber:m,mount:y,disabled:v}=t._f,g=Ye(e,f);if(!y||v)return{};const b=a?a[0]:s,k=$=>{i&&b.reportValidity&&(b.setCustomValidity(pa($)?"":$||""),b.reportValidity())},C={},x=RS(s),_=Kh(s),P=x||_,R=(m||ES(s))&&si(s.value)&&si(g)||dm(s)&&s.value===""||g===""||Array.isArray(g)&&!g.length,E=iQ.bind(null,f,r,C),D=($,I,F,M=Na.maxLength,O=Na.minLength)=>{const A=$?I:F;C[f]={type:$?M:O,message:A,ref:s,...E($?M:O,A)}};if(n?!Array.isArray(g)||!g.length:o&&(!P&&(R||un(g))||pa(g)&&!g||_&&!OR(a).isValid||x&&!AR(a).isValid)){const{value:$,message:I}=bp(o)?{value:!!o,message:o}:cc(o);if($&&(C[f]={type:Na.required,message:I,ref:b,...E(Na.required,I)},!r))return k(I),C}if(!R&&(!un(u)||!un(d))){let $,I;const F=cc(d),M=cc(u);if(!un(g)&&!isNaN(g)){const O=s.valueAsNumber||g&&+g;un(F.value)||($=O>F.value),un(M.value)||(I=Onew Date(new Date().toDateString()+" "+W),N=s.type=="time",V=s.type=="week";ya(F.value)&&g&&($=N?A(g)>A(F.value):V?g>F.value:O>new Date(F.value)),ya(M.value)&&g&&(I=N?A(g)+$.value,M=!un(I.value)&&g.length<+I.value;if((F||M)&&(D(F,$.message,I.message),!r))return k(C[f].message),C}if(h&&!R&&ya(g)){const{value:$,message:I}=cc(h);if(hm($)&&!g.match($)&&(C[f]={type:Na.pattern,message:I,ref:s,...E(Na.pattern,I)},!r))return k(I),C}if(p){if(_o(p)){const $=await p(g,e),I=MC($,b);if(I&&(C[f]={...I,...E(Na.validate,I.message)},!r))return k(I.message),C}else if(Li(p)){let $={};for(const I in p){if(!An($)&&!r)break;const F=MC(await p[I](g,e),b,I);F&&($={...F,...E(I,F.message)},k(F.message),r&&(C[f]=$))}if(!An($)&&(C[f]={ref:b,...$},!r))return C}}return k(!0),C};function sQ(t,e){const r=e.slice(0,-1).length;let i=0;for(;i{let t=[];return{get observers(){return t},next:n=>{for(const s of t)s.next&&s.next(n)},subscribe:n=>(t.push(n),{unsubscribe:()=>{t=t.filter(s=>s!==n)}}),unsubscribe:()=>{t=[]}}},fm=t=>un(t)||!NR(t);function wl(t,e){if(fm(t)||fm(e))return t===e;if(Rc(t)&&Rc(e))return t.getTime()===e.getTime();const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(const n of r){const s=t[n];if(!i.includes(n))return!1;if(n!=="ref"){const a=e[n];if(Rc(s)&&Rc(a)||Li(s)&&Li(a)||Array.isArray(s)&&Array.isArray(a)?!wl(s,a):s!==a)return!1}}return!0}var VR=t=>t.type==="select-multiple",oQ=t=>RS(t)||Kh(t),sb=t=>dm(t)&&t.isConnected,$R=t=>{for(const e in t)if(_o(t[e]))return!0;return!1};function pm(t,e={}){const r=Array.isArray(t);if(Li(t)||r)for(const i in t)Array.isArray(t[i])||Li(t[i])&&!$R(t[i])?(e[i]=Array.isArray(t[i])?[]:{},pm(t[i],e[i])):un(t[i])||(e[i]=!0);return e}function zR(t,e,r){const i=Array.isArray(t);if(Li(t)||i)for(const n in t)Array.isArray(t[n])||Li(t[n])&&!$R(t[n])?si(e)||fm(r[n])?r[n]=Array.isArray(t[n])?pm(t[n],[]):{...pm(t[n])}:zR(t[n],un(e)?{}:e[n],r[n]):r[n]=!wl(t[n],e[n]);return r}var Vf=(t,e)=>zR(t,e,pm(e)),WR=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:i})=>si(t)?t:e?t===""?NaN:t&&+t:r&&ya(t)?new Date(t):i?i(t):t;function ab(t){const e=t.ref;if(!(t.refs?t.refs.every(r=>r.disabled):e.disabled))return ES(e)?e.files:RS(e)?AR(t.refs).value:VR(e)?[...e.selectedOptions].map(({value:r})=>r):Kh(e)?OR(t.refs).value:WR(si(e.value)?t.ref.value:e.value,t)}var lQ=(t,e,r,i)=>{const n={};for(const s of t){const a=Ye(e,s);a&&yr(n,s,a._f)}return{criteriaMode:r,names:[...t],fields:n,shouldUseNativeValidation:i}},id=t=>si(t)?t:hm(t)?t.source:Li(t)?hm(t.value)?t.value.source:t.value:t,cQ=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function LC(t,e,r){const i=Ye(t,r);if(i||BS(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const s=n.join("."),a=Ye(e,s),o=Ye(t,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};n.pop()}return{name:r}}var uQ=(t,e,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(e||t):(r?i.isOnBlur:n.isOnBlur)?!t:(r?i.isOnChange:n.isOnChange)?t:!0,dQ=(t,e)=>!Qh(Ye(t,e)).length&&Pi(t,e);const hQ={mode:Us.onSubmit,reValidateMode:Us.onChange,shouldFocusError:!0};function fQ(t={}){let e={...hQ,...t},r={submitCount:0,isDirty:!1,isLoading:_o(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},i={},n=Li(e.defaultValues)||Li(e.values)?Sn(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Sn(n),a={action:!1,mount:!1,watch:!1},o={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:nb(),array:nb(),state:nb()},h=BC(e.mode),p=BC(e.reValidateMode),f=e.criteriaMode===Us.all,m=L=>U=>{clearTimeout(c),c=setTimeout(L,U)},y=async L=>{if(u.isValid||L){const U=e.resolver?An((await P()).errors):await E(i,!0);U!==r.isValid&&d.state.next({isValid:U})}},v=(L,U)=>{(u.isValidating||u.validatingFields)&&((L||Array.from(o.mount)).forEach(G=>{G&&(U?yr(r.validatingFields,G,U):Pi(r.validatingFields,G))}),d.state.next({validatingFields:r.validatingFields,isValidating:!An(r.validatingFields)}))},g=(L,U=[],G,re,Se=!0,ge=!0)=>{if(re&&G){if(a.action=!0,ge&&Array.isArray(Ye(i,L))){const Re=G(Ye(i,L),re.argA,re.argB);Se&&yr(i,L,Re)}if(ge&&Array.isArray(Ye(r.errors,L))){const Re=G(Ye(r.errors,L),re.argA,re.argB);Se&&yr(r.errors,L,Re),dQ(r.errors,L)}if(u.touchedFields&&ge&&Array.isArray(Ye(r.touchedFields,L))){const Re=G(Ye(r.touchedFields,L),re.argA,re.argB);Se&&yr(r.touchedFields,L,Re)}u.dirtyFields&&(r.dirtyFields=Vf(n,s)),d.state.next({name:L,isDirty:$(L,U),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else yr(s,L,U)},b=(L,U)=>{yr(r.errors,L,U),d.state.next({errors:r.errors})},k=L=>{r.errors=L,d.state.next({errors:r.errors,isValid:!1})},C=(L,U,G,re)=>{const Se=Ye(i,L);if(Se){const ge=Ye(s,L,si(G)?Ye(n,L):G);si(ge)||re&&re.defaultChecked||U?yr(s,L,U?ge:ab(Se._f)):M(L,ge),a.mount&&y()}},x=(L,U,G,re,Se)=>{let ge=!1,Re=!1;const Ke={name:L},ct=!!(Ye(i,L)&&Ye(i,L)._f&&Ye(i,L)._f.disabled);if(!G||re){u.isDirty&&(Re=r.isDirty,r.isDirty=Ke.isDirty=$(),ge=Re!==Ke.isDirty);const Pt=ct||wl(Ye(n,L),U);Re=!!(!ct&&Ye(r.dirtyFields,L)),Pt||ct?Pi(r.dirtyFields,L):yr(r.dirtyFields,L,!0),Ke.dirtyFields=r.dirtyFields,ge=ge||u.dirtyFields&&Re!==!Pt}if(G){const Pt=Ye(r.touchedFields,L);Pt||(yr(r.touchedFields,L,G),Ke.touchedFields=r.touchedFields,ge=ge||u.touchedFields&&Pt!==G)}return ge&&Se&&d.state.next(Ke),ge?Ke:{}},_=(L,U,G,re)=>{const Se=Ye(r.errors,L),ge=u.isValid&&pa(U)&&r.isValid!==U;if(t.delayError&&G?(l=m(()=>b(L,G)),l(t.delayError)):(clearTimeout(c),l=null,G?yr(r.errors,L,G):Pi(r.errors,L)),(G?!wl(Se,G):Se)||!An(re)||ge){const Re={...re,...ge&&pa(U)?{isValid:U}:{},errors:r.errors,name:L};r={...r,...Re},d.state.next(Re)}},P=async L=>{v(L,!0);const U=await e.resolver(s,e.context,lQ(L||o.mount,i,e.criteriaMode,e.shouldUseNativeValidation));return v(L),U},R=async L=>{const{errors:U}=await P(L);if(L)for(const G of L){const re=Ye(U,G);re?yr(r.errors,G,re):Pi(r.errors,G)}else r.errors=U;return U},E=async(L,U,G={valid:!0})=>{for(const re in L){const Se=L[re];if(Se){const{_f:ge,...Re}=Se;if(ge){const Ke=o.array.has(ge.name);v([re],!0);const ct=await DC(Se,s,f,e.shouldUseNativeValidation&&!U,Ke);if(v([re]),ct[ge.name]&&(G.valid=!1,U))break;!U&&(Ye(ct,ge.name)?Ke?nQ(r.errors,ct,ge.name):yr(r.errors,ge.name,ct[ge.name]):Pi(r.errors,ge.name))}Re&&await E(Re,U,G)}}return G.valid},D=()=>{for(const L of o.unMount){const U=Ye(i,L);U&&(U._f.refs?U._f.refs.every(G=>!sb(G)):!sb(U._f.ref))&&J(L)}o.unMount=new Set},$=(L,U)=>(L&&U&&yr(s,L,U),!wl(Q(),n)),I=(L,U,G)=>IR(L,o,{...a.mount?s:si(U)?n:ya(L)?{[L]:U}:U},G,U),F=L=>Qh(Ye(a.mount?s:n,L,t.shouldUnregister?Ye(n,L,[]):[])),M=(L,U,G={})=>{const re=Ye(i,L);let Se=U;if(re){const ge=re._f;ge&&(!ge.disabled&&yr(s,L,WR(U,ge)),Se=dm(ge.ref)&&un(U)?"":U,VR(ge.ref)?[...ge.ref.options].forEach(Re=>Re.selected=Se.includes(Re.value)):ge.refs?Kh(ge.ref)?ge.refs.length>1?ge.refs.forEach(Re=>(!Re.defaultChecked||!Re.disabled)&&(Re.checked=Array.isArray(Se)?!!Se.find(Ke=>Ke===Re.value):Se===Re.value)):ge.refs[0]&&(ge.refs[0].checked=!!Se):ge.refs.forEach(Re=>Re.checked=Re.value===Se):ES(ge.ref)?ge.ref.value="":(ge.ref.value=Se,ge.ref.type||d.values.next({name:L,values:{...s}})))}(G.shouldDirty||G.shouldTouch)&&x(L,Se,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&W(L)},O=(L,U,G)=>{for(const re in U){const Se=U[re],ge=`${L}.${re}`,Re=Ye(i,ge);(o.array.has(L)||!fm(Se)||Re&&!Re._f)&&!Rc(Se)?O(ge,Se,G):M(ge,Se,G)}},A=(L,U,G={})=>{const re=Ye(i,L),Se=o.array.has(L),ge=Sn(U);yr(s,L,ge),Se?(d.array.next({name:L,values:{...s}}),(u.isDirty||u.dirtyFields)&&G.shouldDirty&&d.state.next({name:L,dirtyFields:Vf(n,s),isDirty:$(L,ge)})):re&&!re._f&&!un(ge)?O(L,ge,G):M(L,ge,G),PC(L,o)&&d.state.next({...r}),d.values.next({name:a.mount?L:void 0,values:{...s}})},N=async L=>{a.mount=!0;const U=L.target;let G=U.name,re=!0;const Se=Ye(i,G),ge=()=>U.type?ab(Se._f):ER(L),Re=Ke=>{re=Number.isNaN(Ke)||Ke===Ye(s,G,Ke)};if(Se){let Ke,ct;const Pt=ge(),ve=L.type===um.BLUR||L.type===um.FOCUS_OUT,ce=!cQ(Se._f)&&!e.resolver&&!Ye(r.errors,G)&&!Se._f.deps||uQ(ve,Ye(r.touchedFields,G),r.isSubmitted,p,h),Qe=PC(G,o,ve);yr(s,G,Pt),ve?(Se._f.onBlur&&Se._f.onBlur(L),l&&l(0)):Se._f.onChange&&Se._f.onChange(L);const bt=x(G,Pt,ve,!1),Tt=!An(bt)||Qe;if(!ve&&d.values.next({name:G,type:L.type,values:{...s}}),ce)return u.isValid&&y(),Tt&&d.state.next({name:G,...Qe?{}:bt});if(!ve&&Qe&&d.state.next({...r}),e.resolver){const{errors:Ie}=await P([G]);if(Re(Pt),re){const xt=LC(r.errors,i,G),Le=LC(Ie,i,xt.name||G);Ke=Le.error,G=Le.name,ct=An(Ie)}}else v([G],!0),Ke=(await DC(Se,s,f,e.shouldUseNativeValidation))[G],v([G]),Re(Pt),re&&(Ke?ct=!1:u.isValid&&(ct=await E(i,!0)));re&&(Se._f.deps&&W(Se._f.deps),_(G,ct,Ke,bt))}},V=(L,U)=>{if(Ye(r.errors,U)&&L.focus)return L.focus(),1},W=async(L,U={})=>{let G,re;const Se=yp(L);if(e.resolver){const ge=await R(si(L)?L:Se);G=An(ge),re=L?!Se.some(Re=>Ye(ge,Re)):G}else L?(re=(await Promise.all(Se.map(async ge=>{const Re=Ye(i,ge);return await E(Re&&Re._f?{[ge]:Re}:Re)}))).every(Boolean),!(!re&&!r.isValid)&&y()):re=G=await E(i);return d.state.next({...!ya(L)||u.isValid&&G!==r.isValid?{}:{name:L},...e.resolver||!L?{isValid:G}:{},errors:r.errors}),U.shouldFocus&&!re&&Ld(i,V,L?Se:o.mount),re},Q=L=>{const U={...a.mount?s:n};return si(L)?U:ya(L)?Ye(U,L):L.map(G=>Ye(U,G))},ne=(L,U)=>({invalid:!!Ye((U||r).errors,L),isDirty:!!Ye((U||r).dirtyFields,L),error:Ye((U||r).errors,L),isValidating:!!Ye(r.validatingFields,L),isTouched:!!Ye((U||r).touchedFields,L)}),ie=L=>{L&&yp(L).forEach(U=>Pi(r.errors,U)),d.state.next({errors:L?r.errors:{}})},te=(L,U,G)=>{const re=(Ye(i,L,{_f:{}})._f||{}).ref,Se=Ye(r.errors,L)||{},{ref:ge,message:Re,type:Ke,...ct}=Se;yr(r.errors,L,{...ct,...U,ref:re}),d.state.next({name:L,errors:r.errors,isValid:!1}),G&&G.shouldFocus&&re&&re.focus&&re.focus()},j=(L,U)=>_o(L)?d.values.subscribe({next:G=>L(I(void 0,U),G)}):I(L,U,!0),J=(L,U={})=>{for(const G of L?yp(L):o.mount)o.mount.delete(G),o.array.delete(G),U.keepValue||(Pi(i,G),Pi(s,G)),!U.keepError&&Pi(r.errors,G),!U.keepDirty&&Pi(r.dirtyFields,G),!U.keepTouched&&Pi(r.touchedFields,G),!U.keepIsValidating&&Pi(r.validatingFields,G),!e.shouldUnregister&&!U.keepDefaultValue&&Pi(n,G);d.values.next({values:{...s}}),d.state.next({...r,...U.keepDirty?{isDirty:$()}:{}}),!U.keepIsValid&&y()},me=({disabled:L,name:U,field:G,fields:re,value:Se})=>{if(pa(L)&&a.mount||L){const ge=L?void 0:si(Se)?ab(G?G._f:Ye(re,U)._f):Se;yr(s,U,ge),x(U,ge,!1,!1,!0)}},pe=(L,U={})=>{let G=Ye(i,L);const re=pa(U.disabled);return yr(i,L,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:L}},name:L,mount:!0,...U}}),o.mount.add(L),G?me({field:G,disabled:U.disabled,name:L,value:U.value}):C(L,!0,U.value),{...re?{disabled:U.disabled}:{},...e.progressive?{required:!!U.required,min:id(U.min),max:id(U.max),minLength:id(U.minLength),maxLength:id(U.maxLength),pattern:id(U.pattern)}:{},name:L,onChange:N,onBlur:N,ref:Se=>{if(Se){pe(L,U),G=Ye(i,L);const ge=si(Se.value)&&Se.querySelectorAll&&Se.querySelectorAll("input,select,textarea")[0]||Se,Re=oQ(ge),Ke=G._f.refs||[];if(Re?Ke.find(ct=>ct===ge):ge===G._f.ref)return;yr(i,L,{_f:{...G._f,...Re?{refs:[...Ke.filter(sb),ge,...Array.isArray(Ye(n,L))?[{}]:[]],ref:{type:ge.type,name:L}}:{ref:ge}}}),C(L,!1,void 0,ge)}else G=Ye(i,L,{}),G._f&&(G._f.mount=!1),(e.shouldUnregister||U.shouldUnregister)&&!(RR(o.array,L)&&a.action)&&o.unMount.add(L)}}},De=()=>e.shouldFocusError&&Ld(i,V,o.mount),Be=L=>{pa(L)&&(d.state.next({disabled:L}),Ld(i,(U,G)=>{const re=Ye(i,G);re&&(U.disabled=re._f.disabled||L,Array.isArray(re._f.refs)&&re._f.refs.forEach(Se=>{Se.disabled=re._f.disabled||L}))},0,!1))},Ce=(L,U)=>async G=>{let re;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let Se=Sn(s);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:ge,values:Re}=await P();r.errors=ge,Se=Re}else await E(i);if(Pi(r.errors,"root"),An(r.errors)){d.state.next({errors:{}});try{await L(Se,G)}catch(ge){re=ge}}else U&&await U({...r.errors},G),De(),setTimeout(De);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:An(r.errors)&&!re,submitCount:r.submitCount+1,errors:r.errors}),re)throw re},Te=(L,U={})=>{Ye(i,L)&&(si(U.defaultValue)?A(L,Sn(Ye(n,L))):(A(L,U.defaultValue),yr(n,L,Sn(U.defaultValue))),U.keepTouched||Pi(r.touchedFields,L),U.keepDirty||(Pi(r.dirtyFields,L),r.isDirty=U.defaultValue?$(L,Sn(Ye(n,L))):$()),U.keepError||(Pi(r.errors,L),u.isValid&&y()),d.state.next({...r}))},X=(L,U={})=>{const G=L?Sn(L):n,re=Sn(G),Se=An(L),ge=Se?n:re;if(U.keepDefaultValues||(n=G),!U.keepValues){if(U.keepDirtyValues)for(const Re of o.mount)Ye(r.dirtyFields,Re)?yr(ge,Re,Ye(s,Re)):A(Re,Ye(ge,Re));else{if(_S&&si(L))for(const Re of o.mount){const Ke=Ye(i,Re);if(Ke&&Ke._f){const ct=Array.isArray(Ke._f.refs)?Ke._f.refs[0]:Ke._f.ref;if(dm(ct)){const Pt=ct.closest("form");if(Pt){Pt.reset();break}}}}i={}}s=t.shouldUnregister?U.keepDefaultValues?Sn(n):{}:Sn(ge),d.array.next({values:{...ge}}),d.values.next({values:{...ge}})}o={mount:U.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!U.keepIsValid||!!U.keepDirtyValues,a.watch=!!t.shouldUnregister,d.state.next({submitCount:U.keepSubmitCount?r.submitCount:0,isDirty:Se?!1:U.keepDirty?r.isDirty:!!(U.keepDefaultValues&&!wl(L,n)),isSubmitted:U.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Se?[]:U.keepDirtyValues?U.keepDefaultValues&&s?Vf(n,s):r.dirtyFields:U.keepDefaultValues&&L?Vf(n,L):U.keepDirty?r.dirtyFields:{},touchedFields:U.keepTouched?r.touchedFields:{},errors:U.keepErrors?r.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ee=(L,U)=>X(_o(L)?L(s):L,U);return{control:{register:pe,unregister:J,getFieldState:ne,handleSubmit:Ce,setError:te,_executeSchema:P,_getWatch:I,_getDirty:$,_updateValid:y,_removeUnmounted:D,_updateFieldArray:g,_updateDisabledField:me,_getFieldArray:F,_reset:X,_resetDefaultValues:()=>_o(e.defaultValues)&&e.defaultValues().then(L=>{ee(L,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:L=>{r={...r,...L}},_disableForm:Be,_subjects:d,_proxyFormState:u,_setErrors:k,get _fields(){return i},get _formValues(){return s},get _state(){return a},set _state(L){a=L},get _defaultValues(){return n},get _names(){return o},set _names(L){o=L},get _formState(){return r},set _formState(L){r=L},get _options(){return e},set _options(L){e={...e,...L}}},trigger:W,register:pe,handleSubmit:Ce,watch:j,setValue:A,getValues:Q,reset:ee,resetField:Te,clearErrors:ie,unregister:J,setError:te,setFocus:(L,U={})=>{const G=Ye(i,L),re=G&&G._f;if(re){const Se=re.refs?re.refs[0]:re.ref;Se.focus&&(Se.focus(),U.shouldSelect&&Se.select())}},getFieldState:ne}}function pQ(t={}){const e=At.useRef(),r=At.useRef(),[i,n]=At.useState({isDirty:!1,isValidating:!1,isLoading:_o(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:_o(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...fQ(t),formState:i});const s=e.current.control;return s._options=t,NS({subject:s._subjects.state,next:a=>{LR(a,s._proxyFormState,s._updateFormState,!0)&&n({...s._formState})}}),At.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),At.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==i.isDirty&&s._subjects.state.next({isDirty:a})}},[s,i.isDirty]),At.useEffect(()=>{t.values&&!wl(t.values,r.current)?(s._reset(t.values,s._options.resetOptions),r.current=t.values,n(a=>({...a}))):s._resetDefaultValues()},[t.values,s]),At.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),At.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),At.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=DR(i,s),e.current}var HR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r=1e3,i=6e4,n=36e5,s="millisecond",a="second",o="minute",l="hour",c="day",u="week",d="month",h="quarter",p="year",f="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var M=["th","st","nd","rd"],O=F%100;return"["+F+(M[(O-20)%10]||M[O]||M[0])+"]"}},b=function(F,M,O){var A=String(F);return!A||A.length>=M?F:""+Array(M+1-A.length).join(O)+F},k={s:b,z:function(F){var M=-F.utcOffset(),O=Math.abs(M),A=Math.floor(O/60),N=O%60;return(M<=0?"+":"-")+b(A,2,"0")+":"+b(N,2,"0")},m:function F(M,O){if(M.date()1)return F(W[0])}else{var Q=M.name;x[Q]=M,N=Q}return!A&&N&&(C=N),N||!A&&C},E=function(F,M){if(P(F))return F.clone();var O=typeof M=="object"?M:{};return O.date=F,O.args=arguments,new $(O)},D=k;D.l=R,D.i=P,D.w=function(F,M){return E(F,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var $=function(){function F(O){this.$L=R(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[_]=!0}var M=F.prototype;return M.parse=function(O){this.$d=function(A){var N=A.date,V=A.utc;if(N===null)return new Date(NaN);if(D.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var W=N.match(y);if(W){var Q=W[2]-1||0,ne=(W[7]||"0").substring(0,3);return V?new Date(Date.UTC(W[1],Q,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ne)):new Date(W[1],Q,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ne)}}return new Date(N)}(O),this.init()},M.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},M.$utils=function(){return D},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(O,A){var N=E(O);return this.startOf(A)<=N&&N<=this.endOf(A)},M.isAfter=function(O,A){return E(O)T.jsx(EK,{value:a.value,onChange:a.onChange})}),T.jsxs("div",{children:[T.jsx(ib,{name:"startTime",control:n,render:({field:a})=>T.jsx(_C,{value:a.value,onChange:a.onChange})}),T.jsx(ib,{name:"endTime",control:n,render:({field:a})=>T.jsx(_C,{value:a.value,onChange:a.onChange})})]})]}),T.jsx(LN,{children:T.jsx($a,{onClick:s(i),children:"Submit"})})]})}function yQ(){const[t,e]=w.useState([]),[r,i]=w.useState(!1),[n,s]=w.useState(null);function a(l){var c=[...t];c[n]=l,e(c),s(null)}function o(l){e([...t,l]),i(!1)}return T.jsxs(Tu,{title:"Shifts",children:[T.jsx(Gh,{children:t.map((l,c)=>T.jsxs(T.Fragment,{children:[T.jsx(Rz,{title:l.day.format("dddd, MMMM D")+" - "+l.endTime.diff(l.startTime,"hours")+" hours",action:T.jsx(yn,{onClick:()=>s(c),children:T.jsx(lE,{})})}),T.jsx(lh,{children:l.startTime.format("h:mm a")+" to "+l.endTime.format("h:mm a")})]}))}),T.jsx(eW,{color:"primary",sx:{position:"absolute",right:16,bottom:16},onClick:()=>{i(!0)},children:T.jsx(aS,{})}),T.jsx(FC,{open:r,onClose:()=>{i(!1)},_handleSubmit:o}),T.jsx(FC,{open:n!==null,onClose:()=>{s(null)},shift:n!==null?t[n]:void 0,_handleSubmit:a})]})}var UR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r="week",i="year";return function(n,s,a){var o=s.prototype;o.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=a(this).startOf(i).add(1,i).date(c),d=a(this).endOf(r);if(u.isBefore(d))return 1}var h=a(this).startOf(i).date(c).startOf(r).subtract(1,"millisecond"),p=this.diff(h,r,!0);return p<0?a(this).startOf("week").week():Math.ceil(p)},o.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(UR);var bQ=UR.exports;const vQ=io(bQ);var GR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},l=function(m){return(m=+m)+(m>68?1900:2e3)},c=function(m){return function(y){this[m]=+y}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var v=y.match(/([+-]|\d\d)/g),g=60*v[1]+(+v[2]||0);return g===0?0:v[0]==="+"?-g:g}(m)}],d=function(m){var y=o[m];return y&&(y.indexOf?y:y.s.concat(y.f))},h=function(m,y){var v,g=o.meridiem;if(g){for(var b=1;b<=24;b+=1)if(m.indexOf(g(b,0,y))>-1){v=b>12;break}}else v=m===(y?"pm":"PM");return v},p={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[n,c("day")],Do:[a,function(m){var y=o.ordinal,v=m.match(/\d+/);if(this.day=v[0],y)for(var g=1;g<=31;g+=1)y(g).replace(/\[|\]/g,"")===m&&(this.day=g)}],M:[s,c("month")],MM:[n,c("month")],MMM:[a,function(m){var y=d("months"),v=(d("monthsShort")||y.map(function(g){return g.slice(0,3)})).indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[a,function(m){var y=d("months").indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function f(m){var y,v;y=m,v=o&&o.formats;for(var g=(m=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,E,D){var $=D&&D.toUpperCase();return E||v[D]||r[D]||v[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(I,F,M){return F||M.slice(1)})})).match(i),b=g.length,k=0;k-1)return new Date((A==="X"?1e3:1)*O);var V=f(A)(O),W=V.year,Q=V.month,ne=V.day,ie=V.hours,te=V.minutes,j=V.seconds,J=V.milliseconds,me=V.zone,pe=new Date,De=ne||(W||Q?1:pe.getDate()),Be=W||pe.getFullYear(),Ce=0;W&&!Q||(Ce=Q>0?Q-1:pe.getMonth());var Te=ie||0,X=te||0,ee=j||0,Y=J||0;return me?new Date(Date.UTC(Be,Ce,De,Te,X,ee,Y+60*me.offset*1e3)):N?new Date(Date.UTC(Be,Ce,De,Te,X,ee,Y)):new Date(Be,Ce,De,Te,X,ee,Y)}catch{return new Date("")}}(C,P,x),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),D&&C!=this.format(P)&&(this.$d=new Date("")),o={}}else if(P instanceof Array)for(var I=P.length,F=1;F<=I;F+=1){_[1]=P[F-1];var M=v.apply(this,_);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}F===I&&(this.$d=new Date(""))}else b.call(this,k)}}})})(GR);var wQ=GR.exports;const SQ=io(wQ);var jR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(i,n,s){var a=n.prototype,o=a.format;s.en.formats=r,a.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=function(d,h){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,f,m){var y=m&&m.toUpperCase();return f||h[m]||r[m]||h[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,g,b){return g||b.slice(1)})})}(l,c===void 0?{}:c);return o.call(this,u)}}})})(jR);var xQ=jR.exports;const kQ=io(xQ);var YR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){return function(r,i,n){i.prototype.isBetween=function(s,a,o,l){var c=n(s),u=n(a),d=(l=l||"()")[0]==="(",h=l[1]===")";return(d?this.isAfter(c,o):!this.isBefore(c,o))&&(h?this.isBefore(u,o):!this.isAfter(u,o))||(d?this.isBefore(c,o):!this.isAfter(c,o))&&(h?this.isAfter(u,o):!this.isBefore(u,o))}}})})(YR);var CQ=YR.exports;const TQ=io(CQ);var XR={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(pu,function(){return function(r,i){var n=i.prototype,s=n.format;n.format=function(a){var o=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var c=this.$utils(),u=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return c.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}});return s.bind(this)(u)}}})})(XR);var _Q=XR.exports;const BQ=io(_Q);ui.extend(kQ);ui.extend(vQ);ui.extend(TQ);ui.extend(BQ);const PQ=yR(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),NQ={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},EQ={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},ob=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(` `),IC=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(` -`),EQ=(t,e)=>e?(...r)=>t(...r).locale(e):t;class RQ{constructor({locale:e,formats:r}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=PQ,this.setLocaleToValue=i=>{const n=this.getCurrentLocaleCode();return n===i.locale()?i:i.locale(n)},this.hasUTCPlugin=()=>typeof ci.utc<"u",this.hasTimezonePlugin=()=>typeof ci.tz<"u",this.isSame=(i,n,s)=>{const a=this.setTimezone(n,this.getTimezone(i));return i.format(s)===a.format(s)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return ci.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const n=ci.tz.guess();return n!=="UTC"?ci.tz(i,n):ci(i)}return ci(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(ob);return ci.utc(i)},this.createTZDate=(i,n)=>{if(!this.hasUTCPlugin())throw new Error(ob);if(!this.hasTimezonePlugin())throw new Error(IC);const s=i!==void 0&&!i.endsWith("Z");return ci(i).tz(this.cleanTimezone(n),s)},this.getLocaleFormats=()=>{const i=ci.Ls,n=this.locale||"en";let s=i[n];return s===void 0&&(BQ(),s=i.en),s.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const n=this.getTimezone(i);if(n!=="UTC"){const s=i.tz(this.cleanTimezone(n),!0);if((s.$offset??0)===(i.$offset??0))return i;i.$offset=s.$offset}return i},this.date=(i,n="default")=>{if(i===null)return null;let s;return n==="UTC"?s=this.createUTCDate(i):n==="system"||n==="default"&&!this.hasTimezonePlugin()?s=this.createSystemDate(i):s=this.createTZDate(i,n),this.locale===void 0?s:s.locale(this.locale)},this.getInvalidDate=()=>ci(new Date("Invalid date")),this.getTimezone=i=>{var n;if(this.hasTimezonePlugin()){const s=(n=i.$x)==null?void 0:n.$timezone;if(s)return s}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,n)=>{if(this.getTimezone(i)===n)return i;if(n==="UTC"){if(!this.hasUTCPlugin())throw new Error(ob);return i.utc()}if(n==="system")return i.local();if(!this.hasTimezonePlugin()){if(n==="default")return i;throw new Error(IC)}return ci.tz(i,this.cleanTimezone(n))},this.toJsDate=i=>i.toDate(),this.parse=(i,n)=>i===""?null:this.dayjs(i,n,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const n=this.getLocaleFormats(),s=a=>a.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(o,l,c)=>l||c.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(a,o,l)=>{const c=l&&l.toUpperCase();return o||n[l]||s(n[c])})},this.isValid=i=>i==null?!1:i.isValid(),this.format=(i,n)=>this.formatByString(i,this.formats[n]),this.formatByString=(i,n)=>this.dayjs(i).format(n),this.formatNumber=i=>i,this.isEqual=(i,n)=>i===null&&n===null?!0:i===null||n===null?!1:i.toDate().getTime()===n.toDate().getTime(),this.isSameYear=(i,n)=>this.isSame(i,n,"YYYY"),this.isSameMonth=(i,n)=>this.isSame(i,n,"YYYY-MM"),this.isSameDay=(i,n)=>this.isSame(i,n,"YYYY-MM-DD"),this.isSameHour=(i,n)=>i.isSame(n,"hour"),this.isAfter=(i,n)=>i>n,this.isAfterYear=(i,n)=>this.hasUTCPlugin()?!this.isSameYear(i,n)&&i.utc()>n.utc():i.isAfter(n,"year"),this.isAfterDay=(i,n)=>this.hasUTCPlugin()?!this.isSameDay(i,n)&&i.utc()>n.utc():i.isAfter(n,"day"),this.isBefore=(i,n)=>ithis.hasUTCPlugin()?!this.isSameYear(i,n)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,n)&&i.utc()i>=n&&i<=s,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"year"):i.add(n,"year")),this.addMonths=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"month"):i.add(n,"month")),this.addWeeks=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"week"):i.add(n,"week")),this.addDays=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"day"):i.add(n,"day")),this.addHours=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"hour"):i.add(n,"hour")),this.addMinutes=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"minute"):i.add(n,"minute")),this.addSeconds=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"second"):i.add(n,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,n)=>this.adjustOffset(i.set("year",n)),this.setMonth=(i,n)=>this.adjustOffset(i.set("month",n)),this.setDate=(i,n)=>this.adjustOffset(i.set("date",n)),this.setHours=(i,n)=>this.adjustOffset(i.set("hour",n)),this.setMinutes=(i,n)=>this.adjustOffset(i.set("minute",n)),this.setSeconds=(i,n)=>this.adjustOffset(i.set("second",n)),this.setMilliseconds=(i,n)=>this.adjustOffset(i.set("millisecond",n)),this.getDaysInMonth=i=>i.daysInMonth(),this.getWeekArray=i=>{const n=this.setLocaleToValue(i),s=this.startOfWeek(this.startOfMonth(n)),a=this.endOfWeek(this.endOfMonth(n));let o=0,l=s;const c=[];for(;li.week(),this.getYearRange=([i,n])=>{const s=this.startOfYear(i),a=this.endOfYear(n),o=[];let l=s;for(;this.isBefore(l,a);)o.push(l),l=this.addYears(l,1);return o},this.dayjs=EQ(ci,e),this.locale=e,this.formats=S({},NQ,r),ci.extend(wQ)}getDayOfWeek(e){return e.day()+1}}const XR=24,MQ={toNoteNumber(t){switch(t){case"C":return 0;case"D":return 2;case"E":return 4;case"F":return 5;case"G":return 7;case"A":return 9;case"B":return 11}}};var La=(t=>(t[t.Natural=0]="Natural",t[t.Sharp=1]="Sharp",t[t.Flat=-1]="Flat",t[t.DoubleSharp=2]="DoubleSharp",t[t.DoubleFlat=-2]="DoubleFlat",t))(La||{});(t=>{function e(r){switch(r){case 0:return"";case-2:return"bb";case-1:return"b";case 1:return"#";case 2:return"##"}}t.toDisplayString=e})(La||(La={}));const lb={increaseBy(t,e){return Math.abs((e+t)%12)},toNote(t){switch(t){case 0:return Zt("C");case 1:return Zt("D",-1);case 2:return Zt("D");case 3:return Zt("E",-1);case 4:return Zt("E");case 5:return Zt("F");case 6:return Zt("G",-1);case 7:return Zt("G");case 8:return Zt("A",-1);case 9:return Zt("A");case 10:return Zt("B",-1);case 11:return Zt("B")}}},di={toNoteNumber(t){return lb.increaseBy(t.accidental,MQ.toNoteNumber(t.letter))},toDisplayString(t){return`${t.letter}${La.toDisplayString(t.accidental)}`},transpose(t,e){return lb.toNote(lb.increaseBy(t,di.toNoteNumber(e)))}};console.log(di.toDisplayString(di.transpose(3,Zt("C"))));function Zt(t,e){return{letter:t,accidental:e||0}}var _o=(t=>(t.Root="Root",t.First="1st",t.Second="2nd",t.Third="3rd",t))(_o||{});(t=>{function e(r,i,n){switch(r){case"Root":return di.transpose(0,n);case"1st":switch(i){case"Maj7":case"Dom7":return di.transpose(4,n);default:return di.transpose(3,n)}case"2nd":switch(i){case"Half-Dim7":case"Dim7":return di.transpose(6,n);default:return di.transpose(7,n)}case"3rd":switch(i){case"Maj7":return di.transpose(11,n);case"Dom7":case"Min7":case"Half-Dim7":return di.transpose(10,n);default:return di.transpose(9,n)}}}t.bassNote=e})(_o||(_o={}));var fl=(t=>(t.Maj7="Maj7",t.Dom7="Dom7",t.Min7="Min7",t.Half="Half-Dim7",t.Full="Dim7",t))(fl||{}),mm;(t=>{function e(r){switch(r){case 1:return Zt("E");case 2:return Zt("B");case 3:return Zt("G");case 4:return Zt("D");case 5:return Zt("A");case 6:return Zt("E")}}t.firstNote=e})(mm||(mm={}));const fd={toTex(t){return`${t.fret}.${t.string}`},onString(t,e){let r=di.toNoteNumber(e),i=r-di.toNoteNumber(mm.firstNote(t));console.log(i);const n=[];for(;i<=XR;)i>=0&&n.push(i),r+=12,i=r-di.toNoteNumber(mm.firstNote(t));return n.map(s=>({string:t,fret:s}))}};console.log(fd.onString(5,Zt("C")));function st(t,e){return{string:t,fret:e}}const DQ={generate(t,e,r="Root"){switch(t){case 6:switch(e){case"Maj7":switch(r){case"Root":return[st(6,0),st(4,1),st(3,1),st(2,0)];case"1st":return[st(6,0),st(4,-2),st(3,0),st(2,0)];default:return[]}case"Dom7":switch(r){case"Root":return[st(6,0),st(4,0),st(3,1),st(2,0)];case"1st":return[st(6,0),st(4,-2),st(3,0),st(2,-1)]}case"Min7":switch(r){case"Root":return[st(6,0),st(4,0),st(3,0),st(2,0)];case"1st":return[st(6,0),st(4,-1),st(3,1),st(2,0)]}case"Half-Dim7":switch(r){case"Root":return[st(6,0),st(4,0),st(3,0),st(2,-1)];case"1st":return[st(6,0),st(4,-1),st(3,0),st(2,0)]}case"Dim7":switch(r){case"Root":return[st(6,0),st(4,-1),st(3,0),st(2,-1)];case"1st":return[st(6,0),st(4,-1),st(3,0),st(2,-1)]}default:return[]}case 5:switch(e){case"Maj7":switch(r){case"Root":return[st(5,0),st(4,2),st(3,1),st(2,2)];default:return[]}case"Dom7":switch(r){case"Root":return[st(5,0),st(4,2),st(3,0),st(2,2)]}case"Min7":switch(r){case"Root":return[st(5,0),st(4,2),st(3,0),st(2,1)]}case"Half-Dim7":switch(r){case"Root":return[st(5,0),st(4,1),st(3,0),st(2,1)]}case"Dim7":switch(r){case"Root":return[st(5,0),st(4,11),st(3,-1),st(2,1)]}default:return[]}default:return[]}}},qR={toTex(t){return`(${t.map(e=>fd.toTex(e)+" ").join("")})`},generate(t,e,r,i="Root"){const n=_o.bassNote(i,e,t);return(r?fd.onString(r,n):fd.onString(6,n).concat(fd.onString(5,n))).map(o=>DQ.generate(o.string,e,i).map(l=>({string:l.string,fret:l.fret+o.fret}))).filter(o=>!o.some(l=>l.fret<0||l.fret>XR))}},OC={toTex(t){return`\\ks ${di.toDisplayString(t.key.note)} ${t.chords.map(e=>qR.toTex(e)).join("")}`}};var ja;(function(t){t[t.Page=0]="Page",t[t.Horizontal=1]="Horizontal"})(ja||(ja={}));var Cn;(function(t){t[t.Default=0]="Default",t[t.ScoreTab=1]="ScoreTab",t[t.Score=2]="Score",t[t.Tab=3]="Tab",t[t.TabMixed=4]="TabMixed"})(Cn||(Cn={}));class $a{static getValue(e){return $a._values||($a._values=new Map),e=e.toLowerCase().replaceAll(" ",""),$a._values.has(e)?$a._values.get(e):0}static isPiano(e){return e<=7||e>=16&&e<=23}static isGuitar(e){return e>=24&&e<=39||e===105||e===43}}$a._values=new Map([["acousticgrandpiano",0],["brightacousticpiano",1],["electricgrandpiano",2],["honkytonkpiano",3],["electricpiano1",4],["electricpiano2",5],["harpsichord",6],["clavinet",7],["celesta",8],["glockenspiel",9],["musicbox",10],["vibraphone",11],["marimba",12],["xylophone",13],["tubularbells",14],["dulcimer",15],["drawbarorgan",16],["percussiveorgan",17],["rockorgan",18],["churchorgan",19],["reedorgan",20],["accordion",21],["harmonica",22],["tangoaccordion",23],["acousticguitarnylon",24],["acousticguitarsteel",25],["electricguitarjazz",26],["electricguitarclean",27],["electricguitarmuted",28],["overdrivenguitar",29],["distortionguitar",30],["guitarharmonics",31],["acousticbass",32],["electricbassfinger",33],["electricbasspick",34],["fretlessbass",35],["slapbass1",36],["slapbass2",37],["synthbass1",38],["synthbass2",39],["violin",40],["viola",41],["cello",42],["contrabass",43],["tremolostrings",44],["pizzicatostrings",45],["orchestralharp",46],["timpani",47],["stringensemble1",48],["stringensemble2",49],["synthstrings1",50],["synthstrings2",51],["choiraahs",52],["voiceoohs",53],["synthvoice",54],["orchestrahit",55],["trumpet",56],["trombone",57],["tuba",58],["mutedtrumpet",59],["frenchhorn",60],["brasssection",61],["synthbrass1",62],["synthbrass2",63],["sopranosax",64],["altosax",65],["tenorsax",66],["baritonesax",67],["oboe",68],["englishhorn",69],["bassoon",70],["clarinet",71],["piccolo",72],["flute",73],["recorder",74],["panflute",75],["blownbottle",76],["shakuhachi",77],["whistle",78],["ocarina",79],["lead1square",80],["lead2sawtooth",81],["lead3calliope",82],["lead4chiff",83],["lead5charang",84],["lead6voice",85],["lead7fifths",86],["lead8bassandlead",87],["pad1newage",88],["pad2warm",89],["pad3polysynth",90],["pad4choir",91],["pad5bowed",92],["pad6metallic",93],["pad7halo",94],["pad8sweep",95],["fx1rain",96],["fx2soundtrack",97],["fx3crystal",98],["fx4atmosphere",99],["fx5brightness",100],["fx6goblins",101],["fx7echoes",102],["fx8scifi",103],["sitar",104],["banjo",105],["shamisen",106],["koto",107],["kalimba",108],["bagpipe",109],["fiddle",110],["shanai",111],["tinklebell",112],["agogo",113],["steeldrums",114],["woodblock",115],["taikodrum",116],["melodictom",117],["synthdrum",118],["reversecymbal",119],["guitarfretnoise",120],["breathnoise",121],["seashore",122],["birdtweet",123],["telephonering",124],["helicopter",125],["applause",126],["gunshot",127]]);class Bu{init(e,r){this.data=e,this.settings=r}}var mi;(function(t){t[t.General=0]="General",t[t.Format=1]="Format",t[t.AlphaTex=2]="AlphaTex"})(mi||(mi={}));class gi extends Error{constructor(e,r="",i){super(r??"",{cause:i}),this.type=e,this.inner=i??null,Object.setPrototypeOf(this,gi.prototype)}}class Gr extends gi{constructor(e=null,r=null){super(mi.Format,e??"Unsupported format"),this.inner=r,Object.setPrototypeOf(this,Gr.prototype)}}var jr;(function(t){t[t.None=0]="None",t[t.Normal=1]="Normal",t[t.Heavy=2]="Heavy"})(jr||(jr={}));var ai;(function(t){t[t.Tempo=0]="Tempo",t[t.Volume=1]="Volume",t[t.Instrument=2]="Instrument",t[t.Balance=3]="Balance"})(ai||(ai={}));class Ei{constructor(){this.isLinear=!1,this.type=ai.Tempo,this.value=0,this.ratioPosition=0,this.text=""}static buildTempoAutomation(e,r,i,n){(n<1||n>5)&&(n=2);let s=new Float32Array([1,.5,1,1.5,2,3]),a=new Ei;return a.type=ai.Tempo,a.isLinear=e,a.ratioPosition=r,a.value=i*s[n],a}static buildInstrumentAutomation(e,r,i){let n=new Ei;return n.type=ai.Instrument,n.isLinear=e,n.ratioPosition=r,n.value=i,n}}var ot;(function(t){t[t.Neutral=0]="Neutral",t[t.C3=1]="C3",t[t.C4=2]="C4",t[t.F4=3]="F4",t[t.G2=4]="G2"})(ot||(ot={}));var Ft;(function(t){t[t._15ma=0]="_15ma",t[t._8va=1]="_8va",t[t.Regular=2]="Regular",t[t._8vb=3]="_8vb",t[t._15mb=4]="_15mb"})(Ft||(Ft={}));var qn;(function(t){t[t.None=0]="None",t[t.Simple=1]="Simple",t[t.FirstOfDouble=2]="FirstOfDouble",t[t.SecondOfDouble=3]="SecondOfDouble"})(qn||(qn={}));class so{constructor(){this.id=so._globalBarId++,this.index=0,this.nextBar=null,this.previousBar=null,this.clef=ot.G2,this.clefOttava=Ft.Regular,this.voices=[],this.simileMark=qn.None,this.isMultiVoice=!1,this.displayScale=1,this.displayWidth=-1}get masterBar(){return this.staff.track.score.masterBars[this.index]}get isEmpty(){for(let e=0,r=this.voices.length;e0&&!s.isEmpty&&(this.isMultiVoice=!0)}}calculateDuration(){let e=0;for(let r of this.voices){let i=r.calculateDuration();i>e&&(e=i)}return e}}so._globalBarId=0;class lt{static ticksToMillis(e,r){return e*(6e4/(r*lt.QuarterTime))|0}static millisToTicks(e,r){return e/(6e4/(r*lt.QuarterTime))|0}static toTicks(e){return lt.valueToTicks(e)}static valueToTicks(e){let r=e;return r<0&&(r=1/-r),lt.QuarterTime*(4/r)|0}static applyDot(e,r){return r?e+(e/4|0)*3:e+(e/2|0)}static applyTuplet(e,r,i){return e*i/r|0}static removeTuplet(e,r,i){return e*r/i|0}static dynamicToVelocity(e){return lt.MinVelocity+e*lt.VelocityIncrement}}lt.QuarterTime=960;lt.MinVelocity=15;lt.VelocityIncrement=16;class Re{constructor(e=0,r=0){this.offset=e,this.value=r}}Re.MaxPosition=60;Re.MaxValue=12;var Gt;(function(t){t[t.Default=0]="Default",t[t.Gradual=1]="Gradual",t[t.Fast=2]="Fast"})(Gt||(Gt={}));var ze;(function(t){t[t.None=0]="None",t[t.Custom=1]="Custom",t[t.Bend=2]="Bend",t[t.Release=3]="Release",t[t.BendRelease=4]="BendRelease",t[t.Hold=5]="Hold",t[t.Prebend=6]="Prebend",t[t.PrebendBend=7]="PrebendBend",t[t.PrebendRelease=8]="PrebendRelease"})(ze||(ze={}));var ir;(function(t){t[t.None=0]="None",t[t.BrushUp=1]="BrushUp",t[t.BrushDown=2]="BrushDown",t[t.ArpeggioUp=3]="ArpeggioUp",t[t.ArpeggioDown=4]="ArpeggioDown"})(ir||(ir={}));var pn;(function(t){t[t.None=0]="None",t[t.Crescendo=1]="Crescendo",t[t.Decrescendo=2]="Decrescendo"})(pn||(pn={}));var H;(function(t){t[t.QuadrupleWhole=-4]="QuadrupleWhole",t[t.DoubleWhole=-2]="DoubleWhole",t[t.Whole=1]="Whole",t[t.Half=2]="Half",t[t.Quarter=4]="Quarter",t[t.Eighth=8]="Eighth",t[t.Sixteenth=16]="Sixteenth",t[t.ThirtySecond=32]="ThirtySecond",t[t.SixtyFourth=64]="SixtyFourth",t[t.OneHundredTwentyEighth=128]="OneHundredTwentyEighth",t[t.TwoHundredFiftySixth=256]="TwoHundredFiftySixth"})(H||(H={}));var yt;(function(t){t[t.PPP=0]="PPP",t[t.PP=1]="PP",t[t.P=2]="P",t[t.MP=3]="MP",t[t.MF=4]="MF",t[t.F=5]="F",t[t.FF=6]="FF",t[t.FFF=7]="FFF"})(yt||(yt={}));var Je;(function(t){t[t.None=0]="None",t[t.OnBeat=1]="OnBeat",t[t.BeforeBeat=2]="BeforeBeat",t[t.BendGrace=3]="BendGrace"})(Je||(Je={}));var at;(function(t){t[t.Unknown=-2]="Unknown",t[t.NoOrDead=-1]="NoOrDead",t[t.Thumb=0]="Thumb",t[t.IndexFinger=1]="IndexFinger",t[t.MiddleFinger=2]="MiddleFinger",t[t.AnnularFinger=3]="AnnularFinger",t[t.LittleFinger=4]="LittleFinger"})(at||(at={}));var Xe;(function(t){t[t.None=0]="None",t[t.Natural=1]="Natural",t[t.Artificial=2]="Artificial",t[t.Pinch=3]="Pinch",t[t.Tap=4]="Tap",t[t.Semi=5]="Semi",t[t.Feedback=6]="Feedback"})(Xe||(Xe={}));var Or;(function(t){t[t.Default=0]="Default",t[t.ForceNone=1]="ForceNone",t[t.ForceNatural=2]="ForceNatural",t[t.ForceSharp=3]="ForceSharp",t[t.ForceDoubleSharp=4]="ForceDoubleSharp",t[t.ForceFlat=5]="ForceFlat",t[t.ForceDoubleFlat=6]="ForceDoubleFlat"})(Or||(Or={}));var pi;(function(t){t[t.None=0]="None",t[t.IntoFromBelow=1]="IntoFromBelow",t[t.IntoFromAbove=2]="IntoFromAbove"})(pi||(pi={}));var ut;(function(t){t[t.None=0]="None",t[t.Shift=1]="Shift",t[t.Legato=2]="Legato",t[t.OutUp=3]="OutUp",t[t.OutDown=4]="OutDown",t[t.PickSlideDown=5]="PickSlideDown",t[t.PickSlideUp=6]="PickSlideUp"})(ut||(ut={}));var Dt;(function(t){t[t.None=0]="None",t[t.Slight=1]="Slight",t[t.Wide=2]="Wide"})(Dt||(Dt={}));var za;(function(t){t[t.Hidden=0]="Hidden",t[t.ShowWithBeams=1]="ShowWithBeams",t[t.ShowWithBars=2]="ShowWithBars"})(za||(za={}));var ta;(function(t){t[t.ScoreDefault=0]="ScoreDefault",t[t.ScoreForcePiano=1]="ScoreForcePiano",t[t.SingleNoteEffectBand=2]="SingleNoteEffectBand",t[t.SingleNoteEffectBandForcePiano=3]="SingleNoteEffectBandForcePiano"})(ta||(ta={}));var si;(function(t){t[t.GuitarPro=0]="GuitarPro",t[t.SongBook=1]="SongBook"})(si||(si={}));var tt;(function(t){t[t.ScoreTitle=0]="ScoreTitle",t[t.ScoreSubTitle=1]="ScoreSubTitle",t[t.ScoreArtist=2]="ScoreArtist",t[t.ScoreAlbum=3]="ScoreAlbum",t[t.ScoreWords=4]="ScoreWords",t[t.ScoreMusic=5]="ScoreMusic",t[t.ScoreWordsAndMusic=6]="ScoreWordsAndMusic",t[t.ScoreCopyright=7]="ScoreCopyright",t[t.GuitarTuning=8]="GuitarTuning",t[t.TrackNames=9]="TrackNames",t[t.ChordDiagrams=10]="ChordDiagrams",t[t.ParenthesisOnTiedBends=11]="ParenthesisOnTiedBends",t[t.TabNotesOnTiedBends=12]="TabNotesOnTiedBends",t[t.ZerosOnDiveWhammys=13]="ZerosOnDiveWhammys",t[t.EffectAlternateEndings=14]="EffectAlternateEndings",t[t.EffectCapo=15]="EffectCapo",t[t.EffectChordNames=16]="EffectChordNames",t[t.EffectCrescendo=17]="EffectCrescendo",t[t.EffectDynamics=18]="EffectDynamics",t[t.EffectFadeIn=19]="EffectFadeIn",t[t.EffectFermata=20]="EffectFermata",t[t.EffectFingering=21]="EffectFingering",t[t.EffectHarmonics=22]="EffectHarmonics",t[t.EffectLetRing=23]="EffectLetRing",t[t.EffectLyrics=24]="EffectLyrics",t[t.EffectMarker=25]="EffectMarker",t[t.EffectOttavia=26]="EffectOttavia",t[t.EffectPalmMute=27]="EffectPalmMute",t[t.EffectPickSlide=28]="EffectPickSlide",t[t.EffectPickStroke=29]="EffectPickStroke",t[t.EffectSlightBeatVibrato=30]="EffectSlightBeatVibrato",t[t.EffectSlightNoteVibrato=31]="EffectSlightNoteVibrato",t[t.EffectTap=32]="EffectTap",t[t.EffectTempo=33]="EffectTempo",t[t.EffectText=34]="EffectText",t[t.EffectTrill=35]="EffectTrill",t[t.EffectTripletFeel=36]="EffectTripletFeel",t[t.EffectWhammyBar=37]="EffectWhammyBar",t[t.EffectWideBeatVibrato=38]="EffectWideBeatVibrato",t[t.EffectWideNoteVibrato=39]="EffectWideNoteVibrato",t[t.EffectLeftHandTap=40]="EffectLeftHandTap"})(tt||(tt={}));class mh{constructor(){this.notationMode=si.GuitarPro,this.fingeringMode=ta.ScoreDefault,this.elements=new Map,this.rhythmMode=za.Hidden,this.rhythmHeight=15,this.transpositionPitches=[],this.displayTranspositionPitches=[],this.smallGraceTabNotes=!0,this.extendBendArrowsOnTiedNotes=!0,this.extendLineEffectsToBeatEnd=!1,this.slurHeight=5}isNotationElementVisible(e){return this.elements.has(e)?this.elements.get(e):mh.defaultElements.has(e)?mh.defaultElements.get(e):!0}}mh.defaultElements=new Map([[tt.ZerosOnDiveWhammys,!1]]);class KR{constructor(e){this._value=void 0,this._factory=e}get value(){return this._value===void 0&&(this._value=this._factory()),this._value}}var Gs;(function(t){t[t.None=0]="None",t[t.Debug=1]="Debug",t[t.Info=2]="Info",t[t.Warning=3]="Warning",t[t.Error=4]="Error"})(Gs||(Gs={}));class Sl{static format(e,r){return`[AlphaTab][${e}] ${r}`}debug(e,r,...i){console.debug(Sl.format(e,r),...i)}warning(e,r,...i){console.warn(Sl.format(e,r),...i)}info(e,r,...i){console.info(Sl.format(e,r),...i)}error(e,r,...i){console.error(Sl.format(e,r),...i)}}Sl.logLevel=Gs.Info;class de{static shouldLog(e){return de.logLevel!==Gs.None&&e>=de.logLevel}static debug(e,r,...i){de.shouldLog(Gs.Debug)&&de.log.debug(e,r,...i)}static warning(e,r,...i){de.shouldLog(Gs.Warning)&&de.log.warning(e,r,...i)}static info(e,r,...i){de.shouldLog(Gs.Info)&&de.log.info(e,r,...i)}static error(e,r,...i){de.shouldLog(Gs.Error)&&de.log.error(e,r,...i)}}de.logLevel=Gs.Info;de.log=new Sl;class LQ{constructor(){this.note=null,this.noteValue=0,this.octave=0}get realValue(){return this.octave*12+this.noteValue}}class er{static getIndex(e){let r=0;return e<0?r:Math.log2(e)|0}static keySignatureIsFlat(e){return e<0}static keySignatureIsNatural(e){return e===0}static keySignatureIsSharp(e){return e>0}static applyPitchOffsets(e,r){for(let i=0;i=48&&a<=57){if(!r)return null;i+=String.fromCharCode(a)}else if(a>=65&&a<=90||a>=97&&a<=122||a===35)r+=String.fromCharCode(a);else return null}if(!i||!r)return null;let n=new LQ;return n.octave=parseInt(i)+1,n.note=r.toLowerCase(),n.noteValue=er.getToneForText(n.note),n}static getTuningForText(e){let r=er.parseTuning(e);return r?r.realValue:-1}static getToneForText(e){switch(e.toLowerCase()){case"c":return 0;case"c#":case"db":return 1;case"d":return 2;case"d#":case"eb":return 3;case"e":return 4;case"f":return 5;case"f#":case"gb":return 6;case"g":return 7;case"g#":case"ab":return 8;case"a":return 9;case"a#":case"bb":return 10;case"b":return 11;default:return 0}}static newGuid(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)}static isAlmostEqualTo(e,r){return Math.abs(e-r)<1e-5}static toHexString(e,r=0){let i="",n="0123456789ABCDEF";do i=String.fromCharCode(n.charCodeAt(e&15))+i,e=e>>4;while(e>0);for(;i.length=ki.gp6ElementAndVariationToArticulation.length&&(r=0),ki.gp6ElementAndVariationToArticulation[e][r]):38}static getArticulation(e){const r=e.percussionArticulation,i=e.beat.voice.bar.staff.track.percussionArticulations;return r=0}get isPiano(){return!this.isStringed&&this.octave>=0&&this.tone>=0}get isPercussion(){return!this.isStringed&&this.percussionArticulation>=0}get element(){return this.isPercussion?ki.getElementAndVariation(this)[0]:-1}get variation(){return this.isPercussion?ki.getElementAndVariation(this)[1]:-1}get isHammerPullDestination(){return!!this.hammerPullOrigin}get isSlurOrigin(){return!!this.slurDestination}get isHarmonic(){return this.harmonicType!==Xe.None}get isTieOrigin(){return this.tieDestination!==null}get trillFret(){return this.trillValue-this.stringTuning}get isTrill(){return this.trillValue>=0}get isEffectSlurDestination(){return!!this.effectSlurOrigin}get stringTuning(){return this.beat.voice.bar.staff.capo+kr.getStringTuning(this.beat.voice.bar.staff,this.string)}static getStringTuning(e,r){return e.tuning.length>0?e.tuning[e.tuning.length-(r-1)-1]:0}get realValue(){return this.calculateRealValue(!0,!0)}get realValueWithoutHarmonic(){return this.calculateRealValue(!0,!1)}calculateRealValue(e,r){const i=e?this.beat.voice.bar.staff.transpositionPitch:0;if(r){let n=this.calculateRealValue(e,!1);return this.isStringed&&(this.harmonicType===Xe.Natural?n=this.harmonicPitch+this.stringTuning-i:n+=this.harmonicPitch),n}else return this.isPercussion?this.percussionArticulation:this.isStringed?this.fret+this.stringTuning-i:this.isPiano?this.octave*12+this.tone-i:0}get harmonicPitch(){if(this.harmonicType===Xe.None||!this.isStringed)return 0;let e=this.harmonicValue;return er.isAlmostEqualTo(e,2.4)?36:er.isAlmostEqualTo(e,2.7)?34:e<3?0:e<=3.5?31:e<=4?28:e<=5?24:e<=6?34:e<=7?19:e<=8.5?36:e<=9?28:e<=10?34:e<=11?0:e<=12?12:e<14?0:e<=15?34:e<=16?28:e<=17?36:e<=18?0:e<=19?19:e<=21?0:e<=22?36:e<=24?24:0}get initialBendValue(){return this.hasBend?Math.floor(this.bendPoints[0].value/2):this.bendOrigin?Math.floor(this.bendOrigin.bendPoints[this.bendOrigin.bendPoints.length-1].value/2):this.isTieDestination&&this.tieOrigin.bendOrigin?Math.floor(this.tieOrigin.bendOrigin.bendPoints[this.tieOrigin.bendOrigin.bendPoints.length-1].value/2):this.beat.hasWhammyBar?Math.floor(this.beat.whammyBarPoints[0].value/2):this.beat.isContinuedWhammy?Math.floor(this.beat.previousBeat.whammyBarPoints[this.beat.previousBeat.whammyBarPoints.length-1].value/2):0}get displayValue(){return this.displayValueWithoutBend+this.initialBendValue}get displayValueWithoutBend(){let e=this.realValue;switch(this.harmonicType!==Xe.Natural&&this.harmonicType!==Xe.None&&(e-=this.harmonicPitch),this.beat.ottava){case Ft._15ma:e-=24;break;case Ft._8va:e-=12;break;case Ft.Regular:break;case Ft._8vb:e+=12;break;case Ft._15mb:e+=24;break}switch(this.beat.voice.bar.clefOttava){case Ft._15ma:e-=24;break;case Ft._8va:e-=12;break;case Ft.Regular:break;case Ft._8vb:e+=12;break;case Ft._15mb:e+=24;break}return e-this.beat.voice.bar.staff.displayTranspositionPitch}get hasQuarterToneOffset(){return this.hasBend?this.bendPoints[0].value%2!==0:this.bendOrigin?this.bendOrigin.bendPoints[this.bendOrigin.bendPoints.length-1].value%2!==0:this.beat.hasWhammyBar?this.beat.whammyBarPoints[0].value%2!==0:this.beat.isContinuedWhammy?this.beat.previousBeat.whammyBarPoints[this.beat.previousBeat.whammyBarPoints.length-1].value%2!==0:!1}addBendPoint(e){let r=this.bendPoints;r===null&&(r=[],this.bendPoints=r),r.push(e),(!this.maxBendPoint||e.value>this.maxBendPoint.value)&&(this.maxBendPoint=e),this.bendType===ze.None&&(this.bendType=ze.Custom)}finish(e,r=null){let i=new KR(()=>kr.nextNoteOnSameLine(this)),n=e&&e.notation.notationMode===si.SongBook;if(this.isTieDestination&&(this.chain(r),n&&this.tieOrigin&&this.tieOrigin.isLetRing&&(this.isLetRing=!0)),this.isLetRing&&(!i.value||!i.value.isLetRing?this.letRingDestination=this:this.letRingDestination=i.value,n&&this.isTieDestination&&!this.tieOrigin.hasBend&&(this.isVisible=!1)),this.isPalmMute&&(!i.value||!i.value.isPalmMute?this.palmMuteDestination=this:this.palmMuteDestination=i.value),this.isHammerPullOrigin){let o=kr.findHammerPullDestination(this);o?(this.hammerPullDestination=o,o.hammerPullOrigin=this):this.isHammerPullOrigin=!1}switch(this.slideOutType){case ut.Shift:case ut.Legato:this.slideTarget=i.value,this.slideTarget?this.slideTarget.slideOrigin=this:this.slideOutType=ut.None;break}let s=null;this.isHammerPullOrigin&&this.hammerPullDestination?s=this.hammerPullDestination:this.slideOutType===ut.Legato&&this.slideTarget&&(s=this.slideTarget),s&&(this.hasEffectSlur=!0,this.effectSlurOrigin&&this.beat.pickStroke===Bi.None?(this.effectSlurOrigin.effectSlurDestination=s,this.effectSlurOrigin.effectSlurDestination.effectSlurOrigin=this.effectSlurOrigin,this.effectSlurOrigin=null):(this.isEffectSlurOrigin=!0,this.effectSlurDestination=s,this.effectSlurDestination.effectSlurOrigin=this));const a=this.bendPoints;if(a!=null&&a.length>0&&this.bendType===ze.Custom){let o=this.isTieDestination&&this.tieOrigin.hasBend;if(this.isContinuedBend=o,a.length===4){let l=a[0],c=a[1],u=a[2],d=a[3];c.value===u.value?d.value>l.value?c.value>d.value?this.bendType=ze.BendRelease:!o&&l.value>0?(this.bendType=ze.PrebendBend,a.splice(2,1),a.splice(1,1)):(this.bendType=ze.Bend,a.splice(2,1),a.splice(1,1)):d.valuel.value?this.bendType=ze.BendRelease:l.value>0&&!o?(this.bendType=ze.Prebend,a.splice(2,1),a.splice(1,1)):(this.bendType=ze.Hold,a.splice(2,1),a.splice(1,1)):de.warning("Model","Unsupported bend type detected, fallback to custom",null)}else if(a.length===2){let l=a[0],c=a[1];c.value>l.value?!o&&l.value>0?this.bendType=ze.PrebendBend:this.bendType=ze.Bend:c.value0&&(this.accidentalMode=Or.Default)}static nextNoteOnSameLine(e){let r=e.beat.nextBeat;for(;r&&r.voice.bar.index<=e.beat.voice.bar.index+kr.MaxOffsetForSameLineSearch;){let i=r.getNoteOnString(e.string);if(i)return i;r=r.nextBeat}return null}static findHammerPullDestination(e){let r=e.beat.nextBeat;for(;r&&r.voice.bar.index<=e.beat.voice.bar.index+kr.MaxOffsetForSameLineSearch;){let i=r.getNoteOnString(e.string);if(i)return i;for(let n=e.string;n>0;n--)if(i=r.getNoteOnString(n),i){if(i.isLeftHandTapped)return i;break}for(let n=e.string;n<=e.beat.voice.bar.staff.tuning.length;n++)if(i=r.getNoteOnString(n),i){if(i.isLeftHandTapped)return i;break}r=r.nextBeat}return null}static findTieOrigin(e){let r=e.beat.previousBeat;for(;r&&r.voice.bar.index>=e.beat.voice.bar.index-kr.MaxOffsetForSameLineSearch;){if(e.isStringed){let i=r.getNoteOnString(e.string);if(i)return i}else if(e.octave===-1&&e.tone===-1){if(e.index0&&(this.id=this.beats[0].absoluteDisplayStart+"_"+this.beats[0].voice.index)}}var js;(function(t){t[t.Auto=0]="Auto",t[t.ForceSplitToNext=1]="ForceSplitToNext",t[t.ForceMergeWithNext=2]="ForceMergeWithNext"})(js||(js={}));class Mi{constructor(){this.id=Mi._globalBeatId++,this.index=0,this.previousBeat=null,this.nextBeat=null,this.notes=[],this.noteStringLookup=new Map,this.noteValueLookup=new Map,this.isEmpty=!1,this.whammyStyle=Gt.Default,this.ottava=Ft.Regular,this.fermata=null,this.isLegatoOrigin=!1,this.minNote=null,this.maxNote=null,this.maxStringNote=null,this.minStringNote=null,this.duration=H.Quarter,this.isLetRing=!1,this.isPalmMute=!1,this.automations=[],this.dots=0,this.fadeIn=!1,this.lyrics=null,this.hasRasgueado=!1,this.pop=!1,this.slap=!1,this.tap=!1,this.text=null,this.brushType=ir.None,this.brushDuration=0,this.tupletDenominator=-1,this.tupletNumerator=-1,this.tupletGroup=null,this.isContinuedWhammy=!1,this.whammyBarType=Lt.None,this.whammyBarPoints=null,this.maxWhammyPoint=null,this.minWhammyPoint=null,this.vibrato=Dt.None,this.chordId=null,this.graceType=Je.None,this.graceGroup=null,this.graceIndex=-1,this.pickStroke=Bi.None,this.tremoloSpeed=null,this.crescendo=pn.None,this.displayStart=0,this.playbackStart=0,this.displayDuration=0,this.playbackDuration=0,this.dynamics=yt.F,this.invertBeamDirection=!1,this.preferredBeamDirection=null,this.isEffectSlurOrigin=!1,this.effectSlurOrigin=null,this.effectSlurDestination=null,this.beamingMode=js.Auto}get isLastOfVoice(){return this.index===this.voice.beats.length-1}get isLegatoDestination(){return!!this.previousBeat&&this.previousBeat.isLegatoOrigin}get isRest(){return this.isEmpty||this.notes.length===0}get isFullBarRest(){return this.isRest&&this.voice.beats.length===1&&this.duration===H.Whole}get hasTuplet(){return!(this.tupletDenominator===-1&&this.tupletNumerator===-1)&&!(this.tupletDenominator===1&&this.tupletNumerator===1)}get hasWhammyBar(){return this.whammyBarPoints!==null&&this.whammyBarType!==Lt.None}get hasChord(){return!!this.chordId}get chord(){return this.chordId?this.voice.bar.staff.getChord(this.chordId):null}get isTremolo(){return!!this.tremoloSpeed}get absoluteDisplayStart(){return this.voice.bar.masterBar.start+this.displayStart}get absolutePlaybackStart(){return this.voice.bar.masterBar.start+this.playbackStart}get isEffectSlurDestination(){return!!this.effectSlurOrigin}addWhammyBarPoint(e){let r=this.whammyBarPoints;r===null&&(r=[],this.whammyBarPoints=r),r.push(e),(!this.maxWhammyPoint||e.value>this.maxWhammyPoint.value)&&(this.maxWhammyPoint=e),(!this.minWhammyPoint||e.value=r.length)return;r.splice(e,1);let i=r[e];if(i===this.maxWhammyPoint){this.maxWhammyPoint=null;for(let n of r)(!this.maxWhammyPoint||n.value>this.maxWhammyPoint.value)&&(this.maxWhammyPoint=n)}if(i===this.minWhammyPoint){this.minWhammyPoint=null;for(let n of r)(!this.minWhammyPoint||n.value=0&&(this.notes.splice(r,1),e.isStringed&&this.noteStringLookup.delete(e.string))}getAutomation(e){for(let r=0,i=this.automations.length;r0&&this.tupletNumerator>=0&&(e=lt.applyTuplet(e,this.tupletNumerator,this.tupletDenominator)),e}updateDurations(){let e=this.calculateDuration();switch(this.playbackDuration=e,this.graceType){case Je.BeforeBeat:case Je.OnBeat:switch(this.duration){case H.Sixteenth:this.playbackDuration=lt.toTicks(H.SixtyFourth);break;case H.ThirtySecond:this.playbackDuration=lt.toTicks(H.OneHundredTwentyEighth);break;default:this.playbackDuration=lt.toTicks(H.ThirtySecond);break}this.displayDuration=0;break;case Je.BendGrace:this.playbackDuration/=2,this.displayDuration=0;break;default:this.displayDuration=e;let r=this.previousBeat;r&&r.graceType===Je.BendGrace&&(this.playbackDuration=r.playbackDuration);break}}finishTuplet(){let e=this.previousBeat,r=e?e.tupletGroup:null;(this.hasTuplet||this.graceType!==Je.None&&r)&&((!e||!r||!r.check(this))&&(r=new Ci(this.voice),r.check(this)),this.tupletGroup=r)}finish(e,r=null){switch(this.getAutomation(ai.Instrument)===null&&this.index===0&&this.voice.index===0&&this.voice.bar.index===0&&this.voice.bar.staff.index===0&&this.automations.push(Ei.buildInstrumentAutomation(!1,0,this.voice.bar.staff.track.playbackInfo.program)),this.graceType){case Je.OnBeat:case Je.BeforeBeat:let c=this.graceGroup.beats.length;c===1?this.duration=H.Eighth:c===2?this.duration=H.Sixteenth:this.duration=H.ThirtySecond;break}let i=e?e.notation.notationMode:si.GuitarPro,n=this.text==="grad"||this.text==="grad.";n&&i===si.SongBook&&(this.text="");let s=!1;this.minNote=null,this.maxNote=null,this.minStringNote=null,this.maxStringNote=null;let a=0,o=!1;for(let c=0,u=this.notes.length;cthis.maxNote.realValue)&&(this.maxNote=d),(!this.minStringNote||d.stringthis.maxStringNote.string)&&(this.maxStringNote=d),d.hasEffectSlur&&(o=!0))}if(o&&(this.effectSlurOrigin?(this.effectSlurOrigin.effectSlurDestination=this.nextBeat,this.effectSlurOrigin.effectSlurDestination&&(this.effectSlurOrigin.effectSlurDestination.effectSlurOrigin=this.effectSlurOrigin),this.effectSlurOrigin=null):(this.isEffectSlurOrigin=!0,this.effectSlurDestination=this.nextBeat,this.effectSlurDestination&&(this.effectSlurDestination.effectSlurOrigin=this))),this.notes.length>0&&a===0&&(this.isEmpty=!0),!this.isRest&&(!this.isLetRing||!this.isPalmMute)){let c=this.previousBeat;for(;c&&c.isRest;)this.isLetRing||(c.isLetRing=!1),this.isPalmMute||(c.isPalmMute=!1),c=c.previousBeat}else this.isRest&&this.previousBeat&&e&&e.notation.notationMode===si.GuitarPro&&(this.previousBeat.isLetRing&&(this.isLetRing=!0),this.previousBeat.isPalmMute&&(this.isPalmMute=!0));const l=this.whammyBarPoints;if(l!==null&&l.length>0&&this.whammyBarType===Lt.Custom){i===si.SongBook&&(this.whammyStyle=n?Gt.Gradual:Gt.Fast);let c=!!this.previousBeat&&this.previousBeat.hasWhammyBar;if(this.isContinuedWhammy=c,l.length===4){let u=l[0],d=l[1],h=l[2],p=l[3];d.value===h.value&&(u.valued.value&&d.value>p.value?(u.value!==0&&!c?this.whammyBarType=Lt.PrediveDive:this.whammyBarType=Lt.Dive,l.splice(2,1),l.splice(1,1)):u.value>d.value&&d.valuep.value?(this.whammyBarType=Lt.Dip,(d.offset===h.offset||i===si.SongBook)&&l.splice(2,1)):u.value===d.value&&d.value===p.value&&(u.value!==0&&!c?this.whammyBarType=Lt.Predive:this.whammyBarType=Lt.Hold,l.splice(2,1),l.splice(1,1)))}}if(this.updateDurations(),s){let c=MS.clone(this);c.id=Mi._globalBeatId++,c.pickStroke=Bi.None;for(let u=0,d=c.notes.length;ue.voice.bar.index||e.voice.bar.index===this.voice.bar.index&&this.index>e.index}hasNoteOnString(e){return this.noteStringLookup.has(e)}getNoteWithRealValue(e){return this.noteValueLookup.has(e)?this.noteValueLookup.get(e):null}chain(e=null){for(const r of this.notes)this.noteValueLookup.set(r.realValue,r),r.chain(e)}}Mi._globalBeatId=0;class Wo{constructor(){this.name="",this.firstFret=1,this.strings=[],this.barreFrets=[],this.showName=!0,this.showDiagram=!0,this.showFingering=!0}get uniqueId(){return[this.name,this.firstFret.toString(),this.strings.join(","),this.barreFrets.join(","),this.showDiagram.toString(),this.showFingering.toString(),this.showName.toString()].join("|")}}var Zr;(function(t){t[t.Cb=-7]="Cb",t[t.Gb=-6]="Gb",t[t.Db=-5]="Db",t[t.Ab=-4]="Ab",t[t.Eb=-3]="Eb",t[t.Bb=-2]="Bb",t[t.F=-1]="F",t[t.C=0]="C",t[t.G=1]="G",t[t.D=2]="D",t[t.A=3]="A",t[t.E=4]="E",t[t.B=5]="B",t[t.FSharp=6]="FSharp",t[t.CSharp=7]="CSharp"})(Zr||(Zr={}));var Fi;(function(t){t[t.IgnoreSpaces=0]="IgnoreSpaces",t[t.Begin=1]="Begin",t[t.Text=2]="Text",t[t.Comment=3]="Comment",t[t.Dash=4]="Dash"})(Fi||(Fi={}));class Hr{constructor(){this.startBar=0,this.text=""}finish(e=!1){this.chunks=[],this.parse(this.text,0,this.chunks,e)}parse(e,r,i,n){if(!e)return;let s=Fi.Begin,a=Fi.Begin,o=!1,l=0;for(;r0&&e!=="-")&&this.chunks.push(e)}prepareChunk(e){let r=e.split("+").join(" "),i=r.length;for(;i>0&&r.charAt(i-1)==="_";)i--;return i!==r.length?r.substr(0,i):r}}Hr.CharCodeLF=10;Hr.CharCodeTab=9;Hr.CharCodeCR=13;Hr.CharCodeSpace=32;Hr.CharCodeBrackedClose=93;Hr.CharCodeBrackedOpen=91;Hr.CharCodeDash=45;var Ho;(function(t){t[t.Major=0]="Major",t[t.Minor=1]="Minor"})(Ho||(Ho={}));var gt;(function(t){t[t.NoTripletFeel=0]="NoTripletFeel",t[t.Triplet16th=1]="Triplet16th",t[t.Triplet8th=2]="Triplet8th",t[t.Dotted16th=3]="Dotted16th",t[t.Dotted8th=4]="Dotted8th",t[t.Scottish16th=5]="Scottish16th",t[t.Scottish8th=6]="Scottish8th"})(gt||(gt={}));class eo{constructor(){this.alternateEndings=0,this.nextMasterBar=null,this.previousMasterBar=null,this.index=0,this.keySignature=Zr.C,this.keySignatureType=Ho.Major,this.isDoubleBar=!1,this.isRepeatStart=!1,this.repeatCount=0,this.timeSignatureNumerator=4,this.timeSignatureDenominator=4,this.timeSignatureCommon=!1,this.tripletFeel=gt.NoTripletFeel,this.section=null,this.tempoAutomation=null,this.fermata=null,this.start=0,this.isAnacrusis=!1,this.displayScale=1,this.displayWidth=-1}get isRepeatEnd(){return this.repeatCount>0}get isSectionStart(){return!!this.section}calculateDuration(e=!0){if(this.isAnacrusis&&e){let r=0;for(let i of this.score.tracks)for(let n of i.staves){let s=this.indexr&&(r=s)}return r}return this.timeSignatureNumerator*lt.valueToTicks(this.timeSignatureDenominator)}addFermata(e,r){let i=this.fermata;i===null&&(i=new Map,this.fermata=i),i.set(e,r)}getFermata(e){const r=this.fermata;return r===null?null:r.has(e.playbackStart)?r.get(e.playbackStart):null}}eo.MaxAlternateEndings=8;class IQ{constructor(){this.hideDynamics=!1}}class AC{constructor(){this.masterBars=[],this.opening=null,this.closings=[],this.isClosed=!1}get openings(){const e=this.opening;return e?[e]:[]}get isOpened(){var e;return((e=this.opening)==null?void 0:e.isRepeatStart)===!0}addMasterBar(e){this.opening===null&&(this.opening=e),this.masterBars.push(e),e.repeatGroup=this,e.isRepeatEnd&&(this.closings.push(e),this.isClosed=!0)}}class Ql{constructor(){this._currentRepeatGroup=null,this._openedRepeatGroups=[],this._properlyOpenedRepeatGroups=0,this.album="",this.artist="",this.copyright="",this.instructions="",this.music="",this.notices="",this.subTitle="",this.title="",this.words="",this.tab="",this.tempo=120,this.tempoLabel="",this.masterBars=[],this.tracks=[],this.defaultSystemsLayout=3,this.systemsLayout=[],this.stylesheet=new IQ}rebuildRepeatGroups(){this._currentRepeatGroup=null,this._openedRepeatGroups=[],this._properlyOpenedRepeatGroups=0;for(const e of this.masterBars)this.addMasterBarToRepeatGroups(e)}addMasterBar(e){e.score=this,e.index=this.masterBars.length,this.masterBars.length!==0&&(e.previousMasterBar=this.masterBars[this.masterBars.length-1],e.previousMasterBar.nextMasterBar=e,e.start=e.previousMasterBar.start+(e.previousMasterBar.isAnacrusis?0:e.previousMasterBar.calculateDuration())),this.addMasterBarToRepeatGroups(e),this.masterBars.push(e)}addMasterBarToRepeatGroups(e){var r;e.isRepeatStart?((r=this._currentRepeatGroup)!=null&&r.isClosed&&(this._openedRepeatGroups.pop(),this._properlyOpenedRepeatGroups--),this._currentRepeatGroup=new AC,this._openedRepeatGroups.push(this._currentRepeatGroup),this._properlyOpenedRepeatGroups++):this._currentRepeatGroup||(this._currentRepeatGroup=new AC,this._openedRepeatGroups.push(this._currentRepeatGroup)),this._currentRepeatGroup.addMasterBar(e),e.isRepeatEnd&&this._properlyOpenedRepeatGroups>1&&(this._openedRepeatGroups.pop(),this._properlyOpenedRepeatGroups--,this._currentRepeatGroup=this._openedRepeatGroups.length>0?this._openedRepeatGroups[this._openedRepeatGroups.length-1]:null)}addTrack(e){e.score=this,e.index=this.tracks.length,this.tracks.push(e)}finish(e){const r=new Map;for(let i=0,n=this.tracks.length;i>24&255}get r(){return this.raw>>16&255}get g(){return this.raw>>8&255}get b(){return this.raw&255}static random(e=100){return new Yt(Math.random()*255|0,Math.random()*255|0,Math.random()*255|0,e)}static fromJson(e){switch(typeof e){case"number":{const r=new Yt(0,0,0,0);return r.raw=e,r.updateRgba(),r}case"string":{const r=e;if(r.startsWith("#")){if(r.length===4)return new Yt(parseInt(r[1],16)*17,parseInt(r[2],16)*17,parseInt(r[3],16)*17);if(r.length===5)return new Yt(parseInt(r[1],16)*17,parseInt(r[2],16)*17,parseInt(r[3],16)*17,parseInt(r[4],16)*17);if(r.length===7)return new Yt(parseInt(r.substring(1,3),16),parseInt(r.substring(3,5),16),parseInt(r.substring(5,7),16));if(r.length===9)return new Yt(parseInt(r.substring(1,3),16),parseInt(r.substring(3,5),16),parseInt(r.substring(5,7),16),parseInt(r.substring(7,9),16))}else if(r.startsWith("rgba")||r.startsWith("rgb")){const i=r.indexOf("("),n=r.lastIndexOf(")");if(i===-1||n===-1)throw new Wr("No values specified for rgb/rgba function");const s=r.substring(i+1,n).split(",");if(s.length===3)return new Yt(parseInt(s[0]),parseInt(s[1]),parseInt(s[2]));if(s.length===4)return new Yt(parseInt(s[0]),parseInt(s[1]),parseInt(s[2]),parseFloat(s[3])*255)}return null}}throw new Wr("Unsupported format for color")}static toJson(e){return e.raw}}Yt.BlackRgb="#000000";class ZR{constructor(){this.volume=15,this.balance=8,this.port=1,this.program=0,this.primaryChannel=0,this.secondaryChannel=0,this.isMute=!1,this.isSolo=!1}}class ye{static getTextForTuning(e,r){let i=ye.getTextPartsForTuning(e);return r?i.join(""):i[0]}static getTextPartsForTuning(e,r=-1){let i=e/12|0,n=e%12;return[["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"][n],(i+r).toString()]}static getDefaultTuningFor(e){return ye._defaultTunings.has(e)?ye._defaultTunings.get(e):null}static getPresetsFor(e){switch(e){case 7:return ye._sevenStrings;case 6:return ye._sixStrings;case 5:return ye._fiveStrings;case 4:return ye._fourStrings}return[]}static initialize(){ye._defaultTunings.set(7,new ye("Guitar 7 strings",[64,59,55,50,45,40,35],!0)),ye._sevenStrings.push(ye._defaultTunings.get(7)),ye._defaultTunings.set(6,new ye("Guitar Standard Tuning",[64,59,55,50,45,40],!0)),ye._sixStrings.push(ye._defaultTunings.get(6)),ye._sixStrings.push(new ye("Guitar Tune down ½ step",[63,58,54,49,44,39],!1)),ye._sixStrings.push(new ye("Guitar Tune down 1 step",[62,57,53,48,43,38],!1)),ye._sixStrings.push(new ye("Guitar Tune down 2 step",[60,55,51,46,41,36],!1)),ye._sixStrings.push(new ye("Guitar Dropped D Tuning",[64,59,55,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Dropped D Tuning variant",[64,57,55,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Double Dropped D Tuning",[62,59,55,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Dropped E Tuning",[66,61,57,52,47,40],!1)),ye._sixStrings.push(new ye("Guitar Dropped C Tuning",[62,57,53,48,43,36],!1)),ye._sixStrings.push(new ye("Guitar Open C Tuning",[64,60,55,48,43,36],!1)),ye._sixStrings.push(new ye("Guitar Open Cm Tuning",[63,60,55,48,43,36],!1)),ye._sixStrings.push(new ye("Guitar Open C6 Tuning",[64,57,55,48,43,36],!1)),ye._sixStrings.push(new ye("Guitar Open Cmaj7 Tuning",[64,59,55,52,43,36],!1)),ye._sixStrings.push(new ye("Guitar Open D Tuning",[62,57,54,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Open Dm Tuning",[62,57,53,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Open D5 Tuning",[62,57,50,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Open D6 Tuning",[62,59,54,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Open Dsus4 Tuning",[62,57,55,50,45,38],!1)),ye._sixStrings.push(new ye("Guitar Open E Tuning",[64,59,56,52,47,40],!1)),ye._sixStrings.push(new ye("Guitar Open Em Tuning",[64,59,55,52,47,40],!1)),ye._sixStrings.push(new ye("Guitar Open Esus11 Tuning",[64,59,55,52,45,40],!1)),ye._sixStrings.push(new ye("Guitar Open F Tuning",[65,60,53,48,45,41],!1)),ye._sixStrings.push(new ye("Guitar Open G Tuning",[62,59,55,50,43,38],!1)),ye._sixStrings.push(new ye("Guitar Open Gm Tuning",[62,58,55,50,43,38],!1)),ye._sixStrings.push(new ye("Guitar Open G6 Tuning",[64,59,55,50,43,38],!1)),ye._sixStrings.push(new ye("Guitar Open Gsus4 Tuning",[62,60,55,50,43,38],!1)),ye._sixStrings.push(new ye("Guitar Open A Tuning",[64,61,57,52,45,40],!1)),ye._sixStrings.push(new ye("Guitar Open Am Tuning",[64,60,57,52,45,40],!1)),ye._sixStrings.push(new ye("Guitar Nashville Tuning",[64,59,67,62,57,52],!1)),ye._sixStrings.push(new ye("Bass 6 Strings Tuning",[48,43,38,33,28,23],!1)),ye._sixStrings.push(new ye("Lute or Vihuela Tuning",[64,59,54,50,45,40],!1)),ye._defaultTunings.set(5,new ye("Bass 5 Strings Tuning",[43,38,33,28,23],!0)),ye._fiveStrings.push(ye._defaultTunings.get(5)),ye._fiveStrings.push(new ye("Banjo Dropped C Tuning",[62,59,55,48,67],!1)),ye._fiveStrings.push(new ye("Banjo Open D Tuning",[62,57,54,50,69],!1)),ye._fiveStrings.push(new ye("Banjo Open G Tuning",[62,59,55,50,67],!1)),ye._fiveStrings.push(new ye("Banjo G Minor Tuning",[62,58,55,50,67],!1)),ye._fiveStrings.push(new ye("Banjo G Modal Tuning",[62,57,55,50,67],!1)),ye._defaultTunings.set(4,new ye("Bass Standard Tuning",[43,38,33,28],!0)),ye._fourStrings.push(ye._defaultTunings.get(4)),ye._fourStrings.push(new ye("Bass Tune down ½ step",[42,37,32,27],!1)),ye._fourStrings.push(new ye("Bass Tune down 1 step",[41,36,31,26],!1)),ye._fourStrings.push(new ye("Bass Tune down 2 step",[39,34,29,24],!1)),ye._fourStrings.push(new ye("Bass Dropped D Tuning",[43,38,33,26],!1)),ye._fourStrings.push(new ye("Ukulele C Tuning",[45,40,36,43],!1)),ye._fourStrings.push(new ye("Ukulele G Tuning",[52,47,43,38],!1)),ye._fourStrings.push(new ye("Mandolin Standard Tuning",[64,57,50,43],!1)),ye._fourStrings.push(new ye("Mandolin or Violin Tuning",[76,69,62,55],!1)),ye._fourStrings.push(new ye("Viola Tuning",[69,62,55,48],!1)),ye._fourStrings.push(new ye("Cello Tuning",[57,50,43,36],!1))}static findTuning(e){let r=ye.getPresetsFor(e.length);for(let i=0,n=r.length;i0}finish(e,r=null){this.stringTuning.finish();for(let i=0,n=this.bars.length;i0&&(e.previousBar=r[r.length-1],e.previousBar.nextBar=e),r.push(e)}}class _a{constructor(){this.index=0,this.staves=[],this.playbackInfo=new ZR,this.color=new Yt(200,0,0,255),this.name="",this.shortName="",this.defaultSystemsLayout=3,this.systemsLayout=[],this.percussionArticulations=[]}ensureStaveCount(e){for(;this.staves.length_a.ShortNameMaxLength&&(this.shortName=this.shortName.substr(0,_a.ShortNameMaxLength)));for(let i=0,n=this.staves.length;i=0&&n.startBar0&&(e.nextBeat=i.beats[0]),e.nextBeat.previousBeat=e}e.chain(r)}}addGraceBeat(e){if(this.beats.length===0){this.addBeat(e);return}let r=this.beats[this.beats.length-1];this.beats.splice(this.beats.length-1,1),this.addBeat(e),this.addBeat(r),this.isEmpty=!1}getBeatAtPlaybackStart(e){return this._beatLookup.has(e)?this._beatLookup.get(e):null}finish(e,r=null){this._beatLookup=new Map;let i=null;for(let a=0;a=0?s.substr(0,n):s}static readSInt8(e){let r=e.readByte();return((r&255)>>7)*-256+(r&255)}static readInt24(e,r){let i=e[r]|e[r+1]<<8|e[r+2]<<16;return(i&8388608)===8388608&&(i=i|255<<24),i}static readInt16(e,r){return pt.int32ToInt16(e[r]|e[r+1]<<8)}static toString(e,r){let i=ae.detectEncoding(e);return i&&(r=i),r||(r="utf-8"),new TextDecoder(r).decode(e.buffer)}static detectEncoding(e){return e.length>2&&e[0]===254&&e[1]===255?"utf-16be":e.length>2&&e[0]===255&&e[1]===254?"utf-16le":e.length>4&&e[0]===0&&e[1]===0&&e[2]===254&&e[3]===255?"utf-32be":e.length>4&&e[0]===255&&e[1]===254&&e[2]===0&&e[3]===0?"utf-32le":null}static stringToBytes(e){return new TextEncoder().encode(e)}static writeInt32BE(e,r){e.writeByte(r>>24&255),e.writeByte(r>>16&255),e.writeByte(r>>8&255),e.writeByte(r>>0&255)}static writeInt32LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255),e.writeByte(r>>16&255),e.writeByte(r>>24&255)}static writeUInt16LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255)}static writeInt16LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255)}static writeInt16BE(e,r){e.writeByte(r>>8&255),e.writeByte(r>>0&255)}}class Di{constructor(){this.length=0,this.position=0}get bytesWritten(){return this.position}getBuffer(){return this._buffer}static empty(){return Di.withCapacity(0)}static withCapacity(e){let r=new Di;return r._buffer=new Uint8Array(e),r}static fromBuffer(e){let r=new Di;return r._buffer=e,r.length=e.length,r}static fromString(e){let r=ae.stringToBytes(e);return Di.fromBuffer(r)}reset(){this.position=0}skip(e){this.position+=e}readByte(){return this.length-this.position<=0?-1:this._buffer[this.position++]}read(e,r,i){let n=this.length-this.position;return n>i&&(n=i),n<=0?0:(e.set(this._buffer.subarray(this.position,this.position+n),r),this.position+=n,n)}writeByte(e){let r=this.position+1;this.ensureCapacity(r),this._buffer[this.position]=e&255,r>this.length&&(this.length=r),this.position=r}write(e,r,i){let n=this.position+i;this.ensureCapacity(n);let s=Math.min(i,e.length-r);this._buffer.set(e.subarray(r,r+s),this.position),n>this.length&&(this.length=n),this.position=n}ensureCapacity(e){if(e>this._buffer.length){let r=e;r<256&&(r=256),r0&&i.set(this._buffer.subarray(0,0+this.length),0),this._buffer=i}}readAll(){return this.toArray()}toArray(){let e=new Uint8Array(this.length);return e.set(this._buffer.subarray(0,0+this.length),0),e}copyTo(e){e.write(this._buffer,0,this.length)}}var q;(function(t){t[t.No=0]="No",t[t.Eof=1]="Eof",t[t.Number=2]="Number",t[t.DoubleDot=3]="DoubleDot",t[t.Dot=4]="Dot",t[t.String=5]="String",t[t.Tuning=6]="Tuning",t[t.LParensis=7]="LParensis",t[t.RParensis=8]="RParensis",t[t.LBrace=9]="LBrace",t[t.RBrace=10]="RBrace",t[t.Pipe=11]="Pipe",t[t.MetaCommand=12]="MetaCommand",t[t.Multiply=13]="Multiply",t[t.LowerThan=14]="LowerThan"})(q||(q={}));class Pl extends gi{constructor(e,r,i,n,s,a,o,l=null){super(mi.AlphaTex,e),this.position=r,this.line=i,this.col=n,this.nonTerm=s??"",this.expected=a??q.No,this.symbol=o??q.No,this.symbolData=l,Object.setPrototypeOf(this,Pl.prototype)}static symbolError(e,r,i,n,s,a,o=null){let l=`MalFormed AlphaTex: @${e} (line ${r}, col ${i}): Error on block ${n}`;return s!==a?(l+=`, expected a ${q[s]} found a ${q[a]}`,o!==null&&(l+=`: '${o}'`)):l+=`, invalid value: '${o}'`,new Pl(l,e,r,i,n,s,a,o)}static errorMessage(e,r,i,n){return e=`MalFormed AlphaTex: @${r} (line ${i}, col ${n}): ${e}`,new Pl(e,r,i,n,null,null,null,null)}}class Wi extends Bu{constructor(){super(),this._trackChannel=0,this._input="",this._ch=Wi.Eof,this._curChPos=0,this._line=1,this._col=0,this._lastValidSpot=[0,1,0],this._sy=q.No,this._syData="",this._allowNegatives=!1,this._allowFloat=!1,this._allowTuning=!1,this._currentDuration=H.QuadrupleWhole,this._currentDynamics=yt.PPP,this._currentTuplet=0,this._staffHasExplicitTuning=!1,this._staffTuningApplied=!1,this.logErrors=!1}get name(){return"AlphaTex"}initFromString(e,r){this.data=Di.empty(),this._input=e,this.settings=r}readScore(){try{if(this.data.length>0&&(this._input=ae.toString(this.data.readAll(),this.settings.importer.encoding)),this._allowTuning=!0,this._lyrics=new Map,this.createDefaultScore(),this._curChPos=0,this._line=1,this._col=0,this.saveValidSpot(),this._currentDuration=H.Quarter,this._currentDynamics=yt.F,this._currentTuplet=1,this._ch=this.nextChar(),this._sy=this.newSy(),this._sy===q.LowerThan)throw new Gr("Unknown start sign '<' (meant to import as XML?)");if(this._sy===q.Eof)throw new Gr("Unexpected end of file");const e=this.metaData(),r=this.bars();if(!e&&!r)throw new Gr("No alphaTex data found");this.consolidate(),this._score.finish(this.settings),this._score.rebuildRepeatGroups();for(const[i,n]of this._lyrics)this._score.tracks[i].applyLyrics(n);return this._score}catch(e){throw e instanceof Pl?new Gr(e.message,e):e}}consolidate(){for(let e of this._score.tracks)for(let r of e.staves)for(;r.bars.length=48&&e<=57||this._allowNegatives&&e===45||this._allowFloat&&e===46}readName(){let e="";do e+=String.fromCharCode(this._ch),this._ch=this.nextChar();while(Wi.isNameLetter(this._ch)||this.isDigit(this._ch));return e}readNumber(){let e="";do e+=String.fromCharCode(this._ch),this._ch=this.nextChar();while(this.isDigit(this._ch));return this._allowFloat?parseFloat(e):parseInt(e)}metaData(){let e=!1,r=!0;for(;this._sy===q.MetaCommand&&r;){let i=this._syData.toLowerCase();switch(i){case"title":case"subtitle":case"artist":case"album":case"words":case"music":case"copyright":this._sy=this.newSy(),this._sy!==q.String&&this.error(i,q.String,!0);let n=this._syData;switch(i){case"title":this._score.title=n;break;case"subtitle":this._score.subTitle=n;break;case"artist":this._score.artist=n;break;case"album":this._score.album=n;break;case"words":this._score.words=n;break;case"music":this._score.music=n;break;case"copyright":this._score.copyright=n;break}this._sy=this.newSy(),e=!0;break;case"tempo":this._allowFloat=!0,this._sy=this.newSy(),this._allowFloat=!1,this._sy===q.Number?this._score.tempo=this._syData:this.error("tempo",q.Number,!0),this._sy=this.newSy(),e=!0;break;default:this.handleStaffMeta()?e=!0:e?this.error("metaDataTags",q.String,!1):r=!1;break}}return e?(this._sy!==q.Dot&&this.error("song",q.Dot,!0),this._sy=this.newSy()):this._sy===q.Dot&&(this._sy=this.newSy()),e}handleStaffMeta(){var e;switch(this._syData.toLowerCase()){case"capo":return this._sy=this.newSy(),this._sy===q.Number?this._currentStaff.capo=this._syData:this.error("capo",q.Number,!0),this._sy=this.newSy(),!0;case"tuning":this._sy=this.newSy();let r=this._currentStaff.tuning.length;switch(this._staffHasExplicitTuning=!0,this._staffTuningApplied=!1,this._sy){case q.String:let s=this._syData.toLowerCase();s==="piano"||s==="none"||s==="voice"?(this._currentStaff.stringTuning.tunings=[],this._currentStaff.displayTranspositionPitch=0):this.error("tuning",q.Tuning,!0),this._sy=this.newSy();break;case q.Tuning:let a=[];do{let o=this._syData;a.push(o.realValue),this._sy=this.newSy()}while(this._sy===q.Tuning);this._currentStaff.stringTuning.tunings=a;break;default:this.error("tuning",q.Tuning,!0);break}return r!==this._currentStaff.tuning.length&&(((e=this._currentStaff.chords)==null?void 0:e.size)??0)>0&&this.errorMessage("Tuning must be defined before any chord"),!0;case"instrument":if(this._sy=this.newSy(),this._staffTuningApplied=!1,this._sy===q.Number){let s=this._syData;s>=0&&s<=127?this._currentTrack.playbackInfo.program=this._syData:this.error("instrument",q.Number,!1)}else if(this._sy===q.String){let s=this._syData.toLowerCase();this._currentTrack.playbackInfo.program=$a.getValue(s)}else this.error("instrument",q.Number,!0);return this._sy=this.newSy(),!0;case"lyrics":this._sy=this.newSy();let i=new Hr;return i.startBar=0,i.text="",this._sy===q.Number&&(i.startBar=this._syData,this._sy=this.newSy()),this._sy===q.String?(i.text=this._syData,this._sy=this.newSy()):this.error("lyrics",q.String,!0),this._lyrics.get(this._currentTrack.index).push(i),!0;case"chord":this._sy=this.newSy();let n=new Wo;this.chordProperties(n),this._sy===q.String?(n.name=this._syData,this._sy=this.newSy()):this.error("chord-name",q.Number,!0);for(let s=0;s0&&this.newTrack(),this._sy===q.String&&(this._currentTrack.name=this._syData,this._sy=this.newSy()),this._sy===q.String&&(this._currentTrack.shortName=this._syData,this._sy=this.newSy())),this._sy===q.MetaCommand&&this._syData.toLowerCase()==="staff"&&(this._staffHasExplicitTuning=!1,this._staffTuningApplied=!1,this._sy=this.newSy(),this._currentTrack.staves[0].bars.length>0&&(this._currentTrack.ensureStaveCount(this._currentTrack.staves.length+1),this._currentStaff=this._currentTrack.staves[this._currentTrack.staves.length-1],this._currentDynamics=yt.F),this.staffProperties()),!0)}staffProperties(){if(this._sy!==q.LBrace)return;this._sy=this.newSy();let e=!1,r=!1;for(;this._sy===q.String;)switch(this._syData.toLowerCase()){case"score":e=!0,this._sy=this.newSy();break;case"tabs":r=!0,this._sy=this.newSy();break;default:this.error("staff-properties",q.String,!1);break}(e||r)&&(this._currentStaff.showStandardNotation=e,this._currentStaff.showTablature=r),this._sy!==q.RBrace&&this.error("staff-properties",q.RBrace,!0),this._sy=this.newSy()}bar(){const e=this.trackStaffMeta();let r=this.newBar(this._currentStaff);if(this._currentStaff.bars.length>this._score.masterBars.length){let a=new eo;this._score.addMasterBar(a),a.index>0&&(a.keySignature=a.previousMasterBar.keySignature,a.keySignatureType=a.previousMasterBar.keySignatureType,a.timeSignatureDenominator=a.previousMasterBar.timeSignatureDenominator,a.timeSignatureNumerator=a.previousMasterBar.timeSignatureNumerator,a.tripletFeel=a.previousMasterBar.tripletFeel)}const i=this.barMeta(r);if(!this._staffTuningApplied&&!this._staffHasExplicitTuning){const a=this._currentTrack.playbackInfo.program;this._currentStaff.displayTranspositionPitch=0,this._currentStaff.stringTuning.tunings=[],a==15||a>=24&&a<=31?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=ye.getDefaultTuningFor(6).tunings):a>=32&&a<=39?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=[43,38,33,28]):a==40||a==44||a==45||a==48||a==49||a==50||a==51?this._currentStaff.stringTuning.tunings=[52,57,50,43]:a==41?this._currentStaff.stringTuning.tunings=[57,50,43,36]:a==42?this._currentStaff.stringTuning.tunings=[45,38,31,24]:a==43?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=[43,38,33,28]):a==105?this._currentStaff.stringTuning.tunings=[50,47,43,38,55]:a==106?this._currentStaff.stringTuning.tunings=[57,52,45]:a==107?this._currentStaff.stringTuning.tunings=[52,45,38,31]:a==110&&(this._currentStaff.stringTuning.tunings=[64,57,50,43]),this._staffTuningApplied=!0}let n=!1,s=r.voices[0];for(;this._sy!==q.Pipe&&this._sy!==q.Eof&&this.beat(s);)n=!0;if(s.beats.length===0){let a=new Mi;a.isEmpty=!0,s.addBeat(a)}return e||i||n}newBar(e){let r=new so;e.addBar(r),r.index>0&&(r.clef=r.previousBar.clef);let i=new Ba;return r.addVoice(i),r}beat(e){this.beatDuration();let r=new Mi;if(e.addBeat(r),this._sy===q.LParensis){for(this._sy=this.newSy(),this.note(r);this._sy!==q.RParensis&&this._sy!==q.Eof&&this.note(r););this._sy!==q.RParensis&&this.error("note-list",q.RParensis,!0),this._sy=this.newSy()}else if(this._sy===q.String&&this._syData.toLowerCase()==="r")this._sy=this.newSy();else if(!this.note(r))return e.beats.splice(e.beats.length-1,1),!1;this._sy===q.Dot&&(this._allowNegatives=!0,this._sy=this.newSy(),this._allowNegatives=!1,this._sy!==q.Number&&this.error("duration",q.Number,!0),this._currentDuration=this.parseDuration(this._syData),this._sy=this.newSy()),r.duration=this._currentDuration,r.dynamics=this._currentDynamics,this._currentTuplet!==1&&!r.hasTuplet&&Wi.applyTuplet(r,this._currentTuplet);let i=1;this._sy===q.Multiply&&(this._sy=this.newSy(),this._sy!==q.Number?this.error("multiplier",q.Number,!0):i=this._syData,this._sy=this.newSy()),this.beatEffects(r);for(let n=0;n60;)e.removeWhammyBarPoint(e.whammyBarPoints.length-1);if(i)e.whammyBarPoints.sort((n,s)=>n.offset-s.offset);else{let n=e.whammyBarPoints.length,s=60/n|0,a=0;for(;a0,l=-1;o&&(this._sy!==q.Dot&&this.error("note",q.Dot,!0),this._sy=this.newSy(),this._sy!==q.Number&&this.error("note-string",q.Number,!0),l=this._syData,(l<1||l>this._currentStaff.tuning.length)&&this.error("note-string",q.Number,!1),this._sy=this.newSy());let c=new kr;return o?(c.string=this._currentStaff.tuning.length-(l-1),c.isDead=r,c.isTieDestination=i,i||(c.fret=n)):(c.octave=s,c.tone=a,c.isTieDestination=i),e.addNote(c),this.noteEffects(c),!0}noteEffects(e){if(this._sy===q.LBrace){for(this._sy=this.newSy();this._sy===q.String;){let r=this._syData.toLowerCase();if(r==="b"||r==="be"){let i=r==="be";for(this._sy=this.newSy(),this._sy!==q.LParensis&&this.error("bend-effect",q.LParensis,!0),this._sy=this.newSy();this._sy!==q.RParensis&&this._sy!==q.Eof;){let s=0,a=0;i?(this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),s=this._syData,this._sy=this.newSy(),this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),a=this._syData):(this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),a=this._syData),e.addBendPoint(new Re(s,a)),this._sy=this.newSy()}const n=e.bendPoints;if(n!=null){for(;n.length>60;)n.splice(n.length-1,1);if(i)n.sort((s,a)=>s.offset-a.offset);else{let s=n.length,a=60/(s-1)|0,o=0;for(;o2048&&this.error("repeatclose",q.Number,!1),i.repeatCount=this._syData,this._sy=this.newSy();else if(n==="ae")if(this._sy=this.newSy(),this._sy===q.LParensis){for(this._sy=this.newSy(),this._sy!==q.Number&&this.error("alternateending",q.Number,!0),this.applyAlternateEnding(i);this._sy===q.Number;)this.applyAlternateEnding(i);this._sy!==q.RParensis&&this.error("alternateending-list",q.RParensis,!0),this._sy=this.newSy()}else this._sy!==q.Number&&this.error("alternateending",q.Number,!0),this.applyAlternateEnding(i);else if(n==="ks")this._sy=this.newSy(),this._sy!==q.String&&this.error("keysignature",q.String,!0),i.keySignature=this.parseKeySignature(this._syData),this._sy=this.newSy();else if(n==="clef"){switch(this._sy=this.newSy(),this._sy){case q.String:e.clef=this.parseClefFromString(this._syData);break;case q.Number:e.clef=this.parseClefFromInt(this._syData);break;case q.Tuning:let s=this._syData;e.clef=this.parseClefFromInt(s.realValue);break;default:this.error("clef",q.String,!0);break}this._sy=this.newSy()}else if(n==="tempo"){this._allowFloat=!0,this._sy=this.newSy(),this._allowFloat=!1,this._sy!==q.Number&&this.error("tempo",q.Number,!0);let s=new Ei;s.isLinear=!1,s.type=ai.Tempo,s.value=this._syData,i.tempoAutomation=s,this._sy=this.newSy()}else if(n==="section"){this._sy=this.newSy(),this._sy!==q.String&&this.error("section",q.String,!0);let s=this._syData;this._sy=this.newSy();let a="";this._sy===q.String&&!this.isNoteText(this._syData.toLowerCase())&&(a=s,s=this._syData,this._sy=this.newSy());let o=new iy;o.marker=a,o.text=s,i.section=o}else if(n==="tf"){switch(this._allowTuning=!1,this._sy=this.newSy(),this._allowTuning=!0,this._sy){case q.String:i.tripletFeel=this.parseTripletFeelFromString(this._syData);break;case q.Number:i.tripletFeel=this.parseTripletFeelFromInt(this._syData);break;default:this.error("triplet-feel",q.String,!0);break}this._sy=this.newSy()}else n==="ac"?(i.isAnacrusis=!0,this._sy=this.newSy()):e.index===0?this.handleStaffMeta()||this.error("measure-effects",q.String,!1):this.error("measure-effects",q.String,!1)}if(i.index===0&&!i.tempoAutomation){let n=new Ei;n.isLinear=!1,n.type=ai.Tempo,n.value=this._score.tempo,i.tempoAutomation=n}return r}applyAlternateEnding(e){let r=this._syData;r<1&&this.error("alternateending",q.Number,!0),e.alternateEndings|=1<=400&&this.readLyrics(),this._versionNumber>=510&&this.data.skip(19),this._versionNumber>=500&&(this.readPageSetup(),this._score.tempoLabel=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),this._score.tempo=ae.readInt32LE(this.data),this._versionNumber>=510&&Rt.gpReadBool(this.data),ae.readInt32LE(this.data),this._versionNumber>=400&&this.data.readByte(),this.readPlaybackInfos(),this._versionNumber>=500&&(this.data.skip(38),this.data.skip(4)),this._barCount=ae.readInt32LE(this.data),this._trackCount=ae.readInt32LE(this.data),this.readMasterBars(),this.readTracks(),this.readBars(),this._score.masterBars.length>0&&(this._score.masterBars[0].tempoAutomation=Ei.buildTempoAutomation(!1,0,this._score.tempo,2),this._score.masterBars[0].tempoAutomation.text=this._score.tempoLabel),this._score.finish(this.settings),this._lyrics&&this._lyricsTrack>=0&&this._score.tracks[this._lyricsTrack].applyLyrics(this._lyrics),this._score}readVersion(){let e=Rt.gpReadStringByteLength(this.data,30,this.settings.importer.encoding);if(!e.startsWith(da.VersionString))throw new Gr("Unsupported format");e=e.substr(da.VersionString.length+1);let r=e.indexOf(".");this._versionNumber=100*parseInt(e.substr(0,r))+parseInt(e.substr(r+1)),de.debug(this.name,"Guitar Pro version "+e+" detected")}readScoreInformation(){var i;this._score.title=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.subTitle=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.artist=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.album=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.words=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.music=this._versionNumber>=500?Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding):this._score.words,this._score.copyright=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.tab=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.instructions=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding);let e=ae.readInt32LE(this.data),r="";for(let n=0;n0&&(r+=`\r -`),r+=(i=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding))==null?void 0:i.toString();this._score.notices=r}readLyrics(){this._lyrics=[],this._lyricsTrack=ae.readInt32LE(this.data)-1;for(let e=0;e<5;e++){let r=new Hr;r.startBar=ae.readInt32LE(this.data)-1,r.text=Rt.gpReadStringInt(this.data,this.settings.importer.encoding),this._lyrics.push(r)}}readPageSetup(){this.data.skip(30);for(let e=0;e<10;e++)Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)}readPlaybackInfos(){this._playbackInfos=[];for(let e=0;e<64;e++){let r=new ZR;r.primaryChannel=e,r.secondaryChannel=e,r.program=ae.readInt32LE(this.data),r.volume=this.data.readByte(),r.balance=this.data.readByte(),this.data.skip(6),this._playbackInfos.push(r)}}readMasterBars(){for(let e=0;e0&&(e=this._score.masterBars[this._score.masterBars.length-1]);let r=new eo,i=this.data.readByte();if(i&1?r.timeSignatureNumerator=this.data.readByte():e&&(r.timeSignatureNumerator=e.timeSignatureNumerator),i&2?r.timeSignatureDenominator=this.data.readByte():e&&(r.timeSignatureDenominator=e.timeSignatureDenominator),r.isRepeatStart=(i&4)!==0,i&8&&(r.repeatCount=this.data.readByte()+(this._versionNumber>=500?0:1)),i&16&&this._versionNumber<500){let n=e,s=0;for(;n&&!(n.isRepeatEnd&&n!==e||n.isRepeatStart);)s=s|n.alternateEndings,n=n.previousMasterBar;let a=0,o=this.data.readByte();for(let l=0;l<8;l++){let c=1<l&&!(s&c)&&(a=a|c)}r.alternateEndings=a}if(i&32){let n=new iy;n.text=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),n.marker="",Rt.gpReadColor(this.data,!1),r.section=n}if(i&64?(r.keySignature=ae.readSInt8(this.data),r.keySignatureType=this.data.readByte()):e&&(r.keySignature=e.keySignature,r.keySignatureType=e.keySignatureType),this._versionNumber>=500&&i&3&&this.data.skip(4),this._versionNumber>=500&&(r.alternateEndings=this.data.readByte()),this._versionNumber>=500){switch(this.data.readByte()){case 1:r.tripletFeel=gt.Triplet8th;break;case 2:r.tripletFeel=gt.Triplet16th;break}this.data.readByte()}else r.tripletFeel=this._globalTripletFeel;r.isDoubleBar=(i&128)!==0,this._score.addMasterBar(r)}readTracks(){for(let e=0;ec&&s.push(u)}r.stringTuning.tunings=s;let a=ae.readInt32LE(this.data),o=ae.readInt32LE(this.data)-1,l=ae.readInt32LE(this.data)-1;if(this.data.skip(4),o>=0&&o=500&&(this.data.readByte(),this.data.readByte(),this.data.skip(43)),this._versionNumber>=510&&(this.data.skip(4),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding))}readBars(){for(let e=0;e=500&&(this.data.readByte(),n=2);for(let s=0;s=0;p--)h.push(d.chunks[p]);this._beatTextChunksByTrack.set(e.index,h)}else n.text=u}let l=Xe.None;s&8&&(l=this.readBeatEffects(n)),s&16&&this.readMixTableChange(n);let c=this.data.readByte();for(let u=6;u>=0;u--)if(c&1<=500&&(this.data.readByte(),this.data.readByte()&8&&this.data.readByte()),o&&!n.isRest&&this._beatTextChunksByTrack.has(e.index)&&this._beatTextChunksByTrack.get(e.index).length>0&&(n.lyrics=[this._beatTextChunksByTrack.get(e.index).pop()])}readChord(e){let r=new Wo,i=er.newGuid();if(this._versionNumber>=500){this.data.skip(17),r.name=Rt.gpReadStringByteLength(this.data,21,this.settings.importer.encoding),this.data.skip(4),r.firstFret=ae.readInt32LE(this.data);for(let a=0;a<7;a++){let o=ae.readInt32LE(this.data);a=400){this.data.skip(16),r.name=Rt.gpReadStringByteLength(this.data,21,this.settings.importer.encoding),this.data.skip(4),r.firstFret=ae.readInt32LE(this.data);for(let a=0;a<7;a++){let o=ae.readInt32LE(this.data);a=406?7:6;if(r.name=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),r.firstFret=ae.readInt32LE(this.data),r.firstFret>0)for(let s=0;s=400&&(i=this.data.readByte()),e.fadeIn=(r&16)!==0,(this._versionNumber<400&&r&1||r&2)&&(e.vibrato=Dt.Slight),e.hasRasgueado=(i&1)!==0,r&32&&this._versionNumber>=400)switch(ae.readSInt8(this.data)){case 1:e.tap=!0;break;case 2:e.slap=!0;break;case 3:e.pop=!0;break}else if(r&32){switch(ae.readSInt8(this.data)){case 1:e.tap=!0;break;case 2:e.slap=!0;break;case 3:e.pop=!0;break}this.data.skip(4)}if(i&4&&this.readTremoloBarEffect(e),r&64){let n=0,s=0;this._versionNumber<500?(s=this.data.readByte(),n=this.data.readByte()):(n=this.data.readByte(),s=this.data.readByte()),n>0?(e.brushType=ir.BrushUp,e.brushDuration=da.toStrokeValue(n)):s>0&&(e.brushType=ir.BrushDown,e.brushDuration=da.toStrokeValue(s))}if(i&2)switch(ae.readSInt8(this.data)){case 0:e.pickStroke=Bi.None;break;case 1:e.pickStroke=Bi.Up;break;case 2:e.pickStroke=Bi.Down;break}if(this._versionNumber<400){if(r&4)return Xe.Natural;if(r&8)return Xe.Artificial}return Xe.None}readTremoloBarEffect(e){this.data.readByte(),ae.readInt32LE(this.data);let r=ae.readInt32LE(this.data);if(r>0)for(let i=0;i=500&&this.data.skip(16),r.volume=ae.readSInt8(this.data),r.balance=ae.readSInt8(this.data);let i=ae.readSInt8(this.data),n=ae.readSInt8(this.data),s=ae.readSInt8(this.data),a=ae.readSInt8(this.data);if(this._versionNumber>=500&&(r.tempoName=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),r.tempo=ae.readInt32LE(this.data),r.volume>=0&&this.data.readByte(),r.balance>=0&&this.data.readByte(),i>=0&&this.data.readByte(),n>=0&&this.data.readByte(),s>=0&&this.data.readByte(),a>=0&&this.data.readByte(),r.tempo>=0&&(r.duration=ae.readSInt8(this.data),this._versionNumber>=510&&this.data.readByte()),this._versionNumber>=400&&this.data.readByte(),this._versionNumber>=500&&this.data.readByte(),this._versionNumber>=510&&(Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),r.volume>=0){let o=new Ei;o.isLinear=!0,o.type=ai.Volume,o.value=r.volume,e.automations.push(o)}if(r.balance>=0){let o=new Ei;o.isLinear=!0,o.type=ai.Balance,o.value=r.balance,e.automations.push(o)}if(r.instrument>=0){let o=new Ei;o.isLinear=!0,o.type=ai.Instrument,o.value=r.instrument,e.automations.push(o)}if(r.tempo>=0){let o=new Ei;o.isLinear=!0,o.type=ai.Tempo,o.value=r.tempo,e.automations.push(o),e.voice.bar.masterBar.tempoAutomation=o}}readNote(e,r,i,n,s){let a=new kr;a.string=r.staff.tuning.length-s;let o=this.data.readByte();if(o&2?a.accentuated=jr.Heavy:o&64&&(a.accentuated=jr.Normal),a.isGhost=(o&4)!==0,o&32){let c=this.data.readByte();c===3?a.isDead=!0:c===2&&(a.isTieDestination=!0)}if(o&1&&this._versionNumber<500&&(this.data.readByte(),this.data.readByte()),o&16){let c=ae.readSInt8(this.data);a.dynamics=this.toDynamicValue(c),n.dynamics=a.dynamics}o&32&&(a.fret=ae.readSInt8(this.data)),o&128&&(a.leftHandFinger=ae.readSInt8(this.data),a.rightHandFinger=ae.readSInt8(this.data),a.isFingering=!0);let l=!1;if(this._versionNumber>=500&&(o&1&&(a.durationPercent=Rt.gpReadDouble(this.data)),l=(this.data.readByte()&2)!==0),n.addNote(a),o&8&&this.readNoteEffects(e,i,n,a),r.staff.isPercussion&&(a.percussionArticulation=a.fret,a.string=-1,a.fret=-1),l){const c=ye.defaultAccidentals[a.realValueWithoutHarmonic%12];c==="#"?a.accidentalMode=Or.ForceFlat:c==="b"&&(a.accidentalMode=Or.ForceSharp)}return a}toDynamicValue(e){switch(e){case 1:return yt.PPP;case 2:return yt.PP;case 3:return yt.P;case 4:return yt.MP;case 5:return yt.MF;case 6:return yt.F;case 7:return yt.FF;case 8:return yt.FFF;default:return yt.F}}readNoteEffects(e,r,i,n){let s=this.data.readByte(),a=0;this._versionNumber>=400&&(a=this.data.readByte()),s&1&&this.readBend(n),s&16&&this.readGrace(r,n),a&4&&this.readTremoloPicking(i),a&8?this.readSlide(n):this._versionNumber<400&&s&4&&(n.slideOutType=ut.Shift),a&16&&this.readArtificialHarmonic(n),a&32&&this.readTrill(n),n.isLetRing=(s&8)!==0,n.isHammerPullOrigin=(s&2)!==0,a&64&&(n.vibrato=Dt.Slight),n.isPalmMute=(a&2)!==0,n.isStaccato=(a&1)!==0}readBend(e){this.data.readByte(),ae.readInt32LE(this.data);let r=ae.readInt32LE(this.data);if(r>0)for(let i=0;i=500){let r=ae.readSInt8(this.data);r&1?e.slideOutType=ut.Shift:r&2?e.slideOutType=ut.Legato:r&4?e.slideOutType=ut.OutDown:r&8&&(e.slideOutType=ut.OutUp),r&16?e.slideInType=pi.IntoFromBelow:r&32&&(e.slideInType=pi.IntoFromAbove)}else switch(ae.readSInt8(this.data)){case 1:e.slideOutType=ut.Shift;break;case 2:e.slideOutType=ut.Legato;break;case 3:e.slideOutType=ut.OutDown;break;case 4:e.slideOutType=ut.OutUp;break;case-1:e.slideInType=pi.IntoFromBelow;break;case-2:e.slideInType=pi.IntoFromAbove;break}}readArtificialHarmonic(e){let r=this.data.readByte();if(this._versionNumber>=500)switch(r){case 1:e.harmonicType=Xe.Natural,e.harmonicValue=this.deltaFretToHarmonicValue(e.fret);break;case 2:this.data.readByte(),this.data.readByte(),this.data.readByte(),e.harmonicType=Xe.Artificial;break;case 3:e.harmonicType=Xe.Tap,e.harmonicValue=this.deltaFretToHarmonicValue(this.data.readByte());break;case 4:e.harmonicType=Xe.Pinch,e.harmonicValue=12;break;case 5:e.harmonicType=Xe.Semi,e.harmonicValue=12;break}else if(this._versionNumber>=400)switch(r){case 1:e.harmonicType=Xe.Natural;break;case 3:e.harmonicType=Xe.Tap;break;case 4:e.harmonicType=Xe.Pinch;break;case 5:e.harmonicType=Xe.Semi;break;case 15:e.harmonicType=Xe.Artificial;break;case 17:e.harmonicType=Xe.Artificial;break;case 22:e.harmonicType=Xe.Artificial;break}}deltaFretToHarmonicValue(e){switch(e){case 2:return 2.4;case 3:return 3.2;case 4:case 5:case 7:case 9:case 12:case 16:case 17:case 19:case 24:return e;case 8:return 8.2;case 10:return 9.6;case 14:case 15:return 14.7;case 21:case 22:return 21.7;default:return 12}}readTrill(e){switch(e.trillValue=this.data.readByte()+e.stringTuning,this.data.readByte()){case 1:e.trillSpeed=H.Sixteenth;break;case 2:e.trillSpeed=H.ThirtySecond;break;case 3:e.trillSpeed=H.SixtyFourth;break}}}da.VersionString="FICHIER GUITAR PRO ";da.BendStep=25;class Rt{static gpReadDouble(e){let r=new Uint8Array(8);return e.read(r,0,r.length),new Float64Array(r.buffer)[0]}static gpReadFloat(e){let r=new Uint8Array(4);return r[3]=e.readByte(),r[2]=e.readByte(),r[2]=e.readByte(),r[1]=e.readByte(),new Float32Array(r.buffer)[0]}static gpReadColor(e,r=!1){let i=e.readByte(),n=e.readByte(),s=e.readByte(),a=255;return r?a=e.readByte():e.skip(1),new Yt(i,n,s,a)}static gpReadBool(e){return e.readByte()!==0}static gpReadStringIntUnused(e,r){return e.skip(4),Rt.gpReadString(e,e.readByte(),r)}static gpReadStringInt(e,r){return Rt.gpReadString(e,ae.readInt32LE(e),r)}static gpReadStringIntByte(e,r){let i=ae.readInt32LE(e)-1;return e.readByte(),Rt.gpReadString(e,i,r)}static gpReadString(e,r,i){let n=new Uint8Array(r);return e.read(n,0,n.length),ae.toString(n,i)}static gpWriteString(e,r){const i=ae.stringToBytes(r);e.writeByte(r.length),e.write(i,0,i.length)}static gpReadStringByteLength(e,r,i){let n=e.readByte(),s=Rt.gpReadString(e,n,i);return n",e,r)}break;case it.WaitEndRet:switch(n){case Ve.CharCodeGreaterThan:return r;default:throw new an("Expected >",e,r)}case it.Close:if(!Ve.isValidChar(n)){if(o===r)throw new an("Expected node name",e,r);if(e.substr(o,r-o)!==i.localName)throw new an("Expected ",e,r);s=it.IgnoreSpaces,a=it.WaitEndRet;continue}break;case it.Comment:n===Ve.CharCodeMinus&&e.charCodeAt(r+1)===Ve.CharCodeMinus&&e.charCodeAt(r+2)===Ve.CharCodeGreaterThan&&(r+=2,s=it.Begin);break;case it.Doctype:if(n===Ve.CharCodeBrackedOpen)h++;else if(n===Ve.CharCodeBrackedClose)h--;else if(n===Ve.CharCodeGreaterThan&&h===0){let f=new Ws;f.nodeType=ue.DocumentType,f.value=e.substr(o,r-o),i.addChild(f),s=it.Begin}break;case it.Header:n===Ve.CharCodeQuestion&&e.charCodeAt(r+1)===Ve.CharCodeGreaterThan&&(r++,s=it.Begin);break;case it.Escape:if(n===Ve.CharCodeSemi){let f=e.substr(o,r-o);if(f.charCodeAt(0)===Ve.CharCodeSharp){let m=f.charCodeAt(1)===Ve.CharCodeLowerX?parseInt("0"+f.substr(1,f.length-1)):parseInt(f.substr(1,f.length-1));l+=String.fromCharCode(m)}else Ve.Escapes.has(f)?l+=Ve.Escapes.get(f):l+=("&"+f+";").toString();o=r+1,s=c}else!Ve.isValidChar(n)&&n!==Ve.CharCodeSharp&&(l+="&",l+=e.substr(o,r-o),r--,o=r+1,s=c);break}r++}if(s===it.Begin&&(o=r,s=it.Pcdata),s===it.Pcdata){if(r!==o){l+=e.substr(o,r-o);let f=new Ws;f.nodeType=ue.Text,f.value=l,i.addChild(f)}return r}if(s===it.Escape&&c===it.Pcdata){l+="&",l+=e.substr(o,r-o);let f=new Ws;return f.nodeType=ue.Text,f.value=l,i.addChild(f),r}throw new an("Unexpected end",e,r)}static isValidChar(e){return e>=Ve.CharCodeLowerA&&e<=Ve.CharCodeLowerZ||e>=Ve.CharCodeUpperA&&e<=Ve.CharCodeUpperZ||e>=Ve.CharCode0&&e<=Ve.CharCode9||e===Ve.CharCodeColon||e===Ve.CharCodeDot||e===Ve.CharCodeUnderscore||e===Ve.CharCodeMinus}}Ve.CharCodeLF=10;Ve.CharCodeTab=9;Ve.CharCodeCR=13;Ve.CharCodeSpace=32;Ve.CharCodeLowerThan=60;Ve.CharCodeAmp=38;Ve.CharCodeBrackedClose=93;Ve.CharCodeBrackedOpen=91;Ve.CharCodeGreaterThan=62;Ve.CharCodeExclamation=33;Ve.CharCodeUpperD=68;Ve.CharCodeLowerD=100;Ve.CharCodeMinus=45;Ve.CharCodeQuestion=63;Ve.CharCodeSlash=47;Ve.CharCodeEquals=61;Ve.CharCodeDoubleQuote=34;Ve.CharCodeSingleQuote=39;Ve.CharCodeSharp=35;Ve.CharCodeLowerX=120;Ve.CharCodeLowerA=97;Ve.CharCodeLowerZ=122;Ve.CharCodeUpperA=65;Ve.CharCodeUpperZ=90;Ve.CharCode0=48;Ve.CharCode9=57;Ve.CharCodeColon=58;Ve.CharCodeDot=46;Ve.CharCodeUnderscore=95;Ve.CharCodeSemi=59;Ve.Escapes=new Map([["lt","<"],["gt",">"],["amp","&"],["quot",'"'],["apos","'"]]);class LS{static write(e,r,i){const n=new LS(r,i);return n.writeNode(e),n.toString()}constructor(e,r){this._result=[],this._indention=e,this._xmlHeader=r,this._currentIndention="",this._isStartOfLine=!0}writeNode(e){switch(e.nodeType){case ue.None:break;case ue.Element:this._result.length>0&&this.writeLine(),this.write(`<${e.localName}`);for(const[r,i]of e.attributes)this.write(` ${r}="`),this.writeAttributeValue(i),this.write('"');if(e.childNodes.length===0)this.write("/>");else{if(this.write(">"),e.childNodes.length===1&&!e.firstElement)this.writeNode(e.childNodes[0]);else{this.indent();for(const r of e.childNodes)r.nodeType===ue.Element&&this.writeNode(r);this.unindend(),this.writeLine()}this.write(``)}break;case ue.Text:e.value&&this.write(e.value);break;case ue.CDATA:e.value!==null&&this.write(``);break;case ue.Document:this._xmlHeader&&this.write('');for(const r of e.childNodes)this.writeNode(r);break;case ue.DocumentType:this.write(``);break}}unindend(){this._currentIndention=this._currentIndention.substr(0,this._currentIndention.length-this._indention.length)}indent(){this._currentIndention+=this._indention}writeAttributeValue(e){for(let r=0;r":this._result.push(">");break;case"&":this._result.push("&");break;case"'":this._result.push("'");break;case'"':this._result.push(""");break;default:this._result.push(i);break}}}write(e){this._isStartOfLine&&this._result.push(this._currentIndention),this._result.push(e),this._isStartOfLine=!1}writeLine(e=null){e&&this.write(e),this._indention.length>0&&!this._isStartOfLine&&(this._result.push(` -`),this._isStartOfLine=!0)}toString(){return this._result.join("").trimRight()}}class FS extends Ws{constructor(){super(),this.nodeType=ue.Document}parse(e){Ve.parse(e,0,this)}toString(){return this.toFormattedString()}toFormattedString(e="",r=!1){return LS.write(this,e,r)}}var ve;(function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"})(ve||(ve={}));class AQ{constructor(){this.id="",this.dots=0,this.tupletDenominator=-1,this.tupletNumerator=-1,this.value=H.Quarter}}class VQ{constructor(){this.name="",this.path="",this.role="",this.program=0}get uniqueId(){return this.path+";"+this.name+";"+this.role}}class ds{constructor(){this._hasAnacrusis=!1,this._skipApplyLyrics=!1}parseXml(e,r){this._masterTrackAutomations=new Map,this._automationsPerTrackIdAndBarIndex=new Map,this._tracksMapping=[],this._tracksById=new Map,this._masterBars=[],this._barsOfMasterBar=[],this._voicesOfBar=new Map,this._barsById=new Map,this._voiceById=new Map,this._beatsOfVoice=new Map,this._beatById=new Map,this._rhythmOfBeat=new Map,this._rhythmById=new Map,this._notesOfBeat=new Map,this._noteById=new Map,this._tappedNotes=new Map,this._lyricsByTrack=new Map,this._soundsByTrack=new Map,this._skipApplyLyrics=!1;let i=new FS;try{i.parse(e)}catch(n){throw new Gr("Could not parse XML",n)}if(this.parseDom(i),this.buildModel(),this.score.finish(r),!this._skipApplyLyrics&&this._lyricsByTrack.size>0)for(const[n,s]of this._lyricsByTrack)this._tracksById.get(n).applyLyrics(s)}parseDom(e){let r=e.firstElement;if(r)if(r.localName==="GPIF"){this.score=new Ql;for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Score":this.parseScoreNode(i);break;case"MasterTrack":this.parseMasterTrackNode(i);break;case"Tracks":this.parseTracksNode(i);break;case"MasterBars":this.parseMasterBarsNode(i);break;case"Bars":this.parseBars(i);break;case"Voices":this.parseVoices(i);break;case"Beats":this.parseBeats(i);break;case"Notes":this.parseNotes(i);break;case"Rhythms":this.parseRhythms(i);break}}else throw new Gr("Root node of XML was not GPIF")}parseScoreNode(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"Title":this.score.title=r.firstChild.innerText;break;case"SubTitle":this.score.subTitle=r.firstChild.innerText;break;case"Artist":this.score.artist=r.firstChild.innerText;break;case"Album":this.score.album=r.firstChild.innerText;break;case"Words":this.score.words=r.firstChild.innerText;break;case"Music":this.score.music=r.firstChild.innerText;break;case"WordsAndMusic":if(r.firstChild&&r.firstChild.innerText!==""){let i=r.firstChild.innerText;i&&!this.score.words&&(this.score.words=i),i&&!this.score.music&&(this.score.music=i)}break;case"Copyright":this.score.copyright=r.firstChild.innerText;break;case"Tabber":this.score.tab=r.firstChild.innerText;break;case"Instructions":this.score.instructions=r.firstChild.innerText;break;case"Notices":this.score.notices=r.firstChild.innerText;break;case"ScoreSystemsDefaultLayout":this.score.defaultSystemsLayout=parseInt(r.innerText);break;case"ScoreSystemsLayout":this.score.systemsLayout=r.innerText.split(" ").map(i=>parseInt(i));break}}parseMasterTrackNode(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"Automations":this.parseAutomations(r,this._masterTrackAutomations,null);break;case"Tracks":this._tracksMapping=r.innerText.split(" ");break;case"Anacrusis":this._hasAnacrusis=!0;break}}parseAutomations(e,r,i){for(let n of e.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"Automation":this.parseAutomation(n,r,i);break}}parseAutomation(e,r,i){let n=null,s=!1,a=-1,o=0,l=0,c=null,u=0,d=null;for(let p of e.childNodes)if(p.nodeType===ue.Element)switch(p.localName){case"Type":n=p.innerText;break;case"Linear":s=p.innerText.toLowerCase()==="true";break;case"Bar":a=parseInt(p.innerText);break;case"Position":o=parseFloat(p.innerText);break;case"Value":if(p.firstElement&&p.firstElement.nodeType===ue.CDATA)c=p.innerText;else{let f=p.innerText.split(" ");f.length===1?(l=parseFloat(f[0]),u=1):(l=parseFloat(f[0]),u=parseInt(f[1]))}break;case"Text":d=p.innerText;break}if(!n)return;let h=null;switch(n){case"Tempo":h=Ei.buildTempoAutomation(s,o,l,u);break;case"Sound":c&&i&&i.has(c)&&(h=Ei.buildInstrumentAutomation(s,o,i.get(c).program));break}h&&(d&&(h.text=d),a>=0&&(r.has(a)||r.set(a,[]),r.get(a).push(h)))}parseTracksNode(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"Track":this.parseTrack(r);break}}parseTrack(e){this._articulationByName=new Map;let r=new _a;r.ensureStaveCount(1);let i=r.staves[0];i.showStandardNotation=!0;let n=e.getAttribute("id");for(let s of e.childNodes)if(s.nodeType===ue.Element)switch(s.localName){case"Name":r.name=s.innerText;break;case"Color":let a=s.innerText.split(" ");if(a.length>=3){let c=parseInt(a[0]),u=parseInt(a[1]),d=parseInt(a[2]);r.color=new Yt(c,u,d,255)}break;case"Instrument":let o=s.getAttribute("ref");(o.endsWith("-gs")||o.endsWith("GrandStaff"))&&(r.ensureStaveCount(2),r.staves[1].showStandardNotation=!0);break;case"InstrumentSet":this.parseInstrumentSet(r,s);break;case"NotationPatch":this.parseNotationPatch(r,s);break;case"ShortName":r.shortName=s.innerText;break;case"SystemsDefautLayout":r.defaultSystemsLayout=parseInt(s.innerText);break;case"SystemsLayout":r.systemsLayout=s.innerText.split(" ").map(c=>parseInt(c));break;case"Lyrics":this.parseLyrics(n,s);break;case"Properties":this.parseTrackProperties(r,s);break;case"GeneralMidi":case"MidiConnection":case"MIDISettings":this.parseGeneralMidi(r,s);break;case"Sounds":this.parseSounds(n,r,s);break;case"PlaybackState":let l=s.innerText;r.playbackInfo.isSolo=l==="Solo",r.playbackInfo.isMute=l==="Mute";break;case"PartSounding":this.parsePartSounding(r,s);break;case"Staves":this.parseStaves(r,s);break;case"Transpose":this.parseTranspose(r,s);break;case"RSE":this.parseRSE(r,s);break;case"Automations":this.parseTrackAutomations(n,s);break}this._tracksById.set(n,r)}parseTrackAutomations(e,r){const i=new Map;this._automationsPerTrackIdAndBarIndex.set(e,i),this.parseAutomations(r,i,this._soundsByTrack.get(e))}parseNotationPatch(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"LineCount":const n=parseInt(i.innerText);for(let s of e.staves)s.standardNotationLineCount=n;break;case"Elements":this.parseElements(e,i);break}}parseInstrumentSet(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Type":switch(i.innerText){case"drumKit":for(let s of e.staves)s.isPercussion=!0;break}if(i.innerText==="drumKit")for(let s of e.staves)s.isPercussion=!0;break;case"Elements":this.parseElements(e,i);break;case"LineCount":const n=parseInt(i.innerText);for(let s of e.staves)s.standardNotationLineCount=n;break}}parseElements(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Element":this.parseElement(e,i);break}}parseElement(e,r){const i=r.findChildElement("Type"),n=i?i.innerText:"";for(let s of r.childNodes)if(s.nodeType===ue.Element)switch(s.localName){case"Name":case"Articulations":this.parseArticulations(e,s,n);break}}parseArticulations(e,r,i){for(let n of r.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"Articulation":this.parseArticulation(e,n,i);break}}parseArticulation(e,r,i){const n=new Le;n.outputMidiNumber=-1,n.elementType=i;let s="";for(let a of r.childNodes)if(a.nodeType===ue.Element){const o=a.innerText;switch(a.localName){case"Name":s=a.innerText;break;case"OutputMidiNumber":o.length>0&&(n.outputMidiNumber=parseInt(o));break;case"TechniqueSymbol":n.techniqueSymbol=this.parseTechniqueSymbol(o);break;case"TechniquePlacement":switch(o){case"outside":n.techniqueSymbolPlacement=ft.Bottom;break;case"inside":n.techniqueSymbolPlacement=ft.Middle;break;case"above":n.techniqueSymbolPlacement=ft.Bottom;break;case"below":n.techniqueSymbolPlacement=ft.Top;break}break;case"Noteheads":const l=o.split(" ");l.length>=1&&(n.noteHeadDefault=this.parseNoteHead(l[0])),l.length>=2&&(n.noteHeadHalf=this.parseNoteHead(l[1])),l.length>=3&&(n.noteHeadWhole=this.parseNoteHead(l[2])),n.noteHeadHalf==B.None&&(n.noteHeadHalf=n.noteHeadDefault),n.noteHeadWhole==B.None&&(n.noteHeadWhole=n.noteHeadDefault);break;case"StaffLine":o.length>0&&(n.staffLine=parseInt(o));break}}n.outputMidiNumber!==-1?(e.percussionArticulations.push(n),s.length>0&&this._articulationByName.set(s,n)):s.length>0&&this._articulationByName.has(s)&&(this._articulationByName.get(s).staffLine=n.staffLine)}parseTechniqueSymbol(e){switch(e){case"pictEdgeOfCymbal":return B.PictEdgeOfCymbal;case"articStaccatoAbove":return B.ArticStaccatoAbove;case"noteheadParenthesis":return B.NoteheadParenthesis;case"stringsUpBow":return B.StringsUpBow;case"stringsDownBow":return B.StringsDownBow;case"guitarGolpe":return B.GuitarGolpe;default:return B.None}}parseNoteHead(e){switch(e){case"noteheadDoubleWholeSquare":return B.NoteheadDoubleWholeSquare;case"noteheadDoubleWhole":return B.NoteheadDoubleWhole;case"noteheadWhole":return B.NoteheadWhole;case"noteheadHalf":return B.NoteheadHalf;case"noteheadBlack":return B.NoteheadBlack;case"noteheadNull":return B.NoteheadNull;case"noteheadXOrnate":return B.NoteheadXOrnate;case"noteheadTriangleUpWhole":return B.NoteheadTriangleUpWhole;case"noteheadTriangleUpHalf":return B.NoteheadTriangleUpHalf;case"noteheadTriangleUpBlack":return B.NoteheadTriangleUpBlack;case"noteheadDiamondBlackWide":return B.NoteheadDiamondBlackWide;case"noteheadDiamondWhite":return B.NoteheadDiamondWhite;case"noteheadDiamondWhiteWide":return B.NoteheadDiamondWhiteWide;case"noteheadCircleX":return B.NoteheadCircleX;case"noteheadXWhole":return B.NoteheadXWhole;case"noteheadXHalf":return B.NoteheadXHalf;case"noteheadXBlack":return B.NoteheadXBlack;case"noteheadParenthesis":return B.NoteheadParenthesis;case"noteheadSlashedBlack2":return B.NoteheadSlashedBlack2;case"noteheadCircleSlash":return B.NoteheadCircleSlash;case"noteheadHeavyX":return B.NoteheadHeavyX;case"noteheadHeavyXHat":return B.NoteheadHeavyXHat;default:return de.warning("GPIF","Unknown notehead symbol",e),B.None}}parseStaves(e,r){let i=0;for(let n of r.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"Staff":e.ensureStaveCount(i+1);let s=e.staves[i];this.parseStaff(s,n),i++;break}}parseStaff(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Properties":this.parseStaffProperties(e,i);break}}parseStaffProperties(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Property":this.parseStaffProperty(e,i);break}}parseStaffProperty(e,r){switch(r.getAttribute("name")){case"Tuning":for(let s of r.childNodes)if(s.nodeType===ue.Element)switch(s.localName){case"Pitches":let a=r.findChildElement("Pitches").innerText.split(" "),o=new Array(a.length);for(let l=0;l=12&&(e.playbackInfo.balance=Math.floor(parseFloat(i[11])*16),e.playbackInfo.volume=Math.floor(parseFloat(i[12])*16))}}parseMasterBarsNode(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"MasterBar":this.parseMasterBar(r);break}}parseMasterBar(e){let r=new eo;this._masterBars.length===0&&this._hasAnacrusis&&(r.isAnacrusis=!0);for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"Time":let n=i.innerText.split("/");r.timeSignatureNumerator=parseInt(n[0]),r.timeSignatureDenominator=parseInt(n[1]);break;case"DoubleBar":r.isDoubleBar=!0;break;case"Section":r.section=new iy,r.section.marker=i.findChildElement("Letter").innerText,r.section.text=i.findChildElement("Text").innerText;break;case"Repeat":i.getAttribute("start").toLowerCase()==="true"&&(r.isRepeatStart=!0),i.getAttribute("end").toLowerCase()==="true"&&i.getAttribute("count")&&(r.repeatCount=parseInt(i.getAttribute("count")));break;case"AlternateEndings":let s=i.innerText.split(" "),a=0;for(let l=0;l0&&s0&&o.voices[0].beats.length>0){const l=o.voices[0].beats[0];for(const c of a)l.automations.push(c)}}}}for(const[e,r]of this._masterTrackAutomations){let i=this.score.masterBars[e];for(let n=0,s=r.length;n0){let r=0;for(let i of this.scoreViews[0].trackViewGroups){if(r32)throw new Wr("Invalid huffman");for(let c=0;c=n)throw new Wr("Invalid huffman");s[u]++}let o=0;for(let c=1;cr)throw new Wr("Invalid huffman");let s=i<<5|n;return e.has(s)?new vp(e.get(s)):(i=i<<1,n+=1,new hl(Si.treeMake(e,r,i,n),Si.treeMake(e,r,i|1,n)))}static treeCompress(e){let r=Si.treeDepth(e);if(r===0)return e;if(r===1){if(e instanceof hl)return new hl(Si.treeCompress(e.left),Si.treeCompress(e.right));throw new Wr("assert")}let i=1<0?(Si.treeWalk(e,r,i+1,n-1,s.left),Si.treeWalk(e,r|1<Vs.BufferSize&&this.slide(),this.buffer.set(e.subarray(r,r+i),this.pos),this.pos+=i}addByte(e){this.pos===Vs.BufferSize&&this.slide(),this.buffer[this.pos]=e,this.pos++}getLastChar(){return this.buffer[this.pos-1]}available(){return this.pos}}Vs.Size=32768;Vs.BufferSize=65536;class Ui{static buildFixedHuffman(){let e=[];for(let r=0;r<288;r++)e.push(r<=143?8:r<=255?9:r<=279?7:8);return Si.make(e,0,288,10)}constructor(e){this._nbits=0,this._bits=0,this._state=Fr.Block,this._isFinal=!1,this._huffman=Ui._fixedHuffman,this._huffdist=null,this._len=0,this._dist=0,this._needed=0,this._output=null,this._outpos=0,this._lengths=[],this._window=new Vs,this._input=e;for(let r=0;r<19;r++)this._lengths.push(-1)}readBytes(e,r,i){if(this._needed=i,this._outpos=r,this._output=e,i>0)for(;this.inflateLoop(););return i-this._needed}inflateLoop(){switch(this._state){case Fr.Head:let e=this._input.readByte();if((e&15)!==8)throw new Wr("Invalid data");let i=this._input.readByte(),n=(i&32)!==0;if(((e<<8)+i)%31!==0)throw new Wr("Invalid data");if(n)throw new Wr("Unsupported dictionary");return this._state=Fr.Block,!0;case Fr.Crc:return this._state=Fr.Done,!0;case Fr.Done:return!1;case Fr.Block:switch(this._isFinal=this.getBit(),this.getBits(2)){case 0:if(this._len=ae.readUInt16LE(this._input),ae.readUInt16LE(this._input)!==65535-this._len)throw new Wr("Invalid data");this._state=Fr.Flat;let o=this.inflateLoop();return this.resetBits(),o;case 1:return this._huffman=Ui._fixedHuffman,this._huffdist=null,this._state=Fr.CData,!0;case 2:let l=this.getBits(5)+257,c=this.getBits(5)+1,u=this.getBits(4)+4;for(let h=0;h0}case Fr.DistOne:{let a=this._len0}case Fr.Dist:for(;this._len>0&&this._needed>0;){let a=this._len0;case Fr.CData:let s=this.applyHuffman(this._huffman);if(s<256)return this.addByte(s),this._needed>0;if(s===256)return this._state=this._isFinal?Fr.Crc:Fr.Block,!0;{s=s-257&255;let a=Ui.LenExtraBitsTbl[s];if(a===-1)throw new Wr("Invalid data");this._len=Ui.LenBaseValTbl[s]+this.getBits(a);let o=this._huffdist,l=o?this.applyHuffman(o):this.getRevBits(5);if(a=Ui.DistExtraBitsTbl[l],a===-1)throw new Wr("Invalid data");if(this._dist=Ui.DistBaseValTbl[l]+this.getBits(a),this._dist>this._window.available())throw new Wr("Invalid data");return this._state=this._dist===1?Fr.DistOne:Fr.Dist,!0}}return!1}addDistOne(e){let r=this._window.getLastChar();for(let i=0;i>1,e}getBits(e){for(;this._nbits>e,r}getRevBits(e){return e===0?0:this.getBit()?1<r)throw new Wr("Invalid data");for(;ir)throw new Wr("Invalid data");break;case 18:if(i+=11+this.getBits(7),i>r)throw new Wr("Invalid data");break;default:throw new Wr("Invalid data")}}}applyHuffman(e){if(e instanceof vp)return e.n;if(e instanceof hl)return this.applyHuffman(this.getBit()?e.right:e.left);if(e instanceof av)return this.applyHuffman(e.table[this.getBits(e.n)]);throw new Wr("Invalid data")}}Ui.LenExtraBitsTbl=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,-1,-1];Ui.LenBaseValTbl=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258];Ui.DistExtraBitsTbl=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,-1,-1];Ui.DistBaseValTbl=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];Ui.CodeLengthsPos=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];Ui._fixedHuffman=Ui.buildFixedHuffman();class Wa{constructor(e,r){this.fullName=e;let i=e.lastIndexOf("/");this.fileName=i===-1||i===e.length-1?this.fullName:e.substr(i+1),this.data=r}}Wa.OptionalDataDescriptorSignature=134695760;Wa.CompressionMethodDeflate=8;Wa.LocalFileHeaderSignature=67324752;Wa.CentralFileHeaderSignature=33639248;Wa.EndOfCentralDirSignature=101010256;class iM{constructor(e){this._readable=e}read(){let e=[];for(;;){let r=this.readEntry();if(!r)break;e.push(r)}return e}readEntry(){let e=this._readable;if(ae.readInt32LE(e)!==Wa.LocalFileHeaderSignature)return null;ae.readUInt16LE(e);let i=ae.readUInt16LE(e),n=ae.readUInt16LE(e),s=n!==0;if(s&&n!==Wa.CompressionMethodDeflate)return null;ae.readInt16LE(this._readable),ae.readInt16LE(this._readable),ae.readInt32LE(e),ae.readInt32LE(e);let a=ae.readInt32LE(e),o=ae.readInt16LE(e),l=ae.readInt16LE(e),c=ae.toString(ae.readByteArray(e,o),"utf-8");e.skip(l);let u;if(s){let d=Di.empty(),h=new Ui(this._readable),p=new Uint8Array(65536);for(;;){let f=h.readBytes(p,0,p.length);if(d.write(p,0,f),f=0;)r=r|this.readBit()<=8){if(this._currentByte=this._source.readByte(),this._currentByte===-1)throw new gh;this._position=0}const e=this._currentByte>>yh.ByteSize-this._position-1&1;return this._position++,e}readAll(){let e=Di.empty();try{for(;;)e.writeByte(this.readByte()&255)}catch(r){if(!(r instanceof gh))throw r}return e.toArray()}}yh.ByteSize=8;class zQ{constructor(){this.fileName="",this.fileSize=0,this.data=null}}class Pu{constructor(){this.files=[],this.files=[],this.fileFilter=e=>!0}load(e){let r=new yh(e);this.readBlock(r)}readHeader(e){return this.getString(e.readBytes(4),0,4)}decompress(e,r=!1){let i=Di.empty(),n,s=this.getInteger(e.readBytes(4),0);try{for(;i.lengtho.endsWith("score.gpif")||o.endsWith("BinaryStylesheet")||o.endsWith("PartConfiguration"),e.load(this.data),de.debug(this.name,"GPX filesystem loaded");let r=null,i=null,n=null;for(let o of e.files)switch(o.fileName){case"score.gpif":r=ae.toString(o.data,this.settings.importer.encoding);break;case"BinaryStylesheet":i=o.data;break;case"PartConfiguration":n=o.data;break}if(!r)throw new Gr("No score.gpif found in GPX");de.debug(this.name,"Start Parsing score.gpif");let s=new ds;s.parseXml(r,this.settings),de.debug(this.name,"score.gpif parsed");let a=s.score;return i&&(de.debug(this.name,"Start Parsing BinaryStylesheet"),new ny(i).apply(a),de.debug(this.name,"BinaryStylesheet parsed")),n&&(de.debug(this.name,"Start Parsing Part Configuration"),new rM(n).apply(a),de.debug(this.name,"Part Configuration parsed")),a}}class HQ extends Bu{get name(){return"MusicXML"}constructor(){super(),this._currentPartGroup=null,this._trackFirstMeasureNumber=0,this._maxVoices=0,this._currentDirection=null,this._currentChord=null,this._divisionsPerQuarterNote=0,this._voiceOfStaff=new Map,this._isBeamContinue=!1,this._previousBeatWasPulled=!1,this._previousBeat=null}readScore(){this._trackById=new Map,this._partGroups=new Map,this._tieStarts=[],this._tieStartIds=new Map,this._slurStarts=new Map;let e=ae.toString(this.data.readAll(),this.settings.importer.encoding),r=new FS;try{r.parse(e)}catch{throw new Gr("Unsupported format")}return this._score=new Ql,this._score.tempo=120,this.parseDom(r),this.settings.importer.mergePartGroupsInMusicXml&&this.mergePartGroups(),this._score.finish(this.settings),this._score.rebuildRepeatGroups(),this._score}mergePartGroups(){let e=!1;for(const r of this._partGroups.values())r.length>1&&(this.mergeGroup(r),e=!0);if(e)for(let r=0;r0){let c=l[0].getElementsByTagName("staves",!1);if(c.length>0){let u=parseInt(c[0].innerText);r.ensureStaveCount(u)}}}let s=new Array(r.staves.length),a=null;for(let l=r.staves[0].bars.length;l<=n;l++)for(let c=0;c0){let d=r.staves[c].bars[r.staves[c].bars.length-1];u.clef=d.clef}a=this.getOrCreateMasterBar(n),r.staves[c].addBar(u),this.ensureVoices(u)}let o=new Map;if(a){let l=!1;for(let c of e.childNodes)if(c.nodeType===ue.Element)switch(c.localName){case"note":this.parseNoteBeat(c,s);break;case"forward":this.parseForward(c,s);break;case"direction":this.parseDirection(c,a);break;case"attributes":l||(this.parseAttributes(c,s,a,r),l=!0);break;case"harmony":this.parseHarmony(c,r,o);break;case"sound":break;case"barline":this.parseBarline(c,a);break}}return!0}ensureVoices(e){for(;e.voices.length0&&(n=parseInt(s[0].innerText)-1);let a=this._previousBeatWasPulled;this._previousBeatWasPulled=!1;let o=e.getElementsByTagName("staff",!1),l=1;if(o.length>0){l=parseInt(o[0].innerText),(this._isBeamContinue||a)&&this._previousBeat.voice.bar.staff.index!==l-1&&(l=this._previousBeat.voice.bar.staff.index+1,this._previousBeatWasPulled=!0);let h=r[0].staff.track.index+"-"+l;this._voiceOfStaff.has(h)||this._voiceOfStaff.set(h,n)}l--;let c;l<0?c=r[0]:l>=r.length?c=r[r.length-1]:c=r[l];let u,d=this.getOrCreateVoice(c,n);return i&&d.beats.length>0||d.beats.length===1&&d.isEmpty?u=d.beats[d.beats.length-1]:(u=new Mi,u.isEmpty=!1,d.addBeat(u)),this._isBeamContinue=!1,this._previousBeat=u,u}parseForward(e,r){let i=this.getOrCreateBeat(e,r,!1),s=parseInt(e.findChildElement("duration").innerText)*H.Quarter/this._divisionsPerQuarterNote,a=[H.SixtyFourth,H.ThirtySecond,H.Sixteenth,H.Eighth,H.Quarter,H.Half,H.Whole];for(let o of a)if(s>=o){i.duration=o,s-=o;break}i.isEmpty=!1}parseStaffDetails(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"staff-lines":for(let n of r.staves)n.stringTuning.tunings=new Array(parseInt(i.innerText)).fill(0);break;case"staff-tuning":this.parseStaffTuning(i,r);break}for(let i of r.staves)this.isEmptyTuning(i.tuning)&&(i.stringTuning.tunings=[])}parseStaffTuning(e,r){let i=parseInt(e.getAttribute("line")),n="C",s="",a=0;for(let l of e.childNodes)if(l.nodeType===ue.Element)switch(l.localName){case"tuning-step":n=l.innerText;break;case"tuning-alter":a=parseInt(l.innerText);break;case"tuning-octave":s=l.innerText;break}let o=er.getTuningForText(n+s)+a;for(let l of r.staves)l.tuning[l.tuning.length-i]=o}parseHarmony(e,r,i){let n=new Wo;for(let a of e.childNodes)if(a.nodeType===ue.Element)switch(a.localName){case"root":n.name=this.parseHarmonyRoot(a);break;case"kind":n.name=n.name+this.parseHarmonyKind(a);break;case"frame":this.parseHarmonyFrame(a,n);break}this._currentChord=er.newGuid();const s=n.uniqueId;i.has(s)&&(n.showDiagram=!1);for(let a of r.staves)a.addChord(this._currentChord,n);i.set(s,n)}parseHarmonyRoot(e){let r="",i="";for(let n of e.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"root-step":r=n.innerText;break;case"root-alter":switch(parseInt(e.innerText)){case-2:i="bb";break;case-1:i="b";break;case 0:i="";break;case 1:i="#";break;case 2:i="##";break}break}return r+i}parseHarmonyKind(e){const r=e.getAttribute("text");let i="";if(r)i=r;else switch(e.innerText){case"major":i="";break;case"minor":i="m";break;case"augmented":i="+";break;case"diminished":i="○";break;case"dominant":i="7";break;case"major-seventh":i="7M";break;case"minor-seventh":i="m7";break;case"diminished-seventh":i="○7";break;case"augmented-seventh":i="+7";break;case"half-diminished":i="⍉";break;case"major-minor":i="mMaj";break;case"major-sixth":i="maj6";break;case"minor-sixth":i="m6";break;case"dominant-ninth":i="9";break;case"major-ninth":i="maj9";break;case"minor-ninth":i="m9";break;case"dominant-11th":i="11";break;case"major-11th":i="maj11";break;case"minor-11th":i="m11";break;case"dominant-13th":i="13";break;case"major-13th":i="maj13";break;case"minor-13th":i="m13";break;case"suspended-second":i="sus2";break;case"suspended-fourth":i="sus4";break}return i}parseHarmonyFrame(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"frame-strings":const n=parseInt(i.innerText);r.strings=new Array(n);for(let o=0;o=0&&(r.strings[s-1]=a);break;case"barre":s&&a&&o.getAttribute("type")==="start"&&r.barreFrets.push(a);break}break}}parseBarline(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"repeat":this.parseRepeat(i,r);break;case"ending":this.parseEnding(i,r);break}}parseEnding(e,r){let i=parseInt(e.getAttribute("number"));i>0&&(--i,r.alternateEndings=r.alternateEndings|1<0,n=this.getOrCreateBeat(e,r,i);!n.chordId&&this._currentChord&&(n.chordId=this._currentChord,this._currentChord=null),this._currentDirection&&(n.text=this._currentDirection,this._currentDirection=null);let s=new kr;n.voice.isEmpty=!1,n.isEmpty=!1,n.addNote(s),n.dots=0;let a=!1;for(let o of e.childNodes)if(o.nodeType===ue.Element)switch(o.localName){case"grace":n.graceType=Je.BeforeBeat,n.duration=H.ThirtySecond;break;case"duration":if(n.isRest&&!a)switch(parseInt(o.innerText)){case 1:n.duration=H.Whole;break;case 2:n.duration=H.Half;break;case 4:n.duration=H.Quarter;break;case 8:n.duration=H.Eighth;break;case 16:n.duration=H.Sixteenth;break;case 32:n.duration=H.ThirtySecond;break;case 64:n.duration=H.SixtyFourth;break;default:n.duration=H.Quarter;break}break;case"tie":this.parseTied(o,s);break;case"cue":break;case"instrument":break;case"type":n.duration=this.getDuration(o.innerText),n.graceType!==Je.None&&n.duration0&&!r.isTieDestination){const i=this._tieStarts[0];i.beat.voice.index===r.beat.voice.index&&i.beat.voice.bar.staff.index===r.beat.voice.bar.staff.index&&i.beat.voice.bar.staff.track.index===r.beat.voice.bar.staff.track.index&&(r.isTieDestination=!0,r.tieOrigin=this._tieStarts[0]),this._tieStarts.splice(0,1),this._tieStartIds.delete(r.id)}}parseNotations(e,r,i){for(let n of e.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"articulations":this.parseArticulations(n,i);break;case"tied":this.parseTied(n,i);break;case"slide":case"glissando":n.getAttribute("type")==="start"&&(i.slideOutType=ut.Shift);break;case"dynamics":this.parseDynamics(n,r);break;case"technical":this.parseTechnical(n,i);break;case"ornaments":this.parseOrnaments(n,i);break;case"slur":let s=n.getAttribute("number");switch(s||(s="1"),s=r.voice.bar.staff.index+"_"+s,n.getAttribute("type")){case"start":this._slurStarts.set(s,i);break;case"stop":if(this._slurStarts.has(s)){i.isSlurDestination=!0;let a=this._slurStarts.get(s);a.slurDestination=i,i.slurOrigin=a}break}break}}parseOrnaments(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"tremolo":switch(parseInt(i.innerText)){case 1:r.beat.tremoloSpeed=H.Eighth;break;case 2:r.beat.tremoloSpeed=H.Sixteenth;break;case 3:r.beat.tremoloSpeed=H.ThirtySecond;break}break}}parseTechnical(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"string":r.string=parseInt(i.innerText),r.string!==-2147483648&&(r.string=r.beat.voice.bar.staff.tuning.length-r.string+1);break;case"fret":r.fret=parseInt(i.innerText);break;case"down-bow":r.beat.pickStroke=Bi.Down;break;case"up-bow":r.beat.pickStroke=Bi.Up;break}(r.string===-2147483648||r.fret===-2147483648)&&(r.string=-1,r.fret=-1)}parseArticulations(e,r){for(let i of e.childNodes)switch(i.localName){case"accent":r.accentuated=jr.Normal;break;case"strong-accent":r.accentuated=jr.Heavy;break;case"staccato":case"detached-legato":r.isStaccato=!0;break}}parseDynamics(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"p":r.dynamics=yt.P;break;case"pp":r.dynamics=yt.PP;break;case"ppp":r.dynamics=yt.PPP;break;case"f":r.dynamics=yt.F;break;case"ff":r.dynamics=yt.FF;break;case"fff":r.dynamics=yt.FFF;break;case"mp":r.dynamics=yt.MP;break;case"mf":r.dynamics=yt.MF;break}}parseTimeModification(e,r){for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"actual-notes":r.tupletNumerator=parseInt(i.innerText);break;case"normal-notes":r.tupletDenominator=parseInt(i.innerText);break}}parseUnpitched(e,r){let i="",n=0,s=0;for(let o of e.childNodes)if(o.nodeType===ue.Element)switch(o.localName){case"display-step":i=o.innerText;break;case"display-alter":n=parseInt(o.innerText);break;case"display-octave":s=parseInt(o.innerText);break}let a=s*12+er.getToneForText(i)+n;r.octave=a/12|0,r.tone=a-r.octave*12}parsePitch(e,r){let i="",n=0,s=0;for(let o of e.childNodes)if(o.nodeType===ue.Element)switch(o.localName){case"step":i=o.innerText;break;case"alter":n=parseFloat(o.innerText),isNaN(n)&&(n=0);break;case"octave":s=parseInt(o.innerText)+1;break}let a=s*12+er.getToneForText(i)+(n|0);r.octave=a/12|0,r.tone=a-r.octave*12}getOrCreateVoice(e,r){if(r0){let n=this._score.masterBars[this._score.masterBars.length-1];i.timeSignatureDenominator=n.timeSignatureDenominator,i.timeSignatureNumerator=n.timeSignatureNumerator,i.keySignature=n.keySignature,i.keySignatureType=n.keySignatureType}this._score.addMasterBar(i)}return this._score.masterBars[e]}parseIdentification(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"creator":r.getAttribute("type")==="composer"&&(this._score.music=r.innerText);break;case"rights":this._score.copyright&&(this._score.copyright+=` -`),this._score.copyright+=r.innerText;break}}parsePartList(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"part-group":this.parsePartGroup(r);break;case"score-part":this.parseScorePart(r);break}}parsePartGroup(e){switch(e.getAttribute("type")){case"start":this._currentPartGroup=e.getAttribute("number"),this._partGroups.set(this._currentPartGroup,[]);break;case"stop":this._currentPartGroup=null;break}}parseScorePart(e){let r=e.getAttribute("id"),i=new _a;i.ensureStaveCount(1);let n=i.staves[0];n.showStandardNotation=!0,this._trackById.set(r,i),this._score.addTrack(i),this._currentPartGroup&&this._partGroups.get(this._currentPartGroup).push(i);for(let s of e.childNodes)if(s.nodeType===ue.Element)switch(s.localName){case"part-name":i.name=s.innerText;break;case"part-abbreviation":i.shortName=s.innerText;break;case"midi-instrument":this.parseMidiInstrument(s,i);break}this.isEmptyTuning(i.staves[0].tuning)&&(i.staves[0].stringTuning.tunings=[])}isEmptyTuning(e){if(!e)return!0;for(let r=0;r=this.events[this.events.length-1].tick)this.events.push(e);else{let r=this.events.length;for(;r>0&&this.events[r-1].tick>e.tick;)r--;this.events.splice(r,0,e)}}writeTo(e){let r=Di.empty(),i=0;for(let a of this.events){let o=a.tick-i;Fo.writeVariableInt(r,o),a.writeTo(r),i=a.tick}const n=new Uint8Array([77,84,114,107]);e.write(n,0,n.length);let s=r.toArray();ae.writeInt32BE(e,s.length),e.write(s,0,s.length)}}class Fo{constructor(){this.format=cu.SingleTrackMultiChannel,this.division=lt.QuarterTime,this.tracks=[]}get events(){if(this.tracks.length==1)return this.tracks[0].events;{const e=[];for(const r of this.tracks)this.events.push(...r.events);return e.sort((r,i)=>r.tick-i.tick),e}}ensureTracks(e){for(;this.tracks.length>=7;while(r>0);for(;n>0;)n--,n>0?e.writeByte(i[n]|128):e.writeByte(i[n])}}var Bt;(function(t){t[t.TimeSignature=88]="TimeSignature",t[t.NoteOn=128]="NoteOn",t[t.NoteOff=144]="NoteOff",t[t.ControlChange=176]="ControlChange",t[t.ProgramChange=192]="ProgramChange",t[t.TempoChange=81]="TempoChange",t[t.PitchBend=224]="PitchBend",t[t.PerNotePitchBend=96]="PerNotePitchBend",t[t.EndOfTrack=47]="EndOfTrack",t[t.AlphaTabRest=241]="AlphaTabRest",t[t.AlphaTabMetronome=242]="AlphaTabMetronome",t[t.SystemExclusive=240]="SystemExclusive",t[t.SystemExclusive2=247]="SystemExclusive2",t[t.Meta=255]="Meta"})(Bt||(Bt={}));class ao{constructor(e,r,i){this.track=e,this.tick=r,this.type=i}get command(){return this.type}get message(){return 0}get data1(){return 0}get data2(){return 0}}class sM extends ao{constructor(e,r,i,n,s,a){super(e,r,Bt.TimeSignature),this.track=e,this.tick=r,this.numerator=i,this.denominatorIndex=n,this.midiClocksPerMetronomeClick=s,this.thirtySecondNodesInQuarter=a}writeTo(e){e.writeByte(255),e.writeByte(88),Fo.writeVariableInt(e,4),e.writeByte(this.numerator&255),e.writeByte(this.denominatorIndex&255),e.writeByte(this.midiClocksPerMetronomeClick&255),e.writeByte(this.thirtySecondNodesInQuarter&255)}}class to extends ao{constructor(e,r,i){super(e,r,i)}writeTo(e){e.writeByte(240);const r=Di.withCapacity(16);r.writeByte(to.AlphaTabManufacturerId),this.writeEventData(r),r.writeByte(247),Fo.writeVariableInt(e,r.length),r.copyTo(e)}}to.AlphaTabManufacturerId=125;to.MetronomeEventId=0;to.RestEventId=1;class aM extends to{constructor(e,r,i,n,s){super(e,r,Bt.AlphaTabMetronome),this.isMetronome=!0,this.metronomeNumerator=i,this.metronomeDurationInMilliseconds=s,this.metronomeDurationInTicks=n}writeEventData(e){e.writeByte(to.MetronomeEventId),e.writeByte(this.metronomeNumerator),ae.writeInt32LE(e,this.metronomeDurationInTicks),ae.writeInt32LE(e,this.metronomeDurationInMilliseconds)}}class oM extends to{constructor(e,r,i){super(e,r,Bt.AlphaTabRest),this.channel=i}writeEventData(e){e.writeByte(to.RestEventId),e.writeByte(this.channel)}}class lM extends ao{constructor(e,r,i,n,s,a){super(e,r,i),this.channel=n,this.noteKey=s,this.noteVelocity=a}get data1(){return this.noteKey}get data2(){return this.noteVelocity}}class cM extends lM{constructor(e,r,i,n,s){super(e,r,Bt.NoteOn,i,n,s)}writeTo(e){e.writeByte(this.channel&15|144),e.writeByte(this.noteKey&255),e.writeByte(this.noteVelocity&255)}}class uM extends lM{constructor(e,r,i,n,s){super(e,r,Bt.NoteOff,i,n,s)}writeTo(e){e.writeByte(this.channel&15|128),e.writeByte(this.noteKey&255),e.writeByte(this.noteVelocity&255)}}class dM extends ao{constructor(e,r,i,n,s){super(e,r,Bt.ControlChange),this.channel=i,this.controller=n,this.value=s}writeTo(e){e.writeByte(this.channel&15|176),e.writeByte(this.controller&255),e.writeByte(this.value&255)}get data1(){return this.controller}get data2(){return this.value}}class hM extends ao{constructor(e,r,i,n){super(e,r,Bt.ProgramChange),this.channel=i,this.program=n}writeTo(e){e.writeByte(this.channel&15|192),e.writeByte(this.program&255)}get data1(){return this.program}}class fM extends ao{constructor(e,r){super(0,e,Bt.TempoChange),this.microSecondsPerQuarterNote=r}writeTo(e){e.writeByte(255),e.writeByte(81),e.writeByte(3),e.writeByte(this.microSecondsPerQuarterNote>>16&255),e.writeByte(this.microSecondsPerQuarterNote>>8&255),e.writeByte(this.microSecondsPerQuarterNote&255)}}class pM extends ao{constructor(e,r,i,n){super(e,r,Bt.PitchBend),this.channel=i,this.value=n}writeTo(e){e.writeByte(this.channel&15|224),e.writeByte(this.value&127),e.writeByte(this.value>>7&127)}get data1(){return this.value&127}get data2(){return this.value>>7&127}}class mM extends ao{constructor(e,r,i,n,s){super(e,r,Bt.PerNotePitchBend),this.channel=i,this.noteKey=n,this.value=s}writeTo(e){throw new gi(mi.General,"Note Bend (Midi2.0) events cannot be exported to SMF1.0")}}class gM extends ao{constructor(e,r){super(e,r,Bt.EndOfTrack)}writeTo(e){e.writeByte(255),e.writeByte(47),e.writeByte(0)}}class Fd{constructor(e,r){this.time=0,this.eventIndex=e,this.event=r,this.isMetronome=this.event.type==Bt.AlphaTabMetronome}static newMetronomeEvent(e,r,i,n,s){const a=new aM(0,r,i,n,s);return new Fd(e,a)}}class ht{}ht.DefaultChannelCount=17;ht.MetronomeChannel=ht.DefaultChannelCount-1;ht.AudioChannels=2;ht.MinVolume=0;ht.MinProgram=0;ht.MaxProgram=127;ht.MinPlaybackSpeed=.125;ht.MaxPlaybackSpeed=8;ht.MaxPitchWheel=16384;ht.MaxPitchWheel20=4294967296;ht.DefaultPitchWheel=ht.MaxPitchWheel/2;ht.MicroBufferCount=32;ht.MicroBufferSize=64;class $C{constructor(e,r,i){this.bpm=e,this.ticks=r,this.time=i}}class ub{constructor(){this.tempoChanges=[],this.firstProgramEventPerChannel=new Map,this.firstTimeSignatureNumerator=0,this.firstTimeSignatureDenominator=0,this.synthData=[],this.division=lt.QuarterTime,this.eventIndex=0,this.currentTime=0,this.playbackRange=null,this.playbackRangeStartTime=0,this.playbackRangeEndTime=0,this.endTick=0,this.endTime=0}}class UQ{get isPlayingMain(){return this._currentState==this._mainState}get isPlayingOneTimeMidi(){return this._currentState==this._oneTimeState}get isPlayingCountIn(){return this._currentState==this._countInState}constructor(e){this._oneTimeState=null,this._countInState=null,this.isLooping=!1,this.playbackSpeed=1,this._synthesizer=e,this._mainState=new ub,this._currentState=this._mainState}get mainPlaybackRange(){return this._mainState.playbackRange}set mainPlaybackRange(e){this._mainState.playbackRange=e,e&&(this._mainState.playbackRangeStartTime=this.tickPositionToTimePositionWithSpeed(this._mainState,e.startTick,1),this._mainState.playbackRangeEndTime=this.tickPositionToTimePositionWithSpeed(this._mainState,e.endTick,1))}get currentTime(){return this._currentState.currentTime/this.playbackSpeed}get currentEndTick(){return this._currentState.endTick}get currentEndTime(){return this._currentState.endTime/this.playbackSpeed}mainSeek(e){if(e*=this.playbackSpeed,this.mainPlaybackRange&&(ethis._mainState.playbackRangeEndTime&&(e=this._mainState.playbackRangeEndTime)),e>this._mainState.currentTime)this.mainSilentProcess(e-this._mainState.currentTime);else if(e0)for(;ch.time>p.time?1:h.time0&&(e=this.internalEndTime}stop(){this.isPlayingMain&&this.mainPlaybackRange?this._currentState.currentTime=this.mainPlaybackRange.startTick:this._currentState.currentTime=0,this._currentState.eventIndex=0}resetOneTimeMidi(){this._oneTimeState=null,this._currentState=this._mainState}resetCountIn(){this._countInState=null,this._currentState=this._mainState}startCountIn(){this.generateCountInMidi(),this._currentState=this._countInState,this.stop(),this._synthesizer.noteOffAll(!0)}generateCountInMidi(){const e=new ub;e.division=this._mainState.division;let r=120,i=4,n=4;this._mainState.eventIndex===0?(r=this._mainState.tempoChanges[0].bpm,i=this._mainState.firstTimeSignatureNumerator,n=this._mainState.firstTimeSignatureDenominator):(r=this._synthesizer.currentTempo,i=this._synthesizer.timeSignatureNumerator,n=this._synthesizer.timeSignatureDenominator),e.tempoChanges.push(new $C(r,0,0));let s=e.division*(4/n)|0,a=s*(6e4/(r*this._mainState.division)),o=0,l=0;for(let c=0;cc.time>u.time?1:c.timee.size||i.position+$n.HeaderSize>=i.length||(r.id=ae.read8BitStringLength(i,4),r.id.charCodeAt(0)<=32||r.id.charCodeAt(0)>=122)||(r.size=ae.readUInt32LE(i),e&&$n.HeaderSize+r.size>e.size))return!1;e&&(e.size-=$n.HeaderSize+r.size);let n=r.id==="RIFF",s=r.id==="LIST";return n&&e?!1:!n&&!s?!0:(r.id=ae.read8BitStringLength(i,4),r.id.charCodeAt(0)<=32||r.id.charCodeAt(0)>=122?!1:(r.size-=4,!0))}}$n.HeaderSize=8;class OS{constructor(){this.phdrs=[],this.pbags=[],this.pmods=[],this.pgens=[],this.insts=[],this.ibags=[],this.imods=[],this.igens=[],this.sHdrs=[],this.fontSamples=new Float32Array(0)}load(e){const r=new $n,i=new $n;if(!$n.load(null,r,e)||r.id!=="sfbk")throw new Wr("Soundfont is not a valid Soundfont2 file");for(;$n.load(r,i,e);){let n=new $n;if(i.id==="pdta")for(;$n.load(i,n,e);)switch(n.id){case"phdr":for(let s=0,a=n.size/hv.SizeInFile|0;s0;){let o=Math.min(i,a.length/2|0);r.read(a,0,o*2);for(let l=0;l>8&255}constructor(e){this.wordAmount=ae.readUInt16LE(e)}}class GQ{constructor(){this.presetIndex=0,this.bank=0,this.pitchWheel=0,this.perNotePitchWheel=new Map,this.midiPan=0,this.midiVolume=0,this.midiExpression=0,this.midiRpn=0,this.midiData=0,this.panOffset=0,this.gainDb=0,this.pitchRange=0,this.tuning=0,this.mixVolume=0,this.mute=!1,this.solo=!1}}class jQ{constructor(){this.activeChannel=0,this.channelList=[]}setupVoice(e,r){const i=this.channelList[this.activeChannel],n=r.region.pan+i.panOffset;r.playingChannel=this.activeChannel,r.mixVolume=i.mixVolume,r.noteGainDb+=i.gainDb,r.updatePitchRatio(i,e.outSampleRate),n<=-.5?(r.panFactorLeft=1,r.panFactorRight=0):n>=.5?(r.panFactorLeft=0,r.panFactorRight=1):(r.panFactorLeft=Math.sqrt(.5-n),r.panFactorRight=Math.sqrt(.5+n))}}var Fa;(function(t){t[t.None=0]="None",t[t.Continuous=1]="Continuous",t[t.Sustain=2]="Sustain"})(Fa||(Fa={}));var xl;(function(t){t[t.StereoInterleaved=0]="StereoInterleaved",t[t.StereoUnweaved=1]="StereoUnweaved",t[t.Mono=2]="Mono"})(xl||(xl={}));class YQ{constructor(){this.name="",this.presetNumber=0,this.bank=0,this.regions=null,this.fontSamples=null}}class Pr{static timecents2Secs(e){return Math.pow(2,e/1200)}static decibelsToGain(e){return e>-100?Math.pow(10,e*.05):0}static gainToDecibels(e){return e<=1e-5?-100:20*Math.log10(e)}static cents2Hertz(e){return 8.176*Math.pow(2,e/1200)}static clamp(e,r,i){return e<=r?r:e>=i?i:e}}class pd{constructor(e){this.delay=0,this.attack=0,this.hold=0,this.decay=0,this.sustain=0,this.release=0,this.keynumToHold=0,this.keynumToDecay=0,e&&(this.delay=e.delay,this.attack=e.attack,this.hold=e.hold,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.keynumToHold=e.keynumToHold,this.keynumToDecay=e.keynumToDecay)}clear(){this.delay=0,this.attack=0,this.hold=0,this.decay=0,this.sustain=0,this.release=0,this.keynumToHold=0,this.keynumToDecay=0}envToSecs(e){this.delay=this.delay<-11950?0:Pr.timecents2Secs(this.delay),this.attack=this.attack<-11950?0:Pr.timecents2Secs(this.attack),this.release=this.release<-11950?0:Pr.timecents2Secs(this.release),this.keynumToHold===0&&(this.hold=this.hold<-11950?0:Pr.timecents2Secs(this.hold)),this.keynumToDecay===0&&(this.decay=this.decay<-11950?0:Pr.timecents2Secs(this.decay)),this.sustain<0?this.sustain=0:e?this.sustain=Pr.decibelsToGain(-this.sustain/10):this.sustain=1-this.sustain/1e3}}var _t;(function(t){t[t.StartAddrsOffset=0]="StartAddrsOffset",t[t.EndAddrsOffset=1]="EndAddrsOffset",t[t.StartloopAddrsOffset=2]="StartloopAddrsOffset",t[t.EndloopAddrsOffset=3]="EndloopAddrsOffset",t[t.StartAddrsCoarseOffset=4]="StartAddrsCoarseOffset",t[t.ModLfoToPitch=5]="ModLfoToPitch",t[t.VibLfoToPitch=6]="VibLfoToPitch",t[t.ModEnvToPitch=7]="ModEnvToPitch",t[t.InitialFilterFc=8]="InitialFilterFc",t[t.InitialFilterQ=9]="InitialFilterQ",t[t.ModLfoToFilterFc=10]="ModLfoToFilterFc",t[t.ModEnvToFilterFc=11]="ModEnvToFilterFc",t[t.EndAddrsCoarseOffset=12]="EndAddrsCoarseOffset",t[t.ModLfoToVolume=13]="ModLfoToVolume",t[t.Unused1=14]="Unused1",t[t.ChorusEffectsSend=15]="ChorusEffectsSend",t[t.ReverbEffectsSend=16]="ReverbEffectsSend",t[t.Pan=17]="Pan",t[t.Unused2=18]="Unused2",t[t.Unused3=19]="Unused3",t[t.Unused4=20]="Unused4",t[t.DelayModLFO=21]="DelayModLFO",t[t.FreqModLFO=22]="FreqModLFO",t[t.DelayVibLFO=23]="DelayVibLFO",t[t.FreqVibLFO=24]="FreqVibLFO",t[t.DelayModEnv=25]="DelayModEnv",t[t.AttackModEnv=26]="AttackModEnv",t[t.HoldModEnv=27]="HoldModEnv",t[t.DecayModEnv=28]="DecayModEnv",t[t.SustainModEnv=29]="SustainModEnv",t[t.ReleaseModEnv=30]="ReleaseModEnv",t[t.KeynumToModEnvHold=31]="KeynumToModEnvHold",t[t.KeynumToModEnvDecay=32]="KeynumToModEnvDecay",t[t.DelayVolEnv=33]="DelayVolEnv",t[t.AttackVolEnv=34]="AttackVolEnv",t[t.HoldVolEnv=35]="HoldVolEnv",t[t.DecayVolEnv=36]="DecayVolEnv",t[t.SustainVolEnv=37]="SustainVolEnv",t[t.ReleaseVolEnv=38]="ReleaseVolEnv",t[t.KeynumToVolEnvHold=39]="KeynumToVolEnvHold",t[t.KeynumToVolEnvDecay=40]="KeynumToVolEnvDecay",t[t.Instrument=41]="Instrument",t[t.Reserved1=42]="Reserved1",t[t.KeyRange=43]="KeyRange",t[t.VelRange=44]="VelRange",t[t.StartloopAddrsCoarseOffset=45]="StartloopAddrsCoarseOffset",t[t.Keynum=46]="Keynum",t[t.Velocity=47]="Velocity",t[t.InitialAttenuation=48]="InitialAttenuation",t[t.Reserved2=49]="Reserved2",t[t.EndloopAddrsCoarseOffset=50]="EndloopAddrsCoarseOffset",t[t.CoarseTune=51]="CoarseTune",t[t.FineTune=52]="FineTune",t[t.SampleID=53]="SampleID",t[t.SampleModes=54]="SampleModes",t[t.Reserved3=55]="Reserved3",t[t.ScaleTuning=56]="ScaleTuning",t[t.ExclusiveClass=57]="ExclusiveClass",t[t.OverridingRootKey=58]="OverridingRootKey",t[t.Unused5=59]="Unused5",t[t.EndOper=60]="EndOper"})(_t||(_t={}));class dc{constructor(e){this.loopMode=Fa.None,this.sampleRate=0,this.loKey=0,this.hiKey=0,this.loVel=0,this.hiVel=0,this.group=0,this.offset=0,this.end=0,this.loopStart=0,this.loopEnd=0,this.transpose=0,this.tune=0,this.pitchKeyCenter=0,this.pitchKeyTrack=0,this.attenuation=0,this.pan=0,this.ampEnv=new pd,this.modEnv=new pd,this.initialFilterQ=0,this.initialFilterFc=0,this.modEnvToPitch=0,this.modEnvToFilterFc=0,this.modLfoToFilterFc=0,this.modLfoToVolume=0,this.delayModLFO=0,this.freqModLFO=0,this.modLfoToPitch=0,this.delayVibLFO=0,this.freqVibLFO=0,this.vibLfoToPitch=0,e&&(this.loopMode=e.loopMode,this.sampleRate=e.sampleRate,this.loKey=e.loKey,this.hiKey=e.hiKey,this.loVel=e.loVel,this.hiVel=e.hiVel,this.group=e.group,this.offset=e.offset,this.end=e.end,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.transpose=e.transpose,this.tune=e.tune,this.pitchKeyCenter=e.pitchKeyCenter,this.pitchKeyTrack=e.pitchKeyTrack,this.attenuation=e.attenuation,this.pan=e.pan,this.ampEnv=new pd(e.ampEnv),this.modEnv=new pd(e.modEnv),this.initialFilterQ=e.initialFilterQ,this.initialFilterFc=e.initialFilterFc,this.modEnvToPitch=e.modEnvToPitch,this.modEnvToFilterFc=e.modEnvToFilterFc,this.modLfoToFilterFc=e.modLfoToFilterFc,this.modLfoToVolume=e.modLfoToVolume,this.delayModLFO=e.delayModLFO,this.freqModLFO=e.freqModLFO,this.modLfoToPitch=e.modLfoToPitch,this.delayVibLFO=e.delayVibLFO,this.freqVibLFO=e.freqVibLFO,this.vibLfoToPitch=e.vibLfoToPitch)}clear(e){this.loopMode=Fa.None,this.sampleRate=0,this.loKey=0,this.hiKey=0,this.loVel=0,this.hiVel=0,this.group=0,this.offset=0,this.end=0,this.loopStart=0,this.loopEnd=0,this.transpose=0,this.tune=0,this.pitchKeyCenter=0,this.pitchKeyTrack=0,this.attenuation=0,this.pan=0,this.ampEnv.clear(),this.modEnv.clear(),this.initialFilterQ=0,this.initialFilterFc=0,this.modEnvToPitch=0,this.modEnvToFilterFc=0,this.modLfoToFilterFc=0,this.modLfoToVolume=0,this.delayModLFO=0,this.freqModLFO=0,this.modLfoToPitch=0,this.delayVibLFO=0,this.freqVibLFO=0,this.vibLfoToPitch=0,this.hiKey=127,this.hiVel=127,this.pitchKeyCenter=60,!e&&(this.pitchKeyTrack=100,this.pitchKeyCenter=-1,this.ampEnv.delay=-12e3,this.ampEnv.attack=-12e3,this.ampEnv.hold=-12e3,this.ampEnv.decay=-12e3,this.ampEnv.release=-12e3,this.modEnv.delay=-12e3,this.modEnv.attack=-12e3,this.modEnv.hold=-12e3,this.modEnv.decay=-12e3,this.modEnv.release=-12e3,this.initialFilterFc=13500,this.delayModLFO=-12e3,this.delayVibLFO=-12e3)}operator(e,r){switch(e){case _t.StartAddrsOffset:this.offset+=pt.int16ToUint32(r.shortAmount);break;case _t.EndAddrsOffset:this.end+=pt.int16ToUint32(r.shortAmount);break;case _t.StartloopAddrsOffset:this.loopStart+=pt.int16ToUint32(r.shortAmount);break;case _t.EndloopAddrsOffset:this.loopEnd+=pt.int16ToUint32(r.shortAmount);break;case _t.StartAddrsCoarseOffset:this.offset+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.ModLfoToPitch:this.modLfoToPitch=r.shortAmount;break;case _t.VibLfoToPitch:this.vibLfoToPitch=r.shortAmount;break;case _t.ModEnvToPitch:this.modEnvToPitch=r.shortAmount;break;case _t.InitialFilterFc:this.initialFilterFc=r.shortAmount;break;case _t.InitialFilterQ:this.initialFilterQ=r.shortAmount;break;case _t.ModLfoToFilterFc:this.modLfoToFilterFc=r.shortAmount;break;case _t.ModEnvToFilterFc:this.modEnvToFilterFc=r.shortAmount;break;case _t.EndAddrsCoarseOffset:this.end+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.ModLfoToVolume:this.modLfoToVolume=r.shortAmount;break;case _t.Pan:this.pan=r.shortAmount/1e3;break;case _t.DelayModLFO:this.delayModLFO=r.shortAmount;break;case _t.FreqModLFO:this.freqModLFO=r.shortAmount;break;case _t.DelayVibLFO:this.delayVibLFO=r.shortAmount;break;case _t.FreqVibLFO:this.freqVibLFO=r.shortAmount;break;case _t.DelayModEnv:this.modEnv.delay=r.shortAmount;break;case _t.AttackModEnv:this.modEnv.attack=r.shortAmount;break;case _t.HoldModEnv:this.modEnv.hold=r.shortAmount;break;case _t.DecayModEnv:this.modEnv.decay=r.shortAmount;break;case _t.SustainModEnv:this.modEnv.sustain=r.shortAmount;break;case _t.ReleaseModEnv:this.modEnv.release=r.shortAmount;break;case _t.KeynumToModEnvHold:this.modEnv.keynumToHold=r.shortAmount;break;case _t.KeynumToModEnvDecay:this.modEnv.keynumToDecay=r.shortAmount;break;case _t.DelayVolEnv:this.ampEnv.delay=r.shortAmount;break;case _t.AttackVolEnv:this.ampEnv.attack=r.shortAmount;break;case _t.HoldVolEnv:this.ampEnv.hold=r.shortAmount;break;case _t.DecayVolEnv:this.ampEnv.decay=r.shortAmount;break;case _t.SustainVolEnv:this.ampEnv.sustain=r.shortAmount;break;case _t.ReleaseVolEnv:this.ampEnv.release=r.shortAmount;break;case _t.KeynumToVolEnvHold:this.ampEnv.keynumToHold=r.shortAmount;break;case _t.KeynumToVolEnvDecay:this.ampEnv.keynumToDecay=r.shortAmount;break;case _t.KeyRange:this.loKey=r.lowByteAmount,this.hiKey=r.highByteAmount;break;case _t.VelRange:this.loVel=r.lowByteAmount,this.hiVel=r.highByteAmount;break;case _t.StartloopAddrsCoarseOffset:this.loopStart+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.InitialAttenuation:this.attenuation+=r.shortAmount*.1;break;case _t.EndloopAddrsCoarseOffset:this.loopEnd+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.CoarseTune:this.transpose+=r.shortAmount;break;case _t.FineTune:this.tune+=r.shortAmount;break;case _t.SampleModes:this.loopMode=(r.wordAmount&3)===3?Fa.Sustain:(r.wordAmount&3)===1?Fa.Continuous:Fa.None;break;case _t.ScaleTuning:this.pitchKeyTrack=r.shortAmount;break;case _t.ExclusiveClass:this.group=r.wordAmount;break;case _t.OverridingRootKey:this.pitchKeyCenter=r.shortAmount;break}}}var Qt;(function(t){t[t.None=0]="None",t[t.Delay=1]="Delay",t[t.Attack=2]="Attack",t[t.Hold=3]="Hold",t[t.Decay=4]="Decay",t[t.Sustain=5]="Sustain",t[t.Release=6]="Release",t[t.Done=7]="Done"})(Qt||(Qt={}));class bh{constructor(){this.level=0,this.slope=0,this.samplesUntilNextSegment=0,this.segment=Qt.None,this.midiVelocity=0,this.parameters=null,this.segmentIsExponential=!1,this.isAmpEnv=!1}nextSegment(e,r){if(this.parameters)for(;;)switch(e){case Qt.None:if(this.samplesUntilNextSegment=this.parameters.delay*r|0,this.samplesUntilNextSegment>0){this.segment=Qt.Delay,this.segmentIsExponential=!1,this.level=0,this.slope=0;return}e=Qt.Delay;break;case Qt.Delay:if(this.samplesUntilNextSegment=this.parameters.attack*r|0,this.samplesUntilNextSegment>0){this.isAmpEnv||(this.samplesUntilNextSegment=this.parameters.attack*((145-this.midiVelocity)/144)*r|0),this.segment=Qt.Attack,this.segmentIsExponential=!1,this.level=0,this.slope=1/this.samplesUntilNextSegment;return}e=Qt.Attack;break;case Qt.Attack:if(this.samplesUntilNextSegment=this.parameters.hold*r|0,this.samplesUntilNextSegment>0){this.segment=Qt.Hold,this.segmentIsExponential=!1,this.level=1,this.slope=0;return}e=Qt.Hold;break;case Qt.Hold:if(this.samplesUntilNextSegment=this.parameters.decay*r|0,this.samplesUntilNextSegment>0){if(this.segment=Qt.Decay,this.level=1,this.isAmpEnv){let i=-9.226/this.samplesUntilNextSegment;this.slope=Math.exp(i),this.segmentIsExponential=!0,this.parameters.sustain>0&&(this.samplesUntilNextSegment=Math.log(this.parameters.sustain)/i|0)}else this.slope=-1/this.samplesUntilNextSegment,this.samplesUntilNextSegment=this.parameters.decay*(1-this.parameters.sustain)*r|0,this.segmentIsExponential=!1;return}e=Qt.Decay;break;case Qt.Decay:this.segment=Qt.Sustain,this.level=this.parameters.sustain,this.slope=0,this.samplesUntilNextSegment=2147483647,this.segmentIsExponential=!1;return;case Qt.Sustain:if(this.segment=Qt.Release,this.samplesUntilNextSegment=(this.parameters.release<=0?bh.FastReleaseTime:this.parameters.release)*r|0,this.isAmpEnv){let i=-9.226/this.samplesUntilNextSegment;this.slope=Math.exp(i),this.segmentIsExponential=!0}else this.slope=-this.level/this.samplesUntilNextSegment,this.segmentIsExponential=!1;return;default:this.segment=Qt.Done,this.segmentIsExponential=!1,this.level=0,this.slope=0,this.samplesUntilNextSegment=134217727;return}}setup(e,r,i,n,s){this.parameters=new pd(e),this.parameters.keynumToHold>0&&(this.parameters.hold+=this.parameters.keynumToHold*(60-r),this.parameters.hold=this.parameters.hold<-1e4?0:Pr.timecents2Secs(this.parameters.hold)),this.parameters.keynumToDecay>0&&(this.parameters.decay+=this.parameters.keynumToDecay*(60-r),this.parameters.decay=this.parameters.decay<-1e4?0:Pr.timecents2Secs(this.parameters.decay)),this.midiVelocity=i|0,this.isAmpEnv=n,this.nextSegment(Qt.None,s)}process(e,r){this.slope>0&&(this.segmentIsExponential?this.level*=Math.pow(this.slope,e):this.level+=this.slope*e),this.samplesUntilNextSegment-=e,this.samplesUntilNextSegment<=0&&this.nextSegment(this.segment,r)}}bh.FastReleaseTime=.01;class zC{constructor(){this.samplesUntil=0,this.level=0,this.delta=0}setup(e,r,i){this.samplesUntil=e*i|0,this.delta=4*Pr.cents2Hertz(r)/i,this.level=0}process(e){if(this.samplesUntil>e){this.samplesUntil-=e;return}this.level+=this.delta*e,this.level>1?(this.delta=-this.delta,this.level=2-this.level):this.level<-1&&(this.delta=-this.delta,this.level=-2-this.level)}}class WC{constructor(e){this.qInv=0,this.a0=0,this.a1=0,this.b1=0,this.b2=0,this.z1=0,this.z2=0,this.active=!1,e&&(this.qInv=e.qInv,this.a0=e.a0,this.a1=e.a1,this.b1=e.b1,this.b2=e.b2,this.z1=e.z1,this.z2=e.z2,this.active=e.active)}setup(e){let r=Math.tan(Math.PI*e),i=r*r,n=1/(1+r*this.qInv+i);this.a0=i*n,this.a1=2*this.a0,this.b1=2*(i-1)*n,this.b2=(1-r*this.qInv+i)*n}process(e){let r=e*this.a0+this.z1;return this.z1=e*this.a1+this.z2-this.b1*r,this.z2=e*this.a0-this.b2*r,r}}class vh{constructor(){this.playingPreset=0,this.playingKey=0,this.playingChannel=0,this.region=null,this.pitchInputTimecents=0,this.pitchOutputFactor=0,this.sourceSamplePosition=0,this.noteGainDb=0,this.panFactorLeft=0,this.panFactorRight=0,this.playIndex=0,this.loopStart=0,this.loopEnd=0,this.ampEnv=new bh,this.modEnv=new bh,this.lowPass=new WC,this.modLfo=new zC,this.vibLfo=new zC,this.mixVolume=0,this.mute=!1}updatePitchRatio(e,r){let i=e.pitchWheel;e.perNotePitchWheel.has(this.playingKey)&&(i+=e.perNotePitchWheel.get(this.playingKey)-8192);const n=i===8192?e.tuning:i/16383*e.pitchRange*2-e.pitchRange+e.tuning;this.calcPitchRatio(n,r)}calcPitchRatio(e,r){if(!this.region)return;const i=this.playingKey+this.region.transpose+this.region.tune/100;let n=this.region.pitchKeyCenter+(i-this.region.pitchKeyCenter)*(this.region.pitchKeyTrack/100);e!==0&&(n+=e),this.pitchInputTimecents=n*100,this.pitchOutputFactor=this.region.sampleRate/(Pr.timecents2Secs(this.region.pitchKeyCenter*100)*r)}end(e){this.region&&(this.ampEnv.nextSegment(Qt.Sustain,e),this.modEnv.nextSegment(Qt.Sustain,e),this.region.loopMode===Fa.Sustain&&(this.loopEnd=this.loopStart))}endQuick(e){this.ampEnv.parameters.release=0,this.ampEnv.nextSegment(Qt.Sustain,e),this.modEnv.parameters.release=0,this.modEnv.nextSegment(Qt.Sustain,e)}render(e,r,i,n,s){if(!this.region)return;let a=this.region,l=e.presets[this.playingPreset].fontSamples,c=0,u=e.outputMode===xl.StereoUnweaved?n:-1,d=a.modEnvToPitch!==0||a.modEnvToFilterFc!==0,h=this.modLfo.delta>0&&(a.modLfoToPitch!==0||a.modLfoToFilterFc!==0||a.modLfoToVolume!==0),p=this.vibLfo.delta>0&&a.vibLfoToPitch!==0,f=this.loopStart0;){let N,V,W=0,Q=n>vh.RenderEffectSampleBlock?vh.RenderEffectSampleBlock:n;if(n-=Q,C){let ne=_+this.modLfo.level*P+this.modEnv.level*R;k.active=ne<=13500,k.active&&k.setup(Pr.cents2Hertz(ne)/x)}switch(E&&(D=Pr.timecents2Secs(this.pitchInputTimecents+(this.modLfo.level*$+this.vibLfo.level*I+this.modEnv.level*F))*this.pitchOutputFactor),M&&(O=Pr.decibelsToGain(this.noteGainDb+this.modLfo.level*A)),N=O*this.ampEnv.level,s?N=0:N*=this.mixVolume,this.ampEnv.process(Q,e.outSampleRate),d&&this.modEnv.process(Q,e.outSampleRate),h&&this.modLfo.process(Q),p&&this.vibLfo.process(Q),e.outputMode){case xl.StereoInterleaved:for(V=N*this.panFactorLeft,W=N*this.panFactorRight;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]+=j*V,c++,r[i+c]+=j*W,c++,b+=D,b>=g&&f&&(b-=y-m+1)}break;case xl.StereoUnweaved:for(V=N*this.panFactorLeft,W=N*this.panFactorRight;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]+=j*V,c++,r[i+u]+=j*W,u++,b+=D,b>=g&&f&&(b-=y-m+1)}break;case xl.Mono:for(;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]=j*N,c++,b+=D,b>=g&&f&&(b-=y-m+1)}break}if(b>=v||this.ampEnv.segment===Qt.Done){this.kill();return}}this.sourceSamplePosition=b,(k.active||C)&&(this.lowPass=k)}kill(){this.playingPreset=-1}}vh.RenderEffectSampleBlock=ht.MicroBufferSize;class mv{constructor(){this._items=[],this._position=0,this.isEmpty=!0}clear(){this._items=[],this._position=0,this.isEmpty=!0}enqueue(e){this.isEmpty=!1,this._items.push(e)}peek(){return this._items[this._position]}dequeue(){const e=this._items[this._position];return this._position++,this._position>=this._items.length/2&&(this._items=this._items.slice(this._position),this._position=0),this.isEmpty=this._items.length==0,e}toArray(){const e=this._items.slice(this._position);return e.reverse(),e}}var jt;(function(t){t[t.BankSelectCoarse=0]="BankSelectCoarse",t[t.ModulationCoarse=1]="ModulationCoarse",t[t.DataEntryCoarse=6]="DataEntryCoarse",t[t.VolumeCoarse=7]="VolumeCoarse",t[t.PanCoarse=10]="PanCoarse",t[t.ExpressionControllerCoarse=11]="ExpressionControllerCoarse",t[t.BankSelectFine=32]="BankSelectFine",t[t.ModulationFine=33]="ModulationFine",t[t.DataEntryFine=38]="DataEntryFine",t[t.VolumeFine=39]="VolumeFine",t[t.PanFine=42]="PanFine",t[t.ExpressionControllerFine=43]="ExpressionControllerFine",t[t.HoldPedal=64]="HoldPedal",t[t.LegatoPedal=68]="LegatoPedal",t[t.NonRegisteredParameterFine=98]="NonRegisteredParameterFine",t[t.NonRegisteredParameterCourse=99]="NonRegisteredParameterCourse",t[t.RegisteredParameterFine=100]="RegisteredParameterFine",t[t.RegisteredParameterCourse=101]="RegisteredParameterCourse",t[t.AllSoundOff=120]="AllSoundOff",t[t.ResetControllers=121]="ResetControllers",t[t.AllNotesOff=123]="AllNotesOff"})(jt||(jt={}));class XQ{constructor(e){this._midiEventQueue=new mv,this._mutedChannels=new Map,this._soloChannels=new Map,this._isAnySolo=!1,this._transpositionPitches=new Map,this.currentTempo=0,this.timeSignatureNumerator=0,this.timeSignatureDenominator=0,this.presets=null,this._voices=[],this._channels=null,this._voicePlayIndex=0,this.outputMode=xl.StereoInterleaved,this.outSampleRate=0,this.globalGainDb=0,this.outSampleRate=e}synthesize(e,r,i){return this.fillWorkingBuffer(e,r,i)}synthesizeSilent(e){this.fillWorkingBuffer(null,0,e)}channelGetMixVolume(e){return this._channels&&e0}resetChannelStates(){this._mutedChannels=new Map,this._soloChannels=new Map,this.applyTranspositionPitches(new Map),this._isAnySolo=!1}applyTranspositionPitches(e){const r=this._transpositionPitches;for(const i of this._voices)if(i.playingChannel>=0&&i.playingChannel!==9){let n=0;r.has(i.playingChannel)&&(n-=r.get(i.playingChannel)),e.has(i.playingChannel)&&(n+=e.get(i.playingChannel)),i.playingKey+=n,this._channels&&i.updatePitchRatio(this._channels.channelList[i.playingChannel],this.outSampleRate)}this._transpositionPitches=e}dispatchEvent(e){this._midiEventQueue.enqueue(e)}fillWorkingBuffer(e,r,i){const n=this._isAnySolo,s=[];for(;!this._midiEventQueue.isEmpty;){let a=this._midiEventQueue.dequeue();a.isMetronome&&this.metronomeVolume>0?(this.channelNoteOff(ht.MetronomeChannel,33),this.channelNoteOn(ht.MetronomeChannel,33,95/127)):a.event&&this.processMidiMessage(a.event),s.push(a)}for(const a of this._voices)if(a.playingPreset!==-1){const o=a.playingChannel,l=this._mutedChannels.has(o)||n&&o!=ht.MetronomeChannel&&!this._soloChannels.has(o);e?a.render(this,e,r,i,l):a.kill()}return s}processMidiMessage(e){switch(de.debug("MIdi","Processing Midi message "+Bt[e.type]+"/"+e.tick),e.type){case Bt.TimeSignature:const i=e;this.timeSignatureNumerator=i.numerator,this.timeSignatureDenominator=Math.pow(2,i.denominatorIndex);break;case Bt.NoteOn:const n=e;this.channelNoteOn(n.channel,n.noteKey,n.noteVelocity/127);break;case Bt.NoteOff:const s=e;this.channelNoteOff(s.channel,s.noteKey);break;case Bt.ControlChange:const a=e;this.channelMidiControl(a.channel,a.controller,a.value);break;case Bt.ProgramChange:const o=e;this.channelSetPresetNumber(o.channel,o.program,o.channel===9);break;case Bt.TempoChange:const l=e;this.currentTempo=6e7/l.microSecondsPerQuarterNote;break;case Bt.PitchBend:const c=e;this.channelSetPitchWheel(c.channel,c.value);break;case Bt.PerNotePitchBend:const u=e;let d=u.value;d=d*ht.MaxPitchWheel/ht.MaxPitchWheel20,this.channelSetPerNotePitchWheel(u.channel,u.noteKey,d);break}}get metronomeVolume(){return this.channelGetMixVolume(ht.MetronomeChannel)}set metronomeVolume(e){this.setupMetronomeChannel(e)}setupMetronomeChannel(e){this.channelSetMixVolume(ht.MetronomeChannel,e),e>0&&(this.channelSetVolume(ht.MetronomeChannel,1),this.channelSetPresetNumber(ht.MetronomeChannel,0,!0))}get masterVolume(){return Pr.decibelsToGain(this.globalGainDb)}set masterVolume(e){var r=Pr.gainToDecibels(e);const i=r-this.globalGainDb;if(i!==0){for(const n of this._voices)n.playingPreset!==-1&&(n.noteGainDb+=i);this.globalGainDb=r}}resetSoft(){for(const e of this._voices)e.playingPreset!==-1&&(e.ampEnv.segment=1?r:44100,this.globalGainDb=i}noteOn(e,r,i){if(!this.presets)return;const n=i*127|0;if(e<0||e>=this.presets.length)return;if(i<=0){this.noteOff(e,r);return}const s=this._voicePlayIndex++;for(const a of this.presets[e].regions){if(ra.hiKey||na.hiVel)continue;let o=null;if(a.group!==0)for(const u of this._voices)u.playingPreset===e&&u.region.group===a.group?u.endQuick(this.outSampleRate):u.playingPreset===-1&&!o&&(o=u);else for(let u of this._voices)u.playingPreset===-1&&(o=u);if(!o){for(let u=0;u<4;u++){const d=new vh;d.playingPreset=-1,this._voices.push(d)}o=this._voices[this._voices.length-4]}o.region=a,o.playingPreset=e,o.playingKey=r,o.playIndex=s,o.noteGainDb=this.globalGainDb-a.attenuation-Pr.gainToDecibels(1/i),this._channels?this._channels.setupVoice(this,o):(o.calcPitchRatio(0,this.outSampleRate),o.panFactorLeft=Math.sqrt(.5-a.pan),o.panFactorRight=Math.sqrt(.5+a.pan)),o.sourceSamplePosition=a.offset;const l=a.loopMode!==Fa.None&&a.loopStart=Qt.Release||(!i||a.playIndex=Qt.Release)||a.end(this.outSampleRate)}bankNoteOff(e,r,i){const n=this.getPresetIndex(e,r);return n===-1?!1:(this.noteOff(n,i),!0)}noteOffAll(e){for(const r of this._voices)r.playingPreset!==-1&&r.ampEnv.segment=0;i--){let n=this.presets[i];if(n.presetNumber===r&&n.bank===e)return i}return-1}getPresetName(e){return this.presets?e<0||e>=this.presets.length?null:this.presets[e].name:null}bankGetPresetName(e,r){return this.getPresetName(this.getPresetIndex(e,r))}channelNoteOn(e,r,i){!this._channels||e>this._channels.channelList.length||(this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e)),this._channels.activeChannel=e,this.noteOn(this._channels.channelList[e].presetIndex,r,i))}channelNoteOff(e,r){this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e));const i=[];let n=null,s=null;for(const o of this._voices)o.playingPreset===-1||o.playingChannel!==e||o.playingKey!==r||o.ampEnv.segment>=Qt.Release||(!n||o.playIndex=Qt.Release)||o.end(this.outSampleRate)}channelNoteOffAll(e){this.channelInit(e).perNotePitchWheel.clear();for(const i of this._voices)i.playingPreset!==-1&&i.playingChannel===e&&i.ampEnv.segment=.5?(i.panFactorLeft=0,i.panFactorRight=1):(i.panFactorLeft=Math.sqrt(.5-n),i.panFactorRight=Math.sqrt(.5+n))}this.channelInit(e).panOffset=r-.5}channelSetVolume(e,r){const i=this.channelInit(e),n=Pr.gainToDecibels(r),s=n-i.gainDb;if(s!==0){for(const a of this._voices)a.playingChannel===e&&a.playingPreset!==-1&&(a.noteGainDb+=s);i.gainDb=n}}channelSetPitchWheel(e,r){const i=this.channelInit(e);i.pitchWheel!==r&&(i.pitchWheel=pt.int32ToUint16(r),this.channelApplyPitch(e,i))}channelSetPerNotePitchWheel(e,r,i){this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e));const n=this.channelInit(e);n.perNotePitchWheel.has(r)&&n.perNotePitchWheel.get(r)===i||(n.perNotePitchWheel.set(r,i),this.channelApplyPitch(e,n,r))}channelApplyPitch(e,r,i=-1){for(const n of this._voices)n.playingChannel===e&&n.playingPreset!==-1&&(i==-1||n.playingKey===i)&&n.updatePitchRatio(r,this.outSampleRate)}channelSetPitchRange(e,r){const i=this.channelInit(e);i.pitchRange!==r&&(i.pitchRange=r,i.pitchWheel!==8192&&this.channelApplyPitch(e,i))}channelSetTuning(e,r){const i=this.channelInit(e);i.tuning!==r&&(i.tuning=r,this.channelApplyPitch(e,i))}channelMidiControl(e,r,i){let n=this.channelInit(e);switch(r){case jt.DataEntryFine:n.midiData=pt.int32ToUint16(n.midiData&16256|i),n.midiRpn===0?this.channelSetPitchRange(e,(n.midiData>>7)+.01*(n.midiData&127)):n.midiRpn===1?this.channelSetTuning(e,(n.tuning|0)+(n.midiData-8192)/8192):n.midiRpn===2&&this.channelSetTuning(e,i-64+(n.tuning-(n.tuning|0)));return;case jt.VolumeCoarse:n.midiVolume=pt.int32ToUint16(n.midiVolume&127|i<<7),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.VolumeFine:n.midiVolume=pt.int32ToUint16(n.midiVolume&16256|i),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.ExpressionControllerCoarse:n.midiExpression=pt.int32ToUint16(n.midiExpression&127|i<<7),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.ExpressionControllerFine:n.midiExpression=pt.int32ToUint16(n.midiExpression&16256|i),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.PanCoarse:n.midiPan=pt.int32ToUint16(n.midiPan&127|i<<7),this.channelSetPan(e,n.midiPan/16383);return;case jt.PanFine:n.midiPan=pt.int32ToUint16(n.midiPan&16256|i),this.channelSetPan(e,n.midiPan/16383);return;case jt.DataEntryCoarse:n.midiData=pt.int32ToUint16(n.midiData&127|i<<7),n.midiRpn===0?this.channelSetPitchRange(e,(n.midiData>>7)+.01*(n.midiData&127)):n.midiRpn===1?this.channelSetTuning(e,(n.tuning|0)+(n.midiData-8192)/8192):n.midiRpn===2&&r===jt.DataEntryCoarse&&this.channelSetTuning(e,i-64+(n.tuning-(n.tuning|0)));return;case jt.BankSelectCoarse:n.bank=pt.int32ToUint16(32768|i);return;case jt.BankSelectFine:n.bank=pt.int32ToUint16((n.bank&32768?(n.bank&127)<<7:0)|i);return;case jt.RegisteredParameterCourse:n.midiRpn=pt.int32ToUint16((n.midiRpn===65535?0:n.midiRpn)&127|i<<7);return;case jt.RegisteredParameterFine:n.midiRpn=pt.int32ToUint16((n.midiRpn===65535?0:n.midiRpn)&16256|i);return;case jt.NonRegisteredParameterFine:n.midiRpn=65535;return;case jt.NonRegisteredParameterCourse:n.midiRpn=65535;return;case jt.AllSoundOff:this.channelSoundsOffAll(e);return;case jt.AllNotesOff:this.channelNoteOffAll(e);return;case jt.ResetControllers:n.midiVolume=16383,n.midiExpression=16383,n.midiPan=8192,n.bank=0,this.channelSetVolume(e,1),this.channelSetPan(e,.5),this.channelSetPitchRange(e,2);return}}channelGetPresetIndex(e){return this._channels&&e=e.insts.length)continue;let g=e.insts[v.genAmount.wordAmount];for(let b=g.instBagNdx;b=h&&C<=p&&P>=f&&_<=m&&l++}}}}o.regions=new Array(l);let c=new dc;c.clear(!0);for(let u=s.presetBagNdx;u=e.insts.length)continue;let v=new dc;v.clear(!1);let g=e.insts[y];for(let b=g.instBagNdx;bh.hiKey||C.hiVelh.hiVel)continue;h.loKey>C.loKey&&(C.loKey=h.loKey),h.hiKeyC.loVel&&(C.loVel=h.loVel),h.hiVel.5&&(C.pan=.5),(C.initialFilterQ<1500||C.initialFilterQ>13500)&&(C.initialFilterQ=0);let R=e.sHdrs[P.genAmount.wordAmount];C.offset+=R.start,C.end+=R.end,C.loopStart+=R.startLoop,C.loopEnd+=R.endLoop,R.endLoop>0&&(C.loopEnd-=1),C.pitchKeyCenter===-1&&(C.pitchKeyCenter=R.originalPitch),C.tune+=R.pitchCorrection,C.sampleRate=R.sampleRate,C.end!==0&&C.endr!==e)}trigger(){for(const e of this._listeners)e()}}class Nt{constructor(){this._listeners=[]}on(e){this._listeners.push(e)}off(e){this._listeners=this._listeners.filter(r=>r!==e)}trigger(e){for(const r of this._listeners)r(e)}}class bM{constructor(e){this.events=e}}class vM{constructor(e){this.playbackRange=e}}class qQ{get isReadyForPlayback(){return this.isReady&&this._isSoundFontLoaded&&this._isMidiLoaded}get logLevel(){return de.logLevel}set logLevel(e){de.logLevel=e}get masterVolume(){return this._synthesizer.masterVolume}set masterVolume(e){e=Math.max(e,ht.MinVolume),this._synthesizer.masterVolume=e}get metronomeVolume(){return this._metronomeVolume}set metronomeVolume(e){e=Math.max(e,ht.MinVolume),this._metronomeVolume=e,this._synthesizer.metronomeVolume=e}get countInVolume(){return this._countInVolume}set countInVolume(e){e=Math.max(e,ht.MinVolume),this._countInVolume=e}get midiEventsPlayedFilter(){return Array.from(this._midiEventsPlayedFilter)}set midiEventsPlayedFilter(e){this._midiEventsPlayedFilter=new Set(e)}get playbackSpeed(){return this._sequencer.playbackSpeed}set playbackSpeed(e){e=Pr.clamp(e,ht.MinPlaybackSpeed,ht.MaxPlaybackSpeed);let r=this._sequencer.playbackSpeed;this._sequencer.playbackSpeed=e,this.timePosition=this.timePosition*(r/e)}get tickPosition(){return this._tickPosition}set tickPosition(e){this.timePosition=this._sequencer.mainTickPositionToTimePosition(e)}get timePosition(){return this._timePosition}set timePosition(e){de.debug("AlphaSynth",`Seeking to position ${e}ms (main)`),this._sequencer.mainSeek(e),this.updateTimePosition(e,!0),this._sequencer.isPlayingMain&&(this._notPlayedSamples=0,this.output.resetSamples())}get playbackRange(){return this._sequencer.mainPlaybackRange}set playbackRange(e){this._sequencer.mainPlaybackRange=e,e&&(this.tickPosition=e.startTick),this.playbackRangeChanged.trigger(new vM(e))}get isLooping(){return this._sequencer.isLooping}set isLooping(e){this._sequencer.isLooping=e}destroy(){de.debug("AlphaSynth","Destroying player"),this.stop(),this.output.destroy()}constructor(e,r){this._isSoundFontLoaded=!1,this._isMidiLoaded=!1,this._tickPosition=0,this._timePosition=0,this._metronomeVolume=0,this._countInVolume=0,this._playedEventsQueue=new mv,this._midiEventsPlayedFilter=new Set,this._notPlayedSamples=0,this.isReady=!1,this.state=ti.Paused,this.ready=new oi,this.readyForPlayback=new oi,this.finished=new oi,this.soundFontLoaded=new oi,this.soundFontLoadFailed=new Nt,this.midiLoaded=new Nt,this.midiLoadFailed=new Nt,this.stateChanged=new Nt,this.positionChanged=new Nt,this.midiEventsPlayed=new Nt,this.playbackRangeChanged=new Nt,de.debug("AlphaSynth","Initializing player"),this.state=ti.Paused,de.debug("AlphaSynth","Creating output"),this.output=e,de.debug("AlphaSynth","Creating synthesizer"),this._synthesizer=new XQ(this.output.sampleRate),this._sequencer=new UQ(this._synthesizer),de.debug("AlphaSynth","Opening output"),this.output.ready.on(()=>{this.isReady=!0,this.ready.trigger(),this.checkReadyForPlayback()}),this.output.sampleRequest.on(()=>{if(this.state==ti.Playing&&!this._sequencer.isFinished){let i=new Float32Array(ht.MicroBufferSize*ht.MicroBufferCount*ht.AudioChannels),n=0;for(let s=0;s0&&(de.debug("AlphaSynth","Starting countin"),this._sequencer.startCountIn(),this._synthesizer.setupMetronomeChannel(this._countInVolume),this.updateTimePosition(0,!0)),this.output.play(),!0)}playInternal(){this._sequencer.isPlayingOneTimeMidi&&(de.debug("AlphaSynth","Cancelling one time midi"),this.stopOneTimeMidi()),de.debug("AlphaSynth","Starting playback"),this._synthesizer.setupMetronomeChannel(this.metronomeVolume),this.state=ti.Playing,this.stateChanged.trigger(new wp(this.state,!1))}pause(){this.state===ti.Paused||!this._isMidiLoaded||(de.debug("AlphaSynth","Pausing playback"),this.state=ti.Paused,this.stateChanged.trigger(new wp(this.state,!1)),this.output.pause(),this._synthesizer.noteOffAll(!1))}playPause(){this.state!==ti.Paused||!this._isMidiLoaded?this.pause():this.play()}stop(){this._isMidiLoaded&&(de.debug("AlphaSynth","Stopping playback"),this.state=ti.Paused,this.output.pause(),this._notPlayedSamples=0,this._sequencer.stop(),this._synthesizer.noteOffAll(!0),this.tickPosition=this._sequencer.mainPlaybackRange?this._sequencer.mainPlaybackRange.startTick:0,this.stateChanged.trigger(new wp(this.state,!0)))}playOneTimeMidiFile(e){this._sequencer.isPlayingOneTimeMidi?this.stopOneTimeMidi():this.pause(),this._sequencer.loadOneTimeMidi(e),this._synthesizer.noteOffAll(!0),this.updateTimePosition(0,!0),this._notPlayedSamples=0,this.output.resetSamples(),this.output.play()}resetSoundFonts(){this.stop(),this._synthesizer.resetPresets(),this._isSoundFontLoaded=!1,this.soundFontLoaded.trigger()}loadSoundFont(e,r){this.pause();let i=Di.fromBuffer(e);try{de.debug("AlphaSynth","Loading soundfont from bytes");let n=new OS;n.load(i),this._synthesizer.loadPresets(n,r),this._isSoundFontLoaded=!0,this.soundFontLoaded.trigger(),de.debug("AlphaSynth","soundFont successfully loaded"),this.checkReadyForPlayback()}catch(n){de.error("AlphaSynth","Could not load soundfont from bytes "+n),this.soundFontLoadFailed.trigger(n)}}checkReadyForPlayback(){this.isReadyForPlayback&&(this._synthesizer.setupMetronomeChannel(this.metronomeVolume),this.readyForPlayback.trigger())}loadMidiFile(e){this.stop();try{de.debug("AlphaSynth","Loading midi from model"),this._sequencer.loadMidi(e),this._isMidiLoaded=!0,this.midiLoaded.trigger(new gm(0,this._sequencer.currentEndTime,0,this._sequencer.currentEndTick,!1)),de.debug("AlphaSynth","Midi successfully loaded"),this.checkReadyForPlayback(),this.tickPosition=0}catch(r){de.error("AlphaSynth","Could not load midi from model "+r),this.midiLoadFailed.trigger(r)}}applyTranspositionPitches(e){this._synthesizer.applyTranspositionPitches(e)}setChannelMute(e,r){this._synthesizer.channelSetMute(e,r)}resetChannelStates(){this._synthesizer.resetChannelStates()}setChannelSolo(e,r){this._synthesizer.channelSetSolo(e,r)}setChannelVolume(e,r){r=Math.max(r,ht.MinVolume),this._synthesizer.channelSetMixVolume(e,r)}onSamplesPlayed(e){if(e===0)return;let r=e/this._synthesizer.outSampleRate*1e3;this._notPlayedSamples-=e*ht.AudioChannels,this.updateTimePosition(this._timePosition+r,!1),this.checkForFinish()}checkForFinish(){let e=0,r=0;this.playbackRange&&this._sequencer.isPlayingMain?(e=this.playbackRange.startTick,r=this.playbackRange.endTick):r=this._sequencer.currentEndTick,this._tickPosition>=r&&this._notPlayedSamples<=0&&(this._notPlayedSamples=0,this._sequencer.isPlayingCountIn?(de.debug("AlphaSynth","Finished playback (count-in)"),this._sequencer.resetCountIn(),this.timePosition=this._sequencer.currentTime,this.playInternal(),this.output.resetSamples()):this._sequencer.isPlayingOneTimeMidi?(de.debug("AlphaSynth","Finished playback (one time)"),this.output.resetSamples(),this.state=ti.Paused,this.stopOneTimeMidi()):(de.debug("AlphaSynth","Finished playback (main)"),this.finished.trigger(),this.isLooping?this.tickPosition=e:this.stop()))}stopOneTimeMidi(){this.output.pause(),this._synthesizer.noteOffAll(!0),this._sequencer.resetOneTimeMidi(),this.timePosition=this._sequencer.currentTime}updateTimePosition(e,r){const i=e;this._timePosition=i;const n=this._sequencer.currentTimePositionToTickPosition(i);this._tickPosition=n;const s=this._sequencer.currentEndTime,a=this._sequencer.currentEndTick,o=this._sequencer.isPlayingMain?"main":this._sequencer.isPlayingCountIn?"count-in":"one-time";if(de.debug("AlphaSynth",`Position changed: (time: ${i}/${s}, tick: ${n}/${a}, Active Voices: ${this._synthesizer.activeVoiceCount} (${o})`),this._sequencer.isPlayingMain&&this.positionChanged.trigger(new gm(i,s,n,a,r)),r)this._playedEventsQueue.clear();else{const l=new mv;for(;!this._playedEventsQueue.isEmpty&&this._playedEventsQueue.peek().timen.toLowerCase()===e.toLowerCase())]:i;case"number":return e;case"undefined":case"object":return null}throw new gi(mi.Format,`Could not parse enum value '${e}'`)}static forEach(e,r){if(e instanceof Map)e.forEach(r);else if(typeof e=="object")for(const i in e)r(e[i],i)}static getValue(e,r){return e instanceof Map?e.get(r):typeof e=="object"?e[r]:null}}class KQ{constructor(e,r,i){this.text=e,this.startPos=r,this.endPos=i}}class Mc{constructor(e){this.style="normal",this.variant="normal",this.weight="normal",this.stretch="normal",this.lineHeight="normal",this.size="1rem",this.families=[],this.parseOnlyFamilies=!1,this._currentTokenIndex=-1,this._input="",this._currentToken=null,this._input=e,this._tokens=this.splitToTokens(e)}splitToTokens(e){const r=[];let i=0;for(;ii&&r.push(new KQ(e.substring(i,n),i,n)),i=n+1}return r}parse(){var e;if(this.reset(),this._tokens.length===1)switch((e=this._currentToken)==null?void 0:e.text){case"caption":case"icon":case"menu":case"message-box":case"small-caption":case"status-bar":case"inherit":return}this.parseOnlyFamilies||(this.fontStyleVariantWeight(),this.fontSizeLineHeight()),this.fontFamily()}static parseFamilies(e){const r=new Mc(e);return r.parseOnlyFamilies=!0,r.parse(),r.families}fontFamily(){if(!this._currentToken){if(this.parseOnlyFamilies)return;throw new Error("Missing font list")}const e=this._input.substr(this._currentToken.startPos).trim();let r=0;for(;r=3)throw new Error(`Invalid font size '${this._currentToken}' specified`);if(this.nextToken(),e.length>=2)if(e[1]==="/"){if(!this._currentToken)throw new Error("Missing line-height after font size");this.lineHeight=this._currentToken.text,this.nextToken()}else this.size=e[0],this.lineHeight=e[1];else if(e.length>=1){if(this.size=e[0],this._currentToken&&this._currentToken.text.indexOf("/")===0)if(this._currentToken.text==="/"){if(this.nextToken(),!this._currentToken)throw new Error("Missing line-height after font size");this.lineHeight=this._currentToken.text,this.nextToken()}else this.lineHeight=this._currentToken.text.substr(1),this.nextToken()}else throw new Error("Missing font size")}nextToken(){this._currentTokenIndex++,this._currentTokenIndex0;){const a=s.pop();i?r?e||(this.style=a):this.variant=a:this.weight=a}}reset(){this._currentTokenIndex=-1,this.nextToken()}static quoteFont(e){return e.indexOf(" ")===-1?e:`"${e.replaceAll('"','\\"')}"`}}var vr;(function(t){t[t.Plain=0]="Plain",t[t.Italic=1]="Italic"})(vr||(vr={}));var Tn;(function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold"})(Tn||(Tn={}));class Mt{reset(){this._cssScale=0,this._css=this.toCssString()}get family(){return this._families[0]}set family(e){this.families=Mc.parseFamilies(e)}get families(){return this._families}set families(e){this._families=e,this.reset()}get size(){return this._size}set size(e){this._size=e,this.reset()}get style(){return this._style}set style(e){this._style=e,this.reset()}get weight(){return this._weight}set weight(e){this._weight=e,this.reset()}get isBold(){return this.weight===Tn.Bold}get isItalic(){return this.style===vr.Italic}constructor(e,r,i=vr.Plain,n=Tn.Regular){this._cssScale=0,this._families=Mc.parseFamilies(e),this._size=r,this._style=i,this._weight=n,this._css=this.toCssString()}static withFamilyList(e,r,i=vr.Plain,n=Tn.Regular){const s=new Mt("",r,i,n);return s.families=e,s}toCssString(e=1){if(!this._css||!(Math.abs(e-this._cssScale)<.01)){let r="";this.isBold&&(r+="bold "),this.isItalic&&(r+="italic "),r+=this.size*e,r+="px ",r+=this.families.map(i=>Mc.quoteFont(i)).join(", "),this._css=r,this._cssScale=e}return this._css}static fromJson(e){switch(typeof e){case"undefined":return null;case"object":{const r=e;let i=r.get("families"),n=r.get("size"),s=Ne.parseEnum(r.get("style"),vr),a=Ne.parseEnum(r.get("weight"),Tn);return Mt.withFamilyList(i,n,s,a)}case"string":{const r=new Mc(e);r.parse();let i=r.families,n=r.size.toLowerCase(),s=0;switch(n){case"xx-small":s=7;break;case"x-small":s=10;break;case"small":case"smaller":s=13;break;case"medium":s=16;break;case"large":case"larger":s=18;break;case"x-large":s=24;break;case"xx-large":s=32;break;default:try{n.endsWith("em")?s=parseFloat(n.substr(0,n.length-2))*16:n.endsWith("pt")?s=parseFloat(n.substr(0,n.length-2))*16/12:n.endsWith("px")?s=parseFloat(n.substr(0,n.length-2)):s=12}catch{s=12}break}let a=vr.Plain;r.style==="italic"&&(a=vr.Italic);let o=Tn.Regular;switch(r.weight.toLowerCase()){case"normal":case"lighter":break;default:o=Tn.Bold;break}return Mt.withFamilyList(i,s,a,o)}default:return null}}static toJson(e){const r=new Map;return r.set("families",e.families),r.set("size",e.size),r.set("style",e.style),r.set("weight",e.weight),r}}class ln{constructor(){this.copyrightFont=new Mt(ln.sansFont,12,vr.Plain,Tn.Bold),this.titleFont=new Mt(ln.serifFont,32,vr.Plain),this.subTitleFont=new Mt(ln.serifFont,20,vr.Plain),this.wordsFont=new Mt(ln.serifFont,15,vr.Plain),this.effectFont=new Mt(ln.serifFont,12,vr.Italic),this.fretboardNumberFont=new Mt(ln.sansFont,11,vr.Plain),this.tablatureFont=new Mt(ln.sansFont,13,vr.Plain),this.graceFont=new Mt(ln.sansFont,11,vr.Plain),this.staffLineColor=new Yt(165,165,165,255),this.barSeparatorColor=new Yt(34,34,17,255),this.barNumberFont=new Mt(ln.sansFont,11,vr.Plain),this.barNumberColor=new Yt(200,0,0,255),this.fingeringFont=new Mt(ln.serifFont,14,vr.Plain),this.markerFont=new Mt(ln.serifFont,14,vr.Plain,Tn.Bold),this.mainGlyphColor=new Yt(0,0,0,255),this.secondaryGlyphColor=new Yt(0,0,0,100),this.scoreInfoColor=new Yt(0,0,0,255)}}ln.sansFont="Arial, sans-serif";ln.serifFont="Georgia, serif";var Uo;(function(t){t[t.Automatic=0]="Automatic",t[t.UseModelLayout=1]="UseModelLayout"})(Uo||(Uo={}));class QQ{constructor(){this.scale=1,this.stretchForce=1,this.layoutMode=ja.Page,this.staveProfile=Cn.Default,this.barsPerRow=-1,this.startBar=1,this.barCount=-1,this.barCountPerPartial=10,this.justifyLastSystem=!1,this.resources=new ln,this.padding=null,this.systemsLayoutMode=Uo.Automatic}}class JQ{constructor(){this.encoding="utf-8",this.mergePartGroupsInMusicXml=!1,this.beatTextAsLyrics=!1}}var Ia;(function(t){t[t.Off=0]="Off",t[t.Continuous=1]="Continuous",t[t.OffScreen=2]="OffScreen"})(Ia||(Ia={}));class ZQ{constructor(){this.noteWideLength=480,this.noteWideAmplitude=2,this.noteSlightLength=480,this.noteSlightAmplitude=2,this.beatWideLength=240,this.beatWideAmplitude=3,this.beatSlightLength=240,this.beatSlightAmplitude=3}}class eJ{constructor(){this.simpleSlidePitchOffset=6,this.simpleSlideDurationRatio=.25,this.shiftSlideDurationRatio=.5}}var wh;(function(t){t[t.WebAudioAudioWorklets=0]="WebAudioAudioWorklets",t[t.WebAudioScriptProcessor=1]="WebAudioScriptProcessor"})(wh||(wh={}));class tJ{constructor(){this.soundFont=null,this.scrollElement="html,body",this.outputMode=wh.WebAudioAudioWorklets,this.enablePlayer=!1,this.enableCursor=!0,this.enableAnimatedBeatCursor=!0,this.enableElementHighlighting=!0,this.enableUserInteraction=!0,this.scrollOffsetX=0,this.scrollOffsetY=0,this.scrollMode=Ia.Continuous,this.scrollSpeed=300,this.nativeBrowserSmoothScroll=!0,this.songBookBendDuration=75,this.songBookDipDuration=150,this.vibrato=new ZQ,this.slide=new eJ,this.playTripletFeel=!0,this.bufferTimeInMilliseconds=500}}class db{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("scriptfile",e.scriptFile),r.set("fontdirectory",e.fontDirectory),r.set("file",e.file),r.set("tex",e.tex),r.set("tracks",e.tracks),r.set("enablelazyloading",e.enableLazyLoading),r.set("engine",e.engine),r.set("loglevel",e.logLevel),r.set("useworkers",e.useWorkers),r.set("includenotebounds",e.includeNoteBounds),r}static setProperty(e,r,i){switch(r){case"scriptfile":return e.scriptFile=i,!0;case"fontdirectory":return e.fontDirectory=i,!0;case"file":return e.file=i,!0;case"tex":return e.tex=i,!0;case"tracks":return e.tracks=i,!0;case"enablelazyloading":return e.enableLazyLoading=i,!0;case"engine":return e.engine=i,!0;case"loglevel":return e.logLevel=Ne.parseEnum(i,Gs),!0;case"useworkers":return e.useWorkers=i,!0;case"includenotebounds":return e.includeNoteBounds=i,!0}return!1}}class hb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("copyrightfont",Mt.toJson(e.copyrightFont)),r.set("titlefont",Mt.toJson(e.titleFont)),r.set("subtitlefont",Mt.toJson(e.subTitleFont)),r.set("wordsfont",Mt.toJson(e.wordsFont)),r.set("effectfont",Mt.toJson(e.effectFont)),r.set("fretboardnumberfont",Mt.toJson(e.fretboardNumberFont)),r.set("tablaturefont",Mt.toJson(e.tablatureFont)),r.set("gracefont",Mt.toJson(e.graceFont)),r.set("stafflinecolor",Yt.toJson(e.staffLineColor)),r.set("barseparatorcolor",Yt.toJson(e.barSeparatorColor)),r.set("barnumberfont",Mt.toJson(e.barNumberFont)),r.set("barnumbercolor",Yt.toJson(e.barNumberColor)),r.set("fingeringfont",Mt.toJson(e.fingeringFont)),r.set("markerfont",Mt.toJson(e.markerFont)),r.set("mainglyphcolor",Yt.toJson(e.mainGlyphColor)),r.set("secondaryglyphcolor",Yt.toJson(e.secondaryGlyphColor)),r.set("scoreinfocolor",Yt.toJson(e.scoreInfoColor)),r}static setProperty(e,r,i){switch(r){case"copyrightfont":return e.copyrightFont=Mt.fromJson(i),!0;case"titlefont":return e.titleFont=Mt.fromJson(i),!0;case"subtitlefont":return e.subTitleFont=Mt.fromJson(i),!0;case"wordsfont":return e.wordsFont=Mt.fromJson(i),!0;case"effectfont":return e.effectFont=Mt.fromJson(i),!0;case"fretboardnumberfont":return e.fretboardNumberFont=Mt.fromJson(i),!0;case"tablaturefont":return e.tablatureFont=Mt.fromJson(i),!0;case"gracefont":return e.graceFont=Mt.fromJson(i),!0;case"stafflinecolor":return e.staffLineColor=Yt.fromJson(i),!0;case"barseparatorcolor":return e.barSeparatorColor=Yt.fromJson(i),!0;case"barnumberfont":return e.barNumberFont=Mt.fromJson(i),!0;case"barnumbercolor":return e.barNumberColor=Yt.fromJson(i),!0;case"fingeringfont":return e.fingeringFont=Mt.fromJson(i),!0;case"markerfont":return e.markerFont=Mt.fromJson(i),!0;case"mainglyphcolor":return e.mainGlyphColor=Yt.fromJson(i),!0;case"secondaryglyphcolor":return e.secondaryGlyphColor=Yt.fromJson(i),!0;case"scoreinfocolor":return e.scoreInfoColor=Yt.fromJson(i),!0}return!1}}class fb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("scale",e.scale),r.set("stretchforce",e.stretchForce),r.set("layoutmode",e.layoutMode),r.set("staveprofile",e.staveProfile),r.set("barsperrow",e.barsPerRow),r.set("startbar",e.startBar),r.set("barcount",e.barCount),r.set("barcountperpartial",e.barCountPerPartial),r.set("justifylastsystem",e.justifyLastSystem),r.set("resources",hb.toJson(e.resources)),r.set("padding",e.padding),r.set("systemslayoutmode",e.systemsLayoutMode),r}static setProperty(e,r,i){switch(r){case"scale":return e.scale=i,!0;case"stretchforce":return e.stretchForce=i,!0;case"layoutmode":return e.layoutMode=Ne.parseEnum(i,ja),!0;case"staveprofile":return e.staveProfile=Ne.parseEnum(i,Cn),!0;case"barsperrow":return e.barsPerRow=i,!0;case"startbar":return e.startBar=i,!0;case"barcount":return e.barCount=i,!0;case"barcountperpartial":return e.barCountPerPartial=i,!0;case"justifylastsystem":return e.justifyLastSystem=i,!0;case"padding":return e.padding=i,!0;case"systemslayoutmode":return e.systemsLayoutMode=Ne.parseEnum(i,Uo),!0}if(["resources"].indexOf(r)>=0)return hb.fromJson(e.resources,i),!0;for(const n of["resources"])if(r.indexOf(n)===0&&hb.setProperty(e.resources,r.substring(n.length),i))return!0;return!1}}class pb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;r.set("notationmode",e.notationMode),r.set("fingeringmode",e.fingeringMode);{const i=new Map;r.set("elements",i);for(const[n,s]of e.elements)i.set(n.toString(),s)}return r.set("rhythmmode",e.rhythmMode),r.set("rhythmheight",e.rhythmHeight),r.set("transpositionpitches",e.transpositionPitches),r.set("displaytranspositionpitches",e.displayTranspositionPitches),r.set("smallgracetabnotes",e.smallGraceTabNotes),r.set("extendbendarrowsontiednotes",e.extendBendArrowsOnTiedNotes),r.set("extendlineeffectstobeatend",e.extendLineEffectsToBeatEnd),r.set("slurheight",e.slurHeight),r}static setProperty(e,r,i){switch(r){case"notationmode":return e.notationMode=Ne.parseEnum(i,si),!0;case"fingeringmode":return e.fingeringMode=Ne.parseEnum(i,ta),!0;case"elements":return e.elements=new Map,Ne.forEach(i,(n,s)=>{e.elements.set(Ne.parseEnum(s,tt),n)}),!0;case"rhythmmode":return e.rhythmMode=Ne.parseEnum(i,za),!0;case"rhythmheight":return e.rhythmHeight=i,!0;case"transpositionpitches":return e.transpositionPitches=i,!0;case"displaytranspositionpitches":return e.displayTranspositionPitches=i,!0;case"smallgracetabnotes":return e.smallGraceTabNotes=i,!0;case"extendbendarrowsontiednotes":return e.extendBendArrowsOnTiedNotes=i,!0;case"extendlineeffectstobeatend":return e.extendLineEffectsToBeatEnd=i,!0;case"slurheight":return e.slurHeight=i,!0}return!1}}class mb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("encoding",e.encoding),r.set("mergepartgroupsinmusicxml",e.mergePartGroupsInMusicXml),r.set("beattextaslyrics",e.beatTextAsLyrics),r}static setProperty(e,r,i){switch(r){case"encoding":return e.encoding=i,!0;case"mergepartgroupsinmusicxml":return e.mergePartGroupsInMusicXml=i,!0;case"beattextaslyrics":return e.beatTextAsLyrics=i,!0}return!1}}class gb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("notewidelength",e.noteWideLength),r.set("notewideamplitude",e.noteWideAmplitude),r.set("noteslightlength",e.noteSlightLength),r.set("noteslightamplitude",e.noteSlightAmplitude),r.set("beatwidelength",e.beatWideLength),r.set("beatwideamplitude",e.beatWideAmplitude),r.set("beatslightlength",e.beatSlightLength),r.set("beatslightamplitude",e.beatSlightAmplitude),r}static setProperty(e,r,i){switch(r){case"notewidelength":return e.noteWideLength=i,!0;case"notewideamplitude":return e.noteWideAmplitude=i,!0;case"noteslightlength":return e.noteSlightLength=i,!0;case"noteslightamplitude":return e.noteSlightAmplitude=i,!0;case"beatwidelength":return e.beatWideLength=i,!0;case"beatwideamplitude":return e.beatWideAmplitude=i,!0;case"beatslightlength":return e.beatSlightLength=i,!0;case"beatslightamplitude":return e.beatSlightAmplitude=i,!0}return!1}}class yb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("simpleslidepitchoffset",e.simpleSlidePitchOffset),r.set("simpleslidedurationratio",e.simpleSlideDurationRatio),r.set("shiftslidedurationratio",e.shiftSlideDurationRatio),r}static setProperty(e,r,i){switch(r){case"simpleslidepitchoffset":return e.simpleSlidePitchOffset=i,!0;case"simpleslidedurationratio":return e.simpleSlideDurationRatio=i,!0;case"shiftslidedurationratio":return e.shiftSlideDurationRatio=i,!0}return!1}}class bb{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("soundfont",e.soundFont),r.set("outputmode",e.outputMode),r.set("enableplayer",e.enablePlayer),r.set("enablecursor",e.enableCursor),r.set("enableanimatedbeatcursor",e.enableAnimatedBeatCursor),r.set("enableelementhighlighting",e.enableElementHighlighting),r.set("enableuserinteraction",e.enableUserInteraction),r.set("scrolloffsetx",e.scrollOffsetX),r.set("scrolloffsety",e.scrollOffsetY),r.set("scrollmode",e.scrollMode),r.set("scrollspeed",e.scrollSpeed),r.set("nativebrowsersmoothscroll",e.nativeBrowserSmoothScroll),r.set("songbookbendduration",e.songBookBendDuration),r.set("songbookdipduration",e.songBookDipDuration),r.set("vibrato",gb.toJson(e.vibrato)),r.set("slide",yb.toJson(e.slide)),r.set("playtripletfeel",e.playTripletFeel),r.set("buffertimeinmilliseconds",e.bufferTimeInMilliseconds),r}static setProperty(e,r,i){switch(r){case"soundfont":return e.soundFont=i,!0;case"scrollelement":return e.scrollElement=i,!0;case"outputmode":return e.outputMode=Ne.parseEnum(i,wh),!0;case"enableplayer":return e.enablePlayer=i,!0;case"enablecursor":return e.enableCursor=i,!0;case"enableanimatedbeatcursor":return e.enableAnimatedBeatCursor=i,!0;case"enableelementhighlighting":return e.enableElementHighlighting=i,!0;case"enableuserinteraction":return e.enableUserInteraction=i,!0;case"scrolloffsetx":return e.scrollOffsetX=i,!0;case"scrolloffsety":return e.scrollOffsetY=i,!0;case"scrollmode":return e.scrollMode=Ne.parseEnum(i,Ia),!0;case"scrollspeed":return e.scrollSpeed=i,!0;case"nativebrowsersmoothscroll":return e.nativeBrowserSmoothScroll=i,!0;case"songbookbendduration":return e.songBookBendDuration=i,!0;case"songbookdipduration":return e.songBookDipDuration=i,!0;case"playtripletfeel":return e.playTripletFeel=i,!0;case"buffertimeinmilliseconds":return e.bufferTimeInMilliseconds=i,!0}if(["vibrato"].indexOf(r)>=0)return gb.fromJson(e.vibrato,i),!0;for(const n of["vibrato"])if(r.indexOf(n)===0&&gb.setProperty(e.vibrato,r.substring(n.length),i))return!0;if(["slide"].indexOf(r)>=0)return yb.fromJson(e.slide,i),!0;for(const n of["slide"])if(r.indexOf(n)===0&&yb.setProperty(e.slide,r.substring(n.length),i))return!0;return!1}}class uu{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("core",db.toJson(e.core)),r.set("display",fb.toJson(e.display)),r.set("notation",pb.toJson(e.notation)),r.set("importer",mb.toJson(e.importer)),r.set("player",bb.toJson(e.player)),r}static setProperty(e,r,i){if(["core",""].indexOf(r)>=0)return db.fromJson(e.core,i),!0;for(const n of["core",""])if(r.indexOf(n)===0&&db.setProperty(e.core,r.substring(n.length),i))return!0;if(["display",""].indexOf(r)>=0)return fb.fromJson(e.display,i),!0;for(const n of["display",""])if(r.indexOf(n)===0&&fb.setProperty(e.display,r.substring(n.length),i))return!0;if(["notation"].indexOf(r)>=0)return pb.fromJson(e.notation,i),!0;for(const n of["notation"])if(r.indexOf(n)===0&&pb.setProperty(e.notation,r.substring(n.length),i))return!0;if(["importer"].indexOf(r)>=0)return mb.fromJson(e.importer,i),!0;for(const n of["importer"])if(r.indexOf(n)===0&&mb.setProperty(e.importer,r.substring(n.length),i))return!0;if(["player"].indexOf(r)>=0)return bb.fromJson(e.player,i),!0;for(const n of["player"])if(r.indexOf(n)===0&&bb.setProperty(e.player,r.substring(n.length),i))return!0;return!1}}class Wl{constructor(){this.core=new VM,this.display=new QQ,this.notation=new mh,this.importer=new JQ,this.player=new tJ}setSongBookModeSettings(){this.notation.notationMode=si.SongBook,this.notation.smallGraceTabNotes=!1,this.notation.fingeringMode=ta.SingleNoteEffectBand,this.notation.extendBendArrowsOnTiedNotes=!1,this.notation.elements.set(tt.ParenthesisOnTiedBends,!1),this.notation.elements.set(tt.TabNotesOnTiedBends,!1),this.notation.elements.set(tt.ZerosOnDiveWhammys,!0)}static get songBook(){let e=new Wl;return e.setSongBookModeSettings(),e}fillFromJson(e){uu.fromJson(this,e)}}class HC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("marker",e.marker),r.set("text",e.text),r}static setProperty(e,r,i){switch(r){case"marker":return e.marker=i,!0;case"text":return e.text=i,!0}return!1}}class ym{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("islinear",e.isLinear),r.set("type",e.type),r.set("value",e.value),r.set("ratioposition",e.ratioPosition),r.set("text",e.text),r}static setProperty(e,r,i){switch(r){case"islinear":return e.isLinear=i,!0;case"type":return e.type=Ne.parseEnum(i,ai),!0;case"value":return e.value=i,!0;case"ratioposition":return e.ratioPosition=i,!0;case"text":return e.text=i,!0}return!1}}class UC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("type",e.type),r.set("length",e.length),r}static setProperty(e,r,i){switch(r){case"type":return e.type=Ne.parseEnum(i,Qs),!0;case"length":return e.length=i,!0}return!1}}class GC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;if(r.set("alternateendings",e.alternateEndings),r.set("keysignature",e.keySignature),r.set("keysignaturetype",e.keySignatureType),r.set("isdoublebar",e.isDoubleBar),r.set("isrepeatstart",e.isRepeatStart),r.set("repeatcount",e.repeatCount),r.set("timesignaturenumerator",e.timeSignatureNumerator),r.set("timesignaturedenominator",e.timeSignatureDenominator),r.set("timesignaturecommon",e.timeSignatureCommon),r.set("tripletfeel",e.tripletFeel),r.set("section",HC.toJson(e.section)),r.set("tempoautomation",ym.toJson(e.tempoAutomation)),e.fermata!==null){const i=new Map;r.set("fermata",i);for(const[n,s]of e.fermata)i.set(n.toString(),UC.toJson(s))}return r.set("start",e.start),r.set("isanacrusis",e.isAnacrusis),r.set("displayscale",e.displayScale),r.set("displaywidth",e.displayWidth),r}static setProperty(e,r,i){switch(r){case"alternateendings":return e.alternateEndings=i,!0;case"keysignature":return e.keySignature=Ne.parseEnum(i,Zr),!0;case"keysignaturetype":return e.keySignatureType=Ne.parseEnum(i,Ho),!0;case"isdoublebar":return e.isDoubleBar=i,!0;case"isrepeatstart":return e.isRepeatStart=i,!0;case"repeatcount":return e.repeatCount=i,!0;case"timesignaturenumerator":return e.timeSignatureNumerator=i,!0;case"timesignaturedenominator":return e.timeSignatureDenominator=i,!0;case"timesignaturecommon":return e.timeSignatureCommon=i,!0;case"tripletfeel":return e.tripletFeel=Ne.parseEnum(i,gt),!0;case"fermata":return e.fermata=new Map,Ne.forEach(i,(n,s)=>{const a=new DS;UC.fromJson(a,n),e.addFermata(parseInt(s),a)}),!0;case"start":return e.start=i,!0;case"isanacrusis":return e.isAnacrusis=i,!0;case"displayscale":return e.displayScale=i,!0;case"displaywidth":return e.displayWidth=i,!0}return["section"].indexOf(r)>=0?(i?(e.section=new iy,HC.fromJson(e.section,i)):e.section=null,!0):["tempoautomation"].indexOf(r)>=0?(i?(e.tempoAutomation=new Ei,ym.fromJson(e.tempoAutomation,i)):e.tempoAutomation=null,!0):!1}}class bm{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("offset",e.offset),r.set("value",e.value),r}static setProperty(e,r,i){switch(r){case"offset":return e.offset=i,!0;case"value":return e.value=i,!0}return!1}}class jC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){var i;if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("accentuated",e.accentuated),r.set("bendtype",e.bendType),r.set("bendstyle",e.bendStyle),r.set("iscontinuedbend",e.isContinuedBend),e.bendPoints!==null&&r.set("bendpoints",(i=e.bendPoints)==null?void 0:i.map(n=>bm.toJson(n))),r.set("fret",e.fret),r.set("string",e.string),r.set("octave",e.octave),r.set("tone",e.tone),r.set("percussionarticulation",e.percussionArticulation),r.set("isvisible",e.isVisible),r.set("islefthandtapped",e.isLeftHandTapped),r.set("ishammerpullorigin",e.isHammerPullOrigin),r.set("isslurdestination",e.isSlurDestination),r.set("harmonictype",e.harmonicType),r.set("harmonicvalue",e.harmonicValue),r.set("isghost",e.isGhost),r.set("isletring",e.isLetRing),r.set("ispalmmute",e.isPalmMute),r.set("isdead",e.isDead),r.set("isstaccato",e.isStaccato),r.set("slideintype",e.slideInType),r.set("slideouttype",e.slideOutType),r.set("vibrato",e.vibrato),r.set("istiedestination",e.isTieDestination),r.set("lefthandfinger",e.leftHandFinger),r.set("righthandfinger",e.rightHandFinger),r.set("isfingering",e.isFingering),r.set("trillvalue",e.trillValue),r.set("trillspeed",e.trillSpeed),r.set("durationpercent",e.durationPercent),r.set("accidentalmode",e.accidentalMode),r.set("dynamics",e.dynamics),e.toJson(r),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"accentuated":return e.accentuated=Ne.parseEnum(i,jr),!0;case"bendtype":return e.bendType=Ne.parseEnum(i,ze),!0;case"bendstyle":return e.bendStyle=Ne.parseEnum(i,Gt),!0;case"iscontinuedbend":return e.isContinuedBend=i,!0;case"bendpoints":if(i){e.bendPoints=[];for(const n of i){const s=new Re;bm.fromJson(s,n),e.addBendPoint(s)}}return!0;case"fret":return e.fret=i,!0;case"string":return e.string=i,!0;case"octave":return e.octave=i,!0;case"tone":return e.tone=i,!0;case"percussionarticulation":return e.percussionArticulation=i,!0;case"isvisible":return e.isVisible=i,!0;case"islefthandtapped":return e.isLeftHandTapped=i,!0;case"ishammerpullorigin":return e.isHammerPullOrigin=i,!0;case"isslurdestination":return e.isSlurDestination=i,!0;case"harmonictype":return e.harmonicType=Ne.parseEnum(i,Xe),!0;case"harmonicvalue":return e.harmonicValue=i,!0;case"isghost":return e.isGhost=i,!0;case"isletring":return e.isLetRing=i,!0;case"ispalmmute":return e.isPalmMute=i,!0;case"isdead":return e.isDead=i,!0;case"isstaccato":return e.isStaccato=i,!0;case"slideintype":return e.slideInType=Ne.parseEnum(i,pi),!0;case"slideouttype":return e.slideOutType=Ne.parseEnum(i,ut),!0;case"vibrato":return e.vibrato=Ne.parseEnum(i,Dt),!0;case"istiedestination":return e.isTieDestination=i,!0;case"lefthandfinger":return e.leftHandFinger=Ne.parseEnum(i,at),!0;case"righthandfinger":return e.rightHandFinger=Ne.parseEnum(i,at),!0;case"isfingering":return e.isFingering=i,!0;case"trillvalue":return e.trillValue=i,!0;case"trillspeed":return e.trillSpeed=Ne.parseEnum(i,H),!0;case"durationpercent":return e.durationPercent=i,!0;case"accidentalmode":return e.accidentalMode=Ne.parseEnum(i,Or),!0;case"dynamics":return e.dynamics=Ne.parseEnum(i,yt),!0}return e.setProperty(r,i)}}class YC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){var i;if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("notes",e.notes.map(n=>jC.toJson(n))),r.set("isempty",e.isEmpty),r.set("whammystyle",e.whammyStyle),r.set("ottava",e.ottava),r.set("islegatoorigin",e.isLegatoOrigin),r.set("duration",e.duration),r.set("automations",e.automations.map(n=>ym.toJson(n))),r.set("dots",e.dots),r.set("fadein",e.fadeIn),r.set("lyrics",e.lyrics),r.set("hasrasgueado",e.hasRasgueado),r.set("pop",e.pop),r.set("slap",e.slap),r.set("tap",e.tap),r.set("text",e.text),r.set("brushtype",e.brushType),r.set("brushduration",e.brushDuration),r.set("tupletdenominator",e.tupletDenominator),r.set("tupletnumerator",e.tupletNumerator),r.set("iscontinuedwhammy",e.isContinuedWhammy),r.set("whammybartype",e.whammyBarType),e.whammyBarPoints!==null&&r.set("whammybarpoints",(i=e.whammyBarPoints)==null?void 0:i.map(n=>bm.toJson(n))),r.set("vibrato",e.vibrato),r.set("chordid",e.chordId),r.set("gracetype",e.graceType),r.set("pickstroke",e.pickStroke),r.set("tremolospeed",e.tremoloSpeed),r.set("crescendo",e.crescendo),r.set("displaystart",e.displayStart),r.set("playbackstart",e.playbackStart),r.set("displayduration",e.displayDuration),r.set("playbackduration",e.playbackDuration),r.set("dynamics",e.dynamics),r.set("invertbeamdirection",e.invertBeamDirection),r.set("preferredbeamdirection",e.preferredBeamDirection),r.set("beamingmode",e.beamingMode),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"notes":e.notes=[];for(const n of i){const s=new kr;jC.fromJson(s,n),e.addNote(s)}return!0;case"isempty":return e.isEmpty=i,!0;case"whammystyle":return e.whammyStyle=Ne.parseEnum(i,Gt),!0;case"ottava":return e.ottava=Ne.parseEnum(i,Ft),!0;case"islegatoorigin":return e.isLegatoOrigin=i,!0;case"duration":return e.duration=Ne.parseEnum(i,H),!0;case"automations":e.automations=[];for(const n of i){const s=new Ei;ym.fromJson(s,n),e.automations.push(s)}return!0;case"dots":return e.dots=i,!0;case"fadein":return e.fadeIn=i,!0;case"lyrics":return e.lyrics=i,!0;case"hasrasgueado":return e.hasRasgueado=i,!0;case"pop":return e.pop=i,!0;case"slap":return e.slap=i,!0;case"tap":return e.tap=i,!0;case"text":return e.text=i,!0;case"brushtype":return e.brushType=Ne.parseEnum(i,ir),!0;case"brushduration":return e.brushDuration=i,!0;case"tupletdenominator":return e.tupletDenominator=i,!0;case"tupletnumerator":return e.tupletNumerator=i,!0;case"iscontinuedwhammy":return e.isContinuedWhammy=i,!0;case"whammybartype":return e.whammyBarType=Ne.parseEnum(i,Lt),!0;case"whammybarpoints":if(i){e.whammyBarPoints=[];for(const n of i){const s=new Re;bm.fromJson(s,n),e.addWhammyBarPoint(s)}}return!0;case"vibrato":return e.vibrato=Ne.parseEnum(i,Dt),!0;case"chordid":return e.chordId=i,!0;case"gracetype":return e.graceType=Ne.parseEnum(i,Je),!0;case"pickstroke":return e.pickStroke=Ne.parseEnum(i,Bi),!0;case"tremolospeed":return e.tremoloSpeed=Ne.parseEnum(i,H),!0;case"crescendo":return e.crescendo=Ne.parseEnum(i,pn),!0;case"displaystart":return e.displayStart=i,!0;case"playbackstart":return e.playbackStart=i,!0;case"displayduration":return e.displayDuration=i,!0;case"playbackduration":return e.playbackDuration=i,!0;case"dynamics":return e.dynamics=Ne.parseEnum(i,yt),!0;case"invertbeamdirection":return e.invertBeamDirection=i,!0;case"preferredbeamdirection":return e.preferredBeamDirection=Ne.parseEnum(i,ve),!0;case"beamingmode":return e.beamingMode=Ne.parseEnum(i,js),!0}return!1}}class XC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("beats",e.beats.map(i=>YC.toJson(i))),r.set("isempty",e.isEmpty),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"beats":e.beats=[];for(const n of i){const s=new Mi;YC.fromJson(s,n),e.addBeat(s)}return!0;case"isempty":return e.isEmpty=i,!0}return!1}}class qC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("clef",e.clef),r.set("clefottava",e.clefOttava),r.set("voices",e.voices.map(i=>XC.toJson(i))),r.set("similemark",e.simileMark),r.set("displayscale",e.displayScale),r.set("displaywidth",e.displayWidth),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"clef":return e.clef=Ne.parseEnum(i,ot),!0;case"clefottava":return e.clefOttava=Ne.parseEnum(i,Ft),!0;case"voices":e.voices=[];for(const n of i){const s=new Ba;XC.fromJson(s,n),e.addVoice(s)}return!0;case"similemark":return e.simileMark=Ne.parseEnum(i,qn),!0;case"displayscale":return e.displayScale=i,!0;case"displaywidth":return e.displayWidth=i,!0}return!1}}class KC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("name",e.name),r.set("firstfret",e.firstFret),r.set("strings",e.strings),r.set("barrefrets",e.barreFrets),r.set("showname",e.showName),r.set("showdiagram",e.showDiagram),r.set("showfingering",e.showFingering),r}static setProperty(e,r,i){switch(r){case"name":return e.name=i,!0;case"firstfret":return e.firstFret=i,!0;case"strings":return e.strings=i,!0;case"barrefrets":return e.barreFrets=i,!0;case"showname":return e.showName=i,!0;case"showdiagram":return e.showDiagram=i,!0;case"showfingering":return e.showFingering=i,!0}return!1}}class QC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("isstandard",e.isStandard),r.set("name",e.name),r.set("tunings",e.tunings),r}static setProperty(e,r,i){switch(r){case"isstandard":return e.isStandard=i,!0;case"name":return e.name=i,!0;case"tunings":return e.tunings=i,!0}return!1}}class JC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;if(r.set("bars",e.bars.map(i=>qC.toJson(i))),e.chords!==null){const i=new Map;r.set("chords",i);for(const[n,s]of e.chords)i.set(n.toString(),KC.toJson(s))}return r.set("capo",e.capo),r.set("transpositionpitch",e.transpositionPitch),r.set("displaytranspositionpitch",e.displayTranspositionPitch),r.set("stringtuning",QC.toJson(e.stringTuning)),r.set("showtablature",e.showTablature),r.set("showstandardnotation",e.showStandardNotation),r.set("ispercussion",e.isPercussion),r.set("standardnotationlinecount",e.standardNotationLineCount),r}static setProperty(e,r,i){switch(r){case"bars":e.bars=[];for(const n of i){const s=new so;qC.fromJson(s,n),e.addBar(s)}return!0;case"chords":return e.chords=new Map,Ne.forEach(i,(n,s)=>{const a=new Wo;KC.fromJson(a,n),e.addChord(s,a)}),!0;case"capo":return e.capo=i,!0;case"transpositionpitch":return e.transpositionPitch=i,!0;case"displaytranspositionpitch":return e.displayTranspositionPitch=i,!0;case"showtablature":return e.showTablature=i,!0;case"showstandardnotation":return e.showStandardNotation=i,!0;case"ispercussion":return e.isPercussion=i,!0;case"standardnotationlinecount":return e.standardNotationLineCount=i,!0}return["stringtuning"].indexOf(r)>=0?(QC.fromJson(e.stringTuning,i),!0):!1}}class ZC{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("volume",e.volume),r.set("balance",e.balance),r.set("port",e.port),r.set("program",e.program),r.set("primarychannel",e.primaryChannel),r.set("secondarychannel",e.secondaryChannel),r.set("ismute",e.isMute),r.set("issolo",e.isSolo),r}static setProperty(e,r,i){switch(r){case"volume":return e.volume=i,!0;case"balance":return e.balance=i,!0;case"port":return e.port=i,!0;case"program":return e.program=i,!0;case"primarychannel":return e.primaryChannel=i,!0;case"secondarychannel":return e.secondaryChannel=i,!0;case"ismute":return e.isMute=i,!0;case"issolo":return e.isSolo=i,!0}return!1}}class eT{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("elementtype",e.elementType),r.set("staffline",e.staffLine),r.set("noteheaddefault",e.noteHeadDefault),r.set("noteheadhalf",e.noteHeadHalf),r.set("noteheadwhole",e.noteHeadWhole),r.set("techniquesymbol",e.techniqueSymbol),r.set("techniquesymbolplacement",e.techniqueSymbolPlacement),r.set("outputmidinumber",e.outputMidiNumber),r}static setProperty(e,r,i){switch(r){case"elementtype":return e.elementType=i,!0;case"staffline":return e.staffLine=i,!0;case"noteheaddefault":return e.noteHeadDefault=Ne.parseEnum(i,B),!0;case"noteheadhalf":return e.noteHeadHalf=Ne.parseEnum(i,B),!0;case"noteheadwhole":return e.noteHeadWhole=Ne.parseEnum(i,B),!0;case"techniquesymbol":return e.techniqueSymbol=Ne.parseEnum(i,B),!0;case"techniquesymbolplacement":return e.techniqueSymbolPlacement=Ne.parseEnum(i,ft),!0;case"outputmidinumber":return e.outputMidiNumber=i,!0}return!1}}class tT{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("staves",e.staves.map(i=>JC.toJson(i))),r.set("playbackinfo",ZC.toJson(e.playbackInfo)),r.set("color",Yt.toJson(e.color)),r.set("name",e.name),r.set("shortname",e.shortName),r.set("defaultsystemslayout",e.defaultSystemsLayout),r.set("systemslayout",e.systemsLayout),r.set("percussionarticulations",e.percussionArticulations.map(i=>eT.toJson(i))),r}static setProperty(e,r,i){switch(r){case"staves":e.staves=[];for(const n of i){const s=new eM;JC.fromJson(s,n),e.addStaff(s)}return!0;case"color":return e.color=Yt.fromJson(i),!0;case"name":return e.name=i,!0;case"shortname":return e.shortName=i,!0;case"defaultsystemslayout":return e.defaultSystemsLayout=i,!0;case"systemslayout":return e.systemsLayout=i,!0;case"percussionarticulations":e.percussionArticulations=[];for(const n of i){const s=new Le;eT.fromJson(s,n),e.percussionArticulations.push(s)}return!0}return["playbackinfo"].indexOf(r)>=0?(ZC.fromJson(e.playbackInfo,i),!0):!1}}class rT{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("hidedynamics",e.hideDynamics),r}static setProperty(e,r,i){switch(r){case"hidedynamics":return e.hideDynamics=i,!0}return!1}}class iT{static fromJson(e,r){r&&Ne.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("album",e.album),r.set("artist",e.artist),r.set("copyright",e.copyright),r.set("instructions",e.instructions),r.set("music",e.music),r.set("notices",e.notices),r.set("subtitle",e.subTitle),r.set("title",e.title),r.set("words",e.words),r.set("tab",e.tab),r.set("tempo",e.tempo),r.set("tempolabel",e.tempoLabel),r.set("masterbars",e.masterBars.map(i=>GC.toJson(i))),r.set("tracks",e.tracks.map(i=>tT.toJson(i))),r.set("defaultsystemslayout",e.defaultSystemsLayout),r.set("systemslayout",e.systemsLayout),r.set("stylesheet",rT.toJson(e.stylesheet)),r}static setProperty(e,r,i){switch(r){case"album":return e.album=i,!0;case"artist":return e.artist=i,!0;case"copyright":return e.copyright=i,!0;case"instructions":return e.instructions=i,!0;case"music":return e.music=i,!0;case"notices":return e.notices=i,!0;case"subtitle":return e.subTitle=i,!0;case"title":return e.title=i,!0;case"words":return e.words=i,!0;case"tab":return e.tab=i,!0;case"tempo":return e.tempo=i,!0;case"tempolabel":return e.tempoLabel=i,!0;case"masterbars":e.masterBars=[];for(const n of i){const s=new eo;GC.fromJson(s,n),e.addMasterBar(s)}return!0;case"tracks":e.tracks=[];for(const n of i){const s=new _a;tT.fromJson(s,n),e.addTrack(s)}return!0;case"defaultsystemslayout":return e.defaultSystemsLayout=i,!0;case"systemslayout":return e.systemsLayout=i,!0}return["stylesheet"].indexOf(r)>=0?(rT.fromJson(e.stylesheet,i),!0):!1}}class Ar{static jsonReplacer(e,r){if(r instanceof Map){if("fromEntries"in Object)return Object.fromEntries(r);{const i={};for(const[n,s]of r)i[n]=s;return i}}else if(ArrayBuffer.isView(r))return Array.apply([],[r]);return r}static scoreToJson(e){let r=Ar.scoreToJsObject(e);return JSON.stringify(r,Ar.jsonReplacer)}static jsonToScore(e,r){return Ar.jsObjectToScore(JSON.parse(e),r)}static scoreToJsObject(e){return iT.toJson(e)}static jsObjectToScore(e,r){let i=new Ql;return iT.fromJson(i,e),i.finish(r??new Wl),i}static settingsToJson(e){let r=Ar.settingsToJsObject(e);return JSON.stringify(r,Ar.jsonReplacer)}static jsonToSettings(e){return Ar.jsObjectToSettings(JSON.parse(e))}static settingsToJsObject(e){return uu.toJson(e)}static jsObjectToSettings(e){let r=new Wl;return uu.fromJson(r,e),r}static jsObjectToMidiFile(e){let r=new Fo;return Ne.forEach(e,(i,n)=>{switch(n){case"division":r.division=i;break;case"tracks":for(let s of i){let a=Ar.jsObjectToMidiTrack(s);r.tracks.push(a)}break}}),r}static jsObjectToMidiTrack(e){let r=new nM;return Ne.forEach(e,(i,n)=>{switch(n){case"events":for(let s of i){let a=Ar.jsObjectToMidiEvent(s);r.events.push(a)}break}}),r}static jsObjectToMidiEvent(e){let r=Ne.getValue(e,"track"),i=Ne.getValue(e,"tick"),n=Ne.getValue(e,"type");switch(n){case Bt.TimeSignature:return new sM(r,i,Ne.getValue(e,"numerator"),Ne.getValue(e,"denominatorIndex"),Ne.getValue(e,"midiClocksPerMetronomeClick"),Ne.getValue(e,"thirdySecondNodesInQuarter"));case Bt.AlphaTabRest:return new oM(r,i,Ne.getValue(e,"channel"));case Bt.AlphaTabMetronome:return new aM(r,i,Ne.getValue(e,"metronomeNumerator"),Ne.getValue(e,"metronomeDurationInTicks"),Ne.getValue(e,"metronomeDurationInMilliseconds"));case Bt.NoteOn:return new cM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"noteKey"),Ne.getValue(e,"noteVelocity"));case Bt.NoteOff:return new uM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"noteKey"),Ne.getValue(e,"noteVelocity"));case Bt.ControlChange:return new dM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"controller"),Ne.getValue(e,"value"));case Bt.ProgramChange:return new hM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"program"));case Bt.TempoChange:return new fM(i,Ne.getValue(e,"microSecondsPerQuarterNote"));case Bt.PitchBend:return new pM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"value"));case Bt.PerNotePitchBend:return new mM(r,i,Ne.getValue(e,"channel"),Ne.getValue(e,"noteKey"),Ne.getValue(e,"value"));case Bt.EndOfTrack:return new gM(r,i)}throw new gi(mi.Format,"Unknown Midi Event type: "+n)}static midiFileToJsObject(e){const r=new Map;r.set("division",e.division);const i=[];for(let n of e.tracks)i.push(Ar.midiTrackToJsObject(n));return r.set("tracks",i),r}static midiTrackToJsObject(e){const r=new Map,i=[];for(let n of e.events)i.push(Ar.midiEventToJsObject(n));return r.set("events",i),r}static midiEventToJsObject(e){const r=new Map;switch(r.set("track",e.track),r.set("tick",e.tick),r.set("type",e.type),e.type){case Bt.TimeSignature:r.set("numerator",e.numerator),r.set("denominatorIndex",e.denominatorIndex),r.set("midiClocksPerMetronomeClick",e.midiClocksPerMetronomeClick),r.set("thirdySecondNodesInQuarter",e.thirtySecondNodesInQuarter);break;case Bt.AlphaTabRest:r.set("channel",e.channel);break;case Bt.AlphaTabMetronome:r.set("metronomeNumerator",e.metronomeNumerator),r.set("metronomeDurationInMilliseconds",e.metronomeDurationInMilliseconds),r.set("metronomeDurationInTicks",e.metronomeDurationInTicks);break;case Bt.NoteOn:case Bt.NoteOff:r.set("channel",e.channel),r.set("noteKey",e.noteKey),r.set("noteVelocity",e.noteVelocity);break;case Bt.ControlChange:r.set("channel",e.channel),r.set("controller",e.controller),r.set("value",e.value);break;case Bt.ProgramChange:r.set("channel",e.channel),r.set("program",e.program);break;case Bt.TempoChange:r.set("microSecondsPerQuarterNote",e.microSecondsPerQuarterNote);break;case Bt.PitchBend:r.set("channel",e.channel),r.set("value",e.value);break;case Bt.PerNotePitchBend:r.set("channel",e.channel),r.set("noteKey",e.noteKey),r.set("value",e.value);break;case Bt.EndOfTrack:break}return r}}class pr{constructor(){this.ready=new oi,this.samplesPlayed=new Nt,this.sampleRequest=new oi}get sampleRate(){return pr.preferredSampleRate}open(){de.debug("AlphaSynth","Initializing synth worker"),this._worker=Se.globalThis,this._worker.addEventListener("message",this.handleMessage.bind(this)),this.ready.trigger()}destroy(){this._worker.postMessage({cmd:"alphaSynth.output.destroy"})}handleMessage(e){let r=e.data;switch(r.cmd){case pr.CmdOutputSampleRequest:this.sampleRequest.trigger();break;case pr.CmdOutputSamplesPlayed:this.samplesPlayed.trigger(r.samples);break}}addSamples(e){this._worker.postMessage({cmd:"alphaSynth.output.addSamples",samples:e})}play(){this._worker.postMessage({cmd:"alphaSynth.output.play"})}pause(){this._worker.postMessage({cmd:"alphaSynth.output.pause"})}resetSamples(){this._worker.postMessage({cmd:"alphaSynth.output.resetSamples"})}activate(){}}pr.CmdOutputPrefix="alphaSynth.output.";pr.CmdOutputAddSamples=pr.CmdOutputPrefix+"addSamples";pr.CmdOutputPlay=pr.CmdOutputPrefix+"play";pr.CmdOutputPause=pr.CmdOutputPrefix+"pause";pr.CmdOutputResetSamples=pr.CmdOutputPrefix+"resetSamples";pr.CmdOutputSampleRequest=pr.CmdOutputPrefix+"sampleRequest";pr.CmdOutputSamplesPlayed=pr.CmdOutputPrefix+"samplesPlayed";pr.preferredSampleRate=0;class AS{constructor(e,r){this._main=e,this._main.addEventListener("message",this.handleMessage.bind(this)),this._player=new qQ(new pr,r),this._player.positionChanged.on(this.onPositionChanged.bind(this)),this._player.stateChanged.on(this.onPlayerStateChanged.bind(this)),this._player.finished.on(this.onFinished.bind(this)),this._player.soundFontLoaded.on(this.onSoundFontLoaded.bind(this)),this._player.soundFontLoadFailed.on(this.onSoundFontLoadFailed.bind(this)),this._player.soundFontLoadFailed.on(this.onSoundFontLoadFailed.bind(this)),this._player.midiLoaded.on(this.onMidiLoaded.bind(this)),this._player.midiLoadFailed.on(this.onMidiLoadFailed.bind(this)),this._player.readyForPlayback.on(this.onReadyForPlayback.bind(this)),this._player.midiEventsPlayed.on(this.onMidiEventsPlayed.bind(this)),this._player.playbackRangeChanged.on(this.onPlaybackRangeChanged.bind(this)),this._main.postMessage({cmd:"alphaSynth.ready"})}static init(){let e=Se.globalThis;e.addEventListener("message",r=>{let i=r.data;switch(i.cmd){case"alphaSynth.initialize":pr.preferredSampleRate=i.sampleRate,de.logLevel=i.logLevel,Se.globalThis.alphaSynthWebWorker=new AS(e,i.bufferTimeInMilliseconds);break}})}handleMessage(e){let r=e.data;switch(r.cmd){case"alphaSynth.setLogLevel":de.logLevel=r.value;break;case"alphaSynth.setMasterVolume":this._player.masterVolume=r.value;break;case"alphaSynth.setMetronomeVolume":this._player.metronomeVolume=r.value;break;case"alphaSynth.setPlaybackSpeed":this._player.playbackSpeed=r.value;break;case"alphaSynth.setTickPosition":this._player.tickPosition=r.value;break;case"alphaSynth.setTimePosition":this._player.timePosition=r.value;break;case"alphaSynth.setPlaybackRange":this._player.playbackRange=r.value;break;case"alphaSynth.setIsLooping":this._player.isLooping=r.value;break;case"alphaSynth.setCountInVolume":this._player.countInVolume=r.value;break;case"alphaSynth.setMidiEventsPlayedFilter":this._player.midiEventsPlayedFilter=r.value;break;case"alphaSynth.play":this._player.play();break;case"alphaSynth.pause":this._player.pause();break;case"alphaSynth.playPause":this._player.playPause();break;case"alphaSynth.stop":this._player.stop();break;case"alphaSynth.playOneTimeMidiFile":this._player.playOneTimeMidiFile(Ar.jsObjectToMidiFile(r.midi));break;case"alphaSynth.loadSoundFontBytes":this._player.loadSoundFont(r.data,r.append);break;case"alphaSynth.resetSoundFonts":this._player.resetSoundFonts();break;case"alphaSynth.loadMidi":this._player.loadMidiFile(Ar.jsObjectToMidiFile(r.midi));break;case"alphaSynth.setChannelMute":this._player.setChannelMute(r.channel,r.mute);break;case"alphaSynth.setChannelSolo":this._player.setChannelSolo(r.channel,r.solo);break;case"alphaSynth.setChannelVolume":this._player.setChannelVolume(r.channel,r.volume);break;case"alphaSynth.resetChannelStates":this._player.resetChannelStates();break;case"alphaSynth.destroy":this._player.destroy(),this._main.postMessage({cmd:"alphaSynth.destroyed"});break;case"alphaSynth.applyTranspositionPitches":this._player.applyTranspositionPitches(new Map(JSON.parse(r.transpositionPitches)));break}}onPositionChanged(e){this._main.postMessage({cmd:"alphaSynth.positionChanged",currentTime:e.currentTime,endTime:e.endTime,currentTick:e.currentTick,endTick:e.endTick,isSeek:e.isSeek})}onPlayerStateChanged(e){this._main.postMessage({cmd:"alphaSynth.playerStateChanged",state:e.state,stopped:e.stopped})}onFinished(){this._main.postMessage({cmd:"alphaSynth.finished"})}onSoundFontLoaded(){this._main.postMessage({cmd:"alphaSynth.soundFontLoaded"})}onSoundFontLoadFailed(e){this._main.postMessage({cmd:"alphaSynth.soundFontLoadFailed",error:this.serializeException(e)})}serializeException(e){let r=JSON.parse(JSON.stringify(e));return e.message&&(r.message=e.message),e.stack&&(r.stack=e.stack),e.constructor&&e.constructor.name&&(r.type=e.constructor.name),r}onMidiLoaded(e){this._main.postMessage({cmd:"alphaSynth.midiLoaded",currentTime:e.currentTime,endTime:e.endTime,currentTick:e.currentTick,endTick:e.endTick,isSeek:e.isSeek})}onMidiLoadFailed(e){this._main.postMessage({cmd:"alphaSynth.midiLoaded",error:this.serializeException(e)})}onReadyForPlayback(){this._main.postMessage({cmd:"alphaSynth.readyForPlayback"})}onMidiEventsPlayed(e){this._main.postMessage({cmd:"alphaSynth.midiEventsPlayed",events:e.events.map(Ar.midiEventToJsObject)})}onPlaybackRangeChanged(e){this._main.postMessage({cmd:"alphaSynth.playbackRangeChanged",playbackRange:e.playbackRange})}}class Vr{static generateFontLookup(e){if(!Vr.FontSizeLookupTables.has(e))if(Se.isRunningInWorker)Vr.FontSizeLookupTables.set(e,new Uint8Array([8]));else{let i=document.createElement("canvas").getContext("2d");i.font=`11px ${e}`;let n=[];for(let a=32;a<255;a++){let o=String.fromCharCode(a);n.push(i.measureText(o).width)}let s=new Uint8Array(n);Vr.FontSizeLookupTables.set(e,s)}}static measureString(e,r,i,n,s){let a,o=11,l=r[0];for(let d=0;d=0&&(u+=a[h]*i/o)}return u*c}}Vr.Georgia=new Uint8Array([3,4,5,7,7,9,8,2,4,4,5,7,3,4,3,5,7,5,6,6,6,6,6,6,7,6,3,3,7,7,7,5,10,7,7,7,8,7,7,8,9,4,6,8,7,10,8,8,7,8,8,6,7,8,7,11,8,7,7,4,5,4,7,7,6,6,6,5,6,5,4,6,6,3,3,6,3,10,6,6,6,6,5,5,4,6,5,8,6,5,5,5,4,5,7,6,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,3,4,6,7,6,7,4,6,6,10,6,6,7,0,10,7,5,7,6,6,6,6,6,3,6,6,6,6,12,12,12,5,7,7,7,7,7,7,11,7,7,7,7,7,4,4,4,4,8,8,8,8,8,8,8,7,8,8,8,8,8,7,7,6,6,6,6,6,6,6,8,5,5,5,5,5,3,3,3,3,6,6,6,6,6,6,6,7,6,6,6,6,6,5,6]);Vr.Arial=new Uint8Array([3,3,4,6,6,10,7,2,4,4,4,6,3,4,3,3,6,6,6,6,6,6,6,6,6,6,3,3,6,6,6,6,11,7,7,8,8,7,7,9,8,3,6,7,6,9,8,9,7,9,8,7,7,8,7,10,7,7,7,3,3,3,5,6,4,6,6,6,6,6,3,6,6,2,2,6,2,9,6,6,6,6,4,6,3,6,6,8,6,6,6,4,3,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,6,6,6,6,3,6,4,8,4,6,6,0,8,6,4,6,4,4,4,6,6,4,4,4,4,6,9,9,9,7,7,7,7,7,7,7,11,8,7,7,7,7,3,3,3,3,8,8,9,9,9,9,9,6,9,8,8,8,8,7,7,7,6,6,6,6,6,6,10,6,6,6,6,6,3,3,3,3,6,6,6,6,6,6,6,6,7,6,6,6,6,6,6]);Vr.FontSizeLookupTables=new Map([["Arial",Vr.Arial],["'Arial'",Vr.Arial],['"Arial"',Vr.Arial],["Georgia",Vr.Georgia],["'Georgia'",Vr.Georgia],['"Georgia"',Vr.Georgia]]);Vr.ControlChars=32;class kl{constructor(){this.id=er.newGuid(),this.x=0,this.y=0,this.width=0,this.height=0,this.totalWidth=0,this.totalHeight=0,this.firstMasterBarIndex=-1,this.lastMasterBarIndex=-1,this.renderResult=null}}class wM{constructor(){this.beats=[]}addBeat(e){e.barBounds=this,this.beats.push(e),this.masterBarBounds.addBeat(e)}findBeatAtPos(e){let r=null;for(let i of this.beats)if(!r||i.realBounds.xe)break;return r}finish(){this.beats.sort((e,r)=>e.realBounds.x-r.realBounds.x)}}class SM{constructor(){this.notes=null}addNote(e){this.notes||(this.notes=[]),e.beatBounds=this,this.notes.push(e)}findNoteAtPos(e,r){const i=this.notes;if(!i)return null;for(let n of i){let s=n.noteHeadBounds.y+n.noteHeadBounds.h,a=n.noteHeadBounds.x+n.noteHeadBounds.w;if(n.noteHeadBounds.x<=e&&n.noteHeadBounds.y<=r&&e<=a&&r<=s)return n.note}return null}}class xM{constructor(){this.index=0,this.isFirstOfLine=!1,this.bars=[],this.staveGroupBounds=null}addBar(e){e.masterBarBounds=this,this.bars.push(e)}findBeatAtPos(e,r){let i=null,n=1e7;for(let s of this.bars){let a=s.findBeatAtPos(e);if(a&&(!i||i.realBounds.xe.realBounds.yr.realBounds.y?1:e.realBounds.xr.realBounds.x?1:0);for(const e of this.bars)e.finish()}addBeat(e){this.staveGroupBounds.boundsLookup.addBeat(e)}}class VS{}class kM{constructor(){this.index=0,this.bars=[]}finish(){for(let e of this.bars)e.finish()}addBar(e){this.boundsLookup.addMasterBar(e),e.staveGroupBounds=this,this.bars.push(e)}findBarAtPos(e){let r=null;for(let i of this.bars)if(!r||i.realBounds.xi.realBounds.x+i.realBounds.w)break;return r}}class Sh{constructor(){this._beatLookup=new Map,this._masterBarLookup=new Map,this._currentStaveGroup=null,this.staveGroups=[],this.isFinished=!1}toJson(){let e={},r=[];e.staveGroups=r;for(let i of this.staveGroups){let n={};n.visualBounds=this.boundsToJson(i.visualBounds),n.realBounds=this.boundsToJson(i.realBounds),n.bars=[];for(let s of i.bars){let a={};a.lineAlignedBounds=this.boundsToJson(s.lineAlignedBounds),a.visualBounds=this.boundsToJson(s.visualBounds),a.realBounds=this.boundsToJson(s.realBounds),a.index=s.index,a.bars=[];for(let o of s.bars){let l={};l.visualBounds=this.boundsToJson(o.visualBounds),l.realBounds=this.boundsToJson(o.realBounds),l.beats=[];for(let c of o.beats){let u={};u.visualBounds=this.boundsToJson(c.visualBounds),u.realBounds=this.boundsToJson(c.realBounds);let d=u;if(d.beatIndex=c.beat.index,d.voiceIndex=c.beat.voice.index,d.barIndex=c.beat.voice.bar.index,d.staffIndex=c.beat.voice.bar.staff.index,d.trackIndex=c.beat.voice.bar.staff.track.index,c.notes){let h=u.notes=[];for(let p of c.notes){let f={},m=f;m.index=p.note.index,f.noteHeadBounds=this.boundsToJson(p.noteHeadBounds),h.push(f)}}l.beats.push(u)}a.bars.push(l)}n.bars.push(a)}r.push(n)}return e}static fromJson(e,r){let i=new Sh,n=e.staveGroups;for(let s of n){let a=new kM;a.visualBounds=s.visualBounds,a.realBounds=s.realBounds,i.addStaveGroup(a);for(let o of s.bars){let l=new xM;l.index=o.index,l.isFirstOfLine=o.isFirstOfLine,l.lineAlignedBounds=o.lineAlignedBounds,l.visualBounds=o.visualBounds,l.realBounds=o.realBounds,a.addBar(l);for(let c of o.bars){let u=new wM;u.visualBounds=c.visualBounds,u.realBounds=c.realBounds,l.addBar(u);for(let d of c.beats){let h=new SM;h.visualBounds=d.visualBounds,h.realBounds=d.realBounds;let p=d;if(h.beat=r.tracks[p.trackIndex].staves[p.staffIndex].bars[p.barIndex].voices[p.voiceIndex].beats[p.beatIndex],d.notes){h.notes=[];for(let f of d.notes){let m=new VS,y=f;m.note=h.beat.notes[y.index],m.noteHeadBounds=f.noteHeadBounds,h.addNote(m)}}u.addBeat(h)}}}}return i}boundsToJson(e){let r={};return r.x=e.x,r.y=e.y,r.w=e.w,r.h=e.h,r}finish(){for(let e of this.staveGroups)e.finish();this.isFinished=!0}addStaveGroup(e){e.index=this.staveGroups.length,e.boundsLookup=this,this.staveGroups.push(e),this._currentStaveGroup=e}addMasterBar(e){e.staveGroupBounds?this._masterBarLookup.set(e.index,e):(e.staveGroupBounds=this._currentStaveGroup,this._masterBarLookup.set(e.index,e),this._currentStaveGroup.addBar(e))}addBeat(e){var r;this._beatLookup.has(e.beat.id)||this._beatLookup.set(e.beat.id,[]),(r=this._beatLookup.get(e.beat.id))==null||r.push(e)}findMasterBarByIndex(e){return this._masterBarLookup.has(e)?this._masterBarLookup.get(e):null}findMasterBar(e){let r=e.index;return this._masterBarLookup.has(r)?this._masterBarLookup.get(r):null}findBeat(e){const r=this.findBeats(e);return r?r[0]:null}findBeats(e){let r=e.id;return this._beatLookup.has(r)?this._beatLookup.get(r):null}getBeatAtPos(e,r){let i=0,n=this.staveGroups.length-1,s=-1;for(;i<=n;){let l=(n+i)/2|0,c=this.staveGroups[l];if(r>=c.realBounds.y&&r<=c.realBounds.y+c.realBounds.h){s=l;break}r=0&&n0&&i.push(e.tracks[0])}this.tracks=i,this.render()}catch(i){this.error.trigger(i)}}renderTracks(e){e.length===0?this.score=null:this.score=e[0].score,this.tracks=e,this.render()}updateSettings(e){this.settings=e}renderResult(e){try{const r=this.layout;r?(de.debug("Rendering","Request render of lazy partial "+e),r.renderLazyPartial(e)):de.warning("Rendering","Request render of lazy partial "+e+" ignored, no layout exists")}catch(r){this.error.trigger(r)}}render(){if(this.width===0){de.warning("Rendering","AlphaTab skipped rendering because of width=0 (element invisible)",null);return}if(this.boundsLookup=new Sh,this.recreateCanvas(),this.canvas.lineWidth=this.settings.display.scale,this.canvas.settings=this.settings,!this.tracks||this.tracks.length===0||!this.score)de.debug("Rendering","Clearing rendered tracks because no score or tracks are set"),this.preRender.trigger(!1),this._renderedTracks=null,this.onRenderFinished(),this.postRenderFinished.trigger(),de.debug("Rendering","Clearing finished");else{de.debug("Rendering","Rendering "+this.tracks.length+" tracks");for(let e=0;e{this._main.postMessage({cmd:"alphaTab.partialRenderFinished",result:a})}),this._renderer.partialLayoutFinished.on(a=>{this._main.postMessage({cmd:"alphaTab.partialLayoutFinished",result:a})}),this._renderer.renderFinished.on(a=>{this._main.postMessage({cmd:"alphaTab.renderFinished",result:a})}),this._renderer.postRenderFinished.on(()=>{var a;this._main.postMessage({cmd:"alphaTab.postRenderFinished",boundsLookup:((a=this._renderer.boundsLookup)==null?void 0:a.toJson())??null})}),this._renderer.preRender.on(a=>{this._main.postMessage({cmd:"alphaTab.preRender",resize:a})}),this._renderer.error.on(this.error.bind(this));break;case"alphaTab.invalidate":this._renderer.render();break;case"alphaTab.resizeRender":this._renderer.resizeRender();break;case"alphaTab.renderResult":this._renderer.renderResult(r.resultId);break;case"alphaTab.setWidth":this._renderer.width=r.width;break;case"alphaTab.renderScore":this.updateFontSizes(r.fontSizes);let s=r.score==null?null:Ar.jsObjectToScore(r.score,this._renderer.settings);this.renderMultiple(s,r.trackIndexes);break;case"alphaTab.updateSettings":this.updateSettings(r.settings);break}}updateFontSizes(e){if(e){Vr.FontSizeLookupTables||(Vr.FontSizeLookupTables=new Map);for(let r in e)Vr.FontSizeLookupTables.set(r,e[r])}}updateSettings(e){uu.fromJson(this._renderer.settings,e)}renderMultiple(e,r){try{this._renderer.renderScore(e,r)}catch(i){this.error(i)}}error(e){de.error("Worker","An unexpected error occurred in worker",e),this._main.postMessage({cmd:"alphaTab.error",error:e})}}class rJ{constructor(){this._canvas=null,this._color=new Yt(0,0,0,255),this._font=new Mt("Arial",10,vr.Plain),this._lineWidth=0;let e=document.createElement("span");e.classList.add("at"),document.body.appendChild(e);let r=window.getComputedStyle(e),i=r.fontFamily;(i.startsWith('"')||i.startsWith("'"))&&(i=i.substr(1,i.length-2)),this._musicFont=new Mt(i,parseFloat(r.fontSize),vr.Plain),this._measureCanvas=document.createElement("canvas"),this._measureCanvas.width=10,this._measureCanvas.height=10,this._measureCanvas.style.width="10px",this._measureCanvas.style.height="10px",this._measureContext=this._measureCanvas.getContext("2d"),this._measureContext.textBaseline="hanging"}destroy(){}onRenderFinished(){return null}beginRender(e,r){this._canvas=document.createElement("canvas"),this._canvas.width=e*Se.HighDpiFactor|0,this._canvas.height=r*Se.HighDpiFactor|0,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px",this._context=this._canvas.getContext("2d"),this._context.textBaseline="hanging",this._context.scale(Se.HighDpiFactor,Se.HighDpiFactor),this._context.lineWidth=this._lineWidth}endRender(){let e=this._canvas;return this._canvas=null,e}get color(){return this._color}set color(e){this._color.rgba!==e.rgba&&(this._color=e,this._context.strokeStyle=e.rgba,this._context.fillStyle=e.rgba)}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this._context&&(this._context.lineWidth=e)}fillRect(e,r,i,n){i>0&&this._context.fillRect(e|0,r|0,i,n)}strokeRect(e,r,i,n){this._context.strokeRect(e|0,r|0,i,n)}beginPath(){this._context.beginPath()}closePath(){this._context.closePath()}moveTo(e,r){this._context.moveTo(e,r)}lineTo(e,r){this._context.lineTo(e,r)}quadraticCurveTo(e,r,i,n){this._context.quadraticCurveTo(e,r,i,n)}bezierCurveTo(e,r,i,n,s,a){this._context.bezierCurveTo(e,r,i,n,s,a)}fillCircle(e,r,i){this._context.beginPath(),this._context.arc(e,r,i,0,Math.PI*2,!0),this.fill()}strokeCircle(e,r,i){this._context.beginPath(),this._context.arc(e,r,i,0,Math.PI*2,!0),this.stroke()}fill(){this._context.fill(),this._context.beginPath()}stroke(){this._context.stroke(),this._context.beginPath()}get font(){return this._font}set font(e){this._font=e,this._context&&(this._context.font=e.toCssString(this.settings.display.scale)),this._measureContext.font=e.toCssString(this.settings.display.scale)}get textAlign(){switch(this._context.textAlign){case"left":return Qe.Left;case"center":return Qe.Center;case"right":return Qe.Right;default:return Qe.Left}}set textAlign(e){switch(e){case Qe.Left:this._context.textAlign="left";break;case Qe.Center:this._context.textAlign="center";break;case Qe.Right:this._context.textAlign="right";break}}get textBaseline(){switch(this._context.textBaseline){case"hanging":return ft.Top;case"middle":return ft.Middle;case"bottom":return ft.Bottom;default:return ft.Top}}set textBaseline(e){switch(e){case ft.Top:this._context.textBaseline="hanging";break;case ft.Middle:this._context.textBaseline="middle";break;case ft.Bottom:this._context.textBaseline="bottom";break}}beginGroup(e){}endGroup(){}fillText(e,r,i){this._context.fillText(e,r,i)}measureText(e){return this._measureContext.measureText(e).width}fillMusicFontSymbol(e,r,i,n,s=!1){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,String.fromCharCode(n),s)}fillMusicFontSymbols(e,r,i,n,s=!1){let a="";for(let o of n)o!==B.None&&(a+=String.fromCharCode(o));this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s=!1){let a=this._context.textAlign,o=this._context.textBaseline,l=this._context.font;this._context.font=this._musicFont.toCssString(i),this._context.textBaseline="middle",s?this._context.textAlign="center":this._context.textAlign="left",this._context.fillText(n,e,r),this._context.textBaseline=o,this._context.font=l,this._context.textAlign=a}beginRotate(e,r,i){this._context.save(),this._context.translate(e,r),this._context.rotate(i*Math.PI/180)}endRotate(){this._context.restore()}}class ma{constructor(e,r=!1){this._midiFile=e,this._smf1Mode=r}addTimeSignature(e,r,i){let n=0,s=i;for(;s=s>>1,s>0;)n++;this._midiFile.addEvent(new sM(0,e,r,n,48,8))}addRest(e,r,i){this._smf1Mode||this._midiFile.addEvent(new oM(e,r,i))}addNote(e,r,i,n,s,a){this._midiFile.addEvent(new cM(e,r,a,ma.fixValue(n),ma.fixValue(s))),this._midiFile.addEvent(new uM(e,r+i,a,ma.fixValue(n),ma.fixValue(s)))}static fixValue(e){return e>127?127:e<0?0:e}addControlChange(e,r,i,n,s){this._midiFile.addEvent(new dM(e,r,i,n,ma.fixValue(s)))}addProgramChange(e,r,i,n){this._midiFile.addEvent(new hM(e,r,i,n))}addTempo(e,r){const i=6e7/r|0;this._midiFile.addEvent(new fM(e,i))}addBend(e,r,i,n){n>=ht.MaxPitchWheel?n=ht.MaxPitchWheel:n=Math.floor(n),this._midiFile.addEvent(new pM(e,r,i,n))}addNoteBend(e,r,i,n,s){this._smf1Mode?this.addBend(e,r,i,s):(s=s*ht.MaxPitchWheel20/ht.MaxPitchWheel,this._midiFile.addEvent(new mM(e,r,i,n,s)))}finishTrack(e,r){(this._midiFile.format==cu.MultiTrack||e==0)&&this._midiFile.addEvent(new gM(e,r))}}class iJ{constructor(e,r){this.closingIndex=0,this.group=e,this.opening=r,e.closings=e.closings.sort((i,n)=>i.index-n.index),this.iterations=e.closings.map(i=>0)}}class nJ{get finished(){return this.index>=this._score.masterBars.length}constructor(e){this._repeatStack=[],this._groupsOnStack=new Set,this._previousAlternateEndings=0,this.shouldPlay=!0,this.index=0,this.currentTick=0,this._score=e}processCurrent(){const e=this._score.masterBars[this.index];let r=e.alternateEndings;if(r===0&&(r=this._previousAlternateEndings),e===e.repeatGroup.opening&&e.repeatGroup.isClosed&&!this._groupsOnStack.has(e.repeatGroup)){const i=new iJ(e.repeatGroup,e);this._repeatStack.push(i),this._groupsOnStack.add(e.repeatGroup),this._previousAlternateEndings=0,r=e.alternateEndings}if(this._repeatStack.length===0||r===0)this.shouldPlay=!0;else{const i=this._repeatStack[this._repeatStack.length-1],n=i.iterations[i.closingIndex];this._previousAlternateEndings=r,r&1<0&&r>0){const i=this._repeatStack[this._repeatStack.length-1];if(i.iterations[i.closingIndex]=this.lastBeat.end){const a=new ns(this.lastBeat.end,s);a.highlightBeat(e,r),this.insertAfter(this.lastBeat,a)}else{let a=null;if(i=o.start&&ia.start)if(s==a.end){const o=new ns(a.start,i);for(const l of a.highlightedBeats)o.highlightBeat(l.beat,l.playbackStart);a.start=i,a.highlightBeat(e,r),this.insertBefore(a,o)}else if(s=r.start&&i=r.nextBeat.start&&ii?s=r.masterBar:r.masterBar.nextMasterBar&&r.masterBar.nextMasterBar.start<=i&&r.masterBar.nextMasterBar.end>i&&(s=r.masterBar.nextMasterBar)),s||(s=this.findMasterBar(i)),!s)return null;for(;s;){if(s.firstBeat){let a=this.findBeatInMasterBar(s,s.firstBeat,i,e,!0,n);if(a)return a}s=s.nextMasterBar}return null}findBeatInMasterBar(e,r,i,n,s,a){if(!r)return null;let o=null,l=null;const c=i-e.start;for(;r!=null&&l==null;){if(r.start<=c&&cc)break;r=(r==null?void 0:r.nextBeat)??null}return l==null?null:this.createResult(e,o,l,s,n)}createResult(e,r,i,n,s){const a=new aJ(e);return a.beat=i,a.beatLookup=r,a.tickDuration=r.end-r.start,n&&this.fillNextBeat(a,s),a.duration=lt.ticksToMillis(a.tickDuration,e.tempo),a}findMasterBar(e){const r=this.masterBars;let i=0,n=r.length-1;for(;i<=n;){const s=(n+i)/2|0,a=r[s];if(e>=a.start&&es){const l=i+r;n.addBeat(e,r,0,l)}}else n.addBeat(e,r,r,i)}}class lJ{constructor(){this.noteOnly=0,this.untilTieOrSlideEnd=0,this.letRingEnd=0}}class cJ{constructor(){this.firstBeatDuration=0,this.secondBeatStartOffset=0,this.secondBeatDuration=0}}class Vt{constructor(e,r,i){this._currentTempo=0,this._programsPerChannel=new Map,this.tickLookup=new oJ,this.applyTranspositionPitches=!0,this.transpositionPitches=new Map,this._currentTripletFeel=null,this.vibratoResolution=16,this._score=e,this._settings=r||new Wl,this._currentTempo=this._score.tempo,this._handler=i}generate(){this.transpositionPitches.clear();for(const i of this._score.tracks)this.generateTrack(i);de.debug("Midi","Begin midi generation");const e=new nJ(this._score);let r=null;for(;!e.finished;){const i=e.index,n=this._score.masterBars[i],s=e.currentTick;if(e.processCurrent(),e.shouldPlay){this.generateMasterBar(n,r,s);for(const a of this._score.tracks)for(const o of a.staves)i{this._handler.addBend(e.voice.bar.staff.track.index,c,a.playbackInfo.secondaryChannel,u)})}}static calculateTripletFeelInfo(e,r,i){let n;switch(i.voice.bar.masterBar.tripletFeel){case gt.Triplet8th:case gt.Dotted8th:case gt.Scottish8th:n=H.Eighth;break;case gt.Triplet16th:case gt.Dotted16th:case gt.Scottish16th:n=H.Sixteenth;break;default:return null}const s=lt.toTicks(n);if(r!==s||e%s!==0||!i.nextBeat||i.nextBeat.voice!==i.voice||i.playbackDuration!==s)return null;const a=new cJ;switch(i.voice.bar.masterBar.tripletFeel){case gt.Triplet8th:a.firstBeatDuration=lt.applyTuplet(lt.toTicks(H.Quarter),3,2),a.secondBeatDuration=lt.applyTuplet(lt.toTicks(H.Eighth),3,2);break;case gt.Dotted8th:a.firstBeatDuration=lt.applyDot(lt.toTicks(H.Eighth),!1),a.secondBeatDuration=lt.toTicks(H.Sixteenth);break;case gt.Scottish8th:a.firstBeatDuration=lt.toTicks(H.Sixteenth),a.secondBeatDuration=lt.applyDot(lt.toTicks(H.Eighth),!1);break;case gt.Triplet16th:a.firstBeatDuration=lt.applyTuplet(lt.toTicks(H.Eighth),3,2),a.secondBeatDuration=lt.applyTuplet(lt.toTicks(H.Sixteenth),3,2);break;case gt.Dotted16th:a.firstBeatDuration=lt.applyDot(lt.toTicks(H.Sixteenth),!1),a.secondBeatDuration=lt.toTicks(H.ThirtySecond);break;case gt.Scottish16th:a.firstBeatDuration=lt.toTicks(H.ThirtySecond),a.secondBeatDuration=lt.applyDot(lt.toTicks(H.Sixteenth),!1);break}return a.secondBeatStartOffset=r-a.firstBeatDuration,a}generateNote(e,r,i,n){const s=e.beat.voice.bar.staff.track,a=e.beat.voice.bar.staff;let o=e.calculateRealValue(this.applyTranspositionPitches,!0);if(e.isPercussion){const f=ki.getArticulation(e);f&&(o=f.outputMidiNumber)}const l=e.isStringed&&e.string<=n.length?n[e.string-1]:0,c=r+l,u=this.getNoteDuration(e,i);u.untilTieOrSlideEnd-=l,u.noteOnly-=l,u.letRingEnd-=l;const d=Vt.getNoteVelocity(e),h=e.hasBend||e.beat.hasWhammyBar||e.beat.vibrato!==Dt.None?s.playbackInfo.secondaryChannel:s.playbackInfo.primaryChannel;let p=0;if(e.hasBend?p=Vt.getPitchWheel(e.bendPoints[0].value):e.beat.hasWhammyBar?p=Vt.getPitchWheel(e.beat.whammyBarPoints[0].value):e.isTieDestination||e.slideOrigin&&e.slideOrigin.slideOutType===ut.Legato?p=-1:p=Vt.getPitchWheel(0),p>=0&&this._handler.addNoteBend(s.index,c,h,o,p),e.beat.fadeIn&&this.generateFadeIn(e,c,u),e.isTrill&&!a.isPercussion){this.generateTrill(e,c,u,o,d,h);return}if(e.beat.isTremolo){this.generateTremoloPicking(e,c,u,o,d,h);return}if(e.hasBend?this.generateBend(e,c,u,o,h):e.beat.hasWhammyBar&&e.index===0?this.generateWhammy(e.beat,c,u,h):e.slideInType!==pi.None||e.slideOutType!==ut.None?this.generateSlide(e,c,u,o,h):(e.vibrato!==Dt.None||e.isTieDestination&&e.tieOrigin.vibrato!==Dt.None)&&this.generateVibrato(e,c,u,o,h),!e.isTieDestination&&(!e.slideOrigin||e.slideOrigin.slideOutType!==ut.Legato)){let f=Math.max(u.untilTieOrSlideEnd,u.letRingEnd);this._handler.addNote(s.index,c,f,o,d,h)}}getNoteDuration(e,r){const i=new lJ;if(i.noteOnly=r,i.untilTieOrSlideEnd=r,i.letRingEnd=r,e.isDead)return i.noteOnly=this.applyStaticDuration(Vt.DefaultDurationDead,r),i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isPalmMute)return i.noteOnly=this.applyStaticDuration(Vt.DefaultDurationPalmMute,r),i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isStaccato)return i.noteOnly=r/2|0,i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isTieOrigin){const n=e.tieDestination;if(n)if(e.isTieDestination){const s=this.getNoteDuration(n,n.beat.playbackDuration);i.untilTieOrSlideEnd=r+s.untilTieOrSlideEnd}else{const s=e.beat.absolutePlaybackStart,a=this.getNoteDuration(n,n.beat.playbackDuration),o=n.beat.absolutePlaybackStart+a.untilTieOrSlideEnd;i.untilTieOrSlideEnd=o-s}}else if(e.slideOutType===ut.Legato){const n=e.slideTarget;if(n){const s=e.beat.absolutePlaybackStart,a=this.getNoteDuration(n,n.beat.playbackDuration),o=n.beat.absolutePlaybackStart+a.untilTieOrSlideEnd;i.untilTieOrSlideEnd=o-s}}if(e.isLetRing&&this._settings.notation.notationMode===si.GuitarPro){let n=e.beat,s=0;const a=e.beat.voice.bar.masterBar.calculateDuration();for(;n.nextBeat;){let o=n.nextBeat;if(o.isRest||e.isStringed&&o.hasNoteOnString(e.string))break;if(n=n.nextBeat,s=n.absolutePlaybackStart-e.beat.absolutePlaybackStart+n.playbackDuration,s>a){s=a;break}}n===e.beat?i.letRingEnd=r:i.letRingEnd=s}else i.letRingEnd=i.untilTieOrSlideEnd;return i}applyStaticDuration(e,r){const i=this._currentTempo*e/Re.MaxPosition|0;return Math.min(i,r)}static getNoteVelocity(e){let r=e.dynamics;switch(!e.beat.voice.bar.staff.isPercussion&&e.hammerPullOrigin&&r--,e.isGhost&&r--,e.accentuated){case jr.Normal:r++;break;case jr.Heavy:r+=2;break}return lt.dynamicToVelocity(r)}generateFadeIn(e,r,i){const n=e.beat.voice.bar.staff.track,a=Vt.toChannelShort(n.playbackInfo.volume)/i.noteOnly,o=120,l=i.noteOnly/o|0,c=r+i.noteOnly;for(let u=l-1;u>=0;u--){const d=c-u*o,h=(d-r)*a;u===l-1&&(this._handler.addControlChange(n.index,r,n.playbackInfo.primaryChannel,jt.VolumeCoarse,h),this._handler.addControlChange(n.index,r,n.playbackInfo.secondaryChannel,jt.VolumeCoarse,h)),this._handler.addControlChange(n.index,d,n.playbackInfo.primaryChannel,jt.VolumeCoarse,h),this._handler.addControlChange(n.index,d,n.playbackInfo.secondaryChannel,jt.VolumeCoarse,h)}}generateVibrato(e,r,i,n,s){let a=0,o=0;switch(e.vibrato!==Dt.None?e.vibrato:e.isTieDestination?e.tieOrigin.vibrato:Dt.Slight){case Dt.Slight:a=this._settings.player.vibrato.noteSlightLength,o=this._settings.player.vibrato.noteSlightAmplitude;break;case Dt.Wide:a=this._settings.player.vibrato.noteWideLength,o=this._settings.player.vibrato.noteWideAmplitude;break;default:return}const c=e.beat.voice.bar.staff.track;this.generateVibratorWithParams(r,i.noteOnly,a,o,(u,d)=>{this._handler.addNoteBend(c.index,u,s,n,d)})}generateVibratorWithParams(e,r,i,n,s){const a=this.vibratoResolution,o=i/2|0;e+=i;const l=e+r;for(;e{this._handler.addNoteBend(l.index,h,s,n,p)})}generateBend(e,r,i,n,s){let a=e.bendPoints,o=e.beat.voice.bar.staff.track;const l=(p,f)=>{this._handler.addNoteBend(o.index,p,s,n,f)};let c=null,u;if(e.isTieOrigin&&this._settings.notation.extendBendArrowsOnTiedNotes){let p=e;for(;p.isTieOrigin&&!p.tieDestination.hasBend;)p=p.tieDestination;u=p.beat.absolutePlaybackStart-e.beat.absolutePlaybackStart+this.getNoteDuration(p,p.beat.playbackDuration).noteOnly}else if(e.isTieOrigin&&e.beat.graceType!==Je.None){switch(e.tieDestination.bendType){case ze.Bend:case ze.BendRelease:case ze.PrebendBend:c=e.tieDestination.bendPoints[1].value;break;case ze.Prebend:case ze.PrebendRelease:c=e.tieDestination.bendPoints[0].value;break}u=Math.max(i.noteOnly,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo))}else u=i.noteOnly;a[0].value>0&&!e.isContinuedBend&&r>0&&r--;const d=Math.min(u,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));let h=[];switch(e.bendType){case ze.Custom:h=a;break;case ze.Bend:case ze.Release:switch(e.bendStyle){case Gt.Default:h=a;break;case Gt.Gradual:h.push(new Re(0,e.bendPoints[0].value)),(!c||c0&&!e.isContinuedWhammy&&r--;const l=(u,d)=>{this._handler.addBend(a.index,u,n,d)};let c=[];switch(e.whammyBarType){case Lt.Custom:c=s;break;case Lt.Dive:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Re(0,s[0].value)),c.push(new Re(Re.MaxPosition,s[1].value));break;case Gt.Fast:const u=Math.min(o,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!1,[s[0].value,s[1].value],u,l);return}break;case Lt.Dip:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Re(0,s[0].value)),c.push(new Re(Re.MaxPosition/2|0,s[1].value)),c.push(new Re(Re.MaxPosition,s[2].value));break;case Gt.Fast:const u=Math.min(o,lt.millisToTicks(this._settings.player.songBookDipDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!0,[s[0].value,s[1].value,s[2].value],u,l);return}break;case Lt.Hold:c=s;break;case Lt.Predive:c=s;break;case Lt.PrediveDive:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Re(0,s[0].value)),c.push(new Re(Re.MaxPosition/2|0,s[0].value)),c.push(new Re(Re.MaxPosition,s[1].value));break;case Gt.Fast:const u=Vt.getPitchWheel(s[0].value);this._handler.addBend(a.index,r,n,u|0);const d=Math.min(o,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!1,[s[0].value,s[1].value],d,l);return}break}this.generateWhammyOrBend(r,o,c,l)}generateWhammyOrBend(e,r,i,n){const s=r/Re.MaxPosition;for(let a=0;a=h&&(c=h-d),this._handler.addNote(o.index,d,c,u?l:n,s,a),u=!u,d+=c}generateTremoloPicking(e,r,i,n,s,a){const o=e.beat.voice.bar.staff.track;let l=lt.toTicks(e.beat.tremoloSpeed),c=r;const u=r+i.untilTieOrSlideEnd;for(;c+10=u&&(l=u-c),this._handler.addNote(o.index,c,l,n,s,a),c+=l}getBrushInfo(e){const r=new Int32Array(e.voice.bar.staff.tuning.length);if(e.brushType!==ir.None){let i=0,n=0;for(const s of e.notes)s.isTieDestination||(i|=1<0){let s=0;const a=e.brushDuration/(n-1)|0;for(let o=0;o=0;)this.createTies(this.beat.notes[e--]);this.renderer.registerTies(this.ties),this.updateWidth()}updateWidth(){if(this.minWidth=this.preNotes.width+this.onNotes.width,!this.beat.isRest)if(this.onNotes.beamingHelper.beats.length===1)this.beat.duration>=H.Eighth&&(this.minWidth+=20*this.scale);else switch(this.beat.duration){case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:this.minWidth+=10*this.scale;break}let e=0;for(let r of this.ties)r.width>e&&(e=r.width);this.minWidth+=e,this.width=this.minWidth}scaleToWidth(e){this.onNotes.updateBeamingHelper(),this.width=e}createTies(e){}static getGroupId(e){return"b"+e.id}paint(e,r,i){if(this.beat.voice.isEmpty||this.preNotes.isEmpty&&this.onNotes.isEmpty&&this.ties.length===0)return;i.beginGroup(Ys.getGroupId(this.beat)),this.preNotes.paint(e+this.x,r+this.y,i),this.onNotes.paint(e+this.x,r+this.y,i);let s=e-this.voiceContainer.x-this.renderer.x,a=r-this.voiceContainer.y-this.renderer.y;for(let o=0,l=this.ties.length;o{this._isDestroyed||this.container.width!==this.renderer.width&&this.triggerResize()},e.resizeThrottle));let i=new nT;i.oldWidth=this.renderer.width,i.newWidth=this.container.width|0,i.settings=this.settings,this.onResize(i),this.renderer.preRender.on(this.onRenderStarted.bind(this)),this.renderer.renderFinished.on(n=>{this.onRenderFinished(n)}),this.renderer.postRenderFinished.on(()=>{let n=Date.now()-this._startTime;de.debug("rendering","Rendering completed in "+n+"ms"),this.onPostRenderFinished()}),this.renderer.preRender.on(n=>{this._startTime=Date.now()}),this.renderer.partialLayoutFinished.on(this.appendRenderResult.bind(this)),this.renderer.partialRenderFinished.on(this.updateRenderResult.bind(this)),this.renderer.renderFinished.on(n=>{this.appendRenderResult(n),this.appendRenderResult(null)}),this.renderer.error.on(this.onError.bind(this)),this.settings.player.enablePlayer&&this.setupPlayer(),this.setupClickHandling(),this.uiFacade.beginInvoke(()=>{this.uiFacade.initialRender()})}destroy(){this._isDestroyed=!0,this.player&&this.player.destroy(),this.uiFacade.destroy(),this.renderer.destroy()}updateSettings(){var r;const e=this.score;e&&er.applyPitchOffsets(this.settings,e),this.renderer.updateSettings(this.settings),this.settings.player.enablePlayer?(this.setupPlayer(),e&&((r=this.player)==null||r.applyTranspositionPitches(Vt.buildTranspositionPitches(e,this.settings)))):this.destroyPlayer(),this.onSettingsUpdated()}load(e,r){try{return this.uiFacade.load(e,i=>{this.renderScore(i,r)},i=>{this.onError(i)})}catch(i){return this.onError(i),!1}}renderScore(e,r){let i=[];if(!r)e.tracks.length>0&&i.push(e.tracks[0]);else if(r.length===0)e.tracks.length>0&&i.push(e.tracks[0]);else if(r.length===1&&r[0]===-1)for(let n of e.tracks)i.push(n);else for(let n of r)n>=0&&n<=e.tracks.length&&i.push(e.tracks[n]);this.internalRenderTracks(e,i)}renderTracks(e){if(e.length>0){let r=e[0].score;for(let i of e)if(i.score!==r){this.onError(new gi(mi.General,"All rendered tracks must belong to the same score."));return}this.internalRenderTracks(r,e)}}internalRenderTracks(e,r){if(er.applyPitchOffsets(this.settings,e),e!==this.score){this.score=e,this.tracks=r,this._trackIndexes=[];for(let i of r)this._trackIndexes.push(i.index);this._trackIndexLookup=new Set(this._trackIndexes),this.onScoreLoaded(e),this.loadMidiForScore(),this.render()}else{this.tracks=r,this._trackIndexes=[];for(let i of r)this._trackIndexes.push(i.index);this._trackIndexLookup=new Set(this._trackIndexes),this.render()}}triggerResize(){if(!this.container.isVisible)de.warning("Rendering","AlphaTab container was invisible while autosizing, waiting for element to become visible",null),this.uiFacade.rootContainerBecameVisible.on(()=>{de.debug("Rendering","AlphaTab container became visible, doing autosizing",null),this.triggerResize()});else{let e=new nT;e.oldWidth=this.renderer.width,e.newWidth=this.container.width,e.settings=this.settings,this.onResize(e),this.renderer.updateSettings(this.settings),this.renderer.width=this.container.width,this.renderer.resizeRender()}}appendRenderResult(e){e?(this.canvasElement.width=e.totalWidth,this.canvasElement.height=e.totalHeight,this._cursorWrapper&&(this._cursorWrapper.width=e.totalWidth,this._cursorWrapper.height=e.totalHeight),(e.width>0||e.height>0)&&this.uiFacade.beginAppendRenderResults(e)):this.uiFacade.beginAppendRenderResults(e)}updateRenderResult(e){e&&e.renderResult&&this.uiFacade.beginUpdateRenderResults(e)}tex(e,r){try{let i=new Wi;i.logErrors=!0,i.initFromString(e,this.settings);let n=i.readScore();this.renderScore(n,r)}catch(i){this.onError(i)}}loadSoundFont(e,r=!1){return this.player?this.uiFacade.loadSoundFont(e,r):!1}resetSoundFonts(){this.player&&this.player.resetSoundFonts()}render(){this.renderer&&(this.uiFacade.canRender?(this.renderer.width=this.container.width,this.renderer.renderScore(this.score,this._trackIndexes)):this.uiFacade.canRenderChanged.on(()=>this.render()))}get tickCache(){return this._tickCache}get isReadyForPlayback(){return this.player?this.player.isReadyForPlayback:!1}get playerState(){return this.player?this.player.state:ti.Paused}get masterVolume(){return this.player?this.player.masterVolume:0}set masterVolume(e){this.player&&(this.player.masterVolume=e)}get metronomeVolume(){return this.player?this.player.metronomeVolume:0}set metronomeVolume(e){this.player&&(this.player.metronomeVolume=e)}get countInVolume(){return this.player?this.player.countInVolume:0}set countInVolume(e){this.player&&(this.player.countInVolume=e)}get midiEventsPlayedFilter(){return this.player?this.player.midiEventsPlayedFilter:[]}set midiEventsPlayedFilter(e){this.player&&(this.player.midiEventsPlayedFilter=e)}get tickPosition(){return this.player?this.player.tickPosition:0}set tickPosition(e){this.player&&(this.player.tickPosition=e)}get timePosition(){return this.player?this.player.timePosition:0}set timePosition(e){this.player&&(this.player.timePosition=e)}get playbackRange(){return this.player?this.player.playbackRange:null}set playbackRange(e){this.player&&(this.player.playbackRange=e,this.settings.player.enableCursor&&this.updateSelectionCursor(e))}get playbackSpeed(){return this.player?this.player.playbackSpeed:0}set playbackSpeed(e){this.player&&(this.player.playbackSpeed=e)}get isLooping(){return this.player?this.player.isLooping:!1}set isLooping(e){this.player&&(this.player.isLooping=e)}destroyPlayer(){this.player&&(this.player.destroy(),this.player=null,this._previousTick=0,this._playerState=ti.Paused,this.destroyCursors())}setupPlayer(){this.updateCursors(),!this.player&&(this.player=this.uiFacade.createWorkerPlayer(),this.player&&(this.player.ready.on(()=>{this.loadMidiForScore()}),this.player.readyForPlayback.on(()=>{if(this.onPlayerReady(),this.tracks)for(let e of this.tracks){let r=e.playbackInfo.volume/16;this.player.setChannelVolume(e.playbackInfo.primaryChannel,r),this.player.setChannelVolume(e.playbackInfo.secondaryChannel,r)}}),this.player.soundFontLoaded.on(this.onSoundFontLoaded.bind(this)),this.player.soundFontLoadFailed.on(e=>{this.onError(e)}),this.player.midiLoaded.on(this.onMidiLoaded.bind(this)),this.player.midiLoadFailed.on(e=>{this.onError(e)}),this.player.stateChanged.on(this.onPlayerStateChanged.bind(this)),this.player.positionChanged.on(this.onPlayerPositionChanged.bind(this)),this.player.midiEventsPlayed.on(this.onMidiEventsPlayed.bind(this)),this.player.playbackRangeChanged.on(this.onPlaybackRangeChanged.bind(this)),this.player.finished.on(this.onPlayerFinished.bind(this)),this.setupPlayerEvents()))}loadMidiForScore(){if(!this.player||!this.score||!this.player.isReady)return;de.debug("AlphaTab","Generating Midi");let e=new Fo,r=new ma(e),i=new Vt(this.score,this.settings,r);i.applyTranspositionPitches=!1,i.generate(),this._tickCache=i.tickLookup,this.onMidiLoad(e),this.player.loadMidiFile(e),this.player.applyTranspositionPitches(i.transpositionPitches)}changeTrackVolume(e,r){if(this.player)for(let i of e)this.player.setChannelVolume(i.playbackInfo.primaryChannel,r),this.player.setChannelVolume(i.playbackInfo.secondaryChannel,r)}changeTrackSolo(e,r){if(this.player)for(let i of e)this.player.setChannelSolo(i.playbackInfo.primaryChannel,r),this.player.setChannelSolo(i.playbackInfo.secondaryChannel,r)}changeTrackMute(e,r){if(this.player)for(let i of e)this.player.setChannelMute(i.playbackInfo.primaryChannel,r),this.player.setChannelMute(i.playbackInfo.secondaryChannel,r)}play(){return this.player?this.player.play():!1}pause(){this.player&&this.player.pause()}playPause(){this.player&&this.player.playPause()}stop(){this.player&&this.player.stop()}playBeat(e){if(!this.player)return;let r=new Fo,i=new ma(r);new Vt(e.voice.bar.staff.track.score,this.settings,i).generateSingleBeat(e),this.player.playOneTimeMidiFile(r)}playNote(e){if(!this.player)return;let r=new Fo,i=new ma(r);new Vt(e.beat.voice.bar.staff.track.score,this.settings,i).generateSingleNote(e),this.player.playOneTimeMidiFile(r)}destroyCursors(){this._cursorWrapper&&(this.uiFacade.destroyCursors(),this._cursorWrapper=null,this._barCursor=null,this._beatCursor=null,this._selectionWrapper=null)}updateCursors(){if(this.settings.player.enableCursor&&!this._cursorWrapper){let e=this.uiFacade.createCursors();e&&(this._cursorWrapper=e.cursorWrapper,this._barCursor=e.barCursor,this._beatCursor=e.beatCursor,this._selectionWrapper=e.selectionWrapper),this._currentBeat!==null&&this.cursorUpdateBeat(this._currentBeat,!1,this._previousTick>10,!0)}else!this.settings.player.enableCursor&&this._cursorWrapper&&this.destroyCursors()}setupPlayerEvents(){this._previousTick=0,this._playerState=ti.Paused,this.renderer.postRenderFinished.on(()=>{this._currentBeat=null,this.cursorUpdateTick(this._previousTick,!1,this._previousTick>10)}),this.player&&(this.player.positionChanged.on(e=>{this._previousTick=e.currentTick,this.uiFacade.beginInvoke(()=>{this.cursorUpdateTick(e.currentTick,!1)})}),this.player.stateChanged.on(e=>{if(this._playerState=e.state,!e.stopped&&e.state===ti.Paused){let r=this._currentBeat,i=this._tickCache;r&&i&&(this.player.tickPosition=i.getBeatStart(r.beat))}}))}cursorUpdateTick(e,r,i=!1){let n=this._tickCache;if(n){let s=this._trackIndexLookup;if(s!=null&&s.size>0){let a=n.findBeat(s,e,this._currentBeat);a&&this.cursorUpdateBeat(a,r,i)}}}cursorUpdateBeat(e,r,i,n=!1){var f;const s=e.beat,a=((f=e.nextBeat)==null?void 0:f.beat)??null,o=e.duration,l=e.beatLookup.highlightedBeats;if(!s)return;let c=this.renderer.boundsLookup;if(!c)return;let u=this._currentBeat,d=this._previousCursorCache,h=this._previousStateForCursor;if(!n&&s===(u==null?void 0:u.beat)&&c===d&&h===this._playerState)return;let p=c.findBeat(s);p&&(this._currentBeat=e,this._previousCursorCache=c,this._previousStateForCursor=this._playerState,this.uiFacade.beginInvoke(()=>{this.internalCursorUpdateBeat(s,a,o,r,l,c,p,i)}))}scrollToCursor(){const e=this._currentBarBounds;e&&this.internalScrollToCursor(e)}internalScrollToCursor(e){let r=this.uiFacade.getScrollContainer(),i=Se.getLayoutEngineFactory(this.settings.display.layoutMode).vertical,n=this.settings.player.scrollMode;if(i){let s=e.realBounds.y+this.settings.player.scrollOffsetY;if(s!==this._lastScroll)switch(this._lastScroll=s,n){case Ia.Continuous:let a=this.uiFacade.getOffset(r,this.container);this.uiFacade.scrollToY(r,a.y+s,this.settings.player.scrollSpeed);break;case Ia.OffScreen:let o=r.scrollTop+this.uiFacade.getOffset(null,r).h;if(e.visualBounds.y+e.visualBounds.h>=o||e.visualBounds.y=o||e.visualBounds.x{u&&u.transitionToX(i/this.playbackSpeed,f)})}l=!n,p=!0}l&&!this._beatMouseDown&&this.settings.player.scrollMode!==Ia.Off&&this.internalScrollToCursor(d),p&&(this.onPlayedBeatChanged(e),this.onActiveBeatsChanged(new dJ(s.map(f=>f.beat))))}onPlayedBeatChanged(e){this._isDestroyed||(this.playedBeatChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playedBeatChanged",e))}onActiveBeatsChanged(e){this._isDestroyed||(this.activeBeatsChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"activeBeatsChanged",e))}onBeatMouseDown(e,r){this._isDestroyed||(this.settings.player.enablePlayer&&this.settings.player.enableCursor&&this.settings.player.enableUserInteraction&&(this._selectionStart=new $f(r),this._selectionEnd=null),this._beatMouseDown=!0,this.beatMouseDown.trigger(r),this.uiFacade.triggerEvent(this.container,"beatMouseDown",r,e))}onNoteMouseDown(e,r){this._isDestroyed||(this._noteMouseDown=!0,this.noteMouseDown.trigger(r),this.uiFacade.triggerEvent(this.container,"noteMouseDown",r,e))}onBeatMouseMove(e,r){this._isDestroyed||(this.settings.player.enableUserInteraction&&(!this._selectionEnd||this._selectionEnd.beat!==r)&&(this._selectionEnd=new $f(r),this.cursorSelectRange(this._selectionStart,this._selectionEnd)),this.beatMouseMove.trigger(r),this.uiFacade.triggerEvent(this.container,"beatMouseMove",r,e))}onNoteMouseMove(e,r){this._isDestroyed||(this.noteMouseMove.trigger(r),this.uiFacade.triggerEvent(this.container,"noteMouseMove",r,e))}onBeatMouseUp(e,r){var i,n;if(!this._isDestroyed){if(this.settings.player.enablePlayer&&this.settings.player.enableCursor&&this.settings.player.enableUserInteraction){if(this._selectionEnd){let s=((i=this._tickCache)==null?void 0:i.getBeatStart(this._selectionStart.beat))??this._selectionStart.beat.absolutePlaybackStart;if((((n=this._tickCache)==null?void 0:n.getBeatStart(this._selectionEnd.beat))??this._selectionEnd.beat.absolutePlaybackStart){var s,a;if(!e.isLeftMouseButton)return;this.settings.player.enableUserInteraction&&e.preventDefault();let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(n&&(this.onBeatMouseDown(e,n),this.settings.core.includeNoteBounds)){const o=(a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i);o&&this.onNoteMouseDown(e,o)}}),this.canvasElement.mouseMove.on(e=>{var s,a;if(!this._beatMouseDown)return;let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(n&&(this.onBeatMouseMove(e,n),this._noteMouseDown)){const o=(a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i);o&&this.onNoteMouseMove(e,o)}}),this.canvasElement.mouseUp.on(e=>{var s,a;if(!this._beatMouseDown)return;this.settings.player.enableUserInteraction&&e.preventDefault();let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(this.onBeatMouseUp(e,n),this._noteMouseDown)if(n){const o=((a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i))??null;this.onNoteMouseUp(e,o)}else this.onNoteMouseUp(e,null)}),this.renderer.postRenderFinished.on(()=>{!this._selectionStart||!this.settings.player.enablePlayer||!this.settings.player.enableCursor||!this.settings.player.enableUserInteraction||this.cursorSelectRange(this._selectionStart,this._selectionEnd)})}cursorSelectRange(e,r){var c,u;let i=this.renderer.boundsLookup;if(!i)return;let n=this._selectionWrapper;if(!n||(n.clear(),!e||!r||e.beat===r.beat))return;e.bounds||(e.bounds=i.findBeat(e.beat)),r.bounds||(r.bounds=i.findBeat(r.beat));let s=((c=this._tickCache)==null?void 0:c.getBeatStart(e.beat))??e.beat.absolutePlaybackStart;if((((u=this._tickCache)==null?void 0:u.getBeatStart(r.beat))??r.beat.absolutePlaybackStart)0&&(this.playerPositionChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playerPositionChanged",e))}onMidiEventsPlayed(e){this._isDestroyed||(this.midiEventsPlayed.trigger(e),this.uiFacade.triggerEvent(this.container,"midiEventsPlayed",e))}onPlaybackRangeChanged(e){this._isDestroyed||(this.playbackRangeChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playbackRangeChanged",e))}onSettingsUpdated(){this._isDestroyed||(this.settingsUpdated.trigger(),this.uiFacade.triggerEvent(this.container,"settingsUpdated",null))}}class Ma extends gi{constructor(e,r){super(mi.General,e),this.xhr=r,Object.setPrototypeOf(this,Ma.prototype)}}class Dc{static loadScoreAsync(e,r,i,n){let s=new XMLHttpRequest;s.open("GET",e,!0,null,null),s.responseType="arraybuffer",s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){let a=s.response;if(s.status===200||s.status===0&&a)try{let o=s.response,l=new Uint8Array(o),c=Dc.loadScoreFromBytes(l,n);r(c)}catch(o){i(o)}else s.status===0?i(new Ma(`You are offline!! +`),RQ=(t,e)=>e?(...r)=>t(...r).locale(e):t;class MQ{constructor({locale:e,formats:r}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=NQ,this.setLocaleToValue=i=>{const n=this.getCurrentLocaleCode();return n===i.locale()?i:i.locale(n)},this.hasUTCPlugin=()=>typeof ui.utc<"u",this.hasTimezonePlugin=()=>typeof ui.tz<"u",this.isSame=(i,n,s)=>{const a=this.setTimezone(n,this.getTimezone(i));return i.format(s)===a.format(s)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return ui.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const n=ui.tz.guess();return n!=="UTC"?ui.tz(i,n):ui(i)}return ui(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(ob);return ui.utc(i)},this.createTZDate=(i,n)=>{if(!this.hasUTCPlugin())throw new Error(ob);if(!this.hasTimezonePlugin())throw new Error(IC);const s=i!==void 0&&!i.endsWith("Z");return ui(i).tz(this.cleanTimezone(n),s)},this.getLocaleFormats=()=>{const i=ui.Ls,n=this.locale||"en";let s=i[n];return s===void 0&&(PQ(),s=i.en),s.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const n=this.getTimezone(i);if(n!=="UTC"){const s=i.tz(this.cleanTimezone(n),!0);if((s.$offset??0)===(i.$offset??0))return i;i.$offset=s.$offset}return i},this.date=(i,n="default")=>{if(i===null)return null;let s;return n==="UTC"?s=this.createUTCDate(i):n==="system"||n==="default"&&!this.hasTimezonePlugin()?s=this.createSystemDate(i):s=this.createTZDate(i,n),this.locale===void 0?s:s.locale(this.locale)},this.getInvalidDate=()=>ui(new Date("Invalid date")),this.getTimezone=i=>{var n;if(this.hasTimezonePlugin()){const s=(n=i.$x)==null?void 0:n.$timezone;if(s)return s}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,n)=>{if(this.getTimezone(i)===n)return i;if(n==="UTC"){if(!this.hasUTCPlugin())throw new Error(ob);return i.utc()}if(n==="system")return i.local();if(!this.hasTimezonePlugin()){if(n==="default")return i;throw new Error(IC)}return ui.tz(i,this.cleanTimezone(n))},this.toJsDate=i=>i.toDate(),this.parse=(i,n)=>i===""?null:this.dayjs(i,n,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const n=this.getLocaleFormats(),s=a=>a.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(o,l,c)=>l||c.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(a,o,l)=>{const c=l&&l.toUpperCase();return o||n[l]||s(n[c])})},this.isValid=i=>i==null?!1:i.isValid(),this.format=(i,n)=>this.formatByString(i,this.formats[n]),this.formatByString=(i,n)=>this.dayjs(i).format(n),this.formatNumber=i=>i,this.isEqual=(i,n)=>i===null&&n===null?!0:i===null||n===null?!1:i.toDate().getTime()===n.toDate().getTime(),this.isSameYear=(i,n)=>this.isSame(i,n,"YYYY"),this.isSameMonth=(i,n)=>this.isSame(i,n,"YYYY-MM"),this.isSameDay=(i,n)=>this.isSame(i,n,"YYYY-MM-DD"),this.isSameHour=(i,n)=>i.isSame(n,"hour"),this.isAfter=(i,n)=>i>n,this.isAfterYear=(i,n)=>this.hasUTCPlugin()?!this.isSameYear(i,n)&&i.utc()>n.utc():i.isAfter(n,"year"),this.isAfterDay=(i,n)=>this.hasUTCPlugin()?!this.isSameDay(i,n)&&i.utc()>n.utc():i.isAfter(n,"day"),this.isBefore=(i,n)=>ithis.hasUTCPlugin()?!this.isSameYear(i,n)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,n)&&i.utc()i>=n&&i<=s,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"year"):i.add(n,"year")),this.addMonths=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"month"):i.add(n,"month")),this.addWeeks=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"week"):i.add(n,"week")),this.addDays=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"day"):i.add(n,"day")),this.addHours=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"hour"):i.add(n,"hour")),this.addMinutes=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"minute"):i.add(n,"minute")),this.addSeconds=(i,n)=>this.adjustOffset(n<0?i.subtract(Math.abs(n),"second"):i.add(n,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,n)=>this.adjustOffset(i.set("year",n)),this.setMonth=(i,n)=>this.adjustOffset(i.set("month",n)),this.setDate=(i,n)=>this.adjustOffset(i.set("date",n)),this.setHours=(i,n)=>this.adjustOffset(i.set("hour",n)),this.setMinutes=(i,n)=>this.adjustOffset(i.set("minute",n)),this.setSeconds=(i,n)=>this.adjustOffset(i.set("second",n)),this.setMilliseconds=(i,n)=>this.adjustOffset(i.set("millisecond",n)),this.getDaysInMonth=i=>i.daysInMonth(),this.getWeekArray=i=>{const n=this.setLocaleToValue(i),s=this.startOfWeek(this.startOfMonth(n)),a=this.endOfWeek(this.endOfMonth(n));let o=0,l=s;const c=[];for(;li.week(),this.getYearRange=([i,n])=>{const s=this.startOfYear(i),a=this.endOfYear(n),o=[];let l=s;for(;this.isBefore(l,a);)o.push(l),l=this.addYears(l,1);return o},this.dayjs=RQ(ui,e),this.locale=e,this.formats=S({},EQ,r),ui.extend(SQ)}getDayOfWeek(e){return e.day()+1}}const qR=14,KR=1,DQ={toNoteNumber(t){switch(t){case"C":return 0;case"D":return 2;case"E":return 4;case"F":return 5;case"G":return 7;case"A":return 9;case"B":return 11}}};var La=(t=>(t[t.Natural=0]="Natural",t[t.Sharp=1]="Sharp",t[t.Flat=-1]="Flat",t[t.DoubleSharp=2]="DoubleSharp",t[t.DoubleFlat=-2]="DoubleFlat",t))(La||{});(t=>{function e(r){switch(r){case 0:return"";case-2:return"bb";case-1:return"b";case 1:return"#";case 2:return"##"}}t.toDisplayString=e})(La||(La={}));const lb={increaseBy(t,e){return Math.abs((e+t)%12)},toNote(t){switch(t){case 0:return Zt("C");case 1:return Zt("D",-1);case 2:return Zt("D");case 3:return Zt("E",-1);case 4:return Zt("E");case 5:return Zt("F");case 6:return Zt("G",-1);case 7:return Zt("G");case 8:return Zt("A",-1);case 9:return Zt("A");case 10:return Zt("B",-1);case 11:return Zt("B")}}},Gr={toNoteNumber(t){return lb.increaseBy(t.accidental,DQ.toNoteNumber(t.letter))},toDisplayString(t){return`${t.letter}${La.toDisplayString(t.accidental)}`},transpose(t,e){return lb.toNote(lb.increaseBy(t,Gr.toNoteNumber(e)))}};console.log(Gr.toDisplayString(Gr.transpose(3,Zt("C"))));function Zt(t,e){return{letter:t,accidental:e||0}}var Bo=(t=>(t.Root="Root",t.First="1st",t.Second="2nd",t.Third="3rd",t))(Bo||{});(t=>{function e(r,i,n){switch(r){case"Root":return Gr.transpose(0,n);case"1st":switch(i){case"Maj7":case"Dom7":return Gr.transpose(4,n);default:return Gr.transpose(3,n)}case"2nd":switch(i){case"Half-Dim7":case"Dim7":return Gr.transpose(6,n);default:return Gr.transpose(7,n)}case"3rd":switch(i){case"Maj7":return Gr.transpose(11,n);case"Dom7":case"Min7":case"Half-Dim7":return Gr.transpose(10,n);default:return Gr.transpose(9,n)}}}t.bassNote=e})(Bo||(Bo={}));var Fa=(t=>(t.Maj7="Maj7",t.Dom7="Dom7",t.Min7="Min7",t.Half="Half-Dim7",t.Full="Dim7",t))(Fa||{});(t=>{function e(r){switch(r){case"Maj7":return"△7";case"Dom7":return"7";case"Min7":return"m7";case"Half-Dim7":return"ø7";case"Dim7":return"°7"}}t.toLeadSheet=e})(Fa||(Fa={}));var mm;(t=>{function e(r){switch(r){case 1:return Zt("E");case 2:return Zt("B");case 3:return Zt("G");case 4:return Zt("D");case 5:return Zt("A");case 6:return Zt("E")}}t.firstNote=e})(mm||(mm={}));const fd={toTex(t){return`${t.fret}.${t.string}`},onString(t,e){let r=Gr.toNoteNumber(e),i=r-Gr.toNoteNumber(mm.firstNote(t));console.log(i);const n=[];for(;i<=qR;)i>=KR&&n.push(i),r+=12,i=r-Gr.toNoteNumber(mm.firstNote(t));return n.map(s=>({string:t,fret:s}))}};console.log(fd.onString(2,Zt("B")).map(t=>t.fret));function oe(t,e){return{string:t,fret:e}}const LQ={generate(t,e,r="Root"){switch(t){case 6:switch(e){case"Maj7":switch(r){case"Root":return[oe(6,0),oe(4,1),oe(3,1),oe(2,0)];case"1st":return[oe(6,0),oe(4,-2),oe(3,0),oe(2,0)];case"2nd":return[oe(6,0),oe(5,0),oe(4,-1),oe(3,1)];case"3rd":return[oe(6,0),oe(5,0),oe(4,-2),oe(3,-2)]}case"Dom7":switch(r){case"Root":return[oe(6,0),oe(4,0),oe(3,1),oe(2,0)];case"1st":return[oe(6,0),oe(4,-2),oe(3,0),oe(2,-1)];case"2nd":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,-2)];case"3rd":return[oe(6,0),oe(4,-1),oe(3,-1),oe(2,-1)]}case"Min7":switch(r){case"Root":return[oe(6,0),oe(4,0),oe(3,0),oe(2,0)];case"1st":return[oe(6,0),oe(4,-1),oe(3,1),oe(2,0)];case"2nd":return[oe(6,0),oe(4,-2),oe(3,0),oe(2,-2)];case"3rd":return[oe(6,0),oe(4,-1),oe(3,-1),oe(2,-2)]}case"Half-Dim7":switch(r){case"Root":return[oe(6,0),oe(4,0),oe(3,0),oe(2,-1)];case"1st":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,0)];case"2nd":return[oe(6,0),oe(4,-1),oe(3,1),oe(2,-1)];case"3rd":return[oe(6,0),oe(4,-2),oe(3,-1),oe(2,-2)]}case"Dim7":switch(r){case"Root":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,-1)];case"1st":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,-1)];case"2nd":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,-1)];case"3rd":return[oe(6,0),oe(4,-1),oe(3,0),oe(2,-1)]}}case 5:switch(e){case"Maj7":switch(r){case"Root":return[oe(5,0),oe(4,2),oe(3,1),oe(2,2)];case"1st":return[oe(5,0),oe(4,2),oe(3,-2),oe(2,1)];case"2nd":return[oe(5,0),oe(4,0),oe(3,-1),oe(2,2)];case"3rd":return[oe(5,0),oe(4,0),oe(3,-2),oe(2,-1)]}case"Dom7":switch(r){case"Root":return[oe(5,0),oe(4,2),oe(3,0),oe(2,2)];case"1st":return[oe(5,0),oe(4,1),oe(3,-2),oe(2,1)];case"2nd":return[oe(5,0),oe(4,0),oe(3,-1),oe(2,2)];case"3rd":return[oe(5,0),oe(4,1),oe(3,-1),oe(2,0)]}case"Min7":switch(r){case"Root":return[oe(5,0),oe(4,2),oe(3,0),oe(2,1)];case"1st":return[oe(5,0),oe(4,2),oe(3,-1),oe(2,2)];case"2nd":return[oe(5,0),oe(4,0),oe(3,-2),oe(2,1)];case"3rd":return[oe(5,0),oe(4,0),oe(3,-1),oe(2,0)]}case"Half-Dim7":switch(r){case"Root":return[oe(5,0),oe(4,1),oe(3,0),oe(2,1)];case"1st":return[oe(5,0),oe(4,2),oe(3,-1),oe(2,1)];case"2nd":return[oe(5,0),oe(4,1),oe(3,-1),oe(2,2)];case"3rd":return[oe(5,0),oe(4,0),oe(3,-2),oe(2,0)]}case"Dim7":switch(r){case"Root":case"1st":case"2nd":case"3rd":return[oe(5,0),oe(4,1),oe(3,-1),oe(2,1)]}}default:return[]}}},QR={toTex(t){return`(${t.notes.map(e=>fd.toTex(e)+" ").join("")}).1${t.name&&`{ch "${t.name}"}`}|`},generate(t,e,r,i){var n=[];const s=i?[i]:["Root","1st","2nd","3rd"];for(const a of s){const o=Bo.bassNote(a,e,t),l=r?fd.onString(r,o):fd.onString(6,o).concat(fd.onString(5,o));n=n.concat(l.map(c=>({name:`${Gr.toDisplayString(t)}${Fa.toLeadSheet(e)}${a==="Root"?"":`/${Gr.toDisplayString(o)}`}`,notes:LQ.generate(c.string,e,a).map(u=>({string:u.string,fret:u.fret+c.fret}))})))}return n.filter(a=>!a.notes.some(o=>o.fretqR)).sort((a,o)=>Math.min(...a.notes.map(l=>l.fret))-Math.min(...o.notes.map(l=>l.fret))).sort((a,o)=>Math.max(...o.notes.map(l=>l.string))-Math.max(...a.notes.map(l=>l.string)))}},FQ={toTex(t){return`\\ks ${Gr.toDisplayString(t.key.note)} ${t.chords.map(e=>QR.toTex(e)).join("")}`}};var Ya;(function(t){t[t.Page=0]="Page",t[t.Horizontal=1]="Horizontal"})(Ya||(Ya={}));var Cn;(function(t){t[t.Default=0]="Default",t[t.ScoreTab=1]="ScoreTab",t[t.Score=2]="Score",t[t.Tab=3]="Tab",t[t.TabMixed=4]="TabMixed"})(Cn||(Cn={}));class za{static getValue(e){return za._values||(za._values=new Map),e=e.toLowerCase().replaceAll(" ",""),za._values.has(e)?za._values.get(e):0}static isPiano(e){return e<=7||e>=16&&e<=23}static isGuitar(e){return e>=24&&e<=39||e===105||e===43}}za._values=new Map([["acousticgrandpiano",0],["brightacousticpiano",1],["electricgrandpiano",2],["honkytonkpiano",3],["electricpiano1",4],["electricpiano2",5],["harpsichord",6],["clavinet",7],["celesta",8],["glockenspiel",9],["musicbox",10],["vibraphone",11],["marimba",12],["xylophone",13],["tubularbells",14],["dulcimer",15],["drawbarorgan",16],["percussiveorgan",17],["rockorgan",18],["churchorgan",19],["reedorgan",20],["accordion",21],["harmonica",22],["tangoaccordion",23],["acousticguitarnylon",24],["acousticguitarsteel",25],["electricguitarjazz",26],["electricguitarclean",27],["electricguitarmuted",28],["overdrivenguitar",29],["distortionguitar",30],["guitarharmonics",31],["acousticbass",32],["electricbassfinger",33],["electricbasspick",34],["fretlessbass",35],["slapbass1",36],["slapbass2",37],["synthbass1",38],["synthbass2",39],["violin",40],["viola",41],["cello",42],["contrabass",43],["tremolostrings",44],["pizzicatostrings",45],["orchestralharp",46],["timpani",47],["stringensemble1",48],["stringensemble2",49],["synthstrings1",50],["synthstrings2",51],["choiraahs",52],["voiceoohs",53],["synthvoice",54],["orchestrahit",55],["trumpet",56],["trombone",57],["tuba",58],["mutedtrumpet",59],["frenchhorn",60],["brasssection",61],["synthbrass1",62],["synthbrass2",63],["sopranosax",64],["altosax",65],["tenorsax",66],["baritonesax",67],["oboe",68],["englishhorn",69],["bassoon",70],["clarinet",71],["piccolo",72],["flute",73],["recorder",74],["panflute",75],["blownbottle",76],["shakuhachi",77],["whistle",78],["ocarina",79],["lead1square",80],["lead2sawtooth",81],["lead3calliope",82],["lead4chiff",83],["lead5charang",84],["lead6voice",85],["lead7fifths",86],["lead8bassandlead",87],["pad1newage",88],["pad2warm",89],["pad3polysynth",90],["pad4choir",91],["pad5bowed",92],["pad6metallic",93],["pad7halo",94],["pad8sweep",95],["fx1rain",96],["fx2soundtrack",97],["fx3crystal",98],["fx4atmosphere",99],["fx5brightness",100],["fx6goblins",101],["fx7echoes",102],["fx8scifi",103],["sitar",104],["banjo",105],["shamisen",106],["koto",107],["kalimba",108],["bagpipe",109],["fiddle",110],["shanai",111],["tinklebell",112],["agogo",113],["steeldrums",114],["woodblock",115],["taikodrum",116],["melodictom",117],["synthdrum",118],["reversecymbal",119],["guitarfretnoise",120],["breathnoise",121],["seashore",122],["birdtweet",123],["telephonering",124],["helicopter",125],["applause",126],["gunshot",127]]);class Bu{init(e,r){this.data=e,this.settings=r}}var mi;(function(t){t[t.General=0]="General",t[t.Format=1]="Format",t[t.AlphaTex=2]="AlphaTex"})(mi||(mi={}));class gi extends Error{constructor(e,r="",i){super(r??"",{cause:i}),this.type=e,this.inner=i??null,Object.setPrototypeOf(this,gi.prototype)}}class jr extends gi{constructor(e=null,r=null){super(mi.Format,e??"Unsupported format"),this.inner=r,Object.setPrototypeOf(this,jr.prototype)}}var Yr;(function(t){t[t.None=0]="None",t[t.Normal=1]="Normal",t[t.Heavy=2]="Heavy"})(Yr||(Yr={}));var oi;(function(t){t[t.Tempo=0]="Tempo",t[t.Volume=1]="Volume",t[t.Instrument=2]="Instrument",t[t.Balance=3]="Balance"})(oi||(oi={}));class Ei{constructor(){this.isLinear=!1,this.type=oi.Tempo,this.value=0,this.ratioPosition=0,this.text=""}static buildTempoAutomation(e,r,i,n){(n<1||n>5)&&(n=2);let s=new Float32Array([1,.5,1,1.5,2,3]),a=new Ei;return a.type=oi.Tempo,a.isLinear=e,a.ratioPosition=r,a.value=i*s[n],a}static buildInstrumentAutomation(e,r,i){let n=new Ei;return n.type=oi.Instrument,n.isLinear=e,n.ratioPosition=r,n.value=i,n}}var ot;(function(t){t[t.Neutral=0]="Neutral",t[t.C3=1]="C3",t[t.C4=2]="C4",t[t.F4=3]="F4",t[t.G2=4]="G2"})(ot||(ot={}));var Ft;(function(t){t[t._15ma=0]="_15ma",t[t._8va=1]="_8va",t[t.Regular=2]="Regular",t[t._8vb=3]="_8vb",t[t._15mb=4]="_15mb"})(Ft||(Ft={}));var qn;(function(t){t[t.None=0]="None",t[t.Simple=1]="Simple",t[t.FirstOfDouble=2]="FirstOfDouble",t[t.SecondOfDouble=3]="SecondOfDouble"})(qn||(qn={}));class ao{constructor(){this.id=ao._globalBarId++,this.index=0,this.nextBar=null,this.previousBar=null,this.clef=ot.G2,this.clefOttava=Ft.Regular,this.voices=[],this.simileMark=qn.None,this.isMultiVoice=!1,this.displayScale=1,this.displayWidth=-1}get masterBar(){return this.staff.track.score.masterBars[this.index]}get isEmpty(){for(let e=0,r=this.voices.length;e0&&!s.isEmpty&&(this.isMultiVoice=!0)}}calculateDuration(){let e=0;for(let r of this.voices){let i=r.calculateDuration();i>e&&(e=i)}return e}}ao._globalBarId=0;class lt{static ticksToMillis(e,r){return e*(6e4/(r*lt.QuarterTime))|0}static millisToTicks(e,r){return e/(6e4/(r*lt.QuarterTime))|0}static toTicks(e){return lt.valueToTicks(e)}static valueToTicks(e){let r=e;return r<0&&(r=1/-r),lt.QuarterTime*(4/r)|0}static applyDot(e,r){return r?e+(e/4|0)*3:e+(e/2|0)}static applyTuplet(e,r,i){return e*i/r|0}static removeTuplet(e,r,i){return e*r/i|0}static dynamicToVelocity(e){return lt.MinVelocity+e*lt.VelocityIncrement}}lt.QuarterTime=960;lt.MinVelocity=15;lt.VelocityIncrement=16;class Me{constructor(e=0,r=0){this.offset=e,this.value=r}}Me.MaxPosition=60;Me.MaxValue=12;var Gt;(function(t){t[t.Default=0]="Default",t[t.Gradual=1]="Gradual",t[t.Fast=2]="Fast"})(Gt||(Gt={}));var We;(function(t){t[t.None=0]="None",t[t.Custom=1]="Custom",t[t.Bend=2]="Bend",t[t.Release=3]="Release",t[t.BendRelease=4]="BendRelease",t[t.Hold=5]="Hold",t[t.Prebend=6]="Prebend",t[t.PrebendBend=7]="PrebendBend",t[t.PrebendRelease=8]="PrebendRelease"})(We||(We={}));var ir;(function(t){t[t.None=0]="None",t[t.BrushUp=1]="BrushUp",t[t.BrushDown=2]="BrushDown",t[t.ArpeggioUp=3]="ArpeggioUp",t[t.ArpeggioDown=4]="ArpeggioDown"})(ir||(ir={}));var pn;(function(t){t[t.None=0]="None",t[t.Crescendo=1]="Crescendo",t[t.Decrescendo=2]="Decrescendo"})(pn||(pn={}));var H;(function(t){t[t.QuadrupleWhole=-4]="QuadrupleWhole",t[t.DoubleWhole=-2]="DoubleWhole",t[t.Whole=1]="Whole",t[t.Half=2]="Half",t[t.Quarter=4]="Quarter",t[t.Eighth=8]="Eighth",t[t.Sixteenth=16]="Sixteenth",t[t.ThirtySecond=32]="ThirtySecond",t[t.SixtyFourth=64]="SixtyFourth",t[t.OneHundredTwentyEighth=128]="OneHundredTwentyEighth",t[t.TwoHundredFiftySixth=256]="TwoHundredFiftySixth"})(H||(H={}));var yt;(function(t){t[t.PPP=0]="PPP",t[t.PP=1]="PP",t[t.P=2]="P",t[t.MP=3]="MP",t[t.MF=4]="MF",t[t.F=5]="F",t[t.FF=6]="FF",t[t.FFF=7]="FFF"})(yt||(yt={}));var Ze;(function(t){t[t.None=0]="None",t[t.OnBeat=1]="OnBeat",t[t.BeforeBeat=2]="BeforeBeat",t[t.BendGrace=3]="BendGrace"})(Ze||(Ze={}));var at;(function(t){t[t.Unknown=-2]="Unknown",t[t.NoOrDead=-1]="NoOrDead",t[t.Thumb=0]="Thumb",t[t.IndexFinger=1]="IndexFinger",t[t.MiddleFinger=2]="MiddleFinger",t[t.AnnularFinger=3]="AnnularFinger",t[t.LittleFinger=4]="LittleFinger"})(at||(at={}));var qe;(function(t){t[t.None=0]="None",t[t.Natural=1]="Natural",t[t.Artificial=2]="Artificial",t[t.Pinch=3]="Pinch",t[t.Tap=4]="Tap",t[t.Semi=5]="Semi",t[t.Feedback=6]="Feedback"})(qe||(qe={}));var Or;(function(t){t[t.Default=0]="Default",t[t.ForceNone=1]="ForceNone",t[t.ForceNatural=2]="ForceNatural",t[t.ForceSharp=3]="ForceSharp",t[t.ForceDoubleSharp=4]="ForceDoubleSharp",t[t.ForceFlat=5]="ForceFlat",t[t.ForceDoubleFlat=6]="ForceDoubleFlat"})(Or||(Or={}));var pi;(function(t){t[t.None=0]="None",t[t.IntoFromBelow=1]="IntoFromBelow",t[t.IntoFromAbove=2]="IntoFromAbove"})(pi||(pi={}));var ut;(function(t){t[t.None=0]="None",t[t.Shift=1]="Shift",t[t.Legato=2]="Legato",t[t.OutUp=3]="OutUp",t[t.OutDown=4]="OutDown",t[t.PickSlideDown=5]="PickSlideDown",t[t.PickSlideUp=6]="PickSlideUp"})(ut||(ut={}));var Dt;(function(t){t[t.None=0]="None",t[t.Slight=1]="Slight",t[t.Wide=2]="Wide"})(Dt||(Dt={}));var Wa;(function(t){t[t.Hidden=0]="Hidden",t[t.ShowWithBeams=1]="ShowWithBeams",t[t.ShowWithBars=2]="ShowWithBars"})(Wa||(Wa={}));var ta;(function(t){t[t.ScoreDefault=0]="ScoreDefault",t[t.ScoreForcePiano=1]="ScoreForcePiano",t[t.SingleNoteEffectBand=2]="SingleNoteEffectBand",t[t.SingleNoteEffectBandForcePiano=3]="SingleNoteEffectBandForcePiano"})(ta||(ta={}));var ai;(function(t){t[t.GuitarPro=0]="GuitarPro",t[t.SongBook=1]="SongBook"})(ai||(ai={}));var rt;(function(t){t[t.ScoreTitle=0]="ScoreTitle",t[t.ScoreSubTitle=1]="ScoreSubTitle",t[t.ScoreArtist=2]="ScoreArtist",t[t.ScoreAlbum=3]="ScoreAlbum",t[t.ScoreWords=4]="ScoreWords",t[t.ScoreMusic=5]="ScoreMusic",t[t.ScoreWordsAndMusic=6]="ScoreWordsAndMusic",t[t.ScoreCopyright=7]="ScoreCopyright",t[t.GuitarTuning=8]="GuitarTuning",t[t.TrackNames=9]="TrackNames",t[t.ChordDiagrams=10]="ChordDiagrams",t[t.ParenthesisOnTiedBends=11]="ParenthesisOnTiedBends",t[t.TabNotesOnTiedBends=12]="TabNotesOnTiedBends",t[t.ZerosOnDiveWhammys=13]="ZerosOnDiveWhammys",t[t.EffectAlternateEndings=14]="EffectAlternateEndings",t[t.EffectCapo=15]="EffectCapo",t[t.EffectChordNames=16]="EffectChordNames",t[t.EffectCrescendo=17]="EffectCrescendo",t[t.EffectDynamics=18]="EffectDynamics",t[t.EffectFadeIn=19]="EffectFadeIn",t[t.EffectFermata=20]="EffectFermata",t[t.EffectFingering=21]="EffectFingering",t[t.EffectHarmonics=22]="EffectHarmonics",t[t.EffectLetRing=23]="EffectLetRing",t[t.EffectLyrics=24]="EffectLyrics",t[t.EffectMarker=25]="EffectMarker",t[t.EffectOttavia=26]="EffectOttavia",t[t.EffectPalmMute=27]="EffectPalmMute",t[t.EffectPickSlide=28]="EffectPickSlide",t[t.EffectPickStroke=29]="EffectPickStroke",t[t.EffectSlightBeatVibrato=30]="EffectSlightBeatVibrato",t[t.EffectSlightNoteVibrato=31]="EffectSlightNoteVibrato",t[t.EffectTap=32]="EffectTap",t[t.EffectTempo=33]="EffectTempo",t[t.EffectText=34]="EffectText",t[t.EffectTrill=35]="EffectTrill",t[t.EffectTripletFeel=36]="EffectTripletFeel",t[t.EffectWhammyBar=37]="EffectWhammyBar",t[t.EffectWideBeatVibrato=38]="EffectWideBeatVibrato",t[t.EffectWideNoteVibrato=39]="EffectWideNoteVibrato",t[t.EffectLeftHandTap=40]="EffectLeftHandTap"})(rt||(rt={}));class mh{constructor(){this.notationMode=ai.GuitarPro,this.fingeringMode=ta.ScoreDefault,this.elements=new Map,this.rhythmMode=Wa.Hidden,this.rhythmHeight=15,this.transpositionPitches=[],this.displayTranspositionPitches=[],this.smallGraceTabNotes=!0,this.extendBendArrowsOnTiedNotes=!0,this.extendLineEffectsToBeatEnd=!1,this.slurHeight=5}isNotationElementVisible(e){return this.elements.has(e)?this.elements.get(e):mh.defaultElements.has(e)?mh.defaultElements.get(e):!0}}mh.defaultElements=new Map([[rt.ZerosOnDiveWhammys,!1]]);class JR{constructor(e){this._value=void 0,this._factory=e}get value(){return this._value===void 0&&(this._value=this._factory()),this._value}}var Gs;(function(t){t[t.None=0]="None",t[t.Debug=1]="Debug",t[t.Info=2]="Info",t[t.Warning=3]="Warning",t[t.Error=4]="Error"})(Gs||(Gs={}));class Sl{static format(e,r){return`[AlphaTab][${e}] ${r}`}debug(e,r,...i){console.debug(Sl.format(e,r),...i)}warning(e,r,...i){console.warn(Sl.format(e,r),...i)}info(e,r,...i){console.info(Sl.format(e,r),...i)}error(e,r,...i){console.error(Sl.format(e,r),...i)}}Sl.logLevel=Gs.Info;class he{static shouldLog(e){return he.logLevel!==Gs.None&&e>=he.logLevel}static debug(e,r,...i){he.shouldLog(Gs.Debug)&&he.log.debug(e,r,...i)}static warning(e,r,...i){he.shouldLog(Gs.Warning)&&he.log.warning(e,r,...i)}static info(e,r,...i){he.shouldLog(Gs.Info)&&he.log.info(e,r,...i)}static error(e,r,...i){he.shouldLog(Gs.Error)&&he.log.error(e,r,...i)}}he.logLevel=Gs.Info;he.log=new Sl;class IQ{constructor(){this.note=null,this.noteValue=0,this.octave=0}get realValue(){return this.octave*12+this.noteValue}}class er{static getIndex(e){let r=0;return e<0?r:Math.log2(e)|0}static keySignatureIsFlat(e){return e<0}static keySignatureIsNatural(e){return e===0}static keySignatureIsSharp(e){return e>0}static applyPitchOffsets(e,r){for(let i=0;i=48&&a<=57){if(!r)return null;i+=String.fromCharCode(a)}else if(a>=65&&a<=90||a>=97&&a<=122||a===35)r+=String.fromCharCode(a);else return null}if(!i||!r)return null;let n=new IQ;return n.octave=parseInt(i)+1,n.note=r.toLowerCase(),n.noteValue=er.getToneForText(n.note),n}static getTuningForText(e){let r=er.parseTuning(e);return r?r.realValue:-1}static getToneForText(e){switch(e.toLowerCase()){case"c":return 0;case"c#":case"db":return 1;case"d":return 2;case"d#":case"eb":return 3;case"e":return 4;case"f":return 5;case"f#":case"gb":return 6;case"g":return 7;case"g#":case"ab":return 8;case"a":return 9;case"a#":case"bb":return 10;case"b":return 11;default:return 0}}static newGuid(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+"-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)+Math.floor((1+Math.random())*65536).toString(16).substring(1)}static isAlmostEqualTo(e,r){return Math.abs(e-r)<1e-5}static toHexString(e,r=0){let i="",n="0123456789ABCDEF";do i=String.fromCharCode(n.charCodeAt(e&15))+i,e=e>>4;while(e>0);for(;i.length=ki.gp6ElementAndVariationToArticulation.length&&(r=0),ki.gp6ElementAndVariationToArticulation[e][r]):38}static getArticulation(e){const r=e.percussionArticulation,i=e.beat.voice.bar.staff.track.percussionArticulations;return r=0}get isPiano(){return!this.isStringed&&this.octave>=0&&this.tone>=0}get isPercussion(){return!this.isStringed&&this.percussionArticulation>=0}get element(){return this.isPercussion?ki.getElementAndVariation(this)[0]:-1}get variation(){return this.isPercussion?ki.getElementAndVariation(this)[1]:-1}get isHammerPullDestination(){return!!this.hammerPullOrigin}get isSlurOrigin(){return!!this.slurDestination}get isHarmonic(){return this.harmonicType!==qe.None}get isTieOrigin(){return this.tieDestination!==null}get trillFret(){return this.trillValue-this.stringTuning}get isTrill(){return this.trillValue>=0}get isEffectSlurDestination(){return!!this.effectSlurOrigin}get stringTuning(){return this.beat.voice.bar.staff.capo+kr.getStringTuning(this.beat.voice.bar.staff,this.string)}static getStringTuning(e,r){return e.tuning.length>0?e.tuning[e.tuning.length-(r-1)-1]:0}get realValue(){return this.calculateRealValue(!0,!0)}get realValueWithoutHarmonic(){return this.calculateRealValue(!0,!1)}calculateRealValue(e,r){const i=e?this.beat.voice.bar.staff.transpositionPitch:0;if(r){let n=this.calculateRealValue(e,!1);return this.isStringed&&(this.harmonicType===qe.Natural?n=this.harmonicPitch+this.stringTuning-i:n+=this.harmonicPitch),n}else return this.isPercussion?this.percussionArticulation:this.isStringed?this.fret+this.stringTuning-i:this.isPiano?this.octave*12+this.tone-i:0}get harmonicPitch(){if(this.harmonicType===qe.None||!this.isStringed)return 0;let e=this.harmonicValue;return er.isAlmostEqualTo(e,2.4)?36:er.isAlmostEqualTo(e,2.7)?34:e<3?0:e<=3.5?31:e<=4?28:e<=5?24:e<=6?34:e<=7?19:e<=8.5?36:e<=9?28:e<=10?34:e<=11?0:e<=12?12:e<14?0:e<=15?34:e<=16?28:e<=17?36:e<=18?0:e<=19?19:e<=21?0:e<=22?36:e<=24?24:0}get initialBendValue(){return this.hasBend?Math.floor(this.bendPoints[0].value/2):this.bendOrigin?Math.floor(this.bendOrigin.bendPoints[this.bendOrigin.bendPoints.length-1].value/2):this.isTieDestination&&this.tieOrigin.bendOrigin?Math.floor(this.tieOrigin.bendOrigin.bendPoints[this.tieOrigin.bendOrigin.bendPoints.length-1].value/2):this.beat.hasWhammyBar?Math.floor(this.beat.whammyBarPoints[0].value/2):this.beat.isContinuedWhammy?Math.floor(this.beat.previousBeat.whammyBarPoints[this.beat.previousBeat.whammyBarPoints.length-1].value/2):0}get displayValue(){return this.displayValueWithoutBend+this.initialBendValue}get displayValueWithoutBend(){let e=this.realValue;switch(this.harmonicType!==qe.Natural&&this.harmonicType!==qe.None&&(e-=this.harmonicPitch),this.beat.ottava){case Ft._15ma:e-=24;break;case Ft._8va:e-=12;break;case Ft.Regular:break;case Ft._8vb:e+=12;break;case Ft._15mb:e+=24;break}switch(this.beat.voice.bar.clefOttava){case Ft._15ma:e-=24;break;case Ft._8va:e-=12;break;case Ft.Regular:break;case Ft._8vb:e+=12;break;case Ft._15mb:e+=24;break}return e-this.beat.voice.bar.staff.displayTranspositionPitch}get hasQuarterToneOffset(){return this.hasBend?this.bendPoints[0].value%2!==0:this.bendOrigin?this.bendOrigin.bendPoints[this.bendOrigin.bendPoints.length-1].value%2!==0:this.beat.hasWhammyBar?this.beat.whammyBarPoints[0].value%2!==0:this.beat.isContinuedWhammy?this.beat.previousBeat.whammyBarPoints[this.beat.previousBeat.whammyBarPoints.length-1].value%2!==0:!1}addBendPoint(e){let r=this.bendPoints;r===null&&(r=[],this.bendPoints=r),r.push(e),(!this.maxBendPoint||e.value>this.maxBendPoint.value)&&(this.maxBendPoint=e),this.bendType===We.None&&(this.bendType=We.Custom)}finish(e,r=null){let i=new JR(()=>kr.nextNoteOnSameLine(this)),n=e&&e.notation.notationMode===ai.SongBook;if(this.isTieDestination&&(this.chain(r),n&&this.tieOrigin&&this.tieOrigin.isLetRing&&(this.isLetRing=!0)),this.isLetRing&&(!i.value||!i.value.isLetRing?this.letRingDestination=this:this.letRingDestination=i.value,n&&this.isTieDestination&&!this.tieOrigin.hasBend&&(this.isVisible=!1)),this.isPalmMute&&(!i.value||!i.value.isPalmMute?this.palmMuteDestination=this:this.palmMuteDestination=i.value),this.isHammerPullOrigin){let o=kr.findHammerPullDestination(this);o?(this.hammerPullDestination=o,o.hammerPullOrigin=this):this.isHammerPullOrigin=!1}switch(this.slideOutType){case ut.Shift:case ut.Legato:this.slideTarget=i.value,this.slideTarget?this.slideTarget.slideOrigin=this:this.slideOutType=ut.None;break}let s=null;this.isHammerPullOrigin&&this.hammerPullDestination?s=this.hammerPullDestination:this.slideOutType===ut.Legato&&this.slideTarget&&(s=this.slideTarget),s&&(this.hasEffectSlur=!0,this.effectSlurOrigin&&this.beat.pickStroke===Bi.None?(this.effectSlurOrigin.effectSlurDestination=s,this.effectSlurOrigin.effectSlurDestination.effectSlurOrigin=this.effectSlurOrigin,this.effectSlurOrigin=null):(this.isEffectSlurOrigin=!0,this.effectSlurDestination=s,this.effectSlurDestination.effectSlurOrigin=this));const a=this.bendPoints;if(a!=null&&a.length>0&&this.bendType===We.Custom){let o=this.isTieDestination&&this.tieOrigin.hasBend;if(this.isContinuedBend=o,a.length===4){let l=a[0],c=a[1],u=a[2],d=a[3];c.value===u.value?d.value>l.value?c.value>d.value?this.bendType=We.BendRelease:!o&&l.value>0?(this.bendType=We.PrebendBend,a.splice(2,1),a.splice(1,1)):(this.bendType=We.Bend,a.splice(2,1),a.splice(1,1)):d.valuel.value?this.bendType=We.BendRelease:l.value>0&&!o?(this.bendType=We.Prebend,a.splice(2,1),a.splice(1,1)):(this.bendType=We.Hold,a.splice(2,1),a.splice(1,1)):he.warning("Model","Unsupported bend type detected, fallback to custom",null)}else if(a.length===2){let l=a[0],c=a[1];c.value>l.value?!o&&l.value>0?this.bendType=We.PrebendBend:this.bendType=We.Bend:c.value0&&(this.accidentalMode=Or.Default)}static nextNoteOnSameLine(e){let r=e.beat.nextBeat;for(;r&&r.voice.bar.index<=e.beat.voice.bar.index+kr.MaxOffsetForSameLineSearch;){let i=r.getNoteOnString(e.string);if(i)return i;r=r.nextBeat}return null}static findHammerPullDestination(e){let r=e.beat.nextBeat;for(;r&&r.voice.bar.index<=e.beat.voice.bar.index+kr.MaxOffsetForSameLineSearch;){let i=r.getNoteOnString(e.string);if(i)return i;for(let n=e.string;n>0;n--)if(i=r.getNoteOnString(n),i){if(i.isLeftHandTapped)return i;break}for(let n=e.string;n<=e.beat.voice.bar.staff.tuning.length;n++)if(i=r.getNoteOnString(n),i){if(i.isLeftHandTapped)return i;break}r=r.nextBeat}return null}static findTieOrigin(e){let r=e.beat.previousBeat;for(;r&&r.voice.bar.index>=e.beat.voice.bar.index-kr.MaxOffsetForSameLineSearch;){if(e.isStringed){let i=r.getNoteOnString(e.string);if(i)return i}else if(e.octave===-1&&e.tone===-1){if(e.index0&&(this.id=this.beats[0].absoluteDisplayStart+"_"+this.beats[0].voice.index)}}var js;(function(t){t[t.Auto=0]="Auto",t[t.ForceSplitToNext=1]="ForceSplitToNext",t[t.ForceMergeWithNext=2]="ForceMergeWithNext"})(js||(js={}));class Mi{constructor(){this.id=Mi._globalBeatId++,this.index=0,this.previousBeat=null,this.nextBeat=null,this.notes=[],this.noteStringLookup=new Map,this.noteValueLookup=new Map,this.isEmpty=!1,this.whammyStyle=Gt.Default,this.ottava=Ft.Regular,this.fermata=null,this.isLegatoOrigin=!1,this.minNote=null,this.maxNote=null,this.maxStringNote=null,this.minStringNote=null,this.duration=H.Quarter,this.isLetRing=!1,this.isPalmMute=!1,this.automations=[],this.dots=0,this.fadeIn=!1,this.lyrics=null,this.hasRasgueado=!1,this.pop=!1,this.slap=!1,this.tap=!1,this.text=null,this.brushType=ir.None,this.brushDuration=0,this.tupletDenominator=-1,this.tupletNumerator=-1,this.tupletGroup=null,this.isContinuedWhammy=!1,this.whammyBarType=Lt.None,this.whammyBarPoints=null,this.maxWhammyPoint=null,this.minWhammyPoint=null,this.vibrato=Dt.None,this.chordId=null,this.graceType=Ze.None,this.graceGroup=null,this.graceIndex=-1,this.pickStroke=Bi.None,this.tremoloSpeed=null,this.crescendo=pn.None,this.displayStart=0,this.playbackStart=0,this.displayDuration=0,this.playbackDuration=0,this.dynamics=yt.F,this.invertBeamDirection=!1,this.preferredBeamDirection=null,this.isEffectSlurOrigin=!1,this.effectSlurOrigin=null,this.effectSlurDestination=null,this.beamingMode=js.Auto}get isLastOfVoice(){return this.index===this.voice.beats.length-1}get isLegatoDestination(){return!!this.previousBeat&&this.previousBeat.isLegatoOrigin}get isRest(){return this.isEmpty||this.notes.length===0}get isFullBarRest(){return this.isRest&&this.voice.beats.length===1&&this.duration===H.Whole}get hasTuplet(){return!(this.tupletDenominator===-1&&this.tupletNumerator===-1)&&!(this.tupletDenominator===1&&this.tupletNumerator===1)}get hasWhammyBar(){return this.whammyBarPoints!==null&&this.whammyBarType!==Lt.None}get hasChord(){return!!this.chordId}get chord(){return this.chordId?this.voice.bar.staff.getChord(this.chordId):null}get isTremolo(){return!!this.tremoloSpeed}get absoluteDisplayStart(){return this.voice.bar.masterBar.start+this.displayStart}get absolutePlaybackStart(){return this.voice.bar.masterBar.start+this.playbackStart}get isEffectSlurDestination(){return!!this.effectSlurOrigin}addWhammyBarPoint(e){let r=this.whammyBarPoints;r===null&&(r=[],this.whammyBarPoints=r),r.push(e),(!this.maxWhammyPoint||e.value>this.maxWhammyPoint.value)&&(this.maxWhammyPoint=e),(!this.minWhammyPoint||e.value=r.length)return;r.splice(e,1);let i=r[e];if(i===this.maxWhammyPoint){this.maxWhammyPoint=null;for(let n of r)(!this.maxWhammyPoint||n.value>this.maxWhammyPoint.value)&&(this.maxWhammyPoint=n)}if(i===this.minWhammyPoint){this.minWhammyPoint=null;for(let n of r)(!this.minWhammyPoint||n.value=0&&(this.notes.splice(r,1),e.isStringed&&this.noteStringLookup.delete(e.string))}getAutomation(e){for(let r=0,i=this.automations.length;r0&&this.tupletNumerator>=0&&(e=lt.applyTuplet(e,this.tupletNumerator,this.tupletDenominator)),e}updateDurations(){let e=this.calculateDuration();switch(this.playbackDuration=e,this.graceType){case Ze.BeforeBeat:case Ze.OnBeat:switch(this.duration){case H.Sixteenth:this.playbackDuration=lt.toTicks(H.SixtyFourth);break;case H.ThirtySecond:this.playbackDuration=lt.toTicks(H.OneHundredTwentyEighth);break;default:this.playbackDuration=lt.toTicks(H.ThirtySecond);break}this.displayDuration=0;break;case Ze.BendGrace:this.playbackDuration/=2,this.displayDuration=0;break;default:this.displayDuration=e;let r=this.previousBeat;r&&r.graceType===Ze.BendGrace&&(this.playbackDuration=r.playbackDuration);break}}finishTuplet(){let e=this.previousBeat,r=e?e.tupletGroup:null;(this.hasTuplet||this.graceType!==Ze.None&&r)&&((!e||!r||!r.check(this))&&(r=new Ci(this.voice),r.check(this)),this.tupletGroup=r)}finish(e,r=null){switch(this.getAutomation(oi.Instrument)===null&&this.index===0&&this.voice.index===0&&this.voice.bar.index===0&&this.voice.bar.staff.index===0&&this.automations.push(Ei.buildInstrumentAutomation(!1,0,this.voice.bar.staff.track.playbackInfo.program)),this.graceType){case Ze.OnBeat:case Ze.BeforeBeat:let c=this.graceGroup.beats.length;c===1?this.duration=H.Eighth:c===2?this.duration=H.Sixteenth:this.duration=H.ThirtySecond;break}let i=e?e.notation.notationMode:ai.GuitarPro,n=this.text==="grad"||this.text==="grad.";n&&i===ai.SongBook&&(this.text="");let s=!1;this.minNote=null,this.maxNote=null,this.minStringNote=null,this.maxStringNote=null;let a=0,o=!1;for(let c=0,u=this.notes.length;cthis.maxNote.realValue)&&(this.maxNote=d),(!this.minStringNote||d.stringthis.maxStringNote.string)&&(this.maxStringNote=d),d.hasEffectSlur&&(o=!0))}if(o&&(this.effectSlurOrigin?(this.effectSlurOrigin.effectSlurDestination=this.nextBeat,this.effectSlurOrigin.effectSlurDestination&&(this.effectSlurOrigin.effectSlurDestination.effectSlurOrigin=this.effectSlurOrigin),this.effectSlurOrigin=null):(this.isEffectSlurOrigin=!0,this.effectSlurDestination=this.nextBeat,this.effectSlurDestination&&(this.effectSlurDestination.effectSlurOrigin=this))),this.notes.length>0&&a===0&&(this.isEmpty=!0),!this.isRest&&(!this.isLetRing||!this.isPalmMute)){let c=this.previousBeat;for(;c&&c.isRest;)this.isLetRing||(c.isLetRing=!1),this.isPalmMute||(c.isPalmMute=!1),c=c.previousBeat}else this.isRest&&this.previousBeat&&e&&e.notation.notationMode===ai.GuitarPro&&(this.previousBeat.isLetRing&&(this.isLetRing=!0),this.previousBeat.isPalmMute&&(this.isPalmMute=!0));const l=this.whammyBarPoints;if(l!==null&&l.length>0&&this.whammyBarType===Lt.Custom){i===ai.SongBook&&(this.whammyStyle=n?Gt.Gradual:Gt.Fast);let c=!!this.previousBeat&&this.previousBeat.hasWhammyBar;if(this.isContinuedWhammy=c,l.length===4){let u=l[0],d=l[1],h=l[2],p=l[3];d.value===h.value&&(u.valued.value&&d.value>p.value?(u.value!==0&&!c?this.whammyBarType=Lt.PrediveDive:this.whammyBarType=Lt.Dive,l.splice(2,1),l.splice(1,1)):u.value>d.value&&d.valuep.value?(this.whammyBarType=Lt.Dip,(d.offset===h.offset||i===ai.SongBook)&&l.splice(2,1)):u.value===d.value&&d.value===p.value&&(u.value!==0&&!c?this.whammyBarType=Lt.Predive:this.whammyBarType=Lt.Hold,l.splice(2,1),l.splice(1,1)))}}if(this.updateDurations(),s){let c=MS.clone(this);c.id=Mi._globalBeatId++,c.pickStroke=Bi.None;for(let u=0,d=c.notes.length;ue.voice.bar.index||e.voice.bar.index===this.voice.bar.index&&this.index>e.index}hasNoteOnString(e){return this.noteStringLookup.has(e)}getNoteWithRealValue(e){return this.noteValueLookup.has(e)?this.noteValueLookup.get(e):null}chain(e=null){for(const r of this.notes)this.noteValueLookup.set(r.realValue,r),r.chain(e)}}Mi._globalBeatId=0;class Ho{constructor(){this.name="",this.firstFret=1,this.strings=[],this.barreFrets=[],this.showName=!0,this.showDiagram=!0,this.showFingering=!0}get uniqueId(){return[this.name,this.firstFret.toString(),this.strings.join(","),this.barreFrets.join(","),this.showDiagram.toString(),this.showFingering.toString(),this.showName.toString()].join("|")}}var ei;(function(t){t[t.Cb=-7]="Cb",t[t.Gb=-6]="Gb",t[t.Db=-5]="Db",t[t.Ab=-4]="Ab",t[t.Eb=-3]="Eb",t[t.Bb=-2]="Bb",t[t.F=-1]="F",t[t.C=0]="C",t[t.G=1]="G",t[t.D=2]="D",t[t.A=3]="A",t[t.E=4]="E",t[t.B=5]="B",t[t.FSharp=6]="FSharp",t[t.CSharp=7]="CSharp"})(ei||(ei={}));var Fi;(function(t){t[t.IgnoreSpaces=0]="IgnoreSpaces",t[t.Begin=1]="Begin",t[t.Text=2]="Text",t[t.Comment=3]="Comment",t[t.Dash=4]="Dash"})(Fi||(Fi={}));class Hr{constructor(){this.startBar=0,this.text=""}finish(e=!1){this.chunks=[],this.parse(this.text,0,this.chunks,e)}parse(e,r,i,n){if(!e)return;let s=Fi.Begin,a=Fi.Begin,o=!1,l=0;for(;r0&&e!=="-")&&this.chunks.push(e)}prepareChunk(e){let r=e.split("+").join(" "),i=r.length;for(;i>0&&r.charAt(i-1)==="_";)i--;return i!==r.length?r.substr(0,i):r}}Hr.CharCodeLF=10;Hr.CharCodeTab=9;Hr.CharCodeCR=13;Hr.CharCodeSpace=32;Hr.CharCodeBrackedClose=93;Hr.CharCodeBrackedOpen=91;Hr.CharCodeDash=45;var Uo;(function(t){t[t.Major=0]="Major",t[t.Minor=1]="Minor"})(Uo||(Uo={}));var gt;(function(t){t[t.NoTripletFeel=0]="NoTripletFeel",t[t.Triplet16th=1]="Triplet16th",t[t.Triplet8th=2]="Triplet8th",t[t.Dotted16th=3]="Dotted16th",t[t.Dotted8th=4]="Dotted8th",t[t.Scottish16th=5]="Scottish16th",t[t.Scottish8th=6]="Scottish8th"})(gt||(gt={}));class to{constructor(){this.alternateEndings=0,this.nextMasterBar=null,this.previousMasterBar=null,this.index=0,this.keySignature=ei.C,this.keySignatureType=Uo.Major,this.isDoubleBar=!1,this.isRepeatStart=!1,this.repeatCount=0,this.timeSignatureNumerator=4,this.timeSignatureDenominator=4,this.timeSignatureCommon=!1,this.tripletFeel=gt.NoTripletFeel,this.section=null,this.tempoAutomation=null,this.fermata=null,this.start=0,this.isAnacrusis=!1,this.displayScale=1,this.displayWidth=-1}get isRepeatEnd(){return this.repeatCount>0}get isSectionStart(){return!!this.section}calculateDuration(e=!0){if(this.isAnacrusis&&e){let r=0;for(let i of this.score.tracks)for(let n of i.staves){let s=this.indexr&&(r=s)}return r}return this.timeSignatureNumerator*lt.valueToTicks(this.timeSignatureDenominator)}addFermata(e,r){let i=this.fermata;i===null&&(i=new Map,this.fermata=i),i.set(e,r)}getFermata(e){const r=this.fermata;return r===null?null:r.has(e.playbackStart)?r.get(e.playbackStart):null}}to.MaxAlternateEndings=8;class AQ{constructor(){this.hideDynamics=!1}}class OC{constructor(){this.masterBars=[],this.opening=null,this.closings=[],this.isClosed=!1}get openings(){const e=this.opening;return e?[e]:[]}get isOpened(){var e;return((e=this.opening)==null?void 0:e.isRepeatStart)===!0}addMasterBar(e){this.opening===null&&(this.opening=e),this.masterBars.push(e),e.repeatGroup=this,e.isRepeatEnd&&(this.closings.push(e),this.isClosed=!0)}}class Ql{constructor(){this._currentRepeatGroup=null,this._openedRepeatGroups=[],this._properlyOpenedRepeatGroups=0,this.album="",this.artist="",this.copyright="",this.instructions="",this.music="",this.notices="",this.subTitle="",this.title="",this.words="",this.tab="",this.tempo=120,this.tempoLabel="",this.masterBars=[],this.tracks=[],this.defaultSystemsLayout=3,this.systemsLayout=[],this.stylesheet=new AQ}rebuildRepeatGroups(){this._currentRepeatGroup=null,this._openedRepeatGroups=[],this._properlyOpenedRepeatGroups=0;for(const e of this.masterBars)this.addMasterBarToRepeatGroups(e)}addMasterBar(e){e.score=this,e.index=this.masterBars.length,this.masterBars.length!==0&&(e.previousMasterBar=this.masterBars[this.masterBars.length-1],e.previousMasterBar.nextMasterBar=e,e.start=e.previousMasterBar.start+(e.previousMasterBar.isAnacrusis?0:e.previousMasterBar.calculateDuration())),this.addMasterBarToRepeatGroups(e),this.masterBars.push(e)}addMasterBarToRepeatGroups(e){var r;e.isRepeatStart?((r=this._currentRepeatGroup)!=null&&r.isClosed&&(this._openedRepeatGroups.pop(),this._properlyOpenedRepeatGroups--),this._currentRepeatGroup=new OC,this._openedRepeatGroups.push(this._currentRepeatGroup),this._properlyOpenedRepeatGroups++):this._currentRepeatGroup||(this._currentRepeatGroup=new OC,this._openedRepeatGroups.push(this._currentRepeatGroup)),this._currentRepeatGroup.addMasterBar(e),e.isRepeatEnd&&this._properlyOpenedRepeatGroups>1&&(this._openedRepeatGroups.pop(),this._properlyOpenedRepeatGroups--,this._currentRepeatGroup=this._openedRepeatGroups.length>0?this._openedRepeatGroups[this._openedRepeatGroups.length-1]:null)}addTrack(e){e.score=this,e.index=this.tracks.length,this.tracks.push(e)}finish(e){const r=new Map;for(let i=0,n=this.tracks.length;i>24&255}get r(){return this.raw>>16&255}get g(){return this.raw>>8&255}get b(){return this.raw&255}static random(e=100){return new Yt(Math.random()*255|0,Math.random()*255|0,Math.random()*255|0,e)}static fromJson(e){switch(typeof e){case"number":{const r=new Yt(0,0,0,0);return r.raw=e,r.updateRgba(),r}case"string":{const r=e;if(r.startsWith("#")){if(r.length===4)return new Yt(parseInt(r[1],16)*17,parseInt(r[2],16)*17,parseInt(r[3],16)*17);if(r.length===5)return new Yt(parseInt(r[1],16)*17,parseInt(r[2],16)*17,parseInt(r[3],16)*17,parseInt(r[4],16)*17);if(r.length===7)return new Yt(parseInt(r.substring(1,3),16),parseInt(r.substring(3,5),16),parseInt(r.substring(5,7),16));if(r.length===9)return new Yt(parseInt(r.substring(1,3),16),parseInt(r.substring(3,5),16),parseInt(r.substring(5,7),16),parseInt(r.substring(7,9),16))}else if(r.startsWith("rgba")||r.startsWith("rgb")){const i=r.indexOf("("),n=r.lastIndexOf(")");if(i===-1||n===-1)throw new Wr("No values specified for rgb/rgba function");const s=r.substring(i+1,n).split(",");if(s.length===3)return new Yt(parseInt(s[0]),parseInt(s[1]),parseInt(s[2]));if(s.length===4)return new Yt(parseInt(s[0]),parseInt(s[1]),parseInt(s[2]),parseFloat(s[3])*255)}return null}}throw new Wr("Unsupported format for color")}static toJson(e){return e.raw}}Yt.BlackRgb="#000000";class tM{constructor(){this.volume=15,this.balance=8,this.port=1,this.program=0,this.primaryChannel=0,this.secondaryChannel=0,this.isMute=!1,this.isSolo=!1}}class be{static getTextForTuning(e,r){let i=be.getTextPartsForTuning(e);return r?i.join(""):i[0]}static getTextPartsForTuning(e,r=-1){let i=e/12|0,n=e%12;return[["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"][n],(i+r).toString()]}static getDefaultTuningFor(e){return be._defaultTunings.has(e)?be._defaultTunings.get(e):null}static getPresetsFor(e){switch(e){case 7:return be._sevenStrings;case 6:return be._sixStrings;case 5:return be._fiveStrings;case 4:return be._fourStrings}return[]}static initialize(){be._defaultTunings.set(7,new be("Guitar 7 strings",[64,59,55,50,45,40,35],!0)),be._sevenStrings.push(be._defaultTunings.get(7)),be._defaultTunings.set(6,new be("Guitar Standard Tuning",[64,59,55,50,45,40],!0)),be._sixStrings.push(be._defaultTunings.get(6)),be._sixStrings.push(new be("Guitar Tune down ½ step",[63,58,54,49,44,39],!1)),be._sixStrings.push(new be("Guitar Tune down 1 step",[62,57,53,48,43,38],!1)),be._sixStrings.push(new be("Guitar Tune down 2 step",[60,55,51,46,41,36],!1)),be._sixStrings.push(new be("Guitar Dropped D Tuning",[64,59,55,50,45,38],!1)),be._sixStrings.push(new be("Guitar Dropped D Tuning variant",[64,57,55,50,45,38],!1)),be._sixStrings.push(new be("Guitar Double Dropped D Tuning",[62,59,55,50,45,38],!1)),be._sixStrings.push(new be("Guitar Dropped E Tuning",[66,61,57,52,47,40],!1)),be._sixStrings.push(new be("Guitar Dropped C Tuning",[62,57,53,48,43,36],!1)),be._sixStrings.push(new be("Guitar Open C Tuning",[64,60,55,48,43,36],!1)),be._sixStrings.push(new be("Guitar Open Cm Tuning",[63,60,55,48,43,36],!1)),be._sixStrings.push(new be("Guitar Open C6 Tuning",[64,57,55,48,43,36],!1)),be._sixStrings.push(new be("Guitar Open Cmaj7 Tuning",[64,59,55,52,43,36],!1)),be._sixStrings.push(new be("Guitar Open D Tuning",[62,57,54,50,45,38],!1)),be._sixStrings.push(new be("Guitar Open Dm Tuning",[62,57,53,50,45,38],!1)),be._sixStrings.push(new be("Guitar Open D5 Tuning",[62,57,50,50,45,38],!1)),be._sixStrings.push(new be("Guitar Open D6 Tuning",[62,59,54,50,45,38],!1)),be._sixStrings.push(new be("Guitar Open Dsus4 Tuning",[62,57,55,50,45,38],!1)),be._sixStrings.push(new be("Guitar Open E Tuning",[64,59,56,52,47,40],!1)),be._sixStrings.push(new be("Guitar Open Em Tuning",[64,59,55,52,47,40],!1)),be._sixStrings.push(new be("Guitar Open Esus11 Tuning",[64,59,55,52,45,40],!1)),be._sixStrings.push(new be("Guitar Open F Tuning",[65,60,53,48,45,41],!1)),be._sixStrings.push(new be("Guitar Open G Tuning",[62,59,55,50,43,38],!1)),be._sixStrings.push(new be("Guitar Open Gm Tuning",[62,58,55,50,43,38],!1)),be._sixStrings.push(new be("Guitar Open G6 Tuning",[64,59,55,50,43,38],!1)),be._sixStrings.push(new be("Guitar Open Gsus4 Tuning",[62,60,55,50,43,38],!1)),be._sixStrings.push(new be("Guitar Open A Tuning",[64,61,57,52,45,40],!1)),be._sixStrings.push(new be("Guitar Open Am Tuning",[64,60,57,52,45,40],!1)),be._sixStrings.push(new be("Guitar Nashville Tuning",[64,59,67,62,57,52],!1)),be._sixStrings.push(new be("Bass 6 Strings Tuning",[48,43,38,33,28,23],!1)),be._sixStrings.push(new be("Lute or Vihuela Tuning",[64,59,54,50,45,40],!1)),be._defaultTunings.set(5,new be("Bass 5 Strings Tuning",[43,38,33,28,23],!0)),be._fiveStrings.push(be._defaultTunings.get(5)),be._fiveStrings.push(new be("Banjo Dropped C Tuning",[62,59,55,48,67],!1)),be._fiveStrings.push(new be("Banjo Open D Tuning",[62,57,54,50,69],!1)),be._fiveStrings.push(new be("Banjo Open G Tuning",[62,59,55,50,67],!1)),be._fiveStrings.push(new be("Banjo G Minor Tuning",[62,58,55,50,67],!1)),be._fiveStrings.push(new be("Banjo G Modal Tuning",[62,57,55,50,67],!1)),be._defaultTunings.set(4,new be("Bass Standard Tuning",[43,38,33,28],!0)),be._fourStrings.push(be._defaultTunings.get(4)),be._fourStrings.push(new be("Bass Tune down ½ step",[42,37,32,27],!1)),be._fourStrings.push(new be("Bass Tune down 1 step",[41,36,31,26],!1)),be._fourStrings.push(new be("Bass Tune down 2 step",[39,34,29,24],!1)),be._fourStrings.push(new be("Bass Dropped D Tuning",[43,38,33,26],!1)),be._fourStrings.push(new be("Ukulele C Tuning",[45,40,36,43],!1)),be._fourStrings.push(new be("Ukulele G Tuning",[52,47,43,38],!1)),be._fourStrings.push(new be("Mandolin Standard Tuning",[64,57,50,43],!1)),be._fourStrings.push(new be("Mandolin or Violin Tuning",[76,69,62,55],!1)),be._fourStrings.push(new be("Viola Tuning",[69,62,55,48],!1)),be._fourStrings.push(new be("Cello Tuning",[57,50,43,36],!1))}static findTuning(e){let r=be.getPresetsFor(e.length);for(let i=0,n=r.length;i0}finish(e,r=null){this.stringTuning.finish();for(let i=0,n=this.bars.length;i0&&(e.previousBar=r[r.length-1],e.previousBar.nextBar=e),r.push(e)}}class _a{constructor(){this.index=0,this.staves=[],this.playbackInfo=new tM,this.color=new Yt(200,0,0,255),this.name="",this.shortName="",this.defaultSystemsLayout=3,this.systemsLayout=[],this.percussionArticulations=[]}ensureStaveCount(e){for(;this.staves.length_a.ShortNameMaxLength&&(this.shortName=this.shortName.substr(0,_a.ShortNameMaxLength)));for(let i=0,n=this.staves.length;i=0&&n.startBar0&&(e.nextBeat=i.beats[0]),e.nextBeat.previousBeat=e}e.chain(r)}}addGraceBeat(e){if(this.beats.length===0){this.addBeat(e);return}let r=this.beats[this.beats.length-1];this.beats.splice(this.beats.length-1,1),this.addBeat(e),this.addBeat(r),this.isEmpty=!1}getBeatAtPlaybackStart(e){return this._beatLookup.has(e)?this._beatLookup.get(e):null}finish(e,r=null){this._beatLookup=new Map;let i=null;for(let a=0;a=0?s.substr(0,n):s}static readSInt8(e){let r=e.readByte();return((r&255)>>7)*-256+(r&255)}static readInt24(e,r){let i=e[r]|e[r+1]<<8|e[r+2]<<16;return(i&8388608)===8388608&&(i=i|255<<24),i}static readInt16(e,r){return pt.int32ToInt16(e[r]|e[r+1]<<8)}static toString(e,r){let i=ae.detectEncoding(e);return i&&(r=i),r||(r="utf-8"),new TextDecoder(r).decode(e.buffer)}static detectEncoding(e){return e.length>2&&e[0]===254&&e[1]===255?"utf-16be":e.length>2&&e[0]===255&&e[1]===254?"utf-16le":e.length>4&&e[0]===0&&e[1]===0&&e[2]===254&&e[3]===255?"utf-32be":e.length>4&&e[0]===255&&e[1]===254&&e[2]===0&&e[3]===0?"utf-32le":null}static stringToBytes(e){return new TextEncoder().encode(e)}static writeInt32BE(e,r){e.writeByte(r>>24&255),e.writeByte(r>>16&255),e.writeByte(r>>8&255),e.writeByte(r>>0&255)}static writeInt32LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255),e.writeByte(r>>16&255),e.writeByte(r>>24&255)}static writeUInt16LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255)}static writeInt16LE(e,r){e.writeByte(r>>0&255),e.writeByte(r>>8&255)}static writeInt16BE(e,r){e.writeByte(r>>8&255),e.writeByte(r>>0&255)}}class Di{constructor(){this.length=0,this.position=0}get bytesWritten(){return this.position}getBuffer(){return this._buffer}static empty(){return Di.withCapacity(0)}static withCapacity(e){let r=new Di;return r._buffer=new Uint8Array(e),r}static fromBuffer(e){let r=new Di;return r._buffer=e,r.length=e.length,r}static fromString(e){let r=ae.stringToBytes(e);return Di.fromBuffer(r)}reset(){this.position=0}skip(e){this.position+=e}readByte(){return this.length-this.position<=0?-1:this._buffer[this.position++]}read(e,r,i){let n=this.length-this.position;return n>i&&(n=i),n<=0?0:(e.set(this._buffer.subarray(this.position,this.position+n),r),this.position+=n,n)}writeByte(e){let r=this.position+1;this.ensureCapacity(r),this._buffer[this.position]=e&255,r>this.length&&(this.length=r),this.position=r}write(e,r,i){let n=this.position+i;this.ensureCapacity(n);let s=Math.min(i,e.length-r);this._buffer.set(e.subarray(r,r+s),this.position),n>this.length&&(this.length=n),this.position=n}ensureCapacity(e){if(e>this._buffer.length){let r=e;r<256&&(r=256),r0&&i.set(this._buffer.subarray(0,0+this.length),0),this._buffer=i}}readAll(){return this.toArray()}toArray(){let e=new Uint8Array(this.length);return e.set(this._buffer.subarray(0,0+this.length),0),e}copyTo(e){e.write(this._buffer,0,this.length)}}var q;(function(t){t[t.No=0]="No",t[t.Eof=1]="Eof",t[t.Number=2]="Number",t[t.DoubleDot=3]="DoubleDot",t[t.Dot=4]="Dot",t[t.String=5]="String",t[t.Tuning=6]="Tuning",t[t.LParensis=7]="LParensis",t[t.RParensis=8]="RParensis",t[t.LBrace=9]="LBrace",t[t.RBrace=10]="RBrace",t[t.Pipe=11]="Pipe",t[t.MetaCommand=12]="MetaCommand",t[t.Multiply=13]="Multiply",t[t.LowerThan=14]="LowerThan"})(q||(q={}));class Pl extends gi{constructor(e,r,i,n,s,a,o,l=null){super(mi.AlphaTex,e),this.position=r,this.line=i,this.col=n,this.nonTerm=s??"",this.expected=a??q.No,this.symbol=o??q.No,this.symbolData=l,Object.setPrototypeOf(this,Pl.prototype)}static symbolError(e,r,i,n,s,a,o=null){let l=`MalFormed AlphaTex: @${e} (line ${r}, col ${i}): Error on block ${n}`;return s!==a?(l+=`, expected a ${q[s]} found a ${q[a]}`,o!==null&&(l+=`: '${o}'`)):l+=`, invalid value: '${o}'`,new Pl(l,e,r,i,n,s,a,o)}static errorMessage(e,r,i,n){return e=`MalFormed AlphaTex: @${r} (line ${i}, col ${n}): ${e}`,new Pl(e,r,i,n,null,null,null,null)}}class Wi extends Bu{constructor(){super(),this._trackChannel=0,this._input="",this._ch=Wi.Eof,this._curChPos=0,this._line=1,this._col=0,this._lastValidSpot=[0,1,0],this._sy=q.No,this._syData="",this._allowNegatives=!1,this._allowFloat=!1,this._allowTuning=!1,this._currentDuration=H.QuadrupleWhole,this._currentDynamics=yt.PPP,this._currentTuplet=0,this._staffHasExplicitTuning=!1,this._staffTuningApplied=!1,this.logErrors=!1}get name(){return"AlphaTex"}initFromString(e,r){this.data=Di.empty(),this._input=e,this.settings=r}readScore(){try{if(this.data.length>0&&(this._input=ae.toString(this.data.readAll(),this.settings.importer.encoding)),this._allowTuning=!0,this._lyrics=new Map,this.createDefaultScore(),this._curChPos=0,this._line=1,this._col=0,this.saveValidSpot(),this._currentDuration=H.Quarter,this._currentDynamics=yt.F,this._currentTuplet=1,this._ch=this.nextChar(),this._sy=this.newSy(),this._sy===q.LowerThan)throw new jr("Unknown start sign '<' (meant to import as XML?)");if(this._sy===q.Eof)throw new jr("Unexpected end of file");const e=this.metaData(),r=this.bars();if(!e&&!r)throw new jr("No alphaTex data found");this.consolidate(),this._score.finish(this.settings),this._score.rebuildRepeatGroups();for(const[i,n]of this._lyrics)this._score.tracks[i].applyLyrics(n);return this._score}catch(e){throw e instanceof Pl?new jr(e.message,e):e}}consolidate(){for(let e of this._score.tracks)for(let r of e.staves)for(;r.bars.length=48&&e<=57||this._allowNegatives&&e===45||this._allowFloat&&e===46}readName(){let e="";do e+=String.fromCharCode(this._ch),this._ch=this.nextChar();while(Wi.isNameLetter(this._ch)||this.isDigit(this._ch));return e}readNumber(){let e="";do e+=String.fromCharCode(this._ch),this._ch=this.nextChar();while(this.isDigit(this._ch));return this._allowFloat?parseFloat(e):parseInt(e)}metaData(){let e=!1,r=!0;for(;this._sy===q.MetaCommand&&r;){let i=this._syData.toLowerCase();switch(i){case"title":case"subtitle":case"artist":case"album":case"words":case"music":case"copyright":this._sy=this.newSy(),this._sy!==q.String&&this.error(i,q.String,!0);let n=this._syData;switch(i){case"title":this._score.title=n;break;case"subtitle":this._score.subTitle=n;break;case"artist":this._score.artist=n;break;case"album":this._score.album=n;break;case"words":this._score.words=n;break;case"music":this._score.music=n;break;case"copyright":this._score.copyright=n;break}this._sy=this.newSy(),e=!0;break;case"tempo":this._allowFloat=!0,this._sy=this.newSy(),this._allowFloat=!1,this._sy===q.Number?this._score.tempo=this._syData:this.error("tempo",q.Number,!0),this._sy=this.newSy(),e=!0;break;default:this.handleStaffMeta()?e=!0:e?this.error("metaDataTags",q.String,!1):r=!1;break}}return e?(this._sy!==q.Dot&&this.error("song",q.Dot,!0),this._sy=this.newSy()):this._sy===q.Dot&&(this._sy=this.newSy()),e}handleStaffMeta(){var e;switch(this._syData.toLowerCase()){case"capo":return this._sy=this.newSy(),this._sy===q.Number?this._currentStaff.capo=this._syData:this.error("capo",q.Number,!0),this._sy=this.newSy(),!0;case"tuning":this._sy=this.newSy();let r=this._currentStaff.tuning.length;switch(this._staffHasExplicitTuning=!0,this._staffTuningApplied=!1,this._sy){case q.String:let s=this._syData.toLowerCase();s==="piano"||s==="none"||s==="voice"?(this._currentStaff.stringTuning.tunings=[],this._currentStaff.displayTranspositionPitch=0):this.error("tuning",q.Tuning,!0),this._sy=this.newSy();break;case q.Tuning:let a=[];do{let o=this._syData;a.push(o.realValue),this._sy=this.newSy()}while(this._sy===q.Tuning);this._currentStaff.stringTuning.tunings=a;break;default:this.error("tuning",q.Tuning,!0);break}return r!==this._currentStaff.tuning.length&&(((e=this._currentStaff.chords)==null?void 0:e.size)??0)>0&&this.errorMessage("Tuning must be defined before any chord"),!0;case"instrument":if(this._sy=this.newSy(),this._staffTuningApplied=!1,this._sy===q.Number){let s=this._syData;s>=0&&s<=127?this._currentTrack.playbackInfo.program=this._syData:this.error("instrument",q.Number,!1)}else if(this._sy===q.String){let s=this._syData.toLowerCase();this._currentTrack.playbackInfo.program=za.getValue(s)}else this.error("instrument",q.Number,!0);return this._sy=this.newSy(),!0;case"lyrics":this._sy=this.newSy();let i=new Hr;return i.startBar=0,i.text="",this._sy===q.Number&&(i.startBar=this._syData,this._sy=this.newSy()),this._sy===q.String?(i.text=this._syData,this._sy=this.newSy()):this.error("lyrics",q.String,!0),this._lyrics.get(this._currentTrack.index).push(i),!0;case"chord":this._sy=this.newSy();let n=new Ho;this.chordProperties(n),this._sy===q.String?(n.name=this._syData,this._sy=this.newSy()):this.error("chord-name",q.Number,!0);for(let s=0;s0&&this.newTrack(),this._sy===q.String&&(this._currentTrack.name=this._syData,this._sy=this.newSy()),this._sy===q.String&&(this._currentTrack.shortName=this._syData,this._sy=this.newSy())),this._sy===q.MetaCommand&&this._syData.toLowerCase()==="staff"&&(this._staffHasExplicitTuning=!1,this._staffTuningApplied=!1,this._sy=this.newSy(),this._currentTrack.staves[0].bars.length>0&&(this._currentTrack.ensureStaveCount(this._currentTrack.staves.length+1),this._currentStaff=this._currentTrack.staves[this._currentTrack.staves.length-1],this._currentDynamics=yt.F),this.staffProperties()),!0)}staffProperties(){if(this._sy!==q.LBrace)return;this._sy=this.newSy();let e=!1,r=!1;for(;this._sy===q.String;)switch(this._syData.toLowerCase()){case"score":e=!0,this._sy=this.newSy();break;case"tabs":r=!0,this._sy=this.newSy();break;default:this.error("staff-properties",q.String,!1);break}(e||r)&&(this._currentStaff.showStandardNotation=e,this._currentStaff.showTablature=r),this._sy!==q.RBrace&&this.error("staff-properties",q.RBrace,!0),this._sy=this.newSy()}bar(){const e=this.trackStaffMeta();let r=this.newBar(this._currentStaff);if(this._currentStaff.bars.length>this._score.masterBars.length){let a=new to;this._score.addMasterBar(a),a.index>0&&(a.keySignature=a.previousMasterBar.keySignature,a.keySignatureType=a.previousMasterBar.keySignatureType,a.timeSignatureDenominator=a.previousMasterBar.timeSignatureDenominator,a.timeSignatureNumerator=a.previousMasterBar.timeSignatureNumerator,a.tripletFeel=a.previousMasterBar.tripletFeel)}const i=this.barMeta(r);if(!this._staffTuningApplied&&!this._staffHasExplicitTuning){const a=this._currentTrack.playbackInfo.program;this._currentStaff.displayTranspositionPitch=0,this._currentStaff.stringTuning.tunings=[],a==15||a>=24&&a<=31?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=be.getDefaultTuningFor(6).tunings):a>=32&&a<=39?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=[43,38,33,28]):a==40||a==44||a==45||a==48||a==49||a==50||a==51?this._currentStaff.stringTuning.tunings=[52,57,50,43]:a==41?this._currentStaff.stringTuning.tunings=[57,50,43,36]:a==42?this._currentStaff.stringTuning.tunings=[45,38,31,24]:a==43?(this._currentStaff.displayTranspositionPitch=-12,this._currentStaff.stringTuning.tunings=[43,38,33,28]):a==105?this._currentStaff.stringTuning.tunings=[50,47,43,38,55]:a==106?this._currentStaff.stringTuning.tunings=[57,52,45]:a==107?this._currentStaff.stringTuning.tunings=[52,45,38,31]:a==110&&(this._currentStaff.stringTuning.tunings=[64,57,50,43]),this._staffTuningApplied=!0}let n=!1,s=r.voices[0];for(;this._sy!==q.Pipe&&this._sy!==q.Eof&&this.beat(s);)n=!0;if(s.beats.length===0){let a=new Mi;a.isEmpty=!0,s.addBeat(a)}return e||i||n}newBar(e){let r=new ao;e.addBar(r),r.index>0&&(r.clef=r.previousBar.clef);let i=new Ba;return r.addVoice(i),r}beat(e){this.beatDuration();let r=new Mi;if(e.addBeat(r),this._sy===q.LParensis){for(this._sy=this.newSy(),this.note(r);this._sy!==q.RParensis&&this._sy!==q.Eof&&this.note(r););this._sy!==q.RParensis&&this.error("note-list",q.RParensis,!0),this._sy=this.newSy()}else if(this._sy===q.String&&this._syData.toLowerCase()==="r")this._sy=this.newSy();else if(!this.note(r))return e.beats.splice(e.beats.length-1,1),!1;this._sy===q.Dot&&(this._allowNegatives=!0,this._sy=this.newSy(),this._allowNegatives=!1,this._sy!==q.Number&&this.error("duration",q.Number,!0),this._currentDuration=this.parseDuration(this._syData),this._sy=this.newSy()),r.duration=this._currentDuration,r.dynamics=this._currentDynamics,this._currentTuplet!==1&&!r.hasTuplet&&Wi.applyTuplet(r,this._currentTuplet);let i=1;this._sy===q.Multiply&&(this._sy=this.newSy(),this._sy!==q.Number?this.error("multiplier",q.Number,!0):i=this._syData,this._sy=this.newSy()),this.beatEffects(r);for(let n=0;n60;)e.removeWhammyBarPoint(e.whammyBarPoints.length-1);if(i)e.whammyBarPoints.sort((n,s)=>n.offset-s.offset);else{let n=e.whammyBarPoints.length,s=60/n|0,a=0;for(;a0,l=-1;o&&(this._sy!==q.Dot&&this.error("note",q.Dot,!0),this._sy=this.newSy(),this._sy!==q.Number&&this.error("note-string",q.Number,!0),l=this._syData,(l<1||l>this._currentStaff.tuning.length)&&this.error("note-string",q.Number,!1),this._sy=this.newSy());let c=new kr;return o?(c.string=this._currentStaff.tuning.length-(l-1),c.isDead=r,c.isTieDestination=i,i||(c.fret=n)):(c.octave=s,c.tone=a,c.isTieDestination=i),e.addNote(c),this.noteEffects(c),!0}noteEffects(e){if(this._sy===q.LBrace){for(this._sy=this.newSy();this._sy===q.String;){let r=this._syData.toLowerCase();if(r==="b"||r==="be"){let i=r==="be";for(this._sy=this.newSy(),this._sy!==q.LParensis&&this.error("bend-effect",q.LParensis,!0),this._sy=this.newSy();this._sy!==q.RParensis&&this._sy!==q.Eof;){let s=0,a=0;i?(this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),s=this._syData,this._sy=this.newSy(),this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),a=this._syData):(this._sy!==q.Number&&this.error("bend-effect-value",q.Number,!0),a=this._syData),e.addBendPoint(new Me(s,a)),this._sy=this.newSy()}const n=e.bendPoints;if(n!=null){for(;n.length>60;)n.splice(n.length-1,1);if(i)n.sort((s,a)=>s.offset-a.offset);else{let s=n.length,a=60/(s-1)|0,o=0;for(;o2048&&this.error("repeatclose",q.Number,!1),i.repeatCount=this._syData,this._sy=this.newSy();else if(n==="ae")if(this._sy=this.newSy(),this._sy===q.LParensis){for(this._sy=this.newSy(),this._sy!==q.Number&&this.error("alternateending",q.Number,!0),this.applyAlternateEnding(i);this._sy===q.Number;)this.applyAlternateEnding(i);this._sy!==q.RParensis&&this.error("alternateending-list",q.RParensis,!0),this._sy=this.newSy()}else this._sy!==q.Number&&this.error("alternateending",q.Number,!0),this.applyAlternateEnding(i);else if(n==="ks")this._sy=this.newSy(),this._sy!==q.String&&this.error("keysignature",q.String,!0),i.keySignature=this.parseKeySignature(this._syData),this._sy=this.newSy();else if(n==="clef"){switch(this._sy=this.newSy(),this._sy){case q.String:e.clef=this.parseClefFromString(this._syData);break;case q.Number:e.clef=this.parseClefFromInt(this._syData);break;case q.Tuning:let s=this._syData;e.clef=this.parseClefFromInt(s.realValue);break;default:this.error("clef",q.String,!0);break}this._sy=this.newSy()}else if(n==="tempo"){this._allowFloat=!0,this._sy=this.newSy(),this._allowFloat=!1,this._sy!==q.Number&&this.error("tempo",q.Number,!0);let s=new Ei;s.isLinear=!1,s.type=oi.Tempo,s.value=this._syData,i.tempoAutomation=s,this._sy=this.newSy()}else if(n==="section"){this._sy=this.newSy(),this._sy!==q.String&&this.error("section",q.String,!0);let s=this._syData;this._sy=this.newSy();let a="";this._sy===q.String&&!this.isNoteText(this._syData.toLowerCase())&&(a=s,s=this._syData,this._sy=this.newSy());let o=new iy;o.marker=a,o.text=s,i.section=o}else if(n==="tf"){switch(this._allowTuning=!1,this._sy=this.newSy(),this._allowTuning=!0,this._sy){case q.String:i.tripletFeel=this.parseTripletFeelFromString(this._syData);break;case q.Number:i.tripletFeel=this.parseTripletFeelFromInt(this._syData);break;default:this.error("triplet-feel",q.String,!0);break}this._sy=this.newSy()}else n==="ac"?(i.isAnacrusis=!0,this._sy=this.newSy()):e.index===0?this.handleStaffMeta()||this.error("measure-effects",q.String,!1):this.error("measure-effects",q.String,!1)}if(i.index===0&&!i.tempoAutomation){let n=new Ei;n.isLinear=!1,n.type=oi.Tempo,n.value=this._score.tempo,i.tempoAutomation=n}return r}applyAlternateEnding(e){let r=this._syData;r<1&&this.error("alternateending",q.Number,!0),e.alternateEndings|=1<=400&&this.readLyrics(),this._versionNumber>=510&&this.data.skip(19),this._versionNumber>=500&&(this.readPageSetup(),this._score.tempoLabel=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),this._score.tempo=ae.readInt32LE(this.data),this._versionNumber>=510&&Rt.gpReadBool(this.data),ae.readInt32LE(this.data),this._versionNumber>=400&&this.data.readByte(),this.readPlaybackInfos(),this._versionNumber>=500&&(this.data.skip(38),this.data.skip(4)),this._barCount=ae.readInt32LE(this.data),this._trackCount=ae.readInt32LE(this.data),this.readMasterBars(),this.readTracks(),this.readBars(),this._score.masterBars.length>0&&(this._score.masterBars[0].tempoAutomation=Ei.buildTempoAutomation(!1,0,this._score.tempo,2),this._score.masterBars[0].tempoAutomation.text=this._score.tempoLabel),this._score.finish(this.settings),this._lyrics&&this._lyricsTrack>=0&&this._score.tracks[this._lyricsTrack].applyLyrics(this._lyrics),this._score}readVersion(){let e=Rt.gpReadStringByteLength(this.data,30,this.settings.importer.encoding);if(!e.startsWith(da.VersionString))throw new jr("Unsupported format");e=e.substr(da.VersionString.length+1);let r=e.indexOf(".");this._versionNumber=100*parseInt(e.substr(0,r))+parseInt(e.substr(r+1)),he.debug(this.name,"Guitar Pro version "+e+" detected")}readScoreInformation(){var i;this._score.title=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.subTitle=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.artist=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.album=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.words=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.music=this._versionNumber>=500?Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding):this._score.words,this._score.copyright=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.tab=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding),this._score.instructions=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding);let e=ae.readInt32LE(this.data),r="";for(let n=0;n0&&(r+=`\r +`),r+=(i=Rt.gpReadStringIntUnused(this.data,this.settings.importer.encoding))==null?void 0:i.toString();this._score.notices=r}readLyrics(){this._lyrics=[],this._lyricsTrack=ae.readInt32LE(this.data)-1;for(let e=0;e<5;e++){let r=new Hr;r.startBar=ae.readInt32LE(this.data)-1,r.text=Rt.gpReadStringInt(this.data,this.settings.importer.encoding),this._lyrics.push(r)}}readPageSetup(){this.data.skip(30);for(let e=0;e<10;e++)Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)}readPlaybackInfos(){this._playbackInfos=[];for(let e=0;e<64;e++){let r=new tM;r.primaryChannel=e,r.secondaryChannel=e,r.program=ae.readInt32LE(this.data),r.volume=this.data.readByte(),r.balance=this.data.readByte(),this.data.skip(6),this._playbackInfos.push(r)}}readMasterBars(){for(let e=0;e0&&(e=this._score.masterBars[this._score.masterBars.length-1]);let r=new to,i=this.data.readByte();if(i&1?r.timeSignatureNumerator=this.data.readByte():e&&(r.timeSignatureNumerator=e.timeSignatureNumerator),i&2?r.timeSignatureDenominator=this.data.readByte():e&&(r.timeSignatureDenominator=e.timeSignatureDenominator),r.isRepeatStart=(i&4)!==0,i&8&&(r.repeatCount=this.data.readByte()+(this._versionNumber>=500?0:1)),i&16&&this._versionNumber<500){let n=e,s=0;for(;n&&!(n.isRepeatEnd&&n!==e||n.isRepeatStart);)s=s|n.alternateEndings,n=n.previousMasterBar;let a=0,o=this.data.readByte();for(let l=0;l<8;l++){let c=1<l&&!(s&c)&&(a=a|c)}r.alternateEndings=a}if(i&32){let n=new iy;n.text=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),n.marker="",Rt.gpReadColor(this.data,!1),r.section=n}if(i&64?(r.keySignature=ae.readSInt8(this.data),r.keySignatureType=this.data.readByte()):e&&(r.keySignature=e.keySignature,r.keySignatureType=e.keySignatureType),this._versionNumber>=500&&i&3&&this.data.skip(4),this._versionNumber>=500&&(r.alternateEndings=this.data.readByte()),this._versionNumber>=500){switch(this.data.readByte()){case 1:r.tripletFeel=gt.Triplet8th;break;case 2:r.tripletFeel=gt.Triplet16th;break}this.data.readByte()}else r.tripletFeel=this._globalTripletFeel;r.isDoubleBar=(i&128)!==0,this._score.addMasterBar(r)}readTracks(){for(let e=0;ec&&s.push(u)}r.stringTuning.tunings=s;let a=ae.readInt32LE(this.data),o=ae.readInt32LE(this.data)-1,l=ae.readInt32LE(this.data)-1;if(this.data.skip(4),o>=0&&o=500&&(this.data.readByte(),this.data.readByte(),this.data.skip(43)),this._versionNumber>=510&&(this.data.skip(4),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding))}readBars(){for(let e=0;e=500&&(this.data.readByte(),n=2);for(let s=0;s=0;p--)h.push(d.chunks[p]);this._beatTextChunksByTrack.set(e.index,h)}else n.text=u}let l=qe.None;s&8&&(l=this.readBeatEffects(n)),s&16&&this.readMixTableChange(n);let c=this.data.readByte();for(let u=6;u>=0;u--)if(c&1<=500&&(this.data.readByte(),this.data.readByte()&8&&this.data.readByte()),o&&!n.isRest&&this._beatTextChunksByTrack.has(e.index)&&this._beatTextChunksByTrack.get(e.index).length>0&&(n.lyrics=[this._beatTextChunksByTrack.get(e.index).pop()])}readChord(e){let r=new Ho,i=er.newGuid();if(this._versionNumber>=500){this.data.skip(17),r.name=Rt.gpReadStringByteLength(this.data,21,this.settings.importer.encoding),this.data.skip(4),r.firstFret=ae.readInt32LE(this.data);for(let a=0;a<7;a++){let o=ae.readInt32LE(this.data);a=400){this.data.skip(16),r.name=Rt.gpReadStringByteLength(this.data,21,this.settings.importer.encoding),this.data.skip(4),r.firstFret=ae.readInt32LE(this.data);for(let a=0;a<7;a++){let o=ae.readInt32LE(this.data);a=406?7:6;if(r.name=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),r.firstFret=ae.readInt32LE(this.data),r.firstFret>0)for(let s=0;s=400&&(i=this.data.readByte()),e.fadeIn=(r&16)!==0,(this._versionNumber<400&&r&1||r&2)&&(e.vibrato=Dt.Slight),e.hasRasgueado=(i&1)!==0,r&32&&this._versionNumber>=400)switch(ae.readSInt8(this.data)){case 1:e.tap=!0;break;case 2:e.slap=!0;break;case 3:e.pop=!0;break}else if(r&32){switch(ae.readSInt8(this.data)){case 1:e.tap=!0;break;case 2:e.slap=!0;break;case 3:e.pop=!0;break}this.data.skip(4)}if(i&4&&this.readTremoloBarEffect(e),r&64){let n=0,s=0;this._versionNumber<500?(s=this.data.readByte(),n=this.data.readByte()):(n=this.data.readByte(),s=this.data.readByte()),n>0?(e.brushType=ir.BrushUp,e.brushDuration=da.toStrokeValue(n)):s>0&&(e.brushType=ir.BrushDown,e.brushDuration=da.toStrokeValue(s))}if(i&2)switch(ae.readSInt8(this.data)){case 0:e.pickStroke=Bi.None;break;case 1:e.pickStroke=Bi.Up;break;case 2:e.pickStroke=Bi.Down;break}if(this._versionNumber<400){if(r&4)return qe.Natural;if(r&8)return qe.Artificial}return qe.None}readTremoloBarEffect(e){this.data.readByte(),ae.readInt32LE(this.data);let r=ae.readInt32LE(this.data);if(r>0)for(let i=0;i=500&&this.data.skip(16),r.volume=ae.readSInt8(this.data),r.balance=ae.readSInt8(this.data);let i=ae.readSInt8(this.data),n=ae.readSInt8(this.data),s=ae.readSInt8(this.data),a=ae.readSInt8(this.data);if(this._versionNumber>=500&&(r.tempoName=Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),r.tempo=ae.readInt32LE(this.data),r.volume>=0&&this.data.readByte(),r.balance>=0&&this.data.readByte(),i>=0&&this.data.readByte(),n>=0&&this.data.readByte(),s>=0&&this.data.readByte(),a>=0&&this.data.readByte(),r.tempo>=0&&(r.duration=ae.readSInt8(this.data),this._versionNumber>=510&&this.data.readByte()),this._versionNumber>=400&&this.data.readByte(),this._versionNumber>=500&&this.data.readByte(),this._versionNumber>=510&&(Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding),Rt.gpReadStringIntByte(this.data,this.settings.importer.encoding)),r.volume>=0){let o=new Ei;o.isLinear=!0,o.type=oi.Volume,o.value=r.volume,e.automations.push(o)}if(r.balance>=0){let o=new Ei;o.isLinear=!0,o.type=oi.Balance,o.value=r.balance,e.automations.push(o)}if(r.instrument>=0){let o=new Ei;o.isLinear=!0,o.type=oi.Instrument,o.value=r.instrument,e.automations.push(o)}if(r.tempo>=0){let o=new Ei;o.isLinear=!0,o.type=oi.Tempo,o.value=r.tempo,e.automations.push(o),e.voice.bar.masterBar.tempoAutomation=o}}readNote(e,r,i,n,s){let a=new kr;a.string=r.staff.tuning.length-s;let o=this.data.readByte();if(o&2?a.accentuated=Yr.Heavy:o&64&&(a.accentuated=Yr.Normal),a.isGhost=(o&4)!==0,o&32){let c=this.data.readByte();c===3?a.isDead=!0:c===2&&(a.isTieDestination=!0)}if(o&1&&this._versionNumber<500&&(this.data.readByte(),this.data.readByte()),o&16){let c=ae.readSInt8(this.data);a.dynamics=this.toDynamicValue(c),n.dynamics=a.dynamics}o&32&&(a.fret=ae.readSInt8(this.data)),o&128&&(a.leftHandFinger=ae.readSInt8(this.data),a.rightHandFinger=ae.readSInt8(this.data),a.isFingering=!0);let l=!1;if(this._versionNumber>=500&&(o&1&&(a.durationPercent=Rt.gpReadDouble(this.data)),l=(this.data.readByte()&2)!==0),n.addNote(a),o&8&&this.readNoteEffects(e,i,n,a),r.staff.isPercussion&&(a.percussionArticulation=a.fret,a.string=-1,a.fret=-1),l){const c=be.defaultAccidentals[a.realValueWithoutHarmonic%12];c==="#"?a.accidentalMode=Or.ForceFlat:c==="b"&&(a.accidentalMode=Or.ForceSharp)}return a}toDynamicValue(e){switch(e){case 1:return yt.PPP;case 2:return yt.PP;case 3:return yt.P;case 4:return yt.MP;case 5:return yt.MF;case 6:return yt.F;case 7:return yt.FF;case 8:return yt.FFF;default:return yt.F}}readNoteEffects(e,r,i,n){let s=this.data.readByte(),a=0;this._versionNumber>=400&&(a=this.data.readByte()),s&1&&this.readBend(n),s&16&&this.readGrace(r,n),a&4&&this.readTremoloPicking(i),a&8?this.readSlide(n):this._versionNumber<400&&s&4&&(n.slideOutType=ut.Shift),a&16&&this.readArtificialHarmonic(n),a&32&&this.readTrill(n),n.isLetRing=(s&8)!==0,n.isHammerPullOrigin=(s&2)!==0,a&64&&(n.vibrato=Dt.Slight),n.isPalmMute=(a&2)!==0,n.isStaccato=(a&1)!==0}readBend(e){this.data.readByte(),ae.readInt32LE(this.data);let r=ae.readInt32LE(this.data);if(r>0)for(let i=0;i=500){let r=ae.readSInt8(this.data);r&1?e.slideOutType=ut.Shift:r&2?e.slideOutType=ut.Legato:r&4?e.slideOutType=ut.OutDown:r&8&&(e.slideOutType=ut.OutUp),r&16?e.slideInType=pi.IntoFromBelow:r&32&&(e.slideInType=pi.IntoFromAbove)}else switch(ae.readSInt8(this.data)){case 1:e.slideOutType=ut.Shift;break;case 2:e.slideOutType=ut.Legato;break;case 3:e.slideOutType=ut.OutDown;break;case 4:e.slideOutType=ut.OutUp;break;case-1:e.slideInType=pi.IntoFromBelow;break;case-2:e.slideInType=pi.IntoFromAbove;break}}readArtificialHarmonic(e){let r=this.data.readByte();if(this._versionNumber>=500)switch(r){case 1:e.harmonicType=qe.Natural,e.harmonicValue=this.deltaFretToHarmonicValue(e.fret);break;case 2:this.data.readByte(),this.data.readByte(),this.data.readByte(),e.harmonicType=qe.Artificial;break;case 3:e.harmonicType=qe.Tap,e.harmonicValue=this.deltaFretToHarmonicValue(this.data.readByte());break;case 4:e.harmonicType=qe.Pinch,e.harmonicValue=12;break;case 5:e.harmonicType=qe.Semi,e.harmonicValue=12;break}else if(this._versionNumber>=400)switch(r){case 1:e.harmonicType=qe.Natural;break;case 3:e.harmonicType=qe.Tap;break;case 4:e.harmonicType=qe.Pinch;break;case 5:e.harmonicType=qe.Semi;break;case 15:e.harmonicType=qe.Artificial;break;case 17:e.harmonicType=qe.Artificial;break;case 22:e.harmonicType=qe.Artificial;break}}deltaFretToHarmonicValue(e){switch(e){case 2:return 2.4;case 3:return 3.2;case 4:case 5:case 7:case 9:case 12:case 16:case 17:case 19:case 24:return e;case 8:return 8.2;case 10:return 9.6;case 14:case 15:return 14.7;case 21:case 22:return 21.7;default:return 12}}readTrill(e){switch(e.trillValue=this.data.readByte()+e.stringTuning,this.data.readByte()){case 1:e.trillSpeed=H.Sixteenth;break;case 2:e.trillSpeed=H.ThirtySecond;break;case 3:e.trillSpeed=H.SixtyFourth;break}}}da.VersionString="FICHIER GUITAR PRO ";da.BendStep=25;class Rt{static gpReadDouble(e){let r=new Uint8Array(8);return e.read(r,0,r.length),new Float64Array(r.buffer)[0]}static gpReadFloat(e){let r=new Uint8Array(4);return r[3]=e.readByte(),r[2]=e.readByte(),r[2]=e.readByte(),r[1]=e.readByte(),new Float32Array(r.buffer)[0]}static gpReadColor(e,r=!1){let i=e.readByte(),n=e.readByte(),s=e.readByte(),a=255;return r?a=e.readByte():e.skip(1),new Yt(i,n,s,a)}static gpReadBool(e){return e.readByte()!==0}static gpReadStringIntUnused(e,r){return e.skip(4),Rt.gpReadString(e,e.readByte(),r)}static gpReadStringInt(e,r){return Rt.gpReadString(e,ae.readInt32LE(e),r)}static gpReadStringIntByte(e,r){let i=ae.readInt32LE(e)-1;return e.readByte(),Rt.gpReadString(e,i,r)}static gpReadString(e,r,i){let n=new Uint8Array(r);return e.read(n,0,n.length),ae.toString(n,i)}static gpWriteString(e,r){const i=ae.stringToBytes(r);e.writeByte(r.length),e.write(i,0,i.length)}static gpReadStringByteLength(e,r,i){let n=e.readByte(),s=Rt.gpReadString(e,n,i);return n",e,r)}break;case nt.WaitEndRet:switch(n){case $e.CharCodeGreaterThan:return r;default:throw new an("Expected >",e,r)}case nt.Close:if(!$e.isValidChar(n)){if(o===r)throw new an("Expected node name",e,r);if(e.substr(o,r-o)!==i.localName)throw new an("Expected ",e,r);s=nt.IgnoreSpaces,a=nt.WaitEndRet;continue}break;case nt.Comment:n===$e.CharCodeMinus&&e.charCodeAt(r+1)===$e.CharCodeMinus&&e.charCodeAt(r+2)===$e.CharCodeGreaterThan&&(r+=2,s=nt.Begin);break;case nt.Doctype:if(n===$e.CharCodeBrackedOpen)h++;else if(n===$e.CharCodeBrackedClose)h--;else if(n===$e.CharCodeGreaterThan&&h===0){let f=new Ws;f.nodeType=de.DocumentType,f.value=e.substr(o,r-o),i.addChild(f),s=nt.Begin}break;case nt.Header:n===$e.CharCodeQuestion&&e.charCodeAt(r+1)===$e.CharCodeGreaterThan&&(r++,s=nt.Begin);break;case nt.Escape:if(n===$e.CharCodeSemi){let f=e.substr(o,r-o);if(f.charCodeAt(0)===$e.CharCodeSharp){let m=f.charCodeAt(1)===$e.CharCodeLowerX?parseInt("0"+f.substr(1,f.length-1)):parseInt(f.substr(1,f.length-1));l+=String.fromCharCode(m)}else $e.Escapes.has(f)?l+=$e.Escapes.get(f):l+=("&"+f+";").toString();o=r+1,s=c}else!$e.isValidChar(n)&&n!==$e.CharCodeSharp&&(l+="&",l+=e.substr(o,r-o),r--,o=r+1,s=c);break}r++}if(s===nt.Begin&&(o=r,s=nt.Pcdata),s===nt.Pcdata){if(r!==o){l+=e.substr(o,r-o);let f=new Ws;f.nodeType=de.Text,f.value=l,i.addChild(f)}return r}if(s===nt.Escape&&c===nt.Pcdata){l+="&",l+=e.substr(o,r-o);let f=new Ws;return f.nodeType=de.Text,f.value=l,i.addChild(f),r}throw new an("Unexpected end",e,r)}static isValidChar(e){return e>=$e.CharCodeLowerA&&e<=$e.CharCodeLowerZ||e>=$e.CharCodeUpperA&&e<=$e.CharCodeUpperZ||e>=$e.CharCode0&&e<=$e.CharCode9||e===$e.CharCodeColon||e===$e.CharCodeDot||e===$e.CharCodeUnderscore||e===$e.CharCodeMinus}}$e.CharCodeLF=10;$e.CharCodeTab=9;$e.CharCodeCR=13;$e.CharCodeSpace=32;$e.CharCodeLowerThan=60;$e.CharCodeAmp=38;$e.CharCodeBrackedClose=93;$e.CharCodeBrackedOpen=91;$e.CharCodeGreaterThan=62;$e.CharCodeExclamation=33;$e.CharCodeUpperD=68;$e.CharCodeLowerD=100;$e.CharCodeMinus=45;$e.CharCodeQuestion=63;$e.CharCodeSlash=47;$e.CharCodeEquals=61;$e.CharCodeDoubleQuote=34;$e.CharCodeSingleQuote=39;$e.CharCodeSharp=35;$e.CharCodeLowerX=120;$e.CharCodeLowerA=97;$e.CharCodeLowerZ=122;$e.CharCodeUpperA=65;$e.CharCodeUpperZ=90;$e.CharCode0=48;$e.CharCode9=57;$e.CharCodeColon=58;$e.CharCodeDot=46;$e.CharCodeUnderscore=95;$e.CharCodeSemi=59;$e.Escapes=new Map([["lt","<"],["gt",">"],["amp","&"],["quot",'"'],["apos","'"]]);class LS{static write(e,r,i){const n=new LS(r,i);return n.writeNode(e),n.toString()}constructor(e,r){this._result=[],this._indention=e,this._xmlHeader=r,this._currentIndention="",this._isStartOfLine=!0}writeNode(e){switch(e.nodeType){case de.None:break;case de.Element:this._result.length>0&&this.writeLine(),this.write(`<${e.localName}`);for(const[r,i]of e.attributes)this.write(` ${r}="`),this.writeAttributeValue(i),this.write('"');if(e.childNodes.length===0)this.write("/>");else{if(this.write(">"),e.childNodes.length===1&&!e.firstElement)this.writeNode(e.childNodes[0]);else{this.indent();for(const r of e.childNodes)r.nodeType===de.Element&&this.writeNode(r);this.unindend(),this.writeLine()}this.write(``)}break;case de.Text:e.value&&this.write(e.value);break;case de.CDATA:e.value!==null&&this.write(``);break;case de.Document:this._xmlHeader&&this.write('');for(const r of e.childNodes)this.writeNode(r);break;case de.DocumentType:this.write(``);break}}unindend(){this._currentIndention=this._currentIndention.substr(0,this._currentIndention.length-this._indention.length)}indent(){this._currentIndention+=this._indention}writeAttributeValue(e){for(let r=0;r":this._result.push(">");break;case"&":this._result.push("&");break;case"'":this._result.push("'");break;case'"':this._result.push(""");break;default:this._result.push(i);break}}}write(e){this._isStartOfLine&&this._result.push(this._currentIndention),this._result.push(e),this._isStartOfLine=!1}writeLine(e=null){e&&this.write(e),this._indention.length>0&&!this._isStartOfLine&&(this._result.push(` +`),this._isStartOfLine=!0)}toString(){return this._result.join("").trimRight()}}class FS extends Ws{constructor(){super(),this.nodeType=de.Document}parse(e){$e.parse(e,0,this)}toString(){return this.toFormattedString()}toFormattedString(e="",r=!1){return LS.write(this,e,r)}}var we;(function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"})(we||(we={}));class $Q{constructor(){this.id="",this.dots=0,this.tupletDenominator=-1,this.tupletNumerator=-1,this.value=H.Quarter}}class zQ{constructor(){this.name="",this.path="",this.role="",this.program=0}get uniqueId(){return this.path+";"+this.name+";"+this.role}}class ds{constructor(){this._hasAnacrusis=!1,this._skipApplyLyrics=!1}parseXml(e,r){this._masterTrackAutomations=new Map,this._automationsPerTrackIdAndBarIndex=new Map,this._tracksMapping=[],this._tracksById=new Map,this._masterBars=[],this._barsOfMasterBar=[],this._voicesOfBar=new Map,this._barsById=new Map,this._voiceById=new Map,this._beatsOfVoice=new Map,this._beatById=new Map,this._rhythmOfBeat=new Map,this._rhythmById=new Map,this._notesOfBeat=new Map,this._noteById=new Map,this._tappedNotes=new Map,this._lyricsByTrack=new Map,this._soundsByTrack=new Map,this._skipApplyLyrics=!1;let i=new FS;try{i.parse(e)}catch(n){throw new jr("Could not parse XML",n)}if(this.parseDom(i),this.buildModel(),this.score.finish(r),!this._skipApplyLyrics&&this._lyricsByTrack.size>0)for(const[n,s]of this._lyricsByTrack)this._tracksById.get(n).applyLyrics(s)}parseDom(e){let r=e.firstElement;if(r)if(r.localName==="GPIF"){this.score=new Ql;for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Score":this.parseScoreNode(i);break;case"MasterTrack":this.parseMasterTrackNode(i);break;case"Tracks":this.parseTracksNode(i);break;case"MasterBars":this.parseMasterBarsNode(i);break;case"Bars":this.parseBars(i);break;case"Voices":this.parseVoices(i);break;case"Beats":this.parseBeats(i);break;case"Notes":this.parseNotes(i);break;case"Rhythms":this.parseRhythms(i);break}}else throw new jr("Root node of XML was not GPIF")}parseScoreNode(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"Title":this.score.title=r.firstChild.innerText;break;case"SubTitle":this.score.subTitle=r.firstChild.innerText;break;case"Artist":this.score.artist=r.firstChild.innerText;break;case"Album":this.score.album=r.firstChild.innerText;break;case"Words":this.score.words=r.firstChild.innerText;break;case"Music":this.score.music=r.firstChild.innerText;break;case"WordsAndMusic":if(r.firstChild&&r.firstChild.innerText!==""){let i=r.firstChild.innerText;i&&!this.score.words&&(this.score.words=i),i&&!this.score.music&&(this.score.music=i)}break;case"Copyright":this.score.copyright=r.firstChild.innerText;break;case"Tabber":this.score.tab=r.firstChild.innerText;break;case"Instructions":this.score.instructions=r.firstChild.innerText;break;case"Notices":this.score.notices=r.firstChild.innerText;break;case"ScoreSystemsDefaultLayout":this.score.defaultSystemsLayout=parseInt(r.innerText);break;case"ScoreSystemsLayout":this.score.systemsLayout=r.innerText.split(" ").map(i=>parseInt(i));break}}parseMasterTrackNode(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"Automations":this.parseAutomations(r,this._masterTrackAutomations,null);break;case"Tracks":this._tracksMapping=r.innerText.split(" ");break;case"Anacrusis":this._hasAnacrusis=!0;break}}parseAutomations(e,r,i){for(let n of e.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"Automation":this.parseAutomation(n,r,i);break}}parseAutomation(e,r,i){let n=null,s=!1,a=-1,o=0,l=0,c=null,u=0,d=null;for(let p of e.childNodes)if(p.nodeType===de.Element)switch(p.localName){case"Type":n=p.innerText;break;case"Linear":s=p.innerText.toLowerCase()==="true";break;case"Bar":a=parseInt(p.innerText);break;case"Position":o=parseFloat(p.innerText);break;case"Value":if(p.firstElement&&p.firstElement.nodeType===de.CDATA)c=p.innerText;else{let f=p.innerText.split(" ");f.length===1?(l=parseFloat(f[0]),u=1):(l=parseFloat(f[0]),u=parseInt(f[1]))}break;case"Text":d=p.innerText;break}if(!n)return;let h=null;switch(n){case"Tempo":h=Ei.buildTempoAutomation(s,o,l,u);break;case"Sound":c&&i&&i.has(c)&&(h=Ei.buildInstrumentAutomation(s,o,i.get(c).program));break}h&&(d&&(h.text=d),a>=0&&(r.has(a)||r.set(a,[]),r.get(a).push(h)))}parseTracksNode(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"Track":this.parseTrack(r);break}}parseTrack(e){this._articulationByName=new Map;let r=new _a;r.ensureStaveCount(1);let i=r.staves[0];i.showStandardNotation=!0;let n=e.getAttribute("id");for(let s of e.childNodes)if(s.nodeType===de.Element)switch(s.localName){case"Name":r.name=s.innerText;break;case"Color":let a=s.innerText.split(" ");if(a.length>=3){let c=parseInt(a[0]),u=parseInt(a[1]),d=parseInt(a[2]);r.color=new Yt(c,u,d,255)}break;case"Instrument":let o=s.getAttribute("ref");(o.endsWith("-gs")||o.endsWith("GrandStaff"))&&(r.ensureStaveCount(2),r.staves[1].showStandardNotation=!0);break;case"InstrumentSet":this.parseInstrumentSet(r,s);break;case"NotationPatch":this.parseNotationPatch(r,s);break;case"ShortName":r.shortName=s.innerText;break;case"SystemsDefautLayout":r.defaultSystemsLayout=parseInt(s.innerText);break;case"SystemsLayout":r.systemsLayout=s.innerText.split(" ").map(c=>parseInt(c));break;case"Lyrics":this.parseLyrics(n,s);break;case"Properties":this.parseTrackProperties(r,s);break;case"GeneralMidi":case"MidiConnection":case"MIDISettings":this.parseGeneralMidi(r,s);break;case"Sounds":this.parseSounds(n,r,s);break;case"PlaybackState":let l=s.innerText;r.playbackInfo.isSolo=l==="Solo",r.playbackInfo.isMute=l==="Mute";break;case"PartSounding":this.parsePartSounding(r,s);break;case"Staves":this.parseStaves(r,s);break;case"Transpose":this.parseTranspose(r,s);break;case"RSE":this.parseRSE(r,s);break;case"Automations":this.parseTrackAutomations(n,s);break}this._tracksById.set(n,r)}parseTrackAutomations(e,r){const i=new Map;this._automationsPerTrackIdAndBarIndex.set(e,i),this.parseAutomations(r,i,this._soundsByTrack.get(e))}parseNotationPatch(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"LineCount":const n=parseInt(i.innerText);for(let s of e.staves)s.standardNotationLineCount=n;break;case"Elements":this.parseElements(e,i);break}}parseInstrumentSet(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Type":switch(i.innerText){case"drumKit":for(let s of e.staves)s.isPercussion=!0;break}if(i.innerText==="drumKit")for(let s of e.staves)s.isPercussion=!0;break;case"Elements":this.parseElements(e,i);break;case"LineCount":const n=parseInt(i.innerText);for(let s of e.staves)s.standardNotationLineCount=n;break}}parseElements(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Element":this.parseElement(e,i);break}}parseElement(e,r){const i=r.findChildElement("Type"),n=i?i.innerText:"";for(let s of r.childNodes)if(s.nodeType===de.Element)switch(s.localName){case"Name":case"Articulations":this.parseArticulations(e,s,n);break}}parseArticulations(e,r,i){for(let n of r.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"Articulation":this.parseArticulation(e,n,i);break}}parseArticulation(e,r,i){const n=new Fe;n.outputMidiNumber=-1,n.elementType=i;let s="";for(let a of r.childNodes)if(a.nodeType===de.Element){const o=a.innerText;switch(a.localName){case"Name":s=a.innerText;break;case"OutputMidiNumber":o.length>0&&(n.outputMidiNumber=parseInt(o));break;case"TechniqueSymbol":n.techniqueSymbol=this.parseTechniqueSymbol(o);break;case"TechniquePlacement":switch(o){case"outside":n.techniqueSymbolPlacement=ft.Bottom;break;case"inside":n.techniqueSymbolPlacement=ft.Middle;break;case"above":n.techniqueSymbolPlacement=ft.Bottom;break;case"below":n.techniqueSymbolPlacement=ft.Top;break}break;case"Noteheads":const l=o.split(" ");l.length>=1&&(n.noteHeadDefault=this.parseNoteHead(l[0])),l.length>=2&&(n.noteHeadHalf=this.parseNoteHead(l[1])),l.length>=3&&(n.noteHeadWhole=this.parseNoteHead(l[2])),n.noteHeadHalf==B.None&&(n.noteHeadHalf=n.noteHeadDefault),n.noteHeadWhole==B.None&&(n.noteHeadWhole=n.noteHeadDefault);break;case"StaffLine":o.length>0&&(n.staffLine=parseInt(o));break}}n.outputMidiNumber!==-1?(e.percussionArticulations.push(n),s.length>0&&this._articulationByName.set(s,n)):s.length>0&&this._articulationByName.has(s)&&(this._articulationByName.get(s).staffLine=n.staffLine)}parseTechniqueSymbol(e){switch(e){case"pictEdgeOfCymbal":return B.PictEdgeOfCymbal;case"articStaccatoAbove":return B.ArticStaccatoAbove;case"noteheadParenthesis":return B.NoteheadParenthesis;case"stringsUpBow":return B.StringsUpBow;case"stringsDownBow":return B.StringsDownBow;case"guitarGolpe":return B.GuitarGolpe;default:return B.None}}parseNoteHead(e){switch(e){case"noteheadDoubleWholeSquare":return B.NoteheadDoubleWholeSquare;case"noteheadDoubleWhole":return B.NoteheadDoubleWhole;case"noteheadWhole":return B.NoteheadWhole;case"noteheadHalf":return B.NoteheadHalf;case"noteheadBlack":return B.NoteheadBlack;case"noteheadNull":return B.NoteheadNull;case"noteheadXOrnate":return B.NoteheadXOrnate;case"noteheadTriangleUpWhole":return B.NoteheadTriangleUpWhole;case"noteheadTriangleUpHalf":return B.NoteheadTriangleUpHalf;case"noteheadTriangleUpBlack":return B.NoteheadTriangleUpBlack;case"noteheadDiamondBlackWide":return B.NoteheadDiamondBlackWide;case"noteheadDiamondWhite":return B.NoteheadDiamondWhite;case"noteheadDiamondWhiteWide":return B.NoteheadDiamondWhiteWide;case"noteheadCircleX":return B.NoteheadCircleX;case"noteheadXWhole":return B.NoteheadXWhole;case"noteheadXHalf":return B.NoteheadXHalf;case"noteheadXBlack":return B.NoteheadXBlack;case"noteheadParenthesis":return B.NoteheadParenthesis;case"noteheadSlashedBlack2":return B.NoteheadSlashedBlack2;case"noteheadCircleSlash":return B.NoteheadCircleSlash;case"noteheadHeavyX":return B.NoteheadHeavyX;case"noteheadHeavyXHat":return B.NoteheadHeavyXHat;default:return he.warning("GPIF","Unknown notehead symbol",e),B.None}}parseStaves(e,r){let i=0;for(let n of r.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"Staff":e.ensureStaveCount(i+1);let s=e.staves[i];this.parseStaff(s,n),i++;break}}parseStaff(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Properties":this.parseStaffProperties(e,i);break}}parseStaffProperties(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Property":this.parseStaffProperty(e,i);break}}parseStaffProperty(e,r){switch(r.getAttribute("name")){case"Tuning":for(let s of r.childNodes)if(s.nodeType===de.Element)switch(s.localName){case"Pitches":let a=r.findChildElement("Pitches").innerText.split(" "),o=new Array(a.length);for(let l=0;l=12&&(e.playbackInfo.balance=Math.floor(parseFloat(i[11])*16),e.playbackInfo.volume=Math.floor(parseFloat(i[12])*16))}}parseMasterBarsNode(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"MasterBar":this.parseMasterBar(r);break}}parseMasterBar(e){let r=new to;this._masterBars.length===0&&this._hasAnacrusis&&(r.isAnacrusis=!0);for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"Time":let n=i.innerText.split("/");r.timeSignatureNumerator=parseInt(n[0]),r.timeSignatureDenominator=parseInt(n[1]);break;case"DoubleBar":r.isDoubleBar=!0;break;case"Section":r.section=new iy,r.section.marker=i.findChildElement("Letter").innerText,r.section.text=i.findChildElement("Text").innerText;break;case"Repeat":i.getAttribute("start").toLowerCase()==="true"&&(r.isRepeatStart=!0),i.getAttribute("end").toLowerCase()==="true"&&i.getAttribute("count")&&(r.repeatCount=parseInt(i.getAttribute("count")));break;case"AlternateEndings":let s=i.innerText.split(" "),a=0;for(let l=0;l0&&s0&&o.voices[0].beats.length>0){const l=o.voices[0].beats[0];for(const c of a)l.automations.push(c)}}}}for(const[e,r]of this._masterTrackAutomations){let i=this.score.masterBars[e];for(let n=0,s=r.length;n0){let r=0;for(let i of this.scoreViews[0].trackViewGroups){if(r32)throw new Wr("Invalid huffman");for(let c=0;c=n)throw new Wr("Invalid huffman");s[u]++}let o=0;for(let c=1;cr)throw new Wr("Invalid huffman");let s=i<<5|n;return e.has(s)?new vp(e.get(s)):(i=i<<1,n+=1,new fl(Si.treeMake(e,r,i,n),Si.treeMake(e,r,i|1,n)))}static treeCompress(e){let r=Si.treeDepth(e);if(r===0)return e;if(r===1){if(e instanceof fl)return new fl(Si.treeCompress(e.left),Si.treeCompress(e.right));throw new Wr("assert")}let i=1<0?(Si.treeWalk(e,r,i+1,n-1,s.left),Si.treeWalk(e,r|1<Vs.BufferSize&&this.slide(),this.buffer.set(e.subarray(r,r+i),this.pos),this.pos+=i}addByte(e){this.pos===Vs.BufferSize&&this.slide(),this.buffer[this.pos]=e,this.pos++}getLastChar(){return this.buffer[this.pos-1]}available(){return this.pos}}Vs.Size=32768;Vs.BufferSize=65536;class Ui{static buildFixedHuffman(){let e=[];for(let r=0;r<288;r++)e.push(r<=143?8:r<=255?9:r<=279?7:8);return Si.make(e,0,288,10)}constructor(e){this._nbits=0,this._bits=0,this._state=Fr.Block,this._isFinal=!1,this._huffman=Ui._fixedHuffman,this._huffdist=null,this._len=0,this._dist=0,this._needed=0,this._output=null,this._outpos=0,this._lengths=[],this._window=new Vs,this._input=e;for(let r=0;r<19;r++)this._lengths.push(-1)}readBytes(e,r,i){if(this._needed=i,this._outpos=r,this._output=e,i>0)for(;this.inflateLoop(););return i-this._needed}inflateLoop(){switch(this._state){case Fr.Head:let e=this._input.readByte();if((e&15)!==8)throw new Wr("Invalid data");let i=this._input.readByte(),n=(i&32)!==0;if(((e<<8)+i)%31!==0)throw new Wr("Invalid data");if(n)throw new Wr("Unsupported dictionary");return this._state=Fr.Block,!0;case Fr.Crc:return this._state=Fr.Done,!0;case Fr.Done:return!1;case Fr.Block:switch(this._isFinal=this.getBit(),this.getBits(2)){case 0:if(this._len=ae.readUInt16LE(this._input),ae.readUInt16LE(this._input)!==65535-this._len)throw new Wr("Invalid data");this._state=Fr.Flat;let o=this.inflateLoop();return this.resetBits(),o;case 1:return this._huffman=Ui._fixedHuffman,this._huffdist=null,this._state=Fr.CData,!0;case 2:let l=this.getBits(5)+257,c=this.getBits(5)+1,u=this.getBits(4)+4;for(let h=0;h0}case Fr.DistOne:{let a=this._len0}case Fr.Dist:for(;this._len>0&&this._needed>0;){let a=this._len0;case Fr.CData:let s=this.applyHuffman(this._huffman);if(s<256)return this.addByte(s),this._needed>0;if(s===256)return this._state=this._isFinal?Fr.Crc:Fr.Block,!0;{s=s-257&255;let a=Ui.LenExtraBitsTbl[s];if(a===-1)throw new Wr("Invalid data");this._len=Ui.LenBaseValTbl[s]+this.getBits(a);let o=this._huffdist,l=o?this.applyHuffman(o):this.getRevBits(5);if(a=Ui.DistExtraBitsTbl[l],a===-1)throw new Wr("Invalid data");if(this._dist=Ui.DistBaseValTbl[l]+this.getBits(a),this._dist>this._window.available())throw new Wr("Invalid data");return this._state=this._dist===1?Fr.DistOne:Fr.Dist,!0}}return!1}addDistOne(e){let r=this._window.getLastChar();for(let i=0;i>1,e}getBits(e){for(;this._nbits>e,r}getRevBits(e){return e===0?0:this.getBit()?1<r)throw new Wr("Invalid data");for(;ir)throw new Wr("Invalid data");break;case 18:if(i+=11+this.getBits(7),i>r)throw new Wr("Invalid data");break;default:throw new Wr("Invalid data")}}}applyHuffman(e){if(e instanceof vp)return e.n;if(e instanceof fl)return this.applyHuffman(this.getBit()?e.right:e.left);if(e instanceof av)return this.applyHuffman(e.table[this.getBits(e.n)]);throw new Wr("Invalid data")}}Ui.LenExtraBitsTbl=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,-1,-1];Ui.LenBaseValTbl=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258];Ui.DistExtraBitsTbl=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,-1,-1];Ui.DistBaseValTbl=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];Ui.CodeLengthsPos=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];Ui._fixedHuffman=Ui.buildFixedHuffman();class Ha{constructor(e,r){this.fullName=e;let i=e.lastIndexOf("/");this.fileName=i===-1||i===e.length-1?this.fullName:e.substr(i+1),this.data=r}}Ha.OptionalDataDescriptorSignature=134695760;Ha.CompressionMethodDeflate=8;Ha.LocalFileHeaderSignature=67324752;Ha.CentralFileHeaderSignature=33639248;Ha.EndOfCentralDirSignature=101010256;class sM{constructor(e){this._readable=e}read(){let e=[];for(;;){let r=this.readEntry();if(!r)break;e.push(r)}return e}readEntry(){let e=this._readable;if(ae.readInt32LE(e)!==Ha.LocalFileHeaderSignature)return null;ae.readUInt16LE(e);let i=ae.readUInt16LE(e),n=ae.readUInt16LE(e),s=n!==0;if(s&&n!==Ha.CompressionMethodDeflate)return null;ae.readInt16LE(this._readable),ae.readInt16LE(this._readable),ae.readInt32LE(e),ae.readInt32LE(e);let a=ae.readInt32LE(e),o=ae.readInt16LE(e),l=ae.readInt16LE(e),c=ae.toString(ae.readByteArray(e,o),"utf-8");e.skip(l);let u;if(s){let d=Di.empty(),h=new Ui(this._readable),p=new Uint8Array(65536);for(;;){let f=h.readBytes(p,0,p.length);if(d.write(p,0,f),f=0;)r=r|this.readBit()<=8){if(this._currentByte=this._source.readByte(),this._currentByte===-1)throw new gh;this._position=0}const e=this._currentByte>>yh.ByteSize-this._position-1&1;return this._position++,e}readAll(){let e=Di.empty();try{for(;;)e.writeByte(this.readByte()&255)}catch(r){if(!(r instanceof gh))throw r}return e.toArray()}}yh.ByteSize=8;class HQ{constructor(){this.fileName="",this.fileSize=0,this.data=null}}class Pu{constructor(){this.files=[],this.files=[],this.fileFilter=e=>!0}load(e){let r=new yh(e);this.readBlock(r)}readHeader(e){return this.getString(e.readBytes(4),0,4)}decompress(e,r=!1){let i=Di.empty(),n,s=this.getInteger(e.readBytes(4),0);try{for(;i.lengtho.endsWith("score.gpif")||o.endsWith("BinaryStylesheet")||o.endsWith("PartConfiguration"),e.load(this.data),he.debug(this.name,"GPX filesystem loaded");let r=null,i=null,n=null;for(let o of e.files)switch(o.fileName){case"score.gpif":r=ae.toString(o.data,this.settings.importer.encoding);break;case"BinaryStylesheet":i=o.data;break;case"PartConfiguration":n=o.data;break}if(!r)throw new jr("No score.gpif found in GPX");he.debug(this.name,"Start Parsing score.gpif");let s=new ds;s.parseXml(r,this.settings),he.debug(this.name,"score.gpif parsed");let a=s.score;return i&&(he.debug(this.name,"Start Parsing BinaryStylesheet"),new ny(i).apply(a),he.debug(this.name,"BinaryStylesheet parsed")),n&&(he.debug(this.name,"Start Parsing Part Configuration"),new nM(n).apply(a),he.debug(this.name,"Part Configuration parsed")),a}}class GQ extends Bu{get name(){return"MusicXML"}constructor(){super(),this._currentPartGroup=null,this._trackFirstMeasureNumber=0,this._maxVoices=0,this._currentDirection=null,this._currentChord=null,this._divisionsPerQuarterNote=0,this._voiceOfStaff=new Map,this._isBeamContinue=!1,this._previousBeatWasPulled=!1,this._previousBeat=null}readScore(){this._trackById=new Map,this._partGroups=new Map,this._tieStarts=[],this._tieStartIds=new Map,this._slurStarts=new Map;let e=ae.toString(this.data.readAll(),this.settings.importer.encoding),r=new FS;try{r.parse(e)}catch{throw new jr("Unsupported format")}return this._score=new Ql,this._score.tempo=120,this.parseDom(r),this.settings.importer.mergePartGroupsInMusicXml&&this.mergePartGroups(),this._score.finish(this.settings),this._score.rebuildRepeatGroups(),this._score}mergePartGroups(){let e=!1;for(const r of this._partGroups.values())r.length>1&&(this.mergeGroup(r),e=!0);if(e)for(let r=0;r0){let c=l[0].getElementsByTagName("staves",!1);if(c.length>0){let u=parseInt(c[0].innerText);r.ensureStaveCount(u)}}}let s=new Array(r.staves.length),a=null;for(let l=r.staves[0].bars.length;l<=n;l++)for(let c=0;c0){let d=r.staves[c].bars[r.staves[c].bars.length-1];u.clef=d.clef}a=this.getOrCreateMasterBar(n),r.staves[c].addBar(u),this.ensureVoices(u)}let o=new Map;if(a){let l=!1;for(let c of e.childNodes)if(c.nodeType===de.Element)switch(c.localName){case"note":this.parseNoteBeat(c,s);break;case"forward":this.parseForward(c,s);break;case"direction":this.parseDirection(c,a);break;case"attributes":l||(this.parseAttributes(c,s,a,r),l=!0);break;case"harmony":this.parseHarmony(c,r,o);break;case"sound":break;case"barline":this.parseBarline(c,a);break}}return!0}ensureVoices(e){for(;e.voices.length0&&(n=parseInt(s[0].innerText)-1);let a=this._previousBeatWasPulled;this._previousBeatWasPulled=!1;let o=e.getElementsByTagName("staff",!1),l=1;if(o.length>0){l=parseInt(o[0].innerText),(this._isBeamContinue||a)&&this._previousBeat.voice.bar.staff.index!==l-1&&(l=this._previousBeat.voice.bar.staff.index+1,this._previousBeatWasPulled=!0);let h=r[0].staff.track.index+"-"+l;this._voiceOfStaff.has(h)||this._voiceOfStaff.set(h,n)}l--;let c;l<0?c=r[0]:l>=r.length?c=r[r.length-1]:c=r[l];let u,d=this.getOrCreateVoice(c,n);return i&&d.beats.length>0||d.beats.length===1&&d.isEmpty?u=d.beats[d.beats.length-1]:(u=new Mi,u.isEmpty=!1,d.addBeat(u)),this._isBeamContinue=!1,this._previousBeat=u,u}parseForward(e,r){let i=this.getOrCreateBeat(e,r,!1),s=parseInt(e.findChildElement("duration").innerText)*H.Quarter/this._divisionsPerQuarterNote,a=[H.SixtyFourth,H.ThirtySecond,H.Sixteenth,H.Eighth,H.Quarter,H.Half,H.Whole];for(let o of a)if(s>=o){i.duration=o,s-=o;break}i.isEmpty=!1}parseStaffDetails(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"staff-lines":for(let n of r.staves)n.stringTuning.tunings=new Array(parseInt(i.innerText)).fill(0);break;case"staff-tuning":this.parseStaffTuning(i,r);break}for(let i of r.staves)this.isEmptyTuning(i.tuning)&&(i.stringTuning.tunings=[])}parseStaffTuning(e,r){let i=parseInt(e.getAttribute("line")),n="C",s="",a=0;for(let l of e.childNodes)if(l.nodeType===de.Element)switch(l.localName){case"tuning-step":n=l.innerText;break;case"tuning-alter":a=parseInt(l.innerText);break;case"tuning-octave":s=l.innerText;break}let o=er.getTuningForText(n+s)+a;for(let l of r.staves)l.tuning[l.tuning.length-i]=o}parseHarmony(e,r,i){let n=new Ho;for(let a of e.childNodes)if(a.nodeType===de.Element)switch(a.localName){case"root":n.name=this.parseHarmonyRoot(a);break;case"kind":n.name=n.name+this.parseHarmonyKind(a);break;case"frame":this.parseHarmonyFrame(a,n);break}this._currentChord=er.newGuid();const s=n.uniqueId;i.has(s)&&(n.showDiagram=!1);for(let a of r.staves)a.addChord(this._currentChord,n);i.set(s,n)}parseHarmonyRoot(e){let r="",i="";for(let n of e.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"root-step":r=n.innerText;break;case"root-alter":switch(parseInt(e.innerText)){case-2:i="bb";break;case-1:i="b";break;case 0:i="";break;case 1:i="#";break;case 2:i="##";break}break}return r+i}parseHarmonyKind(e){const r=e.getAttribute("text");let i="";if(r)i=r;else switch(e.innerText){case"major":i="";break;case"minor":i="m";break;case"augmented":i="+";break;case"diminished":i="○";break;case"dominant":i="7";break;case"major-seventh":i="7M";break;case"minor-seventh":i="m7";break;case"diminished-seventh":i="○7";break;case"augmented-seventh":i="+7";break;case"half-diminished":i="⍉";break;case"major-minor":i="mMaj";break;case"major-sixth":i="maj6";break;case"minor-sixth":i="m6";break;case"dominant-ninth":i="9";break;case"major-ninth":i="maj9";break;case"minor-ninth":i="m9";break;case"dominant-11th":i="11";break;case"major-11th":i="maj11";break;case"minor-11th":i="m11";break;case"dominant-13th":i="13";break;case"major-13th":i="maj13";break;case"minor-13th":i="m13";break;case"suspended-second":i="sus2";break;case"suspended-fourth":i="sus4";break}return i}parseHarmonyFrame(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"frame-strings":const n=parseInt(i.innerText);r.strings=new Array(n);for(let o=0;o=0&&(r.strings[s-1]=a);break;case"barre":s&&a&&o.getAttribute("type")==="start"&&r.barreFrets.push(a);break}break}}parseBarline(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"repeat":this.parseRepeat(i,r);break;case"ending":this.parseEnding(i,r);break}}parseEnding(e,r){let i=parseInt(e.getAttribute("number"));i>0&&(--i,r.alternateEndings=r.alternateEndings|1<0,n=this.getOrCreateBeat(e,r,i);!n.chordId&&this._currentChord&&(n.chordId=this._currentChord,this._currentChord=null),this._currentDirection&&(n.text=this._currentDirection,this._currentDirection=null);let s=new kr;n.voice.isEmpty=!1,n.isEmpty=!1,n.addNote(s),n.dots=0;let a=!1;for(let o of e.childNodes)if(o.nodeType===de.Element)switch(o.localName){case"grace":n.graceType=Ze.BeforeBeat,n.duration=H.ThirtySecond;break;case"duration":if(n.isRest&&!a)switch(parseInt(o.innerText)){case 1:n.duration=H.Whole;break;case 2:n.duration=H.Half;break;case 4:n.duration=H.Quarter;break;case 8:n.duration=H.Eighth;break;case 16:n.duration=H.Sixteenth;break;case 32:n.duration=H.ThirtySecond;break;case 64:n.duration=H.SixtyFourth;break;default:n.duration=H.Quarter;break}break;case"tie":this.parseTied(o,s);break;case"cue":break;case"instrument":break;case"type":n.duration=this.getDuration(o.innerText),n.graceType!==Ze.None&&n.duration0&&!r.isTieDestination){const i=this._tieStarts[0];i.beat.voice.index===r.beat.voice.index&&i.beat.voice.bar.staff.index===r.beat.voice.bar.staff.index&&i.beat.voice.bar.staff.track.index===r.beat.voice.bar.staff.track.index&&(r.isTieDestination=!0,r.tieOrigin=this._tieStarts[0]),this._tieStarts.splice(0,1),this._tieStartIds.delete(r.id)}}parseNotations(e,r,i){for(let n of e.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"articulations":this.parseArticulations(n,i);break;case"tied":this.parseTied(n,i);break;case"slide":case"glissando":n.getAttribute("type")==="start"&&(i.slideOutType=ut.Shift);break;case"dynamics":this.parseDynamics(n,r);break;case"technical":this.parseTechnical(n,i);break;case"ornaments":this.parseOrnaments(n,i);break;case"slur":let s=n.getAttribute("number");switch(s||(s="1"),s=r.voice.bar.staff.index+"_"+s,n.getAttribute("type")){case"start":this._slurStarts.set(s,i);break;case"stop":if(this._slurStarts.has(s)){i.isSlurDestination=!0;let a=this._slurStarts.get(s);a.slurDestination=i,i.slurOrigin=a}break}break}}parseOrnaments(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"tremolo":switch(parseInt(i.innerText)){case 1:r.beat.tremoloSpeed=H.Eighth;break;case 2:r.beat.tremoloSpeed=H.Sixteenth;break;case 3:r.beat.tremoloSpeed=H.ThirtySecond;break}break}}parseTechnical(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"string":r.string=parseInt(i.innerText),r.string!==-2147483648&&(r.string=r.beat.voice.bar.staff.tuning.length-r.string+1);break;case"fret":r.fret=parseInt(i.innerText);break;case"down-bow":r.beat.pickStroke=Bi.Down;break;case"up-bow":r.beat.pickStroke=Bi.Up;break}(r.string===-2147483648||r.fret===-2147483648)&&(r.string=-1,r.fret=-1)}parseArticulations(e,r){for(let i of e.childNodes)switch(i.localName){case"accent":r.accentuated=Yr.Normal;break;case"strong-accent":r.accentuated=Yr.Heavy;break;case"staccato":case"detached-legato":r.isStaccato=!0;break}}parseDynamics(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"p":r.dynamics=yt.P;break;case"pp":r.dynamics=yt.PP;break;case"ppp":r.dynamics=yt.PPP;break;case"f":r.dynamics=yt.F;break;case"ff":r.dynamics=yt.FF;break;case"fff":r.dynamics=yt.FFF;break;case"mp":r.dynamics=yt.MP;break;case"mf":r.dynamics=yt.MF;break}}parseTimeModification(e,r){for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"actual-notes":r.tupletNumerator=parseInt(i.innerText);break;case"normal-notes":r.tupletDenominator=parseInt(i.innerText);break}}parseUnpitched(e,r){let i="",n=0,s=0;for(let o of e.childNodes)if(o.nodeType===de.Element)switch(o.localName){case"display-step":i=o.innerText;break;case"display-alter":n=parseInt(o.innerText);break;case"display-octave":s=parseInt(o.innerText);break}let a=s*12+er.getToneForText(i)+n;r.octave=a/12|0,r.tone=a-r.octave*12}parsePitch(e,r){let i="",n=0,s=0;for(let o of e.childNodes)if(o.nodeType===de.Element)switch(o.localName){case"step":i=o.innerText;break;case"alter":n=parseFloat(o.innerText),isNaN(n)&&(n=0);break;case"octave":s=parseInt(o.innerText)+1;break}let a=s*12+er.getToneForText(i)+(n|0);r.octave=a/12|0,r.tone=a-r.octave*12}getOrCreateVoice(e,r){if(r0){let n=this._score.masterBars[this._score.masterBars.length-1];i.timeSignatureDenominator=n.timeSignatureDenominator,i.timeSignatureNumerator=n.timeSignatureNumerator,i.keySignature=n.keySignature,i.keySignatureType=n.keySignatureType}this._score.addMasterBar(i)}return this._score.masterBars[e]}parseIdentification(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"creator":r.getAttribute("type")==="composer"&&(this._score.music=r.innerText);break;case"rights":this._score.copyright&&(this._score.copyright+=` +`),this._score.copyright+=r.innerText;break}}parsePartList(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"part-group":this.parsePartGroup(r);break;case"score-part":this.parseScorePart(r);break}}parsePartGroup(e){switch(e.getAttribute("type")){case"start":this._currentPartGroup=e.getAttribute("number"),this._partGroups.set(this._currentPartGroup,[]);break;case"stop":this._currentPartGroup=null;break}}parseScorePart(e){let r=e.getAttribute("id"),i=new _a;i.ensureStaveCount(1);let n=i.staves[0];n.showStandardNotation=!0,this._trackById.set(r,i),this._score.addTrack(i),this._currentPartGroup&&this._partGroups.get(this._currentPartGroup).push(i);for(let s of e.childNodes)if(s.nodeType===de.Element)switch(s.localName){case"part-name":i.name=s.innerText;break;case"part-abbreviation":i.shortName=s.innerText;break;case"midi-instrument":this.parseMidiInstrument(s,i);break}this.isEmptyTuning(i.staves[0].tuning)&&(i.staves[0].stringTuning.tunings=[])}isEmptyTuning(e){if(!e)return!0;for(let r=0;r=this.events[this.events.length-1].tick)this.events.push(e);else{let r=this.events.length;for(;r>0&&this.events[r-1].tick>e.tick;)r--;this.events.splice(r,0,e)}}writeTo(e){let r=Di.empty(),i=0;for(let a of this.events){let o=a.tick-i;Io.writeVariableInt(r,o),a.writeTo(r),i=a.tick}const n=new Uint8Array([77,84,114,107]);e.write(n,0,n.length);let s=r.toArray();ae.writeInt32BE(e,s.length),e.write(s,0,s.length)}}class Io{constructor(){this.format=cu.SingleTrackMultiChannel,this.division=lt.QuarterTime,this.tracks=[]}get events(){if(this.tracks.length==1)return this.tracks[0].events;{const e=[];for(const r of this.tracks)this.events.push(...r.events);return e.sort((r,i)=>r.tick-i.tick),e}}ensureTracks(e){for(;this.tracks.length>=7;while(r>0);for(;n>0;)n--,n>0?e.writeByte(i[n]|128):e.writeByte(i[n])}}var Bt;(function(t){t[t.TimeSignature=88]="TimeSignature",t[t.NoteOn=128]="NoteOn",t[t.NoteOff=144]="NoteOff",t[t.ControlChange=176]="ControlChange",t[t.ProgramChange=192]="ProgramChange",t[t.TempoChange=81]="TempoChange",t[t.PitchBend=224]="PitchBend",t[t.PerNotePitchBend=96]="PerNotePitchBend",t[t.EndOfTrack=47]="EndOfTrack",t[t.AlphaTabRest=241]="AlphaTabRest",t[t.AlphaTabMetronome=242]="AlphaTabMetronome",t[t.SystemExclusive=240]="SystemExclusive",t[t.SystemExclusive2=247]="SystemExclusive2",t[t.Meta=255]="Meta"})(Bt||(Bt={}));class oo{constructor(e,r,i){this.track=e,this.tick=r,this.type=i}get command(){return this.type}get message(){return 0}get data1(){return 0}get data2(){return 0}}class oM extends oo{constructor(e,r,i,n,s,a){super(e,r,Bt.TimeSignature),this.track=e,this.tick=r,this.numerator=i,this.denominatorIndex=n,this.midiClocksPerMetronomeClick=s,this.thirtySecondNodesInQuarter=a}writeTo(e){e.writeByte(255),e.writeByte(88),Io.writeVariableInt(e,4),e.writeByte(this.numerator&255),e.writeByte(this.denominatorIndex&255),e.writeByte(this.midiClocksPerMetronomeClick&255),e.writeByte(this.thirtySecondNodesInQuarter&255)}}class ro extends oo{constructor(e,r,i){super(e,r,i)}writeTo(e){e.writeByte(240);const r=Di.withCapacity(16);r.writeByte(ro.AlphaTabManufacturerId),this.writeEventData(r),r.writeByte(247),Io.writeVariableInt(e,r.length),r.copyTo(e)}}ro.AlphaTabManufacturerId=125;ro.MetronomeEventId=0;ro.RestEventId=1;class lM extends ro{constructor(e,r,i,n,s){super(e,r,Bt.AlphaTabMetronome),this.isMetronome=!0,this.metronomeNumerator=i,this.metronomeDurationInMilliseconds=s,this.metronomeDurationInTicks=n}writeEventData(e){e.writeByte(ro.MetronomeEventId),e.writeByte(this.metronomeNumerator),ae.writeInt32LE(e,this.metronomeDurationInTicks),ae.writeInt32LE(e,this.metronomeDurationInMilliseconds)}}class cM extends ro{constructor(e,r,i){super(e,r,Bt.AlphaTabRest),this.channel=i}writeEventData(e){e.writeByte(ro.RestEventId),e.writeByte(this.channel)}}class uM extends oo{constructor(e,r,i,n,s,a){super(e,r,i),this.channel=n,this.noteKey=s,this.noteVelocity=a}get data1(){return this.noteKey}get data2(){return this.noteVelocity}}class dM extends uM{constructor(e,r,i,n,s){super(e,r,Bt.NoteOn,i,n,s)}writeTo(e){e.writeByte(this.channel&15|144),e.writeByte(this.noteKey&255),e.writeByte(this.noteVelocity&255)}}class hM extends uM{constructor(e,r,i,n,s){super(e,r,Bt.NoteOff,i,n,s)}writeTo(e){e.writeByte(this.channel&15|128),e.writeByte(this.noteKey&255),e.writeByte(this.noteVelocity&255)}}class fM extends oo{constructor(e,r,i,n,s){super(e,r,Bt.ControlChange),this.channel=i,this.controller=n,this.value=s}writeTo(e){e.writeByte(this.channel&15|176),e.writeByte(this.controller&255),e.writeByte(this.value&255)}get data1(){return this.controller}get data2(){return this.value}}class pM extends oo{constructor(e,r,i,n){super(e,r,Bt.ProgramChange),this.channel=i,this.program=n}writeTo(e){e.writeByte(this.channel&15|192),e.writeByte(this.program&255)}get data1(){return this.program}}class mM extends oo{constructor(e,r){super(0,e,Bt.TempoChange),this.microSecondsPerQuarterNote=r}writeTo(e){e.writeByte(255),e.writeByte(81),e.writeByte(3),e.writeByte(this.microSecondsPerQuarterNote>>16&255),e.writeByte(this.microSecondsPerQuarterNote>>8&255),e.writeByte(this.microSecondsPerQuarterNote&255)}}class gM extends oo{constructor(e,r,i,n){super(e,r,Bt.PitchBend),this.channel=i,this.value=n}writeTo(e){e.writeByte(this.channel&15|224),e.writeByte(this.value&127),e.writeByte(this.value>>7&127)}get data1(){return this.value&127}get data2(){return this.value>>7&127}}class yM extends oo{constructor(e,r,i,n,s){super(e,r,Bt.PerNotePitchBend),this.channel=i,this.noteKey=n,this.value=s}writeTo(e){throw new gi(mi.General,"Note Bend (Midi2.0) events cannot be exported to SMF1.0")}}class bM extends oo{constructor(e,r){super(e,r,Bt.EndOfTrack)}writeTo(e){e.writeByte(255),e.writeByte(47),e.writeByte(0)}}class Fd{constructor(e,r){this.time=0,this.eventIndex=e,this.event=r,this.isMetronome=this.event.type==Bt.AlphaTabMetronome}static newMetronomeEvent(e,r,i,n,s){const a=new lM(0,r,i,n,s);return new Fd(e,a)}}class ht{}ht.DefaultChannelCount=17;ht.MetronomeChannel=ht.DefaultChannelCount-1;ht.AudioChannels=2;ht.MinVolume=0;ht.MinProgram=0;ht.MaxProgram=127;ht.MinPlaybackSpeed=.125;ht.MaxPlaybackSpeed=8;ht.MaxPitchWheel=16384;ht.MaxPitchWheel20=4294967296;ht.DefaultPitchWheel=ht.MaxPitchWheel/2;ht.MicroBufferCount=32;ht.MicroBufferSize=64;class VC{constructor(e,r,i){this.bpm=e,this.ticks=r,this.time=i}}class ub{constructor(){this.tempoChanges=[],this.firstProgramEventPerChannel=new Map,this.firstTimeSignatureNumerator=0,this.firstTimeSignatureDenominator=0,this.synthData=[],this.division=lt.QuarterTime,this.eventIndex=0,this.currentTime=0,this.playbackRange=null,this.playbackRangeStartTime=0,this.playbackRangeEndTime=0,this.endTick=0,this.endTime=0}}class jQ{get isPlayingMain(){return this._currentState==this._mainState}get isPlayingOneTimeMidi(){return this._currentState==this._oneTimeState}get isPlayingCountIn(){return this._currentState==this._countInState}constructor(e){this._oneTimeState=null,this._countInState=null,this.isLooping=!1,this.playbackSpeed=1,this._synthesizer=e,this._mainState=new ub,this._currentState=this._mainState}get mainPlaybackRange(){return this._mainState.playbackRange}set mainPlaybackRange(e){this._mainState.playbackRange=e,e&&(this._mainState.playbackRangeStartTime=this.tickPositionToTimePositionWithSpeed(this._mainState,e.startTick,1),this._mainState.playbackRangeEndTime=this.tickPositionToTimePositionWithSpeed(this._mainState,e.endTick,1))}get currentTime(){return this._currentState.currentTime/this.playbackSpeed}get currentEndTick(){return this._currentState.endTick}get currentEndTime(){return this._currentState.endTime/this.playbackSpeed}mainSeek(e){if(e*=this.playbackSpeed,this.mainPlaybackRange&&(ethis._mainState.playbackRangeEndTime&&(e=this._mainState.playbackRangeEndTime)),e>this._mainState.currentTime)this.mainSilentProcess(e-this._mainState.currentTime);else if(e0)for(;ch.time>p.time?1:h.time0&&(e=this.internalEndTime}stop(){this.isPlayingMain&&this.mainPlaybackRange?this._currentState.currentTime=this.mainPlaybackRange.startTick:this._currentState.currentTime=0,this._currentState.eventIndex=0}resetOneTimeMidi(){this._oneTimeState=null,this._currentState=this._mainState}resetCountIn(){this._countInState=null,this._currentState=this._mainState}startCountIn(){this.generateCountInMidi(),this._currentState=this._countInState,this.stop(),this._synthesizer.noteOffAll(!0)}generateCountInMidi(){const e=new ub;e.division=this._mainState.division;let r=120,i=4,n=4;this._mainState.eventIndex===0?(r=this._mainState.tempoChanges[0].bpm,i=this._mainState.firstTimeSignatureNumerator,n=this._mainState.firstTimeSignatureDenominator):(r=this._synthesizer.currentTempo,i=this._synthesizer.timeSignatureNumerator,n=this._synthesizer.timeSignatureDenominator),e.tempoChanges.push(new VC(r,0,0));let s=e.division*(4/n)|0,a=s*(6e4/(r*this._mainState.division)),o=0,l=0;for(let c=0;cc.time>u.time?1:c.timee.size||i.position+$n.HeaderSize>=i.length||(r.id=ae.read8BitStringLength(i,4),r.id.charCodeAt(0)<=32||r.id.charCodeAt(0)>=122)||(r.size=ae.readUInt32LE(i),e&&$n.HeaderSize+r.size>e.size))return!1;e&&(e.size-=$n.HeaderSize+r.size);let n=r.id==="RIFF",s=r.id==="LIST";return n&&e?!1:!n&&!s?!0:(r.id=ae.read8BitStringLength(i,4),r.id.charCodeAt(0)<=32||r.id.charCodeAt(0)>=122?!1:(r.size-=4,!0))}}$n.HeaderSize=8;class OS{constructor(){this.phdrs=[],this.pbags=[],this.pmods=[],this.pgens=[],this.insts=[],this.ibags=[],this.imods=[],this.igens=[],this.sHdrs=[],this.fontSamples=new Float32Array(0)}load(e){const r=new $n,i=new $n;if(!$n.load(null,r,e)||r.id!=="sfbk")throw new Wr("Soundfont is not a valid Soundfont2 file");for(;$n.load(r,i,e);){let n=new $n;if(i.id==="pdta")for(;$n.load(i,n,e);)switch(n.id){case"phdr":for(let s=0,a=n.size/hv.SizeInFile|0;s0;){let o=Math.min(i,a.length/2|0);r.read(a,0,o*2);for(let l=0;l>8&255}constructor(e){this.wordAmount=ae.readUInt16LE(e)}}class YQ{constructor(){this.presetIndex=0,this.bank=0,this.pitchWheel=0,this.perNotePitchWheel=new Map,this.midiPan=0,this.midiVolume=0,this.midiExpression=0,this.midiRpn=0,this.midiData=0,this.panOffset=0,this.gainDb=0,this.pitchRange=0,this.tuning=0,this.mixVolume=0,this.mute=!1,this.solo=!1}}class XQ{constructor(){this.activeChannel=0,this.channelList=[]}setupVoice(e,r){const i=this.channelList[this.activeChannel],n=r.region.pan+i.panOffset;r.playingChannel=this.activeChannel,r.mixVolume=i.mixVolume,r.noteGainDb+=i.gainDb,r.updatePitchRatio(i,e.outSampleRate),n<=-.5?(r.panFactorLeft=1,r.panFactorRight=0):n>=.5?(r.panFactorLeft=0,r.panFactorRight=1):(r.panFactorLeft=Math.sqrt(.5-n),r.panFactorRight=Math.sqrt(.5+n))}}var Ia;(function(t){t[t.None=0]="None",t[t.Continuous=1]="Continuous",t[t.Sustain=2]="Sustain"})(Ia||(Ia={}));var xl;(function(t){t[t.StereoInterleaved=0]="StereoInterleaved",t[t.StereoUnweaved=1]="StereoUnweaved",t[t.Mono=2]="Mono"})(xl||(xl={}));class qQ{constructor(){this.name="",this.presetNumber=0,this.bank=0,this.regions=null,this.fontSamples=null}}class Pr{static timecents2Secs(e){return Math.pow(2,e/1200)}static decibelsToGain(e){return e>-100?Math.pow(10,e*.05):0}static gainToDecibels(e){return e<=1e-5?-100:20*Math.log10(e)}static cents2Hertz(e){return 8.176*Math.pow(2,e/1200)}static clamp(e,r,i){return e<=r?r:e>=i?i:e}}class pd{constructor(e){this.delay=0,this.attack=0,this.hold=0,this.decay=0,this.sustain=0,this.release=0,this.keynumToHold=0,this.keynumToDecay=0,e&&(this.delay=e.delay,this.attack=e.attack,this.hold=e.hold,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.keynumToHold=e.keynumToHold,this.keynumToDecay=e.keynumToDecay)}clear(){this.delay=0,this.attack=0,this.hold=0,this.decay=0,this.sustain=0,this.release=0,this.keynumToHold=0,this.keynumToDecay=0}envToSecs(e){this.delay=this.delay<-11950?0:Pr.timecents2Secs(this.delay),this.attack=this.attack<-11950?0:Pr.timecents2Secs(this.attack),this.release=this.release<-11950?0:Pr.timecents2Secs(this.release),this.keynumToHold===0&&(this.hold=this.hold<-11950?0:Pr.timecents2Secs(this.hold)),this.keynumToDecay===0&&(this.decay=this.decay<-11950?0:Pr.timecents2Secs(this.decay)),this.sustain<0?this.sustain=0:e?this.sustain=Pr.decibelsToGain(-this.sustain/10):this.sustain=1-this.sustain/1e3}}var _t;(function(t){t[t.StartAddrsOffset=0]="StartAddrsOffset",t[t.EndAddrsOffset=1]="EndAddrsOffset",t[t.StartloopAddrsOffset=2]="StartloopAddrsOffset",t[t.EndloopAddrsOffset=3]="EndloopAddrsOffset",t[t.StartAddrsCoarseOffset=4]="StartAddrsCoarseOffset",t[t.ModLfoToPitch=5]="ModLfoToPitch",t[t.VibLfoToPitch=6]="VibLfoToPitch",t[t.ModEnvToPitch=7]="ModEnvToPitch",t[t.InitialFilterFc=8]="InitialFilterFc",t[t.InitialFilterQ=9]="InitialFilterQ",t[t.ModLfoToFilterFc=10]="ModLfoToFilterFc",t[t.ModEnvToFilterFc=11]="ModEnvToFilterFc",t[t.EndAddrsCoarseOffset=12]="EndAddrsCoarseOffset",t[t.ModLfoToVolume=13]="ModLfoToVolume",t[t.Unused1=14]="Unused1",t[t.ChorusEffectsSend=15]="ChorusEffectsSend",t[t.ReverbEffectsSend=16]="ReverbEffectsSend",t[t.Pan=17]="Pan",t[t.Unused2=18]="Unused2",t[t.Unused3=19]="Unused3",t[t.Unused4=20]="Unused4",t[t.DelayModLFO=21]="DelayModLFO",t[t.FreqModLFO=22]="FreqModLFO",t[t.DelayVibLFO=23]="DelayVibLFO",t[t.FreqVibLFO=24]="FreqVibLFO",t[t.DelayModEnv=25]="DelayModEnv",t[t.AttackModEnv=26]="AttackModEnv",t[t.HoldModEnv=27]="HoldModEnv",t[t.DecayModEnv=28]="DecayModEnv",t[t.SustainModEnv=29]="SustainModEnv",t[t.ReleaseModEnv=30]="ReleaseModEnv",t[t.KeynumToModEnvHold=31]="KeynumToModEnvHold",t[t.KeynumToModEnvDecay=32]="KeynumToModEnvDecay",t[t.DelayVolEnv=33]="DelayVolEnv",t[t.AttackVolEnv=34]="AttackVolEnv",t[t.HoldVolEnv=35]="HoldVolEnv",t[t.DecayVolEnv=36]="DecayVolEnv",t[t.SustainVolEnv=37]="SustainVolEnv",t[t.ReleaseVolEnv=38]="ReleaseVolEnv",t[t.KeynumToVolEnvHold=39]="KeynumToVolEnvHold",t[t.KeynumToVolEnvDecay=40]="KeynumToVolEnvDecay",t[t.Instrument=41]="Instrument",t[t.Reserved1=42]="Reserved1",t[t.KeyRange=43]="KeyRange",t[t.VelRange=44]="VelRange",t[t.StartloopAddrsCoarseOffset=45]="StartloopAddrsCoarseOffset",t[t.Keynum=46]="Keynum",t[t.Velocity=47]="Velocity",t[t.InitialAttenuation=48]="InitialAttenuation",t[t.Reserved2=49]="Reserved2",t[t.EndloopAddrsCoarseOffset=50]="EndloopAddrsCoarseOffset",t[t.CoarseTune=51]="CoarseTune",t[t.FineTune=52]="FineTune",t[t.SampleID=53]="SampleID",t[t.SampleModes=54]="SampleModes",t[t.Reserved3=55]="Reserved3",t[t.ScaleTuning=56]="ScaleTuning",t[t.ExclusiveClass=57]="ExclusiveClass",t[t.OverridingRootKey=58]="OverridingRootKey",t[t.Unused5=59]="Unused5",t[t.EndOper=60]="EndOper"})(_t||(_t={}));class dc{constructor(e){this.loopMode=Ia.None,this.sampleRate=0,this.loKey=0,this.hiKey=0,this.loVel=0,this.hiVel=0,this.group=0,this.offset=0,this.end=0,this.loopStart=0,this.loopEnd=0,this.transpose=0,this.tune=0,this.pitchKeyCenter=0,this.pitchKeyTrack=0,this.attenuation=0,this.pan=0,this.ampEnv=new pd,this.modEnv=new pd,this.initialFilterQ=0,this.initialFilterFc=0,this.modEnvToPitch=0,this.modEnvToFilterFc=0,this.modLfoToFilterFc=0,this.modLfoToVolume=0,this.delayModLFO=0,this.freqModLFO=0,this.modLfoToPitch=0,this.delayVibLFO=0,this.freqVibLFO=0,this.vibLfoToPitch=0,e&&(this.loopMode=e.loopMode,this.sampleRate=e.sampleRate,this.loKey=e.loKey,this.hiKey=e.hiKey,this.loVel=e.loVel,this.hiVel=e.hiVel,this.group=e.group,this.offset=e.offset,this.end=e.end,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.transpose=e.transpose,this.tune=e.tune,this.pitchKeyCenter=e.pitchKeyCenter,this.pitchKeyTrack=e.pitchKeyTrack,this.attenuation=e.attenuation,this.pan=e.pan,this.ampEnv=new pd(e.ampEnv),this.modEnv=new pd(e.modEnv),this.initialFilterQ=e.initialFilterQ,this.initialFilterFc=e.initialFilterFc,this.modEnvToPitch=e.modEnvToPitch,this.modEnvToFilterFc=e.modEnvToFilterFc,this.modLfoToFilterFc=e.modLfoToFilterFc,this.modLfoToVolume=e.modLfoToVolume,this.delayModLFO=e.delayModLFO,this.freqModLFO=e.freqModLFO,this.modLfoToPitch=e.modLfoToPitch,this.delayVibLFO=e.delayVibLFO,this.freqVibLFO=e.freqVibLFO,this.vibLfoToPitch=e.vibLfoToPitch)}clear(e){this.loopMode=Ia.None,this.sampleRate=0,this.loKey=0,this.hiKey=0,this.loVel=0,this.hiVel=0,this.group=0,this.offset=0,this.end=0,this.loopStart=0,this.loopEnd=0,this.transpose=0,this.tune=0,this.pitchKeyCenter=0,this.pitchKeyTrack=0,this.attenuation=0,this.pan=0,this.ampEnv.clear(),this.modEnv.clear(),this.initialFilterQ=0,this.initialFilterFc=0,this.modEnvToPitch=0,this.modEnvToFilterFc=0,this.modLfoToFilterFc=0,this.modLfoToVolume=0,this.delayModLFO=0,this.freqModLFO=0,this.modLfoToPitch=0,this.delayVibLFO=0,this.freqVibLFO=0,this.vibLfoToPitch=0,this.hiKey=127,this.hiVel=127,this.pitchKeyCenter=60,!e&&(this.pitchKeyTrack=100,this.pitchKeyCenter=-1,this.ampEnv.delay=-12e3,this.ampEnv.attack=-12e3,this.ampEnv.hold=-12e3,this.ampEnv.decay=-12e3,this.ampEnv.release=-12e3,this.modEnv.delay=-12e3,this.modEnv.attack=-12e3,this.modEnv.hold=-12e3,this.modEnv.decay=-12e3,this.modEnv.release=-12e3,this.initialFilterFc=13500,this.delayModLFO=-12e3,this.delayVibLFO=-12e3)}operator(e,r){switch(e){case _t.StartAddrsOffset:this.offset+=pt.int16ToUint32(r.shortAmount);break;case _t.EndAddrsOffset:this.end+=pt.int16ToUint32(r.shortAmount);break;case _t.StartloopAddrsOffset:this.loopStart+=pt.int16ToUint32(r.shortAmount);break;case _t.EndloopAddrsOffset:this.loopEnd+=pt.int16ToUint32(r.shortAmount);break;case _t.StartAddrsCoarseOffset:this.offset+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.ModLfoToPitch:this.modLfoToPitch=r.shortAmount;break;case _t.VibLfoToPitch:this.vibLfoToPitch=r.shortAmount;break;case _t.ModEnvToPitch:this.modEnvToPitch=r.shortAmount;break;case _t.InitialFilterFc:this.initialFilterFc=r.shortAmount;break;case _t.InitialFilterQ:this.initialFilterQ=r.shortAmount;break;case _t.ModLfoToFilterFc:this.modLfoToFilterFc=r.shortAmount;break;case _t.ModEnvToFilterFc:this.modEnvToFilterFc=r.shortAmount;break;case _t.EndAddrsCoarseOffset:this.end+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.ModLfoToVolume:this.modLfoToVolume=r.shortAmount;break;case _t.Pan:this.pan=r.shortAmount/1e3;break;case _t.DelayModLFO:this.delayModLFO=r.shortAmount;break;case _t.FreqModLFO:this.freqModLFO=r.shortAmount;break;case _t.DelayVibLFO:this.delayVibLFO=r.shortAmount;break;case _t.FreqVibLFO:this.freqVibLFO=r.shortAmount;break;case _t.DelayModEnv:this.modEnv.delay=r.shortAmount;break;case _t.AttackModEnv:this.modEnv.attack=r.shortAmount;break;case _t.HoldModEnv:this.modEnv.hold=r.shortAmount;break;case _t.DecayModEnv:this.modEnv.decay=r.shortAmount;break;case _t.SustainModEnv:this.modEnv.sustain=r.shortAmount;break;case _t.ReleaseModEnv:this.modEnv.release=r.shortAmount;break;case _t.KeynumToModEnvHold:this.modEnv.keynumToHold=r.shortAmount;break;case _t.KeynumToModEnvDecay:this.modEnv.keynumToDecay=r.shortAmount;break;case _t.DelayVolEnv:this.ampEnv.delay=r.shortAmount;break;case _t.AttackVolEnv:this.ampEnv.attack=r.shortAmount;break;case _t.HoldVolEnv:this.ampEnv.hold=r.shortAmount;break;case _t.DecayVolEnv:this.ampEnv.decay=r.shortAmount;break;case _t.SustainVolEnv:this.ampEnv.sustain=r.shortAmount;break;case _t.ReleaseVolEnv:this.ampEnv.release=r.shortAmount;break;case _t.KeynumToVolEnvHold:this.ampEnv.keynumToHold=r.shortAmount;break;case _t.KeynumToVolEnvDecay:this.ampEnv.keynumToDecay=r.shortAmount;break;case _t.KeyRange:this.loKey=r.lowByteAmount,this.hiKey=r.highByteAmount;break;case _t.VelRange:this.loVel=r.lowByteAmount,this.hiVel=r.highByteAmount;break;case _t.StartloopAddrsCoarseOffset:this.loopStart+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.InitialAttenuation:this.attenuation+=r.shortAmount*.1;break;case _t.EndloopAddrsCoarseOffset:this.loopEnd+=pt.int16ToUint32(r.shortAmount)*32768;break;case _t.CoarseTune:this.transpose+=r.shortAmount;break;case _t.FineTune:this.tune+=r.shortAmount;break;case _t.SampleModes:this.loopMode=(r.wordAmount&3)===3?Ia.Sustain:(r.wordAmount&3)===1?Ia.Continuous:Ia.None;break;case _t.ScaleTuning:this.pitchKeyTrack=r.shortAmount;break;case _t.ExclusiveClass:this.group=r.wordAmount;break;case _t.OverridingRootKey:this.pitchKeyCenter=r.shortAmount;break}}}var Qt;(function(t){t[t.None=0]="None",t[t.Delay=1]="Delay",t[t.Attack=2]="Attack",t[t.Hold=3]="Hold",t[t.Decay=4]="Decay",t[t.Sustain=5]="Sustain",t[t.Release=6]="Release",t[t.Done=7]="Done"})(Qt||(Qt={}));class bh{constructor(){this.level=0,this.slope=0,this.samplesUntilNextSegment=0,this.segment=Qt.None,this.midiVelocity=0,this.parameters=null,this.segmentIsExponential=!1,this.isAmpEnv=!1}nextSegment(e,r){if(this.parameters)for(;;)switch(e){case Qt.None:if(this.samplesUntilNextSegment=this.parameters.delay*r|0,this.samplesUntilNextSegment>0){this.segment=Qt.Delay,this.segmentIsExponential=!1,this.level=0,this.slope=0;return}e=Qt.Delay;break;case Qt.Delay:if(this.samplesUntilNextSegment=this.parameters.attack*r|0,this.samplesUntilNextSegment>0){this.isAmpEnv||(this.samplesUntilNextSegment=this.parameters.attack*((145-this.midiVelocity)/144)*r|0),this.segment=Qt.Attack,this.segmentIsExponential=!1,this.level=0,this.slope=1/this.samplesUntilNextSegment;return}e=Qt.Attack;break;case Qt.Attack:if(this.samplesUntilNextSegment=this.parameters.hold*r|0,this.samplesUntilNextSegment>0){this.segment=Qt.Hold,this.segmentIsExponential=!1,this.level=1,this.slope=0;return}e=Qt.Hold;break;case Qt.Hold:if(this.samplesUntilNextSegment=this.parameters.decay*r|0,this.samplesUntilNextSegment>0){if(this.segment=Qt.Decay,this.level=1,this.isAmpEnv){let i=-9.226/this.samplesUntilNextSegment;this.slope=Math.exp(i),this.segmentIsExponential=!0,this.parameters.sustain>0&&(this.samplesUntilNextSegment=Math.log(this.parameters.sustain)/i|0)}else this.slope=-1/this.samplesUntilNextSegment,this.samplesUntilNextSegment=this.parameters.decay*(1-this.parameters.sustain)*r|0,this.segmentIsExponential=!1;return}e=Qt.Decay;break;case Qt.Decay:this.segment=Qt.Sustain,this.level=this.parameters.sustain,this.slope=0,this.samplesUntilNextSegment=2147483647,this.segmentIsExponential=!1;return;case Qt.Sustain:if(this.segment=Qt.Release,this.samplesUntilNextSegment=(this.parameters.release<=0?bh.FastReleaseTime:this.parameters.release)*r|0,this.isAmpEnv){let i=-9.226/this.samplesUntilNextSegment;this.slope=Math.exp(i),this.segmentIsExponential=!0}else this.slope=-this.level/this.samplesUntilNextSegment,this.segmentIsExponential=!1;return;default:this.segment=Qt.Done,this.segmentIsExponential=!1,this.level=0,this.slope=0,this.samplesUntilNextSegment=134217727;return}}setup(e,r,i,n,s){this.parameters=new pd(e),this.parameters.keynumToHold>0&&(this.parameters.hold+=this.parameters.keynumToHold*(60-r),this.parameters.hold=this.parameters.hold<-1e4?0:Pr.timecents2Secs(this.parameters.hold)),this.parameters.keynumToDecay>0&&(this.parameters.decay+=this.parameters.keynumToDecay*(60-r),this.parameters.decay=this.parameters.decay<-1e4?0:Pr.timecents2Secs(this.parameters.decay)),this.midiVelocity=i|0,this.isAmpEnv=n,this.nextSegment(Qt.None,s)}process(e,r){this.slope>0&&(this.segmentIsExponential?this.level*=Math.pow(this.slope,e):this.level+=this.slope*e),this.samplesUntilNextSegment-=e,this.samplesUntilNextSegment<=0&&this.nextSegment(this.segment,r)}}bh.FastReleaseTime=.01;class $C{constructor(){this.samplesUntil=0,this.level=0,this.delta=0}setup(e,r,i){this.samplesUntil=e*i|0,this.delta=4*Pr.cents2Hertz(r)/i,this.level=0}process(e){if(this.samplesUntil>e){this.samplesUntil-=e;return}this.level+=this.delta*e,this.level>1?(this.delta=-this.delta,this.level=2-this.level):this.level<-1&&(this.delta=-this.delta,this.level=-2-this.level)}}class zC{constructor(e){this.qInv=0,this.a0=0,this.a1=0,this.b1=0,this.b2=0,this.z1=0,this.z2=0,this.active=!1,e&&(this.qInv=e.qInv,this.a0=e.a0,this.a1=e.a1,this.b1=e.b1,this.b2=e.b2,this.z1=e.z1,this.z2=e.z2,this.active=e.active)}setup(e){let r=Math.tan(Math.PI*e),i=r*r,n=1/(1+r*this.qInv+i);this.a0=i*n,this.a1=2*this.a0,this.b1=2*(i-1)*n,this.b2=(1-r*this.qInv+i)*n}process(e){let r=e*this.a0+this.z1;return this.z1=e*this.a1+this.z2-this.b1*r,this.z2=e*this.a0-this.b2*r,r}}class vh{constructor(){this.playingPreset=0,this.playingKey=0,this.playingChannel=0,this.region=null,this.pitchInputTimecents=0,this.pitchOutputFactor=0,this.sourceSamplePosition=0,this.noteGainDb=0,this.panFactorLeft=0,this.panFactorRight=0,this.playIndex=0,this.loopStart=0,this.loopEnd=0,this.ampEnv=new bh,this.modEnv=new bh,this.lowPass=new zC,this.modLfo=new $C,this.vibLfo=new $C,this.mixVolume=0,this.mute=!1}updatePitchRatio(e,r){let i=e.pitchWheel;e.perNotePitchWheel.has(this.playingKey)&&(i+=e.perNotePitchWheel.get(this.playingKey)-8192);const n=i===8192?e.tuning:i/16383*e.pitchRange*2-e.pitchRange+e.tuning;this.calcPitchRatio(n,r)}calcPitchRatio(e,r){if(!this.region)return;const i=this.playingKey+this.region.transpose+this.region.tune/100;let n=this.region.pitchKeyCenter+(i-this.region.pitchKeyCenter)*(this.region.pitchKeyTrack/100);e!==0&&(n+=e),this.pitchInputTimecents=n*100,this.pitchOutputFactor=this.region.sampleRate/(Pr.timecents2Secs(this.region.pitchKeyCenter*100)*r)}end(e){this.region&&(this.ampEnv.nextSegment(Qt.Sustain,e),this.modEnv.nextSegment(Qt.Sustain,e),this.region.loopMode===Ia.Sustain&&(this.loopEnd=this.loopStart))}endQuick(e){this.ampEnv.parameters.release=0,this.ampEnv.nextSegment(Qt.Sustain,e),this.modEnv.parameters.release=0,this.modEnv.nextSegment(Qt.Sustain,e)}render(e,r,i,n,s){if(!this.region)return;let a=this.region,l=e.presets[this.playingPreset].fontSamples,c=0,u=e.outputMode===xl.StereoUnweaved?n:-1,d=a.modEnvToPitch!==0||a.modEnvToFilterFc!==0,h=this.modLfo.delta>0&&(a.modLfoToPitch!==0||a.modLfoToFilterFc!==0||a.modLfoToVolume!==0),p=this.vibLfo.delta>0&&a.vibLfoToPitch!==0,f=this.loopStart0;){let N,V,W=0,Q=n>vh.RenderEffectSampleBlock?vh.RenderEffectSampleBlock:n;if(n-=Q,C){let ne=_+this.modLfo.level*P+this.modEnv.level*R;k.active=ne<=13500,k.active&&k.setup(Pr.cents2Hertz(ne)/x)}switch(E&&(D=Pr.timecents2Secs(this.pitchInputTimecents+(this.modLfo.level*$+this.vibLfo.level*I+this.modEnv.level*F))*this.pitchOutputFactor),M&&(O=Pr.decibelsToGain(this.noteGainDb+this.modLfo.level*A)),N=O*this.ampEnv.level,s?N=0:N*=this.mixVolume,this.ampEnv.process(Q,e.outSampleRate),d&&this.modEnv.process(Q,e.outSampleRate),h&&this.modLfo.process(Q),p&&this.vibLfo.process(Q),e.outputMode){case xl.StereoInterleaved:for(V=N*this.panFactorLeft,W=N*this.panFactorRight;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]+=j*V,c++,r[i+c]+=j*W,c++,b+=D,b>=g&&f&&(b-=y-m+1)}break;case xl.StereoUnweaved:for(V=N*this.panFactorLeft,W=N*this.panFactorRight;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]+=j*V,c++,r[i+u]+=j*W,u++,b+=D,b>=g&&f&&(b-=y-m+1)}break;case xl.Mono:for(;Q-- >0&&b=y&&f?m:ne+1,te=b-ne,j=l[ne]*(1-te)+l[ie]*te;k.active&&(j=k.process(j)),r[i+c]=j*N,c++,b+=D,b>=g&&f&&(b-=y-m+1)}break}if(b>=v||this.ampEnv.segment===Qt.Done){this.kill();return}}this.sourceSamplePosition=b,(k.active||C)&&(this.lowPass=k)}kill(){this.playingPreset=-1}}vh.RenderEffectSampleBlock=ht.MicroBufferSize;class mv{constructor(){this._items=[],this._position=0,this.isEmpty=!0}clear(){this._items=[],this._position=0,this.isEmpty=!0}enqueue(e){this.isEmpty=!1,this._items.push(e)}peek(){return this._items[this._position]}dequeue(){const e=this._items[this._position];return this._position++,this._position>=this._items.length/2&&(this._items=this._items.slice(this._position),this._position=0),this.isEmpty=this._items.length==0,e}toArray(){const e=this._items.slice(this._position);return e.reverse(),e}}var jt;(function(t){t[t.BankSelectCoarse=0]="BankSelectCoarse",t[t.ModulationCoarse=1]="ModulationCoarse",t[t.DataEntryCoarse=6]="DataEntryCoarse",t[t.VolumeCoarse=7]="VolumeCoarse",t[t.PanCoarse=10]="PanCoarse",t[t.ExpressionControllerCoarse=11]="ExpressionControllerCoarse",t[t.BankSelectFine=32]="BankSelectFine",t[t.ModulationFine=33]="ModulationFine",t[t.DataEntryFine=38]="DataEntryFine",t[t.VolumeFine=39]="VolumeFine",t[t.PanFine=42]="PanFine",t[t.ExpressionControllerFine=43]="ExpressionControllerFine",t[t.HoldPedal=64]="HoldPedal",t[t.LegatoPedal=68]="LegatoPedal",t[t.NonRegisteredParameterFine=98]="NonRegisteredParameterFine",t[t.NonRegisteredParameterCourse=99]="NonRegisteredParameterCourse",t[t.RegisteredParameterFine=100]="RegisteredParameterFine",t[t.RegisteredParameterCourse=101]="RegisteredParameterCourse",t[t.AllSoundOff=120]="AllSoundOff",t[t.ResetControllers=121]="ResetControllers",t[t.AllNotesOff=123]="AllNotesOff"})(jt||(jt={}));class KQ{constructor(e){this._midiEventQueue=new mv,this._mutedChannels=new Map,this._soloChannels=new Map,this._isAnySolo=!1,this._transpositionPitches=new Map,this.currentTempo=0,this.timeSignatureNumerator=0,this.timeSignatureDenominator=0,this.presets=null,this._voices=[],this._channels=null,this._voicePlayIndex=0,this.outputMode=xl.StereoInterleaved,this.outSampleRate=0,this.globalGainDb=0,this.outSampleRate=e}synthesize(e,r,i){return this.fillWorkingBuffer(e,r,i)}synthesizeSilent(e){this.fillWorkingBuffer(null,0,e)}channelGetMixVolume(e){return this._channels&&e0}resetChannelStates(){this._mutedChannels=new Map,this._soloChannels=new Map,this.applyTranspositionPitches(new Map),this._isAnySolo=!1}applyTranspositionPitches(e){const r=this._transpositionPitches;for(const i of this._voices)if(i.playingChannel>=0&&i.playingChannel!==9){let n=0;r.has(i.playingChannel)&&(n-=r.get(i.playingChannel)),e.has(i.playingChannel)&&(n+=e.get(i.playingChannel)),i.playingKey+=n,this._channels&&i.updatePitchRatio(this._channels.channelList[i.playingChannel],this.outSampleRate)}this._transpositionPitches=e}dispatchEvent(e){this._midiEventQueue.enqueue(e)}fillWorkingBuffer(e,r,i){const n=this._isAnySolo,s=[];for(;!this._midiEventQueue.isEmpty;){let a=this._midiEventQueue.dequeue();a.isMetronome&&this.metronomeVolume>0?(this.channelNoteOff(ht.MetronomeChannel,33),this.channelNoteOn(ht.MetronomeChannel,33,95/127)):a.event&&this.processMidiMessage(a.event),s.push(a)}for(const a of this._voices)if(a.playingPreset!==-1){const o=a.playingChannel,l=this._mutedChannels.has(o)||n&&o!=ht.MetronomeChannel&&!this._soloChannels.has(o);e?a.render(this,e,r,i,l):a.kill()}return s}processMidiMessage(e){switch(he.debug("MIdi","Processing Midi message "+Bt[e.type]+"/"+e.tick),e.type){case Bt.TimeSignature:const i=e;this.timeSignatureNumerator=i.numerator,this.timeSignatureDenominator=Math.pow(2,i.denominatorIndex);break;case Bt.NoteOn:const n=e;this.channelNoteOn(n.channel,n.noteKey,n.noteVelocity/127);break;case Bt.NoteOff:const s=e;this.channelNoteOff(s.channel,s.noteKey);break;case Bt.ControlChange:const a=e;this.channelMidiControl(a.channel,a.controller,a.value);break;case Bt.ProgramChange:const o=e;this.channelSetPresetNumber(o.channel,o.program,o.channel===9);break;case Bt.TempoChange:const l=e;this.currentTempo=6e7/l.microSecondsPerQuarterNote;break;case Bt.PitchBend:const c=e;this.channelSetPitchWheel(c.channel,c.value);break;case Bt.PerNotePitchBend:const u=e;let d=u.value;d=d*ht.MaxPitchWheel/ht.MaxPitchWheel20,this.channelSetPerNotePitchWheel(u.channel,u.noteKey,d);break}}get metronomeVolume(){return this.channelGetMixVolume(ht.MetronomeChannel)}set metronomeVolume(e){this.setupMetronomeChannel(e)}setupMetronomeChannel(e){this.channelSetMixVolume(ht.MetronomeChannel,e),e>0&&(this.channelSetVolume(ht.MetronomeChannel,1),this.channelSetPresetNumber(ht.MetronomeChannel,0,!0))}get masterVolume(){return Pr.decibelsToGain(this.globalGainDb)}set masterVolume(e){var r=Pr.gainToDecibels(e);const i=r-this.globalGainDb;if(i!==0){for(const n of this._voices)n.playingPreset!==-1&&(n.noteGainDb+=i);this.globalGainDb=r}}resetSoft(){for(const e of this._voices)e.playingPreset!==-1&&(e.ampEnv.segment=1?r:44100,this.globalGainDb=i}noteOn(e,r,i){if(!this.presets)return;const n=i*127|0;if(e<0||e>=this.presets.length)return;if(i<=0){this.noteOff(e,r);return}const s=this._voicePlayIndex++;for(const a of this.presets[e].regions){if(ra.hiKey||na.hiVel)continue;let o=null;if(a.group!==0)for(const u of this._voices)u.playingPreset===e&&u.region.group===a.group?u.endQuick(this.outSampleRate):u.playingPreset===-1&&!o&&(o=u);else for(let u of this._voices)u.playingPreset===-1&&(o=u);if(!o){for(let u=0;u<4;u++){const d=new vh;d.playingPreset=-1,this._voices.push(d)}o=this._voices[this._voices.length-4]}o.region=a,o.playingPreset=e,o.playingKey=r,o.playIndex=s,o.noteGainDb=this.globalGainDb-a.attenuation-Pr.gainToDecibels(1/i),this._channels?this._channels.setupVoice(this,o):(o.calcPitchRatio(0,this.outSampleRate),o.panFactorLeft=Math.sqrt(.5-a.pan),o.panFactorRight=Math.sqrt(.5+a.pan)),o.sourceSamplePosition=a.offset;const l=a.loopMode!==Ia.None&&a.loopStart=Qt.Release||(!i||a.playIndex=Qt.Release)||a.end(this.outSampleRate)}bankNoteOff(e,r,i){const n=this.getPresetIndex(e,r);return n===-1?!1:(this.noteOff(n,i),!0)}noteOffAll(e){for(const r of this._voices)r.playingPreset!==-1&&r.ampEnv.segment=0;i--){let n=this.presets[i];if(n.presetNumber===r&&n.bank===e)return i}return-1}getPresetName(e){return this.presets?e<0||e>=this.presets.length?null:this.presets[e].name:null}bankGetPresetName(e,r){return this.getPresetName(this.getPresetIndex(e,r))}channelNoteOn(e,r,i){!this._channels||e>this._channels.channelList.length||(this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e)),this._channels.activeChannel=e,this.noteOn(this._channels.channelList[e].presetIndex,r,i))}channelNoteOff(e,r){this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e));const i=[];let n=null,s=null;for(const o of this._voices)o.playingPreset===-1||o.playingChannel!==e||o.playingKey!==r||o.ampEnv.segment>=Qt.Release||(!n||o.playIndex=Qt.Release)||o.end(this.outSampleRate)}channelNoteOffAll(e){this.channelInit(e).perNotePitchWheel.clear();for(const i of this._voices)i.playingPreset!==-1&&i.playingChannel===e&&i.ampEnv.segment=.5?(i.panFactorLeft=0,i.panFactorRight=1):(i.panFactorLeft=Math.sqrt(.5-n),i.panFactorRight=Math.sqrt(.5+n))}this.channelInit(e).panOffset=r-.5}channelSetVolume(e,r){const i=this.channelInit(e),n=Pr.gainToDecibels(r),s=n-i.gainDb;if(s!==0){for(const a of this._voices)a.playingChannel===e&&a.playingPreset!==-1&&(a.noteGainDb+=s);i.gainDb=n}}channelSetPitchWheel(e,r){const i=this.channelInit(e);i.pitchWheel!==r&&(i.pitchWheel=pt.int32ToUint16(r),this.channelApplyPitch(e,i))}channelSetPerNotePitchWheel(e,r,i){this._transpositionPitches.has(e)&&(r+=this._transpositionPitches.get(e));const n=this.channelInit(e);n.perNotePitchWheel.has(r)&&n.perNotePitchWheel.get(r)===i||(n.perNotePitchWheel.set(r,i),this.channelApplyPitch(e,n,r))}channelApplyPitch(e,r,i=-1){for(const n of this._voices)n.playingChannel===e&&n.playingPreset!==-1&&(i==-1||n.playingKey===i)&&n.updatePitchRatio(r,this.outSampleRate)}channelSetPitchRange(e,r){const i=this.channelInit(e);i.pitchRange!==r&&(i.pitchRange=r,i.pitchWheel!==8192&&this.channelApplyPitch(e,i))}channelSetTuning(e,r){const i=this.channelInit(e);i.tuning!==r&&(i.tuning=r,this.channelApplyPitch(e,i))}channelMidiControl(e,r,i){let n=this.channelInit(e);switch(r){case jt.DataEntryFine:n.midiData=pt.int32ToUint16(n.midiData&16256|i),n.midiRpn===0?this.channelSetPitchRange(e,(n.midiData>>7)+.01*(n.midiData&127)):n.midiRpn===1?this.channelSetTuning(e,(n.tuning|0)+(n.midiData-8192)/8192):n.midiRpn===2&&this.channelSetTuning(e,i-64+(n.tuning-(n.tuning|0)));return;case jt.VolumeCoarse:n.midiVolume=pt.int32ToUint16(n.midiVolume&127|i<<7),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.VolumeFine:n.midiVolume=pt.int32ToUint16(n.midiVolume&16256|i),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.ExpressionControllerCoarse:n.midiExpression=pt.int32ToUint16(n.midiExpression&127|i<<7),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.ExpressionControllerFine:n.midiExpression=pt.int32ToUint16(n.midiExpression&16256|i),this.channelSetVolume(e,Math.pow(n.midiVolume/16383*(n.midiExpression/16383),3));return;case jt.PanCoarse:n.midiPan=pt.int32ToUint16(n.midiPan&127|i<<7),this.channelSetPan(e,n.midiPan/16383);return;case jt.PanFine:n.midiPan=pt.int32ToUint16(n.midiPan&16256|i),this.channelSetPan(e,n.midiPan/16383);return;case jt.DataEntryCoarse:n.midiData=pt.int32ToUint16(n.midiData&127|i<<7),n.midiRpn===0?this.channelSetPitchRange(e,(n.midiData>>7)+.01*(n.midiData&127)):n.midiRpn===1?this.channelSetTuning(e,(n.tuning|0)+(n.midiData-8192)/8192):n.midiRpn===2&&r===jt.DataEntryCoarse&&this.channelSetTuning(e,i-64+(n.tuning-(n.tuning|0)));return;case jt.BankSelectCoarse:n.bank=pt.int32ToUint16(32768|i);return;case jt.BankSelectFine:n.bank=pt.int32ToUint16((n.bank&32768?(n.bank&127)<<7:0)|i);return;case jt.RegisteredParameterCourse:n.midiRpn=pt.int32ToUint16((n.midiRpn===65535?0:n.midiRpn)&127|i<<7);return;case jt.RegisteredParameterFine:n.midiRpn=pt.int32ToUint16((n.midiRpn===65535?0:n.midiRpn)&16256|i);return;case jt.NonRegisteredParameterFine:n.midiRpn=65535;return;case jt.NonRegisteredParameterCourse:n.midiRpn=65535;return;case jt.AllSoundOff:this.channelSoundsOffAll(e);return;case jt.AllNotesOff:this.channelNoteOffAll(e);return;case jt.ResetControllers:n.midiVolume=16383,n.midiExpression=16383,n.midiPan=8192,n.bank=0,this.channelSetVolume(e,1),this.channelSetPan(e,.5),this.channelSetPitchRange(e,2);return}}channelGetPresetIndex(e){return this._channels&&e=e.insts.length)continue;let g=e.insts[v.genAmount.wordAmount];for(let b=g.instBagNdx;b=h&&C<=p&&P>=f&&_<=m&&l++}}}}o.regions=new Array(l);let c=new dc;c.clear(!0);for(let u=s.presetBagNdx;u=e.insts.length)continue;let v=new dc;v.clear(!1);let g=e.insts[y];for(let b=g.instBagNdx;bh.hiKey||C.hiVelh.hiVel)continue;h.loKey>C.loKey&&(C.loKey=h.loKey),h.hiKeyC.loVel&&(C.loVel=h.loVel),h.hiVel.5&&(C.pan=.5),(C.initialFilterQ<1500||C.initialFilterQ>13500)&&(C.initialFilterQ=0);let R=e.sHdrs[P.genAmount.wordAmount];C.offset+=R.start,C.end+=R.end,C.loopStart+=R.startLoop,C.loopEnd+=R.endLoop,R.endLoop>0&&(C.loopEnd-=1),C.pitchKeyCenter===-1&&(C.pitchKeyCenter=R.originalPitch),C.tune+=R.pitchCorrection,C.sampleRate=R.sampleRate,C.end!==0&&C.endr!==e)}trigger(){for(const e of this._listeners)e()}}class Nt{constructor(){this._listeners=[]}on(e){this._listeners.push(e)}off(e){this._listeners=this._listeners.filter(r=>r!==e)}trigger(e){for(const r of this._listeners)r(e)}}class wM{constructor(e){this.events=e}}class SM{constructor(e){this.playbackRange=e}}class QQ{get isReadyForPlayback(){return this.isReady&&this._isSoundFontLoaded&&this._isMidiLoaded}get logLevel(){return he.logLevel}set logLevel(e){he.logLevel=e}get masterVolume(){return this._synthesizer.masterVolume}set masterVolume(e){e=Math.max(e,ht.MinVolume),this._synthesizer.masterVolume=e}get metronomeVolume(){return this._metronomeVolume}set metronomeVolume(e){e=Math.max(e,ht.MinVolume),this._metronomeVolume=e,this._synthesizer.metronomeVolume=e}get countInVolume(){return this._countInVolume}set countInVolume(e){e=Math.max(e,ht.MinVolume),this._countInVolume=e}get midiEventsPlayedFilter(){return Array.from(this._midiEventsPlayedFilter)}set midiEventsPlayedFilter(e){this._midiEventsPlayedFilter=new Set(e)}get playbackSpeed(){return this._sequencer.playbackSpeed}set playbackSpeed(e){e=Pr.clamp(e,ht.MinPlaybackSpeed,ht.MaxPlaybackSpeed);let r=this._sequencer.playbackSpeed;this._sequencer.playbackSpeed=e,this.timePosition=this.timePosition*(r/e)}get tickPosition(){return this._tickPosition}set tickPosition(e){this.timePosition=this._sequencer.mainTickPositionToTimePosition(e)}get timePosition(){return this._timePosition}set timePosition(e){he.debug("AlphaSynth",`Seeking to position ${e}ms (main)`),this._sequencer.mainSeek(e),this.updateTimePosition(e,!0),this._sequencer.isPlayingMain&&(this._notPlayedSamples=0,this.output.resetSamples())}get playbackRange(){return this._sequencer.mainPlaybackRange}set playbackRange(e){this._sequencer.mainPlaybackRange=e,e&&(this.tickPosition=e.startTick),this.playbackRangeChanged.trigger(new SM(e))}get isLooping(){return this._sequencer.isLooping}set isLooping(e){this._sequencer.isLooping=e}destroy(){he.debug("AlphaSynth","Destroying player"),this.stop(),this.output.destroy()}constructor(e,r){this._isSoundFontLoaded=!1,this._isMidiLoaded=!1,this._tickPosition=0,this._timePosition=0,this._metronomeVolume=0,this._countInVolume=0,this._playedEventsQueue=new mv,this._midiEventsPlayedFilter=new Set,this._notPlayedSamples=0,this.isReady=!1,this.state=ri.Paused,this.ready=new li,this.readyForPlayback=new li,this.finished=new li,this.soundFontLoaded=new li,this.soundFontLoadFailed=new Nt,this.midiLoaded=new Nt,this.midiLoadFailed=new Nt,this.stateChanged=new Nt,this.positionChanged=new Nt,this.midiEventsPlayed=new Nt,this.playbackRangeChanged=new Nt,he.debug("AlphaSynth","Initializing player"),this.state=ri.Paused,he.debug("AlphaSynth","Creating output"),this.output=e,he.debug("AlphaSynth","Creating synthesizer"),this._synthesizer=new KQ(this.output.sampleRate),this._sequencer=new jQ(this._synthesizer),he.debug("AlphaSynth","Opening output"),this.output.ready.on(()=>{this.isReady=!0,this.ready.trigger(),this.checkReadyForPlayback()}),this.output.sampleRequest.on(()=>{if(this.state==ri.Playing&&!this._sequencer.isFinished){let i=new Float32Array(ht.MicroBufferSize*ht.MicroBufferCount*ht.AudioChannels),n=0;for(let s=0;s0&&(he.debug("AlphaSynth","Starting countin"),this._sequencer.startCountIn(),this._synthesizer.setupMetronomeChannel(this._countInVolume),this.updateTimePosition(0,!0)),this.output.play(),!0)}playInternal(){this._sequencer.isPlayingOneTimeMidi&&(he.debug("AlphaSynth","Cancelling one time midi"),this.stopOneTimeMidi()),he.debug("AlphaSynth","Starting playback"),this._synthesizer.setupMetronomeChannel(this.metronomeVolume),this.state=ri.Playing,this.stateChanged.trigger(new wp(this.state,!1))}pause(){this.state===ri.Paused||!this._isMidiLoaded||(he.debug("AlphaSynth","Pausing playback"),this.state=ri.Paused,this.stateChanged.trigger(new wp(this.state,!1)),this.output.pause(),this._synthesizer.noteOffAll(!1))}playPause(){this.state!==ri.Paused||!this._isMidiLoaded?this.pause():this.play()}stop(){this._isMidiLoaded&&(he.debug("AlphaSynth","Stopping playback"),this.state=ri.Paused,this.output.pause(),this._notPlayedSamples=0,this._sequencer.stop(),this._synthesizer.noteOffAll(!0),this.tickPosition=this._sequencer.mainPlaybackRange?this._sequencer.mainPlaybackRange.startTick:0,this.stateChanged.trigger(new wp(this.state,!0)))}playOneTimeMidiFile(e){this._sequencer.isPlayingOneTimeMidi?this.stopOneTimeMidi():this.pause(),this._sequencer.loadOneTimeMidi(e),this._synthesizer.noteOffAll(!0),this.updateTimePosition(0,!0),this._notPlayedSamples=0,this.output.resetSamples(),this.output.play()}resetSoundFonts(){this.stop(),this._synthesizer.resetPresets(),this._isSoundFontLoaded=!1,this.soundFontLoaded.trigger()}loadSoundFont(e,r){this.pause();let i=Di.fromBuffer(e);try{he.debug("AlphaSynth","Loading soundfont from bytes");let n=new OS;n.load(i),this._synthesizer.loadPresets(n,r),this._isSoundFontLoaded=!0,this.soundFontLoaded.trigger(),he.debug("AlphaSynth","soundFont successfully loaded"),this.checkReadyForPlayback()}catch(n){he.error("AlphaSynth","Could not load soundfont from bytes "+n),this.soundFontLoadFailed.trigger(n)}}checkReadyForPlayback(){this.isReadyForPlayback&&(this._synthesizer.setupMetronomeChannel(this.metronomeVolume),this.readyForPlayback.trigger())}loadMidiFile(e){this.stop();try{he.debug("AlphaSynth","Loading midi from model"),this._sequencer.loadMidi(e),this._isMidiLoaded=!0,this.midiLoaded.trigger(new gm(0,this._sequencer.currentEndTime,0,this._sequencer.currentEndTick,!1)),he.debug("AlphaSynth","Midi successfully loaded"),this.checkReadyForPlayback(),this.tickPosition=0}catch(r){he.error("AlphaSynth","Could not load midi from model "+r),this.midiLoadFailed.trigger(r)}}applyTranspositionPitches(e){this._synthesizer.applyTranspositionPitches(e)}setChannelMute(e,r){this._synthesizer.channelSetMute(e,r)}resetChannelStates(){this._synthesizer.resetChannelStates()}setChannelSolo(e,r){this._synthesizer.channelSetSolo(e,r)}setChannelVolume(e,r){r=Math.max(r,ht.MinVolume),this._synthesizer.channelSetMixVolume(e,r)}onSamplesPlayed(e){if(e===0)return;let r=e/this._synthesizer.outSampleRate*1e3;this._notPlayedSamples-=e*ht.AudioChannels,this.updateTimePosition(this._timePosition+r,!1),this.checkForFinish()}checkForFinish(){let e=0,r=0;this.playbackRange&&this._sequencer.isPlayingMain?(e=this.playbackRange.startTick,r=this.playbackRange.endTick):r=this._sequencer.currentEndTick,this._tickPosition>=r&&this._notPlayedSamples<=0&&(this._notPlayedSamples=0,this._sequencer.isPlayingCountIn?(he.debug("AlphaSynth","Finished playback (count-in)"),this._sequencer.resetCountIn(),this.timePosition=this._sequencer.currentTime,this.playInternal(),this.output.resetSamples()):this._sequencer.isPlayingOneTimeMidi?(he.debug("AlphaSynth","Finished playback (one time)"),this.output.resetSamples(),this.state=ri.Paused,this.stopOneTimeMidi()):(he.debug("AlphaSynth","Finished playback (main)"),this.finished.trigger(),this.isLooping?this.tickPosition=e:this.stop()))}stopOneTimeMidi(){this.output.pause(),this._synthesizer.noteOffAll(!0),this._sequencer.resetOneTimeMidi(),this.timePosition=this._sequencer.currentTime}updateTimePosition(e,r){const i=e;this._timePosition=i;const n=this._sequencer.currentTimePositionToTickPosition(i);this._tickPosition=n;const s=this._sequencer.currentEndTime,a=this._sequencer.currentEndTick,o=this._sequencer.isPlayingMain?"main":this._sequencer.isPlayingCountIn?"count-in":"one-time";if(he.debug("AlphaSynth",`Position changed: (time: ${i}/${s}, tick: ${n}/${a}, Active Voices: ${this._synthesizer.activeVoiceCount} (${o})`),this._sequencer.isPlayingMain&&this.positionChanged.trigger(new gm(i,s,n,a,r)),r)this._playedEventsQueue.clear();else{const l=new mv;for(;!this._playedEventsQueue.isEmpty&&this._playedEventsQueue.peek().timen.toLowerCase()===e.toLowerCase())]:i;case"number":return e;case"undefined":case"object":return null}throw new gi(mi.Format,`Could not parse enum value '${e}'`)}static forEach(e,r){if(e instanceof Map)e.forEach(r);else if(typeof e=="object")for(const i in e)r(e[i],i)}static getValue(e,r){return e instanceof Map?e.get(r):typeof e=="object"?e[r]:null}}class JQ{constructor(e,r,i){this.text=e,this.startPos=r,this.endPos=i}}class Mc{constructor(e){this.style="normal",this.variant="normal",this.weight="normal",this.stretch="normal",this.lineHeight="normal",this.size="1rem",this.families=[],this.parseOnlyFamilies=!1,this._currentTokenIndex=-1,this._input="",this._currentToken=null,this._input=e,this._tokens=this.splitToTokens(e)}splitToTokens(e){const r=[];let i=0;for(;ii&&r.push(new JQ(e.substring(i,n),i,n)),i=n+1}return r}parse(){var e;if(this.reset(),this._tokens.length===1)switch((e=this._currentToken)==null?void 0:e.text){case"caption":case"icon":case"menu":case"message-box":case"small-caption":case"status-bar":case"inherit":return}this.parseOnlyFamilies||(this.fontStyleVariantWeight(),this.fontSizeLineHeight()),this.fontFamily()}static parseFamilies(e){const r=new Mc(e);return r.parseOnlyFamilies=!0,r.parse(),r.families}fontFamily(){if(!this._currentToken){if(this.parseOnlyFamilies)return;throw new Error("Missing font list")}const e=this._input.substr(this._currentToken.startPos).trim();let r=0;for(;r=3)throw new Error(`Invalid font size '${this._currentToken}' specified`);if(this.nextToken(),e.length>=2)if(e[1]==="/"){if(!this._currentToken)throw new Error("Missing line-height after font size");this.lineHeight=this._currentToken.text,this.nextToken()}else this.size=e[0],this.lineHeight=e[1];else if(e.length>=1){if(this.size=e[0],this._currentToken&&this._currentToken.text.indexOf("/")===0)if(this._currentToken.text==="/"){if(this.nextToken(),!this._currentToken)throw new Error("Missing line-height after font size");this.lineHeight=this._currentToken.text,this.nextToken()}else this.lineHeight=this._currentToken.text.substr(1),this.nextToken()}else throw new Error("Missing font size")}nextToken(){this._currentTokenIndex++,this._currentTokenIndex0;){const a=s.pop();i?r?e||(this.style=a):this.variant=a:this.weight=a}}reset(){this._currentTokenIndex=-1,this.nextToken()}static quoteFont(e){return e.indexOf(" ")===-1?e:`"${e.replaceAll('"','\\"')}"`}}var vr;(function(t){t[t.Plain=0]="Plain",t[t.Italic=1]="Italic"})(vr||(vr={}));var Tn;(function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold"})(Tn||(Tn={}));class Mt{reset(){this._cssScale=0,this._css=this.toCssString()}get family(){return this._families[0]}set family(e){this.families=Mc.parseFamilies(e)}get families(){return this._families}set families(e){this._families=e,this.reset()}get size(){return this._size}set size(e){this._size=e,this.reset()}get style(){return this._style}set style(e){this._style=e,this.reset()}get weight(){return this._weight}set weight(e){this._weight=e,this.reset()}get isBold(){return this.weight===Tn.Bold}get isItalic(){return this.style===vr.Italic}constructor(e,r,i=vr.Plain,n=Tn.Regular){this._cssScale=0,this._families=Mc.parseFamilies(e),this._size=r,this._style=i,this._weight=n,this._css=this.toCssString()}static withFamilyList(e,r,i=vr.Plain,n=Tn.Regular){const s=new Mt("",r,i,n);return s.families=e,s}toCssString(e=1){if(!this._css||!(Math.abs(e-this._cssScale)<.01)){let r="";this.isBold&&(r+="bold "),this.isItalic&&(r+="italic "),r+=this.size*e,r+="px ",r+=this.families.map(i=>Mc.quoteFont(i)).join(", "),this._css=r,this._cssScale=e}return this._css}static fromJson(e){switch(typeof e){case"undefined":return null;case"object":{const r=e;let i=r.get("families"),n=r.get("size"),s=Ee.parseEnum(r.get("style"),vr),a=Ee.parseEnum(r.get("weight"),Tn);return Mt.withFamilyList(i,n,s,a)}case"string":{const r=new Mc(e);r.parse();let i=r.families,n=r.size.toLowerCase(),s=0;switch(n){case"xx-small":s=7;break;case"x-small":s=10;break;case"small":case"smaller":s=13;break;case"medium":s=16;break;case"large":case"larger":s=18;break;case"x-large":s=24;break;case"xx-large":s=32;break;default:try{n.endsWith("em")?s=parseFloat(n.substr(0,n.length-2))*16:n.endsWith("pt")?s=parseFloat(n.substr(0,n.length-2))*16/12:n.endsWith("px")?s=parseFloat(n.substr(0,n.length-2)):s=12}catch{s=12}break}let a=vr.Plain;r.style==="italic"&&(a=vr.Italic);let o=Tn.Regular;switch(r.weight.toLowerCase()){case"normal":case"lighter":break;default:o=Tn.Bold;break}return Mt.withFamilyList(i,s,a,o)}default:return null}}static toJson(e){const r=new Map;return r.set("families",e.families),r.set("size",e.size),r.set("style",e.style),r.set("weight",e.weight),r}}class ln{constructor(){this.copyrightFont=new Mt(ln.sansFont,12,vr.Plain,Tn.Bold),this.titleFont=new Mt(ln.serifFont,32,vr.Plain),this.subTitleFont=new Mt(ln.serifFont,20,vr.Plain),this.wordsFont=new Mt(ln.serifFont,15,vr.Plain),this.effectFont=new Mt(ln.serifFont,12,vr.Italic),this.fretboardNumberFont=new Mt(ln.sansFont,11,vr.Plain),this.tablatureFont=new Mt(ln.sansFont,13,vr.Plain),this.graceFont=new Mt(ln.sansFont,11,vr.Plain),this.staffLineColor=new Yt(165,165,165,255),this.barSeparatorColor=new Yt(34,34,17,255),this.barNumberFont=new Mt(ln.sansFont,11,vr.Plain),this.barNumberColor=new Yt(200,0,0,255),this.fingeringFont=new Mt(ln.serifFont,14,vr.Plain),this.markerFont=new Mt(ln.serifFont,14,vr.Plain,Tn.Bold),this.mainGlyphColor=new Yt(0,0,0,255),this.secondaryGlyphColor=new Yt(0,0,0,100),this.scoreInfoColor=new Yt(0,0,0,255)}}ln.sansFont="Arial, sans-serif";ln.serifFont="Georgia, serif";var Go;(function(t){t[t.Automatic=0]="Automatic",t[t.UseModelLayout=1]="UseModelLayout"})(Go||(Go={}));class ZQ{constructor(){this.scale=1,this.stretchForce=1,this.layoutMode=Ya.Page,this.staveProfile=Cn.Default,this.barsPerRow=-1,this.startBar=1,this.barCount=-1,this.barCountPerPartial=10,this.justifyLastSystem=!1,this.resources=new ln,this.padding=null,this.systemsLayoutMode=Go.Automatic}}class eJ{constructor(){this.encoding="utf-8",this.mergePartGroupsInMusicXml=!1,this.beatTextAsLyrics=!1}}var Oa;(function(t){t[t.Off=0]="Off",t[t.Continuous=1]="Continuous",t[t.OffScreen=2]="OffScreen"})(Oa||(Oa={}));class tJ{constructor(){this.noteWideLength=480,this.noteWideAmplitude=2,this.noteSlightLength=480,this.noteSlightAmplitude=2,this.beatWideLength=240,this.beatWideAmplitude=3,this.beatSlightLength=240,this.beatSlightAmplitude=3}}class rJ{constructor(){this.simpleSlidePitchOffset=6,this.simpleSlideDurationRatio=.25,this.shiftSlideDurationRatio=.5}}var wh;(function(t){t[t.WebAudioAudioWorklets=0]="WebAudioAudioWorklets",t[t.WebAudioScriptProcessor=1]="WebAudioScriptProcessor"})(wh||(wh={}));class iJ{constructor(){this.soundFont=null,this.scrollElement="html,body",this.outputMode=wh.WebAudioAudioWorklets,this.enablePlayer=!1,this.enableCursor=!0,this.enableAnimatedBeatCursor=!0,this.enableElementHighlighting=!0,this.enableUserInteraction=!0,this.scrollOffsetX=0,this.scrollOffsetY=0,this.scrollMode=Oa.Continuous,this.scrollSpeed=300,this.nativeBrowserSmoothScroll=!0,this.songBookBendDuration=75,this.songBookDipDuration=150,this.vibrato=new tJ,this.slide=new rJ,this.playTripletFeel=!0,this.bufferTimeInMilliseconds=500}}class db{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("scriptfile",e.scriptFile),r.set("fontdirectory",e.fontDirectory),r.set("file",e.file),r.set("tex",e.tex),r.set("tracks",e.tracks),r.set("enablelazyloading",e.enableLazyLoading),r.set("engine",e.engine),r.set("loglevel",e.logLevel),r.set("useworkers",e.useWorkers),r.set("includenotebounds",e.includeNoteBounds),r}static setProperty(e,r,i){switch(r){case"scriptfile":return e.scriptFile=i,!0;case"fontdirectory":return e.fontDirectory=i,!0;case"file":return e.file=i,!0;case"tex":return e.tex=i,!0;case"tracks":return e.tracks=i,!0;case"enablelazyloading":return e.enableLazyLoading=i,!0;case"engine":return e.engine=i,!0;case"loglevel":return e.logLevel=Ee.parseEnum(i,Gs),!0;case"useworkers":return e.useWorkers=i,!0;case"includenotebounds":return e.includeNoteBounds=i,!0}return!1}}class hb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("copyrightfont",Mt.toJson(e.copyrightFont)),r.set("titlefont",Mt.toJson(e.titleFont)),r.set("subtitlefont",Mt.toJson(e.subTitleFont)),r.set("wordsfont",Mt.toJson(e.wordsFont)),r.set("effectfont",Mt.toJson(e.effectFont)),r.set("fretboardnumberfont",Mt.toJson(e.fretboardNumberFont)),r.set("tablaturefont",Mt.toJson(e.tablatureFont)),r.set("gracefont",Mt.toJson(e.graceFont)),r.set("stafflinecolor",Yt.toJson(e.staffLineColor)),r.set("barseparatorcolor",Yt.toJson(e.barSeparatorColor)),r.set("barnumberfont",Mt.toJson(e.barNumberFont)),r.set("barnumbercolor",Yt.toJson(e.barNumberColor)),r.set("fingeringfont",Mt.toJson(e.fingeringFont)),r.set("markerfont",Mt.toJson(e.markerFont)),r.set("mainglyphcolor",Yt.toJson(e.mainGlyphColor)),r.set("secondaryglyphcolor",Yt.toJson(e.secondaryGlyphColor)),r.set("scoreinfocolor",Yt.toJson(e.scoreInfoColor)),r}static setProperty(e,r,i){switch(r){case"copyrightfont":return e.copyrightFont=Mt.fromJson(i),!0;case"titlefont":return e.titleFont=Mt.fromJson(i),!0;case"subtitlefont":return e.subTitleFont=Mt.fromJson(i),!0;case"wordsfont":return e.wordsFont=Mt.fromJson(i),!0;case"effectfont":return e.effectFont=Mt.fromJson(i),!0;case"fretboardnumberfont":return e.fretboardNumberFont=Mt.fromJson(i),!0;case"tablaturefont":return e.tablatureFont=Mt.fromJson(i),!0;case"gracefont":return e.graceFont=Mt.fromJson(i),!0;case"stafflinecolor":return e.staffLineColor=Yt.fromJson(i),!0;case"barseparatorcolor":return e.barSeparatorColor=Yt.fromJson(i),!0;case"barnumberfont":return e.barNumberFont=Mt.fromJson(i),!0;case"barnumbercolor":return e.barNumberColor=Yt.fromJson(i),!0;case"fingeringfont":return e.fingeringFont=Mt.fromJson(i),!0;case"markerfont":return e.markerFont=Mt.fromJson(i),!0;case"mainglyphcolor":return e.mainGlyphColor=Yt.fromJson(i),!0;case"secondaryglyphcolor":return e.secondaryGlyphColor=Yt.fromJson(i),!0;case"scoreinfocolor":return e.scoreInfoColor=Yt.fromJson(i),!0}return!1}}class fb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("scale",e.scale),r.set("stretchforce",e.stretchForce),r.set("layoutmode",e.layoutMode),r.set("staveprofile",e.staveProfile),r.set("barsperrow",e.barsPerRow),r.set("startbar",e.startBar),r.set("barcount",e.barCount),r.set("barcountperpartial",e.barCountPerPartial),r.set("justifylastsystem",e.justifyLastSystem),r.set("resources",hb.toJson(e.resources)),r.set("padding",e.padding),r.set("systemslayoutmode",e.systemsLayoutMode),r}static setProperty(e,r,i){switch(r){case"scale":return e.scale=i,!0;case"stretchforce":return e.stretchForce=i,!0;case"layoutmode":return e.layoutMode=Ee.parseEnum(i,Ya),!0;case"staveprofile":return e.staveProfile=Ee.parseEnum(i,Cn),!0;case"barsperrow":return e.barsPerRow=i,!0;case"startbar":return e.startBar=i,!0;case"barcount":return e.barCount=i,!0;case"barcountperpartial":return e.barCountPerPartial=i,!0;case"justifylastsystem":return e.justifyLastSystem=i,!0;case"padding":return e.padding=i,!0;case"systemslayoutmode":return e.systemsLayoutMode=Ee.parseEnum(i,Go),!0}if(["resources"].indexOf(r)>=0)return hb.fromJson(e.resources,i),!0;for(const n of["resources"])if(r.indexOf(n)===0&&hb.setProperty(e.resources,r.substring(n.length),i))return!0;return!1}}class pb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;r.set("notationmode",e.notationMode),r.set("fingeringmode",e.fingeringMode);{const i=new Map;r.set("elements",i);for(const[n,s]of e.elements)i.set(n.toString(),s)}return r.set("rhythmmode",e.rhythmMode),r.set("rhythmheight",e.rhythmHeight),r.set("transpositionpitches",e.transpositionPitches),r.set("displaytranspositionpitches",e.displayTranspositionPitches),r.set("smallgracetabnotes",e.smallGraceTabNotes),r.set("extendbendarrowsontiednotes",e.extendBendArrowsOnTiedNotes),r.set("extendlineeffectstobeatend",e.extendLineEffectsToBeatEnd),r.set("slurheight",e.slurHeight),r}static setProperty(e,r,i){switch(r){case"notationmode":return e.notationMode=Ee.parseEnum(i,ai),!0;case"fingeringmode":return e.fingeringMode=Ee.parseEnum(i,ta),!0;case"elements":return e.elements=new Map,Ee.forEach(i,(n,s)=>{e.elements.set(Ee.parseEnum(s,rt),n)}),!0;case"rhythmmode":return e.rhythmMode=Ee.parseEnum(i,Wa),!0;case"rhythmheight":return e.rhythmHeight=i,!0;case"transpositionpitches":return e.transpositionPitches=i,!0;case"displaytranspositionpitches":return e.displayTranspositionPitches=i,!0;case"smallgracetabnotes":return e.smallGraceTabNotes=i,!0;case"extendbendarrowsontiednotes":return e.extendBendArrowsOnTiedNotes=i,!0;case"extendlineeffectstobeatend":return e.extendLineEffectsToBeatEnd=i,!0;case"slurheight":return e.slurHeight=i,!0}return!1}}class mb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("encoding",e.encoding),r.set("mergepartgroupsinmusicxml",e.mergePartGroupsInMusicXml),r.set("beattextaslyrics",e.beatTextAsLyrics),r}static setProperty(e,r,i){switch(r){case"encoding":return e.encoding=i,!0;case"mergepartgroupsinmusicxml":return e.mergePartGroupsInMusicXml=i,!0;case"beattextaslyrics":return e.beatTextAsLyrics=i,!0}return!1}}class gb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("notewidelength",e.noteWideLength),r.set("notewideamplitude",e.noteWideAmplitude),r.set("noteslightlength",e.noteSlightLength),r.set("noteslightamplitude",e.noteSlightAmplitude),r.set("beatwidelength",e.beatWideLength),r.set("beatwideamplitude",e.beatWideAmplitude),r.set("beatslightlength",e.beatSlightLength),r.set("beatslightamplitude",e.beatSlightAmplitude),r}static setProperty(e,r,i){switch(r){case"notewidelength":return e.noteWideLength=i,!0;case"notewideamplitude":return e.noteWideAmplitude=i,!0;case"noteslightlength":return e.noteSlightLength=i,!0;case"noteslightamplitude":return e.noteSlightAmplitude=i,!0;case"beatwidelength":return e.beatWideLength=i,!0;case"beatwideamplitude":return e.beatWideAmplitude=i,!0;case"beatslightlength":return e.beatSlightLength=i,!0;case"beatslightamplitude":return e.beatSlightAmplitude=i,!0}return!1}}class yb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("simpleslidepitchoffset",e.simpleSlidePitchOffset),r.set("simpleslidedurationratio",e.simpleSlideDurationRatio),r.set("shiftslidedurationratio",e.shiftSlideDurationRatio),r}static setProperty(e,r,i){switch(r){case"simpleslidepitchoffset":return e.simpleSlidePitchOffset=i,!0;case"simpleslidedurationratio":return e.simpleSlideDurationRatio=i,!0;case"shiftslidedurationratio":return e.shiftSlideDurationRatio=i,!0}return!1}}class bb{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("soundfont",e.soundFont),r.set("outputmode",e.outputMode),r.set("enableplayer",e.enablePlayer),r.set("enablecursor",e.enableCursor),r.set("enableanimatedbeatcursor",e.enableAnimatedBeatCursor),r.set("enableelementhighlighting",e.enableElementHighlighting),r.set("enableuserinteraction",e.enableUserInteraction),r.set("scrolloffsetx",e.scrollOffsetX),r.set("scrolloffsety",e.scrollOffsetY),r.set("scrollmode",e.scrollMode),r.set("scrollspeed",e.scrollSpeed),r.set("nativebrowsersmoothscroll",e.nativeBrowserSmoothScroll),r.set("songbookbendduration",e.songBookBendDuration),r.set("songbookdipduration",e.songBookDipDuration),r.set("vibrato",gb.toJson(e.vibrato)),r.set("slide",yb.toJson(e.slide)),r.set("playtripletfeel",e.playTripletFeel),r.set("buffertimeinmilliseconds",e.bufferTimeInMilliseconds),r}static setProperty(e,r,i){switch(r){case"soundfont":return e.soundFont=i,!0;case"scrollelement":return e.scrollElement=i,!0;case"outputmode":return e.outputMode=Ee.parseEnum(i,wh),!0;case"enableplayer":return e.enablePlayer=i,!0;case"enablecursor":return e.enableCursor=i,!0;case"enableanimatedbeatcursor":return e.enableAnimatedBeatCursor=i,!0;case"enableelementhighlighting":return e.enableElementHighlighting=i,!0;case"enableuserinteraction":return e.enableUserInteraction=i,!0;case"scrolloffsetx":return e.scrollOffsetX=i,!0;case"scrolloffsety":return e.scrollOffsetY=i,!0;case"scrollmode":return e.scrollMode=Ee.parseEnum(i,Oa),!0;case"scrollspeed":return e.scrollSpeed=i,!0;case"nativebrowsersmoothscroll":return e.nativeBrowserSmoothScroll=i,!0;case"songbookbendduration":return e.songBookBendDuration=i,!0;case"songbookdipduration":return e.songBookDipDuration=i,!0;case"playtripletfeel":return e.playTripletFeel=i,!0;case"buffertimeinmilliseconds":return e.bufferTimeInMilliseconds=i,!0}if(["vibrato"].indexOf(r)>=0)return gb.fromJson(e.vibrato,i),!0;for(const n of["vibrato"])if(r.indexOf(n)===0&&gb.setProperty(e.vibrato,r.substring(n.length),i))return!0;if(["slide"].indexOf(r)>=0)return yb.fromJson(e.slide,i),!0;for(const n of["slide"])if(r.indexOf(n)===0&&yb.setProperty(e.slide,r.substring(n.length),i))return!0;return!1}}class uu{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n.toLowerCase(),i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("core",db.toJson(e.core)),r.set("display",fb.toJson(e.display)),r.set("notation",pb.toJson(e.notation)),r.set("importer",mb.toJson(e.importer)),r.set("player",bb.toJson(e.player)),r}static setProperty(e,r,i){if(["core",""].indexOf(r)>=0)return db.fromJson(e.core,i),!0;for(const n of["core",""])if(r.indexOf(n)===0&&db.setProperty(e.core,r.substring(n.length),i))return!0;if(["display",""].indexOf(r)>=0)return fb.fromJson(e.display,i),!0;for(const n of["display",""])if(r.indexOf(n)===0&&fb.setProperty(e.display,r.substring(n.length),i))return!0;if(["notation"].indexOf(r)>=0)return pb.fromJson(e.notation,i),!0;for(const n of["notation"])if(r.indexOf(n)===0&&pb.setProperty(e.notation,r.substring(n.length),i))return!0;if(["importer"].indexOf(r)>=0)return mb.fromJson(e.importer,i),!0;for(const n of["importer"])if(r.indexOf(n)===0&&mb.setProperty(e.importer,r.substring(n.length),i))return!0;if(["player"].indexOf(r)>=0)return bb.fromJson(e.player,i),!0;for(const n of["player"])if(r.indexOf(n)===0&&bb.setProperty(e.player,r.substring(n.length),i))return!0;return!1}}class Wl{constructor(){this.core=new zM,this.display=new ZQ,this.notation=new mh,this.importer=new eJ,this.player=new iJ}setSongBookModeSettings(){this.notation.notationMode=ai.SongBook,this.notation.smallGraceTabNotes=!1,this.notation.fingeringMode=ta.SingleNoteEffectBand,this.notation.extendBendArrowsOnTiedNotes=!1,this.notation.elements.set(rt.ParenthesisOnTiedBends,!1),this.notation.elements.set(rt.TabNotesOnTiedBends,!1),this.notation.elements.set(rt.ZerosOnDiveWhammys,!0)}static get songBook(){let e=new Wl;return e.setSongBookModeSettings(),e}fillFromJson(e){uu.fromJson(this,e)}}class WC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("marker",e.marker),r.set("text",e.text),r}static setProperty(e,r,i){switch(r){case"marker":return e.marker=i,!0;case"text":return e.text=i,!0}return!1}}class ym{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("islinear",e.isLinear),r.set("type",e.type),r.set("value",e.value),r.set("ratioposition",e.ratioPosition),r.set("text",e.text),r}static setProperty(e,r,i){switch(r){case"islinear":return e.isLinear=i,!0;case"type":return e.type=Ee.parseEnum(i,oi),!0;case"value":return e.value=i,!0;case"ratioposition":return e.ratioPosition=i,!0;case"text":return e.text=i,!0}return!1}}class HC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("type",e.type),r.set("length",e.length),r}static setProperty(e,r,i){switch(r){case"type":return e.type=Ee.parseEnum(i,Qs),!0;case"length":return e.length=i,!0}return!1}}class UC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;if(r.set("alternateendings",e.alternateEndings),r.set("keysignature",e.keySignature),r.set("keysignaturetype",e.keySignatureType),r.set("isdoublebar",e.isDoubleBar),r.set("isrepeatstart",e.isRepeatStart),r.set("repeatcount",e.repeatCount),r.set("timesignaturenumerator",e.timeSignatureNumerator),r.set("timesignaturedenominator",e.timeSignatureDenominator),r.set("timesignaturecommon",e.timeSignatureCommon),r.set("tripletfeel",e.tripletFeel),r.set("section",WC.toJson(e.section)),r.set("tempoautomation",ym.toJson(e.tempoAutomation)),e.fermata!==null){const i=new Map;r.set("fermata",i);for(const[n,s]of e.fermata)i.set(n.toString(),HC.toJson(s))}return r.set("start",e.start),r.set("isanacrusis",e.isAnacrusis),r.set("displayscale",e.displayScale),r.set("displaywidth",e.displayWidth),r}static setProperty(e,r,i){switch(r){case"alternateendings":return e.alternateEndings=i,!0;case"keysignature":return e.keySignature=Ee.parseEnum(i,ei),!0;case"keysignaturetype":return e.keySignatureType=Ee.parseEnum(i,Uo),!0;case"isdoublebar":return e.isDoubleBar=i,!0;case"isrepeatstart":return e.isRepeatStart=i,!0;case"repeatcount":return e.repeatCount=i,!0;case"timesignaturenumerator":return e.timeSignatureNumerator=i,!0;case"timesignaturedenominator":return e.timeSignatureDenominator=i,!0;case"timesignaturecommon":return e.timeSignatureCommon=i,!0;case"tripletfeel":return e.tripletFeel=Ee.parseEnum(i,gt),!0;case"fermata":return e.fermata=new Map,Ee.forEach(i,(n,s)=>{const a=new DS;HC.fromJson(a,n),e.addFermata(parseInt(s),a)}),!0;case"start":return e.start=i,!0;case"isanacrusis":return e.isAnacrusis=i,!0;case"displayscale":return e.displayScale=i,!0;case"displaywidth":return e.displayWidth=i,!0}return["section"].indexOf(r)>=0?(i?(e.section=new iy,WC.fromJson(e.section,i)):e.section=null,!0):["tempoautomation"].indexOf(r)>=0?(i?(e.tempoAutomation=new Ei,ym.fromJson(e.tempoAutomation,i)):e.tempoAutomation=null,!0):!1}}class bm{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("offset",e.offset),r.set("value",e.value),r}static setProperty(e,r,i){switch(r){case"offset":return e.offset=i,!0;case"value":return e.value=i,!0}return!1}}class GC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){var i;if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("accentuated",e.accentuated),r.set("bendtype",e.bendType),r.set("bendstyle",e.bendStyle),r.set("iscontinuedbend",e.isContinuedBend),e.bendPoints!==null&&r.set("bendpoints",(i=e.bendPoints)==null?void 0:i.map(n=>bm.toJson(n))),r.set("fret",e.fret),r.set("string",e.string),r.set("octave",e.octave),r.set("tone",e.tone),r.set("percussionarticulation",e.percussionArticulation),r.set("isvisible",e.isVisible),r.set("islefthandtapped",e.isLeftHandTapped),r.set("ishammerpullorigin",e.isHammerPullOrigin),r.set("isslurdestination",e.isSlurDestination),r.set("harmonictype",e.harmonicType),r.set("harmonicvalue",e.harmonicValue),r.set("isghost",e.isGhost),r.set("isletring",e.isLetRing),r.set("ispalmmute",e.isPalmMute),r.set("isdead",e.isDead),r.set("isstaccato",e.isStaccato),r.set("slideintype",e.slideInType),r.set("slideouttype",e.slideOutType),r.set("vibrato",e.vibrato),r.set("istiedestination",e.isTieDestination),r.set("lefthandfinger",e.leftHandFinger),r.set("righthandfinger",e.rightHandFinger),r.set("isfingering",e.isFingering),r.set("trillvalue",e.trillValue),r.set("trillspeed",e.trillSpeed),r.set("durationpercent",e.durationPercent),r.set("accidentalmode",e.accidentalMode),r.set("dynamics",e.dynamics),e.toJson(r),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"accentuated":return e.accentuated=Ee.parseEnum(i,Yr),!0;case"bendtype":return e.bendType=Ee.parseEnum(i,We),!0;case"bendstyle":return e.bendStyle=Ee.parseEnum(i,Gt),!0;case"iscontinuedbend":return e.isContinuedBend=i,!0;case"bendpoints":if(i){e.bendPoints=[];for(const n of i){const s=new Me;bm.fromJson(s,n),e.addBendPoint(s)}}return!0;case"fret":return e.fret=i,!0;case"string":return e.string=i,!0;case"octave":return e.octave=i,!0;case"tone":return e.tone=i,!0;case"percussionarticulation":return e.percussionArticulation=i,!0;case"isvisible":return e.isVisible=i,!0;case"islefthandtapped":return e.isLeftHandTapped=i,!0;case"ishammerpullorigin":return e.isHammerPullOrigin=i,!0;case"isslurdestination":return e.isSlurDestination=i,!0;case"harmonictype":return e.harmonicType=Ee.parseEnum(i,qe),!0;case"harmonicvalue":return e.harmonicValue=i,!0;case"isghost":return e.isGhost=i,!0;case"isletring":return e.isLetRing=i,!0;case"ispalmmute":return e.isPalmMute=i,!0;case"isdead":return e.isDead=i,!0;case"isstaccato":return e.isStaccato=i,!0;case"slideintype":return e.slideInType=Ee.parseEnum(i,pi),!0;case"slideouttype":return e.slideOutType=Ee.parseEnum(i,ut),!0;case"vibrato":return e.vibrato=Ee.parseEnum(i,Dt),!0;case"istiedestination":return e.isTieDestination=i,!0;case"lefthandfinger":return e.leftHandFinger=Ee.parseEnum(i,at),!0;case"righthandfinger":return e.rightHandFinger=Ee.parseEnum(i,at),!0;case"isfingering":return e.isFingering=i,!0;case"trillvalue":return e.trillValue=i,!0;case"trillspeed":return e.trillSpeed=Ee.parseEnum(i,H),!0;case"durationpercent":return e.durationPercent=i,!0;case"accidentalmode":return e.accidentalMode=Ee.parseEnum(i,Or),!0;case"dynamics":return e.dynamics=Ee.parseEnum(i,yt),!0}return e.setProperty(r,i)}}class jC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){var i;if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("notes",e.notes.map(n=>GC.toJson(n))),r.set("isempty",e.isEmpty),r.set("whammystyle",e.whammyStyle),r.set("ottava",e.ottava),r.set("islegatoorigin",e.isLegatoOrigin),r.set("duration",e.duration),r.set("automations",e.automations.map(n=>ym.toJson(n))),r.set("dots",e.dots),r.set("fadein",e.fadeIn),r.set("lyrics",e.lyrics),r.set("hasrasgueado",e.hasRasgueado),r.set("pop",e.pop),r.set("slap",e.slap),r.set("tap",e.tap),r.set("text",e.text),r.set("brushtype",e.brushType),r.set("brushduration",e.brushDuration),r.set("tupletdenominator",e.tupletDenominator),r.set("tupletnumerator",e.tupletNumerator),r.set("iscontinuedwhammy",e.isContinuedWhammy),r.set("whammybartype",e.whammyBarType),e.whammyBarPoints!==null&&r.set("whammybarpoints",(i=e.whammyBarPoints)==null?void 0:i.map(n=>bm.toJson(n))),r.set("vibrato",e.vibrato),r.set("chordid",e.chordId),r.set("gracetype",e.graceType),r.set("pickstroke",e.pickStroke),r.set("tremolospeed",e.tremoloSpeed),r.set("crescendo",e.crescendo),r.set("displaystart",e.displayStart),r.set("playbackstart",e.playbackStart),r.set("displayduration",e.displayDuration),r.set("playbackduration",e.playbackDuration),r.set("dynamics",e.dynamics),r.set("invertbeamdirection",e.invertBeamDirection),r.set("preferredbeamdirection",e.preferredBeamDirection),r.set("beamingmode",e.beamingMode),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"notes":e.notes=[];for(const n of i){const s=new kr;GC.fromJson(s,n),e.addNote(s)}return!0;case"isempty":return e.isEmpty=i,!0;case"whammystyle":return e.whammyStyle=Ee.parseEnum(i,Gt),!0;case"ottava":return e.ottava=Ee.parseEnum(i,Ft),!0;case"islegatoorigin":return e.isLegatoOrigin=i,!0;case"duration":return e.duration=Ee.parseEnum(i,H),!0;case"automations":e.automations=[];for(const n of i){const s=new Ei;ym.fromJson(s,n),e.automations.push(s)}return!0;case"dots":return e.dots=i,!0;case"fadein":return e.fadeIn=i,!0;case"lyrics":return e.lyrics=i,!0;case"hasrasgueado":return e.hasRasgueado=i,!0;case"pop":return e.pop=i,!0;case"slap":return e.slap=i,!0;case"tap":return e.tap=i,!0;case"text":return e.text=i,!0;case"brushtype":return e.brushType=Ee.parseEnum(i,ir),!0;case"brushduration":return e.brushDuration=i,!0;case"tupletdenominator":return e.tupletDenominator=i,!0;case"tupletnumerator":return e.tupletNumerator=i,!0;case"iscontinuedwhammy":return e.isContinuedWhammy=i,!0;case"whammybartype":return e.whammyBarType=Ee.parseEnum(i,Lt),!0;case"whammybarpoints":if(i){e.whammyBarPoints=[];for(const n of i){const s=new Me;bm.fromJson(s,n),e.addWhammyBarPoint(s)}}return!0;case"vibrato":return e.vibrato=Ee.parseEnum(i,Dt),!0;case"chordid":return e.chordId=i,!0;case"gracetype":return e.graceType=Ee.parseEnum(i,Ze),!0;case"pickstroke":return e.pickStroke=Ee.parseEnum(i,Bi),!0;case"tremolospeed":return e.tremoloSpeed=Ee.parseEnum(i,H),!0;case"crescendo":return e.crescendo=Ee.parseEnum(i,pn),!0;case"displaystart":return e.displayStart=i,!0;case"playbackstart":return e.playbackStart=i,!0;case"displayduration":return e.displayDuration=i,!0;case"playbackduration":return e.playbackDuration=i,!0;case"dynamics":return e.dynamics=Ee.parseEnum(i,yt),!0;case"invertbeamdirection":return e.invertBeamDirection=i,!0;case"preferredbeamdirection":return e.preferredBeamDirection=Ee.parseEnum(i,we),!0;case"beamingmode":return e.beamingMode=Ee.parseEnum(i,js),!0}return!1}}class YC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("beats",e.beats.map(i=>jC.toJson(i))),r.set("isempty",e.isEmpty),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"beats":e.beats=[];for(const n of i){const s=new Mi;jC.fromJson(s,n),e.addBeat(s)}return!0;case"isempty":return e.isEmpty=i,!0}return!1}}class XC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("id",e.id),r.set("clef",e.clef),r.set("clefottava",e.clefOttava),r.set("voices",e.voices.map(i=>YC.toJson(i))),r.set("similemark",e.simileMark),r.set("displayscale",e.displayScale),r.set("displaywidth",e.displayWidth),r}static setProperty(e,r,i){switch(r){case"id":return e.id=i,!0;case"clef":return e.clef=Ee.parseEnum(i,ot),!0;case"clefottava":return e.clefOttava=Ee.parseEnum(i,Ft),!0;case"voices":e.voices=[];for(const n of i){const s=new Ba;YC.fromJson(s,n),e.addVoice(s)}return!0;case"similemark":return e.simileMark=Ee.parseEnum(i,qn),!0;case"displayscale":return e.displayScale=i,!0;case"displaywidth":return e.displayWidth=i,!0}return!1}}class qC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("name",e.name),r.set("firstfret",e.firstFret),r.set("strings",e.strings),r.set("barrefrets",e.barreFrets),r.set("showname",e.showName),r.set("showdiagram",e.showDiagram),r.set("showfingering",e.showFingering),r}static setProperty(e,r,i){switch(r){case"name":return e.name=i,!0;case"firstfret":return e.firstFret=i,!0;case"strings":return e.strings=i,!0;case"barrefrets":return e.barreFrets=i,!0;case"showname":return e.showName=i,!0;case"showdiagram":return e.showDiagram=i,!0;case"showfingering":return e.showFingering=i,!0}return!1}}class KC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("isstandard",e.isStandard),r.set("name",e.name),r.set("tunings",e.tunings),r}static setProperty(e,r,i){switch(r){case"isstandard":return e.isStandard=i,!0;case"name":return e.name=i,!0;case"tunings":return e.tunings=i,!0}return!1}}class QC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;if(r.set("bars",e.bars.map(i=>XC.toJson(i))),e.chords!==null){const i=new Map;r.set("chords",i);for(const[n,s]of e.chords)i.set(n.toString(),qC.toJson(s))}return r.set("capo",e.capo),r.set("transpositionpitch",e.transpositionPitch),r.set("displaytranspositionpitch",e.displayTranspositionPitch),r.set("stringtuning",KC.toJson(e.stringTuning)),r.set("showtablature",e.showTablature),r.set("showstandardnotation",e.showStandardNotation),r.set("ispercussion",e.isPercussion),r.set("standardnotationlinecount",e.standardNotationLineCount),r}static setProperty(e,r,i){switch(r){case"bars":e.bars=[];for(const n of i){const s=new ao;XC.fromJson(s,n),e.addBar(s)}return!0;case"chords":return e.chords=new Map,Ee.forEach(i,(n,s)=>{const a=new Ho;qC.fromJson(a,n),e.addChord(s,a)}),!0;case"capo":return e.capo=i,!0;case"transpositionpitch":return e.transpositionPitch=i,!0;case"displaytranspositionpitch":return e.displayTranspositionPitch=i,!0;case"showtablature":return e.showTablature=i,!0;case"showstandardnotation":return e.showStandardNotation=i,!0;case"ispercussion":return e.isPercussion=i,!0;case"standardnotationlinecount":return e.standardNotationLineCount=i,!0}return["stringtuning"].indexOf(r)>=0?(KC.fromJson(e.stringTuning,i),!0):!1}}class JC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("volume",e.volume),r.set("balance",e.balance),r.set("port",e.port),r.set("program",e.program),r.set("primarychannel",e.primaryChannel),r.set("secondarychannel",e.secondaryChannel),r.set("ismute",e.isMute),r.set("issolo",e.isSolo),r}static setProperty(e,r,i){switch(r){case"volume":return e.volume=i,!0;case"balance":return e.balance=i,!0;case"port":return e.port=i,!0;case"program":return e.program=i,!0;case"primarychannel":return e.primaryChannel=i,!0;case"secondarychannel":return e.secondaryChannel=i,!0;case"ismute":return e.isMute=i,!0;case"issolo":return e.isSolo=i,!0}return!1}}class ZC{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("elementtype",e.elementType),r.set("staffline",e.staffLine),r.set("noteheaddefault",e.noteHeadDefault),r.set("noteheadhalf",e.noteHeadHalf),r.set("noteheadwhole",e.noteHeadWhole),r.set("techniquesymbol",e.techniqueSymbol),r.set("techniquesymbolplacement",e.techniqueSymbolPlacement),r.set("outputmidinumber",e.outputMidiNumber),r}static setProperty(e,r,i){switch(r){case"elementtype":return e.elementType=i,!0;case"staffline":return e.staffLine=i,!0;case"noteheaddefault":return e.noteHeadDefault=Ee.parseEnum(i,B),!0;case"noteheadhalf":return e.noteHeadHalf=Ee.parseEnum(i,B),!0;case"noteheadwhole":return e.noteHeadWhole=Ee.parseEnum(i,B),!0;case"techniquesymbol":return e.techniqueSymbol=Ee.parseEnum(i,B),!0;case"techniquesymbolplacement":return e.techniqueSymbolPlacement=Ee.parseEnum(i,ft),!0;case"outputmidinumber":return e.outputMidiNumber=i,!0}return!1}}class eT{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("staves",e.staves.map(i=>QC.toJson(i))),r.set("playbackinfo",JC.toJson(e.playbackInfo)),r.set("color",Yt.toJson(e.color)),r.set("name",e.name),r.set("shortname",e.shortName),r.set("defaultsystemslayout",e.defaultSystemsLayout),r.set("systemslayout",e.systemsLayout),r.set("percussionarticulations",e.percussionArticulations.map(i=>ZC.toJson(i))),r}static setProperty(e,r,i){switch(r){case"staves":e.staves=[];for(const n of i){const s=new rM;QC.fromJson(s,n),e.addStaff(s)}return!0;case"color":return e.color=Yt.fromJson(i),!0;case"name":return e.name=i,!0;case"shortname":return e.shortName=i,!0;case"defaultsystemslayout":return e.defaultSystemsLayout=i,!0;case"systemslayout":return e.systemsLayout=i,!0;case"percussionarticulations":e.percussionArticulations=[];for(const n of i){const s=new Fe;ZC.fromJson(s,n),e.percussionArticulations.push(s)}return!0}return["playbackinfo"].indexOf(r)>=0?(JC.fromJson(e.playbackInfo,i),!0):!1}}class tT{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("hidedynamics",e.hideDynamics),r}static setProperty(e,r,i){switch(r){case"hidedynamics":return e.hideDynamics=i,!0}return!1}}class rT{static fromJson(e,r){r&&Ee.forEach(r,(i,n)=>this.setProperty(e,n,i))}static toJson(e){if(!e)return null;const r=new Map;return r.set("album",e.album),r.set("artist",e.artist),r.set("copyright",e.copyright),r.set("instructions",e.instructions),r.set("music",e.music),r.set("notices",e.notices),r.set("subtitle",e.subTitle),r.set("title",e.title),r.set("words",e.words),r.set("tab",e.tab),r.set("tempo",e.tempo),r.set("tempolabel",e.tempoLabel),r.set("masterbars",e.masterBars.map(i=>UC.toJson(i))),r.set("tracks",e.tracks.map(i=>eT.toJson(i))),r.set("defaultsystemslayout",e.defaultSystemsLayout),r.set("systemslayout",e.systemsLayout),r.set("stylesheet",tT.toJson(e.stylesheet)),r}static setProperty(e,r,i){switch(r){case"album":return e.album=i,!0;case"artist":return e.artist=i,!0;case"copyright":return e.copyright=i,!0;case"instructions":return e.instructions=i,!0;case"music":return e.music=i,!0;case"notices":return e.notices=i,!0;case"subtitle":return e.subTitle=i,!0;case"title":return e.title=i,!0;case"words":return e.words=i,!0;case"tab":return e.tab=i,!0;case"tempo":return e.tempo=i,!0;case"tempolabel":return e.tempoLabel=i,!0;case"masterbars":e.masterBars=[];for(const n of i){const s=new to;UC.fromJson(s,n),e.addMasterBar(s)}return!0;case"tracks":e.tracks=[];for(const n of i){const s=new _a;eT.fromJson(s,n),e.addTrack(s)}return!0;case"defaultsystemslayout":return e.defaultSystemsLayout=i,!0;case"systemslayout":return e.systemsLayout=i,!0}return["stylesheet"].indexOf(r)>=0?(tT.fromJson(e.stylesheet,i),!0):!1}}class Ar{static jsonReplacer(e,r){if(r instanceof Map){if("fromEntries"in Object)return Object.fromEntries(r);{const i={};for(const[n,s]of r)i[n]=s;return i}}else if(ArrayBuffer.isView(r))return Array.apply([],[r]);return r}static scoreToJson(e){let r=Ar.scoreToJsObject(e);return JSON.stringify(r,Ar.jsonReplacer)}static jsonToScore(e,r){return Ar.jsObjectToScore(JSON.parse(e),r)}static scoreToJsObject(e){return rT.toJson(e)}static jsObjectToScore(e,r){let i=new Ql;return rT.fromJson(i,e),i.finish(r??new Wl),i}static settingsToJson(e){let r=Ar.settingsToJsObject(e);return JSON.stringify(r,Ar.jsonReplacer)}static jsonToSettings(e){return Ar.jsObjectToSettings(JSON.parse(e))}static settingsToJsObject(e){return uu.toJson(e)}static jsObjectToSettings(e){let r=new Wl;return uu.fromJson(r,e),r}static jsObjectToMidiFile(e){let r=new Io;return Ee.forEach(e,(i,n)=>{switch(n){case"division":r.division=i;break;case"tracks":for(let s of i){let a=Ar.jsObjectToMidiTrack(s);r.tracks.push(a)}break}}),r}static jsObjectToMidiTrack(e){let r=new aM;return Ee.forEach(e,(i,n)=>{switch(n){case"events":for(let s of i){let a=Ar.jsObjectToMidiEvent(s);r.events.push(a)}break}}),r}static jsObjectToMidiEvent(e){let r=Ee.getValue(e,"track"),i=Ee.getValue(e,"tick"),n=Ee.getValue(e,"type");switch(n){case Bt.TimeSignature:return new oM(r,i,Ee.getValue(e,"numerator"),Ee.getValue(e,"denominatorIndex"),Ee.getValue(e,"midiClocksPerMetronomeClick"),Ee.getValue(e,"thirdySecondNodesInQuarter"));case Bt.AlphaTabRest:return new cM(r,i,Ee.getValue(e,"channel"));case Bt.AlphaTabMetronome:return new lM(r,i,Ee.getValue(e,"metronomeNumerator"),Ee.getValue(e,"metronomeDurationInTicks"),Ee.getValue(e,"metronomeDurationInMilliseconds"));case Bt.NoteOn:return new dM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"noteKey"),Ee.getValue(e,"noteVelocity"));case Bt.NoteOff:return new hM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"noteKey"),Ee.getValue(e,"noteVelocity"));case Bt.ControlChange:return new fM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"controller"),Ee.getValue(e,"value"));case Bt.ProgramChange:return new pM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"program"));case Bt.TempoChange:return new mM(i,Ee.getValue(e,"microSecondsPerQuarterNote"));case Bt.PitchBend:return new gM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"value"));case Bt.PerNotePitchBend:return new yM(r,i,Ee.getValue(e,"channel"),Ee.getValue(e,"noteKey"),Ee.getValue(e,"value"));case Bt.EndOfTrack:return new bM(r,i)}throw new gi(mi.Format,"Unknown Midi Event type: "+n)}static midiFileToJsObject(e){const r=new Map;r.set("division",e.division);const i=[];for(let n of e.tracks)i.push(Ar.midiTrackToJsObject(n));return r.set("tracks",i),r}static midiTrackToJsObject(e){const r=new Map,i=[];for(let n of e.events)i.push(Ar.midiEventToJsObject(n));return r.set("events",i),r}static midiEventToJsObject(e){const r=new Map;switch(r.set("track",e.track),r.set("tick",e.tick),r.set("type",e.type),e.type){case Bt.TimeSignature:r.set("numerator",e.numerator),r.set("denominatorIndex",e.denominatorIndex),r.set("midiClocksPerMetronomeClick",e.midiClocksPerMetronomeClick),r.set("thirdySecondNodesInQuarter",e.thirtySecondNodesInQuarter);break;case Bt.AlphaTabRest:r.set("channel",e.channel);break;case Bt.AlphaTabMetronome:r.set("metronomeNumerator",e.metronomeNumerator),r.set("metronomeDurationInMilliseconds",e.metronomeDurationInMilliseconds),r.set("metronomeDurationInTicks",e.metronomeDurationInTicks);break;case Bt.NoteOn:case Bt.NoteOff:r.set("channel",e.channel),r.set("noteKey",e.noteKey),r.set("noteVelocity",e.noteVelocity);break;case Bt.ControlChange:r.set("channel",e.channel),r.set("controller",e.controller),r.set("value",e.value);break;case Bt.ProgramChange:r.set("channel",e.channel),r.set("program",e.program);break;case Bt.TempoChange:r.set("microSecondsPerQuarterNote",e.microSecondsPerQuarterNote);break;case Bt.PitchBend:r.set("channel",e.channel),r.set("value",e.value);break;case Bt.PerNotePitchBend:r.set("channel",e.channel),r.set("noteKey",e.noteKey),r.set("value",e.value);break;case Bt.EndOfTrack:break}return r}}class pr{constructor(){this.ready=new li,this.samplesPlayed=new Nt,this.sampleRequest=new li}get sampleRate(){return pr.preferredSampleRate}open(){he.debug("AlphaSynth","Initializing synth worker"),this._worker=xe.globalThis,this._worker.addEventListener("message",this.handleMessage.bind(this)),this.ready.trigger()}destroy(){this._worker.postMessage({cmd:"alphaSynth.output.destroy"})}handleMessage(e){let r=e.data;switch(r.cmd){case pr.CmdOutputSampleRequest:this.sampleRequest.trigger();break;case pr.CmdOutputSamplesPlayed:this.samplesPlayed.trigger(r.samples);break}}addSamples(e){this._worker.postMessage({cmd:"alphaSynth.output.addSamples",samples:e})}play(){this._worker.postMessage({cmd:"alphaSynth.output.play"})}pause(){this._worker.postMessage({cmd:"alphaSynth.output.pause"})}resetSamples(){this._worker.postMessage({cmd:"alphaSynth.output.resetSamples"})}activate(){}}pr.CmdOutputPrefix="alphaSynth.output.";pr.CmdOutputAddSamples=pr.CmdOutputPrefix+"addSamples";pr.CmdOutputPlay=pr.CmdOutputPrefix+"play";pr.CmdOutputPause=pr.CmdOutputPrefix+"pause";pr.CmdOutputResetSamples=pr.CmdOutputPrefix+"resetSamples";pr.CmdOutputSampleRequest=pr.CmdOutputPrefix+"sampleRequest";pr.CmdOutputSamplesPlayed=pr.CmdOutputPrefix+"samplesPlayed";pr.preferredSampleRate=0;class AS{constructor(e,r){this._main=e,this._main.addEventListener("message",this.handleMessage.bind(this)),this._player=new QQ(new pr,r),this._player.positionChanged.on(this.onPositionChanged.bind(this)),this._player.stateChanged.on(this.onPlayerStateChanged.bind(this)),this._player.finished.on(this.onFinished.bind(this)),this._player.soundFontLoaded.on(this.onSoundFontLoaded.bind(this)),this._player.soundFontLoadFailed.on(this.onSoundFontLoadFailed.bind(this)),this._player.soundFontLoadFailed.on(this.onSoundFontLoadFailed.bind(this)),this._player.midiLoaded.on(this.onMidiLoaded.bind(this)),this._player.midiLoadFailed.on(this.onMidiLoadFailed.bind(this)),this._player.readyForPlayback.on(this.onReadyForPlayback.bind(this)),this._player.midiEventsPlayed.on(this.onMidiEventsPlayed.bind(this)),this._player.playbackRangeChanged.on(this.onPlaybackRangeChanged.bind(this)),this._main.postMessage({cmd:"alphaSynth.ready"})}static init(){let e=xe.globalThis;e.addEventListener("message",r=>{let i=r.data;switch(i.cmd){case"alphaSynth.initialize":pr.preferredSampleRate=i.sampleRate,he.logLevel=i.logLevel,xe.globalThis.alphaSynthWebWorker=new AS(e,i.bufferTimeInMilliseconds);break}})}handleMessage(e){let r=e.data;switch(r.cmd){case"alphaSynth.setLogLevel":he.logLevel=r.value;break;case"alphaSynth.setMasterVolume":this._player.masterVolume=r.value;break;case"alphaSynth.setMetronomeVolume":this._player.metronomeVolume=r.value;break;case"alphaSynth.setPlaybackSpeed":this._player.playbackSpeed=r.value;break;case"alphaSynth.setTickPosition":this._player.tickPosition=r.value;break;case"alphaSynth.setTimePosition":this._player.timePosition=r.value;break;case"alphaSynth.setPlaybackRange":this._player.playbackRange=r.value;break;case"alphaSynth.setIsLooping":this._player.isLooping=r.value;break;case"alphaSynth.setCountInVolume":this._player.countInVolume=r.value;break;case"alphaSynth.setMidiEventsPlayedFilter":this._player.midiEventsPlayedFilter=r.value;break;case"alphaSynth.play":this._player.play();break;case"alphaSynth.pause":this._player.pause();break;case"alphaSynth.playPause":this._player.playPause();break;case"alphaSynth.stop":this._player.stop();break;case"alphaSynth.playOneTimeMidiFile":this._player.playOneTimeMidiFile(Ar.jsObjectToMidiFile(r.midi));break;case"alphaSynth.loadSoundFontBytes":this._player.loadSoundFont(r.data,r.append);break;case"alphaSynth.resetSoundFonts":this._player.resetSoundFonts();break;case"alphaSynth.loadMidi":this._player.loadMidiFile(Ar.jsObjectToMidiFile(r.midi));break;case"alphaSynth.setChannelMute":this._player.setChannelMute(r.channel,r.mute);break;case"alphaSynth.setChannelSolo":this._player.setChannelSolo(r.channel,r.solo);break;case"alphaSynth.setChannelVolume":this._player.setChannelVolume(r.channel,r.volume);break;case"alphaSynth.resetChannelStates":this._player.resetChannelStates();break;case"alphaSynth.destroy":this._player.destroy(),this._main.postMessage({cmd:"alphaSynth.destroyed"});break;case"alphaSynth.applyTranspositionPitches":this._player.applyTranspositionPitches(new Map(JSON.parse(r.transpositionPitches)));break}}onPositionChanged(e){this._main.postMessage({cmd:"alphaSynth.positionChanged",currentTime:e.currentTime,endTime:e.endTime,currentTick:e.currentTick,endTick:e.endTick,isSeek:e.isSeek})}onPlayerStateChanged(e){this._main.postMessage({cmd:"alphaSynth.playerStateChanged",state:e.state,stopped:e.stopped})}onFinished(){this._main.postMessage({cmd:"alphaSynth.finished"})}onSoundFontLoaded(){this._main.postMessage({cmd:"alphaSynth.soundFontLoaded"})}onSoundFontLoadFailed(e){this._main.postMessage({cmd:"alphaSynth.soundFontLoadFailed",error:this.serializeException(e)})}serializeException(e){let r=JSON.parse(JSON.stringify(e));return e.message&&(r.message=e.message),e.stack&&(r.stack=e.stack),e.constructor&&e.constructor.name&&(r.type=e.constructor.name),r}onMidiLoaded(e){this._main.postMessage({cmd:"alphaSynth.midiLoaded",currentTime:e.currentTime,endTime:e.endTime,currentTick:e.currentTick,endTick:e.endTick,isSeek:e.isSeek})}onMidiLoadFailed(e){this._main.postMessage({cmd:"alphaSynth.midiLoaded",error:this.serializeException(e)})}onReadyForPlayback(){this._main.postMessage({cmd:"alphaSynth.readyForPlayback"})}onMidiEventsPlayed(e){this._main.postMessage({cmd:"alphaSynth.midiEventsPlayed",events:e.events.map(Ar.midiEventToJsObject)})}onPlaybackRangeChanged(e){this._main.postMessage({cmd:"alphaSynth.playbackRangeChanged",playbackRange:e.playbackRange})}}class Vr{static generateFontLookup(e){if(!Vr.FontSizeLookupTables.has(e))if(xe.isRunningInWorker)Vr.FontSizeLookupTables.set(e,new Uint8Array([8]));else{let i=document.createElement("canvas").getContext("2d");i.font=`11px ${e}`;let n=[];for(let a=32;a<255;a++){let o=String.fromCharCode(a);n.push(i.measureText(o).width)}let s=new Uint8Array(n);Vr.FontSizeLookupTables.set(e,s)}}static measureString(e,r,i,n,s){let a,o=11,l=r[0];for(let d=0;d=0&&(u+=a[h]*i/o)}return u*c}}Vr.Georgia=new Uint8Array([3,4,5,7,7,9,8,2,4,4,5,7,3,4,3,5,7,5,6,6,6,6,6,6,7,6,3,3,7,7,7,5,10,7,7,7,8,7,7,8,9,4,6,8,7,10,8,8,7,8,8,6,7,8,7,11,8,7,7,4,5,4,7,7,6,6,6,5,6,5,4,6,6,3,3,6,3,10,6,6,6,6,5,5,4,6,5,8,6,5,5,5,4,5,7,6,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,3,4,6,7,6,7,4,6,6,10,6,6,7,0,10,7,5,7,6,6,6,6,6,3,6,6,6,6,12,12,12,5,7,7,7,7,7,7,11,7,7,7,7,7,4,4,4,4,8,8,8,8,8,8,8,7,8,8,8,8,8,7,7,6,6,6,6,6,6,6,8,5,5,5,5,5,3,3,3,3,6,6,6,6,6,6,6,7,6,6,6,6,6,5,6]);Vr.Arial=new Uint8Array([3,3,4,6,6,10,7,2,4,4,4,6,3,4,3,3,6,6,6,6,6,6,6,6,6,6,3,3,6,6,6,6,11,7,7,8,8,7,7,9,8,3,6,7,6,9,8,9,7,9,8,7,7,8,7,10,7,7,7,3,3,3,5,6,4,6,6,6,6,6,3,6,6,2,2,6,2,9,6,6,6,6,4,6,3,6,6,8,6,6,6,4,3,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,6,6,6,6,3,6,4,8,4,6,6,0,8,6,4,6,4,4,4,6,6,4,4,4,4,6,9,9,9,7,7,7,7,7,7,7,11,8,7,7,7,7,3,3,3,3,8,8,9,9,9,9,9,6,9,8,8,8,8,7,7,7,6,6,6,6,6,6,10,6,6,6,6,6,3,3,3,3,6,6,6,6,6,6,6,6,7,6,6,6,6,6,6]);Vr.FontSizeLookupTables=new Map([["Arial",Vr.Arial],["'Arial'",Vr.Arial],['"Arial"',Vr.Arial],["Georgia",Vr.Georgia],["'Georgia'",Vr.Georgia],['"Georgia"',Vr.Georgia]]);Vr.ControlChars=32;class kl{constructor(){this.id=er.newGuid(),this.x=0,this.y=0,this.width=0,this.height=0,this.totalWidth=0,this.totalHeight=0,this.firstMasterBarIndex=-1,this.lastMasterBarIndex=-1,this.renderResult=null}}class xM{constructor(){this.beats=[]}addBeat(e){e.barBounds=this,this.beats.push(e),this.masterBarBounds.addBeat(e)}findBeatAtPos(e){let r=null;for(let i of this.beats)if(!r||i.realBounds.xe)break;return r}finish(){this.beats.sort((e,r)=>e.realBounds.x-r.realBounds.x)}}class kM{constructor(){this.notes=null}addNote(e){this.notes||(this.notes=[]),e.beatBounds=this,this.notes.push(e)}findNoteAtPos(e,r){const i=this.notes;if(!i)return null;for(let n of i){let s=n.noteHeadBounds.y+n.noteHeadBounds.h,a=n.noteHeadBounds.x+n.noteHeadBounds.w;if(n.noteHeadBounds.x<=e&&n.noteHeadBounds.y<=r&&e<=a&&r<=s)return n.note}return null}}class CM{constructor(){this.index=0,this.isFirstOfLine=!1,this.bars=[],this.staveGroupBounds=null}addBar(e){e.masterBarBounds=this,this.bars.push(e)}findBeatAtPos(e,r){let i=null,n=1e7;for(let s of this.bars){let a=s.findBeatAtPos(e);if(a&&(!i||i.realBounds.xe.realBounds.yr.realBounds.y?1:e.realBounds.xr.realBounds.x?1:0);for(const e of this.bars)e.finish()}addBeat(e){this.staveGroupBounds.boundsLookup.addBeat(e)}}class VS{}class TM{constructor(){this.index=0,this.bars=[]}finish(){for(let e of this.bars)e.finish()}addBar(e){this.boundsLookup.addMasterBar(e),e.staveGroupBounds=this,this.bars.push(e)}findBarAtPos(e){let r=null;for(let i of this.bars)if(!r||i.realBounds.xi.realBounds.x+i.realBounds.w)break;return r}}class Sh{constructor(){this._beatLookup=new Map,this._masterBarLookup=new Map,this._currentStaveGroup=null,this.staveGroups=[],this.isFinished=!1}toJson(){let e={},r=[];e.staveGroups=r;for(let i of this.staveGroups){let n={};n.visualBounds=this.boundsToJson(i.visualBounds),n.realBounds=this.boundsToJson(i.realBounds),n.bars=[];for(let s of i.bars){let a={};a.lineAlignedBounds=this.boundsToJson(s.lineAlignedBounds),a.visualBounds=this.boundsToJson(s.visualBounds),a.realBounds=this.boundsToJson(s.realBounds),a.index=s.index,a.bars=[];for(let o of s.bars){let l={};l.visualBounds=this.boundsToJson(o.visualBounds),l.realBounds=this.boundsToJson(o.realBounds),l.beats=[];for(let c of o.beats){let u={};u.visualBounds=this.boundsToJson(c.visualBounds),u.realBounds=this.boundsToJson(c.realBounds);let d=u;if(d.beatIndex=c.beat.index,d.voiceIndex=c.beat.voice.index,d.barIndex=c.beat.voice.bar.index,d.staffIndex=c.beat.voice.bar.staff.index,d.trackIndex=c.beat.voice.bar.staff.track.index,c.notes){let h=u.notes=[];for(let p of c.notes){let f={},m=f;m.index=p.note.index,f.noteHeadBounds=this.boundsToJson(p.noteHeadBounds),h.push(f)}}l.beats.push(u)}a.bars.push(l)}n.bars.push(a)}r.push(n)}return e}static fromJson(e,r){let i=new Sh,n=e.staveGroups;for(let s of n){let a=new TM;a.visualBounds=s.visualBounds,a.realBounds=s.realBounds,i.addStaveGroup(a);for(let o of s.bars){let l=new CM;l.index=o.index,l.isFirstOfLine=o.isFirstOfLine,l.lineAlignedBounds=o.lineAlignedBounds,l.visualBounds=o.visualBounds,l.realBounds=o.realBounds,a.addBar(l);for(let c of o.bars){let u=new xM;u.visualBounds=c.visualBounds,u.realBounds=c.realBounds,l.addBar(u);for(let d of c.beats){let h=new kM;h.visualBounds=d.visualBounds,h.realBounds=d.realBounds;let p=d;if(h.beat=r.tracks[p.trackIndex].staves[p.staffIndex].bars[p.barIndex].voices[p.voiceIndex].beats[p.beatIndex],d.notes){h.notes=[];for(let f of d.notes){let m=new VS,y=f;m.note=h.beat.notes[y.index],m.noteHeadBounds=f.noteHeadBounds,h.addNote(m)}}u.addBeat(h)}}}}return i}boundsToJson(e){let r={};return r.x=e.x,r.y=e.y,r.w=e.w,r.h=e.h,r}finish(){for(let e of this.staveGroups)e.finish();this.isFinished=!0}addStaveGroup(e){e.index=this.staveGroups.length,e.boundsLookup=this,this.staveGroups.push(e),this._currentStaveGroup=e}addMasterBar(e){e.staveGroupBounds?this._masterBarLookup.set(e.index,e):(e.staveGroupBounds=this._currentStaveGroup,this._masterBarLookup.set(e.index,e),this._currentStaveGroup.addBar(e))}addBeat(e){var r;this._beatLookup.has(e.beat.id)||this._beatLookup.set(e.beat.id,[]),(r=this._beatLookup.get(e.beat.id))==null||r.push(e)}findMasterBarByIndex(e){return this._masterBarLookup.has(e)?this._masterBarLookup.get(e):null}findMasterBar(e){let r=e.index;return this._masterBarLookup.has(r)?this._masterBarLookup.get(r):null}findBeat(e){const r=this.findBeats(e);return r?r[0]:null}findBeats(e){let r=e.id;return this._beatLookup.has(r)?this._beatLookup.get(r):null}getBeatAtPos(e,r){let i=0,n=this.staveGroups.length-1,s=-1;for(;i<=n;){let l=(n+i)/2|0,c=this.staveGroups[l];if(r>=c.realBounds.y&&r<=c.realBounds.y+c.realBounds.h){s=l;break}r=0&&n0&&i.push(e.tracks[0])}this.tracks=i,this.render()}catch(i){this.error.trigger(i)}}renderTracks(e){e.length===0?this.score=null:this.score=e[0].score,this.tracks=e,this.render()}updateSettings(e){this.settings=e}renderResult(e){try{const r=this.layout;r?(he.debug("Rendering","Request render of lazy partial "+e),r.renderLazyPartial(e)):he.warning("Rendering","Request render of lazy partial "+e+" ignored, no layout exists")}catch(r){this.error.trigger(r)}}render(){if(this.width===0){he.warning("Rendering","AlphaTab skipped rendering because of width=0 (element invisible)",null);return}if(this.boundsLookup=new Sh,this.recreateCanvas(),this.canvas.lineWidth=this.settings.display.scale,this.canvas.settings=this.settings,!this.tracks||this.tracks.length===0||!this.score)he.debug("Rendering","Clearing rendered tracks because no score or tracks are set"),this.preRender.trigger(!1),this._renderedTracks=null,this.onRenderFinished(),this.postRenderFinished.trigger(),he.debug("Rendering","Clearing finished");else{he.debug("Rendering","Rendering "+this.tracks.length+" tracks");for(let e=0;e{this._main.postMessage({cmd:"alphaTab.partialRenderFinished",result:a})}),this._renderer.partialLayoutFinished.on(a=>{this._main.postMessage({cmd:"alphaTab.partialLayoutFinished",result:a})}),this._renderer.renderFinished.on(a=>{this._main.postMessage({cmd:"alphaTab.renderFinished",result:a})}),this._renderer.postRenderFinished.on(()=>{var a;this._main.postMessage({cmd:"alphaTab.postRenderFinished",boundsLookup:((a=this._renderer.boundsLookup)==null?void 0:a.toJson())??null})}),this._renderer.preRender.on(a=>{this._main.postMessage({cmd:"alphaTab.preRender",resize:a})}),this._renderer.error.on(this.error.bind(this));break;case"alphaTab.invalidate":this._renderer.render();break;case"alphaTab.resizeRender":this._renderer.resizeRender();break;case"alphaTab.renderResult":this._renderer.renderResult(r.resultId);break;case"alphaTab.setWidth":this._renderer.width=r.width;break;case"alphaTab.renderScore":this.updateFontSizes(r.fontSizes);let s=r.score==null?null:Ar.jsObjectToScore(r.score,this._renderer.settings);this.renderMultiple(s,r.trackIndexes);break;case"alphaTab.updateSettings":this.updateSettings(r.settings);break}}updateFontSizes(e){if(e){Vr.FontSizeLookupTables||(Vr.FontSizeLookupTables=new Map);for(let r in e)Vr.FontSizeLookupTables.set(r,e[r])}}updateSettings(e){uu.fromJson(this._renderer.settings,e)}renderMultiple(e,r){try{this._renderer.renderScore(e,r)}catch(i){this.error(i)}}error(e){he.error("Worker","An unexpected error occurred in worker",e),this._main.postMessage({cmd:"alphaTab.error",error:e})}}class nJ{constructor(){this._canvas=null,this._color=new Yt(0,0,0,255),this._font=new Mt("Arial",10,vr.Plain),this._lineWidth=0;let e=document.createElement("span");e.classList.add("at"),document.body.appendChild(e);let r=window.getComputedStyle(e),i=r.fontFamily;(i.startsWith('"')||i.startsWith("'"))&&(i=i.substr(1,i.length-2)),this._musicFont=new Mt(i,parseFloat(r.fontSize),vr.Plain),this._measureCanvas=document.createElement("canvas"),this._measureCanvas.width=10,this._measureCanvas.height=10,this._measureCanvas.style.width="10px",this._measureCanvas.style.height="10px",this._measureContext=this._measureCanvas.getContext("2d"),this._measureContext.textBaseline="hanging"}destroy(){}onRenderFinished(){return null}beginRender(e,r){this._canvas=document.createElement("canvas"),this._canvas.width=e*xe.HighDpiFactor|0,this._canvas.height=r*xe.HighDpiFactor|0,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px",this._context=this._canvas.getContext("2d"),this._context.textBaseline="hanging",this._context.scale(xe.HighDpiFactor,xe.HighDpiFactor),this._context.lineWidth=this._lineWidth}endRender(){let e=this._canvas;return this._canvas=null,e}get color(){return this._color}set color(e){this._color.rgba!==e.rgba&&(this._color=e,this._context.strokeStyle=e.rgba,this._context.fillStyle=e.rgba)}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this._context&&(this._context.lineWidth=e)}fillRect(e,r,i,n){i>0&&this._context.fillRect(e|0,r|0,i,n)}strokeRect(e,r,i,n){this._context.strokeRect(e|0,r|0,i,n)}beginPath(){this._context.beginPath()}closePath(){this._context.closePath()}moveTo(e,r){this._context.moveTo(e,r)}lineTo(e,r){this._context.lineTo(e,r)}quadraticCurveTo(e,r,i,n){this._context.quadraticCurveTo(e,r,i,n)}bezierCurveTo(e,r,i,n,s,a){this._context.bezierCurveTo(e,r,i,n,s,a)}fillCircle(e,r,i){this._context.beginPath(),this._context.arc(e,r,i,0,Math.PI*2,!0),this.fill()}strokeCircle(e,r,i){this._context.beginPath(),this._context.arc(e,r,i,0,Math.PI*2,!0),this.stroke()}fill(){this._context.fill(),this._context.beginPath()}stroke(){this._context.stroke(),this._context.beginPath()}get font(){return this._font}set font(e){this._font=e,this._context&&(this._context.font=e.toCssString(this.settings.display.scale)),this._measureContext.font=e.toCssString(this.settings.display.scale)}get textAlign(){switch(this._context.textAlign){case"left":return Je.Left;case"center":return Je.Center;case"right":return Je.Right;default:return Je.Left}}set textAlign(e){switch(e){case Je.Left:this._context.textAlign="left";break;case Je.Center:this._context.textAlign="center";break;case Je.Right:this._context.textAlign="right";break}}get textBaseline(){switch(this._context.textBaseline){case"hanging":return ft.Top;case"middle":return ft.Middle;case"bottom":return ft.Bottom;default:return ft.Top}}set textBaseline(e){switch(e){case ft.Top:this._context.textBaseline="hanging";break;case ft.Middle:this._context.textBaseline="middle";break;case ft.Bottom:this._context.textBaseline="bottom";break}}beginGroup(e){}endGroup(){}fillText(e,r,i){this._context.fillText(e,r,i)}measureText(e){return this._measureContext.measureText(e).width}fillMusicFontSymbol(e,r,i,n,s=!1){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,String.fromCharCode(n),s)}fillMusicFontSymbols(e,r,i,n,s=!1){let a="";for(let o of n)o!==B.None&&(a+=String.fromCharCode(o));this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s=!1){let a=this._context.textAlign,o=this._context.textBaseline,l=this._context.font;this._context.font=this._musicFont.toCssString(i),this._context.textBaseline="middle",s?this._context.textAlign="center":this._context.textAlign="left",this._context.fillText(n,e,r),this._context.textBaseline=o,this._context.font=l,this._context.textAlign=a}beginRotate(e,r,i){this._context.save(),this._context.translate(e,r),this._context.rotate(i*Math.PI/180)}endRotate(){this._context.restore()}}class ma{constructor(e,r=!1){this._midiFile=e,this._smf1Mode=r}addTimeSignature(e,r,i){let n=0,s=i;for(;s=s>>1,s>0;)n++;this._midiFile.addEvent(new oM(0,e,r,n,48,8))}addRest(e,r,i){this._smf1Mode||this._midiFile.addEvent(new cM(e,r,i))}addNote(e,r,i,n,s,a){this._midiFile.addEvent(new dM(e,r,a,ma.fixValue(n),ma.fixValue(s))),this._midiFile.addEvent(new hM(e,r+i,a,ma.fixValue(n),ma.fixValue(s)))}static fixValue(e){return e>127?127:e<0?0:e}addControlChange(e,r,i,n,s){this._midiFile.addEvent(new fM(e,r,i,n,ma.fixValue(s)))}addProgramChange(e,r,i,n){this._midiFile.addEvent(new pM(e,r,i,n))}addTempo(e,r){const i=6e7/r|0;this._midiFile.addEvent(new mM(e,i))}addBend(e,r,i,n){n>=ht.MaxPitchWheel?n=ht.MaxPitchWheel:n=Math.floor(n),this._midiFile.addEvent(new gM(e,r,i,n))}addNoteBend(e,r,i,n,s){this._smf1Mode?this.addBend(e,r,i,s):(s=s*ht.MaxPitchWheel20/ht.MaxPitchWheel,this._midiFile.addEvent(new yM(e,r,i,n,s)))}finishTrack(e,r){(this._midiFile.format==cu.MultiTrack||e==0)&&this._midiFile.addEvent(new bM(e,r))}}class sJ{constructor(e,r){this.closingIndex=0,this.group=e,this.opening=r,e.closings=e.closings.sort((i,n)=>i.index-n.index),this.iterations=e.closings.map(i=>0)}}class aJ{get finished(){return this.index>=this._score.masterBars.length}constructor(e){this._repeatStack=[],this._groupsOnStack=new Set,this._previousAlternateEndings=0,this.shouldPlay=!0,this.index=0,this.currentTick=0,this._score=e}processCurrent(){const e=this._score.masterBars[this.index];let r=e.alternateEndings;if(r===0&&(r=this._previousAlternateEndings),e===e.repeatGroup.opening&&e.repeatGroup.isClosed&&!this._groupsOnStack.has(e.repeatGroup)){const i=new sJ(e.repeatGroup,e);this._repeatStack.push(i),this._groupsOnStack.add(e.repeatGroup),this._previousAlternateEndings=0,r=e.alternateEndings}if(this._repeatStack.length===0||r===0)this.shouldPlay=!0;else{const i=this._repeatStack[this._repeatStack.length-1],n=i.iterations[i.closingIndex];this._previousAlternateEndings=r,r&1<0&&r>0){const i=this._repeatStack[this._repeatStack.length-1];if(i.iterations[i.closingIndex]=this.lastBeat.end){const a=new ns(this.lastBeat.end,s);a.highlightBeat(e,r),this.insertAfter(this.lastBeat,a)}else{let a=null;if(i=o.start&&ia.start)if(s==a.end){const o=new ns(a.start,i);for(const l of a.highlightedBeats)o.highlightBeat(l.beat,l.playbackStart);a.start=i,a.highlightBeat(e,r),this.insertBefore(a,o)}else if(s=r.start&&i=r.nextBeat.start&&ii?s=r.masterBar:r.masterBar.nextMasterBar&&r.masterBar.nextMasterBar.start<=i&&r.masterBar.nextMasterBar.end>i&&(s=r.masterBar.nextMasterBar)),s||(s=this.findMasterBar(i)),!s)return null;for(;s;){if(s.firstBeat){let a=this.findBeatInMasterBar(s,s.firstBeat,i,e,!0,n);if(a)return a}s=s.nextMasterBar}return null}findBeatInMasterBar(e,r,i,n,s,a){if(!r)return null;let o=null,l=null;const c=i-e.start;for(;r!=null&&l==null;){if(r.start<=c&&cc)break;r=(r==null?void 0:r.nextBeat)??null}return l==null?null:this.createResult(e,o,l,s,n)}createResult(e,r,i,n,s){const a=new lJ(e);return a.beat=i,a.beatLookup=r,a.tickDuration=r.end-r.start,n&&this.fillNextBeat(a,s),a.duration=lt.ticksToMillis(a.tickDuration,e.tempo),a}findMasterBar(e){const r=this.masterBars;let i=0,n=r.length-1;for(;i<=n;){const s=(n+i)/2|0,a=r[s];if(e>=a.start&&es){const l=i+r;n.addBeat(e,r,0,l)}}else n.addBeat(e,r,r,i)}}class uJ{constructor(){this.noteOnly=0,this.untilTieOrSlideEnd=0,this.letRingEnd=0}}class dJ{constructor(){this.firstBeatDuration=0,this.secondBeatStartOffset=0,this.secondBeatDuration=0}}class Vt{constructor(e,r,i){this._currentTempo=0,this._programsPerChannel=new Map,this.tickLookup=new cJ,this.applyTranspositionPitches=!0,this.transpositionPitches=new Map,this._currentTripletFeel=null,this.vibratoResolution=16,this._score=e,this._settings=r||new Wl,this._currentTempo=this._score.tempo,this._handler=i}generate(){this.transpositionPitches.clear();for(const i of this._score.tracks)this.generateTrack(i);he.debug("Midi","Begin midi generation");const e=new aJ(this._score);let r=null;for(;!e.finished;){const i=e.index,n=this._score.masterBars[i],s=e.currentTick;if(e.processCurrent(),e.shouldPlay){this.generateMasterBar(n,r,s);for(const a of this._score.tracks)for(const o of a.staves)i{this._handler.addBend(e.voice.bar.staff.track.index,c,a.playbackInfo.secondaryChannel,u)})}}static calculateTripletFeelInfo(e,r,i){let n;switch(i.voice.bar.masterBar.tripletFeel){case gt.Triplet8th:case gt.Dotted8th:case gt.Scottish8th:n=H.Eighth;break;case gt.Triplet16th:case gt.Dotted16th:case gt.Scottish16th:n=H.Sixteenth;break;default:return null}const s=lt.toTicks(n);if(r!==s||e%s!==0||!i.nextBeat||i.nextBeat.voice!==i.voice||i.playbackDuration!==s)return null;const a=new dJ;switch(i.voice.bar.masterBar.tripletFeel){case gt.Triplet8th:a.firstBeatDuration=lt.applyTuplet(lt.toTicks(H.Quarter),3,2),a.secondBeatDuration=lt.applyTuplet(lt.toTicks(H.Eighth),3,2);break;case gt.Dotted8th:a.firstBeatDuration=lt.applyDot(lt.toTicks(H.Eighth),!1),a.secondBeatDuration=lt.toTicks(H.Sixteenth);break;case gt.Scottish8th:a.firstBeatDuration=lt.toTicks(H.Sixteenth),a.secondBeatDuration=lt.applyDot(lt.toTicks(H.Eighth),!1);break;case gt.Triplet16th:a.firstBeatDuration=lt.applyTuplet(lt.toTicks(H.Eighth),3,2),a.secondBeatDuration=lt.applyTuplet(lt.toTicks(H.Sixteenth),3,2);break;case gt.Dotted16th:a.firstBeatDuration=lt.applyDot(lt.toTicks(H.Sixteenth),!1),a.secondBeatDuration=lt.toTicks(H.ThirtySecond);break;case gt.Scottish16th:a.firstBeatDuration=lt.toTicks(H.ThirtySecond),a.secondBeatDuration=lt.applyDot(lt.toTicks(H.Sixteenth),!1);break}return a.secondBeatStartOffset=r-a.firstBeatDuration,a}generateNote(e,r,i,n){const s=e.beat.voice.bar.staff.track,a=e.beat.voice.bar.staff;let o=e.calculateRealValue(this.applyTranspositionPitches,!0);if(e.isPercussion){const f=ki.getArticulation(e);f&&(o=f.outputMidiNumber)}const l=e.isStringed&&e.string<=n.length?n[e.string-1]:0,c=r+l,u=this.getNoteDuration(e,i);u.untilTieOrSlideEnd-=l,u.noteOnly-=l,u.letRingEnd-=l;const d=Vt.getNoteVelocity(e),h=e.hasBend||e.beat.hasWhammyBar||e.beat.vibrato!==Dt.None?s.playbackInfo.secondaryChannel:s.playbackInfo.primaryChannel;let p=0;if(e.hasBend?p=Vt.getPitchWheel(e.bendPoints[0].value):e.beat.hasWhammyBar?p=Vt.getPitchWheel(e.beat.whammyBarPoints[0].value):e.isTieDestination||e.slideOrigin&&e.slideOrigin.slideOutType===ut.Legato?p=-1:p=Vt.getPitchWheel(0),p>=0&&this._handler.addNoteBend(s.index,c,h,o,p),e.beat.fadeIn&&this.generateFadeIn(e,c,u),e.isTrill&&!a.isPercussion){this.generateTrill(e,c,u,o,d,h);return}if(e.beat.isTremolo){this.generateTremoloPicking(e,c,u,o,d,h);return}if(e.hasBend?this.generateBend(e,c,u,o,h):e.beat.hasWhammyBar&&e.index===0?this.generateWhammy(e.beat,c,u,h):e.slideInType!==pi.None||e.slideOutType!==ut.None?this.generateSlide(e,c,u,o,h):(e.vibrato!==Dt.None||e.isTieDestination&&e.tieOrigin.vibrato!==Dt.None)&&this.generateVibrato(e,c,u,o,h),!e.isTieDestination&&(!e.slideOrigin||e.slideOrigin.slideOutType!==ut.Legato)){let f=Math.max(u.untilTieOrSlideEnd,u.letRingEnd);this._handler.addNote(s.index,c,f,o,d,h)}}getNoteDuration(e,r){const i=new uJ;if(i.noteOnly=r,i.untilTieOrSlideEnd=r,i.letRingEnd=r,e.isDead)return i.noteOnly=this.applyStaticDuration(Vt.DefaultDurationDead,r),i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isPalmMute)return i.noteOnly=this.applyStaticDuration(Vt.DefaultDurationPalmMute,r),i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isStaccato)return i.noteOnly=r/2|0,i.untilTieOrSlideEnd=i.noteOnly,i.letRingEnd=i.noteOnly,i;if(e.isTieOrigin){const n=e.tieDestination;if(n)if(e.isTieDestination){const s=this.getNoteDuration(n,n.beat.playbackDuration);i.untilTieOrSlideEnd=r+s.untilTieOrSlideEnd}else{const s=e.beat.absolutePlaybackStart,a=this.getNoteDuration(n,n.beat.playbackDuration),o=n.beat.absolutePlaybackStart+a.untilTieOrSlideEnd;i.untilTieOrSlideEnd=o-s}}else if(e.slideOutType===ut.Legato){const n=e.slideTarget;if(n){const s=e.beat.absolutePlaybackStart,a=this.getNoteDuration(n,n.beat.playbackDuration),o=n.beat.absolutePlaybackStart+a.untilTieOrSlideEnd;i.untilTieOrSlideEnd=o-s}}if(e.isLetRing&&this._settings.notation.notationMode===ai.GuitarPro){let n=e.beat,s=0;const a=e.beat.voice.bar.masterBar.calculateDuration();for(;n.nextBeat;){let o=n.nextBeat;if(o.isRest||e.isStringed&&o.hasNoteOnString(e.string))break;if(n=n.nextBeat,s=n.absolutePlaybackStart-e.beat.absolutePlaybackStart+n.playbackDuration,s>a){s=a;break}}n===e.beat?i.letRingEnd=r:i.letRingEnd=s}else i.letRingEnd=i.untilTieOrSlideEnd;return i}applyStaticDuration(e,r){const i=this._currentTempo*e/Me.MaxPosition|0;return Math.min(i,r)}static getNoteVelocity(e){let r=e.dynamics;switch(!e.beat.voice.bar.staff.isPercussion&&e.hammerPullOrigin&&r--,e.isGhost&&r--,e.accentuated){case Yr.Normal:r++;break;case Yr.Heavy:r+=2;break}return lt.dynamicToVelocity(r)}generateFadeIn(e,r,i){const n=e.beat.voice.bar.staff.track,a=Vt.toChannelShort(n.playbackInfo.volume)/i.noteOnly,o=120,l=i.noteOnly/o|0,c=r+i.noteOnly;for(let u=l-1;u>=0;u--){const d=c-u*o,h=(d-r)*a;u===l-1&&(this._handler.addControlChange(n.index,r,n.playbackInfo.primaryChannel,jt.VolumeCoarse,h),this._handler.addControlChange(n.index,r,n.playbackInfo.secondaryChannel,jt.VolumeCoarse,h)),this._handler.addControlChange(n.index,d,n.playbackInfo.primaryChannel,jt.VolumeCoarse,h),this._handler.addControlChange(n.index,d,n.playbackInfo.secondaryChannel,jt.VolumeCoarse,h)}}generateVibrato(e,r,i,n,s){let a=0,o=0;switch(e.vibrato!==Dt.None?e.vibrato:e.isTieDestination?e.tieOrigin.vibrato:Dt.Slight){case Dt.Slight:a=this._settings.player.vibrato.noteSlightLength,o=this._settings.player.vibrato.noteSlightAmplitude;break;case Dt.Wide:a=this._settings.player.vibrato.noteWideLength,o=this._settings.player.vibrato.noteWideAmplitude;break;default:return}const c=e.beat.voice.bar.staff.track;this.generateVibratorWithParams(r,i.noteOnly,a,o,(u,d)=>{this._handler.addNoteBend(c.index,u,s,n,d)})}generateVibratorWithParams(e,r,i,n,s){const a=this.vibratoResolution,o=i/2|0;e+=i;const l=e+r;for(;e{this._handler.addNoteBend(l.index,h,s,n,p)})}generateBend(e,r,i,n,s){let a=e.bendPoints,o=e.beat.voice.bar.staff.track;const l=(p,f)=>{this._handler.addNoteBend(o.index,p,s,n,f)};let c=null,u;if(e.isTieOrigin&&this._settings.notation.extendBendArrowsOnTiedNotes){let p=e;for(;p.isTieOrigin&&!p.tieDestination.hasBend;)p=p.tieDestination;u=p.beat.absolutePlaybackStart-e.beat.absolutePlaybackStart+this.getNoteDuration(p,p.beat.playbackDuration).noteOnly}else if(e.isTieOrigin&&e.beat.graceType!==Ze.None){switch(e.tieDestination.bendType){case We.Bend:case We.BendRelease:case We.PrebendBend:c=e.tieDestination.bendPoints[1].value;break;case We.Prebend:case We.PrebendRelease:c=e.tieDestination.bendPoints[0].value;break}u=Math.max(i.noteOnly,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo))}else u=i.noteOnly;a[0].value>0&&!e.isContinuedBend&&r>0&&r--;const d=Math.min(u,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));let h=[];switch(e.bendType){case We.Custom:h=a;break;case We.Bend:case We.Release:switch(e.bendStyle){case Gt.Default:h=a;break;case Gt.Gradual:h.push(new Me(0,e.bendPoints[0].value)),(!c||c0&&!e.isContinuedWhammy&&r--;const l=(u,d)=>{this._handler.addBend(a.index,u,n,d)};let c=[];switch(e.whammyBarType){case Lt.Custom:c=s;break;case Lt.Dive:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Me(0,s[0].value)),c.push(new Me(Me.MaxPosition,s[1].value));break;case Gt.Fast:const u=Math.min(o,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!1,[s[0].value,s[1].value],u,l);return}break;case Lt.Dip:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Me(0,s[0].value)),c.push(new Me(Me.MaxPosition/2|0,s[1].value)),c.push(new Me(Me.MaxPosition,s[2].value));break;case Gt.Fast:const u=Math.min(o,lt.millisToTicks(this._settings.player.songBookDipDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!0,[s[0].value,s[1].value,s[2].value],u,l);return}break;case Lt.Hold:c=s;break;case Lt.Predive:c=s;break;case Lt.PrediveDive:switch(e.whammyStyle){case Gt.Default:c=s;break;case Gt.Gradual:c.push(new Me(0,s[0].value)),c.push(new Me(Me.MaxPosition/2|0,s[0].value)),c.push(new Me(Me.MaxPosition,s[1].value));break;case Gt.Fast:const u=Vt.getPitchWheel(s[0].value);this._handler.addBend(a.index,r,n,u|0);const d=Math.min(o,lt.millisToTicks(this._settings.player.songBookBendDuration,this._currentTempo));this.generateSongBookWhammyOrBend(r,o,!1,[s[0].value,s[1].value],d,l);return}break}this.generateWhammyOrBend(r,o,c,l)}generateWhammyOrBend(e,r,i,n){const s=r/Me.MaxPosition;for(let a=0;a=h&&(c=h-d),this._handler.addNote(o.index,d,c,u?l:n,s,a),u=!u,d+=c}generateTremoloPicking(e,r,i,n,s,a){const o=e.beat.voice.bar.staff.track;let l=lt.toTicks(e.beat.tremoloSpeed),c=r;const u=r+i.untilTieOrSlideEnd;for(;c+10=u&&(l=u-c),this._handler.addNote(o.index,c,l,n,s,a),c+=l}getBrushInfo(e){const r=new Int32Array(e.voice.bar.staff.tuning.length);if(e.brushType!==ir.None){let i=0,n=0;for(const s of e.notes)s.isTieDestination||(i|=1<0){let s=0;const a=e.brushDuration/(n-1)|0;for(let o=0;o=0;)this.createTies(this.beat.notes[e--]);this.renderer.registerTies(this.ties),this.updateWidth()}updateWidth(){if(this.minWidth=this.preNotes.width+this.onNotes.width,!this.beat.isRest)if(this.onNotes.beamingHelper.beats.length===1)this.beat.duration>=H.Eighth&&(this.minWidth+=20*this.scale);else switch(this.beat.duration){case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:this.minWidth+=10*this.scale;break}let e=0;for(let r of this.ties)r.width>e&&(e=r.width);this.minWidth+=e,this.width=this.minWidth}scaleToWidth(e){this.onNotes.updateBeamingHelper(),this.width=e}createTies(e){}static getGroupId(e){return"b"+e.id}paint(e,r,i){if(this.beat.voice.isEmpty||this.preNotes.isEmpty&&this.onNotes.isEmpty&&this.ties.length===0)return;i.beginGroup(Ys.getGroupId(this.beat)),this.preNotes.paint(e+this.x,r+this.y,i),this.onNotes.paint(e+this.x,r+this.y,i);let s=e-this.voiceContainer.x-this.renderer.x,a=r-this.voiceContainer.y-this.renderer.y;for(let o=0,l=this.ties.length;o{this._isDestroyed||this.container.width!==this.renderer.width&&this.triggerResize()},e.resizeThrottle));let i=new iT;i.oldWidth=this.renderer.width,i.newWidth=this.container.width|0,i.settings=this.settings,this.onResize(i),this.renderer.preRender.on(this.onRenderStarted.bind(this)),this.renderer.renderFinished.on(n=>{this.onRenderFinished(n)}),this.renderer.postRenderFinished.on(()=>{let n=Date.now()-this._startTime;he.debug("rendering","Rendering completed in "+n+"ms"),this.onPostRenderFinished()}),this.renderer.preRender.on(n=>{this._startTime=Date.now()}),this.renderer.partialLayoutFinished.on(this.appendRenderResult.bind(this)),this.renderer.partialRenderFinished.on(this.updateRenderResult.bind(this)),this.renderer.renderFinished.on(n=>{this.appendRenderResult(n),this.appendRenderResult(null)}),this.renderer.error.on(this.onError.bind(this)),this.settings.player.enablePlayer&&this.setupPlayer(),this.setupClickHandling(),this.uiFacade.beginInvoke(()=>{this.uiFacade.initialRender()})}destroy(){this._isDestroyed=!0,this.player&&this.player.destroy(),this.uiFacade.destroy(),this.renderer.destroy()}updateSettings(){var r;const e=this.score;e&&er.applyPitchOffsets(this.settings,e),this.renderer.updateSettings(this.settings),this.settings.player.enablePlayer?(this.setupPlayer(),e&&((r=this.player)==null||r.applyTranspositionPitches(Vt.buildTranspositionPitches(e,this.settings)))):this.destroyPlayer(),this.onSettingsUpdated()}load(e,r){try{return this.uiFacade.load(e,i=>{this.renderScore(i,r)},i=>{this.onError(i)})}catch(i){return this.onError(i),!1}}renderScore(e,r){let i=[];if(!r)e.tracks.length>0&&i.push(e.tracks[0]);else if(r.length===0)e.tracks.length>0&&i.push(e.tracks[0]);else if(r.length===1&&r[0]===-1)for(let n of e.tracks)i.push(n);else for(let n of r)n>=0&&n<=e.tracks.length&&i.push(e.tracks[n]);this.internalRenderTracks(e,i)}renderTracks(e){if(e.length>0){let r=e[0].score;for(let i of e)if(i.score!==r){this.onError(new gi(mi.General,"All rendered tracks must belong to the same score."));return}this.internalRenderTracks(r,e)}}internalRenderTracks(e,r){if(er.applyPitchOffsets(this.settings,e),e!==this.score){this.score=e,this.tracks=r,this._trackIndexes=[];for(let i of r)this._trackIndexes.push(i.index);this._trackIndexLookup=new Set(this._trackIndexes),this.onScoreLoaded(e),this.loadMidiForScore(),this.render()}else{this.tracks=r,this._trackIndexes=[];for(let i of r)this._trackIndexes.push(i.index);this._trackIndexLookup=new Set(this._trackIndexes),this.render()}}triggerResize(){if(!this.container.isVisible)he.warning("Rendering","AlphaTab container was invisible while autosizing, waiting for element to become visible",null),this.uiFacade.rootContainerBecameVisible.on(()=>{he.debug("Rendering","AlphaTab container became visible, doing autosizing",null),this.triggerResize()});else{let e=new iT;e.oldWidth=this.renderer.width,e.newWidth=this.container.width,e.settings=this.settings,this.onResize(e),this.renderer.updateSettings(this.settings),this.renderer.width=this.container.width,this.renderer.resizeRender()}}appendRenderResult(e){e?(this.canvasElement.width=e.totalWidth,this.canvasElement.height=e.totalHeight,this._cursorWrapper&&(this._cursorWrapper.width=e.totalWidth,this._cursorWrapper.height=e.totalHeight),(e.width>0||e.height>0)&&this.uiFacade.beginAppendRenderResults(e)):this.uiFacade.beginAppendRenderResults(e)}updateRenderResult(e){e&&e.renderResult&&this.uiFacade.beginUpdateRenderResults(e)}tex(e,r){try{let i=new Wi;i.logErrors=!0,i.initFromString(e,this.settings);let n=i.readScore();this.renderScore(n,r)}catch(i){this.onError(i)}}loadSoundFont(e,r=!1){return this.player?this.uiFacade.loadSoundFont(e,r):!1}resetSoundFonts(){this.player&&this.player.resetSoundFonts()}render(){this.renderer&&(this.uiFacade.canRender?(this.renderer.width=this.container.width,this.renderer.renderScore(this.score,this._trackIndexes)):this.uiFacade.canRenderChanged.on(()=>this.render()))}get tickCache(){return this._tickCache}get isReadyForPlayback(){return this.player?this.player.isReadyForPlayback:!1}get playerState(){return this.player?this.player.state:ri.Paused}get masterVolume(){return this.player?this.player.masterVolume:0}set masterVolume(e){this.player&&(this.player.masterVolume=e)}get metronomeVolume(){return this.player?this.player.metronomeVolume:0}set metronomeVolume(e){this.player&&(this.player.metronomeVolume=e)}get countInVolume(){return this.player?this.player.countInVolume:0}set countInVolume(e){this.player&&(this.player.countInVolume=e)}get midiEventsPlayedFilter(){return this.player?this.player.midiEventsPlayedFilter:[]}set midiEventsPlayedFilter(e){this.player&&(this.player.midiEventsPlayedFilter=e)}get tickPosition(){return this.player?this.player.tickPosition:0}set tickPosition(e){this.player&&(this.player.tickPosition=e)}get timePosition(){return this.player?this.player.timePosition:0}set timePosition(e){this.player&&(this.player.timePosition=e)}get playbackRange(){return this.player?this.player.playbackRange:null}set playbackRange(e){this.player&&(this.player.playbackRange=e,this.settings.player.enableCursor&&this.updateSelectionCursor(e))}get playbackSpeed(){return this.player?this.player.playbackSpeed:0}set playbackSpeed(e){this.player&&(this.player.playbackSpeed=e)}get isLooping(){return this.player?this.player.isLooping:!1}set isLooping(e){this.player&&(this.player.isLooping=e)}destroyPlayer(){this.player&&(this.player.destroy(),this.player=null,this._previousTick=0,this._playerState=ri.Paused,this.destroyCursors())}setupPlayer(){this.updateCursors(),!this.player&&(this.player=this.uiFacade.createWorkerPlayer(),this.player&&(this.player.ready.on(()=>{this.loadMidiForScore()}),this.player.readyForPlayback.on(()=>{if(this.onPlayerReady(),this.tracks)for(let e of this.tracks){let r=e.playbackInfo.volume/16;this.player.setChannelVolume(e.playbackInfo.primaryChannel,r),this.player.setChannelVolume(e.playbackInfo.secondaryChannel,r)}}),this.player.soundFontLoaded.on(this.onSoundFontLoaded.bind(this)),this.player.soundFontLoadFailed.on(e=>{this.onError(e)}),this.player.midiLoaded.on(this.onMidiLoaded.bind(this)),this.player.midiLoadFailed.on(e=>{this.onError(e)}),this.player.stateChanged.on(this.onPlayerStateChanged.bind(this)),this.player.positionChanged.on(this.onPlayerPositionChanged.bind(this)),this.player.midiEventsPlayed.on(this.onMidiEventsPlayed.bind(this)),this.player.playbackRangeChanged.on(this.onPlaybackRangeChanged.bind(this)),this.player.finished.on(this.onPlayerFinished.bind(this)),this.setupPlayerEvents()))}loadMidiForScore(){if(!this.player||!this.score||!this.player.isReady)return;he.debug("AlphaTab","Generating Midi");let e=new Io,r=new ma(e),i=new Vt(this.score,this.settings,r);i.applyTranspositionPitches=!1,i.generate(),this._tickCache=i.tickLookup,this.onMidiLoad(e),this.player.loadMidiFile(e),this.player.applyTranspositionPitches(i.transpositionPitches)}changeTrackVolume(e,r){if(this.player)for(let i of e)this.player.setChannelVolume(i.playbackInfo.primaryChannel,r),this.player.setChannelVolume(i.playbackInfo.secondaryChannel,r)}changeTrackSolo(e,r){if(this.player)for(let i of e)this.player.setChannelSolo(i.playbackInfo.primaryChannel,r),this.player.setChannelSolo(i.playbackInfo.secondaryChannel,r)}changeTrackMute(e,r){if(this.player)for(let i of e)this.player.setChannelMute(i.playbackInfo.primaryChannel,r),this.player.setChannelMute(i.playbackInfo.secondaryChannel,r)}play(){return this.player?this.player.play():!1}pause(){this.player&&this.player.pause()}playPause(){this.player&&this.player.playPause()}stop(){this.player&&this.player.stop()}playBeat(e){if(!this.player)return;let r=new Io,i=new ma(r);new Vt(e.voice.bar.staff.track.score,this.settings,i).generateSingleBeat(e),this.player.playOneTimeMidiFile(r)}playNote(e){if(!this.player)return;let r=new Io,i=new ma(r);new Vt(e.beat.voice.bar.staff.track.score,this.settings,i).generateSingleNote(e),this.player.playOneTimeMidiFile(r)}destroyCursors(){this._cursorWrapper&&(this.uiFacade.destroyCursors(),this._cursorWrapper=null,this._barCursor=null,this._beatCursor=null,this._selectionWrapper=null)}updateCursors(){if(this.settings.player.enableCursor&&!this._cursorWrapper){let e=this.uiFacade.createCursors();e&&(this._cursorWrapper=e.cursorWrapper,this._barCursor=e.barCursor,this._beatCursor=e.beatCursor,this._selectionWrapper=e.selectionWrapper),this._currentBeat!==null&&this.cursorUpdateBeat(this._currentBeat,!1,this._previousTick>10,!0)}else!this.settings.player.enableCursor&&this._cursorWrapper&&this.destroyCursors()}setupPlayerEvents(){this._previousTick=0,this._playerState=ri.Paused,this.renderer.postRenderFinished.on(()=>{this._currentBeat=null,this.cursorUpdateTick(this._previousTick,!1,this._previousTick>10)}),this.player&&(this.player.positionChanged.on(e=>{this._previousTick=e.currentTick,this.uiFacade.beginInvoke(()=>{this.cursorUpdateTick(e.currentTick,!1)})}),this.player.stateChanged.on(e=>{if(this._playerState=e.state,!e.stopped&&e.state===ri.Paused){let r=this._currentBeat,i=this._tickCache;r&&i&&(this.player.tickPosition=i.getBeatStart(r.beat))}}))}cursorUpdateTick(e,r,i=!1){let n=this._tickCache;if(n){let s=this._trackIndexLookup;if(s!=null&&s.size>0){let a=n.findBeat(s,e,this._currentBeat);a&&this.cursorUpdateBeat(a,r,i)}}}cursorUpdateBeat(e,r,i,n=!1){var f;const s=e.beat,a=((f=e.nextBeat)==null?void 0:f.beat)??null,o=e.duration,l=e.beatLookup.highlightedBeats;if(!s)return;let c=this.renderer.boundsLookup;if(!c)return;let u=this._currentBeat,d=this._previousCursorCache,h=this._previousStateForCursor;if(!n&&s===(u==null?void 0:u.beat)&&c===d&&h===this._playerState)return;let p=c.findBeat(s);p&&(this._currentBeat=e,this._previousCursorCache=c,this._previousStateForCursor=this._playerState,this.uiFacade.beginInvoke(()=>{this.internalCursorUpdateBeat(s,a,o,r,l,c,p,i)}))}scrollToCursor(){const e=this._currentBarBounds;e&&this.internalScrollToCursor(e)}internalScrollToCursor(e){let r=this.uiFacade.getScrollContainer(),i=xe.getLayoutEngineFactory(this.settings.display.layoutMode).vertical,n=this.settings.player.scrollMode;if(i){let s=e.realBounds.y+this.settings.player.scrollOffsetY;if(s!==this._lastScroll)switch(this._lastScroll=s,n){case Oa.Continuous:let a=this.uiFacade.getOffset(r,this.container);this.uiFacade.scrollToY(r,a.y+s,this.settings.player.scrollSpeed);break;case Oa.OffScreen:let o=r.scrollTop+this.uiFacade.getOffset(null,r).h;if(e.visualBounds.y+e.visualBounds.h>=o||e.visualBounds.y=o||e.visualBounds.x{u&&u.transitionToX(i/this.playbackSpeed,f)})}l=!n,p=!0}l&&!this._beatMouseDown&&this.settings.player.scrollMode!==Oa.Off&&this.internalScrollToCursor(d),p&&(this.onPlayedBeatChanged(e),this.onActiveBeatsChanged(new fJ(s.map(f=>f.beat))))}onPlayedBeatChanged(e){this._isDestroyed||(this.playedBeatChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playedBeatChanged",e))}onActiveBeatsChanged(e){this._isDestroyed||(this.activeBeatsChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"activeBeatsChanged",e))}onBeatMouseDown(e,r){this._isDestroyed||(this.settings.player.enablePlayer&&this.settings.player.enableCursor&&this.settings.player.enableUserInteraction&&(this._selectionStart=new $f(r),this._selectionEnd=null),this._beatMouseDown=!0,this.beatMouseDown.trigger(r),this.uiFacade.triggerEvent(this.container,"beatMouseDown",r,e))}onNoteMouseDown(e,r){this._isDestroyed||(this._noteMouseDown=!0,this.noteMouseDown.trigger(r),this.uiFacade.triggerEvent(this.container,"noteMouseDown",r,e))}onBeatMouseMove(e,r){this._isDestroyed||(this.settings.player.enableUserInteraction&&(!this._selectionEnd||this._selectionEnd.beat!==r)&&(this._selectionEnd=new $f(r),this.cursorSelectRange(this._selectionStart,this._selectionEnd)),this.beatMouseMove.trigger(r),this.uiFacade.triggerEvent(this.container,"beatMouseMove",r,e))}onNoteMouseMove(e,r){this._isDestroyed||(this.noteMouseMove.trigger(r),this.uiFacade.triggerEvent(this.container,"noteMouseMove",r,e))}onBeatMouseUp(e,r){var i,n;if(!this._isDestroyed){if(this.settings.player.enablePlayer&&this.settings.player.enableCursor&&this.settings.player.enableUserInteraction){if(this._selectionEnd){let s=((i=this._tickCache)==null?void 0:i.getBeatStart(this._selectionStart.beat))??this._selectionStart.beat.absolutePlaybackStart;if((((n=this._tickCache)==null?void 0:n.getBeatStart(this._selectionEnd.beat))??this._selectionEnd.beat.absolutePlaybackStart){var s,a;if(!e.isLeftMouseButton)return;this.settings.player.enableUserInteraction&&e.preventDefault();let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(n&&(this.onBeatMouseDown(e,n),this.settings.core.includeNoteBounds)){const o=(a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i);o&&this.onNoteMouseDown(e,o)}}),this.canvasElement.mouseMove.on(e=>{var s,a;if(!this._beatMouseDown)return;let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(n&&(this.onBeatMouseMove(e,n),this._noteMouseDown)){const o=(a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i);o&&this.onNoteMouseMove(e,o)}}),this.canvasElement.mouseUp.on(e=>{var s,a;if(!this._beatMouseDown)return;this.settings.player.enableUserInteraction&&e.preventDefault();let r=e.getX(this.canvasElement),i=e.getY(this.canvasElement),n=((s=this.renderer.boundsLookup)==null?void 0:s.getBeatAtPos(r,i))??null;if(this.onBeatMouseUp(e,n),this._noteMouseDown)if(n){const o=((a=this.renderer.boundsLookup)==null?void 0:a.getNoteAtPos(n,r,i))??null;this.onNoteMouseUp(e,o)}else this.onNoteMouseUp(e,null)}),this.renderer.postRenderFinished.on(()=>{!this._selectionStart||!this.settings.player.enablePlayer||!this.settings.player.enableCursor||!this.settings.player.enableUserInteraction||this.cursorSelectRange(this._selectionStart,this._selectionEnd)})}cursorSelectRange(e,r){var c,u;let i=this.renderer.boundsLookup;if(!i)return;let n=this._selectionWrapper;if(!n||(n.clear(),!e||!r||e.beat===r.beat))return;e.bounds||(e.bounds=i.findBeat(e.beat)),r.bounds||(r.bounds=i.findBeat(r.beat));let s=((c=this._tickCache)==null?void 0:c.getBeatStart(e.beat))??e.beat.absolutePlaybackStart;if((((u=this._tickCache)==null?void 0:u.getBeatStart(r.beat))??r.beat.absolutePlaybackStart)0&&(this.playerPositionChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playerPositionChanged",e))}onMidiEventsPlayed(e){this._isDestroyed||(this.midiEventsPlayed.trigger(e),this.uiFacade.triggerEvent(this.container,"midiEventsPlayed",e))}onPlaybackRangeChanged(e){this._isDestroyed||(this.playbackRangeChanged.trigger(e),this.uiFacade.triggerEvent(this.container,"playbackRangeChanged",e))}onSettingsUpdated(){this._isDestroyed||(this.settingsUpdated.trigger(),this.uiFacade.triggerEvent(this.container,"settingsUpdated",null))}}class Ma extends gi{constructor(e,r){super(mi.General,e),this.xhr=r,Object.setPrototypeOf(this,Ma.prototype)}}class Dc{static loadScoreAsync(e,r,i,n){let s=new XMLHttpRequest;s.open("GET",e,!0,null,null),s.responseType="arraybuffer",s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){let a=s.response;if(s.status===200||s.status===0&&a)try{let o=s.response,l=new Uint8Array(o),c=Dc.loadScoreFromBytes(l,n);r(c)}catch(o){i(o)}else s.status===0?i(new Ma(`You are offline!! Please Check Your Network.`,s)):s.status===404?i(new Ma("Requested URL not found.",s)):s.status===500?i(new Ma("Internel Server Error.",s)):s.statusText==="parsererror"?i(new Ma(`Error. -Parsing JSON Request failed.`,s)):s.statusText==="timeout"?i(new Ma("Request Time out.",s)):i(new Ma("Unknow Error: "+s.responseText,s))}},s.send()}static loadScoreFromBytes(e,r){r||(r=new Wl);let i=Se.buildImporters();de.debug("ScoreLoader",`Loading score from ${e.length} bytes using ${i.length} importers`);let n=null,s=Di.fromBuffer(e);for(let a of i){s.reset();try{de.debug("ScoreLoader","Importing using importer "+a.name),a.init(s,r),n=a.readScore(),de.debug("ScoreLoader","Score imported using "+a.name);break}catch(o){if(o instanceof Gr)de.debug("ScoreLoader",a.name+" does not support the file");else throw de.error("ScoreLoader","Score import failed due to unexpected error: ",o),o}}if(n)return n;throw new Gr("No compatible importer found for file")}}class vb{get isLeftMouseButton(){return this.mouseEvent.button===0}getX(e){let r=e.element,n=r.getBoundingClientRect().left+r.ownerDocument.defaultView.pageXOffset;return this.mouseEvent.pageX-n}getY(e){let r=e.element,n=r.getBoundingClientRect().top+r.ownerDocument.defaultView.pageYOffset;return this.mouseEvent.pageY-n}preventDefault(){this.mouseEvent.preventDefault()}constructor(e){this.mouseEvent=e}}class ga{get width(){return this.element.offsetWidth}set width(e){this.element.style.width=e+"px"}get scrollLeft(){return this.element.scrollLeft}set scrollLeft(e){this.element.scrollTop=e}get scrollTop(){return this.element.scrollLeft}set scrollTop(e){this.element.scrollTop=e}get height(){return this.element.offsetHeight}set height(e){e>=0?this.element.style.height=e+"px":this.element.style.height="100%"}get isVisible(){return!!this.element.offsetWidth||!!this.element.offsetHeight||!!this.element.getClientRects().length}constructor(e){this._resizeListeners=0,this.lastBounds=new dn,this.element=e,this.mouseDown={on:r=>{this.element.addEventListener("mousedown",i=>{r(new vb(i))},!0)},off:r=>{}},this.mouseUp={on:r=>{this.element.addEventListener("mouseup",i=>{r(new vb(i))},!0)},off:r=>{}},this.mouseMove={on:r=>{this.element.addEventListener("mousemove",i=>{r(new vb(i))},!0)},off:r=>{}},this.resize={on:r=>{this._resizeListeners===0&&ga.resizeObserver.value.observe(this.element),this.element.addEventListener("resize",r,!0),this._resizeListeners++},off:r=>{this.element.removeEventListener("resize",r,!0),this._resizeListeners--,this._resizeListeners<=0&&(this._resizeListeners=0,ga.resizeObserver.value.unobserve(this.element))}}}stopAnimation(){this.element.style.transition="none"}transitionToX(e,r){this.element.style.transition=`transform ${e}ms linear`,this.setBounds(r,NaN,NaN,NaN)}setBounds(e,r,i,n){isNaN(e)&&(e=this.lastBounds.x),isNaN(r)&&(r=this.lastBounds.y),isNaN(i)&&(i=this.lastBounds.w),isNaN(n)&&(n=this.lastBounds.h),this.element.style.transform=`translate(${e}px, ${r}px) scale(${i}, ${n})`,this.element.style.transformOrigin="top left",this.lastBounds.x=e,this.lastBounds.y=r,this.lastBounds.w=i,this.lastBounds.h=n}appendChild(e){this.element.appendChild(e.element)}clear(){this.element.innerHTML=""}}ga.resizeObserver=new KR(()=>new ResizeObserver(t=>{for(const e of t){let r=new CustomEvent("resize",{detail:e});e.target.dispatchEvent(r)}}));class _M{constructor(e){this._isStarted=!1,this.isFontLoaded=!1,this.fontLoaded=new Nt,this._originalFamilies=e,this._families=e}checkForFontAvailability(){if(Se.isRunningInWorker){this.isFontLoaded=!1;return}if(this._isStarted)return;this._isStarted=!0;let e=0,r=window.setInterval(()=>{de.warning("Rendering",`Could not load font '${this._families[0]}' within ${(e+1)*5} seconds`,null),this._families.length>1?(this._families.shift(),e=0):e++},5e3);de.debug("Font",`Start checking for font availablility: ${this._families.join(", ")}`);let i=a=>{this._families.length>1?(de.debug("Font",`[${this._families[0]}] Loading Failed, switching to ${this._families[1]}`,a),this._families.shift(),window.setTimeout(()=>{s()},0)):(de.error("Font",`[${this._originalFamilies.join(",")}] Loading Failed, rendering cannot start`,a),window.clearInterval(r))},n=a=>{de.debug("Font",`[${a}] Font API signaled available`),this.isFontLoaded=!0,window.clearInterval(r),this.fontLoaded.trigger(this._families[0])},s=async()=>{for(const a of this._families)if(await this.isFontAvailable(a,!1)){n(a);return}try{await document.fonts.load(`1em ${this._families[0]}`)}catch(a){i(a)}return de.debug("Font",`[${this._families[0]}] Font API signaled loaded`),await this.isFontAvailable(this._families[0],!0)?n(this._families[0]):i("Font not available"),!0};document.fonts.ready.then(()=>{s()})}isFontAvailable(e,r){return new Promise(i=>{const n="1em "+e;if(document.fonts.check(n))i(!0);else if(r){de.debug("Font",`Font ${e} not available, creating test element to trigger load`);const s=document.createElement("div");s.style.font=n,s.style.opacity="0",s.style.position="absolute",s.style.top="0",s.style.left="0",s.innerText=`Trigger ${e} load`,document.body.appendChild(s),setTimeout(()=>{document.body.removeChild(s),document.fonts.check(n)?i(!0):i(!1)},200)}else i(!1)})}}class BM{constructor(e){this._writePosition=0,this._readPosition=0,this.count=0,this._buffer=new Float32Array(e)}clear(){this._readPosition=0,this._writePosition=0,this.count=0,this._buffer=new Float32Array(this._buffer.length)}write(e,r,i){let n=0;i>this._buffer.length-this.count&&(i=this._buffer.length-this.count);const s=Math.min(this._buffer.length-this._writePosition,i);return this._buffer.set(e.subarray(r,r+s),this._writePosition),this._writePosition+=s,this._writePosition%=this._buffer.length,n+=s,nthis.count&&(i=this.count);let n=0;const s=Math.min(this._buffer.length-this._readPosition,i);return e.set(this._buffer.subarray(this._readPosition,this._readPosition+s),r),n+=s,this._readPosition+=s,this._readPosition%=this._buffer.length,n{var r,i;de.debug("WebAudio",`Audio Context resume success: state=${(r=this._context)==null?void 0:r.state}, sampleRate:${(i=this._context)==null?void 0:i.sampleRate}`),e&&e()},r=>{var i,n;de.warning("WebAudio",`Audio Context resume failed: state=${(i=this._context)==null?void 0:i.state}, sampleRate:${(n=this._context)==null?void 0:n.sampleRate}, reason=${r}`)}))}patchIosSampleRate(){let e=navigator.userAgent;if(e.indexOf("iPhone")!==-1||e.indexOf("iPad")!==-1){let r=this.createAudioContext(),i=r.createBuffer(1,1,ms.PreferredSampleRate),n=r.createBufferSource();n.buffer=i,n.connect(r.destination),n.start(0),n.disconnect(0),r.close()}}createAudioContext(){if("AudioContext"in Se.globalThis)return new AudioContext;if("webkitAudioContext"in Se.globalThis)return new webkitAudioContext;throw new gi(mi.General,"AudioContext not found")}open(e){this.patchIosSampleRate(),this._context=this.createAudioContext(),this._context.state==="suspended"&&this.registerResumeHandler()}registerResumeHandler(){this._resumeHandler=(()=>{this.activate(()=>{this.unregisterResumeHandler()})}).bind(this),document.body.addEventListener("touchend",this._resumeHandler,!1),document.body.addEventListener("click",this._resumeHandler,!1)}unregisterResumeHandler(){const e=this._resumeHandler;e&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1))}play(){let e=this._context;this.activate(),this._buffer=e.createBuffer(2,ms.BufferSize,e.sampleRate),this._source=e.createBufferSource(),this._source.buffer=this._buffer,this._source.loop=!0}pause(){this._source&&(this._source.stop(0),this._source.disconnect()),this._source=null}destroy(){var e;this.pause(),(e=this._context)==null||e.close(),this._context=null,this.unregisterResumeHandler()}onSamplesPlayed(e){this.samplesPlayed.trigger(e)}onSampleRequest(){this.sampleRequest.trigger()}onReady(){this.ready.trigger()}}ms.BufferSize=4096;ms.PreferredSampleRate=44100;class fJ extends ms{constructor(){super(...arguments),this._audioNode=null,this._bufferCount=0,this._requestedBufferCount=0,this._outputBuffer=new Float32Array(0)}open(e){super.open(e),this._bufferCount=Math.floor(e*this.sampleRate/1e3/ms.BufferSize),this._circularBuffer=new BM(ms.BufferSize*this._bufferCount),this.onReady()}play(){super.play();let e=this._context;this._audioNode=e.createScriptProcessor(4096,0,2),this._audioNode.onaudioprocess=this.generateSound.bind(this),this._circularBuffer.clear(),this.requestBuffers(),this._source=e.createBufferSource(),this._source.buffer=this._buffer,this._source.loop=!0,this._source.connect(this._audioNode,0,0),this._source.start(0),this._audioNode.connect(e.destination,0,0)}pause(){super.pause(),this._audioNode&&this._audioNode.disconnect(0),this._audioNode=null}addSamples(e){this._circularBuffer.write(e,0,e.length),this._requestedBufferCount--}resetSamples(){this._circularBuffer.clear()}requestBuffers(){const e=this._bufferCount/2|0;let r=e*ms.BufferSize;if(this._circularBuffer.count+this._requestedBufferCount*ms.BufferSize{let a=new Uint8Array(n.response);this.loadSoundFont(a,r)},n.onerror=s=>{de.error("AlphaSynth","Loading failed: "+s.message),this.soundFontLoadFailed.trigger(new Ma(s.message,n))},n.onprogress=s=>{de.debug("AlphaSynth",`Soundfont downloading: ${s.loaded}/${s.total} bytes`),i(new pJ(s.loaded,s.total))},n.send()}resetSoundFonts(){this._synth.postMessage({cmd:"alphaSynth.resetSoundFonts"})}loadMidiFile(e){this._synth.postMessage({cmd:"alphaSynth.loadMidi",midi:Ar.midiFileToJsObject(e)})}applyTranspositionPitches(e){this._synth.postMessage({cmd:"alphaSynth.applyTranspositionPitches",transpositionPitches:JSON.stringify(Array.from(e.entries()))})}setChannelMute(e,r){this._synth.postMessage({cmd:"alphaSynth.setChannelMute",channel:e,mute:r})}resetChannelStates(){this._synth.postMessage({cmd:"alphaSynth.resetChannelStates"})}setChannelSolo(e,r){this._synth.postMessage({cmd:"alphaSynth.setChannelSolo",channel:e,solo:r})}setChannelVolume(e,r){r=Math.max(r,ht.MinVolume),this._synth.postMessage({cmd:"alphaSynth.setChannelVolume",channel:e,volume:r})}handleWorkerMessage(e){let r=e.data;switch(r.cmd){case"alphaSynth.ready":this._workerIsReady=!0,this.checkReady();break;case"alphaSynth.destroyed":this._synth.terminate();break;case"alphaSynth.readyForPlayback":this._workerIsReadyForPlayback=!0,this.checkReadyForPlayback();break;case"alphaSynth.positionChanged":this._timePosition=r.currentTime,this._tickPosition=r.currentTick,this.positionChanged.trigger(new gm(r.currentTime,r.endTime,r.currentTick,r.endTick,r.isSeek));break;case"alphaSynth.midiEventsPlayed":this.midiEventsPlayed.trigger(new bM(r.events.map(Ar.jsObjectToMidiEvent)));break;case"alphaSynth.playerStateChanged":this._state=r.state,this.stateChanged.trigger(new wp(r.state,r.stopped));break;case"alphaSynth.playbackRangeChanged":this._playbackRange=r.playbackRange,this.playbackRangeChanged.trigger(new vM(this._playbackRange));break;case"alphaSynth.finished":this.finished.trigger();break;case"alphaSynth.soundFontLoaded":this.soundFontLoaded.trigger();break;case"alphaSynth.soundFontLoadFailed":this.soundFontLoadFailed.trigger(r.error);break;case"alphaSynth.midiLoaded":this.checkReadyForPlayback(),this.midiLoaded.trigger(new gm(r.currentTime,r.endTime,r.currentTick,r.endTick,r.isSeek));break;case"alphaSynth.midiLoadFailed":this.checkReadyForPlayback(),this.midiLoadFailed.trigger(r.error);break;case"alphaSynth.output.addSamples":this._output.addSamples(r.samples);break;case"alphaSynth.output.play":this._output.play();break;case"alphaSynth.output.pause":this._output.pause();break;case"alphaSynth.output.destroy":this._output.destroy();break;case"alphaSynth.output.resetSamples":this._output.resetSamples();break}}checkReady(){this.isReady&&this.ready.trigger()}checkReadyForPlayback(){this.isReadyForPlayback&&this.readyForPlayback.trigger()}onOutputSampleRequest(){this._synth.postMessage({cmd:"alphaSynth.output.sampleRequest"})}onOutputSamplesPlayed(e){this._synth.postMessage({cmd:"alphaSynth.output.samplesPlayed",samples:e})}onOutputReady(){this._outputIsReady=!0,this.checkReady()}}class mJ{constructor(e,r){this._width=0,this.boundsLookup=null,this.preRender=new Nt,this.partialRenderFinished=new Nt,this.partialLayoutFinished=new Nt,this.renderFinished=new Nt,this.postRenderFinished=new oi,this.error=new Nt,this._api=e;try{this._worker=Se.createWebWorker(r)}catch(i){de.error("Rendering",`Failed to create WebWorker: ${i}`);return}this._worker.postMessage({cmd:"alphaTab.initialize",settings:this.serializeSettingsForWorker(r)}),this._worker.addEventListener("message",this.handleWorkerMessage.bind(this))}destroy(){this._worker.terminate()}updateSettings(e){this._worker.postMessage({cmd:"alphaTab.updateSettings",settings:this.serializeSettingsForWorker(e)})}serializeSettingsForWorker(e){const r=Ar.settingsToJsObject(e);return r.delete("player"),r}render(){this._worker.postMessage({cmd:"alphaTab.render"})}resizeRender(){this._worker.postMessage({cmd:"alphaTab.resizeRender"})}renderResult(e){this._worker.postMessage({cmd:"alphaTab.renderResult",resultId:e})}get width(){return this._width}set width(e){this._width=e,this._worker.postMessage({cmd:"alphaTab.setWidth",width:e})}handleWorkerMessage(e){let r=e.data;switch(r.cmd){case"alphaTab.preRender":this.preRender.trigger(r.resize);break;case"alphaTab.partialRenderFinished":this.partialRenderFinished.trigger(r.result);break;case"alphaTab.partialLayoutFinished":this.partialLayoutFinished.trigger(r.result);break;case"alphaTab.renderFinished":this.renderFinished.trigger(r.result);break;case"alphaTab.postRenderFinished":this.boundsLookup=Sh.fromJson(r.boundsLookup,this._api.score),this.boundsLookup.finish(),this.postRenderFinished.trigger();break;case"alphaTab.error":this.error.trigger(r.error);break}}renderScore(e,r){let i=e==null?null:Ar.scoreToJsObject(e);this._worker.postMessage({cmd:"alphaTab.renderScore",score:i,trackIndexes:r,fontSizes:Vr.FontSizeLookupTables})}}class gJ{constructor(e,r,i,n){this.cursorWrapper=e,this.barCursor=r,this.beatCursor=i,this.selectionWrapper=n}}var Un;(function(t){t[t.Browser=0]="Browser",t[t.NodeJs=1]="NodeJs",t[t.BrowserModule=2]="BrowserModule"})(Un||(Un={}));class xh{static init(){var e;xh._isRegistered||(xh._isRegistered=!0,registerProcessor("alphatab",(e=class extends AudioWorkletProcessor{constructor(i){super(i),this._outputBuffer=new Float32Array(0),this._bufferCount=0,this._requestedBufferCount=0,de.debug("WebAudio","creating processor"),this._bufferCount=Math.floor(i.processorOptions.bufferTimeInMilliseconds*sampleRate/1e3/e.BufferSize),this._circularBuffer=new BM(e.BufferSize*this._bufferCount),this.port.onmessage=this.handleMessage.bind(this)}handleMessage(i){let n=i.data;switch(n.cmd){case pr.CmdOutputAddSamples:const a=n.samples;this._circularBuffer.write(a,0,a.length),this._requestedBufferCount--;break;case pr.CmdOutputResetSamples:this._circularBuffer.clear();break}}process(i,n,s){if(n.length!==1&&n[0].length!==2)return!1;let a=n[0][0],o=n[0][1];if(!a||!o)return!0;let l=a.length+o.length,c=this._outputBuffer;c.length!==l&&(c=new Float32Array(l),this._outputBuffer=c);const u=this._circularBuffer.read(c,0,Math.min(c.length,this._circularBuffer.count));let d=0;for(let h=0;h{this._worklet=new AudioWorkletNode(e,"alphatab",{numberOfOutputs:1,outputChannelCount:[2],processorOptions:{bufferTimeInMilliseconds:this._bufferTimeInMilliseconds}}),this._worklet.port.onmessage=this.handleMessage.bind(this),this._source.connect(this._worklet),this._source.start(0),this._worklet.connect(e.destination)},r=>{de.error("WebAudio",`Audio Worklet creation failed: reason=${r}`)})}handleMessage(e){let r=e.data;switch(r.cmd){case pr.CmdOutputSamplesPlayed:this.onSamplesPlayed(r.samples);break;case pr.CmdOutputSampleRequest:this.onSampleRequest();break}}pause(){super.pause(),this._worklet&&(this._worklet.port.onmessage=null,this._worklet.disconnect()),this._worklet=null}addSamples(e){var r;(r=this._worklet)==null||r.port.postMessage({cmd:pr.CmdOutputAddSamples,samples:e})}resetSamples(){var e;(e=this._worklet)==null||e.port.postMessage({cmd:pr.CmdOutputResetSamples})}}class bJ extends ga{constructor(e,r,i){super(e),this._xscale=r,this._yscale=i}get width(){return this.element.offsetWidth/this._xscale}set width(e){this.element.style.width=e*this._xscale+"px"}get height(){return this.element.offsetHeight/this._yscale}set height(e){e>=0?this.element.style.height=e*this._yscale+"px":this.element.style.height="100%"}setBounds(e,r,i,n){isNaN(e)&&(e=this.lastBounds.x),isNaN(r)&&(r=this.lastBounds.y),isNaN(i)?i=this.lastBounds.w:i=i/this._xscale,isNaN(n)?n=this.lastBounds.h:n=n/this._yscale,this.element.style.transform=`translate(${e}px, ${r}px) scale(${i}, ${n})`,this.element.style.transformOrigin="top left",this.lastBounds.x=e,this.lastBounds.y=r,this.lastBounds.w=i,this.lastBounds.h=n}}var la;(function(t){t[t.LayoutDone=0]="LayoutDone",t[t.RenderRequested=1]="RenderRequested",t[t.RenderDone=2]="RenderDone",t[t.Detached=3]="Detached"})(la||(la={}));class vJ{get resizeThrottle(){return 10}get canRender(){return this.areAllFontsLoaded()}areAllFontsLoaded(){if(Se.bravuraFontChecker.checkForFontAvailability(),!Se.bravuraFontChecker.isFontLoaded)return!1;let e=!1;for(const r of this._fontCheckers.values())r.isFontLoaded||(e=!0);return e?!1:(de.debug("Font","All fonts loaded: "+this._fontCheckers.size),!0)}onFontLoaded(e){Vr.generateFontLookup(e),this.areAllFontsLoaded()&&this.canRenderChanged.trigger()}constructor(e){if(this._fontCheckers=new Map,this._contents=null,this._file=null,this._totalResultCount=0,this._initialTrackIndexes=null,this._barToElementLookup=new Map,this._resultIdToElementLookup=new Map,this.rootContainerBecameVisible=new oi,this.canRenderChanged=new oi,this._highlightedElements=[],this._scrollContainer=null,Se.webPlatform!==Un.Browser&&Se.webPlatform!==Un.BrowserModule)throw new gi(mi.General,"Usage of AlphaTabApi is only possible in browser environments. For usage in node use the Low Level APIs");e.classList.add("alphaTab"),this.rootContainer=new ga(e),this.areWorkersSupported="Worker"in window,Se.bravuraFontChecker.fontLoaded.on(this.onFontLoaded.bind(this)),this._intersectionObserver=new IntersectionObserver(this.onElementVisibilityChanged.bind(this),{threshold:[0,.01,1]}),this._intersectionObserver.observe(e)}onElementVisibilityChanged(e){for(const r of e){const i=r.target;if(i===this.rootContainer.element)r.isIntersecting&&(this.rootContainerBecameVisible.trigger(),this._intersectionObserver.unobserve(this.rootContainer.element));else if("layoutResultId"in i&&this._api.settings.core.enableLazyLoading){const n=i;r.isIntersecting?n.renderedResultId!==n.layoutResultId?this._resultIdToElementLookup.has(n.layoutResultId)?n.resultState!==la.RenderRequested&&(n.resultState=la.RenderRequested,this._api.renderer.renderResult(n.layoutResultId)):i.replaceChildren():n.resultState===la.Detached&&(i.replaceChildren(...n.renderedResult),n.resultState=la.RenderDone):n.resultState===la.RenderDone&&(n.resultState=la.Detached,n.replaceChildren())}}}createWorkerRenderer(){return new mJ(this._api,this._api.settings)}initialize(e,r){this._api=e;let i;r instanceof Wl?i=r:i=Ar.jsObjectToSettings(r);let n=this.getDataAttributes();uu.fromJson(i,n),i.notation.notationMode===si.SongBook&&i.setSongBookModeSettings(),e.settings=i,this.setupFontCheckers(i),this._initialTrackIndexes=this.parseTracks(i.core.tracks),this._contents="";let s=e.container;i.core.tex&&(this._contents=s.element.innerHTML,s.element.innerHTML=""),this.createStyleElement(i),this._file=i.core.file}setupFontCheckers(e){this.registerFontChecker(e.display.resources.copyrightFont),this.registerFontChecker(e.display.resources.effectFont),this.registerFontChecker(e.display.resources.fingeringFont),this.registerFontChecker(e.display.resources.graceFont),this.registerFontChecker(e.display.resources.markerFont),this.registerFontChecker(e.display.resources.tablatureFont),this.registerFontChecker(e.display.resources.titleFont),this.registerFontChecker(e.display.resources.wordsFont),this.registerFontChecker(e.display.resources.barNumberFont),this.registerFontChecker(e.display.resources.fretboardNumberFont),this.registerFontChecker(e.display.resources.subTitleFont)}registerFontChecker(e){if(!this._fontCheckers.has(e.families.join(", "))){let r=new _M(e.families);this._fontCheckers.set(e.families.join(", "),r),r.fontLoaded.on(this.onFontLoaded.bind(this)),r.checkForFontAvailability()}}destroy(){this.rootContainer.element.innerHTML=""}createCanvasElement(){let e=document.createElement("div");return e.className="at-surface",e.style.fontSize="0",e.style.overflow="hidden",e.style.lineHeight="0",e.style.position="relative",new ga(e)}triggerEvent(e,r,i=null,n){let s=e.element;r="alphaTab."+r;let a=document.createEvent("CustomEvent"),o=n?n.mouseEvent:null;if(a.initCustomEvent(r,!1,!1,i),o&&(a.originalEvent=o),s.dispatchEvent(a),window&&"jQuery"in window){let l=window.jQuery,c=[];c.push(i),o&&c.push(o),l(s).trigger(r,c)}}load(e,r,i){if(e instanceof Ql)return r(e),!0;if(e instanceof ArrayBuffer){let n=new Uint8Array(e);return r(Dc.loadScoreFromBytes(n,this._api.settings)),!0}return e instanceof Uint8Array?(r(Dc.loadScoreFromBytes(e,this._api.settings)),!0):typeof e=="string"?(Dc.loadScoreAsync(e,r,i,this._api.settings),!0):!1}loadSoundFont(e,r){return this._api.player?e instanceof ArrayBuffer?(this._api.player.loadSoundFont(new Uint8Array(e),r),!0):e instanceof Uint8Array?(this._api.player.loadSoundFont(e,r),!0):typeof e=="string"?(this._api.loadSoundFontFromUrl(e,r),!0):!1:!1}initialRender(){this._api.renderer.preRender.on(r=>{this._totalResultCount=0,this._resultIdToElementLookup.clear(),this._barToElementLookup.clear()});const e=()=>{this._api.renderer.width=this.rootContainer.width|0,this._api.renderer.updateSettings(this._api.settings),this._contents?(this._api.tex(this._contents,this._initialTrackIndexes??void 0),this._initialTrackIndexes=null):this._file&&Dc.loadScoreAsync(this._file,r=>{this._api.renderScore(r,this._initialTrackIndexes??void 0),this._initialTrackIndexes=null},r=>{this._api.onError(r)},this._api.settings)};this.rootContainer.isVisible?e():this.rootContainerBecameVisible.on(e)}createStyleElement(e){let r=this._api.container.element.ownerDocument;Se.createStyleElement(r,e.core.fontDirectory)}parseTracks(e){if(!e)return[];let r=[];if(typeof e=="string")try{if(e==="all")return[-1];e=JSON.parse(e)}catch{e=[0]}if(typeof e=="number")r.push(e);else if("length"in e){let i=e.length,n=e;for(let s=0;s=0||o===-1)&&r.push(o)}}else"index"in e&&r.push(e.index);return r}getDataAttributes(){let e=new Map,r=this._api.container.element;if(r.dataset)for(let i of Object.keys(r.dataset)){let n=r.dataset[i];try{n=JSON.parse(n)}catch{n===""&&(n=null)}e.set(i,n)}else for(let i=0;i=0&&this._barToElementLookup.set(n,i);this._api.settings.core.enableLazyLoading&&(this._intersectionObserver.unobserve(i),this._intersectionObserver.observe(i)),this._totalResultCount++}else for(;r.childElementCount>this._totalResultCount;)this._api.settings.core.enableLazyLoading&&this._intersectionObserver.unobserve(r.lastChild),r.removeChild(r.lastElementChild)}createWorkerPlayer(){let e=null,r="ScriptProcessorNode"in window;return window.isSecureContext&&"AudioWorkletNode"in window&&this._api.settings.player.outputMode===wh.WebAudioAudioWorklets?(de.debug("Player","Will use webworkers for synthesizing and web audio api with worklets for playback"),e=new sT(new yJ(this._api.settings),this._api.settings)):r&&(de.debug("Player","Will use webworkers for synthesizing and web audio api with ScriptProcessor for playback"),e=new sT(new fJ,this._api.settings)),e?e.ready.on(()=>{this._api.settings.player.soundFont&&this._api.loadSoundFontFromUrl(this._api.settings.player.soundFont,!1)}):de.error("Player","Player requires webworkers and web audio api, browser unsupported",null),e}beginInvoke(e){window.requestAnimationFrame(()=>{e()})}highlightElements(e,r){const i=this._barToElementLookup.get(r);if(i){let n=i.getElementsByClassName(e);for(let s=0;s{a===0&&(a=l);let c=l-a,u=Math.min(c/i,1);e.scrollTop=n+s*u|0,c{a===0&&(a=l);let c=l-a,u=Math.min(c/i,1);e.scrollLeft=n+s*u|0,c=0?this.element.style.height=e+"px":this.element.style.height="100%"}get isVisible(){return!!this.element.offsetWidth||!!this.element.offsetHeight||!!this.element.getClientRects().length}constructor(e){this._resizeListeners=0,this.lastBounds=new dn,this.element=e,this.mouseDown={on:r=>{this.element.addEventListener("mousedown",i=>{r(new vb(i))},!0)},off:r=>{}},this.mouseUp={on:r=>{this.element.addEventListener("mouseup",i=>{r(new vb(i))},!0)},off:r=>{}},this.mouseMove={on:r=>{this.element.addEventListener("mousemove",i=>{r(new vb(i))},!0)},off:r=>{}},this.resize={on:r=>{this._resizeListeners===0&&ga.resizeObserver.value.observe(this.element),this.element.addEventListener("resize",r,!0),this._resizeListeners++},off:r=>{this.element.removeEventListener("resize",r,!0),this._resizeListeners--,this._resizeListeners<=0&&(this._resizeListeners=0,ga.resizeObserver.value.unobserve(this.element))}}}stopAnimation(){this.element.style.transition="none"}transitionToX(e,r){this.element.style.transition=`transform ${e}ms linear`,this.setBounds(r,NaN,NaN,NaN)}setBounds(e,r,i,n){isNaN(e)&&(e=this.lastBounds.x),isNaN(r)&&(r=this.lastBounds.y),isNaN(i)&&(i=this.lastBounds.w),isNaN(n)&&(n=this.lastBounds.h),this.element.style.transform=`translate(${e}px, ${r}px) scale(${i}, ${n})`,this.element.style.transformOrigin="top left",this.lastBounds.x=e,this.lastBounds.y=r,this.lastBounds.w=i,this.lastBounds.h=n}appendChild(e){this.element.appendChild(e.element)}clear(){this.element.innerHTML=""}}ga.resizeObserver=new JR(()=>new ResizeObserver(t=>{for(const e of t){let r=new CustomEvent("resize",{detail:e});e.target.dispatchEvent(r)}}));class PM{constructor(e){this._isStarted=!1,this.isFontLoaded=!1,this.fontLoaded=new Nt,this._originalFamilies=e,this._families=e}checkForFontAvailability(){if(xe.isRunningInWorker){this.isFontLoaded=!1;return}if(this._isStarted)return;this._isStarted=!0;let e=0,r=window.setInterval(()=>{he.warning("Rendering",`Could not load font '${this._families[0]}' within ${(e+1)*5} seconds`,null),this._families.length>1?(this._families.shift(),e=0):e++},5e3);he.debug("Font",`Start checking for font availablility: ${this._families.join(", ")}`);let i=a=>{this._families.length>1?(he.debug("Font",`[${this._families[0]}] Loading Failed, switching to ${this._families[1]}`,a),this._families.shift(),window.setTimeout(()=>{s()},0)):(he.error("Font",`[${this._originalFamilies.join(",")}] Loading Failed, rendering cannot start`,a),window.clearInterval(r))},n=a=>{he.debug("Font",`[${a}] Font API signaled available`),this.isFontLoaded=!0,window.clearInterval(r),this.fontLoaded.trigger(this._families[0])},s=async()=>{for(const a of this._families)if(await this.isFontAvailable(a,!1)){n(a);return}try{await document.fonts.load(`1em ${this._families[0]}`)}catch(a){i(a)}return he.debug("Font",`[${this._families[0]}] Font API signaled loaded`),await this.isFontAvailable(this._families[0],!0)?n(this._families[0]):i("Font not available"),!0};document.fonts.ready.then(()=>{s()})}isFontAvailable(e,r){return new Promise(i=>{const n="1em "+e;if(document.fonts.check(n))i(!0);else if(r){he.debug("Font",`Font ${e} not available, creating test element to trigger load`);const s=document.createElement("div");s.style.font=n,s.style.opacity="0",s.style.position="absolute",s.style.top="0",s.style.left="0",s.innerText=`Trigger ${e} load`,document.body.appendChild(s),setTimeout(()=>{document.body.removeChild(s),document.fonts.check(n)?i(!0):i(!1)},200)}else i(!1)})}}class NM{constructor(e){this._writePosition=0,this._readPosition=0,this.count=0,this._buffer=new Float32Array(e)}clear(){this._readPosition=0,this._writePosition=0,this.count=0,this._buffer=new Float32Array(this._buffer.length)}write(e,r,i){let n=0;i>this._buffer.length-this.count&&(i=this._buffer.length-this.count);const s=Math.min(this._buffer.length-this._writePosition,i);return this._buffer.set(e.subarray(r,r+s),this._writePosition),this._writePosition+=s,this._writePosition%=this._buffer.length,n+=s,nthis.count&&(i=this.count);let n=0;const s=Math.min(this._buffer.length-this._readPosition,i);return e.set(this._buffer.subarray(this._readPosition,this._readPosition+s),r),n+=s,this._readPosition+=s,this._readPosition%=this._buffer.length,n{var r,i;he.debug("WebAudio",`Audio Context resume success: state=${(r=this._context)==null?void 0:r.state}, sampleRate:${(i=this._context)==null?void 0:i.sampleRate}`),e&&e()},r=>{var i,n;he.warning("WebAudio",`Audio Context resume failed: state=${(i=this._context)==null?void 0:i.state}, sampleRate:${(n=this._context)==null?void 0:n.sampleRate}, reason=${r}`)}))}patchIosSampleRate(){let e=navigator.userAgent;if(e.indexOf("iPhone")!==-1||e.indexOf("iPad")!==-1){let r=this.createAudioContext(),i=r.createBuffer(1,1,ms.PreferredSampleRate),n=r.createBufferSource();n.buffer=i,n.connect(r.destination),n.start(0),n.disconnect(0),r.close()}}createAudioContext(){if("AudioContext"in xe.globalThis)return new AudioContext;if("webkitAudioContext"in xe.globalThis)return new webkitAudioContext;throw new gi(mi.General,"AudioContext not found")}open(e){this.patchIosSampleRate(),this._context=this.createAudioContext(),this._context.state==="suspended"&&this.registerResumeHandler()}registerResumeHandler(){this._resumeHandler=(()=>{this.activate(()=>{this.unregisterResumeHandler()})}).bind(this),document.body.addEventListener("touchend",this._resumeHandler,!1),document.body.addEventListener("click",this._resumeHandler,!1)}unregisterResumeHandler(){const e=this._resumeHandler;e&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1))}play(){let e=this._context;this.activate(),this._buffer=e.createBuffer(2,ms.BufferSize,e.sampleRate),this._source=e.createBufferSource(),this._source.buffer=this._buffer,this._source.loop=!0}pause(){this._source&&(this._source.stop(0),this._source.disconnect()),this._source=null}destroy(){var e;this.pause(),(e=this._context)==null||e.close(),this._context=null,this.unregisterResumeHandler()}onSamplesPlayed(e){this.samplesPlayed.trigger(e)}onSampleRequest(){this.sampleRequest.trigger()}onReady(){this.ready.trigger()}}ms.BufferSize=4096;ms.PreferredSampleRate=44100;class mJ extends ms{constructor(){super(...arguments),this._audioNode=null,this._bufferCount=0,this._requestedBufferCount=0,this._outputBuffer=new Float32Array(0)}open(e){super.open(e),this._bufferCount=Math.floor(e*this.sampleRate/1e3/ms.BufferSize),this._circularBuffer=new NM(ms.BufferSize*this._bufferCount),this.onReady()}play(){super.play();let e=this._context;this._audioNode=e.createScriptProcessor(4096,0,2),this._audioNode.onaudioprocess=this.generateSound.bind(this),this._circularBuffer.clear(),this.requestBuffers(),this._source=e.createBufferSource(),this._source.buffer=this._buffer,this._source.loop=!0,this._source.connect(this._audioNode,0,0),this._source.start(0),this._audioNode.connect(e.destination,0,0)}pause(){super.pause(),this._audioNode&&this._audioNode.disconnect(0),this._audioNode=null}addSamples(e){this._circularBuffer.write(e,0,e.length),this._requestedBufferCount--}resetSamples(){this._circularBuffer.clear()}requestBuffers(){const e=this._bufferCount/2|0;let r=e*ms.BufferSize;if(this._circularBuffer.count+this._requestedBufferCount*ms.BufferSize{let a=new Uint8Array(n.response);this.loadSoundFont(a,r)},n.onerror=s=>{he.error("AlphaSynth","Loading failed: "+s.message),this.soundFontLoadFailed.trigger(new Ma(s.message,n))},n.onprogress=s=>{he.debug("AlphaSynth",`Soundfont downloading: ${s.loaded}/${s.total} bytes`),i(new gJ(s.loaded,s.total))},n.send()}resetSoundFonts(){this._synth.postMessage({cmd:"alphaSynth.resetSoundFonts"})}loadMidiFile(e){this._synth.postMessage({cmd:"alphaSynth.loadMidi",midi:Ar.midiFileToJsObject(e)})}applyTranspositionPitches(e){this._synth.postMessage({cmd:"alphaSynth.applyTranspositionPitches",transpositionPitches:JSON.stringify(Array.from(e.entries()))})}setChannelMute(e,r){this._synth.postMessage({cmd:"alphaSynth.setChannelMute",channel:e,mute:r})}resetChannelStates(){this._synth.postMessage({cmd:"alphaSynth.resetChannelStates"})}setChannelSolo(e,r){this._synth.postMessage({cmd:"alphaSynth.setChannelSolo",channel:e,solo:r})}setChannelVolume(e,r){r=Math.max(r,ht.MinVolume),this._synth.postMessage({cmd:"alphaSynth.setChannelVolume",channel:e,volume:r})}handleWorkerMessage(e){let r=e.data;switch(r.cmd){case"alphaSynth.ready":this._workerIsReady=!0,this.checkReady();break;case"alphaSynth.destroyed":this._synth.terminate();break;case"alphaSynth.readyForPlayback":this._workerIsReadyForPlayback=!0,this.checkReadyForPlayback();break;case"alphaSynth.positionChanged":this._timePosition=r.currentTime,this._tickPosition=r.currentTick,this.positionChanged.trigger(new gm(r.currentTime,r.endTime,r.currentTick,r.endTick,r.isSeek));break;case"alphaSynth.midiEventsPlayed":this.midiEventsPlayed.trigger(new wM(r.events.map(Ar.jsObjectToMidiEvent)));break;case"alphaSynth.playerStateChanged":this._state=r.state,this.stateChanged.trigger(new wp(r.state,r.stopped));break;case"alphaSynth.playbackRangeChanged":this._playbackRange=r.playbackRange,this.playbackRangeChanged.trigger(new SM(this._playbackRange));break;case"alphaSynth.finished":this.finished.trigger();break;case"alphaSynth.soundFontLoaded":this.soundFontLoaded.trigger();break;case"alphaSynth.soundFontLoadFailed":this.soundFontLoadFailed.trigger(r.error);break;case"alphaSynth.midiLoaded":this.checkReadyForPlayback(),this.midiLoaded.trigger(new gm(r.currentTime,r.endTime,r.currentTick,r.endTick,r.isSeek));break;case"alphaSynth.midiLoadFailed":this.checkReadyForPlayback(),this.midiLoadFailed.trigger(r.error);break;case"alphaSynth.output.addSamples":this._output.addSamples(r.samples);break;case"alphaSynth.output.play":this._output.play();break;case"alphaSynth.output.pause":this._output.pause();break;case"alphaSynth.output.destroy":this._output.destroy();break;case"alphaSynth.output.resetSamples":this._output.resetSamples();break}}checkReady(){this.isReady&&this.ready.trigger()}checkReadyForPlayback(){this.isReadyForPlayback&&this.readyForPlayback.trigger()}onOutputSampleRequest(){this._synth.postMessage({cmd:"alphaSynth.output.sampleRequest"})}onOutputSamplesPlayed(e){this._synth.postMessage({cmd:"alphaSynth.output.samplesPlayed",samples:e})}onOutputReady(){this._outputIsReady=!0,this.checkReady()}}class yJ{constructor(e,r){this._width=0,this.boundsLookup=null,this.preRender=new Nt,this.partialRenderFinished=new Nt,this.partialLayoutFinished=new Nt,this.renderFinished=new Nt,this.postRenderFinished=new li,this.error=new Nt,this._api=e;try{this._worker=xe.createWebWorker(r)}catch(i){he.error("Rendering",`Failed to create WebWorker: ${i}`);return}this._worker.postMessage({cmd:"alphaTab.initialize",settings:this.serializeSettingsForWorker(r)}),this._worker.addEventListener("message",this.handleWorkerMessage.bind(this))}destroy(){this._worker.terminate()}updateSettings(e){this._worker.postMessage({cmd:"alphaTab.updateSettings",settings:this.serializeSettingsForWorker(e)})}serializeSettingsForWorker(e){const r=Ar.settingsToJsObject(e);return r.delete("player"),r}render(){this._worker.postMessage({cmd:"alphaTab.render"})}resizeRender(){this._worker.postMessage({cmd:"alphaTab.resizeRender"})}renderResult(e){this._worker.postMessage({cmd:"alphaTab.renderResult",resultId:e})}get width(){return this._width}set width(e){this._width=e,this._worker.postMessage({cmd:"alphaTab.setWidth",width:e})}handleWorkerMessage(e){let r=e.data;switch(r.cmd){case"alphaTab.preRender":this.preRender.trigger(r.resize);break;case"alphaTab.partialRenderFinished":this.partialRenderFinished.trigger(r.result);break;case"alphaTab.partialLayoutFinished":this.partialLayoutFinished.trigger(r.result);break;case"alphaTab.renderFinished":this.renderFinished.trigger(r.result);break;case"alphaTab.postRenderFinished":this.boundsLookup=Sh.fromJson(r.boundsLookup,this._api.score),this.boundsLookup.finish(),this.postRenderFinished.trigger();break;case"alphaTab.error":this.error.trigger(r.error);break}}renderScore(e,r){let i=e==null?null:Ar.scoreToJsObject(e);this._worker.postMessage({cmd:"alphaTab.renderScore",score:i,trackIndexes:r,fontSizes:Vr.FontSizeLookupTables})}}class bJ{constructor(e,r,i,n){this.cursorWrapper=e,this.barCursor=r,this.beatCursor=i,this.selectionWrapper=n}}var Un;(function(t){t[t.Browser=0]="Browser",t[t.NodeJs=1]="NodeJs",t[t.BrowserModule=2]="BrowserModule"})(Un||(Un={}));class xh{static init(){var e;xh._isRegistered||(xh._isRegistered=!0,registerProcessor("alphatab",(e=class extends AudioWorkletProcessor{constructor(i){super(i),this._outputBuffer=new Float32Array(0),this._bufferCount=0,this._requestedBufferCount=0,he.debug("WebAudio","creating processor"),this._bufferCount=Math.floor(i.processorOptions.bufferTimeInMilliseconds*sampleRate/1e3/e.BufferSize),this._circularBuffer=new NM(e.BufferSize*this._bufferCount),this.port.onmessage=this.handleMessage.bind(this)}handleMessage(i){let n=i.data;switch(n.cmd){case pr.CmdOutputAddSamples:const a=n.samples;this._circularBuffer.write(a,0,a.length),this._requestedBufferCount--;break;case pr.CmdOutputResetSamples:this._circularBuffer.clear();break}}process(i,n,s){if(n.length!==1&&n[0].length!==2)return!1;let a=n[0][0],o=n[0][1];if(!a||!o)return!0;let l=a.length+o.length,c=this._outputBuffer;c.length!==l&&(c=new Float32Array(l),this._outputBuffer=c);const u=this._circularBuffer.read(c,0,Math.min(c.length,this._circularBuffer.count));let d=0;for(let h=0;h{this._worklet=new AudioWorkletNode(e,"alphatab",{numberOfOutputs:1,outputChannelCount:[2],processorOptions:{bufferTimeInMilliseconds:this._bufferTimeInMilliseconds}}),this._worklet.port.onmessage=this.handleMessage.bind(this),this._source.connect(this._worklet),this._source.start(0),this._worklet.connect(e.destination)},r=>{he.error("WebAudio",`Audio Worklet creation failed: reason=${r}`)})}handleMessage(e){let r=e.data;switch(r.cmd){case pr.CmdOutputSamplesPlayed:this.onSamplesPlayed(r.samples);break;case pr.CmdOutputSampleRequest:this.onSampleRequest();break}}pause(){super.pause(),this._worklet&&(this._worklet.port.onmessage=null,this._worklet.disconnect()),this._worklet=null}addSamples(e){var r;(r=this._worklet)==null||r.port.postMessage({cmd:pr.CmdOutputAddSamples,samples:e})}resetSamples(){var e;(e=this._worklet)==null||e.port.postMessage({cmd:pr.CmdOutputResetSamples})}}class wJ extends ga{constructor(e,r,i){super(e),this._xscale=r,this._yscale=i}get width(){return this.element.offsetWidth/this._xscale}set width(e){this.element.style.width=e*this._xscale+"px"}get height(){return this.element.offsetHeight/this._yscale}set height(e){e>=0?this.element.style.height=e*this._yscale+"px":this.element.style.height="100%"}setBounds(e,r,i,n){isNaN(e)&&(e=this.lastBounds.x),isNaN(r)&&(r=this.lastBounds.y),isNaN(i)?i=this.lastBounds.w:i=i/this._xscale,isNaN(n)?n=this.lastBounds.h:n=n/this._yscale,this.element.style.transform=`translate(${e}px, ${r}px) scale(${i}, ${n})`,this.element.style.transformOrigin="top left",this.lastBounds.x=e,this.lastBounds.y=r,this.lastBounds.w=i,this.lastBounds.h=n}}var la;(function(t){t[t.LayoutDone=0]="LayoutDone",t[t.RenderRequested=1]="RenderRequested",t[t.RenderDone=2]="RenderDone",t[t.Detached=3]="Detached"})(la||(la={}));class SJ{get resizeThrottle(){return 10}get canRender(){return this.areAllFontsLoaded()}areAllFontsLoaded(){if(xe.bravuraFontChecker.checkForFontAvailability(),!xe.bravuraFontChecker.isFontLoaded)return!1;let e=!1;for(const r of this._fontCheckers.values())r.isFontLoaded||(e=!0);return e?!1:(he.debug("Font","All fonts loaded: "+this._fontCheckers.size),!0)}onFontLoaded(e){Vr.generateFontLookup(e),this.areAllFontsLoaded()&&this.canRenderChanged.trigger()}constructor(e){if(this._fontCheckers=new Map,this._contents=null,this._file=null,this._totalResultCount=0,this._initialTrackIndexes=null,this._barToElementLookup=new Map,this._resultIdToElementLookup=new Map,this.rootContainerBecameVisible=new li,this.canRenderChanged=new li,this._highlightedElements=[],this._scrollContainer=null,xe.webPlatform!==Un.Browser&&xe.webPlatform!==Un.BrowserModule)throw new gi(mi.General,"Usage of AlphaTabApi is only possible in browser environments. For usage in node use the Low Level APIs");e.classList.add("alphaTab"),this.rootContainer=new ga(e),this.areWorkersSupported="Worker"in window,xe.bravuraFontChecker.fontLoaded.on(this.onFontLoaded.bind(this)),this._intersectionObserver=new IntersectionObserver(this.onElementVisibilityChanged.bind(this),{threshold:[0,.01,1]}),this._intersectionObserver.observe(e)}onElementVisibilityChanged(e){for(const r of e){const i=r.target;if(i===this.rootContainer.element)r.isIntersecting&&(this.rootContainerBecameVisible.trigger(),this._intersectionObserver.unobserve(this.rootContainer.element));else if("layoutResultId"in i&&this._api.settings.core.enableLazyLoading){const n=i;r.isIntersecting?n.renderedResultId!==n.layoutResultId?this._resultIdToElementLookup.has(n.layoutResultId)?n.resultState!==la.RenderRequested&&(n.resultState=la.RenderRequested,this._api.renderer.renderResult(n.layoutResultId)):i.replaceChildren():n.resultState===la.Detached&&(i.replaceChildren(...n.renderedResult),n.resultState=la.RenderDone):n.resultState===la.RenderDone&&(n.resultState=la.Detached,n.replaceChildren())}}}createWorkerRenderer(){return new yJ(this._api,this._api.settings)}initialize(e,r){this._api=e;let i;r instanceof Wl?i=r:i=Ar.jsObjectToSettings(r);let n=this.getDataAttributes();uu.fromJson(i,n),i.notation.notationMode===ai.SongBook&&i.setSongBookModeSettings(),e.settings=i,this.setupFontCheckers(i),this._initialTrackIndexes=this.parseTracks(i.core.tracks),this._contents="";let s=e.container;i.core.tex&&(this._contents=s.element.innerHTML,s.element.innerHTML=""),this.createStyleElement(i),this._file=i.core.file}setupFontCheckers(e){this.registerFontChecker(e.display.resources.copyrightFont),this.registerFontChecker(e.display.resources.effectFont),this.registerFontChecker(e.display.resources.fingeringFont),this.registerFontChecker(e.display.resources.graceFont),this.registerFontChecker(e.display.resources.markerFont),this.registerFontChecker(e.display.resources.tablatureFont),this.registerFontChecker(e.display.resources.titleFont),this.registerFontChecker(e.display.resources.wordsFont),this.registerFontChecker(e.display.resources.barNumberFont),this.registerFontChecker(e.display.resources.fretboardNumberFont),this.registerFontChecker(e.display.resources.subTitleFont)}registerFontChecker(e){if(!this._fontCheckers.has(e.families.join(", "))){let r=new PM(e.families);this._fontCheckers.set(e.families.join(", "),r),r.fontLoaded.on(this.onFontLoaded.bind(this)),r.checkForFontAvailability()}}destroy(){this.rootContainer.element.innerHTML=""}createCanvasElement(){let e=document.createElement("div");return e.className="at-surface",e.style.fontSize="0",e.style.overflow="hidden",e.style.lineHeight="0",e.style.position="relative",new ga(e)}triggerEvent(e,r,i=null,n){let s=e.element;r="alphaTab."+r;let a=document.createEvent("CustomEvent"),o=n?n.mouseEvent:null;if(a.initCustomEvent(r,!1,!1,i),o&&(a.originalEvent=o),s.dispatchEvent(a),window&&"jQuery"in window){let l=window.jQuery,c=[];c.push(i),o&&c.push(o),l(s).trigger(r,c)}}load(e,r,i){if(e instanceof Ql)return r(e),!0;if(e instanceof ArrayBuffer){let n=new Uint8Array(e);return r(Dc.loadScoreFromBytes(n,this._api.settings)),!0}return e instanceof Uint8Array?(r(Dc.loadScoreFromBytes(e,this._api.settings)),!0):typeof e=="string"?(Dc.loadScoreAsync(e,r,i,this._api.settings),!0):!1}loadSoundFont(e,r){return this._api.player?e instanceof ArrayBuffer?(this._api.player.loadSoundFont(new Uint8Array(e),r),!0):e instanceof Uint8Array?(this._api.player.loadSoundFont(e,r),!0):typeof e=="string"?(this._api.loadSoundFontFromUrl(e,r),!0):!1:!1}initialRender(){this._api.renderer.preRender.on(r=>{this._totalResultCount=0,this._resultIdToElementLookup.clear(),this._barToElementLookup.clear()});const e=()=>{this._api.renderer.width=this.rootContainer.width|0,this._api.renderer.updateSettings(this._api.settings),this._contents?(this._api.tex(this._contents,this._initialTrackIndexes??void 0),this._initialTrackIndexes=null):this._file&&Dc.loadScoreAsync(this._file,r=>{this._api.renderScore(r,this._initialTrackIndexes??void 0),this._initialTrackIndexes=null},r=>{this._api.onError(r)},this._api.settings)};this.rootContainer.isVisible?e():this.rootContainerBecameVisible.on(e)}createStyleElement(e){let r=this._api.container.element.ownerDocument;xe.createStyleElement(r,e.core.fontDirectory)}parseTracks(e){if(!e)return[];let r=[];if(typeof e=="string")try{if(e==="all")return[-1];e=JSON.parse(e)}catch{e=[0]}if(typeof e=="number")r.push(e);else if("length"in e){let i=e.length,n=e;for(let s=0;s=0||o===-1)&&r.push(o)}}else"index"in e&&r.push(e.index);return r}getDataAttributes(){let e=new Map,r=this._api.container.element;if(r.dataset)for(let i of Object.keys(r.dataset)){let n=r.dataset[i];try{n=JSON.parse(n)}catch{n===""&&(n=null)}e.set(i,n)}else for(let i=0;i=0&&this._barToElementLookup.set(n,i);this._api.settings.core.enableLazyLoading&&(this._intersectionObserver.unobserve(i),this._intersectionObserver.observe(i)),this._totalResultCount++}else for(;r.childElementCount>this._totalResultCount;)this._api.settings.core.enableLazyLoading&&this._intersectionObserver.unobserve(r.lastChild),r.removeChild(r.lastElementChild)}createWorkerPlayer(){let e=null,r="ScriptProcessorNode"in window;return window.isSecureContext&&"AudioWorkletNode"in window&&this._api.settings.player.outputMode===wh.WebAudioAudioWorklets?(he.debug("Player","Will use webworkers for synthesizing and web audio api with worklets for playback"),e=new nT(new vJ(this._api.settings),this._api.settings)):r&&(he.debug("Player","Will use webworkers for synthesizing and web audio api with ScriptProcessor for playback"),e=new nT(new mJ,this._api.settings)),e?e.ready.on(()=>{this._api.settings.player.soundFont&&this._api.loadSoundFontFromUrl(this._api.settings.player.soundFont,!1)}):he.error("Player","Player requires webworkers and web audio api, browser unsupported",null),e}beginInvoke(e){window.requestAnimationFrame(()=>{e()})}highlightElements(e,r){const i=this._barToElementLookup.get(r);if(i){let n=i.getElementsByClassName(e);for(let s=0;s{a===0&&(a=l);let c=l-a,u=Math.min(c/i,1);e.scrollTop=n+s*u|0,c{a===0&&(a=l);let c=l-a,u=Math.min(c/i,1);e.scrollLeft=n+s*u|0,c @@ -229,11 +229,11 @@ Parsing JSON Request failed.`,s)):s.statusText==="timeout"?i(new Ma("Request Tim - `);const s=this.score;s&&(s.artist&&s.title?i.document.title=`${s.title} - ${s.artist}`:s.title&&(i.document.title=`${s.title}`)),i.document.body.appendChild(n);let a=typeof window.screenLeft<"u"?window.screenLeft:window.left,o=typeof window.screenTop<"u"?window.screenTop:window.top,l="innerWidth"in window?window.innerWidth:"clientWidth"in document.documentElement?document.documentElement.clientWidth:window.screen.width,c="innerHeight"in window?window.innerHeight:"clientHeight"in document.documentElement?document.documentElement.clientHeight:window.screen.height,u=n.offsetWidth+50,d=window.innerHeight,h=(l/2|0)-(u/2|0)+a,p=(c/2|0)-(d/2|0)+o;i.resizeTo(u,d),i.moveTo(h,p),i.focus();let f=Ar.jsObjectToSettings(Ar.settingsToJsObject(this.settings));f.core.enableLazyLoading=!1,f.core.useWorkers=!0,f.core.file=null,f.core.tracks=null,f.player.enableCursor=!1,f.player.enablePlayer=!1,f.player.enableElementHighlighting=!1,f.player.enableUserInteraction=!1,f.player.soundFont=null,f.display.scale=.8,f.display.stretchForce=.8,uu.fromJson(f,r);let m=new sy(n,f);i.onunload=()=>{m.destroy()},m.renderer.postRenderFinished.on(()=>{i.print()}),m.renderTracks(this.tracks)}downloadMidi(e=cu.SingleTrackMultiChannel){if(!this.score)return;let r=new Fo;r.format=e;let i=new ma(r,!0);new Vt(this.score,this.settings,i).generate();let s=r.toBinary(),a=this.score.title?`${this.score.title}.mid`:"File.mid",o=document.createElement("a");o.download=a;let l=new Blob([s],{type:"audio/midi"}),c=URL.createObjectURL(l);o.href=c,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}changeTrackMute(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackMute(i,r)}changeTrackSolo(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackSolo(i,r)}changeTrackVolume(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackVolume(i,r)}trackIndexesToTracks(e){if(!this.score)return[];let r=[];if(e.length===1&&e[0]===-1)for(let i of this.score.tracks)r.push(i);else for(let i of e)i>=0&&i{this.soundFontLoad.trigger(i),this.uiFacade.triggerEvent(this.container,"soundFontLoad",i)})}}class aT{constructor(){this._initListeners=[]}exec(e,r,i){if(typeof r!="string"&&(i=[r],r="init"),r.charCodeAt(0)===95||r==="exec")return null;let n=new jQuery(e),s=n.data("alphaTab");if(r==="destroy"&&!s)return null;if(r!=="init"&&!s)throw new Error("alphaTab not initialized");let a=this[r];if(a){let o=[n,s].concat(i);return a.apply(this,o)}else return de.error("Api","Method '"+r+"' does not exist on jQuery.alphaTab"),null}init(e,r,i){if(!r){r=new sy(e[0],i),e.data("alphaTab",r);for(let n of this._initListeners)n(e,r,i)}}destroy(e,r){e.removeData("alphaTab"),r.destroy()}print(e,r,i,n){r.print(i,n)}load(e,r,i,n){return r.load(i,n)}render(e,r){r.render()}renderScore(e,r,i,n){r.renderScore(i,n)}renderTracks(e,r,i){r.renderTracks(i)}invalidate(e,r){r.render()}tex(e,r,i,n){r.tex(i,n)}muteTrack(e,r,i,n){r.changeTrackMute(i,n)}soloTrack(e,r,i,n){r.changeTrackSolo(i,n)}trackVolume(e,r,i,n){r.changeTrackVolume(i,n)}loadSoundFont(e,r,i,n){r.loadSoundFont(i,n)}resetSoundFonts(e,r){r.resetSoundFonts()}pause(e,r){r.pause()}play(e,r){return r.play()}playPause(e,r){r.playPause()}stop(e,r){r.stop()}api(e,r){return r}player(e,r){return r.player}isReadyForPlayback(e,r){return r.isReadyForPlayback}playerState(e,r){return r.playerState}masterVolume(e,r,i){return typeof i=="number"&&(r.masterVolume=i),r.masterVolume}metronomeVolume(e,r,i){return typeof i=="number"&&(r.metronomeVolume=i),r.metronomeVolume}countInVolume(e,r,i){return typeof i=="number"&&(r.countInVolume=i),r.countInVolume}midiEventsPlayedFilter(e,r,i){return Array.isArray(i)&&(r.midiEventsPlayedFilter=i),r.midiEventsPlayedFilter}playbackSpeed(e,r,i){return typeof i=="number"&&(r.playbackSpeed=i),r.playbackSpeed}tickPosition(e,r,i){return typeof i=="number"&&(r.tickPosition=i),r.tickPosition}timePosition(e,r,i){return typeof i=="number"&&(r.timePosition=i),r.timePosition}loop(e,r,i){return typeof i=="boolean"&&(r.isLooping=i),r.isLooping}renderer(e,r){return r.renderer}score(e,r){return r.score}settings(e,r){return r.settings}tracks(e,r){return r.tracks}_oninit(e){this._initListeners.push(e)}static restore(e){new jQuery(e).empty().removeData("alphaTab")}}class zS{constructor(){this.buffer="",this._currentPath="",this._currentPathIsEmpty=!0,this.color=new Yt(255,255,255,255),this.lineWidth=1,this.font=new Mt("Arial",10,vr.Plain),this.textAlign=Qe.Left,this.textBaseline=ft.Top}destroy(){}beginRender(e,r){this.buffer=` + `);const s=this.score;s&&(s.artist&&s.title?i.document.title=`${s.title} - ${s.artist}`:s.title&&(i.document.title=`${s.title}`)),i.document.body.appendChild(n);let a=typeof window.screenLeft<"u"?window.screenLeft:window.left,o=typeof window.screenTop<"u"?window.screenTop:window.top,l="innerWidth"in window?window.innerWidth:"clientWidth"in document.documentElement?document.documentElement.clientWidth:window.screen.width,c="innerHeight"in window?window.innerHeight:"clientHeight"in document.documentElement?document.documentElement.clientHeight:window.screen.height,u=n.offsetWidth+50,d=window.innerHeight,h=(l/2|0)-(u/2|0)+a,p=(c/2|0)-(d/2|0)+o;i.resizeTo(u,d),i.moveTo(h,p),i.focus();let f=Ar.jsObjectToSettings(Ar.settingsToJsObject(this.settings));f.core.enableLazyLoading=!1,f.core.useWorkers=!0,f.core.file=null,f.core.tracks=null,f.player.enableCursor=!1,f.player.enablePlayer=!1,f.player.enableElementHighlighting=!1,f.player.enableUserInteraction=!1,f.player.soundFont=null,f.display.scale=.8,f.display.stretchForce=.8,uu.fromJson(f,r);let m=new sy(n,f);i.onunload=()=>{m.destroy()},m.renderer.postRenderFinished.on(()=>{i.print()}),m.renderTracks(this.tracks)}downloadMidi(e=cu.SingleTrackMultiChannel){if(!this.score)return;let r=new Io;r.format=e;let i=new ma(r,!0);new Vt(this.score,this.settings,i).generate();let s=r.toBinary(),a=this.score.title?`${this.score.title}.mid`:"File.mid",o=document.createElement("a");o.download=a;let l=new Blob([s],{type:"audio/midi"}),c=URL.createObjectURL(l);o.href=c,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}changeTrackMute(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackMute(i,r)}changeTrackSolo(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackSolo(i,r)}changeTrackVolume(e,r){let i=this.trackIndexesToTracks(this.uiFacade.parseTracks(e));super.changeTrackVolume(i,r)}trackIndexesToTracks(e){if(!this.score)return[];let r=[];if(e.length===1&&e[0]===-1)for(let i of this.score.tracks)r.push(i);else for(let i of e)i>=0&&i{this.soundFontLoad.trigger(i),this.uiFacade.triggerEvent(this.container,"soundFontLoad",i)})}}class sT{constructor(){this._initListeners=[]}exec(e,r,i){if(typeof r!="string"&&(i=[r],r="init"),r.charCodeAt(0)===95||r==="exec")return null;let n=new jQuery(e),s=n.data("alphaTab");if(r==="destroy"&&!s)return null;if(r!=="init"&&!s)throw new Error("alphaTab not initialized");let a=this[r];if(a){let o=[n,s].concat(i);return a.apply(this,o)}else return he.error("Api","Method '"+r+"' does not exist on jQuery.alphaTab"),null}init(e,r,i){if(!r){r=new sy(e[0],i),e.data("alphaTab",r);for(let n of this._initListeners)n(e,r,i)}}destroy(e,r){e.removeData("alphaTab"),r.destroy()}print(e,r,i,n){r.print(i,n)}load(e,r,i,n){return r.load(i,n)}render(e,r){r.render()}renderScore(e,r,i,n){r.renderScore(i,n)}renderTracks(e,r,i){r.renderTracks(i)}invalidate(e,r){r.render()}tex(e,r,i,n){r.tex(i,n)}muteTrack(e,r,i,n){r.changeTrackMute(i,n)}soloTrack(e,r,i,n){r.changeTrackSolo(i,n)}trackVolume(e,r,i,n){r.changeTrackVolume(i,n)}loadSoundFont(e,r,i,n){r.loadSoundFont(i,n)}resetSoundFonts(e,r){r.resetSoundFonts()}pause(e,r){r.pause()}play(e,r){return r.play()}playPause(e,r){r.playPause()}stop(e,r){r.stop()}api(e,r){return r}player(e,r){return r.player}isReadyForPlayback(e,r){return r.isReadyForPlayback}playerState(e,r){return r.playerState}masterVolume(e,r,i){return typeof i=="number"&&(r.masterVolume=i),r.masterVolume}metronomeVolume(e,r,i){return typeof i=="number"&&(r.metronomeVolume=i),r.metronomeVolume}countInVolume(e,r,i){return typeof i=="number"&&(r.countInVolume=i),r.countInVolume}midiEventsPlayedFilter(e,r,i){return Array.isArray(i)&&(r.midiEventsPlayedFilter=i),r.midiEventsPlayedFilter}playbackSpeed(e,r,i){return typeof i=="number"&&(r.playbackSpeed=i),r.playbackSpeed}tickPosition(e,r,i){return typeof i=="number"&&(r.tickPosition=i),r.tickPosition}timePosition(e,r,i){return typeof i=="number"&&(r.timePosition=i),r.timePosition}loop(e,r,i){return typeof i=="boolean"&&(r.isLooping=i),r.isLooping}renderer(e,r){return r.renderer}score(e,r){return r.score}settings(e,r){return r.settings}tracks(e,r){return r.tracks}_oninit(e){this._initListeners.push(e)}static restore(e){new jQuery(e).empty().removeData("alphaTab")}}class zS{constructor(){this.buffer="",this._currentPath="",this._currentPathIsEmpty=!0,this.color=new Yt(255,255,255,255),this.lineWidth=1,this.font=new Mt("Arial",10,vr.Plain),this.textAlign=Je.Left,this.textBaseline=ft.Top}destroy(){}beginRender(e,r){this.buffer=` `,this._currentPath="",this._currentPathIsEmpty=!0,this.textBaseline=ft.Top}beginGroup(e){this.buffer+=``}endGroup(){this.buffer+=""}endRender(){return this.buffer+="",this.buffer}fillRect(e,r,i,n){i>0&&(this.buffer+=` `)}strokeRect(e,r,i,n){this.buffer+=` -`}beginPath(){}closePath(){this._currentPath+=" z"}moveTo(e,r){this._currentPath+=` M${e},${r}`}lineTo(e,r){this._currentPathIsEmpty=!1,this._currentPath+=` L${e},${r}`}quadraticCurveTo(e,r,i,n){this._currentPathIsEmpty=!1,this._currentPath+=` Q${e},${r},${i},${n}`}bezierCurveTo(e,r,i,n,s,a){this._currentPathIsEmpty=!1,this._currentPath+=` C${e},${r},${i},${n},${s},${a}`}fillCircle(e,r,i){this._currentPathIsEmpty=!1,this._currentPath+=` M${e-i},${r} A1,1 0 0,0 ${e+i},${r} A1,1 0 0,0 ${e-i},${r} z`,this.fill()}strokeCircle(e,r,i){this._currentPathIsEmpty=!1,this._currentPath+=` M${e-i},${r} A1,1 0 0,0 ${e+i},${r} A1,1 0 0,0 ${e-i},${r} z`,this.stroke()}fill(){this._currentPathIsEmpty||(this.buffer+=`${zS.escapeText(e)}`,this.buffer+=n}static escapeText(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}getSvgTextAlignment(e){switch(e){case Qe.Left:return"start";case Qe.Center:return"middle";case Qe.Right:return"end"}return""}getSvgBaseLine(){switch(this.textBaseline){case ft.Top:return'dominant-baseline="hanging"';case ft.Bottom:return'dominant-baseline="bottom"';default:return""}}measureText(e){return e?Vr.measureString(e,this.font.families,this.font.size,this.font.style,this.font.weight):0}onRenderFinished(){return null}beginRotate(e,r,i){this.buffer+=''}endRotate(){this.buffer+=""}}class wJ extends zS{constructor(){super()}fillMusicFontSymbol(e,r,i,n,s){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,`&#${n};`,s)}fillMusicFontSymbols(e,r,i,n,s){let a="";for(let o of n)o!==B.None&&(a+=`&#${o};`);this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s){this.buffer+=`${n}`}}class WS{constructor(){this.isInAccolade=!0,this.isRelevantForBoundsLookup=!0,this.hideOnMultiTrack=!1,this.hideOnPercussionTrack=!1}canCreate(e,r){return!this.hideOnPercussionTrack||!r.isPercussion}}var vt;(function(t){t[t.PreNotes=0]="PreNotes",t[t.OnNotes=1]="OnNotes",t[t.MiddleNotes=2]="MiddleNotes",t[t.Stem=3]="Stem",t[t.PostNotes=4]="PostNotes",t[t.EndBeat=5]="EndBeat"})(vt||(vt={}));class ra extends Dr{get isEmpty(){return!this.glyphs||this.glyphs.length===0}constructor(e,r){super(e,r),this.glyphs=null}doLayout(){if(!this.glyphs||this.glyphs.length===0){this.width=0;return}let e=0;for(let r=0,i=this.glyphs.length;r0?o.beat.graceIndex===0?o.x=n[s-1].x+n[s-1].width:o.x=n[s-1].x+u[o.beat.graceIndex-1].postSpringWidth-u[o.beat.graceIndex-1].preSpringWidth-d:o.x=-d}break}if(s>0){let l=o.x-n[s-1].x;n[s-1].scaleToWidth(l)}if(s===a-1){let l=this.width-n[n.length-1].x;o.scaleToWidth(l)}}}registerLayoutingInfo(e){e.updateVoiceSize(this.width);let r=this.beatGlyphs;for(let i of r)i.registerLayoutingInfo(e)}applyLayoutingInfo(e){let r=this.beatGlyphs;for(let i of r)i.applyLayoutingInfo(e);this.scaleToForce(Math.max(this.renderer.settings.display.stretchForce,e.minStretchForce))}addGlyph(e){let r=e;e.x=this.beatGlyphs.length===0?0:this.beatGlyphs[this.beatGlyphs.length-1].x+this.beatGlyphs[this.beatGlyphs.length-1].width,e.renderer=this.renderer,e.doLayout(),this.beatGlyphs.push(r),this.width=e.x+e.width,r.beat.hasTuplet&&r.beat.tupletGroup.beats[0].id===r.beat.id&&this.tupletGroups.push(r.beat.tupletGroup)}doLayout(){}paint(e,r,i){i.color=this.voice.index===0?this.renderer.resources.mainGlyphColor:this.renderer.resources.secondaryGlyphColor;for(let n=0,s=this.beatGlyphs.length;no)&&(this.maxLine=o,this.maxLineBeat=i),n||this.registerLine(i,o),a}registerLine(e,r){let i;this._beatLines.has(e.id)?i=this._beatLines.get(e.id):(i=new SJ,this._beatLines.set(e.id,i)),(i.minLine===-1e3||ri.maxLine)&&(i.maxLine=r)}getMaxLine(e){return this._beatLines.has(e.id)?this._beatLines.get(e.id).maxLine:0}getMinLine(e){return this._beatLines.has(e.id)?this._beatLines.get(e.id).minLine:0}static calculateNoteLine(e,r,i){let n=r,s=e.masterBar.keySignature,a=e.clef,o=n%12,l=(n/12|0)-1,c=Ir.OctaveSteps[a];c-=l*Ir.StepsPerOctave;let u=er.keySignatureIsSharp(s)||er.keySignatureIsNatural(s)?Ir.SharpNoteSteps:Ir.FlatNoteSteps;return c-=u[o],c}getNoteLine(e){return this._appliedScoreLines.get(e.id)}getNoteLineForValue(e,r=!1){return this._appliedScoreLinesByValue.has(e)?this._appliedScoreLinesByValue.get(e):r&&this._notesByValue.has(e)?this.getNoteLine(this._notesByValue.get(e)):0}}Ir.KeySignatureLookup=[[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0],[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0],[!1,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0],[!1,!0,!0,!0,!0,!1,!1,!1,!0,!0,!0,!0],[!1,!1,!1,!0,!0,!1,!1,!1,!0,!0,!0,!0],[!1,!1,!1,!0,!0,!1,!1,!1,!1,!1,!0,!0],[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0],[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!0,!1,!1,!1,!1,!1],[!0,!0,!1,!1,!1,!0,!0,!1,!1,!1,!1,!1],[!0,!0,!1,!1,!1,!0,!0,!0,!0,!1,!1,!1],[!0,!0,!0,!0,!1,!0,!0,!0,!0,!1,!1,!1],[!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0,!1],[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1],[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]];Ir.AccidentalNotes=[!1,!0,!1,!0,!1,!1,!0,!1,!0,!1,!0,!1];Ir.StepsPerOctave=7;Ir.OctaveSteps=[38,32,30,26,38];Ir.SharpNoteSteps=[0,0,1,1,2,3,3,4,4,5,5,6];Ir.FlatNoteSteps=[0,1,1,2,2,3,4,4,5,5,6,6];class xJ{constructor(){this.staffId="",this.up=0,this.down=0}}class kJ{constructor(){this.startBeat=null,this.startX=0,this.startY=0,this.endBeat=null,this.endX=0,this.endY=0}calcY(e){return this.startX===this.endX?this.startY:(this.endY-this.startY)/(this.endX-this.startX)*(e-this.startX)+this.startY}}class Bn{get isRestBeamHelper(){return this.beats.length===1&&this.beats[0].isRest}get hasLine(){return this.beats.length===1&&this.beats[0].duration>H.Whole}get hasFlag(){return this.beats.length===1&&!this.beats[0].isRest&&(this.beats[0].duration>H.Quarter||this.beats[0].graceType!==Je.None)}constructor(e,r){this._beatLineXPositions=new Map,this._firstNonRestBeat=null,this._lastNonRestBeat=null,this.voice=null,this.beats=[],this.shortestDuration=H.QuadrupleWhole,this.fingeringCount=0,this.hasTuplet=!1,this._firstBeatLowestNoteCompareValue=-1,this._firstBeatHighestNoteCompareValue=-1,this._lastBeatLowestNoteCompareValue=-1,this._lastBeatHighestNoteCompareValue=-1,this.lowestNoteInHelper=null,this._lowestNoteCompareValueInHelper=-1,this.highestNoteInHelper=null,this._highestNoteCompareValueInHelper=-1,this.invertBeamDirection=!1,this.preferredBeamDirection=null,this.isGrace=!1,this.minRestLine=null,this.beatOfMinRestLine=null,this.maxRestLine=null,this.beatOfMaxRestLine=null,this.direction=ve.Up,this.drawingInfos=new Map,this._staff=e,this._renderer=r,this.beats=[]}getBeatLineX(e){return this.hasBeatLineX(e)?this.direction===ve.Up?this._beatLineXPositions.get(e.index).up:this._beatLineXPositions.get(e.index).down:0}hasBeatLineX(e){return this._beatLineXPositions.has(e.index)}registerBeatLineX(e,r,i,n){let s=this.getOrCreateBeatPositions(r);s.staffId=e,s.up=i,s.down=n;for(const a of this.drawingInfos.values())a.startBeat==r?a.startX=this.getBeatLineX(r):a.endBeat==r&&(a.endX=this.getBeatLineX(r))}getOrCreateBeatPositions(e){return this._beatLineXPositions.has(e.index)||this._beatLineXPositions.set(e.index,new xJ),this._beatLineXPositions.get(e.index)}finish(){this.direction=this.calculateDirection()}calculateDirection(){let e=null;if(this.voice?this.preferredBeamDirection!==null?e=this.preferredBeamDirection:this.voice.index>0?e=this.invert(ve.Down):this.voice.bar.isMultiVoice?e=this.invert(ve.Up):this.beats[0].graceType!==Je.None&&(e=this.invert(ve.Up)):e=ve.Up,this.highestNoteInHelper&&this.lowestNoteInHelper){let r=this._renderer.getNoteY(this.highestNoteInHelper,Ge.Center),i=this._renderer.getNoteY(this.lowestNoteInHelper,Ge.Center);if(e===null){const n=(r+i)/2;e=this.invert(this._renderer.middleYPosition=this._lastNonRestBeat.index||this._firstNonRestBeat&&e.index<=this._firstNonRestBeat.index)return;let i=r,n=r;const s=Bn.computeLineHeightsForRest(e.duration);i-=s[0],n+=s[1];const a=this.minRestLine,o=this.maxRestLine;(a===null||a>i)&&(this.minRestLine=i,this.beatOfMinRestLine=e),(o===null||othis.fingeringCount&&(this.fingeringCount=i),this.checkNote(e.minNote),this.checkNote(e.maxNote),this.shortestDurationthis._firstBeatHighestNoteCompareValue)&&(this._firstBeatHighestNoteCompareValue=i)),(this._lastBeatLowestNoteCompareValue===-1||rthis._lastBeatHighestNoteCompareValue)&&(this._lastBeatHighestNoteCompareValue=i),(!this.lowestNoteInHelper||rthis._highestNoteCompareValueInHelper)&&(this.highestNoteInHelper=e,this._highestNoteCompareValueInHelper=i)}static canJoin(e,r){if(!e||!r||e.graceType!==r.graceType||e.graceType===Je.BendGrace||r.graceType===Je.BendGrace)return!1;if(e.graceType!==Je.None&&r.graceType!==Je.None)return!0;let i=e.voice.bar,n=r.voice.bar;if(i!==n)return!1;let s=e.playbackStart,a=r.playbackStart;if(!Bn.canJoinDuration(e.duration)||!Bn.canJoinDuration(r.duration))return s===a;if(e.tupletGroup!==r.tupletGroup)return!1;if(e.hasTuplet&&r.hasTuplet&&e.tupletGroup===r.tupletGroup&&e.tupletGroup.isFull)return!0;let o=lt.QuarterTime;switch(i.masterBar.timeSignatureDenominator){case 8:i.masterBar.timeSignatureNumerator%3===0&&(o+=lt.QuarterTime/2|0);break}let l=(o+s)/o|0|0,c=(o+a)/o|0|0;return l===c}static canJoinDuration(e){switch(e){case H.Whole:case H.Half:case H.Quarter:return!1;default:return!0}}static isFullBarJoin(e,r,i){return er.getIndex(e.duration)-2-i>0&&er.getIndex(r.duration)-2-i>0}get beatOfLowestNote(){return this.lowestNoteInHelper.beat}get beatOfHighestNote(){return this.highestNoteInHelper.beat}isPositionFrom(e,r){return this._beatLineXPositions.has(r.index)?this._beatLineXPositions.get(r.index).staffId===e||!this._beatLineXPositions.get(r.index).staffId:!0}}class CJ{constructor(e,r){this.topY=0,this.bottomY=0,this.topY=e,this.bottomY=r}}class TJ{constructor(e){this.topY=-1e3,this.bottomY=-1e3,this.slots=[],this.beat=e}addSlot(e,r){if(this.slots.push(new CJ(e,r)),this.topY===-1e3)this.topY=e,this.bottomY=r;else{const i=Math.min(e,r),n=Math.max(e,r);ithis.bottomY&&(this.bottomY=n)}}}class _J{constructor(){this.reservedLayoutAreasByDisplayTime=new Map,this.restDurationsByDisplayTime=new Map}getBeatMinMaxY(){let e=-1e3,r=-1e3;for(const i of this.reservedLayoutAreasByDisplayTime.values())e===-1e3?(e=i.topY,r=i.bottomY):(e>i.topY&&(e=i.topY),r0&&this.reservedLayoutAreasByDisplayTime.has(e.playbackStart)){const n=Bn.computeLineHeightsForRest(e.duration).map(u=>u*i);let s=r-n[0],a=r+n[1],o=s;const l=this.reservedLayoutAreasByDisplayTime.get(e.playbackStart);let c=!1;for(const u of l.slots)if(s>=u.topY&&s<=u.bottomY||a>=u.topY&&a<=u.bottomY){c=!0;break}if(c){e.voice.index==1?o=l.topY-n[1]-n[0]:o=l.bottomY;let u=o+n[0]+n[1];const d=i*2;let h=Math.ceil(Math.abs(o-s)/d);return l.addSlot(o,u),o1?this._firstFretSpacing=xi.FretSpacing*e:this._firstFretSpacing=0,this.height=this._textRow+this._fretRow+(xi.Frets-1)*xi.FretSpacing*e+2*xi.Padding*e,this.width=this._firstFretSpacing+(this._chord.staff.tuning.length-1)*xi.StringSpacing*e+2*xi.Padding*e}paint(e,r,i){e+=this.x+xi.Padding*this.scale+this._firstFretSpacing,r+=this.y;let n=this.width-2*xi.Padding*this.scale+this.scale-this._firstFretSpacing,s=xi.StringSpacing*this.scale,a=xi.FretSpacing*this.scale,o=this.renderer.resources,l=xi.CircleRadius*this.scale,c=i.textAlign,u=i.textBaseline;i.font=o.effectFont,i.textAlign=Qe.Center,i.textBaseline=ft.Top,this._chord.showName&&i.fillText(this._chord.name,e+this.width/2,r+o.effectFont.size/2),r+=this._textRow,e+=s/2,i.font=o.fretboardNumberFont,i.textBaseline=ft.Middle;for(let h=0;h1&&(i.textAlign=Qe.Left,i.fillText(this._chord.firstFret.toString(),e-this._firstFretSpacing,r+a/2)),i.fillRect(e,r-this.scale,n,2*this.scale);for(let h=0;h<=xi.Frets;h++){let p=r+h*a;i.fillRect(e,p,n,this.scale)}let d=new Map;for(let h of this._chord.barreFrets){let p=[-1,-1];d.set(h-this._chord.firstFret,p)}for(let h=0;h0){if(p-=this._chord.firstFret,d.has(p)){let y=d.get(p);(y[0]===-1||hy[1])&&(y[1]=h)}let f=r+p*a+a/2+.5*this.scale,m=e+(this._chord.strings.length-h-1)*s;i.fillCircle(m,f,l)}}for(const[h,p]of d){let f=r+h*a+a/2+.5*this.scale,m=e+(this._chord.strings.length-p[1]-1)*s,y=e+(this._chord.strings.length-p[0]-1)*s;i.fillRect(m,f-l,y-m,l*2)}i.textAlign=c,i.textBaseline=u}}xi.Padding=5;xi.Frets=5;xi.CircleRadius=2.5;xi.StringSpacing=10;xi.FretSpacing=12;class oT extends ra{constructor(e,r,i=Qe.Center){super(e,r),this._glyphWidth=0,this.glyphs=[],this._align=i}doLayout(){let e=0;switch(this._align){case Qe.Left:e=0;break;case Qe.Center:e=(this.width-this._glyphWidth)/2;break;case Qe.Right:e=this.width-this._glyphWidth;break}for(let r of this.glyphs)r.x=e,e+=r.width}addGlyphToRow(e){this.glyphs.push(e),this._glyphWidth+=e.width,e.height>this.height&&(this.height=e.height)}}class du extends ra{constructor(e,r,i=Qe.Center){super(e,r),this._rows=[],this.height=0,this.glyphs=[],this._align=i}doLayout(){let e=0,r=0,i=2*du.Padding*this.scale;this._rows=[];let n=new oT(e,r,this._align);n.width=this.width;for(let s of this.glyphs)e+s.width0){let r=new xi(0,0,e);r.renderer=this.renderer,r.doLayout(),this.glyphs.push(r)}}}class Ai extends na{constructor(e,r,i,n,s=Qe.Left){super(e,r),this._lines=i.split(` -`),this.font=n,this.textAlign=s}doLayout(){super.doLayout(),this.height=this.font.size*this._lines.length}paint(e,r,i){let n=i.color;i.color=n,i.font=this.font;let s=i.textAlign;i.textAlign=this.textAlign;let a=r+this.y;for(let o of this._lines)i.fillText(o,e+this.x,a),a+=this.font.size;i.textAlign=s}}class NJ{get staveId(){return this._factory.staffId}constructor(e,r,i){this._sharedLayoutData=new Map,this.barRenderers=[],this.x=0,this.y=0,this.height=0,this.index=0,this.staffIndex=0,this.trackIndex=0,this.staveTop=0,this.topSpacing=20,this.bottomSpacing=5,this.staveBottom=0,this.isFirstInAccolade=!1,this.isLastInAccolade=!1,this._factory=i,this.trackIndex=e,this.modelStaff=r}getSharedLayoutData(e,r){return this._sharedLayoutData.has(e)?this._sharedLayoutData.get(e):r}setSharedLayoutData(e,r){this._sharedLayoutData.set(e,r)}get isInAccolade(){return this._factory.isInAccolade}get isRelevantForBoundsLookup(){return this._factory.isRelevantForBoundsLookup}registerStaffTop(e){this.staveTop=e}registerStaffBottom(e){this.staveBottom=e}addBarRenderer(e){e.staff=this,e.index=this.barRenderers.length,e.reLayout(),this.barRenderers.push(e),this.staveGroup.layout.registerBarRenderer(this.staveId,e)}addBar(e,r){let i;e?i=this._factory.create(this.staveGroup.layout.renderer,e):i=new br(this.staveGroup.layout.renderer,e),i.staff=this,i.index=this.barRenderers.length,i.layoutingInfo=r,i.doLayout(),i.registerLayoutingInfo();const n=i.barDisplayWidth;n>0&&this.staveGroup.layout.systemsLayoutMode==Pn.FromModelWithWidths&&(i.width=n),this.barRenderers.push(i),e&&this.staveGroup.layout.registerBarRenderer(this.staveId,i)}revertLastBar(){let e=this.barRenderers[this.barRenderers.length-1];return this.barRenderers.splice(this.barRenderers.length-1,1),this.staveGroup.layout.unregisterBarRenderer(this.staveId,e),e}scaleToWidth(e){this._sharedLayoutData=new Map;let r=this.topOverflow,i=0;switch(this.staveGroup.layout.systemsLayoutMode){case Pn.Automatic:let s=(e-this.staveGroup.computedWidth)/this.barRenderers.length;for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;let l=o.computedWidth+s;o.scaleToWidth(l),i+=o.width}break;case Pn.FromModelWithScale:e-=this.staveGroup.accoladeSpacing;const a=this.staveGroup.totalBarDisplayScale;for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;const l=o.barDisplayScale*e/a;o.scaleToWidth(l),i+=o.width}break;case Pn.FromModelWithWidths:for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;const l=o.barDisplayWidth;l>0?o.scaleToWidth(l):o.scaleToWidth(o.computedWidth),i+=o.width}break}}get topOverflow(){let e=0;for(let r=0,i=this.barRenderers.length;re&&(e=n.topOverflow)}return e}get bottomOverflow(){let e=0;for(let r=0,i=this.barRenderers.length;re&&(e=n.bottomOverflow)}return e}finalizeStaff(){this.height=0;let e=!1,r=this.topOverflow;for(let i=0;i0&&(this.height+=this.topSpacing+r+this.bottomOverflow+this.bottomSpacing)}paint(e,r,i,n,s){if(!(this.height===0||s===0))for(let a=n,o=Math.min(n+s,this.barRenderers.length);athis.voiceSize&&(this.voiceSize=e,this.version++)}setPreBeatSize(e,r){(!this.preBeatSizes.has(e.id)||this.preBeatSizes.get(e.id)a.longestDuration&&(a.longestDuration=r),a.allDurations.add(r);else{if(a=new lT,a.timePosition=e,a.allDurations.add(r),this._timeSortedSprings.length>0){let c=this._timeSortedSprings[this._timeSortedSprings.length-1];for(const u of c.allDurations)c.timePosition+u}a.longestDuration=r,a.postSpringWidth=s,a.graceBeatWidth=i,a.preBeatWidth=n,this.springs.set(e,a);let o=this._timeSortedSprings,l=o.length-1;for(;l>0&&o[l].timePosition>e;)l--;this._timeSortedSprings.splice(l+1,0,a)}return(this._minTime===-1||this._minTime>e)&&(this._minTime=e),a}addBeatSpring(e,r,i){let n=e.absoluteDisplayStart;if(e.graceType!==Je.None){const s=e.graceGroup.id;this.allGraceRods.has(s)||this.allGraceRods.set(s,new Array(e.graceGroup.beats.length)),!e.graceGroup.isComplete&&!this.incompleteGraceRods.has(s)&&this.incompleteGraceRods.set(s,new Array(e.graceGroup.beats.length));let a=this.allGraceRods.get(s)[e.graceIndex];if(a)a.postSpringWidth=0;n--)r[n].graceBeatWidth=i,i-=r[n].preBeatWidth+r[n].postSpringWidth}this._incompleteGraceRodsWidth=0;for(const e of this.incompleteGraceRods.values())for(const r of e)this._incompleteGraceRodsWidth+=r.preBeatWidth+r.postSpringWidth;this.calculateSpringConstants(),this.version++}calculateSpringConstants(){this._xMin=0;let e=this.springs;for(const n of e.values())n.springWidth0&&(e-=this._timeSortedSprings[0].preSpringWidth),e-=this._incompleteGraceRodsWidth,Math.max(e,0)*this.totalSpringConstant):-1}calculateVoiceWidth(e){let r=0;return this.totalSpringConstant!==-1&&(r=this.calculateWidth(e,this.totalSpringConstant)),this._timeSortedSprings.length>0&&(r+=this._timeSortedSprings[0].preSpringWidth),r+=this._incompleteGraceRodsWidth,r}calculateWidth(e,r){return e/r}buildOnTimePositions(e){if(this.totalSpringConstant===-1)return new Map;if(er.isAlmostEqualTo(this._onTimePositionsForce,e)&&this._onTimePositions)return this._onTimePositions;this._onTimePositionsForce=e;let r=new Map;this._onTimePositions=r;let i=this._timeSortedSprings;if(i.length===0)return r;let n=i[0].preSpringWidth;for(let s=0;s1){let e=this.masterBarsRenderers[this.masterBarsRenderers.length-1];this.masterBarsRenderers.splice(this.masterBarsRenderers.length-1,1);let r=0,i=0;for(let n=0,s=this._allStaves.length;nr&&(r=l);const c=o.barDisplayScale;c>i&&(i=c)}return this.width-=r,this.computedWidth-=r,this.totalBarDisplayScale-=i,e}return null}updateWidthFromLastBar(){let e=0,r=0;for(let i=0,n=this._allStaves.length;ie&&(e=a.computedWidth);const o=a.barDisplayScale;o>r&&(r=o)}return this.width+=e,this.computedWidth+=e,this.totalBarDisplayScale+=r,e}calculateAccoladeSpacing(e){if(!this._accoladeSpacingCalculated&&this.index===0)if(this._accoladeSpacingCalculated=!0,!this.layout.renderer.settings.notation.isNotationElementVisible(tt.TrackNames))this.accoladeSpacing=0;else{let r=this.layout.renderer.canvas,i=this.layout.renderer.settings.display.resources.effectFont;r.font=i;for(let n of e)this.accoladeSpacing=Math.ceil(Math.max(this.accoladeSpacing,r.measureText(n.shortName)));this.accoladeSpacing*=this.layout.scale,this.accoladeSpacing+=2*kh.AccoladeLabelSpacing*this.layout.scale,this.width+=this.accoladeSpacing,this.computedWidth+=this.accoladeSpacing}}getStaveTrackGroup(e){for(let r=0,i=this.staves.length;r0&&n===0){if(i.color=a.barSeparatorColor,this._firstStaffInAccolade&&this._lastStaffInAccolade){let o=r+this._firstStaffInAccolade.y+this._firstStaffInAccolade.staveTop+this._firstStaffInAccolade.topSpacing+this._firstStaffInAccolade.topOverflow,l=r+this._lastStaffInAccolade.y+this._lastStaffInAccolade.topSpacing+this._lastStaffInAccolade.topOverflow+this._lastStaffInAccolade.staveBottom,c=e+this._firstStaffInAccolade.x;i.beginPath(),i.moveTo(c,o),i.lineTo(c,l),i.stroke()}i.font=a.effectFont;for(let o=0,l=this.staves.length;o0?this._firstStaffInAccolade.barRenderers[0].topPadding:0),c=r+this.y+i.y+i.height-i.bottomSpacing-i.bottomOverflow-(i.barRenderers.length>0?i.barRenderers[0].bottomPadding:0),u=s-n,d=c-l,h=o-a,p=this.x+this._firstStaffInAccolade.x,f=new kM;f.visualBounds=new dn,f.visualBounds.x=e,f.visualBounds.y=r+this.y,f.visualBounds.w=this.width,f.visualBounds.h=this.height,f.realBounds=new dn,f.realBounds.x=e,f.realBounds.y=r+this.y,f.realBounds.w=this.width,f.realBounds.h=this.height,this.layout.renderer.boundsLookup.addStaveGroup(f);let m=new Map;for(let y=0;y0)){this.createGlyphs(this._tuning);for(const e of this.glyphs)e.renderer=this.renderer,e.doLayout()}}createGlyphs(e){const r=this.renderer.scale,i=this.renderer.resources;this.height=0;const n=15*r;this._trackLabel.length>0&&(this.addGlyph(new Ai(0,this.height,this._trackLabel,i.effectFont,Qe.Left)),this.height+=n),this.addGlyph(new Ai(0,this.height,e.name,i.effectFont,Qe.Left));const s=64*r;if(this.renderer.scoreRenderer.canvas.font=i.effectFont,this.width=Math.max(this.renderer.scoreRenderer.canvas.measureText(this._trackLabel)*r,Math.max(this.renderer.scoreRenderer.canvas.measureText(e.name)*r,2*s)),this.height+=n,!e.isStandard){const o=ay.CircleNumberHeight*.7*r;let l=Math.ceil(e.tunings.length/2)|0,c=0,u=this.height;for(let d=0,h=e.tunings.length;d0){let i=new ay(0,0,e,r);i.renderer=this.renderer,i.doLayout(),this.glyphs.push(i)}}}class DJ{constructor(e,r){this.args=e,this.renderCallback=r}}var Pn;(function(t){t[t.Automatic=0]="Automatic",t[t.FromModelWithScale=1]="FromModelWithScale",t[t.FromModelWithWidths=2]="FromModelWithWidths"})(Pn||(Pn={}));class NM{constructor(e){this._barRendererLookup=new Map,this.width=0,this.height=0,this.scoreInfoGlyphs=new Map,this.chordDiagrams=null,this.tuningGlyph=null,this.systemsLayoutMode=Pn.Automatic,this._lazyPartials=new Map,this.firstBarIndex=0,this.lastBarIndex=0,this.renderer=e}resize(){this._lazyPartials.clear(),this.doResize()}layoutAndRender(){this._lazyPartials.clear();let e=this.renderer.score,r=this.renderer.settings.display.startBar;r--,r=Math.min(e.masterBars.length-1,Math.max(0,r)),this.firstBarIndex=r;let i=this.renderer.settings.display.barCount;i<0&&(i=e.masterBars.length),i=r+i-1,i=Math.min(e.masterBars.length-1,Math.max(0,i)),this.lastBarIndex=i,this.createScoreInfoGlyphs(),this.doLayoutAndRender()}registerPartial(e,r){this.renderer.settings.core.enableLazyLoading?(this._lazyPartials.set(e.id,new DJ(e,r)),this.renderer.partialLayoutFinished.trigger(e)):(this.renderer.partialLayoutFinished.trigger(e),this.internalRenderLazyPartial(e,r))}internalRenderLazyPartial(e,r){const i=this.renderer.canvas;i.beginRender(e.width,e.height),r(i),e.renderResult=i.endRender(),this.renderer.partialRenderFinished.trigger(e)}renderLazyPartial(e){if(this._lazyPartials.has(e)){const r=this._lazyPartials.get(e);this.internalRenderLazyPartial(r.args,r.renderCallback)}}createScoreInfoGlyphs(){de.debug("ScoreLayout","Creating score info glyphs");let e=this.renderer.settings.notation,r=this.renderer.score,i=this.renderer.settings.display.resources;this.scoreInfoGlyphs=new Map,r.title&&e.isNotationElementVisible(tt.ScoreTitle)&&this.scoreInfoGlyphs.set(tt.ScoreTitle,new Ai(0,0,r.title,i.titleFont,Qe.Center)),r.subTitle&&e.isNotationElementVisible(tt.ScoreSubTitle)&&this.scoreInfoGlyphs.set(tt.ScoreSubTitle,new Ai(0,0,r.subTitle,i.subTitleFont,Qe.Center)),r.artist&&e.isNotationElementVisible(tt.ScoreArtist)&&this.scoreInfoGlyphs.set(tt.ScoreArtist,new Ai(0,0,r.artist,i.subTitleFont,Qe.Center)),r.album&&e.isNotationElementVisible(tt.ScoreAlbum)&&this.scoreInfoGlyphs.set(tt.ScoreAlbum,new Ai(0,0,r.album,i.subTitleFont,Qe.Center)),r.music&&r.music===r.words&&e.isNotationElementVisible(tt.ScoreWordsAndMusic)?this.scoreInfoGlyphs.set(tt.ScoreWordsAndMusic,new Ai(0,0,"Music and Words by "+r.words,i.wordsFont,Qe.Center)):(r.music&&e.isNotationElementVisible(tt.ScoreMusic)&&this.scoreInfoGlyphs.set(tt.ScoreMusic,new Ai(0,0,"Music by "+r.music,i.wordsFont,Qe.Right)),r.words&&e.isNotationElementVisible(tt.ScoreWords)&&this.scoreInfoGlyphs.set(tt.ScoreWords,new Ai(0,0,"Words by "+r.words,i.wordsFont,Qe.Left)));const n=new br(this.renderer,this.renderer.tracks[0].staves[0].bars[0]);if(e.isNotationElementVisible(tt.GuitarTuning)){let s=[];for(let a of this.renderer.tracks)for(let o of a.staves)if(!o.isPercussion&&o.isStringed&&o.tuning.length>0&&o.showTablature){s.push(o);break}if(s.length>0){this.tuningGlyph=new MJ(0,0),this.tuningGlyph.renderer=n;for(const a of s)this.tuningGlyph.addTuning(a.stringTuning,s.length>1?a.track.name:"")}}if(e.isNotationElementVisible(tt.ChordDiagrams)){this.chordDiagrams=new PJ(0,0),this.chordDiagrams.renderer=n;let s=new Set;for(let a of this.renderer.tracks)for(let o of a.staves){const l=o.chords;if(l)for(const[,c]of l)s.has(c.uniqueId)||c.showDiagram&&(s.add(c.uniqueId),this.chordDiagrams.addChord(c))}}}get scale(){return this.renderer.settings.display.scale}createEmptyStaveGroup(){let e=new kh;e.layout=this;for(let r=0;r{c.color=i.mainGlyphColor,c.font=o,c.textAlign=Qe.Left,c.fillText(r,0,n)}),e+s}}var Ge;(function(t){t[t.TopWithStem=0]="TopWithStem",t[t.Top=1]="Top",t[t.Center=2]="Center",t[t.Bottom=3]="Bottom",t[t.BottomWithStem=4]="BottomWithStem"})(Ge||(Ge={}));var Nr;(function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"})(Nr||(Nr={}));class br{get nextRenderer(){return!this.bar||!this.bar.nextBar?null:this.scoreRenderer.layout.getRendererForBar(this.staff.staveId,this.bar.nextBar)}get previousRenderer(){return!this.bar||!this.bar.previousBar?null:this.scoreRenderer.layout.getRendererForBar(this.staff.staveId,this.bar.previousBar)}constructor(e,r){this._preBeatGlyphs=new nd,this._voiceContainers=new Map,this._postBeatGlyphs=new nd,this._ties=[],this.x=0,this.y=0,this.width=0,this.computedWidth=0,this.height=0,this.index=0,this.topOverflow=0,this.bottomOverflow=0,this.isLinkedToPrevious=!1,this.canWrap=!0,this._wasFirstOfLine=!1,this._appliedLayoutingInfo=0,this.isFinalized=!1,this.topPadding=0,this.bottomPadding=0,this.scoreRenderer=e,this.bar=r,r&&(this.helpers=new BJ(this))}registerTies(e){this._ties.push(...e)}get middleYPosition(){return 0}registerOverflowTop(e){return e>this.topOverflow?(this.topOverflow=e,!0):!1}registerOverflowBottom(e){return e>this.bottomOverflow?(this.bottomOverflow=e,!0):!1}scaleToWidth(e){let r=e-this._preBeatGlyphs.width-this._postBeatGlyphs.width;for(const i of this._voiceContainers.values())i.scaleToWidth(r);this._postBeatGlyphs.x=this._preBeatGlyphs.x+this._preBeatGlyphs.width+r,this.width=e}get resources(){return this.settings.display.resources}get settings(){return this.scoreRenderer.settings}get scale(){return this.settings.display.scale}get barDisplayScale(){return this.staff.staveGroup.staves.length>1?this.bar.masterBar.displayScale:this.bar.displayScale}get barDisplayWidth(){return this.staff.staveGroup.staves.length>1?this.bar.masterBar.displayWidth:this.bar.displayWidth}get isFirstOfLine(){return this.index===0}get isLast(){return!this.bar||this.bar.index===this.scoreRenderer.layout.lastBarIndex}registerLayoutingInfo(){let e=this.layoutingInfo,r=this._preBeatGlyphs.width;e.preBeatSize=this.layoutingInfo.version)return!1;this._appliedLayoutingInfo=this.layoutingInfo.version,this._preBeatGlyphs.width=this.layoutingInfo.preBeatSize;let e=this._preBeatGlyphs.x+this._preBeatGlyphs.width;for(const i of this._voiceContainers.values()){i.x=this._preBeatGlyphs.x+this._preBeatGlyphs.width,i.applyLayoutingInfo(this.layoutingInfo);let n=i.x+i.width;e0&&this.scoreRenderer.layout.systemsLayoutMode==Pn.FromModelWithWidths&&(this.width=r,this.computedWidth=r),!0}finalizeRenderer(){this.isFinalized=!0;let e=!1;const r=this.y-this.staff.topSpacing,i=this.y+this.height+this.staff.bottomSpacing;for(const n of this._ties)if(n.doLayout(),n.height>0){const s=n.y+n.height-i;s>0&&this.registerOverflowBottom(s)&&(e=!0);const a=n.y-r;a<0&&this.registerOverflowTop(a*-1)&&(e=!0)}return e}doLayout(){if(this.bar){this.helpers.initialize(),this._ties=[],this._preBeatGlyphs=new nd,this._preBeatGlyphs.renderer=this,this._voiceContainers.clear(),this._postBeatGlyphs=new nd,this._postBeatGlyphs.renderer=this;for(let e=0;ethis.height&&(this.height=r.height)}}createOrResizeGlyph(e,r){let i;switch(e){case Et.FullBar:return i=this.info.createNewGlyph(this.renderer,r),i.renderer=this.renderer,i.beat=r,i.doLayout(),this._effectGlyphs[r.voice.index].set(r.index,i),this._uniqueEffectGlyphs[r.voice.index].push(i),i;case Et.SinglePreBeat:case Et.SingleOnBeat:case Et.SingleOnBeatToEnd:return i=this.info.createNewGlyph(this.renderer,r),i.renderer=this.renderer,i.beat=r,i.doLayout(),this._effectGlyphs[r.voice.index].set(r.index,i),this._uniqueEffectGlyphs[r.voice.index].push(i),i;case Et.GroupedOnBeat:case Et.GroupedOnBeatToEnd:let n=e===Et.GroupedOnBeat?Et.SingleOnBeat:Et.SingleOnBeatToEnd;if(r.index>0||this.renderer.index>0){let s=r.previousBeat;if(this.info.shouldCreateGlyph(this.renderer.settings,s)){let a=null;if(r.index>0&&this._effectGlyphs[r.voice.index].has(s.index))a=this._effectGlyphs[r.voice.index].get(s.index);else if(this.renderer.index>0){let c=this.renderer.previousRenderer.getBand(s.voice,this.info.effectId);if(c){let u=c._effectGlyphs[s.voice.index];u.has(s.index)&&(a=u.get(s.index))}}let o=this.createOrResizeGlyph(n,r);return a&&this.info.canExpand(s,r)&&(a.nextGlyph=o,o.previousGlyph=a,this.isLinkedToPrevious=!0),o}return this.createOrResizeGlyph(n,r)}return this.createOrResizeGlyph(n,r);default:return this.createOrResizeGlyph(Et.SingleOnBeat,r)}}paint(e,r,i){super.paint(e,r,i);for(let n=0,s=this._uniqueEffectGlyphs.length;nthis.shared.height&&(this.shared.height=e.height),(!this.shared.firstBeat||e.firstBeat.isBefore(this.shared.firstBeat))&&(this.shared.firstBeat=e.firstBeat),(!this.shared.lastBeat||e.lastBeat.isAfter(this.shared.lastBeat))&&(this.shared.lastBeat=e.lastBeat)}canBeUsed(e){return(!this.shared.uniqueEffectId&&e.info.canShareBand||e.info.effectId===this.shared.uniqueEffectId)&&(!this.shared.firstBeat||this.shared.lastBeat.isBefore(e.firstBeat)||this.shared.lastBeat.isBefore(this.shared.firstBeat))}}class OJ{constructor(){this.slots=[],this._effectSlot=new Map}getOrCreateSlot(e){if(this._effectSlot.has(e.info.effectId)){let i=this._effectSlot.get(e.info.effectId);if(i.canBeUsed(e))return i}for(let i of this.slots)if(i.canBeUsed(e))return i;let r=new IJ;return this.slots.push(r),r}register(e){let r=this.getOrCreateSlot(e);r.update(e),this._effectSlot.set(e.info.effectId,r)}}class oy extends ra{constructor(){super(0,0),this.computedWidth=0}doLayout(){let e=0;if(this.glyphs)for(let r=0,i=this.glyphs.length;r=0;r--)e(this.container.beat.notes[r])}}class HS extends oy{constructor(){super(...arguments),this.centerX=0}updateBeamingHelper(){}buildBoundingsLookup(e,r,i){}getNoteX(e,r){return 0}getNoteY(e,r){return 0}}class AJ extends br{constructor(e,r,i){super(e,r),this._bands=[],this._bandLookup=new Map,this.sizingInfo=null,this._infos=i}updateSizes(){this.topOverflow=0,this.bottomOverflow=0,this.topPadding=0,this.bottomPadding=0,this.updateHeight(),super.updateSizes()}finalizeRenderer(){let e=super.finalizeRenderer();return this.updateHeight()&&(e=!0),e}updateHeight(){if(!this.sizingInfo)return!1;let e=0;for(let r of this.sizingInfo.slots){r.shared.y=e;for(let i of r.bands)i.y=e,i.height=r.shared.height;e+=r.shared.height}return e!==this.height?(this.height=e,!0):!1}applyLayoutingInfo(){if(!super.applyLayoutingInfo())return!1;if(this.index>0){let e=this.previousRenderer;this.sizingInfo=e.sizingInfo}else this.sizingInfo=new OJ;for(let e of this._bands)e.alignGlyphs(),e.isEmpty||this.sizingInfo.register(e);return this.updateHeight(),!0}scaleToWidth(e){super.scaleToWidth(e);for(let r of this._bands)r.alignGlyphs()}createBeatGlyphs(){this._bands=[],this._bandLookup=new Map;for(let e of this.bar.voices)if(this.hasVoiceContainer(e))for(let r of this._infos){let i=new LJ(e,r);i.renderer=this,i.doLayout(),this._bands.push(i),this._bandLookup.set(e.index+"."+r.effectId,i)}for(let e of this.bar.voices)this.hasVoiceContainer(e)&&this.createVoiceGlyphs(e);for(let e of this._bands)e.isLinkedToPrevious&&(this.isLinkedToPrevious=!0)}createVoiceGlyphs(e){for(let r of e.beats){let i=new Ys(r,this.getVoiceContainer(e));i.preNotes=new oy,i.onNotes=new HS,this.addBeatGlyph(i);for(let n of this._bands)n.createGlyph(r)}}paint(e,r,i){this.paintBackground(e,r,i);for(let n of this._bands)i.color=n.voice.index===0?this.resources.mainGlyphColor:this.resources.secondaryGlyphColor,n.isEmpty||n.paint(e+this.x,r+this.y,i)}getBand(e,r){let i=e.index+"."+r;return this._bandLookup.has(i)?this._bandLookup.get(i):null}}class po extends WS{get staffId(){return this._staffId}constructor(e,r){super(),this._infos=r,this._staffId=e,this.isInAccolade=!1,this.isRelevantForBoundsLookup=!1}create(e,r){return new AJ(e,r,this._infos.filter(i=>e.settings.notation.isNotationElementVisible(i.notationElement)))}}class Ch extends na{constructor(e,r,i){super(e,r),this._endingsString="",this._endings=[];for(let n=0;n0){let s=this.renderer.resources;i.font=s.wordsFont,i.moveTo(e+this.x,r+this.y+this.height),i.lineTo(e+this.x,r+this.y),i.lineTo(e+this.x+this.width,r+this.y),i.stroke(),i.fillText(this._endingsString,e+this.x+Ch.Padding*this.scale,r+this.y*this.scale)}i.textBaseline=n}}Ch.Padding=3;class vi{get effectId(){return this.notationElement.toString()}}class wb extends vi{get notationElement(){return tt.EffectAlternateEndings}get hideOnMultiTrack(){return!0}get canShareBand(){return!1}get sizingMode(){return Et.FullBar}shouldCreateGlyph(e,r){return r.voice.index===0&&r.index===0&&r.voice.bar.masterBar.alternateEndings!==0}createNewGlyph(e,r){return new Ch(0,0,r.voice.bar.masterBar.alternateEndings)}canExpand(e,r){return!0}}class cT extends vi{get notationElement(){return tt.EffectCapo}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return r.index===0&&r.voice.bar.index===0&&r.voice.bar.staff.capo!==0}createNewGlyph(e,r){return new Ai(0,0,"Capo. fret "+r.voice.bar.staff.capo,e.resources.effectFont,Qe.Left)}canExpand(e,r){return!1}}class Sb extends vi{get notationElement(){return tt.EffectChordNames}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return r.hasChord}createNewGlyph(e,r){return new Ai(0,0,r.chord.name,e.resources.effectFont,Qe.Center)}canExpand(e,r){return!1}}class Jh extends na{constructor(e){super(),this.forceGroupedRendering=!1,this.endOnBarLine=!1,this.endPosition=e}get isLinkedWithPrevious(){return!!this.previousGlyph&&this.previousGlyph.renderer.staff.staveGroup===this.renderer.staff.staveGroup}get isLinkedWithNext(){return!!this.nextGlyph&&this.nextGlyph.renderer.isFinalized&&this.nextGlyph.renderer.staff.staveGroup===this.renderer.staff.staveGroup}paint(e,r,i){if(this.isLinkedWithPrevious)return;if(!this.isLinkedWithNext&&!this.forceGroupedRendering){this.paintNonGrouped(e,r,i);return}let n;if(!this.isLinkedWithNext&&this.forceGroupedRendering)n=this;else for(n=this.nextGlyph;n.isLinkedWithNext;)n=n.nextGlyph;let s=n.renderer,a=n.beat,o=this.endPosition,l=e-this.renderer.x,c=this.calculateEndX(s,a,l,o);this.paintGrouped(e,r,c,i)}calculateEndX(e,r,i,n){return r?i+e.x+e.getBeatX(r,n):i+e.x+this.x+this.width}paintNonGrouped(e,r,i){let n=e-this.renderer.x,s=this.calculateEndX(this.renderer,this.beat,n,this.endPosition);this.paintGrouped(e,r,s,i)}}class Th extends Jh{constructor(e,r,i){super(vt.EndBeat),this._crescendo=pn.None,this._crescendo=i,this.x=e,this.y=r}doLayout(){super.doLayout(),this.height=17*this.scale}paintGrouped(e,r,i,n){let s=e+this.x,a=this.height*this.scale;n.beginPath(),this._crescendo===pn.Crescendo?(i-=Th.Padding*this.scale,n.moveTo(i,r+this.y),n.lineTo(s,r+this.y+a/2),n.lineTo(i,r+this.y+a)):(i-=Th.Padding*this.scale,n.moveTo(s,r+this.y),n.lineTo(i,r+this.y+a/2),n.lineTo(s,r+this.y+a)),n.stroke()}}Th.Padding=mt.QuarterNoteHeadWidth/2|0;class uT extends vi{get notationElement(){return tt.EffectCrescendo}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.GroupedOnBeatToEnd}shouldCreateGlyph(e,r){return r.crescendo!==pn.None}createNewGlyph(e,r){return new Th(0,0,r.crescendo)}canExpand(e,r){return e.crescendo===r.crescendo}}class US extends Er{constructor(e,r,i){super(e,r,.6,US.getSymbol(i))}doLayout(){super.doLayout(),this.height=17*this.scale,this.y+=this.height/2}static getSymbol(e){switch(e){case yt.PPP:return B.DynamicPPP;case yt.PP:return B.DynamicPP;case yt.P:return B.DynamicPiano;case yt.MP:return B.DynamicMP;case yt.MF:return B.DynamicMF;case yt.F:return B.DynamicForte;case yt.FF:return B.DynamicFF;case yt.FFF:return B.DynamicFFF;default:return B.None}}}class dT extends vi{get notationElement(){return tt.EffectDynamics}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return this.internalShouldCreateGlyph(r)}internalShouldCreateGlyph(e){if(e.voice.bar.staff.track.score.stylesheet.hideDynamics||e.isEmpty||e.voice.isEmpty||e.isRest||e.graceType!==Je.None)return!1;let r=this.getPreviousDynamicsBeat(e),i=e.voice.index===0&&!r||e.dynamics!==(r==null?void 0:r.dynamics);if(i&&e.voice.index>0){for(let n of e.voice.bar.voices)if(n.index0}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}canExpand(e,r){return!0}}class oo extends Jh{constructor(e){super(vt.OnNotes),this._label=e}doLayout(){this.renderer.settings.notation.extendLineEffectsToBeatEnd&&(this.endPosition=vt.EndBeat,this.forceGroupedRendering=!0),super.doLayout(),this.height=this.renderer.resources.effectFont.size}paintNonGrouped(e,r,i){let n=this.renderer.resources;i.font=n.effectFont;let s=i.textAlign;i.textAlign=Qe.Center,i.fillText(this._label,e+this.x,r+this.y),i.textAlign=s}paintGrouped(e,r,i,n){this.paintNonGrouped(e,r,n);let s=3*this.scale,a=n.measureText(this._label),o=e+this.x+a/2+s,l=r+this.y+4*this.scale,c=8*this.scale;if(i>o){let u=o;for(;uo){let u=o;for(;u0&&r.voice.bar.masterBar.tripletFeel!==r.voice.bar.masterBar.previousMasterBar.tripletFeel)}createNewGlyph(e,r){return new zt(r.voice.bar.masterBar.tripletFeel)}canExpand(e,r){return!0}}class pT extends vi{get notationElement(){return tt.EffectWhammyBar}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.GroupedOnBeat}shouldCreateGlyph(e,r){return r.hasWhammyBar}createNewGlyph(e,r){return new oo("w/bar")}canExpand(e,r){return!0}}class jf extends vi{get notationElement(){return tt.EffectWideBeatVibrato}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.GroupedOnBeatToEnd}shouldCreateGlyph(e,r){return r.vibrato===Dt.Wide}createNewGlyph(e,r){return new EM(Dt.Wide)}canExpand(e,r){return!0}}class Yf extends Jl{get notationElement(){return tt.EffectWideNoteVibrato}shouldCreateGlyphForNote(e){return e.vibrato===Dt.Wide||e.isTieDestination&&e.tieOrigin.vibrato===Dt.Wide}get sizingMode(){return Et.GroupedOnBeatToEnd}createNewGlyph(e,r){return new Hl(0,0,Dt.Wide,1.2)}}class mT{constructor(){this.x=0,this.width=0,this.masterBars=[]}}class Zh extends NM{get name(){return"HorizontalScreen"}constructor(e){super(e),this._group=null,this._pagePadding=null}get supportsResize(){return!1}get firstBarX(){let e=this._pagePadding[0];return this._group&&(e+=this._group.accoladeSpacing),e}doResize(){}doLayoutAndRender(){switch(this._pagePadding=this.renderer.settings.display.padding,this.renderer.settings.display.systemsLayoutMode){case Uo.Automatic:this.systemsLayoutMode=Pn.Automatic;break;case Uo.UseModelLayout:this.systemsLayoutMode=Pn.FromModelWithWidths;break}this._pagePadding||(this._pagePadding=Zh.PagePadding),this._pagePadding.length===1?this._pagePadding=[this._pagePadding[0],this._pagePadding[0],this._pagePadding[0],this._pagePadding[0]]:this._pagePadding.length===2&&(this._pagePadding=[this._pagePadding[0],this._pagePadding[1],this._pagePadding[0],this._pagePadding[1]]);let e=this.renderer.score,r=this.renderer.settings.display.startBar;r--,r=Math.min(e.masterBars.length-1,Math.max(0,r));let i=r,n=this.renderer.settings.display.barCount;n<=0&&(n=e.masterBars.length),n=r+n-1,n=Math.min(e.masterBars.length-1,Math.max(0,n)),this._group=this.createEmptyStaveGroup(),this._group.isLast=!0,this._group.x=this._pagePadding[0],this._group.y=this._pagePadding[1];let s=this.renderer.settings.display.barCountPerPartial,a=[],o=new mT,l=0;for(;i<=n;){let u=this._group.addBars(this.renderer.tracks,i);if(u)if(o.masterBars.length===0&&u.isLinkedToPrevious&&a.length>0){let d=a[a.length-1];d.masterBars.push(e.masterBars[i]),d.width+=u.width,l+=u.width,o.x+=l}else o.masterBars.push(e.masterBars[i]),o.width+=u.width,o.masterBars.length>=s&&(a.length===0&&(o.width+=this._group.accoladeSpacing+this._pagePadding[0]),l+=o.width,a.push(o),de.debug(this.name,"Finished partial from bar "+o.masterBars[0].index+" to "+o.masterBars[o.masterBars.length-1].index,null),o=new mT,o.x=l);i++}o.masterBars.length>0&&(a.length===0&&(o.width+=this._group.accoladeSpacing+this._pagePadding[0]),a.push(o),de.debug(this.name,"Finished partial from bar "+o.masterBars[0].index+" to "+o.masterBars[o.masterBars.length-1].index,null)),this.finalizeGroup(),this.height=Math.floor(this._group.y+this._group.height),this.width=this._group.x+this._group.width+this._pagePadding[2],i=0;let c=0;for(let u=0;u{let y=this._group.getBarX(d.masterBars[0].index)+this._group.accoladeSpacing;f===0&&(y-=this._group.x+this._group.accoladeSpacing),m.color=this.renderer.settings.display.resources.mainGlyphColor,m.textAlign=Qe.Left,de.debug(this.name,"Rendering partial from bar "+d.masterBars[0].index+" to "+d.masterBars[d.masterBars.length-1].index,null),this._group.paintPartial(-y,this._group.y,m,p,d.masterBars.length)}),i+=d.masterBars.length}this.height=this.layoutAndRenderAnnotation(this.height)+this._pagePadding[3]}finalizeGroup(){this._group.scaleToWidth(this._group.width),this._group.finalizeGroup()}}Zh.PagePadding=[20,20,20,20];Zh.GroupSpacing=20;class ef extends NM{get name(){return"PageView"}constructor(e){super(e),this._groups=[],this._allMasterBarRenderers=[],this._barsFromPreviousGroup=[],this._pagePadding=null}doLayoutAndRender(){switch(this.renderer.settings.display.systemsLayoutMode){case Uo.Automatic:this.systemsLayoutMode=Pn.Automatic;break;case Uo.UseModelLayout:this.systemsLayoutMode=Pn.FromModelWithScale;break}this._pagePadding=this.renderer.settings.display.padding,this._pagePadding||(this._pagePadding=ef.PagePadding),this._pagePadding.length===1?this._pagePadding=[this._pagePadding[0],this._pagePadding[0],this._pagePadding[0],this._pagePadding[0]]:this._pagePadding.length===2&&(this._pagePadding=[this._pagePadding[0],this._pagePadding[1],this._pagePadding[0],this._pagePadding[1]]);let e=0;this.width=this.renderer.width,this._allMasterBarRenderers=[],e=this.layoutAndRenderScoreInfo(e,-1),e=this.layoutAndRenderTunings(e,-1),e=this.layoutAndRenderChordDiagrams(e,-1),e=this.layoutAndRenderScore(e),e=this.layoutAndRenderAnnotation(e),this.height=e+this._pagePadding[3]}get supportsResize(){return!0}get firstBarX(){let e=this._pagePadding[0];return this._groups.length>0&&(e+=this._groups[0].accoladeSpacing),e}doResize(){let e=0;this.width=this.renderer.width;let r=this.height;e=this.layoutAndRenderScoreInfo(e,r),e=this.layoutAndRenderTunings(e,r),e=this.layoutAndRenderChordDiagrams(e,r),e=this.resizeAndRenderScore(e,r),e=this.layoutAndRenderAnnotation(e),this.height=e+this._pagePadding[3]}layoutAndRenderTunings(e,r=-1){if(!this.tuningGlyph)return e;let i=this.renderer.settings.display.resources;this.tuningGlyph.x=this._pagePadding[0],this.tuningGlyph.width=this.width,this.tuningGlyph.doLayout();let n=this.tuningGlyph.height+11*this.scale;const s=new kl;return s.x=0,s.y=e,s.width=this.width,s.height=n,s.totalWidth=this.width,s.totalHeight=r<0?e+s.height:r,this.registerPartial(s,a=>{a.color=i.scoreInfoColor,a.textAlign=Qe.Center,this.tuningGlyph.paint(0,0,a)}),e+n}layoutAndRenderChordDiagrams(e,r=-1){if(!this.chordDiagrams)return e;const i=this.renderer.settings.display.resources;this.chordDiagrams.width=this.width,this.chordDiagrams.doLayout();const n=Math.floor(this.chordDiagrams.height),s=new kl;return s.x=0,s.y=e,s.width=this.width,s.height=n,s.totalWidth=this.width,s.totalHeight=r<0?e+n:r,this.registerPartial(s,a=>{a.color=i.scoreInfoColor,a.textAlign=Qe.Center,this.chordDiagrams.paint(0,0,a)}),e+n}layoutAndRenderScoreInfo(e,r=-1){de.debug(this.name,"Layouting score info");const i=new kl;i.x=0,i.y=e;let n=this._pagePadding[1],s=this.scale,a=this.renderer.settings.display.resources,o=[tt.ScoreTitle,tt.ScoreSubTitle,tt.ScoreArtist,tt.ScoreAlbum,tt.ScoreWordsAndMusic];for(let u=0;u{u.color=a.scoreInfoColor,u.textAlign=Qe.Center;for(const d of this.scoreInfoGlyphs.values())d.paint(0,0,u)}),e+n}resizeAndRenderScore(e,r){if(this.renderer.settings.display.barsPerRow>0||this.systemsLayoutMode==Pn.FromModelWithScale)for(let n=0;n1;)o=a.revertLastBar(),n--;a.isFull=!0,a.isLast=this.lastBarIndex===a.lastBarIndex,this._groups.push(a),this.fitGroup(a),e+=this.paintGroup(a,r),a=this.createEmptyStaveGroup(),a.index=this._groups.length,a.x=this._pagePadding[0],a.y=e}}a.isLast=this.lastBarIndex===a.lastBarIndex,this.fitGroup(a),e+=this.paintGroup(a,r)}return e}layoutAndRenderScore(e){let i=this.firstBarIndex,n=this.lastBarIndex;for(this._groups=[];i<=n;){let s=this.createStaveGroup(i,n);this._groups.push(s),s.x=this._pagePadding[0],s.y=e,i=s.lastBarIndex+1,this.fitGroup(s),de.debug(this.name,"Rendering partial from bar "+s.firstBarIndex+" to "+s.lastBarIndex,null),e+=this.paintGroup(s,e)}return e}paintGroup(e,r){let i=Math.floor(e.height+20*this.scale);const n=new kl;return n.x=0,n.y=e.y,n.totalWidth=this.width,n.totalHeight=r,n.width=this.width,n.height=i,n.firstMasterBarIndex=e.firstBarIndex,n.lastMasterBarIndex=e.lastBarIndex,e.buildBoundingsLookup(0,0),this.registerPartial(n,s=>{this.renderer.canvas.color=this.renderer.settings.display.resources.mainGlyphColor,this.renderer.canvas.textAlign=Qe.Left,e.paint(0,-n.y,s)}),r+=i,i}fitGroup(e){e.isFull||e.width>this.maxWidth||this.renderer.settings.display.justifyLastSystem?e.scaleToWidth(this.maxWidth):e.scaleToWidth(e.width),e.finalizeGroup()}getBarsPerRow(e){let r=this.renderer.settings.display.barsPerRow;if(this.systemsLayoutMode==Pn.FromModelWithScale){let i,n;this.renderer.tracks.length>1?(i=this.renderer.score.defaultSystemsLayout,n=this.renderer.score.systemsLayout):(i=this.renderer.tracks[0].defaultSystemsLayout,n=this.renderer.tracks[0].systemsLayout),r=e0)for(let c of this._barsFromPreviousGroup)i.addMasterBarRenderers(this.renderer.tracks,c),o=c.masterBar.index;else{let c=i.addBars(this.renderer.tracks,o);c&&this._allMasterBarRenderers.push(c)}this._barsFromPreviousGroup=[];let l=!1;if((n===-1&&i.width>=s&&i.masterBarsRenderers.length!==0||i.masterBarsRenderers.length===n+1)&&(l=!0),l){let c=i.revertLastBar();if(c)for(this._barsFromPreviousGroup.push(c);c&&!c.canWrap&&i.masterBarsRenderers.length>1;)c=i.revertLastBar(),c&&this._barsFromPreviousGroup.push(c);return i.isFull=!0,i.isLast=!1,this._barsFromPreviousGroup.reverse(),i}i.x=0,o++}return i.isLast=r===i.lastBarIndex,i}get maxWidth(){return this.renderer.width-this._pagePadding[0]-this._pagePadding[2]}}ef.PagePadding=[40,40,40,40];ef.GroupSpacing=20;class Io extends Er{constructor(e,r,i,n=!1){super(e,r,n?mt.GraceScale:1,Io.getMusicSymbol(i)),this._isGrace=n,this._accidentalType=i}static getMusicSymbol(e){switch(e){case $t.Natural:return B.AccidentalNatural;case $t.Sharp:return B.AccidentalSharp;case $t.Flat:return B.AccidentalFlat;case $t.NaturalQuarterNoteUp:return B.AccidentalQuarterToneNaturalArrowUp;case $t.SharpQuarterNoteUp:return B.AccidentalQuarterToneSharpArrowUp;case $t.FlatQuarterNoteUp:return B.AccidentalQuarterToneFlatArrowUp;case $t.DoubleSharp:return B.AccidentalDoubleSharp;case $t.DoubleFlat:return B.AccidentalDoubleFlat}return B.None}doLayout(){switch(this._accidentalType){case $t.DoubleFlat:this.width=18;break;default:this.width=8;break}this.width=this.width*(this._isGrace?mt.GraceScale:1)*this.scale}}class RM extends Dr{constructor(e,r,i){super(e,r),this._number=0,this._number=i}doLayout(){this.renderer.scoreRenderer.canvas.font=this.renderer.resources.barNumberFont,this.width=this.renderer.scoreRenderer.canvas.measureText(this._number.toString())+5*this.scale}paint(e,r,i){if(!this.renderer.staff.isFirstInAccolade)return;let n=this.renderer.resources,s=i.color;i.color=n.barNumberColor,i.font=n.barNumberFont,i.fillText(this._number.toString(),e+this.x,r+this.y),i.color=s}}class MM extends Dr{constructor(e,r){super(e,r)}doLayout(){this.renderer.isLast?this.width=15*this.scale:!this.renderer.nextRenderer||this.renderer.nextRenderer.staff!==this.renderer.staff||!this.renderer.nextRenderer.bar.masterBar.isRepeatStart?(this.width=2*this.scale,this.renderer.bar.masterBar.isDoubleBar&&(this.width+=2*this.scale)):this.width=2*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x,l=a-s;this.renderer.isLast?(i.fillRect(o+this.width-n-n,s,this.scale,l),i.fillRect(o+this.width-n,s,n,l)):(!this.renderer.nextRenderer||this.renderer.nextRenderer.staff!==this.renderer.staff||!this.renderer.nextRenderer.bar.masterBar.isRepeatStart)&&(i.fillRect(o+this.width-this.scale,s,this.scale,l),this.renderer.bar.masterBar.isDoubleBar&&i.fillRect(o+this.width-5*this.scale,s,this.scale,l))}}class jS extends Er{constructor(e,r,i,n){super(e,r,1,jS.getSymbol(i)),this._clef=i,this._clefOttava=n}doLayout(){switch(this._clef){case ot.Neutral:this.width=15*this.scale;break;case ot.C3:case ot.C4:case ot.F4:case ot.G2:this.width=28*this.scale;break}}static getSymbol(e){switch(e){case ot.Neutral:return B.UnpitchedPercussionClef1;case ot.C3:return B.CClef;case ot.C4:return B.CClef;case ot.F4:return B.FClef;case ot.G2:return B.GClef;default:return B.None}}paint(e,r,i){super.paint(e,r,i);let n,s=!1;switch(this._clefOttava){case Ft._15ma:n=new Er(-4*this.scale,0,.5,B.Quindicesima),s=!0;break;case Ft._8va:n=new Er(-2*this.scale,0,.5,B.Ottava),s=!0;break;case Ft._8vb:n=new Er(-6*this.scale,0,.5,B.Ottava);break;case Ft._15mb:n=new Er(-8*this.scale,0,.5,B.Quindicesima);break;default:return}let a=0,o=0;switch(this._clef){case ot.Neutral:a=s?-12:15,o=0;break;case ot.C3:a=s?-19:27,o=0;break;case ot.C4:a=s?-19:27,o=0;break;case ot.F4:a=s?-9:27,o=-4;break;case ot.G2:a=s?-37:30,o=0;break;default:return}n.renderer=this.renderer,n.doLayout();let l=this.width/2;n.paint(e+this.x+l+o*this.scale,r+this.y+a*this.scale,i)}}class DM extends Dr{constructor(e,r){super(e,r)}doLayout(){this.width=11*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x,l=a-s,c=1.5*this.scale,u=(s+a)/2,d=3;i.fillCircle(o,u-c*d,c),i.fillCircle(o,u+c*d,c),o+=4*this.scale,i.beginPath(),i.moveTo(o,s),i.lineTo(o,a),i.stroke(),o+=3*this.scale+.5,i.fillRect(o,s,n,l)}}class LM extends Dr{constructor(e,r,i){super(e,r),this._count=0,this._count=0,this._count=i}doLayout(){this.width=0}paint(e,r,i){let n=this.renderer.resources,s=i.textAlign;i.font=n.barNumberFont,i.textAlign=Qe.Right;let a="x"+this._count,o=i.measureText(a)/1.5;i.fillText(a,e+this.x-o,r+this.y),i.textAlign=s}}class FM extends Dr{constructor(e,r,i,n){super(e,r),this._dotOffset=0,this._circleSize=0,this._dotOffset=0,this._circleSize=0,this._dotOffset=n,this._circleSize=i}doLayout(){this.width=13*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x+.5,l=a-s;i.fillRect(o,s,n,l),o+=n*2-.5,i.beginPath(),i.moveTo(o,s),i.lineTo(o,a),i.stroke(),o+=3*this.scale;let c=this._circleSize*this.scale,u=(s+a)/2;i.fillCircle(o,u-c*this._dotOffset,c),i.fillCircle(o,u+c*this._dotOffset,c)}}class vm extends Er{constructor(e,r,i){super(e,r,1,vm.getSymbol(i))}static getSymbol(e){switch(e){case jr.None:return B.None;case jr.Normal:return B.ArticAccentAbove;case jr.Heavy:return B.ArticMarcatoAbove;default:return B.None}}doLayout(){this.width=9*this.scale,this.height=9*this.scale}paint(e,r,i){super.paint(e-2*this.scale,r+this.height,i)}}class gv extends Dr{constructor(e,r,i){super(e,r),this._size=0,this._size=i}doLayout(){this.width=this._size+3*this.scale}paint(e,r,i){i.fillCircle(e+this.x,r+this.y,this._size)}}class UJ extends Er{constructor(e,r,i){super(e,r,i?mt.GraceScale:1,B.NoteheadXOrnate),this._isGrace=i}doLayout(){this.width=9*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*this.scale}}class wm extends Er{constructor(e,r,i,n){super(e,r,n?mt.GraceScale:1,wm.getSymbol(i)),this._isGrace=n}static getSymbol(e){switch(e){case H.QuadrupleWhole:case H.DoubleWhole:case H.Whole:case H.Half:return B.NoteheadDiamondWhiteWide;default:return B.NoteheadDiamondBlackWide}}doLayout(){this.width=9*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*this.scale}}class hi extends Dr{constructor(e,r,i){super(0,0),this.yOffset=0,this.startNoteRenderer=null,this.endNoteRenderer=null,this.tieDirection=ve.Up,this._startX=0,this._startY=0,this._endX=0,this._endY=0,this._tieHeight=0,this._shouldDraw=!1,this.startBeat=e,this.endBeat=r,this.forEnd=i}doLayout(){if(this.width=0,!this.endBeat){this._shouldDraw=!1;return}let e=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this.startBeat.voice.bar);this.startNoteRenderer=e;let r=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this.endBeat.voice.bar);this.endNoteRenderer=r,this._startX=0,this._endX=0,this._startY=0,this._endY=0,this.height=0,this._shouldDraw=!1,this.tieDirection=e?this.getBeamDirection(this.startBeat,e):this.getBeamDirection(this.endBeat,r),!this.forEnd&&e?(e!==r?(this._startX=e.x+this.getStartX(),this._startY=e.y+this.getStartY()+this.yOffset,!r||e.staff!==r.staff?(this._endX=e.x+e.width,this._endY=this._startY):(this._endX=r.x+this.getEndX(),this._endY=r.y+this.getEndY()+this.yOffset)):(this._startX=e.x+this.getStartX(),this._endX=r.x+this.getEndX(),this._startY=e.y+this.getStartY()+this.yOffset,this._endY=r.y+this.getEndY()+this.yOffset),this._shouldDraw=!0):(!e||e.staff!==r.staff)&&(this._startX=r.x,this._endX=r.x+this.getEndX(),this._startY=r.y+this.getEndY()+this.yOffset,this._endY=this._startY,this._shouldDraw=!0),this._shouldDraw&&(this.y=Math.min(this._startY,this._endY),this.shouldDrawBendSlur()?this._tieHeight=0:(this._tieHeight=this.getTieHeight(this._startX,this._startY,this._endX,this._endY),this.height=hi.calculateActualTieHeight(this.renderer.scale,this._startX,this._startY,this._endX,this._endY,this.tieDirection===ve.Down,this._tieHeight,4).h),this.tieDirection===ve.Up&&(this.y-=this.height))}paint(e,r,i){this._shouldDraw&&(this.shouldDrawBendSlur()?hi.drawBendSlur(i,e+this._startX,r+this._startY,e+this._endX,r+this._endY,this.tieDirection===ve.Down,this.scale):hi.paintTie(i,this.scale,e+this._startX,r+this._startY,e+this._endX,r+this._endY,this.tieDirection===ve.Down,this._tieHeight,4))}shouldDrawBendSlur(){return!1}getTieHeight(e,r,i,n){return 22}getBeamDirection(e,r){return ve.Down}getStartY(){return 0}getEndY(){return 0}getStartX(){return 0}getEndX(){return 0}static calculateActualTieHeight(e,r,i,n,s,a,o,l){const c=hi.computeBezierControlPoints(e,r,i,n,s,a,o,l);r=c[0],i=c[1];const u=c[2],d=c[3];n=c[6],s=c[7];const h=(r-u)/(r-2*u+n),p=hi.calculateExtrema(r,i,u,d,n,s,h),f=p.length>0?Math.min(r,n,p[0]):Math.min(r,n),m=p.length>0?Math.max(r,n,p[0]):Math.max(r,n),y=(i-d)/(i-2*d+s),v=hi.calculateExtrema(r,i,u,d,n,s,y),g=v.length>0?Math.min(i,s,v[1]):Math.min(i,s),b=v.length>0?Math.max(i,s,v[1]):Math.max(i,s),k=new dn;return k.x=f,k.y=g,k.w=m-f,k.h=b-g,k}static calculateExtrema(e,r,i,n,s,a,o){if(o<=0||1<=o)return[];const l=e+(i-e)*o,c=r+(n-r)*o,u=i+(s-i)*o,d=n+(a-n)*o;return[l+(u-l)*o,c+(d-c)*o]}static computeBezierControlPoints(e,r,i,n,s,a,o,l){if(r===n&&i===s)return[];if(nn.line-s.line);let r=null,i=e.getScoreHeight(1);for(let n=0,s=this._infos.length;n0?this._glyphs[0].width:0}paint(e,r,i){super.paint(e,r,i);for(let n of this._glyphs)n.paint(e+this.x,r+this.y,i)}}class jJ{constructor(e,r){this.line=0,this.glyph=e,this.line=r}}class IM extends Dr{constructor(){super(0,0),this._infos=[],this._noteHeadPadding=0,this.minNote=null,this.maxNote=null,this.spacingChanged=new oi,this.upLineX=0,this.downLineX=0,this.displacedX=0,this.noteStartX=0}add(e,r){let i=new jJ(e,r);this._infos.push(i),(!this.minNote||this.minNote.line>i.line)&&(this.minNote=i),(!this.maxNote||this.maxNote.line8}doLayout(){this._infos.sort((o,l)=>l.line-o.line);let e=0,r=!1,i=0,n=!1,s=this.direction,a=0;for(let o=0,l=this._infos.length;o=this.minNote.line;){let d=r+n.getScoreY(u);i.fillRect(e-s+this.noteStartX,d,a,this.scale),u-=2}i.color=c}if(this.hasBottomOverflow){let c=i.color;i.color=n.resources.staffLineColor;let u=10;for(;u<=this.maxNote.line;){let d=r+n.getScoreY(u);i.fillRect(e-s+this.noteStartX,d,a,this.scale),u+=2}i.color=c}let o=this._infos,l=e+this._noteHeadPadding;for(let c of o)c.glyph.renderer=this.renderer,c.glyph.paint(l,r,i)}}class cy extends Er{constructor(e,r,i){super(e,r,1,cy.getSymbol(i))}doLayout(){this.width=12*this.scale}static getSymbol(e){switch(e){case H.ThirtySecond:return B.Tremolo3;case H.Sixteenth:return B.Tremolo2;case H.Eighth:return B.Tremolo1;default:return B.None}}}class YJ extends IM{constructor(){super(),this._noteGlyphLookup=new Map,this._notes=[],this._tremoloPicking=null,this.aboveBeatEffects=new Map,this.belowBeatEffects=new Map}get direction(){return this.beamingHelper.direction}getNoteX(e,r){if(this._noteGlyphLookup.has(e.id)){let i=this._noteGlyphLookup.get(e.id),n=this.x+i.x+this._noteHeadPadding;switch(r){case Nr.Left:break;case Nr.Center:n+=i.width/2;break;case Nr.Right:n+=i.width;break}return n}return 0}getNoteY(e,r){if(this._noteGlyphLookup.has(e.id)){const i=this._noteGlyphLookup.get(e.id);let n=this.y+i.y;switch(r){case Ge.TopWithStem:n-=this.renderer.getStemSize(this.beamingHelper);break;case Ge.Top:n-=i.height/2;break;case Ge.Center:break;case Ge.Bottom:n+=i.height/2;break;case Ge.BottomWithStem:n+=this.renderer.getStemSize(this.beamingHelper);break}return n}return 0}addNoteGlyph(e,r,i){super.add(e,i),this._noteGlyphLookup.set(r.id,e),this._notes.push(r)}updateBeamingHelper(e){this.beamingHelper&&this.beamingHelper.registerBeatLineX("score",this.beat,e+this.x+this.upLineX,e+this.x+this.downLineX)}doLayout(){super.doLayout();let e=this.direction;for(const r of this.aboveBeatEffects.values())r.renderer=this.renderer,r.doLayout();for(const r of this.belowBeatEffects.values())r.renderer=this.renderer,r.doLayout();if(this.beat.isTremolo){let r=0,i=e===ve.Up?this.minNote:this.maxNote,n=e===ve.Up?this.displacedX:0,s=this.beat.tremoloSpeed;switch(s){case H.ThirtySecond:r=e===ve.Up?-15:15;break;case H.Sixteenth:r=e===ve.Up?-12:15;break;case H.Eighth:r=e===ve.Up?-10:10;break;default:r=e===ve.Up?-10:15;break}this._tremoloPicking=new cy(n,i.glyph.y+r*this.scale,s),this._tremoloPicking.renderer=this.renderer,this._tremoloPicking.doLayout()}}buildBoundingsLookup(e,r,i){for(let n of this._notes)if(this._noteGlyphLookup.has(n.id)){let s=this._noteGlyphLookup.get(n.id),a=new VS;a.note=n,a.noteHeadBounds=new dn,a.noteHeadBounds.x=r+this.x+this._noteHeadPadding+s.x,a.noteHeadBounds.y=i+this.y+s.y-s.height/2,a.noteHeadBounds.w=s.width,a.noteHeadBounds.h=s.height,e.addNote(a)}}paint(e,r,i){let n=this.renderer,s=0,a=0,o=1,l=-o;this.beamingHelper.direction===ve.Up?(a=n.getScoreY(this.minNote.line),s=n.getScoreY(this.maxNote.line-2)):(a=n.getScoreY(this.maxNote.line-1),s=n.getScoreY(this.minNote.line+1),l*=-1,o*=-1);for(const c of this.aboveBeatEffects.values())s+=l*c.height,c.paint(e+this.x+2*this.scale,r+this.y+s,i);for(const c of this.belowBeatEffects.values())a+=o*c.height,c.paint(e+this.x+2*this.scale,r+this.y+a,i);super.paint(e,r,i),this._tremoloPicking&&this._tremoloPicking.paint(e,r,i)}}class fu extends Er{constructor(e,r,i){super(e,r,1,fu.getSymbol(i)),this._duration=i}static getSymbol(e){switch(e){case H.QuadrupleWhole:return B.RestLonga;case H.DoubleWhole:return B.RestDoubleWhole;case H.Whole:return B.RestWhole;case H.Half:return B.RestHalf;case H.Quarter:return B.RestQuarter;case H.Eighth:return B.RestEighth;case H.Sixteenth:return B.RestSixteenth;case H.ThirtySecond:return B.RestThirtySecond;case H.SixtyFourth:return B.RestSixtyFourth;case H.OneHundredTwentyEighth:return B.RestOneHundredTwentyEighth;case H.TwoHundredFiftySixth:return B.RestTwoHundredFiftySixth;default:return B.None}}static getSize(e){switch(e){case H.QuadrupleWhole:case H.DoubleWhole:case H.Whole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:return 9;case H.ThirtySecond:return 12;case H.SixtyFourth:return 14;case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:return 20}return 10}doLayout(){this.width=fu.getSize(this._duration)*this.scale}updateBeamingHelper(e){this.beamingHelper&&this.beamingHelper.registerBeatLineX("score",this.beat,e+this.x+this.width/2,e+this.x+this.width/2)}}class gT{constructor(){this.x=0,this.y=-3e3,this.width=0}}class OM extends ra{constructor(){super(0,0)}doLayout(){if(!this.glyphs||this.glyphs.length===0){this.width=0;return}this.glyphs.sort((i,n)=>i.yn.y?1:0);let e=[];e.push(new gT);let r=21*this.scale;for(let i=0,n=this.glyphs.length;is.y;)a++,a===e.length&&e.push(new gT);s.x=a,e[a].y=s.y+r,e[a].width0&&(this._releaseMinValue===-1||i0&&(this._releaseMinValue===-1||i0&&(this._releaseMinValue===-1||i=0&&(n[1].lineValue=r);break;case ze.BendRelease:n[1].lineValue=this._bendMiddleMinValue,r=i.isTieOrigin?this._releaseContinuedMinValue:this._releaseMinValue,r>=0&&(n[2].lineValue=r);break;case ze.Prebend:n[0].lineValue=this._preBendMinValue;break;case ze.PrebendBend:n[0].lineValue=this._preBendMinValue,n[1].lineValue=i.isTieOrigin?this._bendEndContinuedMinValue:this._bendEndMinValue;break;case ze.PrebendRelease:n[0].lineValue=this._preBendMinValue,r=i.isTieOrigin?this._releaseContinuedMinValue:this._releaseMinValue,r>=0&&(n[1].lineValue=r);break}}this.width=0,this._notes.sort((i,n)=>i.isStringed?i.string-n.string:i.realValue-n.realValue)}createRenderingPoints(e){let r=[];switch(e.bendType){case ze.Custom:for(let i of e.bendPoints)r.push(new mo(i.offset,i.value));break;case ze.BendRelease:r.push(new mo(0,e.bendPoints[0].value)),r.push(new mo(Re.MaxPosition/2|0,e.bendPoints[1].value)),r.push(new mo(Re.MaxPosition,e.bendPoints[3].value));break;case ze.Bend:case ze.Hold:case ze.Prebend:case ze.PrebendBend:case ze.PrebendRelease:case ze.Release:r.push(new mo(0,e.bendPoints[0].value)),r.push(new mo(Re.MaxPosition,e.bendPoints[1].value));break}return r}paint(e,r,i){let n=i.color;this._notes.length>1&&(i.color=this.renderer.resources.secondaryGlyphColor);for(let s of this._notes){let a=this._renderPoints.get(s.id),o=this.renderer,l=s,c=!1,u=null,d=!1,h=s.bendStyle===Gt.Gradual?"grad.":"",p=null;for(;l.isTieOrigin;){let b=l.tieDestination;if(u=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,b.beat.voice.bar),!u||o.staff!==u.staff)break;if(l=b,c=!0,l.hasBend||!this.renderer.settings.notation.extendBendArrowsOnTiedNotes){d=!0;break}}p=l.beat,u=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,p.voice.bar),p.isLastOfVoice&&!l.hasBend&&this.renderer.settings.notation.extendBendArrowsOnTiedNotes&&(p=null);let f=0,m=0,y=r+o.y;f=e+o.x,a[0].value>0||s.isContinuedBend?f+=o.getBeatX(s.beat,vt.MiddleNotes):f+=o.getNoteX(s,Nr.Right),!p||p.isLastOfVoice&&!d?m=e+u.x+u.postBeatGlyphsStart:d||!p.nextBeat?m=e+u.x+u.getBeatX(p,vt.MiddleNotes):s.bendType===ze.Hold?m=e+u.x+u.getBeatX(p.nextBeat,vt.OnNotes):m=e+u.x+u.getBeatX(p.nextBeat,vt.PreNotes),c||(m-=hs.ArrowSize*this.scale);let g=(m-f)/Re.MaxPosition;i.beginPath();for(let b=0,k=a.length-1;br.value?(y+g>f&&(y=f-g),l.beginPath(),l.moveTo(m,y),l.lineTo(m-g*.5,y+g),l.lineTo(m+g*.5,y+g),l.closePath(),l.fill(),v=g):i.value!==r.value&&(y0){let b=m,k=hs.DashSize*this.scale,C=h+k;if((b-h)/(k*2)<1)l.moveTo(b,f),l.lineTo(h,f);else for(;b>C;)l.moveTo(b,f),l.lineTo(b-k,f),b-=k*2;l.stroke()}}else m>h?(l.moveTo(h,f),l.bezierCurveTo((h+m)/2,f,m,f,m,y+v),l.stroke()):(l.moveTo(h,f),l.lineTo(m,y),l.stroke());if(o&&r.offsety){let x=Math.abs(f-y);k=x>l.font.size*1.3?f-x/2:f,C=(h+m-b)/2}else k=f,C=m-b;l.fillText(o,C,k)}if(i.value!==0&&r.value!==i.value){let b=i.value,k=i.value>r.value;b=Math.abs(b);let C="";if(b===4)C="full",b-=4;else if(b>=4||b<=-4){let x=b/4|0;C+=x,b-=x*4}if(b>0&&(C+=hs.getFractionSign(b)),C!==""){y=s-p*i.value;let x=y;k||(x=f+Math.abs(y-f)*1/3),l.font=u.tablatureFont;let _=l.measureText(C),P=x-u.tablatureFont.size*.5-2*this.scale,R=m-_/2;l.fillText(C,R,P)}}}static getFractionSign(e){switch(e){case 1:return"¼";case 2:return"½";case 3:return"¾";default:return e+"/ 4"}}}hs.ArrowSize=6;hs.DashSize=3;hs.BendValueHeight=6;class zn extends Dr{constructor(e){super(0,0),this._isSimpleDip=!1,this._beat=e,this._renderPoints=this.createRenderingPoints(e)}createRenderingPoints(e){if(e.whammyBarType===Lt.Custom)return e.whammyBarPoints;let r=[];switch(e.whammyBarType){case Lt.Dive:case Lt.Hold:case Lt.PrediveDive:case Lt.Predive:r.push(new Re(0,e.whammyBarPoints[0].value)),r.push(new Re(Re.MaxPosition,e.whammyBarPoints[1].value));break;case Lt.Dip:r.push(new Re(0,e.whammyBarPoints[0].value)),r.push(new Re(Re.MaxPosition/2|0,e.whammyBarPoints[1].value)),r.push(new Re(Re.MaxPosition,e.whammyBarPoints[e.whammyBarPoints.length-1].value));break}return r}doLayout(){super.doLayout(),this._isSimpleDip=this.renderer.settings.notation.notationMode===si.SongBook&&this._beat.whammyBarType===Lt.Dip;let e=null,r=null,i=this._beat;for(;i&&i.hasWhammyBar;)(!e||e.value>i.minWhammyPoint.value)&&(e=i.minWhammyPoint),(!r||r.value0?Math.abs(this.getOffset(r.value)):0;(n>0||this._beat.whammyBarPoints[0].value!==0||this.renderer.settings.notation.isNotationElementVisible(tt.ZerosOnDiveWhammys))&&(n+=this.renderer.resources.tablatureFont.size*2);let s=e.value<0?Math.abs(this.getOffset(e.value)):0;this.renderer.registerOverflowTop(n+s);let a=this.renderer.staff.getSharedLayoutData(zn.TopOffsetSharedDataKey,-1);n>a&&this.renderer.staff.setSharedLayoutData(zn.TopOffsetSharedDataKey,n)}getOffset(e){if(e===0)return 0;let r=zn.PerHalfSize*this.scale+Math.log2(Math.abs(e)/2)*zn.PerHalfSize*this.scale;return e<0&&(r=-r),r}paint(e,r,i){let n=this.renderer,s=this._beat.nextBeat,a=null,o=vt.PreNotes;s&&(a=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,s.voice.bar),!a||a.staff!==n.staff||a!==n&&!s.hasWhammyBar?(s=null,a=null):o=s.hasWhammyBar&&(n.settings.notation.notationMode!==si.SongBook||s.whammyBarType!==Lt.Dip)?vt.MiddleNotes:vt.PreNotes);let l=0,c=0;this._isSimpleDip?(l=e+n.x+n.getBeatX(this._beat,vt.OnNotes)-2*this.scale,c=e+n.x+n.getBeatX(this._beat,vt.PostNotes)+2*this.scale):(l=e+n.x+n.getBeatX(this._beat,vt.MiddleNotes),c=a?e+a.x+a.getBeatX(s,o):e+n.x+n.width-2*this.scale);let u=i.textAlign;if(i.textAlign=Qe.Center,this._renderPoints.length>=2){let d=(c-l)/Re.MaxPosition;i.beginPath();let h=r+this.renderer.staff.getSharedLayoutData(zn.TopOffsetSharedDataKey,0),p=this._beat.whammyStyle===Gt.Gradual?"grad.":"";for(let f=0,m=this._renderPoints.length-1;fb;)l.moveTo(u,b),l.lineTo(u,b+y),b+=y*2}l.stroke()}else if(r.value===i.value){let y=zn.DashSize*this.scale;if(Math.abs(d-u)/(y*2)<1)l.moveTo(u,h),l.lineTo(d,p);else{let g=Math.max(u,d),b=Math.min(u,d);for(;g>b;)l.moveTo(g,h),l.lineTo(g-y,h),g-=y*2}l.stroke()}else l.moveTo(u,h),l.lineTo(d,p);let f=this.renderer.resources;if(e&&!this._beat.isContinuedWhammy&&!this._isSimpleDip){let y=h;y-=f.tablatureFont.size+2*this.scale,this.renderer.settings.notation.isNotationElementVisible(tt.ZerosOnDiveWhammys)&&l.fillText("0",u,y),c&&(y-=f.tablatureFont.size+2*this.scale,l.fillText(c,u,y))}let m=Math.abs(i.value);if((m!==0||this.renderer.settings.notation.isNotationElementVisible(tt.ZerosOnDiveWhammys)&&!this._isSimpleDip)&&r.value!==i.value){let y="";if(i.value<0&&(y+="-"),m>=4){let b=m/4|0;y+=b,m-=b*4}else m===0&&(y+="0");m>0&&(y+=hs.getFractionSign(m));let v=0;this._isSimpleDip?v=Math.min(h,p)-f.tablatureFont.size-2*this.scale:(v=r.offset===i.offset?Math.min(h,p):p,v-=f.tablatureFont.size+2*this.scale,n&&n.value>i.value&&(v-=2*this.scale));let g=d;l.fillText(y,g,v)}}}zn.TopOffsetSharedDataKey="tab.whammy.topoffset";zn.PerHalfSize=6;zn.DashSize=3;class Nl extends YS{constructor(e){super(0,0),this._beat=e}doLayout(){let e=this.renderer.settings.notation.notationMode;switch(this._beat.whammyBarType){case Lt.None:case Lt.Custom:case Lt.Hold:return;case Lt.Dive:case Lt.PrediveDive:{let r=new hn(this._beat,!1);r.renderer=this.renderer;let i=this._beat.whammyBarPoints[this._beat.whammyBarPoints.length-1];for(let n of this._beat.notes)n.isTieOrigin||r.addGlyph(this.getBendNoteValue(n,i),i.value%2!==0);r.doLayout(),this.BendNoteHeads.push(r)}break;case Lt.Dip:if(e===si.SongBook){let r=this.renderer.resources;this.renderer.simpleWhammyOverflow=r.tablatureFont.size*1.5+Nl.SimpleDipHeight*this.scale+Nl.SimpleDipPadding*this.scale}else{let r=new hn(this._beat,!1);if(r.renderer=this.renderer,this.renderer.settings.notation.notationMode===si.GuitarPro){let n=this._beat.whammyBarPoints[1];for(let s of this._beat.notes)r.addGlyph(this.getBendNoteValue(s,this._beat.whammyBarPoints[1]),n.value%2!==0)}r.doLayout(),this.BendNoteHeads.push(r);let i=new hn(this._beat,!1);if(i.renderer=this.renderer,this.renderer.settings.notation.notationMode===si.GuitarPro){let n=this._beat.whammyBarPoints[this._beat.whammyBarPoints.length-1];for(let s of this._beat.notes)i.addGlyph(this.getBendNoteValue(s,n),n.value%2!==0)}i.doLayout(),this.BendNoteHeads.push(i)}break;case Lt.Predive:break}super.doLayout()}paint(e,r,i){let n=this._beat;switch(n.whammyBarType){case Lt.None:case Lt.Custom:return}let s=this.renderer.settings.notation.notationMode,a=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,n.voice.bar),o=e+a.x+a.getBeatX(n,vt.MiddleNotes),l=this.getTieDirection(n,a),c=this._beat.notes.length===1?l:ve.Up,u=i.textAlign;for(let d=0;d0&&d>=(this._beat.notes.length/2|0)&&(c=ve.Down),c===ve.Down?p+=a.getNoteY(h,Ge.Bottom):p+=a.getNoteY(h,Ge.Top);let f=e+a.x;n.isLastOfVoice?f+=a.width:f+=a.getBeatX(n,vt.EndBeat),f-=8*this.scale;let m=n.whammyStyle===Gt.Gradual&&d===0?"grad.":"",y=null;h.isTieOrigin&&(y=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,h.tieDestination.beat.voice.bar),y&&y.staff===a.staff?f=e+y.x+y.getBeatX(h.tieDestination.beat,vt.MiddleNotes):y=null);let v=mt.NoteHeadHeight*this.scale*mt.GraceScale*.5;c===ve.Up&&(v=-v);let g=n.whammyBarPoints.length>0?this.getBendNoteValue(h,n.whammyBarPoints[n.whammyBarPoints.length-1]):0,b=0,k=!1;switch(this.BendNoteHeads.length>0&&this.BendNoteHeads[0].containsNoteValue(g)?(b=this.BendNoteHeads[0].getNoteValueY(g)+v,k=!0):y&&(h.isTieOrigin&&h.tieDestination.beat.hasWhammyBar||h.beat.isContinuedWhammy)?(b=r+y.y+y.getNoteY(h.tieDestination,Ge.Top),k=!0,c===ve.Down&&(b+=mt.NoteHeadHeight*this.scale)):h.isTieOrigin&&(y?b=r+y.y+y.getNoteY(h.tieDestination,Ge.Top):b=p,c===ve.Down&&(b+=mt.NoteHeadHeight*this.scale)),n.whammyBarType){case Lt.Hold:h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===ve.Down,22,4);break;case Lt.Dive:d===0&&(this.BendNoteHeads[0].x=f-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i),this.BendNoteHeads[0].containsNoteValue(g)&&(b+=this.BendNoteHeads[0].y)),k?this.drawBendSlur(i,o,p,f,b,c===ve.Down,this.scale,m):h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===ve.Down,22,4);break;case Lt.Dip:if(s===si.SongBook){if(d===0){let _=e+a.x+a.getBeatX(this._beat,vt.OnNotes)-2*this.scale,P=e+a.x+a.getBeatX(this._beat,vt.PostNotes)+2*this.scale,R=(_+P)/2,E=((this._beat.whammyBarPoints[1].value-this._beat.whammyBarPoints[0].value)/4|0).toString();i.font=this.renderer.resources.tablatureFont,i.fillText(E,R,r+this.y);let D=r+this.y+i.font.size+2*this.scale,$=D+Nl.SimpleDipHeight*this.scale;this._beat.whammyBarPoints[1].value>this._beat.whammyBarPoints[0].value?(i.moveTo(_,$),i.lineTo(R,D),i.lineTo(P,$)):(i.moveTo(_,D),i.lineTo(R,$),i.lineTo(P,D)),i.stroke()}h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===ve.Down,22,4)}else{let _=(o+f)/2;this.BendNoteHeads[0].x=_-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i);let P=this.getBendNoteValue(h,n.whammyBarPoints[1]),R=this.BendNoteHeads[0].getNoteValueY(P)+v;this.drawBendSlur(i,o,p,_,R,c===ve.Down,this.scale,m),this.BendNoteHeads[1].x=f-this.BendNoteHeads[1].noteHeadOffset,this.BendNoteHeads[1].y=r+a.y,this.BendNoteHeads[1].paint(0,0,i),b=this.BendNoteHeads[1].getNoteValueY(g)+v,this.drawBendSlur(i,_,R,f,b,c===ve.Down,this.scale,m)}break;case Lt.PrediveDive:case Lt.Predive:let C=e+a.x+a.getBeatX(h.beat,vt.PreNotes);C+=a.getPreNotesGlyphForBeat(h.beat).prebendNoteHeadOffset;let x=r+a.y+a.getScoreY(a.accidentalHelper.getNoteLineForValue(h.displayValue-(h.beat.whammyBarPoints[0].value/2|0),!1))+v;this.drawBendSlur(i,C,x,o,p,c===ve.Down,this.scale,m),this.BendNoteHeads.length>0&&(this.BendNoteHeads[0].x=f-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i),this.drawBendSlur(i,o,p,f,b,c===ve.Down,this.scale,m));break}}i.textAlign=u}getBendNoteValue(e,r){return e.displayValueWithoutBend+(r.value/2|0)}}Nl.SimpleDipHeight=zn.PerHalfSize*2;Nl.SimpleDipPadding=2;class fn extends Dr{constructor(e,r,i){super(e,r),this.width=i}}class XJ extends Er{constructor(e,r,i,n,s){super(e,r,s?mt.GraceScale:1,i.getSymbol(n)),this._isGrace=s,this._articulation=i}paint(e,r,i){let n=this._isGrace?this.scale:0;i.fillMusicFontSymbol(e+this.x,r+this.y+n,this.glyphScale*this.scale,this.symbol,!1),this._articulation.techniqueSymbol!==B.None&&this._articulation.techniqueSymbolPlacement===ft.Middle&&i.fillMusicFontSymbol(e+this.x,r+this.y+n,this.glyphScale*this.scale,this._articulation.techniqueSymbol,!1)}doLayout(){let e=(this._isGrace?mt.GraceScale:1)*this.scale;switch(this.symbol){case B.NoteheadWhole:this.width=14;break;case B.NoteheadCircleX:case B.NoteheadDiamondWhite:this.width=9;break;case B.NoteheadHeavyXHat:case B.NoteheadHeavyX:this.width=13;break;default:this.width=10;break}this.width=this.width*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*e}}class yT extends Er{constructor(e,r){super(e,r,mt.GraceScale,B.ArticStaccatoAbove)}doLayout(){this.width=mt.QuarterNoteHeadWidth*this.scale,this.height=7*this.scale}paint(e,r,i){super.paint(e+3*this.scale,r+5*this.scale,i)}}class qJ extends Er{constructor(e,r){super(e,r,.5,B.PictEdgeOfCymbal)}doLayout(){this.width=22*this.scale,this.height=15*this.scale}paint(e,r,i){super.paint(e-3*this.scale,r+this.height,i)}}class KJ extends Er{constructor(e,r){super(e,r,mt.GraceScale,B.GuitarGolpe)}doLayout(){this.width=9*this.scale,this.height=10*this.scale}paint(e,r,i){super.paint(e,r+this.height,i)}}class QJ extends HS{constructor(){super(...arguments),this._collisionOffset=-1e3,this._skipPaint=!1,this.noteHeads=null,this.restGlyph=null}getNoteX(e,r){return this.noteHeads?this.noteHeads.getNoteX(e,r):0}buildBoundingsLookup(e,r,i){this.noteHeads&&this.noteHeads.buildBoundingsLookup(e,r+this.x,i+this.y)}getNoteY(e,r){return this.noteHeads?this.noteHeads.getNoteY(e,r):0}updateBeamingHelper(){if(this.noteHeads)this.noteHeads.updateBeamingHelper(this.container.x+this.x);else if(this.restGlyph&&(this.restGlyph.updateBeamingHelper(this.container.x+this.x),this.renderer.bar.isMultiVoice&&this._collisionOffset===-1e3)){this._collisionOffset=this.renderer.helpers.collisionHelper.applyRestCollisionOffset(this.container.beat,this.restGlyph.y,this.renderer.getScoreHeight(1)),this.y+=this._collisionOffset;const e=this.renderer.helpers.collisionHelper.restDurationsByDisplayTime;e.has(this.container.beat.playbackStart)&&e.get(this.container.beat.playbackStart).has(this.container.beat.playbackDuration)&&e.get(this.container.beat.playbackStart).get(this.container.beat.playbackDuration)!==this.container.beat.id&&(this._skipPaint=!0)}}paint(e,r,i){this._skipPaint||super.paint(e,r,i)}doLayout(){let e=this.renderer;if(!this.container.beat.isEmpty)if(this.container.beat.isRest){let r=Math.ceil((this.renderer.bar.staff.standardNotationLineCount-1)/2)*2;this.container.beat.duration===H.Whole&&this.renderer.bar.staff.standardNotationLineCount!==1&&this.renderer.bar.staff.standardNotationLineCount!==3&&(r-=2);const i=new fu(0,e.getScoreY(r),this.container.beat.duration);if(this.restGlyph=i,i.beat=this.container.beat,i.beamingHelper=this.beamingHelper,this.addGlyph(i),this.renderer.bar.isMultiVoice)if(this.container.beat.voice.index===0){const n=Bn.computeLineHeightsForRest(this.container.beat.duration);let s=i.y-e.getScoreHeight(n[0]),a=i.y+e.getScoreHeight(n[1]);this.renderer.helpers.collisionHelper.reserveBeatSlot(this.container.beat,s,a)}else this.renderer.helpers.collisionHelper.registerRest(this.container.beat);if(this.beamingHelper&&this.beamingHelper.applyRest(this.container.beat,r),this.container.beat.dots>0){this.addGlyph(new fn(0,0,5*this.scale));for(let n=0;n0){this.addGlyph(new fn(0,0,5*this.scale));for(let n=0;n0;){let r=e%10,i=new XS(0,0,r,this._scale);this.addGlyph(i),e=e/10|0}if(this.glyphs){this.glyphs.reverse();let r=0;for(let i=0,n=this.glyphs.length;id.displayValue-u.displayValue);let l=this._beat.graceType===Je.BendGrace?this._beat.nextBeat:this._beat,c=this._notes.length===1?this.getTieDirection(l,n):ve.Up;for(let u=0;u0&&u>=(this._notes.length/2|0)&&(c=ve.Down);let h=r+n.y+n.getNoteY(d,Ge.Top),p=mt.NoteHeadHeight*this.scale*mt.GraceScale*.5;c===ve.Down&&(h+=mt.NoteHeadHeight*this.scale);let f=d.bendStyle===Gt.Gradual?"grad.":"";if(d.isTieOrigin){let m=d.tieDestination,y=m?this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,m.beat.voice.bar):null;if(!y||y.staff!==n.staff){let v=e+n.x+n.width,g=d.tieDestination.realValue;n.accidentalHelper.applyAccidentalForValue(d.beat,g,!1,!0);let b=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(g,!1));d.bendType===ze.Hold||d.bendType===ze.Prebend?hi.paintTie(i,this.scale,s,h,v,b,c===ve.Down,22,4):this.drawBendSlur(i,s,h,v,b,c===ve.Down,this.scale,f)}else{let v=e+y.x+y.getBeatX(m.beat,vt.MiddleNotes),g=r+y.y+y.getNoteY(m,Ge.Top);c===ve.Down&&(g+=mt.NoteHeadHeight*this.scale),d.bendType===ze.Hold||d.bendType===ze.Prebend?hi.paintTie(i,this.scale,s,h,v,g,c===ve.Down,22,4):this.drawBendSlur(i,s,h,v,g,c===ve.Down,this.scale,f)}switch(d.bendType){case ze.Prebend:case ze.PrebendBend:case ze.PrebendRelease:let v=e+n.x+n.getBeatX(d.beat,vt.PreNotes);v+=n.getPreNotesGlyphForBeat(d.beat).prebendNoteHeadOffset;let g=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(d.displayValue-(d.bendPoints[0].value/2|0),!1))+p;this.drawBendSlur(i,v,g,s,h,c===ve.Down,this.scale);break}}else{c===ve.Up&&(p=-p);let m=0,y=0;switch(d.bendType){case ze.Bend:m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this._endNoteGlyph.getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===ve.Down,this.scale,f);break;case ze.BendRelease:let v=this.getBendNoteValue(d,d.bendPoints[1]),g=this._middleNoteGlyph.getNoteValueY(v)+p;this.drawBendSlur(i,s,h,o,g,c===ve.Down,this.scale,f),m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this._endNoteGlyph.getNoteValueY(m)+p,this.drawBendSlur(i,o,g,a,y,c===ve.Down,this.scale,f);break;case ze.Release:this.BendNoteHeads.length>0&&(m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this.BendNoteHeads[0].getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===ve.Down,this.scale,f));break;case ze.Prebend:case ze.PrebendBend:case ze.PrebendRelease:let b=e+n.x+n.getBeatX(d.beat,vt.PreNotes);b+=n.getPreNotesGlyphForBeat(d.beat).prebendNoteHeadOffset;let k=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(d.displayValue-(d.bendPoints[0].value/2|0),!1))+p;this.drawBendSlur(i,b,k,s,h,c===ve.Down,this.scale),this.BendNoteHeads.length>0&&(m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this.BendNoteHeads[0].getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===ve.Down,this.scale,f));break}}}}getBendNoteValue(e,r){return e.displayValueWithoutBend+(r.value/2|0)}}class yv extends hi{constructor(e,r,i=!1){super(e,r,i)}doLayout(){super.doLayout()}getBeamDirection(e,r){if(e.isRest)return ve.Up;switch(r.getBeatDirection(e)){case ve.Up:return ve.Down;default:return ve.Up}}getStartY(){if(this.startBeat.isRest)return this.startNoteRenderer.getScoreY(9);switch(this.tieDirection){case ve.Up:return this.startNoteRenderer.getNoteY(this.startBeat.maxNote,Ge.Top);default:return this.startNoteRenderer.getNoteY(this.startBeat.minNote,Ge.Bottom)}}getEndY(){const e=this.endNoteRenderer;if(this.endBeat.isRest)switch(this.tieDirection){case ve.Up:return e.getScoreY(9);default:return e.getScoreY(0)}const r=this.startNoteRenderer.getBeatDirection(this.startBeat),i=e.getBeatDirection(this.endBeat);if(r!==i&&this.startBeat.graceType===Je.None)if(i===this.tieDirection)switch(this.tieDirection){case ve.Up:return e.getNoteY(this.endBeat.maxNote,Ge.TopWithStem);default:return e.getNoteY(this.endBeat.minNote,Ge.BottomWithStem)}else switch(this.tieDirection){case ve.Up:return e.getNoteY(this.endBeat.maxNote,Ge.BottomWithStem);default:return e.getNoteY(this.endBeat.minNote,Ge.TopWithStem)}switch(this.tieDirection){case ve.Up:return e.getNoteY(this.endBeat.maxNote,Ge.Top);default:return e.getNoteY(this.endBeat.minNote,Ge.Bottom)}}getStartX(){return this.startNoteRenderer.getBeatX(this.startBeat,vt.MiddleNotes)}getEndX(){const e=this.endNoteRenderer.getBeatDirection(this.endBeat);return this.endNoteRenderer.getBeatX(this.endBeat,this.endBeat.duration>H.Whole&&e===this.tieDirection?vt.Stem:vt.MiddleNotes)}}class rZ extends Dr{constructor(e,r,i,n){super(0,0),this._outType=r,this._inType=e,this._startNote=i,this._parent=n}doLayout(){this.width=0}paint(e,r,i){this.paintSlideIn(e,r,i),this.drawSlideOut(e,r,i)}paintSlideIn(e,r,i){let n=this.renderer,s=12*this.scale,a=e+n.x+n.getNoteX(this._startNote,Nr.Left)-2*this.scale,o=r+n.y+n.getNoteY(this._startNote,Ge.Center),l=a-s,c=r+n.y;switch(this._inType){case pi.IntoFromBelow:c+=n.getNoteY(this._startNote,Ge.Bottom);break;case pi.IntoFromAbove:c+=n.getNoteY(this._startNote,Ge.Top);break;default:return}let u=this.getAccidentalsWidth(n,this._startNote.beat);l-=u,a-=u,this.paintSlideLine(i,!1,l,a,c,o)}getAccidentalsWidth(e,r){let i=e.getPreNotesGlyphForBeat(r);return i&&i.accidentals?i.accidentals.width:0}drawSlideOut(e,r,i){let n=this.renderer,s=12*this.scale,a=1*this.scale,o=2*this.scale,l=0,c=0,u=0,d=0,h=!1;switch(this._outType){case ut.Shift:case ut.Legato:if(l=e+n.x+n.getBeatX(this._startNote.beat,vt.PostNotes),c=r+n.y+n.getNoteY(this._startNote,Ge.Center),this._startNote.slideTarget){let p=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this._startNote.slideTarget.beat.voice.bar);!p||p.staff!==n.staff?(u=e+n.x+n.width,d=c):(u=e+p.x+p.getBeatX(this._startNote.slideTarget.beat,vt.PreNotes)-a,d=r+p.y+p.getNoteY(this._startNote.slideTarget,Ge.Center)),this._startNote.slideTarget.realValue>this._startNote.realValue?(c+=o,d-=o):(c-=o,d+=o)}else u=e+n.x+this._parent.x,d=c;break;case ut.OutUp:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,Ge.Center),u=l+s,d=r+n.y+n.getNoteY(this._startNote,Ge.Top);break;case ut.OutDown:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,Ge.Center),u=l+s,d=r+n.y+n.getNoteY(this._startNote,Ge.Bottom);break;case ut.PickSlideUp:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,Ge.Center),d=r+n.y+n.getNoteY(this._startNote,Ge.Top),u=e+n.x+n.width,this._startNote.beat.nextBeat&&this._startNote.beat.nextBeat.voice===this._startNote.beat.voice&&(u=e+n.x+n.getBeatX(this._startNote.beat.nextBeat,vt.PreNotes)),h=!0;break;case ut.PickSlideDown:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,Ge.Center),d=r+n.y+n.getNoteY(this._startNote,Ge.Bottom),u=e+n.x+n.width,this._startNote.beat.nextBeat&&this._startNote.beat.nextBeat.voice===this._startNote.beat.voice&&(u=e+n.x+n.getBeatX(this._startNote.beat.nextBeat,vt.PreNotes)),h=!0;break;default:return}this.paintSlideLine(i,h,l,u,c,d)}paintSlideLine(e,r,i,n,s,a){if(r){let o=new Hl(0,0,Dt.Slight,1.2);o.renderer=this.renderer,o.doLayout(),s-=o.height/2,a-=o.height/2;let l=n-i,c=a-s,u=Math.sqrt(Math.pow(c,2)+Math.pow(l,2));o.width=l;let d=Math.asin(c/u)*(180/Math.PI);e.beginRotate(i,s,d),o.paint(0,0,e),e.endRotate()}else e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.stroke()}}class Xf extends yv{constructor(e,r,i=!1){super(e.beat,r.beat,i),this._startNote=e,this._endNote=r}getTieHeight(e,r,i,n){return Math.log2(i-e+1)*this.renderer.settings.notation.slurHeight}getStartY(){if(this.isStartCentered())switch(this.tieDirection){case ve.Up:return this.startNoteRenderer.getNoteY(this._startNote,Ge.Top);default:return this.startNoteRenderer.getNoteY(this._startNote,Ge.Bottom)}return this.startNoteRenderer.getNoteY(this._startNote,Ge.Center)}getEndY(){if(this.isEndCentered())if(this.isEndOnStem())switch(this.tieDirection){case ve.Up:return this.endNoteRenderer.getNoteY(this._endNote,Ge.TopWithStem);default:return this.endNoteRenderer.getNoteY(this._endNote,Ge.BottomWithStem)}else switch(this.tieDirection){case ve.Up:return this.endNoteRenderer.getNoteY(this._endNote,Ge.Top);default:return this.endNoteRenderer.getNoteY(this._endNote,Ge.Bottom)}else return this.endNoteRenderer.getNoteY(this._endNote,Ge.Center)}isStartCentered(){return this._startNote===this._startNote.beat.maxNote&&this.tieDirection===ve.Up||this._startNote===this._startNote.beat.minNote&&this.tieDirection===ve.Down}isEndCentered(){return this._startNote.beat.graceType===Je.None&&(this._endNote===this._endNote.beat.maxNote&&this.tieDirection===ve.Up||this._endNote===this._endNote.beat.minNote&&this.tieDirection===ve.Down)}isEndOnStem(){const e=this.endNoteRenderer,r=this.startNoteRenderer.getBeatDirection(this.startBeat),i=e.getBeatDirection(this.endBeat);return r!==i&&this.startBeat.graceType===Je.None}getStartX(){return this.isStartCentered()?this.startNoteRenderer.getBeatX(this._startNote.beat,vt.MiddleNotes):this.startNoteRenderer.getNoteX(this._startNote,Nr.Right)}getEndX(){return this.isEndCentered()?this.isEndOnStem()?this.endNoteRenderer.getBeatX(this._endNote.beat,vt.Stem):this.endNoteRenderer.getNoteX(this._endNote,Nr.Center):this.endNoteRenderer.getBeatX(this._endNote.beat,vt.PreNotes)}}class bT extends hi{constructor(e,r,i=!1){super(e?e.beat:null,r?r.beat:null,i),this.startNote=e,this.endNote=r}shouldDrawBendSlur(){return this.renderer.settings.notation.extendBendArrowsOnTiedNotes&&!!this.startNote.bendOrigin&&this.startNote.isTieOrigin}doLayout(){super.doLayout()}getBeamDirection(e,r){switch(r.getBeatDirection(e)){case ve.Up:return ve.Down;default:return ve.Up}}getStartY(){if(this.startBeat.isRest)return this.startNoteRenderer.getScoreY(9);switch(this.tieDirection){case ve.Up:return this.startNoteRenderer.getNoteY(this.startNote,Ge.Top);default:return this.startNoteRenderer.getNoteY(this.startNote,Ge.Bottom)}}getEndY(){const e=this.endNoteRenderer;if(this.endBeat.isRest)switch(this.tieDirection){case ve.Up:return e.getScoreY(9);default:return e.getScoreY(0)}switch(this.tieDirection){case ve.Up:return e.getNoteY(this.endNote,Ge.Top);default:return e.getNoteY(this.endNote,Ge.Bottom)}}getStartX(){return this.startNoteRenderer.getBeatX(this.startNote.beat,vt.PostNotes)}getEndX(){return this.endNoteRenderer.getBeatX(this.endNote.beat,vt.PreNotes)}}class iZ extends Ys{constructor(e,r){super(e,r),this._bend=null,this._effectSlur=null,this._effectEndSlur=null}doLayout(){if(this._effectSlur=null,this._effectEndSlur=null,super.doLayout(),this.beat.isLegatoOrigin){if(!this.beat.previousBeat||!this.beat.previousBeat.isLegatoOrigin){let e=this.beat.nextBeat;for(;e.nextBeat&&e.nextBeat.isLegatoDestination;)e=e.nextBeat;this.addTie(new yv(this.beat,e,!1))}}else if(this.beat.isLegatoDestination&&!this.beat.isLegatoOrigin){let e=this.beat.previousBeat;for(;e.previousBeat&&e.previousBeat.isLegatoOrigin;)e=e.previousBeat;this.addTie(new yv(e,this.beat,!0))}this._bend&&(this._bend.renderer=this.renderer,this._bend.doLayout(),this.updateWidth())}createTies(e){if(e.isVisible){if(e.isTieOrigin&&!e.hasBend&&!e.beat.hasWhammyBar&&e.beat.graceType!==Je.BendGrace&&e.tieDestination&&e.tieDestination.isVisible){let r=new bT(e,e.tieDestination,!1);this.addTie(r)}if(e.isTieDestination&&!e.tieOrigin.hasBend&&!e.beat.hasWhammyBar){let r=new bT(e.tieOrigin,e,!0);this.addTie(r)}if(e.slideInType!==pi.None||e.slideOutType!==ut.None){let r=new rZ(e.slideInType,e.slideOutType,e,this);this.addTie(r)}if(e.isSlurOrigin&&e.slurDestination&&e.slurDestination.isVisible){let r=new Xf(e,e.slurDestination,!1);this.addTie(r)}if(e.isSlurDestination){let r=new Xf(e.slurOrigin,e,!0);this.addTie(r)}if(!this._effectSlur&&e.isEffectSlurOrigin&&e.effectSlurDestination){const r=new Xf(e,e.effectSlurDestination,!1);this._effectSlur=r,this.addTie(r)}if(!this._effectEndSlur&&e.beat.isEffectSlurDestination&&e.beat.effectSlurOrigin){let r=this.onNotes.beamingHelper.direction,i=r===ve.Up?e.beat.effectSlurOrigin.minNote:e.beat.effectSlurOrigin.maxNote,n=r===ve.Up?e.beat.minNote:e.beat.maxNote;const s=new Xf(i,n,!0);this._effectEndSlur=s,this.addTie(s)}if(e.hasBend){if(!this._bend){const r=new tZ(e.beat);this._bend=r,r.renderer=this.renderer,this.addTie(r)}this._bend.addBends(e)}}}}class fs extends br{constructor(e,r){super(e,r),this.simpleWhammyOverflow=0,this._firstLineY=0,this._startSpacing=!1,this.accidentalHelper=new Ir(this)}getBeatDirection(e){return this.helpers.getBeamingHelperForBeat(e).direction}get lineOffset(){return(br.LineSpacing+1)*this.scale}updateSizes(){let e=this.resources,r=e.tablatureFont.size/2+e.tablatureFont.size*.2;this.topPadding=r*this.scale,this.bottomPadding=r*this.scale,this.height=this.lineOffset*4+this.topPadding+this.bottomPadding,this.updateFirstLineY(),super.updateSizes()}updateFirstLineY(){let e=this.lineOffset*4,r=(this.bar.staff.standardNotationLineCount-1)*this.lineOffset;this._firstLineY=(e-r)/2}doLayout(){if(this.updateFirstLineY(),super.doLayout(),!this.bar.isEmpty&&this.accidentalHelper.maxLineBeat){let e=this.getScoreY(-2),r=this.getScoreY(6),i=this.simpleWhammyOverflow;this.registerOverflowTop(i);let n=this.getScoreY(this.accidentalHelper.maxLine),s=this.helpers.getBeamingHelperForBeat(this.accidentalHelper.maxLineBeat);s.direction===ve.Up&&(n-=this.getStemSize(s),n-=s.fingeringCount*this.resources.graceFont.size,s.hasTuplet&&(n-=this.resources.effectFont.size*2)),s.hasTuplet&&(n-=this.resources.effectFont.size*1.5),nr&&this.registerOverflowBottom(Math.abs(a)-r)}}paint(e,r,i){super.paint(e,r,i),this.paintBeams(e,r,i),this.paintTuplets(e,r,i)}paintTuplets(e,r,i){for(let n of this.bar.voices)if(this.hasVoiceContainer(n)){let s=this.getVoiceContainer(n);for(let a of s.tupletGroups)this.paintTupletHelper(e+this.beatGlyphsStart,r,i,a)}}paintBeams(e,r,i){for(let n=0,s=this.helpers.beamHelpers.length;n=0;Q--)if(!n.beats[Q].isRest){y=n.beats[Q];break}let v=!1;m||(m=p,v=!0),y||(y=f);let g=this.helpers.beamHelperLookup[n.voice.index].get(p.index),b=this.helpers.beamHelperLookup[n.voice.index].get(f.index),k=g.getBeatLineX(p),C=b.getBeatLineX(f),x=this.helpers.beamHelperLookup[n.voice.index].get(m.index),_=this.helpers.beamHelperLookup[n.voice.index].get(y.index),P=g.direction,R=this.calculateBeamYWithDirection(x,k,P),E=this.calculateBeamYWithDirection(_,C,P);v&&(R=Math.max(R,E),E=R),i.font=s.effectFont;let D=i.measureText(l),$=3*this.scale,I=(k+C)/2,F=I-D/2-$,M=I+D/2+$,O=(E-R)/(C-k),A=R-O*k,N=O*F+A,V=O*I+A,W=O*M+A;P===ve.Down&&(d*=-1,h*=-1),i.beginPath(),i.moveTo(e+this.x+k,r+this.y+R-d|0),i.lineTo(e+this.x+k,r+this.y+R-d-h|0),i.lineTo(e+this.x+F,r+this.y+N-d-h|0),i.stroke(),i.beginPath(),i.moveTo(e+this.x+M,r+this.y+W-d-h|0),i.lineTo(e+this.x+C,r+this.y+E-d-h|0),i.lineTo(e+this.x+C,r+this.y+E-d|0),i.stroke(),i.fillText(l,e+this.x+I,r+this.y+V-d-h)}i.textAlign=a,i.textBaseline=o}getStemSize(e){let r=e.beats.length===1?this.getFlagStemSize(e.shortestDuration):this.getBarStemSize(e.shortestDuration);return e.isGrace&&(r=r*mt.GraceScale),r}getBarStemSize(e){let r=0;switch(e){case H.QuadrupleWhole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:r=6;break;case H.ThirtySecond:r=8;break;case H.SixtyFourth:r=9;break;case H.OneHundredTwentyEighth:r=9;break;case H.TwoHundredFiftySixth:r=10;break;default:r=0;break}return this.getScoreHeight(r)}getFlagStemSize(e){let r=0;switch(e){case H.QuadrupleWhole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:case H.ThirtySecond:case H.SixtyFourth:case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:r=6;break;default:r=0;break}return this.getScoreHeight(r)}get middleYPosition(){return this.getScoreY(this.bar.staff.standardNotationLineCount-1)}getNoteY(e,r){let i=super.getNoteY(e,r);if(isNaN(i)){const n=Ir.computeLineWithoutAccidentals(this.bar,e);i=this.getScoreY(n)}return i}calculateBeamY(e,r){return this.calculateBeamYWithDirection(e,r,e.direction)}applyLayoutingInfo(){const e=super.applyLayoutingInfo();if(e&&this.bar.isMultiVoice){let r=this.getScoreY(-2),i=this.getScoreY(6),n=this.helpers.collisionHelper.getBeatMinMaxY();n[0]i&&this.registerOverflowBottom(Math.abs(n[1])-i)}return e}calculateBeamYWithDirection(e,r,i){let n=this.getStemSize(e);if(!e.drawingInfos.has(i)){let s=new kJ;e.drawingInfos.set(i,s);const a=e.beats[0],o=e.beats[e.beats.length-1];let l=e.isRestBeamHelper;s.startBeat=a,s.startX=e.getBeatLineX(a),l?s.startY=i===ve.Up?this.getScoreY(e.minRestLine):this.getScoreY(e.maxRestLine):s.startY=i===ve.Up?this.getScoreY(this.accidentalHelper.getMinLine(a))-n:this.getScoreY(this.accidentalHelper.getMaxLine(a))+n,s.endBeat=o,s.endX=e.getBeatLineX(o),l?s.endY=i===ve.Up?this.getScoreY(e.minRestLine):this.getScoreY(e.maxRestLine):s.endY=i===ve.Up?this.getScoreY(this.accidentalHelper.getMinLine(o))-n:this.getScoreY(this.accidentalHelper.getMaxLine(o))+n;let c=10*this.scale;if(i===ve.Down&&s.startY>s.endY&&s.startY-s.endY>c&&(s.endY=s.startY-c),i===ve.Down&&s.endY>s.startY&&s.endY-s.startY>c&&(s.startY=s.endY-c),i===ve.Up&&s.startYc&&(s.endY=s.startY+c),i===ve.Up&&s.endYc&&(s.startY=s.endY+c),e.beats.length>1){if(i===ve.Up){let u=this.getScoreY(this.accidentalHelper.getMinLine(e.beatOfHighestNote))-n;const h=s.calcY(e.getBeatLineX(e.beatOfHighestNote))-u;h>0&&(s.startY-=h,s.endY-=h)}else{let u=this.getScoreY(this.accidentalHelper.getMaxLine(e.beatOfLowestNote))+n;const d=s.calcY(e.getBeatLineX(e.beatOfLowestNote)),h=u-d;h>0&&(s.startY+=h,s.endY+=h)}if(e.minRestLine!==null||e.maxRestLine!==null){const u=er.getIndex(e.shortestDuration)-2;let d=e.isGrace?mt.GraceScale:1,h=u*(br.BeamSpacing+br.BeamThickness)*this.scale*d;if(h+=br.BeamSpacing,i===ve.Up&&e.minRestLine!==null){let p=this.getScoreY(e.minRestLine)-h;const m=s.calcY(e.getBeatLineX(e.beatOfMinRestLine))-p;m>0&&(s.startY-=m,s.endY-=m)}else if(i===ve.Down&&e.maxRestLine!==null){let p=this.getScoreY(e.maxRestLine)+h;const f=s.calcY(e.getBeatLineX(e.beatOfMaxRestLine)),m=p-f;m>0&&(s.startY+=m,s.endY+=m)}}}}return e.drawingInfos.get(i).calcY(r)}paintBar(e,r,i,n){for(let s=0,a=n.beats.length;s0&&!Bn.isFullBarJoin(o,n.beats[s-1],k)&&(C=u-m,x=u,_=R+this.calculateBeamY(n,C),P=R+this.calculateBeamY(n,x),fs.paintSingleBar(i,e+this.x+C,_,e+this.x+x,P,v))}}}static paintSingleBar(e,r,i,n,s,a){e.beginPath(),e.moveTo(r,i),e.lineTo(n,s),e.lineTo(n,s+a),e.lineTo(r,i+a),e.closePath(),e.fill()}paintFlag(e,r,i,n){let s=n.beats[0];if(s.graceType===Je.BendGrace||s.graceType!==Je.None&&this.settings.notation.notationMode===si.SongBook)return;let a=s.graceType!==Je.None,o=a?mt.GraceScale:1,l=this.getFlagStemSize(n.shortestDuration),c=n.getBeatLineX(s),u=n.direction,d=this.getScoreY(this.accidentalHelper.getMinLine(s)),h=this.getScoreY(this.accidentalHelper.getMaxLine(s)),p=0,f=0;if(u===ve.Down?(h+=l*o,p=h,f=r+this.y+h):(d-=l*o,p=d,f=r+this.y+d),this.paintFingering(i,s,e+this.x+c,u,f),!!n.hasLine){if(i.lineWidth=br.StemWidth*this.scale,i.beginPath(),i.moveTo(e+this.x+c,r+this.y+d),i.lineTo(e+this.x+c,r+this.y+h),i.stroke(),i.lineWidth=this.scale,s.graceType===Je.BeforeBeat){let m=15*this.scale,y=12*this.scale;i.beginPath(),u===ve.Down?(i.moveTo(e+this.x+c-y/2,r+this.y+h-m),i.lineTo(e+this.x+c+y/2,r+this.y+h)):(i.moveTo(e+this.x+c-y/2,r+this.y+d+m),i.lineTo(e+this.x+c+y/2,r+this.y+d)),i.stroke()}if(n.hasFlag){let m=new Nu(c-this.scale/2,p,s.duration,u,a);m.renderer=this,m.doLayout(),m.paint(e+this.x,r+this.y,i)}}}paintFingering(e,r,i,n,s){let a=this.settings;if(a.notation.fingeringMode!==ta.ScoreDefault&&a.notation.fingeringMode!==ta.ScoreForcePiano)return;n===ve.Up?i-=10*this.scale:i+=3*this.scale;let o=r.notes.slice(0);o.sort((l,c)=>l.realValue-c.realValue);for(let l=0;l2&&this.addPostBeatGlyph(new LM(0,this.getScoreHeight(-.5),this.bar.masterBar.repeatCount))):this.addPostBeatGlyph(new MM(0,0))}createStartSpacing(){this._startSpacing||(this.addPreBeatGlyph(new fn(0,0,2*this.scale)),this._startSpacing=!0)}createKeySignatureGlyphs(){let e=0,r=this.bar.masterBar.keySignature,i=this.bar.previousBar?this.bar.previousBar.masterBar.keySignature:0;switch(this.bar.clef){case ot.Neutral:e=0;break;case ot.G2:e=1;break;case ot.F4:e=3;break;case ot.C3:e=2;break;case ot.C4:e=0;break}let n=new Map,s=[];if(er.keySignatureIsSharp(r))for(let l=0;lthis._startNote.fret?(l+=a,u-=a):(l-=a,u+=a)}else c=e+n.x+this._parent.x,u=l;break;case ut.OutUp:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,Ge.Center),c=o+s-h,u=r+n.y+n.getNoteY(this._startNote,Ge.Center)-a;break;case ut.OutDown:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,Ge.Center),c=o+s-h,u=r+n.y+n.getNoteY(this._startNote,Ge.Center)+a;break;case ut.PickSlideDown:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,Ge.Center),c=e+n.x+n.getBeatX(this._startNote.beat,vt.EndBeat),u=l+a*3,d=!0;break;case ut.PickSlideUp:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,Ge.Center),c=e+n.x+n.getBeatX(this._startNote.beat,vt.EndBeat),u=l-a*3,d=!0;break;default:return}this.paintSlideLine(i,d,o,c,l,u)}paintSlideLine(e,r,i,n,s,a){if(r){let o=new Hl(0,0,Dt.Slight,1.2);o.renderer=this.renderer,o.doLayout(),s-=o.height/2,a-=o.height/2;let l=n-i,c=a-s,u=Math.sqrt(Math.pow(c,2)+Math.pow(l,2));o.width=l;let d=Math.asin(c/u)*(180/Math.PI);e.beginRotate(i,s,d),o.paint(0,0,e),e.endRotate()}else e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.stroke()}}class Oo extends hi{constructor(e,r,i=!1){super(e.beat,r.beat,i),this.startNote=e,this.endNote=r}getTieHeight(e,r,i,n){return this.startNote===this.endNote?15:super.getTieHeight(e,r,i,n)}getBeamDirection(e,r){return this.startNote===this.endNote?ve.Up:Oo.getBeamDirectionForNote(this.startNote)}static getBeamDirectionForNote(e){return e.string>3?ve.Up:ve.Down}getStartY(){return this.startNote===this.endNote?this.startNoteRenderer.getNoteY(this.startNote,Ge.Center):this.tieDirection===ve.Up?this.startNoteRenderer.getNoteY(this.startNote,Ge.Top):this.startNoteRenderer.getNoteY(this.startNote,Ge.Bottom)}getEndY(){return this.getStartY()}getStartX(){return this.startNote===this.endNote?this.getEndX()-20*this.scale:this.startNoteRenderer.getNoteX(this.startNote,Nr.Center)}getEndX(){return this.startNote===this.endNote?this.endNoteRenderer.getNoteX(this.endNote,Nr.Left):this.endNoteRenderer.getNoteX(this.endNote,Nr.Center)}}class wT extends Oo{constructor(e,r,i,n=!1){super(e,r,n),this._direction=Oo.getBeamDirectionForNote(e),this._forSlide=i}getTieHeight(e,r,i,n){return Math.log(i-e+1)*this.renderer.settings.notation.slurHeight}tryExpand(e,r,i,n){if(this._forSlide!==i||this.forEnd!==n||this.startNote.beat.id!==e.beat.id||this.endNote.beat.id!==r.beat.id||this._direction!==Oo.getBeamDirectionForNote(e))return!1;switch(this._direction){case ve.Up:e.realValue>this.startNote.realValue&&(this.startNote=e,this.startBeat=e.beat),r.realValue>this.endNote.realValue&&(this.endNote=r,this.endBeat=r.beat);break;case ve.Down:e.realValue=0&&(this._noteString=this._noteString.substr(0,i+2)),this._noteString="<"+this._noteString+">"}if(e.isTrill)this._trillNoteString="("+(e.trillFret-e.beat.voice.bar.staff.transpositionPitch).toString()+")";else if(er.isAlmostEqualTo(e.harmonicValue,0))this._trillNoteString="";else switch(e.harmonicType){case Xe.Artificial:case Xe.Pinch:case Xe.Tap:case Xe.Semi:case Xe.Feedback:let i=(r+e.harmonicValue).toString(),n=i.indexOf(".");n>=0&&(i=i.substr(0,n+2)),this._trillNoteString="<"+i+">";break;default:this._trillNoteString="";break}this.isEmpty=!this._noteString,this.isEmpty||(this.renderer.scoreRenderer.canvas.font=this.renderer.resources.tablatureFont,this.noteStringWidth=this.renderer.scoreRenderer.canvas.measureText(this._noteString)*this.scale,this.width=this.noteStringWidth,this.height=this.renderer.scoreRenderer.canvas.font.size,this._trillNoteString&&(this.renderer.scoreRenderer.canvas.font=this.renderer.resources.graceFont,this._trillNoteStringWidth=3*this.scale+this.renderer.scoreRenderer.canvas.measureText(this._trillNoteString),this.width+=this._trillNoteStringWidth))}paint(e,r,i){if(this.isEmpty)return;let n=this.noteStringWidth+this._trillNoteStringWidth,s=e+this.x+(this.width-n)/2,a=this.renderer.scoreRenderer.canvas.font;this.renderer.scoreRenderer.canvas.font=this.renderer.resources.graceFont,i.fillText(this._trillNoteString,s+this.noteStringWidth+3*this.scale,r+this.y),this.renderer.scoreRenderer.canvas.font=a,i.fillText(this._noteString,s,r+this.y)}buildBoundingsLookup(e,r,i){let n=new VS;n.note=this._note,n.noteHeadBounds=new dn,n.noteHeadBounds.x=r+this.x,n.noteHeadBounds.y=i+this.y-this.height/2,n.noteHeadBounds.w=this.width,n.noteHeadBounds.h=this.height,e.addNote(n)}}class oZ extends Dr{constructor(e,r,i){super(e,r),this._notes=[],this.minStringNote=null,this.beatEffects=new Map,this.notesPerString=new Map,this.noteStringWidth=0,this._isGrace=i}buildBoundingsLookup(e,r,i){for(const n of this._notes)n.buildBoundingsLookup(e,r+this.x,i+this.y)}getNoteX(e,r){if(this.notesPerString.has(e.string)){let i=this.notesPerString.get(e.string),n=this.x+i.x;switch(r){case Nr.Left:break;case Nr.Center:n+=i.noteStringWidth/2;break;case Nr.Right:n+=i.width;break}return n}return 0}getNoteY(e,r){if(this.notesPerString.has(e.string)){const i=this.notesPerString.get(e.string);let n=this.y+i.y;switch(r){case Ge.Top:case Ge.TopWithStem:n-=i.height/2+2*this.scale;break;case Ge.Center:break;case Ge.Bottom:case Ge.BottomWithStem:n+=i.height/2;break}return n}return 0}doLayout(){let e=0,r=0;for(let a=0,o=this._notes.length;ae&&(e=l.width),l.noteStringWidth>r&&(r=l.noteStringWidth)}this.noteStringWidth=r;let i=this.renderer.resources.tablatureFont.size,n=this.getNoteY(this.minStringNote,Ge.Center)+i/2,s=7*this.scale;for(const a of this.beatEffects.values())a.y+=n,a.x+=this.width/2,a.renderer=this.renderer,n+=s,a.doLayout();this.width=e}addNoteGlyph(e,r){this._notes.push(e),this.notesPerString.set(r.string,e),(!this.minStringNote||r.string0&&e.showRests){this.addGlyph(new fn(0,0,5*this.scale));for(let a=0;a0&&e.settings.notation.rhythmMode!==za.Hidden){this.addGlyph(new fn(0,0,5*this.scale));for(let s=0;s0){e=!0;break}e&&(this._tupletSize=this.resources.effectFont.size*.8,this.registerOverflowBottom(this._tupletSize))}}createPreBeatGlyphs(){if(super.createPreBeatGlyphs(),this.bar.masterBar.isRepeatStart&&this.addPreBeatGlyph(new FM(0,0,1.5,3)),this.isFirstOfLine){let e=(this.bar.staff.tuning.length-1)/2;this.addPreBeatGlyph(new hZ(5*this.scale,this.getTabY(e)))}this.showTimeSignature&&(!this.bar.previousBar||this.bar.previousBar&&this.bar.masterBar.timeSignatureNumerator!==this.bar.previousBar.masterBar.timeSignatureNumerator||this.bar.previousBar&&this.bar.masterBar.timeSignatureDenominator!==this.bar.previousBar.masterBar.timeSignatureDenominator)&&(this.createStartSpacing(),this.createTimeSignatureGlyphs()),this.addPreBeatGlyph(new RM(0,this.getTabHeight(-.5),this.bar.index+1))}createStartSpacing(){this._startSpacing||(this.addPreBeatGlyph(new fn(0,0,2*this.scale)),this._startSpacing=!0)}createTimeSignatureGlyphs(){this.addPreBeatGlyph(new fn(0,0,5*this.scale));const e=(this.bar.staff.tuning.length+1)/2-1;this.addPreBeatGlyph(new fZ(0,this.getTabY(e),this.bar.masterBar.timeSignatureNumerator,this.bar.masterBar.timeSignatureDenominator,this.bar.masterBar.timeSignatureCommon))}createVoiceGlyphs(e){for(let r=0,i=e.beats.length;r2&&this.addPostBeatGlyph(new LM(0,this.getTabY(-1),this.bar.masterBar.repeatCount))):this.addPostBeatGlyph(new MM(0,0))}getTabY(e){return this._firstLineY+this.getTabHeight(e)}getTabHeight(e){return this.lineOffset*e}get middleYPosition(){return this.getTabY(this.bar.staff.tuning.length-1)}paintBackground(e,r,i){super.paintBackground(e,r,i);let n=this.resources;i.color=n.staffLineColor;let s=this.scale,a=[];for(let o=0,l=this.bar.staff.tuning.length;ol[0]>c[0]?1:l[0]0&&!Bn.isFullBarJoin(o,n.beats[s-1],v)&&(g=l-h,b=l,k=x,C=x,Ha.paintSingleBar(i,e+this.x+g,k,e+this.x+b,C,f))}}}}paintTupletHelper(e,r,i,n){let s=this.resources,a=i.textAlign,o=i.textBaseline;i.color=n.voice.index===0?this.resources.mainGlyphColor:this.resources.secondaryGlyphColor,i.textAlign=Qe.Center,i.textBaseline=ft.Middle;let l,c=n.beats[0].tupletNumerator,u=n.beats[0].tupletDenominator;if(c===2&&u===3?l="2":c===3&&u===2?l="3":c===4&&u===6?l="4":c===5&&u===4?l="5":c===6&&u===4?l="6":c===7&&u===4?l="7":c===9&&u===8?l="9":c===10&&u===8?l="10":c===11&&u===8?l="11":c===12&&u===8?l="12":c===13&&u===8?l="13":l=c+":"+u,n.beats.length===1||!n.isFull)for(let d=0,h=n.beats.length;dc.topY-u.topY));let l=s;for(;l>n;){a.moveTo(i,l);let c=n;if(o.length>0&&o[o.length-1].bottomY>c){const u=o.pop();c=r+u.bottomY,a.lineTo(i,c),l=r+u.topY}else{a.lineTo(i,c);break}}a.stroke()}paintFooter(e,r,i,n){for(let s of n.beats){if(s.graceType!==Je.None||s.duration===H.Whole||s.duration===H.DoubleWhole||s.duration===H.QuadrupleWhole)return;let a=n.getBeatLineX(s),o=r+this.y,l=r+this.y+this.height-this._tupletSize,c=this.getOnNotesGlyphForBeat(s);if(!c.noteNumbers||s.duration===H.Half?o+=this.height-this.settings.notation.rhythmHeight*this.settings.display.scale-this._tupletSize:o+=c.noteNumbers.getNoteY(c.noteNumbers.minStringNote,Ge.Bottom),this.paintBeamingStem(s,r+this.y,e+this.x+a,o,l,i),s.duration>H.Quarter){let u=new Nu(0,0,s.duration,ve.Down,!1);u.renderer=this,u.doLayout(),u.paint(e+this.x+a,l,i)}}}}Ha.StaffId="tab";Ha.TabLineSpacing=10;class Mb extends WS{get staffId(){return Ha.StaffId}constructor(e,r,i){super(),this._showTimeSignature=e,this._showRests=r,this._showTiedNotes=i,this.hideOnPercussionTrack=!0}canCreate(e,r){return r.tuning.length>0&&super.canCreate(e,r)}create(e,r){let i=new Ha(e,r);return i.showRests=this._showRests,i.showTimeSignature=this._showTimeSignature,i.showTiedNotes=this._showTiedNotes,i}}class Bh extends na{constructor(){super(0,0)}doLayout(){super.doLayout();const e=this.renderer.resources.effectFont;this.height=e.size+Bh.Padding*this.scale}paint(e,r,i){let n=this.renderer.resources;i.font=n.effectFont;let s=i.textAlign;i.textAlign=Qe.Center,i.fillText("T",e+this.x,r+this.y+i.font.size/2),i.textAlign=s,i.strokeCircle(e+this.x,r+this.y+i.font.size/2+(Bh.Padding-1)*this.scale,i.font.size/1.6)}}Bh.Padding=4;class qf extends Jl{get notationElement(){return tt.EffectTap}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyphForNote(e){return e.isLeftHandTapped}createNewGlyph(e,r){return new Bh}}class lo{constructor(){this.noteRange=1,this.x=0,this.y=0}}var Cl;(function(t){t[t.None=0]="None",t[t.Rectangle=1]="Rectangle",t[t.Ellipse=2]="Ellipse",t[t.Circle=3]="Circle"})(Cl||(Cl={}));class Db extends lo{constructor(){super(...arguments),this.align=Qe.Left,this.frame=Cl.None,this.text="",this.fontFace="",this.weight=0,this.height=0}}class ST extends lo{constructor(){super(...arguments),this.chord=new Wo}}class xT extends lo{}class kT extends lo{}class pZ extends lo{constructor(){super(...arguments),this.number=0}}class CT extends lo{constructor(){super(...arguments),this.decrescendo=!1}}class Lb extends lo{constructor(){super(...arguments),this.allNumbers=!1,this.firstNumber=0,this.lastNumber=0}}class mZ extends lo{constructor(){super(...arguments),this.octave=1}}class gZ extends lo{}class yZ{constructor(){this.defaultClef=ot.G2,this.description="",this.percussion=!1,this.instrument=0,this.volume=0,this.transpose=0,this.index=0}}class bZ{constructor(){this.from=0,this.to=0,this.curly=!1}}class vZ{constructor(){this.currentBarIndex=-1,this.currentBarComplete=!0,this.currentBarDuration=0,this.currentPosition=0,this.voiceStemDir=null,this.repeatCount=0,this.repeatEnd=null}}class xm{constructor(){this._trackChannel=0,this._beamingMode=js.Auto,this._isFirstSystem=!0,this._staffLookup=new Map,this._brackets=[],this._staffLayoutLookup=new Map,this._staffLayouts=[],this._timeSignature=new eo,this._voiceStates=new Map}parseXml(e,r){this._galleryObjects=new Map,this._tieStarts=[],this._tieStartIds=new Map,this._voiceCounts=new Map,this._slurs=new Map,this._crescendo=new Map,this._isFirstSystem=!0;let i=new FS;try{i.parse(e)}catch(n){throw new Gr("Could not parse XML",n)}this.parseDom(i),this.consolidate(),this.score.finish(r)}consolidate(){let e=this.score.tempo;for(const r of this.score.tracks){const i=this._voiceCounts.get(r.index);for(const n of r.staves){for(;n.bars.length{i.isLegatoOrigin=!0}),xm.applyEffectRange(this._crescendo,(r,i)=>{i.crescendo=r.decrescendo?pn.Decrescendo:pn.Crescendo})}static applyEffectRange(e,r){for(const[i,n]of e){const s=n.noteRange;let a=i;for(let o=0;o!!s.curly);r.sort((s,a)=>s.from-a.from);let i=0,n=null;for(let s=0;sr[i].to;)i++;n&&ir[i].from&&s<=r[i].to?n.ensureStaveCount(n.staves.length+1):(n=new _a,n.ensureStaveCount(1),n.name=a.description,n.playbackInfo.volume=Math.floor(a.volume/128*16),n.playbackInfo.program=a.instrument,a.percussion?(n.playbackInfo.primaryChannel=9,n.playbackInfo.secondaryChannel=9):(n.playbackInfo.primaryChannel=this._trackChannel++,n.playbackInfo.secondaryChannel=this._trackChannel++),this.score.addTrack(n));const o=n.staves[n.staves.length-1];o.isPercussion=a.percussion,o.transpositionPitch=a.transpose,o.displayTranspositionPitch=0,o.showTablature=!1,this._staffLookup.set(a.index,o)}}parseBrackets(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"bracket":this.parseBracket(r);break}}parseBracket(e){const r=new bZ;r.from=parseInt(e.getAttribute("from")),r.to=parseInt(e.getAttribute("to")),e.attributes.has("curly")&&(r.curly=e.attributes.get("curly")==="true"),this._brackets.push(r)}parseLayoutStaves(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"staffLayout":this.parseStaffLayout(r);break}}parseStaffLayout(e){const r=new yZ;r.description=e.getAttribute("description");for(let i of e.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"notation":i.attributes.has("defaultClef")&&(r.defaultClef=this.parseClef(i.attributes.get("defaultClef")));break;case"sound":i.attributes.has("percussion")&&(r.percussion=i.attributes.get("percussion")==="true"),i.attributes.has("instr")&&(r.instrument=parseInt(i.attributes.get("instr"))),i.attributes.has("volume")&&(r.volume=parseInt(i.attributes.get("volume"))),i.attributes.has("transpose")&&(r.transpose=parseInt(i.attributes.get("transpose")));break}this._staffLayoutLookup.set(r.description,r),r.index=this._staffLayouts.length,this._staffLayouts.push(r)}parseClef(e){switch(e){case"treble":return ot.G2;case"bass":return ot.F4;case"alto":return ot.C4;case"tenor":return ot.C4}return ot.G2}parseClefOttava(e){return e.endsWith("-")?Ft._8vb:e.endsWith("+")?Ft._8va:Ft.Regular}parseSystems(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"system":this.parseSystem(r);break}}parseSystem(e){e.attributes.has("tempo")&&this.score.masterBars.length===0&&(this.score.tempo=parseInt(e.attributes.get("tempo"))),e.getAttribute("beamGrouping")==="0"&&(this._beamingMode=js.ForceSplitToNext);for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"staves":this.parseStaves(e,r);break}this._isFirstSystem=!1}parseStaves(e,r){let i=this.score.masterBars.length;for(let n of r.childNodes)if(n.nodeType===ue.Element)switch(n.localName){case"staff":this.parseStaff(e,i,n);break}}parseStaff(e,r,i){const n=i.getAttribute("layout");this._currentStaffLayout=this._staffLayoutLookup.get(n),this._timeSignature.timeSignatureNumerator=4,this._timeSignature.timeSignatureDenominator=4,this._timeSignature.timeSignatureCommon=!1,this.parseTime(i.getAttribute("defaultTime"));const s=this._staffLookup.get(this._currentStaffLayout.index);for(;s.bars.length0){const r=e.split("/");this._timeSignature.timeSignatureNumerator=parseInt(r[0]),this._timeSignature.timeSignatureDenominator=parseInt(r[1]),this._timeSignature.timeSignatureCommon=!1}break}}parseVoices(e,r,i,n,s){let a=0;for(let o of s.childNodes)if(o.nodeType===ue.Element)switch(o.localName){case"voice":this.parseVoice(e,r,i,a,n,o),a++;break}}getOrCreateBar(e,r){return r0?(r.clef=e.bars[e.bars.length-1].clef,r.clefOttava=e.bars[e.bars.length-1].clefOttava):r.clef=this._currentStaffLayout.defaultClef,e.addBar(r),e.bars.length>this.score.masterBars.length){let i=new eo;this.score.addMasterBar(i),i.index>0&&(i.keySignature=i.previousMasterBar.keySignature,i.keySignatureType=i.previousMasterBar.keySignatureType,i.tripletFeel=i.previousMasterBar.tripletFeel),i.timeSignatureDenominator=this._timeSignature.timeSignatureDenominator,i.timeSignatureNumerator=this._timeSignature.timeSignatureNumerator,i.timeSignatureCommon=this._timeSignature.timeSignatureCommon}return r}newBar(e,r){this._currentVoiceState.currentBarIndex++,this._currentBar=this.getOrCreateBar(e,this._currentVoiceState.currentBarIndex),this._currentVoiceState.currentBarDuration=this._currentBar.masterBar.calculateDuration(!1),this._currentVoiceState.currentBarComplete=!1,this._currentVoiceState.currentPosition=0,this.ensureVoice(e,r)}parseVoice(e,r,i,n,s,a){const o=e+"_"+n;if(this._currentVoiceState&&!this._currentVoiceState.currentBarComplete&&(this._currentBar.masterBar.isAnacrusis=!0),this._voiceStates.has(o)?(this._currentVoiceState=this._voiceStates.get(o),this._currentBar=this.getOrCreateBar(r,this._currentVoiceState.currentBarIndex),this.ensureVoice(r,n)):(this._currentVoiceState=new vZ,this._currentVoiceState.currentBarIndex=s-1,this._voiceStates.set(o,this._currentVoiceState),this.newBar(r,n)),a.attributes.has("stemDir"))switch(a.attributes.get("stemDir")){case"up":this._currentVoiceState.voiceStemDir=ve.Up;break;case"down":this._currentVoiceState.voiceStemDir=ve.Down;break;default:this._currentVoiceState.voiceStemDir=null;break}else this._currentVoiceState.voiceStemDir=null;const l=a.findChildElement("noteObjects");if(i.attributes.has("tempo")&&(this._currentBar.masterBar.tempoAutomation=new Ei,this._currentBar.masterBar.tempoAutomation.isLinear=!0,this._currentBar.masterBar.tempoAutomation.type=ai.Tempo,this._currentBar.masterBar.tempoAutomation.value=parseInt(i.attributes.get("tempo"))),l){for(let c of l.childNodes)if(c.nodeType===ue.Element)switch(this._currentVoiceState.currentBarComplete&&c.localName!=="barline"&&this.newBar(r,n),c.localName){case"clefSign":this._currentBar.clef=this.parseClef(c.getAttribute("clef")),this._currentBar.clefOttava=this.parseClefOttava(c.getAttribute("clef"));break;case"keySign":this._currentBar.masterBar.keySignature=parseInt(c.getAttribute("fifths"));break;case"timeSign":this.parseTime(c.getAttribute("time")),this._currentBar.masterBar.timeSignatureDenominator=this._timeSignature.timeSignatureDenominator,this._currentBar.masterBar.timeSignatureNumerator=this._timeSignature.timeSignatureNumerator,this._currentBar.masterBar.timeSignatureCommon=this._timeSignature.timeSignatureCommon,this._currentVoiceState.currentPosition=0,this._currentVoiceState.currentBarDuration=this._currentBar.masterBar.calculateDuration(!1);break;case"barline":switch(c.getAttribute("type")){case"double":this._currentBar.masterBar.isDoubleBar=!0,this._currentVoiceState.currentBarComplete||(this._currentBar.masterBar.isAnacrusis=!0),this._currentVoiceState.currentBarComplete=!0;break;case"end":this._currentVoiceState.currentBarComplete||(this._currentBar.masterBar.isAnacrusis=!0);break;case"repEnd":this._currentVoiceState.repeatEnd=this._currentBar.masterBar,this._currentBar.masterBar.repeatCount=this._currentVoiceState.currentBarDuration&&(this._currentVoiceState.currentBarComplete=!0);break;case"rest":const d=this.parseRestDurations(this._currentBar,c.findChildElement("duration"));d&&(this.initFromPreviousBeat(d,this._currentVoice),d.updateDurations(),this._currentVoiceState.currentPosition+=d.playbackDuration,this._currentVoice.addBeat(d),this._currentVoiceState.currentPosition>=this._currentVoiceState.currentBarDuration&&(this._currentVoiceState.currentBarComplete=!0));break}}}initFromPreviousBeat(e,r){let i=this.getLastBeat(r);i&&(e.dynamics=i.dynamics)}getLastBeat(e){if(e.beats.length>0)return e.beats[e.beats.length-1];if(e.bar.index>0){const r=e.bar.staff.bars[e.bar.index-1];if(e.index0&&!n.isTieDestination&&(n.isTieDestination=!0,n.tieOrigin=this._tieStarts[0],this._tieStarts.splice(0,1),this._tieStartIds.delete(n.id));break}}parseBeatDrawObject(e,r){for(let i of r.childNodes)if(i.nodeType===ue.Element)switch(i.localName){case"drawObj":const n=this.parseDrawObj(i);if(n){if(n instanceof Db)n.fontFace.startsWith("capella")?n.text==="u"?(e.fermata=new DS,e.fermata.type=Qs.Medium):n.text==="f"?e.dynamics=yt.F:n.text==="j"&&(e.dynamics=yt.MF):this._isFirstSystem&&this.score.title===""&&n.align===Qe.Center&&n.height>16&&n.weight>400?this.score.title=n.text:this._isFirstSystem&&this.score.artist===""&&n.align===Qe.Center&&n.y<0?this.score.artist=n.text:this._isFirstSystem&&this.score.music===""&&n.align===Qe.Right&&n.y<0?this.score.music=n.text:n.text.startsWith("by capella")||(e.text=n.text);else if(!(n instanceof ST))if(n instanceof kT)e.vibrato=Dt.Slight;else if(n instanceof CT)e.crescendo=n.decrescendo?pn.Decrescendo:pn.Crescendo,n.noteRange++,this._crescendo.set(e,n);else if(n instanceof xT){const s=n;this._slurs.set(e,s)}else n instanceof Lb&&this.applyVolta(n)}break}}parseBarDrawObject(e){for(let r of e.childNodes)if(r.nodeType===ue.Element)switch(r.localName){case"drawObj":const i=this.parseDrawObj(r);i&&i instanceof Lb&&this.applyVolta(i);break}}applyVolta(e){if(e.lastNumber>0?(this._currentVoiceState.repeatCount=e.lastNumber,this._currentVoiceState.repeatEnd&&this._currentVoiceState.repeatEnd.repeatCount0&&(this._currentVoiceState.repeatCount=e.firstNumber,this._currentVoiceState.repeatEnd&&this._currentVoiceState.repeatEnd.repeatCount0&&e.firstNumber>0){let r=0;for(let i=e.firstNumber;i<=e.lastNumber;i++)r=r|1<0?this._currentBar.masterBar.alternateEndings=1<0&&(this._currentBar.masterBar.alternateEndings=1<0)for(let n of r)switch(n.fileName){case"score.xml":i=ae.toString(n.data,this.settings.importer.encoding);break}else this.data.reset(),i=ae.toString(this.data.readAll(),this.settings.importer.encoding);if(!i)throw new Gr("No valid capella file");de.debug(this.name,"Start Parsing score.xml");try{let n=new xm;return n.parseXml(i,this.settings),de.debug(this.name,"score.xml parsed"),n.score}catch(n){throw new Gr("Failed to parse CapXML",n)}}}class SZ{constructor(e){this._targets=new Set,this._callback=e,window.addEventListener("resize",this.onWindowResize.bind(this),!1)}observe(e){this._targets.add(e)}unobserve(e){this._targets.delete(e)}disconnect(){this._targets.clear()}onWindowResize(){const e=[];for(const r of this._targets)e.push({target:r,contentRect:void 0,borderBoxSize:void 0,contentBoxSize:[],devicePixelContentBoxSize:[]});this._callback(e,this)}}class xZ{constructor(e){this._elements=[];let r=null;const i=this._check.bind(this);this._check=()=>{r||(r=setTimeout(()=>{i(),r=null},100))},this._callback=e,window.addEventListener("resize",this._check,!0),document.addEventListener("scroll",this._check,!0)}observe(e){this._elements.indexOf(e)>=0||(this._elements.push(e),this._check())}unobserve(e){this._elements=this._elements.filter(r=>r!=e)}_check(){const e=[];this._elements.forEach(r=>{const i=r.getBoundingClientRect();i.top+i.height>=0&&i.top<=window.innerHeight&&i.left+i.width>=0&&i.left<=window.innerWidth&&e.push({target:r,isIntersecting:!0})}),e.length&&this._callback(e,this)}}function TT(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}var kZ=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};function _T(t){function e(i){t.error=t.hasError?new kZ(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function r(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}class or{static enable(e,r){or.alphaSkia=r,or.initializeMusicFont(or.alphaSkia.AlphaSkiaTypeface.register(e))}static initializeMusicFont(e){or.musicFont=e}static registerFont(e,r){const i=or.alphaSkia.AlphaSkiaTypeface.register(e.buffer);r||(r=Mt.withFamilyList([i.familyName],12,i.isItalic?vr.Italic:vr.Plain,i.isBold?Tn.Bold:Tn.Regular));for(const n of r.families)this.customTypeFaces.set(or.customTypefaceKey(n,r.isBold,r.isItalic),i);return r}static customTypefaceKey(e,r,i){return e.toLowerCase()+"_"+r+"_"+i}getTypeFace(){if(this._typeFaceCache!=this.font.toCssString(this.settings.display.scale)){if(this._typeFaceIsSystem){const r={stack:[],error:void 0,hasError:!1};try{const i=TT(r,this._typeFace,!1)}catch(i){r.error=i,r.hasError=!0}finally{_T(r)}}for(const r of this.font.families){var e=or.customTypefaceKey(r,this.font.isBold,this.font.isItalic);or.customTypeFaces.has(e)?(this._typeFaceIsSystem=!1,this._typeFace=or.customTypeFaces.get(e)):(this._typeFaceIsSystem=!0,this._typeFace=or.alphaSkia.AlphaSkiaTypeface.create(r,this.font.isBold,this.font.isItalic))}this._typeFaceCache=this.font.toCssString(this.settings.display.scale)}return this._typeFace}constructor(){this._color=new Yt(0,0,0,0),this._lineWidth=0,this._typeFaceCache="",this._typeFaceIsSystem=!1,this._typeFace=null,this.font=new Mt("Arial",10,vr.Plain),this.textAlign=Qe.Left,this.textBaseline=ft.Top,this._canvas=new or.alphaSkia.AlphaSkiaCanvas,this.color=new Yt(0,0,0,255)}destroy(){const e={stack:[],error:void 0,hasError:!1};try{const r=TT(e,this._canvas,!1)}catch(r){e.error=r,e.hasError=!0}finally{_T(e)}}onRenderFinished(){return null}beginRender(e,r){this._canvas.beginRender(e,r,Se.HighDpiFactor)}endRender(){return this._canvas.endRender()}get color(){return this._color}set color(e){this._color.rgba!==e.rgba&&(this._color=e,this._canvas.color=or.alphaSkia.AlphaSkiaCanvas.rgbaToColor(e.r,e.g,e.b,e.a))}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this._canvas.lineWidth=e}fillRect(e,r,i,n){i>0&&this._canvas.fillRect(e|0,r|0,i,n)}strokeRect(e,r,i,n){this._canvas.strokeRect(e|0,r|0,i,n)}beginPath(){this._canvas.beginPath()}closePath(){this._canvas.closePath()}moveTo(e,r){this._canvas.moveTo(e,r)}lineTo(e,r){this._canvas.lineTo(e,r)}quadraticCurveTo(e,r,i,n){this._canvas.quadraticCurveTo(e,r,i,n)}bezierCurveTo(e,r,i,n,s,a){this._canvas.bezierCurveTo(e,r,i,n,s,a)}fillCircle(e,r,i){this._canvas.fillCircle(e,r,i)}strokeCircle(e,r,i){this._canvas.strokeCircle(e,r,i)}fill(){this._canvas.fill()}stroke(){this._canvas.stroke()}beginGroup(e){}endGroup(){}fillText(e,r,i){if(e.length==0)return;let n=or.alphaSkia.AlphaSkiaTextAlign.Left;switch(this.textAlign){case Qe.Left:n=or.alphaSkia.AlphaSkiaTextAlign.Left;break;case Qe.Center:n=or.alphaSkia.AlphaSkiaTextAlign.Center;break;case Qe.Right:n=or.alphaSkia.AlphaSkiaTextAlign.Right;break}let s=or.alphaSkia.AlphaSkiaTextBaseline.Top;switch(this.textBaseline){case ft.Top:s=or.alphaSkia.AlphaSkiaTextBaseline.Top;break;case ft.Middle:s=or.alphaSkia.AlphaSkiaTextBaseline.Middle;break;case ft.Bottom:s=or.alphaSkia.AlphaSkiaTextBaseline.Bottom;break}this._canvas.fillText(e,this.getTypeFace(),this.font.size*this.settings.display.scale,r,i,n,s)}measureText(e){return this._canvas.measureText(e,this.getTypeFace(),this.font.size*this.settings.display.scale)}fillMusicFontSymbol(e,r,i,n,s){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,String.fromCharCode(n),s)}fillMusicFontSymbols(e,r,i,n,s){let a="";for(let o of n)o!==B.None&&(a+=String.fromCharCode(o));this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s){this._canvas.fillText(n,or.musicFont,Se.MusicFontSize*this.settings.display.scale*i,e,r,s?or.alphaSkia.AlphaSkiaTextAlign.Center:or.alphaSkia.AlphaSkiaTextAlign.Left,or.alphaSkia.AlphaSkiaTextBaseline.Alphabetic)}beginRotate(e,r,i){this._canvas.beginRotate(e,r,i)}endRotate(){this._canvas.endRotate()}}or.musicFont=null;or.customTypeFaces=new Map;class BT{constructor(e,r){this.vertical=e,this.createLayout=r}}class Fb{constructor(e,r){this.supportsWorkers=e,this.createCanvas=r}}class Se{static createStyleElement(e,r){let i=e.getElementById("alphaTabStyle");if(!i){if(!r){de.error("AlphaTab","Font directory could not be detected, cannot create style element");return}i=e.createElement("style"),i.id="alphaTabStyle";let n=` +`}beginPath(){}closePath(){this._currentPath+=" z"}moveTo(e,r){this._currentPath+=` M${e},${r}`}lineTo(e,r){this._currentPathIsEmpty=!1,this._currentPath+=` L${e},${r}`}quadraticCurveTo(e,r,i,n){this._currentPathIsEmpty=!1,this._currentPath+=` Q${e},${r},${i},${n}`}bezierCurveTo(e,r,i,n,s,a){this._currentPathIsEmpty=!1,this._currentPath+=` C${e},${r},${i},${n},${s},${a}`}fillCircle(e,r,i){this._currentPathIsEmpty=!1,this._currentPath+=` M${e-i},${r} A1,1 0 0,0 ${e+i},${r} A1,1 0 0,0 ${e-i},${r} z`,this.fill()}strokeCircle(e,r,i){this._currentPathIsEmpty=!1,this._currentPath+=` M${e-i},${r} A1,1 0 0,0 ${e+i},${r} A1,1 0 0,0 ${e-i},${r} z`,this.stroke()}fill(){this._currentPathIsEmpty||(this.buffer+=`${zS.escapeText(e)}`,this.buffer+=n}static escapeText(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}getSvgTextAlignment(e){switch(e){case Je.Left:return"start";case Je.Center:return"middle";case Je.Right:return"end"}return""}getSvgBaseLine(){switch(this.textBaseline){case ft.Top:return'dominant-baseline="hanging"';case ft.Bottom:return'dominant-baseline="bottom"';default:return""}}measureText(e){return e?Vr.measureString(e,this.font.families,this.font.size,this.font.style,this.font.weight):0}onRenderFinished(){return null}beginRotate(e,r,i){this.buffer+=''}endRotate(){this.buffer+=""}}class xJ extends zS{constructor(){super()}fillMusicFontSymbol(e,r,i,n,s){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,`&#${n};`,s)}fillMusicFontSymbols(e,r,i,n,s){let a="";for(let o of n)o!==B.None&&(a+=`&#${o};`);this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s){this.buffer+=`${n}`}}class WS{constructor(){this.isInAccolade=!0,this.isRelevantForBoundsLookup=!0,this.hideOnMultiTrack=!1,this.hideOnPercussionTrack=!1}canCreate(e,r){return!this.hideOnPercussionTrack||!r.isPercussion}}var vt;(function(t){t[t.PreNotes=0]="PreNotes",t[t.OnNotes=1]="OnNotes",t[t.MiddleNotes=2]="MiddleNotes",t[t.Stem=3]="Stem",t[t.PostNotes=4]="PostNotes",t[t.EndBeat=5]="EndBeat"})(vt||(vt={}));class ra extends Dr{get isEmpty(){return!this.glyphs||this.glyphs.length===0}constructor(e,r){super(e,r),this.glyphs=null}doLayout(){if(!this.glyphs||this.glyphs.length===0){this.width=0;return}let e=0;for(let r=0,i=this.glyphs.length;r0?o.beat.graceIndex===0?o.x=n[s-1].x+n[s-1].width:o.x=n[s-1].x+u[o.beat.graceIndex-1].postSpringWidth-u[o.beat.graceIndex-1].preSpringWidth-d:o.x=-d}break}if(s>0){let l=o.x-n[s-1].x;n[s-1].scaleToWidth(l)}if(s===a-1){let l=this.width-n[n.length-1].x;o.scaleToWidth(l)}}}registerLayoutingInfo(e){e.updateVoiceSize(this.width);let r=this.beatGlyphs;for(let i of r)i.registerLayoutingInfo(e)}applyLayoutingInfo(e){let r=this.beatGlyphs;for(let i of r)i.applyLayoutingInfo(e);this.scaleToForce(Math.max(this.renderer.settings.display.stretchForce,e.minStretchForce))}addGlyph(e){let r=e;e.x=this.beatGlyphs.length===0?0:this.beatGlyphs[this.beatGlyphs.length-1].x+this.beatGlyphs[this.beatGlyphs.length-1].width,e.renderer=this.renderer,e.doLayout(),this.beatGlyphs.push(r),this.width=e.x+e.width,r.beat.hasTuplet&&r.beat.tupletGroup.beats[0].id===r.beat.id&&this.tupletGroups.push(r.beat.tupletGroup)}doLayout(){}paint(e,r,i){i.color=this.voice.index===0?this.renderer.resources.mainGlyphColor:this.renderer.resources.secondaryGlyphColor;for(let n=0,s=this.beatGlyphs.length;no)&&(this.maxLine=o,this.maxLineBeat=i),n||this.registerLine(i,o),a}registerLine(e,r){let i;this._beatLines.has(e.id)?i=this._beatLines.get(e.id):(i=new kJ,this._beatLines.set(e.id,i)),(i.minLine===-1e3||ri.maxLine)&&(i.maxLine=r)}getMaxLine(e){return this._beatLines.has(e.id)?this._beatLines.get(e.id).maxLine:0}getMinLine(e){return this._beatLines.has(e.id)?this._beatLines.get(e.id).minLine:0}static calculateNoteLine(e,r,i){let n=r,s=e.masterBar.keySignature,a=e.clef,o=n%12,l=(n/12|0)-1,c=Ir.OctaveSteps[a];c-=l*Ir.StepsPerOctave;let u=er.keySignatureIsSharp(s)||er.keySignatureIsNatural(s)?Ir.SharpNoteSteps:Ir.FlatNoteSteps;return c-=u[o],c}getNoteLine(e){return this._appliedScoreLines.get(e.id)}getNoteLineForValue(e,r=!1){return this._appliedScoreLinesByValue.has(e)?this._appliedScoreLinesByValue.get(e):r&&this._notesByValue.has(e)?this.getNoteLine(this._notesByValue.get(e)):0}}Ir.KeySignatureLookup=[[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0],[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0],[!1,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0],[!1,!0,!0,!0,!0,!1,!1,!1,!0,!0,!0,!0],[!1,!1,!1,!0,!0,!1,!1,!1,!0,!0,!0,!0],[!1,!1,!1,!0,!0,!1,!1,!1,!1,!1,!0,!0],[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0],[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!0,!1,!1,!1,!1,!1],[!0,!0,!1,!1,!1,!0,!0,!1,!1,!1,!1,!1],[!0,!0,!1,!1,!1,!0,!0,!0,!0,!1,!1,!1],[!0,!0,!0,!0,!1,!0,!0,!0,!0,!1,!1,!1],[!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0,!1],[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1],[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]];Ir.AccidentalNotes=[!1,!0,!1,!0,!1,!1,!0,!1,!0,!1,!0,!1];Ir.StepsPerOctave=7;Ir.OctaveSteps=[38,32,30,26,38];Ir.SharpNoteSteps=[0,0,1,1,2,3,3,4,4,5,5,6];Ir.FlatNoteSteps=[0,1,1,2,2,3,4,4,5,5,6,6];class CJ{constructor(){this.staffId="",this.up=0,this.down=0}}class TJ{constructor(){this.startBeat=null,this.startX=0,this.startY=0,this.endBeat=null,this.endX=0,this.endY=0}calcY(e){return this.startX===this.endX?this.startY:(this.endY-this.startY)/(this.endX-this.startX)*(e-this.startX)+this.startY}}class Bn{get isRestBeamHelper(){return this.beats.length===1&&this.beats[0].isRest}get hasLine(){return this.beats.length===1&&this.beats[0].duration>H.Whole}get hasFlag(){return this.beats.length===1&&!this.beats[0].isRest&&(this.beats[0].duration>H.Quarter||this.beats[0].graceType!==Ze.None)}constructor(e,r){this._beatLineXPositions=new Map,this._firstNonRestBeat=null,this._lastNonRestBeat=null,this.voice=null,this.beats=[],this.shortestDuration=H.QuadrupleWhole,this.fingeringCount=0,this.hasTuplet=!1,this._firstBeatLowestNoteCompareValue=-1,this._firstBeatHighestNoteCompareValue=-1,this._lastBeatLowestNoteCompareValue=-1,this._lastBeatHighestNoteCompareValue=-1,this.lowestNoteInHelper=null,this._lowestNoteCompareValueInHelper=-1,this.highestNoteInHelper=null,this._highestNoteCompareValueInHelper=-1,this.invertBeamDirection=!1,this.preferredBeamDirection=null,this.isGrace=!1,this.minRestLine=null,this.beatOfMinRestLine=null,this.maxRestLine=null,this.beatOfMaxRestLine=null,this.direction=we.Up,this.drawingInfos=new Map,this._staff=e,this._renderer=r,this.beats=[]}getBeatLineX(e){return this.hasBeatLineX(e)?this.direction===we.Up?this._beatLineXPositions.get(e.index).up:this._beatLineXPositions.get(e.index).down:0}hasBeatLineX(e){return this._beatLineXPositions.has(e.index)}registerBeatLineX(e,r,i,n){let s=this.getOrCreateBeatPositions(r);s.staffId=e,s.up=i,s.down=n;for(const a of this.drawingInfos.values())a.startBeat==r?a.startX=this.getBeatLineX(r):a.endBeat==r&&(a.endX=this.getBeatLineX(r))}getOrCreateBeatPositions(e){return this._beatLineXPositions.has(e.index)||this._beatLineXPositions.set(e.index,new CJ),this._beatLineXPositions.get(e.index)}finish(){this.direction=this.calculateDirection()}calculateDirection(){let e=null;if(this.voice?this.preferredBeamDirection!==null?e=this.preferredBeamDirection:this.voice.index>0?e=this.invert(we.Down):this.voice.bar.isMultiVoice?e=this.invert(we.Up):this.beats[0].graceType!==Ze.None&&(e=this.invert(we.Up)):e=we.Up,this.highestNoteInHelper&&this.lowestNoteInHelper){let r=this._renderer.getNoteY(this.highestNoteInHelper,je.Center),i=this._renderer.getNoteY(this.lowestNoteInHelper,je.Center);if(e===null){const n=(r+i)/2;e=this.invert(this._renderer.middleYPosition=this._lastNonRestBeat.index||this._firstNonRestBeat&&e.index<=this._firstNonRestBeat.index)return;let i=r,n=r;const s=Bn.computeLineHeightsForRest(e.duration);i-=s[0],n+=s[1];const a=this.minRestLine,o=this.maxRestLine;(a===null||a>i)&&(this.minRestLine=i,this.beatOfMinRestLine=e),(o===null||othis.fingeringCount&&(this.fingeringCount=i),this.checkNote(e.minNote),this.checkNote(e.maxNote),this.shortestDurationthis._firstBeatHighestNoteCompareValue)&&(this._firstBeatHighestNoteCompareValue=i)),(this._lastBeatLowestNoteCompareValue===-1||rthis._lastBeatHighestNoteCompareValue)&&(this._lastBeatHighestNoteCompareValue=i),(!this.lowestNoteInHelper||rthis._highestNoteCompareValueInHelper)&&(this.highestNoteInHelper=e,this._highestNoteCompareValueInHelper=i)}static canJoin(e,r){if(!e||!r||e.graceType!==r.graceType||e.graceType===Ze.BendGrace||r.graceType===Ze.BendGrace)return!1;if(e.graceType!==Ze.None&&r.graceType!==Ze.None)return!0;let i=e.voice.bar,n=r.voice.bar;if(i!==n)return!1;let s=e.playbackStart,a=r.playbackStart;if(!Bn.canJoinDuration(e.duration)||!Bn.canJoinDuration(r.duration))return s===a;if(e.tupletGroup!==r.tupletGroup)return!1;if(e.hasTuplet&&r.hasTuplet&&e.tupletGroup===r.tupletGroup&&e.tupletGroup.isFull)return!0;let o=lt.QuarterTime;switch(i.masterBar.timeSignatureDenominator){case 8:i.masterBar.timeSignatureNumerator%3===0&&(o+=lt.QuarterTime/2|0);break}let l=(o+s)/o|0|0,c=(o+a)/o|0|0;return l===c}static canJoinDuration(e){switch(e){case H.Whole:case H.Half:case H.Quarter:return!1;default:return!0}}static isFullBarJoin(e,r,i){return er.getIndex(e.duration)-2-i>0&&er.getIndex(r.duration)-2-i>0}get beatOfLowestNote(){return this.lowestNoteInHelper.beat}get beatOfHighestNote(){return this.highestNoteInHelper.beat}isPositionFrom(e,r){return this._beatLineXPositions.has(r.index)?this._beatLineXPositions.get(r.index).staffId===e||!this._beatLineXPositions.get(r.index).staffId:!0}}class _J{constructor(e,r){this.topY=0,this.bottomY=0,this.topY=e,this.bottomY=r}}class BJ{constructor(e){this.topY=-1e3,this.bottomY=-1e3,this.slots=[],this.beat=e}addSlot(e,r){if(this.slots.push(new _J(e,r)),this.topY===-1e3)this.topY=e,this.bottomY=r;else{const i=Math.min(e,r),n=Math.max(e,r);ithis.bottomY&&(this.bottomY=n)}}}class PJ{constructor(){this.reservedLayoutAreasByDisplayTime=new Map,this.restDurationsByDisplayTime=new Map}getBeatMinMaxY(){let e=-1e3,r=-1e3;for(const i of this.reservedLayoutAreasByDisplayTime.values())e===-1e3?(e=i.topY,r=i.bottomY):(e>i.topY&&(e=i.topY),r0&&this.reservedLayoutAreasByDisplayTime.has(e.playbackStart)){const n=Bn.computeLineHeightsForRest(e.duration).map(u=>u*i);let s=r-n[0],a=r+n[1],o=s;const l=this.reservedLayoutAreasByDisplayTime.get(e.playbackStart);let c=!1;for(const u of l.slots)if(s>=u.topY&&s<=u.bottomY||a>=u.topY&&a<=u.bottomY){c=!0;break}if(c){e.voice.index==1?o=l.topY-n[1]-n[0]:o=l.bottomY;let u=o+n[0]+n[1];const d=i*2;let h=Math.ceil(Math.abs(o-s)/d);return l.addSlot(o,u),o1?this._firstFretSpacing=xi.FretSpacing*e:this._firstFretSpacing=0,this.height=this._textRow+this._fretRow+(xi.Frets-1)*xi.FretSpacing*e+2*xi.Padding*e,this.width=this._firstFretSpacing+(this._chord.staff.tuning.length-1)*xi.StringSpacing*e+2*xi.Padding*e}paint(e,r,i){e+=this.x+xi.Padding*this.scale+this._firstFretSpacing,r+=this.y;let n=this.width-2*xi.Padding*this.scale+this.scale-this._firstFretSpacing,s=xi.StringSpacing*this.scale,a=xi.FretSpacing*this.scale,o=this.renderer.resources,l=xi.CircleRadius*this.scale,c=i.textAlign,u=i.textBaseline;i.font=o.effectFont,i.textAlign=Je.Center,i.textBaseline=ft.Top,this._chord.showName&&i.fillText(this._chord.name,e+this.width/2,r+o.effectFont.size/2),r+=this._textRow,e+=s/2,i.font=o.fretboardNumberFont,i.textBaseline=ft.Middle;for(let h=0;h1&&(i.textAlign=Je.Left,i.fillText(this._chord.firstFret.toString(),e-this._firstFretSpacing,r+a/2)),i.fillRect(e,r-this.scale,n,2*this.scale);for(let h=0;h<=xi.Frets;h++){let p=r+h*a;i.fillRect(e,p,n,this.scale)}let d=new Map;for(let h of this._chord.barreFrets){let p=[-1,-1];d.set(h-this._chord.firstFret,p)}for(let h=0;h0){if(p-=this._chord.firstFret,d.has(p)){let y=d.get(p);(y[0]===-1||hy[1])&&(y[1]=h)}let f=r+p*a+a/2+.5*this.scale,m=e+(this._chord.strings.length-h-1)*s;i.fillCircle(m,f,l)}}for(const[h,p]of d){let f=r+h*a+a/2+.5*this.scale,m=e+(this._chord.strings.length-p[1]-1)*s,y=e+(this._chord.strings.length-p[0]-1)*s;i.fillRect(m,f-l,y-m,l*2)}i.textAlign=c,i.textBaseline=u}}xi.Padding=5;xi.Frets=5;xi.CircleRadius=2.5;xi.StringSpacing=10;xi.FretSpacing=12;class aT extends ra{constructor(e,r,i=Je.Center){super(e,r),this._glyphWidth=0,this.glyphs=[],this._align=i}doLayout(){let e=0;switch(this._align){case Je.Left:e=0;break;case Je.Center:e=(this.width-this._glyphWidth)/2;break;case Je.Right:e=this.width-this._glyphWidth;break}for(let r of this.glyphs)r.x=e,e+=r.width}addGlyphToRow(e){this.glyphs.push(e),this._glyphWidth+=e.width,e.height>this.height&&(this.height=e.height)}}class du extends ra{constructor(e,r,i=Je.Center){super(e,r),this._rows=[],this.height=0,this.glyphs=[],this._align=i}doLayout(){let e=0,r=0,i=2*du.Padding*this.scale;this._rows=[];let n=new aT(e,r,this._align);n.width=this.width;for(let s of this.glyphs)e+s.width0){let r=new xi(0,0,e);r.renderer=this.renderer,r.doLayout(),this.glyphs.push(r)}}}class Ai extends na{constructor(e,r,i,n,s=Je.Left){super(e,r),this._lines=i.split(` +`),this.font=n,this.textAlign=s}doLayout(){super.doLayout(),this.height=this.font.size*this._lines.length}paint(e,r,i){let n=i.color;i.color=n,i.font=this.font;let s=i.textAlign;i.textAlign=this.textAlign;let a=r+this.y;for(let o of this._lines)i.fillText(o,e+this.x,a),a+=this.font.size;i.textAlign=s}}class RJ{get staveId(){return this._factory.staffId}constructor(e,r,i){this._sharedLayoutData=new Map,this.barRenderers=[],this.x=0,this.y=0,this.height=0,this.index=0,this.staffIndex=0,this.trackIndex=0,this.staveTop=0,this.topSpacing=20,this.bottomSpacing=5,this.staveBottom=0,this.isFirstInAccolade=!1,this.isLastInAccolade=!1,this._factory=i,this.trackIndex=e,this.modelStaff=r}getSharedLayoutData(e,r){return this._sharedLayoutData.has(e)?this._sharedLayoutData.get(e):r}setSharedLayoutData(e,r){this._sharedLayoutData.set(e,r)}get isInAccolade(){return this._factory.isInAccolade}get isRelevantForBoundsLookup(){return this._factory.isRelevantForBoundsLookup}registerStaffTop(e){this.staveTop=e}registerStaffBottom(e){this.staveBottom=e}addBarRenderer(e){e.staff=this,e.index=this.barRenderers.length,e.reLayout(),this.barRenderers.push(e),this.staveGroup.layout.registerBarRenderer(this.staveId,e)}addBar(e,r){let i;e?i=this._factory.create(this.staveGroup.layout.renderer,e):i=new br(this.staveGroup.layout.renderer,e),i.staff=this,i.index=this.barRenderers.length,i.layoutingInfo=r,i.doLayout(),i.registerLayoutingInfo();const n=i.barDisplayWidth;n>0&&this.staveGroup.layout.systemsLayoutMode==Pn.FromModelWithWidths&&(i.width=n),this.barRenderers.push(i),e&&this.staveGroup.layout.registerBarRenderer(this.staveId,i)}revertLastBar(){let e=this.barRenderers[this.barRenderers.length-1];return this.barRenderers.splice(this.barRenderers.length-1,1),this.staveGroup.layout.unregisterBarRenderer(this.staveId,e),e}scaleToWidth(e){this._sharedLayoutData=new Map;let r=this.topOverflow,i=0;switch(this.staveGroup.layout.systemsLayoutMode){case Pn.Automatic:let s=(e-this.staveGroup.computedWidth)/this.barRenderers.length;for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;let l=o.computedWidth+s;o.scaleToWidth(l),i+=o.width}break;case Pn.FromModelWithScale:e-=this.staveGroup.accoladeSpacing;const a=this.staveGroup.totalBarDisplayScale;for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;const l=o.barDisplayScale*e/a;o.scaleToWidth(l),i+=o.width}break;case Pn.FromModelWithWidths:for(const o of this.barRenderers){o.x=i,o.y=this.topSpacing+r;const l=o.barDisplayWidth;l>0?o.scaleToWidth(l):o.scaleToWidth(o.computedWidth),i+=o.width}break}}get topOverflow(){let e=0;for(let r=0,i=this.barRenderers.length;re&&(e=n.topOverflow)}return e}get bottomOverflow(){let e=0;for(let r=0,i=this.barRenderers.length;re&&(e=n.bottomOverflow)}return e}finalizeStaff(){this.height=0;let e=!1,r=this.topOverflow;for(let i=0;i0&&(this.height+=this.topSpacing+r+this.bottomOverflow+this.bottomSpacing)}paint(e,r,i,n,s){if(!(this.height===0||s===0))for(let a=n,o=Math.min(n+s,this.barRenderers.length);athis.voiceSize&&(this.voiceSize=e,this.version++)}setPreBeatSize(e,r){(!this.preBeatSizes.has(e.id)||this.preBeatSizes.get(e.id)a.longestDuration&&(a.longestDuration=r),a.allDurations.add(r);else{if(a=new oT,a.timePosition=e,a.allDurations.add(r),this._timeSortedSprings.length>0){let c=this._timeSortedSprings[this._timeSortedSprings.length-1];for(const u of c.allDurations)c.timePosition+u}a.longestDuration=r,a.postSpringWidth=s,a.graceBeatWidth=i,a.preBeatWidth=n,this.springs.set(e,a);let o=this._timeSortedSprings,l=o.length-1;for(;l>0&&o[l].timePosition>e;)l--;this._timeSortedSprings.splice(l+1,0,a)}return(this._minTime===-1||this._minTime>e)&&(this._minTime=e),a}addBeatSpring(e,r,i){let n=e.absoluteDisplayStart;if(e.graceType!==Ze.None){const s=e.graceGroup.id;this.allGraceRods.has(s)||this.allGraceRods.set(s,new Array(e.graceGroup.beats.length)),!e.graceGroup.isComplete&&!this.incompleteGraceRods.has(s)&&this.incompleteGraceRods.set(s,new Array(e.graceGroup.beats.length));let a=this.allGraceRods.get(s)[e.graceIndex];if(a)a.postSpringWidth=0;n--)r[n].graceBeatWidth=i,i-=r[n].preBeatWidth+r[n].postSpringWidth}this._incompleteGraceRodsWidth=0;for(const e of this.incompleteGraceRods.values())for(const r of e)this._incompleteGraceRodsWidth+=r.preBeatWidth+r.postSpringWidth;this.calculateSpringConstants(),this.version++}calculateSpringConstants(){this._xMin=0;let e=this.springs;for(const n of e.values())n.springWidth0&&(e-=this._timeSortedSprings[0].preSpringWidth),e-=this._incompleteGraceRodsWidth,Math.max(e,0)*this.totalSpringConstant):-1}calculateVoiceWidth(e){let r=0;return this.totalSpringConstant!==-1&&(r=this.calculateWidth(e,this.totalSpringConstant)),this._timeSortedSprings.length>0&&(r+=this._timeSortedSprings[0].preSpringWidth),r+=this._incompleteGraceRodsWidth,r}calculateWidth(e,r){return e/r}buildOnTimePositions(e){if(this.totalSpringConstant===-1)return new Map;if(er.isAlmostEqualTo(this._onTimePositionsForce,e)&&this._onTimePositions)return this._onTimePositions;this._onTimePositionsForce=e;let r=new Map;this._onTimePositions=r;let i=this._timeSortedSprings;if(i.length===0)return r;let n=i[0].preSpringWidth;for(let s=0;s1){let e=this.masterBarsRenderers[this.masterBarsRenderers.length-1];this.masterBarsRenderers.splice(this.masterBarsRenderers.length-1,1);let r=0,i=0;for(let n=0,s=this._allStaves.length;nr&&(r=l);const c=o.barDisplayScale;c>i&&(i=c)}return this.width-=r,this.computedWidth-=r,this.totalBarDisplayScale-=i,e}return null}updateWidthFromLastBar(){let e=0,r=0;for(let i=0,n=this._allStaves.length;ie&&(e=a.computedWidth);const o=a.barDisplayScale;o>r&&(r=o)}return this.width+=e,this.computedWidth+=e,this.totalBarDisplayScale+=r,e}calculateAccoladeSpacing(e){if(!this._accoladeSpacingCalculated&&this.index===0)if(this._accoladeSpacingCalculated=!0,!this.layout.renderer.settings.notation.isNotationElementVisible(rt.TrackNames))this.accoladeSpacing=0;else{let r=this.layout.renderer.canvas,i=this.layout.renderer.settings.display.resources.effectFont;r.font=i;for(let n of e)this.accoladeSpacing=Math.ceil(Math.max(this.accoladeSpacing,r.measureText(n.shortName)));this.accoladeSpacing*=this.layout.scale,this.accoladeSpacing+=2*kh.AccoladeLabelSpacing*this.layout.scale,this.width+=this.accoladeSpacing,this.computedWidth+=this.accoladeSpacing}}getStaveTrackGroup(e){for(let r=0,i=this.staves.length;r0&&n===0){if(i.color=a.barSeparatorColor,this._firstStaffInAccolade&&this._lastStaffInAccolade){let o=r+this._firstStaffInAccolade.y+this._firstStaffInAccolade.staveTop+this._firstStaffInAccolade.topSpacing+this._firstStaffInAccolade.topOverflow,l=r+this._lastStaffInAccolade.y+this._lastStaffInAccolade.topSpacing+this._lastStaffInAccolade.topOverflow+this._lastStaffInAccolade.staveBottom,c=e+this._firstStaffInAccolade.x;i.beginPath(),i.moveTo(c,o),i.lineTo(c,l),i.stroke()}i.font=a.effectFont;for(let o=0,l=this.staves.length;o0?this._firstStaffInAccolade.barRenderers[0].topPadding:0),c=r+this.y+i.y+i.height-i.bottomSpacing-i.bottomOverflow-(i.barRenderers.length>0?i.barRenderers[0].bottomPadding:0),u=s-n,d=c-l,h=o-a,p=this.x+this._firstStaffInAccolade.x,f=new TM;f.visualBounds=new dn,f.visualBounds.x=e,f.visualBounds.y=r+this.y,f.visualBounds.w=this.width,f.visualBounds.h=this.height,f.realBounds=new dn,f.realBounds.x=e,f.realBounds.y=r+this.y,f.realBounds.w=this.width,f.realBounds.h=this.height,this.layout.renderer.boundsLookup.addStaveGroup(f);let m=new Map;for(let y=0;y0)){this.createGlyphs(this._tuning);for(const e of this.glyphs)e.renderer=this.renderer,e.doLayout()}}createGlyphs(e){const r=this.renderer.scale,i=this.renderer.resources;this.height=0;const n=15*r;this._trackLabel.length>0&&(this.addGlyph(new Ai(0,this.height,this._trackLabel,i.effectFont,Je.Left)),this.height+=n),this.addGlyph(new Ai(0,this.height,e.name,i.effectFont,Je.Left));const s=64*r;if(this.renderer.scoreRenderer.canvas.font=i.effectFont,this.width=Math.max(this.renderer.scoreRenderer.canvas.measureText(this._trackLabel)*r,Math.max(this.renderer.scoreRenderer.canvas.measureText(e.name)*r,2*s)),this.height+=n,!e.isStandard){const o=ay.CircleNumberHeight*.7*r;let l=Math.ceil(e.tunings.length/2)|0,c=0,u=this.height;for(let d=0,h=e.tunings.length;d0){let i=new ay(0,0,e,r);i.renderer=this.renderer,i.doLayout(),this.glyphs.push(i)}}}class FJ{constructor(e,r){this.args=e,this.renderCallback=r}}var Pn;(function(t){t[t.Automatic=0]="Automatic",t[t.FromModelWithScale=1]="FromModelWithScale",t[t.FromModelWithWidths=2]="FromModelWithWidths"})(Pn||(Pn={}));class RM{constructor(e){this._barRendererLookup=new Map,this.width=0,this.height=0,this.scoreInfoGlyphs=new Map,this.chordDiagrams=null,this.tuningGlyph=null,this.systemsLayoutMode=Pn.Automatic,this._lazyPartials=new Map,this.firstBarIndex=0,this.lastBarIndex=0,this.renderer=e}resize(){this._lazyPartials.clear(),this.doResize()}layoutAndRender(){this._lazyPartials.clear();let e=this.renderer.score,r=this.renderer.settings.display.startBar;r--,r=Math.min(e.masterBars.length-1,Math.max(0,r)),this.firstBarIndex=r;let i=this.renderer.settings.display.barCount;i<0&&(i=e.masterBars.length),i=r+i-1,i=Math.min(e.masterBars.length-1,Math.max(0,i)),this.lastBarIndex=i,this.createScoreInfoGlyphs(),this.doLayoutAndRender()}registerPartial(e,r){this.renderer.settings.core.enableLazyLoading?(this._lazyPartials.set(e.id,new FJ(e,r)),this.renderer.partialLayoutFinished.trigger(e)):(this.renderer.partialLayoutFinished.trigger(e),this.internalRenderLazyPartial(e,r))}internalRenderLazyPartial(e,r){const i=this.renderer.canvas;i.beginRender(e.width,e.height),r(i),e.renderResult=i.endRender(),this.renderer.partialRenderFinished.trigger(e)}renderLazyPartial(e){if(this._lazyPartials.has(e)){const r=this._lazyPartials.get(e);this.internalRenderLazyPartial(r.args,r.renderCallback)}}createScoreInfoGlyphs(){he.debug("ScoreLayout","Creating score info glyphs");let e=this.renderer.settings.notation,r=this.renderer.score,i=this.renderer.settings.display.resources;this.scoreInfoGlyphs=new Map,r.title&&e.isNotationElementVisible(rt.ScoreTitle)&&this.scoreInfoGlyphs.set(rt.ScoreTitle,new Ai(0,0,r.title,i.titleFont,Je.Center)),r.subTitle&&e.isNotationElementVisible(rt.ScoreSubTitle)&&this.scoreInfoGlyphs.set(rt.ScoreSubTitle,new Ai(0,0,r.subTitle,i.subTitleFont,Je.Center)),r.artist&&e.isNotationElementVisible(rt.ScoreArtist)&&this.scoreInfoGlyphs.set(rt.ScoreArtist,new Ai(0,0,r.artist,i.subTitleFont,Je.Center)),r.album&&e.isNotationElementVisible(rt.ScoreAlbum)&&this.scoreInfoGlyphs.set(rt.ScoreAlbum,new Ai(0,0,r.album,i.subTitleFont,Je.Center)),r.music&&r.music===r.words&&e.isNotationElementVisible(rt.ScoreWordsAndMusic)?this.scoreInfoGlyphs.set(rt.ScoreWordsAndMusic,new Ai(0,0,"Music and Words by "+r.words,i.wordsFont,Je.Center)):(r.music&&e.isNotationElementVisible(rt.ScoreMusic)&&this.scoreInfoGlyphs.set(rt.ScoreMusic,new Ai(0,0,"Music by "+r.music,i.wordsFont,Je.Right)),r.words&&e.isNotationElementVisible(rt.ScoreWords)&&this.scoreInfoGlyphs.set(rt.ScoreWords,new Ai(0,0,"Words by "+r.words,i.wordsFont,Je.Left)));const n=new br(this.renderer,this.renderer.tracks[0].staves[0].bars[0]);if(e.isNotationElementVisible(rt.GuitarTuning)){let s=[];for(let a of this.renderer.tracks)for(let o of a.staves)if(!o.isPercussion&&o.isStringed&&o.tuning.length>0&&o.showTablature){s.push(o);break}if(s.length>0){this.tuningGlyph=new LJ(0,0),this.tuningGlyph.renderer=n;for(const a of s)this.tuningGlyph.addTuning(a.stringTuning,s.length>1?a.track.name:"")}}if(e.isNotationElementVisible(rt.ChordDiagrams)){this.chordDiagrams=new EJ(0,0),this.chordDiagrams.renderer=n;let s=new Set;for(let a of this.renderer.tracks)for(let o of a.staves){const l=o.chords;if(l)for(const[,c]of l)s.has(c.uniqueId)||c.showDiagram&&(s.add(c.uniqueId),this.chordDiagrams.addChord(c))}}}get scale(){return this.renderer.settings.display.scale}createEmptyStaveGroup(){let e=new kh;e.layout=this;for(let r=0;r{c.color=i.mainGlyphColor,c.font=o,c.textAlign=Je.Left,c.fillText(r,0,n)}),e+s}}var je;(function(t){t[t.TopWithStem=0]="TopWithStem",t[t.Top=1]="Top",t[t.Center=2]="Center",t[t.Bottom=3]="Bottom",t[t.BottomWithStem=4]="BottomWithStem"})(je||(je={}));var Nr;(function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"})(Nr||(Nr={}));class br{get nextRenderer(){return!this.bar||!this.bar.nextBar?null:this.scoreRenderer.layout.getRendererForBar(this.staff.staveId,this.bar.nextBar)}get previousRenderer(){return!this.bar||!this.bar.previousBar?null:this.scoreRenderer.layout.getRendererForBar(this.staff.staveId,this.bar.previousBar)}constructor(e,r){this._preBeatGlyphs=new nd,this._voiceContainers=new Map,this._postBeatGlyphs=new nd,this._ties=[],this.x=0,this.y=0,this.width=0,this.computedWidth=0,this.height=0,this.index=0,this.topOverflow=0,this.bottomOverflow=0,this.isLinkedToPrevious=!1,this.canWrap=!0,this._wasFirstOfLine=!1,this._appliedLayoutingInfo=0,this.isFinalized=!1,this.topPadding=0,this.bottomPadding=0,this.scoreRenderer=e,this.bar=r,r&&(this.helpers=new NJ(this))}registerTies(e){this._ties.push(...e)}get middleYPosition(){return 0}registerOverflowTop(e){return e>this.topOverflow?(this.topOverflow=e,!0):!1}registerOverflowBottom(e){return e>this.bottomOverflow?(this.bottomOverflow=e,!0):!1}scaleToWidth(e){let r=e-this._preBeatGlyphs.width-this._postBeatGlyphs.width;for(const i of this._voiceContainers.values())i.scaleToWidth(r);this._postBeatGlyphs.x=this._preBeatGlyphs.x+this._preBeatGlyphs.width+r,this.width=e}get resources(){return this.settings.display.resources}get settings(){return this.scoreRenderer.settings}get scale(){return this.settings.display.scale}get barDisplayScale(){return this.staff.staveGroup.staves.length>1?this.bar.masterBar.displayScale:this.bar.displayScale}get barDisplayWidth(){return this.staff.staveGroup.staves.length>1?this.bar.masterBar.displayWidth:this.bar.displayWidth}get isFirstOfLine(){return this.index===0}get isLast(){return!this.bar||this.bar.index===this.scoreRenderer.layout.lastBarIndex}registerLayoutingInfo(){let e=this.layoutingInfo,r=this._preBeatGlyphs.width;e.preBeatSize=this.layoutingInfo.version)return!1;this._appliedLayoutingInfo=this.layoutingInfo.version,this._preBeatGlyphs.width=this.layoutingInfo.preBeatSize;let e=this._preBeatGlyphs.x+this._preBeatGlyphs.width;for(const i of this._voiceContainers.values()){i.x=this._preBeatGlyphs.x+this._preBeatGlyphs.width,i.applyLayoutingInfo(this.layoutingInfo);let n=i.x+i.width;e0&&this.scoreRenderer.layout.systemsLayoutMode==Pn.FromModelWithWidths&&(this.width=r,this.computedWidth=r),!0}finalizeRenderer(){this.isFinalized=!0;let e=!1;const r=this.y-this.staff.topSpacing,i=this.y+this.height+this.staff.bottomSpacing;for(const n of this._ties)if(n.doLayout(),n.height>0){const s=n.y+n.height-i;s>0&&this.registerOverflowBottom(s)&&(e=!0);const a=n.y-r;a<0&&this.registerOverflowTop(a*-1)&&(e=!0)}return e}doLayout(){if(this.bar){this.helpers.initialize(),this._ties=[],this._preBeatGlyphs=new nd,this._preBeatGlyphs.renderer=this,this._voiceContainers.clear(),this._postBeatGlyphs=new nd,this._postBeatGlyphs.renderer=this;for(let e=0;ethis.height&&(this.height=r.height)}}createOrResizeGlyph(e,r){let i;switch(e){case Et.FullBar:return i=this.info.createNewGlyph(this.renderer,r),i.renderer=this.renderer,i.beat=r,i.doLayout(),this._effectGlyphs[r.voice.index].set(r.index,i),this._uniqueEffectGlyphs[r.voice.index].push(i),i;case Et.SinglePreBeat:case Et.SingleOnBeat:case Et.SingleOnBeatToEnd:return i=this.info.createNewGlyph(this.renderer,r),i.renderer=this.renderer,i.beat=r,i.doLayout(),this._effectGlyphs[r.voice.index].set(r.index,i),this._uniqueEffectGlyphs[r.voice.index].push(i),i;case Et.GroupedOnBeat:case Et.GroupedOnBeatToEnd:let n=e===Et.GroupedOnBeat?Et.SingleOnBeat:Et.SingleOnBeatToEnd;if(r.index>0||this.renderer.index>0){let s=r.previousBeat;if(this.info.shouldCreateGlyph(this.renderer.settings,s)){let a=null;if(r.index>0&&this._effectGlyphs[r.voice.index].has(s.index))a=this._effectGlyphs[r.voice.index].get(s.index);else if(this.renderer.index>0){let c=this.renderer.previousRenderer.getBand(s.voice,this.info.effectId);if(c){let u=c._effectGlyphs[s.voice.index];u.has(s.index)&&(a=u.get(s.index))}}let o=this.createOrResizeGlyph(n,r);return a&&this.info.canExpand(s,r)&&(a.nextGlyph=o,o.previousGlyph=a,this.isLinkedToPrevious=!0),o}return this.createOrResizeGlyph(n,r)}return this.createOrResizeGlyph(n,r);default:return this.createOrResizeGlyph(Et.SingleOnBeat,r)}}paint(e,r,i){super.paint(e,r,i);for(let n=0,s=this._uniqueEffectGlyphs.length;nthis.shared.height&&(this.shared.height=e.height),(!this.shared.firstBeat||e.firstBeat.isBefore(this.shared.firstBeat))&&(this.shared.firstBeat=e.firstBeat),(!this.shared.lastBeat||e.lastBeat.isAfter(this.shared.lastBeat))&&(this.shared.lastBeat=e.lastBeat)}canBeUsed(e){return(!this.shared.uniqueEffectId&&e.info.canShareBand||e.info.effectId===this.shared.uniqueEffectId)&&(!this.shared.firstBeat||this.shared.lastBeat.isBefore(e.firstBeat)||this.shared.lastBeat.isBefore(this.shared.firstBeat))}}class VJ{constructor(){this.slots=[],this._effectSlot=new Map}getOrCreateSlot(e){if(this._effectSlot.has(e.info.effectId)){let i=this._effectSlot.get(e.info.effectId);if(i.canBeUsed(e))return i}for(let i of this.slots)if(i.canBeUsed(e))return i;let r=new AJ;return this.slots.push(r),r}register(e){let r=this.getOrCreateSlot(e);r.update(e),this._effectSlot.set(e.info.effectId,r)}}class oy extends ra{constructor(){super(0,0),this.computedWidth=0}doLayout(){let e=0;if(this.glyphs)for(let r=0,i=this.glyphs.length;r=0;r--)e(this.container.beat.notes[r])}}class HS extends oy{constructor(){super(...arguments),this.centerX=0}updateBeamingHelper(){}buildBoundingsLookup(e,r,i){}getNoteX(e,r){return 0}getNoteY(e,r){return 0}}class $J extends br{constructor(e,r,i){super(e,r),this._bands=[],this._bandLookup=new Map,this.sizingInfo=null,this._infos=i}updateSizes(){this.topOverflow=0,this.bottomOverflow=0,this.topPadding=0,this.bottomPadding=0,this.updateHeight(),super.updateSizes()}finalizeRenderer(){let e=super.finalizeRenderer();return this.updateHeight()&&(e=!0),e}updateHeight(){if(!this.sizingInfo)return!1;let e=0;for(let r of this.sizingInfo.slots){r.shared.y=e;for(let i of r.bands)i.y=e,i.height=r.shared.height;e+=r.shared.height}return e!==this.height?(this.height=e,!0):!1}applyLayoutingInfo(){if(!super.applyLayoutingInfo())return!1;if(this.index>0){let e=this.previousRenderer;this.sizingInfo=e.sizingInfo}else this.sizingInfo=new VJ;for(let e of this._bands)e.alignGlyphs(),e.isEmpty||this.sizingInfo.register(e);return this.updateHeight(),!0}scaleToWidth(e){super.scaleToWidth(e);for(let r of this._bands)r.alignGlyphs()}createBeatGlyphs(){this._bands=[],this._bandLookup=new Map;for(let e of this.bar.voices)if(this.hasVoiceContainer(e))for(let r of this._infos){let i=new IJ(e,r);i.renderer=this,i.doLayout(),this._bands.push(i),this._bandLookup.set(e.index+"."+r.effectId,i)}for(let e of this.bar.voices)this.hasVoiceContainer(e)&&this.createVoiceGlyphs(e);for(let e of this._bands)e.isLinkedToPrevious&&(this.isLinkedToPrevious=!0)}createVoiceGlyphs(e){for(let r of e.beats){let i=new Ys(r,this.getVoiceContainer(e));i.preNotes=new oy,i.onNotes=new HS,this.addBeatGlyph(i);for(let n of this._bands)n.createGlyph(r)}}paint(e,r,i){this.paintBackground(e,r,i);for(let n of this._bands)i.color=n.voice.index===0?this.resources.mainGlyphColor:this.resources.secondaryGlyphColor,n.isEmpty||n.paint(e+this.x,r+this.y,i)}getBand(e,r){let i=e.index+"."+r;return this._bandLookup.has(i)?this._bandLookup.get(i):null}}class mo extends WS{get staffId(){return this._staffId}constructor(e,r){super(),this._infos=r,this._staffId=e,this.isInAccolade=!1,this.isRelevantForBoundsLookup=!1}create(e,r){return new $J(e,r,this._infos.filter(i=>e.settings.notation.isNotationElementVisible(i.notationElement)))}}class Ch extends na{constructor(e,r,i){super(e,r),this._endingsString="",this._endings=[];for(let n=0;n0){let s=this.renderer.resources;i.font=s.wordsFont,i.moveTo(e+this.x,r+this.y+this.height),i.lineTo(e+this.x,r+this.y),i.lineTo(e+this.x+this.width,r+this.y),i.stroke(),i.fillText(this._endingsString,e+this.x+Ch.Padding*this.scale,r+this.y*this.scale)}i.textBaseline=n}}Ch.Padding=3;class vi{get effectId(){return this.notationElement.toString()}}class wb extends vi{get notationElement(){return rt.EffectAlternateEndings}get hideOnMultiTrack(){return!0}get canShareBand(){return!1}get sizingMode(){return Et.FullBar}shouldCreateGlyph(e,r){return r.voice.index===0&&r.index===0&&r.voice.bar.masterBar.alternateEndings!==0}createNewGlyph(e,r){return new Ch(0,0,r.voice.bar.masterBar.alternateEndings)}canExpand(e,r){return!0}}class lT extends vi{get notationElement(){return rt.EffectCapo}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return r.index===0&&r.voice.bar.index===0&&r.voice.bar.staff.capo!==0}createNewGlyph(e,r){return new Ai(0,0,"Capo. fret "+r.voice.bar.staff.capo,e.resources.effectFont,Je.Left)}canExpand(e,r){return!1}}class Sb extends vi{get notationElement(){return rt.EffectChordNames}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return r.hasChord}createNewGlyph(e,r){return new Ai(0,0,r.chord.name,e.resources.effectFont,Je.Center)}canExpand(e,r){return!1}}class Jh extends na{constructor(e){super(),this.forceGroupedRendering=!1,this.endOnBarLine=!1,this.endPosition=e}get isLinkedWithPrevious(){return!!this.previousGlyph&&this.previousGlyph.renderer.staff.staveGroup===this.renderer.staff.staveGroup}get isLinkedWithNext(){return!!this.nextGlyph&&this.nextGlyph.renderer.isFinalized&&this.nextGlyph.renderer.staff.staveGroup===this.renderer.staff.staveGroup}paint(e,r,i){if(this.isLinkedWithPrevious)return;if(!this.isLinkedWithNext&&!this.forceGroupedRendering){this.paintNonGrouped(e,r,i);return}let n;if(!this.isLinkedWithNext&&this.forceGroupedRendering)n=this;else for(n=this.nextGlyph;n.isLinkedWithNext;)n=n.nextGlyph;let s=n.renderer,a=n.beat,o=this.endPosition,l=e-this.renderer.x,c=this.calculateEndX(s,a,l,o);this.paintGrouped(e,r,c,i)}calculateEndX(e,r,i,n){return r?i+e.x+e.getBeatX(r,n):i+e.x+this.x+this.width}paintNonGrouped(e,r,i){let n=e-this.renderer.x,s=this.calculateEndX(this.renderer,this.beat,n,this.endPosition);this.paintGrouped(e,r,s,i)}}class Th extends Jh{constructor(e,r,i){super(vt.EndBeat),this._crescendo=pn.None,this._crescendo=i,this.x=e,this.y=r}doLayout(){super.doLayout(),this.height=17*this.scale}paintGrouped(e,r,i,n){let s=e+this.x,a=this.height*this.scale;n.beginPath(),this._crescendo===pn.Crescendo?(i-=Th.Padding*this.scale,n.moveTo(i,r+this.y),n.lineTo(s,r+this.y+a/2),n.lineTo(i,r+this.y+a)):(i-=Th.Padding*this.scale,n.moveTo(s,r+this.y),n.lineTo(i,r+this.y+a/2),n.lineTo(s,r+this.y+a)),n.stroke()}}Th.Padding=mt.QuarterNoteHeadWidth/2|0;class cT extends vi{get notationElement(){return rt.EffectCrescendo}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.GroupedOnBeatToEnd}shouldCreateGlyph(e,r){return r.crescendo!==pn.None}createNewGlyph(e,r){return new Th(0,0,r.crescendo)}canExpand(e,r){return e.crescendo===r.crescendo}}class US extends Er{constructor(e,r,i){super(e,r,.6,US.getSymbol(i))}doLayout(){super.doLayout(),this.height=17*this.scale,this.y+=this.height/2}static getSymbol(e){switch(e){case yt.PPP:return B.DynamicPPP;case yt.PP:return B.DynamicPP;case yt.P:return B.DynamicPiano;case yt.MP:return B.DynamicMP;case yt.MF:return B.DynamicMF;case yt.F:return B.DynamicForte;case yt.FF:return B.DynamicFF;case yt.FFF:return B.DynamicFFF;default:return B.None}}}class uT extends vi{get notationElement(){return rt.EffectDynamics}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyph(e,r){return this.internalShouldCreateGlyph(r)}internalShouldCreateGlyph(e){if(e.voice.bar.staff.track.score.stylesheet.hideDynamics||e.isEmpty||e.voice.isEmpty||e.isRest||e.graceType!==Ze.None)return!1;let r=this.getPreviousDynamicsBeat(e),i=e.voice.index===0&&!r||e.dynamics!==(r==null?void 0:r.dynamics);if(i&&e.voice.index>0){for(let n of e.voice.bar.voices)if(n.index0}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}canExpand(e,r){return!0}}class lo extends Jh{constructor(e){super(vt.OnNotes),this._label=e}doLayout(){this.renderer.settings.notation.extendLineEffectsToBeatEnd&&(this.endPosition=vt.EndBeat,this.forceGroupedRendering=!0),super.doLayout(),this.height=this.renderer.resources.effectFont.size}paintNonGrouped(e,r,i){let n=this.renderer.resources;i.font=n.effectFont;let s=i.textAlign;i.textAlign=Je.Center,i.fillText(this._label,e+this.x,r+this.y),i.textAlign=s}paintGrouped(e,r,i,n){this.paintNonGrouped(e,r,n);let s=3*this.scale,a=n.measureText(this._label),o=e+this.x+a/2+s,l=r+this.y+4*this.scale,c=8*this.scale;if(i>o){let u=o;for(;uo){let u=o;for(;u0&&r.voice.bar.masterBar.tripletFeel!==r.voice.bar.masterBar.previousMasterBar.tripletFeel)}createNewGlyph(e,r){return new zt(r.voice.bar.masterBar.tripletFeel)}canExpand(e,r){return!0}}class fT extends vi{get notationElement(){return rt.EffectWhammyBar}get hideOnMultiTrack(){return!1}get canShareBand(){return!1}get sizingMode(){return Et.GroupedOnBeat}shouldCreateGlyph(e,r){return r.hasWhammyBar}createNewGlyph(e,r){return new lo("w/bar")}canExpand(e,r){return!0}}class jf extends vi{get notationElement(){return rt.EffectWideBeatVibrato}get hideOnMultiTrack(){return!1}get canShareBand(){return!0}get sizingMode(){return Et.GroupedOnBeatToEnd}shouldCreateGlyph(e,r){return r.vibrato===Dt.Wide}createNewGlyph(e,r){return new MM(Dt.Wide)}canExpand(e,r){return!0}}class Yf extends Jl{get notationElement(){return rt.EffectWideNoteVibrato}shouldCreateGlyphForNote(e){return e.vibrato===Dt.Wide||e.isTieDestination&&e.tieOrigin.vibrato===Dt.Wide}get sizingMode(){return Et.GroupedOnBeatToEnd}createNewGlyph(e,r){return new Hl(0,0,Dt.Wide,1.2)}}class pT{constructor(){this.x=0,this.width=0,this.masterBars=[]}}class Zh extends RM{get name(){return"HorizontalScreen"}constructor(e){super(e),this._group=null,this._pagePadding=null}get supportsResize(){return!1}get firstBarX(){let e=this._pagePadding[0];return this._group&&(e+=this._group.accoladeSpacing),e}doResize(){}doLayoutAndRender(){switch(this._pagePadding=this.renderer.settings.display.padding,this.renderer.settings.display.systemsLayoutMode){case Go.Automatic:this.systemsLayoutMode=Pn.Automatic;break;case Go.UseModelLayout:this.systemsLayoutMode=Pn.FromModelWithWidths;break}this._pagePadding||(this._pagePadding=Zh.PagePadding),this._pagePadding.length===1?this._pagePadding=[this._pagePadding[0],this._pagePadding[0],this._pagePadding[0],this._pagePadding[0]]:this._pagePadding.length===2&&(this._pagePadding=[this._pagePadding[0],this._pagePadding[1],this._pagePadding[0],this._pagePadding[1]]);let e=this.renderer.score,r=this.renderer.settings.display.startBar;r--,r=Math.min(e.masterBars.length-1,Math.max(0,r));let i=r,n=this.renderer.settings.display.barCount;n<=0&&(n=e.masterBars.length),n=r+n-1,n=Math.min(e.masterBars.length-1,Math.max(0,n)),this._group=this.createEmptyStaveGroup(),this._group.isLast=!0,this._group.x=this._pagePadding[0],this._group.y=this._pagePadding[1];let s=this.renderer.settings.display.barCountPerPartial,a=[],o=new pT,l=0;for(;i<=n;){let u=this._group.addBars(this.renderer.tracks,i);if(u)if(o.masterBars.length===0&&u.isLinkedToPrevious&&a.length>0){let d=a[a.length-1];d.masterBars.push(e.masterBars[i]),d.width+=u.width,l+=u.width,o.x+=l}else o.masterBars.push(e.masterBars[i]),o.width+=u.width,o.masterBars.length>=s&&(a.length===0&&(o.width+=this._group.accoladeSpacing+this._pagePadding[0]),l+=o.width,a.push(o),he.debug(this.name,"Finished partial from bar "+o.masterBars[0].index+" to "+o.masterBars[o.masterBars.length-1].index,null),o=new pT,o.x=l);i++}o.masterBars.length>0&&(a.length===0&&(o.width+=this._group.accoladeSpacing+this._pagePadding[0]),a.push(o),he.debug(this.name,"Finished partial from bar "+o.masterBars[0].index+" to "+o.masterBars[o.masterBars.length-1].index,null)),this.finalizeGroup(),this.height=Math.floor(this._group.y+this._group.height),this.width=this._group.x+this._group.width+this._pagePadding[2],i=0;let c=0;for(let u=0;u{let y=this._group.getBarX(d.masterBars[0].index)+this._group.accoladeSpacing;f===0&&(y-=this._group.x+this._group.accoladeSpacing),m.color=this.renderer.settings.display.resources.mainGlyphColor,m.textAlign=Je.Left,he.debug(this.name,"Rendering partial from bar "+d.masterBars[0].index+" to "+d.masterBars[d.masterBars.length-1].index,null),this._group.paintPartial(-y,this._group.y,m,p,d.masterBars.length)}),i+=d.masterBars.length}this.height=this.layoutAndRenderAnnotation(this.height)+this._pagePadding[3]}finalizeGroup(){this._group.scaleToWidth(this._group.width),this._group.finalizeGroup()}}Zh.PagePadding=[20,20,20,20];Zh.GroupSpacing=20;class ef extends RM{get name(){return"PageView"}constructor(e){super(e),this._groups=[],this._allMasterBarRenderers=[],this._barsFromPreviousGroup=[],this._pagePadding=null}doLayoutAndRender(){switch(this.renderer.settings.display.systemsLayoutMode){case Go.Automatic:this.systemsLayoutMode=Pn.Automatic;break;case Go.UseModelLayout:this.systemsLayoutMode=Pn.FromModelWithScale;break}this._pagePadding=this.renderer.settings.display.padding,this._pagePadding||(this._pagePadding=ef.PagePadding),this._pagePadding.length===1?this._pagePadding=[this._pagePadding[0],this._pagePadding[0],this._pagePadding[0],this._pagePadding[0]]:this._pagePadding.length===2&&(this._pagePadding=[this._pagePadding[0],this._pagePadding[1],this._pagePadding[0],this._pagePadding[1]]);let e=0;this.width=this.renderer.width,this._allMasterBarRenderers=[],e=this.layoutAndRenderScoreInfo(e,-1),e=this.layoutAndRenderTunings(e,-1),e=this.layoutAndRenderChordDiagrams(e,-1),e=this.layoutAndRenderScore(e),e=this.layoutAndRenderAnnotation(e),this.height=e+this._pagePadding[3]}get supportsResize(){return!0}get firstBarX(){let e=this._pagePadding[0];return this._groups.length>0&&(e+=this._groups[0].accoladeSpacing),e}doResize(){let e=0;this.width=this.renderer.width;let r=this.height;e=this.layoutAndRenderScoreInfo(e,r),e=this.layoutAndRenderTunings(e,r),e=this.layoutAndRenderChordDiagrams(e,r),e=this.resizeAndRenderScore(e,r),e=this.layoutAndRenderAnnotation(e),this.height=e+this._pagePadding[3]}layoutAndRenderTunings(e,r=-1){if(!this.tuningGlyph)return e;let i=this.renderer.settings.display.resources;this.tuningGlyph.x=this._pagePadding[0],this.tuningGlyph.width=this.width,this.tuningGlyph.doLayout();let n=this.tuningGlyph.height+11*this.scale;const s=new kl;return s.x=0,s.y=e,s.width=this.width,s.height=n,s.totalWidth=this.width,s.totalHeight=r<0?e+s.height:r,this.registerPartial(s,a=>{a.color=i.scoreInfoColor,a.textAlign=Je.Center,this.tuningGlyph.paint(0,0,a)}),e+n}layoutAndRenderChordDiagrams(e,r=-1){if(!this.chordDiagrams)return e;const i=this.renderer.settings.display.resources;this.chordDiagrams.width=this.width,this.chordDiagrams.doLayout();const n=Math.floor(this.chordDiagrams.height),s=new kl;return s.x=0,s.y=e,s.width=this.width,s.height=n,s.totalWidth=this.width,s.totalHeight=r<0?e+n:r,this.registerPartial(s,a=>{a.color=i.scoreInfoColor,a.textAlign=Je.Center,this.chordDiagrams.paint(0,0,a)}),e+n}layoutAndRenderScoreInfo(e,r=-1){he.debug(this.name,"Layouting score info");const i=new kl;i.x=0,i.y=e;let n=this._pagePadding[1],s=this.scale,a=this.renderer.settings.display.resources,o=[rt.ScoreTitle,rt.ScoreSubTitle,rt.ScoreArtist,rt.ScoreAlbum,rt.ScoreWordsAndMusic];for(let u=0;u{u.color=a.scoreInfoColor,u.textAlign=Je.Center;for(const d of this.scoreInfoGlyphs.values())d.paint(0,0,u)}),e+n}resizeAndRenderScore(e,r){if(this.renderer.settings.display.barsPerRow>0||this.systemsLayoutMode==Pn.FromModelWithScale)for(let n=0;n1;)o=a.revertLastBar(),n--;a.isFull=!0,a.isLast=this.lastBarIndex===a.lastBarIndex,this._groups.push(a),this.fitGroup(a),e+=this.paintGroup(a,r),a=this.createEmptyStaveGroup(),a.index=this._groups.length,a.x=this._pagePadding[0],a.y=e}}a.isLast=this.lastBarIndex===a.lastBarIndex,this.fitGroup(a),e+=this.paintGroup(a,r)}return e}layoutAndRenderScore(e){let i=this.firstBarIndex,n=this.lastBarIndex;for(this._groups=[];i<=n;){let s=this.createStaveGroup(i,n);this._groups.push(s),s.x=this._pagePadding[0],s.y=e,i=s.lastBarIndex+1,this.fitGroup(s),he.debug(this.name,"Rendering partial from bar "+s.firstBarIndex+" to "+s.lastBarIndex,null),e+=this.paintGroup(s,e)}return e}paintGroup(e,r){let i=Math.floor(e.height+20*this.scale);const n=new kl;return n.x=0,n.y=e.y,n.totalWidth=this.width,n.totalHeight=r,n.width=this.width,n.height=i,n.firstMasterBarIndex=e.firstBarIndex,n.lastMasterBarIndex=e.lastBarIndex,e.buildBoundingsLookup(0,0),this.registerPartial(n,s=>{this.renderer.canvas.color=this.renderer.settings.display.resources.mainGlyphColor,this.renderer.canvas.textAlign=Je.Left,e.paint(0,-n.y,s)}),r+=i,i}fitGroup(e){e.isFull||e.width>this.maxWidth||this.renderer.settings.display.justifyLastSystem?e.scaleToWidth(this.maxWidth):e.scaleToWidth(e.width),e.finalizeGroup()}getBarsPerRow(e){let r=this.renderer.settings.display.barsPerRow;if(this.systemsLayoutMode==Pn.FromModelWithScale){let i,n;this.renderer.tracks.length>1?(i=this.renderer.score.defaultSystemsLayout,n=this.renderer.score.systemsLayout):(i=this.renderer.tracks[0].defaultSystemsLayout,n=this.renderer.tracks[0].systemsLayout),r=e0)for(let c of this._barsFromPreviousGroup)i.addMasterBarRenderers(this.renderer.tracks,c),o=c.masterBar.index;else{let c=i.addBars(this.renderer.tracks,o);c&&this._allMasterBarRenderers.push(c)}this._barsFromPreviousGroup=[];let l=!1;if((n===-1&&i.width>=s&&i.masterBarsRenderers.length!==0||i.masterBarsRenderers.length===n+1)&&(l=!0),l){let c=i.revertLastBar();if(c)for(this._barsFromPreviousGroup.push(c);c&&!c.canWrap&&i.masterBarsRenderers.length>1;)c=i.revertLastBar(),c&&this._barsFromPreviousGroup.push(c);return i.isFull=!0,i.isLast=!1,this._barsFromPreviousGroup.reverse(),i}i.x=0,o++}return i.isLast=r===i.lastBarIndex,i}get maxWidth(){return this.renderer.width-this._pagePadding[0]-this._pagePadding[2]}}ef.PagePadding=[40,40,40,40];ef.GroupSpacing=20;class Oo extends Er{constructor(e,r,i,n=!1){super(e,r,n?mt.GraceScale:1,Oo.getMusicSymbol(i)),this._isGrace=n,this._accidentalType=i}static getMusicSymbol(e){switch(e){case $t.Natural:return B.AccidentalNatural;case $t.Sharp:return B.AccidentalSharp;case $t.Flat:return B.AccidentalFlat;case $t.NaturalQuarterNoteUp:return B.AccidentalQuarterToneNaturalArrowUp;case $t.SharpQuarterNoteUp:return B.AccidentalQuarterToneSharpArrowUp;case $t.FlatQuarterNoteUp:return B.AccidentalQuarterToneFlatArrowUp;case $t.DoubleSharp:return B.AccidentalDoubleSharp;case $t.DoubleFlat:return B.AccidentalDoubleFlat}return B.None}doLayout(){switch(this._accidentalType){case $t.DoubleFlat:this.width=18;break;default:this.width=8;break}this.width=this.width*(this._isGrace?mt.GraceScale:1)*this.scale}}class DM extends Dr{constructor(e,r,i){super(e,r),this._number=0,this._number=i}doLayout(){this.renderer.scoreRenderer.canvas.font=this.renderer.resources.barNumberFont,this.width=this.renderer.scoreRenderer.canvas.measureText(this._number.toString())+5*this.scale}paint(e,r,i){if(!this.renderer.staff.isFirstInAccolade)return;let n=this.renderer.resources,s=i.color;i.color=n.barNumberColor,i.font=n.barNumberFont,i.fillText(this._number.toString(),e+this.x,r+this.y),i.color=s}}class LM extends Dr{constructor(e,r){super(e,r)}doLayout(){this.renderer.isLast?this.width=15*this.scale:!this.renderer.nextRenderer||this.renderer.nextRenderer.staff!==this.renderer.staff||!this.renderer.nextRenderer.bar.masterBar.isRepeatStart?(this.width=2*this.scale,this.renderer.bar.masterBar.isDoubleBar&&(this.width+=2*this.scale)):this.width=2*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x,l=a-s;this.renderer.isLast?(i.fillRect(o+this.width-n-n,s,this.scale,l),i.fillRect(o+this.width-n,s,n,l)):(!this.renderer.nextRenderer||this.renderer.nextRenderer.staff!==this.renderer.staff||!this.renderer.nextRenderer.bar.masterBar.isRepeatStart)&&(i.fillRect(o+this.width-this.scale,s,this.scale,l),this.renderer.bar.masterBar.isDoubleBar&&i.fillRect(o+this.width-5*this.scale,s,this.scale,l))}}class jS extends Er{constructor(e,r,i,n){super(e,r,1,jS.getSymbol(i)),this._clef=i,this._clefOttava=n}doLayout(){switch(this._clef){case ot.Neutral:this.width=15*this.scale;break;case ot.C3:case ot.C4:case ot.F4:case ot.G2:this.width=28*this.scale;break}}static getSymbol(e){switch(e){case ot.Neutral:return B.UnpitchedPercussionClef1;case ot.C3:return B.CClef;case ot.C4:return B.CClef;case ot.F4:return B.FClef;case ot.G2:return B.GClef;default:return B.None}}paint(e,r,i){super.paint(e,r,i);let n,s=!1;switch(this._clefOttava){case Ft._15ma:n=new Er(-4*this.scale,0,.5,B.Quindicesima),s=!0;break;case Ft._8va:n=new Er(-2*this.scale,0,.5,B.Ottava),s=!0;break;case Ft._8vb:n=new Er(-6*this.scale,0,.5,B.Ottava);break;case Ft._15mb:n=new Er(-8*this.scale,0,.5,B.Quindicesima);break;default:return}let a=0,o=0;switch(this._clef){case ot.Neutral:a=s?-12:15,o=0;break;case ot.C3:a=s?-19:27,o=0;break;case ot.C4:a=s?-19:27,o=0;break;case ot.F4:a=s?-9:27,o=-4;break;case ot.G2:a=s?-37:30,o=0;break;default:return}n.renderer=this.renderer,n.doLayout();let l=this.width/2;n.paint(e+this.x+l+o*this.scale,r+this.y+a*this.scale,i)}}class FM extends Dr{constructor(e,r){super(e,r)}doLayout(){this.width=11*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x,l=a-s,c=1.5*this.scale,u=(s+a)/2,d=3;i.fillCircle(o,u-c*d,c),i.fillCircle(o,u+c*d,c),o+=4*this.scale,i.beginPath(),i.moveTo(o,s),i.lineTo(o,a),i.stroke(),o+=3*this.scale+.5,i.fillRect(o,s,n,l)}}class IM extends Dr{constructor(e,r,i){super(e,r),this._count=0,this._count=0,this._count=i}doLayout(){this.width=0}paint(e,r,i){let n=this.renderer.resources,s=i.textAlign;i.font=n.barNumberFont,i.textAlign=Je.Right;let a="x"+this._count,o=i.measureText(a)/1.5;i.fillText(a,e+this.x-o,r+this.y),i.textAlign=s}}class OM extends Dr{constructor(e,r,i,n){super(e,r),this._dotOffset=0,this._circleSize=0,this._dotOffset=0,this._circleSize=0,this._dotOffset=n,this._circleSize=i}doLayout(){this.width=13*this.scale}paint(e,r,i){let n=4*this.scale,s=r+this.y+this.renderer.topPadding,a=r+this.y+this.renderer.height-this.renderer.bottomPadding,o=e+this.x+.5,l=a-s;i.fillRect(o,s,n,l),o+=n*2-.5,i.beginPath(),i.moveTo(o,s),i.lineTo(o,a),i.stroke(),o+=3*this.scale;let c=this._circleSize*this.scale,u=(s+a)/2;i.fillCircle(o,u-c*this._dotOffset,c),i.fillCircle(o,u+c*this._dotOffset,c)}}class vm extends Er{constructor(e,r,i){super(e,r,1,vm.getSymbol(i))}static getSymbol(e){switch(e){case Yr.None:return B.None;case Yr.Normal:return B.ArticAccentAbove;case Yr.Heavy:return B.ArticMarcatoAbove;default:return B.None}}doLayout(){this.width=9*this.scale,this.height=9*this.scale}paint(e,r,i){super.paint(e-2*this.scale,r+this.height,i)}}class gv extends Dr{constructor(e,r,i){super(e,r),this._size=0,this._size=i}doLayout(){this.width=this._size+3*this.scale}paint(e,r,i){i.fillCircle(e+this.x,r+this.y,this._size)}}class jJ extends Er{constructor(e,r,i){super(e,r,i?mt.GraceScale:1,B.NoteheadXOrnate),this._isGrace=i}doLayout(){this.width=9*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*this.scale}}class wm extends Er{constructor(e,r,i,n){super(e,r,n?mt.GraceScale:1,wm.getSymbol(i)),this._isGrace=n}static getSymbol(e){switch(e){case H.QuadrupleWhole:case H.DoubleWhole:case H.Whole:case H.Half:return B.NoteheadDiamondWhiteWide;default:return B.NoteheadDiamondBlackWide}}doLayout(){this.width=9*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*this.scale}}class hi extends Dr{constructor(e,r,i){super(0,0),this.yOffset=0,this.startNoteRenderer=null,this.endNoteRenderer=null,this.tieDirection=we.Up,this._startX=0,this._startY=0,this._endX=0,this._endY=0,this._tieHeight=0,this._shouldDraw=!1,this.startBeat=e,this.endBeat=r,this.forEnd=i}doLayout(){if(this.width=0,!this.endBeat){this._shouldDraw=!1;return}let e=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this.startBeat.voice.bar);this.startNoteRenderer=e;let r=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this.endBeat.voice.bar);this.endNoteRenderer=r,this._startX=0,this._endX=0,this._startY=0,this._endY=0,this.height=0,this._shouldDraw=!1,this.tieDirection=e?this.getBeamDirection(this.startBeat,e):this.getBeamDirection(this.endBeat,r),!this.forEnd&&e?(e!==r?(this._startX=e.x+this.getStartX(),this._startY=e.y+this.getStartY()+this.yOffset,!r||e.staff!==r.staff?(this._endX=e.x+e.width,this._endY=this._startY):(this._endX=r.x+this.getEndX(),this._endY=r.y+this.getEndY()+this.yOffset)):(this._startX=e.x+this.getStartX(),this._endX=r.x+this.getEndX(),this._startY=e.y+this.getStartY()+this.yOffset,this._endY=r.y+this.getEndY()+this.yOffset),this._shouldDraw=!0):(!e||e.staff!==r.staff)&&(this._startX=r.x,this._endX=r.x+this.getEndX(),this._startY=r.y+this.getEndY()+this.yOffset,this._endY=this._startY,this._shouldDraw=!0),this._shouldDraw&&(this.y=Math.min(this._startY,this._endY),this.shouldDrawBendSlur()?this._tieHeight=0:(this._tieHeight=this.getTieHeight(this._startX,this._startY,this._endX,this._endY),this.height=hi.calculateActualTieHeight(this.renderer.scale,this._startX,this._startY,this._endX,this._endY,this.tieDirection===we.Down,this._tieHeight,4).h),this.tieDirection===we.Up&&(this.y-=this.height))}paint(e,r,i){this._shouldDraw&&(this.shouldDrawBendSlur()?hi.drawBendSlur(i,e+this._startX,r+this._startY,e+this._endX,r+this._endY,this.tieDirection===we.Down,this.scale):hi.paintTie(i,this.scale,e+this._startX,r+this._startY,e+this._endX,r+this._endY,this.tieDirection===we.Down,this._tieHeight,4))}shouldDrawBendSlur(){return!1}getTieHeight(e,r,i,n){return 22}getBeamDirection(e,r){return we.Down}getStartY(){return 0}getEndY(){return 0}getStartX(){return 0}getEndX(){return 0}static calculateActualTieHeight(e,r,i,n,s,a,o,l){const c=hi.computeBezierControlPoints(e,r,i,n,s,a,o,l);r=c[0],i=c[1];const u=c[2],d=c[3];n=c[6],s=c[7];const h=(r-u)/(r-2*u+n),p=hi.calculateExtrema(r,i,u,d,n,s,h),f=p.length>0?Math.min(r,n,p[0]):Math.min(r,n),m=p.length>0?Math.max(r,n,p[0]):Math.max(r,n),y=(i-d)/(i-2*d+s),v=hi.calculateExtrema(r,i,u,d,n,s,y),g=v.length>0?Math.min(i,s,v[1]):Math.min(i,s),b=v.length>0?Math.max(i,s,v[1]):Math.max(i,s),k=new dn;return k.x=f,k.y=g,k.w=m-f,k.h=b-g,k}static calculateExtrema(e,r,i,n,s,a,o){if(o<=0||1<=o)return[];const l=e+(i-e)*o,c=r+(n-r)*o,u=i+(s-i)*o,d=n+(a-n)*o;return[l+(u-l)*o,c+(d-c)*o]}static computeBezierControlPoints(e,r,i,n,s,a,o,l){if(r===n&&i===s)return[];if(nn.line-s.line);let r=null,i=e.getScoreHeight(1);for(let n=0,s=this._infos.length;n0?this._glyphs[0].width:0}paint(e,r,i){super.paint(e,r,i);for(let n of this._glyphs)n.paint(e+this.x,r+this.y,i)}}class XJ{constructor(e,r){this.line=0,this.glyph=e,this.line=r}}class AM extends Dr{constructor(){super(0,0),this._infos=[],this._noteHeadPadding=0,this.minNote=null,this.maxNote=null,this.spacingChanged=new li,this.upLineX=0,this.downLineX=0,this.displacedX=0,this.noteStartX=0}add(e,r){let i=new XJ(e,r);this._infos.push(i),(!this.minNote||this.minNote.line>i.line)&&(this.minNote=i),(!this.maxNote||this.maxNote.line8}doLayout(){this._infos.sort((o,l)=>l.line-o.line);let e=0,r=!1,i=0,n=!1,s=this.direction,a=0;for(let o=0,l=this._infos.length;o=this.minNote.line;){let d=r+n.getScoreY(u);i.fillRect(e-s+this.noteStartX,d,a,this.scale),u-=2}i.color=c}if(this.hasBottomOverflow){let c=i.color;i.color=n.resources.staffLineColor;let u=10;for(;u<=this.maxNote.line;){let d=r+n.getScoreY(u);i.fillRect(e-s+this.noteStartX,d,a,this.scale),u+=2}i.color=c}let o=this._infos,l=e+this._noteHeadPadding;for(let c of o)c.glyph.renderer=this.renderer,c.glyph.paint(l,r,i)}}class cy extends Er{constructor(e,r,i){super(e,r,1,cy.getSymbol(i))}doLayout(){this.width=12*this.scale}static getSymbol(e){switch(e){case H.ThirtySecond:return B.Tremolo3;case H.Sixteenth:return B.Tremolo2;case H.Eighth:return B.Tremolo1;default:return B.None}}}class qJ extends AM{constructor(){super(),this._noteGlyphLookup=new Map,this._notes=[],this._tremoloPicking=null,this.aboveBeatEffects=new Map,this.belowBeatEffects=new Map}get direction(){return this.beamingHelper.direction}getNoteX(e,r){if(this._noteGlyphLookup.has(e.id)){let i=this._noteGlyphLookup.get(e.id),n=this.x+i.x+this._noteHeadPadding;switch(r){case Nr.Left:break;case Nr.Center:n+=i.width/2;break;case Nr.Right:n+=i.width;break}return n}return 0}getNoteY(e,r){if(this._noteGlyphLookup.has(e.id)){const i=this._noteGlyphLookup.get(e.id);let n=this.y+i.y;switch(r){case je.TopWithStem:n-=this.renderer.getStemSize(this.beamingHelper);break;case je.Top:n-=i.height/2;break;case je.Center:break;case je.Bottom:n+=i.height/2;break;case je.BottomWithStem:n+=this.renderer.getStemSize(this.beamingHelper);break}return n}return 0}addNoteGlyph(e,r,i){super.add(e,i),this._noteGlyphLookup.set(r.id,e),this._notes.push(r)}updateBeamingHelper(e){this.beamingHelper&&this.beamingHelper.registerBeatLineX("score",this.beat,e+this.x+this.upLineX,e+this.x+this.downLineX)}doLayout(){super.doLayout();let e=this.direction;for(const r of this.aboveBeatEffects.values())r.renderer=this.renderer,r.doLayout();for(const r of this.belowBeatEffects.values())r.renderer=this.renderer,r.doLayout();if(this.beat.isTremolo){let r=0,i=e===we.Up?this.minNote:this.maxNote,n=e===we.Up?this.displacedX:0,s=this.beat.tremoloSpeed;switch(s){case H.ThirtySecond:r=e===we.Up?-15:15;break;case H.Sixteenth:r=e===we.Up?-12:15;break;case H.Eighth:r=e===we.Up?-10:10;break;default:r=e===we.Up?-10:15;break}this._tremoloPicking=new cy(n,i.glyph.y+r*this.scale,s),this._tremoloPicking.renderer=this.renderer,this._tremoloPicking.doLayout()}}buildBoundingsLookup(e,r,i){for(let n of this._notes)if(this._noteGlyphLookup.has(n.id)){let s=this._noteGlyphLookup.get(n.id),a=new VS;a.note=n,a.noteHeadBounds=new dn,a.noteHeadBounds.x=r+this.x+this._noteHeadPadding+s.x,a.noteHeadBounds.y=i+this.y+s.y-s.height/2,a.noteHeadBounds.w=s.width,a.noteHeadBounds.h=s.height,e.addNote(a)}}paint(e,r,i){let n=this.renderer,s=0,a=0,o=1,l=-o;this.beamingHelper.direction===we.Up?(a=n.getScoreY(this.minNote.line),s=n.getScoreY(this.maxNote.line-2)):(a=n.getScoreY(this.maxNote.line-1),s=n.getScoreY(this.minNote.line+1),l*=-1,o*=-1);for(const c of this.aboveBeatEffects.values())s+=l*c.height,c.paint(e+this.x+2*this.scale,r+this.y+s,i);for(const c of this.belowBeatEffects.values())a+=o*c.height,c.paint(e+this.x+2*this.scale,r+this.y+a,i);super.paint(e,r,i),this._tremoloPicking&&this._tremoloPicking.paint(e,r,i)}}class fu extends Er{constructor(e,r,i){super(e,r,1,fu.getSymbol(i)),this._duration=i}static getSymbol(e){switch(e){case H.QuadrupleWhole:return B.RestLonga;case H.DoubleWhole:return B.RestDoubleWhole;case H.Whole:return B.RestWhole;case H.Half:return B.RestHalf;case H.Quarter:return B.RestQuarter;case H.Eighth:return B.RestEighth;case H.Sixteenth:return B.RestSixteenth;case H.ThirtySecond:return B.RestThirtySecond;case H.SixtyFourth:return B.RestSixtyFourth;case H.OneHundredTwentyEighth:return B.RestOneHundredTwentyEighth;case H.TwoHundredFiftySixth:return B.RestTwoHundredFiftySixth;default:return B.None}}static getSize(e){switch(e){case H.QuadrupleWhole:case H.DoubleWhole:case H.Whole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:return 9;case H.ThirtySecond:return 12;case H.SixtyFourth:return 14;case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:return 20}return 10}doLayout(){this.width=fu.getSize(this._duration)*this.scale}updateBeamingHelper(e){this.beamingHelper&&this.beamingHelper.registerBeatLineX("score",this.beat,e+this.x+this.width/2,e+this.x+this.width/2)}}class mT{constructor(){this.x=0,this.y=-3e3,this.width=0}}class VM extends ra{constructor(){super(0,0)}doLayout(){if(!this.glyphs||this.glyphs.length===0){this.width=0;return}this.glyphs.sort((i,n)=>i.yn.y?1:0);let e=[];e.push(new mT);let r=21*this.scale;for(let i=0,n=this.glyphs.length;is.y;)a++,a===e.length&&e.push(new mT);s.x=a,e[a].y=s.y+r,e[a].width0&&(this._releaseMinValue===-1||i0&&(this._releaseMinValue===-1||i0&&(this._releaseMinValue===-1||i=0&&(n[1].lineValue=r);break;case We.BendRelease:n[1].lineValue=this._bendMiddleMinValue,r=i.isTieOrigin?this._releaseContinuedMinValue:this._releaseMinValue,r>=0&&(n[2].lineValue=r);break;case We.Prebend:n[0].lineValue=this._preBendMinValue;break;case We.PrebendBend:n[0].lineValue=this._preBendMinValue,n[1].lineValue=i.isTieOrigin?this._bendEndContinuedMinValue:this._bendEndMinValue;break;case We.PrebendRelease:n[0].lineValue=this._preBendMinValue,r=i.isTieOrigin?this._releaseContinuedMinValue:this._releaseMinValue,r>=0&&(n[1].lineValue=r);break}}this.width=0,this._notes.sort((i,n)=>i.isStringed?i.string-n.string:i.realValue-n.realValue)}createRenderingPoints(e){let r=[];switch(e.bendType){case We.Custom:for(let i of e.bendPoints)r.push(new go(i.offset,i.value));break;case We.BendRelease:r.push(new go(0,e.bendPoints[0].value)),r.push(new go(Me.MaxPosition/2|0,e.bendPoints[1].value)),r.push(new go(Me.MaxPosition,e.bendPoints[3].value));break;case We.Bend:case We.Hold:case We.Prebend:case We.PrebendBend:case We.PrebendRelease:case We.Release:r.push(new go(0,e.bendPoints[0].value)),r.push(new go(Me.MaxPosition,e.bendPoints[1].value));break}return r}paint(e,r,i){let n=i.color;this._notes.length>1&&(i.color=this.renderer.resources.secondaryGlyphColor);for(let s of this._notes){let a=this._renderPoints.get(s.id),o=this.renderer,l=s,c=!1,u=null,d=!1,h=s.bendStyle===Gt.Gradual?"grad.":"",p=null;for(;l.isTieOrigin;){let b=l.tieDestination;if(u=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,b.beat.voice.bar),!u||o.staff!==u.staff)break;if(l=b,c=!0,l.hasBend||!this.renderer.settings.notation.extendBendArrowsOnTiedNotes){d=!0;break}}p=l.beat,u=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,p.voice.bar),p.isLastOfVoice&&!l.hasBend&&this.renderer.settings.notation.extendBendArrowsOnTiedNotes&&(p=null);let f=0,m=0,y=r+o.y;f=e+o.x,a[0].value>0||s.isContinuedBend?f+=o.getBeatX(s.beat,vt.MiddleNotes):f+=o.getNoteX(s,Nr.Right),!p||p.isLastOfVoice&&!d?m=e+u.x+u.postBeatGlyphsStart:d||!p.nextBeat?m=e+u.x+u.getBeatX(p,vt.MiddleNotes):s.bendType===We.Hold?m=e+u.x+u.getBeatX(p.nextBeat,vt.OnNotes):m=e+u.x+u.getBeatX(p.nextBeat,vt.PreNotes),c||(m-=hs.ArrowSize*this.scale);let g=(m-f)/Me.MaxPosition;i.beginPath();for(let b=0,k=a.length-1;br.value?(y+g>f&&(y=f-g),l.beginPath(),l.moveTo(m,y),l.lineTo(m-g*.5,y+g),l.lineTo(m+g*.5,y+g),l.closePath(),l.fill(),v=g):i.value!==r.value&&(y0){let b=m,k=hs.DashSize*this.scale,C=h+k;if((b-h)/(k*2)<1)l.moveTo(b,f),l.lineTo(h,f);else for(;b>C;)l.moveTo(b,f),l.lineTo(b-k,f),b-=k*2;l.stroke()}}else m>h?(l.moveTo(h,f),l.bezierCurveTo((h+m)/2,f,m,f,m,y+v),l.stroke()):(l.moveTo(h,f),l.lineTo(m,y),l.stroke());if(o&&r.offsety){let x=Math.abs(f-y);k=x>l.font.size*1.3?f-x/2:f,C=(h+m-b)/2}else k=f,C=m-b;l.fillText(o,C,k)}if(i.value!==0&&r.value!==i.value){let b=i.value,k=i.value>r.value;b=Math.abs(b);let C="";if(b===4)C="full",b-=4;else if(b>=4||b<=-4){let x=b/4|0;C+=x,b-=x*4}if(b>0&&(C+=hs.getFractionSign(b)),C!==""){y=s-p*i.value;let x=y;k||(x=f+Math.abs(y-f)*1/3),l.font=u.tablatureFont;let _=l.measureText(C),P=x-u.tablatureFont.size*.5-2*this.scale,R=m-_/2;l.fillText(C,R,P)}}}static getFractionSign(e){switch(e){case 1:return"¼";case 2:return"½";case 3:return"¾";default:return e+"/ 4"}}}hs.ArrowSize=6;hs.DashSize=3;hs.BendValueHeight=6;class zn extends Dr{constructor(e){super(0,0),this._isSimpleDip=!1,this._beat=e,this._renderPoints=this.createRenderingPoints(e)}createRenderingPoints(e){if(e.whammyBarType===Lt.Custom)return e.whammyBarPoints;let r=[];switch(e.whammyBarType){case Lt.Dive:case Lt.Hold:case Lt.PrediveDive:case Lt.Predive:r.push(new Me(0,e.whammyBarPoints[0].value)),r.push(new Me(Me.MaxPosition,e.whammyBarPoints[1].value));break;case Lt.Dip:r.push(new Me(0,e.whammyBarPoints[0].value)),r.push(new Me(Me.MaxPosition/2|0,e.whammyBarPoints[1].value)),r.push(new Me(Me.MaxPosition,e.whammyBarPoints[e.whammyBarPoints.length-1].value));break}return r}doLayout(){super.doLayout(),this._isSimpleDip=this.renderer.settings.notation.notationMode===ai.SongBook&&this._beat.whammyBarType===Lt.Dip;let e=null,r=null,i=this._beat;for(;i&&i.hasWhammyBar;)(!e||e.value>i.minWhammyPoint.value)&&(e=i.minWhammyPoint),(!r||r.value0?Math.abs(this.getOffset(r.value)):0;(n>0||this._beat.whammyBarPoints[0].value!==0||this.renderer.settings.notation.isNotationElementVisible(rt.ZerosOnDiveWhammys))&&(n+=this.renderer.resources.tablatureFont.size*2);let s=e.value<0?Math.abs(this.getOffset(e.value)):0;this.renderer.registerOverflowTop(n+s);let a=this.renderer.staff.getSharedLayoutData(zn.TopOffsetSharedDataKey,-1);n>a&&this.renderer.staff.setSharedLayoutData(zn.TopOffsetSharedDataKey,n)}getOffset(e){if(e===0)return 0;let r=zn.PerHalfSize*this.scale+Math.log2(Math.abs(e)/2)*zn.PerHalfSize*this.scale;return e<0&&(r=-r),r}paint(e,r,i){let n=this.renderer,s=this._beat.nextBeat,a=null,o=vt.PreNotes;s&&(a=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,s.voice.bar),!a||a.staff!==n.staff||a!==n&&!s.hasWhammyBar?(s=null,a=null):o=s.hasWhammyBar&&(n.settings.notation.notationMode!==ai.SongBook||s.whammyBarType!==Lt.Dip)?vt.MiddleNotes:vt.PreNotes);let l=0,c=0;this._isSimpleDip?(l=e+n.x+n.getBeatX(this._beat,vt.OnNotes)-2*this.scale,c=e+n.x+n.getBeatX(this._beat,vt.PostNotes)+2*this.scale):(l=e+n.x+n.getBeatX(this._beat,vt.MiddleNotes),c=a?e+a.x+a.getBeatX(s,o):e+n.x+n.width-2*this.scale);let u=i.textAlign;if(i.textAlign=Je.Center,this._renderPoints.length>=2){let d=(c-l)/Me.MaxPosition;i.beginPath();let h=r+this.renderer.staff.getSharedLayoutData(zn.TopOffsetSharedDataKey,0),p=this._beat.whammyStyle===Gt.Gradual?"grad.":"";for(let f=0,m=this._renderPoints.length-1;fb;)l.moveTo(u,b),l.lineTo(u,b+y),b+=y*2}l.stroke()}else if(r.value===i.value){let y=zn.DashSize*this.scale;if(Math.abs(d-u)/(y*2)<1)l.moveTo(u,h),l.lineTo(d,p);else{let g=Math.max(u,d),b=Math.min(u,d);for(;g>b;)l.moveTo(g,h),l.lineTo(g-y,h),g-=y*2}l.stroke()}else l.moveTo(u,h),l.lineTo(d,p);let f=this.renderer.resources;if(e&&!this._beat.isContinuedWhammy&&!this._isSimpleDip){let y=h;y-=f.tablatureFont.size+2*this.scale,this.renderer.settings.notation.isNotationElementVisible(rt.ZerosOnDiveWhammys)&&l.fillText("0",u,y),c&&(y-=f.tablatureFont.size+2*this.scale,l.fillText(c,u,y))}let m=Math.abs(i.value);if((m!==0||this.renderer.settings.notation.isNotationElementVisible(rt.ZerosOnDiveWhammys)&&!this._isSimpleDip)&&r.value!==i.value){let y="";if(i.value<0&&(y+="-"),m>=4){let b=m/4|0;y+=b,m-=b*4}else m===0&&(y+="0");m>0&&(y+=hs.getFractionSign(m));let v=0;this._isSimpleDip?v=Math.min(h,p)-f.tablatureFont.size-2*this.scale:(v=r.offset===i.offset?Math.min(h,p):p,v-=f.tablatureFont.size+2*this.scale,n&&n.value>i.value&&(v-=2*this.scale));let g=d;l.fillText(y,g,v)}}}zn.TopOffsetSharedDataKey="tab.whammy.topoffset";zn.PerHalfSize=6;zn.DashSize=3;class Nl extends YS{constructor(e){super(0,0),this._beat=e}doLayout(){let e=this.renderer.settings.notation.notationMode;switch(this._beat.whammyBarType){case Lt.None:case Lt.Custom:case Lt.Hold:return;case Lt.Dive:case Lt.PrediveDive:{let r=new hn(this._beat,!1);r.renderer=this.renderer;let i=this._beat.whammyBarPoints[this._beat.whammyBarPoints.length-1];for(let n of this._beat.notes)n.isTieOrigin||r.addGlyph(this.getBendNoteValue(n,i),i.value%2!==0);r.doLayout(),this.BendNoteHeads.push(r)}break;case Lt.Dip:if(e===ai.SongBook){let r=this.renderer.resources;this.renderer.simpleWhammyOverflow=r.tablatureFont.size*1.5+Nl.SimpleDipHeight*this.scale+Nl.SimpleDipPadding*this.scale}else{let r=new hn(this._beat,!1);if(r.renderer=this.renderer,this.renderer.settings.notation.notationMode===ai.GuitarPro){let n=this._beat.whammyBarPoints[1];for(let s of this._beat.notes)r.addGlyph(this.getBendNoteValue(s,this._beat.whammyBarPoints[1]),n.value%2!==0)}r.doLayout(),this.BendNoteHeads.push(r);let i=new hn(this._beat,!1);if(i.renderer=this.renderer,this.renderer.settings.notation.notationMode===ai.GuitarPro){let n=this._beat.whammyBarPoints[this._beat.whammyBarPoints.length-1];for(let s of this._beat.notes)i.addGlyph(this.getBendNoteValue(s,n),n.value%2!==0)}i.doLayout(),this.BendNoteHeads.push(i)}break;case Lt.Predive:break}super.doLayout()}paint(e,r,i){let n=this._beat;switch(n.whammyBarType){case Lt.None:case Lt.Custom:return}let s=this.renderer.settings.notation.notationMode,a=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,n.voice.bar),o=e+a.x+a.getBeatX(n,vt.MiddleNotes),l=this.getTieDirection(n,a),c=this._beat.notes.length===1?l:we.Up,u=i.textAlign;for(let d=0;d0&&d>=(this._beat.notes.length/2|0)&&(c=we.Down),c===we.Down?p+=a.getNoteY(h,je.Bottom):p+=a.getNoteY(h,je.Top);let f=e+a.x;n.isLastOfVoice?f+=a.width:f+=a.getBeatX(n,vt.EndBeat),f-=8*this.scale;let m=n.whammyStyle===Gt.Gradual&&d===0?"grad.":"",y=null;h.isTieOrigin&&(y=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,h.tieDestination.beat.voice.bar),y&&y.staff===a.staff?f=e+y.x+y.getBeatX(h.tieDestination.beat,vt.MiddleNotes):y=null);let v=mt.NoteHeadHeight*this.scale*mt.GraceScale*.5;c===we.Up&&(v=-v);let g=n.whammyBarPoints.length>0?this.getBendNoteValue(h,n.whammyBarPoints[n.whammyBarPoints.length-1]):0,b=0,k=!1;switch(this.BendNoteHeads.length>0&&this.BendNoteHeads[0].containsNoteValue(g)?(b=this.BendNoteHeads[0].getNoteValueY(g)+v,k=!0):y&&(h.isTieOrigin&&h.tieDestination.beat.hasWhammyBar||h.beat.isContinuedWhammy)?(b=r+y.y+y.getNoteY(h.tieDestination,je.Top),k=!0,c===we.Down&&(b+=mt.NoteHeadHeight*this.scale)):h.isTieOrigin&&(y?b=r+y.y+y.getNoteY(h.tieDestination,je.Top):b=p,c===we.Down&&(b+=mt.NoteHeadHeight*this.scale)),n.whammyBarType){case Lt.Hold:h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===we.Down,22,4);break;case Lt.Dive:d===0&&(this.BendNoteHeads[0].x=f-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i),this.BendNoteHeads[0].containsNoteValue(g)&&(b+=this.BendNoteHeads[0].y)),k?this.drawBendSlur(i,o,p,f,b,c===we.Down,this.scale,m):h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===we.Down,22,4);break;case Lt.Dip:if(s===ai.SongBook){if(d===0){let _=e+a.x+a.getBeatX(this._beat,vt.OnNotes)-2*this.scale,P=e+a.x+a.getBeatX(this._beat,vt.PostNotes)+2*this.scale,R=(_+P)/2,E=((this._beat.whammyBarPoints[1].value-this._beat.whammyBarPoints[0].value)/4|0).toString();i.font=this.renderer.resources.tablatureFont,i.fillText(E,R,r+this.y);let D=r+this.y+i.font.size+2*this.scale,$=D+Nl.SimpleDipHeight*this.scale;this._beat.whammyBarPoints[1].value>this._beat.whammyBarPoints[0].value?(i.moveTo(_,$),i.lineTo(R,D),i.lineTo(P,$)):(i.moveTo(_,D),i.lineTo(R,$),i.lineTo(P,D)),i.stroke()}h.isTieOrigin&&hi.paintTie(i,this.scale,o,p,f,b,l===we.Down,22,4)}else{let _=(o+f)/2;this.BendNoteHeads[0].x=_-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i);let P=this.getBendNoteValue(h,n.whammyBarPoints[1]),R=this.BendNoteHeads[0].getNoteValueY(P)+v;this.drawBendSlur(i,o,p,_,R,c===we.Down,this.scale,m),this.BendNoteHeads[1].x=f-this.BendNoteHeads[1].noteHeadOffset,this.BendNoteHeads[1].y=r+a.y,this.BendNoteHeads[1].paint(0,0,i),b=this.BendNoteHeads[1].getNoteValueY(g)+v,this.drawBendSlur(i,_,R,f,b,c===we.Down,this.scale,m)}break;case Lt.PrediveDive:case Lt.Predive:let C=e+a.x+a.getBeatX(h.beat,vt.PreNotes);C+=a.getPreNotesGlyphForBeat(h.beat).prebendNoteHeadOffset;let x=r+a.y+a.getScoreY(a.accidentalHelper.getNoteLineForValue(h.displayValue-(h.beat.whammyBarPoints[0].value/2|0),!1))+v;this.drawBendSlur(i,C,x,o,p,c===we.Down,this.scale,m),this.BendNoteHeads.length>0&&(this.BendNoteHeads[0].x=f-this.BendNoteHeads[0].noteHeadOffset,this.BendNoteHeads[0].y=r+a.y,this.BendNoteHeads[0].paint(0,0,i),this.drawBendSlur(i,o,p,f,b,c===we.Down,this.scale,m));break}}i.textAlign=u}getBendNoteValue(e,r){return e.displayValueWithoutBend+(r.value/2|0)}}Nl.SimpleDipHeight=zn.PerHalfSize*2;Nl.SimpleDipPadding=2;class fn extends Dr{constructor(e,r,i){super(e,r),this.width=i}}class KJ extends Er{constructor(e,r,i,n,s){super(e,r,s?mt.GraceScale:1,i.getSymbol(n)),this._isGrace=s,this._articulation=i}paint(e,r,i){let n=this._isGrace?this.scale:0;i.fillMusicFontSymbol(e+this.x,r+this.y+n,this.glyphScale*this.scale,this.symbol,!1),this._articulation.techniqueSymbol!==B.None&&this._articulation.techniqueSymbolPlacement===ft.Middle&&i.fillMusicFontSymbol(e+this.x,r+this.y+n,this.glyphScale*this.scale,this._articulation.techniqueSymbol,!1)}doLayout(){let e=(this._isGrace?mt.GraceScale:1)*this.scale;switch(this.symbol){case B.NoteheadWhole:this.width=14;break;case B.NoteheadCircleX:case B.NoteheadDiamondWhite:this.width=9;break;case B.NoteheadHeavyXHat:case B.NoteheadHeavyX:this.width=13;break;default:this.width=10;break}this.width=this.width*(this._isGrace?mt.GraceScale:1)*this.scale,this.height=mt.NoteHeadHeight*e}}class gT extends Er{constructor(e,r){super(e,r,mt.GraceScale,B.ArticStaccatoAbove)}doLayout(){this.width=mt.QuarterNoteHeadWidth*this.scale,this.height=7*this.scale}paint(e,r,i){super.paint(e+3*this.scale,r+5*this.scale,i)}}class QJ extends Er{constructor(e,r){super(e,r,.5,B.PictEdgeOfCymbal)}doLayout(){this.width=22*this.scale,this.height=15*this.scale}paint(e,r,i){super.paint(e-3*this.scale,r+this.height,i)}}class JJ extends Er{constructor(e,r){super(e,r,mt.GraceScale,B.GuitarGolpe)}doLayout(){this.width=9*this.scale,this.height=10*this.scale}paint(e,r,i){super.paint(e,r+this.height,i)}}class ZJ extends HS{constructor(){super(...arguments),this._collisionOffset=-1e3,this._skipPaint=!1,this.noteHeads=null,this.restGlyph=null}getNoteX(e,r){return this.noteHeads?this.noteHeads.getNoteX(e,r):0}buildBoundingsLookup(e,r,i){this.noteHeads&&this.noteHeads.buildBoundingsLookup(e,r+this.x,i+this.y)}getNoteY(e,r){return this.noteHeads?this.noteHeads.getNoteY(e,r):0}updateBeamingHelper(){if(this.noteHeads)this.noteHeads.updateBeamingHelper(this.container.x+this.x);else if(this.restGlyph&&(this.restGlyph.updateBeamingHelper(this.container.x+this.x),this.renderer.bar.isMultiVoice&&this._collisionOffset===-1e3)){this._collisionOffset=this.renderer.helpers.collisionHelper.applyRestCollisionOffset(this.container.beat,this.restGlyph.y,this.renderer.getScoreHeight(1)),this.y+=this._collisionOffset;const e=this.renderer.helpers.collisionHelper.restDurationsByDisplayTime;e.has(this.container.beat.playbackStart)&&e.get(this.container.beat.playbackStart).has(this.container.beat.playbackDuration)&&e.get(this.container.beat.playbackStart).get(this.container.beat.playbackDuration)!==this.container.beat.id&&(this._skipPaint=!0)}}paint(e,r,i){this._skipPaint||super.paint(e,r,i)}doLayout(){let e=this.renderer;if(!this.container.beat.isEmpty)if(this.container.beat.isRest){let r=Math.ceil((this.renderer.bar.staff.standardNotationLineCount-1)/2)*2;this.container.beat.duration===H.Whole&&this.renderer.bar.staff.standardNotationLineCount!==1&&this.renderer.bar.staff.standardNotationLineCount!==3&&(r-=2);const i=new fu(0,e.getScoreY(r),this.container.beat.duration);if(this.restGlyph=i,i.beat=this.container.beat,i.beamingHelper=this.beamingHelper,this.addGlyph(i),this.renderer.bar.isMultiVoice)if(this.container.beat.voice.index===0){const n=Bn.computeLineHeightsForRest(this.container.beat.duration);let s=i.y-e.getScoreHeight(n[0]),a=i.y+e.getScoreHeight(n[1]);this.renderer.helpers.collisionHelper.reserveBeatSlot(this.container.beat,s,a)}else this.renderer.helpers.collisionHelper.registerRest(this.container.beat);if(this.beamingHelper&&this.beamingHelper.applyRest(this.container.beat,r),this.container.beat.dots>0){this.addGlyph(new fn(0,0,5*this.scale));for(let n=0;n0){this.addGlyph(new fn(0,0,5*this.scale));for(let n=0;n0;){let r=e%10,i=new XS(0,0,r,this._scale);this.addGlyph(i),e=e/10|0}if(this.glyphs){this.glyphs.reverse();let r=0;for(let i=0,n=this.glyphs.length;id.displayValue-u.displayValue);let l=this._beat.graceType===Ze.BendGrace?this._beat.nextBeat:this._beat,c=this._notes.length===1?this.getTieDirection(l,n):we.Up;for(let u=0;u0&&u>=(this._notes.length/2|0)&&(c=we.Down);let h=r+n.y+n.getNoteY(d,je.Top),p=mt.NoteHeadHeight*this.scale*mt.GraceScale*.5;c===we.Down&&(h+=mt.NoteHeadHeight*this.scale);let f=d.bendStyle===Gt.Gradual?"grad.":"";if(d.isTieOrigin){let m=d.tieDestination,y=m?this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,m.beat.voice.bar):null;if(!y||y.staff!==n.staff){let v=e+n.x+n.width,g=d.tieDestination.realValue;n.accidentalHelper.applyAccidentalForValue(d.beat,g,!1,!0);let b=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(g,!1));d.bendType===We.Hold||d.bendType===We.Prebend?hi.paintTie(i,this.scale,s,h,v,b,c===we.Down,22,4):this.drawBendSlur(i,s,h,v,b,c===we.Down,this.scale,f)}else{let v=e+y.x+y.getBeatX(m.beat,vt.MiddleNotes),g=r+y.y+y.getNoteY(m,je.Top);c===we.Down&&(g+=mt.NoteHeadHeight*this.scale),d.bendType===We.Hold||d.bendType===We.Prebend?hi.paintTie(i,this.scale,s,h,v,g,c===we.Down,22,4):this.drawBendSlur(i,s,h,v,g,c===we.Down,this.scale,f)}switch(d.bendType){case We.Prebend:case We.PrebendBend:case We.PrebendRelease:let v=e+n.x+n.getBeatX(d.beat,vt.PreNotes);v+=n.getPreNotesGlyphForBeat(d.beat).prebendNoteHeadOffset;let g=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(d.displayValue-(d.bendPoints[0].value/2|0),!1))+p;this.drawBendSlur(i,v,g,s,h,c===we.Down,this.scale);break}}else{c===we.Up&&(p=-p);let m=0,y=0;switch(d.bendType){case We.Bend:m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this._endNoteGlyph.getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===we.Down,this.scale,f);break;case We.BendRelease:let v=this.getBendNoteValue(d,d.bendPoints[1]),g=this._middleNoteGlyph.getNoteValueY(v)+p;this.drawBendSlur(i,s,h,o,g,c===we.Down,this.scale,f),m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this._endNoteGlyph.getNoteValueY(m)+p,this.drawBendSlur(i,o,g,a,y,c===we.Down,this.scale,f);break;case We.Release:this.BendNoteHeads.length>0&&(m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this.BendNoteHeads[0].getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===we.Down,this.scale,f));break;case We.Prebend:case We.PrebendBend:case We.PrebendRelease:let b=e+n.x+n.getBeatX(d.beat,vt.PreNotes);b+=n.getPreNotesGlyphForBeat(d.beat).prebendNoteHeadOffset;let k=r+n.y+n.getScoreY(n.accidentalHelper.getNoteLineForValue(d.displayValue-(d.bendPoints[0].value/2|0),!1))+p;this.drawBendSlur(i,b,k,s,h,c===we.Down,this.scale),this.BendNoteHeads.length>0&&(m=this.getBendNoteValue(d,d.bendPoints[d.bendPoints.length-1]),y=this.BendNoteHeads[0].getNoteValueY(m)+p,this.drawBendSlur(i,s,h,a,y,c===we.Down,this.scale,f));break}}}}getBendNoteValue(e,r){return e.displayValueWithoutBend+(r.value/2|0)}}class yv extends hi{constructor(e,r,i=!1){super(e,r,i)}doLayout(){super.doLayout()}getBeamDirection(e,r){if(e.isRest)return we.Up;switch(r.getBeatDirection(e)){case we.Up:return we.Down;default:return we.Up}}getStartY(){if(this.startBeat.isRest)return this.startNoteRenderer.getScoreY(9);switch(this.tieDirection){case we.Up:return this.startNoteRenderer.getNoteY(this.startBeat.maxNote,je.Top);default:return this.startNoteRenderer.getNoteY(this.startBeat.minNote,je.Bottom)}}getEndY(){const e=this.endNoteRenderer;if(this.endBeat.isRest)switch(this.tieDirection){case we.Up:return e.getScoreY(9);default:return e.getScoreY(0)}const r=this.startNoteRenderer.getBeatDirection(this.startBeat),i=e.getBeatDirection(this.endBeat);if(r!==i&&this.startBeat.graceType===Ze.None)if(i===this.tieDirection)switch(this.tieDirection){case we.Up:return e.getNoteY(this.endBeat.maxNote,je.TopWithStem);default:return e.getNoteY(this.endBeat.minNote,je.BottomWithStem)}else switch(this.tieDirection){case we.Up:return e.getNoteY(this.endBeat.maxNote,je.BottomWithStem);default:return e.getNoteY(this.endBeat.minNote,je.TopWithStem)}switch(this.tieDirection){case we.Up:return e.getNoteY(this.endBeat.maxNote,je.Top);default:return e.getNoteY(this.endBeat.minNote,je.Bottom)}}getStartX(){return this.startNoteRenderer.getBeatX(this.startBeat,vt.MiddleNotes)}getEndX(){const e=this.endNoteRenderer.getBeatDirection(this.endBeat);return this.endNoteRenderer.getBeatX(this.endBeat,this.endBeat.duration>H.Whole&&e===this.tieDirection?vt.Stem:vt.MiddleNotes)}}class nZ extends Dr{constructor(e,r,i,n){super(0,0),this._outType=r,this._inType=e,this._startNote=i,this._parent=n}doLayout(){this.width=0}paint(e,r,i){this.paintSlideIn(e,r,i),this.drawSlideOut(e,r,i)}paintSlideIn(e,r,i){let n=this.renderer,s=12*this.scale,a=e+n.x+n.getNoteX(this._startNote,Nr.Left)-2*this.scale,o=r+n.y+n.getNoteY(this._startNote,je.Center),l=a-s,c=r+n.y;switch(this._inType){case pi.IntoFromBelow:c+=n.getNoteY(this._startNote,je.Bottom);break;case pi.IntoFromAbove:c+=n.getNoteY(this._startNote,je.Top);break;default:return}let u=this.getAccidentalsWidth(n,this._startNote.beat);l-=u,a-=u,this.paintSlideLine(i,!1,l,a,c,o)}getAccidentalsWidth(e,r){let i=e.getPreNotesGlyphForBeat(r);return i&&i.accidentals?i.accidentals.width:0}drawSlideOut(e,r,i){let n=this.renderer,s=12*this.scale,a=1*this.scale,o=2*this.scale,l=0,c=0,u=0,d=0,h=!1;switch(this._outType){case ut.Shift:case ut.Legato:if(l=e+n.x+n.getBeatX(this._startNote.beat,vt.PostNotes),c=r+n.y+n.getNoteY(this._startNote,je.Center),this._startNote.slideTarget){let p=this.renderer.scoreRenderer.layout.getRendererForBar(this.renderer.staff.staveId,this._startNote.slideTarget.beat.voice.bar);!p||p.staff!==n.staff?(u=e+n.x+n.width,d=c):(u=e+p.x+p.getBeatX(this._startNote.slideTarget.beat,vt.PreNotes)-a,d=r+p.y+p.getNoteY(this._startNote.slideTarget,je.Center)),this._startNote.slideTarget.realValue>this._startNote.realValue?(c+=o,d-=o):(c-=o,d+=o)}else u=e+n.x+this._parent.x,d=c;break;case ut.OutUp:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,je.Center),u=l+s,d=r+n.y+n.getNoteY(this._startNote,je.Top);break;case ut.OutDown:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,je.Center),u=l+s,d=r+n.y+n.getNoteY(this._startNote,je.Bottom);break;case ut.PickSlideUp:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,je.Center),d=r+n.y+n.getNoteY(this._startNote,je.Top),u=e+n.x+n.width,this._startNote.beat.nextBeat&&this._startNote.beat.nextBeat.voice===this._startNote.beat.voice&&(u=e+n.x+n.getBeatX(this._startNote.beat.nextBeat,vt.PreNotes)),h=!0;break;case ut.PickSlideDown:l=e+n.x+n.getNoteX(this._startNote,Nr.Right),c=r+n.y+n.getNoteY(this._startNote,je.Center),d=r+n.y+n.getNoteY(this._startNote,je.Bottom),u=e+n.x+n.width,this._startNote.beat.nextBeat&&this._startNote.beat.nextBeat.voice===this._startNote.beat.voice&&(u=e+n.x+n.getBeatX(this._startNote.beat.nextBeat,vt.PreNotes)),h=!0;break;default:return}this.paintSlideLine(i,h,l,u,c,d)}paintSlideLine(e,r,i,n,s,a){if(r){let o=new Hl(0,0,Dt.Slight,1.2);o.renderer=this.renderer,o.doLayout(),s-=o.height/2,a-=o.height/2;let l=n-i,c=a-s,u=Math.sqrt(Math.pow(c,2)+Math.pow(l,2));o.width=l;let d=Math.asin(c/u)*(180/Math.PI);e.beginRotate(i,s,d),o.paint(0,0,e),e.endRotate()}else e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.stroke()}}class Xf extends yv{constructor(e,r,i=!1){super(e.beat,r.beat,i),this._startNote=e,this._endNote=r}getTieHeight(e,r,i,n){return Math.log2(i-e+1)*this.renderer.settings.notation.slurHeight}getStartY(){if(this.isStartCentered())switch(this.tieDirection){case we.Up:return this.startNoteRenderer.getNoteY(this._startNote,je.Top);default:return this.startNoteRenderer.getNoteY(this._startNote,je.Bottom)}return this.startNoteRenderer.getNoteY(this._startNote,je.Center)}getEndY(){if(this.isEndCentered())if(this.isEndOnStem())switch(this.tieDirection){case we.Up:return this.endNoteRenderer.getNoteY(this._endNote,je.TopWithStem);default:return this.endNoteRenderer.getNoteY(this._endNote,je.BottomWithStem)}else switch(this.tieDirection){case we.Up:return this.endNoteRenderer.getNoteY(this._endNote,je.Top);default:return this.endNoteRenderer.getNoteY(this._endNote,je.Bottom)}else return this.endNoteRenderer.getNoteY(this._endNote,je.Center)}isStartCentered(){return this._startNote===this._startNote.beat.maxNote&&this.tieDirection===we.Up||this._startNote===this._startNote.beat.minNote&&this.tieDirection===we.Down}isEndCentered(){return this._startNote.beat.graceType===Ze.None&&(this._endNote===this._endNote.beat.maxNote&&this.tieDirection===we.Up||this._endNote===this._endNote.beat.minNote&&this.tieDirection===we.Down)}isEndOnStem(){const e=this.endNoteRenderer,r=this.startNoteRenderer.getBeatDirection(this.startBeat),i=e.getBeatDirection(this.endBeat);return r!==i&&this.startBeat.graceType===Ze.None}getStartX(){return this.isStartCentered()?this.startNoteRenderer.getBeatX(this._startNote.beat,vt.MiddleNotes):this.startNoteRenderer.getNoteX(this._startNote,Nr.Right)}getEndX(){return this.isEndCentered()?this.isEndOnStem()?this.endNoteRenderer.getBeatX(this._endNote.beat,vt.Stem):this.endNoteRenderer.getNoteX(this._endNote,Nr.Center):this.endNoteRenderer.getBeatX(this._endNote.beat,vt.PreNotes)}}class yT extends hi{constructor(e,r,i=!1){super(e?e.beat:null,r?r.beat:null,i),this.startNote=e,this.endNote=r}shouldDrawBendSlur(){return this.renderer.settings.notation.extendBendArrowsOnTiedNotes&&!!this.startNote.bendOrigin&&this.startNote.isTieOrigin}doLayout(){super.doLayout()}getBeamDirection(e,r){switch(r.getBeatDirection(e)){case we.Up:return we.Down;default:return we.Up}}getStartY(){if(this.startBeat.isRest)return this.startNoteRenderer.getScoreY(9);switch(this.tieDirection){case we.Up:return this.startNoteRenderer.getNoteY(this.startNote,je.Top);default:return this.startNoteRenderer.getNoteY(this.startNote,je.Bottom)}}getEndY(){const e=this.endNoteRenderer;if(this.endBeat.isRest)switch(this.tieDirection){case we.Up:return e.getScoreY(9);default:return e.getScoreY(0)}switch(this.tieDirection){case we.Up:return e.getNoteY(this.endNote,je.Top);default:return e.getNoteY(this.endNote,je.Bottom)}}getStartX(){return this.startNoteRenderer.getBeatX(this.startNote.beat,vt.PostNotes)}getEndX(){return this.endNoteRenderer.getBeatX(this.endNote.beat,vt.PreNotes)}}class sZ extends Ys{constructor(e,r){super(e,r),this._bend=null,this._effectSlur=null,this._effectEndSlur=null}doLayout(){if(this._effectSlur=null,this._effectEndSlur=null,super.doLayout(),this.beat.isLegatoOrigin){if(!this.beat.previousBeat||!this.beat.previousBeat.isLegatoOrigin){let e=this.beat.nextBeat;for(;e.nextBeat&&e.nextBeat.isLegatoDestination;)e=e.nextBeat;this.addTie(new yv(this.beat,e,!1))}}else if(this.beat.isLegatoDestination&&!this.beat.isLegatoOrigin){let e=this.beat.previousBeat;for(;e.previousBeat&&e.previousBeat.isLegatoOrigin;)e=e.previousBeat;this.addTie(new yv(e,this.beat,!0))}this._bend&&(this._bend.renderer=this.renderer,this._bend.doLayout(),this.updateWidth())}createTies(e){if(e.isVisible){if(e.isTieOrigin&&!e.hasBend&&!e.beat.hasWhammyBar&&e.beat.graceType!==Ze.BendGrace&&e.tieDestination&&e.tieDestination.isVisible){let r=new yT(e,e.tieDestination,!1);this.addTie(r)}if(e.isTieDestination&&!e.tieOrigin.hasBend&&!e.beat.hasWhammyBar){let r=new yT(e.tieOrigin,e,!0);this.addTie(r)}if(e.slideInType!==pi.None||e.slideOutType!==ut.None){let r=new nZ(e.slideInType,e.slideOutType,e,this);this.addTie(r)}if(e.isSlurOrigin&&e.slurDestination&&e.slurDestination.isVisible){let r=new Xf(e,e.slurDestination,!1);this.addTie(r)}if(e.isSlurDestination){let r=new Xf(e.slurOrigin,e,!0);this.addTie(r)}if(!this._effectSlur&&e.isEffectSlurOrigin&&e.effectSlurDestination){const r=new Xf(e,e.effectSlurDestination,!1);this._effectSlur=r,this.addTie(r)}if(!this._effectEndSlur&&e.beat.isEffectSlurDestination&&e.beat.effectSlurOrigin){let r=this.onNotes.beamingHelper.direction,i=r===we.Up?e.beat.effectSlurOrigin.minNote:e.beat.effectSlurOrigin.maxNote,n=r===we.Up?e.beat.minNote:e.beat.maxNote;const s=new Xf(i,n,!0);this._effectEndSlur=s,this.addTie(s)}if(e.hasBend){if(!this._bend){const r=new iZ(e.beat);this._bend=r,r.renderer=this.renderer,this.addTie(r)}this._bend.addBends(e)}}}}class fs extends br{constructor(e,r){super(e,r),this.simpleWhammyOverflow=0,this._firstLineY=0,this._startSpacing=!1,this.accidentalHelper=new Ir(this)}getBeatDirection(e){return this.helpers.getBeamingHelperForBeat(e).direction}get lineOffset(){return(br.LineSpacing+1)*this.scale}updateSizes(){let e=this.resources,r=e.tablatureFont.size/2+e.tablatureFont.size*.2;this.topPadding=r*this.scale,this.bottomPadding=r*this.scale,this.height=this.lineOffset*4+this.topPadding+this.bottomPadding,this.updateFirstLineY(),super.updateSizes()}updateFirstLineY(){let e=this.lineOffset*4,r=(this.bar.staff.standardNotationLineCount-1)*this.lineOffset;this._firstLineY=(e-r)/2}doLayout(){if(this.updateFirstLineY(),super.doLayout(),!this.bar.isEmpty&&this.accidentalHelper.maxLineBeat){let e=this.getScoreY(-2),r=this.getScoreY(6),i=this.simpleWhammyOverflow;this.registerOverflowTop(i);let n=this.getScoreY(this.accidentalHelper.maxLine),s=this.helpers.getBeamingHelperForBeat(this.accidentalHelper.maxLineBeat);s.direction===we.Up&&(n-=this.getStemSize(s),n-=s.fingeringCount*this.resources.graceFont.size,s.hasTuplet&&(n-=this.resources.effectFont.size*2)),s.hasTuplet&&(n-=this.resources.effectFont.size*1.5),nr&&this.registerOverflowBottom(Math.abs(a)-r)}}paint(e,r,i){super.paint(e,r,i),this.paintBeams(e,r,i),this.paintTuplets(e,r,i)}paintTuplets(e,r,i){for(let n of this.bar.voices)if(this.hasVoiceContainer(n)){let s=this.getVoiceContainer(n);for(let a of s.tupletGroups)this.paintTupletHelper(e+this.beatGlyphsStart,r,i,a)}}paintBeams(e,r,i){for(let n=0,s=this.helpers.beamHelpers.length;n=0;Q--)if(!n.beats[Q].isRest){y=n.beats[Q];break}let v=!1;m||(m=p,v=!0),y||(y=f);let g=this.helpers.beamHelperLookup[n.voice.index].get(p.index),b=this.helpers.beamHelperLookup[n.voice.index].get(f.index),k=g.getBeatLineX(p),C=b.getBeatLineX(f),x=this.helpers.beamHelperLookup[n.voice.index].get(m.index),_=this.helpers.beamHelperLookup[n.voice.index].get(y.index),P=g.direction,R=this.calculateBeamYWithDirection(x,k,P),E=this.calculateBeamYWithDirection(_,C,P);v&&(R=Math.max(R,E),E=R),i.font=s.effectFont;let D=i.measureText(l),$=3*this.scale,I=(k+C)/2,F=I-D/2-$,M=I+D/2+$,O=(E-R)/(C-k),A=R-O*k,N=O*F+A,V=O*I+A,W=O*M+A;P===we.Down&&(d*=-1,h*=-1),i.beginPath(),i.moveTo(e+this.x+k,r+this.y+R-d|0),i.lineTo(e+this.x+k,r+this.y+R-d-h|0),i.lineTo(e+this.x+F,r+this.y+N-d-h|0),i.stroke(),i.beginPath(),i.moveTo(e+this.x+M,r+this.y+W-d-h|0),i.lineTo(e+this.x+C,r+this.y+E-d-h|0),i.lineTo(e+this.x+C,r+this.y+E-d|0),i.stroke(),i.fillText(l,e+this.x+I,r+this.y+V-d-h)}i.textAlign=a,i.textBaseline=o}getStemSize(e){let r=e.beats.length===1?this.getFlagStemSize(e.shortestDuration):this.getBarStemSize(e.shortestDuration);return e.isGrace&&(r=r*mt.GraceScale),r}getBarStemSize(e){let r=0;switch(e){case H.QuadrupleWhole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:r=6;break;case H.ThirtySecond:r=8;break;case H.SixtyFourth:r=9;break;case H.OneHundredTwentyEighth:r=9;break;case H.TwoHundredFiftySixth:r=10;break;default:r=0;break}return this.getScoreHeight(r)}getFlagStemSize(e){let r=0;switch(e){case H.QuadrupleWhole:case H.Half:case H.Quarter:case H.Eighth:case H.Sixteenth:case H.ThirtySecond:case H.SixtyFourth:case H.OneHundredTwentyEighth:case H.TwoHundredFiftySixth:r=6;break;default:r=0;break}return this.getScoreHeight(r)}get middleYPosition(){return this.getScoreY(this.bar.staff.standardNotationLineCount-1)}getNoteY(e,r){let i=super.getNoteY(e,r);if(isNaN(i)){const n=Ir.computeLineWithoutAccidentals(this.bar,e);i=this.getScoreY(n)}return i}calculateBeamY(e,r){return this.calculateBeamYWithDirection(e,r,e.direction)}applyLayoutingInfo(){const e=super.applyLayoutingInfo();if(e&&this.bar.isMultiVoice){let r=this.getScoreY(-2),i=this.getScoreY(6),n=this.helpers.collisionHelper.getBeatMinMaxY();n[0]i&&this.registerOverflowBottom(Math.abs(n[1])-i)}return e}calculateBeamYWithDirection(e,r,i){let n=this.getStemSize(e);if(!e.drawingInfos.has(i)){let s=new TJ;e.drawingInfos.set(i,s);const a=e.beats[0],o=e.beats[e.beats.length-1];let l=e.isRestBeamHelper;s.startBeat=a,s.startX=e.getBeatLineX(a),l?s.startY=i===we.Up?this.getScoreY(e.minRestLine):this.getScoreY(e.maxRestLine):s.startY=i===we.Up?this.getScoreY(this.accidentalHelper.getMinLine(a))-n:this.getScoreY(this.accidentalHelper.getMaxLine(a))+n,s.endBeat=o,s.endX=e.getBeatLineX(o),l?s.endY=i===we.Up?this.getScoreY(e.minRestLine):this.getScoreY(e.maxRestLine):s.endY=i===we.Up?this.getScoreY(this.accidentalHelper.getMinLine(o))-n:this.getScoreY(this.accidentalHelper.getMaxLine(o))+n;let c=10*this.scale;if(i===we.Down&&s.startY>s.endY&&s.startY-s.endY>c&&(s.endY=s.startY-c),i===we.Down&&s.endY>s.startY&&s.endY-s.startY>c&&(s.startY=s.endY-c),i===we.Up&&s.startYc&&(s.endY=s.startY+c),i===we.Up&&s.endYc&&(s.startY=s.endY+c),e.beats.length>1){if(i===we.Up){let u=this.getScoreY(this.accidentalHelper.getMinLine(e.beatOfHighestNote))-n;const h=s.calcY(e.getBeatLineX(e.beatOfHighestNote))-u;h>0&&(s.startY-=h,s.endY-=h)}else{let u=this.getScoreY(this.accidentalHelper.getMaxLine(e.beatOfLowestNote))+n;const d=s.calcY(e.getBeatLineX(e.beatOfLowestNote)),h=u-d;h>0&&(s.startY+=h,s.endY+=h)}if(e.minRestLine!==null||e.maxRestLine!==null){const u=er.getIndex(e.shortestDuration)-2;let d=e.isGrace?mt.GraceScale:1,h=u*(br.BeamSpacing+br.BeamThickness)*this.scale*d;if(h+=br.BeamSpacing,i===we.Up&&e.minRestLine!==null){let p=this.getScoreY(e.minRestLine)-h;const m=s.calcY(e.getBeatLineX(e.beatOfMinRestLine))-p;m>0&&(s.startY-=m,s.endY-=m)}else if(i===we.Down&&e.maxRestLine!==null){let p=this.getScoreY(e.maxRestLine)+h;const f=s.calcY(e.getBeatLineX(e.beatOfMaxRestLine)),m=p-f;m>0&&(s.startY+=m,s.endY+=m)}}}}return e.drawingInfos.get(i).calcY(r)}paintBar(e,r,i,n){for(let s=0,a=n.beats.length;s0&&!Bn.isFullBarJoin(o,n.beats[s-1],k)&&(C=u-m,x=u,_=R+this.calculateBeamY(n,C),P=R+this.calculateBeamY(n,x),fs.paintSingleBar(i,e+this.x+C,_,e+this.x+x,P,v))}}}static paintSingleBar(e,r,i,n,s,a){e.beginPath(),e.moveTo(r,i),e.lineTo(n,s),e.lineTo(n,s+a),e.lineTo(r,i+a),e.closePath(),e.fill()}paintFlag(e,r,i,n){let s=n.beats[0];if(s.graceType===Ze.BendGrace||s.graceType!==Ze.None&&this.settings.notation.notationMode===ai.SongBook)return;let a=s.graceType!==Ze.None,o=a?mt.GraceScale:1,l=this.getFlagStemSize(n.shortestDuration),c=n.getBeatLineX(s),u=n.direction,d=this.getScoreY(this.accidentalHelper.getMinLine(s)),h=this.getScoreY(this.accidentalHelper.getMaxLine(s)),p=0,f=0;if(u===we.Down?(h+=l*o,p=h,f=r+this.y+h):(d-=l*o,p=d,f=r+this.y+d),this.paintFingering(i,s,e+this.x+c,u,f),!!n.hasLine){if(i.lineWidth=br.StemWidth*this.scale,i.beginPath(),i.moveTo(e+this.x+c,r+this.y+d),i.lineTo(e+this.x+c,r+this.y+h),i.stroke(),i.lineWidth=this.scale,s.graceType===Ze.BeforeBeat){let m=15*this.scale,y=12*this.scale;i.beginPath(),u===we.Down?(i.moveTo(e+this.x+c-y/2,r+this.y+h-m),i.lineTo(e+this.x+c+y/2,r+this.y+h)):(i.moveTo(e+this.x+c-y/2,r+this.y+d+m),i.lineTo(e+this.x+c+y/2,r+this.y+d)),i.stroke()}if(n.hasFlag){let m=new Nu(c-this.scale/2,p,s.duration,u,a);m.renderer=this,m.doLayout(),m.paint(e+this.x,r+this.y,i)}}}paintFingering(e,r,i,n,s){let a=this.settings;if(a.notation.fingeringMode!==ta.ScoreDefault&&a.notation.fingeringMode!==ta.ScoreForcePiano)return;n===we.Up?i-=10*this.scale:i+=3*this.scale;let o=r.notes.slice(0);o.sort((l,c)=>l.realValue-c.realValue);for(let l=0;l2&&this.addPostBeatGlyph(new IM(0,this.getScoreHeight(-.5),this.bar.masterBar.repeatCount))):this.addPostBeatGlyph(new LM(0,0))}createStartSpacing(){this._startSpacing||(this.addPreBeatGlyph(new fn(0,0,2*this.scale)),this._startSpacing=!0)}createKeySignatureGlyphs(){let e=0,r=this.bar.masterBar.keySignature,i=this.bar.previousBar?this.bar.previousBar.masterBar.keySignature:0;switch(this.bar.clef){case ot.Neutral:e=0;break;case ot.G2:e=1;break;case ot.F4:e=3;break;case ot.C3:e=2;break;case ot.C4:e=0;break}let n=new Map,s=[];if(er.keySignatureIsSharp(r))for(let l=0;lthis._startNote.fret?(l+=a,u-=a):(l-=a,u+=a)}else c=e+n.x+this._parent.x,u=l;break;case ut.OutUp:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,je.Center),c=o+s-h,u=r+n.y+n.getNoteY(this._startNote,je.Center)-a;break;case ut.OutDown:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,je.Center),c=o+s-h,u=r+n.y+n.getNoteY(this._startNote,je.Center)+a;break;case ut.PickSlideDown:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,je.Center),c=e+n.x+n.getBeatX(this._startNote.beat,vt.EndBeat),u=l+a*3,d=!0;break;case ut.PickSlideUp:o=e+n.x+n.getNoteX(this._startNote,Nr.Right),l=r+n.y+n.getNoteY(this._startNote,je.Center),c=e+n.x+n.getBeatX(this._startNote.beat,vt.EndBeat),u=l-a*3,d=!0;break;default:return}this.paintSlideLine(i,d,o,c,l,u)}paintSlideLine(e,r,i,n,s,a){if(r){let o=new Hl(0,0,Dt.Slight,1.2);o.renderer=this.renderer,o.doLayout(),s-=o.height/2,a-=o.height/2;let l=n-i,c=a-s,u=Math.sqrt(Math.pow(c,2)+Math.pow(l,2));o.width=l;let d=Math.asin(c/u)*(180/Math.PI);e.beginRotate(i,s,d),o.paint(0,0,e),e.endRotate()}else e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.stroke()}}class Ao extends hi{constructor(e,r,i=!1){super(e.beat,r.beat,i),this.startNote=e,this.endNote=r}getTieHeight(e,r,i,n){return this.startNote===this.endNote?15:super.getTieHeight(e,r,i,n)}getBeamDirection(e,r){return this.startNote===this.endNote?we.Up:Ao.getBeamDirectionForNote(this.startNote)}static getBeamDirectionForNote(e){return e.string>3?we.Up:we.Down}getStartY(){return this.startNote===this.endNote?this.startNoteRenderer.getNoteY(this.startNote,je.Center):this.tieDirection===we.Up?this.startNoteRenderer.getNoteY(this.startNote,je.Top):this.startNoteRenderer.getNoteY(this.startNote,je.Bottom)}getEndY(){return this.getStartY()}getStartX(){return this.startNote===this.endNote?this.getEndX()-20*this.scale:this.startNoteRenderer.getNoteX(this.startNote,Nr.Center)}getEndX(){return this.startNote===this.endNote?this.endNoteRenderer.getNoteX(this.endNote,Nr.Left):this.endNoteRenderer.getNoteX(this.endNote,Nr.Center)}}class vT extends Ao{constructor(e,r,i,n=!1){super(e,r,n),this._direction=Ao.getBeamDirectionForNote(e),this._forSlide=i}getTieHeight(e,r,i,n){return Math.log(i-e+1)*this.renderer.settings.notation.slurHeight}tryExpand(e,r,i,n){if(this._forSlide!==i||this.forEnd!==n||this.startNote.beat.id!==e.beat.id||this.endNote.beat.id!==r.beat.id||this._direction!==Ao.getBeamDirectionForNote(e))return!1;switch(this._direction){case we.Up:e.realValue>this.startNote.realValue&&(this.startNote=e,this.startBeat=e.beat),r.realValue>this.endNote.realValue&&(this.endNote=r,this.endBeat=r.beat);break;case we.Down:e.realValue=0&&(this._noteString=this._noteString.substr(0,i+2)),this._noteString="<"+this._noteString+">"}if(e.isTrill)this._trillNoteString="("+(e.trillFret-e.beat.voice.bar.staff.transpositionPitch).toString()+")";else if(er.isAlmostEqualTo(e.harmonicValue,0))this._trillNoteString="";else switch(e.harmonicType){case qe.Artificial:case qe.Pinch:case qe.Tap:case qe.Semi:case qe.Feedback:let i=(r+e.harmonicValue).toString(),n=i.indexOf(".");n>=0&&(i=i.substr(0,n+2)),this._trillNoteString="<"+i+">";break;default:this._trillNoteString="";break}this.isEmpty=!this._noteString,this.isEmpty||(this.renderer.scoreRenderer.canvas.font=this.renderer.resources.tablatureFont,this.noteStringWidth=this.renderer.scoreRenderer.canvas.measureText(this._noteString)*this.scale,this.width=this.noteStringWidth,this.height=this.renderer.scoreRenderer.canvas.font.size,this._trillNoteString&&(this.renderer.scoreRenderer.canvas.font=this.renderer.resources.graceFont,this._trillNoteStringWidth=3*this.scale+this.renderer.scoreRenderer.canvas.measureText(this._trillNoteString),this.width+=this._trillNoteStringWidth))}paint(e,r,i){if(this.isEmpty)return;let n=this.noteStringWidth+this._trillNoteStringWidth,s=e+this.x+(this.width-n)/2,a=this.renderer.scoreRenderer.canvas.font;this.renderer.scoreRenderer.canvas.font=this.renderer.resources.graceFont,i.fillText(this._trillNoteString,s+this.noteStringWidth+3*this.scale,r+this.y),this.renderer.scoreRenderer.canvas.font=a,i.fillText(this._noteString,s,r+this.y)}buildBoundingsLookup(e,r,i){let n=new VS;n.note=this._note,n.noteHeadBounds=new dn,n.noteHeadBounds.x=r+this.x,n.noteHeadBounds.y=i+this.y-this.height/2,n.noteHeadBounds.w=this.width,n.noteHeadBounds.h=this.height,e.addNote(n)}}class cZ extends Dr{constructor(e,r,i){super(e,r),this._notes=[],this.minStringNote=null,this.beatEffects=new Map,this.notesPerString=new Map,this.noteStringWidth=0,this._isGrace=i}buildBoundingsLookup(e,r,i){for(const n of this._notes)n.buildBoundingsLookup(e,r+this.x,i+this.y)}getNoteX(e,r){if(this.notesPerString.has(e.string)){let i=this.notesPerString.get(e.string),n=this.x+i.x;switch(r){case Nr.Left:break;case Nr.Center:n+=i.noteStringWidth/2;break;case Nr.Right:n+=i.width;break}return n}return 0}getNoteY(e,r){if(this.notesPerString.has(e.string)){const i=this.notesPerString.get(e.string);let n=this.y+i.y;switch(r){case je.Top:case je.TopWithStem:n-=i.height/2+2*this.scale;break;case je.Center:break;case je.Bottom:case je.BottomWithStem:n+=i.height/2;break}return n}return 0}doLayout(){let e=0,r=0;for(let a=0,o=this._notes.length;ae&&(e=l.width),l.noteStringWidth>r&&(r=l.noteStringWidth)}this.noteStringWidth=r;let i=this.renderer.resources.tablatureFont.size,n=this.getNoteY(this.minStringNote,je.Center)+i/2,s=7*this.scale;for(const a of this.beatEffects.values())a.y+=n,a.x+=this.width/2,a.renderer=this.renderer,n+=s,a.doLayout();this.width=e}addNoteGlyph(e,r){this._notes.push(e),this.notesPerString.set(r.string,e),(!this.minStringNote||r.string0&&e.showRests){this.addGlyph(new fn(0,0,5*this.scale));for(let a=0;a0&&e.settings.notation.rhythmMode!==Wa.Hidden){this.addGlyph(new fn(0,0,5*this.scale));for(let s=0;s0){e=!0;break}e&&(this._tupletSize=this.resources.effectFont.size*.8,this.registerOverflowBottom(this._tupletSize))}}createPreBeatGlyphs(){if(super.createPreBeatGlyphs(),this.bar.masterBar.isRepeatStart&&this.addPreBeatGlyph(new OM(0,0,1.5,3)),this.isFirstOfLine){let e=(this.bar.staff.tuning.length-1)/2;this.addPreBeatGlyph(new pZ(5*this.scale,this.getTabY(e)))}this.showTimeSignature&&(!this.bar.previousBar||this.bar.previousBar&&this.bar.masterBar.timeSignatureNumerator!==this.bar.previousBar.masterBar.timeSignatureNumerator||this.bar.previousBar&&this.bar.masterBar.timeSignatureDenominator!==this.bar.previousBar.masterBar.timeSignatureDenominator)&&(this.createStartSpacing(),this.createTimeSignatureGlyphs()),this.addPreBeatGlyph(new DM(0,this.getTabHeight(-.5),this.bar.index+1))}createStartSpacing(){this._startSpacing||(this.addPreBeatGlyph(new fn(0,0,2*this.scale)),this._startSpacing=!0)}createTimeSignatureGlyphs(){this.addPreBeatGlyph(new fn(0,0,5*this.scale));const e=(this.bar.staff.tuning.length+1)/2-1;this.addPreBeatGlyph(new mZ(0,this.getTabY(e),this.bar.masterBar.timeSignatureNumerator,this.bar.masterBar.timeSignatureDenominator,this.bar.masterBar.timeSignatureCommon))}createVoiceGlyphs(e){for(let r=0,i=e.beats.length;r2&&this.addPostBeatGlyph(new IM(0,this.getTabY(-1),this.bar.masterBar.repeatCount))):this.addPostBeatGlyph(new LM(0,0))}getTabY(e){return this._firstLineY+this.getTabHeight(e)}getTabHeight(e){return this.lineOffset*e}get middleYPosition(){return this.getTabY(this.bar.staff.tuning.length-1)}paintBackground(e,r,i){super.paintBackground(e,r,i);let n=this.resources;i.color=n.staffLineColor;let s=this.scale,a=[];for(let o=0,l=this.bar.staff.tuning.length;ol[0]>c[0]?1:l[0]0&&!Bn.isFullBarJoin(o,n.beats[s-1],v)&&(g=l-h,b=l,k=x,C=x,Ua.paintSingleBar(i,e+this.x+g,k,e+this.x+b,C,f))}}}}paintTupletHelper(e,r,i,n){let s=this.resources,a=i.textAlign,o=i.textBaseline;i.color=n.voice.index===0?this.resources.mainGlyphColor:this.resources.secondaryGlyphColor,i.textAlign=Je.Center,i.textBaseline=ft.Middle;let l,c=n.beats[0].tupletNumerator,u=n.beats[0].tupletDenominator;if(c===2&&u===3?l="2":c===3&&u===2?l="3":c===4&&u===6?l="4":c===5&&u===4?l="5":c===6&&u===4?l="6":c===7&&u===4?l="7":c===9&&u===8?l="9":c===10&&u===8?l="10":c===11&&u===8?l="11":c===12&&u===8?l="12":c===13&&u===8?l="13":l=c+":"+u,n.beats.length===1||!n.isFull)for(let d=0,h=n.beats.length;dc.topY-u.topY));let l=s;for(;l>n;){a.moveTo(i,l);let c=n;if(o.length>0&&o[o.length-1].bottomY>c){const u=o.pop();c=r+u.bottomY,a.lineTo(i,c),l=r+u.topY}else{a.lineTo(i,c);break}}a.stroke()}paintFooter(e,r,i,n){for(let s of n.beats){if(s.graceType!==Ze.None||s.duration===H.Whole||s.duration===H.DoubleWhole||s.duration===H.QuadrupleWhole)return;let a=n.getBeatLineX(s),o=r+this.y,l=r+this.y+this.height-this._tupletSize,c=this.getOnNotesGlyphForBeat(s);if(!c.noteNumbers||s.duration===H.Half?o+=this.height-this.settings.notation.rhythmHeight*this.settings.display.scale-this._tupletSize:o+=c.noteNumbers.getNoteY(c.noteNumbers.minStringNote,je.Bottom),this.paintBeamingStem(s,r+this.y,e+this.x+a,o,l,i),s.duration>H.Quarter){let u=new Nu(0,0,s.duration,we.Down,!1);u.renderer=this,u.doLayout(),u.paint(e+this.x+a,l,i)}}}}Ua.StaffId="tab";Ua.TabLineSpacing=10;class Mb extends WS{get staffId(){return Ua.StaffId}constructor(e,r,i){super(),this._showTimeSignature=e,this._showRests=r,this._showTiedNotes=i,this.hideOnPercussionTrack=!0}canCreate(e,r){return r.tuning.length>0&&super.canCreate(e,r)}create(e,r){let i=new Ua(e,r);return i.showRests=this._showRests,i.showTimeSignature=this._showTimeSignature,i.showTiedNotes=this._showTiedNotes,i}}class Bh extends na{constructor(){super(0,0)}doLayout(){super.doLayout();const e=this.renderer.resources.effectFont;this.height=e.size+Bh.Padding*this.scale}paint(e,r,i){let n=this.renderer.resources;i.font=n.effectFont;let s=i.textAlign;i.textAlign=Je.Center,i.fillText("T",e+this.x,r+this.y+i.font.size/2),i.textAlign=s,i.strokeCircle(e+this.x,r+this.y+i.font.size/2+(Bh.Padding-1)*this.scale,i.font.size/1.6)}}Bh.Padding=4;class qf extends Jl{get notationElement(){return rt.EffectTap}get sizingMode(){return Et.SingleOnBeat}shouldCreateGlyphForNote(e){return e.isLeftHandTapped}createNewGlyph(e,r){return new Bh}}class co{constructor(){this.noteRange=1,this.x=0,this.y=0}}var Cl;(function(t){t[t.None=0]="None",t[t.Rectangle=1]="Rectangle",t[t.Ellipse=2]="Ellipse",t[t.Circle=3]="Circle"})(Cl||(Cl={}));class Db extends co{constructor(){super(...arguments),this.align=Je.Left,this.frame=Cl.None,this.text="",this.fontFace="",this.weight=0,this.height=0}}class wT extends co{constructor(){super(...arguments),this.chord=new Ho}}class ST extends co{}class xT extends co{}class gZ extends co{constructor(){super(...arguments),this.number=0}}class kT extends co{constructor(){super(...arguments),this.decrescendo=!1}}class Lb extends co{constructor(){super(...arguments),this.allNumbers=!1,this.firstNumber=0,this.lastNumber=0}}class yZ extends co{constructor(){super(...arguments),this.octave=1}}class bZ extends co{}class vZ{constructor(){this.defaultClef=ot.G2,this.description="",this.percussion=!1,this.instrument=0,this.volume=0,this.transpose=0,this.index=0}}class wZ{constructor(){this.from=0,this.to=0,this.curly=!1}}class SZ{constructor(){this.currentBarIndex=-1,this.currentBarComplete=!0,this.currentBarDuration=0,this.currentPosition=0,this.voiceStemDir=null,this.repeatCount=0,this.repeatEnd=null}}class xm{constructor(){this._trackChannel=0,this._beamingMode=js.Auto,this._isFirstSystem=!0,this._staffLookup=new Map,this._brackets=[],this._staffLayoutLookup=new Map,this._staffLayouts=[],this._timeSignature=new to,this._voiceStates=new Map}parseXml(e,r){this._galleryObjects=new Map,this._tieStarts=[],this._tieStartIds=new Map,this._voiceCounts=new Map,this._slurs=new Map,this._crescendo=new Map,this._isFirstSystem=!0;let i=new FS;try{i.parse(e)}catch(n){throw new jr("Could not parse XML",n)}this.parseDom(i),this.consolidate(),this.score.finish(r)}consolidate(){let e=this.score.tempo;for(const r of this.score.tracks){const i=this._voiceCounts.get(r.index);for(const n of r.staves){for(;n.bars.length{i.isLegatoOrigin=!0}),xm.applyEffectRange(this._crescendo,(r,i)=>{i.crescendo=r.decrescendo?pn.Decrescendo:pn.Crescendo})}static applyEffectRange(e,r){for(const[i,n]of e){const s=n.noteRange;let a=i;for(let o=0;o!!s.curly);r.sort((s,a)=>s.from-a.from);let i=0,n=null;for(let s=0;sr[i].to;)i++;n&&ir[i].from&&s<=r[i].to?n.ensureStaveCount(n.staves.length+1):(n=new _a,n.ensureStaveCount(1),n.name=a.description,n.playbackInfo.volume=Math.floor(a.volume/128*16),n.playbackInfo.program=a.instrument,a.percussion?(n.playbackInfo.primaryChannel=9,n.playbackInfo.secondaryChannel=9):(n.playbackInfo.primaryChannel=this._trackChannel++,n.playbackInfo.secondaryChannel=this._trackChannel++),this.score.addTrack(n));const o=n.staves[n.staves.length-1];o.isPercussion=a.percussion,o.transpositionPitch=a.transpose,o.displayTranspositionPitch=0,o.showTablature=!1,this._staffLookup.set(a.index,o)}}parseBrackets(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"bracket":this.parseBracket(r);break}}parseBracket(e){const r=new wZ;r.from=parseInt(e.getAttribute("from")),r.to=parseInt(e.getAttribute("to")),e.attributes.has("curly")&&(r.curly=e.attributes.get("curly")==="true"),this._brackets.push(r)}parseLayoutStaves(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"staffLayout":this.parseStaffLayout(r);break}}parseStaffLayout(e){const r=new vZ;r.description=e.getAttribute("description");for(let i of e.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"notation":i.attributes.has("defaultClef")&&(r.defaultClef=this.parseClef(i.attributes.get("defaultClef")));break;case"sound":i.attributes.has("percussion")&&(r.percussion=i.attributes.get("percussion")==="true"),i.attributes.has("instr")&&(r.instrument=parseInt(i.attributes.get("instr"))),i.attributes.has("volume")&&(r.volume=parseInt(i.attributes.get("volume"))),i.attributes.has("transpose")&&(r.transpose=parseInt(i.attributes.get("transpose")));break}this._staffLayoutLookup.set(r.description,r),r.index=this._staffLayouts.length,this._staffLayouts.push(r)}parseClef(e){switch(e){case"treble":return ot.G2;case"bass":return ot.F4;case"alto":return ot.C4;case"tenor":return ot.C4}return ot.G2}parseClefOttava(e){return e.endsWith("-")?Ft._8vb:e.endsWith("+")?Ft._8va:Ft.Regular}parseSystems(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"system":this.parseSystem(r);break}}parseSystem(e){e.attributes.has("tempo")&&this.score.masterBars.length===0&&(this.score.tempo=parseInt(e.attributes.get("tempo"))),e.getAttribute("beamGrouping")==="0"&&(this._beamingMode=js.ForceSplitToNext);for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"staves":this.parseStaves(e,r);break}this._isFirstSystem=!1}parseStaves(e,r){let i=this.score.masterBars.length;for(let n of r.childNodes)if(n.nodeType===de.Element)switch(n.localName){case"staff":this.parseStaff(e,i,n);break}}parseStaff(e,r,i){const n=i.getAttribute("layout");this._currentStaffLayout=this._staffLayoutLookup.get(n),this._timeSignature.timeSignatureNumerator=4,this._timeSignature.timeSignatureDenominator=4,this._timeSignature.timeSignatureCommon=!1,this.parseTime(i.getAttribute("defaultTime"));const s=this._staffLookup.get(this._currentStaffLayout.index);for(;s.bars.length0){const r=e.split("/");this._timeSignature.timeSignatureNumerator=parseInt(r[0]),this._timeSignature.timeSignatureDenominator=parseInt(r[1]),this._timeSignature.timeSignatureCommon=!1}break}}parseVoices(e,r,i,n,s){let a=0;for(let o of s.childNodes)if(o.nodeType===de.Element)switch(o.localName){case"voice":this.parseVoice(e,r,i,a,n,o),a++;break}}getOrCreateBar(e,r){return r0?(r.clef=e.bars[e.bars.length-1].clef,r.clefOttava=e.bars[e.bars.length-1].clefOttava):r.clef=this._currentStaffLayout.defaultClef,e.addBar(r),e.bars.length>this.score.masterBars.length){let i=new to;this.score.addMasterBar(i),i.index>0&&(i.keySignature=i.previousMasterBar.keySignature,i.keySignatureType=i.previousMasterBar.keySignatureType,i.tripletFeel=i.previousMasterBar.tripletFeel),i.timeSignatureDenominator=this._timeSignature.timeSignatureDenominator,i.timeSignatureNumerator=this._timeSignature.timeSignatureNumerator,i.timeSignatureCommon=this._timeSignature.timeSignatureCommon}return r}newBar(e,r){this._currentVoiceState.currentBarIndex++,this._currentBar=this.getOrCreateBar(e,this._currentVoiceState.currentBarIndex),this._currentVoiceState.currentBarDuration=this._currentBar.masterBar.calculateDuration(!1),this._currentVoiceState.currentBarComplete=!1,this._currentVoiceState.currentPosition=0,this.ensureVoice(e,r)}parseVoice(e,r,i,n,s,a){const o=e+"_"+n;if(this._currentVoiceState&&!this._currentVoiceState.currentBarComplete&&(this._currentBar.masterBar.isAnacrusis=!0),this._voiceStates.has(o)?(this._currentVoiceState=this._voiceStates.get(o),this._currentBar=this.getOrCreateBar(r,this._currentVoiceState.currentBarIndex),this.ensureVoice(r,n)):(this._currentVoiceState=new SZ,this._currentVoiceState.currentBarIndex=s-1,this._voiceStates.set(o,this._currentVoiceState),this.newBar(r,n)),a.attributes.has("stemDir"))switch(a.attributes.get("stemDir")){case"up":this._currentVoiceState.voiceStemDir=we.Up;break;case"down":this._currentVoiceState.voiceStemDir=we.Down;break;default:this._currentVoiceState.voiceStemDir=null;break}else this._currentVoiceState.voiceStemDir=null;const l=a.findChildElement("noteObjects");if(i.attributes.has("tempo")&&(this._currentBar.masterBar.tempoAutomation=new Ei,this._currentBar.masterBar.tempoAutomation.isLinear=!0,this._currentBar.masterBar.tempoAutomation.type=oi.Tempo,this._currentBar.masterBar.tempoAutomation.value=parseInt(i.attributes.get("tempo"))),l){for(let c of l.childNodes)if(c.nodeType===de.Element)switch(this._currentVoiceState.currentBarComplete&&c.localName!=="barline"&&this.newBar(r,n),c.localName){case"clefSign":this._currentBar.clef=this.parseClef(c.getAttribute("clef")),this._currentBar.clefOttava=this.parseClefOttava(c.getAttribute("clef"));break;case"keySign":this._currentBar.masterBar.keySignature=parseInt(c.getAttribute("fifths"));break;case"timeSign":this.parseTime(c.getAttribute("time")),this._currentBar.masterBar.timeSignatureDenominator=this._timeSignature.timeSignatureDenominator,this._currentBar.masterBar.timeSignatureNumerator=this._timeSignature.timeSignatureNumerator,this._currentBar.masterBar.timeSignatureCommon=this._timeSignature.timeSignatureCommon,this._currentVoiceState.currentPosition=0,this._currentVoiceState.currentBarDuration=this._currentBar.masterBar.calculateDuration(!1);break;case"barline":switch(c.getAttribute("type")){case"double":this._currentBar.masterBar.isDoubleBar=!0,this._currentVoiceState.currentBarComplete||(this._currentBar.masterBar.isAnacrusis=!0),this._currentVoiceState.currentBarComplete=!0;break;case"end":this._currentVoiceState.currentBarComplete||(this._currentBar.masterBar.isAnacrusis=!0);break;case"repEnd":this._currentVoiceState.repeatEnd=this._currentBar.masterBar,this._currentBar.masterBar.repeatCount=this._currentVoiceState.currentBarDuration&&(this._currentVoiceState.currentBarComplete=!0);break;case"rest":const d=this.parseRestDurations(this._currentBar,c.findChildElement("duration"));d&&(this.initFromPreviousBeat(d,this._currentVoice),d.updateDurations(),this._currentVoiceState.currentPosition+=d.playbackDuration,this._currentVoice.addBeat(d),this._currentVoiceState.currentPosition>=this._currentVoiceState.currentBarDuration&&(this._currentVoiceState.currentBarComplete=!0));break}}}initFromPreviousBeat(e,r){let i=this.getLastBeat(r);i&&(e.dynamics=i.dynamics)}getLastBeat(e){if(e.beats.length>0)return e.beats[e.beats.length-1];if(e.bar.index>0){const r=e.bar.staff.bars[e.bar.index-1];if(e.index0&&!n.isTieDestination&&(n.isTieDestination=!0,n.tieOrigin=this._tieStarts[0],this._tieStarts.splice(0,1),this._tieStartIds.delete(n.id));break}}parseBeatDrawObject(e,r){for(let i of r.childNodes)if(i.nodeType===de.Element)switch(i.localName){case"drawObj":const n=this.parseDrawObj(i);if(n){if(n instanceof Db)n.fontFace.startsWith("capella")?n.text==="u"?(e.fermata=new DS,e.fermata.type=Qs.Medium):n.text==="f"?e.dynamics=yt.F:n.text==="j"&&(e.dynamics=yt.MF):this._isFirstSystem&&this.score.title===""&&n.align===Je.Center&&n.height>16&&n.weight>400?this.score.title=n.text:this._isFirstSystem&&this.score.artist===""&&n.align===Je.Center&&n.y<0?this.score.artist=n.text:this._isFirstSystem&&this.score.music===""&&n.align===Je.Right&&n.y<0?this.score.music=n.text:n.text.startsWith("by capella")||(e.text=n.text);else if(!(n instanceof wT))if(n instanceof xT)e.vibrato=Dt.Slight;else if(n instanceof kT)e.crescendo=n.decrescendo?pn.Decrescendo:pn.Crescendo,n.noteRange++,this._crescendo.set(e,n);else if(n instanceof ST){const s=n;this._slurs.set(e,s)}else n instanceof Lb&&this.applyVolta(n)}break}}parseBarDrawObject(e){for(let r of e.childNodes)if(r.nodeType===de.Element)switch(r.localName){case"drawObj":const i=this.parseDrawObj(r);i&&i instanceof Lb&&this.applyVolta(i);break}}applyVolta(e){if(e.lastNumber>0?(this._currentVoiceState.repeatCount=e.lastNumber,this._currentVoiceState.repeatEnd&&this._currentVoiceState.repeatEnd.repeatCount0&&(this._currentVoiceState.repeatCount=e.firstNumber,this._currentVoiceState.repeatEnd&&this._currentVoiceState.repeatEnd.repeatCount0&&e.firstNumber>0){let r=0;for(let i=e.firstNumber;i<=e.lastNumber;i++)r=r|1<0?this._currentBar.masterBar.alternateEndings=1<0&&(this._currentBar.masterBar.alternateEndings=1<0)for(let n of r)switch(n.fileName){case"score.xml":i=ae.toString(n.data,this.settings.importer.encoding);break}else this.data.reset(),i=ae.toString(this.data.readAll(),this.settings.importer.encoding);if(!i)throw new jr("No valid capella file");he.debug(this.name,"Start Parsing score.xml");try{let n=new xm;return n.parseXml(i,this.settings),he.debug(this.name,"score.xml parsed"),n.score}catch(n){throw new jr("Failed to parse CapXML",n)}}}class kZ{constructor(e){this._targets=new Set,this._callback=e,window.addEventListener("resize",this.onWindowResize.bind(this),!1)}observe(e){this._targets.add(e)}unobserve(e){this._targets.delete(e)}disconnect(){this._targets.clear()}onWindowResize(){const e=[];for(const r of this._targets)e.push({target:r,contentRect:void 0,borderBoxSize:void 0,contentBoxSize:[],devicePixelContentBoxSize:[]});this._callback(e,this)}}class CZ{constructor(e){this._elements=[];let r=null;const i=this._check.bind(this);this._check=()=>{r||(r=setTimeout(()=>{i(),r=null},100))},this._callback=e,window.addEventListener("resize",this._check,!0),document.addEventListener("scroll",this._check,!0)}observe(e){this._elements.indexOf(e)>=0||(this._elements.push(e),this._check())}unobserve(e){this._elements=this._elements.filter(r=>r!=e)}_check(){const e=[];this._elements.forEach(r=>{const i=r.getBoundingClientRect();i.top+i.height>=0&&i.top<=window.innerHeight&&i.left+i.width>=0&&i.left<=window.innerWidth&&e.push({target:r,isIntersecting:!0})}),e.length&&this._callback(e,this)}}function CT(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}var TZ=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};function TT(t){function e(i){t.error=t.hasError?new TZ(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function r(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}class or{static enable(e,r){or.alphaSkia=r,or.initializeMusicFont(or.alphaSkia.AlphaSkiaTypeface.register(e))}static initializeMusicFont(e){or.musicFont=e}static registerFont(e,r){const i=or.alphaSkia.AlphaSkiaTypeface.register(e.buffer);r||(r=Mt.withFamilyList([i.familyName],12,i.isItalic?vr.Italic:vr.Plain,i.isBold?Tn.Bold:Tn.Regular));for(const n of r.families)this.customTypeFaces.set(or.customTypefaceKey(n,r.isBold,r.isItalic),i);return r}static customTypefaceKey(e,r,i){return e.toLowerCase()+"_"+r+"_"+i}getTypeFace(){if(this._typeFaceCache!=this.font.toCssString(this.settings.display.scale)){if(this._typeFaceIsSystem){const r={stack:[],error:void 0,hasError:!1};try{const i=CT(r,this._typeFace,!1)}catch(i){r.error=i,r.hasError=!0}finally{TT(r)}}for(const r of this.font.families){var e=or.customTypefaceKey(r,this.font.isBold,this.font.isItalic);or.customTypeFaces.has(e)?(this._typeFaceIsSystem=!1,this._typeFace=or.customTypeFaces.get(e)):(this._typeFaceIsSystem=!0,this._typeFace=or.alphaSkia.AlphaSkiaTypeface.create(r,this.font.isBold,this.font.isItalic))}this._typeFaceCache=this.font.toCssString(this.settings.display.scale)}return this._typeFace}constructor(){this._color=new Yt(0,0,0,0),this._lineWidth=0,this._typeFaceCache="",this._typeFaceIsSystem=!1,this._typeFace=null,this.font=new Mt("Arial",10,vr.Plain),this.textAlign=Je.Left,this.textBaseline=ft.Top,this._canvas=new or.alphaSkia.AlphaSkiaCanvas,this.color=new Yt(0,0,0,255)}destroy(){const e={stack:[],error:void 0,hasError:!1};try{const r=CT(e,this._canvas,!1)}catch(r){e.error=r,e.hasError=!0}finally{TT(e)}}onRenderFinished(){return null}beginRender(e,r){this._canvas.beginRender(e,r,xe.HighDpiFactor)}endRender(){return this._canvas.endRender()}get color(){return this._color}set color(e){this._color.rgba!==e.rgba&&(this._color=e,this._canvas.color=or.alphaSkia.AlphaSkiaCanvas.rgbaToColor(e.r,e.g,e.b,e.a))}get lineWidth(){return this._lineWidth}set lineWidth(e){this._lineWidth=e,this._canvas.lineWidth=e}fillRect(e,r,i,n){i>0&&this._canvas.fillRect(e|0,r|0,i,n)}strokeRect(e,r,i,n){this._canvas.strokeRect(e|0,r|0,i,n)}beginPath(){this._canvas.beginPath()}closePath(){this._canvas.closePath()}moveTo(e,r){this._canvas.moveTo(e,r)}lineTo(e,r){this._canvas.lineTo(e,r)}quadraticCurveTo(e,r,i,n){this._canvas.quadraticCurveTo(e,r,i,n)}bezierCurveTo(e,r,i,n,s,a){this._canvas.bezierCurveTo(e,r,i,n,s,a)}fillCircle(e,r,i){this._canvas.fillCircle(e,r,i)}strokeCircle(e,r,i){this._canvas.strokeCircle(e,r,i)}fill(){this._canvas.fill()}stroke(){this._canvas.stroke()}beginGroup(e){}endGroup(){}fillText(e,r,i){if(e.length==0)return;let n=or.alphaSkia.AlphaSkiaTextAlign.Left;switch(this.textAlign){case Je.Left:n=or.alphaSkia.AlphaSkiaTextAlign.Left;break;case Je.Center:n=or.alphaSkia.AlphaSkiaTextAlign.Center;break;case Je.Right:n=or.alphaSkia.AlphaSkiaTextAlign.Right;break}let s=or.alphaSkia.AlphaSkiaTextBaseline.Top;switch(this.textBaseline){case ft.Top:s=or.alphaSkia.AlphaSkiaTextBaseline.Top;break;case ft.Middle:s=or.alphaSkia.AlphaSkiaTextBaseline.Middle;break;case ft.Bottom:s=or.alphaSkia.AlphaSkiaTextBaseline.Bottom;break}this._canvas.fillText(e,this.getTypeFace(),this.font.size*this.settings.display.scale,r,i,n,s)}measureText(e){return this._canvas.measureText(e,this.getTypeFace(),this.font.size*this.settings.display.scale)}fillMusicFontSymbol(e,r,i,n,s){n!==B.None&&this.fillMusicFontSymbolText(e,r,i,String.fromCharCode(n),s)}fillMusicFontSymbols(e,r,i,n,s){let a="";for(let o of n)o!==B.None&&(a+=String.fromCharCode(o));this.fillMusicFontSymbolText(e,r,i,a,s)}fillMusicFontSymbolText(e,r,i,n,s){this._canvas.fillText(n,or.musicFont,xe.MusicFontSize*this.settings.display.scale*i,e,r,s?or.alphaSkia.AlphaSkiaTextAlign.Center:or.alphaSkia.AlphaSkiaTextAlign.Left,or.alphaSkia.AlphaSkiaTextBaseline.Alphabetic)}beginRotate(e,r,i){this._canvas.beginRotate(e,r,i)}endRotate(){this._canvas.endRotate()}}or.musicFont=null;or.customTypeFaces=new Map;class _T{constructor(e,r){this.vertical=e,this.createLayout=r}}class Fb{constructor(e,r){this.supportsWorkers=e,this.createCanvas=r}}class xe{static createStyleElement(e,r){let i=e.getElementById("alphaTabStyle");if(!i){if(!r){he.error("AlphaTab","Font directory could not be detected, cannot create style element");return}i=e.createElement("style"),i.id="alphaTabStyle";let n=` @font-face { font-family: 'alphaTab'; src: url('${r}Bravura.eot'); @@ -263,6 +263,12 @@ Parsing JSON Request failed.`,s)):s.statusText==="timeout"?i(new Ma("Request Tim line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - font-size: ${Se.MusicFontSize}px; + font-size: ${xe.MusicFontSize}px; overflow: visible !important; - }`;i.innerHTML=n,e.getElementsByTagName("head").item(0).appendChild(i),Se.bravuraFontChecker.checkForFontAvailability()}}static get globalThis(){if(Se._globalThis===void 0){try{Se._globalThis=globalThis}catch{}typeof Se._globalThis>"u"&&(Se._globalThis=self),typeof Se._globalThis>"u"&&(Se._globalThis=global),typeof Se._globalThis>"u"&&(Se._globalThis=window),typeof Se._globalThis>"u"&&(Se._globalThis=Function("return this")())}return this._globalThis}static get isRunningInWorker(){return"WorkerGlobalScope"in Se.globalThis}static get isRunningInAudioWorklet(){return"AudioWorkletGlobalScope"in Se.globalThis}static throttle(e,r){let i=0;return()=>{Se.globalThis.clearTimeout(i),i=Se.globalThis.setTimeout(e,r)}}static detectScriptFile(){if(!Se.isRunningInWorker&&Se.globalThis.ALPHATAB_ROOT){let e=Se.globalThis.ALPHATAB_ROOT;return e=Se.ensureFullUrl(e),e=Se.appendScriptName(e),e}try{const e=import.meta.url;if(e&&e.indexOf("file://")===-1)return e}catch{}return"document"in Se.globalThis&&document.currentScript?document.currentScript.src:null}static ensureFullUrl(e){var r,i,n;if(!e)return"";if(!e.startsWith("http")&&!e.startsWith("https")&&!e.startsWith("file")){let s="",a=Se.globalThis.location;if(s+=(r=a.protocol)==null?void 0:r.toString(),s+="//",a.hostname&&(s+=(i=a.hostname)==null?void 0:i.toString()),a.port&&(s+=":",s+=(n=a.port)==null?void 0:n.toString()),!e.startsWith("/")){let o=a.pathname.split("/").slice(0,-1).join("/");o.length>0&&(o.startsWith("/")||(s+="/"),s+=o==null?void 0:o.toString())}return e.startsWith("/")||(s+="/"),s+=e==null?void 0:e.toString(),s}return e}static appendScriptName(e){return e&&!e.endsWith(".js")&&(e.endsWith("/")||(e+="/"),e+="alphaTab.js"),e}static detectFontDirectory(){if(!Se.isRunningInWorker&&Se.globalThis.ALPHATAB_FONT)return Se.ensureFullUrl(Se.globalThis.ALPHATAB_FONT);const e=Se.scriptFile;if(e){let r=e.lastIndexOf("/");if(r>=0)return e.substr(0,r)+"/font/"}return null}static registerJQueryPlugin(){if(!Se.isRunningInWorker&&Se.globalThis&&"jQuery"in Se.globalThis){let e=Se.globalThis.jQuery,r=new aT;e.fn.alphaTab=function(i){const n=Array.prototype.slice.call(arguments,1);return this.length===1?r.exec(this[0],i,n):this.each((s,a)=>{r.exec(a,i,n)})},e.alphaTab={restore:aT.restore},e.fn.alphaTab.fn=r}}static getRenderEngineFactory(e){return!e||!Se.renderEngines.has(e)?Se.renderEngines.get("default"):Se.renderEngines.get(e)}static getLayoutEngineFactory(e){return!e||!Se.layoutEngines.has(e)?Se.layoutEngines.get(ja.Page):Se.layoutEngines.get(e)}static buildImporters(){return[new da,new WQ,new $Q,new HQ,new wZ,new Wi]}static createDefaultRenderEngines(){const e=new Map;return e.set("svg",new Fb(!0,()=>new wJ)),e.set("default",e.get("svg")),e.set("skia",new Fb(!1,()=>new or)),Se.createPlatformSpecificRenderEngines(e),e}static enableAlphaSkia(e,r){or.enable(e,r)}static registerAlphaSkiaCustomFont(e,r){return or.registerFont(e,r)}static createPlatformSpecificRenderEngines(e){e.set("html5",new Fb(!1,()=>new rJ))}static createDefaultStaveProfiles(){const e=new Map;e.set(Cn.ScoreTab,[new po("score-effects",[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new pT,new Gf,new Wf(!0),new jf,new Hf,new Yf,new Uf,new qf,new wb]),new vT,new po("tab-effects",[new uT,new Wf(!1),new dT,new zf,new Gf,new jf,new Hf,new Yf,new Uf,new fT,new xb,new On(Xe.Natural),new On(Xe.Artificial),new On(Xe.Pinch),new On(Xe.Tap),new On(Xe.Semi),new On(Xe.Feedback),new Cb,new cT,new hT,new _b,new Pb,new Bb,new qf]),new Mb(!1,!1,!1)]),e.set(Cn.Score,[new po("score-effects",[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new pT,new Gf,new Wf(!0),new jf,new Hf,new Yf,new Uf,new xb,new Cb,new _b,new Pb,new Bb,new qf,new wb]),new vT,new po("score-bottom-effects",[new uT,new Wf(!1),new dT,new zf])]);let r=[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new Gf,new jf,new Hf,new Yf,new Uf,new fT,new xb,new On(Xe.Artificial),new On(Xe.Pinch),new On(Xe.Tap),new On(Xe.Semi),new On(Xe.Feedback),new Cb,new cT,new hT,new _b,new Pb,new Bb,new qf,new wb];return e.set(Cn.Tab,[new po("tab-effects",r),new Mb(!0,!0,!0),new po("tab-bottom-effects",[new zf])]),e.set(Cn.TabMixed,[new po("tab-effects",r),new Mb(!1,!1,!1),new po("tab-bottom-effects",[new zf])]),e}static createDefaultLayoutEngines(){const e=new Map;return e.set(ja.Page,new BT(!0,r=>new ef(r))),e.set(ja.Horizontal,new BT(!1,r=>new Zh(r))),e}static initializeMain(e,r){Se.isRunningInWorker||Se.isRunningInAudioWorklet||((Se.webPlatform===Un.Browser||Se.webPlatform===Un.BrowserModule)&&(Se.registerJQueryPlugin(),Se.HighDpiFactor=window.devicePixelRatio,"ResizeObserver"in Se.globalThis||(Se.globalThis.ResizeObserver=SZ),"IntersectionObserver"in Se.globalThis||(Se.globalThis.IntersectionObserver=xZ),"replaceChildren"in Element.prototype||(Element.prototype.replaceChildren=function(...i){this.innerHTML="",this.append(...i)},Document.prototype.replaceChildren=Element.prototype.replaceChildren,DocumentFragment.prototype.replaceChildren=Element.prototype.replaceChildren),"replaceAll"in String.prototype||(String.prototype.replaceAll=function(i,n){return this.replace(new RegExp(i,"g"),n)})),Se.createWebWorker=e,Se.createAudioWorklet=r)}static get alphaTabWorker(){return this.globalThis.Worker}static initializeWorker(){if(!Se.isRunningInWorker)throw new gi(mi.General,"Not running in worker, cannot run worker initialization");$S.init(),AS.init(),Se.createWebWorker=e=>{throw new gi(mi.General,"Nested workers are not supported")}}static initializeAudioWorklet(){if(!Se.isRunningInAudioWorklet)throw new gi(mi.General,"Not running in audio worklet, cannot run worklet initialization");xh.init()}static detectWebPack(){try{if(typeof __webpack_require__=="function")return!0}catch{}return!1}static detectVite(){try{if(typeof __BASE__=="string")return!0}catch{}return!1}static detectWebPlatform(){try{if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return Un.NodeJs}catch{}try{const e=import.meta.url;if(e&&typeof e=="string"&&!e.startsWith("file://"))return Un.BrowserModule}catch{}return Un.Browser}}Se.MusicFontSize=34;Se.HighDpiFactor=1;Se._globalThis=void 0;Se.webPlatform=Se.detectWebPlatform();Se.isWebPackBundled=Se.detectWebPack();Se.isViteBundled=Se.detectVite();Se.scriptFile=Se.detectScriptFile();Se.fontDirectory=Se.detectFontDirectory();Se.bravuraFontChecker=new _M(["alphaTab"]);Se.renderEngines=Se.createDefaultRenderEngines();Se.layoutEngines=Se.createDefaultLayoutEngines();Se.staveProfiles=Se.createDefaultStaveProfiles();class VM{constructor(){this.scriptFile=null,this.fontDirectory=null,this.file=null,this.tex=!1,this.tracks=null,this.enableLazyLoading=!0,this.engine="default",this.logLevel=Gs.Info,this.useWorkers=!0,this.includeNoteBounds=!1,this.scriptFile=Se.scriptFile,this.fontDirectory=Se.fontDirectory}}var he;(function(t){t[t.SteelGuitar=1]="SteelGuitar",t[t.AcousticGuitar=2]="AcousticGuitar",t[t.TwelveStringGuitar=3]="TwelveStringGuitar",t[t.ElectricGuitar=4]="ElectricGuitar",t[t.Bass=5]="Bass",t[t.ClassicalGuitar=23]="ClassicalGuitar",t[t.UprightBass=6]="UprightBass",t[t.Ukulele=7]="Ukulele",t[t.Banjo=8]="Banjo",t[t.Mandolin=9]="Mandolin",t[t.Piano=10]="Piano",t[t.Synth=12]="Synth",t[t.Strings=11]="Strings",t[t.Brass=13]="Brass",t[t.Reed=14]="Reed",t[t.Woodwind=15]="Woodwind",t[t.Vocal=16]="Vocal",t[t.PitchedIdiophone=17]="PitchedIdiophone",t[t.Fx=21]="Fx",t[t.PercussionKit=18]="PercussionKit",t[t.Idiophone=19]="Idiophone",t[t.Membraphone=20]="Membraphone"})(he||(he={}));class ge{constructor(e,r,i=null){if(this.icon=he.Piano,this.icon=e,this.instrumentSetName=r,i)this.instrumentSetType=i;else{const n=r.split(" ");n[0]=n[0].substr(0,1).toLowerCase()+n[0].substr(1),this.instrumentSetType=n.join("")}}}new ge(he.Piano,"Acoustic Piano"),new ge(he.Piano,"Acoustic Piano"),new ge(he.Piano,"Electric Piano"),new ge(he.Piano,"Acoustic Piano"),new ge(he.Piano,"Electric Piano"),new ge(he.Piano,"Electric Piano"),new ge(he.Piano,"Harpsichord"),new ge(he.Piano,"Harpsichord"),new ge(he.PitchedIdiophone,"Celesta"),new ge(he.PitchedIdiophone,"Vibraphone"),new ge(he.PitchedIdiophone,"Vibraphone"),new ge(he.PitchedIdiophone,"Vibraphone"),new ge(he.PitchedIdiophone,"Xylophone"),new ge(he.PitchedIdiophone,"Xylophone"),new ge(he.PitchedIdiophone,"Vibraphone"),new ge(he.Banjo,"Banjo"),new ge(he.Piano,"Electric Organ"),new ge(he.Piano,"Electric Organ"),new ge(he.Piano,"Electric Organ"),new ge(he.Piano,"Electric Organ"),new ge(he.Piano,"Electric Organ"),new ge(he.Piano,"Electric Organ"),new ge(he.Woodwind,"Recorder"),new ge(he.Piano,"Electric Organ"),new ge(he.ClassicalGuitar,"Nylon Guitar"),new ge(he.SteelGuitar,"Steel Guitar"),new ge(he.SteelGuitar,"Electric Guitar"),new ge(he.ElectricGuitar,"Electric Guitar"),new ge(he.ElectricGuitar,"Electric Guitar"),new ge(he.ElectricGuitar,"Electric Guitar"),new ge(he.SteelGuitar,"Electric Guitar"),new ge(he.SteelGuitar,"Electric Guitar"),new ge(he.Bass,"Acoustic Bass"),new ge(he.Bass,"Electric Bass"),new ge(he.Bass,"Electric Bass"),new ge(he.Bass,"Acoustic Bass"),new ge(he.Bass,"Electric Bass"),new ge(he.Bass,"Electric Bass"),new ge(he.Synth,"Synth Bass"),new ge(he.Synth,"Synth Bass"),new ge(he.Strings,"Violin"),new ge(he.Strings,"Viola"),new ge(he.Strings,"Cello"),new ge(he.Strings,"Contrabass"),new ge(he.Strings,"Violin"),new ge(he.Strings,"Violin"),new ge(he.Piano,"Harp"),new ge(he.Membraphone,"Timpani"),new ge(he.Strings,"Violin"),new ge(he.Strings,"Violin"),new ge(he.Strings,"Violin"),new ge(he.Strings,"Violin"),new ge(he.Vocal,"Voice"),new ge(he.Vocal,"Voice"),new ge(he.Vocal,"Voice"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Brass,"Trumpet"),new ge(he.Brass,"Trombone"),new ge(he.Brass,"Tuba"),new ge(he.Brass,"Trumpet"),new ge(he.Brass,"French Horn"),new ge(he.Brass,"Trumpet"),new ge(he.Brass,"Trumpet"),new ge(he.Brass,"Trumpet"),new ge(he.Reed,"Saxophone"),new ge(he.Reed,"Saxophone"),new ge(he.Reed,"Saxophone"),new ge(he.Reed,"Saxophone"),new ge(he.Reed,"Oboe"),new ge(he.Reed,"English Horn"),new ge(he.Reed,"Bassoon"),new ge(he.Reed,"Clarinet"),new ge(he.Reed,"Piccolo"),new ge(he.Woodwind,"Flute"),new ge(he.Woodwind,"Recorder"),new ge(he.Woodwind,"Flute"),new ge(he.Woodwind,"Recorder"),new ge(he.Woodwind,"Flute"),new ge(he.Woodwind,"Recorder"),new ge(he.Woodwind,"Flute"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Lead Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Synth,"Pad Synthesizer"),new ge(he.Fx,"Pad Synthesizer"),new ge(he.Fx,"Pad Synthesizer"),new ge(he.Fx,"Pad Synthesizer"),new ge(he.Fx,"Pad Synthesizer"),new ge(he.Fx,"Lead Synthesizer"),new ge(he.Fx,"Lead Synthesizer"),new ge(he.Fx,"Lead Synthesizer"),new ge(he.Fx,"Trumpet"),new ge(he.ElectricGuitar,"Banjo"),new ge(he.Banjo,"Banjo"),new ge(he.Ukulele,"Ukulele"),new ge(he.Banjo,"Banjo"),new ge(he.PitchedIdiophone,"Xylophone"),new ge(he.Reed,"Bassoon"),new ge(he.Strings,"Violin"),new ge(he.Woodwind,"Flute"),new ge(he.PitchedIdiophone,"Xylophone"),new ge(he.Idiophone,"Celesta"),new ge(he.PitchedIdiophone,"Vibraphone"),new ge(he.Idiophone,"Xylophone"),new ge(he.Membraphone,"Xylophone"),new ge(he.Membraphone,"Xylophone"),new ge(he.Membraphone,"Xylophone"),new ge(he.Idiophone,"Celesta"),new ge(he.Fx,"Steel Guitar"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Recorder"),new ge(he.Fx,"Timpani");new ge(he.PercussionKit,"Drums","drumKit");class El{static buildCrc32Lookup(){const r=new Uint32Array(256);for(let i=0;i>>1^3988292384:n>>>1;r[i]=n}return r}get value(){return~this._checkValue}constructor(){this._checkValue=El.CrcInit,this.reset()}update(e,r,i){for(let n=0;n>>8}reset(){this._checkValue=El.CrcInit}}El.Crc32Lookup=El.buildCrc32Lookup();El.CrcInit=4294967295;class wr{}wr.MAX_WBITS=15;wr.WSIZE=1<0;){let h=Math.floor((d-1)/2);if(this.freqs[r[h]]>u)r[d]=r[h],d=h;else break}r[d]=c,n=c}}for(;i<2;){let c=n<2?++n:0;r[i++]=c}this.numCodes=Math.max(n+1,this.minNumCodes);let s=i,a=new Int32Array(4*i-2),o=new Int32Array(2*i-1),l=s;for(let c=0;co[r[h+1]]&&h++,r[d]=r[h],d=h,h=h*2+1;let p=o[u];for(;h=d,d>0;)if(d=Math.floor((h-1)/2),o[r[d]]>p)r[h]=r[d];else break;r[h]=u;let f=r[0];u=l++,a[2*u]=c,a[2*u+1]=f;let m=Math.min(o[c]&255,o[f]&255);for(p=o[c]+o[f]-m+1,o[u]=p,d=0,h=1;ho[r[h+1]]&&h++,r[d]=r[h],d=h,h=d*2+1;for(;h=d,h>0;)if(d=Math.floor((h-1)/2),o[r[d]]>p)r[h]=r[d];else break;r[h]=u}while(i>1);this.buildLength(a)}buildLength(e){this.length=new Uint8Array(this.freqs.length);let r=Math.floor(e.length/2),i=Math.floor((r+1)/2),n=0;for(let l=0;l=0;l--)if(e[2*l+1]!=-1){let c=s[l]+1;c>this.maxLength&&(c=this.maxLength,n++),s[e[2*l]]=c,s[e[2*l+1]]=c}else{let c=s[l];this.bitLengthCounts[c-1]++,this.length[e[2*l]]=s[l]}if(n==0)return;let a=this.maxLength-1;do{for(;this.bitLengthCounts[--a]==0;);do this.bitLengthCounts[a]--,this.bitLengthCounts[++a]++,n-=1<0&&a0);this.bitLengthCounts[this.maxLength-1]+=n,this.bitLengthCounts[this.maxLength-2]-=n;let o=2*i;for(let l=this.maxLength;l!=0;l--){let c=this.bitLengthCounts[l-1];for(;c>0;){let u=2*e[o++];e[u+1]==-1&&(this.length[e[u]]=l,c--)}}}getEncodedLength(){let e=0;for(let r=0;r=r)););n0&&(this.codes[i]=Ze.bitReverse(e[n-1]),e[n-1]+=1<<16-n)}}writeTree(e){let r,i,n,s=-1,a=0;for(;a=r)););if(n0;)e.writeSymbol(s);else s!=0?(e.writeSymbol(Wn.Repeat3To6),this.huffman.pending.writeBits(n-3,2)):n<=10?(e.writeSymbol(Wn.Repeat3To10),this.huffman.pending.writeBits(n-3,3)):(e.writeSymbol(Wn.Repeat11To138),this.huffman.pending.writeBits(n-11,7))}}writeSymbol(e){this.huffman.pending.writeBits(this.codes[e]&65535,this.length[e])}}Wn.Repeat3To6=16;Wn.Repeat3To10=17;Wn.Repeat11To138=18;class Ze{static staticInit(){let e=0;for(;e<144;)Ze.staticLCodes[e]=Ze.bitReverse(48+e<<8),Ze.staticLLength[e++]=8;for(;e<256;)Ze.staticLCodes[e]=Ze.bitReverse(256+e<<7),Ze.staticLLength[e++]=9;for(;e<280;)Ze.staticLCodes[e]=Ze.bitReverse(-256+e<<9),Ze.staticLLength[e++]=7;for(;e>4&15]<<8|Ze.bit4Reverse[e>>8&15]<<4|Ze.bit4Reverse[e>>12]}constructor(e){this.last_lit=0,this.extra_bits=0,this.pending=e,this.literalTree=new Wn(this,Ze.LITERAL_NUM,257,15),this.distTree=new Wn(this,Ze.DIST_NUM,1,15),this.blTree=new Wn(this,Ze.BITLEN_NUM,4,7),this.d_buf=new Int16Array(Ze.BUFSIZE),this.l_buf=new Uint8Array(Ze.BUFSIZE)}isFull(){return this.last_lit>=Ze.BUFSIZE}reset(){this.last_lit=0,this.extra_bits=0,this.literalTree.reset(),this.distTree.reset(),this.blTree.reset()}flushStoredBlock(e,r,i,n){this.pending.writeBits((Ze.STORED_BLOCK<<1)+(n?1:0),3),this.pending.alignToByte(),this.pending.writeShort(i),this.pending.writeShort(~i),this.pending.writeBlock(e,r,i),this.reset()}flushBlock(e,r,i,n){this.literalTree.freqs[Ze.EOF_SYMBOL]++,this.literalTree.buildTree(),this.distTree.buildTree(),this.literalTree.calcBLFreq(this.blTree),this.distTree.calcBLFreq(this.blTree),this.blTree.buildTree();let s=4;for(let l=18;l>s;l--)this.blTree.length[Ze.BL_ORDER[l]]>0&&(s=l+1);let a=14+s*3+this.blTree.getEncodedLength()+this.literalTree.getEncodedLength()+this.distTree.getEncodedLength()+this.extra_bits,o=this.extra_bits;for(let l=0;l=o&&(a=o),r>=0&&i+4>3?this.flushStoredBlock(e,r,i,n):a==o?(this.pending.writeBits((Ze.STATIC_TREES<<1)+(n?1:0),3),this.literalTree.setStaticCodes(Ze.staticLCodes,Ze.staticLLength),this.distTree.setStaticCodes(Ze.staticDCodes,Ze.staticDLength),this.compressBlock(),this.reset()):(this.pending.writeBits((Ze.DYN_TREES<<1)+(n?1:0),3),this.sendAllTrees(s),this.compressBlock(),this.reset())}sendAllTrees(e){this.blTree.buildCodes(),this.literalTree.buildCodes(),this.distTree.buildCodes(),this.pending.writeBits(this.literalTree.numCodes-257,5),this.pending.writeBits(this.distTree.numCodes-1,5),this.pending.writeBits(e-4,4);for(let r=0;r0&&s<=5&&this.pending.writeBits(r&(1<0&&this.pending.writeBits(i&(1<=265&&i<285&&(this.extra_bits+=Math.floor((i-261)/4));let n=Ze.Dcode(e-1);return this.distTree.freqs[n]++,n>=4&&(this.extra_bits+=Math.floor(n/2)-1),this.isFull()}tallyLit(e){return this.d_buf[this.last_lit]=0,this.l_buf[this.last_lit++]=e,this.literalTree.freqs[e]++,this.isFull()}static Lcode(e){if(e==255)return 285;let r=257;for(;e>=8;)r+=4,e=e>>1;return r+e}static Dcode(e){let r=0;for(;e>=4;)r+=2,e=e>>1;return r+e}}Ze.BUFSIZE=1<{if(Se.webPlatform==Un.NodeJs)throw new gi(mi.General,"Workers not yet supported in Node.js");if(Se.webPlatform==Un.BrowserModule||Se.isWebPackBundled||Se.isViteBundled)return de.debug("AlphaTab","Creating webworker"),new Se.alphaTabWorker(new URL(new URL("/sandbox/assets/alphaTab.worker-CLdxKs-e.js",import.meta.url),import.meta.url),{type:"module"});if(!t.core.scriptFile)throw new gi(mi.General,"Could not detect alphaTab script file, cannot initialize renderer");try{de.debug("AlphaTab","Creating Blob worker");const e=`importScripts('${t.core.scriptFile}')`,r=new Blob([e]);return new Worker(URL.createObjectURL(r))}catch{return de.warning("Rendering","Could not create inline worker, fallback to normal worker"),new Worker(t.core.scriptFile)}},(t,e)=>{if(Se.webPlatform==Un.NodeJs)throw new gi(mi.General,"Audio Worklets not yet supported in Node.js");return Se.webPlatform==Un.BrowserModule||Se.isWebPackBundled||Se.isViteBundled?(de.debug("AlphaTab","Creating Module worklet"),t.audioWorklet.addModule(new URL(new URL("/sandbox/assets/alphaTab.worklet-DYZhGsI-.js",import.meta.url),import.meta.url))):(de.debug("AlphaTab","Creating Script worklet"),t.audioWorklet.addModule(e.core.scriptFile))});function CZ(t){const e=w.useRef(null),r=w.useRef(null),i=t.string??void 0,n={key:{note:Zt("C")},chords:qR.generate(t.note,t.quality,i,t.inversion)};w.useEffect(()=>(e.current&&(r.current=new sy(e.current,{core:{fontDirectory:"/font/"},player:{enablePlayer:!0,enableCursor:!0,enableUserInteraction:!0,soundFont:"/soundfont/sonivox.sf2"}}),console.log(OC.toTex(n)),r.current.tex(`\\tempo 50 . ${OC.toTex(n)}`)),()=>{var a;(a=r.current)==null||a.destroy()}),[]);function s(){var a;(a=r.current)==null||a.playPause()}return T.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[T.jsx("div",{style:{width:600},ref:e}),T.jsx(Va,{onClick:s,children:"Play/Pause"})]})}const TZ=840;function PT(){return{width:window.innerWidth,height:window.innerHeight,isMobile:window.innerWidth(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[]),t}const NT=[Zt("C"),Zt("D",La.Flat),Zt("D"),Zt("E",La.Flat),Zt("E"),Zt("F"),Zt("G",La.Flat),Zt("G"),Zt("A",La.Flat),Zt("A"),Zt("B",La.Flat),Zt("B")],ET=[_o.Root,_o.First,_o.Second,_o.Third],BZ=[fl.Maj7,fl.Dom7,fl.Min7,fl.Half,fl.Full],Ii={container:{display:"flex",flex:1,flexDirection:"column",padding:14,fontFamily:"sans-serif"},section:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(60px, 1fr))",gridTemplateRows:"repeat(auto-fit, minmax(40px, 1fr))",gap:14},notesSection:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(60px, 1fr))",gridTemplateRows:"repeat(auto-fit, minmax(40px, 1fr))",gap:14},formGroup:{marginTop:16,marginBottom:16},button:{backgroundColor:"#007BFF",color:"#fff",transition:"background-color 0.3s, transform 0.1s",cursor:"pointer",flex:1},chordText:{fontSize:20,marginTop:5,textAlign:"center",textTransform:"none"},toggleButton:{maxHeight:"50px",display:"flex",flexDirection:"column",borderRadius:8,textAlign:"center",justifyContent:"center",fontSize:15,padding:7,cursor:"pointer",transition:"background-color 0.3s, transform 0.1s"},toggleButtonsContainer:{},toggleButtonChecked:{backgroundColor:"#9df"},toggleButtonUnchecked:{backgroundColor:"#eee"},toggleButtonHover:{backgroundColor:"#b3e5fc"},toggleButtonActive:{transform:"scale(0.95)"},buttonHover:{backgroundColor:"#0056b3"},buttonActive:{transform:"scale(0.95)"}};function PZ(){const[t,e]=w.useState(NT),[r,i]=w.useState(ET),[n,s]=w.useState(BZ),[a,o]=w.useState(!0),[l,c]=w.useState(!1),{isMobile:u}=_Z(),[d,h]=w.useState(null);function p(){h({note:t[Math.floor(Math.random()*t.length)],inversion:r[Math.floor(Math.random()*r.length)],quality:n[Math.floor(Math.random()*n.length)],string:a?Math.floor(Math.random()*2)===0?6:5:null})}return T.jsxs(Tu,{title:"Chord Generator",children:[T.jsxs("div",{style:Ii.container,children:[T.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignContent:"center"},children:T.jsx(Va,{style:Ii.chordText,disabled:!d,onClick:()=>c(!0),children:T.jsx(Mr,{children:d?`${di.toDisplayString(d.note)} ${d.quality?d.quality:""} ${d.inversion} ${d.string?` on ${d.string} string`:""}`:"Generate a chord!"})})}),T.jsxs("div",{style:Ii.toggleButtonsContainer,children:[T.jsx("div",{style:Ii.notesSection,children:NT.map(f=>T.jsx(Ib,{checked:t.includes(f),onChange:()=>t.includes(f)?e(m=>m.filter(y=>di.toNoteNumber(y)!==di.toNoteNumber(f))):e(m=>m.concat(f)),children:di.toDisplayString(f)},di.toDisplayString(f)))}),T.jsx(B1,{style:{minHeight:"5px",margin:"7px 0"}}),T.jsx("div",{style:Ii.section,children:ET.map(f=>T.jsx(Ib,{checked:r.includes(f),onChange:()=>r.includes(f)?i(m=>m.filter(y=>y!==f)):i(m=>m.concat(f)),children:f},f))}),T.jsx(B1,{style:{minHeight:"5px",margin:"7px 0"}}),T.jsx("div",{style:Ii.section,children:Object.values(fl).map(f=>T.jsx(Ib,{checked:n.includes(f),onChange:()=>n.includes(f)?s(m=>m.filter(y=>y!==f)):s(m=>m.concat(f)),children:f},f))})]}),T.jsx(k6,{style:Ii.formGroup,children:T.jsx(y6,{control:T.jsx(OU,{checked:a,onChange:()=>o(!a)}),label:"Include string"})}),T.jsx("div",{style:{display:"flex"},children:T.jsx(Va,{style:Ii.button,size:"large",onMouseOver:f=>f.currentTarget.style.backgroundColor=Ii.buttonHover.backgroundColor,onMouseOut:f=>f.currentTarget.style.backgroundColor=Ii.button.backgroundColor,onMouseDown:f=>f.currentTarget.style.transform=Ii.buttonActive.transform,onMouseUp:f=>f.currentTarget.style.transform="scale(1)",onClick:p,children:"Generate"})})]}),d&&l&&T.jsxs(Gg,{fullScreen:u,open:l,onClose:()=>c(!1),children:[T.jsx(IN,{children:`${di.toDisplayString(d.note)} ${d.quality?d.quality:""} ${d.inversion} ${d.string?` on ${d.string} string`:""}`}),T.jsx(yn,{"aria-label":"close",onClick:()=>c(!1),sx:{position:"absolute",right:9,top:9,color:f=>f.palette.grey[600]},children:T.jsx(aE,{})}),T.jsx(CZ,{note:d.note,inversion:d.inversion,string:d.string,quality:d.quality})]})]})}function Ib({children:t,checked:e,onChange:r}){return T.jsx("div",{style:{...Ii.toggleButton,...e?Ii.toggleButtonChecked:Ii.toggleButtonUnchecked},onMouseOver:i=>i.currentTarget.style.backgroundColor=Ii.toggleButtonHover.backgroundColor,onMouseOut:i=>i.currentTarget.style.backgroundColor=e?Ii.toggleButtonChecked.backgroundColor:Ii.toggleButtonUnchecked.backgroundColor,onMouseDown:i=>i.currentTarget.style.transform=Ii.toggleButtonActive.transform,onMouseUp:i=>i.currentTarget.style.transform="scale(1)",onClick:()=>r(!e),children:T.jsx("div",{children:t})})}function NZ(){const t=CF([{path:"/",element:T.jsx(OG,{}),children:[]},{path:"/todo",element:T.jsx(VG,{})},{path:"/counter",element:T.jsx(gj,{})},{path:"/rating",element:T.jsx(yj,{})},{path:"/layout",element:T.jsx(bj,{})},{path:"/shifts",element:T.jsx(gQ,{})},{path:"/music",element:T.jsx(PZ,{})}]);return T.jsx(fS,{dateAdapter:RQ,children:T.jsx(DF,{router:t})})}const EZ=X7({reducer:{counter:mj}});Ob.createRoot(document.getElementById("root")).render(T.jsx(At.StrictMode,{children:T.jsx(a7,{store:EZ,children:T.jsx(NZ,{})})})); + }`;i.innerHTML=n,e.getElementsByTagName("head").item(0).appendChild(i),xe.bravuraFontChecker.checkForFontAvailability()}}static get globalThis(){if(xe._globalThis===void 0){try{xe._globalThis=globalThis}catch{}typeof xe._globalThis>"u"&&(xe._globalThis=self),typeof xe._globalThis>"u"&&(xe._globalThis=global),typeof xe._globalThis>"u"&&(xe._globalThis=window),typeof xe._globalThis>"u"&&(xe._globalThis=Function("return this")())}return this._globalThis}static get isRunningInWorker(){return"WorkerGlobalScope"in xe.globalThis}static get isRunningInAudioWorklet(){return"AudioWorkletGlobalScope"in xe.globalThis}static throttle(e,r){let i=0;return()=>{xe.globalThis.clearTimeout(i),i=xe.globalThis.setTimeout(e,r)}}static detectScriptFile(){if(!xe.isRunningInWorker&&xe.globalThis.ALPHATAB_ROOT){let e=xe.globalThis.ALPHATAB_ROOT;return e=xe.ensureFullUrl(e),e=xe.appendScriptName(e),e}try{const e=import.meta.url;if(e&&e.indexOf("file://")===-1)return e}catch{}return"document"in xe.globalThis&&document.currentScript?document.currentScript.src:null}static ensureFullUrl(e){var r,i,n;if(!e)return"";if(!e.startsWith("http")&&!e.startsWith("https")&&!e.startsWith("file")){let s="",a=xe.globalThis.location;if(s+=(r=a.protocol)==null?void 0:r.toString(),s+="//",a.hostname&&(s+=(i=a.hostname)==null?void 0:i.toString()),a.port&&(s+=":",s+=(n=a.port)==null?void 0:n.toString()),!e.startsWith("/")){let o=a.pathname.split("/").slice(0,-1).join("/");o.length>0&&(o.startsWith("/")||(s+="/"),s+=o==null?void 0:o.toString())}return e.startsWith("/")||(s+="/"),s+=e==null?void 0:e.toString(),s}return e}static appendScriptName(e){return e&&!e.endsWith(".js")&&(e.endsWith("/")||(e+="/"),e+="alphaTab.js"),e}static detectFontDirectory(){if(!xe.isRunningInWorker&&xe.globalThis.ALPHATAB_FONT)return xe.ensureFullUrl(xe.globalThis.ALPHATAB_FONT);const e=xe.scriptFile;if(e){let r=e.lastIndexOf("/");if(r>=0)return e.substr(0,r)+"/font/"}return null}static registerJQueryPlugin(){if(!xe.isRunningInWorker&&xe.globalThis&&"jQuery"in xe.globalThis){let e=xe.globalThis.jQuery,r=new sT;e.fn.alphaTab=function(i){const n=Array.prototype.slice.call(arguments,1);return this.length===1?r.exec(this[0],i,n):this.each((s,a)=>{r.exec(a,i,n)})},e.alphaTab={restore:sT.restore},e.fn.alphaTab.fn=r}}static getRenderEngineFactory(e){return!e||!xe.renderEngines.has(e)?xe.renderEngines.get("default"):xe.renderEngines.get(e)}static getLayoutEngineFactory(e){return!e||!xe.layoutEngines.has(e)?xe.layoutEngines.get(Ya.Page):xe.layoutEngines.get(e)}static buildImporters(){return[new da,new UQ,new WQ,new GQ,new xZ,new Wi]}static createDefaultRenderEngines(){const e=new Map;return e.set("svg",new Fb(!0,()=>new xJ)),e.set("default",e.get("svg")),e.set("skia",new Fb(!1,()=>new or)),xe.createPlatformSpecificRenderEngines(e),e}static enableAlphaSkia(e,r){or.enable(e,r)}static registerAlphaSkiaCustomFont(e,r){return or.registerFont(e,r)}static createPlatformSpecificRenderEngines(e){e.set("html5",new Fb(!1,()=>new nJ))}static createDefaultStaveProfiles(){const e=new Map;e.set(Cn.ScoreTab,[new mo("score-effects",[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new fT,new Gf,new Wf(!0),new jf,new Hf,new Yf,new Uf,new qf,new wb]),new bT,new mo("tab-effects",[new cT,new Wf(!1),new uT,new zf,new Gf,new jf,new Hf,new Yf,new Uf,new hT,new xb,new On(qe.Natural),new On(qe.Artificial),new On(qe.Pinch),new On(qe.Tap),new On(qe.Semi),new On(qe.Feedback),new Cb,new lT,new dT,new _b,new Pb,new Bb,new qf]),new Mb(!1,!1,!1)]),e.set(Cn.Score,[new mo("score-effects",[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new fT,new Gf,new Wf(!0),new jf,new Hf,new Yf,new Uf,new xb,new Cb,new _b,new Pb,new Bb,new qf,new wb]),new bT,new mo("score-bottom-effects",[new cT,new Wf(!1),new uT,new zf])]);let r=[new Nb,new Rb,new Tb,new Eb,new Sb,new kb,new Gf,new jf,new Hf,new Yf,new Uf,new hT,new xb,new On(qe.Artificial),new On(qe.Pinch),new On(qe.Tap),new On(qe.Semi),new On(qe.Feedback),new Cb,new lT,new dT,new _b,new Pb,new Bb,new qf,new wb];return e.set(Cn.Tab,[new mo("tab-effects",r),new Mb(!0,!0,!0),new mo("tab-bottom-effects",[new zf])]),e.set(Cn.TabMixed,[new mo("tab-effects",r),new Mb(!1,!1,!1),new mo("tab-bottom-effects",[new zf])]),e}static createDefaultLayoutEngines(){const e=new Map;return e.set(Ya.Page,new _T(!0,r=>new ef(r))),e.set(Ya.Horizontal,new _T(!1,r=>new Zh(r))),e}static initializeMain(e,r){xe.isRunningInWorker||xe.isRunningInAudioWorklet||((xe.webPlatform===Un.Browser||xe.webPlatform===Un.BrowserModule)&&(xe.registerJQueryPlugin(),xe.HighDpiFactor=window.devicePixelRatio,"ResizeObserver"in xe.globalThis||(xe.globalThis.ResizeObserver=kZ),"IntersectionObserver"in xe.globalThis||(xe.globalThis.IntersectionObserver=CZ),"replaceChildren"in Element.prototype||(Element.prototype.replaceChildren=function(...i){this.innerHTML="",this.append(...i)},Document.prototype.replaceChildren=Element.prototype.replaceChildren,DocumentFragment.prototype.replaceChildren=Element.prototype.replaceChildren),"replaceAll"in String.prototype||(String.prototype.replaceAll=function(i,n){return this.replace(new RegExp(i,"g"),n)})),xe.createWebWorker=e,xe.createAudioWorklet=r)}static get alphaTabWorker(){return this.globalThis.Worker}static initializeWorker(){if(!xe.isRunningInWorker)throw new gi(mi.General,"Not running in worker, cannot run worker initialization");$S.init(),AS.init(),xe.createWebWorker=e=>{throw new gi(mi.General,"Nested workers are not supported")}}static initializeAudioWorklet(){if(!xe.isRunningInAudioWorklet)throw new gi(mi.General,"Not running in audio worklet, cannot run worklet initialization");xh.init()}static detectWebPack(){try{if(typeof __webpack_require__=="function")return!0}catch{}return!1}static detectVite(){try{if(typeof __BASE__=="string")return!0}catch{}return!1}static detectWebPlatform(){try{if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return Un.NodeJs}catch{}try{const e=import.meta.url;if(e&&typeof e=="string"&&!e.startsWith("file://"))return Un.BrowserModule}catch{}return Un.Browser}}xe.MusicFontSize=34;xe.HighDpiFactor=1;xe._globalThis=void 0;xe.webPlatform=xe.detectWebPlatform();xe.isWebPackBundled=xe.detectWebPack();xe.isViteBundled=xe.detectVite();xe.scriptFile=xe.detectScriptFile();xe.fontDirectory=xe.detectFontDirectory();xe.bravuraFontChecker=new PM(["alphaTab"]);xe.renderEngines=xe.createDefaultRenderEngines();xe.layoutEngines=xe.createDefaultLayoutEngines();xe.staveProfiles=xe.createDefaultStaveProfiles();class zM{constructor(){this.scriptFile=null,this.fontDirectory=null,this.file=null,this.tex=!1,this.tracks=null,this.enableLazyLoading=!0,this.engine="default",this.logLevel=Gs.Info,this.useWorkers=!0,this.includeNoteBounds=!1,this.scriptFile=xe.scriptFile,this.fontDirectory=xe.fontDirectory}}var fe;(function(t){t[t.SteelGuitar=1]="SteelGuitar",t[t.AcousticGuitar=2]="AcousticGuitar",t[t.TwelveStringGuitar=3]="TwelveStringGuitar",t[t.ElectricGuitar=4]="ElectricGuitar",t[t.Bass=5]="Bass",t[t.ClassicalGuitar=23]="ClassicalGuitar",t[t.UprightBass=6]="UprightBass",t[t.Ukulele=7]="Ukulele",t[t.Banjo=8]="Banjo",t[t.Mandolin=9]="Mandolin",t[t.Piano=10]="Piano",t[t.Synth=12]="Synth",t[t.Strings=11]="Strings",t[t.Brass=13]="Brass",t[t.Reed=14]="Reed",t[t.Woodwind=15]="Woodwind",t[t.Vocal=16]="Vocal",t[t.PitchedIdiophone=17]="PitchedIdiophone",t[t.Fx=21]="Fx",t[t.PercussionKit=18]="PercussionKit",t[t.Idiophone=19]="Idiophone",t[t.Membraphone=20]="Membraphone"})(fe||(fe={}));class ye{constructor(e,r,i=null){if(this.icon=fe.Piano,this.icon=e,this.instrumentSetName=r,i)this.instrumentSetType=i;else{const n=r.split(" ");n[0]=n[0].substr(0,1).toLowerCase()+n[0].substr(1),this.instrumentSetType=n.join("")}}}new ye(fe.Piano,"Acoustic Piano"),new ye(fe.Piano,"Acoustic Piano"),new ye(fe.Piano,"Electric Piano"),new ye(fe.Piano,"Acoustic Piano"),new ye(fe.Piano,"Electric Piano"),new ye(fe.Piano,"Electric Piano"),new ye(fe.Piano,"Harpsichord"),new ye(fe.Piano,"Harpsichord"),new ye(fe.PitchedIdiophone,"Celesta"),new ye(fe.PitchedIdiophone,"Vibraphone"),new ye(fe.PitchedIdiophone,"Vibraphone"),new ye(fe.PitchedIdiophone,"Vibraphone"),new ye(fe.PitchedIdiophone,"Xylophone"),new ye(fe.PitchedIdiophone,"Xylophone"),new ye(fe.PitchedIdiophone,"Vibraphone"),new ye(fe.Banjo,"Banjo"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Piano,"Electric Organ"),new ye(fe.Woodwind,"Recorder"),new ye(fe.Piano,"Electric Organ"),new ye(fe.ClassicalGuitar,"Nylon Guitar"),new ye(fe.SteelGuitar,"Steel Guitar"),new ye(fe.SteelGuitar,"Electric Guitar"),new ye(fe.ElectricGuitar,"Electric Guitar"),new ye(fe.ElectricGuitar,"Electric Guitar"),new ye(fe.ElectricGuitar,"Electric Guitar"),new ye(fe.SteelGuitar,"Electric Guitar"),new ye(fe.SteelGuitar,"Electric Guitar"),new ye(fe.Bass,"Acoustic Bass"),new ye(fe.Bass,"Electric Bass"),new ye(fe.Bass,"Electric Bass"),new ye(fe.Bass,"Acoustic Bass"),new ye(fe.Bass,"Electric Bass"),new ye(fe.Bass,"Electric Bass"),new ye(fe.Synth,"Synth Bass"),new ye(fe.Synth,"Synth Bass"),new ye(fe.Strings,"Violin"),new ye(fe.Strings,"Viola"),new ye(fe.Strings,"Cello"),new ye(fe.Strings,"Contrabass"),new ye(fe.Strings,"Violin"),new ye(fe.Strings,"Violin"),new ye(fe.Piano,"Harp"),new ye(fe.Membraphone,"Timpani"),new ye(fe.Strings,"Violin"),new ye(fe.Strings,"Violin"),new ye(fe.Strings,"Violin"),new ye(fe.Strings,"Violin"),new ye(fe.Vocal,"Voice"),new ye(fe.Vocal,"Voice"),new ye(fe.Vocal,"Voice"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Brass,"Trumpet"),new ye(fe.Brass,"Trombone"),new ye(fe.Brass,"Tuba"),new ye(fe.Brass,"Trumpet"),new ye(fe.Brass,"French Horn"),new ye(fe.Brass,"Trumpet"),new ye(fe.Brass,"Trumpet"),new ye(fe.Brass,"Trumpet"),new ye(fe.Reed,"Saxophone"),new ye(fe.Reed,"Saxophone"),new ye(fe.Reed,"Saxophone"),new ye(fe.Reed,"Saxophone"),new ye(fe.Reed,"Oboe"),new ye(fe.Reed,"English Horn"),new ye(fe.Reed,"Bassoon"),new ye(fe.Reed,"Clarinet"),new ye(fe.Reed,"Piccolo"),new ye(fe.Woodwind,"Flute"),new ye(fe.Woodwind,"Recorder"),new ye(fe.Woodwind,"Flute"),new ye(fe.Woodwind,"Recorder"),new ye(fe.Woodwind,"Flute"),new ye(fe.Woodwind,"Recorder"),new ye(fe.Woodwind,"Flute"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Lead Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Synth,"Pad Synthesizer"),new ye(fe.Fx,"Pad Synthesizer"),new ye(fe.Fx,"Pad Synthesizer"),new ye(fe.Fx,"Pad Synthesizer"),new ye(fe.Fx,"Pad Synthesizer"),new ye(fe.Fx,"Lead Synthesizer"),new ye(fe.Fx,"Lead Synthesizer"),new ye(fe.Fx,"Lead Synthesizer"),new ye(fe.Fx,"Trumpet"),new ye(fe.ElectricGuitar,"Banjo"),new ye(fe.Banjo,"Banjo"),new ye(fe.Ukulele,"Ukulele"),new ye(fe.Banjo,"Banjo"),new ye(fe.PitchedIdiophone,"Xylophone"),new ye(fe.Reed,"Bassoon"),new ye(fe.Strings,"Violin"),new ye(fe.Woodwind,"Flute"),new ye(fe.PitchedIdiophone,"Xylophone"),new ye(fe.Idiophone,"Celesta"),new ye(fe.PitchedIdiophone,"Vibraphone"),new ye(fe.Idiophone,"Xylophone"),new ye(fe.Membraphone,"Xylophone"),new ye(fe.Membraphone,"Xylophone"),new ye(fe.Membraphone,"Xylophone"),new ye(fe.Idiophone,"Celesta"),new ye(fe.Fx,"Steel Guitar"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Recorder"),new ye(fe.Fx,"Timpani");new ye(fe.PercussionKit,"Drums","drumKit");class El{static buildCrc32Lookup(){const r=new Uint32Array(256);for(let i=0;i>>1^3988292384:n>>>1;r[i]=n}return r}get value(){return~this._checkValue}constructor(){this._checkValue=El.CrcInit,this.reset()}update(e,r,i){for(let n=0;n>>8}reset(){this._checkValue=El.CrcInit}}El.Crc32Lookup=El.buildCrc32Lookup();El.CrcInit=4294967295;class wr{}wr.MAX_WBITS=15;wr.WSIZE=1<0;){let h=Math.floor((d-1)/2);if(this.freqs[r[h]]>u)r[d]=r[h],d=h;else break}r[d]=c,n=c}}for(;i<2;){let c=n<2?++n:0;r[i++]=c}this.numCodes=Math.max(n+1,this.minNumCodes);let s=i,a=new Int32Array(4*i-2),o=new Int32Array(2*i-1),l=s;for(let c=0;co[r[h+1]]&&h++,r[d]=r[h],d=h,h=h*2+1;let p=o[u];for(;h=d,d>0;)if(d=Math.floor((h-1)/2),o[r[d]]>p)r[h]=r[d];else break;r[h]=u;let f=r[0];u=l++,a[2*u]=c,a[2*u+1]=f;let m=Math.min(o[c]&255,o[f]&255);for(p=o[c]+o[f]-m+1,o[u]=p,d=0,h=1;ho[r[h+1]]&&h++,r[d]=r[h],d=h,h=d*2+1;for(;h=d,h>0;)if(d=Math.floor((h-1)/2),o[r[d]]>p)r[h]=r[d];else break;r[h]=u}while(i>1);this.buildLength(a)}buildLength(e){this.length=new Uint8Array(this.freqs.length);let r=Math.floor(e.length/2),i=Math.floor((r+1)/2),n=0;for(let l=0;l=0;l--)if(e[2*l+1]!=-1){let c=s[l]+1;c>this.maxLength&&(c=this.maxLength,n++),s[e[2*l]]=c,s[e[2*l+1]]=c}else{let c=s[l];this.bitLengthCounts[c-1]++,this.length[e[2*l]]=s[l]}if(n==0)return;let a=this.maxLength-1;do{for(;this.bitLengthCounts[--a]==0;);do this.bitLengthCounts[a]--,this.bitLengthCounts[++a]++,n-=1<0&&a0);this.bitLengthCounts[this.maxLength-1]+=n,this.bitLengthCounts[this.maxLength-2]-=n;let o=2*i;for(let l=this.maxLength;l!=0;l--){let c=this.bitLengthCounts[l-1];for(;c>0;){let u=2*e[o++];e[u+1]==-1&&(this.length[e[u]]=l,c--)}}}getEncodedLength(){let e=0;for(let r=0;r=r)););n0&&(this.codes[i]=et.bitReverse(e[n-1]),e[n-1]+=1<<16-n)}}writeTree(e){let r,i,n,s=-1,a=0;for(;a=r)););if(n0;)e.writeSymbol(s);else s!=0?(e.writeSymbol(Wn.Repeat3To6),this.huffman.pending.writeBits(n-3,2)):n<=10?(e.writeSymbol(Wn.Repeat3To10),this.huffman.pending.writeBits(n-3,3)):(e.writeSymbol(Wn.Repeat11To138),this.huffman.pending.writeBits(n-11,7))}}writeSymbol(e){this.huffman.pending.writeBits(this.codes[e]&65535,this.length[e])}}Wn.Repeat3To6=16;Wn.Repeat3To10=17;Wn.Repeat11To138=18;class et{static staticInit(){let e=0;for(;e<144;)et.staticLCodes[e]=et.bitReverse(48+e<<8),et.staticLLength[e++]=8;for(;e<256;)et.staticLCodes[e]=et.bitReverse(256+e<<7),et.staticLLength[e++]=9;for(;e<280;)et.staticLCodes[e]=et.bitReverse(-256+e<<9),et.staticLLength[e++]=7;for(;e>4&15]<<8|et.bit4Reverse[e>>8&15]<<4|et.bit4Reverse[e>>12]}constructor(e){this.last_lit=0,this.extra_bits=0,this.pending=e,this.literalTree=new Wn(this,et.LITERAL_NUM,257,15),this.distTree=new Wn(this,et.DIST_NUM,1,15),this.blTree=new Wn(this,et.BITLEN_NUM,4,7),this.d_buf=new Int16Array(et.BUFSIZE),this.l_buf=new Uint8Array(et.BUFSIZE)}isFull(){return this.last_lit>=et.BUFSIZE}reset(){this.last_lit=0,this.extra_bits=0,this.literalTree.reset(),this.distTree.reset(),this.blTree.reset()}flushStoredBlock(e,r,i,n){this.pending.writeBits((et.STORED_BLOCK<<1)+(n?1:0),3),this.pending.alignToByte(),this.pending.writeShort(i),this.pending.writeShort(~i),this.pending.writeBlock(e,r,i),this.reset()}flushBlock(e,r,i,n){this.literalTree.freqs[et.EOF_SYMBOL]++,this.literalTree.buildTree(),this.distTree.buildTree(),this.literalTree.calcBLFreq(this.blTree),this.distTree.calcBLFreq(this.blTree),this.blTree.buildTree();let s=4;for(let l=18;l>s;l--)this.blTree.length[et.BL_ORDER[l]]>0&&(s=l+1);let a=14+s*3+this.blTree.getEncodedLength()+this.literalTree.getEncodedLength()+this.distTree.getEncodedLength()+this.extra_bits,o=this.extra_bits;for(let l=0;l=o&&(a=o),r>=0&&i+4>3?this.flushStoredBlock(e,r,i,n):a==o?(this.pending.writeBits((et.STATIC_TREES<<1)+(n?1:0),3),this.literalTree.setStaticCodes(et.staticLCodes,et.staticLLength),this.distTree.setStaticCodes(et.staticDCodes,et.staticDLength),this.compressBlock(),this.reset()):(this.pending.writeBits((et.DYN_TREES<<1)+(n?1:0),3),this.sendAllTrees(s),this.compressBlock(),this.reset())}sendAllTrees(e){this.blTree.buildCodes(),this.literalTree.buildCodes(),this.distTree.buildCodes(),this.pending.writeBits(this.literalTree.numCodes-257,5),this.pending.writeBits(this.distTree.numCodes-1,5),this.pending.writeBits(e-4,4);for(let r=0;r0&&s<=5&&this.pending.writeBits(r&(1<0&&this.pending.writeBits(i&(1<=265&&i<285&&(this.extra_bits+=Math.floor((i-261)/4));let n=et.Dcode(e-1);return this.distTree.freqs[n]++,n>=4&&(this.extra_bits+=Math.floor(n/2)-1),this.isFull()}tallyLit(e){return this.d_buf[this.last_lit]=0,this.l_buf[this.last_lit++]=e,this.literalTree.freqs[e]++,this.isFull()}static Lcode(e){if(e==255)return 285;let r=257;for(;e>=8;)r+=4,e=e>>1;return r+e}static Dcode(e){let r=0;for(;e>=4;)r+=2,e=e>>1;return r+e}}et.BUFSIZE=1<{if(xe.webPlatform==Un.NodeJs)throw new gi(mi.General,"Workers not yet supported in Node.js");if(xe.webPlatform==Un.BrowserModule||xe.isWebPackBundled||xe.isViteBundled)return he.debug("AlphaTab","Creating webworker"),new xe.alphaTabWorker(new URL(new URL("/sandbox/assets/alphaTab.worker-CLdxKs-e.js",import.meta.url),import.meta.url),{type:"module"});if(!t.core.scriptFile)throw new gi(mi.General,"Could not detect alphaTab script file, cannot initialize renderer");try{he.debug("AlphaTab","Creating Blob worker");const e=`importScripts('${t.core.scriptFile}')`,r=new Blob([e]);return new Worker(URL.createObjectURL(r))}catch{return he.warning("Rendering","Could not create inline worker, fallback to normal worker"),new Worker(t.core.scriptFile)}},(t,e)=>{if(xe.webPlatform==Un.NodeJs)throw new gi(mi.General,"Audio Worklets not yet supported in Node.js");return xe.webPlatform==Un.BrowserModule||xe.isWebPackBundled||xe.isViteBundled?(he.debug("AlphaTab","Creating Module worklet"),t.audioWorklet.addModule(new URL(new URL("/sandbox/assets/alphaTab.worklet-DYZhGsI-.js",import.meta.url),import.meta.url))):(he.debug("AlphaTab","Creating Script worklet"),t.audioWorklet.addModule(e.core.scriptFile))});function _Z(t){const e=w.useRef(null),r=w.useRef(null),i=t.string??void 0,n={key:{note:Zt("C")},chords:QR.generate(t.note,t.quality,i,t.inversion)};w.useEffect(()=>{if(e.current){r.current=new sy(e.current,{core:{fontDirectory:"/font/"},player:{enablePlayer:!0,enableCursor:!0,enableUserInteraction:!0,soundFont:"/soundfont/sonivox.sf2"}});const a=` + \\tempo 120 + + . + + + ${FQ.toTex(n)}`;console.log(a),r.current.metronomeVolume=1,r.current.isLooping=!0,r.current.playbackSpeed=1,r.current.countInVolume=1,r.current.tex(a)}return()=>{var a;(a=r.current)==null||a.destroy()}},[]);function s(){var a;(a=r.current)==null||a.playPause()}return T.jsxs(T.Fragment,{children:[T.jsx("div",{style:{display:"flex",flexDirection:"column",overflow:"auto"},children:T.jsx("div",{style:{width:800,overflow:"auto"},ref:e})}),T.jsx("div",{style:{display:"flex"},children:T.jsx(aE,{defaultValue:1,step:.1,min:.1,max:2,style:{margin:"50px",flex:1},onChangeCommitted:(a,o)=>{r.current&&(r.current.playbackSpeed=o)},children:"Tempo"})}),T.jsx($a,{onClick:s,children:"Play/Pause"})]})}const BZ=840;function BT(){return{width:window.innerWidth,height:window.innerHeight,isMobile:window.innerWidth(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[]),t}const PT=[Zt("C"),Zt("D",La.Flat),Zt("D"),Zt("E",La.Flat),Zt("E"),Zt("F"),Zt("G",La.Flat),Zt("G"),Zt("A",La.Flat),Zt("A"),Zt("B",La.Flat),Zt("B")],NT=[Bo.Root,Bo.First,Bo.Second,Bo.Third],ET=[Fa.Maj7,Fa.Dom7,Fa.Min7,Fa.Half,Fa.Full],Ii={container:{display:"flex",flex:1,flexDirection:"column",padding:14,fontFamily:"sans-serif"},section:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(60px, 1fr))",gridTemplateRows:"repeat(auto-fit, minmax(40px, 1fr))",gap:14},notesSection:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(60px, 1fr))",gridTemplateRows:"repeat(auto-fit, minmax(40px, 1fr))",gap:14},formGroup:{marginTop:16,marginBottom:16},button:{backgroundColor:"#007BFF",color:"#fff",transition:"background-color 0.3s, transform 0.1s",cursor:"pointer",flex:1},chordText:{fontSize:20,marginTop:5,textAlign:"center",textTransform:"none"},toggleButton:{maxHeight:"50px",display:"flex",flexDirection:"column",borderRadius:8,textAlign:"center",justifyContent:"center",fontSize:15,padding:7,cursor:"pointer",transition:"background-color 0.3s, transform 0.1s"},toggleButtonsContainer:{},toggleButtonChecked:{backgroundColor:"#9df"},toggleButtonUnchecked:{backgroundColor:"#eee"},toggleButtonHover:{backgroundColor:"#b3e5fc"},toggleButtonActive:{transform:"scale(0.95)"},buttonHover:{backgroundColor:"#0056b3"},buttonActive:{transform:"scale(0.95)"}};function NZ(){const[t,e]=w.useState(PT),[r,i]=w.useState(NT),[n,s]=w.useState(ET),[a,o]=w.useState(!0),[l,c]=w.useState(!1),{isMobile:u}=PZ(),[d,h]=w.useState(null);function p(){h({note:t[Math.floor(Math.random()*t.length)],inversion:r[Math.floor(Math.random()*r.length)],quality:n[Math.floor(Math.random()*n.length)],string:a?Math.floor(Math.random()*2)===0?6:5:null})}return T.jsxs(Tu,{title:"Chord Generator",children:[T.jsxs("div",{style:Ii.container,children:[T.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignContent:"center"},children:T.jsx($a,{style:Ii.chordText,disabled:!d,onClick:()=>c(!0),children:T.jsx(Mr,{children:d?`${Gr.toDisplayString(d.note)} ${d.quality?d.quality:""} ${d.inversion?d.inversion:""} ${d.string?` on ${d.string} string`:""}`:"Generate a chord!"})})}),T.jsxs("div",{style:Ii.toggleButtonsContainer,children:[T.jsx("div",{style:Ii.notesSection,children:PT.map(f=>T.jsx(Ib,{checked:t.includes(f),onChange:()=>t.includes(f)?e(m=>m.filter(y=>Gr.toNoteNumber(y)!==Gr.toNoteNumber(f))):e(m=>m.concat(f)),children:Gr.toDisplayString(f)},Gr.toDisplayString(f)))}),T.jsx(B1,{style:{minHeight:"5px",margin:"7px 0"}}),T.jsx("div",{style:Ii.section,children:NT.map(f=>T.jsx(Ib,{checked:r.includes(f),onChange:()=>r.includes(f)?i(m=>m.filter(y=>y!==f)):i(m=>m.concat(f)),children:f},f))}),T.jsx(B1,{style:{minHeight:"5px",margin:"7px 0"}}),T.jsx("div",{style:Ii.section,children:ET.map(f=>T.jsx(Ib,{checked:n.includes(f),onChange:()=>n.includes(f)?s(m=>m.filter(y=>y!==f)):s(m=>m.concat(f)),children:f},f))})]}),T.jsx(TW,{style:Ii.formGroup,children:T.jsx(vW,{control:T.jsx(AU,{checked:a,onChange:()=>o(!a)}),label:"Include string"})}),T.jsx("div",{style:{display:"flex"},children:T.jsx($a,{style:Ii.button,size:"large",onMouseOver:f=>f.currentTarget.style.backgroundColor=Ii.buttonHover.backgroundColor,onMouseOut:f=>f.currentTarget.style.backgroundColor=Ii.button.backgroundColor,onMouseDown:f=>f.currentTarget.style.transform=Ii.buttonActive.transform,onMouseUp:f=>f.currentTarget.style.transform="scale(1)",onClick:p,children:"Generate"})})]}),d&&l&&T.jsxs(Gg,{maxWidth:"lg",fullScreen:u,open:l,onClose:()=>c(!1),children:[T.jsx(IN,{children:`${Gr.toDisplayString(d.note)} ${d.quality?d.quality:""} ${d.inversion?d.inversion:""} ${d.string?` on ${d.string} string`:""}`}),T.jsx(yn,{"aria-label":"close",onClick:()=>c(!1),sx:{position:"absolute",right:9,top:9,color:f=>f.palette.grey[600]},children:T.jsx(oE,{})}),T.jsx(_Z,{note:d.note,inversion:d.inversion,string:d.string,quality:d.quality})]})]})}function Ib({children:t,checked:e,onChange:r}){return T.jsx("div",{style:{...Ii.toggleButton,...e?Ii.toggleButtonChecked:Ii.toggleButtonUnchecked},onMouseOver:i=>i.currentTarget.style.backgroundColor=Ii.toggleButtonHover.backgroundColor,onMouseOut:i=>i.currentTarget.style.backgroundColor=e?Ii.toggleButtonChecked.backgroundColor:Ii.toggleButtonUnchecked.backgroundColor,onMouseDown:i=>i.currentTarget.style.transform=Ii.toggleButtonActive.transform,onMouseUp:i=>i.currentTarget.style.transform="scale(1)",onClick:()=>r(!e),children:T.jsx("div",{children:t})})}function EZ(){const t=_F([{path:"/",element:T.jsx(AG,{}),children:[]},{path:"/todo",element:T.jsx($G,{})},{path:"/counter",element:T.jsx(yj,{})},{path:"/rating",element:T.jsx(bj,{})},{path:"/layout",element:T.jsx(vj,{})},{path:"/shifts",element:T.jsx(yQ,{})},{path:"/music",element:T.jsx(NZ,{})}]);return T.jsx(fS,{dateAdapter:MQ,children:T.jsx(FF,{router:t})})}const RZ=q7({reducer:{counter:gj}});Ob.createRoot(document.getElementById("root")).render(T.jsx(At.StrictMode,{children:T.jsx(o7,{store:RZ,children:T.jsx(EZ,{})})})); diff --git a/index.html b/index.html index 412ddb8..d231c30 100644 --- a/index.html +++ b/index.html @@ -18,8 +18,8 @@ flex-direction: column; } - - + +