var ln=Object.defineProperty;var un=(i,e,r)=>e in i?ln(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var ii=(i,e,r)=>(un(i,typeof e!="symbol"?e+"":e,r),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const index$1="",common="",popup$1="",SnackbarSfc="",elevation="",loading$2="",button$1="",icon$1="",snackbar="",coreSfc="",cell="",CellSfc="",ripple="",formDetails="",hoverOverlay="",_switch="",SwitchSfc="",style="";function makeMap(i,e){const r=Object.create(null),s=i.split(",");for(let o=0;o!!r[o.toLowerCase()]:o=>!!r[o]}function normalizeStyle(i){if(isArray$9(i)){const e={};for(let r=0;r{if(r){const s=r.split(propertyDelimiterRE);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function normalizeClass(i){let e="";if(isString$2(i))e=i;else if(isArray$9(i))for(let r=0;risString$2(i)?i:i==null?"":isArray$9(i)||isObject$5(i)&&(i.toString===objectToString$3||!isFunction$6(i.toString))?JSON.stringify(i,replacer,2):String(i),replacer=(i,e)=>e&&e.__v_isRef?replacer(i,e.value):isMap$3(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[s,o])=>(r[`${s} =>`]=o,r),{})}:isSet$3(e)?{[`Set(${e.size})`]:[...e.values()]}:isObject$5(e)&&!isArray$9(e)&&!isPlainObject$3(e)?String(e):e,EMPTY_OBJ={},EMPTY_ARR=[],NOOP=()=>{},NO=()=>!1,onRE=/^on[^a-z]/,isOn=i=>onRE.test(i),isModelListener=i=>i.startsWith("onUpdate:"),extend$3=Object.assign,remove$7=(i,e)=>{const r=i.indexOf(e);r>-1&&i.splice(r,1)},hasOwnProperty$f=Object.prototype.hasOwnProperty,hasOwn$2=(i,e)=>hasOwnProperty$f.call(i,e),isArray$9=Array.isArray,isMap$3=i=>toTypeString(i)==="[object Map]",isSet$3=i=>toTypeString(i)==="[object Set]",isFunction$6=i=>typeof i=="function",isString$2=i=>typeof i=="string",isSymbol$1=i=>typeof i=="symbol",isObject$5=i=>i!==null&&typeof i=="object",isPromise$1=i=>isObject$5(i)&&isFunction$6(i.then)&&isFunction$6(i.catch),objectToString$3=Object.prototype.toString,toTypeString=i=>objectToString$3.call(i),toRawType=i=>toTypeString(i).slice(8,-1),isPlainObject$3=i=>toTypeString(i)==="[object Object]",isIntegerKey=i=>isString$2(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,isReservedProp=makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cacheStringFunction=i=>{const e=Object.create(null);return r=>e[r]||(e[r]=i(r))},camelizeRE$1=/-(\w)/g,camelize$2=cacheStringFunction(i=>i.replace(camelizeRE$1,(e,r)=>r?r.toUpperCase():"")),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(i=>i.replace(hyphenateRE,"-$1").toLowerCase()),capitalize=cacheStringFunction(i=>i.charAt(0).toUpperCase()+i.slice(1)),toHandlerKey=cacheStringFunction(i=>i?`on${capitalize(i)}`:""),hasChanged=(i,e)=>!Object.is(i,e),invokeArrayFns=(i,e)=>{for(let r=0;r{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value:r})},looseToNumber=i=>{const e=parseFloat(i);return isNaN(e)?i:e},toNumber$1=i=>{const e=isString$2(i)?Number(i):NaN;return isNaN(e)?i:e};let _globalThis;const getGlobalThis=()=>_globalThis||(_globalThis=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let activeEffectScope;class EffectScope{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=activeEffectScope,!e&&activeEffectScope&&(this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const r=activeEffectScope;try{return activeEffectScope=this,e()}finally{activeEffectScope=r}}}on(){activeEffectScope=this}off(){activeEffectScope=this.parent}stop(e){if(this._active){let r,s;for(r=0,s=this.effects.length;r{const e=new Set(i);return e.w=0,e.n=0,e},wasTracked=i=>(i.w&trackOpBit)>0,newTracked=i=>(i.n&trackOpBit)>0,initDepMarkers=({deps:i})=>{if(i.length)for(let e=0;e{const{deps:e}=i;if(e.length){let r=0;for(let s=0;s{(y==="length"||y>=c)&&u.push(d)})}else switch(r!==void 0&&u.push(l.get(r)),e){case"add":isArray$9(i)?isIntegerKey(r)&&u.push(l.get("length")):(u.push(l.get(ITERATE_KEY)),isMap$3(i)&&u.push(l.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$9(i)||(u.push(l.get(ITERATE_KEY)),isMap$3(i)&&u.push(l.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap$3(i)&&u.push(l.get(ITERATE_KEY));break}if(u.length===1)u[0]&&triggerEffects(u[0]);else{const c=[];for(const d of u)d&&c.push(...d);triggerEffects(createDep(c))}}function triggerEffects(i,e){const r=isArray$9(i)?i:[...i];for(const s of r)s.computed&&triggerEffect(s);for(const s of r)s.computed||triggerEffect(s)}function triggerEffect(i,e){(i!==activeEffect||i.allowRecurse)&&(i.scheduler?i.scheduler():i.run())}function getDepFromReactive(i,e){var r;return(r=targetMap.get(i))===null||r===void 0?void 0:r.get(e)}const isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(isSymbol$1)),get$1=createGetter(),shallowGet=createGetter(!1,!0),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const i={};return["includes","indexOf","lastIndexOf"].forEach(e=>{i[e]=function(...r){const s=toRaw(this);for(let a=0,l=this.length;a{i[e]=function(...r){pauseTracking();const s=toRaw(this)[e].apply(this,r);return resetTracking(),s}}),i}function hasOwnProperty$e(i){const e=toRaw(this);return track(e,"has",i),e.hasOwnProperty(i)}function createGetter(i=!1,e=!1){return function(s,o,a){if(o==="__v_isReactive")return!i;if(o==="__v_isReadonly")return i;if(o==="__v_isShallow")return e;if(o==="__v_raw"&&a===(i?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(s))return s;const l=isArray$9(s);if(!i){if(l&&hasOwn$2(arrayInstrumentations,o))return Reflect.get(arrayInstrumentations,o,a);if(o==="hasOwnProperty")return hasOwnProperty$e}const u=Reflect.get(s,o,a);return(isSymbol$1(o)?builtInSymbols.has(o):isNonTrackableKeys(o))||(i||track(s,"get",o),e)?u:isRef(u)?l&&isIntegerKey(o)?u:u.value:isObject$5(u)?i?readonly(u):reactive(u):u}}const set$1=createSetter(),shallowSet=createSetter(!0);function createSetter(i=!1){return function(r,s,o,a){let l=r[s];if(isReadonly(l)&&isRef(l)&&!isRef(o))return!1;if(!i&&(!isShallow(o)&&!isReadonly(o)&&(l=toRaw(l),o=toRaw(o)),!isArray$9(r)&&isRef(l)&&!isRef(o)))return l.value=o,!0;const u=isArray$9(r)&&isIntegerKey(s)?Number(s)i,getProto$1=i=>Reflect.getPrototypeOf(i);function get$2(i,e,r=!1,s=!1){i=i.__v_raw;const o=toRaw(i),a=toRaw(e);r||(e!==a&&track(o,"get",e),track(o,"get",a));const{has:l}=getProto$1(o),u=s?toShallow:r?toReadonly:toReactive;if(l.call(o,e))return u(i.get(e));if(l.call(o,a))return u(i.get(a));i!==o&&i.get(e)}function has$4(i,e=!1){const r=this.__v_raw,s=toRaw(r),o=toRaw(i);return e||(i!==o&&track(s,"has",i),track(s,"has",o)),i===o?r.has(i):r.has(i)||r.has(o)}function size(i,e=!1){return i=i.__v_raw,!e&&track(toRaw(i),"iterate",ITERATE_KEY),Reflect.get(i,"size",i)}function add(i){i=toRaw(i);const e=toRaw(this);return getProto$1(e).has.call(e,i)||(e.add(i),trigger(e,"add",i,i)),this}function set(i,e){e=toRaw(e);const r=toRaw(this),{has:s,get:o}=getProto$1(r);let a=s.call(r,i);a||(i=toRaw(i),a=s.call(r,i));const l=o.call(r,i);return r.set(i,e),a?hasChanged(e,l)&&trigger(r,"set",i,e):trigger(r,"add",i,e),this}function deleteEntry(i){const e=toRaw(this),{has:r,get:s}=getProto$1(e);let o=r.call(e,i);o||(i=toRaw(i),o=r.call(e,i)),s&&s.call(e,i);const a=e.delete(i);return o&&trigger(e,"delete",i,void 0),a}function clear(){const i=toRaw(this),e=i.size!==0,r=i.clear();return e&&trigger(i,"clear",void 0,void 0),r}function createForEach(i,e){return function(s,o){const a=this,l=a.__v_raw,u=toRaw(l),c=e?toShallow:i?toReadonly:toReactive;return!i&&track(u,"iterate",ITERATE_KEY),l.forEach((d,y)=>s.call(o,c(d),c(y),a))}}function createIterableMethod(i,e,r){return function(...s){const o=this.__v_raw,a=toRaw(o),l=isMap$3(a),u=i==="entries"||i===Symbol.iterator&&l,c=i==="keys"&&l,d=o[i](...s),y=r?toShallow:e?toReadonly:toReactive;return!e&&track(a,"iterate",c?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:m,done:g}=d.next();return g?{value:m,done:g}:{value:u?[y(m[0]),y(m[1])]:y(m),done:g}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(i){return function(...e){return i==="delete"?!1:this}}function createInstrumentations(){const i={get(a){return get$2(this,a)},get size(){return size(this)},has:has$4,add,set,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},e={get(a){return get$2(this,a,!1,!0)},get size(){return size(this)},has:has$4,add,set,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},r={get(a){return get$2(this,a,!0)},get size(){return size(this,!0)},has(a){return has$4.call(this,a,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},s={get(a){return get$2(this,a,!0,!0)},get size(){return size(this,!0)},has(a){return has$4.call(this,a,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(a=>{i[a]=createIterableMethod(a,!1,!1),r[a]=createIterableMethod(a,!0,!1),e[a]=createIterableMethod(a,!1,!0),s[a]=createIterableMethod(a,!0,!0)}),[i,r,e,s]}const[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(i,e){const r=e?i?shallowReadonlyInstrumentations:shallowInstrumentations:i?readonlyInstrumentations:mutableInstrumentations;return(s,o,a)=>o==="__v_isReactive"?!i:o==="__v_isReadonly"?i:o==="__v_raw"?s:Reflect.get(hasOwn$2(r,o)&&o in s?r:s,o,a)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(i){return i.__v_skip||!Object.isExtensible(i)?0:targetTypeMap(toRawType(i))}function reactive(i){return isReadonly(i)?i:createReactiveObject(i,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(i){return createReactiveObject(i,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(i){return createReactiveObject(i,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(i,e,r,s,o){if(!isObject$5(i)||i.__v_raw&&!(e&&i.__v_isReactive))return i;const a=o.get(i);if(a)return a;const l=getTargetType(i);if(l===0)return i;const u=new Proxy(i,l===2?s:r);return o.set(i,u),u}function isReactive(i){return isReadonly(i)?isReactive(i.__v_raw):!!(i&&i.__v_isReactive)}function isReadonly(i){return!!(i&&i.__v_isReadonly)}function isShallow(i){return!!(i&&i.__v_isShallow)}function isProxy(i){return isReactive(i)||isReadonly(i)}function toRaw(i){const e=i&&i.__v_raw;return e?toRaw(e):i}function markRaw(i){return def(i,"__v_skip",!0),i}const toReactive=i=>isObject$5(i)?reactive(i):i,toReadonly=i=>isObject$5(i)?readonly(i):i;function trackRefValue(i){shouldTrack&&activeEffect&&(i=toRaw(i),trackEffects(i.dep||(i.dep=createDep())))}function triggerRefValue(i,e){i=toRaw(i);const r=i.dep;r&&triggerEffects(r)}function isRef(i){return!!(i&&i.__v_isRef===!0)}function ref(i){return createRef(i,!1)}function shallowRef(i){return createRef(i,!0)}function createRef(i,e){return isRef(i)?i:new RefImpl(i,e)}class RefImpl{constructor(e,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?e:toRaw(e),this._value=r?e:toReactive(e)}get value(){return trackRefValue(this),this._value}set value(e){const r=this.__v_isShallow||isShallow(e)||isReadonly(e);e=r?e:toRaw(e),hasChanged(e,this._rawValue)&&(this._rawValue=e,this._value=r?e:toReactive(e),triggerRefValue(this))}}function unref(i){return isRef(i)?i.value:i}const shallowUnwrapHandlers={get:(i,e,r)=>unref(Reflect.get(i,e,r)),set:(i,e,r,s)=>{const o=i[e];return isRef(o)&&!isRef(r)?(o.value=r,!0):Reflect.set(i,e,r,s)}};function proxyRefs(i){return isReactive(i)?i:new Proxy(i,shallowUnwrapHandlers)}function toRefs(i){const e=isArray$9(i)?new Array(i.length):{};for(const r in i)e[r]=toRef(i,r);return e}class ObjectRefImpl{constructor(e,r,s){this._object=e,this._key=r,this._defaultValue=s,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return getDepFromReactive(toRaw(this._object),this._key)}}function toRef(i,e,r){const s=i[e];return isRef(s)?s:new ObjectRefImpl(i,e,r)}var _a$1;class ComputedRefImpl{constructor(e,r,s,o){this._setter=r,this.dep=void 0,this.__v_isRef=!0,this[_a$1]=!1,this._dirty=!0,this.effect=new ReactiveEffect(e,()=>{this._dirty||(this._dirty=!0,triggerRefValue(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=s}get value(){const e=toRaw(this);return trackRefValue(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}_a$1="__v_isReadonly";function computed$1(i,e,r=!1){let s,o;const a=isFunction$6(i);return a?(s=i,o=NOOP):(s=i.get,o=i.set),new ComputedRefImpl(s,o,a||!o,r)}function warn(i,...e){}function callWithErrorHandling(i,e,r,s){let o;try{o=s?i(...s):i()}catch(a){handleError(a,e,r)}return o}function callWithAsyncErrorHandling(i,e,r,s){if(isFunction$6(i)){const a=callWithErrorHandling(i,e,r,s);return a&&isPromise$1(a)&&a.catch(l=>{handleError(l,e,r)}),a}const o=[];for(let a=0;a>>1;getId(queue$1[s])flushIndex&&queue$1.splice(e,1)}function queuePostFlushCb(i){isArray$9(i)?pendingPostFlushCbs.push(...i):(!activePostFlushCbs||!activePostFlushCbs.includes(i,i.allowRecurse?postFlushIndex+1:postFlushIndex))&&pendingPostFlushCbs.push(i),queueFlush()}function flushPreFlushCbs(i,e=isFlushing?flushIndex+1:0){for(;egetId(r)-getId(s)),postFlushIndex=0;postFlushIndexi.id==null?1/0:i.id,comparator=(i,e)=>{const r=getId(i)-getId(e);if(r===0){if(i.pre&&!e.pre)return-1;if(e.pre&&!i.pre)return 1}return r};function flushJobs(i){isFlushPending=!1,isFlushing=!0,queue$1.sort(comparator);const e=NOOP;try{for(flushIndex=0;flushIndexisString$2(v)?v.trim():v)),m&&(o=r.map(looseToNumber))}let u,c=s[u=toHandlerKey(e)]||s[u=toHandlerKey(camelize$2(e))];!c&&a&&(c=s[u=toHandlerKey(hyphenate(e))]),c&&callWithAsyncErrorHandling(c,i,6,o);const d=s[u+"Once"];if(d){if(!i.emitted)i.emitted={};else if(i.emitted[u])return;i.emitted[u]=!0,callWithAsyncErrorHandling(d,i,6,o)}}function normalizeEmitsOptions(i,e,r=!1){const s=e.emitsCache,o=s.get(i);if(o!==void 0)return o;const a=i.emits;let l={},u=!1;if(!isFunction$6(i)){const c=d=>{const y=normalizeEmitsOptions(d,e,!0);y&&(u=!0,extend$3(l,y))};!r&&e.mixins.length&&e.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}return!a&&!u?(isObject$5(i)&&s.set(i,null),null):(isArray$9(a)?a.forEach(c=>l[c]=null):extend$3(l,a),isObject$5(i)&&s.set(i,l),l)}function isEmitListener(i,e){return!i||!isOn(e)?!1:(e=e.slice(2).replace(/Once$/,""),hasOwn$2(i,e[0].toLowerCase()+e.slice(1))||hasOwn$2(i,hyphenate(e))||hasOwn$2(i,e))}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(i){const e=currentRenderingInstance;return currentRenderingInstance=i,currentScopeId=i&&i.type.__scopeId||null,e}function pushScopeId(i){currentScopeId=i}function popScopeId(){currentScopeId=null}function withCtx(i,e=currentRenderingInstance,r){if(!e||i._n)return i;const s=(...o)=>{s._d&&setBlockTracking(-1);const a=setCurrentRenderingInstance(e);let l;try{l=i(...o)}finally{setCurrentRenderingInstance(a),s._d&&setBlockTracking(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function markAttrsAccessed(){}function renderComponentRoot(i){const{type:e,vnode:r,proxy:s,withProxy:o,props:a,propsOptions:[l],slots:u,attrs:c,emit:d,render:y,renderCache:m,data:g,setupState:v,ctx:b,inheritAttrs:S}=i;let x,A;const E=setCurrentRenderingInstance(i);try{if(r.shapeFlag&4){const _=o||s;x=normalizeVNode(y.call(_,_,m,a,v,g,b)),A=c}else{const _=e;x=normalizeVNode(_.length>1?_(a,{attrs:c,slots:u,emit:d}):_(a,null)),A=e.props?c:getFunctionalFallthrough(c)}}catch(_){blockStack.length=0,handleError(_,i,1),x=createVNode(Comment)}let w=x;if(A&&S!==!1){const _=Object.keys(A),{shapeFlag:T}=w;_.length&&T&7&&(l&&_.some(isModelListener)&&(A=filterModelListeners(A,l)),w=cloneVNode(w,A))}return r.dirs&&(w=cloneVNode(w),w.dirs=w.dirs?w.dirs.concat(r.dirs):r.dirs),r.transition&&(w.transition=r.transition),x=w,setCurrentRenderingInstance(E),x}const getFunctionalFallthrough=i=>{let e;for(const r in i)(r==="class"||r==="style"||isOn(r))&&((e||(e={}))[r]=i[r]);return e},filterModelListeners=(i,e)=>{const r={};for(const s in i)(!isModelListener(s)||!(s.slice(9)in e))&&(r[s]=i[s]);return r};function shouldUpdateComponent(i,e,r){const{props:s,children:o,component:a}=i,{props:l,children:u,patchFlag:c}=e,d=a.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return s?hasPropsChanged(s,l,d):!!l;if(c&8){const y=e.dynamicProps;for(let m=0;mi.__isSuspense;function queueEffectWithSuspense(i,e){e&&e.pendingBranch?isArray$9(i)?e.effects.push(...i):e.effects.push(i):queuePostFlushCb(i)}function provide(i,e){if(currentInstance){let r=currentInstance.provides;const s=currentInstance.parent&¤tInstance.parent.provides;s===r&&(r=currentInstance.provides=Object.create(s)),r[i]=e}}function inject(i,e,r=!1){const s=currentInstance||currentRenderingInstance;if(s){const o=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(o&&i in o)return o[i];if(arguments.length>1)return r&&isFunction$6(e)?e.call(s.proxy):e}}function watchEffect(i,e){return doWatch(i,null,e)}const INITIAL_WATCHER_VALUE={};function watch(i,e,r){return doWatch(i,e,r)}function doWatch(i,e,{immediate:r,deep:s,flush:o,onTrack:a,onTrigger:l}=EMPTY_OBJ){const u=getCurrentScope()===(currentInstance==null?void 0:currentInstance.scope)?currentInstance:null;let c,d=!1,y=!1;if(isRef(i)?(c=()=>i.value,d=isShallow(i)):isReactive(i)?(c=()=>i,s=!0):isArray$9(i)?(y=!0,d=i.some(w=>isReactive(w)||isShallow(w)),c=()=>i.map(w=>{if(isRef(w))return w.value;if(isReactive(w))return traverse(w);if(isFunction$6(w))return callWithErrorHandling(w,u,2)})):isFunction$6(i)?e?c=()=>callWithErrorHandling(i,u,2):c=()=>{if(!(u&&u.isUnmounted))return m&&m(),callWithAsyncErrorHandling(i,u,3,[g])}:c=NOOP,e&&s){const w=c;c=()=>traverse(w())}let m,g=w=>{m=A.onStop=()=>{callWithErrorHandling(w,u,4)}},v;if(isInSSRComponentSetup)if(g=NOOP,e?r&&callWithAsyncErrorHandling(e,u,3,[c(),y?[]:void 0,g]):c(),o==="sync"){const w=useSSRContext();v=w.__watcherHandles||(w.__watcherHandles=[])}else return NOOP;let b=y?new Array(i.length).fill(INITIAL_WATCHER_VALUE):INITIAL_WATCHER_VALUE;const S=()=>{if(A.active)if(e){const w=A.run();(s||d||(y?w.some((_,T)=>hasChanged(_,b[T])):hasChanged(w,b)))&&(m&&m(),callWithAsyncErrorHandling(e,u,3,[w,b===INITIAL_WATCHER_VALUE?void 0:y&&b[0]===INITIAL_WATCHER_VALUE?[]:b,g]),b=w)}else A.run()};S.allowRecurse=!!e;let x;o==="sync"?x=S:o==="post"?x=()=>queuePostRenderEffect(S,u&&u.suspense):(S.pre=!0,u&&(S.id=u.uid),x=()=>queueJob(S));const A=new ReactiveEffect(c,x);e?r?S():b=A.run():o==="post"?queuePostRenderEffect(A.run.bind(A),u&&u.suspense):A.run();const E=()=>{A.stop(),u&&u.scope&&remove$7(u.scope.effects,A)};return v&&v.push(E),E}function instanceWatch(i,e,r){const s=this.proxy,o=isString$2(i)?i.includes(".")?createPathGetter(s,i):()=>s[i]:i.bind(s,s);let a;isFunction$6(e)?a=e:(a=e.handler,r=e);const l=currentInstance;setCurrentInstance(this);const u=doWatch(o,a.bind(s),r);return l?setCurrentInstance(l):unsetCurrentInstance(),u}function createPathGetter(i,e){const r=e.split(".");return()=>{let s=i;for(let o=0;o{traverse(r,e)});else if(isPlainObject$3(i))for(const r in i)traverse(i[r],e);return i}function useTransitionState(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return onMounted(()=>{i.isMounted=!0}),onBeforeUnmount(()=>{i.isUnmounting=!0}),i}const TransitionHookValidator=[Function,Array],BaseTransitionImpl={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},setup(i,{slots:e}){const r=getCurrentInstance(),s=useTransitionState();let o;return()=>{const a=e.default&&getTransitionRawChildren(e.default(),!0);if(!a||!a.length)return;let l=a[0];if(a.length>1){for(const S of a)if(S.type!==Comment){l=S;break}}const u=toRaw(i),{mode:c}=u;if(s.isLeaving)return emptyPlaceholder(l);const d=getKeepAliveChild(l);if(!d)return emptyPlaceholder(l);const y=resolveTransitionHooks(d,u,s,r);setTransitionHooks(d,y);const m=r.subTree,g=m&&getKeepAliveChild(m);let v=!1;const{getTransitionKey:b}=d.type;if(b){const S=b();o===void 0?o=S:S!==o&&(o=S,v=!0)}if(g&&g.type!==Comment&&(!isSameVNodeType(d,g)||v)){const S=resolveTransitionHooks(g,u,s,r);if(setTransitionHooks(g,S),c==="out-in")return s.isLeaving=!0,S.afterLeave=()=>{s.isLeaving=!1,r.update.active!==!1&&r.update()},emptyPlaceholder(l);c==="in-out"&&d.type!==Comment&&(S.delayLeave=(x,A,E)=>{const w=getLeavingNodesForType(s,g);w[String(g.key)]=g,x._leaveCb=()=>{A(),x._leaveCb=void 0,delete y.delayedLeave},y.delayedLeave=E})}return l}}},BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(i,e){const{leavingVNodes:r}=i;let s=r.get(e.type);return s||(s=Object.create(null),r.set(e.type,s)),s}function resolveTransitionHooks(i,e,r,s){const{appear:o,mode:a,persisted:l=!1,onBeforeEnter:u,onEnter:c,onAfterEnter:d,onEnterCancelled:y,onBeforeLeave:m,onLeave:g,onAfterLeave:v,onLeaveCancelled:b,onBeforeAppear:S,onAppear:x,onAfterAppear:A,onAppearCancelled:E}=e,w=String(i.key),_=getLeavingNodesForType(r,i),T=(k,M)=>{k&&callWithAsyncErrorHandling(k,s,9,M)},C=(k,M)=>{const R=M[1];T(k,M),isArray$9(k)?k.every(H=>H.length<=1)&&R():k.length<=1&&R()},P={mode:a,persisted:l,beforeEnter(k){let M=u;if(!r.isMounted)if(o)M=S||u;else return;k._leaveCb&&k._leaveCb(!0);const R=_[w];R&&isSameVNodeType(i,R)&&R.el._leaveCb&&R.el._leaveCb(),T(M,[k])},enter(k){let M=c,R=d,H=y;if(!r.isMounted)if(o)M=x||c,R=A||d,H=E||y;else return;let B=!1;const F=k._enterCb=I=>{B||(B=!0,I?T(H,[k]):T(R,[k]),P.delayedLeave&&P.delayedLeave(),k._enterCb=void 0)};M?C(M,[k,F]):F()},leave(k,M){const R=String(i.key);if(k._enterCb&&k._enterCb(!0),r.isUnmounting)return M();T(m,[k]);let H=!1;const B=k._leaveCb=F=>{H||(H=!0,M(),F?T(b,[k]):T(v,[k]),k._leaveCb=void 0,_[R]===i&&delete _[R])};_[R]=i,g?C(g,[k,B]):B()},clone(k){return resolveTransitionHooks(k,e,r,s)}};return P}function emptyPlaceholder(i){if(isKeepAlive(i))return i=cloneVNode(i),i.children=null,i}function getKeepAliveChild(i){return isKeepAlive(i)?i.children?i.children[0]:void 0:i}function setTransitionHooks(i,e){i.shapeFlag&6&&i.component?setTransitionHooks(i.component.subTree,e):i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}function getTransitionRawChildren(i,e=!1,r){let s=[],o=0;for(let a=0;a1)for(let a=0;a!!i.type.__asyncLoader;function defineAsyncComponent(i){isFunction$6(i)&&(i={loader:i});const{loader:e,loadingComponent:r,errorComponent:s,delay:o=200,timeout:a,suspensible:l=!0,onError:u}=i;let c=null,d,y=0;const m=()=>(y++,c=null,g()),g=()=>{let v;return c||(v=c=e().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),u)return new Promise((S,x)=>{u(b,()=>S(m()),()=>x(b),y+1)});throw b}).then(b=>v!==c&&c?c:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),d=b,b)))};return defineComponent({name:"AsyncComponentWrapper",__asyncLoader:g,get __asyncResolved(){return d},setup(){const v=currentInstance;if(d)return()=>createInnerComp(d,v);const b=E=>{c=null,handleError(E,v,13,!s)};if(l&&v.suspense||isInSSRComponentSetup)return g().then(E=>()=>createInnerComp(E,v)).catch(E=>(b(E),()=>s?createVNode(s,{error:E}):null));const S=ref(!1),x=ref(),A=ref(!!o);return o&&setTimeout(()=>{A.value=!1},o),a!=null&&setTimeout(()=>{if(!S.value&&!x.value){const E=new Error(`Async component timed out after ${a}ms.`);b(E),x.value=E}},a),g().then(()=>{S.value=!0,v.parent&&isKeepAlive(v.parent.vnode)&&queueJob(v.parent.update)}).catch(E=>{b(E),x.value=E}),()=>{if(S.value&&d)return createInnerComp(d,v);if(x.value&&s)return createVNode(s,{error:x.value});if(r&&!A.value)return createVNode(r)}}})}function createInnerComp(i,e){const{ref:r,props:s,children:o,ce:a}=e.vnode,l=createVNode(i,s,o);return l.ref=r,l.ce=a,delete e.vnode.ce,l}const isKeepAlive=i=>i.type.__isKeepAlive;function onActivated(i,e){registerKeepAliveHook(i,"a",e)}function onDeactivated(i,e){registerKeepAliveHook(i,"da",e)}function registerKeepAliveHook(i,e,r=currentInstance){const s=i.__wdc||(i.__wdc=()=>{let o=r;for(;o;){if(o.isDeactivated)return;o=o.parent}return i()});if(injectHook(e,s,r),r){let o=r.parent;for(;o&&o.parent;)isKeepAlive(o.parent.vnode)&&injectToKeepAliveRoot(s,e,r,o),o=o.parent}}function injectToKeepAliveRoot(i,e,r,s){const o=injectHook(e,i,s,!0);onUnmounted(()=>{remove$7(s[e],o)},r)}function injectHook(i,e,r=currentInstance,s=!1){if(r){const o=r[i]||(r[i]=[]),a=e.__weh||(e.__weh=(...l)=>{if(r.isUnmounted)return;pauseTracking(),setCurrentInstance(r);const u=callWithAsyncErrorHandling(e,r,i,l);return unsetCurrentInstance(),resetTracking(),u});return s?o.unshift(a):o.push(a),a}}const createHook=i=>(e,r=currentInstance)=>(!isInSSRComponentSetup||i==="sp")&&injectHook(i,(...s)=>e(...s),r),onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(i,e=currentInstance){injectHook("ec",i,e)}function withDirectives(i,e){const r=currentRenderingInstance;if(r===null)return i;const s=getExposeProxy(r)||r.proxy,o=i.dirs||(i.dirs=[]);for(let a=0;ae(l,u,void 0,a&&a[u]));else{const l=Object.keys(i);o=new Array(l.length);for(let u=0,c=l.length;uisVNode(e)?!(e.type===Comment||e.type===Fragment&&!ensureValidVNode(e.children)):!0)?i:null}const getPublicInstance=i=>i?isStatefulComponent(i)?getExposeProxy(i)||i.proxy:getPublicInstance(i.parent):null,publicPropertiesMap=extend$3(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>getPublicInstance(i.parent),$root:i=>getPublicInstance(i.root),$emit:i=>i.emit,$options:i=>resolveMergedOptions(i),$forceUpdate:i=>i.f||(i.f=()=>queueJob(i.update)),$nextTick:i=>i.n||(i.n=nextTick.bind(i.proxy)),$watch:i=>instanceWatch.bind(i)}),hasSetupBinding=(i,e)=>i!==EMPTY_OBJ&&!i.__isScriptSetup&&hasOwn$2(i,e),PublicInstanceProxyHandlers={get({_:i},e){const{ctx:r,setupState:s,data:o,props:a,accessCache:l,type:u,appContext:c}=i;let d;if(e[0]!=="$"){const v=l[e];if(v!==void 0)switch(v){case 1:return s[e];case 2:return o[e];case 4:return r[e];case 3:return a[e]}else{if(hasSetupBinding(s,e))return l[e]=1,s[e];if(o!==EMPTY_OBJ&&hasOwn$2(o,e))return l[e]=2,o[e];if((d=i.propsOptions[0])&&hasOwn$2(d,e))return l[e]=3,a[e];if(r!==EMPTY_OBJ&&hasOwn$2(r,e))return l[e]=4,r[e];shouldCacheAccess&&(l[e]=0)}}const y=publicPropertiesMap[e];let m,g;if(y)return e==="$attrs"&&track(i,"get",e),y(i);if((m=u.__cssModules)&&(m=m[e]))return m;if(r!==EMPTY_OBJ&&hasOwn$2(r,e))return l[e]=4,r[e];if(g=c.config.globalProperties,hasOwn$2(g,e))return g[e]},set({_:i},e,r){const{data:s,setupState:o,ctx:a}=i;return hasSetupBinding(o,e)?(o[e]=r,!0):s!==EMPTY_OBJ&&hasOwn$2(s,e)?(s[e]=r,!0):hasOwn$2(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(a[e]=r,!0)},has({_:{data:i,setupState:e,accessCache:r,ctx:s,appContext:o,propsOptions:a}},l){let u;return!!r[l]||i!==EMPTY_OBJ&&hasOwn$2(i,l)||hasSetupBinding(e,l)||(u=a[0])&&hasOwn$2(u,l)||hasOwn$2(s,l)||hasOwn$2(publicPropertiesMap,l)||hasOwn$2(o.config.globalProperties,l)},defineProperty(i,e,r){return r.get!=null?i._.accessCache[e]=0:hasOwn$2(r,"value")&&this.set(i,e,r.value,null),Reflect.defineProperty(i,e,r)}};let shouldCacheAccess=!0;function applyOptions(i){const e=resolveMergedOptions(i),r=i.proxy,s=i.ctx;shouldCacheAccess=!1,e.beforeCreate&&callHook$1(e.beforeCreate,i,"bc");const{data:o,computed:a,methods:l,watch:u,provide:c,inject:d,created:y,beforeMount:m,mounted:g,beforeUpdate:v,updated:b,activated:S,deactivated:x,beforeDestroy:A,beforeUnmount:E,destroyed:w,unmounted:_,render:T,renderTracked:C,renderTriggered:P,errorCaptured:k,serverPrefetch:M,expose:R,inheritAttrs:H,components:B,directives:F,filters:I}=e;if(d&&resolveInjections(d,s,null,i.appContext.config.unwrapInjectedRef),l)for(const $ in l){const N=l[$];isFunction$6(N)&&(s[$]=N.bind(r))}if(o){const $=o.call(r,r);isObject$5($)&&(i.data=reactive($))}if(shouldCacheAccess=!0,a)for(const $ in a){const N=a[$],O=isFunction$6(N)?N.bind(r,r):isFunction$6(N.get)?N.get.bind(r,r):NOOP,Q=!isFunction$6(N)&&isFunction$6(N.set)?N.set.bind(r):NOOP,z=computed({get:O,set:Q});Object.defineProperty(s,$,{enumerable:!0,configurable:!0,get:()=>z.value,set:W=>z.value=W})}if(u)for(const $ in u)createWatcher(u[$],s,r,$);if(c){const $=isFunction$6(c)?c.call(r):c;Reflect.ownKeys($).forEach(N=>{provide(N,$[N])})}y&&callHook$1(y,i,"c");function D($,N){isArray$9(N)?N.forEach(O=>$(O.bind(r))):N&&$(N.bind(r))}if(D(onBeforeMount,m),D(onMounted,g),D(onBeforeUpdate,v),D(onUpdated,b),D(onActivated,S),D(onDeactivated,x),D(onErrorCaptured,k),D(onRenderTracked,C),D(onRenderTriggered,P),D(onBeforeUnmount,E),D(onUnmounted,_),D(onServerPrefetch,M),isArray$9(R))if(R.length){const $=i.exposed||(i.exposed={});R.forEach(N=>{Object.defineProperty($,N,{get:()=>r[N],set:O=>r[N]=O})})}else i.exposed||(i.exposed={});T&&i.render===NOOP&&(i.render=T),H!=null&&(i.inheritAttrs=H),B&&(i.components=B),F&&(i.directives=F)}function resolveInjections(i,e,r=NOOP,s=!1){isArray$9(i)&&(i=normalizeInject(i));for(const o in i){const a=i[o];let l;isObject$5(a)?"default"in a?l=inject(a.from||o,a.default,!0):l=inject(a.from||o):l=inject(a),isRef(l)&&s?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:u=>l.value=u}):e[o]=l}}function callHook$1(i,e,r){callWithAsyncErrorHandling(isArray$9(i)?i.map(s=>s.bind(e.proxy)):i.bind(e.proxy),e,r)}function createWatcher(i,e,r,s){const o=s.includes(".")?createPathGetter(r,s):()=>r[s];if(isString$2(i)){const a=e[i];isFunction$6(a)&&watch(o,a)}else if(isFunction$6(i))watch(o,i.bind(r));else if(isObject$5(i))if(isArray$9(i))i.forEach(a=>createWatcher(a,e,r,s));else{const a=isFunction$6(i.handler)?i.handler.bind(r):e[i.handler];isFunction$6(a)&&watch(o,a,i)}}function resolveMergedOptions(i){const e=i.type,{mixins:r,extends:s}=e,{mixins:o,optionsCache:a,config:{optionMergeStrategies:l}}=i.appContext,u=a.get(e);let c;return u?c=u:!o.length&&!r&&!s?c=e:(c={},o.length&&o.forEach(d=>mergeOptions$1(c,d,l,!0)),mergeOptions$1(c,e,l)),isObject$5(e)&&a.set(e,c),c}function mergeOptions$1(i,e,r,s=!1){const{mixins:o,extends:a}=e;a&&mergeOptions$1(i,a,r,!0),o&&o.forEach(l=>mergeOptions$1(i,l,r,!0));for(const l in e)if(!(s&&l==="expose")){const u=internalOptionMergeStrats[l]||r&&r[l];i[l]=u?u(i[l],e[l]):e[l]}return i}const internalOptionMergeStrats={data:mergeDataFn,props:mergeObjectOptions,emits:mergeObjectOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(i,e){return e?i?function(){return extend$3(isFunction$6(i)?i.call(this,this):i,isFunction$6(e)?e.call(this,this):e)}:e:i}function mergeInject(i,e){return mergeObjectOptions(normalizeInject(i),normalizeInject(e))}function normalizeInject(i){if(isArray$9(i)){const e={};for(let r=0;r0)&&!(l&16)){if(l&8){const y=i.vnode.dynamicProps;for(let m=0;m{c=!0;const[g,v]=normalizePropsOptions(m,e,!0);extend$3(l,g),v&&u.push(...v)};!r&&e.mixins.length&&e.mixins.forEach(y),i.extends&&y(i.extends),i.mixins&&i.mixins.forEach(y)}if(!a&&!c)return isObject$5(i)&&s.set(i,EMPTY_ARR),EMPTY_ARR;if(isArray$9(a))for(let y=0;y-1,v[1]=S<0||b-1||hasOwn$2(v,"default"))&&u.push(m)}}}const d=[l,u];return isObject$5(i)&&s.set(i,d),d}function validatePropName(i){return i[0]!=="$"}function getType(i){const e=i&&i.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:i===null?"null":""}function isSameType(i,e){return getType(i)===getType(e)}function getTypeIndex(i,e){return isArray$9(e)?e.findIndex(r=>isSameType(r,i)):isFunction$6(e)&&isSameType(e,i)?0:-1}const isInternalKey=i=>i[0]==="_"||i==="$stable",normalizeSlotValue=i=>isArray$9(i)?i.map(normalizeVNode):[normalizeVNode(i)],normalizeSlot$1=(i,e,r)=>{if(e._n)return e;const s=withCtx((...o)=>normalizeSlotValue(e(...o)),r);return s._c=!1,s},normalizeObjectSlots=(i,e,r)=>{const s=i._ctx;for(const o in i){if(isInternalKey(o))continue;const a=i[o];if(isFunction$6(a))e[o]=normalizeSlot$1(o,a,s);else if(a!=null){const l=normalizeSlotValue(a);e[o]=()=>l}}},normalizeVNodeSlots=(i,e)=>{const r=normalizeSlotValue(e);i.slots.default=()=>r},initSlots=(i,e)=>{if(i.vnode.shapeFlag&32){const r=e._;r?(i.slots=toRaw(e),def(e,"_",r)):normalizeObjectSlots(e,i.slots={})}else i.slots={},e&&normalizeVNodeSlots(i,e);def(i.slots,InternalObjectKey,1)},updateSlots=(i,e,r)=>{const{vnode:s,slots:o}=i;let a=!0,l=EMPTY_OBJ;if(s.shapeFlag&32){const u=e._;u?r&&u===1?a=!1:(extend$3(o,e),!r&&u===1&&delete o._):(a=!e.$stable,normalizeObjectSlots(e,o)),l=e}else e&&(normalizeVNodeSlots(i,e),l={default:1});if(a)for(const u in o)!isInternalKey(u)&&!(u in l)&&delete o[u]};function createAppContext(){return{app:null,config:{isNativeTag:NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let uid$1=0;function createAppAPI(i,e){return function(s,o=null){isFunction$6(s)||(s=Object.assign({},s)),o!=null&&!isObject$5(o)&&(o=null);const a=createAppContext(),l=new Set;let u=!1;const c=a.app={_uid:uid$1++,_component:s,_props:o,_container:null,_context:a,_instance:null,version,get config(){return a.config},set config(d){},use(d,...y){return l.has(d)||(d&&isFunction$6(d.install)?(l.add(d),d.install(c,...y)):isFunction$6(d)&&(l.add(d),d(c,...y))),c},mixin(d){return a.mixins.includes(d)||a.mixins.push(d),c},component(d,y){return y?(a.components[d]=y,c):a.components[d]},directive(d,y){return y?(a.directives[d]=y,c):a.directives[d]},mount(d,y,m){if(!u){const g=createVNode(s,o);return g.appContext=a,y&&e?e(g,d):i(g,d,m),u=!0,c._container=d,d.__vue_app__=c,getExposeProxy(g.component)||g.component.proxy}},unmount(){u&&(i(null,c._container),delete c._container.__vue_app__)},provide(d,y){return a.provides[d]=y,c}};return c}}function setRef(i,e,r,s,o=!1){if(isArray$9(i)){i.forEach((g,v)=>setRef(g,e&&(isArray$9(e)?e[v]:e),r,s,o));return}if(isAsyncWrapper(s)&&!o)return;const a=s.shapeFlag&4?getExposeProxy(s.component)||s.component.proxy:s.el,l=o?null:a,{i:u,r:c}=i,d=e&&e.r,y=u.refs===EMPTY_OBJ?u.refs={}:u.refs,m=u.setupState;if(d!=null&&d!==c&&(isString$2(d)?(y[d]=null,hasOwn$2(m,d)&&(m[d]=null)):isRef(d)&&(d.value=null)),isFunction$6(c))callWithErrorHandling(c,u,12,[l,y]);else{const g=isString$2(c),v=isRef(c);if(g||v){const b=()=>{if(i.f){const S=g?hasOwn$2(m,c)?m[c]:y[c]:c.value;o?isArray$9(S)&&remove$7(S,a):isArray$9(S)?S.includes(a)||S.push(a):g?(y[c]=[a],hasOwn$2(m,c)&&(m[c]=y[c])):(c.value=[a],i.k&&(y[i.k]=c.value))}else g?(y[c]=l,hasOwn$2(m,c)&&(m[c]=l)):v&&(c.value=l,i.k&&(y[i.k]=l))};l?(b.id=-1,queuePostRenderEffect(b,r)):b()}}}const queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(i){return baseCreateRenderer(i)}function baseCreateRenderer(i,e){const r=getGlobalThis();r.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:l,createText:u,createComment:c,setText:d,setElementText:y,parentNode:m,nextSibling:g,setScopeId:v=NOOP,insertStaticContent:b}=i,S=(J,se,V,pe=null,ce=null,K=null,Z=!1,he=null,Ce=!!se.dynamicChildren)=>{if(J===se)return;J&&!isSameVNodeType(J,se)&&(pe=ue(J),W(J,ce,K,!0),J=null),se.patchFlag===-2&&(Ce=!1,se.dynamicChildren=null);const{type:Ae,ref:_e,shapeFlag:ke}=se;switch(Ae){case Text:x(J,se,V,pe);break;case Comment:A(J,se,V,pe);break;case Static:J==null&&E(se,V,pe,Z);break;case Fragment:B(J,se,V,pe,ce,K,Z,he,Ce);break;default:ke&1?T(J,se,V,pe,ce,K,Z,he,Ce):ke&6?F(J,se,V,pe,ce,K,Z,he,Ce):(ke&64||ke&128)&&Ae.process(J,se,V,pe,ce,K,Z,he,Ce,Se)}_e!=null&&ce&&setRef(_e,J&&J.ref,K,se||J,!se)},x=(J,se,V,pe)=>{if(J==null)s(se.el=u(se.children),V,pe);else{const ce=se.el=J.el;se.children!==J.children&&d(ce,se.children)}},A=(J,se,V,pe)=>{J==null?s(se.el=c(se.children||""),V,pe):se.el=J.el},E=(J,se,V,pe)=>{[J.el,J.anchor]=b(J.children,se,V,pe,J.el,J.anchor)},w=({el:J,anchor:se},V,pe)=>{let ce;for(;J&&J!==se;)ce=g(J),s(J,V,pe),J=ce;s(se,V,pe)},_=({el:J,anchor:se})=>{let V;for(;J&&J!==se;)V=g(J),o(J),J=V;o(se)},T=(J,se,V,pe,ce,K,Z,he,Ce)=>{Z=Z||se.type==="svg",J==null?C(se,V,pe,ce,K,Z,he,Ce):M(J,se,ce,K,Z,he,Ce)},C=(J,se,V,pe,ce,K,Z,he)=>{let Ce,Ae;const{type:_e,props:ke,shapeFlag:Re,transition:Ee,dirs:le}=J;if(Ce=J.el=l(J.type,K,ke&&ke.is,ke),Re&8?y(Ce,J.children):Re&16&&k(J.children,Ce,null,pe,ce,K&&_e!=="foreignObject",Z,he),le&&invokeDirectiveHook(J,null,pe,"created"),P(Ce,J,J.scopeId,Z,pe),ke){for(const de in ke)de!=="value"&&!isReservedProp(de)&&a(Ce,de,null,ke[de],K,J.children,pe,ce,re);"value"in ke&&a(Ce,"value",null,ke.value),(Ae=ke.onVnodeBeforeMount)&&invokeVNodeHook(Ae,pe,J)}le&&invokeDirectiveHook(J,null,pe,"beforeMount");const we=(!ce||ce&&!ce.pendingBranch)&&Ee&&!Ee.persisted;we&&Ee.beforeEnter(Ce),s(Ce,se,V),((Ae=ke&&ke.onVnodeMounted)||we||le)&&queuePostRenderEffect(()=>{Ae&&invokeVNodeHook(Ae,pe,J),we&&Ee.enter(Ce),le&&invokeDirectiveHook(J,null,pe,"mounted")},ce)},P=(J,se,V,pe,ce)=>{if(V&&v(J,V),pe)for(let K=0;K{for(let Ae=Ce;Ae{const he=se.el=J.el;let{patchFlag:Ce,dynamicChildren:Ae,dirs:_e}=se;Ce|=J.patchFlag&16;const ke=J.props||EMPTY_OBJ,Re=se.props||EMPTY_OBJ;let Ee;V&&toggleRecurse(V,!1),(Ee=Re.onVnodeBeforeUpdate)&&invokeVNodeHook(Ee,V,se,J),_e&&invokeDirectiveHook(se,J,V,"beforeUpdate"),V&&toggleRecurse(V,!0);const le=ce&&se.type!=="foreignObject";if(Ae?R(J.dynamicChildren,Ae,he,V,pe,le,K):Z||N(J,se,he,null,V,pe,le,K,!1),Ce>0){if(Ce&16)H(he,se,ke,Re,V,pe,ce);else if(Ce&2&&ke.class!==Re.class&&a(he,"class",null,Re.class,ce),Ce&4&&a(he,"style",ke.style,Re.style,ce),Ce&8){const we=se.dynamicProps;for(let de=0;de{Ee&&invokeVNodeHook(Ee,V,se,J),_e&&invokeDirectiveHook(se,J,V,"updated")},pe)},R=(J,se,V,pe,ce,K,Z)=>{for(let he=0;he{if(V!==pe){if(V!==EMPTY_OBJ)for(const he in V)!isReservedProp(he)&&!(he in pe)&&a(J,he,V[he],null,Z,se.children,ce,K,re);for(const he in pe){if(isReservedProp(he))continue;const Ce=pe[he],Ae=V[he];Ce!==Ae&&he!=="value"&&a(J,he,Ae,Ce,Z,se.children,ce,K,re)}"value"in pe&&a(J,"value",V.value,pe.value)}},B=(J,se,V,pe,ce,K,Z,he,Ce)=>{const Ae=se.el=J?J.el:u(""),_e=se.anchor=J?J.anchor:u("");let{patchFlag:ke,dynamicChildren:Re,slotScopeIds:Ee}=se;Ee&&(he=he?he.concat(Ee):Ee),J==null?(s(Ae,V,pe),s(_e,V,pe),k(se.children,V,_e,ce,K,Z,he,Ce)):ke>0&&ke&64&&Re&&J.dynamicChildren?(R(J.dynamicChildren,Re,V,ce,K,Z,he),(se.key!=null||ce&&se===ce.subTree)&&traverseStaticChildren(J,se,!0)):N(J,se,V,_e,ce,K,Z,he,Ce)},F=(J,se,V,pe,ce,K,Z,he,Ce)=>{se.slotScopeIds=he,J==null?se.shapeFlag&512?ce.ctx.activate(se,V,pe,Z,Ce):I(se,V,pe,ce,K,Z,Ce):U(J,se,Ce)},I=(J,se,V,pe,ce,K,Z)=>{const he=J.component=createComponentInstance(J,pe,ce);if(isKeepAlive(J)&&(he.ctx.renderer=Se),setupComponent(he),he.asyncDep){if(ce&&ce.registerDep(he,D),!J.el){const Ce=he.subTree=createVNode(Comment);A(null,Ce,se,V)}return}D(he,J,se,V,ce,K,Z)},U=(J,se,V)=>{const pe=se.component=J.component;if(shouldUpdateComponent(J,se,V))if(pe.asyncDep&&!pe.asyncResolved){$(pe,se,V);return}else pe.next=se,invalidateJob(pe.update),pe.update();else se.el=J.el,pe.vnode=se},D=(J,se,V,pe,ce,K,Z)=>{const he=()=>{if(J.isMounted){let{next:_e,bu:ke,u:Re,parent:Ee,vnode:le}=J,we=_e,de;toggleRecurse(J,!1),_e?(_e.el=le.el,$(J,_e,Z)):_e=le,ke&&invokeArrayFns(ke),(de=_e.props&&_e.props.onVnodeBeforeUpdate)&&invokeVNodeHook(de,Ee,_e,le),toggleRecurse(J,!0);const De=renderComponentRoot(J),Ve=J.subTree;J.subTree=De,S(Ve,De,m(Ve.el),ue(Ve),J,ce,K),_e.el=De.el,we===null&&updateHOCHostEl(J,De.el),Re&&queuePostRenderEffect(Re,ce),(de=_e.props&&_e.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(de,Ee,_e,le),ce)}else{let _e;const{el:ke,props:Re}=se,{bm:Ee,m:le,parent:we}=J,de=isAsyncWrapper(se);if(toggleRecurse(J,!1),Ee&&invokeArrayFns(Ee),!de&&(_e=Re&&Re.onVnodeBeforeMount)&&invokeVNodeHook(_e,we,se),toggleRecurse(J,!0),ke&&Ie){const De=()=>{J.subTree=renderComponentRoot(J),Ie(ke,J.subTree,J,ce,null)};de?se.type.__asyncLoader().then(()=>!J.isUnmounted&&De()):De()}else{const De=J.subTree=renderComponentRoot(J);S(null,De,V,pe,J,ce,K),se.el=De.el}if(le&&queuePostRenderEffect(le,ce),!de&&(_e=Re&&Re.onVnodeMounted)){const De=se;queuePostRenderEffect(()=>invokeVNodeHook(_e,we,De),ce)}(se.shapeFlag&256||we&&isAsyncWrapper(we.vnode)&&we.vnode.shapeFlag&256)&&J.a&&queuePostRenderEffect(J.a,ce),J.isMounted=!0,se=V=pe=null}},Ce=J.effect=new ReactiveEffect(he,()=>queueJob(Ae),J.scope),Ae=J.update=()=>Ce.run();Ae.id=J.uid,toggleRecurse(J,!0),Ae()},$=(J,se,V)=>{se.component=J;const pe=J.vnode.props;J.vnode=se,J.next=null,updateProps(J,se.props,pe,V),updateSlots(J,se.children,V),pauseTracking(),flushPreFlushCbs(),resetTracking()},N=(J,se,V,pe,ce,K,Z,he,Ce=!1)=>{const Ae=J&&J.children,_e=J?J.shapeFlag:0,ke=se.children,{patchFlag:Re,shapeFlag:Ee}=se;if(Re>0){if(Re&128){Q(Ae,ke,V,pe,ce,K,Z,he,Ce);return}else if(Re&256){O(Ae,ke,V,pe,ce,K,Z,he,Ce);return}}Ee&8?(_e&16&&re(Ae,ce,K),ke!==Ae&&y(V,ke)):_e&16?Ee&16?Q(Ae,ke,V,pe,ce,K,Z,he,Ce):re(Ae,ce,K,!0):(_e&8&&y(V,""),Ee&16&&k(ke,V,pe,ce,K,Z,he,Ce))},O=(J,se,V,pe,ce,K,Z,he,Ce)=>{J=J||EMPTY_ARR,se=se||EMPTY_ARR;const Ae=J.length,_e=se.length,ke=Math.min(Ae,_e);let Re;for(Re=0;Re_e?re(J,ce,K,!0,!1,ke):k(se,V,pe,ce,K,Z,he,Ce,ke)},Q=(J,se,V,pe,ce,K,Z,he,Ce)=>{let Ae=0;const _e=se.length;let ke=J.length-1,Re=_e-1;for(;Ae<=ke&&Ae<=Re;){const Ee=J[Ae],le=se[Ae]=Ce?cloneIfMounted(se[Ae]):normalizeVNode(se[Ae]);if(isSameVNodeType(Ee,le))S(Ee,le,V,null,ce,K,Z,he,Ce);else break;Ae++}for(;Ae<=ke&&Ae<=Re;){const Ee=J[ke],le=se[Re]=Ce?cloneIfMounted(se[Re]):normalizeVNode(se[Re]);if(isSameVNodeType(Ee,le))S(Ee,le,V,null,ce,K,Z,he,Ce);else break;ke--,Re--}if(Ae>ke){if(Ae<=Re){const Ee=Re+1,le=Ee<_e?se[Ee].el:pe;for(;Ae<=Re;)S(null,se[Ae]=Ce?cloneIfMounted(se[Ae]):normalizeVNode(se[Ae]),V,le,ce,K,Z,he,Ce),Ae++}}else if(Ae>Re)for(;Ae<=ke;)W(J[Ae],ce,K,!0),Ae++;else{const Ee=Ae,le=Ae,we=new Map;for(Ae=le;Ae<=Re;Ae++){const Ze=se[Ae]=Ce?cloneIfMounted(se[Ae]):normalizeVNode(se[Ae]);Ze.key!=null&&we.set(Ze.key,Ae)}let de,De=0;const Ve=Re-le+1;let $e=!1,Je=0;const Ye=new Array(Ve);for(Ae=0;Ae=Ve){W(Ze,ce,K,!0);continue}let ot;if(Ze.key!=null)ot=we.get(Ze.key);else for(de=le;de<=Re;de++)if(Ye[de-le]===0&&isSameVNodeType(Ze,se[de])){ot=de;break}ot===void 0?W(Ze,ce,K,!0):(Ye[ot-le]=Ae+1,ot>=Je?Je=ot:$e=!0,S(Ze,se[ot],V,null,ce,K,Z,he,Ce),De++)}const tt=$e?getSequence(Ye):EMPTY_ARR;for(de=tt.length-1,Ae=Ve-1;Ae>=0;Ae--){const Ze=le+Ae,ot=se[Ze],pt=Ze+1<_e?se[Ze+1].el:pe;Ye[Ae]===0?S(null,ot,V,pt,ce,K,Z,he,Ce):$e&&(de<0||Ae!==tt[de]?z(ot,V,pt,2):de--)}}},z=(J,se,V,pe,ce=null)=>{const{el:K,type:Z,transition:he,children:Ce,shapeFlag:Ae}=J;if(Ae&6){z(J.component.subTree,se,V,pe);return}if(Ae&128){J.suspense.move(se,V,pe);return}if(Ae&64){Z.move(J,se,V,Se);return}if(Z===Fragment){s(K,se,V);for(let ke=0;kehe.enter(K),ce);else{const{leave:ke,delayLeave:Re,afterLeave:Ee}=he,le=()=>s(K,se,V),we=()=>{ke(K,()=>{le(),Ee&&Ee()})};Re?Re(K,le,we):we()}else s(K,se,V)},W=(J,se,V,pe=!1,ce=!1)=>{const{type:K,props:Z,ref:he,children:Ce,dynamicChildren:Ae,shapeFlag:_e,patchFlag:ke,dirs:Re}=J;if(he!=null&&setRef(he,null,V,J,!0),_e&256){se.ctx.deactivate(J);return}const Ee=_e&1&&Re,le=!isAsyncWrapper(J);let we;if(le&&(we=Z&&Z.onVnodeBeforeUnmount)&&invokeVNodeHook(we,se,J),_e&6)q(J.component,V,pe);else{if(_e&128){J.suspense.unmount(V,pe);return}Ee&&invokeDirectiveHook(J,null,se,"beforeUnmount"),_e&64?J.type.remove(J,se,V,ce,Se,pe):Ae&&(K!==Fragment||ke>0&&ke&64)?re(Ae,se,V,!1,!0):(K===Fragment&&ke&384||!ce&&_e&16)&&re(Ce,se,V),pe&&xe(J)}(le&&(we=Z&&Z.onVnodeUnmounted)||Ee)&&queuePostRenderEffect(()=>{we&&invokeVNodeHook(we,se,J),Ee&&invokeDirectiveHook(J,null,se,"unmounted")},V)},xe=J=>{const{type:se,el:V,anchor:pe,transition:ce}=J;if(se===Fragment){ye(V,pe);return}if(se===Static){_(J);return}const K=()=>{o(V),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(J.shapeFlag&1&&ce&&!ce.persisted){const{leave:Z,delayLeave:he}=ce,Ce=()=>Z(V,K);he?he(J.el,K,Ce):Ce()}else K()},ye=(J,se)=>{let V;for(;J!==se;)V=g(J),o(J),J=V;o(se)},q=(J,se,V)=>{const{bum:pe,scope:ce,update:K,subTree:Z,um:he}=J;pe&&invokeArrayFns(pe),ce.stop(),K&&(K.active=!1,W(Z,J,se,V)),he&&queuePostRenderEffect(he,se),queuePostRenderEffect(()=>{J.isUnmounted=!0},se),se&&se.pendingBranch&&!se.isUnmounted&&J.asyncDep&&!J.asyncResolved&&J.suspenseId===se.pendingId&&(se.deps--,se.deps===0&&se.resolve())},re=(J,se,V,pe=!1,ce=!1,K=0)=>{for(let Z=K;ZJ.shapeFlag&6?ue(J.component.subTree):J.shapeFlag&128?J.suspense.next():g(J.anchor||J.el),ge=(J,se,V)=>{J==null?se._vnode&&W(se._vnode,null,null,!0):S(se._vnode||null,J,se,null,null,null,V),flushPreFlushCbs(),flushPostFlushCbs(),se._vnode=J},Se={p:S,um:W,m:z,r:xe,mt:I,mc:k,pc:N,pbc:R,n:ue,o:i};let Be,Ie;return e&&([Be,Ie]=e(Se)),{render:ge,hydrate:Be,createApp:createAppAPI(ge,Be)}}function toggleRecurse({effect:i,update:e},r){i.allowRecurse=e.allowRecurse=r}function traverseStaticChildren(i,e,r=!1){const s=i.children,o=e.children;if(isArray$9(s)&&isArray$9(o))for(let a=0;a>1,i[r[u]]0&&(e[s]=r[a-1]),r[a]=s)}}for(a=r.length,l=r[a-1];a-- >0;)r[a]=l,l=e[l];return r}const isTeleport=i=>i.__isTeleport,isTeleportDisabled=i=>i&&(i.disabled||i.disabled===""),isTargetSVG=i=>typeof SVGElement<"u"&&i instanceof SVGElement,resolveTarget=(i,e)=>{const r=i&&i.to;return isString$2(r)?e?e(r):null:r},TeleportImpl={__isTeleport:!0,process(i,e,r,s,o,a,l,u,c,d){const{mc:y,pc:m,pbc:g,o:{insert:v,querySelector:b,createText:S,createComment:x}}=d,A=isTeleportDisabled(e.props);let{shapeFlag:E,children:w,dynamicChildren:_}=e;if(i==null){const T=e.el=S(""),C=e.anchor=S("");v(T,r,s),v(C,r,s);const P=e.target=resolveTarget(e.props,b),k=e.targetAnchor=S("");P&&(v(k,P),l=l||isTargetSVG(P));const M=(R,H)=>{E&16&&y(w,R,H,o,a,l,u,c)};A?M(r,C):P&&M(P,k)}else{e.el=i.el;const T=e.anchor=i.anchor,C=e.target=i.target,P=e.targetAnchor=i.targetAnchor,k=isTeleportDisabled(i.props),M=k?r:C,R=k?T:P;if(l=l||isTargetSVG(C),_?(g(i.dynamicChildren,_,M,o,a,l,u),traverseStaticChildren(i,e,!0)):c||m(i,e,M,R,o,a,l,u,!1),A)k||moveTeleport(e,r,T,d,1);else if((e.props&&e.props.to)!==(i.props&&i.props.to)){const H=e.target=resolveTarget(e.props,b);H&&moveTeleport(e,H,null,d,0)}else k&&moveTeleport(e,C,P,d,1)}updateCssVars(e)},remove(i,e,r,s,{um:o,o:{remove:a}},l){const{shapeFlag:u,children:c,anchor:d,targetAnchor:y,target:m,props:g}=i;if(m&&a(y),(l||!isTeleportDisabled(g))&&(a(d),u&16))for(let v=0;v0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(i),i}function createElementBlock(i,e,r,s,o,a){return setupBlock(createBaseVNode(i,e,r,s,o,a,!0))}function createBlock(i,e,r,s,o){return setupBlock(createVNode(i,e,r,s,o,!0))}function isVNode(i){return i?i.__v_isVNode===!0:!1}function isSameVNodeType(i,e){return i.type===e.type&&i.key===e.key}const InternalObjectKey="__vInternal",normalizeKey=({key:i})=>i!=null?i:null,normalizeRef=({ref:i,ref_key:e,ref_for:r})=>i!=null?isString$2(i)||isRef(i)||isFunction$6(i)?{i:currentRenderingInstance,r:i,k:e,f:!!r}:i:null;function createBaseVNode(i,e=null,r=null,s=0,o=null,a=i===Fragment?0:1,l=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&normalizeKey(e),ref:e&&normalizeRef(e),scopeId:currentScopeId,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};return u?(normalizeChildren(c,r),a&128&&i.normalize(c)):r&&(c.shapeFlag|=isString$2(r)?8:16),isBlockTreeEnabled>0&&!l&¤tBlock&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&¤tBlock.push(c),c}const createVNode=_createVNode;function _createVNode(i,e=null,r=null,s=0,o=null,a=!1){if((!i||i===NULL_DYNAMIC_COMPONENT)&&(i=Comment),isVNode(i)){const u=cloneVNode(i,e,!0);return r&&normalizeChildren(u,r),isBlockTreeEnabled>0&&!a&¤tBlock&&(u.shapeFlag&6?currentBlock[currentBlock.indexOf(i)]=u:currentBlock.push(u)),u.patchFlag|=-2,u}if(isClassComponent(i)&&(i=i.__vccOpts),e){e=guardReactiveProps(e);let{class:u,style:c}=e;u&&!isString$2(u)&&(e.class=normalizeClass(u)),isObject$5(c)&&(isProxy(c)&&!isArray$9(c)&&(c=extend$3({},c)),e.style=normalizeStyle(c))}const l=isString$2(i)?1:isSuspense(i)?128:isTeleport(i)?64:isObject$5(i)?4:isFunction$6(i)?2:0;return createBaseVNode(i,e,r,s,o,l,a,!0)}function guardReactiveProps(i){return i?isProxy(i)||InternalObjectKey in i?extend$3({},i):i:null}function cloneVNode(i,e,r=!1){const{props:s,ref:o,patchFlag:a,children:l}=i,u=e?mergeProps(s||{},e):s;return{__v_isVNode:!0,__v_skip:!0,type:i.type,props:u,key:u&&normalizeKey(u),ref:e&&e.ref?r&&o?isArray$9(o)?o.concat(normalizeRef(e)):[o,normalizeRef(e)]:normalizeRef(e):o,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:l,target:i.target,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==Fragment?a===-1?16:a|16:a,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:i.transition,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&cloneVNode(i.ssContent),ssFallback:i.ssFallback&&cloneVNode(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce}}function createTextVNode(i=" ",e=0){return createVNode(Text,null,i,e)}function createCommentVNode(i="",e=!1){return e?(openBlock(),createBlock(Comment,null,i)):createVNode(Comment,null,i)}function normalizeVNode(i){return i==null||typeof i=="boolean"?createVNode(Comment):isArray$9(i)?createVNode(Fragment,null,i.slice()):typeof i=="object"?cloneIfMounted(i):createVNode(Text,null,String(i))}function cloneIfMounted(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:cloneVNode(i)}function normalizeChildren(i,e){let r=0;const{shapeFlag:s}=i;if(e==null)e=null;else if(isArray$9(e))r=16;else if(typeof e=="object")if(s&65){const o=e.default;o&&(o._c&&(o._d=!1),normalizeChildren(i,o()),o._c&&(o._d=!0));return}else{r=32;const o=e._;!o&&!(InternalObjectKey in e)?e._ctx=currentRenderingInstance:o===3&¤tRenderingInstance&&(currentRenderingInstance.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else isFunction$6(e)?(e={default:e,_ctx:currentRenderingInstance},r=32):(e=String(e),s&64?(r=16,e=[createTextVNode(e)]):r=8);i.children=e,i.shapeFlag|=r}function mergeProps(...i){const e={};for(let r=0;rcurrentInstance||currentRenderingInstance,setCurrentInstance=i=>{currentInstance=i,i.scope.on()},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),currentInstance=null};function isStatefulComponent(i){return i.vnode.shapeFlag&4}let isInSSRComponentSetup=!1;function setupComponent(i,e=!1){isInSSRComponentSetup=e;const{props:r,children:s}=i.vnode,o=isStatefulComponent(i);initProps(i,r,o,e),initSlots(i,s);const a=o?setupStatefulComponent(i,e):void 0;return isInSSRComponentSetup=!1,a}function setupStatefulComponent(i,e){const r=i.type;i.accessCache=Object.create(null),i.proxy=markRaw(new Proxy(i.ctx,PublicInstanceProxyHandlers));const{setup:s}=r;if(s){const o=i.setupContext=s.length>1?createSetupContext(i):null;setCurrentInstance(i),pauseTracking();const a=callWithErrorHandling(s,i,0,[i.props,o]);if(resetTracking(),unsetCurrentInstance(),isPromise$1(a)){if(a.then(unsetCurrentInstance,unsetCurrentInstance),e)return a.then(l=>{handleSetupResult(i,l,e)}).catch(l=>{handleError(l,i,0)});i.asyncDep=a}else handleSetupResult(i,a,e)}else finishComponentSetup(i,e)}function handleSetupResult(i,e,r){isFunction$6(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:isObject$5(e)&&(i.setupState=proxyRefs(e)),finishComponentSetup(i,r)}let compile$1;function finishComponentSetup(i,e,r){const s=i.type;if(!i.render){if(!e&&compile$1&&!s.render){const o=s.template||resolveMergedOptions(i).template;if(o){const{isCustomElement:a,compilerOptions:l}=i.appContext.config,{delimiters:u,compilerOptions:c}=s,d=extend$3(extend$3({isCustomElement:a,delimiters:u},l),c);s.render=compile$1(o,d)}}i.render=s.render||NOOP}setCurrentInstance(i),pauseTracking(),applyOptions(i),resetTracking(),unsetCurrentInstance()}function createAttrsProxy(i){return new Proxy(i.attrs,{get(e,r){return track(i,"get","$attrs"),e[r]}})}function createSetupContext(i){const e=s=>{i.exposed=s||{}};let r;return{get attrs(){return r||(r=createAttrsProxy(i))},slots:i.slots,emit:i.emit,expose:e}}function getExposeProxy(i){if(i.exposed)return i.exposeProxy||(i.exposeProxy=new Proxy(proxyRefs(markRaw(i.exposed)),{get(e,r){if(r in e)return e[r];if(r in publicPropertiesMap)return publicPropertiesMap[r](i)},has(e,r){return r in e||r in publicPropertiesMap}}))}function getComponentName(i,e=!0){return isFunction$6(i)?i.displayName||i.name:i.name||e&&i.__name}function isClassComponent(i){return isFunction$6(i)&&"__vccOpts"in i}const computed=(i,e)=>computed$1(i,e,isInSSRComponentSetup);function h(i,e,r){const s=arguments.length;return s===2?isObject$5(e)&&!isArray$9(e)?isVNode(e)?createVNode(i,null,[e]):createVNode(i,e):createVNode(i,null,e):(s>3?r=Array.prototype.slice.call(arguments,2):s===3&&isVNode(r)&&(r=[r]),createVNode(i,e,r))}const ssrContextKey=Symbol(""),useSSRContext=()=>inject(ssrContextKey),version="3.2.47",svgNS="http://www.w3.org/2000/svg",doc$2=typeof document<"u"?document:null,templateContainer=doc$2&&doc$2.createElement("template"),nodeOps={insert:(i,e,r)=>{e.insertBefore(i,r||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,r,s)=>{const o=e?doc$2.createElementNS(svgNS,i):doc$2.createElement(i,r?{is:r}:void 0);return i==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:i=>doc$2.createTextNode(i),createComment:i=>doc$2.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>doc$2.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,r,s,o,a){const l=r?r.previousSibling:e.lastChild;if(o&&(o===a||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),r),!(o===a||!(o=o.nextSibling)););else{templateContainer.innerHTML=s?`${i}`:i;const u=templateContainer.content;if(s){const c=u.firstChild;for(;c.firstChild;)u.appendChild(c.firstChild);u.removeChild(c)}e.insertBefore(u,r)}return[l?l.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}};function patchClass(i,e,r){const s=i._vtc;s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?i.removeAttribute("class"):r?i.setAttribute("class",e):i.className=e}function patchStyle(i,e,r){const s=i.style,o=isString$2(r);if(r&&!o){if(e&&!isString$2(e))for(const a in e)r[a]==null&&setStyle(s,a,"");for(const a in r)setStyle(s,a,r[a])}else{const a=s.display;o?e!==r&&(s.cssText=r):e&&i.removeAttribute("style"),"_vod"in i&&(s.display=a)}}const importantRE=/\s*!important$/;function setStyle(i,e,r){if(isArray$9(r))r.forEach(s=>setStyle(i,e,s));else if(r==null&&(r=""),e.startsWith("--"))i.setProperty(e,r);else{const s=autoPrefix(i,e);importantRE.test(r)?i.setProperty(hyphenate(s),r.replace(importantRE,""),"important"):i[s]=r}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(i,e){const r=prefixCache[e];if(r)return r;let s=camelize$2(e);if(s!=="filter"&&s in i)return prefixCache[e]=s;s=capitalize(s);for(let o=0;ocachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(i,e){const r=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=r.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(s,r.value),e,5,[s])};return r.value=i,r.attached=getNow(),r}function patchStopImmediatePropagation(i,e){if(isArray$9(e)){const r=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0},e.map(s=>o=>!o._stopped&&s&&s(o))}else return e}const nativeOnRE=/^on[a-z]/,patchProp=(i,e,r,s,o=!1,a,l,u,c)=>{e==="class"?patchClass(i,s,o):e==="style"?patchStyle(i,r,s):isOn(e)?isModelListener(e)||patchEvent(i,e,r,s,l):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):shouldSetAsProp(i,e,s,o))?patchDOMProp(i,e,s,a,l,u,c):(e==="true-value"?i._trueValue=s:e==="false-value"&&(i._falseValue=s),patchAttr(i,e,s,o))};function shouldSetAsProp(i,e,r,s){return s?!!(e==="innerHTML"||e==="textContent"||e in i&&nativeOnRE.test(e)&&isFunction$6(r)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA"||nativeOnRE.test(e)&&isString$2(r)?!1:e in i}const TRANSITION="transition",ANIMATION="animation",Transition=(i,{slots:e})=>h(BaseTransition,resolveTransitionProps(i),e);Transition.displayName="Transition";const DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=Transition.props=extend$3({},BaseTransition.props,DOMTransitionPropsValidators),callHook=(i,e=[])=>{isArray$9(i)?i.forEach(r=>r(...e)):i&&i(...e)},hasExplicitCallback=i=>i?isArray$9(i)?i.some(e=>e.length>1):i.length>1:!1;function resolveTransitionProps(i){const e={};for(const B in i)B in DOMTransitionPropsValidators||(e[B]=i[B]);if(i.css===!1)return e;const{name:r="v",type:s,duration:o,enterFromClass:a=`${r}-enter-from`,enterActiveClass:l=`${r}-enter-active`,enterToClass:u=`${r}-enter-to`,appearFromClass:c=a,appearActiveClass:d=l,appearToClass:y=u,leaveFromClass:m=`${r}-leave-from`,leaveActiveClass:g=`${r}-leave-active`,leaveToClass:v=`${r}-leave-to`}=i,b=normalizeDuration(o),S=b&&b[0],x=b&&b[1],{onBeforeEnter:A,onEnter:E,onEnterCancelled:w,onLeave:_,onLeaveCancelled:T,onBeforeAppear:C=A,onAppear:P=E,onAppearCancelled:k=w}=e,M=(B,F,I)=>{removeTransitionClass(B,F?y:u),removeTransitionClass(B,F?d:l),I&&I()},R=(B,F)=>{B._isLeaving=!1,removeTransitionClass(B,m),removeTransitionClass(B,v),removeTransitionClass(B,g),F&&F()},H=B=>(F,I)=>{const U=B?P:E,D=()=>M(F,B,I);callHook(U,[F,D]),nextFrame(()=>{removeTransitionClass(F,B?c:a),addTransitionClass(F,B?y:u),hasExplicitCallback(U)||whenTransitionEnds(F,s,S,D)})};return extend$3(e,{onBeforeEnter(B){callHook(A,[B]),addTransitionClass(B,a),addTransitionClass(B,l)},onBeforeAppear(B){callHook(C,[B]),addTransitionClass(B,c),addTransitionClass(B,d)},onEnter:H(!1),onAppear:H(!0),onLeave(B,F){B._isLeaving=!0;const I=()=>R(B,F);addTransitionClass(B,m),forceReflow(),addTransitionClass(B,g),nextFrame(()=>{B._isLeaving&&(removeTransitionClass(B,m),addTransitionClass(B,v),hasExplicitCallback(_)||whenTransitionEnds(B,s,x,I))}),callHook(_,[B,I])},onEnterCancelled(B){M(B,!1),callHook(w,[B])},onAppearCancelled(B){M(B,!0),callHook(k,[B])},onLeaveCancelled(B){R(B),callHook(T,[B])}})}function normalizeDuration(i){if(i==null)return null;if(isObject$5(i))return[NumberOf(i.enter),NumberOf(i.leave)];{const e=NumberOf(i);return[e,e]}}function NumberOf(i){return toNumber$1(i)}function addTransitionClass(i,e){e.split(/\s+/).forEach(r=>r&&i.classList.add(r)),(i._vtc||(i._vtc=new Set)).add(e)}function removeTransitionClass(i,e){e.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const{_vtc:r}=i;r&&(r.delete(e),r.size||(i._vtc=void 0))}function nextFrame(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let endId=0;function whenTransitionEnds(i,e,r,s){const o=i._endId=++endId,a=()=>{o===i._endId&&s()};if(r)return setTimeout(a,r);const{type:l,timeout:u,propCount:c}=getTransitionInfo(i,e);if(!l)return s();const d=l+"end";let y=0;const m=()=>{i.removeEventListener(d,g),a()},g=v=>{v.target===i&&++y>=c&&m()};setTimeout(()=>{y(r[b]||"").split(", "),o=s(`${TRANSITION}Delay`),a=s(`${TRANSITION}Duration`),l=getTimeout(o,a),u=s(`${ANIMATION}Delay`),c=s(`${ANIMATION}Duration`),d=getTimeout(u,c);let y=null,m=0,g=0;e===TRANSITION?l>0&&(y=TRANSITION,m=l,g=a.length):e===ANIMATION?d>0&&(y=ANIMATION,m=d,g=c.length):(m=Math.max(l,d),y=m>0?l>d?TRANSITION:ANIMATION:null,g=y?y===TRANSITION?a.length:c.length:0);const v=y===TRANSITION&&/\b(transform|all)(,|$)/.test(s(`${TRANSITION}Property`).toString());return{type:y,timeout:m,propCount:g,hasTransform:v}}function getTimeout(i,e){for(;i.lengthtoMs(r)+toMs(i[s])))}function toMs(i){return Number(i.slice(0,-1).replace(",","."))*1e3}function forceReflow(){return document.body.offsetHeight}const positionMap=new WeakMap,newPositionMap=new WeakMap,TransitionGroupImpl={name:"TransitionGroup",props:extend$3({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(i,{slots:e}){const r=getCurrentInstance(),s=useTransitionState();let o,a;return onUpdated(()=>{if(!o.length)return;const l=i.moveClass||`${i.name||"v"}-move`;if(!hasCSSTransform(o[0].el,r.vnode.el,l))return;o.forEach(callPendingCbs),o.forEach(recordPosition);const u=o.filter(applyTranslation);forceReflow(),u.forEach(c=>{const d=c.el,y=d.style;addTransitionClass(d,l),y.transform=y.webkitTransform=y.transitionDuration="";const m=d._moveCb=g=>{g&&g.target!==d||(!g||/transform$/.test(g.propertyName))&&(d.removeEventListener("transitionend",m),d._moveCb=null,removeTransitionClass(d,l))};d.addEventListener("transitionend",m)})}),()=>{const l=toRaw(i),u=resolveTransitionProps(l);let c=l.tag||Fragment;o=a,a=e.default?getTransitionRawChildren(e.default()):[];for(let d=0;ddelete i.mode;TransitionGroupImpl.props;const TransitionGroup=TransitionGroupImpl;function callPendingCbs(i){const e=i.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function recordPosition(i){newPositionMap.set(i,i.el.getBoundingClientRect())}function applyTranslation(i){const e=positionMap.get(i),r=newPositionMap.get(i),s=e.left-r.left,o=e.top-r.top;if(s||o){const a=i.el.style;return a.transform=a.webkitTransform=`translate(${s}px,${o}px)`,a.transitionDuration="0s",i}}function hasCSSTransform(i,e,r){const s=i.cloneNode();i._vtc&&i._vtc.forEach(l=>{l.split(/\s+/).forEach(u=>u&&s.classList.remove(u))}),r.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const o=e.nodeType===1?e:e.parentNode;o.appendChild(s);const{hasTransform:a}=getTransitionInfo(s);return o.removeChild(s),a}const keyNames={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},withKeys=(i,e)=>r=>{if(!("key"in r))return;const s=hyphenate(r.key);if(e.some(o=>o===s||keyNames[o]===s))return i(r)},vShow={beforeMount(i,{value:e},{transition:r}){i._vod=i.style.display==="none"?"":i.style.display,r&&e?r.beforeEnter(i):setDisplay(i,e)},mounted(i,{value:e},{transition:r}){r&&e&&r.enter(i)},updated(i,{value:e,oldValue:r},{transition:s}){!e!=!r&&(s?e?(s.beforeEnter(i),setDisplay(i,!0),s.enter(i)):s.leave(i,()=>{setDisplay(i,!1)}):setDisplay(i,e))},beforeUnmount(i,{value:e}){setDisplay(i,e)}};function setDisplay(i,e){i.style.display=e?i._vod:"none"}const rendererOptions=extend$3({patchProp},nodeOps);let renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}const createApp=(...i)=>{const e=ensureRenderer().createApp(...i),{mount:r}=e;return e.mount=s=>{const o=normalizeContainer(s);if(!o)return;const a=e._component;!isFunction$6(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.innerHTML="";const l=r(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},e};function normalizeContainer(i){return isString$2(i)?document.querySelector(i):i}/*! * vue-router v4.1.6 * (c) 2022 Eduardo San Martin Morote * @license MIT */const isBrowser=typeof window<"u";function isESModule(i){return i.__esModule||i[Symbol.toStringTag]==="Module"}const assign$2=Object.assign;function applyToParams(i,e){const r={};for(const s in e){const o=e[s];r[s]=isArray$8(o)?o.map(i):i(o)}return r}const noop$2=()=>{},isArray$8=Array.isArray,TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=i=>i.replace(TRAILING_SLASH_RE,"");function parseURL(i,e,r="/"){let s,o={},a="",l="";const u=e.indexOf("#");let c=e.indexOf("?");return u=0&&(c=-1),c>-1&&(s=e.slice(0,c),a=e.slice(c+1,u>-1?u:e.length),o=i(a)),u>-1&&(s=s||e.slice(0,u),l=e.slice(u,e.length)),s=resolveRelativePath(s!=null?s:e,r),{fullPath:s+(a&&"?")+a+l,path:s,query:o,hash:l}}function stringifyURL(i,e){const r=e.query?i(e.query):"";return e.path+(r&&"?")+r+(e.hash||"")}function stripBase(i,e){return!e||!i.toLowerCase().startsWith(e.toLowerCase())?i:i.slice(e.length)||"/"}function isSameRouteLocation(i,e,r){const s=e.matched.length-1,o=r.matched.length-1;return s>-1&&s===o&&isSameRouteRecord(e.matched[s],r.matched[o])&&isSameRouteLocationParams(e.params,r.params)&&i(e.query)===i(r.query)&&e.hash===r.hash}function isSameRouteRecord(i,e){return(i.aliasOf||i)===(e.aliasOf||e)}function isSameRouteLocationParams(i,e){if(Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!isSameRouteLocationParamsValue(i[r],e[r]))return!1;return!0}function isSameRouteLocationParamsValue(i,e){return isArray$8(i)?isEquivalentArray(i,e):isArray$8(e)?isEquivalentArray(e,i):i===e}function isEquivalentArray(i,e){return isArray$8(e)?i.length===e.length&&i.every((r,s)=>r===e[s]):i.length===1&&i[0]===e}function resolveRelativePath(i,e){if(i.startsWith("/"))return i;if(!i)return e;const r=e.split("/"),s=i.split("/");let o=r.length-1,a,l;for(a=0;a1&&o--;else break;return r.slice(0,o).join("/")+"/"+s.slice(a-(a===s.length?1:0)).join("/")}var NavigationType;(function(i){i.pop="pop",i.push="push"})(NavigationType||(NavigationType={}));var NavigationDirection;(function(i){i.back="back",i.forward="forward",i.unknown=""})(NavigationDirection||(NavigationDirection={}));function normalizeBase(i){if(!i)if(isBrowser){const e=document.querySelector("base");i=e&&e.getAttribute("href")||"/",i=i.replace(/^\w+:\/\/[^\/]+/,"")}else i="/";return i[0]!=="/"&&i[0]!=="#"&&(i="/"+i),removeTrailingSlash(i)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(i,e){return i.replace(BEFORE_HASH_RE,"#")+e}function getElementPosition(i,e){const r=document.documentElement.getBoundingClientRect(),s=i.getBoundingClientRect();return{behavior:e.behavior,left:s.left-r.left-(e.left||0),top:s.top-r.top-(e.top||0)}}const computeScrollPosition=()=>({left:window.pageXOffset,top:window.pageYOffset});function scrollToPosition(i){let e;if("el"in i){const r=i.el,s=typeof r=="string"&&r.startsWith("#"),o=typeof r=="string"?s?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!o)return;e=getElementPosition(o,i)}else e=i;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.pageXOffset,e.top!=null?e.top:window.pageYOffset)}function getScrollKey(i,e){return(history.state?history.state.position-e:-1)+i}const scrollPositions=new Map;function saveScrollPosition(i,e){scrollPositions.set(i,e)}function getSavedScrollPosition(i){const e=scrollPositions.get(i);return scrollPositions.delete(i),e}let createBaseLocation=()=>location.protocol+"//"+location.host;function createCurrentLocation(i,e){const{pathname:r,search:s,hash:o}=e,a=i.indexOf("#");if(a>-1){let u=o.includes(i.slice(a))?i.slice(a).length:1,c=o.slice(u);return c[0]!=="/"&&(c="/"+c),stripBase(c,"")}return stripBase(r,i)+s+o}function useHistoryListeners(i,e,r,s){let o=[],a=[],l=null;const u=({state:g})=>{const v=createCurrentLocation(i,location),b=r.value,S=e.value;let x=0;if(g){if(r.value=v,e.value=g,l&&l===b){l=null;return}x=S?g.position-S.position:0}else s(v);o.forEach(A=>{A(r.value,b,{delta:x,type:NavigationType.pop,direction:x?x>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function c(){l=r.value}function d(g){o.push(g);const v=()=>{const b=o.indexOf(g);b>-1&&o.splice(b,1)};return a.push(v),v}function y(){const{history:g}=window;g.state&&g.replaceState(assign$2({},g.state,{scroll:computeScrollPosition()}),"")}function m(){for(const g of a)g();a=[],window.removeEventListener("popstate",u),window.removeEventListener("beforeunload",y)}return window.addEventListener("popstate",u),window.addEventListener("beforeunload",y),{pauseListeners:c,listen:d,destroy:m}}function buildState(i,e,r,s=!1,o=!1){return{back:i,current:e,forward:r,replaced:s,position:window.history.length,scroll:o?computeScrollPosition():null}}function useHistoryStateNavigation(i){const{history:e,location:r}=window,s={value:createCurrentLocation(i,r)},o={value:e.state};o.value||a(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function a(c,d,y){const m=i.indexOf("#"),g=m>-1?(r.host&&document.querySelector("base")?i:i.slice(m))+c:createBaseLocation()+i+c;try{e[y?"replaceState":"pushState"](d,"",g),o.value=d}catch(v){console.error(v),r[y?"replace":"assign"](g)}}function l(c,d){const y=assign$2({},e.state,buildState(o.value.back,c,o.value.forward,!0),d,{position:o.value.position});a(c,y,!0),s.value=c}function u(c,d){const y=assign$2({},o.value,e.state,{forward:c,scroll:computeScrollPosition()});a(y.current,y,!0);const m=assign$2({},buildState(s.value,c,null),{position:y.position+1},d);a(c,m,!1),s.value=c}return{location:s,state:o,push:u,replace:l}}function createWebHistory(i){i=normalizeBase(i);const e=useHistoryStateNavigation(i),r=useHistoryListeners(i,e.state,e.location,e.replace);function s(a,l=!0){l||r.pauseListeners(),history.go(a)}const o=assign$2({location:"",base:i,go:s,createHref:createHref.bind(null,i)},e,r);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>e.state.value}),o}function createWebHashHistory(i){return i=location.host?i||location.pathname+location.search:"",i.includes("#")||(i+="#"),createWebHistory(i)}function isRouteLocation(i){return typeof i=="string"||i&&typeof i=="object"}function isRouteName(i){return typeof i=="string"||typeof i=="symbol"}const START_LOCATION_NORMALIZED={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},NavigationFailureSymbol=Symbol("");var NavigationFailureType;(function(i){i[i.aborted=4]="aborted",i[i.cancelled=8]="cancelled",i[i.duplicated=16]="duplicated"})(NavigationFailureType||(NavigationFailureType={}));function createRouterError(i,e){return assign$2(new Error,{type:i,[NavigationFailureSymbol]:!0},e)}function isNavigationFailure(i,e){return i instanceof Error&&NavigationFailureSymbol in i&&(e==null||!!(i.type&e))}const BASE_PARAM_PATTERN="[^/]+?",BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(i,e){const r=assign$2({},BASE_PATH_PARSER_OPTIONS,e),s=[];let o=r.start?"^":"";const a=[];for(const d of i){const y=d.length?[]:[90];r.strict&&!d.length&&(o+="/");for(let m=0;me.length?e.length===1&&e[0]===40+40?1:-1:0}function comparePathParserScore(i,e){let r=0;const s=i.score,o=e.score;for(;r0&&e[e.length-1]<0}const ROOT_TOKEN={type:0,value:""},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(i){if(!i)return[[]];if(i==="/")return[[ROOT_TOKEN]];if(!i.startsWith("/"))throw new Error(`Invalid path "${i}"`);function e(v){throw new Error(`ERR (${r})/"${d}": ${v}`)}let r=0,s=r;const o=[];let a;function l(){a&&o.push(a),a=[]}let u=0,c,d="",y="";function m(){d&&(r===0?a.push({type:0,value:d}):r===1||r===2||r===3?(a.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:d,regexp:y,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),d="")}function g(){d+=c}for(;u{l(E)}:noop$2}function l(y){if(isRouteName(y)){const m=s.get(y);m&&(s.delete(y),r.splice(r.indexOf(m),1),m.children.forEach(l),m.alias.forEach(l))}else{const m=r.indexOf(y);m>-1&&(r.splice(m,1),y.record.name&&s.delete(y.record.name),y.children.forEach(l),y.alias.forEach(l))}}function u(){return r}function c(y){let m=0;for(;m=0&&(y.record.path!==r[m].record.path||!isRecordChildOf(y,r[m]));)m++;r.splice(m,0,y),y.record.name&&!isAliasRecord(y)&&s.set(y.record.name,y)}function d(y,m){let g,v={},b,S;if("name"in y&&y.name){if(g=s.get(y.name),!g)throw createRouterError(1,{location:y});S=g.record.name,v=assign$2(paramsFromLocation(m.params,g.keys.filter(E=>!E.optional).map(E=>E.name)),y.params&¶msFromLocation(y.params,g.keys.map(E=>E.name))),b=g.stringify(v)}else if("path"in y)b=y.path,g=r.find(E=>E.re.test(b)),g&&(v=g.parse(b),S=g.record.name);else{if(g=m.name?s.get(m.name):r.find(E=>E.re.test(m.path)),!g)throw createRouterError(1,{location:y,currentLocation:m});S=g.record.name,v=assign$2({},m.params,y.params),b=g.stringify(v)}const x=[];let A=g;for(;A;)x.unshift(A.record),A=A.parent;return{name:S,path:b,params:v,matched:x,meta:mergeMetaFields(x)}}return i.forEach(y=>a(y)),{addRoute:a,resolve:d,removeRoute:l,getRoutes:u,getRecordMatcher:o}}function paramsFromLocation(i,e){const r={};for(const s of e)s in i&&(r[s]=i[s]);return r}function normalizeRouteRecord(i){return{path:i.path,redirect:i.redirect,name:i.name,meta:i.meta||{},aliasOf:void 0,beforeEnter:i.beforeEnter,props:normalizeRecordProps(i),children:i.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in i?i.components||null:i.component&&{default:i.component}}}function normalizeRecordProps(i){const e={},r=i.props||!1;if("component"in i)e.default=r;else for(const s in i.components)e[s]=typeof r=="boolean"?r:r[s];return e}function isAliasRecord(i){for(;i;){if(i.record.aliasOf)return!0;i=i.parent}return!1}function mergeMetaFields(i){return i.reduce((e,r)=>assign$2(e,r.meta),{})}function mergeOptions(i,e){const r={};for(const s in i)r[s]=s in e?e[s]:i[s];return r}function isRecordChildOf(i,e){return e.children.some(r=>r===i||isRecordChildOf(i,r))}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(i){return encodeURI(""+i).replace(ENC_PIPE_RE,"|").replace(ENC_BRACKET_OPEN_RE,"[").replace(ENC_BRACKET_CLOSE_RE,"]")}function encodeHash(i){return commonEncode(i).replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryValue(i){return commonEncode(i).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryKey(i){return encodeQueryValue(i).replace(EQUAL_RE,"%3D")}function encodePath(i){return commonEncode(i).replace(HASH_RE,"%23").replace(IM_RE,"%3F")}function encodeParam(i){return i==null?"":encodePath(i).replace(SLASH_RE,"%2F")}function decode$5(i){try{return decodeURIComponent(""+i)}catch(e){}return""+i}function parseQuery(i){const e={};if(i===""||i==="?")return e;const s=(i[0]==="?"?i.slice(1):i).split("&");for(let o=0;oa&&encodeQueryValue(a)):[s&&encodeQueryValue(s)]).forEach(a=>{a!==void 0&&(e+=(e.length?"&":"")+r,a!=null&&(e+="="+a))})}return e}function normalizeQuery(i){const e={};for(const r in i){const s=i[r];s!==void 0&&(e[r]=isArray$8(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return e}const matchedRouteKey=Symbol(""),viewDepthKey=Symbol(""),routerKey=Symbol(""),routeLocationKey=Symbol(""),routerViewLocationKey=Symbol("");function useCallbacks(){let i=[];function e(s){return i.push(s),()=>{const o=i.indexOf(s);o>-1&&i.splice(o,1)}}function r(){i=[]}return{add:e,list:()=>i,reset:r}}function guardToPromiseFn(i,e,r,s,o){const a=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((l,u)=>{const c=m=>{m===!1?u(createRouterError(4,{from:r,to:e})):m instanceof Error?u(m):isRouteLocation(m)?u(createRouterError(2,{from:e,to:m})):(a&&s.enterCallbacks[o]===a&&typeof m=="function"&&a.push(m),l())},d=i.call(s&&s.instances[o],e,r,c);let y=Promise.resolve(d);i.length<3&&(y=y.then(c)),y.catch(m=>u(m))})}function extractComponentsGuards(i,e,r,s){const o=[];for(const a of i)for(const l in a.components){let u=a.components[l];if(!(e!=="beforeRouteEnter"&&!a.instances[l]))if(isRouteComponent(u)){const d=(u.__vccOpts||u)[e];d&&o.push(guardToPromiseFn(d,r,s,a,l))}else{let c=u();o.push(()=>c.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${a.path}"`));const y=isESModule(d)?d.default:d;a.components[l]=y;const g=(y.__vccOpts||y)[e];return g&&guardToPromiseFn(g,r,s,a,l)()}))}}return o}function isRouteComponent(i){return typeof i=="object"||"displayName"in i||"props"in i||"__vccOpts"in i}function useLink(i){const e=inject(routerKey),r=inject(routeLocationKey),s=computed(()=>e.resolve(unref(i.to))),o=computed(()=>{const{matched:c}=s.value,{length:d}=c,y=c[d-1],m=r.matched;if(!y||!m.length)return-1;const g=m.findIndex(isSameRouteRecord.bind(null,y));if(g>-1)return g;const v=getOriginalPath(c[d-2]);return d>1&&getOriginalPath(y)===v&&m[m.length-1].path!==v?m.findIndex(isSameRouteRecord.bind(null,c[d-2])):g}),a=computed(()=>o.value>-1&&includesParams(r.params,s.value.params)),l=computed(()=>o.value>-1&&o.value===r.matched.length-1&&isSameRouteLocationParams(r.params,s.value.params));function u(c={}){return guardEvent(c)?e[unref(i.replace)?"replace":"push"](unref(i.to)).catch(noop$2):Promise.resolve()}return{route:s,href:computed(()=>s.value.href),isActive:a,isExactActive:l,navigate:u}}const RouterLinkImpl=defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink,setup(i,{slots:e}){const r=reactive(useLink(i)),{options:s}=inject(routerKey),o=computed(()=>({[getLinkClass(i.activeClass,s.linkActiveClass,"router-link-active")]:r.isActive,[getLinkClass(i.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const a=e.default&&e.default(r);return i.custom?a:h("a",{"aria-current":r.isExactActive?i.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:o.value},a)}}}),RouterLink=RouterLinkImpl;function guardEvent(i){if(!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)&&!i.defaultPrevented&&!(i.button!==void 0&&i.button!==0)){if(i.currentTarget&&i.currentTarget.getAttribute){const e=i.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return i.preventDefault&&i.preventDefault(),!0}}function includesParams(i,e){for(const r in e){const s=e[r],o=i[r];if(typeof s=="string"){if(s!==o)return!1}else if(!isArray$8(o)||o.length!==s.length||s.some((a,l)=>a!==o[l]))return!1}return!0}function getOriginalPath(i){return i?i.aliasOf?i.aliasOf.path:i.path:""}const getLinkClass=(i,e,r)=>i!=null?i:e!=null?e:r,RouterViewImpl=defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(i,{attrs:e,slots:r}){const s=inject(routerViewLocationKey),o=computed(()=>i.route||s.value),a=inject(viewDepthKey,0),l=computed(()=>{let d=unref(a);const{matched:y}=o.value;let m;for(;(m=y[d])&&!m.components;)d++;return d}),u=computed(()=>o.value.matched[l.value]);provide(viewDepthKey,computed(()=>l.value+1)),provide(matchedRouteKey,u),provide(routerViewLocationKey,o);const c=ref();return watch(()=>[c.value,u.value,i.name],([d,y,m],[g,v,b])=>{y&&(y.instances[m]=d,v&&v!==y&&d&&d===g&&(y.leaveGuards.size||(y.leaveGuards=v.leaveGuards),y.updateGuards.size||(y.updateGuards=v.updateGuards))),d&&y&&(!v||!isSameRouteRecord(y,v)||!g)&&(y.enterCallbacks[m]||[]).forEach(S=>S(d))},{flush:"post"}),()=>{const d=o.value,y=i.name,m=u.value,g=m&&m.components[y];if(!g)return normalizeSlot(r.default,{Component:g,route:d});const v=m.props[y],b=v?v===!0?d.params:typeof v=="function"?v(d):v:null,x=h(g,assign$2({},b,e,{onVnodeUnmounted:A=>{A.component.isUnmounted&&(m.instances[y]=null)},ref:c}));return normalizeSlot(r.default,{Component:x,route:d})||x}}});function normalizeSlot(i,e){if(!i)return null;const r=i(e);return r.length===1?r[0]:r}const RouterView=RouterViewImpl;function createRouter(i){const e=createRouterMatcher(i.routes,i),r=i.parseQuery||parseQuery,s=i.stringifyQuery||stringifyQuery,o=i.history,a=useCallbacks(),l=useCallbacks(),u=useCallbacks(),c=shallowRef(START_LOCATION_NORMALIZED);let d=START_LOCATION_NORMALIZED;isBrowser&&i.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const y=applyToParams.bind(null,q=>""+q),m=applyToParams.bind(null,encodeParam),g=applyToParams.bind(null,decode$5);function v(q,re){let ue,ge;return isRouteName(q)?(ue=e.getRecordMatcher(q),ge=re):ge=q,e.addRoute(ge,ue)}function b(q){const re=e.getRecordMatcher(q);re&&e.removeRoute(re)}function S(){return e.getRoutes().map(q=>q.record)}function x(q){return!!e.getRecordMatcher(q)}function A(q,re){if(re=assign$2({},re||c.value),typeof q=="string"){const J=parseURL(r,q,re.path),se=e.resolve({path:J.path},re),V=o.createHref(J.fullPath);return assign$2(J,se,{params:g(se.params),hash:decode$5(J.hash),redirectedFrom:void 0,href:V})}let ue;if("path"in q)ue=assign$2({},q,{path:parseURL(r,q.path,re.path).path});else{const J=assign$2({},q.params);for(const se in J)J[se]==null&&delete J[se];ue=assign$2({},q,{params:m(q.params)}),re.params=m(re.params)}const ge=e.resolve(ue,re),Se=q.hash||"";ge.params=y(g(ge.params));const Be=stringifyURL(s,assign$2({},q,{hash:encodeHash(Se),path:ge.path})),Ie=o.createHref(Be);return assign$2({fullPath:Be,hash:Se,query:s===stringifyQuery?normalizeQuery(q.query):q.query||{}},ge,{redirectedFrom:void 0,href:Ie})}function E(q){return typeof q=="string"?parseURL(r,q,c.value.path):assign$2({},q)}function w(q,re){if(d!==q)return createRouterError(8,{from:re,to:q})}function _(q){return P(q)}function T(q){return _(assign$2(E(q),{replace:!0}))}function C(q){const re=q.matched[q.matched.length-1];if(re&&re.redirect){const{redirect:ue}=re;let ge=typeof ue=="function"?ue(q):ue;return typeof ge=="string"&&(ge=ge.includes("?")||ge.includes("#")?ge=E(ge):{path:ge},ge.params={}),assign$2({query:q.query,hash:q.hash,params:"path"in ge?{}:q.params},ge)}}function P(q,re){const ue=d=A(q),ge=c.value,Se=q.state,Be=q.force,Ie=q.replace===!0,J=C(ue);if(J)return P(assign$2(E(J),{state:typeof J=="object"?assign$2({},Se,J.state):Se,force:Be,replace:Ie}),re||ue);const se=ue;se.redirectedFrom=re;let V;return!Be&&isSameRouteLocation(s,ge,ue)&&(V=createRouterError(16,{to:se,from:ge}),Q(ge,ge,!0,!1)),(V?Promise.resolve(V):M(se,ge)).catch(pe=>isNavigationFailure(pe)?isNavigationFailure(pe,2)?pe:O(pe):$(pe,se,ge)).then(pe=>{if(pe){if(isNavigationFailure(pe,2))return P(assign$2({replace:Ie},E(pe.to),{state:typeof pe.to=="object"?assign$2({},Se,pe.to.state):Se,force:Be}),re||se)}else pe=H(se,ge,!0,Ie,Se);return R(se,ge,pe),pe})}function k(q,re){const ue=w(q,re);return ue?Promise.reject(ue):Promise.resolve()}function M(q,re){let ue;const[ge,Se,Be]=extractChangingRecords(q,re);ue=extractComponentsGuards(ge.reverse(),"beforeRouteLeave",q,re);for(const J of ge)J.leaveGuards.forEach(se=>{ue.push(guardToPromiseFn(se,q,re))});const Ie=k.bind(null,q,re);return ue.push(Ie),runGuardQueue(ue).then(()=>{ue=[];for(const J of a.list())ue.push(guardToPromiseFn(J,q,re));return ue.push(Ie),runGuardQueue(ue)}).then(()=>{ue=extractComponentsGuards(Se,"beforeRouteUpdate",q,re);for(const J of Se)J.updateGuards.forEach(se=>{ue.push(guardToPromiseFn(se,q,re))});return ue.push(Ie),runGuardQueue(ue)}).then(()=>{ue=[];for(const J of q.matched)if(J.beforeEnter&&!re.matched.includes(J))if(isArray$8(J.beforeEnter))for(const se of J.beforeEnter)ue.push(guardToPromiseFn(se,q,re));else ue.push(guardToPromiseFn(J.beforeEnter,q,re));return ue.push(Ie),runGuardQueue(ue)}).then(()=>(q.matched.forEach(J=>J.enterCallbacks={}),ue=extractComponentsGuards(Be,"beforeRouteEnter",q,re),ue.push(Ie),runGuardQueue(ue))).then(()=>{ue=[];for(const J of l.list())ue.push(guardToPromiseFn(J,q,re));return ue.push(Ie),runGuardQueue(ue)}).catch(J=>isNavigationFailure(J,8)?J:Promise.reject(J))}function R(q,re,ue){for(const ge of u.list())ge(q,re,ue)}function H(q,re,ue,ge,Se){const Be=w(q,re);if(Be)return Be;const Ie=re===START_LOCATION_NORMALIZED,J=isBrowser?history.state:{};ue&&(ge||Ie?o.replace(q.fullPath,assign$2({scroll:Ie&&J&&J.scroll},Se)):o.push(q.fullPath,Se)),c.value=q,Q(q,re,ue,Ie),O()}let B;function F(){B||(B=o.listen((q,re,ue)=>{if(!ye.listening)return;const ge=A(q),Se=C(ge);if(Se){P(assign$2(Se,{replace:!0}),ge).catch(noop$2);return}d=ge;const Be=c.value;isBrowser&&saveScrollPosition(getScrollKey(Be.fullPath,ue.delta),computeScrollPosition()),M(ge,Be).catch(Ie=>isNavigationFailure(Ie,12)?Ie:isNavigationFailure(Ie,2)?(P(Ie.to,ge).then(J=>{isNavigationFailure(J,20)&&!ue.delta&&ue.type===NavigationType.pop&&o.go(-1,!1)}).catch(noop$2),Promise.reject()):(ue.delta&&o.go(-ue.delta,!1),$(Ie,ge,Be))).then(Ie=>{Ie=Ie||H(ge,Be,!1),Ie&&(ue.delta&&!isNavigationFailure(Ie,8)?o.go(-ue.delta,!1):ue.type===NavigationType.pop&&isNavigationFailure(Ie,20)&&o.go(-1,!1)),R(ge,Be,Ie)}).catch(noop$2)}))}let I=useCallbacks(),U=useCallbacks(),D;function $(q,re,ue){O(q);const ge=U.list();return ge.length?ge.forEach(Se=>Se(q,re,ue)):console.error(q),Promise.reject(q)}function N(){return D&&c.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((q,re)=>{I.add([q,re])})}function O(q){return D||(D=!q,F(),I.list().forEach(([re,ue])=>q?ue(q):re()),I.reset()),q}function Q(q,re,ue,ge){const{scrollBehavior:Se}=i;if(!isBrowser||!Se)return Promise.resolve();const Be=!ue&&getSavedScrollPosition(getScrollKey(q.fullPath,0))||(ge||!ue)&&history.state&&history.state.scroll||null;return nextTick().then(()=>Se(q,re,Be)).then(Ie=>Ie&&scrollToPosition(Ie)).catch(Ie=>$(Ie,q,re))}const z=q=>o.go(q);let W;const xe=new Set,ye={currentRoute:c,listening:!0,addRoute:v,removeRoute:b,hasRoute:x,getRoutes:S,resolve:A,options:i,push:_,replace:T,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:a.add,beforeResolve:l.add,afterEach:u.add,onError:U.add,isReady:N,install(q){const re=this;q.component("RouterLink",RouterLink),q.component("RouterView",RouterView),q.config.globalProperties.$router=re,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>unref(c)}),isBrowser&&!W&&c.value===START_LOCATION_NORMALIZED&&(W=!0,_(o.location).catch(Se=>{}));const ue={};for(const Se in START_LOCATION_NORMALIZED)ue[Se]=computed(()=>c.value[Se]);q.provide(routerKey,re),q.provide(routeLocationKey,reactive(ue)),q.provide(routerViewLocationKey,c);const ge=q.unmount;xe.add(q),q.unmount=function(){xe.delete(q),xe.size<1&&(d=START_LOCATION_NORMALIZED,B&&B(),B=null,c.value=START_LOCATION_NORMALIZED,W=!1,D=!1),ge()}}};return ye}function runGuardQueue(i){return i.reduce((e,r)=>e.then(()=>r()),Promise.resolve())}function extractChangingRecords(i,e){const r=[],s=[],o=[],a=Math.max(e.matched.length,i.matched.length);for(let l=0;lisSameRouteRecord(d,u))?s.push(u):r.push(u));const c=i.matched[l];c&&(e.matched.find(d=>isSameRouteRecord(d,c))||o.push(c))}return[r,s,o]}function useRouter(){return inject(routerKey)}function useRoute$1(){return inject(routeLocationKey)}const isDef$1=i=>i!=null,isFunction$5=i=>typeof i=="function",isObject$4=i=>i!==null&&typeof i=="object",isPromise=i=>isObject$4(i)&&isFunction$5(i.then)&&isFunction$5(i.catch),isNumeric=i=>typeof i=="number"||/^\d+(\.\d+)?$/.test(i),isIOS$2=()=>inBrowser$2?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function noop$1(){}const extend$2=Object.assign,inBrowser$2=typeof window<"u";function get(i,e){const r=e.split(".");let s=i;return r.forEach(o=>{var a;s=isObject$4(s)&&(a=s[o])!=null?a:""}),s}function pick$1(i,e,r){return e.reduce((s,o)=>((!r||i[o]!==void 0)&&(s[o]=i[o]),s),{})}const isSameValue=(i,e)=>JSON.stringify(i)===JSON.stringify(e),toArray=i=>Array.isArray(i)?i:[i],unknownProp=null,numericProp=[Number,String],truthProp={type:Boolean,default:!0},makeRequiredProp=i=>({type:i,required:!0}),makeArrayProp=()=>({type:Array,default:()=>[]}),makeNumberProp=i=>({type:Number,default:i}),makeNumericProp=i=>({type:numericProp,default:i}),makeStringProp=i=>({type:String,default:i});var inBrowser$1=typeof window<"u";function raf(i){return inBrowser$1?requestAnimationFrame(i):-1}function cancelRaf(i){inBrowser$1&&cancelAnimationFrame(i)}function doubleRaf(i){raf(()=>raf(i))}var isWindow=i=>i===window,makeDOMRect=(i,e)=>({top:0,left:0,right:i,bottom:e,width:i,height:e}),useRect=i=>{const e=unref(i);if(isWindow(e)){const r=e.innerWidth,s=e.innerHeight;return makeDOMRect(r,s)}return e!=null&&e.getBoundingClientRect?e.getBoundingClientRect():makeDOMRect(0,0)};function useParent$1(i){const e=inject(i,null);if(e){const r=getCurrentInstance(),{link:s,unlink:o,internalChildren:a}=e;s(r),onUnmounted(()=>o(r));const l=computed(()=>a.indexOf(r));return{parent:e,index:l}}return{parent:null,index:ref(-1)}}function flattenVNodes(i){const e=[],r=s=>{Array.isArray(s)&&s.forEach(o=>{var a;isVNode(o)&&(e.push(o),(a=o.component)!=null&&a.subTree&&(e.push(o.component.subTree),r(o.component.subTree.children)),o.children&&r(o.children))})};return r(i),e}var findVNodeIndex=(i,e)=>{const r=i.indexOf(e);return r===-1?i.findIndex(s=>e.key!==void 0&&e.key!==null&&s.type===e.type&&s.key===e.key):r};function sortChildren(i,e,r){const s=flattenVNodes(i.subTree.children);r.sort((a,l)=>findVNodeIndex(s,a.vnode)-findVNodeIndex(s,l.vnode));const o=r.map(a=>a.proxy);e.sort((a,l)=>{const u=o.indexOf(a),c=o.indexOf(l);return u-c})}function useChildren$1(i){const e=reactive([]),r=reactive([]),s=getCurrentInstance();return{children:e,linkChildren:a=>{provide(i,Object.assign({link:c=>{c.proxy&&(r.push(c),e.push(c.proxy),sortChildren(s,e,r))},unlink:c=>{const d=r.indexOf(c);e.splice(d,1),r.splice(d,1)},children:e,internalChildren:r},a))}}}function onMountedOrActivated(i){let e;onMounted(()=>{i(),nextTick(()=>{e=!0})}),onActivated(()=>{e&&i()})}function useEventListener$1(i,e,r={}){if(!inBrowser$1)return;const{target:s=window,passive:o=!1,capture:a=!1}=r;let l=!1,u;const c=m=>{if(l)return;const g=unref(m);g&&!u&&(g.addEventListener(i,e,{capture:a,passive:o}),u=!0)},d=m=>{if(l)return;const g=unref(m);g&&u&&(g.removeEventListener(i,e,a),u=!1)};onUnmounted(()=>d(s)),onDeactivated(()=>d(s)),onMountedOrActivated(()=>c(s));let y;return isRef(s)&&(y=watch(s,(m,g)=>{d(g),c(m)})),()=>{y==null||y(),d(s),l=!0}}function useClickAway(i,e,r={}){if(!inBrowser$1)return;const{eventName:s="click"}=r;useEventListener$1(s,a=>{(Array.isArray(i)?i:[i]).every(c=>{const d=unref(c);return d&&!d.contains(a.target)})&&e(a)},{target:document})}var width,height;function useWindowSize(){if(!width&&(width=ref(0),height=ref(0),inBrowser$1)){const i=()=>{width.value=window.innerWidth,height.value=window.innerHeight};i(),window.addEventListener("resize",i,{passive:!0}),window.addEventListener("orientationchange",i,{passive:!0})}return{width,height}}var overflowScrollReg=/scroll|auto|overlay/i,defaultRoot=inBrowser$1?window:void 0;function isElement$1(i){return i.tagName!=="HTML"&&i.tagName!=="BODY"&&i.nodeType===1}function getScrollParent(i,e=defaultRoot){let r=i;for(;r&&r!==e&&isElement$1(r);){const{overflowY:s}=window.getComputedStyle(r);if(overflowScrollReg.test(s))return r;r=r.parentNode}return e}function useScrollParent(i,e=defaultRoot){const r=ref();return onMounted(()=>{i.value&&(r.value=getScrollParent(i.value,e))}),r}var visibility;function usePageVisibility(){if(!visibility&&(visibility=ref("visible"),inBrowser$1)){const i=()=>{visibility.value=document.hidden?"hidden":"visible"};i(),window.addEventListener("visibilitychange",i)}return visibility}var CUSTOM_FIELD_INJECTION_KEY=Symbol("van-field");function useCustomFieldValue(i){const e=inject(CUSTOM_FIELD_INJECTION_KEY,null);e&&!e.customValue.value&&(e.customValue.value=i,watch(i,()=>{e.resetValidation(),e.validateWithTrigger("onChange")}))}function getScrollTop(i){const e="scrollTop"in i?i.scrollTop:i.pageYOffset;return Math.max(e,0)}function setScrollTop(i,e){"scrollTop"in i?i.scrollTop=e:i.scrollTo(i.scrollX,e)}function getRootScrollTop(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function setRootScrollTop(i){setScrollTop(window,i),setScrollTop(document.body,i)}function getElementTop(i,e){if(i===window)return 0;const r=e?getScrollTop(e):getRootScrollTop();return useRect(i).top+r}const isIOS$1=isIOS$2();function resetScroll(){isIOS$1&&setRootScrollTop(getRootScrollTop())}const stopPropagation=i=>i.stopPropagation();function preventDefault(i,e){(typeof i.cancelable!="boolean"||i.cancelable)&&i.preventDefault(),e&&stopPropagation(i)}function isHidden(i){const e=unref(i);if(!e)return!1;const r=window.getComputedStyle(e),s=r.display==="none",o=e.offsetParent===null&&r.position!=="fixed";return s||o}const{width:windowWidth,height:windowHeight}=useWindowSize();function addUnit(i){if(isDef$1(i))return isNumeric(i)?`${i}px`:String(i)}function getSizeStyle(i){if(isDef$1(i)){if(Array.isArray(i))return{width:addUnit(i[0]),height:addUnit(i[1])};const e=addUnit(i);return{width:e,height:e}}}function getZIndexStyle(i){const e={};return i!==void 0&&(e.zIndex=+i),e}let rootFontSize;function getRootFontSize(){if(!rootFontSize){const i=document.documentElement,e=i.style.fontSize||window.getComputedStyle(i).fontSize;rootFontSize=parseFloat(e)}return rootFontSize}function convertRem(i){return i=i.replace(/rem/g,""),+i*getRootFontSize()}function convertVw(i){return i=i.replace(/vw/g,""),+i*windowWidth.value/100}function convertVh(i){return i=i.replace(/vh/g,""),+i*windowHeight.value/100}function unitToPx(i){if(typeof i=="number")return i;if(inBrowser$2){if(i.includes("rem"))return convertRem(i);if(i.includes("vw"))return convertVw(i);if(i.includes("vh"))return convertVh(i)}return parseFloat(i)}const camelizeRE=/-(\w)/g,camelize$1=i=>i.replace(camelizeRE,(e,r)=>r.toUpperCase()),kebabCase=i=>i.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,""),clamp=(i,e,r)=>Math.min(Math.max(i,e),r);function trimExtraChar(i,e,r){const s=i.indexOf(e);return s===-1?i:e==="-"&&s!==0?i.slice(0,s):i.slice(0,s+1)+i.slice(s).replace(r,"")}function formatNumber(i,e=!0,r=!0){e?i=trimExtraChar(i,".",/\./g):i=i.split(".")[0],r?i=trimExtraChar(i,"-",/-/g):i=i.replace(/-/,"");const s=e?/[^-0-9.]/g:/[^-0-9]/g;return i.replace(s,"")}function addNumber(i,e){return Math.round((i+e)*1e10)/1e10}const{hasOwnProperty:hasOwnProperty$d}=Object.prototype;function assignKey(i,e,r){const s=e[r];isDef$1(s)&&(!hasOwnProperty$d.call(i,r)||!isObject$4(s)?i[r]=s:i[r]=deepAssign(Object(i[r]),s))}function deepAssign(i,e){return Object.keys(e).forEach(r=>{assignKey(i,e,r)}),i}var stdin_default$l={name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(i,e)=>`${i}年${e}月`,rangePrompt:i=>`最多选择 ${i} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:i=>`${i}折`,condition:i=>`满${i}元可用`},vanCouponCell:{title:"优惠券",count:i=>`${i}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const lang=ref("zh-CN"),messages=reactive({"zh-CN":stdin_default$l}),Locale={messages(){return messages[lang.value]},use(i,e){lang.value=i,this.add({[i]:e})},add(i={}){deepAssign(messages,i)}};var stdin_default$k=Locale;function createTranslate(i){const e=camelize$1(i)+".";return(r,...s)=>{const o=stdin_default$k.messages(),a=get(o,e+r)||get(o,r);return isFunction$5(a)?a(...s):a}}function genBem(i,e){return e?typeof e=="string"?` ${i}--${e}`:Array.isArray(e)?e.reduce((r,s)=>r+genBem(i,s),""):Object.keys(e).reduce((r,s)=>r+(e[s]?genBem(i,s):""),""):""}function createBEM(i){return(e,r)=>(e&&typeof e!="string"&&(r=e,e=""),e=e?`${i}__${e}`:i,`${e}${genBem(e,r)}`)}function createNamespace$1(i){const e=`van-${i}`;return[e,createBEM(e),createTranslate(e)]}const BORDER="van-hairline",BORDER_TOP=`${BORDER}--top`,BORDER_LEFT=`${BORDER}--left`,BORDER_BOTTOM=`${BORDER}--bottom`,BORDER_SURROUND=`${BORDER}--surround`,BORDER_TOP_BOTTOM=`${BORDER}--top-bottom`,BORDER_UNSET_TOP_BOTTOM=`${BORDER}-unset--top-bottom`,HAPTICS_FEEDBACK="van-haptics-feedback",FORM_KEY=Symbol("van-form");function callInterceptor(i,{args:e=[],done:r,canceled:s}){if(i){const o=i.apply(null,e);isPromise(o)?o.then(a=>{a?r():s&&s()}).catch(noop$1):o?r():s&&s()}else r()}function withInstall(i){return i.install=e=>{const{name:r}=i;r&&(e.component(r,i),e.component(camelize$1(`-${r}`),i))},i}const POPUP_TOGGLE_KEY=Symbol();function onPopupReopen(i){const e=inject(POPUP_TOGGLE_KEY,null);e&&watch(e,r=>{r&&i()})}const useHeight=(i,e)=>{const r=ref(),s=()=>{r.value=useRect(i).height};return onMounted(()=>{if(nextTick(s),e)for(let o=1;o<=3;o++)setTimeout(s,100*o)}),onPopupReopen(()=>nextTick(s)),watch([windowWidth,windowHeight],s),r};function usePlaceholder(i,e){const r=useHeight(i,!0);return s=>createVNode("div",{class:e("placeholder"),style:{height:r.value?`${r.value}px`:void 0}},[s()])}const[name$k,bem$h]=createNamespace$1("action-bar"),ACTION_BAR_KEY=Symbol(name$k),actionBarProps={placeholder:Boolean,safeAreaInsetBottom:truthProp};var stdin_default$j=defineComponent({name:name$k,props:actionBarProps,setup(i,{slots:e}){const r=ref(),s=usePlaceholder(r,bem$h),{linkChildren:o}=useChildren$1(ACTION_BAR_KEY);o();const a=()=>{var l;return createVNode("div",{ref:r,class:[bem$h(),{"van-safe-area-bottom":i.safeAreaInsetBottom}]},[(l=e.default)==null?void 0:l.call(e)])};return()=>i.placeholder?s(a):a()}});const ActionBar=withInstall(stdin_default$j);function useExpose(i){const e=getCurrentInstance();e&&extend$2(e.proxy,i)}const routeProps={to:[String,Object],url:String,replace:Boolean};function route({to:i,url:e,replace:r,$router:s}){i&&s?s[r?"replace":"push"](i):e&&(r?location.replace(e):location.href=e)}function useRoute(){const i=getCurrentInstance().proxy;return()=>route(i)}const[name$j,bem$g]=createNamespace$1("badge"),badgeProps={dot:Boolean,max:numericProp,tag:makeStringProp("div"),color:String,offset:Array,content:numericProp,showZero:truthProp,position:makeStringProp("top-right")};var stdin_default$i=defineComponent({name:name$j,props:badgeProps,setup(i,{slots:e}){const r=()=>{if(e.content)return!0;const{content:u,showZero:c}=i;return isDef$1(u)&&u!==""&&(c||u!==0&&u!=="0")},s=()=>{const{dot:u,max:c,content:d}=i;if(!u&&r())return e.content?e.content():isDef$1(c)&&isNumeric(d)&&+d>+c?`${c}+`:d},o=u=>u.startsWith("-")?u.replace("-",""):`-${u}`,a=computed(()=>{const u={background:i.color};if(i.offset){const[c,d]=i.offset,{position:y}=i,[m,g]=y.split("-");e.default?(typeof d=="number"?u[m]=addUnit(m==="top"?d:-d):u[m]=m==="top"?addUnit(d):o(d),typeof c=="number"?u[g]=addUnit(g==="left"?c:-c):u[g]=g==="left"?addUnit(c):o(c)):(u.marginTop=addUnit(d),u.marginLeft=addUnit(c))}return u}),l=()=>{if(r()||i.dot)return createVNode("div",{class:bem$g([i.position,{dot:i.dot,fixed:!!e.default}]),style:a.value},[s()])};return()=>{if(e.default){const{tag:u}=i;return createVNode(u,{class:bem$g("wrapper")},{default:()=>[e.default(),l()]})}return l()}}});const Badge=withInstall(stdin_default$i);let globalZIndex=2e3;const useGlobalZIndex=()=>++globalZIndex,setGlobalZIndex=i=>{globalZIndex=i},[name$i,bem$f]=createNamespace$1("config-provider"),CONFIG_PROVIDER_KEY=Symbol(name$i),configProviderProps={tag:makeStringProp("div"),theme:makeStringProp("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,iconPrefix:String};function mapThemeVarsToCSSVars(i){const e={};return Object.keys(i).forEach(r=>{e[`--van-${kebabCase(r)}`]=i[r]}),e}defineComponent({name:name$i,props:configProviderProps,setup(i,{slots:e}){const r=computed(()=>mapThemeVarsToCSSVars(extend$2({},i.themeVars,i.theme==="dark"?i.themeVarsDark:i.themeVarsLight)));if(inBrowser$2){const s=()=>{document.documentElement.classList.add(`van-theme-${i.theme}`)},o=(a=i.theme)=>{document.documentElement.classList.remove(`van-theme-${a}`)};watch(()=>i.theme,(a,l)=>{l&&o(l),s()},{immediate:!0}),onActivated(s),onDeactivated(o),onBeforeUnmount(o)}return provide(CONFIG_PROVIDER_KEY,i),watchEffect(()=>{i.zIndex!==void 0&&setGlobalZIndex(i.zIndex)}),()=>createVNode(i.tag,{class:bem$f(),style:r.value},{default:()=>{var s;return[(s=e.default)==null?void 0:s.call(e)]}})}});const[name$h,bem$e]=createNamespace$1("icon"),isImage=i=>i==null?void 0:i.includes("/"),iconProps={dot:Boolean,tag:makeStringProp("i"),name:String,size:numericProp,badge:numericProp,color:String,badgeProps:Object,classPrefix:String};var stdin_default$h=defineComponent({name:name$h,props:iconProps,setup(i,{slots:e}){const r=inject(CONFIG_PROVIDER_KEY,null),s=computed(()=>i.classPrefix||(r==null?void 0:r.iconPrefix)||bem$e());return()=>{const{tag:o,dot:a,name:l,size:u,badge:c,color:d}=i,y=isImage(l);return createVNode(Badge,mergeProps({dot:a,tag:o,class:[s.value,y?"":`${s.value}-${l}`],style:{color:d,fontSize:addUnit(u)},content:c},i.badgeProps),{default:()=>{var m;return[(m=e.default)==null?void 0:m.call(e),y&&createVNode("img",{class:bem$e("image"),src:l},null)]}})}}});const Icon$1=withInstall(stdin_default$h),[name$g,bem$d]=createNamespace$1("loading"),SpinIcon=Array(12).fill(null).map((i,e)=>createVNode("i",{class:bem$d("line",String(e+1))},null)),CircularIcon=createVNode("svg",{class:bem$d("circular"),viewBox:"25 25 50 50"},[createVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),loadingProps={size:numericProp,type:makeStringProp("circular"),color:String,vertical:Boolean,textSize:numericProp,textColor:String};var stdin_default$g=defineComponent({name:name$g,props:loadingProps,setup(i,{slots:e}){const r=computed(()=>extend$2({color:i.color},getSizeStyle(i.size))),s=()=>{const a=i.type==="spinner"?SpinIcon:CircularIcon;return createVNode("span",{class:bem$d("spinner",i.type),style:r.value},[e.icon?e.icon():a])},o=()=>{var a;if(e.default)return createVNode("span",{class:bem$d("text"),style:{fontSize:addUnit(i.textSize),color:(a=i.textColor)!=null?a:i.color}},[e.default()])};return()=>{const{type:a,vertical:l}=i;return createVNode("div",{class:bem$d([a,{vertical:l}]),"aria-live":"polite","aria-busy":!0},[s(),o()])}}});const Loading$1=withInstall(stdin_default$g),[name$f,bem$c]=createNamespace$1("button"),buttonProps=extend$2({},routeProps,{tag:makeStringProp("button"),text:String,icon:String,type:makeStringProp("default"),size:makeStringProp("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:makeStringProp("button"),loadingSize:numericProp,loadingText:String,loadingType:String,iconPosition:makeStringProp("left")});var stdin_default$f=defineComponent({name:name$f,props:buttonProps,emits:["click"],setup(i,{emit:e,slots:r}){const s=useRoute(),o=()=>r.loading?r.loading():createVNode(Loading$1,{size:i.loadingSize,type:i.loadingType,class:bem$c("loading")},null),a=()=>{if(i.loading)return o();if(r.icon)return createVNode("div",{class:bem$c("icon")},[r.icon()]);if(i.icon)return createVNode(Icon$1,{name:i.icon,class:bem$c("icon"),classPrefix:i.iconPrefix},null)},l=()=>{let d;if(i.loading?d=i.loadingText:d=r.default?r.default():i.text,d)return createVNode("span",{class:bem$c("text")},[d])},u=()=>{const{color:d,plain:y}=i;if(d){const m={color:y?d:"white"};return y||(m.background=d),d.includes("gradient")?m.border=0:m.borderColor=d,m}},c=d=>{i.loading?preventDefault(d):i.disabled||(e("click",d),s())};return()=>{const{tag:d,type:y,size:m,block:g,round:v,plain:b,square:S,loading:x,disabled:A,hairline:E,nativeType:w,iconPosition:_}=i,T=[bem$c([y,m,{plain:b,block:g,round:v,square:S,loading:x,disabled:A,hairline:E}]),{[BORDER_SURROUND]:E}];return createVNode(d,{type:w,class:T,style:u(),disabled:A,onClick:c},{default:()=>[createVNode("div",{class:bem$c("content")},[_==="left"&&a(),l(),_==="right"&&a()])]})}}});const Button$1=withInstall(stdin_default$f),[name$e,bem$b]=createNamespace$1("action-bar-button"),actionBarButtonProps=extend$2({},routeProps,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean});var stdin_default$e=defineComponent({name:name$e,props:actionBarButtonProps,setup(i,{slots:e}){const r=useRoute(),{parent:s,index:o}=useParent$1(ACTION_BAR_KEY),a=computed(()=>{if(s){const u=s.children[o.value-1];return!(u&&"isButton"in u)}}),l=computed(()=>{if(s){const u=s.children[o.value+1];return!(u&&"isButton"in u)}});return useExpose({isButton:!0}),()=>{const{type:u,icon:c,text:d,color:y,loading:m,disabled:g}=i;return createVNode(Button$1,{class:bem$b([u,{last:l.value,first:a.value}]),size:"large",type:u,icon:c,color:y,loading:m,disabled:g,onClick:r},{default:()=>[e.default?e.default():d]})}}});const ActionBarButton=withInstall(stdin_default$e),popupSharedProps={show:Boolean,zIndex:numericProp,overlay:truthProp,duration:numericProp,teleport:[String,Object],lockScroll:truthProp,lazyRender:truthProp,beforeClose:Function,overlayStyle:Object,overlayClass:unknownProp,transitionAppear:Boolean,closeOnClickOverlay:truthProp},popupSharedPropKeys=Object.keys(popupSharedProps);function getDirection(i,e){return i>e?"horizontal":e>i?"vertical":""}function useTouch(){const i=ref(0),e=ref(0),r=ref(0),s=ref(0),o=ref(0),a=ref(0),l=ref(""),u=()=>l.value==="vertical",c=()=>l.value==="horizontal",d=()=>{r.value=0,s.value=0,o.value=0,a.value=0,l.value=""};return{move:g=>{const v=g.touches[0];r.value=(v.clientX<0?0:v.clientX)-i.value,s.value=v.clientY-e.value,o.value=Math.abs(r.value),a.value=Math.abs(s.value);const b=10;(!l.value||o.value{d(),i.value=g.touches[0].clientX,e.value=g.touches[0].clientY},reset:d,startX:i,startY:e,deltaX:r,deltaY:s,offsetX:o,offsetY:a,direction:l,isVertical:u,isHorizontal:c}}let totalLockCount=0;const BODY_LOCK_CLASS="van-overflow-hidden";function useLockScroll(i,e){const r=useTouch(),s="01",o="10",a=y=>{r.move(y);const m=r.deltaY.value>0?o:s,g=getScrollParent(y.target,i.value),{scrollHeight:v,offsetHeight:b,scrollTop:S}=g;let x="11";S===0?x=b>=v?"00":"01":S+b>=v&&(x="10"),x!=="11"&&r.isVertical()&&!(parseInt(x,2)&parseInt(m,2))&&preventDefault(y,!0)},l=()=>{document.addEventListener("touchstart",r.start),document.addEventListener("touchmove",a,{passive:!1}),totalLockCount||document.body.classList.add(BODY_LOCK_CLASS),totalLockCount++},u=()=>{totalLockCount&&(document.removeEventListener("touchstart",r.start),document.removeEventListener("touchmove",a),totalLockCount--,totalLockCount||document.body.classList.remove(BODY_LOCK_CLASS))},c=()=>e()&&l(),d=()=>e()&&u();onMountedOrActivated(c),onDeactivated(d),onBeforeUnmount(d),watch(e,y=>{y?l():u()})}function useLazyRender(i){const e=ref(!1);return watch(i,r=>{r&&(e.value=r)},{immediate:!0}),r=>()=>e.value?r():null}const[name$d,bem$a]=createNamespace$1("overlay"),overlayProps={show:Boolean,zIndex:numericProp,duration:numericProp,className:unknownProp,lockScroll:truthProp,lazyRender:truthProp,customStyle:Object};var stdin_default$d=defineComponent({name:name$d,props:overlayProps,setup(i,{slots:e}){const r=ref(),s=useLazyRender(()=>i.show||!i.lazyRender),o=l=>{i.lockScroll&&preventDefault(l,!0)},a=s(()=>{var l;const u=extend$2(getZIndexStyle(i.zIndex),i.customStyle);return isDef$1(i.duration)&&(u.animationDuration=`${i.duration}s`),withDirectives(createVNode("div",{ref:r,style:u,class:[bem$a(),i.className]},[(l=e.default)==null?void 0:l.call(e)]),[[vShow,i.show]])});return useEventListener$1("touchmove",o,{target:r}),()=>createVNode(Transition,{name:"van-fade",appear:!0},{default:a})}});const Overlay=withInstall(stdin_default$d),popupProps=extend$2({},popupSharedProps,{round:Boolean,position:makeStringProp("center"),closeIcon:makeStringProp("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:makeStringProp("top-right"),safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[name$c,bem$9]=createNamespace$1("popup");var stdin_default$c=defineComponent({name:name$c,inheritAttrs:!1,props:popupProps,emits:["open","close","opened","closed","keydown","update:show","clickOverlay","clickCloseIcon"],setup(i,{emit:e,attrs:r,slots:s}){let o,a;const l=ref(),u=ref(),c=useLazyRender(()=>i.show||!i.lazyRender),d=computed(()=>{const T={zIndex:l.value};if(isDef$1(i.duration)){const C=i.position==="center"?"animationDuration":"transitionDuration";T[C]=`${i.duration}s`}return T}),y=()=>{o||(o=!0,l.value=i.zIndex!==void 0?+i.zIndex:useGlobalZIndex(),e("open"))},m=()=>{o&&callInterceptor(i.beforeClose,{done(){o=!1,e("close"),e("update:show",!1)}})},g=T=>{e("clickOverlay",T),i.closeOnClickOverlay&&m()},v=()=>{if(i.overlay)return createVNode(Overlay,{show:i.show,class:i.overlayClass,zIndex:l.value,duration:i.duration,customStyle:i.overlayStyle,role:i.closeOnClickOverlay?"button":void 0,tabindex:i.closeOnClickOverlay?0:void 0,onClick:g},{default:s["overlay-content"]})},b=T=>{e("clickCloseIcon",T),m()},S=()=>{if(i.closeable)return createVNode(Icon$1,{role:"button",tabindex:0,name:i.closeIcon,class:[bem$9("close-icon",i.closeIconPosition),HAPTICS_FEEDBACK],classPrefix:i.iconPrefix,onClick:b},null)},x=()=>e("opened"),A=()=>e("closed"),E=T=>e("keydown",T),w=c(()=>{var T;const{round:C,position:P,safeAreaInsetTop:k,safeAreaInsetBottom:M}=i;return withDirectives(createVNode("div",mergeProps({ref:u,style:d.value,role:"dialog",tabindex:0,class:[bem$9({round:C,[P]:P}),{"van-safe-area-top":k,"van-safe-area-bottom":M}],onKeydown:E},r),[(T=s.default)==null?void 0:T.call(s),S()]),[[vShow,i.show]])}),_=()=>{const{position:T,transition:C,transitionAppear:P}=i,k=T==="center"?"van-fade":`van-popup-slide-${T}`;return createVNode(Transition,{name:C||k,appear:P,onAfterEnter:x,onAfterLeave:A},{default:w})};return watch(()=>i.show,T=>{T&&!o&&(y(),r.tabindex===0&&nextTick(()=>{var C;(C=u.value)==null||C.focus()})),!T&&o&&(o=!1,e("close"))}),useExpose({popupRef:u}),useLockScroll(u,()=>i.show&&i.lockScroll),useEventListener$1("popstate",()=>{i.closeOnPopstate&&(m(),a=!1)}),onMounted(()=>{i.show&&y()}),onActivated(()=>{a&&(e("update:show",!0),a=!1)}),onDeactivated(()=>{i.show&&i.teleport&&(m(),a=!0)}),provide(POPUP_TOGGLE_KEY,()=>i.show),()=>i.teleport?createVNode(Teleport,{to:i.teleport},{default:()=>[v(),_()]}):createVNode(Fragment,null,[v(),_()])}});const Popup=withInstall(stdin_default$c);let current=0;function useId(){const i=getCurrentInstance(),{name:e="unknown"}=(i==null?void 0:i.type)||{};return`${e}-${++current}`}let lockCount=0;function lockClick(i){i?(lockCount||document.body.classList.add("van-toast--unclickable"),lockCount++):lockCount&&(lockCount--,lockCount||document.body.classList.remove("van-toast--unclickable"))}const[name$b,bem$8]=createNamespace$1("toast"),popupInheritProps=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay"],toastProps={icon:String,show:Boolean,type:makeStringProp("text"),overlay:Boolean,message:numericProp,iconSize:numericProp,duration:makeNumberProp(2e3),position:makeStringProp("middle"),teleport:[String,Object],wordBreak:String,className:unknownProp,iconPrefix:String,transition:makeStringProp("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:unknownProp,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean};var stdin_default$b=defineComponent({name:name$b,props:toastProps,emits:["update:show"],setup(i,{emit:e,slots:r}){let s,o=!1;const a=()=>{const m=i.show&&i.forbidClick;o!==m&&(o=m,lockClick(o))},l=m=>e("update:show",m),u=()=>{i.closeOnClick&&l(!1)},c=()=>clearTimeout(s),d=()=>{const{icon:m,type:g,iconSize:v,iconPrefix:b,loadingType:S}=i;if(m||g==="success"||g==="fail")return createVNode(Icon$1,{name:m||g,size:v,class:bem$8("icon"),classPrefix:b},null);if(g==="loading")return createVNode(Loading$1,{class:bem$8("loading"),size:v,type:S},null)},y=()=>{const{type:m,message:g}=i;if(r.message)return createVNode("div",{class:bem$8("text")},[r.message()]);if(isDef$1(g)&&g!=="")return m==="html"?createVNode("div",{key:0,class:bem$8("text"),innerHTML:String(g)},null):createVNode("div",{class:bem$8("text")},[g])};return watch(()=>[i.show,i.forbidClick],a),watch(()=>[i.show,i.type,i.message,i.duration],()=>{c(),i.show&&i.duration>0&&(s=setTimeout(()=>{l(!1)},i.duration))}),onMounted(a),onUnmounted(a),()=>createVNode(Popup,mergeProps({class:[bem$8([i.position,i.wordBreak==="normal"?"break-normal":i.wordBreak,{[i.type]:!i.icon}]),i.className],lockScroll:!1,onClick:u,onClosed:c,"onUpdate:show":l},pick$1(i,popupInheritProps)),{default:()=>[d(),y()]})}});function usePopupState(){const i=reactive({show:!1}),e=o=>{i.show=o},r=o=>{extend$2(i,o,{transitionAppear:!0}),e(!0)},s=()=>e(!1);return useExpose({open:r,close:s,toggle:e}),{open:r,close:s,state:i,toggle:e}}function mountComponent(i){const e=createApp(i),r=document.createElement("div");return document.body.appendChild(r),{instance:e.mount(r),unmount(){e.unmount(),document.body.removeChild(r)}}}const defaultOptions$1={icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1};let queue=[],allowMultiple=!1,currentOptions$1=extend$2({},defaultOptions$1);const defaultOptionsMap=new Map;function parseOptions(i){return isObject$4(i)?i:{message:i}}function createInstance(){const{instance:i,unmount:e}=mountComponent({setup(){const r=ref(""),{open:s,state:o,close:a,toggle:l}=usePopupState(),u=()=>{},c=()=>createVNode(stdin_default$b,mergeProps(o,{onClosed:u,"onUpdate:show":l}),null);return watch(r,d=>{o.message=d}),getCurrentInstance().render=c,{open:s,close:a,message:r}}});return i}function getInstance(){if(!queue.length||allowMultiple){const i=createInstance();queue.push(i)}return queue[queue.length-1]}function showToast(i={}){if(!inBrowser$2)return{};const e=getInstance(),r=parseOptions(i);return e.open(extend$2({},currentOptions$1,defaultOptionsMap.get(r.type||currentOptions$1.type),r)),e}const createMethod=i=>e=>showToast(extend$2({type:i},parseOptions(e))),showLoadingToast=createMethod("loading"),closeToast=i=>{queue.length&&(i?(queue.forEach(e=>{e.close()}),queue=[]):queue[0].close())};withInstall(stdin_default$b);const[name$a,bem$7]=createNamespace$1("empty"),emptyProps={image:makeStringProp("default"),imageSize:[Number,String,Array],description:String};var stdin_default$a=defineComponent({name:name$a,props:emptyProps,setup(i,{slots:e}){const r=()=>{const A=e.description?e.description():i.description;if(A)return createVNode("p",{class:bem$7("description")},[A])},s=()=>{if(e.default)return createVNode("div",{class:bem$7("bottom")},[e.default()])},o=useId(),a=A=>`${o}-${A}`,l=A=>`url(#${a(A)})`,u=(A,E,w)=>createVNode("stop",{"stop-color":A,offset:`${E}%`,"stop-opacity":w},null),c=(A,E)=>[u(A,0),u(E,100)],d=A=>[createVNode("defs",null,[createVNode("radialGradient",{id:a(A),cx:"50%",cy:"54%",fx:"50%",fy:"54%",r:"297%",gradientTransform:"matrix(-.16 0 0 -.33 .58 .72)"},[u("#EBEDF0",0),u("#F2F3F5",100,.3)])]),createVNode("ellipse",{fill:l(A),opacity:".8",cx:"80",cy:"140",rx:"46",ry:"8"},null)],y=()=>[createVNode("defs",null,[createVNode("linearGradient",{id:a("a"),x1:"64%",y1:"100%",x2:"64%"},[u("#FFF",0,.5),u("#F2F3F5",100)])]),createVNode("g",{opacity:".8"},[createVNode("path",{d:"M36 131V53H16v20H2v58h34z",fill:l("a")},null),createVNode("path",{d:"M123 15h22v14h9v77h-31V15z",fill:l("a")},null)])],m=()=>[createVNode("defs",null,[createVNode("linearGradient",{id:a("b"),x1:"64%",y1:"97%",x2:"64%",y2:"0%"},[u("#F2F3F5",0,.3),u("#F2F3F5",100)])]),createVNode("g",{opacity:".8"},[createVNode("path",{d:"M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",fill:l("b")},null),createVNode("path",{d:"M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",fill:l("b")},null)])],g=()=>createVNode("svg",{viewBox:"0 0 160 160"},[createVNode("defs",null,[createVNode("linearGradient",{id:a(1),x1:"64%",y1:"100%",x2:"64%"},[u("#FFF",0,.5),u("#F2F3F5",100)]),createVNode("linearGradient",{id:a(2),x1:"50%",x2:"50%",y2:"84%"},[u("#EBEDF0",0),u("#DCDEE0",100,0)]),createVNode("linearGradient",{id:a(3),x1:"100%",x2:"100%",y2:"100%"},[c("#EAEDF0","#DCDEE0")]),createVNode("radialGradient",{id:a(4),cx:"50%",cy:"0%",fx:"50%",fy:"0%",r:"100%",gradientTransform:"matrix(0 1 -.54 0 .5 -.5)"},[u("#EBEDF0",0),u("#FFF",100,0)])]),createVNode("g",{fill:"none"},[y(),createVNode("path",{fill:l(4),d:"M0 139h160v21H0z"},null),createVNode("path",{d:"M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",fill:l(2)},null),createVNode("g",{opacity:".6","stroke-linecap":"round","stroke-width":"7"},[createVNode("path",{d:"M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",stroke:l(3)},null),createVNode("path",{d:"M53 36a34 34 0 0 0 0 48",stroke:l(3)},null),createVNode("path",{d:"M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",stroke:l(3)},null),createVNode("path",{d:"M106 84a34 34 0 0 0 0-48",stroke:l(3)},null)]),createVNode("g",{transform:"translate(31 105)"},[createVNode("rect",{fill:"#EBEDF0",width:"98",height:"34",rx:"2"},null),createVNode("rect",{fill:"#FFF",x:"9",y:"8",width:"80",height:"18",rx:"1.1"},null),createVNode("rect",{fill:"#EBEDF0",x:"15",y:"12",width:"18",height:"6",rx:"1.1"},null)])])]),v=()=>createVNode("svg",{viewBox:"0 0 160 160"},[createVNode("defs",null,[createVNode("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:a(5)},[c("#F2F3F5","#DCDEE0")]),createVNode("linearGradient",{x1:"95%",y1:"48%",x2:"5.5%",y2:"51%",id:a(6)},[c("#EAEDF1","#DCDEE0")]),createVNode("linearGradient",{y1:"45%",x2:"100%",y2:"54%",id:a(7)},[c("#EAEDF1","#DCDEE0")])]),y(),m(),createVNode("g",{transform:"translate(36 50)",fill:"none"},[createVNode("g",{transform:"translate(8)"},[createVNode("rect",{fill:"#EBEDF0",opacity:".6",x:"38",y:"13",width:"36",height:"53",rx:"2"},null),createVNode("rect",{fill:l(5),width:"64",height:"66",rx:"2"},null),createVNode("rect",{fill:"#FFF",x:"6",y:"6",width:"52",height:"55",rx:"1"},null),createVNode("g",{transform:"translate(15 17)",fill:l(6)},[createVNode("rect",{width:"34",height:"6",rx:"1"},null),createVNode("path",{d:"M0 14h34v6H0z"},null),createVNode("rect",{y:"28",width:"34",height:"6",rx:"1"},null)])]),createVNode("rect",{fill:l(7),y:"61",width:"88",height:"28",rx:"1"},null),createVNode("rect",{fill:"#F7F8FA",x:"29",y:"72",width:"30",height:"6",rx:"1"},null)])]),b=()=>createVNode("svg",{viewBox:"0 0 160 160"},[createVNode("defs",null,[createVNode("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:a(8)},[c("#EAEDF1","#DCDEE0")])]),y(),m(),d("c"),createVNode("path",{d:"m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",fill:l(8)},null)]),S=()=>createVNode("svg",{viewBox:"0 0 160 160"},[createVNode("defs",null,[createVNode("linearGradient",{x1:"50%",y1:"100%",x2:"50%",id:a(9)},[c("#EEE","#D8D8D8")]),createVNode("linearGradient",{x1:"100%",y1:"50%",y2:"50%",id:a(10)},[c("#F2F3F5","#DCDEE0")]),createVNode("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:a(11)},[c("#F2F3F5","#DCDEE0")]),createVNode("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:a(12)},[c("#FFF","#F7F8FA")])]),y(),m(),d("d"),createVNode("g",{transform:"rotate(-45 113 -4)",fill:"none"},[createVNode("rect",{fill:l(9),x:"24",y:"52.8",width:"5.8",height:"19",rx:"1"},null),createVNode("rect",{fill:l(10),x:"22.1",y:"67.3",width:"9.9",height:"28",rx:"1"},null),createVNode("circle",{stroke:l(11),"stroke-width":"8",cx:"27",cy:"27",r:"27"},null),createVNode("circle",{fill:l(12),cx:"27",cy:"27",r:"16"},null),createVNode("path",{d:"M37 7c-8 0-15 5-16 12",stroke:l(11),"stroke-width":"3",opacity:".5","stroke-linecap":"round",transform:"rotate(45 29 13)"},null)])]),x=()=>{var A;if(e.image)return e.image();const E={error:b,search:S,network:g,default:v};return((A=E[i.image])==null?void 0:A.call(E))||createVNode("img",{src:i.image},null)};return()=>createVNode("div",{class:bem$7()},[createVNode("div",{class:bem$7("image"),style:getSizeStyle(i.imageSize)},[x()]),r(),s()])}});const Empty=withInstall(stdin_default$a),[name$9,bem$6,t]=createNamespace$1("dialog"),dialogProps=extend$2({},popupSharedProps,{title:String,theme:String,width:numericProp,message:[String,Function],callback:Function,allowHtml:Boolean,className:unknownProp,transition:makeStringProp("van-dialog-bounce"),messageAlign:String,closeOnPopstate:truthProp,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,cancelButtonDisabled:Boolean,confirmButtonText:String,confirmButtonColor:String,confirmButtonDisabled:Boolean,showConfirmButton:truthProp,closeOnClickOverlay:Boolean}),popupInheritKeys=[...popupSharedPropKeys,"transition","closeOnPopstate"];var stdin_default$9=defineComponent({name:name$9,props:dialogProps,emits:["confirm","cancel","keydown","update:show"],setup(i,{emit:e,slots:r}){const s=ref(),o=reactive({confirm:!1,cancel:!1}),a=A=>e("update:show",A),l=A=>{var E;a(!1),(E=i.callback)==null||E.call(i,A)},u=A=>()=>{i.show&&(e(A),i.beforeClose?(o[A]=!0,callInterceptor(i.beforeClose,{args:[A],done(){l(A),o[A]=!1},canceled(){o[A]=!1}})):l(A))},c=u("cancel"),d=u("confirm"),y=withKeys(A=>{var E,w;if(A.target!==((w=(E=s.value)==null?void 0:E.popupRef)==null?void 0:w.value))return;({Enter:i.showConfirmButton?d:noop$1,Escape:i.showCancelButton?c:noop$1})[A.key](),e("keydown",A)},["enter","esc"]),m=()=>{const A=r.title?r.title():i.title;if(A)return createVNode("div",{class:bem$6("header",{isolated:!i.message&&!r.default})},[A])},g=A=>{const{message:E,allowHtml:w,messageAlign:_}=i,T=bem$6("message",{"has-title":A,[_]:_}),C=isFunction$5(E)?E():E;return w&&typeof C=="string"?createVNode("div",{class:T,innerHTML:C},null):createVNode("div",{class:T},[C])},v=()=>{if(r.default)return createVNode("div",{class:bem$6("content")},[r.default()]);const{title:A,message:E,allowHtml:w}=i;if(E){const _=!!(A||r.title);return createVNode("div",{key:w?1:0,class:bem$6("content",{isolated:!_})},[g(_)])}},b=()=>createVNode("div",{class:[BORDER_TOP,bem$6("footer")]},[i.showCancelButton&&createVNode(Button$1,{size:"large",text:i.cancelButtonText||t("cancel"),class:bem$6("cancel"),style:{color:i.cancelButtonColor},loading:o.cancel,disabled:i.cancelButtonDisabled,onClick:c},null),i.showConfirmButton&&createVNode(Button$1,{size:"large",text:i.confirmButtonText||t("confirm"),class:[bem$6("confirm"),{[BORDER_LEFT]:i.showCancelButton}],style:{color:i.confirmButtonColor},loading:o.confirm,disabled:i.confirmButtonDisabled,onClick:d},null)]),S=()=>createVNode(ActionBar,{class:bem$6("footer")},{default:()=>[i.showCancelButton&&createVNode(ActionBarButton,{type:"warning",text:i.cancelButtonText||t("cancel"),class:bem$6("cancel"),color:i.cancelButtonColor,loading:o.cancel,disabled:i.cancelButtonDisabled,onClick:c},null),i.showConfirmButton&&createVNode(ActionBarButton,{type:"danger",text:i.confirmButtonText||t("confirm"),class:bem$6("confirm"),color:i.confirmButtonColor,loading:o.confirm,disabled:i.confirmButtonDisabled,onClick:d},null)]}),x=()=>r.footer?r.footer():i.theme==="round-button"?S():b();return()=>{const{width:A,title:E,theme:w,message:_,className:T}=i;return createVNode(Popup,mergeProps({ref:s,role:"dialog",class:[bem$6([w]),T],style:{width:addUnit(A)},tabindex:0,"aria-labelledby":E||_,onKeydown:y,"onUpdate:show":a},pick$1(i,popupInheritKeys)),{default:()=>[m(),v(),x()]})}}});let instance$1;const DEFAULT_OPTIONS={title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,cancelButtonDisabled:!1,confirmButtonText:"",confirmButtonColor:null,confirmButtonDisabled:!1,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1};let currentOptions=extend$2({},DEFAULT_OPTIONS);function initInstance(){({instance:instance$1}=mountComponent({setup(){const{state:e,toggle:r}=usePopupState();return()=>createVNode(stdin_default$9,mergeProps(e,{"onUpdate:show":r}),null)}}))}function showDialog(i){return inBrowser$2?new Promise((e,r)=>{instance$1||initInstance(),instance$1.open(extend$2({},currentOptions,i,{callback:s=>{(s==="confirm"?e:r)(s)}}))}):Promise.resolve()}const showConfirmDialog=i=>showDialog(extend$2({showCancelButton:!0},i));withInstall(stdin_default$9);const[name$8,bem$5]=createNamespace$1("nav-bar"),navBarProps={title:String,fixed:Boolean,zIndex:numericProp,border:truthProp,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:truthProp};var stdin_default$8=defineComponent({name:name$8,props:navBarProps,emits:["clickLeft","clickRight"],setup(i,{emit:e,slots:r}){const s=ref(),o=usePlaceholder(s,bem$5),a=y=>e("clickLeft",y),l=y=>e("clickRight",y),u=()=>r.left?r.left():[i.leftArrow&&createVNode(Icon$1,{class:bem$5("arrow"),name:"arrow-left"},null),i.leftText&&createVNode("span",{class:bem$5("text")},[i.leftText])],c=()=>r.right?r.right():createVNode("span",{class:bem$5("text")},[i.rightText]),d=()=>{const{title:y,fixed:m,border:g,zIndex:v}=i,b=getZIndexStyle(v),S=i.leftArrow||i.leftText||r.left,x=i.rightText||r.right;return createVNode("div",{ref:s,style:b,class:[bem$5({fixed:m}),{[BORDER_BOTTOM]:g,"van-safe-area-top":i.safeAreaInsetTop}]},[createVNode("div",{class:bem$5("content")},[S&&createVNode("div",{class:[bem$5("left"),i.clickable?HAPTICS_FEEDBACK:""],onClick:a},[u()]),createVNode("div",{class:[bem$5("title"),"van-ellipsis"]},[r.title?r.title():y]),x&&createVNode("div",{class:[bem$5("right"),i.clickable?HAPTICS_FEEDBACK:""],onClick:l},[c()])])])};return()=>i.fixed&&i.placeholder?o(d):d()}});const NavBar=withInstall(stdin_default$8),[name$7,bem$4]=createNamespace$1("notice-bar"),noticeBarProps={text:String,mode:String,color:String,delay:makeNumericProp(1),speed:makeNumericProp(60),leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null}};var stdin_default$7=defineComponent({name:name$7,props:noticeBarProps,emits:["close","replay"],setup(i,{emit:e,slots:r}){let s=0,o=0,a;const l=ref(),u=ref(),c=reactive({show:!0,offset:0,duration:0}),d=()=>{if(r["left-icon"])return r["left-icon"]();if(i.leftIcon)return createVNode(Icon$1,{class:bem$4("left-icon"),name:i.leftIcon},null)},y=()=>{if(i.mode==="closeable")return"cross";if(i.mode==="link")return"arrow"},m=x=>{i.mode==="closeable"&&(c.show=!1,e("close",x))},g=()=>{if(r["right-icon"])return r["right-icon"]();const x=y();if(x)return createVNode(Icon$1,{name:x,class:bem$4("right-icon"),onClick:m},null)},v=()=>{c.offset=s,c.duration=0,raf(()=>{doubleRaf(()=>{c.offset=-o,c.duration=(o+s)/+i.speed,e("replay")})})},b=()=>{const x=i.scrollable===!1&&!i.wrapable,A={transform:c.offset?`translateX(${c.offset}px)`:"",transitionDuration:`${c.duration}s`};return createVNode("div",{ref:l,role:"marquee",class:bem$4("wrap")},[createVNode("div",{ref:u,style:A,class:[bem$4("content"),{"van-ellipsis":x}],onTransitionend:v},[r.default?r.default():i.text])])},S=()=>{const{delay:x,speed:A,scrollable:E}=i,w=isDef$1(x)?+x*1e3:0;s=0,o=0,c.offset=0,c.duration=0,clearTimeout(a),a=setTimeout(()=>{if(!l.value||!u.value||E===!1)return;const _=useRect(l).width,T=useRect(u).width;(E||T>_)&&doubleRaf(()=>{s=_,o=T,c.offset=-o,c.duration=o/+A})},w)};return onPopupReopen(S),onMountedOrActivated(S),useEventListener$1("pageshow",S),useExpose({reset:S}),watch(()=>[i.text,i.scrollable],S),()=>{const{color:x,wrapable:A,background:E}=i;return withDirectives(createVNode("div",{role:"alert",class:bem$4({wrapable:A}),style:{color:x,background:E}},[d(),b(),g()]),[[vShow,c.show]])}}});const NoticeBar=withInstall(stdin_default$7),[name$6,bem$3]=createNamespace$1("skeleton-title"),skeletonTitleProps={round:Boolean,titleWidth:numericProp};var stdin_default$6=defineComponent({name:name$6,props:skeletonTitleProps,setup(i){return()=>createVNode("h3",{class:bem$3([{round:i.round}]),style:{width:addUnit(i.titleWidth)}},null)}});const SkeletonTitle=withInstall(stdin_default$6);var stdin_default$5=SkeletonTitle;const[name$5,bem$2]=createNamespace$1("skeleton-avatar"),skeletonAvatarProps={avatarSize:numericProp,avatarShape:makeStringProp("round")};var stdin_default$4=defineComponent({name:name$5,props:skeletonAvatarProps,setup(i){return()=>createVNode("div",{class:bem$2([i.avatarShape]),style:getSizeStyle(i.avatarSize)},null)}});const SkeletonAvatar=withInstall(stdin_default$4);var stdin_default$3=SkeletonAvatar;const DEFAULT_ROW_WIDTH="100%",skeletonParagraphProps={round:Boolean,rowWidth:{type:numericProp,default:DEFAULT_ROW_WIDTH}},[name$4,bem$1]=createNamespace$1("skeleton-paragraph");var stdin_default$2=defineComponent({name:name$4,props:skeletonParagraphProps,setup(i){return()=>createVNode("div",{class:bem$1([{round:i.round}]),style:{width:i.rowWidth}},null)}});const SkeletonParagraph=withInstall(stdin_default$2);var stdin_default$1=SkeletonParagraph;const[name$3,bem]=createNamespace$1("skeleton"),DEFAULT_LAST_ROW_WIDTH="60%",skeletonProps={row:makeNumericProp(0),round:Boolean,title:Boolean,titleWidth:numericProp,avatar:Boolean,avatarSize:numericProp,avatarShape:makeStringProp("round"),loading:truthProp,animate:truthProp,rowWidth:{type:[Number,String,Array],default:DEFAULT_ROW_WIDTH}};var stdin_default=defineComponent({name:name$3,inheritAttrs:!1,props:skeletonProps,setup(i,{slots:e,attrs:r}){const s=()=>{if(i.avatar)return createVNode(stdin_default$3,{avatarShape:i.avatarShape,avatarSize:i.avatarSize},null)},o=()=>{if(i.title)return createVNode(stdin_default$5,{round:i.round,titleWidth:i.titleWidth},null)},a=c=>{const{rowWidth:d}=i;return d===DEFAULT_ROW_WIDTH&&c===+i.row-1?DEFAULT_LAST_ROW_WIDTH:Array.isArray(d)?d[c]:d},l=()=>Array(+i.row).fill("").map((c,d)=>createVNode(stdin_default$1,{key:d,round:i.round,rowWidth:addUnit(a(d))},null)),u=()=>e.template?e.template():createVNode(Fragment,null,[s(),createVNode("div",{class:bem("content")},[o(),l()])]);return()=>{var c;return i.loading?createVNode("div",mergeProps({class:bem({animate:i.animate,round:i.round})},r),[u()]):(c=e.default)==null?void 0:c.call(e)}}});const Skeleton=withInstall(stdin_default),storeData=reactive({status:"init",user:{},platformType:"STUDENT",platformApi:"/api-student",proxy:"",isApp:!1}),setStoreData=i=>{Object.assign(storeData,i)},setUserInfo=i=>{storeData.status="login",storeData.user=i||{}};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getAugmentedNamespace(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var r=function s(){if(this instanceof s){var o=[null];o.push.apply(o,arguments);var a=Function.bind.apply(e,o);return new a}return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var o=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(r,s,o.get?o:{enumerable:!0,get:function(){return i[s]}})}),r}var assign$1=make_assign(),create$1=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$i={assign:assign$1,create:create$1,trim:trim$1,bind:bind$3,slice:slice$3,each:each$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$4,isObject:isObject$3,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,r,s,o){for(var a=1;a"u"?null:console;if(i){var e=i.warn?i.warn:i.log;e.apply(i,arguments)}}function createStore(i,e,r){r||(r=""),i&&!isList(i)&&(i=[i]),e&&!isList(e)&&(e=[e]);var s=r?"__storejs_"+r+"_":"",o=r?new RegExp("^"+s):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(r))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var l={_namespacePrefix:s,_namespaceRegexp:o,_testStorage:function(c){try{var d="__storejs__test__";c.write(d,d);var y=c.read(d)===d;return c.remove(d),y}catch(m){return!1}},_assignPluginFnProp:function(c,d){var y=this[d];this[d]=function(){var g=slice$2(arguments,0),v=this;function b(){if(y)return each$7(arguments,function(x,A){g[A]=x}),y.apply(v,g)}var S=[b].concat(g);return c.apply(v,S)}},_serialize:function(c){return JSON.stringify(c)},_deserialize:function(c,d){if(!c)return d;var y="";try{y=JSON.parse(c)}catch(m){y=c}return y!==void 0?y:d},_addStorage:function(c){this.enabled||this._testStorage(c)&&(this.storage=c,this.enabled=!0)},_addPlugin:function(c){var d=this;if(isList(c)){each$7(c,function(g){d._addPlugin(g)});return}var y=pluck(this.plugins,function(g){return c===g});if(!y){if(this.plugins.push(c),!isFunction$3(c))throw new Error("Plugins must be function values that return objects");var m=c.call(this);if(!isObject$2(m))throw new Error("Plugins must return an object of function properties");each$7(m,function(g,v){if(!isFunction$3(g))throw new Error("Bad plugin property: "+v+" from plugin "+c.name+". Plugins should only return functions.");d._assignPluginFnProp(g,v)})}},addStorage:function(c){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(c)}},u=create(l,storeAPI,{plugins:[]});return u.raw={},each$7(u,function(c,d){isFunction$3(c)&&(u.raw[d]=bind$2(u,c))}),each$7(i,function(c){u._addStorage(c)}),each$7(e,function(c){u._addPlugin(c)}),u}var util$g=util$i,Global$4=util$g.Global,localStorage_1={name:"localStorage",read:read$5,write:write$5,each:each$6,remove:remove$6,clearAll:clearAll$5};function localStorage$1(){return Global$4.localStorage}function read$5(i){return localStorage$1().getItem(i)}function write$5(i,e){return localStorage$1().setItem(i,e)}function each$6(i){for(var e=localStorage$1().length-1;e>=0;e--){var r=localStorage$1().key(e);i(read$5(r),r)}}function remove$6(i){return localStorage$1().removeItem(i)}function clearAll$5(){return localStorage$1().clear()}var util$f=util$i,Global$3=util$f.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$4,write:write$4,each:each$5,remove:remove$5,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$4(i){return globalStorage[i]}function write$4(i,e){globalStorage[i]=e}function each$5(i){for(var e=globalStorage.length-1;e>=0;e--){var r=globalStorage.key(e);i(globalStorage[r],r)}}function remove$5(i){return globalStorage.removeItem(i)}function clearAll$4(){each$5(function(i,e){delete globalStorage[i]})}var util$e=util$i,Global$2=util$e.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$3,read:read$3,each:each$4,remove:remove$4,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable$1=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$3(i,e){if(!disable$1){var r=fixKey(i);_withStorageEl(function(s){s.setAttribute(r,e),s.save(storageName)})}}function read$3(i){if(!disable$1){var e=fixKey(i),r=null;return _withStorageEl(function(s){r=s.getAttribute(e)}),r}}function each$4(i){_withStorageEl(function(e){for(var r=e.XMLDocument.documentElement.attributes,s=r.length-1;s>=0;s--){var o=r[s];i(e.getAttribute(o.name),o.name)}})}function remove$4(i){var e=fixKey(i);_withStorageEl(function(r){r.removeAttribute(e),r.save(storageName)})}function clearAll$3(){_withStorageEl(function(i){var e=i.XMLDocument.documentElement.attributes;i.load(storageName);for(var r=e.length-1;r>=0;r--)i.removeAttribute(e[r].name);i.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(i){return i.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var i="script",e,r,s;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+i+">document.w=window'),r.close(),e=r.w.frames[0].document,s=e.createElement("div")}catch(o){s=doc$1.createElement("div"),e=doc$1.body}return function(o){var a=[].slice.call(arguments,0);a.unshift(s),e.appendChild(s),s.addBehavior("#default#userData"),s.load(storageName),o.apply(this,a),e.removeChild(s)}}var util$d=util$i,Global$1=util$d.Global,trim=util$d.trim,cookieStorage={name:"cookieStorage",read:read$2,write:write$2,each:each$3,remove:remove$3,clearAll:clearAll$2},doc=Global$1.document;function read$2(i){if(!i||!_has(i))return null;var e="(?:^|.*;\\s*)"+escape(i).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$3(i){for(var e=doc.cookie.split(/; ?/g),r=e.length-1;r>=0;r--)if(trim(e[r])){var s=e[r].split("="),o=unescape(s[0]),a=unescape(s[1]);i(a,o)}}function write$2(i,e){i&&(doc.cookie=escape(i)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$3(i){!i||!_has(i)||(doc.cookie=escape(i)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(i,e){remove$3(e)})}function _has(i){return new RegExp("(?:^|;\\s*)"+escape(i).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$c=util$i,Global=util$c.Global,sessionStorage_1={name:"sessionStorage",read:read$1,write:write$1,each:each$2,remove:remove$2,clearAll:clearAll$1};function sessionStorage$1(){return Global.sessionStorage}function read$1(i){return sessionStorage$1().getItem(i)}function write$1(i,e){return sessionStorage$1().setItem(i,e)}function each$2(i){for(var e=sessionStorage$1().length-1;e>=0;e--){var r=sessionStorage$1().key(e);i(read$1(r),r)}}function remove$2(i){return sessionStorage$1().removeItem(i)}function clearAll$1(){return sessionStorage$1().clear()}var memoryStorage_1={name:"memoryStorage",read,write,each:each$1,remove:remove$1,clearAll},memoryStorage={};function read(i){return memoryStorage[i]}function write(i,e){memoryStorage[i]=e}function each$1(i){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&i(memoryStorage[e],e)}function remove$1(i){delete memoryStorage[i]}function clearAll(i){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(i){return i<10?"0"+i:i}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(i){return rx_escapable.lastIndex=0,rx_escapable.test(i)?'"'+i.replace(rx_escapable,function(e){var r=meta[e];return typeof r=="string"?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'}function str(i,e){var r,s,o,a,l=gap,u,c=e[i];switch(c&&typeof c=="object"&&typeof c.toJSON=="function"&&(c=c.toJSON(i)),typeof rep=="function"&&(c=rep.call(e,i,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,u=[],Object.prototype.toString.apply(c)==="[object Array]"){for(a=c.length,r=0;ri==null,strictUriEncode=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),encodeFragmentIdentifier=Symbol("encodeFragmentIdentifier");function encoderForArrayFormat(i){switch(i.arrayFormat){case"index":return e=>(r,s)=>{const o=r.length;return s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?r:s===null?[...r,[encode$1(e,i),"[",o,"]"].join("")]:[...r,[encode$1(e,i),"[",encode$1(o,i),"]=",encode$1(s,i)].join("")]};case"bracket":return e=>(r,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?r:s===null?[...r,[encode$1(e,i),"[]"].join("")]:[...r,[encode$1(e,i),"[]=",encode$1(s,i)].join("")];case"colon-list-separator":return e=>(r,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?r:s===null?[...r,[encode$1(e,i),":list="].join("")]:[...r,[encode$1(e,i),":list=",encode$1(s,i)].join("")];case"comma":case"separator":case"bracket-separator":{const e=i.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(s,o)=>o===void 0||i.skipNull&&o===null||i.skipEmptyString&&o===""?s:(o=o===null?"":o,s.length===0?[[encode$1(r,i),e,encode$1(o,i)].join("")]:[[s,encode$1(o,i)].join(i.arrayFormatSeparator)])}default:return e=>(r,s)=>s===void 0||i.skipNull&&s===null||i.skipEmptyString&&s===""?r:s===null?[...r,encode$1(e,i)]:[...r,[encode$1(e,i),"=",encode$1(s,i)].join("")]}}function parserForArrayFormat(i){let e;switch(i.arrayFormat){case"index":return(r,s,o)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){o[r]=s;return}o[r]===void 0&&(o[r]={}),o[r][e[1]]=s};case"bracket":return(r,s,o)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){o[r]=s;return}if(o[r]===void 0){o[r]=[s];return}o[r]=[...o[r],s]};case"colon-list-separator":return(r,s,o)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){o[r]=s;return}if(o[r]===void 0){o[r]=[s];return}o[r]=[...o[r],s]};case"comma":case"separator":return(r,s,o)=>{const a=typeof s=="string"&&s.includes(i.arrayFormatSeparator),l=typeof s=="string"&&!a&&decode$3(s,i).includes(i.arrayFormatSeparator);s=l?decode$3(s,i):s;const u=a||l?s.split(i.arrayFormatSeparator).map(c=>decode$3(c,i)):s===null?s:decode$3(s,i);o[r]=u};case"bracket-separator":return(r,s,o)=>{const a=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!a){o[r]=s&&decode$3(s,i);return}const l=s===null?[]:s.split(i.arrayFormatSeparator).map(u=>decode$3(u,i));if(o[r]===void 0){o[r]=l;return}o[r]=[...o[r],...l]};default:return(r,s,o)=>{if(o[r]===void 0){o[r]=s;return}o[r]=[...[o[r]].flat(),s]}}}function validateArrayFormatSeparator(i){if(typeof i!="string"||i.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function encode$1(i,e){return e.encode?e.strict?strictUriEncode(i):encodeURIComponent(i):i}function decode$3(i,e){return e.decode?decodeUriComponent(i):i}function keysSorter(i){return Array.isArray(i)?i.sort():typeof i=="object"?keysSorter(Object.keys(i)).sort((e,r)=>Number(e)-Number(r)).map(e=>i[e]):i}function removeHash(i){const e=i.indexOf("#");return e!==-1&&(i=i.slice(0,e)),i}function getHash(i){let e="";const r=i.indexOf("#");return r!==-1&&(e=i.slice(r)),e}function parseValue(i,e){return e.parseNumbers&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""?i=Number(i):e.parseBooleans&&i!==null&&(i.toLowerCase()==="true"||i.toLowerCase()==="false")&&(i=i.toLowerCase()==="true"),i}function extract(i){i=removeHash(i);const e=i.indexOf("?");return e===-1?"":i.slice(e+1)}function parse$5(i,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},validateArrayFormatSeparator(e.arrayFormatSeparator);const r=parserForArrayFormat(e),s=Object.create(null);if(typeof i!="string"||(i=i.trim().replace(/^[?#&]/,""),!i))return s;for(const o of i.split("&")){if(o==="")continue;const a=e.decode?o.replace(/\+/g," "):o;let[l,u]=splitOnFirst(a,"=");l===void 0&&(l=a),u=u===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?u:decode$3(u,e),r(decode$3(l,e),u,s)}for(const[o,a]of Object.entries(s))if(typeof a=="object"&&a!==null)for(const[l,u]of Object.entries(a))a[l]=parseValue(u,e);else s[o]=parseValue(a,e);return e.sort===!1?s:(e.sort===!0?Object.keys(s).sort():Object.keys(s).sort(e.sort)).reduce((o,a)=>{const l=s[a];return l&&typeof l=="object"&&!Array.isArray(l)?o[a]=keysSorter(l):o[a]=l,o},Object.create(null))}function stringify$2(i,e){if(!i)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},validateArrayFormatSeparator(e.arrayFormatSeparator);const r=l=>e.skipNull&&isNullOrUndefined(i[l])||e.skipEmptyString&&i[l]==="",s=encoderForArrayFormat(e),o={};for(const[l,u]of Object.entries(i))r(l)||(o[l]=u);const a=Object.keys(o);return e.sort!==!1&&a.sort(e.sort),a.map(l=>{const u=i[l];return u===void 0?"":u===null?encode$1(l,e):Array.isArray(u)?u.length===0&&e.arrayFormat==="bracket-separator"?encode$1(l,e)+"[]":u.reduce(s(l),[]).join("&"):encode$1(l,e)+"="+encode$1(u,e)}).filter(l=>l.length>0).join("&")}function parseUrl(i,e){var o,a;e={decode:!0,...e};let[r,s]=splitOnFirst(i,"#");return r===void 0&&(r=i),{url:(a=(o=r==null?void 0:r.split("?"))==null?void 0:o[0])!=null?a:"",query:parse$5(extract(i),e),...e&&e.parseFragmentIdentifier&&s?{fragmentIdentifier:decode$3(s,e)}:{}}}function stringifyUrl(i,e){e={encode:!0,strict:!0,[encodeFragmentIdentifier]:!0,...e};const r=removeHash(i.url).split("?")[0]||"",s=extract(i.url),o={...parse$5(s,{sort:!1}),...i.query};let a=stringify$2(o,e);a&&(a=`?${a}`);let l=getHash(i.url);if(i.fragmentIdentifier){const u=new URL(r);u.hash=i.fragmentIdentifier,l=e[encodeFragmentIdentifier]?u.hash:`#${i.fragmentIdentifier}`}return`${r}${a}${l}`}function pick(i,e,r){r={parseFragmentIdentifier:!0,[encodeFragmentIdentifier]:!1,...r};const{url:s,query:o,fragmentIdentifier:a}=parseUrl(i,r);return stringifyUrl({url:s,query:includeKeys(o,e),fragmentIdentifier:a},r)}function exclude(i,e,r){const s=Array.isArray(e)?o=>!e.includes(o):(o,a)=>!e(o,a);return pick(i,s,r)}const queryString=Object.freeze(Object.defineProperty({__proto__:null,exclude,extract,parse:parse$5,parseUrl,pick,stringify:stringify$2,stringifyUrl},Symbol.toStringTag,{value:"Module"})),getQuery=()=>{let i={};try{i={...queryString.parse(location.search),...queryString.parse(location.hash.split("?")[1])}}catch(e){}return{...i}},browser=()=>{const i=navigator.userAgent,e=/(?:Android)/.test(i),r=/(?:Firefox)/.test(i);function s(){const o=window.navigator.userAgent;let a=!1;if(/ipad/i.test(o)&&(a=!0),o.match(/Macintosh/i)!=null){const u=document.createElement("canvas");if(u!=null){const c=u.getContext("webgl")||u.getContext("experimental-webgl");if(c){const d=c.getExtension("WEBGL_debug_renderer_info");d&&c.getParameter(d.UNMASKED_RENDERER_WEBGL).indexOf("Apple")!=-1&&(a=!0)}}}return a}return{trident:i.indexOf("Trident")>-1,presto:i.indexOf("Presto")>-1,webKit:i.indexOf("AppleWebKit")>-1,gecko:i.indexOf("Gecko")>-1&&i.indexOf("KHTML")==-1,mobile:!!i.match(/AppleWebKit.*Mobile.*/),ios:!!i.match(/Mac OS X/)||/(iPhone|iPad|iPod|iOS)/i.test(i),android:i.indexOf("Android")>-1||i.indexOf("Adr")>-1,iPhone:i.indexOf("ORCHESTRAAPPI")>-1,isApp:i.includes("DAYAAPPA")||i.includes("DAYAAPPI")||i.includes("COLEXIUAPPA")||i.includes("COLEXIUAPPI")||i.includes("ORCHESTRAAPPI")||i.includes("ORCHESTRAAPPA"),isTeacher:i.indexOf("ORCHESTRATEACHER")>-1||i.includes("COLEXIUTEACHER"),isStudent:i.indexOf("ORCHESTRASTUDENT")>-1||i.includes("COLEXIUSTUDENT"),isSchool:i.indexOf("ORCHESTRASCHOOL")>-1,iPad:i.indexOf("iPad")>-1,isTablet:/(?:iPad|PlayBook)/.test(i)||e&&!/(?:Mobile)/.test(i)||r&&/(?:Tablet)/.test(i)||s(),webApp:i.indexOf("Safari")==-1,weixin:i.indexOf("MicroMessenger")>-1,alipay:i.indexOf("AlipayClient")>-1,huawei:!!i.match(/huawei/i)||!!i.match(/honor/i),xiaomi:!!i.match(/mi\s/i)||!!i.match(/redmi/i)||!!i.match(/mix/i)}},getRandomKey=()=>""+Date.now()+Math.floor(Math.random()*1e6),AuthorizationKey="AUTHORIZATION",setToken=i=>{sessionStorage.setItem(AuthorizationKey,i)},getToken=()=>sessionStorage.getItem(AuthorizationKey)||"",setGlobalData=(i,e)=>{if(!i||!e)return;const r=window.GYM||{};r[i]=e,window.GYM=r},BEHAVIORIDKEY="BEHAVIORID",setBehaviorId=i=>{localStorage.setItem(BEHAVIORIDKEY,i)},getBehaviorId=()=>localStorage.getItem(BEHAVIORIDKEY),campIdKey="CAMPID",setCampId=i=>{sessionStorage.setItem(campIdKey,i)},getCampId=()=>sessionStorage.getItem(campIdKey)||"",getSecondRPM=(i,e)=>{if(isNaN(i))return"00:00";let r=Math.floor(i/60/60%24),s=Math.floor(i/60%60),o=Math.floor(i%60);return e==="cn"?`${r>0?r.toString().padStart(2,"0")+"时":""}${s.toString().padStart(2,"0")}分${o.toString().padStart(2,"0")}秒`:`${r>0?r.toString().padStart(2,"0")+":":""}${s.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`},SPEEDKEY="speeds",getStorageSpeed=i=>{const e=store_legacy.get(SPEEDKEY)||{};return console.log("初始速度",e),e[i]||0},matchProductApiUrl=()=>{const i=getQuery(),e={cbs:{dev:"https://dev.resource.colexiu.com",test:"https://test.resource.colexiu.com",online:"https://mec.colexiu.com"},gym:{dev:"https://dev.dayaedu.com",test:"https://test.dayaedu.com",online:"https://online.dayaedu.com"},colexiu:{dev:"https://dev.colexiu.com/",test:"https://test.colexiu.com",online:"https://online.colexiu.com"},orchestra:{dev:"https://dev.lexiaoya.cn",test:"https://test.lexiaoya.cn",online:"https://online.lexiaoya.cn"},instrument:{dev:"https://dev.kt.colexiu.com",test:"https://test.kt.colexiu.com",test2:"https://test.lexiaoya.cn",online:"https://kt.colexiu.com"}};let r=location.origin.includes("//dev")?"dev":location.origin.includes("//test")?"test":location.origin.includes("//online")||location.origin.includes("//kt")||location.origin.includes("//mec")?"online":"dev";if(i.isCbs)return e.cbs[r]+"/cbs-app";{const s=location.pathname.includes("gym")?"gym":location.pathname.includes("colexiu")?"colexiu":location.pathname.includes("orchestra")?"orchestra":"instrument";return s==="instrument"&&r==="test"&&(r=location.origin.includes("//test.kt")?"test":"test2"),e[s][r]+"/edu-app"}},originalPostMessage=window.postMessage;window.postMessage=i=>{originalPostMessage(i,"*")};const loop=()=>{},calls={};var Oi,Vi,Gi,Hi,$i,Ui;const instance=window.DAYA||((Vi=(Oi=window.webkit)==null?void 0:Oi.messageHandlers)==null?void 0:Vi.DAYA)||window.COLEXIU||((Hi=(Gi=window.webkit)==null?void 0:Gi.messageHandlers)==null?void 0:Hi.COLEXIU)||window.ORCHESTRA||((Ui=($i=window.webkit)==null?void 0:$i.messageHandlers)==null?void 0:Ui.ORCHESTRA);instance&&window.addEventListener("message",i=>{var e,r;try{const s=i.data?typeof i.data=="object"?i.data:JSON.parse(i.data):{},o=((e=s.content)==null?void 0:e.uuid)||s.uuid;try{s.content&&(s.content=JSON.parse(s.content))}catch(u){}if(!o){const u=Object.keys(calls).filter(c=>c.indexOf(s.api)===0);for(const c of u){const d=calls[c]||loop;typeof d=="function"&&d(s),Array.isArray(d)&&d.forEach(y=>{typeof y=="function"&&y(s)})}return}const a=((r=s.content)==null?void 0:r.uuid)||s.uuid||s.api+s.uuid,l=calls[a]||loop;typeof l=="function"&&l(s)}catch(s){console.error("通信消息解析错误",s)}});const postMessage=(i,e)=>{if(instance){const r=getRandomKey();calls[r]=e||loop,i.content=i.content?{...i.content,uuid:r}:{uuid:r},instance.postMessage(JSON.stringify(i)),console.log("h5_请求_api:",i)}},listenerMessage=(i,e)=>{const r=i;calls[r]||(calls[r]=[]),calls[r].push(e||loop)},removeListenerMessage=(i,e)=>{const r=i;if(Array.isArray(calls[r])){const s=calls[r].indexOf(e);calls[r].splice(s,1)}},promisefiyPostMessage=i=>new Promise(e=>{postMessage(i,r=>e(r))}),getEarphone=()=>storeData.isApp?promisefiyPostMessage({api:"isWiredHeadsetOn"}):Promise.resolve({}),isSpecialShapedScreen=()=>storeData.isApp?promisefiyPostMessage({api:"isSpecialShapedScreen"}):Promise.resolve({}),sendResult=i=>{listenerMessage("sendResult",i)},removeResult=i=>{removeListenerMessage("sendResult",i)},endSoundCheck=()=>{postMessage({api:"endSoundCheck"})},startEvaluating=i=>storeData.isApp?promisefiyPostMessage({api:"startEvaluating",content:i}):Promise.resolve({}),endEvaluating=i=>storeData.isApp?promisefiyPostMessage({api:"endEvaluating",content:i}):Promise.resolve({}),cancelEvaluating=()=>{postMessage({api:"cancelEvaluating"})},api_startRecordingCb=(i,e)=>{postMessage({api:"startRecording",content:i},e)},api_proxyServiceMessage=i=>storeData.isApp?promisefiyPostMessage({api:"proxyServiceMessage",content:i}):Promise.resolve({}),api_recordStartTime=i=>{listenerMessage("recordStartTime",i)},api_remove_recordStartTime=i=>{removeListenerMessage("recordStartTime",i)},api_videoUpdate=i=>{postMessage({api:"videoUpdate"},i)},api_shareAchievements=i=>storeData.isApp?promisefiyPostMessage({api:"shareAchievements",content:i}):Promise.resolve({}),api_openWebView=i=>storeData.isApp?promisefiyPostMessage({api:"openWebView",content:i}):Promise.resolve({}),api_openCamera=()=>storeData.isApp?promisefiyPostMessage({api:"openCamera"}):Promise.resolve({}),api_closeCamera=()=>storeData.isApp?promisefiyPostMessage({api:"closeCamera"}):Promise.resolve({}),api_setStatusBarVisibility=()=>{postMessage({api:"setStatusBarVisibility",content:{isVisibility:0}})},api_cloudToggleFollow=i=>storeData.isApp?promisefiyPostMessage({api:"cloudToggleFollow",content:{state:i}}):Promise.resolve({}),api_cloudFollowTime=(i,e=!0)=>{e?listenerMessage("cloudFollowTime",i):removeListenerMessage("cloudFollowTime",i)},api_goback=()=>{postMessage({api:"goBack"})},api_back=()=>{postMessage({api:"back"})},api_cloudLoading=(i=!1)=>{postMessage({api:"cloudLoading",content:{show:i,type:"fullscreen"}})},api_cloudDestroy=()=>{postMessage({api:"cloudDestroy"})},api_setEventTracking=()=>{postMessage({api:"setEventTracking",content:{type:"klx_xiaokuAI"}})},api_savePicture=i=>storeData.isApp?promisefiyPostMessage({api:"savePicture",content:i}):Promise.resolve({}),api_setCache=i=>{postMessage({api:"setCache",content:i})},api_suspendPlay=i=>{listenerMessage("suspendPlay",i)},api_startCapture=()=>{postMessage({api:"startCapture"})},api_endCapture=()=>{postMessage({api:"endCapture"})},api_getDeviceDelay=()=>storeData.isApp?promisefiyPostMessage({api:"getDeviceDelay"}):Promise.resolve({}),api_playProgress=i=>{listenerMessage("playProgress",i)},hideComplexButton=(i,e)=>{e?listenerMessage("hideComplexButton",i):removeListenerMessage("hideComplexButton",i)},api_checkSocketStatus=()=>promisefiyPostMessage({api:"checkSocketStatus"}),addAccompanyError=i=>{listenerMessage("accompanyError",i)},removeAccompanyError=i=>{removeListenerMessage("accompanyError",i)},addSocketStatus=i=>{listenerMessage("socketConnectSuccessReport",i)},removeSocketStatus=i=>{removeListenerMessage("socketConnectSuccessReport",i)},api_disconnectSocket=()=>promisefiyPostMessage({api:"disconnectSocket"}),api_cloudGetMediaStatus=()=>promisefiyPostMessage({api:"cloudGetMediaStatus"}),api_cloudPlay=i=>{promisefiyPostMessage({api:"cloudPlay",content:i})},api_cloudSuspend=i=>{promisefiyPostMessage({api:"cloudSuspend",content:i})},api_cloudSetCurrentTime=i=>{promisefiyPostMessage({api:"cloudSetCurrentTime",content:i})},api_cloudChangeSpeed=i=>{promisefiyPostMessage({api:"cloudChangeSpeed",content:i})},api_cloudTimeUpdae=i=>{listenerMessage("cloudTimeUpdae",i)},api_remove_cloudTimeUpdae=i=>{removeListenerMessage("cloudTimeUpdae",i)},api_cloudplayed=i=>{listenerMessage("cloudplayed",i)},api_remove_cloudplayed=i=>{removeListenerMessage("cloudplayed",i)},api_midiMicDelay=i=>{postMessage({api:"proxyServiceMessage",content:i})},api_closeDelayCheck=i=>{promisefiyPostMessage({api:"closeDelayCheck",content:i})},TheError=defineComponent({name:"The-error",setup(i,e){return()=>createVNode("div",null,[createVNode(NavBar,{leftArrow:!0,onClickLeft:()=>{api_back()}},null),createVNode(Empty,{image:"error",description:"网络开小差,请稍后重试"},{default:()=>[createVNode(Button$1,{type:"primary",size:"small",onClick:()=>history.go(0)},{default:()=>[createTextVNode("重新加载")]})]})])}});var shams=function i(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),s=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=shams,hasSymbols$1=function i(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",slice$1=Array.prototype.slice,toStr$1=Object.prototype.toString,funcType="[object Function]",implementation$1=function i(e){var r=this;if(typeof r!="function"||toStr$1.call(r)!==funcType)throw new TypeError(ERROR_MESSAGE+r);for(var s=slice$1.call(arguments,1),o,a=function(){if(this instanceof o){var y=r.apply(this,s.concat(slice$1.call(arguments)));return Object(y)===y?y:this}else return r.apply(e,s.concat(slice$1.call(arguments)))},l=Math.max(0,r.length-s.length),u=[],c=0;c"u"?undefined$1:getProto(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$1,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};try{null.error}catch(i){var errorProto=getProto(getProto(i));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function i(e){var r;if(e==="%AsyncFunction%")r=getEvalledConstructor("async function () {}");else if(e==="%GeneratorFunction%")r=getEvalledConstructor("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=getEvalledConstructor("async function* () {}");else if(e==="%AsyncGenerator%"){var s=i("%AsyncGeneratorFunction%");s&&(r=s.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=i("%AsyncGenerator%");o&&(r=getProto(o.prototype))}return INTRINSICS[e]=r,r},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$1=src$1,$concat$1=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace$1=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function i(e){var r=$strSlice(e,0,1),s=$strSlice(e,-1);if(r==="%"&&s!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&r!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace$1(e,rePropName,function(a,l,u,c){o[o.length]=u?$replace$1(c,reEscapeChar,"$1"):l||a}),o},getBaseIntrinsic=function i(e,r){var s=e,o;if(hasOwn$1(LEGACY_ALIASES,s)&&(o=LEGACY_ALIASES[s],s="%"+o[0]+"%"),hasOwn$1(INTRINSICS,s)){var a=INTRINSICS[s];if(a===needsEval&&(a=doEval(s)),typeof a>"u"&&!r)throw new $TypeError$1("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:s,value:a}}throw new $SyntaxError("intrinsic "+e+" does not exist!")},getIntrinsic=function i(e,r){if(typeof e!="string"||e.length===0)throw new $TypeError$1("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new $TypeError$1('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,e)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=stringToPath(e),o=s.length>0?s[0]:"",a=getBaseIntrinsic("%"+o+"%",r),l=a.name,u=a.value,c=!1,d=a.alias;d&&(o=d[0],$spliceApply(s,$concat$1([0,1],d)));for(var y=1,m=!0;y=s.length){var S=$gOPD(u,g);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?u=S.get:u=u[g]}else m=hasOwn$1(u,g),u=u[g];m&&!c&&(INTRINSICS[l]=u)}}return u},callBindExports={},callBind$1={get exports(){return callBindExports},set exports(i){callBindExports=i}};(function(i){var e=functionBind,r=getIntrinsic,s=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(o,s),l=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch(y){u=null}i.exports=function(m){var g=a(e,o,arguments);if(l&&u){var v=l(g,"length");v.configurable&&u(g,"length",{value:1+c(0,m.length-(arguments.length-1))})}return g};var d=function(){return a(e,s,arguments)};u?u(i.exports,"apply",{value:d}):i.exports.apply=d})(callBind$1);var GetIntrinsic$1=getIntrinsic,callBind=callBindExports,$indexOf=callBind(GetIntrinsic$1("String.prototype.indexOf")),callBound$1=function i(e,r){var s=GetIntrinsic$1(e,!!r);return typeof s=="function"&&$indexOf(e,".prototype.")>-1?callBind(s):s};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString$2=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||"symbol")?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(i){return i.__proto__}:null);function addNumericSeparator(i,e){if(i===1/0||i===-1/0||i!==i||i&&i>-1e3&&i<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof i=="number"){var s=i<0?-$floor(-i):$floor(i);if(s!==i){var o=String(s),a=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,objectInspect=function i(e,r,s,o){var a=r||{};if(has$3(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=has$3(a,"customInspect")?a.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return inspectString(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?addNumericSeparator(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return u?addNumericSeparator(e,d):d}var y=typeof a.depth>"u"?5:a.depth;if(typeof s>"u"&&(s=0),s>=y&&y>0&&typeof e=="object")return isArray$7(e)?"[Array]":"[Object]";var m=getIndent(a,s);if(typeof o>"u")o=[];else if(indexOf$2(o,e)>=0)return"[Circular]";function g(F,I,U){if(I&&(o=$arrSlice.call(o),o.push(I)),U){var D={depth:a.depth};return has$3(a,"quoteStyle")&&(D.quoteStyle=a.quoteStyle),i(F,D,s+1,o)}return i(F,a,s+1,o)}if(typeof e=="function"&&!isRegExp$1(e)){var v=nameOf(e),b=arrObjKeys(e,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(b.length>0?" { "+$join.call(b,", ")+" }":"")}if(isSymbol(e)){var S=hasShammedSymbols?$replace.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(e);return typeof e=="object"&&!hasShammedSymbols?markBoxed(S):S}if(isElement(e)){for(var x="<"+$toLowerCase.call(String(e.nodeName)),A=e.attributes||[],E=0;E",x}if(isArray$7(e)){if(e.length===0)return"[]";var w=arrObjKeys(e,g);return m&&!singleLineValues(w)?"["+indentedJoin(w,m)+"]":"[ "+$join.call(w,", ")+" ]"}if(isError(e)){var _=arrObjKeys(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!isEnumerable.call(e,"cause")?"{ ["+String(e)+"] "+$join.call($concat.call("[cause]: "+g(e.cause),_),", ")+" }":_.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+$join.call(_,", ")+" }"}if(typeof e=="object"&&l){if(inspectSymbol&&typeof e[inspectSymbol]=="function"&&utilInspect)return utilInspect(e,{depth:y-s});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(isMap$2(e)){var T=[];return mapForEach&&mapForEach.call(e,function(F,I){T.push(g(I,e,!0)+" => "+g(F,e))}),collectionOf("Map",mapSize.call(e),T,m)}if(isSet$2(e)){var C=[];return setForEach&&setForEach.call(e,function(F){C.push(g(F,e))}),collectionOf("Set",setSize.call(e),C,m)}if(isWeakMap(e))return weakCollectionOf("WeakMap");if(isWeakSet(e))return weakCollectionOf("WeakSet");if(isWeakRef(e))return weakCollectionOf("WeakRef");if(isNumber$1(e))return markBoxed(g(Number(e)));if(isBigInt(e))return markBoxed(g(bigIntValueOf.call(e)));if(isBoolean$1(e))return markBoxed(booleanValueOf.call(e));if(isString$1(e))return markBoxed(g(String(e)));if(!isDate$1(e)&&!isRegExp$1(e)){var P=arrObjKeys(e,g),k=gPO?gPO(e)===Object.prototype:e instanceof Object||e.constructor===Object,M=e instanceof Object?"":"null prototype",R=!k&&toStringTag&&Object(e)===e&&toStringTag in e?$slice.call(toStr(e),8,-1):M?"Object":"",H=k||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=H+(R||M?"["+$join.call($concat.call([],R||[],M||[]),": ")+"] ":"");return P.length===0?B+"{}":m?B+"{"+indentedJoin(P,m)+"}":B+"{ "+$join.call(P,", ")+" }"}return String(e)};function wrapQuotes(i,e,r){var s=(r.quoteStyle||e)==="double"?'"':"'";return s+i+s}function quote(i){return $replace.call(String(i),/"/g,""")}function isArray$7(i){return toStr(i)==="[object Array]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isDate$1(i){return toStr(i)==="[object Date]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isRegExp$1(i){return toStr(i)==="[object RegExp]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isError(i){return toStr(i)==="[object Error]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isString$1(i){return toStr(i)==="[object String]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isNumber$1(i){return toStr(i)==="[object Number]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isBoolean$1(i){return toStr(i)==="[object Boolean]"&&(!toStringTag||!(typeof i=="object"&&toStringTag in i))}function isSymbol(i){if(hasShammedSymbols)return i&&typeof i=="object"&&i instanceof Symbol;if(typeof i=="symbol")return!0;if(!i||typeof i!="object"||!symToString)return!1;try{return symToString.call(i),!0}catch(e){}return!1}function isBigInt(i){if(!i||typeof i!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(i),!0}catch(e){}return!1}var hasOwn=Object.prototype.hasOwnProperty||function(i){return i in this};function has$3(i,e){return hasOwn.call(i,e)}function toStr(i){return objectToString$2.call(i)}function nameOf(i){if(i.name)return i.name;var e=$match.call(functionToString.call(i),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf$2(i,e){if(i.indexOf)return i.indexOf(e);for(var r=0,s=i.length;re.maxStringLength){var r=i.length-e.maxStringLength,s="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(i,0,e.maxStringLength),e)+s}var o=$replace.call($replace.call(i,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(o,"single",e)}function lowbyte(i){var e=i.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(i){return"Object("+i+")"}function weakCollectionOf(i){return i+" { ? }"}function collectionOf(i,e,r,s){var o=s?indentedJoin(r,s):$join.call(r,", ");return i+" ("+e+") {"+o+"}"}function singleLineValues(i){for(var e=0;e=0)return!1;return!0}function getIndent(i,e){var r;if(i.indent===" ")r=" ";else if(typeof i.indent=="number"&&i.indent>0)r=$join.call(Array(i.indent+1)," ");else return null;return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(i,e){if(i.length===0)return"";var r=` `+e.prev+e.base;return r+$join.call(i,","+r)+` `+e.prev}function arrObjKeys(i,e){var r=isArray$7(i),s=[];if(r){s.length=i.length;for(var o=0;o1;){var r=e.pop(),s=r.obj[r.prop];if(isArray$6(s)){for(var o=[],a=0;a=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===formats$2.RFC1738&&(d===40||d===41)){u+=l.charAt(c);continue}if(d<128){u=u+hexTable[d];continue}if(d<2048){u=u+(hexTable[192|d>>6]+hexTable[128|d&63]);continue}if(d<55296||d>=57344){u=u+(hexTable[224|d>>12]+hexTable[128|d>>6&63]+hexTable[128|d&63]);continue}c+=1,d=65536+((d&1023)<<10|l.charCodeAt(c)&1023),u+=hexTable[240|d>>18]+hexTable[128|d>>12&63]+hexTable[128|d>>6&63]+hexTable[128|d&63]}return u},compact=function i(e){for(var r=[{obj:{o:e},prop:"o"}],s=[],o=0;o"u"&&(w=0)}if(typeof c=="function"?A=c(r,A):A instanceof Date?A=m(A):s==="comma"&&isArray$5(A)&&(A=utils$2.maybeMap(A,function(D){return D instanceof Date?m(D):D})),A===null){if(a)return u&&!b?u(r,defaults$1.encoder,S,"key",g):r;A=""}if(isNonNullishPrimitive(A)||utils$2.isBuffer(A)){if(u){var C=b?r:u(r,defaults$1.encoder,S,"key",g);return[v(C)+"="+v(u(A,defaults$1.encoder,S,"value",g))]}return[v(r)+"="+v(String(A))]}var P=[];if(typeof A>"u")return P;var k;if(s==="comma"&&isArray$5(A))b&&u&&(A=utils$2.maybeMap(A,u)),k=[{value:A.length>0?A.join(",")||null:void 0}];else if(isArray$5(c))k=c;else{var M=Object.keys(A);k=d?M.sort(d):M}for(var R=o&&isArray$5(A)&&A.length===1?r+"[]":r,H=0;H"u"?defaults$1.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:defaults$1.charsetSentinel,delimiter:typeof e.delimiter>"u"?defaults$1.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:defaults$1.encode,encoder:typeof e.encoder=="function"?e.encoder:defaults$1.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:defaults$1.encodeValuesOnly,filter:a,format:s,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:defaults$1.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:defaults$1.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:defaults$1.strictNullHandling}},stringify_1=function(i,e){var r=i,s=normalizeStringifyOptions(e),o,a;typeof s.filter=="function"?(a=s.filter,r=a("",r)):isArray$5(s.filter)&&(a=s.filter,o=a);var l=[];if(typeof r!="object"||r===null)return"";var u;e&&e.arrayFormat in arrayPrefixGenerators?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var c=arrayPrefixGenerators[u];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=c==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),s.sort&&o.sort(s.sort);for(var y=getSideChannel(),m=0;m0?b+v:""},utils$1=utils$3,has=Object.prototype.hasOwnProperty,isArray$4=Array.isArray,defaults={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:utils$1.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(i){return i.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},parseArrayValue=function(i,e){return i&&typeof i=="string"&&e.comma&&i.indexOf(",")>-1?i.split(","):i},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function i(e,r){var s={},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,l=o.split(r.delimiter,a),u=-1,c,d=r.charset;if(r.charsetSentinel)for(c=0;c-1&&(b=isArray$4(b)?[b]:b),has.call(s,v)?s[v]=utils$1.combine(s[v],b):s[v]=b}return s},parseObject=function(i,e,r,s){for(var o=s?e:parseArrayValue(e,r),a=i.length-1;a>=0;--a){var l,u=i[a];if(u==="[]"&&r.parseArrays)l=[].concat(o);else{l=r.plainObjects?Object.create(null):{};var c=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=parseInt(c,10);!r.parseArrays&&c===""?l={0:o}:!isNaN(d)&&u!==c&&String(d)===c&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(l=[],l[d]=o):c!=="__proto__"&&(l[c]=o)}o=l}return o},parseKeys=function i(e,r,s,o){if(e){var a=s.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,c=s.depth>0&&l.exec(a),d=c?a.slice(0,c.index):a,y=[];if(d){if(!s.plainObjects&&has.call(Object.prototype,d)&&!s.allowPrototypes)return;y.push(d)}for(var m=0;s.depth>0&&(c=u.exec(a))!==null&&m"u"?defaults.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?defaults.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:defaults.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:defaults.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:defaults.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:defaults.comma,decoder:typeof e.decoder=="function"?e.decoder:defaults.decoder,delimiter:typeof e.delimiter=="string"||utils$1.isRegExp(e.delimiter)?e.delimiter:defaults.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:defaults.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:defaults.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:defaults.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:defaults.strictNullHandling}},parse$4=function(i,e){var r=normalizeParseOptions(e);if(i===""||i===null||typeof i>"u")return r.plainObjects?Object.create(null):{};for(var s=typeof i=="string"?parseValues(i,r):i,o=r.plainObjects?Object.create(null):{},a=Object.keys(s),l=0;l-1};function normalizeName(i){if(typeof i!="string"&&(i=String(i)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(i)||i==="")throw new TypeError('Invalid character in header field name: "'+i+'"');return i.toLowerCase()}function normalizeValue(i){return typeof i!="string"&&(i=String(i)),i}function iteratorFor(i){var e={next:function(){var r=i.shift();return{done:r===void 0,value:r}}};return support.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Headers(i){this.map={},i instanceof Headers?i.forEach(function(e,r){this.append(r,e)},this):Array.isArray(i)?i.forEach(function(e){this.append(e[0],e[1])},this):i&&Object.getOwnPropertyNames(i).forEach(function(e){this.append(e,i[e])},this)}Headers.prototype.append=function(i,e){i=normalizeName(i),e=normalizeValue(e);var r=this.map[i];this.map[i]=r?r+", "+e:e};Headers.prototype.delete=function(i){delete this.map[normalizeName(i)]};Headers.prototype.get=function(i){return i=normalizeName(i),this.has(i)?this.map[i]:null};Headers.prototype.has=function(i){return this.map.hasOwnProperty(normalizeName(i))};Headers.prototype.set=function(i,e){this.map[normalizeName(i)]=normalizeValue(e)};Headers.prototype.forEach=function(i,e){for(var r in this.map)this.map.hasOwnProperty(r)&&i.call(e,this.map[r],r,this)};Headers.prototype.keys=function(){var i=[];return this.forEach(function(e,r){i.push(r)}),iteratorFor(i)};Headers.prototype.values=function(){var i=[];return this.forEach(function(e){i.push(e)}),iteratorFor(i)};Headers.prototype.entries=function(){var i=[];return this.forEach(function(e,r){i.push([r,e])}),iteratorFor(i)};support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);function consumed(i){if(i.bodyUsed)return Promise.reject(new TypeError("Already read"));i.bodyUsed=!0}function fileReaderReady(i){return new Promise(function(e,r){i.onload=function(){e(i.result)},i.onerror=function(){r(i.error)}})}function readBlobAsArrayBuffer(i){var e=new FileReader,r=fileReaderReady(e);return e.readAsArrayBuffer(i),r}function readBlobAsText(i){var e=new FileReader,r=fileReaderReady(e);return e.readAsText(i),r}function readArrayBufferAsText(i){for(var e=new Uint8Array(i),r=new Array(e.length),s=0;s-1?e:i}function Request(i,e){if(!(this instanceof Request))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(i instanceof Request){if(i.bodyUsed)throw new TypeError("Already read");this.url=i.url,this.credentials=i.credentials,e.headers||(this.headers=new Headers(i.headers)),this.method=i.method,this.mode=i.mode,this.signal=i.signal,!r&&i._bodyInit!=null&&(r=i._bodyInit,i.bodyUsed=!0)}else this.url=String(i);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new Headers(e.headers)),this.method=normalizeMethod(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})};function decode$1(i){var e=new FormData;return i.trim().split("&").forEach(function(r){if(r){var s=r.split("="),o=s.shift().replace(/\+/g," "),a=s.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(a))}}),e}function parseHeaders(i){var e=new Headers,r=i.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(s){return s.indexOf(` `)===0?s.substr(1,s.length):s}).forEach(function(s){var o=s.split(":"),a=o.shift().trim();if(a){var l=o.join(":").trim();e.append(a,l)}}),e}Body.call(Request.prototype);function Response(i,e){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new Headers(e.headers),this.url=e.url||"",this._initBody(i)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var i=new Response(null,{status:0,statusText:""});return i.type="error",i};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(i,e){if(redirectStatuses.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Response(null,{status:e,headers:{location:i}})};var DOMException=global$1.DOMException;try{new DOMException}catch(i){DOMException=function(e,r){this.message=e,this.name=r;var s=Error(e);this.stack=s.stack},DOMException.prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$2(i,e){return new Promise(function(r,s){var o=new Request(i,e);if(o.signal&&o.signal.aborted)return s(new DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var c={status:a.status,statusText:a.statusText,headers:parseHeaders(a.getAllResponseHeaders()||"")};c.url="responseURL"in a?a.responseURL:c.headers.get("X-Request-URL");var d="response"in a?a.response:a.responseText;setTimeout(function(){r(new Response(d,c))},0)},a.onerror=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){s(new DOMException("Aborted","AbortError"))},0)};function u(c){try{return c===""&&global$1.location.href?global$1.location.href:c}catch(d){return c}}a.open(o.method,u(o.url),!0),o.credentials==="include"?a.withCredentials=!0:o.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(support.blob?a.responseType="blob":support.arrayBuffer&&o.headers.get("Content-Type")&&o.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof Headers)?Object.getOwnPropertyNames(e.headers).forEach(function(c){a.setRequestHeader(c,normalizeValue(e.headers[c]))}):o.headers.forEach(function(c,d){a.setRequestHeader(d,c)}),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){a.readyState===4&&o.signal.removeEventListener("abort",l)}),a.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}fetch$2.polyfill=!0;global$1.fetch||(global$1.fetch=fetch$2,global$1.Headers=Headers,global$1.Request=Request,global$1.Response=Response);self.fetch.bind(self);function ownKeys(i,e){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),r.push.apply(r,s)}return r}function _objectSpread2(i){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function _construct(i,e,r){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(o,a,l){var u=[null];u.push.apply(u,a);var c=Function.bind.apply(o,u),d=new c;return l&&_setPrototypeOf(d,l.prototype),d},_construct.apply(null,arguments)}function _isNativeFunction(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function _wrapNativeSuper(i){var e=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(s){if(s===null||!_isNativeFunction(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,o)}function o(){return _construct(s,arguments,_getPrototypeOf(this).constructor)}return o.prototype=Object.create(s.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(o,s)},_wrapNativeSuper(i)}function _assertThisInitialized(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _possibleConstructorReturn(i,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(i)}function _createSuper(i){var e=_isNativeReflectConstruct();return function(){var s=_getPrototypeOf(i),o;if(e){var a=_getPrototypeOf(this).constructor;o=Reflect.construct(s,arguments,a)}else o=s.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _toConsumableArray(i){return _arrayWithoutHoles(i)||_iterableToArray(i)||_unsupportedIterableToArray(i)||_nonIterableSpread()}function _arrayWithoutHoles(i){if(Array.isArray(i))return _arrayLikeToArray(i)}function _iterableToArray(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function _unsupportedIterableToArray(i,e){if(i){if(typeof i=="string")return _arrayLikeToArray(i,e);var r=Object.prototype.toString.call(i).slice(8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Array.from(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(i,e)}}function _arrayLikeToArray(i,e){(e==null||e>i.length)&&(e=i.length);for(var r=0,s=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},o=!1,a=!1,l=!1;if(typeof s=="number"?(process&&process.env,o=!0,a=!1):_typeof(s)==="object"&&s&&(a=s.global||!1,o=s.core||!1,l=s.defaultInstance||!1),a){i.globalMiddlewares.splice(i.globalMiddlewares.length-i.defaultGlobalMiddlewaresLength,0,r);return}if(o){i.coreMiddlewares.splice(i.coreMiddlewares.length-i.defaultCoreMiddlewaresLength,0,r);return}if(l){this.defaultMiddlewares.push(r);return}this.middlewares.push(r)}},{key:"execute",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=compose([].concat(_toConsumableArray(this.middlewares),_toConsumableArray(this.defaultMiddlewares),_toConsumableArray(i.globalMiddlewares),_toConsumableArray(i.coreMiddlewares)));return s(r)}}]),i}();Onion.globalMiddlewares=[];Onion.defaultGlobalMiddlewaresLength=0;Onion.coreMiddlewares=[];Onion.defaultCoreMiddlewaresLength=0;var MapCache$1=function(){function i(e){_classCallCheck(this,i),this.cache=new Map,this.timer={},this.extendOptions(e)}return _createClass(i,[{key:"extendOptions",value:function(r){this.maxCache=r.maxCache||0}},{key:"get",value:function(r){return this.cache.get(JSON.stringify(r))}},{key:"set",value:function(r,s){var o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var l=_toConsumableArray(this.cache.keys())[0];this.cache.delete(l),this.timer[l]&&clearTimeout(this.timer[l])}var u=JSON.stringify(r);this.cache.set(u,s),a>0&&(this.timer[u]=setTimeout(function(){o.cache.delete(u),delete o.timer[u]},a))}},{key:"delete",value:function(r){var s=JSON.stringify(r);return delete this.timer[s],this.cache.delete(s)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),i}(),RequestError=function(i){_inherits(r,i);var e=_createSuper(r);function r(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return _classCallCheck(this,r),a=e.call(this,s),a.name="RequestError",a.request=o,a.type=l,a}return r}(_wrapNativeSuper(Error)),ResponseError=function(i){_inherits(r,i);var e=_createSuper(r);function r(s,o,a,l){var u,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return _classCallCheck(this,r),u=e.call(this,o||s.statusText),u.name="ResponseError",u.data=a,u.response=s,u.request=l,u.type=c,u}return r}(_wrapNativeSuper(Error));function readerGBK(i){return new Promise(function(e,r){var s=new FileReader;s.onload=function(){e(s.result)},s.onerror=r,s.readAsText(i,"GBK")})}function safeJsonParse(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(i)}catch(o){if(e)throw new ResponseError(r,"JSON.parse fail",i,s,"ParseError")}return i}function timeout2Throw(i,e,r){return new Promise(function(s,o){setTimeout(function(){o(new RequestError(e||"timeout of ".concat(i,"ms exceeded"),r,"Timeout"))},i)})}function cancel2Throw(i){return new Promise(function(e,r){i.cancelToken&&i.cancelToken.promise.then(function(s){r(s)})})}var toString$2=Object.prototype.toString;function getEnv(){var i;return typeof process<"u"&&toString$2.call(process)==="[object process]"&&(i="NODE"),typeof XMLHttpRequest<"u"&&(i="BROWSER"),i}function isArray$3(i){return _typeof(i)==="object"&&Object.prototype.toString.call(i)==="[object Array]"}function isURLSearchParams(i){return typeof URLSearchParams<"u"&&i instanceof URLSearchParams}function isDate(i){return _typeof(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function isObject$1(i){return i!==null&&_typeof(i)==="object"}function forEach2ObjArr(i,e){if(i)if(_typeof(i)!=="object"&&(i=[i]),isArray$3(i))for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},s=r.prefix,o=r.suffix;return s&&(e="".concat(s).concat(e)),o&&(e="".concat(e).concat(o)),{url:e,options:r}},warnedCoreType=!1;function __defaultValidateCache(i,e){var r=e.method,s=r===void 0?"get":r;return s.toLowerCase()==="get"}function fetchMiddleware(i,e){if(!i)return e();var r=i.req;r=r===void 0?{}:r;var s=r.options,o=s===void 0?{}:s,a=r.url,l=a===void 0?"":a,u=i.cache,c=i.responseInterceptors,d=o.timeout,y=d===void 0?0:d,m=o.timeoutMessage,g=o.__umiRequestCoreType__,v=g===void 0?"normal":g,b=o.useCache,S=b===void 0?!1:b,x=o.method,A=x===void 0?"get":x,E=o.params,w=o.ttl,_=o.validateCache,T=_===void 0?__defaultValidateCache:_;if(v!=="normal")return process&&process.env,e();var C=fetch;if(!C)throw new Error("Global fetch not exist!");var P=getEnv()==="BROWSER",k=T(l,o)&&S&&P;if(k){var M=u.get({url:l,params:E,method:A});if(M)return M=M.clone(),M.useCache=!0,i.res=M,e()}var R;return y>0?R=Promise.race([cancel2Throw(o),C(l,o),timeout2Throw(y,m,i.req)]):R=Promise.race([cancel2Throw(o),C(l,o)]),c.forEach(function(H){R=R.then(function(B){var F=typeof B.clone=="function"?B.clone():B;return H(F,o)})}),R.then(function(H){if(k&&H.status===200){var B=H.clone();B.useCache=!0,u.set({url:l,params:E,method:A},B,w)}return i.res=H,e()})}function parseResponseMiddleware(i,e){var r;return e().then(function(){if(i){var s=i.res,o=s===void 0?{}:s,a=i.req,l=a===void 0?{}:a,u=l||{},c=u.options;c=c===void 0?{}:c;var d=c.responseType,y=d===void 0?"json":d,m=c.charset,g=m===void 0?"utf8":m;c.getResponse;var v=c.throwErrIfParseFail,b=v===void 0?!1:v,S=c.parseResponse,x=S===void 0?!0:S;if(x&&!(!o||!o.clone)){if(r=getEnv()==="BROWSER"?o.clone():o,r.useCache=o.useCache||!1,g==="gbk")try{return o.blob().then(readerGBK).then(function(A){return safeJsonParse(A,!1,r,l)})}catch(A){throw new ResponseError(r,A.message,null,l,"ParseError")}else if(y==="json")return o.text().then(function(A){return safeJsonParse(A,b,r,l)});try{return o[y]()}catch(A){throw new ResponseError(r,"responseType not support",null,l,"ParseError")}}}}).then(function(s){if(i){i.res;var o=i.req,a=o===void 0?{}:o,l=a||{},u=l.options;u=u===void 0?{}:u;var c=u.getResponse,d=c===void 0?!1:c;if(r){if(r.status>=200&&r.status<300){if(d){i.res={data:s,response:r};return}i.res=s;return}throw new ResponseError(r,"http error",s,a,"HttpError")}}}).catch(function(s){if(s instanceof RequestError||s instanceof ResponseError)throw s;var o=i.req,a=i.res;throw s.request=s.request||o,s.response=s.response||a,s.type=s.type||s.name,s.data=s.data||void 0,s})}function simplePostMiddleware(i,e){if(!i)return e();var r=i.req;r=r===void 0?{}:r;var s=r.options,o=s===void 0?{}:s,a=o.method,l=a===void 0?"get":a;if(["post","put","patch","delete"].indexOf(l.toLowerCase())===-1)return e();var u=o.requestType,c=u===void 0?"json":u,d=o.data;if(d){var y=Object.prototype.toString.call(d);y==="[object Object]"||y==="[object Array]"?c==="json"?(o.headers=_objectSpread2({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},o.headers),o.body=JSON.stringify(d)):c==="form"&&(o.headers=_objectSpread2({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},o.headers),o.body=reqStringify(d)):(o.headers=_objectSpread2({Accept:"application/json"},o.headers),o.body=d)}return i.req.options=o,e()}function paramsSerialize(i,e){var r,s;if(i)if(e)r=e(i);else if(isURLSearchParams(i))r=i.toString();else if(isArray$3(i))s=[],forEach2ObjArr(i,function(a){a===null||typeof a>"u"?s.push(a):s.push(isObject$1(a)?JSON.stringify(a):a)}),r=reqStringify(s);else{s={},forEach2ObjArr(i,function(a,l){var u=a;a===null||typeof a>"u"?s[l]=a:isDate(a)?u=a.toISOString():isArray$3(a)?u=a:isObject$1(a)&&(u=JSON.stringify(a)),s[l]=u});var o=reqStringify(s);r=o}return r}function simpleGetMiddleware(i,e){if(!i)return e();var r=i.req;r=r===void 0?{}:r;var s=r.options,o=s===void 0?{}:s,a=o.paramsSerializer,l=o.params,u=i.req;u=u===void 0?{}:u;var c=u.url,d=c===void 0?"":c;o.method=o.method?o.method.toUpperCase():"GET",o.credentials=o.credentials||"same-origin";var y=paramsSerialize(l,a);if(i.req.originUrl=d,y){var m=d.indexOf("?")!==-1?"&":"?";i.req.url="".concat(d).concat(m).concat(y)}return i.req.options=o,e()}var globalMiddlewares=[simplePostMiddleware,simpleGetMiddleware,parseResponseMiddleware],coreMiddlewares=[fetchMiddleware];Onion.globalMiddlewares=globalMiddlewares;Onion.defaultGlobalMiddlewaresLength=globalMiddlewares.length;Onion.coreMiddlewares=coreMiddlewares;Onion.defaultCoreMiddlewaresLength=coreMiddlewares.length;var Core=function(){function i(e){_classCallCheck(this,i),this.onion=new Onion([]),this.fetchIndex=0,this.mapCache=new MapCache$1(e),this.initOptions=e,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return _createClass(i,[{key:"use",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(r,s),this}},{key:"extendOptions",value:function(r){this.initOptions=mergeRequestOptions(this.initOptions,r),this.mapCache.extendOptions(r)}},{key:"dealRequestInterceptors",value:function(r){var s=function(l,u){return l.then(function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=c.url||r.req.url,r.req.options=c.options||r.req.options,u(r.req.url,r.req.options)})},o=[].concat(_toConsumableArray(i.requestInterceptors),_toConsumableArray(this.instanceRequestInterceptors));return o.reduce(s,Promise.resolve()).then(function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=a.url||r.req.url,r.req.options=a.options||r.req.options,Promise.resolve()})}},{key:"request",value:function(r,s){var o=this,a=this.onion,l={req:{url:r,options:_objectSpread2(_objectSpread2({},s),{},{url:r})},res:null,cache:this.mapCache,responseInterceptors:[].concat(_toConsumableArray(i.responseInterceptors),_toConsumableArray(this.instanceResponseInterceptors))};if(typeof r!="string")throw new Error("url MUST be a string");return new Promise(function(u,c){o.dealRequestInterceptors(l).then(function(){return a.execute(l)}).then(function(){u(l.res)}).catch(function(d){var y=l.req.options.errorHandler;if(y)try{var m=y(d);u(m)}catch(g){c(g)}else c(d)})})}}],[{key:"requestUse",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");s.global?i.requestInterceptors.push(r):this.instanceRequestInterceptors.push(r)}},{key:"responseUse",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");s.global?i.responseInterceptors.push(r):this.instanceResponseInterceptors.push(r)}}]),i}();Core.requestInterceptors=[addfix];Core.responseInterceptors=[];function Cancel(i){this.message=i}Cancel.prototype.toString=function i(){return this.message?"Cancel: ".concat(this.message):"Cancel"};Cancel.prototype.__CANCEL__=!0;function CancelToken(i){if(typeof i!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(o){e=o});var r=this;i(function(o){r.reason||(r.reason=new Cancel(o),e(r.reason))})}CancelToken.prototype.throwIfRequested=function i(){if(this.reason)throw this.reason};CancelToken.source=function i(){var e,r=new CancelToken(function(o){e=o});return{token:r,cancel:e}};function isCancel(i){return!!(i&&i.__CANCEL__)}var request$1=function i(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new Core(e),s=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=mergeRequestOptions(r.initOptions,u);return r.request(l,c)};s.use=r.use.bind(r),s.fetchIndex=r.fetchIndex,s.interceptors={request:{use:Core.requestUse.bind(r)},response:{use:Core.responseUse.bind(r)}};var o=["get","post","delete","put","patch","head","options","rpc"];return o.forEach(function(a){s[a]=function(l,u){return s(l,_objectSpread2(_objectSpread2({},u),{},{method:a}))}}),s.Cancel=Cancel,s.CancelToken=CancelToken,s.isCancel=isCancel,s.extendOptions=r.extendOptions.bind(r),s.middlewares={instance:r.onion.middlewares,defaultInstance:r.onion.defaultMiddlewares,global:Onion.globalMiddlewares,core:Onion.coreMiddlewares},s},extend$1=function i(e){return request$1(e)};request$1({parseResponse:!1});var request$1$1=request$1({}),lodash_isemptyExports={},lodash_isempty={get exports(){return lodash_isemptyExports},set exports(i){lodash_isemptyExports=i}};(function(i,e){var r=9007199254740991,s="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]",l="[object Map]",u="[object Object]",c="[object Promise]",d="[object Set]",y="[object WeakMap]",m="[object DataView]",g=/[\\^$.*+?()[\]{}|]/g,v=/^\[object .+?Constructor\]$/,b=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,S=typeof self=="object"&&self&&self.Object===Object&&self,x=b||S||Function("return this")(),A=e&&!e.nodeType&&e,E=A&&!0&&i&&!i.nodeType&&i,w=E&&E.exports===A;function _(de,De){return de==null?void 0:de[De]}function T(de){var De=!1;if(de!=null&&typeof de.toString!="function")try{De=!!(de+"")}catch(Ve){}return De}function C(de,De){return function(Ve){return de(De(Ve))}}var P=Function.prototype,k=Object.prototype,M=x["__core-js_shared__"],R=function(){var de=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||"");return de?"Symbol(src)_1."+de:""}(),H=P.toString,B=k.hasOwnProperty,F=k.toString,I=RegExp("^"+H.call(B).replace(g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=w?x.Buffer:void 0,D=k.propertyIsEnumerable,$=U?U.isBuffer:void 0,N=C(Object.keys,Object),O=J(x,"DataView"),Q=J(x,"Map"),z=J(x,"Promise"),W=J(x,"Set"),xe=J(x,"WeakMap"),ye=!D.call({valueOf:1},"valueOf"),q=ce(O),re=ce(Q),ue=ce(z),ge=ce(W),Se=ce(xe);function Be(de){return F.call(de)}function Ie(de){if(!Ee(de)||V(de))return!1;var De=ke(de)||T(de)?I:v;return De.test(ce(de))}function J(de,De){var Ve=_(de,De);return Ie(Ve)?Ve:void 0}var se=Be;(O&&se(new O(new ArrayBuffer(1)))!=m||Q&&se(new Q)!=l||z&&se(z.resolve())!=c||W&&se(new W)!=d||xe&&se(new xe)!=y)&&(se=function(de){var De=F.call(de),Ve=De==u?de.constructor:void 0,$e=Ve?ce(Ve):void 0;if($e)switch($e){case q:return m;case re:return l;case ue:return c;case ge:return d;case Se:return y}return De});function V(de){return!!R&&R in de}function pe(de){var De=de&&de.constructor,Ve=typeof De=="function"&&De.prototype||k;return de===Ve}function ce(de){if(de!=null){try{return H.call(de)}catch(De){}try{return de+""}catch(De){}}return""}function K(de){return Ce(de)&&B.call(de,"callee")&&(!D.call(de,"callee")||F.call(de)==s)}var Z=Array.isArray;function he(de){return de!=null&&Re(de.length)&&!ke(de)}function Ce(de){return le(de)&&he(de)}var Ae=$||we;function _e(de){if(he(de)&&(Z(de)||typeof de=="string"||typeof de.splice=="function"||Ae(de)||K(de)))return!de.length;var De=se(de);if(De==l||De==d)return!de.size;if(ye||pe(de))return!N(de).length;for(var Ve in de)if(B.call(de,Ve))return!1;return!0}function ke(de){var De=Ee(de)?F.call(de):"";return De==o||De==a}function Re(de){return typeof de=="number"&&de>-1&&de%1==0&&de<=r}function Ee(de){var De=typeof de;return!!de&&(De=="object"||De=="function")}function le(de){return!!de&&typeof de=="object"}function we(){return!1}i.exports=_e})(lodash_isempty,lodash_isemptyExports);var objectTag$4="[object Object]";function isHostObject(i){var e=!1;if(i!=null&&typeof i.toString!="function")try{e=!!(i+"")}catch(r){}return e}function overArg$1(i,e){return function(r){return i(e(r))}}var funcProto$2=Function.prototype,objectProto$f=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$c=objectProto$f.hasOwnProperty,objectCtorString=funcToString$2.call(Object),objectToString$1=objectProto$f.toString,getPrototype$2=overArg$1(Object.getPrototypeOf,Object);function isObjectLike$1(i){return!!i&&typeof i=="object"}function isPlainObject$2(i){if(!isObjectLike$1(i)||objectToString$1.call(i)!=objectTag$4||isHostObject(i))return!1;var e=getPrototype$2(i);if(e===null)return!0;var r=hasOwnProperty$c.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&funcToString$2.call(r)==objectCtorString}var lodash_isplainobject=isPlainObject$2,lodash_transformExports={},lodash_transform={get exports(){return lodash_transformExports},set exports(i){lodash_transformExports=i}};(function(i,e){var r=200,s="Expected a function",o="__lodash_hash_undefined__",a=1,l=2,u=1/0,c=9007199254740991,d="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",v="[object Error]",b="[object Function]",S="[object GeneratorFunction]",x="[object Map]",A="[object Number]",E="[object Object]",w="[object Promise]",_="[object RegExp]",T="[object Set]",C="[object String]",P="[object Symbol]",k="[object WeakMap]",M="[object ArrayBuffer]",R="[object DataView]",H="[object Float32Array]",B="[object Float64Array]",F="[object Int8Array]",I="[object Int16Array]",U="[object Int32Array]",D="[object Uint8Array]",$="[object Uint8ClampedArray]",N="[object Uint16Array]",O="[object Uint32Array]",Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,W=/^\./,xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ye=/[\\^$.*+?()[\]{}|]/g,q=/\\(\\)?/g,re=/^\[object .+?Constructor\]$/,ue=/^(?:0|[1-9]\d*)$/,ge={};ge[H]=ge[B]=ge[F]=ge[I]=ge[U]=ge[D]=ge[$]=ge[N]=ge[O]=!0,ge[d]=ge[y]=ge[M]=ge[m]=ge[R]=ge[g]=ge[v]=ge[b]=ge[x]=ge[A]=ge[E]=ge[_]=ge[T]=ge[C]=ge[k]=!1;var Se=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Be=typeof self=="object"&&self&&self.Object===Object&&self,Ie=Se||Be||Function("return this")(),J=e&&!e.nodeType&&e,se=J&&!0&&i&&!i.nodeType&&i,V=se&&se.exports===J,pe=V&&Se.process,ce=function(){try{return pe&&pe.binding("util")}catch(ne){}}(),K=ce&&ce.isTypedArray;function Z(ne,Me){for(var Ge=-1,je=ne?ne.length:0;++Ge-1}function lt(ne,Me){var Ge=this.__data__,je=At(Ge,ne);return je<0?Ge.push([ne,Me]):Ge[je][1]=Me,this}ve.prototype.clear=Le,ve.prototype.delete=Oe,ve.prototype.get=Qe,ve.prototype.has=Ke,ve.prototype.set=lt;function Ue(ne){var Me=-1,Ge=ne?ne.length:0;for(this.clear();++MeIt))return!1;var jt=st.get(ne);if(jt&&st.get(Me))return jt==Me;var Xt=-1,Kt=!0,Wt=dt&a?new Tt:void 0;for(st.set(ne,Me),st.set(Me,ne);++Xt-1&&ne%1==0&&ne-1&&ne%1==0&&ne<=c}function mi(ne){var Me=typeof ne;return!!ne&&(Me=="object"||Me=="function")}function bi(ne){return!!ne&&typeof ne=="object"}function Pi(ne){return typeof ne=="symbol"||bi(ne)&&Ze.call(ne)==P}var Ni=K?_e(K):fe;function tn(ne){return ne==null?"":Mt(ne)}function nn(ne,Me,Ge){var je=ne==null?void 0:ri(ne,Me);return je===void 0?Ge:je}function rn(ne,Me){return ne!=null&&Xi(ne,Me,xt)}function Si(ne){return Di(ne)?Yt(ne):Fe(ne)}function sn(ne,Me,Ge){var je=si(ne)||Ni(ne);if(Me=Pe(Me),Ge==null)if(je||mi(ne)){var dt=ne.constructor;je?Ge=si(ne)?new dt:[]:Ge=_i(dt)?ni(ct(ne)):{}}else Ge={};return(je?Z:Ft)(ne,function(st,Et,It){return Me(Ge,st,Et,It)}),Ge}function on(ne){return ne}function an(ne){return yi(ne)?Ce(vi(ne)):ut(ne)}i.exports=sn})(lodash_transform,lodash_transformExports);const isEmpty$1=lodash_isemptyExports,isPlainObject$1=lodash_isplainobject,transform=lodash_transformExports;var src=function i(e,{cleanKeys:r=[],cleanValues:s=[],emptyArrays:o=!0,emptyObjects:a=!0,emptyStrings:l=!0,NaNValues:u=!1,nullValues:c=!0,undefinedValues:d=!0}={}){return transform(e,(y,m,g)=>{if(!r.includes(g)&&((Array.isArray(m)||isPlainObject$1(m))&&(m=i(m,{NaNValues:u,cleanKeys:r,cleanValues:s,emptyArrays:o,emptyObjects:a,emptyStrings:l,nullValues:c,undefinedValues:d})),!s.includes(m)&&!(a&&isPlainObject$1(m)&&isEmpty$1(m))&&!(o&&Array.isArray(m)&&!m.length)&&!(l&&m==="")&&!(u&&Number.isNaN(m))&&!(c&&m===null)&&!(d&&m===void 0))){if(Array.isArray(y))return y.push(m);y[g]=m}})};const whiteUrl=()=>({"/sysMusicScoreCategories/queryTree":"/eduMusicScore/queryTree","/sysMusicScoreAccompaniment/queryPage":queryString.parse(location.search).platform?"/sysMusicScoreAccompaniment/queryPage":"/eduMusicScore/queryPage","/sysMusicScoreAccompaniment/queryPageLimit":"/eduMusicScore/queryPageLimit","/sysMusicScoreAccompaniment/querySubjectIds":"/eduMusicScore/querySubjectIds"});whiteUrl();browser();getQuery();const request=extend$1({requestType:"form",timeout:1e4});request.interceptors.request.use((i,e)=>{const r=e.isContentCenter?"/cbs-app":storeData.platformApi;storeData.proxy+r,i=matchProductApiUrl()+i;const s=getToken(),o={};return s&&!e.isContentCenter&&!e.noToken&&(o.Authorization=s),{url:i,options:{...e,params:src(e.params),data:src(e.data),headers:{...e.headers,...o}}}},{global:!1});request.interceptors.response.use(async(i,e)=>{if(i.status>299||i.status<200){const s=i.statusText+", 状态码"+i.status;showToast(s)}const r=await i.clone().json();if(r.code===5e3)return r;if(r.code!==200&&r.errCode!==0){const s=r.msg||r.message||"处理失败,请重试";throw r.code===403||r.code,new Error(s)}return r},{global:!1});var dayjs_minExports={},dayjs_min={get exports(){return dayjs_minExports},set exports(i){dayjs_minExports=i}};(function(i,e){(function(r,s){i.exports=s()})(commonjsGlobal,function(){var r=1e3,s=6e4,o=36e5,a="millisecond",l="second",u="minute",c="hour",d="day",y="week",m="month",g="quarter",v="year",b="date",S="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|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,E={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 I=["th","st","nd","rd"],U=F%100;return"["+F+(I[(U-20)%10]||I[U]||I[0])+"]"}},w=function(F,I,U){var D=String(F);return!D||D.length>=I?F:""+Array(I+1-D.length).join(U)+F},_={s:w,z:function(F){var I=-F.utcOffset(),U=Math.abs(I),D=Math.floor(U/60),$=U%60;return(I<=0?"+":"-")+w(D,2,"0")+":"+w($,2,"0")},m:function F(I,U){if(I.date()1)return F(O[0])}else{var Q=I.name;C[Q]=I,$=Q}return!D&&$&&(T=$),$||!D&&T},M=function(F,I){if(P(F))return F.clone();var U=typeof I=="object"?I:{};return U.date=F,U.args=arguments,new H(U)},R=_;R.l=k,R.i=P,R.w=function(F,I){return M(F,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var H=function(){function F(U){this.$L=k(U.locale,null,!0),this.parse(U)}var I=F.prototype;return I.parse=function(U){this.$d=function(D){var $=D.date,N=D.utc;if($===null)return new Date(NaN);if(R.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var O=$.match(x);if(O){var Q=O[2]-1||0,z=(O[7]||"0").substring(0,3);return N?new Date(Date.UTC(O[1],Q,O[3]||1,O[4]||0,O[5]||0,O[6]||0,z)):new Date(O[1],Q,O[3]||1,O[4]||0,O[5]||0,O[6]||0,z)}}return new Date($)}(U),this.$x=U.x||{},this.init()},I.init=function(){var U=this.$d;this.$y=U.getFullYear(),this.$M=U.getMonth(),this.$D=U.getDate(),this.$W=U.getDay(),this.$H=U.getHours(),this.$m=U.getMinutes(),this.$s=U.getSeconds(),this.$ms=U.getMilliseconds()},I.$utils=function(){return R},I.isValid=function(){return this.$d.toString()!==S},I.isSame=function(U,D){var $=M(U);return this.startOf(D)<=$&&$<=this.endOf(D)},I.isAfter=function(U,D){return M(U)=0&&m<=1){if(g._volume=m,g._muted)return g;g.usingWebAudio&&g.masterGain.gain.setValueAtTime(m,r.ctx.currentTime);for(var v=0;v=0;g--)m._howls[g].unload();return m.usingWebAudio&&m.ctx&&typeof m.ctx.close<"u"&&(m.ctx.close(),m.ctx=null,y()),m},codecs:function(m){return(this||r)._codecs[m.replace(/^x-/,"")]},_setup:function(){var m=this||r;if(m.state=m.ctx&&m.ctx.state||"suspended",m._autoSuspend(),!m.usingWebAudio)if(typeof Audio<"u")try{var g=new Audio;typeof g.oncanplaythrough>"u"&&(m._canPlayEvent="canplay")}catch(v){m.noAudio=!0}else m.noAudio=!0;try{var g=new Audio;g.muted&&(m.noAudio=!0)}catch(v){}return m.noAudio||m._setupCodecs(),m},_setupCodecs:function(){var m=this||r,g=null;try{g=typeof Audio<"u"?new Audio:null}catch(_){return m}if(!g||typeof g.canPlayType!="function")return m;var v=g.canPlayType("audio/mpeg;").replace(/^no$/,""),b=m._navigator?m._navigator.userAgent:"",S=b.match(/OPR\/([0-6].)/g),x=S&&parseInt(S[0].split("/")[1],10)<33,A=b.indexOf("Safari")!==-1&&b.indexOf("Chrome")===-1,E=b.match(/Version\/(.*?) /),w=A&&E&&parseInt(E[1],10)<15;return m._codecs={mp3:!!(!x&&(v||g.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!v,opus:!!g.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!g.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!g.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(g.canPlayType('audio/wav; codecs="1"')||g.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!g.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!g.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(g.canPlayType("audio/x-m4a;")||g.canPlayType("audio/m4a;")||g.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(g.canPlayType("audio/x-m4b;")||g.canPlayType("audio/m4b;")||g.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(g.canPlayType("audio/x-mp4;")||g.canPlayType("audio/mp4;")||g.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&g.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&g.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!g.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(g.canPlayType("audio/x-flac;")||g.canPlayType("audio/flac;")).replace(/^no$/,"")},m},_unlockAudio:function(){var m=this||r;if(!(m._audioUnlocked||!m.ctx)){m._audioUnlocked=!1,m.autoUnlock=!1,!m._mobileUnloaded&&m.ctx.sampleRate!==44100&&(m._mobileUnloaded=!0,m.unload()),m._scratchBuffer=m.ctx.createBuffer(1,1,22050);var g=function(v){for(;m._html5AudioPool.length"u"?w.noteOn(0):w.start(0),typeof m.ctx.resume=="function"&&m.ctx.resume(),w.onended=function(){w.disconnect(0),m._audioUnlocked=!0,document.removeEventListener("touchstart",g,!0),document.removeEventListener("touchend",g,!0),document.removeEventListener("click",g,!0),document.removeEventListener("keydown",g,!0);for(var _=0;_"u"||!r.usingWebAudio)){for(var g=0;g"u"||!r.usingWebAudio))return m.state==="running"&&m.ctx.state!=="interrupted"&&m._suspendTimer?(clearTimeout(m._suspendTimer),m._suspendTimer=null):m.state==="suspended"||m.state==="running"&&m.ctx.state==="interrupted"?(m.ctx.resume().then(function(){m.state="running";for(var g=0;g"u"&&(m="__default",!v._playLock)){for(var S=0,x=0;x0?A._seek:v._sprite[m][0]/1e3),_=Math.max(0,(v._sprite[m][0]+v._sprite[m][1])/1e3-w),T=_*1e3/Math.abs(A._rate),C=v._sprite[m][0]/1e3,P=(v._sprite[m][0]+v._sprite[m][1])/1e3;A._sprite=m,A._ended=!1;var k=function(){A._paused=!1,A._seek=w,A._start=C,A._stop=P,A._loop=!!(A._loop||v._sprite[m][2])};if(w>=P){v._ended(A);return}var M=A._node;if(v._webAudio){var R=function(){v._playLock=!1,k(),v._refreshBuffer(A);var I=A._muted||v._muted?0:A._volume;M.gain.setValueAtTime(I,r.ctx.currentTime),A._playStart=r.ctx.currentTime,typeof M.bufferSource.start>"u"?A._loop?M.bufferSource.noteGrainOn(0,w,86400):M.bufferSource.noteGrainOn(0,w,_):A._loop?M.bufferSource.start(0,w,86400):M.bufferSource.start(0,w,_),T!==1/0&&(v._endTimers[A._id]=setTimeout(v._ended.bind(v,A),T)),g||setTimeout(function(){v._emit("play",A._id),v._loadQueue()},0)};r.state==="running"&&r.ctx.state!=="interrupted"?R():(v._playLock=!0,v.once("resume",R),v._clearTimer(A._id))}else{var H=function(){M.currentTime=w,M.muted=A._muted||v._muted||r._muted||M.muted,M.volume=A._volume*r.volume(),M.playbackRate=A._rate;try{var I=M.play();if(I&&typeof Promise<"u"&&(I instanceof Promise||typeof I.then=="function")?(v._playLock=!0,k(),I.then(function(){v._playLock=!1,M._unlocked=!0,g?v._loadQueue():v._emit("play",A._id)}).catch(function(){v._playLock=!1,v._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),A._ended=!0,A._paused=!0})):g||(v._playLock=!1,k(),v._emit("play",A._id)),M.playbackRate=A._rate,M.paused){v._emit("playerror",A._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}m!=="__default"||A._loop?v._endTimers[A._id]=setTimeout(v._ended.bind(v,A),T):(v._endTimers[A._id]=function(){v._ended(A),M.removeEventListener("ended",v._endTimers[A._id],!1)},M.addEventListener("ended",v._endTimers[A._id],!1))}catch(U){v._emit("playerror",A._id,U)}};M.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(M.src=v._src,M.load());var B=window&&window.ejecta||!M.readyState&&r._navigator.isCocoonJS;if(M.readyState>=3||B)H();else{v._playLock=!0,v._state="loading";var F=function(){v._state="loaded",H(),M.removeEventListener(r._canPlayEvent,F,!1)};M.addEventListener(r._canPlayEvent,F,!1),v._clearTimer(A._id)}}return A._id},pause:function(m){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"pause",action:function(){g.pause(m)}}),g;for(var v=g._getSoundIds(m),b=0;b"u"?S._node.bufferSource.noteOff(0):S._node.bufferSource.stop(0),g._cleanBuffer(S._node)}else(!isNaN(S._node.duration)||S._node.duration===1/0)&&S._node.pause();arguments[1]||g._emit("pause",S?S._id:null)}return g},stop:function(m,g){var v=this;if(v._state!=="loaded"||v._playLock)return v._queue.push({event:"stop",action:function(){v.stop(m)}}),v;for(var b=v._getSoundIds(m),S=0;S"u"?x._node.bufferSource.noteOff(0):x._node.bufferSource.stop(0),v._cleanBuffer(x._node)):(!isNaN(x._node.duration)||x._node.duration===1/0)&&(x._node.currentTime=x._start||0,x._node.pause(),x._node.duration===1/0&&v._clearSound(x._node))),g||v._emit("stop",x._id))}return v},mute:function(m,g){var v=this;if(v._state!=="loaded"||v._playLock)return v._queue.push({event:"mute",action:function(){v.mute(m,g)}}),v;if(typeof g>"u")if(typeof m=="boolean")v._muted=m;else return v._muted;for(var b=v._getSoundIds(g),S=0;S"u"){var S=m._getSoundIds(),x=S.indexOf(g[0]);x>=0?b=parseInt(g[0],10):v=parseFloat(g[0])}else g.length>=2&&(v=parseFloat(g[0]),b=parseInt(g[1],10));var A;if(typeof v<"u"&&v>=0&&v<=1){if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"volume",action:function(){m.volume.apply(m,g)}}),m;typeof b>"u"&&(m._volume=v),b=m._getSoundIds(b);for(var E=0;E"u")}}return S},_startFadeInterval:function(m,g,v,b,S,x){var A=this,E=g,w=v-g,_=Math.abs(w/.01),T=Math.max(4,_>0?b/_:b),C=Date.now();m._fadeTo=v,m._interval=setInterval(function(){var P=(Date.now()-C)/b;C=Date.now(),E+=w*P,E=Math.round(E*100)/100,w<0?E=Math.max(v,E):E=Math.min(v,E),A._webAudio?m._volume=E:A.volume(E,m._id,!0),x&&(A._volume=E),(vg&&E>=v)&&(clearInterval(m._interval),m._interval=null,m._fadeTo=null,A.volume(v,m._id),A._emit("fade",m._id))},T)},_stopFade:function(m){var g=this,v=g._soundById(m);return v&&v._interval&&(g._webAudio&&v._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(v._interval),v._interval=null,g.volume(v._fadeTo,m),v._fadeTo=null,g._emit("fade",m)),g},loop:function(){var m=this,g=arguments,v,b,S;if(g.length===0)return m._loop;if(g.length===1)if(typeof g[0]=="boolean")v=g[0],m._loop=v;else return S=m._soundById(parseInt(g[0],10)),S?S._loop:!1;else g.length===2&&(v=g[0],b=parseInt(g[1],10));for(var x=m._getSoundIds(b),A=0;A=0?b=parseInt(g[0],10):v=parseFloat(g[0])}else g.length===2&&(v=parseFloat(g[0]),b=parseInt(g[1],10));var A;if(typeof v=="number"){if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"rate",action:function(){m.rate.apply(m,g)}}),m;typeof b>"u"&&(m._rate=v),b=m._getSoundIds(b);for(var E=0;E=0?b=parseInt(g[0],10):m._sounds.length&&(b=m._sounds[0]._id,v=parseFloat(g[0]))}else g.length===2&&(v=parseFloat(g[0]),b=parseInt(g[1],10));if(typeof b>"u")return 0;if(typeof v=="number"&&(m._state!=="loaded"||m._playLock))return m._queue.push({event:"seek",action:function(){m.seek.apply(m,g)}}),m;var A=m._soundById(b);if(A)if(typeof v=="number"&&v>=0){var E=m.playing(b);E&&m.pause(b,!0),A._seek=v,A._ended=!1,m._clearTimer(b),!m._webAudio&&A._node&&!isNaN(A._node.duration)&&(A._node.currentTime=v);var w=function(){E&&m.play(b,!0),m._emit("seek",b)};if(E&&!m._webAudio){var _=function(){m._playLock?setTimeout(_,0):w()};setTimeout(_,0)}else w()}else if(m._webAudio){var T=m.playing(b)?r.ctx.currentTime-A._playStart:0,C=A._rateSeek?A._rateSeek-A._seek:0;return A._seek+(C+T*Math.abs(A._rate))}else return A._node.currentTime;return m},playing:function(m){var g=this;if(typeof m=="number"){var v=g._soundById(m);return v?!v._paused:!1}for(var b=0;b=0&&r._howls.splice(b,1);var S=!0;for(v=0;v=0){S=!1;break}return a&&S&&delete a[m._src],r.noAudio=!1,m._state="unloaded",m._sounds=[],m=null,null},on:function(m,g,v,b){var S=this,x=S["_on"+m];return typeof g=="function"&&x.push(b?{id:v,fn:g,once:b}:{id:v,fn:g}),S},off:function(m,g,v){var b=this,S=b["_on"+m],x=0;if(typeof g=="number"&&(v=g,g=null),g||v)for(x=0;x=0;x--)(!S[x].id||S[x].id===g||m==="load")&&(setTimeout(function(A){A.call(this,g,v)}.bind(b,S[x].fn),0),S[x].once&&b.off(m,S[x].fn,S[x].id));return b._loadQueue(m),b},_loadQueue:function(m){var g=this;if(g._queue.length>0){var v=g._queue[0];v.event===m&&(g._queue.shift(),g._loadQueue()),m||v.action()}return g},_ended:function(m){var g=this,v=m._sprite;if(!g._webAudio&&m._node&&!m._node.paused&&!m._node.ended&&m._node.currentTime=0;b--){if(v<=g)return;m._sounds[b]._ended&&(m._webAudio&&m._sounds[b]._node&&m._sounds[b]._node.disconnect(0),m._sounds.splice(b,1),v--)}}},_getSoundIds:function(m){var g=this;if(typeof m>"u"){for(var v=[],b=0;b=0;if(r._scratchBuffer&&m.bufferSource&&(m.bufferSource.onended=null,m.bufferSource.disconnect(0),v))try{m.bufferSource.buffer=r._scratchBuffer}catch(b){}return m.bufferSource=null,g},_clearSound:function(m){var g=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);g||(m.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(m){this._parent=m,this.init()};o.prototype={init:function(){var m=this,g=m._parent;return m._muted=g._muted,m._loop=g._loop,m._volume=g._volume,m._rate=g._rate,m._seek=0,m._paused=!0,m._ended=!0,m._sprite="__default",m._id=++r._counter,g._sounds.push(m),m.create(),m},create:function(){var m=this,g=m._parent,v=r._muted||m._muted||m._parent._muted?0:m._volume;return g._webAudio?(m._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),m._node.gain.setValueAtTime(v,r.ctx.currentTime),m._node.paused=!0,m._node.connect(r.masterGain)):r.noAudio||(m._node=r._obtainHtml5Audio(),m._errorFn=m._errorListener.bind(m),m._node.addEventListener("error",m._errorFn,!1),m._loadFn=m._loadListener.bind(m),m._node.addEventListener(r._canPlayEvent,m._loadFn,!1),m._endFn=m._endListener.bind(m),m._node.addEventListener("ended",m._endFn,!1),m._node.src=g._src,m._node.preload=g._preload===!0?"auto":g._preload,m._node.volume=v*r.volume(),m._node.load()),m},reset:function(){var m=this,g=m._parent;return m._muted=g._muted,m._loop=g._loop,m._volume=g._volume,m._rate=g._rate,m._seek=0,m._rateSeek=0,m._paused=!0,m._ended=!0,m._sprite="__default",m._id=++r._counter,m},_errorListener:function(){var m=this;m._parent._emit("loaderror",m._id,m._node.error?m._node.error.code:0),m._node.removeEventListener("error",m._errorFn,!1)},_loadListener:function(){var m=this,g=m._parent;g._duration=Math.ceil(m._node.duration*10)/10,Object.keys(g._sprite).length===0&&(g._sprite={__default:[0,g._duration*1e3]}),g._state!=="loaded"&&(g._state="loaded",g._emit("load"),g._loadQueue()),m._node.removeEventListener(r._canPlayEvent,m._loadFn,!1)},_endListener:function(){var m=this,g=m._parent;g._duration===1/0&&(g._duration=Math.ceil(m._node.duration*10)/10,g._sprite.__default[1]===1/0&&(g._sprite.__default[1]=g._duration*1e3),g._ended(m)),m._node.removeEventListener("ended",m._endFn,!1)}};var a={},l=function(m){var g=m._src;if(a[g]){m._duration=a[g].duration,d(m);return}if(/^data:[^;]+;base64,/.test(g)){for(var v=atob(g.split(",")[1]),b=new Uint8Array(v.length),S=0;S0?(a[g._src]=S,d(g,S)):v()};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(m).then(b).catch(v):r.ctx.decodeAudioData(m,b,v)},d=function(m,g){g&&!m._duration&&(m._duration=g.duration),Object.keys(m._sprite).length===0&&(m._sprite={__default:[0,m._duration*1e3]}),m._state!=="loaded"&&(m._state="loaded",m._emit("load"),m._loadQueue())},y=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch(S){r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var m=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),g=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),v=g?parseInt(g[1],10):null;if(m&&v&&v<9){var b=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!b&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};i.Howler=r,i.Howl=s,typeof commonjsGlobal<"u"?(commonjsGlobal.HowlerGlobal=e,commonjsGlobal.Howler=r,commonjsGlobal.Howl=s,commonjsGlobal.Sound=o):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=r,window.Howl=s,window.Sound=o)})();/*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.3 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var o=s._howls.length-1;o>=0;o--)s._howls[o].stereo(r);return s},HowlerGlobal.prototype.pos=function(r,s,o){var a=this;if(!a.ctx||!a.ctx.listener)return a;if(s=typeof s!="number"?a._pos[1]:s,o=typeof o!="number"?a._pos[2]:o,typeof r=="number")a._pos=[r,s,o],typeof a.ctx.listener.positionX<"u"?(a.ctx.listener.positionX.setTargetAtTime(a._pos[0],Howler.ctx.currentTime,.1),a.ctx.listener.positionY.setTargetAtTime(a._pos[1],Howler.ctx.currentTime,.1),a.ctx.listener.positionZ.setTargetAtTime(a._pos[2],Howler.ctx.currentTime,.1)):a.ctx.listener.setPosition(a._pos[0],a._pos[1],a._pos[2]);else return a._pos;return a},HowlerGlobal.prototype.orientation=function(r,s,o,a,l,u){var c=this;if(!c.ctx||!c.ctx.listener)return c;var d=c._orientation;if(s=typeof s!="number"?d[1]:s,o=typeof o!="number"?d[2]:o,a=typeof a!="number"?d[3]:a,l=typeof l!="number"?d[4]:l,u=typeof u!="number"?d[5]:u,typeof r=="number")c._orientation=[r,s,o,a,l,u],typeof c.ctx.listener.forwardX<"u"?(c.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),c.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),c.ctx.listener.forwardZ.setTargetAtTime(o,Howler.ctx.currentTime,.1),c.ctx.listener.upX.setTargetAtTime(a,Howler.ctx.currentTime,.1),c.ctx.listener.upY.setTargetAtTime(l,Howler.ctx.currentTime,.1),c.ctx.listener.upZ.setTargetAtTime(u,Howler.ctx.currentTime,.1)):c.ctx.listener.setOrientation(r,s,o,a,l,u);else return d;return c},Howl.prototype.init=function(r){return function(s){var o=this;return o._orientation=s.orientation||[1,0,0],o._stereo=s.stereo||null,o._pos=s.pos||null,o._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},o._onstereo=s.onstereo?[{fn:s.onstereo}]:[],o._onpos=s.onpos?[{fn:s.onpos}]:[],o._onorientation=s.onorientation?[{fn:s.onorientation}]:[],r.call(this,s)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,s){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"stereo",action:function(){o.stereo(r,s)}}),o;var a=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof r=="number")o._stereo=r,o._pos=[r,0,0];else return o._stereo;for(var l=o._getSoundIds(s),u=0;u"u")if(typeof r=="number")l._pos=[r,s,o];else return l._pos;for(var u=l._getSoundIds(a),c=0;c"u")if(typeof r=="number")l._orientation=[r,s,o];else return l._orientation;for(var u=l._getSoundIds(a),c=0;c"u"&&(o.pannerAttr||(o.pannerAttr={coneInnerAngle:o.coneInnerAngle,coneOuterAngle:o.coneOuterAngle,coneOuterGain:o.coneOuterGain,distanceModel:o.distanceModel,maxDistance:o.maxDistance,refDistance:o.refDistance,rolloffFactor:o.rolloffFactor,panningModel:o.panningModel}),r._pannerAttr={coneInnerAngle:typeof o.pannerAttr.coneInnerAngle<"u"?o.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof o.pannerAttr.coneOuterAngle<"u"?o.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof o.pannerAttr.coneOuterGain<"u"?o.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof o.pannerAttr.distanceModel<"u"?o.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof o.pannerAttr.maxDistance<"u"?o.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof o.pannerAttr.refDistance<"u"?o.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof o.pannerAttr.rolloffFactor<"u"?o.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof o.pannerAttr.panningModel<"u"?o.pannerAttr.panningModel:r._panningModel});else return l=r._soundById(parseInt(s[0],10)),l?l._pannerAttr:r._pannerAttr;else s.length===2&&(o=s[0],a=parseInt(s[1],10));for(var u=r._getSoundIds(a),c=0;c{var r,s;if(!midiData.playing)return;const i=state$1.times[midiData.index];if(!i)return;midiData.index++;const e=i.endtime-i.time;(s=(r=midiData.iframeRef)==null?void 0:r.contentWindow)==null||s.playNote(i.realKey,e),timer=setTimeout(()=>{playNote()},e/midiData.rate*1e3)},hanldeInitMidiData=i=>{midiData.iframeRef=i},hanldeSetMidiPlaybackRate=i=>{midiData.rate=i},setMidiCurrentTime=i=>{clearTimeout(timer),midiData.index=i,playNote()},scoreMode="_scoreMode_mp1so_1",tipBox="_tipBox_mp1so_5",tipContent$1="_tipContent_mp1so_15",tipBtn="_tipBtn_mp1so_18",hiddenPop$1="_hiddenPop_mp1so_28",socketErrorStatus$1="_socketErrorStatus_mp1so_34",styles$v={scoreMode,tipBox,tipContent:tipContent$1,tipBtn,hiddenPop:hiddenPop$1,socketErrorStatus:socketErrorStatus$1};var context={locks:{},zIndex:2e3,enableRipple:!0};reactive(context);const Context=reactive(context),isString=i=>typeof i=="string",isBoolean=i=>typeof i=="boolean",isNumber=i=>typeof i=="number",isPlainObject=i=>Object.prototype.toString.call(i)==="[object Object]",isFunction$2=i=>typeof i=="function",isArray$2=i=>Array.isArray(i),isURL=i=>i?/^(http)|(\.*\/)/.test(i):!1,toNumber=i=>i==null?0:isString(i)?(i=parseFloat(i),i=Number.isNaN(i)?0:i,i):isBoolean(i)?Number(i):i,removeItem=(i,e)=>{if(i.length){const r=i.indexOf(e);if(r>-1)return i.splice(r,1)}},inBrowser=()=>typeof window<"u",camelize=i=>i.replace(/-(\w)/g,(e,r)=>r.toUpperCase());function getViewportSize(){var{innerWidth:i,innerHeight:e}=window;return i>e?{vMin:e,vMax:i}:{vMin:i,vMax:e}}var isRem=i=>isString(i)&&i.endsWith("rem"),isPx=i=>isString(i)&&i.endsWith("px")||isNumber(i),isPercent=i=>isString(i)&&i.endsWith("%"),isVw=i=>isString(i)&&i.endsWith("vw"),isVh=i=>isString(i)&&i.endsWith("vh"),isVMin=i=>isString(i)&&i.endsWith("vmin"),isVMax=i=>isString(i)&&i.endsWith("vmax"),isCalc=i=>isString(i)&&i.startsWith("calc("),isVar=i=>isString(i)&&i.startsWith("var("),toPxNum=i=>{if(isNumber(i))return i;if(isPx(i))return+i.replace("px","");if(isVw(i))return+i.replace("vw","")*window.innerWidth/100;if(isVh(i))return+i.replace("vh","")*window.innerHeight/100;if(isRem(i)){var e=+i.replace("rem",""),r=window.getComputedStyle(document.documentElement).fontSize;return e*parseFloat(r)}return isVMin(i)?getViewportSize().vMin:isVMax(i)?getViewportSize().vMax:isString(i)?toNumber(i):0},toSizeUnit=i=>{if(i!=null)return isPercent(i)||isVw(i)||isVh(i)||isRem(i)||isCalc(i)||isVar(i)||isVMin(i)||isVMax(i)?i:toPxNum(i)+"px"},multiplySizeUnit=function(i,e){if(e===void 0&&(e=1),i!=null){var r=toSizeUnit(i),s=r.match(/(vh|%|rem|px|vw)$/)[0];return""+parseFloat(r)*e+s}};function supportTouch(){var i=typeof window<"u";return i&&"ontouchstart"in window}function useMounted(i){let e=!1;onMounted(()=>{i(),nextTick(()=>{e=!0})}),onActivated(()=>{e&&i()})}function useEventListener(i,e,r,s={}){if(!inBrowser())return;const{passive:o=!1,capture:a=!1}=s;let l=!1,u=!1;const c=g=>{if(l||u)return;const v=unref(g);v&&(v.addEventListener(e,r,{passive:o,capture:a}),l=!0)},d=g=>{if(!l||u)return;const v=unref(g);v&&(v.removeEventListener(e,r,{capture:a}),l=!1)};let y;isRef(i)&&(y=watch(()=>i.value,(g,v)=>{d(v),c(g)}));const m=()=>{y==null||y(),d(i),u=!0};return useMounted(()=>{c(i)}),onBeforeUnmount(()=>{d(i)}),onDeactivated(()=>{d(i)}),m}var __rest=globalThis&&globalThis.__rest||function(i,e){var r={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(r[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(i);or.indexOf(l)),parentProvider:a,bindParent:d=>{onMounted(()=>{nextTick().then(()=>{s(l,d)})}),onBeforeUnmount(()=>{nextTick().then(()=>{o(l,d)})})}}}function flatVNodes(i){const e=[],r=s=>{if(s!=null&&s.component){r(s==null?void 0:s.component.subTree);return}Array.isArray(s==null?void 0:s.children)&&s.children.forEach(o=>{isVNode(o)&&(e.push(o),r(o))})};return r(i),e}function useChildren(i){const e=getCurrentInstance(),r=reactive([]),s=[],o=computed(()=>r.length),a=()=>{const d=flatVNodes(e.subTree);r.sort((y,m)=>d.indexOf(y.vnode)-d.indexOf(m.vnode))},l=(d,y)=>{r.push(d),s.push(y),a()},u=(d,y)=>{removeItem(r,d),removeItem(s,y)};return{length:o,childProviders:s,bindChildren:d=>{provide(i,Object.assign({childInstances:r,collect:l,clear:u},d))}}}function asyncGeneratorStep$1(i,e,r,s,o,a,l){try{var u=i[a](l),c=u.value}catch(d){r(d);return}u.done?e(c):Promise.resolve(c).then(s,o)}function _asyncToGenerator$1(i){return function(){var e=this,r=arguments;return new Promise(function(s,o){var a=i.apply(e,r);function l(c){asyncGeneratorStep$1(a,s,o,l,u,"next",c)}function u(c){asyncGeneratorStep$1(a,s,o,l,u,"throw",c)}l(void 0)})}}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(i){for(var e=1;e(r[s]=i[s],r),{}):i[e]}function mount(i){var e=createApp(i),r=document.createElement("div");return document.body.appendChild(r),{instance:e.mount(r),unmount(){e.unmount(),document.body.removeChild(r)}}}function mountInstance(i,e,r){e===void 0&&(e={}),r===void 0&&(r={});var s={setup(){return()=>h(i,_extends$5({},e,r))}},{unmount:o}=mount(s);return{unmountInstance:o}}function useValidation(){var i=ref(""),e=function(){var o=_asyncToGenerator$1(function*(a,l,u){if(!isArray$2(a)||!a.length)return!0;var c=yield Promise.all(a.map(d=>d(l,u)));return!c.some(d=>d!==!0?(i.value=String(d),!0):!1)});return function(l,u,c){return o.apply(this,arguments)}}(),r=()=>{i.value=""},s=function(){var o=_asyncToGenerator$1(function*(a,l,u,c,d){a.includes(l)&&(yield e(u,c,d))&&(i.value="")});return function(l,u,c,d,y){return o.apply(this,arguments)}}();return{errorMessage:i,validate:e,resetValidation:r,validateWithTrigger:s}}function useRouteListener(i){inBrowser()&&(useEventListener(window,"hashchange",i),useEventListener(window,"popstate",i))}function useTeleport(){var i=ref(!1);return onActivated(()=>{i.value=!1}),onDeactivated(()=>{i.value=!0}),{disabled:i}}function createNamespace(i){var e="var",r=e+"-"+i,s=a=>a?a[0]==="$"?a.replace("$",e):a.startsWith("--")?""+r+a:r+"__"+a:r,o=function(){for(var a=arguments.length,l=new Array(a),u=0;u{if(isArray$2(c)){var[d,y,m=null]=c;return d?y:m}return c})};return{n:s,classes:o}}function call(i){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;so(...r));if(i)return i(...r)}function defineListenerProp(i){return{type:[Function,Array],default:i}}function formatElevation(i,e){return i===!1?null:(i===!0&&e&&(i=e),"var-elevation--"+i)}function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(i){for(var e=1;e{e.tasker=null;var{x:s,y:o,centerX:a,centerY:l,size:u}=computeRippleStyles(this,i),c=document.createElement("div");c.classList.add(n$9()),c.style.opacity="0",c.style.transform="translate("+s+"px, "+o+"px) scale3d(.3, .3, .3)",c.style.width=u+"px",c.style.height=u+"px",e.color&&(c.style.backgroundColor=e.color),c.dataset.createdAt=String(performance.now()),setStyles(this),this.appendChild(c),window.setTimeout(()=>{c.style.transform="translate("+a+"px, "+l+"px) scale3d(1, 1, 1)",c.style.opacity=".25"},20)};e.tasker=window.setTimeout(r,30)}}function removeRipple(){var i=this._ripple,e=()=>{var r=this.querySelectorAll("."+n$9());if(r.length){var s=r[r.length-1],o=ANIMATION_DURATION-performance.now()+Number(s.dataset.createdAt);window.setTimeout(()=>{s.style.opacity="0",window.setTimeout(()=>{var a;return(a=s.parentNode)==null?void 0:a.removeChild(s)},ANIMATION_DURATION)},o)}};i.tasker?window.setTimeout(e,30):e()}function forbidRippleTask(){if(!(!supportTouch()||!Context.enableRipple)){var i=this._ripple;i.tasker&&window.clearTimeout(i.tasker),i.tasker=null}}function mounted$1(i,e){var r;i._ripple=_extends$4({tasker:null},(r=e.value)!=null?r:{},{removeRipple:removeRipple.bind(i)}),i.addEventListener("touchstart",createRipple,{passive:!0}),i.addEventListener("touchmove",forbidRippleTask,{passive:!0}),i.addEventListener("dragstart",removeRipple,{passive:!0}),document.addEventListener("touchend",i._ripple.removeRipple,{passive:!0}),document.addEventListener("touchcancel",i._ripple.removeRipple,{passive:!0})}function unmounted$1(i){i.removeEventListener("touchstart",createRipple),i.removeEventListener("touchmove",forbidRippleTask),i.removeEventListener("dragstart",removeRipple),document.removeEventListener("touchend",i._ripple.removeRipple),document.removeEventListener("touchcancel",i._ripple.removeRipple)}function updated$1(i,e){var r,s,o,a,l={color:(r=e.value)==null?void 0:r.color,disabled:(s=e.value)==null?void 0:s.disabled},u=l.color!==((o=i._ripple)==null?void 0:o.color)||l.disabled!==((a=i._ripple)==null?void 0:a.disabled);if(u){var c,d;i._ripple=_extends$4({tasker:l.disabled?null:(c=i._ripple)==null?void 0:c.tasker,removeRipple:(d=i._ripple)==null?void 0:d.removeRipple},l)}}var Ripple={mounted:mounted$1,unmounted:unmounted$1,updated:updated$1,install(i){i.directive("ripple",this)}};const Ripple$1=Ripple;function resolveLock(){var i=Object.keys(Context.locks).length;i<=0?document.body.classList.remove("var--lock"):document.body.classList.add("var--lock")}function addLock(i){Context.locks[i]=1,resolveLock()}function releaseLock(i){delete Context.locks[i],resolveLock()}function useLock(i,e){var{uid:r}=getCurrentInstance();e&&watch(e,s=>{s===!1?releaseLock(r):s===!0&&i()===!0&&addLock(r)}),watch(i,s=>{e&&e()===!1||(s===!0?addLock(r):releaseLock(r))}),onBeforeMount(()=>{e&&e()===!1||i()===!0&&addLock(r)}),onUnmounted(()=>{e&&e()===!1||i()===!0&&releaseLock(r)}),onActivated(()=>{e&&e()===!1||i()===!0&&addLock(r)}),onDeactivated(()=>{e&&e()===!1||i()===!0&&releaseLock(r)})}function useZIndex(i,e){var r=ref(Context.zIndex);return watch(i,s=>{s&&(Context.zIndex+=e,r.value=Context.zIndex)},{immediate:!0}),{zIndex:r}}var props$8={name:{type:String},size:{type:[Number,String]},color:{type:String},namespace:{type:String,default:"var-icon"},transition:{type:[Number,String],default:0},animationClass:{type:String},onClick:defineListenerProp()};function asyncGeneratorStep(i,e,r,s,o,a,l){try{var u=i[a](l),c=u.value}catch(d){r(d);return}u.done?e(c):Promise.resolve(c).then(s,o)}function _asyncToGenerator(i){return function(){var e=this,r=arguments;return new Promise(function(s,o){var a=i.apply(e,r);function l(c){asyncGeneratorStep(a,s,o,l,u,"next",c)}function u(c){asyncGeneratorStep(a,s,o,l,u,"throw",c)}l(void 0)})}}var{n:n$8,classes:classes$6}=createNamespace("icon");function __render__$8(i,e){return openBlock(),createBlock(resolveDynamicComponent(i.isURL(i.name)?"img":"i"),{class:normalizeClass(i.classes(i.n(),[i.namespace!==i.n(),i.namespace],i.namespace+"--set",[i.isURL(i.name),i.n("image"),i.namespace+"-"+i.nextName],[i.animateInProgress,i.animationClass==null?i.n("--shrinking"):i.animationClass])),style:normalizeStyle({color:i.color,"transition-duration":i.toNumber(i.transition)+"ms",width:i.isURL(i.name)?i.toSizeUnit(i.size):null,height:i.isURL(i.name)?i.toSizeUnit(i.size):null,fontSize:i.toSizeUnit(i.size)}),src:i.isURL(i.name)?i.nextName:null,onClick:i.onClick},null,8,["class","style","src","onClick"])}var __sfc__$8=defineComponent({name:"VarIcon",props:props$8,setup(i){var e=ref(""),r=ref(!1),s=function(){var o=_asyncToGenerator(function*(a,l){var{transition:u}=i;if(l==null||toNumber(u)===0){e.value=a;return}r.value=!0,yield nextTick(),setTimeout(()=>{l!=null&&(e.value=a),r.value=!1},toNumber(u))});return function(l,u){return o.apply(this,arguments)}}();return watch(()=>i.name,s,{immediate:!0}),{n:n$8,classes:classes$6,nextName:e,animateInProgress:r,isURL,toNumber,toSizeUnit}}});__sfc__$8.render=__render__$8;const Icon=__sfc__$8;Icon.install=function(i){i.component(Icon.name,Icon)};function typeValidator$3(i){return["circle","wave","cube","rect","disappear"].includes(i)}function sizeValidator$2(i){return["normal","mini","small","large"].includes(i)}var props$7={type:{type:String,default:"circle",validator:typeValidator$3},radius:{type:[String,Number]},size:{type:String,default:"normal",validator:sizeValidator$2},color:{type:String},description:{type:String},loading:{type:Boolean,default:!1}},{n:n$7,classes:classes$5}=createNamespace("loading"),_withScopeId=i=>(pushScopeId(""),i=i(),popScopeId(),i),_hoisted_1$3=_withScopeId(()=>createBaseVNode("svg",{viewBox:"25 25 50 50"},[createBaseVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),_hoisted_2$1=[_hoisted_1$3];function __render__$7(i,e){return openBlock(),createElementBlock("div",{class:normalizeClass(i.n())},[i.$slots.default?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(i.classes(i.n("content"),[i.loading,i.n("content--active")]))},[renderSlot(i.$slots,"default"),i.loading?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(i.n("content-mask"))},null,2)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),i.isShow?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(i.classes(i.n("$--box"),i.n("body"),[i.$slots.default,i.n("inside")]))},[i.type==="circle"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(i.n("circle"))},[createBaseVNode("span",{class:normalizeClass(i.classes(i.n("circle-block"),i.n("circle-block--"+i.size))),style:normalizeStyle({width:i.multiplySizeUnit(i.radius,2),height:i.multiplySizeUnit(i.radius,2),color:i.color})},_hoisted_2$1,6)],2)):createCommentVNode("v-if",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(i.loadingTypeDict,(r,s)=>(openBlock(),createElementBlock(Fragment,{key:s},[i.type===s?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(i.classes(i.n(s),i.n(s+"--"+i.size)))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(r,o=>(openBlock(),createElementBlock("div",{key:o+s,style:normalizeStyle({backgroundColor:i.color}),class:normalizeClass(i.classes(i.n(s+"-item"),i.n(s+"-item--"+i.size)))},null,6))),128))],2)):createCommentVNode("v-if",!0)],64))),128)),i.$slots.description||i.description?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(i.classes(i.n("description"),i.n("description--"+i.size))),style:normalizeStyle({color:i.color})},[renderSlot(i.$slots,"description",{},()=>[createTextVNode(toDisplayString(i.description),1)])],6)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0)],2)}var __sfc__$7=defineComponent({name:"VarLoading",props:props$7,setup(i,e){var{slots:r}=e,s={wave:5,cube:4,rect:8,disappear:3},o=computed(()=>call(r.default)?i.loading:!0);return{n:n$7,classes:classes$5,multiplySizeUnit,loadingTypeDict:s,isShow:o}}});__sfc__$7.render=__render__$7;const Loading=__sfc__$7;Loading.install=function(i){i.component(Loading.name,Loading)};var props$6={hovering:{type:Boolean,default:!0}},{n:n$6,classes:classes$4}=createNamespace("hover-overlay");function __render__$6(i,e){return openBlock(),createElementBlock("div",{class:normalizeClass(i.classes(i.n(),[i.hovering,i.n("--hovering")]))},null,2)}var __sfc__$6=defineComponent({name:"VarHoverOverlay",props:props$6,setup(){return{n:n$6,classes:classes$4}}});__sfc__$6.render=__render__$6;const HoverOverlay=__sfc__$6;HoverOverlay.install=function(i){i.component(HoverOverlay.name,HoverOverlay)};function useHoverOverlay(){var i=ref(!1),e=r=>{i.value=r};return{hovering:i,handleHovering:e}}function shouldDisabled(i){if(!i)return!1;var e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return!!(i==="desktop"&&e||i==="mobile"&&!e)}function getStyle(i){var e=i.getAttribute("style");return e?e.split(";").filter(Boolean).reduce((r,s)=>{var[o,a]=s.split(":").map(l=>l.trim());return r[camelize(o)]=a,r},{}):{}}function updateRawStyle(i){var{value:e}=i._hover,r=getStyle(i);Object.keys(e).forEach(s=>{var o=camelize(s),a=e[o];a!=null&&r[o]&&(i._hover.rawStyle[o]=r[o])})}function updateStyle(i,e){Object.keys(e).forEach(r=>{var s=e[r];s!=null&&(i.style[r]=s)})}function clearStyle(i){Object.keys(i._hover.value).forEach(e=>{var r=i._hover.value[e];r!=null&&(i.style[e]="")})}function restoreStyle(i){clearStyle(i),updateStyle(i,i._hover.rawStyle)}function createHover(){var{value:i}=this._hover;if(this._hover.hovering=!0,isFunction$2(i)){i(this._hover.hovering);return}updateStyle(this,i)}function removeHover(){if(this._hover.hovering=!1,isFunction$2(this._hover.value)){this._hover.value(this._hover.hovering);return}restoreStyle(this)}function mounted(i,e){var r,s,{arg:o,value:a}=e;shouldDisabled(o)||(i._hover={value:a,hovering:(r=(s=i._hover)==null?void 0:s.hovering)!=null?r:!1,rawStyle:{}},updateRawStyle(i),i.addEventListener("mouseenter",createHover),i.addEventListener("mouseleave",removeHover))}function unmounted(i,e){shouldDisabled(e.arg)||(restoreStyle(i),i.removeEventListener("mouseenter",createHover),i.removeEventListener("mouseleave",removeHover))}function beforeUpdate(i,e){i._hover&&unmounted(i,e)}function shouldUpdateStyle(i,e){return!isFunction$2(e.value)&&i._hover.hovering}function updated(i,e){mounted(i,e),shouldUpdateStyle(i,e)&&updateStyle(i,e.value)}var Hover={mounted,unmounted,beforeUpdate,updated,install(i){i.directive("hover",this)}};const Hover$1=Hover;function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(i){for(var e=1;e{if(!r)return{elevation:formatElevation(i.elevation,2),type:i.type!=null?i.type:"default",size:i.size!=null?i.size:"normal",color:i.color,text:i.text,textColor:i.textColor,outline:i.outline};var{type:d,size:y,color:m,textColor:g,mode:v}=r;return{elevation:"",type:i.type!=null?i.type:d.value,size:i.size!=null?i.size:y.value,color:i.color!=null?i.color:m.value,textColor:i.textColor!=null?i.textColor:g.value,text:v.value!=="normal",outline:v.value==="outline"}}),l=d=>{i.autoLoading&&(e.value=!0,d=isArray$2(d)?d:[d],Promise.all(d).then(()=>{e.value=!1}).catch(()=>{e.value=!1}))},u=d=>{var{loading:y,disabled:m,onClick:g}=i;!g||y||m||e.value||l(call(g,d))},c=d=>{var{loading:y,disabled:m,onTouchstart:g}=i;!g||y||m||e.value||l(call(g,d))};return{n:n$5,classes:classes$3,pending:e,states:a,hovering:s,handleHovering:o,handleClick:u,handleTouchstart:c}}});__sfc__$5.render=__render__$5;const Button=__sfc__$5;Button.install=function(i){i.component(Button.name,Button)};function typeValidator$1(i){return["default","primary","info","success","warning","danger"].includes(i)}function sizeValidator(i){return["normal","mini","small","large"].includes(i)}function modeValidator(i){return["normal","text","outline"].includes(i)}var props$4={type:{type:String,default:"default",validator:typeValidator$1},size:{type:String,default:"normal",validator:sizeValidator},color:{type:String},textColor:{type:String},mode:{type:String,default:"normal",validator:modeValidator},elevation:{type:[Boolean,Number,String],default:!0},vertical:{type:Boolean,default:!1}},{n:n$4,classes:classes$2}=createNamespace("button-group");function __render__$4(i,e){return openBlock(),createElementBlock("div",{class:normalizeClass(i.classes(i.n(),i.n("$--box"),[i.mode,""+i.n("--mode-"+i.mode)],[i.vertical,i.n("--vertical"),i.n("--horizontal")],[i.mode==="normal",i.formatElevation(i.elevation,2)]))},[renderSlot(i.$slots,"default")],2)}var __sfc__$4=defineComponent({name:"VarButtonGroup",props:props$4,setup(i){var{bindButtons:e}=useButtons(),r={elevation:computed(()=>i.elevation),type:computed(()=>i.type),size:computed(()=>i.size),color:computed(()=>i.color),textColor:computed(()=>i.textColor),mode:computed(()=>i.mode)};return e(r),{n:n$4,classes:classes$2,formatElevation}}});__sfc__$4.render=__render__$4;const ButtonGroup=__sfc__$4;ButtonGroup.install=function(i){i.component(ButtonGroup.name,ButtonGroup)};var props$3={errorMessage:{type:String,default:""},extraMessage:{type:String,default:""}},{n:n$3}=createNamespace("form-details"),_hoisted_1$1={key:0},_hoisted_2={key:0};function __render__$3(i,e){return openBlock(),createBlock(Transition,{name:i.n()},{default:withCtx(()=>[i.errorMessage||i.extraMessage?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(i.n())},[createBaseVNode("div",{class:normalizeClass(i.n("error-message"))},[createVNode(Transition,{name:i.n("message")},{default:withCtx(()=>[i.errorMessage?(openBlock(),createElementBlock("div",_hoisted_1$1,toDisplayString(i.errorMessage),1)):createCommentVNode("v-if",!0)]),_:1},8,["name"])],2),createBaseVNode("div",{class:normalizeClass(i.n("extra-message"))},[createVNode(Transition,{name:i.n("message")},{default:withCtx(()=>[i.extraMessage?(openBlock(),createElementBlock("div",_hoisted_2,toDisplayString(i.extraMessage),1)):createCommentVNode("v-if",!0)]),_:1},8,["name"])],2)],2)):createCommentVNode("v-if",!0)]),_:1},8,["name"])}var __sfc__$3=defineComponent({name:"VarFormDetails",props:props$3,setup:()=>({n:n$3})});__sfc__$3.render=__render__$3;const FormDetails=__sfc__$3;FormDetails.install=function(i){i.component(FormDetails.name,FormDetails)};function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(i){for(var e=1;e{r(_extends$2({},a,{instance:s}))}:null;return{index:e,form:i,bindForm:o}}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(i){for(var e=1;e[createTextVNode(toDisplayString(i.content),1)])],2),createBaseVNode("div",{class:normalizeClass(i.n("action"))},[i.iconName?(openBlock(),createBlock(r,{key:0,name:i.iconName},null,8,["name"])):createCommentVNode("v-if",!0),i.type==="loading"?(openBlock(),createBlock(s,{key:1,type:i.loadingType,size:i.loadingSize,color:i.loadingColor,radius:i.loadingRadius},null,8,["type","size","color","radius"])):createCommentVNode("v-if",!0),renderSlot(i.$slots,"action")],2)],6)],6)),[[vShow,i.show]])}var __sfc__$2=defineComponent({name:"VarSnackbarCore",components:{VarLoading:Loading,VarIcon:Icon},props:props$2,setup(i){var e=ref(null),{zIndex:r}=useZIndex(()=>i.show,1);useLock(()=>i.show,()=>i.lockScroll);var s=computed(()=>i.type==="loading"||i.forbidClick),o=computed(()=>i.type?ICON_TYPE_DICT[i.type]:""),a=()=>{e.value=setTimeout(()=>{i.type!=="loading"&&call(i["onUpdate:show"],!1)},i.duration)};return watch(()=>i.show,l=>{l?(call(i.onOpen),a()):l===!1&&(clearTimeout(e.value),call(i.onClose))}),watch(()=>i._update,()=>{clearTimeout(e.value),a()}),useMounted(()=>{i.show&&(call(i.onOpen),a())}),{SNACKBAR_TYPE,n:n$2,classes:classes$1,zIndex:r,iconName:o,isForbidClick:s}}});__sfc__$2.render=__render__$2;const VarSnackbarCore=__sfc__$2;var{n:n$1}=createNamespace("snackbar");function __render__$1(i,e){var r=resolveComponent("var-snackbar-core");return openBlock(),createBlock(Teleport,{to:i.teleport,disabled:i.disabled},[createVNode(Transition,{name:i.n()+"-fade",onAfterEnter:i.onOpened,onAfterLeave:i.onClosed},{default:withCtx(()=>[createVNode(r,mergeProps(i.$props,{class:i.n("transition")}),{action:withCtx(()=>[renderSlot(i.$slots,"action")]),default:withCtx(()=>[renderSlot(i.$slots,"default",{},()=>[createTextVNode(toDisplayString(i.content),1)])]),_:3},16,["class"])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"])}var __sfc__$1=defineComponent({name:"VarSnackbar",components:{VarSnackbarCore},props:props$2,setup(){var{disabled:i}=useTeleport();return{n:n$1,disabled:i}}});__sfc__$1.render=__render__$1;const VarSnackbar=__sfc__$1;function _extends(){return _extends=Object.assign?Object.assign.bind():function(i){for(var e=1;e{},onOpened:()=>{},onClose:()=>{},onClosed:()=>{}},uniqSnackbarOptions=reactive([]),defaultOptions=defaultOptionsValue,transitionGroupProps={name:"var-snackbar-fade",tag:"div",class:"var-transition-group"},TransitionGroupHost={setup(){return()=>{var i=uniqSnackbarOptions.map(e=>{var{id:r,reactiveSnackOptions:s,_update:o}=e,a=document.querySelector(".var-transition-group");s.forbidClick||s.type==="loading"?a.classList.add("var-pointer-auto"):a.classList.remove("var-pointer-auto"),isAllowMultiple&&(s.position="top");var l=isAllowMultiple?"relative":"absolute",u=_extends({position:l},getTop(s.position));return createVNode(VarSnackbarCore,mergeProps(s,{key:r,style:u,"data-id":r,_update:o,show:s.show,"onUpdate:show":c=>s.show=c}),null)});return createVNode(TransitionGroup,mergeProps(transitionGroupProps,{style:{zIndex:Context.zIndex},onAfterEnter:opened,onAfterLeave:removeUniqOption}),_isSlot(i)?i:{default:()=>[i]})}}},Snackbar=function(i){var e=normalizeOptions(i),r=reactive(_extends({},defaultOptions,e));r.show=!0,isMount||(isMount=!0,unmount=mountInstance(TransitionGroupHost).unmountInstance);var{length:s}=uniqSnackbarOptions,o={id:sid++,reactiveSnackOptions:r};if(s===0||isAllowMultiple)addUniqOption(o);else{var a="update-"+sid;updateUniqOption(r,a)}return{clear(){!isAllowMultiple&&uniqSnackbarOptions.length?uniqSnackbarOptions[0].reactiveSnackOptions.show=!1:r.show=!1}}};SNACKBAR_TYPE.forEach(i=>{Snackbar[i]=e=>(isPlainObject(e)?e.type=i:e={content:e,type:i},Snackbar(e))});Snackbar.install=function(i){i.component(VarSnackbar.name,VarSnackbar)};Snackbar.allowMultiple=function(i){i===void 0&&(i=!1),i!==isAllowMultiple&&(uniqSnackbarOptions.forEach(e=>{e.reactiveSnackOptions.show=!1}),isAllowMultiple=i)};Snackbar.clear=function(){uniqSnackbarOptions.forEach(i=>{i.reactiveSnackOptions.show=!1})};Snackbar.setDefaultOptions=function(i){defaultOptions=i};Snackbar.resetDefaultOptions=function(){defaultOptions=defaultOptionsValue};Snackbar.Component=VarSnackbar;function opened(i){var e=i.getAttribute("data-id"),r=uniqSnackbarOptions.find(s=>s.id===toNumber(e));r&&call(r.reactiveSnackOptions.onOpened)}function removeUniqOption(i){i.parentElement&&i.parentElement.classList.remove("var-pointer-auto");var e=i.getAttribute("data-id"),r=uniqSnackbarOptions.find(o=>o.id===toNumber(e));r&&(r.animationEnd=!0,call(r.reactiveSnackOptions.onClosed));var s=uniqSnackbarOptions.every(o=>o.animationEnd);s&&(call(unmount),uniqSnackbarOptions=reactive([]),isMount=!1)}function addUniqOption(i){uniqSnackbarOptions.push(i)}function normalizeOptions(i){return i===void 0&&(i={}),isString(i)?{content:i}:i}function updateUniqOption(i,e){var[r]=uniqSnackbarOptions;r.reactiveSnackOptions=_extends({},r.reactiveSnackOptions,i),r._update=e}function getTop(i){return i===void 0&&(i="top"),i==="bottom"?{[i]:"5%"}:{top:i==="top"?"5%":"45%"}}VarSnackbar.install=function(i){i.component(VarSnackbar.name,VarSnackbar)};const Snackbar$1=Snackbar;var props$1={modelValue:{default:!1},activeValue:{default:!0},inactiveValue:{default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},color:{type:String},loadingColor:{type:String},closeColor:{type:String},size:{type:[String,Number]},rules:{type:Array},ripple:{type:Boolean,default:!0},onClick:defineListenerProp(),onChange:defineListenerProp(),"onUpdate:modelValue":defineListenerProp()},{n,classes}=createNamespace("switch");function __render__(i,e){var r=resolveComponent("var-loading"),s=resolveComponent("var-hover-overlay"),o=resolveComponent("var-form-details"),a=resolveDirective("ripple"),l=resolveDirective("hover");return withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(i.n())},[createBaseVNode("div",{class:normalizeClass(i.classes(i.n("block"),[i.disabled||i.formDisabled,i.n("--disabled")])),onClick:e[0]||(e[0]=function(){return i.switchActive&&i.switchActive(...arguments)}),style:normalizeStyle(i.styleComputed.switch)},[createBaseVNode("div",{style:normalizeStyle(i.styleComputed.track),class:normalizeClass(i.classes(i.n("track"),[i.modelValue===i.activeValue,i.n("track--active")],[i.errorMessage,i.n("track--error")]))},null,6),withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(i.classes(i.n("ripple"),[i.modelValue===i.activeValue,i.n("ripple--active")])),style:normalizeStyle(i.styleComputed.ripple)},[createBaseVNode("div",{style:normalizeStyle(i.styleComputed.handle),class:normalizeClass(i.classes(i.n("handle"),i.n("$-elevation--2"),[i.modelValue===i.activeValue,i.n("handle--active")],[i.errorMessage,i.n("handle--error")]))},[i.loading?(openBlock(),createBlock(r,{key:0,radius:i.radius,color:"currentColor"},null,8,["radius"])):createCommentVNode("v-if",!0)],6),createVNode(s,{hovering:i.hovering},null,8,["hovering"])],6)),[[a,{disabled:!i.ripple||i.disabled||i.loading||i.formDisabled}]])],6),createVNode(o,{"error-message":i.errorMessage},null,8,["error-message"])],2)),[[l,i.hover,"desktop"]])}var __sfc__=defineComponent({name:"VarSwitch",components:{VarLoading:Loading,VarFormDetails:FormDetails,VarHoverOverlay:HoverOverlay},directives:{Ripple:Ripple$1,Hover:Hover$1},props:props$1,setup(i){var{bindForm:e,form:r}=useForm(),{errorMessage:s,validateWithTrigger:o,validate:a,resetValidation:l}=useValidation(),{hovering:u,handleHovering:c}=useHoverOverlay(),d=()=>a(i.rules,i.modelValue),y=()=>nextTick(()=>o(["onChange"],"onChange",i.rules,i.modelValue)),m=computed(()=>{var{size:A,modelValue:E,color:w,closeColor:_,loadingColor:T,activeValue:C}=i;return{handle:{width:multiplySizeUnit(A),height:multiplySizeUnit(A),backgroundColor:E===C?w:_,color:T},ripple:{left:E===C?multiplySizeUnit(A,.5):"-"+multiplySizeUnit(A,.5),color:E===C?w:_||"#999",width:multiplySizeUnit(A,2),height:multiplySizeUnit(A,2)},track:{height:multiplySizeUnit(A,.72),width:multiplySizeUnit(A,1.9),borderRadius:multiplySizeUnit(A,2/3),filter:E===C||s!=null&&s.value?void 0:"brightness(.6)",backgroundColor:E===C?w:_},switch:{height:multiplySizeUnit(A,1.2),width:multiplySizeUnit(A,2)}}}),g=computed(()=>{var{size:A="5.333vw"}=i;return multiplySizeUnit(A,.4)}),v=A=>{var{onClick:E,onChange:w,disabled:_,loading:T,readonly:C,modelValue:P,activeValue:k,inactiveValue:M,"onUpdate:modelValue":R}=i;if(call(E,A),!(_||T||C||r!=null&&r.disabled.value||r!=null&&r.readonly.value)){var H=P===k?M:k;call(w,H),call(R,H),y()}},b=A=>{i.disabled||r!=null&&r.disabled.value||c(A)},S=()=>{call(i["onUpdate:modelValue"],i.inactiveValue),l()},x={reset:S,validate:d,resetValidation:l};return call(e,x),{n,classes,switchActive:v,hovering:u,hover:b,radius:g,styleComputed:m,errorMessage:s,formDisabled:r==null?void 0:r.disabled,formReadonly:r==null?void 0:r.readonly}}});__sfc__.render=__render__;const Switch=__sfc__;Switch.install=function(i){i.component(Switch.name,Switch)};const Image1=""+new URL("../png/5-d8bfbf51.png",import.meta.url).href,Image2=""+new URL("../png/4-cfa387c7.png",import.meta.url).href,Image3=""+new URL("../png/3-d02c685a.png",import.meta.url).href,Image4=""+new URL("../png/2-5c4c2ef5.png",import.meta.url).href,Image5=""+new URL("../png/1-a0d5037d.png",import.meta.url).href,clx1=""+new URL("../svg/clx5-b3331931.svg",import.meta.url).href,clx2=""+new URL("../svg/clx4-7a8a1657.svg",import.meta.url).href,clx3=""+new URL("../svg/clx3-82262a8a.svg",import.meta.url).href,clx4=""+new URL("../svg/clx2-99f2ced3.svg",import.meta.url).href,clx5=""+new URL("../svg/clx1-3d063166.svg",import.meta.url).href,good="data:image/png;base64,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",bad="data:image/png;base64,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",perfect="data:image/png;base64,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",great="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAACQCAMAAABd0AL3AAAC+lBMVEUAAAAEIjMEIzYAHzQDIzcBIzQAIzYAJDcAIzYAIzYFJTcAIzUAIzYAIjYAIzYAIzYAIzYAIzb9/v4AIzbs8PH8/f2drbP5+fmOoKjN1djb4+T2+PlvjZb09/f2+Pi/ztIAJDcFLkDg5+m0wMX8/f05WGWywcYUOEm8ys9TcHy4x8sGMEHS3N8lRlVCZXP/////oXP/nXH/mW8AapkAOEb/gWQA/woAHCT/imj/jmv/hmYAlbwAN5f/lG0Sp8gurMkzr8oAjLY6scsDbpwAMIb/kmsCmr8+s8wLo8YA6gL/l2z/aWcGSlgANI8AICoAkLklqcgEn8P2+vsBO0oALX04rsgA7wEANEAAKXUERlUAJTAEQE0Dgq4aqsn/0bsAFh4A+wgCKzb/dGoBMDwcpMT/w7MDQlL/zLf/fGIPoMH/jmQDh7L/SoUAI2MA9wUEdaEBX4YAG0wA8wT/x7eLvNEBaIQBJ2wAH1j/gGwto77/sXUDe6gci6/Z8PS+3ugAEzX/WYfB0dQBWH6P0+IOjKjtglr/wKe/cFMeKRgAGED/sZDBf3YEQo//nHtxr8cDZJH/hKRs9oD/eJz3mXAAQ10af6X/upr/aZEAUnIRkrMgnLsFdpAfVV0BTGYSmLs1lLMFOHjeg21WvNNBoL1gb5NGttD/p3txRCkCVZnxjmeLZlbQ4+gJhaH/qYb9kHek1+W/x8o5b5MCJUdiV4Ns+YJrwNX/7+UBKQVpiJHqi34x9UVNMxxSdXySVDkA3x0JJxgmZHx1mqZ7YYVpSE4gO0EAZwSRqrD/Znh6y91TpsI1jaQW9SlZma+RlqIogYrfkXYKZWyzX0EaIA3/38/Rd1Fs/ISWXHv/joMGNSf/h5XaapVAXYbvTIXNUIT/eoKqdntKTGsRQTqhgqHGmowCczEAzwoAoQg+S45f+HYoOnaCXWxL9mMAtw0A4AvkoJSnu8AAvi0oLl2sU4QApzT/o7e0xckP2lkAh0JDMUoHgmQjvpAAnUUWzYYJwknwv95DAAAAL3RSTlMACQ4UGyhKY4R0IjBAOGt9UlrwifPiwYq6xSN8kapZ146N54nBmsyOraZXkdKHe359+7gAACz8SURBVHja7JpbaFJxHMfTbtAFSopIcS/tIXrp6KHoglkeZiVBLTCIWQQlsYKELg/i5UXTEBpEKLjZJG1KbeZLssrEooK5yrZR4Ou6EXSh1976/f7/c/wf7XSxDSrwM9jazuX/2+d8/7//+Y/mtGnT5i+jU0Q7Z45qTpsW0K9XQtOpValUbZW/jXbVemU0ejWabMfyNz2uXP8j9uu1anU7lL9Hh4aJU5jd89Tqdih/A5XMo7+vTp7N7nlz1ep2Jn+FVreeeRT4Op6CbHbPnds2+QtUnawdBqJ8umDvH0QcvCfAMrmobbIFjxVBqOQL2w8RtnnAJMvkIpje7T75YzrYcr2iwnvHAinzIZFdDtns1oDJdiZ/a7n2JXlvIDBEPUqZdOyvm1zTNvljZG/hea/gzY8NEYMDQTGTggdFUtbMhz75P75QSv1IpVVGNfMRVrE8BjxCOjA2tA/0HRsojyuJXDz/H47kOt0qRXQdKkCLRzs1iqzE07TfvydrdTq4ShEduSs7Uy/LoyAU8mNkmTk2UZ58oCRy6WIyuWdTZQeg61y5UjNzfrKf6ISjv0Cj0YMbBLx0dBDnP78Ar6CXyHaFvorgKuRTxGO850LY0KcgcvWSpfOJyVmzqNevXP/voNGvU2N29Z0tXNKhVss87neDR1iuqcepFwYORG6DjwaRmnokZ8fi+n+PTl1ny/pl7XE4yafztD1uG6kVr3Mc17eNwEQimrWzZlLbCcP/HfwyfLN653wUPe5EjcfOlUvgUVkkJHctW29m6+WV3Xw2KPTJKAxD8QzxqMfFSMP3Z33iWYol+QLkIkah4IMfK50diApJ9IjizpWzNg55wEQCsndJGsnZe+lCfGeBtMfjEmYM3wDs0/z1IPZF6VFX0Ot1UDwCOctz1q/g5ezZChbEfwf80NV3drj5/IoQhWXGjB7je6bCBo5wu5eadPEC4PHXTa6C9UY9Q5MdDQ89nfTS32c2cPT39w9K7HAJfDRPu1c6CgME02m322y32EXMbsABo0crvsYk5tNJgSqDO7rd/ZRBYK+DPDAhWmnI+/6zvGtM9DhIlhnKtW4qcgd9zF4fy+SMJ7dOnkUXKvQmvd74PrN5u9ls3kc5xNjWOvTCffuOneR5MOnrgyC6U4XU0E4FLP1BF+/qY07yFazKk+zfOTS007IdoHWxqnp3YJjTLMj+JB8dCwztw8GDteILTuKadRdjq4f3DtdN6mb4MrmqQaMr2p/CahEz4U9F7oKPOlQkEBeEs/4oDy8lBRjGYtmpqNIed/FJv1gUtACXd2cKJQJSYfKiaMZgtvaJARv2CN4x2BViGQNlXK7lIhlWF+/xNZv803ktTQjc2wuVQiEFGiVaFbmrGdHlMZlJXnDxjtRYaqfo0YIzO5lMw2eLLJUe3pOHNPZ5YYJUUilqEc9tCiQrqHeHwKeJFnhSFXGZ6R0oZyWPTCTLJDww2exme+4Z5HEYXhbGAkQjVotgz+r3IkFlerFU5UNxsdTekYk9B3v2TIwcIx7N5kGHZ9AMXijJaqKnNkqoTSeqSUtdZVzg83lIWRKkDxHhADofr04kEomenj2JxMTASPwYe45kqkJ7FMBjYd82HP3K6KSRk/FqRCReN8kagh7bJJicUX/0gUc/eiSt3+2GcnvKyIUfMz0C1Q/UFI8laKHBnvJUMTtZysLJx1Aksn07tegeny6Pjj5+9/bTp927P336+Phxuacq5dIyiNkNEo0AWkwnq3ugoKmpC9lsaRJumoWBahPB3vpsAJO4K0zDbga/HTx4YdLAyblalOrrpgU65CIX/+kfeTuYx6TM4/h9+AUvZEulUjgcPv9jrj6FSgYmFY+97oVj2KDCJzjE+KJ0n0YSs07SVZ1GiUc2Ak+e3H2CXz+9ezxdtdQzKcRhfZH65nhiujyVLYXPb7EZ65w4P1kqTk8M7qJ0e3jo8/bC0CH6FC/Q5ZphrNfXjTSKXC3uuVUzmtcV9IgxqU5Dhl5cv2wwGLifkyEiwxxiILBLPvdCnQPlko3LRGKxSCTHGV7c6wePkkjUKFr88P4l8h5koss34gS3sMXIPj5RmyqWzl8GhxdzsdCZM2ecoVgkZzAi5yeLksrukx6HFXbT+M+BWvEEq6uJz92UBpFLFot/mvzTPO6P8knwiHF07ymDRUPD+LlILARA5ZkfiTQwWKEDtdLlTOj4YeD48VCOO39bSiTEsTwKGpG7oJFy6z2aPPL2DQklw55MlKdKUJXRZjPlQmeOS5wJRQwmG8i9XkrEIV/UDTGKTzF73gCgagPh1yLZnvtP53WFerSM14phGDYTgQzRwXMxNCERijSIxHolkUapYqnQrbWsIROqX3o8xl1PipF07xl9dxqlnTr14VYdCCWZ4KffVe1Mo2W8p1ycPMHhCCZT5IzoUMSZM3WZUOXDkW451oly9rIRsJkAbAZND9qqIHLBkqUYSSayxf/LUREqw3nSH8EjpJGLOLHWUAaGzVGNTEdELrKbiqQPniKJtFqvwItHTH5tjHtGRbp7Rj8eQY2nT59+f0tu8u5G5MjHr3bikOTxUTF8meOoyItOyaOk0hkxbUaV128Euxk7rlyYNCFdmzdv3rR5c1eXDcHypPqAZpHLFixtec+t0rNtgOAa9o+hR/d0FjwaY1CpZFIywWwoisQnj5BSaaEjZdhQOOsPAKd35HmaeEyMftxIPB44cODuJeD9h/eXwCOIBL/IRza77Q+74H4R6CswRkTy6HQ6pVDmwFWXzXj53ta6x70Hp8JdIBEtbtqyZcumEye6qEsSTCoSaBK5fAF0yRZFalmDrAgFH0xsEHm/eB2UZOpNKGYwRJpFyhJ58Wm31QoiiccuLJvMMlpo8GgJvobAHwCf8HOIe2AG9oy+FTXuBmDBPg2cenIX2IgikU9VKZP2G+Q+cCMwmSOdMZa7aAIu5kIkkyRyMPC9rVbKCOwKjehxE2rcsGHDli0nKCBTrE8819MgchnO7ZaapEr2Buny+v0FMrGnX6CTCJk2aNNpNGSap3ZGJvKaVRJpM5GqwaQo8k6C7Mxy0GszmUwk5CRB4l6Dx+roO+YROAAWkSPIRokv4zsRKpI2mJjRZoigRWOXiJGovElGNhqfj1M5sFyfNxixItRIEEUyk3dOKohcSOd2CyJVWvan5wBf2U9XmkQWPUI/pxCRhtjxphapKJJ6JCZpG/pGut0+RVXFcQAfq6kXzTS9aKY39Q/0Ju4li4VdaWOv5ea2WGuRkVJJBghbEhiCjlOw2rKbxMoWDylECZRsIxSkhmMgUwnGgw34UK1BpkI1lo5m1ky/3++cs+fudXdF+5oz6gb37md/55x7Hgj1iZUC5uynwRYhy45IR2R8cg0aCkSZf5eysQYh2cfpUWDU1oX+4vV4THRluHCYbGDxUcNb0vDfBaSQtAvI7ASQ19C277k3ku3JG9Z/TTOHA99RX+ePQAbxmjuCnlXiESYo61FCIpTG+6IUEy9JpUrROWr5+SZvMYNsGiwyODLCNfuKoiCL/n6IniWpaQexj/XCd2JRI7FrFlPkyoGKhQut742PBeCqKkriS1GOWn5CyEgnOUfJefMk5OPbk9d//Bne8MG2fEXF2vLk5hJkbierrh2dnV5Mp2Q0QFrwljHwdngnpAhGwawFCbLiyK9YkHpHYjt3afTSuaii3LdUQu6AwgtSZ0xRRFT2zenSmqp8meZcPA59sxj/8CWKYNS0CGTalZC3XetoM083Zn/irli/gQ01Y/y+Ql6CBEcGKWOETEtLA0jUZ20I346FQUpHi8ZqxuIpVqYzmwaRbQ3vH4XjoktmzKUoyb9pJomQPEp0+MdEJQmXhpKc3nmfWHwkZU18vqx7xNBbQki49/8PeYN8iHw1+a31n3yIN9xUxUhSUlP8MJWBhkSQgZGR3f74kCUAifoC0iQhFQy9yIq106NMlx3BEVs2bHDEXDZTfGfxL6K/vLCUJCVkjAkf46KROUWz++sah7+kTNNLFglJtahW9/McR8i0aMg77oJh+1qa9rxoyFfXvwGQDy490CHeNV2YPb6G+k/BG2xRrgIpOnUDJM0sIq3erihTlYNPRhcka8U+M8u7vxEk6zaHqCTLADJR4PKmFLq2yaJsT2PJ7lbwFXZfcHF6P/AJdJtFOGR28na9JHv+QcnrhIRFyLKBgGyGMLwRZDUwQgYCiSFNsSCpm7LTdxR9mLJrlIZscKTIguRxnGNP6kWsJLEgdZD+EMRvhAQvgsQrHHKSo9vcRQMOCdNLAKkaISnlsGb/eGTAMB6fuZvOwsyL27JvvAJyKdywipAprG/WCDJ0ynEVSCdCWuJB4hwNICHshWrfU78BlLGHzLlEiPDL/DOfOtILF3BFnEEqgd39p1i6dwcMJWlhl4ean3aCpNNtZpB2bPMv8VEbIJOSroBcmJad4f4GJOPlTqhOyBwhH8aK7FN5pwIcvGWHHVeBdMaF5IsMGkCSJMw9lEC37UhOjJadMxqpyK1FBMleyYGleoL0h7t9ZplT1dGQBEZte9rqdDrbzQiJwPDvL0HgpdiQ1LpxiyKB5N03EOUcIemGOST7ABFS7XeQpCMepDMeJGYkwCsSQ49F1WbXIEJyR1mR517o4ll2kpo+PBZhaeJGZtlHI2Ef3Ib4hfEZJPH61LanC5wF4CggU8AxISRJOt2w2ZNIMg7lvLiQqiCRkJirQNKwGaMi+7tbqCQpFhUbtjlrkLdsCYk5ORjJSRiyQRog8QEoHSB3nXJQuCNRnhqJgtQ4pGmkohwd5w5JkmnujNbHjdG17puAMjbkTYkqkiBZ2+632RyYAXsCSBy0Y0BWQ+GEA3YeVQ2E4fYLf4mCZINNDk9R0RoKPRxR2/4H9wvrzZyRwvvS/jiQu3zma4ZEyeSKSnf02Ya35OEN/uM4c4RMn9FDsgevsA3i8LUP2BUlAWSsilRwvHecqg6olMDIcbMBUo7aEccnReAlgqQd3IiizVVauLawFG7J3BwwQELPTpDucsrTCKldAflBeTaPMy1KslwSuimwm75BJ8k3ao1dZEzILwKKMEllkhbTGZevsa6ubkBTpGTiitQ4JLRjjKO7fyIcDvfzUtj6awxICkquEZKiaV+A0xkrrQ6muPaxFb2wndS2d3zFY11rqwzDNgQhDxbAcANIi+NA6vx0khBn2pK8lRCx1dmQDedrZOvGh8u5QcLyViAy2eOzU5O2qelbzEA+6VAUngSQSZB+syEJISlAyQOgRQS5ElKAjFnLVtCWXCCgBAIdVX1t3xkhaV7VsgsgIQbI1KtDLlmSh5Byo/PB+mS3lLybH2iZC2RdB4ekZpJPSe1r2r+/6ae2CKQiQ5BWBikccZ7GILtjQo4mgtT3lkU5HDIvDyELH9jcV6VvFard2EdCELJSX5GpElKLQC4kvG1GSYDMY5AkCXM9qEnZuuXRoMSQ6QA5wxct2HoJpxxr27u3rYoWx4SjCtFDwlK1aT5LBDIQ07G9MTGkMRfy8hDS1jXepxln2QkgZUWGXuMtm0NO8YrcPlVz7FBF4pLEmqy7oibnUpEnWEmiJFGypFZV5WsEqRCkXMgCSCtC+j25QZOhIkPIZjbGutMw2FBPSIuRMfMvQdq6Nn+nil3KuJAYgMzWQ/o93mjIaYbX8HtNTW3tsUP1UZJGSDjMpR9x7pSSiSuyojmMkGJ9Lx8m3PSb9uAYHXfER0yCtBKkF5bc/AbI3eBoLTc4lj9SeY5PteXUhnL23ZgpWZi3ZKF16zhugdj51lo8SAADyON6SEsw1zM/CjLwOblN1SDkO+9MVURDkqRo2yhZmfyWPNbLlzMSQqZD6l1nVLGwzEKM6GjRQ8qNTQ4ZBEjvfIoeEtagC2RRImxeXr0RkrftRaM2Yxzw24fvcOdmWjvWcIcrLuR8BtZyHAYbzGgAvsYPe40hKEkJmdRxYrRxtKm2pub8eYB859iwQVJfkpCyDN3s8R5+yCoe5FscssHlmkCniCQUZApzBEidI27g+VX4M4f0AGSQQaYQpIKQ7XhzzvL2iKNzCRxrukhz7T2zeyQk5ZzLZnMZHB22Zic84i3uU+m5DEKPVrBAOhKIhoQ5Na9IAVmC+8qdAOmdj5ApDBJSBSev+qAgew57f3xn48ZjB3mvaeglBaR7+3oJiZve8SG3tMLqD0Jm2lxnWoSkjGYoSHL0FHujIT3GisSCpBS46chyGh0lyRtFyCHYyh7iOw18z6tosQtii07XMuvCJZWb0cRiwg8VP6RwN8wQPug3QtLozB5/MI34RV6A9JgYZL5dTCrs2tGa2uKe5d51kxtRUtSkceDGo0fRkOKQVfyK/JDOlLa7QFI1SLJ6FJAqg/TCDuOOSNPOLc6lvkjMbAiy3cq34EVAEf57eRGg7fn07bdnDSV58hmU1Fu6Huv9uT4vr6QPO0hsJNS0+x0sLYkhd1YRJMTPnyM1hKT4j9Yi5Lp160Ik6XQKSV6RsiSjIO9ih6wAMmEfmdngdmVlcUmLJmLRO4oTFXgWwxsfUkFI1likI6vIdnz+Qci39whIcbjihSx0FJquwgd6fzkLkE1sd43tXSsBH4ds00Ha9ZBOinWTgAzOR0hq21xysra25nDPKoBkNVnBW3dD65eHpqamDn3ZKiAfNkCKQ1YJIcua6nxZWVnNMxaiFLHbI4ejJKQHIINGSJSUkO4II/yBEKkkk6GTzBn6FCRPy5LkNXmkq9TFU9q1ondw0f1nK1euPJCPa+AmvnW9mzvaoiHJkSCtHHIG+8hilJyk+4KS1EP29HgQUtRkWsPwoekaGstrcQgCjxgVSVtjiSFp3e+j97IwZ6o70E5uILdMhMCQ78Ggo5oLkJ4oyFwjZDlnzM7AWAkSji1mvLcPzD6VJamryUW/9MIkeu3arudW9MLhySJ4KqrPbDiALTsCGQJD+GWATLkSsluDUZsgPTASiZKEcMjDCEk1iXBTNZRacgTa1kwsSSPk7ezHP68KaR9bm8UoZ1osKk8o3N3sGlMjmzBzhcxmjtbkLZiMbXT4c8GCchvuyswCpBxvikRR5sCJ3V7IIJzkZTOblZkNA7TULbrIgI2nTaGwqXYMSBo3PbkYP0LCnQlJ6CLP9xwOrmP5EZ6CEJAUjx79EcfyjR80UEkaIcVptcRN+yNF2XSgFCEJ88TExMTMieYsbGhtekiY5tDBIMWfCLJAnD/c+sQTT7yb/M1nDy/AWB24UTj0Nkqe5jVJlBRar4AFSVGj/8Bt6SGBYcbFRiKCpMSG9IXh370E6dFJqgyymCClJBlOToYgJtPG1au7G1fGgJTb3okrEt7/d3sLswwByC52eOEaIWmkBsj77rvvPTih/tmzCLnNYbsMpUclSa2bKBGPVn0oskT/LktPH5BjDVZUy194R1ldbSpLbEir1XcCegR/LpMMpaIkf6I3Qu4AydrJST8gvkZByJLKzBiQ1LYTQz7IIJO0tmVroxizwHG8Sl+QALkKIZNiDzZ2CfmIgHxxi3v9G+kI+YjP1rzPIAmUMqTKIYfaK5Yu/UJCUn9TtfenZ+BY/iaLXcxWaZVHQlrR0dpua1HsmpdL+lESvwOHXC4hkdKf5CdFyvOrV68+XuLOTCfIuo8l5C1zhSSuqrZlr+jLsrRrfCxJFqTGIZevAkgnQXo4JN9bZs+RBeRIkJAtGXCcYwEm2WYb3QfTxD2nEXKWHI2aYk/ssgsgD4IV29Klh1pYeYYFqbEqzQKsNB7KzcJUE0DytDv64etgts0SDNFBq5iQ8N4sJhRk+Wr16u/3l1DbBsjGDXrImwESj/0lgKRtT+Kyb2qDJejC0lJULHzzgfGxjihHCWmc2YiWTZCgKCFfT/56w/vUtsuhf7uIE+6hWV6RQ7Ozs0PRlABJKxkA2Trcwg9KESWfvfIzrXZ6PtNiQWY4mjuA2J/L4+lMEeONEZI5Pi8CLfvPl0t2MsiMxo+jIW+dGyTvvTvgQ9/cuwKeQvCHMvDfhSOFQ4Y+sDrFokWQHEXLporUQ26FTvLrTITM80EXdzkHN6/hjC7yYWmeRklKpCJzzja7XAdbhw/OWMSpMjKMQKoQCwbPU7CWrQnIAmu5z9YdgEGqM1ckaEqh2fokjM+HJSQO++T4KAQLklo29JEIuS35eiBJC0OWLZswkR8VkZNwgly+PDdp5Dhr2t5VsPrDt/E0NSbkMy+Xf/LGgwswGQDZfA6GabZbuGgP6yyNkOTo2v7N8K4/OqggdUFIcmSdNoeEy1tGdjHGgoJs6IwncKnDG5H0w9eFJo/i42IPQgpJGKzIkSQf3Qgt++WSEvrx4IfKk/dfF6RY9VPlfoJg5I4kqRYDpCcp7CNIpRPXI/H9id5cNu0FBMnGbd62t9lc0GVcXJPDDuMzSFmR3LHoIjgC5PDwrtIJkxGS2qi8K7Gsa1I5JKYdZpvV+BF04iFFhOxMMSFjDT5G4pqF7CDRkQcLsr8EushMKMnMjC1N1wVJt0WrPRhZi5IxhSBzOSQ1bSUpWBy0iPam6CEXRCCf2OJ+4+uHaNzOQMjSxWeL+LbhLDjK0ZtNdc6OujC+VoQsnTHpKFnLnuZ3JyWxf1YQsoBJlgNk1kQH/N8hrwcpg1iNmPPFPWKGmAQdpEqOIuD4w37oIgmyPvnd64TkRafRHFvGzhhF96T+x8u9h7ZVxXEAR8X3ps4VKSg4Fd8v9BZ8FM3SaCtS19Jr7NobkS4hWkLJFV1rSdA2VmW2GtBEk2yprWNSna85BlWi1E1a8YGIMHFd5xT9Y0OpVcT96ff3Ozn53dwl60Pw2+nWrbe3+fR3zrnn3HP77MP0nMjeEa8XdxGxVP7OTfxMg96K74LkZPCTOoolOUaQPeF/fqcrR8B99NGXJUXemf/AX/n7ORPb0Uf29vYOl0YZNeK8+/MudDl6CCRJNYMkSJ3ACCB79z1D//IC7TfWjN+BEQXJjPgU3EFCUApyt21vzoZCaNvRZGqlkHp45GVInbuVou6ecFEByOdvOjLCo7Ze7oU9O7ogJ7Hts4CStI09TzfwY6zRMYLs6TN/+e0BFCUsOfqy/JN/MOdXkOnt27e/BveNmLOWOpa7x/fPjmBmIxtzQYmgsQskYlDl9ywcHb+d8b8Xxu/wBBuetSBH7iDFkXrIOdu23+7GY9GeUSNhrhiSuZSl5FZnwwLk8xi03/nwfoLc+tZwpfyoIXlH7DRflKc/39NKkN0+cuyh5Ym6X3779XcsASEk+vuvf/zTnNqoHUf66ZHxEfrjkaPD47chbw4P7z5Cf7Gv8mkB2VKMlyqfznLs2+fG3/xBM0LxFeyGl7sUjobNIw0KMlnfTRUZMPJ1/wUS/Q2b6ShFdaHITejeN/Dw0RtHAYlMOG4P6O05+F85pMmNO/65ev63MVGEfBQJ/vRLKc1hunzVkHdFaQkgR8M8W+5GDo+pf3KGpow6E0RYr2JwF8JnWZgjx8fA+DCKUSvi9ZY7zlBBJqggu+8MUUXa1goh1S4aFcWpCOWv1EztnVfeePnI/RMMyYISUmRIOGrItm3qqjz9+g5+Arh+DI4MKcG70HU6pj0e2rKShRTLKUFBFEcHJFa6dVqSqgtBdr9E5aiatOoO1FWovoAUyIOz6CHrAflgK0pypYONbHV0RyD1vbxhfNUK8j5+E0feL+aARBjSShjx1z130tPAkTEuyL4yR4FksjjqEY7djVzzxwPe53LkJBu7ERwVwm/ZMQ15AMtkilE9gkOhLks7CiS17CjfBQNkzpdc8XXk3ZUlH9GO+kmab45s3GgoSMRVj0g55KfqGohqcj0/Vl2fKNXjlrKC1JATOXaERyNOIYpyj1Exlhx7OUm+60IJIRGSRAD56g+4Ai8yFrt9nl6zo0BCcmprPUFSRWLXylc1Jaoblgypeg0tKYaPSFNXsyzkaO/GsahAMqVYuiEHLS0ZZ0k0PF8P+CQCSbnLAKOCxA3ZyAjEXJIjUo/CCEi8fB1gZhNKcg5rjt+r0YVKkQzdjDxBJMk/327koibIfjyFtKK5tr4CKqfUjI7HNofxRY/FBPK4ROAokG0FMOrW3QpIJJDo43rcwo6QlJY9EvesL0Fid31sxFWOEzEfM4qjhsTErhg+fjTJkocHkEN0L54n7kpROwokSw7s8pYgPWWPIS8N0jP5MiBl04orhCjPEQ8v4DWPRDSk1GRFSORvkyF5xNnhIUgAReyeCmPN2ETaoyRC2Ww3Q7ZEDCfkBJ5/Y0iXYw8g/f4GP/aatOY8frJEUSbHSPIgU+pyJERhFMgnNuGj5nbBUUGuj68AMn14GBtmZK8FNOkXR+5wc7seX6AXbRQX/u4bqRAvO3brJ6to3NatOzbaSpL1iDdgp/oEEt2Fne4nRsQTiRpGjCGRgDFCHSNO5vPys28jCAp1rDw+KMIxG/XFQn4/S3a3xOyx3sNzmLMMDMxAUcrRDQnJQ5D8c0g5Lh9yB0P29h4eJif1WEfZZguZM9I6xvACV0/Ay2nhyA4ayj2IcrQH1Xnmw1oyYxhUaBQ+ouXtqJFEDF86nmNFP9WUJ2IYGdsIhLrr1QlaIoFAJNLSqPfgISHZY0tHESInayRtI+rZ0aAkG/ENi+76E5KwnNlUzRGQMEbjPrhrNNRaCXLNUiF7ehb2j9+sdpwhfF8b0YYqb+5TlyqJiBuy0QXZHTVskyBl4KakbMMXK13uaRDmYA9qnbksjs2b4YQx5CFJ/X0SRDFke21Ij8rDMd+cMHxxv5LEJ/BGAtHZPw8yJSzJ8fiWrSSpJKPdCtLvhlzFtxGrQ9LPQ0ujj+kB5eFxvq8tEUTk5ecW0BAJ0uctRVOKJV7sPVSPVp2GrKHGrYsS5ReN1DsYRYSSox9+aDdbpmmhsryoXEQUhRFHUfxlyfqS+Y6ODpwkms7yiNWoJJOKElJVKhKQt956iK7Kh1RBNiwbsoEhdfYdHb5N20kwwx9/69gWNcr2JZQhXnL12GYdQ3Let0qS7WY+iX/2oa1S4uWJ0adM5DvClgnJDN6JBnT4ADln5cARCTeD0oiOrqfGTZABfGMTe+do2JmpOGZzQfLt2P1Yj4TjSiAbdEVy+voWFvY999zw8Pibd6vQivnHn23hECSufSgRn2FXTQKOgNSZ31aCbG9HWSbsKg62nck3NzMkXTJlbIA4A48TxE7kwwxpmeFUIunLNXlQkl74g9JnJ6b2Dwy8ivGZWrKDUSBnaEkyywUpkPI892KQfkAWFeFIgdcHx47tUzl27CmKluwzVA8ZMxLhjmakA8Fv/PotU4sJpFwDwREJBoNddSlOmJPi5Cn8mTo0JJLKS1JIsLNzA+cWHfVuZ2dnV7C9zgKkPjyf9PXv8BRLkimTs7g8PwRIODolS5CbBgAZ7Yfj8iDjTwIS6bddkjx/ozAhB39kyD6bHSMYEcIaEl99CdIsgxTJsAOyq6uTPcRCMZhWWEHK55Gj+DBhlDggTYYMK8i6VNKI+1u7uSRV0gcAKbdfaWo4M6MKknLrJqrIzTk4LgdyOmG8hh+LSQd50mO9GtLlKFEVaUci5BgzkmHTBVm9IvkiqCokOXQ5IcMVIbsEEseI4y2uipTDwzY6yhCGGy2Z/hmQ+gYsVeXMAI/lM0XLGYaME2TTMiBN20jvUZJ+fzrhLkiRFMoPkujx2dEOm1YJMlxs21UqUlq3lJazrKpASoSfGV2pCskjWzTglZIkyHf1PJHvG0r4HYZsWCYk5hpakijjyTFxFEVH496SiSrHKI3Ky4OEZLNLxOF4PKTbsTrkhkqQ+jgzY2P8jnidkLdpyQGC4ytMyf7NBNnUtBxI1D5WErbLT7HNGYmeai0bkB/YAXb0ol1b7bgoPA4y7IS0FKRk3joBZJAhOzSkQ7JdH6UPc8fVRzZryHaOmcckabQ44ExiLejdO4qSM1yAs7v3zx3UmgfhCMim5UJSTRqxnL9BU/r703amp1JFfpBKglG3a6u93VmRJOmGNOdvdGewcGJIK6whC4OTDknHUYtDFqa3Kch2PUYFE7HXm9Q08wtAvkDLktwh8lYfij21ey/2Mu6d5fdyTcuFRMyUXU6JVbX+eNrO9+Gh/i064YwvBkQ9XifrglUhtaQ17WZE2j61gtUgnZ9wsg0fKpKV+IWxHLLQduPOZoaUwT7je/zpkJoAEORNLLmJHHdvxo3soa3Qkwz5ydETWBYkQqXvi8VbS0Wp1/OyQ/gZyVEkBkCdCCYftonygaSl+SpBOhwvdhblpB5rql/9TM23EfpkWByrQkpFdjEkHOkkUpHUJeSNx5/0e1nyAC3zkuQTA3wfW+2sCOXwYrdyhnLcsP0BLLosDxJffypBM6psrt8PSapKvdbPK14tiIMxmQp2ESSKzqpYke52XbvuojZ5D0CFYDVItOypyTb90TWTlgtyw2KQ7MiHFqQgGbJBQdJoQ4u87LiXHHOyZIJgnGFH6r6WDYlKyGdAicKMZT1ck4BkSaxDaUooRn2YCdd1dSlIc9tg9QjcFevWrbvg/LIGPvh+Idgl0QNNc/PU9ODOsk717224ukaorTLL5PsnyOBgjZzk/W0lSMuI79zRwn3TV68OvPouChKOtIWPt0zJIhIYOZ4hw+4wVwBJBZXPoC45vsBQHBkKFBOj+NSaQF1nZwkSrbd6pB7XrV279mq8wv87O6dKgz22De8Z5S4+foBWyw+x4xQ7yoKmOPJl8pIh5zsEstRGMzZScT0hkchT2xLIaTSjRVMLxjOQK69DUf7PqSloSNv33tMhter38wAh6noc4nLsL082So6LQV4oL3/eFEjH1Uu7mZIlBbOYuiD3RgJZN7mU13IFM56LXH/R/1+UbZOmgkwZL77X1EKO9a8dUI77qR7f7ifHXNTwSQzETpmLQp56jUj+bbkhq07jEIEMAvLrpbyS2rWseCbn3Nrrbvy/s7MQpMHeTMaf3FNPjvVKcm52Mzm2UrMe9SUTZck0W9bikGedfZk0smlrKZAP8a+yimz/VL4dNVVzARxJ8RwO/nB9bU3N4h3C+TUXX117ac0JKq3mhJFDaWAr1EEyY6Bts2NjY27X7JStHNcjOZ+RNy01F9Ad3KKQJ50MyNWXyXnmF4dkSvWfVGRBPsXF6zhr3Sk2amI8ncOW515fe8Eiqb2aj768+gdedMnaE+byS53sg592bQhjj2ZDPUK3OEb5AnxrlkeZ0Sg2nq0A8pSzTl296rI2OUvBXAzyIU0pkI5x5oJr1zGaO0DUimvWnEdZA0tQ4q/P+G/B2RbJ5VeUFfDhDZ1YMtzT2siOoVAOM42hfg8Y0a6NVPuKIc+7ytEwp5utCpBdAglFV9MutEk9kiOruXMmGMkRiqdxnJSkWfVNUvnjlpDrL3b2IJMbNgRtY/uOEBwJshW/1EVPKGpk1GwXBC5IqwqkdJKrTzsPrVsyXehYzmCD8VocwSjjCeCcb1BkxlWrVq1evXrVKliuUZb/LXwyOaHrjYLv4kWXlkHeAsnXXg+VfgiIuoWOdp3qClaGtBzDQO1xkCcRJEpyDbdu6ZEnp9yQ1Soy+G97Z6/bRBBFYS9mbYKxsQmybAkJxZJtED8tJQVtKjeIBAm5oaGhpQwvQENB4TdwQ+nCTaQoHe+QN6Ci586Z8Z6Z2R0vG6RoLPk4UgSeeL2fzr2z92wUXy2tup4emj4Iar56GmO7BQlLjVJktp+iLyOzKLeQCyB886R3thcPHJCv5orka5vj609vvn03QeipD/IdOc76BzmQuABSluyhuqnl5er4OFTa7JEnV3Y49vjokNtJL6fuBmOa3r2bphuUwhI0w+qpF8MLhp7XC0ICzANa8myuzkNVt5BUHNEev7yX3OAkAPL0/GHGcXK/0ywCqbpko9uE992LivPz1WkOJDHOV6szG/8EHBVGWC8voSgYheJtJYHZaqHCRd2tanSxplGypOiY+Cn4vs93CpAfZMdxb4v/mJ9kIN85ID/adS2n6PzuD0m2hGSv+XJI87PIRauF6MLTlWQC7tqJ1LXYERgFmq+2qCUYhWIdAkrYEgLQIvh5eSvKJTid7rUAyA/zr59tfT+x7nE4II9XM/pxakCmHkhV3GiTzc6jIdZfSzPUNTiigEHNVSoCxlsQWKLEhWaZWqWrWkHpna37kiV3CZCe5L+KQb5b/yaX/pGcZdP7dBEWt/Zk5+DF5JoT8MOnR2pqAcYG+qCvu6LbGmMCgaUucVst60G5K6pKYApJTqQ/L8IgZdx18sDlzASi5Oi0SJ/kPXiyczAejCraEn4fH4JjRziqRpiCWk51YKS0LQFzi/haJSt88afglEd8w+stIN8eL4MnOtF26eU/gSmxPSkocX08mDyvAnMkuwy2GV3WwAhovvw/mpz50qgIfaHCCwLrYZXGQ1oyB/JVBnIR5jiQ9oUOWfTZIj5JoJyOxZky79PVobRgNBhPD2FHiyMK2FUChsCIo+tvxpeKpjyKVMcXhYXBfycFD91CMApbgVrQkafh5tYHRxQ2DOmDdEhuUGICnj4dbNeYYYTNkQXsqZZXcgO6Za5NhiS59kGam0WLs2AI1dd1jZ2Ghsx58rZpyXClsATM8jyBYQR2a2KsVVMSIKqecJfVAivCSrLB4wl3x9WrIpAL+nH02FF/eidrX3BLDmSiD7QxJVwJloBpFE4TTBbhlDUKuArFSguqr8D5YfAYkuSVTdKkghdLPj9+pnSk5ZYdOebeBfqIGTUwtW1m1E5xOEB1GEawrGuRKcniGYvk2jWkgFyT4+gpMtXCumuHOOJIRAlbYgTOZv6wGEa0NUeUdZwk1c7de+L1SYK8uJyR4xg5FovO1B2ukrPT3EbSoARLwATOkHQYgYlQMMbqRyaGaoJ7Tk/+cvRnZs0XBqNXd9gGWjzNIEpObRiBOfUHlYURwBipH21Ldpv0pC/WNTBqgDQN7MiyCzbrJEO5YQmaWsE8ARSBERzj9KMddPWaw7J5F3Ma40C37srLzqA0LAVmeaCgGIIiMUbpR1oS8czz7X4cMw40NefUXbldEntqM6NtWiYri4jWjn6Kva26HwxyceDGMnb7KhNRgmV5oJBlEVHb0Q4VMAkPHwQ0wi8xZDkW8zl4pmL7Ysz1b7oVvRudNtk26Ywa2wI33zcXjG0DEGJ6VemoRswGCr4gM6hF7EbPk8y5RPl518wvXewscCFEx1Q7aqU8oRY/RiueYc4FlhQH3ixWZU6XeeY/jl+YKMR6wVhOEtUtKE2iQDk33w1Gq+h2oX3dlASkExmKOnwIRO/Cu75nWOJJE850C2++A2Oq7LgBuCO96wZFTwrK0LyGm+9Rz2kxSHsSKO0RmPMuMKr5Zc+xnKQJZ9JWXmn0sUE8ysIZUcHd950YeGNQUuMt9QLV9xgr1rdSwbi7IwNvFBJKnIBd7S8aryEFbHcH3ri0BxaP/gKdEB7KYrDIcgAAAABJRU5ErkJggg==",scoreIcon={good,bad,perfect,great},leveByScoreMeasureIcons=[{icon:scoreIcon.bad,text:"bad",color:"#EE4C6A"},{icon:scoreIcon.good,text:"good",color:"#FF958B"},{icon:scoreIcon.great,text:"great",color:"#FF8E5A"},{icon:scoreIcon.perfect,text:"perfect",color:"#516AFF"}],icons=[{img:Image1,tips:"你的演奏不太好,再练一练吧~",mome:"敢于尝试",clxImg:clx1,clxtip:"你的演奏不太好,音准和完整性还需加强,再练一练吧~",clxmome:"敢于尝试"},{img:Image2,tips:"你的演奏还不熟练,加紧训练才能有好成绩哦~",mome:"还要加油哦~",clxImg:clx2,clxtip:"你的演奏还不熟练,音准和完整性还需加强,加紧训练才能有好成绩哦~",clxmome:"还要加油哦~"},{img:Image3,tips:"你的演奏还不流畅,科学的练习才能更完美哦~",mome:"突破自我",clxImg:clx3,clxtip:"你的演奏还不流畅,音准和节奏还需加强,科学的练习才能更完美哦~",clxmome:"突破自我"},{img:Image4,tips:"你的演奏还不错,继续加油吧,离完美就差一步啦~",mome:"崭露头角",clxImg:clx4,clxtip:"你的演奏还不错,继续加油吧,加强音准,离完美就差一步啦~",clxmome:"崭露头角"},{img:Image5,tips:"你的演奏完美无缺,继续努力吧~",mome:"你很棒",clxImg:clx5,clxtip:"你的演奏非常不错,音准的把握和节奏稍有瑕疵,完整性把握的很好~",clxmome:"你很棒"}],getLeveByScore=i=>{if(!i&&typeof i!="number")return{};let e=0;return i>20&&i<=40?e=1:i>40&&i<=60?e=2:i>60&&i<=80?e=3:i>80&&(e=4),{...icons[e],leve:e}},getLeveByScoreMeasure=i=>{if(!i&&typeof i!="number")return{};let e=0;return i>=40&&i<70?e=1:i>=70&&i<90?e=2:i>=90&&(e=3),e},dots="_dots_1fmhy_1",dot$2="_dot_1fmhy_1",hide="_hide_1fmhy_22",styles$u={dots,dot:dot$2,hide},tickData=reactive({len:0,reduceLen:0,tickEnd:!1,beatLengthInMilliseconds:0,index:0,show:!1}),isUseSystemBeat=computed(()=>state$1.playType==="play"&&!state$1.isOpenMetronome||state$1.playType==="sing"&&!state$1.isSingOpenMetronome),useLen=computed(()=>isUseSystemBeat.value?tickData.reduceLen:tickData.len);let _time;function closeTick(){tickData.show&&(_time&&clearTimeout(_time),tickData.tickEnd=!0,tickData.show=!1)}const tickPlayCb=(i,e,r)=>{if(tickData.tickEnd){e(i);return}if(i===0?setTimeout(()=>{tickData.index++},100):tickData.index++,r&&(isUseSystemBeat.value||state$1.modeType==="follow"||state$1.modeType==="evaluating"&&!state$1.accompany)){const s=state$1.setting.beatVolume/100;r.volume=s,r.volume<=0?r.muted=!0:r.muted=!1,r.play()}e(i)},handlePlay=(i,e)=>new Promise(r=>{i===0?tickPlayCb(i,r,e):_time=setTimeout(()=>{tickPlayCb(i,r,e)},tickData.beatLengthInMilliseconds)}),audioData$2=reactive({tick:null,tock:null}),createAudio=i=>new Promise(e=>{const r=new Audio(i);r.load(),r.onloadedmetadata=()=>{e(r)},r.onerror=()=>{e(null)}}),handleInitTick=i=>{for(tickData.len=i;i>4&&i%2===0;)i=i/2;tickData.reduceLen=i},handleStartTick=async()=>{tickData.show=!0,tickData.tickEnd=!1,tickData.index=0,tickData.beatLengthInMilliseconds=60/state$1.speed*1e3;for(let i=0;i<=useLen.value;i++){if(tickData.tickEnd)return!1;const e=i===0?audioData$2.tick:i===useLen.value?null:audioData$2.tock;await handlePlay(i,e)}return tickData.show=!1,!0},Tick=defineComponent({name:"metronome",setup(){const i={top:"0px",left:"0px"};e();function e(){const r=document.querySelector("#musicAndSelection"),s=r==null?void 0:r.querySelector("#osmdSvgPage1"),o=s==null?void 0:s.querySelector(".staffline"),a=r==null?void 0:r.getBoundingClientRect(),l=s==null?void 0:s.getBoundingClientRect(),u=o==null?void 0:o.getBoundingClientRect();Object.assign(i,{top:((l==null?void 0:l.top)||0)-((a==null?void 0:a.top)||0)-18+"px",left:((u==null?void 0:u.left)||0)-((l==null?void 0:l.left)||0)+"px"})}return onMounted(()=>{Promise.all([createAudio(tickWav),createAudio(tockWav)]).then(([r,s])=>{r&&(audioData$2.tick=r),s&&(audioData$2.tock=s)})}),()=>tickData.show&&createVNode("div",{class:styles$u.dots,style:i},[Array.from({length:useLen.value}).map((r,s)=>createVNode("div",{class:[styles$u.dot,useLen.value-tickData.index<=s&&styles$u.hide]},null))])}}),fraction$3="_fraction_1y48u_1",closeIcon$1="_closeIcon_1y48u_12",bg$1="_bg_1y48u_19",content$6="_content_1y48u_22",title$6="_title_1y48u_22",desc="_desc_1y48u_29",btn$7="_btn_1y48u_37",loadColumn="_loadColumn_1y48u_44",close$1="_close_1y48u_12",loadIcon="_loadIcon_1y48u_59",successIcon="_successIcon_1y48u_63",loadingPop$1="_loadingPop_1y48u_73",loadingIcon$1="_loadingIcon_1y48u_80",loadingTip$2="_loadingTip_1y48u_83",loadingClose="_loadingClose_1y48u_88",styles$t={fraction:fraction$3,closeIcon:closeIcon$1,bg:bg$1,content:content$6,title:title$6,desc,btn:btn$7,loadColumn,close:close$1,loadIcon,successIcon,loadingPop:loadingPop$1,loadingIcon:loadingIcon$1,loadingTip:loadingTip$2,loadingClose},animGif=""+new URL("../gif/refresh_anim-de363185.gif",import.meta.url).href,AbnormalPop=defineComponent({name:"abnormal-pop",emits:["close","confirm"],setup(i,{emit:e}){return()=>createVNode(Fragment,null,[evaluatingData.socketErrorStatus===0&&createVNode("div",{class:styles$t.fraction},[evaluatingData.socketErrorStatus===0&&createVNode("img",{class:styles$t.closeIcon,src:popImgs.icon_close,onClick:()=>e("close")},null),createVNode("div",{class:styles$t.content},[createVNode("div",{class:styles$t.title},[createTextVNode("网络连接失败")]),createVNode("div",{class:styles$t.desc},[createTextVNode("请确保网络正常后重新连接")])]),createVNode("div",null,[createVNode("img",{src:popImgs.icon_btn,class:styles$t.btn,onClick:()=>e("confirm",!0)},null)])]),evaluatingData.socketErrorStatus===1&&createVNode("div",{class:styles$t.loadingPop},[createVNode("img",{class:styles$t.loadingIcon,src:animGif},null),createVNode("div",{class:styles$t.loadingTip},[createTextVNode("正在连接中,请稍等…")]),createVNode("div",{class:styles$t.loadingClose,onClick:()=>e("close")},[createTextVNode("取消连接")])]),evaluatingData.socketErrorStatus===2&&createVNode("div",{class:styles$t.loadColumn},[createVNode("img",{class:styles$t.successIcon,src:popImgs.icon_success},null),createVNode("p",null,[createTextVNode("网络连接成功")])])])}}),icon_bg=""+new URL("../svg/icon_bg-026faf73.svg",import.meta.url).href,icon_close=""+new URL("../svg/icon_close-382c9a2f.svg",import.meta.url).href,icon_btn=""+new URL("../png/icon_btn-bb49702d.png",import.meta.url).href,icon_success="data:image/png;base64,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",homework="_homework_spg76_1",styles$s={homework},studentQueryUserInfo=async()=>await request.get("/user/getUserInfo"),api_musicPracticeRecordSave=i=>request.post("/musicPracticeRecord/save",{requestType:"json",data:i}),scriptRel="modulepreload",assetsURL=function(i,e){return new URL(i,e).href},seen={},__vitePreload=function i(e,r,s){if(!r||r.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=assetsURL(a,s),a in seen)return;seen[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(!!s)for(let y=o.length-1;y>=0;y--){const m=o[y];if(m.href===a&&(!l||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${u}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":scriptRel,l||(d.as="script",d.crossOrigin=""),d.href=a,document.head.appendChild(d),l)return new Promise((y,m)=>{d.addEventListener("load",y),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e())},headerTop="_headerTop_143s3_1",headerTopRight="_headerTopRight_143s3_11",headerMid="_headerMid_143s3_14",modeWarn="_modeWarn_143s3_23",modeWarnRight="_modeWarnRight_143s3_46",headTopLeftBox="_headTopLeftBox_143s3_50",img$2="_img_143s3_57",listImg="_listImg_143s3_61",title$5="_title_143s3_64",symbolNote="_symbolNote_143s3_69",hidenBack="_hidenBack_143s3_89",modeChangeBox="_modeChangeBox_143s3_93",headRight="_headRight_143s3_114",btn$6="_btn_143s3_121",iconBtn$2="_iconBtn_143s3_132",playType$1="_playType_143s3_146",playSource="_playSource_143s3_152",songSource="_songSource_143s3_158",section="_section_143s3_167",isSection="_isSection_143s3_170",speed="_speed_143s3_173",isSpeed="_isSpeed_143s3_179",settingMode="_settingMode_143s3_188",isSettingMode="_isSettingMode_143s3_191",musicSheet="_musicSheet_143s3_197",isMusicSheet="_isMusicSheet_143s3_200",metronomeBtn="_metronomeBtn_143s3_206",speedCon="_speedCon_143s3_209",disabled$2="_disabled_143s3_234",playBtn="_playBtn_143s3_238",btnWrap="_btnWrap_143s3_244",playLeftButton="_playLeftButton_143s3_253",playRightButton="_playRightButton_143s3_258",progress="_progress_143s3_263",resetBtn$2="_resetBtn_143s3_271",pauseLeftButton="_pauseLeftButton_143s3_282",pauseRightButton="_pauseRightButton_143s3_287",pcTransPop="_pcTransPop_143s3_300",modeView="_modeView_143s3_303",hidden="_hidden_143s3_314",back="_back_143s3_319",name$2="_name_143s3_327",modeBox="_modeBox_143s3_335",twoModeBox="_twoModeBox_143s3_344",modeImg="_modeImg_143s3_347",hiddenPop="_hiddenPop_143s3_354",socketErrorStatus="_socketErrorStatus_143s3_360",styles$r={headerTop,headerTopRight,headerMid,modeWarn,modeWarnRight,headTopLeftBox,img:img$2,listImg,title:title$5,symbolNote,hidenBack,modeChangeBox,headRight,btn:btn$6,iconBtn:iconBtn$2,playType:playType$1,playSource,songSource,section,isSection,speed,isSpeed,settingMode,isSettingMode,musicSheet,isMusicSheet,metronomeBtn,speedCon,disabled:disabled$2,playBtn,btnWrap,playLeftButton,playRightButton,progress,resetBtn:resetBtn$2,pauseLeftButton,pauseRightButton,pcTransPop,modeView,hidden,back,name:name$2,modeBox,twoModeBox,modeImg,hiddenPop,socketErrorStatus},speedContainer="_speedContainer_vgqwi_1",follow$4="_follow_vgqwi_1",head$4="_head_vgqwi_1",content$5="_content_vgqwi_5",conBox$2="_conBox_vgqwi_9",speedSel="_speedSel_vgqwi_12",evaluating$4="_evaluating_vgqwi_15",headTit$3="_headTit_vgqwi_22",closeImg$3="_closeImg_vgqwi_25",tit$3="_tit_vgqwi_80",spendCon$1="_spendCon_vgqwi_86",btn$5="_btn_vgqwi_92",sliderCon$1="_sliderCon_vgqwi_98",customButton$1="_customButton_vgqwi_140",speedVal$1="_speedVal_vgqwi_145",speedBtn$1="_speedBtn_vgqwi_157",disableSpend="_disableSpend_vgqwi_184",metronome="_metronome_vgqwi_188",switchLoading="_switchLoading_vgqwi_209",styles$q={speedContainer,follow:follow$4,head:head$4,content:content$5,conBox:conBox$2,speedSel,evaluating:evaluating$4,headTit:headTit$3,closeImg:closeImg$3,tit:tit$3,spendCon:spendCon$1,btn:btn$5,sliderCon:sliderCon$1,customButton:customButton$1,speedVal:speedVal$1,speedBtn:speedBtn$1,disableSpend,metronome,switchLoading},settting="_settting_1grlm_1",follow$3="_follow_1grlm_1",head$3="_head_1grlm_1",content$4="_content_1grlm_5",conBox$1="_conBox_1grlm_9",cellBox="_cellBox_1grlm_12",evaluating$3="_evaluating_1grlm_15",headTit$2="_headTit_1grlm_22",closeImg$2="_closeImg_1grlm_25",isCamera="_isCamera_1grlm_87",tit$2="_tit_1grlm_105",titbtn="_titbtn_1grlm_111",spendCon="_spendCon_1grlm_123",sliderCon="_sliderCon_1grlm_129",customButton="_customButton_1grlm_169",speedVal="_speedVal_1grlm_174",speedBtn="_speedBtn_1grlm_186",radioBox="_radioBox_1grlm_192",active$2="_active_1grlm_211",frequency$1="_frequency_1grlm_216",frequencyNum="_frequencyNum_1grlm_220",btn$4="_btn_1grlm_232",reactionTimeBox="_reactionTimeBox_1grlm_238",reactionTime="_reactionTime_1grlm_238",timeName="_timeName_1grlm_255",cellBtnBox="_cellBtnBox_1grlm_261",styles$p={settting,follow:follow$3,head:head$3,content:content$4,conBox:conBox$1,cellBox,evaluating:evaluating$3,headTit:headTit$2,closeImg:closeImg$2,isCamera,tit:tit$2,titbtn,spendCon,sliderCon,customButton,speedVal,speedBtn,radioBox,active:active$2,frequency:frequency$1,frequencyNum,btn:btn$4,reactionTimeBox,reactionTime,timeName,cellBtnBox},index="";var lottieExports={},lottie$1={get exports(){return lottieExports},set exports(i){lottieExports=i}};(function(module,exports){typeof navigator<"u"&&function(i,e){module.exports=e()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(i){return document.createElement(i)}function extendPrototype(i,e){var r,s=i.length,o;for(r=0;r1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(i,e){var r=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return r[2]+=e,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(i,e){var r=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var i=[],e,r;for(e=0;e<256;e+=1)r=e.toString(16),i[e]=r.length===1?"0"+r:r;return function(s,o,a){return s<0&&(s=0),o<0&&(o=0),a<0&&(a=0),"#"+i[s]+i[o]+i[a]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(i){return document.createElementNS(svgNS,i)}function _typeof$5(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(r){return typeof r}:_typeof$5=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof$5(i)}var dataManager=function(){var i=1,e=[],r,s,o={onmessage:function(){},postMessage:function(v){r({data:v})}},a={postMessage:function(v){o.onmessage({data:v})}};function l(g){if(window.Worker&&window.Blob&&getWebWorker()){var v=new Blob(["var _workerSelf = self; self.onmessage = ",g.toString()],{type:"text/javascript"}),b=URL.createObjectURL(v);return new Worker(b)}return r=g,o}function u(){s||(s=l(function(v){function b(){function x(U,D){var $,N,O=U.length,Q,z,W,xe;for(N=0;N=0;D-=1)if(U[D].ty==="sh")if(U[D].ks.k.i)T(U[D].ks.k);else for(O=U[D].ks.k.length,N=0;N$[0]?!0:$[0]>U[0]?!1:U[1]>$[1]?!0:$[1]>U[1]?!1:U[2]>$[2]?!0:$[2]>U[2]?!1:null}var P=function(){var U=[4,4,14];function D(N){var O=N.t.d;N.t.d={k:[{s:O,t:0}]}}function $(N){var O,Q=N.length;for(O=0;O=0;O-=1)if(N[O].ty==="sh")if(N[O].ks.k.i)N[O].ks.k.c=N[O].closed;else for(W=N[O].ks.k.length,z=0;z500)&&(this._imageLoaded(),clearInterval(w)),E+=1}.bind(this),50)}function a(A){var E=s(A,this.assetsPath,this.path),w=createNS("image");isSafari?this.testImageLoaded(w):w.addEventListener("load",this._imageLoaded,!1),w.addEventListener("error",function(){_.img=i,this._imageLoaded()}.bind(this),!1),w.setAttributeNS("http://www.w3.org/1999/xlink","href",E),this._elementHelper.append?this._elementHelper.append(w):this._elementHelper.appendChild(w);var _={img:w,assetData:A};return _}function l(A){var E=s(A,this.assetsPath,this.path),w=createTag("img");w.crossOrigin="anonymous",w.addEventListener("load",this._imageLoaded,!1),w.addEventListener("error",function(){_.img=i,this._imageLoaded()}.bind(this),!1),w.src=E;var _={img:w,assetData:A};return _}function u(A){var E={assetData:A},w=s(A,this.assetsPath,this.path);return dataManager.loadData(w,function(_){E.img=_,this._footageLoaded()}.bind(this),function(){E.img={},this._footageLoaded()}.bind(this)),E}function c(A,E){this.imagesLoadedCb=E;var w,_=A.length;for(w=0;w<_;w+=1)A[w].layers||(!A[w].t||A[w].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(A[w]))):A[w].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(A[w]))))}function d(A){this.path=A||""}function y(A){this.assetsPath=A||""}function m(A){for(var E=0,w=this.images.length;Ethis.animationData.op&&(this.animationData.op=i.op,this.totalFrames=Math.floor(i.op-this.animationData.ip));var e=this.animationData.layers,r,s=e.length,o=i.layers,a,l=o.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(i){this.triggerRenderFrameError(i)}},AnimationItem.prototype.play=function(i){i&&this.name!==i||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(i){i&&this.name!==i||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(i){i&&this.name!==i||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(i){i&&this.name!==i||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(i){for(var e,r=0;r=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(r=!0,e=0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(i,e){this.playCount=0,i[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=i[0]-i[1],this.timeCompleted=this.totalFrames,this.firstFrame=i[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):i[1]>i[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=i[1]-i[0],this.timeCompleted=this.totalFrames,this.firstFrame=i[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(i,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(r=e-i)),this.firstFrame=i,this.totalFrames=e-i,this.timeCompleted=this.totalFrames,r!==-1&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(i,e){if(e&&(this.segments.length=0),_typeof$4(i[0])==="object"){var r,s=i.length;for(r=0;r=0;$-=1)e[$].animation.destroy(D)}function k(D,$,N){var O=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Q,z=O.length;for(Q=0;Q0?_=k:w=k;while(Math.abs(P)>a&&++M=o?x(w,H,_,T):B===0?H:S(w,P,P+c,_,T)}},i}(),pooling=function(){function i(e){return e.concat(createSizedArray(e.length))}return{double:i}}(),poolFactory=function(){return function(i,e,r){var s=0,o=i,a=createSizedArray(o),l={newElement:u,release:c};function u(){var d;return s?(s-=1,d=a[s]):d=e(),d}function c(d){s===o&&(a=pooling.double(a),o*=2),r&&r(d),a[s]=d,s+=1}return l}}(),bezierLengthPool=function(){function i(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,i)}(),segmentsLengthPool=function(){function i(){return{lengths:[],totalLength:0}}function e(r){var s,o=r.lengths.length;for(s=0;s-.001&&E<.001}function r(g,v,b,S,x,A,E,w,_){if(b===0&&A===0&&_===0)return e(g,v,S,x,E,w);var T=i.sqrt(i.pow(S-g,2)+i.pow(x-v,2)+i.pow(A-b,2)),C=i.sqrt(i.pow(E-g,2)+i.pow(w-v,2)+i.pow(_-b,2)),P=i.sqrt(i.pow(E-S,2)+i.pow(w-x,2)+i.pow(_-A,2)),k;return T>C?T>P?k=T-C-P:k=P-C-T:P>C?k=P-C-T:k=C-T-P,k>-1e-4&&k<1e-4}var s=function(){return function(g,v,b,S){var x=getDefaultCurveSegments(),A,E,w,_,T,C=0,P,k=[],M=[],R=bezierLengthPool.newElement();for(w=b.length,A=0;AE?-1:1,T=!0;T;)if(S[A]<=E&&S[A+1]>E?(w=(E-S[A])/(S[A+1]-S[A]),T=!1):A+=_,A<0||A>=x-1){if(A===x-1)return b[A];T=!1}return b[A]+(b[A+1]-b[A])*w}function d(g,v,b,S,x,A){var E=c(x,A),w=1-E,_=i.round((w*w*w*g[0]+(E*w*w+w*E*w+w*w*E)*b[0]+(E*E*w+w*E*E+E*w*E)*S[0]+E*E*E*v[0])*1e3)/1e3,T=i.round((w*w*w*g[1]+(E*w*w+w*E*w+w*w*E)*b[1]+(E*E*w+w*E*E+E*w*E)*S[1]+E*E*E*v[1])*1e3)/1e3;return[_,T]}var y=createTypedArray("float32",8);function m(g,v,b,S,x,A,E){x<0?x=0:x>1&&(x=1);var w=c(x,E);A=A>1?1:A;var _=c(A,E),T,C=g.length,P=1-w,k=1-_,M=P*P*P,R=w*P*P*3,H=w*w*P*3,B=w*w*w,F=P*P*k,I=w*P*k+P*w*k+P*P*_,U=w*w*k+P*w*_+w*P*_,D=w*w*_,$=P*k*k,N=w*k*k+P*_*k+P*k*_,O=w*_*k+P*_*_+w*k*_,Q=w*_*_,z=k*k*k,W=_*k*k+k*_*k+k*k*_,xe=_*_*k+k*_*_+_*k*_,ye=_*_*_;for(T=0;T=d.t-r){c.h&&(c=d),o=0;break}if(d.t-r>i){o=a;break}a=A||i=A?_.points.length-1:0;for(g=_.points[T].point.length,m=0;m=k&&C=A)s[0]=w[0],s[1]=w[1],s[2]=w[2];else if(i<=E)s[0]=c.s[0],s[1]=c.s[1],s[2]=c.s[2];else{var I=createQuaternion(c.s),U=createQuaternion(w),D=(i-E)/(A-E);quaternionToEuler(s,slerp(I,U,D))}else for(a=0;a=A?v=1:i1e-6?(g=Math.acos(v),b=Math.sin(g),S=Math.sin((1-r)*g)/b,x=Math.sin(r*g)/b):(S=1-r,x=r),s[0]=S*o+x*c,s[1]=S*a+x*d,s[2]=S*l+x*y,s[3]=S*u+x*m,s}function quaternionToEuler(i,e){var r=e[0],s=e[1],o=e[2],a=e[3],l=Math.atan2(2*s*a-2*r*o,1-2*s*s-2*o*o),u=Math.asin(2*r*s+2*o*a),c=Math.atan2(2*r*a-2*s*o,1-2*r*r-2*o*o);i[0]=l/degToRads,i[1]=u/degToRads,i[2]=c/degToRads}function createQuaternion(i){var e=i[0]*degToRads,r=i[1]*degToRads,s=i[2]*degToRads,o=Math.cos(e/2),a=Math.cos(r/2),l=Math.cos(s/2),u=Math.sin(e/2),c=Math.sin(r/2),d=Math.sin(s/2),y=o*a*l-u*c*d,m=u*c*l+o*a*d,g=u*a*l+o*c*d,v=o*c*l-u*a*d;return[m,g,v,y]}function getValueAtCurrentTime(){var i=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(i===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&i>=r||this._caching.lastFrame=i&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(i,this._caching);this.pv=s}return this._caching.lastFrame=i,this.pv}function setVValue(i){var e;if(this.propType==="unidimensional")e=i*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var r=0,s=this.v.length;r1e-5&&(this.v[r]=e,this._mdf=!0),r+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var i,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(i=0;i=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!o)&&(a[s]=pointPool.newElement()),a[s][0]=i,a[s][1]=e},ShapePath.prototype.setTripleAt=function(i,e,r,s,o,a,l,u){this.setXYAt(i,e,"v",l,u),this.setXYAt(r,s,"o",l,u),this.setXYAt(o,a,"i",l,u)},ShapePath.prototype.reverse=function(){var i=new ShapePath;i.setPathData(this.c,this._length);var e=this.v,r=this.o,s=this.i,o=0;this.c&&(i.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],r[0][0],r[0][1],0,!1),o=1);var a=this._length-1,l=this._length,u;for(u=o;u=I[I.length-1].t-this.offsetTime)T=I[I.length-1].s?I[I.length-1].s[0]:I[I.length-2].e[0],P=!0;else{for(var U=_,D=I.length-1,$=!0,N,O,Q;$&&(N=I[U],O=I[U+1],!(O.t-this.offsetTime>A));)U=O.t-this.offsetTime)B=1;else if(Aw&&A>w)||(this._caching.lastIndex=_0||N>-1e-6&&N<0?s(N*O)/O:N}function $(){var N=this.props,O=D(N[0]),Q=D(N[1]),z=D(N[4]),W=D(N[5]),xe=D(N[12]),ye=D(N[13]);return"matrix("+O+","+Q+","+z+","+W+","+xe+","+ye+")"}return function(){this.reset=o,this.rotate=a,this.rotateX=l,this.rotateY=u,this.rotateZ=c,this.skew=y,this.skewFromAxis=m,this.shear=d,this.scale=g,this.setTransform=v,this.translate=b,this.transform=S,this.multiply=x,this.applyToPoint=T,this.applyToX=C,this.applyToY=P,this.applyToZ=k,this.applyToPointArray=F,this.applyToTriplePoints=B,this.applyToPointStringified=I,this.toCSS=U,this.to2dCSS=$,this.clone=w,this.cloneFromProps=_,this.equals=E,this.inversePoints=H,this.inversePoint=R,this.getInverseMatrix=M,this._t=this.transform,this.isIdentity=A,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(r){return typeof r}:_typeof$3=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof$3(i)}var lottie={};function setLocation(i){setLocationHref(i)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(i){setSubframeEnabled(i)}function setPrefix(i){setIdPrefix(i)}function loadAnimation(i){return animationManager.loadAnimation(i)}function setQuality(i){if(typeof i=="string")switch(i){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(i)&&i>1&&setDefaultCurveSegments(i)}function inBrowser(){return typeof navigator<"u"}function installPlugin(i,e){i==="expressions"&&setExpressionsPlugin(e)}function getFactory(i){switch(i){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(i){for(var e=queryString.split("&"),r=0;r=1?a.push({s:i-1,e:e-1}):(a.push({s:i,e:1}),a.push({s:0,e:e-1}));var l=[],u,c=a.length,d;for(u=0;us+r)){var y,m;d.s*o<=s?y=0:y=(d.s*o-s)/r,d.e*o>=s+r?m=1:m=(d.e*o-s)/r,l.push([y,m])}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(i){var e,r=i.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?r=1+s:this.e.v<0?r=0+s:r=this.e.v+s,e>r){var o=e;e=r,r=o}e=Math.round(e*1e4)*1e-4,r=Math.round(r*1e4)*1e-4,this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var a,l,u=this.shapes.length,c,d,y,m,g,v=0;if(r===e)for(l=0;l=0;l-=1)if(S=this.shapes[l],S.shape._mdf){for(x=S.localShapeCollection,x.releaseShapes(),this.m===2&&u>1?(_=this.calculateShapeEdges(e,r,S.totalShapeLength,w,v),w+=S.totalShapeLength):_=[[A,E]],d=_.length,c=0;c=1?b.push({s:S.totalShapeLength*(A-1),e:S.totalShapeLength*(E-1)}):(b.push({s:S.totalShapeLength*A,e:S.totalShapeLength}),b.push({s:0,e:S.totalShapeLength*(E-1)}));var T=this.addShapes(S,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var C=S.shape.paths.shapes[S.shape.paths._length-1];if(C.c){var P=T.pop();this.addPaths(T,x),T=this.addShapes(S,b[1],P)}else this.addPaths(T,x),T=this.addShapes(S,b[1])}this.addPaths(T,x)}}S.shape.paths=x}}},TrimModifier.prototype.addPaths=function(i,e){var r,s=i.length;for(r=0;re.e){r.c=!1;break}else e.s<=d&&e.e>=d+y.addedLength?(this.addSegment(o[a].v[u-1],o[a].o[u-1],o[a].i[u],o[a].v[u],r,m,x),x=!1):(v=bez.getNewSegment(o[a].v[u-1],o[a].v[u],o[a].o[u-1],o[a].i[u],(e.s-d)/y.addedLength,(e.e-d)/y.addedLength,g[u-1]),this.addSegmentFromArray(v,r,m,x),x=!1,r.c=!1),d+=y.addedLength,m+=1;if(o[a].c&&g.length){if(y=g[u-1],d<=e.e){var A=g[u-1].addedLength;e.s<=d&&e.e>=d+A?(this.addSegment(o[a].v[u-1],o[a].o[u-1],o[a].i[0],o[a].v[0],r,m,x),x=!1):(v=bez.getNewSegment(o[a].v[u-1],o[a].v[0],o[a].o[u-1],o[a].i[0],(e.s-d)/A,(e.e-d)/A,g[u-1]),this.addSegmentFromArray(v,r,m,x),x=!1,r.c=!1)}else r.c=!1;d+=y.addedLength,m+=1}if(r._length&&(r.setXYAt(r.v[S][0],r.v[S][1],"i",S),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(y=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/d,0),m=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/d,0)):(y=this.p.pv,m=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/d,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){y=[],m=[];var g=this.px,v=this.py;g._caching.lastFrame+g.offsetTime<=g.keyframes[0].t?(y[0]=g.getValueAtTime((g.keyframes[0].t+.01)/d,0),y[1]=v.getValueAtTime((v.keyframes[0].t+.01)/d,0),m[0]=g.getValueAtTime(g.keyframes[0].t/d,0),m[1]=v.getValueAtTime(v.keyframes[0].t/d,0)):g._caching.lastFrame+g.offsetTime>=g.keyframes[g.keyframes.length-1].t?(y[0]=g.getValueAtTime(g.keyframes[g.keyframes.length-1].t/d,0),y[1]=v.getValueAtTime(v.keyframes[v.keyframes.length-1].t/d,0),m[0]=g.getValueAtTime((g.keyframes[g.keyframes.length-1].t-.01)/d,0),m[1]=v.getValueAtTime((v.keyframes[v.keyframes.length-1].t-.01)/d,0)):(y=[g.pv,v.pv],m[0]=g.getValueAtTime((g._caching.lastFrame+g.offsetTime-.01)/d,g.offsetTime),m[1]=v.getValueAtTime((v._caching.lastFrame+v.offsetTime-.01)/d,v.offsetTime))}else m=i,y=m;this.v.rotate(-Math.atan2(y[1]-m[1],y[0]-m[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function o(){}function a(c){this._addDynamicProperty(c),this.elem.addDynamicProperty(c),this._isDirty=!0}function l(c,d,y){if(this.elem=c,this.frameId=-1,this.propType="transform",this.data=d,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(y||c),d.p&&d.p.s?(this.px=PropertyFactory.getProp(c,d.p.x,0,0,this),this.py=PropertyFactory.getProp(c,d.p.y,0,0,this),d.p.z&&(this.pz=PropertyFactory.getProp(c,d.p.z,0,0,this))):this.p=PropertyFactory.getProp(c,d.p||{k:[0,0,0]},1,0,this),d.rx){if(this.rx=PropertyFactory.getProp(c,d.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(c,d.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(c,d.rz,0,degToRads,this),d.or.k[0].ti){var m,g=d.or.k.length;for(m=0;m0;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(i){var e,r=i.length;for(e=0;e0?Math.floor(g):Math.ceil(g),S=this.pMatrix.props,x=this.rMatrix.props,A=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var E=0;if(g>0){for(;Eb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),E-=1;v&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-v,!0),E-=v)}s=this.data.m===1?0:this._currentCopies-1,o=this.data.m===1?1:-1,a=this._currentCopies;for(var w,_;a;){if(e=this.elemsData[s].it,r=e[e.length-1].transform.mProps.v.props,_=r.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),E!==0){for((s!==0&&o===1||s!==this._currentCopies-1&&o===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]),this.matrix.transform(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),this.matrix.transform(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15]),w=0;w<_;w+=1)r[w]=this.matrix.props[w];this.matrix.reset()}else for(this.matrix.reset(),w=0;w<_;w+=1)r[w]=this.matrix.props[w];E+=1,a-=1,s+=o}}else for(a=this._currentCopies,s=0,o=1;a;)e=this.elemsData[s].it,r=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=o;return l},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(i,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(i,e){var r=shapePool.newElement();r.c=i.c;var s,o=i._length,a,l,u,c,d,y,m=0,g,v,b,S,x,A;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(o){return o>0&&o<1})},PolynomialBezier.prototype.split=function(i){if(i<=0)return[singlePoint(this.points[0]),this];if(i>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],i),r=lerpPoint(this.points[1],this.points[2],i),s=lerpPoint(this.points[2],this.points[3],i),o=lerpPoint(e,r,i),a=lerpPoint(r,s,i),l=lerpPoint(o,a,i);return[new PolynomialBezier(this.points[0],e,o,l,!0),new PolynomialBezier(l,a,s,this.points[3],!0)]};function extrema(i,e){var r=i.points[0][e],s=i.points[i.points.length-1][e];if(r>s){var o=s;s=r,r=o}for(var a=quadRoots(3*i.a[e],2*i.b[e],i.c[e]),l=0;l0&&a[l]<1){var u=i.point(a[l])[e];us&&(s=u)}return{min:r,max:s}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var i=this.bounds();return{left:i.x.min,right:i.x.max,top:i.y.min,bottom:i.y.max,width:i.x.max-i.x.min,height:i.y.max-i.y.min,cx:(i.x.max+i.x.min)/2,cy:(i.y.max+i.y.min)/2}};function intersectData(i,e,r){var s=i.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:i,t:(e+r)/2,t1:e,t2:r}}function splitData(i){var e=i.bez.split(.5);return[intersectData(e[0],i.t1,i.t),intersectData(e[1],i.t,i.t2)]}function boxIntersect(i,e){return Math.abs(i.cx-e.cx)*2=a||i.width<=s&&i.height<=s&&e.width<=s&&e.height<=s){o.push([i.t,e.t]);return}var l=splitData(i),u=splitData(e);intersectsImpl(l[0],u[0],r+1,s,o,a),intersectsImpl(l[0],u[1],r+1,s,o,a),intersectsImpl(l[1],u[0],r+1,s,o,a),intersectsImpl(l[1],u[1],r+1,s,o,a)}}PolynomialBezier.prototype.intersections=function(i,e,r){e===void 0&&(e=2),r===void 0&&(r=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(i,0,1),0,e,s,r),s},PolynomialBezier.shapeSegment=function(i,e){var r=(e+1)%i.length();return new PolynomialBezier(i.v[e],i.o[e],i.i[r],i.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(i,e){var r=(e+1)%i.length();return new PolynomialBezier(i.v[r],i.i[r],i.o[e],i.v[e],!0)};function crossProduct(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function lineIntersection(i,e,r,s){var o=[i[0],i[1],1],a=[e[0],e[1],1],l=[r[0],r[1],1],u=[s[0],s[1],1],c=crossProduct(crossProduct(o,a),crossProduct(l,u));return floatZero(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function polarOffset(i,e,r){return[i[0]+Math.cos(e)*r,i[1]-Math.sin(e)*r]}function pointDistance(i,e){return Math.hypot(i[0]-e[0],i[1]-e[1])}function pointEqual(i,e){return floatEqual(i[0],e[0])&&floatEqual(i[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(i,e.s,0,null,this),this.frequency=PropertyFactory.getProp(i,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(i,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(i,e,r,s,o,a,l){var u=r-Math.PI/2,c=r+Math.PI/2,d=e[0]+Math.cos(r)*s*o,y=e[1]-Math.sin(r)*s*o;i.setTripleAt(d,y,d+Math.cos(u)*a,y-Math.sin(u)*a,d+Math.cos(c)*l,y-Math.sin(c)*l,i.length())}function getPerpendicularVector(i,e){var r=[e[0]-i[0],e[1]-i[1]],s=-Math.PI*.5,o=[Math.cos(s)*r[0]-Math.sin(s)*r[1],Math.sin(s)*r[0]+Math.cos(s)*r[1]];return o}function getProjectingAngle(i,e){var r=e===0?i.length()-1:e-1,s=(e+1)%i.length(),o=i.v[r],a=i.v[s],l=getPerpendicularVector(o,a);return Math.atan2(0,1)-Math.atan2(l[1],l[0])}function zigZagCorner(i,e,r,s,o,a,l){var u=getProjectingAngle(e,r),c=e.v[r%e._length],d=e.v[r===0?e._length-1:r-1],y=e.v[(r+1)%e._length],m=a===2?Math.sqrt(Math.pow(c[0]-d[0],2)+Math.pow(c[1]-d[1],2)):0,g=a===2?Math.sqrt(Math.pow(c[0]-y[0],2)+Math.pow(c[1]-y[1],2)):0;setPoint(i,e.v[r%e._length],u,l,s,g/((o+1)*2),m/((o+1)*2))}function zigZagSegment(i,e,r,s,o,a){for(var l=0;l1&&e.length>1&&(o=getIntersection(i[0],e[e.length-1]),o)?[[i[0].split(o[0])[0]],[e[e.length-1].split(o[1])[1]]]:[r,s]}function pruneIntersections(i){for(var e,r=1;r1&&(e=pruneSegmentIntersection(i[i.length-1],i[0]),i[i.length-1]=e[0],i[0]=e[1]),i}function offsetSegmentSplit(i,e){var r=i.inflectionPoints(),s,o,a,l;if(r.length===0)return[offsetSegment(i,e)];if(r.length===1||floatEqual(r[1],1))return a=i.split(r[0]),s=a[0],o=a[1],[offsetSegment(s,e),offsetSegment(o,e)];a=i.split(r[0]),s=a[0];var u=(r[1]-r[0])/(1-r[0]);return a=a[1].split(u),l=a[0],o=a[1],[offsetSegment(s,e),offsetSegment(l,e),offsetSegment(o,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(i,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(i,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(i,e,r,s){var o=shapePool.newElement();o.c=i.c;var a=i.length();i.c||(a-=1);var l,u,c,d=[];for(l=0;l=0;l-=1)c=PolynomialBezier.shapeSegmentInverted(i,l),d.push(offsetSegmentSplit(c,e));d=pruneIntersections(d);var y=null,m=null;for(l=0;l0&&(W=!1),W){var q=createTag("style");q.setAttribute("f-forigin",N[O].fOrigin),q.setAttribute("f-origin",N[O].origin),q.setAttribute("f-family",N[O].fFamily),q.type="text/css",q.innerText="@font-face {font-family: "+N[O].fFamily+"; font-style: normal; src: url('"+N[O].fPath+"');}",$.appendChild(q)}}else if(N[O].fOrigin==="g"||N[O].origin===1){for(xe=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),ye=0;ye=55296&&N<=56319){var O=D.charCodeAt(1);O>=56320&&O<=57343&&($=(N-55296)*1024+O-56320+65536)}return $}function C(D,$){var N=D.toString(16)+$.toString(16);return m.indexOf(N)!==-1}function P(D){return D===c}function k(D){return D===u}function M(D){var $=T(D);return $>=d&&$<=y}function R(D){return M(D.substr(0,2))&&M(D.substr(2,2))}function H(D){return r.indexOf(D)!==-1}function B(D,$){var N=T(D.substr($,2));if(N!==s)return!1;var O=0;for($+=2;O<5;){if(N=T(D.substr($,2)),Nl)return!1;O+=1,$+=2}return T(D.substr($,2))===o}function F(){this.isLoaded=!0}var I=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};I.isModifier=C,I.isZeroWidthJoiner=P,I.isFlagEmoji=R,I.isRegionalCode=M,I.isCombinedCharacter=H,I.isRegionalFlag=B,I.isVariationSelector=k,I.BLACK_FLAG_CODE_POINT=s;var U={addChars:A,addFonts:x,getCharData:E,getFontByName:_,measureText:w,checkLoadedFonts:b,setIsLoaded:F};return I.prototype=U,I}();function SlotManager(i){this.animationData=i}SlotManager.prototype.getProp=function(i){return this.animationData.slots&&this.animationData.slots[i.sid]?Object.assign(i,this.animationData.slots[i.sid].p):i};function slotFactory(i){return new SlotManager(i)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,r=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(i){this.audio.rate(i)},AudioElement.prototype.volume=function(i){this._volumeMultiplier=i,this._previousVolume=i*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(i){var e,r=this.layers.length,s;for(this.completeLayers=!0,e=r-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=i-this.layers[e].st&&s.op-s.st>i-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(i){switch(i.ty){case 2:return this.createImage(i);case 0:return this.createComp(i);case 1:return this.createSolid(i);case 3:return this.createNull(i);case 4:return this.createShape(i);case 5:return this.createText(i);case 6:return this.createAudio(i);case 13:return this.createCamera(i);case 15:return this.createFootage(i);default:return this.createNull(i)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(i){return new AudioElement(i,this.globalData,this)},BaseRenderer.prototype.createFootage=function(i){return new FootageElement(i,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var i,e=this.layers.length;for(i=0;i0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(E,"url("+getLocationHref()+"#"+g+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(i){return this.viewData[i].prop},MaskElement.prototype.renderFrame=function(i){var e=this.element.finalTransform.mat,r,s=this.masksProperties.length;for(r=0;r1&&(s+=" C"+e.o[o-1][0]+","+e.o[o-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==s){var l="";r.elem&&(e.c&&(l=i.inv?this.solidPath+s:s),r.elem.setAttribute("d",l)),r.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var i={};i.createFilter=e,i.createAlphaToLuminanceFilter=r;function e(s,o){var a=createNS("filter");return a.setAttribute("id",s),o!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function r(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return i}(),featureSupport=function(){var i={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(i.maskType=!1),/firefox/i.test(navigator.userAgent)&&(i.svgLumaHidden=!1),i}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(i){var e,r="SourceGraphic",s=i.data.ef?i.data.ef.length:0,o=createElementID(),a=filtersFactory.createFilter(o,!0),l=0;this.filters=[];var u;for(e=0;e=0&&(s=this.shapeModifiers[e].processShapes(this._isFirstFrame),!s);e-=1);}},searchProcessedElement:function(e){for(var r=this.processedElements,s=0,o=r.length;s.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var i=0,e=this.data.k.k.length;i0;)A=g.transformers[M].mProps._mdf||A,k-=1,M-=1;if(A)for(k=T-g.styles[w].lvl,M=g.transformers.length-1;k>0;)P.multiply(g.transformers[M].mProps.v),k-=1,M-=1}else P=i;if(C=g.sh.paths,S=C._length,A){for(x="",b=0;b=1?F=.99:F<=-1&&(F=-.99);var I=H*F,U=Math.cos(B+g.a.v)*I+x[0],D=Math.sin(B+g.a.v)*I+x[1];b.setAttribute("fx",U),b.setAttribute("fy",D),S&&!g.g._collapsable&&(g.of.setAttribute("fx",U),g.of.setAttribute("fy",D))}}}function y(m,g,v){var b=g.style,S=g.d;S&&(S._mdf||v)&&S.dashStr&&(b.pElem.setAttribute("stroke-dasharray",S.dashStr),b.pElem.setAttribute("stroke-dashoffset",S.dashoffset[0])),g.c&&(g.c._mdf||v)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(g.c.v[0])+","+bmFloor(g.c.v[1])+","+bmFloor(g.c.v[2])+")"),(g.o._mdf||v)&&b.pElem.setAttribute("stroke-opacity",g.o.v),(g.w._mdf||v)&&(b.pElem.setAttribute("stroke-width",g.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",g.w.v))}return r}();function SVGShapeElement(i,e,r){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(i,e,r),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var i,e=this.shapes.length,r,s,o=this.stylesList.length,a,l=[],u=!1;for(s=0;s1&&u&&this.setShapesAsAnimated(l)}},SVGShapeElement.prototype.setShapesAsAnimated=function(i){var e,r=i.length;for(e=0;e=0;c-=1){if(x=this.searchProcessedElement(i[c]),x?e[c]=r[x-1]:i[c]._render=l,i[c].ty==="fl"||i[c].ty==="st"||i[c].ty==="gf"||i[c].ty==="gs"||i[c].ty==="no")x?e[c].style.closed=!1:e[c]=this.createStyleElement(i[c],o),i[c]._render&&e[c].style.pElem.parentNode!==s&&s.appendChild(e[c].style.pElem),g.push(e[c].style);else if(i[c].ty==="gr"){if(!x)e[c]=this.createGroupElement(i[c]);else for(m=e[c].it.length,y=0;y1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(i){this.effectsSequence.push(i),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(i){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!i)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,o=this.effectsSequence.length,a=i||this.data.d.k[this.keysIndex].s;for(s=0;se);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(i){for(var e=[],r=0,s=i.length,o,a,l=!1,u=!1,c="";r=55296&&o<=56319?FontManager.isRegionalFlag(i,r)?c=i.substr(r,14):(a=i.charCodeAt(r+1),a>=56320&&a<=57343&&(FontManager.isModifier(o,a)?(c=i.substr(r,2),l=!0):FontManager.isFlagEmoji(i.substr(r,4))?c=i.substr(r,4):c=i.substr(r,2))):o>56319?(a=i.charCodeAt(r+1),FontManager.isVariationSelector(o)&&(l=!0)):FontManager.isZeroWidthJoiner(o)&&(l=!0,u=!0),l?(e[e.length-1]+=c,l=!1):e.push(c),r+=c.length;return e},TextProperty.prototype.completeTextData=function(i){i.__complete=!0;var e=this.elem.globalData.fontManager,r=this.data,s=[],o,a,l,u=0,c,d=r.m.g,y=0,m=0,g=0,v=[],b=0,S=0,x,A,E=e.getFontByName(i.f),w,_=0,T=getFontProperties(E);i.fWeight=T.weight,i.fStyle=T.style,i.finalSize=i.s,i.finalText=this.buildFinalText(i.t),a=i.finalText.length,i.finalLineHeight=i.lh;var C=i.tr/1e3*i.finalSize,P;if(i.sz)for(var k=!0,M=i.sz[0],R=i.sz[1],H,B;k;){B=this.buildFinalText(i.t),H=0,b=0,a=B.length,C=i.tr/1e3*i.finalSize;var F=-1;for(o=0;oM&&B[o]!==" "?(F===-1?a+=1:o=F,H+=i.finalLineHeight||i.finalSize*1.2,B.splice(o,F===o?1:0,"\r"),F=-1,b=0):(b+=_,b+=C);H+=E.ascent*i.finalSize/100,this.canResize&&i.finalSize>this.minimumFontSize&&RS?b:S,b=-2*C,c="",l=!0,g+=1):c=U,e.chars?(w=e.getCharData(U,E.fStyle,e.getFontByName(i.f).fFamily),_=l?0:w.w*i.finalSize/100):_=e.measureText(c,i.f,i.finalSize),U===" "?I+=_+C:(b+=_+C+I,I=0),s.push({l:_,an:_,add:y,n:l,anIndexes:[],val:c,line:g,animatorJustifyOffset:0}),d==2){if(y+=_,c===""||c===" "||o===a-1){for((c===""||c===" ")&&(y-=_);m<=o;)s[m].an=y,s[m].ind=u,s[m].extra=_,m+=1;u+=1,y=0}}else if(d==3){if(y+=_,c===""||o===a-1){for(c===""&&(y-=_);m<=o;)s[m].an=y,s[m].ind=u,s[m].extra=_,m+=1;y=0,u+=1}}else s[u].ind=u,s[u].extra=0,u+=1;if(i.l=s,S=b>S?b:S,v.push(b),i.sz)i.boxWidth=i.sz[0],i.justifyOffset=0;else switch(i.boxWidth=S,i.j){case 1:i.justifyOffset=-i.boxWidth;break;case 2:i.justifyOffset=-i.boxWidth/2;break;default:i.justifyOffset=0}i.lineWidths=v;var D=r.a,$,N;A=D.length;var O,Q,z=[];for(x=0;x0?u=this.ne.v/100:c=-this.ne.v/100,this.xe.v>0?d=1-this.xe.v/100:y=1+this.xe.v/100;var m=BezierFactory.getBezierEasing(u,c,d,y).get,g=0,v=this.finalS,b=this.finalE,S=this.data.sh;if(S===2)b===v?g=l>=b?1:0:g=i(0,e(.5/(b-v)+(l-v)/(b-v),1)),g=m(g);else if(S===3)b===v?g=l>=b?0:1:g=1-i(0,e(.5/(b-v)+(l-v)/(b-v),1)),g=m(g);else if(S===4)b===v?g=0:(g=i(0,e(.5/(b-v)+(l-v)/(b-v),1)),g<.5?g*=2:g=1-2*(g-.5)),g=m(g);else if(S===5){if(b===v)g=0;else{var x=b-v;l=e(i(0,l+.5-v),b-v);var A=-x/2+l,E=x/2;g=Math.sqrt(1-A*A/(E*E))}g=m(g)}else S===6?(b===v?g=0:(l=e(i(0,l+.5-v),b-v),g=(1+Math.cos(Math.PI+Math.PI*2*l/(b-v)))/2),g=m(g)):(l>=r(v)&&(l-v<0?g=i(0,e(e(b,1)-(v-l),1)):g=i(0,e(b-l,1))),g=m(g));if(this.sm.v!==100){var w=this.sm.v*.01;w===0&&(w=1e-8);var _=.5-w*.5;g<_?g=0:(g=(g-_)/w,g>1&&(g=1))}return g*this.a.v},getValue:function(l){this.iterateDynamicProperties(),this._mdf=l||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,l&&this.data.r===2&&(this.e.v=this._currentTextLength);var u=this.data.r===2?1:100/this.data.totalChars,c=this.o.v/u,d=this.s.v/u+c,y=this.e.v/u+c;if(d>y){var m=d;d=y,y=m}this.finalS=d,this.finalE=y}},extendPrototype([DynamicPropertyContainer],s);function o(a,l,u){return new s(a,l)}return{getTextSelectorProp:o}}();function TextAnimatorDataProperty(i,e,r){var s={propType:!1},o=PropertyFactory.getProp,a=e.a;this.a={r:a.r?o(i,a.r,0,degToRads,r):s,rx:a.rx?o(i,a.rx,0,degToRads,r):s,ry:a.ry?o(i,a.ry,0,degToRads,r):s,sk:a.sk?o(i,a.sk,0,degToRads,r):s,sa:a.sa?o(i,a.sa,0,degToRads,r):s,s:a.s?o(i,a.s,1,.01,r):s,a:a.a?o(i,a.a,1,0,r):s,o:a.o?o(i,a.o,0,.01,r):s,p:a.p?o(i,a.p,1,0,r):s,sw:a.sw?o(i,a.sw,0,0,r):s,sc:a.sc?o(i,a.sc,1,0,r):s,fc:a.fc?o(i,a.fc,1,0,r):s,fh:a.fh?o(i,a.fh,0,0,r):s,fs:a.fs?o(i,a.fs,0,.01,r):s,fb:a.fb?o(i,a.fb,0,.01,r):s,t:a.t?o(i,a.t,0,0,r):s},this.s=TextSelectorProp.getTextSelectorProp(i,e.s,r),this.s.t=e.s.t}function TextAnimatorProperty(i,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=i,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}TextAnimatorProperty.prototype.searchProperties=function(){var i,e=this._textData.a.length,r,s=PropertyFactory.getProp;for(i=0;i=b+le||!T?(M=(b+le-x)/S.partialLength,ye=_.point[0]+(S.point[0]-_.point[0])*M,q=_.point[1]+(S.point[1]-_.point[1])*M,a.translate(-r[0]*g[y].an*.005,-(r[1]*I)*.01),A=!1):T&&(x+=S.partialLength,E+=1,E>=T.length&&(E=0,w+=1,C[w]?T=C[w].points:H.v.c?(E=0,w=0,T=C[w].points):(x-=S.partialLength,T=null)),T&&(_=S,S=T[E],P=S.partialLength));xe=g[y].an/2-g[y].add,a.translate(-xe,0,0)}else xe=g[y].an/2-g[y].add,a.translate(-xe,0,0),a.translate(-r[0]*g[y].an*.005,-r[1]*I*.01,0);for(N=0;Ni?this.textSpans[i].span:createNS(u?"g":"text"),w<=i){if(c.setAttribute("stroke-linecap","butt"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit","4"),this.textSpans[i].span=c,u){var T=createNS("g");c.appendChild(T),this.textSpans[i].childSpan=T}this.textSpans[i].span=c,this.layerElement.appendChild(c)}c.style.display="inherit"}if(d.reset(),m&&(l[i].n&&(g=-S,v+=r.yOffset,v+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(r,d,l[i].line,g,v),g+=l[i].l||0,g+=S),u){_=this.globalData.fontManager.getCharData(r.finalText[i],s.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily);var C;if(_.t===1)C=new SVGCompElement(_.data,this.globalData,this);else{var P=emptyShapeData;_.data&&_.data.shapes&&(P=this.buildShapeData(_.data,r.finalSize)),C=new SVGShapeElement(P,this.globalData,this)}if(this.textSpans[i].glyph){var k=this.textSpans[i].glyph;this.textSpans[i].childSpan.removeChild(k.layerElement),k.destroy()}this.textSpans[i].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[i].childSpan.appendChild(C.layerElement),_.t===1&&this.textSpans[i].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else m&&c.setAttribute("transform","translate("+d.props[12]+","+d.props[13]+")"),c.textContent=l[i].val,c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}m&&c&&c.setAttribute("d",y)}for(;i=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(i-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var i,e=this.layers.length;for(i=0;i=0;s-=1)e.finalTransform.multiply(e.transforms[s].transform.mProps.v);e._mdf=a},processSequences:function(e){var r,s=this.sequenceList.length;for(r=0;r=1){this.buffers=[];var e=this.globalData.canvasContext,r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r);var s=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(s),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var r=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=r}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0],r=e.getContext("2d");this.clearCanvas(r),r.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],r=e.getContext("2d");this.clearCanvas(r),r.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var s=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(s.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var o=assetLoader.getLumaCanvas(this.canvasContext.canvas),a=o.getContext("2d");a.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(o,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var r=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(r),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(r),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(i,e,r,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var o=4;e.ty==="rc"?o=5:e.ty==="el"?o=6:e.ty==="sr"&&(o=7),this.sh=ShapePropertyFactory.getShapeProp(i,e,o,i);var a,l=r.length,u;for(a=0;a=0;a-=1){if(m=this.searchProcessedElement(i[a]),m?e[a]=r[m-1]:i[a]._shouldRender=s,i[a].ty==="fl"||i[a].ty==="st"||i[a].ty==="gf"||i[a].ty==="gs")m?e[a].style.closed=!1:e[a]=this.createStyleElement(i[a],b),d.push(e[a].style);else if(i[a].ty==="gr"){if(!m)e[a]=this.createGroupElement(i[a]);else for(c=e[a].it.length,u=0;u=0;o-=1)e[o].ty==="tr"?(l=r[o].transform,this.renderShapeTransform(i,l)):e[o].ty==="sh"||e[o].ty==="el"||e[o].ty==="rc"||e[o].ty==="sr"?this.renderPath(e[o],r[o]):e[o].ty==="fl"?this.renderFill(e[o],r[o],l):e[o].ty==="st"?this.renderStroke(e[o],r[o],l):e[o].ty==="gf"||e[o].ty==="gs"?this.renderGradientFill(e[o],r[o],l):e[o].ty==="gr"?this.renderShape(l,e[o].it,r[o].it):e[o].ty;s&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(i,e){if(this._isFirstFrame||e._mdf||i.transforms._mdf){var r=i.trNodes,s=e.paths,o,a,l,u=s._length;r.length=0;var c=i.transforms.finalTransform;for(l=0;l=1?y=.99:y<=-1&&(y=-.99);var m=c*y,g=Math.cos(d+e.a.v)*m+l[0],v=Math.sin(d+e.a.v)*m+l[1];o=a.createRadialGradient(g,v,0,l[0],l[1],c)}var b,S=i.g.p,x=e.g.c,A=1;for(b=0;ba&&c==="xMidYMid slice"||oo&&u==="meet"||ao&&u==="slice")?this.transformCanvas.tx=(r-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:d==="xMax"&&(ao&&u==="slice")?this.transformCanvas.tx=(r-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,y==="YMid"&&(a>o&&u==="meet"||ao&&u==="meet"||a=0;i-=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(i,e){if(!(this.renderedFrame===i&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||i===-1)){this.renderedFrame=i,this.globalData.frameNum=i-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=i;var r,s=this.layers.length;for(this.completeLayers||this.checkLayers(i),r=s-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(i-this.layers[r].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=s-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(i){var e=this.elements;if(!(e[i]||this.layers[i].ty===99)){var r=this.createItem(this.layers[i],this,this.globalData);e[i]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();i.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var i,e=15;for(i=0;i=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var i,e=this.layers.length;for(i=e-1;i>=0;i-=1)this.elements[i]&&this.elements[i].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function CanvasRenderer(i,e){this.animationItem=i,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var r=this.finalTransform.mat.toCSS();e.transform=r,e.webkitTransform=r}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(i,e,r){this.initElement(i,e,r)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var i;this.data.hasMask?(i=createNS("rect"),i.setAttribute("width",this.data.sw),i.setAttribute("height",this.data.sh),i.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(i=createTag("div"),i.style.width=this.data.sw+"px",i.style.height=this.data.sh+"px",i.style.backgroundColor=this.data.sc),this.layerElement.appendChild(i)};function HShapeElement(i,e,r){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(i,e,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var i;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),i=this.svgElement;else{i=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;i.setAttribute("width",e.w),i.setAttribute("height",e.h),i.appendChild(this.shapesContainer),this.layerElement.appendChild(i)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=i},HShapeElement.prototype.getTransformedPoint=function(i,e){var r,s=i.length;for(r=0;r0&&c<1&&o[g].push(this.calculateF(c,i,e,r,s,g))):(d=l*l-4*u*a,d>=0&&(y=(-l+bmSqrt(d))/(2*a),y>0&&y<1&&o[g].push(this.calculateF(y,i,e,r,s,g)),m=(-l-bmSqrt(d))/(2*a),m>0&&m<1&&o[g].push(this.calculateF(m,i,e,r,s,g)))));this.shapeBoundingBox.left=bmMin.apply(null,o[0]),this.shapeBoundingBox.top=bmMin.apply(null,o[1]),this.shapeBoundingBox.right=bmMax.apply(null,o[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,o[1])},HShapeElement.prototype.calculateF=function(i,e,r,s,o,a){return bmPow(1-i,3)*e[a]+3*bmPow(1-i,2)*i*r[a]+3*(1-i)*bmPow(i,2)*s[a]+bmPow(i,3)*o[a]},HShapeElement.prototype.calculateBoundingBox=function(i,e){var r,s=i.length;for(r=0;rr&&(r=o)}r*=i.mult}else r=i.v*i.mult;e.x-=r,e.xMax+=r,e.y-=r,e.yMax+=r},HShapeElement.prototype.currentBoxContains=function(i){return this.currentBBox.x<=i.x&&this.currentBBox.y<=i.y&&this.currentBBox.width+this.currentBBox.x>=i.x+i.width&&this.currentBBox.height+this.currentBBox.y>=i.y+i.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var i=this.tempBoundingBox,e=999999;if(i.x=e,i.xMax=-e,i.y=e,i.yMax=-e,this.calculateBoundingBox(this.itemsData,i),i.width=i.xMax=0;e-=1){var s=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var o;this.p?o=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:o=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(o[0],2)+Math.pow(o[1],2)+Math.pow(o[2],2)),l=[o[0]/a,o[1]/a,o[2]/a],u=Math.sqrt(l[2]*l[2]+l[0]*l[0]),c=Math.atan2(l[1],u),d=Math.atan2(l[0],-l[2]);this.mat.rotateY(d).rotateX(-c)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var y=!this._prevMat.equals(this.mat);if((y||this.pe._mdf)&&this.comp.threeDElements){r=this.comp.threeDElements.length;var m,g,v;for(e=0;e=i)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(i,e){var r=createTag("div"),s,o;styleDiv(r);var a=createTag("div");if(styleDiv(a),e==="3d"){s=r.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var l="50% 50%";s.webkitTransformOrigin=l,s.mozTransformOrigin=l,s.transformOrigin=l,o=a.style;var u="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";o.transform=u,o.webkitTransform=u}r.appendChild(a);var c={container:a,perspectiveElem:r,startPos:i,endPos:i,type:e};return this.threeDElements.push(c),c},HybridRendererBase.prototype.build3dContainers=function(){var i,e=this.layers.length,r,s="";for(i=0;i=0;i-=1)this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(i,e){for(var r=0,s=this.threeDElements.length;rr?(o=i/this.globalData.compSize.w,a=i/this.globalData.compSize.w,l=0,u=(e-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(o=e/this.globalData.compSize.h,a=e/this.globalData.compSize.h,l=(i-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,u=0);var c=this.resizerElem.style;c.webkitTransform="matrix3d("+o+",0,0,0,0,"+a+",0,0,0,0,1,0,"+l+","+u+",0,1)",c.transform=c.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var i=this.globalData.compSize.w,e=this.globalData.compSize.h,r,s=this.threeDElements.length;for(r=0;r=d;)H/=2,B/=2,F>>>=1;return(H+F)/B};return M.int32=function(){return k.g(4)|0},M.quick=function(){return k.g(4)/4294967296},M.double=M,x(E(k.S),i),(_.pass||T||function(R,H,B,F){return F&&(F.S&&b(F,k),R.state=function(){return b(k,{})}),B?(e[l]=R,H):R})(M,P,"global"in _?_.global:this==e,_.state)}e["seed"+l]=g;function v(w){var _,T=w.length,C=this,P=0,k=C.i=C.j=0,M=C.S=[];for(T||(w=[T++]);Pr){var s=r;r=e,e=s}return Math.min(Math.max(i,e),r)}function radiansToDegrees(i){return i/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(i){return i*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(i,e){if(typeof i=="number"||i instanceof Number)return e=e||0,Math.abs(i-e);e||(e=helperLengthArray);var r,s=Math.min(i.length,e.length),o=0;for(r=0;r.5?d/(2-o-a):d/(o+a),o){case e:l=(r-s)/d+(r1&&(r-=1),r<1/6?i+(e-i)*6*r:r<1/2?e:r<2/3?i+(e-i)*(2/3-r)*6:i}function hslToRgb(i){var e=i[0],r=i[1],s=i[2],o,a,l;if(r===0)o=s,l=s,a=s;else{var u=s<.5?s*(1+r):s+r-s*r,c=2*s-u;o=hue2rgb(c,u,e+1/3),a=hue2rgb(c,u,e),l=hue2rgb(c,u,e-1/3)}return[o,a,l,i[3]]}function linear(i,e,r,s,o){if((s===void 0||o===void 0)&&(s=e,o=r,e=0,r=1),r=r)return o;var l=r===e?0:(i-e)/(r-e);if(!s.length)return s+(o-s)*l;var u,c=s.length,d=createTypedArray("float32",c);for(u=0;u1){for(o=0;o1?e=1:e<0&&(e=0);var l=i(e);if($bm_isInstanceOfArray(o)){var u,c=o.length,d=createTypedArray("float32",c);for(u=0;udata.k[e].t&&idata.k[e+1].t-i?(s=e+2,o=data.k[e+1].t):(s=e+1,o=data.k[e].t);break}s===-1&&(s=e+1,o=data.k[e].t)}var a={};return a.index=s,a.time=o/elem.comp.globalData.frameRate,a}function key(i){var e,r,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+i);i-=1,e={time:data.k[i].t/elem.comp.globalData.frameRate,value:[]};var o=Object.prototype.hasOwnProperty.call(data.k[i],"s")?data.k[i].s:data.k[i-1].e;for(s=o.length,r=0;rx.length-1)&&(v=x.length-1),w=x[x.length-1-v].t,E=A-w);var _,T,C;if(g==="pingpong"){var P=Math.floor((S-w)/E);if(P%2!==0)return this.getValueAtTime((E-(S-w)%E+w)/this.comp.globalData.frameRate,0)}else if(g==="offset"){var k=this.getValueAtTime(w/this.comp.globalData.frameRate,0),M=this.getValueAtTime(A/this.comp.globalData.frameRate,0),R=this.getValueAtTime(((S-w)%E+w)/this.comp.globalData.frameRate,0),H=Math.floor((S-w)/E);if(this.pv.length){for(C=new Array(k.length),T=C.length,_=0;_=A)return this.pv;var E,w;b?(v?E=Math.abs(this.elem.comp.globalData.frameRate*v):E=Math.max(0,this.elem.data.op-A),w=A+E):((!v||v>x.length-1)&&(v=x.length-1),w=x[v].t,E=w-A);var _,T,C;if(g==="pingpong"){var P=Math.floor((A-S)/E);if(P%2===0)return this.getValueAtTime(((A-S)%E+A)/this.comp.globalData.frameRate,0)}else if(g==="offset"){var k=this.getValueAtTime(A/this.comp.globalData.frameRate,0),M=this.getValueAtTime(w/this.comp.globalData.frameRate,0),R=this.getValueAtTime((E-(A-S)%E+A)/this.comp.globalData.frameRate,0),H=Math.floor((A-S)/E)+1;if(this.pv.length){for(C=new Array(k.length),T=C.length,_=0;_1?(x-S)/(v-1):1,E=0,w=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var T;EE){var P=w,k=S.c&&w===_-1?0:w+1,M=(E-T)/A[w].addedLength;C=bez.getPointInSegment(S.v[P],S.v[k],S.o[P],S.i[k],M,A[w]);break}else T+=A[w].addedLength;w+=1}return C||(C=S.c?[S.v[0][0],S.v[0][1]]:[S.v[S._length-1][0],S.v[S._length-1][1]]),C},vectorOnPath:function(v,b,S){v==1?v=this.v.c:v==0&&(v=.999);var x=this.pointOnPath(v,b),A=this.pointOnPath(v+.001,b),E=A[0]-x[0],w=A[1]-x[1],_=Math.sqrt(Math.pow(E,2)+Math.pow(w,2));if(_===0)return[0,0];var T=S==="tangent"?[E/_,w/_]:[-w/_,E/_];return T},tangentOnPath:function(v,b){return this.vectorOnPath(v,b,"tangent")},normalOnPath:function(v,b){return this.vectorOnPath(v,b,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([y],c),extendPrototype([y],d),d.prototype.getValueAtTime=u,d.prototype.initiateExpression=ExpressionManager.initiateExpression;var m=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(g,v,b,S,x){var A=m(g,v,b,S,x);return A.propertyIndex=v.ix,A.lock=!1,b===3?expressionHelpers.searchExpressions(g,v.pt,A):b===4&&expressionHelpers.searchExpressions(g,v.ks,A),A.k&&g.addDynamicProperty(A),A}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function i(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,r){var s=this.calculateExpression(r);if(e.t!==s){var o={};return this.copyData(o,e),o.t=s.toString(),o.__complete=!1,o}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),r=this.searchExpressions();return this.kf=e||r,this.kf},TextProperty.prototype.searchExpressions=i}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function i(e,r){var s=createNS("feMerge");s.setAttribute("result",e);var o,a;for(a=0;a=d?m=b<0?s:o:m=s+v*Math.pow((u-i)/b,1/r),y[g]=m,g+=1,a+=256/(l-1);return y.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(i||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(i||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(i||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(i||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(i||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}};function SVGDropShadowEffect(i,e,r,s,o){var a=e.container.globalData.renderConfig.filterSize,l=e.data.fs||a;i.setAttribute("x",l.x||a.x),i.setAttribute("y",l.y||a.y),i.setAttribute("width",l.width||a.width),i.setAttribute("height",l.height||a.height),this.filterManager=e;var u=createNS("feGaussianBlur");u.setAttribute("in","SourceAlpha"),u.setAttribute("result",s+"_drop_shadow_1"),u.setAttribute("stdDeviation","0"),this.feGaussianBlur=u,i.appendChild(u);var c=createNS("feOffset");c.setAttribute("dx","25"),c.setAttribute("dy","0"),c.setAttribute("in",s+"_drop_shadow_1"),c.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=c,i.appendChild(c);var d=createNS("feFlood");d.setAttribute("flood-color","#00ff00"),d.setAttribute("flood-opacity","1"),d.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=d,i.appendChild(d);var y=createNS("feComposite");y.setAttribute("in",s+"_drop_shadow_3"),y.setAttribute("in2",s+"_drop_shadow_2"),y.setAttribute("operator","in"),y.setAttribute("result",s+"_drop_shadow_4"),i.appendChild(y);var m=this.createMergeNode(s,[s+"_drop_shadow_4",o]);i.appendChild(m)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){if((i||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),i||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)))}if((i||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),i||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,o=r*Math.cos(s),a=r*Math.sin(s);this.feOffset.setAttribute("dx",o),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(i,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=i,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}SVGMatte3Effect.prototype.findSymbol=function(i){for(var e=0,r=_svgMatteSymbols.length;e-1&&i%1==0&&i-1&&i%1==0&&i<=MAX_SAFE_INTEGER}function isArrayLike(i){return i!=null&&isLength(i.length)&&!isFunction$1(i)}var objectProto$a=Object.prototype;function isPrototype(i){var e=i&&i.constructor,r=typeof e=="function"&&e.prototype||objectProto$a;return i===r}function baseTimes(i,e){for(var r=-1,s=Array(i);++r-1}function listCacheSet(i,e){var r=this.__data__,s=assocIndexOf(r,i);return s<0?(++this.size,r.push([i,e])):r[s][1]=e,this}function ListCache(i){var e=-1,r=i==null?0:i.length;for(this.clear();++eu))return!1;var d=a.get(i),y=a.get(e);if(d&&y)return d==e&&y==i;var m=-1,g=!0,v=r&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(a.set(i,e),a.set(e,i);++m{const r=i.__vccOpts||i;for(const[s,o]of e)r[s]=o;return r};const _sfc_main=defineComponent({props:{animationData:{type:Object,default:()=>({})},animationLink:{type:String,default:""},loop:{type:[Boolean,Number],default:!0},autoPlay:{type:Boolean,default:!0},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},speed:{type:Number,default:1},delay:{type:Number,default:0},direction:{type:String,default:"forward"},pauseOnHover:{type:Boolean,default:!1},playOnHover:{type:Boolean,default:!1},backgroundColor:{type:String,default:"transparent"},pauseAnimation:{type:Boolean,default:!1},renderer:{type:String,default:"svg"},rendererSettings:{type:Object,default:()=>({})},assetsPath:{type:String,default:""}},emits:{onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onAnimationLoaded:null},setup(i,{emit:e}){let r=ref(null);const s=ref("");let o=1;const a=k=>document.querySelector(`[data-id="${k}"]`)!==null,l=async k=>{let M=i.autoPlay;i.playOnHover&&(M=!1);let R={};if(isEqual(i.animationData,{})===!1&&(R=cloneDeep(i.animationData)),i.animationLink!="")try{R=await(await fetch(i.animationLink)).json()}catch(F){console.error(F);return}let H=i.loop;typeof H=="number"&&H>0&&(H=H-1),i.delay>0&&(M=!1);const B={container:k,renderer:i.renderer,loop:H,autoplay:M,animationData:R,assetsPath:i.assetsPath};isEqual(i.rendererSettings,{})===!1&&(B.rendererSettings=i.rendererSettings),r=Lottie.loadAnimation(B),setTimeout(()=>{M=i.autoPlay,i.playOnHover?r.pause():M?r.play():r.pause(),e("onAnimationLoaded")},i.delay),r.setSpeed(i.speed),i.direction==="reverse"&&r.setDirection(-1),i.direction==="normal"&&r.setDirection(1),(i.pauseAnimation||i.playOnHover)&&r.pause(),r.addEventListener("loopComplete",()=>{i.direction==="alternate"&&(r.stop(),o=o*-1,r.setDirection(o),r.play()),e("onLoopComplete")}),r.addEventListener("complete",()=>{e("onComplete")}),r.addEventListener("enterFrame",()=>{e("onEnterFrame")}),r.addEventListener("segmentStart",()=>{e("onSegmentStart")})},u=computed(()=>{let k=i.width,M=i.height;return typeof i.width=="number"&&(k=`${i.width}px`),typeof i.height=="number"&&(M=`${i.height}px`),{"--lottie-animation-container-width":k,"--lottie-animation-container-height":M,"--lottie-animation-container-background-color":i.backgroundColor}}),c=()=>{r&&i.pauseOnHover&&r.pause(),r&&i.playOnHover&&r.play()},d=()=>{r&&i.pauseOnHover&&r.play(),r&&i.playOnHover&&r.pause()};watch(()=>i.pauseAnimation,()=>{if((i.pauseOnHover||i.playOnHover)&&i.pauseAnimation){console.error("If you are using pauseAnimation prop for Vue3-Lottie, please remove the props pauseOnHover and playOnHover");return}r&&(i.pauseAnimation?r.pause():r.play())});const y=()=>{r&&r.play()},m=()=>{r&&r.pause()},g=()=>{r&&r.stop()},v=()=>{r&&r.destroy()},b=(k=1)=>{if(k<=0)throw new Error("Speed must be greater than 0");r&&r.setSpeed(k)},S=k=>{r&&(k==="forward"?r.setDirection(1):k==="reverse"&&r.setDirection(-1))},x=(k,M=!0)=>{r&&r.goToAndStop(k,M)},A=(k,M=!0)=>{r&&r.goToAndPlay(k,M)},E=(k,M=!1)=>{r&&r.playSegments(k,M)},w=(k=!0)=>{r&&r.setSubframe(k)},_=(k=!0)=>{if(r)return r.getDuration(k)},T=(k,M=0)=>{r&&r.renderer.elements[M].updateDocumentData(k)},C=k=>{for(var M="",R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",H=R.length,B=0;B{if(i.pauseOnHover&&i.playOnHover)throw new Error("You cannot set pauseOnHover and playOnHover for Vue3-Lottie at the same time.");if(i.animationLink===""&&isEqual(i.animationData,{}))throw new Error("You must provide either animationLink or animationData");const M=setInterval(()=>{if(a(k)){clearInterval(M);const R=document.querySelector(`[data-id="${k}" ]`);R&&l(R)}},0)};return onMounted(async()=>{s.value=C(20),P(s.value)}),{elementid:s,hoverEnded:d,hoverStarted:c,getCurrentStyle:u,play:y,pause:m,stop:g,destroy:v,setSpeed:b,setDirection:S,goToAndStop:x,goToAndPlay:A,playSegments:E,setSubFrame:w,getDuration:_,updateDocumentData:T}}}),_hoisted_1=["data-id"];function _sfc_render(i,e,r,s,o,a){return openBlock(),createElementBlock("div",{"data-id":i.elementid,class:"lottie-animation-container",style:normalizeStyle(i.getCurrentStyle),onMouseenter:e[0]||(e[0]=(...l)=>i.hoverStarted&&i.hoverStarted(...l)),onMouseleave:e[1]||(e[1]=(...l)=>i.hoverEnded&&i.hoverEnded(...l))},null,44,_hoisted_1)}var Vue3Lottie=_export_sfc(_sfc_main,[["render",_sfc_render]]);const brid="_brid_107xg_1",note$3="_note_107xg_4",styles$o={brid,note:note$3};let _numberOfSegments=56;const _canvasDomHeight=60,smoothAnimationState={isShow:ref(!1),canvasDom:null,canvasCtx:null,canvasDomWith:0,canvasDomHeight:_canvasDomHeight,canvasSmoothDom:null,smoothAnimationBoxDom:null,smoothBotDom:null,osmdCanvasPageDom:null,osdmScrollDom:null,osdmScrollDomWith:0,osdmScrollDomOffsetLeft:0,selectionBoxDom:null,batePos:[],pointsPos:[],translateXNum:0,aveSpeed:0};watch(smoothAnimationState.isShow,()=>{var i,e;smoothAnimationState.isShow.value?(i=smoothAnimationState.smoothAnimationBoxDom)==null||i.classList.remove("smoothAnimationBoxHide"):(e=smoothAnimationState.smoothAnimationBoxDom)==null||e.classList.add("smoothAnimationBoxHide")});function dataFindIndex(i,e){const r=Math.round(e*_numberOfSegments),{noteId:s,MeasureNumberXML:o}=smoothAnimationState.batePos[i];return smoothAnimationState.pointsPos.findIndex(a=>a.noteId===s&&a.MeasureNumberXML===o)+r}function destroySmoothAnimation(){var i;smoothAnimationState.isShow.value=!1,window.removeEventListener("resize",calcClientWidth),(i=smoothAnimationState.smoothAnimationBoxDom)==null||i.remove(),Object.assign(smoothAnimationState,{canvasDom:null,canvasCtx:null,canvasDomWith:0,canvasDomHeight:_canvasDomHeight,canvasSmoothDom:null,smoothAnimationBoxDom:null,smoothBotDom:null,osmdCanvasPageDom:null,osdmScrollDom:null,osdmScrollDomWith:0,osdmScrollDomOffsetLeft:0,selectionBoxDom:null,batePos:[],pointsPos:[],translateXNum:0,aveSpeed:0})}function moveSmoothAnimationByPlayTime(i){var a,l,u,c;if(state$1.playState==="paused")return;const e=i||getAudioCurrentTime();if(e<=state$1.fixtime||e>((a=state$1.times.last())==null?void 0:a.endtime))return;const r=state$1.activeNoteIndex+1,s=(r>state$1.times.length-1?(l=state$1.times[state$1.activeNoteIndex])==null?void 0:l.endtime:state$1.times[r].time)-((u=state$1.times[state$1.activeNoteIndex])==null?void 0:u.time);if(s<=0)return;let o=(e-((c=state$1.times[state$1.activeNoteIndex])==null?void 0:c.time))/s;o<0&&(o=0),moveSmoothAnimation(o,state$1.activeNoteIndex)}function moveSmoothAnimation(i,e,r=!0){const s=dataFindIndex(e,i),o=smoothAnimationState.pointsPos[s];if((o==null?void 0:o.x)==null){console.error(o==null?void 0:o.x,"nowPointsPos",s,e);return}smoothAnimationMove({x:o.x-18,y:o.y-23},smoothAnimationState.pointsPos.slice(0,s)),r&&move_osmd(o)}function move_osmd(i){var y;const e=(state$1.modeType==="evaluating"?smoothAnimationState.aveSpeed*.5:smoothAnimationState.aveSpeed)*(state$1.speed/60),r=smoothAnimationState.osdmScrollDomWith,s=r/2;let{left:o,right:a,width:l}=smoothAnimationState.smoothBotDom.getBoundingClientRect();o-=smoothAnimationState.osdmScrollDomOffsetLeft,a-=smoothAnimationState.osdmScrollDomOffsetLeft;const u=o+l/2;a>r?(smoothAnimationState.translateXNum=0,smoothAnimationState.osdmScrollDom.scrollLeft=i.x-r*.9):o<0?(smoothAnimationState.translateXNum=0,smoothAnimationState.osdmScrollDom.scrollLeft=i.x-r*.1):u>s-r*.3&&u<=s-r*.25?smoothAnimationState.translateXNum+=e*.5:u>s-r*.25&&u<=s-r*.2?smoothAnimationState.translateXNum+=e*.6:u>s-r*.2&&u<=s-r*.15?smoothAnimationState.translateXNum+=e*.7:u>s-r*.15&&u<=s-r*.1?smoothAnimationState.translateXNum+=e*.8:u>s-r*.1&&u<=s-r*.05?smoothAnimationState.translateXNum+=e*.9:u>s-r*.05&&u<=s?smoothAnimationState.translateXNum+=e:u>s&&u<=s+r*.05?smoothAnimationState.translateXNum+=e*1.2:u>s+r*.05&&u<=s+r*.1?smoothAnimationState.translateXNum+=e*1.4:u>s+r*.1&&u<=s+r*.15?smoothAnimationState.translateXNum+=e*1.7:u>s+r*.15&&u<=s+r*.2?smoothAnimationState.translateXNum+=e*2:u>s+r*.2&&u<=s+r*.25?smoothAnimationState.translateXNum+=e*2.4:u>s+r*.25&&u<=s+r*.3?smoothAnimationState.translateXNum+=e*2.8:u>s+r*.3&&u<=s+r*.35?smoothAnimationState.translateXNum+=e*3.3:u>s+r*.35&&u<=s+r*.4?smoothAnimationState.translateXNum+=e*3.8:u>s+r*.4&&u<=s+r*.45?smoothAnimationState.translateXNum+=e*4.4:u>s+r*.45&&u<=s+r*.5&&(smoothAnimationState.translateXNum+=e*5);const c=((y=smoothAnimationState.osdmScrollDom)==null?void 0:y.scrollLeft)||0,d=smoothAnimationState.canvasDomWith-smoothAnimationState.osdmScrollDomWith-c;smoothAnimationState.translateXNum>d&&(smoothAnimationState.translateXNum=d),moveTranslateXNum(smoothAnimationState.translateXNum)}function moveTranslateXNum(i){smoothAnimationState.osmdCanvasPageDom&&(smoothAnimationState.osmdCanvasPageDom.style.transform=`translateX(-${i}px)`),smoothAnimationState.selectionBoxDom&&(smoothAnimationState.selectionBoxDom.style.transform=`translateX(-${i}px)`)}function smoothAnimationMove(i,e){smoothAnimationState.smoothBotDom&&(smoothAnimationState.smoothBotDom.style.transform=`translate(${i.x}px, ${i.y}px)`),smoothAnimationState.canvasCtx&&drawSmoothCurveProgress(smoothAnimationState.canvasCtx,e,"#FFC121")}function calcClientWidth(){var i,e;smoothAnimationState.osdmScrollDomWith=((i=smoothAnimationState.osdmScrollDom)==null?void 0:i.offsetWidth)||0,smoothAnimationState.osdmScrollDomOffsetLeft=((e=smoothAnimationState.osdmScrollDom)==null?void 0:e.getBoundingClientRect().left)||0}function drawSmoothCurveProgress(i,e,r){i.clearRect(0,0,smoothAnimationState.canvasDomWith,smoothAnimationState.canvasDomHeight),smoothAnimationState.canvasSmoothDom&&i.drawImage(smoothAnimationState.canvasSmoothDom,0,0),drawLines(i,e,r)}function drawLines(i,e,r){if(e.length!==0){i.lineWidth=2,i.strokeStyle=r,i.beginPath(),i.moveTo(e[0].x,e[0].y);for(let s=1;s>>6)+y(128|I&63):y(224|I>>>12&15)+y(128|I>>>6&63)+y(128|I&63)}else{var I=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return y(240|I>>>18&7)+y(128|I>>>12&63)+y(128|I>>>6&63)+y(128|I&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,v=function(F){return F.replace(g,m)},b=function(F){var I=[0,2,1][F.length%3],U=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),D=[c.charAt(U>>>18),c.charAt(U>>>12&63),I>=2?"=":c.charAt(U>>>6&63),I>=1?"=":c.charAt(U&63)];return D.join("")},S=a.btoa?function(B){return a.btoa(B)}:function(B){return B.replace(/[\s\S]{1,3}/g,b)},x=function(B){return S(v(B))},A=function(F,I){return I?x(String(F)).replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,""):x(String(F))},E=function(F){return A(F,!0)},w=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),_=function(F){switch(F.length){case 4:var I=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),U=I-65536;return y((U>>>10)+55296)+y((U&1023)+56320);case 3:return y((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return y((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},T=function(F){return F.replace(w,_)},C=function(F){var I=F.length,U=I%4,D=(I>0?d[F.charAt(0)]<<18:0)|(I>1?d[F.charAt(1)]<<12:0)|(I>2?d[F.charAt(2)]<<6:0)|(I>3?d[F.charAt(3)]:0),$=[y(D>>>16),y(D>>>8&255),y(D&255)];return $.length-=[0,0,2,1][U],$.join("")},P=a.atob?function(B){return a.atob(B)}:function(B){return B.replace(/[\s\S]{1,4}/g,C)},k=function(B){return T(P(B))},M=function(F){return k(String(F).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},R=function(){var F=a.Base64;return a.Base64=l,F},H={VERSION:u,atob:P,btoa:S,fromBase64:M,toBase64:A,utob:v,encode:A,encodeURI:E,btou:T,decode:M,noConflict:R};return H}();r.exports=o},"./lib/crypto.js":function(r,s,o){(function(a){var l=o("./node_modules/@babel/runtime/helpers/typeof.js"),u=u||function(c,d){var y={},m=y.lib={},g=function(){},v=m.Base={extend:function(C){g.prototype=this;var P=new g;return C&&P.mixIn(C),P.hasOwnProperty("init")||(P.init=function(){P.$super.init.apply(this,arguments)}),P.init.prototype=P,P.$super=this,P},create:function(){var C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var P in C)C.hasOwnProperty(P)&&(this[P]=C[P]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}},b=m.WordArray=v.extend({init:function(C,P){C=this.words=C||[],this.sigBytes=P!=d?P:4*C.length},toString:function(C){return(C||x).stringify(this)},concat:function(C){var P=this.words,k=C.words,M=this.sigBytes;if(C=C.sigBytes,this.clamp(),M%4)for(var R=0;R>>2]|=(k[R>>>2]>>>24-8*(R%4)&255)<<24-8*((M+R)%4);else if(65535>>2]=k[R>>>2];else P.push.apply(P,k);return this.sigBytes+=C,this},clamp:function(){var C=this.words,P=this.sigBytes;C[P>>>2]&=4294967295<<32-8*(P%4),C.length=c.ceil(P/4)},clone:function(){var C=v.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var P=[],k=0;k>>2]>>>24-8*(M%4)&255;k.push((R>>>4).toString(16)),k.push((R&15).toString(16))}return k.join("")},parse:function(C){for(var P=C.length,k=[],M=0;M>>3]|=parseInt(C.substr(M,2),16)<<24-4*(M%8);return new b.init(k,P/2)}},A=S.Latin1={stringify:function(C){var P=C.words;C=C.sigBytes;for(var k=[],M=0;M>>2]>>>24-8*(M%4)&255));return k.join("")},parse:function(C){for(var P=C.length,k=[],M=0;M>>2]|=(C.charCodeAt(M)&255)<<24-8*(M%4);return new b.init(k,P)}},E=S.Utf8={stringify:function(C){try{return decodeURIComponent(escape(A.stringify(C)))}catch(P){throw Error("Malformed UTF-8 data")}},parse:function(C){return A.parse(unescape(encodeURIComponent(C)))}},w=m.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new b.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=E.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var P=this._data,k=P.words,M=P.sigBytes,R=this.blockSize,H=M/(4*R),H=C?c.ceil(H):c.max((H|0)-this._minBufferSize,0);if(C=H*R,M=c.min(4*C,M),C){for(var B=0;BC;C++){if(16>C)m[C]=b[S+C]|0;else{var P=m[C-3]^m[C-8]^m[C-14]^m[C-16];m[C]=P<<1|P>>>31}P=(A<<5|A>>>27)+T+m[C],P=20>C?P+((E&w|~E&_)+1518500249):40>C?P+((E^w^_)+1859775393):60>C?P+((E&w|E&_|w&_)-1894007588):P+((E^w^_)-899497514),T=_,_=w,w=E<<30|E>>>2,E=A,A=P}x[0]=x[0]+A|0,x[1]=x[1]+E|0,x[2]=x[2]+w|0,x[3]=x[3]+_|0,x[4]=x[4]+T|0},_doFinalize:function(){var b=this._data,S=b.words,x=8*this._nDataBytes,A=8*b.sigBytes;return S[A>>>5]|=128<<24-A%32,S[(A+64>>>9<<4)+14]=Math.floor(x/4294967296),S[(A+64>>>9<<4)+15]=x,b.sigBytes=4*S.length,this._process(),this._hash},clone:function(){var b=y.clone.call(this);return b._hash=this._hash.clone(),b}});c.SHA1=y._createHelper(g),c.HmacSHA1=y._createHmacHelper(g)})(),function(){var c=u,d=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(m,g){m=this._hasher=new m.init,typeof g=="string"&&(g=d.parse(g));var v=m.blockSize,b=4*v;g.sigBytes>b&&(g=m.finalize(g)),g.clamp();for(var S=this._oKey=g.clone(),x=this._iKey=g.clone(),A=S.words,E=x.words,w=0;w>>2]>>>24-E%4*8&255,_=b[E+1>>>2]>>>24-(E+1)%4*8&255,T=b[E+2>>>2]>>>24-(E+2)%4*8&255,C=w<<16|_<<8|T,P=0;P<4&&E+P*.75>>6*(3-P)&63));var k=x.charAt(64);if(k)for(;A.length%4;)A.push(k);return A.join("")},parse:function(v){var b=v.length,S=this._map,x=S.charAt(64);if(x){var A=v.indexOf(x);A!=-1&&(b=A)}for(var E=[],w=0,_=0;_>>6-_%4*2;E[w>>>2]|=(T|C)<<24-w%4*8,w++}return y.create(E,w)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),l(a)==="object"?a.exports=u:window.CryptoJS=u}).call(this,o("./node_modules/webpack/buildin/module.js")(r))},"./lib/json2xml.js":function(r,s,o){var a=o("./node_modules/@babel/runtime/helpers/typeof.js"),l="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿿、-퟿豈-﷏ﷰ-�",u="-.0-9·̀-ͯ‿⁀",c=new RegExp("^([^"+l+"])|^((x|X)(m|M)(l|L))|([^"+l+u+"])","g"),d=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,y=function(S){var x=[];if(S instanceof Object)for(var A in S)S.hasOwnProperty(A)&&x.push(A);return x},m=function(S,x){var A=function(w,_,T,C,P){var k=x.indent!==void 0?x.indent:" ",M=x.prettyPrint?` `+new Array(C).join(k):"";x.removeIllegalNameCharacters&&(w=w.replace(c,"_"));var R=[M,"<",w,T||""];return _&&_.length>0?(R.push(">"),R.push(_),P&&R.push(M),R.push("")):R.push("/>"),R.join("")};return function E(w,_,T){var C=a(w);switch((Array.isArray?Array.isArray(w):w instanceof Array)?C="array":w instanceof Date&&(C="date"),C){case"array":var P=[];return w.map(function(H){P.push(E(H,1,T+1))}),x.prettyPrint&&P.push(` `),P.join("");case"date":return w.toJSON?w.toJSON():w+"";case"object":var k=[];for(var M in w)if(w.hasOwnProperty(M))if(w[M]instanceof Array)for(var R=0;R0&&k.push(` `),k.join("");case"function":return w();default:return x.escape?v(w):""+w}}(S,0,0)},g=function(S){var x=['"),x.join("")};function v(b){return(""+b).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(d,"")}r.exports=function(b,S){if(S||(S={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof b=="string")try{b=JSON.parse(b.toString())}catch(w){return!1}var x="",A="";S&&(a(S)=="object"?(S.xmlHeader&&(x=g(!!S.xmlHeader.standalone)),typeof S.docType<"u"&&(A="")):x=g()),S=S||{};var E=[x,S.prettyPrint&&A?` `:"",A,m(b,S)];return E.join("").replace(/\n{2,}/g,` `).replace(/\s+$/g,"")}},"./lib/md5.js":function(r,s,o){(function(a){var l,u=o("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var c=(typeof window>"u"?"undefined":u(window))==="object",d=c?window:{};d.JS_MD5_NO_WINDOW&&(c=!1);var y=!c&&(typeof self>"u"?"undefined":u(self))==="object";y&&(d=self);var m=!d.JS_MD5_NO_COMMON_JS&&u(a)==="object"&&a.exports,g=o("./node_modules/webpack/buildin/amd-options.js"),v=!d.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",b="0123456789abcdef".split(""),S=[128,32768,8388608,-2147483648],x=[0,8,16,24],A=["hex","array","digest","buffer","arrayBuffer","base64"],E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),w=[],_;if(v){var T=new ArrayBuffer(68);_=new Uint8Array(T),w=new Uint32Array(T)}(d.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(R){return Object.prototype.toString.call(R)==="[object Array]"}),v&&(d.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(R){return u(R)==="object"&&R.buffer&&R.buffer.constructor===ArrayBuffer});var C=function(H){return function(B,F){return new k(!0).update(B,F)[H]()}},P=function(){var H=C("hex");H.getCtx=H.create=function(){return new k},H.update=function(I){return H.create().update(I)};for(var B=0;B>6,$[I++]=128|B&63):B<55296||B>=57344?($[I++]=224|B>>12,$[I++]=128|B>>6&63,$[I++]=128|B&63):(B=65536+((B&1023)<<10|R.charCodeAt(++F)&1023),$[I++]=240|B>>18,$[I++]=128|B>>12&63,$[I++]=128|B>>6&63,$[I++]=128|B&63);else for(I=this.start;F>2]|=B<>2]|=(192|B>>6)<>2]|=(128|B&63)<=57344?(D[I>>2]|=(224|B>>12)<>2]|=(128|B>>6&63)<>2]|=(128|B&63)<>2]|=(240|B>>18)<>2]|=(128|B>>12&63)<>2]|=(128|B>>6&63)<>2]|=(128|B&63)<=64?(this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var R=this.blocks,H=this.lastByteIndex;R[H>>2]|=S[H&3],H>=56&&(this.hashed||this.hash(),R[0]=R[16],R[16]=R[1]=R[2]=R[3]=R[4]=R[5]=R[6]=R[7]=R[8]=R[9]=R[10]=R[11]=R[12]=R[13]=R[14]=R[15]=0),R[14]=this.bytes<<3,R[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},k.prototype.hash=function(){var R,H,B,F,I,U,D=this.blocks;this.first?(R=D[0]-680876937,R=(R<<7|R>>>25)-271733879<<0,F=(-1732584194^R&2004318071)+D[1]-117830708,F=(F<<12|F>>>20)+R<<0,B=(-271733879^F&(R^-271733879))+D[2]-1126478375,B=(B<<17|B>>>15)+F<<0,H=(R^B&(F^R))+D[3]-1316259209,H=(H<<22|H>>>10)+B<<0):(R=this.h0,H=this.h1,B=this.h2,F=this.h3,R+=(F^H&(B^F))+D[0]-680876936,R=(R<<7|R>>>25)+H<<0,F+=(B^R&(H^B))+D[1]-389564586,F=(F<<12|F>>>20)+R<<0,B+=(H^F&(R^H))+D[2]+606105819,B=(B<<17|B>>>15)+F<<0,H+=(R^B&(F^R))+D[3]-1044525330,H=(H<<22|H>>>10)+B<<0),R+=(F^H&(B^F))+D[4]-176418897,R=(R<<7|R>>>25)+H<<0,F+=(B^R&(H^B))+D[5]+1200080426,F=(F<<12|F>>>20)+R<<0,B+=(H^F&(R^H))+D[6]-1473231341,B=(B<<17|B>>>15)+F<<0,H+=(R^B&(F^R))+D[7]-45705983,H=(H<<22|H>>>10)+B<<0,R+=(F^H&(B^F))+D[8]+1770035416,R=(R<<7|R>>>25)+H<<0,F+=(B^R&(H^B))+D[9]-1958414417,F=(F<<12|F>>>20)+R<<0,B+=(H^F&(R^H))+D[10]-42063,B=(B<<17|B>>>15)+F<<0,H+=(R^B&(F^R))+D[11]-1990404162,H=(H<<22|H>>>10)+B<<0,R+=(F^H&(B^F))+D[12]+1804603682,R=(R<<7|R>>>25)+H<<0,F+=(B^R&(H^B))+D[13]-40341101,F=(F<<12|F>>>20)+R<<0,B+=(H^F&(R^H))+D[14]-1502002290,B=(B<<17|B>>>15)+F<<0,H+=(R^B&(F^R))+D[15]+1236535329,H=(H<<22|H>>>10)+B<<0,R+=(B^F&(H^B))+D[1]-165796510,R=(R<<5|R>>>27)+H<<0,F+=(H^B&(R^H))+D[6]-1069501632,F=(F<<9|F>>>23)+R<<0,B+=(R^H&(F^R))+D[11]+643717713,B=(B<<14|B>>>18)+F<<0,H+=(F^R&(B^F))+D[0]-373897302,H=(H<<20|H>>>12)+B<<0,R+=(B^F&(H^B))+D[5]-701558691,R=(R<<5|R>>>27)+H<<0,F+=(H^B&(R^H))+D[10]+38016083,F=(F<<9|F>>>23)+R<<0,B+=(R^H&(F^R))+D[15]-660478335,B=(B<<14|B>>>18)+F<<0,H+=(F^R&(B^F))+D[4]-405537848,H=(H<<20|H>>>12)+B<<0,R+=(B^F&(H^B))+D[9]+568446438,R=(R<<5|R>>>27)+H<<0,F+=(H^B&(R^H))+D[14]-1019803690,F=(F<<9|F>>>23)+R<<0,B+=(R^H&(F^R))+D[3]-187363961,B=(B<<14|B>>>18)+F<<0,H+=(F^R&(B^F))+D[8]+1163531501,H=(H<<20|H>>>12)+B<<0,R+=(B^F&(H^B))+D[13]-1444681467,R=(R<<5|R>>>27)+H<<0,F+=(H^B&(R^H))+D[2]-51403784,F=(F<<9|F>>>23)+R<<0,B+=(R^H&(F^R))+D[7]+1735328473,B=(B<<14|B>>>18)+F<<0,H+=(F^R&(B^F))+D[12]-1926607734,H=(H<<20|H>>>12)+B<<0,I=H^B,R+=(I^F)+D[5]-378558,R=(R<<4|R>>>28)+H<<0,F+=(I^R)+D[8]-2022574463,F=(F<<11|F>>>21)+R<<0,U=F^R,B+=(U^H)+D[11]+1839030562,B=(B<<16|B>>>16)+F<<0,H+=(U^B)+D[14]-35309556,H=(H<<23|H>>>9)+B<<0,I=H^B,R+=(I^F)+D[1]-1530992060,R=(R<<4|R>>>28)+H<<0,F+=(I^R)+D[4]+1272893353,F=(F<<11|F>>>21)+R<<0,U=F^R,B+=(U^H)+D[7]-155497632,B=(B<<16|B>>>16)+F<<0,H+=(U^B)+D[10]-1094730640,H=(H<<23|H>>>9)+B<<0,I=H^B,R+=(I^F)+D[13]+681279174,R=(R<<4|R>>>28)+H<<0,F+=(I^R)+D[0]-358537222,F=(F<<11|F>>>21)+R<<0,U=F^R,B+=(U^H)+D[3]-722521979,B=(B<<16|B>>>16)+F<<0,H+=(U^B)+D[6]+76029189,H=(H<<23|H>>>9)+B<<0,I=H^B,R+=(I^F)+D[9]-640364487,R=(R<<4|R>>>28)+H<<0,F+=(I^R)+D[12]-421815835,F=(F<<11|F>>>21)+R<<0,U=F^R,B+=(U^H)+D[15]+530742520,B=(B<<16|B>>>16)+F<<0,H+=(U^B)+D[2]-995338651,H=(H<<23|H>>>9)+B<<0,R+=(B^(H|~F))+D[0]-198630844,R=(R<<6|R>>>26)+H<<0,F+=(H^(R|~B))+D[7]+1126891415,F=(F<<10|F>>>22)+R<<0,B+=(R^(F|~H))+D[14]-1416354905,B=(B<<15|B>>>17)+F<<0,H+=(F^(B|~R))+D[5]-57434055,H=(H<<21|H>>>11)+B<<0,R+=(B^(H|~F))+D[12]+1700485571,R=(R<<6|R>>>26)+H<<0,F+=(H^(R|~B))+D[3]-1894986606,F=(F<<10|F>>>22)+R<<0,B+=(R^(F|~H))+D[10]-1051523,B=(B<<15|B>>>17)+F<<0,H+=(F^(B|~R))+D[1]-2054922799,H=(H<<21|H>>>11)+B<<0,R+=(B^(H|~F))+D[8]+1873313359,R=(R<<6|R>>>26)+H<<0,F+=(H^(R|~B))+D[15]-30611744,F=(F<<10|F>>>22)+R<<0,B+=(R^(F|~H))+D[6]-1560198380,B=(B<<15|B>>>17)+F<<0,H+=(F^(B|~R))+D[13]+1309151649,H=(H<<21|H>>>11)+B<<0,R+=(B^(H|~F))+D[4]-145523070,R=(R<<6|R>>>26)+H<<0,F+=(H^(R|~B))+D[11]-1120210379,F=(F<<10|F>>>22)+R<<0,B+=(R^(F|~H))+D[2]+718787259,B=(B<<15|B>>>17)+F<<0,H+=(F^(B|~R))+D[9]-343485551,H=(H<<21|H>>>11)+B<<0,this.first?(this.h0=R+1732584193<<0,this.h1=H-271733879<<0,this.h2=B-1732584194<<0,this.h3=F+271733878<<0,this.first=!1):(this.h0=this.h0+R<<0,this.h1=this.h1+H<<0,this.h2=this.h2+B<<0,this.h3=this.h3+F<<0)},k.prototype.hex=function(){this.finalize();var R=this.h0,H=this.h1,B=this.h2,F=this.h3;return b[R>>4&15]+b[R&15]+b[R>>12&15]+b[R>>8&15]+b[R>>20&15]+b[R>>16&15]+b[R>>28&15]+b[R>>24&15]+b[H>>4&15]+b[H&15]+b[H>>12&15]+b[H>>8&15]+b[H>>20&15]+b[H>>16&15]+b[H>>28&15]+b[H>>24&15]+b[B>>4&15]+b[B&15]+b[B>>12&15]+b[B>>8&15]+b[B>>20&15]+b[B>>16&15]+b[B>>28&15]+b[B>>24&15]+b[F>>4&15]+b[F&15]+b[F>>12&15]+b[F>>8&15]+b[F>>20&15]+b[F>>16&15]+b[F>>28&15]+b[F>>24&15]},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(R){if(R==="hex")return this.hex();this.finalize();var H=this.h0,B=this.h1,F=this.h2,I=this.h3,U=[H&255,H>>8&255,H>>16&255,H>>24&255,B&255,B>>8&255,B>>16&255,B>>24&255,F&255,F>>8&255,F>>16&255,F>>24&255,I&255,I>>8&255,I>>16&255,I>>24&255];return U},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var R=new ArrayBuffer(16),H=new Uint32Array(R);return H[0]=this.h0,H[1]=this.h1,H[2]=this.h2,H[3]=this.h3,R},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.base64=function(){for(var R,H,B,F="",I=this.array(),U=0;U<15;)R=I[U++],H=I[U++],B=I[U++],F+=E[R>>>2]+E[(R<<4|H>>>4)&63]+E[(H<<2|B>>>6)&63]+E[B&63];return R=I[U],F+=E[R>>>2]+E[R<<4&63]+"==",F};var M=P();m?a.exports=M:(d.md5=M,g&&(l=function(){return M}.call(M,o,M,a),l!==void 0&&(a.exports=l)))})()}).call(this,o("./node_modules/webpack/buildin/module.js")(r))},"./lib/request.js":function(r,s,o){var a=o("./node_modules/@babel/runtime/helpers/typeof.js"),l=function(g){switch(a(g)){case"string":return g;case"boolean":return g?"true":"false";case"number":return isFinite(g)?g:"";default:return""}},u=function(g,v,b,S){return v=v||"&",b=b||"=",g===null&&(g=void 0),a(g)==="object"?Object.keys(g).map(function(x){var A=encodeURIComponent(l(x))+b;return Array.isArray(g[x])?g[x].map(function(E){return A+encodeURIComponent(l(E))}).join(v):A+encodeURIComponent(l(g[x]))}).filter(Boolean).join(v):S?encodeURIComponent(l(S))+b+encodeURIComponent(l(g)):""},c=function(g,v,b){var S={},x=v.getAllResponseHeaders();return x&&x.length>0&&x.trim().split(` `).forEach(function(A){if(A){var E=A.indexOf(":"),w=A.substr(0,E).trim().toLowerCase(),_=A.substr(E+1).trim();S[w]=_}}),{error:g,statusCode:v.status,statusMessage:v.statusText,headers:S,body:b}},d=function(g,v){return!v&&v==="text"?g.responseText:g.response},y=function(g,v){var b=(g.method||"GET").toUpperCase(),S=g.url;if(g.qs){var x=u(g.qs);x&&(S+=(S.indexOf("?")===-1?"?":"&")+x)}var A=new XMLHttpRequest;if(A.open(b,S,!0),A.responseType=g.dataType||"text",g.xhrFields)for(var E in g.xhrFields)A[E]=g.xhrFields[E];var w=g.headers;if(w)for(var _ in w)w.hasOwnProperty(_)&&_.toLowerCase()!=="content-length"&&_.toLowerCase()!=="user-agent"&&_.toLowerCase()!=="origin"&&_.toLowerCase()!=="host"&&A.setRequestHeader(_,w[_]);return g.onProgress&&A.upload&&(A.upload.onprogress=g.onProgress),g.onDownloadProgress&&(A.onprogress=g.onDownloadProgress),g.timeout&&(A.timeout=g.timeout),A.ontimeout=function(T){var C=new Error("timeout");v(c(C,A))},A.onload=function(){v(c(null,A,d(A,g.dataType)))},A.onerror=function(T){var C=d(A,g.dataType);if(C)v(c(null,A,C));else{var P=A.statusText;!P&&A.status===0&&(P=new Error("CORS blocked or network error")),v(c(P,A,C))}},A.send(g.body||""),A};r.exports=y},"./lib/xml2json.js":function(r,s,o){var a=o("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,l=function(){this.version="1.3.5";var c={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},d=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(y){return/^\s*$/.test(y)?null:/^(?:true|false)$/i.test(y)?y.toLowerCase()==="true":isFinite(y)?parseFloat(y):y},this.parseString=function(y,m){if(y){var g=this.stringToXML(y);return g.getElementsByTagName("parsererror").length?null:this.parseXML(g,m)}else return null},this.parseXML=function(y,m){for(var g in m)c[g]=m[g];var v={},b=0,S="",x=y.childNodes.length;if(x)for(var A,E,w,_=0;_=C+P||C?new java.lang.String(T,C,P)+"":T}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(T){x.prototype[T]=function(){return null}});function _(T,C){T.currentElement?T.currentElement.appendChild(C):T.doc.appendChild(C)}s.__DOMHandler=x,s.normalizeLineEndings=v,s.DOMParser=b},"./node_modules/@xmldom/xmldom/lib/dom.js":function(r,s,o){var a=o("./node_modules/@xmldom/xmldom/lib/conventions.js"),l=a.find,u=a.NAMESPACE;function c(ee){return ee!==""}function d(ee){return ee?ee.split(/[\t\n\f\r ]+/).filter(c):[]}function y(ee,ae){return ee.hasOwnProperty(ae)||(ee[ae]=!0),ee}function m(ee){if(!ee)return[];var ae=d(ee);return Object.keys(ae.reduce(y,{}))}function g(ee){return function(ae){return ee&&ee.indexOf(ae)!==-1}}function v(ee,ae){for(var Te in ee)Object.prototype.hasOwnProperty.call(ee,Te)&&(ae[Te]=ee[Te])}function b(ee,ae){var Te=ee.prototype;if(!(Te instanceof ae)){let Ne=function(){};Ne.prototype=ae.prototype,Ne=new Ne,v(Te,Ne),ee.prototype=Te=Ne}Te.constructor!=ee&&(typeof ee!="function"&&console.error("unknown Class:"+ee),Te.constructor=ee)}var S={},x=S.ELEMENT_NODE=1,A=S.ATTRIBUTE_NODE=2,E=S.TEXT_NODE=3,w=S.CDATA_SECTION_NODE=4,_=S.ENTITY_REFERENCE_NODE=5,T=S.ENTITY_NODE=6,C=S.PROCESSING_INSTRUCTION_NODE=7,P=S.COMMENT_NODE=8,k=S.DOCUMENT_NODE=9,M=S.DOCUMENT_TYPE_NODE=10,R=S.DOCUMENT_FRAGMENT_NODE=11,H=S.NOTATION_NODE=12,B={},F={};B.INDEX_SIZE_ERR=(F[1]="Index size error",1),B.DOMSTRING_SIZE_ERR=(F[2]="DOMString size error",2);var I=B.HIERARCHY_REQUEST_ERR=(F[3]="Hierarchy request error",3);B.WRONG_DOCUMENT_ERR=(F[4]="Wrong document",4),B.INVALID_CHARACTER_ERR=(F[5]="Invalid character",5),B.NO_DATA_ALLOWED_ERR=(F[6]="No data allowed",6),B.NO_MODIFICATION_ALLOWED_ERR=(F[7]="No modification allowed",7);var U=B.NOT_FOUND_ERR=(F[8]="Not found",8);B.NOT_SUPPORTED_ERR=(F[9]="Not supported",9);var D=B.INUSE_ATTRIBUTE_ERR=(F[10]="Attribute in use",10);B.INVALID_STATE_ERR=(F[11]="Invalid state",11),B.SYNTAX_ERR=(F[12]="Syntax error",12),B.INVALID_MODIFICATION_ERR=(F[13]="Invalid modification",13),B.NAMESPACE_ERR=(F[14]="Invalid namespace",14),B.INVALID_ACCESS_ERR=(F[15]="Invalid access",15);function $(ee,ae){if(ae instanceof Error)var Te=ae;else Te=this,Error.call(this,F[ee]),this.message=F[ee],Error.captureStackTrace&&Error.captureStackTrace(this,$);return Te.code=ee,ae&&(this.message=this.message+": "+ae),Te}$.prototype=Error.prototype,v(B,$);function N(){}N.prototype={length:0,item:function(ee){return ee>=0&&ee=0){for(var We=ae.length-1;Ne0},lookupPrefix:function(ee){for(var ae=this;ae;){var Te=ae._nsMap;if(Te){for(var Ne in Te)if(Object.prototype.hasOwnProperty.call(Te,Ne)&&Te[Ne]===ee)return Ne}ae=ae.nodeType==A?ae.ownerDocument:ae.parentNode}return null},lookupNamespaceURI:function(ee){for(var ae=this;ae;){var Te=ae._nsMap;if(Te&&Object.prototype.hasOwnProperty.call(Te,ee))return Te[ee];ae=ae.nodeType==A?ae.ownerDocument:ae.parentNode}return null},isDefaultNamespace:function(ee){var ae=this.lookupPrefix(ee);return ae==null}};function ue(ee){return ee=="<"&&"<"||ee==">"&&">"||ee=="&"&&"&"||ee=='"'&&"""||"&#"+ee.charCodeAt()+";"}v(S,re),v(S,re.prototype);function ge(ee,ae){if(ae(ee))return!0;if(ee=ee.firstChild)do if(ge(ee,ae))return!0;while(ee=ee.nextSibling)}function Se(){this.ownerDocument=this}function Be(ee,ae,Te){ee&&ee._inc++;var Ne=Te.namespaceURI;Ne===u.XMLNS&&(ae._nsMap[Te.prefix?Te.localName:""]=Te.value)}function Ie(ee,ae,Te,Ne){ee&&ee._inc++;var We=Te.namespaceURI;We===u.XMLNS&&delete ae._nsMap[Te.prefix?Te.localName:""]}function J(ee,ae,Te){if(ee&&ee._inc){ee._inc++;var Ne=ae.childNodes;if(Te)Ne[Ne.length++]=Te;else{for(var We=ae.firstChild,rt=0;We;)Ne[rt++]=We,We=We.nextSibling;Ne.length=rt,delete Ne[Ne.length]}}}function se(ee,ae){var Te=ae.previousSibling,Ne=ae.nextSibling;return Te?Te.nextSibling=Ne:ee.firstChild=Ne,Ne?Ne.previousSibling=Te:ee.lastChild=Te,ae.parentNode=null,ae.previousSibling=null,ae.nextSibling=null,J(ee.ownerDocument,ee),ae}function V(ee){return ee&&(ee.nodeType===re.DOCUMENT_NODE||ee.nodeType===re.DOCUMENT_FRAGMENT_NODE||ee.nodeType===re.ELEMENT_NODE)}function pe(ee){return ee&&(K(ee)||Z(ee)||ce(ee)||ee.nodeType===re.DOCUMENT_FRAGMENT_NODE||ee.nodeType===re.COMMENT_NODE||ee.nodeType===re.PROCESSING_INSTRUCTION_NODE)}function ce(ee){return ee&&ee.nodeType===re.DOCUMENT_TYPE_NODE}function K(ee){return ee&&ee.nodeType===re.ELEMENT_NODE}function Z(ee){return ee&&ee.nodeType===re.TEXT_NODE}function he(ee,ae){var Te=ee.childNodes||[];if(l(Te,K)||ce(ae))return!1;var Ne=l(Te,ce);return!(ae&&Ne&&Te.indexOf(Ne)>Te.indexOf(ae))}function Ce(ee,ae){var Te=ee.childNodes||[];function Ne(rt){return K(rt)&&rt!==ae}if(l(Te,Ne))return!1;var We=l(Te,ce);return!(ae&&We&&Te.indexOf(We)>Te.indexOf(ae))}function Ae(ee,ae,Te){if(!V(ee))throw new $(I,"Unexpected parent node type "+ee.nodeType);if(Te&&Te.parentNode!==ee)throw new $(U,"child not in parent");if(!pe(ae)||ce(ae)&&ee.nodeType!==re.DOCUMENT_NODE)throw new $(I,"Unexpected node type "+ae.nodeType+" for parent node type "+ee.nodeType)}function _e(ee,ae,Te){var Ne=ee.childNodes||[],We=ae.childNodes||[];if(ae.nodeType===re.DOCUMENT_FRAGMENT_NODE){var rt=We.filter(K);if(rt.length>1||l(We,Z))throw new $(I,"More than one element or text in fragment");if(rt.length===1&&!he(ee,Te))throw new $(I,"Element in fragment can not be inserted before doctype")}if(K(ae)&&!he(ee,Te))throw new $(I,"Only one element can be added and only after doctype");if(ce(ae)){if(l(Ne,ce))throw new $(I,"Only one doctype is allowed");var vt=l(Ne,K);if(Te&&Ne.indexOf(vt)1||l(We,Z))throw new $(I,"More than one element or text in fragment");if(rt.length===1&&!Ce(ee,Te))throw new $(I,"Element in fragment can not be inserted before doctype")}if(K(ae)&&!Ce(ee,Te))throw new $(I,"Only one element can be added and only after doctype");if(ce(ae)){if(l(Ne,function(qe){return ce(qe)&&qe!==Te}))throw new $(I,"Only one doctype is allowed");var vt=l(Ne,K);if(Te&&Ne.indexOf(vt)0&&ge(Te.documentElement,function(We){if(We!==Te&&We.nodeType===x){var rt=We.getAttribute("class");if(rt){var vt=ee===rt;if(!vt){var Lt=m(rt);vt=ae.every(g(Lt))}vt&&Ne.push(We)}}}),Ne})},createElement:function(ee){var ae=new le;ae.ownerDocument=this,ae.nodeName=ee,ae.tagName=ee,ae.localName=ee,ae.childNodes=new N;var Te=ae.attributes=new z;return Te._ownerElement=ae,ae},createDocumentFragment:function(){var ee=new ot;return ee.ownerDocument=this,ee.childNodes=new N,ee},createTextNode:function(ee){var ae=new De;return ae.ownerDocument=this,ae.appendData(ee),ae},createComment:function(ee){var ae=new Ve;return ae.ownerDocument=this,ae.appendData(ee),ae},createCDATASection:function(ee){var ae=new $e;return ae.ownerDocument=this,ae.appendData(ee),ae},createProcessingInstruction:function(ee,ae){var Te=new pt;return Te.ownerDocument=this,Te.tagName=Te.nodeName=Te.target=ee,Te.nodeValue=Te.data=ae,Te},createAttribute:function(ee){var ae=new we;return ae.ownerDocument=this,ae.name=ee,ae.nodeName=ee,ae.localName=ee,ae.specified=!0,ae},createEntityReference:function(ee){var ae=new Ze;return ae.ownerDocument=this,ae.nodeName=ee,ae},createElementNS:function(ee,ae){var Te=new le,Ne=ae.split(":"),We=Te.attributes=new z;return Te.childNodes=new N,Te.ownerDocument=this,Te.nodeName=ae,Te.tagName=ae,Te.namespaceURI=ee,Ne.length==2?(Te.prefix=Ne[0],Te.localName=Ne[1]):Te.localName=ae,We._ownerElement=Te,Te},createAttributeNS:function(ee,ae){var Te=new we,Ne=ae.split(":");return Te.ownerDocument=this,Te.nodeName=ae,Te.name=ae,Te.namespaceURI=ee,Te.specified=!0,Ne.length==2?(Te.prefix=Ne[0],Te.localName=Ne[1]):Te.localName=ae,Te}},b(Se,re);function le(){this._nsMap={}}le.prototype={nodeType:x,hasAttribute:function(ee){return this.getAttributeNode(ee)!=null},getAttribute:function(ee){var ae=this.getAttributeNode(ee);return ae&&ae.value||""},getAttributeNode:function(ee){return this.attributes.getNamedItem(ee)},setAttribute:function(ee,ae){var Te=this.ownerDocument.createAttribute(ee);Te.value=Te.nodeValue=""+ae,this.setAttributeNode(Te)},removeAttribute:function(ee){var ae=this.getAttributeNode(ee);ae&&this.removeAttributeNode(ae)},appendChild:function(ee){return ee.nodeType===R?this.insertBefore(ee,null):Ee(this,ee)},setAttributeNode:function(ee){return this.attributes.setNamedItem(ee)},setAttributeNodeNS:function(ee){return this.attributes.setNamedItemNS(ee)},removeAttributeNode:function(ee){return this.attributes.removeNamedItem(ee.nodeName)},removeAttributeNS:function(ee,ae){var Te=this.getAttributeNodeNS(ee,ae);Te&&this.removeAttributeNode(Te)},hasAttributeNS:function(ee,ae){return this.getAttributeNodeNS(ee,ae)!=null},getAttributeNS:function(ee,ae){var Te=this.getAttributeNodeNS(ee,ae);return Te&&Te.value||""},setAttributeNS:function(ee,ae,Te){var Ne=this.ownerDocument.createAttributeNS(ee,ae);Ne.value=Ne.nodeValue=""+Te,this.setAttributeNode(Ne)},getAttributeNodeNS:function(ee,ae){return this.attributes.getNamedItemNS(ee,ae)},getElementsByTagName:function(ee){return new O(this,function(ae){var Te=[];return ge(ae,function(Ne){Ne!==ae&&Ne.nodeType==x&&(ee==="*"||Ne.tagName==ee)&&Te.push(Ne)}),Te})},getElementsByTagNameNS:function(ee,ae){return new O(this,function(Te){var Ne=[];return ge(Te,function(We){We!==Te&&We.nodeType===x&&(ee==="*"||We.namespaceURI===ee)&&(ae==="*"||We.localName==ae)&&Ne.push(We)}),Ne})}},Se.prototype.getElementsByTagName=le.prototype.getElementsByTagName,Se.prototype.getElementsByTagNameNS=le.prototype.getElementsByTagNameNS,b(le,re);function we(){}we.prototype.nodeType=A,b(we,re);function de(){}de.prototype={data:"",substringData:function(ee,ae){return this.data.substring(ee,ee+ae)},appendData:function(ee){ee=this.data+ee,this.nodeValue=this.data=ee,this.length=ee.length},insertData:function(ee,ae){this.replaceData(ee,0,ae)},appendChild:function(ee){throw new Error(F[I])},deleteData:function(ee,ae){this.replaceData(ee,ae,"")},replaceData:function(ee,ae,Te){var Ne=this.data.substring(0,ee),We=this.data.substring(ee+ae);Te=Ne+Te+We,this.nodeValue=this.data=Te,this.length=Te.length}},b(de,re);function De(){}De.prototype={nodeName:"#text",nodeType:E,splitText:function(ee){var ae=this.data,Te=ae.substring(ee);ae=ae.substring(0,ee),this.data=this.nodeValue=ae,this.length=ae.length;var Ne=this.ownerDocument.createTextNode(Te);return this.parentNode&&this.parentNode.insertBefore(Ne,this.nextSibling),Ne}},b(De,de);function Ve(){}Ve.prototype={nodeName:"#comment",nodeType:P},b(Ve,de);function $e(){}$e.prototype={nodeName:"#cdata-section",nodeType:w},b($e,de);function Je(){}Je.prototype.nodeType=M,b(Je,re);function Ye(){}Ye.prototype.nodeType=H,b(Ye,re);function tt(){}tt.prototype.nodeType=T,b(tt,re);function Ze(){}Ze.prototype.nodeType=_,b(Ze,re);function ot(){}ot.prototype.nodeName="#document-fragment",ot.prototype.nodeType=R,b(ot,re);function pt(){}pt.prototype.nodeType=C,b(pt,re);function nt(){}nt.prototype.serializeToString=function(ee,ae,Te){return ct.call(ee,ae,Te)},re.prototype.toString=ct;function ct(ee,ae){var Te=[],Ne=this.nodeType==9&&this.documentElement||this,We=Ne.prefix,rt=Ne.namespaceURI;if(rt&&We==null){var We=Ne.lookupPrefix(rt);if(We==null)var vt=[{namespace:rt,prefix:null}]}return ft(this,Te,ee,ae,vt),Te.join("")}function Pt(ee,ae,Te){var Ne=ee.prefix||"",We=ee.namespaceURI;if(!We||Ne==="xml"&&We===u.XML||We===u.XMLNS)return!1;for(var rt=Te.length;rt--;){var vt=Te[rt];if(vt.prefix===Ne)return vt.namespace!==We}return!0}function at(ee,ae,Te){ee.push(" ",ae,'="',Te.replace(/[<>&"\t\n\r]/g,ue),'"')}function ft(ee,ae,Te,Ne,We){if(We||(We=[]),Ne)if(ee=Ne(ee),ee){if(typeof ee=="string"){ae.push(ee);return}}else return;switch(ee.nodeType){case x:var rt=ee.attributes,vt=rt.length,me=ee.firstChild,Lt=ee.tagName;Te=u.isHTML(ee.namespaceURI)||Te;var qe=Lt;if(!Te&&!ee.prefix&&ee.namespaceURI){for(var Rt,ze=0;ze=0;gt--){var G=We[gt];if(G.prefix===""&&G.namespace===ee.namespaceURI){Rt=G.namespace;break}}if(Rt!==ee.namespaceURI)for(var gt=We.length-1;gt>=0;gt--){var G=We[gt];if(G.namespace===ee.namespaceURI){G.prefix&&(qe=G.prefix+":"+Lt);break}}}ae.push("<",qe);for(var oe=0;oe"),Te&&/^script$/i.test(Lt))for(;me;)me.data?ae.push(me.data):ft(me,ae,Te,Ne,We.slice()),me=me.nextSibling;else for(;me;)ft(me,ae,Te,Ne,We.slice()),me=me.nextSibling;ae.push("")}else ae.push("/>");return;case k:case R:for(var me=ee.firstChild;me;)ft(me,ae,Te,Ne,We.slice()),me=me.nextSibling;return;case A:return at(ae,ee.name,ee.value);case E:return ae.push(ee.data.replace(/[<&>]/g,ue));case w:return ae.push("");case P:return ae.push("");case M:var ve=ee.publicId,Le=ee.systemId;if(ae.push("");else if(Le&&Le!=".")ae.push(" SYSTEM ",Le,">");else{var Oe=ee.internalSubset;Oe&&ae.push(" [",Oe,"]"),ae.push(">")}return;case C:return ae.push("");case _:return ae.push("&",ee.nodeName,";");default:ae.push("??",ee.nodeName)}}function wt(ee,ae,Te){var Ne;switch(ae.nodeType){case x:Ne=ae.cloneNode(!1),Ne.ownerDocument=ee;case R:break;case A:Te=!0;break}if(Ne||(Ne=ae.cloneNode(!1)),Ne.ownerDocument=ee,Ne.parentNode=null,Te)for(var We=ae.firstChild;We;)Ne.appendChild(wt(ee,We,Te)),We=We.nextSibling;return Ne}function Gt(ee,ae,Te){var Ne=new ae.constructor;for(var We in ae)if(Object.prototype.hasOwnProperty.call(ae,We)){var rt=ae[We];typeof rt!="object"&&rt!=Ne[We]&&(Ne[We]=rt)}switch(ae.childNodes&&(Ne.childNodes=new N),Ne.ownerDocument=ee,Ne.nodeType){case x:var vt=ae.attributes,Lt=Ne.attributes=new z,qe=vt.length;Lt._ownerElement=Ne;for(var Rt=0;Rt",lt:"<",quot:'"'}),s.HTML_ENTITIES=a({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(r,s,o){var a=o("./node_modules/@xmldom/xmldom/lib/dom.js");s.DOMImplementation=a.DOMImplementation,s.XMLSerializer=a.XMLSerializer,s.DOMParser=o("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(r,s,o){var a=o("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,l=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,u=new RegExp("[\\-\\.0-9"+l.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),c=new RegExp("^"+l.source+u.source+"*(?::"+l.source+u.source+"*)?$"),d=0,y=1,m=2,g=3,v=4,b=5,S=6,x=7;function A(I,U){this.message=I,this.locator=U,Error.captureStackTrace&&Error.captureStackTrace(this,A)}A.prototype=new Error,A.prototype.name=A.name;function E(){}E.prototype={parse:function(I,U,D){var $=this.domBuilder;$.startDocument(),M(U,U={}),w(I,U,D,$,this.errorHandler),$.endDocument()}};function w(I,U,D,$,N){function O(le){if(le>65535){le-=65536;var we=55296+(le>>10),de=56320+(le&1023);return String.fromCharCode(we,de)}else return String.fromCharCode(le)}function Q(le){var we=le.slice(1,-1);return Object.hasOwnProperty.call(D,we)?D[we]:we.charAt(0)==="#"?O(parseInt(we.substr(1).replace("x","0x"))):(N.error("entity not found:"+le),le)}function z(le){if(le>Se){var we=I.substring(Se,le).replace(/&#?\w+;/g,Q);re&&W(Se),$.characters(we,0,le-Se),Se=le}}function W(le,we){for(;le>=ye&&(we=q.exec(I));)xe=we.index,ye=xe+we[0].length,re.lineNumber++;re.columnNumber=le-xe+1}for(var xe=0,ye=0,q=/.*(?:\r\n?|\n)|.*$/g,re=$.locator,ue=[{currentNSMap:U}],ge={},Se=0;;){try{var Be=I.indexOf("<",Se);if(Be<0){if(!I.substr(Se).match(/^\s*$/)){var Ie=$.doc,J=Ie.createTextNode(I.substr(Se));Ie.appendChild(J),$.currentElement=J}return}switch(Be>Se&&z(Be),I.charAt(Be+1)){case"/":var Ae=I.indexOf(">",Be+3),se=I.substring(Be+2,Ae).replace(/[ \t\n\r]+$/g,""),V=ue.pop();Ae<0?(se=I.substring(Be+2).replace(/[\s<].*/,""),N.error("end tag name: "+se+" is not complete:"+V.tagName),Ae=Be+1+se.length):se.match(/\sSe?Se=Ae:z(Math.max(Be,Se)+1)}}function _(I,U){return U.lineNumber=I.lineNumber,U.columnNumber=I.columnNumber,U}function T(I,U,D,$,N,O){function Q(re,ue,ge){D.attributeNames.hasOwnProperty(re)&&O.fatalError("Attribute "+re+" redefined"),D.addValue(re,ue.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,N),ge)}for(var z,W,xe=++U,ye=d;;){var q=I.charAt(xe);switch(q){case"=":if(ye===y)z=I.slice(U,xe),ye=g;else if(ye===m)ye=g;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ye===g||ye===y)if(ye===y&&(O.warning('attribute value must after "="'),z=I.slice(U,xe)),U=xe+1,xe=I.indexOf(q,U),xe>0)W=I.slice(U,xe),Q(z,W,U-1),ye=b;else throw new Error("attribute value no end '"+q+"' match");else if(ye==v)W=I.slice(U,xe),Q(z,W,U),O.warning('attribute "'+z+'" missed start quot('+q+")!!"),U=xe+1,ye=b;else throw new Error('attribute value must after "="');break;case"/":switch(ye){case d:D.setTagName(I.slice(U,xe));case b:case S:case x:ye=x,D.closed=!0;case v:case y:break;case m:D.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return O.error("unexpected end of input"),ye==d&&D.setTagName(I.slice(U,xe)),xe;case">":switch(ye){case d:D.setTagName(I.slice(U,xe));case b:case S:case x:break;case v:case y:W=I.slice(U,xe),W.slice(-1)==="/"&&(D.closed=!0,W=W.slice(0,-1));case m:ye===m&&(W=z),ye==v?(O.warning('attribute "'+W+'" missed quot(")!'),Q(z,W,U)):((!a.isHTML($[""])||!W.match(/^(?:disabled|checked|selected)$/i))&&O.warning('attribute "'+W+'" missed value!! "'+W+'" instead!!'),Q(W,W,U));break;case g:throw new Error("attribute value missed!!")}return xe;case"€":q=" ";default:if(q<=" ")switch(ye){case d:D.setTagName(I.slice(U,xe)),ye=S;break;case y:z=I.slice(U,xe),ye=m;break;case v:var W=I.slice(U,xe);O.warning('attribute "'+W+'" missed quot(")!!'),Q(z,W,U);case b:ye=S;break}else switch(ye){case m:D.tagName,(!a.isHTML($[""])||!z.match(/^(?:disabled|checked|selected)$/i))&&O.warning('attribute "'+z+'" missed value!! "'+z+'" instead2!!'),Q(z,z,U),U=xe,ye=y;break;case b:O.warning('attribute space is required"'+z+'"!!');case S:ye=y,U=xe;break;case g:ye=v,U=xe;break;case x:throw new Error("elements closed character '/' and '>' must be connected to")}}xe++}}function C(I,U,D){for(var $=I.tagName,N=null,q=I.length;q--;){var O=I[q],Q=O.qName,z=O.value,re=Q.indexOf(":");if(re>0)var W=O.prefix=Q.slice(0,re),xe=Q.slice(re+1),ye=W==="xmlns"&&xe;else xe=Q,W=null,ye=Q==="xmlns"&&"";O.localName=xe,ye!==!1&&(N==null&&(N={},M(D,D={})),D[ye]=N[ye]=z,O.uri=a.XMLNS,U.startPrefixMapping(ye,z))}for(var q=I.length;q--;){O=I[q];var W=O.prefix;W&&(W==="xml"&&(O.uri=a.XML),W!=="xmlns"&&(O.uri=D[W||""]))}var re=$.indexOf(":");re>0?(W=I.prefix=$.slice(0,re),xe=I.localName=$.slice(re+1)):(W=null,xe=I.localName=$);var ue=I.uri=D[W||""];if(U.startElement(ue,xe,$,I),I.closed){if(U.endElement(ue,xe,$),N)for(W in N)Object.prototype.hasOwnProperty.call(N,W)&&U.endPrefixMapping(W)}else return I.currentNSMap=D,I.localNSMap=N,!0}function P(I,U,D,$,N){if(/^(?:script|textarea)$/i.test(D)){var O=I.indexOf("",U),Q=I.substring(U+1,O);if(/[&<]/.test(Q))return/^script$/i.test(D)?(N.characters(Q,0,Q.length),O):(Q=Q.replace(/&#?\w+;/g,$),N.characters(Q,0,Q.length),O)}return U+1}function k(I,U,D,$){var N=$[D];return N==null&&(N=I.lastIndexOf(""),N",U+4);return O>U?(D.comment(I,U+4,O-U-4),O+3):($.error("Unclosed comment"),-1)}else return-1;default:if(I.substr(U+3,6)=="CDATA["){var O=I.indexOf("]]>",U+9);return D.startCDATA(),D.characters(I,U+9,O-U-9),D.endCDATA(),O+3}var Q=F(I,U),z=Q.length;if(z>1&&/!doctype/i.test(Q[0][0])){var W=Q[1][0],xe=!1,ye=!1;z>3&&(/^public$/i.test(Q[2][0])?(xe=Q[3][0],ye=z>4&&Q[4][0]):/^system$/i.test(Q[2][0])&&(ye=Q[3][0]));var q=Q[z-1];return D.startDTD(W,xe,ye),D.endDTD(),q.index+q[0].length}}return-1}function H(I,U,D){var $=I.indexOf("?>",U);if($){var N=I.substring(U,$).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return N?(N[0].length,D.processingInstruction(N[1],N[2]),$+2):-1}return-1}function B(){this.attributeNames={}}B.prototype={setTagName:function(I){if(!c.test(I))throw new Error("invalid tagName:"+I);this.tagName=I},addValue:function(I,U,D){if(!c.test(I))throw new Error("invalid attribute:"+I);this.attributeNames[I]=this.length,this[this.length++]={qName:I,value:U,offset:D}},length:0,getLocalName:function(I){return this[I].localName},getLocator:function(I){return this[I].locator},getQName:function(I){return this[I].qName},getURI:function(I){return this[I].uri},getValue:function(I){return this[I].value}};function F(I,U){var D,$=[],N=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(N.lastIndex=U,N.exec(I);D=N.exec(I);)if($.push(D),D[1])return $}s.XMLReader=E,s.ParseError=A},"./node_modules/process/browser.js":function(r,s){var o=r.exports={},a,l;function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=u}catch(w){a=u}try{typeof clearTimeout=="function"?l=clearTimeout:l=c}catch(w){l=c}})();function d(w){if(a===setTimeout)return setTimeout(w,0);if((a===u||!a)&&setTimeout)return a=setTimeout,setTimeout(w,0);try{return a(w,0)}catch(_){try{return a.call(null,w,0)}catch(T){return a.call(this,w,0)}}}function y(w){if(l===clearTimeout)return clearTimeout(w);if((l===c||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(w);try{return l(w)}catch(_){try{return l.call(null,w)}catch(T){return l.call(this,w)}}}var m=[],g=!1,v,b=-1;function S(){!g||!v||(g=!1,v.length?m=v.concat(m):b=-1,m.length&&x())}function x(){if(!g){var w=d(S);g=!0;for(var _=m.length;_;){for(v=m,m=[];++b<_;)v&&v[b].run();b=-1,_=m.length}v=null,g=!1,y(w)}}o.nextTick=function(w){var _=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;TQ)return ge(null,!1);if(Se>1){var Be=Math.max(ue[0].Size,ue[1].Size);if(Be!==O)return ge(null,!1)}var Ie=function J(se){if(se=ge.length){q.emit("has_and_check_upload_id",re);return}var J=ge[Ie];if(!d.isInArray(re,J)){l.removeUploadId.call(D,J),Be(Ie+1);return}if(l.using[J]){Be(Ie+1);return}b.call(D,{Bucket:B,Region:F,Key:I,UploadId:J,tracker:M.tracker},function(se,V){D._isRunningTask(H)&&(se?(l.removeUploadId.call(D,J),Be(Ie+1)):q.emit("upload_id_available",{UploadId:J,PartList:V.PartList}))})};Se(0)}),q.on("get_remote_upload_id_list",function(){v.call(D,{Bucket:B,Region:F,Key:I,tracker:M.tracker},function(re,ue){if(D._isRunningTask(H)){if(re)return q.emit("error",re);var ge=d.filter(ue.UploadList,function(Ie){return Ie.Key===I&&(!U||Ie.StorageClass.toUpperCase()===U.toUpperCase())}).reverse().map(function(Ie){return Ie.UploadId||Ie.UploadID});if(ge.length)q.emit("seek_local_avail_upload_id",ge);else{var Se=l.getFileId(M.Body,M.ChunkSize,B,I),Be;Se&&(Be=l.getUploadIdList.call(D,Se))&&d.each(Be,function(Ie){l.removeUploadId.call(D,Ie)}),q.emit("no_available_upload_id")}}})}),q.emit("get_remote_upload_id_list")}function v(M,R){var H=this,B=[],F={Bucket:M.Bucket,Region:M.Region,Prefix:M.Key,calledBySdk:M.calledBySdk||"sliceUploadFile",tracker:M.tracker},I=function U(){H.multipartList(F,function(D,$){if(D)return R(D);B.push.apply(B,$.Upload||[]),$.IsTruncated==="true"?(F.KeyMarker=$.NextKeyMarker,F.UploadIdMarker=$.NextUploadIdMarker,U()):R(null,{UploadList:B})})};I()}function b(M,R){var H=this,B=[],F={Bucket:M.Bucket,Region:M.Region,Key:M.Key,UploadId:M.UploadId,calledBySdk:"sliceUploadFile",tracker:M.tracker},I=function U(){H.multipartListPart(F,function(D,$){if(D)return R(D);B.push.apply(B,$.Part||[]),$.IsTruncated==="true"?(F.PartNumberMarker=$.NextPartNumberMarker,U()):R(null,{PartList:B})})};I()}function S(M,R){var H=this,B=M.TaskId,F=M.Bucket,I=M.Region,U=M.Key,D=M.UploadData,$=M.FileSize,N=M.SliceSize,O=Math.min(M.AsyncLimit||H.options.ChunkParallelLimit||1,256),Q=M.Body,z=Math.ceil($/N),W=0,xe=M.ServerSideEncryption,ye=M.Headers,q=d.filter(D.PartList,function(ue){return ue.Uploaded&&(W+=ue.PartNumber>=z&&$%N||N),!ue.Uploaded}),re=M.onProgress;u.eachLimit(q,O,function(ue,ge){if(H._isRunningTask(B)){var Se=ue.PartNumber,Be=Math.min($,ue.PartNumber*N)-(ue.PartNumber-1)*N,Ie=0;x.call(H,{TaskId:B,Bucket:F,Region:I,Key:U,SliceSize:N,FileSize:$,PartNumber:Se,ServerSideEncryption:xe,Body:Q,UploadData:D,Headers:ye,onProgress:function(se){W+=se.loaded-Ie,Ie=se.loaded,re({loaded:W,total:$})},tracker:M.tracker},function(J,se){H._isRunningTask(B)&&(!J&&!se.ETag&&(J='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),J?W-=Ie:(W+=Be-Ie,ue.ETag=se.ETag),re({loaded:W,total:$}),ge(J||null,se))})}},function(ue){if(H._isRunningTask(B)){if(ue)return R(ue);R(null,{UploadId:D.UploadId,SliceList:D.PartList})}})}function x(M,R){var H=this,B=M.TaskId,F=M.Bucket,I=M.Region,U=M.Key,D=M.FileSize,$=M.Body,N=M.PartNumber*1,O=M.SliceSize,Q=M.ServerSideEncryption,z=M.UploadData,W=M.Headers||{},xe=H.options.ChunkRetryTimes+1,ye=O*(N-1),q=O,re=ye+O;re>D&&(re=D,q=re-ye);var ue=["x-cos-traffic-limit","x-cos-mime-limit"],ge={};d.each(W,function(Be,Ie){ue.indexOf(Ie)>-1&&(ge[Ie]=Be)});var Se=z.PartList[N-1];u.retry(xe,function(Be){H._isRunningTask(B)&&d.fileSlice($,ye,re,!0,function(Ie){H.multipartUpload({TaskId:B,Bucket:F,Region:I,Key:U,ContentLength:q,PartNumber:N,UploadId:z.UploadId,ServerSideEncryption:Q,Body:Ie,Headers:ge,onProgress:M.onProgress,calledBySdk:"sliceUploadFile",tracker:M.tracker},function(J,se){if(H._isRunningTask(B))return J?Be(J):(Se.Uploaded=!0,Be(null,se))})})},function(Be,Ie){if(H._isRunningTask(B))return R(Be,Ie)})}function A(M,R){var H=M.Bucket,B=M.Region,F=M.Key,I=M.UploadId,U=M.SliceList,D=this,$=this.options.ChunkRetryTimes+1,N=M.Headers,O=U.map(function(Q){return{PartNumber:Q.PartNumber,ETag:Q.ETag}});u.retry($,function(Q){D.multipartComplete({Bucket:H,Region:B,Key:F,UploadId:I,Parts:O,Headers:N,calledBySdk:"sliceUploadFile",tracker:M.tracker},Q)},function(Q,z){R(Q,z)})}function E(M,R){var H=M.Bucket,B=M.Region,F=M.Key,I=M.UploadId,U=M.Level||"task",D=M.AsyncLimit,$=this,N=new c;if(N.on("error",function(O){return R(O)}),N.on("get_abort_array",function(O){w.call($,{Bucket:H,Region:B,Key:F,Headers:M.Headers,AsyncLimit:D,AbortArray:O},R)}),U==="bucket")v.call($,{Bucket:H,Region:B,calledBySdk:"abortUploadTask"},function(O,Q){if(O)return R(O);N.emit("get_abort_array",Q.UploadList||[])});else if(U==="file"){if(!F)return R(d.error(new Error("abort_upload_task_no_key")));v.call($,{Bucket:H,Region:B,Key:F,calledBySdk:"abortUploadTask"},function(O,Q){if(O)return R(O);N.emit("get_abort_array",Q.UploadList||[])})}else if(U==="task"){if(!I)return R(d.error(new Error("abort_upload_task_no_id")));if(!F)return R(d.error(new Error("abort_upload_task_no_key")));N.emit("get_abort_array",[{Key:F,UploadId:I}])}else return R(d.error(new Error("abort_unknown_level")))}function w(M,R){var H=M.Bucket,B=M.Region,F=M.Key,I=M.AbortArray,U=M.AsyncLimit||1,D=this,$=0,N=new Array(I.length);u.eachLimit(I,U,function(O,Q){var z=$;if(F&&F!==O.Key){N[z]={error:{KeyNotMatch:!0}},Q(null);return}var W=O.UploadId||O.UploadID;D.multipartAbort({Bucket:H,Region:B,Key:O.Key,Headers:M.Headers,UploadId:W},function(xe){var ye={Bucket:H,Region:B,Key:O.Key,UploadId:W};N[z]={error:xe,task:ye},Q(null)}),$++},function(O){if(O)return R(O);for(var Q=[],z=[],W=0,xe=N.length;WB?"sliceUploadFile":"putObject";M.tracker=new y({Beacon:H.options.BeaconReporter,clsReporter:H.options.ClsReporter,bucket:M.Bucket,region:M.Region,apiName:"uploadFile",realApi:N,fileKey:M.Key,fileSize:U,accelerate:$,deepTracker:H.options.DeepTracker,customId:H.options.CustomId,delay:H.options.TrackerDelay})}d.each(M,function(ye,q){a(ye)!=="object"&&typeof ye!="function"&&(D[q]=ye)});var O=M.onTaskReady,Q=function(q){D.TaskId=q,O&&O(q)};M.onTaskReady=Q;var z=U>B?"sliceUploadFile":"putObject",W=M.onFileFinish,xe=function(q,re){M.tracker&&M.tracker.report(q,re),W&&W(q,re,D),R&&R(q,re)};F.push({api:z,params:M,callback:xe}),H._addTasks(F)}function T(M,R){var H=this,B=M.SliceSize===void 0?H.options.SliceSize:M.SliceSize,F=0,I=0,U=d.throttleOnProgress.call(H,I,M.onProgress),D=M.files.length,$=M.onFileFinish,N=Array(D),O=function(W,xe,ye){U(null,!0),$&&$(W,xe,ye),N[ye.Index]={options:ye,error:W,data:xe},--D<=0&&R&&R(null,{files:N})},Q=[];d.each(M.files,function(z,W){(function(){var xe=z.Body,ye=xe.size||xe.length||0,q={Index:W,TaskId:""};if(!H.options.UseRawKey&&z.Key&&z.Key.substr(0,1)==="/"&&(z.Key=z.Key.substr(1)),F+=ye,H.options.EnableReporter){var re=H.options.UseAccelerate||typeof H.options.Domain=="string"&&H.options.Domain.includes("accelerate."),ue=ye>B?"sliceUploadFile":"putObject";z.tracker=new y({Beacon:H.options.BeaconReporter,clsReporter:H.options.ClsReporter,bucket:z.Bucket,region:z.Region,apiName:"uploadFiles",realApi:ue,fileKey:z.Key,fileSize:ye,accelerate:re,deepTracker:H.options.DeepTracker,customId:H.options.CustomId,delay:H.options.TrackerDelay})}d.each(z,function(ce,K){a(ce)!=="object"&&typeof ce!="function"&&(q[K]=ce)});var ge=z.onTaskReady,Se=function(K){q.TaskId=K,ge&&ge(K)};z.onTaskReady=Se;var Be=0,Ie=z.onProgress,J=function(K){I=I-Be+K.loaded,Be=K.loaded,Ie&&Ie(K),U({loaded:I,total:F})};z.onProgress=J;var se=ye>B?"sliceUploadFile":"putObject",V=z.onFileFinish,pe=function(K,Z){z.tracker&&z.tracker.report(K,Z),V&&V(K,Z),O&&O(K,Z,q)};Q.push({api:se,params:z,callback:pe})})()}),H._addTasks(Q)}function C(M,R){var H=new c,B=this,F=M.Bucket,I=M.Region,U=M.Key,D=M.CopySource,$=d.getSourceParams.call(this,D);if(!$){R(d.error(new Error("CopySource format error")));return}var N=$.Bucket,O=$.Region,Q=decodeURIComponent($.Key),z=M.CopySliceSize===void 0?B.options.CopySliceSize:M.CopySliceSize;z=Math.max(0,z);var W=M.CopyChunkSize||this.options.CopyChunkSize,xe=this.options.CopyChunkParallelLimit,ye=this.options.ChunkRetryTimes+1,q=0,re=0,ue,ge,Se={},Be={},Ie={};H.on("copy_slice_complete",function(J){d.each(M.Headers,function(V,pe){pe.toLowerCase().indexOf("x-cos-meta-")});var se=d.map(J.PartList,function(V){return{PartNumber:V.PartNumber,ETag:V.ETag}});u.retry(ye,function(V){B.multipartComplete({Bucket:F,Region:I,Key:U,UploadId:J.UploadId,Parts:se,tracker:M.tracker,calledBySdk:"sliceCopyFile"},V)},function(V,pe){if(l.removeUsing(J.UploadId),V)return ge(null,!0),R(V);l.removeUploadId(J.UploadId),ge({loaded:ue,total:ue},!0),R(null,pe)})}),H.on("get_copy_data_finish",function(J){var se=l.getCopyFileId(D,Se,W,F,U);se&&l.saveUploadId(se,J.UploadId,B.options.UploadIdCacheLimit),l.setUsing(J.UploadId);var V=d.filter(J.PartList,function(pe){return pe.Uploaded&&(re+=pe.PartNumber>=q&&ue%W||W),!pe.Uploaded});u.eachLimit(V,xe,function(pe,ce){var K=pe.PartNumber,Z=pe.CopySourceRange,he=pe.end-pe.start;u.retry(ye,function(Ce){P.call(B,{Bucket:F,Region:I,Key:U,CopySource:D,UploadId:J.UploadId,PartNumber:K,CopySourceRange:Z,tracker:M.tracker,calledBySdk:"sliceCopyFile"},Ce)},function(Ce,Ae){if(Ce)return ce(Ce);re+=he,ge({loaded:re,total:ue}),pe.ETag=Ae.ETag,ce(Ce||null,Ae)})},function(pe){if(pe)return l.removeUsing(J.UploadId),ge(null,!0),R(pe);H.emit("copy_slice_complete",J)})}),H.on("get_chunk_size_finish",function(){var J=function(){B.multipartInit({Bucket:F,Region:I,Key:U,Headers:Ie,tracker:M.tracker,calledBySdk:"sliceCopyFile"},function(K,Z){if(K)return R(K);M.UploadId=Z.UploadId,H.emit("get_copy_data_finish",{UploadId:M.UploadId,PartList:M.PartList})})},se=l.getCopyFileId(D,Se,W,F,U),V=l.getUploadIdList(se);if(!se||!V)return J();var pe=function ce(K){if(K>=V.length)return J();var Z=V[K];if(l.using[Z])return ce(K+1);b.call(B,{Bucket:F,Region:I,Key:U,UploadId:Z,tracker:M.tracker,calledBySdk:"sliceCopyFile"},function(he,Ce){if(he)l.removeUploadId(Z),ce(K+1);else{if(l.using[Z])return ce(K+1);var Ae={},_e=0;d.each(Ce.PartList,function(ke){var Re=parseInt(ke.Size),Ee=_e+Re-1;Ae[ke.PartNumber+"|"+_e+"|"+Ee]=ke.ETag,_e+=Re}),d.each(M.PartList,function(ke){var Re=Ae[ke.PartNumber+"|"+ke.start+"|"+ke.end];Re&&(ke.ETag=Re,ke.Uploaded=!0)}),H.emit("get_copy_data_finish",{UploadId:Z,PartList:M.PartList})}})};pe(0)}),H.on("get_file_size_finish",function(){if(function(){for(var se=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],V=1024*1024,pe=0;peK.length&&(Be[ce]=pe)}),H.emit("get_file_size_finish")}})}function P(M,R){var H=M.TaskId,B=M.Bucket,F=M.Region,I=M.Key,U=M.CopySource,D=M.UploadId,$=M.PartNumber*1,N=M.CopySourceRange,O=this.options.ChunkRetryTimes+1,Q=this;u.retry(O,function(z){Q.uploadPartCopy({TaskId:H,Bucket:B,Region:F,Key:I,CopySource:U,UploadId:D,PartNumber:$,CopySourceRange:N,tracker:M.tracker,calledBySdk:M.calledBySdk},function(W,xe){z(W||null,xe)})},function(z,W){return R(z,W)})}var k={sliceUploadFile:m,abortUploadTask:E,uploadFile:_,uploadFiles:T,sliceCopyFile:C};r.exports.init=function(M,R){R.transferToTaskMethod(k,"sliceUploadFile"),d.each(k,function(H,B){M.prototype[B]=d.apiWrapper(B,H)})}},"./src/async.js":function(r,s){var o=function(c,d,y,m){if(m=m||function(){},!c.length||d<=0)return m();var g=0,v=0,b=0;(function S(){if(g>=c.length)return m();for(;b=c.length?m():S())})})()},a=function(c,d,y){var m=function g(v){d(function(b,S){b&&v"u"?"undefined":a(location))==="object"&&location.protocol==="http:"?"http:":"https:"),ie=this.options.ServiceDomain,be=G.AppId||this.options.appId,me=G.Region;ie?(ie=ie.replace(/\{\{AppId\}\}/gi,be||"").replace(/\{\{Region\}\}/gi,me||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(ie)||(ie=Y+"//"+ie),ie.slice(-1)==="/"&&(ie=ie.slice(0,-1))):me?ie=Y+"//cos."+me+".myqcloud.com":ie=Y+"//service.cos.myqcloud.com";var ve="",Le=me?"cos."+me+".myqcloud.com":"service.cos.myqcloud.com",Oe=ie.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");Le===Oe&&(ve=Le),qe.call(this,{Action:"name/cos:GetService",url:ie,method:"GET",headers:G.Headers,SignHost:ve,tracker:G.tracker},function(Qe,Ke){if(Qe)return oe(Qe);var lt=Ke&&Ke.ListAllMyBucketsResult&&Ke.ListAllMyBucketsResult.Buckets&&Ke.ListAllMyBucketsResult.Buckets.Bucket||[];lt=u.isArray(lt)?lt:[lt];var Ue=Ke&&Ke.ListAllMyBucketsResult&&Ke.ListAllMyBucketsResult.Owner||{};oe(null,{Buckets:lt,Owner:Ue,statusCode:Ke.statusCode,headers:Ke.headers})})}function d(G,oe){var Y=this,ie="";if(G.BucketAZConfig){var be={BucketAZConfig:G.BucketAZConfig};ie=u.json2xml({CreateBucketConfiguration:be})}qe.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,body:ie,tracker:G.tracker},function(me,ve){if(me)return oe(me);var Le=Ne({protocol:Y.options.Protocol,domain:Y.options.Domain,bucket:G.Bucket,region:G.Region,isLocation:!0});oe(null,{Location:Le,statusCode:ve.statusCode,headers:ve.headers})})}function y(G,oe){qe.call(this,{Action:"name/cos:HeadBucket",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,method:"HEAD",tracker:G.tracker},oe)}function m(G,oe){var Y={};Y.prefix=G.Prefix||"",Y.delimiter=G.Delimiter,Y.marker=G.Marker,Y["max-keys"]=G.MaxKeys,Y["encoding-type"]=G.EncodingType,qe.call(this,{Action:"name/cos:GetBucket",ResourceKey:Y.prefix,method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,qs:Y,tracker:G.tracker},function(ie,be){if(ie)return oe(ie);var me=be.ListBucketResult||{},ve=me.Contents||[],Le=me.CommonPrefixes||[];ve=u.isArray(ve)?ve:[ve],Le=u.isArray(Le)?Le:[Le];var Oe=u.clone(me);u.extend(Oe,{Contents:ve,CommonPrefixes:Le,statusCode:be.statusCode,headers:be.headers}),oe(null,Oe)})}function g(G,oe){qe.call(this,{Action:"name/cos:DeleteBucket",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,method:"DELETE",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function v(G,oe){var Y=G.Headers,ie="";if(G.AccessControlPolicy){var be=u.clone(G.AccessControlPolicy||{}),me=be.Grants||be.Grant;me=u.isArray(me)?me:[me],delete be.Grant,delete be.Grants,be.AccessControlList={Grant:me},ie=u.json2xml({AccessControlPolicy:be}),Y["Content-Type"]="application/xml",Y["Content-MD5"]=u.b64(u.md5(ie))}u.each(Y,function(ve,Le){Le.indexOf("x-cos-grant-")===0&&(Y[Le]=Te(Y[Le]))}),qe.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:G.Bucket,Region:G.Region,headers:Y,action:"acl",body:ie,tracker:G.tracker},function(ve,Le){if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function b(G,oe){qe.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"acl",tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);var be=ie.AccessControlPolicy||{},me=be.Owner||{},ve=be.AccessControlList.Grant||[];ve=u.isArray(ve)?ve:[ve];var Le=ae(be);ie.headers&&ie.headers["x-cos-acl"]&&(Le.ACL=ie.headers["x-cos-acl"]),Le=u.extend(Le,{Owner:me,Grants:ve,statusCode:ie.statusCode,headers:ie.headers}),oe(null,Le)})}function S(G,oe){var Y=G.CORSConfiguration||{},ie=Y.CORSRules||G.CORSRules||[];ie=u.clone(u.isArray(ie)?ie:[ie]),u.each(ie,function(Le){u.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Oe){var Qe=Oe+"s",Ke=Le[Qe]||Le[Oe]||[];delete Le[Qe],Le[Oe]=u.isArray(Ke)?Ke:[Ke]})});var be={CORSRule:ie};G.ResponseVary&&(be.ResponseVary=G.ResponseVary);var me=u.json2xml({CORSConfiguration:be}),ve=G.Headers;ve["Content-Type"]="application/xml",ve["Content-MD5"]=u.b64(u.md5(me)),qe.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:me,action:"cors",headers:ve,tracker:G.tracker},function(Le,Oe){if(Le)return oe(Le);oe(null,{statusCode:Oe.statusCode,headers:Oe.headers})})}function x(G,oe){qe.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"cors",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error&&Y.error.Code==="NoSuchCORSConfiguration"){var be={CORSRules:[],statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=ie.CORSConfiguration||{},ve=me.CORSRules||me.CORSRule||[];ve=u.clone(u.isArray(ve)?ve:[ve]);var Le=me.ResponseVary;u.each(ve,function(Oe){u.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Qe){var Ke=Qe+"s",lt=Oe[Ke]||Oe[Qe]||[];delete Oe[Qe],Oe[Ke]=u.isArray(lt)?lt:[lt]})}),oe(null,{CORSRules:ve,ResponseVary:Le,statusCode:ie.statusCode,headers:ie.headers})})}function A(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"cors",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode||Y.statusCode,headers:ie.headers})})}function E(G,oe){qe.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"location",tracker:G.tracker},oe)}function w(G,oe){var Y=G.Policy;try{typeof Y=="string"&&(Y=JSON.parse(Y))}catch(me){}if(!Y||typeof Y=="string")return oe(u.error(new Error("Policy format error")));var ie=JSON.stringify(Y);Y.version||(Y.version="2.0");var be=G.Headers;be["Content-Type"]="application/json",be["Content-MD5"]=u.b64(u.md5(ie)),qe.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:G.Bucket,Region:G.Region,action:"policy",body:ie,headers:be,tracker:G.tracker},function(me,ve){if(me&&me.statusCode===204)return oe(null,{statusCode:me.statusCode});if(me)return oe(me);oe(null,{statusCode:ve.statusCode,headers:ve.headers})})}function _(G,oe){qe.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"policy",rawBody:!0,tracker:G.tracker},function(Y,ie){if(Y)return Y.statusCode&&Y.statusCode===403?oe(u.error(Y,{ErrorStatus:"Access Denied"})):Y.statusCode&&Y.statusCode===405?oe(u.error(Y,{ErrorStatus:"Method Not Allowed"})):Y.statusCode&&Y.statusCode===404?oe(u.error(Y,{ErrorStatus:"Policy Not Found"})):oe(Y);var be={};try{be=JSON.parse(ie.body)}catch(me){}oe(null,{Policy:be,statusCode:ie.statusCode,headers:ie.headers})})}function T(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"policy",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode||Y.statusCode,headers:ie.headers})})}function C(G,oe){var Y=G.Tagging||{},ie=Y.TagSet||Y.Tags||G.Tags||[];ie=u.clone(u.isArray(ie)?ie:[ie]);var be=u.json2xml({Tagging:{TagSet:{Tag:ie}}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"tagging",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function P(G,oe){qe.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"tagging",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error&&(Y.error==="Not Found"||Y.error.Code==="NoSuchTagSet")){var be={Tags:[],statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=[];try{me=ie.Tagging.TagSet.Tag||[]}catch(ve){}me=u.clone(u.isArray(me)?me:[me]),oe(null,{Tags:me,statusCode:ie.statusCode,headers:ie.headers})})}function k(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"tagging",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function M(G,oe){var Y=G.LifecycleConfiguration||{},ie=Y.Rules||G.Rules||[];ie=u.clone(ie);var be=u.json2xml({LifecycleConfiguration:{Rule:ie}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"lifecycle",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function R(G,oe){qe.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"lifecycle",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error&&Y.error.Code==="NoSuchLifecycleConfiguration"){var be={Rules:[],statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=[];try{me=ie.LifecycleConfiguration.Rule||[]}catch(ve){}me=u.clone(u.isArray(me)?me:[me]),oe(null,{Rules:me,statusCode:ie.statusCode,headers:ie.headers})})}function H(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"lifecycle",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function B(G,oe){if(!G.VersioningConfiguration){oe(u.error(new Error("missing param VersioningConfiguration")));return}var Y=G.VersioningConfiguration||{},ie=u.json2xml({VersioningConfiguration:Y}),be=G.Headers;be["Content-Type"]="application/xml",be["Content-MD5"]=u.b64(u.md5(ie)),qe.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:ie,action:"versioning",headers:be,tracker:G.tracker},function(me,ve){if(me&&me.statusCode===204)return oe(null,{statusCode:me.statusCode});if(me)return oe(me);oe(null,{statusCode:ve.statusCode,headers:ve.headers})})}function F(G,oe){qe.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"versioning",tracker:G.tracker},function(Y,ie){Y||!ie.VersioningConfiguration&&(ie.VersioningConfiguration={}),oe(Y,ie)})}function I(G,oe){var Y=u.clone(G.ReplicationConfiguration),ie=u.json2xml({ReplicationConfiguration:Y});ie=ie.replace(/<(\/?)Rules>/gi,"<$1Rule>"),ie=ie.replace(/<(\/?)Tags>/gi,"<$1Tag>");var be=G.Headers;be["Content-Type"]="application/xml",be["Content-MD5"]=u.b64(u.md5(ie)),qe.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:ie,action:"replication",headers:be,tracker:G.tracker},function(me,ve){if(me&&me.statusCode===204)return oe(null,{statusCode:me.statusCode});if(me)return oe(me);oe(null,{statusCode:ve.statusCode,headers:ve.headers})})}function U(G,oe){qe.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"replication",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error&&(Y.error==="Not Found"||Y.error.Code==="ReplicationConfigurationnotFoundError")){var be={ReplicationConfiguration:{Rules:[]},statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}!ie.ReplicationConfiguration&&(ie.ReplicationConfiguration={}),ie.ReplicationConfiguration.Rule&&(ie.ReplicationConfiguration.Rules=u.makeArray(ie.ReplicationConfiguration.Rule),delete ie.ReplicationConfiguration.Rule),oe(Y,ie)})}function D(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"replication",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function $(G,oe){if(!G.WebsiteConfiguration){oe(u.error(new Error("missing param WebsiteConfiguration")));return}var Y=u.clone(G.WebsiteConfiguration||{}),ie=Y.RoutingRules||Y.RoutingRule||[];ie=u.isArray(ie)?ie:[ie],delete Y.RoutingRule,delete Y.RoutingRules,ie.length&&(Y.RoutingRules={RoutingRule:ie});var be=u.json2xml({WebsiteConfiguration:Y}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"website",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function N(G,oe){qe.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,action:"website",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error.Code==="NoSuchWebsiteConfiguration"){var be={WebsiteConfiguration:{},statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=ie.WebsiteConfiguration||{};if(me.RoutingRules){var ve=u.clone(me.RoutingRules.RoutingRule||[]);ve=u.makeArray(ve),me.RoutingRules=ve}oe(null,{WebsiteConfiguration:me,statusCode:ie.statusCode,headers:ie.headers})})}function O(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"website",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function Q(G,oe){if(!G.RefererConfiguration){oe(u.error(new Error("missing param RefererConfiguration")));return}var Y=u.clone(G.RefererConfiguration||{}),ie=Y.DomainList||{},be=ie.Domains||ie.Domain||[];be=u.isArray(be)?be:[be],be.length&&(Y.DomainList={Domain:be});var me=u.json2xml({RefererConfiguration:Y}),ve=G.Headers;ve["Content-Type"]="application/xml",ve["Content-MD5"]=u.b64(u.md5(me)),qe.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:me,action:"referer",headers:ve,tracker:G.tracker},function(Le,Oe){if(Le&&Le.statusCode===204)return oe(null,{statusCode:Le.statusCode});if(Le)return oe(Le);oe(null,{statusCode:Oe.statusCode,headers:Oe.headers})})}function z(G,oe){qe.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,action:"referer",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error.Code==="NoSuchRefererConfiguration"){var be={WebsiteConfiguration:{},statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=ie.RefererConfiguration||{};if(me.DomainList){var ve=u.makeArray(me.DomainList.Domain||[]);me.DomainList={Domains:ve}}oe(null,{RefererConfiguration:me,statusCode:ie.statusCode,headers:ie.headers})})}function W(G,oe){var Y=G.DomainConfiguration||{},ie=Y.DomainRule||G.DomainRule||[];ie=u.clone(ie);var be=u.json2xml({DomainConfiguration:{DomainRule:ie}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"domain",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function xe(G,oe){qe.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"domain",tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);var be=[];try{be=ie.DomainConfiguration.DomainRule||[]}catch(me){}be=u.clone(u.isArray(be)?be:[be]),oe(null,{DomainRule:be,statusCode:ie.statusCode,headers:ie.headers})})}function ye(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"domain",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function q(G,oe){var Y=G.OriginConfiguration||{},ie=Y.OriginRule||G.OriginRule||[];ie=u.clone(ie);var be=u.json2xml({OriginConfiguration:{OriginRule:ie}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"origin",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function re(G,oe){qe.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"origin",tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);var be=[];try{be=ie.OriginConfiguration.OriginRule||[]}catch(me){}be=u.clone(u.isArray(be)?be:[be]),oe(null,{OriginRule:be,statusCode:ie.statusCode,headers:ie.headers})})}function ue(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"origin",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function ge(G,oe){var Y=u.json2xml({BucketLoggingStatus:G.BucketLoggingStatus||""}),ie=G.Headers;ie["Content-Type"]="application/xml",ie["Content-MD5"]=u.b64(u.md5(Y)),qe.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:Y,action:"logging",headers:ie,tracker:G.tracker},function(be,me){if(be&&be.statusCode===204)return oe(null,{statusCode:be.statusCode});if(be)return oe(be);oe(null,{statusCode:me.statusCode,headers:me.headers})})}function Se(G,oe){qe.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"logging",tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);oe(null,{BucketLoggingStatus:ie.BucketLoggingStatus,statusCode:ie.statusCode,headers:ie.headers})})}function Be(G,oe,Y){var ie=u.clone(oe.InventoryConfiguration);if(ie.OptionalFields){var be=ie.OptionalFields||[];ie.OptionalFields={Field:be}}if(ie.Destination&&ie.Destination.COSBucketDestination&&ie.Destination.COSBucketDestination.Encryption){var me=ie.Destination.COSBucketDestination.Encryption;Object.keys(me).indexOf("SSECOS")>-1&&(me["SSE-COS"]=me.SSECOS,delete me.SSECOS)}var ve=u.json2xml({InventoryConfiguration:ie}),Le=oe.Headers;Le["Content-Type"]="application/xml",Le["Content-MD5"]=u.b64(u.md5(ve));var Oe=G==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";qe.call(this,{Action:Oe,method:G,Bucket:oe.Bucket,Region:oe.Region,body:ve,action:"inventory",qs:{id:oe.Id},headers:Le,tracker:oe.tracker},function(Qe,Ke){if(Qe&&Qe.statusCode===204)return Y(null,{statusCode:Qe.statusCode});if(Qe)return Y(Qe);Y(null,{statusCode:Ke.statusCode,headers:Ke.headers})})}function Ie(G,oe){return Be.call(this,"PUT",G,oe)}function J(G,oe){return Be.call(this,"POST",G,oe)}function se(G,oe){qe.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"inventory",qs:{id:G.Id},tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);var be=ie.InventoryConfiguration;if(be&&be.OptionalFields&&be.OptionalFields.Field){var me=be.OptionalFields.Field;u.isArray(me)||(me=[me]),be.OptionalFields=me}if(be.Destination&&be.Destination.COSBucketDestination&&be.Destination.COSBucketDestination.Encryption){var ve=be.Destination.COSBucketDestination.Encryption;Object.keys(ve).indexOf("SSE-COS")>-1&&(ve.SSECOS=ve["SSE-COS"],delete ve["SSE-COS"])}oe(null,{InventoryConfiguration:be,statusCode:ie.statusCode,headers:ie.headers})})}function V(G,oe){qe.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"inventory",qs:{"continuation-token":G.ContinuationToken},tracker:G.tracker},function(Y,ie){if(Y)return oe(Y);var be=ie.ListInventoryConfigurationResult,me=be.InventoryConfiguration||[];me=u.isArray(me)?me:[me],delete be.InventoryConfiguration,u.each(me,function(ve){if(ve&&ve.OptionalFields&&ve.OptionalFields.Field){var Le=ve.OptionalFields.Field;u.isArray(Le)||(Le=[Le]),ve.OptionalFields=Le}if(ve.Destination&&ve.Destination.COSBucketDestination&&ve.Destination.COSBucketDestination.Encryption){var Oe=ve.Destination.COSBucketDestination.Encryption;Object.keys(Oe).indexOf("SSE-COS")>-1&&(Oe.SSECOS=Oe["SSE-COS"],delete Oe["SSE-COS"])}}),be.InventoryConfigurations=me,u.extend(be,{statusCode:ie.statusCode,headers:ie.headers}),oe(null,be)})}function pe(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"inventory",qs:{id:G.Id},tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function ce(G,oe){if(!G.AccelerateConfiguration){oe(u.error(new Error("missing param AccelerateConfiguration")));return}var Y={AccelerateConfiguration:G.AccelerateConfiguration||{}},ie=u.json2xml(Y),be={};be["Content-Type"]="application/xml",be["Content-MD5"]=u.b64(u.md5(ie)),qe.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:ie,action:"accelerate",headers:be,tracker:G.tracker},function(me,ve){if(me)return oe(me);oe(null,{statusCode:ve.statusCode,headers:ve.headers})})}function K(G,oe){qe.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:G.Bucket,Region:G.Region,action:"accelerate",tracker:G.tracker},function(Y,ie){Y||!ie.AccelerateConfiguration&&(ie.AccelerateConfiguration={}),oe(Y,ie)})}function Z(G,oe){var Y=G.ServerSideEncryptionConfiguration||{},ie=Y.Rule||Y.Rules||[],be=u.json2xml({ServerSideEncryptionConfiguration:{Rule:ie}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:G.Bucket,Region:G.Region,body:be,action:"encryption",headers:me,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function he(G,oe){qe.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"encryption",tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.code==="NoSuchEncryptionConfiguration"){var be={EncryptionConfiguration:{Rules:[]},statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=u.makeArray(ie.EncryptionConfiguration&&ie.EncryptionConfiguration.Rule||[]);ie.EncryptionConfiguration={Rules:me},oe(Y,ie)})}function Ce(G,oe){qe.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"encryption",tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function Ae(G,oe){qe.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:G.Bucket,Region:G.Region,Key:G.Key,VersionId:G.VersionId,headers:G.Headers,tracker:G.tracker},function(Y,ie){if(Y){var be=Y.statusCode;return G.Headers["If-Modified-Since"]&&be&&be===304?oe(null,{NotModified:!0,statusCode:be}):oe(Y)}ie.ETag=u.attr(ie.headers,"etag",""),oe(null,ie)})}function _e(G,oe){var Y={};Y.prefix=G.Prefix||"",Y.delimiter=G.Delimiter,Y["key-marker"]=G.KeyMarker,Y["version-id-marker"]=G.VersionIdMarker,Y["max-keys"]=G.MaxKeys,Y["encoding-type"]=G.EncodingType,qe.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:Y.prefix,method:"GET",Bucket:G.Bucket,Region:G.Region,headers:G.Headers,qs:Y,action:"versions",tracker:G.tracker},function(ie,be){if(ie)return oe(ie);var me=be.ListVersionsResult||{},ve=me.DeleteMarker||[];ve=u.isArray(ve)?ve:[ve];var Le=me.Version||[];Le=u.isArray(Le)?Le:[Le];var Oe=u.clone(me);delete Oe.DeleteMarker,delete Oe.Version,u.extend(Oe,{DeleteMarkers:ve,Versions:Le,statusCode:be.statusCode,headers:be.headers}),oe(null,Oe)})}function ke(G,oe){if(this.options.ObjectKeySimplifyCheck){var Y=u.simplifyPath(G.Key);if(Y==="/"){oe(u.error(new Error("The Getobject Key is illegal")));return}}var ie=G.Query||{},be=G.QueryString||"",me=u.throttleOnProgress.call(this,0,G.onProgress),ve=G.tracker;ve&&ve.setParams({signStartTime:new Date().getTime()}),ie["response-content-type"]=G.ResponseContentType,ie["response-content-language"]=G.ResponseContentLanguage,ie["response-expires"]=G.ResponseExpires,ie["response-cache-control"]=G.ResponseCacheControl,ie["response-content-disposition"]=G.ResponseContentDisposition,ie["response-content-encoding"]=G.ResponseContentEncoding,qe.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:G.Bucket,Region:G.Region,Key:G.Key,VersionId:G.VersionId,DataType:G.DataType,headers:G.Headers,qs:ie,qsStr:be,rawBody:!0,onDownloadProgress:me,tracker:ve},function(Le,Oe){if(me(null,!0),Le){var Qe=Le.statusCode;return G.Headers["If-Modified-Since"]&&Qe&&Qe===304?oe(null,{NotModified:!0}):oe(Le)}oe(null,{Body:Oe.body,ETag:u.attr(Oe.headers,"etag",""),statusCode:Oe.statusCode,headers:Oe.headers})})}function Re(G,oe){var Y=this,ie=G.ContentLength,be=u.throttleOnProgress.call(Y,ie,G.onProgress),me=G.Headers;!me["Cache-Control"]&&!me["cache-control"]&&(me["Cache-Control"]=""),!me["Content-Type"]&&!me["content-type"]&&(me["Content-Type"]=G.Body&&G.Body.type||"");var ve=G.UploadAddMetaMd5||Y.options.UploadAddMetaMd5||Y.options.UploadCheckContentMd5,Le=G.tracker;ve&&Le&&Le.setParams({md5StartTime:new Date().getTime()}),u.getBodyMd5(ve,G.Body,function(Oe){Oe&&(Le&&Le.setParams({md5EndTime:new Date().getTime()}),Y.options.UploadCheckContentMd5&&(me["Content-MD5"]=u.b64(Oe)),(G.UploadAddMetaMd5||Y.options.UploadAddMetaMd5)&&(me["x-cos-meta-md5"]=Oe)),G.ContentLength!==void 0&&(me["Content-Length"]=G.ContentLength),be(null,!0),qe.call(Y,{Action:"name/cos:PutObject",TaskId:G.TaskId,method:"PUT",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,qs:G.Query,body:G.Body,onProgress:be,tracker:Le},function(Qe,Ke){if(Qe)return be(null,!0),oe(Qe);be({loaded:ie,total:ie},!0);var lt=Ne({ForcePathStyle:Y.options.ForcePathStyle,protocol:Y.options.Protocol,domain:Y.options.Domain,bucket:G.Bucket,region:Y.options.UseAccelerate?"accelerate":G.Region,object:G.Key});lt=lt.substr(lt.indexOf("://")+3),Ke.Location=lt,Ke.ETag=u.attr(Ke.headers,"etag",""),oe(null,Ke)})},G.onHashProgress)}function Ee(G,oe){qe.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,VersionId:G.VersionId,action:G.Recursive?"recursive":"",tracker:G.tracker},function(Y,ie){if(Y){var be=Y.statusCode;return be&&be===404?oe(null,{BucketNotFound:!0,statusCode:be}):oe(Y)}oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function le(G,oe){var Y={};G.VersionId&&(Y.versionId=G.VersionId),qe.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,qs:Y,action:"acl",tracker:G.tracker},function(ie,be){if(ie)return oe(ie);var me=be.AccessControlPolicy||{},ve=me.Owner||{},Le=me.AccessControlList&&me.AccessControlList.Grant||[];Le=u.isArray(Le)?Le:[Le];var Oe=ae(me);delete Oe.GrantWrite,be.headers&&be.headers["x-cos-acl"]&&(Oe.ACL=be.headers["x-cos-acl"]),Oe=u.extend(Oe,{Owner:ve,Grants:Le,statusCode:be.statusCode,headers:be.headers}),oe(null,Oe)})}function we(G,oe){var Y=G.Headers,ie="";if(G.AccessControlPolicy){var be=u.clone(G.AccessControlPolicy||{}),me=be.Grants||be.Grant;me=u.isArray(me)?me:[me],delete be.Grant,delete be.Grants,be.AccessControlList={Grant:me},ie=u.json2xml({AccessControlPolicy:be}),Y["Content-Type"]="application/xml",Y["Content-MD5"]=u.b64(u.md5(ie))}u.each(Y,function(ve,Le){Le.indexOf("x-cos-grant-")===0&&(Y[Le]=Te(Y[Le]))}),qe.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:G.Bucket,Region:G.Region,Key:G.Key,action:"acl",headers:Y,body:ie,tracker:G.tracker},function(ve,Le){if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function de(G,oe){var Y=G.Headers;Y.Origin=G.Origin,Y["Access-Control-Request-Method"]=G.AccessControlRequestMethod,Y["Access-Control-Request-Headers"]=G.AccessControlRequestHeaders,qe.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:Y,tracker:G.tracker},function(ie,be){if(ie)return ie.statusCode&&ie.statusCode===403?oe(null,{OptionsForbidden:!0,statusCode:ie.statusCode}):oe(ie);var me=be.headers||{};oe(null,{AccessControlAllowOrigin:me["access-control-allow-origin"],AccessControlAllowMethods:me["access-control-allow-methods"],AccessControlAllowHeaders:me["access-control-allow-headers"],AccessControlExposeHeaders:me["access-control-expose-headers"],AccessControlMaxAge:me["access-control-max-age"],statusCode:be.statusCode,headers:be.headers})})}function De(G,oe){var Y=this,ie=G.Headers;!ie["Cache-Control"]&&!ie["cache-control"]&&(ie["Cache-Control"]="");var be=G.CopySource||"",me=u.getSourceParams.call(this,be);if(!me){oe(u.error(new Error("CopySource format error")));return}var ve=me.Bucket,Le=me.Region,Oe=decodeURIComponent(me.Key);qe.call(this,{Scope:[{action:"name/cos:GetObject",bucket:ve,region:Le,prefix:Oe},{action:"name/cos:PutObject",bucket:G.Bucket,region:G.Region,prefix:G.Key}],method:"PUT",Bucket:G.Bucket,Region:G.Region,Key:G.Key,VersionId:G.VersionId,headers:G.Headers,tracker:G.tracker},function(Qe,Ke){if(Qe)return oe(Qe);var lt=u.clone(Ke.CopyObjectResult||{}),Ue=Ne({ForcePathStyle:Y.options.ForcePathStyle,protocol:Y.options.Protocol,domain:Y.options.Domain,bucket:G.Bucket,region:G.Region,object:G.Key,isLocation:!0});u.extend(lt,{Location:Ue,statusCode:Ke.statusCode,headers:Ke.headers}),oe(null,lt)})}function Ve(G,oe){var Y=G.CopySource||"",ie=u.getSourceParams.call(this,Y);if(!ie){oe(u.error(new Error("CopySource format error")));return}var be=ie.Bucket,me=ie.Region,ve=decodeURIComponent(ie.Key);qe.call(this,{Scope:[{action:"name/cos:GetObject",bucket:be,region:me,prefix:ve},{action:"name/cos:PutObject",bucket:G.Bucket,region:G.Region,prefix:G.Key}],method:"PUT",Bucket:G.Bucket,Region:G.Region,Key:G.Key,VersionId:G.VersionId,qs:{partNumber:G.PartNumber,uploadId:G.UploadId},headers:G.Headers,tracker:G.tracker},function(Le,Oe){if(Le)return oe(Le);var Qe=u.clone(Oe.CopyPartResult||{});u.extend(Qe,{statusCode:Oe.statusCode,headers:Oe.headers}),oe(null,Qe)})}function $e(G,oe){var Y=G.Objects||[],ie=G.Quiet;Y=u.isArray(Y)?Y:[Y];var be=u.json2xml({Delete:{Object:Y,Quiet:ie||!1}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be));var ve=u.map(Y,function(Le){return{action:"name/cos:DeleteObject",bucket:G.Bucket,region:G.Region,prefix:Le.Key}});qe.call(this,{Scope:ve,method:"POST",Bucket:G.Bucket,Region:G.Region,body:be,action:"delete",headers:me,tracker:G.tracker},function(Le,Oe){if(Le)return oe(Le);var Qe=Oe.DeleteResult||{},Ke=Qe.Deleted||[],lt=Qe.Error||[];Ke=u.isArray(Ke)?Ke:[Ke],lt=u.isArray(lt)?lt:[lt];var Ue=u.clone(Qe);u.extend(Ue,{Error:lt,Deleted:Ke,statusCode:Oe.statusCode,headers:Oe.headers}),oe(null,Ue)})}function Je(G,oe){var Y=G.Headers;if(!G.RestoreRequest){oe(u.error(new Error("missing param RestoreRequest")));return}var ie=G.RestoreRequest||{},be=u.json2xml({RestoreRequest:ie});Y["Content-Type"]="application/xml",Y["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:G.Bucket,Region:G.Region,Key:G.Key,VersionId:G.VersionId,body:be,action:"restore",headers:Y,tracker:G.tracker},oe)}function Ye(G,oe){var Y=G.Tagging||{},ie=Y.TagSet||Y.Tags||G.Tags||[];ie=u.clone(u.isArray(ie)?ie:[ie]);var be=u.json2xml({Tagging:{TagSet:{Tag:ie}}}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:G.Bucket,Key:G.Key,Region:G.Region,body:be,action:"tagging",headers:me,VersionId:G.VersionId,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);oe(null,{statusCode:Le.statusCode,headers:Le.headers})})}function tt(G,oe){qe.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:G.Key,Bucket:G.Bucket,Region:G.Region,headers:G.Headers,action:"tagging",VersionId:G.VersionId,tracker:G.tracker},function(Y,ie){if(Y){if(Y.statusCode===404&&Y.error&&(Y.error==="Not Found"||Y.error.Code==="NoSuchTagSet")){var be={Tags:[],statusCode:Y.statusCode};Y.headers&&(be.headers=Y.headers),oe(null,be)}else oe(Y);return}var me=[];try{me=ie.Tagging.TagSet.Tag||[]}catch(ve){}me=u.clone(u.isArray(me)?me:[me]),oe(null,{Tags:me,statusCode:ie.statusCode,headers:ie.headers})})}function Ze(G,oe){qe.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,action:"tagging",VersionId:G.VersionId,tracker:G.tracker},function(Y,ie){if(Y&&Y.statusCode===204)return oe(null,{statusCode:Y.statusCode});if(Y)return oe(Y);oe(null,{statusCode:ie.statusCode,headers:ie.headers})})}function ot(G,oe){var Y=G.SelectType;if(!Y)return oe(u.error(new Error("missing param SelectType")));var ie=G.SelectRequest||{},be=u.json2xml({SelectRequest:ie}),me=G.Headers;me["Content-Type"]="application/xml",me["Content-MD5"]=u.b64(u.md5(be)),qe.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:G.Bucket,Region:G.Region,Key:G.Key,headers:G.Headers,action:"select",qs:{"select-type":G.SelectType},VersionId:G.VersionId,body:be,DataType:"arraybuffer",rawBody:!0,tracker:G.tracker},function(ve,Le){if(ve&&ve.statusCode===204)return oe(null,{statusCode:ve.statusCode});if(ve)return oe(ve);var Oe=u.parseSelectPayload(Le.body);oe(null,{statusCode:Le.statusCode,headers:Le.headers,Body:Oe.body,Payload:Oe.payload})})}function pt(G,oe){var Y=this,ie=G.Headers,be=G.tracker;!ie["Cache-Control"]&&!ie["cache-control"]&&(ie["Cache-Control"]=""),!ie["Content-Type"]&&!ie["content-type"]&&(ie["Content-Type"]=G.Body&&G.Body.type||"");var me=G.Body&&(G.UploadAddMetaMd5||Y.options.UploadAddMetaMd5);me&&be&&be.setParams({md5StartTime:new Date().getTime()}),u.getBodyMd5(me,G.Body,function(ve){ve&&(G.Headers["x-cos-meta-md5"]=ve),me&&be&&be.setParams({md5EndTime:new Date().getTime()}),qe.call(Y,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:G.Bucket,Region:G.Region,Key:G.Key,action:"uploads",headers:G.Headers,qs:G.Query,tracker:be},function(Le,Oe){if(Le)return be&&be.parent&&be.parent.setParams({errorNode:"multipartInit"}),oe(Le);if(Oe=u.clone(Oe||{}),Oe&&Oe.InitiateMultipartUploadResult)return oe(null,u.extend(Oe.InitiateMultipartUploadResult,{statusCode:Oe.statusCode,headers:Oe.headers}));oe(null,Oe)})},G.onHashProgress)}function nt(G,oe){var Y=this;u.getFileSize("multipartUpload",G,function(){var ie=G.tracker,be=Y.options.UploadCheckContentMd5;be&&ie&&ie.setParams({md5StartTime:new Date().getTime()}),u.getBodyMd5(be,G.Body,function(me){me&&(G.Headers["Content-MD5"]=u.b64(me)),be&&ie&&ie.setParams({md5EndTime:new Date().getTime()}),ie&&ie.setParams({partNumber:G.PartNumber}),qe.call(Y,{Action:"name/cos:UploadPart",TaskId:G.TaskId,method:"PUT",Bucket:G.Bucket,Region:G.Region,Key:G.Key,qs:{partNumber:G.PartNumber,uploadId:G.UploadId},headers:G.Headers,onProgress:G.onProgress,body:G.Body||null,tracker:ie},function(ve,Le){if(ve)return ie&&ie.parent&&ie.parent.setParams({errorNode:"multipartUpload"}),oe(ve);oe(null,{ETag:u.attr(Le.headers,"etag",""),statusCode:Le.statusCode,headers:Le.headers})})})})}function ct(G,oe){for(var Y=this,ie=G.UploadId,be=G.Parts,me=G.tracker,ve=0,Le=be.length;ve-1?lt(Ke.Authorization):"sign="+encodeURIComponent(Ke.Authorization)),Ke.SecurityToken&&(Ue+="&x-cos-security-token="+Ke.SecurityToken),Ke.ClientIP&&(Ue+="&clientIP="+Ke.ClientIP),Ke.ClientUA&&(Ue+="&clientUA="+Ke.ClientUA),Ke.Token&&(Ue+="&token="+Ke.Token),me&&(Ue+="&"+me),setTimeout(function(){oe(null,{Url:Ue})})}});return Oe?(ve+="?"+Oe.Authorization+(Oe.SecurityToken?"&x-cos-security-token="+Oe.SecurityToken:""),me&&(ve+="&"+me)):me&&(ve+="?"+me),ve}function ae(G){var oe={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},Y={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},ie=G&&G.AccessControlList||{},be=ie.Grant;be&&(be=u.isArray(be)?be:[be]);var me={READ:0,WRITE:0,FULL_CONTROL:0};return be&&be.length&&u.each(be,function(ve){ve.Grantee.ID==="qcs::cam::anyone:anyone"||ve.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?me[ve.Permission]=1:ve.Grantee.ID!==G.Owner.ID&&oe[Y[ve.Permission]].push('id="'+ve.Grantee.ID+'"')}),me.FULL_CONTROL||me.WRITE&&me.READ?oe.ACL="public-read-write":me.READ?oe.ACL="public-read":oe.ACL="private",u.each(Y,function(ve){oe[ve]=Te(oe[ve].join(","))}),oe}function Te(G){var oe=G.split(","),Y={},ie,be;for(ie=0;ie"u"?"undefined":a(location))==="object"&&location.protocol==="http:"?"http:":"https:");me||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(oe)>-1?me="{Region}.myqcloud.com":me="cos.{Region}.myqcloud.com",G.ForcePathStyle||(me="{Bucket}."+me)),me=me.replace(/\{\{AppId\}\}/gi,be).replace(/\{\{Bucket\}\}/gi,ie).replace(/\{\{Region\}\}/gi,oe).replace(/\{\{.*?\}\}/gi,""),me=me.replace(/\{AppId\}/gi,be).replace(/\{BucketName\}/gi,ie).replace(/\{Bucket\}/gi,Y).replace(/\{Region\}/gi,oe).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(me)||(me=Le+"//"+me),me.slice(-1)==="/"&&(me=me.slice(0,-1));var Oe=me;return G.ForcePathStyle&&(Oe+="/"+Y),Oe+="/",ve&&(Oe+=u.camSafeUrlEncode(ve).replace(/%2F/g,"/")),G.isLocation&&(Oe=Oe.replace(/^https?:\/\//,"")),Oe}var We=function(oe){if(!oe.Bucket||!oe.Region)return"";var Y=oe.UseAccelerate===void 0?this.options.UseAccelerate:oe.UseAccelerate,ie=oe.Url||Ne({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:oe.Bucket,region:Y?"accelerate":oe.Region}),be=ie.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return be};function rt(G,oe){var Y=u.clone(G.Headers),ie="";u.each(Y,function(ht,et){(ht===""||["content-type","cache-control","expires"].indexOf(et.toLowerCase())>-1)&&delete Y[et],et.toLowerCase()==="host"&&(ie=ht)});var be=G.ForceSignHost!==!1;!ie&&G.SignHost&&be&&(Y.Host=G.SignHost);var me=!1,ve=function(et,it){me||(me=!0,it&&it.XCosSecurityToken&&!it.SecurityToken&&(it=u.clone(it),it.SecurityToken=it.XCosSecurityToken,delete it.XCosSecurityToken),oe&&oe(et,it))},Le=this,Oe=G.Bucket||"",Qe=G.Region||"",Ke=G.Key||"";Le.options.ForcePathStyle&&Oe&&(Ke=Oe+"/"+Ke);var lt="/"+Ke,Ue={},mt=G.Scope;if(!mt){var Ct=G.Action||"",Dt=G.ResourceKey||G.Key||"";mt=G.Scope||[{action:Ct,bucket:Oe,region:Qe,prefix:Dt}]}var _t=u.md5(JSON.stringify(mt));Le._StsCache=Le._StsCache||[],function(){var ht,et;for(ht=Le._StsCache.length-1;ht>=0;ht--){et=Le._StsCache[ht];var it=Math.round(u.getSkewTime(Le.options.SystemClockOffset)/1e3)+30;if(et.StartTime&&it=et.ExpiredTime){Le._StsCache.splice(ht,1);continue}if(!et.ScopeLimit||et.ScopeLimit&&et.ScopeKey===_t){Ue=et;break}}}();var St=function(){var et="";Ue.StartTime&&G.Expires?et=Ue.StartTime+";"+(Ue.StartTime+G.Expires*1):Ue.StartTime&&Ue.ExpiredTime&&(et=Ue.StartTime+";"+Ue.ExpiredTime);var it=u.getAuth({SecretId:Ue.TmpSecretId,SecretKey:Ue.TmpSecretKey,Method:G.Method,Pathname:lt,Query:G.Query,Headers:Y,Expires:G.Expires,UseRawKey:Le.options.UseRawKey,SystemClockOffset:Le.options.SystemClockOffset,KeyTime:et,ForceSignHost:be}),bt={Authorization:it,SecurityToken:Ue.SecurityToken||Ue.XCosSecurityToken||"",Token:Ue.Token||"",ClientIP:Ue.ClientIP||"",ClientUA:Ue.ClientUA||"",SignFrom:"client"};ve(null,bt)},Tt=function(et){if(et.Authorization){var it=!1,bt=et.Authorization;if(bt)if(bt.indexOf(" ")>-1)it=!1;else if(bt.indexOf("q-sign-algorithm=")>-1&&bt.indexOf("q-ak=")>-1&&bt.indexOf("q-sign-time=")>-1&&bt.indexOf("q-key-time=")>-1&&bt.indexOf("q-url-param-list=")>-1)it=!0;else try{bt=atob(bt),bt.indexOf("a=")>-1&&bt.indexOf("k=")>-1&&bt.indexOf("t=")>-1&&bt.indexOf("r=")>-1&&bt.indexOf("b=")>-1&&(it=!0)}catch(Nt){}if(!it)return u.error(new Error("getAuthorization callback params format error"))}else{if(!et.TmpSecretId)return u.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!et.TmpSecretKey)return u.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!et.SecurityToken&&!et.XCosSecurityToken)return u.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!et.ExpiredTime)return u.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(et.ExpiredTime&&et.ExpiredTime.toString().length!==10)return u.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(et.StartTime&&et.StartTime.toString().length!==10)return u.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(Ue.ExpiredTime&&Ue.ExpiredTime-u.getSkewTime(Le.options.SystemClockOffset)/1e3>60)St();else if(Le.options.getAuthorization)Le.options.getAuthorization.call(Le,{Bucket:Oe,Region:Qe,Method:G.Method,Key:Ke,Pathname:lt,Query:G.Query,Headers:Y,Scope:mt,SystemClockOffset:Le.options.SystemClockOffset,ForceSignHost:be},function(ht){typeof ht=="string"&&(ht={Authorization:ht});var et=Tt(ht);if(et)return ve(et);ht.Authorization?ve(null,ht):(Ue=ht||{},Ue.Scope=mt,Ue.ScopeKey=_t,Le._StsCache.push(Ue),St())});else if(Le.options.getSTS)Le.options.getSTS.call(Le,{Bucket:Oe,Region:Qe},function(ht){Ue=ht||{},Ue.Scope=mt,Ue.ScopeKey=_t,Ue.TmpSecretId||(Ue.TmpSecretId=Ue.SecretId),Ue.TmpSecretKey||(Ue.TmpSecretKey=Ue.SecretKey);var et=Tt(Ue);if(et)return ve(et);Le._StsCache.push(Ue),St()});else return function(){var ht=u.getAuth({SecretId:G.SecretId||Le.options.SecretId,SecretKey:G.SecretKey||Le.options.SecretKey,Method:G.Method,Pathname:lt,Query:G.Query,Headers:Y,Expires:G.Expires,UseRawKey:Le.options.UseRawKey,SystemClockOffset:Le.options.SystemClockOffset,ForceSignHost:be}),et={Authorization:ht,SecurityToken:Le.options.SecurityToken||Le.options.XCosSecurityToken,SignFrom:"client"};return ve(null,et),et}();return""}function vt(G){var oe=this,Y=!1,ie=!1,be=!1,me=G.headers&&(G.headers.date||G.headers.Date)||G.error&&G.error.ServerTime;try{var ve=G.error.Code,Le=G.error.Message;(ve==="RequestTimeTooSkewed"||ve==="AccessDenied"&&Le==="Request has expired")&&(ie=!0)}catch(Qe){}if(G)if(ie&&me){var Oe=Date.parse(me);this.options.CorrectClockSkew&&Math.abs(u.getSkewTime(this.options.SystemClockOffset)-Oe)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=Oe-Date.now(),Y=!0)}else Math.floor(G.statusCode/100)===5?Y=!0:G.message==="CORS blocked or network error"&&(be=!0,Y=oe.options.AutoSwitchHost);return{canRetry:Y,networkError:be}}function Lt(G){var oe=G.requestUrl,Y=G.clientCalcSign,ie=G.networkError;if(!this.options.AutoSwitchHost||!oe||!Y||!ie)return!1;var be=/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/,me=/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/,ve=be.test(oe)&&!me.test(oe);return ve}function qe(G,oe){var Y=this;!G.headers&&(G.headers={}),!G.qs&&(G.qs={}),G.VersionId&&(G.qs.versionId=G.VersionId),G.qs=u.clearKey(G.qs),G.headers&&(G.headers=u.clearKey(G.headers)),G.qs&&(G.qs=u.clearKey(G.qs));var ie=u.clone(G.qs);G.action&&(ie[G.action]="");var be=G.url||G.Url,me=G.SignHost||We.call(this,{Bucket:G.Bucket,Region:G.Region,Url:be}),ve=G.tracker,Le=function Oe(Qe){var Ke=Y.options.SystemClockOffset;ve&&ve.setParams({signStartTime:new Date().getTime(),httpRetryTimes:Qe-1}),G.SwitchHost&&(me=me.replace(/myqcloud.com/,"tencentcos.cn")),rt.call(Y,{Bucket:G.Bucket||"",Region:G.Region||"",Method:G.method,Key:G.Key,Query:ie,Headers:G.headers,SignHost:me,Action:G.Action,ResourceKey:G.ResourceKey,Scope:G.Scope,ForceSignHost:Y.options.ForceSignHost,SwitchHost:G.SwitchHost},function(lt,Ue){if(lt){oe(lt);return}ve&&ve.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),G.AuthData=Ue,Rt.call(Y,G,function(mt,Ct){ve&&ve.setParams({httpEndTime:new Date().getTime()});var Dt=!1,_t=!1;if(mt){var St=vt.call(Y,mt);Dt=St.canRetry||Ke!==Y.options.SystemClockOffset,_t=St.networkError}if(mt&&Qe<2&&Dt){G.headers&&(delete G.headers.Authorization,delete G.headers.token,delete G.headers.clientIP,delete G.headers.clientUA,G.headers["x-cos-security-token"]&&delete G.headers["x-cos-security-token"],G.headers["x-ci-security-token"]&&delete G.headers["x-ci-security-token"]);var Tt=Lt.call(Y,{requestUrl:(mt==null?void 0:mt.url)||"",clientCalcSign:Ue.SignFrom==="client",networkError:_t});G.SwitchHost=Tt,Oe(Qe+1)}else oe(mt,Ct)})})};Le(1)}function Rt(G,oe){var Y=this,ie=G.TaskId;if(!(ie&&!Y._isRunningTask(ie))){var be=G.Bucket,me=G.Region,ve=G.Key,Le=G.method||"GET",Oe=G.Url||G.url,Qe=G.body,Ke=G.rawBody;Y.options.UseAccelerate&&(me="accelerate"),Oe=Oe||Ne({ForcePathStyle:Y.options.ForcePathStyle,protocol:Y.options.Protocol,domain:Y.options.Domain,bucket:be,region:me,object:ve}),G.SwitchHost&&(Oe=Oe.replace(/myqcloud.com/,"tencentcos.cn"));var lt=ve?Oe:"";G.action&&(Oe=Oe+"?"+(u.isIOS_QQ?"".concat(G.action,"="):G.action)),G.qsStr&&(Oe.indexOf("?")>-1?Oe=Oe+"&"+G.qsStr:Oe=Oe+"?"+G.qsStr);var Ue={method:Le,url:Oe,headers:G.headers,qs:G.qs,body:Qe},mt="x-cos-security-token";if(u.isCIHost(Oe)&&(mt="x-ci-security-token"),Ue.headers.Authorization=G.AuthData.Authorization,G.AuthData.Token&&(Ue.headers.token=G.AuthData.Token),G.AuthData.ClientIP&&(Ue.headers.clientIP=G.AuthData.ClientIP),G.AuthData.ClientUA&&(Ue.headers.clientUA=G.AuthData.ClientUA),G.AuthData.SecurityToken&&(Ue.headers[mt]=G.AuthData.SecurityToken),Ue.headers&&(Ue.headers=u.clearKey(Ue.headers)),Ue=u.clearKey(Ue),G.onProgress&&typeof G.onProgress=="function"){var Ct=Qe&&(Qe.size||Qe.length)||0;Ue.onProgress=function(it){if(!(ie&&!Y._isRunningTask(ie))){var bt=it?it.loaded:0;G.onProgress({loaded:bt,total:Ct})}}}G.onDownloadProgress&&(Ue.onDownloadProgress=G.onDownloadProgress),G.DataType&&(Ue.dataType=G.DataType),this.options.Timeout&&(Ue.timeout=this.options.Timeout),Y.options.ForcePathStyle&&(Ue.pathStyle=Y.options.ForcePathStyle),Y.emit("before-send",Ue);var Dt=Ue.url.includes("accelerate."),_t=Ue.qs?Object.keys(Ue.qs).map(function(it){return"".concat(it,"=").concat(Ue.qs[it])}).join("&"):"",St=_t?Ue.url+"?"+_t:Ue.url;if(G.tracker){var Tt;G.tracker.setParams({url:St,httpMethod:Ue.method,accelerate:Dt,httpSize:((Tt=Ue.body)===null||Tt===void 0?void 0:Tt.size)||0}),G.tracker.parent&&!G.tracker.parent.params.url&&G.tracker.parent.setParams({url:lt,accelerate:Dt})}var ht=(Y.options.Request||l)(Ue,function(it){if(!(it&&it.error==="abort")){var bt={options:Ue,error:it&&it.error,statusCode:it&&it.statusCode||0,statusMessage:it&&it.statusMessage||"",headers:it&&it.headers||{},body:it&&it.body};Y.emit("after-receive",bt);var Nt=bt.error,Ot=bt.body,$t={statusCode:bt.statusCode,statusMessage:bt.statusMessage,headers:bt.headers},ti,Yt=function(Qt,xt){if(ie&&Y.off("inner-kill-task",et),!ti){ti=!0;var qt={};$t&&$t.statusCode&&(qt.statusCode=$t.statusCode),$t&&$t.headers&&(qt.headers=$t.headers),Qt?(Ue.url&&(qt.url=Ue.url),Ue.method&&(qt.method=Ue.method),Qt=u.extend(Qt||{},qt),oe(Qt,null)):(xt=u.extend(xt||{},qt),oe(null,xt)),ht=null}};if(Nt)return Yt(u.error(Nt));var At=$t.statusCode,ni=Math.floor(At/100)===2;if(Ke){if(ni)return Yt(null,{body:Ot});if(Ot instanceof Blob){u.readAsBinaryString(Ot,function(ri){var Qt=u.parseResBody(ri),xt=Qt.Error||Qt;return Yt(u.error(new Error(xt.Message||"response body error"),{code:xt.Code,error:xt}))});return}}var zt=u.parseResBody(Ot),Ft=zt.Error||zt;ni?Yt(null,zt):Ft?Yt(u.error(new Error(Ft.Message),{code:Ft.Code,error:Ft})):At?Yt(u.error(new Error($t.statusMessage),{code:""+At})):At&&Yt(u.error(new Error("statusCode error")))}}),et=function it(bt){bt.TaskId===ie&&(ht&&ht.abort&&ht.abort(),Y.off("inner-kill-task",it))};ie&&Y.on("inner-kill-task",et)}}var ze={getService:c,putBucket:d,headBucket:y,getBucket:m,deleteBucket:g,putBucketAcl:v,getBucketAcl:b,putBucketCors:S,getBucketCors:x,deleteBucketCors:A,getBucketLocation:E,getBucketPolicy:_,putBucketPolicy:w,deleteBucketPolicy:T,putBucketTagging:C,getBucketTagging:P,deleteBucketTagging:k,putBucketLifecycle:M,getBucketLifecycle:R,deleteBucketLifecycle:H,putBucketVersioning:B,getBucketVersioning:F,putBucketReplication:I,getBucketReplication:U,deleteBucketReplication:D,putBucketWebsite:$,getBucketWebsite:N,deleteBucketWebsite:O,putBucketReferer:Q,getBucketReferer:z,putBucketDomain:W,getBucketDomain:xe,deleteBucketDomain:ye,putBucketOrigin:q,getBucketOrigin:re,deleteBucketOrigin:ue,putBucketLogging:ge,getBucketLogging:Se,putBucketInventory:Ie,postBucketInventory:J,getBucketInventory:se,listBucketInventory:V,deleteBucketInventory:pe,putBucketAccelerate:ce,getBucketAccelerate:K,putBucketEncryption:Z,getBucketEncryption:he,deleteBucketEncryption:Ce,getObject:ke,headObject:Ae,listObjectVersions:_e,putObject:Re,deleteObject:Ee,getObjectAcl:le,putObjectAcl:we,optionsObject:de,putObjectCopy:De,deleteMultipleObject:$e,restoreObject:Je,putObjectTagging:Ye,getObjectTagging:tt,deleteObjectTagging:Ze,selectObjectContent:ot,appendObject:Gt,uploadPartCopy:Ve,multipartInit:pt,multipartUpload:nt,multipartComplete:ct,multipartList:Pt,multipartListPart:at,multipartAbort:ft,request:wt,getObjectUrl:ee,getAuth:Ht};function gt(G,oe,Y){u.each(["Cors","Acl"],function(ie){if(G.slice(-ie.length)===ie){var be=G.slice(0,-ie.length)+ie.toUpperCase(),me=u.apiWrapper(G,oe),ve=!1;Y[be]=function(){!ve&&console.warn("warning: cos."+be+" has been deprecated. Please Use cos."+G+" instead."),ve=!0,me.apply(this,arguments)}}})}r.exports.init=function(G,oe){oe.transferToTaskMethod(ze,"putObject"),u.each(ze,function(Y,ie){G.prototype[ie]=u.apiWrapper(ie,Y),gt(ie,Y,G.prototype)})}},"./src/cos.js":function(r,s,o){var a=o("./src/util.js"),l=o("./src/event.js"),u=o("./src/task.js"),c=o("./src/base.js"),d=o("./src/advance.js"),y=o("./package.json"),m={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024,SliceSize:1024*1024,CopyChunkParallelLimit:20,CopyChunkSize:1024*1024*10,CopySliceSize:1024*1024*10,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,AutoSwitchHost:!0,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},g=function(b){if(this.options=a.extend(a.clone(m),b||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1024*1024,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1024*1024,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),a.isNode()&&(console.log("Tip: Next.js、Nuxt.js 等服务端渲染技术可正常使用JavaScript SDK,请忽略下方 nodejs 环境警告"),console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),this.options.ForcePathStyle)throw console.warn("cos-js-sdk-v5不再支持使用path-style,仅支持使用virtual-hosted-style,参考文档:https://cloud.tencent.com/document/product/436/96243"),new Error("ForcePathStyle is not supported");l.init(this),u.init(this)};c.init(g,u),d.init(g,u),g.util={md5:a.md5,xml2json:a.xml2json,json2xml:a.json2xml,encodeBase64:a.encodeBase64},g.getAuthorization=a.getAuth,g.version=y.version,r.exports=g},"./src/event.js":function(r,s){var o=function(u){var c={},d=function(m){return!c[m]&&(c[m]=[]),c[m]};u.on=function(y,m){y==="task-list-update"&&console.warn('warning: Event "'+y+'" has been deprecated. Please use "list-update" instead.'),d(y).push(m)},u.off=function(y,m){for(var g=d(y),v=g.length-1;v>=0;v--)m===g[v]&&g.splice(v,1)},u.emit=function(y,m){for(var g=d(y).map(function(b){return b}),v=0;v=0;E--){var w=c[E][2];(!w||w+u=0;w--){var _=c[w];_[0]===x&&_[1]===A&&c.splice(w,1)}c.unshift([x,A,Math.round(Date.now()/1e3)]),c.length>E&&c.splice(E),v()}},removeUploadId:function(x){g.call(this),delete b.using[x];for(var A=c.length-1;A>=0;A--)c[A][1]===x&&c.splice(A,1);v()}};r.exports=b},"./src/task.js":function(r,s,o){var a=o("./src/session.js"),l=o("./src/util.js"),u={},c=function(m,g){u[g]=m[g],m[g]=function(v,b){v.SkipTask?u[g].call(this,v,b):this._addTask(g,v,b)}},d=function(m){var g=[],v={},b=0,S=0,x=function(P){var k={id:P.id,Bucket:P.Bucket,Region:P.Region,Key:P.Key,FilePath:P.FilePath,state:P.state,loaded:P.loaded,size:P.size,speed:P.speed,percent:P.percent,hashPercent:P.hashPercent,error:P.error};return P.FilePath&&(k.FilePath=P.FilePath),P._custom&&(k._custom=P._custom),k},A=function(){var C,P=function(){C=0,m.emit("task-list-update",{list:l.map(g,x)}),m.emit("list-update",{list:l.map(g,x)})};return function(){C||(C=setTimeout(P))}}(),E=function(){if(!(g.length<=m.options.UploadQueueSize)){for(var P=0;Pm.options.UploadQueueSize;){var k=g[P].state==="waiting"||g[P].state==="checking"||g[P].state==="uploading";!g[P]||!k?(v[g[P].id]&&delete v[g[P].id],g.splice(P,1),S--):P++}A()}},w=function C(){if(!(b>=m.options.FileParallelLimit)){for(;g[S]&&g[S].state!=="waiting";)S++;if(!(S>=g.length)){var P=g[S];S++,b++,P.state="checking",P.params.onTaskStart&&P.params.onTaskStart(x(P)),!P.params.UploadData&&(P.params.UploadData={});var k=l.formatParams(P.api,P.params);u[P.api].call(m,k,function(M,R){m._isRunningTask(P.id)&&((P.state==="checking"||P.state==="uploading")&&(P.state=M?"error":"success",M&&(P.error=M),b--,A(),C(),P.callback&&P.callback(M,R),P.state==="success"&&(P.params&&(delete P.params.UploadData,delete P.params.Body,delete P.params),delete P.callback)),E())}),A(),setTimeout(C)}}},_=function(P,k){var M=v[P];if(M){var R=M&&M.state==="waiting",H=M&&(M.state==="checking"||M.state==="uploading");if(k==="canceled"&&M.state!=="canceled"||k==="paused"&&R||k==="paused"&&H){M.state=k,m.emit("inner-kill-task",{TaskId:P,toState:k});try{var B=M&&M.params&&M.params.UploadData.UploadId}catch(F){}k==="canceled"&&B&&a.removeUsing(B),A(),H&&(b--,w()),k==="canceled"&&(M.params&&(delete M.params.UploadData,delete M.params.Body,delete M.params),delete M.callback)}E()}};m._addTasks=function(C){l.each(C,function(P){m._addTask(P.api,P.params,P.callback,!0)}),A()};var T=!0;m._addTask=function(C,P,k,M){P=l.formatParams(C,P);var R=l.uuid();P.TaskId=R,P.onTaskReady&&P.onTaskReady(R),P.TaskReady&&(P.TaskReady(R),T&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),T=!1);var H={params:P,callback:k,api:C,index:g.length,id:R,Bucket:P.Bucket,Region:P.Region,Key:P.Key,FilePath:P.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:P._custom},B=P.onHashProgress;P.onHashProgress=function(I){m._isRunningTask(H.id)&&(H.hashPercent=I.percent,B&&B(I),A())};var F=P.onProgress;return P.onProgress=function(I){m._isRunningTask(H.id)&&(H.state==="checking"&&(H.state="uploading"),H.loaded=I.loaded,H.speed=I.speed,H.percent=I.percent,F&&F(I),A())},l.getFileSize(C,P,function(I,U){if(I)return k(l.error(I));v[R]=H,g.push(H),H.size=U,!M&&A(),w(),E()}),R},m._isRunningTask=function(C){var P=v[C];return!!(P&&(P.state==="checking"||P.state==="uploading"))},m.getTaskList=function(){return l.map(g,x)},m.cancelTask=function(C){_(C,"canceled")},m.pauseTask=function(C){_(C,"paused")},m.restartTask=function(C){var P=v[C];P&&(P.state==="paused"||P.state==="error")&&(P.state="waiting",A(),S=Math.min(S,P.index),w())},m.isUploadRunning=function(){return b||S"u"?"undefined":u(navigator))==="object"){var k=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(k==null?void 0:k.type)||(k==null?void 0:k.effectiveType)||"unknown"}return"unknown"},getProtocol:function(){return(typeof location>"u"?"undefined":u(location))==="object"?location.protocol.replace(/:/,""):"unknown protocol"},getOsType:function(){if((typeof navigator>"u"?"undefined":u(navigator))!=="object")return"unknown os";var k=navigator.userAgent.toLowerCase(),M=/macintosh|mac os x/i.test(navigator.userAgent);return k.indexOf("win32")>=0||k.indexOf("wow32")>=0?"win32":k.indexOf("win64")>=0||k.indexOf("wow64")>=0?"win64":M?"mac":"unknown os"},isMobile:function(){var k=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator>"u"?"undefined":u(navigator))==="object"&&navigator.userAgent.match(k))},isAndroid:function(){var k=/(Android|Adr|Linux)/i;return!!((typeof navigator>"u"?"undefined":u(navigator))==="object"&&navigator.userAgent.match(k))},isIOS:function(){var k=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator>"u"?"undefined":u(navigator))==="object"&&navigator.userAgent.match(k))},isOtherMobile:function(){return v&&!isAndroid&&!isIOS},getUA:function(){if((typeof navigator>"u"?"undefined":u(navigator))!=="object")return"unknown device";var k=navigator.userAgent;return k}},v=g.isMobile(),b=g.isAndroid()?"android":g.isIOS?"ios":"other_mobile",S=g.getOsType(),x=v?b:S,A=g.getUA(),E=g.getProtocol(),w=function(k){return["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(k)?"UploadTask":k==="getObject"?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(k)?"CopyTask":k};function _(P){return P.replace(/([A-Z])/g,"_$1").toLowerCase()}function T(P){var k={},M=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],R=[].concat(M,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),H=P.requestResult==="Success"?M:R;for(var B in P)if(H.includes(B)){var F=_(B);k[F]=P[B]}return k.request_name=P.realApi?w(P.realApi):P.requestName,k}var C=function(){function P(k){a(this,P);var M=k.parent,R=k.traceId,H=k.bucket,B=k.region,F=k.apiName,I=k.realApi,U=k.httpMethod,D=k.fileKey,$=k.fileSize,N=k.accelerate,O=k.customId,Q=k.delay,z=k.deepTracker,W=k.Beacon,xe=k.clsReporter,ye=H&&H.substr(H.lastIndexOf("-")+1)||"";this.parent=M,this.deepTracker=z,this.delay=Q,xe&&!this.clsReporter&&(this.clsReporter=xe),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:c.version,osName:x,networkType:"",requestName:F||"",requestResult:"",realApi:I,bucket:H,region:B,accelerate:N,httpMethod:U,url:"",host:"",httpDomain:"",requestPath:D||"",userAgent:A,networkProtocol:E,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:$||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0,traceId:R||g.getUid(),appid:ye,partNumber:0,httpRetryTimes:0,customId:O||"",partTime:0},W&&(this.beacon=y(W,Q))}return l(P,[{key:"formatResult",value:function(M,R){var H,B,F,I,U,D,$=new Date().getTime(),N=g.getNetType(),O=M?(M==null?void 0:M.code)||(M==null||(H=M.error)===null||H===void 0?void 0:H.code)||(M==null||(B=M.error)===null||B===void 0?void 0:B.Code):"",Q=M?(M==null?void 0:M.message)||(M==null||(F=M.error)===null||F===void 0?void 0:F.message)||(M==null||(I=M.error)===null||I===void 0?void 0:I.Message):"",z=Q,W=M?(M==null?void 0:M.resource)||(M==null||(U=M.error)===null||U===void 0?void 0:U.resource)||(M==null||(D=M.error)===null||D===void 0?void 0:D.Resource):"",xe=M?M==null?void 0:M.statusCode:R.statusCode,ye=M?(M==null?void 0:M.headers)&&(M==null?void 0:M.headers["x-cos-request-id"]):(R==null?void 0:R.headers)&&(R==null?void 0:R.headers["x-cos-request-id"]),q=M?ye?"Server":"Client":"";this.params.requestName==="getObject"&&(this.params.httpSize=R?R.headers&&R.headers["content-length"]:0);var re=this.params.realApi==="sliceUploadFile",ue=this.params.realApi==="sliceCopyFile";if(re||ue){var ge=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:ge<0?0:ge.toFixed(3)})}else{var Se=$-this.params.startTime,Be=this.params.httpEndTime-this.params.httpStartTime,Ie=this.params.httpSize/1024/(Be/1e3),J=this.params.md5EndTime-this.params.md5StartTime,se=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",m(Be)),this.parent.addParamValue("httpFullTime",m(Se)),this.parent.addParamValue("httpMd5",m(J)),this.parent.addParamValue("httpSign",m(se)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",m(Be))),Object.assign(this.params,{httpFullTime:m(Se),httpMd5:m(J),httpSign:m(se),httpTookTime:m(Be),httpSpeed:Ie<0?0:Ie.toFixed(3)})}if(Object.assign(this.params,{networkType:N,requestResult:M?"Failure":"Success",errorType:q,errorCode:O,errorHttpCode:xe,errorName:z,errorMessage:Q,errorServiceName:W,errorRequestId:ye}),M&&(!O||!Q)&&(this.params.fullError=M?JSON.stringify(M):""),this.params.url){try{var V=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=V[2]}catch(pe){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(M,R){if(!(!this.beacon&&!this.clsReporter)){this.formatResult(M,R);var H=T(this.params);this.beacon&&this.sendEventsToBeacon(H),this.clsReporter&&this.sendEventsToCLS(H)}}},{key:"setParams",value:function(M){Object.assign(this.params,M)}},{key:"addParamValue",value:function(M,R){this.params[M]=(+this.params[M]+ +R).toFixed(3)}},{key:"sendEventsToBeacon",value:function(M){var R=this.params.requestName==="sliceUploadFile"||this.params.realApi==="sliceUploadFile";if(!(R&&!this.deepTracker)){var H="qcloud_track_cos_sdk";this.delay===0?this.beacon&&this.beacon.onDirectUserAction(H,M):this.beacon&&this.beacon.onUserAction(H,M)}}},{key:"sendEventsToCLS",value:function(M){var R=this.delay===0;this.clsReporter.log(M,R)}},{key:"generateSubTracker",value:function(M){return Object.assign(M,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new P(M)}}]),P}();r.exports=C},"./src/util.js":function(r,s,o){(function(a){var l=o("./node_modules/@babel/runtime/helpers/typeof.js");function u(Ee,le){var we=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(!we){if(Array.isArray(Ee)||(we=c(Ee))||le&&Ee&&typeof Ee.length=="number"){we&&(Ee=we);var de=0,De=function(){};return{s:De,n:function(){return de>=Ee.length?{done:!0}:{done:!1,value:Ee[de++]}},e:function(tt){throw tt},f:De}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ve=!0,$e=!1,Je;return{s:function(){we=we.call(Ee)},n:function(){var tt=we.next();return Ve=tt.done,tt},e:function(tt){$e=!0,Je=tt},f:function(){try{!Ve&&we.return!=null&&we.return()}finally{if($e)throw Je}}}}function c(Ee,le){if(Ee){if(typeof Ee=="string")return d(Ee,le);var we=Object.prototype.toString.call(Ee).slice(8,-1);if(we==="Object"&&Ee.constructor&&(we=Ee.constructor.name),we==="Map"||we==="Set")return Array.from(Ee);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return d(Ee,le)}}function d(Ee,le){(le==null||le>Ee.length)&&(le=Ee.length);for(var we=0,de=new Array(le);weVe?1:-1})}var E=function(le,we){var de,De,Ve,$e=[],Je=A(le);for(de=0;de-1||w.indexOf(De)>-1)&&(we[de]=le[de])}return we},T=function(le){le=le||{};var we=le.SecretId,de=le.SecretKey,De=le.KeyTime,Ve=(le.method||le.Method||"get").toLowerCase(),$e=N(le.Query||le.params||{}),Je=_(N(le.Headers||le.headers||{})),Ye=le.Key||"",tt;le.UseRawKey?tt=le.Pathname||le.pathname||"/"+Ye:(tt=le.Pathname||le.pathname||Ye,tt.indexOf("/")!==0&&(tt="/"+tt));var Ze=le.ForceSignHost!==!1;if(!Je.Host&&!Je.host&&le.Bucket&&le.Region&&Ze&&(Je.Host=le.Bucket+".cos."+le.Region+".myqcloud.com"),!we)throw new Error("missing param SecretId");if(!de)throw new Error("missing param SecretKey");var ot=Math.round(V(le.SystemClockOffset)/1e3)-1,pt=ot,nt=le.Expires||le.expires;nt===void 0?pt+=900:pt+=nt*1||0;var ct="sha1",Pt=we,at=De||ot+";"+pt,ft=De||ot+";"+pt,wt=A(Je,!0).join(";").toLowerCase(),Gt=A($e,!0).join(";").toLowerCase(),Ht=m.HmacSHA1(ft,de).toString(),ee=[Ve,tt,Re.obj2str($e,!0),Re.obj2str(Je,!0),""].join(` `),ae=["sha1",at,m.SHA1(ee).toString(),""].join(` `),Te=m.HmacSHA1(ae,Ht).toString(),Ne=["q-sign-algorithm="+ct,"q-ak="+Pt,"q-sign-time="+at,"q-key-time="+ft,"q-header-list="+wt,"q-url-param-list="+Gt,"q-signature="+Te].join("&");return Ne},C=function(le,we,de){var De=we/8,Ve=le.slice(de,de+De);return new Uint8Array(Ve).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[we](Ve)[0]},P=function(le,we,de,De){var Ve=le.slice(we,de),$e="";return new Uint8Array(Ve).forEach(function(Je){$e+=String.fromCharCode(Je)}),De&&($e=decodeURIComponent(escape($e))),$e},k=function(le){for(var we={},de=P(le),De={records:[]};le.byteLength;){var Ve=C(le,32,0),$e=C(le,32,4),Je=Ve-$e-16,Ye=0,tt;for(le=le.slice(12);Ye<$e;){var Ze=C(le,8,Ye),ot=P(le,Ye+1,Ye+1+Ze),pt=C(le,16,Ye+Ze+2),nt=P(le,Ye+Ze+4,Ye+Ze+4+pt);we[ot]=nt,Ye+=Ze+4+pt}if(we[":event-type"]==="Records")tt=P(le,Ye,Ye+Je,!0),De.records.push(tt);else if(we[":event-type"]==="Stats")tt=P(le,Ye,Ye+Je,!0),De.stats=Re.xml2json(tt).Stats;else if(we[":event-type"]==="error"){var ct=we[":error-code"],Pt=we[":error-message"],at=new Error(Pt);at.message=Pt,at.name=at.code=ct,De.error=at}le=le.slice(Ye+Je+4)}return{payload:De.records.join(""),body:de}},M=function(le){var we=this.options.CopySourceParser;if(we)return we(le);var de=le.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return de?{Bucket:de[1],Region:de[3],Key:de[7]}:null},R=function(){},H=function(le){var we={};for(var de in le)le.hasOwnProperty(de)&&le[de]!==void 0&&le[de]!==null&&(we[de]=le[de]);return we},B=function(le,we){var de,De=new FileReader;FileReader.prototype.readAsBinaryString?(de=FileReader.prototype.readAsBinaryString,De.onload=function(){we(this.result)}):FileReader.prototype.readAsArrayBuffer?de=function($e){var Je="",Ye=new FileReader;Ye.onload=function(tt){for(var Ze=new Uint8Array(Ye.result),ot=Ze.byteLength,pt=0;ptparseInt(De[Ve])?1:-1;return 0},le=function(de){if(!de)return!1;var De=(de.match(/Chrome\/([.\d]+)/)||[])[1],Ve=(de.match(/QBCore\/([.\d]+)/)||[])[1],$e=(de.match(/QQBrowser\/([.\d]+)/)||[])[1],Je=De&&Ee(De,"53.0.2785.116")<0&&Ve&&Ee(Ve,"3.53.991.400")<0&&$e&&Ee($e,"9.0.2524.400")<=0||!1;return Je};return le(typeof navigator<"u"&&navigator.userAgent)}(),I=function(le,we,de,De,Ve){var $e;if(le.slice?$e=le.slice(we,de):le.mozSlice?$e=le.mozSlice(we,de):le.webkitSlice&&($e=le.webkitSlice(we,de)),De&&F){var Je=new FileReader;Je.onload=function(Ye){$e=null,Ve(new Blob([Je.result]))},Je.readAsArrayBuffer($e)}else Ve($e)},U=function(le,we,de,De){de=de||R,le?typeof we=="string"?de(Re.md5(we,!0)):Blob&&we instanceof Blob?Re.getFileMd5(we,function(Ve,$e){de($e)},De):de():de()},D=1024*1024,$=function(le,we,de){var De=le.size,Ve=0,$e=y.getCtx(),Je=function Ye(tt){if(tt>=De){var Ze=$e.digest("hex");we(null,Ze);return}var ot=Math.min(De,tt+D);Re.fileSlice(le,tt,ot,!1,function(pt){B(pt,function(nt){pt=null,$e=$e.update(nt,!0),Ve+=nt.length,nt=null,de&&de({loaded:Ve,total:De,percent:Math.round(Ve/De*1e4)/1e4}),Ye(tt+D)})})};Je(0)};function N(Ee){return q(Ee,function(le){return l(le)==="object"&&le!==null?N(le):le})}function O(Ee,le,we){return Ee&&le in Ee?Ee[le]:we}function Q(Ee,le){return ye(le,function(we,de){Ee[de]=le[de]}),Ee}function z(Ee){return Ee instanceof Array}function W(Ee,le){for(var we=!1,de=0;de-1,Ye=!$e||typeof $e=="string"&&$e.indexOf("{Region}")>-1;if(le.indexOf("Bucket")>-1||le==="deleteMultipleObject"||le==="multipartList"||le==="listObjectVersions"){if(Je&&!de)return"Bucket";if(Ye&&!De)return"Region"}else if(le.indexOf("Object")>-1||le.indexOf("multipart")>-1||le==="sliceUploadFile"||le==="abortUploadTask"||le==="uploadFile"){if(Je&&!de)return"Bucket";if(Ye&&!De)return"Region";if(!Ve)return"Key"}return!1},Be=function(le,we){if(we=Q({},we),le!=="getAuth"&&le!=="getV4Auth"&&le!=="getObjectUrl"){var de=we.Headers||{};if(we&&l(we)==="object"){(function(){for(var Ve in we)we.hasOwnProperty(Ve)&&Ve.indexOf("x-cos-")>-1&&(de[Ve]=we[Ve])})();var De={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"};Re.each(De,function(Ve,$e){we[Ve]!==void 0&&(de[$e]=we[Ve])}),we.Headers=H(de)}}return we},Ie=function(le,we){return function(de,De){var Ve=this;typeof de=="function"&&(De=de,de={}),de=Be(le,de);var $e;if(Ve.options.EnableReporter)if(de.calledBySdk==="sliceUploadFile"||de.calledBySdk==="sliceCopyFile")$e=de.tracker&&de.tracker.generateSubTracker({apiName:le});else if(["uploadFile","uploadFiles"].includes(le))$e=null;else{var Je=0;de.Body&&(Je=typeof de.Body=="string"?de.Body.length:de.Body.size||de.Body.byteLength||0);var Ye=Ve.options.UseAccelerate||typeof Ve.options.Domain=="string"&&Ve.options.Domain.includes("accelerate.");$e=new S({Beacon:Ve.options.BeaconReporter,clsReporter:Ve.options.ClsReporter,bucket:de.Bucket,region:de.Region,apiName:le,realApi:le,accelerate:Ye,fileKey:de.Key,fileSize:Je,deepTracker:Ve.options.DeepTracker,customId:Ve.options.CustomId,delay:Ve.options.TrackerDelay})}de.tracker=$e;var tt=function(at){return at&&at.headers&&(at.headers["x-cos-request-id"]&&(at.RequestId=at.headers["x-cos-request-id"]),at.headers["x-ci-request-id"]&&(at.RequestId=at.headers["x-ci-request-id"]),at.headers["x-cos-version-id"]&&(at.VersionId=at.headers["x-cos-version-id"]),at.headers["x-cos-delete-marker"]&&(at.DeleteMarker=at.headers["x-cos-delete-marker"])),at},Ze=function(at,ft){$e&&$e.report(at,ft),De&&De(tt(at),tt(ft))},ot=function(){if(le!=="getService"&&le!=="abortUploadTask"){var at=Se.call(Ve,le,de);if(at)return"missing param "+at;if(de.Region){if(Ve.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(de.Region))return"Region format error."}else{if(de.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(de.Region))return"Region format error."}!Ve.options.CompatibilityMode&&de.Region.indexOf("-")===-1&&de.Region!=="yfb"&&de.Region!=="default"&&de.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(de.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(de.Bucket))if(de.AppId)de.Bucket=de.Bucket+"-"+de.AppId;else if(Ve.options.AppId)de.Bucket=de.Bucket+"-"+Ve.options.AppId;else return'Bucket should format as "test-1250000000".';de.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete de.AppId)}!Ve.options.UseRawKey&&de.Key&&de.Key.substr(0,1)==="/"&&(de.Key=de.Key.substr(1))}},pt=ot(),nt=["getAuth","getObjectUrl"].includes(le);if(typeof Promise=="function"&&!nt&&!De)return new Promise(function(Pt,at){if(De=function(wt,Gt){wt?at(wt):Pt(Gt)},pt)return Ze(Re.error(new Error(pt)));we.call(Ve,de,Ze)});if(pt)return Ze(Re.error(new Error(pt)));var ct=we.call(Ve,de,Ze);if(nt)return ct}},J=function(le,we){var de=this,De=0,Ve=0,$e=Date.now(),Je,Ye;function tt(){if(Ye=0,we&&typeof we=="function"){Je=Date.now();var Ze=Math.max(0,Math.round((Ve-De)/((Je-$e)/1e3)*100)/100)||0,ot;Ve===0&&le===0?ot=1:ot=Math.floor(Ve/le*100)/100||0,$e=Je,De=Ve;try{we({loaded:Ve,total:le,speed:Ze,percent:ot})}catch(pt){}}}return function(Ze,ot){if(Ze&&(Ve=Ze.loaded,le=Ze.total),ot)clearTimeout(Ye),tt();else{if(Ye)return;Ye=setTimeout(tt,de.options.ProgressInterval)}}},se=function(le,we,de){var De;if(typeof we.Body=="string"?we.Body=new Blob([we.Body],{type:"text/plain"}):we.Body instanceof ArrayBuffer&&(we.Body=new Blob([we.Body])),we.Body&&(we.Body instanceof Blob||we.Body.toString()==="[object File]"||we.Body.toString()==="[object Blob]"))De=we.Body.size;else{de(Re.error(new Error("params body format error, Only allow File|Blob|String.")));return}we.ContentLength=De,de(null,De)},V=function(le){return Date.now()+(le||0)},pe=function(le,we){var de=le;return le.message=le.message||null,typeof we=="string"?(le.error=we,le.message=we):l(we)==="object"&&we!==null&&(Q(le,we),(we.code||we.name)&&(le.code=we.code||we.name),we.message&&(le.message=we.message),we.stack&&(le.stack=we.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(le,"name",{writable:!0,enumerable:!1}),Object.defineProperty(le,"message",{enumerable:!0})),le.name=we&&we.name||le.name||le.code||"Error",le.code||(le.code=le.name),le.error||(le.error=N(de)),le},ce=function(){return(typeof globalThis>"u"?"undefined":l(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},K=function(){return(typeof window>"u"?"undefined":l(window))!=="object"&&(typeof a>"u"?"undefined":l(a))==="object"&&!0&&!ce()},Z=function(le){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(le)},he=function(){if((typeof navigator>"u"?"undefined":l(navigator))!=="object")return!1;var Ee=navigator.userAgent,le=!!Ee.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return le}(),Ce=function(){return(typeof navigator>"u"?"undefined":l(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),Ae=function(le,we){var de=b.encode(le);return we&&(de=de.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),de},_e=function(le){var we=le.split("/"),de=[],De=u(we),Ve;try{for(De.s();!(Ve=De.n()).done;){var $e=Ve.value;$e===".."?de.length&&de.pop():$e.length&&$e!=="."&&de.push($e)}}catch(Je){De.e(Je)}finally{De.f()}return"/"+de.join("/")},ke=function(le){var we;if(le&&typeof le=="string"){var de=le.trim(),De=de.indexOf("<")===0,Ve=de.indexOf("{")===0;if(De)we=Re.xml2json(le)||{};else if(Ve)try{var $e=le.replace(/\n/g," "),Je=JSON.parse($e);Object.prototype.toString.call(Je)==="[object Object]"?we=Je:we=le}catch(Ye){we=le}else we=le}else we=le||{};return we},Re={noop:R,formatParams:Be,apiWrapper:Ie,xml2json:g,json2xml:v,md5:y,clearKey:H,fileSlice:I,getBodyMd5:U,getFileMd5:$,b64:ue,extend:Q,isArray:z,isInArray:W,makeArray:xe,each:ye,map:q,filter:re,clone:N,attr:O,uuid:ge,camSafeUrlEncode:x,throttleOnProgress:J,getFileSize:se,getSkewTime:V,error:pe,obj2str:E,getAuth:T,parseSelectPayload:k,getSourceParams:M,isBrowser:!0,isNode:K,isCIHost:Z,isIOS_QQ:he&&Ce,encodeBase64:Ae,simplifyPath:_e,readAsBinaryString:B,parseResBody:ke};r.exports=Re}).call(this,o("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);const container$3="_container_dub61_1",closeBtn$1="_closeBtn_dub61_33",jianyi="_jianyi_dub61_41",styles$m={container:container$3,closeBtn:closeBtn$1,jianyi},earphoneBox$1="_earphoneBox_1aj1j_1",ipadEarphoneBox$1="_ipadEarphoneBox_1aj1j_6",earphoneBtn$1="_earphoneBtn_1aj1j_10",earphoneBg$1="_earphoneBg_1aj1j_14",styles$l={earphoneBox:earphoneBox$1,ipadEarphoneBox:ipadEarphoneBox$1,earphoneBtn:earphoneBtn$1,earphoneBg:earphoneBg$1},startBtn$1="_startBtn_wef68_4",endBtn$1="_endBtn_wef68_19",operatingBtn$1="_operatingBtn_wef68_33",iconBtn$1="_iconBtn_wef68_42",dialogueBox="_dialogueBox_wef68_50",dialogue="_dialogue_wef68_50",dialoguebg="_dialoguebg_wef68_67",dialogueing="_dialogueing_wef68_82",dialogueIcon="_dialogueIcon_wef68_96",inRadioIcon="_inRadioIcon_wef68_100",preJson$1="_preJson_wef68_105",beginMask$1="_beginMask_wef68_112",earphoneBox="_earphoneBox_wef68_120",ipadEarphoneBox="_ipadEarphoneBox_wef68_125",earphoneBtn="_earphoneBtn_wef68_129",earphoneBg="_earphoneBg_wef68_133",styles$k={startBtn:startBtn$1,endBtn:endBtn$1,operatingBtn:operatingBtn$1,iconBtn:iconBtn$1,dialogueBox,dialogue,dialoguebg,dialogueing,dialogueIcon,inRadioIcon,preJson:preJson$1,beginMask:beginMask$1,earphoneBox,ipadEarphoneBox,earphoneBtn,earphoneBg},evaluatResult="_evaluatResult_ain5v_1",closeBtn="_closeBtn_ain5v_9",headerButton="_headerButton_ain5v_25",headBtn="_headBtn_ain5v_35",fraction$2="_fraction_ain5v_52",fractionPercussion="_fractionPercussion_ain5v_62",bg="_bg_ain5v_65",top$1="_top_ain5v_74",badge="_badge_ain5v_80",scoreSection="_scoreSection_ain5v_86",text="_text_ain5v_91",badgeText="_badgeText_ain5v_104",level="_level_ain5v_107",huaWeiLevel="_huaWeiLevel_ain5v_124",num="_num_ain5v_127",rightBadge="_rightBadge_ain5v_134",tips$1="_tips_ain5v_142",ctrls="_ctrls_ain5v_149",ctrlsBtn="_ctrlsBtn_ain5v_155",saveBtn="_saveBtn_ain5v_166",noSaveTip="_noSaveTip_ain5v_169",arrowIcon="_arrowIcon_ain5v_201",detail$3="_detail_ain5v_233",progressitem="_progressitem_ain5v_243",scores="_scores_ain5v_278",scoresNum="_scoresNum_ain5v_281",percussion="_percussion_ain5v_285",scoreDes="_scoreDes_ain5v_295",scoreNum="_scoreNum_ain5v_299",disablued="_disablued_ain5v_303",styles$j={evaluatResult,closeBtn,headerButton,headBtn,fraction:fraction$2,fractionPercussion,bg,top:top$1,badge,scoreSection,text,badgeText,level,huaWeiLevel,num,rightBadge,tips:tips$1,ctrls,ctrlsBtn,saveBtn,noSaveTip,arrowIcon,detail:detail$3,progressitem,scores,scoresNum,percussion,scoreDes,scoreNum,disablued},driver="",fraction$1="_fraction_1ybuf_1",title$4="_title_1ybuf_10",tip$1="_tip_1ybuf_21",btns$2="_btns_1ybuf_26",btn$3="_btn_1ybuf_26",styles$i={fraction:fraction$1,title:title$4,tip:tip$1,btns:btns$2,btn:btn$3},iframe="_iframe_1j216_1",btns$1="_btns_1j216_6",sbtn="_sbtn_1j216_14",disabled$1="_disabled_1j216_24",styles$h={iframe,btns:btns$1,sbtn,disabled:disabled$1},countdown="_countdown_j2yeo_1",step1="_step1_j2yeo_13",step2="_step2_j2yeo_16",step3="_step3_j2yeo_19",isAnimating="_isAnimating_j2yeo_22",styles$g={countdown,step1,step2,step3,isAnimating},countdownData=reactive({isShow:!1,step:3,isAnimating:!1});let _countdownTIme;function startCountdown(){Object.assign(countdownData,{isShow:!0,step:3,isAnimating:!1});let i;return _countdownTIme=setInterval(()=>{if(countdownData.step<=0)clearInterval(_countdownTIme),countdownData.isShow=!1,i(!0);else{countdownData.isAnimating=!0;const e=setTimeout(()=>{clearTimeout(e),countdownData.isAnimating=!1,countdownData.step--},300)}},1e3),new Promise(e=>{i=e})}const dragBom$1="_dragBom_1vkd6_1",guide$1="_guide_1vkd6_9",guideBg$1="_guideBg_1vkd6_25",guideDone$1="_guideDone_1vkd6_33",guideTop$1="_guideTop_1vkd6_44",guideLeft$1="_guideLeft_1vkd6_52",guideRight$1="_guideRight_1vkd6_61",styles$f={dragBom:dragBom$1,guide:guide$1,guideBg:guideBg$1,guideDone:guideDone$1,guideTop:guideTop$1,guideLeft:guideLeft$1,guideRight:guideRight$1};getQuery();function autoCorrelate(i,e){for(var r=i.length,s=0,o=0;od[m+1];)m++;for(var g=-1,v=-1,o=m;og&&(g=d[o],v=o);var b=v,S=d[b-1],x=d[b],A=d[b+1];let E=(S+A-2*x)/2,w=(A-S)/2;return E&&(b=b-w/(2*E)),e/b}const audioRecorder={audioContext:null,mediaRecorder:null,recordeState:!1,progress:i=>{},init(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)},toggleRecord(i){return new Promise((e,r)=>{i?navigator.mediaDevices.getUserMedia({audio:!0}).then(s=>{audioRecorder.mediaRecorder=s.getAudioTracks()[0],audioRecorder.recordeState=!0;const o=this.audioContext.createMediaStreamSource(s),a=this.audioContext.createAnalyser();a.fftSize=2048,o.connect(a);var l=new Float32Array(a.fftSize);const u=this.audioContext.sampleRate;function c(){if(!audioRecorder.recordeState)return;a.getFloatTimeDomainData(l);const d=autoCorrelate(l,u);audioRecorder.progress(d),setTimeout(()=>{c()},10)}c(),e(!0)}).catch(s=>{e(!1),console.error("Error accessing media devices:",s)}):audioRecorder.mediaRecorder.stop()})},checkSupport(){return new Promise((i,e)=>{if(navigator.mediaDevices.getUserMedia){const r={audio:!0};navigator.mediaDevices.getUserMedia(r).then(s=>{i(!0),console.log("授权成功!")},()=>{i(!1),console.error("授权失败!")})}else i(!1),console.error("浏览器不支持 getUserMedia")})}},query$2=getQuery(),followData=reactive({list:[],index:0,start:!1,rendered:!1,earphone:!1,isBeginMask:!1,dontAccredit:!0}),handleRecord=i=>{if(query$2.isCbs)return;i<0&&(i=0);const e=i/1e3,r={clientType:storeData.user.clientType,musicSheetId:state$1.examSongId,sysMusicScoreId:state$1.examSongId,feature:"FOLLOW_UP_TRAINING",practiceSource:"FOLLOW_UP_TRAINING",playTime:e,deviceType:browser().android?"ANDROID":"IOS",behaviorId:getBehaviorId()};api_musicPracticeRecordSave(r)},toggleFollow=(i=!0)=>{state$1.modeType=state$1.modeType==="follow"?"practise":"follow",i||(followData.start=!1,storeData.isApp&&!followData.dontAccredit&&openToggleRecord(!1))},noteFrequency=ref(0),audioFrequency=ref(0),followTime=ref(0),openToggleRecord=async(i=!0)=>{if(i||api_cloudToggleFollow(i?"start":"end"),i)followTime.value=Date.now();else{const e=Date.now()-followTime.value;followTime.value!==0&&e>0&&(handleRecord(e),followTime.value=0)}storeData.isApp||!await(audioRecorder==null?void 0:audioRecorder.toggleRecord(i))&&followData.start&&(followData.earphone=!0,followData.start=!1)},onClear=()=>{state$1.times.forEach(i=>{const e=document.querySelector(`div[data-vf=vf${i.id}]`);e&&e.classList.remove("follow-up","follow-down","follow-error","follow-success");const r=document.getElementById(`vf-${i.id}`),s=document.getElementById(`vf-${i.id}-stem`);r&&(r.classList.remove("follow-up","follow-down","follow-success"),s==null||s.classList.remove("follow-up","follow-down","follow-success"))})},handleFollowStart=async()=>{var e;followData.isBeginMask=!0,checking=!1;const i=await api_cloudToggleFollow("start");if((e=i==null?void 0:i.content)!=null&&e.reson)followData.isBeginMask=!1,followData.start=!1;else{if(followData.dontAccredit=!1,!await handleStartTick())return followData.isBeginMask=!1,followData.start=!1,!1;onClear(),followData.isBeginMask=!1,followData.start=!0,followData.index=0,followData.list=[],initSetPlayRate(),resetPlaybackToStart(),openToggleRecord(!0),getNoteIndex();const s=getDuration(state$1.osmd);metronomeData.totalNumerator=s.numerator||2,metronomeData.followAudioIndex=1,state$1.beatStartTime=0,followBeatPaly()}},handleFollowEnd=()=>{onClear(),followData.start=!1,openToggleRecord(!1),followData.index=0,console.log("结束")},clearRightNoteColor=()=>{var r,s,o;const i=(r=state$1.times[state$1.activeNoteIndex])==null?void 0:r.id,e=((o=(s=document.getElementById(`vf-${i}`))==null?void 0:s.getBoundingClientRect())==null?void 0:o.left)||0;state$1.times.forEach(a=>{var u;const l=document.getElementById(`vf-${a.id}`);((u=l==null?void 0:l.getBoundingClientRect())==null?void 0:u.left)>=e&&l.classList.remove("follow-up","follow-down","follow-error","follow-success")})},autoEndFollow=()=>{if(followData.index>=state$1.times.length){handleFollowEnd();return}if(followData.index+1,!state$1.times.slice(followData.index,state$1.times.length).some(r=>r.frequency>1)&&state$1.times[followData.index].frequency<1){handleFollowEnd();return}clearRightNoteColor()},next=()=>{followData.index{const i=state$1.times[followData.index];return i.frequency<=0?(followData.index=followData.index+1,next(),getNoteIndex()):(noteFrequency.value=i.frequency,{id:i.id,min:i.frequency-(i.frequency-i.prevFrequency)*.5,max:i.frequency+(i.nextFrequency-i.frequency)*.5,duration:i.duration,baseFrequency:i.frequency})};let checking=!1;const onFollowTime=i=>{var r;const e=(r=i==null?void 0:i.content)==null?void 0:r.frequency;followData.start&&e>0&&(audioFrequency.value=e,checked())};let startTime=0;const checked=()=>{if(checking)return;checking=!0;const i=getNoteIndex();if(audioFrequency.value=i.min&&audioFrequency.value<=i.max){if(startTime===0)startTime=Date.now();else if((Date.now()-startTime)/1e3>=i.duration*.6){startTime=0,followData.index=followData.index+1,setColor(i,"",!0),setTimeout(()=>{next(),checking=!1},3e3);return}}setColor(i,audioFrequency.value>i.baseFrequency?"follow-up":"follow-down"),checking=!1},setColor=(i,e,r=!1)=>{const s=document.querySelector(`div[data-vf=vf${i.id}]`);s&&(s.classList.remove("follow-up","follow-down","follow-error","follow-success"),r?s.classList.add("follow-success"):s.classList.add("follow-error",e));const o=document.getElementById(`vf-${i.id}`);if(o){const a=document.getElementById(`vf-${i.id}-stem`);o.classList.remove("follow-up","follow-down"),a==null||a.classList.remove("follow-up","follow-down","follow-success"),e&&(o.classList.add(e),a==null||a.classList.add(e)),r&&(o.classList.add("follow-success"),a==null||a.classList.add("follow-success"))}},skipNotePractice=()=>{followData.index=state$1.activeNoteIndex,Array.from(document.querySelectorAll(".follow-error")).forEach(e=>{e==null||e.classList.remove("follow-up","follow-down","follow-error")}),clearRightNoteColor()};watch(()=>followData.index,()=>{skipNotePlay(followData.index)});const FollowPractice=defineComponent({name:"follow",setup(){return onMounted(async()=>{storeData.isApp?api_cloudFollowTime(onFollowTime):await audioRecorder.checkSupport()?(audioRecorder.init(),audioRecorder.progress=e=>{onFollowTime({api:"",content:{frequency:e}})}):followData.earphone=!0,console.log("进入跟练模式")}),onUnmounted(()=>{resetPlaybackToStart(),onClear(),storeData.isApp&&!followData.dontAccredit&&openToggleRecord(!1),console.log("退出跟练模式")}),()=>createVNode("div",null,null)}}),index_module={},container$2="_container_w9k0g_1",follow$1="_follow_w9k0g_1",head$1="_head_w9k0g_1",pickerCon="_pickerCon_w9k0g_5",pickerBox="_pickerBox_w9k0g_9",picker="_picker_w9k0g_5",evaluating$1="_evaluating_w9k0g_18",headTit="_headTit_w9k0g_25",closeImg="_closeImg_w9k0g_28",button="_button_w9k0g_105",styles$e={container:container$2,follow:follow$1,head:head$1,pickerCon,pickerBox,picker,evaluating:evaluating$1,headTit,closeImg,button},toggleMusicSheet=reactive({show:!1,toggle:(i=!0)=>{toggleMusicSheet.show=i}}),popup="_popup_eh7py_1",tabs="_tabs_eh7py_4",follow="_follow_eh7py_64",evaluating="_evaluating_eh7py_68",wrap="_wrap_eh7py_72",searchBox="_searchBox_eh7py_76",isFocus="_isFocus_eh7py_85",searchBtn="_searchBtn_eh7py_112",dropdownMenu="_dropdownMenu_eh7py_128",currItem="_currItem_eh7py_187",item$1="_item_eh7py_202",itemActive="_itemActive_eh7py_210",content$2="_content_eh7py_215",name$1="_name_eh7py_215",titleImg="_titleImg_eh7py_218",iconType="_iconType_eh7py_227",VIP="_VIP_eh7py_236",detail$2="_detail_eh7py_245",usedNum="_usedNum_eh7py_250",author$1="_author_eh7py_269",playType="_playType_eh7py_275",singType="_singType_eh7py_276",empty="_empty_eh7py_294",styles$d={popup,tabs,follow,evaluating,wrap,searchBox,isFocus,searchBtn,dropdownMenu,currItem,item:item$1,itemActive,content:content$2,name:name$1,titleImg,iconType,VIP,detail:detail$2,usedNum,author:author$1,playType,singType,empty},query$1=getQuery();computed(()=>!(query$1.workRecord||query$1.modelType||state$1.platform===IPlatform.PC||query$1.isCbs));ref(!1);class AJAX{static ajax(e,r=9e3){let s;const o=e.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)s=new XMLHttpRequest;else if(ActiveXObject)s=new ActiveXObject("Microsoft.XMLHTTP");else return Promise.reject(new Error("XMLHttp not supported."));return s.timeout=r,new Promise((a,l)=>{s.onreadystatechange=()=>{s.readyState===XMLHttpRequest.DONE&&(s.status===200||s.status===0&&s.responseText?a(s.responseText):l(new Error("Could not retrieve requested URL "+s.status)))},s.ontimeout=u=>{l(new Error("Server request Timeout"))},s.overrideMimeType(o),s.open("GET",e,!0),s.send()})}}const _Fraction=class{constructor(i=0,e=1,r=0,s=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=i,this.denominator=e,this.wholeValue=r,s&&this.simplify(),this.setRealValue()}static max(i,e){return i.RealValue>e.RealValue?i:e}static Equal(i,e){return i.wholeValue===e.wholeValue&&i.Denominator===e.Denominator&&i.Numerator===e.Numerator}static createFromFraction(i){return new _Fraction(i.numerator,i.denominator,i.wholeValue,!1)}static plus(i,e){const r=i.clone();return r.Add(e),r}static minus(i,e){const r=i.clone();return r.Sub(e),r}static multiply(i,e){return new _Fraction((i.wholeValue*i.denominator+i.numerator)*(e.wholeValue*e.denominator+e.numerator),i.denominator*e.denominator)}static greatestCommonDenominator(i,e){if(i===0)return e;if(e===1)return 1;for(;Math.abs(e)>=1&&Math.abs(i)>=1;)i>e?i-=e:e-=i;const r=Math.round(i);return Math.max(r,1)}toString(){let i=this.numerator+"/"+this.denominator;return this.wholeValue!==0&&(i=this.wholeValue+" "+i),i}clone(){return new _Fraction(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(i){this.numerator!==i&&(this.numerator=i,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(i){this.denominator!==i&&(this.denominator=i,this.numerator!==0&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(i){this.wholeValue!==i&&(this.wholeValue=i,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let i=1,e=2;const r=this.GetExpandedNumerator();for(;ei;)e.Numerator++;if(this.numerator>this.denominator){const r=new _Fraction(this.numerator-1,this.denominator,this.wholeValue);for(;r.Denominator>i;)r.Numerator--;if(r.Denominator_Fraction.maximumAllowedNumber){const r=this.denominator/_Fraction.maximumAllowedNumber;this.numerator=Math.round(this.numerator/r),this.denominator=Math.round(this.denominator/r)}if(this.numerator>_Fraction.maximumAllowedNumber){const r=this.numerator/_Fraction.maximumAllowedNumber;this.numerator=Math.round(this.numerator/r),this.denominator=Math.round(this.denominator/r)}}isOnBeat(i){const e=this.distanceFromBeat(i);return Math.abs(e)<_Fraction.FloatInaccuracyTolerance}distanceFromBeat(i){const e=new _Fraction(1,i.Denominator);return this.RealValue%e.RealValue}};let Fraction$1=_Fraction;Fraction$1.maximumAllowedNumber=46340;Fraction$1.FloatInaccuracyTolerance=1e-4;class AbstractExpression{constructor(e){this.placement=e}static isStringInStringList(e,r){for(let s=0,o=e.length;s(i[i.Above=0]="Above",i[i.Below=1]="Below",i[i.Left=2]="Left",i[i.Right=3]="Right",i[i.NotYetDefined=4]="NotYetDefined",i[i.AboveOrBelow=5]="AboveOrBelow",i))(PlacementEnum||{});const _ContinuousDynamicExpression=class extends AbstractExpression{constructor(i,e,r,s,o,a,l=""){super(e),super.parentMeasure=s,this.NumberXml=a,this.dynamicType=i,this.label=l,this.staffNumber=r,this.activeInstantaneousDynamic=o,this.startVolume=1,this.endVolume=1,this.setStartAndEndVolume(),l!==""&&this.setType()}setStartAndEndVolume(){this.activeInstantaneousDynamic&&(this.dynamicType===0&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*1.2),this.dynamicType===1&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*.8))}get DynamicType(){return this.dynamicType}set DynamicType(i){this.dynamicType=i}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(i){this.startMultiExpression=i}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(i){this.endMultiExpression=i}get Placement(){return this.placement}set Placement(i){this.placement=i}get StartVolume(){return this.startVolume}set StartVolume(i){this.startVolume=i}get EndVolume(){return this.endVolume}set EndVolume(i){this.endVolume=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Label(){return this.label}set Label(i){this.label=i,this.setType()}static isInputStringContinuousDynamic(i){return i?_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicIncreasing,i)||_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicDecreasing,i):!1}getInterpolatedDynamic(i){const e=this.StartMultiExpression.AbsoluteTimestamp;let r;if(this.EndMultiExpression?r=this.EndMultiExpression.AbsoluteTimestamp:r=Fraction$1.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),i.lt(e))return-1;if(r.lt(i))return-2;const s=Fraction$1.minus(i,e).RealValue/Fraction$1.minus(r,e).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*s))}isWedge(){return!this.label}setType(){_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicIncreasing,this.label)?this.dynamicType=0:_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=1)}};let ContinuousDynamicExpression=_ContinuousDynamicExpression;ContinuousDynamicExpression.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."];ContinuousDynamicExpression.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"];var ContDynamicEnum=(i=>(i[i.crescendo=0]="crescendo",i[i.diminuendo=1]="diminuendo",i))(ContDynamicEnum||{}),DynamicExpressionSymbolEnum=(i=>(i[i.p=0]="p",i[i.f=1]="f",i[i.s=2]="s",i[i.z=3]="z",i[i.m=4]="m",i[i.r=5]="r",i))(DynamicExpressionSymbolEnum||{});class MusicSheetReadingException{constructor(e,r){this.message=e,r&&(this.message+=" "+r.toString())}}class ArgumentOutOfRangeException{constructor(e){this.message=e}}class InvalidEnumArgumentException{constructor(e){this.message=e}}var loglevelExports={},loglevel={get exports(){return loglevelExports},set exports(i){loglevelExports=i}};(function(i){(function(e,r){i.exports?i.exports=r():e.log=r()})(commonjsGlobal,function(){var e=function(){},r="undefined",s=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"];function a(S,x){var A=S[x];if(typeof A.bind=="function")return A.bind(S);try{return Function.prototype.bind.call(A,S)}catch(E){return function(){return Function.prototype.apply.apply(A,[S,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(S){return S==="debug"&&(S="log"),typeof console===r?!1:S==="trace"&&s?l:console[S]!==void 0?a(console,S):console.log!==void 0?a(console,"log"):e}function c(S,x){for(var A=0;A=0&&M<=E.levels.SILENT){if(w=M,R!==!1&&T(M),c.call(E,M,S),typeof console===r&&M"u"}i.isUndefined=u;function c(m){return Object.prototype.toString.call(m)==="[object String]"}i.isString=c;function d(m){return u(m)||!l(m)?function(g,v){return g=0;a--)if(s(i[a],e))return a;return-1}arrays$4.lastIndexOf=lastIndexOf;function contains(i,e,r){return indexOf$1(i,e,r)>=0}arrays$4.contains=contains;function remove(i,e,r){var s=indexOf$1(i,e,r);return s<0?!1:(i.splice(s,1),!0)}arrays$4.remove=remove;function frequency(i,e,r){for(var s=r||util$a.defaultEquals,o=i.length,a=0,l=0;l=i.length||r<0||r>=i.length)return!1;var s=i[e];return i[e]=i[r],i[r]=s,!0}arrays$4.swap=swap;function toString$1(i){return"["+i.toString()+"]"}arrays$4.toString=toString$1;function forEach(i,e){for(var r=0,s=i;re.size())return!1;var r=!0;return this.forEach(function(s){return e.contains(s)?!0:(r=!1,!1)}),r},i.prototype.remove=function(e){return this.contains(e)?(this.dictionary.remove(e),!0):!1},i.prototype.forEach=function(e){this.dictionary.forEach(function(r,s){return e(s)})},i.prototype.toArray=function(){return this.dictionary.values()},i.prototype.isEmpty=function(){return this.dictionary.isEmpty()},i.prototype.size=function(){return this.dictionary.size()},i.prototype.clear=function(){this.dictionary.clear()},i.prototype.toString=function(){return arrays$3.toString(this.toArray())},i}();_Set.default=Set$1;Object.defineProperty(Bag$1,"__esModule",{value:!0});var util$7=util$b,Dictionary_1$4=Dictionary$2,Set_1$1=_Set,Bag=function(){function i(e){this.toStrF=e||util$7.defaultToString,this.dictionary=new Dictionary_1$4.default(this.toStrF),this.nElements=0}return i.prototype.add=function(e,r){if(r===void 0&&(r=1),util$7.isUndefined(e)||r<=0)return!1;if(this.contains(e))this.dictionary.getValue(e).copies+=r;else{var s={value:e,copies:r};this.dictionary.setValue(e,s)}return this.nElements+=r,!0},i.prototype.count=function(e){return this.contains(e)?this.dictionary.getValue(e).copies:0},i.prototype.contains=function(e){return this.dictionary.containsKey(e)},i.prototype.remove=function(e,r){if(r===void 0&&(r=1),util$7.isUndefined(e)||r<=0)return!1;if(this.contains(e)){var s=this.dictionary.getValue(e);return r>s.copies?this.nElements-=s.copies:this.nElements-=r,s.copies-=r,s.copies<=0&&this.dictionary.remove(e),!0}else return!1},i.prototype.toArray=function(){for(var e=[],r=this.dictionary.values(),s=0,o=r;sthis.nElements||util$6.isUndefined(e))return!1;var s=this.createNode(e);if(this.nElements===0||this.lastNode===null)this.firstNode=s,this.lastNode=s;else if(r===this.nElements)this.lastNode.next=s,this.lastNode=s;else if(r===0)s.next=this.firstNode,this.firstNode=s;else{var o=this.nodeAtIndex(r-1);if(o===null)return!1;s.next=o.next,o.next=s}return this.nElements++,!0},i.prototype.first=function(){if(this.firstNode!==null)return this.firstNode.element},i.prototype.last=function(){if(this.lastNode!==null)return this.lastNode.element},i.prototype.elementAtIndex=function(e){var r=this.nodeAtIndex(e);if(r!==null)return r.element},i.prototype.indexOf=function(e,r){var s=r||util$6.defaultEquals;if(util$6.isUndefined(e))return-1;for(var o=this.firstNode,a=0;o!==null;){if(s(o.element,e))return a;a++,o=o.next}return-1},i.prototype.contains=function(e,r){return this.indexOf(e,r)>=0},i.prototype.remove=function(e,r){var s=r||util$6.defaultEquals;if(this.nElements<1||util$6.isUndefined(e))return!1;for(var o=null,a=this.firstNode;a!==null;){if(s(a.element,e))return o===null?(this.firstNode=a.next,a===this.lastNode&&(this.lastNode=null)):a===this.lastNode?(this.lastNode=o,o.next=a.next,a.next=null):(o.next=a.next,a.next=null),this.nElements--,!0;o=a,a=a.next}return!1},i.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},i.prototype.equals=function(e,r){var s=r||util$6.defaultEquals;return!(e instanceof i)||this.size()!==e.size()?!1:this.equalsAux(this.firstNode,e.firstNode,s)},i.prototype.equalsAux=function(e,r,s){for(;e!==null&&r!==null;){if(!s(e.element,r.element))return!1;e=e.next,r=r.next}return!0},i.prototype.removeElementAtIndex=function(e){if(!(e<0||e>=this.nElements||this.firstNode===null||this.lastNode===null)){var r;if(this.nElements===1)r=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var s=this.nodeAtIndex(e-1);s===null?(r=this.firstNode.element,this.firstNode=this.firstNode.next):s.next===this.lastNode&&(r=this.lastNode.element,this.lastNode=s),s!==null&&s.next!==null&&(r=s.next.element,s.next=s.next.next)}return this.nElements--,r}},i.prototype.forEach=function(e){for(var r=this.firstNode;r!==null&&e(r.element)!==!1;)r=r.next},i.prototype.reverse=function(){for(var e=null,r=this.firstNode,s=null;r!==null;)s=r.next,r.next=e,e=r,r=s;s=this.firstNode,this.firstNode=this.lastNode,this.lastNode=s},i.prototype.toArray=function(){for(var e=[],r=this.firstNode;r!==null;)e.push(r.element),r=r.next;return e},i.prototype.size=function(){return this.nElements},i.prototype.isEmpty=function(){return this.nElements<=0},i.prototype.toString=function(){return arrays$2.toString(this.toArray())},i.prototype.nodeAtIndex=function(e){if(e<0||e>=this.nElements)return null;if(e===this.nElements-1)return this.lastNode;for(var r=this.firstNode,s=0;s0&&(e=e.rightCh);return e},i.prototype.transplant=function(e,r){e.parent===null?this.root=r:e===e.parent.leftCh?e.parent.leftCh=r:e.parent.rightCh=r,r!==null&&(r.parent=e.parent)},i.prototype.removeNode=function(e){if(e.leftCh===null)this.transplant(e,e.rightCh);else if(e.rightCh===null)this.transplant(e,e.leftCh);else{var r=this.minimumAux(e.rightCh);r.parent!==e&&(this.transplant(r,r.rightCh),r.rightCh=e.rightCh,r.rightCh.parent=r),this.transplant(e,r),r.leftCh=e.leftCh,r.leftCh.parent=r}},i.prototype.inorderTraversalAux=function(e,r,s){e===null||s.stop||(this.inorderTraversalAux(e.leftCh,r,s),!s.stop&&(s.stop=r(e.element)===!1,!s.stop&&this.inorderTraversalAux(e.rightCh,r,s)))},i.prototype.levelTraversalAux=function(e,r){var s=new Queue_1$1.default;for(e!==null&&s.enqueue(e),e=s.dequeue()||null;e!=null;){if(r(e.element)===!1)return;e.leftCh!==null&&s.enqueue(e.leftCh),e.rightCh!==null&&s.enqueue(e.rightCh),e=s.dequeue()||null}},i.prototype.preorderTraversalAux=function(e,r,s){e===null||s.stop||(s.stop=r(e.element)===!1,!s.stop&&(this.preorderTraversalAux(e.leftCh,r,s),!s.stop&&this.preorderTraversalAux(e.rightCh,r,s)))},i.prototype.postorderTraversalAux=function(e,r,s){e===null||s.stop||(this.postorderTraversalAux(e.leftCh,r,s),!s.stop&&(this.postorderTraversalAux(e.rightCh,r,s),!s.stop&&(s.stop=r(e.element)===!1)))},i.prototype.minimumAux=function(e){for(;e!=null&&e.leftCh!==null;)e=e.leftCh;return e},i.prototype.maximumAux=function(e){for(;e!=null&&e.rightCh!==null;)e=e.rightCh;return e},i.prototype.heightAux=function(e){return e===null?-1:Math.max(this.heightAux(e.leftCh),this.heightAux(e.rightCh))+1},i.prototype.insertNode=function(e){for(var r=null,s=this.root;s!==null;){var o=this.compare(e.element,s.element);if(o===0)return null;o<0?(r=s,s=s.leftCh):(r=s,s=s.rightCh)}return e.parent=r,r===null?this.root=e:this.compare(e.element,r.element)<0?r.leftCh=e:r.rightCh=e,e},i.prototype.createNode=function(e){return{element:e,leftCh:null,rightCh:null,parent:null}},i}();BSTreeKV$1.default=BSTreeKV;var __extends$2=commonjsGlobal&&commonjsGlobal.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])};return function(e,r){i(e,r);function s(){this.constructor=e}e.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}();Object.defineProperty(BSTree$1,"__esModule",{value:!0});var BSTreeKV_1$1=BSTreeKV$1,BSTree=function(i){__extends$2(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(BSTreeKV_1$1.default);BSTree$1.default=BSTree;var Heap$1={};Object.defineProperty(Heap$1,"__esModule",{value:!0});var collections=util$b,arrays$1=arrays$4,Heap=function(){function i(e){this.data=[],this.compare=e||collections.defaultCompare}return i.prototype.leftChildIndex=function(e){return 2*e+1},i.prototype.rightChildIndex=function(e){return 2*e+2},i.prototype.parentIndex=function(e){return Math.floor((e-1)/2)},i.prototype.minIndex=function(e,r){return r>=this.data.length?e>=this.data.length?-1:e:this.compare(this.data[e],this.data[r])<=0?e:r},i.prototype.siftUp=function(e){for(var r=this.parentIndex(e);e>0&&this.compare(this.data[r],this.data[e])>0;)arrays$1.swap(this.data,r,e),e=r,r=this.parentIndex(e)},i.prototype.siftDown=function(e){for(var r=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e));r>=0&&this.compare(this.data[e],this.data[r])>0;)arrays$1.swap(this.data,r,e),e=r,r=this.minIndex(this.leftChildIndex(e),this.rightChildIndex(e))},i.prototype.peek=function(){if(this.data.length>0)return this.data[0]},i.prototype.add=function(e){return collections.isUndefined(e)?!1:(this.data.push(e),this.siftUp(this.data.length-1),!0)},i.prototype.removeRoot=function(){if(this.data.length>0){var e=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),e}},i.prototype.contains=function(e){var r=collections.compareToEquals(this.compare);return arrays$1.contains(this.data,e,r)},i.prototype.size=function(){return this.data.length},i.prototype.isEmpty=function(){return this.data.length<=0},i.prototype.clear=function(){this.data.length=0},i.prototype.forEach=function(e){arrays$1.forEach(this.data,e)},i}();Heap$1.default=Heap;var LinkedDictionary$1={},__extends$1=commonjsGlobal&&commonjsGlobal.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])};return function(e,r){i(e,r);function s(){this.constructor=e}e.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}();Object.defineProperty(LinkedDictionary$1,"__esModule",{value:!0});var Dictionary_1$3=Dictionary$2,util$4=util$b,LinkedDictionaryPair=function(){function i(e,r){this.key=e,this.value=r}return i.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},i}(),HeadOrTailLinkedDictionaryPair=function(){function i(){this.key=null,this.value=null}return i.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},i}();function isHeadOrTailLinkedDictionaryPair(i){return!i.next}var LinkedDictionary=function(i){__extends$1(e,i);function e(r){var s=i.call(this,r)||this;return s.head=new HeadOrTailLinkedDictionaryPair,s.tail=new HeadOrTailLinkedDictionaryPair,s.head.next=s.tail,s.tail.prev=s.head,s}return e.prototype.appendToTail=function(r){var s=this.tail.prev;s.next=r,r.prev=s,r.next=this.tail,this.tail.prev=r},e.prototype.getLinkedDictionaryPair=function(r){if(!util$4.isUndefined(r)){var s="$"+this.toStr(r),o=this.table[s];return o}},e.prototype.getValue=function(r){var s=this.getLinkedDictionaryPair(r);if(!util$4.isUndefined(s))return s.value},e.prototype.remove=function(r){var s=this.getLinkedDictionaryPair(r);if(!util$4.isUndefined(s))return i.prototype.remove.call(this,r),s.unlink(),s.value},e.prototype.clear=function(){i.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(r,s){var o="$"+this.toStr(s.key);s.next=r.next,s.prev=r.prev,this.remove(r.key),s.prev.next=s,s.next.prev=s,this.table[o]=s,++this.nElements},e.prototype.setValue=function(r,s){if(!(util$4.isUndefined(r)||util$4.isUndefined(s))){var o=this.getLinkedDictionaryPair(r),a=new LinkedDictionaryPair(r,s),l="$"+this.toStr(r);if(util$4.isUndefined(o)){this.appendToTail(a),this.table[l]=a,++this.nElements;return}else return this.replace(o,a),o.value}},e.prototype.keys=function(){var r=[];return this.forEach(function(s,o){r.push(s)}),r},e.prototype.values=function(){var r=[];return this.forEach(function(s,o){r.push(o)}),r},e.prototype.forEach=function(r){for(var s=this.head.next;!isHeadOrTailLinkedDictionaryPair(s);){var o=r(s.key,s.value);if(o===!1)return;s=s.next}},e}(Dictionary_1$3.default);LinkedDictionary$1.default=LinkedDictionary;var MultiDictionary$1={};Object.defineProperty(MultiDictionary$1,"__esModule",{value:!0});var util$3=util$b,Dictionary_1$2=Dictionary$2,arrays=arrays$4,MultiDictionary=function(){function i(e,r,s){s===void 0&&(s=!1),this.dict=new Dictionary_1$2.default(e),this.equalsF=r||util$3.defaultEquals,this.allowDuplicate=s}return i.prototype.getValue=function(e){var r=this.dict.getValue(e);return util$3.isUndefined(r)?[]:arrays.copy(r)},i.prototype.setValue=function(e,r){if(util$3.isUndefined(e)||util$3.isUndefined(r))return!1;var s=this.dict.getValue(e);return util$3.isUndefined(s)?(this.dict.setValue(e,[r]),!0):!this.allowDuplicate&&arrays.contains(s,r,this.equalsF)?!1:(s.push(r),!0)},i.prototype.remove=function(e,r){if(util$3.isUndefined(r)){var s=this.dict.remove(e);return!util$3.isUndefined(s)}var o=this.dict.getValue(e);return!util$3.isUndefined(o)&&arrays.remove(o,r,this.equalsF)?(o.length===0&&this.dict.remove(e),!0):!1},i.prototype.keys=function(){return this.dict.keys()},i.prototype.values=function(){for(var e=this.dict.values(),r=[],s=0,o=e;s-1&&this.insertIdIntoRoot(r,s);for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var a=this.findNodeId(o,e);a>-1&&this.insertIdIntoNode(o,r,a)}},i.prototype.insertIdAfterId=function(e,r){var s=this.findRootId(e);s>-1&&this.insertIdIntoRoot(r,s+1);for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)){var a=this.findNodeId(o,e);a>-1&&this.insertIdIntoNode(o,r,a+1)}},i.prototype.insertIdIntoId=function(e,r){this.nodeInsertAtEnd(e,r),this.nodes[r]=[]},i.prototype.insertIdIntoRoot=function(e,r){if(r===void 0)this.rootInsertAtEnd(e);else if(r<0){var s=this.rootIds.length;this.rootIds.splice(r+s+1,0,e)}else this.rootIds.splice(r,0,e);this.nodes[e]=this.nodes[e]||[]},i.prototype.insertIdIntoNode=function(e,r,s){if(this.nodes[e]=this.nodes[e]||[],this.nodes[r]=this.nodes[r]||[],s===void 0)this.nodeInsertAtEnd(e,r);else if(s<0){var o=this.nodes[e].length;this.nodes[e].splice(s+o+1,0,r)}else this.nodes[e].splice(s,0,r)},i.prototype.moveId=function(e,r,s){var o=e,a=this.findRootId(o);this.nodes[r];for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){this.findNodeId(l,r);break}var u=r,c=this.findRootId(u);this.nodes[r];for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){this.findNodeId(l,r);break}if(a>-1)if(c>-1)switch(this.rootDelete(a),c>a&&c--,s){case Direction.BEFORE:this.insertIdIntoRoot(o,c);break;case Direction.AFTER:this.insertIdIntoRoot(o,c+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(u,o);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(u,o);break}else{this.rootDelete(a);for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){var d=this.findNodeId(l,u);if(d>-1){switch(s){case Direction.BEFORE:this.insertIdIntoNode(l,o,d);break;case Direction.AFTER:this.insertIdIntoNode(l,o,d+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(u,o);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(u,o);break}break}}}else if(c>-1){for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){var d=this.findNodeId(l,o);if(d>-1){this.nodeDeleteAtIndex(l,d);break}}switch(s){case Direction.BEFORE:this.insertIdIntoRoot(o,c);break;case Direction.AFTER:this.insertIdIntoRoot(o,c+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(u,o);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(u,o);break}}else{for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){var d=this.findNodeId(l,o);if(d>-1){this.nodeDeleteAtIndex(l,d);break}}for(var l in this.nodes)if(this.nodes.hasOwnProperty(l)){var d=this.findNodeId(l,u);if(d>-1){switch(s){case Direction.BEFORE:this.insertIdIntoNode(l,o,d);break;case Direction.AFTER:this.insertIdIntoNode(l,o,d+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(u,o);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(u,o);break}break}}}},i.prototype.swapArrayElements=function(e,r,s){var o=e[r];return e[r]=e[s],e[s]=o,e},i.prototype.rootDeleteId=function(e){var r=this.findRootId(e);r>-1&&this.rootDelete(r)},i.prototype.nodeAndSubNodesDelete=function(e){for(var r=[],s=0;s(i[i.pppppp=0]="pppppp",i[i.ppppp=1]="ppppp",i[i.pppp=2]="pppp",i[i.ppp=3]="ppp",i[i.pp=4]="pp",i[i.p=5]="p",i[i.mp=6]="mp",i[i.mf=7]="mf",i[i.f=8]="f",i[i.ff=9]="ff",i[i.fff=10]="fff",i[i.ffff=11]="ffff",i[i.fffff=12]="fffff",i[i.ffffff=13]="ffffff",i[i.sf=14]="sf",i[i.sff=15]="sff",i[i.sfp=16]="sfp",i[i.sfpp=17]="sfpp",i[i.fp=18]="fp",i[i.rf=19]="rf",i[i.rfz=20]="rfz",i[i.sfz=21]="sfz",i[i.sffz=22]="sffz",i[i.fz=23]="fz",i[i.other=24]="other",i))(DynamicEnum||{});InstantaneousDynamicExpression.staticConstructor();class DynamicsContainer{constructor(e,r){e instanceof ContinuousDynamicExpression?this.continuousDynamicExpression=e:e instanceof InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=e),this.staffNumber=r}static Compare(e,r){return e.parMultiExpression().AbsoluteTimestamp.CompareTo(r.parMultiExpression().AbsoluteTimestamp)}parMultiExpression(){if(this.continuousDynamicExpression)return this.continuousDynamicExpression.StartMultiExpression;if(this.instantaneousDynamicExpression)return this.instantaneousDynamicExpression.ParentMultiExpression}}class AbstractNotationInstruction{constructor(e){this.printObject=!0,this.parent=e}get Parent(){return this.parent}set Parent(e){this.parent=e}get PrintObject(){return this.printObject}set PrintObject(e){this.printObject=e}}class RhythmInstruction extends AbstractNotationInstruction{constructor(e,r){super(void 0),this.rhythm=e,this.numerator=e.Numerator,this.denominator=e.Denominator,this.symbolEnum=r}get Rhythm(){return this.rhythm}set Rhythm(e){this.rhythm=e}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(e){this.symbolEnum=e}clone(){return new RhythmInstruction(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(e){const r=this;return r===e?!0:!r||!e?!1:r.numerator===e.numerator&&r.denominator===e.denominator}OperatorNotEqual(e){return this!==e}ToString(){return"Rhythm: "+this.rhythm.toString()}}var RhythmSymbolEnum=(i=>(i[i.NONE=0]="NONE",i[i.COMMON=1]="COMMON",i[i.CUT=2]="CUT",i))(RhythmSymbolEnum||{});class MusicPartManagerIterator{constructor(e,r,s){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.repetitionIterationCountDictKeys=[],this.repetitionIterationCountDictValues=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new Fraction$1(0,1),this.currentEnrolledMeasureTimestamp=new Fraction$1(0,1),this.currentRelativeInMeasureTimestamp=new Fraction$1(0,1),this.currentVerticalContainerInMeasureTimestamp=new Fraction$1(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[],this.SkipInvisibleNotes=!0,this.testNoteIdx=0;try{this.frontReached=!0,this.musicSheet=e,this.currentBpm=e.userStartTempoInBPM,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const o of this.musicSheet.Repetitions)this.setRepetitionIterationCount(o,1);for(let o=0;o=this.JumpResponsibleRepetition.StartIndex&&o.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(o)}}handleRepetitionsAtMeasureEnd(){for(let e=0,r=this.currentMeasure.LastRepetitionInstructions.length;e-1&&this.getRepetitionIterationCount(o)=this.JumpResponsibleRepetition.StartIndex&&o.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(o),this.repetitionIterationCountDictKeys.contains(o))){const a=o.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(o));if(a>=0){this.currentMeasureIndex=a,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=o,this.forwardJumpOccurred=!0;return}a===-2&&(this.endReached=!0)}}}this.currentMeasureIndex++,this.JumpResponsibleRepetition!==void 0&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(e){this.currentMeasureIndex=e.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(e),this.jumpResponsibleRepetition=e,this.backJumpOccurred=!0}activateCurrentRhythmInstructions(){if(this.currentMeasure!==void 0&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&this.currentMeasure.FirstInstructionsStaffEntries[0]!==void 0){const e=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let r=0,s=e.length;r0&&(this.currentDynamicEntryIndex>=e.length||e[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=r.length||r[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex0){this.currentVoiceEntryIndex--;const e=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(e),this.currentVerticalContainerInMeasureTimestamp=e.Timestamp,this.currentTimeStamp=Fraction$1.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.activateCurrentDynamicOrTempoInstructions();const r=this.musicSheet.SelectionEnd;r&&this.currentTimeStamp.lt(r)&&(this.endReached=!1),this.currentMeasureIndex=this.musicSheet.SourceMeasures.indexOf(this.CurrentMeasure);return}else if(this.currentVoiceEntryIndex===0&&this.currentMeasureIndex!==0){const e=this.musicSheet.SourceMeasures[this.currentMeasureIndex-1];this.currentMeasureIndex--,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex];const r=e.VerticalSourceStaffEntryContainers[e.VerticalSourceStaffEntryContainers.length-1];this.currentVoiceEntries=this.getVoiceEntries(r),this.currentVerticalContainerInMeasureTimestamp=r.Timestamp,this.currentVoiceEntryIndex=e.VerticalSourceStaffEntryContainers.length-1,this.currentTimeStamp=Fraction$1.plus(this.currentMeasure.AbsoluteTimestamp,r.Timestamp),this.activateCurrentDynamicOrTempoInstructions();const s=this.musicSheet.SelectionEnd;s&&this.currentTimeStamp.lt(s)&&(this.endReached=!1);return}this.frontReached=!0,this.currentTimeStamp=new Fraction$1(-1,1)}recursiveMove(){var e,r,s,o;if(this.currentVoiceEntryIndex++,this.currentVoiceEntryIndex===0&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!e)return!0;for(let s=0,o=r.length;sr,this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[r].AbsoluteTimestamp,this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>s){const o=this.openSheetMusicDisplay.Sheet.SourceMeasures[s];this.openSheetMusicDisplay.Sheet.SelectionEnd=Fraction$1.plus(o.AbsoluteTimestamp,o.Duration)}this.iterator=this.manager.getIterator(),this.iterator.SkipInvisibleNotes=this.skipInvisibleNotes}getStaffEntryFromVoiceEntry(e){const r=e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,s=e.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(s,r,e.ParentSourceStaffEntry)}updateWithTimestamp(e){const r=this.manager.absoluteEnrolledToSheetTimestamp(e),s=this.graphic.calculateXPositionFromTimestamp(r),o=s[0],a=s[1];this.updateCurrentPageFromSystem(a);const l=s[2];if(!l)return;const u=Math.max(l.parentMeasure.MeasureNumber,1);let c;for(const g of this.graphic.MeasureList[u-1])if(g){c=g;break}const d=this.graphic.calculateCursorPoints(o,a),y=d[0].y,m=d[1].y-y;if(c){if(this.updateWidthAndStyle(c.PositionAndShape,o,y,m),this.openSheetMusicDisplay.FollowCursor){const g=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:g<1e3?"smooth":"auto",block:this.ScrollPosition})}this.cursorElement.style.display=""}}update(){if(this.hidden||this.hidden===void 0||this.hidden===null)return;this.updateCurrentPage();const e=this.Iterator;let r=e.CurrentVisibleVoiceEntries(),s=e.CurrentMeasureIndex,o=0,a=0,l=0,u;if(r.length===0&&!e.FrontReached&&!e.EndReached&&(e.moveToPrevious(),r=e.CurrentVisibleVoiceEntries(),e.moveToNext()),e.FrontReached&&r.length===0){e.moveToNext(),r=e.CurrentVisibleVoiceEntries();const g=this.findVisibleGraphicalMeasure(e.CurrentMeasureIndex);o=g.PositionAndShape.AbsolutePosition.x,u=g.ParentMusicSystem,e.moveToPrevious()}else if(e.EndReached||!e.CurrentVoiceEntries||r.length===0){e.moveToPrevious(),r=e.CurrentVisibleVoiceEntries(),s=e.CurrentMeasureIndex;const g=this.findVisibleGraphicalMeasure(e.CurrentMeasureIndex);o=g.PositionAndShape.AbsolutePosition.x+g.PositionAndShape.Size.width,u=g.ParentMusicSystem,e.moveToNext()}else if(e.CurrentMeasure.isReducedToMultiRest){const g=this.findVisibleGraphicalMeasure(e.CurrentMeasureIndex),v=g.parentSourceMeasure.multipleRestMeasures,S=e.CurrentMeasure.multipleRestMeasureNumber/(v+1),x=g.PositionAndShape.Size.width-g.beginInstructionsWidth;o=g.PositionAndShape.AbsolutePosition.x+g.beginInstructionsWidth+S*x,u=g.ParentMusicSystem}else{const v=r.map(b=>this.getStaffEntryFromVoiceEntry(b)).sort((b,S)=>{var x,A,E,w;return((A=(x=b==null?void 0:b.PositionAndShape)==null?void 0:x.AbsolutePosition)==null?void 0:A.x)<=((w=(E=S==null?void 0:S.PositionAndShape)==null?void 0:E.AbsolutePosition)==null?void 0:w.x)?-1:1})[0];v&&(o=v.PositionAndShape.AbsolutePosition.x,u=v.parentMeasure.ParentMusicSystem)}if(!u)return;a=u.PositionAndShape.AbsolutePosition.y+u.StaffLines[0].PositionAndShape.RelativePosition.y;let c=u.PositionAndShape.AbsolutePosition.y;const d=u.StaffLines[u.StaffLines.length-1];d&&(c+=d.PositionAndShape.RelativePosition.y+d.StaffHeight),l=c-a;const y=this.findVisibleGraphicalMeasure(s);if(!y)return;const m=y.PositionAndShape;if(this.updateWidthAndStyle(m,o,a,l),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const g=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:g<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}findVisibleGraphicalMeasure(e){for(let r=0;r{s.push.apply(s,o.Notes)}),s}GNotesUnderCursor(e){const r=this.VoicesUnderCursor(e),s=[];return r.forEach(o=>{s.push(...o.Notes.map(a=>this.rules.GNote(a)))}),s}updateCurrentPage(){let e=this.iterator.currentTimeStamp;e.RealValue<0&&(e=new Fraction$1(0,0));for(const r of this.graphic.MusicPages)if(r.MusicSystems.last().GetSystemsLastTimeStamp().gt(e)){const o=r.PageNumber;return o!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+o),this.container.appendChild(this.cursorElement)),this.currentPageNumber=o}return 1}get SkipInvisibleNotes(){return this.skipInvisibleNotes}set SkipInvisibleNotes(e){this.skipInvisibleNotes=e,this.iterator.SkipInvisibleNotes=e}get CursorOptions(){return this.cursorOptions}set CursorOptions(e){this.cursorOptions=e}updateCurrentPageFromSystem(e){if(e!=null&&e.Parent){const r=e.Parent.PageNumber;return r!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+r),this.container.appendChild(this.cursorElement)),this.currentPageNumber=r}return 1}Dispose(){this.rules=void 0,this.openSheetMusicDisplay=void 0,this.cursorOptions=void 0}}var DrawingParametersEnum=(i=>(i.allon="allon",i.compact="compact",i.compacttight="compacttight",i.default="default",i.leadsheet="leadsheet",i.preview="preview",i.thumbnail="thumbnail",i))(DrawingParametersEnum||{}),CursorType=(i=>(i[i.Standard=0]="Standard",i[i.ThinLeft=1]="ThinLeft",i[i.ShortThinTopLeft=2]="ShortThinTopLeft",i[i.CurrentArea=3]="CurrentArea",i[i.CurrentAreaLeft=4]="CurrentAreaLeft",i))(CursorType||{}),AlignRestOption=(i=>(i[i.Never=0]="Never",i[i.Always=1]="Always",i[i.Auto=2]="Auto",i))(AlignRestOption||{}),FillEmptyMeasuresWithWholeRests=(i=>(i[i.No=0]="No",i[i.YesVisible=1]="YesVisible",i[i.YesInvisible=2]="YesInvisible",i))(FillEmptyMeasuresWithWholeRests||{}),BackendType=(i=>(i[i.SVG=0]="SVG",i[i.Canvas=1]="Canvas",i))(BackendType||{}),SkyBottomLineBatchCalculatorBackendType=(i=>(i[i.Plain=0]="Plain",i[i.WebGL=1]="WebGL",i))(SkyBottomLineBatchCalculatorBackendType||{});class OSMDOptions{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:DrawingParametersEnum.default}}static BackendTypeFromString(e){return e&&e.toLowerCase()==="canvas"?1:0}}class IXmlElement{constructor(e){if(this.hasAttributes=!1,!e)throw new Error("IXmlElement: expected Element, got undefined");this.elem=e,this.name=e.nodeName.toLowerCase(),e.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=e.attributes[0]),this.hasElements=e.hasChildNodes(),e.childNodes.length===1&&e.childNodes[0].nodeType===Node.TEXT_NODE?this.value=e.childNodes[0].nodeValue:this.value=""}attribute(e){return this.elem.attributes.getNamedItem(e)}attributes(){if(!this.attrs){const e=this.elem.attributes,r=[];for(let s=0;s0){let s;for(let o=0,a=r.length;oo?1:0}getFirstNonNullStaffEntry(){for(let e=0,r=this.staffEntries.length;e(i[i.BaseWritingColor=0]="BaseWritingColor",i[i.FollowingCursor=1]="FollowingCursor",i[i.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",i[i.PlaybackCursor=3]="PlaybackCursor",i[i.Highlighted=4]="Highlighted",i[i.ErrorUnderlay=5]="ErrorUnderlay",i[i.Selected=6]="Selected",i[i.SelectionSymbol=7]="SelectionSymbol",i[i.DebugColor1=8]="DebugColor1",i[i.DebugColor2=9]="DebugColor2",i[i.DebugColor3=10]="DebugColor3",i[i.SplitScreenDivision=11]="SplitScreenDivision",i[i.GreyTransparentOverlay=12]="GreyTransparentOverlay",i[i.MarkedArea1=13]="MarkedArea1",i[i.MarkedArea2=14]="MarkedArea2",i[i.MarkedArea3=15]="MarkedArea3",i[i.MarkedArea4=16]="MarkedArea4",i[i.MarkedArea5=17]="MarkedArea5",i[i.MarkedArea6=18]="MarkedArea6",i[i.MarkedArea7=19]="MarkedArea7",i[i.MarkedArea8=20]="MarkedArea8",i[i.MarkedArea9=21]="MarkedArea9",i[i.MarkedArea10=22]="MarkedArea10",i[i.Comment1=23]="Comment1",i[i.Comment2=24]="Comment2",i[i.Comment3=25]="Comment3",i[i.Comment4=26]="Comment4",i[i.Comment5=27]="Comment5",i[i.Comment6=28]="Comment6",i[i.Comment7=29]="Comment7",i[i.Comment8=30]="Comment8",i[i.Comment9=31]="Comment9",i[i.Comment10=32]="Comment10",i))(OutlineAndFillStyleEnum||{});const OUTLINE_AND_FILL_STYLE_DICT=new Dictionary;OUTLINE_AND_FILL_STYLE_DICT.setValue(0,"Thistle");OUTLINE_AND_FILL_STYLE_DICT.setValue(1,"Aqua");OUTLINE_AND_FILL_STYLE_DICT.setValue(2,"Azure");OUTLINE_AND_FILL_STYLE_DICT.setValue(3,"Bisque");OUTLINE_AND_FILL_STYLE_DICT.setValue(4,"CadetBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(5,"DarkBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(6,"DarkGoldenRod");OUTLINE_AND_FILL_STYLE_DICT.setValue(7,"BlanchedAlmond");OUTLINE_AND_FILL_STYLE_DICT.setValue(8,"Chartreuse");OUTLINE_AND_FILL_STYLE_DICT.setValue(9,"DarkGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(10,"DarkOrange");OUTLINE_AND_FILL_STYLE_DICT.setValue(11,"FireBrick");OUTLINE_AND_FILL_STYLE_DICT.setValue(12,"DarkSalmon");OUTLINE_AND_FILL_STYLE_DICT.setValue(13,"DarkSeaGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(14,"DarkOrchid");OUTLINE_AND_FILL_STYLE_DICT.setValue(15,"Aquamarine");OUTLINE_AND_FILL_STYLE_DICT.setValue(16,"DarkKhaki");OUTLINE_AND_FILL_STYLE_DICT.setValue(17,"ForestGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(18,"AliceBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(19,"DeepPink");OUTLINE_AND_FILL_STYLE_DICT.setValue(20,"Coral");OUTLINE_AND_FILL_STYLE_DICT.setValue(21,"DarkOliveGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(22,"Chocolate");OUTLINE_AND_FILL_STYLE_DICT.setValue(23,"DodgerBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(24,"Blue");OUTLINE_AND_FILL_STYLE_DICT.setValue(25,"Beige");OUTLINE_AND_FILL_STYLE_DICT.setValue(26,"Crimson");OUTLINE_AND_FILL_STYLE_DICT.setValue(27,"Fuchsia");OUTLINE_AND_FILL_STYLE_DICT.setValue(28,"Brown");OUTLINE_AND_FILL_STYLE_DICT.setValue(29,"BlanchedAlmond");OUTLINE_AND_FILL_STYLE_DICT.setValue(30,"CornflowerBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(31,"Cornsilk");OUTLINE_AND_FILL_STYLE_DICT.setValue(32,"DarkGrey");var GraphicalLayers=(i=>(i[i.Background=0]="Background",i[i.Highlight=1]="Highlight",i[i.MeasureError=2]="MeasureError",i[i.SelectionSymbol=3]="SelectionSymbol",i[i.Cursor=4]="Cursor",i[i.PSI_Debug=5]="PSI_Debug",i[i.Notes=6]="Notes",i[i.Comment=7]="Comment",i[i.Debug_above=8]="Debug_above",i))(GraphicalLayers||{}),NoteState=(i=>(i[i.Normal=0]="Normal",i[i.Selected=1]="Selected",i[i.Follow_Confirmed=2]="Follow_Confirmed",i[i.QFeedback_NotFound=3]="QFeedback_NotFound",i[i.QFeedback_OK=4]="QFeedback_OK",i[i.QFeedback_Perfect=5]="QFeedback_Perfect",i[i.Debug1=6]="Debug1",i[i.Debug2=7]="Debug2",i[i.Debug3=8]="Debug3",i))(NoteState||{}),AutoColorSet=(i=>(i.C="#d82c6b",i.D="#F89D15",i.E="#FFE21A",i.F="#4dbd5c",i.G="#009D96",i.A="#43469d",i.B="#76429c",i.Rest="#000000",i))(AutoColorSet||{});class GraphicalLine{constructor(e,r,s=0,o=OutlineAndFillStyleEnum.BaseWritingColor,a=void 0){this.start=e,this.end=r,this.width=s,this.styleId=o,this.colorHex=a}get Start(){return this.start}set Start(e){this.start=e}get End(){return this.end}set End(e){this.end=e}get Width(){return this.width}set Width(e){this.width=e}}class PointF2D{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}static get Empty(){return new PointF2D}static pointsAreEqual(e,r){return e.x===r.x&&e.y===r.y}ToString(){return"["+this.x+", "+this.y+"]"}}var NoteEnum=(i=>(i[i.C=0]="C",i[i.D=2]="D",i[i.E=4]="E",i[i.F=5]="F",i[i.G=7]="G",i[i.A=9]="A",i[i.B=11]="B",i))(NoteEnum||{}),AccidentalEnum=(i=>(i[i.SHARP=0]="SHARP",i[i.FLAT=1]="FLAT",i[i.NONE=2]="NONE",i[i.NATURAL=3]="NATURAL",i[i.DOUBLESHARP=4]="DOUBLESHARP",i[i.DOUBLEFLAT=5]="DOUBLEFLAT",i[i.TRIPLESHARP=6]="TRIPLESHARP",i[i.TRIPLEFLAT=7]="TRIPLEFLAT",i[i.QUARTERTONESHARP=8]="QUARTERTONESHARP",i[i.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",i[i.SLASHFLAT=10]="SLASHFLAT",i[i.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",i[i.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",i[i.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",i[i.SLASHSHARP=14]="SLASHSHARP",i[i.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",i[i.SORI=16]="SORI",i[i.KORON=17]="KORON",i))(AccidentalEnum||{});const _Pitch=class{constructor(i,e,r,s=void 0,o=!1){this.accidental=2,this.fundamentalNote=i,this.octave=e,this.accidental=r,this.accidentalXml=s,this.halfTone=i+(e+_Pitch.octXmlDiff)*12+_Pitch.HalfTonesFromAccidental(r),o||(this.frequency=_Pitch.calcFrequency(this),this.nextFrequency=_Pitch.calcFrequency(this,"next"),this.prevFrequency=_Pitch.calcFrequency(this,"prev"))}static getNoteEnumString(i){switch(i){case 0:return"C";case 2:return"D";case 4:return"E";case 5:return"F";case 7:return"G";case 9:return"A";case 11:return"B";default:return""}}static lineShiftFromNoteEnum(i,e){if(e===0)return[i,0];const r=_Pitch.pitchEnumValues,s=r.indexOf(i);let o=0,a=(s+e)%r.length;return s+e>r.length-1&&(o=1),a<0&&(a=r.length+a,o=-1),[r[a],o]}static CalculateTransposedHalfTone(i,e){const r=i.fundamentalNote+i.AccidentalHalfTones+e;return _Pitch.WrapAroundCheck(r,12)}static WrapAroundCheck(i,e){let r=0;for(;i<0;)i+=e,r--;for(;i>=e;)i-=e,r++;return{overflow:r,halftone:i}}static calcFrequency(i,e){const r=window.DYProjectName==="musicScore"?{"-2":[11,3],"-7":[12],"-9":[5],12:[33,34,35,37,38,2],24:[39]}:{"-2":[4,12,23],"-7":[13],"-9":[6],12:[5,116,55]};let s=0,o;if(i instanceof _Pitch){const d=i;s=d.octave-1,o=d.fundamentalNote-9+d.AccidentalHalfTones}else typeof i=="number"&&(o=i-57);const a=window.DYSubjectId;let l=0;if(window.DYEnvironment==="COLEXIU"&&(r[12]=[120]),window.xmlNeedAdjustVoice){for(const d in r)if(Object.prototype.hasOwnProperty.call(r,d)&&r[d].includes(a)){l=parseFloat(d);break}}let u=o+l;return e==="next"&&u++,e==="prev"&&u--,442*Math.pow(2,s)*Math.pow(2,u/12)}static calcFractionalKey(i){return Math.log(i/440)/Math.LN10*_Pitch.halftoneFactor+57}static fromFrequency(i){const e=_Pitch.calcFractionalKey(i)+.5,r=Math.floor(e/12)-_Pitch.octXmlDiff,s=Math.floor(e)%12;let o=s,a=2;return this.pitchEnumValues.indexOf(o)===-1&&(o=s-1,a=0),new _Pitch(o,r,a)}static fromHalftone(i){const e=Math.floor(i/12)-_Pitch.octXmlDiff,r=i%12;let s=r,o=2;return this.pitchEnumValues.indexOf(s)===-1&&(s=r-1,o=0),new _Pitch(s,e,o)}static ceiling(i){i=i%12;let e=i;return this.pitchEnumValues.indexOf(e)===-1&&(e=i+1),e}static floor(i){i=i%12;let e=i;return this.pitchEnumValues.indexOf(e)===-1&&(e=i-1),e}static HalfTonesFromAccidental(i){switch(i){case 2:return 0;case 0:return 1;case 1:return-1;case 3:return 0;case 4:return 2;case 5:return-2;case 6:return 3;case 7:return-3;case 8:return .5;case 9:return-.5;case 10:return-.51;case 11:return 1.5;case 12:return-1.5;case 13:return .0013;case 14:return .0014;case 15:return-.0015;case 16:return .0016;case 17:return .0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(i){switch(i){case 0:return 2;case 1:return 0;case-1:return 1;case 2:return 4;case-2:return 5;case 3:return 6;case-3:return 7;case .5:return 8;case-.5:return 9;case 1.5:return 11;case-1.5:return 12;default:return i>0&&i<1?8:i<0&&i>-1?9:8}}static accidentalVexflow(i){let e;switch(i){case 3:e="n";break;case 1:e="b";break;case 0:e="#";break;case 4:e="##";break;case 6:e="###";break;case 5:e="bb";break;case 7:e="bbs";break;case 8:e="+";break;case 9:e="d";break;case 10:e="bs";break;case 11:e="++";break;case 12:e="db";break;case 13:e="+-";break;case 14:e="++-";break;case 15:e="bss";break;case 16:e="o";break;case 17:e="k";break}return e}get AccidentalHalfTones(){return _Pitch.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return _Pitch.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(i){if(i>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return i>0?this.getHigherPitchByTransposeFactor(i):i<0?this.getLowerPitchByTransposeFactor(-i):this}DoEnharmonicChange(){switch(this.accidental){case 1:case 5:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=_Pitch.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+_Pitch.octXmlDiff)*12));break;case 0:case 4:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=_Pitch.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+_Pitch.octXmlDiff)*12));break;default:return}}ToString(){let i=_Pitch.accidentalVexflow(this.accidental);return i||(i=""),"Key: "+_Pitch.getNoteEnumString(this.fundamentalNote)+i+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}ToStringShort(i=0){let e=_Pitch.accidentalVexflow(this.accidental);e||(e="");const r=this.octave+i;return _Pitch.getNoteEnumString(this.fundamentalNote)+e+r}get ToStringShortGet(){return this.ToStringShort(0)}OperatorEquals(i){const e=this;return!e||!i?!1:e.FundamentalNote===i.FundamentalNote&&e.Octave===i.Octave&&e.Accidental===i.Accidental}OperatorNotEqual(i){return this!==i}OperatorFundamentalGreaterThan(i){const e=this;return e.Octave===i.Octave?e.FundamentalNote>i.FundamentalNote:e.Octave>i.Octave}OperatorFundamentalLessThan(i){const e=this;return e.Octave===i.Octave?e.FundamentalNote_Pitch.pitchEnumValues.length-1?(s=_Pitch.pitchEnumValues[e+i-_Pitch.pitchEnumValues.length],r++):s=_Pitch.pitchEnumValues[e+i],new _Pitch(s,r,2)}getLowerPitchByTransposeFactor(i){const e=_Pitch.pitchEnumValues.indexOf(this.fundamentalNote);let r=this.octave,s;return e-i<0?(s=_Pitch.pitchEnumValues[_Pitch.pitchEnumValues.length+e-i],r--):s=_Pitch.pitchEnumValues[e-i],new _Pitch(s,r,2)}getNextFundamentalNote(i){let e=_Pitch.pitchEnumValues.indexOf(i);return e=(e+1)%_Pitch.pitchEnumValues.length,_Pitch.pitchEnumValues[e]}getPreviousFundamentalNote(i){const e=_Pitch.pitchEnumValues.indexOf(i);return e>0?_Pitch.pitchEnumValues[e-1]:_Pitch.pitchEnumValues[_Pitch.pitchEnumValues.length-1]}};let Pitch=_Pitch;Pitch.pitchEnumValues=[0,2,4,5,7,9,11];Pitch.halftoneFactor=12/(Math.LN2/Math.LN10);Pitch.octXmlDiff=3;class ClefInstruction extends AbstractNotationInstruction{constructor(e=0,r=0,s=2){super(void 0),this.clefType=0,this.line=2,this.octaveOffset=0,this.line=s,this.clefType=e,this.octaveOffset=r,this.calcParameters()}static getDefaultClefFromMidiInstrument(e){switch(e){case 0:return new ClefInstruction(1,0,4);case 33:return new ClefInstruction(1,0,4);case 34:return new ClefInstruction(1,0,4);case 35:return new ClefInstruction(1,0,4);case 36:return new ClefInstruction(1,0,4);case 37:return new ClefInstruction(1,0,4);case 38:return new ClefInstruction(1,0,4);case 39:return new ClefInstruction(1,0,4);case 43:return new ClefInstruction(1,0,4);default:return new ClefInstruction(0,0,2)}}static getAllPossibleClefs(){const e=[];for(let r=0;r<=2;r++){const s=new ClefInstruction(0,r,2);e.push(s)}for(let r=-2;r<=0;r++){const s=new ClefInstruction(1,r,4);e.push(s)}return e}static isSupportedClef(e){switch(e){case 0:case 1:case 2:case 3:case 4:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(e){this.clefType=e}get Line(){return this.line}set Line(e){this.line=e}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(e){this.octaveOffset=e}get ClefPitch(){return this.clefPitch}set ClefPitch(e){this.clefPitch=e}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(e){this.referenceCyPosition=e}Equals(e){return this===e?!0:!this||!e?!1:this.clefPitch===e.clefPitch&&this.Line===e.Line}NotEqual(e){return!this.Equals(e)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case 0:this.clefPitch=new Pitch(NoteEnum.G,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case 1:this.clefPitch=new Pitch(NoteEnum.F,0+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case 2:this.clefPitch=new Pitch(NoteEnum.C,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case 3:this.clefPitch=new Pitch(NoteEnum.C,2,AccidentalEnum.NONE),this.referenceCyPosition=2;break;case 4:this.clefPitch=new Pitch(NoteEnum.G,0,AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new ArgumentOutOfRangeException("clefType")}}}var ClefEnum=(i=>(i[i.G=0]="G",i[i.F=1]="F",i[i.C=2]="C",i[i.percussion=3]="percussion",i[i.TAB=4]="TAB",i))(ClefEnum||{}),MidiInstrument=(i=>(i[i.None=-1]="None",i[i.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",i[i.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",i[i.Electric_Grand_Piano=2]="Electric_Grand_Piano",i[i.Honky_tonk_Piano=3]="Honky_tonk_Piano",i[i.Electric_Piano_1=4]="Electric_Piano_1",i[i.Electric_Piano_2=5]="Electric_Piano_2",i[i.Harpsichord=6]="Harpsichord",i[i.Clavinet=7]="Clavinet",i[i.Celesta=8]="Celesta",i[i.Glockenspiel=9]="Glockenspiel",i[i.Music_Box=10]="Music_Box",i[i.Vibraphone=11]="Vibraphone",i[i.Marimba=12]="Marimba",i[i.Xylophone=13]="Xylophone",i[i.Tubular_Bells=14]="Tubular_Bells",i[i.Dulcimer=15]="Dulcimer",i[i.Drawbar_Organ=16]="Drawbar_Organ",i[i.Percussive_Organ=17]="Percussive_Organ",i[i.Rock_Organ=18]="Rock_Organ",i[i.Church_Organ=19]="Church_Organ",i[i.Reed_Organ=20]="Reed_Organ",i[i.Accordion=21]="Accordion",i[i.Harmonica=22]="Harmonica",i[i.Tango_Accordion=23]="Tango_Accordion",i[i.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",i[i.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",i[i.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",i[i.Electric_Guitar_clean=27]="Electric_Guitar_clean",i[i.Electric_Guitar_muted=28]="Electric_Guitar_muted",i[i.Overdriven_Guitar=29]="Overdriven_Guitar",i[i.Distortion_Guitar=30]="Distortion_Guitar",i[i.Guitar_harmonics=31]="Guitar_harmonics",i[i.Acoustic_Bass=32]="Acoustic_Bass",i[i.Electric_Bass_finger=33]="Electric_Bass_finger",i[i.Electric_Bass_pick=34]="Electric_Bass_pick",i[i.Fretless_Bass=35]="Fretless_Bass",i[i.Slap_Bass_1=36]="Slap_Bass_1",i[i.Slap_Bass_2=37]="Slap_Bass_2",i[i.Synth_Bass_1=38]="Synth_Bass_1",i[i.Synth_Bass_2=39]="Synth_Bass_2",i[i.Violin=40]="Violin",i[i.Viola=41]="Viola",i[i.Cello=42]="Cello",i[i.Contrabass=43]="Contrabass",i[i.Tremolo_Strings=44]="Tremolo_Strings",i[i.Pizzicato_Strings=45]="Pizzicato_Strings",i[i.Orchestral_Harp=46]="Orchestral_Harp",i[i.Timpani=47]="Timpani",i[i.String_Ensemble_1=48]="String_Ensemble_1",i[i.String_Ensemble_2=49]="String_Ensemble_2",i[i.Synth_Strings_1=50]="Synth_Strings_1",i[i.Synth_Strings_2=51]="Synth_Strings_2",i[i.Choir_Aahs=52]="Choir_Aahs",i[i.Voice_Oohs=53]="Voice_Oohs",i[i.Synth_Voice=54]="Synth_Voice",i[i.Orchestra_Hit=55]="Orchestra_Hit",i[i.Trumpet=56]="Trumpet",i[i.Trombone=57]="Trombone",i[i.Tuba=58]="Tuba",i[i.Muted_Trumpet=59]="Muted_Trumpet",i[i.French_Horn=60]="French_Horn",i[i.Brass_Section=61]="Brass_Section",i[i.Synth_Brass_1=62]="Synth_Brass_1",i[i.Synth_Brass_2=63]="Synth_Brass_2",i[i.Soprano_Sax=64]="Soprano_Sax",i[i.Alto_Sax=65]="Alto_Sax",i[i.Tenor_Sax=66]="Tenor_Sax",i[i.Baritone_Sax=67]="Baritone_Sax",i[i.Oboe=68]="Oboe",i[i.English_Horn=69]="English_Horn",i[i.Bassoon=70]="Bassoon",i[i.Clarinet=71]="Clarinet",i[i.Piccolo=72]="Piccolo",i[i.Flute=73]="Flute",i[i.Recorder=74]="Recorder",i[i.Pan_Flute=75]="Pan_Flute",i[i.Blown_Bottle=76]="Blown_Bottle",i[i.Shakuhachi=77]="Shakuhachi",i[i.Whistle=78]="Whistle",i[i.Ocarina=79]="Ocarina",i[i.Lead_1_square=80]="Lead_1_square",i[i.Lead_2_sawtooth=81]="Lead_2_sawtooth",i[i.Lead_3_calliope=82]="Lead_3_calliope",i[i.Lead_4_chiff=83]="Lead_4_chiff",i[i.Lead_5_charang=84]="Lead_5_charang",i[i.Lead_6_voice=85]="Lead_6_voice",i[i.Lead_7_fifths=86]="Lead_7_fifths",i[i.Lead_8_bass_lead=87]="Lead_8_bass_lead",i[i.Pad_1_new_age=88]="Pad_1_new_age",i[i.Pad_2_warm=89]="Pad_2_warm",i[i.Pad_3_polysynth=90]="Pad_3_polysynth",i[i.Pad_4_choir=91]="Pad_4_choir",i[i.Pad_5_bowed=92]="Pad_5_bowed",i[i.Pad_6_metallic=93]="Pad_6_metallic",i[i.Pad_7_halo=94]="Pad_7_halo",i[i.Pad_8_sweep=95]="Pad_8_sweep",i[i.FX_1_rain=96]="FX_1_rain",i[i.FX_2_soundtrack=97]="FX_2_soundtrack",i[i.FX_3_crystal=98]="FX_3_crystal",i[i.FX_4_atmosphere=99]="FX_4_atmosphere",i[i.FX_5_brightness=100]="FX_5_brightness",i[i.FX_6_goblins=101]="FX_6_goblins",i[i.FX_7_echoes=102]="FX_7_echoes",i[i.FX_8_scifi=103]="FX_8_scifi",i[i.Sitar=104]="Sitar",i[i.Banjo=105]="Banjo",i[i.Shamisen=106]="Shamisen",i[i.Koto=107]="Koto",i[i.Kalimba=108]="Kalimba",i[i.Bag_pipe=109]="Bag_pipe",i[i.Fiddle=110]="Fiddle",i[i.Shanai=111]="Shanai",i[i.Tinkle_Bell=112]="Tinkle_Bell",i[i.Agogo=113]="Agogo",i[i.Steel_Drums=114]="Steel_Drums",i[i.Woodblock=115]="Woodblock",i[i.Taiko_Drum=116]="Taiko_Drum",i[i.Melodic_Tom=117]="Melodic_Tom",i[i.Synth_Drum=118]="Synth_Drum",i[i.Reverse_Cymbal=119]="Reverse_Cymbal",i[i.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",i[i.Breath_Noise=121]="Breath_Noise",i[i.Seashore=122]="Seashore",i[i.Bird_Tweet=123]="Bird_Tweet",i[i.Telephone_Ring=124]="Telephone_Ring",i[i.Helicopter=125]="Helicopter",i[i.Applause=126]="Applause",i[i.Gunshot=127]="Gunshot",i[i.Percussion=128]="Percussion",i))(MidiInstrument||{});const _KeyInstruction=class extends AbstractNotationInstruction{constructor(i=void 0,e=0,r=0){super(i),this.isTransposedBy=0,this.Key=e,this.keyTypeOriginal=e,this.mode=r,this.alteratedNotes=this.calcAlteratedNotes()}static copy(i){const e=new _KeyInstruction(i.parent,i.Key,i.Mode);return e.keyTypeOriginal=i.keyTypeOriginal,e}static getAllPossibleMajorKeyInstructions(){const i=[];for(let e=-7;e<7;e++){const r=new _KeyInstruction(void 0,e,0);i.push(r)}return i}get Key(){return this.keyType}set Key(i){this.keyType=i,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(i){this.mode=i}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const i=[];if(this.keyType>0)for(let e=0;e=0}getAlterationForPitch(i){return this.keyType>0&&this.alteratedNotes.indexOf(i.FundamentalNote)<=this.keyType?AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(i.FundamentalNote)<=Math.abs(this.keyType)?AccidentalEnum.FLAT:AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(i){const e=this;return e===i?!0:!e||!i?!1:e.Key===i.Key&&e.Mode===i.Mode}OperatorNotEqual(i){return!this.OperatorEquals(i)}};let KeyInstruction=_KeyInstruction;KeyInstruction.sharpPositionList=[NoteEnum.F,NoteEnum.C,NoteEnum.G,NoteEnum.D,NoteEnum.A,NoteEnum.E,NoteEnum.B];KeyInstruction.flatPositionList=[NoteEnum.B,NoteEnum.E,NoteEnum.A,NoteEnum.D,NoteEnum.G,NoteEnum.C,NoteEnum.F];var KeyEnum=(i=>(i[i.major=0]="major",i[i.minor=1]="minor",i[i.none=2]="none",i[i.dorian=3]="dorian",i[i.phrygian=4]="phrygian",i[i.lydian=5]="lydian",i[i.mixolydian=6]="mixolydian",i[i.aeolian=7]="aeolian",i[i.ionian=8]="ionian",i[i.locrian=9]="locrian",i))(KeyEnum||{});class SizeF2D{constructor(e=0,r=0){this.width=e,this.height=r}}class RectangleF2D{constructor(e,r,s,o){this.x=0,this.y=0,this.width=0,this.height=0,this.x=e,this.y=r,this.width=s,this.height=o}static createFromLocationAndSize(e,r){return new RectangleF2D(e.x,e.y,r.width,r.height)}get Location(){return new PointF2D(this.x,this.y)}get Size(){return new SizeF2D(this.width,this.height)}}class AClassHierarchyTrackable{isInstanceOfClass(e){let r=this.constructor.prototype;for(;r;){if(e===r.constructor.name)return!0;r=r.__proto__}return!1}}class GraphicalObject extends AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(e){this.boundingBox=e}}class Clickable extends GraphicalObject{}let BoundingBox$1=class{constructor(e=void 0,r=void 0,s=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new PointF2D,this.relativePosition=new PointF2D,this.size=new SizeF2D,this.marginSize=new SizeF2D,this.upperLeftCorner=new PointF2D,this.upperLeftMarginCorner=new PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=r,this.dataObject=e,this.isSymbol=s,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,r&&(this.Parent=r)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(e){this.xBordersHaveBeenSet=e}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(e){this.yBordersHaveBeenSet=e}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(e){this.absolutePosition=e}get RelativePosition(){return this.relativePosition}set RelativePosition(e){this.relativePosition=e,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(e){this.size=e}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(e){this.borderLeft=e,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(e){this.borderRight=e,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(e){this.borderTop=e,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(e){this.borderBottom=e,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(e){this.borderMarginLeft=e,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(e){this.borderMarginTop=e,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(l,1)}this.parent=e,((s=(r=this.parent)==null?void 0:r.ChildElements)==null?void 0:s.indexOf(this))>-1?loglevelExports.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):(a=(o=this.parent)==null?void 0:o.ChildElements)==null||a.push(this)}get DataObject(){return this.dataObject}get Center(){return new PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let e=this.parent;for(;e;)this.absolutePosition.x+=e.relativePosition.x,this.absolutePosition.y+=e.relativePosition.y,e=e.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let e=0,r=this.ChildElements.length;e.001;break;case 2:case 3:o=this.relativePosition.y,e.calculateMarginPositionAlongDirection(this,r),a=Math.abs(o-this.relativePosition.y)>.001;break;default:throw new ArgumentOutOfRangeException("direction")}while(a)}collisionDetection(e){const r=Math.min(this.AbsolutePosition.x+this.borderRight,e.absolutePosition.x+e.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,e.absolutePosition.x+e.borderLeft),s=Math.min(this.AbsolutePosition.y+this.borderBottom,e.absolutePosition.y+e.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,e.absolutePosition.y+e.borderTop);return r>0&&s>0}liesInsideBorders(e){const r=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderLeft&&e.absolutePosition.x+e.borderLeft<=this.AbsolutePosition.x+this.borderRight,s=this.AbsolutePosition.x+this.borderLeft<=e.absolutePosition.x+e.borderRight&&e.absolutePosition.x+e.borderRight<=this.AbsolutePosition.x+this.borderRight;if(r&&s){const o=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderTop&&e.absolutePosition.y+e.borderTop<=this.AbsolutePosition.y+this.borderBottom,a=this.AbsolutePosition.y+this.borderTop<=e.absolutePosition.y+e.borderBottom&&e.absolutePosition.y+e.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(o&&a)return!0}return!1}pointLiesInsideBorders(e){return this.AbsolutePosition.x+this.borderLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(e){const r=Math.min(this.AbsolutePosition.x+this.borderMarginRight,e.absolutePosition.x+e.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,e.absolutePosition.x+e.borderMarginLeft),s=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,e.absolutePosition.y+e.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,e.absolutePosition.y+e.borderMarginTop);return r>0&&s>0}liesInsideMargins(e){const r=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginLeft&&e.absolutePosition.x+e.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,s=this.AbsolutePosition.x+this.borderMarginLeft<=e.absolutePosition.x+e.borderMarginRight&&e.absolutePosition.x+e.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(r&&s){const o=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginTop&&e.absolutePosition.y+e.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,a=this.AbsolutePosition.y+this.borderMarginTop<=e.absolutePosition.y+e.borderMarginBottom&&e.absolutePosition.y+e.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(o&&a)return!0}return!1}pointLiesInsideMargins(e){return this.AbsolutePosition.x+this.borderMarginLeft<=e.x&&e.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=e.y&&e.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(e,r,s){this.RelativePosition=new PointF2D(s.x,s.y),this.setAbsolutePositionFromParent();let o=0,a=!1;do switch(r){case 0:case 1:o=this.relativePosition.x,e.calculatePositionAlongDirection(this,r),a=Math.abs(o-this.relativePosition.x)>1e-4;break;case 2:case 3:o=this.relativePosition.y,e.calculatePositionAlongDirection(this,r),a=Math.abs(o-this.relativePosition.y)>1e-4;break;default:throw new ArgumentOutOfRangeException("direction")}while(a)}getClickedObjectOfType(e){const r=this.dataObject;if(this.pointLiesInsideBorders(e)&&r)return r;for(let s=0,o=this.childElements.length;s(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.NotYetDefined=4]="NotYetDefined",i))(ColDirEnum||{});Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,writable:!0,value:function(){return this[this.length-1]}});Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,writable:!0,value:function(){this.length=0}});Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,writable:!0,value:function(i){return this.indexOf(i)!==-1}});class CollectionUtil{static contains2(e,r){for(let s=0;s(i[i.Down=0]="Down",i[i.Right=1]="Right",i[i.RightDown=2]="RightDown",i))(PagePlacementEnum||{}),TextAlignmentEnum=(i=>(i[i.LeftTop=0]="LeftTop",i[i.LeftCenter=1]="LeftCenter",i[i.LeftBottom=2]="LeftBottom",i[i.CenterTop=3]="CenterTop",i[i.CenterCenter=4]="CenterCenter",i[i.CenterBottom=5]="CenterBottom",i[i.RightTop=6]="RightTop",i[i.RightCenter=7]="RightCenter",i[i.RightBottom=8]="RightBottom",i))(TextAlignmentEnum||{});class TextAlignment{static IsLeft(e){return e===0||e===1||e===2}static IsCenterAligned(e){return e===3||e===4||e===5}static IsRight(e){return e===6||e===7||e===8}}var ColoringModes=(i=>(i[i.XML=0]="XML",i[i.AutoColoring=1]="AutoColoring",i[i.CustomColorSet=2]="CustomColorSet",i))(ColoringModes||{}),FontStyles=(i=>(i[i.Regular=0]="Regular",i[i.Bold=1]="Bold",i[i.Italic=2]="Italic",i[i.BoldItalic=3]="BoldItalic",i[i.Underlined=4]="Underlined",i))(FontStyles||{}),Fonts=(i=>(i[i.TimesNewRoman=0]="TimesNewRoman",i[i.Kokila=1]="Kokila",i[i.Gonville=2]="Gonville",i))(Fonts||{});const FontStringNames={0:"Times New Roman",1:"Kokila",2:"Gonville"};var TieTypes=(i=>(i.SIMPLE="",i.HAMMERON="H",i.PULLOFF="P",i.SLIDE="S",i.TAPPING="T",i))(TieTypes||{});class ChordSymbolContainer{constructor(e,r,s,o,a){this.rootPitch=e,this.chordKind=r,this.bassPitch=s,this.degrees=o,this.rules=a}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(e,r,s){let o=e.RootPitch;if(MusicSheetCalculator.transposeCalculator&&(o=MusicSheetCalculator.transposeCalculator.transposePitch(e.RootPitch,s,r)),e.ChordKind===31)return e.getTextFromChordKindEnum(e.ChordKind);let a=Pitch.getNoteEnumString(o.FundamentalNote);o.Accidental!==AccidentalEnum.NONE&&(a+=e.getTextForAccidental(o.Accidental));const l={adds:[],alts:[],subs:[]};for(const y of e.ChordDegrees)if(y){let m="";switch(y.alteration!==AccidentalEnum.NONE&&(m+=e.getTextForAccidental(y.alteration)),m+=y.value,y.text){case 0:l.adds.push(m);break;case 1:l.alts.push(m);break;case 2:l.subs.push(m);break}}let u=e.getTextFromChordKindEnum(e.ChordKind);const c=["adds","alts","subs"],d=e.rules.CustomChords;for(const y of d){if(y.chordKind!==e.chordKind)continue;let m=!0;for(const g of c){for(const v of y.degrees[g]||[])if(l[g].indexOf(v)<0){m=!1;break}if(!m)break}if(m){for(const g of c)for(const v of y.degrees[g]||[])l[g].splice(l[g].indexOf(v),1);u=y.alternateName}}if(a+=u,l.adds.length>0&&(a+="("+l.adds.join(",")+")"),l.alts.length>0&&(a+="(alt "+l.alts.join(",")+")"),l.subs.length>0&&(a+="(omit "+l.subs.join(",")+")"),e.BassPitch){let y=e.BassPitch;MusicSheetCalculator.transposeCalculator&&(y=MusicSheetCalculator.transposeCalculator.transposePitch(e.BassPitch,s,r)),a+="/",a+=Pitch.getNoteEnumString(y.FundamentalNote),a+=e.getTextForAccidental(y.Accidental)}return a}getTextForAccidental(e){const r=this.rules.ChordAccidentalTexts.getValue(e);return r!==void 0?r:""}getTextFromChordKindEnum(e){var r;return(r=this.rules.ChordSymbolLabelTexts.getValue(e))!=null?r:""}}class Degree{constructor(e,r,s){this.value=e,this.alteration=r,this.text=s}}class CustomChord{constructor(e,r,s){this.alternateName=e,this.chordKind=r,this.degrees=s}static createCustomChord(e,r,s){return new CustomChord(e,r,s)}static renameCustomChord(e,r,s){for(const o of s)o.alternateName===e&&(o.alternateName=r)}}var ChordDegreeText=(i=>(i[i.add=0]="add",i[i.alter=1]="alter",i[i.subtract=2]="subtract",i))(ChordDegreeText||{}),ChordSymbolEnum=(i=>(i[i.major=0]="major",i[i.minor=1]="minor",i[i.augmented=2]="augmented",i[i.diminished=3]="diminished",i[i.dominant=4]="dominant",i[i.majorseventh=5]="majorseventh",i[i.minorseventh=6]="minorseventh",i[i.diminishedseventh=7]="diminishedseventh",i[i.augmentedseventh=8]="augmentedseventh",i[i.halfdiminished=9]="halfdiminished",i[i.majorminor=10]="majorminor",i[i.majorsixth=11]="majorsixth",i[i.minorsixth=12]="minorsixth",i[i.dominantninth=13]="dominantninth",i[i.majorninth=14]="majorninth",i[i.minorninth=15]="minorninth",i[i.dominant11th=16]="dominant11th",i[i.major11th=17]="major11th",i[i.minor11th=18]="minor11th",i[i.dominant13th=19]="dominant13th",i[i.major13th=20]="major13th",i[i.minor13th=21]="minor13th",i[i.suspendedsecond=22]="suspendedsecond",i[i.suspendedfourth=23]="suspendedfourth",i[i.Neapolitan=24]="Neapolitan",i[i.Italian=25]="Italian",i[i.French=26]="French",i[i.German=27]="German",i[i.pedal=28]="pedal",i[i.power=29]="power",i[i.Tristan=30]="Tristan",i[i.none=31]="none",i))(ChordSymbolEnum||{});class GraphicalNote extends GraphicalObject{constructor(e,r,s,o=void 0){super(),this.DrawnAccidental=AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=e,this.parentVoiceEntry=r,this.PositionAndShape=new BoundingBox$1(this,r.PositionAndShape),o?this.graphicalNoteLength=o:this.graphicalNoteLength=e.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=s,this.rules.addGraphicalNoteToNoteMap(e,this)}Transpose(e,r,s,o){let a=this.sourceNote.Pitch;return MusicSheetCalculator.transposeCalculator&&(a=MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,e,s)),a}calculateNumberOfNeededDots(e){return!this.sourceNote||!this.sourceNote.NoteTuplet?e.calculateNumberOfNeededDots():0}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(e,r){return r.NoteToGraphicalNoteMap.getValue(e.NoteToGraphicalNoteObjectId)}ToStringShort(e=0){var r;return(r=this.sourceNote)==null?void 0:r.ToStringShort(e)}get ToStringShortGet(){return this.ToStringShort(0)}}const _EngravingRules=class{constructor(){this.DYSlursStartingAtSameStaffEntryYOffset=0,this.DYMinNoteWidth=0,this.DYWorkId=0,this.DYWorkSpecial=!1,this.DYContainerId="osmdCanvasPage",this.DYSVGContainerId="osmdSvgPage",this.DYMusicScoreType="staff",this.DYMusicScoreId="",this.DYCustomRepeatCount=0,this.DYMusicClientType="",this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.RenderCount=0,this.PlayAlreadyStartedNotesFromCursorPosition=!1,this.PlaybackSkipNotesSafetyInterval=.02,this.UseDefaultVoiceInteractionListener=!0,this.LimitCursorPositionToCurrentMeasure=!0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=_EngravingRules.unit*3,this.MpatMode=!0,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.SheetCopyrightHeight=1.5,this.SheetCopyrightMargin=2,this.SheetComposerSubtitleUseLegacyParsing=!1,this.CompactMode=!1,this.PagePlacementEnum=PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=_EngravingRules.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.SystemLyricistDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.AutoBeamTabs=!1,this.BeamWidth=_EngravingRules.unit/2,this.BeamSpaceWidth=_EngravingRules.unit/3,this.BeamForwardLength=1.25*_EngravingRules.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.PercussionUseCajon2NoteSystem=!1,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.GraceNoteGroupXMargin=0,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.SoftAccentWedgePadding=.4,this.SoftAccentSizeFactor=.6,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolExtraXShiftForShortChordSymbols=.3,this.ChordSymbolExtraXShiftWidthThreshold=2,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolWholeMeasureRestXOffset=0,this.ChordSymbolWholeMeasureRestXOffsetMeasure1=-2,this.ChordAccidentalTexts=new Dictionary,this.resetChordAccidentalTexts(this.ChordAccidentalTexts,!1),this.ChordSymbolLabelTexts=new Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RepetitionEndInstructionXShiftAsPercentOfStaveWidth=.4,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*_EngravingRules.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletsBracketedUseXMLValue=!0,this.TupletNumberLabelHeight=1.5*_EngravingRules.unit,this.TupletNumberYOffset=.5,this.TupletNumberLimitConsecutiveRepetitions=!0,this.TupletNumberMaxConsecutiveRepetitions=2,this.TupletNumberAlwaysDisableAfterFirstMax=!0,this.TupletNumberUseShowNoneXMLValue=!0,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!0,this.TabTupletYOffsetBottom=1,this.TabTupletYOffsetTop=-3.5,this.TabTupletYOffsetEffects=1.5,this.TabTupletsBracketed=!0,this.TabBeamsRendered=!0,this.TabKeySignatureRendered=!1,this.TabKeySignatureSpacingAdded=!0,this.TabTimeSignatureRendered=!1,this.TabTimeSignatureSpacingAdded=!0,this.TabFingeringsRendered=!1,this.SlurPlacementFromXML=!0,this.SlurPlacementAtStems=!1,this.SlurPlacementUseSkyBottomLine=!1,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurEndArticulationYOffset=.8,this.SlurStartArticulationYOffsetOfArticulation=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.SlurMaximumYControlPointDistance=void 0,this.GlissandoNoteOffset=.5,this.GlissandoStafflineStartMinimumWidth=1,this.GlissandoStafflineStartYDistanceToNote=.8,this.GlissandoStafflineEndOffset=1,this.GlissandoDefaultWidth=.1,this.RepetitionAllowFirstMeasureBeginningRepeatBarline=!1,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.LyricsYMarginToBottomLine=.2,this.LyricsExtraXShiftForShortLyrics=.5,this.LyricsExtraXShiftForShortLyricsWidthThreshold=1.4,this.LyricsUseXPaddingForLongLyrics=!0,this.LyricsXPaddingFactorForLongLyrics=1,this.LyricsXPaddingWidthThreshold=1.7,this.LyricsXPaddingReductionForLongNotes=.7,this.LyricsXPaddingReductionForLastNoteInMeasure=1.2,this.LyricsXPaddingForLastNoteInMeasure=!0,this.VerticalBetweenLyricsDistance=2,this.HorizontalBetweenLyricsDistance=5,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.TempoYSpacing=.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.IgnoreRepeatedDynamics=!1,this.ExpressionsUseXMLColor=!0,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.TremoloBuzzRollThickness=.25,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=_EngravingRules.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=_EngravingRules.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=_EngravingRules.unit,this.OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure=!1,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MultipleRestMeasureAddKeySignature=!0,this.FixedMeasureWidth=!1,this.FixedMeasureWidthFixedValue=void 0,this.FixedMeasureWidthUseForPickupMeasures=!1,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,this.VoiceSpacingMultiplierVexflow=1,this.VoiceSpacingAddendVexflow=5,this.PickupMeasureWidthMultiplier=1,this.PickupMeasureRepetitionSpacing=.8,this.PickupMeasureSpacingSingleNoteAddend=1.6,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-1,this.SoftmaxFactorVexFlow=15,this.StaggerSameWholeNotes=!0,this.AlignRests=AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.RenderGlissandi=!0,this.ColoringMode=ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderCopyright=!1,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderSystemLabelsAfterFirstPage=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMultipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.RenderPedals=!0,this.RenderWavyLines=!0,this.ArticulationPlacementFromXML=!0,this.BreathMarkDistance=.8,this.FingeringPosition=PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.NewSystemAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,this.IgnoreBracketsWords=!0,this.PlaceWordsInsideStafflineFromXml=!1,this.PlaceWordsInsideStafflineYOffset=.9,this.UseJustifiedBuilder=!0,this.PageFormat=PageFormat.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.PerformanceMode=!1,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0,this.SkyBottomLineBatchMinMeasures=5,this.SkyBottomLineWebGLMinMeasures=80,this.AlwaysSetPreferredSkyBottomLineBackendAutomatically=!0,this.DisableWebGLInFirefox=!0,this.DisableWebGLInSafariAndIOS=!0,this.setPreferredSkyBottomLineBackendAutomatically();try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(i){loglevelExports.info("EngravingRules()",i)}this.MpatMode&&(this.NewPartAndSystemAfterFinalBarline=!0)}setPreferredSkyBottomLineBackendAutomatically(i=-1){var o,a,l,u;let e="",r="";typeof globalThis=="object"&&(e=(a=(o=globalThis.navigator)==null?void 0:o.vendor)!=null?a:"",r=(u=(l=globalThis.navigator)==null?void 0:l.userAgent)!=null?u:"");let s=!1;(this.DisableWebGLInSafariAndIOS&&/apple/i.test(e)||this.DisableWebGLInFirefox&&r.includes("Firefox"))&&(s=!0),this.PreferredSkyBottomLineBatchCalculatorBackend=SkyBottomLineBatchCalculatorBackendType.Plain,s||i>=this.SkyBottomLineWebGLMinMeasures&&(this.PreferredSkyBottomLineBatchCalculatorBackend=SkyBottomLineBatchCalculatorBackendType.WebGL)}applyDefaultColorMusic(i){this.DefaultColorMusic=i,this.DefaultColorNotehead=i,this.DefaultColorRest=i,this.DefaultColorStem=i,this.DefaultColorLabel=i,this.DefaultColorLyrics=i,this.DefaultColorTitle=i,this.LedgerLineColorDefault=i}addGraphicalNoteToNoteMap(i,e){i.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(i.NoteToGraphicalNoteObjectId,e),this.NoteToGraphicalNoteMapObjectCount++}GNote(i){return GraphicalNote.FromNote(i,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}resetChordAccidentalTexts(i,e){i.setValue(AccidentalEnum.SHARP,e?"♯":"#"),i.setValue(AccidentalEnum.FLAT,e?"♭":"b"),i.setValue(AccidentalEnum.DOUBLEFLAT,e?"𝄫":"bb"),i.setValue(AccidentalEnum.DOUBLESHARP,e?"𝄪":"x")}setChordSymbolLabelText(i,e){this.ChordSymbolLabelTexts.setValue(i,e)}resetChordSymbolLabelTexts(i){return i.setValue(ChordSymbolEnum.minor,"m"),i.setValue(ChordSymbolEnum.augmented,"aug"),i.setValue(ChordSymbolEnum.diminished,"dim"),i.setValue(ChordSymbolEnum.dominant,"7"),i.setValue(ChordSymbolEnum.majorseventh,"maj7"),i.setValue(ChordSymbolEnum.minorseventh,"m7"),i.setValue(ChordSymbolEnum.diminishedseventh,"dim7"),i.setValue(ChordSymbolEnum.augmentedseventh,"aug7"),i.setValue(ChordSymbolEnum.halfdiminished,`m7${this.ChordAccidentalTexts.getValue(AccidentalEnum.FLAT)}5`),i.setValue(ChordSymbolEnum.majorminor,"m(maj7)"),i.setValue(ChordSymbolEnum.majorsixth,"maj6"),i.setValue(ChordSymbolEnum.minorsixth,"m6"),i.setValue(ChordSymbolEnum.dominantninth,"9"),i.setValue(ChordSymbolEnum.majorninth,"maj9"),i.setValue(ChordSymbolEnum.minorninth,"m9"),i.setValue(ChordSymbolEnum.dominant11th,"11"),i.setValue(ChordSymbolEnum.major11th,"maj11"),i.setValue(ChordSymbolEnum.minor11th,"m11"),i.setValue(ChordSymbolEnum.dominant13th,"13"),i.setValue(ChordSymbolEnum.major13th,"maj13"),i.setValue(ChordSymbolEnum.minor13th,"m13"),i.setValue(ChordSymbolEnum.suspendedsecond,"sus2"),i.setValue(ChordSymbolEnum.suspendedfourth,"sus4"),i.setValue(ChordSymbolEnum.power,"5"),i.setValue(ChordSymbolEnum.none,"N.C."),i}addChordName(i,e,r,s,o){if(ChordSymbolEnum[e]!==void 0){const a={adds:r,alts:s,subs:o};this.CustomChords.push(CustomChord.createCustomChord(i,ChordSymbolEnum[e],a))}}renameChord(i,e){CustomChord.renameCustomChord(i,e,this.CustomChords)}resetChordNames(){const i=this.ChordAccidentalTexts.getValue(AccidentalEnum.SHARP),e=this.ChordAccidentalTexts.getValue(AccidentalEnum.FLAT);this.addChordName("alt","major",[`${i}5`,`${e}9`,`${i}9`],[`${e}5`],[]),this.addChordName("7alt","dominant",[`${i}5`,`${e}9`,`${i}9`],[`${e}5`],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName(`m7${e}5`,"minorseventh",[],[`${e}5`],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let i=0;i{var s,o,a,l;return((o=(s=r.sourceNote.Pitch)==null?void 0:s.getHalfTone())!=null?o:0)-((l=(a=e.sourceNote.Pitch)==null?void 0:a.getHalfTone())!=null?l:0)}),this.notes}sortForVexflow(){return this.notes.sort((e,r)=>{var s,o,a;return((o=(s=e.sourceNote.Pitch)==null?void 0:s.getHalfTone())!=null?o:0)-((a=r.sourceNote.Pitch.getHalfTone())!=null?a:0)}),this.notes}color(){}}class GraphicalMusicSheet{constructor(e,r){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=e,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=r,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get JianpuKeySignature(){return this.jianpuKeySignature}set JianpuKeySignature(e){this.jianpuKeySignature=e}get MusicPages(){return this.musicPages}set MusicPages(e){this.musicPages=e}get MeasureList(){return this.measureList}set MeasureList(e){this.measureList=e}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(e){this.verticalGraphicalStaffEntryContainers=e}get Title(){return this.title}set Title(e){this.title=e}get Subtitle(){return this.subtitle}set Subtitle(e){this.subtitle=e}get Composer(){return this.composer}set Composer(e){this.composer=e}get Lyricist(){return this.lyricist}set Lyricist(e){this.lyricist=e}get Copyright(){return this.copyright}set Copyright(e){this.copyright=e}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(e){this.minAllowedSystemWidth=e}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(e){this.leadSheet=e}static transformRelativeToAbsolutePosition(e){for(let r=0;r=0;o--){const a=(s=this.measureList[o])==null?void 0:s[r];if(a)return a}}findGraphicalStaffEntryFromMeasureList(e,r,s){for(let o=r;o0)return l.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(e,r){const s=[],o=this.measureList[0].length;for(let a=e;a<=r;a++)for(let l=0;l=0;r--){if(this.verticalGraphicalStaffEntryContainers[r].AbsoluteTimestamp.lt(e)){const s=new VerticalGraphicalStaffEntryContainer(this.numberOfStaves,e);return this.verticalGraphicalStaffEntryContainers.splice(r+1,0,s),s}if(this.verticalGraphicalStaffEntryContainers[r].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers[r]}}GetVerticalContainerFromTimestamp(e,r=0){const s=CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new VerticalGraphicalStaffEntryContainer(0,e),VerticalGraphicalStaffEntryContainer.compareByTimestamp,r);if(s>=0)return this.verticalGraphicalStaffEntryContainers[s]}GetInterpolatedIndexInVerticalContainers(e){const r=this.verticalGraphicalStaffEntryContainers;if(r.length===1)return 0;let s=0,o=r.length-1,a,l;if(e.lte(r[r.length-1].AbsoluteTimestamp)){for(;o-s>1;){const y=Math.floor((o+s)/2);if(r[s].AbsoluteTimestamp.Equals(e)){o=s;break}else if(r[o].AbsoluteTimestamp.Equals(e)){s=o;break}else{if(r[y].AbsoluteTimestamp.Equals(e))return this.verticalGraphicalStaffEntryContainers.indexOf(r[y]);e.lt(r[y].AbsoluteTimestamp)?o=y:s=y}}if(s===o)return this.verticalGraphicalStaffEntryContainers.indexOf(r[s]);a=r[s].AbsoluteTimestamp,l=r[o].AbsoluteTimestamp}else a=r[r.length-1].AbsoluteTimestamp,l=Fraction$1.plus(this.getLongestStaffEntryDuration(r.length-1),a),o=r.length;const u=l.RealValue-a.RealValue,c=l.RealValue-e.RealValue,d=o-c/u;return Math.min(d,this.verticalGraphicalStaffEntryContainers.length-1)}getVisibleStavesIndicesFromSourceMeasure(e){const r=[],s=[];for(let o=0,a=e.length;o=0;)o=this.measureList[--s][e];return this.measureList[s][e]}getMeasureIndex(e,r,s){for(r=0;r{var s;return((s=r.parentStaffEntry)==null?void 0:s.relInMeasureTimestamp)!==void 0})}GetNearestNote(e,r){const s=this.GetNearestVoiceEntry(e);if(!s)return;let o,a=Number.MAX_SAFE_INTEGER;for(const l of s.notes){const u=l.PositionAndShape.AbsolutePosition.y,c=Math.abs(l.PositionAndShape.AbsolutePosition.x-e.x),d=Math.abs(u-e.y);c+dl.PositionAndShape.RelativePosition.x&&(s=l):s=l)}}catch(o){loglevelExports.info("GraphicalMusicSheet.getStaffEntry",o)}return s}GetPreviousVisibleContainerIndex(e){for(let r=e-1;r>=0;r--){const s=this.verticalGraphicalStaffEntryContainers[r].StaffEntries;for(let o=0,a=s.length;o=0;a--)if(s=this.getStaffEntry(a),s)if(r){if(s.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return s}else return s}findClosestRightStaffEntry(e,r){let s;const o=Math.max(0,Math.ceil(e));for(let a=o;a1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let e=new Fraction$1(0,1);const r=[];for(let s=0,o=this.staffEntries.length;s0&&l.Add(c.notes[0].graphicalNoteLength);e.lt(l)&&(e=Fraction$1.createFromFraction(l))}return e}addGraphicalStaffEntry(e){this.staffEntries.push(e)}addGraphicalStaffEntryAtTimestamp(e){if(e)if(this.staffEntries.length===0||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(e.relInMeasureTimestamp))this.staffEntries.push(e);else for(let r=this.staffEntries.length-1;r>=0;r--){if(this.staffEntries[r].relInMeasureTimestamp.lt(e.relInMeasureTimestamp)){this.staffEntries.splice(r+1,0,e);break}r===0&&this.staffEntries.splice(r,0,e)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!0:this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!1:this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const e=this.parentSourceMeasure;return e?e.beginsWithLineRepetition():!1}endsWithLineRepetition(){const e=this.parentSourceMeasure;return e?e.endsWithLineRepetition():!1}beginsWithWordRepetition(){const e=this.parentSourceMeasure;return e?e.beginsWithWordRepetition():!1}endsWithWordRepetition(){const e=this.parentSourceMeasure;return e?e.endsWithWordRepetition():!1}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}const Vex=()=>{};Vex.L=(i,e)=>{if(!e)return;const r=Array.prototype.slice.call(e).join(" ");window.console.log(i+": "+r)};Vex.MakeException=i=>class extends Error{constructor(r,s){super(r),this.name=i,this.message=r,this.data=s}};class RuntimeError{constructor(e,r){this.code=e,this.message=r}toString(){return"[RuntimeError] "+this.code+":"+this.message}}Vex.RuntimeError=RuntimeError;Vex.RERR=Vex.RuntimeError;Vex.Merge=(i,e)=>{for(const r in e)i[r]=e[r];return i};Vex.Min=Math.min;Vex.Max=Math.max;Vex.forEach=(i,e)=>{for(let r=0;ri%e>=e/2?parseInt(i/e,10)*e+e:parseInt(i/e,10)*e;Vex.MidLine=(i,e)=>{let r=e+(i-e)/2;return r%2>0&&(r=Vex.RoundN(r*10,5)/10),r};Vex.SortAndUnique=(i,e,r)=>{if(i.length>1){const s=[];let o;i.sort(e);for(let a=0;a{let r=i.length;for(;r--;)if(i[r]===e)return!0;return!1};Vex.getCanvasContext=i=>{if(!i)throw new Vex.RERR("BadArgument","Invalid canvas selector: "+i);const e=document.getElementById(i);if(!(e&&e.getContext))throw new Vex.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")};Vex.drawDot=(i,e,r,s="#55")=>{i.save(),i.setFillStyle(s),i.beginPath(),i.arc(e,r,3,0,Math.PI*2,!0),i.closePath(),i.fill(),i.restore()};Vex.BM=(i,e)=>{const r=new Date().getTime();e();const s=new Date().getTime()-r;Vex.L(i+s+"ms")};Vex.StackTrace=()=>new Error().stack;Vex.W=(...i)=>{const e=i.join(" ");window.console.log("Warning: ",e,Vex.StackTrace())};Vex.Prefix=i=>Vex.Prefix.prefix+i;Vex.Prefix.prefix="vf-";class Fraction{static GCD(e,r){if(typeof e!="number"||typeof r!="number")throw new Vex.RERR("BadArgument",`Invalid numbers: ${e}, ${r}`);let s;for(;r!==0;)s=r,r=e%r,e=s;return e}static LCM(e,r){return e*r/Fraction.GCD(e,r)}static LCMM(e){if(e.length===0)return 0;if(e.length===1)return e[0];if(e.length===2)return Fraction.LCM(e[0],e[1]);{const r=e[0];return e.shift(),Fraction.LCM(r,Fraction.LCMM(e))}}constructor(e,r){this.set(e,r)}set(e,r){return this.numerator=e===void 0?1:e,this.denominator=r===void 0?1:r,this}value(){return this.numerator/this.denominator}simplify(){let e=this.numerator,r=this.denominator;const s=Fraction.GCD(e,r);return e/=s,r/=s,r<0&&(r=-r,e=-e),this.set(e,r)}add(e,r){let s,o;e instanceof Fraction?(s=e.numerator,o=e.denominator):(e!==void 0?s=e:s=0,r!==void 0?o=r:o=1);const a=Fraction.LCM(this.denominator,o),l=a/this.denominator,u=a/o,c=this.numerator*l+s*u;return this.set(c,a)}subtract(e,r){let s,o;e instanceof Fraction?(s=e.numerator,o=e.denominator):(e!==void 0?s=e:s=0,r!==void 0?o=r:o=1);const a=Fraction.LCM(this.denominator,o),l=a/this.denominator,u=a/o,c=this.numerator*l-s*u;return this.set(c,a)}multiply(e,r){let s,o;return e instanceof Fraction?(s=e.numerator,o=e.denominator):(e!==void 0?s=e:s=1,r!==void 0?o=r:o=1),this.set(this.numerator*s,this.denominator*o)}divide(e,r){let s,o;return e instanceof Fraction?(s=e.numerator,o=e.denominator):(e!==void 0?s=e:s=1,r!==void 0?o=r:o=1),this.set(this.numerator*o,this.denominator*s)}equals(e){const r=Fraction.__compareA.copy(e).simplify(),s=Fraction.__compareB.copy(this).simplify();return r.numerator===s.numerator&&r.denominator===s.denominator}greaterThan(e){const r=Fraction.__compareB.copy(this);return r.subtract(e),r.numerator>0}greaterThanEquals(e){const r=Fraction.__compareB.copy(this);return r.subtract(e),r.numerator>=0}lessThan(e){return!this.greaterThanEquals(e)}lessThanEquals(e){return!this.greaterThan(e)}clone(){return new Fraction(this.numerator,this.denominator)}copy(e){return typeof e=="number"?this.set(e||0,1):this.set(e.numerator,e.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return Fraction.__tmp.copy(this).simplify().toString()}toMixedString(){let e="";const r=this.quotient(),s=Fraction.__tmp.copy(this);return r<0?s.abs().fraction():s.fraction(),r!==0?(e+=r,s.numerator!==0&&(e+=" "+s.toSimplifiedString())):s.numerator===0?e="0":e=s.toSimplifiedString(),e}parse(e){const r=e.split("/"),s=parseInt(r[0],10),o=r[1]?parseInt(r[1],10):1;return this.set(s,o)}}Fraction.__compareA=new Fraction;Fraction.__compareB=new Fraction;Fraction.__tmp=new Fraction;const X$3=Vex.MakeException("RegistryError");function setIndexValue(i,e,r,s,o){i[e][r]||(i[e][r]={}),i[e][r][s]=o}class Registry{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(e){Registry.defaultRegistry=e}static getDefaultRegistry(){return Registry.defaultRegistry}static disableDefaultRegistry(){Registry.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:e,name:r,value:s,oldValue:o}){const a=this.getElementById(e);o!==null&&this.index[r][o]&&delete this.index[r][o][e],s!==null&&setIndexValue(this.index,r,s,a.getAttribute("id"),a)}register(e,r){if(r=r||e.getAttribute("id"),!r)throw new X$3("Can't add element without `id` attribute to registry",e);return e.setAttribute("id",r),setIndexValue(this.index,"id",r,r,e),Registry.INDEXES.forEach(s=>{this.updateIndex({id:r,name:s,value:e.getAttribute(s),oldValue:null})}),e.onRegister(this),this}getElementById(e){return this.index.id[e]?this.index.id[e][e]:null}getElementsByAttribute(e,r){const s=this.index[e];return s&&s[r]?Object.keys(s[r]).map(o=>s[r][o]):[]}getElementsByType(e){return this.getElementsByAttribute("type",e)}getElementsByClass(e){return this.getElementsByAttribute("class",e)}onUpdate({id:e,name:r,value:s,oldValue:o}){function a(l,u){return l.filter(c=>c===u).length>0}return a(Registry.INDEXES.concat(["id","class"]),r)?(this.updateIndex({id:e,name:r,value:s,oldValue:o}),this):this}}Registry.defaultRegistry=null;let Element$1=class Ci{static newID(){return"auto"+Ci.ID++}constructor({type:e}={}){this.attrs={id:Ci.newID(),el:null,type:e||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,Registry.getDefaultRegistry()&&Registry.getDefaultRegistry().register(this)}setStyle(e){return this.style=e,this}getStyle(){return this.style}applyStyle(e=this.context,r=this.getStyle()){return r?(e.save(),r.shadowColor&&e.setShadowColor(r.shadowColor),r.shadowBlur&&e.setShadowBlur(r.shadowBlur),r.fillStyle&&e.setFillStyle(r.fillStyle),r.strokeStyle&&e.setStrokeStyle(r.strokeStyle),r.lineWidth&&e.setLineWidth(r.lineWidth),this):this}restoreStyle(e=this.context,r=this.getStyle()){return r?(e.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(e){return this.attrs.classes[e]===!0}addClass(e){return this.attrs.classes[e]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:e,oldValue:null}),this}removeClass(e){return delete this.attrs.classes[e],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:e}),this}onRegister(e){return this.registry=e,this}isRendered(){return this.rendered}setRendered(e=!0){return this.rendered=e,this}getAttributes(){return this.attrs}getAttribute(e){return this.attrs[e]}setAttribute(e,r){const s=this.attrs.id,o=this.attrs[e];return this.attrs[e]=r,this.registry&&this.registry.onUpdate({id:s,name:e,value:r,oldValue:o}),this}getContext(){return this.context}setContext(e){return this.context=e,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new Vex.RERR("NoContext","No rendering context attached to instance");return this.context}};Element$1.ID=1e3;class BoundingBoxComputation{constructor(e,r,s,o){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(e,r),this.addPoint(s,o)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(e,r){e!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),r!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=r,this.y2=r),rthis.y2&&(this.y2=r))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addQuadraticCurve(e,r,s,o,a,l){const u=e+.6666666666666666*(s-e),c=r+2/3*(o-r),d=u+1/3*(a-e),y=c+1/3*(l-r);this.addBezierCurve(e,r,u,c,d,y,a,l)}addBezierCurve(e,r,s,o,a,l,u,c){const d=[e,r],y=[s,o],m=[a,l],g=[u,c];let v;this.addPoint(d[0],d[1]),this.addPoint(g[0],g[1]);const b=(S,x)=>Math.pow(1-S,3)*d[x]+3*Math.pow(1-S,2)*S*y[x]+3*(1-S)*Math.pow(S,2)*m[x]+Math.pow(S,3)*g[x];for(v=0;v<=1;v++){const S=6*d[v]-12*y[v]+6*m[v],x=-3*d[v]+9*y[v]-9*m[v]+3*g[v],A=3*y[v]-3*d[v];if(x===0){if(S===0)continue;const T=-A/S;0{if(!i)throw new Vex.RERR("BadArgument","Invalid clef: "+i);const e=Flow.clefProperties.values[i];if(!e)throw new Vex.RERR("BadArgument","Invalid clef: "+i);return e};Flow.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}};Flow.keyProperties=(i,e,r)=>{e===void 0&&(e="treble");const s={octave_shift:0};typeof r=="object"&&Vex.Merge(s,r);const o=i.split("/");if(o.length<2)throw new Vex.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${i}`);const a=o[0].toUpperCase(),l=Flow.keyProperties.note_values[a];if(!l)throw new Vex.RERR("BadArguments","Invalid key name: "+a);l.octave&&(o[1]=l.octave);let u=parseInt(o[1],10);u-=s.octave_shift;let d=(u*7-4*7+l.index)/2;d+=Flow.clefProperties(e).line_shift;let y=0;d<=0&&d*2%2===0&&(y=1),d>=6&&d*2%2===0&&(y=-1);const m=typeof l.int_val<"u"?u*12+l.int_val:null,g=l.code,v=l.shift_right;let b={};if(o.length>2&&o[2]){const S=o[2].toUpperCase();b=Flow.keyProperties.customNoteHeads[S]||{}}return{key:a,octave:u,line:d,int_value:m,accidental:l.accidental,code:g,stroke:y,shift_right:v,displaced:!1,...b}};Flow.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}};Flow.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},TI:{code:"v11",shift_right:0,stem_up_y_shift:5,stem_down_y_shift:5,stem_up_x_offset:6,stem_down_x_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0},rwl:{code:"rwl",shift_right:0},rhl:{code:"rhl",shift_right:0}};Flow.integerToNote=i=>{if(typeof i>"u")throw new Vex.RERR("BadArguments","Undefined integer for integerToNote");if(i<-2)throw new Vex.RERR("BadArguments",`integerToNote requires integer > -2: ${i}`);const e=Flow.integerToNote.table[i];if(!e)throw new Vex.RERR("BadArguments",`Unknown note value for integer: ${i}`);return e};Flow.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"};Flow.tabToGlyph=(i,e=1)=>{let r=null,s=0,o=0;if(i.toString().toUpperCase()==="X"){const a=new Glyph("v7f",Flow.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();r="v7f",s=a.width,o=-a.height/2}else s=Flow.textWidth(i.toString());return{text:i,code:r,getWidth:()=>s*e,shift_y:o}};Flow.textWidth=i=>7*i.toString().length;Flow.articulationCodes=i=>Flow.articulationCodes.articulations[i];Flow.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}};Flow.accidentalCodes=i=>Flow.accidentalCodes.accidentals[i];Flow.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}};Flow.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}};Flow.ornamentCodes=i=>Flow.ornamentCodes.ornaments[i];Flow.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}};Flow.keySignature=i=>{const e=Flow.keySignature.keySpecs[i];if(!e)throw new Vex.RERR("BadKeySignature",`Bad key signature spec: '${i}'`);if(!e.acc)return[];const r=Flow.keySignature.accidentalList(e.acc),s=[];for(let o=0;o({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]})[i];Flow.parseNoteDurationString=i=>{if(typeof i!="string")return null;const r=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(i);if(!r)return null;const s=r[1],o=r[2].length;let a=r[3];return a.length===0&&(a="n"),{duration:s,dots:o,type:a}};Flow.parseNoteStruct=i=>{const e=i.duration,r=Flow.parseNoteDurationString(e);if(!r)return null;let s=Flow.durationToTicks(r.duration);if(s==null)return null;let o=i.type;const a=[];if(o){if(!Flow.getGlyphProps.validTypes[o])return null}else o=r.type||"n",i.keys!==void 0&&i.keys.forEach((c,d)=>{const y=c.split("/");y&&y.length===3&&(a[d]=y[2])});const l=i.dots?i.dots:r.dots;if(typeof l!="number")return null;let u=s;for(let c=0;c{const e=Flow.durationAliases[i];if(e!==void 0&&(i=e),Flow.durationToTicks.durations[i]===void 0)throw new Vex.RERR("BadArguments",`The provided duration is not valid: ${i}`);return i};Flow.durationToFraction=i=>new Fraction().parse(Flow.sanitizeDuration(i));Flow.durationToNumber=i=>Flow.durationToFraction(i).value();Flow.durationToTicks=i=>{i=Flow.sanitizeDuration(i);const e=Flow.durationToTicks.durations[i];return e===void 0?null:e};Flow.durationToTicks.durations={"1/2":Flow.RESOLUTION*2,1:Flow.RESOLUTION/1,2:Flow.RESOLUTION/2,4:Flow.RESOLUTION/4,8:Flow.RESOLUTION/8,16:Flow.RESOLUTION/16,32:Flow.RESOLUTION/32,64:Flow.RESOLUTION/64,128:Flow.RESOLUTION/128,256:Flow.RESOLUTION/256};Flow.durationAliases={w:"1",h:"2",q:"4",b:"256"};Flow.getGlyphProps=(i,e)=>{i=Flow.sanitizeDuration(i);const r=Flow.getGlyphProps.duration_codes[i];if(r===void 0)return null;e||(e="n");let s=r.type[e];if(s===void 0){const o=Flow.keyProperties.customNoteHeads[e.toUpperCase()];if(o===void 0)return null;s={code_head:o.code,...o}}return{...r.common,...s}};Flow.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}};Flow.getGlyphProps.duration_codes={"1/2":{common:{getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v53",i).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v1d",i).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v81",i).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(i=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",i).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}};Flow.smufl={};Flow.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"};Flow.TIME4_4={num_beats:4,beat_value:4,resolution:Flow.RESOLUTION};class CanvasContext{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(e,r){return Math.max(e,r)>this.CANVAS_BROWSER_SIZE_LIMIT&&(Vex.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT),r>this.CANVAS_BROWSER_SIZE_LIMIT&&(r=this.CANVAS_BROWSER_SIZE_LIMIT)),[e,r]}constructor(e){this.vexFlowCanvasContext=e,e.canvas?this.canvas=e.canvas:this.canvas={width:CanvasContext.WIDTH,height:CanvasContext.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(e,r,s){return this.vexFlowCanvasContext.font=(s||"")+" "+r+"pt "+e,this}setRawFont(e){return this.vexFlowCanvasContext.font=e,this}setFillStyle(e){return this.vexFlowCanvasContext.fillStyle=e,this}setBackgroundFillStyle(e){return this.background_fillStyle=e,this}setStrokeStyle(e){return this.vexFlowCanvasContext.strokeStyle=e,this}setShadowColor(e){return this.vexFlowCanvasContext.shadowColor=e,this}setShadowBlur(e){return this.vexFlowCanvasContext.shadowBlur=e,this}setLineWidth(e){return this.vexFlowCanvasContext.lineWidth=e,this}setLineCap(e){return this.vexFlowCanvasContext.lineCap=e,this}setLineDash(e){return this.vexFlowCanvasContext.lineDash=e,this}scale(e,r){return this.vexFlowCanvasContext.scale(parseFloat(e),parseFloat(r))}resize(e,r){return[e,r]=this.SanitizeCanvasDims(parseInt(e,10),parseInt(r,10)),this.vexFlowCanvasContext.resize(e,r)}rect(e,r,s,o){return this.vexFlowCanvasContext.rect(e,r,s,o)}fillRect(e,r,s,o){return this.vexFlowCanvasContext.fillRect(e,r,s,o)}clearRect(e,r,s,o){return this.vexFlowCanvasContext.clearRect(e,r,s,o)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(e,r){return this.vexFlowCanvasContext.moveTo(e,r)}lineTo(e,r){return this.vexFlowCanvasContext.lineTo(e,r)}bezierCurveTo(e,r,s,o,a,l){return this.vexFlowCanvasContext.bezierCurveTo(e,r,s,o,a,l)}quadraticCurveTo(e,r,s,o){return this.vexFlowCanvasContext.quadraticCurveTo(e,r,s,o)}arc(e,r,s,o,a,l){return this.vexFlowCanvasContext.arc(e,r,s,o,a,l)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(e){return this.vexFlowCanvasContext.measureText(e)}fillText(e,r,s){return this.vexFlowCanvasContext.fillText(e,r,s)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class RaphaelContext{constructor(e){this.element=e,this.paper=Raphael(e),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(e,r,s){return this.state.font_family=e,this.state.font_size=r,this.state.font_weight=s,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(e){return this.attributes.font=e,this}setFillStyle(e){return this.attributes.fill=e,this}setBackgroundFillStyle(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}setStrokeStyle(e){return this.attributes.stroke=e,this}setShadowColor(e){return this.shadow_attributes.color=e,this}setShadowBlur(e){return this.shadow_attributes.width=e,this}setLineWidth(e){this.attributes["stroke-width"]=e,this.lineWidth=e}setLineDash(){return this}setLineCap(){return this}scale(e,r){return this.state.scale={x:e,y:r},this.attributes.transform="S"+e+","+r+",0,0",this.attributes.scale=e+","+r+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+e+","+r+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(e,r){return this.element.style.width=e,this.paper.setSize(e,r),this}setViewBox(e){this.paper.canvas.setAttribute("viewBox",e)}rect(e,r,s,o){return o<0&&(r+=o,o=-o),this.paper.rect(e,r,s-.5,o-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(e,r,s,o){return o<0&&(r+=o,o=-o),this.paper.rect(e,r,s-.5,o-.5).attr(this.attributes),this}clearRect(e,r,s,o){return o<0&&(r+=o,o=-o),this.paper.rect(e,r,s-.5,o-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(e,r){return this.path+="M"+e+","+r,this.pen.x=e,this.pen.y=r,this}lineTo(e,r){return this.path+="L"+e+","+r,this.pen.x=e,this.pen.y=r,this}bezierCurveTo(e,r,s,o,a,l){return this.path+="C"+e+","+r+","+s+","+o+","+a+","+l,this.pen.x=a,this.pen.y=l,this}quadraticCurveTo(e,r,s,o){return this.path+="Q"+e+","+r+","+s+","+o,this.pen.x=s,this.pen.y=o,this}arc(e,r,s,o,a,l){function u(d){for(;d<0;)d+=Math.PI*2;for(;d>Math.PI*2;)d-=Math.PI*2;return d}if(o=u(o),a=u(a),o>a){const d=o;o=a,a=d,l=!l}const c=a-o;return c>Math.PI?(this.arcHelper(e,r,s,o,o+c/2,l),this.arcHelper(e,r,s,o+c/2,a,l)):this.arcHelper(e,r,s,o,a,l),this}arcHelper(e,r,s,o,a,l){const u=e+s*Math.cos(o),c=r+s*Math.sin(o),d=e+s*Math.cos(a),y=r+s*Math.sin(a);let m=0,g=0;l?(g=1,a-oMath.PI&&(m=1),this.path+="M"+u+","+c+",A"+s+","+s+",0,"+m+","+g+","+d+","+y+"M"+this.pen.x+","+this.pen.y}glow(){const e=this.paper.set();if(this.shadow_attributes.width>0){const r=this.shadow_attributes,s=r.width/2;for(let o=1;o<=s;o++)e.push(this.paper.path(this.path).attr({stroke:r.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(r.width/s*o).toFixed(3),opacity:+((r.opacity||.3)/s).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return e}fill(){const e=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(e),this}stroke(){const e=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,r=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",e);return this.glow(r),this}closePath(){return this.path+="Z",this}measureText(e){const r=this.paper.text(0,0,e).attr(this.attributes).attr("fill","none").attr("stroke","none"),s=r.getBBox();return r.remove(),{width:s.width,height:s.height}}fillText(e,r,s){return this.paper.text(r+this.measureText(e).width/2,s-this.state.font_size/(2.25*this.state.scale.y),e).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const e=this.state_stack.pop();return this.state.font_family=e.state.font_family,this.attributes.font=e.attributes.font,this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this}}const attrNamesToIgnoreMap={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const i={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};Vex.Merge(attrNamesToIgnoreMap.rect,i),Vex.Merge(attrNamesToIgnoreMap.path,i)}class SVGContext{constructor(e){this.element=e,this.svgNS="http://www.w3.org/2000/svg";const r=this.create("svg");this.element.appendChild(r),this.svg=r,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(e){return document.createElementNS(this.svgNS,e)}openGroup(e,r,s,o){const a=this.create("g");return this.groups.push(a),this.parent.appendChild(a),this.parent=a,e&&a.setAttribute("class",Vex.Prefix(e)),r&&a.setAttribute("id",Vex.Prefix(r)),s&&s.pointerBBox&&a.setAttribute("pointer-events","bounding-box"),o&&o==="isX"&&(a.style.transformOrigin="center",a.style.transformBox="content-box",a.style.transform="scale(1.5) translateY(-5px)"),a}closeGroup(e){if(e&&e==="transform"){const r=this.groups.pop();let s=r.getAttribute("class");s=s+" vf-stopDot",r.setAttribute("class",s)}else this.groups.pop();this.parent=this.groups[this.groups.length-1]}add(e){this.parent.appendChild(e)}iePolyfill(){typeof navigator<"u"&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(e,r,s){let o=!1,a=!1,l="normal";typeof s=="string"&&(s.indexOf("italic")!==-1&&(s=s.replace(/italic/g,""),a=!0),s.indexOf("bold")!==-1&&(s=s.replace(/bold/g,""),o=!0),s=s.replace(/ /g,"")),s=o?"bold":s,s=typeof s>"u"||s===""?"normal":s,l=a?"italic":l;const u={"font-family":e,"font-size":r+"pt","font-weight":s,"font-style":l};return this.fontSize=Number(r),Vex.Merge(this.attributes,u),Vex.Merge(this.state,u),this}setRawFont(e){e=e.trim();const r=e.split(" ");return this.attributes["font-family"]=r[1],this.state["font-family"]=r[1],this.attributes["font-size"]=r[0],this.state["font-size"]=r[0],this.fontSize=Number(r[0].match(/\d+/)),this}setFillStyle(e){return this.attributes.fill=e,this}setBackgroundFillStyle(e){return this.background_attributes.fill=e,this.background_attributes.stroke=e,this}setStrokeStyle(e){return this.attributes.stroke=e,this}setShadowColor(e){return this.shadow_attributes.color=e,this}setShadowBlur(e){return this.shadow_attributes.width=e,this}setLineWidth(e){this.attributes["stroke-width"]=e,this.lineWidth=e}setLineDash(e){if(Object.prototype.toString.call(e)==="[object Array]")return e=e.join(", "),this.attributes["stroke-dasharray"]=e,this;throw new Vex.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(e){return this.attributes["stroke-linecap"]=e,this}resize(e,r){this.width=e,this.height=r,this.element.style.width=e;const s={width:e,height:r};return this.applyAttributes(this.svg,s),this.scale(this.state.scale.x,this.state.scale.y),this}scale(e,r){this.state.scale={x:e,y:r};const s=this.width/e,o=this.height/r;return this.setViewBox(0,0,s,o),this}setViewBox(...e){if(e.length===1){const[r]=e;this.svg.setAttribute("viewBox",r)}else{const[r,s,o,a]=e,l=r+" "+s+" "+o+" "+a;this.svg.setAttribute("viewBox",l)}}applyAttributes(e,r){const s=attrNamesToIgnoreMap[e.nodeName];return Object.keys(r).forEach(o=>{var a;s&&s[o]||!o||!r[o]||o==="d"&&((a=r[o])==null?void 0:a.indexOf("NaN"))>-1||e.setAttributeNS(null,o,r[o])}),e}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(e,r,s,o,a){o<0&&(r+=o,o*=-1);const l=this.create("rect");return typeof a>"u"&&(a={fill:"none","stroke-width":this.lineWidth,stroke:this.attributes.stroke}),Vex.Merge(a,{x:e,y:r,width:s,height:o}),this.applyAttributes(l,a),this.add(l),this}fillRect(e,r,s,o){return o<0&&(r+=o,o*=-1),this.rect(e,r,s,o,this.attributes),this}clearRect(e,r,s,o){return this.rect(e,r,s,o,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(e,r){return this.path+="M"+e+" "+r,this.pen.x=e,this.pen.y=r,this}lineTo(e,r){return this.path+="L"+e+" "+r,this.pen.x=e,this.pen.y=r,this}bezierCurveTo(e,r,s,o,a,l){return this.path+="C"+e+" "+r+","+s+" "+o+","+a+" "+l,this.pen.x=a,this.pen.y=l,this}quadraticCurveTo(e,r,s,o){return this.path+="Q"+e+" "+r+","+s+" "+o,this.pen.x=s,this.pen.y=o,this}arc(e,r,s,o,a,l){function u(d){for(;d<0;)d+=Math.PI*2;for(;d>Math.PI*2;)d-=Math.PI*2;return d}if(o=u(o),a=u(a),o>a){const d=o;o=a,a=d,l=!l}const c=a-o;return c>Math.PI?(this.arcHelper(e,r,s,o,o+c/2,l),this.arcHelper(e,r,s,o+c/2,a,l)):this.arcHelper(e,r,s,o,a,l),this}arcHelper(e,r,s,o,a,l){const u=e+s*Math.cos(o),c=r+s*Math.sin(o),d=e+s*Math.cos(a),y=r+s*Math.sin(a);let m=0,g=0;l?(g=1,a-oMath.PI&&(m=1),this.path+="M"+u+" "+c+" A"+s+" "+s+" 0 "+m+" "+g+" "+d+" "+y,!isNaN(this.pen.x)&&!isNaN(this.pen.y)&&(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const e=this.shadow_attributes,r=e.width/2;for(let s=1;s<=r;s++){const o={stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width*.4/r*s).toFixed(3),opacity:+((e.opacity||.3)/r).toFixed(3)},a=this.create("path");o.d=this.path,this.applyAttributes(a,o),this.add(a)}}return this}fill(e){this.glow();const r=this.create("path");let s=e;return typeof e>"u"?(e={},Vex.Merge(e,this.attributes),e.stroke="none",s=e):(s=e,Vex.Merge(s,this.attributes),e.class&&(s.class=e.class),e.id&&(s.id=e.id)),e.d=this.path,this.applyAttributes(r,e),this.add(r),this}stroke(e=void 0){this.glow();const r=this.create("path"),s={};return Vex.Merge(s,this.attributes),e&&Vex.Merge(s,e),s.fill="none",s["stroke-width"]=this.lineWidth,s.d=this.path,this.applyAttributes(r,s),this.add(r),this}measureText(e){const r=this.create("text");if(typeof r.getBBox!="function")return{x:0,y:0,width:0,height:0};r.textContent=e,this.applyAttributes(r,this.attributes),this.svg.appendChild(r);let s=r.getBBox();return this.ie&&e!==""&&this.attributes["font-style"]==="italic"&&(s=this.ieMeasureTextFix(s,e)),this.svg.removeChild(r),s}ieMeasureTextFix(e){const r=Number(this.fontSize),s=1.196,o=1.9598,a=s*r+o,l=e.width-a,u=e.height-1.5;return{x:e.x,y:e.y,width:l,height:u}}fillText(e,r,s){if(!e||e.length<=0)return;const o={};Vex.Merge(o,this.attributes),o.stroke="none",o.x=r,o.y=s;const a=this.create("text");a.textContent=e,this.applyAttributes(a,o),this.add(a)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const e=this.state_stack.pop();return this.state["font-family"]=e.state["font-family"],this.state["font-weight"]=e.state["font-weight"],this.state["font-style"]=e.state["font-style"],this.state["font-size"]=e.state["font-size"],this.state.scale=e.state.scale,this.attributes["font-family"]=e.attributes["font-family"],this.attributes["font-weight"]=e.attributes["font-weight"],this.attributes["font-style"]=e.attributes["font-style"],this.attributes["font-size"]=e.attributes["font-size"],this.attributes.fill=e.attributes.fill,this.attributes.stroke=e.attributes.stroke,this.attributes["stroke-width"]=e.attributes["stroke-width"],this.attributes["stroke-dasharray"]=e.attributes["stroke-dasharray"],this.shadow_attributes.width=e.shadow_attributes.width,this.shadow_attributes.color=e.shadow_attributes.color,this.lineWidth=e.lineWidth,this}}let lastContext=null;class Renderer{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return lastContext}static set lastContext(e){lastContext=e}static buildContext(e,r,s,o,a){const l=new Renderer(e,r);s&&o&&l.resize(s,o),a||(a="#FFF");const u=l.getContext();return u.setBackgroundFillStyle(a),Renderer.lastContext=u,u}static getCanvasContext(e,r,s,o){return Renderer.buildContext(e,Renderer.Backends.CANVAS,r,s,o)}static getRaphaelContext(e,r,s,o){return Renderer.buildContext(e,Renderer.Backends.RAPHAEL,r,s,o)}static getSVGContext(e,r,s,o){return Renderer.buildContext(e,Renderer.Backends.SVG,r,s,o)}static bolsterCanvasContext(e){if(Renderer.USE_CANVAS_PROXY)return new CanvasContext(e);const r=["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"];return e.vexFlowCanvasContext=e,r.forEach(s=>{e[s]=e[s]||CanvasContext.prototype[s]}),e}static drawDashedLine(e,r,s,o,a,l){e.beginPath();const u=o-r,c=a-s,d=Math.atan2(c,u);let y=r,m=s;e.moveTo(r,s);let g=0,v=!0;for(;!((u<0?y<=o:y>=o)&&(c<0?m<=a:m>=a));){const b=l[g++%l.length],S=y+Math.cos(d)*b;y=u<0?Math.max(o,S):Math.min(o,S);const x=m+Math.sin(d)*b;m=c<0?Math.max(a,x):Math.min(a,x),v?e.lineTo(y,m):e.moveTo(y,m),v=!v}e.closePath(),e.stroke()}constructor(e,r){if(this.elementId=e,!this.elementId)throw new Vex.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(e),this.element||(this.element=e),this.ctx=null,this.paper=null,this.backend=r,this.backend===Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement",`Can't get canvas context from element: ${e}`);this.ctx=Renderer.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0}))}else if(this.backend===Renderer.Backends.RAPHAEL)this.ctx=new RaphaelContext(this.element);else if(this.backend===Renderer.Backends.SVG)this.ctx=new SVGContext(this.element);else throw new Vex.RERR("InvalidBackend",`No support for backend: ${this.backend}`)}resize(e,r){if(this.backend===Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[e,r]=CanvasContext.SanitizeCanvasDims(e,r);const s=window.devicePixelRatio||1;this.element.width=e*s,this.element.height=r*s,this.element.style.width=e+"px",this.element.style.height=r+"px",this.ctx=Renderer.bolsterCanvasContext(this.element.getContext("2d",{willReadFrequently:!0})),this.ctx.scale(s,s)}else this.ctx.resize(e,r);return this}getContext(){return this.ctx}}function L$j(...i){Stem.DEBUG&&Vex.L("Vex.Flow.Stem",i)}class Stem extends Element$1{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return Flow.STEM_WIDTH}static get HEIGHT(){return Flow.STEM_HEIGHT}constructor(e={}){super(),this.setAttribute("type","Stem"),this.x_begin=e.x_begin||0,this.x_end=e.x_end||0,this.y_top=e.y_top||0,this.y_bottom=e.y_bottom||0,this.stem_extension=e.stem_extension||0,this.stem_direction=e.stem_direction||0,this.hide=e.hide||!1,this.isStemlet=e.isStemlet||!1,this.stemletHeight=e.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(e)}setResetHeight(e){this.resetHeight=e}setOptions(e){this.stem_up_y_offset=e.stem_up_y_offset||0,this.stem_down_y_offset=e.stem_down_y_offset||0}setNoteHeadXBounds(e,r){return this.x_begin=e,this.x_end=r,this}setDirection(e){this.stem_direction=e}setExtension(e){this.stem_extension=e}getExtension(){return this.stem_extension}setYBounds(e,r){this.y_top=e,this.y_bottom=r}getCategory(){return Stem.CATEGORY}getHeight(){const e=this.stem_direction===Stem.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(Stem.HEIGHT-e+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new Vex.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const e=this.stem_direction===Stem.UP,r=[this.y_top,this.y_bottom],s=Stem.HEIGHT+this.stem_extension,o=(e?Math.min:Math.max)(...r),a=(e?Math.max:Math.min)(...r);return{topY:o+s*-this.stem_direction,baseY:a}}setVisibility(e){return this.hide=!e,this}setStemlet(e,r){return this.isStemlet=e,this.stemletHeight=r,this}draw(){if(this.setRendered(),this.hide)return;const e=this.checkContext();let r,s;const o=this.stem_direction;o===Stem.DOWN?(r=this.x_begin,s=this.y_top+this.stem_down_y_offset):(r=this.x_end,s=this.y_bottom-this.stem_up_y_offset);const a=this.getHeight();L$j("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const l=this.isStemlet?a-this.stemletHeight*this.stem_direction:0;if(e.save(),this.applyStyle(e),e.beginPath(),e.setLineWidth(Stem.WIDTH),e.moveTo(r,s-l),e.lineTo(r,s-a-this.renderHeightAdjustment*o),e.svg){const u={class:Vex.Prefix("stem")};this.id&&(u.id=this.id),e.stroke(u)}else e.stroke();this.restoreStyle(e),e.restore()}}let Tuplet$1=class ai extends Element$1{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(e,r){if(super(),this.setAttribute("type","Tuplet"),!e||!e.length)throw new Vex.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=Vex.Merge({},r),this.notes=e,this.num_notes="num_notes"in this.options?this.options.num_notes:e.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=e.some(s=>s.beam===null),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||ai.LOCATION_TOP,Formatter.AlignRestsToNotes(e,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let e=0;e=1;)this.numerator_glyphs.unshift(new Glyph("v"+e%10,this.point)),e=parseInt(e/10,10);for(this.denom_glyphs=[],e=this.notes_occupied;e>=1;)this.denom_glyphs.unshift(new Glyph("v"+e%10,this.point)),e=parseInt(e/10,10)}getNestedTupletCount(){const e=this.location,r=this.notes[0];let s=a(r,e),o=a(r,e);function a(l,u){return l.tupletStack.filter(c=>c.location===u).length}return this.notes.forEach(l=>{const u=a(l,e);s=u>s?u:s,o=uo&&(o=l)}}return o+e+r}draw(){this.checkContext(),this.setRendered();const e=this.notes[0],r=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=e.getTieLeftX()-5,this.width=r.getTieRightX()-this.x_pos+5):(this.x_pos=e.getStemX(),this.width=r.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const s=(u,c)=>u+c.getMetrics().width;let o=this.numerator_glyphs.reduce(s,0);this.ratioed&&(o=this.denom_glyphs.reduce(s,o),o+=this.point*.32);const l=this.x_pos+this.width/2-o/2;if(this.bracketed){const u=this.width/2-o/2-5;u>0&&(this.context.fillRect(this.x_pos,this.y_pos,u,1),this.context.fillRect(this.x_pos+this.width/2+o/2+5,this.y_pos,u,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===ai.LOCATION_BOTTOM),1,this.location*10),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===ai.LOCATION_BOTTOM),1,this.location*10))}if(this.RenderTupletNumber!==!1){let u=0;this.numerator_glyphs.forEach(c=>{c.render(this.context,l+u,this.y_pos+this.point/3-2),u+=c.getMetrics().width})}if(this.ratioed){const u=l+x_offset+this.point*.16,c=this.point*.06;this.context.beginPath(),this.context.arc(u,this.y_pos-this.point*.08,c,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(u,this.y_pos+this.point*.12,c,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),x_offset+=this.point*.32,this.denom_glyphs.forEach(d=>{d.render(this.context,l+x_offset,this.y_pos+this.point/3-2),x_offset+=d.getMetrics().width})}}};function calculateStemDirection(i){let e=0;return i.forEach(r=>{r.keyProps&&r.keyProps.forEach(s=>{e+=s.line-3})}),e>=0?Stem.DOWN:Stem.UP}const getStemSlope=(i,e)=>{const r=i.getStemExtents().topY,s=i.getStemX(),o=e.getStemExtents().topY,a=e.getStemX();return(o-r)/(a-s)},BEAM_LEFT="L",BEAM_RIGHT="R",BEAM_BOTH="B";let Beam$1=class Mi extends Element$1{static getDefaultBeamGroups(e){(!e||e==="c")&&(e="4/4");const s={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[e];if(s===void 0){const o=parseInt(e.split("/")[0],10),a=parseInt(e.split("/")[1],10);if(o%3===0)return[new Fraction(3,a)];if(a>4)return[new Fraction(2,a)];if(a<=4)return[new Fraction(1,a)]}else return s.map(o=>new Fraction().parse(o));return[new Fraction(1,4)]}static applyAndGetBeams(e,r,s){return Mi.generateBeams(e.getTickables(),{groups:s,stem_direction:r})}static generateBeams(e,r){r||(r={}),(!r.groups||!r.groups.length)&&(r.groups=[new Fraction(2,8)]);const s=r.groups.map(_=>{if(!_.multiply)throw new Vex.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return _.clone().multiply(Flow.RESOLUTION,1)}),o=e;let a=0,l=[],u=[];function c(_){return _.reduce((T,C)=>C.getTicks().clone().add(T),new Fraction(0,1))}function d(){s.length-1>a?a+=1:a=0}function y(){let _=[];o.forEach(T=>{if(_=[],T.shouldIgnoreTicks()){l.push(u),u=_;return}u.push(T);const C=s[a].clone(),P=c(u),k=Flow.durationToNumber(T.duration)<8;k&&T.tuplet&&(C.numerator*=2),P.greaterThan(C)?(k||_.push(u.pop()),l.push(u),u=_,d()):P.equals(C)&&(l.push(u),u=_,d())}),u.length>0&&l.push(u)}function m(){return l.filter(_=>{if(_.length>1){let T=!0;return _.forEach(C=>{C.getIntrinsicTicks()>=Flow.durationToTicks("4")&&(T=!1)}),T}return!1})}function g(){const _=[];l.forEach(T=>{let C=[];T.forEach((P,k,M)=>{const R=k===0||k===M.length-1,H=M[k-1],B=!r.beam_rests&&P.isRest(),F=r.beam_rests&&r.beam_middle_only&&P.isRest()&&R;let I=!1;if(r.maintain_stem_directions&&H&&!P.isRest()&&!H.isRest()){const $=H.getStemDirection();I=P.getStemDirection()!==$}const U=parseInt(P.duration,10)<8;B||F||I||U?(C.length>0&&_.push(C),C=I?[P]:[]):C.push(P)}),C.length>0&&_.push(C)}),l=_}function v(){l.forEach(_=>{let T;if(r.maintain_stem_directions){const C=b(_);T=C?C.getStemDirection():Stem.UP}else r.stem_direction?T=r.stem_direction:T=calculateStemDirection(_);S(_,T)})}function b(_){for(let T=0;T<_.length;T++){const C=_[T];if(!C.isRest())return C}return!1}function S(_,T){_.forEach(C=>{C.setStemDirection(T)})}function x(){const _=[];return l.forEach(T=>{let C=null;T.forEach(P=>{P.tuplet&&C!==P.tuplet&&(C=P.tuplet,_.push(C))})}),_}y(),g(),v();const A=m(),E=x(),w=[];return A.forEach(_=>{const T=new Mi(_);r.show_stemlets&&(T.render_options.show_stemlets=!0),r.secondary_breaks&&(T.render_options.secondary_break_ticks=Flow.durationToTicks(r.secondary_breaks)),r.flat_beams===!0&&(T.render_options.flat_beams=!0,T.render_options.flat_beam_offset=r.flat_beam_offset),w.push(T)}),E.forEach(_=>{const T=_.notes[0].stem_direction===Stem.DOWN?Tuplet$1.LOCATION_BOTTOM:Tuplet$1.LOCATION_TOP;_.setTupletLocation(T);let C=!1;for(let P=0;P<_.notes.length;P++)if(_.notes[P].beam===null){C=!0;break}_.setBracketed(C)}),w}constructor(e,r){if(super(),this.setAttribute("type","Beam"),!e||e==[])throw new Vex.RuntimeError("BadArguments","No notes provided for beam.");if(e.length===1)throw new Vex.RuntimeError("BadArguments","Too few notes for beam.");if(this.ticks=e[0].getIntrinsicTicks(),this.ticks>=Flow.durationToTicks("4"))throw new Vex.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let s,o;for(this.stem_direction=Stem.UP,s=0;su+c.stem_direction,0)>-1?Stem.UP:Stem.DOWN),s=0;ss.getGlyph().beam_count).reduce((s,o)=>o>s?o:s)}breakSecondaryAt(e){return this.break_on_indices=e,this}getSlopeY(e,r,s,o){return s+(e-r)*o}calculateSlope(){const{notes:e,stem_direction:r,render_options:{max_slope:s,min_slope:o,slope_iterations:a,slope_cost:l}}=this,u=e[0],c=getStemSlope(u,e[e.length-1]),d=(s-o)/a;let y=Number.MAX_VALUE,m=0,g=0;for(let v=o;v<=s;v+=d){let b=0,S=0;for(let w=1;wx)&&(d=x,u=Math.min(...S.getYs()),c=S.getBeamCount())}let y=l/e.length;const m=s*1.5,g=o+c*m,v=u+g*-r;r===Stem.DOWN&&yv&&(y=u-g),a+this.render_options.flat_beam_offset_per_beam>0?r===Stem.DOWN&&y>a&&!this.render_options.flat_beams?this.render_options.flat_beam_offset=y:r===Stem.UP&&y0){let o=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(o+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let a=this.notes[0].note_heads[0].y;const l=this.stem_direction>0?Math.min:Math.max;for(const u of this.notes)for(const c of u.note_heads)a=l(a,c.y);s=a+o*-this.stem_direction}return s}applyStemExtensions(){const{notes:e,slope:r,y_shift:s,stem_direction:o,beam_count:a,render_options:{show_stemlets:l,stemlet_extension:u,beam_width:c}}=this,d=e[0],y=this.getBeamYToDraw(),m=d.getStemX();for(let g=0;g=8&&(v=this.break_on_indices.indexOf(y)!==-1,this.render_options.secondary_break_ticks&&c>=this.render_options.secondary_break_ticks&&(c=0,v=!0));const b=m.getIntrinsicTicks(){e.getStem()&&(this.context.openGroup("stem",e.getAttribute("id")+"-stem"),e.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const e=["4","8","16","32","64"],r=this.notes[0];let s=this.getBeamYToDraw();const o=r.getStemX(),a=this.render_options.beam_width*this.stem_direction,l={};for(const u of this.notes)l[u.getAttribute("id")]=0;for(let u=0;u{e.getStave()||e.setStave(this.stave)}),this.preFormatted=!0,this)}draw(e=this.context,r=this.stave){this.setRendered();let s=null;for(let o=0;o0&&s){const l=a.getBoundingBox();l&&s.mergeWith(l)}a.setContext(e),a.drawWithStyle()}this.boundingBox=s}};function drawBoldDoubleLine(i,e,r,s,o){if(e!==StaveConnector.type.BOLD_DOUBLE_LEFT&&e!==StaveConnector.type.BOLD_DOUBLE_RIGHT)throw new Vex.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let a=3,l=3.5;const u=2;e===StaveConnector.type.BOLD_DOUBLE_RIGHT&&(a=-5,l=3),i.fillRect(r+a,s,1,o-s),i.fillRect(r-u,s,l,o-s)}class StaveConnector extends Element$1{static get type(){return{SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8}}static get typeString(){return{singleRight:StaveConnector.type.SINGLE_RIGHT,singleLeft:StaveConnector.type.SINGLE_LEFT,single:StaveConnector.type.SINGLE,double:StaveConnector.type.DOUBLE,brace:StaveConnector.type.BRACE,bracket:StaveConnector.type.BRACKET,boldDoubleLeft:StaveConnector.type.BOLD_DOUBLE_LEFT,boldDoubleRight:StaveConnector.type.BOLD_DOUBLE_RIGHT,thinDouble:StaveConnector.type.THIN_DOUBLE,none:StaveConnector.type.NONE}}constructor(e,r){super(),this.setAttribute("type","StaveConnector"),this.thickness=Flow.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=e,this.bottom_stave=r,this.type=StaveConnector.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(e){return e=typeof e=="string"?StaveConnector.typeString[e]:e,e>=StaveConnector.type.SINGLE_RIGHT&&e<=StaveConnector.type.NONE&&(this.type=e),this}setText(e,r){return this.texts.push({content:e,options:Vex.Merge({shift_x:0,shift_y:0},r)}),this}setFont(e){Vex.Merge(this.font,e)}setXShift(e){if(typeof e!="number")throw Vex.RERR("InvalidType","x_shift must be a Number");return this.x_shift=e,this}draw(){const e=this.checkContext();this.setRendered();let r=this.top_stave.getYForLine(0),s=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,o=this.width,a=this.top_stave.getX();(this.type===StaveConnector.type.SINGLE_RIGHT||this.type===StaveConnector.type.BOLD_DOUBLE_RIGHT||this.type===StaveConnector.type.THIN_DOUBLE)&&(a=this.top_stave.getX()+this.top_stave.width);let u=s-r;switch(this.type){case StaveConnector.type.SINGLE:o=1;break;case StaveConnector.type.SINGLE_LEFT:o=1;break;case StaveConnector.type.SINGLE_RIGHT:o=1;break;case StaveConnector.type.DOUBLE:a-=this.width+2;break;case StaveConnector.type.BRACE:{o=12;const c=this.top_stave.getX()-2+this.x_shift,d=r,y=c,m=s,g=c-o,v=d+u/2,b=g-.9*o,S=d+.2*u,x=c+1.1*o,A=v-.135*u,E=x,w=v+.135*u,_=b,T=m-.2*u,C=g-o,P=T,k=c+.4*o,M=v+.135*u,R=k,H=v-.135*u,B=C,F=S;e.beginPath(),e.moveTo(c,d),e.bezierCurveTo(b,S,x,A,g,v),e.bezierCurveTo(E,w,_,T,y,m),e.bezierCurveTo(C,P,k,M,g,v),e.bezierCurveTo(R,H,B,F,c,d),e.fill(),e.stroke();break}case StaveConnector.type.BRACKET:r-=4,s+=4,u=s-r,Glyph.renderGlyph(e,a-5,r-3,40,"v1b",!0),Glyph.renderGlyph(e,a-5,s+3,40,"v10",!0),a-=this.width+2;break;case StaveConnector.type.BOLD_DOUBLE_LEFT:drawBoldDoubleLine(e,this.type,a+this.x_shift,r,s);break;case StaveConnector.type.BOLD_DOUBLE_RIGHT:drawBoldDoubleLine(e,this.type,a,r,s);break;case StaveConnector.type.THIN_DOUBLE:o=1;break;case StaveConnector.type.NONE:break;default:throw new Vex.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==StaveConnector.type.BRACE&&this.type!==StaveConnector.type.BOLD_DOUBLE_LEFT&&this.type!==StaveConnector.type.BOLD_DOUBLE_RIGHT&&this.type!==StaveConnector.type.NONE&&e.fillRect(a,r,o,u),this.type===StaveConnector.type.THIN_DOUBLE&&e.fillRect(a-3,r,o,u),e.save(),e.lineWidth=2,e.setFont(this.font.family,this.font.size,this.font.weight);for(let c=0;c0){const x=S.space.deviation,A=x>=0?"+":"";e.setFillStyle("red"),e.fillText(A+Math.round(x),u+r.getXShift(),s-10)}e.restore()}constructor(e){if(super(),this.setAttribute("type","Note"),!e)throw new Vex.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const r=Flow.parseNoteStruct(e);if(!r)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(e)}`);if(this.duration=r.duration,this.dots=r.dots,this.noteType=r.type,this.customTypes=r.customTypes,this.DYMusicScoreType=e.DYMusicScoreType,e.duration_override?this.setDuration(e.duration_override):this.setIntrinsicTicks(r.ticks),this.modifiers=[],this.glyph=Flow.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(s=>Flow.getGlyphProps(this.duration,s)),this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new Vex.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],e.align_center&&this.setCenterAlignment(e.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:Note.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(e){return this.playNote=e,this}isRest(){return!1}addStroke(e,r){return r.setNote(this),r.setIndex(e),this.modifiers.push(r),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(e){return this.stave=e,this.setYs([e.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return Note.CATEGORY}setContext(e){return this.context=e,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(e){return this.extraLeftPx=e,this}setExtraRightPx(e){return this.extraRightPx=e,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth?this.glyph.getWidth(this.render_options.glyph_font_scale):15}setYs(e){return this.ys=e,this}getYs(){if(this.ys.length===0)throw new Vex.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(e){if(!this.stave)throw new Vex.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(e)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new Vex.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(e){return this.voice=e,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(e){return this.tickContext=e,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(e){return this.modifierContext=e,this}addModifier(e,r=0){return e.setNote(this),e.setIndex(r),this.modifiers.push(e),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let e=0,r=0;this.modifierContext!=null&&(e=this.modifierContext.state.left_shift,r=this.modifierContext.state.right_shift);const s=this.getWidth();return{width:s,noteWidth:s-e-r-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:e,modRightPx:r,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(e){this.width=e}getWidth(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(e){return this.x_shift=e,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let e=this.tickContext.getX();return this.stave&&(e+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(this.DYMusicScoreType==="jianpu"||(e+=this.getCenterXShift())),e}setPreFormatted(e){if(this.preFormatted=e,this.preFormatted){const r=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,r.left),this.right_modPx=Math.max(this.right_modPx,r.right)}}}function L$i(...i){NoteHead.DEBUG&&Vex.L("Vex.Flow.NoteHead",i)}function drawSlashNoteHead(i,e,r,s,o,a){const l=Flow.SLASH_NOTEHEAD_WIDTH;i.save(),i.setLineWidth(Flow.STEM_WIDTH);let u=!1;if(Flow.durationToNumber(e)>2&&(u=!0),u||(r-=Flow.STEM_WIDTH/2*o),i.beginPath(),i.moveTo(r,s+a),i.lineTo(r,s+1),i.lineTo(r+l,s-a),i.lineTo(r+l,s),i.lineTo(r,s+a),i.closePath(),u?i.fill():i.stroke(),Flow.durationToFraction(e).equals(.5)){const c=[-3,-1,l+1,l+3];for(let d=0;d5||this.line<0)&&(this.isLedgerLinedRest=!0,this.duration==="h"?(e.custom_glyph_code="rhl",this.x_shift_ledger_rest-=4):this.duration==="w"&&(e.custom_glyph_code="rwl",this.x_shift_ledger_rest-=4,this.y_shift_ledger_rest=-5)),e.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=e.custom_glyph_code,this.stem_up_x_offset=e.stem_up_x_offset||0,this.stem_down_x_offset=e.stem_down_x_offset||0,this.stem_up_y_shift=e.stem_up_y_shift||0,this.stem_down_y_shift=e.stem_down_y_shift||0),this.style=e.style,this.slashed=e.slashed,Vex.Merge(this.render_options,{glyph_font_scale:e.glyph_font_scale||Flow.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return NoteHead.CATEGORY}getWidth(){return this.width}isDisplaced(){return this.displaced===!0}getGlyph(){return this.glyph}setX(e){return this.x=e,this}getY(){return this.y}setY(e){return this.y=e,this}getLine(){return this.line}setLine(e){return this.line=e,this}getAbsoluteX(){const e=this.preFormatted?super.getAbsoluteX():this.x,r=Stem.WIDTH/2;return e+(this.displaced?(this.width-r)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const e=this.stave.getSpacingBetweenLines(),r=e/2,s=this.y-r;return new Flow.BoundingBox(this.getAbsoluteX(),s,this.width,e)}setStave(e){const r=this.getLine();return this.stave=e,this.setY(e.getYForNote(r)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const e=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(e),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const e=this.context;let r=this.getAbsoluteX(),s=this.y;this.custom_glyph&&(r+=this.x_shift_ledger_rest,this.stem_direction===Stem.UP?(r+=this.stem_up_x_offset,s+=this.stem_up_y_shift||0):this.stem_direction===Stem.DOWN&&(r+=this.stem_down_x_offset,s+=this.stem_down_y_shift||0),s+=this.y_shift_ledger_rest),L$i("Drawing note head '",this.note_type,this.duration,"' at",r,s);const o=this.stem_direction,a=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(e),this.note_type==="s"){const l=this.stave.getSpacingBetweenLines();drawSlashNoteHead(e,this.duration,r,s,o,l)}else Glyph.renderGlyph(e,r,s,a,this.glyph_code);this.style&&this.restoreStyle(e)}}class StemmableNote extends Note{constructor(e){super(e),this.setAttribute("type","StemmableNote"),this.stem=null,this.stemExtensionOverride=null,this.beam=null,this.renderFlag=!0}getStem(){return this.stem}setStem(e){return this.stem=e,this}buildStem(){const e=new Stem;return this.setStem(e),this}buildFlag(){const{glyph:e,beam:r}=this,s=r===null&&this.renderFlag;if(e&&e.flag&&s){const o=this.getStemDirection()===Stem.DOWN?e.code_flag_downstem:e.code_flag_upstem;this.flag=new Glyph(o,this.render_options.glyph_font_scale)}}getTopGlyph(){return this.getStemDirection()===Stem.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return Stem.HEIGHT+this.getStemExtension()}getBeamCount(){const e=this.getGlyph();return e?e.beam_count:0}getStemMinumumLength(){let r=Flow.durationToFraction(this.duration).value()<=1?0:20;switch(this.duration){case"8":this.beam==null&&(r=35);break;case"16":r=this.beam==null?35:25;break;case"32":r=this.beam==null?45:35;break;case"64":r=this.beam==null?50:40;break;case"128":r=this.beam==null?55:45;break}return r}getStemDirection(){return this.stem_direction}setStemDirection(e){if(e||(e=Stem.UP),e!==Stem.UP&&e!==Stem.DOWN)throw new Vex.RERR("BadArgument",`Invalid stem direction: ${e}`);if(this.stem_direction=e,this.stem){this.stem.setDirection(e),this.stem.setExtension(this.getStemExtension());const r=this.getTopGlyph()||this.getGlyph();this.stem.setOptions({stem_up_y_offset:r.stem_up_y_offset,stem_down_y_offset:r.stem_down_y_offset})}return this.reset(),this.flag&&this.renderFlag&&this.buildFlag(),this.beam=null,this.preFormatted&&this.preFormat(),this}getStemX(){const e=this.getAbsoluteX()+this.x_shift,r=this.getAbsoluteX()+this.x_shift+this.getGlyphWidth();return this.stem_direction===Stem.DOWN?e:r}getCenterGlyphX(){return this.getAbsoluteX()+this.x_shift+this.getGlyphWidth()/2}getStemExtension(){const e=this.getGlyph();return this.stemExtensionOverride!=null?this.stemExtensionOverride:e?this.getStemDirection()===1?e.stem_up_extension:e.stem_down_extension:0}setStemLength(e){return this.stemExtensionOverride=e-Stem.HEIGHT,this}getStemExtents(){return this.stem.getExtents()}setBeam(e){return this.beam=e,this}getYForTopText(e){const r=this.getStemExtents();return this.hasStem()?Math.min(this.stave.getYForTopText(e),r.topY-this.render_options.annotation_spacing*(e+1)):this.stave.getYForTopText(e)}getYForBottomText(e){const r=this.getStemExtents();return this.hasStem()?Math.max(this.stave.getYForTopText(e),r.baseY+this.render_options.annotation_spacing*e):this.stave.getYForBottomText(e)}hasFlag(){return this.renderFlag&&Flow.getGlyphProps(this.duration).flag&&!this.beam}postFormat(){return this.beam&&this.beam.postFormat(),this.postFormatted=!0,this}drawStem(e){this.checkContext(),this.setRendered(),this.setStem(new Stem(e)),this.stem.setContext(this.context).draw()}}class Modifier extends Element$1{static get CATEGORY(){return"none"}static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4}}static get PositionString(){return{above:Modifier.Position.ABOVE,below:Modifier.Position.BELOW,left:Modifier.Position.LEFT,right:Modifier.Position.RIGHT}}constructor(){super(),this.setAttribute("type","Modifier"),this.width=0,this.note=null,this.index=null,this.text_line=0,this.position=Modifier.Position.LEFT,this.modifier_context=null,this.x_shift=0,this.y_shift=0,this.spacingFromNextModifier=0}getCategory(){return Modifier.CATEGORY}getWidth(){return this.width}setWidth(e){return this.width=e,this}getNote(){return this.note}setNote(e){return this.note=e,this}getIndex(){return this.index}setIndex(e){return this.index=e,this}getModifierContext(){return this.modifier_context}setModifierContext(e){return this.modifier_context=e,this}getPosition(){return this.position}setPosition(e){return this.position=typeof e=="string"?Modifier.PositionString[e]:e,this}setTextLine(e){return this.text_line=e,this}setYShift(e){return this.y_shift=e,this}setSpacingFromNextModifier(e){this.spacingFromNextModifier=e}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(e){this.x_shift=0,this.position===Modifier.Position.LEFT?this.x_shift-=e:this.x_shift+=e}getXShift(){return this.x_shift}draw(){throw this.checkContext(),new Vex.RERR("MethodNotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(e,r){const s=r.getTickContext(),o=s.getExtraPx(),a=s.getX()-o.left-o.extraLeft+this.getSpacingFromNextModifier();e.forEach(l=>{const u=l.getTickContext();l.setStave(r.stave),u.setXOffset(a)})}}class Dot extends Modifier{static get CATEGORY(){return"dots"}static format(e,r){const s=r.right_shift,o=1;if(!e||e.length===0)return!1;const a=[],l={};for(let v=0;vb.line-v.line);let u=s,c=0,d=null,y=null,m=null,g=0;for(let v=0;vc?u:c,d=A,y=S}return r.right_shift+=c,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=Modifier.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return Dot.CATEGORY}setNote(e){this.note=e,this.note.getCategory()==="gracenotes"&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(e){return this.dot_shiftY=e,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index===null)throw new Vex.RERR("NoAttachedNote","Can't draw dot without a note and index.");const e=this.note.stave.options.spacing_between_lines_px,r=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.note.getCategory()==="tabnotes"&&(r.y=this.note.getStemExtents().baseY+1);const s=r.x+this.x_shift+this.width-this.radius;let o=this.dot_shiftY*e;this.note&&this.note.DYMusicScoreType=="jianpu"&&(o=-5);const a=r.y+this.y_shift+o,l=this.context;l.beginPath(),l.arc(s,a,this.radius,0,Math.PI*2,!1),l.fill()}}function L$h(...i){StaveNote.DEBUG&&Vex.L("Vex.Flow.StaveNote",i)}const getStemAdjustment=i=>Stem.WIDTH/(2*-i.getStemDirection()),isInnerNoteIndex=(i,e)=>e===(i.getStemDirection()===Stem.UP?i.keyProps.length-1:0);function shiftRestVertical(i,e,r){if(i.note.shiftRestVerticalDisabled)return;const s=(e.isrest?0:1)*r;i.line+=s,i.maxLine+=s,i.minLine+=s,i.note.setKeyLine(0,i.note.getKeyLine(0)+s)}function centerRest(i,e,r){const s=i.line-Vex.MidLine(e.minLine,r.maxLine);i.note.setKeyLine(0,i.note.getKeyLine(0)-s),i.line-=s,i.maxLine-=s,i.minLine-=s}class StaveNote extends StemmableNote{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return Stem.UP}static get STEM_DOWN(){return Stem.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static renderVibrato(e,r,s,o){let{width:a,height:l,wave_width:u,wave_girth:c,wave_height:d,stem_direction:y}=o;const m=Math.floor(a/u);let g=l/(m/2)*y;g==0&&(y=1,g=.3),e.beginPath(),e.moveTo(r,s+c);for(let v=0;v2?s[1]:null;let c=a>2?s[2]:s[1];a===2&&l.stemDirection===-1&&c.stemDirection===1&&!l.isrest&&!c.isRest&&(l=s[1],c=s[0]);const d=Math.max(l.voice_shift,c.voice_shift);let y=0,m;if(a===2){const g=l.stemDirection===c.stemDirection?0:.5;if(l.stemDirection===c.stemDirection&&l.minLine<=c.maxLine&&(l.isrest||(m=Math.abs(l.line-(c.maxLine+.5)),m=Math.max(m,l.stemMin),l.minLine=l.line-m,l.note.setStemLength(m*10))),l.minLine<=c.maxLine+g)if(l.isrest)shiftRestVertical(l,c,1),l.note.hasLedgerLinedRest&&(l.note.shiftRestVerticalDisabled=!0);else if(c.isrest)shiftRestVertical(c,l,-1),c.note.hasLedgerLinedRest&&(c.note.shiftRestVerticalDisabled=!0);else{y=d;const v=Math.abs(l.line-c.line);let b=0,S=0;l.note.duration==="h"?b++:l.note.duration==="w"&&S++,c.note.duration==="h"?b++:c.note.duration==="w"&&S++;let x=b===1||S===1||l.note.dots!==c.note.dots;if(o&&(x=x||S===2),v===0&&x){if(c.note.setXShift(y),l.note.dots>0){let A=0;for(const E of l.note.modifiers)if(E instanceof Dot&&(A++,E.setYShift(-10*(c.maxLine-l.line+1)),A===l.note.dots))break}}else v<1&&v>0?c.note.setXShift(y):l.note.voice!==c.note.voice&&l.stemDirection===c.stemDirection&&(l.line>c.line?l.stemDirection===1?c.note.renderFlag=!1:l.note.renderFlag=!1:c.line>l.line?c.stemDirection===1?l.note.renderFlag=!1:c.note.renderFlag=!1:c.stemDirection===1&&(c.stemDirection=-1,c.note.setStemDirection(-1)))}return!0}if(u!==null&&u.minLiner.postFormat()),!0):!1}constructor(e){if(super(e),this.setAttribute("type","StaveNote"),this.keys=e.keys,this.clef=e.clef,this.octave_shift=e.octave_shift,this.beam=null,this.vibrato=null,this.slideNote=null,this.glyph=Flow.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(e)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.paddingRight=0,this.note_heads=[],this.modifiers=[],Vex.Merge(this.render_options,{glyph_font_scale:e.glyph_font_scale||Flow.DEFAULT_NOTATION_FONT_SCALE,stroke_px:e.stroke_px||StaveNote.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),e.auto_stem?this.autoStem():this.setStemDirection(e.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const e=this.note_heads.map(s=>s.getStyle()),r=[];this.note_heads.forEach(s=>r.push(s.note_type)),this.buildNoteHeads(),this.note_heads.forEach((s,o)=>{s.setStyle(e[o]),r[o]&&(s.note_type=r[o])}),this.stave&&this.note_heads.forEach(s=>s.setStave(this.stave)),this.calcExtraPx()}setBeam(e){return this.beam=e,this.calcExtraPx(),this}setVibrato(e){this.vibrato=e}setSlideNote(e){this.slideNote=e}getCategory(){return StaveNote.CATEGORY}buildStem(){this.setStem(new Stem({hide:!!this.isRest()})),this.stem.id=Vex.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const e=this.getStemDirection(),r=this.getKeys();let s=null,o=null,a=!1,l,u,c;e===Stem.UP?(l=0,u=r.length,c=1):e===Stem.DOWN&&(l=r.length-1,u=-1,c=-1);for(let d=l;d!==u;d+=c){const y=this.keyProps[d],m=y.line;s===null?s=m:(o=Math.abs(s-m),o===0||o===.5?a=!a:(a=!1,this.use_default_head_x=!0)),s=m;const g=new NoteHead({duration:this.duration,note_type:this.noteType,displaced:a,stem_direction:e,custom_glyph_code:y.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:y.shift_right,stem_up_x_offset:y.stem_up_x_offset,stem_down_x_offset:y.stem_down_x_offset,stem_up_y_shift:y.stem_up_y_shift,stem_down_y_shift:y.stem_down_y_shift,line:y.line});g.isLedgerLinedRest&&(this.hasLedgerLinedRest=!0),this.note_heads[d]=g}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const e=3,s=(this.minLine+this.maxLine)/20&&(this.keyProps[r-1].displaced=!0)),e=l,this.keyProps.push(a)}e=-1/0,this.keyProps.forEach(r=>{r.liner.line-s.line)}getBoundingBox(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:e,modLeftPx:r,extraLeftPx:s}=this.getMetrics(),o=this.getAbsoluteX()-r-s-this.paddingRight;let a=0,l=0;const u=this.getStave().getSpacingBetweenLines()/2,c=u*2;if(this.isRest()){const d=this.ys[0],y=Flow.durationToFraction(this.duration);y.equals(1)||y.equals(2)?(a=d-u,l=d+u):(a=d-this.glyph.line_above*c,l=d+this.glyph.line_below*c)}else if(this.glyph.stem){const d=this.getStemExtents();d.baseY+=u*this.stem_direction,a=Math.min(d.topY,d.baseY),l=Math.max(d.topY,d.baseY)}else{a=null,l=null;for(let d=0;dr&&(r=o):o1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return this.noteType==="r"?this.getCenterGlyphX():super.getStemX()+getStemAdjustment(this)}getYForTopText(e){const r=this.getStemExtents();return Math.min(this.stave.getYForTopText(e),r.topY-this.render_options.annotation_spacing*(e+1))}getYForBottomText(e){const r=this.getStemExtents();return Math.max(this.stave.getYForTopText(e),r.baseY+this.render_options.annotation_spacing*e)}setStave(e){super.setStave(e);const r=this.note_heads.map(s=>(s.setStave(e),s.getY()));if(this.setYs(r),this.stem){const{y_top:s,y_bottom:o}=this.getNoteHeadBounds();this.stem.setYBounds(s,o)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(e){return this.displaced=e,this}getTieRightX(){let e=this.getAbsoluteX();return e+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(e+=this.modifierContext.getExtraRightPx()),e}getTieLeftX(){let e=this.getAbsoluteX();return e+=this.x_shift-this.extraLeftPx,e}getLineForRest(){let e=this.keyProps[0].line;if(this.keyProps.length>1){const r=this.keyProps[this.keyProps.length-1].line,s=Math.max(e,r),o=Math.min(e,r);e=Vex.MidLine(s,o)}return e}getModifierStartXY(e,r,s){if(s=s||{},!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length===0)throw new Vex.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:o,BELOW:a,LEFT:l,RIGHT:u}=Modifier.Position;let c=0;return e===l?c=-1*2:e===u?(c=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===Stem.UP&&this.hasFlag()&&(s.forceFlagRight||isInnerNoteIndex(this,r))&&(c+=this.flag.getMetrics().width)):(e===a||e===o)&&(c=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+c,y:this.ys[r]}}setStyle(e){super.setStyle(e),this.note_heads.forEach(r=>r.setStyle(e)),this.stem&&this.stem.setStyle(e)}setStemStyle(e){this.stem&&this.getStem().setStyle(e)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(e){this.ledgerLineStyle=e}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(e){this.flagStyle=e}getFlagStyle(){return this.flagStyle}setKeyStyle(e,r){return this.note_heads[e].setStyle(r),this}setKeyLine(e,r){return this.keyProps[e].line=r,this.reset(),this}getKeyLine(e){return this.keyProps[e].line}addToModifierContext(e){this.setModifierContext(e);for(let r=0;r{const g=m.getLine(),v=m.getY();(e===null||vr)&&(r=v),o===null&&m.isDisplaced()&&(o=m.getAbsoluteX()),s===null&&!m.isDisplaced()&&(s=m.getAbsoluteX()),a=g>a?g:a,l=g{let T;_&&w?T=S-s:w?T=b-s:T=v-s;const C=w&&_?l:a;o.beginPath(),o.moveTo(T,E),o.lineTo(T+C,E),o.stroke()},A={...e.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(o,A);for(let E=6;E<=u;++E){const w=b!==null&&E<=y,_=v!==null&&E<=d;x(e.getYForNote(E),w,_)}for(let E=0;E>=c;--E){const w=b!==null&&E>=g,_=v!==null&&E>=m;x(e.getYForNote(E),w,_)}this.restoreStyle(o,A)}drawVibrato(){if(this.vibrato){const e=this.context,r=this.vibrato.getNoteHeadEndX()+2;let{y_bottom:s}=this.vibrato.getNoteHeadBounds(),{y_top:o}=this.getNoteHeadBounds();const a=s1&&l.getAttribute("type")==="Accidental"&&this.modifiers.findIndex(y=>y.getAttribute("type")==="GraceNoteGroup")>=0)&&!(l.note&&l.note.DYMusicScoreType=="jianpu"&&l.getAttribute("type")==="Dot"&&!l.note.formatterMetrics.duration)){if(l.note&&l.note.DYMusicScoreType=="jianpu"&&l.getAttribute("type")==="Dot")try{l.note.getModifierStartXY(l.position,0,{forceFlagRight:!0}).x-l.note.x<9&&(l.x_shift+=7)}catch(d){console.log("🚀 ~ error:",d)}l.note&&l.note.DYMusicScoreType=="jianpu"&&(((s=l==null?void 0:l.articulation)==null?void 0:s.code)==="v28"||((o=l==null?void 0:l.articulation)==null?void 0:o.code)==="v42")&&(r="transform"),u.applyStyle(e,c),l.setContext(e),l.drawWithStyle(),u.restoreStyle(e,c)}}e.closeGroup(r),this.drawVibrato(),this.drawSlide()}drawFlag(){const{stem:e,beam:r,context:s}=this;if(!s)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");const o=r===null&&this.renderFlag;if(this.getGlyph().flag&&o){const{y_top:l,y_bottom:u}=this.getNoteHeadBounds(),c=e.getHeight(),d=this.getStemX();let y=this.getStemDirection()===Stem.DOWN?l-c+2:u-c-2;if(e&&!r){const m=this.keyProps[0].line;(m>6.5||m<-.5)&&(y=y+(m>6.5?(m-6.5)*10:(m+.5)*10))}s.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(s,this.getFlagStyle()||!1),this.flag.render(s,d,y),this.restoreStyle(s,this.getFlagStyle()||!1),s.closeGroup()}}drawNoteHeads(){this.note_heads.forEach(e=>{this.context.openGroup("notehead",null,{pointerBBox:!0});try{if(this.isRest()&&this.duration==="w"){const r=this.stave.options.line_config.filter(o=>o.visible).length;this.keyProps[0].line===4&&r<5&&e.setY(e.getY()+10),r===1&&e.setLine(3)}}catch(r){}e.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(e){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");e&&this.setStem(new Stem(e)),this.stem.id=Vex.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");if(this.ys.length===0)throw new Vex.RERR("NoYValues","Can't draw note without Y values.");const e=this.stave.getLines();if(e===2||e===3||e===4)for(let o=0;oo.setX(r)),this.stem){let o=this.getStemX();const a=this.keyProps[0].line;(a>6.5||a<-.5)&&(this.beam||(this.stem.renderHeightAdjustment=a>6.5?(a-6.5)*10:Math.abs(a+.5)*10)),this.stem.setNoteHeadXBounds(o,o)}L$h("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),s&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class FretHandFinger extends Modifier{static get CATEGORY(){return"frethandfinger"}static format(e,r){const{left_shift:s,right_shift:o}=r,a=1;if(!e||e.length===0)return!1;const l=[];let u=null,c=0,d=0;for(let x=0;xA.line-x.line);let y=0,m=0,g=0,v=0,b=null,S=null;for(let x=0;xg?A:g):w===Modifier.Position.RIGHT&&(_.setXShift(m),A=d+k,v=A>v?A:v),b=T,S=E}return r.left_shift+=g,r.right_shift+=v,!0}constructor(e){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=e,this.width=7,this.position=Modifier.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return FretHandFinger.CATEGORY}setFretHandFinger(e){return this.finger=e,this}setOffsetX(e){return this.x_offset=e,this}setOffsetY(e){return this.y_offset=e,this}draw(){if(this.checkContext(),!this.note||this.index==null)throw new Vex.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.context,r=this.note.getModifierStartXY(this.position,this.index);let s=r.x+this.x_shift+this.x_offset,o=r.y+this.y_shift+this.y_offset+5;switch(this.position){case Modifier.Position.ABOVE:s-=4,o-=12;break;case Modifier.Position.BELOW:s-=2,o+=10;break;case Modifier.Position.LEFT:s-=this.width;break;case Modifier.Position.RIGHT:s+=1;break;default:throw new Vex.RERR("InvalidPostion",`The position ${this.position} does not exist`)}e.save(),e.setFont(this.font.family,this.font.size,this.font.weight),e.fillText(""+this.finger,s,o),e.restore()}}class Music{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:Music.scales.major,m:Music.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(e){return!(e==null||e<0||e>=Music.NUM_TONES)}isValidIntervalValue(e){return this.isValidNoteValue(e)}getNoteParts(e){if(!e||e.length<1)throw new Vex.RERR("BadArguments","Invalid note name: "+e);if(e.length>3)throw new Vex.RERR("BadArguments","Invalid note name: "+e);const r=e.toLowerCase(),o=/^([cdefgab])(b|bb|n|#|##)?$/.exec(r);if(o!=null){const a=o[1],l=o[2];return{root:a,accidental:l}}else throw new Vex.RERR("BadArguments","Invalid note name: "+e)}getKeyParts(e){if(!e||e.length<1)throw new Vex.RERR("BadArguments","Invalid key: "+e);const r=e.toLowerCase(),o=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(r);if(o!=null){const a=o[1],l=o[2];let u=o[3];return u||(u="M"),{root:a,accidental:l,type:u}}else throw new Vex.RERR("BadArguments",`Invalid key: ${e}`)}getNoteValue(e){const r=Music.noteValues[e];if(r==null)throw new Vex.RERR("BadArguments",`Invalid note name: ${e}`);return r.int_val}getIntervalValue(e){const r=Music.intervals[e];if(r==null)throw new Vex.RERR("BadArguments",`Invalid interval name: ${e}`);return r}getCanonicalNoteName(e){if(!this.isValidNoteValue(e))throw new Vex.RERR("BadArguments",`Invalid note value: ${e}`);return Music.canonical_notes[e]}getCanonicalIntervalName(e){if(!this.isValidIntervalValue(e))throw new Vex.RERR("BadArguments",`Invalid interval value: ${e}`);return Music.diatonic_intervals[e]}getRelativeNoteValue(e,r,s){if(s==null&&(s=1),s!==1&&s!==-1)throw new Vex.RERR("BadArguments",`Invalid direction: ${s}`);let o=(e+s*r)%Music.NUM_TONES;return o<0&&(o+=Music.NUM_TONES),o}getRelativeNoteName(e,r){const s=this.getNoteParts(e),o=this.getNoteValue(s.root);let a=r-o;if(Math.abs(a)>Music.NUM_TONES-3){let u=1;a>0&&(u=-1);const c=(r+1+(o+1))%Music.NUM_TONES*u;if(Math.abs(c)>2)throw new Vex.RERR("BadArguments",`Notes not related: ${e}, ${r})`);a=c}if(Math.abs(a)>2)throw new Vex.RERR("BadArguments",`Notes not related: ${e}, ${r})`);let l=s.root;if(a>0)for(let u=1;u<=a;++u)l+="#";else if(a<0)for(let u=-1;u>=a;--u)l+="b";return l}getScaleTones(e,r){const s=[e];let o=e;for(let a=0;ai.getMetrics().width;class Accidental extends Modifier{static get CATEGORY(){return"accidentals"}static format(e,r){const o=r.left_shift+1,a=3;if(!e||e.length===0)return;const l=[];let u=null,c=0,d;for(let E=0;Ew.line-E.line);const y=[];let m=0,g=null;for(let E=0;Em?w.shift:m,g=w.line}let v=0;for(let E=0;Ey[_+I],P=I=>I.map(C),k=(I,U)=>{const[D,$]=P([I,U]).map(N=>N.line);return D-$},M=(...I)=>I.map(P).every(U=>!this.checkCollision(...U)),R=T-_+1;let H=this.checkCollision(y[_],y[T])?"a":"b";switch(R){case 3:H==="a"&&k(1,2)===.5&&k(0,1)!==.5&&(H="second_on_bottom");break;case 4:M([0,2],[1,3])&&(H="spaced_out_tetrachord");break;case 5:H==="b"&&M([1,3])&&(H="spaced_out_pentachord",M([0,2],[2,4])&&(H="very_spaced_out_pentachord"));break;case 6:M([0,3],[1,4],[2,5])&&(H="spaced_out_hexachord"),M([0,2],[2,4],[1,3],[3,5])&&(H="very_spaced_out_hexachord");break}let B,F;if(R>=7){let I=2,U=!0;for(;U===!0;){U=!1;for(let D=0;D+IF?v:F}else for(B=E;B<=T;B++)F=Flow.accidentalColumnsTable[R][H][B-E],y[B].column=F,v=v>F?v:F;E=T}const b=[],S=[];for(let E=0;E<=v;E++)b[E]=0,S[E]=0;b[0]=m+o,S[0]=m+o,y.forEach(E=>{E.width>b[E.column]&&(b[E.column]=E.width)});for(let E=1;E{let w=0;const _=A+E.numAcc;for(A;A<_;A++){const T=S[E.column-1]+w;l[A].acc.setXShift(T),w+=l[A].acc.getWidth()+a,L$g("Line, accCount, shift: ",E.line,A,T)}}),r.left_shift+=x}static checkCollision(e,r){let s=r.line-e.line,o=3;s>0?(o=r.flatLine||r.dblSharpLine?2.5:3,e.dblSharpLine&&(s-=.5)):(o=e.flatLine||e.dblSharpLine?2.5:3,r.dblSharpLine&&(s-=.5));const a=Math.abs(s){const c=new Fraction(0,1);u.getTickables().forEach(y=>{if(y.shouldIgnoreTicks())return;const m=o[c.value()];m?m.push(y):(s.push(c.value()),o[c.value()]=[y]),c.add(y.getTicks())})});const a=new Music;r||(r="C");const l=a.createScaleMap(r);s.forEach(u=>{const c=o[u],d=[],y=m=>{m.isRest()||m.shouldIgnoreTicks()||(m.keys.forEach((g,v)=>{const b=a.getNoteParts(g.split("/")[0]),S=b.accidental||"n",x=b.root+S,A=l[b.root]===x,E=d.indexOf(x)>-1;if(!A||A&&E){l[b.root]=x;const w=new Accidental(S);m.addAccidental(v,w),d.push(x)}}),m.getModifiers().forEach(g=>{g.getCategory()==="gracenotegroups"&&g.getGraceNotes().forEach(y)}))};c.forEach(y)})}constructor(e=null){if(super(),this.setAttribute("type","Accidental"),L$g("New accidental: ",e),this.note=null,this.index=null,this.type=e,this.position=Modifier.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=Flow.accidentalCodes(this.type),!this.accidental)throw new Vex.RERR("ArgumentError",`Unknown accidental type: ${e}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const e=this.render_options.font_scale;this.glyph=new Glyph(this.accidental.code,e),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new Glyph(Flow.accidentalCodes("{").code,e),this.parenRight=new Glyph(Flow.accidentalCodes("}").code,e),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return Accidental.CATEGORY}getWidth(){const e=this.cautionary?getGlyphWidth(this.parenLeft)+getGlyphWidth(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return getGlyphWidth(this.glyph)+e}setNote(e){if(!e)throw new Vex.RERR("ArgumentError",`Bad note value: ${e}`);this.note=e,this.note.getCategory()==="gracenotes"&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:e,type:r,position:s,note:o,index:a,cautionary:l,x_shift:u,y_shift:c,glyph:d,parenLeft:y,parenRight:m,render_options:{parenLeftPadding:g,parenRightPadding:v}}=this;if(this.checkContext(),!(o&&a!=null))throw new Vex.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const b=o.getModifierStartXY(s,a);let S=b.x+u;const x=b.y+c;L$g("Rendering: ",r,S,x),l?(m.render(e,S,x),S-=getGlyphWidth(m),S-=v,S-=this.accidental.parenRightPaddingAdjustment,d.render(e,S,x),S-=getGlyphWidth(d),S-=g,y.render(e,S,x)):d.render(e,S,x),this.setRendered()}}let NoteSubGroup$1=class zi extends Modifier{static get CATEGORY(){return"notesubgroup"}static format(e,r){if(!e||e.length===0)return!1;let s=0;for(let o=0;o{r.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Formatter,this.voice=new Voice$1({num_beats:4,beat_value:4,resolution:Flow.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return zi.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(e){this.note=e}setWidth(e){this.width=e}getWidth(){return this.width}draw(){this.checkContext();const e=this.getNote();if(!(e&&this.index!==null))throw new Vex.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,e),this.subNotes.forEach(r=>r.setContext(this.context).drawWithStyle())}};class StaveTie extends Element$1{constructor(e,r){super(),this.setAttribute("type","StaveTie"),this.notes=e,this.context=null,this.text=r,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:15,style:""}},this.font=this.render_options.font,this.setNotes(e)}setFont(e){return this.font=e,this}setDirection(e){return this.direction=e,this}setNotes(e){if(!e.first_note&&!e.last_note)throw new Vex.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(e.first_indices||(e.first_indices=[0]),e.last_indices||(e.last_indices=[0]),e.first_indices.length!==e.last_indices.length)throw new Vex.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=e.first_note,this.first_indices=e.first_indices,this.last_note=e.last_note,this.last_indices=e.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(e){if(e.first_ys.length===0||e.last_ys.length===0)throw new Vex.RERR("BadArguments","No Y-values to render");const r=this.context;let s=this.render_options.cp1,o=this.render_options.cp2;Math.abs(e.last_x_px-e.first_x_px)<10&&(s=2,o=8);const a=this.render_options.first_x_shift,l=this.render_options.last_x_shift,u=this.render_options.y_shift*e.direction;for(let c=0;cg&&Math.abs(y-g)<10?-6:0;if(this.first_note&&this.first_note.DYMusicScoreType==="jianpu"){if(this.getAttribute("type")==="TabTie")continue;y1){const r=new Beam$1(e);r.render_options.beam_width=3,r.render_options.partial_beam_length=4,this.beams.push(r)}return this}setNote(e){this.note=e}setWidth(e){this.width=e}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const e=this.getNote();if(L$f("Drawing grace note group for:",e),!(e&&this.index!==null))throw new Vex.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),e),this.grace_notes.forEach(r=>{r.setContext(this.context).draw()}),this.beams.forEach(r=>{r.setContext(this.context).draw()}),this.show_slur){const r=this.getNote().getCategory()===StaveNote.CATEGORY,s=r?StaveTie:TabTie;this.slur=new s({last_note:this.grace_notes[0],first_note:e,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(r?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class Stroke extends Modifier{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(e,r){const s=r.left_shift,o=0;if(!e||e.length===0)return this;const a=e.map(c=>{const d=c.getNote();if(d instanceof StaveNote){const{line:y,displaced:m}=d.getKeyProps()[c.getIndex()],g=m?d.getExtraLeftPx():0;return{line:y,shift:g,stroke:c}}else{const{str:y}=d.getPositions()[c.getIndex()];return{line:y,shift:0,stroke:c}}}),l=s,u=a.reduce((c,{stroke:d,shift:y})=>(d.setXShift(l+y),Math.max(d.getWidth()+o,c)),0);return r.left_shift+=u,!0}constructor(e,r){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=Vex.Merge({},r),this.all_voices="all_voices"in this.options?this.options.all_voices:!0,this.note_end=null,this.index=null,this.type=e,this.position=Modifier.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return Stroke.CATEGORY}getPosition(){return this.position}addEndNote(e){return this.note_end=e,this}draw(){if(this.checkContext(),this.setRendered(),!(this.note&&this.index!=null))throw new Vex.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const e=this.note.getModifierStartXY(this.position,this.index);let r=this.note.getYs(),s=e.y,o=e.y;const a=e.x-5,l=this.note.stave.options.spacing_between_lines_px,u=this.getModifierContext().getModifiers(this.note.getCategory());for(let v=0;vT.line-_.line);let S=0,x=0,A=0,E=null,w=null;for(y=0;yx?_:x):v===Modifier.Position.RIGHT&&(m.setXShift(S),_+=P,A=_>A?_:A),E=T,w=g}return r.left_shift+=x,r.right_shift+=A,!0}constructor(e){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=e,this.setWidth(20),this.position=Modifier.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=Renderer.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return StringNumber.CATEGORY}getNote(){return this.note}setNote(e){return this.note=e,this}getIndex(){return this.index}setIndex(e){return this.index=e,this}setLineEndType(e){return e>=Renderer.LineEndType.NONE&&e<=Renderer.LineEndType.DOWN&&(this.leg=e),this}setStringNumber(e){return this.string_number=e,this}setOffsetX(e){return this.x_offset=e,this}setOffsetY(e){return this.y_offset=e,this}setLastNote(e){return this.last_note=e,this}setDashed(e){return this.dashed=e,this}draw(){const e=this.checkContext();if(!(this.note&&this.index!=null))throw new Vex.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const r=this.note.stave.options.spacing_between_lines_px,s=this.note.getModifierStartXY(this.position,this.index);let o=s.x+this.x_shift+this.x_offset,a=s.y+this.y_shift+this.y_offset;switch(this.position){case Modifier.Position.ABOVE:case Modifier.Position.BELOW:{const u=this.note.getStemExtents();let c=u.topY,d=u.baseY+2;this.note.stem_direction===StaveNote.STEM_DOWN&&(c=u.baseY,d=u.topY-2),this.position===Modifier.Position.ABOVE?a=this.note.hasStem()?c-r*1.75:s.y-r*1.75:a=this.note.hasStem()?d+r*1.5:s.y+r*1.75,a+=this.y_shift+this.y_offset;break}case Modifier.Position.LEFT:o-=this.radius/2+5;break;case Modifier.Position.RIGHT:o+=this.radius/2+6;break;default:throw new Vex.RERR("InvalidPosition",`The position ${this.position} is invalid`)}e.save(),e.beginPath(),e.arc(o,a,this.radius,0,Math.PI*2,!1),e.lineWidth=1.5,e.stroke(),e.setFont(this.font.family,this.font.size,this.font.weight);const l=o-e.measureText(this.string_number).width/2;if(e.fillText(""+this.string_number,l,a+4.5),this.last_note!=null){const u=this.last_note.getStemX()-this.note.getX()+5;e.strokeStyle="#000000",e.lineCap="round",e.lineWidth=.6,this.dashed?Renderer.drawDashedLine(e,o+10,a,o+u,a,[3,3]):Renderer.drawDashedLine(e,o+10,a,o+u,a,[3,0]);let c,d;switch(this.leg){case Renderer.LineEndType.UP:c=-10,d=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(e,o+u,a,o+u,a+c,d);break;case Renderer.LineEndType.DOWN:c=10,d=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(e,o+u,a,o+u,a+c,d);break}}e.restore()}}class TickContext extends Tickable{static getNextContext(e){const r=e.tContexts,s=r.indexOf(e);return r[s+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new Fraction(0,1),this.maxTicks=new Fraction(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}getX(){return this.x}setX(e){return this.x=e,this.xBase=e,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(e){this.xBase=e,this.x=e+this.xOffset}getXOffset(){return this.xOffset}setXOffset(e){this.xOffset=e,this.x=this.xBase+e}getWidth(){return this.width+this.padding*2}setPadding(e){return this.padding=e,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(e=>e.isCenterAligned())}getMetrics(){const{width:e,notePx:r,extraLeftPx:s,extraRightPx:o}=this;return{width:e,notePx:r,extraLeftPx:s,extraRightPx:o}}getCurrentTick(){return this.currentTick}setCurrentTick(e){this.currentTick=e,this.preFormatted=!1}getExtraPx(){let e=0,r=0,s=0,o=0;for(let a=0;ai(e/.5)*.5,isWithinLines=(i,e)=>e===ABOVE?i<=5:i>=1,getRoundingFunction=(i,e)=>isWithinLines(i,e)?e===ABOVE?Math.ceil:Math.floor:Math.round,snapLineToStaff=(i,e,r,s)=>{const o=roundToNearestHalf(getRoundingFunction(e,r),e),a=i&&isWithinLines(o,r),l=o%1===0;return a&&l?o+.5*-s:o},isStaveNote=i=>{const e=i.getCategory();return e==="stavenotes"||e==="gracenotes"},isTabNote=i=>{const e=i.getCategory();return e==="tabnotes"||e==="numberednotes"},getTopY=(i,e)=>{const r=i.getStave(),s=i.getStemDirection(),{topY:o,baseY:a}=i.getStemExtents();if(isStaveNote(i))return i.hasStem()?s===Stem.UP?o:a:Math.min(...i.getYs());if(isTabNote(i))return i.hasStem()&&s===Stem.UP?o:r.getYForTopText(e);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getBottomY=(i,e)=>{const r=i.getStave(),s=i.getStemDirection(),{topY:o,baseY:a}=i.getStemExtents();if(isStaveNote(i))return i.hasStem()?s===Stem.UP?a:o:Math.max(...i.getYs());if(isTabNote(i))return i.hasStem()?s===Stem.UP?r.getYForBottomText(e):o:r.getYForBottomText(e);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getInitialOffset=(i,e)=>{const r=e===ABOVE&&i.getStemDirection()===Stem.UP||e===BELOW&&i.getStemDirection()===Stem.DOWN;return isStaveNote(i)?i.hasStem()&&r?.5:1:i.hasStem()&&r?1:0};let Articulation$1=class Ei extends Modifier{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(e,r){if(!e||e.length===0)return!1;const s=c=>c.getPosition()===ABOVE,o=c=>c.getPosition()===BELOW,a=.5,l=(c,d,y)=>roundToNearestHalf(getRoundingFunction(d,y),c.glyph.getMetrics().height/10+a);e.filter(s).forEach(c=>{c.setTextLine(r.top_text_line),r.top_text_line+=l(c,r.top_text_line,ABOVE)}),e.filter(o).forEach(c=>{c.setTextLine(r.text_line),r.text_line+=l(c,r.text_line,BELOW)});const u=e.map(c=>c.getWidth()).reduce((c,d)=>Math.max(d,c));return r.left_shift+=u/2,r.right_shift+=u/2,!0}static easyScoreHook({articulations:e},r,s){if(!e)return;const o={staccato:"a.",tenuto:"a-"};e.split(",").map(a=>a.trim().split(".")).map(([a,l])=>{const u={type:o[a]};return l&&(u.position=Modifier.PositionString[l]),s.getFactory().Articulation(u)}).map(a=>r.addModifier(0,a))}constructor(e){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=e,this.position=BELOW,this.render_options={font_scale:38},this.breathMarkDistance=.8,this.articulation=Flow.articulationCodes(this.type),this.type==="abr"&&(this.articulation={code:"v6c",between_lines:!1}),!this.articulation)throw new Vex.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new Glyph(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return Ei.CATEGORY}draw(){const{note:e,index:r,position:s,glyph:o,articulation:{between_lines:a},text_line:l,context:u}=this;if(this.checkContext(),!e||r==null)throw new Vex.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const c=e.getStave(),d=c.getSpacingBetweenLines(),y=e.getCategory()==="tabnotes";let{x:m}=e.getModifierStartXY(s,r);if(this.type==="abr"){let x=0;const A=e.getTickContext(),E=TickContext.getNextContext(A),w=e.getTickContext().getX();if(E)x=(E.getX()-w)*this.breathMarkDistance;else{const _=e.getStave();x=(_.getX()+_.getWidth()-w)*this.breathMarkDistance}m+=x}const g=this.getXShift();g&&(m+=g);const v=!a||y,b=getInitialOffset(e,s);let S={[ABOVE]:()=>{o.setOrigin(.5,1);const x=getTopY(e,l)-(l+b)*d+(this.y_shift||0);return v?Math.min(c.getYForTopText(Ei.INITIAL_OFFSET),x):x},[BELOW]:()=>{o.setOrigin(.5,0);const x=getBottomY(e,l)+(l+b)*d;return v?Math.max(c.getYForBottomText(Ei.INITIAL_OFFSET),x):x}}[s]();if(!y){const x=s===ABOVE?-1:1,A=y?e.positions[r].str:e.getKeyProps()[r].line,w=(e.getYs()[r]-S)/d+A,_=snapLineToStaff(a,w,s,x);isWithinLines(_,s)&&o.setOrigin(.5,.5),S+=Math.abs(_-w)*d*x}L$e(`Rendering articulation at (x: ${m}, y: ${S})`),o.render(u,m,S)}};function L$d(...i){Ornament.DEBUG&&Vex.L("Vex.Flow.Ornament",i)}class Ornament extends Modifier{static get CATEGORY(){return"ornaments"}static format(e,r){if(!e||e.length===0)return!1;let s=0;for(let o=0;o0&&o--;for(let c=0;c{L$b("Preformatting ModifierContext: ",e.CATEGORY),e.format(this.getModifiers(e.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(e=>{L$b("Postformatting ModifierContext: ",e.CATEGORY),e.postFormat(this.getModifiers(e.CATEGORY),this)})}}function L$a(...i){Formatter.DEBUG&&Vex.L("Vex.Flow.Formatter",i)}function getNext(i,e){var s,o;const r=i[e+1];return r&&((s=r==null?void 0:r.keys)!=null&&s.includes("b/4"))||(o=r==null?void 0:r.keys)!=null&&o.includes("r/4")?getNext(i,e+1):r}function lookAhead(i,e,r,s){let o=e;for(r+=1;r{if(c.getMode()===Voice$1.Mode.STRICT&&!c.isComplete())throw new Vex.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(u,Fraction.LCM(u,c.getResolutionMultiplier()))},1),o={},a=[],l=[];return i.forEach(u=>{const c=new Fraction(0,s);u.getTickables().forEach(d=>{const y=c.numerator;if(!o[y]){const m=new e;l.push(m),o[y]=m}r(d,o[y]),a.push(y),c.add(d.getTicks())})}),{map:o,array:l,list:Vex.SortAndUnique(a,(u,c)=>u-c,(u,c)=>u===c),resolutionMultiplier:s}}class Formatter{static SimpleFormat(e,r=0,{paddingBetween:s=10}={}){e.reduce((o,a)=>{a.addToModifierContext(new ModifierContext);const l=new TickContext().addTickable(a).preFormat(),u=l.getExtraPx();return l.setX(o+u.left),o+l.getWidth()+u.right+s},r)}static plotDebugging(e,r,s,o,a){const l=s+Note.STAVEPADDING,u=r.contextGaps;function c(d,y,m){e.beginPath(),e.setStrokeStyle(m),e.setFillStyle(m),e.setLineWidth(1),e.fillRect(d,o,y-d,a-o)}e.save(),e.setFont("Arial",8,""),u.gaps.forEach(d=>{c(l+d.x1,l+d.x2,"#aaa"),e.fillText(Math.round(d.x2-d.x1),l+d.x1,a+12)}),e.fillText(Math.round(u.total)+"px",l-20,a+12),e.setFillStyle("red"),e.fillText("Loss: "+r.lossHistory.map(d=>Math.round(d)),l-20,a+22),e.restore()}static FormatAndDraw(e,r,s,o){const a={auto_beam:!1,align_rests:!1};typeof o=="object"?Vex.Merge(a,o):typeof o=="boolean"&&(a.auto_beam=o);const l=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(s),u=a.auto_beam?Beam$1.applyAndGetBeams(l):[];return new Formatter().joinVoices([l],{align_rests:a.align_rests}).formatToStave([l],r,{align_rests:a.align_rests,stave:r}),l.setStave(r).draw(e,r),u.forEach(c=>c.setContext(e).draw()),l.getBoundingBox()}static FormatAndDrawTab(e,r,s,o,a,l,u){const c={auto_beam:l,align_rests:!1};typeof u=="object"?Vex.Merge(c,u):typeof u=="boolean"&&(c.auto_beam=u);const d=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(a),y=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(o),m=c.auto_beam?Beam$1.applyAndGetBeams(d):[];new Formatter().joinVoices([d],{align_rests:c.align_rests}).joinVoices([y]).formatToStave([d,y],s,{align_rests:c.align_rests}),d.draw(e,s),y.draw(e,r),m.forEach(g=>g.setContext(e).draw()),new StaveConnector(s,r).setContext(e).draw()}static AlignRestsToNotes(e,r,s){return e.forEach((o,a)=>{if(o instanceof StaveNote&&o.isRest()){if(o.tuplet&&!s)return;const l=o.getGlyph().position.toUpperCase();if(l!=="R/4"&&l!=="B/4")return;if(r||o.beam!=null){const u=o.getKeyProps()[0];if(a===0)u.line=lookAhead(e,u.line,a,!1),o.setKeyLine(0,u.line);else if(a>0&&a0){const S=v<1.5?Math.abs(v-1.5)*u:0;b.setResetHeight(S)}else{const S=v>4.5?Math.abs(v-4.5)*u:0;b.setResetHeight(S)}}}}}}),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new Fraction(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(e,r){if(!e||!e.length)throw new Vex.RERR("BadArgument","No voices to format rests");e.forEach(s=>Formatter.AlignRestsToNotes(s.getTickables(),r))}preCalculateMinTotalWidth(e){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!e)throw new Vex.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(e)}const{list:r,map:s}=this.tickContexts;return this.minTotalWidth=r.map(o=>{const a=s[o];return a.preFormat(),a.getWidth()}).reduce((o,a)=>o+a,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new Vex.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(e){const r=createContexts(e,ModifierContext,(s,o)=>s.addToModifierContext(o));return this.modiferContexts=r,r}createTickContexts(e){const r=createContexts(e,TickContext,(s,o)=>o.addTickable(s));return r.array.forEach(s=>{s.tContexts=r.array}),this.totalTicks=e[0].getTicksUsed().clone(),this.tickContexts=r,r}preFormat(e=0,r,s,o){const a=this.tickContexts,{list:l,map:u,resolutionMultiplier:c}=a;s&&o&&s.forEach(x=>x.setStave(o).preFormat());let d=0,y=0;const m=e/2;if(this.minTotalWidth=0,l.forEach(x=>{const A=u[x];r&&A.setContext(r),A.preFormat();const E=A.getWidth();this.minTotalWidth+=E;const w=A.getMetrics();d=d+y+w.extraLeftPx,A.setX(d),y=E-w.extraLeftPx}),this.minTotalWidth=d+y,this.hasMinTotalWidth=!0,e<=0)return;const g=e-this.minTotalWidth;let v=this.totalTicks.value();v===0&&(v=1);const b=g/(v*c);let S=0;l.forEach((x,A)=>{const E=l[A-1]||0,w=u[x],_=(x-E)*b;S+=_,w.setX(w.getX()+S),w.getCenterAlignedTickables().forEach(T=>{T.center_x_shift=m-w.getX()})}),l.length!==1&&(this.justifyWidth=e,this.lossHistory=[],this.evaluate())}evaluate(){const e=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((a,l)=>{if(l===0)return;const u=this.tickContexts.list[l-1],c=this.tickContexts.map[u],d=this.tickContexts.map[a],y=c.getMetrics(),m=c.getX()+y.width,g=d.getX(),v=g-m;this.contextGaps.total+=v,this.contextGaps.gaps.push({x1:m,x2:g}),d.getFormatterMetrics().freedom.left=v,c.getFormatterMetrics().freedom.right=v});const r=this.durationStats={};function s(a,l){const u=r[a];u===void 0?r[a]={mean:l,count:1}:(u.count+=1,u.mean=(u.mean+l)/2)}this.voices.forEach(a=>{a.getTickables().forEach((l,u,c)=>{const d=l.getTicks().clone().simplify().toString(),y=l.getMetrics(),m=l.getFormatterMetrics(),g=l.getX()+y.noteWidth+y.modRightPx+y.extraRightPx;let v=0;if(u{a.getTickables().forEach(l=>{const u=l.getTicks().clone().simplify().toString(),c=l.getFormatterMetrics();c.iterations+=1,c.space.deviation=c.space.used-r[u].mean,c.duration=u,c.space.mean=r[u].mean,o+=Math.pow(r[u].mean,2)})}),this.totalCost=Math.sqrt(o),this.lossHistory.push(this.totalCost),this}tune(){const e=o=>o.reduce((a,l)=>a+l);function r(o,a,l,u){o.setX(o.getX()+u),o.getFormatterMetrics().freedom.left+=u,o.getFormatterMetrics().freedom.right-=u,a&&(a.getFormatterMetrics().freedom.right+=u),l&&(l.getFormatterMetrics().freedom.left-=u)}let s=0;return this.tickContexts.list.forEach((o,a,l)=>{const u=this.tickContexts.map[o],c=a>0?this.tickContexts.map[l[a-1]]:null,d=ag.getFormatterMetrics().space.deviation));y>0?s=-Math.min(u.getFormatterMetrics().freedom.right,Math.abs(y)):y<0&&(d?s=Math.min(d.getFormatterMetrics().freedom.right,Math.abs(y)):s=0);const m=Math.min(5,Math.abs(s));s=s>0?m:-m}),this.evaluate()}postFormat(){const e=r=>r.list.forEach(s=>r.map[s].postFormat());return e(this.modiferContexts),e(this.tickContexts),this}joinVoices(e){return this.createModifierContexts(e),this.hasMinTotalWidth=!1,this}format(e,r,s){const o={align_rests:!1,context:null,stave:null};return Vex.Merge(o,s),this.voices=e,this.alignRests(e,o.align_rests),this.createTickContexts(e),this.preFormat(r,o.context,e,o.stave),this}formatToStave(e,r,s){const o=r.getNoteEndX()-r.getNoteStartX()-10;L$a("Formatting voices to width: ",o);const a={context:r.getContext()};return Vex.Merge(a,s),this.format(e,o,a)}}class StaveModifier extends Element$1{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=StaveModifier.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(e){return this.position=e,this}getStave(){return this.stave}setStave(e){return this.stave=e,this}getWidth(){return this.width}setWidth(e){return this.width=e,this}getX(){return this.x}setX(e){return this.x=e,this}getCategory(){return""}makeSpacer(e){return{getContext(){return!0},setStave(){},renderToStave(){},getMetrics(){return{width:e}}}}placeGlyphOnLine(e,r,s){e.setYShift(r.getYForLine(s)-r.getYForGlyphs())}getPadding(e){return e!==void 0&&e<2?0:this.padding}setPadding(e){return this.padding=e,this}setLayoutMetrics(e){return this.layoutMetrics=e,this}getLayoutMetrics(){return this.layoutMetrics}}class Barline extends StaveModifier{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:Barline.type.SINGLE,double:Barline.type.DOUBLE,end:Barline.type.END,repeatBegin:Barline.type.REPEAT_BEGIN,repeatEnd:Barline.type.REPEAT_END,repeatBoth:Barline.type.REPEAT_BOTH,none:Barline.type.NONE}}constructor(e){super(),this.setAttribute("type","Barline"),this.thickness=Flow.STAVE_LINE_THICKNESS;const r=Barline.type;this.widths={},this.widths[r.SINGLE]=5,this.widths[r.DOUBLE]=5,this.widths[r.END]=5,this.widths[r.REPEAT_BEGIN]=5,this.widths[r.REPEAT_END]=5,this.widths[r.REPEAT_BOTH]=5,this.widths[r.NONE]=5,this.paddings={},this.paddings[r.SINGLE]=0,this.paddings[r.DOUBLE]=0,this.paddings[r.END]=0,this.paddings[r.REPEAT_BEGIN]=15,this.paddings[r.REPEAT_END]=15,this.paddings[r.REPEAT_BOTH]=15,this.paddings[r.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[r.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[r.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(StaveModifier.Position.BEGIN),this.setType(e)}getCategory(){return Barline.CATEGORY}getType(){return this.type}setType(e){return this.type=typeof e=="string"?Barline.typeString[e]:e,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(e){switch(e.checkContext(),this.setRendered(),this.type){case Barline.type.SINGLE:this.drawVerticalBar(e,this.x,!1);break;case Barline.type.DOUBLE:this.drawVerticalBar(e,this.x,!0);break;case Barline.type.END:this.drawVerticalEndBar(e,this.x);break;case Barline.type.REPEAT_BEGIN:this.drawRepeatBar(e,this.x,!0),e.getX()!==this.x&&this.drawVerticalBar(e,e.getX());break;case Barline.type.REPEAT_END:this.drawRepeatBar(e,this.x,!1);break;case Barline.type.REPEAT_BOTH:this.drawRepeatBar(e,this.x,!1),this.drawRepeatBar(e,this.x,!0);break}}drawVerticalBar(e,r,s){e.checkContext();const o=e.getTopLineTopY(),a=e.getBottomLineBottomY();s&&e.context.fillRect(r-3,o,1,a-o),e.context.fillRect(r,o,1,a-o)}drawVerticalEndBar(e,r){e.checkContext();const s=e.getTopLineTopY(),o=e.getBottomLineBottomY();e.context.fillRect(r-5,s,1,o-s),e.context.fillRect(r-2,s,3,o-s)}drawRepeatBar(e,r,s){e.checkContext();const o=e.getTopLineTopY(),a=e.getBottomLineBottomY();let l=3;s||(l=-5),e.context.fillRect(r+l,o,1,a-o),e.context.fillRect(r-2,o,3,a-o);const u=2;s?l+=4:l-=4;const c=r+l+u/2;let d=(e.getNumLines()-1)*e.getSpacingBetweenLines();d=d/2-e.getSpacingBetweenLines()/2;let y=o+d+u/2;e.context.beginPath(),e.context.arc(c,y,u,0,Math.PI*2,!1),e.context.fill(),y+=e.getSpacingBetweenLines(),e.context.beginPath(),e.context.arc(c,y,u,0,Math.PI*2,!1),e.context.fill()}}let Repetition$1=class Vt extends StaveModifier{static get CATEGORY(){return"repetitions"}static get type(){return{NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13}}constructor(e,r,s){super(),this.setAttribute("type","Repetition"),this.symbol_type=e,this.x=r,this.x_shift=0,this.y_shift=s,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return Vt.CATEGORY}setShiftX(e){return this.x_shift=e,this}setShiftY(e){return this.y_shift=e,this}setX(e){return this.x=e,this}draw(e,r){switch(this.setRendered(),this.symbol_type){case Vt.type.CODA_RIGHT:this.drawCodaFixed(e,r+e.width);break;case Vt.type.CODA_LEFT:this.drawSymbolText(e,r,"Coda",!0);break;case Vt.type.SEGNO_LEFT:this.drawSignoFixed(e,r);break;case Vt.type.SEGNO_RIGHT:this.drawSignoFixed(e,r+e.width);break;case Vt.type.DC:this.drawSymbolText(e,r,"D.C.",!1);break;case Vt.type.DC_AL_CODA:this.drawSymbolText(e,r,"D.C. al",!0);break;case Vt.type.DC_AL_FINE:this.drawSymbolText(e,r,"D.C. al Fine",!1);break;case Vt.type.DS:this.drawSymbolText(e,r,"D.S.",!1);break;case Vt.type.DS_AL_CODA:this.drawSymbolText(e,r,"D.S. al",!0);break;case Vt.type.DS_AL_FINE:this.drawSymbolText(e,r,"D.S. al Fine",!1);break;case Vt.type.FINE:this.drawSymbolText(e,r,"Fine",!1);break;case Vt.type.TO_CODA:this.drawSymbolText(e,r,"To",!0);break}return this}drawCodaFixed(e,r){const s=e.getYForTopText(e.options.num_lines)+this.y_shift;return Glyph.renderGlyph(e.context,this.x+r+this.x_shift,s+25,40,"v4d",!0),this}drawSignoFixed(e,r){const s=e.getYForTopText(e.options.num_lines)+this.y_shift;return Glyph.renderGlyph(e.context,this.x+r+this.x_shift,s+25,30,"v8c",!0),this}drawSymbolText(e,r,s,o){const a=e.checkContext();a.save(),a.setFont(this.font.family,this.font.size,this.font.weight);let l=0+this.x_shift,u=r+this.x_shift;if(this.symbol_type===Vt.type.CODA_LEFT?(l=this.x+this.x_shift,u=l+a.measureText(s).width+12):(this.x_shift=-(l+a.measureText(s).width+12+e.options.vertical_bar_width+12),l=this.x+this.x_shift+e.options.vertical_bar_width,u=l+a.measureText(s).width+12),this.xShiftAsPercentOfStaveWidth){const d=e.width*this.xShiftAsPercentOfStaveWidth;(this.symbol_type===Vt.type.DC_AL_FINE||this.symbol_type===Vt.type.FINE||this.symbol_type===Vt.type.DC||this.symbol_type===Vt.type.DS_AL_FINE||this.symbol_type===Vt.type.DS||this.symbol_type===Vt.type.FINE)&&(l+=d)}const c=e.getYForTopText(e.options.num_lines)+this.y_shift+25;return o&&Glyph.renderGlyph(a,u,c,40,"v4d",!0),a.fillText(s,l,c+5),a.restore(),this}};class StaveSection extends StaveModifier{static get CATEGORY(){return"stavesection"}constructor(e,r,s){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=e,this.x=r,this.shift_x=0,this.shift_y=s,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return StaveSection.CATEGORY}setStaveSection(e){return this.section=e,this}setShiftX(e){return this.shift_x=e,this}setShiftY(e){return this.shift_y=e,this}draw(e,r){const s=e.checkContext();this.setRendered(),s.save(),s.lineWidth=2,s.setFont(this.font.family,this.font.size,this.font.weight);const o=s.measureText(""+this.section),a=o.width;let l=o.height;!l&&o.emHeightAscent>=0&&(l=o.emHeightAscent+2),l||(l=o.fontBoundingBoxAscent+3);let u=a+6;u<18&&(u=18);const c=l+this.font.size/10,d=e.getYForTopText(3)+19-c*1.15+this.shift_y;let y=this.x+r;return s.beginPath(),s.lineWidth=2,s.rect(y,d+l/4,u,c),s.stroke(),y+=(u-a)/2,s.fillText(""+this.section,y,d+c),s.restore(),this}}class StaveTempo extends StaveModifier{static get CATEGORY(){return"stavetempo"}constructor(e,r,s){super(),this.setAttribute("type","StaveTempo"),this.tempo=e,this.position=Modifier.Position.ABOVE,this.x=r,this.shift_x=10,this.shift_y=s,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return StaveTempo.CATEGORY}setTempo(e){return this.tempo=e,this}setShiftX(e){return this.shift_x=e,this}setShiftY(e){return this.shift_y=e,this}draw(e,r){const s=e.checkContext();this.setRendered();const o=this.render_options,a=o.glyph_font_scale/38,l=this.tempo.name,u=this.tempo.duration,c=this.tempo.dots,d=this.tempo.bpm,y=this.font;let m=this.x+this.shift_x+r;const g=e.getYForTopText(1)+this.shift_y;if(s.save(),s.openGroup("stavetempo",null,{}),l&&(s.setFont(y.family,y.size,y.weight),s.fillText(l,m,g),m+=s.measureText(l).width),u&&d){s.setFont(y.family,y.size,"normal"),l&&(m+=s.measureText(" ").width,s.fillText("(",m,g),m+=s.measureText("(").width);const v=Flow.getGlyphProps(u);if(m+=3*a,Glyph.renderGlyph(s,m,g,o.glyph_font_scale,v.code_head),m+=v.getWidth()*a,v.stem){let b=30;v.beam_count&&(b+=3*(v.beam_count-1)),b*=a;const S=g-b;s.fillRect(m-a,S,a,b),v.flag&&(Glyph.renderGlyph(s,m,S,o.glyph_font_scale,v.code_flag_upstem),c||(m+=6*a))}for(let b=0;b=e.line?c.above:c.below)}this.placeGlyphOnLine(o,this.stave,e.line),this.glyphs.push(o);const l=this.xPositions[this.xPositions.length-1],u=o.getMetrics().width+a;this.xPositions.push(l+u),this.width+=u}cancelKey(e){return this.formatted=!1,this.cancelKeySpec=e,this}convertToCancelAccList(e){const r=Flow.keySignature(e),s=this.accList.length>0&&r.length>0&&r[0].type!==this.accList[0].type,o=s?r.length:r.length-this.accList.length;if(o<1)return;const a=[];for(let l=0;l0?e[0].type:null;let s;if(this.cancelKeySpec&&(s=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const o=(this.position===StaveModifier.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;s&&this.convertAccLines(o,s.type,s.accList),this.convertAccLines(o,r,e);for(let a=0;a0){const e=this.stave.context.openGroup("keysignature");for(let r=0;r{const e=i.split("/").filter(r=>r!=="");if(e.length!==2)throw new Vex.RERR("BadTimeSignature",`Invalid time spec: ${i}. Must be in the form "/"`);e.forEach(r=>{if(isNaN(Number(r)))throw new Vex.RERR("BadTimeSignature",`Invalid time spec: ${i}. Must contain two valid numbers.`)})};class TimeSignature extends StaveModifier{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(e=null,r=15,s=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=s,e===null)return;const o=r;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(StaveModifier.Position.BEGIN),this.setTimeSig(e),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(o)}getCategory(){return TimeSignature.CATEGORY}parseTimeSpec(e){if(e==="C"||e==="C|"){const{line:o,code:a,point:l}=TimeSignature.glyphs[e];return{line:o,num:!1,glyph:new Glyph(a,l)}}this.validate_args&&assertIsValidFraction(e);const[r,s]=e.split("/").map(o=>o.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(r,s)}}makeTimeSignatureGlyph(e,r){const s=new Glyph("v0",this.point);s.topGlyphs=[],s.botGlyphs=[];let o=0;for(let m=0;ma?o:a,u=s.getMetrics().x_min;s.getMetrics=()=>({x_min:u,x_max:u+l,width:l});const c=(l-o)/2,d=(l-a)/2,y=this;return s.renderToStave=function(g){let v=g+c;for(let b=0;br.visible).filter(Boolean).length}formatBegModifiers(e){let r=0;e.forEach(s=>{s.getNoteStartX()>r&&(r=s.getNoteStartX())}),e.forEach(s=>{s.setNoteStartX(r)}),r=0,e.forEach(s=>{s.getModifiers(StaveModifier.Position.BEGIN,Barline.CATEGORY).forEach(a=>{a.getType()==Barline.type.REPEAT_BEGIN&&a.getX()>r&&(r=a.getX())})}),e.forEach(s=>{s.getModifiers(StaveModifier.Position.BEGIN,Barline.CATEGORY).forEach(a=>{a.getType()==Barline.type.REPEAT_BEGIN&&a.setX(r)})}),r=0,e.forEach(s=>{s.getModifiers(StaveModifier.Position.BEGIN,TimeSignature.CATEGORY).forEach(a=>{a.getX()>r&&(r=a.getX())})}),e.forEach(s=>{s.getModifiers(StaveModifier.Position.BEGIN,TimeSignature.CATEGORY).forEach(a=>{a.setX(r)})})}getOptions(){return this.options}setNoteStartX(e){return this.formatted||this.format(),this.setStartX(e),this}setStartX(e){this.start_x=e}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(e){return this.options.num_lines=parseInt(e,10),this.resetLines(),this}setY(e){return this.y=e,this}getTopLineTopY(){return this.getYForLine(0)-Flow.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getLines()===2?this.getYForLine(6)+Flow.STAVE_LINE_THICKNESS/2:this.getYForLine(this.getNumLines()-1)+Flow.STAVE_LINE_THICKNESS/2}setX(e){const r=e-this.x;this.formatted=!1,this.x=e,this.start_x+=r,this.end_x+=r;for(let s=0;ss.getWidth()&&(r-=s.getWidth()),r}setRepetitionTypeLeft(e,r){return this.modifiers.push(new Repetition$1(e,this.x,r)),this}setRepetitionTypeRight(e,r){return this.modifiers.push(new Repetition$1(e,this.x,r)),this}setVoltaType(e,r,s){if(e===2)volta.type===2&&volta.stave.modifiers.push(new Volta(volta.type,volta.number_t,volta.x,volta.y)),volta={stave:this,type:e,number_t:r,MeasureNumber:this.MeasureNumber,y:s,x:this.x};else if(e===4){let o=this.MeasureNumber-volta.MeasureNumber,a=Math.max(volta.y,s);for(let l=0;l<=o;l++)voltaMeasureNumber[volta.MeasureNumber+l]={type:l===0?2:l===o?4:0,number_t:r,y:a};volta={}}else this.modifiers.push(new Volta(e,r,this.x,s));return this}drawVolta(){let e=voltaMeasureNumber[this.MeasureNumber];e&&(this.modifiers.push(new Volta(e.type,e.number_t,this.x,e.y)),delete voltaMeasureNumber[this.MeasureNumber]),volta.type&&volta.MeasureNumber==this.MeasureNumber&&(this.modifiers.push(new Volta(volta.type,volta.number_t,this.x,volta.y)),volta={})}setSection(e,r,s=0,o=12){const a=new StaveSection(e,this.x+s,r);return a.font.size=o,this.modifiers.push(a),this}setTempo(e,r){return this.modifiers.push(new StaveTempo(e,this.x,r)),this}setText(e,r,s){let o=new StaveText(e,r,s);return o.setFont({family:"Arial",size:14,weight:"normal"}),this.modifiers.push(o),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new BoundingBox(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const e=this.options,r=e.spacing_between_lines_px;return this.getYForLine(e.num_lines)+e.space_below_staff_ln*r}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(e){const r=this.options,s=r.spacing_between_lines_px,o=r.space_above_staff_ln;return this.y+e*s+o*s}getLineForY(e){const r=this.options,s=r.spacing_between_lines_px,o=r.space_above_staff_ln;return(e-this.y)/s-o}getYForTopText(e){const r=e||0;return this.getYForLine(-r-this.options.top_text_position)}getYForBottomText(e){const r=e||0;return this.getYForLine(this.options.bottom_text_position+r)}getYForNote(e){const r=this.options,s=r.spacing_between_lines_px,o=r.space_above_staff_ln;return this.y+o*s+5*s-e*s}getYForGlyphs(){return this.getYForLine(3)}addModifier(e,r,s){return r!==void 0&&e.setPosition(r),s&&(this.timeSignature.numerator=s.numerator,this.timeSignature.denominator=s.denominator),e.setStave(this),this.formatted=!1,this.modifiers.push(e),this}addEndModifier(e){return this.addModifier(e,StaveModifier.Position.END),this}setBegBarType(e){const{SINGLE:r,REPEAT_BEGIN:s,NONE:o}=Barline.type;return(e===r||e===s||e===o)&&(this.modifiers[0].setType(e),this.formatted=!1),this}setEndBarType(e){return e!==Barline.type.REPEAT_BEGIN&&(this.modifiers[1].setType(e),this.formatted=!1),this}setClef(e,r,s,o){o===void 0&&(o=StaveModifier.Position.BEGIN),o===StaveModifier.Position.END?this.endClef=e:this.clef=e;const a=this.getModifiers(o,Clef.CATEGORY);return a.length===0?this.addClef(e,r,s,o):a[0].setType(e,r,s),this}setEndClef(e,r,s){return this.setClef(e,r,s,StaveModifier.Position.END),this}setKeySignature(e,r,s){this.options.keySignature=e,s===void 0&&(s=StaveModifier.Position.BEGIN);const o=this.getModifiers(s,KeySignature.CATEGORY);return o.length===0?this.options.DYMusicScoreType!=="jianpu"&&this.addKeySignature(e,r,s):o[0].setKeySig(e,r),this}setEndKeySignature(e,r){return this.setKeySignature(e,r,StaveModifier.Position.END),this}setTimeSignature(e,r,s){s===void 0&&(s=StaveModifier.Position.BEGIN);const o=this.getModifiers(s,TimeSignature.CATEGORY);return o.length===0?this.addTimeSignature(e,r,s):o[0].setTimeSig(e),this}setEndTimeSignature(e,r){return this.setTimeSignature(e,r,StaveModifier.Position.END),this}addKeySignature(e,r,s){return s===void 0&&(s=StaveModifier.Position.BEGIN),this.addModifier(new KeySignature(e,r).setPosition(s),s),this}addClef(e,r,s,o){return o===void 0||o===StaveModifier.Position.BEGIN?this.clef=e:o===StaveModifier.Position.END&&(this.endClef=e),this.addModifier(new Clef(e,r,s),o),this}addEndClef(e,r,s){return this.addClef(e,r,s,StaveModifier.Position.END),this}addTimeSignature(e,r,s){return this.addModifier(new TimeSignature(e,r),s),this}addEndTimeSignature(e,r){return this.addTimeSignature(e,r,StaveModifier.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(e,r){return e===void 0&&r===void 0?this.modifiers:this.modifiers.filter(s=>(e===void 0||e===s.getPosition())&&(r===void 0||r===s.getCategory()))}sortByCategory(e,r){for(let s=e.length-1;s>=0;s--)for(let o=0;or[e[o+1].getCategory()]){const a=e[o];e[o]=e[o+1],e[o+1]=a}}format(){const e=this.modifiers[0],r=this.modifiers[1],s=this.getModifiers(StaveModifier.Position.BEGIN),o=this.getModifiers(StaveModifier.Position.END);this.sortByCategory(s,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(o,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),s.length>1&&e.getType()===Barline.type.REPEAT_BEGIN&&(s.push(s.splice(0,1)[0]),s.splice(0,0,new Barline(Barline.type.SINGLE))),o.indexOf(r)>0&&o.splice(0,0,new Barline(Barline.type.NONE));let a,l,u,c=0,d=this.x;for(let g=0;gd?d=v:u.setX(d),d+=a,l+a===0&&c--}d>this.start_x&&this.setStartX(d),d=this.x+this.width;const y={left:0,right:0,paddingRight:0,paddingLeft:0};let m=0;for(let g=0;g{l.includes(c)?u.visible=!0:u.visible=!1})}for(let l=0;lthis.drawStaveTempo()),this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const l=this.context.measureText(""+this.measure).width;o=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-l/2,o),this.context.restore()}return this}drawStaveTempo(){if(!this.staveTempos.length)return;const e=document.querySelector(`#${this.attrs.id}`);if(!e)return;const r=e.parentElement.getBBox(),s=this.getYForLine(0),o=e.parentElement.parentElement.querySelectorAll(".vf-curve");if(o.length){const a=this.x+this.staveTempos[0].shift_x+this.getModifierXShift(0),l=this.getYForTopText(1)+r.y-s+5;o.forEach(u=>{const c=u.getBBox();c.x-10a&&c.y-10l&&(r.y=c.y+5)})}for(let a=0;a1&&(hideTrackTune$1=!0)}}else this.options.keySignature!=_keySignature&&this.setText(`1=${r}`,1,{justification:1,shift_x:50,shift_y:-50});_keySignature=this.options.keySignature}if(this.MeasureNumber>=0&&this.timeSignature.numerator){let r=40,s=0;this.MeasureNumber<2&&(r=70,s=-72),this.setText(`${this.timeSignature.numerator}`,1,{justification:1,shift_x:r,shift_y:s-13}),this.setText("ᅳ",1,{justification:1,shift_x:r+3,shift_y:s-2}),this.setText(`${this.timeSignature.denominator}`,1,{justification:1,shift_x:r,shift_y:s+8})}}drawVertical(e,r){this.drawVerticalFixed(this.x+e,r)}drawVerticalFixed(e,r){this.checkContext();const s=this.getYForLine(0),o=this.getYForLine(this.options.num_lines-1);r&&this.context.fillRect(e-3,s,1,o-s+1),this.context.fillRect(e,s,1,o-s+1)}drawVerticalBar(e){this.drawVerticalBarFixed(this.x+e,!1)}drawVerticalBarFixed(e){this.checkContext();const r=this.getYForLine(0),s=this.getYForLine(this.options.num_lines-1);this.context.fillRect(e,r,1,s-r+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(e,r){if(e>=this.options.num_lines||e<0)throw new Vex.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(r.visible===void 0)throw new Vex.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if(typeof r.visible!="boolean")throw new Vex.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[e]=r,this}setConfigForLines(e){if(e.length!==this.options.num_lines)throw new Vex.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const r in e)e[r]||(e[r]=this.options.line_config[r]),Vex.Merge(this.options.line_config[r],e[r]);return this.options.line_config=e,this}}class TabStave extends Stave{constructor(e,r,s,o){const a={spacing_between_lines_px:13,num_lines:6,top_text_position:1};Vex.Merge(a,o),super(e,r,s,a),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}function getUnusedStringGroups(i,e){const r=[];let s=[];for(let o=1;o<=i;o++)e.indexOf(o)>-1?(r.push(s),s=[]):s.push(o);return s.length>0&&r.push(s),r}function getPartialStemLines(i,e,r,s){const o=s!==1,a=s!==-1,l=r.getSpacingBetweenLines(),u=r.getNumLines(),c=[];return e.forEach(d=>{const y=d.indexOf(u)>-1,m=d.indexOf(1)>-1;if(o&&m||a&&y)return;d.length===1&&d.push(d[0]);const g=[];d.forEach((v,b,S)=>{const x=v===1,A=v===u;let E=r.getYForLine(v-1);b===0&&!x?E-=l/2-1:b===S.length-1&&!A&&(E+=l/2-1),g.push(E),s===1&&x?g.push(i-2):s===-1&&A&&g.push(i+2)}),c.push(g.sort((v,b)=>v-b))}),c}let TabNote$1=class qi extends StemmableNote{static get CATEGORY(){return"tabnotes"}constructor(e,r){if(super(e),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=e.positions,Vex.Merge(this.render_options,{glyph_font_scale:Flow.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:r,draw_dots:r,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=Flow.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(e)}`);this.buildStem(),e.stem_direction?this.setStemDirection(e.stem_direction):this.setStemDirection(Stem.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return qi.CATEGORY}setGhost(e){return this.ghost=e,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const e=this.getGlyph();return this.stem_extension_override!=null?this.stem_extension_override:e?this.getStemDirection()===1?e.tabnote_stem_up_extension:e.tabnote_stem_down_extension:0}addDot(){const e=new Dot;return this.dots+=1,this.addModifier(e,0)}updateWidth(){this.glyphs=[],this.width=0;for(let e=0;ethis.width}setStave(e){super.setStave(e),this.context=e.context;let r;if(this.context){const o=this.context;for(this.width=0,r=0;ra.width),this.width=Math.max(a.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const s=this.positions.map(({str:o})=>e.getYForLine(o-1));return this.setYs(s),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(e){this.setModifierContext(e);for(let r=0;r{e.getCategory()==="dots"&&!this.render_options.draw_dots||(e.setContext(this.context),e.drawWithStyle())})}drawStemThrough(){const e=this.getStemX(),r=this.getStemY(),s=this.context,o=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&o){const l=this.stave.getNumLines(),u=this.positions.map(y=>y.str),c=getUnusedStringGroups(l,u),d=getPartialStemLines(r,c,this.getStave(),this.getStemDirection());s.save(),s.setLineWidth(Stem.WIDTH),d.forEach(y=>{y.length!==0&&(s.beginPath(),s.moveTo(e,y[0]),s.lineTo(e,y[y.length-1]),s.stroke(),s.closePath())}),s.restore()}}drawPositions(){const e=this.context,r=this.getAbsoluteX(),s=this.ys;for(let o=0;oparseInt(o,10)?TabSlide.SLIDE_DOWN:TabSlide.SLIDE_UP}this.slide_direction=r,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(e)}renderTie(e){if(e.first_ys.length===0||e.last_ys.length===0)throw new Vex.RERR("BadArguments","No Y-values to render");const r=this.context,s=e.first_x_px,o=e.first_ys,a=e.last_x_px,l=this.slide_direction;if(l!==TabSlide.SLIDE_UP&&l!==TabSlide.SLIDE_DOWN)throw new Vex.RERR("BadSlide","Invalid slide direction");for(let u=0;uthis.numStrings)throw new Vex.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${e}`);return this.tuningValues[r-1]}getValueForFret(e,r){const s=this.getValueForString(r),o=parseInt(e,10);if(o<0)throw new Vex.RERR("BadArguments","Fret number must be 0 or higher: "+e);return s+o}getNoteForFret(e,r){const s=this.getValueForFret(e,r),o=Math.floor(s/12),a=s%12;return Flow.integerToNote(a)+"/"+o}}class KeyManager{constructor(e){this.music=new Music,this.setKey(e)}setKey(e){return this.key=e,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!Music.scaleTypes[this.keyParts.type])throw new Vex.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Music.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const r=Music.root_indices[this.keyParts.root];for(let s=0;s{const s=TextDynamics.GLYPHS[r];if(!s)throw new Vex.RERR("Invalid dynamics character: "+r);const o=this.render_options.glyph_font_size,a=new Glyph(s.code,o);this.glyphs.push(a),e+=s.width}),this.setWidth(e),this.preFormatted=!0,this}draw(){this.setRendered();const e=this.getAbsoluteX(),r=this.stave.getYForLine(this.line+-3);L$7("Rendering Dynamics: ",this.sequence);let s=e;this.glyphs.forEach((o,a)=>{const l=this.sequence[a];o.render(this.context,s,r),s+=TextDynamics.GLYPHS[l].width})}}function drawArrowHead(i,e,r,s,o,a,l){i.beginPath(),i.moveTo(e,r),i.lineTo(s,o),i.lineTo(a,l),i.lineTo(e,r),i.closePath(),i.fill()}function drawArrowLine(i,e,r,s){const o=s.draw_start_arrow&&s.draw_end_arrow,a=e.x,l=e.y,u=r.x,c=r.y,d=Math.sqrt((u-a)*(u-a)+(c-l)*(c-l)),y=(d-s.arrowhead_length/3)/d;let m,g,v,b;s.draw_end_arrow||o?(m=Math.round(a+(u-a)*y),g=Math.round(l+(c-l)*y)):(m=u,g=c),s.draw_start_arrow||o?(v=a+(u-a)*(1-y),b=l+(c-l)*(1-y)):(v=a,b=l),s.color&&(i.setStrokeStyle(s.color),i.setFillStyle(s.color)),i.beginPath(),i.moveTo(v,b),i.lineTo(m,g),i.stroke(),i.closePath();const S=Math.atan2(c-l,u-a),x=Math.abs(s.arrowhead_length/Math.cos(s.arrowhead_angle));let A,E,w,_,T,C;(s.draw_end_arrow||o)&&(A=S+Math.PI+s.arrowhead_angle,w=u+Math.cos(A)*x,_=c+Math.sin(A)*x,E=S+Math.PI-s.arrowhead_angle,T=u+Math.cos(E)*x,C=c+Math.sin(E)*x,drawArrowHead(i,w,_,u,c,T,C)),(s.draw_start_arrow||o)&&(A=S+s.arrowhead_angle,w=a+Math.cos(A)*x,_=l+Math.sin(A)*x,E=S-s.arrowhead_angle,T=a+Math.cos(E)*x,C=l+Math.sin(E)*x,drawArrowHead(i,w,_,a,l,T,C))}class StaveLine extends Element$1{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(e){super(),this.setAttribute("type","StaveLine"),this.notes=e,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:StaveLine.TextVerticalPosition.TOP,text_justification:StaveLine.TextJustification.CENTER},this.setNotes(e)}setFont(e){return this.font=e,this}setText(e){return this.text=e,this}setNotes(e){if(!e.first_note&&!e.last_note)throw new Vex.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(e.first_indices||(e.first_indices=[0]),e.last_indices||(e.last_indices=[0]),e.first_indices.length!==e.last_indices.length)throw new Vex.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=e.first_note,this.first_indices=e.first_indices,this.last_note=e.last_note,this.last_indices=e.last_indices,this}applyLineStyle(){const e=this.checkContext(),r=this.render_options;r.line_dash&&e.setLineDash(r.line_dash),r.line_width&&e.setLineWidth(r.line_width),r.rounded_end?e.setLineCap("round"):e.setLineCap("square")}applyFontStyle(){const e=this.checkContext();this.font&&e.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color))}draw(){const e=this.checkContext();this.setRendered();const r=this.first_note,s=this.last_note,o=this.render_options;e.save(),this.applyLineStyle();let a,l;this.first_indices.forEach((g,v)=>{const b=this.last_indices[v];a=r.getModifierStartXY(2,g),l=s.getModifierStartXY(1,b);const S=a.y>l.y;a.x+=r.getMetrics().modRightPx+o.padding_left,l.x-=s.getMetrics().modLeftPx+o.padding_right;const x=r.getGlyph().getWidth();r.getKeyProps()[g].displaced&&r.getStemDirection()===1&&(a.x+=x+o.padding_left),s.getKeyProps()[b].displaced&&s.getStemDirection()===-1&&(l.x-=x+o.padding_right),a.y+=S?-3:1,l.y+=S?2:0,drawArrowLine(e,a,l,this.render_options)}),e.restore();const u=e.measureText(this.text).width,c=o.text_justification;let d=0;c===StaveLine.TextJustification.LEFT?d=a.x:c===StaveLine.TextJustification.CENTER?d=(l.x-a.x)/2+a.x-u/2:c===StaveLine.TextJustification.RIGHT&&(d=l.x-u);let y;const m=o.text_position_vertical;return m===StaveLine.TextVerticalPosition.TOP?y=r.getStave().getYForTopText():m===StaveLine.TextVerticalPosition.BOTTOM&&(y=r.getStave().getYForBottomText(Flow.TEXT_HEIGHT_OFFSET_HACK)),e.save(),this.applyFontStyle(),e.fillText(this.text,d,y),e.restore(),this}}function L$6(...i){PedalMarking.DEBUG&&Vex.L("Vex.Flow.PedalMarking",i)}function drawPedalGlyph(i,e,r,s,o){const a=PedalMarking.GLYPHS[i];new Glyph(a.code,o).render(e,r+a.x_shift,s+a.y_shift)}class PedalMarking extends Element$1{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:PedalMarking.Styles.TEXT,bracket:PedalMarking.Styles.BRACKET,mixed:PedalMarking.Styles.MIXED,mixed_open_end:PedalMarking.Styles.MIXED_OPEN_END,bracket_open_begin:PedalMarking.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:PedalMarking.Styles.BRACKET_OPEN_END,bracket_open_both:PedalMarking.Styles.BRACKET_OPEN_BOTH}}static createSustain(e){return new PedalMarking(e)}static createSostenuto(e){const r=new PedalMarking(e);return r.setStyle(PedalMarking.Styles.MIXED),r.setCustomText("Sost. Ped."),r}static createUnaCorda(e){const r=new PedalMarking(e);return r.setStyle(PedalMarking.Styles.TEXT),r.setCustomText("una corda","tre corda"),r}constructor(e){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=e,this.style=PedalMarking.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setEndStave(e){if(this.endStave=e,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let r=0;r3)throw new Vex.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=e,this}setLine(e){return this.line=e,this}drawBracketed(){const e=this.context;let r=!1,s,o;const a=this;this.notes.forEach((l,u,c)=>{r=!r;let d=0;if(l?(d=l.getNoteHeadBeginX(),this.BeginsStave&&(d=l.getStave().getNoteStartX())):d=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)r?this.ChangeBegin&&(d=l.getAbsoluteX()):(l?this.ChangeEnd?d=l.getAbsoluteX():d=l.getStave().end_x+this.endStaveAddedWidth-a.render_options.text_margin_right:d=this.endStave.end_x+this.endStaveAddedWidth-a.render_options.text_margin_right,this.endMargin=-a.render_options.text_margin_right);else if(l)if(r)this.ChangeBegin&&(d=l.getAbsoluteX());else switch(a.style){case PedalMarking.Styles.BRACKET_OPEN_END:case PedalMarking.Styles.BRACKET_OPEN_BOTH:case PedalMarking.Styles.MIXED_OPEN_END:d=l.getNoteHeadEndX();break;default:this.ChangeEnd?d=l.getAbsoluteX():(d=l.getNoteHeadBeginX()-a.render_options.text_margin_right,this.startMargin=-a.render_options.text_margin_right);break}let y=this.endStave;l&&(y=l.getStave());let m=y.getYForBottomText(a.line+3);o&&o>m&&(m=o);const g=c[u+1]===l,v=c[u-1]===l;let b=0;if(r)if(b=v?5:0,(a.style===PedalMarking.Styles.MIXED||a.style===PedalMarking.Styles.MIXED_OPEN_END)&&!v)if(a.custom_depress_text){const S=e.measureText(a.custom_depress_text).width;e.fillText(a.custom_depress_text,d-S/2,m),b=S/2+a.render_options.text_margin_right}else drawPedalGlyph("pedal_depress",e,d,m,a.render_options.glyph_point_size),b=20+a.render_options.text_margin_right;else e.beginPath(),a.style===PedalMarking.Styles.BRACKET_OPEN_BEGIN||a.style===PedalMarking.Styles.BRACKET_OPEN_BOTH?e.moveTo(d+b,m):(this.ChangeBegin&&(d+=5),e.moveTo(d,m-a.render_options.bracket_height),this.ChangeBegin&&(d+=5),e.lineTo(d+b,m)),e.stroke(),e.closePath();else b=g&&!this.EndsStave?-5:0,e.beginPath(),e.moveTo(s,o),e.lineTo(d+b,m),a.style!==PedalMarking.Styles.BRACKET_OPEN_END&&a.style!==PedalMarking.Styles.MIXED_OPEN_END&&a.style!==PedalMarking.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(d+=5),e.lineTo(d,m-a.render_options.bracket_height)),e.stroke(),e.closePath();s=d+b,o=m})}drawText(){const e=this.context;let r=!1;const s=this,o=s.render_options.glyph_point_size;this.notes.forEach(a=>{if(!a)return;r=!r;const l=a.getStave(),u=a.getAbsoluteX(),c=l.getYForBottomText(s.line+3);let d=0;r?s.custom_depress_text?(d=e.measureText(s.custom_depress_text).width,e.fillText(s.custom_depress_text,u-d/2,c)):drawPedalGlyph("pedal_depress",e,u,c,o):s.custom_release_text?(d=e.measureText(s.custom_release_text).width,e.fillText(s.custom_release_text,u-d/2,c)):drawPedalGlyph("pedal_release",e,u,c,o)})}draw(){const e=this.checkContext();this.setRendered(),e.save(),e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color),e.setFont(this.font.family,this.font.size,this.font.weight),L$6("Rendering Pedal Marking"),this.style===PedalMarking.Styles.BRACKET||this.style===PedalMarking.Styles.MIXED||this.style===PedalMarking.Styles.MIXED_OPEN_END||this.style===PedalMarking.Styles.BRACKET_OPEN_BEGIN||this.style===PedalMarking.Styles.BRACKET_OPEN_END||this.style===PedalMarking.Styles.BRACKET_OPEN_BOTH?(e.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===PedalMarking.Styles.TEXT&&this.drawText(),e.restore()}}function L$5(...i){TextBracket.DEBUG&&Vex.L("Vex.Flow.TextBracket",i)}class TextBracket extends Element$1{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:TextBracket.Positions.TOP,bottom:TextBracket.Positions.BOTTOM}}constructor({start:e,stop:r,text:s="",superscript:o="",position:a=TextBracket.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=e,this.stop=r,this.text=s,this.superscript=o,this.position=typeof a=="string"?TextBracket.PositionString[a]:a,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(e){return e.setFont(this.font.family,this.font.size,this.font.weight),e.setStrokeStyle(this.render_options.color),e.setFillStyle(this.render_options.color),e.setLineWidth(this.render_options.line_width),this}setDashed(e,r){return this.render_options.dashed=e,r&&(this.render_options.dash=r),this}setFont(e){return this.font={...this.font,...e},this}setLine(e){return this.line=e,this}draw(){const e=this.context;this.setRendered();let r=0;switch(this.position){case TextBracket.Positions.TOP:r=this.start.getStave().getYForTopText(this.line);break;case TextBracket.Positions.BOTTOM:r=this.start.getStave().getYForBottomText(this.line+Flow.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new Vex.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const s={x:this.start.getAbsoluteX(),y:r},o={x:this.stop.getAbsoluteX(),y:r};L$5("Rendering TextBracket: start:",s,"stop:",o,"y:",r);const a=this.render_options.bracket_height*this.position;e.save(),this.applyStyle(e),e.fillText(this.text,s.x,s.y);let l=e.measureText(this.text).width;l>0||(l=10*this.text.length);let u=e.measureText("M").width;u>0||(u=20);const c=s.y-u/2.5;e.setFont(this.font.family,this.font.size/1.4,this.font.weight),e.fillText(this.superscript,s.x+l+1,c);let d=e.measureText(this.superscript).width;d>0||(d=12,this.superscript.includes("m")&&(d+=5));let y=e.measureText("M").width;y>0||(y=10);let m=s.x,g=c,v=o.x+this.stop.getGlyph().getWidth();this.position===TextBracket.Positions.TOP?(m+=l+d+5,g-=y/2.7):this.position===TextBracket.Positions.BOTTOM&&(g+=y/2.7,m+=l+2,this.render_options.underline_superscript||(m+=d)),this.render_options.dashed?(v0||r===!0;return r&&!(a>0)&&(this.pos=o),u?this.matchSuccess():this.matchFail(o),{success:u,results:s,numMatches:a}}expectZeroOrMore(e){return this.expectOneOrMore(e,!0)}expect(e){L$2("Evaluating rules:",e);let r;if(!e)throw new X$2("Invalid Rule: "+e,e);const s=e.bind(this.grammar)();if(s.token)r=this.matchToken(s.token,s.noSpace===!0),r.success&&(this.pos+=r.incrementPos);else if(s.expect)s.oneOrMore?r=this.expectOneOrMore(s):s.zeroOrMore?r=this.expectZeroOrMore(s):r=this.expectOne(s);else throw new X$2("Bad grammar! No `token` or `expect` property",s);return r.matches=[],r.results&&r.results.forEach(o=>r.matches.push(flattenMatches(o))),s.run&&r.success&&s.run(r),r}}function L$1(...i){EasyScore.DEBUG&&Vex.L("Vex.Flow.EasyScore",i)}const X$1=Vex.MakeException("EasyScoreError");class Grammar{constructor(e){this.builder=e}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:e=>this.builder.addChord(e.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:e=>this.builder.addSingleNote(e.matches[0],e.matches[1],e.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:e=>this.builder.setNoteDots(e.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:e=>this.builder.setNoteType(e.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:e=>this.builder.setNoteDuration(e.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){const e=r=>r.slice(1,-1);return{expect:[this.KEY,this.EQUALS,this.VAL],run:r=>this.builder.addNoteOption(r.matches[0],e(r.matches[2]))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class Builder{constructor(e){this.factory=e,this.commitHooks=[],this.reset()}reset(e={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,e)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(e){this.commitHooks.push(e)}resetPiece(){L$1("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(e){L$1("setNoteDots:",e),e&&(this.piece.dots=e.length)}setNoteDuration(e){L$1("setNoteDuration:",e),this.rollingDuration=this.piece.duration=e||this.rollingDuration}setNoteType(e){L$1("setNoteType:",e),e&&(this.piece.type=e)}addNoteOption(e,r){L$1("addNoteOption: key:",e,"value:",r),this.piece.options[e]=r}addNote(e,r,s){L$1("addNote:",e,r,s),this.piece.chord.push({key:e,accid:r,octave:s})}addSingleNote(e,r,s){L$1("addSingleNote:",e,r,s),this.addNote(e,r,s)}addChord(e){L$1("startChord"),typeof e[0]!="object"?this.addSingleNote(e[0]):e.forEach(r=>{r&&this.addNote(...r)}),L$1("endChord")}commitPiece(){L$1("commitPiece");const{factory:e}=this;if(!e)return;const r={...this.options,...this.piece.options},{stem:s,clef:o}=r,a=s.toLowerCase()==="auto",l=!a&&s.toLowerCase()==="up"?StaveNote.STEM_UP:StaveNote.STEM_DOWN,{chord:u,duration:c,dots:d,type:y}=this.piece,m=u.map(b=>b.key+"/"+b.octave),g=e.StaveNote({keys:m,duration:c,dots:d,type:y,clef:o,auto_stem:a});a||g.setStemDirection(l);const v=u.map(b=>b.accid||null);v.forEach((b,S)=>{b&&g.addAccidental(S,e.Accidental({type:b}))});for(let b=0;bb(r,g,this)),this.elements.notes.push(g),this.elements.accidentals.concat(v),this.resetPiece()}}function setId({id:i},e){i!==void 0&&e.setAttribute("id",i)}function setClass(i,e){if(!i.class)return;const r=/\s*,\s*/;i.class.split(r).forEach(s=>e.addClass(s))}class EasyScore{constructor(e={}){this.setOptions(e),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(e){return Object.assign(this.defaults,e),this}setOptions(e){return this.options={factory:null,builder:null,commitHooks:[setId,setClass,Articulation$1.easyScoreHook],throwOnError:!1,...e},this.factory=this.options.factory,this.builder=this.options.builder||new Builder(this.factory),this.grammar=new Grammar(this.builder),this.parser=new Parser(this.grammar),this.options.commitHooks.forEach(r=>this.addCommitHook(r)),this}setContext(e){return this.factory&&this.factory.setContext(e),this}parse(e,r={}){this.builder.reset(r);const s=this.parser.parse(e);if(!s.success&&this.options.throwOnError)throw new X$1("Error parsing line: "+e,s);return s}beam(e,r={}){return this.factory.Beam({notes:e,options:r}),e}tuplet(e,r={}){return this.factory.Tuplet({notes:e,options:r}),e}notes(e,r={}){return r={clef:this.defaults.clef,stem:this.defaults.stem,...r},this.parse(e,r),this.builder.getElements().notes}voice(e,r){return r={time:this.defaults.time,...r},this.factory.Voice(r).addTickables(e)}addCommitHook(e){return this.builder.addCommitHook(e)}}function initGroup(){return{notes:[],finish:!1,total:0,staveId:""}}let _text_width=null,tone="C",group=initGroup(),_denominator="",_numerator="",ornamentGroup="";class NumberedNote extends StaveNote{static get CATEGORY(){return"numberednotes"}static accidentalAndKey(e){switch(e){case"G":return{4:"#"};case"D":return{1:"#",4:"#"};case"A":return{1:"#",4:"#",5:"#"};case"E":return{1:"#",2:"#",4:"#",5:"#"};case"B":return{1:"#",2:"#",4:"#",5:"#",6:"#"};case"F#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#"};case"C#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#",7:"#"};case"F":return{7:"b"};case"Bb":return{7:"b",3:"b"};case"Eb":return{7:"b",3:"b",6:"b"};case"Ab":return{7:"b",2:"b",3:"b",6:"b"};case"Db":return{7:"b",2:"b",3:"b",5:"b",6:"b"};case"Gb":return{7:"b",1:"b",2:"b",3:"b",5:"b",6:"b"};case"Cb":return{7:"b",1:"b",2:"b",3:"b",4:"b",5:"b",6:"b"};default:return{}}}static accidentalMap(e){switch(e){case"C":return"";case"F":case"Bb":case"Eb":case"Ab":case"Db":case"Gb":case"Cb":return{bb:"b",b:"",n:"#","#":"##"};default:return{b:"bb",n:"b","#":"","##":"#"}}}static get noteLift(){switch(tone){case"G":return["7"];case"D":return["7","3"];case"A":return["7","3","6"];case"E":return["2","6","3","7"];case"B":return["5","2","6","3","7"];case"F#":return["1","5","2","6","3","7"];case"C#":return["4","1","5","2","6","3","7"];case"F":return["4"];case"Bb":return["1","4"];case"Eb":return["5","1","4"];case"Ab":return["2","5","1","4"];case"Db":return["6","2","5","1","4"];case"Gb":return["3","6","2","5","1","4"];case"Cb":return["7","3","6","2","5","1","4"]}}static get longDurationLine(){return{1:3,2:1,6:2}}static get numberedDurationLine(){return{8:1,16:2,32:3,64:4,128:5}}static get durationTime(){return{8:6144,4:4096}}constructor(e){super(e),this.setAttribute("type","NumberedNote"),tone=e.keyString,this.ornament=!!e.ornament,this.line=0,this.keys=e.keys||[],this.fontSize=20,this.offset_x=0,this.offset_y=0,this.note_tones=[],this.duration_lines=0,this.long_duration_lines=0,this.note_size=e.note_size||16;const r=Flow.sanitizeDuration(this.duration);var s=NumberedNote.numberedDurationLine[r.toString()];if(s&&(this.duration_lines=s),s=NumberedNote.longDurationLine[r.toString()],s&&(this.long_duration_lines=s),!_text_width){var o="__$text_wraper$$__";let l=document.createElement("canvas");l.id=o,document.body.append(l);const u=document.getElementById(o),c=u.getContext("2d");c.font="Arial 22px";var a=c.measureText("5");_text_width=a.width+2,document.body.removeChild(u)}}getCategory(){return NumberedNote.CATEGORY}setKeySignature(e){this.keySignature=e}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setWidth(this.full_width),this.setPreFormatted(!0))}filterNote(){if(window&&window.sett&&window.sett.keySignature||!this.keys||!this.keys.length)return;const e=NumberedNote.accidentalMap(tone);if(!e)return;const r=NumberedNote.noteLift;if(!r)return;var s=this.keys[0].split("/"),o=s[0];o==="b"&&(o="R"),o=o.replace(new RegExp("#","g"),""),o=o.replace(new RegExp("n","g"),""),o.length>1&&(o=o.replace(new RegExp("b","g"),""));const a=NumberedNoteHead.numberedNotationMapping[o.toUpperCase()];if(r.includes(a))for(let l=0;l{switch(s.getAttribute("type")){case"Accidental":s.render_options.font_scale=this.note_width*1.4,s.x_shift=2,s.y_shift=this.unit_height/2,this.ornament&&(s.render_options.font_scale=this.note_width,s.x_shift=14,s.y_shift=-10);break;case"Stroke":s.x_shift=-1*e,s.y_shift=1*this.unit_height;break;case"Dot":s.x_shift=r*this.duration_dot_width+7,s.y_shift=1*this.unit_height,r++;break;case"Ornament":s.y_shift=-3;break;default:s.y_shift=1*this.unit_height}s.reset&&s.reset(),e+=s.getWidth()/2})}handleDeleteDot(){for(let e=0;eu),s=r.length?r[0]/r[1]:0;if(this.ornament)return;if(s===0)return this.long_duration_lines=this.intrinsicTicks/e-1,this.long_duration_lines>=_numerator&&(this.long_duration_lines=_numerator-1),_denominator==8&&(this.long_duration_lines=0,_numerator==3&&this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),_numerator==6&&(this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),new Glyph("v0",40).render(this.context,this.bottom_x+40,this.top_y),this.draw_dot(this.context,this.bottom_x+65,this.bottom_y-30,this.dot_width))),group=initGroup();let o={lines:this.duration_lines,duration:s,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,y:this.y,width:this.full_width};s>e*2&&(this.long_duration_lines=parseInt(s/e)-1,this.handleDeleteDot()),ornamentGroup&&(o.x+=this.note_width),group.notes.push(o);let a=group.notes.reduce((u,c)=>u+c.duration,0);a=parseInt(a),a>e&&(a-=e),a>e-10&&ac.lines===0).length&&(this.drawDurationLoneLine(),group=initGroup()))}draw(){if(this.checkContext(),!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");let e=this.context;e.save(),e.setFont("Arial",this.note_height,"normal"),this.setAttribute("el",e.openGroup("stavenote",this.getAttribute("id"))),e.openGroup("note",null,{pointerBBox:!0});let r=this.getAbsoluteX()+2.5;this.x=r;let s=this.stave.getYForLine(2)+this.note_height/2;this.y=s,this.buildToneHeads(),this.preFormatModifier(),this.applyStyle(),this.note_tones.forEach(o=>{o!=null&&o.key.includes("X2")?o.draw(e,"isX"):o.draw(e)}),e.openGroup("modifier",null,{pointerBBox:!0}),this.drawModifiers(),e.closeGroup(),e.closeGroup(),e.closeGroup(),this.calcGroup(),group.staveId=this.stave.attrs.id,this.drawDurationLine(e,{}),this.drawLongDurationLines(e),this.restoreStyle(),this.setRendered(),this.ornament?ornamentGroup?ornamentGroup=Object.assign(ornamentGroup,{lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}):ornamentGroup={lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}:ornamentGroup=""}drawDurationLoneLine(e,r){e=e||this.context;let s=r||this.y+this.duration_line_space;for(let o=0;o<5;o++){let a=[],l=0;for(let u=0;uo)a.push(c),l++;else{if(a.length>1){let d=a.length-1;s=a[0].y+this.duration_line_space,e.rect(a[0].x,s+o*3,a[d].x-a[0].x+a[d].width,.5)}a=[],l=u+1}}if(a.length>1){let u=a.length-1;s=a[0].y+this.duration_line_space,e.rect(a[0].x,s+o*3,a[u].x-a[0].x+a[u].width,.5)}}}draw_dot(e,r,s,o){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(r,s,o,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}drawDurationLine(e,r){var s=this.attrs.id+"-lines";e.openGroup("numbered_note_lines",s);var o,a;if(this.duration_lines>0){const c=this.duration_line_space;var l=this.full_width;if(r&&r.width&&(l=r.width),l<0&&(l=this.note_width),!r||typeof r.startX>"u"?o=this.x-c/2-this.left_width:o=r.startX,!r||typeof r.startY>"u"?a=this.y+this.duration_line_space:a=r.startY,group.finish&&(this.drawDurationLoneLine(e,a),group=initGroup()),this.ornament?(o+=12,a-=22,l=15,ornamentGroup&&(o-=10,l+=10)):ornamentGroup&&(o+=this.note_width,l-=this.note_width),l>0){for(var u=0;uc.getAttribute("type")==="Dot"),l=this.modifiers.findIndex(c=>c.getAttribute("type")==="Accidental"),u=this.modifiers.findIndex(c=>c.getAttribute("type")==="GraceNoteGroup");o&&l>-1?this.modifiers[l].accidental.code=o==="#"?"v18":"v44":a>=0||u>=0?a>=0&&this.modifiers.splice(a+1,1):this.modifiers.splice(l,1)}}catch(o){console.log("🚀 ~ error",o)}}this.setYs(e)}getFullWidth(){return this.full_width}getFullHeight(){return this.full_height}getLine(){return this.keyProps[0].line}get full_width(){return this.note_width+this.left_width+this.right_width+this.long_duration_line_width}get long_duration_line_width(){return(this.long_duration_width+this.long_duration_space)*this.long_duration_lines}get full_height(){return this.bottom_y-this.top_y}get note_width(){return this.note_size||0}get note_dot_width(){return 6}get note_height(){return this.unit_height}get unit_height(){return this.note_size||0}get note_x(){return this.x||0}get top_x(){return this.x||0}get top_y(){var e=this;return(this.y||0)-(e.note_tones.map(s=>(s.td+s.bd)*(e.dot_space+e.dot_width)).reduce((s,o)=>s+o,0)+this.note_height*this.note_tones.length-this.unit_height-this.note_tones[0].bd*(e.dot_space+e.dot_width)+(this.note_tones.length-1)*this.head_space)}get bottom_x(){return this.x||0}get bottom_y(){return(this.y||0)+this.unit_height+this.duration_lines*(this.duration_line_height+this.duration_line_space)+this.note_tones[0].meta.bd*(this.dot_width+this.dot_space)}get left_width(){return this.modifiers_width}get right_width(){return this.full_duration_dot_width}get duration_dot_width(){return 6}get full_duration_dot_width(){return this.duration_dot_width*this.getModifiersByCategory(Dot.CATEGORY).length}getModifiersByCategory(e){var r=[];return this.modifiers.forEach(s=>{s.getCategory()===e&&r.push(s)}),r}get head_space(){return 6}get duration_line_height(){return 2}get duration_line_space(){return 4}get dot_width(){return 2}get dot_space(){return 2}get long_duration_space(){return 10}get long_duration_width(){return 20}getWidth(){return this.full_width}get modifiers_width(){let e=0;return this.modifiers.forEach(r=>{e+=r.getWidth()}),e}}class NumberedNoteHead{static get numberedNotationMapping(){let e=tone;switch(window&&window.sett&&window.sett.keySignature&&(e="C"),e){case"A":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",X:"x",min:2.5,max:5.5};case"B":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",X:"x",min:-.5,max:2.5};case"D":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",X:"x",min:.5,max:3.5};case"E":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",X:"x",min:1,max:4};case"F":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",X:"x",min:1.5,max:4.5};case"G":case"Gb":return{C:"4",D:"5",E:"6",F:"7",G:"1",A:"2",B:"3",R:"0",X:"x",min:2,max:5};case"Eb":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",X:"x",min:1,max:4};case"D#":case"Db":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",X:"x",min:.5,max:3.5};case"F#":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",X:"x",min:1.5,max:4.5};case"Ab":case"G#":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",X:"x",min:-1,max:2};case"Bb":case"A#":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",X:"x",min:-.5,max:2.5};case"C#":case"Cb":default:return{C:"1",D:"2",E:"3",F:"4",G:"5",A:"6",B:"7",R:"0",X:"x",min:0,max:3}}}tone_to_numbered_key(){var e=this.key.split("/"),r=e[0];r==="b"&&(r="R"),r=r.replace(new RegExp("#","g"),""),r=r.replace(new RegExp("n","g"),""),r.length>1&&(r=r.replace(new RegExp("b","g"),"")),e.includes("X2")&&(r="X");let s=0,o=0;this.note.stave&&this.note.stave.options&&this.note.stave.options.keySignature&&(tone=this.note.stave.options.keySignature);const a=this.note.getLine();return aNumberedNoteHead.numberedNotationMapping.max&&(o=Math.ceil((a-NumberedNoteHead.numberedNotationMapping.max)/3.5)),r.toUpperCase()==="R"&&(s=0,o=0),{key:NumberedNoteHead.numberedNotationMapping[r.toUpperCase()],td:o,bd:s}}constructor(e){this.key=e.key,this.x=e.x||0,this.y=e.y||0,this.idx=e.idx||0,this.note=e.note||0,this.meta=this.tone_to_numbered_key(),this.noteSize=e.noteSize||16,this.td=this.meta.td,this.bd=this.meta.bd}draw(e,r){let s=this.y;r&&r==="isX"?e.openGroup("numbered-note-head","","","isX"):e.openGroup("numbered-note-head");var o=this.x+(this.note.ornament?-2:0);let a=s-this.note.unit_height-this.note.dot_space-(this.note.ornament?-4:2);for(let u=0;u1&&(c-=this.note.duration_line_space),s+=c}this.draw_dot(e,o+_text_width,s,this.note.dot_width),s+=this.note.dot_width+this.note.dot_space}e.closeGroup()}get height(){return this.note.note_height+(this.meta.bd+this.meta.td)*(this.note.dot_width+this.note.dot_space)}draw_dot(e,r,s,o){e.openGroup("numbered-note-dot"),e.beginPath(),e.arc(r,s,o,0,2*Math.PI),e.closePath(),e.fill(),e.closeGroup()}}function L(...i){Factory.DEBUG&&Vex.L("Vex.Flow.Factory",i)}const X=Vex.MakeException("FactoryError");function setDefaults$1(i={},e){const r=e.options;return i=Object.assign(e,i),i.options=Object.assign(r,i.options),i}class Factory{constructor(e){L("New factory: ",e);const r={stave:{space:10},renderer:{context:null,elementId:"",backend:Renderer.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=r,this.setOptions(e)}static newFromElementId(e,r=500,s=200){return new Factory({renderer:{elementId:e,width:r,height:s}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(e){for(const r of["stave","renderer","font"])Object.assign(this.options[r],e[r]);(this.options.renderer.elementId!==null||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:e,backend:r,width:s,height:o,background:a}=this.options.renderer;if(e==="")throw new X("HTML DOM element not set in Factory");this.context=Renderer.buildContext(e,r,s,o,a)}getContext(){return this.context}setContext(e){return this.context=e,this}getStave(){return this.stave}getVoices(){return this.voices}space(e){return this.options.stave.space*e}Stave(e){e=setDefaults$1(e,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const r=new Stave(e.x,e.y,e.width,e.options);return this.staves.push(r),r.setContext(this.context),this.stave=r,r}TabStave(e){e=setDefaults$1(e,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space*1.3}});const r=new TabStave(e.x,e.y,e.width,e.options);return this.staves.push(r),r.setContext(this.context),this.stave=r,r}StaveNote(e){const r=new StaveNote(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}GhostNote(e){const r=new GhostNote(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}TextNote(e){const r=new TextNote(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}NumberedNote(e){const r=new NumberedNote(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}BarNote(e){e=setDefaults$1(e,{type:"single",options:{}});const r=new BarNote(e.type);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}ClefNote(e){e=setDefaults$1(e,{type:"treble",options:{size:"default"}});const r=new ClefNote(e.type,e.options.size,e.options.annotation);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}TimeSigNote(e){e=setDefaults$1(e,{time:"4/4",options:{}});const r=new TimeSigNote(e.time);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}KeySigNote(e){const r=new KeySigNote(e.key,e.cancelKey,e.alterKey);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}TabNote(e){const r=new TabNote$1(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}GraceNote(e){const r=new GraceNote(e);return this.stave&&r.setStave(this.stave),r.setContext(this.context),r}GraceNoteGroup(e){const r=new GraceNoteGroup(e.notes,e.slur);return r.setContext(this.context),r}Accidental(e){e=setDefaults$1(e,{type:null,options:{}});const r=new Accidental(e.type);return r.setContext(this.context),r}Annotation(e){e=setDefaults$1(e,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const r=new Annotation(e.text);return r.setJustification(e.hJustify),r.setVerticalJustification(e.vJustify),r.setFont(e.fontFamily,e.fontSize,e.fontWeight),r.setContext(this.context),r}Articulation(e){e=setDefaults$1(e,{type:"a.",position:"above",options:{}});const r=new Articulation$1(e.type);return r.setPosition(e.position),r.setContext(this.context),r}TextDynamics(e){e=setDefaults$1(e,{text:"p",duration:"q",dots:0,line:0,options:{}});const r=new TextDynamics({text:e.text,line:e.line,duration:e.duration,dots:e.dots});return this.stave&&r.setStave(this.stave),r.setContext(this.context),this.renderQ.push(r),r}Fingering(e){e=setDefaults$1(e,{number:"0",position:"left",options:{}});const r=new FretHandFinger(e.number);return r.setPosition(e.position),r.setContext(this.context),r}StringNumber(e){e=setDefaults$1(e,{number:"0",position:"left",options:{}});const r=new StringNumber(e.number);return r.setPosition(e.position),r.setContext(this.context),r}TickContext(){return new TickContext().setContext(this.context)}ModifierContext(){return new ModifierContext}MultiMeasureRest(e){const r=new MultiMeasureRest(e.number_of_measures,e);return r.setContext(this.context),this.renderQ.push(r),r}Voice(e){e=setDefaults$1(e,{time:"4/4",options:{}});const r=new Voice$1(e.time);return this.voices.push(r),r}StaveConnector(e){e=setDefaults$1(e,{top_stave:null,bottom_stave:null,type:"double",options:{}});const r=new StaveConnector(e.top_stave,e.bottom_stave);return r.setType(e.type).setContext(this.context),this.renderQ.push(r),r}Formatter(){return new Formatter}Tuplet(e){e=setDefaults$1(e,{notes:[],options:{}});const r=new Tuplet$1(e.notes,e.options).setContext(this.context);return this.renderQ.push(r),r}Beam(e){e=setDefaults$1(e,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const r=new Beam$1(e.notes,e.options.autoStem).setContext(this.context);return r.breakSecondaryAt(e.options.secondaryBeamBreaks),this.renderQ.push(r),r}Curve(e){e=setDefaults$1(e,{from:null,to:null,options:{}});const r=new Curve(e.from,e.to,e.options).setContext(this.context);return this.renderQ.push(r),r}StaveTie(e){e=setDefaults$1(e,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const r=new StaveTie({first_note:e.from,last_note:e.to,first_indices:e.first_indices,last_indices:e.last_indices},e.text);return e.options.direction&&r.setDirection(e.options.direction),r.setContext(this.context),this.renderQ.push(r),r}StaveLine(e){e=setDefaults$1(e,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const r=new StaveLine({first_note:e.from,last_note:e.to,first_indices:e.first_indices,last_indices:e.last_indices});return e.options.text&&r.setText(e.options.text),e.options.font&&r.setFont(e.options.font),r.setContext(this.context),this.renderQ.push(r),r}VibratoBracket(e){e=setDefaults$1(e,{from:null,to:null,options:{harsh:!1}});const r=new VibratoBracket({start:e.from,stop:e.to});return e.options.line&&r.setLine(e.options.line),e.options.harsh&&r.setHarsh(e.options.harsh),r.setContext(this.context),this.renderQ.push(r),r}TextBracket(e){e=setDefaults$1(e,{from:null,to:null,text:"",options:{superscript:"",position:1}});const r=new TextBracket({start:e.from,stop:e.to,text:e.text,superscript:e.options.superscript,position:e.options.position});return e.options.line&&r.setLine(e.options.line),e.options.font&&r.setFont(e.options.font),r.setContext(this.context),this.renderQ.push(r),r}System(e={}){e.factory=this;const r=new System(e).setContext(this.context);return this.systems.push(r),r}EasyScore(e={}){return e.factory=this,new EasyScore(e)}PedalMarking(e={}){e=setDefaults$1(e,{notes:[],options:{style:"mixed"}});const r=new PedalMarking(e.notes);return r.setStyle(PedalMarking.StylesString[e.options.style]),r.setContext(this.context),this.renderQ.push(r),r}NoteSubGroup(e={}){e=setDefaults$1(e,{notes:[],options:{}});const r=new NoteSubGroup$1(e.notes);return r.setContext(this.context),r}draw(){this.systems.forEach(e=>e.setContext(this.context).format()),this.staves.forEach(e=>e.setContext(this.context).draw()),this.voices.forEach(e=>e.setContext(this.context).draw()),this.renderQ.forEach(e=>{e.isRendered()||e.setContext(this.context).draw()}),this.systems.forEach(e=>e.setContext(this.context).draw()),this.reset()}}function setDefaults(i,e){const r=e.options;return i=Object.assign(e,i),i.options=Object.assign(r,i.options),i}class System extends Element$1{constructor(e={}){super(),this.setAttribute("type","System"),this.setOptions(e),this.parts=[]}setOptions(e={}){this.options=setDefaults(e,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Factory({renderer:{el:null}})}setContext(e){return super.setContext(e),this.factory.setContext(e),this}addConnector(e="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:e}),this.connector}addStave(e){return e=setDefaults(e,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}}),e.stave||(e.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:e.options})),e.voices.forEach(r=>r.setContext(this.context).setStave(e.stave).getTickables().forEach(s=>s.setStave(e.stave))),this.parts.push(e),e.stave}format(){const e=new Formatter;this.formatter=e;let r=this.options.y,s=0,o=[];const a=[];this.parts.forEach(u=>{r=r+u.stave.space(u.spaceAbove),u.stave.setY(r),e.joinVoices(u.voices),r=r+u.stave.space(u.spaceBelow),r=r+u.stave.space(this.options.spaceBetweenStaves),u.debugNoteMetrics&&(a.push({y:r,voice:u.voices[0]}),r+=15),o=o.concat(u.voices),s=Math.max(s,u.stave.getNoteStartX())}),this.parts.forEach(u=>u.stave.setNoteStartX(s));const l=this.options.width-(s-this.options.x)-Note.STAVEPADDING;e.format(o,l);for(let u=0;u{r.voice.getTickables().forEach(s=>Note.plotMetrics(e,s,r.y))})}}Vex.Flow=Flow;Vex.Flow.Element=Element$1;Vex.Flow.Fraction=Fraction;Vex.Flow.Renderer=Renderer;Vex.Flow.Formatter=Formatter;Vex.Flow.Music=Music;Vex.Flow.Glyph=Glyph;Vex.Flow.Stave=Stave;Vex.Flow.StaveNote=StaveNote;Vex.Flow.StaveModifier=StaveModifier;Vex.Flow.StaveTempo=StaveTempo;Vex.Flow.Voice=Voice$1;Vex.Flow.Accidental=Accidental;Vex.Flow.Beam=Beam$1;Vex.Flow.StaveTie=StaveTie;Vex.Flow.TabStave=TabStave;Vex.Flow.TabNote=TabNote$1;Vex.Flow.Bend=Bend;Vex.Flow.Vibrato=Vibrato;Vex.Flow.VibratoBracket=VibratoBracket;Vex.Flow.Note=Note;Vex.Flow.ModifierContext=ModifierContext;Vex.Flow.MultiMeasureRest=MultiMeasureRest;Vex.Flow.TickContext=TickContext;Vex.Flow.Articulation=Articulation$1;Vex.Flow.Annotation=Annotation;Vex.Flow.Barline=Barline;Vex.Flow.NoteHead=NoteHead;Vex.Flow.StaveConnector=StaveConnector;Vex.Flow.ClefNote=ClefNote;Vex.Flow.KeySignature=KeySignature;Vex.Flow.KeySigNote=KeySigNote;Vex.Flow.TimeSignature=TimeSignature;Vex.Flow.TimeSigNote=TimeSigNote;Vex.Flow.Stem=Stem;Vex.Flow.TabTie=TabTie;Vex.Flow.Clef=Clef;Vex.Flow.Dot=Dot;Vex.Flow.Modifier=Modifier;Vex.Flow.TabSlide=TabSlide;Vex.Flow.Tuplet=Tuplet$1;Vex.Flow.GraceNote=GraceNote;Vex.Flow.GraceTabNote=GraceTabNote;Vex.Flow.Tuning=Tuning;Vex.Flow.KeyManager=KeyManager;Vex.Flow.StaveHairpin=StaveHairpin;Vex.Flow.BoundingBox=BoundingBox;Vex.Flow.Stroke=Stroke;Vex.Flow.TextNote=TextNote;Vex.Flow.Curve=Curve;Vex.Flow.TextDynamics=TextDynamics;Vex.Flow.StaveLine=StaveLine;Vex.Flow.Ornament=Ornament;Vex.Flow.PedalMarking=PedalMarking;Vex.Flow.TextBracket=TextBracket;Vex.Flow.FretHandFinger=FretHandFinger;Vex.Flow.Repetition=Repetition$1;Vex.Flow.BarNote=BarNote;Vex.Flow.GhostNote=GhostNote;Vex.Flow.NoteSubGroup=NoteSubGroup$1;Vex.Flow.GraceNoteGroup=GraceNoteGroup;Vex.Flow.Tremolo=Tremolo;Vex.Flow.StringNumber=StringNumber;Vex.Flow.Crescendo=Crescendo;Vex.Flow.Volta=Volta;Vex.Flow.Font=Font;Vex.Flow.System=System;Vex.Flow.Factory=Factory;Vex.Flow.Parser=Parser;Vex.Flow.EasyScore=EasyScore;Vex.Flow.Registry=Registry;var SystemLinesEnum=(i=>(i[i.SingleThin=0]="SingleThin",i[i.DoubleThin=1]="DoubleThin",i[i.ThinBold=2]="ThinBold",i[i.BoldThinDots=3]="BoldThinDots",i[i.DotsThinBold=4]="DotsThinBold",i[i.DotsBoldBoldDots=5]="DotsBoldBoldDots",i[i.None=6]="None",i[i.Dotted=7]="Dotted",i[i.Dashed=8]="Dashed",i[i.Bold=9]="Bold",i[i.BoldThin=10]="BoldThin",i[i.DoubleBold=11]="DoubleBold",i[i.Tick=12]="Tick",i[i.Short=13]="Short",i))(SystemLinesEnum||{});class SystemLinesEnumHelper{static xmlBarlineStyleToSystemLinesEnum(e){return e==="regular"?0:e==="dotted"?7:e==="dashed"?8:e==="heavy"?9:e==="light-light"?1:e==="light-heavy"?2:e==="heavy-light"?10:e==="heavy-heavy"?11:e==="tick"?12:e==="short"?13:e==="none"?6:0}}class Matrix2D{constructor(){this.matrix=[];for(let e=0;e<2;e++){this.matrix[e]=[];for(let r=0;r<2;r++)this.matrix[e][r]=0}}static getRotationMatrix(e){const r=new Matrix2D,s=Math.cos(e),o=Math.sin(e);return r.matrix[0][0]=s,r.matrix[0][1]=-o,r.matrix[1][0]=o,r.matrix[1][1]=s,r}scalarMultiplication(e){for(let r=0;r<2;r++)for(let s=0;s<2;s++)this.matrix[r][s]*=e}getTransposeMatrix(){const e=new Matrix2D;for(let r=0;r<2;r++)for(let s=0;s<2;s++)e.matrix[r][s]=this.matrix[s][r];return e}vectorMultiplication(e){const r=new PointF2D;return r.x=e.x*this.matrix[0][0]+e.y*this.matrix[0][1],r.y=e.x*this.matrix[1][0]+e.y*this.matrix[1][1],r}}class MusicSheetErrors{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(e){let r=this.measureErrors[e];r||(r=[]),this.measureErrors[e]=r.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(e){this.tempErrors.push(e)}push(e){this.errors.push(e)}}class Arpeggio{constructor(e,r=7){this.parentVoiceEntry=e,this.type=r,this.notes=[]}addNote(e){this.notes.push(e),e.Arpeggio=this}}var ArpeggioType=(i=>(i[i.BRUSH_DOWN=1]="BRUSH_DOWN",i[i.BRUSH_UP=2]="BRUSH_UP",i[i.ROLL_DOWN=3]="ROLL_DOWN",i[i.ROLL_UP=4]="ROLL_UP",i[i.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",i[i.RASQUEDO_UP=6]="RASQUEDO_UP",i[i.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS",i))(ArpeggioType||{});class Beam{constructor(e=1,r=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.AutoGenerated=!1,this.BeamNumber=e,this.BeamNumberOffsetToXML=r}get Notes(){return this.notes}set Notes(e){this.notes=e}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(e){this.extendedNoteList=e}addNoteToBeam(e){e&&(e.NoteBeam=this,this.notes.push(e),this.extendedNoteList.push(e))}}class Glissando{constructor(e){this.notes=[],this.XMLNumber=1,this.AddNote(e),this.StartNote=e,this.Direction=ColDirEnum.NotYetDefined}get Notes(){return this.notes}get Duration(){const e=new Fraction$1;for(const r of this.notes)e.Add(r.Length);return e}get Pitch(){return this.StartNote.Pitch}AddNote(e){this.notes.push(e),e.NoteGlissando=this,this.notes.length===2&&(this.notes[0].Pitch.getHalfTone()2:(loglevelExports.warn("notehead: sourceNote and filledXmlAttribute undefined."),s=!0)),this.filled=s}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(e){switch(e.toLowerCase()){case"normal":return 2;case"x":return 8;case"slash":return 4;case"diamond":return 1;case"square":return 5;case"la":return 5;case"do":case"triangle":return 6;case"inverted triangle":return 7;case"rectangle":return 3;case"circle-x":return 0;default:return loglevelExports.info("unsupported/unhandled xml notehead '"+e+"'. Using normal notehead."),2}}}var NoteHeadShape=(i=>(i[i.CIRCLEX=0]="CIRCLEX",i[i.DIAMOND=1]="DIAMOND",i[i.NORMAL=2]="NORMAL",i[i.RECTANGLE=3]="RECTANGLE",i[i.SLASH=4]="SLASH",i[i.SQUARE=5]="SQUARE",i[i.TRIANGLE=6]="TRIANGLE",i[i.TRIANGLE_INVERTED=7]="TRIANGLE_INVERTED",i[i.X=8]="X",i))(NoteHeadShape||{});class ITextTranslation{static translateText(e,r){if(!this.defaultTextTranslation)return r}}var NoteType=(i=>(i[i.UNDEFINED=0]="UNDEFINED",i[i._1024th=1]="_1024th",i[i._512th=2]="_512th",i[i._256th=3]="_256th",i[i._128th=4]="_128th",i[i._64th=5]="_64th",i[i._32nd=6]="_32nd",i[i._16th=7]="_16th",i[i.EIGTH=8]="EIGTH",i[i.QUARTER=9]="QUARTER",i[i.HALF=10]="HALF",i[i.WHOLE=11]="WHOLE",i[i.BREVE=12]="BREVE",i[i.LONG=13]="LONG",i[i.MAXIMA=14]="MAXIMA",i))(NoteType||{});class NoteTypeHandler{static NoteTypeToString(e){return this.NoteTypeXmlValues[e]}static StringToNoteType(e){const r=this.NoteTypeXmlValues.indexOf(e);return r!==-1?r:0}static getNoteDurationFromType(e){switch(e){case"1024th":return new Fraction$1(1,1024);case"512th":return new Fraction$1(1,512);case"256th":return new Fraction$1(1,256);case"128th":return new Fraction$1(1,128);case"64th":return new Fraction$1(1,64);case"32th":case"32nd":return new Fraction$1(1,32);case"16th":return new Fraction$1(1,16);case"eighth":return new Fraction$1(1,8);case"quarter":return new Fraction$1(1,4);case"half":return new Fraction$1(1,2);case"whole":return new Fraction$1(1,1);case"breve":return new Fraction$1(2,1);case"long":return new Fraction$1(4,1);case"maxima":return new Fraction$1(8,1);default:{const r=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new MusicSheetReadingException(r)}}}}NoteTypeHandler.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"];class OrnamentContainer{constructor(e){this.placement=PlacementEnum.Above,this.accidentalAbove=AccidentalEnum.NONE,this.accidentalBelow=AccidentalEnum.NONE,this.ornament=e}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(e){this.accidentalAbove=e}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(e){this.accidentalBelow=e}}var OrnamentEnum=(i=>(i[i.Trill=0]="Trill",i[i.Turn=1]="Turn",i[i.InvertedTurn=2]="InvertedTurn",i[i.DelayedTurn=3]="DelayedTurn",i[i.DelayedInvertedTurn=4]="DelayedInvertedTurn",i[i.Mordent=5]="Mordent",i[i.InvertedMordent=6]="InvertedMordent",i))(OrnamentEnum||{});class VerticalSourceStaffEntryContainer{constructor(e,r,s){this.staffEntries=[],this.comments=[],this.timestamp=r,this.staffEntries=new Array(s),this.parentMeasure=e}$get$(e){return this.staffEntries[e]}$set$(e,r){this.staffEntries[e]=r}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get StaffEntries(){return this.staffEntries}set StaffEntries(e){this.staffEntries=e}get Comments(){return this.comments}set Comments(e){this.comments=e}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(e){this.parentMeasure=e}getAbsoluteTimestamp(){return Fraction$1.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}class SourceStaffEntry{constructor(e,r){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=e,this.parentStaff=r}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return Fraction$1.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(e){this.voiceEntries=e}get Link(){return this.staffEntryLink}set Link(e){this.staffEntryLink=e}get Instructions(){return this.instructions}set Instructions(e){this.instructions=e}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(e){this.chordSymbolContainers=e}removeAllInstructionsOfTypeClefInstruction(){let e=0,r=0;for(;e0)return!0;return!1}hasTie(){for(let e=0,r=this.VoiceEntries.length;er.parentRepetition.StartIndex)return-1}if(e.alignment===0&&r.alignment===0){if(e.parentRepetition.EndIndexr.parentRepetition.EndIndex)return-1}}return 0}}class RepetitionInstruction{constructor(e,r,s=1,o=void 0,a=void 0){this.endingIndices=void 0,this.measureIndex=e,a&&(this.endingIndices=a.slice()),this.type=r,this.alignment=s,this.parentRepetition=o}CompareTo(e){const r=e;if(this.measureIndex>r.measureIndex)return 1;if(this.measureIndex(i[i.StartLine=0]="StartLine",i[i.ForwardJump=1]="ForwardJump",i[i.BackJumpLine=2]="BackJumpLine",i[i.Ending=3]="Ending",i[i.DaCapo=4]="DaCapo",i[i.DalSegno=5]="DalSegno",i[i.Fine=6]="Fine",i[i.ToCoda=7]="ToCoda",i[i.DalSegnoAlFine=8]="DalSegnoAlFine",i[i.DaCapoAlFine=9]="DaCapoAlFine",i[i.DalSegnoAlCoda=10]="DalSegnoAlCoda",i[i.DaCapoAlCoda=11]="DaCapoAlCoda",i[i.Coda=12]="Coda",i[i.Segno=13]="Segno",i[i.None=14]="None",i))(RepetitionInstructionEnum||{}),AlignmentType=(i=>(i[i.Begin=0]="Begin",i[i.End=1]="End",i))(AlignmentType||{});let prevSourceMeasure=null;class SourceMeasure{constructor(e,r){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.metronomeNoteIndex=0,this.WasRendered=!1,this.completeNumberOfStaves=e,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(e),this.lastInstructionsStaffEntries=new Array(e),this.rules=r,this.TempoInBPM=0;for(let s=0;s1)return e[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(e){this.verticalMeasureList=e}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(e){this.tempoInBPM=e}findOrCreateStaffEntry(e,r,s){let o,a;for(const u of this.verticalSourceStaffEntryContainers)if(u.Timestamp.Equals(e)){a=u;break}if(a)return a.StaffEntries[r]?o=a.StaffEntries[r]:(o=new SourceStaffEntry(a,s),a.StaffEntries[r]=o),{createdNewContainer:!1,staffEntry:o};const l=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(this.verticalSourceStaffEntryContainers.length===0||l.Timestamp.lt(e)){const u=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(u),o=new SourceStaffEntry(u,s),u.StaffEntries[r]=o}else for(let u=this.verticalSourceStaffEntryContainers.length-1;u>=0;u--){if(this.verticalSourceStaffEntryContainers[u].Timestamp.lt(e)){const c=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(u+1,0,c),o=new SourceStaffEntry(c,s),c.StaffEntries[r]=o;break}if(u===0){const c=new VerticalSourceStaffEntryContainer(this,e.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(u,0,c),o=new SourceStaffEntry(c,s),c.StaffEntries[r]=o;break}}return{createdNewContainer:!0,staffEntry:o}}findOrCreateVoiceEntry(e,r){let s,o=!1;for(const a of e.VoiceEntries)if(a.ParentVoice===r){s=a;break}return s||(s=new VoiceEntry(e.Timestamp,r,e),o=!0),{createdVoiceEntry:o,voiceEntry:s}}getPreviousSourceStaffEntryFromIndex(e,r){for(let s=r-1;s>=0;s--)if(this.verticalSourceStaffEntryContainers[s][e])return this.verticalSourceStaffEntryContainers[s][e]}getVerticalContainerIndexByTimestamp(e){for(let r=0,s=this.VerticalSourceStaffEntryContainers.length;r=0;m--){const g=this.verticalSourceStaffEntryContainers[m][u+c];if(g!==void 0&&g.hasTie()&&l.lt(Fraction$1.plus(g.Timestamp,g.calculateMaxNoteLength()))){l=Fraction$1.plus(g.Timestamp,g.calculateMaxNoteLength());break}}}}o.push(l)}for(let a=0,l=o.length;a0)return!0}return!1}beginsWithLineRepetition(){for(let e=0,r=this.FirstRepetitionInstructions.length;e=0;o--)if(s=this.verticalSourceStaffEntryContainers[o].StaffEntries[e],s&&(!r||s.VoiceEntries.length>0))return s}canBeReducedToMultiRest(){var s,o,a,l,u,c;if(this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0)return!1;let e=!0,r=!1;for(const d of this.verticalSourceStaffEntryContainers)if(d){for(const y of d.StaffEntries)if(!(!y||!y.ParentStaff.ParentInstrument.Visible)){if(y.ChordContainers.length>0)return!1;y.ParentStaff.hasLyrics&&(r=!0);for(const m of y.VoiceEntries){for(const g of m.Notes)if(!g.isRest()){e=!1;break}if(!e)break}}}if(!e||r||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const d of this.staffLinkedExpressions)if(d.length>0)return!1;for(const d of this.lastInstructionsStaffEntries)for(let y=0,m=d==null?void 0:d.Instructions.length;y=0;r--)for(let s=0;s(i[i.Fingering=0]="Fingering",i[i.String=1]="String",i))(TechnicalInstructionType||{});class TechnicalInstruction{}class PlaybackNote{constructor(e,r){this.parentEntry=e,this.parentNote=r,this.ParentNote.PlaybackNote=this,this.Length=this.ParentNote.Length,r.Pitch!==void 0?this.ParentNote.ParentStaff.ParentInstrument.MidiInstrumentId===MidiInstrument.Percussion?this.MidiKey=PlaybackNote.noteToMidiDrumKey(r):this.MidiKey=r.Pitch.getHalfTone()+12:this.MidiKey=0}setLength(){this.ParentNote.NoteTie!==void 0&&this.ParentNote.NoteTie.StartNote===this.ParentNote&&(this.Length=this.ParentNote.NoteTie.Duration)}get ParentEntry(){return this.parentEntry}get ParentNote(){return this.parentNote}static noteToMidiDrumKey(e){var o;const r=e.Pitch.getHalfTone()-12,s=(o=e.Notehead)==null?void 0:o.Shape;switch(e.Pitch.Octave){case 1:switch(e.Pitch.FundamentalNote){case NoteEnum.D:switch(s){default:return 44}case NoteEnum.E:switch(s){default:return 35}case NoteEnum.F:switch(s){default:return 36}case NoteEnum.G:switch(s){default:return 41}case NoteEnum.A:switch(s){default:return 43}case NoteEnum.B:switch(s){case NoteHeadShape.TRIANGLE:return 54;default:return 47}default:return r}case 2:switch(e.Pitch.FundamentalNote){case NoteEnum.C:switch(s){case NoteHeadShape.X:return 37;default:return 38}case NoteEnum.D:switch(s){case NoteHeadShape.X:return 59;default:return 48}case NoteEnum.E:switch(s){case NoteHeadShape.X:return 42;case NoteHeadShape.CIRCLEX:return 46;case NoteHeadShape.TRIANGLE:return 56;default:return 50}case NoteEnum.F:switch(s){case NoteHeadShape.DIAMOND:return 53;default:return 51}case NoteEnum.G:switch(s){case NoteHeadShape.CIRCLEX:case NoteHeadShape.DIAMOND:return 46;default:return 42}case NoteEnum.A:switch(s){default:return 49}case NoteEnum.B:switch(s){default:return 57}default:return r}case 3:switch(e.Pitch.FundamentalNote){case NoteEnum.C:switch(s){case NoteHeadShape.CIRCLEX:return 52;default:return 55}default:return r}default:return r}}}class PlaybackEntry{constructor(e){this.notes=[],this.TimestampShift=new Fraction$1,this.parentVoiceEntry=e;for(const r of e.Notes)this.Notes.push(new PlaybackNote(this,r))}get ParentVoiceEntry(){return this.parentVoiceEntry}get Notes(){return this.notes}get Length(){if(this.Notes.length>0)return this.Notes[0].Length}set Length(e){for(const r of this.Notes)r.Length=e}get HasNotes(){return this.Notes.length>0}}class VoiceEntry{constructor(e,r,s,o=!0,a=!1,l=!1,u=!1){if(this.notes=[],this.graceVoiceEntriesBefore=[],this.graceVoiceEntriesAfter=[],this.articulations=[],this.playbackEntries=[],this.technicalInstructions=[],this.lyricsEntries=new Dictionary,this.wantedStemDirection=-1,this.stemDirectionXml=-1,this.stemDirection=-1,this.timestamp=e,this.parentVoice=r,this.parentSourceStaffEntry=s,this.isGrace=a,this.graceAfterMainNote=!1,this.graceNoteSlash=l,this.graceSlur=u,a||r.VoiceEntries.push(this),o&&s!==void 0){const c=s.VoiceEntries;c.indexOf(this)===-1&&c.push(this)}this.mainPlaybackEntry=new PlaybackEntry(this),this.PlaybackEntries.push(this.mainPlaybackEntry)}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get Notes(){return this.notes}addNote(e){this.notes.push(e),!e.isRest()&&(e.NoteTie===void 0||e.NoteTie.StartNote===e)&&this.MainPlaybackEntry.Notes.push(new PlaybackNote(this.MainPlaybackEntry,e))}get GraceVoiceEntriesBefore(){return this.graceVoiceEntriesBefore}set GraceVoiceEntriesBefore(e){this.graceVoiceEntriesBefore=e;for(const r of this.graceVoiceEntriesBefore)r.parentSourceStaffEntry=this.ParentSourceStaffEntry}get GraceVoiceEntriesAfter(){return this.graceVoiceEntriesAfter}set GraceVoiceEntriesAfter(e){this.graceVoiceEntriesAfter=e;for(const r of this.graceVoiceEntriesAfter)r.parentSourceStaffEntry=this.ParentSourceStaffEntry}get IsGrace(){return this.isGrace}set IsGrace(e){this.isGrace=e}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(e){this.graceAfterMainNote=e}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(e){this.graceNoteSlash=e}get GraceSlur(){return this.graceSlur}set GraceSlur(e){this.graceSlur=e}get Articulations(){return this.articulations}get PlaybackEntries(){return this.playbackEntries}get Fermata(){return this.fermata}get MainPlaybackEntry(){return this.mainPlaybackEntry}set MainPlaybackEntry(e){this.mainPlaybackEntry=e}removeMainPlaybackEntry(){this.mainPlaybackEntry!==void 0&&this.removePlaybackEntry(this.mainPlaybackEntry)}removePlaybackEntry(e){this.mainPlaybackEntry===e&&(this.mainPlaybackEntry=void 0);const r=this.playbackEntries.indexOf(e);r>-1&&this.playbackEntries.splice(r,1)}set Articulations(e){this.articulations=e}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(e){this.arpeggio=e}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(e){this.ornamentContainer=e}set WantedStemDirection(e){this.wantedStemDirection=e}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(e){this.stemDirectionXml=e}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(e){this.stemDirection=e}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(e){this.stemColorXml=e}get StemColor(){return this.stemColor}set StemColor(e){this.stemColor=e}get VolumeModifier(){return this.volumeModifier}set VolumeModifier(e){this.volumeModifier=e}get DurationModifier(){return this.durationModifier}set DurationModifier(e){this.durationModifier=e}hasArticulation(e){for(const r of this.articulations)if(r.Equals(e))return!0;return!1}static isSupportedArticulation(e){switch(e){case 0:case 1:case 2:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 27:return!0;default:return!1}}hasTie(){for(let e=0,r=this.Notes.length;e0)return!0;return!1}isStaccato(){for(const e of this.Articulations)if(e.articulationEnum===6)return!0;return!1}isAccent(){for(const e of this.Articulations)if(e.articulationEnum===0||e.articulationEnum===1)return!0;return!1}getVerseNumberForLyricEntry(e){let r="1";return this.lyricsEntries.forEach((s,o)=>{e===o&&(r=s)}),r}}var ArticulationEnum=(i=>(i[i.accent=0]="accent",i[i.strongaccent=1]="strongaccent",i[i.softaccent=2]="softaccent",i[i.marcatoup=3]="marcatoup",i[i.marcatodown=4]="marcatodown",i[i.invertedstrongaccent=5]="invertedstrongaccent",i[i.staccato=6]="staccato",i[i.staccatissimo=7]="staccatissimo",i[i.spiccato=8]="spiccato",i[i.tenuto=9]="tenuto",i[i.fermata=10]="fermata",i[i.invertedfermata=11]="invertedfermata",i[i.breathmark=12]="breathmark",i[i.caesura=13]="caesura",i[i.lefthandpizzicato=14]="lefthandpizzicato",i[i.naturalharmonic=15]="naturalharmonic",i[i.snappizzicato=16]="snappizzicato",i[i.upbow=17]="upbow",i[i.downbow=18]="downbow",i[i.scoop=19]="scoop",i[i.plop=20]="plop",i[i.doit=21]="doit",i[i.falloff=22]="falloff",i[i.stress=23]="stress",i[i.unstress=24]="unstress",i[i.detachedlegato=25]="detachedlegato",i[i.otherarticulation=26]="otherarticulation",i[i.bend=27]="bend",i))(ArticulationEnum||{}),StemDirectionType=(i=>(i[i.Undefined=-1]="Undefined",i[i.Up=0]="Up",i[i.Down=1]="Down",i[i.None=2]="None",i[i.Double=3]="Double",i))(StemDirectionType||{}),SystemLinePosition=(i=>(i[i.MeasureBegin=0]="MeasureBegin",i[i.MeasureEnd=1]="MeasureEnd",i))(SystemLinePosition||{});class GraphicalLabel extends Clickable{constructor(e,r,s,o,a=void 0){super(),this.CenteringXShift=0,this.label=e,this.boundingBox=new BoundingBox$1(this,a),this.label.fontHeight=r,this.label.textAlignment=s,this.rules=o,this.rules.MpatMode&&this.label.text==="TRIO"&&(this.label.fontFamily="Arial")}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var u,c;if(this.Label.text.trim()==="")return;this.TextLines=[];const e=(c=(u=this.rules)==null?void 0:u.LabelMarginBorderFactor)!=null?c:.1,r=this.Label.text.split(/[\n\r]+/g),s=r.length;let o=0;for(let d=0;d0&&this.TextLines.length>1&&(a+=this.rules.SpacingBetweenTextLines*s/10);const l=this.PositionAndShape;switch(this.Label.textAlignment){case TextAlignmentEnum.CenterBottom:l.BorderTop=-a,l.BorderLeft=-o/2,l.BorderBottom=0,l.BorderRight=o/2;break;case TextAlignmentEnum.CenterCenter:l.BorderTop=-a/2,l.BorderLeft=-o/2,l.BorderBottom=a/2,l.BorderRight=o/2;break;case TextAlignmentEnum.CenterTop:l.BorderTop=0,l.BorderLeft=-o/2,l.BorderBottom=a,l.BorderRight=o/2;break;case TextAlignmentEnum.LeftBottom:l.BorderTop=-a,l.BorderLeft=0,l.BorderBottom=0,l.BorderRight=o;break;case TextAlignmentEnum.LeftCenter:l.BorderTop=-a/2,l.BorderLeft=0,l.BorderBottom=a/2,l.BorderRight=o;break;case TextAlignmentEnum.LeftTop:l.BorderTop=0,l.BorderLeft=0,l.BorderBottom=a,l.BorderRight=o;break;case TextAlignmentEnum.RightBottom:l.BorderTop=-a,l.BorderLeft=-o,l.BorderBottom=0,l.BorderRight=0;break;case TextAlignmentEnum.RightCenter:l.BorderTop=-a/2,l.BorderLeft=-o,l.BorderBottom=a/2,l.BorderRight=0;break;case TextAlignmentEnum.RightTop:l.BorderTop=0,l.BorderLeft=-o,l.BorderBottom=a,l.BorderRight=0;break}l.BorderMarginTop=l.BorderTop-a*e,l.BorderMarginLeft=l.BorderLeft-a*e,l.BorderMarginBottom=l.BorderBottom+a*e,l.BorderMarginRight=l.BorderRight+a*e}}class Label{constructor(e="",r=TextAlignmentEnum.CenterBottom,s=void 0,o=!0){this.IsCreditLabel=!1,this.isLyricText=!1,this.text=e,this.print=o,this.textAlignment=r,this.font=s,this.fontFamily=void 0}set font(e){this.fontEnumValue=e,this.fontFamily=FontStringNames[e]}get font(){return this.fontEnumValue}ToString(){return this.text}}const SpeedTag={Grava:40,Largo:46,Lento:52,Adagio:56,Larghetto:60,Andante:66,Anderato:69,Andantino:69,Moderato:88,Allegretto:108,"Allegro Moderato":108,Allegro:132,Vivace:152,Vivo:160,Vivacissimo:168,Presto:184,Prestissimo:208},SpecialMarks=["纯律","纯律结束"],HideWords=["跳过下一个","b","#","§","º","X"],GradientWords=["poco rit.","rall.","rit.","accel.","molto rit.","molto rall","lentando","poco accel.","calando"],GRADIENT_SPEED_CLOSE_TAG="结束范围速度",GRADIENT_SPEED_RESET_TAG="a tempo",SpecialWords=[GRADIENT_SPEED_CLOSE_TAG],SpeedKeyword="速度 ",SpeedHiddenKeyword="仅文本速度 ";function isSpeedKeyword(i){return i.indexOf(SpeedKeyword)===0}function isSpeedHiddenKeyword(i){return i.indexOf(SpeedHiddenKeyword)===0}function formatSpeedKeyword(i){return i.replace(SpeedHiddenKeyword,"").replace(SpeedKeyword,"")}function isGradientWords(i){return GradientWords.includes(i)}function isSpecialMark(i){return[...Object.keys(SpeedTag),...SpecialMarks,...SpecialWords,...HideWords].map(e=>e.trim().toLocaleUpperCase()).includes(i.toLocaleUpperCase().trim())}function isTopFont(i){return[TextAlignmentEnum.CenterTop,TextAlignmentEnum.RightTop].includes(i)}var MusicSymbol=(i=>(i[i.Unused_first_Symbol=0]="Unused_first_Symbol",i[i.BLACK_HEAD=1]="BLACK_HEAD",i[i.UPWARDS_TAIL=2]="UPWARDS_TAIL",i[i.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",i[i.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",i[i.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",i[i.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",i[i.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",i[i.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",i[i.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",i[i.ROUND_HEAD=10]="ROUND_HEAD",i[i.WHITE_HEAD=11]="WHITE_HEAD",i[i.G_CLEF=12]="G_CLEF",i[i.F_CLEF=13]="F_CLEF",i[i.C_CLEF=14]="C_CLEF",i[i.BREVE=15]="BREVE",i[i.BREVE_REST=16]="BREVE_REST",i[i.COMMON_TIME=17]="COMMON_TIME",i[i.CUT_TIME=18]="CUT_TIME",i[i.WHOLE_REST=19]="WHOLE_REST",i[i.HALF_REST=20]="HALF_REST",i[i.QUARTER_REST=21]="QUARTER_REST",i[i.EIGHTH_REST=22]="EIGHTH_REST",i[i.SIXTEENTH_REST=23]="SIXTEENTH_REST",i[i.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",i[i.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",i[i.FLAT=26]="FLAT",i[i.SHARP=27]="SHARP",i[i.NATURAL=28]="NATURAL",i[i.DOUBLE_FLAT=29]="DOUBLE_FLAT",i[i.DOUBLE_SHARP=30]="DOUBLE_SHARP",i[i.ZERO=31]="ZERO",i[i.ONE=32]="ONE",i[i.TWO=33]="TWO",i[i.THREE=34]="THREE",i[i.FOUR=35]="FOUR",i[i.FIVE=36]="FIVE",i[i.SIX=37]="SIX",i[i.SEVEN=38]="SEVEN",i[i.EIGHT=39]="EIGHT",i[i.NINE=40]="NINE",i[i.DOT=41]="DOT",i[i.FERMATA=42]="FERMATA",i[i.INVERTED_FERMATA=43]="INVERTED_FERMATA",i[i.SPICCATO=44]="SPICCATO",i[i.TENUTO=45]="TENUTO",i[i.MARCATO=46]="MARCATO",i[i.MARCATISSIMO=47]="MARCATISSIMO",i[i.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",i[i.P=49]="P",i[i.F=50]="F",i[i.S=51]="S",i[i.Z=52]="Z",i[i.M=53]="M",i[i.R=54]="R",i[i.SEGNO=55]="SEGNO",i[i.CODA=56]="CODA",i[i.DRUM_CLEF=57]="DRUM_CLEF",i[i.G_CLEF_SUB8=58]="G_CLEF_SUB8",i[i.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",i[i.G_CLEF_SUB15=60]="G_CLEF_SUB15",i[i.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",i[i.F_CLEF_SUB8=62]="F_CLEF_SUB8",i[i.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",i[i.F_CLEF_SUB15=64]="F_CLEF_SUB15",i[i.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",i[i.DOWN_BOW=66]="DOWN_BOW",i[i.MORDENT=67]="MORDENT",i[i.INVERTED_MORDENT=68]="INVERTED_MORDENT",i[i.TURN=69]="TURN",i[i.INVERTED_TURN=70]="INVERTED_TURN",i[i.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",i[i.RELEASE_PED=72]="RELEASE_PED",i[i.ENGAGE_PED=73]="ENGAGE_PED",i[i.VA8=74]="VA8",i[i.VB8=75]="VB8",i[i.TRILL=76]="TRILL",i[i.MA15=77]="MA15",i[i.MB15=78]="MB15",i[i.HIGH=79]="HIGH",i[i.PLAY=80]="PLAY",i[i.MIC=81]="MIC",i[i.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",i[i.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",i[i.EditPen=84]="EditPen",i[i.PEDAL_BRACKET=85]="PEDAL_BRACKET",i[i.PEDAL_MIXED=86]="PEDAL_MIXED",i[i.PEDAL_SYMBOL=87]="PEDAL_SYMBOL",i))(MusicSymbol||{}),MusicSymbolDrawingStyle=(i=>(i[i.Normal=0]="Normal",i[i.Disabled=1]="Disabled",i[i.Selected=2]="Selected",i[i.Clickable=3]="Clickable",i[i.PlaybackSymbols=4]="PlaybackSymbols",i[i.FollowSymbols=5]="FollowSymbols",i[i.QFeedbackNotFound=6]="QFeedbackNotFound",i[i.QFeedbackOk=7]="QFeedbackOk",i[i.QFeedbackPerfect=8]="QFeedbackPerfect",i[i.Debug1=9]="Debug1",i[i.Debug2=10]="Debug2",i[i.Debug3=11]="Debug3",i))(MusicSymbolDrawingStyle||{}),PhonicScoreModes=(i=>(i[i.Following=0]="Following",i[i.Midi=1]="Midi",i[i.Manual=2]="Manual",i))(PhonicScoreModes||{});class LabelRenderSpecs{}class MusicSheetDrawer{constructor(e,r){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.needSpecialArrTs=[],this.phonicScoreMode=PhonicScoreModes.Manual,this.textMeasurer=e,this.splitScreenLineColor=-1,this.drawingParameters=r,this.rules=r.Rules}set Mode(e){this.phonicScoreMode=e}drawSheet(e){if(this.graphicalMusicSheet=e,this.rules=e.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const s of e.Cursors){if(!s)continue;const o=new BoundingBox$1(s);o.AbsolutePosition=s.Start,o.BorderBottom=s.End.y-s.Start.y,o.BorderRight=s.Width/2,o.BorderLeft=-s.Width/2,this.isVisible(o)&&this.drawLineAsVerticalRectangle(s,GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const r=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let s=0;sz[0]).filter(Boolean))||[],O=[];let Q=!1;for(let z=0;zz.x-W.x))==null?void 0:T[0])==null?void 0:C.measure;break}}}catch(D){console.log("🚀 ~ error",D)}let I=0;F?I=((P=F.stave)==null?void 0:P.end_x)||0:I=((k=s.sourceNote.SourceMeasure.VerticalMeasureList[0])==null?void 0:k.getVFStave()).end_x;const U=0;a.ScreenPosition.x=I,a.ScreenPosition.y=H===0?(e.PositionAndShape.Parent.AbsolutePosition.y-3-U)*10:H*10}const c=["C","G","D","A","E","B","F#","C#","G#","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","D#","A#","E#"];c.includes(o.text)&&(a.ScreenPosition.y=(e.PositionAndShape.Parent.AbsolutePosition.y+e.PositionAndShape.Parent.BorderTop+e.PositionAndShape.Parent.BorderMarginTop)*10),["play","listen"].includes(o.text.toLocaleLowerCase())&&o.textAlignment===TextAlignmentEnum.LeftBottom&&(a.ScreenPosition.y=(e.PositionAndShape.Parent.AbsolutePosition.y-1+e.PositionAndShape.Parent.BorderBottom)*10);const d=["ffp","p-f","sfzp","szf","sffzp"];for(let H=0;H0&&(isTopFont(e.Label.textAlignment)||[TextAlignmentEnum.CenterBottom].includes(e.Label.textAlignment))){let H=-1,B=!1;for(const F of(u==null?void 0:u.AbstractExpressions)||[])if(F.Label===e?H=(M=F==null?void 0:F.parentMeasure)==null?void 0:M.measureListIndex:(R=F.expression)!=null&&R.TempoInBpm&&(B=F.expression.TempoInBpm>0),B&&H>-1){a.ScreenPosition.y-=4*10;break}}this.renderLabel(e,r,a)}calculateLabel(e){var u,c;const r=new LabelRenderSpecs,s=e.Label;r.ScreenPosition=this.applyScreenTransformation(e.PositionAndShape.AbsolutePosition),r.FontHeightInPixel=this.calculatePixelDistance(s.fontHeight);const o=this.calculatePixelDistance(e.PositionAndShape.Size.width);switch(r.BitmapWidth=Math.ceil(o),r.BitmapHeight=e.TextLines?Math.ceil(r.FontHeightInPixel*(.2+e.TextLines.length)):10,s.textAlignment){case TextAlignmentEnum.LeftTop:break;case TextAlignmentEnum.LeftCenter:r.ScreenPosition.y-=r.BitmapHeight/2;break;case TextAlignmentEnum.LeftBottom:r.ScreenPosition.y-=r.BitmapHeight;break;case TextAlignmentEnum.CenterTop:r.ScreenPosition.x-=r.BitmapWidth/2;break;case TextAlignmentEnum.CenterCenter:r.ScreenPosition.x-=r.BitmapWidth/2,r.ScreenPosition.y-=r.BitmapHeight/2;break;case TextAlignmentEnum.CenterBottom:r.ScreenPosition.x-=r.BitmapWidth/2,r.ScreenPosition.y-=r.BitmapHeight,s.text==="筒音作5"&&this.rules.DYMusicScoreType==="jianpu"&&(r.ScreenPosition.x=80);break;case TextAlignmentEnum.RightTop:r.ScreenPosition.x-=r.BitmapWidth;break;case TextAlignmentEnum.RightCenter:r.ScreenPosition.x-=r.BitmapWidth,r.ScreenPosition.y-=r.BitmapHeight/2;break;case TextAlignmentEnum.RightBottom:r.ScreenPosition.x-=r.BitmapWidth,r.ScreenPosition.y-=r.BitmapHeight;break;default:throw new ArgumentOutOfRangeException("")}const a=e.PositionAndShape.Parent.DataObject,l=[1,3,7,9,15,20,22,24,28,30,36,41];this.rules.DYMusicScoreId&&this.rules.DYMusicScoreId==="1722157850347765762"&&(s.text==="."&&(r.ScreenPosition.x=142,r.ScreenPosition.y=134),s.text==="T"&&(this.needSpecialArrTs.push(r),((c=(u=a==null?void 0:a.measures)==null?void 0:u[0])==null?void 0:c.MeasureNumber)===1?r.ScreenPosition.y+=20:r.ScreenPosition.y-=20));for(let d in this.needSpecialArrTs)l.includes(Number(d))&&(this.needSpecialArrTs[d].ScreenPosition.x-=20);return r}applyScreenTransformations(e){const r=[];for(const s of e)r.push(this.applyScreenTransformation(s));return r}drawSplitScreenLine(){}renderRectangle(e,r,s,o=void 0,a=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(e){}drawSelectionEndSymbol(e){}renderLabel(e,r,s){throw new Error("not implemented")}renderSystemToScreen(e,r,s){}drawSkyLine(e){}drawBottomLine(e){}drawInstrumentBrace(e,r){}drawGroupBracket(e,r){}isVisible(e){return!0}drawMusicSystem(e){const r=this.getSystemAbsBoundingRect(e),s=this.getSytemBoundingBoxInPixels(r);this.drawMusicSystemComponents(e,s,r)}getSytemBoundingBoxInPixels(e){const r=this.applyScreenTransformationForRect(e);return r.x=Math.round(r.x),r.y=Math.round(r.y),r}getSystemAbsBoundingRect(e){const r=e.PositionAndShape.BoundingRectangle;return new RectangleF2D(e.PositionAndShape.AbsolutePosition.x+e.PositionAndShape.BorderLeft-1,e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderTop-1,r.width+6,r.height+2)}drawMusicSystemComponents(e,r,s){const o=this.graphicalMusicSheet.SelectionStartSymbol,a=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&o!==void 0&&this.isVisible(o.PositionAndShape)&&this.drawSelectionStartSymbol(o),this.drawingParameters.drawSelectionEndSymbol&&a!==void 0&&this.isVisible(a.PositionAndShape)&&this.drawSelectionEndSymbol(a);for(const c of e.StaffLines)this.drawStaffLine(c),this.rules.RenderLyrics&&(c.LyricsDashes.length>0&&this.drawDashes(c.LyricsDashes),c.LyricLines.length>0&&this.drawLyricLines(c.LyricLines,c));for(const c of e.SystemLines)this.drawSystemLineObject(c);if(this.rules.RenderSystemLabelsAfterFirstPage||e.Parent===e.Parent.Parent.MusicPages[0])for(const c of e.Labels)c.SVGNode=this.drawLabel(c,GraphicalLayers.Notes);const l=this.graphicalMusicSheet.ParentMusicSheet.Instruments,u=l.filter(c=>c.Visible).length;for(const c of e.InstrumentBrackets)this.drawInstrumentBrace(c,e);if(l.length>0)if(u>1)for(const c of e.GroupBrackets)this.drawGroupBracket(c,e);else for(const c of e.GroupBrackets)c.Visible=!1;if(!this.leadSheet)for(const c of e.MeasureNumberLabels)c.SVGNode=this.drawLabel(c,GraphicalLayers.Notes);for(const c of e.StaffLines)this.drawStaffLineSymbols(c);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(e)}activateSystemRendering(e,r,s,o){return!0}drawSystemLineObject(e){}drawStaffLine(e){for(const r of e.Measures)this.drawMeasure(r),r.parentSourceMeasure&&(r.parentSourceMeasure.WasRendered=!0);this.rules.RenderLyrics&&e.LyricsDashes.length>0&&this.drawDashes(e.LyricsDashes),this.drawOctaveShifts(e),this.drawPedals(e),this.drawWavyLines(e),this.drawExpressions(e),this.skyLineVisible&&this.drawSkyLine(e),this.bottomLineVisible&&this.drawBottomLine(e)}drawLyricLines(e,r){r.LyricLines.forEach(s=>{s.Start.y+=r.PositionAndShape.AbsolutePosition.y,s.End.y+=r.PositionAndShape.AbsolutePosition.y,s.Start.x+=r.PositionAndShape.AbsolutePosition.x,s.End.x+=r.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(s,this.rules.LyricUnderscoreLineWidth,s.colorHex)})}drawExpressions(e){}drawGraphicalLine(e,r,s="black"){return this.drawLine(e.Start,e.End,s,r)}drawLine(e,r,s="#FF0000FF",o){}drawDashes(e){e.forEach(r=>r.SVGNode=this.drawLabel(r,GraphicalLayers.Notes))}drawOctaveShifts(e){}drawStaffLines(e){if(e.StaffLines){const r=e.PositionAndShape.AbsolutePosition;for(let s=0;s<5;s++)this.drawLineAsHorizontalRectangleWithOffset(e.StaffLines[s],r,GraphicalLayers.Notes)}}drawSymbol(e,r,s,o=1,a=GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(e){this.graphicalMusicSheet.LeadSheet=e}drawPage(e){if(this.isVisible(e.PositionAndShape)){for(const r of e.MusicSystems)this.isVisible(r.PositionAndShape)&&this.drawMusicSystem(r);if(e===e.Parent.MusicPages[0])for(const r of e.Labels)r.SVGNode=this.drawLabel(r,GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(e.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(e,r=0,s="all"){const o=e.DataObject.constructor.name;let a=!1;s==="all"&&(a=!0),(a||o===s)&&this.drawBoundingBox(e,void 0,!0,o,r),r++,e.ChildElements.forEach(l=>this.drawBoundingBoxes(l,r,s))}drawBoundingBox(e,r=void 0,s=!1,o=void 0,a=0){let l=new RectangleF2D(e.AbsolutePosition.x+e.BorderMarginLeft,e.AbsolutePosition.y+e.BorderMarginTop,e.BorderMarginRight-e.BorderMarginLeft,e.BorderMarginBottom-e.BorderMarginTop);s&&(this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(e.AbsolutePosition.x-1,e.AbsolutePosition.y),new PointF2D(e.AbsolutePosition.x+1,e.AbsolutePosition.y),.1,OutlineAndFillStyleEnum.BaseWritingColor,r),a-1),this.drawLineAsVerticalRectangle(new GraphicalLine(new PointF2D(e.AbsolutePosition.x,e.AbsolutePosition.y-1),new PointF2D(e.AbsolutePosition.x,e.AbsolutePosition.y+1),.1,OutlineAndFillStyleEnum.BaseWritingColor,r),a-1)),l=this.applyScreenTransformationForRect(l);const u=this.renderRectangle(l,GraphicalLayers.Background,a,r,.5);if(o){const c=new Label(o),d=new LabelRenderSpecs;d.BitmapWidth=l.width,d.BitmapHeight=l.height,d.FontHeightInPixel=l.height,d.ScreenPosition=new PointF2D(l.x,l.y+12),this.renderLabel(new GraphicalLabel(c,.8,TextAlignmentEnum.CenterCenter,this.rules),a,d)}return u}drawMarkedAreas(e){for(const r of e.GraphicalMarkedAreas)r&&(r.systemRectangle&&this.drawRectangle(r.systemRectangle,GraphicalLayers.Background),r.settings&&(r.settings.SVGNode=this.drawLabel(r.settings,GraphicalLayers.Comment)),r.labelRectangle&&this.drawRectangle(r.labelRectangle,GraphicalLayers.Background),r.label&&(r.label.SVGNode=this.drawLabel(r.label,GraphicalLayers.Comment)))}drawStaffLineSymbols(e){const r=e.ParentStaff.ParentInstrument,s=e.PositionAndShape.AbsolutePosition.x,o=e.PositionAndShape.AbsolutePosition.y+2,a=e.PositionAndShape.BorderRight;r.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(s,o),new PointF2D(s+a,o),4,OutlineAndFillStyleEnum.Highlighted),GraphicalLayers.Highlight);let l=MusicSymbolDrawingStyle.Disabled,u=MusicSymbol.PLAY,c=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case PhonicScoreModes.Midi:u=MusicSymbol.PLAY,this.midiPlaybackAvailable&&e.ParentStaff.audible&&(l=MusicSymbolDrawingStyle.PlaybackSymbols);break;case PhonicScoreModes.Following:u=MusicSymbol.MIC,e.ParentStaff.following&&(l=MusicSymbolDrawingStyle.FollowSymbols);break;default:c=!1;break}if(c){const d=new PointF2D(s+a+2,o);this.drawSymbol(u,l,d)}if(this.drawingParameters.drawErrors)for(const d of e.Measures){const y=d.PositionAndShape,m=y.AbsolutePosition.x,g=y.AbsolutePosition.y+2;d.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(m,g),new PointF2D(m+y.BorderRight,g),4,OutlineAndFillStyleEnum.ErrorUnderlay),GraphicalLayers.MeasureError)}}}class VexFlowTextMeasurer{constructor(e){this.fontSize=20,this.fontSizeStandard=this.fontSize;const r=document.createElement("canvas");this.context=r.getContext("2d"),this.rules=e}computeTextWidthToHeightRatio(e,r,s,o=void 0,a=this.fontSize){return this.context.font=VexFlowConverter.font(a,s,r,this.rules,o),this.context.measureText(e).width/a}setFontSize(e=this.fontSizeStandard){return this.fontSize=e,e}}class AbstractGraphicalExpression extends GraphicalObject{constructor(e,r,s){super(),this.expression=r,this.parentMeasure=s,this.boundingBox=new BoundingBox$1(this,e.PositionAndShape),this.parentStaffLine=e,this.parentStaffLine.AbstractExpressions.push(this),this.rules=e.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}class GraphicalInstantaneousTempoExpression extends AbstractGraphicalExpression{constructor(e,r){super(r.PositionAndShape.Parent.DataObject,e,e.parentMeasure),this.label=r}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}class GraphicalInstantaneousDynamicExpression extends AbstractGraphicalExpression{constructor(e,r,s){super(r,e,s.parentSourceMeasure),this.mInstantaneousDynamicExpression=e,this.mMeasure=s}updateSkyBottomLine(){const e=this.parentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,s=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let o=0;switch(this.Placement){case PlacementEnum.Above:o=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,e.updateSkyLineInRange(r,s,o);break;case PlacementEnum.Below:o=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,e.updateBottomLineInRange(r,s,o);break;default:loglevelExports.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}class GraphicalContinuousDynamicExpression extends AbstractGraphicalExpression{constructor(e,r,s){super(r,e,s),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(e){this.startMeasure=e}get EndMeasure(){return this.endMeasure}set EndMeasure(e){this.endMeasure=e}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(e){this.isSplittedPart=e}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(e){this.notToBeRemoved=e}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var o;const e=this.parentStaffLine.SkyBottomLineCalculator,r=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,s=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsSoftAccent&&!this.IsVerbal&&this.lines.length<2&&loglevelExports.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==ContDynamicEnum.diminuendo&&loglevelExports.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+((o=this.startMeasure)==null?void 0:o.MeasureNumber)),this.Placement){case PlacementEnum.Above:if(this.IsSoftAccent)e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End),e.updateSkyLineWithWedge(this.lines[2].End,this.lines[2].Start),e.updateSkyLineWithLine(this.lines[0].End,this.lines[2].End,this.lines[0].End.y);else if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);else{const a=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(r,s,a)}break;case PlacementEnum.Below:if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);else{const a=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(r,s,a)}break;default:loglevelExports.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(e,r,s,o=this.rules.WedgeOpeningLength,a=this.rules.WedgeLineWidth){const l=new PointF2D(e,s),u=new PointF2D(r,s-o/2),c=new PointF2D(r,s+o/2);this.addWedgeLines(l,u,c,a)}createFirstHalfCrescendoLines(e,r,s,o=this.rules.WedgeMeasureEndOpeningLength,a=this.rules.WedgeLineWidth){const l=new PointF2D(e,s),u=new PointF2D(r,s-o/2),c=new PointF2D(r,s+o/2);this.addWedgeLines(l,u,c,a)}createSecondHalfCrescendoLines(e,r,s,o=this.rules.WedgeMeasureBeginOpeningLength,a=this.rules.WedgeOpeningLength,l=this.rules.WedgeLineWidth){const u=new PointF2D(e,s-o/2),c=new PointF2D(e,s+o/2),d=new PointF2D(r,s-a/2),y=new PointF2D(r,s+a/2);this.addDoubleLines(u,d,c,y,l)}recalculateCrescendoLines(e,r,s){const o=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),o?this.createSecondHalfCrescendoLines(e,r,s):this.isSplittedPart?this.createFirstHalfCrescendoLines(e,r,s):this.createCrescendoLines(e,r,s)}createDiminuendoLines(e,r,s,o=this.rules.WedgeOpeningLength,a=this.rules.WedgeLineWidth){const l=new PointF2D(e,s-o/2),u=new PointF2D(e,s+o/2),c=new PointF2D(r,s);this.addWedgeLines(c,l,u,a)}createFirstHalfDiminuendoLines(e,r,s,o=this.rules.WedgeOpeningLength,a=this.rules.WedgeMeasureEndOpeningLength,l=this.rules.WedgeLineWidth){const u=new PointF2D(e,s-o/2),c=new PointF2D(e,s+o/2),d=new PointF2D(r,s-a/2),y=new PointF2D(r,s+a/2);this.addDoubleLines(u,d,c,y,l)}createSecondHalfDiminuendoLines(e,r,s,o=this.rules.WedgeMeasureBeginOpeningLength,a=this.rules.WedgeLineWidth){const l=new PointF2D(e,s-o/2),u=new PointF2D(e,s+o/2),c=new PointF2D(r,s);this.addWedgeLines(c,l,u,a)}recalculateDiminuendoLines(e,r,s){const o=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),o?this.createFirstHalfDiminuendoLines(e,r,s):this.isSplittedPart?this.createSecondHalfDiminuendoLines(e,r,s):this.createDiminuendoLines(e,r,s)}createFirstHalfLines(e,r,s,o=this.rules.WedgeOpeningLength,a=this.rules.WedgeMeasureEndOpeningLength,l=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?this.createFirstHalfCrescendoLines(e,r,s,a,l):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&this.createFirstHalfDiminuendoLines(e,r,s,o,a,l)}createSecondHalfLines(e,r,s,o=this.rules.WedgeMeasureBeginOpeningLength,a=this.rules.WedgeOpeningLength,l=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?this.createSecondHalfCrescendoLines(e,r,s,o,a,l):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&this.createSecondHalfDiminuendoLines(e,r,s,o,l)}createLines(e,r,s,o=this.rules.WedgeOpeningLength,a=this.rules.WedgeLineWidth){this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?this.createCrescendoLines(e,r,s,o,a):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&this.createDiminuendoLines(e,r,s,o,a)}calcPsi(){if(this.IsVerbal){this.PositionAndShape.calculateBoundingBox();return}this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.IsSoftAccent?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[3].Start.x-this.lines[0].Start.x):this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0)}cleanUp(){this.lines.clear()}shiftYPosition(e){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=e,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=e,this.lines[0].End.y+=e,this.lines[1].End.y+=e)}squeeze(e){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e):e<0?this.lines[0].Start.x+=e:(this.lines[0].End.x+=e,this.lines[1].End.x+=e),this.calcPsi())}addWedgeLines(e,r,s,o){const a=new GraphicalLine(e,r,o),l=new GraphicalLine(e,s,o);this.rules.DefaultColorMusic&&(a.colorHex=this.rules.DefaultColorMusic,l.colorHex=this.rules.DefaultColorMusic),this.lines.push(a),this.lines.push(l)}addDoubleLines(e,r,s,o,a){const l=new GraphicalLine(e,r,a),u=new GraphicalLine(s,o,a);this.rules.DefaultColorMusic&&(l.colorHex=this.rules.DefaultColorMusic,u.colorHex=this.rules.DefaultColorMusic),this.lines.push(l),this.lines.push(u)}}class DrawingParameters{constructor(e=DrawingParametersEnum.default,r){this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCopyright=!1,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=PlacementEnum.Left,this.drawHiddenNotes=!1,this.rules=r,this.rules||(this.rules=new EngravingRules),this.DrawingParametersEnum=e}set DrawingParametersEnum(e){switch(this.drawingParametersEnum=e,e){case DrawingParametersEnum.allon:this.setForAllOn();break;case DrawingParametersEnum.thumbnail:this.setForThumbnail();break;case DrawingParametersEnum.leadsheet:this.setForLeadsheet();break;case DrawingParametersEnum.compact:this.setForCompactMode();break;case DrawingParametersEnum.compacttight:this.setForCompactTightMode();break;case DrawingParametersEnum.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(e){this.drawCredits=e,this.DrawComposer=e,this.DrawTitle=e,this.DrawSubtitle=e,this.DrawLyricist=e,this.DrawCopyright=e}get DrawTitle(){return this.drawTitle}set DrawTitle(e){this.drawTitle=e,this.rules.RenderTitle=e,e||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(e){this.drawSubtitle=e,this.rules.RenderSubtitle=e,e&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(e){this.drawComposer=e,this.rules.RenderComposer=e}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(e){this.drawLyricist=e,this.rules.RenderLyricist=e}get DrawCopyright(){return this.drawCopyright}set DrawCopyright(e){this.drawCopyright=e,this.rules.RenderCopyright=e}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(e){this.drawPartNames=e,this.rules.RenderPartNames=e,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(e){this.fingeringPosition=e,this.rules.FingeringPosition=e}get Rules(){return this.rules}set Rules(e){this.rules=e}}class GraphicalUnknownExpression extends AbstractGraphicalExpression{constructor(e,r,s,o,a=void 0){super(e,new AbstractExpression(s),o),this.label=r,this.sourceMultiExpression=a}updateSkyBottomLine(){const e=this.parentStaffLine.SkyBottomLineCalculator,r=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,s=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case PlacementEnum.Above:const o=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(r,s,o);break;case PlacementEnum.Below:const a=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(r,s,a);break;default:loglevelExports.error("Placement for GraphicalUnknownExpression is unknown")}}}const VF$c=Vex.Flow;class VexFlowBackend{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let e=this.canvas;return this.getVexflowBackendType()===VF$c.Renderer.Backends.CANVAS&&(e=this.inner),e}getRenderer(){return this.renderer}removeAllChildrenFromContainer(e){for(;e.children.length!==0;)e.removeChild(e.children.item(0))}removeFromContainer(e){const r=this.getRenderElement();for(let s=0;sa.y)),s=Math.min(...e.map(a=>a.y));if(r-s>100){const a=r-100;e.forEach(l=>{r-l.y>100&&(l.y=a)})}console.log("连音线-弧度",e);const o=this.ctx.openGroup("curve");return this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),this.ctx.lineTo(e[7].x,e[7].y),this.ctx.bezierCurveTo(e[6].x,e[6].y,e[5].x,e[5].y,e[4].x,e[4].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.closePath(),this.ctx.fill(),this.ctx.closeGroup(),o}renderPath(e,r=!0,s){const o=this.ctx.openGroup("path",s);this.ctx.beginPath();let a;for(const l of e){if(!a){this.ctx.moveTo(l.x,l.y),a=l;continue}this.ctx.lineTo(l.x,l.y)}return this.ctx.closePath(),r?this.ctx.fill():this.ctx.stroke(),this.ctx.stroke(),this.ctx.closeGroup(),o}export(){const e=this.ctx.svg.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),s=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);s.replaceChild(e,s.documentElement);const o=new XMLSerializer().serializeToString(s),a=document.createElement("a");a.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(o.replace(/> \r<`)),a.download="opensheetmusicdisplay_download.svg",a.innerHTML=window.location.href+"/download",document.body.appendChild(a)}}const unitInPixels=10;class VexFlowMusicSheetDrawer extends MusicSheetDrawer{constructor(e=new DrawingParameters){super(new VexFlowTextMeasurer(e.Rules),e),this.backends=[],this.zoom=1,this.pageIdx=0,this.getDotId=(r,s)=>s?String(r.Label.PositionAndShape.RelativePosition[s]):String(r.Label.PositionAndShape.RelativePosition.x)+String(r.Label.PositionAndShape.RelativePosition.y),this.hasDot=(r,s,o,a)=>{const l=s||Object.values(a);for(const u of l){if(o)return r.x===u.x&&r.y===u.y;if(r.x===u.x)return!0}return!1}}get Zoom(){return this.zoom}get Backends(){return this.backends}initializeBackendForPage(e){this.backend=this.backends[e.PageNumber-1]}drawSheet(e){var r,s,o;this.rules.DefaultVexFlowNoteFont==="gonville"&&(Vex.Flow.DEFAULT_FONT_STACK=[(r=Vex.Flow.Fonts)==null?void 0:r.Gonville,(s=Vex.Flow.Fonts)==null?void 0:s.Bravura,(o=Vex.Flow.Fonts)==null?void 0:o.Custom]),Vex.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*unitInPixels,Vex.Flow.STEM_WIDTH=this.rules.StemWidth*unitInPixels,Vex.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,Vex.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const a of e.MusicPages){if(a.PageNumber>this.rules.MaxPageToDrawNumber)break;const l=this.backends[this.pageIdx];l.graphicalMusicPage=a,l.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(e)}drawPage(e){e&&(this.backend=this.backends[e.PageNumber-1],super.drawPage(e),this.pageIdx+=1)}clear(){for(const e of this.backends)e.clear()}setZoom(e){this.zoom=e}calculatePixelDistance(e){return e*unitInPixels}drawStaffLine(e){const r=this.backend.getContext().openGroup();r&&r.classList.add("staffline"),super.drawStaffLine(e);const s=e.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(e,s),this.backend.getContext().closeGroup(),this.rules.RenderGlissandi&&this.drawGlissandi(e,s)}drawSlurs(e,r){var o,a,l,u;const s=(o=window.GYM)==null?void 0:o.vfcurveItem;for(let c=0;c(m.index?m.index===c:!0)&&m.MeasureNumberXML==d.staffEntries[d.staffEntries.length-1].parentMeasure.MeasureNumber);y&&(d.bezierEndControlPt.y+=(a=y==null?void 0:y.bezierEndControlPt)!=null&&a.y?y.bezierEndControlPt.y:0,d.bezierEndPt.y+=(l=y==null?void 0:y.bezierEndPt)!=null&&l.y?y.bezierEndPt.y:0,d.bezierStartControlPt.y+=(u=y==null?void 0:y.bezierStartControlPt)!=null&&u.y?y.bezierStartControlPt.y:0)}catch(y){console.log(y)}this.drawSlur(d,r)}}}drawGlissandi(e,r){for(const s of e.GraphicalGlissandi)this.drawGlissando(s,r)}drawGlissando(e,r){if(e.StaffLine.ParentStaff.isTab||e.calculateLine(this.rules),e.Line){const s=new PointF2D(e.Line.Start.x+r.x,e.Line.Start.y),o=new PointF2D(e.Line.End.x+r.x,e.Line.End.y);this.drawLine(s,o,e.Color,e.Width)}else{const s=e.vfTie;if(s){const o=this.backend.getContext();s.setContext(o),s.draw()}}}drawSlur(e,r){const s=[];let o,a,l,u;this.rules.DYMusicScoreType==="jianpu"?((e.placement>0||e.bezierStartPt.y>0)&&(e.bezierStartPt.y=-.8,e.bezierStartControlPt.y=-2.5),o=new PointF2D(e.bezierStartPt.x+r.x,e.bezierStartPt.y+r.y),a=new PointF2D(e.bezierStartControlPt.x+r.x,e.bezierStartControlPt.y+r.y),l=new PointF2D(e.bezierEndControlPt.x+r.x,e.bezierStartControlPt.y+r.y),u=new PointF2D(e.bezierEndPt.x+r.x,e.bezierStartPt.y+r.y)):(o=new PointF2D(e.bezierStartPt.x+r.x,e.bezierStartPt.y+r.y),a=new PointF2D(e.bezierStartControlPt.x+r.x,e.bezierStartControlPt.y+r.y),l=new PointF2D(e.bezierEndControlPt.x+r.x,e.bezierEndControlPt.y+r.y),u=new PointF2D(e.bezierEndPt.x+r.x,e.bezierEndPt.y+r.y)),s.push(this.applyScreenTransformation(o)),s.push(this.applyScreenTransformation(a)),s.push(this.applyScreenTransformation(l)),s.push(this.applyScreenTransformation(u)),e.placement===PlacementEnum.Above?(o.y-=.05,a.y-=.3,l.y-=.3,u.y-=.05):(o.y+=.05,a.y+=.3,l.y+=.3,u.y+=.05),s.push(this.applyScreenTransformation(o)),s.push(this.applyScreenTransformation(a)),s.push(this.applyScreenTransformation(l)),s.push(this.applyScreenTransformation(u)),e.SVGElement=this.backend.renderCurve(s)}drawMeasure(e){e.setAbsoluteCoordinates(e.PositionAndShape.AbsolutePosition.x*unitInPixels,e.PositionAndShape.AbsolutePosition.y*unitInPixels);const r=this.backend.getContext();try{e.draw(r)}catch(o){loglevelExports.warn("VexFlowMusicSheetDrawer.drawMeasure",o)}let s=0;for(const o of e.staffEntries)this.drawStaffEntry(o),s=this.drawBuzzRolls(o,s)}drawBuzzRolls(e,r){var s;for(const o of e.graphicalVoiceEntries)for(const a of o.notes)if((s=a.sourceNote.TremoloInfo)!=null&&s.tremoloUnmeasured){const l=this.rules.TremoloBuzzRollThickness,u=.9,c=.5,d=a;let y,m;const g=d.vfnote[0].getStemDirection();let v;if(this.backend instanceof SvgVexFlowBackend&&(v=d.getStemSVG()),(v==null?void 0:v.getBbox)!==void 0){const T=v.getBBox();y=new PointF2D(T.x/10,T.y/10),m=T.height/10}else m=d.vfnote[0].getStemLength()/10,y=new PointF2D(d.vfnote[0].getStem().x_begin/10,d.vfnote[0].getStem().y_top/10),g===1&&(y.y-=m);let S=y.y+m/3;d.vfnote[0].getBeamCount()>1&&(S=y.y+m/2,g===-1&&(S-=c+.2));const x=y.x-.5,A=S,E=[],w=[new PointF2D(0,-l),new PointF2D(u-l,0),new PointF2D(-u+l,-c),new PointF2D(0,-l),new PointF2D(u,0),new PointF2D(0,l),new PointF2D(-u+l,0),new PointF2D(u-l,c),new PointF2D(0,l),new PointF2D(-u,0)];let _=new PointF2D(x,A);E.push(_);for(const T of w)_=E.last(),E.push(new PointF2D(_.x+T.x,_.y-T.y));this.DrawPath(E,d.ParentMusicPage,!0,`buzzRoll${r}`),r++}return r}drawLine(e,r,s="#000000FF",o=.2){return e=this.applyScreenTransformation(e),r=this.applyScreenTransformation(r),this.backend.renderLine(e,r,s,o*unitInPixels)}DrawOverlayLine(e,r,s,o="#FF0000FF",a=.2,l){if(!s.PageNumber||s.PageNumber>this.backends.length||s.PageNumber<1){console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");return}const u=s.PageNumber-1,c=this.backends[u];return e=this.applyScreenTransformation(e),r=this.applyScreenTransformation(r),l||(l=`overlayLine ${e.x}/${e.y}`),c.renderLine(e,r,o,a*unitInPixels,l)}DrawPath(e,r,s=!0,o){const a=r.PageNumber-1,l=this.backends[a],u=[];for(const c of e)u.push(this.applyScreenTransformation(c));return l.renderPath(u,s,o)}drawSkyLine(e){const r=e.PositionAndShape.AbsolutePosition,s=e.PositionAndShape.Size.width;this.drawSampledLine(e.SkyLine,r,s)}drawBottomLine(e){const r=new PointF2D(e.PositionAndShape.AbsolutePosition.x,e.PositionAndShape.AbsolutePosition.y),s=e.PositionAndShape.Size.width;this.drawSampledLine(e.BottomLine,r,s,"#0000FFFF")}drawSampledLine(e,r,s,o="#FF0000FF"){const a=[];let l=0;for(let c=0;c0){const c=this.rules.SamplingUnit;let d=new PointF2D(u.x,u.y),y=new PointF2D(a[0]/c+u.x,u.y);this.drawLine(d,y,o);let m,g;e[0]>=0&&(m=new PointF2D(a[0]/c+u.x,u.y),g=new PointF2D(a[0]/c+u.x,u.y+e[a[0]]),this.drawLine(m,g,o));for(let v=1;v0)for(const r of e.FingeringEntries)r.SVGNode=this.drawLabel(r,GraphicalLayers.Notes);if(e.graphicalChordContainers!==void 0&&e.graphicalChordContainers.length>0)for(const r of e.graphicalChordContainers){const s=r.GraphicalLabel;s.SVGNode=this.drawLabel(s,GraphicalLayers.Notes)}this.rules.RenderLyrics&&e.LyricsEntries.length>0&&this.drawLyrics(e.LyricsEntries,GraphicalLayers.Notes)}drawLyrics(e,r){e.forEach(s=>{const o=s.GraphicalLabel;o.Label.colorDefault=this.rules.DefaultColorLyrics,o.SVGNode=this.drawLabel(o,r)})}drawInstrumentBrace(e,r){e.draw(this.backend.getContext())}drawGroupBracket(e,r){e.draw(this.backend.getContext())}drawOctaveShifts(e){for(const r of e.OctaveShifts)if(r){const s=r,o=this.backend.getContext(),a=s.getTextBracket();this.rules.DefaultColorMusic&&(a.render_options.color=this.rules.DefaultColorMusic),a.setContext(o);try{a.draw()}catch(l){loglevelExports.warn(l)}}}drawPedals(e){for(const r of e.Pedals)if(r){const s=r,o=this.backend.getContext(),a=s.getPedalMarking();a.render_options.color=this.rules.DefaultColorMusic,a.setContext(o),a.draw()}}drawWavyLines(e){for(const r of e.WavyLines)if(r){const s=r,o=this.backend.getContext(),a=s.getVibratoBracket();a.setContext(o),a.draw()}}getMaxExpressionsYAndDots(e){var c,d;const r=[];let s=0;for(const y of e.measures)r.push(y.measureNumber);const o={},a={},l={};for(const y of e.AbstractExpressions)if(y instanceof GraphicalUnknownExpression&&r.includes(y.parentMeasure.MeasureNumber)){const m=this.getDotId(y),g=this.getDotId(y,"x");a[m]||(a[m]=[]),l[g]||(l[g]=[]),this.hasDot(y.Label.PositionAndShape.RelativePosition,a[m],!0)||(a[m].push(y.Label.PositionAndShape.RelativePosition),l[g].push(y.Label.PositionAndShape.RelativePosition)),o[m]=y.Label.PositionAndShape.RelativePosition}let u=0;for(const y of e.AbstractExpressions){const m=(c=y.parentMeasure)==null?void 0:c.MeasureNumber;if(y instanceof GraphicalUnknownExpression&&r.includes(m)){const g=(d=y.parentMeasure.verticalMeasureList[0])==null?void 0:d.stave,v=(g==null?void 0:g.end_x)-(g==null?void 0:g.x),b=this.getDotId(y,"x");if((l[b]||[]).length===1&&u!==m){const S=y.Label.PositionAndShape.AbsolutePosition.y;s=s===0?S:Math.min(s,S)}(l[b]||[]).length!==1&&v/10Number.EPSILON){let o=Math.min(...e.Lines.map(l=>l.Start.x)),a=Math.min(...e.Lines.map(l=>l.Start.y));e.Lines[0].Start.x=o,e.Lines[1].Start.x=o,e.Lines[0].Start.y=a+this.rules.WedgeOpeningLength/2,e.Lines[1].Start.y=a+this.rules.WedgeOpeningLength*2,e.Lines[0].End.y+=this.rules.WedgeOpeningLength/2,e.Lines[1].End.y+=this.rules.WedgeOpeningLength}}catch(o){}const s=this.backend.getContext();s.openGroup("lineGroup");for(const o of e.Lines){const a=new PointF2D(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+o.Start.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+o.Start.y),l=new PointF2D(e.ParentStaffLine.PositionAndShape.AbsolutePosition.x+o.End.x,e.ParentStaffLine.PositionAndShape.AbsolutePosition.y+o.End.y);this.drawLine(a,l,(r=o.colorHex)!=null?r:"#000000",o.Width)}s.closeGroup()}}renderLabel(e,r,s){return this._renderLabel(e,s)}_renderLabel(e,r){var d,y,m;if(!e.Label.print)return;const s=e.Label.fontHeight*unitInPixels,{font:o}=e.Label;let a;this.rules.ColoringEnabled&&(a=e.Label.colorDefault,e.ColorXML&&(a=e.ColorXML),e.Label.color&&(a=e.Label.color.toString()),a||(a=this.rules.DefaultColorLabel));let{fontStyle:l,fontFamily:u}=e.Label;l||(l=this.rules.DefaultFontStyle),u||(u=this.rules.DefaultFontFamily);let c;for(let g=0;g<((d=e.TextLines)==null?void 0:d.length);g++){const v=e.TextLines[g],b=this.calculatePixelDistance(v.xOffset),S=new PointF2D(r.ScreenPosition.x+b,r.ScreenPosition.y),x=this.backend.renderText(s,l,o,v.text,r.FontHeightInPixel,S,a,e.Label.fontFamily,(y=e.Label)==null?void 0:y.lyricExtendNoteId,(m=e.Label)==null?void 0:m.lyricVerseNumber);c?c.appendChild(x):c=x,r.ScreenPosition.y=r.ScreenPosition.y+r.FontHeightInPixel,e.TextLines.length>1&&(r.ScreenPosition.y+=this.rules.SpacingBetweenTextLines)}return c}renderRectangle(e,r,s,o,a){return this.backend.renderRectangle(e,s,o,a)}applyScreenTransformation(e){return new PointF2D(e.x*unitInPixels,e.y*unitInPixels)}applyScreenTransformationForRect(e){return new RectangleF2D(e.x*unitInPixels,e.y*unitInPixels,e.width*unitInPixels,e.height*unitInPixels)}}class TabNote extends Note$1{constructor(e,r,s,o,a,l,u,c){super(e,r,s,o,a),this.stringNumberTab=l,this.fretNumber=u,this.bendArray=c}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}hasTabEffects(){var e;return((e=this.bendArray)==null?void 0:e.length)>0}}const VF$a=Vex.Flow,_VexFlowConverter=class{static durations(i,e){const r=[],s=i.clone();for(;s.RealValue>1e-4;){const o=s.RealValue;if(o>=2)r.push("1/2"),s.Sub(new Fraction$1(2,1));else if(o>=1)r.push("w"),s.Sub(new Fraction$1(1,1));else if(o<1&&o>=.5){if(e&&o>.5)return["w"];r.push("h"),s.Sub(new Fraction$1(1,2))}else if(o<.5&&o>=.25){if(e&&o>.25)return["h"];r.push("q"),s.Sub(new Fraction$1(1,4))}else if(o<.25&&o>=.125){if(e&&o>.125)return["q"];r.push("8"),s.Sub(new Fraction$1(1,8))}else if(o<.125&&o>=.0625){if(e&&o>.0625)return["8"];r.push("16"),s.Sub(new Fraction$1(1,16))}else if(o<.0625&&o>=.03125){if(e&&o>.03125)return["16"];r.push("32"),s.Sub(new Fraction$1(1,32))}else if(o<.03125&&o>=.015625){if(e&&o>.015625)return["32"];r.push("64"),s.Sub(new Fraction$1(1,64))}else{if(e)return["64"];r.push("128"),s.Sub(new Fraction$1(1,128))}}return r}static pitch(i,e,r,s=void 0,o=void 0){let a=o;o===void 0&&(a=3),e&&o===void 0&&(a=0,r.ClefType===ClefEnum.F&&(a=2),r.ClefType===ClefEnum.C&&(a=2));const l=NoteEnum[i.FundamentalNote].toLowerCase(),u=Pitch.accidentalVexflow(i.Accidental),c=i.Octave-r.OctaveOffset+a;let d="";return s&&(d=this.NoteHeadCode(s)),[l+"n/"+c+d,u,r]}static restToNotePitch(i,e){let r=i.Octave;switch(e){case ClefEnum.C:case ClefEnum.F:{r+=2;break}case ClefEnum.G:}return new Pitch(i.FundamentalNote,r,AccidentalEnum.NONE)}static NoteHeadCode(i){const e="/",r=i.Filled?"2":"1";switch(i.Shape){case NoteHeadShape.NORMAL:return"";case NoteHeadShape.DIAMOND:return e+"D"+r;case NoteHeadShape.TRIANGLE:return e+"T"+r;case NoteHeadShape.TRIANGLE_INVERTED:return e+"TI";case NoteHeadShape.X:return e+"X"+r;case NoteHeadShape.CIRCLEX:return e+"X3";case NoteHeadShape.RECTANGLE:return e+"R"+r;case NoteHeadShape.SQUARE:return e+"S"+r;case NoteHeadShape.SLASH:return"";default:return""}}static GhostNotes(i){const e=[],r=_VexFlowConverter.durations(i,!1);for(const s of r)e.push(new VF$a.GhostNote({duration:s}));return e}static StaveNote(i){var C,P,k,M,R,H,B,F,I,U,D,$,N,O,Q,z,W,xe,ye;i.sortForVexflow();const e=i.notes,r=i.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,s=e[0];let o=[],a;const l=[],u=s.graphicalNoteLength,c=s.sourceNote.NoteTuplet!==void 0;let d=_VexFlowConverter.durations(u,c)[0];_VexFlowConverter.idx+=1,s.sourceNote.TypeLength!==void 0&&s.sourceNote.TypeLength!==u&&s.sourceNote.TypeLength.RealValue!==0&&(d=_VexFlowConverter.durations(s.sourceNote.TypeLength,c)[0],s.numberOfDots=s.sourceNote.DotsXml);let y,m=s.numberOfDots,g=!1,v=0,b=!1,S;for(const q of e){if(m=1&&Be.length-1>=se+1&&(Ie=(R=(M=Be[se-1])==null?void 0:M.graphicalVoiceEntries[0])==null?void 0:R.parentVoiceEntry,J=(B=(H=Be[se+1])==null?void 0:H.graphicalVoiceEntries[0])==null?void 0:B.parentVoiceEntry,Ie&&J)){const V=Ie.Notes[0],pe=J.Notes[0];if((F=V.NoteBeam)!=null&&F.Notes.includes(pe)&&pe.ParentStaffEntry.ParentStaff.StafflineCount!==1){const ce=Ie.Notes.last().Pitch,K=q.Clef(),Z=_VexFlowConverter.pitch(_VexFlowConverter.restToNotePitch(ce.getTransposedPitch(-2),K.ClefType),!1,K);ce.FundamentalNote===4&&(o=[Z[0]])}}}}if((q.sourceNote.IsWholeMeasureRest||u.RealValue===q.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue)&&(o=r.DYMusicScoreType==="staff"?["d/5"]:["R/5"],d="w",m=0,g=!0,v=r.WholeRestXShiftVexflow*unitInPixels),[...q.sourceNote.ParentStaff.Voices].filter(Se=>(Se==null?void 0:Se.VoiceId)!=1).length){const Se=q.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,Be=q.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let Ie,J;for(const se of Se)for(const V of se.notes){if(V===q||V.sourceNote.isRest()||!V.sourceNote.PrintObject){q.lineShift=-2;continue}const pe=V.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,ce=Be===1||Be===5,K=ce?1:-1,he=V.sourceNote.Pitch.getHalfTone(),Ce=K===1&&he>Ie,Ae=K===-1&&he0){let se=3;const V=q.Clef();switch(V.ClefType){case ClefEnum.F:se=5;break;case ClefEnum.C:se=4;break}S=Pitch.fromHalftone(Ie),o=[_VexFlowConverter.pitch(S,!0,V,void 0,se)[0]]}}break}q.sourceNote.Notehead&&(q.sourceNote.Notehead.Shape,NoteHeadShape.SLASH);const re=q.vfpitch;if((U=(I=re[2])==null?void 0:I.Parent)!=null&&U.Instructions)for(let ue=0,ge=re[2].Parent.Instructions.length;ue0&&r.RenderLyrics&&r.LyricsUseXPaddingForLongLyrics){const ge=i.parentStaffEntry.parentMeasure,Se=ge.staffEntries.indexOf(i.parentStaffEntry),Be=[];for(let se=Se+1;se.25){re=!1;break}if(se.LyricsEntries.length>0)break;const pe=Fraction$1.minus(V,J);ue+=pe.RealValue*32,J=V}}if(r.RenderLyrics&&r.LyricsUseXPaddingForLongLyrics&&q.length>0&&re){let ge=!1,Se=0;for(const Ie of e)if(Ie.sourceNote.Length.RealValue<=.125){ge=!0;break}let Be=!1;for(const Ie of q){const J=r.LyricsXPaddingWidthThreshold;let se=Ie.GraphicalLabel.PositionAndShape.Size.width;if(Ie.hasDashFromLyricWord()&&(se+=.5),se>J){Se+=se-J;const V=i.parentStaffEntry,pe=V.parentMeasure.staffEntries,K=pe.indexOf(V)===pe.length-1;K&&(ue+=r.LyricsXPaddingReductionForLastNoteInMeasure),ge||(ue+=r.LyricsXPaddingReductionForLongNotes),(r.LyricsXPaddingForLastNoteInMeasure||!K)&&se>J+ue&&(Be=!0,Se-=ue);break}}Be&&(x.paddingRight=10*r.LyricsXPaddingFactorForLongLyrics*Se)}}const w=i.notes[0].lineShift;if(w!==0&&(x.getKeyProps()[0].line+=w),e.length>1)for(let q=0;q1&&i.notes[0].sourceNote.ParentVoiceEntry.ParentVoice.VoiceId==1&&(x.getKeyProps()[0].line=4.5);const T=(z=window.GYM)==null?void 0:z.customBassDrum;if(T&&x.isRest()&&(x.getDuration()==="q"&&(x.getKeyProps()[0].line=T),x.getDuration()==="h"&&(x.getKeyProps()[0].line=T-1)),x.getKeyProps().forEach(({line:q},re)=>i.notes[re].staffLine=q),(r.LedgerLineWidth||r.LedgerLineStrokeStyle)&&(x.ledgerLineStyle||(x.ledgerLineStyle={}),r.LedgerLineWidth&&(x.ledgerLineStyle.lineWidth=r.LedgerLineWidth),r.LedgerLineStrokeStyle&&(x.ledgerLineStyle.strokeStyle=r.LedgerLineStrokeStyle)),r.ColoringEnabled){const q=r.DefaultColorStem;let re=i.parentVoiceEntry.StemColor;!re&&q&&(re=q);const ue={fillStyle:re,strokeStyle:re};re&&(x.setStemStyle(ue),x.flag&&r.ColorFlags&&x.setFlagStyle(ue))}if(x.x_shift=v,i.parentVoiceEntry.IsGrace&&i.notes[0].sourceNote.NoteBeam&&(i.parentVoiceEntry.WantedStemDirection=i.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),i.parentVoiceEntry){let q=i.parentVoiceEntry.WantedStemDirection;const re=((W=window.GYM)==null?void 0:W.stemDirectionNote)||[],ue=re==null?void 0:re.find(ge=>ge.id===i.notes[0].sourceNote.NoteToGraphicalNoteObjectId);switch(ue&&typeof(ue==null?void 0:ue.direction)=="number"&&(q=ue.direction),q){case StemDirectionType.Up:x.setStemDirection(VF$a.Stem.UP),i.parentVoiceEntry.StemDirection=StemDirectionType.Up;break;case StemDirectionType.Down:x.setStemDirection(VF$a.Stem.DOWN),i.parentVoiceEntry.StemDirection=StemDirectionType.Down;break}}for(let q=0,re=e.length;q0&&ge==="single"){const Se=new VF$a.Tremolo(ue);Se.extra_stroke_scale=r.TremoloStrokeScale,Se.y_spacing_scale=r.TremoloYSpacingScale,x&&x.duration==="w"&&x.stem.setExtension(-9),x.addModifier(q,Se)}if(ue>0&&ge==="start"&&this.noteTremoloList.push(x),ue>0&&ge==="stop"){if(this.noteTremoloList.push(x),this.noteTremoloList.filter(Ie=>Ie.duration==="w").length===this.noteTremoloList.length)try{this.noteTremoloList[0].keyProps&&this.noteTremoloList[1].keyProps&&((xe=(this.noteTremoloList[0].keyProps[0].line>this.noteTremoloList[1].keyProps[0].line?this.noteTremoloList[1]:this.noteTremoloList[0]).stem)==null||xe.setResetHeight(30))}catch(Ie){console.error("设置都是全音符,stem的高度失败")}const Be=new VF$a.Tremolo(ue,[...this.noteTremoloList]);Be.extra_stroke_scale=1.2,Be.y_spacing_scale=1.2,Be.x_shift=-30,x.addModifier(q,Be),this.noteTremoloList=[]}this.glissandoList.length&&(x.setVibrato(this.glissandoList[0].vfnote[0]),this.glissandoList=[]),e[q].sourceNote.glissandoType==="start"&&this.glissandoList.push(e[q])}if(this.slideNote){try{x.setSlideNote(this.slideNote)}catch(q){console.error(q)}this.slideNote=null}if(i.notes[0].sourceNote.slideType==="start"&&(this.slideNote=x),E.Length.RealValue===.25&&E.Notehead&&E.Notehead.Filled===!1){const q=x.getKeyProps();for(let re=0;re1){let q=x.getKeyProps().filter(ue=>!ue.code&&ue.line>3);!((ye=window.GYM)==null?void 0:ye.stemDirectionNote)&&q.length===o.length&&x.setStemDirection(-1)}r.DYMusicScoreType==="jianpu"&&window&&window.sett&&window.sett.keySignature&&x.addAccidental(0,new VF$a.Accidental("#"));try{const q=["b","#","§","º","X"],re={b:"b","#":"#","§":"n",º:"bb",X:"##"};for(const ue of e){const ge=ue.sourceNote.voiceEntry.Timestamp;for(const Se of ue.sourceNote.SourceMeasure.StaffLinkedExpressions)for(const Be of Se){const Ie=Fraction$1.Equal(ge,Be.Timestamp),se=Be.EntriesList.map(V=>V.label).filter(V=>q.includes(V)).map(V=>re[V]);if(Ie){for(const V of se)V&&x.addAnnotation(0,new VF$a.Annotation(V));break}}}}catch(q){}return x}static generateArticulations(i,e,r){var s,o,a,l,u,c;if(!(!i||i.getAttribute("type")==="GhostNote"))for(const d of e.sourceNote.ParentVoiceEntry.Articulations){let y=VF$a.Modifier.Position.ABOVE;i.getStemDirection()===VF$a.Stem.UP&&(y=VF$a.Modifier.Position.BELOW);let m;const g=d.articulationEnum;switch(r.ArticulationPlacementFromXML&&(d.placement===PlacementEnum.Above?y=VF$a.Modifier.Position.ABOVE:d.placement===PlacementEnum.Below&&(y=VF$a.Modifier.Position.BELOW)),g){case ArticulationEnum.accent:{m=new VF$a.Articulation("a>");const v=e.sourceNote.NoteSlurs;for(const b of v)b.StartNote===e.sourceNote&&(b.PlacementXml===PlacementEnum.Above?m.setYShift(-r.SlurStartArticulationYOffsetOfArticulation*10):b.PlacementXml===PlacementEnum.Below&&m.setYShift(r.SlurStartArticulationYOffsetOfArticulation*10));break}case ArticulationEnum.breathmark:{m=new VF$a.Articulation("abr"),d.placement===PlacementEnum.Above&&(y=VF$a.Modifier.Position.ABOVE),m.breathMarkDistance=r.BreathMarkDistance;break}case ArticulationEnum.downbow:{m=new VF$a.Articulation("am"),d.placement===void 0&&(y=VF$a.Modifier.Position.ABOVE,d.placement=PlacementEnum.Above);break}case ArticulationEnum.fermata:{m=new VF$a.Articulation("a@a"),y=VF$a.Modifier.Position.ABOVE,d.placement=PlacementEnum.Above;break}case ArticulationEnum.marcatodown:{m=new VF$a.Articulation("a|");break}case ArticulationEnum.marcatoup:{m=new VF$a.Articulation("a^"),y=VF$a.Modifier.Position.ABOVE;break}case ArticulationEnum.invertedfermata:{const v=e.sourceNote.ParentVoiceEntry,b=e.sourceNote;if(v!==b.ParentVoiceEntry.ParentSourceStaffEntry.VoiceEntries.last()){v.Articulations=v.Articulations.slice(v.Articulations.indexOf(d)),v.ParentSourceStaffEntry.VoiceEntries.last().Articulations.push(d);continue}m=new VF$a.Articulation("a@u"),y=VF$a.Modifier.Position.BELOW,d.placement=PlacementEnum.Below;break}case ArticulationEnum.lefthandpizzicato:{m=new VF$a.Articulation("a+");break}case ArticulationEnum.naturalharmonic:{m=new VF$a.Articulation("ah");break}case ArticulationEnum.snappizzicato:{m=new VF$a.Articulation("ao");break}case ArticulationEnum.staccatissimo:{m=new VF$a.Articulation("av");break}case ArticulationEnum.staccato:{m=new VF$a.Articulation("a.");break}case ArticulationEnum.tenuto:{m=new VF$a.Articulation("a-");break}case ArticulationEnum.upbow:{m=new VF$a.Articulation("a|"),d.placement===void 0&&(y=VF$a.Modifier.Position.ABOVE,d.placement=PlacementEnum.Above);break}case ArticulationEnum.strongaccent:{m=new VF$a.Articulation("a^");break}}m&&(!i.hasStem()&&!i.isRest()&&g==ArticulationEnum.accent&&i.getLineNumber()>=3&&(y=VF$a.Modifier.Position.ABOVE,(o=(s=i==null?void 0:i.modifiers)==null?void 0:s.filter(S=>["TREMOLO"].includes(S.getCategory().toLocaleUpperCase())))!=null&&o.length&&m.setYShift(-16)),g===ArticulationEnum.strongaccent&&(y=VF$a.Modifier.Position.ABOVE,(a=window.GYM)!=null&&a.customArtPosition&&(i.getStemDirection()===1?y=VF$a.Modifier.Position.ABOVE:(y=VF$a.Modifier.Position.BELOW,m=new VF$a.Articulation("a|")))),(l=window.GYM)!=null&&l.customAccentItem&&g===ArticulationEnum.accent&&(y=VF$a.Modifier.Position.ABOVE),(u=window.GYM)!=null&&u.customLefthandpizzicatoItem&&(g===ArticulationEnum.lefthandpizzicato||g===ArticulationEnum.naturalharmonic)&&(y=VF$a.Modifier.Position.ABOVE),g===ArticulationEnum.tenuto&&i.getDuration()==="w"&&((c=window.GYM)!=null&&c.customTenutoItem)&&(y=VF$a.Modifier.Position.ABOVE),m.setPosition(y),i.addModifier(0,m))}}static generateOrnaments(i,e){let r=VF$a.Modifier.Position.ABOVE;e.placement===PlacementEnum.Below&&(r=VF$a.Modifier.Position.BELOW);let s;switch(e.GetOrnament){case OrnamentEnum.DelayedInvertedTurn:{s=new VF$a.Ornament("turn_inverted"),s.setDelayed(!0);break}case OrnamentEnum.DelayedTurn:{s=new VF$a.Ornament("turn"),s.setDelayed(!0);break}case OrnamentEnum.InvertedMordent:{s=new VF$a.Ornament("mordent"),s.setDelayed(!1);break}case OrnamentEnum.InvertedTurn:{s=new VF$a.Ornament("turn_inverted"),s.setDelayed(!1);break}case OrnamentEnum.Mordent:{s=new VF$a.Ornament("mordent_inverted"),s.setDelayed(!1);break}case OrnamentEnum.Trill:{s=new VF$a.Ornament("tr"),s.setDelayed(!1);break}case OrnamentEnum.Turn:{s=new VF$a.Ornament("turn"),s.setDelayed(!1);break}default:{loglevelExports.warn("unhandled OrnamentEnum type: "+e.GetOrnament);return}}s&&(e.AccidentalBelow!==AccidentalEnum.NONE&&s.setLowerAccidental(Pitch.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==AccidentalEnum.NONE&&s.setUpperAccidental(Pitch.accidentalVexflow(e.AccidentalAbove)),s.setPosition(r),i.addModifier(0,s))}static StrokeTypeFromArpeggioType(i){switch(i){case ArpeggioType.ARPEGGIO_DIRECTIONLESS:return VF$a.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case ArpeggioType.BRUSH_DOWN:return VF$a.Stroke.Type.BRUSH_UP;case ArpeggioType.BRUSH_UP:return VF$a.Stroke.Type.BRUSH_DOWN;case ArpeggioType.RASQUEDO_DOWN:return VF$a.Stroke.Type.RASQUEDO_UP;case ArpeggioType.RASQUEDO_UP:return VF$a.Stroke.Type.RASQUEDO_DOWN;case ArpeggioType.ROLL_DOWN:return VF$a.Stroke.Type.ROLL_UP;case ArpeggioType.ROLL_UP:return VF$a.Stroke.Type.ROLL_DOWN;default:return VF$a.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(i){const e=[],r=i.notes.reverse(),s=[],o=i.notes[0].graphicalNoteLength,a=i.notes[0].sourceNote.NoteTuplet!==void 0;let l=_VexFlowConverter.durations(o,a)[0],u=0;for(const d of i.notes){const y=d.sourceNote;let m={str:y.StringNumberTab,fret:y.FretNumber};d.sourceNote instanceof TabNote||(loglevelExports.info(`invalid tab note: ${d.sourceNote.Pitch.ToString()} in measure ${i.parentStaffEntry.parentMeasure.MeasureNumber}, likely missing XML string+fret number.`),m={str:1,fret:0}),e.push(m),y.BendArray&&y.BendArray.forEach(function(g){let v;const b=g.bendalter-m.fret;b>1?v="Full":b===1?v="1/2":v="1/4",g.direction==="up"?s.push({type:VF$a.Bend.UP,text:v,width:10}):s.push({type:VF$a.Bend.DOWN,text:v,width:10})}),u(i[i.VA8=0]="VA8",i[i.VB8=1]="VB8",i[i.MA15=2]="MA15",i[i.MB15=3]="MB15",i[i.NONE=4]="NONE",i))(OctaveEnum||{});class AbstractTempoExpression extends AbstractExpression{constructor(e,r,s,o){super(r),this.label=e,this.staffNumber=s,this.parentMultiTempoExpression=o}get Label(){return this.label}set Label(e){this.label=e}get Placement(){return this.placement}set Placement(e){this.placement=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(e,r){for(const s of e)if(AbstractTempoExpression.stringContainsSeparatedWord(r.toLowerCase().trim(),s.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(e,r){return e===r||e.indexOf(" "+r)!==-1||e.indexOf(r+" ")!==-1}}const _InstantaneousTempoExpression=class extends AbstractTempoExpression{constructor(i,e,r,s,o,a=!1){super(i,e,r,o),this.isMetronomeMark=a,this.setTempoAndTempoType(s)}static getDefaultValueForTempoType(i){switch(i){case 1:return 20;case 2:return 30;case 3:return 48;case 4:return 52;case 5:return 63;case 6:return 70;case 7:return 75;case 8:return 88;case 9:return 92;case 10:return 96;case 11:return 106;case 12:return 112;case 13:return 118;case 14:return 130;case 15:return 140;case 16:return 155;case 17:return 170;case 18:return 184;case 19:return 200;default:throw new ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(i){return i?_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghissimo,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoGrave,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLento,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLargo,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghetto,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagio,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagietto,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndante,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndantino,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoModerato,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegretto,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegro,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivace,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivacissimo,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPresto,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPrestissimo,i)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral,i):!1}get Label(){return this.label}set Label(i){this.label=i}get Placement(){return this.placement}set Placement(i){this.placement=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(i){this.tempoInBpm=i}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(i){if(!this.label){this.tempoInBpm=i,this.tempoEnum=23;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghissimo,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(1)),this.tempoInBpm=i,this.tempoEnum=1;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoGrave,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(2)),this.tempoInBpm=i,this.tempoEnum=2;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLento,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(3)),this.tempoInBpm=i,this.tempoEnum=3;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLargo,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(4)),this.tempoInBpm=i,this.tempoEnum=4;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghetto,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(5)),this.tempoInBpm=i,this.tempoEnum=5;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagio,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(6)),this.tempoInBpm=i,this.tempoEnum=6;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagietto,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(7)),this.tempoInBpm=i,this.tempoEnum=7;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(8)),this.tempoInBpm=i,this.tempoEnum=8;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndante,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(9)),this.tempoInBpm=i,this.tempoEnum=9;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndantino,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(10)),this.tempoInBpm=i,this.tempoEnum=10;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoModerato,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(11)),this.tempoInBpm=i,this.tempoEnum=11;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegretto,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(12)),this.tempoInBpm=i,this.tempoEnum=12;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(13)),this.tempoInBpm=i,this.tempoEnum=13;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegro,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(14)),this.tempoInBpm=i,this.tempoEnum=14;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivace,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(15)),this.tempoInBpm=i,this.tempoEnum=15;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivacissimo,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(16)),this.tempoInBpm=i,this.tempoEnum=16;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(17)),this.tempoInBpm=i,this.tempoEnum=17;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPresto,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(18)),this.tempoInBpm=i,this.tempoEnum=18;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPrestissimo,this.label)){i===0&&(i=_InstantaneousTempoExpression.getDefaultValueForTempoType(19)),this.tempoInBpm=i,this.tempoEnum=19;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAddons,this.label)){this.tempoInBpm=0,this.tempoEnum=21;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral,this.label)){this.tempoInBpm=0,this.tempoEnum=22;return}}};let InstantaneousTempoExpression=_InstantaneousTempoExpression;InstantaneousTempoExpression.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"];InstantaneousTempoExpression.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"];InstantaneousTempoExpression.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"];InstantaneousTempoExpression.listInstantaneousTempoLargo=["Largo","Breit","broadly"];InstantaneousTempoExpression.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"];InstantaneousTempoExpression.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"];InstantaneousTempoExpression.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"];InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato=["Andante moderato"];InstantaneousTempoExpression.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"];InstantaneousTempoExpression.listInstantaneousTempoAndantino=["Andantino","Maestoso"];InstantaneousTempoExpression.listInstantaneousTempoModerato=["Moderato","Mäßig","Modéré","moderately"];InstantaneousTempoExpression.listInstantaneousTempoAllegretto=["Allegretto","Animato","fast"];InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato=["Allegro moderato"];InstantaneousTempoExpression.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fröhlich"];InstantaneousTempoExpression.listInstantaneousTempoVivace=["Vivace","Allegro Assai","Lebhaft","Lebendig","lively and fast"];InstantaneousTempoExpression.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"];InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"];InstantaneousTempoExpression.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"];InstantaneousTempoExpression.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"];InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento","rallentando","ritardando","ritard.","rit.","ritard","rall...","accelerando","accel"];InstantaneousTempoExpression.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"];var TempoEnum=(i=>(i[i.none=0]="none",i[i.larghissimo=1]="larghissimo",i[i.grave=2]="grave",i[i.lento=3]="lento",i[i.largo=4]="largo",i[i.larghetto=5]="larghetto",i[i.adagio=6]="adagio",i[i.adagietto=7]="adagietto",i[i.andanteModerato=8]="andanteModerato",i[i.andante=9]="andante",i[i.andantino=10]="andantino",i[i.moderato=11]="moderato",i[i.allegretto=12]="allegretto",i[i.allegroModerato=13]="allegroModerato",i[i.allegro=14]="allegro",i[i.vivace=15]="vivace",i[i.vivacissimo=16]="vivacissimo",i[i.allegrissimo=17]="allegrissimo",i[i.presto=18]="presto",i[i.prestissimo=19]="prestissimo",i[i.lastRealTempo=20]="lastRealTempo",i[i.addon=21]="addon",i[i.changes=22]="changes",i[i.metronomeMark=23]="metronomeMark",i))(TempoEnum||{});const _MoodExpression=class extends AbstractExpression{constructor(i,e,r){super(e),this.label=i,this.staffNumber=r,this.setMoodType()}static isInputStringMood(i){return i?_MoodExpression.isStringInStringList(_MoodExpression.listMoodAffettuoso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAgitato,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAnimato,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAppassionato,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodBrillante,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodCantabile,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodDolce,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEnergico,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEroico,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEspressivo,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodFurioso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGiocoso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGioioso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrandioso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrazioso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodLacrimoso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodLeggiero,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMaestoso,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMalinconico,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarcato,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarziale,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMesto,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMorendo,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodNobilmente,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodPatetico,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodPesante,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSaltando,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSautille,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodScherzando,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSostenuto,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSpiccato,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTenerezza,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTranquillamente,i)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTrionfante,i):!1}get Label(){return this.label}set Label(i){this.label=i}get Mood(){return this.moodType}set Mood(i){this.moodType=i}get StaffNumber(){return this.staffNumber}set StaffNumber(i){this.staffNumber=i}get Placement(){return this.placement}set Placement(i){this.placement=i}setMoodType(){_MoodExpression.isStringInStringList(_MoodExpression.listMoodAffettuoso,this.label)?this.moodType=0:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAgitato,this.label)?this.moodType=1:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAnimato,this.label)?this.moodType=3:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAppassionato,this.label)?this.moodType=2:_MoodExpression.isStringInStringList(_MoodExpression.listMoodBrillante,this.label)?this.moodType=4:_MoodExpression.isStringInStringList(_MoodExpression.listMoodCantabile,this.label)?this.moodType=5:_MoodExpression.isStringInStringList(_MoodExpression.listMoodDolce,this.label)?this.moodType=6:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEnergico,this.label)?this.moodType=7:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEroico,this.label)?this.moodType=8:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEspressivo,this.label)?this.moodType=9:_MoodExpression.isStringInStringList(_MoodExpression.listMoodFurioso,this.label)?this.moodType=10:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGiocoso,this.label)?this.moodType=11:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGioioso,this.label)?this.moodType=12:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrandioso,this.label)?this.moodType=14:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrazioso,this.label)?this.moodType=15:_MoodExpression.isStringInStringList(_MoodExpression.listMoodLacrimoso,this.label)?this.moodType=13:_MoodExpression.isStringInStringList(_MoodExpression.listMoodLeggiero,this.label)?this.moodType=16:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMaestoso,this.label)?this.moodType=17:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMalinconico,this.label)?this.moodType=18:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarcato,this.label)?this.moodType=19:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarziale,this.label)?this.moodType=20:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMesto,this.label)?this.moodType=21:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMorendo,this.label)?this.moodType=22:_MoodExpression.isStringInStringList(_MoodExpression.listMoodNobilmente,this.label)?this.moodType=23:_MoodExpression.isStringInStringList(_MoodExpression.listMoodPatetico,this.label)?this.moodType=24:_MoodExpression.isStringInStringList(_MoodExpression.listMoodPesante,this.label)?this.moodType=25:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSaltando,this.label)?this.moodType=27:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSautille,this.label)?this.moodType=26:_MoodExpression.isStringInStringList(_MoodExpression.listMoodScherzando,this.label)?this.moodType=28:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSostenuto,this.label)?this.moodType=29:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSpiccato,this.label)?this.moodType=30:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTenerezza,this.label)?this.moodType=31:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTranquillamente,this.label)?this.moodType=32:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTrionfante,this.label)&&(this.moodType=33)}};let MoodExpression=_MoodExpression;MoodExpression.listMoodAffettuoso=["affettuoso"];MoodExpression.listMoodAgitato=["agitato"];MoodExpression.listMoodAppassionato=["appassionato"];MoodExpression.listMoodAnimato=["animato","lively"];MoodExpression.listMoodBrillante=["brillante"];MoodExpression.listMoodCantabile=["cantabile"];MoodExpression.listMoodDolce=["dolce"];MoodExpression.listMoodEnergico=["energico"];MoodExpression.listMoodEroico=["eroico"];MoodExpression.listMoodEspressivo=["espressivo"];MoodExpression.listMoodFurioso=["furioso"];MoodExpression.listMoodGiocoso=["giocoso"];MoodExpression.listMoodGioioso=["gioioso"];MoodExpression.listMoodLacrimoso=["lacrimoso"];MoodExpression.listMoodGrandioso=["grandioso"];MoodExpression.listMoodGrazioso=["grazioso"];MoodExpression.listMoodLeggiero=["leggiero"];MoodExpression.listMoodMaestoso=["maestoso"];MoodExpression.listMoodMalinconico=["malinconico"];MoodExpression.listMoodMarcato=["marcato"];MoodExpression.listMoodMarziale=["marziale"];MoodExpression.listMoodMesto=["mesto"];MoodExpression.listMoodMorendo=["morendo"];MoodExpression.listMoodNobilmente=["nobilmente"];MoodExpression.listMoodPatetico=["patetico"];MoodExpression.listMoodPesante=["pesante"];MoodExpression.listMoodSautille=["sautille"];MoodExpression.listMoodSaltando=["saltando"];MoodExpression.listMoodScherzando=["scherzando"];MoodExpression.listMoodSostenuto=["sostenuto"];MoodExpression.listMoodSpiccato=["spiccato"];MoodExpression.listMoodTenerezza=["tenerezza"];MoodExpression.listMoodTranquillamente=["tranquillamente"];MoodExpression.listMoodTrionfante=["trionfante"];class UnknownExpression extends AbstractExpression{constructor(e,r,s,o){super(r),this.label=e,this.staffNumber=o,s===void 0&&(s=TextAlignmentEnum.LeftBottom),this.textAlignment=s}get Label(){return this.label}get Placement(){return this.placement}set Placement(e){this.placement=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get TextAlignment(){return this.textAlignment}}class MultiExpression{constructor(e,r){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=e,this.timestamp=r}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(e){this.sourceMeasure=e}get StaffNumber(){return this.staffNumber}set StaffNumber(e){this.staffNumber=e}get Timestamp(){return this.timestamp}set Timestamp(e){this.timestamp=e}get AbsoluteTimestamp(){return Fraction$1.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(e){this.instantaneousDynamic=e}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(e){this.endingContinuousDynamic=e}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(e){this.startingContinuousDynamic=e}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(e){this.octaveShiftStart=e}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(e){this.octaveShiftEnd=e}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(e){this.combinedExpressionsText=e}getPlacementOfFirstEntry(){let e=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof InstantaneousDynamicExpression?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof ContinuousDynamicExpression?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof MoodExpression?e=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof UnknownExpression&&(e=this.expressions[0].expression.Placement)),e}getFontstyleOfFirstEntry(){var r;let e=FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof ContinuousDynamicExpression||this.expressions[0].expression instanceof MoodExpression?e=FontStyles.Italic:this.expressions[0].expression instanceof UnknownExpression&&(e=(r=this.expressions[0].expression.fontStyle)!=null?r:FontStyles.Regular)),e}addExpression(e,r){e instanceof InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=e,this.instantaneousDynamic.ParentMultiExpression=this):e instanceof ContinuousDynamicExpression?this.startingContinuousDynamic=e:e instanceof MoodExpression?this.moodList.push(e):e instanceof UnknownExpression&&this.unknownList.push(e),this.addExpressionToEntryList(e,r)}CompareTo(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue=5&&i<=12}get TempoType(){return this.tempoType}set TempoType(i){this.tempoType=i}get StartTempo(){return this.startTempo}set StartTempo(i){this.startTempo=i}get EndTempo(){return this.endTempo}set EndTempo(i){this.endTempo=i}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(i){this.absoluteEndTimestamp=i}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(i){const e=Fraction$1.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(i.lt(e))return-1;if(this.absoluteEndTimestamp.lt(i))return-2;const r=Fraction$1.minus(i,e).RealValue/Fraction$1.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*r))}setTempoType(){_ContinuousTempoExpression.isStringInStringList(_ContinuousTempoExpression.listContinuousTempoFaster,this.label)?this.tempoType=0:_ContinuousTempoExpression.isStringInStringList(_ContinuousTempoExpression.listContinuousTempoSlower,this.label)&&(this.tempoType=9)}};let ContinuousTempoExpression=_ContinuousTempoExpression;ContinuousTempoExpression.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"];ContinuousTempoExpression.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"];class MultiTempoExpression{constructor(e,r){this.expressions=[],this.sourceMeasure=e,this.timestamp=r}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return Fraction$1.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(e){this.sourceMeasure=e}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(e){this.combinedExpressionsText=e}getPlacementOfFirstEntry(){let e=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof InstantaneousTempoExpression?e=this.expressions[0].Expression.Placement:this.expressions[0].Expression instanceof ContinuousTempoExpression&&(e=this.expressions[0].Expression.Placement)),e}getFontstyleOfFirstEntry(){let e=FontStyles.Regular;return this.expressions[0].Expression instanceof InstantaneousTempoExpression?e=FontStyles.Bold:this.expressions[0].Expression instanceof ContinuousTempoExpression&&(e=FontStyles.Italic),e}addExpression(e,r){if(this.checkIfAlreadyExists(e))return;e instanceof InstantaneousTempoExpression?this.instantaneousTempo=e:e instanceof ContinuousTempoExpression&&(this.continuousTempo=e);const s=new TempoExpressionEntry;s.prefix=r,s.Expression=e,s.label=e.Label,this.expressions.push(s)}CompareTo(e){return this.Timestamp.RealValue>e.Timestamp.RealValue?1:this.Timestamp.RealValue0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const e of this.musicSystems)this.optimizeDistanceBetweenStaffLines(e);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(e,r,s,o){for(let a=0,l=e.length;a0&&(u.beginInstructionsWidth=s),o>0&&(u.endInstructionsWidth=o)}}finalizeCurrentAndCreateNewSystem(e,r=!1,s=!0,o=!1){this.finalizeCurrentSystem(e,r,s,o),this.currentSystemParams=new SystemBuildParameters,e!==void 0&&this.measureListIndex=1){const r=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let s=0;const o=e[e.length-1];o.endLine===SystemLinesEnum.DotsBoldBoldDots&&(o.endLine=SystemLinesEnum.DotsThinBold,s=r[0].getLineWidth(SystemLinesEnum.DotsBoldBoldDots)/2-r[0].getLineWidth(SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=s;for(let a=0,l=r.length;a1){l=!0;break}}let u=0;for(let c=0;c=0&&this.measureList[C]){const k=(w=this.measureList[C][0])==null?void 0:w.parentSourceMeasure;k!=null&&k.ImplicitMeasure&&(k!=null&&k.RhythmPrinted)&&(_=!1)}_&&(r.addRhythmAtBegin(d,s),r.parentSourceMeasure.RhythmPrinted=d,v=!0)}return(m||g||v)&&(l+=r.beginInstructionsWidth,v&&(l+=this.rules.RhythmRightMargin)),l}addInstructionsAtMeasureEnd(e,r,s){if(!e||!e.Instructions||e.Instructions.length===0)return 0;for(let o=0,a=e.Instructions.length;o0&&(this.currentSystemParams.systemMeasures.push({beginLine:SystemLinesEnum.None,endLine:SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=o,this.currentSystemParams.currentSystemFixWidth+=o)}addExtraInstructionMeasure(e,r,s){const o=this.currentSystemParams.currentSystem,a=MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(o.StaffLines[e]);r&&a.addKeyAtBegin(r,this.activeKeys[e],this.activeClefs[e]),s!==void 0&&s.PrintObject&&a.addRhythmAtBegin(s),a.PositionAndShape.BorderLeft=0,a.PositionAndShape.BorderTop=0,a.PositionAndShape.BorderBottom=this.rules.StaffHeight;const l=this.rules.MeasureLeftMargin+a.beginInstructionsWidth+this.rules.MeasureRightMargin;return a.PositionAndShape.BorderRight=l,o.StaffLines[e].Measures.push(a),l}addStaveMeasuresToSystem(e){if(e[0]){const r=[];for(let o=0;o1){const u=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,e.measureListIndex+e.multipleRestMeasures-1);e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[u]}}finally{}const r=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures,s=r[this.measureListIndex];let o=!1;return s.allRests&&(o=(l=(a=r[this.measureListIndex+s.multipleRestMeasures-1])==null?void 0:a.endsWithLineRepetition)==null?void 0:l.call(a)),this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()||o?SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?SystemLinesEnum.DoubleThin:e&&e.endingBarStyleEnum!==void 0?e.endingBarStyleEnum:SystemLinesEnum.SingleThin}getLineWidth(e,r,s){let o=e.getLineWidth(r);return r===SystemLinesEnum.DotsBoldBoldDots&&(o/=2),s&&r===SystemLinesEnum.BoldThinDots&&(o+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),o}previousMeasureEndsLineRepetition(){if(this.measureListIndex===0)return!1;for(let e=0,r=this.measureList[this.measureListIndex-1].length;e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[e])return!1;for(let r=0,s=this.measureList[e].length;r=c)l=y,c=y.multipleRestMeasureNumber;else break}return l.endsWithLineRepetition()}}return!1}nextMeasureBeginsWordRepetition(){const e=this.measureListIndex+1;if(e>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||e>this.measureList.length-1)return!1;for(let r=0,s=this.measureList[e].length;r1)for(let u=1;ua&&(a=y)}for(let u=0;uthis.rules.PageHeight-this.rules.PageBottomMargin&&(o++,o<=4&&console.log(`warning: could not fit a single system on page ${e.PageNumber} and measure number ${s.GraphicalMeasures[0][0].MeasureNumber}. The PageFormat may be too small for this sheet." Will not give further warnings for all pages, only total.`))}else{const c=this.musicSystems[u-1],d=c.StaffLines[c.StaffLines.length-1],y=d.PositionAndShape;let m=this.findRequiredDistanceWithSkyBottomLine(c,s);m=Math.max(a,m),m+=this.rules.MinSkyBottomDistBetweenSystems,((l=window==null?void 0:window.appName)==null?void 0:l.toLocaleUpperCase())==="GYM"&&(m=m<16?16:m);const g=this.hasExpressionCounts(s);g.TempoCount>0&&this.rules.MetronomeMarksDrawn&&(m+=2),g.OtherCount>0&&this.rules.MetronomeMarksDrawn&&(m+=2),m=Math.max(m,this.rules.MinimumDistanceBetweenSystems+d.StaffHeight);const v=r+y.RelativePosition.y+m,b=v+s.PositionAndShape.BorderMarginBottom;if(!(this.rules.NewPageAtXMLNewPageAttribute&&c.breaksPage)&&b0&&console.log(`total amount of pages that couldn't fit a single music system: ${o} of ${e.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(e,r){const s=e.StaffLines[e.StaffLines.length-1],o=r.StaffLines[0],a=s.BottomLine,l=o.SkyLine,u=s.PositionAndShape,c=o.PositionAndShape,d=1/this.rules.SamplingUnit;let y=0;for(let m=0;m=l.length)break;const b=Math.max(0,v-6),S=Math.min(l.length-1,v+6);let x=0;for(let E=b;E<=S;E++)x=Math.min(x,l[E]);const A=g-x;y=Math.max(A,y)}return y===0&&(y=u.BorderBottom-c.BorderTop),y}}class SystemBuildParameters{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return this.systemMeasureIndex===0}}class OctaveShiftParams{constructor(e,r,s){this.getOpenOctaveShift=e,this.getAbsoluteStartTimestamp=r,this.getAbsoluteEndTimestamp=s}}class AccidentalCalculator{constructor(){this.keySignatureNoteAlterationsDict=new Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(e){this.activeKeyInstruction=e,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const e of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(e,this.keySignatureNoteAlterationsDict.getValue(e))}checkAccidental(e,r){if(!r)return;const s=r.FundamentalNote+r.Octave*12,o=this.currentAlterationsComparedToKeyInstructionList.indexOf(s)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(s)){if(o&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(s),1),this.currentInMeasureNoteAlterationsDict.getValue(s)!==r.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(s)&&this.keySignatureNoteAlterationsDict.getValue(s)!==r.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(s),this.currentInMeasureNoteAlterationsDict.setValue(s,r.AccidentalHalfTones)):r.Accidental!==AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(s);const a=this.currentInMeasureNoteAlterationsDict.getValue(s);if(r.Accidental===AccidentalEnum.NONE&&(Math.abs(a)===.5?r=new Pitch(r.FundamentalNote,r.Octave,AccidentalEnum.NONE):r=new Pitch(r.FundamentalNote,r.Octave,AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(r.Accidental)&&!r.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,r)}}else if(r.Accidental!==AccidentalEnum.NONE){if(o||this.currentAlterationsComparedToKeyInstructionList.push(s),this.currentInMeasureNoteAlterationsDict.setValue(s,r.AccidentalHalfTones),this.isAlterAmbiguousAccidental(r.Accidental)&&!r.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,r)}else o&&(r=new Pitch(r.FundamentalNote,r.Octave,AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(s),1),MusicSheetCalculator.symbolFactory.addGraphicalAccidental(e,r))}isAlterAmbiguousAccidental(e){return e===AccidentalEnum.SLASHFLAT||e===AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const e=this.activeKeyInstruction.AlteratedNotes;let r;this.activeKeyInstruction.Key>0?r=AccidentalEnum.SHARP:r=AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let s=-9;s<9;s++)for(let o=0;o0?(s=d-1,e.push({startIndex:r,endIndex:s}),r=d):g.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(s=d,e.push({startIndex:r,endIndex:s}),r=d+1)}r0?Number(H):6,_===H||w+k>b&&_%2===0?(a.push(_),w=P,_=1):_++}else w>b?(a.push(_),w=P,_=1):_++;P>b?M=T+1:M=Math.ceil(M),A===M?E+=1:(o.push(E),A=M,E=1)}o.push(E),a.push(_),a=a.filter(Boolean)}return a.length>1&&a[a.length-1]===1&&(a[a.length-2]=a[a.length-2]-1,a[a.length-1]=a[a.length-1]+1),console.log(a,o),this.buildPreparedMusicSystems(a)}buildPreparedMusicSystems(e){let r=!1;this.currentSystemParams=new SystemBuildParameters,this.currentSystemParams.currentSystem=this.initMusicSystem();for(let s=0,o=this.measureList.length;s0&&this.rules.RenderMultipleRestMeasures){m.isReducedToMultiRest=!0,m.multipleRestMeasureNumber=1;const v=m.multipleRestMeasures-1;d+=v;for(let b=1;b<=v;b++){const S=e.SourceMeasures.indexOf(m)+b;if(S>=e.SourceMeasures.length)break;const x=e.SourceMeasures[S];x.multipleRestMeasureNumber=b+1,x.isReducedToMultiRest=!0,r.push([void 0])}}}if(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let d,y=0;for(let m=0,g=e.SourceMeasures.length;m0){d.isReducedToMultiRest=!0,d.multipleRestMeasureNumber=1,y++,v.multipleRestMeasureNumber=y,v.isReducedToMultiRest=!0;for(let b=0;b1){d.multipleRestMeasures=y;const b=this.createGraphicalMeasuresForSourceMeasure(d,s,a,u,o);r[d.measureListIndex]=b,y=0,d=void 0}else y=0,d=void 0}if(y>1){d.multipleRestMeasures=y,d.isReducedToMultiRest=!0;const m=this.createGraphicalMeasuresForSourceMeasure(d,s,a,u,o);r[d.measureListIndex]=m,y=0,d=void 0}}const c=o.map(d=>d.ClefType===ClefEnum.percussion);this.handleStaffEntries(c),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(e,r){var s;if(this.graphicalMusicSheet.MeasureList.length>0){let o=0,a;for(let l=0;lo&&(o=u),MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(a,u)}if(this.rules.FixedMeasureWidth){let l=o;this.rules.FixedMeasureWidthFixedValue&&(l=this.rules.FixedMeasureWidthFixedValue);for(let u=0;u1;if(a===1&&r.Measures[0].parentSourceMeasure.ImplicitMeasure&&(u=!1),u)return;(l.MeasureNumber===0||l.MeasureNumber===1)&&(s=l.MeasureNumber),l!==r.Measures[0]&&this.rules.MeasureNumberLabelXOffset?o=this.rules.MeasureNumberLabelXOffset:o=0;const c=this.rules.UseXMLMeasureNumbers&&l.MeasureNumber===1&&l.parentSourceMeasure.getPrintedMeasureNumber()!==1;((l.MeasureNumber===s||l.MeasureNumber>=s+this.rules.MeasureNumberLabelOffset)&&!l.parentSourceMeasure.ImplicitMeasure||c)&&((l.MeasureNumber!==1||l.MeasureNumber===1&&l!==r.Measures[0]||c)&&this.calculateSingleMeasureNumberPlacement(l,r,e,o),s=l.MeasureNumber)}}calculateSingleMeasureNumberPlacement(e,r,s,o=0){const a=e.parentSourceMeasure.getPrintedMeasureNumber().toString(),l=new Label(a),u=new GraphicalLabel(l,this.rules.MeasureNumberLabelHeight,TextAlignmentEnum.LeftBottom,this.rules),c=r.SkyBottomLineCalculator;u.setLabelPositionAndShapeBorders(),u.PositionAndShape.Parent=s.PositionAndShape;const d=r.PositionAndShape.RelativePosition.x+e.PositionAndShape.RelativePosition.x-u.PositionAndShape.BorderMarginLeft+o;let y,m=d,g=d-u.PositionAndShape.BorderLeft+u.PositionAndShape.BorderRight;m-=r.PositionAndShape.RelativePosition.x,g-=r.PositionAndShape.RelativePosition.x;const v=m+.5,b=g-.5,S=c.getSkyLineMinInRange(v,b);if(e===r.Measures[0]){let x=0;if(s.GroupBrackets.length>0)for(const A of s.GroupBrackets)x=Math.min(x,A.PositionAndShape.BorderTop);else e.ParentStaff.ParentInstrument.Parent&&(x=-1);y=Math.min(S,x)}else y=S;y=Math.min(0,y),u.PositionAndShape.RelativePosition=new PointF2D(d,y),s.MeasureNumberLabels.push(u)}calculateMeasureNumberSkyline(e){const r=e.StaffLines[0];for(const s of e.MeasureNumberLabels){let o=s.PositionAndShape.RelativePosition.x,a=o-s.PositionAndShape.BorderLeft+s.PositionAndShape.BorderRight;o-=r.PositionAndShape.RelativePosition.x,a-=r.PositionAndShape.RelativePosition.x,r.SkyBottomLineCalculator.updateSkyLineInRange(o,a,s.PositionAndShape.RelativePosition.y+s.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(e,r,s){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(e,r){let s=0,o=this.rules.StaffHeight;const a=new Map,l=[],u=e.SkyBottomLineCalculator;let c=e.Measures.length;for(let y=0;y0){l.push(S),s=Math.max(s,S.LyricsEntries.length);const A=S.PositionAndShape.RelativePosition.x+g.x;let E=Number.MAX_VALUE,w=Number.MIN_VALUE;for(let T=0;T0){const y=e.PositionAndShape.Size.width;let m=l[0].PositionAndShape.RelativePosition.x+l[0].PositionAndShape.BorderMarginLeft+l[0].parentMeasure.PositionAndShape.RelativePosition.x;m=m>y?y:m,u.updateBottomLineInRange(m,y,d)}return l}calculateLyricsExtendsAndDashes(e){for(let r=0,s=e.length;r0||e.UnknownList.length>0){let y="";for(let S=0,x=e.EntriesList.length;S-50){let S=u/10;S+=this.rules.PlaceWordsInsideStafflineYOffset,b.PositionAndShape.RelativePosition.y=S}new GraphicalUnknownExpression(m,b,v,(d=a[s])==null?void 0:d.parentSourceMeasure,e)}}clearRecreatedObjects(){for(let e=0,r=this.staffEntriesWithGraphicalTies.length;ee.length-1&&(loglevelExports.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=e.length-1);const r=[];for(let l=this.rules.MinMeasureToDrawIndex,u=e.length;l0){let A=0;l.staffEntries[0].relInMeasureTimestamp.RealValue===0&&(A=l.staffEntries[0].PositionAndShape.RelativePosition.x,l.MeasureNumber===1&&(A+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1));const E=l.PositionAndShape.Size.width-l.endInstructionsWidth,w=c.relInMeasureTimestamp.RealValue/l.parentSourceMeasure.Duration.RealValue;let _=A+(E-A)*w+y.PositionAndShape.BorderMarginLeft;u&&(_=Math.max(_,u.PositionAndShape.RelativePosition.x+u.GraphicalLabel.PositionAndShape.Size.width+this.rules.ChordSymbolXSpacing)),y.PositionAndShape.RelativePosition.x=_,y.PositionAndShape.Parent=l.staffEntries[0].PositionAndShape.Parent}const m=y.PositionAndShape,g=m.Parent;if(g.DataObject instanceof GraphicalMeasure&&c.relInMeasureTimestamp.RealValue===0&&(m.RelativePosition.x=Math.max(l.beginInstructionsWidth,m.RelativePosition.x),l.MeasureNumber===1&&m.RelativePosition.x>3&&(m.RelativePosition.x+=this.rules.ChordSymbolWholeMeasureRestXOffsetMeasure1)),c.PositionAndShape.RelativePosition.x===0){const A=e.GraphicalMeasures[a];for(const E of A){let w=!1;for(const _ of E.staffEntries)if(_.relInMeasureTimestamp===c.relInMeasureTimestamp&&_.PositionAndShape.RelativePosition.x!==0){m.RelativePosition.x=_.PositionAndShape.RelativePosition.x,w=!0;break}if(w)break}}const v=m.BorderMarginLeft+g.AbsolutePosition.x+m.RelativePosition.x,b=m.BorderMarginRight+g.AbsolutePosition.x+m.RelativePosition.x;(!this.rules.ChordSymbolYAlignment||o>0)&&(o=s.getSkyLineMinInRange(v,b));let S=0;d===0?(S+=this.rules.ChordSymbolYOffset,S+=.1):S+=this.rules.ChordSymbolYPadding,S*=-1;const x=y.GraphicalLabel;x.PositionAndShape.RelativePosition.y=o+S,x.setLabelPositionAndShapeBorders(),x.PositionAndShape.calculateBoundingBox(),s.updateSkyLineInRange(v,b,o+x.PositionAndShape.BorderMarginTop),u=y}}}}calculateAlignedChordSymbolsOffset(e,r){let s=Number.MAX_SAFE_INTEGER;for(const o of e)for(const a of o.graphicalChordContainers){const l=a.PositionAndShape,u=l.Parent;let c=l.BorderMarginLeft+u.AbsolutePosition.x,d=l.BorderMarginRight+u.AbsolutePosition.x;u.DataObject instanceof GraphicalMeasure&&(c+=u.DataObject.beginInstructionsWidth,d+=u.DataObject.beginInstructionsWidth),s=Math.min(s,r.getSkyLineMinInRange(c,d))}return s}layoutMeasureWithWholeRest(e,r,s){}layoutBeams(e){}layoutArticulationMarks(e,r,s){}layoutOrnament(e,r,s){}calculateRestNotePlacementWithinGraphicalBeam(e,r,s,o,a){}calculateTupletNumbers(){if(!this.rules.TupletNumberLimitConsecutiveRepetitions)return;let e=-1,r,s=0,o,a;const l={};for(const u of this.graphicalMusicSheet.ParentMusicSheet.Instruments)for(const c of u.Voices){s=0,l[c.VoiceId]={};for(const d of c.VoiceEntries)if(d.Notes.length>0){const y=d.Notes[0];if(!y.NoteTuplet||y.NoteTuplet.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed)){e=-1,s=0,o=void 0,r=void 0;continue}if(y.NoteTuplet===a)continue;let m=y.TypeLength;if(m||(loglevelExports.warn("note missing TypeLength"),m=y.NoteTuplet.Fractions[0]),y.NoteTuplet!==o&&l[c.VoiceId][y.NoteTuplet.TupletLabelNumber]&&l[c.VoiceId][y.NoteTuplet.TupletLabelNumber][m.RealValue]){y.NoteTuplet.RenderTupletNumber=!1,a=y.NoteTuplet;continue}(y.NoteTuplet.TupletLabelNumber!==e||!m.Equals(r)||y.NoteTuplet.Bracket)&&(e=y.NoteTuplet.TupletLabelNumber,r=m,s=0),o=y.NoteTuplet,s++,s<=this.rules.TupletNumberMaxConsecutiveRepetitions&&(y.NoteTuplet.RenderTupletNumber=!0),s>this.rules.TupletNumberMaxConsecutiveRepetitions&&(y.NoteTuplet.RenderTupletNumber=!1,this.rules.TupletNumberAlwaysDisableAfterFirstMax&&(l[c.VoiceId][e]||(l[c.VoiceId][e]={}),l[c.VoiceId][e][m.RealValue]=!0)),a=o}}}calculateSlurs(){}calculateGlissandi(){}calculateDynamicExpressionsForMultiExpression(e,r,s){}calculateGraphicalVerbalContinuousDynamic(e,r){const s=e.Label,o=r.x+s.PositionAndShape.BorderMarginLeft,a=r.x+s.PositionAndShape.BorderMarginRight,l=e.ContinuousDynamic.Placement,c=e.ParentStaffLine.SkyBottomLineCalculator;let d;l===PlacementEnum.Below?(d=c.getBottomLineMaxInRange(o,a),s.PositionAndShape.RelativePosition=new PointF2D(r.x,d-s.PositionAndShape.BorderMarginTop)):(d=c.getSkyLineMinInRange(o,a),s.PositionAndShape.RelativePosition=new PointF2D(r.x,d-s.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(e,r){var Q;const s=e.IsSoftAccent,o=e.ParentStaffLine.ParentStaff.idInMusicSheet,a=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(e.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,o);if(!a){loglevelExports.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");return}e.EndMeasure=a;const l=e.ParentStaffLine,u=a.ParentStaffLine,c=u&&l===u;let d=!1;u?d=u==null?void 0:u.isPartOfMultiStaffInstrument():l&&(d=l==null?void 0:l.isPartOfMultiStaffInstrument());const y=Fraction$1.createFromFraction(e.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),m=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(y),g=m.getFirstNonNullStaffEntry().parentMeasure,v=g.PositionAndShape.AbsolutePosition.x+g.PositionAndShape.BorderRight;let b=new Fraction$1(0,0,0);for(const z of m.StaffEntries){const W=(Q=z==null?void 0:z.sourceStaffEntry)==null?void 0:Q.calculateMaxNoteLength(!1);W!=null&&W.gt(b)&&(b=W)}const S=!s&&e.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo,x=this.getRelativePositionInStaffLineFromTimestamp(y,o,u,d,0,S),A=Fraction$1.plus(y,b),E=this.getRelativePositionInStaffLineFromTimestamp(A,o,u,d,0,e.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo),w=this.rules.SoftAccentWedgePadding,_=m.getFirstNonNullStaffEntry().PositionAndShape.Size.width,T=this.rules.SoftAccentSizeFactor;s?(r.x-=_/2*T+w,x.x=r.x+_/2*T):E.x>x.x&&E.xk){const ye=P.StaffLines[z].PositionAndShape.RelativePosition.y-l.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;N=this.rules.StaffHeight+ye/2}else N=this.rules.WedgePlacementBelowY;N-=this.rules.WedgeOpeningLength/2,c||(O=N);let W=M.getBottomLineMaxInRange(F,U);if(W>N&&(N=W),kO&&(O=W),O+=this.rules.WedgeOpeningLength/2,O+=this.rules.WedgeVerticalMargin),N+=this.rules.WedgeOpeningLength/2,N+=this.rules.WedgeVerticalMargin}else if(R===PlacementEnum.Above){if(l.ParentStaff.ParentInstrument.Staves.length===1)N=this.rules.WedgePlacementAboveY;else{let W=0;k>0&&(W=k-1);const xe=P.StaffLines[W];N=-(l.PositionAndShape.RelativePosition.y-xe.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}N+=this.rules.WedgeOpeningLength/2,c||(O=N);let z=M.getSkyLineMinInRange(F,U);if(z1&&k>0){const W=l.findClosestStaffEntry(F),xe=l.findClosestStaffEntry(U);W&&xe&&W.parentVerticalContainer}c||(z=u.SkyBottomLineCalculator.getSkyLineMinInRange(I,D),zye&&(ye=q),ye+=this.rules.WedgeOpeningLength/2,ye+=this.rules.WedgeVerticalMargin}else if(R===PlacementEnum.Above){const q=xe.SkyBottomLineCalculator.getSkyLineMinInRange(I,D);q-m/2?c=-m/2:c=d-e.PositionAndShape.BorderMarginBottom}else c=d-e.PositionAndShape.BorderMarginBottom;e.PositionAndShape.RelativePosition=new PointF2D(r.x,c)}else if(e.Placement===PlacementEnum.Below){const d=u.getBottomLineMaxInRange(a,l),y=o.ParentStaff.ParentInstrument.Staves[o.ParentStaff.ParentInstrument.Staves.length-1];if(o.isPartOfMultiStaffInstrument()&&o.ParentStaff!==y){const g=o.ParentMusicSystem.StaffLines[o.ParentMusicSystem.StaffLines.indexOf(o)+1].PositionAndShape.RelativePosition.y-o.PositionAndShape.RelativePosition.y-this.rules.StaffHeight,v=e.PositionAndShape.BorderMarginBottom;d+ve.PositionAndShape.Size.width&&(v=e.PositionAndShape.Size.width-this.rules.MeasureRightMargin,g=v-y.PositionAndShape.MarginSize.width,r.x=g-y.PositionAndShape.BorderMarginLeft);let b;const S=e.SkyBottomLineCalculator;return a===PlacementEnum.Below?b=S.getBottomLineMaxInRange(g,v)+c:b=S.getSkyLineMinInRange(g,v)-c,y.PositionAndShape.RelativePosition=new PointF2D(r.x,b),a===PlacementEnum.Below?S.updateBottomLineInRange(g,v,y.PositionAndShape.BorderMarginBottom+b):S.updateSkyLineInRange(g,v,y.PositionAndShape.BorderMarginTop+b),y}calculateTempoExpressionsForMultiTempoExpression(e,r,s,o){metronomeMarks={};const a=Fraction$1.plus(e.AbsoluteTimestamp,r.Timestamp),l=this.graphicalMusicSheet.MeasureList[s];let u=new PointF2D;if(r.ContinuousTempo||r.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!l[0])return;let c=l[0].ParentStaffLine,d=l[0].PositionAndShape.RelativePosition.x,y=0;for(let m=0;m0){c=l[m].ParentStaffLine,d=l[m].PositionAndShape.RelativePosition.x,y=m;break}if(u=this.getRelativePositionInStaffLineFromTimestamp(a,y,c,c.isPartOfMultiStaffInstrument(),d),r.EntriesList.length>0&&r.EntriesList[0].Expression instanceof InstantaneousTempoExpression){const m=r.EntriesList[0].Expression;if(m.Placement=PlacementEnum.Above,c.Measures[0].staffEntries.length>0&&Math.abs(u.x-c.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)===0&&c.ParentMusicSystem===this.musicSystems[0]){const g=c.Measures[0].FirstInstructionStaffEntry;if(g){const v=g.GraphicalInstructions.last();u.x=v.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(u.x=c.PositionAndShape.RelativePosition.x+c.Measures[0].PositionAndShape.RelativePosition.x)}}for(const m of r.EntriesList){let g=TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(g=TextAlignmentEnum.LeftBottom);const v=this.calculateLabel(c,u,m.label,r.getFontstyleOfFirstEntry(),m.Expression.Placement,this.rules.UnknownTextHeight,g,this.rules.TempoYSpacing);if(m.Expression.ColorXML&&this.rules.ExpressionsUseXMLColor&&(v.ColorXML=m.Expression.ColorXML),m.Expression instanceof InstantaneousTempoExpression){for(const S of c.AbstractExpressions)S instanceof GraphicalInstantaneousTempoExpression&&(S.SourceExpression.Label,m.Expression.Label);new GraphicalInstantaneousTempoExpression(m.Expression,v).ParentStaffLine||loglevelExports.warn("Adding staffline didn't work"),m.Expression.Enum===TempoEnum.metronomeMark&&(metronomeMarks[s]=m.Expression)}else m.Expression instanceof ContinuousTempoExpression;if(o===e.TempoExpressions.length-1)for(const b of Object.values(metronomeMarks))this.createMetronomeMark(b,s);else if(m.Expression instanceof ContinuousTempoExpression){for(const b of c.AbstractExpressions)b instanceof GraphicalInstantaneousTempoExpression&&(b.SourceExpression.Label,m.Expression.Label);c.AbstractExpressions.push(new GraphicalInstantaneousTempoExpression(m.Expression,v))}}}}createMetronomeMark(e,r){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(e){}clearSystemsAndMeasures(){for(let e=0,r=this.graphicalMusicSheet.MusicPages.length;e-1&&g.PositionAndShape.ChildElements.splice(v,1),g.FirstInstructionStaffEntry=void 0,g.beginInstructionsWidth=0}if(g.LastInstructionStaffEntry){const v=g.PositionAndShape.ChildElements.indexOf(g.LastInstructionStaffEntry.PositionAndShape);v>-1&&g.PositionAndShape.ChildElements.splice(v,1),g.LastInstructionStaffEntry=void 0,g.endInstructionsWidth=0}}d.Measures=[],d.PositionAndShape.ChildElements=[]}l.StaffLines.length=0,l.PositionAndShape.ChildElements=[]}s.MusicSystems=[],s.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(e,r,s,o,a,l,u,c,d,y=void 0,m=void 0){e.StemDirectionXml!==StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&e.StemDirectionXml!==void 0?e.WantedStemDirection=e.StemDirectionXml:this.calculateStemDirectionFromVoices(e);const g=r.findOrCreateGraphicalVoiceEntry(e);g.octaveShiftValue=c;const v=r.tabStaffEntry;let b;v&&(b=v.findOrCreateGraphicalVoiceEntry(e));for(let S=0,x=e.Notes.length;S-1)continue;let E;if(e.IsGrace?E=MusicSheetCalculator.symbolFactory.createGraceNote(A,g,a,this.rules,c):(E=MusicSheetCalculator.symbolFactory.createNote(A,g,a,c,this.rules,void 0),MusicSheetCalculator.stafflineNoteCalculator.trackNote(E)),A.Pitch&&this.checkNoteForAccidental(E,s,a,c),this.resetYPositionForLeadSheet(E.PositionAndShape),r.addGraphicalNoteToListAtCorrectYPosition(g,E),E.PositionAndShape.calculateBoundingBox(),this.leadSheet||(A.NoteBeam!==void 0&&A.PrintObject&&(!(A instanceof TabNote)||this.rules.TabBeamsRendered)&&this.handleBeam(E,A.NoteBeam,u),A.NoteTuplet!==void 0&&A.PrintObject&&this.handleTuplet(E,A.NoteTuplet,l)),b){const w=MusicSheetCalculator.symbolFactory.createNote(A,b,a,c,this.rules,void 0);v.addGraphicalNoteToListAtCorrectYPosition(b,w),w.PositionAndShape.calculateBoundingBox(),this.leadSheet||A.NoteTuplet&&this.handleTuplet(w,A.NoteTuplet,l)}}return e.Articulations.length>0&&this.handleVoiceEntryArticulations(e.Articulations,e,r),e.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(e.TechnicalInstructions,e,r),e.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(e,r,o),e.OrnamentContainer&&this.handleVoiceEntryOrnaments(e.OrnamentContainer,e,r),c}resetYPositionForLeadSheet(e){this.leadSheet&&(e.RelativePosition=new PointF2D(e.RelativePosition.x,0))}layoutVoiceEntries(e,r){if(e.PositionAndShape.RelativePosition=new PointF2D(0,0),!this.leadSheet)for(const s of e.graphicalVoiceEntries){const o=s.notes;if(o.length===0)continue;const a=o[0].sourceNote.ParentVoiceEntry,l=o[0].sourceNote.Pitch!==void 0;this.layoutVoiceEntry(a,o,e,l)}}maxInstrNameLabelLength(){var r;let e=0;for(const s of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((r=s.NameLabel)!=null&&r.print&&s.Voices.length>0&&s.Voices[0].Visible){let o=s.NameLabel;this.rules.RenderPartNames||(o=new Label("",o.textAlignment,o.font));const a=new GraphicalLabel(o,this.rules.InstrumentLabelTextHeight,TextAlignmentEnum.LeftCenter,this.rules);a.setLabelPositionAndShapeBorders(),e=Math.max(e,a.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){var o;const e=this.graphicalMusicSheet.ParentMusicSheet,r=this.rules.DefaultColorTitle;if(e.Title!==void 0&&this.rules.RenderTitle){const a=new GraphicalLabel(e.Title,this.rules.SheetTitleHeight,TextAlignmentEnum.CenterBottom,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=r,this.graphicalMusicSheet.Title=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(e.Subtitle!==void 0&&this.rules.RenderSubtitle){const a=new GraphicalLabel(e.Subtitle,this.rules.SheetSubtitleHeight,TextAlignmentEnum.CenterCenter,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=r,this.graphicalMusicSheet.Subtitle=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(e.Composer!==void 0&&this.rules.RenderComposer){const a=new GraphicalLabel(e.Composer,this.rules.SheetComposerHeight,TextAlignmentEnum.RightCenter,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=r,this.graphicalMusicSheet.Composer=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(e.Lyricist!==void 0&&this.rules.RenderLyricist){const a=new GraphicalLabel(e.Lyricist,this.rules.SheetAuthorHeight,TextAlignmentEnum.RightCenter,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=r,this.graphicalMusicSheet.Lyricist=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);if(e.Copyright!==void 0&&this.rules.RenderCopyright){const a=new GraphicalLabel(e.Copyright,this.rules.SheetCopyrightHeight,TextAlignmentEnum.CenterBottom,this.rules);a.Label.IsCreditLabel=!0,a.Label.colorDefault=r,this.graphicalMusicSheet.Copyright=a,a.setLabelPositionAndShapeBorders()}else this.rules.RenderCopyright||(this.graphicalMusicSheet.Copyright=void 0);const s=(o=this.graphicalMusicSheet.musicSheet.sourceMeasures)==null?void 0:o[0];if(s&&s.FirstInstructionsStaffEntries.length>0){const a=s.FirstInstructionsStaffEntries[0];let l,u;for(let c=0,d=a.Instructions.length;c0&&y.graphicalVoiceEntries[0].notes.length===1){const m=y.graphicalVoiceEntries[0].notes[0];!m.sourceNote.Pitch&&new Fraction$1(1,2).lt(m.sourceNote.Length)&&this.layoutMeasureWithWholeRest(m,y,d)}}}}}}optimizeRestNotePlacement(e,r){if(e.graphicalVoiceEntries.length===0)return;const s=e.graphicalVoiceEntries[0].notes;if(s.length===0)return;const o=s[0],a=o.sourceNote.isRest();if(e.graphicalVoiceEntries.length===2){let l=!1;const u=e.graphicalVoiceEntries[1].notes;u.length>0&&(l=u[0].sourceNote.isRest()),a&&l?this.calculateTwoRestNotesPlacementWithCollisionDetection(e):(a||l)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(e)}else if(a&&e!==r.staffEntries[0]&&e!==r.staffEntries[r.staffEntries.length-1]){const l=r.staffEntries.indexOf(e),u=r.staffEntries[l-1],c=r.staffEntries[l+1];if(u.graphicalVoiceEntries.length===1){const d=u.graphicalVoiceEntries[0].notes[0];if(d.sourceNote.NoteBeam!==void 0&&c.graphicalVoiceEntries.length===1){const y=c.graphicalVoiceEntries[0].notes[0];y.sourceNote.NoteBeam!==void 0&&d.sourceNote.NoteBeam===y.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(e,o,d,c,y),e.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(e,r,s,o,a=0,l=!1){let u=new PointF2D,c,d;const y=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,m=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),g=Math.min(Math.floor(m),y-1),v=Math.min(Math.ceil(m),y-1);if(g<0||r<0)return u;if(c=this.getFirstLeftNotNullStaffEntryFromContainer(g,r,o),d=this.getFirstRightNotNullStaffEntryFromContainer(v,r,o),c&&d){let b=c.parentMeasure.PositionAndShape.RelativePosition.x;a>0&&(b=a);let S=c.PositionAndShape.RelativePosition.x+b,x=d.PositionAndShape.RelativePosition.x+d.parentMeasure.PositionAndShape.RelativePosition.x;const A=e.RealValue>d.getAbsoluteTimestamp().RealValue;a>0?x=d.PositionAndShape.RelativePosition.x+b:l&&(c.getAbsoluteTimestamp().RealValue===e.RealValue||A)&&(S=c.PositionAndShape.RelativePosition.x+c.PositionAndShape.BorderLeft+b,x=S);let E=0;if(c!==d){const w=c.getAbsoluteTimestamp(),_=d.getAbsoluteTimestamp();E=Fraction$1.minus(e,w).RealValue/Fraction$1.minus(_,w).RealValue}c.parentMeasure.ParentStaffLine!==d.parentMeasure.ParentStaffLine&&(c.parentMeasure.ParentStaffLine===s?x=s.PositionAndShape.Size.width:S=s.PositionAndShape.RelativePosition.x),u=new PointF2D(S+(x-S)*E,0)}return u}getRelativeXPositionFromTimestamp(e){const r=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,s=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(e),o=Math.max(0,Math.min(Math.round(s),r-1)),a=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[o].getFirstNonNullStaffEntry();return a.PositionAndShape.RelativePosition.x+a.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(e){var y,m;this.rules.RenderSingleHorizontalStaffline&&(e.PositionAndShape.BorderRight=e.PositionAndShape.Size.width,e.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=e.PositionAndShape.Size.width);let r=10,s=-1;if(e.MusicSystems.length>0){const g=e.MusicSystems[0];r=g.PositionAndShape.RelativePosition.y+g.PositionAndShape.BorderTop;const v=e.MusicSystems[e.MusicSystems.length-1];s=v.PositionAndShape.RelativePosition.y+v.PositionAndShape.BorderBottom}if(this.graphicalMusicSheet.Title&&this.rules.RenderTitle){const g=this.graphicalMusicSheet.Title;g.PositionAndShape.Parent=e.PositionAndShape;const v=new PointF2D;v.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,v.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,g.PositionAndShape.RelativePosition=v,e.Labels.push(g)}if(this.graphicalMusicSheet.Subtitle&&this.rules.RenderTitle&&this.rules.RenderSubtitle){const g=this.graphicalMusicSheet.Subtitle;g.PositionAndShape.Parent=e.PositionAndShape;const v=new PointF2D;v.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,v.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle;const b=(y=g.TextLines)==null?void 0:y.length;b>1&&(v.y+=g.PositionAndShape.BorderBottom*(b-1)/b),g.PositionAndShape.RelativePosition=v,e.Labels.push(g)}const o=this.graphicalMusicSheet.Composer;let a;const u=this.graphicalMusicSheet.Composer&&this.rules.RenderComposer&&this.graphicalMusicSheet.Lyricist&&this.rules.RenderLyricist?2:0;if(o&&this.rules.RenderComposer){o.PositionAndShape.Parent=e.PositionAndShape,o.setLabelPositionAndShapeBorders();const g=new PointF2D;g.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,g.y=r,g.y-=this.rules.SystemComposerDistance;const v=(m=o.TextLines)==null?void 0:m.length;v>1&&(g.y-=o.PositionAndShape.BorderBottom*(v-1)/v),a=g.y,g.y-=u,o.PositionAndShape.RelativePosition=g,e.Labels.push(o)}const c=this.graphicalMusicSheet.Lyricist;if(c&&this.rules.RenderLyricist){c.PositionAndShape.Parent=e.PositionAndShape,c.setLabelPositionAndShapeBorders();const g=new PointF2D;g.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,g.y=r,g.y-=this.rules.SystemLyricistDistance,g.y+=c.PositionAndShape.BorderBottom,g.y=Math.min(g.y,a!=null?a:Number.MAX_SAFE_INTEGER),g.y+=u,c.PositionAndShape.RelativePosition=g,e.Labels.push(c)}const d=this.graphicalMusicSheet.Copyright;if(d&&this.rules.RenderCopyright){d.PositionAndShape.Parent=e.PositionAndShape,d.setLabelPositionAndShapeBorders();const g=new PointF2D;g.x=e.PositionAndShape.Size.width/2,g.y=s+this.rules.SheetCopyrightMargin,g.y-=d.PositionAndShape.BorderTop,d.PositionAndShape.RelativePosition=g,e.Labels.push(d)}}createGraphicalTies(){for(let e=0;e=0&&this.staffEntriesWithGraphicalTies.push(a)}a=u}}setTieDirections(e){if(!e)return;const r=e.ties;if(r.length===1){const s=r[0];if(s.TieDirection===PlacementEnum.NotYetDefined){const o=s.Notes[0].ParentVoiceEntry.ParentVoice.VoiceId;(o===2||o===6)&&(s.TieDirection=PlacementEnum.Below)}}if(r.length>1){let s;for(const o of r){const a=o.Notes[0];(!s||a.Pitch.getHalfTone()>s.Pitch.getHalfTone())&&(s=a)}for(const o of r)o.TieDirection===PlacementEnum.NotYetDefined&&(o.Notes[0]===s?o.TieDirection=PlacementEnum.Above:o.TieDirection=PlacementEnum.Below)}}createAccidentalCalculators(){const e=[],r=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(r)for(let s=0;s1)return;m=MusicSheetCalculator.symbolFactory.createGraphicalMeasure(e,y)}if(m.hasError=e.getErrorInMeasure(c),e.FirstInstructionsStaffEntries[c])for(let A=0,E=e.FirstInstructionsStaffEntries[c].Instructions.length;A0){const C=E.Instructions[0];MusicSheetCalculator.symbolFactory.createInStaffClef(w,C)}this.rules.RenderChordSymbols&&((x=E.ChordContainers)==null?void 0:x.length)>0&&(E.ParentStaff.ParentInstrument.HasChordSymbols=!0,MusicSheetCalculator.symbolFactory.createChordSymbols(E,w,o.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(o.doCalculationsAtEndOfMeasure(),e.LastInstructionsStaffEntries[c]){const A=e.LastInstructionsStaffEntries[c];for(let E=0,w=A.Instructions.length;E=1&&m.staffEntries.length===0){const A=new SourceStaffEntry(new VerticalSourceStaffEntryContainer(m.parentSourceMeasure,m.parentSourceMeasure.AbsoluteTimestamp,m.parentSourceMeasure.CompleteNumberOfStaves),y);if(y.Voices.length===0){const k=new Voice(m.ParentStaff.ParentInstrument,-1);y.Voices.push(k)}const E=new VoiceEntry(new Fraction$1(0,1),y.Voices[0],A);let w=e.Duration;w.RealValue===0&&(w=e.ActiveTimeSignature.clone());const _=new Note$1(E,A,w,void 0,e,!0);_.IsWholeMeasureRest=!0,_.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===FillEmptyMeasuresWithWholeRests.YesVisible,E.addNote(_);const T=MusicSheetCalculator.symbolFactory.createStaffEntry(A,m);m.addGraphicalStaffEntry(T),T.relInMeasureTimestamp=E.Timestamp;const C=MusicSheetCalculator.symbolFactory.createVoiceEntry(E,T);T.graphicalVoiceEntries.push(C);const P=MusicSheetCalculator.symbolFactory.createNote(_,C,new ClefInstruction,OctaveEnum.NONE,this.rules);MusicSheetCalculator.stafflineNoteCalculator.trackNote(P),C.notes.push(P)}m.hasOnlyRests=!0;for(const A of m.staffEntries)if(m.hasOnlyRests=A.hasOnlyRests(),!m.hasOnlyRests)break;return m}checkNoteForAccidental(e,r,s,o){let a=e.sourceNote.Pitch;const l=e.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();l!==0&&e.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==MidiInstrument.Percussion&&(a=e.Transpose(r.ActiveKeyInstruction,s,l,o),e.sourceNote.TransposedPitch=a),e.sourceNote.halfTone=a.getHalfTone(),r.checkAccidental(e,a)}handleStaffEntries(e){for(let r=0,s=this.graphicalMusicSheet.MeasureList.length;r0&&!this.rules.PercussionUseCajon2NoteSystem&&e[a]&&(this.rules.PercussionOneLineCutoff===-1||MusicSheetCalculator.stafflineNoteCalculator.getStafflineUniquePositionCount(a)0&&c.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(c,a),this.layoutStaffEntry(c));this.graphicalMeasureCreatedCalculations(u)}}}}calculateSkyBottomLines(){for(const e of this.musicSystems)for(const r of e.StaffLines)r.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let e=0,r=this.musicSystems.length;e0&&this.layoutArticulationMarks(S.Articulations,S,g)}}}}}}calculateOrnaments(){for(let e=0,r=this.musicSystems.length;e0&&o.LyricVersesNumbers.sort()}for(let r=0,s=this.musicSystems.length;r=0&&(o=r.GraphicalLyricsEntries[s+1]),!o)return;const a=e.StaffEntryParent.parentMeasure.ParentStaffLine,l=o.StaffEntryParent.parentMeasure.ParentStaffLine,u=e.StaffEntryParent,c=o.StaffEntryParent;if(e.StaffEntryParent.parentMeasure.ParentStaffLine===o.StaffEntryParent.parentMeasure.ParentStaffLine){const d=u.parentMeasure.PositionAndShape.RelativePosition.x+u.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight-e.GraphicalLabel.CenteringXShift,y=c.parentMeasure.PositionAndShape.RelativePosition.x+c.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.RelativePosition.x+o.GraphicalLabel.PositionAndShape.BorderMarginLeft,m=e.GraphicalLabel.PositionAndShape.RelativePosition.y;let g=1;y-d>this.rules.MinimumDistanceBetweenDashes*3&&(g=Math.floor((y-d)/this.rules.MinimumDistanceBetweenDashes)-1),g===1?this.calculateSingleDashForLyricWord(a,d,y,m):this.calculateDashes(a,d,y,m)}else{const d=u.parentMeasure.PositionAndShape.RelativePosition.x+u.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,y=a.Measures[a.Measures.length-1],m=y.PositionAndShape.RelativePosition.x+y.PositionAndShape.Size.width;let g=e.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(a,d,m,g),l&&l.Measures[0]&&c.parentMeasure.ParentStaffLine&&!(c===c.parentMeasure.staffEntries[0]&&c.parentMeasure===c.parentMeasure.ParentStaffLine.Measures[0])){const v=l.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,b=c.parentMeasure.PositionAndShape.RelativePosition.x+c.PositionAndShape.RelativePosition.x+o.GraphicalLabel.PositionAndShape.BorderMarginLeft;g=o.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(l,v,b,g)}}}calculateDashes(e,r,s,o){let a=s-r;if(ar;)a=this.calculateRightAndLeftDashesForLyricWord(e,r,s,o),r+=u,s-=u,c++;a>u*2&&this.calculateSingleDashForLyricWord(e,r,s,o)}}calculateSingleDashForLyricWord(e,r,s,o){const a=new Label("-");a.colorDefault=this.rules.DefaultColorLyrics;let l=this.rules.LyricsHeight;s-r<.8&&(l*=.8,o-=.1*l);const u=new GraphicalLabel(a,l,TextAlignmentEnum.CenterBottom,this.rules);u.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(u),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e),u.PositionAndShape.Parent=e.PositionAndShape;const c=new PointF2D(r+(s-r)/2,o);u.PositionAndShape.RelativePosition=c}calculateLyricExtend(e){let r=e.GraphicalLabel.PositionAndShape.RelativePosition.y;const s=e.StaffEntryParent,o=s.parentMeasure.ParentStaffLine;let a,l;const u=s.parentMeasure.ParentStaff.idInMusicSheet;for(let c=s.parentVerticalContainer.Index+1;c0)break;a=d,l=a.parentMeasure.ParentStaffLine,l||(l=s.parentMeasure.ParentStaffLine)}}if(!(!a||!l))if(o===l&&a.parentMeasure.ParentStaffLine){const c=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,d=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+a.PositionAndShape.BorderMarginRight;r-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(o,c,d,r)}else{const c=o.Measures[o.Measures.length-1].PositionAndShape,d=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+e.GraphicalLabel.PositionAndShape.BorderMarginRight,y=c.RelativePosition.x+c.Size.width;if(r-=e.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(o,d,y,r),!a)return;if(a.parentMeasure.ParentStaffLine&&a.parentMeasure.staffEntries&&!(a===a.parentMeasure.staffEntries[0]&&a.parentMeasure===a.parentMeasure.ParentStaffLine.Measures[0])){const m=l.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,g=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+a.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(l,m,g,r)}}}calculateSingleLyricWordWithUnderscore(e,r,s,o){const a=new PointF2D(r,o),l=new PointF2D(s,o),u=new GraphicalLine(a,l,this.rules.LyricUnderscoreLineWidth);u.colorHex=this.rules.DefaultColorLyrics,e.LyricLines.push(u),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e)}calculateRightAndLeftDashesForLyricWord(e,r,s,o){const a=new Label("-");a.colorDefault=this.rules.DefaultColorLyrics;const l=new GraphicalLabel(a,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);l.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(l),this.staffLinesWithLyricWords.indexOf(e)===-1&&this.staffLinesWithLyricWords.push(e),l.PositionAndShape.Parent=e.PositionAndShape;const u=new PointF2D(r,o);l.PositionAndShape.RelativePosition=u;const c=new Label("-"),d=new GraphicalLabel(c,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);d.setLabelPositionAndShapeBorders(),e.LyricsDashes.push(d),d.PositionAndShape.Parent=e.PositionAndShape;const y=new PointF2D(s,o);return d.PositionAndShape.RelativePosition=y,d.PositionAndShape.RelativePosition.x-l.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex),r=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);for(let s=r;s<=e;s++){const o=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[s];this.dynamicExpressionMap.clear();for(let a=0;a=0;l--)if((a=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[l])!=null&&a.StaffEntries[r])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[l].StaffEntries[r]}getFirstRightNotNullStaffEntryFromContainer(e,r,s){var o,a;if((o=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e])!=null&&o.StaffEntries[r])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[e].StaffEntries[r];for(let l=e+1;l0||r.StaffLinkedExpressions[s][o].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(r.StaffLinkedExpressions[s][o],e,s)}}calculateStemDirectionFromVoices(e){if(e.ParentSourceStaffEntry.Link!==void 0)if(e===e.ParentSourceStaffEntry.VoiceEntries[0]){e.WantedStemDirection=StemDirectionType.Up;return}else{e.WantedStemDirection=StemDirectionType.Down;return}else e.ParentVoice instanceof LinkedVoice?e.WantedStemDirection=StemDirectionType.Down:e.ParentSourceStaffEntry.VoiceEntries.length>1&&(e.WantedStemDirection=StemDirectionType.Up)}setBeamNotesWantedStemDirections(e){if(!(e.Notes.length>0))return;const r=e.Notes[0].NoteBeam;if(r){for(const s of r.Notes)if(s.ParentVoiceEntry.WantedStemDirection!==StemDirectionType.Undefined&&s.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===e.ParentSourceStaffEntry.ParentStaff.Id){e.WantedStemDirection=s.ParentVoiceEntry.WantedStemDirection;break}}}}class InstrumentalGroup{constructor(e,r,s){this.instrumentalGroups=[],this.name=e,this.musicSheet=r,this.parent=s}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(e){this.name=e}get GetMusicSheet(){return this.musicSheet}}class Instrument extends InstrumentalGroup{constructor(e,r,s,o){super(void 0,s,o),this.Transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.playbackTranspose=0,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=e,this.idString=r,this.nameLabel=new Label(r)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(e){this.hasLyrics=e}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(e){this.hasChordSymbols=e}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(e){this.lyricVersesNumbers=e}get Name(){return this.nameLabel.text}set Name(e){this.nameLabel.text=e}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(e){this.subInstruments[0].midiInstrumentID=e}get Volume(){return this.subInstruments[0].volume}set Volume(e){for(let r=0,s=this.subInstruments.length;r0?this.Voices[0].Visible:!1}set Visible(e){for(let r=0,s=this.Voices.length;r-1&&this.parent.MusicSystems.splice(r,1)}this.parent=e,this.boundingBox.Parent=e.PositionAndShape}get NextSystem(){const e=this.Parent.MusicSystems.indexOf(this);return e!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[e+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(e,r,s){let o=-e/2;s&&(o=this.maxLabelLength+r-e/2);const a=this.staffLines[0].Measures[0];let l;this.staffLines.length>1&&(l=this.staffLines[this.staffLines.length-1].Measures[0]);const u=this.createSystemLine(o,e,SystemLinesEnum.SingleThin,SystemLinePosition.MeasureBegin,this,a,l);this.SystemLines.push(u),u.PositionAndShape.RelativePosition=new PointF2D(o,0),u.PositionAndShape.BorderLeft=0,u.PositionAndShape.BorderRight=e,u.PositionAndShape.BorderTop=u.PositionAndShape.Parent.BorderTop,u.PositionAndShape.BorderBottom=u.PositionAndShape.Parent.BorderBottom,this.createLinesForSystemLine(u)}createVerticalLineForMeasure(e,r,s,o,a,l){const u=l.ParentStaffLine,c=new PointF2D(u.PositionAndShape.RelativePosition.x,u.PositionAndShape.RelativePosition.y),d=u.ParentStaff.ParentInstrument.Staves;if(u.ParentStaff===d[0]){let y;d.length>1&&(y=this.getBottomStaffLine(u).Measures[a]);const m=this.createSystemLine(e,r,s,o,this,l,y),g=c.x+e;m.PositionAndShape.RelativePosition=new PointF2D(g,0),m.PositionAndShape.BorderLeft=0,m.PositionAndShape.BorderRight=r,this.SystemLines.push(m)}}setYPositionsToVerticalLineObjectsAndCreateLines(e){}calculateBorders(e){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(e){for(let r=0,s=e.length;r1){let l,u;for(let c=0,d=this.staffLines.length;cthis.maxLabelLength&&(this.maxLabelLength=y.PositionAndShape.Size.width,r=a)}this.updateMusicSystemStaffLineXPosition(r)}setMusicSystemLabelsYPosition(){this.labels.forEach((e,r)=>{let s=0,o=0;for(let a=0;a0&&(r.PositionAndShape.RelativePosition=new PointF2D(0,s/o+2))})}checkStaffEntriesForStaffEntryLink(){let e=!1,r=!1;for(let s=0;s=0;s--){if(r=e.InstrumentalGroups[s],r instanceof Instrument){if(r.Visible===!0)return r;continue}return this.findLastVisibleInstrumentInInstrumentalGroup(r)}}updateMusicSystemStaffLineXPosition(e){for(let r=0,s=this.StaffLines.length;r0){const a=(o=window.GYM)==null?void 0:o.multitrack;a&&a>1&&(hideTrackTune=!0)}else hideTrackTune=!1;const s=VexFlowConverter.TimeSignature(e);hideTrackTune||this.stave.addModifier(s,VF$7.StaveModifier.Position.BEGIN,{numerator:e.Rhythm.Numerator,denominator:e.Rhythm.Denominator}),(!this.ShowTimeSignature||this.isTabMeasure&&!this.rules.TabTimeSignatureRendered)&&(s.setStyle({fillStyle:"#00000000"}),s.hidden=!0),this.updateInstructionWidth()}addClefAtEnd(e,r=!0){const s=VexFlowConverter.Clef(e,"small");if(!(!r&&this.stave.endClef)){this.stave.setEndClef(s.type,s.size,s.annotation);for(const o of this.stave.getModifiers())if(r){const a=o.originalStrokeStyle,l=o.originalFillStyle;o.getStyle()&&(a&&l?(o.getStyle().strokeStyle=a,o.getStyle().fillStyle=l):(o.getStyle().strokeStyle=null,o.getStyle().fillStyle=null))}else if(o.getCategory()==="clefs"&&o.getPosition()===VF$7.StaveModifier.Position.END&&o.type===s.type){const a="#12345600",l=o.getStyle();l&&(o.originalStrokeStyle=l.strokeStyle,o.originalFillStyle=l.fillStyle),o.setStyle({strokeStyle:a,fillStyle:a})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(e,r,s=!0){switch(r){case SystemLinePosition.MeasureBegin:switch(e){case SystemLinesEnum.BoldThinDots:s||(this.stave.modifiers[0].draw=function(o){switch(o.checkContext(),this.setRendered(),this.type){case VF$7.Barline.type.SINGLE:this.drawVerticalBar(o,this.x,!1);break;case VF$7.Barline.type.DOUBLE:this.drawVerticalBar(o,this.x,!0);break;case VF$7.Barline.type.END:this.drawVerticalEndBar(o,this.x);break;case VF$7.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(o,this.x,!0);break;case VF$7.Barline.type.REPEAT_END:this.drawRepeatBar(o,this.x,!1);break;case VF$7.Barline.type.REPEAT_BOTH:this.drawRepeatBar(o,this.x,!1),this.drawRepeatBar(o,this.x,!0);break}}),this.stave.setBegBarType(VF$7.Barline.type.REPEAT_BEGIN);break}break;case SystemLinePosition.MeasureEnd:switch(e){case SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(VF$7.Barline.type.REPEAT_BOTH);break;case SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(VF$7.Barline.type.REPEAT_END);break;case SystemLinesEnum.DoubleThin:this.stave.setEndBarType(VF$7.Barline.type.DOUBLE);break;case SystemLinesEnum.ThinBold:this.stave.setEndBarType(VF$7.Barline.type.END);break;case SystemLinesEnum.None:this.stave.setEndBarType(VF$7.Barline.type.NONE);break}break}}addMeasureNumber(){const e=this.MeasureNumber.toString(),r=3;this.stave.setText(e,r,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(e){let r,s=VF$7.StaveModifier.Position.END;const o=this.beginInstructionsWidth;switch(e.type){case RepetitionInstructionEnum.Segno:r=VF$7.Repetition.type.SEGNO_LEFT,s=VF$7.StaveModifier.Position.LEFT;break;case RepetitionInstructionEnum.Coda:r=VF$7.Repetition.type.CODA_LEFT,s=VF$7.StaveModifier.Position.LEFT;break;case RepetitionInstructionEnum.DaCapo:r=VF$7.Repetition.type.DC;break;case RepetitionInstructionEnum.DalSegno:r=VF$7.Repetition.type.DS;break;case RepetitionInstructionEnum.Fine:r=VF$7.Repetition.type.FINE;break;case RepetitionInstructionEnum.ToCoda:r=VF$7.Repetition.type.TO_CODA;break;case RepetitionInstructionEnum.DaCapoAlFine:r=VF$7.Repetition.type.DC_AL_FINE;break;case RepetitionInstructionEnum.DaCapoAlCoda:r=VF$7.Repetition.type.DC_AL_CODA;break;case RepetitionInstructionEnum.DalSegnoAlFine:r=VF$7.Repetition.type.DS_AL_FINE;break;case RepetitionInstructionEnum.DalSegnoAlCoda:r=VF$7.Repetition.type.DS_AL_CODA;break}if(r){if(this.stave.getModifiers().find(c=>c.symbol_type===r))return;const u=new VF$7.Repetition(r,o,-this.rules.RepetitionSymbolsYOffset);u.xShiftAsPercentOfStaveWidth=this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth,this.stave.addModifier(u,s);return}this.addVolta(e)}addVolta(e){var s;let r=VF$7.Volta.type.BEGIN;if(e.type===RepetitionInstructionEnum.Ending){switch(e.alignment){case AlignmentType.Begin:this.parentSourceMeasure.endsRepetitionEnding()?r=VF$7.Volta.type.BEGIN_END:r=VF$7.Volta.type.BEGIN;break;case AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;r=VF$7.Volta.type.END;break}const o=this.ParentStaffLine.SkyBottomLineCalculator,a=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,l=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,a+.4),u=o.getSkyLineMinInRange(a,l)-2;let c=-6.1+this.rules.VoltaOffset,d=this.rules.VoltaOffset;if(u0){loglevelExports.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const m=this.createGhostGves(y);s.splice(l,0,...m),l+=m.length}}else{const y=Fraction$1.minus(c,this.parentSourceMeasure.AbsoluteTimestamp);if(y.RealValue>0){loglevelExports.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const m=this.createGhostGves(y);s.splice(0,0,...m),l+=m.length}}r=d}const o=Fraction$1.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),a=Fraction$1.minus(o,r);if(a.RealValue>0){loglevelExports.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const l=this.createGhostGves(a);s=s.concat(l)}return s}createGhostGves(e){const r=VexFlowConverter.GhostNotes(e),s=[];for(const o of r){const a=new VexFlowVoiceEntry(void 0,void 0,this.rules);a.vfStaveNote=o,s.push(a)}return s}handleBeam(e,r){const s=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let o=this.beams[s];o||(o=this.beams[s]=[]);let a;for(const u of o)u[0]===r&&(a=u);a||(a=[r,[]],o.push(a));const l=e.parentVoiceEntry;a[1].indexOf(l)<0&&a[1].push(l)}handleTuplet(e,r){const s=e.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;r=e.sourceNote.NoteTuplet;let o=this.tuplets[s];o||(o=this.tuplets[s]=[]);let a;for(const u of o)u[0]===r&&(a=u);a||(a=[r,[]],o.push(a));const l=e.parentVoiceEntry;a[1].indexOf(l)<0&&a[1].push(l)}finalizeBeams(){if(this.vfbeams={},this.isTabMeasure&&!this.rules.TabBeamsRendered)return;const e=[];for(const r in this.beams)if(this.beams.hasOwnProperty(r)){let s=this.vfbeams[r];s||(s=this.vfbeams[r]=[]);for(const o of this.beams[r]){let a=!1;for(const v of o[0].Notes)if(v.Length.RealValue>=new Fraction$1(1,4).RealValue&&(!v.TypeLength||v.TypeLength.RealValue>.125)){a=!0;break}if(a){loglevelExports.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const l=[],u=o[0],c=o[1];let d=!0;for(const v of c)v.parentVoiceEntry.ParentVoice===u.Notes[0].ParentVoiceEntry.ParentVoice&&(d=v.parentVoiceEntry.WantedStemDirection===StemDirectionType.Undefined);let y=!1,m;const g=[];for(const v of c){const b=v.vfStaveNote;b&&(l.push(b),e.push(b)),v.parentVoiceEntry.IsGrace&&(y=!0),v.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&g.push(v.parentVoiceEntry.StemColor)}if(l.length>1){const v=new VF$7.Beam(l,d);if(y&&(v.render_options.beam_width=3,v.render_options.partial_beam_length=4),g.length>=2&&this.rules.ColorBeams){m=g[0];for(const b of g)if(b!==m){m=void 0;break}v.setStyle({fillStyle:m,strokeStyle:m})}this.rules.FlatBeams&&(v.render_options.flat_beams=!0,v.render_options.flat_beam_offset=this.rules.FlatBeamOffset,v.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),s.push(v)}else loglevelExports.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(e)}autoBeamNotes(e){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let r=60,s=[],o=[],a,l=[];this.autoTupletVfBeams=[];const u=[];this.autoVfBeams=[];let c=this.parentSourceMeasure.ActiveTimeSignature;c||(c=this.parentSourceMeasure.Duration);for(const m of this.staffEntries)for(const g of m.graphicalVoiceEntries){const v=g.vfStaveNote,b=g.notes[0],S={vfStaveNote:v,sourceNote:b.sourceNote},x=m.relInMeasureTimestamp.isOnBeat(c),A=o.length>=2,E=b.sourceNote.Length.RealValue-new Fraction$1(1,4).RealValue>-Fraction$1.FloatInaccuracyTolerance,w=g.parentVoiceEntry.IsGrace||E||e.contains(v);if(w||x){if(A){for(const T of o)s.push(T);u.push(s.slice()),s=[]}if(o=[],w)continue}const _=g.notes[0].sourceNote.NoteTuplet;if(_){let T=!1;for(const C of _.Notes){for(const P of C)if(P.NoteTypeXml>=NoteType.QUARTER||P.ParentVoiceEntry.IsGrace||P.isRest()&&!this.rules.AutoBeamOptions.beam_rests){T=!0;break}if(T)break}if(!a)a=_;else if(a!==_){if(l.length>1){const C=[];for(const M of l)C.push(M.vfStaveNote);const P=new VF$7.Beam(C,!0);this.rules.FlatBeams&&(P.render_options.flat_beams=!0,P.render_options.flat_beam_offset=this.rules.FlatBeamOffset,P.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(P);const k=new Beam(r++);k.AutoGenerated=!0;for(const M of l)k.addNoteToBeam(M.sourceNote)}l=[],a=_}T||l.push(S);continue}else a=void 0;o.push(S)}if(l.length>=2){const m=[];for(const b of l)m.push(b.vfStaveNote);const g=new VF$7.Beam(m,!0);this.rules.FlatBeams&&(g.render_options.flat_beams=!0,g.render_options.flat_beam_offset=this.rules.FlatBeamOffset,g.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(g);const v=new Beam(r++);v.AutoGenerated=!0;for(const b of l)v.addNoteToBeam(b.sourceNote)}if(o.length>=2){for(const m of o)s.push(m);u.push(s)}const d=this.rules.AutoBeamOptions,y={beam_middle_only:d.beam_middle_rests_only,beam_rests:d.beam_rests,maintain_stem_directions:d.maintain_stem_directions};if(d.groups&&d.groups.length){const m=[];for(const g of d.groups)m.push(new VF$7.Fraction(g[0],g[1]));y.groups=m}for(const m of u){const g=[];for(const b of m)g.push(b.vfStaveNote);const v=VF$7.Beam.generateBeams(g,y);for(const b of v)this.rules.FlatBeams&&(b.render_options.flat_beams=!0,b.render_options.flat_beam_offset=this.rules.FlatBeamOffset,b.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(b)}}finalizeTuplets(){this.vftuplets={};for(const e in this.tuplets)if(this.tuplets.hasOwnProperty(e)){let r=this.vftuplets[e];r||(r=this.vftuplets[e]=[]);for(const s of this.tuplets[e]){const o=[],a=s[1];for(const l of a)o.push(l.vfStaveNote);if(o.length>1){const l=s[0],u=l.Notes[0][0].NormalNotes,c=l.shouldBeBracketed(this.rules.TupletsBracketedUseXMLValue,this.rules.TupletsBracketed,this.rules.TripletsBracketed,this.isTabMeasure,this.rules.TabTupletsBracketed);let d=VF$7.Tuplet.LOCATION_TOP;l.tupletLabelNumberPlacement===PlacementEnum.Below&&(d=VF$7.Tuplet.LOCATION_BOTTOM);let y=0;if(this.isTabMeasure&&(y=this.rules.TabTupletYOffsetBottom*10,d===VF$7.Tuplet.LOCATION_TOP)){y=this.rules.TabTupletYOffsetTop*-10;const g=l.Notes[0][0];g!=null&&g.hasTabEffects()&&(y-=this.rules.TabTupletYOffsetEffects*10)}const m=new VF$7.Tuplet(o,{bracketed:c,location:d,notes_occupied:u,num_notes:l.TupletLabelNumber,ratioed:this.rules.TupletsRatioed,y_offset:y});r.push(m)}else loglevelExports.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(e){}graphicalMeasureCreatedCalculations(){let e,r=[];const s=[];for(const a of this.staffEntries){e=!1,r=[];for(const l of a.graphicalVoiceEntries){if(l.parentVoiceEntry.IsGrace){r.push(l),s.push(l),e||(e=l.parentVoiceEntry.GraceSlur);continue}if(l.vfStaveNote=VexFlowConverter.StaveNote(l),r.length>0){const u=[];for(let d=0;d0&&(y.GraceSlash=!1);const m=VexFlowConverter.StaveNote(y);y.vfStaveNote=m,u.push(m)}const c=new VF$7.GraceNoteGroup(u,e);c.spacing=this.rules.GraceNoteGroupXMargin*10,l.vfStaveNote.addModifier(0,c),r=[]}}}if(r.length>0)for(const a of r)a.vfStaveNote=VexFlowConverter.StaveNote(a),a.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const o=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const a of this.staffEntries)a.setModifierXOffsets();for(const a of o){if(!a)continue;this.vfVoices[a.VoiceId]=new VF$7.Voice({beat_value:this.parentSourceMeasure.ActiveTimeSignature.Denominator,num_beats:this.parentSourceMeasure.ActiveTimeSignature.Numerator,resolution:VF$7.RESOLUTION}).setMode(VF$7.Voice.Mode.SOFT);const l=this.getRestFilledVexFlowStaveNotesPerVoice(a);for(const u of l){if(u.parentVoiceEntry&&u.parentVoiceEntry.IsGrace&&!u.parentVoiceEntry.GraceAfterMainNote)continue;const c=u;if(c.vfStaveNote.getTicks().denominator===0&&(c.vfStaveNote.getTicks().denominator=1),u.notes.length===0||!u.notes[0]||!u.notes[0].sourceNote.PrintObject){this.vfVoices[a.VoiceId].addTickable(c.vfStaveNote);continue}const d=c.parentStaffEntry;if(d&&d.vfClefBefore){const y=new NoteSubGroup([d.vfClefBefore]);c.vfStaveNote.getCategory&&c.vfStaveNote.getCategory()==="stavenotes"&&c.vfStaveNote.addModifier(0,y)}u.parentVoiceEntry&&this.rules.RenderFingerings&&((this.rules.FingeringPosition===PlacementEnum.Left||this.rules.FingeringPosition===PlacementEnum.Right)&&this.createFingerings(u),this.createStringNumber(u)),this.createArpeggio(u),this.vfVoices[a.VoiceId].addTickable(c.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const a of s)this.createFingerings(a),this.createStringNumber(a),this.createArpeggio(a);this.createArticulations(),this.createOrnaments()}createArpeggio(e){if(e.parentVoiceEntry&&e.parentVoiceEntry.Arpeggio){const r=e.parentVoiceEntry.Arpeggio;if(e.notes&&e.notes.length>1){const s=VexFlowConverter.StrokeTypeFromArpeggioType(r.type),o=new VF$7.Stroke(s,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&e.vfStaveNote.addStroke(0,o)}else loglevelExports.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const e of this.staffEntries)for(const r of e.graphicalVoiceEntries)for(const s of r.notes){const o=s.vfnote;if(!o||!o[0])continue;switch(o[0].getStemDirection()){case VF$7.Stem.UP:r.parentVoiceEntry.StemDirection=StemDirectionType.Up;break;case VF$7.Stem.DOWN:r.parentVoiceEntry.StemDirection=StemDirectionType.Down;break}}}createArticulations(){for(let e=0,r=this.staffEntries.length;es){for(const l of e.notes)if(!l.sourceNote.Fingering&&(l.sourceNote.Fingering=o.pop(),s++,o.length===0))break}let a=-1;for(const l of e.notes){const u=l.sourceNote.Fingering;if(!u){a++;continue}a++;let c=this.rules.FingeringPosition;this.rules.FingeringPositionGrace===PlacementEnum.AboveOrBelow&&(this.isUpperStaffOfInstrument()?c=PlacementEnum.Above:this.isLowerStaffOfInstrument()&&(c=PlacementEnum.Below)),u.placement!==PlacementEnum.NotYetDefined&&(c=u.placement);let d=this.rules.FingeringOffsetX,y;switch(c){default:case PlacementEnum.Left:y=VF$7.StaveModifier.Position.LEFT,d-=l.baseFingeringXOffset*unitInPixels;break;case PlacementEnum.Right:y=VF$7.StaveModifier.Position.RIGHT,d+=l.baseFingeringXOffset*unitInPixels;break;case PlacementEnum.Above:y=VF$7.StaveModifier.Position.ABOVE;break;case PlacementEnum.Below:y=VF$7.StaveModifier.Position.BELOW;break;case PlacementEnum.NotYetDefined:const g=e.parentStaffEntry.sourceStaffEntry.ParentStaff;e.notes.length>1||e.parentStaffEntry.graphicalVoiceEntries.length>1?y=VF$7.StaveModifier.Position.LEFT:g.idInMusicSheet===0?(y=VF$7.StaveModifier.Position.ABOVE,c=PlacementEnum.Above):(y=VF$7.StaveModifier.Position.BELOW,c=PlacementEnum.Below)}const m=new VF$7.FretHandFinger(u.value);if(m.setPosition(y),m.setOffsetX(d),c===PlacementEnum.Above||c===PlacementEnum.Below){const g=c===PlacementEnum.Above?-1:1,v=c===PlacementEnum.Above?a:s-1-a;if(this.rules.FingeringInsideStafflines&&s>1){const b=m.getWidth()/2,S=s*2.5;m.setOffsetY(g*(v+S)*b)}else if(!this.rules.FingeringInsideStafflines){const b=new VF$7.StringNumber(u.value);b.radius=0,b.setPosition(y),b.setOffsetY(g*v*b.getWidth()*2/3),r.vfStaveNote.addModifier(a,b);continue}}r.vfStaveNote.addModifier(a,m)}}createStringNumber(e){if(!this.rules.RenderStringNumbersClassical)return;const r=e;e.notes.forEach((s,o)=>{const a=s.sourceNote.StringInstruction;if(a){let l=a.value;switch(l){case"1":l="I";break;case"2":l="II";break;case"3":l="III";break;case"4":l="IV";break;case"5":l="V";break;case"6":l="VI";break}const u=new VF$7.StringNumber(l);u.radius=0;const c=-this.rules.StringNumberOffsetY;e.notes.length>1||e.parentStaffEntry.graphicalVoiceEntries.length>1?(u.setOffsetX(s.baseStringNumberXOffset*13),u.setPosition(VF$7.Modifier.Position.RIGHT)):u.setPosition(VF$7.Modifier.Position.ABOVE),u.setOffsetY(c),r.vfStaveNote.addModifier(o,u)}})}lineTo(e,r){const s=new VF$7.StaveConnector(e.getVFStave(),this.stave);s.setType(r),this.connectors.push(s)}getVFStave(){return this.stave}updateInstructionWidth(){let e=0,r=0;const s=this.stave.getModifiers();for(const o of s)o.getPosition()===5?e+=o.getWidth()+o.getPadding(void 0):o.getPosition()===6&&(r+=o.getWidth()+o.getPadding(void 0));this.beginInstructionsWidth=(e!=null?e:0)/unitInPixels,this.endInstructionsWidth=(r!=null?r:0)/unitInPixels}addStaveTie(e,r){this.vfTies.push(e),r.vfTie=e,r.Tie.TieDirection===PlacementEnum.Below&&e.setDirection(1)}}class GraphicalStaffEntry extends GraphicalObject{constructor(e,r=void 0,s=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=e,this.graphicalVoiceEntries=[],this.sourceStaffEntry=r,s?(this.staffEntryParent=s,this.parentVerticalContainer=s.parentVerticalContainer,this.PositionAndShape=new BoundingBox$1(this,s.PositionAndShape)):this.PositionAndShape=new BoundingBox$1(this,e.PositionAndShape),r&&(this.relInMeasureTimestamp=r.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(e){this.lyricsEntries=e}getAbsoluteTimestamp(){const e=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&e.Add(this.relInMeasureTimestamp),e}findTieGraphicalNoteFromNote(e){var s;const r=((s=window.GYM)==null?void 0:s.graceCustom)||!1;for(const o of this.graphicalVoiceEntries)for(const a of o.notes){const l=a.sourceNote;if(r){if(e.NoteToGraphicalNoteObjectId==l.NoteToGraphicalNoteObjectId)return a}else if(!l.isRest()&&l.Pitch.FundamentalNote===e.Pitch.FundamentalNote&&l.Pitch.Octave===e.Pitch.Octave&&l.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return a}}findEndTieGraphicalNoteFromNoteWithStartingSlur(e,r){if(e){for(const s of this.graphicalVoiceEntries)if(s.parentVoiceEntry===e.ParentVoiceEntry)for(const o of s.notes){const a=o.sourceNote;if(a.NoteTie&&a.NoteSlurs.indexOf(r)!==-1)return o}}}findGraphicalNoteFromGraceNote(e){if(e){for(const r of this.graphicalVoiceEntries)if(r.parentVoiceEntry===e.ParentVoiceEntry){for(const s of r.notes)if(s.sourceNote===e)return s}}}findGraphicalNoteFromNote(e){if(e){for(const r of this.graphicalVoiceEntries)if(r.parentVoiceEntry===e.ParentVoiceEntry){for(const s of r.notes)if(s.sourceNote===e&&this.getAbsoluteTimestamp().Equals(e.getAbsoluteTimestamp()))return s}}}getGraphicalNoteDurationFromVoice(e){for(const r of this.graphicalVoiceEntries)if(r.parentVoiceEntry.ParentVoice===e)return r.notes[0].graphicalNoteLength;return new Fraction$1(0,1)}findVoiceEntryGraphicalNotes(e){for(const r of this.graphicalVoiceEntries)if(r.parentVoiceEntry===e)return r.notes}isVoiceEntryPartOfLinkedVoiceEntry(e){if(this.sourceStaffEntry.Link)for(let r=0,s=this.sourceStaffEntry.Link.LinkStaffEntries.length;r0&&(e=o)}return e}findStaffEntryMaxNoteLength(){let e=new Fraction$1(0,1);for(const r of this.graphicalVoiceEntries)for(const s of r.notes){const o=s.graphicalNoteLength;e.lt(o)&&o.GetExpandedNumerator()>0&&(e=o)}return e}findOrCreateGraphicalVoiceEntry(e){for(const s of this.graphicalVoiceEntries)if(s.parentVoiceEntry===e)return s;const r=MusicSheetCalculator.symbolFactory.createVoiceEntry(e,this);return this.graphicalVoiceEntries.push(r),r}findOrCreateGraphicalVoiceEntryFromGraphicalNote(e){for(const s of this.graphicalVoiceEntries)if(s===e.parentVoiceEntry)return s;const r=MusicSheetCalculator.symbolFactory.createVoiceEntry(e.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(r),r}addGraphicalNoteToListAtCorrectYPosition(e,r){const s=e.notes;if(s.length===0||r.PositionAndShape.RelativePosition.y=0;o--){if(s[o].PositionAndShape.RelativePosition.y>r.PositionAndShape.RelativePosition.y){s.splice(o+1,0,r);break}if(o===0){s.splice(0,0,r);break}}}hasOnlyRests(){return this.sourceStaffEntry.hasOnlyRests}getSkylineMin(){var o;const e=(o=this.parentMeasure)==null?void 0:o.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[r,s]=this.getAbsoluteStartAndEnd();return e.getSkyLineMinInRange(r,s)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var o;const e=(o=this.parentMeasure)==null?void 0:o.ParentStaffLine.SkyBottomLineCalculator;if(!e)return;const[r,s]=this.getAbsoluteStartAndEnd();return e.getBottomLineMaxInRange(r,s)}getAbsoluteStartAndEnd(){let e=this.PositionAndShape.AbsolutePosition.x;e-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x;const r=e+this.PositionAndShape.Size.width;return[e,r]}}class VexFlowStaffEntry extends GraphicalStaffEntry{constructor(e,r,s){super(e,r,s)}calculateXPosition(){const e=this.parentMeasure.getVFStave();let r=0;for(const s of this.graphicalVoiceEntries)if(s.vfStaveNote){if(s.vfStaveNote.setStave(e),!s.vfStaveNote.preFormatted)continue;s.applyBordersFromVexflow();let o=!1,a=this.PositionAndShape;s.notes[0].sourceNote.isWholeRest()&&!this.hasOnlyRests()&&(o=!0,a=s.PositionAndShape),this.parentMeasure.ParentStaff.isTab?a.RelativePosition.x=(s.vfStaveNote.getAbsoluteX()+s.vfStaveNote.glyph.getWidth())/unitInPixels:(a.RelativePosition.x=s.vfStaveNote.getBoundingBox().getX()/unitInPixels,o&&(a.RelativePosition.x-=e.getNoteStartX()/unitInPixels,a.RelativePosition.x-=1.3));const l=s.notes[0].sourceNote;l.isRest()&&l.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(a.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,s.PositionAndShape.BorderLeft=-.7,s.PositionAndShape.BorderRight=.7),s.PositionAndShape.BorderLefta.staffLine),s=this.calculateModifierXOffsets(r,1),o=this.calculateModifierXOffsets(r,.5);e.forEach((a,l)=>{a.baseFingeringXOffset=o[l],a.baseStringNumberXOffset=s[l]})}calculateModifierXOffsets(e,r){const s=[];for(let o=0;o=0;u--){if(Math.abs(e[o]-e[u])<=r&&a===s[u]){a++,l=!0;break}l=!1}s.push(a)}return s}}class VexFlowGraphicalNote extends GraphicalNote{constructor(e,r,s,o=OctaveEnum.NONE,a,l=void 0){if(super(e,r,a,l),this.clef=s,this.octaveShift=o,e.Pitch){const u=e.isRest()?e.Pitch:OctaveShift.getPitchFromOctaveShift(e.Pitch,o);this.vfpitch=VexFlowConverter.pitch(u,e.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(e){const r=this.drawPitch(e);this.vfpitch=VexFlowConverter.pitch(r,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=r.Accidental}drawPitch(e){return OctaveShift.getPitchFromOctaveShift(e,this.octaveShift)}Transpose(e,r,s,o){const a=super.Transpose(e,r,s,o),l=OctaveShift.getPitchFromOctaveShift(a,this.octaveShift);return this.vfpitch=VexFlowConverter.pitch(l,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,l}setIndex(e,r){this.vfnote=[e,r],this.vfnoteIndex=r}notehead(e=void 0){let r=e;r||(r=this.vfnote[0]);const s=r.note_heads;return s&&s.length>this.vfnoteIndex&&s[this.vfnoteIndex]?r.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const e=[];for(let r=0;;r++){const s=document.getElementById(`vf-${this.getSVGId()}-beam${r}`);if(!s)break;e.push(s)}return e}}class GraphicalChordSymbolContainer extends GraphicalObject{constructor(e,r,s,o,a,l){super(),this.chordSymbolContainer=e,this.boundingBox=new BoundingBox$1(this,r),this.rules=l,this.calculateLabel(s,a,o)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(e,r,s){const o=ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,r,s);this.graphicalLabel=new GraphicalLabel(new Label(o),e,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}const VF$6=Vex.Flow;class VexFlowTabMeasure extends VexFlowMeasure{constructor(e,r=void 0,s=void 0){super(e,r,s),this.isTabMeasure=!0}resetLayout(){var r;const e=(r=this.ParentStaff.StafflineCount)!=null?r:6;this.stave=new VF$6.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:e}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let r=0,s=this.staffEntries.length;r1){const u=VexFlowConverter.StrokeTypeFromArpeggioType(l.type),c=new VF$6.Stroke(u,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&a.vfStaveNote.addStroke(0,c)}else loglevelExports.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}if(a.vfGhostNotes)for(const l of a.vfGhostNotes)this.vfVoices[r.VoiceId].addTickable(l);else this.vfVoices[r.VoiceId].addTickable(a.vfStaveNote)}}}}class StaffLineActivitySymbol extends GraphicalObject{constructor(e){super(),this.parentStaffLine=e;const r=e.PositionAndShape;this.boundingBox=new BoundingBox$1(this,r),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}class StaffLine extends GraphicalObject{constructor(e,r){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.graphicalGlissandi=[],this.Pedals=[],this.WavyLines=[],this.parentMusicSystem=e,this.parentStaff=r,this.boundingBox=new BoundingBox$1(this,e.PositionAndShape),this.skyBottomLine=MusicSheetCalculator.symbolFactory.createSkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)switch(this.ParentStaff.StafflineCount){case 5:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*6;break;default:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;break}else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2;break}}get Measures(){return this.measures}set Measures(e){this.measures=e}get StaffLines(){return this.staffLines}set StaffLines(e){this.staffLines=e}get Index(){return this.parentMusicSystem.StaffLines.indexOf(this)}get NextStaffLine(){const e=this.Index;return e!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[e+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(e){this.abstractExpressions=e}set LyricLines(e){this.lyricLines=e}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(e){this.lyricsDashes=e}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(e){this.parentMusicSystem=e}get ParentStaff(){return this.parentStaff}set ParentStaff(e){this.parentStaff=e}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(e){this.octaveShifts=e}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}get GraphicalGlissandi(){return this.graphicalGlissandi}addSlurToStaffline(e){this.graphicalSlurs.push(e)}addGlissandoToStaffline(e){this.graphicalGlissandi.push(e),e.StaffLine=this}addActivitySymbolClickArea(){const e=new StaffLineActivitySymbol(this),r=this.PositionAndShape;e.PositionAndShape.RelativePosition=new PointF2D(r.RelativePosition.x+r.BorderRight+.5,r.RelativePosition.y+.5),e.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(e){let r;for(let s=0,o=this.Measures.length;s0){const c=u.map(g=>g.PositionAndShape.Center.y),d=Math.max(...c),y=((a=window.GYM)==null?void 0:a.noNeedContinuousDynamic)||!1,m=((l=window.GYM)==null?void 0:l.noNeedGraphicalContinuousDynamic)||!1;for(let g=0;g0?u[g-1]:void 0;if(S){const A=this.getOverlap(v.PositionAndShape,S.PositionAndShape);v.squeeze(-(A.x+this.rules.DynamicExpressionSpacer))}if(x){const A=this.getOverlap(x.PositionAndShape,v.PositionAndShape);v.squeeze(A.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(e,r){const s=e.RelativePosition.x+e.BorderMarginRight,o=r.RelativePosition.x+r.BorderMarginLeft,a=e.RelativePosition.y+e.BorderMarginBottom,l=r.RelativePosition.y+r.BorderMarginTop;return new PointF2D(o-s,l-a)}getOverlap(e,r){return new PointF2D(e.RelativePosition.x+e.BorderMarginRight-(r.RelativePosition.x+r.BorderMarginLeft),e.RelativePosition.y+e.BorderMarginBottom-(r.RelativePosition.y+r.BorderMarginTop))}}class VexFlowStaffLine extends StaffLine{constructor(e,r){super(e,r),this.slursInVFStaffLine=[],this.alignmentManager=new AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(e){this.slursInVFStaffLine.push(e)}get AlignmentManager(){return this.alignmentManager}}const VF$5=Vex.Flow;class VexFlowMultiRestMeasure extends VexFlowMeasure{constructor(e,r=void 0,s=void 0){super(e,r,s),this.minimumStaffEntriesWidth=-1,s?this.rules=s.ParentMusicSystem.rules:r&&(this.rules=r.Rules),this.resetLayout(),this.multiRestElement=new VF$5.MultiMeasureRest(r.multipleRestMeasures,{})}draw(e){var a,l,u,c,d,y;const r=e.openGroup();(a=r==null?void 0:r.classList)==null||a.add("vf-measure"),r==null||r.setAttribute("data-num",String((l=this==null?void 0:this.parentSourceMeasure)==null?void 0:l.MeasureNumberXML));const s=e.openGroup();(u=s==null?void 0:s.classList)==null||u.add("vf-stave"),s==null||s.setAttribute("id",(d=(c=this.stave)==null?void 0:c.attrs)==null?void 0:d.id),this.stave.setContext(e).draw(),e.closeGroup();const o=e.openGroup();(y=o==null?void 0:o.classList)==null||y.add("vf-voices"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(e),this.multiRestElement.draw(),e.closeGroup();for(const m of this.connectors)m.setContext(e).draw();return e.closeGroup(),r}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(e){return[]}getRestFilledVexFlowStaveNotesPerVoice(e){return[]}handleBeam(e,r){}handleTuplet(e,r){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(e){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(e){}getVFStave(){return this.stave}}class SkyBottomLineCalculationResult{constructor(e,r){this.skyLine=e,this.bottomLine=r}}const VF$4=Vex.Flow;class CanvasVexFlowBackend extends VexFlowBackend{constructor(e){super(),this.rules=e}getVexflowBackendType(){return VF$4.Renderer.Backends.CANVAS}getOSMDBackendType(){return BackendType.Canvas}getCanvasSize(){var e;return(e=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))==null?void 0:e.offsetHeight}initialize(e,r){this.zoom=r,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),e.appendChild(this.inner),this.renderer=new VF$4.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(e=300,r=300){this.graphicalMusicPage||(this.graphicalMusicPage=new GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=r,this.renderer=new VF$4.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}free(){this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas,this.canvas=null)}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(e){this.ctx.scale(e,e)}translate(e,r){this.CanvasRenderingCtx.translate(e,r)}renderText(e,r,s,o,a,l,u=void 0,c=void 0){const d=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=VexFlowConverter.font(e,r,s,this.rules,c),this.CanvasRenderingCtx.fillStyle=u,this.CanvasRenderingCtx.strokeStyle=u,this.CanvasRenderingCtx.fillText(o,l.x,l.y+a),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=d}renderRectangle(e,r,s,o=1){const a=this.CanvasRenderingCtx.fillStyle;s?this.CanvasRenderingCtx.fillStyle=s:this.CanvasRenderingCtx.fillStyle=VexFlowConverter.style(r),this.CanvasRenderingCtx.globalAlpha=o,this.ctx.fillRect(e.x,e.y,e.width,e.height),this.CanvasRenderingCtx.fillStyle=a,this.CanvasRenderingCtx.globalAlpha=1}renderLine(e,r,s="#FF0000FF",o=2,a){const l=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=s,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(e.x,e.y),this.CanvasRenderingCtx.lineTo(r.x,r.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=l}renderCurve(e){this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),this.ctx.lineTo(e[7].x,e[7].y),this.ctx.bezierCurveTo(e[6].x,e[6].y,e[5].x,e[5].y,e[4].x,e[4].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.closePath(),this.ctx.fill()}renderPath(e,r=!0,s){this.ctx.beginPath();let o;for(const a of e){if(!o){this.ctx.moveTo(a.x,a.y),o=a;continue}this.ctx.lineTo(a.x,a.y)}this.ctx.closePath(),r?this.ctx.fill():this.ctx.stroke()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}class SkyBottomLineCalculator{constructor(e){this.mStaffLineParent=e,this.mRules=e.ParentMusicSystem.rules}updateLines(e){const r=this.StaffLineParent.Measures;if(e.length!==r.length)if(loglevelExports.warn("SkyBottomLineCalculator: lengths of calculation result array and measure array do not match"),e.length(d-u)/unitInPixels+this.StaffLineParent.TopLineOffset);const c=Math.min(...this.mBottomLine);this.mBottomLine=this.mBottomLine.map(d=>(d-c)/unitInPixels+this.StaffLineParent.BottomLineOffset)}calculateLines(){const e=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];const r=new CanvasVexFlowBackend(this.StaffLineParent.ParentMusicSystem.rules);for(const l of this.StaffLineParent.Measures){l.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const u=l.getVFStave();let c=u.getWidth();if(!(c>0)&&!l.IsExtraGraphicalMeasure&&(loglevelExports.warn("SkyBottomLineCalculator: width not > 0 in measure "+l.MeasureNumber),c=50),!(c>=50)&&l.IsExtraGraphicalMeasure)continue;r.initializeHeadless(c);const d=r.getContext(),y=r.getCanvas();c=y.width;const m=y.height;this.mRules.DYMusicScoreType==="jianpu"||u.setY(u.y+100);const g=u.getWidth();u.setWidth(c),l.format(),u.setWidth(g);try{l.draw(d)}catch(E){loglevelExports.warn("SkyBottomLineCalculator.calculateLines.draw",E)}const v=d.getImageData(0,0,c,m),b=4,S=Math.max(Math.ceil(l.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),x=new Array(S),A=new Array(S);for(let E=0;E0){x[E]=w;break}}for(let w=m;w>0;w--){const T=w*c*b+E*b;if(v.data[T+3]>0){A[E]=w;break}}}for(let E=0;E(l-Math.max(...this.mSkyLine))/unitInPixels+this.StaffLineParent.TopLineOffset),this.mBottomLine=this.mBottomLine.map(l=>(l-Math.min(...this.mBottomLine))/unitInPixels+this.StaffLineParent.BottomLineOffset)}updateSkyLineWithLine(e,r,s){const o=Math.floor(e.x*this.SamplingUnit),a=Math.ceil(r.x*this.SamplingUnit);for(let l=o+1;l=this.BottomLine.length&&(s=this.BottomLine.length-1),o<0&&(o=0),o>=this.BottomLine.length&&(o=this.BottomLine.length),this.SkyLine[s]=e.y;for(let l=s+1;l=this.BottomLine.length&&(s=this.BottomLine.length-1),o<0&&(o=0),o>=this.BottomLine.length&&(o=this.BottomLine.length),this.BottomLine[s]=e.y;for(let l=s+1;le)}setBottomLineWithValue(e){this.BottomLine.forEach(r=>e)}getLeftIndexForPointX(e,r){const s=Math.floor(e*this.SamplingUnit);return s<0?0:s>=r?r-1:s}getRightIndexForPointX(e,r){const s=Math.ceil(e*this.SamplingUnit);return s<0?0:s>=r?r-1:s}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter(e=>!isNaN(e)))}getSkyLineMinAtPoint(e){const r=Math.round(e*this.SamplingUnit);return this.mSkyLine[r]}getSkyLineMinInRange(e,r){return this.getMinInRange(this.SkyLine,e,r)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(e=>!isNaN(e)))}getBottomLineMaxAtPoint(e){const r=Math.round(e*this.SamplingUnit);return this.mBottomLine[r]}getBottomLineMaxInRange(e,r){return this.getMaxInRange(this.BottomLine,e,r)}getBottomLineMaxInBoundingBox(e){const r=Math.floor(e.AbsolutePosition.x+e.BorderLeft),s=Math.ceil(e.AbsolutePosition.x+e.BorderRight);return this.getMaxInRange(this.mBottomLine,r,s)}updateWithBoundingBoxRecursively(e){if(e.ChildElements&&e.ChildElements.length>0)for(const r of e.ChildElements)this.updateWithBoundingBoxRecursively(r);else{const r=e.BorderTop+e.AbsolutePosition.y,s=e.BorderBottom+e.AbsolutePosition.y;if(r<0){const o=Math.floor(e.AbsolutePosition.x+e.BorderLeft),a=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mSkyLine,o,a,r)}else if(s>this.StaffLineParent.StaffHeight){const o=Math.floor(e.AbsolutePosition.x+e.BorderLeft),a=Math.ceil(e.AbsolutePosition.x+e.BorderRight);this.updateInRange(this.mBottomLine,o,a,s)}}}findPreviousValidNumber(e,r){for(let s=e;s>=0;s--)if(!isNaN(r[s]))return r[s];return 0}findNextValidNumber(e,r){if(e>=r.length)return r[e-1];for(let s=e;se.length&&(s=e.length);for(let a=r;aMath.abs(e[a])?o:e[a]}setInRange(e,r=0,s=e.length,o=0){if(r=Math.floor(r*this.SamplingUnit),s=Math.ceil(s*this.SamplingUnit),se.length&&(s=e.length);for(let a=r;a=e.length&&(r=e.length-1),s<0&&(s=0),s>=e.length&&(s=e.length),r>=0&&s<=e.length)return Math.min(...e.slice(r,s+1))}getMaxInRange(e,r,s){if(r=Math.floor(r*this.SamplingUnit),s=Math.ceil(s*this.SamplingUnit),!e)return Number.MIN_VALUE;if(r<0&&(r=0),r>=e.length&&(r=e.length-1),s<0&&(s=0),s>=e.length&&(s=e.length),r>=0&&s<=e.length)return Math.max(...e.slice(r,s+1))}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}var parserExports$1={},parser$2={get exports(){return parserExports$1},set exports(i){parserExports$1=i}};/*! * d-path-parser - v1.0.0 * by Massimo Artizzu (MaxArt2501) * * https://github.com/MaxArt2501/d-path-parser * * Licensed under the MIT License * See LICENSE for details */(function(i,e){(function(r,s){i.exports=s()})(commonjsGlobal,function(){return function(s){for(var o={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},a={number:function(S){return+v("number",S)},"coordinate pair":function(S){var x=v("number",S);if(x===null&&!S)return null;v("comma");var A=v("number",!0);return{x:+x,y:+A}},"arc definition":function(S){var x=a["coordinate pair"](S);if(!x&&!S)return null;v("comma");var A=+v("number",!0);v("comma",!0);var E=!!+v("flag",!0);v("comma");var w=!!+v("flag",!0);v("comma");var _=a["coordinate pair"](!0);return{radii:x,rotation:A,large:E,clockwise:w,end:_}}},l=0,u=[];lr.bottom)switch(e.tagName.toLowerCase()){case"g":for(const g of e.children)this.recursiveUpdate(g,r,s,o);break;case"circle":case"rect":case"line":case"path":let y=Math.floor((a.x-s.x)/unitInPixels*this.mRules.SamplingUnit);const m=y+Math.ceil(a.width/unitInPixels*this.mRules.SamplingUnit);if(e.parentElement.classList.contains("vf-beams")&&e.hasAttribute("d")){const g=parserExports$1(e.getAttribute("d"));if(g.length===5){const v=g[0],b=g[3],S=(b.end.y-v.end.y)/(b.end.x-v.end.x);let x=v.end.y/unitInPixels;for(y;y<=m;y++)xd[y]&&(d[y]=x),x+=S/this.mRules.SamplingUnit}}else for(y;y<=m;y++)ld[y]&&(d[y]=u);break}}calculateLinesForMeasure(e,r){var C,P,k;const s=r.getBBox(),o=Math.max(Math.round(e.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),a=s.height/unitInPixels,u=r.getElementsByClassName("vf-stave")[0].getBBox();let c=(u==null?void 0:u.height)/unitInPixels,d=(u==null?void 0:u.y)/unitInPixels;const y=e.getVFStave();let m=((C=y.options)!=null&&C.num_lines?y.options.num_lines:5)-1,g=-1,v=0;const b=[m];for(const M of(P=y.options)==null?void 0:P.line_config)M.visible?(g===-1&&(g=v),b.push(v)):m--,v++;const S=b.pop();g===-1&&(g=0),m=S-g;const x=(k=y.options)==null?void 0:k.spacing_between_lines_px,A=m*x/unitInPixels;c-A>.2&&(c=A,d=g*x/unitInPixels);const E=d+c,w=new Array(o).fill(d),_=new Array(o).fill(E),T=[w,_];if(a>c)for(const M of r.children)this.recursiveUpdate(M,{top:d,bottom:E},s,[w,_]);return T}calculateLines(){this.mSkyLine=[],this.mBottomLine=[];const e=document.createElement("div");document.body.append(e);const r=new SvgVexFlowBackend(this.mRules);r.initialize(e,1,"0");const s=r.getContext(),o=s.openGroup();o.classList.add("staffline");for(const a of this.StaffLineParent.Measures){a.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),a.setAbsoluteCoordinates(a.PositionAndShape.AbsolutePosition.x*unitInPixels,a.PositionAndShape.AbsolutePosition.y*unitInPixels);const l=a.draw(s),[u,c]=this.calculateLinesForMeasure(a,l);this.mSkyLine.push(...u),this.mBottomLine.push(...c)}s.closeGroup();for(const a of o.getElementsByClassName("vf-ties"))for(const l of a.childNodes)if(l.nodeName.toLowerCase()==="path"){const u=l.getBBox();let c=Math.floor(u.x/unitInPixels*this.mRules.SamplingUnit);const d=c+Math.ceil(u.width/unitInPixels*this.mRules.SamplingUnit),y=u.y/unitInPixels,m=u.height/unitInPixels+y;for(c;c<=d;c++)ythis.mBottomLine[c]&&(this.mBottomLine[c]=m)}r.clear(),e.remove()}}const VF$3=Vex.Flow;class VexFlowGraphicalSymbolFactory{constructor(){this.hasBBox=!1,document.createElementNS("http://www.w3.org/2000/svg","g").getBBox!==void 0&&(this.hasBBox=!0)}createMusicSystem(e,r){return new VexFlowMusicSystem(e,r)}createStaffLine(e,r){return new VexFlowStaffLine(e,r)}createSkyBottomLineCalculator(e){return e.ParentMusicSystem.rules.PerformanceMode&&this.hasBBox?new SkyBottomLineCalculatorSVG(e):new SkyBottomLineCalculator(e)}createGraphicalMeasure(e,r,s=!1){return new VexFlowMeasure(r,e,void 0)}createMultiRestMeasure(e,r,s){return new VexFlowMultiRestMeasure(r,e,s)}createTabStaffMeasure(e,r){return new VexFlowTabMeasure(r,e)}createExtraGraphicalMeasure(e){const r=new VexFlowMeasure(e.ParentStaff,void 0,e);return r.IsExtraGraphicalMeasure=!0,r.ExtraGraphicalMeasurePreviousMeasure=e.Measures.last(),r}createStaffEntry(e,r){return new VexFlowStaffEntry(r,e,void 0)}createVoiceEntry(e,r){return new VexFlowVoiceEntry(e,r)}createNote(e,r,s,o=OctaveEnum.NONE,a,l=void 0){return new VexFlowGraphicalNote(e,r,s,o,a,l)}createGraceNote(e,r,s,o,a=OctaveEnum.NONE){return new VexFlowGraphicalNote(e,r,s,a,o)}addGraphicalAccidental(e,r){e.setAccidental(r)}addFermataAtTiedEndNote(e,r){}createInStaffClef(e,r){const s=e,o=VexFlowConverter.Clef(r,"small");s.vfClefBefore=new VF$3.ClefNote(o.type,o.size,o.annotation)}createChordSymbols(e,r,s,o){const a=r.parentMeasure.parentSourceMeasure.Rules;let l=0;const u=a.ChordSymbolXSpacing;for(const c of e.ChordContainers){let d=r.PositionAndShape;r.graphicalVoiceEntries.length===1&&r.graphicalVoiceEntries[0].notes.length===1&&r.graphicalVoiceEntries[0].notes[0].sourceNote.isWholeRest()&&(d=r.parentMeasure.PositionAndShape,l+=r.parentMeasure.beginInstructionsWidth,l+=a.ChordSymbolWholeMeasureRestXOffset);const y=new GraphicalChordSymbolContainer(c,d,a.ChordSymbolTextHeight,s,o,r.parentMeasure.parentSourceMeasure.Rules),m=y.GraphicalLabel;m.PositionAndShape.RelativePosition.y-=a.ChordSymbolYOffset,m.setLabelPositionAndShapeBorders();let g=0;m.PositionAndShape.Size.width=4&&e.Parent.Notes[0].Length.Denominator>4&&TextAlignmentEnum.LeftBottom;const l=new Label(e.Text);l.isLyricText=!0,l.lyricExtendNoteId=(d=(c=e==null?void 0:e.Parent)==null?void 0:c.Notes[0])==null?void 0:d.NoteToGraphicalNoteObjectId,l.lyricVerseNumber=e==null?void 0:e.verseNumber;const u=this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules;this.graphicalLabel=new GraphicalLabel(l,s,a,u,r.PositionAndShape),this.graphicalLabel.Label.colorDefault=u.DefaultColorLyrics,this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(0,o),this.graphicalLabel.setLabelPositionAndShapeBorders(),this.graphicalLabel.PositionAndShape.Size.width1&&e=_GraphicalCurve.bezierCurveStepSize?new PointF2D:new PointF2D(_GraphicalCurve.oneMinusTPow3[e]*this.bezierStartPt.x+_GraphicalCurve.bezierFactorOne[e]*this.bezierStartControlPt.x+_GraphicalCurve.bezierFactorTwo[e]*this.bezierEndControlPt.x+_GraphicalCurve.tPow3[e]*this.bezierEndPt.x,_GraphicalCurve.oneMinusTPow3[e]*this.bezierStartPt.y+_GraphicalCurve.bezierFactorOne[e]*this.bezierStartControlPt.y+_GraphicalCurve.bezierFactorTwo[e]*this.bezierEndControlPt.y+_GraphicalCurve.tPow3[e]*this.bezierEndPt.y)}};let GraphicalCurve=_GraphicalCurve;GraphicalCurve.bezierCurveStepSize=1e3;const VF$1=Vex.Flow,_GraphicalSlur=class extends GraphicalCurve{constructor(i,e){super(),this.staffEntries=[],this.slur=i,this.rules=e}static Compare(i,e){if(i.staffEntries.length<1)return-1;if(e.staffEntries.length<1)return 1;const r=Fraction$1.minus(i.staffEntries[i.staffEntries.length-1].getAbsoluteTimestamp(),i.staffEntries[0].getAbsoluteTimestamp()),s=Fraction$1.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp());return r.RealValue>s.RealValue?1:s.RealValue>r.RealValue?-1:0}calculateCurve(i){const e=this.staffEntries[0],r=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let o=r.findGraphicalNoteFromNote(this.slur.EndNote);!o&&this.graceEnd&&(o=r.findGraphicalNoteFromGraceNote(this.slur.EndNote));const a=e.parentMeasure.ParentStaffLine,l=a.SkyBottomLineCalculator;this.calculatePlacement(l,a);const u=this.calculateStartAndEnd(s,o,a,i,l),c=u.startX,d=u.endX;let y=u.startY,m=u.endY;const g=i.SlurTangentMinAngle,v=i.SlurTangentMaxAngle;let b;if(this.placement===PlacementEnum.Above){y-=i.SlurNoteHeadYOffset,m-=i.SlurNoteHeadYOffset;const S=new PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,y);s?S.x+=this.staffEntries[0].PositionAndShape.BorderRight:S.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(S.x+=r.PositionAndShape.RelativePosition.x);const x=new PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,m);if(o?x.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:x.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(x.x+=r.staffEntryParent.PositionAndShape.RelativePosition.x),b=this.calculateTopPoints(S,x,a,l),b.length===0){const re=new PointF2D((x.x-S.x)/2+S.x,(x.y-S.y)/2+S.y);b.push(re)}const A=Math.atan((m-y)/(d-c)),E=new PointF2D(0,0);let w=new PointF2D(d-c,-(m-y));const _=Matrix2D.getRotationMatrix(A),T=_.getTransposeMatrix();w=_.vectorMultiplication(w);const C=this.calculateTranslatedAndRotatedPointListAbove(b,c,y,_),P=this.calculateMaxLeftSlope(C,E,w),k=this.calculateMaxRightSlope(C,E,w),M=E.y-E.x*P,R=w.y-w.x*k,H=new PointF2D;let B=!1;Math.abs(Math.abs(P)-Math.abs(k))<1e-4?(H.x=w.x/2,H.y=0,B=!0):(H.x=(R-M)/(P-k),H.y=P*H.x+M);const F=this.calculateHeightWidthRatio(w.x,C),I=0,U=0;let D=g,$=-g;if(!B){const re=this.calculateAngles(g,P,k,v);D=re.startAngle,$=re.endAngle}const N=this.calculateControlPoints(w.x,D,$,C,F,y,m);let O=N.startControlPoint,Q=N.endControlPoint;O=T.vectorMultiplication(O),O.x+=c,O.y=-O.y+y,Q=T.vectorMultiplication(Q),Q.x+=c,Q.y=-Q.y+y,this.bezierStartPt=new PointF2D(c,y-I),this.bezierStartControlPt=new PointF2D(O.x,O.y-I),this.bezierEndControlPt=new PointF2D(Q.x,Q.y-U),this.bezierEndPt=new PointF2D(d,m-U);const z=a.SkyLine.length,W=l.getLeftIndexForPointX(this.bezierStartPt.x,z),xe=l.getLeftIndexForPointX(this.bezierEndPt.x,z),ye=this.bezierEndPt.x-this.bezierStartPt.x,q=l.SamplingUnit;for(let re=W;re=W&&(a.SkyLine[Se]=Math.min(a.SkyLine[Se],ge.y)),Se++,Se=W&&(a.BottomLine[Se]=Math.max(a.BottomLine[Se],ge.y)),Se++,Se0){this.placement=PlacementEnum.Above;return}const r=this.staffEntries[0],s=this.staffEntries[this.staffEntries.length-1],o=r.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection,a=s.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(o===a)this.placement=o===StemDirectionType.Up?PlacementEnum.Below:PlacementEnum.Above,this.rules.SlurPlacementAtStems&&(this.placement=o===StemDirectionType.Up?PlacementEnum.Above:PlacementEnum.Below);else{let l=r.PositionAndShape.BorderLeft+r.PositionAndShape.RelativePosition.x+r.parentMeasure.PositionAndShape.RelativePosition.x,u=s.PositionAndShape.BorderRight+s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(l+=s.PositionAndShape.RelativePosition.x),this.graceEnd&&(u+=s.staffEntryParent.PositionAndShape.RelativePosition.x);const c=i.getSkyLineMinInRange(l,u)*-1;i.getBottomLineMaxInRange(l,u)-e.StaffHeight>c?this.placement=PlacementEnum.Above:this.placement=PlacementEnum.Below}}calculateTopPoints(i,e,r,s){const o=[];let a=s.getRightIndexForPointX(i.x,r.SkyLine.length),l=s.getLeftIndexForPointX(e.x,r.SkyLine.length);a<0&&(a=0),l>=r.SkyLine.length&&(l=r.SkyLine.length-1);for(let u=a;u=r.BottomLine.length&&(l=r.BottomLine.length-1);for(let u=a;ud&&i>y&&(c+=i/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,c*=1+e/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,u/=c);const m=Math.min(.5,Math.max(.1,1.7*e/80*u*Math.pow(Math.max(o,.05),.4))),g=Math.min(.5,Math.max(.1,1.7*-r/80*u*Math.pow(Math.max(o,.05),.4))),v=new PointF2D;v.x=i*m*Math.cos(e*_GraphicalSlur.degreesToRadiansFactor),v.y=i*m*Math.sin(e*_GraphicalSlur.degreesToRadiansFactor);const b=new PointF2D;b.x=i-i*g*Math.cos(r*_GraphicalSlur.degreesToRadiansFactor),b.y=-(i*g*Math.sin(r*_GraphicalSlur.degreesToRadiansFactor));let S=v.y-b.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(S)>this.rules.SlurMaximumYControlPointDistance;)S<0?(v.y+=1,b.y-=1):(v.y-=1,b.y+=1),S=v.y-b.y;return{startControlPoint:v,endControlPoint:b}}calculateAngles(i,e,r,s){let a=Math.atan(e)/_GraphicalSlur.degreesToRadiansFactor;e>0?a+=20:a-=20;let l=Math.atan(r)/_GraphicalSlur.degreesToRadiansFactor;r<0?l-=20:l+=20;const u=Math.min(Math.max(i,a),s),c=Math.max(Math.min(-i,l),-s);return{startAngle:u,endAngle:c}}};let GraphicalSlur=_GraphicalSlur;GraphicalSlur.degreesToRadiansFactor=Math.PI/180;class VexflowStafflineNoteCalculator{constructor(e){this.staffPitchListMapping=new Dictionary,this.baseLineNote=NoteEnum.B,this.baseLineOctave=1,this.rules=e}trackNote(e){if(!(e instanceof VexFlowGraphicalNote)||e.Clef().ClefType!==ClefEnum.percussion||e.sourceNote.isRest()||this.rules.PercussionOneLineCutoff===0||this.rules.PercussionForceVoicesOneLineCutoff===-1)return;const r=e.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let s;this.staffPitchListMapping.containsKey(r)||this.staffPitchListMapping.setValue(r,new Array),s=this.staffPitchListMapping.getValue(r);const o=e.sourceNote.Pitch;VexflowStafflineNoteCalculator.findOrInsert(s,o)}static PitchIndexOf(e,r,s=0){if(s>e.length-1)return-1;for(let o=s;othis.rules.PercussionOneLineCutoff&&!o&&!this.rules.PercussionUseCajon2NoteSystem)return e;const a=e,l=e.sourceNote.Pitch;let u=this.baseLineNote,c=this.baseLineOctave;if(this.rules.PercussionUseCajon2NoteSystem?l.FundamentalNote===NoteEnum.C&&(u=NoteEnum.G,c=1):this.rules.PercussionUseXMLDisplayStep&&e.sourceNote.displayStepUnpitched!==void 0&&(u=e.sourceNote.displayStepUnpitched,c=e.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),s.length<=this.rules.PercussionForceVoicesOneLineCutoff)a.setAccidental(new Pitch(u,c,l.Accidental));else{const d=VexflowStafflineNoteCalculator.PitchIndexOf(s,l);if(d>-1){const y=Math.ceil(s.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(d>=y)switch(c=2,(d-y)%5){case 1:u=NoteEnum.E;break;case 2:u=NoteEnum.G;break;case 3:u=NoteEnum.B;break;case 4:u=NoteEnum.D,c=3;break;default:u=NoteEnum.C;break}else switch(d%5){case 1:u=NoteEnum.F;break;case 2:u=NoteEnum.D;break;case 3:u=NoteEnum.B,c=0;break;case 4:u=NoteEnum.G,c=0;break;default:u=NoteEnum.A;break}const m=new Pitch(u,c,l.Accidental);a.setAccidental(m);const g=a.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&g.Notes.length<2&&(m.Octave>this.baseLineOctave||m.FundamentalNote===this.baseLineNote&&m.Octave===this.baseLineOctave?a.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Up:a.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Down)}}return a}getStafflineUniquePositionCount(e){return this.staffPitchListMapping.containsKey(e)?this.staffPitchListMapping.getValue(e).length:0}}class GraphicalPedal extends GraphicalObject{constructor(e,r){super(),this.getPedal=e,this.setSymbol(),this.PositionAndShape=new BoundingBox$1(this,r)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_MIXED:this.pedalSymbol=MusicSymbol.PEDAL_BRACKET}}class VexFlowPedal extends GraphicalPedal{constructor(e,r,s=!1,o=!1){switch(super(e,r),this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=e.ChangeBegin,this.ChangeEnd=e.ChangeEnd,this.pedalSymbol){case MusicSymbol.PEDAL_SYMBOL:this.vfStyle=Vex.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new BoundingBox$1(this,r);break;case MusicSymbol.PEDAL_MIXED:s&&o?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:s?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:o?this.vfStyle=Vex.Flow.PedalMarking.Styles.MIXED_OPEN_END:this.vfStyle=Vex.Flow.PedalMarking.Styles.MIXED;break;case MusicSymbol.PEDAL_BRACKET:default:s&&o?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:s?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:o?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_END:this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET;break}}setStartNote(e){if(!e)return!1;for(const r of e.graphicalVoiceEntries){const s=r;if(s!=null&&s.vfStaveNote)return this.startNote=s.vfStaveNote,this.startVfVoiceEntry=s,!0}return!1}setEndNote(e){if(!e)return!1;for(const r of e.graphicalVoiceEntries){const s=r;if(s!=null&&s.vfStaveNote)return this.endNote=s.vfStaveNote,this.endVfVoiceEntry=s,!0}return!1}setEndMeasure(e){this.endMeasure=e}CalculateBoundingBox(){}setLine(e){this.line=e}getPedalMarking(){const e=new Vex.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&e.setEndStave(this.endMeasure.getVFStave()),e.setStyle(this.vfStyle),e.setLine(this.line),e.setCustomText(this.DepressText,this.ReleaseText),(!this.endVfVoiceEntry||this.getPedal.EndsStave)&&(e.EndsStave=!0),this.getPedal.BeginsStave&&(e.BeginsStave=!0),e.ChangeBegin=this.ChangeBegin,e.ChangeEnd=this.ChangeEnd,e}setEndsStave(e,r){r!=null&&r.gte(e.parentSourceMeasure.Duration)&&(this.getPedal.EndsStave=!0)}setBeginsStave(e,r){e&&r.RealValue===0&&(this.getPedal.BeginsStave=!0)}}class GraphicalGlissando{constructor(e){this.Glissando=e,this.staffEntries=[]}calculateLine(e){const r=this.staffEntries[0],s=this.staffEntries[this.staffEntries.length-1],o=r.findGraphicalNoteFromNote(this.Glissando.StartNote),a=s.findGraphicalNoteFromNote(this.Glissando.EndNote);if(!o&&!a)return;const l=r.parentMeasure.ParentStaffLine;let u,c,d,y;if(o&&r.parentMeasure.ParentStaffLine===this.StaffLine)u=o.PositionAndShape.RelativePosition.x+o.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+o.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x+e.GlissandoNoteOffset,d=o.PositionAndShape.AbsolutePosition.y;else{u=s.parentMeasure.beginInstructionsWidth-.4;const v=this.Glissando.Direction===ColDirEnum.Down?-1:1;d=a.PositionAndShape.AbsolutePosition.y+v*e.GlissandoStafflineStartYDistanceToNote}if(a&&s.parentMeasure.ParentStaffLine===this.StaffLine)c=a.PositionAndShape.RelativePosition.x+a.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+a.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x-.5-e.GlissandoNoteOffset,u>c&&(u=c-e.GlissandoStafflineStartMinimumWidth),y=a.PositionAndShape.AbsolutePosition.y;else{if(l.Measures.last().parentSourceMeasure.HasEndLine)return;c=l.PositionAndShape.Size.width,c-u>e.GlissandoStafflineEndOffset&&(u=c-e.GlissandoStafflineEndOffset);const v=this.Glissando.Direction===ColDirEnum.Down?1:-1;y=o.PositionAndShape.AbsolutePosition.y+v*e.GlissandoStafflineStartYDistanceToNote}const m=new PointF2D(u,d),g=new PointF2D(c,y);this.Width===void 0&&(this.Width=e.GlissandoDefaultWidth),this.Line=new GraphicalLine(m,g,this.Width)}}class VexFlowGlissando extends GraphicalGlissando{}class GraphicalWavyLine extends GraphicalObject{constructor(e,r){super(),this.getWavyLine=e,this.PositionAndShape=new BoundingBox$1(this,r)}}class VexflowVibratoBracket extends GraphicalWavyLine{constructor(e,r,s=!1){super(e,r),this.line=1,this.isVibrato=!1,this.toEndOfStopStave=!1,this.isVibrato=s}get ToEndOfStopStave(){return this.toEndOfStopStave}setStartNote(e){for(const r of e.graphicalVoiceEntries){const s=r;if(s!=null&&s.vfStaveNote)return this.startNote=s.vfStaveNote,this.startVfVoiceEntry=s,!0}return!1}setEndNote(e){for(const r of e.graphicalVoiceEntries){const s=r;if(s!=null&&s.vfStaveNote){this.endNote=s.vfStaveNote,this.endVfVoiceEntry=s;const o=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries,a=o[o.length-1];return this.toEndOfStopStave=a===this.endVfVoiceEntry.parentStaffEntry,!0}}return!1}CalculateBoundingBox(){const e=this.getVibratoBracket();this.boundingBox.Size.height=e.render_options.wave_height*.2}getVibratoBracket(){const e=new Vex.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOfStopStave});return e.setLine(this.line),this.isVibrato?e.render_options.vibrato_width=20:e.render_options.wave_girth=4,e}}const VF=Vex.Flow;class VexFlowMusicSheetCalculator extends MusicSheetCalculator{constructor(e){var r,s,o,a,l,u,c,d;super(),this.beamsNeedUpdate=!1,this.rules=e,MusicSheetCalculator.symbolFactory=new VexFlowGraphicalSymbolFactory,MusicSheetCalculator.TextMeasurer=new VexFlowTextMeasurer(this.rules),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(this.rules),((r=this.rules.DefaultVexFlowNoteFont)==null?void 0:r.toLowerCase())==="gonville"?Vex.Flow.DEFAULT_FONT_STACK=[(s=Vex.Flow.Fonts)==null?void 0:s.Gonville,(o=Vex.Flow.Fonts)==null?void 0:o.Bravura,(a=Vex.Flow.Fonts)==null?void 0:a.Custom]:((l=this.rules.DefaultVexFlowNoteFont)==null?void 0:l.toLowerCase())==="petaluma"&&(Vex.Flow.DEFAULT_FONT_STACK=[(u=Vex.Flow.Fonts)==null?void 0:u.Petaluma,(c=Vex.Flow.Fonts)==null?void 0:c.Gonville,(d=Vex.Flow.Fonts)==null?void 0:d.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(this.rules);for(const e of this.graphicalMusicSheet.MeasureList)for(const r of e)r==null||r.clean()}formatMeasures(){for(const e of this.graphicalMusicSheet.MeasureList){if(!e||!e[0])continue;e.find(s=>s==null?void 0:s.isVisible()).format();for(const s of e){for(const o of s.staffEntries)o.calculateXPosition();s.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(e){const r=[];for(const y of e)y!=null&&y.isVisible()&&r.push(y);if(r.length===0)return 0;e=r;const s=[],o=new VF.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let a=e[0].staffEntries.length,l=1;for(const y of e){if(!y)continue;let m=0;for(const b of y.staffEntries)m+=b.setMaxAccidentals();y.parentSourceMeasure.ImplicitMeasure&&(a=Math.max(y.staffEntries.length,a),l=Math.max(y.staffEntries.length+m,l));const g=y.vfVoices,v=[];for(const b in g)if(g.hasOwnProperty(b)){const S=g[b];y.hasOnlyRests&&!S.ticksUsed.equals(S.totalTicks)&&(S.ticksUsed=S.totalTicks),v.push(S),s.push(S)}if(v.length===0){loglevelExports.debug("Found a measure with no voices. Continuing anyway.",g);continue}o.joinVoices(v)}let u=12;const c=e[0].parentSourceMeasure,d=.3;if(s.length>0){if(u=o.preCalculateMinTotalWidth(s)/unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+a*d,c!=null&&c.ImplicitMeasure){u=c.Duration.RealValue/c.ActiveTimeSignature.RealValue*u;let g=0;const v=c.measureListIndex;if(v>1)for(const b of this.graphicalMusicSheet.MeasureList[v-1]){const S=b==null?void 0:b.parentSourceMeasure.endingBarStyleEnum;if(S===SystemLinesEnum.ThinBold||S===SystemLinesEnum.DotsThinBold){g=this.rules.PickupMeasureRepetitionSpacing;break}}u+=g,a>1?u+=l*d*1.5:v>1&&a===1&&(u+=this.rules.PickupMeasureSpacingSingleNoteAddend),u*=this.rules.PickupMeasureWidthMultiplier}MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(e,u);const y=(g,v)=>{o.formatToStave(s,v.getVFStave())},m=(g,v)=>{o.formatToStave(s,v.getVFStave(),{align_rests:!0,context:void 0})};for(const g of e){if(this.rules.AlignRests===AlignRestOption.Never)g.formatVoices=y;else if(this.rules.AlignRests===AlignRestOption.Always)g.formatVoices=m;else if(this.rules.AlignRests===AlignRestOption.Auto){let v=!1;for(const b of g.staffEntries){let S=0,x=0;for(const A of b.graphicalVoiceEntries)if(A.parentVoiceEntry.IsGrace||A&&A.notes&&A.notes[0]&&A.notes[0].sourceNote&&A.notes[0].sourceNote.PrintObject&&S++,A&&A.notes&&A.notes[0]&&A.notes[0].sourceNote&&A.notes[0].sourceNote.isRest()&&A.notes[0].sourceNote.PrintObject&&x++,S>1&&x>=1){v=!0;break}if(v)break}v?g.formatVoices=m:g.formatVoices=y}if(g===e[0]){const v=g;v.formatVoices(u*unitInPixels,v)}}}for(const y of e)if(y)for(const m of y.staffEntries)m.calculateXPosition();for(const y of e){if(!y)continue;const m=y.vfVoices,g=[];for(const v in m)m.hasOwnProperty(v)&&g.push(m[v]);if(g.length===0){loglevelExports.debug("Found a measure with no voices. Continuing anyway.",m);continue}o.joinVoices(g)}return u}calculateElongationFactor(e,r,s,o,a,l,u,c){let d=a,y=0;for(const m of e){const g=m.GraphicalLabel.Label.textAlignment;let v=u,b=c;if(m instanceof GraphicalLyricEntry&&m.ParentLyricWord){m.LyricsEntry.SyllableIndex>0&&(v=this.rules.BetweenSyllableMinimumDistance,TextAlignment.IsCenterAligned(g)&&(v+=1));const F=m.ParentLyricWord.GetLyricWord.Syllables;F.length>1&&m.LyricsEntry.SyllableIndex4&&(H*=1.1)}}else s[y]&&(H=_/T);M=Math.max(R,H),d=Math.max(d,M);let B=Math.max(_-T||0,0);s[y]&&(B+=s[y].cumulativeOverlap),s[y]={cumulativeOverlap:B,extend:m instanceof GraphicalLyricEntry?m.LyricsEntry.extend:!1,labelWidth:x,measureNumber:l,sourceNoteDuration:m instanceof GraphicalLyricEntry?m.LyricsEntry&&m.LyricsEntry.Parent.Notes[0].Length:!1,text:m instanceof GraphicalLyricEntry?m.LyricsEntry.Text:m.GraphicalLabel.Label.text,xPosition:w},y++}return d}calculateElongationFactorFromStaffEntries(e,r,s,o){let a=s;const l={},u={};for(const c of e)c.LyricsEntries.length>0&&this.rules.RenderLyrics&&(a=this.calculateElongationFactor(c.LyricsEntries,c,l,r,a,o,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),c.graphicalChordContainers.length>0&&this.rules.RenderChordSymbols&&(a=this.calculateElongationFactor(c.graphicalChordContainers,c,u,r,a,o,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return a}calculateMeasureWidthFromStaffEntries(e,r){var l;let s=1;if(!((l=window.GYM)==null?void 0:l.multitrack))for(const u of e)!u||u.staffEntries.length===0||(s=this.calculateElongationFactorFromStaffEntries(u.staffEntries,r,s,u.MeasureNumber),s=1);return s=Math.min(s,this.rules.MaximumLyricsElongationFactor),r*s}createGraphicalTie(e,r,s,o,a){return new GraphicalTie(e,o,a)}updateStaffLineBorders(e){e.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(e){e.rules=this.rules,e.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(e,r,s,o){for(let a=0;a=2&&(l=o.vfnote[0],u=o.vfnote[1]);let c,d=0;if(a&&a.vfnote&&a.vfnote.length>=2&&(c=a.vfnote[0],d=a.vfnote[1]),r){if(l){const x=new VF.StaveTie({first_indices:[u],first_note:l}),A=o.parentVoiceEntry.parentStaffEntry.parentMeasure;if(c){c.getDuration()==="w"&&((m=(y=c.keyProps)==null?void 0:y[0])==null?void 0:m.line)>=3&&c.setStemDirection(-1);let E=((g=window.GYM)==null?void 0:g.tieDirection)||0;Math.abs(E)===1&&(((b=(v=c.keyProps)==null?void 0:v[0])==null?void 0:b.line)>=3?c.setStemDirection(-E):c.setStemDirection(E)),x==null||x.setDirection(c.getStemDirection())}if(A.vfTies.length>0){const E=A.vfTies[0].direction;x==null||x.setDirection(E?-E:1)}A.addStaveTie(x,e)}if(c){const x=new VF.StaveTie({last_indices:[d],last_note:c}),A=a.parentVoiceEntry.parentStaffEntry.parentMeasure;if(A.vfTies.length>0){const E=A.vfTies[0].direction;x==null||x.setDirection(E?-E:1)}A.addStaveTie(x,e)}}else if(l||c){let x;if(s)if(e.Tie.Type==="S"){const w=e.StartNote.sourceNote,_=e.EndNote.sourceNote;let T=1;w.FretNumber>_.FretNumber&&(T=-1),x=new VF.TabSlide({first_indices:[u],first_note:l,last_indices:[d],last_note:c},T)}else x=new VF.TabTie({first_indices:[u],first_note:l,last_indices:[d],last_note:c},e.Tie.Type);else{x=new VF.StaveTie({first_indices:[u],first_note:l,last_indices:[d],last_note:c});const w=e.Tie.getTieDirection(o.sourceNote);w===PlacementEnum.Below?x.setDirection(1):w===PlacementEnum.Above&&x.setDirection(-1)}const A=a.parentVoiceEntry.parentStaffEntry.parentMeasure,E=((S=window.GYM)==null?void 0:S.graceCustom)||!1;E&&x.setDirection(E.direction),A.addStaveTie(x,e)}}calculateDynamicExpressionsForMultiExpression(e,r,s){if(rthis.rules.MaxMeasureToDrawIndex)return;const o=e.AbsoluteTimestamp,a=this.graphicalMusicSheet.MeasureList[r],l=a[s].ParentStaffLine,u=a[s];if(!l)return;const c=e.StartingContinuousDynamic,d=c!==void 0&&!c.IsStartOfSoftAccent,y=this.getRelativePositionInStaffLineFromTimestamp(o,s,l,l==null?void 0:l.isPartOfMultiStaffInstrument(),void 0,d);if(y.x<=0&&(y.x=u.beginInstructionsWidth+this.rules.RhythmRightMargin),e.InstantaneousDynamic){const m=new VexFlowInstantaneousDynamicExpression(e.InstantaneousDynamic,l,u);this.calculateGraphicalInstantaneousDynamicExpression(m,y,o),this.dynamicExpressionMap.set(o.RealValue,m.PositionAndShape)}if(c){const m=new VexFlowContinuousDynamicExpression(c,l,u.parentSourceMeasure);if(m.StartMeasure=u,m.IsSoftAccent=e.StartingContinuousDynamic.IsStartOfSoftAccent,!m.IsVerbal&&c.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(m,y),m.updateSkyBottomLine()}catch(g){}else m.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(m,y):loglevelExports.warn("This continuous dynamic is not covered. measure"+e.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(e,r){var E,w,_,T,C,P,k,M,R,H,B;const s=Math.max(e.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),o=r||s,a=Math.max(e.StaffNumber-1,0),l=this.graphicalMusicSheet.MeasureList[o][a].getVFStave();let u="q";if(e.beatUnit){const F=NoteTypeHandler.getNoteDurationFromType(e.beatUnit);u=VexFlowConverter.durations(F,!1)[0]}let c=this.rules.MetronomeMarkYShift,d=!1;const y=[];if(e.parentMeasure){for(const F of e.parentMeasure.StaffLinkedExpressions)for(const I of F)I&&I instanceof UnknownExpression&&y.push(I);for(const F of e.parentMeasure.TempoExpressions){const I=((E=F.InstantaneousTempo)==null?void 0:E.Enum)===TempoEnum.metronomeMark;if(!e.beatUnit&&F.InstantaneousTempo.beatUnit){const U=NoteTypeHandler.getNoteDurationFromType(e.beatUnit);u=VexFlowConverter.durations(U,!1)[0]}if(F.getPlacementOfFirstEntry()===PlacementEnum.Above&&!I){d=!0;break}}}d&&(c-=1.4);const m=(w=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)==null?void 0:w.SkyLine;let g=e.TempoInBpm,v="",b="",S="";for(const F of this.graphicalMusicSheet.MeasureList[o][a].parentSourceMeasure.TempoExpressions){if(b=F.CombinedExpressionsText,isSpecialMark(F.CombinedExpressionsText)){v=F.CombinedExpressionsText;break}if(isSpeedKeyword(F.CombinedExpressionsText)||isSpeedHiddenKeyword(F.CombinedExpressionsText)){v=formatSpeedKeyword(F.CombinedExpressionsText),g=F.sourceMeasure.TempoInBPM,isSpeedKeyword(F.CombinedExpressionsText)&&(S=u);break}}const x={bpm:e.TempoInBpm,dots:e.dotted,duration:u,name:v};v&&(x.bpm=g/(x.dots?1.5:1),isSpeedKeyword(b)?x.duration=S:(g===SpeedTag[v]||!SpeedTag[v])&&(x.duration=""));const A=((P=(C=(T=(_=this.graphicalMusicSheet.MeasureList[o][a])==null?void 0:_.vfVoices)==null?void 0:T[1])==null?void 0:C.boundingBox)==null?void 0:P.y)||0;if(this.rules.MetronomeMarksDrawn){if(m){const D=((M=(k=this.graphicalMusicSheet.MeasureList[0])==null?void 0:k[a])==null?void 0:M.ParentStaffLine).Measures.map($=>$.MeasureNumber-1);if(A&&D.includes(o)&&(isSpeedKeyword(b)||isSpeedHiddenKeyword(b))){const $=m.slice(0,9);let N=Math.min(...$);N=N<0?N-1:N,c+=N}D.includes(o)&&y.length?m[0]=Math.min(m[0],-4.5+c-4):m[0]=Math.min(m[0],-4.5+c)}l.options.line_config.reduce((U,D)=>(D.visible&&U++,U),0)<5&&(c-=2),l.setTempo(x,c*unitInPixels);let I=0;try{const U=(B=(H=(R=this.graphicalMusicSheet.MeasureList[o][a])==null?void 0:R.vfVoices)==null?void 0:H[1])==null?void 0:B.getTickables();I+=U[e.parentMeasure.metronomeNoteIndex].getBoundingBox().getX()-l.getNoteStartX()}catch(U){}l.getModifiers()[l.getModifiers().length-1].setShiftX(I)}}calculateRehearsalMark(e){var d,y,m,g,v,b,S,x,A;const r=e.rehearsalExpression;if(!r)return;const s=(m=(y=(d=e.VerticalMeasureList)==null?void 0:d[0])==null?void 0:y.getVFStave)==null?void 0:m.call(y);if(!s)return;const o=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let a=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;e.IsSystemStartMeasure&&(a+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const l=this.rules.RehearsalMarkFontSize,u=s.getModifiers(),c=u.find(E=>E.getCategory().toLocaleLowerCase()==="repetitions");if(c&&c.setShiftY(c.y_shift-10),s.setSection(r.label,o,a,l),(b=(v=(g=e.VerticalMeasureList)==null?void 0:g[0])==null?void 0:v.ParentStaffLine)!=null&&b.AbstractExpressions){const E=u.find(w=>w.getCategory().toLocaleLowerCase()==="stavesection");for(let w of((A=(x=(S=e==null?void 0:e.VerticalMeasureList)==null?void 0:S[0])==null?void 0:x.ParentStaffLine)==null?void 0:A.AbstractExpressions)||[])w instanceof GraphicalUnknownExpression&&(E&&(w.Label.PositionAndShape.RelativePosition.y-=.5),c&&(w.Label.PositionAndShape.RelativePosition.y-=1.7))}}calculateSingleOctaveShift(e,r,s,o){var b;const a=r.OctaveShiftStart,l=a.ParentStartMultiExpression.Timestamp,u=(b=a.ParentEndMultiExpression)==null?void 0:b.Timestamp,c=this.rules.MinMeasureToDrawIndex,d=this.rules.MaxMeasureToDrawIndex;let y=this.graphicalMusicSheet.MeasureList[s][o].ParentStaffLine;y||(y=this.graphicalMusicSheet.MeasureList[c][o].ParentStaffLine);let m;a.ParentEndMultiExpression?m=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentEndMultiExpression.SourceMeasureParent,o):m=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(o,!0),m.MeasureNumber>d+1&&(m=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(o,!0));let g;if(a.ParentEndMultiExpression?g=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,o):g=this.graphicalMusicSheet.MeasureList[c][o],g.MeasureNumberd||m.parentSourceMeasure.measureListIndexd)return;let v=m.ParentStaffLine;if(v||(v=y),m&&y&&v){const S=new VexFlowOctaveShift(a,y.PositionAndShape);if(!S.startNote){let E;for(const w of g.staffEntries)if(w){E=w;break}if(!E||(S.setStartNote(E),!S.startNote))return}if(!S.endNote){let E;for(let w=m.staffEntries.length-1;w>=0;w++)if(m.staffEntries[w]){E=m.staffEntries[w];break}if(!E){S.graphicalEndAtMeasureEnd=!0;return}if(S.setEndNote(E),!S.endNote)return}let x=g.findGraphicalStaffEntryFromTimestamp(l);x||(x=g.staffEntries[0]);let A=m.findGraphicalStaffEntryFromTimestamp(u);if(A||(A=m.staffEntries[m.staffEntries.length-1]),S.setStartNote(x),v!==y){S.endsOnDifferentStaffLine=!0;let E=this.findLastStafflineMeasure(y);E===void 0&&(E=m);const w=E.staffEntries[E.staffEntries.length-1];S.setEndNote(w),S.graphicalEndAtMeasureEnd=!0,S.endMeasure=E;const _=v.ParentMusicSystem.Id-y.ParentMusicSystem.Id;if(_>0)for(let T=y.ParentMusicSystem.Id;T=0;r--){const s=e.Measures[r];if(s.staffEntries.length>0)return s}}calculateSinglePedal(e,r,s,o){var b;const a=r.PedalStart,l=a.ParentStartMultiExpression.Timestamp,u=(b=a.ParentEndMultiExpression)==null?void 0:b.Timestamp,c=this.rules.MinMeasureToDrawIndex,d=this.rules.MaxMeasureToDrawIndex;let y=this.graphicalMusicSheet.MeasureList[s][o].ParentStaffLine;y||(y=this.graphicalMusicSheet.MeasureList[c][o].ParentStaffLine);let m;a.ParentEndMultiExpression?m=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentEndMultiExpression.SourceMeasureParent,o):m=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(o,!0),m||(m=a.ParentStartMultiExpression.SourceMeasureParent.VerticalMeasureList[o]),m.MeasureNumber>d+1&&(m=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(o,!0));let g;if(a.ParentEndMultiExpression?g=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,o):(g=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,o),g||(g=this.graphicalMusicSheet.MeasureList[c][o])),g.MeasureNumberd||m.parentSourceMeasure.measureListIndexd)return;let v=m.ParentStaffLine;if(v||(v=y),m&&y&&v){let S=!1;y!==v&&(S=!0);const x=new VexFlowPedal(a,y.PositionAndShape,!1,S);x.setEndsStave(m,u);let A=g.findGraphicalStaffEntryFromTimestamp(l);A||(A=g.staffEntries[0]);let E=m.findGraphicalStaffEntryFromTimestamp(u);if(E||(E=m.staffEntries[m.staffEntries.length-1]),!x.setStartNote(A))return;if(x.setBeginsStave(x.startNote.isRest(),l),v!==y)if(x.pedalSymbol===MusicSymbol.PEDAL_SYMBOL){x.setEndNote(E),x.setEndMeasure(m),x.ReleaseText=" ",x.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(x.startVfVoiceEntry,x.endVfVoiceEntry,x,y);const w=v.Measures[0],_=new VexFlowPedal(a,w.PositionAndShape);x.setEndsStave(m,u);const T=w.staffEntries[0];if(!_.setStartNote(T))return;_.setEndNote(E),_.setEndMeasure(m),x.setEndMeasure(m),v.Pedals.push(_),_.CalculateBoundingBox(),_.DepressText=" ",this.calculatePedalSkyBottomLine(_.startVfVoiceEntry,_.endVfVoiceEntry,_,v)}else{let w=this.findLastStafflineMeasure(y);w===void 0&&(w=m);const _=w.staffEntries[w.staffEntries.length-1];x.setEndNote(_),x.setEndMeasure(m),x.ChangeEnd=!1;const T=v.ParentMusicSystem.Id-y.ParentMusicSystem.Id;if(T>0){let C=1;for(let P=y.ParentMusicSystem.Id;Pd+1&&(m=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(o,!0));let g;if(a.ParentEndMultiExpression?g=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(a.ParentStartMultiExpression.SourceMeasureParent,o):g=this.graphicalMusicSheet.MeasureList[c][o],g.MeasureNumberd||m.parentSourceMeasure.measureListIndexd)return;let v=m.ParentStaffLine;if(v||(v=y),m&&y&&v){const S=new VexflowVibratoBracket(a,y.PositionAndShape,g.ParentStaff.isTab);let x=g.findGraphicalStaffEntryFromTimestamp(l);x||(x=g.staffEntries[0]);let A=m.findGraphicalStaffEntryFromTimestamp(u);if(A||(A=m.staffEntries[m.staffEntries.length-1]),S.setStartNote(x),v!==y){let E=y.Measures[y.Measures.length-1];E===void 0&&(E=m);const w=E.staffEntries[E.staffEntries.length-1];if(S.setEndNote(w),v.ParentMusicSystem.Id-y.ParentMusicSystem.Id>0)for(let T=y.ParentMusicSystem.Id;Tm){const w=m;m=y,y=w}o.SkyBottomLineCalculator.updateBottomLineInRange(y,m,g+A)}for(const A of o.Pedals){const E=A,w=E.getPedalMarking(),_=w.line+3+(o.StaffLines.length-1);if(g>_){const T=w.render_options.text_margin_right/10;let C=E.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-T,P;E.setLine(g-3-(o.StaffLines.length-1));let k=(b=E.endVfVoiceEntry)==null?void 0:b.PositionAndShape;if(k||(k=E.endMeasure.PositionAndShape),E.EndSymbolPositionAndShape){const M=u.render_options.glyph_point_size/20;P=C+3.4;const R=k.AbsolutePosition.x-T,H=R+1.5;o.SkyBottomLineCalculator.updateBottomLineInRange(C,P,g+M),o.SkyBottomLineCalculator.updateBottomLineInRange(R,H,g+M)}else{const M=w.render_options.bracket_height/10;if(w.EndsStave)P=k.AbsolutePosition.x+k.Size.width-T;else switch(u.style){case l.BRACKET_OPEN_END:case l.BRACKET_OPEN_BOTH:case l.MIXED_OPEN_END:P=k.AbsolutePosition.x+k.BorderRight-T;break;default:P=k.AbsolutePosition.x+k.BorderLeft-T;break}const R=(x=(S=E.endVfVoiceEntry)==null?void 0:S.parentStaffEntry)==null?void 0:x.vfClefBefore;if(R){const H=R.getWidth()/10;P+=H}if(C>P){const H=C;C=P,P=H}o.SkyBottomLineCalculator.updateBottomLineInRange(C,P,g+M)}}}}calculateOctaveShiftSkyBottomLine(e,r,s,o){if(!r){loglevelExports.warn("octaveshift: no endStaffEntry");return}let a=r.PositionAndShape;s.graphicalEndAtMeasureEnd&&(a=r.parentMeasure.PositionAndShape);let l=e.PositionAndShape.Size.width,u=a.Size.width;e.hasOnlyRests()?l=-l:l/=2,s.graphicalEndAtMeasureEnd||(r.hasOnlyRests()?u*=2:u/=2,e===r&&(u*=2));let c=e.PositionAndShape.AbsolutePosition.x-l,d=a.AbsolutePosition.x+u;if(c>d){const g=c;c=d,d=g}s.PositionAndShape.Size.width=d-c;const y=s.getTextBracket(),m=y.font.size/10;if(y.position===VF.TextBracket.Positions.TOP){const g=Math.ceil(o.SkyBottomLineCalculator.getSkyLineMinInRange(c,d));if(g===1/0)return;y.start.getStave().options.top_text_position=Math.abs(g),o.SkyBottomLineCalculator.updateSkyLineInRange(c,d,g-m*2)}else{const g=o.SkyBottomLineCalculator.getBottomLineMaxInRange(c,d);if(g===1/0)return;y.start.getStave().options.bottom_text_position=g,e.parentMeasure!==r.parentMeasure&&(y.stop.getStave().options.bottom_text_position=g),o.SkyBottomLineCalculator.updateBottomLineInRange(c,d,g+m*1.5)}}calculateWordRepetitionInstruction(e,r){let s;const o=this.graphicalMusicSheet.MeasureList[r];for(let a=0,l=o.length;as.StaffLines));let r=0;for(const s of e)for(const o of s.Measures)o&&r++;this.rules.AlwaysSetPreferredSkyBottomLineBackendAutomatically&&this.rules.setPreferredSkyBottomLineBackendAutomatically(r);for(const s of e)s.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){for(const e of this.musicSystems)for(const r of e.StaffLines)try{r.AlignmentManager.alignDynamicExpressions(),r.AbstractExpressions.forEach(s=>{s.updateSkyBottomLine()})}catch(s){}}handleTiedGraphicalNote(e,r,s,o,a,l,u,c){}handleBeam(e,r,s){e.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(e,r)}handleVoiceEntryLyrics(e,r,s){e.LyricsEntries.forEach((o,a)=>{const l=new GraphicalLyricEntry(a,r,this.rules.LyricsHeight,this.rules.StaffHeight);if(r.LyricsEntries.push(l),l.GraphicalLabel.setLabelPositionAndShapeBorders(),a.Word){const c=a.Word.Syllables.indexOf(a);let d=s.indexOf(a.Word);if(d===-1&&(s.push(a.Word),d=s.indexOf(a.Word)),this.graphicalLyricWords.length===0||d>this.graphicalLyricWords.length-1){const y=new GraphicalLyricWord(a.Word);l.ParentLyricWord=y,y.GraphicalLyricsEntries[c]=l,this.graphicalLyricWords.push(y)}else{const y=this.graphicalLyricWords[d];l.ParentLyricWord=y,y.GraphicalLyricsEntries[c]=l,y.isFilled()&&(s.splice(d,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(y),1))}}})}handleVoiceEntryOrnaments(e,r,s){}handleVoiceEntryArticulations(e,r,s){}handleVoiceEntryTechnicalInstructions(e,r,s){}handleTuplet(e,r,s){e.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(e,r)}findIndexGraphicalSlurFromSlur(e,r){for(let s=0;s=0){const m=o[y];m.staffEntries.indexOf(l)===-1&&m.staffEntries.push(l),o.splice(y,1)}}}for(const u of o)u.staffEntries.indexOf(l)===-1&&u.staffEntries.push(l)}}for(const r of this.musicSystems)for(const s of r.StaffLines){const o=s.GraphicalSlurs.sort(GraphicalSlur.Compare);for(const a of o)a.slur.isCrossed()||a.calculateCurve(this.rules)}}calculateGlissandi(){const e={};for(const r of this.graphicalMusicSheet.MeasureList[0])e[r.ParentStaff.idInMusicSheet]=[];for(const r of this.musicSystems)for(const s of r.StaffLines){const o=e[s.ParentStaff.idInMusicSheet];for(let a=0;a=0){const m=o[y];m.staffEntries.indexOf(l)===-1&&m.staffEntries.push(l),o.splice(y,1)}}}}for(const u of o)u.staffEntries.indexOf(l)===-1&&u.staffEntries.push(l)}}for(const r of this.musicSystems)for(const s of r.StaffLines)for(const o of s.GraphicalGlissandi)if(s.ParentStaff.isTab){const l=o.Glissando.StartNote,u=o.Glissando.EndNote,c=o.staffEntries[0].findGraphicalNoteFromNote(l),d=o.staffEntries.last().findGraphicalNoteFromNote(u);if(!c&&!d)return;let y=1;l.FretNumber>u.FretNumber&&(y=-1);let m,g,v;c&&c.vfnote&&c.vfnote.length>=2&&(v=c.vfnote[0],m=[0]);let b;d&&d.vfnote&&d.vfnote.length>=2&&(b=d.vfnote[0],g=[0]);const S=new VF.TabSlide({first_indices:m,first_note:v,last_indices:g,last_note:b},y),x=c==null?void 0:c.parentVoiceEntry.parentStaffEntry.parentMeasure;x&&(x.vfTies.push(S),o.vfTie=S);const A=d==null?void 0:d.parentVoiceEntry.parentStaffEntry.parentMeasure;A&&(A.vfTies.push(S),o.vfTie=S)}}}class MusicPartManager{constructor(e){this.musicSheet=e}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new Fraction$1(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(e){let r;for(let s=this.timestamps.length-1;s>=0;s--)if(r=this.timestamps[s],e.gte(r.from))return r;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(e){if(this.timestamps.length===0)return e;const r=this.getCurrentRepetitionTimestampTransform(e);return Fraction$1.plus(e,Fraction$1.minus(r.to,r.from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(e){return e?new MusicPartManagerIterator(this.musicSheet,e,void 0):new MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(e){this.musicSheet.SelectionStart=e,this.musicSheet.SelectionEnd=void 0}setSelectionRange(e,r){this.musicSheet.SelectionStart=e!=null?e:this.sheetStart,this.musicSheet.SelectionEnd=r!=null?r:this.sheetEnd}calcMapping(){this.timestamps=[];const e=this.getIterator();let r=e.CurrentRepetition,s=new TimestampTransform(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(this.timestamps.push(s);!e.EndReached;){if(e.JumpOccurred||r!==e.CurrentRepetition){if(r=e.CurrentRepetition,e.backJumpOccurred){const o=e.JumpResponsibleRepetition;s.nextBackJump=e.CurrentEnrolledTimestamp,s.curRepetition=o,s.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let a=this.timestamps.length-2;a>=0&&!(o.AbsoluteTimestamp.gt(this.timestamps[a].to)||this.timestamps[a].curRepetition);a--)this.timestamps[a].nextBackJump=s.nextBackJump,this.timestamps[a].curRepetition=o,this.timestamps[a].curRepetitionIteration=s.curRepetitionIteration}s=new TimestampTransform(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),this.timestamps.push(s)}e.moveToNext()}}}class TimestampTransform{constructor(e,r,s,o){this.from=e,this.to=r,this.curRepetition=s,this.curRepetitionIteration=o,this.nextBackJump=void 0,this.nextForwardJump=void 0}}class PartListEntry{constructor(e){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=e}get Visible(){return this.visible}set Visible(e){this.visible=e}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}class SourceMusicPart extends PartListEntry{constructor(e,r,s){super(e),this.musicSheet=e,this.startIndex=r,this.endIndex=s}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(e){this.parentRepetition=e}get AbsoluteTimestamp(){return Fraction$1.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(e){this.startIndex=e}setEndIndex(e){this.endIndex=e}}class Repetition extends PartListEntry{constructor(e,r=!1){super(e),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=e,this.virtualOverallRepetition=r}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(e){this.visibles=e}get DefaultNumberOfRepetitions(){let e=2;return this.virtualOverallRepetition&&(e=1),Math.max(e,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(e){this.userNumberOfRepetitions=e,this.repetitonIterationOrder=[];const r=this.userNumberOfRepetitions-this.NumberOfEndings;for(let s=1;s<=this.userNumberOfRepetitions;s++)s<=r?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(s-r)}getForwardJumpTargetForIteration(e){const r=this.repetitonIterationOrder[e-1];return this.endingIndexDict[r]?this.endingIndexDict[r].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}setEndingsStartIndex(e,r){const s=new RepetitionEndingPart(new SourceMusicPart(this.musicSheet2,r,r));this.endingParts.push(s);for(const o of e)try{this.endingIndexDict[o]=s,s.endingIndices.push(o),this.numberOfEndings0&&(o=1),a.Add(new Fraction$1(o,r)),a}}class MusicSheet{constructor(){this.idString="uninitialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new MusicSheetErrors,this.staves=[],this.playbackDataDict=new Dictionary,this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new Fraction$1(0,1),this.soundTempos=new Map,this.userStartTempoInBPM=100,this.playbackSettings=new PlaybackSettings(new Fraction$1(4,4,0,!1),this.userStartTempoInBPM),this.pageWidth=120,this.MusicPartManager=new MusicPartManager(this),this.hasBPMInfo=!1}get SoundTempos(){return this.soundTempos}set SoundTempos(e){this.soundTempos=e}static getIndexFromStaff(e){return e.idInMusicSheet}get CurrentKeyInstruction(){return this.currentKeyInstruction}set CurrentKeyInstruction(e){this.currentKeyInstruction=e}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(e){this.sourceMeasures=e}get Repetitions(){return this.repetitions}set Repetitions(e){this.repetitions=e}get DynListStaves(){return this.dynListStaves}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(e){this.playbackSettings=e}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(e){this.drawErroneousMeasures=e}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(e){this.hasBeenOpenedForTheFirstTime=e}InitializeStartTempoInBPM(e){this.playbackSettings.BeatsPerMinute=e,this.userStartTempoInBPM=e}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(e){this.defaultStartTempoInBpm=e,this.InitializeStartTempoInBPM(e)}get Path(){return this.path}set Path(e){this.path=e}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(e){this.Title=new Label(e)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(e){this.Subtitle=new Label(e)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(e){this.Composer=new Label(e)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(e){this.Lyricist=new Label(e)}get CopyrightString(){return this.copyright?this.copyright.text:""}set CopyrightString(e){this.Copyright=new Label(e,TextAlignmentEnum.CenterBottom,void 0,!0)}get Title(){return this.title}set Title(e){this.title=e}get Subtitle(){return this.subtitle}set Subtitle(e){this.subtitle=e}get Composer(){return this.composer}set Composer(e){this.composer=e}get Lyricist(){return this.lyricist}set Lyricist(e){this.lyricist=e}get Copyright(){return this.copyright}set Copyright(e){this.copyright=e}get Rules(){return this.rules||(loglevelExports.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new EngravingRules),this.rules}set Rules(e){this.rules=e}get SheetErrors(){return this.musicSheetErrors}get PlaybackDataDict(){return this.playbackDataDict}get SelectionStart(){return this.selectionStart}set SelectionStart(e){this.selectionStart=e.clone(),this.currentEnrolledPosition=e.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(e){this.selectionEnd=e}set HasBPMInfo(e){this.hasBPMInfo=e}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(e){this.sourceMeasures.push(e),e.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let e=0,r=this.instruments.length;e0){const e=this.TimestampSortedTempoExpressionsList[0];if(e.InstantaneousTempo)return e.InstantaneousTempo.TempoInBpm;if(e.ContinuousTempo)return e.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(e){return loglevelExports.info("MusicSheet.FirstMeasureNumber: ",e),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(e){return loglevelExports.info("MusicSheet.LastMeasureNumber: ",e),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(e){this.currentEnrolledPosition=e.clone()}get Transpose(){return this.transpose}set Transpose(e){this.transpose=e}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(e){this.idString=e}getEnrolledSelectionStartTimeStampWorkaround(){const e=this.MusicPartManager.getIterator(this.SelectionStart);return Fraction$1.createFromFraction(e.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const e=this.getLastSourceMeasure();return Fraction$1.plus(e.AbsoluteTimestamp,e.Duration)}getSourceMeasureFromTimeStamp(e){for(let r=0,s=this.sourceMeasures.length;r0&&o.Voices[0].Visible&&e.push(o)}return e}}MusicSheet.defaultTitle="defaultTitle";class LyricWord{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(e){for(let r=0,s=this.Syllables.length;r=0&&(this.syllableIndex=a)}get Text(){return this.text}set Text(e){this.text=e}get Word(){return this.word}get Parent(){return this.parent}set Parent(e){this.parent=e}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}get IsTranslation(){return this.VerseNumber.endsWith("translation")}get IsChorus(){return this.VerseNumber.startsWith("chorus")}get FontStyle(){return this.IsChorus||this.IsTranslation?FontStyles.Italic:FontStyles.Regular}}class LyricsReader{constructor(e){this.openLyricWords={},this.musicSheet=e}addLyricEntry(e,r){var s,o;if(e){const a=e;for(let l=0,u=a.length;l0)for(let w=x;w0){const a=e.elements();for(let l=0,u=a.length;l0&&r.Articulations[0].articulationEnum!==ArticulationEnum.staccato&&r.Articulations.splice(0,0,v);else if(d==="breathmark")m===PlacementEnum.NotYetDefined&&(v.placement=PlacementEnum.Above);else if(d==="strongaccent"){const b=(o=c==null?void 0:c.attribute("type"))==null?void 0:o.value;b==="up"?v.articulationEnum=ArticulationEnum.marcatoup:b==="down"&&(v.articulationEnum=ArticulationEnum.marcatodown)}else if(y===ArticulationEnum.softaccent){const b=r.ParentSourceStaffEntry.ParentStaff.Id-1;m===PlacementEnum.NotYetDefined&&(m=PlacementEnum.Above,b>0&&(m=PlacementEnum.Below));const S=r.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure,x=new MultiExpression(S,r.Timestamp);x.StartingContinuousDynamic=new ContinuousDynamicExpression(ContDynamicEnum.crescendo,m,b,S,null,-1),x.StartingContinuousDynamic.IsStartOfSoftAccent=!0,x.StartingContinuousDynamic.StartMultiExpression=x,x.StartingContinuousDynamic.EndMultiExpression=x,x.EndingContinuousDynamic=new ContinuousDynamicExpression(ContDynamicEnum.diminuendo,m,b,S,null,-1),x.EndingContinuousDynamic.StartMultiExpression=x,x.EndingContinuousDynamic.EndMultiExpression=x,S.StaffLinkedExpressions[b].push(x)}if(!r.hasArticulation(v))switch(r.Articulations.push(v),v.articulationEnum){case ArticulationEnum.staccato:case ArticulationEnum.staccatissimo:r.DurationModifier=v;break;case ArticulationEnum.accent:case ArticulationEnum.strongaccent:r.VolumeModifier=v;break;default:break}}}catch(y){const m="Invalid note articulation.";loglevelExports.debug("addArticulationExpression",m,y);return}}}}addFermata(e,r){var a;let s=ArticulationEnum.fermata;e.attributes().length>0&&e.attribute("type")&&e.attribute("type").value==="inverted"&&(s=ArticulationEnum.invertedfermata);let o=PlacementEnum.Above;((a=e.attribute("placement"))==null?void 0:a.value)==="below"&&(o=PlacementEnum.Below),r.Articulations.push(new Articulation(s,o))}addTechnicalArticulations(e,r,s){var u,c;const o={bend:ArticulationEnum.bend,"down-bow":ArticulationEnum.downbow,"open-string":ArticulationEnum.naturalharmonic,"snap-pizzicato":ArticulationEnum.snappizzicato,stopped:ArticulationEnum.lefthandpizzicato,"up-bow":ArticulationEnum.upbow,harmonic:ArticulationEnum.naturalharmonic};for(const d in o){if(!o.hasOwnProperty(d))continue;const y=o[d],m=e.element(d);if(m){let g;((u=m.attribute("placement"))==null?void 0:u.value)==="above"&&(g=PlacementEnum.Above),((c=m.attribute("placement"))==null?void 0:c.value)==="below"&&(g=PlacementEnum.Below);const v=new Articulation(y,g);r.hasArticulation(v)||r.Articulations.push(v)}}const a=e.elements("fingering");for(const d of a){const y=this.createTechnicalInstruction(d,s);y.type=TechnicalInstructionType.Fingering,s.Fingering||(s.Fingering=y),r.TechnicalInstructions.push(y)}const l=e.element("string");if(l){const d=this.createTechnicalInstruction(l,s);d.type=TechnicalInstructionType.String,s.StringInstruction=d,r.TechnicalInstructions.push(d)}}createTechnicalInstruction(e,r){const s=new TechnicalInstruction;s.sourceNote=r,s.value=e.value;const o=e.attribute("placement");return this.rules.FingeringPositionFromXML&&(s.placement=this.getPlacement(o)),s}getPlacement(e,r=PlacementEnum.NotYetDefined){if(r!==PlacementEnum.NotYetDefined)return r;if(e)switch(e.value){case"above":return PlacementEnum.Above;case"below":return PlacementEnum.Below;case"left":return PlacementEnum.Left;case"right":return PlacementEnum.Right;default:return PlacementEnum.NotYetDefined}else return PlacementEnum.NotYetDefined}addOrnament(e,r){if(e){let s;const o={"delayed-inverted-turn":OrnamentEnum.DelayedInvertedTurn,"delayed-turn":OrnamentEnum.DelayedTurn,"inverted-mordent":OrnamentEnum.InvertedMordent,"inverted-turn":OrnamentEnum.InvertedTurn,mordent:OrnamentEnum.Mordent,"trill-mark":OrnamentEnum.Trill,turn:OrnamentEnum.Turn};for(const a in o){if(!o.hasOwnProperty(a))continue;const l=e.element(a);if(l){s=new OrnamentContainer(o[a]);const u=l.attribute("placement");u&&u.value==="below"&&(s.placement=PlacementEnum.Below)}}if(s){const a=e.elements("accidental-mark");if(a){let l=PlacementEnum.Below,u=AccidentalEnum.NONE;const c=a;for(let d=0,y=c.length;d0&&(this.currentVoiceEntry.GraceVoiceEntriesBefore=this.graceVoiceEntriesTempList,this.graceVoiceEntriesTempList=[]))}finalizeReadingMeasure(){this.graceVoiceEntriesTempList.length>0&&this.currentNormalVoiceEntry!==void 0&&this.currentNormalVoiceEntry.GraceVoiceEntriesAfter.concat(this.graceVoiceEntriesTempList),this.graceVoiceEntriesTempList=[],this.pluginManager.processVoiceMeasureReadPlugins(this.currMeasureVoiceEntries,this.activeKey,this.activeRhythm),this.currMeasureVoiceEntries.length=0,this.openBeams.length>1&&this.handleOpenBeam()}read(e,r,s,o,a,l,u,c,d,y,m,g,v,b,S,x,A,E,w,_,T,C,P){this.currentStaffEntry=u,this.currentMeasure=c;try{this.currentNote=l?this.addRestNote(e.element("rest"),r,o,s,a,v,b,w,e):this.addSingleNote(e,r,o,s,a,m,g,v,b,S,x,A,E,w,T,C,P),this.currentNote.DotsXml=_;const k=e.elements("lyric");this.lyricsReader!==void 0&&k&&(this.lyricsReader.addLyricEntry(k,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let M=!1;const R=e.element("notations");if(R){this.articulationReader&&this.readArticulations(R,this.currentVoiceEntry,this.currentNote);const H=R.elements("slur"),B=R.elements("slide"),F=R.elements("glissando");this.slurReader!==void 0&&(H.length>0||B.length>0)&&!this.currentNote.ParentVoiceEntry.IsGrace&&(this.slurReader.addSlur(H,this.currentNote),B.length>0&&this.slurReader.addSlur(B,this.currentNote),F.length>0&&this.slurReader.addSlur(F,this.currentNote));const I=R.elements("tuplet");I.length>0&&(this.openTupletNumber=this.addTuplet(e,I),M=!0);const U=R.element("arpeggiate");if(U!==void 0){let N;if(this.currentVoiceEntry.Arpeggio)N=this.currentVoiceEntry.Arpeggio;else{let O=!1;for(const Q of this.currentStaffEntry.VoiceEntries)if(Q.Arpeggio){O=!0,N=Q.Arpeggio;break}if(!O){let Q=ArpeggioType.ARPEGGIO_DIRECTIONLESS;const z=U.attribute("direction");if(z)switch(z.value){case"up":Q=ArpeggioType.ROLL_UP;break;case"down":Q=ArpeggioType.ROLL_DOWN;break;default:Q=ArpeggioType.ARPEGGIO_DIRECTIONLESS}N=new Arpeggio(this.currentVoiceEntry,Q),this.currentVoiceEntry.Arpeggio=N}}N.addNote(this.currentNote)}const D=R.elements("tied");D.length>0&&this.addTie(D,d,y,TieTypes.SIMPLE);const $=R.element("technical");if($){const N=$.elements("hammer-on");N.length>0&&this.addTie(N,d,y,TieTypes.HAMMERON);const O=$.elements("pull-off");O.length>0&&this.addTie(O,d,y,TieTypes.PULLOFF)}}e.element("time-modification")!==void 0&&!M&&this.handleTimeModificationNode(e)}catch(k){loglevelExports.warn(k);const M=ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(M),this.musicSheet.SheetErrors.pushMeasureError(k)}return this.currentNote}checkForStaffEntryLink(e,r,s,o){const a=new StaffEntryLink(this.currentVoiceEntry);a.LinkStaffEntries.push(s),s.Link=a;const l=this.currentVoiceEntry.Timestamp.clone(),u=o.getVerticalContainerByTimestamp(l);return s=u.StaffEntries[e],s||(s=new SourceStaffEntry(u,r),u.StaffEntries[e]=s),s.VoiceEntries.push(this.currentVoiceEntry),a.LinkStaffEntries.push(s),s.Link=a,s}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const e=this.openTieDict;for(const r in e)if(e.hasOwnProperty(r)){const s=e[r];Fraction$1.plus(s.StartNote.ParentStaffEntry.Timestamp,s.Duration).lt(s.StartNote.SourceMeasure.Duration)&&delete e[r]}}hasVoiceEntry(){return this.currentVoiceEntry!==void 0}readArticulations(e,r,s){const o=e.element("articulations");o&&this.articulationReader.addArticulationExpression(o,r);const a=e.element("fermata");a&&this.articulationReader.addFermata(a,r);const l=e.element("technical");l&&this.articulationReader.addTechnicalArticulations(l,r,s);const u=e.element("ornaments");u&&this.articulationReader.addOrnament(u,r)}addSingleNote(e,r,s,o,a,l,u,c,d,y,m,g,v,b,S,x,A){var xe;let E=0,w,_=AccidentalEnum.NONE,T=NoteEnum.C,C=NoteEnum.C,P=0,k=0,M,R,H;const B=e.elements();for(let ye=0,q=B.length;ye{const q=ye.getAttribute("begin"),re=ye.getAttribute("end");Q.push({begin:q?q/1e3:0,end:re?re/1e3:0})}),this.addNoteInfo(U,s,c,d,a,C,k,b,b,Q),U.TypeLength=o,U.IsGraceNote=y,U.StemDirectionXml=m,U.TremoloInfo=g,U.PlaybackInstrumentId=M,(R!==void 0&&R!=="normal"||H!==void 0)&&(U.Notehead=new Notehead(U,R,H)),U.NoteheadColorXml=b,U.NoteheadColor=b,U.PlaybackInstrumentId=M,U.TremoloType=S,U.glissandoType=x,U.slideType=A,this.currentVoiceEntry.addNote(U),m===StemDirectionType.None&&(v="#00000000"),this.currentVoiceEntry.StemDirectionXml=m,v&&(this.currentVoiceEntry.StemColorXml=v,this.currentVoiceEntry.StemColor=v,U.StemColorXml=v),e.elements("beam")&&!l&&this.createBeam(e,U),U}addRestNote(e,r,s,o,a,l,u,c,d){var _;const y=Fraction$1.createFromFraction(r),m=e.element("display-step"),g=e.element("display-octave");let v,b,S;m&&g&&(v=NoteEnum[m.value.toUpperCase()],b=parseInt(g.value,10),S=new Pitch(v,b,AccidentalEnum.NONE,void 0,!0));const x=new Note$1(this.currentVoiceEntry,this.currentStaffEntry,y,S,this.currentMeasure,!0);let A=[];const E=e.element("times")||d.element("times"),w=(_=E==null?void 0:E.elem)==null?void 0:_.getElementsByTagName("time");return w&&w.length&&Array.from(w).forEach(T=>{const C=T.getAttribute("begin"),P=T.getAttribute("end");A.push({begin:C?C/1e3:0,end:P?P/1e3:0})}),this.addNoteInfo(x,s,l,u,a,v,b,c,c,A),x.TypeLength=o,this.currentVoiceEntry.Notes.push(x),this.openBeams.length>0&&this.openBeams.last().ExtendedNoteList.push(x),x}addNoteInfo(e,r,s,o,a,l,u,c,d,y){e.NoteTypeXml=r,e.PrintObject=s,e.IsCueNote=o,e.NormalNotes=a,e.displayStepUnpitched=l,e.displayOctaveUnpitched=u,e.NoteheadColorXml=c,e.NoteheadColor=c,e.noteTimeInfo=y}createBeam(e,r){var s;try{const o=e.element("beam");let a;if(o!==void 0&&o.hasAttributes&&(a=o.attribute("number")),a){let l=parseInt(a.value,10);const u=e.elements("beam"),c=u[0].value;u&&(c==="begin"?(l===((s=this.openBeams.last())==null?void 0:s.BeamNumber)?(this.beamNumberOffset++,l+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new Beam(l,this.beamNumberOffset))):l+=this.beamNumberOffset);let d=!1;if(!(l>0&&l<=this.openBeams.length)||!this.openBeams[l-1]){loglevelExports.debug("[OSMD] invalid beamnumber");return}for(let y=0,m=this.openBeams[l-1].Notes.length;y1){let a=e.element("time-modification");a&&(a=a.element("actual-notes"));const l=r;for(let u=0,c=l.length;u1&&this.openTupletNumber--),this.tupletDict[v]=S;const A=[];A.push(this.currentNote),S.Notes.push(A),S.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=S,this.openTupletNumber=v}else if(g.value==="stop"){let v=1;d.attribute("number")&&(v=parseInt(d.attribute("number").value,10));const b=this.tupletDict[v];if(b){const S=d.attribute("placement");S&&(S.value==="below"?b.tupletLabelNumberPlacement=PlacementEnum.Below:b.tupletLabelNumberPlacement=PlacementEnum.Above,b.PlacementFromXml=!0);const x=[];if(x.push(this.currentNote),b.Notes.push(x),!b.PlacementFromXml){let A=!1;for(const E of b.Notes){for(const w of E)if(!w.isRest()){w.StemDirectionXml===StemDirectionType.Down?b.tupletLabelNumberPlacement=PlacementEnum.Below:b.tupletLabelNumberPlacement=PlacementEnum.Above,A=!0;break}if(A)break}}b.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=b,delete this.tupletDict[v],Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(r[0]){const a=r[0];if(a.hasAttributes){const l=a.attribute("type").value;let u=1;a.attribute("number")&&(u=parseInt(a.attribute("number").value,10));const c=isNaN(u),d=this.readShowNumberNoneGiven(a),y=a.attribute("bracket");if(y&&y.value==="yes"?(s=!0,o=!0):y&&y.value==="no"&&(o=!1),l==="start"){let m=0,g=e.element("time-modification");if(g&&(g=g.element("actual-notes")),g&&(m=parseInt(g.value,10),isNaN(m))){const x=ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(x),new MusicSheetReadingException(x)}c&&(this.openTupletNumber++,u=this.openTupletNumber);let v=this.tupletDict[u];v||(v=this.tupletDict[u]=new Tuplet(m,s),v.BracketedXmlValue=o,v.ShowNumberNoneGivenInXml=d,v.tupletLabelNumberPlacement=PlacementEnum.Above);const b=a.attribute("placement");b&&(b.value==="below"?v.tupletLabelNumberPlacement=PlacementEnum.Below:v.tupletLabelNumberPlacement=PlacementEnum.Above,v.PlacementFromXml=!0);const S=[];S.push(this.currentNote),v.Notes.push(S),v.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=v,this.openTupletNumber=u}else if(l==="stop"){c&&(u=this.openTupletNumber);const m=this.tupletDict[this.openTupletNumber];if(m){const g=a.attribute("placement");g&&(g.value==="below"?m.tupletLabelNumberPlacement=PlacementEnum.Below:m.tupletLabelNumberPlacement=PlacementEnum.Above,m.PlacementFromXml=!0);const v=[];if(v.push(this.currentNote),m.Notes.push(v),!m.PlacementFromXml){let b=!1;for(const S of m.Notes){for(const x of S)if(!x.isRest()){x.StemDirectionXml===StemDirectionType.Down?m.tupletLabelNumberPlacement=PlacementEnum.Below:m.tupletLabelNumberPlacement=PlacementEnum.Above,b=!0;break}if(b)break}}m.Fractions.push(this.getTupletNoteDurationFromType(e)),this.currentNote.NoteTuplet=m,Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[u]}}}}return this.openTupletNumber}readShowNumberNoneGiven(e){const r=e.attribute("show-number");return!!(r!=null&&r.value&&r.value==="none")}handleTimeModificationNode(e){if(this.tupletDict[this.openTupletNumber])try{const r=this.tupletDict[this.openTupletNumber],s=CollectionUtil.last(r.Notes),o=s[0].ParentVoiceEntry;let a;o.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?a=s:(a=[],r.Notes.push(a),r.Fractions.push(this.getTupletNoteDurationFromType(e))),a.push(this.currentNote),this.currentNote.NoteTuplet=r}catch(r){const s=ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(s),r}else if(this.currentVoiceEntry.Notes.length>0){const r=this.currentVoiceEntry.Notes[0];if(r.NoteTuplet){const s=r.NoteTuplet;CollectionUtil.last(s.Notes).push(this.currentNote),this.currentNote.NoteTuplet=s}}}addTie(e,r,s,o){if(e){if(e.length===1){const a=e[0];if(a!==void 0&&a.attributes()){const l=this.getTieDirection(a),u=a.attribute("type").value;try{if(u==="start"){const c=this.findCurrentNoteInTieDict(this.currentNote);c<0&&delete this.openTieDict[c];const d=this.getNextAvailableNumberForTie(),y=new Tie(this.currentNote,o);this.openTieDict[d]=y,y.TieNumber=d,y.TieDirection=l}else if(u==="stop"){const c=this.findCurrentNoteInTieDict(this.currentNote),d=this.openTieDict[c];d&&(d.AddNote(this.currentNote),delete this.openTieDict[c])}}catch(c){const d=ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(d)}}}else if(e.length===2){const a=this.findCurrentNoteInTieDict(this.currentNote);if(a>=0){const l=this.openTieDict[a];l.AddNote(this.currentNote);for(const u of e)if(u.attribute("type").value==="start"){const d=this.getTieDirection(u);l.NoteIndexToTieDirection[l.Notes.length-1]=d}}}}}getTieDirection(e){let r=PlacementEnum.NotYetDefined;const s=e.attribute("placement");s&&(s.value==="above"?r=PlacementEnum.Above:s.value==="below"&&(r=PlacementEnum.Below));const o=e.attribute("orientation");return o&&(o.value==="over"?r=PlacementEnum.Above:o.value==="under"&&(r=PlacementEnum.Below)),r}getNextAvailableNumberForTie(){const e=Object.keys(this.openTieDict);if(e.length===0)return 1;e.sort((r,s)=>+r-+s);for(let r=0;r0?o.RealValue>0?(d=Fraction$1.multiply(Fraction$1.minus(o,a),d),this.directionTimestamp=Fraction$1.plus(d,o)):this.directionTimestamp=Fraction$1.createFromFraction(d):this.offsetDivisions<0&&(o.RealValue>0?(d=Fraction$1.multiply(Fraction$1.minus(o,a),d),this.directionTimestamp=Fraction$1.minus(o,d)):this.directionTimestamp=Fraction$1.createFromFraction(d));let y;const m=e.element("direction-type");let g;if(m&&(g=m.element("wedge"),g)){const b=g.attribute("default-y");b&&(y=this.readPosition(b))}this.WedgeYPosXml=y;const v=e.attribute("placement");if(v)try{const b=v.value;b==="below"?this.placement=PlacementEnum.Below:b==="above"&&(this.placement=PlacementEnum.Above)}catch(b){const S=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");loglevelExports.debug("ExpressionReader.readExpressionParameters",S,b),this.musicSheet.SheetErrors.pushMeasureError(S),this.placement=PlacementEnum.Below}if(this.placement===PlacementEnum.NotYetDefined)try{if(m){const b=m.element("dynamics");if(b){const A=b.attribute("default-y");A&&this.readExpressionPlacement(A,"read dynamics y pos")}if(g){const A=g.attribute("default-y");A&&this.readExpressionPlacement(A,"read wedge y pos")}const S=m.element("words");if(S){const A=S.attribute("default-y");A&&this.readExpressionPlacement(A,"read words y pos")}const x=m.element("rehearsal");if(x){const A=x.attribute("default-y");A&&this.readExpressionPlacement(A,"read rehearsal pos")}}}catch(b){const S=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement. Set to default.");loglevelExports.debug("ExpressionReader.readExpressionParameters",S,b),this.musicSheet.SheetErrors.pushMeasureError(S),this.placement=PlacementEnum.Below}this.placement===PlacementEnum.NotYetDefined&&(r.Staves.length>1?this.placement=PlacementEnum.Below:r.HasLyrics?this.placement=PlacementEnum.Above:this.placement=PlacementEnum.Below)}read(e,r,s,o=void 0,a=0,l){let u=!1,c=!1;const d=e.element("sound");if(d){const g=d.attribute("tempo"),v=d.attribute("dynamics");if(g){const b=g.value.match(/^(\d+)(\.\d+)?$/);(b==null?void 0:b.length)>0?this.soundTempo=Math.round(Number.parseFloat(g.value)):(loglevelExports.info("invalid xml tempo: "+g.value),this.soundTempo=100),r.TempoInBPM=this.soundTempo,this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,u=!0}if(v){const b=v.value.match(/\d+/);this.soundDynamic=b!==void 0?parseInt(b[0],10):100,c=!0}}const y=e.element("direction-type");if(!y)return;let m=y.element("metronome");if(m){r.metronomeNoteIndex=a;const g=m.element("beat-unit"),v=m.element("beat-unit-dot")!==void 0,b=m.element("per-minute");if(g!==void 0&&b){m.hasAttributes&&m.attribute("default-x")!==void 0&&(this.directionTimestamp=Fraction$1.createFromFraction(s));const x=parseFloat(b.value);!l&&this.createNewTempoExpressionIfNeeded(r);const A=new InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,x,this.currentMultiTempoExpression,!0);A.parentMeasure=r,this.soundTempo=x,r.TempoInBPM=this.soundTempo*(v?1.5:1),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),r.MeasureNumberXML===1&&this.musicSheet.SourceMeasures.length===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,A.dotted=v,A.beatUnit=g.value,this.currentMultiTempoExpression.addExpression(A,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}return}if(m=y.element("dynamics"),m){const g=e.element("notations")!==void 0;this.interpretInstantaneousDynamics(m,r,s,g);return}if(m=y.element("words"),m){const g=y.elements("words");let v="";for(const b of g)v+=b.value;if(m.value=v,u||isSpeedKeyword(m.value)||isSpeedHiddenKeyword(m.value)){this.createNewTempoExpressionIfNeeded(r),this.currentMultiTempoExpression.CombinedExpressionsText=m.value,(isSpeedKeyword(m.value)||isSpeedHiddenKeyword(m.value))&&(m.value=void 0);const b=new InstantaneousTempoExpression(m.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(b,"")}else c||this.interpretWords(m,r,s);return}if(m=y.element("wedge"),m){this.interpretWedge(m,r,o,r.MeasureNumber);return}if(m=y.element("rehearsal"),m){this.interpretRehearsalMark(m,r,s,r.MeasureNumber);return}}closeOpenExpressions(e,r){for(const s of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(e,s.NumberXml,r),this.closeOpenContinuousDynamic(s,e,r);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(Fraction$1.plus(e.AbsoluteTimestamp,r))}addOctaveShift(e,r,s){var u;let o=1;const a=e.element("staff");if(a)try{o=parseInt(a.value,10)}catch(c){const d=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number. Set to default");this.musicSheet.SheetErrors.pushMeasureError(d),o=1,loglevelExports.debug("ExpressionReader.addOctaveShift",d,c)}const l=e.element("direction-type");if(l){const c=l.element("octave-shift"),d=this.readPlacement(e);if(c!==void 0&&c.hasAttributes)try{const y=this.readNumber(c);if(c.attribute("size")){const m=parseInt(c.attribute("size").value,10);let g=0;m===8?g=1:m===15&&(g=2);let v=(u=c.attribute("type"))==null?void 0:u.value;if(v||(d===PlacementEnum.Above?v="down":d===PlacementEnum.Below&&(v="up")),v==="up"||v==="down"){const b=new OctaveShift(v,g);b.StaffNumber=o,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(r,y),this.getMultiExpression.OctaveShiftStart=b,b.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=b}else if(v==="stop"){if(this.openOctaveShift){this.getMultiExpression=this.createNewMultiExpressionIfNeeded(r,this.openOctaveShift.numberXml,s);const b=this.getMultiExpression;b.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0}}else v||loglevelExports.debug("octave-shift missing type in xml")}}catch(y){const m=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(m),loglevelExports.debug("ExpressionReader.addOctaveShift",m,y)}}}addPedalMarking(e,r,s){var a,l,u;const o=e.element("direction-type");if(o){const c=o.element("pedal");if(c!==void 0&&c.hasAttributes){let d=!1,y=!1;try{switch(((a=c.attribute("line"))==null?void 0:a.value)==="yes"?y=!0:((l=c.attribute("line"))==null?void 0:l.value)==="no"?(y=!1,d=!0):((u=c.attribute("sign"))==null?void 0:u.value)==="yes"?d=!0:(d=!1,y=!0),c.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(r),this.createNewMultiExpressionIfNeeded(r,-1),this.openPedal=new Pedal(y,d),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(r,s);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(r,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(r,-1),this.openPedal=new Pedal(y,d),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression);break;case"continue":break;default:break}}catch(m){const g=ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(g),loglevelExports.debug("ExpressionReader.addPedalMarking",g,m)}}}}endOpenPedal(e,r){this.createNewMultiExpressionIfNeeded(e,-1,r),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}addWavyLine(e,r,s,o){if(e&&e.hasAttributes)try{switch(e.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(r,-1),this.openWavyLine=new WavyLine(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(r,-1,s),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0);break;case"continue":break;default:break}}catch(a){const l=ITextTranslation.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(l),loglevelExports.debug("ExpressionReader.addWavyLine",l,a)}}initialize(){this.placement=PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(e){var s;const r=(s=e.attribute("placement"))==null?void 0:s.value;return r==="above"?PlacementEnum.Above:r==="below"?PlacementEnum.Below:PlacementEnum.NotYetDefined}readExpressionPlacement(e,r){try{const s=this.readPosition(e);s<0?this.placement=PlacementEnum.Below:s>0&&(this.placement=PlacementEnum.Above)}catch(s){loglevelExports.debug("ExpressionReader.readExpressionParameters",r,s)}}readPosition(e){try{const r=parseInt(e.value,10);return r<0?this.placement=PlacementEnum.Below:r>0&&(this.placement=PlacementEnum.Above),r}catch(r){loglevelExports.debug("ExpressionReader.readExpressionParameters",r)}}interpretInstantaneousDynamics(e,r,s,o){var a,l,u;if(e.hasElements){e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(s));const c=this.readNumber(e);let d=(a=e.elements()[0])==null?void 0:a.name;if(d==="other-dynamics"&&(d=e.elements()[0].value),d){if((l=r.Rules)!=null&&l.IgnoreRepeatedDynamics){let m;try{m=DynamicEnum[d]}catch(g){const v=ITextTranslation.translateText("ReaderErrorMessages/DynamicError","Error while reading dynamic.");this.musicSheet.SheetErrors.pushMeasureError(v);return}if(((u=this.activeInstantaneousDynamic)==null?void 0:u.DynEnum)===m)return}o?this.createNewMultiExpressionIfNeeded(r,c,Fraction$1.createFromFraction(s)):this.createNewMultiExpressionIfNeeded(r,c);const y=new InstantaneousDynamicExpression(d,this.soundDynamic,this.placement,this.staffNumber,r);y.InMeasureTimestamp=s.clone(),this.getMultiExpression.addExpression(y,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=y.DynEnum:this.activeInstantaneousDynamic=new InstantaneousDynamicExpression(d,0,PlacementEnum.NotYetDefined,1,r)}}}interpretWords(e,r,s){var v;const o=e.value;if(r.Rules.IgnoreBracketsWords&&(/^\(\s*\)$/.test(o)||/^\[\s*\]$/.test(o)))return;let a;const l=e.attribute("font-style");let u,c,d;l&&(u=l.value,u==="italic"&&(a=FontStyles.Italic));const y=e.attribute("font-weight");y&&(c=y.value,c==="bold"&&(a=FontStyles.Bold,u==="italic"&&(a=FontStyles.BoldItalic)));const m=e.attribute("color");m&&(d=m.value);let g;if(r.Rules.PlaceWordsInsideStafflineFromXml){const b=(v=e.attribute("default-y"))==null?void 0:v.value;(b==null?void 0:b.length)>0&&(g=Number.parseInt(b,10))}if(o.length>0){if(e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(s)),this.checkIfWordsNodeIsRepetitionInstruction(o))return;this.fillMultiOrTempoExpression(o,r,s,a,d,g),this.initialize()}}readNumber(e){var o;let r=1;const s=(o=e.attribute("number"))==null?void 0:o.value;return s&&(r=Number.parseInt(s,10)),r}interpretWedge(e,r,s,o){var u,c;e!==void 0&&e.hasAttributes&&e.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(s));const a=this.readNumber(e),l=(c=(u=e.attribute("type"))==null?void 0:u.value)==null?void 0:c.toLowerCase();this.lastWedge&&this.lastWedge.parentMeasure.MeasureNumberXML===r.MeasureNumberXML&&this.lastWedge.StaffNumber===this.staffNumber&&this.placement===this.lastWedge.Placement&&this.WedgeYPosXml!==void 0&&this.lastWedge.YPosXml===this.WedgeYPosXml&&this.lastWedge.StartMultiExpression.Timestamp.Equals(this.directionTimestamp)&&this.lastWedge.DynamicType===ContDynamicEnum[l]||(l==="stop"?this.createNewMultiExpressionIfNeeded(r,a,s):this.createNewMultiExpressionIfNeeded(r,a),this.addWedge(e,r,s),this.initialize())}interpretRehearsalMark(e,r,s,o){r.rehearsalExpression=new RehearsalExpression(e.value,this.placement)}createNewMultiExpressionIfNeeded(e,r,s=void 0){s||(s=this.directionTimestamp);let o=this.getMultiExpression;return(!o||o&&(o.SourceMeasureParent!==e||o.numberXml!==r||o.SourceMeasureParent===e&&o.Timestamp!==s))&&(this.getMultiExpression=o=new MultiExpression(e,Fraction$1.createFromFraction(s)),e.StaffLinkedExpressions[this.globalStaffIndex].push(o)),o}createNewTempoExpressionIfNeeded(e){(!this.currentMultiTempoExpression||this.currentMultiTempoExpression.SourceMeasureParent!==e||this.currentMultiTempoExpression.Timestamp!==this.directionTimestamp)&&(this.currentMultiTempoExpression=new MultiTempoExpression(e,Fraction$1.createFromFraction(this.directionTimestamp)),e.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(e,r,s){if(e!==void 0&&e.hasAttributes){const o=this.readNumber(e),a=e.attribute("type").value.toLowerCase();try{if(a==="crescendo"||a==="diminuendo"){const l=new ContinuousDynamicExpression(ContDynamicEnum[a],this.placement,this.staffNumber,r,this.activeInstantaneousDynamic,o);this.lastWedge=l,this.lastWedge.YPosXml=this.WedgeYPosXml,this.openContinuousDynamicExpressions.push(l);let u=this.getMultiExpression;u||(u=this.createNewMultiExpressionIfNeeded(r,o)),u.StartingContinuousDynamic=l,l.StartMultiExpression=u,this.activeInstantaneousDynamic!==void 0&&this.activeInstantaneousDynamic.StaffNumber===l.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if(a==="stop")for(const l of this.openContinuousDynamicExpressions)l.NumberXml===o&&this.closeOpenContinuousDynamic(l,r,s)}catch(l){const u="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(u),loglevelExports.debug("ExpressionReader.addWedge",u,l)}}}fillMultiOrTempoExpression(e,r,s,o,a,l=void 0){if(!e)return;const u=e.trim();this.createExpressionFromString("",u,r,s,e,o,a,l)}createExpressionFromString(e,r,s,o,a,l,u,c=void 0){if(InstantaneousTempoExpression.isInputStringInstantaneousTempo(r)||ContinuousTempoExpression.isInputStringContinuousTempo(r)){if(s.TempoExpressions.length>0)for(let g=0,v=s.TempoExpressions.length;g0)for(let g=0,v=s.TempoExpressions.length;g0&&!this.hasDigit(r)&&this.globalStaffIndex>0){if(b.EntriesList[0].label.indexOf(r)>=0)return!1;break}}let y=TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(y=TextAlignmentEnum.LeftBottom);const m=new UnknownExpression(r,this.placement,y,this.staffNumber);return m.fontStyle=l,m.ColorXML=u,m.defaultYXml=c,d.addExpression(m,e),!1}closeOpenContinuousDynamic(e,r,s){if(!e)return;const o=e.NumberXml;e.EndMultiExpression=this.createNewMultiExpressionIfNeeded(r,o,s),e.StartMultiExpression.EndingContinuousDynamic=e,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(a=>a!==e)}closeOpenContinuousTempo(e){this.openContinuousTempoExpression.AbsoluteEndTimestamp=e,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(e){return e=e.trim().toLowerCase(),e==="coda"||e==="tocoda"||e==="to coda"||e==="fine"||e==="d.c."||e==="dacapo"||e==="da capo"||e==="d.s."||e==="dalsegno"||e==="dal segno"||e==="d.c. al fine"||e==="d.s. al fine"||e==="d.c. al coda"||e==="d.s. al coda"}hasDigit(e){return/\d/.test(e)}}class SlurReader{constructor(e){this.openSlurDict={},this.musicSheet=e}addSlur(e,r,s){try{if(e){for(const o of e)if(o.attributes().length>0){const a=o.attribute("type").value;let l=1;try{o.attribute("number")&&(l=parseInt(o.attribute("number").value,10))}catch(y){loglevelExports.debug("VoiceGenerator.addSlur number: ",y)}let u=PlacementEnum.NotYetDefined;const c=o.attribute("placement");c&&c.value&&(c.value==="above"?u=PlacementEnum.Above:c.value==="below"&&(u=PlacementEnum.Below));const d=o.attribute("orientation");if(d&&d.value&&(d.value==="over"?u=PlacementEnum.Above:d.value==="under"&&(u=PlacementEnum.Below)),a==="start"){let y=new Slur;this.openSlurDict[l]=y,y.StartNote=r,y.idx=s,y.PlacementXml=u}else if(a==="stop"){const y=this.openSlurDict[l];if(y){const m=o.name;if(m==="slide"||m==="glissando"){const g=y.StartNote,v=new Glissando(g);v.AddNote(r),v.EndNote=r,r.NoteGlissando=v,delete this.openSlurDict[l]}else y.idx=s,y.EndNote=r,r.isDuplicateSlur(y)||(r.NoteSlurs.push(y),y.StartNote.NoteSlurs.push(y)),delete this.openSlurDict[l]}}}}}catch(o){const a=ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(a)}}}class InstrumentReader{constructor(e,r,s,o){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.soundTempos=new Map,this.xmlNotes=[],this.repetitionInstructionReader=r,this.xmlMeasureList=s,this.musicSheet=o.GetMusicSheet,this.instrument=o,this.activeClefs=new Array(o.Staves.length),this.activeClefsHaveBeenInitialized=new Array(o.Staves.length);for(let a=0;a=this.xmlMeasureList.length)return!1;this.currentMeasure=e,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(e,this.currentXmlMeasureIndex);let o=new Fraction$1(0,1),a=new Fraction$1(0,1),l=!1;this.maxTieNoteFraction=new Fraction$1(0,1);let u=!1;const c=[];let d=!1;try{const w=this.xmlMeasureList[this.currentXmlMeasureIndex],_=w.elements();if(e.Rules.UseXMLMeasureNumbers&&!Number.isInteger(e.MeasureNumberXML)){const C=parseInt((y=w.attribute("number"))==null?void 0:y.value,10);Number.isInteger(C)&&(e.MeasureNumberXML=C)}let T;for(let C=0;C<_.length;C++){const P=_[C];if(C>0&&(T=_[C-1]),P.name==="print"){const k=P.attribute("new-system");(k==null?void 0:k.value)==="yes"&&(e.printNewSystemXml=!0);const M=P.attribute("new-page");(M==null?void 0:M.value)==="yes"&&(e.printNewPageXml=!0)}else if(P.name==="attributes"){const k=P.element("divisions");if(k&&(this.divisions=parseInt(k.value,10),isNaN(this.divisions))){const H=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(loglevelExports.debug("InstrumentReader.readNextXmlMeasure",H),this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(H+this.instrument.Name);else throw l=!0,new MusicSheetReadingException(H+this.instrument.Name)}if(!P.element("divisions")&&this.divisions===0&&this.currentXmlMeasureIndex===0){const H=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(H+this.instrument.Name);else throw l=!0,new MusicSheetReadingException(H+this.instrument.Name)}this.addAbstractInstruction(P,s,T,o.clone()),o.Equals(new Fraction$1(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],P)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],P,o)&&this.saveClefInstructionAtEndOfMeasure();const M=P.elements("staff-details");for(const H of M){const B=H.element("staff-lines");if(B){let F=1;const I=H.attribute("number");I&&(F=parseInt(I.value,10)),this.instrument.Staves[F-1].StafflineCount=parseInt(B.value,10)}}const R=P.element("measure-style");if(R){const H=R.element("multiple-rest");if(H){const B=H.value;let F=0;try{F=Number.parseInt(B,10),e.multipleRestMeasures!==void 0&&F!==e.multipleRestMeasures?e.multipleRestMeasures=0:(e.multipleRestMeasures=F,this.currentMultirestStartMeasure=e,this.followingMultirestMeasures=F+1)}catch(I){console.log("multirest parse error: "+I)}}}}else if(P.name==="note"){let k=!0;((m=P.attribute("print-object"))==null?void 0:m.value)==="no"&&(k=!1);const M=this.getNoteStaff(P);this.currentStaff=this.instrument.Staves[M-1];const R=P.element("chord")!==void 0;if(P.element("voice")){const V=parseInt(P.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(V,M-1)}else(!R||!this.currentVoiceGenerator)&&(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,M-1));let H=0,B=new Fraction$1(0,1),F=2,I,U=!1;if(P.element("duration")){if(H=parseInt(P.element("duration").value,10),isNaN(H)){const V=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(V),loglevelExports.debug("InstrumentReader.readNextXmlMeasure",V);continue}else if(B=new Fraction$1(H,4*this.divisions),H===0?B=this.getNoteDurationFromTypeNode(P):I=this.getNoteDurationFromTypeNode(P),P.element("time-modification")){B=this.getNoteDurationForTuplet(P);const V=P.element("time-modification");V!=null&&V.element("normal-notes")&&(F=parseInt(V.element("normal-notes").value,10)),U=!0}}const D=P.element("rest")!==void 0,$=P.combinedElement("notations"),N=P.element("grace")!==void 0||H===0||R&&u;let O=!1,Q=!1;if(N){const V=P.element("duration"),pe=P.element("grace");pe&&pe.attributes()&&pe.attribute("slash")&&pe.attribute("slash").value==="yes"&&(O=!0),V||(B=this.getNoteDurationFromTypeNode(P)),$&&$.element("slur")&&(Q=!0)}const[z,W]=this.getCueNoteAndNoteTypeXml(P),[xe,ye,q]=this.getStemDirectionAndColors(P);let re,ue=0,ge="",Se="",Be="";if($){const V=$.element("ornaments");if(V){re=this.getTremoloInfo(V),this.getWavyLines(V,P,o,a);const he=V.element("tremolo");if(he){const Ae=he.attribute("type");if(ge=Ae.value,Ae){const _e=parseInt(he.value,10);_e>0&&(ue=_e),(Ae.value==="start"||Ae.value==="stop")&&(B=new Fraction$1(parseInt(P.element("duration").value,10),4*this.divisions))}}const Ce=V.elements("wavy-line");if(Ce!==void 0)for(const Ae of Ce){const _e=this.expressionReaders[this.readExpressionStaffNumber(P)-1];_e&&(_e.readExpressionParameters(Ae,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),_e.addWavyLine(Ae,this.currentMeasure,o,a))}}$.elements("glissando").find(he=>he.attribute("type").value==="start")&&(Se="start"),$.elements("slide").find(he=>he.attribute("type").value==="start")&&(Be="start")}const Ie=R?a.clone():o.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(Ie,this.inSourceMeasureInstrumentIndex+M-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!R&&!N&&!u||N&&!u||N&&!R||!N&&u)&&this.currentVoiceGenerator.createVoiceEntry(Ie,this.currentStaffEntry,this.activeKey,this.ActiveRhythm,N,O,Q),!N&&!R&&(a=o.clone(),o.Add(B)),R&&this.currentStaffEntry!==void 0&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+M-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const J=this.currentStaffEntry!==void 0&&this.currentStaffEntry.Timestamp!==void 0&&this.currentStaffEntry.Timestamp.Equals(new Fraction$1(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,J),this.activeRhythm,!U&&!N&&(B=new Fraction$1(H,4*this.divisions));const se=P.elements("dot").length;if(this.currentVoiceGenerator.read(P,B,I,W,F,D,this.currentStaffEntry,this.currentMeasure,r,this.maxTieNoteFraction,R,s,k,z,N,xe,re,ye,q,se,ge,Se,Be),$!==void 0&&$.element("dynamics")){const V=this.expressionReaders[this.readExpressionStaffNumber(P)-1];V&&(V.readExpressionParameters(P,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),V.read(P,this.currentMeasure,a,void 0,c.length))}u=N}else if(P.name==="forward"){const k=parseInt(P.element("duration").value,10);o.Add(new Fraction$1(k,4*this.divisions))}else if(P.name==="backup"){const k=parseInt(P.element("duration").value,10);o.Sub(new Fraction$1(k,4*this.divisions)),o.IsNegative()&&(o=new Fraction$1(0,1)),a.Sub(new Fraction$1(k,4*this.divisions)),a.IsNegative()&&(a=new Fraction$1(0,1))}else if(P.name==="direction"){const k=P.elements("direction-type"),M=P.element("direction-type");let R=Math.min(1,o.RealValue);this.activeRhythm!==void 0&&this.activeRhythm.Rhythm&&(R/=this.activeRhythm.Rhythm.RealValue);let H=!1;if(this.repetitionInstructionReader&&(H=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(M,R)),!H){let B=this.expressionReaders[0];const F=this.readExpressionStaffNumber(P)-1;if(FD==null?void 0:D.toLocaleLowerCase()).includes((g=I.value)==null?void 0:g.toLocaleLowerCase())&&(this.currentGradualChangeMeasure=this.currentMeasure,this.currentMeasure.speedInfo={startWord:(v=I.value)==null?void 0:v.toLocaleLowerCase(),startXmlNoteIndex:c.length,endXmlNoteIndex:0,resetXmlNoteIndex:0,startMeasureListIndex:this.currentXmlMeasureIndex,endMeasureListIndex:0,resetMeasureListIndex:0},this.xmlNotes=[]),I.value.startsWith(GRADIENT_SPEED_CLOSE_TAG)&&((b=this.currentGradualChangeMeasure)!=null&&b.speedInfo)&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:this.xmlNotes.length,endMeasureListIndex:this.currentXmlMeasureIndex}),((S=I.value)==null?void 0:S.toLocaleLowerCase())==="a tempo".toLocaleLowerCase()&&((x=this.currentGradualChangeMeasure)!=null&&x.speedInfo)){const{endXmlNoteIndex:D,resetXmlNoteIndex:$,endMeasureListIndex:N}=this.currentGradualChangeMeasure.speedInfo;$===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:D||this.xmlNotes.length,endMeasureListIndex:N||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}I.value&&I.value.toLocaleLowerCase()==="hiddenspeed"?d=!0:d=!1}if(k.find(U=>U.element("metronome"))&&((A=this.currentGradualChangeMeasure)!=null&&A.speedInfo)){const{endXmlNoteIndex:U,resetXmlNoteIndex:D,endMeasureListIndex:$}=this.currentGradualChangeMeasure.speedInfo;D===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:U||this.xmlNotes.length,endMeasureListIndex:$||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}B.readExpressionParameters(P,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),B.read(P,this.currentMeasure,o,a.clone(),c.length,d)}}}else if(P.name==="barline"){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(P)&&(this.currentMeasure.HasEndLine=!0);const k=P.attribute("location");if(C===_.length-1||k&&k.value==="right"){const R=(E=P.element("bar-style"))==null?void 0:E.value;R&&(this.currentMeasure.endingBarStyleXml=R,this.currentMeasure.endingBarStyleEnum=SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(R))}}else if(P.name==="sound")try{if(P.attribute("tempo")){const k=parseFloat(P.attribute("tempo").value);P.element("offset")&&(this.soundTempos.has(this.currentXmlMeasureIndex)||this.soundTempos.set(this.currentXmlMeasureIndex,[]),this.soundTempos.get(this.currentXmlMeasureIndex).push(k)),this.currentXmlMeasureIndex===0&&(this.musicSheet.DefaultStartTempoInBpm=k,this.musicSheet.HasBPMInfo=!0)}}catch(k){loglevelExports.debug("InstrumentReader.readTempoInstruction",k)}else if(P.name==="harmony"){const k=this.getNoteStaff(P);this.currentStaff=this.instrument.Staves[k-1];const M=o.clone();this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(M,this.inSourceMeasureInstrumentIndex+k-1,this.currentStaff).staffEntry,this.currentStaffEntry.ChordContainers.push(ChordSymbolReader.readChordSymbol(P,this.musicSheet,this.activeKey))}}for(const C in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(C)&&this.voiceGeneratorsDict[C].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let C=0;C{this.voiceGeneratorsDict[C].finalizeReadingMeasure()}),this.musicSheet.HasBPMInfo?e.TempoInBPM===0&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=window.baseMeasureSpeed||120}catch(w){if(l)throw new MusicSheetReadingException(w.Message);const _=ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(_),loglevelExports.debug("InstrumentReader.readNextXmlMeasure",_,w)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}getStemDirectionAndColors(e){let r=StemDirectionType.Undefined,s;const o=e.element("stem");if(o){r=this.getStemDirectionType(o);const u=o.attribute("color");u&&(s=this.parseXmlColor(u.value))}let a=this.getNoteHeadColorXml(e);const l=this.getNoteColorXml(e);return l&&!a&&(a=l),l&&!s&&(s=l),[r,s,a]}parseXmlColor(e){if(e)return e.length===7?e:e.length===9?"#"+e.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const e in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(e)&&this.voiceGeneratorsDict[e].checkOpenTies()}getOrCreateVoiceGenerator(e,r){const s=this.instrument.Staves[r];let o=this.voiceGeneratorsDict[e];if(o)s.Voices.indexOf(o.GetVoice)===-1&&s.Voices.push(o.GetVoice);else{const a=this.staffMainVoiceGeneratorDict[r];a?(o=new VoiceGenerator(this.pluginManager,s,e,this.slurReader,a.GetVoice),s.Voices.push(o.GetVoice),this.voiceGeneratorsDict[e]=o):(o=new VoiceGenerator(this.pluginManager,s,e,this.slurReader),s.Voices.push(o.GetVoice),this.voiceGeneratorsDict[e]=o,this.staffMainVoiceGeneratorDict[r]=o)}return o}createExpressionGenerators(e){this.expressionReaders=new Array(e);for(let r=0;r0?r=this.musicSheet.SourceMeasures[0]:r=this.currentMeasure;const s=new ClefInstruction(ClefEnum.G,0,2);let o;r.FirstInstructionsStaffEntries[e]?(o=r.FirstInstructionsStaffEntries[e],o.removeFirstInstructionOfTypeClefInstruction()):(o=new SourceStaffEntry(void 0,void 0),r.FirstInstructionsStaffEntries[e]=o),s.Parent=o,o.Instructions.splice(0,0,s)}createDefaultKeyInstruction(){let e;this.musicSheet.SourceMeasures.length>0?e=this.musicSheet.SourceMeasures[0]:e=this.currentMeasure;const r=new KeyInstruction(void 0,0,KeyEnum.major);for(let s=this.inSourceMeasureInstrumentIndex;s0&&s[o-1].name==="backup")return!0;let a=-1;for(let l=0;l0||a<0}isAttributesNodeAtEndOfMeasure(e,r,s){var u;if(s.Equals((u=this.ActiveRhythm)==null?void 0:u.Rhythm))return!0;const o=e.elements().slice();let a=0;for(let c=0;cl}getNoteDurationFromTypeNode(e){const r=e.element("type");if(r){const s=r.value;return NoteTypeHandler.getNoteDurationFromType(s)}return new Fraction$1(0,4*this.divisions)}addAbstractInstruction(e,r,s,o){if(e.element("divisions")&&e.elements().length===1)return;const a=e.element("transpose");if(a){const c=a.element("chromatic");c&&(this.instrument.PlaybackTranspose=parseInt(c.value,10))}const l=e.elements("clef");let u;if(l.length>0)for(let c=0,d=l.length;cthis.currentClefNumber&&(v=this.currentClefNumber),this.currentClefNumber=v+1}catch(w){u=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef. Using default."),this.musicSheet.SheetErrors.pushMeasureError(u),v=1,this.currentClefNumber=v+1}const E=new ClefInstruction(m,b,g);this.abstractInstructions.push([v,E,o])}if(e.element("key")!==void 0&&this.instrument.MidiInstrumentId!==MidiInstrument.Percussion){let c=0;const d=e.element("key").element("fifths");if(d)try{c=parseInt(d.value,10)}catch(v){u=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),c=0,loglevelExports.debug("InstrumentReader.addAbstractInstruction",u,v)}let y=KeyEnum.none,m=e.element("key");if(m&&(m=m.element("mode")),m)try{y=KeyEnum[m.value]}catch(v){u=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key/mode. Set to default."),this.musicSheet.SheetErrors.pushMeasureError(u),y=KeyEnum.major,loglevelExports.debug("InstrumentReader.addAbstractInstruction",u,v)}const g=new KeyInstruction(void 0,c,y);this.abstractInstructions.push([1,g,o])}if(e.element("time")){const c=e.element("time");let d=RhythmSymbolEnum.NONE,y=!0;if(c!==void 0&&c.hasAttributes){const A=c.attribute("symbol");A&&(A.value==="common"?d=RhythmSymbolEnum.COMMON:A.value==="cut"&&(d=RhythmSymbolEnum.CUT));const E=c.attribute("print-object");E&&E.value==="no"&&(y=!1)}let m=0,g=0;const v=c&&c.element("senza-misura")!==void 0,b=e.elements("time"),S=[],x=[];for(let A=0,E=b.length;A0&&x!==void 0&&S.length===x.length){const E=S.length,w=new Array(E);let _=0;for(let T=0;T=0;s--){const o=this.abstractInstructions[s],a=o[0],l=o[1],u=o[2];if(l instanceof ClefInstruction){const c=l;if(this.currentXmlMeasureIndex===0||a<=this.activeClefs.length&&c!==this.activeClefs[a-1])if(!r&&this.currentStaffEntry!==void 0&&!this.currentStaffEntry.hasNotes()&&a-1===this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff)){const d=c,y=this.currentStaffEntry;if(u&&Math.abs(u.RealValue-y.Timestamp.RealValue)>.01)continue;d.Parent=y,y.removeFirstInstructionOfTypeClefInstruction(),y.Instructions.push(d),this.activeClefs[a-1]=c,this.abstractInstructions.splice(s,1)}else if(r){if(u.RealValue!==0)continue;let d;if(this.currentMeasure){const y=c,m=this.inSourceMeasureInstrumentIndex+a-1,g=this.currentMeasure.FirstInstructionsStaffEntries[m];if(this.currentXmlMeasureIndex===0)if(!g)d=new SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[m]=d,y.Parent=d,d.Instructions.push(y),this.activeClefsHaveBeenInitialized[a-1]=!0;else if(this.currentMeasure.FirstInstructionsStaffEntries[m]!==void 0&&!(g.Instructions[0]instanceof ClefInstruction))d=g,y.Parent=d,d.removeFirstInstructionOfTypeClefInstruction(),d.Instructions.splice(0,0,y),this.activeClefsHaveBeenInitialized[a-1]=!0;else{const v=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[m]=v,y.Parent=v,v.Instructions.push(y)}else if(this.activeClefsHaveBeenInitialized[a-1]){let v=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(v=this.currentMultirestStartMeasure);const b=new SourceStaffEntry(void 0,void 0);v.LastInstructionsStaffEntries[m]=b,y.Parent=b,b.Instructions.push(y)}else{const v=this.musicSheet.SourceMeasures[0];v.FirstInstructionsStaffEntries[m]?(d=v.FirstInstructionsStaffEntries[m],d.removeFirstInstructionOfTypeClefInstruction()):d=new SourceStaffEntry(void 0,void 0),y.Parent=d,d.Instructions.splice(0,0,y),this.activeClefsHaveBeenInitialized[a-1]=!0}this.activeClefs[a-1]=c,this.abstractInstructions.splice(s,1)}}else{let d;const y=this.activeRhythm.Rhythm;y.RealValue>0&&u.RealValue/y.RealValue>.9&&y.RealValue!==u.RealValue&&(this.currentMeasure.LastInstructionsStaffEntries[a-1]||(this.currentMeasure.LastInstructionsStaffEntries[a-1]=new SourceStaffEntry(void 0,this.instrument.Staves[a-1])),d=this.currentMeasure.LastInstructionsStaffEntries[a-1]),d&&(c.Parent=d,d.Instructions.push(c),this.activeClefs[a-1]=c,this.abstractInstructions.splice(s,1))}else a<=this.activeClefs.length&&c===this.activeClefs[a-1]&&this.abstractInstructions.splice(s,1)}if(l instanceof KeyInstruction){const c=l;if(!this.activeKey||this.activeKey.Key!==c.Key){this.activeKey=c,this.abstractInstructions.splice(s,1);let d;if(this.activeKeyHasBeenInitialized?d=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,this.currentXmlMeasureIndex>0?d=this.musicSheet.SourceMeasures[0]:d=this.currentMeasure),d)for(let y=this.inSourceMeasureInstrumentIndex;y=0;e--){const r=this.abstractInstructions[e][0],s=this.abstractInstructions[e][1];if(s instanceof ClefInstruction){const o=s;if(!this.activeClefs[r-1]||o.ClefType!==this.activeClefs[r-1].ClefType||o.ClefType===this.activeClefs[r-1].ClefType&&o.Line!==this.activeClefs[r-1].Line){const a=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+r-1]=a;const l=o;l.Parent=a,a.Instructions.push(l),this.activeClefs[r-1]=o,this.abstractInstructions.splice(e,1)}}}}getNoteDurationForTuplet(e){let r=new Fraction$1(0,1);const s=this.getNoteDurationFromTypeNode(e);if(e.element("time-modification")){const o=e.element("time-modification");if(o&&o.element("actual-notes")!==void 0&&o.element("normal-notes")){const a=o.element("actual-notes"),l=o.element("normal-notes");if(a!==void 0&&l){const u=parseInt(a.value,10),c=parseInt(l.value,10);r=new Fraction$1(c*s.Numerator,u*s.Denominator)}}}return r}readExpressionStaffNumber(e){let r=1;if(e.element("staff")){const s=e.element("staff");if(s)try{r=parseInt(s.value,10)}catch(o){const a=ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number. Set to default.");this.musicSheet.SheetErrors.pushMeasureError(a),r=1,loglevelExports.debug("InstrumentReader.readExpressionStaffNumber",a,o)}}return r}readDivisionsFromNotes(){let e=0,r=this.currentXmlMeasureIndex,s=!1;for(;!s;){const o=this.xmlMeasureList[r].elements();for(let a=0,l=o.length;a0){s=!0;break}}if(e===0&&(r++,r===this.xmlMeasureList.length)){const a=ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new MusicSheetReadingException(a+this.instrument.Name)}}return e}getCueNoteAndNoteTypeXml(e){const r=e.element("cue");let s=!1;r&&(s=!0);const o=e.element("type");let a=NoteType.UNDEFINED;if(o){const l=o.attribute("size");(l==null?void 0:l.value)==="cue"&&(s=!0),a=NoteTypeHandler.StringToNoteType(o.value)}return[s,a]}getStemDirectionType(e){switch(e.value){case"down":return StemDirectionType.Down;case"up":return StemDirectionType.Up;case"double":return StemDirectionType.Double;case"none":return StemDirectionType.None;default:return StemDirectionType.Undefined}}getNoteHeadColorXml(e){const r=e.element("notehead");if(r){const s=r.attribute("color");if(s)return this.parseXmlColor(s.value)}return null}getNoteColorXml(e){const r=e.attribute("color");return r?this.parseXmlColor(r.value):null}getTremoloInfo(e){let r,s;const o=e.element("tremolo");if(o){const a=o.attribute("type");if(a){if(a.value==="single"){const l=parseInt(o.value,10);l>0&&(r=l)}else r=0;a.value==="unmeasured"&&(s=!0)}}return{tremoloStrokes:r,tremoloUnmeasured:s}}getWavyLines(e,r,s,o){const a=e.elements("wavy-line");if(a)for(const l of a){const u=this.expressionReaders[this.readExpressionStaffNumber(r)-1];u&&(u.readExpressionParameters(l,this.instrument,this.divisions,s,o,this.currentMeasure.MeasureNumber,!1),u.addWavyLine(l,this.currentMeasure,s,o))}}getNoteStaff(e){let r=1;return this.instrument.Staves.length>1&&e.element("staff")&&(r=parseInt(e.element("staff").value,10),isNaN(r)&&(loglevelExports.debug("InstrumentReader.readNextXmlMeasure.get staff number"),r=1)),r}}class InstrumentNames{}InstrumentNames.MidiInstrument={banjo:MidiInstrument.Banjo,blockfloete:MidiInstrument.Recorder,brass:MidiInstrument.Trombone,bratsche:MidiInstrument.Viola,cello:MidiInstrument.Cello,clarinet:MidiInstrument.Clarinet,contrabass:MidiInstrument.Contrabass,"steel drum":MidiInstrument.Steel_Drums,drums:MidiInstrument.Percussion,flute:MidiInstrument.Flute,floete:MidiInstrument.Flute,frenchhorn:MidiInstrument.French_Horn,gitarre:MidiInstrument.Acoustic_Guitar_nylon,guitar:MidiInstrument.Acoustic_Guitar_nylon,harfe:MidiInstrument.Orchestral_Harp,harp:MidiInstrument.Orchestral_Harp,klarinette:MidiInstrument.Clarinet,klavier:MidiInstrument.Acoustic_Grand_Piano,kontrabass:MidiInstrument.Contrabass,oboe:MidiInstrument.Oboe,organ:MidiInstrument.Church_Organ,orgel:MidiInstrument.Church_Organ,orgue:MidiInstrument.Church_Organ,percussion:MidiInstrument.Percussion,piano:MidiInstrument.Acoustic_Grand_Piano,piccolo:MidiInstrument.Piccolo,posaune:MidiInstrument.Trombone,recorder:MidiInstrument.Recorder,sax:MidiInstrument.Tenor_Sax,schlagwerk:MidiInstrument.Percussion,schlagzeug:MidiInstrument.Percussion,steeldrum:MidiInstrument.Steel_Drums,streicher:MidiInstrument.String_Ensemble_1,strings:MidiInstrument.String_Ensemble_1,tpt:MidiInstrument.Trumpet,trombone:MidiInstrument.Trombone,trompete:MidiInstrument.Trumpet,trumpet:MidiInstrument.Trumpet,tuba:MidiInstrument.Tuba,unnamed:MidiInstrument.Acoustic_Grand_Piano,viola:MidiInstrument.Viola,violin:MidiInstrument.Violin,"violon-c":MidiInstrument.Cello,"violon.":MidiInstrument.Violin,voice:MidiInstrument.Synth_Voice,woodblock:MidiInstrument.Woodblock,alt:MidiInstrument.Synth_Voice,alto:MidiInstrument.Synth_Voice,bariton:MidiInstrument.Synth_Voice,baritone:MidiInstrument.Synth_Voice,bass:MidiInstrument.Synth_Voice,sopran:MidiInstrument.Synth_Voice,tenor:MidiInstrument.Synth_Voice};InstrumentNames.MidiInstrumentSounds={"brass.alphorn":MidiInstrument.French_Horn,"brass.alto-horn":MidiInstrument.French_Horn,"brass.baritone-horn":MidiInstrument.French_Horn,"brass.bugle":MidiInstrument.Trumpet,"brass.bugle.alto":MidiInstrument.Trumpet,"brass.bugle.baritone":MidiInstrument.Trombone,"brass.bugle.contrabass":MidiInstrument.Trombone,"brass.bugle.euphonium-bugle":MidiInstrument.French_Horn,"brass.bugle.mellophone-bugle":MidiInstrument.French_Horn,"brass.bugle.soprano":MidiInstrument.Trumpet,"brass.cimbasso":MidiInstrument.Trombone,"brass.conch-shell":MidiInstrument.Flute,"brass.cornet":MidiInstrument.Trumpet,"brass.cornet.soprano":MidiInstrument.Trumpet,"brass.cornett":MidiInstrument.Trumpet,"brass.cornett.tenor":MidiInstrument.Trumpet,"brass.cornettino":MidiInstrument.Trumpet,"brass.didgeridoo":MidiInstrument.Flute,"brass.euphonium":MidiInstrument.French_Horn,"brass.fiscorn":MidiInstrument.French_Horn,"brass.flugelhorn":MidiInstrument.French_Horn,"brass.french-horn":MidiInstrument.French_Horn,"brass.group":MidiInstrument.Brass_Section,"brass.group.synth":MidiInstrument.Synth_Brass_1,"brass.helicon":MidiInstrument.French_Horn,"brass.horagai":MidiInstrument.Trumpet,"brass.kuhlohorn":MidiInstrument.French_Horn,"brass.mellophone":MidiInstrument.French_Horn,"brass.natural-horn":MidiInstrument.French_Horn,"brass.ophicleide":MidiInstrument.French_Horn,"brass.posthorn":MidiInstrument.French_Horn,"brass.saxhorn":MidiInstrument.French_Horn,"brass.sousaphone":MidiInstrument.Tuba,"brass.trombone":MidiInstrument.Trombone,"brass.trombone.alto":MidiInstrument.Trombone,"brass.trombone.bass":MidiInstrument.Trombone,"brass.trombone.contrabass":MidiInstrument.Trombone,"brass.trombone.tenor":MidiInstrument.Trombone,"brass.trumpet":MidiInstrument.Trumpet,"brass.trumpet.baroque":MidiInstrument.Trumpet,"brass.trumpet.bass":MidiInstrument.Trombone,"brass.trumpet.bflat":MidiInstrument.Trumpet,"brass.trumpet.c":MidiInstrument.Trumpet,"brass.trumpet.d":MidiInstrument.Trumpet,"brass.trumpet.piccolo":MidiInstrument.Trumpet,"brass.trumpet.pocket":MidiInstrument.Trumpet,"brass.trumpet.slide":MidiInstrument.Trumpet,"brass.trumpet.tenor":MidiInstrument.Trumpet,"brass.tuba":MidiInstrument.Tuba,"brass.tuba.bass":MidiInstrument.Tuba,"brass.tuba.subcontrabass":MidiInstrument.Tuba,"brass.vienna-horn":MidiInstrument.French_Horn,"brass.wagner-tuba":MidiInstrument.French_Horn,"drum.ashiko":MidiInstrument.Shakuhachi,"drum.bass-drum":MidiInstrument.Percussion,"drum.bongo":MidiInstrument.Percussion,"drum.bougarabou":MidiInstrument.Percussion,"drum.buffalo-drum":MidiInstrument.Percussion,"drum.cajon":MidiInstrument.Percussion,"drum.chenda":MidiInstrument.Percussion,"drum.chu-daiko":MidiInstrument.Percussion,"drum.conga":MidiInstrument.Percussion,"drum.cuica":MidiInstrument.Percussion,"drum.dabakan":MidiInstrument.Percussion,"drum.daff":MidiInstrument.Percussion,"drum.dafli":MidiInstrument.Percussion,"drum.daibyosi":MidiInstrument.Percussion,"drum.damroo":MidiInstrument.Percussion,"drum.darabuka":MidiInstrument.Percussion,"drum.def":MidiInstrument.Percussion,"drum.dhol":MidiInstrument.Percussion,"drum.dholak":MidiInstrument.Percussion,"drum.djembe":MidiInstrument.Percussion,"drum.doira":MidiInstrument.Percussion,"drum.dondo":MidiInstrument.Percussion,"drum.doun-doun-ba":MidiInstrument.Percussion,"drum.duff":MidiInstrument.Percussion,"drum.dumbek":MidiInstrument.Percussion,"drum.fontomfrom":MidiInstrument.Percussion,"drum.frame-drum":MidiInstrument.Percussion,"drum.frame-drum.arabian":MidiInstrument.Percussion,"drum.geduk":MidiInstrument.Percussion,"drum.ghatam":MidiInstrument.Percussion,"drum.gome":MidiInstrument.Percussion,"drum.group":MidiInstrument.Percussion,"drum.group.chinese":MidiInstrument.Percussion,"drum.group.ewe":MidiInstrument.Percussion,"drum.group.indian":MidiInstrument.Percussion,"drum.group.set":MidiInstrument.Percussion,"drum.hand-drum":MidiInstrument.Percussion,"drum.hira-daiko":MidiInstrument.Percussion,"drum.ibo":MidiInstrument.Percussion,"drum.igihumurizo":MidiInstrument.Percussion,"drum.inyahura":MidiInstrument.Percussion,"drum.ishakwe":MidiInstrument.Percussion,"drum.jang-gu":MidiInstrument.Percussion,"drum.kagan":MidiInstrument.Percussion,"drum.kakko":MidiInstrument.Percussion,"drum.kanjira":MidiInstrument.Percussion,"drum.kendhang":MidiInstrument.Percussion,"drum.kendhang.ageng":MidiInstrument.Percussion,"drum.kendhang.ciblon":MidiInstrument.Percussion,"drum.kenkeni":MidiInstrument.Percussion,"drum.khol":MidiInstrument.Percussion,"drum.kick-drum":MidiInstrument.Percussion,"drum.kidi":MidiInstrument.Percussion,"drum.ko-daiko":MidiInstrument.Percussion,"drum.kpanlogo":MidiInstrument.Percussion,"drum.kudum":MidiInstrument.Percussion,"drum.lambeg":MidiInstrument.Percussion,"drum.lion-drum":MidiInstrument.Percussion,"drum.log-drum":MidiInstrument.Percussion,"drum.log-drum.african":MidiInstrument.Percussion,"drum.log-drum.native":MidiInstrument.Percussion,"drum.log-drum.nigerian":MidiInstrument.Percussion,"drum.madal":MidiInstrument.Percussion,"drum.maddale":MidiInstrument.Percussion,"drum.mridangam":MidiInstrument.Percussion,"drum.naal":MidiInstrument.Percussion,"drum.nagado-daiko":MidiInstrument.Percussion,"drum.nagara":MidiInstrument.Percussion,"drum.naqara":MidiInstrument.Percussion,"drum.o-daiko":MidiInstrument.Percussion,"drum.okawa":MidiInstrument.Percussion,"drum.okedo-daiko":MidiInstrument.Percussion,"drum.pahu-hula":MidiInstrument.Percussion,"drum.pakhawaj":MidiInstrument.Percussion,"drum.pandeiro":MidiInstrument.Percussion,"drum.pandero":MidiInstrument.Percussion,"drum.powwow":MidiInstrument.Percussion,"drum.pueblo":MidiInstrument.Percussion,"drum.repinique":MidiInstrument.Percussion,"drum.riq":MidiInstrument.Percussion,"drum.rototom":MidiInstrument.Percussion,"drum.sabar":MidiInstrument.Percussion,"drum.sakara":MidiInstrument.Percussion,"drum.sampho":MidiInstrument.Percussion,"drum.sangban":MidiInstrument.Percussion,"drum.shime-daiko":MidiInstrument.Percussion,"drum.slit-drum":MidiInstrument.Percussion,"drum.slit-drum.krin":MidiInstrument.Percussion,"drum.snare-drum":MidiInstrument.Percussion,"drum.snare-drum.electric":MidiInstrument.Synth_Drum,"drum.sogo":MidiInstrument.Percussion,"drum.surdo":MidiInstrument.Percussion,"drum.tabla":MidiInstrument.Percussion,"drum.tabla.bayan":MidiInstrument.Percussion,"drum.tabla.dayan":MidiInstrument.Percussion,"drum.tabor":MidiInstrument.Percussion,"drum.taiko":MidiInstrument.Taiko_Drum,"drum.talking":MidiInstrument.Percussion,"drum.tama":MidiInstrument.Percussion,"drum.tamborim":MidiInstrument.Percussion,"drum.tamborita":MidiInstrument.Percussion,"drum.tambourine":MidiInstrument.Percussion,"drum.tamte":MidiInstrument.Percussion,"drum.tangku":MidiInstrument.Percussion,"drum.tan-tan":MidiInstrument.Percussion,"drum.taphon":MidiInstrument.Percussion,"drum.tar":MidiInstrument.Percussion,"drum.tasha":MidiInstrument.Percussion,"drum.tenor-drum":MidiInstrument.Percussion,"drum.teponaxtli":MidiInstrument.Percussion,"drum.thavil":MidiInstrument.Percussion,"drum.the-box":MidiInstrument.Percussion,"drum.timbale":MidiInstrument.Percussion,"drum.timpani":MidiInstrument.Timpani,"drum.tinaja":MidiInstrument.Percussion,"drum.toere":MidiInstrument.Percussion,"drum.tombak":MidiInstrument.Percussion,"drum.tom-tom":MidiInstrument.Melodic_Tom,"drum.tom-tom.synth":MidiInstrument.Melodic_Tom,"drum.tsuzumi":MidiInstrument.Percussion,"drum.tumbak":MidiInstrument.Percussion,"drum.uchiwa-daiko":MidiInstrument.Percussion,"drum.udaku":MidiInstrument.Percussion,"drum.udu":MidiInstrument.Percussion,"drum.zarb":MidiInstrument.Percussion,"effect.applause":MidiInstrument.Applause,"effect.gunshot":MidiInstrument.Gunshot,"effect.helicopter":MidiInstrument.Helicopter,"effect.telephone-ring":MidiInstrument.Telephone_Ring,"keyboard.accordion":MidiInstrument.Accordion,"keyboard.bandoneon":MidiInstrument.Accordion,"keyboard.celesta":MidiInstrument.Celesta,"keyboard.clavichord":MidiInstrument.Harpsichord,"keyboard.clavichord.synth":MidiInstrument.Harpsichord,"keyboard.concertina":MidiInstrument.Accordion,"keyboard.fortepiano":MidiInstrument.Acoustic_Grand_Piano,"keyboard.harmonium":MidiInstrument.Drawbar_Organ,"keyboard.harpsichord":MidiInstrument.Harpsichord,"keyboard.ondes-martenot":MidiInstrument.Pad_3_polysynth,"keyboard.organ":MidiInstrument.Church_Organ,"keyboard.organ.drawbar":MidiInstrument.Percussive_Organ,"keyboard.organ.percussive":MidiInstrument.Rock_Organ,"keyboard.organ.pipe":MidiInstrument.Church_Organ,"keyboard.organ.reed":MidiInstrument.Church_Organ,"keyboard.organ.rotary":MidiInstrument.Rock_Organ,"keyboard.piano":MidiInstrument.Acoustic_Grand_Piano,"keyboard.piano.electric":MidiInstrument.Electric_Grand_Piano,"keyboard.piano.grand":MidiInstrument.Acoustic_Grand_Piano,"keyboard.piano.honky-tonk":MidiInstrument.Honky_tonk_Piano,"keyboard.piano.prepared":MidiInstrument.Acoustic_Grand_Piano,"keyboard.piano.toy":MidiInstrument.Honky_tonk_Piano,"keyboard.piano.upright":MidiInstrument.Acoustic_Grand_Piano,"keyboard.virginal":MidiInstrument.Acoustic_Grand_Piano,"metal.adodo":MidiInstrument.Xylophone,"metal.anvil":MidiInstrument.Xylophone,"metal.babendil":MidiInstrument.Xylophone,"metal.bells.agogo":MidiInstrument.Agogo,"metal.bells.almglocken":MidiInstrument.Tubular_Bells,"metal.bells.bell-plate":MidiInstrument.Tubular_Bells,"metal.bells.bell-tree":MidiInstrument.Tubular_Bells,"metal.bells.carillon":MidiInstrument.Tubular_Bells,"metal.bells.chimes":MidiInstrument.Tinkle_Bell,"metal.bells.chimta":MidiInstrument.Tubular_Bells,"metal.bells.chippli":MidiInstrument.Tubular_Bells,"metal.bells.church":MidiInstrument.Tubular_Bells,"metal.bells.cowbell":MidiInstrument.Percussion,"metal.bells.dawuro":MidiInstrument.Percussion,"metal.bells.gankokwe":MidiInstrument.Percussion,"metal.bells.ghungroo":MidiInstrument.Percussion,"metal.bells.hatheli":MidiInstrument.Percussion,"metal.bells.jingle-bell":MidiInstrument.Percussion,"metal.bells.khartal":MidiInstrument.Percussion,"metal.bells.mark-tree":MidiInstrument.Percussion,"metal.bells.sistrum":MidiInstrument.Percussion,"metal.bells.sleigh-bells":MidiInstrument.Percussion,"metal.bells.temple":MidiInstrument.Percussion,"metal.bells.tibetan":MidiInstrument.Percussion,"metal.bells.tinklebell":MidiInstrument.Percussion,"metal.bells.trychel":MidiInstrument.Percussion,"metal.bells.wind-chimes":MidiInstrument.Percussion,"metal.bells.zills":MidiInstrument.Percussion,"metal.berimbau":MidiInstrument.Flute,"metal.brake-drums":MidiInstrument.Percussion,"metal.crotales":MidiInstrument.Percussion,"metal.cymbal.bo":MidiInstrument.Percussion,"metal.cymbal.ceng-ceng":MidiInstrument.Percussion,"metal.cymbal.chabara":MidiInstrument.Percussion,"metal.cymbal.chinese":MidiInstrument.Percussion,"metal.cymbal.ching":MidiInstrument.Percussion,"metal.cymbal.clash":MidiInstrument.Percussion,"metal.cymbal.crash":MidiInstrument.Percussion,"metal.cymbal.finger":MidiInstrument.Percussion,"metal.cymbal.hand":MidiInstrument.Percussion,"metal.cymbal.kesi":MidiInstrument.Percussion,"metal.cymbal.manjeera":MidiInstrument.Percussion,"metal.cymbal.reverse":MidiInstrument.Percussion,"metal.cymbal.ride":MidiInstrument.Percussion,"metal.cymbal.sizzle":MidiInstrument.Percussion,"metal.cymbal.splash":MidiInstrument.Percussion,"metal.cymbal.suspended":MidiInstrument.Percussion,"metal.cymbal.tebyoshi":MidiInstrument.Percussion,"metal.cymbal.tibetan":MidiInstrument.Percussion,"metal.cymbal.tingsha":MidiInstrument.Percussion,"metal.flexatone":MidiInstrument.Percussion,"metal.gong":MidiInstrument.Percussion,"metal.gong.ageng":MidiInstrument.Percussion,"metal.gong.agung":MidiInstrument.Percussion,"metal.gong.chanchiki":MidiInstrument.Percussion,"metal.gong.chinese":MidiInstrument.Percussion,"metal.gong.gandingan":MidiInstrument.Percussion,"metal.gong.kempul":MidiInstrument.Percussion,"metal.gong.kempyang":MidiInstrument.Percussion,"metal.gong.ketuk":MidiInstrument.Percussion,"metal.gong.kkwenggwari":MidiInstrument.Percussion,"metal.gong.luo":MidiInstrument.Percussion,"metal.gong.singing":MidiInstrument.Percussion,"metal.gong.thai":MidiInstrument.Percussion,"metal.guira":MidiInstrument.Percussion,"metal.hang":MidiInstrument.Percussion,"metal.hi-hat":MidiInstrument.Percussion,"metal.jaw-harp":MidiInstrument.Percussion,"metal.kengong":MidiInstrument.Percussion,"metal.murchang":MidiInstrument.Percussion,"metal.musical-saw":MidiInstrument.Percussion,"metal.singing-bowl":MidiInstrument.Percussion,"metal.spoons":MidiInstrument.Percussion,"metal.steel-drums":MidiInstrument.Percussion,"metal.tamtam":MidiInstrument.Percussion,"metal.thundersheet":MidiInstrument.Percussion,"metal.triangle":MidiInstrument.Percussion,"metal.washboard":MidiInstrument.Percussion,"pitched-percussion.angklung":MidiInstrument.Xylophone,"pitched-percussion.balafon":MidiInstrument.Xylophone,"pitched-percussion.bell-lyre":MidiInstrument.Xylophone,"pitched-percussion.bells":MidiInstrument.Tubular_Bells,"pitched-percussion.bianqing":MidiInstrument.Xylophone,"pitched-percussion.bianzhong":MidiInstrument.Xylophone,"pitched-percussion.bonang":MidiInstrument.Xylophone,"pitched-percussion.cimbalom":MidiInstrument.Xylophone,"pitched-percussion.crystal-glasses":MidiInstrument.Xylophone,"pitched-percussion.dan-tam-thap-luc":MidiInstrument.Xylophone,"pitched-percussion.fangxiang":MidiInstrument.Xylophone,"pitched-percussion.gandingan-a-kayo":MidiInstrument.Xylophone,"pitched-percussion.gangsa":MidiInstrument.Xylophone,"pitched-percussion.gender":MidiInstrument.Xylophone,"pitched-percussion.giying":MidiInstrument.Xylophone,"pitched-percussion.glass-harmonica":MidiInstrument.Xylophone,"pitched-percussion.glockenspiel":MidiInstrument.Glockenspiel,"pitched-percussion.glockenspiel.alto":MidiInstrument.Glockenspiel,"pitched-percussion.glockenspiel.soprano":MidiInstrument.Glockenspiel,"pitched-percussion.gyil":MidiInstrument.Xylophone,"pitched-percussion.hammer-dulcimer":MidiInstrument.Dulcimer,"pitched-percussion.handbells":MidiInstrument.Tubular_Bells,"pitched-percussion.handchimes":MidiInstrument.Tubular_Bells,"pitched-percussion.kalimba":MidiInstrument.Kalimba,"pitched-percussion.kantil":MidiInstrument.Xylophone,"pitched-percussion.khim":MidiInstrument.Xylophone,"pitched-percussion.kulintang":MidiInstrument.Xylophone,"pitched-percussion.kulintang-a-kayo":MidiInstrument.Xylophone,"pitched-percussion.kulintang-a-tiniok":MidiInstrument.Xylophone,"pitched-percussion.likembe":MidiInstrument.Xylophone,"pitched-percussion.luntang":MidiInstrument.Xylophone,"pitched-percussion.marimba":MidiInstrument.Marimba,"pitched-percussion.marimba.bass":MidiInstrument.Marimba,"pitched-percussion.mbira":MidiInstrument.Marimba,"pitched-percussion.mbira.array":MidiInstrument.Marimba,"pitched-percussion.metallophone":MidiInstrument.Xylophone,"pitched-percussion.metallophone.alto":MidiInstrument.Xylophone,"pitched-percussion.metallophone.bass":MidiInstrument.Xylophone,"pitched-percussion.metallophone.soprano":MidiInstrument.Xylophone,"pitched-percussion.music-box":MidiInstrument.Glockenspiel,"pitched-percussion.pelog-panerus":MidiInstrument.Xylophone,"pitched-percussion.pemade":MidiInstrument.Xylophone,"pitched-percussion.penyacah":MidiInstrument.Xylophone,"pitched-percussion.ranat.ek":MidiInstrument.Xylophone,"pitched-percussion.ranat.ek-lek":MidiInstrument.Xylophone,"pitched-percussion.ranat.thum":MidiInstrument.Xylophone,"pitched-percussion.ranat.thum-lek":MidiInstrument.Xylophone,"pitched-percussion.reyong":MidiInstrument.Xylophone,"pitched-percussion.sanza":MidiInstrument.Xylophone,"pitched-percussion.saron-barung":MidiInstrument.Xylophone,"pitched-percussion.saron-demong":MidiInstrument.Xylophone,"pitched-percussion.saron-panerus":MidiInstrument.Xylophone,"pitched-percussion.slendro-panerus":MidiInstrument.Xylophone,"pitched-percussion.slentem":MidiInstrument.Xylophone,"pitched-percussion.tsymbaly":MidiInstrument.Xylophone,"pitched-percussion.tubes":MidiInstrument.Tubular_Bells,"pitched-percussion.tubular-bells":MidiInstrument.Tubular_Bells,"pitched-percussion.vibraphone":MidiInstrument.Vibraphone,"pitched-percussion.xylophone":MidiInstrument.Xylophone,"pitched-percussion.xylophone.alto":MidiInstrument.Xylophone,"pitched-percussion.xylophone.bass":MidiInstrument.Xylophone,"pitched-percussion.xylophone.soprano":MidiInstrument.Xylophone,"pitched-percussion.xylorimba":MidiInstrument.Xylophone,"pitched-percussion.yangqin":MidiInstrument.Xylophone,"pluck.archlute":MidiInstrument.Acoustic_Guitar_nylon,"pluck.autoharp":MidiInstrument.Orchestral_Harp,"pluck.baglama":MidiInstrument.Orchestral_Harp,"pluck.bajo":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.alto":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.bass":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.contrabass":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.piccolo":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.prima":MidiInstrument.Acoustic_Guitar_steel,"pluck.balalaika.secunda":MidiInstrument.Acoustic_Guitar_steel,"pluck.bandola":MidiInstrument.Acoustic_Guitar_steel,"pluck.bandura":MidiInstrument.Acoustic_Guitar_steel,"pluck.bandurria":MidiInstrument.Acoustic_Guitar_steel,"pluck.banjo":MidiInstrument.Banjo,"pluck.banjo.tenor":MidiInstrument.Banjo,"pluck.banjolele":MidiInstrument.Banjo,"pluck.barbat":MidiInstrument.Acoustic_Guitar_steel,"pluck.bass":MidiInstrument.Electric_Bass_finger,"pluck.bass.acoustic":MidiInstrument.Acoustic_Bass,"pluck.bass.bolon":MidiInstrument.Electric_Bass_finger,"pluck.bass.electric":MidiInstrument.Electric_Bass_finger,"pluck.bass.fretless":MidiInstrument.Fretless_Bass,"pluck.bass.guitarron":MidiInstrument.Acoustic_Bass,"pluck.bass.synth":MidiInstrument.Synth_Bass_1,"pluck.bass.synth.lead":MidiInstrument.Synth_Bass_2,"pluck.celtic-harp":MidiInstrument.Orchestral_Harp,"pluck.charango":MidiInstrument.Acoustic_Guitar_nylon,"pluck.chitarra-battente":MidiInstrument.Acoustic_Guitar_nylon,"pluck.cithara":MidiInstrument.Acoustic_Guitar_nylon,"pluck.cittern":MidiInstrument.Acoustic_Guitar_nylon,"pluck.cuatro":MidiInstrument.Acoustic_Guitar_nylon,"pluck.dulcimer":MidiInstrument.Dulcimer,"pluck.dutar":MidiInstrument.Acoustic_Grand_Piano,"pluck.duxianqin":MidiInstrument.Dulcimer,"pluck.ektara":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar.acoustic":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar.electric":MidiInstrument.Electric_Guitar_clean,"pluck.guitar.nylon-string":MidiInstrument.Electric_Guitar_clean,"pluck.guitar.pedal-steel":MidiInstrument.Electric_Guitar_clean,"pluck.guitar.portuguese":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar.requinto":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar.resonator":MidiInstrument.Acoustic_Guitar_nylon,"pluck.guitar.steel-string":MidiInstrument.Acoustic_Guitar_steel,"pluck.harp":MidiInstrument.Orchestral_Harp,"pluck.harp-guitar":MidiInstrument.Orchestral_Harp,"pluck.huapanguera":MidiInstrument.Orchestral_Harp,"pluck.lute":MidiInstrument.Acoustic_Grand_Piano,"pluck.lyre":MidiInstrument.Orchestral_Harp,"pluck.mandobass":MidiInstrument.Acoustic_Guitar_nylon,"pluck.mandocello":MidiInstrument.Acoustic_Guitar_nylon,"pluck.mandola":MidiInstrument.Acoustic_Guitar_nylon,"pluck.mandolin":MidiInstrument.Acoustic_Guitar_nylon,"pluck.mandolin.octave":MidiInstrument.Acoustic_Guitar_nylon,"pluck.setar":MidiInstrument.Acoustic_Guitar_nylon,"pluck.shamisen":MidiInstrument.Shamisen,"pluck.sitar":MidiInstrument.Sitar,"pluck.synth":MidiInstrument.Electric_Bass_pick,"pluck.synth.charang":MidiInstrument.Electric_Bass_pick,"pluck.synth.chiff":MidiInstrument.Electric_Bass_pick,"pluck.synth.stick":MidiInstrument.Electric_Bass_pick,"pluck.tambura":MidiInstrument.Acoustic_Grand_Piano,"pluck.ukulele":MidiInstrument.Banjo,"pluck.ukulele.tenor":MidiInstrument.Banjo,"strings.arpeggione":MidiInstrument.Cello,"strings.cello":MidiInstrument.Cello,"strings.cello.piccolo":MidiInstrument.Cello,"strings.contrabass":MidiInstrument.Contrabass,"strings.fiddle":MidiInstrument.Fiddle,"strings.fiddle.hardanger":MidiInstrument.Fiddle,"strings.group":MidiInstrument.String_Ensemble_1,"strings.group.synth":MidiInstrument.Synth_Strings_1,"strings.octobass":MidiInstrument.Contrabass,"strings.tromba-marina":MidiInstrument.Contrabass,"strings.vielle":MidiInstrument.Violin,"strings.viol":MidiInstrument.Violin,"strings.viol.alto":MidiInstrument.Violin,"strings.viol.bass":MidiInstrument.Violin,"strings.viol.tenor":MidiInstrument.Violin,"strings.viol.treble":MidiInstrument.Violin,"strings.viol.violone":MidiInstrument.Violin,"strings.viola":MidiInstrument.Viola,"strings.viola-damore":MidiInstrument.Viola,"strings.violin":MidiInstrument.Violin,"strings.violono.piccolo":MidiInstrument.Violin,"strings.violotta":MidiInstrument.Viola,"synth.group":MidiInstrument.Pad_3_polysynth,"synth.group.fifths":MidiInstrument.Pad_3_polysynth,"synth.group.orchestra":MidiInstrument.Orchestra_Hit,"synth.pad":MidiInstrument.Pad_1_new_age,"synth.pad.bowed":MidiInstrument.Pad_1_new_age,"synth.pad.choir":MidiInstrument.Pad_4_choir,"synth.pad.halo":MidiInstrument.Acoustic_Grand_Piano,"synth.pad.polysynth":MidiInstrument.Pad_3_polysynth,"voice.alto":MidiInstrument.Voice_Oohs,"voice.baritone":MidiInstrument.Voice_Oohs,"voice.bass":MidiInstrument.Voice_Oohs,"voice.female":MidiInstrument.Synth_Voice,"voice.kazoo":MidiInstrument.Flute,"voice.male":MidiInstrument.Voice_Oohs,"voice.mezzo-soprano":MidiInstrument.Voice_Oohs,"voice.soprano":MidiInstrument.Voice_Oohs,"voice.synth":MidiInstrument.Synth_Voice,"voice.tenor":MidiInstrument.Voice_Oohs,"voice.vocals":MidiInstrument.Choir_Aahs,"wind.flutes.flute":MidiInstrument.Flute,"wind.flutes.flute.alto":MidiInstrument.Flute,"wind.flutes.flute.bass":MidiInstrument.Flute,"wind.flutes.flute.contra-alto":MidiInstrument.Flute,"wind.flutes.flute.contrabass":MidiInstrument.Flute,"wind.flutes.flute.double-contrabass":MidiInstrument.Flute,"wind.flutes.flute.irish":MidiInstrument.Flute,"wind.flutes.flute.piccolo":MidiInstrument.Piccolo,"wind.flutes.flute.subcontrabass":MidiInstrument.Flute,"wind.flutes.ocarina":MidiInstrument.Ocarina,"wind.flutes.panpipes":MidiInstrument.Pan_Flute,"wind.flutes.recorder":MidiInstrument.Acoustic_Grand_Piano,"wind.flutes.recorder.alto":MidiInstrument.Recorder,"wind.flutes.recorder.bass":MidiInstrument.Recorder,"wind.flutes.recorder.contrabass":MidiInstrument.Recorder,"wind.flutes.recorder.descant":MidiInstrument.Recorder,"wind.flutes.recorder.garklein":MidiInstrument.Recorder,"wind.flutes.recorder.great-bass":MidiInstrument.Recorder,"wind.flutes.recorder.sopranino":MidiInstrument.Recorder,"wind.flutes.recorder.soprano":MidiInstrument.Recorder,"wind.flutes.recorder.tenor":MidiInstrument.Recorder,"wind.flutes.shakuhachi":MidiInstrument.Shakuhachi,"wind.flutes.whistle":MidiInstrument.Whistle,"wind.flutes.whistle.alto":MidiInstrument.Whistle,"wind.flutes.whistle.low-irish":MidiInstrument.Whistle,"wind.flutes.whistle.shiva":MidiInstrument.Whistle,"wind.flutes.whistle.slide":MidiInstrument.Whistle,"wind.flutes.whistle.tin":MidiInstrument.Whistle,"wind.flutes.whistle.tin.bflat":MidiInstrument.Whistle,"wind.flutes.whistle.tin.c":MidiInstrument.Whistle,"wind.flutes.whistle.tin.d":MidiInstrument.Whistle,"wind.group":MidiInstrument.Flute,"wind.pipes.bagpipes":MidiInstrument.Bag_pipe,"wind.reed.basset-horn":MidiInstrument.Bassoon,"wind.reed.bassoon":MidiInstrument.Bassoon,"wind.reed.bombarde":MidiInstrument.Bassoon,"wind.reed.clarinet":MidiInstrument.Clarinet,"wind.reed.clarinet.a":MidiInstrument.Clarinet,"wind.reed.clarinet.alto":MidiInstrument.Clarinet,"wind.reed.clarinet.bass":MidiInstrument.Clarinet,"wind.reed.clarinet.basset":MidiInstrument.Clarinet,"wind.reed.clarinet.bflat":MidiInstrument.Clarinet,"wind.reed.clarinet.contra-alto":MidiInstrument.Clarinet,"wind.reed.clarinet.contrabass":MidiInstrument.Clarinet,"wind.reed.clarinet.d":MidiInstrument.Clarinet,"wind.reed.clarinet.eflat":MidiInstrument.Clarinet,"wind.reed.clarinet.g":MidiInstrument.Clarinet,"wind.reed.clarinet.piccolo":MidiInstrument.Clarinet,"wind.reed.clarinet.piccolo.aflat":MidiInstrument.Clarinet,"wind.reed.clarinette-damour":MidiInstrument.Clarinet,"wind.reed.contrabass":MidiInstrument.Clarinet,"wind.reed.contrabassoon":MidiInstrument.Clarinet,"wind.reed.cornamuse":MidiInstrument.Bag_pipe,"wind.reed.english-horn":MidiInstrument.English_Horn,"wind.reed.harmonica":MidiInstrument.Harmonica,"wind.reed.harmonica.bass":MidiInstrument.Harmonica,"wind.reed.oboe":MidiInstrument.Oboe,"wind.reed.oboe.bass":MidiInstrument.Oboe,"wind.reed.oboe.piccolo":MidiInstrument.Oboe,"wind.reed.oboe-da-caccia":MidiInstrument.Oboe,"wind.reed.oboe-damore":MidiInstrument.Oboe,"wind.reed.saxonette":MidiInstrument.Soprano_Sax,"wind.reed.saxophone":MidiInstrument.Alto_Sax,"wind.reed.saxophone.alto":MidiInstrument.Alto_Sax,"wind.reed.saxophone.aulochrome":MidiInstrument.Alto_Sax,"wind.reed.saxophone.baritone":MidiInstrument.Baritone_Sax,"wind.reed.saxophone.bass":MidiInstrument.Baritone_Sax,"wind.reed.saxophone.contrabass":MidiInstrument.Baritone_Sax,"wind.reed.saxophone.melody":MidiInstrument.Baritone_Sax,"wind.reed.saxophone.mezzo-soprano":MidiInstrument.Alto_Sax,"wind.reed.saxophone.sopranino":MidiInstrument.Soprano_Sax,"wind.reed.saxophone.sopranissimo":MidiInstrument.Soprano_Sax,"wind.reed.saxophone.soprano":MidiInstrument.Soprano_Sax,"wind.reed.saxophone.subcontrabass":MidiInstrument.Baritone_Sax,"wind.reed.saxophone.tenor":MidiInstrument.Tenor_Sax,"wood.bones":MidiInstrument.Woodblock,"wood.castanets":MidiInstrument.Woodblock,"wood.claves":MidiInstrument.Woodblock,"wood.drum-sticks":MidiInstrument.Woodblock,"wood.gourd":MidiInstrument.Woodblock,"wood.granite-block":MidiInstrument.Woodblock,"wood.guban":MidiInstrument.Woodblock,"wood.guiro":MidiInstrument.Woodblock,"wood.hyoushigi":MidiInstrument.Woodblock,"wood.ipu":MidiInstrument.Woodblock,"wood.jam-block":MidiInstrument.Woodblock,"wood.kaekeeke":MidiInstrument.Woodblock,"wood.kagul":MidiInstrument.Woodblock,"wood.kalaau":MidiInstrument.Woodblock,"wood.kashiklar":MidiInstrument.Woodblock,"wood.kubing":MidiInstrument.Woodblock,"wood.pan-clappers":MidiInstrument.Woodblock,"wood.sand-block":MidiInstrument.Woodblock,"wood.slapstick":MidiInstrument.Woodblock,"wood.stir-drum":MidiInstrument.Woodblock,"wood.temple-block":MidiInstrument.Woodblock,"wood.tic-toc-block":MidiInstrument.Woodblock,"wood.tonetang":MidiInstrument.Woodblock,"wood.wood-block":MidiInstrument.Woodblock};class SubInstrument{constructor(e){this.parentInstrument=e,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=InstrumentNames.MidiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(e){return e===MidiInstrument.Acoustic_Grand_Piano||e===MidiInstrument.Bright_Acoustic_Piano||e===MidiInstrument.Electric_Grand_Piano||e===MidiInstrument.Electric_Piano_1||e===MidiInstrument.Electric_Piano_2}setMidiInstrumentSound(e){this.midiInstrumentID=InstrumentNames.MidiInstrumentSounds[e]}setMidiInstrument(e){this.midiInstrumentID=InstrumentNames.MidiInstrument[this.parseMidiInstrument(e)]}parseMidiInstrument(e){try{if(e){const r=e.toLowerCase().trim();for(const s in InstrumentNames.MidiInstrument)if(r.indexOf(s)!==-1)return s}if(this.parentInstrument.Name){const r=this.parentInstrument.Name.toLowerCase().trim();for(const s in InstrumentNames.MidiInstrument)if(r.indexOf(s)!==-1)return s}}catch(r){loglevelExports.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}class StringUtil{static StringContainsSeparatedWord(e,r,s=!1){return new RegExp("( |^)"+r+"([ .]|$)",s?"i":void 0).test(e)}}class RepetitionInstructionReader{set MusicSheet(e){this.musicSheet=e,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(e,r){this.currentMeasureIndex=r}handleLineRepetitionInstructions(e){let r=!1;if(e.elements().length>0){let s="",o=!1,a="",l="",u="";const c=[],d=e.element("bar-style");d&&(u=d.value),e.attributes().length>0&&e.attribute("location")?s=e.attribute("location").value:s="right";const y=e.elements();for(let m=0,g=y.length;m0)if(s==="left"){if(l==="start"){const m=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.Begin,void 0,c);this.addInstruction(this.repetitionInstructions,m)}if(a==="forward"){const m=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,m)}}else{if(l==="stop"){const m=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.End,void 0,c);this.addInstruction(this.repetitionInstructions,m)}if(a==="backward"){const m=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,m)}}}return r}handleRepetitionInstructionsFromWordsOrSymbols(e,r){const s=e.element("words"),o=this.currentMeasureIndex;if(s){const a="d\\s?\\.s\\.",l=s.value.trim().toLowerCase();if(StringUtil.StringContainsSeparatedWord(l,a+" al fine",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,a+" al coda",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,c),!0}const u="d\\.\\s?c\\.";if(StringUtil.StringContainsSeparatedWord(l,u+" al fine",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,u+" al coda",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,u)||StringUtil.StringContainsSeparatedWord(l,"da\\s?capo",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,a,!0)||StringUtil.StringContainsSeparatedWord(l,"dal\\s?segno",!0)){let c;return StringUtil.StringContainsSeparatedWord(l,"al\\s?coda",!0)?c=new RepetitionInstruction(o,RepetitionInstructionEnum.DalSegnoAlCoda):c=new RepetitionInstruction(o,RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,"to\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(l,"a (la )?coda",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,"fine",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,"coda",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,c),!0}if(StringUtil.StringContainsSeparatedWord(l,"segno",!0)){const c=new RepetitionInstruction(o,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,c),!0}}else if(e.element("segno")){const a=new RepetitionInstruction(o,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,a),!0}else if(e.element("coda")){const a=new RepetitionInstruction(o,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,a),!0}return!1}removeRedundantInstructions(){let e=0,r=0,s=0,o=0;for(let a=0;a0&&this.findInstructionInPreviousMeasure(a,l.measureIndex,RepetitionInstructionEnum.ToCoda)&&(l.type=RepetitionInstructionEnum.None),r===0&&s===0&&(l.type=RepetitionInstructionEnum.ToCoda,l.alignment=AlignmentType.End,l.measureIndex--);break;case RepetitionInstructionEnum.Segno:if(e-o>0){let u=!1;for(let c=0,d=this.repetitionInstructions.length;c0?y.type=RepetitionInstructionEnum.DalSegnoAlCoda:y.type=RepetitionInstructionEnum.DalSegno,l.type=RepetitionInstructionEnum.None,u=!0;break;case RepetitionInstructionEnum.DalSegno:case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:l.type=RepetitionInstructionEnum.None,u=!0;break}if(u)break}if(u)break;s-r>0?l.type=RepetitionInstructionEnum.DalSegnoAlCoda:l.type=RepetitionInstructionEnum.DalSegno,l.alignment=AlignmentType.End,l.measureIndex--}break}if(this.backwardSearchForPreviousIdenticalInstruction(a,l)||l.type===RepetitionInstructionEnum.None)this.repetitionInstructions.splice(a,1),a--;else switch(l.type){case RepetitionInstructionEnum.Fine:break;case RepetitionInstructionEnum.ToCoda:s++;break;case RepetitionInstructionEnum.Coda:r++;break;case RepetitionInstructionEnum.Segno:e++;break;case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:o++;break}}this.repetitionInstructions.sort(RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(e,r,s){for(let o=e-1;o>=0;o--){const a=this.repetitionInstructions[o];if(r-a.measureIndex===1&&a.type===s)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(e,r){for(let s=e-1;s>=0;s--)if(this.repetitionInstructions[s].equals(r))return!0;return!1}addInstruction(e,r){let s=!0;for(let o=0,a=e.length;o0;)try{const c=this.openRepetitions.last();if(c.RepetitonUnderConstruction.FromWords){if(c.WaitingForCoda){let d=c.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;d>=this.musicSheet.SourceMeasures.length&&(d=-1),c.RepetitonUnderConstruction.setEndingStartIndex(2,d)}else if(c.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(c.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){const d=o.length-1,y=new RepetitionInstruction(d,RepetitionInstructionEnum.BackJumpLine,AlignmentType.End,c.RepetitonUnderConstruction);c.RepetitonUnderConstruction.BackwardJumpInstructions.push(y),o[d].LastRepetitionInstructions.push(y)}this.finalizeRepetition(this.openRepetitions.last())}catch(c){try{const d=this.openRepetitions.last().RepetitonUnderConstruction;for(const y of this.repetitionInstructions)y.parentRepetition===d&&(y.parentRepetition=void 0);this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(d){loglevelExports.error("RepetitionCalculator: calculateRepetitions2",d)}}let a=!1;const l=0,u=this.musicSheet.SourceMeasures.length-1;for(const c of this.musicSheet.Repetitions)if(c.StartIndex===l&&c.EndIndex===u){a=!0;break}if(!a){const c=new Repetition(this.musicSheet,!0);c.FromWords=!0,c.startMarker=new RepetitionInstruction(l,RepetitionInstructionEnum.StartLine),c.startMarker.parentRepetition=c,this.musicSheet.SourceMeasures[l].FirstRepetitionInstructions.push(c.startMarker),c.endMarker=new RepetitionInstruction(u,RepetitionInstructionEnum.BackJumpLine),c.endMarker.parentRepetition=c,c.BackwardJumpInstructions.push(c.endMarker),c.UserNumberOfRepetitions=c.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(c)}for(let c=0,d=this.musicSheet.SourceMeasures.length;c1&&y.FirstRepetitionInstructions.sort(RepetitionInstructionComparer.Compare),y.LastRepetitionInstructions.length>1&&y.LastRepetitionInstructions.sort(RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(e){var s,o,a,l,u,c,d;let r;switch(e.type){case RepetitionInstructionEnum.StartLine:r=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.FromWords=!1,r.RepetitonUnderConstruction.startMarker=e,(s=this.currentMeasure)==null||s.FirstRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.BackJumpLine:r=this.getOrCreateCurrentRepetition2(!1),e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),(o=this.currentMeasure)==null||o.LastRepetitionInstructions.push(e),r.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(r);break;case RepetitionInstructionEnum.Ending:if(r=this.getOrCreateCurrentRepetition(),e.parentRepetition=r.RepetitonUnderConstruction,e.endingIndices.contains(1)&&e.alignment===AlignmentType.Begin){if(r.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){r=void 0;for(let m=this.openRepetitions.length-1;m>=0;m--){const g=this.openRepetitions[m];if(g.RepetitonUnderConstruction.BackwardJumpInstructions.length===0)for(r=g;this.openRepetitions.length-1>m;){const v=this.openRepetitions.last();this.finalizeRepetition(v)}}r===void 0&&(r=this.createNewRepetition(0),r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None))}r.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex-1,RepetitionInstructionEnum.ForwardJump,AlignmentType.End,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(r.RepetitonUnderConstruction.forwardJumpInstruction))}if(e.alignment===AlignmentType.Begin)r.RepetitonUnderConstruction.setEndingsStartIndex(e.endingIndices,this.currentMeasureIndex),(a=this.currentMeasure)==null||a.FirstRepetitionInstructions.push(e);else for(let m=0,g=e.endingIndices.length;m0&&Math.abs(r.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1||this.openRepetitions.length&&((d=(c=(u=this.openRepetitions)==null?void 0:u.find(m=>m.RepetitonUnderConstruction.startMarker.type===RepetitionInstructionEnum.StartLine))==null?void 0:c.RepetitonUnderConstruction)==null?void 0:d.StartIndex)===this.currentMeasureIndex)break;r=this.createNewRepetition(this.currentMeasureIndex),e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.FromWords=!0,r.SegnoFound=!0,r.RepetitonUnderConstruction.startMarker=e,this.currentMeasure.FirstRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.Fine:if(this.openRepetitions.length===0||(r=this.getCurrentRepetition(!0),r===void 0))break;e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.FromWords=!0,r.RepetitonUnderConstruction.forwardJumpInstruction===void 0?(r.FineFound=!0,r.RepetitonUnderConstruction.forwardJumpInstruction=e,r.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(e)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Fine,AlignmentType.End,void 0));break;case RepetitionInstructionEnum.ToCoda:if(this.openRepetitions.length===0||(r=this.getCurrentRepetition(!0),r===void 0))break;r.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.FromWords=!0,r.ToCodaFound=!0,r.RepetitonUnderConstruction.forwardJumpInstruction=e,this.currentMeasure.LastRepetitionInstructions.push(e));break;case RepetitionInstructionEnum.Coda:if(this.openRepetitions.length===0)break;r=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=r.RepetitonUnderConstruction,r.WaitingForCoda?(r.CodaFound=!0,r.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(e),this.finalizeRepetition(r),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):r.ToCodaFound||(r.RepetitonUnderConstruction.BackwardJumpInstructions.length===0?(r.ToCodaFound=!0,r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.ToCoda,AlignmentType.End,r.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(r.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Coda,AlignmentType.Begin,void 0)));break;case RepetitionInstructionEnum.DaCapo:r=this.getOrCreateCurrentRepetition(),r.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(r),r.RepetitonUnderConstruction.StartIndex!==0&&(r=this.createNewRepetition(0)),e.parentRepetition=r.RepetitonUnderConstruction,r.RepetitonUnderConstruction.FromWords=!0,r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,r.RepetitonUnderConstruction),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e),r.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(r);break;case RepetitionInstructionEnum.DalSegno:if(r=this.getOrCreateCurrentRepetition2(!0),r.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(r),r=this.createNewRepetition(0),r.RepetitonUnderConstruction.FromWords=!0,r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,r.RepetitonUnderConstruction)),e.parentRepetition=r.RepetitonUnderConstruction,!r.SegnoFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);m>=0&&(r.SegnoFound=!0,r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(m,RepetitionInstructionEnum.Segno,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].FirstRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.startMarker))}r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&r.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DalSegnoAlFine:if(this.openRepetitions.length===0)break;if(r=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=r.RepetitonUnderConstruction,!r.SegnoFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);m>=0&&(r.SegnoFound=!0,r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(m,RepetitionInstructionEnum.Segno,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].FirstRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.startMarker))}if(!r.FineFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,e.measureIndex);m>=0&&(r.FineFound=!0,r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(m,RepetitionInstructionEnum.Fine,AlignmentType.Begin,r.RepetitonUnderConstruction),r.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction))}r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||r.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DaCapoAlFine:if(r=this.getOrCreateCurrentRepetition(),r.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(r),r=this.createNewRepetition(0)),r.RepetitonUnderConstruction.startMarker!==void 0&&r.RepetitonUnderConstruction.StartIndex!==0&&(r=this.createNewRepetition(0)),r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,r.RepetitonUnderConstruction),r.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=r.RepetitonUnderConstruction,!r.FineFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,e.measureIndex);m>=0&&(r.FineFound=!0,r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(m,RepetitionInstructionEnum.Fine,AlignmentType.Begin,r.RepetitonUnderConstruction),r.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction))}r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||r.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DalSegnoAlCoda:if(this.openRepetitions.length===0)break;if(r=this.getOrCreateCurrentRepetition2(!0),e.parentRepetition=r.RepetitonUnderConstruction,!r.SegnoFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,e.measureIndex);m>=0&&(r.SegnoFound=!0,r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(m,RepetitionInstructionEnum.Segno,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].FirstRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.startMarker))}if(!r.ToCodaFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,e.measureIndex);if(m>=0)r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(m,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction),r.ToCodaFound=!0;else{const g=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,e.measureIndex);g>=0&&(r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(g,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[g].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction),r.ToCodaFound=!0)}}r.ToCodaFound&&(r.WaitingForCoda=!0),r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||r.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.DaCapoAlCoda:if(r=this.getOrCreateCurrentRepetition(),r.RepetitonUnderConstruction.BackwardJumpInstructions.length>0?(this.finalizeRepetition(r),r=this.createNewRepetition(0)):r.RepetitonUnderConstruction.EndingParts.length===0&&(this.finalizeRepetition(r),r=this.createNewRepetition(0)),r.RepetitonUnderConstruction.startMarker!==void 0&&r.RepetitonUnderConstruction.StartIndex!==0&&(r=this.createNewRepetition(0)),r.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,r.RepetitonUnderConstruction),r.RepetitonUnderConstruction.FromWords=!0,e.parentRepetition=r.RepetitonUnderConstruction,!r.ToCodaFound){const m=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,e.measureIndex);if(m>=0)r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(m,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[m].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction),r.ToCodaFound=!0;else{const g=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,e.measureIndex);g>=0&&(r.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(g,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,r.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[g].LastRepetitionInstructions.splice(0,0,r.RepetitonUnderConstruction.forwardJumpInstruction),r.ToCodaFound=!0)}}r.ToCodaFound&&(r.WaitingForCoda=!0),r.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||r.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),r.RepetitonUnderConstruction.BackwardJumpInstructions.push(e),this.currentMeasure.LastRepetitionInstructions.push(e);break;case RepetitionInstructionEnum.None:break;default:throw new ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}findInstructionInMainListBackwards(e,r){for(let s=this.repetitionInstructions.length-1;s>=0;s--){const o=this.repetitionInstructions[s];if(o.measureIndex<=r&&o.type===e)return o.measureIndex}return-1}finalizeRepetition(e){const r=e.RepetitonUnderConstruction;if(r.BackwardJumpInstructions.length>0){let s=!0;const o=this.getLastFinalizedRepetition();if(o!==void 0&&r.coversIdenticalMeasures(o)){if(r.NumberOfEndings>o.NumberOfEndings){const a=this.musicSheet.Repetitions.indexOf(o,0);a>-1&&this.musicSheet.Repetitions.splice(a,1),o.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(r)}s=!1,r.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(r);if(s){r.startMarker.type===RepetitionInstructionEnum.None&&this.musicSheet.SourceMeasures[r.StartIndex].FirstRepetitionInstructions.push(r.startMarker),console.log("设置循环次数3",window==null?void 0:window.DYCustomRepeatCount,this.rules.DYCustomRepeatCount,r.DefaultNumberOfRepetitions);const a=(window==null?void 0:window.DYCustomRepeatCount)>r.DefaultNumberOfRepetitions?window==null?void 0:window.DYCustomRepeatCount:r.DefaultNumberOfRepetitions;r.UserNumberOfRepetitions=a||this.rules.DYCustomRepeatCount||r.DefaultNumberOfRepetitions}}this.openRepetitions.splice(this.openRepetitions.length-1,1)}getCurrentRepetition(e){let r;for(let s=this.openRepetitions.length-1;s>=0;s--)if(this.openRepetitions[s].RepetitonUnderConstruction.FromWords===e){for(r=this.openRepetitions[s];s0)return this.openRepetitions.last();const e=this.createNewRepetition(0);return e.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,e.RepetitonUnderConstruction),e}getOrCreateCurrentRepetition2(e){let r;if(this.openRepetitions.length&&this.openRepetitions.last().RepetitonUnderConstruction.EndingParts.length<2){for(let o=this.openRepetitions.length-1;o>=0;o--)if(r=this.openRepetitions[o],r.RepetitonUnderConstruction.FromWords===e){for(;o0){const s=this.openRepetitions.last(),o=s.RepetitonUnderConstruction;if(o.BackwardJumpInstructions.length>0){const a=Object.keys(o.EndingIndexDict);(a.length===0||o.EndingIndexDict[a[a.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(s)}}const r=new RepetitionBuildingContainer(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=e,this.openRepetitions.push(r),r}getLastFinalizedRepetition(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}}class RepetitionBuildingContainer{constructor(e){this.RepetitonUnderConstruction=new Repetition(e)}}class MusicSymbolModuleFactory{static createRepetitionInstructionReader(){return new RepetitionInstructionReader}static createRepetitionCalculator(){return new RepetitionCalculator}}class ReaderPluginManager{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(e){this.voiceMeasureReadPlugins.push(e)}processVoiceMeasureReadPlugins(e,r,s){for(const o of this.voiceMeasureReadPlugins)try{o.measureReadCalculations(e,r,s)}catch(a){loglevelExports.info("VoiceGenerator.addSingleNote: ",a)}}}class MusicSheetReader{constructor(e=void 0,r=new EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new ReaderPluginManager,e?this.afterSheetReadingModules=e:this.afterSheetReadingModules=[],this.repetitionInstructionReader=MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=r}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(e){for(const r of e)r.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(e,r){try{return this._createMusicSheet(e,r)}catch(s){loglevelExports.error("MusicSheetReader.CreateMusicSheet",s);return}}_removeFromArray(e,r){const s=e.indexOf(r);s!==-1&&e.splice(s,1)}trimString(e){return e.replace(/^\s+|\s+$/g,"")}_lastElement(e){return e[e.length-1]}_createMusicSheet(e,r){const s=[];let o=0;if(this.musicSheet=new MusicSheet,this.musicSheet.Path=r,this.musicSheet.Rules=this.rules,!e)throw new MusicSheetReadingException("Undefined root element");this.pushSheetLabels(e,r);const a=e.element("part-list");if(!a)throw new MusicSheetReadingException("Undefined partListNode");const l=e.elements("part"),u=a.elements();this.initializeReading(u,l,s);let c=!0;this.currentFraction=new Fraction$1(0,1);let d=!1,y=e.element("identification");for(y&&(y=y.element("encoding")),y&&(y=y.element("software")),y!==void 0&&y.value==="Guitar Pro 5"&&(d=!0);c;){this.currentMeasure!==void 0&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(o=0),this.currentMeasure=new SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const m of s)try{c=c&&m.readNextXmlMeasure(this.currentMeasure,this.currentFraction,d)}catch(g){const v=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new MusicSheetReadingException(v,g)}c&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(s),this.checkSourceMeasureForNullEntries(),o=this.setSourceMeasureDuration(s,o),MusicSheetReader.doCalculationsAfterDurationHasBeenSet(s),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=100),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let m=0,g=this.afterSheetReadingModules.length;ms){if(this.areRhythmInstructionsMixed(r)&&u.SymbolEnum!==RhythmSymbolEnum.NONE)continue;s=u.Rhythm.RealValue,o=r.indexOf(u)}}if(r.length>0&&r.lengthe.Denominator){const s=r.Denominator/e.Denominator;e.expand(s)}}checkIfMeasureIsImplicit(e,r){return!this.previousMeasure&&e.lt(r)?!0:this.previousMeasure?Fraction$1.plus(this.previousMeasure.Duration,e).Equals(r):!1}allInstrumentsHaveSameDuration(e,r){let s=0;for(let o=0,a=e.length;o=0;e--)for(let r=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries.length-1;r>=0;r--){const s=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[r];if(s)for(let o=s.VoiceEntries.length-1;o>=0;o--){const a=s.VoiceEntries[o];a.Notes.length===0&&(this._removeFromArray(a.ParentVoice.VoiceEntries,a),this._removeFromArray(s.VoiceEntries,a))}s!==void 0&&s.VoiceEntries.length===0&&s.ChordContainers.length===0&&(this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries[r]=void 0)}for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;e>=0;e--){let r=0;for(let s=0,o=this.currentMeasure.VerticalSourceStaffEntryContainers[e].StaffEntries.length;s0){const o=r[0].elements("rights");if(o.length>0)for(let a=0,l=o.length;ar||w){if(!s&&!w)s=T;else if(A||C==="right")a?a+=` `+T:a=T;else if(x||C!=="right"&&C!=="left")o?o+=` `+T:o=T;else if(C==="left"){this.musicSheet.Lyricist||(this.musicSheet.Lyricist=new Label(T));break}}}}}}if(!this.musicSheet.Title&&s&&(this.musicSheet.Title=new Label(this.trimString(s))),!this.musicSheet.Subtitle&&o&&(this.musicSheet.Subtitle=new Label(this.trimString(o))),a){let g=!1;if(!this.musicSheet.Composer)g=!0;else{const v=((y=a.match(` `))!=null?y:[]).length+1,b=((m=this.musicSheet.Composer.text.match(` `))!=null?m:[]).length+1;v>=b&&(g=!0)}g&&(this.musicSheet.Composer=new Label(this.trimString(a)))}}readTitleAndComposerFromCreditsLegacy(e){var d,y,m;const r=this.computeSystemYCoordinates(e);if(r===0)return;let s=1,o,a=0,l,u;const c=e.elements("credit");for(let g=0,v=c.length;gr||_){if(!this.musicSheet.Title&&!_){const C=(m=S.attribute("font-size"))==null?void 0:m.value;if(C){const P=parseFloat(C);s0&&y.MidiInstrumentId!==MidiInstrument.Percussion&&(S.midiInstrumentID=Math.max(0,parseInt(w.value,10)-1));else if(w.name==="midi-unpitched")S.fixedKey=Math.max(0,parseInt(w.value,10));else if(w.name==="volume")try{const _=parseFloat(w.value);S.volume=_/127}catch(_){loglevelExports.debug("ExpressionReader.readExpressionParameters","read volume",_)}else if(w.name==="pan")try{const _=parseFloat(w.value);S.pan=_/64}catch(_){loglevelExports.debug("ExpressionReader.readExpressionParameters","read pan",_)}}catch(_){loglevelExports.info("MusicSheetReader.createInstrumentGroups midi settings: ",_)}}}}catch(S){loglevelExports.info("MusicSheetReader.createInstrumentGroups: ",S)}}if(y.SubInstruments.length===0){const g=new SubInstrument(y);y.SubInstruments.push(g)}s[d]=y,o?(o.InstrumentalGroups.push(y),this.musicSheet.Instruments.push(y)):(this.musicSheet.InstrumentalGroups.push(y),this.musicSheet.Instruments.push(y))}else if(c.name==="part-group"&&c.attribute("type").value==="start"){const d=new InstrumentalGroup("group",this.musicSheet,o);o?o.InstrumentalGroups.push(d):this.musicSheet.InstrumentalGroups.push(d),o=d}else if(c.name==="part-group"&&c.attribute("type").value==="stop"&&o){if(o.InstrumentalGroups.length===1){const d=o.InstrumentalGroups[0];o.Parent?(o.Parent.InstrumentalGroups.push(d),this._removeFromArray(o.Parent.InstrumentalGroups,o)):(this.musicSheet.InstrumentalGroups.push(d),this._removeFromArray(this.musicSheet.InstrumentalGroups,o))}o=o.Parent}}}catch(a){const l=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new MusicSheetReadingException(l,a)}for(let a=0,l=this.musicSheet.Instruments.length;a0){const a=o[0];if(a){let l=a.element("attributes");l&&(l=l.element("staves")),l?r+=parseInt(l.value,10):r++}}}if(isNaN(r)||r<=0){const s=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new MusicSheetReadingException(s)}return r}getInstrumentNumberOfStavesFromXml(e){let r=0;const s=e.element("measure");if(s){const o=s.element("attributes");let a;o&&(a=o.element("staves")),!o||!a?r=1:r=parseInt(a.value,10)}if(isNaN(r)||r<=0){const o=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new MusicSheetReadingException(o)}return r}}function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jszip_minExports={},jszip_min={get exports(){return jszip_minExports},set exports(i){jszip_minExports=i}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(i,e){(function(r){i.exports=r()})(function(){return function r(s,o,a){function l(d,y){if(!o[d]){if(!s[d]){var m=typeof commonjsRequire=="function"&&commonjsRequire;if(!y&&m)return m(d,!0);if(u)return u(d,!0);var g=new Error("Cannot find module '"+d+"'");throw g.code="MODULE_NOT_FOUND",g}var v=o[d]={exports:{}};s[d][0].call(v.exports,function(b){var S=s[d][1][b];return l(S||b)},v,v.exports,r,s,o,a)}return o[d].exports}for(var u=typeof commonjsRequire=="function"&&commonjsRequire,c=0;c>2,v=(3&d)<<4|y>>4,b=1>6:64,S=2>4,y=(15&g)<<4|(v=u.indexOf(c.charAt(S++)))>>2,m=(3&v)<<6|(b=u.indexOf(c.charAt(S++))),E[x++]=d,v!==64&&(E[x++]=y),b!==64&&(E[x++]=m);return E}},{"./support":30,"./utils":32}],2:[function(r,s,o){var a=r("./external"),l=r("./stream/DataWorker"),u=r("./stream/Crc32Probe"),c=r("./stream/DataLengthProbe");function d(y,m,g,v,b){this.compressedSize=y,this.uncompressedSize=m,this.crc32=g,this.compression=v,this.compressedContent=b}d.prototype={getContentWorker:function(){var y=new l(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),m=this;return y.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new l(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(y,m,g){return y.pipe(new u).pipe(new c("uncompressedSize")).pipe(m.compressWorker(g)).pipe(new c("compressedSize")).withStreamInfo("compression",m)},s.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,s,o){var a=r("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},o.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,s,o){var a=r("./utils"),l=function(){for(var u,c=[],d=0;d<256;d++){u=d;for(var y=0;y<8;y++)u=1&u?3988292384^u>>>1:u>>>1;c[d]=u}return c}();s.exports=function(u,c){return u!==void 0&&u.length?a.getTypeOf(u)!=="string"?function(d,y,m,g){var v=l,b=g+m;d^=-1;for(var S=g;S>>8^v[255&(d^y[S])];return-1^d}(0|c,u,u.length,0):function(d,y,m,g){var v=l,b=g+m;d^=-1;for(var S=g;S>>8^v[255&(d^y.charCodeAt(S))];return-1^d}(0|c,u,u.length,0):0}},{"./utils":32}],5:[function(r,s,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(r,s,o){var a=null;a=typeof Promise<"u"?Promise:r("lie"),s.exports={Promise:a}},{lie:37}],7:[function(r,s,o){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",l=r("pako"),u=r("./utils"),c=r("./stream/GenericWorker"),d=a?"uint8array":"array";function y(m,g){c.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=g,this.meta={}}o.magic="\b\0",u.inherits(y,c),y.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(u.transformTo(d,m.data),!1)},y.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new l[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(g){m.push({data:g,meta:m.meta})}},o.compressWorker=function(m){return new y("Deflate",m)},o.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,s,o){function a(v,b){var S,x="";for(S=0;S>>=8;return x}function l(v,b,S,x,A,E){var w,_,T=v.file,C=v.compression,P=E!==d.utf8encode,k=u.transformTo("string",E(T.name)),M=u.transformTo("string",d.utf8encode(T.name)),R=T.comment,H=u.transformTo("string",E(R)),B=u.transformTo("string",d.utf8encode(R)),F=M.length!==T.name.length,I=B.length!==R.length,U="",D="",$="",N=T.dir,O=T.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};b&&!S||(Q.crc32=v.crc32,Q.compressedSize=v.compressedSize,Q.uncompressedSize=v.uncompressedSize);var z=0;b&&(z|=8),P||!F&&!I||(z|=2048);var W=0,xe=0;N&&(W|=16),A==="UNIX"?(xe=798,W|=function(q,re){var ue=q;return q||(ue=re?16893:33204),(65535&ue)<<16}(T.unixPermissions,N)):(xe=20,W|=function(q){return 63&(q||0)}(T.dosPermissions)),w=O.getUTCHours(),w<<=6,w|=O.getUTCMinutes(),w<<=5,w|=O.getUTCSeconds()/2,_=O.getUTCFullYear()-1980,_<<=4,_|=O.getUTCMonth()+1,_<<=5,_|=O.getUTCDate(),F&&(D=a(1,1)+a(y(k),4)+M,U+="up"+a(D.length,2)+D),I&&($=a(1,1)+a(y(H),4)+B,U+="uc"+a($.length,2)+$);var ye="";return ye+=` \0`,ye+=a(z,2),ye+=C.magic,ye+=a(w,2),ye+=a(_,2),ye+=a(Q.crc32,4),ye+=a(Q.compressedSize,4),ye+=a(Q.uncompressedSize,4),ye+=a(k.length,2),ye+=a(U.length,2),{fileRecord:m.LOCAL_FILE_HEADER+ye+k+U,dirRecord:m.CENTRAL_FILE_HEADER+a(xe,2)+ye+a(H.length,2)+"\0\0\0\0"+a(W,4)+a(x,4)+k+U+H}}var u=r("../utils"),c=r("../stream/GenericWorker"),d=r("../utf8"),y=r("../crc32"),m=r("../signature");function g(v,b,S,x){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=S,this.encodeFileName=x,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(g,c),g.prototype.push=function(v){var b=v.meta.percent||0,S=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,c.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:S?(b+100*(S-x-1))/S:100}}))},g.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var b=this.streamFiles&&!v.file.dir;if(b){var S=l(v,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:S.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(v){this.accumulate=!1;var b=this.streamFiles&&!v.file.dir,S=l(v,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(S.dirRecord),b)this.push({data:function(x){return m.DATA_DESCRIPTOR+a(x.crc32,4)+a(x.compressedSize,4)+a(x.uncompressedSize,4)}(v),meta:{percent:100}});else for(this.push({data:S.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var v=this.bytesWritten,b=0;b=this.index;c--)d=(d<<8)+this.byteAt(c);return this.index+=u,d},readString:function(u){return a.transformTo("string",this.readData(u))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var u=this.readInt(4);return new Date(Date.UTC(1980+(u>>25&127),(u>>21&15)-1,u>>16&31,u>>11&31,u>>5&63,(31&u)<<1))}},s.exports=l},{"../utils":32}],19:[function(r,s,o){var a=r("./Uint8ArrayReader");function l(u){a.call(this,u)}r("../utils").inherits(l,a),l.prototype.readData=function(u){this.checkOffset(u);var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},s.exports=l},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,s,o){var a=r("./DataReader");function l(u){a.call(this,u)}r("../utils").inherits(l,a),l.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},l.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},l.prototype.readAndCheckSignature=function(u){return u===this.readData(4)},l.prototype.readData=function(u){this.checkOffset(u);var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},s.exports=l},{"../utils":32,"./DataReader":18}],21:[function(r,s,o){var a=r("./ArrayReader");function l(u){a.call(this,u)}r("../utils").inherits(l,a),l.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},s.exports=l},{"../utils":32,"./ArrayReader":17}],22:[function(r,s,o){var a=r("../utils"),l=r("../support"),u=r("./ArrayReader"),c=r("./StringReader"),d=r("./NodeBufferReader"),y=r("./Uint8ArrayReader");s.exports=function(m){var g=a.getTypeOf(m);return a.checkSupport(g),g!=="string"||l.uint8array?g==="nodebuffer"?new d(m):l.uint8array?new y(a.transformTo("uint8array",m)):new u(a.transformTo("array",m)):new c(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,s,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,s,o){var a=r("./GenericWorker"),l=r("../utils");function u(c){a.call(this,"ConvertWorker to "+c),this.destType=c}l.inherits(u,a),u.prototype.processChunk=function(c){this.push({data:l.transformTo(this.destType,c.data),meta:c.meta})},s.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(r,s,o){var a=r("./GenericWorker"),l=r("../crc32");function u(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(u,a),u.prototype.processChunk=function(c){this.streamInfo.crc32=l(c.data,this.streamInfo.crc32||0),this.push(c)},s.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,s,o){var a=r("../utils"),l=r("./GenericWorker");function u(c){l.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(u,l),u.prototype.processChunk=function(c){if(c){var d=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=d+c.data.length}l.prototype.processChunk.call(this,c)},s.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(r,s,o){var a=r("../utils"),l=r("./GenericWorker");function u(c){l.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(y){d.dataIsReady=!0,d.data=y,d.max=y&&y.length||0,d.type=a.getTypeOf(y),d.isPaused||d._tickAndRepeat()},function(y){d.error(y)})}a.inherits(u,l),u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,d=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,d);break;case"uint8array":c=this.data.subarray(this.index,d);break;case"array":case"nodebuffer":c=this.data.slice(this.index,d)}return this.index=d,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(r,s,o){function a(l){this.name=l||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(l){this.emit("data",l)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(l){this.emit("error",l)}return!0},error:function(l){return!this.isFinished&&(this.isPaused?this.generatedError=l:(this.isFinished=!0,this.emit("error",l),this.previous&&this.previous.error(l),this.cleanUp()),!0)},on:function(l,u){return this._listeners[l].push(u),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(l,u){if(this._listeners[l])for(var c=0;c "+l:l}},s.exports=a},{}],29:[function(r,s,o){var a=r("../utils"),l=r("./ConvertWorker"),u=r("./GenericWorker"),c=r("../base64"),d=r("../support"),y=r("../external"),m=null;if(d.nodestream)try{m=r("../nodejs/NodejsStreamOutputAdapter")}catch(b){}function g(b,S){return new y.Promise(function(x,A){var E=[],w=b._internalType,_=b._outputType,T=b._mimeType;b.on("data",function(C,P){E.push(C),S&&S(P)}).on("error",function(C){E=[],A(C)}).on("end",function(){try{var C=function(P,k,M){switch(P){case"blob":return a.newBlob(a.transformTo("arraybuffer",k),M);case"base64":return c.encode(k);default:return a.transformTo(P,k)}}(_,function(P,k){var M,R=0,H=null,B=0;for(M=0;M"u")o.blob=!1;else{var a=new ArrayBuffer(0);try{o.blob=new Blob([a],{type:"application/zip"}).size===0}catch(u){try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);l.append(a),o.blob=l.getBlob("application/zip").size===0}catch(c){o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch(u){o.nodestream=!1}},{"readable-stream":16}],31:[function(r,s,o){for(var a=r("./utils"),l=r("./support"),u=r("./nodejsUtils"),c=r("./stream/GenericWorker"),d=new Array(256),y=0;y<256;y++)d[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;d[254]=d[254]=1;function m(){c.call(this,"utf-8 decode"),this.leftOver=null}function g(){c.call(this,"utf-8 encode")}o.utf8encode=function(v){return l.nodebuffer?u.newBufferFrom(v,"utf-8"):function(b){var S,x,A,E,w,_=b.length,T=0;for(E=0;E<_;E++)(64512&(x=b.charCodeAt(E)))==55296&&E+1<_&&(64512&(A=b.charCodeAt(E+1)))==56320&&(x=65536+(x-55296<<10)+(A-56320),E++),T+=x<128?1:x<2048?2:x<65536?3:4;for(S=l.uint8array?new Uint8Array(T):new Array(T),E=w=0;w>>6:(x<65536?S[w++]=224|x>>>12:(S[w++]=240|x>>>18,S[w++]=128|x>>>12&63),S[w++]=128|x>>>6&63),S[w++]=128|63&x);return S}(v)},o.utf8decode=function(v){return l.nodebuffer?a.transformTo("nodebuffer",v).toString("utf-8"):function(b){var S,x,A,E,w=b.length,_=new Array(2*w);for(S=x=0;S>10&1023,_[x++]=56320|1023&A)}return _.length!==x&&(_.subarray?_=_.subarray(0,x):_.length=x),a.applyFromCharCode(_)}(v=a.transformTo(l.uint8array?"uint8array":"array",v))},a.inherits(m,c),m.prototype.processChunk=function(v){var b=a.transformTo(l.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(l.uint8array){var S=b;(b=new Uint8Array(S.length+this.leftOver.length)).set(this.leftOver,0),b.set(S,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var x=function(E,w){var _;for((w=w||E.length)>E.length&&(w=E.length),_=w-1;0<=_&&(192&E[_])==128;)_--;return _<0||_===0?w:_+d[E[_]]>w?_:w}(b),A=b;x!==b.length&&(l.uint8array?(A=b.subarray(0,x),this.leftOver=b.subarray(x,b.length)):(A=b.slice(0,x),this.leftOver=b.slice(x,b.length))),this.push({data:o.utf8decode(A),meta:v.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=m,a.inherits(g,c),g.prototype.processChunk=function(v){this.push({data:o.utf8encode(v.data),meta:v.meta})},o.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,s,o){var a=r("./support"),l=r("./base64"),u=r("./nodejsUtils"),c=r("./external");function d(S){return S}function y(S,x){for(var A=0;A>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=a(this.extraFields[1].value);this.uncompressedSize===l.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===l.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===l.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===l.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var b,S,x,A=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?g[x++]=224|v>>>12:(g[x++]=240|v>>>18,g[x++]=128|v>>>12&63),g[x++]=128|v>>>6&63),g[x++]=128|63&v);return g},o.buf2binstring=function(m){return y(m,m.length)},o.binstring2buf=function(m){for(var g=new a.Buf8(m.length),v=0,b=g.length;v>10&1023,E[b++]=56320|1023&S)}return y(E,b)},o.utf8border=function(m,g){var v;for((g=g||m.length)>m.length&&(g=m.length),v=g-1;0<=v&&(192&m[v])==128;)v--;return v<0||v===0?g:v+c[m[v]]>g?v:g}},{"./common":41}],43:[function(r,s,o){s.exports=function(a,l,u,c){for(var d=65535&a|0,y=a>>>16&65535|0,m=0;u!==0;){for(u-=m=2e3>>1:l>>>1;u[c]=l}return u}();s.exports=function(l,u,c,d){var y=a,m=d+c;l^=-1;for(var g=d;g>>8^y[255&(l^u[g])];return-1^l}},{}],46:[function(r,s,o){var a,l=r("../utils/common"),u=r("./trees"),c=r("./adler32"),d=r("./crc32"),y=r("./messages"),m=0,g=4,v=0,b=-2,S=-1,x=4,A=2,E=8,w=9,_=286,T=30,C=19,P=2*_+1,k=15,M=3,R=258,H=R+M+1,B=42,F=113,I=1,U=2,D=3,$=4;function N(V,pe){return V.msg=y[pe],pe}function O(V){return(V<<1)-(4V.avail_out&&(ce=V.avail_out),ce!==0&&(l.arraySet(V.output,pe.pending_buf,pe.pending_out,ce,V.next_out),V.next_out+=ce,pe.pending_out+=ce,V.total_out+=ce,V.avail_out-=ce,pe.pending-=ce,pe.pending===0&&(pe.pending_out=0))}function W(V,pe){u._tr_flush_block(V,0<=V.block_start?V.block_start:-1,V.strstart-V.block_start,pe),V.block_start=V.strstart,z(V.strm)}function xe(V,pe){V.pending_buf[V.pending++]=pe}function ye(V,pe){V.pending_buf[V.pending++]=pe>>>8&255,V.pending_buf[V.pending++]=255&pe}function q(V,pe){var ce,K,Z=V.max_chain_length,he=V.strstart,Ce=V.prev_length,Ae=V.nice_match,_e=V.strstart>V.w_size-H?V.strstart-(V.w_size-H):0,ke=V.window,Re=V.w_mask,Ee=V.prev,le=V.strstart+R,we=ke[he+Ce-1],de=ke[he+Ce];V.prev_length>=V.good_match&&(Z>>=2),Ae>V.lookahead&&(Ae=V.lookahead);do if(ke[(ce=pe)+Ce]===de&&ke[ce+Ce-1]===we&&ke[ce]===ke[he]&&ke[++ce]===ke[he+1]){he+=2,ce++;do;while(ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&ke[++he]===ke[++ce]&&he_e&&--Z!=0);return Ce<=V.lookahead?Ce:V.lookahead}function re(V){var pe,ce,K,Z,he,Ce,Ae,_e,ke,Re,Ee=V.w_size;do{if(Z=V.window_size-V.lookahead-V.strstart,V.strstart>=Ee+(Ee-H)){for(l.arraySet(V.window,V.window,Ee,Ee,0),V.match_start-=Ee,V.strstart-=Ee,V.block_start-=Ee,pe=ce=V.hash_size;K=V.head[--pe],V.head[pe]=Ee<=K?K-Ee:0,--ce;);for(pe=ce=Ee;K=V.prev[--pe],V.prev[pe]=Ee<=K?K-Ee:0,--ce;);Z+=Ee}if(V.strm.avail_in===0)break;if(Ce=V.strm,Ae=V.window,_e=V.strstart+V.lookahead,ke=Z,Re=void 0,Re=Ce.avail_in,ke=M)for(he=V.strstart-V.insert,V.ins_h=V.window[he],V.ins_h=(V.ins_h<=M&&(V.ins_h=(V.ins_h<=M)if(K=u._tr_tally(V,V.strstart-V.match_start,V.match_length-M),V.lookahead-=V.match_length,V.match_length<=V.max_lazy_match&&V.lookahead>=M){for(V.match_length--;V.strstart++,V.ins_h=(V.ins_h<=M&&(V.ins_h=(V.ins_h<=M&&V.match_length<=V.prev_length){for(Z=V.strstart+V.lookahead-M,K=u._tr_tally(V,V.strstart-1-V.prev_match,V.prev_length-M),V.lookahead-=V.prev_length-1,V.prev_length-=2;++V.strstart<=Z&&(V.ins_h=(V.ins_h<V.pending_buf_size-5&&(ce=V.pending_buf_size-5);;){if(V.lookahead<=1){if(re(V),V.lookahead===0&&pe===m)return I;if(V.lookahead===0)break}V.strstart+=V.lookahead,V.lookahead=0;var K=V.block_start+ce;if((V.strstart===0||V.strstart>=K)&&(V.lookahead=V.strstart-K,V.strstart=K,W(V,!1),V.strm.avail_out===0)||V.strstart-V.block_start>=V.w_size-H&&(W(V,!1),V.strm.avail_out===0))return I}return V.insert=0,pe===g?(W(V,!0),V.strm.avail_out===0?D:$):(V.strstart>V.block_start&&(W(V,!1),V.strm.avail_out),I)}),new Se(4,4,8,4,ue),new Se(4,5,16,8,ue),new Se(4,6,32,32,ue),new Se(4,4,16,16,ge),new Se(8,16,32,32,ge),new Se(8,16,128,128,ge),new Se(8,32,128,256,ge),new Se(32,128,258,1024,ge),new Se(32,258,258,4096,ge)],o.deflateInit=function(V,pe){return se(V,pe,E,15,8,0)},o.deflateInit2=se,o.deflateReset=J,o.deflateResetKeep=Ie,o.deflateSetHeader=function(V,pe){return V&&V.state?V.state.wrap!==2?b:(V.state.gzhead=pe,v):b},o.deflate=function(V,pe){var ce,K,Z,he;if(!V||!V.state||5>8&255),xe(K,K.gzhead.time>>16&255),xe(K,K.gzhead.time>>24&255),xe(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),xe(K,255&K.gzhead.os),K.gzhead.extra&&K.gzhead.extra.length&&(xe(K,255&K.gzhead.extra.length),xe(K,K.gzhead.extra.length>>8&255)),K.gzhead.hcrc&&(V.adler=d(V.adler,K.pending_buf,K.pending,0)),K.gzindex=0,K.status=69):(xe(K,0),xe(K,0),xe(K,0),xe(K,0),xe(K,0),xe(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),xe(K,3),K.status=F);else{var Ce=E+(K.w_bits-8<<4)<<8;Ce|=(2<=K.strategy||K.level<2?0:K.level<6?1:K.level===6?2:3)<<6,K.strstart!==0&&(Ce|=32),Ce+=31-Ce%31,K.status=F,ye(K,Ce),K.strstart!==0&&(ye(K,V.adler>>>16),ye(K,65535&V.adler)),V.adler=1}if(K.status===69)if(K.gzhead.extra){for(Z=K.pending;K.gzindex<(65535&K.gzhead.extra.length)&&(K.pending!==K.pending_buf_size||(K.gzhead.hcrc&&K.pending>Z&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),z(V),Z=K.pending,K.pending!==K.pending_buf_size));)xe(K,255&K.gzhead.extra[K.gzindex]),K.gzindex++;K.gzhead.hcrc&&K.pending>Z&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),K.gzindex===K.gzhead.extra.length&&(K.gzindex=0,K.status=73)}else K.status=73;if(K.status===73)if(K.gzhead.name){Z=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>Z&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),z(V),Z=K.pending,K.pending===K.pending_buf_size)){he=1;break}he=K.gzindexZ&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),he===0&&(K.gzindex=0,K.status=91)}else K.status=91;if(K.status===91)if(K.gzhead.comment){Z=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>Z&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),z(V),Z=K.pending,K.pending===K.pending_buf_size)){he=1;break}he=K.gzindexZ&&(V.adler=d(V.adler,K.pending_buf,K.pending-Z,Z)),he===0&&(K.status=103)}else K.status=103;if(K.status===103&&(K.gzhead.hcrc?(K.pending+2>K.pending_buf_size&&z(V),K.pending+2<=K.pending_buf_size&&(xe(K,255&V.adler),xe(K,V.adler>>8&255),V.adler=0,K.status=F)):K.status=F),K.pending!==0){if(z(V),V.avail_out===0)return K.last_flush=-1,v}else if(V.avail_in===0&&O(pe)<=O(ce)&&pe!==g)return N(V,-5);if(K.status===666&&V.avail_in!==0)return N(V,-5);if(V.avail_in!==0||K.lookahead!==0||pe!==m&&K.status!==666){var Ae=K.strategy===2?function(_e,ke){for(var Re;;){if(_e.lookahead===0&&(re(_e),_e.lookahead===0)){if(ke===m)return I;break}if(_e.match_length=0,Re=u._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++,Re&&(W(_e,!1),_e.strm.avail_out===0))return I}return _e.insert=0,ke===g?(W(_e,!0),_e.strm.avail_out===0?D:$):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?I:U}(K,pe):K.strategy===3?function(_e,ke){for(var Re,Ee,le,we,de=_e.window;;){if(_e.lookahead<=R){if(re(_e),_e.lookahead<=R&&ke===m)return I;if(_e.lookahead===0)break}if(_e.match_length=0,_e.lookahead>=M&&0<_e.strstart&&(Ee=de[le=_e.strstart-1])===de[++le]&&Ee===de[++le]&&Ee===de[++le]){we=_e.strstart+R;do;while(Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&Ee===de[++le]&&le_e.lookahead&&(_e.match_length=_e.lookahead)}if(_e.match_length>=M?(Re=u._tr_tally(_e,1,_e.match_length-M),_e.lookahead-=_e.match_length,_e.strstart+=_e.match_length,_e.match_length=0):(Re=u._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++),Re&&(W(_e,!1),_e.strm.avail_out===0))return I}return _e.insert=0,ke===g?(W(_e,!0),_e.strm.avail_out===0?D:$):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?I:U}(K,pe):a[K.level].func(K,pe);if(Ae!==D&&Ae!==$||(K.status=666),Ae===I||Ae===D)return V.avail_out===0&&(K.last_flush=-1),v;if(Ae===U&&(pe===1?u._tr_align(K):pe!==5&&(u._tr_stored_block(K,0,0,!1),pe===3&&(Q(K.head),K.lookahead===0&&(K.strstart=0,K.block_start=0,K.insert=0))),z(V),V.avail_out===0))return K.last_flush=-1,v}return pe!==g?v:K.wrap<=0?1:(K.wrap===2?(xe(K,255&V.adler),xe(K,V.adler>>8&255),xe(K,V.adler>>16&255),xe(K,V.adler>>24&255),xe(K,255&V.total_in),xe(K,V.total_in>>8&255),xe(K,V.total_in>>16&255),xe(K,V.total_in>>24&255)):(ye(K,V.adler>>>16),ye(K,65535&V.adler)),z(V),0=ce.w_size&&(he===0&&(Q(ce.head),ce.strstart=0,ce.block_start=0,ce.insert=0),ke=new l.Buf8(ce.w_size),l.arraySet(ke,pe,Re-ce.w_size,ce.w_size,0),pe=ke,Re=ce.w_size),Ce=V.avail_in,Ae=V.next_in,_e=V.input,V.avail_in=Re,V.next_in=0,V.input=pe,re(ce);ce.lookahead>=M;){for(K=ce.strstart,Z=ce.lookahead-(M-1);ce.ins_h=(ce.ins_h<>>=M=k>>>24,w-=M,(M=k>>>16&255)===0)U[y++]=65535&k;else{if(!(16&M)){if(!(64&M)){k=_[(65535&k)+(E&(1<>>=M,w-=M),w<15&&(E+=I[c++]<>>=M=k>>>24,w-=M,!(16&(M=k>>>16&255))){if(!(64&M)){k=T[(65535&k)+(E&(1<>>=M,w-=M,(M=y-m)>3,E&=(1<<(w-=R<<3))-1,a.next_in=c,a.next_out=y,a.avail_in=c>>24&255)+(B>>>8&65280)+((65280&B)<<8)+((255&B)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(B){var F;return B&&B.state?(F=B.state,B.total_in=B.total_out=F.total=0,B.msg="",F.wrap&&(B.adler=1&F.wrap),F.mode=b,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new a.Buf32(S),F.distcode=F.distdyn=new a.Buf32(x),F.sane=1,F.back=-1,g):v}function _(B){var F;return B&&B.state?((F=B.state).wsize=0,F.whave=0,F.wnext=0,w(B)):v}function T(B,F){var I,U;return B&&B.state?(U=B.state,F<0?(I=0,F=-F):(I=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(a.arraySet($.window,F,I-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(U<(D=$.wsize-$.wnext)&&(D=U),a.arraySet($.window,F,I-U,D,$.wnext),(U-=D)?(a.arraySet($.window,F,I-U,U,0),$.wnext=U,$.whave=$.wsize):($.wnext+=D,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=D))),0}o.inflateReset=_,o.inflateReset2=T,o.inflateResetKeep=w,o.inflateInit=function(B){return C(B,15)},o.inflateInit2=C,o.inflate=function(B,F){var I,U,D,$,N,O,Q,z,W,xe,ye,q,re,ue,ge,Se,Be,Ie,J,se,V,pe,ce,K,Z=0,he=new a.Buf8(4),Ce=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!B||!B.state||!B.output||!B.input&&B.avail_in!==0)return v;(I=B.state).mode===12&&(I.mode=13),N=B.next_out,D=B.output,Q=B.avail_out,$=B.next_in,U=B.input,O=B.avail_in,z=I.hold,W=I.bits,xe=O,ye=Q,pe=g;e:for(;;)switch(I.mode){case b:if(I.wrap===0){I.mode=13;break}for(;W<16;){if(O===0)break e;O--,z+=U[$++]<>>8&255,I.check=u(I.check,he,2,0),W=z=0,I.mode=2;break}if(I.flags=0,I.head&&(I.head.done=!1),!(1&I.wrap)||(((255&z)<<8)+(z>>8))%31){B.msg="incorrect header check",I.mode=30;break}if((15&z)!=8){B.msg="unknown compression method",I.mode=30;break}if(W-=4,V=8+(15&(z>>>=4)),I.wbits===0)I.wbits=V;else if(V>I.wbits){B.msg="invalid window size",I.mode=30;break}I.dmax=1<>8&1),512&I.flags&&(he[0]=255&z,he[1]=z>>>8&255,I.check=u(I.check,he,2,0)),W=z=0,I.mode=3;case 3:for(;W<32;){if(O===0)break e;O--,z+=U[$++]<>>8&255,he[2]=z>>>16&255,he[3]=z>>>24&255,I.check=u(I.check,he,4,0)),W=z=0,I.mode=4;case 4:for(;W<16;){if(O===0)break e;O--,z+=U[$++]<>8),512&I.flags&&(he[0]=255&z,he[1]=z>>>8&255,I.check=u(I.check,he,2,0)),W=z=0,I.mode=5;case 5:if(1024&I.flags){for(;W<16;){if(O===0)break e;O--,z+=U[$++]<>>8&255,I.check=u(I.check,he,2,0)),W=z=0}else I.head&&(I.head.extra=null);I.mode=6;case 6:if(1024&I.flags&&(O<(q=I.length)&&(q=O),q&&(I.head&&(V=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Array(I.head.extra_len)),a.arraySet(I.head.extra,U,$,q,V)),512&I.flags&&(I.check=u(I.check,U,q,$)),O-=q,$+=q,I.length-=q),I.length))break e;I.length=0,I.mode=7;case 7:if(2048&I.flags){if(O===0)break e;for(q=0;V=U[$+q++],I.head&&V&&I.length<65536&&(I.head.name+=String.fromCharCode(V)),V&&q>9&1,I.head.done=!0),B.adler=I.check=0,I.mode=12;break;case 10:for(;W<32;){if(O===0)break e;O--,z+=U[$++]<>>=7&W,W-=7&W,I.mode=27;break}for(;W<3;){if(O===0)break e;O--,z+=U[$++]<>>=1)){case 0:I.mode=14;break;case 1:if(R(I),I.mode=20,F!==6)break;z>>>=2,W-=2;break e;case 2:I.mode=17;break;case 3:B.msg="invalid block type",I.mode=30}z>>>=2,W-=2;break;case 14:for(z>>>=7&W,W-=7&W;W<32;){if(O===0)break e;O--,z+=U[$++]<>>16^65535)){B.msg="invalid stored block lengths",I.mode=30;break}if(I.length=65535&z,W=z=0,I.mode=15,F===6)break e;case 15:I.mode=16;case 16:if(q=I.length){if(O>>=5,W-=5,I.ndist=1+(31&z),z>>>=5,W-=5,I.ncode=4+(15&z),z>>>=4,W-=4,286>>=3,W-=3}for(;I.have<19;)I.lens[Ce[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,ce={bits:I.lenbits},pe=d(0,I.lens,0,19,I.lencode,0,I.work,ce),I.lenbits=ce.bits,pe){B.msg="invalid code lengths set",I.mode=30;break}I.have=0,I.mode=19;case 19:for(;I.have>>16&255,Be=65535&Z,!((ge=Z>>>24)<=W);){if(O===0)break e;O--,z+=U[$++]<>>=ge,W-=ge,I.lens[I.have++]=Be;else{if(Be===16){for(K=ge+2;W>>=ge,W-=ge,I.have===0){B.msg="invalid bit length repeat",I.mode=30;break}V=I.lens[I.have-1],q=3+(3&z),z>>>=2,W-=2}else if(Be===17){for(K=ge+3;W>>=ge)),z>>>=3,W-=3}else{for(K=ge+7;W>>=ge)),z>>>=7,W-=7}if(I.have+q>I.nlen+I.ndist){B.msg="invalid bit length repeat",I.mode=30;break}for(;q--;)I.lens[I.have++]=V}}if(I.mode===30)break;if(I.lens[256]===0){B.msg="invalid code -- missing end-of-block",I.mode=30;break}if(I.lenbits=9,ce={bits:I.lenbits},pe=d(y,I.lens,0,I.nlen,I.lencode,0,I.work,ce),I.lenbits=ce.bits,pe){B.msg="invalid literal/lengths set",I.mode=30;break}if(I.distbits=6,I.distcode=I.distdyn,ce={bits:I.distbits},pe=d(m,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,ce),I.distbits=ce.bits,pe){B.msg="invalid distances set",I.mode=30;break}if(I.mode=20,F===6)break e;case 20:I.mode=21;case 21:if(6<=O&&258<=Q){B.next_out=N,B.avail_out=Q,B.next_in=$,B.avail_in=O,I.hold=z,I.bits=W,c(B,ye),N=B.next_out,D=B.output,Q=B.avail_out,$=B.next_in,U=B.input,O=B.avail_in,z=I.hold,W=I.bits,I.mode===12&&(I.back=-1);break}for(I.back=0;Se=(Z=I.lencode[z&(1<>>16&255,Be=65535&Z,!((ge=Z>>>24)<=W);){if(O===0)break e;O--,z+=U[$++]<>Ie)])>>>16&255,Be=65535&Z,!(Ie+(ge=Z>>>24)<=W);){if(O===0)break e;O--,z+=U[$++]<>>=Ie,W-=Ie,I.back+=Ie}if(z>>>=ge,W-=ge,I.back+=ge,I.length=Be,Se===0){I.mode=26;break}if(32&Se){I.back=-1,I.mode=12;break}if(64&Se){B.msg="invalid literal/length code",I.mode=30;break}I.extra=15&Se,I.mode=22;case 22:if(I.extra){for(K=I.extra;W>>=I.extra,W-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=23;case 23:for(;Se=(Z=I.distcode[z&(1<>>16&255,Be=65535&Z,!((ge=Z>>>24)<=W);){if(O===0)break e;O--,z+=U[$++]<>Ie)])>>>16&255,Be=65535&Z,!(Ie+(ge=Z>>>24)<=W);){if(O===0)break e;O--,z+=U[$++]<>>=Ie,W-=Ie,I.back+=Ie}if(z>>>=ge,W-=ge,I.back+=ge,64&Se){B.msg="invalid distance code",I.mode=30;break}I.offset=Be,I.extra=15&Se,I.mode=24;case 24:if(I.extra){for(K=I.extra;W>>=I.extra,W-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){B.msg="invalid distance too far back",I.mode=30;break}I.mode=25;case 25:if(Q===0)break e;if(q=ye-Q,I.offset>q){if((q=I.offset-q)>I.whave&&I.sane){B.msg="invalid distance too far back",I.mode=30;break}re=q>I.wnext?(q-=I.wnext,I.wsize-q):I.wnext-q,q>I.length&&(q=I.length),ue=I.window}else ue=D,re=N-I.offset,q=I.length;for(QP?(M=re[ue+x[F]],W[xe+x[F]]):(M=96,0),E=1<>N)+(w-=E)]=k<<24|M<<16|R|0,w!==0;);for(E=1<>=1;if(E!==0?(z&=E-1,z+=E):z=0,F++,--ye[B]==0){if(B===U)break;B=m[g+x[F]]}if(D>>7)]}function xe(Z,he){Z.pending_buf[Z.pending++]=255&he,Z.pending_buf[Z.pending++]=he>>>8&255}function ye(Z,he,Ce){Z.bi_valid>A-Ce?(Z.bi_buf|=he<>A-Z.bi_valid,Z.bi_valid+=Ce-A):(Z.bi_buf|=he<>>=1,Ce<<=1,0<--he;);return Ce>>>1}function ue(Z,he,Ce){var Ae,_e,ke=new Array(x+1),Re=0;for(Ae=1;Ae<=x;Ae++)ke[Ae]=Re=Re+Ce[Ae-1]<<1;for(_e=0;_e<=he;_e++){var Ee=Z[2*_e+1];Ee!==0&&(Z[2*_e]=re(ke[Ee]++,Ee))}}function ge(Z){var he;for(he=0;he>1;1<=Ce;Ce--)Ie(Z,ke,Ce);for(_e=le;Ce=Z.heap[1],Z.heap[1]=Z.heap[Z.heap_len--],Ie(Z,ke,1),Ae=Z.heap[1],Z.heap[--Z.heap_max]=Ce,Z.heap[--Z.heap_max]=Ae,ke[2*_e]=ke[2*Ce]+ke[2*Ae],Z.depth[_e]=(Z.depth[Ce]>=Z.depth[Ae]?Z.depth[Ce]:Z.depth[Ae])+1,ke[2*Ce+1]=ke[2*Ae+1]=_e,Z.heap[1]=_e++,Ie(Z,ke,1),2<=Z.heap_len;);Z.heap[--Z.heap_max]=Z.heap[1],function(de,De){var Ve,$e,Je,Ye,tt,Ze,ot=De.dyn_tree,pt=De.max_code,nt=De.stat_desc.static_tree,ct=De.stat_desc.has_stree,Pt=De.stat_desc.extra_bits,at=De.stat_desc.extra_base,ft=De.stat_desc.max_length,wt=0;for(Ye=0;Ye<=x;Ye++)de.bl_count[Ye]=0;for(ot[2*de.heap[de.heap_max]+1]=0,Ve=de.heap_max+1;Ve>=7;_e>>=1)if(1&we&&Ee.dyn_ltree[2*le]!==0)return l;if(Ee.dyn_ltree[18]!==0||Ee.dyn_ltree[20]!==0||Ee.dyn_ltree[26]!==0)return u;for(le=32;le>>3,(ke=Z.static_len+3+7>>>3)<=_e&&(_e=ke)):_e=ke=Ce+5,Ce+4<=_e&&he!==-1?K(Z,he,Ce,Ae):Z.strategy===4||ke===_e?(ye(Z,2+(Ae?1:0),3),J(Z,H,B)):(ye(Z,4+(Ae?1:0),3),function(Ee,le,we,de){var De;for(ye(Ee,le-257,5),ye(Ee,we-1,5),ye(Ee,de-4,4),De=0;De>>8&255,Z.pending_buf[Z.d_buf+2*Z.last_lit+1]=255&he,Z.pending_buf[Z.l_buf+Z.last_lit]=255&Ce,Z.last_lit++,he===0?Z.dyn_ltree[2*Ce]++:(Z.matches++,he--,Z.dyn_ltree[2*(I[Ce]+m+1)]++,Z.dyn_dtree[2*W(he)]++),Z.last_lit===Z.lit_bufsize-1},o._tr_align=function(Z){ye(Z,2,3),q(Z,w,H),function(he){he.bi_valid===16?(xe(he,he.bi_buf),he.bi_buf=0,he.bi_valid=0):8<=he.bi_valid&&(he.pending_buf[he.pending++]=255&he.bi_buf,he.bi_buf>>=8,he.bi_valid-=8)}(Z)}},{"../utils/common":41}],53:[function(r,s,o){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,s,o){(function(a){(function(l,u){if(!l.setImmediate){var c,d,y,m,g=1,v={},b=!1,S=l.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(l);x=x&&x.setTimeout?x:l,c={}.toString.call(l.process)==="[object process]"?function(_){process.nextTick(function(){E(_)})}:function(){if(l.postMessage&&!l.importScripts){var _=!0,T=l.onmessage;return l.onmessage=function(){_=!1},l.postMessage("","*"),l.onmessage=T,_}}()?(m="setImmediate$"+Math.random()+"$",l.addEventListener?l.addEventListener("message",w,!1):l.attachEvent("onmessage",w),function(_){l.postMessage(m+_,"*")}):l.MessageChannel?((y=new MessageChannel).port1.onmessage=function(_){E(_.data)},function(_){y.port2.postMessage(_)}):S&&"onreadystatechange"in S.createElement("script")?(d=S.documentElement,function(_){var T=S.createElement("script");T.onreadystatechange=function(){E(_),T.onreadystatechange=null,d.removeChild(T),T=null},d.appendChild(T)}):function(_){setTimeout(E,0,_)},x.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var T=new Array(arguments.length-1),C=0;C"u"?a===void 0?this:a:self)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jszip_min);class MXLHelper{static MXLtoIXmlElement(e){const r=new jszip_minExports;return r.loadAsync(e).then(a=>r.file("META-INF/container.xml").async("text"),a=>{throw a}).then(a=>{const c=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return r.file(c).async("text")},a=>{throw a}).then(a=>{const u=new DOMParser().parseFromString(a,"text/xml"),c=new IXmlElement(u.documentElement);return Promise.resolve(c)},a=>{throw a}).then(a=>a,a=>{throw new Error("extractSheetFromMxl: "+a.message)})}static MXLtoXMLstring(e){const r=new jszip_minExports;return r.loadAsync(e).then(s=>r.file("META-INF/container.xml").async("text"),s=>{throw loglevelExports.error(s),s}).then(s=>{const l=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return r.file(l).async("text")},s=>{throw s})}}class PlaybackNoteGenerator{calculate(e){const r=new MusicPartManagerIterator(e);for(;!r.EndReached;){const s=r.CurrentEnrolledTimestamp,o=r.CurrentAudibleVoiceEntries();for(const a of o)this.handleVoiceEntry(e,a,s);r.moveToNext()}}handleVoiceEntry(e,r,s){if(r.IsGrace)return;const o=r.ParentVoice;let a;e.PlaybackDataDict.containsKey(o)?a=e.PlaybackDataDict.getValue(o):(a=[],e.PlaybackDataDict.setValue(o,a));for(const l of r.PlaybackEntries)if(l.HasNotes){for(const c of l.Notes)c.setLength();const u=Fraction$1.plus(s,l.TimestampShift);PlaybackNoteGenerator.addEntrySorted(a,l,u)}}static addEntrySorted(e,r,s){if(e.length===0)e.push({enrolledTimestamp:s,playbackEntry:r});else for(let o=e.length-1;o>=0;o--){const a=e[o];if(s.RealValue>a.enrolledTimestamp.RealValue)if(o===e.length-1){e.push({enrolledTimestamp:s,playbackEntry:r});break}else{e.splice(o+1,0,{enrolledTimestamp:s,playbackEntry:r});break}}}}class ScreenViewingRegion{constructor(e,r,s,o){this.psi=new BoundingBox$1(void 0),this.displaySizeInPixel=e,this.RelativeDisplaySize=r,this.RelativeDisplayPosition=s,this.WidthInUnits=o}static createWithRelativeDefaults(e,r){return new ScreenViewingRegion(e,new SizeF2D(1,1),new PointF2D(0,0),r)}static createWithDefaults(){return new ScreenViewingRegion(new SizeF2D(1,1),new SizeF2D(1,1),new PointF2D(0,0),1)}get UpperLeftPositionInUnits(){return this.psi.AbsolutePosition}set UpperLeftPositionInUnits(e){this.psi.AbsolutePosition=e}get DisplaySizeInPixel(){return this.displaySizeInPixel}set DisplaySizeInPixel(e){this.displaySizeInPixel=e,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RelativeDisplaySize(){return this.relativeRegionSize}set RelativeDisplaySize(e){this.relativeRegionSize=e,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RegionSizeInPixel(){return this.regionSizeInPixel}get WidthInUnits(){return this.psi.BorderRight}set WidthInUnits(e){this.psi.BorderRight=e,this.recalculateDependentVariables()}get ViewRegionInUnits(){return new SizeF2D(this.psi.BorderRight,this.psi.BorderBottom)}isVisible(e,r){const s=this.psi.collisionDetection(e);return this.psi.liesInsideBorders(e),s}isInsideDisplayArea(e,r){return this.RelativeDisplayPosition.x<=e&&e<=this.RelativeDisplayPosition.x+this.RelativeDisplaySize.width&&this.RelativeDisplayPosition.y<=r&&r<=this.RelativeDisplayPosition.y+this.RelativeDisplaySize.height}transformToUnitCoordinates(e){return new PointF2D(this.UpperLeftPositionInUnits.x+this.ViewRegionInUnits.width*((e.x-this.RelativeDisplayPosition.x)/this.RelativeDisplaySize.width),this.UpperLeftPositionInUnits.y+this.ViewRegionInUnits.height*((e.y-this.RelativeDisplayPosition.y)/this.RelativeDisplaySize.height))}transformLengthXToUnitCoordinates(e){return e/this.horizontalUnitToPixelRatio}transformLengthYToUnitCoordinates(e){return e/this.verticalUnitToPixelRatio}recalculateDependentVariables(){const e=this.regionSizeInPixel.width/this.regionSizeInPixel.height;this.psi.BorderBottom=this.psi.BorderRight/e,this.horizontalUnitToPixelRatio=this.regionSizeInPixel.width/this.ViewRegionInUnits.width,this.verticalUnitToPixelRatio=this.regionSizeInPixel.height/this.ViewRegionInUnits.height}}class AbstractZoomView{constructor(e){this.aspectRatio=1,this.zoomViews=[],this.mouseZoomMode=!1,this.autoScrollY=!0,this.displayInteractionManager=e,this.displayInteractionManager.addListener(this),this.offsetXMin=Number.MIN_VALUE,this.offsetYMin=Number.MIN_VALUE,this.rangeXMin=1,this.rangeYMin=1,this.offsetXMax=Number.MAX_VALUE,this.offsetYMax=Number.MAX_VALUE,this.rangeXMax=1e9,this.rangeYMax=1e9,this.XScrollingEnabled=!1,this.YScrollingEnabled=!0}positionTouched(e,r){if(!this.convertToUnitsReady())return;const s=this.getPositionInUnits(e,r);this.unitPosTouched(s,e,r)}get TouchActive(){return this.displayInteractionManager.TouchActive}get TouchMoving(){return this.displayInteractionManager.TouchMoving}positionDoubleTouched(e,r){if(!this.convertToUnitsReady())return;const s=this.getPositionInUnits(e,r);this.unitPosDoubleTouched(s,e,r)}get UsesManuallyControlledZoomMode(){return this.usesManuallyControlledZoomMode}set UsesManuallyControlledZoomMode(e){this.usesManuallyControlledZoomMode=e}mouseDown(e,r,s=!1){if(!this.convertToUnitsReady())return;this.selectScrollControllerY(!1),this.lastRangeX=Math.max(1,this.RangeX),this.lastRangeY=Math.max(1,this.RangeY),this.lastOffsetX=this.OffsetX,this.lastOffsetY=this.OffsetY;const o=this.getPositionInUnits(e,r);this.unitPosTouchDown(o,e,r),this.usesManuallyControlledZoomMode||(s?this.mouseZoomMode=!0:this.mouseZoomMode=!1)}mouseUp(e,r){const s=this.getPositionInUnits(e,r);this.unitPosTouchUp(s,e,r)}mouseMove(e,r,s,o){this.mouseZoomMode?(Math.abs(s-0)>1e-8&&(this.RangeX=Math.abs(this.lastRangeX/(1+s))),!this.lockRanges&&Math.abs(o-0)>1e-8&&(this.RangeY=Math.abs(this.lastRangeY/(1-o)))):(Math.abs(s-0)>1e-8&&(this.OffsetX=this.lastOffsetX-s*this.RangeX),Math.abs(o-0)>1e-8&&(this.OffsetY=this.lastOffsetY-o*this.RangeY));const a=this.getPositionInUnits(e,r);this.unitPosMove(a,e,r)}zoom(e){this.RangeX=Math.abs(this.lastRangeX/e)}addZoomView(e){this.zoomViews.push(e)}get OffsetX(){return this.offsetX}set OffsetX(e){this.offsetX=Math.min(this.offsetXMax,Math.max(this.offsetXMin,e));for(const r of this.zoomViews)r.viewportXChanged(this.offsetX,this.RangeX)}get OffsetY(){return this.offsetY}set OffsetY(e){this.offsetY=e,this.offsetY>this.offsetYMax?this.offsetY=this.offsetYMax:this.offsetY(i[i.SingleTouch=0]="SingleTouch",i[i.DoubleTouch=1]="DoubleTouch",i[i.TouchUp=2]="TouchUp",i[i.TouchDown=3]="TouchDown",i[i.Move=4]="Move",i))(InteractionType||{});class VoiceEntryInteractionListener{constructor(e){this.renderingManager=e}userDisplayInteraction(e,r,s){var o,a;switch(s){case InteractionType.TouchDown:case InteractionType.SingleTouch:case InteractionType.DoubleTouch:{const l=this.renderingManager.GraphicalMusicSheet.GetNearestVoiceEntry(r);if(l&&l.parentStaffEntry.parentVerticalContainer!==void 0){const u=l.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;this.renderingManager.setStartPosition(u),((o=l.notes[0])==null?void 0:o.sourceNote.Pitch)!==void 0&&((a=this.renderingManager.PlaybackManager)==null||a.playVoiceEntry(l.parentVoiceEntry))}break}}}}class SheetRenderingManager extends AbstractZoomView{constructor(e,r){super(e),this.mainViewingRegion=ScreenViewingRegion.createWithDefaults(),this.tryAgainToRenderCount=0,this.yOffsetMouseDown=Number.MIN_VALUE,this.unlockCursorDistancePixel=50,this.relativeTopPosition=.06,this.internalPreviewImageScale=3,this.listeners=[],this.LockDisplayToCursor=!0,this.ZoomActive=!1,this.rules=r,this.addZoomView(this),this.lockRanges=!0,this.TopBarHeightInPixel=70,this.BottomBarHeightInPixel=0,this.rules.UseDefaultVoiceInteractionListener&&this.listeners.push(new VoiceEntryInteractionListener(this))}addListener(e){this.listeners.push(e)}get Listeners(){return this.listeners}convertToUnitsReady(){return this.graphicalMusicSheet!==void 0}unitPosTouched(e,r,s){if(!this.SingleTouchDisabled){const o=new PointF2D(r,s);this.handleUserDisplayInteraction(o,e,InteractionType.SingleTouch)}}unitPosDoubleTouched(e,r,s){if(!this.DoubleTouchDisabled){const o=new PointF2D(r,s);this.handleUserDisplayInteraction(o,e,InteractionType.DoubleTouch)}}unitPosTouchDown(e,r,s){const o=new PointF2D(r,s);this.handleUserDisplayInteraction(o,e,InteractionType.TouchDown),this.yOffsetMouseDown=e.y}unitPosTouchUp(e,r,s){const o=new PointF2D(r,s);this.handleUserDisplayInteraction(o,e,InteractionType.TouchUp),this.displayInteractionManager.WasZoomGestureActive===!1&&this.unlockFromCursorIfNecessary(e),this.yOffsetMouseDown=Number.MIN_VALUE}unitPosMove(e,r,s){const o=new PointF2D(r,s);this.handleUserDisplayInteraction(o,e,InteractionType.Move),this.unlockFromCursorIfNecessary(e)}get MainViewingRegion(){return this.mainViewingRegion}setMusicSheet(e){this.graphicalMusicSheet=e,this.adaptDisplayLimitsToSheet(),this.setYOffset(0,!0)}viewportXChanged(e,r){this.graphicalMusicSheet!==void 0&&this.horizontalViewportChanged(e,r)}viewportYChanged(e,r){this.graphicalMusicSheet!==void 0&&(this.yOffsetMouseDown<=Number.MIN_VALUE+.5&&(this.yOffsetMouseDown=e),this.verticalViewportChanged(e,r))}displaySizeChanged(e,r){super.viewSizeChanged(e,r),!(Math.abs(e-0)<1e-7||Math.abs(r-0)<1e-7)&&(this.graphicalMusicSheet!==void 0&&this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(),this.mainViewingRegion.DisplaySizeInPixel=new SizeF2D(e,r),this.adaptDisplayLimitsToSheet())}calcDisplayYPosition(e){return e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderMarginTop-this.topBarHeightInUnits()-this.relativeTopPosition*this.heightWithoutTopBottomBarsInUnits()}yPositionForLastSystem(e){return e.PositionAndShape.AbsolutePosition.y+e.PositionAndShape.BorderMarginBottom-this.topBarHeightInUnits()-(1-this.relativeTopPosition)*this.heightWithoutTopBottomBarsInUnits()}scorePositionChanged(e,r,s,o,a,l){const u=this.calcDisplayYPosition(o);this.setYPosition(u,l)}setXPosition(e,r){this.LockDisplayToCursor&&this.setXOffset(e,r)}setYPosition(e,r){this.LockDisplayToCursor&&this.setYOffset(e,r)}get DrawingParameters(){return this.musicSheetDrawer.drawingParameters}topBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.TopBarHeightInPixel)}bottomBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.BottomBarHeightInPixel)}heightWithoutTopBottomBarsInUnits(){return this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits()}activePositionToBottomBarHeight(){return(this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits())*(1-2*this.relativeTopPosition)}getClickPosition(e,r){return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(e,r))}graphicalObjectIsVisible(e){return this.mainViewingRegion.isVisible(e,!1)}adaptDisplayLimitsToSheet(){if(this.graphicalMusicSheet===void 0||this.graphicalMusicSheet.MusicPages.length===0||this.graphicalMusicSheet.MusicPages[0].MusicSystems.length===0)return;this.offsetXMin=0,this.rangeXMin=this.graphicalMusicSheet.MinAllowedSystemWidth,this.rangeXMax=300,this.offsetYMin=-.3*this.RangeY;const e=this.graphicalMusicSheet.MusicPages.last().PositionAndShape;this.offsetYMax=Math.max(0,e.BorderMarginBottom-.7*this.RangeY),this.OffsetY>this.offsetYMax&&this.setYOffset(this.offsetYMax,!0)}horizontalViewportChanged(e,r){this.mainViewingRegion.WidthInUnits!==r&&(this.mainViewingRegion.WidthInUnits=r)}verticalViewportChanged(e,r){this.mainViewingRegion.UpperLeftPositionInUnits=new PointF2D(this.mainViewingRegion.UpperLeftPositionInUnits.x,e)}unlockFromCursorIfNecessary(e){if(this.LockDisplayToCursor===!1||this.ZoomActive||this.displayInteractionManager.ZoomGestureActive||this.displayInteractionManager.WasZoomGestureActive)return;Math.abs((e.y-this.yOffsetMouseDown)*this.mainViewingRegion.RegionSizeInPixel.height/this.mainViewingRegion.ViewRegionInUnits.height)>this.unlockCursorDistancePixel&&(this.LockDisplayToCursor=!1)}getPositionInUnits(e,r){return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(e,r))}handleUserDisplayInteraction(e,r,s){switch(s){case InteractionType.TouchDown:case InteractionType.SingleTouch:case InteractionType.DoubleTouch:case InteractionType.TouchUp:case InteractionType.TouchDown:case InteractionType.Move:for(const o of this.listeners)o.userDisplayInteraction(e,r,s);break;default:throw new Error("type")}}setStartPosition(e){var r;this.graphicalMusicSheet!==void 0&&(this.graphicalMusicSheet.ParentMusicSheet.SelectionStart=e,(r=this.PlaybackManager)==null||r.reset())}get GraphicalMusicSheet(){return this.graphicalMusicSheet}}class WebSheetRenderingManager extends SheetRenderingManager{mouseMove(e,r,s,o){const a=this.getPositionInUnits(e,r);this.unitPosMove(a,e,r)}}class AbstractDisplayInteractionManager{constructor(){this.listeners=[],this.zoomGestureActive=!1,this.touchCount=0,this.touchActive=!1,this.touchMoving=!1,this.displayWidth=1,this.displayHeight=1,this.displayDpi=96,this.maxNumerOfFingers=2,this.movementThreshInch=.075,this.interactionWasZoomGesture=!1}addListener(e){this.listeners.push(e)}get ZoomGestureActive(){return this.zoomGestureActive}get WasZoomGestureActive(){return this.interactionWasZoomGesture}displaySizeChanged(e,r){this.displayWidth=e,this.displayHeight=r;for(const s of this.listeners)s.displaySizeChanged(this.displayWidth,this.displayHeight)}Dispose(){this.dispose()}Initialize(){this.initialize()}get DisplayDpi(){return this.displayDpi}get TouchActive(){return this.touchActive}get TouchMoving(){return this.touchMoving}touchDown(e,r,s){this.interactionWasZoomGesture=!1;const o=e/this.displayWidth,a=r/this.displayHeight;this.lastRelPosX=o,this.lastRelPosY=a,this.lastPixelX=e,this.lastPixelY=r,this.touchActive=!0,this.touchMoving=!1,this.touchCount=Math.min(this.touchCount+1,this.maxNumerOfFingers);for(const l of this.listeners)l.mouseDown(o,a,!s)}move(e,r){if(this.touchActive&&!this.zoomGestureActive){const s=e/this.displayWidth,o=r/this.displayHeight,a=s-this.lastRelPosX,l=o-this.lastRelPosY;this.touchMoving=!0;for(const u of this.listeners)u.mouseMove(s,o,a,l)}}zoomGestureStarted(){this.zoomGestureActive=!0}zoomGestureCompleted(){this.zoomGestureActive=!1,this.interactionWasZoomGesture=!0}zoomGestureMove(e){this.zoomGestureActive&&this.listeners.forEach(function(r){r.zoom(e)})}touchUp(e,r){this.touchActive=!1,this.touchMoving=!1,this.touchCount=Math.max(0,this.touchCount-1);const s=e/this.displayWidth,o=r/this.displayHeight;for(const a of this.listeners)a.mouseUp(s,o)}click(e,r){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,r)&&!this.ZoomGestureActive){const s=e/this.displayWidth,o=r/this.displayHeight;for(const a of this.listeners)a.positionTouched(s,o)}}doubleClick(e,r){if(!this.mouseDidMove(this.lastPixelX,e,this.lastPixelY,r)&&!this.ZoomGestureActive){const s=e/this.displayWidth,o=r/this.displayHeight;for(const a of this.listeners)a.positionDoubleTouched(s,o)}}mouseDidMove(e,r,s,o){const a=Math.abs(e-r)/this.displayDpi,l=Math.abs(s-o)/this.displayDpi;return a>this.movementThreshInch||l>this.movementThreshInch}}class WebDisplayInteractionManager extends AbstractDisplayInteractionManager{constructor(e){super(),this.fullOffsetLeft=0,this.fullOffsetTop=0,this.fullScrollTop=0,this.fullScrollLeft=0,this.parentScrollMap=new Map,this.scrollCallbackMap=new Map,this.timeout=void 0,this.resizeObserver=void 0,this.EventCallbackMap=new Dictionary,this.DOUBLE_CLICK_WINDOW=200,this.lastClick=0,this.osmdSheetMusicContainer=e,this.listenForInteractions()}get FullOffsetTop(){return this.fullOffsetTop}get FullScrollTop(){return this.fullScrollTop}get FullOffsetLeft(){return this.fullOffsetLeft}get FullScrollLeft(){return this.fullScrollLeft}static resizeCallback(e,r){clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.fullOffsetLeft=0,r.fullOffsetTop=0;let s=r.osmdSheetMusicContainer;for(;s;)r.fullOffsetLeft+=s.offsetLeft,r.fullOffsetTop+=s.offsetTop,s=s.offsetParent;r.resizeEventListener(),r.deregisterScrollOffsets(),r.registerScrollOffsets()},500)}registerScrollOffsets(){let e=this.osmdSheetMusicContainer;this.fullScrollTop=0,this.fullScrollLeft=0;const r=this;for(;e&&e!==document.documentElement;){if(this.parentScrollMap.set(e,[e.scrollTop,e.scrollLeft]),this.fullScrollLeft+=e.scrollLeft,this.fullScrollTop+=e.scrollTop,e.scrollHeight>e.clientHeight){const s=function(o){const a=r.parentScrollMap.get(this),l=a[0],u=a[1];r.fullScrollTop=r.fullScrollTop-l+this.scrollTop,r.fullScrollLeft=r.fullScrollLeft-u+this.scrollLeft,r.parentScrollMap.set(this,[this.scrollTop,this.scrollLeft])};this.scrollCallbackMap.set(e,s),e.addEventListener("scroll",s)}e=e.parentElement}}deregisterScrollOffsets(){for(const e of this.scrollCallbackMap.keys())e.removeEventListener("scroll",this.scrollCallbackMap.get(e));this.scrollCallbackMap.clear()}initialize(){this.fullOffsetLeft=0,this.fullOffsetTop=0;let e=this.osmdSheetMusicContainer;const r=[],s=this;for(window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(o=>{WebDisplayInteractionManager.resizeCallback(o,s)}));e;)this.fullOffsetLeft+=e.offsetLeft,this.fullOffsetTop+=e.offsetTop,this.resizeObserver?this.resizeObserver.observe(e):r.push(e),e=e.offsetParent;if(this.resizeObserver)this.disposeResizeListener=()=>{s.resizeObserver.disconnect(),s.resizeObserver=void 0};else{let o=()=>{WebDisplayInteractionManager.resizeCallback(r,s)};window.addEventListener("resize",o),this.disposeResizeListener=()=>{window.removeEventListener("resize",o),o=void 0}}s.registerScrollOffsets()}dispose(){this.disposeResizeListener();for(const e of this.EventCallbackMap.keys()){const r=this.EventCallbackMap.getValue(e);r[0].removeEventListener(e,r[1])}this.EventCallbackMap.clear(),this.deregisterScrollOffsets(),this.scrollCallbackMap.clear(),this.parentScrollMap.clear()}isTouch(){if("ontouchstart"in window||window.DocumentTouch)return!0;if(!window.matchMedia)return!1;const r=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join("");return window.matchMedia(r).matches}get downEventName(){return this.isTouch()?"touchstart":"mousedown"}get moveEventName(){return this.isTouch()?"touchmove":"mousemove"}listenForInteractions(){const e=this.downEventListener.bind(this),r=this.touchEndEventListener.bind(this),s=this.moveEventListener.bind(this);this.osmdSheetMusicContainer.addEventListener("mousedown",e),this.osmdSheetMusicContainer.addEventListener("touchend",r),document.addEventListener(this.moveEventName,s),this.EventCallbackMap.setValue("mousedown",[this.osmdSheetMusicContainer,e]),this.EventCallbackMap.setValue("touchend",[this.osmdSheetMusicContainer,r]),this.EventCallbackMap.setValue(this.moveEventName,[document,s])}downEventListener(e){const r=new Date().getTime(),s=r-this.lastClick;clearTimeout(this.clickTimeout);let o=0,a=0;this.isTouch()&&e instanceof TouchEvent?(o=e.touches[0].pageX,a=e.touches[0].pageY):e instanceof MouseEvent&&(o=e.pageX,a=e.pageY);const l=this.getOffsetCoordinates(o,a);if(s0)this.doubleClick(l.x,l.y);else{const u=this;this.clickTimeout=setTimeout(function(){clearTimeout(this.clickTimeout),u.isTouch()?u.touchDown(l.x,l.y,void 0):u.click(l.x,l.y)},this.DOUBLE_CLICK_WINDOW)}this.lastClick=r}moveEventListener(e){let r=0,s=0;if(this.isTouch()&&e instanceof TouchEvent){let a;e.touches&&e.touches.length>0?a=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(a=e.changedTouches[0]),r=a==null?void 0:a.clientX,s=a==null?void 0:a.clientY}else e instanceof MouseEvent&&(r=e.clientX,s=e.clientY);const o=this.getOffsetCoordinates(r,s);this.move(o.x,o.y)}touchEndEventListener(e){let r;e.touches&&e.touches.length>0?r=e.touches[0]:e.changedTouches&&e.changedTouches.length>0&&(r=e.changedTouches[0]);const s=this.getOffsetCoordinates(r==null?void 0:r.pageX,r==null?void 0:r.pageY);this.touchUp(s.x,s.y)}resizeEventListener(){this.displaySizeChanged(this.osmdSheetMusicContainer.clientWidth,this.osmdSheetMusicContainer.clientHeight)}getOffsetCoordinates(e,r){const s=e-this.fullOffsetLeft+this.fullScrollLeft,o=r-this.fullOffsetTop+this.fullScrollTop;return new PointF2D(s,o)}}class DynamicsCalculator{static fillDynamicsList(e,r,s){for(let o=0;o=0&&s[c].push(new DynamicsContainer(u.InstantaneousDynamic,c))}if(u.StartingContinuousDynamic!==void 0){s[o].push(new DynamicsContainer(u.StartingContinuousDynamic,u.StaffNumber));const c=this.getOtherStaffIndexIfLinkedStavesAreDetected(e,o,u.StartingContinuousDynamic.Placement);c>=0&&s[c].push(new DynamicsContainer(u.StartingContinuousDynamic,c))}}}}static getOtherStaffIndexIfLinkedStavesAreDetected(e,r,s){const o=e.getStaffFromIndex(r),a=o.ParentInstrument.Staves.indexOf(o),l=o.ParentInstrument.Staves.length;return l>1&&a===0&&s===PlacementEnum.Below?r+1:l>1&&a===1&&s===PlacementEnum.Above?r-1:-1}static fillDynamicExpressions(e){const r=e.DynListStaves,s=e.getCompleteNumberOfStaves(),o=e.TimestampSortedDynamicExpressionsList;for(let a=0;a{e(this.processStringXml(s))},s=>{loglevelExports.error(new Error("[OSMD] Invalid MXL file: "+s)),r(new Error("[OSMD] Invalid MXL file: "+s))})}processStringXml(i){const e=new DOMParser;if(i.substr(0,3)==="")return loglevelExports.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+i),e.parseFromString(i.substr(3),"application/xml");if(i.substr(0,6).includes("{r.isMxl(m)?r.processMxl(m,u,c):u(r.processStringXml(m))},m=>{throw c(m),m});else{const m=new Error("[OSMD] osmd.load(string): Could not process string. Did not find {e.init(this.sheet.MusicPartManager,this.graphic)}),this.drawingParameters.DrawingParametersEnum===DrawingParametersEnum.leadsheet&&(this.graphic.LeadSheet=!0),this.renderingManager.setMusicSheet(this.graphic),this.interactionManager.Initialize()}render(){var e;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");(e=this.drawer)==null||e.clear();let i=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(i=this.rules.SheetMaximumWidth),this.sheet.pageWidth=i/this.zoom/10,this.renderingManager.MainViewingRegion.WidthInUnits=this.sheet.pageWidth,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,loglevelExports.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(loglevelExports.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom);for(const r of this.sheet.SourceMeasures)r.WasRendered=!1;this.drawer.drawSheet(this.graphic),this.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(r=>{r.update()}),this.zoomUpdated=!1,this.interactionManager.displaySizeChanged(this.container.clientWidth,this.container.clientHeight),this.rules.RenderCount++}createOrRefreshRenderBackend(){if(this.drawer&&this.drawer.Backends){this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container);for(const s of this.drawer.Backends)s.free();this.drawer.Backends.clear()}this.drawingParameters.Rules=this.rules,this.drawer=new VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let i=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(i=(this.EngravingRules.PageLeftMargin+this.graphic.MusicPages[0].PositionAndShape.Size.width+this.EngravingRules.PageRightMargin)*10*this.zoom);let e;const r=32767;for(const s of this.graphic.MusicPages){if(s.PageNumber>this.rules.MaxPageToDrawNumber)break;const o=this.createBackend(this.backendType,s),a=" exceeds CanvasBackend limit of 32767. Cutting off score.";o.getOSMDBackendType()===BackendType.Canvas&&i>r&&(loglevelExports.warn("[OSMD] Warning: width of "+i+a),i=r),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?e=i/this.rules.PageFormat.aspectRatio:(e=s.PositionAndShape.Size.height,e+=this.rules.PageBottomMargin,o.getOSMDBackendType()===BackendType.Canvas&&(e+=.1),e+=s.PositionAndShape.BorderTop,this.rules.RenderTitle&&(e+=this.rules.TitleTopDistance),e*=this.zoom*10),o.getOSMDBackendType()===BackendType.Canvas&&e>r&&(loglevelExports.warn("[OSMD] Warning: height of "+e+a),e=Math.min(e,r)),o.resize(i,e),o.clear(),o.getContext().setFillStyle(this.rules.DefaultColorMusic),o.getContext().setStrokeStyle(this.rules.DefaultColorMusic),this.drawer.Backends.push(o),this.graphic.drawer=this.drawer}}exportSVG(){var i;for(const e of(i=this.drawer)==null?void 0:i.Backends)e instanceof SvgVexFlowBackend&&e.export()}IsReadyToRender(){return this.graphic!==void 0}clear(){var i;(i=this.drawer)==null||i.clear(),this.reset()}dispose(){this.disposeResizeListener&&this.disposeResizeListener(),this.InteractionManager&&this.InteractionManager.Dispose()}setOptions(i){if(this.rules||(this.rules=new EngravingRules),!this.drawingParameters&&!i.drawingParameters?this.drawingParameters=new DrawingParameters(DrawingParametersEnum.default,this.rules):i.drawingParameters&&(this.drawingParameters?this.drawingParameters.DrawingParametersEnum=DrawingParametersEnum[i.drawingParameters.toLowerCase()]:this.drawingParameters=new DrawingParameters(DrawingParametersEnum[i.drawingParameters],this.rules)),i==null){loglevelExports.warn(`warning: osmd.setOptions() called without an options parameter, has no effect. example usage: osmd.setOptions({drawCredits: false, drawPartNames: false})`);return}this.OnXMLRead=function(o){return o},i.onXMLRead&&(this.OnXMLRead=i.onXMLRead);let r=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(i.backend!==void 0){const o=OSMDOptions.BackendTypeFromString(i.backend);r=r||this.backendType!==o,this.backendType=o}this.needBackendUpdate=r,i.autoBeam!==void 0&&(this.rules.AutoBeamNotes=i.autoBeam);const s=i.autoBeamOptions;if(s&&(s.maintain_stem_directions===void 0&&(s.maintain_stem_directions=!1),this.rules.AutoBeamOptions=s,s.groups&&s.groups.length)){for(const o of s.groups)if(o.length!==2)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}i.percussionOneLineCutoff!==void 0&&(this.rules.PercussionOneLineCutoff=i.percussionOneLineCutoff),this.rules.PercussionOneLineCutoff!==0&&i.percussionForceVoicesOneLineCutoff!==void 0&&(this.rules.PercussionForceVoicesOneLineCutoff=i.percussionForceVoicesOneLineCutoff),i.alignRests!==void 0&&(this.rules.AlignRests=i.alignRests),i.coloringMode!==void 0&&this.setColoringMode(i),i.coloringEnabled!==void 0&&(this.rules.ColoringEnabled=i.coloringEnabled),i.colorStemsLikeNoteheads!==void 0&&(this.rules.ColorStemsLikeNoteheads=i.colorStemsLikeNoteheads),i.disableCursor&&(this.drawingParameters.drawCursors=!1),i.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),i.drawCredits!==void 0&&(this.drawingParameters.DrawCredits=i.drawCredits),i.drawComposer!==void 0&&(this.drawingParameters.DrawComposer=i.drawComposer),i.drawTitle!==void 0&&(this.drawingParameters.DrawTitle=i.drawTitle),i.drawSubtitle!==void 0&&(this.drawingParameters.DrawSubtitle=i.drawSubtitle),i.drawLyricist!==void 0&&(this.drawingParameters.DrawLyricist=i.drawLyricist),i.drawMetronomeMarks!==void 0&&(this.rules.MetronomeMarksDrawn=i.drawMetronomeMarks),i.drawPartNames!==void 0&&(this.drawingParameters.DrawPartNames=i.drawPartNames,i.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=i.drawPartNames)),i.drawPartAbbreviations!==void 0&&(this.rules.RenderPartAbbreviations=i.drawPartAbbreviations),i.drawFingerings===!1&&(this.rules.RenderFingerings=!1),i.drawMeasureNumbers!==void 0&&(this.rules.RenderMeasureNumbers=i.drawMeasureNumbers),i.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=i.drawMeasureNumbersOnlyAtSystemStart),i.drawLyrics!==void 0&&(this.rules.RenderLyrics=i.drawLyrics),i.drawTimeSignatures!==void 0&&(this.rules.RenderTimeSignatures=i.drawTimeSignatures),i.drawSlurs!==void 0&&(this.rules.RenderSlurs=i.drawSlurs),i.measureNumberInterval!==void 0&&(this.rules.MeasureNumberLabelOffset=i.measureNumberInterval),i.useXMLMeasureNumbers!==void 0&&(this.rules.UseXMLMeasureNumbers=i.useXMLMeasureNumbers),i.fingeringPosition!==void 0&&(this.rules.FingeringPosition=AbstractExpression.PlacementEnumFromString(i.fingeringPosition)),i.fingeringInsideStafflines!==void 0&&(this.rules.FingeringInsideStafflines=i.fingeringInsideStafflines),i.newSystemFromXML!==void 0&&(this.rules.NewSystemAtXMLNewSystemAttribute=i.newSystemFromXML),i.newSystemFromNewPageInXML!==void 0&&(this.rules.NewSystemAtXMLNewPageAttribute=i.newSystemFromNewPageInXML),i.newPageFromXML!==void 0&&(this.rules.NewPageAtXMLNewPageAttribute=i.newPageFromXML),i.fillEmptyMeasuresWithWholeRest!==void 0&&(this.rules.FillEmptyMeasuresWithWholeRest=i.fillEmptyMeasuresWithWholeRest),i.followCursor!==void 0&&(this.FollowCursor=i.followCursor),i.setWantedStemDirectionByXml!==void 0&&(this.rules.SetWantedStemDirectionByXml=i.setWantedStemDirectionByXml),i.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):i.darkMode===!1&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),i.defaultColorMusic&&this.rules.applyDefaultColorMusic(i.defaultColorMusic),i.defaultColorNotehead&&(this.rules.DefaultColorNotehead=i.defaultColorNotehead),i.defaultColorRest&&(this.rules.DefaultColorRest=i.defaultColorRest),i.defaultColorStem&&(this.rules.DefaultColorStem=i.defaultColorStem),i.defaultColorLabel&&(this.rules.DefaultColorLabel=i.defaultColorLabel),i.defaultColorTitle&&(this.rules.DefaultColorTitle=i.defaultColorTitle),i.defaultFontFamily&&(this.rules.DefaultFontFamily=i.defaultFontFamily),i.defaultFontStyle&&(this.rules.DefaultFontStyle=i.defaultFontStyle),i.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=i.drawUpToMeasureNumber-1),i.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=i.drawFromMeasureNumber-1),i.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=i.drawUpToPageNumber),i.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=i.drawUpToSystemNumber),i.tupletsRatioed&&(this.rules.TupletsRatioed=!0),i.tupletsBracketed&&(this.rules.TupletsBracketed=!0),i.tripletsBracketed&&(this.rules.TripletsBracketed=!0),i.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):i.autoResize===!1&&(this.autoResizeEnabled=!1),i.pageFormat!==void 0&&this.setPageFormat(i.pageFormat),i.pageBackgroundColor!==void 0&&(this.rules.PageBackgroundColor=i.pageBackgroundColor),i.performanceMode!==void 0&&(this.rules.PerformanceMode=i.performanceMode),i.renderSingleHorizontalStaffline!==void 0&&(this.rules.RenderSingleHorizontalStaffline=i.renderSingleHorizontalStaffline),i.spacingFactorSoftmax!==void 0&&(this.rules.SoftmaxFactorVexFlow=i.spacingFactorSoftmax),i.spacingBetweenTextLines!==void 0&&(this.rules.SpacingBetweenTextLines=i.spacingBetweenTextLines),i.stretchLastSystemLine!==void 0&&(this.rules.StretchLastSystemLine=i.stretchLastSystemLine),i.autoGenerateMultipleRestMeasuresFromRestMeasures!==void 0&&(this.rules.AutoGenerateMultipleRestMeasuresFromRestMeasures=i.autoGenerateMultipleRestMeasuresFromRestMeasures),i.cursorsOptions!==void 0?this.cursorsOptions=i.cursorsOptions:this.cursorsOptions=[{type:CursorType.Standard,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}],i.preferredSkyBottomLineBatchCalculatorBackend!==void 0&&(this.rules.PreferredSkyBottomLineBatchCalculatorBackend=i.preferredSkyBottomLineBatchCalculatorBackend),i.skyBottomLineBatchMinMeasures!==void 0&&(this.rules.SkyBottomLineBatchMinMeasures=i.skyBottomLineBatchMinMeasures)}setColoringMode(i){if(i.coloringMode===ColoringModes.XML){this.rules.ColoringMode=ColoringModes.XML;return}const e=[NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B];let r;if(i.coloringMode===ColoringModes.CustomColorSet){if(!i.coloringSetCustom||i.coloringSetCustom.length!==8)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter (array) with 8 strings (C to B, rest note).");for(const o of i.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(o))throw new Error(`One of the color strings in options.coloringSetCustom was not a valid HTML Hex color: `+o);r=i.coloringSetCustom}else if(i.coloringMode===ColoringModes.AutoColoring){r=[];const o=Object.keys(AutoColorSet);for(let a=0;a{i.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1,this.rules.RenderCount=0}autoResize(){const i=this;this.handleResize(()=>{},()=>{var e;((e=this.graphic)==null?void 0:e.GetCalculator)instanceof VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),i.IsReadyToRender()&&i.render()})}handleResize(i,e){let r,s;const a=this;function l(){a.AutoResizeEnabled&&(r=new Date().getTime(),s||(i(),r=new Date().getTime(),s=window.setTimeout(u,200)))}function u(){s=void 0,window.clearTimeout(s),new Date().getTime()-r<200?s=window.setTimeout(u,200):e()}window.attachEvent?window.attachEvent("onresize",l):window.addEventListener("resize",l),this.disposeResizeListener=()=>{window.detachEvent?window.detachEvent("onresize",l):window.removeEventListener("resize",l),this.resizeHandlerAttached=!1},this.resizeHandlerAttached=!0,window.setTimeout(i,0),window.setTimeout(e,1)}enableOrDisableCursors(i){var e,r,s,o,a,l,u,c,d;if(this.drawingParameters.drawCursors=i,i){for(let y=0;y{y.hide()})}createBackend(i,e){let r;return i===void 0||i===BackendType.SVG?r=new SvgVexFlowBackend(this.rules):r=new CanvasVexFlowBackend(this.rules),r.graphicalMusicPage=e,r.initialize(this.container,this.zoom),r}static StringToPageFormat(i){let e=PageFormat.UndefinedPageFormat;if(i.match("^[0-9]+x[0-9]+$")){const r=i.split("x"),s=Number.parseInt(r[0],10),o=Number.parseInt(r[1],10);s>0&&s<32768&&o>0&&o<32768&&(e=new PageFormat(s,o,`customPageFormat${i}`))}return i=i.replace(" ","_"),i=i.replace("Landscape","L"),i=i.replace("Portrait","P"),_OpenSheetMusicDisplay.PageFormatStandards.hasOwnProperty(i)&&(e=_OpenSheetMusicDisplay.PageFormatStandards[i]),e}setPageFormat(i){const e=_OpenSheetMusicDisplay.StringToPageFormat(i);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(i,e){if(i>0&&e>0){const r=new PageFormat(i,e);this.rules.PageFormat=r}}set DrawSkyLine(i){this.drawSkyLine=i,this.drawer&&(this.drawer.skyLineVisible=i)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(i){this.drawBottomLine=i,this.drawer&&(this.drawer.bottomLineVisible=i)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(i){this.setDrawBoundingBox(i,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(i,e=!1){this.drawBoundingBox=i,this.drawer&&(this.drawer.drawableBoundingBoxElement=i),e&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(i){this.autoResizeEnabled=i}get Zoom(){return this.zoom}set Zoom(i){var e;this.zoom=i,this.zoomUpdated=!0,((e=this.graphic)==null?void 0:e.GetCalculator)instanceof VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(i){this.followCursor=i}get FollowCursor(){return this.followCursor}set TransposeCalculator(i){MusicSheetCalculator.transposeCalculator=i}get TransposeCalculator(){return MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get InteractionManager(){return this.interactionManager}get Version(){return this.version}};let OpenSheetMusicDisplay=_OpenSheetMusicDisplay;OpenSheetMusicDisplay.PageFormatStandards={A3_L:new PageFormat(420,297,"A3_L"),A3_P:new PageFormat(297,420,"A3_P"),A4_L:new PageFormat(297,210,"A4_L"),A4_P:new PageFormat(210,297,"A4_P"),A5_L:new PageFormat(210,148,"A5_L"),A5_P:new PageFormat(148,210,"A5_P"),A6_L:new PageFormat(148,105,"A6_L"),A6_P:new PageFormat(105,148,"A6_P"),Endless:PageFormat.UndefinedPageFormat,Letter_L:new PageFormat(279.4,215.9,"Letter_L"),Letter_P:new PageFormat(215.9,279.4,"Letter_P")};var handlebarsExports={},handlebars={get exports(){return handlebarsExports},set exports(i){handlebarsExports=i}},handlebars_runtimeExports={},handlebars_runtime={get exports(){return handlebars_runtimeExports},set exports(i){handlebars_runtimeExports=i}},base$1={},utils={};utils.__esModule=!0;utils.extend=extend;utils.indexOf=indexOf;utils.escapeExpression=escapeExpression;utils.isEmpty=isEmpty;utils.createFrame=createFrame;utils.blockParams=blockParams;utils.appendContextPath=appendContextPath;var escape$1={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},badChars=/[&<>"'`=]/g,possible=/[&<>"'`=]/;function escapeChar(i){return escape$1[i]}function extend(i){for(var e=1;e0?(a.ids&&(a.ids=[a.name]),s.helpers.each(o,a)):l(this);if(a.data&&a.ids){var c=r.createFrame(a.data);c.contextPath=r.appendContextPath(a.data.contextPath,a.name),a={data:c}}return u(o,a)})},i.exports=e.default})(blockHelperMissing,blockHelperMissingExports);var eachExports={},each={get exports(){return eachExports},set exports(i){eachExports=i}};(function(i,e){e.__esModule=!0;function r(l){return l&&l.__esModule?l:{default:l}}var s=utils,o=exceptionExports,a=r(o);e.default=function(l){l.registerHelper("each",function(u,c){if(!c)throw new a.default("Must pass iterator to #each");var d=c.fn,y=c.inverse,m=0,g="",v=void 0,b=void 0;c.data&&c.ids&&(b=s.appendContextPath(c.data.contextPath,c.ids[0])+"."),s.isFunction(u)&&(u=u.call(this)),c.data&&(v=s.createFrame(c.data));function S(_,T,C){v&&(v.key=_,v.index=T,v.first=T===0,v.last=!!C,b&&(v.contextPath=b+_)),g=g+d(u[_],{data:v,blockParams:s.blockParams([u[_],_],[b+_,null])})}if(u&&typeof u=="object")if(s.isArray(u))for(var x=u.length;m=0?a=l:a=parseInt(a,10)}return a},log:function(a){if(a=s.lookupLevel(a),typeof console<"u"&&s.lookupLevel(s.level)<=a){var l=s.methodMap[a];console[l]||(l="log");for(var u=arguments.length,c=Array(u>1?u-1:0),d=1;d= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};base$1.REVISION_CHANGES=REVISION_CHANGES;var objectType="[object Object]";function HandlebarsEnvironment(i,e,r){this.helpers=i||{},this.partials=e||{},this.decorators=r||{},_helpers$2.registerDefaultHelpers(this),_decorators.registerDefaultDecorators(this)}HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:_logger2.default,log:_logger2.default.log,registerHelper:function i(e,r){if(_utils$3.toString.call(e)===objectType){if(r)throw new _exception2$3.default("Arg not supported with multiple helpers");_utils$3.extend(this.helpers,e)}else this.helpers[e]=r},unregisterHelper:function i(e){delete this.helpers[e]},registerPartial:function i(e,r){if(_utils$3.toString.call(e)===objectType)_utils$3.extend(this.partials,e);else{if(typeof r>"u")throw new _exception2$3.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=r}},unregisterPartial:function i(e){delete this.partials[e]},registerDecorator:function i(e,r){if(_utils$3.toString.call(e)===objectType){if(r)throw new _exception2$3.default("Arg not supported with multiple decorators");_utils$3.extend(this.decorators,e)}else this.decorators[e]=r},unregisterDecorator:function i(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function i(){_internalProtoAccess$1.resetLoggedProperties()}};var log=_logger2.default.log;base$1.log=log;base$1.createFrame=_utils$3.createFrame;base$1.logger=_logger2.default;var safeStringExports={},safeString={get exports(){return safeStringExports},set exports(i){safeStringExports=i}};(function(i,e){e.__esModule=!0;function r(s){this.string=s}r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},e.default=r,i.exports=e.default})(safeString,safeStringExports);var runtime={},wrapHelper$1={};wrapHelper$1.__esModule=!0;wrapHelper$1.wrapHelper=wrapHelper;function wrapHelper(i,e){if(typeof i!="function")return i;var r=function(){var o=arguments[arguments.length-1];return arguments[arguments.length-1]=e(o),i.apply(this,arguments)};return r}runtime.__esModule=!0;runtime.checkRevision=checkRevision;runtime.template=template;runtime.wrapProgram=wrapProgram;runtime.resolvePartial=resolvePartial;runtime.invokePartial=invokePartial;runtime.noop=noop;function _interopRequireDefault$3(i){return i&&i.__esModule?i:{default:i}}function _interopRequireWildcard$1(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e.default=i,e}var _utils$2=utils,Utils=_interopRequireWildcard$1(_utils$2),_exception$2=exceptionExports,_exception2$2=_interopRequireDefault$3(_exception$2),_base=base$1,_helpers$1=helpers$1,_internalWrapHelper=wrapHelper$1,_internalProtoAccess=protoAccess;function checkRevision(i){var e=i&&i[0]||1,r=_base.COMPILER_REVISION;if(!(e>=_base.LAST_COMPATIBLE_COMPILER_REVISION&&e<=_base.COMPILER_REVISION))if(e<_base.LAST_COMPATIBLE_COMPILER_REVISION){var s=_base.REVISION_CHANGES[r],o=_base.REVISION_CHANGES[e];throw new _exception2$2.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+o+").")}else throw new _exception2$2.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+i[1]+").")}function template(i,e){if(!e)throw new _exception2$2.default("No environment passed to template");if(!i||!i.main)throw new _exception2$2.default("Unknown template object: "+typeof i);i.main.decorator=i.main_d,e.VM.checkRevision(i.compiler);var r=i.compiler&&i.compiler[0]===7;function s(l,u,c){c.hash&&(u=Utils.extend({},u,c.hash),c.ids&&(c.ids[0]=!0)),l=e.VM.resolvePartial.call(this,l,u,c);var d=Utils.extend({},c,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),y=e.VM.invokePartial.call(this,l,u,d);if(y==null&&e.compile&&(c.partials[c.name]=e.compile(l,i.compilerOptions,e),y=c.partials[c.name](u,d)),y!=null){if(c.indent){for(var m=y.split(` `),g=0,v=m.length;g"u"&&(this.lexer.yylloc={});var x=this.lexer.yylloc;m.push(x);var A=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function E(){var F;return F=c.lexer.lex()||1,typeof F!="number"&&(F=c.symbols_[F]||F),F}for(var w,_,T,C,P={},k,M,R,H;;){if(_=d[d.length-1],this.defaultActions[_]?T=this.defaultActions[_]:((w===null||typeof w>"u")&&(w=E()),T=g[_]&&g[_][w]),typeof T>"u"||!T.length||!T[0]){var B="";{H=[];for(k in g[_])this.terminals_[k]&&k>2&&H.push("'"+this.terminals_[k]+"'");this.lexer.showPosition?B="Parse error on line "+(b+1)+`: `+this.lexer.showPosition()+` Expecting `+H.join(", ")+", got '"+(this.terminals_[w]||w)+"'":B="Parse error on line "+(b+1)+": Unexpected "+(w==1?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(B,{text:this.lexer.match,token:this.terminals_[w]||w,line:this.lexer.yylineno,loc:x,expected:H})}}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+w);switch(T[0]){case 1:d.push(w),y.push(this.lexer.yytext),m.push(this.lexer.yylloc),d.push(T[1]),w=null,S=this.lexer.yyleng,v=this.lexer.yytext,b=this.lexer.yylineno,x=this.lexer.yylloc;break;case 2:if(M=this.productions_[T[1]][1],P.$=y[y.length-M],P._$={first_line:m[m.length-(M||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(M||1)].first_column,last_column:m[m.length-1].last_column},A&&(P._$.range=[m[m.length-(M||1)].range[0],m[m.length-1].range[1]]),C=this.performAction.call(P,v,S,b,this.yy,T[1],y,m),typeof C<"u")return C;M&&(d=d.slice(0,-1*M*2),y=y.slice(0,-1*M),m=m.slice(0,-1*M)),d.push(this.productions_[T[1]][0]),y.push(P.$),m.push(P._$),R=g[d[d.length-2]][d[d.length-1]],d.push(R);break;case 3:return!0}}return!0}},o=function(){var l={EOF:1,parseError:function(c,d){if(this.yy.parser)this.yy.parser.parseError(c,d);else throw new Error(c)},setInput:function(c){return this._input=c,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var d=c.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},unput:function(c){var d=c.length,y=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d-1),this.offset-=d;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1&&(this.yylineno-=y.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===m.length?this.yylloc.first_column:0)+m[m.length-y.length].length-y[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-d]),this},more:function(){return this._more=!0,this},less:function(c){this.unput(this.match.slice(c))},pastInput:function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var c=this.pastInput(),d=new Array(c.length+1).join("-");return c+this.upcomingInput()+` `+d+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,d,y,m,g;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),b=0;bd[0].length)&&(d=y,m=b,!this.options.flex)));b++);return d?(g=d[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],c=this.performAction.call(this,this.yy,this,v[m],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var c=this.next();return typeof c<"u"?c:this.lex()},begin:function(c){this.conditionStack.push(c)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(c){this.begin(c)}};return l.options={},l.performAction=function(c,d,y,m){function g(v,b){return d.yytext=d.yytext.substring(v,d.yyleng-b+v)}switch(y){case 0:if(d.yytext.slice(-2)==="\\\\"?(g(0,1),this.begin("mu")):d.yytext.slice(-1)==="\\"?(g(0,1),this.begin("emu")):this.begin("mu"),d.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(g(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(d.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return d.yytext=g(1,2).replace(/\\"/g,'"'),80;case 32:return d.yytext=g(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return d.yytext=d.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},l.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],l.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},l}();s.lexer=o;function a(){this.yy={}}return a.prototype=s,s.Parser=a,new a}();e.default=r,i.exports=e.default})(parser$1,parserExports);var whitespaceControlExports={},whitespaceControl={get exports(){return whitespaceControlExports},set exports(i){whitespaceControlExports=i}},visitorExports={},visitor={get exports(){return visitorExports},set exports(i){visitorExports=i}};(function(i,e){e.__esModule=!0;function r(d){return d&&d.__esModule?d:{default:d}}var s=exceptionExports,o=r(s);function a(){this.parents=[]}a.prototype={constructor:a,mutating:!1,acceptKey:function(y,m){var g=this.accept(y[m]);if(this.mutating){if(g&&!a.prototype[g.type])throw new o.default('Unexpected node type "'+g.type+'" found when accepting '+m+" on "+y.type);y[m]=g}},acceptRequired:function(y,m){if(this.acceptKey(y,m),!y[m])throw new o.default(y.type+" requires "+m)},acceptArray:function(y){for(var m=0,g=y.length;m0)throw new _exception2$1.default("Invalid path: "+s,{loc:r});c===".."&&a++}else o.push(c)}return{type:"PathExpression",data:i,depth:a,parts:o,original:s,loc:r}}function prepareMustache(i,e,r,s,o,a){var l=s.charAt(3)||s.charAt(2),u=l!=="{"&&l!=="&",c=/\*/.test(s);return{type:c?"Decorator":"MustacheStatement",path:i,params:e,hash:r,escaped:u,strip:o,loc:this.locInfo(a)}}function prepareRawBlock(i,e,r,s){validateClose(i,r),s=this.locInfo(s);var o={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:i.path,params:i.params,hash:i.hash,program:o,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}}function prepareBlock(i,e,r,s,o,a){s&&s.path&&validateClose(i,s);var l=/\*/.test(i.open);e.blockParams=i.blockParams;var u=void 0,c=void 0;if(r){if(l)throw new _exception2$1.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=s.strip),c=r.strip,u=r.program}return o&&(o=u,u=e,e=o),{type:l?"DecoratorBlock":"BlockStatement",path:i.path,params:i.params,hash:i.hash,program:e,inverse:u,openStrip:i.strip,inverseStrip:c,closeStrip:s&&s.strip,loc:this.locInfo(a)}}function prepareProgram(i,e){if(!e&&i.length){var r=i[0].loc,s=i[i.length-1].loc;r&&s&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:i,strip:{},loc:e}}function preparePartialBlock(i,e,r,s){return validateClose(i,r),{type:"PartialBlockStatement",name:i.path,params:i.params,hash:i.hash,program:e,openStrip:i.strip,closeStrip:r&&r.strip,loc:this.locInfo(s)}}base.__esModule=!0;base.parseWithoutProcessing=parseWithoutProcessing;base.parse=parse$2;function _interopRequireWildcard(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e.default=i,e}function _interopRequireDefault$1(i){return i&&i.__esModule?i:{default:i}}var _parser=parserExports,_parser2=_interopRequireDefault$1(_parser),_whitespaceControl=whitespaceControlExports,_whitespaceControl2=_interopRequireDefault$1(_whitespaceControl),_helpers=helpers,Helpers=_interopRequireWildcard(_helpers),_utils$1=utils;base.parser=_parser2.default;var yy={};_utils$1.extend(yy,Helpers);function parseWithoutProcessing(i,e){if(i.type==="Program")return i;_parser2.default.yy=yy,yy.locInfo=function(s){return new yy.SourceLocation(e&&e.srcName,s)};var r=_parser2.default.parse(i);return r}function parse$2(i,e){var r=parseWithoutProcessing(i,e),s=new _whitespaceControl2.default(e);return s.accept(r)}var compiler={};compiler.__esModule=!0;compiler.Compiler=Compiler;compiler.precompile=precompile;compiler.compile=compile;function _interopRequireDefault(i){return i&&i.__esModule?i:{default:i}}var _exception=exceptionExports,_exception2=_interopRequireDefault(_exception),_utils=utils,_ast=astExports,_ast2=_interopRequireDefault(_ast),slice=[].slice;function Compiler(){}Compiler.prototype={compiler:Compiler,equals:function i(e){var r=this.opcodes.length;if(e.opcodes.length!==r)return!1;for(var s=0;s1)throw new _exception2.default("Unsupported number of partial arguments: "+s.length,e);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var o=e.name.original,a=e.name.type==="SubExpression";a&&this.accept(e.name),this.setupFullMustacheParams(e,r,void 0,!0);var l=e.indent||"";this.options.preventIndent&&l&&(this.opcode("appendContent",l),l=""),this.opcode("invokePartial",a,o,l),this.opcode("append")},PartialBlockStatement:function i(e){this.PartialStatement(e)},MustacheStatement:function i(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function i(e){this.DecoratorBlock(e)},ContentStatement:function i(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function i(){},SubExpression:function i(e){transformLiteralToPath(e);var r=this.classifySexpr(e);r==="simple"?this.simpleSexpr(e):r==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function i(e,r,s){var o=e.path,a=o.parts[0],l=r!=null||s!=null;this.opcode("getContext",o.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",s),o.strict=!0,this.accept(o),this.opcode("invokeAmbiguous",a,l)},simpleSexpr:function i(e){var r=e.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function i(e,r,s){var o=this.setupFullMustacheParams(e,r,s),a=e.path,l=a.parts[0];if(this.options.knownHelpers[l])this.opcode("invokeKnownHelper",o.length,l);else{if(this.options.knownHelpersOnly)throw new _exception2.default("You specified knownHelpersOnly, but used the unknown helper "+l,e);a.strict=!0,a.falsy=!0,this.accept(a),this.opcode("invokeHelper",o.length,a.original,_ast2.default.helpers.simpleId(a))}},PathExpression:function i(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var r=e.parts[0],s=_ast2.default.helpers.scopedId(e),o=!e.depth&&!s&&this.blockParamIndex(r);o?this.opcode("lookupBlockParam",o,e.parts):r?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,s):this.opcode("pushContext")},StringLiteral:function i(e){this.opcode("pushString",e.value)},NumberLiteral:function i(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function i(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function i(){this.opcode("pushLiteral","undefined")},NullLiteral:function i(){this.opcode("pushLiteral","null")},Hash:function i(e){var r=e.pairs,s=0,o=r.length;for(this.opcode("pushHash");s=0)return[r,a]}}};function precompile(i,e,r){if(i==null||typeof i!="string"&&i.type!=="Program")throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+i);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var s=r.parse(i,e),o=new r.Compiler().compile(s,e);return new r.JavaScriptCompiler().compile(o,e)}function compile(i,e,r){if(e===void 0&&(e={}),i==null||typeof i!="string"&&i.type!=="Program")throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+i);e=_utils.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var s=void 0;function o(){var l=r.parse(i,e),u=new r.Compiler().compile(l,e),c=new r.JavaScriptCompiler().compile(u,e,void 0,!0);return r.template(c)}function a(l,u){return s||(s=o()),s.call(this,l,u)}return a._setup=function(l){return s||(s=o()),s._setup(l)},a._child=function(l,u,c,d){return s||(s=o()),s._child(l,u,c,d)},a}function argEquals(i,e){if(i===e)return!0;if(_utils.isArray(i)&&_utils.isArray(e)&&i.length===e.length){for(var r=0;r>1;return c?-d:d}return base64Vlq.encode=function(c){var d="",y,m=a(c);do y=m&s,m>>>=e,m>0&&(y|=o),d+=i.encode(y);while(m>0);return d},base64Vlq.decode=function(c,d,y){var m=c.length,g=0,v=0,b,S;do{if(d>=m)throw new Error("Expected more digits in base 64 VLQ value.");if(S=i.decode(c.charCodeAt(d++)),S===-1)throw new Error("Invalid base64 digit: "+c.charAt(d-1));b=!!(S&o),S&=s,g=g+(S<=0;H--)M=k[H],M==="."?k.splice(H,1):M===".."?R++:R>0&&(M===""?(k.splice(H+1,R),R=0):(k.splice(H,2),R--));return T=k.join("/"),T===""&&(T=P?"/":"."),C?(C.path=T,a(C)):T}i.normalize=l;function u(_,T){_===""&&(_="."),T===""&&(T=".");var C=o(T),P=o(_);if(P&&(_=P.path||"/"),C&&!C.scheme)return P&&(C.scheme=P.scheme),a(C);if(C||T.match(s))return T;if(P&&!P.host&&!P.path)return P.host=T,a(P);var k=T.charAt(0)==="/"?T:l(_.replace(/\/+$/,"")+"/"+T);return P?(P.path=k,a(P)):k}i.join=u,i.isAbsolute=function(_){return _.charAt(0)==="/"||r.test(_)};function c(_,T){_===""&&(_="."),_=_.replace(/\/$/,"");for(var C=0;T.indexOf(_+"/")!==0;){var P=_.lastIndexOf("/");if(P<0||(_=_.slice(0,P),_.match(/^([^\/]+:\/)?\/*$/)))return T;++C}return Array(C+1).join("../")+T.substr(_.length+1)}i.relative=c;var d=function(){var _=Object.create(null);return!("__proto__"in _)}();function y(_){return _}function m(_){return v(_)?"$"+_:_}i.toSetString=d?y:m;function g(_){return v(_)?_.slice(1):_}i.fromSetString=d?y:g;function v(_){if(!_)return!1;var T=_.length;if(T<9||_.charCodeAt(T-1)!==95||_.charCodeAt(T-2)!==95||_.charCodeAt(T-3)!==111||_.charCodeAt(T-4)!==116||_.charCodeAt(T-5)!==111||_.charCodeAt(T-6)!==114||_.charCodeAt(T-7)!==112||_.charCodeAt(T-8)!==95||_.charCodeAt(T-9)!==95)return!1;for(var C=T-10;C>=0;C--)if(_.charCodeAt(C)!==36)return!1;return!0}function b(_,T,C){var P=x(_.source,T.source);return P!==0||(P=_.originalLine-T.originalLine,P!==0)||(P=_.originalColumn-T.originalColumn,P!==0||C)||(P=_.generatedColumn-T.generatedColumn,P!==0)||(P=_.generatedLine-T.generatedLine,P!==0)?P:x(_.name,T.name)}i.compareByOriginalPositions=b;function S(_,T,C){var P=_.generatedLine-T.generatedLine;return P!==0||(P=_.generatedColumn-T.generatedColumn,P!==0||C)||(P=x(_.source,T.source),P!==0)||(P=_.originalLine-T.originalLine,P!==0)||(P=_.originalColumn-T.originalColumn,P!==0)?P:x(_.name,T.name)}i.compareByGeneratedPositionsDeflated=S;function x(_,T){return _===T?0:_===null?1:T===null?-1:_>T?1:-1}function A(_,T){var C=_.generatedLine-T.generatedLine;return C!==0||(C=_.generatedColumn-T.generatedColumn,C!==0)||(C=x(_.source,T.source),C!==0)||(C=_.originalLine-T.originalLine,C!==0)||(C=_.originalColumn-T.originalColumn,C!==0)?C:x(_.name,T.name)}i.compareByGeneratedPositionsInflated=A;function E(_){return JSON.parse(_.replace(/^\)]}'[^\n]*\n/,""))}i.parseSourceMapInput=E;function w(_,T,C){if(T=T||"",_&&(_[_.length-1]!=="/"&&T[0]!=="/"&&(_+="/"),T=_+T),C){var P=o(C);if(!P)throw new Error("sourceMapURL could not be parsed");if(P.path){var k=P.path.lastIndexOf("/");k>=0&&(P.path=P.path.substring(0,k+1))}T=u(a(P),T)}return l(T)}i.computeSourceURL=w}(util)),util}var arraySet={},hasRequiredArraySet;function requireArraySet(){if(hasRequiredArraySet)return arraySet;hasRequiredArraySet=1;var i=requireUtil(),e=Object.prototype.hasOwnProperty,r=typeof Map<"u";function s(){this._array=[],this._set=r?new Map:Object.create(null)}return s.fromArray=function(a,l){for(var u=new s,c=0,d=a.length;c=0)return l}else{var u=i.toSetString(a);if(e.call(this._set,u))return this._set[u]}throw new Error('"'+a+'" is not in the set.')},s.prototype.at=function(a){if(a>=0&&aa||l==a&&c>=u||i.compareByGeneratedPositionsInflated(s,o)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return r.prototype.unsortedForEach=function(o,a){this._array.forEach(o,a)},r.prototype.add=function(o){e(this._last,o)?(this._last=o,this._array.push(o)):(this._sorted=!1,this._array.push(o))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},mappingList.MappingList=r,mappingList}var hasRequiredSourceMapGenerator;function requireSourceMapGenerator(){if(hasRequiredSourceMapGenerator)return sourceMapGenerator;hasRequiredSourceMapGenerator=1;var i=requireBase64Vlq(),e=requireUtil(),r=requireArraySet().ArraySet,s=requireMappingList().MappingList;function o(a){a||(a={}),this._file=e.getArg(a,"file",null),this._sourceRoot=e.getArg(a,"sourceRoot",null),this._skipValidation=e.getArg(a,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new s,this._sourcesContents=null}return o.prototype._version=3,o.fromSourceMap=function(l){var u=l.sourceRoot,c=new o({file:l.file,sourceRoot:u});return l.eachMapping(function(d){var y={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(y.source=d.source,u!=null&&(y.source=e.relative(u,y.source)),y.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(y.name=d.name)),c.addMapping(y)}),l.sources.forEach(function(d){var y=d;u!==null&&(y=e.relative(u,d)),c._sources.has(y)||c._sources.add(y);var m=l.sourceContentFor(d);m!=null&&c.setSourceContent(d,m)}),c},o.prototype.addMapping=function(l){var u=e.getArg(l,"generated"),c=e.getArg(l,"original",null),d=e.getArg(l,"source",null),y=e.getArg(l,"name",null);this._skipValidation||this._validateMapping(u,c,d,y),d!=null&&(d=String(d),this._sources.has(d)||this._sources.add(d)),y!=null&&(y=String(y),this._names.has(y)||this._names.add(y)),this._mappings.add({generatedLine:u.line,generatedColumn:u.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:d,name:y})},o.prototype.setSourceContent=function(l,u){var c=l;this._sourceRoot!=null&&(c=e.relative(this._sourceRoot,c)),u!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[e.toSetString(c)]=u):this._sourcesContents&&(delete this._sourcesContents[e.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},o.prototype.applySourceMap=function(l,u,c){var d=u;if(u==null){if(l.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);d=l.file}var y=this._sourceRoot;y!=null&&(d=e.relative(y,d));var m=new r,g=new r;this._mappings.unsortedForEach(function(v){if(v.source===d&&v.originalLine!=null){var b=l.originalPositionFor({line:v.originalLine,column:v.originalColumn});b.source!=null&&(v.source=b.source,c!=null&&(v.source=e.join(c,v.source)),y!=null&&(v.source=e.relative(y,v.source)),v.originalLine=b.line,v.originalColumn=b.column,b.name!=null&&(v.name=b.name))}var S=v.source;S!=null&&!m.has(S)&&m.add(S);var x=v.name;x!=null&&!g.has(x)&&g.add(x)},this),this._sources=m,this._names=g,l.sources.forEach(function(v){var b=l.sourceContentFor(v);b!=null&&(c!=null&&(v=e.join(c,v)),y!=null&&(v=e.relative(y,v)),this.setSourceContent(v,b))},this)},o.prototype._validateMapping=function(l,u,c,d){if(u&&typeof u.line!="number"&&typeof u.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(l&&"line"in l&&"column"in l&&l.line>0&&l.column>=0&&!u&&!c&&!d)){if(l&&"line"in l&&"column"in l&&u&&"line"in u&&"column"in u&&l.line>0&&l.column>=0&&u.line>0&&u.column>=0&&c)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:l,source:c,original:u,name:d}))}},o.prototype._serializeMappings=function(){for(var l=0,u=1,c=0,d=0,y=0,m=0,g="",v,b,S,x,A=this._mappings.toArray(),E=0,w=A.length;E0){if(!e.compareByGeneratedPositionsInflated(b,A[E-1]))continue;v+=","}v+=i.encode(b.generatedColumn-l),l=b.generatedColumn,b.source!=null&&(x=this._sources.indexOf(b.source),v+=i.encode(x-m),m=x,v+=i.encode(b.originalLine-1-d),d=b.originalLine-1,v+=i.encode(b.originalColumn-c),c=b.originalColumn,b.name!=null&&(S=this._names.indexOf(b.name),v+=i.encode(S-y),y=S)),g+=v}return g},o.prototype._generateSourcesContent=function(l,u){return l.map(function(c){if(!this._sourcesContents)return null;u!=null&&(c=e.relative(u,c));var d=e.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,d)?this._sourcesContents[d]:null},this)},o.prototype.toJSON=function(){var l={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(l.file=this._file),this._sourceRoot!=null&&(l.sourceRoot=this._sourceRoot),this._sourcesContents&&(l.sourcesContent=this._generateSourcesContent(l.sources,l.sourceRoot)),l},o.prototype.toString=function(){return JSON.stringify(this.toJSON())},sourceMapGenerator.SourceMapGenerator=o,sourceMapGenerator}var sourceMapConsumer={},binarySearch={},hasRequiredBinarySearch;function requireBinarySearch(){return hasRequiredBinarySearch||(hasRequiredBinarySearch=1,function(i){i.GREATEST_LOWER_BOUND=1,i.LEAST_UPPER_BOUND=2;function e(r,s,o,a,l,u){var c=Math.floor((s-r)/2)+r,d=l(o,a[c],!0);return d===0?c:d>0?s-c>1?e(c,s,o,a,l,u):u==i.LEAST_UPPER_BOUND?s1?e(r,c,o,a,l,u):u==i.LEAST_UPPER_BOUND?c:r<0?-1:r}i.search=function(s,o,a,l){if(o.length===0)return-1;var u=e(-1,o.length,s,o,a,l||i.GREATEST_LOWER_BOUND);if(u<0)return-1;for(;u-1>=0&&a(o[u],o[u-1],!0)===0;)--u;return u}}(binarySearch)),binarySearch}var quickSort={},hasRequiredQuickSort;function requireQuickSort(){if(hasRequiredQuickSort)return quickSort;hasRequiredQuickSort=1;function i(s,o,a){var l=s[o];s[o]=s[a],s[a]=l}function e(s,o){return Math.round(s+Math.random()*(o-s))}function r(s,o,a,l){if(a=0){var S=this._originalMappings[b];if(y.column===void 0)for(var x=S.originalLine;S&&S.originalLine===x;)v.push({line:i.getArg(S,"generatedLine",null),column:i.getArg(S,"generatedColumn",null),lastColumn:i.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++b];else for(var A=S.originalColumn;S&&S.originalLine===m&&S.originalColumn==A;)v.push({line:i.getArg(S,"generatedLine",null),column:i.getArg(S,"generatedColumn",null),lastColumn:i.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++b]}return v},sourceMapConsumer.SourceMapConsumer=a;function l(d,y){var m=d;typeof d=="string"&&(m=i.parseSourceMapInput(d));var g=i.getArg(m,"version"),v=i.getArg(m,"sources"),b=i.getArg(m,"names",[]),S=i.getArg(m,"sourceRoot",null),x=i.getArg(m,"sourcesContent",null),A=i.getArg(m,"mappings"),E=i.getArg(m,"file",null);if(g!=this._version)throw new Error("Unsupported version: "+g);S&&(S=i.normalize(S)),v=v.map(String).map(i.normalize).map(function(w){return S&&i.isAbsolute(S)&&i.isAbsolute(w)?i.relative(S,w):w}),this._names=r.fromArray(b.map(String),!0),this._sources=r.fromArray(v,!0),this._absoluteSources=this._sources.toArray().map(function(w){return i.computeSourceURL(S,w,y)}),this.sourceRoot=S,this.sourcesContent=x,this._mappings=A,this._sourceMapURL=y,this.file=E}l.prototype=Object.create(a.prototype),l.prototype.consumer=a,l.prototype._findSourceIndex=function(d){var y=d;if(this.sourceRoot!=null&&(y=i.relative(this.sourceRoot,y)),this._sources.has(y))return this._sources.indexOf(y);var m;for(m=0;m1&&(k.source=x+R[1],x+=R[1],k.originalLine=b+R[2],b=k.originalLine,k.originalLine+=1,k.originalColumn=S+R[3],S=k.originalColumn,R.length>4&&(k.name=A+R[4],A+=R[4])),P.push(k),typeof k.originalLine=="number"&&C.push(k)}o(P,i.compareByGeneratedPositionsDeflated),this.__generatedMappings=P,o(C,i.compareByOriginalPositions),this.__originalMappings=C},l.prototype._findMapping=function(y,m,g,v,b,S){if(y[g]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+y[g]);if(y[v]<0)throw new TypeError("Column must be greater than or equal to 0, got "+y[v]);return e.search(y,m,b,S)},l.prototype.computeColumnSpans=function(){for(var y=0;y=0){var v=this._generatedMappings[g];if(v.generatedLine===m.generatedLine){var b=i.getArg(v,"source",null);b!==null&&(b=this._sources.at(b),b=i.computeSourceURL(this.sourceRoot,b,this._sourceMapURL));var S=i.getArg(v,"name",null);return S!==null&&(S=this._names.at(S)),{source:b,line:i.getArg(v,"originalLine",null),column:i.getArg(v,"originalColumn",null),name:S}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(y){return y==null}):!1},l.prototype.sourceContentFor=function(y,m){if(!this.sourcesContent)return null;var g=this._findSourceIndex(y);if(g>=0)return this.sourcesContent[g];var v=y;this.sourceRoot!=null&&(v=i.relative(this.sourceRoot,v));var b;if(this.sourceRoot!=null&&(b=i.urlParse(this.sourceRoot))){var S=v.replace(/^file:\/\//,"");if(b.scheme=="file"&&this._sources.has(S))return this.sourcesContent[this._sources.indexOf(S)];if((!b.path||b.path=="/")&&this._sources.has("/"+v))return this.sourcesContent[this._sources.indexOf("/"+v)]}if(m)return null;throw new Error('"'+v+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(y){var m=i.getArg(y,"source");if(m=this._findSourceIndex(m),m<0)return{line:null,column:null,lastColumn:null};var g={source:m,originalLine:i.getArg(y,"line"),originalColumn:i.getArg(y,"column")},v=this._findMapping(g,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(y,"bias",a.GREATEST_LOWER_BOUND));if(v>=0){var b=this._originalMappings[v];if(b.source===g.source)return{line:i.getArg(b,"generatedLine",null),column:i.getArg(b,"generatedColumn",null),lastColumn:i.getArg(b,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},sourceMapConsumer.BasicSourceMapConsumer=l;function c(d,y){var m=d;typeof d=="string"&&(m=i.parseSourceMapInput(d));var g=i.getArg(m,"version"),v=i.getArg(m,"sections");if(g!=this._version)throw new Error("Unsupported version: "+g);this._sources=new r,this._names=new r;var b={line:-1,column:0};this._sections=v.map(function(S){if(S.url)throw new Error("Support for url field in sections not implemented.");var x=i.getArg(S,"offset"),A=i.getArg(x,"line"),E=i.getArg(x,"column");if(A=0;c--)this.prepend(u[c]);else if(u[o]||typeof u=="string")this.children.unshift(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},a.prototype.walk=function(u){for(var c,d=0,y=this.children.length;d0){for(c=[],d=0;d0&&(S+=", "+x.join(", "));var A=0;Object.keys(this.aliases).forEach(function(_){var T=b.aliases[_];T.children&&T.referenceCount>1&&(S+=", alias"+ ++A+"="+_,T.children[0]="alias"+A)}),this.lookupPropertyFunctionIsUsed&&(S+=", "+this.lookupPropertyFunctionVarDeclaration());var E=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&E.push("blockParams"),this.useDepths&&E.push("depths");var w=this.mergeSource(S);return v?(E.push(w),Function.apply(this,E)):this.source.wrap(["function(",E.join(","),`) { `,w,"}"])},mergeSource:function(v){var b=this.environment.isSimple,S=!this.forceBuffer,x=void 0,A=void 0,E=void 0,w=void 0;return this.source.each(function(_){_.appendToBuffer?(E?_.prepend(" + "):E=_,w=_):(E&&(A?E.prepend("buffer += "):x=!0,w.add(";"),E=w=void 0),A=!0,b||(S=!1))}),S?E?(E.prepend("return "),w.add(";")):A||this.source.push('return "";'):(v+=", buffer = "+(x?"":this.initializeBuffer()),E?(E.prepend("return buffer + "),w.add(";")):this.source.push("return buffer;")),v&&this.source.prepend("var "+v.substring(2)+(x?"":`; `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return` lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined } `.trim()},blockValue:function(v){var b=this.aliasable("container.hooks.blockHelperMissing"),S=[this.contextName(0)];this.setupHelperArgs(v,0,S);var x=this.popStack();S.splice(1,0,x),this.push(this.source.functionCall(b,"call",S))},ambiguousBlockValue:function(){var v=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var S=this.topStack();b.splice(1,0,S),this.pushSource(["if (!",this.lastHelper,") { ",S," = ",this.source.functionCall(v,"call",b),"}"])},appendContent:function(v){this.pendingContent?v=this.pendingContent+v:this.pendingLocation=this.source.currentLocation,this.pendingContent=v},append:function(){if(this.isInline())this.replaceStack(function(b){return[" != null ? ",b,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var v=this.popStack();this.pushSource(["if (",v," != null) { ",this.appendToBuffer(v,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(v){this.lastContext=v},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(v,b,S,x){var A=0;!x&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(v[A++])):this.pushContext(),this.resolvePath("context",v,A,b,S)},lookupBlockParam:function(v,b){this.useBlockParams=!0,this.push(["blockParams[",v[0],"][",v[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(v,b,S){v?this.pushStackLiteral("container.data(data, "+v+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,S)},resolvePath:function(v,b,S,x,A){var E=this;if(this.options.strict||this.options.assumeObjects){this.push(m(this.options.strict&&A,this,b,S,v));return}for(var w=b.length;Sthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var v=this.inlineStack;this.inlineStack=[];for(var b=0,S=v.length;b64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function decode(i,e){for(var r=i.replace(/[^A-Za-z0-9\+\/]/g,""),s=r.length,o=e?Math.ceil((s*3+1>>2)/e)*e:s*3+1>>2,a=new Uint8Array(o),l,u,c=0,d=0,y=0;y>>(16>>>l&24)&255;c=0}return a}var base64={decode},fetch$1=function(i,e){return new Promise(function(r,s){var o=new XMLHttpRequest;e&&(o.responseType=e),o.open("GET",i),o.onload=function(){o.status===200?r(o.response):s(Error(o.statusText))},o.onerror=function(){s(Error("Network Error"))},o.send()})};(function(i){var e=base64,r=fetch$1;function s(P){return function(k){return typeof k=="string"&&P.test(k)}}function o(P,k){return typeof P=="string"?P+k:typeof P=="function"?P(k):k}function a(P,k,M,R){var H=l(k)?u:c(k)?d:y(k)?m:g(k)?v:b(k)?S:x(k)?A:E(k)?w:_(k)?T:null,B=M||{};return H?H(P,k,B):R?Promise.resolve(R):Promise.reject("Source not valid ("+k+")")}a.fetch=r;function l(P){return P instanceof ArrayBuffer}function u(P,k,M){return new Promise(function(R,H){P.decodeAudioData(k,function(B){R(B)},function(){H("Can't decode audio data ("+k.slice(0,30)+"...)")})})}var c=s(/\.(mp3|wav|ogg)(\?.*)?$/i);function d(P,k,M){var R=o(M.from,k);return a(P,a.fetch(R,"arraybuffer"),M)}function y(P){return P&&typeof P.then=="function"}function m(P,k,M){return k.then(function(R){return a(P,R,M)})}var g=Array.isArray;function v(P,k,M){return Promise.all(k.map(function(R){return a(P,R,M,R)}))}function b(P){return P&&typeof P=="object"}function S(P,k,M){var R={},H=Object.keys(k).map(function(B){if(M.only&&M.only.indexOf(B)===-1)return null;var F=k[B];return a(P,F,M,F).then(function(I){R[B]=I})});return Promise.all(H).then(function(){return R})}var x=s(/\.json(\?.*)?$/i);function A(P,k,M){var R=o(M.from,k);return a(P,a.fetch(R,"text").then(JSON.parse),M)}var E=s(/^data:audio/);function w(P,k,M){var R=k.indexOf(",");return a(P,e.decode(k.slice(R+1)).buffer,M)}var _=s(/\.js(\?.*)?$/i);function T(P,k,M){var R=o(M.from,k);return a(P,a.fetch(R,"text").then(C),M)}function C(P){var k=P.indexOf("MIDI.Soundfont.");if(k<0)throw Error("Invalid MIDI.js Soundfont format");k=P.indexOf("=",k)+2;var M=P.lastIndexOf(",");return JSON.parse(P.slice(k,M)+"}")}i.exports&&(i.exports=a),typeof window<"u"&&(window.loadAudio=a)})(lib$1);var libExports={},lib={get exports(){return libExports},set exports(i){libExports=i}},adsr=ADSR$1;function ADSR$1(i){var e=i.createGain(),r=e._voltage=getVoltage(i),s=scale(r),o=scale(r),a=scale(r);return e._startAmount=scale(o),e._endAmount=scale(a),e._multiplier=scale(s),e._multiplier.connect(e),e._startAmount.connect(e),e._endAmount.connect(e),e.value=s.gain,e.startValue=o.gain,e.endValue=a.gain,e.startValue.value=0,e.endValue.value=0,Object.defineProperties(e,props),e}var props={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(i){var e=this._multiplier.gain,r=this._startAmount.gain,s=this._endAmount.gain;this._voltage.start(i),this._decayFrom=this._decayFrom=i+this.attack,this._startedAt=i;var o=this.sustain;e.cancelScheduledValues(i),r.cancelScheduledValues(i),s.cancelScheduledValues(i),s.setValueAtTime(0,i),this.attack?(e.setValueAtTime(0,i),e.linearRampToValueAtTime(1,i+this.attack),r.setValueAtTime(1,i),r.linearRampToValueAtTime(0,i+this.attack)):(e.setValueAtTime(1,i),r.setValueAtTime(0,i)),this.decay&&e.setTargetAtTime(o,this._decayFrom,getTimeConstant(this.decay))}},stop:{value:function(i,e){e&&(i=i-this.release);var r=i+this.release;if(this.release){var s=this._multiplier.gain,o=this._startAmount.gain,a=this._endAmount.gain;s.cancelScheduledValues(i),o.cancelScheduledValues(i),a.cancelScheduledValues(i);var l=getTimeConstant(this.release);if(this.attack&&i=e&&(d=e),d}var ADSR=adsr,EMPTY={},DEFAULTS={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function SamplePlayer(i,e,r){var s=!1,o=0,a={},l=i.createGain();l.gain.value=1;var u=Object.assign({},DEFAULTS,r),c={context:i,out:l,opts:u};return e instanceof AudioBuffer?c.buffer=e:c.buffers=e,c.start=function(m,g,v){if(c.buffer&&m!==null)return c.start(null,m,g);var b=m?c.buffers[m]:c.buffer;if(b){if(!s){console.warn("SamplePlayer not connected to any node.");return}}else{console.warn("Buffer "+m+" not found.");return}var S=v||EMPTY;g=Math.max(i.currentTime,g||0),c.emit("start",g,m,S);var x=y(m,b,S);return x.id=d(m,x),x.env.start(g),x.source.start(g),c.emit("started",g,x.id,x),S.duration&&x.stop(g+S.duration),x},c.play=function(m,g,v){return c.start(m,g,v)},c.stop=function(m,g){var v;return g=g||Object.keys(a),g.map(function(b){return v=a[b],v?(v.stop(m),v.id):null})},c.connect=function(m){return s=!0,l.connect(m),c},c.emit=function(m,g,v,b){c.onevent&&c.onevent(m,g,v,b);var S=c["on"+m];S&&S.forEach(x=>{x(g,v,b)})},c;function d(m,g){return g.id=o++,a[g.id]=g,g.startTime=i.currentTime,g.source.onended=function(){var v=i.currentTime;g.source.disconnect(),g.env.disconnect(),g.disconnect(),c.emit("ended",v,g.id,g)},g.id}function y(m,g,v){var b=i.createGain();return b.gain.value=0,b.connect(l),b.env=envelope(i,v,u),b.env.connect(b.gain),b.source=i.createBufferSource(),b.source.buffer=g,b.source.connect(b),b.source.loop=v.loop||u.loop,b.source.playbackRate.value=centsToRate(v.cents||u.cents),b.source.loopStart=v.loopStart||u.loopStart,b.source.loopEnd=v.loopEnd||u.loopEnd,b.stop=function(S){var x=S||i.currentTime;c.emit("stop",x,m);var A=b.env.stop(x);b.source.stop(A)},b}}function isNum$1(i){return typeof i=="number"}var PARAMS=["attack","decay","sustain","release"];function envelope(i,e,r){var s=ADSR(i),o=e.adsr||r.adsr;return PARAMS.forEach(function(a,l){o?s[a]=o[l]:s[a]=e[a]||r[a]}),s.value.value=isNum$1(e.gain)?e.gain:isNum$1(r.gain)?r.gain:1,s}function centsToRate(i){return i?Math.pow(2,i/1200):1}var player=SamplePlayer,events=function(i){return i.on=function(e,r){if(arguments.length===1&&typeof e=="function")return i.on("event",e);var s="on"+e;return i[s]?i[s].push(r):i[s]=[r],i},i},REGEX$1=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function regex$1(){return REGEX$1}var SEMITONES$1=[0,2,4,5,7,9,11];function parse$1(i,e,r){if(typeof i!="string")return null;var s=REGEX$1.exec(i);if(!s||!e&&s[4])return null;var o={letter:s[1].toUpperCase(),acc:s[2].replace(/x/g,"##")};return o.pc=o.letter+o.acc,o.step=(o.letter.charCodeAt(0)+3)%7,o.alt=o.acc[0]==="b"?-o.acc.length:o.acc.length,o.chroma=SEMITONES$1[o.step]+o.alt,s[3]&&(o.oct=+s[3],o.midi=o.chroma+12*(o.oct+1),o.freq=midiToFreq$1(o.midi,r)),e&&(o.tonicOf=s[4]),o}function midiToFreq$1(i,e){return Math.pow(2,(i-69)/12)*(e||440)}var parser={parse:parse$1,regex:regex$1,midiToFreq:midiToFreq$1},FNS=["letter","acc","pc","step","alt","chroma","oct","midi","freq"];FNS.forEach(function(i){parser[i]=function(e){var r=parse$1(e);return r&&typeof r[i]<"u"?r[i]:null}});var noteParser$1=parser,note$2=noteParser$1,isMidi=function(i){return i!==null&&i!==[]&&i>=0&&i<129},toMidi=function(i){return isMidi(i)?+i:note$2.midi(i)},notes$1=function(i){if(i.buffers){var e=i.opts.map,r=typeof e=="function"?e:toMidi,s=function(a){return a?r(a)||a:null};i.buffers=mapBuffers(i.buffers,s);var o=i.start;i.start=function(a,l,u){var c=s(a),d=c%1;return d&&(c=Math.floor(c),u=Object.assign(u||{},{cents:Math.floor(d*100)})),o(c,l,u)}}return i};function mapBuffers(i,e){return Object.keys(i).reduce(function(r,s){return r[e(s)]=i[s],r},{})}var isArr=Array.isArray,isObj=function(i){return i&&typeof i=="object"},OPTS={},scheduler=function(i){return i.schedule=function(e,r){var s=i.context.currentTime,o=e"u"?null:i.step?build(i.step,i.alt,i.oct):i<0||i>6?null:LETTERS.charAt(i)+accStr(e)+octStr(r)}function midi(i){if((isNum(i)||isStr(i))&&i>=0&&i<128)return+i;var e=parse(i);return e&&isDef(e.midi)?e.midi:null}function freq(i,e){var r=midi(i);return r===null?null:midiToFreq(r,e)}function letter(i){return(parse(i)||{}).letter}function acc(i){return(parse(i)||{}).acc}function pc(i){return(parse(i)||{}).pc}function step(i){return(parse(i)||{}).step}function alt(i){return(parse(i)||{}).alt}function chroma(i){return(parse(i)||{}).chroma}function oct(i){return(parse(i)||{}).oct}const noteParser=Object.freeze(Object.defineProperty({__proto__:null,acc,alt,build,chroma,freq,letter,midi,oct,parse,pc,regex,step},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(noteParser);var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var i=require$$0;function e(o,a){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof e))return new e(o);this.nameToUrl=a||e.nameToUrl,this.ctx=o,this.instruments={},this.promises=[]}e.prototype.onready=function(o){console.warn("deprecated API"),console.log("Please use Promise.all(Soundfont.instrument(), Soundfont.instrument()).then() instead of new Soundfont().onready()"),Promise.all(this.promises).then(o)},e.prototype.instrument=function(o,a){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var l=this.ctx;if(o=o||"default",o in this.instruments)return this.instruments[o];var u={name:o,play:s(l,a)};if(this.instruments[o]=u,o!=="default"){var c=e.instrument(l,o,a).then(function(d){return u.play=d.play,u});this.promises.push(c),u.onready=function(d){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),c.then(d)}}else u.onready=function(d){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),d()};return u};function r(o,a,l){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),e.instrument(o,a,l).then(function(u){return u.buffers})}e.loadBuffers=r;function s(o,a){return a=a||{},function(l,u,c,d){console.warn("The oscillator player is deprecated."),console.log("Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.");var y=l>0&&l<129?+l:i.midi(l),m=y?i.midiToFreq(y,440):null;if(m){c=c||.2,d=d||{};var g=d.destination||a.destination||o.destination,v=d.vcoType||a.vcoType||"sine",b=d.gain||a.gain||.4,S=o.createOscillator();S.type=v,S.frequency.value=m;var x=o.createGain();return x.gain.value=b,S.connect(x),x.connect(g),S.start(u),c>0&&S.stop(u+c),S}}}return e.noteToMidi=i.midi,legacy=e,legacy}(function(i){var e=libExports$1,r=libExports;function s(u,c,d){if(arguments.length===1)return function(b,S){return s(u,b,S)};var y=d||{},m=y.isSoundfontURL||o,g=y.nameToUrl||a,v=m(c)?c:g(c,y.soundfont,y.format);return e(u,v,{only:y.only||y.notes}).then(function(b){var S=r(u,b,y).connect(y.destination?y.destination:u.destination);return S.url=v,S.name=c,S})}function o(u){return/\.js(\?.*)?$/i.test(u)}function a(u,c,d){return d=d==="ogg"?d:"mp3",c=c==="FluidR3_GM"?c:"MusyngKite","https://gleitz.github.io/midi-js-soundfonts/"+c+"/"+u+"-"+d+".js"}var l=requireLegacy();l.instrument=s,l.nameToUrl=a,i.exports&&(i.exports=l),typeof window<"u"&&(window.Soundfont=l)})(lib$2);NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B;const selectionContainer="_selectionContainer_1w9ea_1",position="_position_1w9ea_8",note$1="_note_1w9ea_11",selectBox="_selectBox_1w9ea_14",selectHandle="_selectHandle_1w9ea_20",selectHandleRight="_selectHandleRight_1w9ea_34",playIng="_playIng_1w9ea_39",disable="_disable_1w9ea_43",line="_line_1w9ea_46",eyeLine="_eyeLine_1w9ea_58",lineStaff="_lineStaff_1w9ea_61",lineJianPu="_lineJianPu_1w9ea_64",scoreItem="_scoreItem_1w9ea_70",dotWrap="_dotWrap_1w9ea_107",noteFollow="_noteFollow_1w9ea_122",followTipUp="_followTipUp_1w9ea_131",followTipDown="_followTipDown_1w9ea_132",linePC="_linePC_1w9ea_229",noteDot="_noteDot_1w9ea_233",staveBgContainer="_staveBgContainer_1w9ea_241",staveBg="_staveBg_1w9ea_241",styles$c={selectionContainer,position,note:note$1,selectBox,selectHandle,selectHandleRight,playIng,disable,line,eyeLine,lineStaff,lineJianPu,scoreItem,dotWrap,noteFollow,followTipUp,followTipDown,linePC,noteDot,staveBgContainer,staveBg},noteMove="_noteMove_1usjb_1",activeModel="_activeModel_1usjb_14",toolBox="_toolBox_1usjb_17",moveDisabled="_moveDisabled_1usjb_33",hideTool="_hideTool_1usjb_36",rightHideIcon$1="_rightHideIcon_1usjb_39",styles$b={noteMove,activeModel,toolBox,moveDisabled,hideTool,rightHideIcon:rightHideIcon$1},tooltip="",TooltipSfc="",buttonGroup="",ButtonGroupSfc="",rightHideIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAB4CAYAAACjK+FPAAAAAXNSR0IArs4c6QAAA9hJREFUeF7tnctrE1EUxr+J7wfqRsdCA2okIhMfNCXZVKyKWOzSZVbdCS5KcetON6J/RKEQBKFLwVWpUgvddNFVNkWbGrptSCsVm8otmTDpTDptb+49cx8Xumrn3PM735m5Z5r2HAf86zyAqwAuAjgF4HTr6xi/6Z5Z+Occ0dQZANdbgOeOaEPmZYcGPQHgJoAbAFIyPeXc61CgaQAeAAar2joQKEvv2wAyqtEF/I0FPQ4gD+CKwpDM9X1BmZJFAJcVh4wFZfcje+josLoqyh4893UgbDFEgp4E8AQAuz91WZGgOqWsL1QI9CyAxwCOWjElNQNCoHcAXEuqtxx+hUCftgpyDpuJvLQD9BKAB4l0k9+pDtBbALL8NhNpoQOUVUGql3rdotwB+hDAhUTqwe9UB+gzAKxY0HG1QdlL9KiOhHtLQPYyPWJB1Y9AO3WtouqLuUtgFdVEyDaGVdQqqmgEbOoqKlxXt62iVlFFI2BTV1Hh7MPIpq5NXUUjYFNXUeHsU9emLmnqzszMvCgUCqOO4zgLCwtfhoeHP3M6lDxFl5aWXuZyuecBsJ3Jycn3Y2NjPzhgkwUaAbnLtry8/D2TyXzQArQbJIObm5srDw0NfVIedD/IRqPx23XdV5ubm02lQWMga4ODgxOVSuUPByT9b+olQdKCSoSkA5UMSQNKACkflAhSLighpDxQYkg5oCsrK2/S6XQh6hxsNBq9OifjjlmxtW61Wn3T399PDSle0e3t7elUKhX6S+6NjY1aPp/vRcUTp6T/fbGKNpvNacdxQqD1er3qed7E6urq34N6yvlzYkFrtdrbvr6+e1FO1uv1X57nvZYEKxaUAa6trb1zXfcuMax4UAZYqVTGs9ks+8+L0JKkrBzQBMDKAyWGlQtKCCsflAiWBpQAlg5UMiwtqERYetA42PX19Z+u645vbW3tcJSByQCNg52dnZ3i/PwlOaD7wWr1kYSfllHlYrlc/lgqlb5pkbpBiPn5+dLAwMAI+9hwcXHxa7FYnOKAFP/izelcLy9P1j3aS7I9tiyowOCSmLaKkoRd4KZWUYHBJTFtFSUJu8BNraICg0ti2ipKEnaBm1pFBQaXxLRVlCTsAje1igoMLolpqyhJ2AVuahUVGFwS021FjWncxMJsRCsuBmpMczVj2uUZ0wDRmJaW7D41okkpA821JgqQHHYCN22fo/4erJHwI8WmChwkPiFQdpERraEZqDHNvhmsEe3b/ZzXKYUj71Ef1JgRCwzYiKEZQWW1H4MSPKO0H2wThDViVFEQWPvhU1HlVnCcGBsl5o8US9Q4sf9BGvvA8pV1NwAAAABJRU5ErkJggg==";let extStyleConfigJson={};window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;const showToolBox=ref(!0),moveData=reactive({open:!1,zoom:1,partIndex:"0",hasExtJson:!1,isWeb:!1,modelList:[],activeIndex:-1,sw:0,tool:{isAddAndSub:!1},noteCoords:[]}),initNoteCoord=()=>{const i=Array.from(document.querySelectorAll(".node-dot"));moveData.noteCoords=i.map(e=>{var s;const r=((s=e==null?void 0:e.getBoundingClientRect)==null?void 0:s.call(e))||{x:0,y:0};return{x:r.x,y:r.y}})},computedDistance=(i,e)=>{let r=-1,s=0,o,a,l;return moveData.noteCoords.forEach((u,c)=>{o=Math.abs(u.x-i),a=Math.abs(u.y-e),l=Math.sqrt(o*o+a*a),l=Number(l.toFixed(0)),l!==0&&(r===-1||l{setEleId(m,"temp"+l),l++});let u=1;[...r].forEach(m=>{setEleId(m,"text"+u),u++});let c=1;[...s].forEach(m=>{setEleId(m,"section"+c),c++});let d=1;[...o].forEach(m=>{setEleId(m,"repet"+d),d++});let y=1;[...a].forEach(m=>{setEleId(m,"line"+y),y++})}function setEleId(i,e){if(!i||!e)return;i.getAttribute("id")||i.setAttribute("id",e),createModelBox(i)}function createModelBox(i){var u;const e=((u=document.getElementById("musicAndSelection"))==null?void 0:u.getBoundingClientRect())||{x:0,y:0},r=e.x||0,s=e.y||0,o=i.getBoundingClientRect(),a={left:o.x-r+"px",top:o.y-s+"px",width:o.width+"px",height:o.height+"px"},l=i.getAttribute("class");moveData.modelList.push({id:i.getAttribute("id"),bbox:a,type:l,isMove:!1,left:o.left,top:o.top,width:o.width,height:o.height,x:0,y:0,zoom:state$1.zoom,isDelete:!1,d2:getLineGroupPathDx(i),dx:0})}function getBox(i){var a;if(!i)return{};const e=((a=document.getElementById("musicAndSelection"))==null?void 0:a.getBoundingClientRect())||{x:0,y:0},r=e.x||0,s=e.y||0,o=i.getBoundingClientRect();return{left:o.x-r,top:o.y-s,width:o.width,height:o.height}}const filterMoveData=async()=>{const i=state$1.examSongId;if(i){const e=window.fontSize,r=moveData.modelList.filter(o=>o.isMove).map(o=>{var m,g,v,b;const a=o.left+o.x,l=o.top+o.y,u=computedDistance(a,l),c=a-((m=moveData.noteCoords[u])==null?void 0:m.x),d=l-((g=moveData.noteCoords[u])==null?void 0:g.y);let y={id:o.id,isMove:o.isMove,isDelete:o.isDelete,x:o.x,y:o.y,xRem:Math.abs(o.x/e),yRem:Math.abs(o.y/e),zoom:o.zoom,w:moveData.sw,type:o.type,noteIdx:u,noteRelativeX:c,noteRelativeY:d};if(o.type==="vf-lineGroup"&&(y.dx=o.dx),o.id.includes("text")){const S=((b=(v=document.querySelector("#"+o.id))==null?void 0:v.querySelector("text"))==null?void 0:b.innerHTML)||"";y.textContent=S}return y});extStyleConfigJson[moveData.partIndex]=r,console.log("🚀 ~ extStyleConfigJson",extStyleConfigJson);const s=await request.post("/musicSheet/img",{requestType:"json",data:{id:i,extStyleConfigJson:JSON.stringify(extStyleConfigJson)}});s&&s.code==200&&showToast("保存成功"),clearActiveModel()}},dragData={open:!1,startX:0,startY:0,x:0,y:0,repeatEdit:!1},undoData=reactive({undoList:[],redoList:[],activeItem:null});function onDown(i){const e=i.target,r=moveData.modelList.findIndex(s=>s.id===e.dataset.id);if(r>-1){const s=moveData.modelList[r];moveData.activeIndex=r,dragData.startX=i.clientX,dragData.startY=i.clientY,dragData.x=s.x,dragData.y=s.y,dragData.repeatEdit=s.noteIdx>=0,document.onmousemove=onMove,document.onmouseup=onUp,dragData.open=!0,s.type==="vf-lineGroup"?moveData.tool.isAddAndSub=!0:moveData.tool.isAddAndSub=!1,undoData.activeItem={...s};return}moveData.activeIndex=-1}function onMove(i){if(dragData.open){const e=i.clientX-dragData.startX+dragData.x,r=i.clientY-dragData.startY+dragData.y;setModelPostion(moveData.modelList[moveData.activeIndex],e,r,dragData.repeatEdit)}}function onUp(i){document.onmousemove=null,document.onmouseup=null,dragData.open=!1;const e=i.clientX-dragData.startX+dragData.x,r=i.clientY-dragData.startY+dragData.y;(e||r)&&(moveData.modelList[moveData.activeIndex].isMove=!0,moveData.modelList[moveData.activeIndex].x=e,moveData.modelList[moveData.activeIndex].y=r,undoData.activeItem&&undoData.undoList.push({...undoData.activeItem})),undoData.activeItem=null}const renderSvgItem=i=>{if(setModelPostion(i,i.x,i.y),i.isDelete){const e=document.querySelector("#"+i.id);e&&(e.style.display="none")}else{const e=document.querySelector("#"+i.id);e&&(e.style.display="")}};async function setModelPostion(i,e,r,s){var o;if(i){const a=document.querySelector("#"+i.id),l=document.querySelector(`[data-id=${i.id}]`);if(e===0&&r===0)a&&a.removeAttribute("transform"),l&&(l.style.transform="");else{let u=e,c=r;if(i.noteIdx>=0&&!s){moveData.noteCoords.length||await initNoteCoord();const d=moveData.noteCoords[i.noteIdx].x+i.noteRelativeX,y=moveData.noteCoords[i.noteIdx].y+i.noteRelativeY,m=((o=document.getElementById(i.id))==null?void 0:o.getBoundingClientRect())||{x:0,y:0};u=d-m.x,c=y-m.y,a&&a.setAttribute("transform",`translate(${u/moveData.zoom}, ${c/moveData.zoom})`),l&&(l.style.transform=`translate(${u}px, ${c}px)`)}else a&&a.setAttribute("transform",`translate(${u/moveData.zoom}, ${c/moveData.zoom})`),l&&(l.style.transform=`translate(${u}px, ${c}px)`)}}}const handleDeleteMoveNote=()=>{const i=moveData.modelList[moveData.activeIndex];if(i){moveData.modelList[moveData.activeIndex].isMove=!0,undoData.undoList.push({...moveData.modelList[moveData.activeIndex]}),moveData.modelList[moveData.activeIndex].isDelete=!i.isDelete;const e=document.querySelector("#"+i.id);e&&(e.style.display=moveData.modelList[moveData.activeIndex].isDelete?"none":"")}else showToast("选中需要删除的元素")},resetMoveNote=()=>{for(let i=0;i{if(!["add","sub"].includes(i))return;const e=moveData.modelList[moveData.activeIndex];if(!e||e.type!=="vf-lineGroup")return;e.isMove=!0;const r=i==="add"?10:-10;undoData.undoList.push({...moveData.modelList[moveData.activeIndex]}),moveData.modelList[moveData.activeIndex].dx=e.dx+r,renderLineGroup(moveData.modelList[moveData.activeIndex])};function getLineGroupPathDx(i){var r,s,o,a;if(!i)return 0;const e=i.querySelectorAll("path");if(e!=null&&e.length)for(let l=0;l{const i=undoData.undoList.pop();if(i){const e=moveData.modelList.findIndex(r=>r.id===i.id);e>-1&&(moveData.modelList[e]=i,renderSvgItem(moveData.modelList[e]),i.type==="vf-lineGroup"&&renderLineGroup(i))}},renderForMoveData=()=>{if(state$1.extStyleConfigJson)try{extStyleConfigJson=JSON.parse(state$1.extStyleConfigJson)}catch(e){extStyleConfigJson={}}if(!extStyleConfigJson||!(extStyleConfigJson!=null&&extStyleConfigJson[moveData.partIndex])){initSvgId();return}else initSvgId();const i=extStyleConfigJson==null?void 0:extStyleConfigJson[moveData.partIndex];i&&Array.isArray(i)&&nextTick(()=>{console.log("🚀 ~ list",i),i.forEach(e=>{var s,o,a,l,u,c,d;let r=moveData.modelList.findIndex(y=>y.id===e.id);if(e.type==="vf-text"&&e.textContent){let y=((a=(o=document.querySelector("#"+((s=moveData.modelList[r])==null?void 0:s.id)))==null?void 0:o.querySelector("text"))==null?void 0:a.innerHTML)||"",m=r,g=!1,v=r,b=r;if(y!==e.textContent)for(;!g;){let S=moveData.modelList[v]&&((u=(l=document.querySelector("#"+moveData.modelList[v].id))==null?void 0:l.querySelector("text"))==null?void 0:u.innerHTML)||"",x=moveData.modelList[b]&&((d=(c=document.querySelector("#"+moveData.modelList[b].id))==null?void 0:c.querySelector("text"))==null?void 0:d.innerHTML)||"";S===e.textContent||x===e.textContent?(g=!0,m=S===e.textContent?v:b):(!S&&!x&&(g=!0,m=-1),v=v-1,b=b+1)}r=m,e.id=`text${m+1}`}r>-1&&(moveData.modelList[r]={...moveData.modelList[r],...e},renderSvgItem(moveData.modelList[r]),e.type==="vf-lineGroup"&&renderLineGroup(moveData.modelList[r]))})})},MoveMusicScore=defineComponent({name:"move-music-score",setup(){moveData.zoom=state$1.zoom;const e=getQuery().isMove==="1";return console.log("🚀 ~ isOpen:",e),onMounted(()=>{nextTick(()=>initNoteCoord());const r=document.getElementById("toolBox");r&&document.body.appendChild(r)}),()=>createVNode("div",{class:[moveData.open?"":styles$b.moveDisabled]},[createVNode("div",{id:"toolBox"},[createVNode("div",{class:[styles$b.toolBox,!showToolBox.value&&styles$b.hideTool]},[createVNode(Switch,{modelValue:moveData.open,"onUpdate:modelValue":r=>moveData.open=r},null),moveData.open&&createVNode(Fragment,null,[moveData.tool.isAddAndSub&&createVNode(ButtonGroup,{size:"small",elevation:!1},{default:()=>[createVNode(Button,{onClick:()=>handleAddAndSub("add")},{default:()=>[createTextVNode("加")]}),createVNode(Button,{onClick:()=>handleAddAndSub("sub")},{default:()=>[createTextVNode("减")]})]}),createVNode(Button,{size:"small",onClick:handleUndo,disabled:!undoData.undoList.length},{default:()=>[createVNode(Icon,{name:"arrow-down",style:{transform:"rotate(90deg)"}},null)]}),createVNode(Button,{size:"small",onClick:handleDeleteMoveNote,disabled:!(moveData.activeIndex>-1)},{default:()=>{var r;return[(r=moveData.modelList[moveData.activeIndex])!=null&&r.isDelete?"显示元素":"删除元素"]}}),createVNode(Button,{size:"small",onClick:resetMoveNote},{default:()=>[createTextVNode("重置数据")]}),createVNode(Button,{size:"small",type:"primary",onClick:filterMoveData},{default:()=>[createTextVNode("保存数据")]}),createVNode(Button,{size:"small",type:"primary",onClick:()=>showToolBox.value=!1},{default:()=>[createTextVNode("收起")]})])]),!showToolBox.value&&createVNode("img",{class:[styles$b.rightHideIcon,showToolBox.value?"":styles$b.rightIconShow],src:rightHideIcon,onClick:()=>showToolBox.value=!0},null)]),moveData.modelList.map((r,s)=>createVNode("div",{class:[styles$b.noteMove,moveData.activeIndex===s&&styles$b.activeModel],style:r.bbox,"data-id":r.id,onMousedown:onDown},null))])}}),IntonationDown="data:image/png;base64,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",IntonationUp="data:image/png;base64,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",MultipleRestMeasures=defineComponent({name:"multipleRestMeasures",props:{item:{type:Object,required:!0}},setup(i){return()=>createVNode(Fragment,null,[state$1.activeMeasureIndex==i.item.MeasureNumberXML&&createVNode("div",{class:styles$c.dotWrap},[i.item.multipleRestMeasures])])}}),selectData=reactive({notes:[],staves:[],measureHeight:0}),calcNoteData=()=>{var u,c,d,y,m,g,v,b,S,x,A,E,w,_,T,C,P,k,M,R,H,B,F,I,U,D,$,N,O,Q,z,W,xe;const i=((u=document.getElementById("musicAndSelection"))==null?void 0:u.getBoundingClientRect())||{x:0,y:0},e=i.x||0,r=i.y||0,s=state$1.times,o=[],a=[];let l=0;for(let ye=0;yeSe.id===re.id)||selectData.notes.push(re),o.push(q.noteId)}}if(!a.includes(q.MeasureNumberXML)){if(q.stave){if((H=(R=q.stave)==null?void 0:R.attrs)!=null&&H.id){const ue=document.querySelector(`#${q.stave.attrs.id}`),ge=[Array.from((ue==null?void 0:ue.querySelectorAll(".vf-clef"))||[]),Array.from((ue==null?void 0:ue.querySelectorAll(".vf-keysignature"))||[]),Array.from((ue==null?void 0:ue.getElementsByTagName("text"))||[])].flat();try{ge.length&&ge.forEach(Ie=>{var J;(J=Ie==null?void 0:Ie.style)==null||J.setProperty("display","none")})}catch(Ie){}const Se=((B=ue==null?void 0:ue.getBoundingClientRect)==null?void 0:B.call(ue))||{x:0,width:0,y:0,height:0};ye===0&&(l=Se.height);try{ge.length&&ge.forEach(Ie=>{var J;(J=Ie==null?void 0:Ie.style)==null||J.removeProperty("display")})}catch(Ie){}selectData.measureHeight=Se.height;let Be=Se.height-l;Be=Be>0?Be:0,re.staveBox={left:Se.x-e+"px",top:Se.y-r+Be+"px",width:Se.width+"px",height:Se.height-Be+"px"},selectData.staves.push(re)}a.push(q.MeasureNumberXML)}else if(q.multipleRestMeasures)if(state$1.isCombineRender){let ue=null;for(let Se=0;Sege.MeasureNumberXML===q.MeasureNumberXML-1);ue!=null&&ue.staveBox&&(re.staveBox={left:ue.staveBox.left,top:ue.staveBox.top,width:ue.staveBox.width},selectData.staves.push(re),a.push(q.MeasureNumberXML))}}}(($=(D=selectData.staves[0])==null?void 0:D.staveBox)==null?void 0:$.top)!==((O=(N=selectData.staves[1])==null?void 0:N.staveBox)==null?void 0:O.top)&&(selectData.staves[0].staveBox.top=((z=(Q=selectData.staves[1])==null?void 0:Q.staveBox)==null?void 0:z.top)||((xe=(W=selectData.staves[0])==null?void 0:W.staveBox)==null?void 0:xe.top)),console.log("🚀 ~ selectData.notes:",selectData.notes,selectData.staves)},Selection=defineComponent({name:"selection",setup(){const i=useRoute$1(),e={...getQuery(),...i.query},r=computed(()=>state$1.sectionStatus||state$1.modeType==="evaluating"),s=computed(()=>state$1.sectionStatus?state$1.section.map((o,a)=>{if(a===0){const l=selectData.staves.find(u=>u.MeasureNumberXML===o.MeasureNumberXML);return l&&{left:l.staveBox.left,top:l.staveBox.top,height:selectData.measureHeight+"px"}}else{const l=state$1.userChooseEndIndex>o.MeasureNumberXML?state$1.userChooseEndIndex:o.MeasureNumberXML,u=selectData.staves.find(c=>c.MeasureNumberXML===l);return u&&{left:parseFloat(u.staveBox.left)+parseFloat(u.staveBox.width)-2+"px",top:u.staveBox.top,height:selectData.measureHeight+"px"}}}):[]);return onMounted(()=>{selectData.notes=[],selectData.staves=[],calcNoteData();try{moveData.partIndex=state$1.partIndex+"",nextTick(()=>renderForMoveData())}catch(o){}}),()=>createVNode(Fragment,null,[createVNode("div",{class:styles$c.staveBgContainer},[selectData.staves.map(o=>createVNode(Fragment,null,[o.staveBox&&o.multipleRestMeasures<=1&&createVNode("div",{style:{left:o.staveBox.left,top:`calc(${o.staveBox.top} + ${o.staveBox.height})`,width:o.staveBox.width},class:[styles$c.staveBg]},null)]))]),createVNode("div",{id:"selectionBox",class:[styles$c.selectionContainer],onClick:o=>o.stopPropagation()},[selectData.staves.map((o,a)=>{var c;const l=o.id&&evaluatingData.evaluatings[o.measureListIndex],u=!state$1.isReport&&metronomeData.cursorMode===2&&o.MeasureNumberXML===((c=metronomeData.activeMetro)==null?void 0:c.measureNumberXML)&&state$1.times[state$1.activeNoteIndex].MeasureNumberXML===o.MeasureNumberXML;return createVNode(Fragment,null,[o.staveBox&&createVNode("div",{key:o.id,class:[styles$c.position,state$1.platform===IPlatform.PC&&state$1.zoom>.8?styles$c.linePC:""],style:o.staveBox,onClick:()=>handleSelection(o)},[u&&createVNode("div",{style:{height:selectData.measureHeight+"px",position:"relative"}},[createVNode("div",{class:[styles$c.line,state$1.setting.eyeProtection?styles$c.eyeLine:"",state$1.musicRenderType==EnumMusicRenderType.staff?styles$c.lineStaff:styles$c.lineJianPu],style:{left:metronomeData.activeMetro.left}},null)]),!state$1.isReport&&!!o.multipleRestMeasures&&createVNode(MultipleRestMeasures,{item:o},null),createVNode(Transition,{name:"centerTop",onAfterEnter:()=>{l.show=!1}},{default:()=>{var d,y;return[(l==null?void 0:l.show)&&createVNode("div",{class:styles$c.scoreItem,style:{color:((d=leveByScoreMeasureIcons[l.leve])==null?void 0:d.color)||""}},[createVNode("img",{src:(y=leveByScoreMeasureIcons[l.leve])==null?void 0:y.icon},null),createVNode("span",null,[l.score])])]}})])])}),selectData.notes.map(o=>createVNode("div",{class:[styles$c.position,r.value&&styles$c.disable,styles$c.note,`noteIndex_${o.index}`],style:o.bbox,onClick:()=>skipNotePlay(o.index)},[createVNode("div",{class:styles$c.noteFollow,"data-vf":"vf"+o.id},[createVNode("div",{class:[styles$c.followTipUp,"tip-up"]},[createVNode("img",{src:IntonationUp},null),createVNode("span",null,[createTextVNode("音准"),createVNode("i",null,[createTextVNode("高了")])])]),createVNode("div",{class:[styles$c.followTipDown,"tip-down"]},[createVNode("img",{src:IntonationDown},null),createVNode("span",null,[createTextVNode("音准"),createVNode("i",null,[createTextVNode("低了")])])])]),createVNode("div",{class:[styles$c.noteDot,"node-dot"]},null)])),s.value.map((o,a)=>o&&createVNode("div",{class:styles$c.selectBox,style:o},[createVNode("div",{class:[styles$c.selectHandle,a>0&&styles$c.selectHandleRight,(state$1.playState==="play"||e.workRecord)&&styles$c.playIng],onClick:()=>{state$1.section.length===2&&a===0?(state$1.section=[],resetBaseRate(state$1.activeNoteIndex),showToast({message:"请选择开始小节",duration:0,position:"top",className:"selectionToast"})):(state$1.section.splice(a,1),state$1.section=[...state$1.section],showToast({message:state$1.section.length?"请选择结束小节":"请选择开始小节",duration:0,position:"top",className:"selectionToast"}))}},null)])),e.isMove=="1"&&createVNode(MoveMusicScore,null,null)])])}}),notTouch="_notTouch_16l2s_47",styles$a={notTouch},speedInfo={"rall.":1.333333333,"poco rit.":1.333333333,"rit.":1.333333333,"molto rit.":1.333333333,"molto rall":1.333333333,molto:1.333333333,lentando:1.333333333,allargando:1.333333333,morendo:1.333333333,"accel.":.8,calando:2,"poco accel.":.8,"gradually slowing":1.333333333,slowing:1.333333333,slow:1.333333333,slowly:1.333333333,faster:1.333333333},getNextNote=(i,e)=>{var u;let r=0;const s=i.closest(e);let o=s;const a=s==null?void 0:s.closest("measure");let l=null;for(;!l&&r<((a==null?void 0:a.childNodes.length)||50);)r++,((u=o==null?void 0:o.nextElementSibling)==null?void 0:u.tagName)==="note"&&(l=o==null?void 0:o.nextElementSibling),o=o==null?void 0:o.nextElementSibling;return l},getGradualLengthByXml=i=>{var d,y,m,g;const e=new DOMParser().parseFromString(i,"text/xml"),r=Array.from(e.querySelectorAll("measure")),s=Array.from(e.querySelectorAll("note")),o=Array.from(e.querySelectorAll("words")),a=Array.from(e.querySelectorAll("metronome")),l=[];for(const v of[...o,...a]){const b=getNextNote(v,"direction");if(b){const S=b==null?void 0:b.closest("measure"),x=Array.from(S.querySelectorAll("note")),A=Array.from(S.childNodes).filter(_=>_.nodeName==="note").findIndex(_=>_===b);let E=0,w=0;for(let _=0;_v.index-b.index);const c=Object.keys(speedInfo).map(v=>v.toLocaleLowerCase());for(const v of l){let b=!1,S=0;const x=(y=v.textContent)==null?void 0:y.toLocaleLowerCase().trim();v===l[l.length-1]&&((m=u[u.length-1])==null?void 0:m.length)===1&&(b=!0);const A=c.find(E=>{const w=E.split(" ");return x&&w.includes(x)});if(v.type==="metronome"||v.type==="words"&&(x.startsWith("a tempo")||A)||b){const E=u.findIndex(w=>w.length===1);E>-1&&v.index>((g=u[E])==null?void 0:g[0].start)&&(S=-1,u[E][1]={start:v.index,measureIndex:v.measureIndex,closedMeasureIndex:v.measureIndex,noteInMeasureIndex:v.noteInMeasureIndex,allDuration:v.allDuration,leftDuration:v.leftDuration,type:x})}v.type==="words"&&A&&u.push([{start:v.index,measureIndex:v.measureIndex,closedMeasureIndex:v.measureIndex+S,noteInMeasureIndex:v.noteInMeasureIndex,allDuration:v.allDuration,leftDuration:v.leftDuration,type:x}])}return u};getQuery();const container$1=ref(),resetGivenFormate=()=>{var r,s;const e={12200:[{parts:["0","1"],tieId:["1483"]},{parts:["2"],tieId:["1463"]},{parts:["10"],tieId:["1246"]},{parts:["11"],tieId:["2455"]},{parts:["13"],tieId:["1488","1688"]},{parts:["14","15"],tieId:["1272"]},{parts:["16"],tieId:["1264","1368"],staveSection:[{id:"section-0",y:-10}]}],12420:[{parts:["0"],tieId:["1298","1405","1998","2598","3229","2731","2617"]}],7729:[{parts:["3"],tieId:["1498","1660"]}],7439:[{parts:["23"],vfmodifiers:[{id:"modifiers-130",y:-18,isLast:!0}]}],12711:[{parts:["0"],voltas:-12},{parts:["4"],voltas:-8}],3581:[{parts:["0"],voltas:-8}],6244:[{parts:["15"],stavenote:[{id:"vf-auto1608",y:-15}]}],7473:[{parts:["0"],voltas:-8}]}[state$1.cbsExamSongId];if(e){const o=state$1.partIndex+"",a=e.find(l=>l.parts.includes(o));if(!a)return;if(a.tieId&&a.tieId.length)for(let l=0;l{u.classList.add(`section-${c}`)});for(let u=0;u{u.classList.add(`modifiers-${c}`)});for(let u=0;u{u.style.transform=`translateY(${a.voltas}px)`}),a.stavenote&&a.stavenote.length)for(let l=0;l{var r,s,o,a,l,u,c,d,y,m,g,v,b;if(["1788850864767643649","1788502467554750466","1789839575249596417","1788501975122489346","1796006876341813249"].includes(state$1.cbsExamSongId)||i){const S=(r=Array.from(document.getElementsByClassName("vf-curve")))==null?void 0:r.last();if(S&&(S.style.display="none"),state$1.musicRenderType!=="staff"){const x=document.getElementById("auto2670"),A=document.getElementById("auto2710"),E=document.getElementById("auto3099"),w=document.getElementById("auto3339"),_=state$1.cbsExamSongId=="1789839575249596417"&&((o=(s=document.getElementById("vf-auto1554"))==null?void 0:s.getElementsByClassName("vf-modifier"))==null?void 0:o[0]),T=state$1.cbsExamSongId=="1789839575249596417"&&document.getElementById("vf-auto1554-lines"),C=state$1.cbsExamSongId=="1788501975122489346"&&((l=(a=document.getElementById("vf-auto2116"))==null?void 0:a.getElementsByClassName("vf-modifier"))==null?void 0:l[0]),P=state$1.cbsExamSongId=="1788501975122489346"&&document.getElementById("vf-auto2116-lines"),k=state$1.cbsExamSongId=="1788502467554750466"&&((c=(u=document.getElementById("vf-auto2122"))==null?void 0:u.getElementsByClassName("vf-modifier"))==null?void 0:c[0]),M=state$1.cbsExamSongId=="1788502467554750466"&&document.getElementById("vf-auto2122-lines");if(x&&(x.style.display="none"),A&&(A.style.display="none"),E&&(E.style.display="none"),w&&(w.style.display="none"),_&&(_.style.transform="translateX(-0.65rem)"),C&&(C.style.transform="translateX(-0.65rem)"),k&&(k.style.transform="translateX(-0.65rem)"),T&&(T.style.transform="translateX(-0.65rem)"),P&&(P.style.transform="translateX(-0.65rem)"),M&&(M.style.transform="translateX(-0.65rem)"),T||P||M){const R=T?T.querySelector("path"):P?P.querySelector("path"):M?M.querySelector("path"):null;let H=R==null?void 0:R.getAttribute("d");if(H){const B=(m=(y=(d=H.split("L"))==null?void 0:d.last())==null?void 0:y.split(" "))==null?void 0:m[0];let F=((v=(g=H.split("M"))==null?void 0:g[1])==null?void 0:v.split(" ")[0])||0;F=F?Number(F):0;let I=((b=H.split("L"))==null?void 0:b.last().split(" ")[0])||0;I=I?Number(I):0;const U=I-F,D=F-U;H=H.replace(`L${B}`,`L${D}`),R.setAttribute("d",H)}}}}},resetFormate=()=>{var s,o,a;if(container$1.value=document.getElementById("scrollContainer"),!container$1.value)return;moveGracePosition();const i=Array.from(container$1.value.querySelectorAll(".staffline")),e=4,r=28;for(let l=0,u=i.length;l .vf-voices")),b=Array.from(c.querySelectorAll(".vf-measure > .vf-beams")),S=Array.from(c.querySelectorAll(".vf-ties")),x=Array.from(c.querySelectorAll(".vf-line")),A=Array.from(c.querySelectorAll(".vf-measure > .vf-stave text"));Array.from(c.querySelectorAll(".vf-measure > .vf-stave rect[fill=none]"));const E=Array.from(c.querySelectorAll(".vf-measure .vf-staveSection")),w=Array.from(c.querySelectorAll(".vf-measure > .vf-stave path")),_=Array.from(c.querySelectorAll(".vf-measure .vf-stopDot")),T=Array.from(c.querySelectorAll(".vf-measure > .vf-stave")),C=((s=w[0])==null?void 0:s.getBBox().y)||0,P=["To Coda","D.S. al Coda","Coda"];A.filter(D=>P.includes(D.textContent||"")).forEach(D=>{b.forEach($=>{var Q;const N=collisionDetection(D,$),O=D==null?void 0:D.previousSibling;if(N.isCollision){const z=Number(D.getAttribute("y"))-(N.b1-N.t2)-e+"";D.setAttribute("y",z),O&&O.getAttribute("stroke-width")==="0.3"&&O.getAttribute("stroke")==="none"&&(((Q=O.getAttribute("d"))==null?void 0:Q.length)||0)>3e3&&(O.style.transform=`translateY(${-(N.b1-N.t2+e)}px)`)}}),v.forEach($=>{var Q;const N=collisionDetection(D,$),O=D==null?void 0:D.previousSibling;if(N.isCollision){const z=Number(D.getAttribute("y"))-(N.b1-N.t2)-e+"";D.setAttribute("y",z),O&&O.getAttribute("stroke-width")==="0.3"&&O.getAttribute("stroke")==="none"&&(((Q=O.getAttribute("d"))==null?void 0:Q.length)||0)>3e3&&(O.style.transform=`translateY(${-(N.b1-N.t2+e)}px)`)}})}),E.forEach(D=>{let $=0;[...g,...S,...v].forEach(N=>{const O=collisionDetection(D,N);O.isCollision&&($=Math.min($,O.t2-O.b1-e))}),D.style.transform=`translateY(${$}px)`});let k=Array.from(c.querySelectorAll(".vf-text > text")).filter(D=>D.getBBox().y text")).filter(D=>D.getBBox().y{const $=D.getBBox();$.y1&&R.forEach(D=>{D.setAttribute("y",M+"")}),k.forEach(D=>{[...g,...m,...x].forEach($=>{let N=collisionDetection(D,$);if(N.isCollision&&N.b1{k.forEach($=>{if(D.parentNode!==$.parentNode&&!["marcato","legato"].includes(D.textContent))if(["marcato","legato"].includes($.textContent)){if(collisionDetection(D,$,30,30).isCollision){const O=D.getBBox();$.setAttribute("x",O.x+O.width+5+""),$.setAttribute("y",O.y+O.height-5+"")}}else{const N=collisionDetection(D,$);if(N.isCollision){const O=Number(D.getAttribute("y")),Q=N.b2-N.t2<24?24:N.b2-N.t2;$.setAttribute("y",O-Q-.5+"")}}})});const H=["C","G","D","A","E","B","F#","C#","G#","F","Bb","Eb","Ab","Db","Gb","Cb","Fb","D#","A#","E#"],B=["Bb","Eb","Ab","Db","Gb","Cb","Fb"],F=["F#","C#","G#","D#","A#","E#","B#"];k.forEach(D=>{const $=D.textContent;if(H.includes($)){const N=Number(D.getAttribute("y")),O=C?C-r:N;D.setAttribute("y",O)}B.includes($)&&(D.textContent=$.replace("b","♭")),F.includes($)&&(D.textContent=$.replace("#","♯"))}),_.forEach(D=>{state$1.musicRenderType==="fixedTone"?D.setAttribute("transform","translate(3,-12)"):D.setAttribute("transform","translate(3,-7)")});const I=Array.from(c.querySelectorAll(".vf-text > text")).filter(D=>D.getBBox().y>y),U=Array.from(c.querySelectorAll(".vf-line")).filter(D=>D.getBBox().y>y);for(let D=0;D{[...m].forEach($=>{let N=collisionDetection(D,$);N.isCollision&&D.setAttribute("y",N.b2+Math.abs(N.t1-Number(D.getAttribute("y")))+"")})}),U.forEach(D=>{var N;const $=[];if((N=D.nextElementSibling)!=null&&N.classList.contains("vf-line")&&I.forEach(O=>{let Q=collisionDetection(D,O,20,20);Q.isCollision&&$.push({text:O,result:Q})}),$.length===1){const O=$[0].result,Q=$[0].text;O.x2+O.w2O.x1+O.w1?Math.abs(O.y2-O.y1)>10&&Q.setAttribute("y",O.y1+O.h2/2+""):Math.abs(O.x2-O.x1)10&&Q.setAttribute("y",O.y1+O.h2/2+"")):(Q.setAttribute("x",O.x1+O.w1+5+""),Math.abs(O.y2-O.y1)>10&&Q.setAttribute("y",O.y1+O.h2/2+""))}else if($.length===2){const O=$[0].result,Q=$[0].text,z=$[1].result,W=$[1].text;Q.setAttribute("x",O.x1-O.w2-5+""),Math.abs(O.y2-O.y1)>10&&Q.setAttribute("y",O.y1+O.h2/2+""),W.setAttribute("x",z.x1+z.w1+5+""),Math.abs(z.y2-z.y1)>10&&W.setAttribute("y",z.y1+z.h2/2+"")}}),I.forEach(D=>{I.forEach($=>{if(D.parentNode!==$.parentNode&&!["marcato","legato","cresc.","Cantabile"].includes(D.textContent))if(["marcato","legato","cresc.","Cantabile"].includes($.textContent)){if(collisionDetection(D,$,30,30).isCollision){const O=D.getBBox();$.setAttribute("x",O.x+O.width+5+""),$.setAttribute("y",O.y+O.height-5+"")}}else{const N=collisionDetection(D,$);N.isCollision&&$.setAttribute("y",N.y1+N.h1+N.h2+"")}})});for(let D=0;D{const N=[Array.from((D==null?void 0:D.getElementsByTagName("text"))||[]),Array.from((D==null?void 0:D.querySelectorAll(".vf-StaveSection"))||[]),Array.from((D==null?void 0:D.querySelectorAll(".vf-Volta"))||[]),Array.from((D==null?void 0:D.querySelectorAll(".vf-clef"))||[]),Array.from((D==null?void 0:D.querySelectorAll(".vf-keysignature"))||[]),Array.from((D==null?void 0:D.querySelectorAll(".vf-Repetition"))||[])].flat();try{N.length&&N.forEach(q=>{var re;q.parentNode===D&&(D==null||D.removeChild(q),(re=q==null?void 0:q.style)==null||re.setProperty("display","none"))})}catch(q){}const O=(D==null?void 0:D.getBBox())||{},Q=state$1.isEvaluatReport?"#132D4C":"#609FCF",z=state$1.isEvaluatReport?"#040D1E":"#2B70A5",W=``,xe=``,ye=`${W}${xe}`;try{N.length&&N.forEach(q=>{var re;D==null||D.appendChild(q),(re=q==null?void 0:q.style)==null||re.removeProperty("display")})}catch(q){}D.innerHTML=ye+D.innerHTML}),state$1.vfmeasures=state$1.vfmeasures.concat(m))}!state$1.isCombineRender&&state$1.isSingleLine&&transSinglePage()},transSinglePage=()=>{var i,e;if(state$1.isSingleLine&&!state$1.isSimplePage){const r=(i=document==null?void 0:document.getElementById("osmdSvgPage1"))==null?void 0:i.getBoundingClientRect(),s=(e=document==null?void 0:document.querySelector(".staffline"))==null?void 0:e.getBoundingClientRect();if(r&&s&&r.height>200){const o=r.height>400?1.2:2,a=(r.height-s.height)/o;document.getElementById("osmdSvgPage1").style.transform=`translateY(-${a}px)`}}},collisionDetection=(i,e,r=0,s=0)=>{const o=i.getBBox(),a=e.getBBox();let l=o.y-s,u=o.x-r,c=o.x+o.width+r,d=o.y+o.height+s,y=a.y,m=a.x,g=a.x+a.width,v=a.y+a.height;return dg||l>v||c{const i=state$1.partIndex+"",r=[{id:"12644",part_index:"25",direction:1}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i);setGlobalData("tieDirection",r?r.direction:void 0);const o=[{id:"3509",part_index:"16",direction:1}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i);o&&setGlobalData("graceCustom",{direction:o.direction});const l=[{id:"3030",part_index:"17",line:4},{id:"12704",part_index:"23",line:3}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i);l&&setGlobalData("customBassDrum",l.line);const c=[{id:"11654",part_index:"16",stemNotes:[{id:124,direction:0},{id:125,direction:0},{id:126,direction:0},{id:127,direction:0},{id:128,direction:0}]},{id:"3581",part_index:"4",stemNotes:[{id:380,direction:1}]},{id:"3470",part_index:"0",stemNotes:[{id:36,direction:1},{id:37,direction:1}]},{id:"3470",part_index:"11",stemNotes:[{id:33,direction:1},{id:56,direction:1}]},{id:"12644",part_index:"22",stemNotes:[{id:22,direction:1},{id:26,direction:1},{id:135,direction:1},{id:163,direction:1},{id:199,direction:1},{id:204,direction:1},{id:206,direction:1},{id:208,direction:1},{id:210,direction:1},{id:213,direction:1}]},{id:"12303",part_index:"18",stemNotes:[{id:1,direction:1},{id:4,direction:1},{id:6,direction:1},{id:9,direction:1},{id:12,direction:1},{id:14,direction:1}]},{id:"12669",part_index:"24",stemNotes:[{id:65,direction:1},{id:296,direction:1},{id:298,direction:1},{id:300,direction:1},{id:338,direction:1}]},{id:"12420",part_index:"21",stemNotes:[{id:614,direction:0},{id:617,direction:0},{id:619,direction:0},{id:621,direction:0}]},{id:"12711",part_index:"22",stemNotes:[]},{id:"12973",part_index:"21",stemNotes:[{id:619,direction:1},{id:622,direction:1},{id:745,direction:1}]}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i);c&&setGlobalData("stemDirectionNote",c.stemNotes);const y=[{id:"12711",part_index:"4",vfcurve:[{MeasureNumberXML:25,index:1,bezierEndControlPt:{y:-2}},{MeasureNumberXML:33,index:1,bezierEndControlPt:{y:-2}}]},{id:"12059",part_index:"0",vfcurve:[{MeasureNumberXML:15,bezierEndControlPt:{y:2.8},bezierEndPt:{y:1.1}},{MeasureNumberXML:16,bezierEndControlPt:{y:-1}},{MeasureNumberXML:19,index:1,bezierEndControlPt:{y:2}},{MeasureNumberXML:20,bezierEndControlPt:{y:-1}},{MeasureNumberXML:42,index:1,bezierEndControlPt:{y:-1.5},bezierStartControlPt:{y:-1.5}},{MeasureNumberXML:46,index:3,bezierEndControlPt:{y:-1.5},bezierStartControlPt:{y:-1.5}}]},{id:"12668",part_index:"11",vfcurve:[{MeasureNumberXML:8,index:2,bezierEndControlPt:{y:-3},bezierStartControlPt:{y:-3},bezierEndPt:{y:-1}}]},{id:"11976",part_index:"0",vfcurve:[{MeasureNumberXML:14,index:4,bezierEndControlPt:{y:-3}},{MeasureNumberXML:14,index:1,bezierEndPt:{y:1.5},bezierEndControlPt:{y:1}}]}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i);y&&setGlobalData("vfcurveItem",y.vfcurve),[{id:"12644",part_index:"25"}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i)&&setGlobalData("customArtPosition",!0),[{id:"12645",part_index:"5"}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i)&&setGlobalData("customTenutoItem",!0),([{id:"12711",part_index:"22"},{id:"12711",part_index:"25"}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i)||state$1.isEvxml)&&setGlobalData("customAccentItem",!0),[{id:"12711",part_index:"25"},{id:"7755",part_index:"10"},{id:"6226",part_index:"16"}].find(({id:w,part_index:_})=>w==state$1.cbsExamSongId&&_==i)&&setGlobalData("customLefthandpizzicatoItem",!0)},musicRenderTypeKey="musicRenderType";let osmd=null;const musicData=reactive({showSelection:!1,isRenderLoading:!0,score:"",containerWidth:0,isRefreshLoading:!1}),resetRenderMusicScore=i=>{const e=queryString.parse(location.search),r=queryString.stringify({...e,_t:Date.now(),musicRenderType:i,isSingleLine:state$1.isSingleLine});location.search="?"+r},downloadXmlStr=ref(""),MusicScore=defineComponent({name:"music-score",emits:["rendered"],props:{showSelection:{type:Boolean,default:!0},renderTypeKey:{type:String,default:""},musicColor:{type:String,default:""},showPartNames:{type:Boolean,default:!1}},setup(i,{emit:e,slots:r,expose:s}){const o=async()=>{const d=downloadXmlStr.value||await fetch(state$1.xmlUrl).then(m=>m.text());downloadXmlStr.value="";const y=formatXML(d);musicData.score=state$1.isCombineRender?y:onlyVisible(y,state$1.partIndex),state$1.gradualTimes&&(state$1.gradual=getGradualLengthByXml(y))},a=async()=>{console.time("渲染加载耗时");const d=document.getElementById("musicAndSelection");if(!(!d||!musicData.score)){if(setGlobalMusicSheet(),osmd=new OpenSheetMusicDisplay(d,{drawTitle:!1,drawSubtitle:!1,autoResize:!1,followCursor:!1,drawPartNames:i.showPartNames,drawLyricist:!1,drawComposer:!1,defaultColorMusic:i.musicColor,renderSingleHorizontalStaffline:!!state$1.isSingleLine,autoGenerateMultipleRestMeasuresFromRestMeasures:!0,drawLyrics:(!state$1.accompany&&!state$1.music||state$1.playType==="sing")&&!state$1.isSimplePage,colorStemsLikeNoteheads:!0}),state$1.isSimplePage?(osmd.EngravingRules.PageTopMargin=state$1.musicRenderType==="staff"?2:4,osmd.EngravingRules.PageTopMarginNarrow=0,osmd.EngravingRules.PageLeftMargin=3.6,osmd.EngravingRules.PageRightMargin=0,osmd.EngravingRules.BreathMarkDistance=.1,osmd.EngravingRules.PageBottomMargin=0):(osmd.EngravingRules.PageTopMargin=state$1.isPreView?1:3,osmd.EngravingRules.PageTopMarginNarrow=3,osmd.EngravingRules.PageLeftMargin=3.6,osmd.EngravingRules.PageRightMargin=3,osmd.EngravingRules.BreathMarkDistance=.1,osmd.EngravingRules.PageBottomMargin=state$1.isSingleLine?2:18),osmd.EngravingRules.DYMusicScoreType=state$1.musicRenderType===EnumMusicRenderType.staff?"staff":"jianpu",state$1.musicRenderType===EnumMusicRenderType.fixedTone?window.sett={keySignature:!0}:window.sett={keySignature:!1},osmd.EngravingRules.DYMusicScoreId=state$1.examSongId||"",osmd.EngravingRules.DYCustomRepeatCount=state$1.maxLyricNum||0,await osmd.load(musicData.score),state$1.isSimplePage&&(state$1.zoom=.5),!state$1.isSimplePage&&state$1.isCombineRender)for(let y=0;y{var d;musicData.containerWidth=((d=document.getElementById("musicAndSelection"))==null?void 0:d.offsetWidth)||625};onMounted(async()=>{l(),await o(),await a(),musicData.isRenderLoading=!1});const u=computed(()=>{var m;let d=!1;const y=((m=state$1.times[state$1.activeNoteIndex])==null?void 0:m.measureListIndex)||-1;for(const[g,v]of state$1.gradual)if(g&&v&&(d=g.measureIndex<=y&&y{console.log("刷新谱面123");const d=document.getElementById("musicAndSelection"),y=document.getElementById("osmdCanvasPage1"),m=document.getElementById("selectionBox");d&&y&&(d==null||d.removeChild(y),d==null||d.removeChild(m)),state$1.vfmeasures=[],musicData.showSelection=!1,state$1.osmd.clear(),musicData.isRenderLoading=!0,musicData.isRefreshLoading=!0,state$1.loadingText="正在加载中,请稍等…",state$1.isLoading=!0,requestAnimationFrame(async()=>{l(),await o(),await a(),musicData.isRenderLoading=!1,musicData.isRefreshLoading=!1,state$1.isLoading=!1,musicData.showSelection=!0})}}),()=>{var d;return createVNode("div",{id:"musicAndSelection",style:{"--music-zoom":state$1.musicZoom},class:[u.value&&styles$a.inGradualRange,state$1.musicRenderType==EnumMusicRenderType.staff?"staff":"jianpuTone",state$1.isSingleLine&&"singleLineMusicBox",!state$1.isCreateImg&&!state$1.isPreView&&state$1.musicRenderType===EnumMusicRenderType.staff?"blueMusicXml":"",state$1.isSingleLine&&state$1.playState==="play"&&styles$a.notTouch]},[(d=r.default)==null?void 0:d.call(r),i.showSelection&&musicData.showSelection&&!state$1.isPreView&&!state$1.isEvaluatReport&&!state$1.isSimplePage&&createVNode(Selection,null,null)])}}}),skeleton="_skeleton_51b96_1",detail$1="_detail_51b96_16",pageBg="_pageBg_51b96_24",headHeight="_headHeight_51b96_33",headHide="_headHide_51b96_41",container="_container_51b96_50",fingeringCon="_fingeringCon_51b96_62",xiaomi="_xiaomi_51b96_87",PC="_PC_51b96_91",preViewDetail="_preViewDetail_51b96_116",preJson="_preJson_51b96_143",loadingPop="_loadingPop_51b96_155",isPreView="_isPreView_51b96_170",loadingTip$1="_loadingTip_51b96_173",lottie="_lottie_51b96_176",bg2Left="_bg2Left_51b96_183",bg2Right="_bg2Right_51b96_189",headerDown="_headerDown_51b96_1",styles$9={skeleton,detail:detail$1,pageBg,headHeight,headHide,container,fingeringCon,xiaomi,PC,preViewDetail,preJson,loadingPop,isPreView,loadingTip:loadingTip$1,lottie,bg2Left,bg2Right,headerDown},fingeringContainer$1="_fingeringContainer_5z951_1",emptyDom="_emptyDom_5z951_10",vertical="_vertical_5z951_19",imgs$1="_imgs_5z951_23",hulusiTop="_hulusiTop_5z951_26",rightContent="_rightContent_5z951_43",yidiao="_yidiao_5z951_87",tizhi$1="_tizhi_5z951_94",canDisplay$1="_canDisplay_5z951_110",activeopacity="_activeopacity_5z951_1",leftrotates="_leftrotates_5z951_1",rightrotates="_rightrotates_5z951_1",styles$8={fingeringContainer:fingeringContainer$1,emptyDom,vertical,imgs:imgs$1,hulusiTop,rightContent,yidiao,tizhi:tizhi$1,canDisplay:canDisplay$1,activeopacity,leftrotates,rightrotates},relationships={flute:{59:[27,26,25,15,24,22,17,20],60:[27,26,25,15,24,22,17,20],61:[27,26,25,15,24,22,17,21],62:[27,26,25,15,24,22,17],63:[27,26,25,15,24,22,17,19],64:[27,26,25,15,24,22,19],65:[27,26,25,15,24,19],66:[27,26,25,15,17,19],67:[27,26,25,15,19],68:[27,26,25,15,18,19],69:[27,26,15,19],70:[[27,14,19],[27,24,15,19]],71:[27,15,19],72:[27,19],73:[19],74:[26,25,24,22,17,15],75:[26,25,24,22,17,19,15],76:[27,26,25,15,24,22,19],77:[27,26,25,15,24,19],78:[27,26,25,15,17,19],79:[27,26,25,15,19],80:[27,26,25,15,18,19],81:[27,26,15,19],82:[[27,14,19],[27,24,15,19]],83:[27,15,19],84:[27,19],85:[19],86:[26,25,15,19],87:[27,26,25,15,24,22,17,18,19],88:[27,26,15,24,22,19],89:[27,25,24,15,19],90:[27,25,17,15,19],91:[27,26,25,19],92:[26,25,18,19],93:[26,24,15,19],94:[23,24,15,19],95:[27,25,15,16],96:[27,26,25,18,24,19]},clarinet:{52:[[3,4,6,8,9,11,14,18,20],[3,4,6,8,9,11,14,20]],53:[[3,4,6,8,9,11,12,20],[3,4,6,8,9,11,18,20]],54:[[3,4,6,8,9,11,13,18,20],[3,4,6,8,9,11,13,20],[3,4,6,8,9,11,15]],55:[3,4,6,8,9,11,20],56:[3,4,6,8,9,11,16,20],57:[3,4,6,8,9,20],58:[3,4,6,8,20],59:[[3,4,6,9,20],[3,4,6,8,10,20]],60:[3,4,6,20],61:[3,4,6,7,20],62:[3,4,20],63:[[3,4,20,24],[3,4,5,20],[3,8,20]],64:[3,20],65:[20],66:[[3],[20,23,24]],67:[],68:[2],69:[1],70:[1,19],71:[[3,4,6,8,9,11,14,18,19,20],[3,4,6,8,9,11,14,19,20]],72:[[3,4,6,8,9,11,12,19,20],[3,4,6,8,9,11,18,19,20]],73:[[3,4,6,8,9,11,13,19,20],[3,4,6,8,9,11,13,18,19,20],[3,4,6,8,9,11,15,19,20]],74:[3,4,6,8,9,11,19,20],75:[3,4,6,8,9,11,16,19,20],76:[3,4,6,8,9,19,20],77:[3,4,6,8,19,20],78:[[3,4,6,9,19,20],[3,4,6,8,10,19,20]],79:[3,4,6,19,20],80:[3,4,6,7,19,20],81:[3,4,19,20],82:[[3,4,19,20,24],[3,4,5,19,20],[3,4,8,19,20]],83:[3,19,20],84:[19,20],85:[4,6,8,9,19,20],86:[4,6,8,16,19,20],87:[[4,6,8,10,16,19,20],[4,6,9,16,19,20]],88:[4,6,16,19,20],89:[4,6,7,16,19,20]},trumpet:{0:[1,2,3],54:[4,5,6],55:[4,2,6],56:[1,5,6],57:[4,5,3],58:[4,2,3],59:[1,5,3],60:[1,2,3],61:[4,5,6],62:[4,2,6],63:[1,5,6],64:[4,5,3],65:[4,2,3],66:[1,5,3],67:[1,2,3],68:[1,5,6],69:[4,5,3],70:[4,2,3],71:[1,5,3],72:[1,2,3],73:[4,5,3],74:[4,2,3],75:[1,5,3],76:[1,2,3],77:[4,2,3],78:[1,4,3],79:[1,2,3],80:[1,5,6],81:[4,5,3],82:[4,2,3],83:[1,5,3],84:[1,2,3]},horn:{53:[1],54:[2],55:[],56:[2,3],57:[1,2],58:[1],59:[2],60:[],61:[1,2],62:[1],63:[2],64:[],65:[1],66:[2],67:[],68:[0,2,3],69:[0,1,2],70:[0,1],71:[0,2],72:[0],73:[0,2,3],74:[0,1,2],75:[0,1],76:[0,2],77:[0],78:[0,2],79:[0],80:[0,2,3],81:[0,1,2],82:[0,1],83:[0,2],84:[0]},"up-bass-horn":{0:[1,2,3],40:[4,5,6],41:[4,2,6],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,6],48:[4,2,6],49:[1,5,6],50:[4,5,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3],59:[4,5,3],60:[4,2,3],61:[1,5,3],62:[1,2,3],63:[4,2,3],64:[1,5,3],65:[1,2,3],66:[1,5,6],67:[4,5,3],68:[4,2,3],69:[1,5,3],70:[1,2,3]},trombone:{0:[1],40:[22],41:[11],42:[5],43:[4],44:[3],45:[2],46:[1],47:[22],48:[11],49:[5],50:[4],51:[3],52:[2],53:[1],54:[5],55:[4],56:[3],57:[2],58:[1],59:[4],60:[3],61:[2],62:[1],63:[3],64:[2],65:[1],66:[5],67:[4],68:[3],69:[2],70:[1]},saxophone:{58:[2,4,5,13,17,18,19,23],59:[2,4,5,11,17,18,19,23],60:[2,4,5,17,18,19,23],61:[2,4,5,12,17,18,19,23],62:[2,4,5,17,18,19],63:[2,4,5,17,18,19,22],64:[2,4,5,17,18],65:[2,4,5,17],66:[[2,4,5,18],[2,4,5,17,21]],67:[2,4,5],68:[2,4,5,10],69:[2,4],70:[[2,4,16],[2,17],[2,3]],71:[2],72:[[4],[2,15]],73:[],74:[2,4,5,6,17,18,19],75:[2,4,5,6,17,18,19,22],76:[2,4,5,6,17,18],77:[2,4,5,6,17],78:[[2,4,5,6,18],[2,4,5,6,17,21]],79:[2,4,5,6],80:[2,4,5,6,10],81:[2,4,6],82:[[2,4,6,16],[2,6,17],[2,3,6]],83:[2,6],84:[[4,6],[2,6,15]],85:[6],86:[6,9],87:[6,7,8],88:[6,8,9,14],89:[[6,7,8,9,14],[1,4,6]]},tuba:{0:[1,2,3],28:[4,5,6],29:[4,2,6],30:[1,5,6],31:[4,5,3],32:[4,2,3],33:[4,2,6],34:[1,2,3],35:[4,5,6],36:[4,2,6],37:[1,5,6],38:[4,5,3],39:[4,2,3],40:[1,5,3],41:[1,2,3],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,3],48:[4,2,3],49:[1,5,3],50:[1,2,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3]},piccolo:{60:[11,2,33,4,5,6,7,8],61:[11,2,33,4,5,6,7,88],62:[11,2,33,4,5,6,7],63:[11,2,33,4,5,6,77],64:[11,2,33,4,5,6],65:[11,2,33,4,5],66:[11,2,33,4,6,7],67:[11,2,33,4],68:[11,2,33,5,6,77],69:[11,2,33],70:[[11,2,4,5],[1,11,2,4,6,7]],71:[[11,2],[11,33,4]],72:[11,33],73:[[2,33],[11]],74:[33],75:[33,4,5,6,7],76:[1,2,33,4,5,6],77:[1,2,33,4,5],78:[1,2,33,4,6,8],79:[1,2,33,4],80:[1,2,33,4,6,7,8],81:[1,2,33],82:[1,2,33,5,6,7],83:[1,2,33,5,6],84:[1,2,5,6],85:[1,2,4,5,7,8,100],86:[1,2,4,5,7,8]},"small-drum":{0:["active","active-left","active-right"],64:["left","right"]},hulusi:{64:[7,6,5,4,3,2,11,91],65:[7,6,5,4,3,2,1,91],66:[7,6,5,4,3,2,91],67:[7,6,5,4,3,2,11,92],68:[7,6,5,4,3,2,1,92],69:[7,6,5,4,3,2,93],70:[7,6,5,4,3,11,93],71:[7,6,5,4,3,93],72:[7,6,5,4,95],73:[7,6,5,3,2,95],74:[7,6,5,95],75:[7,6,4,3,95],76:[7,6,95],77:[7,5,4,3,2,94],78:[7,5,4,94],79:[7,94],80:[6,94],81:[96]},pan:{55:[21],57:[20],59:[19],60:[18],62:[17],64:[16],65:[15],67:[14],69:[13],71:[12],72:[11],74:[10],76:[9],77:[8],79:[7],81:[6],83:[5],84:[4],86:[3],88:[2],89:[1]},ocarina:{57:[1,2,3,4,5,6,7,8,9,10,11,12],58:[1,2,3,4,5,6,8,9,10,11,12],59:[1,2,4,5,6,7,8,9,10,11,12],60:[1,2,4,5,6,8,9,10,11,12],61:[1,2,4,5,6,7,8,9,11,12],62:[1,2,4,5,6,8,9,11,12],63:[1,2,4,5,6,9,11,12],64:[1,2,4,5,6,8,11,12],65:[1,2,4,5,6,11,12],66:[1,2,4,6,9,11,12],67:[1,2,4,6,11,12],68:[1,2,6,9,11,12],69:[1,2,6,11,12],70:[1,6,9,11,12],71:[1,6,11,12],72:[6,11,12],73:[6,9,12],74:[6,12],75:[6,9],76:[6],77:[]},melodica:{53:[1],54:[101],55:[2],56:[102],57:[3],58:[103],59:[4],60:[5],61:[104],62:[6],63:[105],64:[7],65:[8],66:[106],67:[9],68:[107],69:[10],70:[108],71:[11],72:[12],73:[109],74:[13],75:[110],76:[14],77:[15],78:[111],79:[16],80:[112],81:[17],82:[113],83:[18],84:[19]},baroqueRecorder:{60:[11,2,33,4,5,6,7,8],61:[11,2,33,4,5,6,7,88],62:[11,2,33,4,5,6,7],63:[11,2,33,4,5,6,77],64:[11,2,33,4,5,6],65:[11,2,33,4,5,7,8],66:[11,2,33,4,6,7],67:[11,2,33,4],68:[11,2,33,5,6,77],69:[11,2,33],70:[11,2,4,5],71:[11,2],72:[11,33],73:[2,33],74:[33],75:[33,4,5,6,7],76:[1,2,33,4,5,6],77:[1,2,33,4,5,7],78:[1,2,33,4,6],79:[1,2,33,4],80:[1,2,33,5],81:[1,2,33],82:[1,2,33,5,6,7],83:[1,2,33,5,6],84:[1,2,5,6],85:[1,2,4,5,7,8,100],86:[1,2,4,5,7,8],87:[1,2,4],88:[1,2,33,4,5,6],89:[1,2,33,4,5,7],90:[1,2,33,4,6],91:[1,2,33,4],92:[1,2,33,5],93:[1,2,33],94:[1,2,33,5,6,7],95:[1,2,33,5,6],96:[1,2,5,6],97:[1,2,4,5,7,8],98:[1,2,4]}},mappingVoicePart=(i,e)=>{if(e==="GYM")return Number(i);if(e==="COLEXIU")return{Flute:2,Clarinet:4,Trombone:14,Tuba:17,Trumpet:12,Horn:13,AltoSaxophone:6,TenorSaxophone:6,Saxophone:6,UpBassHorn:15,Melodica:137,HulusiFlute:136,PanFlute:135,Ocarina:134,Recorder:120,Ukulele:130,Mouthorgan:140,Piano:150}[i];if(e==="ORCHESTRA")return{1:23,2:2,3:5,4:4,5:12,6:14,7:13,8:15,9:17}[i];if(e==="INSTRUMENT"){let r=i;return typeof r=="string"&&(r=r.toLocaleLowerCase().replace(/ /g,"")),{flute:2,clarinet:4,trombone:14,tuba:17,trumpet:12,horn:13,altosaxophone:6,tenorsaxophone:6,saxophone:6,upbasshorn:15,hulusiFlute:136,panflute:135,recorder:120,ukulele:130,mouthorgan:140,piano:150,baroquerecorder:"baroque-recorder",4:"piccolo",3:"hulusi-flute",1:"pan-flute",2:"ocarina",5:"melodica",23:2,24:6,25:4,26:12,27:14,28:13,29:15,30:17,tenorrecorder:"piccolo",germanrecorder:"piccolo",woodwind:"hulusi-flute",hulusi:"hulusi-flute",panpipes:"pan-flute",ocarina:"ocarina",altoocarina:"ocarina",whistling:"whistling",nai:"melodica",melodica:"melodica",15:"baroque-recorder",16:"baroque-recorder"}[r]||0}else if(e==="ENSEMBLE"){let r=i;const s={Piccolo:"piccolo",Flute:2,"Flute 1":2,"Flute 2":2,Oboe:1,"Clarinet in Bb 1":4,"Clarinet in Bb 2":4,"Alto Clarinet in Eb":4,"Bass Clarinet in Bb":4,Bassoon:1,"Alto Saxophone":5,"Tenor Saxophone":5,"Baritone Saxophone":5,"Trumpet in Bb 1":12,"Trumpet in Bb 2":12,"Horn in F":13,"Horn in F 1":13,"Horn in F 2":13,"Trombone 1":14,"Trombone 2":14,"Trombone 3":14,Euphonium:15,Tuba:17,Chimes:1,Bells:1,Xylophone:1,"Snare Drum":1,"Bass Drum":1,Triangle:1,"Suspended Cymbal":1,"Crash Cymbals":1,"Concert Toms":1,Timpani:1,flute:2,oboe:4,clarinet:4,trombone:14,tuba:17,trumpet:12,horn:13,altosaxophone:6,tenorsaxophone:6,saxophone:6,upbasshorn:15,melodica:137,hulusiFlute:136,panflute:135,recorder:120,ukulele:130,mouthorgan:140,piano:150,4:"piccolo",3:"hulusi-flute",1:"pan-flute",2:"ocarina",5:"melodica",26:12,tenorrecorder:"piccolo",woodwind:"hulusi-flute",panpipes:"pan-flute",ocarina:"ocarina",nai:"melodica",BaroqueRecorder:"baroque-recorder"};let o;if(typeof r=="string"){for(let a in s)if(a===r){o=s[a];break}}else o=s.code;return o}return 0},subjectFingering=i=>{switch(i){case 2:return{name:"flute",direction:"transverse",height:"1.6rem",scaleData:{scale:"0.8",offset:"3.64rem"},hasTizhi:!0,id:1};case 4:return{name:"clarinet",direction:"vertical",width:"3rem",hasTizhi:!0,id:3};case 5:case 6:return{name:"saxophone",direction:"vertical",width:"4.34rem",hasTizhi:!0,id:5};case 12:return{name:"trumpet",direction:"transverse",height:"1.6rem",scaleData:{scale:"0.8",offset:"3.64rem"},hasTizhi:!1,id:11};case 13:return{name:"horn",direction:"vertical",width:"4.98rem",hasTizhi:!1,id:12};case 14:return{name:"trombone",direction:"transverse",height:"1.6rem",scaleData:{scale:"0.8",offset:"3.64rem"},hasTizhi:!1,id:13};case 15:return{name:"up-bass-horn",direction:"vertical",width:"4.34rem",hasTizhi:!1,id:14};case 17:return{name:"tuba",direction:"vertical",width:"4.34rem",hasTizhi:!1,id:16};case 120:return{name:"piccolo",direction:"vertical",width:"3rem",orientation:0,hasTizhi:!0,id:2};case"piccolo":return{name:"piccolo",direction:"vertical",width:"3rem",orientation:0,code:"竖笛",hasTizhi:!0,id:37};case"hulusi-flute":return{name:"hulusi-flute",direction:"vertical",width:"3rem",orientation:0,code:"葫芦丝",hasTizhi:!1,id:35};case"pan-flute":return{name:"pan-flute",direction:"transverse",height:"2rem",scaleData:{scale:"0.8",offset:"3.64rem"},disabledFinger:!0,orientation:0,code:"排箫",hasTizhi:!1,id:33};case"ocarina":return{name:"ocarina",direction:"vertical",width:"3rem",disabledFinger:!0,orientation:0,code:"陶笛",hasTizhi:!1,id:34};case"whistling":return{name:"whistling",direction:"vertical",width:"3rem",disabledFinger:!0,orientation:0,code:"陶笛",hasTizhi:!1,id:39};case 137:case"melodica":return{name:"melodica",direction:"transverse",height:"2rem",scaleData:{scale:"0.8",offset:"3.64rem"},orientation:0,code:"口风琴",hasTizhi:!1,id:36};case"baroque-recorder":return{name:"baroque-recorder",direction:"vertical",width:"3rem",orientation:0,code:"竖笛",hasTizhi:!0,id:38};default:return typeof i=="number"?{id:i}:{}}},getFingeringConfig=async(i,e)=>{switch(i){case"flute":return{json:(await __vitePreload(()=>import("./index-7f22768f.js"),[],import.meta.url)).default,relationship:relationships.flute,height:"60px",styles:{}};case"clarinet":return{json:(await __vitePreload(()=>import("./index-2499965c.js"),[],import.meta.url)).default,relationship:relationships.clarinet,styles:{marginLeft:".4rem",marginRight:".7rem"}};case"trumpet":return{json:(await __vitePreload(()=>import("./index-f01bef28.js"),[],import.meta.url)).default,relationship:relationships.trumpet};case"horn":return{json:(await __vitePreload(()=>import("./index-20c025d3.js"),[],import.meta.url)).default,relationship:relationships.horn,height:"212px",width:"252px"};case"tuba":return{json:(await __vitePreload(()=>import("./index-902205b3.js"),[],import.meta.url)).default,relationship:relationships.tuba};case"piccolo":return{json:(await __vitePreload(()=>import("./index-4b43430a.js"),[],import.meta.url)).default,relationship:relationships.piccolo};case"piccolo1":return{json:(await __vitePreload(()=>import("./index-0bbf84fb.js"),[],import.meta.url)).default,relationship:relationships.piccolo};case"piccolo2":return{json:(await __vitePreload(()=>import("./index-f5dd9e1d.js"),[],import.meta.url)).default,relationship:relationships.piccolo};case"up-bass-horn":return{json:(await __vitePreload(()=>import("./index-ad5b3309.js"),[],import.meta.url)).default,relationship:relationships["up-bass-horn"]};case"trombone":return{json:(await __vitePreload(()=>import("./index-f23e3dbf.js"),[],import.meta.url)).default,relationship:relationships.trombone};case"saxophone":return{json:(await __vitePreload(()=>import("./index-cef965b9.js"),[],import.meta.url)).default,relationship:relationships.saxophone,styles:{marginLeft:".2rem",marginRight:".3rem"}};case"small-drum":return{json:(await __vitePreload(()=>import("./index-7ad0b9f0.js"),[],import.meta.url)).default,relationship:relationships["up-bass-horn"],width:"180px"};case"hulusi-flute":return{json:(e==="musicDetail"?await __vitePreload(()=>import("./index-655a454b.js"),[],import.meta.url):await __vitePreload(()=>import("./index-71a277d3.js"),[],import.meta.url)).default,relationship:relationships.hulusi,styles:{marginLeft:".6rem",marginRight:".7rem"}};case"hulusi-flute1":return{json:(await __vitePreload(()=>import("./index-03bddf2b.js"),[],import.meta.url)).default,relationship:relationships.hulusi,styles:{marginLeft:".6rem",marginRight:".7rem"}};case"hulusi-flute2":return{json:(await __vitePreload(()=>import("./index-97e45cdd.js"),[],import.meta.url)).default,relationship:relationships.hulusi,styles:{marginLeft:".6rem",marginRight:".7rem"}};case"pan-flute":return{json:(await __vitePreload(()=>import("./index-03c84c67.js"),[],import.meta.url)).default,relationship:relationships.pan};case"pan-flute1":return{json:(await __vitePreload(()=>import("./index-91fbf033.js"),[],import.meta.url)).default,relationship:relationships.pan};case"pan-flute2":return{json:(await __vitePreload(()=>import("./index-0d3b7b42.js"),[],import.meta.url)).default,relationship:relationships.pan};case"pan-flute3":return{json:(await __vitePreload(()=>import("./index-2a1343e0.js"),[],import.meta.url)).default,relationship:relationships.pan};case"ocarina":return{json:(await __vitePreload(()=>import("./index-330cb7c5.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"ocarina1":return{json:(await __vitePreload(()=>import("./index-ad04d4cf.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"ocarina2":return{json:(await __vitePreload(()=>import("./index-c7652d9b.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"whistling":return{json:(await __vitePreload(()=>import("./index-2270f2d1.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"whistling1":return{json:(await __vitePreload(()=>import("./index-38262e39.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"whistling2":return{json:(await __vitePreload(()=>import("./index-6972bb98.js"),[],import.meta.url)).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"melodica":return{json:(await __vitePreload(()=>import("./index-d0f39753.js"),[],import.meta.url)).default,relationship:relationships.melodica,height:"80px",styles:{marginTop:"auto"}};case"melodica1":return{json:(await __vitePreload(()=>import("./index-58c2eaac.js"),[],import.meta.url)).default,relationship:relationships.melodica,height:"80px",styles:{marginTop:"auto"}};case"baroque-recorder":return{json:(await __vitePreload(()=>import("./index-f9270c49.js"),[],import.meta.url)).default,relationship:relationships.baroqueRecorder};case"baroque-recorder1":return{json:(await __vitePreload(()=>import("./index-142fdf16.js"),[],import.meta.url)).default,relationship:relationships.baroqueRecorder};case"baroque-recorder2":return{json:(await __vitePreload(()=>import("./index-d13c0247.js"),[],import.meta.url)).default,relationship:relationships.baroqueRecorder};default:return null}},startBtn="_startBtn_yex3q_1",endBtn="_endBtn_yex3q_17",bottom="_bottom_yex3q_31",top="_top_yex3q_34",pcEndBtn="_pcEndBtn_yex3q_38",noteState="_noteState_yex3q_45",dot$1="_dot_yex3q_59",operatingBtn="_operatingBtn_yex3q_65",iconBtn="_iconBtn_yex3q_74",operatingLeft="_operatingLeft_yex3q_82",beginMask="_beginMask_yex3q_85",styles$7={startBtn,endBtn,bottom,top,pcEndBtn,noteState,dot:dot$1,operatingBtn,iconBtn,operatingLeft,beginMask},fraction="_fraction_ubutp_1",content$1="_content_ubutp_5",title$3="_title_ubutp_15",erji="_erji_ubutp_21",tip="_tip_ubutp_27",btns="_btns_ubutp_31",btn$2="_btn_ubutp_31",microBox="_microBox_ubutp_41",microBg="_microBg_ubutp_46",microBtn="_microBtn_ubutp_53",microCancel="_microCancel_ubutp_59",microConfirm="_microConfirm_ubutp_64",styles$6={fraction,content:content$1,title:title$3,erji,tip,btns,btn:btn$2,microBox,microBg,microBtn,microCancel,microConfirm};reactive({starTime:0});const fingerBox="_fingerBox_6a5fc_7",hiddens="_hiddens_6a5fc_16",fingerRight="_fingerRight_6a5fc_19",fingerContent="_fingerContent_6a5fc_23",backBtn$1="_backBtn_6a5fc_26",tips="_tips_6a5fc_29",tipHidden="_tipHidden_6a5fc_46",tipContentbox="_tipContentbox_6a5fc_52",tipContent="_tipContent_6a5fc_52",fingerBottom="_fingerBottom_6a5fc_60",tipsOverlay="_tipsOverlay_6a5fc_96",bgIn="_bgIn_6a5fc_1",tipsPcBg="_tipsPcBg_6a5fc_105",popoverContainer="_popoverContainer_6a5fc_118",selected="_selected_6a5fc_153",head="_head_6a5fc_157",left="_left_6a5fc_185",baseBtn="_baseBtn_6a5fc_189",wrapFinger="_wrapFinger_6a5fc_222",userTab="_userTab_6a5fc_228",userTabBox="_userTabBox_6a5fc_234",notes="_notes_6a5fc_237",lastNoteContent="_lastNoteContent_6a5fc_241",noteBox="_noteBox_6a5fc_244",noteContent="_noteContent_6a5fc_247",changeMusBtn="_changeMusBtn_6a5fc_250",optionBtns="_optionBtns_6a5fc_267",btnBox="_btnBox_6a5fc_306",btnCon="_btnCon_6a5fc_313",btnGr="_btnGr_6a5fc_319",usrTabOverlaping="_usrTabOverlaping_6a5fc_344",boxFinger="_boxFinger_6a5fc_348",pcBoxFinger="_pcBoxFinger_6a5fc_353",boxFingerOverlapping="_boxFingerOverlapping_6a5fc_356",tipTitle="_tipTitle_6a5fc_372",tipTitleName="_tipTitleName_6a5fc_384",tipImg="_tipImg_6a5fc_414",tipClose="_tipClose_6a5fc_426",iconBook="_iconBook_6a5fc_435",tipItem="_tipItem_6a5fc_486",iconWrap="_iconWrap_6a5fc_494",tipItemIcon="_tipItemIcon_6a5fc_500",btnGrToggleBtn="_btnGrToggleBtn_6a5fc_511",nameBox="_nameBox_6a5fc_522",name="_name_6a5fc_522",noteKey="_noteKey_6a5fc_528",dot="_dot_6a5fc_533",botDot="_botDot_6a5fc_538",arrowImg="_arrowImg_6a5fc_545",usrTabOverlapingNotes="_usrTabOverlapingNotes_6a5fc_550",paddingLeft="_paddingLeft_6a5fc_564",noteContentWrap="_noteContentWrap_6a5fc_576",noteBtn="_noteBtn_6a5fc_618",disabled="_disabled_6a5fc_629",tipsT="_tipsT_6a5fc_635",playTips="_playTips_6a5fc_640",playTips2="_playTips2_6a5fc_645",playTips5="_playTips5_6a5fc_650",playError="_playError_6a5fc_655",playSuccess="_playSuccess_6a5fc_660",note="_note_6a5fc_237",showAnswer="_showAnswer_6a5fc_684",errorAnswer="_errorAnswer_6a5fc_693",keyActive="_keyActive_6a5fc_710",noteName="_noteName_6a5fc_722",dotFixed="_dotFixed_6a5fc_725",mark="_mark_6a5fc_729",oBtn="_oBtn_6a5fc_740",gamut="_gamut_6a5fc_750",play="_play_6a5fc_640",success="_success_6a5fc_756",fingeringContainer="_fingeringContainer_6a5fc_764",loading="_loading_6a5fc_773",loadingWrap="_loadingWrap_6a5fc_785",loadingIcon="_loadingIcon_6a5fc_792",loadingTip="_loadingTip_6a5fc_799",imgs="_imgs_6a5fc_825",fingeringPointSection="_fingeringPointSection_6a5fc_840",p1="_p1_6a5fc_847",p2="_p2_6a5fc_852",melodica="_melodica_6a5fc_879",tizhi="_tizhi_6a5fc_896",canDisplay="_canDisplay_6a5fc_915",fixedRightBtns="_fixedRightBtns_6a5fc_923",active$1="_active_6a5fc_955",rightBtn="_rightBtn_6a5fc_960",resetBtn$1="_resetBtn_6a5fc_992",toggleBtn="_toggleBtn_6a5fc_995",toggleBtnhulusi="_toggleBtnhulusi_6a5fc_1021",topDot="_topDot_6a5fc_1042",bottomDot="_bottomDot_6a5fc_1045",toggleBtnhulusi2="_toggleBtnhulusi2_6a5fc_1051",oterhD="_oterhD_6a5fc_1055",tones="_tones_6a5fc_1070",toneTitle="_toneTitle_6a5fc_1081",tipWrap="_tipWrap_6a5fc_1152",toneAction="_toneAction_6a5fc_1164",toneContent="_toneContent_6a5fc_1179",hulusiNoteKey="_hulusiNoteKey_6a5fc_1216",hulusiBtn="_hulusiBtn_6a5fc_1249",changeSubjectPopup="_changeSubjectPopup_6a5fc_1291",linkSourceClass="_linkSourceClass_6a5fc_1302",changeInstrumentBtn="_changeInstrumentBtn_6a5fc_1306",noteContentOther="_noteContentOther_6a5fc_1309",dragTopBox="_dragTopBox_6a5fc_1317",styles$5={fingerBox,hiddens,fingerRight,fingerContent,backBtn:backBtn$1,tips,tipHidden,tipContentbox,tipContent,fingerBottom,tipsOverlay,bgIn,tipsPcBg,popoverContainer,selected,head,left,baseBtn,wrapFinger,userTab,userTabBox,notes,lastNoteContent,noteBox,noteContent,changeMusBtn,optionBtns,btnBox,btnCon,btnGr,usrTabOverlaping,boxFinger,pcBoxFinger,boxFingerOverlapping,tipTitle,tipTitleName,tipImg,tipClose,iconBook,tipItem,iconWrap,tipItemIcon,btnGrToggleBtn,nameBox,name,noteKey,dot,botDot,arrowImg,usrTabOverlapingNotes,paddingLeft,noteContentWrap,noteBtn,disabled,tipsT,playTips,playTips2,playTips5,playError,playSuccess,note,showAnswer,errorAnswer,keyActive,noteName,dotFixed,mark,oBtn,gamut,play,success,fingeringContainer,loading,loadingWrap,loadingIcon,loadingTip,imgs,fingeringPointSection,p1,p2,"pan-flute":"_pan-flute_6a5fc_867","pan-flute-back":"_pan-flute-back_6a5fc_871",melodica,tizhi,canDisplay,fixedRightBtns,active:active$1,rightBtn,resetBtn:resetBtn$1,toggleBtn,toggleBtnhulusi,topDot,bottomDot,toggleBtnhulusi2,oterhD,tones,toneTitle,tipWrap,toneAction,toneContent,hulusiNoteKey,hulusiBtn,changeSubjectPopup,linkSourceClass,changeInstrumentBtn,noteContentOther,dragTopBox};var hammerExports={},hammer={get exports(){return hammerExports},set exports(i){hammerExports=i}};/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */(function(i){(function(e,r,s,o){var a=["","webkit","Moz","MS","ms","o"],l=r.createElement("div"),u="function",c=Math.round,d=Math.abs,y=Date.now;function m(te,fe,Pe){return setTimeout(w(te,Pe),fe)}function g(te,fe,Pe){return Array.isArray(te)?(v(te,Pe[fe],Pe),!0):!1}function v(te,fe,Pe){var Fe;if(te)if(te.forEach)te.forEach(fe,Pe);else if(te.length!==o)for(Fe=0;Fe\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ut=e.console&&(e.console.warn||e.console.log);return ut&&ut.call(e.console,Fe,Xe),te.apply(this,arguments)}}var S;typeof Object.assign!="function"?S=function(fe){if(fe===o||fe===null)throw new TypeError("Cannot convert undefined or null to object");for(var Pe=Object(fe),Fe=1;Fe-1}function R(te){return te.trim().split(/\s+/g)}function H(te,fe,Pe){if(te.indexOf&&!Pe)return te.indexOf(fe);for(var Fe=0;FeUt[fe]}):Fe=Fe.sort()),Fe}function I(te,fe){for(var Pe,Fe,He=fe[0].toUpperCase()+fe.slice(1),Xe=0;Xe1&&!Pe.firstMultiple?Pe.firstMultiple=we(fe):He===1&&(Pe.firstMultiple=!1);var Xe=Pe.firstInput,ut=Pe.firstMultiple,Mt=ut?ut.center:Xe.center,Bt=fe.center=de(Fe);fe.timeStamp=y(),fe.deltaTime=fe.timeStamp-Xe.timeStamp,fe.angle=Je(Mt,Bt),fe.distance=$e(Mt,Bt),Ee(Pe,fe),fe.offsetDirection=Ve(fe.deltaX,fe.deltaY);var Ut=De(fe.deltaTime,fe.deltaX,fe.deltaY);fe.overallVelocityX=Ut.x,fe.overallVelocityY=Ut.y,fe.overallVelocity=d(Ut.x)>d(Ut.y)?Ut.x:Ut.y,fe.scale=ut?tt(ut.pointers,Fe):1,fe.rotation=ut?Ye(ut.pointers,Fe):0,fe.maxPointers=Pe.prevInput?fe.pointers.length>Pe.prevInput.maxPointers?fe.pointers.length:Pe.prevInput.maxPointers:fe.pointers.length,le(Pe,fe);var Jt=te.element;k(fe.srcEvent.target,Jt)&&(Jt=fe.srcEvent.target),fe.target=Jt}function Ee(te,fe){var Pe=fe.center,Fe=te.offsetDelta||{},He=te.prevDelta||{},Xe=te.prevInput||{};(fe.eventType===ue||Xe.eventType===Se)&&(He=te.prevDelta={x:Xe.deltaX||0,y:Xe.deltaY||0},Fe=te.offsetDelta={x:Pe.x,y:Pe.y}),fe.deltaX=He.x+(Pe.x-Fe.x),fe.deltaY=He.y+(Pe.y-Fe.y)}function le(te,fe){var Pe=te.lastInterval||fe,Fe=fe.timeStamp-Pe.timeStamp,He,Xe,ut,Mt;if(fe.eventType!=Be&&(Fe>re||Pe.velocity===o)){var Bt=fe.deltaX-Pe.deltaX,Ut=fe.deltaY-Pe.deltaY,Jt=De(Fe,Bt,Ut);Xe=Jt.x,ut=Jt.y,He=d(Jt.x)>d(Jt.y)?Jt.x:Jt.y,Mt=Ve(Bt,Ut),te.lastInterval=fe}else He=Pe.velocity,Xe=Pe.velocityX,ut=Pe.velocityY,Mt=Pe.direction;fe.velocity=He,fe.velocityX=Xe,fe.velocityY=ut,fe.direction=Mt}function we(te){for(var fe=[],Pe=0;Pe=d(fe)?te<0?J:se:fe<0?V:pe}function $e(te,fe,Pe){Pe||(Pe=he);var Fe=fe[Pe[0]]-te[Pe[0]],He=fe[Pe[1]]-te[Pe[1]];return Math.sqrt(Fe*Fe+He*He)}function Je(te,fe,Pe){Pe||(Pe=he);var Fe=fe[Pe[0]]-te[Pe[0]],He=fe[Pe[1]]-te[Pe[1]];return Math.atan2(He,Fe)*180/Math.PI}function Ye(te,fe){return Je(fe[1],fe[0],Ce)+Je(te[1],te[0],Ce)}function tt(te,fe){return $e(fe[0],fe[1],Ce)/$e(te[0],te[1],Ce)}var Ze={mousedown:ue,mousemove:ge,mouseup:Se},ot="mousedown",pt="mousemove mouseup";function nt(){this.evEl=ot,this.evWin=pt,this.pressed=!1,Ae.apply(this,arguments)}E(nt,Ae,{handler:function(fe){var Pe=Ze[fe.type];Pe&ue&&fe.button===0&&(this.pressed=!0),Pe&ge&&fe.which!==1&&(Pe=Se),this.pressed&&(Pe&Se&&(this.pressed=!1),this.callback(this.manager,Pe,{pointers:[fe],changedPointers:[fe],pointerType:ye,srcEvent:fe}))}});var ct={pointerdown:ue,pointermove:ge,pointerup:Se,pointercancel:Be,pointerout:Be},Pt={2:W,3:xe,4:ye,5:q},at="pointerdown",ft="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(at="MSPointerDown",ft="MSPointerMove MSPointerUp MSPointerCancel");function wt(){this.evEl=at,this.evWin=ft,Ae.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}E(wt,Ae,{handler:function(fe){var Pe=this.store,Fe=!1,He=fe.type.toLowerCase().replace("ms",""),Xe=ct[He],ut=Pt[fe.pointerType]||fe.pointerType,Mt=ut==W,Bt=H(Pe,fe.pointerId,"pointerId");Xe&ue&&(fe.button===0||Mt)?Bt<0&&(Pe.push(fe),Bt=Pe.length-1):Xe&(Se|Be)&&(Fe=!0),!(Bt<0)&&(Pe[Bt]=fe,this.callback(this.manager,Xe,{pointers:Pe,changedPointers:[fe],pointerType:ut,srcEvent:fe}),Fe&&Pe.splice(Bt,1))}});var Gt={touchstart:ue,touchmove:ge,touchend:Se,touchcancel:Be},Ht="touchstart",ee="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=Ht,this.evWin=ee,this.started=!1,Ae.apply(this,arguments)}E(ae,Ae,{handler:function(fe){var Pe=Gt[fe.type];if(Pe===ue&&(this.started=!0),!!this.started){var Fe=Te.call(this,fe,Pe);Pe&(Se|Be)&&Fe[0].length-Fe[1].length===0&&(this.started=!1),this.callback(this.manager,Pe,{pointers:Fe[0],changedPointers:Fe[1],pointerType:W,srcEvent:fe})}}});function Te(te,fe){var Pe=B(te.touches),Fe=B(te.changedTouches);return fe&(Se|Be)&&(Pe=F(Pe.concat(Fe),"identifier",!0)),[Pe,Fe]}var Ne={touchstart:ue,touchmove:ge,touchend:Se,touchcancel:Be},We="touchstart touchmove touchend touchcancel";function rt(){this.evTarget=We,this.targetIds={},Ae.apply(this,arguments)}E(rt,Ae,{handler:function(fe){var Pe=Ne[fe.type],Fe=vt.call(this,fe,Pe);Fe&&this.callback(this.manager,Pe,{pointers:Fe[0],changedPointers:Fe[1],pointerType:W,srcEvent:fe})}});function vt(te,fe){var Pe=B(te.touches),Fe=this.targetIds;if(fe&(ue|ge)&&Pe.length===1)return Fe[Pe[0].identifier]=!0,[Pe,Pe];var He,Xe,ut=B(te.changedTouches),Mt=[],Bt=this.target;if(Xe=Pe.filter(function(Ut){return k(Ut.target,Bt)}),fe===ue)for(He=0;He-1&&Fe.splice(Xe,1)};setTimeout(He,Lt)}}function G(te){for(var fe=te.srcEvent.clientX,Pe=te.srcEvent.clientY,Fe=0;Fe-1&&this.requireFail.splice(fe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(te){return!!this.simultaneous[te.id]},emit:function(te){var fe=this,Pe=this.state;function Fe(He){fe.manager.emit(He,te)}Pe<_t&&Fe(fe.options.event+it(Pe)),Fe(fe.options.event),te.additionalEvent&&Fe(te.additionalEvent),Pe>=_t&&Fe(fe.options.event+it(Pe))},tryEmit:function(te){if(this.canEmit())return this.emit(te);this.state=ht},canEmit:function(){for(var te=0;tefe.threshold&&He&fe.direction},attrTest:function(te){return Ot.prototype.attrTest.call(this,te)&&(this.state&Ct||!(this.state&Ct)&&this.directionTest(te))},emit:function(te){this.pX=te.deltaX,this.pY=te.deltaY;var fe=bt(te.direction);fe&&(te.additionalEvent=this.options.event+fe),this._super.emit.call(this,te)}});function ti(){Ot.apply(this,arguments)}E(ti,Ot,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(te){return this._super.attrTest.call(this,te)&&(Math.abs(te.scale-1)>this.options.threshold||this.state&Ct)},emit:function(te){if(te.scale!==1){var fe=te.scale<1?"in":"out";te.additionalEvent=this.options.event+fe}this._super.emit.call(this,te)}});function Yt(){et.apply(this,arguments),this._timer=null,this._input=null}E(Yt,et,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(te){var fe=this.options,Pe=te.pointers.length===fe.pointers,Fe=te.distancefe.time;if(this._input=te,!Fe||!Pe||te.eventType&(Se|Be)&&!He)this.reset();else if(te.eventType&ue)this.reset(),this._timer=m(function(){this.state=St,this.tryEmit()},fe.time,this);else if(te.eventType&Se)return St;return ht},reset:function(){clearTimeout(this._timer)},emit:function(te){this.state===St&&(te&&te.eventType&Se?this.manager.emit(this.options.event+"up",te):(this._input.timeStamp=y(),this.manager.emit(this.options.event,this._input)))}});function At(){Ot.apply(this,arguments)}E(At,Ot,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(te){return this._super.attrTest.call(this,te)&&(Math.abs(te.rotation)>this.options.threshold||this.state&Ct)}});function ni(){Ot.apply(this,arguments)}E(ni,Ot,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ce|K,pointers:1},getTouchAction:function(){return $t.prototype.getTouchAction.call(this)},attrTest:function(te){var fe=this.options.direction,Pe;return fe&(ce|K)?Pe=te.overallVelocity:fe&ce?Pe=te.overallVelocityX:fe&K&&(Pe=te.overallVelocityY),this._super.attrTest.call(this,te)&&fe&te.offsetDirection&&te.distance>this.options.threshold&&te.maxPointers==this.options.pointers&&d(Pe)>this.options.velocity&&te.eventType&Se},emit:function(te){var fe=bt(te.offsetDirection);fe&&this.manager.emit(this.options.event+fe,te),this.manager.emit(this.options.event,te)}});function zt(){et.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}E(zt,et,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[me]},process:function(te){var fe=this.options,Pe=te.pointers.length===fe.pointers,Fe=te.distance{const e=await api_cloudGetMediaStatus(),r=e==null?void 0:e.content.status;if(r==="init"||r==="suspend"&&i==="paused")return;r==="suspend"?(state$1.isSelectMeasureMode&&(audioData$1.progress=state$1.midiSectionStart),await api_cloudPlay({songID:state$1.examSongId,startTime:audioData$1.progress*1e3,originalSpeed:state$1.originSpeed,speed:state$1.modeType==="evaluating"?state$1.originSpeed:state$1.speed,hertz:440}),onPlay()):(await api_cloudSuspend({songID:state$1.examSongId}),state$1.modeType==="evaluating"&&(audioData$1.progress=0));const s=await api_cloudGetMediaStatus();state$1.playState=(s==null?void 0:s.content.status)==="suspend"?"paused":"play",console.log(s,"cloudGetMediaStatused")},authorName="_authorName_mq8wm_1",title="_title_mq8wm_4",authorCon="_authorCon_mq8wm_19",author="_author_mq8wm_1",styles$1={authorName,title,authorCon,author},emptyMusic="_emptyMusic_pi1dj_1",emptyMusicBox="_emptyMusicBox_pi1dj_13",img="_img_pi1dj_18",tit="_tit_pi1dj_22",backBtn="_backBtn_pi1dj_29",styles={emptyMusic,emptyMusicBox,img,tit,backBtn};ref(!1);const musicScoreRef=ref();ref();const headerColumnHide=ref(!1);defineAsyncComponent(()=>__vitePreload(()=>import("./modeView-089979ec.js"),["./modeView-089979ec.js","../css/modeView-c4c5480d.css"],import.meta.url));const headTopData=reactive({modeType:"",showBack:!0,settingMode:!1,handleChangeModeType(i){if(!(i==="evaluating"&&!state$1.enableEvaluation)&&!(i==="follow"&&state$1.isPercussion)){if(i==="follow"&&metronomeData.cursorMode===2&&(metronomeData.cursorMode=1),i==="evaluating"){if(!evaluatingData.jsonLoadDone){evaluatingData.jsonLoading=!0,state$1.audioDone&&showToast("资源加载中,请稍后");return}if(state$1.platform===IPlatform.PC){showConfirmDialog({className:"modalTip",title:"温馨提示",message:"该功能暂未开放,敬请期待!",showCancelButton:!1});return}state$1.isSingleLine||(state$1.isSingleLine=!0,refreshMusicSvg()),smoothAnimationState.isShow.value=!1,state$1.playIngSpeed=state$1.originSpeed,handleStartEvaluat()}else i==="follow"&&(state$1.isSingleLine||(state$1.isSingleLine=!0,refreshMusicSvg()),smoothAnimationState.isShow.value=!1,toggleFollow());headTopData.modeType="show"}},oldPlayType:"play",oldModeType:"practise"});reactive({speedShow:!1,musicTypeShow:!1});ref();ref();const data=reactive({trainingType:"",worke:{}}),browserInfo$2=browser();let socketStartTime=0;const popImgs={icon_bg,icon_close,icon_btn,icon_success},evaluatingData=reactive({contentData:{},rendered:!1,earphone:!1,soundEffect:!1,soundEffectFrequency:0,checkStep:0,checkEnd:!1,earphoneMode:!1,earPhoneType:"",soundEffectMode:!1,websocketState:!1,startBegin:!1,backtime:0,evaluatings:{},resultData:{},resulstMode:!1,isComplete:!1,isDisabledPlayMusic:!1,socketErrorPop:!1,errorContents:"",socketErrorStatus:0,delayCheckSocketError:!1,isErrorState:!1,accompanyErrorType:"",isAudioPlayEnd:!1,preloadJson:!0,jsonLoading:!0,jsonLoadDone:!0,hideResultModal:!1,oneselfCancleEvaluating:!1,isBeginMask:!1,recordingTime:0,endEvaluatingTime:0,evaluatSpeed:0,needReplayEvaluat:!1,needPlayTick:!1,tipErjiShow:!1,onceErjiPopShow:!1,needCheckErjiStatus:!0}),sendOffsetTime=async i=>{var r;const e=await api_getDeviceDelay();api_midiMicDelay({header:{commond:"audioPlayStart",type:"SOUND_COMPARE"},body:{offsetTime:i,micDelay:(r=e==null?void 0:e.content)==null?void 0:r.value}})},handleStartEvaluat=async()=>{var i;if(state$1.modeType==="evaluating")handleCancelEvaluat(),state$1.modeType="practise";else if(state$1.modeType="evaluating",state$1.platform!=="PC"){const e=await api_checkSocketStatus();((i=e==null?void 0:e.content)==null?void 0:i.status)==="connected"&&handleStopPlay()}else handleStopPlay();state$1.modeType!=="evaluating"&&(evaluatingData.rendered=!1)},check_currentTime=()=>{let i=0;if(state$1.isSelectMeasureMode&&(i=state$1.section[0].time*1e3),getAudioCurrentTime()*1e3-i>=500){sendEvaluatingOffsetTime(500);return}setTimeout(()=>{check_currentTime()},10)},sendEvaluatingOffsetTime=async i=>{if(!evaluatingData.backtime)return;const r=Date.now()-evaluatingData.backtime-i;console.error("真正播放延迟",r,"currentTime:",i),await api_proxyServiceMessage({header:{commond:"audioPlayStart",type:"SOUND_COMPARE"},body:{offsetTime:r<0?0:r,micDelay:0}})},checkUseEarphone=async()=>{var e;const i=await getEarphone();return((e=i==null?void 0:i.content)==null?void 0:e.checkIsWired)||!1},handleEndSoundCheck=()=>{endSoundCheck()},connectWebsocket=async i=>{evaluatingData.contentData=i,evaluatingData.websocketState=!0},handlePerformDetection=async()=>{if(!evaluatingData.checkEnd){if(evaluatingData.checkStep===0){if(evaluatingData.checkStep=5,state$1.setting.soundEffect){evaluatingData.soundEffectMode=!0;return}const i=await api_getDeviceDelay();if(console.log("🚀 ~ delayTime:",i),!i){evaluatingData.soundEffectMode=!0;return}handlePerformDetection();return}if(evaluatingData.checkStep=5){if(evaluatingData.checkStep=10,!await checkUseEarphone()){evaluatingData.earphoneMode=!0;return}handlePerformDetection();return}evaluatingData.checkStep===10&&(evaluatingData.checkEnd=!0)}},addMeasureScore=(i,e=!0)=>{for(let r in evaluatingData.evaluatings)evaluatingData.evaluatings[r].show=!1;evaluatingData.evaluatings[i.measureRenderIndex]={...i,leve:getLeveByScoreMeasure(i.score),show:e}},handleScoreResult=i=>{if(console.log("返回",i,evaluatingData.oneselfCancleEvaluating),i!=null&&i.content){const{header:e,body:r}=i.content;e.commond==="checking"&&(evaluatingData.soundEffectFrequency=r.frequency),(e==null?void 0:e.commond)==="measureScore"&&!evaluatingData.oneselfCancleEvaluating&&(console.log("🚀 ~ 评测返回:",i),addMeasureScore(r)),(e==null?void 0:e.commond)==="overall"&&(console.log("🚀 ~ 评测返回:",i),console.log("评测结束",r),state$1.isHideEvaluatReportSaveBtn=!1,setTimeout(()=>{data.trainingType==="EVALUATION"&&!evaluatingData.isComplete?evaluatingData.hideResultModal=!0:evaluatingData.hideResultModal=!1,evaluatingData.oneselfCancleEvaluating&&(evaluatingData.hideResultModal=!0),evaluatingData.resulstMode=!evaluatingData.isErrorState},200),evaluatingData.resultData={...r,...getLeveByScore(r.score)},closeToast(),state$1.isLoading=!1)}},handleStartBegin=async i=>{var s;evaluatingData.needPlayTick=!1,state$1.isAppPlay&&await api_cloudSetCurrentTime({currentTime:0,songID:state$1.examSongId}),evaluatingData.isComplete=!1,evaluatingData.evaluatings={},evaluatingData.resultData={},evaluatingData.backtime=0,evaluatingData.isAudioPlayEnd=!1;const e=await startEvaluating(evaluatingData.contentData);if((e==null?void 0:e.api)!=="startEvaluating"){Snackbar$1.error("请在APP端进行评测"),evaluatingData.startBegin=!1;return}if((s=e==null?void 0:e.content)!=null&&s.reson){evaluatingData.startBegin=!1;return}if(resetPlaybackToStart(),evaluatingData.startBegin=!0,evaluatingData.isDisabledPlayMusic){if(evaluatingData.isBeginMask=!0,await startCountdown(),state$1.playState=state$1.playState==="paused"?"play":"paused",state$1.playState==="play"&&state$1.playType==="play"&&state$1.needTick||state$1.playType==="sing"&&state$1.needSingTick)if(state$1.playType==="play"&&!state$1.isOpenMetronome||state$1.playType==="sing"&&!state$1.isSingOpenMetronome){const o=await handleStartTick();if(console.log("🚀 ~ tickend:",o),!o){state$1.playState="paused",evaluatingData.startBegin=!1,evaluatingData.isBeginMask=!1;return}}else evaluatingData.needPlayTick=!0;evaluatingData.isBeginMask=!1,onPlay()}if(evaluatingData.isErrorState){state$1.playState="paused",evaluatingData.startBegin=!1;return}const r=state$1.basePlayRate*state$1.originAudioPlayRate;await api_startRecordingCb({accompanimentState:state$1.accompany?1:0,firstNoteTime:i||0,speedRate:parseFloat(r.toFixed(2))},()=>{state$1.isAppPlay&&setTimeout(()=>{sendOffsetTime(0)},300)}),evaluatingData.recordingTime=+new Date,state$1.setting.camera&&(console.log("开始录制视频"),await api_startCapture()),state$1.isAppPlay&&(await api_cloudChangeSpeed({speed:state$1.originSpeed,originalSpeed:state$1.originSpeed,songID:state$1.examSongId}),audioData$1.progress=0,audioListStart(state$1.playState)),evaluatingData.oneselfCancleEvaluating=!1},playMusic=async()=>{if(!await togglePlay("play")){evaluatingData.startBegin=!1,handleCancelEvaluat();return}check_currentTime(),state$1.setting.camera&&(console.log("开始录制视频"),api_startCapture())},recordStartTimePoint=async i=>{var r;if(console.error("开始录音"),!evaluatingData.startBegin)return;let e=((r=i==null?void 0:i.content)==null?void 0:r.inteveral)||0;browserInfo$2.ios&&(e*=1e3),evaluatingData.backtime=e||Date.now(),console.log("🚀 ~ 开始时间点:",evaluatingData.backtime,"已经录的时间:",Date.now()-e,"记录时间点:",Date.now()),!evaluatingData.isDisabledPlayMusic&&playMusic()},handleEndEvaluat=(i=!1,e)=>{!evaluatingData.startBegin||state$1.modeType!=="evaluating"||(console.log("评测结束1"),endEvaluating({musicScoreId:state$1.examSongId}),!i&&data.trainingType==="EVALUATION"?showToast({message:"完整演奏结束才算作业分数!"}):e||(state$1.loadingText="正在评分中,请稍等...",state$1.isLoading=!0),setTimeout(()=>{if(evaluatingData.startBegin=!1,e==="selfCancel"){const r=state$1.sectionStatus&&state$1.section.length===2?state$1.sectionFirst||state$1.section[0]:state$1.times[0];state$1.activeNoteIndex=r.i,state$1.activeMeasureIndex=r.MeasureNumberXML,resetBaseRate(r.i)}},500),evaluatingData.isComplete=i,state$1.setting.camera&&(console.log("结束录制视频"),api_endCapture()))},handleEndBegin=()=>{handleEndEvaluat(),handleStopPlay()},handleCancelEvaluat=i=>{evaluatingData.evaluatings={},evaluatingData.startBegin=!1,closeToast(),api_proxyServiceMessage({header:{commond:"recordCancel",type:"SOUND_COMPARE",status:200}}),cancelEvaluating(),handleStopPlay(),console.log("评测结束2"),endEvaluating({musicScoreId:state$1.examSongId}),state$1.setting.camera&&(console.log("结束录制视频"),api_endCapture())},handleViewReport=(i,e)=>{var o;const r=((o=evaluatingData.resultData)==null?void 0:o[i])||"";let s="";switch(e){case"gym":s=location.origin+location.pathname+"#/report/"+r;break;case"orchestra":s=location.origin+location.pathname+"report-share.html?id="+r;break;case"instrument":s=location.origin+location.pathname+"#/evaluat-report?id="+r+"&musicRenderType="+state$1.musicRenderType;break;default:s=location.origin+location.pathname+"report-share.html?id="+r;break}api_openWebView({url:s,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0,c_orientation:0})},handleComplexButton=i=>{console.log("监听是否隐藏保存按钮",i),i!=null&&i.content&&(i.content,state$1.isHideEvaluatReportSaveBtn=!0)},handleAccompanyError=i=>{if(console.log("异常信息返回",i),i!=null&&i.content){const{type:e,reson:r}=i.content;switch(state$1.playState="paused",e){case"enterBackground":case"playError":case"socketError":if(evaluatingData.soundEffectMode){evaluatingData.socketErrorStatus=0,evaluatingData.delayCheckSocketError=!0,evaluatingData.socketErrorPop=e==="socketError",evaluatingData.accompanyErrorType=e;return}state$1.modeType==="evaluating"&&evaluatingData.startBegin&&handleCancelEvaluat(),closeTick(),e==="socketError"&&api_closeDelayCheck({}),evaluatingData.socketErrorStatus=0,evaluatingData.socketErrorPop=e==="socketError",evaluatingData.isErrorState=!0,evaluatingData.accompanyErrorType=e,resetPlaybackToStart();break}}},handleSocketStatus=i=>{var e;if(((e=i==null?void 0:i.content)==null?void 0:e.status)==="connected"){const r=+new Date;evaluatingData.delayCheckSocketError=!1;const s=r-socketStartTime;if(s<1e3){const o=1e3-s;setTimeout(()=>{evaluatingData.socketErrorStatus=2},o)}}},hanldeConfirmPop=async()=>{api_checkSocketStatus(),evaluatingData.socketErrorStatus=1,socketStartTime=+new Date},hanldeClosePop=()=>{evaluatingData.socketErrorPop=!1,evaluatingData.socketErrorStatus=0},Evaluating=defineComponent({name:"evaluating",setup(){const i=usePageVisibility(),e=reactive({finger:!1,play_mode:"",enableAccompaniment:!0}),r=()=>{e.play_mode=state$1.playSource,e.enableAccompaniment=state$1.setting.enableAccompaniment,e.enableAccompaniment||(console.log("关闭伴奏"),toggleMutePlayAudio(e.play_mode==="music"?"music":e.play_mode==="background"?"background":"mingSong",!0))},s=()=>{state$1.playSource=e.play_mode,e.enableAccompaniment||toggleMutePlayAudio(e.play_mode==="music"?"music":e.play_mode==="background"?"background":"mingSong",!1)};return watch(i,o=>{o=="hidden"&&evaluatingData.startBegin}),watch(()=>evaluatingData.socketErrorStatus,()=>{evaluatingData.socketErrorStatus===2&&setTimeout(()=>{evaluatingData.socketErrorPop=!1},1e3)}),watch(()=>evaluatingData.socketErrorPop,()=>{evaluatingData.socketErrorPop&&state$1.setting.soundEffect&&api_closeDelayCheck({})}),onMounted(()=>{resetPlaybackToStart(),r(),evaluatingData.resultData={},evaluatingData.onceErjiPopShow=!1,evaluatingData.evaluatings={},evaluatingData.soundEffectFrequency=0,evaluatingData.checkStep=0,evaluatingData.rendered=!0,sendResult(handleScoreResult),hideComplexButton(handleComplexButton,!0),api_recordStartTime(recordStartTimePoint),addAccompanyError(handleAccompanyError),addSocketStatus(handleSocketStatus),state$1.isSelectMeasureMode||clearSelection(),console.log("加载评测模块成功")}),onUnmounted(()=>{evaluatingData.checkEnd=!1,evaluatingData.rendered=!1,resetPlaybackToStart(),removeResult(handleScoreResult),hideComplexButton(()=>{},!1),api_remove_recordStartTime(recordStartTimePoint),s(),removeAccompanyError(handleAccompanyError),evaluatingData.socketErrorPop&&state$1.setting.soundEffect?console.log("延迟检测出错"):removeSocketStatus(handleSocketStatus),api_disconnectSocket(),console.log("卸载评测模块成功")}),()=>createVNode("div",null,[createVNode("div",{class:styles$v.hiddenPop},[createVNode("img",{src:popImgs.icon_bg},null),createVNode("img",{src:popImgs.icon_btn},null),createVNode("img",{src:popImgs.icon_success},null),createVNode("img",{src:popImgs.icon_close},null)]),createVNode(Popup,{teleport:"body",closeOnClickOverlay:!1,class:["popup-custom","van-scale",evaluatingData.socketErrorStatus===2&&styles$v.socketErrorStatus],transition:"van-scale",show:evaluatingData.socketErrorPop,"onUpdate:show":o=>evaluatingData.socketErrorPop=o,"overlay-style":evaluatingData.socketErrorStatus===2?{background:"initial"}:{}},{default:()=>[createVNode(AbnormalPop,{onConfirm:hanldeConfirmPop,onClose:hanldeClosePop},null)]})])}}),audioData$1=reactive({songEle:null,backgroundEle:null,mingSongEle:null,songCollection:{songEle:null,backgroundEle:null,fanSongEle:null,banSongEle:null,mingSongEle:null,beatSongEle:null,betaBackgroundEle:null,betaFanSongEle:null,betaBanSongEle:null,betaMingSongEle:null},midiRender:!1,progress:0,duration:0,mingSongType:1,mingSongTypeCollection:{mingSongEle:null,mingSongGirlEle:null,beatMingSongEle:null,beatMingSongGirlEle:null}}),midiRef=ref(),audioListStart=i=>{var e,r,s,o,a,l;if(i==="play"&&state$1.originSpeed!==0){const u=state$1.originAudioPlayRate*state$1.basePlayRate;setAudioPlaybackRate(u)}if(state$1.isAppPlay){cloudToggleState(i);return}i==="play"?state$1.playSource==="mingSong"?(e=audioData$1.mingSongEle)==null||e.play():((r=audioData$1.songEle)==null||r.play(),(s=audioData$1.backgroundEle)==null||s.play()):i==="paused"&&((o=audioData$1.songEle)==null||o.pause(),(a=audioData$1.backgroundEle)==null||a.pause(),(l=audioData$1.mingSongEle)==null||l.pause())},setAudioPlaybackRate=i=>{if(state$1.isAppPlay){if(state$1.modeType==="evaluating")return;hanldeSetMidiPlaybackRate(i);return}audioData$1.songEle&&(audioData$1.songEle.playbackRate=i),audioData$1.backgroundEle&&(audioData$1.backgroundEle.playbackRate=i),audioData$1.mingSongEle&&(audioData$1.mingSongEle.playbackRate=i)},getAudioCurrentTime=()=>{var i,e,r,s;return state$1.isAppPlay||state$1.modeType==="evaluating"||state$1.modeType==="evaluating"?audioData$1.progress:state$1.playSource==="music"?((i=audioData$1.songEle)==null?void 0:i.currentTime)||audioData$1.progress:state$1.playSource==="background"?((e=audioData$1.backgroundEle)==null?void 0:e.currentTime)||audioData$1.progress:state$1.playSource==="mingSong"?((r=audioData$1.mingSongEle)==null?void 0:r.currentTime)||audioData$1.progress:((s=audioData$1.songEle)==null?void 0:s.currentTime)||audioData$1.progress},getAudioDuration=()=>{var i,e,r,s,o;if(state$1.isAppPlay){const a=((i=state$1.times[state$1.times.length-1||0])==null?void 0:i.endtime)||0;return audioData$1.duration||a}return state$1.playSource==="mingSong"?((e=audioData$1.mingSongEle)==null?void 0:e.duration)||audioData$1.duration:((r=audioData$1.songEle)==null?void 0:r.duration)||((s=audioData$1.backgroundEle)==null?void 0:s.duration)||((o=audioData$1.mingSongEle)==null?void 0:o.duration)||audioData$1.duration},setAudioCurrentTime=(i,e=0)=>{if(state$1.isAppPlay){setMidiCurrentTime(e);return}audioData$1.songEle&&(audioData$1.songEle.currentTime=i),audioData$1.backgroundEle&&(audioData$1.backgroundEle.currentTime=i),audioData$1.mingSongEle&&(audioData$1.mingSongEle.currentTime=i),audioData$1.progress=i},toggleMutePlayAudio=(i,e)=>{i==="music"?audioData$1.songEle&&(audioData$1.songEle.muted=e):i==="background"?audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=e):i==="mingSong"&&audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=e)},changeSongSourceByBate=i=>{var r,s,o;const e=((r=audioData$1.songEle)==null?void 0:r.currentTime)||((s=audioData$1.backgroundEle)==null?void 0:s.currentTime)||((o=audioData$1.mingSongEle)==null?void 0:o.currentTime)||audioData$1.progress||0;i?state$1.playType==="play"?(audioData$1.songEle=audioData$1.songCollection.songEle,audioData$1.backgroundEle=audioData$1.songCollection.backgroundEle):(audioData$1.songEle=audioData$1.songCollection.fanSongEle,audioData$1.backgroundEle=audioData$1.songCollection.banSongEle,audioData$1.mingSongEle=audioData$1.songCollection.mingSongEle):state$1.playType==="play"?(audioData$1.songEle=audioData$1.songCollection.beatSongEle||audioData$1.songCollection.songEle,audioData$1.backgroundEle=audioData$1.songCollection.betaBackgroundEle||audioData$1.songCollection.backgroundEle):(audioData$1.songEle=audioData$1.songCollection.betaFanSongEle||audioData$1.songCollection.fanSongEle,audioData$1.backgroundEle=audioData$1.songCollection.betaBanSongEle||audioData$1.songCollection.banSongEle,audioData$1.mingSongEle=audioData$1.songCollection.betaMingSongEle||audioData$1.songCollection.mingSongEle),audioData$1.songEle&&(audioData$1.songEle.currentTime=e),audioData$1.backgroundEle&&(audioData$1.backgroundEle.currentTime=e),audioData$1.mingSongEle&&(audioData$1.mingSongEle.currentTime=e),state$1.playSource==="music"?(audioData$1.songEle&&(audioData$1.songEle.muted=!1),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!0),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!0)):state$1.playSource==="background"?(audioData$1.songEle&&(audioData$1.songEle.muted=!0),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!1),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!0)):(audioData$1.songEle&&(audioData$1.songEle.muted=!0),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!0),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!1))},changeMingSongType=()=>{const{mingSongEle:i,mingSongGirlEle:e,beatMingSongEle:r,beatMingSongGirlEle:s}=audioData$1.mingSongTypeCollection;if(i&&e){const o=audioData$1.mingSongType;audioData$1.songCollection.mingSongEle=o===1?i:e,audioData$1.songCollection.betaMingSongEle=o===1?r:s}},AudioList=defineComponent({name:"audio-list",setup(){const i=()=>{midiRef.value.contentWindow.handleRendered=()=>{audioData$1.midiRender=!0},hanldeInitMidiData(midiRef.value)};watch(()=>state$1.playSource,()=>{if(state$1.modeType==="evaluating"&&!state$1.setting.enableAccompaniment){console.log("评测模式设置了关闭伴奏,不切换原音伴奏");return}state$1.playSource==="music"?(audioData$1.songEle&&(audioData$1.songEle.muted=!1),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!0),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!0)):state$1.playSource==="background"?(audioData$1.songEle&&(audioData$1.songEle.muted=!0),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!1),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!0)):(audioData$1.songEle&&(audioData$1.songEle.muted=!0),audioData$1.backgroundEle&&(audioData$1.backgroundEle.muted=!0),audioData$1.mingSongEle&&(audioData$1.mingSongEle.muted=!1))});const e=c=>c?new Promise(d=>{const y=new Audio(c+"?v="+Date.now());y.load(),y.onloadedmetadata=()=>{d(y)},y.onerror=()=>{d(null)}}):Promise.resolve(null),r=c=>{storeData.isApp&&state$1.modeType==="evaluating"&&evaluatingData.needPlayTick&&c>0&&(evaluatingData.needPlayTick=!1,handleStartTick())},s=c=>{var g,v,b;const d=(c==null?void 0:c.currentTime)||((g=c==null?void 0:c.content)==null?void 0:g.currentTime),y=(c==null?void 0:c.totalDuration)||((v=c==null?void 0:c.content)==null?void 0:v.totalDuration),m=d/1e3;if(audioData$1.progress=m,r(m),audioData$1.duration=y/1e3,((b=c==null?void 0:c.content)==null?void 0:b.totalDuration)>1e3&&d>=y){if(console.log("播放结束1111",evaluatingData.isAudioPlayEnd,d,y),evaluatingData.isAudioPlayEnd)return;evaluatingData.isAudioPlayEnd=!0,onEnded()}},o=c=>{var m,g,v;if(audioData$1.duration==0){const b=((m=state$1.times[state$1.times.length-1||0])==null?void 0:m.endtime)||0;audioData$1.duration=b}const d=(c==null?void 0:c.currentTime)||((g=c==null?void 0:c.content)==null?void 0:g.currentTime);c!=null&&c.totalDuration||((v=c==null?void 0:c.content)==null||v.totalDuration);const y=d/1e3;audioData$1.progress=y,state$1.sectionStatus&&state$1.section.length==2&&d>=state$1.section},a=c=>{c&&(console.log("midi结束"),audioData$1.progress=0,onEnded())};function l(){return Promise.all([e(state$1.music),e(state$1.accompany),e(state$1.fanSong),e(state$1.banSong),e(state$1.mingSong),e(state$1.mingSongGirl)])}function u(){return Promise.all([e(state$1.beatSong.music),e(state$1.beatSong.accompany),e(state$1.beatSong.fanSong),e(state$1.beatSong.banSong),e(state$1.beatSong.mingSong),e(state$1.beatSong.mingSongGirl)])}return onMounted(async()=>{var c;if(state$1.isPreView){state$1.isLoading=!1;return}if(state$1.playMode!=="MIDI"){console.time("音频加载时间");const[d,y,m,g,v,b]=await l();audioData$1.backgroundEle=y,audioData$1.songEle=d,Object.assign(audioData$1.songCollection,{songEle:d,backgroundEle:y,fanSongEle:m,banSongEle:g,mingSongEle:v}),Object.assign(audioData$1.mingSongTypeCollection,{mingSongEle:v,mingSongGirlEle:b}),d?(d.addEventListener("play",onPlay),d.addEventListener("ended",onEnded),y&&(y.muted=!0)):y&&(y.addEventListener("play",onPlay),y.addEventListener("ended",onEnded)),m?(m.addEventListener("play",onPlay),m.addEventListener("ended",onEnded),g&&(g.muted=!0),v&&(v.muted=!0)):g&&(g.addEventListener("play",onPlay),g.addEventListener("ended",onEnded),v&&(v.muted=!0)),v&&(v.addEventListener("play",onPlay),v.addEventListener("ended",onEnded)),b&&(b.addEventListener("play",onPlay),b.addEventListener("ended",onEnded));const[S,x,A,E,w,_]=await u();Object.assign(audioData$1.songCollection,{beatSongEle:S,betaBackgroundEle:x,betaFanSongEle:A,betaBanSongEle:E,beatMingSongEle:w}),Object.assign(audioData$1.mingSongTypeCollection,{beatMingSongEle:w,beatMingSongGirlEle:_}),S?(S.addEventListener("play",onPlay),S.addEventListener("ended",onEnded),x&&(x.muted=!0)):x&&(x.addEventListener("play",onPlay),x.addEventListener("ended",onEnded)),A?(A.addEventListener("play",onPlay),A.addEventListener("ended",onEnded),E&&(E.muted=!0),w&&(w.muted=!0)):E&&(E.addEventListener("play",onPlay),E.addEventListener("ended",onEnded),w&&(w.muted=!0)),w&&(w.addEventListener("play",onPlay),w.addEventListener("ended",onEnded)),_&&(_.addEventListener("play",onPlay),_.addEventListener("ended",onEnded));const T=storeData.user.gender;T!=null&&(audioData$1.mingSongType=T),changeMingSongType(),state$1.audioDone=!0,state$1.isLoading=!1,console.timeEnd("音频加载时间"),console.log("音频数据:",audioData$1),api_playProgress(s)}else{state$1.audioDone=!0,state$1.isLoading=!1;const d=((c=state$1.times[state$1.times.length-1||0])==null?void 0:c.endtime)||0;audioData$1.duration=d,api_cloudTimeUpdae(o),api_cloudplayed(a)}}),onUnmounted(()=>{api_remove_cloudplayed(a),api_remove_cloudTimeUpdae(o)}),()=>createVNode(Fragment,null,[createVNode("div",{class:styles$w.audioList},[state$1.playMode==="MIDI"&&state$1.speed!=0&&createVNode("iframe",{style:{display:"none"},ref:midiRef,src:"/midi/index.html",onLoad:i},null)])])}}),browserInfo$1=browser();let tipsTimer=null;const audioData=reactive({tick:null,tock:null}),metronomeData=reactive({disable:!0,initPlayerState:!1,lineShow:!1,isClick:!1,metro:null,metroList:[],activeList:[],metroMeasure:[],activeIndex:null,activeMetro:{},cursorMode:1,cursorTips:"",followAudioIndex:1,totalNumerator:2});watch(()=>metronomeData.cursorMode,()=>{const i=document.querySelector("#cursorImg-0");if(i){switch(metronomeData.cursorMode){case 1:i.classList.remove("lineHide"),i.style.opacity="inherit",metronomeData.cursorTips="您已切换到指针跟随音符播放",i.style.opacity="inherit";break;case 2:i.classList.add("lineHide"),i.style.opacity="inherit",metronomeData.cursorTips="您已切换到指针跟随节拍播放";break;case 3:i.style.opacity="0",metronomeData.cursorTips="您已关闭指针显示";break}hideCursorTip()}});watch(()=>metronomeData.lineShow,()=>{const i=document.querySelector("#cursorImg-0");i&&(metronomeData.lineShow?i.classList.add("lineHide"):i.classList.remove("lineHide"))});class Metronome{constructor(e){ii(this,"playType","tick");ii(this,"source",null);ii(this,"source1",null);ii(this,"source2",null);ii(this,"createAudio",e=>new Promise(r=>{const s=new Audio(e);s.load(),s.onloadedmetadata=()=>{r(s)},s.onerror=()=>{r(null)}}));ii(this,"sound",e=>{state$1.sectionStatus||(e=setCurrentTime(e));let r=-1,s=-1;for(let o=0;o=a)r=o,s=a;else break}if(r>-1&&metronomeData.activeIndex!==r){metronomeData.activeIndex=r,metronomeData.activeMetro=this.getStep(s),this.playAudio(),metronomeData.isClick=!1;return}metronomeData.isClick=!1});ii(this,"playAudio",()=>{var r;if(state$1.modeType==="practise"&&state$1.playMode!=="MIDI"&&(state$1.playType==="play"&&state$1.playSource==="music"&&audioData$1.songCollection.beatSongEle||state$1.playType==="play"&&state$1.playSource==="background"&&audioData$1.songCollection.betaBackgroundEle||state$1.playType==="sing"&&state$1.playSource==="music"&&audioData$1.songCollection.betaFanSongEle||state$1.playType==="sing"&&state$1.playSource==="background"&&audioData$1.songCollection.betaBanSongEle||state$1.playType==="sing"&&state$1.playSource==="mingSong"&&audioData$1.songCollection.betaMingSongEle)||!metronomeData.initPlayerState||state$1.playState==="paused")return;const e=state$1.setting.beatVolume/100;this.source=((r=metronomeData.activeMetro)==null?void 0:r.index)===0?audioData.tick:audioData.tock,this.source.volume=metronomeData.disable?0:e,this.source.volume<=0?this.source.muted=!0:this.source.muted=!1,this.source.play()});ii(this,"simulatePlayAudio",()=>{if(!metronomeData.initPlayerState)return;const e=state$1.setting.beatVolume/100;this.source=metronomeData.followAudioIndex===1?audioData.tick:audioData.tock,this.source.volume=metronomeData.disable?0:e,this.source.volume<=0?this.source.muted=!0:this.source.muted=!1,this.source.play(),metronomeData.followAudioIndex+=1,metronomeData.followAudioIndex=metronomeData.followAudioIndex>metronomeData.totalNumerator?1:metronomeData.followAudioIndex});ii(this,"loadAudio1",()=>new howler.Howl({src:tockAndTick.tick}));ii(this,"loadAudio2",()=>new howler.Howl({src:tockAndTick.tock}))}init(e){this.calculation(e),metronomeData.activeList=[],this.initPlayer()}initPlayer(){metronomeData.initPlayerState||Promise.all([this.createAudio(tickWav),this.createAudio(tockWav)]).then(([e,r])=>{e&&(audioData.tick=e),r&&(audioData.tock=r),metronomeData.initPlayerState=!0})}selectPlay(){}getStep(e){for(let r=0;ra.time===e);if(o)return o}return{}}calculation(e){var l,u,c,d,y,m,g,v,b,S,x,A,E,w;const r=[];let s=-1;for(let _=0;_-1&&C!=s){let k=T.measures[0].time;!state$1.isEvxml&&_===0&&(k=T.measures[T.measures.length-1].endtime-T.measures[0].measureLength);const M={measureNumberXML:C,measureNumberIndex:P,numerator:((g=(m=(y=T==null?void 0:T.noteElement)==null?void 0:y.sourceMeasure)==null?void 0:m.ActiveTimeSignature)==null?void 0:g.numerator)||0,start:k,end:T.measures[T.measures.length-1].endtime,time:T.measures[T.measures.length-1].endtime-k,stave_x:((A=(x=(S=(b=(v=T==null?void 0:T.noteElement)==null?void 0:v.sourceMeasure)==null?void 0:b.verticalMeasureList)==null?void 0:S[0])==null?void 0:x.stave)==null?void 0:A.x)||0,end_x:((E=T==null?void 0:T.stave)==null?void 0:E.end_x)||0||0,stepList:[],svgs:[],isRestFlag:T.isRestFlag};if([121].includes(state$1.subjectId)){const R=e.filter(H=>{var B,F;return((F=(B=H==null?void 0:H.noteElement)==null?void 0:B.sourceMeasure)==null?void 0:F.measureListIndex)==P});T.measures=R,M.start=T.measures[0].time,M.end=T.measures[T.measures.length-1].endtime,M.time=T.measures[T.measures.length-1].endtime-T.measures[0].time;try{const H=T.noteElement.sourceMeasure.verticalMeasureList.reduce((F,I)=>(F.push(...I.vfVoices[1].tickables),F),[]),B=[];M.svgs=H.map(F=>{const I=F.getBoundingBox().x;if(!B.includes(I)&&F.duration!=="w")return B.push(I),F._start_x=I,F}).filter(Boolean).sort((F,I)=>F._start_x-I._start_x)}catch(H){console.log(H)}M.stepList=calculateMutilpleMetroStep(T.measures,M)}else{let R=T.measures;state$1.isCombineRender&&(R=R.filter(H=>H.MeasureNumberXML===M.measureNumberXML)),M.stepList=calculateMetroStep(R,M)}r.push(M),s=C}}let o=[];const a=[];try{for(let _=0;_-1?`${B} + ${k}%`:`${B}px + ${k}%`:`${k}%`,T.stepList[M]=H}a[_].push({index:M,time:R,left:(H==null?void 0:H.indexOf("%"))>-1?`calc(${H})`:H,measureNumberXML:T.measureNumberXML,isRestFlag:T.isRestFlag})}}}catch(_){console.log(_)}console.log("节拍器",o,a),metronomeData.metroList=o,metronomeData.metroMeasure=a,metronomeData.activeMetro=((w=a[0])==null?void 0:w[0])||{}}}function calculateMetroStep(i,e){var u,c,d,y,m,g,v,b,S,x,A,E,w,_,T,C,P,k,M,R,H,B,F,I,U,D,$,N,O,Q,z,W,xe,ye,q,re,ue,ge,Se,Be,Ie,J,se,V,pe,ce,K,Z,he,Ce,Ae,_e,ke,Re,Ee,le,we,de,De,Ve,$e,Je,Ye,tt,Ze,ot,pt;const s=i.reduce((nt,ct)=>(nt+=ct._noteLength,nt),0)/e.numerator;if(i.length===1){const nt=i[0].svgElement;if(nt&&!nt.isRest()){const ct=((m=(y=(d=(c=(u=nt==null?void 0:nt.attrs)==null?void 0:u.el)==null?void 0:c.parentElement)==null?void 0:d.parentElement)==null?void 0:y.getBoundingClientRect)==null?void 0:m.call(y))||{x:0,right:0};let Pt=((b=(v=(g=nt==null?void 0:nt.attrs)==null?void 0:g.el)==null?void 0:v.getBoundingClientRect)==null?void 0:b.call(v))||{x:0},at=Math.abs(ct.right-Pt.x)/e.numerator,ft=[];for(let wt=0;wt=1){o-=s;let ft=((B=(H=(R=(M=(k=(P=ct==null?void 0:ct.svgElement)==null?void 0:P.attrs)==null?void 0:k.el)==null?void 0:M.parentElement)==null?void 0:R.parentElement)==null?void 0:H.getBoundingClientRect)==null?void 0:B.call(H))||{x:0};if(state$1.musicRenderType!=="staff"&&(ft=((O=(N=($=(D=(U=(I=(F=ct==null?void 0:ct.svgElement)==null?void 0:F.attrs)==null?void 0:I.el)==null?void 0:U.parentElement)==null?void 0:D.parentElement)==null?void 0:$.querySelector(".vf-stave"))==null?void 0:N.getBoundingClientRect)==null?void 0:O.call(N))||{x:0}),!ft.width&&a.length>0&&(ft=state$1.musicRenderType!=="staff"?((ue=(re=(q=(ye=(xe=(W=(z=(Q=a[0])==null?void 0:Q.svgElement)==null?void 0:z.attrs)==null?void 0:W.el)==null?void 0:xe.parentElement)==null?void 0:ye.parentElement)==null?void 0:q.querySelector(".vf-stave"))==null?void 0:re.getBoundingClientRect)==null?void 0:ue.call(re))||{x:0}:((V=(se=(J=(Ie=(Be=(Se=(ge=a[0])==null?void 0:ge.svgElement)==null?void 0:Se.attrs)==null?void 0:Be.el)==null?void 0:Ie.parentElement)==null?void 0:J.parentElement)==null?void 0:se.getBoundingClientRect)==null?void 0:V.call(se))||{x:0}),a.length>0){let ee=((he=(Z=(K=(ce=(pe=a[0])==null?void 0:pe.svgElement)==null?void 0:ce.attrs)==null?void 0:K.el)==null?void 0:Z.getBoundingClientRect)==null?void 0:he.call(Z))||{x:0},ae=ee.x-ft.x;if(a[0]._noteLength/s>=1){const Te=((Re=(ke=(_e=(Ae=(Ce=i[a[0].index+1])==null?void 0:Ce.svgElement)==null?void 0:Ae.attrs)==null?void 0:_e.el)==null?void 0:ke.getBoundingClientRect)==null?void 0:Re.call(ke))||{x:ft.right},Ne=Math.abs(ee.x-Te.x)/2;ae=ee.x-ft.x+Ne}l.push(ae)}else{let ae=(((de=(we=(le=(Ee=ct==null?void 0:ct.svgElement)==null?void 0:Ee.attrs)==null?void 0:le.el)==null?void 0:we.getBoundingClientRect)==null?void 0:de.call(we))||{x:0}).x-ft.x;l.push(ae)}a=[];let wt=((Je=($e=(Ve=(De=ct==null?void 0:ct.svgElement)==null?void 0:De.attrs)==null?void 0:Ve.el)==null?void 0:$e.getBoundingClientRect)==null?void 0:Je.call($e))||{x:0},Gt=wt.x-ft.x,Ht=0;if(at>1){const ee=((pt=(ot=(Ze=(tt=(Ye=i[nt+1])==null?void 0:Ye.svgElement)==null?void 0:tt.attrs)==null?void 0:Ze.el)==null?void 0:ot.getBoundingClientRect)==null?void 0:pt.call(ot))||{x:ft.right};Ht=Math.abs(wt.x-ee.x)/at}for(let ee=1;eeNumber.EPSILON&&o>0&&a.push(ct)}return l=l.reduce((nt,ct)=>(nt.includes(ct)?nt.push(void 0):nt.push(ct),nt),[]),l}function calculateMutilpleMetroStep(i,e){var u,c,d,y,m,g,v,b,S,x,A,E,w,_,T,C,P,k,M;const r=e.time/e.numerator,s=((v=(g=(m=(y=(d=(c=(u=i[0])==null?void 0:u.svgElement)==null?void 0:c.attrs)==null?void 0:d.el)==null?void 0:y.parentElement)==null?void 0:m.parentElement)==null?void 0:g.getBoundingClientRect)==null?void 0:v.call(g))||{x:0};if(i.length===1){const R=e.svgs[0];let H=((x=(S=(b=R==null?void 0:R.attrs)==null?void 0:b.el)==null?void 0:S.getBoundingClientRect)==null?void 0:x.call(S))||{x:0};return R&&!R.isRest()?[H.x-s.x]:[]}let o=0,a=[],l=[];for(let R=0;Rr){o-=r;let U=I.x-s.x;a.length>0&&(F=(T=(_=e.svgs[a[0]._index])==null?void 0:_.attrs)==null?void 0:T.el,I=((C=F==null?void 0:F.getBoundingClientRect)==null?void 0:C.call(F))||{x:0},U=I.x-s.x),l.push(U),a=[]}else a.push(H);if(Math.abs(o-r)<.001){let U=I.x-s.x;a.length>0&&(F=(k=(P=e.svgs[a[0]._index])==null?void 0:P.attrs)==null?void 0:k.el,I=((M=F==null?void 0:F.getBoundingClientRect)==null?void 0:M.call(F))||{x:0},U=I.x-s.x),l.push(U),o=0,a=[]}}return l=l.reduce((R,H)=>(R.includes(H)?R.push(void 0):R.push(H),R),[]),l}function setCurrentTime(i){return browserInfo$1.huawei||browserInfo$1.xiaomi?i+=.125:browserInfo$1.android?i+=.11:browserInfo$1.ios&&(i+=.01),i}function hideCursorTip(){tipsTimer?(clearTimeout(tipsTimer),tipsTimer=setTimeout(()=>{metronomeData.cursorTips="",clearTimeout(tipsTimer),tipsTimer=null},2e3)):tipsTimer=setTimeout(()=>{metronomeData.cursorTips="",clearTimeout(tipsTimer),tipsTimer=null},2e3)}var GradualVersion=(i=>(i[i.BASE=0]="BASE",i[i.ENSEMBLE=1]="ENSEMBLE",i))(GradualVersion||{});const query=getQuery();var EnumMusicRenderType=(i=>(i.staff="staff",i.firstTone="firstTone",i.fixedTone="fixedTone",i))(EnumMusicRenderType||{});const musicscoresettingKey="musicscoresetting";var IPlatform=(i=>(i.APP="APP",i.PC="PC",i))(IPlatform||{});const state=reactive({platform:"",appName:"",musicRenderType:"staff",musicRendered:!1,detailId:"",xmlUrl:"",subjectId:0,trackId:0,isVip:!1,categoriesId:0,categoriesName:"",enableEvaluation:!0,enableNotation:!1,specialShowNotation:!1,examSongId:"",cbsExamSongId:"",examSongName:"",coverImg:"",extConfigJson:{},extStyleConfigJson:{},isOpenMetronome:!1,isSingOpenMetronome:!1,isShowFingering:!1,music:"",accompany:"",fanSong:"",banSong:"",mingSong:"",mingSongGirl:"",beatSong:{music:"",accompany:"",fanSong:"",banSong:"",mingSong:"",mingSongGirl:""},midiUrl:"",parentCategoriesId:0,musicSheetCategoriesId:0,bizMusicCategoryId:0,playMode:"MP3",speed:0,originSpeed:0,playIngSpeed:0,track:"",partIndex:0,needTick:!1,needSingTick:!1,osmd:null,isSpecialBookCategory:!1,playState:"paused",playEnd:!1,playType:"play",playSource:"music",playProgress:0,activeNoteIndex:0,activeMeasureIndex:-1,sectionStatus:!1,section:[],sectionBoundingBoxs:[],isOpenPrepare:!1,sectionFirst:null,times:[],modeType:"practise",setting:{soundEffect:!0,eyeProtection:!1,camera:!1,cameraOpacity:70,repeatAutoPlay:!0,displayFingering:!0,displayCursor:!0,frequency:0,evaluationDifficulty:"BEGINNER",saveToAlbum:!0,enableAccompaniment:!0,reactionTimeMs:0,beatVolume:50},baseFrequency:440,fixtime:0,evXmlBeginTime:0,secondEvXmlBeginTime:0,evXmlBeginArr:[],fingeringInfo:{},scrollContainer:"musicAndSelection",isPercussion:!1,evaluationStandard:"",repeatedBeats:0,partListNames:[],gradual:[],gradualVersion:GradualVersion.BASE,gradualTimes:null,multitrack:0,zoom:.8,musicZoom:1,isSelectMeasureMode:!1,isReport:!1,isHideEvaluatReportSaveBtn:!1,isConcert:!1,userChooseEndIndex:0,repeatInfo:[],canSelectTracks:[],subjectCodeId:0,musicalCodeId:0,musicalCode:"",isCombineRender:!1,isScoreRender:!1,defaultScoreRender:!1,noMusicSource:!1,measureTime:0,beatStartTime:0,isPreView:!1,isEvaluatReport:!1,midiPlayIniting:!1,songs:{},isAppPlay:!1,audiosInstance:null,durationNum:0,midiSectionStart:0,audioDone:!1,isSingleLine:!0,isEvxml:!1,noTimes:[],playBtnDirection:"left",musicScoreBtnDirection:"right",isAttendClass:!1,guideInfo:null,noteCoords:[],specialPosInit:!1,paymentType:null,defaultModeType:1,maxLyricNum:0,vfmeasures:[],musicComposer:"",musicLyricist:"",isLoading:!0,loadingText:"音频资源加载中,请稍后…",isSimplePage:!1,originAudioPlayRate:1,basePlayRate:1,hasDriverPop:!1,noSavePopShow:!0,xmlHasLyric:!1,isCreateImg:!1,workSectionNeedReset:!1,melodyLine:!0});browser();const customData=reactive({customNoteRealValue:[],customNoteCurrentTime:!1}),setStep=()=>{if(state.playState!=="play"){console.log("暂停播放");return}let i=Date.now();requestAnimationFrame(()=>{Date.now()-i<16.7?(handlePlaying(),setStep()):setTimeout(()=>{handlePlaying(),setStep()},16.7)})},onPlay=()=>{console.log("开始播放","音频总时长:",getAudioDuration()),state.playEnd=!1,setStep()},autoResetPlay=()=>{state.modeType==="practise"&&(skipNotePlay(0,!0),state.setting.repeatAutoPlay&&(scrollViewNote(),setTimeout(()=>{togglePlay("play")},1e3)))},onEnded=()=>{if(console.log("音频播放结束"),state.playEnd){console.log("音频播放结束,无需再次执行");return}state.playEnd=!0,state.playState="paused",audioListStart(state.playState),handleEndEvaluat(!0),autoResetPlay()},dynamicShowPlaySpeed=i=>{if(!headerColumnHide.value){console.log("动态计算速度");const e=state.times[i];if(e&&e.measureSpeed){const r=Math.floor(state.basePlayRate*e.measureSpeed);state.speed!==r&&(state.speed=r)}}},initSetPlayRate=()=>{const i=state.sectionStatus&&state.section.length===2?state.sectionFirst||state.section[0]:state.times[state.activeNoteIndex];if(i&&i.measureSpeed){const e=state.speed/i.measureSpeed;state.basePlayRate=e||1,console.log("播放倍率",state.basePlayRate)}},resetBaseRate=i=>{const e=i||0,r=state.times[e],s=r!=null&&r.measureSpeed?r.measureSpeed:state.originSpeed;console.log("速度2",s),state.speed=s,state.basePlayRate=1},handlePlaying=()=>{const i=getAudioCurrentTime(),e=getAudioDuration();state.playProgress=i/e*100;let r=getNote(i);if(r){if(state.sectionStatus&&state.section.length===2){const s=state.sectionFirst?state.sectionFirst:state.section[0],o=state.section[1];if(state.repeatInfo.length){const a=verifyCanRepeat(state.section[0].MeasureNumberXML,state.section[1].MeasureNumberXML),l=a.repeatIdx==-1?0:a.repeatIdx;if(state.modeType==="practise"&&!a.canRepeat&&state.section[1].MeasureNumberXML>state.repeatInfo[l].end){const u=state.times[r.i-1];if(u&&u.MeasureNumberXML>r.MeasureNumberXML){const c=state.times.find(d=>d.MeasureNumberXML===u.MeasureNumberXML+1);if(c){setAudioCurrentTime(c.time,c.i),gotoNext(c);return}}}}if(i-o.endtime>=0){if(console.log("选段播放结束",state.setting.repeatAutoPlay),state.modeType==="evaluating"&&state.isSelectMeasureMode){onEnded();return}if(state.modeType==="practise"&&state.sectionStatus){onEnded(),resetPlaybackToStart();return}r=s,setAudioCurrentTime(s.time,s.i)}}gotoNext(r),dynamicShowPlaySpeed(r.i)}state.isSingleLine&&moveSmoothAnimationByPlayTime()},skipNotePlay=async(i,e=!1)=>{console.log("点击音符");const r=state.times[i];let s=r.time;e&&(s=0),r&&(r.measureSpeed&&state.section.length<2&&(state.speed=Math.floor(state.basePlayRate*r.measureSpeed)),setAudioCurrentTime(s,i),gotoNext(r,!0),state.isAppPlay&&(await api_cloudSetCurrentTime({currentTime:s*1e3,songID:state.examSongId}),audioData$1.progress=s,state.midiSectionStart=s),followData.start&&skipNotePractice())},togglePlay=async(i,e)=>{if(!state.isAppPlay&&!state.audioDone){e||showToast("音频资源加载中,请稍后");return}if(i==="play"&&state.modeType==="practise"&&state.playMode!=="MIDI"&&(console.log("设置音源"),changeSongSourceByBate(metronomeData.disable)),state.isAppPlay){if(i==="paused"){await api_cloudSuspend({songID:state.examSongId}),state.playState="paused",closeTick();return}skipNotePlay(state.activeNoteIndex,!1),await api_cloudChangeSpeed({speed:state.modeType==="evaluating"?state.originSpeed:state.speed,originalSpeed:state.originSpeed,songID:state.examSongId});const s=await api_cloudGetMediaStatus(),o=(s==null?void 0:s.content.status)==="suspend"?"play":"paused";state.playState=o}else state.playState=i;state.playState==="play"&&state.sectionStatus&&state.section.length==2&&state.playProgress===0&&resetPlaybackToStart(),state.playState==="paused"&&closeTick();const r=state.section.length===2&&state.section[0].MeasureNumberXML===2;if(state.playState==="play"&&getAudioCurrentTime()===0&&!r&&(state.playType==="play"&&state.needTick||state.playType==="sing"&&state.needSingTick))if(state.playType==="play"&&!state.isOpenMetronome||state.playType==="sing"&&!state.isSingOpenMetronome){if(!await handleStartTick())return state.playState="paused",!1}else handleStartTick();return state.playState=="play"&&state.sectionStatus&&state.section.length<2&&clearSelection(),initSetPlayRate(),audioListStart(state.playState),!0},handleStopPlay=()=>{state.playState="paused",audioListStart(state.playState)},resetPlaybackToStart=()=>{var i;if(state.sectionStatus&&state.section.length===2){state.section=formateSelectMearure(state.section);return}else metronomeData.activeMetro=((i=metronomeData.metroMeasure[0])==null?void 0:i[0])||{};skipNotePlay(0,!0)},gotoCustomNote=i=>{try{state.osmd.cursor.reset()}catch(e){}for(let e=0;e{const r=i.i;if(state.activeNoteIndex===i.i){state.playState==="paused"&&fillWordColor(),state.isSingleLine&&state.playState==="paused"&&moveSvgDom(e);return}const s=state.osmd;let o=state.activeNoteIndex;if(state.activeNoteIndex=r,state.activeMeasureIndex=i.MeasureNumberXML,dynamicShowPlaySpeed(state.activeNoteIndex),o&&r-o===1)s.cursor.next();else if(o&&r-o>0)for(;r-o>0;)o++,s.cursor.next();else gotoCustomNote(r);fillWordColor(),state.isSingleLine&&moveSvgDom(e),scrollViewNote()},getNote=i=>{const e=state.times,r=state.times.length;if(i>e[r-1].endtime+2&&!state.isAppPlay&&!state.isSimplePage){onEnded();return}let s=null;for(let o=state.activeNoteIndex;o=a.time)(!l||a.time!=l.time)&&(s=a);else break}return s},handleResetPlay=()=>{state.isAppPlay&&(audioData$1.progress=0),query.workRecord||resetBaseRate(),resetPlaybackToStart(),togglePlay("play")},handleSetSpeed=i=>{state.speed=i;const e=state.sectionStatus&&state.section.length===2?state.sectionFirst||state.section[0]:state.times[state.activeNoteIndex];state.basePlayRate=e!=null&&e.measureSpeed?state.speed/e.measureSpeed:state.speed/state.originSpeed;const r=state.originAudioPlayRate*state.basePlayRate;console.log("速度设置",i,"小节计算的倍率",state.basePlayRate,"实际播放倍率",r)},clearSelection=()=>{state.sectionStatus=!1,state.section=[],closeToast()},handleChangeSection=()=>{if(state.sectionStatus){togglePlay("paused"),clearSelection(),resetBaseRate(state.activeNoteIndex),state.sectionFirst=null;return}state.sectionStatus=!0,state.sectionStatus&&togglePlay("paused"),showToast({message:"请选择开始小节",duration:0,position:"top",className:"selectionToast"})},formateSelectMearure=i=>{var u,c;if(!i.length)return[];const e=i.sort((d,y)=>d.time-y.time),r=(u=e[0])==null?void 0:u.measureOpenIndex,s=(c=e.last())==null?void 0:c.measureOpenIndex,o=state.times.filter(d=>r===d.measureOpenIndex)||[],a=state.times.filter(d=>s===d.measureOpenIndex)||[];if(!o.length||!a.length)return clearSelection(),[];e[0]=o[0],e[1]=a.last();let l=e[0].i;if(state.isOpenPrepare){const d=e[0].MeasureNumberXML;state.sectionFirst=state.times.find(y=>d-y.MeasureNumberXML===1),l=state.sectionFirst?state.sectionFirst.i:l}return skipNotePlay(l,l===0),e},handleSelection=i=>{!state.sectionStatus||state.section.length>1||(state.section.length!==2&&i&&(state.section.push(i),state.section.length===2&&(setSection(state.section[0].MeasureNumberXML,state.section[1].MeasureNumberXML),closeToast())),state.section.length===1&&showToast({message:"请选择结束小节",duration:0,position:"top",className:"selectionToast"}))},setSection=(i,e,r)=>{var S,x,A,E;const s=state.times.filter(w=>w.noteElement.sourceMeasure.MeasureNumberXML==i),o=state.times.filter(w=>w.noteElement.sourceMeasure.MeasureNumberXML==e);state.userChooseEndIndex=e;const a=o[o.length-1].noteId;let l=o.filter(w=>w.noteId===a);const u=verifyCanRepeat(i,e);console.log("能否重播",u);const c=u.canRepeat;let d=!1;l.length===1&&(d=(A=(x=(S=l[0])==null?void 0:S.stave)==null?void 0:x.modifiers)==null?void 0:A.some(w=>w.getAttribute("type")==="Volta"));let y=e;const m=((E=state.repeatInfo[u.repeatIdx])==null?void 0:E.end)||0;for(;c&&l.length===1&&l[0].MeasureNumberXML<=m&&!d;){y=y-1;const w=state.times.filter(T=>T.noteElement.sourceMeasure.MeasureNumberXML==y),_=w[w.length-1].noteId;l=w.filter(T=>T.noteId===_)}const g=c&&u.repeatIdx==state.repeatInfo.length-1?l.length-1:0,v=s[0],b=l[g];v&&b&&(state.isSelectMeasureMode=!0,hanldeDirectSelection([v,b]),r&&handleSetSpeed(r))},hanldeDirectSelection=i=>{!Array.isArray(i)||i.length!==2||(state.sectionStatus=!0,setTimeout(()=>{state.section=formateSelectMearure(i);const e=state.sectionStatus&&state.section.length===2?state.sectionFirst||state.section[0]:state.times[state.activeNoteIndex];e.measureSpeed&&query.workRecord===void 0&&handleSetSpeed(e.measureSpeed),console.log("选段小节",state.section)},0))};let offsetTop=0;const scrollViewNote=()=>{const i=document.getElementById("cursorImg-0"),e=document.getElementById(state.scrollContainer);!i||!e||offsetTop===i.offsetTop||(offsetTop=i.offsetTop,offsetTop>50?e.scrollTo({top:(offsetTop-50)*state.musicZoom,behavior:"smooth"}):e.scrollTo({top:0,behavior:"smooth"}))},isRhythmicExercises=()=>state.examSongName.indexOf("节奏练习")>-1,handleRessetState=()=>{state.noSavePopShow=!0,clearSelection(),skipNotePlay(0,!0),resetBaseRate(),state.isAppPlay&&(audioData$1.progress=0),state.modeType==="evaluating"?handleStartEvaluat():state.modeType==="practise"?togglePlay("paused",!0):state.modeType==="follow"&&toggleFollow(!1)},state$1=state,followBeatPaly=()=>{let i=null;if(!followData.start){clearTimeout(i),i=null;return}const e=state.measureTime*1e3/metronomeData.totalNumerator/state.basePlayRate;requestAnimationFrame(()=>{var s;Date.now()-state.beatStartTime{var u,c,d,y,m,g;if(prevActiveNoteIndex!==-1){const v=(d=(c=(u=state.times[prevActiveNoteIndex])==null?void 0:u.svgElement)==null?void 0:c.attrs)==null?void 0:d.id,b=document.getElementById(`vf-${v}`),S=document.getElementById(`vf-${v}-stem`),x=document.getElementById(`vf-${v}-lines`);b==null||b.classList.remove("noteActive"),S==null||S.classList.remove("noteActive"),x==null||x.classList.remove("noteActive")}const i=(g=(m=(y=state.times[state.activeNoteIndex])==null?void 0:y.svgElement)==null?void 0:m.attrs)==null?void 0:g.id,e=document.getElementById(`vf-${i}`),r=document.getElementById(`vf-${i}-stem`),s=document.getElementById(`vf-${i}-lines`);e==null||e.classList.add("noteActive"),r==null||r.classList.add("noteActive"),s==null||s.classList.add("noteActive"),prevActiveNoteIndex=state.activeNoteIndex;const o=state.times[state.activeNoteIndex];Array.from(document.querySelectorAll(".vf-lyric")).forEach(v=>{v==null||v.classList.remove("lyricActive")}),Array.from(document.querySelectorAll(`.lyric${o==null?void 0:o.noteId}`)).forEach((v,b)=>{var A,E;const S=v.getAttribute("lyricIndex"),x=(A=o.measures)==null?void 0:A.every(w=>{var _;return((_=w==null?void 0:w.formatLyricsEntries)==null?void 0:_.length)<=1});(b===o.repeatIdx&&o.repeatIdx+1==S||o.repeatIdx!=b&&!x&&o.repeatIdx+1==S||o.repeatIdx>0&&((E=o.formatLyricsEntries)==null?void 0:E.length)===1&&x)&&(v==null||v.classList.add("lyricActive"))})},moveSvgDom=i=>{var e,r,s,o,a,l;if(i){smoothAnimationState.translateXNum=0,moveTranslateXNum(0),moveSmoothAnimation(0,state.activeNoteIndex,!1);const u=((e=state.times[state.activeNoteIndex].bbox)==null?void 0:e.originWidth)||((r=state.times[state.activeNoteIndex].bbox)==null?void 0:r.width),c=((s=state.times[0].bbox)==null?void 0:s.originWidth)||((o=state.times[0].bbox)==null?void 0:o.width),d=((a=state.times[state.activeNoteIndex].bbox)==null?void 0:a.x)-((l=state.times[0].bbox)==null?void 0:l.x)+u/2-c/2;smoothAnimationState.osdmScrollDom.scrollTo({left:d,behavior:"smooth"})}};watch(()=>state.playState,()=>{state.isSingleLine&&!state.playEnd&&state.playState==="paused"&&(moveTranslateXNum(0),requestAnimationFrame(()=>{const i=smoothAnimationState.osdmScrollDom.scrollLeft;smoothAnimationState.osdmScrollDom.scrollLeft=i+smoothAnimationState.translateXNum,smoothAnimationState.translateXNum=0}))});watch(()=>state.activeMeasureIndex,()=>{state.vfmeasures.forEach((i,e)=>{var o,a,l,u,c,d,y,m,g,v,b,S;const r=i.getAttribute("data-num")?Number(i.getAttribute("data-num")):-1,s=(o=state.vfmeasures[e+1])!=null&&o.getAttribute("data-num")?Number((a=state.vfmeasures[e+1])==null?void 0:a.getAttribute("data-num")):-1;if(r>=0&&(r===state.activeMeasureIndex||rstate.activeMeasureIndex)||rA&&(x=state.section[1].MeasureNumberXML,A=state.section[0].MeasureNumberXML),r>=x&&r<=A&&((y=i.querySelector(".vf-custom-bg"))==null||y.setAttribute("fill","#609FCF"),(m=i.querySelector(".vf-custom-bot"))==null||m.setAttribute("fill","#2B70A5")),state.sectionFirst&&r===state.sectionFirst.MeasureNumberXML&&((g=i==null?void 0:i.querySelector(".vf-custom-bg"))==null||g.setAttribute("fill","#71B8BD"),(v=i==null?void 0:i.querySelector(".vf-custom-bot"))==null||v.setAttribute("fill","#448F9C"))}else(b=i.querySelector(".vf-custom-bg"))==null||b.setAttribute("fill","#609FCF"),(S=i.querySelector(".vf-custom-bot"))==null||S.setAttribute("fill","#2B70A5")})});watch(()=>state.section,()=>{if(state.section.length===2){let i=state.section[0].MeasureNumberXML,e=state.section[1].MeasureNumberXML;i>e&&(i=state.section[1].MeasureNumberXML,e=state.section[0].MeasureNumberXML),state.vfmeasures.forEach((r,s)=>{var a,l,u,c,d,y;const o=r.getAttribute("data-num")?Number(r.getAttribute("data-num")):1;oe&&((u=r.querySelector(".vf-custom-bg"))==null||u.setAttribute("fill","rgba(96,159,207,0.5)"),(c=r.querySelector(".vf-custom-bot"))==null||c.setAttribute("fill","rgba(43,112,165,0.5)")),state.sectionFirst&&o===state.sectionFirst.MeasureNumberXML&&((d=r==null?void 0:r.querySelector(".vf-custom-bg"))==null||d.setAttribute("fill","#71B8BD"),(y=r==null?void 0:r.querySelector(".vf-custom-bot"))==null||y.setAttribute("fill","#448F9C"))})}else state.vfmeasures.forEach((i,e)=>{var o,a,l,u,c,d;const r=i.getAttribute("data-num")?Number(i.getAttribute("data-num")):-1,s=(o=state.vfmeasures[e+1])!=null&&o.getAttribute("data-num")?Number((a=state.vfmeasures[e+1])==null?void 0:a.getAttribute("data-num")):-1;r>=0&&(r===state.activeMeasureIndex||rstate.activeMeasureIndex)?((l=i.querySelector(".vf-custom-bg"))==null||l.setAttribute("fill","#132D4C"),(u=i.querySelector(".vf-custom-bot"))==null||u.setAttribute("fill","#040D1E")):((c=i.querySelector(".vf-custom-bg"))==null||c.setAttribute("fill","#609FCF"),(d=i.querySelector(".vf-custom-bot"))==null||d.setAttribute("fill","#2B70A5"))})});const refreshMusicSvg=()=>{var i;clearSelection(),resetBaseRate(),state.activeMeasureIndex=-1,query.workRecord&&(state.workSectionNeedReset=!0),destroySmoothAnimation(),(i=musicScoreRef.value)==null||i.refreshMusicScore()};watch(()=>state.setting.displayFingering,()=>{var i,e;(i=state.fingeringInfo)!=null&&i.name&&state.fingeringInfo.direction==="vertical"&&state.isSingleLine&&nextTick(()=>{calcClientWidth()}),(e=state.fingeringInfo)!=null&&e.name&&state.fingeringInfo.direction==="vertical"&&!state.isSingleLine&&(headTopData.settingMode=!1,refreshMusicSvg())});const browserInfo=browser();dayjs.extend(duration);const getFixTime=i=>{const e=getDuration(state$1.osmd);let r=e.numerator||0,s=e.denominator||4;const o=e.beatUnit||"quarter";return state$1.repeatedBeats&&(r=r*2),60/i*formatBeatUnit(o)*(r/s)},retain=i=>Math.ceil(i*1e6)/1e6,formatLyricsEntries=i=>{var s,o;const e=((s=i.parentStaffEntry)==null?void 0:s.voiceEntries)||[],r=[];for(const a of e)if((o=a.lyricsEntries)!=null&&o.table){const l=Object.values(a.lyricsEntries.table);for(const u of l)r.push(u==null?void 0:u.value.text)}return r},createSpeedInfo=(i,e)=>{var r,s;if(i&&speedInfo[(r=i.startWord)==null?void 0:r.toLocaleLowerCase()]){const o=Math.max(i.endXmlNoteIndex,3),a=[],l=e,u=e/speedInfo[(s=i.startWord)==null?void 0:s.toLocaleLowerCase()];for(let c=0;c{let e=i;const r=i.split(":");return r.length===1?e=`00:${r[0]}:00`:r.length===2&&(e=`00:${r[0]}:${r[1]}`),`1970-01-01 00:${e}0`},getDuration=i=>{var r;if(i){const{Duration:s,TempoInBPM:o,ActiveTimeSignature:a,TempoExpressions:l}=(r=i.GraphicSheet.MeasureList[0][0])==null?void 0:r.parentSourceMeasure;if(s){let u="quarter";for(const d of l)u=d.InstantaneousTempo.beatUnit||"quarter";return{...formatDuration(a),TempoInBPM:o,beatUnit:u}}}return{...new Fraction$1,TempoInBPM:90,beatUnit:"quarter"}};function formatDuration(i,e){return i}function formatBeatUnit(i){let e=4;switch(i){case"1024th":e=1024;break;case"512th":e=512;break;case"256th":e=256;break;case"128th":e=128;break;case"64th":e=64;break;case"32nd":e=32;break;case"16th":e=16;break;case"eighth":e=8;break;case"quarter":e=4;break;case"half":e=2;break;case"whole":e=1;break;case"breve":e=.5;break;case"long":e=.25;break;case"maxima":e=.125;break}return e}function getTimeByBeatUnit(i,e,r){return r/formatBeatUnit(i)*e}const setElementNoteBefore=(i,e,r)=>{let s=0;if(e){for(let o=0;o0){let o=0;const a=Array.from(r.childNodes).filter(u=>u.nodeName==="note"),l=a[a.length-1];if(s>=a.length&&l){r.insertBefore(i,r.childNodes[Array.from(r.childNodes).indexOf(l)]);return}for(let u=0;u{if(i){const e=i.toLocaleLowerCase(),r="d\\s?\\.s\\.",s="d\\.\\s?c\\.";return e==="@"||StringUtil.StringContainsSeparatedWord(e,r+" al fine",!0)||StringUtil.StringContainsSeparatedWord(e,r+" al coda",!0)||StringUtil.StringContainsSeparatedWord(e,s+" al fine",!0)||StringUtil.StringContainsSeparatedWord(e,s+" al coda",!0)||StringUtil.StringContainsSeparatedWord(e,s)||StringUtil.StringContainsSeparatedWord(e,"da\\s?capo",!0)||StringUtil.StringContainsSeparatedWord(e,r,!0)||StringUtil.StringContainsSeparatedWord(e,"dal\\s?segno",!0)||StringUtil.StringContainsSeparatedWord(e,"al\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(e,"to\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(e,"a (la )?coda",!0)||StringUtil.StringContainsSeparatedWord(e,"fine",!0)||StringUtil.StringContainsSeparatedWord(e,"coda",!0)||StringUtil.StringContainsSeparatedWord(e,"segno",!0)}return!1},onlyVisible=(i,e)=>{var v,b,S,x,A,E,w,_,T;if(!i)return"";const r=state$1.examSongId+"",s=new DOMParser().parseFromString(i,"text/xml"),o=((b=(v=s.getElementsByTagName("part-list"))==null?void 0:v[0])==null?void 0:b.getElementsByTagName("score-part"))||[],a=Array.from(o).map(C=>{var P,k,M;return((M=(k=(P=C.getElementsByTagName("part-name"))==null?void 0:P[0])==null?void 0:k.textContent)==null?void 0:M.trim())||""}),l=s.getElementsByTagName("part"),u=[...(S=l[0])==null?void 0:S.getElementsByTagName("measure")],c=[...(x=l[0])==null?void 0:x.getElementsByTagName("metronome")],d=[...(A=l[0])==null?void 0:A.getElementsByTagName("words")],y=[...(E=l[0])==null?void 0:E.getElementsByTagName("coda")],m=[...(w=l[0])==null?void 0:w.getElementsByTagName("rehearsal")];((T=(_=a[0])==null?void 0:_.toLocaleUpperCase)==null?void 0:T.call(_))==="COMMON"&&(e++,a.shift());const g=o[e];if(state$1.partListNames=a,g){const C=g.getAttribute("id");Array.from(l).forEach(P=>{var k,M,R,H,B;if(P&&P.getAttribute("id")!==C)(k=P.parentNode)==null||k.removeChild(P);else if(P&&P.getAttribute("id")!=="P1"){const F={};for(let I=0;I{var O;const U=(O=I.parentElement)==null?void 0:O.parentElement,D=U==null?void 0:U.parentElement,$=[...(D==null?void 0:D.childNodes)||[]],N=U?$.indexOf(U):-1;if(D&&N>-1){const Q=u.indexOf(D),z=P.getElementsByTagName("measure")[Q];setElementNoteBefore(U,D,z)}}),d.forEach(I=>{var D;let U=I.textContent||"";if(U=["cresc."].includes(U)?"":U,(isSpecialMark(U)||isSpeedKeyword(U)||isGradientWords(U)||isRepeatWord(U)||GRADIENT_SPEED_RESET_TAG)&&U){const $=(D=I.parentElement)==null?void 0:D.parentElement,N=$==null?void 0:$.parentElement,O=[...(N==null?void 0:N.childNodes)||[]],Q=$?O.indexOf($):-1;if($&&N&&Q>-1){const z=u.indexOf(N),W=P.getElementsByTagName("measure")[z];Array.from((W==null?void 0:W.getElementsByTagName("words"))||[]).reduce((q,re)=>{var ue;return(ue=re.textContent)!=null&&ue.includes(U)&&q++,q},0)===0&&(["12280"].includes(r)?W==null||W.insertBefore($.cloneNode(!0),W==null?void 0:W.childNodes[Q]):setElementNoteBefore($,N,W))}}}),y.forEach(I=>{var O;const U=(O=I.parentElement)==null?void 0:O.parentElement,D=U==null?void 0:U.parentElement,$=[...(D==null?void 0:D.childNodes)||[]],N=U?$.indexOf(U):-1;if(U&&D&&N>-1){const Q=u.indexOf(D),z=P.getElementsByTagName("measure")[Q];["12280"].includes(r)?z==null||z.insertBefore(U.cloneNode(!0),z==null?void 0:z.childNodes[N]):setElementNoteBefore(U,D,z)}}),m.forEach(I=>{var $,N;const U=($=I.parentElement)==null?void 0:$.parentElement,D=U==null?void 0:U.parentElement;if(D){const O=u.indexOf(D);(N=P.getElementsByTagName("measure")[O])==null||N.appendChild(U.cloneNode(!0))}})}else d.forEach((F,I)=>{var D,$,N;const U=F.textContent||"";if(isSpeedKeyword(U)&&U){const O=($=(D=F.parentElement)==null?void 0:D.parentElement)==null?void 0:$.parentElement;if(O&&O.firstElementChild&&O.firstElementChild!==F){const Q=(N=F.parentElement)==null?void 0:N.parentElement,z=O.firstElementChild;O.insertBefore(Q,z)}}});if(P&&P.getAttribute("id")===C){const F=P.getElementsByTagName("barline"),I=(H=F[F.length-1])==null?void 0:H.parentElement;if(((B=I==null?void 0:I.lastElementChild)==null?void 0:B.tagName)!=="barline"){const U=(I==null?void 0:I.children)||[];for(let D of U)if(D.tagName==="barline"){I==null||I.appendChild(D);break}}}}),Array.from(o).forEach(P=>{var k;P&&P.getAttribute("id")!==C&&((k=P.parentNode)==null||k.removeChild(P))})}return new XMLSerializer().serializeToString(appoggianceFormate(s))},appoggianceFormate=i=>{var s,o,a,l;if(!i)return i;const e=i.querySelectorAll("grace");if(!e.length)return i;const r=u=>u.querySelector("grace")?r(u==null?void 0:u.nextElementSibling):u;for(let u of e){const c=(s=u.parentElement)==null?void 0:s.querySelector("notations");if(c&&c.querySelectorAll("slur").length>1){let d=r((o=u.parentElement)==null?void 0:o.nextElementSibling);if(d&&d.querySelectorAll("slur").length>0){const y=Array.from(((a=d.querySelector("notations"))==null?void 0:a.children)||[]).map(g=>g.getAttribute("number")),m=c.querySelectorAll("slur");for(let g of m)y.includes(g.getAttribute("number"))||(l=d.querySelector("notations"))==null||l.appendChild(g)}}}return i},formatXML=(i,e)=>{var m,g,v;if(!i)return"";const r=new DOMParser().parseFromString(i,"text/xml"),s=Array.from(r.getElementsByTagName("measure")),o=r.getElementsByTagName("per-minute");let a=[];for(const b of o)b.textContent&&Number(b.textContent)&&a.push(Number(b.textContent));a=[...new Set(a)];const l=a.length>1;state$1.originSpeed===0&&(state$1.originSpeed=a[0]?a[0]:100,state$1.speed=state$1.originSpeed),a.length===0?window.baseMeasureSpeed=state$1.originSpeed:state$1.originAudioPlayRate=a[0]/state$1.originSpeed,console.log("是否是变速的曲子:",l,a);const u=Array.from(r.querySelectorAll("repeat"));compatibleXmlPitchVoice(r),getComposer(r),parseXmlToRepeat(u),state$1.isEvxml&&(analyzeEvxml(r),customizationXml(r));let c=-1,d=-1,y=-1;for(const b of s){d===-1&&b.getElementsByTagName("beats").length&&(d=parseInt(b.getElementsByTagName("beats")[0].textContent||"4")),y===-1&&b.getElementsByTagName("beat-type").length&&(y=parseInt(b.getElementsByTagName("beat-type")[0].textContent||"4")),c===-1&&b.getElementsByTagName("per-minute").length&&(c=Number((m=b.getElementsByTagName("per-minute")[0])==null?void 0:m.textContent));const S=parseInt(((g=b.getElementsByTagName("divisions")[0])==null?void 0:g.textContent)||"256");b.getElementsByTagName("note").length&&state$1.isEvxml&&(Array.from(b.getElementsByTagName("note"))||[]).forEach(E=>{var w;E.getElementsByTagName("grace").length||(!E.getElementsByTagName("duration").length||E.getElementsByTagName("duration").length&&((w=E.getElementsByTagName("duration")[0])==null?void 0:w.textContent)==0)&&b.removeChild(E)});const x=new RegExp("[\\u4E00-\\u9FFF]+","g");if(b.getElementsByTagName("words").length&&state$1.isEvxml&&(Array.from(b.getElementsByTagName("words"))||[]).forEach(E=>{var w;E!=null&&E.textContent&&x.test(E==null?void 0:E.textContent)&&((w=E==null?void 0:E.parentNode)!=null&&w.parentNode)&&b.removeChild(E.parentNode.parentNode)}),b.getElementsByTagName("note").length===0){const A=(v=b.getElementsByTagName("forward")[0])==null?void 0:v.getElementsByTagName("duration")[0];A&&(A.textContent="0"),b.innerHTML=b.innerHTML+` ${S*d} 1 whole `}}return new XMLSerializer().serializeToString(r)},formateTimes=i=>{var W,xe,ye,q,re,ue,ge,Se,Be,Ie,J,se,V,pe,ce,K,Z,he,Ce,Ae,_e,ke,Re,Ee,le,we,de,De,Ve,$e,Je,Ye,tt,Ze,ot,pt,nt,ct,Pt,at,ft,wt,Gt,Ht,ee,ae,Te,Ne,We,rt,vt,Lt,qe,Rt;const e=customData.customNoteRealValue,r=customData.customNoteCurrentTime;state$1.examSongId+"",state$1.partIndex+"";let s=browserInfo.huawei?.08:0;const o=[],a=[],l=[],{originSpeed:u}=state$1;let c=0;const d=(ze,gt)=>{var ie,be,me,ve,Le,Oe;return["906"].includes(state$1.cbsExamSongId)?((ie=gt.measures[0])==null?void 0:ie.realKey)||ze:["782","784"].includes(state$1.cbsExamSongId)&&[14,16,30,32].includes((be=gt.firstVerticalMeasure)==null?void 0:be.measureNumber)?((me=o[o.length-1])==null?void 0:me.realKey)||ze:["900","901","640","641","739","740","800","801","773","774","869","872","714","715"].includes(state$1.cbsExamSongId)&&(((ve=gt.firstVerticalMeasure)==null?void 0:ve.measureNumber)===3||((Le=gt.firstVerticalMeasure)==null?void 0:Le.measureNumber)===9)&&((Oe=gt.measures[0])==null?void 0:Oe.realKey)||ze};if(!i.cursor)return[];const y=i.cursor.Iterator;console.time("音符跑完时间");let m=0,g=0,v=[],b=[],S=0,x=0,A=0,E="quarter",w,_,T=0,C=0,P=0,k=0,M=0,R=0,H=0,B=0;const F=[];state$1.gradualTimes&&console.log("后台设置的渐慢小节时间",state$1.gradual,state$1.gradualTimes);let I=y.currentTimeStamp.RealValue;const U=[];let D=!1,$=0,N=0;for(;!y.EndReached;){let ze=0,gt=0;for(let ve=0;ve1?1:0);continue}Le.notes[0].length.realValue0?oe=[...y.CurrentVoiceEntries]:oe=[...y.CurrentVoiceEntries].filter(ve=>{var Le;return ve&&((Le=ve==null?void 0:ve.ParentVoice)==null?void 0:Le.VoiceId)!=1});let ie=0,be=!1,me=!1;if(oe.length&&!D){be=!0;let ve=[...y.CurrentVoiceEntries].reduce((Le,Oe)=>(Le.push(...Oe.Notes),Le),[]);if(ve=ve.filter(Le=>!Le.IsGraceNote),ve=ve.sort((Le,Oe)=>{var Qe,Ke;return((Qe=Le==null?void 0:Le.length)==null?void 0:Qe.realValue)-((Ke=Oe==null?void 0:Oe.length)==null?void 0:Ke.realValue)}),ie=((re=(q=ve==null?void 0:ve[0])==null?void 0:q.length)==null?void 0:re.realValue)||0,state$1.multitrack>0&&oe.length===2){const Le=((ge=(ue=ve[0])==null?void 0:ue.length)==null?void 0:ge.realValue)||0;$=(((Be=(Se=ve[ve.length-1])==null?void 0:Se.length)==null?void 0:Be.realValue)||0)-Le,D=$!==0}}(Ie=F[F.length-1])!=null&&Ie.isDouble&&!oe.length&&(me=!0),state$1.multitrack>0&&!be&&D&&(be=!0,ie=$,D=!1,$=0),U.push(y.currentTimeStamp.realValue-I),I=y.currentTimeStamp.realValue;for(const ve of G){let Le=ve.notes[0];if(Le.IsGraceNote){const Oe=Le.parentStaffEntry.voiceEntries.find(Qe=>!Qe.isGrace);if(!Oe)continue;Le=Oe.notes[0]}if(Le.fixedKey=Le.ParentVoiceEntry.ParentVoice.Parent.SubInstruments[0].fixedKey||0,(J=Le==null?void 0:Le.voiceEntry)!=null&&J.isGrace){be=!0;let Oe=[...y.currentVoiceEntries].reduce((Qe,Ke)=>(Qe.push(...Ke.notes),Qe),[]);Oe=Oe.sort((Qe,Ke)=>{var lt,Ue;return((lt=Ke==null?void 0:Ke.length)==null?void 0:lt.realValue)-((Ue=Qe==null?void 0:Qe.length)==null?void 0:Ue.realValue)}),ie=ie!=0?Math.min((V=(se=Oe==null?void 0:Oe[0])==null?void 0:se.length)==null?void 0:V.realValue,ie):(ce=(pe=Oe==null?void 0:Oe[0])==null?void 0:pe.length)==null?void 0:ce.realValue}state$1.multitrack>0&&ie>Le.length.realValue&&(ie=Le.length.realValue),Le.maxNoteNum=Y,F.push({note:Le,iterator:{...y},currentTime:ie,isDouble:be,isMutileSubject:me,measuresTempoInBPM:(K=Le==null?void 0:Le.sourceMeasure)==null?void 0:K.tempoInBPM})}y.moveToNextVisibleVoiceEntry(!1),y.backJumpOccurred&&(N+=1),y.repeatIdx=N}const O=F.some(ze=>ze.measuresTempoInBPM!==F[0].measuresTempoInBPM);console.log("变速曲子",O,F);let Q=[];for(let{note:ze,iterator:gt,currentTime:G,isDouble:oe,isMutileSubject:Y}of F){if(ze){if(c!=((Z=ze==null?void 0:ze.sourceMeasure)==null?void 0:Z.MeasureNumberXML)&&(g=0),g===0&&c!=((he=ze==null?void 0:ze.sourceMeasure)==null?void 0:he.MeasureNumberXML)&&(c=(Ce=ze==null?void 0:ze.sourceMeasure)==null?void 0:Ce.MeasureNumberXML,l.push(ze.sourceMeasure)),g===0&&state$1.isSpecialBookCategory)for(const yt of(Ae=ze.sourceMeasure)==null?void 0:Ae.TempoExpressions)(_e=yt==null?void 0:yt.InstantaneousTempo)!=null&&_e.beatUnit&&(E=yt.InstantaneousTempo.beatUnit);M==((ke=ze.sourceMeasure)==null?void 0:ke.MeasureNumberXML)&&m!==0?k++:(M=(Re=ze.sourceMeasure)==null?void 0:Re.MeasureNumberXML,k=0);let ie=ze.sourceMeasure.tempoInBPM;const{metronomeNoteIndex:be}=gt.currentMeasure;be!==0&&be>g&&(ie=((Ee=o[o.length-1])==null?void 0:Ee.speed)||100);let me=[];state$1.isCombineRender&&ze.sourceMeasure.verticalMeasureList.length&&(ze.sourceMeasure.verticalMeasureList=(le=ze.sourceMeasure)==null?void 0:le.verticalMeasureList.filter(yt=>{var te;return state$1.canSelectTracks.includes((te=yt==null?void 0:yt.parentStaff)==null?void 0:te.parentInstrument.Name)})),me=[(de=(we=ze.sourceMeasure)==null?void 0:we.verticalMeasureList)==null?void 0:de[0]];let ve=(De=me[0])!=null&&De.vfVoices["1"]?(Ve=me[0])==null?void 0:Ve.vfVoices["1"]:($e=me[0])!=null&&$e.vfVoices["2"]?(Je=me[0])==null?void 0:Je.vfVoices["2"]:null;const Le=(tt=(Ye=ze.sourceMeasure)==null?void 0:Ye.verticalMeasureList)==null?void 0:tt.length;let Oe=0,Qe=ve==null?void 0:ve.tickables[k];for(;!Qe&&Le>1&&Oe<=Le-1&&ve!==null;)Oe+=1,me=[(ot=(Ze=ze.sourceMeasure)==null?void 0:Ze.verticalMeasureList)==null?void 0:ot[Oe]],ve=(pt=me[0])!=null&&pt.vfVoices["1"]?(nt=me[0])==null?void 0:nt.vfVoices["1"]:(ct=me[0])!=null&&ct.vfVoices["2"]?(Pt=me[0])==null?void 0:Pt.vfVoices["2"]:null,Qe=ve==null?void 0:ve.tickables[k];const{realValue:Ke}=gt.currentTimeStamp,{RealValue:lt,Denominator:Ue}=formatDuration(gt.currentMeasure.activeTimeSignature,gt.currentMeasure.duration);let{wholeValue:mt,numerator:Ct,denominator:Dt,realValue:_t}=ze.length;e[m]&&(_t=e[m]),oe&&G>0&&G!=_t&&(_t=G),r&&Y&&U[m+1]>0&&_t>U[m+1]&&(_t=U[m+1]);let St=x;state$1.isEvxml&&St0){const yt=state$1.gradual.find((Pe,Fe)=>{var Xe;const He=state$1.gradual[Fe+1];return Pe[0].measureIndex<=it&&((Xe=Pe[1])==null?void 0:Xe.measureIndex)>=it&&(!He||(He==null?void 0:He[0].measureIndex)!==it)}),[te,fe]=yt||[];if(te&&fe){const Pe=fe.measureIndex-te.measureIndex,Fe=te.closedMeasureIndex==it&&g>=te.noteInMeasureIndex,He=fe.closedMeasureIndex===it&&g0)){const yt=w[0]-(w[1]-w[0]),{resetXmlNoteIndex:te,endXmlNoteIndex:fe}=_,Pe=fe;let Fe=(w[w.length-1]-yt)/Pe;if(Fe=ze.DotsXml?Fe/1.5:Fe,TT&&(et=(ft=o[m-1])==null?void 0:ft.speed);Tt=(state$1.isSpecialBookCategory?getTimeByBeatUnit(E,et,gt.currentMeasure.activeTimeSignature.Denominator):u)||1;const He=!(TT);T++,He&&(T=0,_=void 0,w=void 0,b=[])}const bt=_t;let Nt=ht||Math.min(lt,_t)*formatBeatUnit(E)*(60/Tt);const Ot=lt*Ue*(60/Tt);["1788501975122489346","1788502467554750466"].includes(state$1.cbsExamSongId)&&(m==13&&(Nt=Nt/2),m==44&&(Nt=Nt*6),m==56&&(Nt=Nt*4)),x+=Nt,A+=Nt;let $t=Nt+St;const ti=ze.fixedKey||0,Yt=(wt=ve==null?void 0:ve.tickables)==null?void 0:wt.filter(yt=>{var te;return((te=yt.attrs)==null?void 0:te.type)!=="GhostNote"}),At=Yt==null?void 0:Yt[k];if(o.length&&o[o.length-1].relativeTime===St)continue;if(m===0&&!state$1.isAppPlay){let yt=0;(((Ht=(Gt=ze.sourceMeasure.verticalMeasureList)==null?void 0:Gt[0])==null?void 0:Ht.staffEntries)||[]).forEach(fe=>{var Pe,Fe,He,Xe,ut,Mt;(Mt=(ut=(Xe=(He=(Fe=(Pe=fe==null?void 0:fe.sourceStaffEntry)==null?void 0:Pe.voiceEntries)==null?void 0:Fe[0])==null?void 0:He.notes)==null?void 0:Xe[0])==null?void 0:ut.length)!=null&&Mt.realValue&&(yt+=fe.sourceStaffEntry.voiceEntries[0].notes[0].length.realValue)}),yt0&&!state$1.isEvxml&&(s+=S,state$1.fixtime=s),state$1.isEvxml&&(s=state$1.evXmlBeginTime?state$1.evXmlBeginTime:s,state$1.fixtime=s),console.log("节拍器时间",s,state$1.evXmlBeginTime)}let ni=(ee=me[0])==null?void 0:ee.stave;ze.sourceMeasure.multipleRestMeasures&&(C=ze.sourceMeasure.multipleRestMeasures,P=0),Pte===(At==null?void 0:At.attrs.id)))==null?void 0:Te.length)||0;zt=(Ne=ze==null?void 0:ze.noteTimeInfo[yt])==null?void 0:Ne.begin,Ft=(We=ze==null?void 0:ze.noteTimeInfo[yt])==null?void 0:We.end,zt&&(St=zt-s)}At!=null&&At.attrs.id&&Q.push(At==null?void 0:At.attrs.id);let ri=!1;(rt=At==null?void 0:At.modifiers)!=null&&rt.length&&(ri=At==null?void 0:At.modifiers.some(yt=>{var te;return((te=yt==null?void 0:yt.attrs)==null?void 0:te.type)==="GraceNoteGroup"}));const Qt=o.filter(yt=>yt.noteId===ze.NoteToGraphicalNoteObjectId).length,xt={isStaccato:ze.voiceEntry.isStaccato(),isRestFlag:ze.isRestFlag,noteId:ze.NoteToGraphicalNoteObjectId,measureListIndex:ze.sourceMeasure.measureListIndex,MeasureNumberXML:ze.sourceMeasure.MeasureNumberXML,_noteLength:bt,svgElement:At,frequency:((vt=ze==null?void 0:ze.pitch)==null?void 0:vt.frequency)||-1,nextFrequency:((Lt=ze==null?void 0:ze.pitch)==null?void 0:Lt.nextFrequency)||-1,prevFrequency:((qe=ze==null?void 0:ze.pitch)==null?void 0:qe.prevFrequency)||-1,difftime:S,octaveOffset:(Rt=me[0])==null?void 0:Rt.octaveOffset,speed:et,beatSpeed:Tt,i:m,si:g,stepSpeeds:b,measureOpenIndex:l.length-1,measures:v,tempoInBPM:ze.sourceMeasure.tempoInBPM,measureLength:Ot,relaMeasureLength:A,id:At==null?void 0:At.attrs.id,hasGraceNote:ri,note:ze.halfTone+12,fixtime:s,relativeTime:retain(St),time:state$1.isEvxml&&zt?retain(zt):retain(St+s),endtime:state$1.isEvxml&&Ft?retain(Ft):retain($t+s),relaEndtime:retain($t),realValue:Ke,halfTone:ze.halfTone,noteElement:ze,fixedKey:ti,realKey:0,duration:0,formatLyricsEntries:formatLyricsEntries(ze),stave:ni,firstVerticalMeasure:me[0],noteLength:1,osdmContext:i,speedbeatUnit:E,multipleRestMeasures:P,totalMultipleRestMeasures:C,measureSpeed:ie,maxNoteNum:ze.maxNoteNum,repeatIdx:Qt,xmlNoteTime:retain(R),xmlNoteEndTime:retain(R+Nt),xmlMp3BeatFixTime:H,notBeatFixtime:state$1.isOpenMetronome?s-H:s,notBeatTime:state$1.isEvxml&&zt?retain(zt):retain(St+(state$1.isOpenMetronome?s-H:s)),notBeatEndTime:state$1.isEvxml&&Ft?retain(Ft):retain($t+(state$1.isOpenMetronome?s-H:s))};if(R+=Nt,state$1.isEvxml&&xt.repeatIdx&&xt.i>0&&xt.MeasureNumberXML===1&&xt.noteId===0){const yt=state$1.evXmlBeginArr[xt.repeatIdx]||0;xt.time=xt.time+yt,xt.endtime=xt.endtime+yt,x=x+yt,St=St+yt}xt.realKey=d(ze.halfTone-ti*12,xt),xt.duration=xt.endtime-xt.time;let qt=(ve==null?void 0:ve.tickables)||[];[121].includes(state$1.subjectId)&&(qt=ze.sourceMeasure.verticalSourceStaffEntryContainers),qt=qt.filter(yt=>{var te;return((te=yt.attrs)==null?void 0:te.type)!=="GhostNote"});const di=state$1.isCombineRender&&ze.maxNoteNum?ze.maxNoteNum:qt.length;xt.noteLength=di||1,o.push(xt),a.push(xt.id),v.push(xt),gze.relativeTime-gt.relativeTime).map((ze,gt)=>Object.assign(ze,{i:gt}));console.timeEnd("音符跑完时间");try{i.cursor.reset()}catch(ze){}return z},getNoteByMeasuresSlursStart=i=>{let e=i,r;if(i.noteElement.tie&&i.noteElement.tie.StartNote&&(r=i.noteElement.tie.StartNote),e&&r&&r!==e.noteElement){const s=[];for(const o of state$1.times)r===o.noteElement&&s.push(o);if(s.length)return s.find(o=>o.i===i.i-1)||s[0]}return e},getComposer=i=>{var r,s;const e=Array.from(i.querySelectorAll("creator"));for(const o of e)o&&o.getAttribute("type")==="composer"&&!state$1.musicComposer&&(state$1.musicComposer=((r=o.textContent)==null?void 0:r.trim())||""),o&&o.getAttribute("type")==="lyricist"&&!state$1.musicLyricist&&(state$1.musicLyricist=((s=o.textContent)==null?void 0:s.trim())||"")},parseXmlToRepeat=i=>{if(!i.length)return;let e=[],r=0,s=0;for(let o=0;o{let r=-1;if(state$1.repeatInfo.length){for(let s=state$1.repeatInfo.length-1;s>=0;s--){const{start:o,end:a}=state$1.repeatInfo[s];if(i<=o&&e>=a)return r=s,{repeatIdx:r,canRepeat:!0}}return{repeatIdx:r,canRepeat:!1}}else return{repeatIdx:r,canRepeat:!1}},customizationXml=i=>{var u,c;const e=Array.from(i.querySelectorAll("credit")),r=Array.from(i.querySelectorAll("creator")),s=Array.from(i.querySelectorAll("grace")),o=Array.from(i.getElementsByTagName("measure")),a=Array.from(i.getElementsByTagName("note"));let l=0;if(a&&a.length)for(const d of a)lb.getAttribute("segno")==="segno");!y&&m&&v&&d.parentNode.removeChild(d)}if(l>1&&!(i.querySelectorAll("repeat").length>0)){const y=o.last();if(y.getElementsByTagName("barline").length){const m=y.getElementsByTagName("barline")[0];m.innerHTML=m.innerHTML+''}else y.innerHTML=y.innerHTML+` light-heavy `}},analyzeEvxml=(i,e)=>{var c,d,y,m,g,v,b,S,x,A,E,w,_,T,C,P,k,M,R;const r=(y=(d=(c=i.getElementsByTagName("timegap")[0])==null?void 0:c.getElementsByTagName("values")[0])==null?void 0:d.getElementsByTagName("item")[0])==null?void 0:y.getAttribute("num"),s=(v=(g=(m=i.getElementsByTagName("timegap")[0])==null?void 0:m.getElementsByTagName("values")[0])==null?void 0:g.getElementsByTagName("item")[0])==null?void 0:v.getAttribute("den"),o=(x=(S=(b=i.getElementsByTagName("timegap")[0])==null?void 0:b.getElementsByTagName("values")[0])==null?void 0:S.getElementsByTagName("item")[1])==null?void 0:x.getAttribute("num"),a=(w=(E=(A=i.getElementsByTagName("timegap")[0])==null?void 0:A.getElementsByTagName("values")[0])==null?void 0:E.getElementsByTagName("item")[1])==null?void 0:w.getAttribute("den"),l=(_=i.getElementsByTagName("timegap"))!=null&&_.length?Array.from((k=(P=(C=(T=i.getElementsByTagName("timegap"))==null?void 0:T[0])==null?void 0:C.getElementsByTagName("values"))==null?void 0:P[0])==null?void 0:k.getElementsByTagName("item")):[],u=i.getElementsByTagName("measure")[0];if(u){const H=(R=(M=u.getElementsByTagName("times")[0])==null?void 0:M.getElementsByTagName("time")[0])==null?void 0:R.getAttribute("begin");state$1.evXmlBeginTime=H?H/1e3:r?60/state$1.originSpeed*r*4/s:0,state$1.secondEvXmlBeginTime=H?0:o?60/state$1.originSpeed*o*4/a:0;const B=i.getElementsByTagName("timegap").length>0,F=i.getElementsByTagName("times").length>0;if(l&&l.length&&!H)for(const I of l){const U=I==null?void 0:I.getAttribute("num"),D=I==null?void 0:I.getAttribute("den"),$=U?60/state$1.originSpeed*U*4/D:0;state$1.evXmlBeginArr.push($)}console.log("🚀 ~ evxml解析","有timegap:",B,"有times:",F,"timegap集合",state$1.evXmlBeginArr,"第一个timegap",state$1.evXmlBeginTime)}},compatibleXmlPitchVoice=i=>{var s,o,a;if(Array.from(i.getElementsByTagName("part-name")).filter(l=>{var u;return((u=l==null?void 0:l.textContent)==null?void 0:u.trim().toLocaleUpperCase())!=="COMMON"}).length==1){const u=((a=(o=(s=(Array.from(i.getElementsByTagName("instrument-name"))||[])[0])==null?void 0:s.textContent)==null?void 0:o.trim())==null?void 0:a.toLocaleLowerCase())||"";let c=!1;switch(state$1.musicalCodeId){case 37:case 38:c=!!(!u||u.includes("solo")||u.includes("tenor recorder"));break;case 33:c=!!(!u||u.includes("solo")||u.includes("panpipes"));break;case 34:c=!!(!u||u.includes("solo")||u.includes("ocarina"));break;case 35:c=!!(!u||u.includes("solo")||u.includes("woodwind"));break;case 39:c=!!(!u||u.includes("solo")||u.includes("whistling"));break;default:c=!!(!u||u.includes("solo"));break}window.xmlNeedAdjustVoice=c}},Notfind=defineComponent({name:"notfund",render(){return createVNode(Empty,{image:"error",description:this.$route.path+" 路径不存在"},{default:()=>[createVNode(Button$1,{type:"primary",onClick:()=>this.$router.replace("/")},{default:()=>[createTextVNode("返回首页")]})]})}});export{evaluatingData as $,nextTick as A,BORDER_UNSET_TOP_BOTTOM as B,withInstall as C,useScrollParent as D,onUpdated as E,onMounted as F,useRect as G,HAPTICS_FEEDBACK as H,isHidden as I,addUnit as J,request as K,Loading$1 as L,getQuery as M,onBeforeMount as N,setToken as O,setBehaviorId as P,setCampId as Q,storeData as R,RouterView as S,TheError as T,Fragment as U,setUserInfo as V,getRandomKey as W,createTextVNode as X,state$1 as Y,reactive as Z,Icon$1 as _,clamp as a,setStoreData as a$,showToast as a0,queryString as a1,api_shareAchievements as a2,Snackbar$1 as a3,browser as a4,handlePerformDetection as a5,handleStartBegin as a6,handleEndBegin as a7,NoticeBar as a8,Popup as a9,metronomeData as aA,handleResetPlay as aB,Badge as aC,api_back as aD,useRouter as aE,getSecondRPM as aF,customData as aG,setGlobalData as aH,api_setStatusBarVisibility as aI,onBeforeUnmount as aJ,Skeleton as aK,Transition as aL,MusicScore as aM,AudioList as aN,Evaluating as aO,isSpecialShapedScreen as aP,mappingVoicePart as aQ,isRhythmicExercises as aR,subjectFingering as aS,formateTimes as aT,Metronome as aU,getStorageSpeed as aV,api_cloudLoading as aW,addMeasureScore as aX,createRouter as aY,createWebHashHistory as aZ,Notfind as a_,handleEndSoundCheck as aa,handleViewReport as ab,handleStartEvaluat as ac,api_videoUpdate as ad,api_proxyServiceMessage as ae,connectWebsocket as af,getNoteByMeasuresSlursStart as ag,useClickAway as ah,Button$1 as ai,handleSetSpeed as aj,api_openCamera as ak,api_closeCamera as al,store_legacy as am,toRefs as an,isVNode as ao,api_cloudDestroy as ap,postMessage as aq,useRoute$1 as ar,showLoadingToast as as,request$1$1 as at,closeToast as au,getBehaviorId as av,getCampId as aw,onUnmounted as ax,handleChangeSection as ay,togglePlay as az,makeArrayProp as b,BORDER_BOTTOM as b$,createApp as b0,Vue3Lottie as b1,api_savePicture as b2,musicRenderTypeKey as b3,resetRenderMusicScore as b4,getAudioCurrentTime as b5,handleRessetState as b6,toggleFollow as b7,handleFollowStart as b8,handleFollowEnd as b9,onActivated as bA,onPopupReopen as bB,doubleRaf as bC,useId as bD,BORDER_TOP_BOTTOM as bE,setRootScrollTop as bF,getElementTop as bG,callInterceptor as bH,route as bI,inject as bJ,routeProps as bK,provide as bL,withDirectives as bM,vShow as bN,useRoute as bO,getRootScrollTop as bP,isObject$4 as bQ,isPromise as bR,isFunction$5 as bS,FORM_KEY as bT,toArray as bU,formatNumber as bV,CUSTOM_FIELD_INJECTION_KEY as bW,resetScroll as bX,makeNumberProp as bY,cancelRaf as bZ,getSizeStyle as b_,api_setEventTracking as ba,Tick as bb,FollowPractice as bc,handleInitTick as bd,promisefiyPostMessage as be,api_setCache as bf,getToken as bg,followData as bh,api_suspendPlay as bi,hanldeDirectSelection as bj,showDialog as bk,api_openWebView as bl,musicscoresettingKey as bm,useCustomFieldValue as bn,unknownProp as bo,raf as bp,getScrollTop as bq,setScrollTop as br,onBeforeUpdate as bs,inBrowser$2 as bt,onDeactivated as bu,onMountedOrActivated as bv,getZIndexStyle as bw,windowWidth as bx,windowHeight as by,usePageVisibility as bz,createNamespace$1 as c,stopPropagation as c0,addNumber as c1,defineListenerProp as c2,useZIndex as c3,useTeleport as c4,useLock as c5,useRouteListener as c6,Teleport as c7,call as c8,createNamespace as c9,styles$8 as ca,getFingeringConfig as cb,api_goback as cc,headTopData as cd,styles$r as ce,smoothAnimationState as cf,studentQueryUserInfo as cg,defineComponent as d,extend$2 as e,useParent$1 as f,useExpose as g,useEventListener$1 as h,isDef$1 as i,createVNode as j,useChildren$1 as k,pick$1 as l,makeRequiredProp as m,numericProp as n,makeNumericProp as o,preventDefault as p,makeStringProp as q,ref as r,computed as s,truthProp as t,useTouch as u,unitToPx as v,watchEffect as w,watch as x,isSameValue as y,mergeProps as z};