Spaces:
Sleeping
Sleeping
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["musicWidgetsBrowser"]=e():t["musicWidgetsBrowser"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"0241":function(t,e,n){const r=n("b37a"),i=n("33e9"),o=800,u=.24*o,a=t=>Math.tanh(t/u),s=function(t,e,{softIndexFactor:n=1}={}){e=Number(e);const r=t[e];if(e>0){const i=t[e-1];console.assert(null!=r.start,"note.start is null",r),console.assert(null!=i.start,"lastNote.start is null",i),r.deltaSi=a((r.start-i.start)*n),r.softIndex=i.softIndex+r.deltaSi,console.assert(!Number.isNaN(r.deltaSi),"note.deltaSi is NaN.",r.start,i.start)}else r.softIndex=0,r.deltaSi=0},c=function(t,e,n=r.zero()){t.matches=[];const i=e.pitchMap[t.pitch];if(i)for(const o of i){const e=new r(t,o);n&&e.evaluatePrev(n),t.matches.push(e)}},l=function(t,{softIndexFactor:e=1}={}){for(let n=0;n<t.notes.length;++n)s(t.notes,n,{softIndexFactor:e})},f=async function(t,e,n){const r=new i(t,e);r.resetCursor(-1);for(let i=0;i<e.notes.length;++i){r.step(i);const t=await(n&&n(i,r));if(t===Symbol.for("end"))return void console.log("Navigation interrupted.")}return r};t.exports={normalizeInterval:a,makeNoteSoftIndex:s,makeMatchNodes:c,genNotationContext:l,runNavigation:f,Navigator:i,Node:r}},"0a40":function(t,e,n){const{Notation:r}=n("ee4f"),i=()=>new Promise(t=>requestAnimationFrame(t));class o{constructor(t,{cacheSpan:e=600,onMidi:n,onPlayFinish:i,onTurnCursor:o}={}){let u;this.cacheSpan=e,this.onMidi=n,this.onPlayFinish=i,this.onTurnCursor=o,u=t.notes&&Number.isFinite(t.endTime)?t:r.parseMidi(t),this.notation=u,this.events=u.events,this.isPlaying=!1,this.progressTime=0,this.startTime=performance.now(),this.duration=u.endTime,this.cursorTurnDelta=0,console.assert(u.tempos&&u.tempos.length,"[MidiPlayer] invalid notation, tempos is empty.")}dispose(){this.isPlaying=!1,this.progressTime=0}get progressTicks(){return this.notation.timeToTicks(this.progressTime)}set progressTicks(t){this.progressTime=this.notation.ticksToTime(t),this.onTurnCursor&&this.onTurnCursor(this.progressTime)}async play({nextFrame:t=i}={}){this.progressTime>=this.duration&&(this.progressTime=0);let e=performance.now();this.startTime=e-this.progressTime,this.isPlaying=!0;let n=this.events.findIndex(t=>t.time>=e-this.startTime);while(this.isPlaying){for(;n<this.events.length;++n){const t=this.events[n];if(!t||t.time>this.progressTime+this.cacheSpan)break;"channel"===t.data.type&&this.startTime+t.time>=e&&this.onMidi&&this.onMidi(t.data,this.startTime+t.time)}if(await t(),!this.isPlaying)break;if(0!==this.cursorTurnDelta){const t=this.cursorTurnDelta<0;if(this.startTime-=this.cursorTurnDelta,this.cursorTurnDelta=0,t)for(;n>0;--n){const t=this.events[n].time;if(this.startTime+t<e)break}}e=performance.now(),this.progressTime=e-this.startTime,this.progressTime>this.duration&&(this.isPlaying=!1,this.onPlayFinish&&this.onPlayFinish())}}pause(){this.isPlaying=!1}turnCursor(t){this.isPlaying?this.cursorTurnDelta+=t-this.progressTime:this.progressTime=t,this.onTurnCursor&&this.onTurnCursor(t)}}t.exports=o},"2ef0":function(t,e,n){(function(t,r){var i; | |
/** | |
* @license | |
* Lodash <https://lodash.com/> | |
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> | |
* Released under MIT license <https://lodash.com/license> | |
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | |
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | |
*/(function(){var o,u="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",d=1,v=2,g=4,m=1,y=2,w=1,_=2,b=4,A=8,k=16,x=32,I=64,S=128,T=256,q=512,E=30,C="...",O=800,M=16,N=1,B=2,j=3,U=1/0,P=9007199254740991,R=17976931348623157e292,F=NaN,D=4294967295,W=D-1,K=D>>>1,V=[["ary",S],["bind",w],["bindKey",_],["curry",A],["curryRight",k],["flip",q],["partial",x],["partialRight",I],["rearg",T]],z="[object Arguments]",L="[object Array]",Z="[object AsyncFunction]",J="[object Boolean]",G="[object Date]",Y="[object DOMException]",Q="[object Error]",X="[object Function]",H="[object GeneratorFunction]",$="[object Map]",tt="[object Number]",et="[object Null]",nt="[object Object]",rt="[object Promise]",it="[object Proxy]",ot="[object RegExp]",ut="[object Set]",at="[object String]",st="[object Symbol]",ct="[object Undefined]",lt="[object WeakMap]",ft="[object WeakSet]",ht="[object ArrayBuffer]",pt="[object DataView]",dt="[object Float32Array]",vt="[object Float64Array]",gt="[object Int8Array]",mt="[object Int16Array]",yt="[object Int32Array]",wt="[object Uint8Array]",_t="[object Uint8ClampedArray]",bt="[object Uint16Array]",At="[object Uint32Array]",kt=/\b__p \+= '';/g,xt=/\b(__p \+=) '' \+/g,It=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,qt=RegExp(St.source),Et=RegExp(Tt.source),Ct=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,Mt=/<%=([\s\S]+?)%>/g,Nt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bt=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ut=/[\\^$.*+?()[\]{}|]/g,Pt=RegExp(Ut.source),Rt=/^\s+/,Ft=/\s/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Wt=/\{\n\/\* \[wrapped with (.+)\] \*/,Kt=/,? & /,Vt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zt=/[()=,{}\[\]\/\s]/,Lt=/\\(\\)?/g,Zt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jt=/\w*$/,Gt=/^[-+]0x[0-9a-f]+$/i,Yt=/^0b[01]+$/i,Qt=/^\[object .+?Constructor\]$/,Xt=/^0o[0-7]+$/i,Ht=/^(?:0|[1-9]\d*)$/,$t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,te=/($^)/,ee=/['\n\r\u2028\u2029\\]/g,ne="\\ud800-\\udfff",re="\\u0300-\\u036f",ie="\\ufe20-\\ufe2f",oe="\\u20d0-\\u20ff",ue=re+ie+oe,ae="\\u2700-\\u27bf",se="a-z\\xdf-\\xf6\\xf8-\\xff",ce="\\xac\\xb1\\xd7\\xf7",le="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fe="\\u2000-\\u206f",he=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="A-Z\\xc0-\\xd6\\xd8-\\xde",de="\\ufe0e\\ufe0f",ve=ce+le+fe+he,ge="['’]",me="["+ne+"]",ye="["+ve+"]",we="["+ue+"]",_e="\\d+",be="["+ae+"]",Ae="["+se+"]",ke="[^"+ne+ve+_e+ae+se+pe+"]",xe="\\ud83c[\\udffb-\\udfff]",Ie="(?:"+we+"|"+xe+")",Se="[^"+ne+"]",Te="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+pe+"]",Ce="\\u200d",Oe="(?:"+Ae+"|"+ke+")",Me="(?:"+Ee+"|"+ke+")",Ne="(?:"+ge+"(?:d|ll|m|re|s|t|ve))?",Be="(?:"+ge+"(?:D|LL|M|RE|S|T|VE))?",je=Ie+"?",Ue="["+de+"]?",Pe="(?:"+Ce+"(?:"+[Se,Te,qe].join("|")+")"+Ue+je+")*",Re="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",De=Ue+je+Pe,We="(?:"+[be,Te,qe].join("|")+")"+De,Ke="(?:"+[Se+we+"?",we,Te,qe,me].join("|")+")",Ve=RegExp(ge,"g"),ze=RegExp(we,"g"),Le=RegExp(xe+"(?="+xe+")|"+Ke+De,"g"),Ze=RegExp([Ee+"?"+Ae+"+"+Ne+"(?="+[ye,Ee,"$"].join("|")+")",Me+"+"+Be+"(?="+[ye,Ee+Oe,"$"].join("|")+")",Ee+"?"+Oe+"+"+Ne,Ee+"+"+Be,Fe,Re,_e,We].join("|"),"g"),Je=RegExp("["+Ce+ne+ue+de+"]"),Ge=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ye=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qe=-1,Xe={};Xe[dt]=Xe[vt]=Xe[gt]=Xe[mt]=Xe[yt]=Xe[wt]=Xe[_t]=Xe[bt]=Xe[At]=!0,Xe[z]=Xe[L]=Xe[ht]=Xe[J]=Xe[pt]=Xe[G]=Xe[Q]=Xe[X]=Xe[$]=Xe[tt]=Xe[nt]=Xe[ot]=Xe[ut]=Xe[at]=Xe[lt]=!1;var He={};He[z]=He[L]=He[ht]=He[pt]=He[J]=He[G]=He[dt]=He[vt]=He[gt]=He[mt]=He[yt]=He[$]=He[tt]=He[nt]=He[ot]=He[ut]=He[at]=He[st]=He[wt]=He[_t]=He[bt]=He[At]=!0,He[Q]=He[X]=He[lt]=!1;var $e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},tn={"&":"&","<":"<",">":">",'"':""","'":"'"},en={"&":"&","<":"<",">":">",""":'"',"'":"'"},nn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rn=parseFloat,on=parseInt,un="object"==typeof t&&t&&t.Object===Object&&t,an="object"==typeof self&&self&&self.Object===Object&&self,sn=un||an||Function("return this")(),cn=e&&!e.nodeType&&e,ln=cn&&"object"==typeof r&&r&&!r.nodeType&&r,fn=ln&&ln.exports===cn,hn=fn&&un.process,pn=function(){try{var t=ln&&ln.require&&ln.require("util").types;return t||hn&&hn.binding&&hn.binding("util")}catch(e){}}(),dn=pn&&pn.isArrayBuffer,vn=pn&&pn.isDate,gn=pn&&pn.isMap,mn=pn&&pn.isRegExp,yn=pn&&pn.isSet,wn=pn&&pn.isTypedArray;function _n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function bn(t,e,n,r){var i=-1,o=null==t?0:t.length;while(++i<o){var u=t[i];e(r,u,n(u),t)}return r}function An(t,e){var n=-1,r=null==t?0:t.length;while(++n<r)if(!1===e(t[n],n,t))break;return t}function kn(t,e){var n=null==t?0:t.length;while(n--)if(!1===e(t[n],n,t))break;return t}function xn(t,e){var n=-1,r=null==t?0:t.length;while(++n<r)if(!e(t[n],n,t))return!1;return!0}function In(t,e){var n=-1,r=null==t?0:t.length,i=0,o=[];while(++n<r){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}function Sn(t,e){var n=null==t?0:t.length;return!!n&&Rn(t,e,0)>-1}function Tn(t,e,n){var r=-1,i=null==t?0:t.length;while(++r<i)if(n(e,t[r]))return!0;return!1}function qn(t,e){var n=-1,r=null==t?0:t.length,i=Array(r);while(++n<r)i[n]=e(t[n],n,t);return i}function En(t,e){var n=-1,r=e.length,i=t.length;while(++n<r)t[i+n]=e[n];return t}function Cn(t,e,n,r){var i=-1,o=null==t?0:t.length;r&&o&&(n=t[++i]);while(++i<o)n=e(n,t[i],i,t);return n}function On(t,e,n,r){var i=null==t?0:t.length;r&&i&&(n=t[--i]);while(i--)n=e(n,t[i],i,t);return n}function Mn(t,e){var n=-1,r=null==t?0:t.length;while(++n<r)if(e(t[n],n,t))return!0;return!1}var Nn=Kn("length");function Bn(t){return t.split("")}function jn(t){return t.match(Vt)||[]}function Un(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Pn(t,e,n,r){var i=t.length,o=n+(r?1:-1);while(r?o--:++o<i)if(e(t[o],o,t))return o;return-1}function Rn(t,e,n){return e===e?dr(t,e,n):Pn(t,Dn,n)}function Fn(t,e,n,r){var i=n-1,o=t.length;while(++i<o)if(r(t[i],e))return i;return-1}function Dn(t){return t!==t}function Wn(t,e){var n=null==t?0:t.length;return n?Zn(t,e)/n:F}function Kn(t){return function(e){return null==e?o:e[t]}}function Vn(t){return function(e){return null==t?o:t[e]}}function zn(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ln(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}function Zn(t,e){var n,r=-1,i=t.length;while(++r<i){var u=e(t[r]);u!==o&&(n=n===o?u:n+u)}return n}function Jn(t,e){var n=-1,r=Array(t);while(++n<t)r[n]=e(n);return r}function Gn(t,e){return qn(e,(function(e){return[e,t[e]]}))}function Yn(t){return t?t.slice(0,yr(t)+1).replace(Rt,""):t}function Qn(t){return function(e){return t(e)}}function Xn(t,e){return qn(e,(function(e){return t[e]}))}function Hn(t,e){return t.has(e)}function $n(t,e){var n=-1,r=t.length;while(++n<r&&Rn(e,t[n],0)>-1);return n}function tr(t,e){var n=t.length;while(n--&&Rn(e,t[n],0)>-1);return n}function er(t,e){var n=t.length,r=0;while(n--)t[n]===e&&++r;return r}var nr=Vn($e),rr=Vn(tn);function ir(t){return"\\"+nn[t]}function or(t,e){return null==t?o:t[e]}function ur(t){return Je.test(t)}function ar(t){return Ge.test(t)}function sr(t){var e,n=[];while(!(e=t.next()).done)n.push(e.value);return n}function cr(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function lr(t,e){return function(n){return t(e(n))}}function fr(t,e){var n=-1,r=t.length,i=0,o=[];while(++n<r){var u=t[n];u!==e&&u!==p||(t[n]=p,o[i++]=n)}return o}function hr(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pr(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function dr(t,e,n){var r=n-1,i=t.length;while(++r<i)if(t[r]===e)return r;return-1}function vr(t,e,n){var r=n+1;while(r--)if(t[r]===e)return r;return r}function gr(t){return ur(t)?_r(t):Nn(t)}function mr(t){return ur(t)?br(t):Bn(t)}function yr(t){var e=t.length;while(e--&&Ft.test(t.charAt(e)));return e}var wr=Vn(en);function _r(t){var e=Le.lastIndex=0;while(Le.test(t))++e;return e}function br(t){return t.match(Le)||[]}function Ar(t){return t.match(Ze)||[]}var kr=function t(e){e=null==e?sn:xr.defaults(sn.Object(),e,xr.pick(sn,Ye));var n=e.Array,r=e.Date,i=e.Error,Ft=e.Function,Vt=e.Math,ne=e.Object,re=e.RegExp,ie=e.String,oe=e.TypeError,ue=n.prototype,ae=Ft.prototype,se=ne.prototype,ce=e["__core-js_shared__"],le=ae.toString,fe=se.hasOwnProperty,he=0,pe=function(){var t=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),de=se.toString,ve=le.call(ne),ge=sn._,me=re("^"+le.call(fe).replace(Ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=fn?e.Buffer:o,we=e.Symbol,_e=e.Uint8Array,be=ye?ye.allocUnsafe:o,Ae=lr(ne.getPrototypeOf,ne),ke=ne.create,xe=se.propertyIsEnumerable,Ie=ue.splice,Se=we?we.isConcatSpreadable:o,Te=we?we.iterator:o,qe=we?we.toStringTag:o,Ee=function(){try{var t=Ju(ne,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ce=e.clearTimeout!==sn.clearTimeout&&e.clearTimeout,Oe=r&&r.now!==sn.Date.now&&r.now,Me=e.setTimeout!==sn.setTimeout&&e.setTimeout,Ne=Vt.ceil,Be=Vt.floor,je=ne.getOwnPropertySymbols,Ue=ye?ye.isBuffer:o,Pe=e.isFinite,Re=ue.join,Fe=lr(ne.keys,ne),De=Vt.max,We=Vt.min,Ke=r.now,Le=e.parseInt,Ze=Vt.random,Je=ue.reverse,Ge=Ju(e,"DataView"),$e=Ju(e,"Map"),tn=Ju(e,"Promise"),en=Ju(e,"Set"),nn=Ju(e,"WeakMap"),un=Ju(ne,"create"),an=nn&&new nn,cn={},ln=Ma(Ge),hn=Ma($e),pn=Ma(tn),Nn=Ma(en),Bn=Ma(nn),Vn=we?we.prototype:o,dr=Vn?Vn.valueOf:o,_r=Vn?Vn.toString:o;function br(t){if(Il(t)&&!sl(t)&&!(t instanceof Tr)){if(t instanceof Sr)return t;if(fe.call(t,"__wrapped__"))return Ba(t)}return new Sr(t)}var kr=function(){function t(){}return function(e){if(!xl(e))return{};if(ke)return ke(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function Ir(){}function Sr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Tr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function qr(){var t=new Tr(this.__wrapped__);return t.__actions__=iu(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=iu(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=iu(this.__views__),t}function Er(){if(this.__filtered__){var t=new Tr(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function Cr(){var t=this.__wrapped__.value(),e=this.__dir__,n=sl(t),r=e<0,i=n?t.length:0,o=Hu(0,i,this.__views__),u=o.start,a=o.end,s=a-u,c=r?a:u-1,l=this.__iteratees__,f=l.length,h=0,p=We(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return Fo(t,this.__actions__);var d=[];t:while(s--&&h<p){c+=e;var v=-1,g=t[c];while(++v<f){var m=l[v],y=m.iteratee,w=m.type,_=y(g);if(w==B)g=_;else if(!_){if(w==N)continue t;break t}}d[h++]=g}return d}function Or(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Mr(){this.__data__=un?un(null):{},this.size=0}function Nr(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Br(t){var e=this.__data__;if(un){var n=e[t];return n===f?o:n}return fe.call(e,t)?e[t]:o}function jr(t){var e=this.__data__;return un?e[t]!==o:fe.call(e,t)}function Ur(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=un&&e===o?f:e,this}function Pr(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Rr(){this.__data__=[],this.size=0}function Fr(t){var e=this.__data__,n=li(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Ie.call(e,n,1),--this.size,!0}function Dr(t){var e=this.__data__,n=li(e,t);return n<0?o:e[n][1]}function Wr(t){return li(this.__data__,t)>-1}function Kr(t,e){var n=this.__data__,r=li(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Vr(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function zr(){this.size=0,this.__data__={hash:new Or,map:new($e||Pr),string:new Or}}function Lr(t){var e=Lu(this,t)["delete"](t);return this.size-=e?1:0,e}function Zr(t){return Lu(this,t).get(t)}function Jr(t){return Lu(this,t).has(t)}function Gr(t,e){var n=Lu(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Yr(t){var e=-1,n=null==t?0:t.length;this.__data__=new Vr;while(++e<n)this.add(t[e])}function Qr(t){return this.__data__.set(t,f),this}function Xr(t){return this.__data__.has(t)}function Hr(t){var e=this.__data__=new Pr(t);this.size=e.size}function $r(){this.__data__=new Pr,this.size=0}function ti(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}function ei(t){return this.__data__.get(t)}function ni(t){return this.__data__.has(t)}function ri(t,e){var n=this.__data__;if(n instanceof Pr){var r=n.__data__;if(!$e||r.length<a-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vr(r)}return n.set(t,e),this.size=n.size,this}function ii(t,e){var n=sl(t),r=!n&&al(t),i=!n&&!r&&pl(t),o=!n&&!r&&!i&&Dl(t),u=n||r||i||o,a=u?Jn(t.length,ie):[],s=a.length;for(var c in t)!e&&!fe.call(t,c)||u&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ua(c,s))||a.push(c);return a}function oi(t){var e=t.length;return e?t[yo(0,e-1)]:o}function ui(t,e){return Ea(iu(t),gi(e,0,t.length))}function ai(t){return Ea(iu(t))}function si(t,e,n){(n!==o&&!il(t[e],n)||n===o&&!(e in t))&&di(t,e,n)}function ci(t,e,n){var r=t[e];fe.call(t,e)&&il(r,n)&&(n!==o||e in t)||di(t,e,n)}function li(t,e){var n=t.length;while(n--)if(il(t[n][0],e))return n;return-1}function fi(t,e,n,r){return Ai(t,(function(t,i,o){e(r,t,n(t),o)})),r}function hi(t,e){return t&&ou(e,kf(e),t)}function pi(t,e){return t&&ou(e,xf(e),t)}function di(t,e,n){"__proto__"==e&&Ee?Ee(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function vi(t,e){var r=-1,i=e.length,u=n(i),a=null==t;while(++r<i)u[r]=a?o:mf(t,e[r]);return u}function gi(t,e,n){return t===t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function mi(t,e,n,r,i,u){var a,s=e&d,c=e&v,l=e&g;if(n&&(a=i?n(t,r,i,u):n(t)),a!==o)return a;if(!xl(t))return t;var f=sl(t);if(f){if(a=ea(t),!s)return iu(t,a)}else{var h=Xu(t),p=h==X||h==H;if(pl(t))return Go(t,s);if(h==nt||h==z||p&&!i){if(a=c||p?{}:na(t),!s)return c?au(t,pi(a,t)):uu(t,hi(a,t))}else{if(!He[h])return i?t:{};a=ra(t,h,s)}}u||(u=new Hr);var m=u.get(t);if(m)return m;u.set(t,a),Pl(t)?t.forEach((function(r){a.add(mi(r,e,n,r,t,u))})):Sl(t)&&t.forEach((function(r,i){a.set(i,mi(r,e,n,i,t,u))}));var y=l?c?Du:Fu:c?xf:kf,w=f?o:y(t);return An(w||t,(function(r,i){w&&(i=r,r=t[i]),ci(a,i,mi(r,e,n,i,t,u))})),a}function yi(t){var e=kf(t);return function(n){return wi(n,t,e)}}function wi(t,e,n){var r=n.length;if(null==t)return!r;t=ne(t);while(r--){var i=n[r],u=e[i],a=t[i];if(a===o&&!(i in t)||!u(a))return!1}return!0}function _i(t,e,n){if("function"!=typeof t)throw new oe(c);return Ia((function(){t.apply(o,n)}),e)}function bi(t,e,n,r){var i=-1,o=Sn,u=!0,s=t.length,c=[],l=e.length;if(!s)return c;n&&(e=qn(e,Qn(n))),r?(o=Tn,u=!1):e.length>=a&&(o=Hn,u=!1,e=new Yr(e));t:while(++i<s){var f=t[i],h=null==n?f:n(f);if(f=r||0!==f?f:0,u&&h===h){var p=l;while(p--)if(e[p]===h)continue t;c.push(f)}else o(e,h,r)||c.push(f)}return c}br.templateSettings={escape:Ct,evaluate:Ot,interpolate:Mt,variable:"",imports:{_:br}},br.prototype=Ir.prototype,br.prototype.constructor=br,Sr.prototype=kr(Ir.prototype),Sr.prototype.constructor=Sr,Tr.prototype=kr(Ir.prototype),Tr.prototype.constructor=Tr,Or.prototype.clear=Mr,Or.prototype["delete"]=Nr,Or.prototype.get=Br,Or.prototype.has=jr,Or.prototype.set=Ur,Pr.prototype.clear=Rr,Pr.prototype["delete"]=Fr,Pr.prototype.get=Dr,Pr.prototype.has=Wr,Pr.prototype.set=Kr,Vr.prototype.clear=zr,Vr.prototype["delete"]=Lr,Vr.prototype.get=Zr,Vr.prototype.has=Jr,Vr.prototype.set=Gr,Yr.prototype.add=Yr.prototype.push=Qr,Yr.prototype.has=Xr,Hr.prototype.clear=$r,Hr.prototype["delete"]=ti,Hr.prototype.get=ei,Hr.prototype.has=ni,Hr.prototype.set=ri;var Ai=lu(Oi),ki=lu(Mi,!0);function xi(t,e){var n=!0;return Ai(t,(function(t,r,i){return n=!!e(t,r,i),n})),n}function Ii(t,e,n){var r=-1,i=t.length;while(++r<i){var u=t[r],a=e(u);if(null!=a&&(s===o?a===a&&!Fl(a):n(a,s)))var s=a,c=u}return c}function Si(t,e,n,r){var i=t.length;n=Gl(n),n<0&&(n=-n>i?0:i+n),r=r===o||r>i?i:Gl(r),r<0&&(r+=i),r=n>r?0:Yl(r);while(n<r)t[n++]=e;return t}function Ti(t,e){var n=[];return Ai(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function qi(t,e,n,r,i){var o=-1,u=t.length;n||(n=oa),i||(i=[]);while(++o<u){var a=t[o];e>0&&n(a)?e>1?qi(a,e-1,n,r,i):En(i,a):r||(i[i.length]=a)}return i}var Ei=fu(),Ci=fu(!0);function Oi(t,e){return t&&Ei(t,e,kf)}function Mi(t,e){return t&&Ci(t,e,kf)}function Ni(t,e){return In(e,(function(e){return bl(t[e])}))}function Bi(t,e){e=zo(e,t);var n=0,r=e.length;while(null!=t&&n<r)t=t[Oa(e[n++])];return n&&n==r?t:o}function ji(t,e,n){var r=e(t);return sl(t)?r:En(r,n(t))}function Ui(t){return null==t?t===o?ct:et:qe&&qe in ne(t)?Gu(t):wa(t)}function Pi(t,e){return t>e}function Ri(t,e){return null!=t&&fe.call(t,e)}function Fi(t,e){return null!=t&&e in ne(t)}function Di(t,e,n){return t>=We(e,n)&&t<De(e,n)}function Wi(t,e,r){var i=r?Tn:Sn,u=t[0].length,a=t.length,s=a,c=n(a),l=1/0,f=[];while(s--){var h=t[s];s&&e&&(h=qn(h,Qn(e))),l=We(h.length,l),c[s]=!r&&(e||u>=120&&h.length>=120)?new Yr(s&&h):o}h=t[0];var p=-1,d=c[0];t:while(++p<u&&f.length<l){var v=h[p],g=e?e(v):v;if(v=r||0!==v?v:0,!(d?Hn(d,g):i(f,g,r))){s=a;while(--s){var m=c[s];if(!(m?Hn(m,g):i(t[s],g,r)))continue t}d&&d.push(g),f.push(v)}}return f}function Ki(t,e,n,r){return Oi(t,(function(t,i,o){e(r,n(t),i,o)})),r}function Vi(t,e,n){e=zo(e,t),t=ba(t,e);var r=null==t?t:t[Oa(os(e))];return null==r?o:_n(r,t,n)}function zi(t){return Il(t)&&Ui(t)==z}function Li(t){return Il(t)&&Ui(t)==ht}function Zi(t){return Il(t)&&Ui(t)==G}function Ji(t,e,n,r,i){return t===e||(null==t||null==e||!Il(t)&&!Il(e)?t!==t&&e!==e:Gi(t,e,n,r,Ji,i))}function Gi(t,e,n,r,i,o){var u=sl(t),a=sl(e),s=u?L:Xu(t),c=a?L:Xu(e);s=s==z?nt:s,c=c==z?nt:c;var l=s==nt,f=c==nt,h=s==c;if(h&&pl(t)){if(!pl(e))return!1;u=!0,l=!1}if(h&&!l)return o||(o=new Hr),u||Dl(t)?ju(t,e,n,r,i,o):Uu(t,e,s,n,r,i,o);if(!(n&m)){var p=l&&fe.call(t,"__wrapped__"),d=f&&fe.call(e,"__wrapped__");if(p||d){var v=p?t.value():t,g=d?e.value():e;return o||(o=new Hr),i(v,g,n,r,o)}}return!!h&&(o||(o=new Hr),Pu(t,e,n,r,i,o))}function Yi(t){return Il(t)&&Xu(t)==$}function Qi(t,e,n,r){var i=n.length,u=i,a=!r;if(null==t)return!u;t=ne(t);while(i--){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}while(++i<u){s=n[i];var c=s[0],l=t[c],f=s[1];if(a&&s[2]){if(l===o&&!(c in t))return!1}else{var h=new Hr;if(r)var p=r(l,f,c,t,e,h);if(!(p===o?Ji(f,l,m|y,r,h):p))return!1}}return!0}function Xi(t){if(!xl(t)||fa(t))return!1;var e=bl(t)?me:Qt;return e.test(Ma(t))}function Hi(t){return Il(t)&&Ui(t)==ot}function $i(t){return Il(t)&&Xu(t)==ut}function to(t){return Il(t)&&kl(t.length)&&!!Xe[Ui(t)]}function eo(t){return"function"==typeof t?t:null==t?Oh:"object"==typeof t?sl(t)?ao(t[0],t[1]):uo(t):zh(t)}function no(t){if(!pa(t))return Fe(t);var e=[];for(var n in ne(t))fe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ro(t){if(!xl(t))return ya(t);var e=pa(t),n=[];for(var r in t)("constructor"!=r||!e&&fe.call(t,r))&&n.push(r);return n}function io(t,e){return t<e}function oo(t,e){var r=-1,i=ll(t)?n(t.length):[];return Ai(t,(function(t,n,o){i[++r]=e(t,n,o)})),i}function uo(t){var e=Zu(t);return 1==e.length&&e[0][2]?va(e[0][0],e[0][1]):function(n){return n===t||Qi(n,t,e)}}function ao(t,e){return sa(t)&&da(e)?va(Oa(t),e):function(n){var r=mf(n,t);return r===o&&r===e?wf(n,t):Ji(e,r,m|y)}}function so(t,e,n,r,i){t!==e&&Ei(e,(function(u,a){if(i||(i=new Hr),xl(u))co(t,e,a,n,so,r,i);else{var s=r?r(ka(t,a),u,a+"",t,e,i):o;s===o&&(s=u),si(t,a,s)}}),xf)}function co(t,e,n,r,i,u,a){var s=ka(t,n),c=ka(e,n),l=a.get(c);if(l)si(t,n,l);else{var f=u?u(s,c,n+"",t,e,a):o,h=f===o;if(h){var p=sl(c),d=!p&&pl(c),v=!p&&!d&&Dl(c);f=c,p||d||v?sl(s)?f=s:fl(s)?f=iu(s):d?(h=!1,f=Go(c,!0)):v?(h=!1,f=$o(c,!0)):f=[]:Bl(c)||al(c)?(f=s,al(s)?f=Xl(s):xl(s)&&!bl(s)||(f=na(c))):h=!1}h&&(a.set(c,f),i(f,c,r,u,a),a["delete"](c)),si(t,n,f)}}function lo(t,e){var n=t.length;if(n)return e+=e<0?n:0,ua(e,n)?t[e]:o}function fo(t,e,n){e=e.length?qn(e,(function(t){return sl(t)?function(e){return Bi(e,1===t.length?t[0]:t)}:t})):[Oh];var r=-1;e=qn(e,Qn(zu()));var i=oo(t,(function(t,n,i){var o=qn(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return Ln(i,(function(t,e){return eu(t,e,n)}))}function ho(t,e){return po(t,e,(function(e,n){return wf(t,n)}))}function po(t,e,n){var r=-1,i=e.length,o={};while(++r<i){var u=e[r],a=Bi(t,u);n(a,u)&&xo(o,zo(u,t),a)}return o}function vo(t){return function(e){return Bi(e,t)}}function go(t,e,n,r){var i=r?Fn:Rn,o=-1,u=e.length,a=t;t===e&&(e=iu(e)),n&&(a=qn(t,Qn(n)));while(++o<u){var s=0,c=e[o],l=n?n(c):c;while((s=i(a,l,s,r))>-1)a!==t&&Ie.call(a,s,1),Ie.call(t,s,1)}return t}function mo(t,e){var n=t?e.length:0,r=n-1;while(n--){var i=e[n];if(n==r||i!==o){var o=i;ua(i)?Ie.call(t,i,1):Uo(t,i)}}return t}function yo(t,e){return t+Be(Ze()*(e-t+1))}function wo(t,e,r,i){var o=-1,u=De(Ne((e-t)/(r||1)),0),a=n(u);while(u--)a[i?u:++o]=t,t+=r;return a}function _o(t,e){var n="";if(!t||e<1||e>P)return n;do{e%2&&(n+=t),e=Be(e/2),e&&(t+=t)}while(e);return n}function bo(t,e){return Sa(_a(t,e,Oh),t+"")}function Ao(t){return oi(Kf(t))}function ko(t,e){var n=Kf(t);return Ea(n,gi(e,0,n.length))}function xo(t,e,n,r){if(!xl(t))return t;e=zo(e,t);var i=-1,u=e.length,a=u-1,s=t;while(null!=s&&++i<u){var c=Oa(e[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(i!=a){var f=s[c];l=r?r(f,c,s):o,l===o&&(l=xl(f)?f:ua(e[i+1])?[]:{})}ci(s,c,l),s=s[c]}return t}var Io=an?function(t,e){return an.set(t,e),t}:Oh,So=Ee?function(t,e){return Ee(t,"toString",{configurable:!0,enumerable:!1,value:Th(e),writable:!0})}:Oh;function To(t){return Ea(Kf(t))}function qo(t,e,r){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;var u=n(o);while(++i<o)u[i]=t[i+e];return u}function Eo(t,e){var n;return Ai(t,(function(t,r,i){return n=e(t,r,i),!n})),!!n}function Co(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e===e&&i<=K){while(r<i){var o=r+i>>>1,u=t[o];null!==u&&!Fl(u)&&(n?u<=e:u<e)?r=o+1:i=o}return i}return Oo(t,e,Oh,n)}function Oo(t,e,n,r){var i=0,u=null==t?0:t.length;if(0===u)return 0;e=n(e);var a=e!==e,s=null===e,c=Fl(e),l=e===o;while(i<u){var f=Be((i+u)/2),h=n(t[f]),p=h!==o,d=null===h,v=h===h,g=Fl(h);if(a)var m=r||v;else m=l?v&&(r||p):s?v&&p&&(r||!d):c?v&&p&&!d&&(r||!g):!d&&!g&&(r?h<=e:h<e);m?i=f+1:u=f}return We(u,W)}function Mo(t,e){var n=-1,r=t.length,i=0,o=[];while(++n<r){var u=t[n],a=e?e(u):u;if(!n||!il(a,s)){var s=a;o[i++]=0===u?0:u}}return o}function No(t){return"number"==typeof t?t:Fl(t)?F:+t}function Bo(t){if("string"==typeof t)return t;if(sl(t))return qn(t,Bo)+"";if(Fl(t))return _r?_r.call(t):"";var e=t+"";return"0"==e&&1/t==-U?"-0":e}function jo(t,e,n){var r=-1,i=Sn,o=t.length,u=!0,s=[],c=s;if(n)u=!1,i=Tn;else if(o>=a){var l=e?null:Eu(t);if(l)return hr(l);u=!1,i=Hn,c=new Yr}else c=e?[]:s;t:while(++r<o){var f=t[r],h=e?e(f):f;if(f=n||0!==f?f:0,u&&h===h){var p=c.length;while(p--)if(c[p]===h)continue t;e&&c.push(h),s.push(f)}else i(c,h,n)||(c!==s&&c.push(h),s.push(f))}return s}function Uo(t,e){return e=zo(e,t),t=ba(t,e),null==t||delete t[Oa(os(e))]}function Po(t,e,n,r){return xo(t,e,n(Bi(t,e)),r)}function Ro(t,e,n,r){var i=t.length,o=r?i:-1;while((r?o--:++o<i)&&e(t[o],o,t));return n?qo(t,r?0:o,r?o+1:i):qo(t,r?o+1:0,r?i:o)}function Fo(t,e){var n=t;return n instanceof Tr&&(n=n.value()),Cn(e,(function(t,e){return e.func.apply(e.thisArg,En([t],e.args))}),n)}function Do(t,e,r){var i=t.length;if(i<2)return i?jo(t[0]):[];var o=-1,u=n(i);while(++o<i){var a=t[o],s=-1;while(++s<i)s!=o&&(u[o]=bi(u[o]||a,t[s],e,r))}return jo(qi(u,1),e,r)}function Wo(t,e,n){var r=-1,i=t.length,u=e.length,a={};while(++r<i){var s=r<u?e[r]:o;n(a,t[r],s)}return a}function Ko(t){return fl(t)?t:[]}function Vo(t){return"function"==typeof t?t:Oh}function zo(t,e){return sl(t)?t:sa(t,e)?[t]:Ca($l(t))}var Lo=bo;function Zo(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:qo(t,e,n)}var Jo=Ce||function(t){return sn.clearTimeout(t)};function Go(t,e){if(e)return t.slice();var n=t.length,r=be?be(n):new t.constructor(n);return t.copy(r),r}function Yo(t){var e=new t.constructor(t.byteLength);return new _e(e).set(new _e(t)),e}function Qo(t,e){var n=e?Yo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Xo(t){var e=new t.constructor(t.source,Jt.exec(t));return e.lastIndex=t.lastIndex,e}function Ho(t){return dr?ne(dr.call(t)):{}}function $o(t,e){var n=e?Yo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function tu(t,e){if(t!==e){var n=t!==o,r=null===t,i=t===t,u=Fl(t),a=e!==o,s=null===e,c=e===e,l=Fl(e);if(!s&&!l&&!u&&t>e||u&&a&&c&&!s&&!l||r&&a&&c||!n&&c||!i)return 1;if(!r&&!u&&!l&&t<e||l&&n&&i&&!r&&!u||s&&n&&i||!a&&i||!c)return-1}return 0}function eu(t,e,n){var r=-1,i=t.criteria,o=e.criteria,u=i.length,a=n.length;while(++r<u){var s=tu(i[r],o[r]);if(s){if(r>=a)return s;var c=n[r];return s*("desc"==c?-1:1)}}return t.index-e.index}function nu(t,e,r,i){var o=-1,u=t.length,a=r.length,s=-1,c=e.length,l=De(u-a,0),f=n(c+l),h=!i;while(++s<c)f[s]=e[s];while(++o<a)(h||o<u)&&(f[r[o]]=t[o]);while(l--)f[s++]=t[o++];return f}function ru(t,e,r,i){var o=-1,u=t.length,a=-1,s=r.length,c=-1,l=e.length,f=De(u-s,0),h=n(f+l),p=!i;while(++o<f)h[o]=t[o];var d=o;while(++c<l)h[d+c]=e[c];while(++a<s)(p||o<u)&&(h[d+r[a]]=t[o++]);return h}function iu(t,e){var r=-1,i=t.length;e||(e=n(i));while(++r<i)e[r]=t[r];return e}function ou(t,e,n,r){var i=!n;n||(n={});var u=-1,a=e.length;while(++u<a){var s=e[u],c=r?r(n[s],t[s],s,n,t):o;c===o&&(c=t[s]),i?di(n,s,c):ci(n,s,c)}return n}function uu(t,e){return ou(t,Yu(t),e)}function au(t,e){return ou(t,Qu(t),e)}function su(t,e){return function(n,r){var i=sl(n)?bn:fi,o=e?e():{};return i(n,t,zu(r,2),o)}}function cu(t){return bo((function(e,n){var r=-1,i=n.length,u=i>1?n[i-1]:o,a=i>2?n[2]:o;u=t.length>3&&"function"==typeof u?(i--,u):o,a&&aa(n[0],n[1],a)&&(u=i<3?o:u,i=1),e=ne(e);while(++r<i){var s=n[r];s&&t(e,s,r,u)}return e}))}function lu(t,e){return function(n,r){if(null==n)return n;if(!ll(n))return t(n,r);var i=n.length,o=e?i:-1,u=ne(n);while(e?o--:++o<i)if(!1===r(u[o],o,u))break;return n}}function fu(t){return function(e,n,r){var i=-1,o=ne(e),u=r(e),a=u.length;while(a--){var s=u[t?a:++i];if(!1===n(o[s],s,o))break}return e}}function hu(t,e,n){var r=e&w,i=vu(t);function o(){var e=this&&this!==sn&&this instanceof o?i:t;return e.apply(r?n:this,arguments)}return o}function pu(t){return function(e){e=$l(e);var n=ur(e)?mr(e):o,r=n?n[0]:e.charAt(0),i=n?Zo(n,1).join(""):e.slice(1);return r[t]()+i}}function du(t){return function(e){return Cn(Ah(Yf(e).replace(Ve,"")),t,"")}}function vu(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=kr(t.prototype),r=t.apply(n,e);return xl(r)?r:n}}function gu(t,e,r){var i=vu(t);function u(){var a=arguments.length,s=n(a),c=a,l=Vu(u);while(c--)s[c]=arguments[c];var f=a<3&&s[0]!==l&&s[a-1]!==l?[]:fr(s,l);if(a-=f.length,a<r)return Tu(t,e,wu,u.placeholder,o,s,f,o,o,r-a);var h=this&&this!==sn&&this instanceof u?i:t;return _n(h,this,s)}return u}function mu(t){return function(e,n,r){var i=ne(e);if(!ll(e)){var u=zu(n,3);e=kf(e),n=function(t){return u(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[u?e[a]:a]:o}}function yu(t){return Ru((function(e){var n=e.length,r=n,i=Sr.prototype.thru;t&&e.reverse();while(r--){var u=e[r];if("function"!=typeof u)throw new oe(c);if(i&&!a&&"wrapper"==Ku(u))var a=new Sr([],!0)}r=a?r:n;while(++r<n){u=e[r];var s=Ku(u),l="wrapper"==s?Wu(u):o;a=l&&la(l[0])&&l[1]==(S|A|x|T)&&!l[4].length&&1==l[9]?a[Ku(l[0])].apply(a,l[3]):1==u.length&&la(u)?a[s]():a.thru(u)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&sl(r))return a.plant(r).value();var i=0,o=n?e[i].apply(this,t):r;while(++i<n)o=e[i].call(this,o);return o}}))}function wu(t,e,r,i,u,a,s,c,l,f){var h=e&S,p=e&w,d=e&_,v=e&(A|k),g=e&q,m=d?o:vu(t);function y(){var o=arguments.length,w=n(o),_=o;while(_--)w[_]=arguments[_];if(v)var b=Vu(y),A=er(w,b);if(i&&(w=nu(w,i,u,v)),a&&(w=ru(w,a,s,v)),o-=A,v&&o<f){var k=fr(w,b);return Tu(t,e,wu,y.placeholder,r,w,k,c,l,f-o)}var x=p?r:this,I=d?x[t]:t;return o=w.length,c?w=Aa(w,c):g&&o>1&&w.reverse(),h&&l<o&&(w.length=l),this&&this!==sn&&this instanceof y&&(I=m||vu(I)),I.apply(x,w)}return y}function _u(t,e){return function(n,r){return Ki(n,t,e(r),{})}}function bu(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=Bo(n),r=Bo(r)):(n=No(n),r=No(r)),i=t(n,r)}return i}}function Au(t){return Ru((function(e){return e=qn(e,Qn(zu())),bo((function(n){var r=this;return t(e,(function(t){return _n(t,r,n)}))}))}))}function ku(t,e){e=e===o?" ":Bo(e);var n=e.length;if(n<2)return n?_o(e,t):e;var r=_o(e,Ne(t/gr(e)));return ur(e)?Zo(mr(r),0,t).join(""):r.slice(0,t)}function xu(t,e,r,i){var o=e&w,u=vu(t);function a(){var e=-1,s=arguments.length,c=-1,l=i.length,f=n(l+s),h=this&&this!==sn&&this instanceof a?u:t;while(++c<l)f[c]=i[c];while(s--)f[c++]=arguments[++e];return _n(h,o?r:this,f)}return a}function Iu(t){return function(e,n,r){return r&&"number"!=typeof r&&aa(e,n,r)&&(n=r=o),e=Jl(e),n===o?(n=e,e=0):n=Jl(n),r=r===o?e<n?1:-1:Jl(r),wo(e,n,r,t)}}function Su(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Ql(e),n=Ql(n)),t(e,n)}}function Tu(t,e,n,r,i,u,a,s,c,l){var f=e&A,h=f?a:o,p=f?o:a,d=f?u:o,v=f?o:u;e|=f?x:I,e&=~(f?I:x),e&b||(e&=~(w|_));var g=[t,e,i,d,h,v,p,s,c,l],m=n.apply(o,g);return la(t)&&xa(m,g),m.placeholder=r,Ta(m,t,e)}function qu(t){var e=Vt[t];return function(t,n){if(t=Ql(t),n=null==n?0:We(Gl(n),292),n&&Pe(t)){var r=($l(t)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+n));return r=($l(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-n))}return e(t)}}var Eu=en&&1/hr(new en([,-0]))[1]==U?function(t){return new en(t)}:Fh;function Cu(t){return function(e){var n=Xu(e);return n==$?cr(e):n==ut?pr(e):Gn(e,t(e))}}function Ou(t,e,n,r,i,u,a,s){var l=e&_;if(!l&&"function"!=typeof t)throw new oe(c);var f=r?r.length:0;if(f||(e&=~(x|I),r=i=o),a=a===o?a:De(Gl(a),0),s=s===o?s:Gl(s),f-=i?i.length:0,e&I){var h=r,p=i;r=i=o}var d=l?o:Wu(t),v=[t,e,n,r,i,h,p,u,a,s];if(d&&ma(v,d),t=v[0],e=v[1],n=v[2],r=v[3],i=v[4],s=v[9]=v[9]===o?l?0:t.length:De(v[9]-f,0),!s&&e&(A|k)&&(e&=~(A|k)),e&&e!=w)g=e==A||e==k?gu(t,e,s):e!=x&&e!=(w|x)||i.length?wu.apply(o,v):xu(t,e,n,r);else var g=hu(t,e,n);var m=d?Io:xa;return Ta(m(g,v),t,e)}function Mu(t,e,n,r){return t===o||il(t,se[n])&&!fe.call(r,n)?e:t}function Nu(t,e,n,r,i,u){return xl(t)&&xl(e)&&(u.set(e,t),so(t,e,o,Nu,u),u["delete"](e)),t}function Bu(t){return Bl(t)?o:t}function ju(t,e,n,r,i,u){var a=n&m,s=t.length,c=e.length;if(s!=c&&!(a&&c>s))return!1;var l=u.get(t),f=u.get(e);if(l&&f)return l==e&&f==t;var h=-1,p=!0,d=n&y?new Yr:o;u.set(t,e),u.set(e,t);while(++h<s){var v=t[h],g=e[h];if(r)var w=a?r(g,v,h,e,t,u):r(v,g,h,t,e,u);if(w!==o){if(w)continue;p=!1;break}if(d){if(!Mn(e,(function(t,e){if(!Hn(d,e)&&(v===t||i(v,t,n,r,u)))return d.push(e)}))){p=!1;break}}else if(v!==g&&!i(v,g,n,r,u)){p=!1;break}}return u["delete"](t),u["delete"](e),p}function Uu(t,e,n,r,i,o,u){switch(n){case pt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ht:return!(t.byteLength!=e.byteLength||!o(new _e(t),new _e(e)));case J:case G:case tt:return il(+t,+e);case Q:return t.name==e.name&&t.message==e.message;case ot:case at:return t==e+"";case $:var a=cr;case ut:var s=r&m;if(a||(a=hr),t.size!=e.size&&!s)return!1;var c=u.get(t);if(c)return c==e;r|=y,u.set(t,e);var l=ju(a(t),a(e),r,i,o,u);return u["delete"](t),l;case st:if(dr)return dr.call(t)==dr.call(e)}return!1}function Pu(t,e,n,r,i,u){var a=n&m,s=Fu(t),c=s.length,l=Fu(e),f=l.length;if(c!=f&&!a)return!1;var h=c;while(h--){var p=s[h];if(!(a?p in e:fe.call(e,p)))return!1}var d=u.get(t),v=u.get(e);if(d&&v)return d==e&&v==t;var g=!0;u.set(t,e),u.set(e,t);var y=a;while(++h<c){p=s[h];var w=t[p],_=e[p];if(r)var b=a?r(_,w,p,e,t,u):r(w,_,p,t,e,u);if(!(b===o?w===_||i(w,_,n,r,u):b)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var A=t.constructor,k=e.constructor;A==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof A&&A instanceof A&&"function"==typeof k&&k instanceof k||(g=!1)}return u["delete"](t),u["delete"](e),g}function Ru(t){return Sa(_a(t,o,Ga),t+"")}function Fu(t){return ji(t,kf,Yu)}function Du(t){return ji(t,xf,Qu)}var Wu=an?function(t){return an.get(t)}:Fh;function Ku(t){var e=t.name+"",n=cn[e],r=fe.call(cn,e)?n.length:0;while(r--){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function Vu(t){var e=fe.call(br,"placeholder")?br:t;return e.placeholder}function zu(){var t=br.iteratee||Mh;return t=t===Mh?eo:t,arguments.length?t(arguments[0],arguments[1]):t}function Lu(t,e){var n=t.__data__;return ca(e)?n["string"==typeof e?"string":"hash"]:n.map}function Zu(t){var e=kf(t),n=e.length;while(n--){var r=e[n],i=t[r];e[n]=[r,i,da(i)]}return e}function Ju(t,e){var n=or(t,e);return Xi(n)?n:o}function Gu(t){var e=fe.call(t,qe),n=t[qe];try{t[qe]=o;var r=!0}catch(u){}var i=de.call(t);return r&&(e?t[qe]=n:delete t[qe]),i}var Yu=je?function(t){return null==t?[]:(t=ne(t),In(je(t),(function(e){return xe.call(t,e)})))}:Gh,Qu=je?function(t){var e=[];while(t)En(e,Yu(t)),t=Ae(t);return e}:Gh,Xu=Ui;function Hu(t,e,n){var r=-1,i=n.length;while(++r<i){var o=n[r],u=o.size;switch(o.type){case"drop":t+=u;break;case"dropRight":e-=u;break;case"take":e=We(e,t+u);break;case"takeRight":t=De(t,e-u);break}}return{start:t,end:e}}function $u(t){var e=t.match(Wt);return e?e[1].split(Kt):[]}function ta(t,e,n){e=zo(e,t);var r=-1,i=e.length,o=!1;while(++r<i){var u=Oa(e[r]);if(!(o=null!=t&&n(t,u)))break;t=t[u]}return o||++r!=i?o:(i=null==t?0:t.length,!!i&&kl(i)&&ua(u,i)&&(sl(t)||al(t)))}function ea(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&fe.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function na(t){return"function"!=typeof t.constructor||pa(t)?{}:kr(Ae(t))}function ra(t,e,n){var r=t.constructor;switch(e){case ht:return Yo(t);case J:case G:return new r(+t);case pt:return Qo(t,n);case dt:case vt:case gt:case mt:case yt:case wt:case _t:case bt:case At:return $o(t,n);case $:return new r;case tt:case at:return new r(t);case ot:return Xo(t);case ut:return new r;case st:return Ho(t)}}function ia(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Dt,"{\n/* [wrapped with "+e+"] */\n")}function oa(t){return sl(t)||al(t)||!!(Se&&t&&t[Se])}function ua(t,e){var n=typeof t;return e=null==e?P:e,!!e&&("number"==n||"symbol"!=n&&Ht.test(t))&&t>-1&&t%1==0&&t<e}function aa(t,e,n){if(!xl(n))return!1;var r=typeof e;return!!("number"==r?ll(n)&&ua(e,n.length):"string"==r&&e in n)&&il(n[e],t)}function sa(t,e){if(sl(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Fl(t))||(Bt.test(t)||!Nt.test(t)||null!=e&&t in ne(e))}function ca(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function la(t){var e=Ku(t),n=br[e];if("function"!=typeof n||!(e in Tr.prototype))return!1;if(t===n)return!0;var r=Wu(n);return!!r&&t===r[0]}function fa(t){return!!pe&&pe in t}(Ge&&Xu(new Ge(new ArrayBuffer(1)))!=pt||$e&&Xu(new $e)!=$||tn&&Xu(tn.resolve())!=rt||en&&Xu(new en)!=ut||nn&&Xu(new nn)!=lt)&&(Xu=function(t){var e=Ui(t),n=e==nt?t.constructor:o,r=n?Ma(n):"";if(r)switch(r){case ln:return pt;case hn:return $;case pn:return rt;case Nn:return ut;case Bn:return lt}return e});var ha=ce?bl:Yh;function pa(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||se;return t===n}function da(t){return t===t&&!xl(t)}function va(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==o||t in ne(n)))}}function ga(t){var e=Dc(t,(function(t){return n.size===h&&n.clear(),t})),n=e.cache;return e}function ma(t,e){var n=t[1],r=e[1],i=n|r,o=i<(w|_|S),u=r==S&&n==A||r==S&&n==T&&t[7].length<=e[8]||r==(S|T)&&e[7].length<=e[8]&&n==A;if(!o&&!u)return t;r&w&&(t[2]=e[2],i|=n&w?0:b);var a=e[3];if(a){var s=t[3];t[3]=s?nu(s,a,e[4]):a,t[4]=s?fr(t[3],p):e[4]}return a=e[5],a&&(s=t[5],t[5]=s?ru(s,a,e[6]):a,t[6]=s?fr(t[5],p):e[6]),a=e[7],a&&(t[7]=a),r&S&&(t[8]=null==t[8]?e[8]:We(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function ya(t){var e=[];if(null!=t)for(var n in ne(t))e.push(n);return e}function wa(t){return de.call(t)}function _a(t,e,r){return e=De(e===o?t.length-1:e,0),function(){var i=arguments,o=-1,u=De(i.length-e,0),a=n(u);while(++o<u)a[o]=i[e+o];o=-1;var s=n(e+1);while(++o<e)s[o]=i[o];return s[e]=r(a),_n(t,this,s)}}function ba(t,e){return e.length<2?t:Bi(t,qo(e,0,-1))}function Aa(t,e){var n=t.length,r=We(e.length,n),i=iu(t);while(r--){var u=e[r];t[r]=ua(u,n)?i[u]:o}return t}function ka(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var xa=qa(Io),Ia=Me||function(t,e){return sn.setTimeout(t,e)},Sa=qa(So);function Ta(t,e,n){var r=e+"";return Sa(t,ia(r,Na($u(r),n)))}function qa(t){var e=0,n=0;return function(){var r=Ke(),i=M-(r-n);if(n=r,i>0){if(++e>=O)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Ea(t,e){var n=-1,r=t.length,i=r-1;e=e===o?r:e;while(++n<e){var u=yo(n,i),a=t[u];t[u]=t[n],t[n]=a}return t.length=e,t}var Ca=ga((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(jt,(function(t,n,r,i){e.push(r?i.replace(Lt,"$1"):n||t)})),e}));function Oa(t){if("string"==typeof t||Fl(t))return t;var e=t+"";return"0"==e&&1/t==-U?"-0":e}function Ma(t){if(null!=t){try{return le.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Na(t,e){return An(V,(function(n){var r="_."+n[0];e&n[1]&&!Sn(t,r)&&t.push(r)})),t.sort()}function Ba(t){if(t instanceof Tr)return t.clone();var e=new Sr(t.__wrapped__,t.__chain__);return e.__actions__=iu(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function ja(t,e,r){e=(r?aa(t,e,r):e===o)?1:De(Gl(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];var u=0,a=0,s=n(Ne(i/e));while(u<i)s[a++]=qo(t,u,u+=e);return s}function Ua(t){var e=-1,n=null==t?0:t.length,r=0,i=[];while(++e<n){var o=t[e];o&&(i[r++]=o)}return i}function Pa(){var t=arguments.length;if(!t)return[];var e=n(t-1),r=arguments[0],i=t;while(i--)e[i-1]=arguments[i];return En(sl(r)?iu(r):[r],qi(e,1))}var Ra=bo((function(t,e){return fl(t)?bi(t,qi(e,1,fl,!0)):[]})),Fa=bo((function(t,e){var n=os(e);return fl(n)&&(n=o),fl(t)?bi(t,qi(e,1,fl,!0),zu(n,2)):[]})),Da=bo((function(t,e){var n=os(e);return fl(n)&&(n=o),fl(t)?bi(t,qi(e,1,fl,!0),o,n):[]}));function Wa(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===o?1:Gl(e),qo(t,e<0?0:e,r)):[]}function Ka(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===o?1:Gl(e),e=r-e,qo(t,0,e<0?0:e)):[]}function Va(t,e){return t&&t.length?Ro(t,zu(e,3),!0,!0):[]}function za(t,e){return t&&t.length?Ro(t,zu(e,3),!0):[]}function La(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&aa(t,e,n)&&(n=0,r=i),Si(t,e,n,r)):[]}function Za(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Gl(n);return i<0&&(i=De(r+i,0)),Pn(t,zu(e,3),i)}function Ja(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=Gl(n),i=n<0?De(r+i,0):We(i,r-1)),Pn(t,zu(e,3),i,!0)}function Ga(t){var e=null==t?0:t.length;return e?qi(t,1):[]}function Ya(t){var e=null==t?0:t.length;return e?qi(t,U):[]}function Qa(t,e){var n=null==t?0:t.length;return n?(e=e===o?1:Gl(e),qi(t,e)):[]}function Xa(t){var e=-1,n=null==t?0:t.length,r={};while(++e<n){var i=t[e];r[i[0]]=i[1]}return r}function Ha(t){return t&&t.length?t[0]:o}function $a(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Gl(n);return i<0&&(i=De(r+i,0)),Rn(t,e,i)}function ts(t){var e=null==t?0:t.length;return e?qo(t,0,-1):[]}var es=bo((function(t){var e=qn(t,Ko);return e.length&&e[0]===t[0]?Wi(e):[]})),ns=bo((function(t){var e=os(t),n=qn(t,Ko);return e===os(n)?e=o:n.pop(),n.length&&n[0]===t[0]?Wi(n,zu(e,2)):[]})),rs=bo((function(t){var e=os(t),n=qn(t,Ko);return e="function"==typeof e?e:o,e&&n.pop(),n.length&&n[0]===t[0]?Wi(n,o,e):[]}));function is(t,e){return null==t?"":Re.call(t,e)}function os(t){var e=null==t?0:t.length;return e?t[e-1]:o}function us(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=Gl(n),i=i<0?De(r+i,0):We(i,r-1)),e===e?vr(t,e,i):Pn(t,Dn,i,!0)}function as(t,e){return t&&t.length?lo(t,Gl(e)):o}var ss=bo(cs);function cs(t,e){return t&&t.length&&e&&e.length?go(t,e):t}function ls(t,e,n){return t&&t.length&&e&&e.length?go(t,e,zu(n,2)):t}function fs(t,e,n){return t&&t.length&&e&&e.length?go(t,e,o,n):t}var hs=Ru((function(t,e){var n=null==t?0:t.length,r=vi(t,e);return mo(t,qn(e,(function(t){return ua(t,n)?+t:t})).sort(tu)),r}));function ps(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;e=zu(e,3);while(++r<o){var u=t[r];e(u,r,t)&&(n.push(u),i.push(r))}return mo(t,i),n}function ds(t){return null==t?t:Je.call(t)}function vs(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&aa(t,e,n)?(e=0,n=r):(e=null==e?0:Gl(e),n=n===o?r:Gl(n)),qo(t,e,n)):[]}function gs(t,e){return Co(t,e)}function ms(t,e,n){return Oo(t,e,zu(n,2))}function ys(t,e){var n=null==t?0:t.length;if(n){var r=Co(t,e);if(r<n&&il(t[r],e))return r}return-1}function ws(t,e){return Co(t,e,!0)}function _s(t,e,n){return Oo(t,e,zu(n,2),!0)}function bs(t,e){var n=null==t?0:t.length;if(n){var r=Co(t,e,!0)-1;if(il(t[r],e))return r}return-1}function As(t){return t&&t.length?Mo(t):[]}function ks(t,e){return t&&t.length?Mo(t,zu(e,2)):[]}function xs(t){var e=null==t?0:t.length;return e?qo(t,1,e):[]}function Is(t,e,n){return t&&t.length?(e=n||e===o?1:Gl(e),qo(t,0,e<0?0:e)):[]}function Ss(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===o?1:Gl(e),e=r-e,qo(t,e<0?0:e,r)):[]}function Ts(t,e){return t&&t.length?Ro(t,zu(e,3),!1,!0):[]}function qs(t,e){return t&&t.length?Ro(t,zu(e,3)):[]}var Es=bo((function(t){return jo(qi(t,1,fl,!0))})),Cs=bo((function(t){var e=os(t);return fl(e)&&(e=o),jo(qi(t,1,fl,!0),zu(e,2))})),Os=bo((function(t){var e=os(t);return e="function"==typeof e?e:o,jo(qi(t,1,fl,!0),o,e)}));function Ms(t){return t&&t.length?jo(t):[]}function Ns(t,e){return t&&t.length?jo(t,zu(e,2)):[]}function Bs(t,e){return e="function"==typeof e?e:o,t&&t.length?jo(t,o,e):[]}function js(t){if(!t||!t.length)return[];var e=0;return t=In(t,(function(t){if(fl(t))return e=De(t.length,e),!0})),Jn(e,(function(e){return qn(t,Kn(e))}))}function Us(t,e){if(!t||!t.length)return[];var n=js(t);return null==e?n:qn(n,(function(t){return _n(e,o,t)}))}var Ps=bo((function(t,e){return fl(t)?bi(t,e):[]})),Rs=bo((function(t){return Do(In(t,fl))})),Fs=bo((function(t){var e=os(t);return fl(e)&&(e=o),Do(In(t,fl),zu(e,2))})),Ds=bo((function(t){var e=os(t);return e="function"==typeof e?e:o,Do(In(t,fl),o,e)})),Ws=bo(js);function Ks(t,e){return Wo(t||[],e||[],ci)}function Vs(t,e){return Wo(t||[],e||[],xo)}var zs=bo((function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Us(t,n)}));function Ls(t){var e=br(t);return e.__chain__=!0,e}function Zs(t,e){return e(t),t}function Js(t,e){return e(t)}var Gs=Ru((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return vi(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Tr&&ua(n)?(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:Js,args:[i],thisArg:o}),new Sr(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)}));function Ys(){return Ls(this)}function Qs(){return new Sr(this.value(),this.__chain__)}function Xs(){this.__values__===o&&(this.__values__=Zl(this.value()));var t=this.__index__>=this.__values__.length,e=t?o:this.__values__[this.__index__++];return{done:t,value:e}}function Hs(){return this}function $s(t){var e,n=this;while(n instanceof Ir){var r=Ba(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function tc(){var t=this.__wrapped__;if(t instanceof Tr){var e=t;return this.__actions__.length&&(e=new Tr(this)),e=e.reverse(),e.__actions__.push({func:Js,args:[ds],thisArg:o}),new Sr(e,this.__chain__)}return this.thru(ds)}function ec(){return Fo(this.__wrapped__,this.__actions__)}var nc=su((function(t,e,n){fe.call(t,n)?++t[n]:di(t,n,1)}));function rc(t,e,n){var r=sl(t)?xn:xi;return n&&aa(t,e,n)&&(e=o),r(t,zu(e,3))}function ic(t,e){var n=sl(t)?In:Ti;return n(t,zu(e,3))}var oc=mu(Za),uc=mu(Ja);function ac(t,e){return qi(gc(t,e),1)}function sc(t,e){return qi(gc(t,e),U)}function cc(t,e,n){return n=n===o?1:Gl(n),qi(gc(t,e),n)}function lc(t,e){var n=sl(t)?An:Ai;return n(t,zu(e,3))}function fc(t,e){var n=sl(t)?kn:ki;return n(t,zu(e,3))}var hc=su((function(t,e,n){fe.call(t,n)?t[n].push(e):di(t,n,[e])}));function pc(t,e,n,r){t=ll(t)?t:Kf(t),n=n&&!r?Gl(n):0;var i=t.length;return n<0&&(n=De(i+n,0)),Rl(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Rn(t,e,n)>-1}var dc=bo((function(t,e,r){var i=-1,o="function"==typeof e,u=ll(t)?n(t.length):[];return Ai(t,(function(t){u[++i]=o?_n(e,t,r):Vi(t,e,r)})),u})),vc=su((function(t,e,n){di(t,n,e)}));function gc(t,e){var n=sl(t)?qn:oo;return n(t,zu(e,3))}function mc(t,e,n,r){return null==t?[]:(sl(e)||(e=null==e?[]:[e]),n=r?o:n,sl(n)||(n=null==n?[]:[n]),fo(t,e,n))}var yc=su((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));function wc(t,e,n){var r=sl(t)?Cn:zn,i=arguments.length<3;return r(t,zu(e,4),n,i,Ai)}function _c(t,e,n){var r=sl(t)?On:zn,i=arguments.length<3;return r(t,zu(e,4),n,i,ki)}function bc(t,e){var n=sl(t)?In:Ti;return n(t,Wc(zu(e,3)))}function Ac(t){var e=sl(t)?oi:Ao;return e(t)}function kc(t,e,n){e=(n?aa(t,e,n):e===o)?1:Gl(e);var r=sl(t)?ui:ko;return r(t,e)}function xc(t){var e=sl(t)?ai:To;return e(t)}function Ic(t){if(null==t)return 0;if(ll(t))return Rl(t)?gr(t):t.length;var e=Xu(t);return e==$||e==ut?t.size:no(t).length}function Sc(t,e,n){var r=sl(t)?Mn:Eo;return n&&aa(t,e,n)&&(e=o),r(t,zu(e,3))}var Tc=bo((function(t,e){if(null==t)return[];var n=e.length;return n>1&&aa(t,e[0],e[1])?e=[]:n>2&&aa(e[0],e[1],e[2])&&(e=[e[0]]),fo(t,qi(e,1),[])})),qc=Oe||function(){return sn.Date.now()};function Ec(t,e){if("function"!=typeof e)throw new oe(c);return t=Gl(t),function(){if(--t<1)return e.apply(this,arguments)}}function Cc(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Ou(t,S,o,o,o,o,e)}function Oc(t,e){var n;if("function"!=typeof e)throw new oe(c);return t=Gl(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var Mc=bo((function(t,e,n){var r=w;if(n.length){var i=fr(n,Vu(Mc));r|=x}return Ou(t,r,e,n,i)})),Nc=bo((function(t,e,n){var r=w|_;if(n.length){var i=fr(n,Vu(Nc));r|=x}return Ou(e,r,t,n,i)}));function Bc(t,e,n){e=n?o:e;var r=Ou(t,A,o,o,o,o,o,e);return r.placeholder=Bc.placeholder,r}function jc(t,e,n){e=n?o:e;var r=Ou(t,k,o,o,o,o,o,e);return r.placeholder=jc.placeholder,r}function Uc(t,e,n){var r,i,u,a,s,l,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new oe(c);function v(e){var n=r,u=i;return r=i=o,f=e,a=t.apply(u,n),a}function g(t){return f=t,s=Ia(w,e),h?v(t):a}function m(t){var n=t-l,r=t-f,i=e-n;return p?We(i,u-r):i}function y(t){var n=t-l,r=t-f;return l===o||n>=e||n<0||p&&r>=u}function w(){var t=qc();if(y(t))return _(t);s=Ia(w,m(t))}function _(t){return s=o,d&&r?v(t):(r=i=o,a)}function b(){s!==o&&Jo(s),f=0,r=l=i=s=o}function A(){return s===o?a:_(qc())}function k(){var t=qc(),n=y(t);if(r=arguments,i=this,l=t,n){if(s===o)return g(l);if(p)return Jo(s),s=Ia(w,e),v(l)}return s===o&&(s=Ia(w,e)),a}return e=Ql(e)||0,xl(n)&&(h=!!n.leading,p="maxWait"in n,u=p?De(Ql(n.maxWait)||0,e):u,d="trailing"in n?!!n.trailing:d),k.cancel=b,k.flush=A,k}var Pc=bo((function(t,e){return _i(t,1,e)})),Rc=bo((function(t,e,n){return _i(t,Ql(e)||0,n)}));function Fc(t){return Ou(t,q)}function Dc(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new oe(c);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(Dc.Cache||Vr),n}function Wc(t){if("function"!=typeof t)throw new oe(c);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Kc(t){return Oc(2,t)}Dc.Cache=Vr;var Vc=Lo((function(t,e){e=1==e.length&&sl(e[0])?qn(e[0],Qn(zu())):qn(qi(e,1),Qn(zu()));var n=e.length;return bo((function(r){var i=-1,o=We(r.length,n);while(++i<o)r[i]=e[i].call(this,r[i]);return _n(t,this,r)}))})),zc=bo((function(t,e){var n=fr(e,Vu(zc));return Ou(t,x,o,e,n)})),Lc=bo((function(t,e){var n=fr(e,Vu(Lc));return Ou(t,I,o,e,n)})),Zc=Ru((function(t,e){return Ou(t,T,o,o,o,e)}));function Jc(t,e){if("function"!=typeof t)throw new oe(c);return e=e===o?e:Gl(e),bo(t,e)}function Gc(t,e){if("function"!=typeof t)throw new oe(c);return e=null==e?0:De(Gl(e),0),bo((function(n){var r=n[e],i=Zo(n,0,e);return r&&En(i,r),_n(t,this,i)}))}function Yc(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new oe(c);return xl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Uc(t,e,{leading:r,maxWait:e,trailing:i})}function Qc(t){return Cc(t,1)}function Xc(t,e){return zc(Vo(e),t)}function Hc(){if(!arguments.length)return[];var t=arguments[0];return sl(t)?t:[t]}function $c(t){return mi(t,g)}function tl(t,e){return e="function"==typeof e?e:o,mi(t,g,e)}function el(t){return mi(t,d|g)}function nl(t,e){return e="function"==typeof e?e:o,mi(t,d|g,e)}function rl(t,e){return null==e||wi(t,e,kf(e))}function il(t,e){return t===e||t!==t&&e!==e}var ol=Su(Pi),ul=Su((function(t,e){return t>=e})),al=zi(function(){return arguments}())?zi:function(t){return Il(t)&&fe.call(t,"callee")&&!xe.call(t,"callee")},sl=n.isArray,cl=dn?Qn(dn):Li;function ll(t){return null!=t&&kl(t.length)&&!bl(t)}function fl(t){return Il(t)&&ll(t)}function hl(t){return!0===t||!1===t||Il(t)&&Ui(t)==J}var pl=Ue||Yh,dl=vn?Qn(vn):Zi;function vl(t){return Il(t)&&1===t.nodeType&&!Bl(t)}function gl(t){if(null==t)return!0;if(ll(t)&&(sl(t)||"string"==typeof t||"function"==typeof t.splice||pl(t)||Dl(t)||al(t)))return!t.length;var e=Xu(t);if(e==$||e==ut)return!t.size;if(pa(t))return!no(t).length;for(var n in t)if(fe.call(t,n))return!1;return!0}function ml(t,e){return Ji(t,e)}function yl(t,e,n){n="function"==typeof n?n:o;var r=n?n(t,e):o;return r===o?Ji(t,e,o,n):!!r}function wl(t){if(!Il(t))return!1;var e=Ui(t);return e==Q||e==Y||"string"==typeof t.message&&"string"==typeof t.name&&!Bl(t)}function _l(t){return"number"==typeof t&&Pe(t)}function bl(t){if(!xl(t))return!1;var e=Ui(t);return e==X||e==H||e==Z||e==it}function Al(t){return"number"==typeof t&&t==Gl(t)}function kl(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=P}function xl(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Il(t){return null!=t&&"object"==typeof t}var Sl=gn?Qn(gn):Yi;function Tl(t,e){return t===e||Qi(t,e,Zu(e))}function ql(t,e,n){return n="function"==typeof n?n:o,Qi(t,e,Zu(e),n)}function El(t){return Nl(t)&&t!=+t}function Cl(t){if(ha(t))throw new i(s);return Xi(t)}function Ol(t){return null===t}function Ml(t){return null==t}function Nl(t){return"number"==typeof t||Il(t)&&Ui(t)==tt}function Bl(t){if(!Il(t)||Ui(t)!=nt)return!1;var e=Ae(t);if(null===e)return!0;var n=fe.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&le.call(n)==ve}var jl=mn?Qn(mn):Hi;function Ul(t){return Al(t)&&t>=-P&&t<=P}var Pl=yn?Qn(yn):$i;function Rl(t){return"string"==typeof t||!sl(t)&&Il(t)&&Ui(t)==at}function Fl(t){return"symbol"==typeof t||Il(t)&&Ui(t)==st}var Dl=wn?Qn(wn):to;function Wl(t){return t===o}function Kl(t){return Il(t)&&Xu(t)==lt}function Vl(t){return Il(t)&&Ui(t)==ft}var zl=Su(io),Ll=Su((function(t,e){return t<=e}));function Zl(t){if(!t)return[];if(ll(t))return Rl(t)?mr(t):iu(t);if(Te&&t[Te])return sr(t[Te]());var e=Xu(t),n=e==$?cr:e==ut?hr:Kf;return n(t)}function Jl(t){if(!t)return 0===t?t:0;if(t=Ql(t),t===U||t===-U){var e=t<0?-1:1;return e*R}return t===t?t:0}function Gl(t){var e=Jl(t),n=e%1;return e===e?n?e-n:e:0}function Yl(t){return t?gi(Gl(t),0,D):0}function Ql(t){if("number"==typeof t)return t;if(Fl(t))return F;if(xl(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=xl(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Yn(t);var n=Yt.test(t);return n||Xt.test(t)?on(t.slice(2),n?2:8):Gt.test(t)?F:+t}function Xl(t){return ou(t,xf(t))}function Hl(t){return t?gi(Gl(t),-P,P):0===t?t:0}function $l(t){return null==t?"":Bo(t)}var tf=cu((function(t,e){if(pa(e)||ll(e))ou(e,kf(e),t);else for(var n in e)fe.call(e,n)&&ci(t,n,e[n])})),ef=cu((function(t,e){ou(e,xf(e),t)})),nf=cu((function(t,e,n,r){ou(e,xf(e),t,r)})),rf=cu((function(t,e,n,r){ou(e,kf(e),t,r)})),of=Ru(vi);function uf(t,e){var n=kr(t);return null==e?n:hi(n,e)}var af=bo((function(t,e){t=ne(t);var n=-1,r=e.length,i=r>2?e[2]:o;i&&aa(e[0],e[1],i)&&(r=1);while(++n<r){var u=e[n],a=xf(u),s=-1,c=a.length;while(++s<c){var l=a[s],f=t[l];(f===o||il(f,se[l])&&!fe.call(t,l))&&(t[l]=u[l])}}return t})),sf=bo((function(t){return t.push(o,Nu),_n(qf,o,t)}));function cf(t,e){return Un(t,zu(e,3),Oi)}function lf(t,e){return Un(t,zu(e,3),Mi)}function ff(t,e){return null==t?t:Ei(t,zu(e,3),xf)}function hf(t,e){return null==t?t:Ci(t,zu(e,3),xf)}function pf(t,e){return t&&Oi(t,zu(e,3))}function df(t,e){return t&&Mi(t,zu(e,3))}function vf(t){return null==t?[]:Ni(t,kf(t))}function gf(t){return null==t?[]:Ni(t,xf(t))}function mf(t,e,n){var r=null==t?o:Bi(t,e);return r===o?n:r}function yf(t,e){return null!=t&&ta(t,e,Ri)}function wf(t,e){return null!=t&&ta(t,e,Fi)}var _f=_u((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),t[e]=n}),Th(Oh)),bf=_u((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),fe.call(t,e)?t[e].push(n):t[e]=[n]}),zu),Af=bo(Vi);function kf(t){return ll(t)?ii(t):no(t)}function xf(t){return ll(t)?ii(t,!0):ro(t)}function If(t,e){var n={};return e=zu(e,3),Oi(t,(function(t,r,i){di(n,e(t,r,i),t)})),n}function Sf(t,e){var n={};return e=zu(e,3),Oi(t,(function(t,r,i){di(n,r,e(t,r,i))})),n}var Tf=cu((function(t,e,n){so(t,e,n)})),qf=cu((function(t,e,n,r){so(t,e,n,r)})),Ef=Ru((function(t,e){var n={};if(null==t)return n;var r=!1;e=qn(e,(function(e){return e=zo(e,t),r||(r=e.length>1),e})),ou(t,Du(t),n),r&&(n=mi(n,d|v|g,Bu));var i=e.length;while(i--)Uo(n,e[i]);return n}));function Cf(t,e){return Mf(t,Wc(zu(e)))}var Of=Ru((function(t,e){return null==t?{}:ho(t,e)}));function Mf(t,e){if(null==t)return{};var n=qn(Du(t),(function(t){return[t]}));return e=zu(e),po(t,n,(function(t,n){return e(t,n[0])}))}function Nf(t,e,n){e=zo(e,t);var r=-1,i=e.length;i||(i=1,t=o);while(++r<i){var u=null==t?o:t[Oa(e[r])];u===o&&(r=i,u=n),t=bl(u)?u.call(t):u}return t}function Bf(t,e,n){return null==t?t:xo(t,e,n)}function jf(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:xo(t,e,n,r)}var Uf=Cu(kf),Pf=Cu(xf);function Rf(t,e,n){var r=sl(t),i=r||pl(t)||Dl(t);if(e=zu(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:xl(t)&&bl(o)?kr(Ae(t)):{}}return(i?An:Oi)(t,(function(t,r,i){return e(n,t,r,i)})),n}function Ff(t,e){return null==t||Uo(t,e)}function Df(t,e,n){return null==t?t:Po(t,e,Vo(n))}function Wf(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Po(t,e,Vo(n),r)}function Kf(t){return null==t?[]:Xn(t,kf(t))}function Vf(t){return null==t?[]:Xn(t,xf(t))}function zf(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=Ql(n),n=n===n?n:0),e!==o&&(e=Ql(e),e=e===e?e:0),gi(Ql(t),e,n)}function Lf(t,e,n){return e=Jl(e),n===o?(n=e,e=0):n=Jl(n),t=Ql(t),Di(t,e,n)}function Zf(t,e,n){if(n&&"boolean"!=typeof n&&aa(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=Jl(t),e===o?(e=t,t=0):e=Jl(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Ze();return We(t+i*(e-t+rn("1e-"+((i+"").length-1))),e)}return yo(t,e)}var Jf=du((function(t,e,n){return e=e.toLowerCase(),t+(n?Gf(e):e)}));function Gf(t){return bh($l(t).toLowerCase())}function Yf(t){return t=$l(t),t&&t.replace($t,nr).replace(ze,"")}function Qf(t,e,n){t=$l(t),e=Bo(e);var r=t.length;n=n===o?r:gi(Gl(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function Xf(t){return t=$l(t),t&&Et.test(t)?t.replace(Tt,rr):t}function Hf(t){return t=$l(t),t&&Pt.test(t)?t.replace(Ut,"\\$&"):t}var $f=du((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),th=du((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),eh=pu("toLowerCase");function nh(t,e,n){t=$l(t),e=Gl(e);var r=e?gr(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ku(Be(i),n)+t+ku(Ne(i),n)}function rh(t,e,n){t=$l(t),e=Gl(e);var r=e?gr(t):0;return e&&r<e?t+ku(e-r,n):t}function ih(t,e,n){t=$l(t),e=Gl(e);var r=e?gr(t):0;return e&&r<e?ku(e-r,n)+t:t}function oh(t,e,n){return n||null==e?e=0:e&&(e=+e),Le($l(t).replace(Rt,""),e||0)}function uh(t,e,n){return e=(n?aa(t,e,n):e===o)?1:Gl(e),_o($l(t),e)}function ah(){var t=arguments,e=$l(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var sh=du((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function ch(t,e,n){return n&&"number"!=typeof n&&aa(t,e,n)&&(e=n=o),n=n===o?D:n>>>0,n?(t=$l(t),t&&("string"==typeof e||null!=e&&!jl(e))&&(e=Bo(e),!e&&ur(t))?Zo(mr(t),0,n):t.split(e,n)):[]}var lh=du((function(t,e,n){return t+(n?" ":"")+bh(e)}));function fh(t,e,n){return t=$l(t),n=null==n?0:gi(Gl(n),0,t.length),e=Bo(e),t.slice(n,n+e.length)==e}function hh(t,e,n){var r=br.templateSettings;n&&aa(t,e,n)&&(e=o),t=$l(t),e=nf({},e,r,Mu);var u,a,s=nf({},e.imports,r.imports,Mu),c=kf(s),f=Xn(s,c),h=0,p=e.interpolate||te,d="__p += '",v=re((e.escape||te).source+"|"+p.source+"|"+(p===Mt?Zt:te).source+"|"+(e.evaluate||te).source+"|$","g"),g="//# sourceURL="+(fe.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Qe+"]")+"\n";t.replace(v,(function(e,n,r,i,o,s){return r||(r=i),d+=t.slice(h,s).replace(ee,ir),n&&(u=!0,d+="' +\n__e("+n+") +\n'"),o&&(a=!0,d+="';\n"+o+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=s+e.length,e})),d+="';\n";var m=fe.call(e,"variable")&&e.variable;if(m){if(zt.test(m))throw new i(l)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(kt,""):d).replace(xt,"$1").replace(It,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var y=kh((function(){return Ft(c,g+"return "+d).apply(o,f)}));if(y.source=d,wl(y))throw y;return y}function ph(t){return $l(t).toLowerCase()}function dh(t){return $l(t).toUpperCase()}function vh(t,e,n){if(t=$l(t),t&&(n||e===o))return Yn(t);if(!t||!(e=Bo(e)))return t;var r=mr(t),i=mr(e),u=$n(r,i),a=tr(r,i)+1;return Zo(r,u,a).join("")}function gh(t,e,n){if(t=$l(t),t&&(n||e===o))return t.slice(0,yr(t)+1);if(!t||!(e=Bo(e)))return t;var r=mr(t),i=tr(r,mr(e))+1;return Zo(r,0,i).join("")}function mh(t,e,n){if(t=$l(t),t&&(n||e===o))return t.replace(Rt,"");if(!t||!(e=Bo(e)))return t;var r=mr(t),i=$n(r,mr(e));return Zo(r,i).join("")}function yh(t,e){var n=E,r=C;if(xl(e)){var i="separator"in e?e.separator:i;n="length"in e?Gl(e.length):n,r="omission"in e?Bo(e.omission):r}t=$l(t);var u=t.length;if(ur(t)){var a=mr(t);u=a.length}if(n>=u)return t;var s=n-gr(r);if(s<1)return r;var c=a?Zo(a,0,s).join(""):t.slice(0,s);if(i===o)return c+r;if(a&&(s+=c.length-s),jl(i)){if(t.slice(s).search(i)){var l,f=c;i.global||(i=re(i.source,$l(Jt.exec(i))+"g")),i.lastIndex=0;while(l=i.exec(f))var h=l.index;c=c.slice(0,h===o?s:h)}}else if(t.indexOf(Bo(i),s)!=s){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+r}function wh(t){return t=$l(t),t&&qt.test(t)?t.replace(St,wr):t}var _h=du((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),bh=pu("toUpperCase");function Ah(t,e,n){return t=$l(t),e=n?o:e,e===o?ar(t)?Ar(t):jn(t):t.match(e)||[]}var kh=bo((function(t,e){try{return _n(t,o,e)}catch(n){return wl(n)?n:new i(n)}})),xh=Ru((function(t,e){return An(e,(function(e){e=Oa(e),di(t,e,Mc(t[e],t))})),t}));function Ih(t){var e=null==t?0:t.length,n=zu();return t=e?qn(t,(function(t){if("function"!=typeof t[1])throw new oe(c);return[n(t[0]),t[1]]})):[],bo((function(n){var r=-1;while(++r<e){var i=t[r];if(_n(i[0],this,n))return _n(i[1],this,n)}}))}function Sh(t){return yi(mi(t,d))}function Th(t){return function(){return t}}function qh(t,e){return null==t||t!==t?e:t}var Eh=yu(),Ch=yu(!0);function Oh(t){return t}function Mh(t){return eo("function"==typeof t?t:mi(t,d))}function Nh(t){return uo(mi(t,d))}function Bh(t,e){return ao(t,mi(e,d))}var jh=bo((function(t,e){return function(n){return Vi(n,t,e)}})),Uh=bo((function(t,e){return function(n){return Vi(t,n,e)}}));function Ph(t,e,n){var r=kf(e),i=Ni(e,r);null!=n||xl(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Ni(e,kf(e)));var o=!(xl(n)&&"chain"in n)||!!n.chain,u=bl(t);return An(i,(function(n){var r=e[n];t[n]=r,u&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=iu(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,En([this.value()],arguments))})})),t}function Rh(){return sn._===this&&(sn._=ge),this}function Fh(){}function Dh(t){return t=Gl(t),bo((function(e){return lo(e,t)}))}var Wh=Au(qn),Kh=Au(xn),Vh=Au(Mn);function zh(t){return sa(t)?Kn(Oa(t)):vo(t)}function Lh(t){return function(e){return null==t?o:Bi(t,e)}}var Zh=Iu(),Jh=Iu(!0);function Gh(){return[]}function Yh(){return!1}function Qh(){return{}}function Xh(){return""}function Hh(){return!0}function $h(t,e){if(t=Gl(t),t<1||t>P)return[];var n=D,r=We(t,D);e=zu(e),t-=D;var i=Jn(r,e);while(++n<t)e(n);return i}function tp(t){return sl(t)?qn(t,Oa):Fl(t)?[t]:iu(Ca($l(t)))}function ep(t){var e=++he;return $l(t)+e}var np=bu((function(t,e){return t+e}),0),rp=qu("ceil"),ip=bu((function(t,e){return t/e}),1),op=qu("floor");function up(t){return t&&t.length?Ii(t,Oh,Pi):o}function ap(t,e){return t&&t.length?Ii(t,zu(e,2),Pi):o}function sp(t){return Wn(t,Oh)}function cp(t,e){return Wn(t,zu(e,2))}function lp(t){return t&&t.length?Ii(t,Oh,io):o}function fp(t,e){return t&&t.length?Ii(t,zu(e,2),io):o}var hp=bu((function(t,e){return t*e}),1),pp=qu("round"),dp=bu((function(t,e){return t-e}),0);function vp(t){return t&&t.length?Zn(t,Oh):0}function gp(t,e){return t&&t.length?Zn(t,zu(e,2)):0}return br.after=Ec,br.ary=Cc,br.assign=tf,br.assignIn=ef,br.assignInWith=nf,br.assignWith=rf,br.at=of,br.before=Oc,br.bind=Mc,br.bindAll=xh,br.bindKey=Nc,br.castArray=Hc,br.chain=Ls,br.chunk=ja,br.compact=Ua,br.concat=Pa,br.cond=Ih,br.conforms=Sh,br.constant=Th,br.countBy=nc,br.create=uf,br.curry=Bc,br.curryRight=jc,br.debounce=Uc,br.defaults=af,br.defaultsDeep=sf,br.defer=Pc,br.delay=Rc,br.difference=Ra,br.differenceBy=Fa,br.differenceWith=Da,br.drop=Wa,br.dropRight=Ka,br.dropRightWhile=Va,br.dropWhile=za,br.fill=La,br.filter=ic,br.flatMap=ac,br.flatMapDeep=sc,br.flatMapDepth=cc,br.flatten=Ga,br.flattenDeep=Ya,br.flattenDepth=Qa,br.flip=Fc,br.flow=Eh,br.flowRight=Ch,br.fromPairs=Xa,br.functions=vf,br.functionsIn=gf,br.groupBy=hc,br.initial=ts,br.intersection=es,br.intersectionBy=ns,br.intersectionWith=rs,br.invert=_f,br.invertBy=bf,br.invokeMap=dc,br.iteratee=Mh,br.keyBy=vc,br.keys=kf,br.keysIn=xf,br.map=gc,br.mapKeys=If,br.mapValues=Sf,br.matches=Nh,br.matchesProperty=Bh,br.memoize=Dc,br.merge=Tf,br.mergeWith=qf,br.method=jh,br.methodOf=Uh,br.mixin=Ph,br.negate=Wc,br.nthArg=Dh,br.omit=Ef,br.omitBy=Cf,br.once=Kc,br.orderBy=mc,br.over=Wh,br.overArgs=Vc,br.overEvery=Kh,br.overSome=Vh,br.partial=zc,br.partialRight=Lc,br.partition=yc,br.pick=Of,br.pickBy=Mf,br.property=zh,br.propertyOf=Lh,br.pull=ss,br.pullAll=cs,br.pullAllBy=ls,br.pullAllWith=fs,br.pullAt=hs,br.range=Zh,br.rangeRight=Jh,br.rearg=Zc,br.reject=bc,br.remove=ps,br.rest=Jc,br.reverse=ds,br.sampleSize=kc,br.set=Bf,br.setWith=jf,br.shuffle=xc,br.slice=vs,br.sortBy=Tc,br.sortedUniq=As,br.sortedUniqBy=ks,br.split=ch,br.spread=Gc,br.tail=xs,br.take=Is,br.takeRight=Ss,br.takeRightWhile=Ts,br.takeWhile=qs,br.tap=Zs,br.throttle=Yc,br.thru=Js,br.toArray=Zl,br.toPairs=Uf,br.toPairsIn=Pf,br.toPath=tp,br.toPlainObject=Xl,br.transform=Rf,br.unary=Qc,br.union=Es,br.unionBy=Cs,br.unionWith=Os,br.uniq=Ms,br.uniqBy=Ns,br.uniqWith=Bs,br.unset=Ff,br.unzip=js,br.unzipWith=Us,br.update=Df,br.updateWith=Wf,br.values=Kf,br.valuesIn=Vf,br.without=Ps,br.words=Ah,br.wrap=Xc,br.xor=Rs,br.xorBy=Fs,br.xorWith=Ds,br.zip=Ws,br.zipObject=Ks,br.zipObjectDeep=Vs,br.zipWith=zs,br.entries=Uf,br.entriesIn=Pf,br.extend=ef,br.extendWith=nf,Ph(br,br),br.add=np,br.attempt=kh,br.camelCase=Jf,br.capitalize=Gf,br.ceil=rp,br.clamp=zf,br.clone=$c,br.cloneDeep=el,br.cloneDeepWith=nl,br.cloneWith=tl,br.conformsTo=rl,br.deburr=Yf,br.defaultTo=qh,br.divide=ip,br.endsWith=Qf,br.eq=il,br.escape=Xf,br.escapeRegExp=Hf,br.every=rc,br.find=oc,br.findIndex=Za,br.findKey=cf,br.findLast=uc,br.findLastIndex=Ja,br.findLastKey=lf,br.floor=op,br.forEach=lc,br.forEachRight=fc,br.forIn=ff,br.forInRight=hf,br.forOwn=pf,br.forOwnRight=df,br.get=mf,br.gt=ol,br.gte=ul,br.has=yf,br.hasIn=wf,br.head=Ha,br.identity=Oh,br.includes=pc,br.indexOf=$a,br.inRange=Lf,br.invoke=Af,br.isArguments=al,br.isArray=sl,br.isArrayBuffer=cl,br.isArrayLike=ll,br.isArrayLikeObject=fl,br.isBoolean=hl,br.isBuffer=pl,br.isDate=dl,br.isElement=vl,br.isEmpty=gl,br.isEqual=ml,br.isEqualWith=yl,br.isError=wl,br.isFinite=_l,br.isFunction=bl,br.isInteger=Al,br.isLength=kl,br.isMap=Sl,br.isMatch=Tl,br.isMatchWith=ql,br.isNaN=El,br.isNative=Cl,br.isNil=Ml,br.isNull=Ol,br.isNumber=Nl,br.isObject=xl,br.isObjectLike=Il,br.isPlainObject=Bl,br.isRegExp=jl,br.isSafeInteger=Ul,br.isSet=Pl,br.isString=Rl,br.isSymbol=Fl,br.isTypedArray=Dl,br.isUndefined=Wl,br.isWeakMap=Kl,br.isWeakSet=Vl,br.join=is,br.kebabCase=$f,br.last=os,br.lastIndexOf=us,br.lowerCase=th,br.lowerFirst=eh,br.lt=zl,br.lte=Ll,br.max=up,br.maxBy=ap,br.mean=sp,br.meanBy=cp,br.min=lp,br.minBy=fp,br.stubArray=Gh,br.stubFalse=Yh,br.stubObject=Qh,br.stubString=Xh,br.stubTrue=Hh,br.multiply=hp,br.nth=as,br.noConflict=Rh,br.noop=Fh,br.now=qc,br.pad=nh,br.padEnd=rh,br.padStart=ih,br.parseInt=oh,br.random=Zf,br.reduce=wc,br.reduceRight=_c,br.repeat=uh,br.replace=ah,br.result=Nf,br.round=pp,br.runInContext=t,br.sample=Ac,br.size=Ic,br.snakeCase=sh,br.some=Sc,br.sortedIndex=gs,br.sortedIndexBy=ms,br.sortedIndexOf=ys,br.sortedLastIndex=ws,br.sortedLastIndexBy=_s,br.sortedLastIndexOf=bs,br.startCase=lh,br.startsWith=fh,br.subtract=dp,br.sum=vp,br.sumBy=gp,br.template=hh,br.times=$h,br.toFinite=Jl,br.toInteger=Gl,br.toLength=Yl,br.toLower=ph,br.toNumber=Ql,br.toSafeInteger=Hl,br.toString=$l,br.toUpper=dh,br.trim=vh,br.trimEnd=gh,br.trimStart=mh,br.truncate=yh,br.unescape=wh,br.uniqueId=ep,br.upperCase=_h,br.upperFirst=bh,br.each=lc,br.eachRight=fc,br.first=Ha,Ph(br,function(){var t={};return Oi(br,(function(e,n){fe.call(br.prototype,n)||(t[n]=e)})),t}(),{chain:!1}),br.VERSION=u,An(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){br[t].placeholder=br})),An(["drop","take"],(function(t,e){Tr.prototype[t]=function(n){n=n===o?1:De(Gl(n),0);var r=this.__filtered__&&!e?new Tr(this):this.clone();return r.__filtered__?r.__takeCount__=We(n,r.__takeCount__):r.__views__.push({size:We(n,D),type:t+(r.__dir__<0?"Right":"")}),r},Tr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),An(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=n==N||n==j;Tr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:zu(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),An(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Tr.prototype[t]=function(){return this[n](1).value()[0]}})),An(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Tr.prototype[t]=function(){return this.__filtered__?new Tr(this):this[n](1)}})),Tr.prototype.compact=function(){return this.filter(Oh)},Tr.prototype.find=function(t){return this.filter(t).head()},Tr.prototype.findLast=function(t){return this.reverse().find(t)},Tr.prototype.invokeMap=bo((function(t,e){return"function"==typeof t?new Tr(this):this.map((function(n){return Vi(n,t,e)}))})),Tr.prototype.reject=function(t){return this.filter(Wc(zu(t)))},Tr.prototype.slice=function(t,e){t=Gl(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Tr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(e=Gl(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},Tr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Tr.prototype.toArray=function(){return this.take(D)},Oi(Tr.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=br[r?"take"+("last"==e?"Right":""):e],u=r||/^find/.test(e);i&&(br.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Tr,c=a[0],l=s||sl(e),f=function(t){var e=i.apply(br,En([t],a));return r&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=this.__chain__,p=!!this.__actions__.length,d=u&&!h,v=s&&!p;if(!u&&l){e=v?e:new Tr(this);var g=t.apply(e,a);return g.__actions__.push({func:Js,args:[f],thisArg:o}),new Sr(g,h)}return d&&v?t.apply(this,a):(g=this.thru(f),d?r?g.value()[0]:g.value():g)})})),An(["pop","push","shift","sort","splice","unshift"],(function(t){var e=ue[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);br.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(sl(i)?i:[],t)}return this[n]((function(n){return e.apply(sl(n)?n:[],t)}))}})),Oi(Tr.prototype,(function(t,e){var n=br[e];if(n){var r=n.name+"";fe.call(cn,r)||(cn[r]=[]),cn[r].push({name:e,func:n})}})),cn[wu(o,_).name]=[{name:"wrapper",func:o}],Tr.prototype.clone=qr,Tr.prototype.reverse=Er,Tr.prototype.value=Cr,br.prototype.at=Gs,br.prototype.chain=Ys,br.prototype.commit=Qs,br.prototype.next=Xs,br.prototype.plant=$s,br.prototype.reverse=tc,br.prototype.toJSON=br.prototype.valueOf=br.prototype.value=ec,br.prototype.first=br.prototype.head,Te&&(br.prototype[Te]=Hs),br},xr=kr();sn._=xr,i=function(){return xr}.call(e,n,e,r),i===o||(r.exports=i)}).call(this)}).call(this,n("c8ba"),n("62e4")(t))},"33e9":function(t,e,n){const r=n("4620"),i=n("b37a");class o{constructor(t,e,n={}){this.criterion=t,this.sample=e,this.getCursorOffset=n.getCursorOffset||(()=>null),this.outOfPage=n.outOfPage,this.bestNode=null,this.fineCursor=null,this.breakingSI=e.notes.length-1,this.zeroNode=i.zero(),this.zeroNode.offset=this.getCursorOffset()||0,this.relocationThreshold=n.relocationThreshold||r.RelocationThreshold}step(t){const e=this.sample.notes[t];if(e.matches.length>0){e.matches.forEach(e=>{e.evaluatePrev(this.zeroNode);for(let n=t-1;n>=Math.max(this.breakingSI+1,t-r.SkipDeep);--n){const i=this.sample.notes[n];console.assert(i,"prevNote is null:",n,t,this.sample.notes),i.matches.forEach(t=>{const n=e.offset-t.offset;n<2/r.LagOffsetCost&&n>-2/r.LeadOffsetCost&&e.evaluatePrev(t)})}if(e.prior=e.totalCost>1.99?-1:e.priorByOffset(this.zeroNode.offset),e.prior>0&&this.outOfPage){const t=this.criterion.notes[e.ci].startTick;this.outOfPage(t)&&(e.prior-=.7)}}),e.matches.sort((t,e)=>e.prior-t.prior),this.cursors=e.matches;let n=null;const i=this.nullSteps(t),o=this.cursors[0];o&&o.totalCost<1&&(o.prior>0||o.totalCost<.4&&Math.log(Math.max(i*o.value,.001))>this.relocationThreshold)&&(this.zeroNode.offset=o.offset,n=o,(!this.bestNode||o.value>this.bestNode.value)&&(this.bestNode=o)),n?this.fineCursor=n:this.resetCursor(t,{breaking:!1})||(this.zeroNode.offset+=e.deltaSi*Math.tanh(i),console.assert(!Number.isNaN(this.zeroNode.offset),"zeroNode.offset is NaN.",e.deltaSi,i))}else this.cursors=[]}path({fromIndex:t=0,toIndex:e=this.sample.notes.length-1}={}){const n=[];let r=null;for(let i=e;i>=t;){const t=this.sample.notes[i];if(!t.matches.length||t.matches[0].prior<-.01||t.matches[0].totalCost>=1){n[i]=-1,--i;continue}null!=r&&(t.matches.forEach(t=>t.backPrior=t.totalCost<1.99?t.priorByOffset(r):-1),t.matches.sort((t,e)=>e.backPrior-t.backPrior));const e=t.matches[0];e.path.forEach((t,e)=>n[e]=t),r=e.root.offset,i=e.rootSi-1}return console.assert(n.length==e+1,"path length error:",n,t,e+1,this.sample.notes.length,this.sample.notes.length?this.sample.notes[this.sample.notes.length-1].index:null),n}nullSteps(t){return t-(this.fineCursor?this.fineCursor.si:-1)-1}resetCursor(t,{breaking:e=!0}={}){e&&(this.breakingSI=t);const n=this.getCursorOffset();return null!=n&&(this.zeroNode.offset=n,this.zeroNode.si=t,this.fineCursor=null,console.assert(!Number.isNaN(this.zeroNode.offset),"zeroNode.offset is NaN.",n),!0)}get relocationTendency(){const t=this.cursors&&this.cursors[0];if(!t)return null;const e=this.nullSteps(t.si);return e<=0?0:Math.log(Math.max(e*t.value,.001))/this.relocationThreshold}}t.exports=o},"3b0d":function(t,e){t.exports=class{constructor(){this.buffer=""}write(t){this.buffer+=t}writeInt32(t){this.buffer+=String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}writeInt16(t){this.buffer+=String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}writeInt8(t){this.buffer+=String.fromCharCode(255&t)}writeVarInt(t){if(t<0)throw new Error("OStream.writeVarInt minus number: "+t);const e=127&t;t>>=7;let n=String.fromCharCode(e);while(t){const e=127&t;t>>=7,n=String.fromCharCode(128|e)+n}this.buffer+=n}getBuffer(){return this.buffer}getArrayBuffer(){return Uint8Array.from(this.buffer.split("").map(t=>t.charCodeAt(0))).buffer}}},"3b97":function(t,e){const n=(t,{timeWarp:e=1}={})=>{const n=[];let r=120;const i=t.header.ticksPerBeat;for(let c=0;c<t.tracks.length;c++)n[c]={nextEventIndex:0,ticksToNextEvent:t.tracks[c].length?t.tracks[c][0].deltaTime:null};function o(){let e=null,r=null,i=null;for(let t=0;t<n.length;t++)null!=n[t].ticksToNextEvent&&(null==e||n[t].ticksToNextEvent<e)&&(e=n[t].ticksToNextEvent,r=t,i=n[t].nextEventIndex);if(null!=r){const o=t.tracks[r][i];t.tracks[r][i+1]?n[r].ticksToNextEvent+=t.tracks[r][i+1].deltaTime:n[r].ticksToNextEvent=null,n[r].nextEventIndex+=1;for(let t=0;t<n.length;t++)null!=n[t].ticksToNextEvent&&(n[t].ticksToNextEvent-=e);return{ticksToEvent:e,event:o,track:r}}return null}let u;const a=[];function s(){function t(){let t=0;if(u.ticksToEvent>0){const e=u.ticksToEvent/i;t=e/(r/60)}"meta"==u.event.type&&"setTempo"==u.event.subtype&&(r=6e7/u.event.microsecondsPerBeat);const n=1e3*t*e||0;a.push([u,n]),u=o()}if(u=o())while(u)t()}return s(),a},r=t=>{const e=new Map;return t.filter(([{event:t,ticksToEvent:n}])=>{if(n>0&&e.clear(),"channel"!==t.type)return!0;const r=`${t.subtype}|${t.channel}|${t.noteNumber}`;return!e.get(r)&&(e.set(r,t),!0)})},i=t=>{const e=new Map,n=new Map,r=[];let i=-1;return t.forEach(([{event:t,ticksToEvent:o}],u)=>{if(o>0&&(i=u),"channel"!==t.type)return;const a=`${t.channel}|${t.noteNumber}`;switch(t.subtype){case"noteOn":e.get(a)?n.set(a,i):e.set(a,i);break;case"noteOff":n.get(a)?(r.push([n.get(a),u]),n.delete(a)):e.delete(a);break}}),r.forEach((t,e)=>{for(let n=e-1;n>=0;--n){const e=r[n];if(e[1]<t[0])break;t[0]>e[0]&&++t[0]}}),r.forEach(([e,n])=>{if(n>=t.length-1||e<0)return;const r=t[n],i=t[n+1],o=t[e];if(!o[0].ticksToEvent)return void console.warn("invalid front index:",e,n,o);const u=o[1]/o[0].ticksToEvent;i[1]+=r[1],i[0].ticksToEvent+=r[0].ticksToEvent,r[0].ticksToEvent=o[0].ticksToEvent-1,o[0].ticksToEvent=1,r[1]=r[0].ticksToEvent*u,o[1]=o[0].ticksToEvent*u,t.splice(n,1),t.splice(e,0,r)}),t};t.exports={midiToSequence:n,trimSequence:r,fixOverlapNotes:i}},4620:function(t,e){t.exports={CostStepAttenuation:.6,SkipDeep:3,PriorDistanceSigmoidFactor:.1,PriorValueSigmoidFactor:.12,SkipCost:.5,LagOffsetCost:1,LeadOffsetCost:1.6,ZeroOffsetCost:.58,RelocationThreshold:6}},"4a2c":function(t,e,n){const r=n("3b0d");t.exports=function({header:t,tracks:e}){function n(t,e,n){console.assert(4===e.length,"chunk id must be 4 byte"),t.write(e),t.writeInt32(n.length),t.write(n)}function i(t,e){if("unknown"!==e.subtype)switch(t.writeVarInt(e.deltaTime),e.type){case"meta":switch(t.writeInt8(255),e.subtype){case"sequenceNumber":t.writeInt8(0),t.writeVarInt(2),t.writeInt16(e.number);break;case"text":t.writeInt8(1),t.writeVarInt(e.text.length),t.write(e.text);break;case"copyrightNotice":t.writeInt8(2),t.writeVarInt(e.text.length),t.write(e.text);break;case"trackName":t.writeInt8(3),t.writeVarInt(e.text.length),t.write(e.text);break;case"instrumentName":t.writeInt8(4),t.writeVarInt(e.text.length),t.write(e.text);break;case"lyrics":t.writeInt8(5),t.writeVarInt(e.text.length),t.write(e.text);break;case"marker":t.writeInt8(6),t.writeVarInt(e.text.length),t.write(e.text);break;case"cuePoint":t.writeInt8(7),t.writeVarInt(e.text.length),t.write(e.text);break;case"midiChannelPrefix":t.writeInt8(32),t.writeVarInt(1),t.writeInt8(e.channel);break;case"endOfTrack":t.writeInt8(47),t.writeVarInt(0);break;case"setTempo":t.writeInt8(81),t.writeVarInt(3),t.writeInt8(e.microsecondsPerBeat>>16&255),t.writeInt8(e.microsecondsPerBeat>>8&255),t.writeInt8(255&e.microsecondsPerBeat);break;case"smpteOffset":t.writeInt8(84),t.writeVarInt(5);var n={24:0,25:32,29:64,30:96}[e.frameRate];t.writeInt8(e.hour|n),t.writeInt8(e.min),t.writeInt8(e.sec),t.writeInt8(e.frame),t.writeInt8(e.subframe);break;case"timeSignature":t.writeInt8(88),t.writeVarInt(4),t.writeInt8(e.numerator),t.writeInt8(Math.log2(e.denominator)),t.writeInt8(e.metronome),t.writeInt8(e.thirtyseconds);break;case"keySignature":t.writeInt8(89),t.writeVarInt(2),t.writeInt8(e.key),t.writeInt8(e.scale);break;case"sequencerSpecific":t.writeInt8(127),t.writeVarInt(e.data.length),t.write(e.data);break;default:throw new Error("unhandled event subtype:"+e.subtype)}break;case"sysEx":t.writeInt8(240),t.writeVarInt(e.data.length),t.write(e.data);break;case"dividedSysEx":t.writeInt8(247),t.writeVarInt(e.data.length),t.write(e.data);break;case"channel":switch(e.subtype){case"noteOn":t.writeInt8(144|e.channel),t.writeInt8(e.noteNumber),t.writeInt8(e.velocity);break;case"noteOff":t.writeInt8(128|e.channel),t.writeInt8(e.noteNumber),t.writeInt8(e.velocity?e.velocity:0);break;case"noteAftertouch":t.writeInt8(160|e.channel),t.writeInt8(e.noteNumber),t.writeInt8(e.amount);break;case"controller":t.writeInt8(176|e.channel),t.writeInt8(e.controllerType),t.writeInt8(e.value);break;case"programChange":t.writeInt8(192|e.channel),t.writeInt8(e.programNumber);break;case"channelAftertouch":t.writeInt8(208|e.channel),t.writeInt8(e.amount);break;case"pitchBend":t.writeInt8(224|e.channel),t.writeInt8(255&e.value),t.writeInt8(e.value>>7&255);break;default:throw new Error("unhandled event subtype:"+e.subtype)}break;default:throw new Error("unhandled event type:"+e.type)}}const o=new r,u=new r;u.writeInt16(t.formatType),u.writeInt16(e.length),u.writeInt16(t.ticksPerBeat),n(o,"MThd",u.getBuffer());for(let a=0;a<e.length;++a){const t=new r;for(let n=0;n<e[a].length;++n)i(t,e[a][n]);n(o,"MTrk",t.getBuffer())}return o.getArrayBuffer()}},"589a":function(t,e){t.exports=class{constructor(t){this.array=new Uint8Array(t),this.position=0}eof(){return this.position>=this.array.length}read(t){const e=this.array.slice(this.position,this.position+t);return this.position+=t,e}readString(t){const e=Array.from(this.read(t));return e.map(t=>String.fromCharCode(t)).join("")}readInt32(){const t=(this.array[this.position]<<24)+(this.array[this.position+1]<<16)+(this.array[this.position+2]<<8)+this.array[this.position+3];return this.position+=4,t}readInt16(){const t=(this.array[this.position]<<8)+this.array[this.position+1];return this.position+=2,t}readInt8(t){let e=this.array[this.position];return t&&e>127&&(e-=256),this.position+=1,e}readVarInt(){let t=0;while(1){const e=this.readInt8();if(!(128&e))return t+e;t+=127&e,t<<=7}}}},"62e4":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},8875:function(t,e,n){var r,i,o;(function(n,u){i=[],r=u,o="function"===typeof r?r.apply(e,i):r,void 0===o||(t.exports=o)})("undefined"!==typeof self&&self,(function(){function t(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(f){var t,e,n,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,i=/@([^@]*):(\d+):(\d+)\s*$/gi,o=r.exec(f.stack)||i.exec(f.stack),u=o&&o[1]||!1,a=o&&o[2]||!1,s=document.location.href.replace(document.location.hash,""),c=document.getElementsByTagName("script");u===s&&(t=document.documentElement.outerHTML,e=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),n=t.replace(e,"$1").trim());for(var l=0;l<c.length;l++){if("interactive"===c[l].readyState)return c[l];if(c[l].src===u)return c[l];if(u===s&&c[l].innerHTML&&c[l].innerHTML.trim()===n)return c[l]}return null}}return t}))},"88c4":function(t,e,n){const r=n("589a");t.exports=function(t){function e(t){const e=t.readString(4),n=t.readInt32();return{id:e,length:n,data:t.read(n)}}let n;function i(t){const e={};e.deltaTime=t.readVarInt();let r=t.readInt8();if(240===(240&r)){if(255!==r){if(240===r){e.type="sysEx";const n=t.readVarInt();return e.data=t.readString(n),e}if(247===r){e.type="dividedSysEx";const n=t.readVarInt();return e.data=t.readString(n),e}throw new Error("Unrecognised MIDI event type byte: "+r)}{e.type="meta";const n=t.readInt8(),r=t.readVarInt();switch(n){case 0:if(e.subtype="sequenceNumber",2!==r)throw new Error("Expected length for sequenceNumber event is 2, got "+r);return e.number=t.readInt16(),e;case 1:return e.subtype="text",e.text=t.readString(r),e;case 2:return e.subtype="copyrightNotice",e.text=t.readString(r),e;case 3:return e.subtype="trackName",e.text=t.readString(r),e;case 4:return e.subtype="instrumentName",e.text=t.readString(r),e;case 5:return e.subtype="lyrics",e.text=t.readString(r),e;case 6:return e.subtype="marker",e.text=t.readString(r),e;case 7:return e.subtype="cuePoint",e.text=t.readString(r),e;case 32:if(e.subtype="midiChannelPrefix",1!==r)throw new Error("Expected length for midiChannelPrefix event is 1, got "+r);return e.channel=t.readInt8(),e;case 47:if(e.subtype="endOfTrack",0!==r)throw new Error("Expected length for endOfTrack event is 0, got "+r);return e;case 81:if(e.subtype="setTempo",3!==r)throw new Error("Expected length for setTempo event is 3, got "+r);return e.microsecondsPerBeat=(t.readInt8()<<16)+(t.readInt8()<<8)+t.readInt8(),e;case 84:if(e.subtype="smpteOffset",5!==r)throw new Error("Expected length for smpteOffset event is 5, got "+r);const n=t.readInt8();return e.frameRate={0:24,32:25,64:29,96:30}[96&n],e.hour=31&n,e.min=t.readInt8(),e.sec=t.readInt8(),e.frame=t.readInt8(),e.subframe=t.readInt8(),e;case 88:if(e.subtype="timeSignature",4!==r)throw new Error("Expected length for timeSignature event is 4, got "+r);return e.numerator=t.readInt8(),e.denominator=Math.pow(2,t.readInt8()),e.metronome=t.readInt8(),e.thirtyseconds=t.readInt8(),e;case 89:if(e.subtype="keySignature",2!==r)throw new Error("Expected length for keySignature event is 2, got "+r);return e.key=t.readInt8(!0),e.scale=t.readInt8(),e;case 127:return e.subtype="sequencerSpecific",e.data=t.readString(r),e;default:return e.subtype="unknown",e.data=t.readString(r),e}}}else{let i;0===(128&r)?(i=r,r=n):(i=t.readInt8(),n=r);const o=r>>4;switch(e.channel=15&r,e.type="channel",o){case 8:return e.subtype="noteOff",e.noteNumber=i,e.velocity=t.readInt8(),e;case 9:return e.noteNumber=i,e.velocity=t.readInt8(),0===e.velocity?e.subtype="noteOff":e.subtype="noteOn",e;case 10:return e.subtype="noteAftertouch",e.noteNumber=i,e.amount=t.readInt8(),e;case 11:return e.subtype="controller",e.controllerType=i,e.value=t.readInt8(),e;case 12:return e.subtype="programChange",e.programNumber=i,e;case 13:return e.subtype="channelAftertouch",e.amount=i,e;case 14:return e.subtype="pitchBend",e.value=i+(t.readInt8()<<7),e;default:throw new Error("Unrecognised MIDI event type: "+o)}}}let o=t;"string"===typeof t&&(o=t.split("").map(t=>t.charCodeAt(0)));const u=new r(o),a=e(u);if("MThd"!==a.id||6!==a.length)throw new Error("Bad .mid file - header not found");const s=new r(a.data),c=s.readInt16(),l=s.readInt16(),f=s.readInt16();let h;if(32768&f)throw new Error("Expressing time division in SMTPE frames is not supported yet");h=f;const p={formatType:c,trackCount:l,ticksPerBeat:h},d=[];for(let v=0;v<p.trackCount;v++){d[v]=[];const t=e(u);if("MTrk"!==t.id)throw new Error("Unexpected chunk - expected MTrk, got "+t.id);const n=new r(t.data);while(!n.eof()){const t=i(n);d[v].push(t)}}return{header:p,tracks:d}}},b37a:function(t,e,n){const{pick:r}=n("2ef0"),i=n("4620");class o{constructor(t,e){this.s_note=t,this.c_note=e,console.assert(null!=this.s_note.softIndex,"s_note softIndex is null"),this.offset=this.s_note.softIndex-this.c_note.softIndex,this._prev=null,this._totalCost=0,this._value=0,this.cacheDirty=!0}get prev(){return this._prev}set prev(t){t!=this._prev&&(this._prev=t,this.cacheDirty=!0)}get si(){return this.s_note.index}get ci(){return this.c_note.index}get root(){return this.prev.root||this}get rootSi(){return this.prev.zero?this.si:this.prev.rootSi}get id(){return`${this.s_note.index},${this.c_note.index}`}static cost(t,e,n){return t*i.CostStepAttenuation+Math.tanh(e*i.SkipCost)+Math.tanh(.5*n)}updateCache(){this.cacheDirty&&(this._totalCost=o.cost(this.prev.totalCost,this.si-this.prev.si-1,this.selfCost),this._value=this.prev.value+1-Math.tanh(.5*this.selfCost),this.cacheDirty=!1)}get totalCost(){return this.updateCache(),this._totalCost}get value(){return this.updateCache(),this._value}get deep(){return this.prev.deep+1}get path(){const t=[];for(let e=this;!e.zero;e=e.prev)t[e.si]=e.ci;for(let e=0;e<t.length;++e)"number"!=typeof t[e]&&(t[e]=-1);return t}dump(){return r(this,["id","si","ci","rootSi","value","deep","rootSi","offset","prior","selfCost","totalCost"])}evaluatePrev(t){const e=this.evaluatePrevCost(t);console.assert(this.si-t.si>=1,"node index error:",this,t);const n=o.cost(t.totalCost,this.si-t.si-1,e);return(!this.prev||n<this.totalCost)&&(this.prev=t,this.selfCost=e,!0)}evaluatePrevCost(t){let e=0;if(null!=t.offset){const n=this.offset-t.offset,r=t.zero?i.ZeroOffsetCost:n>0?i.LagOffsetCost:i.LeadOffsetCost;e+=(n*r)**2}return e}priorByOffset(t){const e=Math.abs(this.offset-t)/1;return Math.tanh(this.value*i.PriorValueSigmoidFactor)-Math.tanh(e*i.PriorDistanceSigmoidFactor)}static zero(){return{zero:!0,totalCost:0,value:0,si:-1,ci:-1,deep:0,offset:0}}}t.exports=o},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},c9c5:function(t,e,n){const r=n("f5f9"),i=t=>{let e=0;t.forEach(t=>{e+=t.deltaTime,t.tick=e})},o=t=>{let e=0;t.sort((t,e)=>t.tick-e.tick).forEach(t=>{t.deltaTime=t.tick-e,e=t.tick})},u=(t,e,n)=>{i(t);const r=[],u={};return t.forEach(t=>{if(t.tick>=e&&t.tick<=n&&"endOfTrack"!==t.subtype)r.push({...t,tick:t.tick-e});else if(t.tick<e)switch(t.type){case"meta":u[t.subtype]=t;break}}),Object.values(u).forEach(t=>r.push({...t,tick:0})),r.push({tick:n-e,type:"meta",subtype:"endOfTrack"}),o(r),r},a=(t,e,n)=>({header:t.header,tracks:t.tracks.map(t=>u(t,e,n))}),s=480,c=["endOfTrack","trackName","noteOn","noteOff"];function l(t,{startTime:e,unclosedNoteDuration:n=3e4}={}){t.microsecondsPerBeat=t.microsecondsPerBeat||5e5;const r=s,i=1e3*r/t.microsecondsPerBeat,o={formatType:0,ticksPerBeat:r},u=[];if(!Number.isFinite(e)){if(!t.notes||!t.notes[0])throw new Error("encodeToMidiData: no start time specificed");e=t.notes[0].start}u.push({time:e,type:"meta",subtype:"copyrightNotice",text:"Composed by MusicWdigets. BUILT on "+new Date(Number("1698047502710")).toDateString()});const a=t.events&&t.events.find(t=>"setTempo"==t.subtype);a||(u.push({time:e,type:"meta",subtype:"timeSignature",numerator:4,denominator:4,thirtyseconds:8}),u.push({time:e,type:"meta",subtype:"setTempo",microsecondsPerBeat:t.microsecondsPerBeat}));let l=e||0;if(t.notes)for(const s of t.notes)u.push({time:s.start,type:"channel",subtype:"noteOn",channel:s.channel||0,noteNumber:s.pitch,velocity:s.velocity,finger:s.finger}),l=Math.max(l,s.start),Number.isFinite(n)&&(s.duration=s.duration||n),s.duration&&(u.push({time:s.start+s.duration,type:"channel",subtype:"noteOff",channel:s.channel||0,noteNumber:s.pitch,velocity:0}),l=Math.max(l,s.start+s.duration));if(t.events){const e=t.events.filter(t=>!c.includes(t.data.subtype));for(const t of e)u.push({time:t.time,...t.data}),l=Math.max(l,t.time)}return u.push({time:l+100,type:"meta",subtype:"endOfTrack"}),u.sort((function(t,e){return t.time-e.time})),u.map((t,e)=>({event:t,index:e})).filter(({event:t})=>"noteOn"==t.subtype&&null!=t.finger).reverse().forEach(({event:t,index:e})=>u.splice(e+1,0,{time:t.time,type:"meta",subtype:"text",text:`fingering(${t.finger})`})),u.forEach(t=>t.ticks=Math.round((t.time-e)*i)),u.forEach((t,e)=>t.deltaTime=t.ticks-(e>0?u[e-1].ticks:0)),{header:o,tracks:[u]}}function f(t,e){const n=l(t,e);return r.encodeMidiFile(n)}t.exports={sliceMidi:a,encodeToMIDIData:l,encodeToMIDI:f}},ee4f:function(t,e,n){const r=n("3b97"),i={64:"Sustain",65:"Portamento",66:"Sostenuto",67:"Soft"};class o{static parseMidi(t,{fixOverlap:e=!0}={}){const n=[],u={},a={},s=[],c=[];let l=0,f=5e3,h=0,p=4,d=0;const v={};let g,m=0,y=0;const w=[],_=t.header.ticksPerBeat;let b=r.midiToSequence(t);e&&(b=r.trimSequence(r.fixOverlapNotes(b)));const A=b.map(t=>({data:t[0].event,track:t[0].track,deltaTime:t[1],deltaTicks:t[0].ticksToEvent}));let k=0;const x=1;for(const r of A){if(m+=r.deltaTicks,y=Math.round(m*x),r.deltaTicks>0){const t=r.deltaTicks/_;for(let e=Math.ceil(h);e<h+t;++e){const t=l+(e-h)*f;c.push({time:t,index:d%p}),++d}h+=t}l+=r.deltaTime,r.time=l,r.ticks=y;const t=r.data;switch(t.type){case"channel":switch(t.subtype){case"noteOn":{const e=t.noteNumber;n.push({channel:t.channel,pitch:e,startTick:y,start:l,velocity:t.velocity,beats:h,track:r.track}),v.low=Math.min(v.low||e,e),r.index=k,++k}break;case"noteOff":{const e=t.noteNumber;s[t.channel]=s[t.channel]||[];const r=n.findIndex(n=>n.channel==t.channel&&n.pitch==e);if(r>=0){const i=n.splice(r,1)[0];s[t.channel].push({channel:t.channel,startTick:i.startTick,endTick:y,pitch:e,start:i.start,duration:l-i.start,velocity:i.velocity,beats:i.beats,track:i.track,finger:i.finger})}else console.debug("unexpected noteOff: ",l,t);v.high=Math.max(v.high||e,e)}break;case"controller":switch(t.controllerType){case 64:case 65:case 66:case 67:const e=i[t.controllerType];u[t.channel]=u[t.channel]||{},a[t.channel]=a[t.channel]||[];const n=u[t.channel][e];n&&a[t.channel].push({type:e,start:n.start,duration:l-n.start,value:n.value}),u[t.channel][e]={start:l,value:t.value};break}break}break;case"meta":switch(t.subtype){case"setTempo":f=t.microsecondsPerBeat/1e3,w.push({tempo:t.microsecondsPerBeat,tick:y,time:l});break;case"timeSignature":p=t.numerator,d=0;break;case"text":if(!g&&/^find-corres:/.test(t.text)){const e=t.text.match(/:([\d\,-]+)/),n=e&&e[1]||"";g=n.split(",").map(t=>Number(t))}else if(/fingering\(.*\)/.test(t.text)){const[e,r]=t.text.match(/\((.+)\)/),i=Number(r);if(!Number.isNaN(i)){const t=n[n.length-1];t&&(t.finger=i);const e=A.find(t=>t.index==k-1);e&&(e.data.finger=i)}}break;case"copyrightNotice":console.log("MIDI copyright:",t.text);break}break}}return n.forEach(t=>{console.debug("unclosed noteOn event at",t.startTick,t),s[t.channel].push({startTick:t.startTick,endTick:y,pitch:t.pitch,start:t.start,duration:l-t.start,velocity:t.velocity,beats:t.beats,track:t.track,finger:t.finger})}),new o({channels:s,keyRange:v,pedals:a,bars:c,endTime:l,endTick:y,correspondences:g,events:A,tempos:w,ticksPerBeat:_,meta:{}})}constructor(t){Object.assign(this,t),this.notes=[];for(const e of this.channels)if(e)for(const t of e)this.notes.push(t);this.notes.sort((function(t,e){return t.start-e.start}));for(const e in this.notes)this.notes[e].index=Number(e);this.duration=this.notes.length>0?this.endTime-this.notes[0].start:0,this.pitchMap=[];for(const e in this.channels)for(const t in this.channels[e]){const n=this.channels[e][t].pitch;this.pitchMap[n]=this.pitchMap[n]||[],this.pitchMap[n].push(this.channels[e][t])}if(this.pitchMap.forEach(t=>t.sort((t,e)=>t.start-e.start)),this.meta.beatInfos)for(let e=0;e<this.meta.beatInfos.length;++e){const t=this.meta.beatInfos[e];if(e>0){const n=this.meta.beatInfos[e-1];t.beatIndex=n.beatIndex+Math.ceil((t.tick-n.tick)/this.ticksPerBeat)}else t.beatIndex=0}{let t=0,e=0,n=5e5;for(const r of this.tempos){const i=r.tick-e;t+=n/1e3*i/this.ticksPerBeat,e=r.tick,n=r.tempo,r.time=t}}}findChordBySoftindex(t,e=.8){return this.notes.filter(n=>Math.abs(n.softIndex-t)<e)}averageTempo(t){t=t||{from:0,to:this.endtick},console.assert(this.tempos,"no tempos."),console.assert(t.to>t.from,"range is invalid:",t);const e=e=>{const n=Math.max(t.from,this.tempos[e].tick),r=e<this.tempos.length-1?Math.min(this.tempos[e+1].tick,t.to):t.to;return Math.max(0,r-n)},n=this.tempos.reduce((t,n,r)=>t+n.tempo*e(r),0),r=n/(t.to-t.from);return 6e7/r}ticksToTime(t){console.assert(Number.isFinite(t),"invalid tick value:",t),console.assert(this.tempos&&this.tempos.length,"no tempos.");const e=this.tempos.findIndex(e=>e.tick>t),n=e<0?this.tempos.length-1:Math.max(e-1,0),r=this.tempos[n];return r.time+(t-r.tick)*r.tempo*.001/this.ticksPerBeat}timeToTicks(t){console.assert(Number.isFinite(t),"invalid time value:",t),console.assert(this.tempos&&this.tempos.length,"no tempos.");const e=this.tempos.findIndex(e=>e.time>t),n=e<0?this.tempos.length-1:Math.max(e-1,0),r=this.tempos[n];return r.tick+(t-r.time)*this.ticksPerBeat/(.001*r.tempo)}tickRangeToTimeRange(t){return console.assert(t.to>=t.from,"invalid tick range:",t),{from:this.ticksToTime(t.from),to:this.ticksToTime(t.to)}}scaleTempo({factor:t,headTempo:e}){console.assert(this.tempos&&this.tempos.length,"[Notation.scaleTempo] tempos is empty."),e&&(t=e/this.tempos[0].tempo),console.assert(Number.isFinite(t)&&t>0,"[Notation.scaleTempo] invalid factor:",t),this.tempos.forEach(e=>{e.tempo*=t,e.time*=t}),this.events.forEach(e=>{e.deltaTime*=t,e.time*=t}),this.notes.forEach(e=>{e.start*=t,e.duration*=t}),this.endTime*=t}}t.exports={Notation:o}},f5f9:function(t,e,n){t.exports={parseMidiData:n("88c4"),encodeMidiFile:n("4a2c")}},fae3:function(t,e,n){"use strict";if(n.r(e),n.d(e,"MIDI",(function(){return u})),n.d(e,"MusicNotation",(function(){return a})),n.d(e,"MidiPlayer",(function(){return c.a})),n.d(e,"Matcher",(function(){return l})),n.d(e,"MidiAudio",(function(){return O})),n.d(e,"MidiUtils",(function(){return M})),"undefined"!==typeof window){var r=window.document.currentScript,i=n("8875");r=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var u=n("f5f9"),a=n("ee4f"),s=n("0a40"),c=n.n(s),l=n("0241");const f={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(t){const e=Math.ceil(3*t.length/4),n=new ArrayBuffer(e);return this.decode(t,n),n},decode:function(t,e){const n=this._keyStr.indexOf(t.charAt(t.length-1)),r=this._keyStr.indexOf(t.charAt(t.length-1));let i,o,u,a,s,c,l,f,h=Math.ceil(3*t.length/4);64===n&&h--,64===r&&h--;let p=0,d=0;for(i=e?new Uint8Array(e):new Uint8Array(h),t=t.replace(/[^A-Za-z0-9+/=]/g,""),p=0;p<h;p+=3)s=this._keyStr.indexOf(t.charAt(d++)),c=this._keyStr.indexOf(t.charAt(d++)),l=this._keyStr.indexOf(t.charAt(d++)),f=this._keyStr.indexOf(t.charAt(d++)),o=s<<2|c>>4,u=(15&c)<<4|l>>2,a=(3&l)<<6|f,i[p]=o,64!==l&&(i[p+1]=u),64!==f&&(i[p+2]=a);return i}};var h=f;const p=window.MIDI||{};window.MIDI=p;const d=function(t){p.api=t.api,p.setVolume=t.setVolume,p.programChange=t.programChange,p.noteOn=t.noteOn,p.noteOff=t.noteOff,p.chordOn=t.chordOn,p.chordOff=t.chordOff,p.stopAllNotes=t.stopAllNotes,p.getInput=t.getInput,p.getOutputs=t.getOutputs};(function(){var t=null,e=null;const n=p.WebMIDI={api:"webmidi"};n.setVolume=function(t,n){e.send([176+t,7,n])},n.programChange=function(t,n){e.send([192+t,n])},n.noteOn=function(t,n,r,i){e.send([144+t,n,r],1e3*i)},n.noteOff=function(t,n,r){e.send([128+t,n,0],1e3*r)},n.chordOn=function(t,n,r,i){for(var o=0;o<n.length;o++){var u=n[o];e.send([144+t,u,r],1e3*i)}},n.chordOff=function(t,n,r){for(var i=0;i<n.length;i++){var o=n[i];e.send([128+t,o,0],1e3*r)}},n.stopAllNotes=function(){for(var t=0;t<16;t++)e.send([176+t,123,0])},n.getInput=function(){return t.getInputs()},n.getOutputs=function(){return t.getOutputs()},n.connect=function(r){d(n),navigator.requestMIDIAccess().then((function(n){t=n;const i=[...t.outputs];e=i[r.outputDeviceIndex||0][1],r.callback&&r.callback()}),(function(){window.AudioContext||window.webkitAudioContext?r.api="webaudio":window.Audio?r.api="audiotag":r.api="flash",p.loadPlugin(r)}))}})(),(window.AudioContext||window.webkitAudioContext)&&function(){if(window.MIDI&&window.MIDI.WebAudio)return void(p.WebAudio=window.MIDI.WebAudio);const t=window.AudioContext||window.webkitAudioContext,e=p.WebAudio={api:"webaudio",pendingInstruments:{}};let n;const r={};let i=127;const o={},u=function(t,e,r,i,u){const a=p.GeneralMIDI.byName[t],s=a.number,c=e[r];if(!p.Soundfont[t][c])return u(t);const l=p.Soundfont[t][c].split(",")[1],f=h.decodeArrayBuffer(l);n.decodeAudioData(f,(function(n){let l=c;while(l.length<3)l+=" ";if("undefined"!==typeof p.loader&&p.loader.update(null,a.instrument+"<br>Processing: "+(r/87*100>>0)+"%<br>"+l),n.id=c,i[r]=n,i.length===e.length){while(i.length){if(n=i.pop(),!n)continue;const t=p.keyToNote[n.id];o[s+""+t]=n}u(t)}}))},a=t=>Math.max(.001*(t-performance.now())+n.currentTime,0);e.setVolume=function(t,e){i=e},e.empty=function(){return!Object.keys(o).length},e.hasPending=function(){return!Object.keys(e.pendingInstruments).length},e.programChange=function(t,e){p.channels[t].instrument=e},e.noteOn=function(t,e,u,s=0){if(!p.channels[t])return;const c=p.channels[t].instrument;if(!o[c+""+e])return;const l=a(s),f=n.createBufferSource();r[t+""+e]=f,f.buffer=o[c+""+e],f.connect(n.destination),n.createGain?f.gainNode=n.createGain():f.gainNode=n.createGainNode();const h=u/127*(i/127)*2-1;return f.gainNode.connect(n.destination),f.gainNode.gain.setTargetAtTime(Math.max(-1,h),n.currentTime,0),f.connect(f.gainNode),f.noteOn?f.noteOn(l):f.start(l),f},e.noteOff=function(t,e,n=0){const i=a(n),o=r[t+""+e];if(o){if(o.gainNode){const t=o.gainNode.gain;t.linearRampToValueAtTime(t.value,i),t.linearRampToValueAtTime(-1,i+.2)}o.noteOff?o.noteOff(i+.3):o.stop(i+.3),delete r[t+""+e]}},e.chordOn=function(t,n,r,i){for(var o,u={},a=0,s=n.length;a<s;a++)u[o=n[a]]=e.noteOn(t,o,r,i);return u},e.chordOff=function(t,n,r){for(var i,o={},u=0,a=n.length;u<a;u++)o[i=n[u]]=e.noteOff(t,i,r);return o},e.stopAllNotes=function(){for(var t in r){var e=0;e<n.currentTime&&(e+=n.currentTime),r[t].gainNode.gain.linearRampToValueAtTime(1,e),r[t].gainNode.gain.linearRampToValueAtTime(0,e+.2),delete r[t]}},e.connect=function(r){d(e),n=new t;const i=[];for(const t in p.keyToNote)i.push(t);const o=[],a={},s=function(t){for(var e in delete a[t],a)break;!e&&r.callback&&r.callback()};for(const t in p.Soundfont){a[t]=!0;for(let e=0;e<i.length;e++)u(t,i,e,o,s)}}}(),window.Audio&&function(){const t=p.AudioTag={api:"audiotag"};for(var e={},n=127,r=-1,i=[],o=[],u={},a=0;a<12;a++)i[a]=new Audio;var s=function(t,e){if(p.channels[t]){var a=p.channels[t].instrument,s=p.GeneralMIDI.byId[a].id,c=u[e];if(c){var l=s+""+c.id,f=(r+1)%i.length,h=i[f];o[f]=l,h.src=p.Soundfont[s][c.id],h.volume=n/127,h.play(),r=f}}},c=function(t,e){if(p.channels[t]){var n=p.channels[t].instrument,a=p.GeneralMIDI.byId[n].id,s=u[e];if(s)for(var c=a+""+s.id,l=0;l<i.length;l++){var f=(l+r+1)%i.length,h=o[f];if(h&&h===c)return i[f].pause(),void(o[f]=null)}}};t.programChange=function(t,e){p.channels[t].instrument=e},t.setVolume=function(t,e){n=e},t.noteOn=function(t,n,r,i){var o=e[n];if(u[o])return i?window.setTimeout((function(){s(t,o)}),1e3*i):void s(t,o)},t.noteOff=function(t,n,r){var i=e[n];if(u[i])return r?setTimeout((function(){c(t,i)}),1e3*r):void c(t,i)},t.chordOn=function(t,n,r,i){for(var o=0;o<n.length;o++){var a=n[o],c=e[a];if(u[c]){if(i)return window.setTimeout((function(){s(t,c)}),1e3*i);s(t,c)}}},t.chordOff=function(t,n,r){for(var i=0;i<n.length;i++){var o=n[i],a=e[o];if(u[a]){if(r)return window.setTimeout((function(){c(t,a)}),1e3*r);c(t,a)}}},t.stopAllNotes=function(){for(var t=0,e=i.length;t<e;t++)i[t].pause()},t.connect=function(n){for(var r in console.log("AudioTag.connect:",n),p.keyToNote)e[p.keyToNote[r]]=r,u[r]={id:r};d(t),n.callback&&n.callback()}}(),p.GeneralMIDI=function(t){var e=function(t){return t.replace(/[^a-z0-9 ]/gi,"").replace(/[ ]/g,"_").toLowerCase()},n={byName:{},byId:{},byCategory:{}};for(var r in t)for(var i=t[r],o=0,u=i.length;o<u;o++){var a=i[o];if(a){var s=parseInt(a.substr(0,a.indexOf(" ")),10);a=a.replace(s+" ",""),n.byId[--s]=n.byName[e(a)]=n.byCategory[e(r)]={id:e(a),instrument:a,number:s,category:r}}}return n}({Piano:["1 Acoustic Grand Piano","2 Bright Acoustic Piano","3 Electric Grand Piano","4 Honky-tonk Piano","5 Electric Piano 1","6 Electric Piano 2","7 Harpsichord","8 Clavinet"],"Chromatic Percussion":["9 Celesta","10 Glockenspiel","11 Music Box","12 Vibraphone","13 Marimba","14 Xylophone","15 Tubular Bells","16 Dulcimer"],Organ:["17 Drawbar Organ","18 Percussive Organ","19 Rock Organ","20 Church Organ","21 Reed Organ","22 Accordion","23 Harmonica","24 Tango Accordion"],Guitar:["25 Acoustic Guitar (nylon)","26 Acoustic Guitar (steel)","27 Electric Guitar (jazz)","28 Electric Guitar (clean)","29 Electric Guitar (muted)","30 Overdriven Guitar","31 Distortion Guitar","32 Guitar Harmonics"],Bass:["33 Acoustic Bass","34 Electric Bass (finger)","35 Electric Bass (pick)","36 Fretless Bass","37 Slap Bass 1","38 Slap Bass 2","39 Synth Bass 1","40 Synth Bass 2"],Strings:["41 Violin","42 Viola","43 Cello","44 Contrabass","45 Tremolo Strings","46 Pizzicato Strings","47 Orchestral Harp","48 Timpani"],Ensemble:["49 String Ensemble 1","50 String Ensemble 2","51 Synth Strings 1","52 Synth Strings 2","53 Choir Aahs","54 Voice Oohs","55 Synth Choir","56 Orchestra Hit"],Brass:["57 Trumpet","58 Trombone","59 Tuba","60 Muted Trumpet","61 French Horn","62 Brass Section","63 Synth Brass 1","64 Synth Brass 2"],Reed:["65 Soprano Sax","66 Alto Sax","67 Tenor Sax","68 Baritone Sax","69 Oboe","70 English Horn","71 Bassoon","72 Clarinet"],Pipe:["73 Piccolo","74 Flute","75 Recorder","76 Pan Flute","77 Blown Bottle","78 Shakuhachi","79 Whistle","80 Ocarina"],"Synth Lead":["81 Lead 1 (square)","82 Lead 2 (sawtooth)","83 Lead 3 (calliope)","84 Lead 4 (chiff)","85 Lead 5 (charang)","86 Lead 6 (voice)","87 Lead 7 (fifths)","88 Lead 8 (bass + lead)"],"Synth Pad":["89 Pad 1 (new age)","90 Pad 2 (warm)","91 Pad 3 (polysynth)","92 Pad 4 (choir)","93 Pad 5 (bowed)","94 Pad 6 (metallic)","95 Pad 7 (halo)","96 Pad 8 (sweep)"],"Synth Effects":["97 FX 1 (rain)","98 FX 2 (soundtrack)","99 FX 3 (crystal)","100 FX 4 (atmosphere)","101 FX 5 (brightness)","102 FX 6 (goblins)","103 FX 7 (echoes)","104 FX 8 (sci-fi)"],Ethnic:["105 Sitar","106 Banjo","107 Shamisen","108 Koto","109 Kalimba","110 Bagpipe","111 Fiddle","112 Shanai"],Percussive:["113 Tinkle Bell","114 Agogo","115 Steel Drums","116 Woodblock","117 Taiko Drum","118 Melodic Tom","119 Synth Drum"],"Sound effects":["120 Reverse Cymbal","121 Guitar Fret Noise","122 Breath Noise","123 Seashore","124 Bird Tweet","125 Telephone Ring","126 Helicopter","127 Applause","128 Gunshot"]}),p.channels=function(){for(var t={},e=0;e<16;e++)t[e]={instrument:0,mute:!1,mono:!1,omni:!1,solo:!1};return t}(),p.pianoKeyOffset=21,p.keyToNote={},p.noteToKey={},function(){for(var t=21,e=108,n=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],r=t;r<=e;r++){var i=(r-12)/12>>0,o=n[r%12]+i;p.keyToNote[o]=r,p.noteToKey[r]=o}}();var v=p;const g={};let m=0;const y=function(t){m++;const e=new Audio,n=t.split(";")[0];e.id="audio",e.setAttribute("preload","auto"),e.setAttribute("audiobuffer",!0),e.addEventListener("error",(function(){g[n]=!1,m--}),!1),e.addEventListener("canplaythrough",(function(){g[n]=!0,m--}),!1),e.src="data:"+t,document.body.appendChild(e)};function w(t){if("undefined"===typeof Audio)return t({});const e=new Audio;if("undefined"===typeof e.canPlayType)return t(g);let n=e.canPlayType('audio/ogg; codecs="vorbis"');n="probably"===n||"maybe"===n;let r=e.canPlayType("audio/mpeg");if(r="probably"===r||"maybe"===r,!n&&!r)return void t(g);n&&y("audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMlAAAAAOyyzPIBHgF2b3JiaXMAAAAAAUAfAABAHwAAQB8AAEAfAACZAU9nZ1MAAAAAAAAAAAAA6p4zJQEAAAANJGeqCj3//////////5ADdm9yYmlzLQAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMTAxMTAxIChTY2hhdWZlbnVnZ2V0KQAAAAABBXZvcmJpcw9CQ1YBAAABAAxSFCElGVNKYwiVUlIpBR1jUFtHHWPUOUYhZBBTiEkZpXtPKpVYSsgRUlgpRR1TTFNJlVKWKUUdYxRTSCFT1jFloXMUS4ZJCSVsTa50FkvomWOWMUYdY85aSp1j1jFFHWNSUkmhcxg6ZiVkFDpGxehifDA6laJCKL7H3lLpLYWKW4q91xpT6y2EGEtpwQhhc+211dxKasUYY4wxxsXiUyiC0JBVAAABAABABAFCQ1YBAAoAAMJQDEVRgNCQVQBABgCAABRFcRTHcRxHkiTLAkJDVgEAQAAAAgAAKI7hKJIjSZJkWZZlWZameZaouaov+64u667t6roOhIasBACAAAAYRqF1TCqDEEPKQ4QUY9AzoxBDDEzGHGNONKQMMogzxZAyiFssLqgQBKEhKwKAKAAAwBjEGGIMOeekZFIi55iUTkoDnaPUUcoolRRLjBmlEluJMYLOUeooZZRCjKXFjFKJscRUAABAgAMAQICFUGjIigAgCgCAMAYphZRCjCnmFHOIMeUcgwwxxiBkzinoGJNOSuWck85JiRhjzjEHlXNOSuekctBJyaQTAAAQ4AAAEGAhFBqyIgCIEwAwSJKmWZomipamiaJniqrqiaKqWp5nmp5pqqpnmqpqqqrrmqrqypbnmaZnmqrqmaaqiqbquqaquq6nqrZsuqoum65q267s+rZru77uqapsm6or66bqyrrqyrbuurbtS56nqqKquq5nqq6ruq5uq65r25pqyq6purJtuq4tu7Js664s67pmqq5suqotm64s667s2rYqy7ovuq5uq7Ks+6os+75s67ru2rrwi65r66os674qy74x27bwy7ouHJMnqqqnqq7rmarrqq5r26rr2rqmmq5suq4tm6or26os67Yry7aumaosm64r26bryrIqy77vyrJui67r66Ys67oqy8Lu6roxzLat+6Lr6roqy7qvyrKuu7ru+7JuC7umqrpuyrKvm7Ks+7auC8us27oxuq7vq7It/KosC7+u+8Iy6z5jdF1fV21ZGFbZ9n3d95Vj1nVhWW1b+V1bZ7y+bgy7bvzKrQvLstq2scy6rSyvrxvDLux8W/iVmqratum6um7Ksq/Lui60dd1XRtf1fdW2fV+VZd+3hV9pG8OwjK6r+6os68Jry8ov67qw7MIvLKttK7+r68ow27qw3L6wLL/uC8uq277v6rrStXVluX2fsSu38QsAABhwAAAIMKEMFBqyIgCIEwBAEHIOKQahYgpCCKGkEEIqFWNSMuakZM5JKaWUFEpJrWJMSuaclMwxKaGUlkopqYRSWiqlxBRKaS2l1mJKqcVQSmulpNZKSa2llGJMrcUYMSYlc05K5pyUklJrJZXWMucoZQ5K6iCklEoqraTUYuacpA46Kx2E1EoqMZWUYgupxFZKaq2kFGMrMdXUWo4hpRhLSrGVlFptMdXWWqs1YkxK5pyUzDkqJaXWSiqtZc5J6iC01DkoqaTUYiopxco5SR2ElDLIqJSUWiupxBJSia20FGMpqcXUYq4pxRZDSS2WlFosqcTWYoy1tVRTJ6XFklKMJZUYW6y5ttZqDKXEVkqLsaSUW2sx1xZjjqGkFksrsZWUWmy15dhayzW1VGNKrdYWY40x5ZRrrT2n1mJNMdXaWqy51ZZbzLXnTkprpZQWS0oxttZijTHmHEppraQUWykpxtZara3FXEMpsZXSWiypxNhirLXFVmNqrcYWW62ltVprrb3GVlsurdXcYqw9tZRrrLXmWFNtBQAADDgAAASYUAYKDVkJAEQBAADGMMYYhEYpx5yT0ijlnHNSKucghJBS5hyEEFLKnINQSkuZcxBKSSmUklJqrYVSUmqttQIAAAocAAACbNCUWByg0JCVAEAqAIDBcTRNFFXVdX1fsSxRVFXXlW3jVyxNFFVVdm1b+DVRVFXXtW3bFn5NFFVVdmXZtoWiqrqybduybgvDqKqua9uybeuorqvbuq3bui9UXVmWbVu3dR3XtnXd9nVd+Bmzbeu2buu+8CMMR9/4IeTj+3RCCAAAT3AAACqwYXWEk6KxwEJDVgIAGQAAgDFKGYUYM0gxphhjTDHGmAAAgAEHAIAAE8pAoSErAoAoAADAOeecc84555xzzjnnnHPOOeecc44xxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY0wAwE6EA8BOhIVQaMhKACAcAABACCEpKaWUUkoRU85BSSmllFKqFIOMSkoppZRSpBR1lFJKKaWUIqWgpJJSSimllElJKaWUUkoppYw6SimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaVUSimllFJKKaWUUkoppRQAYPLgAACVYOMMK0lnhaPBhYasBAByAwAAhRiDEEJpraRUUkolVc5BKCWUlEpKKZWUUqqYgxBKKqmlklJKKbXSQSihlFBKKSWUUkooJYQQSgmhlFRCK6mEUkoHoYQSQimhhFRKKSWUzkEoIYUOQkmllNRCSB10VFIpIZVSSiklpZQ6CKGUklJLLZVSWkqpdBJSKamV1FJqqbWSUgmhpFZKSSWl0lpJJbUSSkklpZRSSymFVFJJJYSSUioltZZaSqm11lJIqZWUUkqppdRSSiWlkEpKqZSSUmollZRSaiGVlEpJKaTUSimlpFRCSamlUlpKLbWUSkmptFRSSaWUlEpJKaVSSksppRJKSqmllFpJKYWSUkoplZJSSyW1VEoKJaWUUkmptJRSSymVklIBAEAHDgAAAUZUWoidZlx5BI4oZJiAAgAAQABAgAkgMEBQMApBgDACAQAAAADAAAAfAABHARAR0ZzBAUKCwgJDg8MDAAAAAAAAAAAAAACAT2dnUwAEAAAAAAAAAADqnjMlAgAAADzQPmcBAQA="),r&&y("audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");const i=(new Date).getTime(),o=window.setInterval((function(){const e=(new Date).getTime(),n=e-i>5e3;m&&!n||(window.clearInterval(o),t(g))}),1)}const _=function(){return this.loaded={},this.loading={},this};_.prototype.add=function(t){const e=this;"string"===typeof t&&(t={src:t});let n=t.srcs;"undefined"===typeof n&&(n=[{src:t.src,verify:t.verify}]);const r=document.getElementsByTagName("head")[0],i=function(t,n){e.loaded[t.src]||n&&"undefined"===typeof window[n]||(e.loaded[t.src]=!0,e.loading[t.src]&&e.loading[t.src](),delete e.loading[t.src],t.callback&&t.callback(),"undefined"!==typeof getNext&&getNext())},o=[],u=function(n){if("string"===typeof n&&(n={src:n,verify:t.verify}),/([\w\d.])$/.test(n.verify))if(n.test=n.verify,"object"===typeof n.test)for(const t in n.test)o.push(n.test[t]);else o.push(n.test);if(e.loaded[n.src])return;const u=document.createElement("script");u.onreadystatechange=function(){"loaded"!==this.readyState&&"complete"!==this.readyState||i(n)},u.onload=function(){i(n)},u.onerror=function(){},u.setAttribute("type","text/javascript"),u.setAttribute("src",n.src),r.appendChild(u),e.loading[n.src]=function(){}},a=function(e){if(e)i(e,e.test);else for(let t=0;t<n.length;t++)i(n[t],n[t].test);let r=!0;for(let t=0;t<o.length;t++){let e=o[t];if(e&&-1!==e.indexOf(".")){e=e.split(".");const t=window[e[0]];if("undefined"===typeof t)continue;2===e.length?"undefined"===typeof t[e[1]]&&(r=!1):3===e.length&&"undefined"===typeof t[e[1]][e[2]]&&(r=!1)}else"undefined"===typeof window[e]&&(r=!1)}!t.strictOrder&&r?t.callback&&t.callback():setTimeout((function(){a(e)}),10)};if(t.strictOrder){let r=-1;const i=function(){if(r++,n[r]){const t=n[r],o=t.src;e.loading[o]?e.loading[o]=function(){t.callback&&t.callback(),i()}:e.loaded[o]?i():(u(t),a(t))}else t.callback&&t.callback()};i()}else{for(let t=0;t<n.length;t++)u(n[t]);a()}};const b=new _;var A=b;function k(t){fetch(t.url,t.data).then(t=>t.text()).then(e=>{t.onload&&t.onload({responseText:e})}).catch(e=>{console.warn("DOMLoader.sendRequest error:",e),t.onerror&&t.onerror(e,!1)})}const x={script:A,sendRequest:k};v.Soundfont=window.MIDI&&window.MIDI.Soundfont||{},window.MIDI=v,v.audioDetect=w;const I=!1,S={};v.loadPlugin=function(t={}){"function"===typeof t&&(t={callback:t});var e=t.instruments||t.instrument||"acoustic_grand_piano";"object"!==typeof e&&(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];"number"===typeof r&&(e[n]=v.GeneralMIDI.byId[r])}if(v.soundfontUrl=t.soundfontUrl||v.soundfontUrl||"./soundfont/",v.audioDetect((function(n){var r="";if(r=T[t.api]?t.api:I&&navigator.requestMIDIAccess?"webmidi":window.webkitAudioContext||window.AudioContext?"webaudio":window.Audio?"audiotag":"flash",!S[r])return;let i;i=t.targetFormat?t.targetFormat:n["audio/ogg"]?"ogg":"mp3",v.lang=r,v.supports=n,S[r](i,e,t)})),!t.callback)return new Promise(e=>t.callback=e)},S.webmidi=function(t,e,n){v.loader&&v.loader.message("Web MIDI API..."),v.WebMIDI.connect(n)},S.flash=function(t,e,n){v.loader&&v.loader.message("Flash API..."),x.script.add({src:n.soundManagerUrl||"./inc/SoundManager2/script/soundmanager2.js",verify:"SoundManager",callback:function(){v.Flash.connect(e,n)}})},S.audiotag=function(t,e,n){v.loader&&v.loader.message("HTML5 Audio API...");const r=C({items:e,getNext(e){v.Soundfont[e]?r.getNext():x.sendRequest({url:v.soundfontUrl+e+"-"+t+".js",onprogress:E,onload(t){q(t.responseText),v.loader&&v.loader.update(null,"Downloading",100),r.getNext()}})},onComplete(){v.AudioTag.connect(n)}})},S.webaudio=function(t,e,n){v.loader&&v.loader.message("Web Audio API...");const r=C({items:e,getNext(n){v.Soundfont[n]?r.getNext():(v.WebAudio.pendingInstruments[e]=!0,x.sendRequest({url:v.soundfontUrl+n+"-"+t+".js",onprogress:E,onload(t){q(t.responseText),v.loader&&v.loader.update(null,"Downloading...",100),r.getNext(),delete v.WebAudio.pendingInstruments[e]},onerror(t){v.loader&&v.loader.update(t,"Download failed."),delete v.WebAudio.pendingInstruments[e]}}))},onComplete(){v.WebAudio.connect(n)}})};const T={webmidi:!0,webaudio:!0,audiotag:!0,flash:!0},q=function(t){var e=document.createElement("script");e.language="javascript",e.type="text/javascript",e.text=t,document.body.appendChild(e)},E=function(t){this.totalSize||(this.getResponseHeader("Content-Length-Raw")?this.totalSize=parseInt(this.getResponseHeader("Content-Length-Raw")):this.totalSize=t.total);const e=this.totalSize?Math.round(t.loaded/this.totalSize*100):"";v.loader&&v.loader.update(null,"Downloading...",e)},C=function(t){const e={queue:[]};for(const n in t.items)t.items.hasOwnProperty(n)&&e.queue.push(t.items[n]);return e.getNext=function(){if(!e.queue.length)return t.onComplete();t.getNext(e.queue.shift())},setTimeout(e.getNext,1),e};v.loadPlugin;var O=v,M=n("c9c5")}})})); | |
//# sourceMappingURL=musicWidgetsBrowser.umd.min.js.map |